{"version":3,"sources":["jsdelivr-header.js","/npm/newrelic-react-native-agent@1.7.1/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,OCDS,aAAgB,sBAErB,oCACA,wCACG,8CACA,wBAAyB,uCACvB,QAAW,+BACb,UAAW,8BACX,4BAA6B,gDAC7B,YAAa,sBAMpB,MAAM,SACJ,WAAA,GACE,KAAK,aAAe,GACpB,KAAK,MAAQ,CACX,oBAAoB,EACpB,wBAAwB,EACxB,oBAAoB,EACpB,eAAe,GAEjB,KAAK,WAAa,GAClB,KAAK,IAAM,IACX,KAAK,wBAA0B,IAAI,wBACnC,KAAK,aAAe,QACpB,KAAK,mBAAqB,CACtB,uBAAuB,EACvB,6BAA6B,EAC7B,uBAAuB,EACvB,2BAA2B,EAC3B,uBAAuB,EACvB,4BAA4B,EAC5B,gCAAgC,EAChC,gBAAgB,EAChB,SAAU,KAAK,SAAS,KACxB,wBAAwB,EACxB,iBAAkB,GAClB,sBAAuB,GACvB,gBAAgB,EAChB,uBAAuB,EACvB,4BAA4B,EAC5B,uBAAuB,EACvB,2BAA2B,EAEjC,CAEE,SAAW,CAEP,MAAO,QACP,KAAM,OACN,KAAM,OACN,QAAS,UACT,MAAO,QACP,MAAO,SAGX,eAAiB,CACb,QAAS,UACT,OAAQ,SACR,SAAU,WACV,oBAAqB,sBACrB,gBAAiB,kBACjB,kBAAmB,oBACnB,uBAAwB,0BAG5B,WAAa,CACT,QAAS,UACT,MAAO,QACP,QAAS,UACT,iBAAkB,mBAClB,WAAY,cAOhB,eAAiB,IAAM,wBAAwB,eAY/C,wBAA0B,CAAC,EAAW,EAAU,KAE5C,IACI,EAAS,CACT,WAFoB,KAAK,oBAAoB,IAKjD,KAAK,iBAAiB,aAAc,EAAO,EAQ/C,oBAAuB,IACnB,IAAK,EACD,OAAO,KAEX,MAAM,EAAQ,EAAa,OAAO,EAAa,OAC/C,OAAI,EAAM,OACC,KAAK,oBAAoB,GAE7B,EAAM,SAAS,EAO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EAAW,MAAM,QAAS,UAC9B,EACA,QAAQ,KAAO,WACX,EAAK,YAAY,OAAQ,WACzB,EAAY,MAAM,QAAS,UAC/B,EACA,QAAQ,MAAQ,WACZ,EAAK,YAAY,QAAS,WAC1B,EAAa,MAAM,QAAS,UAChC,EAEA,QAAQ,MAAQ,WACZ,EAAK,YAAY,QAAS,WAC1B,EAAa,MAAM,QAAS,UAChC,EAGA,KAAK,MAAM,oBAAqB,CACpC,CACJ,CAOA,WAAA,CAAY,EAAM,GACd,MAAM,EAAU,KAAK,UAAU,EAAM,uBAExB,UAAT,EACA,KAAK,SAAS,mBAAqB,GACnB,SAAT,EACP,KAAK,QAAQ,kBAAoB,GACjB,UAAT,EACP,KAAK,SAAS,mBAAqB,GAEnC,KAAK,QAAQ,iBAAmB,EAGxC,EAKJ,MAAM,SAAW,IAAI,wBACN,gBAIN,aAAc,mBAAsB","file":"/npm/newrelic-react-native-agent@1.7.1/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/newrelic-react-native-agent@1.7.1/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/*\n * Copyright (c) 2022-present New Relic Corporation. All rights reserved.\n * SPDX-License-Identifier: Apache-2.0 \n */\n\nimport { Platform } from 'react-native';\nimport {\n    getUnhandledPromiseRejectionTracker,\n    setUnhandledPromiseRejectionTracker,\n} from 'react-native-promise-rejection-utils';\nimport getCircularReplacer from './new-relic/circular-replacer';\nimport { LOG } from './new-relic/nr-logger';\nimport utils from './new-relic/nr-utils';\nimport NRMAModularAgentWrapper from './new-relic/nrma-modular-agent-wrapper';\nimport version from './new-relic/version';\n\n\n/**\n * New Relic\n */\nclass NewRelic {\n  constructor() {\n    this.JSAppVersion = '';\n    this.state = {\n      didAddErrorHandler: false,\n      didAddPromiseRejection: false,\n      didOverrideConsole: false,\n      isFirstScreen: true\n    };\n    this.lastScreen = '';\n    this.LOG = LOG;\n    this.NRMAModularAgentWrapper = new NRMAModularAgentWrapper();\n    this.agentVersion = version;\n    this.agentConfiguration = {\n        analyticsEventEnabled: true,\n        nativeCrashReportingEnabled: false,\n        crashReportingEnabled: true,\n        interactionTracingEnabled: false,\n        networkRequestEnabled: true,\n        networkErrorRequestEnabled: true,\n        httpResponseBodyCaptureEnabled: true,\n        loggingEnabled: true,\n        logLevel: this.LogLevel.INFO,\n        webViewInstrumentation: true,\n        collectorAddress: \"\",\n        crashCollectorAddress: \"\",\n        fedRampEnabled: false,\n        offlineStorageEnabled: true,\n        backgroundReportingEnabled: false,\n        newEventSystemEnabled: false,\n        distributedTracingEnabled: true,\n    };\n  }\n\n    LogLevel = {\n        // ERROR is least verbose and AUDIT is most verbose\n        ERROR: \"ERROR\",\n        WARN: \"WARN\",\n        INFO: \"INFO\",\n        VERBOSE: \"VERBOSE\",\n        AUDIT: \"AUDIT\",\n        DEBUG: \"DEBUG\"\n    };\n\n    NetworkFailure = {\n        Unknown: 'Unknown',\n        BadURL: 'BadURL',\n        TimedOut: 'TimedOut',\n        CannotConnectToHost: 'CannotConnectToHost',\n        DNSLookupFailed: 'DNSLookupFailed',\n        BadServerResponse: 'BadServerResponse',\n        SecureConnectionFailed: 'SecureConnectionFailed'\n    }\n\n    MetricUnit = {\n        PERCENT: 'PERCENT',\n        BYTES: 'BYTES',\n        SECONDS: 'SECONDS',\n        BYTES_PER_SECOND: 'BYTES_PER_SECOND',\n        OPERATIONS: 'OPERATIONS'\n    }\n\n    /**\n     * True if native agent is started. False if native agent is not started.\n     * @returns {boolean}\n     */\n    isAgentStarted = () => NRMAModularAgentWrapper.isAgentStarted;\n\n    /**\n     * Navigation Route Listener\n     */\n    /**\n     * Subscribe onNavigationStateChange Listener from React Navigation Version 4.x and lower\n     * Creates and records a MobileBreadcrumb for Current Screen\n     * @param {object} prevState\n     * @param {object} newState\n     * @param {object} action\n     */\n    onNavigationStateChange = (prevState, newState, action) => {\n\n        var currentScreenName = this.getCurrentRouteName(newState);\n        var params = {\n            'screenName': currentScreenName\n        };\n\n        this.recordBreadcrumb('navigation', params);\n\n    }\n\n    /**\n     * @param {object} currentState\n     * @returns {string | null}\n     */\n    getCurrentRouteName = (currentState) => {\n        if (!currentState) {\n            return null;\n        }\n        const route = currentState.routes[currentState.index];\n        if (route.routes) {\n            return this.getCurrentRouteName(route);\n        }\n        return route.routeName;\n    }\n    /**\n     * Subcribe componentDidAppearListener Listenr from React Native Navigation Package\n     * Creates and records a MobileBreadcrumb for Current Screen\n     * @param {object} event\n     */\n    componentDidAppearListener = (event) => {\n        if (this.state.isFirstScreen) {\n            this.lastScreen = event.componentName;\n            this.state.isFirstScreen = false;\n            return;\n        }\n        if (this.lastScreen != event.componentName) {\n            var currentScreenName = event.componentName;\n            this.lastScreen = currentScreenName;\n            var params = {\n                'screenName': currentScreenName\n            };\n\n            this.recordBreadcrumb('navigation', params);\n        }\n    }\n\n    /**\n     * Subcribe OnStateChange Listenr from React Navigation Version 5.x and higer\n     * Creates and records a MobileBreadcrumb for Current Screen\n     * @param {object} state\n     */\n    onStateChange = (state) => {\n        var currentScreenName = this.getCurrentScreen(state);\n        var params = {\n            'screenName': currentScreenName\n        };\n\n        this.recordBreadcrumb('navigation', params);\n\n    }\n\n    /**\n     * @param {object} state\n     * @returns {string}\n     */\n    getCurrentScreen(state) {\n\n        if (!state.routes[state.index].state) {\n            return state.routes[state.index].name\n        }\n        return this.getCurrentScreen(state.routes[state.index].state);\n    }\n\n    /**\n     * Start the agent\n     * @param {string} appkey\n     * @param {object} customerConfiguration\n     */\n    startAgent(appkey, customerConfiguration) {\n        this.LOG.verbose = true; // todo: should let this get set by a param\n        this.config = {...this.agentConfiguration, ...customerConfiguration};\n        this.NRMAModularAgentWrapper.startAgent(appkey, this.agentVersion, this.getReactNativeVersion(), this.config);\n        this.addNewRelicErrorHandler();\n        this.addNewRelicPromiseRejectionHandler();\n        this._overrideConsole();\n        //this.enableNetworkInteraction();\n        this.LOG.info('React Native agent started.');\n        this.LOG.info(`New Relic React Native agent version ${this.agentVersion}`);\n        this.setAttribute('ReactNativeAgentVersion', this.agentVersion);\n        this.setAttribute('JSEngine', global.HermesInternal ? \"Hermes\" : \"JavaScriptCore\");\n\n\n    }\n\n    getReactNativeVersion() {\n        var rnVersion = Platform.constants.reactNativeVersion;\n        return `${rnVersion.major}.${rnVersion.minor}.${rnVersion.patch}`\n    }\n\n    /**\n     * FOR ANDROID ONLY.\n     * Enable or disable collection of event data.\n     * @param enabled {boolean} Boolean value for enabling analytics events.\n     */\n    analyticsEventEnabled(enabled) {\n        this.NRMAModularAgentWrapper.execute('analyticsEventEnabled', enabled);\n    }\n\n    /**\n     * Enable or disable reporting successful HTTP requests to the MobileRequest event type.\n     * @param enabled {boolean} Boolean value for enabling successful HTTP requests.\n     */\n    networkRequestEnabled(enabled) {\n        this.NRMAModularAgentWrapper.execute('networkRequestEnabled', enabled);\n    }\n\n    /**\n     * Enable or disable reporting network and HTTP request errors to the MobileRequestError event type.\n     * @param enabled {boolean} Boolean value for enabling network request errors.\n     */\n    networkErrorRequestEnabled(enabled) {\n        this.NRMAModularAgentWrapper.execute('networkErrorRequestEnabled', enabled);\n    }\n\n    /**\n     * Enable or disable capture of HTTP response bodies for HTTP error traces, and MobileRequestError events.\n     * @param enabled {boolean} Boolean value for enabling HTTP response bodies.\n     */\n    httpResponseBodyCaptureEnabled(enabled) {\n        this.NRMAModularAgentWrapper.execute('httpResponseBodyCaptureEnabled', enabled);\n    }\n\n    /**\n     * Creates and records a MobileBreadcrumb event\n     * @param eventName {string} the name you want to give to the breadcrumb event.\n     * @param attributes {Map<string, any>} a map that includes a list of attributes.\n     */\n    recordBreadcrumb(eventName, attributes) {\n        attributes = attributes instanceof Map ? Object.fromEntries(attributes) : attributes;\n        this.NRMAModularAgentWrapper.execute('recordBreadcrumb', eventName, attributes);\n    }\n\n    /**\n     * Creates and records a custom event, for use in New Relic Insights.\n     * The event includes a list of attributes, specified as a map.\n     * @param eventType {string} The type of event.\n     * @param eventName {string} Use this parameter to name the event.\n     * @param attributes {Map<string, any>} A map that includes a list of attributes.\n     */\n    recordCustomEvent(eventType, eventName, attributes) {\n        attributes = attributes instanceof Map ? Object.fromEntries(attributes) : attributes;\n        this.NRMAModularAgentWrapper.execute('recordCustomEvent', eventType, eventName, attributes);\n    }\n\n    /**\n     * Throws a demo run-time exception to test New Relic crash reporting.\n     * @param message {string} Optional argument attached to the exception.\n     */\n    crashNow(message = '') {\n        this.NRMAModularAgentWrapper.execute('crashNow', message);\n    }\n\n    /**\n     * Returns the current session ID.\n     * This method is useful for consolidating monitoring of app data (not just New Relic data) based on a single session definition and identifier.\n     * @return currentSessionId {Promise} A promise that returns the current session id.\n     */\n    async currentSessionId() {\n        return await this.NRMAModularAgentWrapper.execute('currentSessionId');\n    }\n\n    /**\n     * Tracks network requests manually.\n     * You can use this method to record HTTP transactions, with an option to also send a response body.\n     * @param url {string} The URL of the request.\n     * @param httpMethod {string} The HTTP method used, such as GET or POST\n     * @param statusCode {number} The statusCode of the HTTP response, such as 200 for OK.\n     * @param startTime {number} The start time of the request in milliseconds since the epoch.\n     * @param endTime {number} The end time of the request in milliseconds since the epoch.\n     * @param bytesSent {number} The number of bytes sent in the request.\n     * @param bytesReceived {number} The number of bytes received in the response\n     * @param responseBody {string} The response body of the HTTP response. The response body will be truncated and included in an HTTP Error metric if the HTTP transaction is an error.\n     */\n    noticeHttpTransaction(url, httpMethod, statusCode, startTime, endTime, bytesSent, bytesReceived, responseBody) {\n        this.NRMAModularAgentWrapper.execute('noticeHttpTransaction', url, httpMethod, statusCode, startTime, endTime, bytesSent, bytesReceived, responseBody);\n    }\n\n    /**\n     * Add Headers as Attributes in Http Requests, for use in New Relic Insights.\n     * The method includes a list of headers, specified as a map.\n     * @param headers {Map<string, any>} A map that includes a list of headers.\n     */\n    addHTTPHeadersTrackingFor(headers) {\n        this.NRMAModularAgentWrapper.execute('addHTTPHeadersTrackingFor', headers);\n    }\n\n    /**\n     * Records network failures.\n     * If a network request fails, use this method to record details about the failure.\n     * In most cases, place this call inside exception handlers.\n     * @param url {string} The URL of the request.\n     * @param httpMethod {string} The HTTP method used, such as GET or POST.\n     * @param startTime {number} The start time of the request in milliseconds since the epoch.\n     * @param endTime {number} The end time of the request in milliseconds since the epoch.\n     * @param failure {string} Name of the network failure. Possible values are in NewRelic.NetworkFailure.\n     */\n    noticeNetworkFailure(url, httpMethod, startTime, endTime, failure) {\n        this.NRMAModularAgentWrapper.execute('noticeNetworkFailure', url, httpMethod, startTime, endTime, failure);\n    }\n\n    /**\n     * Records custom metrics (arbitrary numerical data).\n     * @param name {string} The name for the custom metric.\n     * @param category {string} The metric category name.\n     * @param value {number} Optional. The value of the metric. Value should be a non-zero positive number.\n     * @param countUnit {string} Optional (but requires value and valueUnit to be set). Unit of measurement for the metric count. Supported values are in NewRelic.MetricUnit.\n     * @param valueUnit {string} Optional (but requires value and countUnit to be set). Unit of measurement for the metric value. Supported values are in NewRelic.MetricUnit.\n     */\n    recordMetric(name, category, value = -1, countUnit = null, valueUnit = null) {\n        this.NRMAModularAgentWrapper.execute('recordMetric', name, category, value, countUnit, valueUnit);\n    }\n\n\n    /**\n     * Removes all attributes from the session.\n     */\n    removeAllAttributes() {\n        this.NRMAModularAgentWrapper.execute('removeAllAttributes');\n    }\n\n    /**\n     * Records JavaScript errors for react-native.\n     * @param e {Error | string} A JavaScript error.\n     */\n    async recordError(e) {\n        await this.recordError(e, false);\n    }\n\n    /**\n     * Records JavaScript errors for react-native.\n     * @param {Error | string} e\n     * @param {boolean} isFatal\n     */\n    async recordError(e, isFatal) {\n        if (e) {\n            if (!this.JSAppVersion) {\n                this.LOG.error('unable to capture JS error. Make sure to call NewRelic.setJSAppVersion() at the start of your application.');\n            }\n\n            var error;\n\n            if (e instanceof Error) {\n                error = e;\n            }\n\n            if (typeof e === 'string') {\n                error = new Error(e || '');\n            }\n\n            if (error !== undefined) {\n                this.NRMAModularAgentWrapper.execute(\"recordHandledException\", error, this.JSAppVersion, isFatal)\n            } else {\n                this.LOG.warn('undefined error name or message');\n            }\n        } else {\n            this.LOG.warn('error is required');\n        }\n    }\n\n    /***\n     * Sets the event harvest cycle length.\n     * Default is 600 seconds (10 minutes).\n     * Minimum value cannot be less than 60 seconds.\n     * Maximum value should not be greater than 600 seconds.\n     * @param maxBufferTimeInSeconds {number} The maximum time (in seconds) that the agent should store events in memory.\n     */\n    setMaxEventBufferTime(maxBufferTimeInSeconds) {\n        this.NRMAModularAgentWrapper.execute('setMaxEventBufferTime', maxBufferTimeInSeconds);\n    }\n\n    /**\n     * Sets the maximum size of the event pool stored in memory until the next harvest cycle.\n     * When the pool size limit is reached, the agent will start sampling events, discarding some new and old, until the pool of events is sent in the next harvest cycle.\n     * Default is a maximum of 1000 events per event harvest cycle.\n     * @param maxSize {number} The maximum number of events per harvest cycle.\n     */\n    setMaxEventPoolSize(maxSize) {\n        this.NRMAModularAgentWrapper.execute('setMaxEventPoolSize', maxSize);\n    }\n\n    /**\n     * Sets the maximum size of total data that can be stored for offline storage.By default, mobile monitoring can collect a maximum of 100 megaBytes of offline storage.\n     * When a data payload fails to send because the device doesn't have an internet connection, it can be stored in the file system until an internet connection has been made.\n     * After a typical harvest payload has been successfully sent, all offline data is sent to New Relic and cleared from storage.\n     * @param megaBytes {number} Maximum size in megaBytes that can be stored in the file system..\n     */\n    setMaxOfflineStorageSize(megaBytes) {\n        this.NRMAModularAgentWrapper.execute('setMaxOfflineStorageSize', megaBytes);\n    }\n\n    /**\n     * Track a method as an interaction\n     * @param {string} actionName - The interaction's name\n     */\n    async startInteraction(actionName) {\n        if (utils.notEmptyString(actionName)) {\n            return await this.NRMAModularAgentWrapper.startInteraction(actionName);\n        } else {\n            this.LOG.warn(`actionName is required`);\n        }\n    }\n\n    /**\n     * End an interaction\n     * Required. The string ID for the interaction you want to end.\n     * This string is returned when you use startInteraction().\n     * @param {string} interActionId\n     */\n    endInteraction(interActionId) {\n        if (utils.notEmptyString(interActionId)) {\n            this.NRMAModularAgentWrapper.execute('endInteraction', interActionId);\n        } else {\n            this.LOG.warn(`interActionId is Required`);\n        }\n    }\n\n\n    /**\n     * ANDROID ONLY\n     * Name or rename an interaction\n     * @param {string} name\n     */\n    setInteractionName(name) {\n        if (Platform.OS === 'android') {\n            this.NRMAModularAgentWrapper.execute('setInteractionName', name);\n        } else {\n            this.LOG.info(`setInterActionName is not supported by iOS Agent`);\n        }\n    }\n\n\n    /**\n     * Creates a custom attribute with a specified name and value.\n     * When called, it overwrites its previous value and type.\n     * The created attribute is shared by multiple Mobile event types.\n     * @param attributeName {string} Name of the attribute.\n     * @param value {string|number|boolean}\n     */\n    setAttribute(attributeName, value) {\n        this.NRMAModularAgentWrapper.execute('setAttribute', attributeName, value);\n    }\n\n    /**\n     * Remove a custom attribute with a specified name and value.\n     * When called, it removes the attribute specified by the name string.\n     * The removed attribute is shared by multiple Mobile event types.\n     * @param attributeName {string} Name of the attribute.\n     */\n    removeAttribute(attributeName) {\n        this.NRMAModularAgentWrapper.execute('removeAttribute', attributeName);\n    }\n\n    /**\n     * This function is used to log a message with a specific log level.\n     *\n     * @param {string} logLevel - The level of the log (e.g., ERROR, WARNING, INFO, VERBOSE, AUDIT).\n     * @param {string} message - The message to be logged.\n     */\n    log(logLevel, message) {\n        // Check if the message is empty\n        if (message === undefined || message.length === 0) {\n            // If the message is empty, log an error message and return\n            console.error(\"Log message is empty.\");\n            return;\n        }\n\n        // Create a new Map to store attributes\n        var attributes = {};\n        // Set the message and log level as attributes\n          attributes[\"message\"] = message;\n          attributes[\"level\"] = logLevel;\n        // Log the attributes\n        this.logAttributes(attributes);\n    }\n\n\n    /**\n     * This function is used to log an error message.\n     *\n     * @param {string} message - The error message to be logged.\n     */\n    logError(message) {\n        this.log(this.LogLevel.ERROR, message);\n    }\n\n    /**\n     * This function is used to log a debug message.\n     *\n     * @param {string} message - The debug message to be logged.\n     */\n    logDebug(message) {\n        this.log(this.LogLevel.DEBUG, message);\n    }\n\n    /**\n     * This function is used to log an informational message.\n     *\n     * @param {string} message - The informational message to be logged.\n     */\n    logInfo(message) {\n        this.log(this.LogLevel.INFO, message);\n    }\n\n    /**\n     * This function is used to log a verbose message.\n     *\n     * @param {string} message - The verbose message to be logged.\n     */\n    logVerbose(message) {\n        this.log(this.LogLevel.VERBOSE, message);\n    }\n\n    /**\n     * This function is used to log a warning message.\n     *\n     * @param {string} message - The warning message to be logged.\n     */\n    logWarn(message) {\n        this.log(this.LogLevel.WARN, message);\n    }\n\n    /**\n     * This function is used to log all attributes.\n     *\n     * @param {Error} error - The error object from which the message is extracted.\n     * @param {Record<string, string | number | boolean>} attributes - The attributes to be logged.\n     */\n    logAll(error, attributes) {\n        // Create a new Map to store all attributes\n        let allAttributes = {};\n\n        // Set the error message as an attribute\n        allAttributes[\"message\"] = error.message;\n\n        // Iterate over the attributes Map and add each attribute to allAttributes\n        for (const [key, value] of Object.entries(attributes)) {\n            allAttributes[key] = value;\n        }\n\n        // Log all attributes\n        this.logAttributes(allAttributes);\n    }\n\n    /**\n     * This function is used to log attributes.\n     *\n     * @param {Record<string, string | number | boolean>} attributes - The attributes to be logged.\n     */\n    logAttributes(attributes) {\n        // Check if the attributes are empty\n        if (utils.isObjectEmpty(attributes)){\n            // If attributes are empty, log an error message and return\n            console.error(\"Attributes are empty.\");\n            return;\n        }\n        this.NRMAModularAgentWrapper.execute('logAttributes', attributes);\n    }\n\n\n    /**\n     * Increments the count of an attribute with a specified name.\n     * When called, it overwrites its previous value and type each time.\n     * If attribute does not exist, it creates an attribute with a value of 1.\n     * The incremented attribute is shared by multiple Mobile event types.\n     * @param attributeName {string} Name of the Attribute.\n     * @param value {number} Optional argument that increments the attribute by this value.\n     */\n    incrementAttribute(attributeName, value = 1) {\n        this.NRMAModularAgentWrapper.execute('incrementAttribute', attributeName, value);\n    }\n\n    /**\n     * Sets the js release version\n     * @param version {string}\n     */\n    setJSAppVersion(version) {\n        if (utils.isString(version)) {\n            this.JSAppVersion = version;\n            this.NRMAModularAgentWrapper.execute('setJSAppVersion', version);\n            return;\n        }\n\n        this.LOG.error(`JSAppVersion '${version}' is not a string.`);\n    }\n\n    /**\n     * Sets a custom user identifier value to associate mobile user\n     * @param userId {string}\n     */\n    setUserId(userId) {\n        if (utils.isString(userId)) {\n            this.NRMAModularAgentWrapper.execute('setUserId', userId);\n        } else {\n            this.LOG.error(`userId '${userId}' is not a string.`);\n        }\n    }\n\n    /**\n     * Shut down the agent within the current application lifecycle during runtime.\n     */\n    shutdown() {\n        this.NRMAModularAgentWrapper.execute('shutdown');\n    }\n\n    /**\n     * Start recording session replay.\n     * Enables session replay functionality to capture and record user interactions.\n     */\n    recordReplay() {\n        this.NRMAModularAgentWrapper.execute('recordReplay');\n    }\n\n    /**\n     * Pause recording session replay.\n     * Temporarily pauses the session replay recording functionality.\n     */\n    pauseReplay() {\n        this.NRMAModularAgentWrapper.execute('pauseReplay');\n    }\n\n    /**\n     * @private\n     */\n    addNewRelicErrorHandler() {\n        if (global && global.ErrorUtils && !this.state.didAddErrorHandler) {\n            const previousHandler = global.ErrorUtils.getGlobalHandler();\n            global.ErrorUtils.setGlobalHandler(async (error, isFatal) => {\n                if (!this.JSAppVersion) {\n                    this.LOG.error('unable to capture JS error. Make sure to call NewRelic.setJSAppVersion() at the start of your application.');\n                }\n                await this.recordError(error, isFatal);\n                previousHandler(error, isFatal);\n            });\n            // prevent us from adding the error handler multiple times.\n            this.state.didAddErrorHandler = true;\n        } else if (!this.state.didAddErrorHandler) {\n            this.LOG.debug('failed to add New Relic error handler no error utils detected');\n        }\n    }\n\n    /**\n     * @private\n     */\n    addNewRelicPromiseRejectionHandler() {\n\n        const prevTracker = getUnhandledPromiseRejectionTracker();\n\n        if (!this.state.didAddPromiseRejection) {\n            setUnhandledPromiseRejectionTracker(async (id, error) => {\n                if (error != undefined) {\n                    await this.recordError(error);\n                } else {\n                    this.recordBreadcrumb(\"Possible Unhandled Promise Rejection\", {id: id})\n                }\n\n                if (prevTracker !== undefined) {\n                    prevTracker(id, error)\n                }\n\n            });\n            this.state.didAddPromiseRejection = true;\n\n        }\n\n    }\n\n    /**\n     * @private\n     */\n    _overrideConsole() {\n        if (!this.state.didOverrideConsole) {\n            const defaultLog = console.log;\n            const defaultWarn = console.warn;\n            const defaultError = console.error;\n            const defaultDebug = console.debug;\n            const self = this;\n\n            console.log = function () {\n                self.sendConsole('log', arguments);\n                defaultLog.apply(console, arguments);\n            };\n            console.warn = function () {\n                self.sendConsole('warn', arguments);\n                defaultWarn.apply(console, arguments);\n            };\n            console.error = function () {\n                self.sendConsole('error', arguments);\n                defaultError.apply(console, arguments);\n            };\n\n            console.debug = function () {\n                self.sendConsole('debug', arguments);\n                defaultDebug.apply(console, arguments);\n            }\n\n\n            this.state.didOverrideConsole = true;\n        }\n    }\n\n    /**\n     * @private\n     * @param {string} type\n     * @param {IArguments | Array<unknown>} args\n     */\n    sendConsole(type, args) {\n        const argsStr = JSON.stringify(args, getCircularReplacer());\n\n        if (type === 'error') {\n            this.logError(\"[CONSOLE][ERROR]\" + argsStr);\n        } else if (type === 'warn') {\n            this.logWarn(\"[CONSOLE][WARN]\" + argsStr);\n        } else if (type === 'debug') {\n            this.logDebug(\"[CONSOLE][DEBUG]\" + argsStr);\n        } else {\n            this.logInfo(\"[CONSOLE][LOG]\" + argsStr);\n        }\n\n    }\n\n}\n\n\nconst newRelic = new NewRelic();\nexport default newRelic;\n\n\n\nexport { NewRelicMask, NewRelicUnmask } from './new-relic/replay/newrelic-mask-view';\n"]}