{"version":3,"sources":["webpack:///./node_modules/@sentry/utils/esm/memo.js","webpack:///./node_modules/@sentry/utils/esm/time.js","webpack:///./node_modules/@sentry/types/esm/severity.js","webpack:///./node_modules/@sentry/utils/esm/polyfill.js","webpack:///./node_modules/@sentry/utils/esm/error.js","webpack:///./node_modules/@sentry/utils/esm/flags.js","webpack:///./node_modules/@sentry/utils/esm/dsn.js","webpack:///./node_modules/@sentry/utils/esm/enums.js","webpack:///./node_modules/@sentry/utils/esm/logger.js","webpack:///./node_modules/@sentry/utils/esm/supports.js","webpack:///./node_modules/@sentry/utils/esm/instrument.js","webpack:///./node_modules/@sentry/utils/esm/misc.js","webpack:///./node_modules/@sentry/utils/esm/syncpromise.js","webpack:///./node_modules/@sentry/utils/esm/promisebuffer.js","webpack:///./node_modules/@sentry/utils/esm/severity.js","webpack:///./node_modules/@sentry/utils/esm/status.js","webpack:///./node_modules/@sentry/utils/esm/tracing.js","webpack:///./node_modules/@sentry/utils/esm/envelope.js","webpack:///./node_modules/@sentry/utils/esm/ratelimit.js","webpack:///./node_modules/@sentry/hub/esm/scope.js","webpack:///./node_modules/@sentry/hub/esm/session.js","webpack:///./node_modules/@sentry/hub/esm/flags.js","webpack:///./node_modules/@sentry/hub/esm/hub.js","webpack:///./node_modules/@sentry/hub/esm/sessionflusher.js","webpack:///./node_modules/@sentry/minimal/esm/index.js","webpack:///./node_modules/@sentry/core/esm/api.js","webpack:///./node_modules/@sentry/core/esm/flags.js","webpack:///./node_modules/@sentry/core/esm/integration.js","webpack:///./node_modules/@sentry/core/esm/baseclient.js","webpack:///./node_modules/@sentry/core/esm/request.js","webpack:///./node_modules/@sentry/core/esm/transports/noop.js","webpack:///./node_modules/@sentry/core/esm/basebackend.js","webpack:///./node_modules/@sentry/core/esm/transports/base.js","webpack:///./node_modules/@sentry/core/esm/version.js","webpack:///./node_modules/@sentry/core/esm/integrations/functiontostring.js","webpack:///./node_modules/@sentry/core/esm/integrations/inboundfilters.js","webpack:///./node_modules/@sentry/browser/esm/stack-parsers.js","webpack:///./node_modules/@sentry/browser/esm/eventbuilder.js","webpack:///./node_modules/@sentry/browser/esm/flags.js","webpack:///./node_modules/@sentry/browser/esm/transports/utils.js","webpack:///./node_modules/@sentry/utils/esm/async.js","webpack:///./node_modules/@sentry/browser/esm/transports/base.js","webpack:///./node_modules/@sentry/utils/esm/clientreport.js","webpack:///./node_modules/@sentry/browser/esm/transports/fetch.js","webpack:///./node_modules/@sentry/browser/esm/transports/xhr.js","webpack:///./node_modules/@sentry/browser/esm/backend.js","webpack:///./node_modules/@sentry/browser/esm/transports/new-fetch.js","webpack:///./node_modules/@sentry/browser/esm/transports/new-xhr.js","webpack:///./node_modules/@sentry/browser/esm/helpers.js","webpack:///./node_modules/@sentry/browser/esm/integrations/globalhandlers.js","webpack:///./node_modules/@sentry/browser/esm/integrations/trycatch.js","webpack:///./node_modules/@sentry/browser/esm/integrations/breadcrumbs.js","webpack:///./node_modules/@sentry/browser/esm/integrations/linkederrors.js","webpack:///./node_modules/@sentry/browser/esm/integrations/useragent.js","webpack:///./node_modules/@sentry/browser/esm/integrations/dedupe.js","webpack:///./node_modules/@sentry/browser/esm/client.js","webpack:///./node_modules/@sentry/browser/esm/sdk.js","webpack:///./node_modules/@sentry/core/esm/sdk.js","webpack:///./node_modules/@sentry/browser/esm/version.js","webpack:///./node_modules/@sentry/browser/esm/index.js","webpack:///./node_modules/@sentry/utils/esm/global.js","webpack:///./node_modules/@sentry/utils/esm/object.js","webpack:///./node_modules/@sentry/utils/esm/normalize.js","webpack:///./node_modules/@sentry/utils/esm/string.js","webpack:///./node_modules/@sentry/webpack-plugin/src/sentry-webpack.module.js","webpack:///./node_modules/@sentry/utils/esm/node.js","webpack:///./node_modules/@sentry/utils/esm/stacktrace.js","webpack:///./node_modules/@sentry/utils/esm/is.js","webpack:///./node_modules/@sentry/utils/esm/browser.js","webpack:///./node_modules/@sentry/utils/esm/env.js"],"names":["memoBuilder","hasWeakSet","WeakSet","inner","obj","has","add","i","length","push","delete","splice","dateTimestampSource","nowSeconds","Date","now","platformPerformance","module","performance","_","getNodePerformance","timeOrigin","getBrowserPerformance","timestampSource","undefined","dateTimestampInSeconds","bind","timestampInSeconds","threshold","performanceNow","dateNow","timeOriginDelta","Math","abs","timeOriginIsReliable","navigationStart","timing","navigationStartDelta","Severity","setPrototypeOf","Object","__proto__","Array","proto","prop","prototype","hasOwnProperty","call","_super","SentryError","message","_newTarget","this","constructor","_this","name","Error","IS_DEBUG_BUILD","__SENTRY_DEBUG__","DSN_REGEX","dsnToString","dsn","withPassword","host","path","pass","port","projectId","protocol","publicKey","dsnFromComponents","components","user","makeDsn","from","str","match","exec","_a","slice","_b","_c","split","join","pop","projectMatch","dsnFromString","forEach","component","isValidProtocol","isNaN","parseInt","validateDsn","PREFIX","CONSOLE_LEVELS","consoleSandbox","callback","global","originalConsole","console","wrappedLevels","level","originalWrappedFunc","__sentry_original__","keys","makeLogger","enabled","logger","enable","disable","args","_i","arguments","apply","supportsFetch","Headers","Request","Response","e","isNativeFetch","func","test","toString","supportsReferrerPolicy","referrerPolicy","lastHref","handlers","instrumented","instrument","type","originalConsoleMethod","triggerHandlers","instrumentConsole","triggerDOMHandler","globalDOMEventHandler","makeDOMEventHandler","document","addEventListener","target","originalAddEventListener","listener","options","el","handlers_1","__sentry_instrumentation_handlers__","handlerForType","refCount","handler","originalRemoveEventListener","handlers_2","instrumentDOM","xhrproto","XMLHttpRequest","originalOpen","xhr","url","xhrInfo","__sentry_xhr__","method","is","toUpperCase","__sentry_own_request__","onreadystatechangeHandler","readyState","status_code","status","endTimestamp","startTimestamp","onreadystatechange","original","readyStateArgs","originalSend","body","instrumentXHR","fetch","result","doc","createElement","sandbox","hidden","head","appendChild","contentWindow","removeChild","err","warn","supportsNativeFetch","originalFetch","handlerData","fetchData","getFetchMethod","getFetchUrl","then","response","error","instrumentFetch","chrome","isChromePackagedApp","app","runtime","hasHistoryApi","history","pushState","replaceState","oldOnPopState","onpopstate","historyReplacementFunction","originalHistoryFunction","to","String","location","href","_oO","instrumentHistory","_oldOnErrorHandler","onerror","msg","line","column","_oldOnUnhandledRejectionHandler","onunhandledrejection","addInstrumentationHandler","data","e_1","next","done","value","e_1_1","return","fetchArgs","debounceTimerID","lastCapturedEvent","globalListener","event","tagName","isContentEditable","shouldSkipDOMEvent","previous","current","shouldShortcircuitPreviousDebounce","clearTimeout","setTimeout","uuid4","crypto","msCrypto","getRandomValues","arr","Uint16Array","pad","num","v","replace","c","r","random","parseUrl","query","fragment","relative","getFirstException","exception","values","getEventDescription","eventId","event_id","firstException","addExceptionTypeValue","addExceptionMechanism","newMechanism","currentMechanism","mechanism","handled","mergedData","checkOrSetAlreadyCaught","__sentry_captured__","resolvedSyncPromise","resolve","rejectedSyncPromise","reason","reject","SyncPromise","executor","_state","_handlers","_resolve","_setResult","_reject","state","_value","_executeHandlers","cachedHandlers","onfulfilled","onrejected","catch","val","finally","onfinally","isRejected","makePromiseBuffer","limit","buffer","remove","task","indexOf","$","taskProducer","drain","timeout","counter","capturedSetTimeout","item","severityFromString","Warning","isSupportedSeverity","Log","eventStatusFromHttpCode","code","RegExp","createEnvelope","headers","items","serializeEnvelope","envelope","serializedHeaders","JSON","stringify","reduce","acc","itemHeaders","payload","serializedPayload","disabledUntil","limits","category","all","isRateLimited","updateRateLimits","e_2","updatedRateLimits","rateLimitHeader","retryAfterHeader","trim","_d","parameters","headerDelay","delay","_e","_f","e_2_1","header","headerDate","parse","parseRetryAfterHeader","Scope","_notifyingListeners","_scopeListeners","_eventProcessors","_breadcrumbs","_user","_tags","_extra","_contexts","_sdkProcessingMetadata","clone","scope","newScope","_level","_span","_session","_transactionName","_fingerprint","_requestSession","addScopeListener","addEventProcessor","setUser","update","_notifyScopeListeners","getUser","getRequestSession","setRequestSession","requestSession","setTags","tags","setTag","key","setExtras","extras","setExtra","extra","setFingerprint","fingerprint","setLevel","setTransactionName","setTransaction","setContext","context","setSpan","span","getSpan","getTransaction","transaction","setSession","session","getSession","captureContext","updatedScope","contexts","clear","addBreadcrumb","breadcrumb","maxBreadcrumbs","maxCrumbs","min","mergedBreadcrumb","timestamp","clearBreadcrumbs","applyToEvent","hint","trace","getTraceContext","transactionName","_applyFingerprint","breadcrumbs","sdkProcessingMetadata","_notifyEventProcessors","getGlobalEventProcessors","setSDKProcessingMetadata","newData","processors","index","processor","final","isArray","concat","Session","errors","sid","duration","init","ignoreDuration","startingTime","time","started","ipAddress","ip_address","did","id","email","username","release","environment","userAgent","close","toJSON","toISOString","attrs","user_agent","Hub","client","_version","_stack","getStackTop","bindClient","isOlderThan","version","setupIntegrations","pushScope","getScope","getStack","getClient","popScope","withScope","captureException","_lastEventId","finalHint","syntheticException","originalException","_invokeClient","captureMessage","captureEvent","lastEventId","getOptions","beforeBreadcrumb","finalBreadcrumb","configureScope","run","oldHub","makeMain","getIntegration","integration","startSpan","_callExtensionMethod","startTransaction","customSamplingContext","traceHeaders","captureSession","endSession","_sendSessionUpdate","layer","startSession","navigator","currentSession","carrier","getMainCarrier","sentry","__SENTRY__","extensions","hub","registry","getHubFromCarrier","setHubOnCarrier","hasHubOnCarrier","activeDomain","domain","active","registryHubTopStack","_Oo","getHubFromActiveDomain","SessionFlusher","transport","flushTimeout","_pendingAggregates","_isEnabled","_transport","_intervalId","setInterval","flush","_sessionAttrs","sendSessionAggregates","sessionAggregates","sendSession","getSessionAggregates","aggregates","map","clearInterval","incrementSessionStatusCount","_incrementSessionStatusCount","date","sessionStartedTrunc","setSeconds","aggregationCounts","errored","exited","crashed","callOnHub","API","metadata","tunnel","_dsnObject","_tunnel","getDsn","forceEnvelope","getBaseApiEndpoint","getStoreEndpoint","getStoreEndpointWithUrlEncodedAuth","getEnvelopeEndpointWithUrlEncodedAuth","initAPIDetails","initDsn","_getIngestEndpoint","_encodedAuth","sentry_key","sentry_version","_getEnvelopeEndpoint","installedIntegrations","filterDuplicates","integrations","every","accIntegration","defaultIntegrations","userIntegrations","filter","userIntegration","integrationsNames","alwaysLastToRun","getIntegrationsToSetup","setupOnce","log","setupIntegration","_typeof","Symbol","iterator","ALREADY_SEEN_ERROR","BaseClient","backendClass","_integrations","_numProcessing","_backend","_options","_dsn","_process","_getBackend","eventFromException","_captureEvent","promisedEvent","eventFromMessage","_sendSession","getTransport","_isClientDoneProcessing","clientFinished","transportFlushed","initialized","_updateSessionFromEvent","exceptions","exceptions_1","exceptions_1_1","sessionNonTerminal","Number","ticked","interval","_prepareEvent","normalizeDepth","normalizeMaxBreadth","prepared","_applyClientOptions","_applyIntegrationsMetadata","finalScope","evt","normalize","_normalizeEvent","depth","maxBreadth","normalized","b","baseClientNormalized","dist","maxValueLength","request","integrationsArray","sdk","_sendEvent","sendEvent","_processEvent","finalEvent","beforeSend","sampleRate","recordLostEvent","outcome","isTransaction","__sentry__","rv","nullErr","_ensureBeforeSendRv","processedEvent","promise","getSdkMetadataForEnvelopeHeader","api","enhanceEventWithSdkInfo","sdkInfo","packages","createSessionEnvelope","sent_at","NoopTransport","BaseBackend","_setupTransport","_exception","_hint","_message","_newTransport","_experiments","newTransport","env","eventType","transactionSampling","samplingMethod","rate","skippedNormalization","sample_rates","createEventEnvelope","_metadata","send","createTransport","makeRequest","bufferSize","rateLimits","envCategory","getEnvelopeType","getRateLimitReason","statusCode","originalFunctionToString","SDK_VERSION","FunctionToString","Function","DEFAULT_IGNORE_ERRORS","InboundFilters","addGlobalEventProcessor","getCurrentHub","self_1","clientOptions","internalOptions","allowUrls","whitelistUrls","denyUrls","blacklistUrls","ignoreErrors","ignoreInternal","_mergeOptions","_isSentryError","oO","_getPossibleEventMessages","some","pattern","_isIgnoredError","_getEventFilterUrl","_isDeniedUrl","_isAllowedUrl","_shouldDropEvent","_getLastValidUrl","frames","frame","filename","stacktrace","frames_1","UNKNOWN_FUNCTION","createFrame","lineno","colno","function","in_app","chromeRegex","chromeEvalRegex","chromeStackParser","parts","subMatch","extractSafariExtensionDetails","geckoREgex","geckoEvalRegex","geckoStackParser","winjsRegex","winjsStackParser","opera10Regex","opera10StackParser","opera11Regex","opera11StackParser","isSafariExtension","isSafariWebExtension","exceptionFromError","ex","parseStackFrames","extractMessage","eventFromError","stack","popSize","framesToPop","reactMinifiedRegexp","getPopSize","eventFromUnknownInput","attachStacktrace","isUnhandledRejection","domException","name_1","eventFromString","__serialized__","eventFromPlainObject","synthetic","input","frames_2","cachedFetchImpl","getNativeFetchImplementation","fetchImpl","sendReport","sendBeacon","fetch_1","credentials","keepalive","requestTypeToCategory","ty","BaseTransport","_buffer","_rateLimits","_outcomes","_api","sendClientReports","visibilityState","_flushOutcomes","_sendRequest","useEnvelope","JSONStringifyError","newErr","innerErr","req","eventToSentryRequest","sessionToSentryRequest","outcomes","discarded_events","discardedEvents","quantity","_handleResponse","requestType","_isRateLimited","_disabledUntil","FetchTransport","_fetch","sentryRequest","originalPayload","Promise","fetchParameters","assign","get","XHRTransport","getResponseHeader","open","setRequestHeader","BrowserBackend","Info","nativeFetch","transportOptions","requestOptions","text","statusText","makeNewXHRTransport","ignoreOnError","shouldIgnoreOnError","ignoreNextOnError","wrap","fn","before","wrapper","__sentry_wrapped__","sentryWrapped","wrappedArguments","arg","property","getOwnPropertyDescriptor","configurable","defineProperty","injectReportDialog","script","async","src","dsnLike","dialogOptions","endpoint","encodedOptions","encodeURIComponent","getReportDialogEndpoint","onLoad","onload","injectionPoint","GlobalHandlers","_installFunc","_installGlobalOnErrorHandler","_installGlobalOnUnhandledRejectionHandler","stackTraceLimit","installFunc","getHubAndAttachStacktrace","ERROR_TYPES_RE","groups","_enhanceEventWithInitialFrame","_eventFromIncompleteOnError","addMechanismAndCapture","detail","ev","ev0","ev0s","ev0sf","DEFAULT_EVENT_TARGET","TryCatch","eventTarget","requestAnimationFrame","_wrapTimeFunction","_wrapRAF","_wrapXHR","eventTargetOption","_wrapEventTarget","originalCallback","xmlHttpRequestProps","wrapOptions","originalFunction","eventName","handleEvent","wrappedEventHandler","originalEventHandler","Breadcrumbs","dom","addSentryBreadcrumb","_consoleBreadcrumb","_innerDomBreadcrumb","keyAttrs","serializeAttribute","_domBreadcrumb","_xhrBreadcrumb","_fetchBreadcrumb","_historyBreadcrumb","parsedLoc","parsedFrom","parsedTo","LinkedErrors","_key","_limit","self","linkedErrors","_walkErrorTree","_handler","UserAgent","referrer","Referer","Dedupe","currentEvent","previousEvent","currentMessage","previousMessage","_isSameFingerprint","_isSameStacktrace","_isSameMessageEvent","previousException","_getExceptionFromEvent","currentException","_isSameExceptionEvent","_previousEvent","currentFrames","_getFramesFromEvent","previousFrames","frameA","frameB","currentFingerprint","previousFingerprint","BrowserClient","showReportDialog","platform","window_1","SENTRY_RELEASE","autoSessionTracking","clientClass","debug","initialScope","initAndBind","startSessionOnHub","startSessionTracking","windowIntegrations","_window","Sentry","Integrations","fallbackGlobalObject","getGlobalObject","window","getGlobalSingleton","creator","fill","source","replacementFactory","wrapped","markFunctionWrapped","addNonEnumerableProperty","writable","getOriginalFunction","urlEncode","object","convertToPlainObject","newObj","getOwnProperties","event_1","serializeEventTarget","currentTarget","CustomEvent","extractedProps","extractExceptionKeysForMessage","maxLength","sort","includedKeys","serialized","dropUndefinedKeys","maxProperties","Infinity","visit","ERROR","normalizeToSize","maxSize","encodeURI","utf8Length","memo","memoize","unmemoize","valueWithToJSON","includes","stringified","_events","getPrototypeOf","stringifyValue","startsWith","numAdded","visitable","visitKey","visitValue","truncate","max","substr","snipLine","newLine","lineLength","start","end","safeJoin","delimiter","output","isMatchingPattern","_global","SENTRY_RELEASES","isNodeEnv","process","dynamicRequire","mod","require","createStackParser","parsers","sortedParsers","a","p","skipFirst","sortedParsers_1","sortedParsers_1_1","parser","stripSentryFramesAndReverse","localStack","firstFrameFunction","lastFrameFunction","reverse","defaultFunctionName","getFunctionName","objectToString","isError","wat","isInstanceOf","isBuiltin","isErrorEvent","isDOMError","isDOMException","isString","isPrimitive","isPlainObject","isEvent","Event","isElement","Element","isRegExp","isThenable","Boolean","isSyntheticEvent","base","htmlTreeAsString","elem","currentElem","out","height","len","sepLength","nextStr","_htmlElementAsString","parentNode","className","classes","attr","toLowerCase","keyAttrPairs","keyAttr","getAttribute","keyAttrPair","allowedAttrs","getLocationHref","isBrowserBundle","__SENTRY_BROWSER_BUNDLE__"],"mappings":"2FAOO,SAASA,IACd,IAAIC,EAAgC,oBAAZC,QACpBC,EAAQF,EAAa,IAAIC,QAAY,GAsCzC,MAAO,CApCP,SAAiBE,GACf,GAAIH,EACF,QAAIE,EAAME,IAAID,KAIdD,EAAMG,IAAIF,IACH,GAIT,IAAK,IAAIG,EAAI,EAAGA,EAAIJ,EAAMK,OAAQD,IAAK,CAGrC,GAFYJ,EAAMI,KAEJH,EACZ,OAAO,CAEX,CAGA,OADAD,EAAMM,KAAKL,IACJ,CACT,EAEA,SAAmBA,GACjB,GAAIH,EACFE,EAAMO,OAAON,QAEb,IAAK,IAAIG,EAAI,EAAGA,EAAIJ,EAAMK,OAAQD,IAChC,GAAIJ,EAAMI,KAAOH,EAAK,CACpBD,EAAMQ,OAAOJ,EAAG,GAChB,KACF,CAGN,EAGF,CAhDA,iC,oCCAA,oGAUIK,EAAsB,CACxBC,WAAY,WACV,OAAOC,KAAKC,MAAQ,GACtB,GAgEF,IAAIC,EAAsB,cAb1B,WACE,IAEE,OADgB,YAAeC,EAAQ,cACtBC,WAGnB,CAFE,MAAOC,GACP,MACF,CACF,CAMwCC,GAvDxC,WACE,IAAIF,EAAc,cAAkBA,YAEpC,GAAKA,GAAgBA,EAAYH,IA0BjC,MAAO,CACLA,IAAK,WACH,OAAOG,EAAYH,KACrB,EACAM,WALeP,KAAKC,MAAQG,EAAYH,MAO5C,CAoB+DO,GAC3DC,OAA0CC,IAAxBR,EAAoCJ,EAAsB,CAC9EC,WAAY,WACV,OAAQG,EAAoBK,WAAaL,EAAoBD,OAAS,GACxE,GAMSU,EAAyBb,EAAoBC,WAAWa,KAAKd,GAa7De,EAAqBJ,EAAgBV,WAAWa,KAAKH,IAkBtB,WAIxC,IAAIL,EAAc,cAAkBA,YAEpC,GAAKA,GAAgBA,EAAYH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2B,EAASnT,QAAO,SAAUme,GACzE,OAAOd,EAAKe,aAAaD,EAC3B,IAAGxgB,KAAI,SAAUwgB,GACf,MAAO,CAACA,EAASd,EAAKe,aAAaD,GACrC,IAAK,KAEL,GAAID,GAAgBA,EAAaphC,OAC/BohC,EAAar8B,SAAQ,SAAUw8B,GAC7Bd,EAAIxgC,KAAK,IAAMshC,EAAY,GAAK,KAAQA,EAAY,GAAK,KAC3D,SASA,GAPIhB,EAAKjlB,IACPmlB,EAAIxgC,KAAK,IAAMsgC,EAAKjlB,KAItB0lB,EAAYT,EAAKS,YAEA,YAASA,GAGxB,IAFAC,EAAUD,EAAUt8B,MAAM,OAErB3E,EAAI,EAAGA,EAAIkhC,EAAQjhC,OAAQD,IAC9B0gC,EAAIxgC,KAAK,IAAMghC,EAAQlhC,IAK7B,IAAIyhC,EAAe,CAAC,OAAQ,OAAQ,QAAS,OAE7C,IAAKzhC,EAAI,EAAGA,EAAIyhC,EAAaxhC,OAAQD,IACnCyX,EAAMgqB,EAAazhC,IACnBmhC,EAAOX,EAAKe,aAAa9pB,KAGvBipB,EAAIxgC,KAAK,IAAMuX,EAAM,KAAQ0pB,EAAO,MAIxC,OAAOT,EAAI97B,KAAK,GAClB,CAMO,SAAS88B,IACd,IAAIh8B,EAAS,cAEb,IACE,OAAOA,EAAOuC,SAAS0E,SAASC,IAGlC,CAFE,MAAOse,GACP,MAAO,EACT,CACF,C,kCCnGO,SAASyW,IACd,MAA4C,qBAA9BC,6BAA+CA,yBAC/D,CAtBA,iC","file":"js/sentry-4a96916691b49599d8c3.chunk.js","sourcesContent":["/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\n/**\n * Helper to decycle json objects\n */\nexport function memoBuilder() {\n var hasWeakSet = typeof WeakSet === 'function';\n var inner = hasWeakSet ? new WeakSet() : [];\n\n function memoize(obj) {\n if (hasWeakSet) {\n if (inner.has(obj)) {\n return true;\n }\n\n inner.add(obj);\n return false;\n } // eslint-disable-next-line @typescript-eslint/prefer-for-of\n\n\n for (var i = 0; i < inner.length; i++) {\n var value = inner[i];\n\n if (value === obj) {\n return true;\n }\n }\n\n inner.push(obj);\n return false;\n }\n\n function unmemoize(obj) {\n if (hasWeakSet) {\n inner.delete(obj);\n } else {\n for (var i = 0; i < inner.length; i++) {\n if (inner[i] === obj) {\n inner.splice(i, 1);\n break;\n }\n }\n }\n }\n\n return [memoize, unmemoize];\n}","import { getGlobalObject } from './global';\nimport { dynamicRequire, isNodeEnv } from './node';\n/**\n * A TimestampSource implementation for environments that do not support the Performance Web API natively.\n *\n * Note that this TimestampSource does not use a monotonic clock. A call to `nowSeconds` may return a timestamp earlier\n * than a previously returned value. We do not try to emulate a monotonic behavior in order to facilitate debugging. It\n * is more obvious to explain \"why does my span have negative duration\" than \"why my spans have zero duration\".\n */\n\nvar dateTimestampSource = {\n nowSeconds: function nowSeconds() {\n return Date.now() / 1000;\n }\n};\n/**\n * Returns a wrapper around the native Performance API browser implementation, or undefined for browsers that do not\n * support the API.\n *\n * Wrapping the native API works around differences in behavior from different browsers.\n */\n\nfunction getBrowserPerformance() {\n var performance = getGlobalObject().performance;\n\n if (!performance || !performance.now) {\n return undefined;\n } // Replace performance.timeOrigin with our own timeOrigin based on Date.now().\n //\n // This is a partial workaround for browsers reporting performance.timeOrigin such that performance.timeOrigin +\n // performance.now() gives a date arbitrarily in the past.\n //\n // Additionally, computing timeOrigin in this way fills the gap for browsers where performance.timeOrigin is\n // undefined.\n //\n // The assumption that performance.timeOrigin + performance.now() ~= Date.now() is flawed, but we depend on it to\n // interact with data coming out of performance entries.\n //\n // Note that despite recommendations against it in the spec, browsers implement the Performance API with a clock that\n // might stop when the computer is asleep (and perhaps under other circumstances). Such behavior causes\n // performance.timeOrigin + performance.now() to have an arbitrary skew over Date.now(). In laptop computers, we have\n // observed skews that can be as long as days, weeks or months.\n //\n // See https://github.com/getsentry/sentry-javascript/issues/2590.\n //\n // BUG: despite our best intentions, this workaround has its limitations. It mostly addresses timings of pageload\n // transactions, but ignores the skew built up over time that can aversely affect timestamps of navigation\n // transactions of long-lived web pages.\n\n\n var timeOrigin = Date.now() - performance.now();\n return {\n now: function now() {\n return performance.now();\n },\n timeOrigin: timeOrigin\n };\n}\n/**\n * Returns the native Performance API implementation from Node.js. Returns undefined in old Node.js versions that don't\n * implement the API.\n */\n\n\nfunction getNodePerformance() {\n try {\n var perfHooks = dynamicRequire(module, 'perf_hooks');\n return perfHooks.performance;\n } catch (_) {\n return undefined;\n }\n}\n/**\n * The Performance API implementation for the current platform, if available.\n */\n\n\nvar platformPerformance = isNodeEnv() ? getNodePerformance() : getBrowserPerformance();\nvar timestampSource = platformPerformance === undefined ? dateTimestampSource : {\n nowSeconds: function nowSeconds() {\n return (platformPerformance.timeOrigin + platformPerformance.now()) / 1000;\n }\n};\n/**\n * Returns a timestamp in seconds since the UNIX epoch using the Date API.\n */\n\nexport var dateTimestampInSeconds = dateTimestampSource.nowSeconds.bind(dateTimestampSource);\n/**\n * Returns a timestamp in seconds since the UNIX epoch using either the Performance or Date APIs, depending on the\n * availability of the Performance API.\n *\n * See `usingPerformanceAPI` to test whether the Performance API is used.\n *\n * BUG: Note that because of how browsers implement the Performance API, the clock might stop when the computer is\n * asleep. This creates a skew between `dateTimestampInSeconds` and `timestampInSeconds`. The\n * skew can grow to arbitrary amounts like days, weeks or months.\n * See https://github.com/getsentry/sentry-javascript/issues/2590.\n */\n\nexport var timestampInSeconds = timestampSource.nowSeconds.bind(timestampSource); // Re-exported with an old name for backwards-compatibility.\n\nexport var timestampWithMs = timestampInSeconds;\n/**\n * A boolean that is true when timestampInSeconds uses the Performance API to produce monotonic timestamps.\n */\n\nexport var usingPerformanceAPI = platformPerformance !== undefined;\n/**\n * Internal helper to store what is the source of browserPerformanceTimeOrigin below. For debugging only.\n */\n\nexport var _browserPerformanceTimeOriginMode;\n/**\n * The number of milliseconds since the UNIX epoch. This value is only usable in a browser, and only when the\n * performance API is available.\n */\n\nexport var browserPerformanceTimeOrigin = function () {\n // Unfortunately browsers may report an inaccurate time origin data, through either performance.timeOrigin or\n // performance.timing.navigationStart, which results in poor results in performance data. We only treat time origin\n // data as reliable if they are within a reasonable threshold of the current time.\n var performance = getGlobalObject().performance;\n\n if (!performance || !performance.now) {\n _browserPerformanceTimeOriginMode = 'none';\n return undefined;\n }\n\n var threshold = 3600 * 1000;\n var performanceNow = performance.now();\n var dateNow = Date.now(); // if timeOrigin isn't available set delta to threshold so it isn't used\n\n var timeOriginDelta = performance.timeOrigin ? Math.abs(performance.timeOrigin + performanceNow - dateNow) : threshold;\n var timeOriginIsReliable = timeOriginDelta < threshold; // While performance.timing.navigationStart is deprecated in favor of performance.timeOrigin, performance.timeOrigin\n // is not as widely supported. Namely, performance.timeOrigin is undefined in Safari as of writing.\n // Also as of writing, performance.timing is not available in Web Workers in mainstream browsers, so it is not always\n // a valid fallback. In the absence of an initial time provided by the browser, fallback to the current time from the\n // Date API.\n // eslint-disable-next-line deprecation/deprecation\n\n var navigationStart = performance.timing && performance.timing.navigationStart;\n var hasNavigationStart = typeof navigationStart === 'number'; // if navigationStart isn't available set delta to threshold so it isn't used\n\n var navigationStartDelta = hasNavigationStart ? Math.abs(navigationStart + performanceNow - dateNow) : threshold;\n var navigationStartIsReliable = navigationStartDelta < threshold;\n\n if (timeOriginIsReliable || navigationStartIsReliable) {\n // Use the more reliable time origin\n if (timeOriginDelta <= navigationStartDelta) {\n _browserPerformanceTimeOriginMode = 'timeOrigin';\n return performance.timeOrigin;\n } else {\n _browserPerformanceTimeOriginMode = 'navigationStart';\n return navigationStart;\n }\n } // Either both timeOrigin and navigationStart are skewed or neither is available, fallback to Date.\n\n\n _browserPerformanceTimeOriginMode = 'dateNow';\n return dateNow;\n}();","/**\n * TODO(v7): Remove this enum and replace with SeverityLevel\n */\nexport var Severity;\n\n(function (Severity) {\n /** JSDoc */\n Severity[\"Fatal\"] = \"fatal\";\n /** JSDoc */\n\n Severity[\"Error\"] = \"error\";\n /** JSDoc */\n\n Severity[\"Warning\"] = \"warning\";\n /** JSDoc */\n\n Severity[\"Log\"] = \"log\";\n /** JSDoc */\n\n Severity[\"Info\"] = \"info\";\n /** JSDoc */\n\n Severity[\"Debug\"] = \"debug\";\n /** JSDoc */\n\n Severity[\"Critical\"] = \"critical\";\n})(Severity || (Severity = {})); // TODO: in v7, these can disappear, because they now also exist in `@sentry/utils`. (Having them there rather than here\n// is nice because then it enforces the idea that only types are exported from `@sentry/types`.)\n\n\nexport var SeverityLevels = ['fatal', 'error', 'warning', 'log', 'info', 'debug', 'critical'];","export var setPrototypeOf = Object.setPrototypeOf || ({\n __proto__: []\n} instanceof Array ? setProtoOf : mixinProperties);\n/**\n * setPrototypeOf polyfill using __proto__\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\n\nfunction setProtoOf(obj, proto) {\n // @ts-ignore __proto__ does not exist on obj\n obj.__proto__ = proto;\n return obj;\n}\n/**\n * setPrototypeOf polyfill using mixin\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\n\n\nfunction mixinProperties(obj, proto) {\n for (var prop in proto) {\n if (!Object.prototype.hasOwnProperty.call(obj, prop)) {\n // @ts-ignore typescript complains about indexing so we remove\n obj[prop] = proto[prop];\n }\n }\n\n return obj;\n}","import { __extends } from \"tslib\";\nimport { setPrototypeOf } from './polyfill';\n/** An error emitted by Sentry SDKs and related utilities. */\n\nvar SentryError = function (_super) {\n __extends(SentryError, _super);\n\n function SentryError(message) {\n var _newTarget = this.constructor;\n\n var _this = _super.call(this, message) || this;\n\n _this.message = message;\n _this.name = _newTarget.prototype.constructor.name;\n setPrototypeOf(_this, _newTarget.prototype);\n return _this;\n }\n\n return SentryError;\n}(Error);\n\nexport { SentryError };","/*\n * This file defines flags and constants that can be modified during compile time in order to facilitate tree shaking\n * for users.\n *\n * Debug flags need to be declared in each package individually and must not be imported across package boundaries,\n * because some build tools have trouble tree-shaking imported guards.\n *\n * As a convention, we define debug flags in a `flags.ts` file in the root of a package's `src` folder.\n *\n * Debug flag files will contain \"magic strings\" like `__SENTRY_DEBUG__` that may get replaced with actual values during\n * our, or the user's build process. Take care when introducing new flags - they must not throw if they are not\n * replaced.\n */\n\n/** Flag that is true for debug builds, false otherwise. */\nexport var IS_DEBUG_BUILD = typeof __SENTRY_DEBUG__ === 'undefined' ? true : __SENTRY_DEBUG__;","import { __read } from \"tslib\";\nimport { SentryError } from './error';\nimport { IS_DEBUG_BUILD } from './flags';\n/** Regular expression used to parse a Dsn. */\n\nvar DSN_REGEX = /^(?:(\\w+):)\\/\\/(?:(\\w+)(?::(\\w+))?@)([\\w.-]+)(?::(\\d+))?\\/(.+)/;\n\nfunction isValidProtocol(protocol) {\n return protocol === 'http' || protocol === 'https';\n}\n/**\n * Renders the string representation of this Dsn.\n *\n * By default, this will render the public representation without the password\n * component. To get the deprecated private representation, set `withPassword`\n * to true.\n *\n * @param withPassword When set to true, the password will be included.\n */\n\n\nexport function dsnToString(dsn, withPassword) {\n if (withPassword === void 0) {\n withPassword = false;\n }\n\n var host = dsn.host,\n path = dsn.path,\n pass = dsn.pass,\n port = dsn.port,\n projectId = dsn.projectId,\n protocol = dsn.protocol,\n publicKey = dsn.publicKey;\n return protocol + \"://\" + publicKey + (withPassword && pass ? \":\" + pass : '') + (\"@\" + host + (port ? \":\" + port : '') + \"/\" + (path ? path + \"/\" : path) + projectId);\n}\n\nfunction dsnFromString(str) {\n var match = DSN_REGEX.exec(str);\n\n if (!match) {\n throw new SentryError(\"Invalid Sentry Dsn: \" + str);\n }\n\n var _a = __read(match.slice(1), 6),\n protocol = _a[0],\n publicKey = _a[1],\n _b = _a[2],\n pass = _b === void 0 ? '' : _b,\n host = _a[3],\n _c = _a[4],\n port = _c === void 0 ? '' : _c,\n lastPath = _a[5];\n\n var path = '';\n var projectId = lastPath;\n var split = projectId.split('/');\n\n if (split.length > 1) {\n path = split.slice(0, -1).join('/');\n projectId = split.pop();\n }\n\n if (projectId) {\n var projectMatch = projectId.match(/^\\d+/);\n\n if (projectMatch) {\n projectId = projectMatch[0];\n }\n }\n\n return dsnFromComponents({\n host: host,\n pass: pass,\n path: path,\n projectId: projectId,\n port: port,\n protocol: protocol,\n publicKey: publicKey\n });\n}\n\nfunction dsnFromComponents(components) {\n // TODO this is for backwards compatibility, and can be removed in a future version\n if ('user' in components && !('publicKey' in components)) {\n components.publicKey = components.user;\n }\n\n return {\n user: components.publicKey || '',\n protocol: components.protocol,\n publicKey: components.publicKey || '',\n pass: components.pass || '',\n host: components.host,\n port: components.port || '',\n path: components.path || '',\n projectId: components.projectId\n };\n}\n\nfunction validateDsn(dsn) {\n if (!IS_DEBUG_BUILD) {\n return;\n }\n\n var port = dsn.port,\n projectId = dsn.projectId,\n protocol = dsn.protocol;\n var requiredComponents = ['protocol', 'publicKey', 'host', 'projectId'];\n requiredComponents.forEach(function (component) {\n if (!dsn[component]) {\n throw new SentryError(\"Invalid Sentry Dsn: \" + component + \" missing\");\n }\n });\n\n if (!projectId.match(/^\\d+$/)) {\n throw new SentryError(\"Invalid Sentry Dsn: Invalid projectId \" + projectId);\n }\n\n if (!isValidProtocol(protocol)) {\n throw new SentryError(\"Invalid Sentry Dsn: Invalid protocol \" + protocol);\n }\n\n if (port && isNaN(parseInt(port, 10))) {\n throw new SentryError(\"Invalid Sentry Dsn: Invalid port \" + port);\n }\n\n return true;\n}\n/** The Sentry Dsn, identifying a Sentry instance and project. */\n\n\nexport function makeDsn(from) {\n var components = typeof from === 'string' ? dsnFromString(from) : dsnFromComponents(from);\n validateDsn(components);\n return components;\n}","export var SeverityLevels = ['fatal', 'error', 'warning', 'log', 'info', 'debug', 'critical'];","import { __read, __spread } from \"tslib\";\nimport { IS_DEBUG_BUILD } from './flags';\nimport { getGlobalObject, getGlobalSingleton } from './global'; // TODO: Implement different loggers for different environments\n\nvar global = getGlobalObject();\n/** Prefix for logging strings */\n\nvar PREFIX = 'Sentry Logger ';\nexport var CONSOLE_LEVELS = ['debug', 'info', 'warn', 'error', 'log', 'assert'];\n/**\n * Temporarily disable sentry console instrumentations.\n *\n * @param callback The function to run against the original `console` messages\n * @returns The results of the callback\n */\n\nexport function consoleSandbox(callback) {\n var global = getGlobalObject();\n\n if (!('console' in global)) {\n return callback();\n }\n\n var originalConsole = global.console;\n var wrappedLevels = {}; // Restore all wrapped console methods\n\n CONSOLE_LEVELS.forEach(function (level) {\n // TODO(v7): Remove this check as it's only needed for Node 6\n var originalWrappedFunc = originalConsole[level] && originalConsole[level].__sentry_original__;\n\n if (level in global.console && originalWrappedFunc) {\n wrappedLevels[level] = originalConsole[level];\n originalConsole[level] = originalWrappedFunc;\n }\n });\n\n try {\n return callback();\n } finally {\n // Revert restoration to wrapped state\n Object.keys(wrappedLevels).forEach(function (level) {\n originalConsole[level] = wrappedLevels[level];\n });\n }\n}\n\nfunction makeLogger() {\n var enabled = false;\n var logger = {\n enable: function enable() {\n enabled = true;\n },\n disable: function disable() {\n enabled = false;\n }\n };\n\n if (IS_DEBUG_BUILD) {\n CONSOLE_LEVELS.forEach(function (name) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n logger[name] = function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n if (enabled) {\n consoleSandbox(function () {\n var _a;\n\n (_a = global.console)[name].apply(_a, __spread([PREFIX + \"[\" + name + \"]:\"], args));\n });\n }\n };\n });\n } else {\n CONSOLE_LEVELS.forEach(function (name) {\n logger[name] = function () {\n return undefined;\n };\n });\n }\n\n return logger;\n} // Ensure we only have a single logger instance, even if multiple versions of @sentry/utils are being used\n\n\nvar logger;\n\nif (IS_DEBUG_BUILD) {\n logger = getGlobalSingleton('logger', makeLogger);\n} else {\n logger = makeLogger();\n}\n\nexport { logger };","import { IS_DEBUG_BUILD } from './flags';\nimport { getGlobalObject } from './global';\nimport { logger } from './logger';\n/**\n * Tells whether current environment supports ErrorEvent objects\n * {@link supportsErrorEvent}.\n *\n * @returns Answer to the given question.\n */\n\nexport function supportsErrorEvent() {\n try {\n new ErrorEvent('');\n return true;\n } catch (e) {\n return false;\n }\n}\n/**\n * Tells whether current environment supports DOMError objects\n * {@link supportsDOMError}.\n *\n * @returns Answer to the given question.\n */\n\nexport function supportsDOMError() {\n try {\n // Chrome: VM89:1 Uncaught TypeError: Failed to construct 'DOMError':\n // 1 argument required, but only 0 present.\n // @ts-ignore It really needs 1 argument, not 0.\n new DOMError('');\n return true;\n } catch (e) {\n return false;\n }\n}\n/**\n * Tells whether current environment supports DOMException objects\n * {@link supportsDOMException}.\n *\n * @returns Answer to the given question.\n */\n\nexport function supportsDOMException() {\n try {\n new DOMException('');\n return true;\n } catch (e) {\n return false;\n }\n}\n/**\n * Tells whether current environment supports Fetch API\n * {@link supportsFetch}.\n *\n * @returns Answer to the given question.\n */\n\nexport function supportsFetch() {\n if (!('fetch' in getGlobalObject())) {\n return false;\n }\n\n try {\n new Headers();\n new Request('');\n new Response();\n return true;\n } catch (e) {\n return false;\n }\n}\n/**\n * isNativeFetch checks if the given function is a native implementation of fetch()\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\n\nexport function isNativeFetch(func) {\n return func && /^function fetch\\(\\)\\s+\\{\\s+\\[native code\\]\\s+\\}$/.test(func.toString());\n}\n/**\n * Tells whether current environment supports Fetch API natively\n * {@link supportsNativeFetch}.\n *\n * @returns true if `window.fetch` is natively implemented, false otherwise\n */\n\nexport function supportsNativeFetch() {\n if (!supportsFetch()) {\n return false;\n }\n\n var global = getGlobalObject(); // Fast path to avoid DOM I/O\n // eslint-disable-next-line @typescript-eslint/unbound-method\n\n if (isNativeFetch(global.fetch)) {\n return true;\n } // window.fetch is implemented, but is polyfilled or already wrapped (e.g: by a chrome extension)\n // so create a \"pure\" iframe to see if that has native fetch\n\n\n var result = false;\n var doc = global.document; // eslint-disable-next-line deprecation/deprecation\n\n if (doc && typeof doc.createElement === 'function') {\n try {\n var sandbox = doc.createElement('iframe');\n sandbox.hidden = true;\n doc.head.appendChild(sandbox);\n\n if (sandbox.contentWindow && sandbox.contentWindow.fetch) {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n result = isNativeFetch(sandbox.contentWindow.fetch);\n }\n\n doc.head.removeChild(sandbox);\n } catch (err) {\n IS_DEBUG_BUILD && logger.warn('Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ', err);\n }\n }\n\n return result;\n}\n/**\n * Tells whether current environment supports ReportingObserver API\n * {@link supportsReportingObserver}.\n *\n * @returns Answer to the given question.\n */\n\nexport function supportsReportingObserver() {\n return 'ReportingObserver' in getGlobalObject();\n}\n/**\n * Tells whether current environment supports Referrer Policy API\n * {@link supportsReferrerPolicy}.\n *\n * @returns Answer to the given question.\n */\n\nexport function supportsReferrerPolicy() {\n // Despite all stars in the sky saying that Edge supports old draft syntax, aka 'never', 'always', 'origin' and 'default'\n // (see https://caniuse.com/#feat=referrer-policy),\n // it doesn't. And it throws an exception instead of ignoring this parameter...\n // REF: https://github.com/getsentry/raven-js/issues/1233\n if (!supportsFetch()) {\n return false;\n }\n\n try {\n new Request('_', {\n referrerPolicy: 'origin'\n });\n return true;\n } catch (e) {\n return false;\n }\n}\n/**\n * Tells whether current environment supports History API\n * {@link supportsHistory}.\n *\n * @returns Answer to the given question.\n */\n\nexport function supportsHistory() {\n // NOTE: in Chrome App environment, touching history.pushState, *even inside\n // a try/catch block*, will cause Chrome to output an error to console.error\n // borrowed from: https://github.com/angular/angular.js/pull/13945/files\n var global = getGlobalObject();\n /* eslint-disable @typescript-eslint/no-unsafe-member-access */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n var chrome = global.chrome;\n var isChromePackagedApp = chrome && chrome.app && chrome.app.runtime;\n /* eslint-enable @typescript-eslint/no-unsafe-member-access */\n\n var hasHistoryApi = 'history' in global && !!global.history.pushState && !!global.history.replaceState;\n return !isChromePackagedApp && hasHistoryApi;\n}","import { __assign, __values } from \"tslib\";\nimport { IS_DEBUG_BUILD } from './flags';\nimport { getGlobalObject } from './global';\nimport { isInstanceOf, isString } from './is';\nimport { CONSOLE_LEVELS, logger } from './logger';\nimport { fill } from './object';\nimport { getFunctionName } from './stacktrace';\nimport { supportsHistory, supportsNativeFetch } from './supports';\nvar global = getGlobalObject();\n/**\n * Instrument native APIs to call handlers that can be used to create breadcrumbs, APM spans etc.\n * - Console API\n * - Fetch API\n * - XHR API\n * - History API\n * - DOM API (click/typing)\n * - Error API\n * - UnhandledRejection API\n */\n\nvar handlers = {};\nvar instrumented = {};\n/** Instruments given API */\n\nfunction instrument(type) {\n if (instrumented[type]) {\n return;\n }\n\n instrumented[type] = true;\n\n switch (type) {\n case 'console':\n instrumentConsole();\n break;\n\n case 'dom':\n instrumentDOM();\n break;\n\n case 'xhr':\n instrumentXHR();\n break;\n\n case 'fetch':\n instrumentFetch();\n break;\n\n case 'history':\n instrumentHistory();\n break;\n\n case 'error':\n instrumentError();\n break;\n\n case 'unhandledrejection':\n instrumentUnhandledRejection();\n break;\n\n default:\n IS_DEBUG_BUILD && logger.warn('unknown instrumentation type:', type);\n return;\n }\n}\n/**\n * Add handler that will be called when given type of instrumentation triggers.\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\n\n\nexport function addInstrumentationHandler(type, callback) {\n handlers[type] = handlers[type] || [];\n handlers[type].push(callback);\n instrument(type);\n}\n/** JSDoc */\n\nfunction triggerHandlers(type, data) {\n var e_1, _a;\n\n if (!type || !handlers[type]) {\n return;\n }\n\n try {\n for (var _b = __values(handlers[type] || []), _c = _b.next(); !_c.done; _c = _b.next()) {\n var handler = _c.value;\n\n try {\n handler(data);\n } catch (e) {\n IS_DEBUG_BUILD && logger.error(\"Error while triggering instrumentation handler.\\nType: \" + type + \"\\nName: \" + getFunctionName(handler) + \"\\nError:\", e);\n }\n }\n } catch (e_1_1) {\n e_1 = {\n error: e_1_1\n };\n } finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n}\n/** JSDoc */\n\n\nfunction instrumentConsole() {\n if (!('console' in global)) {\n return;\n }\n\n CONSOLE_LEVELS.forEach(function (level) {\n if (!(level in global.console)) {\n return;\n }\n\n fill(global.console, level, function (originalConsoleMethod) {\n return function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n triggerHandlers('console', {\n args: args,\n level: level\n }); // this fails for some browsers. :(\n\n if (originalConsoleMethod) {\n originalConsoleMethod.apply(global.console, args);\n }\n };\n });\n });\n}\n/** JSDoc */\n\n\nfunction instrumentFetch() {\n if (!supportsNativeFetch()) {\n return;\n }\n\n fill(global, 'fetch', function (originalFetch) {\n return function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n var handlerData = {\n args: args,\n fetchData: {\n method: getFetchMethod(args),\n url: getFetchUrl(args)\n },\n startTimestamp: Date.now()\n };\n triggerHandlers('fetch', __assign({}, handlerData)); // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n\n return originalFetch.apply(global, args).then(function (response) {\n triggerHandlers('fetch', __assign(__assign({}, handlerData), {\n endTimestamp: Date.now(),\n response: response\n }));\n return response;\n }, function (error) {\n triggerHandlers('fetch', __assign(__assign({}, handlerData), {\n endTimestamp: Date.now(),\n error: error\n })); // NOTE: If you are a Sentry user, and you are seeing this stack frame,\n // it means the sentry.javascript SDK caught an error invoking your application code.\n // This is expected behavior and NOT indicative of a bug with sentry.javascript.\n\n throw error;\n });\n };\n });\n}\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n\n/** Extract `method` from fetch call arguments */\n\n\nfunction getFetchMethod(fetchArgs) {\n if (fetchArgs === void 0) {\n fetchArgs = [];\n }\n\n if ('Request' in global && isInstanceOf(fetchArgs[0], Request) && fetchArgs[0].method) {\n return String(fetchArgs[0].method).toUpperCase();\n }\n\n if (fetchArgs[1] && fetchArgs[1].method) {\n return String(fetchArgs[1].method).toUpperCase();\n }\n\n return 'GET';\n}\n/** Extract `url` from fetch call arguments */\n\n\nfunction getFetchUrl(fetchArgs) {\n if (fetchArgs === void 0) {\n fetchArgs = [];\n }\n\n if (typeof fetchArgs[0] === 'string') {\n return fetchArgs[0];\n }\n\n if ('Request' in global && isInstanceOf(fetchArgs[0], Request)) {\n return fetchArgs[0].url;\n }\n\n return String(fetchArgs[0]);\n}\n/* eslint-enable @typescript-eslint/no-unsafe-member-access */\n\n/** JSDoc */\n\n\nfunction instrumentXHR() {\n if (!('XMLHttpRequest' in global)) {\n return;\n }\n\n var xhrproto = XMLHttpRequest.prototype;\n fill(xhrproto, 'open', function (originalOpen) {\n return function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n } // eslint-disable-next-line @typescript-eslint/no-this-alias\n\n\n var xhr = this;\n var url = args[1];\n var xhrInfo = xhr.__sentry_xhr__ = {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n method: isString(args[0]) ? args[0].toUpperCase() : args[0],\n url: args[1]\n }; // if Sentry key appears in URL, don't capture it as a request\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n\n if (isString(url) && xhrInfo.method === 'POST' && url.match(/sentry_key/)) {\n xhr.__sentry_own_request__ = true;\n }\n\n var onreadystatechangeHandler = function onreadystatechangeHandler() {\n if (xhr.readyState === 4) {\n try {\n // touching statusCode in some platforms throws\n // an exception\n xhrInfo.status_code = xhr.status;\n } catch (e) {\n /* do nothing */\n }\n\n triggerHandlers('xhr', {\n args: args,\n endTimestamp: Date.now(),\n startTimestamp: Date.now(),\n xhr: xhr\n });\n }\n };\n\n if ('onreadystatechange' in xhr && typeof xhr.onreadystatechange === 'function') {\n fill(xhr, 'onreadystatechange', function (original) {\n return function () {\n var readyStateArgs = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n readyStateArgs[_i] = arguments[_i];\n }\n\n onreadystatechangeHandler();\n return original.apply(xhr, readyStateArgs);\n };\n });\n } else {\n xhr.addEventListener('readystatechange', onreadystatechangeHandler);\n }\n\n return originalOpen.apply(xhr, args);\n };\n });\n fill(xhrproto, 'send', function (originalSend) {\n return function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n if (this.__sentry_xhr__ && args[0] !== undefined) {\n this.__sentry_xhr__.body = args[0];\n }\n\n triggerHandlers('xhr', {\n args: args,\n startTimestamp: Date.now(),\n xhr: this\n });\n return originalSend.apply(this, args);\n };\n });\n}\n\nvar lastHref;\n/** JSDoc */\n\nfunction instrumentHistory() {\n if (!supportsHistory()) {\n return;\n }\n\n var oldOnPopState = global.onpopstate;\n\n global.onpopstate = function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n var to = global.location.href; // keep track of the current URL state, as we always receive only the updated state\n\n var from = lastHref;\n lastHref = to;\n triggerHandlers('history', {\n from: from,\n to: to\n });\n\n if (oldOnPopState) {\n // Apparently this can throw in Firefox when incorrectly implemented plugin is installed.\n // https://github.com/getsentry/sentry-javascript/issues/3344\n // https://github.com/bugsnag/bugsnag-js/issues/469\n try {\n return oldOnPopState.apply(this, args);\n } catch (_oO) {// no-empty\n }\n }\n };\n /** @hidden */\n\n\n function historyReplacementFunction(originalHistoryFunction) {\n return function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n var url = args.length > 2 ? args[2] : undefined;\n\n if (url) {\n // coerce to string (this is what pushState does)\n var from = lastHref;\n var to = String(url); // keep track of the current URL state, as we always receive only the updated state\n\n lastHref = to;\n triggerHandlers('history', {\n from: from,\n to: to\n });\n }\n\n return originalHistoryFunction.apply(this, args);\n };\n }\n\n fill(global.history, 'pushState', historyReplacementFunction);\n fill(global.history, 'replaceState', historyReplacementFunction);\n}\n\nvar debounceDuration = 1000;\nvar debounceTimerID;\nvar lastCapturedEvent;\n/**\n * Decide whether the current event should finish the debounce of previously captured one.\n * @param previous previously captured event\n * @param current event to be captured\n */\n\nfunction shouldShortcircuitPreviousDebounce(previous, current) {\n // If there was no previous event, it should always be swapped for the new one.\n if (!previous) {\n return true;\n } // If both events have different type, then user definitely performed two separate actions. e.g. click + keypress.\n\n\n if (previous.type !== current.type) {\n return true;\n }\n\n try {\n // If both events have the same type, it's still possible that actions were performed on different targets.\n // e.g. 2 clicks on different buttons.\n if (previous.target !== current.target) {\n return true;\n }\n } catch (e) {// just accessing `target` property can throw an exception in some rare circumstances\n // see: https://github.com/getsentry/sentry-javascript/issues/838\n } // If both events have the same type _and_ same `target` (an element which triggered an event, _not necessarily_\n // to which an event listener was attached), we treat them as the same action, as we want to capture\n // only one breadcrumb. e.g. multiple clicks on the same button, or typing inside a user input box.\n\n\n return false;\n}\n/**\n * Decide whether an event should be captured.\n * @param event event to be captured\n */\n\n\nfunction shouldSkipDOMEvent(event) {\n // We are only interested in filtering `keypress` events for now.\n if (event.type !== 'keypress') {\n return false;\n }\n\n try {\n var target = event.target;\n\n if (!target || !target.tagName) {\n return true;\n } // Only consider keypress events on actual input elements. This will disregard keypresses targeting body\n // e.g.tabbing through elements, hotkeys, etc.\n\n\n if (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable) {\n return false;\n }\n } catch (e) {// just accessing `target` property can throw an exception in some rare circumstances\n // see: https://github.com/getsentry/sentry-javascript/issues/838\n }\n\n return true;\n}\n/**\n * Wraps addEventListener to capture UI breadcrumbs\n * @param handler function that will be triggered\n * @param globalListener indicates whether event was captured by the global event listener\n * @returns wrapped breadcrumb events handler\n * @hidden\n */\n\n\nfunction makeDOMEventHandler(handler, globalListener) {\n if (globalListener === void 0) {\n globalListener = false;\n }\n\n return function (event) {\n // It's possible this handler might trigger multiple times for the same\n // event (e.g. event propagation through node ancestors).\n // Ignore if we've already captured that event.\n if (!event || lastCapturedEvent === event) {\n return;\n } // We always want to skip _some_ events.\n\n\n if (shouldSkipDOMEvent(event)) {\n return;\n }\n\n var name = event.type === 'keypress' ? 'input' : event.type; // If there is no debounce timer, it means that we can safely capture the new event and store it for future comparisons.\n\n if (debounceTimerID === undefined) {\n handler({\n event: event,\n name: name,\n global: globalListener\n });\n lastCapturedEvent = event;\n } // If there is a debounce awaiting, see if the new event is different enough to treat it as a unique one.\n // If that's the case, emit the previous event and store locally the newly-captured DOM event.\n else if (shouldShortcircuitPreviousDebounce(lastCapturedEvent, event)) {\n handler({\n event: event,\n name: name,\n global: globalListener\n });\n lastCapturedEvent = event;\n } // Start a new debounce timer that will prevent us from capturing multiple events that should be grouped together.\n\n\n clearTimeout(debounceTimerID);\n debounceTimerID = global.setTimeout(function () {\n debounceTimerID = undefined;\n }, debounceDuration);\n };\n}\n/** JSDoc */\n\n\nfunction instrumentDOM() {\n if (!('document' in global)) {\n return;\n } // Make it so that any click or keypress that is unhandled / bubbled up all the way to the document triggers our dom\n // handlers. (Normally we have only one, which captures a breadcrumb for each click or keypress.) Do this before\n // we instrument `addEventListener` so that we don't end up attaching this handler twice.\n\n\n var triggerDOMHandler = triggerHandlers.bind(null, 'dom');\n var globalDOMEventHandler = makeDOMEventHandler(triggerDOMHandler, true);\n global.document.addEventListener('click', globalDOMEventHandler, false);\n global.document.addEventListener('keypress', globalDOMEventHandler, false); // After hooking into click and keypress events bubbled up to `document`, we also hook into user-handled\n // clicks & keypresses, by adding an event listener of our own to any element to which they add a listener. That\n // way, whenever one of their handlers is triggered, ours will be, too. (This is needed because their handler\n // could potentially prevent the event from bubbling up to our global listeners. This way, our handler are still\n // guaranteed to fire at least once.)\n\n ['EventTarget', 'Node'].forEach(function (target) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n var proto = global[target] && global[target].prototype; // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, no-prototype-builtins\n\n if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty('addEventListener')) {\n return;\n }\n\n fill(proto, 'addEventListener', function (originalAddEventListener) {\n return function (type, listener, options) {\n if (type === 'click' || type == 'keypress') {\n try {\n var el = this;\n var handlers_1 = el.__sentry_instrumentation_handlers__ = el.__sentry_instrumentation_handlers__ || {};\n var handlerForType = handlers_1[type] = handlers_1[type] || {\n refCount: 0\n };\n\n if (!handlerForType.handler) {\n var handler = makeDOMEventHandler(triggerDOMHandler);\n handlerForType.handler = handler;\n originalAddEventListener.call(this, type, handler, options);\n }\n\n handlerForType.refCount += 1;\n } catch (e) {// Accessing dom properties is always fragile.\n // Also allows us to skip `addEventListenrs` calls with no proper `this` context.\n }\n }\n\n return originalAddEventListener.call(this, type, listener, options);\n };\n });\n fill(proto, 'removeEventListener', function (originalRemoveEventListener) {\n return function (type, listener, options) {\n if (type === 'click' || type == 'keypress') {\n try {\n var el = this;\n var handlers_2 = el.__sentry_instrumentation_handlers__ || {};\n var handlerForType = handlers_2[type];\n\n if (handlerForType) {\n handlerForType.refCount -= 1; // If there are no longer any custom handlers of the current type on this element, we can remove ours, too.\n\n if (handlerForType.refCount <= 0) {\n originalRemoveEventListener.call(this, type, handlerForType.handler, options);\n handlerForType.handler = undefined;\n delete handlers_2[type]; // eslint-disable-line @typescript-eslint/no-dynamic-delete\n } // If there are no longer any custom handlers of any type on this element, cleanup everything.\n\n\n if (Object.keys(handlers_2).length === 0) {\n delete el.__sentry_instrumentation_handlers__;\n }\n }\n } catch (e) {// Accessing dom properties is always fragile.\n // Also allows us to skip `addEventListenrs` calls with no proper `this` context.\n }\n }\n\n return originalRemoveEventListener.call(this, type, listener, options);\n };\n });\n });\n}\n\nvar _oldOnErrorHandler = null;\n/** JSDoc */\n\nfunction instrumentError() {\n _oldOnErrorHandler = global.onerror;\n\n global.onerror = function (msg, url, line, column, error) {\n triggerHandlers('error', {\n column: column,\n error: error,\n line: line,\n msg: msg,\n url: url\n });\n\n if (_oldOnErrorHandler) {\n // eslint-disable-next-line prefer-rest-params\n return _oldOnErrorHandler.apply(this, arguments);\n }\n\n return false;\n };\n}\n\nvar _oldOnUnhandledRejectionHandler = null;\n/** JSDoc */\n\nfunction instrumentUnhandledRejection() {\n _oldOnUnhandledRejectionHandler = global.onunhandledrejection;\n\n global.onunhandledrejection = function (e) {\n triggerHandlers('unhandledrejection', e);\n\n if (_oldOnUnhandledRejectionHandler) {\n // eslint-disable-next-line prefer-rest-params\n return _oldOnUnhandledRejectionHandler.apply(this, arguments);\n }\n\n return true;\n };\n}","import { __assign } from \"tslib\";\nimport { getGlobalObject } from './global';\nimport { addNonEnumerableProperty } from './object';\nimport { snipLine } from './string';\n/**\n * UUID4 generator\n *\n * @returns string Generated UUID4.\n */\n\nexport function uuid4() {\n var global = getGlobalObject();\n var crypto = global.crypto || global.msCrypto;\n\n if (!(crypto === void 0) && crypto.getRandomValues) {\n // Use window.crypto API if available\n var arr = new Uint16Array(8);\n crypto.getRandomValues(arr); // set 4 in byte 7\n // eslint-disable-next-line no-bitwise\n\n arr[3] = arr[3] & 0xfff | 0x4000; // set 2 most significant bits of byte 9 to '10'\n // eslint-disable-next-line no-bitwise\n\n arr[4] = arr[4] & 0x3fff | 0x8000;\n\n var pad = function pad(num) {\n var v = num.toString(16);\n\n while (v.length < 4) {\n v = \"0\" + v;\n }\n\n return v;\n };\n\n return pad(arr[0]) + pad(arr[1]) + pad(arr[2]) + pad(arr[3]) + pad(arr[4]) + pad(arr[5]) + pad(arr[6]) + pad(arr[7]);\n } // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#2117523\n\n\n return 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n // eslint-disable-next-line no-bitwise\n var r = Math.random() * 16 | 0; // eslint-disable-next-line no-bitwise\n\n var v = c === 'x' ? r : r & 0x3 | 0x8;\n return v.toString(16);\n });\n}\n/**\n * Parses string form of URL into an object\n * // borrowed from https://tools.ietf.org/html/rfc3986#appendix-B\n * // intentionally using regex and not href parsing trick because React Native and other\n * // environments where DOM might not be available\n * @returns parsed URL object\n */\n\nexport function parseUrl(url) {\n if (!url) {\n return {};\n }\n\n var match = url.match(/^(([^:/?#]+):)?(\\/\\/([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$/);\n\n if (!match) {\n return {};\n } // coerce to undefined values to empty string so we don't get 'undefined'\n\n\n var query = match[6] || '';\n var fragment = match[8] || '';\n return {\n host: match[4],\n path: match[5],\n protocol: match[2],\n relative: match[5] + query + fragment\n };\n}\n\nfunction getFirstException(event) {\n return event.exception && event.exception.values ? event.exception.values[0] : undefined;\n}\n/**\n * Extracts either message or type+value from an event that can be used for user-facing logs\n * @returns event's description\n */\n\n\nexport function getEventDescription(event) {\n var message = event.message,\n eventId = event.event_id;\n\n if (message) {\n return message;\n }\n\n var firstException = getFirstException(event);\n\n if (firstException) {\n if (firstException.type && firstException.value) {\n return firstException.type + \": \" + firstException.value;\n }\n\n return firstException.type || firstException.value || eventId || '';\n }\n\n return eventId || '';\n}\n/**\n * Adds exception values, type and value to an synthetic Exception.\n * @param event The event to modify.\n * @param value Value of the exception.\n * @param type Type of the exception.\n * @hidden\n */\n\nexport function addExceptionTypeValue(event, value, type) {\n var exception = event.exception = event.exception || {};\n var values = exception.values = exception.values || [];\n var firstException = values[0] = values[0] || {};\n\n if (!firstException.value) {\n firstException.value = value || '';\n }\n\n if (!firstException.type) {\n firstException.type = type || 'Error';\n }\n}\n/**\n * Adds exception mechanism data to a given event. Uses defaults if the second parameter is not passed.\n *\n * @param event The event to modify.\n * @param newMechanism Mechanism data to add to the event.\n * @hidden\n */\n\nexport function addExceptionMechanism(event, newMechanism) {\n var firstException = getFirstException(event);\n\n if (!firstException) {\n return;\n }\n\n var defaultMechanism = {\n type: 'generic',\n handled: true\n };\n var currentMechanism = firstException.mechanism;\n firstException.mechanism = __assign(__assign(__assign({}, defaultMechanism), currentMechanism), newMechanism);\n\n if (newMechanism && 'data' in newMechanism) {\n var mergedData = __assign(__assign({}, currentMechanism && currentMechanism.data), newMechanism.data);\n\n firstException.mechanism.data = mergedData;\n }\n} // https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\n\nvar SEMVER_REGEXP = /^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$/;\n/**\n * Parses input into a SemVer interface\n * @param input string representation of a semver version\n */\n\nexport function parseSemver(input) {\n var match = input.match(SEMVER_REGEXP) || [];\n var major = parseInt(match[1], 10);\n var minor = parseInt(match[2], 10);\n var patch = parseInt(match[3], 10);\n return {\n buildmetadata: match[5],\n major: isNaN(major) ? undefined : major,\n minor: isNaN(minor) ? undefined : minor,\n patch: isNaN(patch) ? undefined : patch,\n prerelease: match[4]\n };\n}\n/**\n * This function adds context (pre/post/line) lines to the provided frame\n *\n * @param lines string[] containing all lines\n * @param frame StackFrame that will be mutated\n * @param linesOfContext number of context lines we want to add pre/post\n */\n\nexport function addContextToFrame(lines, frame, linesOfContext) {\n if (linesOfContext === void 0) {\n linesOfContext = 5;\n }\n\n var lineno = frame.lineno || 0;\n var maxLines = lines.length;\n var sourceLine = Math.max(Math.min(maxLines, lineno - 1), 0);\n frame.pre_context = lines.slice(Math.max(0, sourceLine - linesOfContext), sourceLine).map(function (line) {\n return snipLine(line, 0);\n });\n frame.context_line = snipLine(lines[Math.min(maxLines - 1, sourceLine)], frame.colno || 0);\n frame.post_context = lines.slice(Math.min(sourceLine + 1, maxLines), sourceLine + 1 + linesOfContext).map(function (line) {\n return snipLine(line, 0);\n });\n}\n/**\n * Strip the query string and fragment off of a given URL or path (if present)\n *\n * @param urlPath Full URL or path, including possible query string and/or fragment\n * @returns URL or path without query string or fragment\n */\n\nexport function stripUrlQueryAndFragment(urlPath) {\n // eslint-disable-next-line no-useless-escape\n return urlPath.split(/[\\?#]/, 1)[0];\n}\n/**\n * Checks whether or not we've already captured the given exception (note: not an identical exception - the very object\n * in question), and marks it captured if not.\n *\n * This is useful because it's possible for an error to get captured by more than one mechanism. After we intercept and\n * record an error, we rethrow it (assuming we've intercepted it before it's reached the top-level global handlers), so\n * that we don't interfere with whatever effects the error might have had were the SDK not there. At that point, because\n * the error has been rethrown, it's possible for it to bubble up to some other code we've instrumented. If it's not\n * caught after that, it will bubble all the way up to the global handlers (which of course we also instrument). This\n * function helps us ensure that even if we encounter the same error more than once, we only record it the first time we\n * see it.\n *\n * Note: It will ignore primitives (always return `false` and not mark them as seen), as properties can't be set on\n * them. {@link: Object.objectify} can be used on exceptions to convert any that are primitives into their equivalent\n * object wrapper forms so that this check will always work. However, because we need to flag the exact object which\n * will get rethrown, and because that rethrowing happens outside of the event processing pipeline, the objectification\n * must be done before the exception captured.\n *\n * @param A thrown exception to check or flag as having been seen\n * @returns `true` if the exception has already been captured, `false` if not (with the side effect of marking it seen)\n */\n\nexport function checkOrSetAlreadyCaught(exception) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (exception && exception.__sentry_captured__) {\n return true;\n }\n\n try {\n // set it this way rather than by assignment so that it's not ennumerable and therefore isn't recorded by the\n // `ExtraErrorData` integration\n addNonEnumerableProperty(exception, '__sentry_captured__', true);\n } catch (err) {// `exception` is a primitive, so we can't mark it seen\n }\n\n return false;\n}","/* eslint-disable @typescript-eslint/explicit-function-return-type */\n\n/* eslint-disable @typescript-eslint/typedef */\n\n/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { isThenable } from './is';\n/**\n * Creates a resolved sync promise.\n *\n * @param value the value to resolve the promise with\n * @returns the resolved sync promise\n */\n\nexport function resolvedSyncPromise(value) {\n return new SyncPromise(function (resolve) {\n resolve(value);\n });\n}\n/**\n * Creates a rejected sync promise.\n *\n * @param value the value to reject the promise with\n * @returns the rejected sync promise\n */\n\nexport function rejectedSyncPromise(reason) {\n return new SyncPromise(function (_, reject) {\n reject(reason);\n });\n}\n/**\n * Thenable class that behaves like a Promise and follows it's interface\n * but is not async internally\n */\n\nvar SyncPromise = function () {\n function SyncPromise(executor) {\n var _this = this;\n\n this._state = 0\n /* PENDING */\n ;\n this._handlers = [];\n /** JSDoc */\n\n this._resolve = function (value) {\n _this._setResult(1\n /* RESOLVED */\n , value);\n };\n /** JSDoc */\n\n\n this._reject = function (reason) {\n _this._setResult(2\n /* REJECTED */\n , reason);\n };\n /** JSDoc */\n\n\n this._setResult = function (state, value) {\n if (_this._state !== 0\n /* PENDING */\n ) {\n return;\n }\n\n if (isThenable(value)) {\n void value.then(_this._resolve, _this._reject);\n return;\n }\n\n _this._state = state;\n _this._value = value;\n\n _this._executeHandlers();\n };\n /** JSDoc */\n\n\n this._executeHandlers = function () {\n if (_this._state === 0\n /* PENDING */\n ) {\n return;\n }\n\n var cachedHandlers = _this._handlers.slice();\n\n _this._handlers = [];\n cachedHandlers.forEach(function (handler) {\n if (handler[0]) {\n return;\n }\n\n if (_this._state === 1\n /* RESOLVED */\n ) {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n handler[1](_this._value);\n }\n\n if (_this._state === 2\n /* REJECTED */\n ) {\n handler[2](_this._value);\n }\n\n handler[0] = true;\n });\n };\n\n try {\n executor(this._resolve, this._reject);\n } catch (e) {\n this._reject(e);\n }\n }\n /** JSDoc */\n\n\n SyncPromise.prototype.then = function (onfulfilled, onrejected) {\n var _this = this;\n\n return new SyncPromise(function (resolve, reject) {\n _this._handlers.push([false, function (result) {\n if (!onfulfilled) {\n // TODO: ¯\\_(ツ)_/¯\n // TODO: FIXME\n resolve(result);\n } else {\n try {\n resolve(onfulfilled(result));\n } catch (e) {\n reject(e);\n }\n }\n }, function (reason) {\n if (!onrejected) {\n reject(reason);\n } else {\n try {\n resolve(onrejected(reason));\n } catch (e) {\n reject(e);\n }\n }\n }]);\n\n _this._executeHandlers();\n });\n };\n /** JSDoc */\n\n\n SyncPromise.prototype.catch = function (onrejected) {\n return this.then(function (val) {\n return val;\n }, onrejected);\n };\n /** JSDoc */\n\n\n SyncPromise.prototype.finally = function (onfinally) {\n var _this = this;\n\n return new SyncPromise(function (resolve, reject) {\n var val;\n var isRejected;\n return _this.then(function (value) {\n isRejected = false;\n val = value;\n\n if (onfinally) {\n onfinally();\n }\n }, function (reason) {\n isRejected = true;\n val = reason;\n\n if (onfinally) {\n onfinally();\n }\n }).then(function () {\n if (isRejected) {\n reject(val);\n return;\n }\n\n resolve(val);\n });\n });\n };\n\n return SyncPromise;\n}();\n\nexport { SyncPromise };","import { SentryError } from './error';\nimport { rejectedSyncPromise, resolvedSyncPromise, SyncPromise } from './syncpromise';\n/**\n * Creates an new PromiseBuffer object with the specified limit\n * @param limit max number of promises that can be stored in the buffer\n */\n\nexport function makePromiseBuffer(limit) {\n var buffer = [];\n\n function isReady() {\n return limit === undefined || buffer.length < limit;\n }\n /**\n * Remove a promise from the queue.\n *\n * @param task Can be any PromiseLike\n * @returns Removed promise.\n */\n\n\n function remove(task) {\n return buffer.splice(buffer.indexOf(task), 1)[0];\n }\n /**\n * Add a promise (representing an in-flight action) to the queue, and set it to remove itself on fulfillment.\n *\n * @param taskProducer A function producing any PromiseLike; In previous versions this used to be `task:\n * PromiseLike`, but under that model, Promises were instantly created on the call-site and their executor\n * functions therefore ran immediately. Thus, even if the buffer was full, the action still happened. By\n * requiring the promise to be wrapped in a function, we can defer promise creation until after the buffer\n * limit check.\n * @returns The original promise.\n */\n\n\n function add(taskProducer) {\n if (!isReady()) {\n return rejectedSyncPromise(new SentryError('Not adding Promise due to buffer limit reached.'));\n } // start the task and add its promise to the queue\n\n\n var task = taskProducer();\n\n if (buffer.indexOf(task) === -1) {\n buffer.push(task);\n }\n\n void task.then(function () {\n return remove(task);\n }) // Use `then(null, rejectionHandler)` rather than `catch(rejectionHandler)` so that we can use `PromiseLike`\n // rather than `Promise`. `PromiseLike` doesn't have a `.catch` method, making its polyfill smaller. (ES5 didn't\n // have promises, so TS has to polyfill when down-compiling.)\n .then(null, function () {\n return remove(task).then(null, function () {// We have to add another catch here because `remove()` starts a new promise chain.\n });\n });\n return task;\n }\n /**\n * Wait for all promises in the queue to resolve or for timeout to expire, whichever comes first.\n *\n * @param timeout The time, in ms, after which to resolve to `false` if the queue is still non-empty. Passing `0` (or\n * not passing anything) will make the promise wait as long as it takes for the queue to drain before resolving to\n * `true`.\n * @returns A promise which will resolve to `true` if the queue is already empty or drains before the timeout, and\n * `false` otherwise\n */\n\n\n function drain(timeout) {\n return new SyncPromise(function (resolve, reject) {\n var counter = buffer.length;\n\n if (!counter) {\n return resolve(true);\n } // wait for `timeout` ms and then resolve to `false` (if not cancelled first)\n\n\n var capturedSetTimeout = setTimeout(function () {\n if (timeout && timeout > 0) {\n resolve(false);\n }\n }, timeout); // if all promises resolve in time, cancel the timer and resolve to `true`\n\n buffer.forEach(function (item) {\n void resolvedSyncPromise(item).then(function () {\n // eslint-disable-next-line no-plusplus\n if (! --counter) {\n clearTimeout(capturedSetTimeout);\n resolve(true);\n }\n }, reject);\n });\n });\n }\n\n return {\n $: buffer,\n add: add,\n drain: drain\n };\n}","import { Severity } from '@sentry/types';\nimport { SeverityLevels } from './enums';\n\nfunction isSupportedSeverity(level) {\n return SeverityLevels.indexOf(level) !== -1;\n}\n/**\n * Converts a string-based level into a {@link Severity}.\n *\n * @param level string representation of Severity\n * @returns Severity\n */\n\n\nexport function severityFromString(level) {\n if (level === 'warn') return Severity.Warning;\n\n if (isSupportedSeverity(level)) {\n return level;\n }\n\n return Severity.Log;\n}","/**\n * Converts an HTTP status code to sentry status {@link EventStatus}.\n *\n * @param code number HTTP status code\n * @returns EventStatus\n */\nexport function eventStatusFromHttpCode(code) {\n if (code >= 200 && code < 300) {\n return 'success';\n }\n\n if (code === 429) {\n return 'rate_limit';\n }\n\n if (code >= 400 && code < 500) {\n return 'invalid';\n }\n\n if (code >= 500) {\n return 'failed';\n }\n\n return 'unknown';\n}","export var TRACEPARENT_REGEXP = new RegExp('^[ \\\\t]*' + // whitespace\n'([0-9a-f]{32})?' + // trace_id\n'-?([0-9a-f]{16})?' + // span_id\n'-?([01])?' + // sampled\n'[ \\\\t]*$');\n/**\n * Extract transaction context data from a `sentry-trace` header.\n *\n * @param traceparent Traceparent string\n *\n * @returns Object containing data from the header, or undefined if traceparent string is malformed\n */\n\nexport function extractTraceparentData(traceparent) {\n var matches = traceparent.match(TRACEPARENT_REGEXP);\n\n if (matches) {\n var parentSampled = void 0;\n\n if (matches[3] === '1') {\n parentSampled = true;\n } else if (matches[3] === '0') {\n parentSampled = false;\n }\n\n return {\n traceId: matches[1],\n parentSampled: parentSampled,\n parentSpanId: matches[2]\n };\n }\n\n return undefined;\n}","import { __read, __spread } from \"tslib\";\nimport { isPrimitive } from './is';\n/**\n * Creates an envelope.\n * Make sure to always explicitly provide the generic to this function\n * so that the envelope types resolve correctly.\n */\n\nexport function createEnvelope(headers, items) {\n if (items === void 0) {\n items = [];\n }\n\n return [headers, items];\n}\n/**\n * Add an item to an envelope.\n * Make sure to always explicitly provide the generic to this function\n * so that the envelope types resolve correctly.\n */\n\nexport function addItemToEnvelope(envelope, newItem) {\n var _a = __read(envelope, 2),\n headers = _a[0],\n items = _a[1];\n\n return [headers, __spread(items, [newItem])];\n}\n/**\n * Get the type of the envelope. Grabs the type from the first envelope item.\n */\n\nexport function getEnvelopeType(envelope) {\n var _a = __read(envelope, 2),\n _b = __read(_a[1], 1),\n _c = __read(_b[0], 1),\n firstItemHeader = _c[0];\n\n return firstItemHeader.type;\n}\n/**\n * Serializes an envelope into a string.\n */\n\nexport function serializeEnvelope(envelope) {\n var _a = __read(envelope, 2),\n headers = _a[0],\n items = _a[1];\n\n var serializedHeaders = JSON.stringify(headers); // Have to cast items to any here since Envelope is a union type\n // Fixed in Typescript 4.2\n // TODO: Remove any[] cast when we upgrade to TS 4.2\n // https://github.com/microsoft/TypeScript/issues/36390\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n return items.reduce(function (acc, item) {\n var _a = __read(item, 2),\n itemHeaders = _a[0],\n payload = _a[1]; // We do not serialize payloads that are primitives\n\n\n var serializedPayload = isPrimitive(payload) ? String(payload) : JSON.stringify(payload);\n return acc + \"\\n\" + JSON.stringify(itemHeaders) + \"\\n\" + serializedPayload;\n }, serializedHeaders);\n}","import { __assign, __values } from \"tslib\";\nexport var DEFAULT_RETRY_AFTER = 60 * 1000; // 60 seconds\n\n/**\n * Extracts Retry-After value from the request header or returns default value\n * @param header string representation of 'Retry-After' header\n * @param now current unix timestamp\n *\n */\n\nexport function parseRetryAfterHeader(header, now) {\n if (now === void 0) {\n now = Date.now();\n }\n\n var headerDelay = parseInt(\"\" + header, 10);\n\n if (!isNaN(headerDelay)) {\n return headerDelay * 1000;\n }\n\n var headerDate = Date.parse(\"\" + header);\n\n if (!isNaN(headerDate)) {\n return headerDate - now;\n }\n\n return DEFAULT_RETRY_AFTER;\n}\n/**\n * Gets the time that given category is disabled until for rate limiting\n */\n\nexport function disabledUntil(limits, category) {\n return limits[category] || limits.all || 0;\n}\n/**\n * Checks if a category is rate limited\n */\n\nexport function isRateLimited(limits, category, now) {\n if (now === void 0) {\n now = Date.now();\n }\n\n return disabledUntil(limits, category) > now;\n}\n/**\n * Update ratelimits from incoming headers.\n * Returns true if headers contains a non-empty rate limiting header.\n */\n\nexport function updateRateLimits(limits, headers, now) {\n var e_1, _a, e_2, _b;\n\n if (now === void 0) {\n now = Date.now();\n }\n\n var updatedRateLimits = __assign({}, limits); // \"The name is case-insensitive.\"\n // https://developer.mozilla.org/en-US/docs/Web/API/Headers/get\n\n\n var rateLimitHeader = headers['x-sentry-rate-limits'];\n var retryAfterHeader = headers['retry-after'];\n\n if (rateLimitHeader) {\n try {\n /**\n * rate limit headers are of the form\n *
,
,..\n * where each
is of the form\n * : : : \n * where\n * is a delay in seconds\n * is the event type(s) (error, transaction, etc) being rate limited and is of the form\n * ;;...\n * is what's being limited (org, project, or key) - ignored by SDK\n * is an arbitrary string like \"org_quota\" - ignored by SDK\n */\n for (var _c = __values(rateLimitHeader.trim().split(',')), _d = _c.next(); !_d.done; _d = _c.next()) {\n var limit = _d.value;\n var parameters = limit.split(':', 2);\n var headerDelay = parseInt(parameters[0], 10);\n var delay = (!isNaN(headerDelay) ? headerDelay : 60) * 1000; // 60sec default\n\n if (!parameters[1]) {\n updatedRateLimits.all = now + delay;\n } else {\n try {\n for (var _e = (e_2 = void 0, __values(parameters[1].split(';'))), _f = _e.next(); !_f.done; _f = _e.next()) {\n var category = _f.value;\n updatedRateLimits[category] = now + delay;\n }\n } catch (e_2_1) {\n e_2 = {\n error: e_2_1\n };\n } finally {\n try {\n if (_f && !_f.done && (_b = _e.return)) _b.call(_e);\n } finally {\n if (e_2) throw e_2.error;\n }\n }\n }\n }\n } catch (e_1_1) {\n e_1 = {\n error: e_1_1\n };\n } finally {\n try {\n if (_d && !_d.done && (_a = _c.return)) _a.call(_c);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n } else if (retryAfterHeader) {\n updatedRateLimits.all = now + parseRetryAfterHeader(retryAfterHeader, now);\n }\n\n return updatedRateLimits;\n}","import { __assign, __read, __spread } from \"tslib\";\nimport { dateTimestampInSeconds, getGlobalSingleton, isPlainObject, isThenable, SyncPromise } from '@sentry/utils';\n/**\n * Absolute maximum number of breadcrumbs added to an event.\n * The `maxBreadcrumbs` option cannot be higher than this value.\n */\n\nvar MAX_BREADCRUMBS = 100;\n/**\n * Holds additional event information. {@link Scope.applyToEvent} will be\n * called by the client before an event will be sent.\n */\n\nvar Scope = function () {\n function Scope() {\n /** Flag if notifying is happening. */\n this._notifyingListeners = false;\n /** Callback for client to receive scope changes. */\n\n this._scopeListeners = [];\n /** Callback list that will be called after {@link applyToEvent}. */\n\n this._eventProcessors = [];\n /** Array of breadcrumbs. */\n\n this._breadcrumbs = [];\n /** User */\n\n this._user = {};\n /** Tags */\n\n this._tags = {};\n /** Extra */\n\n this._extra = {};\n /** Contexts */\n\n this._contexts = {};\n /**\n * A place to stash data which is needed at some point in the SDK's event processing pipeline but which shouldn't get\n * sent to Sentry\n */\n\n this._sdkProcessingMetadata = {};\n }\n /**\n * Inherit values from the parent scope.\n * @param scope to clone.\n */\n\n\n Scope.clone = function (scope) {\n var newScope = new Scope();\n\n if (scope) {\n newScope._breadcrumbs = __spread(scope._breadcrumbs);\n newScope._tags = __assign({}, scope._tags);\n newScope._extra = __assign({}, scope._extra);\n newScope._contexts = __assign({}, scope._contexts);\n newScope._user = scope._user;\n newScope._level = scope._level;\n newScope._span = scope._span;\n newScope._session = scope._session;\n newScope._transactionName = scope._transactionName;\n newScope._fingerprint = scope._fingerprint;\n newScope._eventProcessors = __spread(scope._eventProcessors);\n newScope._requestSession = scope._requestSession;\n }\n\n return newScope;\n };\n /**\n * Add internal on change listener. Used for sub SDKs that need to store the scope.\n * @hidden\n */\n\n\n Scope.prototype.addScopeListener = function (callback) {\n this._scopeListeners.push(callback);\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.addEventProcessor = function (callback) {\n this._eventProcessors.push(callback);\n\n return this;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.setUser = function (user) {\n this._user = user || {};\n\n if (this._session) {\n this._session.update({\n user: user\n });\n }\n\n this._notifyScopeListeners();\n\n return this;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.getUser = function () {\n return this._user;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.getRequestSession = function () {\n return this._requestSession;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.setRequestSession = function (requestSession) {\n this._requestSession = requestSession;\n return this;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.setTags = function (tags) {\n this._tags = __assign(__assign({}, this._tags), tags);\n\n this._notifyScopeListeners();\n\n return this;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.setTag = function (key, value) {\n var _a;\n\n this._tags = __assign(__assign({}, this._tags), (_a = {}, _a[key] = value, _a));\n\n this._notifyScopeListeners();\n\n return this;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.setExtras = function (extras) {\n this._extra = __assign(__assign({}, this._extra), extras);\n\n this._notifyScopeListeners();\n\n return this;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.setExtra = function (key, extra) {\n var _a;\n\n this._extra = __assign(__assign({}, this._extra), (_a = {}, _a[key] = extra, _a));\n\n this._notifyScopeListeners();\n\n return this;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.setFingerprint = function (fingerprint) {\n this._fingerprint = fingerprint;\n\n this._notifyScopeListeners();\n\n return this;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.setLevel = function (level) {\n this._level = level;\n\n this._notifyScopeListeners();\n\n return this;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.setTransactionName = function (name) {\n this._transactionName = name;\n\n this._notifyScopeListeners();\n\n return this;\n };\n /**\n * Can be removed in major version.\n * @deprecated in favor of {@link this.setTransactionName}\n */\n\n\n Scope.prototype.setTransaction = function (name) {\n return this.setTransactionName(name);\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.setContext = function (key, context) {\n var _a;\n\n if (context === null) {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete this._contexts[key];\n } else {\n this._contexts = __assign(__assign({}, this._contexts), (_a = {}, _a[key] = context, _a));\n }\n\n this._notifyScopeListeners();\n\n return this;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.setSpan = function (span) {\n this._span = span;\n\n this._notifyScopeListeners();\n\n return this;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.getSpan = function () {\n return this._span;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.getTransaction = function () {\n // Often, this span (if it exists at all) will be a transaction, but it's not guaranteed to be. Regardless, it will\n // have a pointer to the currently-active transaction.\n var span = this.getSpan();\n return span && span.transaction;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.setSession = function (session) {\n if (!session) {\n delete this._session;\n } else {\n this._session = session;\n }\n\n this._notifyScopeListeners();\n\n return this;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.getSession = function () {\n return this._session;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.update = function (captureContext) {\n if (!captureContext) {\n return this;\n }\n\n if (typeof captureContext === 'function') {\n var updatedScope = captureContext(this);\n return updatedScope instanceof Scope ? updatedScope : this;\n }\n\n if (captureContext instanceof Scope) {\n this._tags = __assign(__assign({}, this._tags), captureContext._tags);\n this._extra = __assign(__assign({}, this._extra), captureContext._extra);\n this._contexts = __assign(__assign({}, this._contexts), captureContext._contexts);\n\n if (captureContext._user && Object.keys(captureContext._user).length) {\n this._user = captureContext._user;\n }\n\n if (captureContext._level) {\n this._level = captureContext._level;\n }\n\n if (captureContext._fingerprint) {\n this._fingerprint = captureContext._fingerprint;\n }\n\n if (captureContext._requestSession) {\n this._requestSession = captureContext._requestSession;\n }\n } else if (isPlainObject(captureContext)) {\n // eslint-disable-next-line no-param-reassign\n captureContext = captureContext;\n this._tags = __assign(__assign({}, this._tags), captureContext.tags);\n this._extra = __assign(__assign({}, this._extra), captureContext.extra);\n this._contexts = __assign(__assign({}, this._contexts), captureContext.contexts);\n\n if (captureContext.user) {\n this._user = captureContext.user;\n }\n\n if (captureContext.level) {\n this._level = captureContext.level;\n }\n\n if (captureContext.fingerprint) {\n this._fingerprint = captureContext.fingerprint;\n }\n\n if (captureContext.requestSession) {\n this._requestSession = captureContext.requestSession;\n }\n }\n\n return this;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.clear = function () {\n this._breadcrumbs = [];\n this._tags = {};\n this._extra = {};\n this._user = {};\n this._contexts = {};\n this._level = undefined;\n this._transactionName = undefined;\n this._fingerprint = undefined;\n this._requestSession = undefined;\n this._span = undefined;\n this._session = undefined;\n\n this._notifyScopeListeners();\n\n return this;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.addBreadcrumb = function (breadcrumb, maxBreadcrumbs) {\n var maxCrumbs = typeof maxBreadcrumbs === 'number' ? Math.min(maxBreadcrumbs, MAX_BREADCRUMBS) : MAX_BREADCRUMBS; // No data has been changed, so don't notify scope listeners\n\n if (maxCrumbs <= 0) {\n return this;\n }\n\n var mergedBreadcrumb = __assign({\n timestamp: dateTimestampInSeconds()\n }, breadcrumb);\n\n this._breadcrumbs = __spread(this._breadcrumbs, [mergedBreadcrumb]).slice(-maxCrumbs);\n\n this._notifyScopeListeners();\n\n return this;\n };\n /**\n * @inheritDoc\n */\n\n\n Scope.prototype.clearBreadcrumbs = function () {\n this._breadcrumbs = [];\n\n this._notifyScopeListeners();\n\n return this;\n };\n /**\n * Applies the current context and fingerprint to the event.\n * Note that breadcrumbs will be added by the client.\n * Also if the event has already breadcrumbs on it, we do not merge them.\n * @param event Event\n * @param hint May contain additional information about the original exception.\n * @hidden\n */\n\n\n Scope.prototype.applyToEvent = function (event, hint) {\n if (this._extra && Object.keys(this._extra).length) {\n event.extra = __assign(__assign({}, this._extra), event.extra);\n }\n\n if (this._tags && Object.keys(this._tags).length) {\n event.tags = __assign(__assign({}, this._tags), event.tags);\n }\n\n if (this._user && Object.keys(this._user).length) {\n event.user = __assign(__assign({}, this._user), event.user);\n }\n\n if (this._contexts && Object.keys(this._contexts).length) {\n event.contexts = __assign(__assign({}, this._contexts), event.contexts);\n }\n\n if (this._level) {\n event.level = this._level;\n }\n\n if (this._transactionName) {\n event.transaction = this._transactionName;\n } // We want to set the trace context for normal events only if there isn't already\n // a trace context on the event. There is a product feature in place where we link\n // errors with transaction and it relies on that.\n\n\n if (this._span) {\n event.contexts = __assign({\n trace: this._span.getTraceContext()\n }, event.contexts);\n var transactionName = this._span.transaction && this._span.transaction.name;\n\n if (transactionName) {\n event.tags = __assign({\n transaction: transactionName\n }, event.tags);\n }\n }\n\n this._applyFingerprint(event);\n\n event.breadcrumbs = __spread(event.breadcrumbs || [], this._breadcrumbs);\n event.breadcrumbs = event.breadcrumbs.length > 0 ? event.breadcrumbs : undefined;\n event.sdkProcessingMetadata = this._sdkProcessingMetadata;\n return this._notifyEventProcessors(__spread(getGlobalEventProcessors(), this._eventProcessors), event, hint);\n };\n /**\n * Add data which will be accessible during event processing but won't get sent to Sentry\n */\n\n\n Scope.prototype.setSDKProcessingMetadata = function (newData) {\n this._sdkProcessingMetadata = __assign(__assign({}, this._sdkProcessingMetadata), newData);\n return this;\n };\n /**\n * This will be called after {@link applyToEvent} is finished.\n */\n\n\n Scope.prototype._notifyEventProcessors = function (processors, event, hint, index) {\n var _this = this;\n\n if (index === void 0) {\n index = 0;\n }\n\n return new SyncPromise(function (resolve, reject) {\n var processor = processors[index];\n\n if (event === null || typeof processor !== 'function') {\n resolve(event);\n } else {\n var result = processor(__assign({}, event), hint);\n\n if (isThenable(result)) {\n void result.then(function (final) {\n return _this._notifyEventProcessors(processors, final, hint, index + 1).then(resolve);\n }).then(null, reject);\n } else {\n void _this._notifyEventProcessors(processors, result, hint, index + 1).then(resolve).then(null, reject);\n }\n }\n });\n };\n /**\n * This will be called on every set call.\n */\n\n\n Scope.prototype._notifyScopeListeners = function () {\n var _this = this; // We need this check for this._notifyingListeners to be able to work on scope during updates\n // If this check is not here we'll produce endless recursion when something is done with the scope\n // during the callback.\n\n\n if (!this._notifyingListeners) {\n this._notifyingListeners = true;\n\n this._scopeListeners.forEach(function (callback) {\n callback(_this);\n });\n\n this._notifyingListeners = false;\n }\n };\n /**\n * Applies fingerprint from the scope to the event if there's one,\n * uses message if there's one instead or get rid of empty fingerprint\n */\n\n\n Scope.prototype._applyFingerprint = function (event) {\n // Make sure it's an array first and we actually have something in place\n event.fingerprint = event.fingerprint ? Array.isArray(event.fingerprint) ? event.fingerprint : [event.fingerprint] : []; // If we have something on the scope, then merge it with event\n\n if (this._fingerprint) {\n event.fingerprint = event.fingerprint.concat(this._fingerprint);\n } // If we have no data at all, remove empty array default\n\n\n if (event.fingerprint && !event.fingerprint.length) {\n delete event.fingerprint;\n }\n };\n\n return Scope;\n}();\n\nexport { Scope };\n/**\n * Returns the global event processors.\n */\n\nfunction getGlobalEventProcessors() {\n return getGlobalSingleton('globalEventProcessors', function () {\n return [];\n });\n}\n/**\n * Add a EventProcessor to be kept globally.\n * @param callback EventProcessor to add\n */\n\n\nexport function addGlobalEventProcessor(callback) {\n getGlobalEventProcessors().push(callback);\n}","import { dropUndefinedKeys, timestampInSeconds, uuid4 } from '@sentry/utils';\n/**\n * @inheritdoc\n */\n\nvar Session = function () {\n function Session(context) {\n this.errors = 0;\n this.sid = uuid4();\n this.duration = 0;\n this.status = 'ok';\n this.init = true;\n this.ignoreDuration = false; // Both timestamp and started are in seconds since the UNIX epoch.\n\n var startingTime = timestampInSeconds();\n this.timestamp = startingTime;\n this.started = startingTime;\n\n if (context) {\n this.update(context);\n }\n }\n /** JSDoc */\n // eslint-disable-next-line complexity\n\n\n Session.prototype.update = function (context) {\n if (context === void 0) {\n context = {};\n }\n\n if (context.user) {\n if (!this.ipAddress && context.user.ip_address) {\n this.ipAddress = context.user.ip_address;\n }\n\n if (!this.did && !context.did) {\n this.did = context.user.id || context.user.email || context.user.username;\n }\n }\n\n this.timestamp = context.timestamp || timestampInSeconds();\n\n if (context.ignoreDuration) {\n this.ignoreDuration = context.ignoreDuration;\n }\n\n if (context.sid) {\n // Good enough uuid validation. — Kamil\n this.sid = context.sid.length === 32 ? context.sid : uuid4();\n }\n\n if (context.init !== undefined) {\n this.init = context.init;\n }\n\n if (!this.did && context.did) {\n this.did = \"\" + context.did;\n }\n\n if (typeof context.started === 'number') {\n this.started = context.started;\n }\n\n if (this.ignoreDuration) {\n this.duration = undefined;\n } else if (typeof context.duration === 'number') {\n this.duration = context.duration;\n } else {\n var duration = this.timestamp - this.started;\n this.duration = duration >= 0 ? duration : 0;\n }\n\n if (context.release) {\n this.release = context.release;\n }\n\n if (context.environment) {\n this.environment = context.environment;\n }\n\n if (!this.ipAddress && context.ipAddress) {\n this.ipAddress = context.ipAddress;\n }\n\n if (!this.userAgent && context.userAgent) {\n this.userAgent = context.userAgent;\n }\n\n if (typeof context.errors === 'number') {\n this.errors = context.errors;\n }\n\n if (context.status) {\n this.status = context.status;\n }\n };\n /** JSDoc */\n\n\n Session.prototype.close = function (status) {\n if (status) {\n this.update({\n status: status\n });\n } else if (this.status === 'ok') {\n this.update({\n status: 'exited'\n });\n } else {\n this.update();\n }\n };\n /** JSDoc */\n\n\n Session.prototype.toJSON = function () {\n return dropUndefinedKeys({\n sid: \"\" + this.sid,\n init: this.init,\n // Make sure that sec is converted to ms for date constructor\n started: new Date(this.started * 1000).toISOString(),\n timestamp: new Date(this.timestamp * 1000).toISOString(),\n status: this.status,\n errors: this.errors,\n did: typeof this.did === 'number' || typeof this.did === 'string' ? \"\" + this.did : undefined,\n duration: this.duration,\n attrs: {\n release: this.release,\n environment: this.environment,\n ip_address: this.ipAddress,\n user_agent: this.userAgent\n }\n });\n };\n\n return Session;\n}();\n\nexport { Session };","/*\n * This file defines flags and constants that can be modified during compile time in order to facilitate tree shaking\n * for users.\n *\n * Debug flags need to be declared in each package individually and must not be imported across package boundaries,\n * because some build tools have trouble tree-shaking imported guards.\n *\n * As a convention, we define debug flags in a `flags.ts` file in the root of a package's `src` folder.\n *\n * Debug flag files will contain \"magic strings\" like `__SENTRY_DEBUG__` that may get replaced with actual values during\n * our, or the user's build process. Take care when introducing new flags - they must not throw if they are not\n * replaced.\n */\n\n/** Flag that is true for debug builds, false otherwise. */\nexport var IS_DEBUG_BUILD = typeof __SENTRY_DEBUG__ === 'undefined' ? true : __SENTRY_DEBUG__;","import { __assign, __read, __spread } from \"tslib\";\nimport { consoleSandbox, dateTimestampInSeconds, getGlobalObject, getGlobalSingleton, isNodeEnv, logger, uuid4 } from '@sentry/utils';\nimport { IS_DEBUG_BUILD } from './flags';\nimport { Scope } from './scope';\nimport { Session } from './session';\n/**\n * API compatibility version of this hub.\n *\n * WARNING: This number should only be increased when the global interface\n * changes and new methods are introduced.\n *\n * @hidden\n */\n\nexport var API_VERSION = 4;\n/**\n * Default maximum number of breadcrumbs added to an event. Can be overwritten\n * with {@link Options.maxBreadcrumbs}.\n */\n\nvar DEFAULT_BREADCRUMBS = 100;\n/**\n * @inheritDoc\n */\n\nvar Hub = function () {\n /**\n * Creates a new instance of the hub, will push one {@link Layer} into the\n * internal stack on creation.\n *\n * @param client bound to the hub.\n * @param scope bound to the hub.\n * @param version number, higher number means higher priority.\n */\n function Hub(client, scope, _version) {\n if (scope === void 0) {\n scope = new Scope();\n }\n\n if (_version === void 0) {\n _version = API_VERSION;\n }\n\n this._version = _version;\n /** Is a {@link Layer}[] containing the client and scope */\n\n this._stack = [{}];\n this.getStackTop().scope = scope;\n\n if (client) {\n this.bindClient(client);\n }\n }\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.isOlderThan = function (version) {\n return this._version < version;\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.bindClient = function (client) {\n var top = this.getStackTop();\n top.client = client;\n\n if (client && client.setupIntegrations) {\n client.setupIntegrations();\n }\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.pushScope = function () {\n // We want to clone the content of prev scope\n var scope = Scope.clone(this.getScope());\n this.getStack().push({\n client: this.getClient(),\n scope: scope\n });\n return scope;\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.popScope = function () {\n if (this.getStack().length <= 1) return false;\n return !!this.getStack().pop();\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.withScope = function (callback) {\n var scope = this.pushScope();\n\n try {\n callback(scope);\n } finally {\n this.popScope();\n }\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.getClient = function () {\n return this.getStackTop().client;\n };\n /** Returns the scope of the top stack. */\n\n\n Hub.prototype.getScope = function () {\n return this.getStackTop().scope;\n };\n /** Returns the scope stack for domains or the process. */\n\n\n Hub.prototype.getStack = function () {\n return this._stack;\n };\n /** Returns the topmost scope layer in the order domain > local > process. */\n\n\n Hub.prototype.getStackTop = function () {\n return this._stack[this._stack.length - 1];\n };\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\n\n\n Hub.prototype.captureException = function (exception, hint) {\n var eventId = this._lastEventId = hint && hint.event_id ? hint.event_id : uuid4();\n var finalHint = hint; // If there's no explicit hint provided, mimic the same thing that would happen\n // in the minimal itself to create a consistent behavior.\n // We don't do this in the client, as it's the lowest level API, and doing this,\n // would prevent user from having full control over direct calls.\n\n if (!hint) {\n var syntheticException = void 0;\n\n try {\n throw new Error('Sentry syntheticException');\n } catch (exception) {\n syntheticException = exception;\n }\n\n finalHint = {\n originalException: exception,\n syntheticException: syntheticException\n };\n }\n\n this._invokeClient('captureException', exception, __assign(__assign({}, finalHint), {\n event_id: eventId\n }));\n\n return eventId;\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.captureMessage = function (message, level, hint) {\n var eventId = this._lastEventId = hint && hint.event_id ? hint.event_id : uuid4();\n var finalHint = hint; // If there's no explicit hint provided, mimic the same thing that would happen\n // in the minimal itself to create a consistent behavior.\n // We don't do this in the client, as it's the lowest level API, and doing this,\n // would prevent user from having full control over direct calls.\n\n if (!hint) {\n var syntheticException = void 0;\n\n try {\n throw new Error(message);\n } catch (exception) {\n syntheticException = exception;\n }\n\n finalHint = {\n originalException: message,\n syntheticException: syntheticException\n };\n }\n\n this._invokeClient('captureMessage', message, level, __assign(__assign({}, finalHint), {\n event_id: eventId\n }));\n\n return eventId;\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.captureEvent = function (event, hint) {\n var eventId = hint && hint.event_id ? hint.event_id : uuid4();\n\n if (event.type !== 'transaction') {\n this._lastEventId = eventId;\n }\n\n this._invokeClient('captureEvent', event, __assign(__assign({}, hint), {\n event_id: eventId\n }));\n\n return eventId;\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.lastEventId = function () {\n return this._lastEventId;\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.addBreadcrumb = function (breadcrumb, hint) {\n var _a = this.getStackTop(),\n scope = _a.scope,\n client = _a.client;\n\n if (!scope || !client) return; // eslint-disable-next-line @typescript-eslint/unbound-method\n\n var _b = client.getOptions && client.getOptions() || {},\n _c = _b.beforeBreadcrumb,\n beforeBreadcrumb = _c === void 0 ? null : _c,\n _d = _b.maxBreadcrumbs,\n maxBreadcrumbs = _d === void 0 ? DEFAULT_BREADCRUMBS : _d;\n\n if (maxBreadcrumbs <= 0) return;\n var timestamp = dateTimestampInSeconds();\n\n var mergedBreadcrumb = __assign({\n timestamp: timestamp\n }, breadcrumb);\n\n var finalBreadcrumb = beforeBreadcrumb ? consoleSandbox(function () {\n return beforeBreadcrumb(mergedBreadcrumb, hint);\n }) : mergedBreadcrumb;\n if (finalBreadcrumb === null) return;\n scope.addBreadcrumb(finalBreadcrumb, maxBreadcrumbs);\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.setUser = function (user) {\n var scope = this.getScope();\n if (scope) scope.setUser(user);\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.setTags = function (tags) {\n var scope = this.getScope();\n if (scope) scope.setTags(tags);\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.setExtras = function (extras) {\n var scope = this.getScope();\n if (scope) scope.setExtras(extras);\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.setTag = function (key, value) {\n var scope = this.getScope();\n if (scope) scope.setTag(key, value);\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.setExtra = function (key, extra) {\n var scope = this.getScope();\n if (scope) scope.setExtra(key, extra);\n };\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n\n Hub.prototype.setContext = function (name, context) {\n var scope = this.getScope();\n if (scope) scope.setContext(name, context);\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.configureScope = function (callback) {\n var _a = this.getStackTop(),\n scope = _a.scope,\n client = _a.client;\n\n if (scope && client) {\n callback(scope);\n }\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.run = function (callback) {\n var oldHub = makeMain(this);\n\n try {\n callback(this);\n } finally {\n makeMain(oldHub);\n }\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.getIntegration = function (integration) {\n var client = this.getClient();\n if (!client) return null;\n\n try {\n return client.getIntegration(integration);\n } catch (_oO) {\n IS_DEBUG_BUILD && logger.warn(\"Cannot retrieve integration \" + integration.id + \" from the current Hub\");\n return null;\n }\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.startSpan = function (context) {\n return this._callExtensionMethod('startSpan', context);\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.startTransaction = function (context, customSamplingContext) {\n return this._callExtensionMethod('startTransaction', context, customSamplingContext);\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.traceHeaders = function () {\n return this._callExtensionMethod('traceHeaders');\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.captureSession = function (endSession) {\n if (endSession === void 0) {\n endSession = false;\n } // both send the update and pull the session from the scope\n\n\n if (endSession) {\n return this.endSession();\n } // only send the update\n\n\n this._sendSessionUpdate();\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.endSession = function () {\n var layer = this.getStackTop();\n var scope = layer && layer.scope;\n var session = scope && scope.getSession();\n\n if (session) {\n session.close();\n }\n\n this._sendSessionUpdate(); // the session is over; take it off of the scope\n\n\n if (scope) {\n scope.setSession();\n }\n };\n /**\n * @inheritDoc\n */\n\n\n Hub.prototype.startSession = function (context) {\n var _a = this.getStackTop(),\n scope = _a.scope,\n client = _a.client;\n\n var _b = client && client.getOptions() || {},\n release = _b.release,\n environment = _b.environment; // Will fetch userAgent if called from browser sdk\n\n\n var global = getGlobalObject();\n var userAgent = (global.navigator || {}).userAgent;\n var session = new Session(__assign(__assign(__assign({\n release: release,\n environment: environment\n }, scope && {\n user: scope.getUser()\n }), userAgent && {\n userAgent: userAgent\n }), context));\n\n if (scope) {\n // End existing session if there's one\n var currentSession = scope.getSession && scope.getSession();\n\n if (currentSession && currentSession.status === 'ok') {\n currentSession.update({\n status: 'exited'\n });\n }\n\n this.endSession(); // Afterwards we set the new session on the scope\n\n scope.setSession(session);\n }\n\n return session;\n };\n /**\n * Sends the current Session on the scope\n */\n\n\n Hub.prototype._sendSessionUpdate = function () {\n var _a = this.getStackTop(),\n scope = _a.scope,\n client = _a.client;\n\n if (!scope) return;\n var session = scope.getSession && scope.getSession();\n\n if (session) {\n if (client && client.captureSession) {\n client.captureSession(session);\n }\n }\n };\n /**\n * Internal helper function to call a method on the top client if it exists.\n *\n * @param method The method to call on the client.\n * @param args Arguments to pass to the client function.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n\n Hub.prototype._invokeClient = function (method) {\n var _a;\n\n var args = [];\n\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n\n var _b = this.getStackTop(),\n scope = _b.scope,\n client = _b.client;\n\n if (client && client[method]) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n (_a = client)[method].apply(_a, __spread(args, [scope]));\n }\n };\n /**\n * Calls global extension method and binding current instance to the function call\n */\n // @ts-ignore Function lacks ending return statement and return type does not include 'undefined'. ts(2366)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n\n Hub.prototype._callExtensionMethod = function (method) {\n var args = [];\n\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n\n var carrier = getMainCarrier();\n var sentry = carrier.__SENTRY__;\n\n if (sentry && sentry.extensions && typeof sentry.extensions[method] === 'function') {\n return sentry.extensions[method].apply(this, args);\n }\n\n IS_DEBUG_BUILD && logger.warn(\"Extension method \" + method + \" couldn't be found, doing nothing.\");\n };\n\n return Hub;\n}();\n\nexport { Hub };\n/**\n * Returns the global shim registry.\n *\n * FIXME: This function is problematic, because despite always returning a valid Carrier,\n * it has an optional `__SENTRY__` property, which then in turn requires us to always perform an unnecessary check\n * at the call-site. We always access the carrier through this function, so we can guarantee that `__SENTRY__` is there.\n **/\n\nexport function getMainCarrier() {\n var carrier = getGlobalObject();\n carrier.__SENTRY__ = carrier.__SENTRY__ || {\n extensions: {},\n hub: undefined\n };\n return carrier;\n}\n/**\n * Replaces the current main hub with the passed one on the global object\n *\n * @returns The old replaced hub\n */\n\nexport function makeMain(hub) {\n var registry = getMainCarrier();\n var oldHub = getHubFromCarrier(registry);\n setHubOnCarrier(registry, hub);\n return oldHub;\n}\n/**\n * Returns the default hub instance.\n *\n * If a hub is already registered in the global carrier but this module\n * contains a more recent version, it replaces the registered version.\n * Otherwise, the currently registered hub will be returned.\n */\n\nexport function getCurrentHub() {\n // Get main carrier (global for every environment)\n var registry = getMainCarrier(); // If there's no hub, or its an old API, assign a new one\n\n if (!hasHubOnCarrier(registry) || getHubFromCarrier(registry).isOlderThan(API_VERSION)) {\n setHubOnCarrier(registry, new Hub());\n } // Prefer domains over global if they are there (applicable only to Node environment)\n\n\n if (isNodeEnv()) {\n return getHubFromActiveDomain(registry);\n } // Return hub that lives on a global object\n\n\n return getHubFromCarrier(registry);\n}\n/**\n * Returns the active domain, if one exists\n * @deprecated No longer used; remove in v7\n * @returns The domain, or undefined if there is no active domain\n */\n// eslint-disable-next-line deprecation/deprecation\n\nexport function getActiveDomain() {\n IS_DEBUG_BUILD && logger.warn('Function `getActiveDomain` is deprecated and will be removed in a future version.');\n\n var sentry = getMainCarrier().__SENTRY__;\n\n return sentry && sentry.extensions && sentry.extensions.domain && sentry.extensions.domain.active;\n}\n/**\n * Try to read the hub from an active domain, and fallback to the registry if one doesn't exist\n * @returns discovered hub\n */\n\nfunction getHubFromActiveDomain(registry) {\n try {\n var sentry = getMainCarrier().__SENTRY__;\n\n var activeDomain = sentry && sentry.extensions && sentry.extensions.domain && sentry.extensions.domain.active; // If there's no active domain, just return global hub\n\n if (!activeDomain) {\n return getHubFromCarrier(registry);\n } // If there's no hub on current domain, or it's an old API, assign a new one\n\n\n if (!hasHubOnCarrier(activeDomain) || getHubFromCarrier(activeDomain).isOlderThan(API_VERSION)) {\n var registryHubTopStack = getHubFromCarrier(registry).getStackTop();\n setHubOnCarrier(activeDomain, new Hub(registryHubTopStack.client, Scope.clone(registryHubTopStack.scope)));\n } // Return hub that lives on a domain\n\n\n return getHubFromCarrier(activeDomain);\n } catch (_Oo) {\n // Return hub that lives on a global object\n return getHubFromCarrier(registry);\n }\n}\n/**\n * This will tell whether a carrier has a hub on it or not\n * @param carrier object\n */\n\n\nfunction hasHubOnCarrier(carrier) {\n return !!(carrier && carrier.__SENTRY__ && carrier.__SENTRY__.hub);\n}\n/**\n * This will create a new {@link Hub} and add to the passed object on\n * __SENTRY__.hub.\n * @param carrier object\n * @hidden\n */\n\n\nexport function getHubFromCarrier(carrier) {\n return getGlobalSingleton('hub', function () {\n return new Hub();\n }, carrier);\n}\n/**\n * This will set passed {@link Hub} on the passed object's __SENTRY__.hub attribute\n * @param carrier object\n * @param hub Hub\n * @returns A boolean indicating success or failure\n */\n\nexport function setHubOnCarrier(carrier, hub) {\n if (!carrier) return false;\n\n var __SENTRY__ = carrier.__SENTRY__ = carrier.__SENTRY__ || {};\n\n __SENTRY__.hub = hub;\n return true;\n}","import { dropUndefinedKeys, logger } from '@sentry/utils';\nimport { IS_DEBUG_BUILD } from './flags';\nimport { getCurrentHub } from './hub';\n/**\n * @inheritdoc\n */\n\nvar SessionFlusher = function () {\n function SessionFlusher(transport, attrs) {\n var _this = this;\n\n this.flushTimeout = 60;\n this._pendingAggregates = {};\n this._isEnabled = true;\n this._transport = transport; // Call to setInterval, so that flush is called every 60 seconds\n\n this._intervalId = setInterval(function () {\n return _this.flush();\n }, this.flushTimeout * 1000);\n this._sessionAttrs = attrs;\n }\n /** Sends session aggregates to Transport */\n\n\n SessionFlusher.prototype.sendSessionAggregates = function (sessionAggregates) {\n if (!this._transport.sendSession) {\n IS_DEBUG_BUILD && logger.warn(\"Dropping session because custom transport doesn't implement sendSession\");\n return;\n }\n\n void this._transport.sendSession(sessionAggregates).then(null, function (reason) {\n IS_DEBUG_BUILD && logger.error('Error while sending session:', reason);\n });\n };\n /** Checks if `pendingAggregates` has entries, and if it does flushes them by calling `sendSessions` */\n\n\n SessionFlusher.prototype.flush = function () {\n var sessionAggregates = this.getSessionAggregates();\n\n if (sessionAggregates.aggregates.length === 0) {\n return;\n }\n\n this._pendingAggregates = {};\n this.sendSessionAggregates(sessionAggregates);\n };\n /** Massages the entries in `pendingAggregates` and returns aggregated sessions */\n\n\n SessionFlusher.prototype.getSessionAggregates = function () {\n var _this = this;\n\n var aggregates = Object.keys(this._pendingAggregates).map(function (key) {\n return _this._pendingAggregates[parseInt(key)];\n });\n var sessionAggregates = {\n attrs: this._sessionAttrs,\n aggregates: aggregates\n };\n return dropUndefinedKeys(sessionAggregates);\n };\n /** JSDoc */\n\n\n SessionFlusher.prototype.close = function () {\n clearInterval(this._intervalId);\n this._isEnabled = false;\n this.flush();\n };\n /**\n * Wrapper function for _incrementSessionStatusCount that checks if the instance of SessionFlusher is enabled then\n * fetches the session status of the request from `Scope.getRequestSession().status` on the scope and passes them to\n * `_incrementSessionStatusCount` along with the start date\n */\n\n\n SessionFlusher.prototype.incrementSessionStatusCount = function () {\n if (!this._isEnabled) {\n return;\n }\n\n var scope = getCurrentHub().getScope();\n var requestSession = scope && scope.getRequestSession();\n\n if (requestSession && requestSession.status) {\n this._incrementSessionStatusCount(requestSession.status, new Date()); // This is not entirely necessarily but is added as a safe guard to indicate the bounds of a request and so in\n // case captureRequestSession is called more than once to prevent double count\n\n\n if (scope) {\n scope.setRequestSession(undefined);\n }\n /* eslint-enable @typescript-eslint/no-unsafe-member-access */\n\n }\n };\n /**\n * Increments status bucket in pendingAggregates buffer (internal state) corresponding to status of\n * the session received\n */\n\n\n SessionFlusher.prototype._incrementSessionStatusCount = function (status, date) {\n // Truncate minutes and seconds on Session Started attribute to have one minute bucket keys\n var sessionStartedTrunc = new Date(date).setSeconds(0, 0);\n this._pendingAggregates[sessionStartedTrunc] = this._pendingAggregates[sessionStartedTrunc] || {}; // corresponds to aggregated sessions in one specific minute bucket\n // for example, {\"started\":\"2021-03-16T08:00:00.000Z\",\"exited\":4, \"errored\": 1}\n\n var aggregationCounts = this._pendingAggregates[sessionStartedTrunc];\n\n if (!aggregationCounts.started) {\n aggregationCounts.started = new Date(sessionStartedTrunc).toISOString();\n }\n\n switch (status) {\n case 'errored':\n aggregationCounts.errored = (aggregationCounts.errored || 0) + 1;\n return aggregationCounts.errored;\n\n case 'ok':\n aggregationCounts.exited = (aggregationCounts.exited || 0) + 1;\n return aggregationCounts.exited;\n\n default:\n aggregationCounts.crashed = (aggregationCounts.crashed || 0) + 1;\n return aggregationCounts.crashed;\n }\n };\n\n return SessionFlusher;\n}();\n\nexport { SessionFlusher };","import { __assign, __read, __spread } from \"tslib\";\nimport { getCurrentHub } from '@sentry/hub';\n/**\n * This calls a function on the current hub.\n * @param method function to call on hub.\n * @param args to pass to function.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\nfunction callOnHub(method) {\n var args = [];\n\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n\n var hub = getCurrentHub();\n\n if (hub && hub[method]) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return hub[method].apply(hub, __spread(args));\n }\n\n throw new Error(\"No hub defined or \" + method + \" was not found on the hub, please open a bug report.\");\n}\n/**\n * Captures an exception event and sends it to Sentry.\n *\n * @param exception An exception-like object.\n * @returns The generated eventId.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\n\n\nexport function captureException(exception, captureContext) {\n var syntheticException = new Error('Sentry syntheticException');\n return callOnHub('captureException', exception, {\n captureContext: captureContext,\n originalException: exception,\n syntheticException: syntheticException\n });\n}\n/**\n * Captures a message event and sends it to Sentry.\n *\n * @param message The message to send to Sentry.\n * @param Severity Define the level of the message.\n * @returns The generated eventId.\n */\n\nexport function captureMessage(message, captureContext) {\n var syntheticException = new Error(message); // This is necessary to provide explicit scopes upgrade, without changing the original\n // arity of the `captureMessage(message, level)` method.\n\n var level = typeof captureContext === 'string' ? captureContext : undefined;\n var context = typeof captureContext !== 'string' ? {\n captureContext: captureContext\n } : undefined;\n return callOnHub('captureMessage', message, level, __assign({\n originalException: message,\n syntheticException: syntheticException\n }, context));\n}\n/**\n * Captures a manually created event and sends it to Sentry.\n *\n * @param event The event to send to Sentry.\n * @returns The generated eventId.\n */\n\nexport function captureEvent(event) {\n return callOnHub('captureEvent', event);\n}\n/**\n * Callback to set context information onto the scope.\n * @param callback Callback function that receives Scope.\n */\n\nexport function configureScope(callback) {\n callOnHub('configureScope', callback);\n}\n/**\n * Records a new breadcrumb which will be attached to future events.\n *\n * Breadcrumbs will be added to subsequent events to provide more context on\n * user's actions prior to an error or crash.\n *\n * @param breadcrumb The breadcrumb to record.\n */\n\nexport function addBreadcrumb(breadcrumb) {\n callOnHub('addBreadcrumb', breadcrumb);\n}\n/**\n * Sets context data with the given name.\n * @param name of the context\n * @param context Any kind of data. This data will be normalized.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\nexport function setContext(name, context) {\n callOnHub('setContext', name, context);\n}\n/**\n * Set an object that will be merged sent as extra data with the event.\n * @param extras Extras object to merge into current context.\n */\n\nexport function setExtras(extras) {\n callOnHub('setExtras', extras);\n}\n/**\n * Set an object that will be merged sent as tags data with the event.\n * @param tags Tags context object to merge into current context.\n */\n\nexport function setTags(tags) {\n callOnHub('setTags', tags);\n}\n/**\n * Set key:value that will be sent as extra data with the event.\n * @param key String of extra\n * @param extra Any kind of data. This data will be normalized.\n */\n\nexport function setExtra(key, extra) {\n callOnHub('setExtra', key, extra);\n}\n/**\n * Set key:value that will be sent as tags data with the event.\n *\n * Can also be used to unset a tag, by passing `undefined`.\n *\n * @param key String key of tag\n * @param value Value of tag\n */\n\nexport function setTag(key, value) {\n callOnHub('setTag', key, value);\n}\n/**\n * Updates user context information for future events.\n *\n * @param user User context object to be set in the current context. Pass `null` to unset the user.\n */\n\nexport function setUser(user) {\n callOnHub('setUser', user);\n}\n/**\n * Creates a new scope with and executes the given operation within.\n * The scope is automatically removed once the operation\n * finishes or throws.\n *\n * This is essentially a convenience function for:\n *\n * pushScope();\n * callback();\n * popScope();\n *\n * @param callback that will be enclosed into push/popScope.\n */\n\nexport function withScope(callback) {\n callOnHub('withScope', callback);\n}\n/**\n * Calls a function on the latest client. Use this with caution, it's meant as\n * in \"internal\" helper so we don't need to expose every possible function in\n * the shim. It is not guaranteed that the client actually implements the\n * function.\n *\n * @param method The method to call on the client/client.\n * @param args Arguments to pass to the client/fontend.\n * @hidden\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\nexport function _callOnClient(method) {\n var args = [];\n\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n\n callOnHub.apply(void 0, __spread(['_invokeClient', method], args));\n}\n/**\n * Starts a new `Transaction` and returns it. This is the entry point to manual tracing instrumentation.\n *\n * A tree structure can be built by adding child spans to the transaction, and child spans to other spans. To start a\n * new child span within the transaction or any span, call the respective `.startChild()` method.\n *\n * Every child span must be finished before the transaction is finished, otherwise the unfinished spans are discarded.\n *\n * The transaction must be finished with a call to its `.finish()` method, at which point the transaction with all its\n * finished child spans will be sent to Sentry.\n *\n * @param context Properties of the new `Transaction`.\n * @param customSamplingContext Information given to the transaction sampling function (along with context-dependent\n * default values). See {@link Options.tracesSampler}.\n *\n * @returns The transaction which was just started\n */\n\nexport function startTransaction(context, customSamplingContext) {\n return callOnHub('startTransaction', __assign({}, context), customSamplingContext);\n}","import { dsnToString, makeDsn, urlEncode } from '@sentry/utils';\nvar SENTRY_API_VERSION = '7';\n/**\n * Helper class to provide urls, headers and metadata that can be used to form\n * different types of requests to Sentry endpoints.\n * Supports both envelopes and regular event requests.\n *\n * @deprecated Please use APIDetails\n **/\n\nvar API = function () {\n /** Create a new instance of API */\n function API(dsn, metadata, tunnel) {\n if (metadata === void 0) {\n metadata = {};\n }\n\n this.dsn = dsn;\n this._dsnObject = makeDsn(dsn);\n this.metadata = metadata;\n this._tunnel = tunnel;\n }\n /** Returns the Dsn object. */\n\n\n API.prototype.getDsn = function () {\n return this._dsnObject;\n };\n /** Does this transport force envelopes? */\n\n\n API.prototype.forceEnvelope = function () {\n return !!this._tunnel;\n };\n /** Returns the prefix to construct Sentry ingestion API endpoints. */\n\n\n API.prototype.getBaseApiEndpoint = function () {\n return getBaseApiEndpoint(this._dsnObject);\n };\n /** Returns the store endpoint URL. */\n\n\n API.prototype.getStoreEndpoint = function () {\n return getStoreEndpoint(this._dsnObject);\n };\n /**\n * Returns the store endpoint URL with auth in the query string.\n *\n * Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests.\n */\n\n\n API.prototype.getStoreEndpointWithUrlEncodedAuth = function () {\n return getStoreEndpointWithUrlEncodedAuth(this._dsnObject);\n };\n /**\n * Returns the envelope endpoint URL with auth in the query string.\n *\n * Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests.\n */\n\n\n API.prototype.getEnvelopeEndpointWithUrlEncodedAuth = function () {\n return getEnvelopeEndpointWithUrlEncodedAuth(this._dsnObject, this._tunnel);\n };\n\n return API;\n}();\n\nexport { API };\n/** Initializes API Details */\n\nexport function initAPIDetails(dsn, metadata, tunnel) {\n return {\n initDsn: dsn,\n metadata: metadata || {},\n dsn: makeDsn(dsn),\n tunnel: tunnel\n };\n}\n/** Returns the prefix to construct Sentry ingestion API endpoints. */\n\nfunction getBaseApiEndpoint(dsn) {\n var protocol = dsn.protocol ? dsn.protocol + \":\" : '';\n var port = dsn.port ? \":\" + dsn.port : '';\n return protocol + \"//\" + dsn.host + port + (dsn.path ? \"/\" + dsn.path : '') + \"/api/\";\n}\n/** Returns the ingest API endpoint for target. */\n\n\nfunction _getIngestEndpoint(dsn, target) {\n return \"\" + getBaseApiEndpoint(dsn) + dsn.projectId + \"/\" + target + \"/\";\n}\n/** Returns a URL-encoded string with auth config suitable for a query string. */\n\n\nfunction _encodedAuth(dsn) {\n return urlEncode({\n // We send only the minimum set of required information. See\n // https://github.com/getsentry/sentry-javascript/issues/2572.\n sentry_key: dsn.publicKey,\n sentry_version: SENTRY_API_VERSION\n });\n}\n/** Returns the store endpoint URL. */\n\n\nfunction getStoreEndpoint(dsn) {\n return _getIngestEndpoint(dsn, 'store');\n}\n/**\n * Returns the store endpoint URL with auth in the query string.\n *\n * Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests.\n */\n\n\nexport function getStoreEndpointWithUrlEncodedAuth(dsn) {\n return getStoreEndpoint(dsn) + \"?\" + _encodedAuth(dsn);\n}\n/** Returns the envelope endpoint URL. */\n\nfunction _getEnvelopeEndpoint(dsn) {\n return _getIngestEndpoint(dsn, 'envelope');\n}\n/**\n * Returns the envelope endpoint URL with auth in the query string.\n *\n * Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests.\n */\n\n\nexport function getEnvelopeEndpointWithUrlEncodedAuth(dsn, tunnel) {\n return tunnel ? tunnel : _getEnvelopeEndpoint(dsn) + \"?\" + _encodedAuth(dsn);\n}\n/**\n * Returns an object that can be used in request headers.\n * This is needed for node and the old /store endpoint in sentry\n */\n\nexport function getRequestHeaders(dsn, clientName, clientVersion) {\n // CHANGE THIS to use metadata but keep clientName and clientVersion compatible\n var header = [\"Sentry sentry_version=\" + SENTRY_API_VERSION];\n header.push(\"sentry_client=\" + clientName + \"/\" + clientVersion);\n header.push(\"sentry_key=\" + dsn.publicKey);\n\n if (dsn.pass) {\n header.push(\"sentry_secret=\" + dsn.pass);\n }\n\n return {\n 'Content-Type': 'application/json',\n 'X-Sentry-Auth': header.join(', ')\n };\n}\n/** Returns the url to the report dialog endpoint. */\n\nexport function getReportDialogEndpoint(dsnLike, dialogOptions) {\n var dsn = makeDsn(dsnLike);\n var endpoint = getBaseApiEndpoint(dsn) + \"embed/error-page/\";\n var encodedOptions = \"dsn=\" + dsnToString(dsn);\n\n for (var key in dialogOptions) {\n if (key === 'dsn') {\n continue;\n }\n\n if (key === 'user') {\n if (!dialogOptions.user) {\n continue;\n }\n\n if (dialogOptions.user.name) {\n encodedOptions += \"&name=\" + encodeURIComponent(dialogOptions.user.name);\n }\n\n if (dialogOptions.user.email) {\n encodedOptions += \"&email=\" + encodeURIComponent(dialogOptions.user.email);\n }\n } else {\n encodedOptions += \"&\" + encodeURIComponent(key) + \"=\" + encodeURIComponent(dialogOptions[key]);\n }\n }\n\n return endpoint + \"?\" + encodedOptions;\n}","/*\n * This file defines flags and constants that can be modified during compile time in order to facilitate tree shaking\n * for users.\n *\n * Debug flags need to be declared in each package individually and must not be imported across package boundaries,\n * because some build tools have trouble tree-shaking imported guards.\n *\n * As a convention, we define debug flags in a `flags.ts` file in the root of a package's `src` folder.\n *\n * Debug flag files will contain \"magic strings\" like `__SENTRY_DEBUG__` that may get replaced with actual values during\n * our, or the user's build process. Take care when introducing new flags - they must not throw if they are not\n * replaced.\n */\n\n/** Flag that is true for debug builds, false otherwise. */\nexport var IS_DEBUG_BUILD = typeof __SENTRY_DEBUG__ === 'undefined' ? true : __SENTRY_DEBUG__;","import { __read, __spread } from \"tslib\";\nimport { addGlobalEventProcessor, getCurrentHub } from '@sentry/hub';\nimport { addNonEnumerableProperty, logger } from '@sentry/utils';\nimport { IS_DEBUG_BUILD } from './flags';\nexport var installedIntegrations = [];\n/**\n * @private\n */\n\nfunction filterDuplicates(integrations) {\n return integrations.reduce(function (acc, integrations) {\n if (acc.every(function (accIntegration) {\n return integrations.name !== accIntegration.name;\n })) {\n acc.push(integrations);\n }\n\n return acc;\n }, []);\n}\n/** Gets integration to install */\n\n\nexport function getIntegrationsToSetup(options) {\n var defaultIntegrations = options.defaultIntegrations && __spread(options.defaultIntegrations) || [];\n var userIntegrations = options.integrations;\n\n var integrations = __spread(filterDuplicates(defaultIntegrations));\n\n if (Array.isArray(userIntegrations)) {\n // Filter out integrations that are also included in user options\n integrations = __spread(integrations.filter(function (integrations) {\n return userIntegrations.every(function (userIntegration) {\n return userIntegration.name !== integrations.name;\n });\n }), filterDuplicates(userIntegrations));\n } else if (typeof userIntegrations === 'function') {\n integrations = userIntegrations(integrations);\n integrations = Array.isArray(integrations) ? integrations : [integrations];\n } // Make sure that if present, `Debug` integration will always run last\n\n\n var integrationsNames = integrations.map(function (i) {\n return i.name;\n });\n var alwaysLastToRun = 'Debug';\n\n if (integrationsNames.indexOf(alwaysLastToRun) !== -1) {\n integrations.push.apply(integrations, __spread(integrations.splice(integrationsNames.indexOf(alwaysLastToRun), 1)));\n }\n\n return integrations;\n}\n/** Setup given integration */\n\nexport function setupIntegration(integration) {\n if (installedIntegrations.indexOf(integration.name) !== -1) {\n return;\n }\n\n integration.setupOnce(addGlobalEventProcessor, getCurrentHub);\n installedIntegrations.push(integration.name);\n IS_DEBUG_BUILD && logger.log(\"Integration installed: \" + integration.name);\n}\n/**\n * Given a list of integration instances this installs them all. When `withDefaults` is set to `true` then all default\n * integrations are added unless they were already provided before.\n * @param integrations array of integration instances\n * @param withDefault should enable default integrations\n */\n\nexport function setupIntegrations(options) {\n var integrations = {};\n getIntegrationsToSetup(options).forEach(function (integration) {\n integrations[integration.name] = integration;\n setupIntegration(integration);\n }); // set the `initialized` flag so we don't run through the process again unecessarily; use `Object.defineProperty`\n // because by default it creates a property which is nonenumerable, which we want since `initialized` shouldn't be\n // considered a member of the index the way the actual integrations are\n\n addNonEnumerableProperty(integrations, 'initialized', true);\n return integrations;\n}","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport { __assign, __read, __spread, __values } from \"tslib\";\n/* eslint-disable max-lines */\n\nimport { Scope } from '@sentry/hub';\nimport { checkOrSetAlreadyCaught, dateTimestampInSeconds, isPlainObject, isPrimitive, isThenable, logger, makeDsn, normalize, rejectedSyncPromise, resolvedSyncPromise, SentryError, SyncPromise, truncate, uuid4 } from '@sentry/utils';\nimport { IS_DEBUG_BUILD } from './flags';\nimport { setupIntegrations } from './integration';\nvar ALREADY_SEEN_ERROR = \"Not capturing exception because it's already been captured.\";\n/**\n * Base implementation for all JavaScript SDK clients.\n *\n * Call the constructor with the corresponding backend constructor and options\n * specific to the client subclass. To access these options later, use\n * {@link Client.getOptions}. Also, the Backend instance is available via\n * {@link Client.getBackend}.\n *\n * If a Dsn is specified in the options, it will be parsed and stored. Use\n * {@link Client.getDsn} to retrieve the Dsn at any moment. In case the Dsn is\n * invalid, the constructor will throw a {@link SentryException}. Note that\n * without a valid Dsn, the SDK will not send any events to Sentry.\n *\n * Before sending an event via the backend, it is passed through\n * {@link BaseClient._prepareEvent} to add SDK information and scope data\n * (breadcrumbs and context). To add more custom information, override this\n * method and extend the resulting prepared event.\n *\n * To issue automatically created events (e.g. via instrumentation), use\n * {@link Client.captureEvent}. It will prepare the event and pass it through\n * the callback lifecycle. To issue auto-breadcrumbs, use\n * {@link Client.addBreadcrumb}.\n *\n * @example\n * class NodeClient extends BaseClient {\n * public constructor(options: NodeOptions) {\n * super(NodeBackend, options);\n * }\n *\n * // ...\n * }\n */\n\nvar BaseClient = function () {\n /**\n * Initializes this client instance.\n *\n * @param backendClass A constructor function to create the backend.\n * @param options Options for the client.\n */\n function BaseClient(backendClass, options) {\n /** Array of used integrations. */\n this._integrations = {};\n /** Number of calls being processed */\n\n this._numProcessing = 0;\n this._backend = new backendClass(options);\n this._options = options;\n\n if (options.dsn) {\n this._dsn = makeDsn(options.dsn);\n }\n }\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\n\n\n BaseClient.prototype.captureException = function (exception, hint, scope) {\n var _this = this; // ensure we haven't captured this very object before\n\n\n if (checkOrSetAlreadyCaught(exception)) {\n IS_DEBUG_BUILD && logger.log(ALREADY_SEEN_ERROR);\n return;\n }\n\n var eventId = hint && hint.event_id;\n\n this._process(this._getBackend().eventFromException(exception, hint).then(function (event) {\n return _this._captureEvent(event, hint, scope);\n }).then(function (result) {\n eventId = result;\n }));\n\n return eventId;\n };\n /**\n * @inheritDoc\n */\n\n\n BaseClient.prototype.captureMessage = function (message, level, hint, scope) {\n var _this = this;\n\n var eventId = hint && hint.event_id;\n var promisedEvent = isPrimitive(message) ? this._getBackend().eventFromMessage(String(message), level, hint) : this._getBackend().eventFromException(message, hint);\n\n this._process(promisedEvent.then(function (event) {\n return _this._captureEvent(event, hint, scope);\n }).then(function (result) {\n eventId = result;\n }));\n\n return eventId;\n };\n /**\n * @inheritDoc\n */\n\n\n BaseClient.prototype.captureEvent = function (event, hint, scope) {\n // ensure we haven't captured this very object before\n if (hint && hint.originalException && checkOrSetAlreadyCaught(hint.originalException)) {\n IS_DEBUG_BUILD && logger.log(ALREADY_SEEN_ERROR);\n return;\n }\n\n var eventId = hint && hint.event_id;\n\n this._process(this._captureEvent(event, hint, scope).then(function (result) {\n eventId = result;\n }));\n\n return eventId;\n };\n /**\n * @inheritDoc\n */\n\n\n BaseClient.prototype.captureSession = function (session) {\n if (!this._isEnabled()) {\n IS_DEBUG_BUILD && logger.warn('SDK not enabled, will not capture session.');\n return;\n }\n\n if (!(typeof session.release === 'string')) {\n IS_DEBUG_BUILD && logger.warn('Discarded session because of missing or non-string release');\n } else {\n this._sendSession(session); // After sending, we set init false to indicate it's not the first occurrence\n\n\n session.update({\n init: false\n });\n }\n };\n /**\n * @inheritDoc\n */\n\n\n BaseClient.prototype.getDsn = function () {\n return this._dsn;\n };\n /**\n * @inheritDoc\n */\n\n\n BaseClient.prototype.getOptions = function () {\n return this._options;\n };\n /**\n * @inheritDoc\n */\n\n\n BaseClient.prototype.getTransport = function () {\n return this._getBackend().getTransport();\n };\n /**\n * @inheritDoc\n */\n\n\n BaseClient.prototype.flush = function (timeout) {\n var _this = this;\n\n return this._isClientDoneProcessing(timeout).then(function (clientFinished) {\n return _this.getTransport().close(timeout).then(function (transportFlushed) {\n return clientFinished && transportFlushed;\n });\n });\n };\n /**\n * @inheritDoc\n */\n\n\n BaseClient.prototype.close = function (timeout) {\n var _this = this;\n\n return this.flush(timeout).then(function (result) {\n _this.getOptions().enabled = false;\n return result;\n });\n };\n /**\n * Sets up the integrations\n */\n\n\n BaseClient.prototype.setupIntegrations = function () {\n if (this._isEnabled() && !this._integrations.initialized) {\n this._integrations = setupIntegrations(this._options);\n }\n };\n /**\n * @inheritDoc\n */\n\n\n BaseClient.prototype.getIntegration = function (integration) {\n try {\n return this._integrations[integration.id] || null;\n } catch (_oO) {\n IS_DEBUG_BUILD && logger.warn(\"Cannot retrieve integration \" + integration.id + \" from the current Client\");\n return null;\n }\n };\n /** Updates existing session based on the provided event */\n\n\n BaseClient.prototype._updateSessionFromEvent = function (session, event) {\n var e_1, _a;\n\n var crashed = false;\n var errored = false;\n var exceptions = event.exception && event.exception.values;\n\n if (exceptions) {\n errored = true;\n\n try {\n for (var exceptions_1 = __values(exceptions), exceptions_1_1 = exceptions_1.next(); !exceptions_1_1.done; exceptions_1_1 = exceptions_1.next()) {\n var ex = exceptions_1_1.value;\n var mechanism = ex.mechanism;\n\n if (mechanism && mechanism.handled === false) {\n crashed = true;\n break;\n }\n }\n } catch (e_1_1) {\n e_1 = {\n error: e_1_1\n };\n } finally {\n try {\n if (exceptions_1_1 && !exceptions_1_1.done && (_a = exceptions_1.return)) _a.call(exceptions_1);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n } // A session is updated and that session update is sent in only one of the two following scenarios:\n // 1. Session with non terminal status and 0 errors + an error occurred -> Will set error count to 1 and send update\n // 2. Session with non terminal status and 1 error + a crash occurred -> Will set status crashed and send update\n\n\n var sessionNonTerminal = session.status === 'ok';\n var shouldUpdateAndSend = sessionNonTerminal && session.errors === 0 || sessionNonTerminal && crashed;\n\n if (shouldUpdateAndSend) {\n session.update(__assign(__assign({}, crashed && {\n status: 'crashed'\n }), {\n errors: session.errors || Number(errored || crashed)\n }));\n this.captureSession(session);\n }\n };\n /** Deliver captured session to Sentry */\n\n\n BaseClient.prototype._sendSession = function (session) {\n this._getBackend().sendSession(session);\n };\n /**\n * Determine if the client is finished processing. Returns a promise because it will wait `timeout` ms before saying\n * \"no\" (resolving to `false`) in order to give the client a chance to potentially finish first.\n *\n * @param timeout The time, in ms, after which to resolve to `false` if the client is still busy. Passing `0` (or not\n * passing anything) will make the promise wait as long as it takes for processing to finish before resolving to\n * `true`.\n * @returns A promise which will resolve to `true` if processing is already done or finishes before the timeout, and\n * `false` otherwise\n */\n\n\n BaseClient.prototype._isClientDoneProcessing = function (timeout) {\n var _this = this;\n\n return new SyncPromise(function (resolve) {\n var ticked = 0;\n var tick = 1;\n var interval = setInterval(function () {\n if (_this._numProcessing == 0) {\n clearInterval(interval);\n resolve(true);\n } else {\n ticked += tick;\n\n if (timeout && ticked >= timeout) {\n clearInterval(interval);\n resolve(false);\n }\n }\n }, tick);\n });\n };\n /** Returns the current backend. */\n\n\n BaseClient.prototype._getBackend = function () {\n return this._backend;\n };\n /** Determines whether this SDK is enabled and a valid Dsn is present. */\n\n\n BaseClient.prototype._isEnabled = function () {\n return this.getOptions().enabled !== false && this._dsn !== undefined;\n };\n /**\n * Adds common information to events.\n *\n * The information includes release and environment from `options`,\n * breadcrumbs and context (extra, tags and user) from the scope.\n *\n * Information that is already present in the event is never overwritten. For\n * nested objects, such as the context, keys are merged.\n *\n * @param event The original event.\n * @param hint May contain additional information about the original exception.\n * @param scope A scope containing event metadata.\n * @returns A new event with more information.\n */\n\n\n BaseClient.prototype._prepareEvent = function (event, scope, hint) {\n var _this = this;\n\n var _a = this.getOptions(),\n _b = _a.normalizeDepth,\n normalizeDepth = _b === void 0 ? 3 : _b,\n _c = _a.normalizeMaxBreadth,\n normalizeMaxBreadth = _c === void 0 ? 1000 : _c;\n\n var prepared = __assign(__assign({}, event), {\n event_id: event.event_id || (hint && hint.event_id ? hint.event_id : uuid4()),\n timestamp: event.timestamp || dateTimestampInSeconds()\n });\n\n this._applyClientOptions(prepared);\n\n this._applyIntegrationsMetadata(prepared); // If we have scope given to us, use it as the base for further modifications.\n // This allows us to prevent unnecessary copying of data if `captureContext` is not provided.\n\n\n var finalScope = scope;\n\n if (hint && hint.captureContext) {\n finalScope = Scope.clone(finalScope).update(hint.captureContext);\n } // We prepare the result here with a resolved Event.\n\n\n var result = resolvedSyncPromise(prepared); // This should be the last thing called, since we want that\n // {@link Hub.addEventProcessor} gets the finished prepared event.\n\n if (finalScope) {\n // In case we have a hub we reassign it.\n result = finalScope.applyToEvent(prepared, hint);\n }\n\n return result.then(function (evt) {\n if (evt) {\n // TODO this is more of the hack trying to solve https://github.com/getsentry/sentry-javascript/issues/2809\n // it is only attached as extra data to the event if the event somehow skips being normalized\n evt.sdkProcessingMetadata = __assign(__assign({}, evt.sdkProcessingMetadata), {\n normalizeDepth: normalize(normalizeDepth) + \" (\" + _typeof(normalizeDepth) + \")\"\n });\n }\n\n if (typeof normalizeDepth === 'number' && normalizeDepth > 0) {\n return _this._normalizeEvent(evt, normalizeDepth, normalizeMaxBreadth);\n }\n\n return evt;\n });\n };\n /**\n * Applies `normalize` function on necessary `Event` attributes to make them safe for serialization.\n * Normalized keys:\n * - `breadcrumbs.data`\n * - `user`\n * - `contexts`\n * - `extra`\n * @param event Event\n * @returns Normalized event\n */\n\n\n BaseClient.prototype._normalizeEvent = function (event, depth, maxBreadth) {\n if (!event) {\n return null;\n }\n\n var normalized = __assign(__assign(__assign(__assign(__assign({}, event), event.breadcrumbs && {\n breadcrumbs: event.breadcrumbs.map(function (b) {\n return __assign(__assign({}, b), b.data && {\n data: normalize(b.data, depth, maxBreadth)\n });\n })\n }), event.user && {\n user: normalize(event.user, depth, maxBreadth)\n }), event.contexts && {\n contexts: normalize(event.contexts, depth, maxBreadth)\n }), event.extra && {\n extra: normalize(event.extra, depth, maxBreadth)\n }); // event.contexts.trace stores information about a Transaction. Similarly,\n // event.spans[] stores information about child Spans. Given that a\n // Transaction is conceptually a Span, normalization should apply to both\n // Transactions and Spans consistently.\n // For now the decision is to skip normalization of Transactions and Spans,\n // so this block overwrites the normalized event to add back the original\n // Transaction information prior to normalization.\n\n\n if (event.contexts && event.contexts.trace) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n normalized.contexts.trace = event.contexts.trace;\n }\n\n normalized.sdkProcessingMetadata = __assign(__assign({}, normalized.sdkProcessingMetadata), {\n baseClientNormalized: true\n });\n return normalized;\n };\n /**\n * Enhances event using the client configuration.\n * It takes care of all \"static\" values like environment, release and `dist`,\n * as well as truncating overly long values.\n * @param event event instance to be enhanced\n */\n\n\n BaseClient.prototype._applyClientOptions = function (event) {\n var options = this.getOptions();\n var environment = options.environment,\n release = options.release,\n dist = options.dist,\n _a = options.maxValueLength,\n maxValueLength = _a === void 0 ? 250 : _a;\n\n if (!('environment' in event)) {\n event.environment = 'environment' in options ? environment : 'production';\n }\n\n if (event.release === undefined && release !== undefined) {\n event.release = release;\n }\n\n if (event.dist === undefined && dist !== undefined) {\n event.dist = dist;\n }\n\n if (event.message) {\n event.message = truncate(event.message, maxValueLength);\n }\n\n var exception = event.exception && event.exception.values && event.exception.values[0];\n\n if (exception && exception.value) {\n exception.value = truncate(exception.value, maxValueLength);\n }\n\n var request = event.request;\n\n if (request && request.url) {\n request.url = truncate(request.url, maxValueLength);\n }\n };\n /**\n * This function adds all used integrations to the SDK info in the event.\n * @param event The event that will be filled with all integrations.\n */\n\n\n BaseClient.prototype._applyIntegrationsMetadata = function (event) {\n var integrationsArray = Object.keys(this._integrations);\n\n if (integrationsArray.length > 0) {\n event.sdk = event.sdk || {};\n event.sdk.integrations = __spread(event.sdk.integrations || [], integrationsArray);\n }\n };\n /**\n * Tells the backend to send this event\n * @param event The Sentry event to send\n */\n\n\n BaseClient.prototype._sendEvent = function (event) {\n this._getBackend().sendEvent(event);\n };\n /**\n * Processes the event and logs an error in case of rejection\n * @param event\n * @param hint\n * @param scope\n */\n\n\n BaseClient.prototype._captureEvent = function (event, hint, scope) {\n return this._processEvent(event, hint, scope).then(function (finalEvent) {\n return finalEvent.event_id;\n }, function (reason) {\n IS_DEBUG_BUILD && logger.error(reason);\n return undefined;\n });\n };\n /**\n * Processes an event (either error or message) and sends it to Sentry.\n *\n * This also adds breadcrumbs and context information to the event. However,\n * platform specific meta data (such as the User's IP address) must be added\n * by the SDK implementor.\n *\n *\n * @param event The event to send to Sentry.\n * @param hint May contain additional information about the original exception.\n * @param scope A scope containing event metadata.\n * @returns A SyncPromise that resolves with the event or rejects in case event was/will not be send.\n */\n\n\n BaseClient.prototype._processEvent = function (event, hint, scope) {\n var _this = this; // eslint-disable-next-line @typescript-eslint/unbound-method\n\n\n var _a = this.getOptions(),\n beforeSend = _a.beforeSend,\n sampleRate = _a.sampleRate;\n\n var transport = this.getTransport();\n\n function recordLostEvent(outcome, category) {\n if (transport.recordLostEvent) {\n transport.recordLostEvent(outcome, category);\n }\n }\n\n if (!this._isEnabled()) {\n return rejectedSyncPromise(new SentryError('SDK not enabled, will not capture event.'));\n }\n\n var isTransaction = event.type === 'transaction'; // 1.0 === 100% events are sent\n // 0.0 === 0% events are sent\n // Sampling for transaction happens somewhere else\n\n if (!isTransaction && typeof sampleRate === 'number' && Math.random() > sampleRate) {\n recordLostEvent('sample_rate', 'event');\n return rejectedSyncPromise(new SentryError(\"Discarding event because it's not included in the random sample (sampling rate = \" + sampleRate + \")\"));\n }\n\n return this._prepareEvent(event, scope, hint).then(function (prepared) {\n if (prepared === null) {\n recordLostEvent('event_processor', event.type || 'event');\n throw new SentryError('An event processor returned null, will not send event.');\n }\n\n var isInternalException = hint && hint.data && hint.data.__sentry__ === true;\n\n if (isInternalException || isTransaction || !beforeSend) {\n return prepared;\n }\n\n var beforeSendResult = beforeSend(prepared, hint);\n return _ensureBeforeSendRv(beforeSendResult);\n }).then(function (processedEvent) {\n if (processedEvent === null) {\n recordLostEvent('before_send', event.type || 'event');\n throw new SentryError('`beforeSend` returned `null`, will not send event.');\n }\n\n var session = scope && scope.getSession && scope.getSession();\n\n if (!isTransaction && session) {\n _this._updateSessionFromEvent(session, processedEvent);\n }\n\n _this._sendEvent(processedEvent);\n\n return processedEvent;\n }).then(null, function (reason) {\n if (reason instanceof SentryError) {\n throw reason;\n }\n\n _this.captureException(reason, {\n data: {\n __sentry__: true\n },\n originalException: reason\n });\n\n throw new SentryError(\"Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\\nReason: \" + reason);\n });\n };\n /**\n * Occupies the client with processing and event\n */\n\n\n BaseClient.prototype._process = function (promise) {\n var _this = this;\n\n this._numProcessing += 1;\n void promise.then(function (value) {\n _this._numProcessing -= 1;\n return value;\n }, function (reason) {\n _this._numProcessing -= 1;\n return reason;\n });\n };\n\n return BaseClient;\n}();\n\nexport { BaseClient };\n/**\n * Verifies that return value of configured `beforeSend` is of expected type.\n */\n\nfunction _ensureBeforeSendRv(rv) {\n var nullErr = '`beforeSend` method has to return `null` or a valid event.';\n\n if (isThenable(rv)) {\n return rv.then(function (event) {\n if (!(isPlainObject(event) || event === null)) {\n throw new SentryError(nullErr);\n }\n\n return event;\n }, function (e) {\n throw new SentryError(\"beforeSend rejected with \" + e);\n });\n } else if (!(isPlainObject(rv) || rv === null)) {\n throw new SentryError(nullErr);\n }\n\n return rv;\n}","import { __assign, __read, __spread } from \"tslib\";\nimport { createEnvelope, dsnToString, normalize, serializeEnvelope } from '@sentry/utils';\nimport { getEnvelopeEndpointWithUrlEncodedAuth, getStoreEndpointWithUrlEncodedAuth } from './api';\n/** Extract sdk info from from the API metadata */\n\nfunction getSdkMetadataForEnvelopeHeader(api) {\n if (!api.metadata || !api.metadata.sdk) {\n return;\n }\n\n var _a = api.metadata.sdk,\n name = _a.name,\n version = _a.version;\n return {\n name: name,\n version: version\n };\n}\n/**\n * Apply SdkInfo (name, version, packages, integrations) to the corresponding event key.\n * Merge with existing data if any.\n **/\n\n\nfunction enhanceEventWithSdkInfo(event, sdkInfo) {\n if (!sdkInfo) {\n return event;\n }\n\n event.sdk = event.sdk || {};\n event.sdk.name = event.sdk.name || sdkInfo.name;\n event.sdk.version = event.sdk.version || sdkInfo.version;\n event.sdk.integrations = __spread(event.sdk.integrations || [], sdkInfo.integrations || []);\n event.sdk.packages = __spread(event.sdk.packages || [], sdkInfo.packages || []);\n return event;\n}\n/** Creates an envelope from a Session */\n\n\nexport function createSessionEnvelope(session, api) {\n var sdkInfo = getSdkMetadataForEnvelopeHeader(api);\n\n var envelopeHeaders = __assign(__assign({\n sent_at: new Date().toISOString()\n }, sdkInfo && {\n sdk: sdkInfo\n }), !!api.tunnel && {\n dsn: dsnToString(api.dsn)\n }); // I know this is hacky but we don't want to add `sessions` to request type since it's never rate limited\n\n\n var type = 'aggregates' in session ? 'sessions' : 'session'; // TODO (v7) Have to cast type because envelope items do not accept a `SentryRequestType`\n\n var envelopeItem = [{\n type: type\n }, session];\n var envelope = createEnvelope(envelopeHeaders, [envelopeItem]);\n return [envelope, type];\n}\n/** Creates a SentryRequest from a Session. */\n\nexport function sessionToSentryRequest(session, api) {\n var _a = __read(createSessionEnvelope(session, api), 2),\n envelope = _a[0],\n type = _a[1];\n\n return {\n body: serializeEnvelope(envelope),\n type: type,\n url: getEnvelopeEndpointWithUrlEncodedAuth(api.dsn, api.tunnel)\n };\n}\n/**\n * Create an Envelope from an event. Note that this is duplicated from below,\n * but on purpose as this will be refactored in v7.\n */\n\nexport function createEventEnvelope(event, api) {\n var sdkInfo = getSdkMetadataForEnvelopeHeader(api);\n var eventType = event.type || 'event';\n var transactionSampling = (event.sdkProcessingMetadata || {}).transactionSampling;\n\n var _a = transactionSampling || {},\n samplingMethod = _a.method,\n sampleRate = _a.rate; // TODO: Below is a temporary hack in order to debug a serialization error - see\n // https://github.com/getsentry/sentry-javascript/issues/2809,\n // https://github.com/getsentry/sentry-javascript/pull/4425, and\n // https://github.com/getsentry/sentry-javascript/pull/4574.\n //\n // TL; DR: even though we normalize all events (which should prevent this), something is causing `JSON.stringify` to\n // throw a circular reference error.\n //\n // When it's time to remove it:\n // 1. Delete everything between here and where the request object `req` is created, EXCEPT the line deleting\n // `sdkProcessingMetadata`\n // 2. Restore the original version of the request body, which is commented out\n // 3. Search for either of the PR URLs above and pull out the companion hacks in the browser playwright tests and the\n // baseClient tests in this package\n\n\n enhanceEventWithSdkInfo(event, api.metadata.sdk);\n event.tags = event.tags || {};\n event.extra = event.extra || {}; // In theory, all events should be marked as having gone through normalization and so\n // we should never set this tag/extra data\n\n if (!(event.sdkProcessingMetadata && event.sdkProcessingMetadata.baseClientNormalized)) {\n event.tags.skippedNormalization = true;\n event.extra.normalizeDepth = event.sdkProcessingMetadata ? event.sdkProcessingMetadata.normalizeDepth : 'unset';\n } // prevent this data from being sent to sentry\n // TODO: This is NOT part of the hack - DO NOT DELETE\n\n\n delete event.sdkProcessingMetadata;\n\n var envelopeHeaders = __assign(__assign({\n event_id: event.event_id,\n sent_at: new Date().toISOString()\n }, sdkInfo && {\n sdk: sdkInfo\n }), !!api.tunnel && {\n dsn: dsnToString(api.dsn)\n });\n\n var eventItem = [{\n type: eventType,\n sample_rates: [{\n id: samplingMethod,\n rate: sampleRate\n }]\n }, event];\n return createEnvelope(envelopeHeaders, [eventItem]);\n}\n/** Creates a SentryRequest from an event. */\n\nexport function eventToSentryRequest(event, api) {\n var sdkInfo = getSdkMetadataForEnvelopeHeader(api);\n var eventType = event.type || 'event';\n var useEnvelope = eventType === 'transaction' || !!api.tunnel;\n var transactionSampling = (event.sdkProcessingMetadata || {}).transactionSampling;\n\n var _a = transactionSampling || {},\n samplingMethod = _a.method,\n sampleRate = _a.rate; // TODO: Below is a temporary hack in order to debug a serialization error - see\n // https://github.com/getsentry/sentry-javascript/issues/2809,\n // https://github.com/getsentry/sentry-javascript/pull/4425, and\n // https://github.com/getsentry/sentry-javascript/pull/4574.\n //\n // TL; DR: even though we normalize all events (which should prevent this), something is causing `JSON.stringify` to\n // throw a circular reference error.\n //\n // When it's time to remove it:\n // 1. Delete everything between here and where the request object `req` is created, EXCEPT the line deleting\n // `sdkProcessingMetadata`\n // 2. Restore the original version of the request body, which is commented out\n // 3. Search for either of the PR URLs above and pull out the companion hacks in the browser playwright tests and the\n // baseClient tests in this package\n\n\n enhanceEventWithSdkInfo(event, api.metadata.sdk);\n event.tags = event.tags || {};\n event.extra = event.extra || {}; // In theory, all events should be marked as having gone through normalization and so\n // we should never set this tag/extra data\n\n if (!(event.sdkProcessingMetadata && event.sdkProcessingMetadata.baseClientNormalized)) {\n event.tags.skippedNormalization = true;\n event.extra.normalizeDepth = event.sdkProcessingMetadata ? event.sdkProcessingMetadata.normalizeDepth : 'unset';\n } // prevent this data from being sent to sentry\n // TODO: This is NOT part of the hack - DO NOT DELETE\n\n\n delete event.sdkProcessingMetadata;\n var body;\n\n try {\n // 99.9% of events should get through just fine - no change in behavior for them\n body = JSON.stringify(event);\n } catch (err) {\n // Record data about the error without replacing original event data, then force renormalization\n event.tags.JSONStringifyError = true;\n event.extra.JSONStringifyError = err;\n\n try {\n body = JSON.stringify(normalize(event));\n } catch (newErr) {\n // At this point even renormalization hasn't worked, meaning something about the event data has gone very wrong.\n // Time to cut our losses and record only the new error. With luck, even in the problematic cases we're trying to\n // debug with this hack, we won't ever land here.\n var innerErr = newErr;\n body = JSON.stringify({\n message: 'JSON.stringify error after renormalization',\n // setting `extra: { innerErr }` here for some reason results in an empty object, so unpack manually\n extra: {\n message: innerErr.message,\n stack: innerErr.stack\n }\n });\n }\n }\n\n var req = {\n // this is the relevant line of code before the hack was added, to make it easy to undo said hack once we've solved\n // the mystery\n // body: JSON.stringify(sdkInfo ? enhanceEventWithSdkInfo(event, api.metadata.sdk) : event),\n body: body,\n type: eventType,\n url: useEnvelope ? getEnvelopeEndpointWithUrlEncodedAuth(api.dsn, api.tunnel) : getStoreEndpointWithUrlEncodedAuth(api.dsn)\n }; // https://develop.sentry.dev/sdk/envelopes/\n // Since we don't need to manipulate envelopes nor store them, there is no\n // exported concept of an Envelope with operations including serialization and\n // deserialization. Instead, we only implement a minimal subset of the spec to\n // serialize events inline here.\n\n if (useEnvelope) {\n var envelopeHeaders = __assign(__assign({\n event_id: event.event_id,\n sent_at: new Date().toISOString()\n }, sdkInfo && {\n sdk: sdkInfo\n }), !!api.tunnel && {\n dsn: dsnToString(api.dsn)\n });\n\n var eventItem = [{\n type: eventType,\n sample_rates: [{\n id: samplingMethod,\n rate: sampleRate\n }]\n }, req.body];\n var envelope = createEnvelope(envelopeHeaders, [eventItem]);\n req.body = serializeEnvelope(envelope);\n }\n\n return req;\n}","import { resolvedSyncPromise } from '@sentry/utils';\n/** Noop transport */\n\nvar NoopTransport = function () {\n function NoopTransport() {}\n /**\n * @inheritDoc\n */\n\n\n NoopTransport.prototype.sendEvent = function (_) {\n return resolvedSyncPromise({\n reason: 'NoopTransport: Event has been skipped because no Dsn is configured.',\n status: 'skipped'\n });\n };\n /**\n * @inheritDoc\n */\n\n\n NoopTransport.prototype.close = function (_) {\n return resolvedSyncPromise(true);\n };\n\n return NoopTransport;\n}();\n\nexport { NoopTransport };","import { __read } from \"tslib\";\nimport { logger, SentryError } from '@sentry/utils';\nimport { initAPIDetails } from './api';\nimport { IS_DEBUG_BUILD } from './flags';\nimport { createEventEnvelope, createSessionEnvelope } from './request';\nimport { NoopTransport } from './transports/noop';\n/**\n * This is the base implemention of a Backend.\n * @hidden\n */\n\nvar BaseBackend = function () {\n /** Creates a new backend instance. */\n function BaseBackend(options) {\n this._options = options;\n\n if (!this._options.dsn) {\n IS_DEBUG_BUILD && logger.warn('No DSN provided, backend will not do anything.');\n }\n\n this._transport = this._setupTransport();\n }\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\n\n\n BaseBackend.prototype.eventFromException = function (_exception, _hint) {\n throw new SentryError('Backend has to implement `eventFromException` method');\n };\n /**\n * @inheritDoc\n */\n\n\n BaseBackend.prototype.eventFromMessage = function (_message, _level, _hint) {\n throw new SentryError('Backend has to implement `eventFromMessage` method');\n };\n /**\n * @inheritDoc\n */\n\n\n BaseBackend.prototype.sendEvent = function (event) {\n // TODO(v7): Remove the if-else\n if (this._newTransport && this._options.dsn && this._options._experiments && this._options._experiments.newTransport) {\n var api = initAPIDetails(this._options.dsn, this._options._metadata, this._options.tunnel);\n var env = createEventEnvelope(event, api);\n void this._newTransport.send(env).then(null, function (reason) {\n IS_DEBUG_BUILD && logger.error('Error while sending event:', reason);\n });\n } else {\n void this._transport.sendEvent(event).then(null, function (reason) {\n IS_DEBUG_BUILD && logger.error('Error while sending event:', reason);\n });\n }\n };\n /**\n * @inheritDoc\n */\n\n\n BaseBackend.prototype.sendSession = function (session) {\n if (!this._transport.sendSession) {\n IS_DEBUG_BUILD && logger.warn(\"Dropping session because custom transport doesn't implement sendSession\");\n return;\n } // TODO(v7): Remove the if-else\n\n\n if (this._newTransport && this._options.dsn && this._options._experiments && this._options._experiments.newTransport) {\n var api = initAPIDetails(this._options.dsn, this._options._metadata, this._options.tunnel);\n\n var _a = __read(createSessionEnvelope(session, api), 1),\n env = _a[0];\n\n void this._newTransport.send(env).then(null, function (reason) {\n IS_DEBUG_BUILD && logger.error('Error while sending session:', reason);\n });\n } else {\n void this._transport.sendSession(session).then(null, function (reason) {\n IS_DEBUG_BUILD && logger.error('Error while sending session:', reason);\n });\n }\n };\n /**\n * @inheritDoc\n */\n\n\n BaseBackend.prototype.getTransport = function () {\n return this._transport;\n };\n /**\n * Sets up the transport so it can be used later to send requests.\n */\n\n\n BaseBackend.prototype._setupTransport = function () {\n return new NoopTransport();\n };\n\n return BaseBackend;\n}();\n\nexport { BaseBackend };","import { disabledUntil, eventStatusFromHttpCode, getEnvelopeType, isRateLimited, makePromiseBuffer, rejectedSyncPromise, resolvedSyncPromise, serializeEnvelope, updateRateLimits } from '@sentry/utils';\nexport var ERROR_TRANSPORT_CATEGORY = 'error';\nexport var TRANSACTION_TRANSPORT_CATEGORY = 'transaction';\nexport var ATTACHMENT_TRANSPORT_CATEGORY = 'attachment';\nexport var SESSION_TRANSPORT_CATEGORY = 'session';\nexport var DEFAULT_TRANSPORT_BUFFER_SIZE = 30;\n/**\n * Creates a `NewTransport`\n *\n * @param options\n * @param makeRequest\n */\n\nexport function createTransport(options, makeRequest, buffer) {\n if (buffer === void 0) {\n buffer = makePromiseBuffer(options.bufferSize || DEFAULT_TRANSPORT_BUFFER_SIZE);\n }\n\n var rateLimits = {};\n\n var flush = function flush(timeout) {\n return buffer.drain(timeout);\n };\n\n function send(envelope) {\n var envCategory = getEnvelopeType(envelope);\n var category = envCategory === 'event' ? 'error' : envCategory;\n var request = {\n category: category,\n body: serializeEnvelope(envelope)\n }; // Don't add to buffer if transport is already rate-limited\n\n if (isRateLimited(rateLimits, category)) {\n return rejectedSyncPromise({\n status: 'rate_limit',\n reason: getRateLimitReason(rateLimits, category)\n });\n }\n\n var requestTask = function requestTask() {\n return makeRequest(request).then(function (_a) {\n var body = _a.body,\n headers = _a.headers,\n reason = _a.reason,\n statusCode = _a.statusCode;\n var status = eventStatusFromHttpCode(statusCode);\n\n if (headers) {\n rateLimits = updateRateLimits(rateLimits, headers);\n }\n\n if (status === 'success') {\n return resolvedSyncPromise({\n status: status,\n reason: reason\n });\n }\n\n return rejectedSyncPromise({\n status: status,\n reason: reason || body || (status === 'rate_limit' ? getRateLimitReason(rateLimits, category) : 'Unknown transport error')\n });\n });\n };\n\n return buffer.add(requestTask);\n }\n\n return {\n send: send,\n flush: flush\n };\n}\n\nfunction getRateLimitReason(rateLimits, category) {\n return \"Too many \" + category + \" requests, backing off until: \" + new Date(disabledUntil(rateLimits, category)).toISOString();\n}","export var SDK_VERSION = '6.19.7';","import { getOriginalFunction } from '@sentry/utils';\nvar originalFunctionToString;\n/** Patch toString calls to return proper name for wrapped functions */\n\nvar FunctionToString = function () {\n function FunctionToString() {\n /**\n * @inheritDoc\n */\n this.name = FunctionToString.id;\n }\n /**\n * @inheritDoc\n */\n\n\n FunctionToString.prototype.setupOnce = function () {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n originalFunctionToString = Function.prototype.toString; // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n Function.prototype.toString = function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n var context = getOriginalFunction(this) || this;\n return originalFunctionToString.apply(context, args);\n };\n };\n /**\n * @inheritDoc\n */\n\n\n FunctionToString.id = 'FunctionToString';\n return FunctionToString;\n}();\n\nexport { FunctionToString };","import { __read, __spread } from \"tslib\";\nimport { getEventDescription, isMatchingPattern, logger } from '@sentry/utils';\nimport { IS_DEBUG_BUILD } from '../flags'; // \"Script error.\" is hard coded into browsers for errors that it can't read.\n// this is the result of a script being pulled in from an external domain and CORS.\n\nvar DEFAULT_IGNORE_ERRORS = [/^Script error\\.?$/, /^Javascript error: Script error\\.? on line 0$/];\n/** Inbound filters configurable by the user */\n\nvar InboundFilters = function () {\n function InboundFilters(_options) {\n if (_options === void 0) {\n _options = {};\n }\n\n this._options = _options;\n /**\n * @inheritDoc\n */\n\n this.name = InboundFilters.id;\n }\n /**\n * @inheritDoc\n */\n\n\n InboundFilters.prototype.setupOnce = function (addGlobalEventProcessor, getCurrentHub) {\n addGlobalEventProcessor(function (event) {\n var hub = getCurrentHub();\n\n if (hub) {\n var self_1 = hub.getIntegration(InboundFilters);\n\n if (self_1) {\n var client = hub.getClient();\n var clientOptions = client ? client.getOptions() : {};\n\n var options = _mergeOptions(self_1._options, clientOptions);\n\n return _shouldDropEvent(event, options) ? null : event;\n }\n }\n\n return event;\n });\n };\n /**\n * @inheritDoc\n */\n\n\n InboundFilters.id = 'InboundFilters';\n return InboundFilters;\n}();\n\nexport { InboundFilters };\n/** JSDoc */\n\nexport function _mergeOptions(internalOptions, clientOptions) {\n if (internalOptions === void 0) {\n internalOptions = {};\n }\n\n if (clientOptions === void 0) {\n clientOptions = {};\n }\n\n return {\n allowUrls: __spread(internalOptions.whitelistUrls || [], internalOptions.allowUrls || [], clientOptions.whitelistUrls || [], clientOptions.allowUrls || []),\n denyUrls: __spread(internalOptions.blacklistUrls || [], internalOptions.denyUrls || [], clientOptions.blacklistUrls || [], clientOptions.denyUrls || []),\n ignoreErrors: __spread(internalOptions.ignoreErrors || [], clientOptions.ignoreErrors || [], DEFAULT_IGNORE_ERRORS),\n ignoreInternal: internalOptions.ignoreInternal !== undefined ? internalOptions.ignoreInternal : true\n };\n}\n/** JSDoc */\n\nexport function _shouldDropEvent(event, options) {\n if (options.ignoreInternal && _isSentryError(event)) {\n IS_DEBUG_BUILD && logger.warn(\"Event dropped due to being internal Sentry Error.\\nEvent: \" + getEventDescription(event));\n return true;\n }\n\n if (_isIgnoredError(event, options.ignoreErrors)) {\n IS_DEBUG_BUILD && logger.warn(\"Event dropped due to being matched by `ignoreErrors` option.\\nEvent: \" + getEventDescription(event));\n return true;\n }\n\n if (_isDeniedUrl(event, options.denyUrls)) {\n IS_DEBUG_BUILD && logger.warn(\"Event dropped due to being matched by `denyUrls` option.\\nEvent: \" + getEventDescription(event) + \".\\nUrl: \" + _getEventFilterUrl(event));\n return true;\n }\n\n if (!_isAllowedUrl(event, options.allowUrls)) {\n IS_DEBUG_BUILD && logger.warn(\"Event dropped due to not being matched by `allowUrls` option.\\nEvent: \" + getEventDescription(event) + \".\\nUrl: \" + _getEventFilterUrl(event));\n return true;\n }\n\n return false;\n}\n\nfunction _isIgnoredError(event, ignoreErrors) {\n if (!ignoreErrors || !ignoreErrors.length) {\n return false;\n }\n\n return _getPossibleEventMessages(event).some(function (message) {\n return ignoreErrors.some(function (pattern) {\n return isMatchingPattern(message, pattern);\n });\n });\n}\n\nfunction _isDeniedUrl(event, denyUrls) {\n // TODO: Use Glob instead?\n if (!denyUrls || !denyUrls.length) {\n return false;\n }\n\n var url = _getEventFilterUrl(event);\n\n return !url ? false : denyUrls.some(function (pattern) {\n return isMatchingPattern(url, pattern);\n });\n}\n\nfunction _isAllowedUrl(event, allowUrls) {\n // TODO: Use Glob instead?\n if (!allowUrls || !allowUrls.length) {\n return true;\n }\n\n var url = _getEventFilterUrl(event);\n\n return !url ? true : allowUrls.some(function (pattern) {\n return isMatchingPattern(url, pattern);\n });\n}\n\nfunction _getPossibleEventMessages(event) {\n if (event.message) {\n return [event.message];\n }\n\n if (event.exception) {\n try {\n var _a = event.exception.values && event.exception.values[0] || {},\n _b = _a.type,\n type = _b === void 0 ? '' : _b,\n _c = _a.value,\n value = _c === void 0 ? '' : _c;\n\n return [\"\" + value, type + \": \" + value];\n } catch (oO) {\n IS_DEBUG_BUILD && logger.error(\"Cannot extract message for event \" + getEventDescription(event));\n return [];\n }\n }\n\n return [];\n}\n\nfunction _isSentryError(event) {\n try {\n // @ts-ignore can't be a sentry error if undefined\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return event.exception.values[0].type === 'SentryError';\n } catch (e) {// ignore\n }\n\n return false;\n}\n\nfunction _getLastValidUrl(frames) {\n if (frames === void 0) {\n frames = [];\n }\n\n for (var i = frames.length - 1; i >= 0; i--) {\n var frame = frames[i];\n\n if (frame && frame.filename !== '' && frame.filename !== '[native code]') {\n return frame.filename || null;\n }\n }\n\n return null;\n}\n\nfunction _getEventFilterUrl(event) {\n try {\n if (event.stacktrace) {\n return _getLastValidUrl(event.stacktrace.frames);\n }\n\n var frames_1;\n\n try {\n // @ts-ignore we only care about frames if the whole thing here is defined\n frames_1 = event.exception.values[0].stacktrace.frames;\n } catch (e) {// ignore\n }\n\n return frames_1 ? _getLastValidUrl(frames_1) : null;\n } catch (oO) {\n IS_DEBUG_BUILD && logger.error(\"Cannot extract url for event \" + getEventDescription(event));\n return null;\n }\n}","import { __read } from \"tslib\"; // global reference to slice\n\nvar UNKNOWN_FUNCTION = '?';\nvar OPERA10_PRIORITY = 10;\nvar OPERA11_PRIORITY = 20;\nvar CHROME_PRIORITY = 30;\nvar WINJS_PRIORITY = 40;\nvar GECKO_PRIORITY = 50;\n\nfunction createFrame(filename, func, lineno, colno) {\n var frame = {\n filename: filename,\n function: func,\n // All browser frames are considered in_app\n in_app: true\n };\n\n if (lineno !== undefined) {\n frame.lineno = lineno;\n }\n\n if (colno !== undefined) {\n frame.colno = colno;\n }\n\n return frame;\n} // Chromium based browsers: Chrome, Brave, new Opera, new Edge\n\n\nvar chromeRegex = /^\\s*at (?:(.*?) ?\\((?:address at )?)?((?:file|https?|blob|chrome-extension|address|native|eval|webpack||[-a-z]+:|.*bundle|\\/).*?)(?::(\\d+))?(?::(\\d+))?\\)?\\s*$/i;\nvar chromeEvalRegex = /\\((\\S*)(?::(\\d+))(?::(\\d+))\\)/;\n\nvar chrome = function chrome(line) {\n var parts = chromeRegex.exec(line);\n\n if (parts) {\n var isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line\n\n if (isEval) {\n var subMatch = chromeEvalRegex.exec(parts[2]);\n\n if (subMatch) {\n // throw out eval line/column and use top-most line/column number\n parts[2] = subMatch[1]; // url\n\n parts[3] = subMatch[2]; // line\n\n parts[4] = subMatch[3]; // column\n }\n } // Kamil: One more hack won't hurt us right? Understanding and adding more rules on top of these regexps right now\n // would be way too time consuming. (TODO: Rewrite whole RegExp to be more readable)\n\n\n var _a = __read(extractSafariExtensionDetails(parts[1] || UNKNOWN_FUNCTION, parts[2]), 2),\n func = _a[0],\n filename = _a[1];\n\n return createFrame(filename, func, parts[3] ? +parts[3] : undefined, parts[4] ? +parts[4] : undefined);\n }\n\n return;\n};\n\nexport var chromeStackParser = [CHROME_PRIORITY, chrome]; // gecko regex: `(?:bundle|\\d+\\.js)`: `bundle` is for react native, `\\d+\\.js` also but specifically for ram bundles because it\n// generates filenames without a prefix like `file://` the filenames in the stacktrace are just 42.js\n// We need this specific case for now because we want no other regex to match.\n\nvar geckoREgex = /^\\s*(.*?)(?:\\((.*?)\\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|capacitor).*?:\\/.*?|\\[native code\\]|[^@]*(?:bundle|\\d+\\.js)|\\/[\\w\\-. /=]+)(?::(\\d+))?(?::(\\d+))?\\s*$/i;\nvar geckoEvalRegex = /(\\S+) line (\\d+)(?: > eval line \\d+)* > eval/i;\n\nvar gecko = function gecko(line) {\n var _a;\n\n var parts = geckoREgex.exec(line);\n\n if (parts) {\n var isEval = parts[3] && parts[3].indexOf(' > eval') > -1;\n\n if (isEval) {\n var subMatch = geckoEvalRegex.exec(parts[3]);\n\n if (subMatch) {\n // throw out eval line/column and use top-most line number\n parts[1] = parts[1] || 'eval';\n parts[3] = subMatch[1];\n parts[4] = subMatch[2];\n parts[5] = ''; // no column when eval\n }\n }\n\n var filename = parts[3];\n var func = parts[1] || UNKNOWN_FUNCTION;\n _a = __read(extractSafariExtensionDetails(func, filename), 2), func = _a[0], filename = _a[1];\n return createFrame(filename, func, parts[4] ? +parts[4] : undefined, parts[5] ? +parts[5] : undefined);\n }\n\n return;\n};\n\nexport var geckoStackParser = [GECKO_PRIORITY, gecko];\nvar winjsRegex = /^\\s*at (?:((?:\\[object object\\])?.+) )?\\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\\d+)(?::(\\d+))?\\)?\\s*$/i;\n\nvar winjs = function winjs(line) {\n var parts = winjsRegex.exec(line);\n return parts ? createFrame(parts[2], parts[1] || UNKNOWN_FUNCTION, +parts[3], parts[4] ? +parts[4] : undefined) : undefined;\n};\n\nexport var winjsStackParser = [WINJS_PRIORITY, winjs];\nvar opera10Regex = / line (\\d+).*script (?:in )?(\\S+)(?:: in function (\\S+))?$/i;\n\nvar opera10 = function opera10(line) {\n var parts = opera10Regex.exec(line);\n return parts ? createFrame(parts[2], parts[3] || UNKNOWN_FUNCTION, +parts[1]) : undefined;\n};\n\nexport var opera10StackParser = [OPERA10_PRIORITY, opera10];\nvar opera11Regex = / line (\\d+), column (\\d+)\\s*(?:in (?:]+)>|([^)]+))\\(.*\\))? in (.*):\\s*$/i;\n\nvar opera11 = function opera11(line) {\n var parts = opera11Regex.exec(line);\n return parts ? createFrame(parts[5], parts[3] || parts[4] || UNKNOWN_FUNCTION, +parts[1], +parts[2]) : undefined;\n};\n\nexport var opera11StackParser = [OPERA11_PRIORITY, opera11];\n/**\n * Safari web extensions, starting version unknown, can produce \"frames-only\" stacktraces.\n * What it means, is that instead of format like:\n *\n * Error: wat\n * at function@url:row:col\n * at function@url:row:col\n * at function@url:row:col\n *\n * it produces something like:\n *\n * function@url:row:col\n * function@url:row:col\n * function@url:row:col\n *\n * Because of that, it won't be captured by `chrome` RegExp and will fall into `Gecko` branch.\n * This function is extracted so that we can use it in both places without duplicating the logic.\n * Unfortunately \"just\" changing RegExp is too complicated now and making it pass all tests\n * and fix this case seems like an impossible, or at least way too time-consuming task.\n */\n\nvar extractSafariExtensionDetails = function extractSafariExtensionDetails(func, filename) {\n var isSafariExtension = func.indexOf('safari-extension') !== -1;\n var isSafariWebExtension = func.indexOf('safari-web-extension') !== -1;\n return isSafariExtension || isSafariWebExtension ? [func.indexOf('@') !== -1 ? func.split('@')[0] : UNKNOWN_FUNCTION, isSafariExtension ? \"safari-extension:\" + filename : \"safari-web-extension:\" + filename] : [func, filename];\n};","import { __assign } from \"tslib\";\nimport { Severity } from '@sentry/types';\nimport { addExceptionMechanism, addExceptionTypeValue, createStackParser, extractExceptionKeysForMessage, isDOMError, isDOMException, isError, isErrorEvent, isEvent, isPlainObject, normalizeToSize, resolvedSyncPromise } from '@sentry/utils';\nimport { chromeStackParser, geckoStackParser, opera10StackParser, opera11StackParser, winjsStackParser } from './stack-parsers';\n/**\n * This function creates an exception from an TraceKitStackTrace\n * @param stacktrace TraceKitStackTrace that will be converted to an exception\n * @hidden\n */\n\nexport function exceptionFromError(ex) {\n // Get the frames first since Opera can lose the stack if we touch anything else first\n var frames = parseStackFrames(ex);\n var exception = {\n type: ex && ex.name,\n value: extractMessage(ex)\n };\n\n if (frames.length) {\n exception.stacktrace = {\n frames: frames\n };\n }\n\n if (exception.type === undefined && exception.value === '') {\n exception.value = 'Unrecoverable error caught';\n }\n\n return exception;\n}\n/**\n * @hidden\n */\n\nexport function eventFromPlainObject(exception, syntheticException, isUnhandledRejection) {\n var event = {\n exception: {\n values: [{\n type: isEvent(exception) ? exception.constructor.name : isUnhandledRejection ? 'UnhandledRejection' : 'Error',\n value: \"Non-Error \" + (isUnhandledRejection ? 'promise rejection' : 'exception') + \" captured with keys: \" + extractExceptionKeysForMessage(exception)\n }]\n },\n extra: {\n __serialized__: normalizeToSize(exception)\n }\n };\n\n if (syntheticException) {\n var frames_1 = parseStackFrames(syntheticException);\n\n if (frames_1.length) {\n event.stacktrace = {\n frames: frames_1\n };\n }\n }\n\n return event;\n}\n/**\n * @hidden\n */\n\nexport function eventFromError(ex) {\n return {\n exception: {\n values: [exceptionFromError(ex)]\n }\n };\n}\n/** Parses stack frames from an error */\n\nexport function parseStackFrames(ex) {\n // Access and store the stacktrace property before doing ANYTHING\n // else to it because Opera is not very good at providing it\n // reliably in other circumstances.\n var stacktrace = ex.stacktrace || ex.stack || '';\n var popSize = getPopSize(ex);\n\n try {\n return createStackParser(opera10StackParser, opera11StackParser, chromeStackParser, winjsStackParser, geckoStackParser)(stacktrace, popSize);\n } catch (e) {// no-empty\n }\n\n return [];\n} // Based on our own mapping pattern - https://github.com/getsentry/sentry/blob/9f08305e09866c8bd6d0c24f5b0aabdd7dd6c59c/src/sentry/lang/javascript/errormapping.py#L83-L108\n\nvar reactMinifiedRegexp = /Minified React error #\\d+;/i;\n\nfunction getPopSize(ex) {\n if (ex) {\n if (typeof ex.framesToPop === 'number') {\n return ex.framesToPop;\n }\n\n if (reactMinifiedRegexp.test(ex.message)) {\n return 1;\n }\n }\n\n return 0;\n}\n/**\n * There are cases where stacktrace.message is an Event object\n * https://github.com/getsentry/sentry-javascript/issues/1949\n * In this specific case we try to extract stacktrace.message.error.message\n */\n\n\nfunction extractMessage(ex) {\n var message = ex && ex.message;\n\n if (!message) {\n return 'No error message';\n }\n\n if (message.error && typeof message.error.message === 'string') {\n return message.error.message;\n }\n\n return message;\n}\n/**\n * Creates an {@link Event} from all inputs to `captureException` and non-primitive inputs to `captureMessage`.\n * @hidden\n */\n\n\nexport function eventFromException(exception, hint, attachStacktrace) {\n var syntheticException = hint && hint.syntheticException || undefined;\n var event = eventFromUnknownInput(exception, syntheticException, attachStacktrace);\n addExceptionMechanism(event); // defaults to { type: 'generic', handled: true }\n\n event.level = Severity.Error;\n\n if (hint && hint.event_id) {\n event.event_id = hint.event_id;\n }\n\n return resolvedSyncPromise(event);\n}\n/**\n * Builds and Event from a Message\n * @hidden\n */\n\nexport function eventFromMessage(message, level, hint, attachStacktrace) {\n if (level === void 0) {\n level = Severity.Info;\n }\n\n var syntheticException = hint && hint.syntheticException || undefined;\n var event = eventFromString(message, syntheticException, attachStacktrace);\n event.level = level;\n\n if (hint && hint.event_id) {\n event.event_id = hint.event_id;\n }\n\n return resolvedSyncPromise(event);\n}\n/**\n * @hidden\n */\n\nexport function eventFromUnknownInput(exception, syntheticException, attachStacktrace, isUnhandledRejection) {\n var event;\n\n if (isErrorEvent(exception) && exception.error) {\n // If it is an ErrorEvent with `error` property, extract it to get actual Error\n var errorEvent = exception;\n return eventFromError(errorEvent.error);\n } // If it is a `DOMError` (which is a legacy API, but still supported in some browsers) then we just extract the name\n // and message, as it doesn't provide anything else. According to the spec, all `DOMExceptions` should also be\n // `Error`s, but that's not the case in IE11, so in that case we treat it the same as we do a `DOMError`.\n //\n // https://developer.mozilla.org/en-US/docs/Web/API/DOMError\n // https://developer.mozilla.org/en-US/docs/Web/API/DOMException\n // https://webidl.spec.whatwg.org/#es-DOMException-specialness\n\n\n if (isDOMError(exception) || isDOMException(exception)) {\n var domException = exception;\n\n if ('stack' in exception) {\n event = eventFromError(exception);\n } else {\n var name_1 = domException.name || (isDOMError(domException) ? 'DOMError' : 'DOMException');\n var message = domException.message ? name_1 + \": \" + domException.message : name_1;\n event = eventFromString(message, syntheticException, attachStacktrace);\n addExceptionTypeValue(event, message);\n }\n\n if ('code' in domException) {\n event.tags = __assign(__assign({}, event.tags), {\n 'DOMException.code': \"\" + domException.code\n });\n }\n\n return event;\n }\n\n if (isError(exception)) {\n // we have a real Error object, do nothing\n return eventFromError(exception);\n }\n\n if (isPlainObject(exception) || isEvent(exception)) {\n // If it's a plain object or an instance of `Event` (the built-in JS kind, not this SDK's `Event` type), serialize\n // it manually. This will allow us to group events based on top-level keys which is much better than creating a new\n // group on any key/value change.\n var objectException = exception;\n event = eventFromPlainObject(objectException, syntheticException, isUnhandledRejection);\n addExceptionMechanism(event, {\n synthetic: true\n });\n return event;\n } // If none of previous checks were valid, then it means that it's not:\n // - an instance of DOMError\n // - an instance of DOMException\n // - an instance of Event\n // - an instance of Error\n // - a valid ErrorEvent (one with an error property)\n // - a plain Object\n //\n // So bail out and capture it as a simple message:\n\n\n event = eventFromString(exception, syntheticException, attachStacktrace);\n addExceptionTypeValue(event, \"\" + exception, undefined);\n addExceptionMechanism(event, {\n synthetic: true\n });\n return event;\n}\n/**\n * @hidden\n */\n\nexport function eventFromString(input, syntheticException, attachStacktrace) {\n var event = {\n message: input\n };\n\n if (attachStacktrace && syntheticException) {\n var frames_2 = parseStackFrames(syntheticException);\n\n if (frames_2.length) {\n event.stacktrace = {\n frames: frames_2\n };\n }\n }\n\n return event;\n}","/*\n * This file defines flags and constants that can be modified during compile time in order to facilitate tree shaking\n * for users.\n *\n * Debug flags need to be declared in each package individually and must not be imported across package boundaries,\n * because some build tools have trouble tree-shaking imported guards.\n *\n * As a convention, we define debug flags in a `flags.ts` file in the root of a package's `src` folder.\n *\n * Debug flag files will contain \"magic strings\" like `__SENTRY_DEBUG__` that may get replaced with actual values during\n * our, or the user's build process. Take care when introducing new flags - they must not throw if they are not\n * replaced.\n */\n\n/** Flag that is true for debug builds, false otherwise. */\nexport var IS_DEBUG_BUILD = typeof __SENTRY_DEBUG__ === 'undefined' ? true : __SENTRY_DEBUG__;","import { forget, getGlobalObject, isNativeFetch, logger, supportsFetch } from '@sentry/utils';\nimport { IS_DEBUG_BUILD } from '../flags';\nvar global = getGlobalObject();\nvar cachedFetchImpl;\n/**\n * A special usecase for incorrectly wrapped Fetch APIs in conjunction with ad-blockers.\n * Whenever someone wraps the Fetch API and returns the wrong promise chain,\n * this chain becomes orphaned and there is no possible way to capture it's rejections\n * other than allowing it bubble up to this very handler. eg.\n *\n * const f = window.fetch;\n * window.fetch = function () {\n * const p = f.apply(this, arguments);\n *\n * p.then(function() {\n * console.log('hi.');\n * });\n *\n * return p;\n * }\n *\n * `p.then(function () { ... })` is producing a completely separate promise chain,\n * however, what's returned is `p` - the result of original `fetch` call.\n *\n * This mean, that whenever we use the Fetch API to send our own requests, _and_\n * some ad-blocker blocks it, this orphaned chain will _always_ reject,\n * effectively causing another event to be captured.\n * This makes a whole process become an infinite loop, which we need to somehow\n * deal with, and break it in one way or another.\n *\n * To deal with this issue, we are making sure that we _always_ use the real\n * browser Fetch API, instead of relying on what `window.fetch` exposes.\n * The only downside to this would be missing our own requests as breadcrumbs,\n * but because we are already not doing this, it should be just fine.\n *\n * Possible failed fetch error messages per-browser:\n *\n * Chrome: Failed to fetch\n * Edge: Failed to Fetch\n * Firefox: NetworkError when attempting to fetch resource\n * Safari: resource blocked by content blocker\n */\n\nexport function getNativeFetchImplementation() {\n if (cachedFetchImpl) {\n return cachedFetchImpl;\n }\n /* eslint-disable @typescript-eslint/unbound-method */\n // Fast path to avoid DOM I/O\n\n\n if (isNativeFetch(global.fetch)) {\n return cachedFetchImpl = global.fetch.bind(global);\n }\n\n var document = global.document;\n var fetchImpl = global.fetch; // eslint-disable-next-line deprecation/deprecation\n\n if (document && typeof document.createElement === 'function') {\n try {\n var sandbox = document.createElement('iframe');\n sandbox.hidden = true;\n document.head.appendChild(sandbox);\n var contentWindow = sandbox.contentWindow;\n\n if (contentWindow && contentWindow.fetch) {\n fetchImpl = contentWindow.fetch;\n }\n\n document.head.removeChild(sandbox);\n } catch (e) {\n IS_DEBUG_BUILD && logger.warn('Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ', e);\n }\n }\n\n return cachedFetchImpl = fetchImpl.bind(global);\n /* eslint-enable @typescript-eslint/unbound-method */\n}\n/**\n * Sends sdk client report using sendBeacon or fetch as a fallback if available\n *\n * @param url report endpoint\n * @param body report payload\n */\n\nexport function sendReport(url, body) {\n var isRealNavigator = Object.prototype.toString.call(global && global.navigator) === '[object Navigator]';\n var hasSendBeacon = isRealNavigator && typeof global.navigator.sendBeacon === 'function';\n\n if (hasSendBeacon) {\n // Prevent illegal invocations - https://xgwang.me/posts/you-may-not-know-beacon/#it-may-throw-error%2C-be-sure-to-catch\n var sendBeacon = global.navigator.sendBeacon.bind(global.navigator);\n return sendBeacon(url, body);\n }\n\n if (supportsFetch()) {\n var fetch_1 = getNativeFetchImplementation();\n return forget(fetch_1(url, {\n body: body,\n method: 'POST',\n credentials: 'omit',\n keepalive: true\n }));\n }\n}","/**\n * Consumes the promise and logs the error when it rejects.\n * @param promise A promise to forget.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function forget(promise) {\n void promise.then(null, function (e) {\n // TODO: Use a better logging mechanism\n // eslint-disable-next-line no-console\n console.error(e);\n });\n}","import { __read } from \"tslib\";\nimport { eventToSentryRequest, getEnvelopeEndpointWithUrlEncodedAuth, getStoreEndpointWithUrlEncodedAuth, initAPIDetails, sessionToSentryRequest } from '@sentry/core';\nimport { createClientReportEnvelope, disabledUntil, dsnToString, eventStatusFromHttpCode, getGlobalObject, isRateLimited, logger, makePromiseBuffer, serializeEnvelope, updateRateLimits } from '@sentry/utils';\nimport { IS_DEBUG_BUILD } from '../flags';\nimport { sendReport } from './utils';\n\nfunction requestTypeToCategory(ty) {\n var tyStr = ty;\n return tyStr === 'event' ? 'error' : tyStr;\n}\n\nvar global = getGlobalObject();\n/** Base Transport class implementation */\n\nvar BaseTransport = function () {\n function BaseTransport(options) {\n var _this = this;\n\n this.options = options;\n /** A simple buffer holding all requests. */\n\n this._buffer = makePromiseBuffer(30);\n /** Locks transport after receiving rate limits in a response */\n\n this._rateLimits = {};\n this._outcomes = {};\n this._api = initAPIDetails(options.dsn, options._metadata, options.tunnel); // eslint-disable-next-line deprecation/deprecation\n\n this.url = getStoreEndpointWithUrlEncodedAuth(this._api.dsn);\n\n if (this.options.sendClientReports && global.document) {\n global.document.addEventListener('visibilitychange', function () {\n if (global.document.visibilityState === 'hidden') {\n _this._flushOutcomes();\n }\n });\n }\n }\n /**\n * @inheritDoc\n */\n\n\n BaseTransport.prototype.sendEvent = function (event) {\n return this._sendRequest(eventToSentryRequest(event, this._api), event);\n };\n /**\n * @inheritDoc\n */\n\n\n BaseTransport.prototype.sendSession = function (session) {\n return this._sendRequest(sessionToSentryRequest(session, this._api), session);\n };\n /**\n * @inheritDoc\n */\n\n\n BaseTransport.prototype.close = function (timeout) {\n return this._buffer.drain(timeout);\n };\n /**\n * @inheritDoc\n */\n\n\n BaseTransport.prototype.recordLostEvent = function (reason, category) {\n var _a;\n\n if (!this.options.sendClientReports) {\n return;\n } // We want to track each category (event, transaction, session) separately\n // but still keep the distinction between different type of outcomes.\n // We could use nested maps, but it's much easier to read and type this way.\n // A correct type for map-based implementation if we want to go that route\n // would be `Partial>>>`\n\n\n var key = requestTypeToCategory(category) + \":\" + reason;\n IS_DEBUG_BUILD && logger.log(\"Adding outcome: \" + key);\n this._outcomes[key] = (_a = this._outcomes[key], _a !== null && _a !== void 0 ? _a : 0) + 1;\n };\n /**\n * Send outcomes as an envelope\n */\n\n\n BaseTransport.prototype._flushOutcomes = function () {\n if (!this.options.sendClientReports) {\n return;\n }\n\n var outcomes = this._outcomes;\n this._outcomes = {}; // Nothing to send\n\n if (!Object.keys(outcomes).length) {\n IS_DEBUG_BUILD && logger.log('No outcomes to flush');\n return;\n }\n\n IS_DEBUG_BUILD && logger.log(\"Flushing outcomes:\\n\" + JSON.stringify(outcomes, null, 2));\n var url = getEnvelopeEndpointWithUrlEncodedAuth(this._api.dsn, this._api.tunnel);\n var discardedEvents = Object.keys(outcomes).map(function (key) {\n var _a = __read(key.split(':'), 2),\n category = _a[0],\n reason = _a[1];\n\n return {\n reason: reason,\n category: category,\n quantity: outcomes[key]\n }; // TODO: Improve types on discarded_events to get rid of cast\n });\n var envelope = createClientReportEnvelope(discardedEvents, this._api.tunnel && dsnToString(this._api.dsn));\n\n try {\n sendReport(url, serializeEnvelope(envelope));\n } catch (e) {\n IS_DEBUG_BUILD && logger.error(e);\n }\n };\n /**\n * Handle Sentry repsonse for promise-based transports.\n */\n\n\n BaseTransport.prototype._handleResponse = function (_a) {\n var requestType = _a.requestType,\n response = _a.response,\n headers = _a.headers,\n resolve = _a.resolve,\n reject = _a.reject;\n var status = eventStatusFromHttpCode(response.status);\n this._rateLimits = updateRateLimits(this._rateLimits, headers); // eslint-disable-next-line deprecation/deprecation\n\n if (this._isRateLimited(requestType)) {\n IS_DEBUG_BUILD && // eslint-disable-next-line deprecation/deprecation\n logger.warn(\"Too many \" + requestType + \" requests, backing off until: \" + this._disabledUntil(requestType));\n }\n\n if (status === 'success') {\n resolve({\n status: status\n });\n return;\n }\n\n reject(response);\n };\n /**\n * Gets the time that given category is disabled until for rate limiting\n *\n * @deprecated Please use `disabledUntil` from @sentry/utils\n */\n\n\n BaseTransport.prototype._disabledUntil = function (requestType) {\n var category = requestTypeToCategory(requestType);\n return new Date(disabledUntil(this._rateLimits, category));\n };\n /**\n * Checks if a category is rate limited\n *\n * @deprecated Please use `isRateLimited` from @sentry/utils\n */\n\n\n BaseTransport.prototype._isRateLimited = function (requestType) {\n var category = requestTypeToCategory(requestType);\n return isRateLimited(this._rateLimits, category);\n };\n\n return BaseTransport;\n}();\n\nexport { BaseTransport };","import { createEnvelope } from './envelope';\nimport { dateTimestampInSeconds } from './time';\n/**\n * Creates client report envelope\n * @param discarded_events An array of discard events\n * @param dsn A DSN that can be set on the header. Optional.\n */\n\nexport function createClientReportEnvelope(discarded_events, dsn, timestamp) {\n var clientReportItem = [{\n type: 'client_report'\n }, {\n timestamp: timestamp || dateTimestampInSeconds(),\n discarded_events: discarded_events\n }];\n return createEnvelope(dsn ? {\n dsn: dsn\n } : {}, [clientReportItem]);\n}","import { __extends } from \"tslib\";\nimport { SentryError, supportsReferrerPolicy, SyncPromise } from '@sentry/utils';\nimport { BaseTransport } from './base';\nimport { getNativeFetchImplementation } from './utils';\n/** `fetch` based transport */\n\nvar FetchTransport = function (_super) {\n __extends(FetchTransport, _super);\n\n function FetchTransport(options, fetchImpl) {\n if (fetchImpl === void 0) {\n fetchImpl = getNativeFetchImplementation();\n }\n\n var _this = _super.call(this, options) || this;\n\n _this._fetch = fetchImpl;\n return _this;\n }\n /**\n * @param sentryRequest Prepared SentryRequest to be delivered\n * @param originalPayload Original payload used to create SentryRequest\n */\n\n\n FetchTransport.prototype._sendRequest = function (sentryRequest, originalPayload) {\n var _this = this; // eslint-disable-next-line deprecation/deprecation\n\n\n if (this._isRateLimited(sentryRequest.type)) {\n this.recordLostEvent('ratelimit_backoff', sentryRequest.type);\n return Promise.reject({\n event: originalPayload,\n type: sentryRequest.type,\n // eslint-disable-next-line deprecation/deprecation\n reason: \"Transport for \" + sentryRequest.type + \" requests locked till \" + this._disabledUntil(sentryRequest.type) + \" due to too many requests.\",\n status: 429\n });\n }\n\n var options = {\n body: sentryRequest.body,\n method: 'POST',\n // Despite all stars in the sky saying that Edge supports old draft syntax, aka 'never', 'always', 'origin' and 'default'\n // (see https://caniuse.com/#feat=referrer-policy),\n // it doesn't. And it throws an exception instead of ignoring this parameter...\n // REF: https://github.com/getsentry/raven-js/issues/1233\n referrerPolicy: supportsReferrerPolicy() ? 'origin' : ''\n };\n\n if (this.options.fetchParameters !== undefined) {\n Object.assign(options, this.options.fetchParameters);\n }\n\n if (this.options.headers !== undefined) {\n options.headers = this.options.headers;\n }\n\n return this._buffer.add(function () {\n return new SyncPromise(function (resolve, reject) {\n void _this._fetch(sentryRequest.url, options).then(function (response) {\n var headers = {\n 'x-sentry-rate-limits': response.headers.get('X-Sentry-Rate-Limits'),\n 'retry-after': response.headers.get('Retry-After')\n };\n\n _this._handleResponse({\n requestType: sentryRequest.type,\n response: response,\n headers: headers,\n resolve: resolve,\n reject: reject\n });\n }).catch(reject);\n });\n }).then(undefined, function (reason) {\n // It's either buffer rejection or any other xhr/fetch error, which are treated as NetworkError.\n if (reason instanceof SentryError) {\n _this.recordLostEvent('queue_overflow', sentryRequest.type);\n } else {\n _this.recordLostEvent('network_error', sentryRequest.type);\n }\n\n throw reason;\n });\n };\n\n return FetchTransport;\n}(BaseTransport);\n\nexport { FetchTransport };","import { __extends } from \"tslib\";\nimport { SentryError, SyncPromise } from '@sentry/utils';\nimport { BaseTransport } from './base';\n/** `XHR` based transport */\n\nvar XHRTransport = function (_super) {\n __extends(XHRTransport, _super);\n\n function XHRTransport() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @param sentryRequest Prepared SentryRequest to be delivered\n * @param originalPayload Original payload used to create SentryRequest\n */\n\n\n XHRTransport.prototype._sendRequest = function (sentryRequest, originalPayload) {\n var _this = this; // eslint-disable-next-line deprecation/deprecation\n\n\n if (this._isRateLimited(sentryRequest.type)) {\n this.recordLostEvent('ratelimit_backoff', sentryRequest.type);\n return Promise.reject({\n event: originalPayload,\n type: sentryRequest.type,\n // eslint-disable-next-line deprecation/deprecation\n reason: \"Transport for \" + sentryRequest.type + \" requests locked till \" + this._disabledUntil(sentryRequest.type) + \" due to too many requests.\",\n status: 429\n });\n }\n\n return this._buffer.add(function () {\n return new SyncPromise(function (resolve, reject) {\n var request = new XMLHttpRequest();\n\n request.onreadystatechange = function () {\n if (request.readyState === 4) {\n var headers = {\n 'x-sentry-rate-limits': request.getResponseHeader('X-Sentry-Rate-Limits'),\n 'retry-after': request.getResponseHeader('Retry-After')\n };\n\n _this._handleResponse({\n requestType: sentryRequest.type,\n response: request,\n headers: headers,\n resolve: resolve,\n reject: reject\n });\n }\n };\n\n request.open('POST', sentryRequest.url);\n\n for (var header in _this.options.headers) {\n if (Object.prototype.hasOwnProperty.call(_this.options.headers, header)) {\n request.setRequestHeader(header, _this.options.headers[header]);\n }\n }\n\n request.send(sentryRequest.body);\n });\n }).then(undefined, function (reason) {\n // It's either buffer rejection or any other xhr/fetch error, which are treated as NetworkError.\n if (reason instanceof SentryError) {\n _this.recordLostEvent('queue_overflow', sentryRequest.type);\n } else {\n _this.recordLostEvent('network_error', sentryRequest.type);\n }\n\n throw reason;\n });\n };\n\n return XHRTransport;\n}(BaseTransport);\n\nexport { XHRTransport };","import { __assign, __extends } from \"tslib\";\nimport { BaseBackend, getEnvelopeEndpointWithUrlEncodedAuth, initAPIDetails } from '@sentry/core';\nimport { Severity } from '@sentry/types';\nimport { supportsFetch } from '@sentry/utils';\nimport { eventFromException, eventFromMessage } from './eventbuilder';\nimport { FetchTransport, makeNewFetchTransport, makeNewXHRTransport, XHRTransport } from './transports';\n/**\n * The Sentry Browser SDK Backend.\n * @hidden\n */\n\nvar BrowserBackend = function (_super) {\n __extends(BrowserBackend, _super);\n\n function BrowserBackend() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @inheritDoc\n */\n\n\n BrowserBackend.prototype.eventFromException = function (exception, hint) {\n return eventFromException(exception, hint, this._options.attachStacktrace);\n };\n /**\n * @inheritDoc\n */\n\n\n BrowserBackend.prototype.eventFromMessage = function (message, level, hint) {\n if (level === void 0) {\n level = Severity.Info;\n }\n\n return eventFromMessage(message, level, hint, this._options.attachStacktrace);\n };\n /**\n * @inheritDoc\n */\n\n\n BrowserBackend.prototype._setupTransport = function () {\n if (!this._options.dsn) {\n // We return the noop transport here in case there is no Dsn.\n return _super.prototype._setupTransport.call(this);\n }\n\n var transportOptions = __assign(__assign({}, this._options.transportOptions), {\n dsn: this._options.dsn,\n tunnel: this._options.tunnel,\n sendClientReports: this._options.sendClientReports,\n _metadata: this._options._metadata\n });\n\n var api = initAPIDetails(transportOptions.dsn, transportOptions._metadata, transportOptions.tunnel);\n var url = getEnvelopeEndpointWithUrlEncodedAuth(api.dsn, api.tunnel);\n\n if (this._options.transport) {\n return new this._options.transport(transportOptions);\n }\n\n if (supportsFetch()) {\n var requestOptions = __assign({}, transportOptions.fetchParameters);\n\n this._newTransport = makeNewFetchTransport({\n requestOptions: requestOptions,\n url: url\n });\n return new FetchTransport(transportOptions);\n }\n\n this._newTransport = makeNewXHRTransport({\n url: url,\n headers: transportOptions.headers\n });\n return new XHRTransport(transportOptions);\n };\n\n return BrowserBackend;\n}(BaseBackend);\n\nexport { BrowserBackend };","import { __assign } from \"tslib\";\nimport { createTransport } from '@sentry/core';\nimport { getNativeFetchImplementation } from './utils';\n/**\n * Creates a Transport that uses the Fetch API to send events to Sentry.\n */\n\nexport function makeNewFetchTransport(options, nativeFetch) {\n if (nativeFetch === void 0) {\n nativeFetch = getNativeFetchImplementation();\n }\n\n function makeRequest(request) {\n var requestOptions = __assign({\n body: request.body,\n method: 'POST',\n referrerPolicy: 'origin'\n }, options.requestOptions);\n\n return nativeFetch(options.url, requestOptions).then(function (response) {\n return response.text().then(function (body) {\n return {\n body: body,\n headers: {\n 'x-sentry-rate-limits': response.headers.get('X-Sentry-Rate-Limits'),\n 'retry-after': response.headers.get('Retry-After')\n },\n reason: response.statusText,\n statusCode: response.status\n };\n });\n });\n }\n\n return createTransport({\n bufferSize: options.bufferSize\n }, makeRequest);\n}","import { createTransport } from '@sentry/core';\nimport { SyncPromise } from '@sentry/utils';\n/**\n * The DONE ready state for XmlHttpRequest\n *\n * Defining it here as a constant b/c XMLHttpRequest.DONE is not always defined\n * (e.g. during testing, it is `undefined`)\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/readyState}\n */\n\nvar XHR_READYSTATE_DONE = 4;\n/**\n * Creates a Transport that uses the XMLHttpRequest API to send events to Sentry.\n */\n\nexport function makeNewXHRTransport(options) {\n function makeRequest(request) {\n return new SyncPromise(function (resolve, _reject) {\n var xhr = new XMLHttpRequest();\n\n xhr.onreadystatechange = function () {\n if (xhr.readyState === XHR_READYSTATE_DONE) {\n var response = {\n body: xhr.response,\n headers: {\n 'x-sentry-rate-limits': xhr.getResponseHeader('X-Sentry-Rate-Limits'),\n 'retry-after': xhr.getResponseHeader('Retry-After')\n },\n reason: xhr.statusText,\n statusCode: xhr.status\n };\n resolve(response);\n }\n };\n\n xhr.open('POST', options.url);\n\n for (var header in options.headers) {\n if (Object.prototype.hasOwnProperty.call(options.headers, header)) {\n xhr.setRequestHeader(header, options.headers[header]);\n }\n }\n\n xhr.send(request.body);\n });\n }\n\n return createTransport({\n bufferSize: options.bufferSize\n }, makeRequest);\n}","import { __assign } from \"tslib\";\nimport { captureException, getReportDialogEndpoint, withScope } from '@sentry/core';\nimport { addExceptionMechanism, addExceptionTypeValue, addNonEnumerableProperty, getGlobalObject, getOriginalFunction, logger, markFunctionWrapped } from '@sentry/utils';\nimport { IS_DEBUG_BUILD } from './flags';\nvar global = getGlobalObject();\nvar ignoreOnError = 0;\n/**\n * @hidden\n */\n\nexport function shouldIgnoreOnError() {\n return ignoreOnError > 0;\n}\n/**\n * @hidden\n */\n\nexport function ignoreNextOnError() {\n // onerror should trigger before setTimeout\n ignoreOnError += 1;\n setTimeout(function () {\n ignoreOnError -= 1;\n });\n}\n/**\n * Instruments the given function and sends an event to Sentry every time the\n * function throws an exception.\n *\n * @param fn A function to wrap.\n * @returns The wrapped function.\n * @hidden\n */\n\nexport function wrap(fn, options, before) {\n // for future readers what this does is wrap a function and then create\n // a bi-directional wrapping between them.\n //\n // example: wrapped = wrap(original);\n // original.__sentry_wrapped__ -> wrapped\n // wrapped.__sentry_original__ -> original\n if (options === void 0) {\n options = {};\n }\n\n if (typeof fn !== 'function') {\n return fn;\n }\n\n try {\n // if we're dealing with a function that was previously wrapped, return\n // the original wrapper.\n var wrapper = fn.__sentry_wrapped__;\n\n if (wrapper) {\n return wrapper;\n } // We don't wanna wrap it twice\n\n\n if (getOriginalFunction(fn)) {\n return fn;\n }\n } catch (e) {\n // Just accessing custom props in some Selenium environments\n // can cause a \"Permission denied\" exception (see raven-js#495).\n // Bail on wrapping and return the function as-is (defers to window.onerror).\n return fn;\n }\n /* eslint-disable prefer-rest-params */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n\n var sentryWrapped = function sentryWrapped() {\n var args = Array.prototype.slice.call(arguments);\n\n try {\n if (before && typeof before === 'function') {\n before.apply(this, arguments);\n } // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access\n\n\n var wrappedArguments = args.map(function (arg) {\n return wrap(arg, options);\n }); // Attempt to invoke user-land function\n // NOTE: If you are a Sentry user, and you are seeing this stack frame, it\n // means the sentry.javascript SDK caught an error invoking your application code. This\n // is expected behavior and NOT indicative of a bug with sentry.javascript.\n\n return fn.apply(this, wrappedArguments);\n } catch (ex) {\n ignoreNextOnError();\n withScope(function (scope) {\n scope.addEventProcessor(function (event) {\n if (options.mechanism) {\n addExceptionTypeValue(event, undefined, undefined);\n addExceptionMechanism(event, options.mechanism);\n }\n\n event.extra = __assign(__assign({}, event.extra), {\n arguments: args\n });\n return event;\n });\n captureException(ex);\n });\n throw ex;\n }\n };\n /* eslint-enable prefer-rest-params */\n // Accessing some objects may throw\n // ref: https://github.com/getsentry/sentry-javascript/issues/1168\n\n\n try {\n for (var property in fn) {\n if (Object.prototype.hasOwnProperty.call(fn, property)) {\n sentryWrapped[property] = fn[property];\n }\n }\n } catch (_oO) {} // eslint-disable-line no-empty\n // Signal that this function has been wrapped/filled already\n // for both debugging and to prevent it to being wrapped/filled twice\n\n\n markFunctionWrapped(sentryWrapped, fn);\n addNonEnumerableProperty(fn, '__sentry_wrapped__', sentryWrapped); // Restore original function name (not all browsers allow that)\n\n try {\n var descriptor = Object.getOwnPropertyDescriptor(sentryWrapped, 'name');\n\n if (descriptor.configurable) {\n Object.defineProperty(sentryWrapped, 'name', {\n get: function get() {\n return fn.name;\n }\n });\n } // eslint-disable-next-line no-empty\n\n } catch (_oO) {}\n\n return sentryWrapped;\n}\n/**\n * Injects the Report Dialog script\n * @hidden\n */\n\nexport function injectReportDialog(options) {\n if (options === void 0) {\n options = {};\n }\n\n if (!global.document) {\n return;\n }\n\n if (!options.eventId) {\n IS_DEBUG_BUILD && logger.error('Missing eventId option in showReportDialog call');\n return;\n }\n\n if (!options.dsn) {\n IS_DEBUG_BUILD && logger.error('Missing dsn option in showReportDialog call');\n return;\n }\n\n var script = global.document.createElement('script');\n script.async = true;\n script.src = getReportDialogEndpoint(options.dsn, options);\n\n if (options.onLoad) {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n script.onload = options.onLoad;\n }\n\n var injectionPoint = global.document.head || global.document.body;\n\n if (injectionPoint) {\n injectionPoint.appendChild(script);\n }\n}","import { __assign, __read } from \"tslib\";\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n\nimport { getCurrentHub } from '@sentry/core';\nimport { Severity } from '@sentry/types';\nimport { addExceptionMechanism, addInstrumentationHandler, getLocationHref, isErrorEvent, isPrimitive, isString, logger } from '@sentry/utils';\nimport { eventFromUnknownInput } from '../eventbuilder';\nimport { IS_DEBUG_BUILD } from '../flags';\nimport { shouldIgnoreOnError } from '../helpers';\n/** Global handlers */\n\nvar GlobalHandlers = function () {\n /** JSDoc */\n function GlobalHandlers(options) {\n /**\n * @inheritDoc\n */\n this.name = GlobalHandlers.id;\n /**\n * Stores references functions to installing handlers. Will set to undefined\n * after they have been run so that they are not used twice.\n */\n\n this._installFunc = {\n onerror: _installGlobalOnErrorHandler,\n onunhandledrejection: _installGlobalOnUnhandledRejectionHandler\n };\n this._options = __assign({\n onerror: true,\n onunhandledrejection: true\n }, options);\n }\n /**\n * @inheritDoc\n */\n\n\n GlobalHandlers.prototype.setupOnce = function () {\n Error.stackTraceLimit = 50;\n var options = this._options; // We can disable guard-for-in as we construct the options object above + do checks against\n // `this._installFunc` for the property.\n // eslint-disable-next-line guard-for-in\n\n for (var key in options) {\n var installFunc = this._installFunc[key];\n\n if (installFunc && options[key]) {\n globalHandlerLog(key);\n installFunc();\n this._installFunc[key] = undefined;\n }\n }\n };\n /**\n * @inheritDoc\n */\n\n\n GlobalHandlers.id = 'GlobalHandlers';\n return GlobalHandlers;\n}();\n\nexport { GlobalHandlers };\n/** JSDoc */\n\nfunction _installGlobalOnErrorHandler() {\n addInstrumentationHandler('error', // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function (data) {\n var _a = __read(getHubAndAttachStacktrace(), 2),\n hub = _a[0],\n attachStacktrace = _a[1];\n\n if (!hub.getIntegration(GlobalHandlers)) {\n return;\n }\n\n var msg = data.msg,\n url = data.url,\n line = data.line,\n column = data.column,\n error = data.error;\n\n if (shouldIgnoreOnError() || error && error.__sentry_own_request__) {\n return;\n }\n\n var event = error === undefined && isString(msg) ? _eventFromIncompleteOnError(msg, url, line, column) : _enhanceEventWithInitialFrame(eventFromUnknownInput(error || msg, undefined, attachStacktrace, false), url, line, column);\n event.level = Severity.Error;\n addMechanismAndCapture(hub, error, event, 'onerror');\n });\n}\n/** JSDoc */\n\n\nfunction _installGlobalOnUnhandledRejectionHandler() {\n addInstrumentationHandler('unhandledrejection', // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function (e) {\n var _a = __read(getHubAndAttachStacktrace(), 2),\n hub = _a[0],\n attachStacktrace = _a[1];\n\n if (!hub.getIntegration(GlobalHandlers)) {\n return;\n }\n\n var error = e; // dig the object of the rejection out of known event types\n\n try {\n // PromiseRejectionEvents store the object of the rejection under 'reason'\n // see https://developer.mozilla.org/en-US/docs/Web/API/PromiseRejectionEvent\n if ('reason' in e) {\n error = e.reason;\n } // something, somewhere, (likely a browser extension) effectively casts PromiseRejectionEvents\n // to CustomEvents, moving the `promise` and `reason` attributes of the PRE into\n // the CustomEvent's `detail` attribute, since they're not part of CustomEvent's spec\n // see https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent and\n // https://github.com/getsentry/sentry-javascript/issues/2380\n else if ('detail' in e && 'reason' in e.detail) {\n error = e.detail.reason;\n }\n } catch (_oO) {// no-empty\n }\n\n if (shouldIgnoreOnError() || error && error.__sentry_own_request__) {\n return true;\n }\n\n var event = isPrimitive(error) ? _eventFromRejectionWithPrimitive(error) : eventFromUnknownInput(error, undefined, attachStacktrace, true);\n event.level = Severity.Error;\n addMechanismAndCapture(hub, error, event, 'onunhandledrejection');\n return;\n });\n}\n/**\n * Create an event from a promise rejection where the `reason` is a primitive.\n *\n * @param reason: The `reason` property of the promise rejection\n * @returns An Event object with an appropriate `exception` value\n */\n\n\nfunction _eventFromRejectionWithPrimitive(reason) {\n return {\n exception: {\n values: [{\n type: 'UnhandledRejection',\n // String() is needed because the Primitive type includes symbols (which can't be automatically stringified)\n value: \"Non-Error promise rejection captured with value: \" + String(reason)\n }]\n }\n };\n}\n/**\n * This function creates a stack from an old, error-less onerror handler.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n\nfunction _eventFromIncompleteOnError(msg, url, line, column) {\n var ERROR_TYPES_RE = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i; // If 'message' is ErrorEvent, get real message from inside\n\n var message = isErrorEvent(msg) ? msg.message : msg;\n var name = 'Error';\n var groups = message.match(ERROR_TYPES_RE);\n\n if (groups) {\n name = groups[1];\n message = groups[2];\n }\n\n var event = {\n exception: {\n values: [{\n type: name,\n value: message\n }]\n }\n };\n return _enhanceEventWithInitialFrame(event, url, line, column);\n}\n/** JSDoc */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n\nfunction _enhanceEventWithInitialFrame(event, url, line, column) {\n // event.exception\n var e = event.exception = event.exception || {}; // event.exception.values\n\n var ev = e.values = e.values || []; // event.exception.values[0]\n\n var ev0 = ev[0] = ev[0] || {}; // event.exception.values[0].stacktrace\n\n var ev0s = ev0.stacktrace = ev0.stacktrace || {}; // event.exception.values[0].stacktrace.frames\n\n var ev0sf = ev0s.frames = ev0s.frames || [];\n var colno = isNaN(parseInt(column, 10)) ? undefined : column;\n var lineno = isNaN(parseInt(line, 10)) ? undefined : line;\n var filename = isString(url) && url.length > 0 ? url : getLocationHref(); // event.exception.values[0].stacktrace.frames\n\n if (ev0sf.length === 0) {\n ev0sf.push({\n colno: colno,\n filename: filename,\n function: '?',\n in_app: true,\n lineno: lineno\n });\n }\n\n return event;\n}\n\nfunction globalHandlerLog(type) {\n IS_DEBUG_BUILD && logger.log(\"Global Handler attached: \" + type);\n}\n\nfunction addMechanismAndCapture(hub, error, event, type) {\n addExceptionMechanism(event, {\n handled: false,\n type: type\n });\n hub.captureEvent(event, {\n originalException: error\n });\n}\n\nfunction getHubAndAttachStacktrace() {\n var hub = getCurrentHub();\n var client = hub.getClient();\n var attachStacktrace = client && client.getOptions().attachStacktrace;\n return [hub, attachStacktrace];\n}","import { __assign } from \"tslib\";\nimport { fill, getFunctionName, getGlobalObject, getOriginalFunction } from '@sentry/utils';\nimport { wrap } from '../helpers';\nvar DEFAULT_EVENT_TARGET = ['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'];\n/** Wrap timer functions and event targets to catch errors and provide better meta data */\n\nvar TryCatch = function () {\n /**\n * @inheritDoc\n */\n function TryCatch(options) {\n /**\n * @inheritDoc\n */\n this.name = TryCatch.id;\n this._options = __assign({\n XMLHttpRequest: true,\n eventTarget: true,\n requestAnimationFrame: true,\n setInterval: true,\n setTimeout: true\n }, options);\n }\n /**\n * Wrap timer functions and event targets to catch errors\n * and provide better metadata.\n */\n\n\n TryCatch.prototype.setupOnce = function () {\n var global = getGlobalObject();\n\n if (this._options.setTimeout) {\n fill(global, 'setTimeout', _wrapTimeFunction);\n }\n\n if (this._options.setInterval) {\n fill(global, 'setInterval', _wrapTimeFunction);\n }\n\n if (this._options.requestAnimationFrame) {\n fill(global, 'requestAnimationFrame', _wrapRAF);\n }\n\n if (this._options.XMLHttpRequest && 'XMLHttpRequest' in global) {\n fill(XMLHttpRequest.prototype, 'send', _wrapXHR);\n }\n\n var eventTargetOption = this._options.eventTarget;\n\n if (eventTargetOption) {\n var eventTarget = Array.isArray(eventTargetOption) ? eventTargetOption : DEFAULT_EVENT_TARGET;\n eventTarget.forEach(_wrapEventTarget);\n }\n };\n /**\n * @inheritDoc\n */\n\n\n TryCatch.id = 'TryCatch';\n return TryCatch;\n}();\n\nexport { TryCatch };\n/** JSDoc */\n\nfunction _wrapTimeFunction(original) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n var originalCallback = args[0];\n args[0] = wrap(originalCallback, {\n mechanism: {\n data: {\n function: getFunctionName(original)\n },\n handled: true,\n type: 'instrument'\n }\n });\n return original.apply(this, args);\n };\n}\n/** JSDoc */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n\nfunction _wrapRAF(original) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return function (callback) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return original.apply(this, [wrap(callback, {\n mechanism: {\n data: {\n function: 'requestAnimationFrame',\n handler: getFunctionName(original)\n },\n handled: true,\n type: 'instrument'\n }\n })]);\n };\n}\n/** JSDoc */\n\n\nfunction _wrapXHR(originalSend) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n } // eslint-disable-next-line @typescript-eslint/no-this-alias\n\n\n var xhr = this;\n var xmlHttpRequestProps = ['onload', 'onerror', 'onprogress', 'onreadystatechange'];\n xmlHttpRequestProps.forEach(function (prop) {\n if (prop in xhr && typeof xhr[prop] === 'function') {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n fill(xhr, prop, function (original) {\n var wrapOptions = {\n mechanism: {\n data: {\n function: prop,\n handler: getFunctionName(original)\n },\n handled: true,\n type: 'instrument'\n }\n }; // If Instrument integration has been called before TryCatch, get the name of original function\n\n var originalFunction = getOriginalFunction(original);\n\n if (originalFunction) {\n wrapOptions.mechanism.data.handler = getFunctionName(originalFunction);\n } // Otherwise wrap directly\n\n\n return wrap(original, wrapOptions);\n });\n }\n });\n return originalSend.apply(this, args);\n };\n}\n/** JSDoc */\n\n\nfunction _wrapEventTarget(target) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n var global = getGlobalObject(); // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n\n var proto = global[target] && global[target].prototype; // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, no-prototype-builtins\n\n if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty('addEventListener')) {\n return;\n }\n\n fill(proto, 'addEventListener', function (original) {\n return function (eventName, fn, options) {\n try {\n if (typeof fn.handleEvent === 'function') {\n fn.handleEvent = wrap(fn.handleEvent.bind(fn), {\n mechanism: {\n data: {\n function: 'handleEvent',\n handler: getFunctionName(fn),\n target: target\n },\n handled: true,\n type: 'instrument'\n }\n });\n }\n } catch (err) {// can sometimes get 'Permission denied to access property \"handle Event'\n }\n\n return original.apply(this, [eventName, // eslint-disable-next-line @typescript-eslint/no-explicit-any\n wrap(fn, {\n mechanism: {\n data: {\n function: 'addEventListener',\n handler: getFunctionName(fn),\n target: target\n },\n handled: true,\n type: 'instrument'\n }\n }), options]);\n };\n });\n fill(proto, 'removeEventListener', function (originalRemoveEventListener) {\n return function (eventName, fn, options) {\n /**\n * There are 2 possible scenarios here:\n *\n * 1. Someone passes a callback, which was attached prior to Sentry initialization, or by using unmodified\n * method, eg. `document.addEventListener.call(el, name, handler). In this case, we treat this function\n * as a pass-through, and call original `removeEventListener` with it.\n *\n * 2. Someone passes a callback, which was attached after Sentry was initialized, which means that it was using\n * our wrapped version of `addEventListener`, which internally calls `wrap` helper.\n * This helper \"wraps\" whole callback inside a try/catch statement, and attached appropriate metadata to it,\n * in order for us to make a distinction between wrapped/non-wrapped functions possible.\n * If a function was wrapped, it has additional property of `__sentry_wrapped__`, holding the handler.\n *\n * When someone adds a handler prior to initialization, and then do it again, but after,\n * then we have to detach both of them. Otherwise, if we'd detach only wrapped one, it'd be impossible\n * to get rid of the initial handler and it'd stick there forever.\n */\n var wrappedEventHandler = fn;\n\n try {\n var originalEventHandler = wrappedEventHandler && wrappedEventHandler.__sentry_wrapped__;\n\n if (originalEventHandler) {\n originalRemoveEventListener.call(this, eventName, originalEventHandler, options);\n }\n } catch (e) {// ignore, accessing __sentry_wrapped__ will throw in some Selenium environments\n }\n\n return originalRemoveEventListener.call(this, eventName, wrappedEventHandler, options);\n };\n });\n}","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport { __assign } from \"tslib\";\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n\n/* eslint-disable max-lines */\n\nimport { getCurrentHub } from '@sentry/core';\nimport { Severity } from '@sentry/types';\nimport { addInstrumentationHandler, getEventDescription, getGlobalObject, htmlTreeAsString, parseUrl, safeJoin, severityFromString } from '@sentry/utils';\n/**\n * Default Breadcrumbs instrumentations\n * TODO: Deprecated - with v6, this will be renamed to `Instrument`\n */\n\nvar Breadcrumbs = function () {\n /**\n * @inheritDoc\n */\n function Breadcrumbs(options) {\n /**\n * @inheritDoc\n */\n this.name = Breadcrumbs.id;\n this._options = __assign({\n console: true,\n dom: true,\n fetch: true,\n history: true,\n sentry: true,\n xhr: true\n }, options);\n }\n /**\n * Create a breadcrumb of `sentry` from the events themselves\n */\n\n\n Breadcrumbs.prototype.addSentryBreadcrumb = function (event) {\n if (!this._options.sentry) {\n return;\n }\n\n getCurrentHub().addBreadcrumb({\n category: \"sentry.\" + (event.type === 'transaction' ? 'transaction' : 'event'),\n event_id: event.event_id,\n level: event.level,\n message: getEventDescription(event)\n }, {\n event: event\n });\n };\n /**\n * Instrument browser built-ins w/ breadcrumb capturing\n * - Console API\n * - DOM API (click/typing)\n * - XMLHttpRequest API\n * - Fetch API\n * - History API\n */\n\n\n Breadcrumbs.prototype.setupOnce = function () {\n if (this._options.console) {\n addInstrumentationHandler('console', _consoleBreadcrumb);\n }\n\n if (this._options.dom) {\n addInstrumentationHandler('dom', _domBreadcrumb(this._options.dom));\n }\n\n if (this._options.xhr) {\n addInstrumentationHandler('xhr', _xhrBreadcrumb);\n }\n\n if (this._options.fetch) {\n addInstrumentationHandler('fetch', _fetchBreadcrumb);\n }\n\n if (this._options.history) {\n addInstrumentationHandler('history', _historyBreadcrumb);\n }\n };\n /**\n * @inheritDoc\n */\n\n\n Breadcrumbs.id = 'Breadcrumbs';\n return Breadcrumbs;\n}();\n\nexport { Breadcrumbs };\n/**\n * A HOC that creaes a function that creates breadcrumbs from DOM API calls.\n * This is a HOC so that we get access to dom options in the closure.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\nfunction _domBreadcrumb(dom) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function _innerDomBreadcrumb(handlerData) {\n var target;\n var keyAttrs = _typeof(dom) === 'object' ? dom.serializeAttribute : undefined;\n\n if (typeof keyAttrs === 'string') {\n keyAttrs = [keyAttrs];\n } // Accessing event.target can throw (see getsentry/raven-js#838, #768)\n\n\n try {\n target = handlerData.event.target ? htmlTreeAsString(handlerData.event.target, keyAttrs) : htmlTreeAsString(handlerData.event, keyAttrs);\n } catch (e) {\n target = '';\n }\n\n if (target.length === 0) {\n return;\n }\n\n getCurrentHub().addBreadcrumb({\n category: \"ui.\" + handlerData.name,\n message: target\n }, {\n event: handlerData.event,\n name: handlerData.name,\n global: handlerData.global\n });\n }\n\n return _innerDomBreadcrumb;\n}\n/**\n * Creates breadcrumbs from console API calls\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n\nfunction _consoleBreadcrumb(handlerData) {\n var breadcrumb = {\n category: 'console',\n data: {\n arguments: handlerData.args,\n logger: 'console'\n },\n level: severityFromString(handlerData.level),\n message: safeJoin(handlerData.args, ' ')\n };\n\n if (handlerData.level === 'assert') {\n if (handlerData.args[0] === false) {\n breadcrumb.message = \"Assertion failed: \" + (safeJoin(handlerData.args.slice(1), ' ') || 'console.assert');\n breadcrumb.data.arguments = handlerData.args.slice(1);\n } else {\n // Don't capture a breadcrumb for passed assertions\n return;\n }\n }\n\n getCurrentHub().addBreadcrumb(breadcrumb, {\n input: handlerData.args,\n level: handlerData.level\n });\n}\n/**\n * Creates breadcrumbs from XHR API calls\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n\nfunction _xhrBreadcrumb(handlerData) {\n if (handlerData.endTimestamp) {\n // We only capture complete, non-sentry requests\n if (handlerData.xhr.__sentry_own_request__) {\n return;\n }\n\n var _a = handlerData.xhr.__sentry_xhr__ || {},\n method = _a.method,\n url = _a.url,\n status_code = _a.status_code,\n body = _a.body;\n\n getCurrentHub().addBreadcrumb({\n category: 'xhr',\n data: {\n method: method,\n url: url,\n status_code: status_code\n },\n type: 'http'\n }, {\n xhr: handlerData.xhr,\n input: body\n });\n return;\n }\n}\n/**\n * Creates breadcrumbs from fetch API calls\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n\nfunction _fetchBreadcrumb(handlerData) {\n // We only capture complete fetch requests\n if (!handlerData.endTimestamp) {\n return;\n }\n\n if (handlerData.fetchData.url.match(/sentry_key/) && handlerData.fetchData.method === 'POST') {\n // We will not create breadcrumbs for fetch requests that contain `sentry_key` (internal sentry requests)\n return;\n }\n\n if (handlerData.error) {\n getCurrentHub().addBreadcrumb({\n category: 'fetch',\n data: handlerData.fetchData,\n level: Severity.Error,\n type: 'http'\n }, {\n data: handlerData.error,\n input: handlerData.args\n });\n } else {\n getCurrentHub().addBreadcrumb({\n category: 'fetch',\n data: __assign(__assign({}, handlerData.fetchData), {\n status_code: handlerData.response.status\n }),\n type: 'http'\n }, {\n input: handlerData.args,\n response: handlerData.response\n });\n }\n}\n/**\n * Creates breadcrumbs from history API calls\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n\nfunction _historyBreadcrumb(handlerData) {\n var global = getGlobalObject();\n var from = handlerData.from;\n var to = handlerData.to;\n var parsedLoc = parseUrl(global.location.href);\n var parsedFrom = parseUrl(from);\n var parsedTo = parseUrl(to); // Initial pushState doesn't provide `from` information\n\n if (!parsedFrom.path) {\n parsedFrom = parsedLoc;\n } // Use only the path component of the URL if the URL matches the current\n // document (almost all the time when using pushState)\n\n\n if (parsedLoc.protocol === parsedTo.protocol && parsedLoc.host === parsedTo.host) {\n to = parsedTo.relative;\n }\n\n if (parsedLoc.protocol === parsedFrom.protocol && parsedLoc.host === parsedFrom.host) {\n from = parsedFrom.relative;\n }\n\n getCurrentHub().addBreadcrumb({\n category: 'navigation',\n data: {\n from: from,\n to: to\n }\n });\n}","import { __read, __spread } from \"tslib\";\nimport { addGlobalEventProcessor, getCurrentHub } from '@sentry/core';\nimport { isInstanceOf } from '@sentry/utils';\nimport { exceptionFromError } from '../eventbuilder';\nvar DEFAULT_KEY = 'cause';\nvar DEFAULT_LIMIT = 5;\n/** Adds SDK info to an event. */\n\nvar LinkedErrors = function () {\n /**\n * @inheritDoc\n */\n function LinkedErrors(options) {\n if (options === void 0) {\n options = {};\n }\n /**\n * @inheritDoc\n */\n\n\n this.name = LinkedErrors.id;\n this._key = options.key || DEFAULT_KEY;\n this._limit = options.limit || DEFAULT_LIMIT;\n }\n /**\n * @inheritDoc\n */\n\n\n LinkedErrors.prototype.setupOnce = function () {\n addGlobalEventProcessor(function (event, hint) {\n var self = getCurrentHub().getIntegration(LinkedErrors);\n return self ? _handler(self._key, self._limit, event, hint) : event;\n });\n };\n /**\n * @inheritDoc\n */\n\n\n LinkedErrors.id = 'LinkedErrors';\n return LinkedErrors;\n}();\n\nexport { LinkedErrors };\n/**\n * @inheritDoc\n */\n\nexport function _handler(key, limit, event, hint) {\n if (!event.exception || !event.exception.values || !hint || !isInstanceOf(hint.originalException, Error)) {\n return event;\n }\n\n var linkedErrors = _walkErrorTree(limit, hint.originalException, key);\n\n event.exception.values = __spread(linkedErrors, event.exception.values);\n return event;\n}\n/**\n * JSDOC\n */\n\nexport function _walkErrorTree(limit, error, key, stack) {\n if (stack === void 0) {\n stack = [];\n }\n\n if (!isInstanceOf(error[key], Error) || stack.length + 1 >= limit) {\n return stack;\n }\n\n var exception = exceptionFromError(error[key]);\n return _walkErrorTree(limit, error[key], key, __spread([exception], stack));\n}","import { __assign } from \"tslib\";\nimport { addGlobalEventProcessor, getCurrentHub } from '@sentry/core';\nimport { getGlobalObject } from '@sentry/utils';\nvar global = getGlobalObject();\n/** UserAgent */\n\nvar UserAgent = function () {\n function UserAgent() {\n /**\n * @inheritDoc\n */\n this.name = UserAgent.id;\n }\n /**\n * @inheritDoc\n */\n\n\n UserAgent.prototype.setupOnce = function () {\n addGlobalEventProcessor(function (event) {\n if (getCurrentHub().getIntegration(UserAgent)) {\n // if none of the information we want exists, don't bother\n if (!global.navigator && !global.location && !global.document) {\n return event;\n } // grab as much info as exists and add it to the event\n\n\n var url = event.request && event.request.url || global.location && global.location.href;\n var referrer = (global.document || {}).referrer;\n var userAgent = (global.navigator || {}).userAgent;\n\n var headers = __assign(__assign(__assign({}, event.request && event.request.headers), referrer && {\n Referer: referrer\n }), userAgent && {\n 'User-Agent': userAgent\n });\n\n var request = __assign(__assign({}, url && {\n url: url\n }), {\n headers: headers\n });\n\n return __assign(__assign({}, event), {\n request: request\n });\n }\n\n return event;\n });\n };\n /**\n * @inheritDoc\n */\n\n\n UserAgent.id = 'UserAgent';\n return UserAgent;\n}();\n\nexport { UserAgent };","import { logger } from '@sentry/utils';\nimport { IS_DEBUG_BUILD } from '../flags';\n/** Deduplication filter */\n\nvar Dedupe = function () {\n function Dedupe() {\n /**\n * @inheritDoc\n */\n this.name = Dedupe.id;\n }\n /**\n * @inheritDoc\n */\n\n\n Dedupe.prototype.setupOnce = function (addGlobalEventProcessor, getCurrentHub) {\n addGlobalEventProcessor(function (currentEvent) {\n var self = getCurrentHub().getIntegration(Dedupe);\n\n if (self) {\n // Juuust in case something goes wrong\n try {\n if (_shouldDropEvent(currentEvent, self._previousEvent)) {\n IS_DEBUG_BUILD && logger.warn('Event dropped due to being a duplicate of previously captured event.');\n return null;\n }\n } catch (_oO) {\n return self._previousEvent = currentEvent;\n }\n\n return self._previousEvent = currentEvent;\n }\n\n return currentEvent;\n });\n };\n /**\n * @inheritDoc\n */\n\n\n Dedupe.id = 'Dedupe';\n return Dedupe;\n}();\n\nexport { Dedupe };\n/** JSDoc */\n\nfunction _shouldDropEvent(currentEvent, previousEvent) {\n if (!previousEvent) {\n return false;\n }\n\n if (_isSameMessageEvent(currentEvent, previousEvent)) {\n return true;\n }\n\n if (_isSameExceptionEvent(currentEvent, previousEvent)) {\n return true;\n }\n\n return false;\n}\n/** JSDoc */\n\n\nfunction _isSameMessageEvent(currentEvent, previousEvent) {\n var currentMessage = currentEvent.message;\n var previousMessage = previousEvent.message; // If neither event has a message property, they were both exceptions, so bail out\n\n if (!currentMessage && !previousMessage) {\n return false;\n } // If only one event has a stacktrace, but not the other one, they are not the same\n\n\n if (currentMessage && !previousMessage || !currentMessage && previousMessage) {\n return false;\n }\n\n if (currentMessage !== previousMessage) {\n return false;\n }\n\n if (!_isSameFingerprint(currentEvent, previousEvent)) {\n return false;\n }\n\n if (!_isSameStacktrace(currentEvent, previousEvent)) {\n return false;\n }\n\n return true;\n}\n/** JSDoc */\n\n\nfunction _isSameExceptionEvent(currentEvent, previousEvent) {\n var previousException = _getExceptionFromEvent(previousEvent);\n\n var currentException = _getExceptionFromEvent(currentEvent);\n\n if (!previousException || !currentException) {\n return false;\n }\n\n if (previousException.type !== currentException.type || previousException.value !== currentException.value) {\n return false;\n }\n\n if (!_isSameFingerprint(currentEvent, previousEvent)) {\n return false;\n }\n\n if (!_isSameStacktrace(currentEvent, previousEvent)) {\n return false;\n }\n\n return true;\n}\n/** JSDoc */\n\n\nfunction _isSameStacktrace(currentEvent, previousEvent) {\n var currentFrames = _getFramesFromEvent(currentEvent);\n\n var previousFrames = _getFramesFromEvent(previousEvent); // If neither event has a stacktrace, they are assumed to be the same\n\n\n if (!currentFrames && !previousFrames) {\n return true;\n } // If only one event has a stacktrace, but not the other one, they are not the same\n\n\n if (currentFrames && !previousFrames || !currentFrames && previousFrames) {\n return false;\n }\n\n currentFrames = currentFrames;\n previousFrames = previousFrames; // If number of frames differ, they are not the same\n\n if (previousFrames.length !== currentFrames.length) {\n return false;\n } // Otherwise, compare the two\n\n\n for (var i = 0; i < previousFrames.length; i++) {\n var frameA = previousFrames[i];\n var frameB = currentFrames[i];\n\n if (frameA.filename !== frameB.filename || frameA.lineno !== frameB.lineno || frameA.colno !== frameB.colno || frameA.function !== frameB.function) {\n return false;\n }\n }\n\n return true;\n}\n/** JSDoc */\n\n\nfunction _isSameFingerprint(currentEvent, previousEvent) {\n var currentFingerprint = currentEvent.fingerprint;\n var previousFingerprint = previousEvent.fingerprint; // If neither event has a fingerprint, they are assumed to be the same\n\n if (!currentFingerprint && !previousFingerprint) {\n return true;\n } // If only one event has a fingerprint, but not the other one, they are not the same\n\n\n if (currentFingerprint && !previousFingerprint || !currentFingerprint && previousFingerprint) {\n return false;\n }\n\n currentFingerprint = currentFingerprint;\n previousFingerprint = previousFingerprint; // Otherwise, compare the two\n\n try {\n return !!(currentFingerprint.join('') === previousFingerprint.join(''));\n } catch (_oO) {\n return false;\n }\n}\n/** JSDoc */\n\n\nfunction _getExceptionFromEvent(event) {\n return event.exception && event.exception.values && event.exception.values[0];\n}\n/** JSDoc */\n\n\nfunction _getFramesFromEvent(event) {\n var exception = event.exception;\n\n if (exception) {\n try {\n // @ts-ignore Object could be undefined\n return exception.values[0].stacktrace.frames;\n } catch (_oO) {\n return undefined;\n }\n } else if (event.stacktrace) {\n return event.stacktrace.frames;\n }\n\n return undefined;\n}","import { __assign, __extends } from \"tslib\";\nimport { BaseClient, SDK_VERSION } from '@sentry/core';\nimport { getGlobalObject, logger } from '@sentry/utils';\nimport { BrowserBackend } from './backend';\nimport { IS_DEBUG_BUILD } from './flags';\nimport { injectReportDialog } from './helpers';\nimport { Breadcrumbs } from './integrations';\n/**\n * The Sentry Browser SDK Client.\n *\n * @see BrowserOptions for documentation on configuration options.\n * @see SentryClient for usage documentation.\n */\n\nvar BrowserClient = function (_super) {\n __extends(BrowserClient, _super);\n /**\n * Creates a new Browser SDK instance.\n *\n * @param options Configuration options for this SDK.\n */\n\n\n function BrowserClient(options) {\n if (options === void 0) {\n options = {};\n }\n\n var _this = this;\n\n options._metadata = options._metadata || {};\n options._metadata.sdk = options._metadata.sdk || {\n name: 'sentry.javascript.browser',\n packages: [{\n name: 'npm:@sentry/browser',\n version: SDK_VERSION\n }],\n version: SDK_VERSION\n };\n _this = _super.call(this, BrowserBackend, options) || this;\n return _this;\n }\n /**\n * Show a report dialog to the user to send feedback to a specific event.\n *\n * @param options Set individual options for the dialog\n */\n\n\n BrowserClient.prototype.showReportDialog = function (options) {\n if (options === void 0) {\n options = {};\n } // doesn't work without a document (React Native)\n\n\n var document = getGlobalObject().document;\n\n if (!document) {\n return;\n }\n\n if (!this._isEnabled()) {\n IS_DEBUG_BUILD && logger.error('Trying to call showReportDialog with Sentry Client disabled');\n return;\n }\n\n injectReportDialog(__assign(__assign({}, options), {\n dsn: options.dsn || this.getDsn()\n }));\n };\n /**\n * @inheritDoc\n */\n\n\n BrowserClient.prototype._prepareEvent = function (event, scope, hint) {\n event.platform = event.platform || 'javascript';\n return _super.prototype._prepareEvent.call(this, event, scope, hint);\n };\n /**\n * @inheritDoc\n */\n\n\n BrowserClient.prototype._sendEvent = function (event) {\n var integration = this.getIntegration(Breadcrumbs);\n\n if (integration) {\n integration.addSentryBreadcrumb(event);\n }\n\n _super.prototype._sendEvent.call(this, event);\n };\n\n return BrowserClient;\n}(BaseClient);\n\nexport { BrowserClient };","import { __assign } from \"tslib\";\nimport { getCurrentHub, initAndBind, Integrations as CoreIntegrations } from '@sentry/core';\nimport { addInstrumentationHandler, getGlobalObject, logger, resolvedSyncPromise } from '@sentry/utils';\nimport { BrowserClient } from './client';\nimport { IS_DEBUG_BUILD } from './flags';\nimport { wrap as internalWrap } from './helpers';\nimport { Breadcrumbs, Dedupe, GlobalHandlers, LinkedErrors, TryCatch, UserAgent } from './integrations';\nexport var defaultIntegrations = [new CoreIntegrations.InboundFilters(), new CoreIntegrations.FunctionToString(), new TryCatch(), new Breadcrumbs(), new GlobalHandlers(), new LinkedErrors(), new Dedupe(), new UserAgent()];\n/**\n * The Sentry Browser SDK Client.\n *\n * To use this SDK, call the {@link init} function as early as possible when\n * loading the web page. To set context information or send manual events, use\n * the provided methods.\n *\n * @example\n *\n * ```\n *\n * import { init } from '@sentry/browser';\n *\n * init({\n * dsn: '__DSN__',\n * // ...\n * });\n * ```\n *\n * @example\n * ```\n *\n * import { configureScope } from '@sentry/browser';\n * configureScope((scope: Scope) => {\n * scope.setExtra({ battery: 0.7 });\n * scope.setTag({ user_mode: 'admin' });\n * scope.setUser({ id: '4711' });\n * });\n * ```\n *\n * @example\n * ```\n *\n * import { addBreadcrumb } from '@sentry/browser';\n * addBreadcrumb({\n * message: 'My Breadcrumb',\n * // ...\n * });\n * ```\n *\n * @example\n *\n * ```\n *\n * import * as Sentry from '@sentry/browser';\n * Sentry.captureMessage('Hello, world!');\n * Sentry.captureException(new Error('Good bye'));\n * Sentry.captureEvent({\n * message: 'Manual',\n * stacktrace: [\n * // ...\n * ],\n * });\n * ```\n *\n * @see {@link BrowserOptions} for documentation on configuration options.\n */\n\nexport function init(options) {\n if (options === void 0) {\n options = {};\n }\n\n if (options.defaultIntegrations === undefined) {\n options.defaultIntegrations = defaultIntegrations;\n }\n\n if (options.release === undefined) {\n var window_1 = getGlobalObject(); // This supports the variable that sentry-webpack-plugin injects\n\n if (window_1.SENTRY_RELEASE && window_1.SENTRY_RELEASE.id) {\n options.release = window_1.SENTRY_RELEASE.id;\n }\n }\n\n if (options.autoSessionTracking === undefined) {\n options.autoSessionTracking = true;\n }\n\n if (options.sendClientReports === undefined) {\n options.sendClientReports = true;\n }\n\n initAndBind(BrowserClient, options);\n\n if (options.autoSessionTracking) {\n startSessionTracking();\n }\n}\n/**\n * Present the user with a report dialog.\n *\n * @param options Everything is optional, we try to fetch all info need from the global scope.\n */\n\nexport function showReportDialog(options) {\n if (options === void 0) {\n options = {};\n }\n\n var hub = getCurrentHub();\n var scope = hub.getScope();\n\n if (scope) {\n options.user = __assign(__assign({}, scope.getUser()), options.user);\n }\n\n if (!options.eventId) {\n options.eventId = hub.lastEventId();\n }\n\n var client = hub.getClient();\n\n if (client) {\n client.showReportDialog(options);\n }\n}\n/**\n * This is the getter for lastEventId.\n *\n * @returns The last event id of a captured event.\n */\n\nexport function lastEventId() {\n return getCurrentHub().lastEventId();\n}\n/**\n * This function is here to be API compatible with the loader.\n * @hidden\n */\n\nexport function forceLoad() {// Noop\n}\n/**\n * This function is here to be API compatible with the loader.\n * @hidden\n */\n\nexport function onLoad(callback) {\n callback();\n}\n/**\n * Call `flush()` on the current client, if there is one. See {@link Client.flush}.\n *\n * @param timeout Maximum time in ms the client should wait to flush its event queue. Omitting this parameter will cause\n * the client to wait until all events are sent before resolving the promise.\n * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it\n * doesn't (or if there's no client defined).\n */\n\nexport function flush(timeout) {\n var client = getCurrentHub().getClient();\n\n if (client) {\n return client.flush(timeout);\n }\n\n IS_DEBUG_BUILD && logger.warn('Cannot flush events. No client defined.');\n return resolvedSyncPromise(false);\n}\n/**\n * Call `close()` on the current client, if there is one. See {@link Client.close}.\n *\n * @param timeout Maximum time in ms the client should wait to flush its event queue before shutting down. Omitting this\n * parameter will cause the client to wait until all events are sent before disabling itself.\n * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it\n * doesn't (or if there's no client defined).\n */\n\nexport function close(timeout) {\n var client = getCurrentHub().getClient();\n\n if (client) {\n return client.close(timeout);\n }\n\n IS_DEBUG_BUILD && logger.warn('Cannot flush events and disable SDK. No client defined.');\n return resolvedSyncPromise(false);\n}\n/**\n * Wrap code within a try/catch block so the SDK is able to capture errors.\n *\n * @param fn A function to wrap.\n *\n * @returns The result of wrapped function call.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\nexport function wrap(fn) {\n return internalWrap(fn)();\n}\n\nfunction startSessionOnHub(hub) {\n hub.startSession({\n ignoreDuration: true\n });\n hub.captureSession();\n}\n/**\n * Enable automatic Session Tracking for the initial page load.\n */\n\n\nfunction startSessionTracking() {\n var window = getGlobalObject();\n var document = window.document;\n\n if (typeof document === 'undefined') {\n IS_DEBUG_BUILD && logger.warn('Session tracking in non-browser environment with @sentry/browser is not supported.');\n return;\n }\n\n var hub = getCurrentHub(); // The only way for this to be false is for there to be a version mismatch between @sentry/browser (>= 6.0.0) and\n // @sentry/hub (< 5.27.0). In the simple case, there won't ever be such a mismatch, because the two packages are\n // pinned at the same version in package.json, but there are edge cases where it's possible. See\n // https://github.com/getsentry/sentry-javascript/issues/3207 and\n // https://github.com/getsentry/sentry-javascript/issues/3234 and\n // https://github.com/getsentry/sentry-javascript/issues/3278.\n\n if (!hub.captureSession) {\n return;\n } // The session duration for browser sessions does not track a meaningful\n // concept that can be used as a metric.\n // Automatically captured sessions are akin to page views, and thus we\n // discard their duration.\n\n\n startSessionOnHub(hub); // We want to create a session for every navigation as well\n\n addInstrumentationHandler('history', function (_a) {\n var from = _a.from,\n to = _a.to; // Don't create an additional session for the initial route or if the location did not change\n\n if (!(from === undefined || from === to)) {\n startSessionOnHub(getCurrentHub());\n }\n });\n}","import { getCurrentHub } from '@sentry/hub';\nimport { logger } from '@sentry/utils';\nimport { IS_DEBUG_BUILD } from './flags';\n/**\n * Internal function to create a new SDK client instance. The client is\n * installed and then bound to the current scope.\n *\n * @param clientClass The client class to instantiate.\n * @param options Options to pass to the client.\n */\n\nexport function initAndBind(clientClass, options) {\n if (options.debug === true) {\n if (IS_DEBUG_BUILD) {\n logger.enable();\n } else {\n // use `console.warn` rather than `logger.warn` since by non-debug bundles have all `logger.x` statements stripped\n // eslint-disable-next-line no-console\n console.warn('[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.');\n }\n }\n\n var hub = getCurrentHub();\n var scope = hub.getScope();\n\n if (scope) {\n scope.update(options.initialScope);\n }\n\n var client = new clientClass(options);\n hub.bindClient(client);\n}","// TODO: Remove in the next major release and rely only on @sentry/core SDK_VERSION and SdkInfo metadata\nexport var SDK_NAME = 'sentry.javascript.browser';","import { __assign } from \"tslib\";\nexport * from './exports';\nimport { Integrations as CoreIntegrations } from '@sentry/core';\nimport { getGlobalObject } from '@sentry/utils';\nimport * as BrowserIntegrations from './integrations';\nimport * as Transports from './transports';\nvar windowIntegrations = {}; // This block is needed to add compatibility with the integrations packages when used with a CDN\n\nvar _window = getGlobalObject();\n\nif (_window.Sentry && _window.Sentry.Integrations) {\n windowIntegrations = _window.Sentry.Integrations;\n}\n\nvar INTEGRATIONS = __assign(__assign(__assign({}, windowIntegrations), CoreIntegrations), BrowserIntegrations);\n\nexport { INTEGRATIONS as Integrations, Transports };","/**\n * NOTE: In order to avoid circular dependencies, if you add a function to this module and it needs to print something,\n * you must either a) use `console.log` rather than the logger, or b) put your function elsewhere.\n */\nimport { isNodeEnv } from './node';\nvar fallbackGlobalObject = {};\n/**\n * Safely get global scope object\n *\n * @returns Global scope object\n */\n\nexport function getGlobalObject() {\n return isNodeEnv() ? global : typeof window !== 'undefined' // eslint-disable-line no-restricted-globals\n ? window // eslint-disable-line no-restricted-globals\n : typeof self !== 'undefined' ? self : fallbackGlobalObject;\n}\n/**\n * Returns a global singleton contained in the global `__SENTRY__` object.\n *\n * If the singleton doesn't already exist in `__SENTRY__`, it will be created using the given factory\n * function and added to the `__SENTRY__` object.\n *\n * @param name name of the global singleton on __SENTRY__\n * @param creator creator Factory function to create the singleton if it doesn't already exist on `__SENTRY__`\n * @param obj (Optional) The global object on which to look for `__SENTRY__`, if not `getGlobalObject`'s return value\n * @returns the singleton\n */\n\nexport function getGlobalSingleton(name, creator, obj) {\n var global = obj || getGlobalObject();\n\n var __SENTRY__ = global.__SENTRY__ = global.__SENTRY__ || {};\n\n var singleton = __SENTRY__[name] || (__SENTRY__[name] = creator());\n return singleton;\n}","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport { __assign, __values } from \"tslib\";\nimport { htmlTreeAsString } from './browser';\nimport { isElement, isError, isEvent, isInstanceOf, isPlainObject, isPrimitive } from './is';\nimport { truncate } from './string';\n/**\n * Replace a method in an object with a wrapped version of itself.\n *\n * @param source An object that contains a method to be wrapped.\n * @param name The name of the method to be wrapped.\n * @param replacementFactory A higher-order function that takes the original version of the given method and returns a\n * wrapped version. Note: The function returned by `replacementFactory` needs to be a non-arrow function, in order to\n * preserve the correct value of `this`, and the original method must be called using `origMethod.call(this, )` or `origMethod.apply(this, [])` (rather than being called directly), again to preserve `this`.\n * @returns void\n */\n\nexport function fill(source, name, replacementFactory) {\n if (!(name in source)) {\n return;\n }\n\n var original = source[name];\n var wrapped = replacementFactory(original); // Make sure it's a function first, as we need to attach an empty prototype for `defineProperties` to work\n // otherwise it'll throw \"TypeError: Object.defineProperties called on non-object\"\n\n if (typeof wrapped === 'function') {\n try {\n markFunctionWrapped(wrapped, original);\n } catch (_Oo) {// This can throw if multiple fill happens on a global object like XMLHttpRequest\n // Fixes https://github.com/getsentry/sentry-javascript/issues/2043\n }\n }\n\n source[name] = wrapped;\n}\n/**\n * Defines a non-enumerable property on the given object.\n *\n * @param obj The object on which to set the property\n * @param name The name of the property to be set\n * @param value The value to which to set the property\n */\n\nexport function addNonEnumerableProperty(obj, name, value) {\n Object.defineProperty(obj, name, {\n // enumerable: false, // the default, so we can save on bundle size by not explicitly setting it\n value: value,\n writable: true,\n configurable: true\n });\n}\n/**\n * Remembers the original function on the wrapped function and\n * patches up the prototype.\n *\n * @param wrapped the wrapper function\n * @param original the original function that gets wrapped\n */\n\nexport function markFunctionWrapped(wrapped, original) {\n var proto = original.prototype || {};\n wrapped.prototype = original.prototype = proto;\n addNonEnumerableProperty(wrapped, '__sentry_original__', original);\n}\n/**\n * This extracts the original function if available. See\n * `markFunctionWrapped` for more information.\n *\n * @param func the function to unwrap\n * @returns the unwrapped version of the function if available.\n */\n\nexport function getOriginalFunction(func) {\n return func.__sentry_original__;\n}\n/**\n * Encodes given object into url-friendly format\n *\n * @param object An object that contains serializable values\n * @returns string Encoded\n */\n\nexport function urlEncode(object) {\n return Object.keys(object).map(function (key) {\n return encodeURIComponent(key) + \"=\" + encodeURIComponent(object[key]);\n }).join('&');\n}\n/**\n * Transforms any object into an object literal with all its attributes\n * attached to it.\n *\n * @param value Initial source that we have to transform in order for it to be usable by the serializer\n */\n\nexport function convertToPlainObject(value) {\n var newObj = value;\n\n if (isError(value)) {\n newObj = __assign({\n message: value.message,\n name: value.name,\n stack: value.stack\n }, getOwnProperties(value));\n } else if (isEvent(value)) {\n var event_1 = value;\n newObj = __assign({\n type: event_1.type,\n target: serializeEventTarget(event_1.target),\n currentTarget: serializeEventTarget(event_1.currentTarget)\n }, getOwnProperties(event_1));\n\n if (typeof CustomEvent !== 'undefined' && isInstanceOf(value, CustomEvent)) {\n newObj.detail = event_1.detail;\n }\n }\n\n return newObj;\n}\n/** Creates a string representation of the target of an `Event` object */\n\nfunction serializeEventTarget(target) {\n try {\n return isElement(target) ? htmlTreeAsString(target) : Object.prototype.toString.call(target);\n } catch (_oO) {\n return '';\n }\n}\n/** Filters out all but an object's own properties */\n\n\nfunction getOwnProperties(obj) {\n var extractedProps = {};\n\n for (var property in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, property)) {\n extractedProps[property] = obj[property];\n }\n }\n\n return extractedProps;\n}\n/**\n * Given any captured exception, extract its keys and create a sorted\n * and truncated list that will be used inside the event message.\n * eg. `Non-error exception captured with keys: foo, bar, baz`\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\n\nexport function extractExceptionKeysForMessage(exception, maxLength) {\n if (maxLength === void 0) {\n maxLength = 40;\n }\n\n var keys = Object.keys(convertToPlainObject(exception));\n keys.sort();\n\n if (!keys.length) {\n return '[object has no keys]';\n }\n\n if (keys[0].length >= maxLength) {\n return truncate(keys[0], maxLength);\n }\n\n for (var includedKeys = keys.length; includedKeys > 0; includedKeys--) {\n var serialized = keys.slice(0, includedKeys).join(', ');\n\n if (serialized.length > maxLength) {\n continue;\n }\n\n if (includedKeys === keys.length) {\n return serialized;\n }\n\n return truncate(serialized, maxLength);\n }\n\n return '';\n}\n/**\n * Given any object, return the new object with removed keys that value was `undefined`.\n * Works recursively on objects and arrays.\n */\n\nexport function dropUndefinedKeys(val) {\n var e_1, _a;\n\n if (isPlainObject(val)) {\n var rv = {};\n\n try {\n for (var _b = __values(Object.keys(val)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var key = _c.value;\n\n if (typeof val[key] !== 'undefined') {\n rv[key] = dropUndefinedKeys(val[key]);\n }\n }\n } catch (e_1_1) {\n e_1 = {\n error: e_1_1\n };\n } finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n\n return rv;\n }\n\n if (Array.isArray(val)) {\n return val.map(dropUndefinedKeys);\n }\n\n return val;\n}\n/**\n * Ensure that something is an object.\n *\n * Turns `undefined` and `null` into `String`s and all other primitives into instances of their respective wrapper\n * classes (String, Boolean, Number, etc.). Acts as the identity function on non-primitives.\n *\n * @param wat The subject of the objectification\n * @returns A version of `wat` which can safely be used with `Object` class methods\n */\n\nexport function objectify(wat) {\n var objectified;\n\n switch (true) {\n case wat === undefined || wat === null:\n objectified = new String(wat);\n break;\n // Though symbols and bigints do have wrapper classes (`Symbol` and `BigInt`, respectively), for whatever reason\n // those classes don't have constructors which can be used with the `new` keyword. We therefore need to cast each as\n // an object in order to wrap it.\n\n case _typeof(wat) === 'symbol' || typeof wat === 'bigint':\n objectified = Object(wat);\n break;\n // this will catch the remaining primitives: `String`, `Number`, and `Boolean`\n\n case isPrimitive(wat):\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n objectified = new wat.constructor(wat);\n break;\n // by process of elimination, at this point we know that `wat` must already be an object\n\n default:\n objectified = wat;\n break;\n }\n\n return objectified;\n}","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport { __read } from \"tslib\";\nimport { isError, isEvent, isNaN, isSyntheticEvent } from './is';\nimport { memoBuilder } from './memo';\nimport { convertToPlainObject } from './object';\nimport { getFunctionName } from './stacktrace';\n/**\n * Recursively normalizes the given object.\n *\n * - Creates a copy to prevent original input mutation\n * - Skips non-enumerable properties\n * - When stringifying, calls `toJSON` if implemented\n * - Removes circular references\n * - Translates non-serializable values (`undefined`/`NaN`/functions) to serializable format\n * - Translates known global objects/classes to a string representations\n * - Takes care of `Error` object serialization\n * - Optionally limits depth of final output\n * - Optionally limits number of properties/elements included in any single object/array\n *\n * @param input The object to be normalized.\n * @param depth The max depth to which to normalize the object. (Anything deeper stringified whole.)\n * @param maxProperties The max number of elements or properties to be included in any single array or\n * object in the normallized output..\n * @returns A normalized version of the object, or `\"**non-serializable**\"` if any errors are thrown during normalization.\n */\n\nexport function normalize(input, depth, maxProperties) {\n if (depth === void 0) {\n depth = +Infinity;\n }\n\n if (maxProperties === void 0) {\n maxProperties = +Infinity;\n }\n\n try {\n // since we're at the outermost level, there is no key\n return visit('', input, depth, maxProperties);\n } catch (err) {\n return {\n ERROR: \"**non-serializable** (\" + err + \")\"\n };\n }\n}\n/** JSDoc */\n\nexport function normalizeToSize(object, // Default Node.js REPL depth\ndepth, // 100kB, as 200kB is max payload size, so half sounds reasonable\nmaxSize) {\n if (depth === void 0) {\n depth = 3;\n }\n\n if (maxSize === void 0) {\n maxSize = 100 * 1024;\n }\n\n var normalized = normalize(object, depth);\n\n if (jsonSize(normalized) > maxSize) {\n return normalizeToSize(object, depth - 1, maxSize);\n }\n\n return normalized;\n}\n/**\n * Visits a node to perform normalization on it\n *\n * @param key The key corresponding to the given node\n * @param value The node to be visited\n * @param depth Optional number indicating the maximum recursion depth\n * @param maxProperties Optional maximum number of properties/elements included in any single object/array\n * @param memo Optional Memo class handling decycling\n */\n\nfunction visit(key, value, depth, maxProperties, memo) {\n if (depth === void 0) {\n depth = +Infinity;\n }\n\n if (maxProperties === void 0) {\n maxProperties = +Infinity;\n }\n\n if (memo === void 0) {\n memo = memoBuilder();\n }\n\n var _a = __read(memo, 2),\n memoize = _a[0],\n unmemoize = _a[1]; // If the value has a `toJSON` method, see if we can bail and let it do the work\n\n\n var valueWithToJSON = value;\n\n if (valueWithToJSON && typeof valueWithToJSON.toJSON === 'function') {\n try {\n return valueWithToJSON.toJSON();\n } catch (err) {// pass (The built-in `toJSON` failed, but we can still try to do it ourselves)\n }\n } // Get the simple cases out of the way first\n\n\n if (value === null || ['number', 'boolean', 'string'].includes(_typeof(value)) && !isNaN(value)) {\n return value;\n }\n\n var stringified = stringifyValue(key, value); // Anything we could potentially dig into more (objects or arrays) will have come back as `\"[object XXXX]\"`.\n // Everything else will have already been serialized, so if we don't see that pattern, we're done.\n\n if (!stringified.startsWith('[object ')) {\n return stringified;\n } // We're also done if we've reached the max depth\n\n\n if (depth === 0) {\n // At this point we know `serialized` is a string of the form `\"[object XXXX]\"`. Clean it up so it's just `\"[XXXX]\"`.\n return stringified.replace('object ', '');\n } // If we've already visited this branch, bail out, as it's circular reference. If not, note that we're seeing it now.\n\n\n if (memoize(value)) {\n return '[Circular ~]';\n } // At this point we know we either have an object or an array, we haven't seen it before, and we're going to recurse\n // because we haven't yet reached the max depth. Create an accumulator to hold the results of visiting each\n // property/entry, and keep track of the number of items we add to it.\n\n\n var normalized = Array.isArray(value) ? [] : {};\n var numAdded = 0; // Before we begin, convert`Error` and`Event` instances into plain objects, since some of each of their relevant\n // properties are non-enumerable and otherwise would get missed.\n\n var visitable = isError(value) || isEvent(value) ? convertToPlainObject(value) : value;\n\n for (var visitKey in visitable) {\n // Avoid iterating over fields in the prototype if they've somehow been exposed to enumeration.\n if (!Object.prototype.hasOwnProperty.call(visitable, visitKey)) {\n continue;\n }\n\n if (numAdded >= maxProperties) {\n normalized[visitKey] = '[MaxProperties ~]';\n break;\n } // Recursively visit all the child nodes\n\n\n var visitValue = visitable[visitKey];\n normalized[visitKey] = visit(visitKey, visitValue, depth - 1, maxProperties, memo);\n numAdded += 1;\n } // Once we've visited all the branches, remove the parent from memo storage\n\n\n unmemoize(value); // Return accumulated values\n\n return normalized;\n} // TODO remove this in v7 (this means the method will no longer be exported, under any name)\n\n\nexport { visit as walk };\n/**\n * Stringify the given value. Handles various known special values and types.\n *\n * Not meant to be used on simple primitives which already have a string representation, as it will, for example, turn\n * the number 1231 into \"[Object Number]\", nor on `null`, as it will throw.\n *\n * @param value The value to stringify\n * @returns A stringified representation of the given value\n */\n\nfunction stringifyValue(key, // this type is a tiny bit of a cheat, since this function does handle NaN (which is technically a number), but for\n// our internal use, it'll do\nvalue) {\n try {\n if (key === 'domain' && value && _typeof(value) === 'object' && value._events) {\n return '[Domain]';\n }\n\n if (key === 'domainEmitter') {\n return '[DomainEmitter]';\n } // It's safe to use `global`, `window`, and `document` here in this manner, as we are asserting using `typeof` first\n // which won't throw if they are not present.\n\n\n if (typeof global !== 'undefined' && value === global) {\n return '[Global]';\n } // eslint-disable-next-line no-restricted-globals\n\n\n if (typeof window !== 'undefined' && value === window) {\n return '[Window]';\n } // eslint-disable-next-line no-restricted-globals\n\n\n if (typeof document !== 'undefined' && value === document) {\n return '[Document]';\n } // React's SyntheticEvent thingy\n\n\n if (isSyntheticEvent(value)) {\n return '[SyntheticEvent]';\n }\n\n if (typeof value === 'number' && value !== value) {\n return '[NaN]';\n } // this catches `undefined` (but not `null`, which is a primitive and can be serialized on its own)\n\n\n if (value === void 0) {\n return '[undefined]';\n }\n\n if (typeof value === 'function') {\n return \"[Function: \" + getFunctionName(value) + \"]\";\n }\n\n if (_typeof(value) === 'symbol') {\n return \"[\" + String(value) + \"]\";\n } // stringified BigInts are indistinguishable from regular numbers, so we need to label them to avoid confusion\n\n\n if (typeof value === 'bigint') {\n return \"[BigInt: \" + String(value) + \"]\";\n } // Now that we've knocked out all the special cases and the primitives, all we have left are objects. Simply casting\n // them to strings means that instances of classes which haven't defined their `toStringTag` will just come out as\n // `\"[object Object]\"`. If we instead look at the constructor's name (which is the same as the name of the class),\n // we can make sure that only plain objects come out that way.\n\n\n return \"[object \" + Object.getPrototypeOf(value).constructor.name + \"]\";\n } catch (err) {\n return \"**non-serializable** (\" + err + \")\";\n }\n}\n/** Calculates bytes size of input string */\n\n\nfunction utf8Length(value) {\n // eslint-disable-next-line no-bitwise\n return ~-encodeURI(value).split(/%..|./).length;\n}\n/** Calculates bytes size of input object */\n\n\nfunction jsonSize(value) {\n return utf8Length(JSON.stringify(value));\n}","import { isRegExp, isString } from './is';\n/**\n * Truncates given string to the maximum characters count\n *\n * @param str An object that contains serializable values\n * @param max Maximum number of characters in truncated string (0 = unlimited)\n * @returns string Encoded\n */\n\nexport function truncate(str, max) {\n if (max === void 0) {\n max = 0;\n }\n\n if (typeof str !== 'string' || max === 0) {\n return str;\n }\n\n return str.length <= max ? str : str.substr(0, max) + \"...\";\n}\n/**\n * This is basically just `trim_line` from\n * https://github.com/getsentry/sentry/blob/master/src/sentry/lang/javascript/processor.py#L67\n *\n * @param str An object that contains serializable values\n * @param max Maximum number of characters in truncated string\n * @returns string Encoded\n */\n\nexport function snipLine(line, colno) {\n var newLine = line;\n var lineLength = newLine.length;\n\n if (lineLength <= 150) {\n return newLine;\n }\n\n if (colno > lineLength) {\n // eslint-disable-next-line no-param-reassign\n colno = lineLength;\n }\n\n var start = Math.max(colno - 60, 0);\n\n if (start < 5) {\n start = 0;\n }\n\n var end = Math.min(start + 140, lineLength);\n\n if (end > lineLength - 5) {\n end = lineLength;\n }\n\n if (end === lineLength) {\n start = Math.max(end - 140, 0);\n }\n\n newLine = newLine.slice(start, end);\n\n if (start > 0) {\n newLine = \"'{snip} \" + newLine;\n }\n\n if (end < lineLength) {\n newLine += ' {snip}';\n }\n\n return newLine;\n}\n/**\n * Join values in array\n * @param input array of values to be joined together\n * @param delimiter string to be placed in-between values\n * @returns Joined values\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\nexport function safeJoin(input, delimiter) {\n if (!Array.isArray(input)) {\n return '';\n }\n\n var output = []; // eslint-disable-next-line @typescript-eslint/prefer-for-of\n\n for (var i = 0; i < input.length; i++) {\n var value = input[i];\n\n try {\n output.push(String(value));\n } catch (e) {\n output.push('[value cannot be serialized]');\n }\n }\n\n return output.join(delimiter);\n}\n/**\n * Checks if the value matches a regex or includes the string\n * @param value The string value to be checked against\n * @param pattern Either a regex or a string that must be contained in value\n */\n\nexport function isMatchingPattern(value, pattern) {\n if (!isString(value)) {\n return false;\n }\n\n if (isRegExp(pattern)) {\n return pattern.test(value);\n }\n\n if (typeof pattern === 'string') {\n return value.indexOf(pattern) !== -1;\n }\n\n return false;\n}\n/**\n * Given a string, escape characters which have meaning in the regex grammar, such that the result is safe to feed to\n * `new RegExp()`.\n *\n * Based on https://github.com/sindresorhus/escape-string-regexp. Vendored to a) reduce the size by skipping the runtime\n * type-checking, and b) ensure it gets down-compiled for old versions of Node (the published package only supports Node\n * 12+).\n *\n * @param regexString The string to escape\n * @returns An version of the string with all special regex characters escaped\n */\n\nexport function escapeStringForRegex(regexString) {\n // escape the hyphen separately so we can also replace it with a unicode literal hyphen, to avoid the problems\n // discussed in https://github.com/sindresorhus/escape-string-regexp/issues/20.\n return regexString.replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&').replace(/-/g, '\\\\x2d');\n}","var _global = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\n_global.SENTRY_RELEASE = {\n id: \"2.45.0\"\n};\n_global.SENTRY_RELEASES = _global.SENTRY_RELEASES || {};\n_global.SENTRY_RELEASES[\"the-far-side@andrews-mcmeel-universal\"] = {\n id: \"2.45.0\"\n};","/**\n * NOTE: In order to avoid circular dependencies, if you add a function to this module and it needs to print something,\n * you must either a) use `console.log` rather than the logger, or b) put your function elsewhere.\n */\nimport { isBrowserBundle } from './env';\n/**\n * Checks whether we're in the Node.js or Browser environment\n *\n * @returns Answer to given question\n */\n\nexport function isNodeEnv() {\n // explicitly check for browser bundles as those can be optimized statically\n // by terser/rollup.\n return !isBrowserBundle() && Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]';\n}\n/**\n * Requires a module which is protected against bundler minification.\n *\n * @param request The module path to resolve\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any\n\nexport function dynamicRequire(mod, request) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return mod.require(request);\n}\n/**\n * Helper for dynamically loading module that should work with linked dependencies.\n * The problem is that we _should_ be using `require(require.resolve(moduleName, { paths: [cwd()] }))`\n * However it's _not possible_ to do that with Webpack, as it has to know all the dependencies during\n * build time. `require.resolve` is also not available in any other way, so we cannot create,\n * a fake helper like we do with `dynamicRequire`.\n *\n * We always prefer to use local package, thus the value is not returned early from each `try/catch` block.\n * That is to mimic the behavior of `require.resolve` exactly.\n *\n * @param moduleName module name to require\n * @returns possibly required module\n */\n\nexport function loadModule(moduleName) {\n var mod;\n\n try {\n mod = dynamicRequire(module, moduleName);\n } catch (e) {// no-empty\n }\n\n try {\n var cwd = dynamicRequire(module, 'process').cwd;\n mod = dynamicRequire(module, cwd() + \"/node_modules/\" + moduleName);\n } catch (e) {// no-empty\n }\n\n return mod;\n}","import { __assign, __values } from \"tslib\";\nvar STACKTRACE_LIMIT = 50;\n/**\n * Creates a stack parser with the supplied line parsers\n *\n * StackFrames are returned in the correct order for Sentry Exception\n * frames and with Sentry SDK internal frames removed from the top and bottom\n *\n */\n\nexport function createStackParser() {\n var parsers = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n parsers[_i] = arguments[_i];\n }\n\n var sortedParsers = parsers.sort(function (a, b) {\n return a[0] - b[0];\n }).map(function (p) {\n return p[1];\n });\n return function (stack, skipFirst) {\n var e_1, _a, e_2, _b;\n\n if (skipFirst === void 0) {\n skipFirst = 0;\n }\n\n var frames = [];\n\n try {\n for (var _c = __values(stack.split('\\n').slice(skipFirst)), _d = _c.next(); !_d.done; _d = _c.next()) {\n var line = _d.value;\n\n try {\n for (var sortedParsers_1 = (e_2 = void 0, __values(sortedParsers)), sortedParsers_1_1 = sortedParsers_1.next(); !sortedParsers_1_1.done; sortedParsers_1_1 = sortedParsers_1.next()) {\n var parser = sortedParsers_1_1.value;\n var frame = parser(line);\n\n if (frame) {\n frames.push(frame);\n break;\n }\n }\n } catch (e_2_1) {\n e_2 = {\n error: e_2_1\n };\n } finally {\n try {\n if (sortedParsers_1_1 && !sortedParsers_1_1.done && (_b = sortedParsers_1.return)) _b.call(sortedParsers_1);\n } finally {\n if (e_2) throw e_2.error;\n }\n }\n }\n } catch (e_1_1) {\n e_1 = {\n error: e_1_1\n };\n } finally {\n try {\n if (_d && !_d.done && (_a = _c.return)) _a.call(_c);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n\n return stripSentryFramesAndReverse(frames);\n };\n}\n/**\n * @hidden\n */\n\nexport function stripSentryFramesAndReverse(stack) {\n if (!stack.length) {\n return [];\n }\n\n var localStack = stack;\n var firstFrameFunction = localStack[0].function || '';\n var lastFrameFunction = localStack[localStack.length - 1].function || ''; // If stack starts with one of our API calls, remove it (starts, meaning it's the top of the stack - aka last call)\n\n if (firstFrameFunction.indexOf('captureMessage') !== -1 || firstFrameFunction.indexOf('captureException') !== -1) {\n localStack = localStack.slice(1);\n } // If stack ends with one of our internal API calls, remove it (ends, meaning it's the bottom of the stack - aka top-most call)\n\n\n if (lastFrameFunction.indexOf('sentryWrapped') !== -1) {\n localStack = localStack.slice(0, -1);\n } // The frame where the crash happened, should be the last entry in the array\n\n\n return localStack.slice(0, STACKTRACE_LIMIT).map(function (frame) {\n return __assign(__assign({}, frame), {\n filename: frame.filename || localStack[0].filename,\n function: frame.function || '?'\n });\n }).reverse();\n}\nvar defaultFunctionName = '';\n/**\n * Safely extract function name from itself\n */\n\nexport function getFunctionName(fn) {\n try {\n if (!fn || typeof fn !== 'function') {\n return defaultFunctionName;\n }\n\n return fn.name || defaultFunctionName;\n } catch (e) {\n // Just accessing custom props in some Selenium environments\n // can cause a \"Permission denied\" exception (see raven-js#495).\n return defaultFunctionName;\n }\n}","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\n/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n// eslint-disable-next-line @typescript-eslint/unbound-method\nvar objectToString = Object.prototype.toString;\n/**\n * Checks whether given value's type is one of a few Error or Error-like\n * {@link isError}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\n\nexport function isError(wat) {\n switch (objectToString.call(wat)) {\n case '[object Error]':\n case '[object Exception]':\n case '[object DOMException]':\n return true;\n\n default:\n return isInstanceOf(wat, Error);\n }\n}\n\nfunction isBuiltin(wat, ty) {\n return objectToString.call(wat) === \"[object \" + ty + \"]\";\n}\n/**\n * Checks whether given value's type is ErrorEvent\n * {@link isErrorEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\n\n\nexport function isErrorEvent(wat) {\n return isBuiltin(wat, 'ErrorEvent');\n}\n/**\n * Checks whether given value's type is DOMError\n * {@link isDOMError}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\n\nexport function isDOMError(wat) {\n return isBuiltin(wat, 'DOMError');\n}\n/**\n * Checks whether given value's type is DOMException\n * {@link isDOMException}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\n\nexport function isDOMException(wat) {\n return isBuiltin(wat, 'DOMException');\n}\n/**\n * Checks whether given value's type is a string\n * {@link isString}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\n\nexport function isString(wat) {\n return isBuiltin(wat, 'String');\n}\n/**\n * Checks whether given value is a primitive (undefined, null, number, boolean, string, bigint, symbol)\n * {@link isPrimitive}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\n\nexport function isPrimitive(wat) {\n return wat === null || _typeof(wat) !== 'object' && typeof wat !== 'function';\n}\n/**\n * Checks whether given value's type is an object literal\n * {@link isPlainObject}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\n\nexport function isPlainObject(wat) {\n return isBuiltin(wat, 'Object');\n}\n/**\n * Checks whether given value's type is an Event instance\n * {@link isEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\n\nexport function isEvent(wat) {\n return typeof Event !== 'undefined' && isInstanceOf(wat, Event);\n}\n/**\n * Checks whether given value's type is an Element instance\n * {@link isElement}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\n\nexport function isElement(wat) {\n return typeof Element !== 'undefined' && isInstanceOf(wat, Element);\n}\n/**\n * Checks whether given value's type is an regexp\n * {@link isRegExp}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\n\nexport function isRegExp(wat) {\n return isBuiltin(wat, 'RegExp');\n}\n/**\n * Checks whether given value has a then function.\n * @param wat A value to be checked.\n */\n\nexport function isThenable(wat) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return Boolean(wat && wat.then && typeof wat.then === 'function');\n}\n/**\n * Checks whether given value's type is a SyntheticEvent\n * {@link isSyntheticEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\n\nexport function isSyntheticEvent(wat) {\n return isPlainObject(wat) && 'nativeEvent' in wat && 'preventDefault' in wat && 'stopPropagation' in wat;\n}\n/**\n * Checks whether given value is NaN\n * {@link isNaN}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\n\nexport function isNaN(wat) {\n return typeof wat === 'number' && wat !== wat;\n}\n/**\n * Checks whether given value's type is an instance of provided constructor.\n * {@link isInstanceOf}.\n *\n * @param wat A value to be checked.\n * @param base A constructor to be used in a check.\n * @returns A boolean representing the result.\n */\n\nexport function isInstanceOf(wat, base) {\n try {\n return wat instanceof base;\n } catch (_e) {\n return false;\n }\n}","import { getGlobalObject } from './global';\nimport { isString } from './is';\n/**\n * Given a child DOM element, returns a query-selector statement describing that\n * and its ancestors\n * e.g. [HTMLElement] => body > div > input#foo.btn[name=baz]\n * @returns generated DOM path\n */\n\nexport function htmlTreeAsString(elem, keyAttrs) {\n // try/catch both:\n // - accessing event.target (see getsentry/raven-js#838, #768)\n // - `htmlTreeAsString` because it's complex, and just accessing the DOM incorrectly\n // - can throw an exception in some circumstances.\n try {\n var currentElem = elem;\n var MAX_TRAVERSE_HEIGHT = 5;\n var MAX_OUTPUT_LEN = 80;\n var out = [];\n var height = 0;\n var len = 0;\n var separator = ' > ';\n var sepLength = separator.length;\n var nextStr = void 0; // eslint-disable-next-line no-plusplus\n\n while (currentElem && height++ < MAX_TRAVERSE_HEIGHT) {\n nextStr = _htmlElementAsString(currentElem, keyAttrs); // bail out if\n // - nextStr is the 'html' element\n // - the length of the string that would be created exceeds MAX_OUTPUT_LEN\n // (ignore this limit if we are on the first iteration)\n\n if (nextStr === 'html' || height > 1 && len + out.length * sepLength + nextStr.length >= MAX_OUTPUT_LEN) {\n break;\n }\n\n out.push(nextStr);\n len += nextStr.length;\n currentElem = currentElem.parentNode;\n }\n\n return out.reverse().join(separator);\n } catch (_oO) {\n return '';\n }\n}\n/**\n * Returns a simple, query-selector representation of a DOM element\n * e.g. [HTMLElement] => input#foo.btn[name=baz]\n * @returns generated DOM path\n */\n\nfunction _htmlElementAsString(el, keyAttrs) {\n var elem = el;\n var out = [];\n var className;\n var classes;\n var key;\n var attr;\n var i;\n\n if (!elem || !elem.tagName) {\n return '';\n }\n\n out.push(elem.tagName.toLowerCase()); // Pairs of attribute keys defined in `serializeAttribute` and their values on element.\n\n var keyAttrPairs = keyAttrs && keyAttrs.length ? keyAttrs.filter(function (keyAttr) {\n return elem.getAttribute(keyAttr);\n }).map(function (keyAttr) {\n return [keyAttr, elem.getAttribute(keyAttr)];\n }) : null;\n\n if (keyAttrPairs && keyAttrPairs.length) {\n keyAttrPairs.forEach(function (keyAttrPair) {\n out.push(\"[\" + keyAttrPair[0] + \"=\\\"\" + keyAttrPair[1] + \"\\\"]\");\n });\n } else {\n if (elem.id) {\n out.push(\"#\" + elem.id);\n } // eslint-disable-next-line prefer-const\n\n\n className = elem.className;\n\n if (className && isString(className)) {\n classes = className.split(/\\s+/);\n\n for (i = 0; i < classes.length; i++) {\n out.push(\".\" + classes[i]);\n }\n }\n }\n\n var allowedAttrs = ['type', 'name', 'title', 'alt'];\n\n for (i = 0; i < allowedAttrs.length; i++) {\n key = allowedAttrs[i];\n attr = elem.getAttribute(key);\n\n if (attr) {\n out.push(\"[\" + key + \"=\\\"\" + attr + \"\\\"]\");\n }\n }\n\n return out.join('');\n}\n/**\n * A safe form of location.href\n */\n\n\nexport function getLocationHref() {\n var global = getGlobalObject();\n\n try {\n return global.document.location.href;\n } catch (oO) {\n return '';\n }\n}","/*\n * This module exists for optimizations in the build process through rollup and terser. We define some global\n * constants, which can be overridden during build. By guarding certain pieces of code with functions that return these\n * constants, we can control whether or not they appear in the final bundle. (Any code guarded by a false condition will\n * never run, and will hence be dropped during treeshaking.) The two primary uses for this are stripping out calls to\n * `logger` and preventing node-related code from appearing in browser bundles.\n *\n * Attention:\n * This file should not be used to define constants/flags that are intended to be used for tree-shaking conducted by\n * users. These fags should live in their respective packages, as we identified user tooling (specifically webpack)\n * having issues tree-shaking these constants across package boundaries.\n * An example for this is the __SENTRY_DEBUG__ constant. It is declared in each package individually because we want\n * users to be able to shake away expressions that it guards.\n */\n\n/**\n * Figures out if we're building a browser bundle.\n *\n * @returns true if this is a browser bundle build.\n */\nexport function isBrowserBundle() {\n return typeof __SENTRY_BROWSER_BUNDLE__ !== 'undefined' && !!__SENTRY_BROWSER_BUNDLE__;\n}"],"sourceRoot":""}