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ApiName","globalConsole","originalConsoleMethods","name","PREFIX","display","DOCS_ORIGIN","DOCS_TROUBLESHOOTING","MORE_DETAILS","catchUserErrors","fn","errorMsg","args","err","performDraw","threshold","round","num","decimals","isPercentage","value","isNumber","ONE_SECOND","ONE_MINUTE","ONE_HOUR","ONE_DAY","ONE_YEAR","relativeToClocks","relative","getCorrectedTimeStamp","timeStampToClocks","timeStamp","getRelativeTime","relativeTime","correctedOrigin","dateNow","getNavigationStart","addDuration","getTimeStamp","currentDrift","toServerDuration","duration","timeStampNow","relativeNow","clocksNow","clocksOrigin","elapsed","start","end","a","b","timestamp","looksLikeRelativeTime","time","navigationStart","ONE_KIBI_BYTE","ONE_MEBI_BYTE","HAS_MULTI_BYTES_CHARACTERS","computeBytesCount","candidate","concatBuffers","buffers","length","total","buffer","result","offset","shallowClone","object","objectHasValue","key","isEmptyObject","mapValues","newObject","getGlobalObject","globalObject","getZoneJsOriginalValue","target","browserWindow","original","onMonitorErrorCollected","debugMode","startMonitorErrorCollection","newOnMonitorErrorCollected","setDebugMode","newDebugMode","monitor","callMonitored","context","e","monitorError","displayIfDebugEnabled","setTimeout","callback","delay","clearTimeout","timeoutId","setInterval","clearInterval","Observable","onFirstSubscribe","f","other","data","observer","mergeObservables","observables","globalObservable","subscriptions","observable","subscription","throttle","wait","options","needLeadingExecution","needTrailingExecution","inWaitPeriod","pendingExecutionWithParameters","pendingTimeoutId","parameters","noop","generateUUID","placeholder","COMMA_SEPARATED_KEY_VALUE","findCommaSeparatedValue","rawString","match","findCommaSeparatedValues","safeTruncate","suffix","lastChar","correctedLength","isChromium","detectBrowserCached","isSafari","browserCache","detectBrowser","_a","userAgent","setCookie","expireDelay","date","expires","sameSite","domain","secure","partitioned","getCookie","initCookieParsed","getInitCookie","deleteCookie","areCookiesAuthorized","testCookieName","testCookieValue","isCookieCorrectlySet","error","getCurrentSiteCache","getCurrentSite","domainLevels","candidateDomain","SESSION_STORE_KEY","findLast","array","predicate","i","item","objectValues","objectEntries","SESSION_TIME_OUT_DELAY","SESSION_EXPIRATION_DELAY","SESSION_COOKIE_EXPIRATION_DELAY","SessionPersistence","SESSION_ENTRY_REGEXP","SESSION_ENTRY_SEPARATOR","isValidSessionString","sessionString","EXPIRED","getExpiredSessionState","previousSessionState","configuration","expiredSessionState","isSessionInNotStartedState","session","isSessionStarted","isSessionInExpiredState","isActiveSession","sessionState","expandSessionState","toSessionString","toSessionState","entry","matches","OLD_SESSION_COOKIE_NAME","OLD_RUM_COOKIE_NAME","OLD_LOGS_COOKIE_NAME","RUM_SESSION_KEY","LOGS_SESSION_KEY","tryOldCookiesMigration","cookieStoreStrategy","oldSessionId","oldRumType","oldLogsType","selectCookieStrategy","initConfiguration","cookieOptions","buildCookieOptions","initCookieStrategy","cookieStore","persistSessionCookie","retrieveSessionCookie","expireSessionCookie","LOCAL_STORAGE_TEST_KEY","selectLocalStorageStrategy","id","testKey","retrievedId","initLocalStorageStrategy","persistInLocalStorage","retrieveSessionFromLocalStorage","expireSessionFromLocalStorage","LOCK_RETRY_DELAY","LOCK_MAX_TRIES","bufferedOperations","ongoingOperations","processSessionStoreOperations","operations","sessionStoreStrategy","numberOfRetries","isLockEnabled","persistSession","expireSession","persistWithLock","currentLock","retrieveStore","lock","next","currentStore","retryLater","processedSession","sessionStore","currentNumberOfRetries","nextOperations","STORAGE_POLL_DELAY","selectSessionStoreStrategyType","sessionStoreStrategyType","startSessionStore","productKey","computeSessionState","renewObservable","expireObservable","sessionStateUpdateObservable","watchSessionTimeoutId","watchSession","sessionCache","startSession","throttledExpandOrRenewSession","cancelExpandOrRenewSession","synchronizedSession","synchronizeSession","expandOrRenewSessionState","hasSessionInCache","renewSessionInCache","expandSession","isSessionInCacheOutdated","expireSessionInCache","trackingType","isTracked","updateSessionState","partialSessionState","TrackingConsent","createTrackingConsentState","currentConsent","trackingConsent","jsonStringify","replacer","space","restoreObjectPrototypeToJson","detachToJsonMethod","restoreArrayPrototypeToJson","restoreValuePrototypeToJson","restoreValueToJson","objectToJson","normalizeUrl","url","buildUrl","isValidUrl","getPathName","pathname","base","supportedURL","getSupportedUrl","doc","anchorElement","baseElement","originalURL","isURLSupported","INTAKE_SITE_STAGING","INTAKE_SITE_FED_STAGING","INTAKE_SITE_US1","INTAKE_SITE_EU1","INTAKE_SITE_US1_FED","PCI_INTAKE_HOST_US1","INTAKE_URL_PARAMETERS","createEndpointBuilder","trackType","configurationTags","buildUrlWithParameters","createEndpointUrlWithParametersBuilder","api","payload","buildEndpointParameters","path","proxy","normalizedProxyUrl","host","buildEndpointHost","site","internalAnalyticsSubdomain","domainParts","extension","clientToken","retry","encoding","tags","TAG_SIZE_LIMIT","buildTags","env","service","version","datacenter","buildTag","rawValue","valueSizeLimit","hasForbiddenCharacters","sanitizedValue","supportUnicodePropertyEscapes","computeTransportConfiguration","endpointBuilders","computeEndpointBuilders","computeReplicaConfiguration","replicaConfiguration","replicaEndpointBuilders","isIntakeUrl","param","DefaultPrivacyLevel","TraceContextInjection","isString","tag","tagName","isDatadogSite","isSampleRate","sampleRate","validateAndBuildConfiguration","_b","_c","_d","_e","_f","serializeConfiguration","ExperimentalFeature","enabledExperimentalFeatures","initFeatureFlags","enableExperimentalFeatures","addExperimentalFeatures","flag","enabledFeatures","isExperimentalFeatureEnabled","featureName","getExperimentalFeatures","UNKNOWN_FUNCTION","computeStackTrace","ex","stack","stackProperty","tryToGetString","exString","line","stackFrame","parseChromeLine","parseChromeAnonymousLine","parseWinLine","parseGeckoLine","fileUrl","filePosition","CHROME_LINE_RE","CHROME_EVAL_RE","parts","isNative","isEval","submatch","CHROME_ANONYMOUS_FUNCTION_RE","WINJS_LINE_RE","GECKO_LINE_RE","GECKO_EVAL_RE","property","computeStackTraceFromOnErrorMessage","messageObj","column","message","tryToParseMessage","ERROR_TYPES_RE","createHandlingStack","type","formattedStack","stackTrace","toStackTraceString","formatErrorMessage","frame","func","instrumentMethod","targetPrototype","method","onPreCall","computeHandlingStack","stopped","instrumentation","postCallCallback","instrumentSetter","after","originalDescriptor","stoppedInstrumentation","instrumentationWrapper","SANITIZE_DEFAULT_MAX_CHARACTER_COUNT","JSON_PATH_ROOT_ELEMENT","KEY_DECORATION_LENGTH","sanitize","source","maxCharacterCount","containerQueue","visitedObjectsWithPath","sanitizedData","sanitizeProcessor","serializedSanitizedData","accumulatedCharacterCount","warnOverCharacterLimit","containerToProcess","separatorLength","targetData","parentPath","queue","sourceToSanitize","tryToApplyToJSON","sanitizePrimitivesAndFunctions","sanitizedSource","sanitizeObjects","sourceAsObject","currentPath","sanitizeEvent","event","changeType","NO_ERROR_STACK_PRESENT_MESSAGE","computeRawError","originalError","handlingStack","componentStack","startClocks","nonErrorPrefix","handling","isErrorInstance","isError","computeMessage","hasUsableStack","causes","flattenErrorCauses","fingerprint","tryToGetFingerprint","tryToGetErrorContext","parentSource","currentError","ErrorSource","trackRuntimeError","errorObservable","handleRuntimeError","rawError","stopInstrumentingOnError","instrumentOnError","stopInstrumentingOnUnhandledRejection","instrumentUnhandledRejection","errorObj","reason","makePublicApi","stub","publicApi","defineGlobal","global","existingGlobalVariable","displayAlreadyInitializedError","sdkName","addEventListener","eventTarget","eventName","listener","addEventListeners","eventNames","once","capture","passive","listenerWithMonitor","stop","listenerTarget","add","remove","RawReportType","initReportObservable","apis","createCspViolationReportObservable","reportTypes","createReportObservable","handleReports","reports","_","report","buildRawReportErrorFromReport","buildRawReportErrorFromCspViolation","body","buildRawReportError","buildStack","partial","sourceFile","lineNumber","columnNumber","sendToExtension","getType","mergeInto","destination","circularReferenceChecker","createCircularReferenceChecker","flags","merged","deepClone","combine","sources","set","has","getConnectivity","navigator","removeItem","index","BUFFER_LIMIT","createBoundedBuffer","arg","TelemetryType","ALLOWED_FRAME_URLS","TELEMETRY_EXCLUDED_SITES","preStartTelemetryBuffer","onRawTelemetryEventCollected","startTelemetry","telemetryService","contextProvider","alreadySentEvents","telemetryEnabled","telemetryEnabledPerType","runtimeEnvInfo","getRuntimeEnvInfo","rawEvent","stringifiedEvent","toTelemetryEvent","addTelemetryError","provider","drainPreStartTelemetry","isTelemetryReplicationAllowed","addTelemetryDebug","formatError","addTelemetryConfiguration","addTelemetryUsage","usage","scrubCustomerFrames","allowedFrameUrl","END_OF_TIMES","CLEAR_OLD_VALUES_INTERVAL","cleanupHistoriesInterval","cleanupTasks","cleanupHistories","task","createValueHistory","maxEntries","entries","deletedEntries","clearExpiredValues","oldTimeThreshold","startTime","endTime","find","closeActive","latestEntry","findAll","getAllEntries","getDeletedEntries","reset","VISIBILITY_CHECK_DELAY","SESSION_CONTEXT_TIMEOUT_DELAY","startSessionManager","trackingConsentState","sessionContextHistory","buildSessionContext","trackActivity","trackVisibility","trackResume","expandOrRenewSession","expandSessionWhenVisible","cb","isServerError","status","tryToClone","response","MAX_ONGOING_BYTES_COUNT","MAX_ONGOING_REQUESTS","MAX_QUEUE_BYTES_COUNT","MAX_BACKOFF_TIME","INITIAL_BACKOFF_TIME","sendWithRetryStrategy","state","sendStrategy","reportError","send","retryQueuedPayloads","scheduleRetry","onSuccess","onFailure","shouldRetryRequest","previousQueue","newPayloadQueue","newRetryState","newBandwidthMonitor","createHttpRequest","endpointBuilder","bytesLimit","retryState","sendStrategyForRetry","onResponse","fetchKeepAliveStrategy","sendBeaconStrategy","beaconUrl","reportBeaconError","fetchStrategy","hasReportedBeaconError","isKeepAliveSupported","fetchUrl","getEventBridge","eventBridgeGlobal","getEventBridgeGlobal","eventType","viewId","view","bridgeSupports","capability","bridge","canUseEventBridge","currentHost","allowedHost","PageExitReason","createPageExitObservable","stopListeners","stopBeforeUnloadListener","isPageExitReason","createBatch","encoder","request","flushController","messageBytesLimit","upsertBuffer","flushSubscription","flush","push","serializedMessage","estimatedMessageBytesCount","realMessageBytesCount","hasMessageFor","removedMessage","messageBytesCount","addOrUpdate","upsertMessages","isPageExit","encoderResult","formatPayloadFromEncoder","pendingMessages","createFlushController","messagesLimit","durationLimit","pageExitObservable","sessionExpireObservable","pageExitSubscription","sessionExpireSubscription","flushObservable","currentBytesCount","currentMessagesCount","flushReason","messagesCount","bytesCount","cancelDurationLimitTimeout","durationLimitTimeoutId","scheduleDurationLimitTimeout","messageBytesCountDiff","startBatchWithReplica","primary","replica","batchFactoryImp","primaryBatch","createBatchFromConfig","replicaBatch","endpoint","replicated","createIdentityEncoder","output","outputBytesCount","additionalEncodedBytesCount","AbstractLifeCycle","eventCallbacks","createEventRateLimiter","limit","onLimitReached","eventCount","allowNextEvent","runOnReadyState","expectedReadyState","asyncRunOnReadyState","resolve","xhrObservable","xhrContexts","initXhrObservable","createXhrObservable","stopInstrumentingStart","openXhr","stopInstrumentingSend","call","sendXhr","stopInstrumentingAbort","abortXhr","xhr","startContext","hasBeenReported","stopInstrumentingOnReadyStateChange","onEnd","unsubscribeLoadEndListener","completeContext","fetchObservable","initFetchObservable","createFetchObservable","beforeSend","onPostCall","input","init","methodFromParams","responsePromise","afterSend","reportFetch","partialContext","requestIdleCallback","opts","requestIdleCallbackShim","MAX_TASK_TIME","IDLE_CALLBACK_TIMEOUT","MAX_EXECUTION_TIME_ON_TIMEOUT","createTaskQueue","pendingTasks","run","deadline","executionTimeRemaining","scheduleNextRun","consoleObservablesByApi","initConsoleObservable","consoleObservables","createConsoleObservable","originalConsoleApi","params","buildConsoleLog","formatConsoleParameters","firstErrorParam","checkContext","maybeContext","isValid","ensureProperties","propertiesConfig","newContext","required","createContextManager","customerDataTracker","changeObservable","contextManager","CONTEXT_STORE_KEY_PREFIX","storageListeners","storeContextManager","customerDataType","storageKey","buildStorageKey","synchronizeWithStorage","dumpToStorage","contextFromStorage","getFromStorage","rawContext","CUSTOMER_DATA_BYTES_LIMIT","CUSTOMER_COMPRESSED_DATA_BYTES_LIMIT","BYTES_COMPUTATION_THROTTLING_DELAY","createCustomerDataTrackerManager","compressionStatus","customerDataTrackers","alreadyWarned","checkCustomerDataLimit","initialBytesCount","bytesCountLimit","tracker","displayCustomerDataLimitReachedWarning","createCustomerDataTracker","newCompressionStatus","bytesCountCache","computeBytesCountThrottled","cancelComputeBytesCount","resetBytesCount","readBytesFromStream","stream","reader","readBytesCount","readMore","onDone","SYNTHETICS_TEST_ID_COOKIE_NAME","SYNTHETICS_RESULT_ID_COOKIE_NAME","SYNTHETICS_INJECTS_RUM_COOKIE_NAME","willSyntheticsInjectRum","getSyntheticsTestId","getSyntheticsResultId","isMatchOption","itemType","matchList","list","useStartsWith","buildCommonContext","globalContextManager","userContextManager","accountContextManager","recorderApi","createCustomVitalsState","startVitalCollection","lifeCycle","pageStateHistory","customVitalsState","vital","addDurationVital","processVital","startDurationVital","nameOrRef","stopDurationVital","vitalsByName","vitalsByReference","reference","stopCallback","vitalStart","buildDurationVital","stopOptions","stopClocks","valueComputedBySdk","rawRumEvent","callPluginsMethod","plugins","methodName","parameter","plugin","createTraceIdentifier","createIdentifier","createSpanIdentifier","bits","radix","high","low","str","mod","toPaddedHexadecimalString","sampleDecisionCache","isTraceSampled","sessionId","decision","sampleUsingKnuthFactor","identifier","knuthFactor","twoPow64","hash","encodedContextCache","getEncodedContext","encoded","encodeToUtf8Base64","plainText","bytes","binString","isTracingOption","expectedItem","clearTracingIfNeeded","startTracer","sessionManager","getCommonContext","injectHeadersIfTracingAllowed","tracingHeaders","headers","header","inject","tracingOption","traceSampled","makeTracingHeaders","traceId","spanId","propagatorTypes","propagatorType","getTraceStateDatadogItems","traceStateDatadogItems","userIdEncoded","accountIdEncoded","DEFAULT_PROPAGATOR_TYPES","validateAndBuildRumConfiguration","_g","allowedTracingUrls","validateAndBuildTracingOptions","baseConfiguration","profilingEnabled","sessionReplaySampleRate","tracingOptions","option","getSelectedTracingPropagators","usedTracingPropagators","serializeRumConfiguration","baseSerializedConfiguration","REMOTE_CONFIGURATION_VERSION","fetchAndApplyRemoteConfiguration","fetchRemoteConfiguration","remoteInitConfiguration","applyRemoteConfiguration","remoteConfiguration","displayRemoteConfigurationFetchingError","buildEndpoint","createPreStartStrategy","ignoreInitIfSyntheticsWillInjectRum","startDeflateWorker","doStartRum","bufferApiCalls","firstStartViewCall","deflateWorker","cachedInitConfiguration","cachedConfiguration","trackingConsentStateSubscription","tryStartRum","emptyContext","initialViewOptions","startRumResult","doInit","eventBridgeAvailable","overrideInitConfigurationForBridge","action","commonContext","providedError","RUM_STORAGE_KEY","makeRumPublicApi","startRumImpl","profilerApi","customerDataTrackerManager","strategy","streamId","createPostStartStrategy","startView","sanitizedOptions","rumPublicApi","newUser","preStartStrategy","createDOMMutationObservable","MutationObserver","getMutationObserverConstructor","constructor","patchedInstance","originalInstance","createWindowOpenObservable","limitModification","modifiableFieldPaths","modifier","clone","fieldPath","fieldType","setValueAtPath","pathSegments","field","restPathSegments","isValidObject","setNestedValue","newType","VIEW_MODIFIABLE_FIELD_PATHS","USER_CUSTOMIZABLE_FIELD_PATHS","ROOT_MODIFIABLE_FIELD_PATHS","modifiableFieldPathsByEvent","startRumAssembly","hooks","viewHistory","urlContexts","displayContext","eventRateLimiters","domainContext","savedCommonContext","customerContext","viewHistoryEntry","urlContext","rumContext","serverRumEvent","shouldSend","startInternalContext","applicationId","actionContexts","viewContext","actionId","LifeCycle","VIEW_CONTEXT_TIME_OUT_DELAY","startViewHistory","viewValueHistory","buildViewHistoryEntry","endClocks","viewUpdate","currentView","FAKE_INITIAL_DOCUMENT","RESOURCE_TYPES","initiatorType","computeResourceEntryType","isType","areInOrder","numbers","isResourceEntryRequestType","computeResourceEntryDuration","responseEnd","computeResourceEntryDetails","hasValidResourceEntryTimings","fetchStart","workerStart","redirectStart","redirectEnd","domainLookupStart","domainLookupEnd","connectStart","secureConnectionStart","connectEnd","requestStart","responseStart","details","formatTiming","hasValidResourceEntryDuration","areCommonTimingsInOrder","areRedirectionTimingsInOrder","hasRedirection","origin","computeResourceEntryProtocol","computeResourceEntryDeliveryType","computeResourceEntrySize","encodedBodySize","decodedBodySize","transferSize","isAllowedRequestUrl","DATA_URL_REGEX","MAX_ATTRIBUTE_VALUE_CHAR_LENGTH","isLongDataUrl","sanitizeDataUrl","nextRequestIndex","startRequestCollection","tracer","trackXhr","trackFetch","getNextRequestIndex","waitForResponseToComplete","clonedResponse","discardNegativeDuration","trackEventCounts","isChildEvent","eventCounts","retrieveFirstInputTiming","startTimeStamp","timingSent","removeEventListeners","evt","timing","sendTimingIfPointerIsNotCancelled","sendTiming","RumPerformanceEntryType","createPerformanceObservable","handlePerformanceEntries","rumPerformanceEntries","filterRumPerformanceEntries","isObserverInitializing","manageResourceTimingBufferFull","stopFirstInputTiming","supportPerformanceTimingEvent","resourceTimingBufferFullListener","supportPerformanceObject","entryType","isForbiddenResource","PAGE_ACTIVITY_VALIDATION_DELAY","PAGE_ACTIVITY_END_DELAY","waitPageActivityEnd","domMutationObservable","windowOpenObservable","pageActivityEndCallback","maxDuration","pageActivityObservable","createPageActivityObservable","doWaitPageActivityEnd","pageActivityEndTimeoutId","hasCompleted","validationTimeoutId","complete","maxDurationTimeoutId","pageActivitySubscription","isBusy","lastChangeTime","firstRequestIndex","pendingRequestsCount","notifyPageActivity","isExcludedUrl","startEvent","s","requestUrl","isTextNode","node","isCommentNode","isElementNode","isNodeShadowHost","isNodeShadowRoot","shadowRoot","hasChildNodes","forEachChildNodes","child","getParentNode","NodePrivacyLevel","PRIVACY_ATTR_NAME","PRIVACY_ATTR_VALUE_HIDDEN","PRIVACY_CLASS_PREFIX","CENSORED_STRING_MARK","CENSORED_IMG_MARK","FORM_PRIVATE_TAG_NAMES","TEXT_MASKING_CHAR","getNodePrivacyLevel","defaultPrivacyLevel","cache","parentNode","parentNodePrivacyLevel","selfNodePrivacyLevel","getNodeSelfPrivacyLevel","nodePrivacyLevel","reducePrivacyLevel","childPrivacyLevel","inputElement","autocomplete","getPrivacySelector","shouldIgnoreElement","shouldMaskNode","privacyLevel","isFormElement","element","censorText","text","getTextContent","textNode","ignoreWhiteSpace","parentTagName","textContent","relAttribute","getLowerCaseAttribute","nameAttribute","propertyAttribute","DEFAULT_PROGRAMMATIC_ACTION_NAME_ATTRIBUTE","ACTION_NAME_PLACEHOLDER","getActionNameFromElement","enablePrivacyForActionName","userProgrammaticAttribute","defaultActionName","getActionNameFromElementProgrammatically","getActionNameFromElementForStrategies","priorityStrategies","fallbackStrategies","targetElement","programmaticAttribute","elementWithAttribute","truncate","normalizeWhitespace","getActionNameFromTextualContent","privacyEnabledActionName","getActionNameFromStandardAttribute","labelledByAttribute","getElementById","label","getTextualContent","MAX_PARENTS_TO_CONSIDER","strategies","recursionCounter","actionName","nameSource","trimmedName","refElement","attribute","removeTextFromElements","query","textToReplace","STABLE_ATTRIBUTES","GLOBALLY_UNIQUE_SELECTOR_GETTERS","getStableAttributeSelector","getIDSelector","UNIQUE_AMONG_CHILDREN_SELECTOR_GETTERS","getClassSelector","getTagNameSelector","getSelectorFromElement","actionNameAttribute","targetElementSelector","currentElement","globallyUniqueSelector","findSelector","isSelectorUniqueGlobally","isSelectorUniqueAmongSiblings","combineSelector","getPositionSelector","isGeneratedValue","classList","className","selector","getAttributeSelector","attributeName","sibling","elementIndex","selectorGetters","childSelector","selectorGetter","elementSelector","currentElementSelector","isSiblingMatching","scopedSelector","parent","MAX_DURATION_BETWEEN_CLICKS","MAX_DISTANCE_BETWEEN_CLICKS","createClickChain","firstClick","onFinalize","bufferedClicks","maxDurationBetweenClicksTimeoutId","appendClick","click","tryFinalize","dontAcceptMoreClick","areEventsSimilar","first","second","mouseEventDistance","listenActionEvents","onPointerDown","onPointerUp","selectionEmptyAtPointerDown","userActivity","clickContext","listeners","isValidPointerEvent","isSelectionEmpty","localUserActivity","selection","MIN_CLICKS_PER_SECOND_TO_CONSIDER_RAGE","computeFrustration","clicks","rageClick","isRage","isDead","hasSelectionChanged","DEAD_CLICK_EXCLUDE_SELECTOR","CLICK_ACTION_MAX_DURATION","interactionSelectorCache","getInteractionSelector","relativeTimestamp","updateInteractionSelector","ACTION_CONTEXT_TIME_OUT_DELAY","trackClickActions","history","stopObservable","currentClickChain","stopClickChain","stopActionEventsListener","pointerDownEvent","processPointerDown","clickActionBase","hadActivityOnPointerDown","getUserActivity","startClickAction","appendClickToClickChain","finalizeClicks","computeClickActionBase","pageActivityEndEvent","newClick","stopWaitPageActivityEnd","viewEndedSubscription","stopSubscription","rect","historyEntry","eventCountsSubscription","activityEndTime","frustrationTypes","newActivityEndTime","frustrationType","domEvents","resourceCount","errorCount","longTaskCount","clickAction","startActionCollection","processAction","autoActionProperties","isAutoAction","actionEvent","trackConsoleError","consoleLog","trackReportError","startErrorCollection","doStartErrorCollection","processError","alreadyMatchedEntries","matchRequestResourceEntry","sameNameEntries","candidates","isBetween","INITIAL_DOCUMENT_OUTDATED_TRACE_ID_THRESHOLD","getDocumentTraceId","document","getDocumentTraceDataFromMeta","getDocumentTraceDataFromComment","traceIdMeta","traceTimeMeta","createDocumentTraceData","comment","findTraceComment","rawTraceTime","traceTime","getTraceCommentFromNode","getNavigationEntry","navigationEntry","timings","computeTimingsFromDeprecatedPerformanceTiming","numberKey","timingElement","retrieveInitialDocumentResourceTiming","getNavigationEntryImpl","startResourceCollection","taskQueue","retrieveInitialDocumentResourceTimingImpl","handleResource","processRequest","performanceResourceSubscription","processResourceEntry","computeRawEvent","matchingTiming","tracingInfo","computeRequestTracingInfo","correspondingTimingOverrides","computeResourceEntryMetrics","computeRequestDuration","resourceEvent","computeResourceEntryTracingInfo","entryMetrics","discardZeroStatus","renderBlockingStatus","statusCode","trackViewEventCounts","onChange","FCP_MAXIMUM_DELAY","trackFirstContentfulPaint","firstHidden","fcpEntry","trackFirstInput","performanceFirstInputSubscription","firstInputEntry","firstInputDelay","firstInputTargetSelector","trackNavigationTimings","waitAfterLoadEvent","isIncompleteNavigation","processNavigationEntry","stopOnReadyState","LCP_MAXIMUM_DELAY","trackLargestContentfulPaint","firstInteractionTimestamp","stopEventListener","biggestLcpSize","performanceLcpSubscription","lcpEntry","lcpTargetSelector","computeLcpEntryUrl","trackFirstHidden","firstHiddenEntry","trackInitialViewMetrics","setLoadEvent","scheduleViewUpdate","initialViewMetrics","stopNavigationTracking","navigationTimings","stopFCPTracking","firstContentfulPaint","stopLCPTracking","largestContentfulPaint","stopFIDTracking","firstInput","trackCumulativeLayoutShift","viewStart","isLayoutShiftSupported","maxClsValue","biggestShift","slidingWindow","slidingSessionWindow","performanceSubscription","cumulatedValue","isMaxValue","attribution","getFirstElementAttribution","asRumRect","x","y","width","height","MAX_WINDOW_DURATION","MAX_UPDATE_GAP","maxValue","shouldCreateNewWindow","interactionCountEstimate","minKnownInteractionId","maxKnownInteractionId","initInteractionCountPolyfill","getInteractionCount","MAX_INTERACTION_ENTRIES","MAX_INP_VALUE","trackInteractionToNextPaint","viewLoadingType","isInteractionToNextPaintSupported","getViewInteractionCount","stopViewInteractionCount","trackViewInteractionCount","viewEnd","longestInteractions","trackLongestInteractions","interactionToNextPaint","interactionToNextPaintTargetSelector","interactionToNextPaintStartTime","handleEntries","newInteraction","firstInputSubscription","eventSubscription","viewEndTime","sortAndTrimLongestInteractions","interactionIndex","interaction","minLongestInteraction","previousInteractionCount","computeViewInteractionCount","trackLoadingTime","loadType","isWaitingForLoadEvent","isWaitingForActivityLoadingTime","loadingTimeCandidates","invokeCallbackIfAllCandidatesAreReceived","loadingTime","loadEvent","getScrollX","scrollX","visual","getScrollY","scrollY","viewportObservable","initViewportObservable","createViewportObservable","updateDimension","getViewportDimension","THROTTLE_SCROLL_DURATION","trackScrollMetrics","scrollValues","createScrollValuesObservable","maxScrollDepth","maxScrollHeight","maxScrollHeightTime","scrollDepth","scrollTop","scrollHeight","shouldUpdate","now","computeScrollValues","throttleDuration","notify","throttledNotify","observerTarget","resizeObserver","eventListener","trackCommonViewMetrics","loadingType","commonViewMetrics","stopLoadingTimeTracking","newLoadingTime","stopScrollMetricsTracking","newScrollMetrics","stopCLSTracking","cumulativeLayoutShift","stopINPTracking","getInteractionToNextPaint","setViewEnd","THROTTLE_VIEW_UPDATE_PERIOD","SESSION_KEEP_ALIVE_INTERVAL","KEEP_TRACKING_AFTER_VIEW_DELAY","trackViews","location","locationChangeObservable","areViewsTrackedAutomatically","activeViews","startNewView","startViewLifeCycle","locationChangeSubscription","renewViewOnLocationChange","viewOptions","newlyCreatedView","newView","pageExitEvent","oldLocation","newLocation","areDifferentLocation","initialLocation","customTimings","documentVersion","sessionIsActive","viewCreatedEvent","throttled","cancelScheduleViewUpdate","triggerViewUpdate","stopCommonViewMetricsTracking","getCommonViewMetrics","stopInitialViewMetricsTracking","stopEventCountsTracking","keepAliveIntervalId","triggerBeforeViewUpdate","currentEnd","sanitizeTiming","updatedName","sanitized","currentLocation","otherLocation","isHashAnAnchor","getPathFromHash","correspondingId","startViewCollection","pageOpenObservable","processViewUpdate","_h","_j","_k","_l","_m","_o","_p","_q","_r","_s","_t","replayStats","clsDevicePixelRatio","viewEvent","computeViewPerformanceData","startRumSessionManager","rawTrackingType","previousState","newState","sessionEntity","isTypeTracked","startRumSessionManagerStub","hasValidRumSession","rumSessionType","startRumBatch","telemetryEventObservable","createEncoder","batch","startRumEventBridge","URL_CONTEXT_TIME_OUT_DELAY","startUrlContexts","urlContextHistory","previousViewUrl","viewUrl","buildUrlContext","current","changeTime","referrer","createLocationChangeObservable","stopHistoryTracking","trackHistory","onLocationChange","stopHashTracking","trackHash","onHistoryChange","stopInstrumentingPushState","getHistoryInstrumentationTarget","stopInstrumentingReplaceState","removeListener","onHashChange","FEATURE_FLAG_CONTEXT_TIME_OUT_DELAY","startFeatureFlagContexts","featureFlagContexts","featureFlagContext","currentContext","MEASURES_PERIOD_DURATION","currentPeriodMeasures","currentBatchMeasures","batchHasRumEvent","startCustomerDataTelemetry","telemetry","batchFlushObservable","initCurrentPeriodMeasures","initCurrentBatchMeasures","updateMeasure","mergeMeasure","sendCurrentPeriodMeasures","createMeasure","measure","MAX_PAGE_STATE_ENTRIES","MAX_PAGE_STATE_ENTRIES_SELECTABLE","PAGE_STATE_CONTEXT_TIME_OUT_DELAY","startPageStateHistory","maxPageStateEntriesSelectable","pageStateEntryHistory","currentPageState","addPageState","getPageState","stopEventListeners","computePageState","nextPageState","wasInPageStateDuringPeriod","pageState","pageStates","processPageStates","pageStateEntries","eventStartTime","startDisplayContext","viewport","animationFrameId","unsubscribeViewport","viewportDimension","createCookieObservable","cookieName","detectCookieChangeStrategy","listenToCookieStoreChange","watchCookieFallback","changeEvent","WATCH_COOKIE_INTERVAL_DELAY","previousCookieValue","watchCookieIntervalId","cookieValue","CI_VISIBILITY_TEST_ID_COOKIE_NAME","startCiVisibilityContext","cookieObservable","testExecutionId","cookieObservableSubscription","startLongAnimationFrameCollection","script","startLongTaskCollection","performanceLongTaskSubscription","createHooks","callbacks","hookName","results","startSyntheticsContext","testId","resultId","startRum","startRumTelemetry","stopWindowOpen","addAction","stopRumEventCollection","startRumEventCollection","addTiming","setViewName","setViewContext","setViewContextProperty","getViewContext","stopViewCollection","stopResourceCollection","stopLongAnimationFrameCollection","addError","vitalCollection","internalContext","actionCollection","ciVisibilityContext","getSessionReplayUrl","errorType","getDatadogSiteUrl","rumConfiguration","subdomain","getSiteDefaultSubdomain","MAX_STATS_HISTORY","statsPerView","getSegmentsCount","getOrCreateReplayStats","addSegment","addRecord","addWroteData","additionalBytesCount","getReplayStats","deleteOldestStats","toDelete","createDeflateEncoder","worker","rawBytesCount","compressedData","compressedDataTrailer","nextWriteActionId","pendingWriteActions","removeMessageListener","workerResponse","nextPendingAction","consumeResult","sendResetIfNeeded","pendingWriteAction","pendingData","reportScriptLoadingError","configuredUrl","scriptType","isMessageCspRelated","baseMessage","INITIALIZATION_TIME_OUT_DELAY","createDeflateWorker","onInitializationFailure","createDeflateWorkerImpl","doStartDeflateWorker","getDeflateWorkerStatus","removeErrorListener","onError","onInitialized","onTimeout","isBrowserSupported","getSessionReplayLink","isRecordingStarted","getErrorType","loadRecorder","getOrCreateDeflateEncoder","stopRecording","doStart","startRecordingImpl","deflateEncoder","canStartRecording","isRecordingInProgress","shouldForceReplay","makeRecorderApi","shouldStartImmediately","onRumStart","getReplayStatsImpl","cachedDeflateEncoder","lazyLoadRecorder","importRecorderImpl","importRecorder","__vitePreload","isProfilingSupported","lazyLoadProfiler","makeProfilerApi","profiler","createRumProfiler","datadogRum"],"ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169],"sources":["../../../../../../node_modules/@datadog/browser-core/esm/tools/display.js","../../../../../../node_modules/@datadog/browser-core/esm/tools/catchUserErrors.js","../../../../../../node_modules/@datadog/browser-core/esm/tools/utils/numberUtils.js","../../../../../../node_modules/@datadog/browser-core/esm/tools/utils/timeUtils.js","../../../../../../node_modules/@datadog/browser-core/esm/tools/utils/byteUtils.js","../../../../../../node_modules/@datadog/browser-core/esm/tools/utils/objectUtils.js","../../../../../../node_modules/@datadog/browser-core/esm/tools/getGlobalObject.js","../../../../../../node_modules/@datadog/browser-core/esm/tools/getZoneJsOriginalValue.js","../../../../../../node_modules/@datadog/browser-core/esm/tools/monitor.js","../../../../../../node_modules/@datadog/browser-core/esm/tools/timer.js","../../../../../../node_modules/@datadog/browser-core/esm/tools/observable.js","../../../../../../node_modules/@datadog/browser-core/esm/tools/utils/functionUtils.js","../../../../../../node_modules/@datadog/browser-core/esm/tools/utils/stringUtils.js","../../../../../../node_modules/@datadog/browser-core/esm/tools/utils/browserDetection.js","../../../../../../node_modules/@datadog/browser-core/esm/browser/cookie.js","../../../../../../node_modules/@datadog/browser-core/esm/domain/session/storeStrategies/sessionStoreStrategy.js","../../../../../../node_modules/@datadog/browser-core/esm/tools/utils/polyfills.js","../../../../../../node_modules/@datadog/browser-core/esm/domain/session/sessionConstants.js","../../../../../../node_modules/@datadog/browser-core/esm/domain/session/sessionStateValidation.js","../../../../../../node_modules/@datadog/browser-core/esm/domain/session/sessionState.js","../../../../../../node_modules/@datadog/browser-core/esm/domain/session/oldCookiesMigration.js","../../../../../../node_modules/@datadog/browser-core/esm/domain/session/storeStrategies/sessionInCookie.js","../../../../../../node_modules/@datadog/browser-core/esm/domain/session/storeStrategies/sessionInLocalStorage.js","../../../../../../node_modules/@datadog/browser-core/esm/domain/session/sessionStoreOperations.js","../../../../../../node_modules/@datadog/browser-core/esm/domain/session/sessionStore.js","../../../../../../node_modules/@datadog/browser-core/esm/domain/trackingConsent.js","../../../../../../node_modules/@datadog/browser-core/esm/tools/serialisation/jsonStringify.js","../../../../../../node_modules/@datadog/browser-core/esm/tools/utils/urlPolyfill.js","../../../../../../node_modules/@datadog/browser-core/esm/domain/configuration/intakeSites.js","../../../../../../node_modules/@datadog/browser-core/esm/domain/configuration/endpointBuilder.js","../../../../../../node_modules/@datadog/browser-core/esm/domain/configuration/tags.js","../../../../../../node_modules/@datadog/browser-core/esm/domain/configuration/transportConfiguration.js","../../../../../../node_modules/@datadog/browser-core/esm/domain/configuration/configuration.js","../../../../../../node_modules/@datadog/browser-core/esm/tools/experimentalFeatures.js","../../../../../../node_modules/@datadog/browser-core/esm/tools/stackTrace/computeStackTrace.js","../../../../../../node_modules/@datadog/browser-core/esm/tools/stackTrace/handlingStack.js","../../../../../../node_modules/@datadog/browser-core/esm/tools/instrumentMethod.js","../../../../../../node_modules/@datadog/browser-core/esm/tools/serialisation/sanitize.js","../../../../../../node_modules/@datadog/browser-core/esm/domain/error/error.js","../../../../../../node_modules/@datadog/browser-core/esm/domain/error/error.types.js","../../../../../../node_modules/@datadog/browser-core/esm/domain/error/trackRuntimeError.js","../../../../../../node_modules/@datadog/browser-core/esm/boot/init.js","../../../../../../node_modules/@datadog/browser-core/esm/boot/displayAlreadyInitializedError.js","../../../../../../node_modules/@datadog/browser-core/esm/browser/addEventListener.js","../../../../../../node_modules/@datadog/browser-core/esm/domain/report/reportObservable.js","../../../../../../node_modules/@datadog/browser-core/esm/tools/sendToExtension.js","../../../../../../node_modules/@datadog/browser-core/esm/tools/utils/typeUtils.js","../../../../../../node_modules/@datadog/browser-core/esm/tools/mergeInto.js","../../../../../../node_modules/@datadog/browser-core/esm/domain/connectivity/connectivity.js","../../../../../../node_modules/@datadog/browser-core/esm/tools/utils/arrayUtils.js","../../../../../../node_modules/@datadog/browser-core/esm/tools/boundedBuffer.js","../../../../../../node_modules/@datadog/browser-core/esm/domain/telemetry/rawTelemetryEvent.types.js","../../../../../../node_modules/@datadog/browser-core/esm/domain/telemetry/telemetry.js","../../../../../../node_modules/@datadog/browser-core/esm/tools/valueHistory.js","../../../../../../node_modules/@datadog/browser-core/esm/domain/session/sessionManager.js","../../../../../../node_modules/@datadog/browser-core/esm/tools/utils/responseUtils.js","../../../../../../node_modules/@datadog/browser-core/esm/transport/sendWithRetryStrategy.js","../../../../../../node_modules/@datadog/browser-core/esm/transport/httpRequest.js","../../../../../../node_modules/@datadog/browser-core/esm/transport/eventBridge.js","../../../../../../node_modules/@datadog/browser-core/esm/browser/pageExitObservable.js","../../../../../../node_modules/@datadog/browser-core/esm/transport/batch.js","../../../../../../node_modules/@datadog/browser-core/esm/transport/flushController.js","../../../../../../node_modules/@datadog/browser-core/esm/transport/startBatchWithReplica.js","../../../../../../node_modules/@datadog/browser-core/esm/tools/encoder.js","../../../../../../node_modules/@datadog/browser-core/esm/tools/abstractLifeCycle.js","../../../../../../node_modules/@datadog/browser-core/esm/domain/eventRateLimiter/createEventRateLimiter.js","../../../../../../node_modules/@datadog/browser-core/esm/browser/runOnReadyState.js","../../../../../../node_modules/@datadog/browser-core/esm/browser/xhrObservable.js","../../../../../../node_modules/@datadog/browser-core/esm/browser/fetchObservable.js","../../../../../../node_modules/@datadog/browser-core/esm/tools/requestIdleCallback.js","../../../../../../node_modules/@datadog/browser-core/esm/tools/taskQueue.js","../../../../../../node_modules/@datadog/browser-core/esm/domain/console/consoleObservable.js","../../../../../../node_modules/@datadog/browser-core/esm/domain/context/contextUtils.js","../../../../../../node_modules/@datadog/browser-core/esm/domain/context/contextManager.js","../../../../../../node_modules/@datadog/browser-core/esm/domain/context/storeContextManager.js","../../../../../../node_modules/@datadog/browser-core/esm/domain/context/customerDataTracker.js","../../../../../../node_modules/@datadog/browser-core/esm/tools/readBytesFromStream.js","../../../../../../node_modules/@datadog/browser-core/esm/domain/synthetics/syntheticsWorkerValues.js","../../../../../../node_modules/@datadog/browser-core/esm/tools/matchOption.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/contexts/commonContext.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/vital/vitalCollection.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/plugins.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/tracing/identifier.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/tracing/sampler.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/tracing/encodedContext.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/tracing/tracer.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/configuration/configuration.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/configuration/remoteConfiguration.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/boot/preStartRum.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/boot/rumPublicApi.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/browser/domMutationObservable.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/browser/windowOpenObservable.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/limitModification.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/assembly.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/contexts/internalContext.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/lifeCycle.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/contexts/viewHistory.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/resource/resourceUtils.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/requestCollection.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/discardNegativeDuration.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/trackEventCounts.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/browser/firstInputPolyfill.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/browser/performanceObservable.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/waitPageActivityEnd.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/browser/htmlDomUtils.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/privacy.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/action/getActionNameFromElement.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/getSelectorFromElement.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/action/clickChain.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/action/listenActionEvents.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/action/computeFrustration.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/action/interactionSelectorCache.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/action/trackClickActions.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/action/actionCollection.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/error/trackConsoleError.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/error/trackReportError.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/error/errorCollection.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/resource/matchRequestResourceEntry.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/tracing/getDocumentTraceId.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/browser/performanceUtils.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/resource/retrieveInitialDocumentResourceTiming.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/resource/resourceCollection.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/view/trackViewEventCounts.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/view/viewMetrics/trackFirstContentfulPaint.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/view/viewMetrics/trackFirstInput.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/view/viewMetrics/trackNavigationTimings.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/view/viewMetrics/trackLargestContentfulPaint.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/view/viewMetrics/trackFirstHidden.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/view/viewMetrics/trackInitialViewMetrics.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/view/viewMetrics/trackCumulativeLayoutShift.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/view/viewMetrics/interactionCountPolyfill.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/view/viewMetrics/trackInteractionToNextPaint.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/view/viewMetrics/trackLoadingTime.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/browser/scroll.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/browser/viewportObservable.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/view/viewMetrics/trackScrollMetrics.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/view/viewMetrics/trackCommonViewMetrics.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/view/trackViews.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/view/viewCollection.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/rumSessionManager.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/transport/startRumBatch.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/transport/startRumEventBridge.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/contexts/urlContexts.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/browser/locationChangeObservable.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/contexts/featureFlagContext.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/startCustomerDataTelemetry.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/contexts/pageStateHistory.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/contexts/displayContext.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/browser/cookieObservable.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/contexts/ciVisibilityContext.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/longAnimationFrame/longAnimationFrameCollection.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/longTask/longTaskCollection.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/hooks.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/contexts/syntheticsContext.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/boot/startRum.js","../../../../../../node_modules/@datadog/browser-rum-core/esm/domain/getSessionReplayUrl.js","../../../../../../node_modules/@datadog/browser-rum/esm/domain/replayStats.js","../../../../../../node_modules/@datadog/browser-rum/esm/domain/deflate/deflateEncoder.js","../../../../../../node_modules/@datadog/browser-rum/esm/domain/scriptLoadingError.js","../../../../../../node_modules/@datadog/browser-rum/esm/domain/deflate/deflateWorker.js","../../../../../../node_modules/@datadog/browser-rum/esm/boot/isBrowserSupported.js","../../../../../../node_modules/@datadog/browser-rum/esm/domain/getSessionReplayLink.js","../../../../../../node_modules/@datadog/browser-rum/esm/boot/postStartStrategy.js","../../../../../../node_modules/@datadog/browser-rum/esm/boot/preStartStrategy.js","../../../../../../node_modules/@datadog/browser-rum/esm/boot/recorderApi.js","../../../../../../node_modules/@datadog/browser-rum/esm/boot/lazyLoadRecorder.js","../../../../../../node_modules/@datadog/browser-rum/esm/domain/profiling/profilingSupported.js","../../../../../../node_modules/@datadog/browser-rum/esm/domain/profiling/lazyLoadProfiler.js","../../../../../../node_modules/@datadog/browser-rum/esm/boot/profilerApi.js","../../../../../../node_modules/@datadog/browser-rum/esm/entries/main.js"],"sourcesContent":["/* eslint-disable local-rules/disallow-side-effects */\n/**\n * Keep references on console methods to avoid triggering patched behaviors\n *\n * NB: in some setup, console could already be patched by another SDK.\n * In this case, some display messages can be sent by the other SDK\n * but we should be safe from infinite loop nonetheless.\n */\nexport const ConsoleApiName = {\n log: 'log',\n debug: 'debug',\n info: 'info',\n warn: 'warn',\n error: 'error',\n};\n/**\n * When building JS bundles, some users might use a plugin[1] or configuration[2] to remove\n * \"console.*\" references. This causes some issue as we expect `console.*` to be defined.\n * As a workaround, let's use a variable alias, so those expressions won't be taken into account by\n * simple static analysis.\n *\n * [1]: https://babeljs.io/docs/babel-plugin-transform-remove-console/\n * [2]: https://github.com/terser/terser#compress-options (look for drop_console)\n */\nexport const globalConsole = console;\nexport const originalConsoleMethods = {};\nObject.keys(ConsoleApiName).forEach((name) => {\n originalConsoleMethods[name] = globalConsole[name];\n});\nconst PREFIX = 'Datadog Browser SDK:';\nexport const display = {\n debug: originalConsoleMethods.debug.bind(globalConsole, PREFIX),\n log: originalConsoleMethods.log.bind(globalConsole, PREFIX),\n info: originalConsoleMethods.info.bind(globalConsole, PREFIX),\n warn: originalConsoleMethods.warn.bind(globalConsole, PREFIX),\n error: originalConsoleMethods.error.bind(globalConsole, PREFIX),\n};\nexport const DOCS_ORIGIN = 'https://docs.datadoghq.com';\nexport const DOCS_TROUBLESHOOTING = `${DOCS_ORIGIN}/real_user_monitoring/browser/troubleshooting`;\nexport const MORE_DETAILS = 'More details:';\n//# sourceMappingURL=display.js.map","import { display } from './display';\nexport function catchUserErrors(fn, errorMsg) {\n return (...args) => {\n try {\n return fn(...args);\n }\n catch (err) {\n display.error(errorMsg, err);\n }\n };\n}\n//# sourceMappingURL=catchUserErrors.js.map","/**\n * Return true if the draw is successful\n * @param threshold between 0 and 100\n */\nexport function performDraw(threshold) {\n return threshold !== 0 && Math.random() * 100 <= threshold;\n}\nexport function round(num, decimals) {\n return +num.toFixed(decimals);\n}\nexport function isPercentage(value) {\n return isNumber(value) && value >= 0 && value <= 100;\n}\nexport function isNumber(value) {\n return typeof value === 'number';\n}\n//# sourceMappingURL=numberUtils.js.map","import { isNumber, round } from './numberUtils';\nexport const ONE_SECOND = 1000;\nexport const ONE_MINUTE = 60 * ONE_SECOND;\nexport const ONE_HOUR = 60 * ONE_MINUTE;\nexport const ONE_DAY = 24 * ONE_HOUR;\nexport const ONE_YEAR = 365 * ONE_DAY;\nexport function relativeToClocks(relative) {\n return { relative, timeStamp: getCorrectedTimeStamp(relative) };\n}\nexport function timeStampToClocks(timeStamp) {\n return { relative: getRelativeTime(timeStamp), timeStamp };\n}\nfunction getCorrectedTimeStamp(relativeTime) {\n const correctedOrigin = (dateNow() - performance.now());\n // apply correction only for positive drift\n if (correctedOrigin > getNavigationStart()) {\n return Math.round(addDuration(correctedOrigin, relativeTime));\n }\n return getTimeStamp(relativeTime);\n}\nexport function currentDrift() {\n return Math.round(dateNow() - addDuration(getNavigationStart(), performance.now()));\n}\nexport function toServerDuration(duration) {\n if (!isNumber(duration)) {\n return duration;\n }\n return round(duration * 1e6, 0);\n}\nexport function dateNow() {\n // Do not use `Date.now` because sometimes websites are wrongly \"polyfilling\" it. For example, we\n // had some users using a very old version of `datejs`, which patched `Date.now` to return a Date\n // instance instead of a timestamp[1]. Those users are unlikely to fix this, so let's handle this\n // case ourselves.\n // [1]: https://github.com/datejs/Datejs/blob/97f5c7c58c5bc5accdab8aa7602b6ac56462d778/src/core-debug.js#L14-L16\n return new Date().getTime();\n}\nexport function timeStampNow() {\n return dateNow();\n}\nexport function relativeNow() {\n return performance.now();\n}\nexport function clocksNow() {\n return { relative: relativeNow(), timeStamp: timeStampNow() };\n}\nexport function clocksOrigin() {\n return { relative: 0, timeStamp: getNavigationStart() };\n}\nexport function elapsed(start, end) {\n return (end - start);\n}\nexport function addDuration(a, b) {\n return a + b;\n}\n// Get the time since the navigation was started.\nexport function getRelativeTime(timestamp) {\n return (timestamp - getNavigationStart());\n}\nexport function getTimeStamp(relativeTime) {\n return Math.round(addDuration(getNavigationStart(), relativeTime));\n}\nexport function looksLikeRelativeTime(time) {\n return time < ONE_YEAR;\n}\n/**\n * Navigation start slightly change on some rare cases\n */\nlet navigationStart;\n/**\n * Notes: this does not use `performance.timeOrigin` because:\n * - It doesn't seem to reflect the actual time on which the navigation has started: it may be much farther in the past,\n * at least in Firefox 71. (see: https://bugzilla.mozilla.org/show_bug.cgi?id=1429926)\n * - It is not supported in Safari <15\n */\nfunction getNavigationStart() {\n if (navigationStart === undefined) {\n navigationStart = performance.timing.navigationStart;\n }\n return navigationStart;\n}\n//# sourceMappingURL=timeUtils.js.map","export const ONE_KIBI_BYTE = 1024;\nexport const ONE_MEBI_BYTE = 1024 * ONE_KIBI_BYTE;\n// eslint-disable-next-line no-control-regex\nconst HAS_MULTI_BYTES_CHARACTERS = /[^\\u0000-\\u007F]/;\nexport function computeBytesCount(candidate) {\n // Accurate bytes count computations can degrade performances when there is a lot of events to process\n if (!HAS_MULTI_BYTES_CHARACTERS.test(candidate)) {\n return candidate.length;\n }\n if (window.TextEncoder !== undefined) {\n return new TextEncoder().encode(candidate).length;\n }\n return new Blob([candidate]).size;\n}\nexport function concatBuffers(buffers) {\n const length = buffers.reduce((total, buffer) => total + buffer.length, 0);\n const result = new Uint8Array(length);\n let offset = 0;\n for (const buffer of buffers) {\n result.set(buffer, offset);\n offset += buffer.length;\n }\n return result;\n}\n//# sourceMappingURL=byteUtils.js.map","export function shallowClone(object) {\n return { ...object };\n}\nexport function objectHasValue(object, value) {\n return Object.keys(object).some((key) => object[key] === value);\n}\nexport function isEmptyObject(object) {\n return Object.keys(object).length === 0;\n}\nexport function mapValues(object, fn) {\n const newObject = {};\n for (const key of Object.keys(object)) {\n newObject[key] = fn(object[key]);\n }\n return newObject;\n}\n//# sourceMappingURL=objectUtils.js.map","/**\n * inspired by https://mathiasbynens.be/notes/globalthis\n */\nexport function getGlobalObject() {\n if (typeof globalThis === 'object') {\n return globalThis;\n }\n Object.defineProperty(Object.prototype, '_dd_temp_', {\n get() {\n return this;\n },\n configurable: true,\n });\n // @ts-ignore _dd_temp is defined using defineProperty\n let globalObject = _dd_temp_;\n // @ts-ignore _dd_temp is defined using defineProperty\n delete Object.prototype._dd_temp_;\n if (typeof globalObject !== 'object') {\n // on safari _dd_temp_ is available on window but not globally\n // fallback on other browser globals check\n if (typeof self === 'object') {\n globalObject = self;\n }\n else if (typeof window === 'object') {\n globalObject = window;\n }\n else {\n globalObject = {};\n }\n }\n return globalObject;\n}\n//# sourceMappingURL=getGlobalObject.js.map","import { getGlobalObject } from './getGlobalObject';\n/**\n * Gets the original value for a DOM API that was potentially patched by Zone.js.\n *\n * Zone.js[1] is a library that patches a bunch of JS and DOM APIs. It usually stores the original\n * value of the patched functions/constructors/methods in a hidden property prefixed by\n * __zone_symbol__.\n *\n * In multiple occasions, we observed that Zone.js is the culprit of important issues leading to\n * browser resource exhaustion (memory leak, high CPU usage). This method is used as a workaround to\n * use the original DOM API instead of the one patched by Zone.js.\n *\n * [1]: https://github.com/angular/angular/tree/main/packages/zone.js\n */\nexport function getZoneJsOriginalValue(target, name) {\n const browserWindow = getGlobalObject();\n let original;\n if (browserWindow.Zone && typeof browserWindow.Zone.__symbol__ === 'function') {\n original = target[browserWindow.Zone.__symbol__(name)];\n }\n if (!original) {\n original = target[name];\n }\n return original;\n}\n//# sourceMappingURL=getZoneJsOriginalValue.js.map","import { display } from './display';\nlet onMonitorErrorCollected;\nlet debugMode = false;\nexport function startMonitorErrorCollection(newOnMonitorErrorCollected) {\n onMonitorErrorCollected = newOnMonitorErrorCollected;\n}\nexport function setDebugMode(newDebugMode) {\n debugMode = newDebugMode;\n}\nexport function resetMonitor() {\n onMonitorErrorCollected = undefined;\n debugMode = false;\n}\nexport function monitored(_, __, descriptor) {\n const originalMethod = descriptor.value;\n descriptor.value = function (...args) {\n const decorated = onMonitorErrorCollected ? monitor(originalMethod) : originalMethod;\n return decorated.apply(this, args);\n };\n}\nexport function monitor(fn) {\n return function () {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return callMonitored(fn, this, arguments);\n }; // consider output type has input type\n}\nexport function callMonitored(fn, context, args) {\n try {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return fn.apply(context, args);\n }\n catch (e) {\n monitorError(e);\n }\n}\nexport function monitorError(e) {\n displayIfDebugEnabled(e);\n if (onMonitorErrorCollected) {\n try {\n onMonitorErrorCollected(e);\n }\n catch (e) {\n displayIfDebugEnabled(e);\n }\n }\n}\nexport function displayIfDebugEnabled(...args) {\n if (debugMode) {\n display.error('[MONITOR]', ...args);\n }\n}\n//# sourceMappingURL=monitor.js.map","import { getZoneJsOriginalValue } from './getZoneJsOriginalValue';\nimport { monitor } from './monitor';\nimport { getGlobalObject } from './getGlobalObject';\nexport function setTimeout(callback, delay) {\n return getZoneJsOriginalValue(getGlobalObject(), 'setTimeout')(monitor(callback), delay);\n}\nexport function clearTimeout(timeoutId) {\n getZoneJsOriginalValue(getGlobalObject(), 'clearTimeout')(timeoutId);\n}\nexport function setInterval(callback, delay) {\n return getZoneJsOriginalValue(getGlobalObject(), 'setInterval')(monitor(callback), delay);\n}\nexport function clearInterval(timeoutId) {\n getZoneJsOriginalValue(getGlobalObject(), 'clearInterval')(timeoutId);\n}\n//# sourceMappingURL=timer.js.map","// eslint-disable-next-line no-restricted-syntax\nexport class Observable {\n constructor(onFirstSubscribe) {\n this.onFirstSubscribe = onFirstSubscribe;\n this.observers = [];\n }\n subscribe(f) {\n this.observers.push(f);\n if (this.observers.length === 1 && this.onFirstSubscribe) {\n this.onLastUnsubscribe = this.onFirstSubscribe(this) || undefined;\n }\n return {\n unsubscribe: () => {\n this.observers = this.observers.filter((other) => f !== other);\n if (!this.observers.length && this.onLastUnsubscribe) {\n this.onLastUnsubscribe();\n }\n },\n };\n }\n notify(data) {\n this.observers.forEach((observer) => observer(data));\n }\n}\nexport function mergeObservables(...observables) {\n return new Observable((globalObservable) => {\n const subscriptions = observables.map((observable) => observable.subscribe((data) => globalObservable.notify(data)));\n return () => subscriptions.forEach((subscription) => subscription.unsubscribe());\n });\n}\n//# sourceMappingURL=observable.js.map","import { setTimeout, clearTimeout } from '../timer';\n// use lodash API\nexport function throttle(fn, wait, options) {\n const needLeadingExecution = options && options.leading !== undefined ? options.leading : true;\n const needTrailingExecution = options && options.trailing !== undefined ? options.trailing : true;\n let inWaitPeriod = false;\n let pendingExecutionWithParameters;\n let pendingTimeoutId;\n return {\n throttled: (...parameters) => {\n if (inWaitPeriod) {\n pendingExecutionWithParameters = parameters;\n return;\n }\n if (needLeadingExecution) {\n fn(...parameters);\n }\n else {\n pendingExecutionWithParameters = parameters;\n }\n inWaitPeriod = true;\n pendingTimeoutId = setTimeout(() => {\n if (needTrailingExecution && pendingExecutionWithParameters) {\n fn(...pendingExecutionWithParameters);\n }\n inWaitPeriod = false;\n pendingExecutionWithParameters = undefined;\n }, wait);\n },\n cancel: () => {\n clearTimeout(pendingTimeoutId);\n inWaitPeriod = false;\n pendingExecutionWithParameters = undefined;\n },\n };\n}\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nexport function noop() { }\n//# sourceMappingURL=functionUtils.js.map","/**\n * UUID v4\n * from https://gist.github.com/jed/982883\n */\nexport function generateUUID(placeholder) {\n return placeholder\n ? // eslint-disable-next-line no-bitwise\n (parseInt(placeholder, 10) ^ ((Math.random() * 16) >> (parseInt(placeholder, 10) / 4))).toString(16)\n : `${1e7}-${1e3}-${4e3}-${8e3}-${1e11}`.replace(/[018]/g, generateUUID);\n}\nconst COMMA_SEPARATED_KEY_VALUE = /([\\w-]+)\\s*=\\s*([^;]+)/g;\nexport function findCommaSeparatedValue(rawString, name) {\n COMMA_SEPARATED_KEY_VALUE.lastIndex = 0;\n while (true) {\n const match = COMMA_SEPARATED_KEY_VALUE.exec(rawString);\n if (match) {\n if (match[1] === name) {\n return match[2];\n }\n }\n else {\n break;\n }\n }\n}\nexport function findCommaSeparatedValues(rawString) {\n const result = new Map();\n COMMA_SEPARATED_KEY_VALUE.lastIndex = 0;\n while (true) {\n const match = COMMA_SEPARATED_KEY_VALUE.exec(rawString);\n if (match) {\n result.set(match[1], match[2]);\n }\n else {\n break;\n }\n }\n return result;\n}\nexport function safeTruncate(candidate, length, suffix = '') {\n const lastChar = candidate.charCodeAt(length - 1);\n const isLastCharSurrogatePair = lastChar >= 0xd800 && lastChar <= 0xdbff;\n const correctedLength = isLastCharSurrogatePair ? length + 1 : length;\n if (candidate.length <= correctedLength) {\n return candidate;\n }\n return `${candidate.slice(0, correctedLength)}${suffix}`;\n}\n//# sourceMappingURL=stringUtils.js.map","export function isChromium() {\n return detectBrowserCached() === 0 /* Browser.CHROMIUM */;\n}\nexport function isSafari() {\n return detectBrowserCached() === 1 /* Browser.SAFARI */;\n}\nlet browserCache;\nfunction detectBrowserCached() {\n return browserCache !== null && browserCache !== void 0 ? browserCache : (browserCache = detectBrowser());\n}\n// Exported only for tests\nexport function detectBrowser(browserWindow = window) {\n var _a;\n const userAgent = browserWindow.navigator.userAgent;\n if (browserWindow.chrome || /HeadlessChrome/.test(userAgent)) {\n return 0 /* Browser.CHROMIUM */;\n }\n if (\n // navigator.vendor is deprecated, but it is the most resilient way we found to detect\n // \"Apple maintained browsers\" (AKA Safari). If one day it gets removed, we still have the\n // useragent test as a semi-working fallback.\n ((_a = browserWindow.navigator.vendor) === null || _a === void 0 ? void 0 : _a.indexOf('Apple')) === 0 ||\n (/safari/i.test(userAgent) && !/chrome|android/i.test(userAgent))) {\n return 1 /* Browser.SAFARI */;\n }\n return 2 /* Browser.OTHER */;\n}\n//# sourceMappingURL=browserDetection.js.map","import { display } from '../tools/display';\nimport { ONE_MINUTE, ONE_SECOND } from '../tools/utils/timeUtils';\nimport { findCommaSeparatedValue, findCommaSeparatedValues, generateUUID } from '../tools/utils/stringUtils';\nexport function setCookie(name, value, expireDelay = 0, options) {\n const date = new Date();\n date.setTime(date.getTime() + expireDelay);\n const expires = `expires=${date.toUTCString()}`;\n const sameSite = options && options.crossSite ? 'none' : 'strict';\n const domain = options && options.domain ? `;domain=${options.domain}` : '';\n const secure = options && options.secure ? ';secure' : '';\n const partitioned = options && options.partitioned ? ';partitioned' : '';\n document.cookie = `${name}=${value};${expires};path=/;samesite=${sameSite}${domain}${secure}${partitioned}`;\n}\nexport function getCookie(name) {\n return findCommaSeparatedValue(document.cookie, name);\n}\nlet initCookieParsed;\n/**\n * Returns a cached value of the cookie. Use this during SDK initialization (and whenever possible)\n * to avoid accessing document.cookie multiple times.\n */\nexport function getInitCookie(name) {\n if (!initCookieParsed) {\n initCookieParsed = findCommaSeparatedValues(document.cookie);\n }\n return initCookieParsed.get(name);\n}\nexport function resetInitCookies() {\n initCookieParsed = undefined;\n}\nexport function deleteCookie(name, options) {\n setCookie(name, '', 0, options);\n}\nexport function areCookiesAuthorized(options) {\n if (document.cookie === undefined || document.cookie === null) {\n return false;\n }\n try {\n // Use a unique cookie name to avoid issues when the SDK is initialized multiple times during\n // the test cookie lifetime\n const testCookieName = `dd_cookie_test_${generateUUID()}`;\n const testCookieValue = 'test';\n setCookie(testCookieName, testCookieValue, ONE_MINUTE, options);\n const isCookieCorrectlySet = getCookie(testCookieName) === testCookieValue;\n deleteCookie(testCookieName, options);\n return isCookieCorrectlySet;\n }\n catch (error) {\n display.error(error);\n return false;\n }\n}\n/**\n * No API to retrieve it, number of levels for subdomain and suffix are unknown\n * strategy: find the minimal domain on which cookies are allowed to be set\n * https://web.dev/same-site-same-origin/#site\n */\nlet getCurrentSiteCache;\nexport function getCurrentSite() {\n if (getCurrentSiteCache === undefined) {\n // Use a unique cookie name to avoid issues when the SDK is initialized multiple times during\n // the test cookie lifetime\n const testCookieName = `dd_site_test_${generateUUID()}`;\n const testCookieValue = 'test';\n const domainLevels = window.location.hostname.split('.');\n let candidateDomain = domainLevels.pop();\n while (domainLevels.length && !getCookie(testCookieName)) {\n candidateDomain = `${domainLevels.pop()}.${candidateDomain}`;\n setCookie(testCookieName, testCookieValue, ONE_SECOND, { domain: candidateDomain });\n }\n deleteCookie(testCookieName, { domain: candidateDomain });\n getCurrentSiteCache = candidateDomain;\n }\n return getCurrentSiteCache;\n}\n//# sourceMappingURL=cookie.js.map","export const SESSION_STORE_KEY = '_dd_s';\n//# sourceMappingURL=sessionStoreStrategy.js.map","export function findLast(array, predicate) {\n for (let i = array.length - 1; i >= 0; i -= 1) {\n const item = array[i];\n if (predicate(item, i, array)) {\n return item;\n }\n }\n return undefined;\n}\n// Keep the following wrapper functions as it can be mangled and will result in smaller bundle size that using\n// the native Object.values and Object.entries directly\nexport function objectValues(object) {\n return Object.values(object);\n}\nexport function objectEntries(object) {\n return Object.entries(object);\n}\n//# sourceMappingURL=polyfills.js.map","import { ONE_HOUR, ONE_MINUTE, ONE_YEAR } from '../../tools/utils/timeUtils';\nexport const SESSION_TIME_OUT_DELAY = 4 * ONE_HOUR;\nexport const SESSION_EXPIRATION_DELAY = 15 * ONE_MINUTE;\nexport const SESSION_COOKIE_EXPIRATION_DELAY = ONE_YEAR;\nexport const SessionPersistence = {\n COOKIE: 'cookie',\n LOCAL_STORAGE: 'local-storage',\n};\n//# sourceMappingURL=sessionConstants.js.map","export const SESSION_ENTRY_REGEXP = /^([a-zA-Z]+)=([a-z0-9-]+)$/;\nexport const SESSION_ENTRY_SEPARATOR = '&';\nexport function isValidSessionString(sessionString) {\n return (!!sessionString &&\n (sessionString.indexOf(SESSION_ENTRY_SEPARATOR) !== -1 || SESSION_ENTRY_REGEXP.test(sessionString)));\n}\n//# sourceMappingURL=sessionStateValidation.js.map","import { isEmptyObject } from '../../tools/utils/objectUtils';\nimport { objectEntries } from '../../tools/utils/polyfills';\nimport { dateNow } from '../../tools/utils/timeUtils';\nimport { generateUUID } from '../../tools/utils/stringUtils';\nimport { SESSION_EXPIRATION_DELAY, SESSION_TIME_OUT_DELAY } from './sessionConstants';\nimport { isValidSessionString, SESSION_ENTRY_REGEXP, SESSION_ENTRY_SEPARATOR } from './sessionStateValidation';\nexport const EXPIRED = '1';\nexport function getExpiredSessionState(previousSessionState, configuration) {\n const expiredSessionState = {\n isExpired: EXPIRED,\n };\n if (configuration.trackAnonymousUser) {\n if (previousSessionState === null || previousSessionState === void 0 ? void 0 : previousSessionState.anonymousId) {\n expiredSessionState.anonymousId = previousSessionState === null || previousSessionState === void 0 ? void 0 : previousSessionState.anonymousId;\n }\n else {\n expiredSessionState.anonymousId = generateUUID();\n }\n }\n return expiredSessionState;\n}\nexport function isSessionInNotStartedState(session) {\n return isEmptyObject(session);\n}\nexport function isSessionStarted(session) {\n return !isSessionInNotStartedState(session);\n}\nexport function isSessionInExpiredState(session) {\n return session.isExpired !== undefined || !isActiveSession(session);\n}\n// An active session is a session in either `Tracked` or `NotTracked` state\nfunction isActiveSession(sessionState) {\n // created and expire can be undefined for versions which was not storing them\n // these checks could be removed when older versions will not be available/live anymore\n return ((sessionState.created === undefined || dateNow() - Number(sessionState.created) < SESSION_TIME_OUT_DELAY) &&\n (sessionState.expire === undefined || dateNow() < Number(sessionState.expire)));\n}\nexport function expandSessionState(session) {\n session.expire = String(dateNow() + SESSION_EXPIRATION_DELAY);\n}\nexport function toSessionString(session) {\n return (objectEntries(session)\n // we use `aid` as a key for anonymousId\n .map(([key, value]) => (key === 'anonymousId' ? `aid=${value}` : `${key}=${value}`))\n .join(SESSION_ENTRY_SEPARATOR));\n}\nexport function toSessionState(sessionString) {\n const session = {};\n if (isValidSessionString(sessionString)) {\n sessionString.split(SESSION_ENTRY_SEPARATOR).forEach((entry) => {\n const matches = SESSION_ENTRY_REGEXP.exec(entry);\n if (matches !== null) {\n const [, key, value] = matches;\n if (key === 'aid') {\n // we use `aid` as a key for anonymousId\n session.anonymousId = value;\n }\n else {\n session[key] = value;\n }\n }\n });\n }\n return session;\n}\n//# sourceMappingURL=sessionState.js.map","import { getInitCookie } from '../../browser/cookie';\nimport { SESSION_STORE_KEY } from './storeStrategies/sessionStoreStrategy';\nimport { expandSessionState, isSessionStarted } from './sessionState';\nexport const OLD_SESSION_COOKIE_NAME = '_dd';\nexport const OLD_RUM_COOKIE_NAME = '_dd_r';\nexport const OLD_LOGS_COOKIE_NAME = '_dd_l';\n// duplicate values to avoid dependency issues\nexport const RUM_SESSION_KEY = 'rum';\nexport const LOGS_SESSION_KEY = 'logs';\n/**\n * This migration should remain in the codebase as long as older versions are available/live\n * to allow older sdk versions to be upgraded to newer versions without compatibility issues.\n */\nexport function tryOldCookiesMigration(cookieStoreStrategy) {\n const sessionString = getInitCookie(SESSION_STORE_KEY);\n if (!sessionString) {\n const oldSessionId = getInitCookie(OLD_SESSION_COOKIE_NAME);\n const oldRumType = getInitCookie(OLD_RUM_COOKIE_NAME);\n const oldLogsType = getInitCookie(OLD_LOGS_COOKIE_NAME);\n const session = {};\n if (oldSessionId) {\n session.id = oldSessionId;\n }\n if (oldLogsType && /^[01]$/.test(oldLogsType)) {\n session[LOGS_SESSION_KEY] = oldLogsType;\n }\n if (oldRumType && /^[012]$/.test(oldRumType)) {\n session[RUM_SESSION_KEY] = oldRumType;\n }\n if (isSessionStarted(session)) {\n expandSessionState(session);\n cookieStoreStrategy.persistSession(session);\n }\n }\n}\n//# sourceMappingURL=oldCookiesMigration.js.map","import { isChromium } from '../../../tools/utils/browserDetection';\nimport { getCurrentSite, areCookiesAuthorized, getCookie, setCookie } from '../../../browser/cookie';\nimport { tryOldCookiesMigration } from '../oldCookiesMigration';\nimport { SESSION_COOKIE_EXPIRATION_DELAY, SESSION_EXPIRATION_DELAY, SESSION_TIME_OUT_DELAY, SessionPersistence, } from '../sessionConstants';\nimport { toSessionString, toSessionState, getExpiredSessionState } from '../sessionState';\nimport { SESSION_STORE_KEY } from './sessionStoreStrategy';\nexport function selectCookieStrategy(initConfiguration) {\n const cookieOptions = buildCookieOptions(initConfiguration);\n return areCookiesAuthorized(cookieOptions) ? { type: SessionPersistence.COOKIE, cookieOptions } : undefined;\n}\nexport function initCookieStrategy(configuration, cookieOptions) {\n const cookieStore = {\n /**\n * Lock strategy allows mitigating issues due to concurrent access to cookie.\n * This issue concerns only chromium browsers and enabling this on firefox increases cookie write failures.\n */\n isLockEnabled: isChromium(),\n persistSession: persistSessionCookie(cookieOptions),\n retrieveSession: retrieveSessionCookie,\n expireSession: (sessionState) => expireSessionCookie(cookieOptions, sessionState, configuration),\n };\n tryOldCookiesMigration(cookieStore);\n return cookieStore;\n}\nfunction persistSessionCookie(options) {\n return (session) => {\n setCookie(SESSION_STORE_KEY, toSessionString(session), SESSION_EXPIRATION_DELAY, options);\n };\n}\nfunction expireSessionCookie(options, sessionState, configuration) {\n const expiredSessionState = getExpiredSessionState(sessionState, configuration);\n // we do not extend cookie expiration date\n setCookie(SESSION_STORE_KEY, toSessionString(expiredSessionState), configuration.trackAnonymousUser ? SESSION_COOKIE_EXPIRATION_DELAY : SESSION_TIME_OUT_DELAY, options);\n}\nfunction retrieveSessionCookie() {\n const sessionString = getCookie(SESSION_STORE_KEY);\n const sessionState = toSessionState(sessionString);\n return sessionState;\n}\nexport function buildCookieOptions(initConfiguration) {\n const cookieOptions = {};\n cookieOptions.secure =\n !!initConfiguration.useSecureSessionCookie || !!initConfiguration.usePartitionedCrossSiteSessionCookie;\n cookieOptions.crossSite = !!initConfiguration.usePartitionedCrossSiteSessionCookie;\n cookieOptions.partitioned = !!initConfiguration.usePartitionedCrossSiteSessionCookie;\n if (initConfiguration.trackSessionAcrossSubdomains) {\n cookieOptions.domain = getCurrentSite();\n }\n return cookieOptions;\n}\n//# sourceMappingURL=sessionInCookie.js.map","import { generateUUID } from '../../../tools/utils/stringUtils';\nimport { SessionPersistence } from '../sessionConstants';\nimport { toSessionString, toSessionState, getExpiredSessionState } from '../sessionState';\nimport { SESSION_STORE_KEY } from './sessionStoreStrategy';\nconst LOCAL_STORAGE_TEST_KEY = '_dd_test_';\nexport function selectLocalStorageStrategy() {\n try {\n const id = generateUUID();\n const testKey = `${LOCAL_STORAGE_TEST_KEY}${id}`;\n localStorage.setItem(testKey, id);\n const retrievedId = localStorage.getItem(testKey);\n localStorage.removeItem(testKey);\n return id === retrievedId ? { type: SessionPersistence.LOCAL_STORAGE } : undefined;\n }\n catch (_a) {\n return undefined;\n }\n}\nexport function initLocalStorageStrategy(configuration) {\n return {\n isLockEnabled: false,\n persistSession: persistInLocalStorage,\n retrieveSession: retrieveSessionFromLocalStorage,\n expireSession: (sessionState) => expireSessionFromLocalStorage(sessionState, configuration),\n };\n}\nfunction persistInLocalStorage(sessionState) {\n localStorage.setItem(SESSION_STORE_KEY, toSessionString(sessionState));\n}\nfunction retrieveSessionFromLocalStorage() {\n const sessionString = localStorage.getItem(SESSION_STORE_KEY);\n return toSessionState(sessionString);\n}\nfunction expireSessionFromLocalStorage(previousSessionState, configuration) {\n persistInLocalStorage(getExpiredSessionState(previousSessionState, configuration));\n}\n//# sourceMappingURL=sessionInLocalStorage.js.map","import { setTimeout } from '../../tools/timer';\nimport { generateUUID } from '../../tools/utils/stringUtils';\nimport { expandSessionState, isSessionInExpiredState } from './sessionState';\nexport const LOCK_RETRY_DELAY = 10;\nexport const LOCK_MAX_TRIES = 100;\nconst bufferedOperations = [];\nlet ongoingOperations;\nexport function processSessionStoreOperations(operations, sessionStoreStrategy, numberOfRetries = 0) {\n var _a;\n const { isLockEnabled, persistSession, expireSession } = sessionStoreStrategy;\n const persistWithLock = (session) => persistSession({ ...session, lock: currentLock });\n const retrieveStore = () => {\n const session = sessionStoreStrategy.retrieveSession();\n const lock = session.lock;\n if (session.lock) {\n delete session.lock;\n }\n return {\n session,\n lock,\n };\n };\n if (!ongoingOperations) {\n ongoingOperations = operations;\n }\n if (operations !== ongoingOperations) {\n bufferedOperations.push(operations);\n return;\n }\n if (isLockEnabled && numberOfRetries >= LOCK_MAX_TRIES) {\n next(sessionStoreStrategy);\n return;\n }\n let currentLock;\n let currentStore = retrieveStore();\n if (isLockEnabled) {\n // if someone has lock, retry later\n if (currentStore.lock) {\n retryLater(operations, sessionStoreStrategy, numberOfRetries);\n return;\n }\n // acquire lock\n currentLock = generateUUID();\n persistWithLock(currentStore.session);\n // if lock is not acquired, retry later\n currentStore = retrieveStore();\n if (currentStore.lock !== currentLock) {\n retryLater(operations, sessionStoreStrategy, numberOfRetries);\n return;\n }\n }\n let processedSession = operations.process(currentStore.session);\n if (isLockEnabled) {\n // if lock corrupted after process, retry later\n currentStore = retrieveStore();\n if (currentStore.lock !== currentLock) {\n retryLater(operations, sessionStoreStrategy, numberOfRetries);\n return;\n }\n }\n if (processedSession) {\n if (isSessionInExpiredState(processedSession)) {\n expireSession(processedSession);\n }\n else {\n expandSessionState(processedSession);\n if (isLockEnabled) {\n persistWithLock(processedSession);\n }\n else {\n persistSession(processedSession);\n }\n }\n }\n if (isLockEnabled) {\n // correctly handle lock around expiration would require to handle this case properly at several levels\n // since we don't have evidence of lock issues around expiration, let's just not do the corruption check for it\n if (!(processedSession && isSessionInExpiredState(processedSession))) {\n // if lock corrupted after persist, retry later\n currentStore = retrieveStore();\n if (currentStore.lock !== currentLock) {\n retryLater(operations, sessionStoreStrategy, numberOfRetries);\n return;\n }\n persistSession(currentStore.session);\n processedSession = currentStore.session;\n }\n }\n // call after even if session is not persisted in order to perform operations on\n // up-to-date session state value => the value could have been modified by another tab\n (_a = operations.after) === null || _a === void 0 ? void 0 : _a.call(operations, processedSession || currentStore.session);\n next(sessionStoreStrategy);\n}\nfunction retryLater(operations, sessionStore, currentNumberOfRetries) {\n setTimeout(() => {\n processSessionStoreOperations(operations, sessionStore, currentNumberOfRetries + 1);\n }, LOCK_RETRY_DELAY);\n}\nfunction next(sessionStore) {\n ongoingOperations = undefined;\n const nextOperations = bufferedOperations.shift();\n if (nextOperations) {\n processSessionStoreOperations(nextOperations, sessionStore);\n }\n}\n//# sourceMappingURL=sessionStoreOperations.js.map","import { clearInterval, setInterval } from '../../tools/timer';\nimport { Observable } from '../../tools/observable';\nimport { ONE_SECOND, dateNow } from '../../tools/utils/timeUtils';\nimport { throttle } from '../../tools/utils/functionUtils';\nimport { generateUUID } from '../../tools/utils/stringUtils';\nimport { display } from '../../tools/display';\nimport { selectCookieStrategy, initCookieStrategy } from './storeStrategies/sessionInCookie';\nimport { getExpiredSessionState, isSessionInExpiredState, isSessionInNotStartedState, isSessionStarted, } from './sessionState';\nimport { initLocalStorageStrategy, selectLocalStorageStrategy } from './storeStrategies/sessionInLocalStorage';\nimport { processSessionStoreOperations } from './sessionStoreOperations';\nimport { SessionPersistence } from './sessionConstants';\n/**\n * Every second, the storage will be polled to check for any change that can occur\n * to the session state in another browser tab, or another window.\n * This value has been determined from our previous cookie-only implementation.\n */\nexport const STORAGE_POLL_DELAY = ONE_SECOND;\n/**\n * Selects the correct session store strategy type based on the configuration and storage\n * availability.\n */\nexport function selectSessionStoreStrategyType(initConfiguration) {\n switch (initConfiguration.sessionPersistence) {\n case SessionPersistence.COOKIE:\n return selectCookieStrategy(initConfiguration);\n case SessionPersistence.LOCAL_STORAGE:\n return selectLocalStorageStrategy();\n case undefined: {\n let sessionStoreStrategyType = selectCookieStrategy(initConfiguration);\n if (!sessionStoreStrategyType && initConfiguration.allowFallbackToLocalStorage) {\n sessionStoreStrategyType = selectLocalStorageStrategy();\n }\n return sessionStoreStrategyType;\n }\n default:\n display.error(`Invalid session persistence '${String(initConfiguration.sessionPersistence)}'`);\n }\n}\n/**\n * Different session concepts:\n * - tracked, the session has an id and is updated along the user navigation\n * - not tracked, the session does not have an id but it is updated along the user navigation\n * - inactive, no session in store or session expired, waiting for a renew session\n */\nexport function startSessionStore(sessionStoreStrategyType, configuration, productKey, computeSessionState) {\n const renewObservable = new Observable();\n const expireObservable = new Observable();\n const sessionStateUpdateObservable = new Observable();\n const sessionStoreStrategy = sessionStoreStrategyType.type === SessionPersistence.COOKIE\n ? initCookieStrategy(configuration, sessionStoreStrategyType.cookieOptions)\n : initLocalStorageStrategy(configuration);\n const { expireSession } = sessionStoreStrategy;\n const watchSessionTimeoutId = setInterval(watchSession, STORAGE_POLL_DELAY);\n let sessionCache;\n startSession();\n const { throttled: throttledExpandOrRenewSession, cancel: cancelExpandOrRenewSession } = throttle(() => {\n processSessionStoreOperations({\n process: (sessionState) => {\n if (isSessionInNotStartedState(sessionState)) {\n return;\n }\n const synchronizedSession = synchronizeSession(sessionState);\n expandOrRenewSessionState(synchronizedSession);\n return synchronizedSession;\n },\n after: (sessionState) => {\n if (isSessionStarted(sessionState) && !hasSessionInCache()) {\n renewSessionInCache(sessionState);\n }\n sessionCache = sessionState;\n },\n }, sessionStoreStrategy);\n }, STORAGE_POLL_DELAY);\n function expandSession() {\n processSessionStoreOperations({\n process: (sessionState) => (hasSessionInCache() ? synchronizeSession(sessionState) : undefined),\n }, sessionStoreStrategy);\n }\n /**\n * allows two behaviors:\n * - if the session is active, synchronize the session cache without updating the session store\n * - if the session is not active, clear the session store and expire the session cache\n */\n function watchSession() {\n processSessionStoreOperations({\n process: (sessionState) => isSessionInExpiredState(sessionState) ? getExpiredSessionState(sessionState, configuration) : undefined,\n after: synchronizeSession,\n }, sessionStoreStrategy);\n }\n function synchronizeSession(sessionState) {\n if (isSessionInExpiredState(sessionState)) {\n sessionState = getExpiredSessionState(sessionState, configuration);\n }\n if (hasSessionInCache()) {\n if (isSessionInCacheOutdated(sessionState)) {\n expireSessionInCache();\n }\n else {\n sessionStateUpdateObservable.notify({ previousState: sessionCache, newState: sessionState });\n sessionCache = sessionState;\n }\n }\n return sessionState;\n }\n function startSession() {\n processSessionStoreOperations({\n process: (sessionState) => {\n if (isSessionInNotStartedState(sessionState)) {\n return getExpiredSessionState(sessionState, configuration);\n }\n },\n after: (sessionState) => {\n sessionCache = sessionState;\n },\n }, sessionStoreStrategy);\n }\n function expandOrRenewSessionState(sessionState) {\n if (isSessionInNotStartedState(sessionState)) {\n return false;\n }\n const { trackingType, isTracked } = computeSessionState(sessionState[productKey]);\n sessionState[productKey] = trackingType;\n delete sessionState.isExpired;\n if (isTracked && !sessionState.id) {\n sessionState.id = generateUUID();\n sessionState.created = String(dateNow());\n }\n }\n function hasSessionInCache() {\n return sessionCache[productKey] !== undefined;\n }\n function isSessionInCacheOutdated(sessionState) {\n return sessionCache.id !== sessionState.id || sessionCache[productKey] !== sessionState[productKey];\n }\n function expireSessionInCache() {\n sessionCache = getExpiredSessionState(sessionCache, configuration);\n expireObservable.notify();\n }\n function renewSessionInCache(sessionState) {\n sessionCache = sessionState;\n renewObservable.notify();\n }\n function updateSessionState(partialSessionState) {\n processSessionStoreOperations({\n process: (sessionState) => ({ ...sessionState, ...partialSessionState }),\n after: synchronizeSession,\n }, sessionStoreStrategy);\n }\n return {\n expandOrRenewSession: throttledExpandOrRenewSession,\n expandSession,\n getSession: () => sessionCache,\n renewObservable,\n expireObservable,\n sessionStateUpdateObservable,\n restartSession: startSession,\n expire: () => {\n cancelExpandOrRenewSession();\n expireSession(sessionCache);\n synchronizeSession(getExpiredSessionState(sessionCache, configuration));\n },\n stop: () => {\n clearInterval(watchSessionTimeoutId);\n },\n updateSessionState,\n };\n}\n//# sourceMappingURL=sessionStore.js.map","import { Observable } from '../tools/observable';\nexport const TrackingConsent = {\n GRANTED: 'granted',\n NOT_GRANTED: 'not-granted',\n};\nexport function createTrackingConsentState(currentConsent) {\n const observable = new Observable();\n return {\n tryToInit(trackingConsent) {\n if (!currentConsent) {\n currentConsent = trackingConsent;\n }\n },\n update(trackingConsent) {\n currentConsent = trackingConsent;\n observable.notify();\n },\n isGranted() {\n return currentConsent === TrackingConsent.GRANTED;\n },\n observable,\n };\n}\n//# sourceMappingURL=trackingConsent.js.map","import { noop } from '../utils/functionUtils';\n/**\n * Custom implementation of JSON.stringify that ignores some toJSON methods. We need to do that\n * because some sites badly override toJSON on certain objects. Removing all toJSON methods from\n * nested values would be too costly, so we just detach them from the root value, and native classes\n * used to build JSON values (Array and Object).\n *\n * Note: this still assumes that JSON.stringify is correct.\n */\nexport function jsonStringify(value, replacer, space) {\n if (typeof value !== 'object' || value === null) {\n return JSON.stringify(value);\n }\n // Note: The order matter here. We need to detach toJSON methods on parent classes before their\n // subclasses.\n const restoreObjectPrototypeToJson = detachToJsonMethod(Object.prototype);\n const restoreArrayPrototypeToJson = detachToJsonMethod(Array.prototype);\n const restoreValuePrototypeToJson = detachToJsonMethod(Object.getPrototypeOf(value));\n const restoreValueToJson = detachToJsonMethod(value);\n try {\n return JSON.stringify(value, replacer, space);\n }\n catch (_a) {\n return '';\n }\n finally {\n restoreObjectPrototypeToJson();\n restoreArrayPrototypeToJson();\n restoreValuePrototypeToJson();\n restoreValueToJson();\n }\n}\nexport function detachToJsonMethod(value) {\n const object = value;\n const objectToJson = object.toJSON;\n if (objectToJson) {\n delete object.toJSON;\n return () => {\n object.toJSON = objectToJson;\n };\n }\n return noop;\n}\n//# sourceMappingURL=jsonStringify.js.map","import { jsonStringify } from '../serialisation/jsonStringify';\nexport function normalizeUrl(url) {\n return buildUrl(url, location.href).href;\n}\nexport function isValidUrl(url) {\n try {\n return !!buildUrl(url);\n }\n catch (_a) {\n return false;\n }\n}\nexport function getPathName(url) {\n const pathname = buildUrl(url).pathname;\n return pathname[0] === '/' ? pathname : `/${pathname}`;\n}\nexport function buildUrl(url, base) {\n const supportedURL = getSupportedUrl();\n if (supportedURL) {\n try {\n return base !== undefined ? new supportedURL(url, base) : new supportedURL(url);\n }\n catch (error) {\n throw new Error(`Failed to construct URL: ${String(error)} ${jsonStringify({ url, base })}`);\n }\n }\n if (base === undefined && !/:/.test(url)) {\n throw new Error(`Invalid URL: '${url}'`);\n }\n let doc = document;\n const anchorElement = doc.createElement('a');\n if (base !== undefined) {\n doc = document.implementation.createHTMLDocument('');\n const baseElement = doc.createElement('base');\n baseElement.href = base;\n doc.head.appendChild(baseElement);\n doc.body.appendChild(anchorElement);\n }\n anchorElement.href = url;\n return anchorElement;\n}\nconst originalURL = URL;\nlet isURLSupported;\nfunction getSupportedUrl() {\n if (isURLSupported === undefined) {\n try {\n const url = new originalURL('http://test/path');\n isURLSupported = url.href === 'http://test/path';\n }\n catch (_a) {\n isURLSupported = false;\n }\n }\n return isURLSupported ? originalURL : undefined;\n}\n//# sourceMappingURL=urlPolyfill.js.map","export const INTAKE_SITE_STAGING = 'datad0g.com';\nexport const INTAKE_SITE_FED_STAGING = 'dd0g-gov.com';\nexport const INTAKE_SITE_US1 = 'datadoghq.com';\nexport const INTAKE_SITE_EU1 = 'datadoghq.eu';\nexport const INTAKE_SITE_US1_FED = 'ddog-gov.com';\nexport const PCI_INTAKE_HOST_US1 = 'pci.browser-intake-datadoghq.com';\nexport const INTAKE_URL_PARAMETERS = ['ddsource', 'ddtags'];\n//# sourceMappingURL=intakeSites.js.map","import { timeStampNow } from '../../tools/utils/timeUtils';\nimport { normalizeUrl } from '../../tools/utils/urlPolyfill';\nimport { generateUUID } from '../../tools/utils/stringUtils';\nimport { INTAKE_SITE_US1, INTAKE_SITE_FED_STAGING, PCI_INTAKE_HOST_US1 } from './intakeSites';\nexport function createEndpointBuilder(initConfiguration, trackType, configurationTags) {\n const buildUrlWithParameters = createEndpointUrlWithParametersBuilder(initConfiguration, trackType);\n return {\n build(api, payload) {\n const parameters = buildEndpointParameters(initConfiguration, trackType, configurationTags, api, payload);\n return buildUrlWithParameters(parameters);\n },\n tags: configurationTags,\n urlPrefix: buildUrlWithParameters(''),\n trackType,\n };\n}\n/**\n * Create a function used to build a full endpoint url from provided parameters. The goal of this\n * function is to pre-compute some parts of the URL to avoid re-computing everything on every\n * request, as only parameters are changing.\n */\nfunction createEndpointUrlWithParametersBuilder(initConfiguration, trackType) {\n const path = `/api/v2/${trackType}`;\n const proxy = initConfiguration.proxy;\n if (typeof proxy === 'string') {\n const normalizedProxyUrl = normalizeUrl(proxy);\n return (parameters) => `${normalizedProxyUrl}?ddforward=${encodeURIComponent(`${path}?${parameters}`)}`;\n }\n if (typeof proxy === 'function') {\n return (parameters) => proxy({ path, parameters });\n }\n const host = buildEndpointHost(trackType, initConfiguration);\n return (parameters) => `https://${host}${path}?${parameters}`;\n}\nexport function buildEndpointHost(trackType, initConfiguration) {\n const { site = INTAKE_SITE_US1, internalAnalyticsSubdomain } = initConfiguration;\n if (trackType === 'logs' && initConfiguration.usePciIntake && site === INTAKE_SITE_US1) {\n return PCI_INTAKE_HOST_US1;\n }\n if (internalAnalyticsSubdomain && site === INTAKE_SITE_US1) {\n return `${internalAnalyticsSubdomain}.${INTAKE_SITE_US1}`;\n }\n if (site === INTAKE_SITE_FED_STAGING) {\n return `http-intake.logs.${site}`;\n }\n const domainParts = site.split('.');\n const extension = domainParts.pop();\n return `browser-intake-${domainParts.join('-')}.${extension}`;\n}\n/**\n * Build parameters to be used for an intake request. Parameters should be re-built for each\n * request, as they change randomly.\n */\nfunction buildEndpointParameters({ clientToken, internalAnalyticsSubdomain }, trackType, configurationTags, api, { retry, encoding }) {\n const tags = [`sdk_version:${\"6.6.1\"}`, `api:${api}`].concat(configurationTags);\n if (retry) {\n tags.push(`retry_count:${retry.count}`, `retry_after:${retry.lastFailureStatus}`);\n }\n const parameters = [\n 'ddsource=browser',\n `ddtags=${encodeURIComponent(tags.join(','))}`,\n `dd-api-key=${clientToken}`,\n `dd-evp-origin-version=${encodeURIComponent(\"6.6.1\")}`,\n 'dd-evp-origin=browser',\n `dd-request-id=${generateUUID()}`,\n ];\n if (encoding) {\n parameters.push(`dd-evp-encoding=${encoding}`);\n }\n if (trackType === 'rum') {\n parameters.push(`batch_time=${timeStampNow()}`);\n }\n if (internalAnalyticsSubdomain) {\n parameters.reverse();\n }\n return parameters.join('&');\n}\n//# sourceMappingURL=endpointBuilder.js.map","import { DOCS_ORIGIN, MORE_DETAILS, display } from '../../tools/display';\nexport const TAG_SIZE_LIMIT = 200;\nexport function buildTags(configuration) {\n const { env, service, version, datacenter } = configuration;\n const tags = [];\n if (env) {\n tags.push(buildTag('env', env));\n }\n if (service) {\n tags.push(buildTag('service', service));\n }\n if (version) {\n tags.push(buildTag('version', version));\n }\n if (datacenter) {\n tags.push(buildTag('datacenter', datacenter));\n }\n return tags;\n}\nexport function buildTag(key, rawValue) {\n // See https://docs.datadoghq.com/getting_started/tagging/#defining-tags for tags syntax. Note\n // that the backend may not follow the exact same rules, so we only want to display an informal\n // warning.\n const valueSizeLimit = TAG_SIZE_LIMIT - key.length - 1;\n if (rawValue.length > valueSizeLimit || hasForbiddenCharacters(rawValue)) {\n display.warn(`${key} value doesn't meet tag requirements and will be sanitized. ${MORE_DETAILS} ${DOCS_ORIGIN}/getting_started/tagging/#defining-tags`);\n }\n // Let the backend do most of the sanitization, but still make sure multiple tags can't be crafted\n // by forging a value containing commas.\n const sanitizedValue = rawValue.replace(/,/g, '_');\n return `${key}:${sanitizedValue}`;\n}\nfunction hasForbiddenCharacters(rawValue) {\n // Unicode property escapes is not supported in all browsers, so we use a try/catch.\n // Todo: Remove the try/catch when dropping support for Chrome 63 and Firefox 67\n // see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Unicode_character_class_escape#browser_compatibility\n if (!supportUnicodePropertyEscapes()) {\n return false;\n }\n // We use the Unicode property escapes to match any character that is a letter including other languages like Chinese, Japanese, etc.\n // p{Ll} matches a lowercase letter.\n // p{Lo} matches a letter that is neither uppercase nor lowercase (ex: Japanese characters).\n // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Unicode_character_class_escape#unicode_property_escapes_vs._character_classes\n return new RegExp('[^\\\\p{Ll}\\\\p{Lo}0-9_:./-]', 'u').test(rawValue);\n}\nexport function supportUnicodePropertyEscapes() {\n try {\n new RegExp('[\\\\p{Ll}]', 'u');\n return true;\n }\n catch (_a) {\n return false;\n }\n}\n//# sourceMappingURL=tags.js.map","import { createEndpointBuilder } from './endpointBuilder';\nimport { buildTags } from './tags';\nimport { INTAKE_SITE_US1, INTAKE_URL_PARAMETERS } from './intakeSites';\nexport function computeTransportConfiguration(initConfiguration) {\n const site = initConfiguration.site || INTAKE_SITE_US1;\n const tags = buildTags(initConfiguration);\n const endpointBuilders = computeEndpointBuilders(initConfiguration, tags);\n const replicaConfiguration = computeReplicaConfiguration(initConfiguration, tags);\n return {\n replica: replicaConfiguration,\n site,\n ...endpointBuilders,\n };\n}\nfunction computeEndpointBuilders(initConfiguration, tags) {\n return {\n logsEndpointBuilder: createEndpointBuilder(initConfiguration, 'logs', tags),\n rumEndpointBuilder: createEndpointBuilder(initConfiguration, 'rum', tags),\n profilingEndpointBuilder: createEndpointBuilder(initConfiguration, 'profile', tags),\n sessionReplayEndpointBuilder: createEndpointBuilder(initConfiguration, 'replay', tags),\n };\n}\nfunction computeReplicaConfiguration(initConfiguration, tags) {\n if (!initConfiguration.replica) {\n return;\n }\n const replicaConfiguration = {\n ...initConfiguration,\n site: INTAKE_SITE_US1,\n clientToken: initConfiguration.replica.clientToken,\n };\n const replicaEndpointBuilders = {\n logsEndpointBuilder: createEndpointBuilder(replicaConfiguration, 'logs', tags),\n rumEndpointBuilder: createEndpointBuilder(replicaConfiguration, 'rum', tags),\n };\n return { applicationId: initConfiguration.replica.applicationId, ...replicaEndpointBuilders };\n}\nexport function isIntakeUrl(url) {\n // check if tags is present in the query string\n return INTAKE_URL_PARAMETERS.every((param) => url.includes(param));\n}\n//# sourceMappingURL=transportConfiguration.js.map","import { catchUserErrors } from '../../tools/catchUserErrors';\nimport { DOCS_ORIGIN, MORE_DETAILS, display } from '../../tools/display';\nimport { ONE_SECOND } from '../../tools/utils/timeUtils';\nimport { isPercentage } from '../../tools/utils/numberUtils';\nimport { ONE_KIBI_BYTE } from '../../tools/utils/byteUtils';\nimport { objectHasValue } from '../../tools/utils/objectUtils';\nimport { selectSessionStoreStrategyType } from '../session/sessionStore';\nimport { TrackingConsent } from '../trackingConsent';\nimport { computeTransportConfiguration } from './transportConfiguration';\nexport const DefaultPrivacyLevel = {\n ALLOW: 'allow',\n MASK: 'mask',\n MASK_USER_INPUT: 'mask-user-input',\n};\nexport const TraceContextInjection = {\n ALL: 'all',\n SAMPLED: 'sampled',\n};\nfunction isString(tag, tagName) {\n if (tag !== undefined && tag !== null && typeof tag !== 'string') {\n display.error(`${tagName} must be defined as a string`);\n return false;\n }\n return true;\n}\nfunction isDatadogSite(site) {\n if (site && typeof site === 'string' && !/(datadog|ddog|datad0g|dd0g)/.test(site)) {\n display.error(`Site should be a valid Datadog site. ${MORE_DETAILS} ${DOCS_ORIGIN}/getting_started/site/.`);\n return false;\n }\n return true;\n}\nexport function isSampleRate(sampleRate, name) {\n if (sampleRate !== undefined && !isPercentage(sampleRate)) {\n display.error(`${name} Sample Rate should be a number between 0 and 100`);\n return false;\n }\n return true;\n}\nexport function validateAndBuildConfiguration(initConfiguration) {\n var _a, _b, _c, _d, _e, _f;\n if (!initConfiguration || !initConfiguration.clientToken) {\n display.error('Client Token is not configured, we will not send any data.');\n return;\n }\n if (!isDatadogSite(initConfiguration.site) ||\n !isSampleRate(initConfiguration.sessionSampleRate, 'Session') ||\n !isSampleRate(initConfiguration.telemetrySampleRate, 'Telemetry') ||\n !isSampleRate(initConfiguration.telemetryConfigurationSampleRate, 'Telemetry Configuration') ||\n !isSampleRate(initConfiguration.telemetryUsageSampleRate, 'Telemetry Usage') ||\n !isString(initConfiguration.version, 'Version') ||\n !isString(initConfiguration.env, 'Env') ||\n !isString(initConfiguration.service, 'Service')) {\n return;\n }\n if (initConfiguration.trackingConsent !== undefined &&\n !objectHasValue(TrackingConsent, initConfiguration.trackingConsent)) {\n display.error('Tracking Consent should be either \"granted\" or \"not-granted\"');\n return;\n }\n return {\n beforeSend: initConfiguration.beforeSend && catchUserErrors(initConfiguration.beforeSend, 'beforeSend threw an error:'),\n sessionStoreStrategyType: selectSessionStoreStrategyType(initConfiguration),\n sessionSampleRate: (_a = initConfiguration.sessionSampleRate) !== null && _a !== void 0 ? _a : 100,\n telemetrySampleRate: (_b = initConfiguration.telemetrySampleRate) !== null && _b !== void 0 ? _b : 20,\n telemetryConfigurationSampleRate: (_c = initConfiguration.telemetryConfigurationSampleRate) !== null && _c !== void 0 ? _c : 5,\n telemetryUsageSampleRate: (_d = initConfiguration.telemetryUsageSampleRate) !== null && _d !== void 0 ? _d : 5,\n service: initConfiguration.service || undefined,\n silentMultipleInit: !!initConfiguration.silentMultipleInit,\n allowUntrustedEvents: !!initConfiguration.allowUntrustedEvents,\n trackingConsent: (_e = initConfiguration.trackingConsent) !== null && _e !== void 0 ? _e : TrackingConsent.GRANTED,\n trackAnonymousUser: (_f = initConfiguration.trackAnonymousUser) !== null && _f !== void 0 ? _f : true,\n storeContextsAcrossPages: !!initConfiguration.storeContextsAcrossPages,\n /**\n * beacon payload max queue size implementation is 64kb\n * ensure that we leave room for logs, rum and potential other users\n */\n batchBytesLimit: 16 * ONE_KIBI_BYTE,\n eventRateLimiterThreshold: 3000,\n maxTelemetryEventsPerPage: 15,\n /**\n * flush automatically, aim to be lower than ALB connection timeout\n * to maximize connection reuse.\n */\n flushTimeout: (30 * ONE_SECOND),\n /**\n * Logs intake limit\n */\n batchMessagesLimit: 50,\n messageBytesLimit: 256 * ONE_KIBI_BYTE,\n ...computeTransportConfiguration(initConfiguration),\n };\n}\nexport function serializeConfiguration(initConfiguration) {\n return {\n session_sample_rate: initConfiguration.sessionSampleRate,\n telemetry_sample_rate: initConfiguration.telemetrySampleRate,\n telemetry_configuration_sample_rate: initConfiguration.telemetryConfigurationSampleRate,\n telemetry_usage_sample_rate: initConfiguration.telemetryUsageSampleRate,\n use_before_send: !!initConfiguration.beforeSend,\n use_partitioned_cross_site_session_cookie: initConfiguration.usePartitionedCrossSiteSessionCookie,\n use_secure_session_cookie: initConfiguration.useSecureSessionCookie,\n use_proxy: !!initConfiguration.proxy,\n silent_multiple_init: initConfiguration.silentMultipleInit,\n track_session_across_subdomains: initConfiguration.trackSessionAcrossSubdomains,\n track_anonymous_user: initConfiguration.trackAnonymousUser,\n session_persistence: initConfiguration.sessionPersistence,\n allow_fallback_to_local_storage: !!initConfiguration.allowFallbackToLocalStorage,\n store_contexts_across_pages: !!initConfiguration.storeContextsAcrossPages,\n allow_untrusted_events: !!initConfiguration.allowUntrustedEvents,\n tracking_consent: initConfiguration.trackingConsent,\n };\n}\n//# sourceMappingURL=configuration.js.map","/**\n * LIMITATION:\n * For NPM setup, this feature flag singleton is shared between RUM and Logs product.\n * This means that an experimental flag set on the RUM product will be set on the Logs product.\n * So keep in mind that in certain configurations, your experimental feature flag may affect other products.\n *\n * FORMAT:\n * All feature flags should be snake_cased\n */\n// We want to use a real enum (i.e. not a const enum) here, to be able to check whether an arbitrary\n// string is an expected feature flag\nimport { objectHasValue } from './utils/objectUtils';\n// eslint-disable-next-line no-restricted-syntax\nexport var ExperimentalFeature;\n(function (ExperimentalFeature) {\n ExperimentalFeature[\"WRITABLE_RESOURCE_GRAPHQL\"] = \"writable_resource_graphql\";\n ExperimentalFeature[\"MISSING_URL_CONTEXT_TELEMETRY\"] = \"missing_url_context_telemetry\";\n ExperimentalFeature[\"USER_ACCOUNT_TRACE_HEADER\"] = \"user_account_trace_header\";\n ExperimentalFeature[\"PROFILING\"] = \"profiling\";\n})(ExperimentalFeature || (ExperimentalFeature = {}));\nconst enabledExperimentalFeatures = new Set();\nexport function initFeatureFlags(enableExperimentalFeatures) {\n if (Array.isArray(enableExperimentalFeatures)) {\n addExperimentalFeatures(enableExperimentalFeatures.filter((flag) => objectHasValue(ExperimentalFeature, flag)));\n }\n}\nexport function addExperimentalFeatures(enabledFeatures) {\n enabledFeatures.forEach((flag) => {\n enabledExperimentalFeatures.add(flag);\n });\n}\nexport function isExperimentalFeatureEnabled(featureName) {\n return enabledExperimentalFeatures.has(featureName);\n}\nexport function resetExperimentalFeatures() {\n enabledExperimentalFeatures.clear();\n}\nexport function getExperimentalFeatures() {\n return enabledExperimentalFeatures;\n}\n//# sourceMappingURL=experimentalFeatures.js.map","/**\n * Cross-browser stack trace computation.\n *\n * Reference implementation: https://github.com/csnover/TraceKit/blob/04530298073c3823de72deb0b97e7b38ca7bcb59/tracekit.js\n */\nconst UNKNOWN_FUNCTION = '?';\nexport function computeStackTrace(ex) {\n const stack = [];\n let stackProperty = tryToGetString(ex, 'stack');\n const exString = String(ex);\n if (stackProperty && stackProperty.startsWith(exString)) {\n stackProperty = stackProperty.slice(exString.length);\n }\n if (stackProperty) {\n stackProperty.split('\\n').forEach((line) => {\n const stackFrame = parseChromeLine(line) || parseChromeAnonymousLine(line) || parseWinLine(line) || parseGeckoLine(line);\n if (stackFrame) {\n if (!stackFrame.func && stackFrame.line) {\n stackFrame.func = UNKNOWN_FUNCTION;\n }\n stack.push(stackFrame);\n }\n });\n }\n return {\n message: tryToGetString(ex, 'message'),\n name: tryToGetString(ex, 'name'),\n stack,\n };\n}\nconst fileUrl = '((?:file|https?|blob|chrome-extension|electron|native|eval|webpack|snippet||\\\\w+\\\\.|\\\\/).*?)';\nconst filePosition = '(?::(\\\\d+))';\nconst CHROME_LINE_RE = new RegExp(`^\\\\s*at (.*?) ?\\\\(${fileUrl}${filePosition}?${filePosition}?\\\\)?\\\\s*$`, 'i');\nconst CHROME_EVAL_RE = new RegExp(`\\\\((\\\\S*)${filePosition}${filePosition}\\\\)`);\nfunction parseChromeLine(line) {\n const parts = CHROME_LINE_RE.exec(line);\n if (!parts) {\n return;\n }\n const isNative = parts[2] && parts[2].indexOf('native') === 0; // start of line\n const isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line\n const submatch = CHROME_EVAL_RE.exec(parts[2]);\n if (isEval && submatch) {\n // throw out eval line/column and use top-most line/column number\n parts[2] = submatch[1]; // url\n parts[3] = submatch[2]; // line\n parts[4] = submatch[3]; // column\n }\n return {\n args: isNative ? [parts[2]] : [],\n column: parts[4] ? +parts[4] : undefined,\n func: parts[1] || UNKNOWN_FUNCTION,\n line: parts[3] ? +parts[3] : undefined,\n url: !isNative ? parts[2] : undefined,\n };\n}\nconst CHROME_ANONYMOUS_FUNCTION_RE = new RegExp(`^\\\\s*at ?${fileUrl}${filePosition}?${filePosition}??\\\\s*$`, 'i');\nfunction parseChromeAnonymousLine(line) {\n const parts = CHROME_ANONYMOUS_FUNCTION_RE.exec(line);\n if (!parts) {\n return;\n }\n return {\n args: [],\n column: parts[3] ? +parts[3] : undefined,\n func: UNKNOWN_FUNCTION,\n line: parts[2] ? +parts[2] : undefined,\n url: parts[1],\n };\n}\nconst WINJS_LINE_RE = /^\\s*at (?:((?:\\[object object\\])?.+) )?\\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\\d+)(?::(\\d+))?\\)?\\s*$/i;\nfunction parseWinLine(line) {\n const parts = WINJS_LINE_RE.exec(line);\n if (!parts) {\n return;\n }\n return {\n args: [],\n column: parts[4] ? +parts[4] : undefined,\n func: parts[1] || UNKNOWN_FUNCTION,\n line: +parts[3],\n url: parts[2],\n };\n}\nconst GECKO_LINE_RE = /^\\s*(.*?)(?:\\((.*?)\\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\\[native).*?|[^@]*bundle)(?::(\\d+))?(?::(\\d+))?\\s*$/i;\nconst GECKO_EVAL_RE = /(\\S+) line (\\d+)(?: > eval line \\d+)* > eval/i;\nfunction parseGeckoLine(line) {\n const parts = GECKO_LINE_RE.exec(line);\n if (!parts) {\n return;\n }\n const isEval = parts[3] && parts[3].indexOf(' > eval') > -1;\n const submatch = GECKO_EVAL_RE.exec(parts[3]);\n if (isEval && submatch) {\n // throw out eval line/column and use top-most line number\n parts[3] = submatch[1];\n parts[4] = submatch[2];\n parts[5] = undefined; // no column when eval\n }\n return {\n args: parts[2] ? parts[2].split(',') : [],\n column: parts[5] ? +parts[5] : undefined,\n func: parts[1] || UNKNOWN_FUNCTION,\n line: parts[4] ? +parts[4] : undefined,\n url: parts[3],\n };\n}\nfunction tryToGetString(candidate, property) {\n if (typeof candidate !== 'object' || !candidate || !(property in candidate)) {\n return undefined;\n }\n const value = candidate[property];\n return typeof value === 'string' ? value : undefined;\n}\nexport function computeStackTraceFromOnErrorMessage(messageObj, url, line, column) {\n const stack = [{ url, column, line }];\n const { name, message } = tryToParseMessage(messageObj);\n return {\n name,\n message,\n stack,\n };\n}\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Error_types\nconst ERROR_TYPES_RE = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?([\\s\\S]*)$/;\nfunction tryToParseMessage(messageObj) {\n let name;\n let message;\n if ({}.toString.call(messageObj) === '[object String]') {\n ;\n [, name, message] = ERROR_TYPES_RE.exec(messageObj);\n }\n return { name, message };\n}\n//# sourceMappingURL=computeStackTrace.js.map","import { callMonitored } from '../monitor';\nimport { computeStackTrace } from './computeStackTrace';\n/**\n * Creates a stacktrace without SDK internal frames.\n * Constraints:\n * - Has to be called at the utmost position of the call stack.\n * - No monitored function should encapsulate it, that is why we need to use callMonitored inside it.\n */\nexport function createHandlingStack(type) {\n /**\n * Skip the two internal frames:\n * - SDK API (console.error, ...)\n * - this function\n * in order to keep only the user calls\n */\n const internalFramesToSkip = 2;\n const error = new Error(type);\n error.name = 'HandlingStack';\n let formattedStack;\n callMonitored(() => {\n const stackTrace = computeStackTrace(error);\n stackTrace.stack = stackTrace.stack.slice(internalFramesToSkip);\n formattedStack = toStackTraceString(stackTrace);\n });\n return formattedStack;\n}\nexport function toStackTraceString(stack) {\n let result = formatErrorMessage(stack);\n stack.stack.forEach((frame) => {\n const func = frame.func === '?' ? '' : frame.func;\n const args = frame.args && frame.args.length > 0 ? `(${frame.args.join(', ')})` : '';\n const line = frame.line ? `:${frame.line}` : '';\n const column = frame.line && frame.column ? `:${frame.column}` : '';\n result += `\\n at ${func}${args} @ ${frame.url}${line}${column}`;\n });\n return result;\n}\nexport function formatErrorMessage(stack) {\n return `${stack.name || 'Error'}: ${stack.message}`;\n}\n//# sourceMappingURL=handlingStack.js.map","import { setTimeout } from './timer';\nimport { callMonitored } from './monitor';\nimport { noop } from './utils/functionUtils';\nimport { createHandlingStack } from './stackTrace/handlingStack';\n/**\n * Instruments a method on a object, calling the given callback before the original method is\n * invoked. The callback receives an object with information about the method call.\n *\n * This function makes sure that we are \"good citizens\" regarding third party instrumentations: when\n * removing the instrumentation, the original method is usually restored, but if a third party\n * instrumentation was set after ours, we keep it in place and just replace our instrumentation with\n * a noop.\n *\n * Note: it is generally better to instrument methods that are \"owned\" by the object instead of ones\n * that are inherited from the prototype chain. Example:\n * * do: `instrumentMethod(Array.prototype, 'push', ...)`\n * * don't: `instrumentMethod([], 'push', ...)`\n *\n * This method is also used to set event handler properties (ex: window.onerror = ...), as it has\n * the same requirements as instrumenting a method:\n * * if the event handler is already set by a third party, we need to call it and not just blindly\n * override it.\n * * if the event handler is set by a third party after us, we need to keep it in place when\n * removing ours.\n *\n * @example\n *\n * instrumentMethod(window, 'fetch', ({ target, parameters, onPostCall }) => {\n * console.log('Before calling fetch on', target, 'with parameters', parameters)\n *\n * onPostCall((result) => {\n * console.log('After fetch calling on', target, 'with parameters', parameters, 'and result', result)\n * })\n * })\n */\nexport function instrumentMethod(targetPrototype, method, onPreCall, { computeHandlingStack } = {}) {\n let original = targetPrototype[method];\n if (typeof original !== 'function') {\n if (method in targetPrototype && method.startsWith('on')) {\n original = noop;\n }\n else {\n return { stop: noop };\n }\n }\n let stopped = false;\n const instrumentation = function () {\n if (stopped) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-call\n return original.apply(this, arguments);\n }\n const parameters = Array.from(arguments);\n let postCallCallback;\n callMonitored(onPreCall, null, [\n {\n target: this,\n parameters,\n onPostCall: (callback) => {\n postCallCallback = callback;\n },\n handlingStack: computeHandlingStack ? createHandlingStack('instrumented method') : undefined,\n },\n ]);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n const result = original.apply(this, parameters);\n if (postCallCallback) {\n callMonitored(postCallCallback, null, [result]);\n }\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return result;\n };\n targetPrototype[method] = instrumentation;\n return {\n stop: () => {\n stopped = true;\n // If the instrumentation has been removed by a third party, keep the last one\n if (targetPrototype[method] === instrumentation) {\n targetPrototype[method] = original;\n }\n },\n };\n}\nexport function instrumentSetter(targetPrototype, property, after) {\n const originalDescriptor = Object.getOwnPropertyDescriptor(targetPrototype, property);\n if (!originalDescriptor || !originalDescriptor.set || !originalDescriptor.configurable) {\n return { stop: noop };\n }\n const stoppedInstrumentation = noop;\n let instrumentation = (target, value) => {\n // put hooked setter into event loop to avoid of set latency\n setTimeout(() => {\n if (instrumentation !== stoppedInstrumentation) {\n after(target, value);\n }\n }, 0);\n };\n const instrumentationWrapper = function (value) {\n originalDescriptor.set.call(this, value);\n instrumentation(this, value);\n };\n Object.defineProperty(targetPrototype, property, {\n set: instrumentationWrapper,\n });\n return {\n stop: () => {\n var _a;\n if (((_a = Object.getOwnPropertyDescriptor(targetPrototype, property)) === null || _a === void 0 ? void 0 : _a.set) === instrumentationWrapper) {\n Object.defineProperty(targetPrototype, property, originalDescriptor);\n }\n instrumentation = stoppedInstrumentation;\n },\n };\n}\n//# sourceMappingURL=instrumentMethod.js.map","import { display } from '../display';\nimport { ONE_KIBI_BYTE } from '../utils/byteUtils';\nimport { detachToJsonMethod } from './jsonStringify';\n// The maximum size of a single event is 256KiB. By default, we ensure that user-provided data\n// going through sanitize fits inside our events, while leaving room for other contexts, metadata, ...\nconst SANITIZE_DEFAULT_MAX_CHARACTER_COUNT = 220 * ONE_KIBI_BYTE;\n// Symbol for the root element of the JSONPath used for visited objects\nconst JSON_PATH_ROOT_ELEMENT = '$';\n// When serializing (using JSON.stringify) a key of an object, { key: 42 } gets wrapped in quotes as \"key\".\n// With the separator (:), we need to add 3 characters to the count.\nconst KEY_DECORATION_LENGTH = 3;\nexport function sanitize(source, maxCharacterCount = SANITIZE_DEFAULT_MAX_CHARACTER_COUNT) {\n // Unbind any toJSON function we may have on [] or {} prototypes\n const restoreObjectPrototypeToJson = detachToJsonMethod(Object.prototype);\n const restoreArrayPrototypeToJson = detachToJsonMethod(Array.prototype);\n // Initial call to sanitizeProcessor - will populate containerQueue if source is an Array or a plain Object\n const containerQueue = [];\n const visitedObjectsWithPath = new WeakMap();\n const sanitizedData = sanitizeProcessor(source, JSON_PATH_ROOT_ELEMENT, undefined, containerQueue, visitedObjectsWithPath);\n const serializedSanitizedData = JSON.stringify(sanitizedData);\n let accumulatedCharacterCount = serializedSanitizedData ? serializedSanitizedData.length : 0;\n if (accumulatedCharacterCount > maxCharacterCount) {\n warnOverCharacterLimit(maxCharacterCount, 'discarded', source);\n return undefined;\n }\n while (containerQueue.length > 0 && accumulatedCharacterCount < maxCharacterCount) {\n const containerToProcess = containerQueue.shift();\n let separatorLength = 0; // 0 for the first element, 1 for subsequent elements\n // Arrays and Objects have to be handled distinctly to ensure\n // we do not pick up non-numerical properties from Arrays\n if (Array.isArray(containerToProcess.source)) {\n for (let key = 0; key < containerToProcess.source.length; key++) {\n const targetData = sanitizeProcessor(containerToProcess.source[key], containerToProcess.path, key, containerQueue, visitedObjectsWithPath);\n if (targetData !== undefined) {\n accumulatedCharacterCount += JSON.stringify(targetData).length;\n }\n else {\n // When an element of an Array (targetData) is undefined, it is serialized as null:\n // JSON.stringify([undefined]) => '[null]' - This accounts for 4 characters\n accumulatedCharacterCount += 4;\n }\n accumulatedCharacterCount += separatorLength;\n separatorLength = 1;\n if (accumulatedCharacterCount > maxCharacterCount) {\n warnOverCharacterLimit(maxCharacterCount, 'truncated', source);\n break;\n }\n ;\n containerToProcess.target[key] = targetData;\n }\n }\n else {\n for (const key in containerToProcess.source) {\n if (Object.prototype.hasOwnProperty.call(containerToProcess.source, key)) {\n const targetData = sanitizeProcessor(containerToProcess.source[key], containerToProcess.path, key, containerQueue, visitedObjectsWithPath);\n // When a property of an object has an undefined value, it will be dropped during serialization:\n // JSON.stringify({a:undefined}) => '{}'\n if (targetData !== undefined) {\n accumulatedCharacterCount +=\n JSON.stringify(targetData).length + separatorLength + key.length + KEY_DECORATION_LENGTH;\n separatorLength = 1;\n }\n if (accumulatedCharacterCount > maxCharacterCount) {\n warnOverCharacterLimit(maxCharacterCount, 'truncated', source);\n break;\n }\n ;\n containerToProcess.target[key] = targetData;\n }\n }\n }\n }\n // Rebind detached toJSON functions\n restoreObjectPrototypeToJson();\n restoreArrayPrototypeToJson();\n return sanitizedData;\n}\n/**\n * Internal function to factorize the process common to the\n * initial call to sanitize, and iterations for Arrays and Objects\n *\n */\nfunction sanitizeProcessor(source, parentPath, key, queue, visitedObjectsWithPath) {\n // Start by handling toJSON, as we want to sanitize its output\n const sourceToSanitize = tryToApplyToJSON(source);\n if (!sourceToSanitize || typeof sourceToSanitize !== 'object') {\n return sanitizePrimitivesAndFunctions(sourceToSanitize);\n }\n const sanitizedSource = sanitizeObjects(sourceToSanitize);\n if (sanitizedSource !== '[Object]' && sanitizedSource !== '[Array]' && sanitizedSource !== '[Error]') {\n return sanitizedSource;\n }\n // Handle potential cyclic references\n // We need to use source as sourceToSanitize could be a reference to a new object\n // At this stage, we know the source is an object type\n const sourceAsObject = source;\n if (visitedObjectsWithPath.has(sourceAsObject)) {\n return `[Reference seen at ${visitedObjectsWithPath.get(sourceAsObject)}]`;\n }\n // Add processed source to queue\n const currentPath = key !== undefined ? `${parentPath}.${key}` : parentPath;\n const target = Array.isArray(sourceToSanitize) ? [] : {};\n visitedObjectsWithPath.set(sourceAsObject, currentPath);\n queue.push({ source: sourceToSanitize, target, path: currentPath });\n return target;\n}\n/**\n * Handles sanitization of simple, non-object types\n *\n */\nfunction sanitizePrimitivesAndFunctions(value) {\n // BigInt cannot be serialized by JSON.stringify(), convert it to a string representation\n if (typeof value === 'bigint') {\n return `[BigInt] ${value.toString()}`;\n }\n // Functions cannot be serialized by JSON.stringify(). Moreover, if a faulty toJSON is present, it needs to be converted\n // so it won't prevent stringify from serializing later\n if (typeof value === 'function') {\n return `[Function] ${value.name || 'unknown'}`;\n }\n // JSON.stringify() does not serialize symbols.\n if (typeof value === 'symbol') {\n return `[Symbol] ${value.description || value.toString()}`;\n }\n return value;\n}\n/**\n * Handles sanitization of object types\n *\n * LIMITATIONS\n * - If a class defines a toStringTag Symbol, it will fall in the catch-all method and prevent enumeration of properties.\n * To avoid this, a toJSON method can be defined.\n */\nfunction sanitizeObjects(value) {\n try {\n if (value instanceof Event) {\n return sanitizeEvent(value);\n }\n if (value instanceof RegExp) {\n return `[RegExp] ${value.toString()}`;\n }\n // Handle all remaining object types in a generic way\n const result = Object.prototype.toString.call(value);\n const match = result.match(/\\[object (.*)\\]/);\n if (match && match[1]) {\n return `[${match[1]}]`;\n }\n }\n catch (_a) {\n // If the previous serialization attempts failed, and we cannot convert using\n // Object.prototype.toString, declare the value unserializable\n }\n return '[Unserializable]';\n}\nfunction sanitizeEvent(event) {\n return {\n type: event.type,\n isTrusted: event.isTrusted,\n currentTarget: event.currentTarget ? sanitizeObjects(event.currentTarget) : null,\n target: event.target ? sanitizeObjects(event.target) : null,\n };\n}\n/**\n * Checks if a toJSON function exists and tries to execute it\n *\n */\nfunction tryToApplyToJSON(value) {\n const object = value;\n if (object && typeof object.toJSON === 'function') {\n try {\n return object.toJSON();\n }\n catch (_a) {\n // If toJSON fails, we continue by trying to serialize the value manually\n }\n }\n return value;\n}\n/**\n * Helper function to display the warning when the accumulated character count is over the limit\n */\nfunction warnOverCharacterLimit(maxCharacterCount, changeType, source) {\n display.warn(`The data provided has been ${changeType} as it is over the limit of ${maxCharacterCount} characters:`, source);\n}\n//# sourceMappingURL=sanitize.js.map","import { sanitize } from '../../tools/serialisation/sanitize';\nimport { jsonStringify } from '../../tools/serialisation/jsonStringify';\nimport { computeStackTrace } from '../../tools/stackTrace/computeStackTrace';\nimport { toStackTraceString } from '../../tools/stackTrace/handlingStack';\nexport const NO_ERROR_STACK_PRESENT_MESSAGE = 'No stack, consider using an instance of Error';\nexport function computeRawError({ stackTrace, originalError, handlingStack, componentStack, startClocks, nonErrorPrefix, source, handling, }) {\n const isErrorInstance = isError(originalError);\n const message = computeMessage(stackTrace, isErrorInstance, nonErrorPrefix, originalError);\n const stack = hasUsableStack(isErrorInstance, stackTrace)\n ? toStackTraceString(stackTrace)\n : NO_ERROR_STACK_PRESENT_MESSAGE;\n const causes = isErrorInstance ? flattenErrorCauses(originalError, source) : undefined;\n const type = stackTrace ? stackTrace.name : undefined;\n const fingerprint = tryToGetFingerprint(originalError);\n const context = tryToGetErrorContext(originalError);\n return {\n startClocks,\n source,\n handling,\n handlingStack,\n componentStack,\n originalError,\n type,\n message,\n stack,\n causes,\n fingerprint,\n context,\n };\n}\nfunction computeMessage(stackTrace, isErrorInstance, nonErrorPrefix, originalError) {\n // Favor stackTrace message only if tracekit has really been able to extract something meaningful (message + name)\n // TODO rework tracekit integration to avoid scattering error building logic\n return (stackTrace === null || stackTrace === void 0 ? void 0 : stackTrace.message) && (stackTrace === null || stackTrace === void 0 ? void 0 : stackTrace.name)\n ? stackTrace.message\n : !isErrorInstance\n ? `${nonErrorPrefix} ${jsonStringify(sanitize(originalError))}`\n : 'Empty message';\n}\nfunction hasUsableStack(isErrorInstance, stackTrace) {\n if (stackTrace === undefined) {\n return false;\n }\n if (isErrorInstance) {\n return true;\n }\n // handle cases where tracekit return stack = [] or stack = [{url: undefined, line: undefined, column: undefined}]\n // TODO rework tracekit integration to avoid generating those unusable stack\n return stackTrace.stack.length > 0 && (stackTrace.stack.length > 1 || stackTrace.stack[0].url !== undefined);\n}\nexport function tryToGetFingerprint(originalError) {\n return isError(originalError) && 'dd_fingerprint' in originalError ? String(originalError.dd_fingerprint) : undefined;\n}\nexport function tryToGetErrorContext(originalError) {\n if (originalError !== null && typeof originalError === 'object' && 'dd_context' in originalError) {\n return originalError.dd_context;\n }\n}\nexport function getFileFromStackTraceString(stack) {\n var _a;\n return (_a = /@ (.+)/.exec(stack)) === null || _a === void 0 ? void 0 : _a[1];\n}\nexport function isError(error) {\n return error instanceof Error || Object.prototype.toString.call(error) === '[object Error]';\n}\nexport function flattenErrorCauses(error, parentSource) {\n let currentError = error;\n const causes = [];\n while (isError(currentError === null || currentError === void 0 ? void 0 : currentError.cause) && causes.length < 10) {\n const stackTrace = computeStackTrace(currentError.cause);\n causes.push({\n message: currentError.cause.message,\n source: parentSource,\n type: stackTrace === null || stackTrace === void 0 ? void 0 : stackTrace.name,\n stack: stackTrace && toStackTraceString(stackTrace),\n });\n currentError = currentError.cause;\n }\n return causes.length ? causes : undefined;\n}\n//# sourceMappingURL=error.js.map","export const ErrorSource = {\n AGENT: 'agent',\n CONSOLE: 'console',\n CUSTOM: 'custom',\n LOGGER: 'logger',\n NETWORK: 'network',\n SOURCE: 'source',\n REPORT: 'report',\n};\n//# sourceMappingURL=error.types.js.map","import { instrumentMethod } from '../../tools/instrumentMethod';\nimport { clocksNow } from '../../tools/utils/timeUtils';\nimport { computeStackTrace, computeStackTraceFromOnErrorMessage } from '../../tools/stackTrace/computeStackTrace';\nimport { computeRawError, isError } from './error';\nimport { ErrorSource } from './error.types';\nexport function trackRuntimeError(errorObservable) {\n const handleRuntimeError = (stackTrace, originalError) => {\n const rawError = computeRawError({\n stackTrace,\n originalError,\n startClocks: clocksNow(),\n nonErrorPrefix: \"Uncaught\" /* NonErrorPrefix.UNCAUGHT */,\n source: ErrorSource.SOURCE,\n handling: \"unhandled\" /* ErrorHandling.UNHANDLED */,\n });\n errorObservable.notify(rawError);\n };\n const { stop: stopInstrumentingOnError } = instrumentOnError(handleRuntimeError);\n const { stop: stopInstrumentingOnUnhandledRejection } = instrumentUnhandledRejection(handleRuntimeError);\n return {\n stop: () => {\n stopInstrumentingOnError();\n stopInstrumentingOnUnhandledRejection();\n },\n };\n}\nexport function instrumentOnError(callback) {\n return instrumentMethod(window, 'onerror', ({ parameters: [messageObj, url, line, column, errorObj] }) => {\n let stackTrace;\n if (isError(errorObj)) {\n stackTrace = computeStackTrace(errorObj);\n }\n else {\n stackTrace = computeStackTraceFromOnErrorMessage(messageObj, url, line, column);\n }\n callback(stackTrace, errorObj !== null && errorObj !== void 0 ? errorObj : messageObj);\n });\n}\nexport function instrumentUnhandledRejection(callback) {\n return instrumentMethod(window, 'onunhandledrejection', ({ parameters: [e] }) => {\n const reason = e.reason || 'Empty reason';\n const stack = computeStackTrace(reason);\n callback(stack, reason);\n });\n}\n//# sourceMappingURL=trackRuntimeError.js.map","import { catchUserErrors } from '../tools/catchUserErrors';\nimport { setDebugMode } from '../tools/monitor';\nimport { display } from '../tools/display';\nexport function makePublicApi(stub) {\n const publicApi = {\n version: \"6.6.1\",\n // This API method is intentionally not monitored, since the only thing executed is the\n // user-provided 'callback'. All SDK usages executed in the callback should be monitored, and\n // we don't want to interfere with the user uncaught exceptions.\n onReady(callback) {\n callback();\n },\n ...stub,\n };\n // Add a \"hidden\" property to set debug mode. We define it that way to hide it\n // as much as possible but of course it's not a real protection.\n Object.defineProperty(publicApi, '_setDebug', {\n get() {\n return setDebugMode;\n },\n enumerable: false,\n });\n return publicApi;\n}\nexport function defineGlobal(global, name, api) {\n const existingGlobalVariable = global[name];\n if (existingGlobalVariable && !existingGlobalVariable.q && existingGlobalVariable.version) {\n display.warn('SDK is loaded more than once. This is unsupported and might have unexpected behavior.');\n }\n global[name] = api;\n if (existingGlobalVariable && existingGlobalVariable.q) {\n existingGlobalVariable.q.forEach((fn) => catchUserErrors(fn, 'onReady callback threw an error:')());\n }\n}\n//# sourceMappingURL=init.js.map","import { display } from '../tools/display';\nexport function displayAlreadyInitializedError(sdkName, initConfiguration) {\n if (!initConfiguration.silentMultipleInit) {\n display.error(`${sdkName} is already initialized.`);\n }\n}\n//# sourceMappingURL=displayAlreadyInitializedError.js.map","import { monitor } from '../tools/monitor';\nimport { getZoneJsOriginalValue } from '../tools/getZoneJsOriginalValue';\n/**\n * Add an event listener to an event target object (Window, Element, mock object...). This provides\n * a few conveniences compared to using `element.addEventListener` directly:\n *\n * * supports IE11 by: using an option object only if needed and emulating the `once` option\n *\n * * wraps the listener with a `monitor` function\n *\n * * returns a `stop` function to remove the listener\n */\nexport function addEventListener(configuration, eventTarget, eventName, listener, options) {\n return addEventListeners(configuration, eventTarget, [eventName], listener, options);\n}\n/**\n * Add event listeners to an event target object (Window, Element, mock object...). This provides\n * a few conveniences compared to using `element.addEventListener` directly:\n *\n * * supports IE11 by: using an option object only if needed and emulating the `once` option\n *\n * * wraps the listener with a `monitor` function\n *\n * * returns a `stop` function to remove the listener\n *\n * * with `once: true`, the listener will be called at most once, even if different events are listened\n */\nexport function addEventListeners(configuration, eventTarget, eventNames, listener, { once, capture, passive } = {}) {\n const listenerWithMonitor = monitor((event) => {\n if (!event.isTrusted && !event.__ddIsTrusted && !configuration.allowUntrustedEvents) {\n return;\n }\n if (once) {\n stop();\n }\n listener(event);\n });\n const options = passive ? { capture, passive } : capture;\n // Use the window.EventTarget.prototype when possible to avoid wrong overrides (e.g: https://github.com/salesforce/lwc/issues/1824)\n const listenerTarget = window.EventTarget && eventTarget instanceof EventTarget ? window.EventTarget.prototype : eventTarget;\n const add = getZoneJsOriginalValue(listenerTarget, 'addEventListener');\n eventNames.forEach((eventName) => add.call(eventTarget, eventName, listenerWithMonitor, options));\n function stop() {\n const remove = getZoneJsOriginalValue(listenerTarget, 'removeEventListener');\n eventNames.forEach((eventName) => remove.call(eventTarget, eventName, listenerWithMonitor, options));\n }\n return {\n stop,\n };\n}\n//# sourceMappingURL=addEventListener.js.map","import { toStackTraceString } from '../../tools/stackTrace/handlingStack';\nimport { monitor } from '../../tools/monitor';\nimport { mergeObservables, Observable } from '../../tools/observable';\nimport { addEventListener } from '../../browser/addEventListener';\nimport { safeTruncate } from '../../tools/utils/stringUtils';\nimport { ErrorSource } from '../error/error.types';\nimport { clocksNow } from '../../tools/utils/timeUtils';\nexport const RawReportType = {\n intervention: 'intervention',\n deprecation: 'deprecation',\n cspViolation: 'csp_violation',\n};\nexport function initReportObservable(configuration, apis) {\n const observables = [];\n if (apis.includes(RawReportType.cspViolation)) {\n observables.push(createCspViolationReportObservable(configuration));\n }\n const reportTypes = apis.filter((api) => api !== RawReportType.cspViolation);\n if (reportTypes.length) {\n observables.push(createReportObservable(reportTypes));\n }\n return mergeObservables(...observables);\n}\nfunction createReportObservable(reportTypes) {\n return new Observable((observable) => {\n if (!window.ReportingObserver) {\n return;\n }\n const handleReports = monitor((reports, _) => reports.forEach((report) => observable.notify(buildRawReportErrorFromReport(report))));\n const observer = new window.ReportingObserver(handleReports, {\n types: reportTypes,\n buffered: true,\n });\n observer.observe();\n return () => {\n observer.disconnect();\n };\n });\n}\nfunction createCspViolationReportObservable(configuration) {\n return new Observable((observable) => {\n const { stop } = addEventListener(configuration, document, \"securitypolicyviolation\" /* DOM_EVENT.SECURITY_POLICY_VIOLATION */, (event) => {\n observable.notify(buildRawReportErrorFromCspViolation(event));\n });\n return stop;\n });\n}\nfunction buildRawReportErrorFromReport(report) {\n const { type, body } = report;\n return buildRawReportError({\n type: body.id,\n message: `${type}: ${body.message}`,\n originalError: report,\n stack: buildStack(body.id, body.message, body.sourceFile, body.lineNumber, body.columnNumber),\n });\n}\nfunction buildRawReportErrorFromCspViolation(event) {\n const message = `'${event.blockedURI}' blocked by '${event.effectiveDirective}' directive`;\n return buildRawReportError({\n type: event.effectiveDirective,\n message: `${RawReportType.cspViolation}: ${message}`,\n originalError: event,\n csp: {\n disposition: event.disposition,\n },\n stack: buildStack(event.effectiveDirective, event.originalPolicy\n ? `${message} of the policy \"${safeTruncate(event.originalPolicy, 100, '...')}\"`\n : 'no policy', event.sourceFile, event.lineNumber, event.columnNumber),\n });\n}\nfunction buildRawReportError(partial) {\n return {\n startClocks: clocksNow(),\n source: ErrorSource.REPORT,\n handling: \"unhandled\" /* ErrorHandling.UNHANDLED */,\n ...partial,\n };\n}\nfunction buildStack(name, message, sourceFile, lineNumber, columnNumber) {\n return sourceFile\n ? toStackTraceString({\n name,\n message,\n stack: [\n {\n func: '?',\n url: sourceFile,\n line: lineNumber !== null && lineNumber !== void 0 ? lineNumber : undefined,\n column: columnNumber !== null && columnNumber !== void 0 ? columnNumber : undefined,\n },\n ],\n })\n : undefined;\n}\n//# sourceMappingURL=reportObservable.js.map","export function sendToExtension(type, payload) {\n const callback = window.__ddBrowserSdkExtensionCallback;\n if (callback) {\n callback({ type, payload });\n }\n}\n//# sourceMappingURL=sendToExtension.js.map","/**\n * Similar to `typeof`, but distinguish plain objects from `null` and arrays\n */\nexport function getType(value) {\n if (value === null) {\n return 'null';\n }\n if (Array.isArray(value)) {\n return 'array';\n }\n return typeof value;\n}\n//# sourceMappingURL=typeUtils.js.map","import { getType } from './utils/typeUtils';\n/**\n * Iterate over source and affect its sub values into destination, recursively.\n * If the source and destination can't be merged, return source.\n */\nexport function mergeInto(destination, source, circularReferenceChecker = createCircularReferenceChecker()) {\n // ignore the source if it is undefined\n if (source === undefined) {\n return destination;\n }\n if (typeof source !== 'object' || source === null) {\n // primitive values - just return source\n return source;\n }\n else if (source instanceof Date) {\n return new Date(source.getTime());\n }\n else if (source instanceof RegExp) {\n const flags = source.flags ||\n // old browsers compatibility\n [\n source.global ? 'g' : '',\n source.ignoreCase ? 'i' : '',\n source.multiline ? 'm' : '',\n source.sticky ? 'y' : '',\n source.unicode ? 'u' : '',\n ].join('');\n return new RegExp(source.source, flags);\n }\n if (circularReferenceChecker.hasAlreadyBeenSeen(source)) {\n // remove circular references\n return undefined;\n }\n else if (Array.isArray(source)) {\n const merged = Array.isArray(destination) ? destination : [];\n for (let i = 0; i < source.length; ++i) {\n merged[i] = mergeInto(merged[i], source[i], circularReferenceChecker);\n }\n return merged;\n }\n const merged = getType(destination) === 'object' ? destination : {};\n for (const key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n merged[key] = mergeInto(merged[key], source[key], circularReferenceChecker);\n }\n }\n return merged;\n}\n/**\n * A simplistic implementation of a deep clone algorithm.\n * Caveats:\n * - It doesn't maintain prototype chains - don't use with instances of custom classes.\n * - It doesn't handle Map and Set\n */\nexport function deepClone(value) {\n return mergeInto(undefined, value);\n}\nexport function combine(...sources) {\n let destination;\n for (const source of sources) {\n // Ignore any undefined or null sources.\n if (source === undefined || source === null) {\n continue;\n }\n destination = mergeInto(destination, source);\n }\n return destination;\n}\nfunction createCircularReferenceChecker() {\n if (typeof WeakSet !== 'undefined') {\n const set = new WeakSet();\n return {\n hasAlreadyBeenSeen(value) {\n const has = set.has(value);\n if (!has) {\n set.add(value);\n }\n return has;\n },\n };\n }\n const array = [];\n return {\n hasAlreadyBeenSeen(value) {\n const has = array.indexOf(value) >= 0;\n if (!has) {\n array.push(value);\n }\n return has;\n },\n };\n}\n//# sourceMappingURL=mergeInto.js.map","export function getConnectivity() {\n var _a;\n const navigator = window.navigator;\n return {\n status: navigator.onLine ? 'connected' : 'not_connected',\n interfaces: navigator.connection && navigator.connection.type ? [navigator.connection.type] : undefined,\n effective_type: (_a = navigator.connection) === null || _a === void 0 ? void 0 : _a.effectiveType,\n };\n}\n//# sourceMappingURL=connectivity.js.map","export function removeDuplicates(array) {\n const set = new Set();\n array.forEach((item) => set.add(item));\n return Array.from(set);\n}\nexport function removeItem(array, item) {\n const index = array.indexOf(item);\n if (index >= 0) {\n array.splice(index, 1);\n }\n}\n//# sourceMappingURL=arrayUtils.js.map","import { removeItem } from './utils/arrayUtils';\nconst BUFFER_LIMIT = 500;\nexport function createBoundedBuffer() {\n const buffer = [];\n const add = (callback) => {\n const length = buffer.push(callback);\n if (length > BUFFER_LIMIT) {\n buffer.splice(0, 1);\n }\n };\n const remove = (callback) => {\n removeItem(buffer, callback);\n };\n const drain = (arg) => {\n buffer.forEach((callback) => callback(arg));\n buffer.length = 0;\n };\n return {\n add,\n remove,\n drain,\n };\n}\n//# sourceMappingURL=boundedBuffer.js.map","export const TelemetryType = {\n log: 'log',\n configuration: 'configuration',\n usage: 'usage',\n};\n//# sourceMappingURL=rawTelemetryEvent.types.js.map","import { ConsoleApiName } from '../../tools/display';\nimport { NO_ERROR_STACK_PRESENT_MESSAGE, isError } from '../error/error';\nimport { toStackTraceString } from '../../tools/stackTrace/handlingStack';\nimport { getExperimentalFeatures } from '../../tools/experimentalFeatures';\nimport { INTAKE_SITE_STAGING, INTAKE_SITE_US1_FED } from '../configuration';\nimport { Observable } from '../../tools/observable';\nimport { timeStampNow } from '../../tools/utils/timeUtils';\nimport { displayIfDebugEnabled, startMonitorErrorCollection } from '../../tools/monitor';\nimport { sendToExtension } from '../../tools/sendToExtension';\nimport { performDraw } from '../../tools/utils/numberUtils';\nimport { jsonStringify } from '../../tools/serialisation/jsonStringify';\nimport { combine } from '../../tools/mergeInto';\nimport { computeStackTrace } from '../../tools/stackTrace/computeStackTrace';\nimport { getConnectivity } from '../connectivity';\nimport { createBoundedBuffer } from '../../tools/boundedBuffer';\nimport { TelemetryType } from './rawTelemetryEvent.types';\nconst ALLOWED_FRAME_URLS = [\n 'https://www.datadoghq-browser-agent.com',\n 'https://www.datad0g-browser-agent.com',\n 'https://d3uc069fcn7uxw.cloudfront.net',\n 'https://d20xtzwzcl0ceb.cloudfront.net',\n 'http://localhost',\n '',\n];\nconst TELEMETRY_EXCLUDED_SITES = [INTAKE_SITE_US1_FED];\n// eslint-disable-next-line local-rules/disallow-side-effects\nlet preStartTelemetryBuffer = createBoundedBuffer();\nlet onRawTelemetryEventCollected = (event) => {\n preStartTelemetryBuffer.add(() => onRawTelemetryEventCollected(event));\n};\nexport function startTelemetry(telemetryService, configuration) {\n let contextProvider;\n const observable = new Observable();\n const alreadySentEvents = new Set();\n const telemetryEnabled = !TELEMETRY_EXCLUDED_SITES.includes(configuration.site) && performDraw(configuration.telemetrySampleRate);\n const telemetryEnabledPerType = {\n [TelemetryType.log]: telemetryEnabled,\n [TelemetryType.configuration]: telemetryEnabled && performDraw(configuration.telemetryConfigurationSampleRate),\n [TelemetryType.usage]: telemetryEnabled && performDraw(configuration.telemetryUsageSampleRate),\n };\n const runtimeEnvInfo = getRuntimeEnvInfo();\n onRawTelemetryEventCollected = (rawEvent) => {\n const stringifiedEvent = jsonStringify(rawEvent);\n if (telemetryEnabledPerType[rawEvent.type] &&\n alreadySentEvents.size < configuration.maxTelemetryEventsPerPage &&\n !alreadySentEvents.has(stringifiedEvent)) {\n const event = toTelemetryEvent(telemetryService, rawEvent, runtimeEnvInfo);\n observable.notify(event);\n sendToExtension('telemetry', event);\n alreadySentEvents.add(stringifiedEvent);\n }\n };\n startMonitorErrorCollection(addTelemetryError);\n function toTelemetryEvent(telemetryService, event, runtimeEnvInfo) {\n return combine({\n type: 'telemetry',\n date: timeStampNow(),\n service: telemetryService,\n version: \"6.6.1\",\n source: 'browser',\n _dd: {\n format_version: 2,\n },\n telemetry: combine(event, {\n runtime_env: runtimeEnvInfo,\n connectivity: getConnectivity(),\n sdk_setup: \"npm\",\n }),\n experimental_features: Array.from(getExperimentalFeatures()),\n }, contextProvider !== undefined ? contextProvider() : {});\n }\n return {\n setContextProvider: (provider) => {\n contextProvider = provider;\n },\n observable,\n enabled: telemetryEnabled,\n };\n}\nfunction getRuntimeEnvInfo() {\n return {\n is_local_file: window.location.protocol === 'file:',\n is_worker: 'WorkerGlobalScope' in self,\n };\n}\nexport function startFakeTelemetry() {\n const events = [];\n onRawTelemetryEventCollected = (event) => {\n events.push(event);\n };\n return events;\n}\n// need to be called after telemetry context is provided and observers are registered\nexport function drainPreStartTelemetry() {\n preStartTelemetryBuffer.drain();\n}\nexport function resetTelemetry() {\n preStartTelemetryBuffer = createBoundedBuffer();\n onRawTelemetryEventCollected = (event) => {\n preStartTelemetryBuffer.add(() => onRawTelemetryEventCollected(event));\n };\n}\n/**\n * Avoid mixing telemetry events from different data centers\n * but keep replicating staging events for reliability\n */\nexport function isTelemetryReplicationAllowed(configuration) {\n return configuration.site === INTAKE_SITE_STAGING;\n}\nexport function addTelemetryDebug(message, context) {\n displayIfDebugEnabled(ConsoleApiName.debug, message, context);\n onRawTelemetryEventCollected({\n type: TelemetryType.log,\n message,\n status: \"debug\" /* StatusType.debug */,\n ...context,\n });\n}\nexport function addTelemetryError(e, context) {\n onRawTelemetryEventCollected({\n type: TelemetryType.log,\n status: \"error\" /* StatusType.error */,\n ...formatError(e),\n ...context,\n });\n}\nexport function addTelemetryConfiguration(configuration) {\n onRawTelemetryEventCollected({\n type: TelemetryType.configuration,\n configuration,\n });\n}\nexport function addTelemetryUsage(usage) {\n onRawTelemetryEventCollected({\n type: TelemetryType.usage,\n usage,\n });\n}\nexport function formatError(e) {\n if (isError(e)) {\n const stackTrace = computeStackTrace(e);\n return {\n error: {\n kind: stackTrace.name,\n stack: toStackTraceString(scrubCustomerFrames(stackTrace)),\n },\n message: stackTrace.message,\n };\n }\n return {\n error: {\n stack: NO_ERROR_STACK_PRESENT_MESSAGE,\n },\n message: `${\"Uncaught\" /* NonErrorPrefix.UNCAUGHT */} ${jsonStringify(e)}`,\n };\n}\nexport function scrubCustomerFrames(stackTrace) {\n stackTrace.stack = stackTrace.stack.filter((frame) => !frame.url || ALLOWED_FRAME_URLS.some((allowedFrameUrl) => frame.url.startsWith(allowedFrameUrl)));\n return stackTrace;\n}\n//# sourceMappingURL=telemetry.js.map","import { setInterval, clearInterval } from './timer';\nimport { removeItem } from './utils/arrayUtils';\nimport { addDuration, relativeNow, ONE_MINUTE } from './utils/timeUtils';\nconst END_OF_TIMES = Infinity;\nexport const CLEAR_OLD_VALUES_INTERVAL = ONE_MINUTE;\nlet cleanupHistoriesInterval = null;\nconst cleanupTasks = new Set();\nfunction cleanupHistories() {\n cleanupTasks.forEach((task) => task());\n}\nexport function createValueHistory({ expireDelay, maxEntries, }) {\n let entries = [];\n const deletedEntries = [];\n if (!cleanupHistoriesInterval) {\n cleanupHistoriesInterval = setInterval(() => cleanupHistories(), CLEAR_OLD_VALUES_INTERVAL);\n }\n const clearExpiredValues = () => {\n const oldTimeThreshold = relativeNow() - expireDelay;\n while (entries.length > 0 && entries[entries.length - 1].endTime < oldTimeThreshold) {\n const entry = entries.pop();\n if (entry) {\n deletedEntries.push(entry.startTime);\n }\n }\n };\n cleanupTasks.add(clearExpiredValues);\n /**\n * Add a value to the history associated with a start time. Returns a reference to this newly\n * added entry that can be removed or closed.\n */\n function add(value, startTime) {\n const entry = {\n value,\n startTime,\n endTime: END_OF_TIMES,\n remove: () => {\n removeItem(entries, entry);\n },\n close: (endTime) => {\n entry.endTime = endTime;\n },\n };\n if (maxEntries && entries.length >= maxEntries) {\n entries.pop();\n }\n entries.unshift(entry);\n return entry;\n }\n /**\n * Return the latest value that was active during `startTime`, or the currently active value\n * if no `startTime` is provided. This method assumes that entries are not overlapping.\n *\n * If `option.returnInactive` is true, returns the value at `startTime` (active or not).\n */\n function find(startTime = END_OF_TIMES, options = { returnInactive: false }) {\n for (const entry of entries) {\n if (entry.startTime <= startTime) {\n if (options.returnInactive || startTime <= entry.endTime) {\n return entry.value;\n }\n break;\n }\n }\n }\n /**\n * Helper function to close the currently active value, if any. This method assumes that entries\n * are not overlapping.\n */\n function closeActive(endTime) {\n const latestEntry = entries[0];\n if (latestEntry && latestEntry.endTime === END_OF_TIMES) {\n latestEntry.close(endTime);\n }\n }\n /**\n * Return all values with an active period overlapping with the duration,\n * or all values that were active during `startTime` if no duration is provided,\n * or all currently active values if no `startTime` is provided.\n */\n function findAll(startTime = END_OF_TIMES, duration = 0) {\n const endTime = addDuration(startTime, duration);\n return entries\n .filter((entry) => entry.startTime <= endTime && startTime <= entry.endTime)\n .map((entry) => entry.value);\n }\n function getAllEntries() {\n return entries.map(({ startTime, endTime, value }) => ({\n startTime,\n endTime: endTime === END_OF_TIMES ? 'Infinity' : endTime,\n value,\n }));\n }\n function getDeletedEntries() {\n return deletedEntries;\n }\n /**\n * Remove all entries from this collection.\n */\n function reset() {\n entries = [];\n }\n /**\n * Stop internal garbage collection of past entries.\n */\n function stop() {\n cleanupTasks.delete(clearExpiredValues);\n if (cleanupTasks.size === 0 && cleanupHistoriesInterval) {\n clearInterval(cleanupHistoriesInterval);\n cleanupHistoriesInterval = null;\n }\n }\n return { add, find, closeActive, findAll, reset, stop, getAllEntries, getDeletedEntries };\n}\n//# sourceMappingURL=valueHistory.js.map","import { Observable } from '../../tools/observable';\nimport { createValueHistory } from '../../tools/valueHistory';\nimport { relativeNow, clocksOrigin, ONE_MINUTE } from '../../tools/utils/timeUtils';\nimport { addEventListener, addEventListeners } from '../../browser/addEventListener';\nimport { clearInterval, setInterval } from '../../tools/timer';\nimport { SESSION_TIME_OUT_DELAY } from './sessionConstants';\nimport { startSessionStore } from './sessionStore';\nexport const VISIBILITY_CHECK_DELAY = ONE_MINUTE;\nconst SESSION_CONTEXT_TIMEOUT_DELAY = SESSION_TIME_OUT_DELAY;\nlet stopCallbacks = [];\nexport function startSessionManager(configuration, productKey, computeSessionState, trackingConsentState) {\n const renewObservable = new Observable();\n const expireObservable = new Observable();\n // TODO - Improve configuration type and remove assertion\n const sessionStore = startSessionStore(configuration.sessionStoreStrategyType, configuration, productKey, computeSessionState);\n stopCallbacks.push(() => sessionStore.stop());\n const sessionContextHistory = createValueHistory({\n expireDelay: SESSION_CONTEXT_TIMEOUT_DELAY,\n });\n stopCallbacks.push(() => sessionContextHistory.stop());\n sessionStore.renewObservable.subscribe(() => {\n sessionContextHistory.add(buildSessionContext(), relativeNow());\n renewObservable.notify();\n });\n sessionStore.expireObservable.subscribe(() => {\n expireObservable.notify();\n sessionContextHistory.closeActive(relativeNow());\n });\n // We expand/renew session unconditionally as tracking consent is always granted when the session\n // manager is started.\n sessionStore.expandOrRenewSession();\n sessionContextHistory.add(buildSessionContext(), clocksOrigin().relative);\n trackingConsentState.observable.subscribe(() => {\n if (trackingConsentState.isGranted()) {\n sessionStore.expandOrRenewSession();\n }\n else {\n sessionStore.expire();\n }\n });\n trackActivity(configuration, () => {\n if (trackingConsentState.isGranted()) {\n sessionStore.expandOrRenewSession();\n }\n });\n trackVisibility(configuration, () => sessionStore.expandSession());\n trackResume(configuration, () => sessionStore.restartSession());\n function buildSessionContext() {\n return {\n id: sessionStore.getSession().id,\n trackingType: sessionStore.getSession()[productKey],\n isReplayForced: !!sessionStore.getSession().forcedReplay,\n anonymousId: sessionStore.getSession().anonymousId,\n };\n }\n return {\n findSession: (startTime, options) => sessionContextHistory.find(startTime, options),\n renewObservable,\n expireObservable,\n sessionStateUpdateObservable: sessionStore.sessionStateUpdateObservable,\n expire: sessionStore.expire,\n updateSessionState: sessionStore.updateSessionState,\n };\n}\nexport function stopSessionManager() {\n stopCallbacks.forEach((e) => e());\n stopCallbacks = [];\n}\nfunction trackActivity(configuration, expandOrRenewSession) {\n const { stop } = addEventListeners(configuration, window, [\"click\" /* DOM_EVENT.CLICK */, \"touchstart\" /* DOM_EVENT.TOUCH_START */, \"keydown\" /* DOM_EVENT.KEY_DOWN */, \"scroll\" /* DOM_EVENT.SCROLL */], expandOrRenewSession, { capture: true, passive: true });\n stopCallbacks.push(stop);\n}\nfunction trackVisibility(configuration, expandSession) {\n const expandSessionWhenVisible = () => {\n if (document.visibilityState === 'visible') {\n expandSession();\n }\n };\n const { stop } = addEventListener(configuration, document, \"visibilitychange\" /* DOM_EVENT.VISIBILITY_CHANGE */, expandSessionWhenVisible);\n stopCallbacks.push(stop);\n const visibilityCheckInterval = setInterval(expandSessionWhenVisible, VISIBILITY_CHECK_DELAY);\n stopCallbacks.push(() => {\n clearInterval(visibilityCheckInterval);\n });\n}\nfunction trackResume(configuration, cb) {\n const { stop } = addEventListener(configuration, window, \"resume\" /* DOM_EVENT.RESUME */, cb, { capture: true });\n stopCallbacks.push(stop);\n}\n//# sourceMappingURL=sessionManager.js.map","export function isServerError(status) {\n return status >= 500;\n}\nexport function tryToClone(response) {\n try {\n return response.clone();\n }\n catch (_a) {\n // clone can throw if the response has already been used by another instrumentation or is disturbed\n return;\n }\n}\n//# sourceMappingURL=responseUtils.js.map","import { setTimeout } from '../tools/timer';\nimport { clocksNow, ONE_MINUTE, ONE_SECOND } from '../tools/utils/timeUtils';\nimport { ONE_MEBI_BYTE, ONE_KIBI_BYTE } from '../tools/utils/byteUtils';\nimport { isServerError } from '../tools/utils/responseUtils';\nimport { ErrorSource } from '../domain/error/error.types';\nexport const MAX_ONGOING_BYTES_COUNT = 80 * ONE_KIBI_BYTE;\nexport const MAX_ONGOING_REQUESTS = 32;\nexport const MAX_QUEUE_BYTES_COUNT = 3 * ONE_MEBI_BYTE;\nexport const MAX_BACKOFF_TIME = ONE_MINUTE;\nexport const INITIAL_BACKOFF_TIME = ONE_SECOND;\nexport function sendWithRetryStrategy(payload, state, sendStrategy, trackType, reportError) {\n if (state.transportStatus === 0 /* TransportStatus.UP */ &&\n state.queuedPayloads.size() === 0 &&\n state.bandwidthMonitor.canHandle(payload)) {\n send(payload, state, sendStrategy, {\n onSuccess: () => retryQueuedPayloads(0 /* RetryReason.AFTER_SUCCESS */, state, sendStrategy, trackType, reportError),\n onFailure: () => {\n state.queuedPayloads.enqueue(payload);\n scheduleRetry(state, sendStrategy, trackType, reportError);\n },\n });\n }\n else {\n state.queuedPayloads.enqueue(payload);\n }\n}\nfunction scheduleRetry(state, sendStrategy, trackType, reportError) {\n if (state.transportStatus !== 2 /* TransportStatus.DOWN */) {\n return;\n }\n setTimeout(() => {\n const payload = state.queuedPayloads.first();\n send(payload, state, sendStrategy, {\n onSuccess: () => {\n state.queuedPayloads.dequeue();\n state.currentBackoffTime = INITIAL_BACKOFF_TIME;\n retryQueuedPayloads(1 /* RetryReason.AFTER_RESUME */, state, sendStrategy, trackType, reportError);\n },\n onFailure: () => {\n state.currentBackoffTime = Math.min(MAX_BACKOFF_TIME, state.currentBackoffTime * 2);\n scheduleRetry(state, sendStrategy, trackType, reportError);\n },\n });\n }, state.currentBackoffTime);\n}\nfunction send(payload, state, sendStrategy, { onSuccess, onFailure }) {\n state.bandwidthMonitor.add(payload);\n sendStrategy(payload, (response) => {\n state.bandwidthMonitor.remove(payload);\n if (!shouldRetryRequest(response)) {\n state.transportStatus = 0 /* TransportStatus.UP */;\n onSuccess();\n }\n else {\n // do not consider transport down if another ongoing request could succeed\n state.transportStatus =\n state.bandwidthMonitor.ongoingRequestCount > 0 ? 1 /* TransportStatus.FAILURE_DETECTED */ : 2 /* TransportStatus.DOWN */;\n payload.retry = {\n count: payload.retry ? payload.retry.count + 1 : 1,\n lastFailureStatus: response.status,\n };\n onFailure();\n }\n });\n}\nfunction retryQueuedPayloads(reason, state, sendStrategy, trackType, reportError) {\n if (reason === 0 /* RetryReason.AFTER_SUCCESS */ && state.queuedPayloads.isFull() && !state.queueFullReported) {\n reportError({\n message: `Reached max ${trackType} events size queued for upload: ${MAX_QUEUE_BYTES_COUNT / ONE_MEBI_BYTE}MiB`,\n source: ErrorSource.AGENT,\n startClocks: clocksNow(),\n });\n state.queueFullReported = true;\n }\n const previousQueue = state.queuedPayloads;\n state.queuedPayloads = newPayloadQueue();\n while (previousQueue.size() > 0) {\n sendWithRetryStrategy(previousQueue.dequeue(), state, sendStrategy, trackType, reportError);\n }\n}\nfunction shouldRetryRequest(response) {\n return (response.type !== 'opaque' &&\n ((response.status === 0 && !navigator.onLine) ||\n response.status === 408 ||\n response.status === 429 ||\n isServerError(response.status)));\n}\nexport function newRetryState() {\n return {\n transportStatus: 0 /* TransportStatus.UP */,\n currentBackoffTime: INITIAL_BACKOFF_TIME,\n bandwidthMonitor: newBandwidthMonitor(),\n queuedPayloads: newPayloadQueue(),\n queueFullReported: false,\n };\n}\nfunction newPayloadQueue() {\n const queue = [];\n return {\n bytesCount: 0,\n enqueue(payload) {\n if (this.isFull()) {\n return;\n }\n queue.push(payload);\n this.bytesCount += payload.bytesCount;\n },\n first() {\n return queue[0];\n },\n dequeue() {\n const payload = queue.shift();\n if (payload) {\n this.bytesCount -= payload.bytesCount;\n }\n return payload;\n },\n size() {\n return queue.length;\n },\n isFull() {\n return this.bytesCount >= MAX_QUEUE_BYTES_COUNT;\n },\n };\n}\nfunction newBandwidthMonitor() {\n return {\n ongoingRequestCount: 0,\n ongoingByteCount: 0,\n canHandle(payload) {\n return (this.ongoingRequestCount === 0 ||\n (this.ongoingByteCount + payload.bytesCount <= MAX_ONGOING_BYTES_COUNT &&\n this.ongoingRequestCount < MAX_ONGOING_REQUESTS));\n },\n add(payload) {\n this.ongoingRequestCount += 1;\n this.ongoingByteCount += payload.bytesCount;\n },\n remove(payload) {\n this.ongoingRequestCount -= 1;\n this.ongoingByteCount -= payload.bytesCount;\n },\n };\n}\n//# sourceMappingURL=sendWithRetryStrategy.js.map","import { monitor, monitorError } from '../tools/monitor';\nimport { newRetryState, sendWithRetryStrategy } from './sendWithRetryStrategy';\nexport function createHttpRequest(endpointBuilder, bytesLimit, reportError) {\n const retryState = newRetryState();\n const sendStrategyForRetry = (payload, onResponse) => fetchKeepAliveStrategy(endpointBuilder, bytesLimit, payload, onResponse);\n return {\n send: (payload) => {\n sendWithRetryStrategy(payload, retryState, sendStrategyForRetry, endpointBuilder.trackType, reportError);\n },\n /**\n * Since fetch keepalive behaves like regular fetch on Firefox,\n * keep using sendBeaconStrategy on exit\n */\n sendOnExit: (payload) => {\n sendBeaconStrategy(endpointBuilder, bytesLimit, payload);\n },\n };\n}\nfunction sendBeaconStrategy(endpointBuilder, bytesLimit, payload) {\n const canUseBeacon = !!navigator.sendBeacon && payload.bytesCount < bytesLimit;\n if (canUseBeacon) {\n try {\n const beaconUrl = endpointBuilder.build('beacon', payload);\n const isQueued = navigator.sendBeacon(beaconUrl, payload.data);\n if (isQueued) {\n return;\n }\n }\n catch (e) {\n reportBeaconError(e);\n }\n }\n fetchStrategy(endpointBuilder, payload);\n}\nlet hasReportedBeaconError = false;\nfunction reportBeaconError(e) {\n if (!hasReportedBeaconError) {\n hasReportedBeaconError = true;\n monitorError(e);\n }\n}\nexport function fetchKeepAliveStrategy(endpointBuilder, bytesLimit, payload, onResponse) {\n const canUseKeepAlive = isKeepAliveSupported() && payload.bytesCount < bytesLimit;\n if (canUseKeepAlive) {\n const fetchUrl = endpointBuilder.build('fetch-keepalive', payload);\n fetch(fetchUrl, { method: 'POST', body: payload.data, keepalive: true, mode: 'cors' })\n .then(monitor((response) => onResponse === null || onResponse === void 0 ? void 0 : onResponse({ status: response.status, type: response.type })))\n .catch(monitor(() => fetchStrategy(endpointBuilder, payload, onResponse)));\n }\n else {\n fetchStrategy(endpointBuilder, payload, onResponse);\n }\n}\nexport function fetchStrategy(endpointBuilder, payload, onResponse) {\n const fetchUrl = endpointBuilder.build('fetch', payload);\n fetch(fetchUrl, { method: 'POST', body: payload.data, mode: 'cors' })\n .then(monitor((response) => onResponse === null || onResponse === void 0 ? void 0 : onResponse({ status: response.status, type: response.type })))\n .catch(monitor(() => onResponse === null || onResponse === void 0 ? void 0 : onResponse({ status: 0 })));\n}\nfunction isKeepAliveSupported() {\n // Request can throw, cf https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#errors\n try {\n return window.Request && 'keepalive' in new Request('http://a');\n }\n catch (_a) {\n return false;\n }\n}\n//# sourceMappingURL=httpRequest.js.map","import { getGlobalObject } from '../tools/getGlobalObject';\nexport function getEventBridge() {\n const eventBridgeGlobal = getEventBridgeGlobal();\n if (!eventBridgeGlobal) {\n return;\n }\n return {\n getCapabilities() {\n var _a;\n return JSON.parse(((_a = eventBridgeGlobal.getCapabilities) === null || _a === void 0 ? void 0 : _a.call(eventBridgeGlobal)) || '[]');\n },\n getPrivacyLevel() {\n var _a;\n return (_a = eventBridgeGlobal.getPrivacyLevel) === null || _a === void 0 ? void 0 : _a.call(eventBridgeGlobal);\n },\n getAllowedWebViewHosts() {\n return JSON.parse(eventBridgeGlobal.getAllowedWebViewHosts());\n },\n send(eventType, event, viewId) {\n const view = viewId ? { id: viewId } : undefined;\n eventBridgeGlobal.send(JSON.stringify({ eventType, event, view }));\n },\n };\n}\nexport function bridgeSupports(capability) {\n const bridge = getEventBridge();\n return !!bridge && bridge.getCapabilities().includes(capability);\n}\nexport function canUseEventBridge(currentHost) {\n var _a;\n if (currentHost === void 0) { currentHost = (_a = getGlobalObject().location) === null || _a === void 0 ? void 0 : _a.hostname; }\n const bridge = getEventBridge();\n return (!!bridge &&\n bridge\n .getAllowedWebViewHosts()\n .some((allowedHost) => currentHost === allowedHost || currentHost.endsWith(`.${allowedHost}`)));\n}\nfunction getEventBridgeGlobal() {\n return getGlobalObject().DatadogEventBridge;\n}\n//# sourceMappingURL=eventBridge.js.map","import { Observable } from '../tools/observable';\nimport { objectValues } from '../tools/utils/polyfills';\nimport { addEventListeners, addEventListener } from './addEventListener';\nexport const PageExitReason = {\n HIDDEN: 'visibility_hidden',\n UNLOADING: 'before_unload',\n PAGEHIDE: 'page_hide',\n FROZEN: 'page_frozen',\n};\nexport function createPageExitObservable(configuration) {\n return new Observable((observable) => {\n const { stop: stopListeners } = addEventListeners(configuration, window, [\"visibilitychange\" /* DOM_EVENT.VISIBILITY_CHANGE */, \"freeze\" /* DOM_EVENT.FREEZE */], (event) => {\n if (event.type === \"visibilitychange\" /* DOM_EVENT.VISIBILITY_CHANGE */ && document.visibilityState === 'hidden') {\n /**\n * Only event that guarantee to fire on mobile devices when the page transitions to background state\n * (e.g. when user switches to a different application, goes to homescreen, etc), or is being unloaded.\n */\n observable.notify({ reason: PageExitReason.HIDDEN });\n }\n else if (event.type === \"freeze\" /* DOM_EVENT.FREEZE */) {\n /**\n * After transitioning in background a tab can be freezed to preserve resources. (cf: https://developer.chrome.com/blog/page-lifecycle-api)\n * Allow to collect events happening between hidden and frozen state.\n */\n observable.notify({ reason: PageExitReason.FROZEN });\n }\n }, { capture: true });\n const stopBeforeUnloadListener = addEventListener(configuration, window, \"beforeunload\" /* DOM_EVENT.BEFORE_UNLOAD */, () => {\n observable.notify({ reason: PageExitReason.UNLOADING });\n }).stop;\n return () => {\n stopListeners();\n stopBeforeUnloadListener();\n };\n });\n}\nexport function isPageExitReason(reason) {\n return objectValues(PageExitReason).includes(reason);\n}\n//# sourceMappingURL=pageExitObservable.js.map","import { DOCS_TROUBLESHOOTING, MORE_DETAILS, display } from '../tools/display';\nimport { objectValues } from '../tools/utils/polyfills';\nimport { isPageExitReason } from '../browser/pageExitObservable';\nimport { jsonStringify } from '../tools/serialisation/jsonStringify';\nimport { computeBytesCount } from '../tools/utils/byteUtils';\nexport function createBatch({ encoder, request, flushController, messageBytesLimit, }) {\n let upsertBuffer = {};\n const flushSubscription = flushController.flushObservable.subscribe((event) => flush(event));\n function push(serializedMessage, estimatedMessageBytesCount, key) {\n flushController.notifyBeforeAddMessage(estimatedMessageBytesCount);\n if (key !== undefined) {\n upsertBuffer[key] = serializedMessage;\n flushController.notifyAfterAddMessage();\n }\n else {\n encoder.write(encoder.isEmpty ? serializedMessage : `\\n${serializedMessage}`, (realMessageBytesCount) => {\n flushController.notifyAfterAddMessage(realMessageBytesCount - estimatedMessageBytesCount);\n });\n }\n }\n function hasMessageFor(key) {\n return key !== undefined && upsertBuffer[key] !== undefined;\n }\n function remove(key) {\n const removedMessage = upsertBuffer[key];\n delete upsertBuffer[key];\n const messageBytesCount = encoder.estimateEncodedBytesCount(removedMessage);\n flushController.notifyAfterRemoveMessage(messageBytesCount);\n }\n function addOrUpdate(message, key) {\n const serializedMessage = jsonStringify(message);\n const estimatedMessageBytesCount = encoder.estimateEncodedBytesCount(serializedMessage);\n if (estimatedMessageBytesCount >= messageBytesLimit) {\n display.warn(`Discarded a message whose size was bigger than the maximum allowed size ${messageBytesLimit}KB. ${MORE_DETAILS} ${DOCS_TROUBLESHOOTING}/#technical-limitations`);\n return;\n }\n if (hasMessageFor(key)) {\n remove(key);\n }\n push(serializedMessage, estimatedMessageBytesCount, key);\n }\n function flush(event) {\n const upsertMessages = objectValues(upsertBuffer).join('\\n');\n upsertBuffer = {};\n const isPageExit = isPageExitReason(event.reason);\n const send = isPageExit ? request.sendOnExit : request.send;\n if (isPageExit &&\n // Note: checking that the encoder is async is not strictly needed, but it's an optimization:\n // if the encoder is async we need to send two requests in some cases (one for encoded data\n // and the other for non-encoded data). But if it's not async, we don't have to worry about\n // it and always send a single request.\n encoder.isAsync) {\n const encoderResult = encoder.finishSync();\n // Send encoded messages\n if (encoderResult.outputBytesCount) {\n send(formatPayloadFromEncoder(encoderResult));\n }\n // Send messages that are not yet encoded at this point\n const pendingMessages = [encoderResult.pendingData, upsertMessages].filter(Boolean).join('\\n');\n if (pendingMessages) {\n send({\n data: pendingMessages,\n bytesCount: computeBytesCount(pendingMessages),\n });\n }\n }\n else {\n if (upsertMessages) {\n encoder.write(encoder.isEmpty ? upsertMessages : `\\n${upsertMessages}`);\n }\n encoder.finish((encoderResult) => {\n send(formatPayloadFromEncoder(encoderResult));\n });\n }\n }\n return {\n flushController,\n add: addOrUpdate,\n upsert: addOrUpdate,\n stop: flushSubscription.unsubscribe,\n };\n}\nfunction formatPayloadFromEncoder(encoderResult) {\n let data;\n if (typeof encoderResult.output === 'string') {\n data = encoderResult.output;\n }\n else {\n data = new Blob([encoderResult.output], {\n // This will set the 'Content-Type: text/plain' header. Reasoning:\n // * The intake rejects the request if there is no content type.\n // * The browser will issue CORS preflight requests if we set it to 'application/json', which\n // could induce higher intake load (and maybe has other impacts).\n // * Also it's not quite JSON, since we are concatenating multiple JSON objects separated by\n // new lines.\n type: 'text/plain',\n });\n }\n return {\n data,\n bytesCount: encoderResult.outputBytesCount,\n encoding: encoderResult.encoding,\n };\n}\n//# sourceMappingURL=batch.js.map","import { Observable } from '../tools/observable';\nimport { clearTimeout, setTimeout } from '../tools/timer';\n/**\n * Returns a \"flush controller\", responsible of notifying when flushing a pool of pending data needs\n * to happen. The implementation is designed to support both synchronous and asynchronous usages,\n * but relies on invariants described in each method documentation to keep a coherent state.\n */\nexport function createFlushController({ messagesLimit, bytesLimit, durationLimit, pageExitObservable, sessionExpireObservable, }) {\n const pageExitSubscription = pageExitObservable.subscribe((event) => flush(event.reason));\n const sessionExpireSubscription = sessionExpireObservable.subscribe(() => flush('session_expire'));\n const flushObservable = new Observable(() => () => {\n pageExitSubscription.unsubscribe();\n sessionExpireSubscription.unsubscribe();\n });\n let currentBytesCount = 0;\n let currentMessagesCount = 0;\n function flush(flushReason) {\n if (currentMessagesCount === 0) {\n return;\n }\n const messagesCount = currentMessagesCount;\n const bytesCount = currentBytesCount;\n currentMessagesCount = 0;\n currentBytesCount = 0;\n cancelDurationLimitTimeout();\n flushObservable.notify({\n reason: flushReason,\n messagesCount,\n bytesCount,\n });\n }\n let durationLimitTimeoutId;\n function scheduleDurationLimitTimeout() {\n if (durationLimitTimeoutId === undefined) {\n durationLimitTimeoutId = setTimeout(() => {\n flush('duration_limit');\n }, durationLimit);\n }\n }\n function cancelDurationLimitTimeout() {\n clearTimeout(durationLimitTimeoutId);\n durationLimitTimeoutId = undefined;\n }\n return {\n flushObservable,\n get messagesCount() {\n return currentMessagesCount;\n },\n /**\n * Notifies that a message will be added to a pool of pending messages waiting to be flushed.\n *\n * This function needs to be called synchronously, right before adding the message, so no flush\n * event can happen after `notifyBeforeAddMessage` and before adding the message.\n *\n * @param estimatedMessageBytesCount: an estimation of the message bytes count once it is\n * actually added.\n */\n notifyBeforeAddMessage(estimatedMessageBytesCount) {\n if (currentBytesCount + estimatedMessageBytesCount >= bytesLimit) {\n flush('bytes_limit');\n }\n // Consider the message to be added now rather than in `notifyAfterAddMessage`, because if no\n // message was added yet and `notifyAfterAddMessage` is called asynchronously, we still want\n // to notify when a flush is needed (for example on page exit).\n currentMessagesCount += 1;\n currentBytesCount += estimatedMessageBytesCount;\n scheduleDurationLimitTimeout();\n },\n /**\n * Notifies that a message *was* added to a pool of pending messages waiting to be flushed.\n *\n * This function can be called asynchronously after the message was added, but in this case it\n * should not be called if a flush event occurred in between.\n *\n * @param messageBytesCountDiff: the difference between the estimated message bytes count and\n * its actual bytes count once added to the pool.\n */\n notifyAfterAddMessage(messageBytesCountDiff = 0) {\n currentBytesCount += messageBytesCountDiff;\n if (currentMessagesCount >= messagesLimit) {\n flush('messages_limit');\n }\n else if (currentBytesCount >= bytesLimit) {\n flush('bytes_limit');\n }\n },\n /**\n * Notifies that a message was removed from a pool of pending messages waiting to be flushed.\n *\n * This function needs to be called synchronously, right after removing the message, so no flush\n * event can happen after removing the message and before `notifyAfterRemoveMessage`.\n *\n * @param messageBytesCount: the message bytes count that was added to the pool. Should\n * correspond to the sum of bytes counts passed to `notifyBeforeAddMessage` and\n * `notifyAfterAddMessage`.\n */\n notifyAfterRemoveMessage(messageBytesCount) {\n currentBytesCount -= messageBytesCount;\n currentMessagesCount -= 1;\n if (currentMessagesCount === 0) {\n cancelDurationLimitTimeout();\n }\n },\n };\n}\n//# sourceMappingURL=flushController.js.map","import { createBatch } from './batch';\nimport { createHttpRequest } from './httpRequest';\nimport { createFlushController } from './flushController';\nexport function startBatchWithReplica(configuration, primary, replica, reportError, pageExitObservable, sessionExpireObservable, batchFactoryImp = createBatch) {\n const primaryBatch = createBatchFromConfig(configuration, primary);\n const replicaBatch = replica && createBatchFromConfig(configuration, replica);\n function createBatchFromConfig(configuration, { endpoint, encoder }) {\n return batchFactoryImp({\n encoder,\n request: createHttpRequest(endpoint, configuration.batchBytesLimit, reportError),\n flushController: createFlushController({\n messagesLimit: configuration.batchMessagesLimit,\n bytesLimit: configuration.batchBytesLimit,\n durationLimit: configuration.flushTimeout,\n pageExitObservable,\n sessionExpireObservable,\n }),\n messageBytesLimit: configuration.messageBytesLimit,\n });\n }\n return {\n flushObservable: primaryBatch.flushController.flushObservable,\n add(message, replicated = true) {\n primaryBatch.add(message);\n if (replicaBatch && replicated) {\n replicaBatch.add(replica.transformMessage ? replica.transformMessage(message) : message);\n }\n },\n upsert: (message, key) => {\n primaryBatch.upsert(message, key);\n if (replicaBatch) {\n replicaBatch.upsert(replica.transformMessage ? replica.transformMessage(message) : message, key);\n }\n },\n stop: () => {\n primaryBatch.stop();\n if (replicaBatch) {\n replicaBatch.stop();\n }\n },\n };\n}\n//# sourceMappingURL=startBatchWithReplica.js.map","import { computeBytesCount } from './utils/byteUtils';\nexport function createIdentityEncoder() {\n let output = '';\n let outputBytesCount = 0;\n return {\n isAsync: false,\n get isEmpty() {\n return !output;\n },\n write(data, callback) {\n const additionalEncodedBytesCount = computeBytesCount(data);\n outputBytesCount += additionalEncodedBytesCount;\n output += data;\n if (callback) {\n callback(additionalEncodedBytesCount);\n }\n },\n finish(callback) {\n callback(this.finishSync());\n },\n finishSync() {\n const result = {\n output,\n outputBytesCount,\n rawBytesCount: outputBytesCount,\n pendingData: '',\n };\n output = '';\n outputBytesCount = 0;\n return result;\n },\n estimateEncodedBytesCount(data) {\n return data.length;\n },\n };\n}\n//# sourceMappingURL=encoder.js.map","// eslint-disable-next-line no-restricted-syntax\nexport class AbstractLifeCycle {\n constructor() {\n this.callbacks = {};\n }\n notify(eventType, data) {\n const eventCallbacks = this.callbacks[eventType];\n if (eventCallbacks) {\n eventCallbacks.forEach((callback) => callback(data));\n }\n }\n subscribe(eventType, callback) {\n if (!this.callbacks[eventType]) {\n this.callbacks[eventType] = [];\n }\n this.callbacks[eventType].push(callback);\n return {\n unsubscribe: () => {\n this.callbacks[eventType] = this.callbacks[eventType].filter((other) => callback !== other);\n },\n };\n }\n}\n//# sourceMappingURL=abstractLifeCycle.js.map","import { setTimeout } from '../../tools/timer';\nimport { clocksNow, ONE_MINUTE } from '../../tools/utils/timeUtils';\nimport { ErrorSource } from '../error/error.types';\nexport function createEventRateLimiter(eventType, limit, onLimitReached) {\n let eventCount = 0;\n let allowNextEvent = false;\n return {\n isLimitReached() {\n if (eventCount === 0) {\n setTimeout(() => {\n eventCount = 0;\n }, ONE_MINUTE);\n }\n eventCount += 1;\n if (eventCount <= limit || allowNextEvent) {\n allowNextEvent = false;\n return false;\n }\n if (eventCount === limit + 1) {\n allowNextEvent = true;\n try {\n onLimitReached({\n message: `Reached max number of ${eventType}s by minute: ${limit}`,\n source: ErrorSource.AGENT,\n startClocks: clocksNow(),\n });\n }\n finally {\n allowNextEvent = false;\n }\n }\n return true;\n },\n };\n}\n//# sourceMappingURL=createEventRateLimiter.js.map","import { noop } from '../tools/utils/functionUtils';\nimport { addEventListener } from './addEventListener';\nexport function runOnReadyState(configuration, expectedReadyState, callback) {\n if (document.readyState === expectedReadyState || document.readyState === 'complete') {\n callback();\n return { stop: noop };\n }\n const eventName = expectedReadyState === 'complete' ? \"load\" /* DOM_EVENT.LOAD */ : \"DOMContentLoaded\" /* DOM_EVENT.DOM_CONTENT_LOADED */;\n return addEventListener(configuration, window, eventName, callback, { once: true });\n}\nexport function asyncRunOnReadyState(configuration, expectedReadyState) {\n return new Promise((resolve) => {\n runOnReadyState(configuration, expectedReadyState, resolve);\n });\n}\n//# sourceMappingURL=runOnReadyState.js.map","import { instrumentMethod } from '../tools/instrumentMethod';\nimport { Observable } from '../tools/observable';\nimport { elapsed, clocksNow, timeStampNow } from '../tools/utils/timeUtils';\nimport { normalizeUrl } from '../tools/utils/urlPolyfill';\nimport { shallowClone } from '../tools/utils/objectUtils';\nimport { addEventListener } from './addEventListener';\nlet xhrObservable;\nconst xhrContexts = new WeakMap();\nexport function initXhrObservable(configuration) {\n if (!xhrObservable) {\n xhrObservable = createXhrObservable(configuration);\n }\n return xhrObservable;\n}\nfunction createXhrObservable(configuration) {\n return new Observable((observable) => {\n const { stop: stopInstrumentingStart } = instrumentMethod(XMLHttpRequest.prototype, 'open', openXhr);\n const { stop: stopInstrumentingSend } = instrumentMethod(XMLHttpRequest.prototype, 'send', (call) => {\n sendXhr(call, configuration, observable);\n }, { computeHandlingStack: true });\n const { stop: stopInstrumentingAbort } = instrumentMethod(XMLHttpRequest.prototype, 'abort', abortXhr);\n return () => {\n stopInstrumentingStart();\n stopInstrumentingSend();\n stopInstrumentingAbort();\n };\n });\n}\nfunction openXhr({ target: xhr, parameters: [method, url] }) {\n xhrContexts.set(xhr, {\n state: 'open',\n method: String(method).toUpperCase(),\n url: normalizeUrl(String(url)),\n });\n}\nfunction sendXhr({ target: xhr, handlingStack }, configuration, observable) {\n const context = xhrContexts.get(xhr);\n if (!context) {\n return;\n }\n const startContext = context;\n startContext.state = 'start';\n startContext.startClocks = clocksNow();\n startContext.isAborted = false;\n startContext.xhr = xhr;\n startContext.handlingStack = handlingStack;\n let hasBeenReported = false;\n const { stop: stopInstrumentingOnReadyStateChange } = instrumentMethod(xhr, 'onreadystatechange', () => {\n if (xhr.readyState === XMLHttpRequest.DONE) {\n // Try to report the XHR as soon as possible, because the XHR may be mutated by the\n // application during a future event. For example, Angular is calling .abort() on\n // completed requests during an onreadystatechange event, so the status becomes '0'\n // before the request is collected.\n onEnd();\n }\n });\n const onEnd = () => {\n unsubscribeLoadEndListener();\n stopInstrumentingOnReadyStateChange();\n if (hasBeenReported) {\n return;\n }\n hasBeenReported = true;\n const completeContext = context;\n completeContext.state = 'complete';\n completeContext.duration = elapsed(startContext.startClocks.timeStamp, timeStampNow());\n completeContext.status = xhr.status;\n observable.notify(shallowClone(completeContext));\n };\n const { stop: unsubscribeLoadEndListener } = addEventListener(configuration, xhr, 'loadend', onEnd);\n observable.notify(startContext);\n}\nfunction abortXhr({ target: xhr }) {\n const context = xhrContexts.get(xhr);\n if (context) {\n context.isAborted = true;\n }\n}\n//# sourceMappingURL=xhrObservable.js.map","import { instrumentMethod } from '../tools/instrumentMethod';\nimport { monitor } from '../tools/monitor';\nimport { Observable } from '../tools/observable';\nimport { clocksNow } from '../tools/utils/timeUtils';\nimport { normalizeUrl } from '../tools/utils/urlPolyfill';\nlet fetchObservable;\nexport function initFetchObservable() {\n if (!fetchObservable) {\n fetchObservable = createFetchObservable();\n }\n return fetchObservable;\n}\nexport function resetFetchObservable() {\n fetchObservable = undefined;\n}\nfunction createFetchObservable() {\n return new Observable((observable) => {\n if (!window.fetch) {\n return;\n }\n const { stop } = instrumentMethod(window, 'fetch', (call) => beforeSend(call, observable), {\n computeHandlingStack: true,\n });\n return stop;\n });\n}\nfunction beforeSend({ parameters, onPostCall, handlingStack }, observable) {\n const [input, init] = parameters;\n let methodFromParams = init && init.method;\n if (methodFromParams === undefined && input instanceof Request) {\n methodFromParams = input.method;\n }\n const method = methodFromParams !== undefined ? String(methodFromParams).toUpperCase() : 'GET';\n const url = input instanceof Request ? input.url : normalizeUrl(String(input));\n const startClocks = clocksNow();\n const context = {\n state: 'start',\n init,\n input,\n method,\n startClocks,\n url,\n handlingStack,\n };\n observable.notify(context);\n // Those properties can be changed by observable subscribers\n parameters[0] = context.input;\n parameters[1] = context.init;\n onPostCall((responsePromise) => afterSend(observable, responsePromise, context));\n}\nfunction afterSend(observable, responsePromise, startContext) {\n const context = startContext;\n function reportFetch(partialContext) {\n context.state = 'resolve';\n Object.assign(context, partialContext);\n observable.notify(context);\n }\n responsePromise.then(monitor((response) => {\n reportFetch({\n response,\n responseType: response.type,\n status: response.status,\n isAborted: false,\n });\n }), monitor((error) => {\n var _a, _b;\n reportFetch({\n status: 0,\n isAborted: ((_b = (_a = context.init) === null || _a === void 0 ? void 0 : _a.signal) === null || _b === void 0 ? void 0 : _b.aborted) || (error instanceof DOMException && error.code === DOMException.ABORT_ERR),\n error,\n });\n }));\n}\n//# sourceMappingURL=fetchObservable.js.map","import { setTimeout, clearTimeout } from './timer';\nimport { monitor } from './monitor';\nimport { dateNow } from './utils/timeUtils';\n/**\n * 'requestIdleCallback' with a shim.\n */\nexport function requestIdleCallback(callback, opts) {\n // Note: check both 'requestIdleCallback' and 'cancelIdleCallback' existence because some polyfills only implement 'requestIdleCallback'.\n if (window.requestIdleCallback && window.cancelIdleCallback) {\n const id = window.requestIdleCallback(monitor(callback), opts);\n return () => window.cancelIdleCallback(id);\n }\n return requestIdleCallbackShim(callback);\n}\nexport const MAX_TASK_TIME = 50;\n/*\n * Shim from https://developer.chrome.com/blog/using-requestidlecallback#checking_for_requestidlecallback\n * Note: there is no simple way to support the \"timeout\" option, so we ignore it.\n */\nexport function requestIdleCallbackShim(callback) {\n const start = dateNow();\n const timeoutId = setTimeout(() => {\n callback({\n didTimeout: false,\n timeRemaining: () => Math.max(0, MAX_TASK_TIME - (dateNow() - start)),\n });\n }, 0);\n return () => clearTimeout(timeoutId);\n}\n//# sourceMappingURL=requestIdleCallback.js.map","import { ONE_SECOND } from './utils/timeUtils';\nimport { requestIdleCallback } from './requestIdleCallback';\n/**\n * Maximum delay before starting to execute tasks in the queue. We don't want to wait too long\n * before running tasks, as it might hurt reliability (ex: if the user navigates away, we might lose\n * the opportunity to send some data). We also don't want to run tasks too often, as it might hurt\n * performance.\n */\nconst IDLE_CALLBACK_TIMEOUT = ONE_SECOND;\n/**\n * Maximum amount of time allocated to running tasks when a timeout (`IDLE_CALLBACK_TIMEOUT`) is\n * reached. We should not run tasks for too long as it will hurt performance, but we should still\n * run some tasks to avoid postponing them forever.\n *\n * Rational: Running tasks for 30ms every second (IDLE_CALLBACK_TIMEOUT) should be acceptable.\n */\nexport const MAX_EXECUTION_TIME_ON_TIMEOUT = 30;\nexport function createTaskQueue() {\n const pendingTasks = [];\n function run(deadline) {\n let executionTimeRemaining;\n if (deadline.didTimeout) {\n const start = performance.now();\n executionTimeRemaining = () => MAX_EXECUTION_TIME_ON_TIMEOUT - (performance.now() - start);\n }\n else {\n executionTimeRemaining = deadline.timeRemaining.bind(deadline);\n }\n while (executionTimeRemaining() > 0 && pendingTasks.length) {\n pendingTasks.shift()();\n }\n if (pendingTasks.length) {\n scheduleNextRun();\n }\n }\n function scheduleNextRun() {\n requestIdleCallback(run, { timeout: IDLE_CALLBACK_TIMEOUT });\n }\n return {\n push(task) {\n if (pendingTasks.push(task) === 1) {\n scheduleNextRun();\n }\n },\n };\n}\n//# sourceMappingURL=taskQueue.js.map","import { flattenErrorCauses, isError, tryToGetFingerprint, tryToGetErrorContext } from '../error/error';\nimport { mergeObservables, Observable } from '../../tools/observable';\nimport { ConsoleApiName, globalConsole } from '../../tools/display';\nimport { callMonitored } from '../../tools/monitor';\nimport { sanitize } from '../../tools/serialisation/sanitize';\nimport { jsonStringify } from '../../tools/serialisation/jsonStringify';\nimport { ErrorSource } from '../error/error.types';\nimport { computeStackTrace } from '../../tools/stackTrace/computeStackTrace';\nimport { createHandlingStack, toStackTraceString, formatErrorMessage } from '../../tools/stackTrace/handlingStack';\nimport { clocksNow } from '../../tools/utils/timeUtils';\nlet consoleObservablesByApi = {};\nexport function initConsoleObservable(apis) {\n const consoleObservables = apis.map((api) => {\n if (!consoleObservablesByApi[api]) {\n consoleObservablesByApi[api] = createConsoleObservable(api); // we are sure that the observable created for this api will yield the expected ConsoleLog type\n }\n return consoleObservablesByApi[api];\n });\n return mergeObservables(...consoleObservables);\n}\nexport function resetConsoleObservable() {\n consoleObservablesByApi = {};\n}\nfunction createConsoleObservable(api) {\n return new Observable((observable) => {\n const originalConsoleApi = globalConsole[api];\n globalConsole[api] = (...params) => {\n originalConsoleApi.apply(console, params);\n const handlingStack = createHandlingStack('console error');\n callMonitored(() => {\n observable.notify(buildConsoleLog(params, api, handlingStack));\n });\n };\n return () => {\n globalConsole[api] = originalConsoleApi;\n };\n });\n}\nfunction buildConsoleLog(params, api, handlingStack) {\n const message = params.map((param) => formatConsoleParameters(param)).join(' ');\n let error;\n if (api === ConsoleApiName.error) {\n const firstErrorParam = params.find(isError);\n error = {\n stack: firstErrorParam ? toStackTraceString(computeStackTrace(firstErrorParam)) : undefined,\n fingerprint: tryToGetFingerprint(firstErrorParam),\n causes: firstErrorParam ? flattenErrorCauses(firstErrorParam, 'console') : undefined,\n startClocks: clocksNow(),\n message,\n source: ErrorSource.CONSOLE,\n handling: \"handled\" /* ErrorHandling.HANDLED */,\n handlingStack,\n context: tryToGetErrorContext(firstErrorParam),\n };\n }\n return {\n api,\n message,\n error,\n handlingStack,\n };\n}\nfunction formatConsoleParameters(param) {\n if (typeof param === 'string') {\n return sanitize(param);\n }\n if (isError(param)) {\n return formatErrorMessage(computeStackTrace(param));\n }\n return jsonStringify(sanitize(param), undefined, 2);\n}\n//# sourceMappingURL=consoleObservable.js.map","import { display } from '../../tools/display';\nimport { getType } from '../../tools/utils/typeUtils';\n/**\n * Simple check to ensure an object is a valid context\n */\nexport function checkContext(maybeContext) {\n const isValid = getType(maybeContext) === 'object';\n if (!isValid) {\n display.error('Unsupported context:', maybeContext);\n }\n return isValid;\n}\n//# sourceMappingURL=contextUtils.js.map","import { deepClone } from '../../tools/mergeInto';\nimport { sanitize } from '../../tools/serialisation/sanitize';\nimport { Observable } from '../../tools/observable';\nimport { display } from '../../tools/display';\nimport { checkContext } from './contextUtils';\nfunction ensureProperties(context, propertiesConfig, name) {\n const newContext = { ...context };\n for (const [key, { required, type }] of Object.entries(propertiesConfig)) {\n /**\n * Ensure specified properties are strings as defined here:\n * https://docs.datadoghq.com/logs/log_configuration/attributes_naming_convention/#user-related-attributes\n */\n if (type === 'string' && key in newContext) {\n /* eslint-disable @typescript-eslint/no-base-to-string */\n newContext[key] = String(newContext[key]);\n }\n if (required && !(key in context)) {\n display.warn(`The property ${key} of ${name} is required; context will not be sent to the intake.`);\n }\n }\n return newContext;\n}\nexport function createContextManager(name = '', { customerDataTracker, propertiesConfig = {}, } = {}) {\n let context = {};\n const changeObservable = new Observable();\n const contextManager = {\n getContext: () => deepClone(context),\n setContext: (newContext) => {\n if (checkContext(newContext)) {\n context = sanitize(ensureProperties(newContext, propertiesConfig, name));\n customerDataTracker === null || customerDataTracker === void 0 ? void 0 : customerDataTracker.updateCustomerData(context);\n }\n else {\n contextManager.clearContext();\n }\n changeObservable.notify();\n },\n setContextProperty: (key, property) => {\n context = sanitize(ensureProperties({ ...context, [key]: property }, propertiesConfig, name));\n customerDataTracker === null || customerDataTracker === void 0 ? void 0 : customerDataTracker.updateCustomerData(context);\n changeObservable.notify();\n },\n removeContextProperty: (key) => {\n delete context[key];\n customerDataTracker === null || customerDataTracker === void 0 ? void 0 : customerDataTracker.updateCustomerData(context);\n ensureProperties(context, propertiesConfig, name);\n changeObservable.notify();\n },\n clearContext: () => {\n context = {};\n customerDataTracker === null || customerDataTracker === void 0 ? void 0 : customerDataTracker.resetCustomerData();\n changeObservable.notify();\n },\n changeObservable,\n };\n return contextManager;\n}\n//# sourceMappingURL=contextManager.js.map","import { addEventListener } from '../../browser/addEventListener';\nimport { combine } from '../../tools/mergeInto';\nimport { isEmptyObject } from '../../tools/utils/objectUtils';\nconst CONTEXT_STORE_KEY_PREFIX = '_dd_c';\nconst storageListeners = [];\nexport function storeContextManager(configuration, contextManager, productKey, customerDataType) {\n const storageKey = buildStorageKey(productKey, customerDataType);\n storageListeners.push(addEventListener(configuration, window, \"storage\" /* DOM_EVENT.STORAGE */, ({ key }) => {\n if (storageKey === key) {\n synchronizeWithStorage();\n }\n }));\n contextManager.changeObservable.subscribe(dumpToStorage);\n const contextFromStorage = combine(getFromStorage(), contextManager.getContext());\n if (!isEmptyObject(contextFromStorage)) {\n contextManager.setContext(contextFromStorage);\n }\n function synchronizeWithStorage() {\n contextManager.setContext(getFromStorage());\n }\n function dumpToStorage() {\n localStorage.setItem(storageKey, JSON.stringify(contextManager.getContext()));\n }\n function getFromStorage() {\n const rawContext = localStorage.getItem(storageKey);\n return rawContext ? JSON.parse(rawContext) : {};\n }\n}\nexport function buildStorageKey(productKey, customerDataType) {\n return `${CONTEXT_STORE_KEY_PREFIX}_${productKey}_${customerDataType}`;\n}\nexport function removeStorageListeners() {\n storageListeners.map((listener) => listener.stop());\n}\n//# sourceMappingURL=storeContextManager.js.map","import { ONE_KIBI_BYTE, computeBytesCount } from '../../tools/utils/byteUtils';\nimport { throttle } from '../../tools/utils/functionUtils';\nimport { jsonStringify } from '../../tools/serialisation/jsonStringify';\nimport { DOCS_TROUBLESHOOTING, MORE_DETAILS, display } from '../../tools/display';\nimport { isEmptyObject } from '../../tools/utils/objectUtils';\n// RUM and logs batch bytes limit is 16KB\n// ensure that we leave room for other event attributes and maintain a decent amount of event per batch\n// (3KB (customer data) + 1KB (other attributes)) * 4 (events per batch) = 16KB\nexport const CUSTOMER_DATA_BYTES_LIMIT = 3 * ONE_KIBI_BYTE;\n// We observed that the compression ratio is around 8 in general, but we also want to keep a margin\n// because some data might not be compressed (ex: last view update on page exit). We chose 16KiB\n// because it is also the limit of the 'batchBytesCount' that we use for RUM and Logs data, but this\n// is a bit arbitrary.\nexport const CUSTOMER_COMPRESSED_DATA_BYTES_LIMIT = 16 * ONE_KIBI_BYTE;\nexport const BYTES_COMPUTATION_THROTTLING_DELAY = 200;\nexport function createCustomerDataTrackerManager(compressionStatus = 2 /* CustomerDataCompressionStatus.Disabled */) {\n const customerDataTrackers = new Map();\n let alreadyWarned = false;\n function checkCustomerDataLimit(initialBytesCount = 0) {\n if (alreadyWarned || compressionStatus === 0 /* CustomerDataCompressionStatus.Unknown */) {\n return;\n }\n const bytesCountLimit = compressionStatus === 2 /* CustomerDataCompressionStatus.Disabled */\n ? CUSTOMER_DATA_BYTES_LIMIT\n : CUSTOMER_COMPRESSED_DATA_BYTES_LIMIT;\n let bytesCount = initialBytesCount;\n customerDataTrackers.forEach((tracker) => {\n bytesCount += tracker.getBytesCount();\n });\n if (bytesCount > bytesCountLimit) {\n displayCustomerDataLimitReachedWarning(bytesCountLimit);\n alreadyWarned = true;\n }\n }\n return {\n /**\n * Creates a detached tracker. The manager will not store a reference to that tracker, and the\n * bytes count will be counted independently from other detached trackers.\n *\n * This is particularly useful when we don't know when the tracker will be unused, so we don't\n * leak memory (ex: when used in Logger instances).\n */\n createDetachedTracker: () => {\n const tracker = createCustomerDataTracker(() => checkCustomerDataLimit(tracker.getBytesCount()));\n return tracker;\n },\n /**\n * Creates a tracker if it doesn't exist, and returns it.\n */\n getOrCreateTracker: (type) => {\n if (!customerDataTrackers.has(type)) {\n customerDataTrackers.set(type, createCustomerDataTracker(checkCustomerDataLimit));\n }\n return customerDataTrackers.get(type);\n },\n setCompressionStatus: (newCompressionStatus) => {\n if (compressionStatus === 0 /* CustomerDataCompressionStatus.Unknown */) {\n compressionStatus = newCompressionStatus;\n checkCustomerDataLimit();\n }\n },\n getCompressionStatus: () => compressionStatus,\n stop: () => {\n customerDataTrackers.forEach((tracker) => tracker.stop());\n customerDataTrackers.clear();\n },\n };\n}\nexport function createCustomerDataTracker(checkCustomerDataLimit) {\n let bytesCountCache = 0;\n // Throttle the bytes computation to minimize the impact on performance.\n // Especially useful if the user call context APIs synchronously multiple times in a row\n const { throttled: computeBytesCountThrottled, cancel: cancelComputeBytesCount } = throttle((context) => {\n bytesCountCache = computeBytesCount(jsonStringify(context));\n checkCustomerDataLimit();\n }, BYTES_COMPUTATION_THROTTLING_DELAY);\n const resetBytesCount = () => {\n cancelComputeBytesCount();\n bytesCountCache = 0;\n };\n return {\n updateCustomerData: (context) => {\n if (isEmptyObject(context)) {\n resetBytesCount();\n }\n else {\n computeBytesCountThrottled(context);\n }\n },\n resetCustomerData: resetBytesCount,\n getBytesCount: () => bytesCountCache,\n stop: () => {\n cancelComputeBytesCount();\n },\n };\n}\nfunction displayCustomerDataLimitReachedWarning(bytesCountLimit) {\n display.warn(`Customer data exceeds the recommended ${bytesCountLimit / ONE_KIBI_BYTE}KiB threshold. ${MORE_DETAILS} ${DOCS_TROUBLESHOOTING}/#customer-data-exceeds-the-recommended-threshold-warning`);\n}\n//# sourceMappingURL=customerDataTracker.js.map","import { monitor } from './monitor';\nimport { noop } from './utils/functionUtils';\n/**\n * Read bytes from a ReadableStream until at least `limit` bytes have been read (or until the end of\n * the stream). The callback is invoked with the at most `limit` bytes, and indicates that the limit\n * has been exceeded if more bytes were available.\n */\nexport function readBytesFromStream(stream, callback, options) {\n const reader = stream.getReader();\n const chunks = [];\n let readBytesCount = 0;\n readMore();\n function readMore() {\n reader.read().then(monitor((result) => {\n if (result.done) {\n onDone();\n return;\n }\n if (options.collectStreamBody) {\n chunks.push(result.value);\n }\n readBytesCount += result.value.length;\n if (readBytesCount > options.bytesLimit) {\n onDone();\n }\n else {\n readMore();\n }\n }), monitor((error) => callback(error)));\n }\n function onDone() {\n reader.cancel().catch(\n // we don't care if cancel fails, but we still need to catch the error to avoid reporting it\n // as an unhandled rejection\n noop);\n let bytes;\n let limitExceeded;\n if (options.collectStreamBody) {\n let completeBuffer;\n if (chunks.length === 1) {\n // optimization: if the response is small enough to fit in a single buffer (provided by the browser), just\n // use it directly.\n completeBuffer = chunks[0];\n }\n else {\n // else, we need to copy buffers into a larger buffer to concatenate them.\n completeBuffer = new Uint8Array(readBytesCount);\n let offset = 0;\n chunks.forEach((chunk) => {\n completeBuffer.set(chunk, offset);\n offset += chunk.length;\n });\n }\n bytes = completeBuffer.slice(0, options.bytesLimit);\n limitExceeded = completeBuffer.length > options.bytesLimit;\n }\n callback(undefined, bytes, limitExceeded);\n }\n}\n//# sourceMappingURL=readBytesFromStream.js.map","import { getInitCookie } from '../../browser/cookie';\nexport const SYNTHETICS_TEST_ID_COOKIE_NAME = 'datadog-synthetics-public-id';\nexport const SYNTHETICS_RESULT_ID_COOKIE_NAME = 'datadog-synthetics-result-id';\nexport const SYNTHETICS_INJECTS_RUM_COOKIE_NAME = 'datadog-synthetics-injects-rum';\nexport function willSyntheticsInjectRum() {\n return Boolean(window._DATADOG_SYNTHETICS_INJECTS_RUM || getInitCookie(SYNTHETICS_INJECTS_RUM_COOKIE_NAME));\n}\nexport function getSyntheticsTestId() {\n const value = window._DATADOG_SYNTHETICS_PUBLIC_ID || getInitCookie(SYNTHETICS_TEST_ID_COOKIE_NAME);\n return typeof value === 'string' ? value : undefined;\n}\nexport function getSyntheticsResultId() {\n const value = window._DATADOG_SYNTHETICS_RESULT_ID || getInitCookie(SYNTHETICS_RESULT_ID_COOKIE_NAME);\n return typeof value === 'string' ? value : undefined;\n}\n//# sourceMappingURL=syntheticsWorkerValues.js.map","import { display } from './display';\nimport { getType } from './utils/typeUtils';\nexport function isMatchOption(item) {\n const itemType = getType(item);\n return itemType === 'string' || itemType === 'function' || item instanceof RegExp;\n}\n/**\n * Returns true if value can be matched by at least one of the provided MatchOptions.\n * When comparing strings, setting useStartsWith to true will compare the value with the start of\n * the option, instead of requiring an exact match.\n */\nexport function matchList(list, value, useStartsWith = false) {\n return list.some((item) => {\n try {\n if (typeof item === 'function') {\n return item(value);\n }\n else if (item instanceof RegExp) {\n return item.test(value);\n }\n else if (typeof item === 'string') {\n return useStartsWith ? value.startsWith(item) : item === value;\n }\n }\n catch (e) {\n display.error(e);\n }\n return false;\n });\n}\n//# sourceMappingURL=matchOption.js.map","export function buildCommonContext(globalContextManager, userContextManager, accountContextManager, recorderApi) {\n return {\n context: globalContextManager.getContext(),\n user: userContextManager.getContext(),\n account: accountContextManager.getContext(),\n hasReplay: recorderApi.isRecording() ? true : undefined,\n };\n}\n//# sourceMappingURL=commonContext.js.map","import { clocksNow, combine, elapsed, generateUUID, toServerDuration } from '@datadog/browser-core';\nexport function createCustomVitalsState() {\n const vitalsByName = new Map();\n const vitalsByReference = new WeakMap();\n return { vitalsByName, vitalsByReference };\n}\nexport function startVitalCollection(lifeCycle, pageStateHistory, customVitalsState) {\n function isValid(vital) {\n return !pageStateHistory.wasInPageStateDuringPeriod(\"frozen\" /* PageState.FROZEN */, vital.startClocks.relative, vital.duration);\n }\n function addDurationVital(vital) {\n if (isValid(vital)) {\n lifeCycle.notify(12 /* LifeCycleEventType.RAW_RUM_EVENT_COLLECTED */, processVital(vital, true));\n }\n }\n return {\n addDurationVital,\n startDurationVital: (name, options = {}) => startDurationVital(customVitalsState, name, options),\n stopDurationVital: (nameOrRef, options = {}) => {\n stopDurationVital(addDurationVital, customVitalsState, nameOrRef, options);\n },\n };\n}\nexport function startDurationVital({ vitalsByName, vitalsByReference }, name, options = {}) {\n const vital = {\n name,\n startClocks: clocksNow(),\n context: options.context,\n description: options.description,\n };\n // To avoid leaking implementation details of the vital, we return a reference to it.\n const reference = { __dd_vital_reference: true };\n vitalsByName.set(name, vital);\n // To avoid memory leaks caused by the creation of numerous references (e.g., from improper useEffect implementations), we use a WeakMap.\n vitalsByReference.set(reference, vital);\n return reference;\n}\nexport function stopDurationVital(stopCallback, { vitalsByName, vitalsByReference }, nameOrRef, options = {}) {\n const vitalStart = typeof nameOrRef === 'string' ? vitalsByName.get(nameOrRef) : vitalsByReference.get(nameOrRef);\n if (!vitalStart) {\n return;\n }\n stopCallback(buildDurationVital(vitalStart, vitalStart.startClocks, options, clocksNow()));\n if (typeof nameOrRef === 'string') {\n vitalsByName.delete(nameOrRef);\n }\n else {\n vitalsByReference.delete(nameOrRef);\n }\n}\nfunction buildDurationVital(vitalStart, startClocks, stopOptions, stopClocks) {\n var _a;\n return {\n name: vitalStart.name,\n type: \"duration\" /* VitalType.DURATION */,\n startClocks,\n duration: elapsed(startClocks.timeStamp, stopClocks.timeStamp),\n context: combine(vitalStart.context, stopOptions.context),\n description: (_a = stopOptions.description) !== null && _a !== void 0 ? _a : vitalStart.description,\n };\n}\nfunction processVital(vital, valueComputedBySdk) {\n const rawRumEvent = {\n date: vital.startClocks.timeStamp,\n vital: {\n id: generateUUID(),\n type: vital.type,\n name: vital.name,\n duration: toServerDuration(vital.duration),\n description: vital.description,\n },\n type: \"vital\" /* RumEventType.VITAL */,\n };\n if (valueComputedBySdk) {\n rawRumEvent._dd = {\n vital: {\n computed_value: true,\n },\n };\n }\n return {\n rawRumEvent,\n startTime: vital.startClocks.relative,\n duration: vital.duration,\n customerContext: vital.context,\n domainContext: {},\n };\n}\n//# sourceMappingURL=vitalCollection.js.map","export function callPluginsMethod(plugins, methodName, parameter) {\n if (!plugins) {\n return;\n }\n for (const plugin of plugins) {\n const method = plugin[methodName];\n if (method) {\n method(parameter);\n }\n }\n}\n//# sourceMappingURL=plugins.js.map","export function createTraceIdentifier() {\n return createIdentifier(64);\n}\nexport function createSpanIdentifier() {\n return createIdentifier(63);\n}\nfunction createIdentifier(bits) {\n const buffer = crypto.getRandomValues(new Uint32Array(2));\n if (bits === 63) {\n // eslint-disable-next-line no-bitwise\n buffer[buffer.length - 1] >>>= 1; // force 63-bit\n }\n // The `.toString` function is intentionally similar to Number and BigInt `.toString` method.\n //\n // JavaScript numbers can represent integers up to 48 bits, this is why we need two of them to\n // represent a 64 bits identifier. But BigInts don't have this limitation and can represent larger\n // integer values.\n //\n // In the future, when we drop browsers without BigInts support, we could use BigInts directly\n // represent identifiers by simply returning a BigInt from this function (as all we need is a\n // value with a `.toString` method).\n //\n // Examples:\n // const buffer = getCrypto().getRandomValues(new Uint32Array(2))\n // return BigInt(buffer[0]) + BigInt(buffer[1]) << 32n\n //\n // // Alternative with BigUint64Array (different Browser support than plain bigints!):\n // return crypto.getRandomValues(new BigUint64Array(1))[0]\n //\n // For now, let's keep using two plain numbers as having two different implementations (one for\n // browsers with BigInt support and one for older browsers) don't bring much value.\n return {\n toString(radix = 10) {\n let high = buffer[1];\n let low = buffer[0];\n let str = '';\n do {\n const mod = (high % radix) * 4294967296 + low;\n high = Math.floor(high / radix);\n low = Math.floor(mod / radix);\n str = (mod % radix).toString(radix) + str;\n } while (high || low);\n return str;\n },\n };\n}\nexport function toPaddedHexadecimalString(id) {\n return id.toString(16).padStart(16, '0');\n}\n//# sourceMappingURL=identifier.js.map","import { performDraw } from '@datadog/browser-core';\nlet sampleDecisionCache;\nexport function isTraceSampled(sessionId, sampleRate) {\n // Shortcuts for common cases. This is not strictly necessary, but it makes the code faster for\n // customers willing to ingest all traces.\n if (sampleRate === 100) {\n return true;\n }\n if (sampleRate === 0) {\n return false;\n }\n if (sampleDecisionCache && sessionId === sampleDecisionCache.sessionId) {\n return sampleDecisionCache.decision;\n }\n let decision;\n // @ts-expect-error BigInt might not be defined in every browser we support\n if (window.BigInt) {\n decision = sampleUsingKnuthFactor(BigInt(`0x${sessionId.split('-')[4]}`), sampleRate);\n }\n else {\n // For simplicity, we don't use consistent sampling for browser without BigInt support\n // TODO: remove this when all browser we support have BigInt support\n decision = performDraw(sampleRate);\n }\n sampleDecisionCache = { sessionId, decision };\n return decision;\n}\n// Exported for tests\nexport function resetSampleDecisionCache() {\n sampleDecisionCache = undefined;\n}\n/**\n * Perform sampling using the Knuth factor method. This method offer consistent sampling result\n * based on the provided identifier.\n *\n * @param identifier The identifier to use for sampling.\n * @param sampleRate The sample rate in percentage between 0 and 100.\n */\nexport function sampleUsingKnuthFactor(identifier, sampleRate) {\n // The formula is:\n //\n // (identifier * knuthFactor) % 2^64 < sampleRate * 2^64\n //\n // Because JavaScript numbers are 64-bit floats, we can't represent 64-bit integers, and the\n // modulo would be incorrect. Thus, we are using BigInts here.\n //\n // Implementation in other languages:\n // * Go https://github.com/DataDog/dd-trace-go/blob/ec6fbb1f2d517b7b8e69961052adf7136f3af773/ddtrace/tracer/sampler.go#L86-L91\n // * Python https://github.com/DataDog/dd-trace-py/blob/0cee2f066fb6e79aa15947c1514c0f406dea47c5/ddtrace/sampling_rule.py#L197\n // * Ruby https://github.com/DataDog/dd-trace-rb/blob/1a6e255cdcb7e7e22235ea5955f90f6dfa91045d/lib/datadog/tracing/sampling/rate_sampler.rb#L42\n // * C++ https://github.com/DataDog/dd-trace-cpp/blob/159629edc438ae45f2bb318eb7bd51abd05e94b5/src/datadog/trace_sampler.cpp#L58\n // * Java https://github.com/DataDog/dd-trace-java/blob/896dd6b380533216e0bdee59614606c8272d313e/dd-trace-core/src/main/java/datadog/trace/common/sampling/DeterministicSampler.java#L48\n //\n // Note: All implementations have slight variations. Some of them use '<=' instead of '<', and\n // use `sampleRate * 2^64 - 1` instead of `sampleRate * 2^64`. The following implementation\n // should adhere to the spec and is a bit simpler than using a 2^64-1 limit as there are less\n // BigInt arithmetic to write. In practice this does not matter, as we are using floating point\n // numbers in the end, and Number(2n**64n-1n) === Number(2n**64n).\n const knuthFactor = BigInt('1111111111111111111');\n const twoPow64 = BigInt('0x10000000000000000'); // 2n ** 64n\n const hash = (identifier * knuthFactor) % twoPow64;\n return Number(hash) <= (sampleRate / 100) * Number(twoPow64);\n}\n//# sourceMappingURL=sampler.js.map","export const encodedContextCache = new Map();\nexport function getEncodedContext(key) {\n if (!key || typeof key !== 'string') {\n return undefined;\n }\n if (encodedContextCache.has(key)) {\n return encodedContextCache.get(key);\n }\n const encoded = encodeToUtf8Base64(key);\n encodedContextCache.set(key, encoded);\n return encoded;\n}\n/**\n *\n * Helper function to encode a string to base64 in UTF-8\n * Comply with the `_dd.p.usr` standard and avoid non-ASCII characters\n * https://developer.mozilla.org/en-US/docs/Web/API/Window/btoa\n */\nexport function encodeToUtf8Base64(plainText) {\n const bytes = new TextEncoder().encode(plainText);\n const binString = String.fromCodePoint(...bytes);\n return btoa(binString);\n}\n//# sourceMappingURL=encodedContext.js.map","import { objectEntries, shallowClone, getType, isMatchOption, matchList, TraceContextInjection, isExperimentalFeatureEnabled, ExperimentalFeature, } from '@datadog/browser-core';\nimport { createSpanIdentifier, createTraceIdentifier, toPaddedHexadecimalString } from './identifier';\nimport { isTraceSampled } from './sampler';\nimport { getEncodedContext } from './encodedContext';\nexport function isTracingOption(item) {\n const expectedItem = item;\n return (getType(expectedItem) === 'object' &&\n isMatchOption(expectedItem.match) &&\n Array.isArray(expectedItem.propagatorTypes));\n}\n/**\n * Clear tracing information to avoid incomplete traces. Ideally, we should do it when the\n * request did not reach the server, but the browser does not expose this. So, we clear tracing\n * information if the request ended with status 0 without being aborted by the application.\n *\n * Reasoning:\n *\n * * Applications are usually aborting requests after a bit of time, for example when the user is\n * typing (autocompletion) or navigating away (in a SPA). With a performant device and good\n * network conditions, the request is likely to reach the server before being canceled.\n *\n * * Requests aborted otherwise (ex: lack of internet, CORS issue, blocked by a privacy extension)\n * are likely to finish quickly and without reaching the server.\n *\n * Of course, it might not be the case every time, but it should limit having incomplete traces a\n * bit.\n * */\nexport function clearTracingIfNeeded(context) {\n if (context.status === 0 && !context.isAborted) {\n context.traceId = undefined;\n context.spanId = undefined;\n context.traceSampled = undefined;\n }\n}\nexport function startTracer(configuration, sessionManager, getCommonContext) {\n return {\n clearTracingIfNeeded,\n traceFetch: (context) => injectHeadersIfTracingAllowed(configuration, context, sessionManager, getCommonContext, (tracingHeaders) => {\n var _a;\n if (context.input instanceof Request && !((_a = context.init) === null || _a === void 0 ? void 0 : _a.headers)) {\n context.input = new Request(context.input);\n Object.keys(tracingHeaders).forEach((key) => {\n ;\n context.input.headers.append(key, tracingHeaders[key]);\n });\n }\n else {\n context.init = shallowClone(context.init);\n const headers = [];\n if (context.init.headers instanceof Headers) {\n context.init.headers.forEach((value, key) => {\n headers.push([key, value]);\n });\n }\n else if (Array.isArray(context.init.headers)) {\n context.init.headers.forEach((header) => {\n headers.push(header);\n });\n }\n else if (context.init.headers) {\n Object.keys(context.init.headers).forEach((key) => {\n headers.push([key, context.init.headers[key]]);\n });\n }\n context.init.headers = headers.concat(objectEntries(tracingHeaders));\n }\n }),\n traceXhr: (context, xhr) => injectHeadersIfTracingAllowed(configuration, context, sessionManager, getCommonContext, (tracingHeaders) => {\n Object.keys(tracingHeaders).forEach((name) => {\n xhr.setRequestHeader(name, tracingHeaders[name]);\n });\n }),\n };\n}\nfunction injectHeadersIfTracingAllowed(configuration, context, sessionManager, getCommonContext, inject) {\n const session = sessionManager.findTrackedSession();\n if (!session) {\n return;\n }\n const tracingOption = configuration.allowedTracingUrls.find((tracingOption) => matchList([tracingOption.match], context.url, true));\n if (!tracingOption) {\n return;\n }\n const traceSampled = isTraceSampled(session.id, configuration.traceSampleRate);\n const shouldInjectHeaders = traceSampled || configuration.traceContextInjection === TraceContextInjection.ALL;\n if (!shouldInjectHeaders) {\n return;\n }\n context.traceSampled = traceSampled;\n context.traceId = createTraceIdentifier();\n context.spanId = createSpanIdentifier();\n inject(makeTracingHeaders(context.traceId, context.spanId, context.traceSampled, tracingOption.propagatorTypes, getCommonContext));\n}\n/**\n * When trace is not sampled, set priority to '0' instead of not adding the tracing headers\n * to prepare the implementation for sampling delegation.\n */\nfunction makeTracingHeaders(traceId, spanId, traceSampled, propagatorTypes, getCommonContext) {\n const tracingHeaders = {};\n propagatorTypes.forEach((propagatorType) => {\n switch (propagatorType) {\n case 'datadog': {\n Object.assign(tracingHeaders, {\n 'x-datadog-origin': 'rum',\n 'x-datadog-parent-id': spanId.toString(),\n 'x-datadog-sampling-priority': traceSampled ? '1' : '0',\n 'x-datadog-trace-id': traceId.toString(),\n });\n break;\n }\n // https://www.w3.org/TR/trace-context/\n case 'tracecontext': {\n Object.assign(tracingHeaders, {\n traceparent: `00-0000000000000000${toPaddedHexadecimalString(traceId)}-${toPaddedHexadecimalString(spanId)}-0${traceSampled ? '1' : '0'}`,\n tracestate: `dd=${getTraceStateDatadogItems(traceSampled, getCommonContext).join(';')}`,\n });\n break;\n }\n // https://github.com/openzipkin/b3-propagation\n case 'b3': {\n Object.assign(tracingHeaders, {\n b3: `${toPaddedHexadecimalString(traceId)}-${toPaddedHexadecimalString(spanId)}-${traceSampled ? '1' : '0'}`,\n });\n break;\n }\n case 'b3multi': {\n Object.assign(tracingHeaders, {\n 'X-B3-TraceId': toPaddedHexadecimalString(traceId),\n 'X-B3-SpanId': toPaddedHexadecimalString(spanId),\n 'X-B3-Sampled': traceSampled ? '1' : '0',\n });\n break;\n }\n }\n });\n return tracingHeaders;\n}\nfunction getTraceStateDatadogItems(traceSampled, getCommonContext) {\n const traceStateDatadogItems = [`s:${traceSampled ? '1' : '0'}`, 'o:rum'];\n if (isExperimentalFeatureEnabled(ExperimentalFeature.USER_ACCOUNT_TRACE_HEADER)) {\n /**\n * We should only enable this feature after the decoding service is available\n */\n const userIdEncoded = getEncodedContext(getCommonContext().user.id);\n const accountIdEncoded = getEncodedContext(getCommonContext().account.id);\n if (userIdEncoded) {\n traceStateDatadogItems.push(`t.usr.id:${userIdEncoded}`);\n }\n if (accountIdEncoded) {\n traceStateDatadogItems.push(`t.account.id:${accountIdEncoded}`);\n }\n }\n return traceStateDatadogItems;\n}\n//# sourceMappingURL=tracer.js.map","import { getType, isMatchOption, serializeConfiguration, DefaultPrivacyLevel, TraceContextInjection, display, objectHasValue, validateAndBuildConfiguration, isSampleRate, isNumber, isExperimentalFeatureEnabled, ExperimentalFeature, } from '@datadog/browser-core';\nimport { isTracingOption } from '../tracing/tracer';\nexport const DEFAULT_PROPAGATOR_TYPES = ['tracecontext', 'datadog'];\nexport function validateAndBuildRumConfiguration(initConfiguration) {\n var _a, _b, _c, _d, _e, _f, _g;\n if (initConfiguration.trackFeatureFlagsForEvents !== undefined &&\n !Array.isArray(initConfiguration.trackFeatureFlagsForEvents)) {\n display.warn('trackFeatureFlagsForEvents should be an array');\n }\n if (!initConfiguration.applicationId) {\n display.error('Application ID is not configured, no RUM data will be collected.');\n return;\n }\n if (!isSampleRate(initConfiguration.sessionReplaySampleRate, 'Session Replay') ||\n !isSampleRate(initConfiguration.traceSampleRate, 'Trace')) {\n return;\n }\n if (initConfiguration.excludedActivityUrls !== undefined && !Array.isArray(initConfiguration.excludedActivityUrls)) {\n display.error('Excluded Activity Urls should be an array');\n return;\n }\n const allowedTracingUrls = validateAndBuildTracingOptions(initConfiguration);\n if (!allowedTracingUrls) {\n return;\n }\n const baseConfiguration = validateAndBuildConfiguration(initConfiguration);\n if (!baseConfiguration) {\n return;\n }\n const profilingEnabled = isExperimentalFeatureEnabled(ExperimentalFeature.PROFILING);\n const sessionReplaySampleRate = (_a = initConfiguration.sessionReplaySampleRate) !== null && _a !== void 0 ? _a : 0;\n return {\n applicationId: initConfiguration.applicationId,\n version: initConfiguration.version || undefined,\n actionNameAttribute: initConfiguration.actionNameAttribute,\n sessionReplaySampleRate,\n startSessionReplayRecordingManually: initConfiguration.startSessionReplayRecordingManually !== undefined\n ? !!initConfiguration.startSessionReplayRecordingManually\n : sessionReplaySampleRate === 0,\n traceSampleRate: (_b = initConfiguration.traceSampleRate) !== null && _b !== void 0 ? _b : 100,\n rulePsr: isNumber(initConfiguration.traceSampleRate) ? initConfiguration.traceSampleRate / 100 : undefined,\n allowedTracingUrls,\n excludedActivityUrls: (_c = initConfiguration.excludedActivityUrls) !== null && _c !== void 0 ? _c : [],\n workerUrl: initConfiguration.workerUrl,\n compressIntakeRequests: !!initConfiguration.compressIntakeRequests,\n trackUserInteractions: !!((_d = initConfiguration.trackUserInteractions) !== null && _d !== void 0 ? _d : true),\n trackViewsManually: !!initConfiguration.trackViewsManually,\n trackResources: !!((_e = initConfiguration.trackResources) !== null && _e !== void 0 ? _e : true),\n trackLongTasks: !!((_f = initConfiguration.trackLongTasks) !== null && _f !== void 0 ? _f : true),\n subdomain: initConfiguration.subdomain,\n defaultPrivacyLevel: objectHasValue(DefaultPrivacyLevel, initConfiguration.defaultPrivacyLevel)\n ? initConfiguration.defaultPrivacyLevel\n : DefaultPrivacyLevel.MASK,\n enablePrivacyForActionName: !!initConfiguration.enablePrivacyForActionName,\n customerDataTelemetrySampleRate: 1,\n traceContextInjection: objectHasValue(TraceContextInjection, initConfiguration.traceContextInjection)\n ? initConfiguration.traceContextInjection\n : TraceContextInjection.SAMPLED,\n plugins: initConfiguration.plugins || [],\n trackFeatureFlagsForEvents: initConfiguration.trackFeatureFlagsForEvents || [],\n profilingSampleRate: profilingEnabled ? ((_g = initConfiguration.profilingSampleRate) !== null && _g !== void 0 ? _g : 0) : 0, // Enforce 0 if profiling is not enabled, and set 0 as default when not set.\n ...baseConfiguration,\n };\n}\n/**\n * Validates allowedTracingUrls and converts match options to tracing options\n */\nfunction validateAndBuildTracingOptions(initConfiguration) {\n if (initConfiguration.allowedTracingUrls === undefined) {\n return [];\n }\n if (!Array.isArray(initConfiguration.allowedTracingUrls)) {\n display.error('Allowed Tracing URLs should be an array');\n return;\n }\n if (initConfiguration.allowedTracingUrls.length !== 0 && initConfiguration.service === undefined) {\n display.error('Service needs to be configured when tracing is enabled');\n return;\n }\n // Convert from (MatchOption | TracingOption) to TracingOption, remove unknown properties\n const tracingOptions = [];\n initConfiguration.allowedTracingUrls.forEach((option) => {\n if (isMatchOption(option)) {\n tracingOptions.push({ match: option, propagatorTypes: DEFAULT_PROPAGATOR_TYPES });\n }\n else if (isTracingOption(option)) {\n tracingOptions.push(option);\n }\n else {\n display.warn('Allowed Tracing Urls parameters should be a string, RegExp, function, or an object. Ignoring parameter', option);\n }\n });\n return tracingOptions;\n}\n/**\n * Combines the selected tracing propagators from the different options in allowedTracingUrls\n */\nfunction getSelectedTracingPropagators(configuration) {\n const usedTracingPropagators = new Set();\n if (Array.isArray(configuration.allowedTracingUrls) && configuration.allowedTracingUrls.length > 0) {\n configuration.allowedTracingUrls.forEach((option) => {\n if (isMatchOption(option)) {\n DEFAULT_PROPAGATOR_TYPES.forEach((propagatorType) => usedTracingPropagators.add(propagatorType));\n }\n else if (getType(option) === 'object' && Array.isArray(option.propagatorTypes)) {\n // Ensure we have an array, as we cannot rely on types yet (configuration is provided by users)\n option.propagatorTypes.forEach((propagatorType) => usedTracingPropagators.add(propagatorType));\n }\n });\n }\n return Array.from(usedTracingPropagators);\n}\nexport function serializeRumConfiguration(configuration) {\n var _a;\n const baseSerializedConfiguration = serializeConfiguration(configuration);\n return {\n session_replay_sample_rate: configuration.sessionReplaySampleRate,\n start_session_replay_recording_manually: configuration.startSessionReplayRecordingManually,\n trace_sample_rate: configuration.traceSampleRate,\n trace_context_injection: configuration.traceContextInjection,\n action_name_attribute: configuration.actionNameAttribute,\n use_allowed_tracing_urls: Array.isArray(configuration.allowedTracingUrls) && configuration.allowedTracingUrls.length > 0,\n selected_tracing_propagators: getSelectedTracingPropagators(configuration),\n default_privacy_level: configuration.defaultPrivacyLevel,\n enable_privacy_for_action_name: configuration.enablePrivacyForActionName,\n use_excluded_activity_urls: Array.isArray(configuration.excludedActivityUrls) && configuration.excludedActivityUrls.length > 0,\n use_worker_url: !!configuration.workerUrl,\n compress_intake_requests: configuration.compressIntakeRequests,\n track_views_manually: configuration.trackViewsManually,\n track_user_interactions: configuration.trackUserInteractions,\n track_resources: configuration.trackResources,\n track_long_task: configuration.trackLongTasks,\n plugins: (_a = configuration.plugins) === null || _a === void 0 ? void 0 : _a.map((plugin) => {\n var _a;\n return ({\n name: plugin.name,\n ...(_a = plugin.getConfigurationTelemetry) === null || _a === void 0 ? void 0 : _a.call(plugin),\n });\n }),\n track_feature_flags_for_events: configuration.trackFeatureFlagsForEvents,\n ...baseSerializedConfiguration,\n };\n}\n//# sourceMappingURL=configuration.js.map","import { display, addEventListener, buildEndpointHost } from '@datadog/browser-core';\nconst REMOTE_CONFIGURATION_VERSION = 'v1';\nexport function fetchAndApplyRemoteConfiguration(initConfiguration, callback) {\n fetchRemoteConfiguration(initConfiguration, (remoteInitConfiguration) => {\n callback(applyRemoteConfiguration(initConfiguration, remoteInitConfiguration));\n });\n}\nexport function applyRemoteConfiguration(initConfiguration, remoteInitConfiguration) {\n return { ...initConfiguration, ...remoteInitConfiguration };\n}\nexport function fetchRemoteConfiguration(configuration, callback) {\n const xhr = new XMLHttpRequest();\n addEventListener(configuration, xhr, 'load', function () {\n if (xhr.status === 200) {\n const remoteConfiguration = JSON.parse(xhr.responseText);\n callback(remoteConfiguration.rum);\n }\n else {\n displayRemoteConfigurationFetchingError();\n }\n });\n addEventListener(configuration, xhr, 'error', function () {\n displayRemoteConfigurationFetchingError();\n });\n xhr.open('GET', buildEndpoint(configuration));\n xhr.send();\n}\nexport function buildEndpoint(configuration) {\n return `https://sdk-configuration.${buildEndpointHost('rum', configuration)}/${REMOTE_CONFIGURATION_VERSION}/${encodeURIComponent(configuration.remoteConfigurationId)}.json`;\n}\nfunction displayRemoteConfigurationFetchingError() {\n display.error('Error fetching the remote configuration.');\n}\n//# sourceMappingURL=remoteConfiguration.js.map","import { createBoundedBuffer, display, canUseEventBridge, displayAlreadyInitializedError, willSyntheticsInjectRum, noop, timeStampNow, clocksNow, getEventBridge, initFeatureFlags, addTelemetryConfiguration, initFetchObservable, } from '@datadog/browser-core';\nimport { validateAndBuildRumConfiguration, } from '../domain/configuration';\nimport { startDurationVital, stopDurationVital } from '../domain/vital/vitalCollection';\nimport { fetchAndApplyRemoteConfiguration, serializeRumConfiguration } from '../domain/configuration';\nimport { callPluginsMethod } from '../domain/plugins';\nexport function createPreStartStrategy({ ignoreInitIfSyntheticsWillInjectRum, startDeflateWorker }, getCommonContext, trackingConsentState, customVitalsState, doStartRum) {\n const bufferApiCalls = createBoundedBuffer();\n let firstStartViewCall;\n let deflateWorker;\n let cachedInitConfiguration;\n let cachedConfiguration;\n const trackingConsentStateSubscription = trackingConsentState.observable.subscribe(tryStartRum);\n const emptyContext = {};\n function tryStartRum() {\n if (!cachedInitConfiguration || !cachedConfiguration || !trackingConsentState.isGranted()) {\n return;\n }\n trackingConsentStateSubscription.unsubscribe();\n let initialViewOptions;\n if (cachedConfiguration.trackViewsManually) {\n if (!firstStartViewCall) {\n return;\n }\n // An initial view is always created when starting RUM.\n // When tracking views automatically, any startView call before RUM start creates an extra\n // view.\n // When tracking views manually, we use the ViewOptions from the first startView call as the\n // initial view options, and we remove the actual startView call so we don't create an extra\n // view.\n bufferApiCalls.remove(firstStartViewCall.callback);\n initialViewOptions = firstStartViewCall.options;\n }\n const startRumResult = doStartRum(cachedConfiguration, deflateWorker, initialViewOptions);\n bufferApiCalls.drain(startRumResult);\n }\n function doInit(initConfiguration) {\n const eventBridgeAvailable = canUseEventBridge();\n if (eventBridgeAvailable) {\n initConfiguration = overrideInitConfigurationForBridge(initConfiguration);\n }\n // Update the exposed initConfiguration to reflect the bridge and remote configuration overrides\n cachedInitConfiguration = initConfiguration;\n addTelemetryConfiguration(serializeRumConfiguration(initConfiguration));\n if (cachedConfiguration) {\n displayAlreadyInitializedError('DD_RUM', initConfiguration);\n return;\n }\n const configuration = validateAndBuildRumConfiguration(initConfiguration);\n if (!configuration) {\n return;\n }\n if (!eventBridgeAvailable && !configuration.sessionStoreStrategyType) {\n display.warn('No storage available for session. We will not send any data.');\n return;\n }\n if (configuration.compressIntakeRequests && !eventBridgeAvailable && startDeflateWorker) {\n deflateWorker = startDeflateWorker(configuration, 'Datadog RUM', \n // Worker initialization can fail asynchronously, especially in Firefox where even CSP\n // issues are reported asynchronously. For now, the SDK will continue its execution even if\n // data won't be sent to Datadog. We could improve this behavior in the future.\n noop);\n if (!deflateWorker) {\n // `startDeflateWorker` should have logged an error message explaining the issue\n return;\n }\n }\n cachedConfiguration = configuration;\n // Instrumuent fetch to track network requests\n // This is needed in case the consent is not granted and some cutsomer\n // library (Apollo Client) is storing uninstrumented fetch to be used later\n // The subscrption is needed so that the instrumentation process is completed\n initFetchObservable().subscribe(noop);\n trackingConsentState.tryToInit(configuration.trackingConsent);\n tryStartRum();\n }\n const addDurationVital = (vital) => {\n bufferApiCalls.add((startRumResult) => startRumResult.addDurationVital(vital));\n };\n const strategy = {\n init(initConfiguration, publicApi) {\n if (!initConfiguration) {\n display.error('Missing configuration');\n return;\n }\n // Set the experimental feature flags as early as possible, so we can use them in most places\n initFeatureFlags(initConfiguration.enableExperimentalFeatures);\n // Expose the initial configuration regardless of initialization success.\n cachedInitConfiguration = initConfiguration;\n // If we are in a Synthetics test configured to automatically inject a RUM instance, we want\n // to completely discard the customer application RUM instance by ignoring their init() call.\n // But, we should not ignore the init() call from the Synthetics-injected RUM instance, so the\n // internal `ignoreInitIfSyntheticsWillInjectRum` option is here to bypass this condition.\n if (ignoreInitIfSyntheticsWillInjectRum && willSyntheticsInjectRum()) {\n return;\n }\n callPluginsMethod(initConfiguration.plugins, 'onInit', { initConfiguration, publicApi });\n if (initConfiguration.remoteConfigurationId) {\n fetchAndApplyRemoteConfiguration(initConfiguration, doInit);\n }\n else {\n doInit(initConfiguration);\n }\n },\n get initConfiguration() {\n return cachedInitConfiguration;\n },\n getInternalContext: noop,\n stopSession: noop,\n addTiming(name, time = timeStampNow()) {\n bufferApiCalls.add((startRumResult) => startRumResult.addTiming(name, time));\n },\n startView(options, startClocks = clocksNow()) {\n const callback = (startRumResult) => {\n startRumResult.startView(options, startClocks);\n };\n bufferApiCalls.add(callback);\n if (!firstStartViewCall) {\n firstStartViewCall = { options, callback };\n tryStartRum();\n }\n },\n setViewName(name) {\n bufferApiCalls.add((startRumResult) => startRumResult.setViewName(name));\n },\n setViewContext(context) {\n bufferApiCalls.add((startRumResult) => startRumResult.setViewContext(context));\n },\n setViewContextProperty(key, value) {\n bufferApiCalls.add((startRumResult) => startRumResult.setViewContextProperty(key, value));\n },\n getViewContext: () => emptyContext,\n addAction(action, commonContext = getCommonContext()) {\n bufferApiCalls.add((startRumResult) => startRumResult.addAction(action, commonContext));\n },\n addError(providedError, commonContext = getCommonContext()) {\n bufferApiCalls.add((startRumResult) => startRumResult.addError(providedError, commonContext));\n },\n addFeatureFlagEvaluation(key, value) {\n bufferApiCalls.add((startRumResult) => startRumResult.addFeatureFlagEvaluation(key, value));\n },\n startDurationVital(name, options) {\n return startDurationVital(customVitalsState, name, options);\n },\n stopDurationVital(name, options) {\n stopDurationVital(addDurationVital, customVitalsState, name, options);\n },\n addDurationVital,\n };\n return strategy;\n}\nfunction overrideInitConfigurationForBridge(initConfiguration) {\n var _a, _b;\n return {\n ...initConfiguration,\n applicationId: '00000000-aaaa-0000-aaaa-000000000000',\n clientToken: 'empty',\n sessionSampleRate: 100,\n defaultPrivacyLevel: (_a = initConfiguration.defaultPrivacyLevel) !== null && _a !== void 0 ? _a : (_b = getEventBridge()) === null || _b === void 0 ? void 0 : _b.getPrivacyLevel(),\n };\n}\n//# sourceMappingURL=preStartRum.js.map","import { addTelemetryUsage, createContextManager, deepClone, makePublicApi, monitor, clocksNow, callMonitored, createHandlingStack, sanitize, createIdentityEncoder, createCustomerDataTrackerManager, storeContextManager, displayAlreadyInitializedError, createTrackingConsentState, timeStampToClocks, } from '@datadog/browser-core';\nimport { buildCommonContext } from '../domain/contexts/commonContext';\nimport { createCustomVitalsState } from '../domain/vital/vitalCollection';\nimport { callPluginsMethod } from '../domain/plugins';\nimport { createPreStartStrategy } from './preStartRum';\nconst RUM_STORAGE_KEY = 'rum';\nexport function makeRumPublicApi(startRumImpl, recorderApi, profilerApi, options = {}) {\n const customerDataTrackerManager = createCustomerDataTrackerManager(0 /* CustomerDataCompressionStatus.Unknown */);\n const globalContextManager = createContextManager('global context', {\n customerDataTracker: customerDataTrackerManager.getOrCreateTracker(2 /* CustomerDataType.GlobalContext */),\n });\n const userContextManager = createContextManager('user', {\n customerDataTracker: customerDataTrackerManager.getOrCreateTracker(1 /* CustomerDataType.User */),\n propertiesConfig: {\n id: { type: 'string' },\n name: { type: 'string' },\n email: { type: 'string' },\n },\n });\n const accountContextManager = createContextManager('account', {\n customerDataTracker: customerDataTrackerManager.getOrCreateTracker(4 /* CustomerDataType.Account */),\n propertiesConfig: {\n id: { type: 'string', required: true },\n name: { type: 'string' },\n },\n });\n const trackingConsentState = createTrackingConsentState();\n const customVitalsState = createCustomVitalsState();\n function getCommonContext() {\n return buildCommonContext(globalContextManager, userContextManager, accountContextManager, recorderApi);\n }\n let strategy = createPreStartStrategy(options, getCommonContext, trackingConsentState, customVitalsState, (configuration, deflateWorker, initialViewOptions) => {\n if (configuration.storeContextsAcrossPages) {\n storeContextManager(configuration, globalContextManager, RUM_STORAGE_KEY, 2 /* CustomerDataType.GlobalContext */);\n storeContextManager(configuration, userContextManager, RUM_STORAGE_KEY, 1 /* CustomerDataType.User */);\n storeContextManager(configuration, accountContextManager, RUM_STORAGE_KEY, 4 /* CustomerDataType.Account */);\n }\n customerDataTrackerManager.setCompressionStatus(deflateWorker ? 1 /* CustomerDataCompressionStatus.Enabled */ : 2 /* CustomerDataCompressionStatus.Disabled */);\n const startRumResult = startRumImpl(configuration, recorderApi, profilerApi, customerDataTrackerManager, getCommonContext, initialViewOptions, deflateWorker && options.createDeflateEncoder\n ? (streamId) => options.createDeflateEncoder(configuration, deflateWorker, streamId)\n : createIdentityEncoder, trackingConsentState, customVitalsState);\n recorderApi.onRumStart(startRumResult.lifeCycle, configuration, startRumResult.session, startRumResult.viewHistory, deflateWorker);\n profilerApi.onRumStart(startRumResult.lifeCycle, configuration, startRumResult.session, startRumResult.viewHistory);\n strategy = createPostStartStrategy(strategy, startRumResult);\n callPluginsMethod(configuration.plugins, 'onRumStart', { strategy });\n return startRumResult;\n });\n const startView = monitor((options) => {\n const sanitizedOptions = typeof options === 'object' ? options : { name: options };\n if (sanitizedOptions.context) {\n customerDataTrackerManager.getOrCreateTracker(3 /* CustomerDataType.View */).updateCustomerData(sanitizedOptions.context);\n }\n strategy.startView(sanitizedOptions);\n addTelemetryUsage({ feature: 'start-view' });\n });\n const rumPublicApi = makePublicApi({\n init: monitor((initConfiguration) => {\n strategy.init(initConfiguration, rumPublicApi);\n }),\n setTrackingConsent: monitor((trackingConsent) => {\n trackingConsentState.update(trackingConsent);\n addTelemetryUsage({ feature: 'set-tracking-consent', tracking_consent: trackingConsent });\n }),\n setViewName: monitor((name) => {\n strategy.setViewName(name);\n addTelemetryUsage({ feature: 'set-view-name' });\n }),\n setViewContext: monitor((context) => {\n strategy.setViewContext(context);\n addTelemetryUsage({ feature: 'set-view-context' });\n }),\n setViewContextProperty: monitor((key, value) => {\n strategy.setViewContextProperty(key, value);\n addTelemetryUsage({ feature: 'set-view-context-property' });\n }),\n getViewContext: monitor(() => {\n addTelemetryUsage({ feature: 'set-view-context-property' });\n return strategy.getViewContext();\n }),\n setGlobalContext: monitor((context) => {\n globalContextManager.setContext(context);\n addTelemetryUsage({ feature: 'set-global-context' });\n }),\n getGlobalContext: monitor(() => globalContextManager.getContext()),\n setGlobalContextProperty: monitor((key, value) => {\n globalContextManager.setContextProperty(key, value);\n addTelemetryUsage({ feature: 'set-global-context' });\n }),\n removeGlobalContextProperty: monitor((key) => globalContextManager.removeContextProperty(key)),\n clearGlobalContext: monitor(() => globalContextManager.clearContext()),\n getInternalContext: monitor((startTime) => strategy.getInternalContext(startTime)),\n getInitConfiguration: monitor(() => deepClone(strategy.initConfiguration)),\n addAction: (name, context) => {\n const handlingStack = createHandlingStack('action');\n callMonitored(() => {\n strategy.addAction({\n name: sanitize(name),\n context: sanitize(context),\n startClocks: clocksNow(),\n type: \"custom\" /* ActionType.CUSTOM */,\n handlingStack,\n });\n addTelemetryUsage({ feature: 'add-action' });\n });\n },\n addError: (error, context) => {\n const handlingStack = createHandlingStack('error');\n callMonitored(() => {\n strategy.addError({\n error, // Do not sanitize error here, it is needed unserialized by computeRawError()\n handlingStack,\n context: sanitize(context),\n startClocks: clocksNow(),\n });\n addTelemetryUsage({ feature: 'add-error' });\n });\n },\n addTiming: monitor((name, time) => {\n // TODO: next major decide to drop relative time support or update its behaviour\n strategy.addTiming(sanitize(name), time);\n }),\n setUser: monitor((newUser) => {\n userContextManager.setContext(newUser);\n addTelemetryUsage({ feature: 'set-user' });\n }),\n getUser: monitor(userContextManager.getContext),\n setUserProperty: monitor((key, property) => {\n userContextManager.setContextProperty(key, property);\n addTelemetryUsage({ feature: 'set-user' });\n }),\n removeUserProperty: monitor(userContextManager.removeContextProperty),\n clearUser: monitor(userContextManager.clearContext),\n setAccount: monitor(accountContextManager.setContext),\n getAccount: monitor(accountContextManager.getContext),\n setAccountProperty: monitor(accountContextManager.setContextProperty),\n removeAccountProperty: monitor(accountContextManager.removeContextProperty),\n clearAccount: monitor(accountContextManager.clearContext),\n startView,\n stopSession: monitor(() => {\n strategy.stopSession();\n addTelemetryUsage({ feature: 'stop-session' });\n }),\n addFeatureFlagEvaluation: monitor((key, value) => {\n strategy.addFeatureFlagEvaluation(sanitize(key), sanitize(value));\n addTelemetryUsage({ feature: 'add-feature-flag-evaluation' });\n }),\n getSessionReplayLink: monitor(() => recorderApi.getSessionReplayLink()),\n startSessionReplayRecording: monitor((options) => {\n recorderApi.start(options);\n addTelemetryUsage({ feature: 'start-session-replay-recording', force: options && options.force });\n }),\n stopSessionReplayRecording: monitor(() => recorderApi.stop()),\n addDurationVital: monitor((name, options) => {\n addTelemetryUsage({ feature: 'add-duration-vital' });\n strategy.addDurationVital({\n name: sanitize(name),\n type: \"duration\" /* VitalType.DURATION */,\n startClocks: timeStampToClocks(options.startTime),\n duration: options.duration,\n context: sanitize(options && options.context),\n description: sanitize(options && options.description),\n });\n }),\n startDurationVital: monitor((name, options) => {\n addTelemetryUsage({ feature: 'start-duration-vital' });\n return strategy.startDurationVital(sanitize(name), {\n context: sanitize(options && options.context),\n description: sanitize(options && options.description),\n });\n }),\n stopDurationVital: monitor((nameOrRef, options) => {\n addTelemetryUsage({ feature: 'stop-duration-vital' });\n strategy.stopDurationVital(typeof nameOrRef === 'string' ? sanitize(nameOrRef) : nameOrRef, {\n context: sanitize(options && options.context),\n description: sanitize(options && options.description),\n });\n }),\n });\n return rumPublicApi;\n}\nfunction createPostStartStrategy(preStartStrategy, startRumResult) {\n return {\n init: (initConfiguration) => {\n displayAlreadyInitializedError('DD_RUM', initConfiguration);\n },\n initConfiguration: preStartStrategy.initConfiguration,\n ...startRumResult,\n };\n}\n//# sourceMappingURL=rumPublicApi.js.map","import { monitor, noop, Observable, getZoneJsOriginalValue } from '@datadog/browser-core';\nexport function createDOMMutationObservable() {\n const MutationObserver = getMutationObserverConstructor();\n return new Observable((observable) => {\n if (!MutationObserver) {\n return;\n }\n const observer = new MutationObserver(monitor(() => observable.notify()));\n observer.observe(document, {\n attributes: true,\n characterData: true,\n childList: true,\n subtree: true,\n });\n return () => observer.disconnect();\n });\n}\nexport function getMutationObserverConstructor() {\n let constructor;\n const browserWindow = window;\n // Angular uses Zone.js to provide a context persisting across async tasks. Zone.js replaces the\n // global MutationObserver constructor with a patched version to support the context propagation.\n // There is an ongoing issue[1][2] with this setup when using a MutationObserver within a Angular\n // component: on some occasions, the callback is being called in an infinite loop, causing the\n // page to freeze (even if the callback is completely empty).\n //\n // To work around this issue, we try to get the original MutationObserver constructor stored by\n // Zone.js.\n //\n // [1] https://github.com/angular/angular/issues/26948\n // [2] https://github.com/angular/angular/issues/31712\n if (browserWindow.Zone) {\n // Zone.js 0.8.6+ is storing original class constructors into the browser 'window' object[3].\n //\n // [3] https://github.com/angular/angular/blob/6375fa79875c0fe7b815efc45940a6e6f5c9c9eb/packages/zone.js/lib/common/utils.ts#L288\n constructor = getZoneJsOriginalValue(browserWindow, 'MutationObserver');\n if (browserWindow.MutationObserver && constructor === browserWindow.MutationObserver) {\n // Anterior Zone.js versions (used in Angular 2) does not expose the original MutationObserver\n // in the 'window' object. Luckily, the patched MutationObserver class is storing an original\n // instance in its properties[4]. Let's get the original MutationObserver constructor from\n // there.\n //\n // [4] https://github.com/angular/zone.js/blob/v0.8.5/lib/common/utils.ts#L412\n const patchedInstance = new browserWindow.MutationObserver(noop);\n const originalInstance = getZoneJsOriginalValue(patchedInstance, 'originalInstance');\n constructor = originalInstance && originalInstance.constructor;\n }\n }\n if (!constructor) {\n constructor = browserWindow.MutationObserver;\n }\n return constructor;\n}\n//# sourceMappingURL=domMutationObservable.js.map","import { instrumentMethod, Observable } from '@datadog/browser-core';\nexport function createWindowOpenObservable() {\n const observable = new Observable();\n const { stop } = instrumentMethod(window, 'open', () => observable.notify());\n return { observable, stop };\n}\n//# sourceMappingURL=windowOpenObservable.js.map","import { sanitize, deepClone, getType, objectEntries } from '@datadog/browser-core';\n/**\n * Allows declaring and enforcing modifications to specific fields of an object.\n * Only supports modifying properties of an object (even if nested in an array).\n * Does not support array manipulation (adding/removing items).\n */\nexport function limitModification(object, modifiableFieldPaths, modifier) {\n const clone = deepClone(object);\n const result = modifier(clone);\n objectEntries(modifiableFieldPaths).forEach(([fieldPath, fieldType]) => \n // Traverse both object and clone simultaneously up to the path and apply the modification from the clone to the original object when the type is valid\n setValueAtPath(object, clone, fieldPath.split(/\\.|(?=\\[\\])/), fieldType));\n return result;\n}\nfunction setValueAtPath(object, clone, pathSegments, fieldType) {\n const [field, ...restPathSegments] = pathSegments;\n if (field === '[]') {\n if (Array.isArray(object) && Array.isArray(clone)) {\n object.forEach((item, i) => setValueAtPath(item, clone[i], restPathSegments, fieldType));\n }\n return;\n }\n if (!isValidObject(object) || !isValidObject(clone)) {\n return;\n }\n if (restPathSegments.length > 0) {\n return setValueAtPath(object[field], clone[field], restPathSegments, fieldType);\n }\n setNestedValue(object, field, clone[field], fieldType);\n}\nfunction setNestedValue(object, field, value, fieldType) {\n const newType = getType(value);\n if (newType === fieldType) {\n object[field] = sanitize(value);\n }\n else if (fieldType === 'object' && (newType === 'undefined' || newType === 'null')) {\n object[field] = {};\n }\n}\nfunction isValidObject(object) {\n return getType(object) === 'object';\n}\n//# sourceMappingURL=limitModification.js.map","import { combine, isEmptyObject, timeStampNow, currentDrift, display, createEventRateLimiter, canUseEventBridge, round, isExperimentalFeatureEnabled, ExperimentalFeature, getConnectivity, addTelemetryDebug, } from '@datadog/browser-core';\nimport { limitModification } from './limitModification';\nconst VIEW_MODIFIABLE_FIELD_PATHS = {\n 'view.name': 'string',\n 'view.url': 'string',\n 'view.referrer': 'string',\n};\nconst USER_CUSTOMIZABLE_FIELD_PATHS = {\n context: 'object',\n};\nconst ROOT_MODIFIABLE_FIELD_PATHS = {\n service: 'string',\n version: 'string',\n};\nlet modifiableFieldPathsByEvent;\nexport function startRumAssembly(configuration, lifeCycle, hooks, sessionManager, viewHistory, urlContexts, displayContext, getCommonContext, reportError) {\n modifiableFieldPathsByEvent = {\n [\"view\" /* RumEventType.VIEW */]: {\n 'view.performance.lcp.resource_url': 'string',\n ...USER_CUSTOMIZABLE_FIELD_PATHS,\n ...VIEW_MODIFIABLE_FIELD_PATHS,\n },\n [\"error\" /* RumEventType.ERROR */]: {\n 'error.message': 'string',\n 'error.stack': 'string',\n 'error.resource.url': 'string',\n 'error.fingerprint': 'string',\n ...USER_CUSTOMIZABLE_FIELD_PATHS,\n ...VIEW_MODIFIABLE_FIELD_PATHS,\n ...ROOT_MODIFIABLE_FIELD_PATHS,\n },\n [\"resource\" /* RumEventType.RESOURCE */]: {\n 'resource.url': 'string',\n ...(isExperimentalFeatureEnabled(ExperimentalFeature.WRITABLE_RESOURCE_GRAPHQL)\n ? { 'resource.graphql': 'object' }\n : {}),\n ...USER_CUSTOMIZABLE_FIELD_PATHS,\n ...VIEW_MODIFIABLE_FIELD_PATHS,\n ...ROOT_MODIFIABLE_FIELD_PATHS,\n },\n [\"action\" /* RumEventType.ACTION */]: {\n 'action.target.name': 'string',\n ...USER_CUSTOMIZABLE_FIELD_PATHS,\n ...VIEW_MODIFIABLE_FIELD_PATHS,\n ...ROOT_MODIFIABLE_FIELD_PATHS,\n },\n [\"long_task\" /* RumEventType.LONG_TASK */]: {\n 'long_task.scripts[].source_url': 'string',\n 'long_task.scripts[].invoker': 'string',\n ...USER_CUSTOMIZABLE_FIELD_PATHS,\n ...VIEW_MODIFIABLE_FIELD_PATHS,\n },\n [\"vital\" /* RumEventType.VITAL */]: {\n ...USER_CUSTOMIZABLE_FIELD_PATHS,\n ...VIEW_MODIFIABLE_FIELD_PATHS,\n },\n };\n const eventRateLimiters = {\n [\"error\" /* RumEventType.ERROR */]: createEventRateLimiter(\"error\" /* RumEventType.ERROR */, configuration.eventRateLimiterThreshold, reportError),\n [\"action\" /* RumEventType.ACTION */]: createEventRateLimiter(\"action\" /* RumEventType.ACTION */, configuration.eventRateLimiterThreshold, reportError),\n [\"vital\" /* RumEventType.VITAL */]: createEventRateLimiter(\"vital\" /* RumEventType.VITAL */, configuration.eventRateLimiterThreshold, reportError),\n };\n lifeCycle.subscribe(12 /* LifeCycleEventType.RAW_RUM_EVENT_COLLECTED */, ({ startTime, duration, rawRumEvent, domainContext, savedCommonContext, customerContext }) => {\n const viewHistoryEntry = viewHistory.findView(startTime);\n const urlContext = urlContexts.findUrl(startTime);\n const session = sessionManager.findTrackedSession(startTime);\n if (session &&\n viewHistoryEntry &&\n !urlContext &&\n isExperimentalFeatureEnabled(ExperimentalFeature.MISSING_URL_CONTEXT_TELEMETRY)) {\n addTelemetryDebug('Missing URL entry', {\n debug: {\n eventType: rawRumEvent.type,\n startTime,\n urlEntries: urlContexts.getAllEntries(),\n urlDeletedEntries: urlContexts.getDeletedEntries(),\n viewEntries: viewHistory.getAllEntries(),\n viewDeletedEntries: viewHistory.getDeletedEntries(),\n },\n });\n }\n if (session && viewHistoryEntry && urlContext) {\n const commonContext = savedCommonContext || getCommonContext();\n const rumContext = {\n _dd: {\n format_version: 2,\n drift: currentDrift(),\n configuration: {\n session_sample_rate: round(configuration.sessionSampleRate, 3),\n session_replay_sample_rate: round(configuration.sessionReplaySampleRate, 3),\n },\n browser_sdk_version: canUseEventBridge() ? \"6.6.1\" : undefined,\n },\n application: {\n id: configuration.applicationId,\n },\n date: timeStampNow(),\n source: 'browser',\n session: {\n id: session.id,\n type: \"user\" /* SessionType.USER */,\n },\n display: displayContext.get(),\n connectivity: getConnectivity(),\n context: commonContext.context,\n };\n const serverRumEvent = combine(rumContext, hooks.triggerHook(0 /* HookNames.Assemble */, {\n eventType: rawRumEvent.type,\n startTime,\n duration,\n }), { context: customerContext }, rawRumEvent);\n if (!('has_replay' in serverRumEvent.session)) {\n ;\n serverRumEvent.session.has_replay = commonContext.hasReplay;\n }\n if (serverRumEvent.type === 'view') {\n ;\n serverRumEvent.session.sampled_for_replay =\n session.sessionReplay === 1 /* SessionReplayState.SAMPLED */;\n }\n if (session.anonymousId && !commonContext.user.anonymous_id && !!configuration.trackAnonymousUser) {\n commonContext.user.anonymous_id = session.anonymousId;\n }\n if (!isEmptyObject(commonContext.user)) {\n ;\n serverRumEvent.usr = commonContext.user;\n }\n if (!isEmptyObject(commonContext.account) && commonContext.account.id) {\n ;\n serverRumEvent.account = commonContext.account;\n }\n if (shouldSend(serverRumEvent, configuration.beforeSend, domainContext, eventRateLimiters)) {\n if (isEmptyObject(serverRumEvent.context)) {\n delete serverRumEvent.context;\n }\n lifeCycle.notify(13 /* LifeCycleEventType.RUM_EVENT_COLLECTED */, serverRumEvent);\n }\n }\n });\n}\nfunction shouldSend(event, beforeSend, domainContext, eventRateLimiters) {\n var _a;\n if (beforeSend) {\n const result = limitModification(event, modifiableFieldPathsByEvent[event.type], (event) => beforeSend(event, domainContext));\n if (result === false && event.type !== \"view\" /* RumEventType.VIEW */) {\n return false;\n }\n if (result === false) {\n display.warn(\"Can't dismiss view events using beforeSend!\");\n }\n }\n const rateLimitReached = (_a = eventRateLimiters[event.type]) === null || _a === void 0 ? void 0 : _a.isLimitReached();\n return !rateLimitReached;\n}\n//# sourceMappingURL=assembly.js.map","/**\n * Internal context keep returning v1 format\n * to not break compatibility with logs data format\n */\nexport function startInternalContext(applicationId, sessionManager, viewHistory, actionContexts, urlContexts) {\n return {\n get: (startTime) => {\n const viewContext = viewHistory.findView(startTime);\n const urlContext = urlContexts.findUrl(startTime);\n const session = sessionManager.findTrackedSession(startTime);\n if (session && viewContext && urlContext) {\n const actionId = actionContexts.findActionId(startTime);\n return {\n application_id: applicationId,\n session_id: session.id,\n user_action: actionId ? { id: actionId } : undefined,\n view: { id: viewContext.id, name: viewContext.name, referrer: urlContext.referrer, url: urlContext.url },\n };\n }\n },\n };\n}\n//# sourceMappingURL=internalContext.js.map","import { AbstractLifeCycle } from '@datadog/browser-core';\nexport const LifeCycle = (AbstractLifeCycle);\n//# sourceMappingURL=lifeCycle.js.map","import { SESSION_TIME_OUT_DELAY, createValueHistory } from '@datadog/browser-core';\nexport const VIEW_CONTEXT_TIME_OUT_DELAY = SESSION_TIME_OUT_DELAY;\nexport function startViewHistory(lifeCycle) {\n const viewValueHistory = createValueHistory({ expireDelay: VIEW_CONTEXT_TIME_OUT_DELAY });\n lifeCycle.subscribe(1 /* LifeCycleEventType.BEFORE_VIEW_CREATED */, (view) => {\n viewValueHistory.add(buildViewHistoryEntry(view), view.startClocks.relative);\n });\n lifeCycle.subscribe(6 /* LifeCycleEventType.AFTER_VIEW_ENDED */, ({ endClocks }) => {\n viewValueHistory.closeActive(endClocks.relative);\n });\n lifeCycle.subscribe(3 /* LifeCycleEventType.BEFORE_VIEW_UPDATED */, (viewUpdate) => {\n const currentView = viewValueHistory.find(viewUpdate.startClocks.relative);\n if (currentView && viewUpdate.name) {\n currentView.name = viewUpdate.name;\n }\n if (currentView && viewUpdate.context) {\n currentView.context = viewUpdate.context;\n }\n });\n lifeCycle.subscribe(10 /* LifeCycleEventType.SESSION_RENEWED */, () => {\n viewValueHistory.reset();\n });\n function buildViewHistoryEntry(view) {\n return {\n service: view.service,\n version: view.version,\n context: view.context,\n id: view.id,\n name: view.name,\n startClocks: view.startClocks,\n };\n }\n return {\n findView: (startTime) => viewValueHistory.find(startTime),\n getAllEntries: () => viewValueHistory.getAllEntries(),\n getDeletedEntries: () => viewValueHistory.getDeletedEntries(),\n stop: () => {\n viewValueHistory.stop();\n },\n };\n}\n//# sourceMappingURL=viewHistory.js.map","import { addTelemetryDebug, elapsed, getPathName, isValidUrl, toServerDuration, isIntakeUrl, } from '@datadog/browser-core';\nexport const FAKE_INITIAL_DOCUMENT = 'initial_document';\nconst RESOURCE_TYPES = [\n [\"document\" /* ResourceType.DOCUMENT */, (initiatorType) => FAKE_INITIAL_DOCUMENT === initiatorType],\n [\"xhr\" /* ResourceType.XHR */, (initiatorType) => 'xmlhttprequest' === initiatorType],\n [\"fetch\" /* ResourceType.FETCH */, (initiatorType) => 'fetch' === initiatorType],\n [\"beacon\" /* ResourceType.BEACON */, (initiatorType) => 'beacon' === initiatorType],\n [\"css\" /* ResourceType.CSS */, (_, path) => /\\.css$/i.test(path)],\n [\"js\" /* ResourceType.JS */, (_, path) => /\\.js$/i.test(path)],\n [\n \"image\" /* ResourceType.IMAGE */,\n (initiatorType, path) => ['image', 'img', 'icon'].includes(initiatorType) || /\\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i.exec(path) !== null,\n ],\n [\"font\" /* ResourceType.FONT */, (_, path) => /\\.(woff|eot|woff2|ttf)$/i.exec(path) !== null],\n [\n \"media\" /* ResourceType.MEDIA */,\n (initiatorType, path) => ['audio', 'video'].includes(initiatorType) || /\\.(mp3|mp4)$/i.exec(path) !== null,\n ],\n];\nexport function computeResourceEntryType(entry) {\n const url = entry.name;\n if (!isValidUrl(url)) {\n addTelemetryDebug(`Failed to construct URL for \"${entry.name}\"`);\n return \"other\" /* ResourceType.OTHER */;\n }\n const path = getPathName(url);\n for (const [type, isType] of RESOURCE_TYPES) {\n if (isType(entry.initiatorType, path)) {\n return type;\n }\n }\n return \"other\" /* ResourceType.OTHER */;\n}\nfunction areInOrder(...numbers) {\n for (let i = 1; i < numbers.length; i += 1) {\n if (numbers[i - 1] > numbers[i]) {\n return false;\n }\n }\n return true;\n}\nexport function isResourceEntryRequestType(entry) {\n return entry.initiatorType === 'xmlhttprequest' || entry.initiatorType === 'fetch';\n}\nexport function computeResourceEntryDuration(entry) {\n const { duration, startTime, responseEnd } = entry;\n // Safari duration is always 0 on timings blocked by cross origin policies.\n if (duration === 0 && startTime < responseEnd) {\n return elapsed(startTime, responseEnd);\n }\n return duration;\n}\nexport function computeResourceEntryDetails(entry) {\n if (!hasValidResourceEntryTimings(entry)) {\n return undefined;\n }\n const { startTime, fetchStart, workerStart, redirectStart, redirectEnd, domainLookupStart, domainLookupEnd, connectStart, secureConnectionStart, connectEnd, requestStart, responseStart, responseEnd, } = entry;\n const details = {\n download: formatTiming(startTime, responseStart, responseEnd),\n first_byte: formatTiming(startTime, requestStart, responseStart),\n };\n // Make sure a worker processing time is recorded\n if (0 < workerStart && workerStart < fetchStart) {\n details.worker = formatTiming(startTime, workerStart, fetchStart);\n }\n // Make sure a connection occurred\n if (fetchStart < connectEnd) {\n details.connect = formatTiming(startTime, connectStart, connectEnd);\n // Make sure a secure connection occurred\n if (connectStart <= secureConnectionStart && secureConnectionStart <= connectEnd) {\n details.ssl = formatTiming(startTime, secureConnectionStart, connectEnd);\n }\n }\n // Make sure a domain lookup occurred\n if (fetchStart < domainLookupEnd) {\n details.dns = formatTiming(startTime, domainLookupStart, domainLookupEnd);\n }\n // Make sure a redirection occurred\n if (startTime < redirectEnd) {\n details.redirect = formatTiming(startTime, redirectStart, redirectEnd);\n }\n return details;\n}\n/**\n * Entries with negative duration are unexpected and should be dismissed. The intake will ignore RUM\n * Resource events with negative durations anyway.\n * Since Chromium 128, more entries have unexpected negative durations, see\n * https://issues.chromium.org/issues/363031537\n */\nexport function hasValidResourceEntryDuration(entry) {\n return entry.duration >= 0;\n}\nexport function hasValidResourceEntryTimings(entry) {\n // Ensure timings are in the right order. On top of filtering out potential invalid\n // RumPerformanceResourceTiming, it will ignore entries from requests where timings cannot be\n // collected, for example cross origin requests without a \"Timing-Allow-Origin\" header allowing\n // it.\n const areCommonTimingsInOrder = areInOrder(entry.startTime, entry.fetchStart, entry.domainLookupStart, entry.domainLookupEnd, entry.connectStart, entry.connectEnd, entry.requestStart, entry.responseStart, entry.responseEnd);\n const areRedirectionTimingsInOrder = hasRedirection(entry)\n ? areInOrder(entry.startTime, entry.redirectStart, entry.redirectEnd, entry.fetchStart)\n : true;\n return areCommonTimingsInOrder && areRedirectionTimingsInOrder;\n}\nfunction hasRedirection(entry) {\n return entry.redirectEnd > entry.startTime;\n}\nfunction formatTiming(origin, start, end) {\n if (origin <= start && start <= end) {\n return {\n duration: toServerDuration(elapsed(start, end)),\n start: toServerDuration(elapsed(origin, start)),\n };\n }\n}\n/**\n * The 'nextHopProtocol' is an empty string for cross-origin resources without CORS headers,\n * meaning the protocol is unknown, and we shouldn't report it.\n * https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming/nextHopProtocol#cross-origin_resources\n */\nexport function computeResourceEntryProtocol(entry) {\n return entry.nextHopProtocol === '' ? undefined : entry.nextHopProtocol;\n}\n/**\n * Handles the 'deliveryType' property to distinguish between supported values ('cache', 'navigational-prefetch'),\n * undefined (unsupported in some browsers), and other cases ('other' for unknown or unrecognized values).\n * see: https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming/deliveryType\n */\nexport function computeResourceEntryDeliveryType(entry) {\n return entry.deliveryType === '' ? 'other' : entry.deliveryType;\n}\nexport function computeResourceEntrySize(entry) {\n // Make sure a request actually occurred\n if (entry.startTime < entry.responseStart) {\n const { encodedBodySize, decodedBodySize, transferSize } = entry;\n return {\n size: decodedBodySize,\n encoded_body_size: encodedBodySize,\n decoded_body_size: decodedBodySize,\n transfer_size: transferSize,\n };\n }\n return {\n size: undefined,\n encoded_body_size: undefined,\n decoded_body_size: undefined,\n transfer_size: undefined,\n };\n}\nexport function isAllowedRequestUrl(url) {\n return url && !isIntakeUrl(url);\n}\nconst DATA_URL_REGEX = /data:(.+)?(;base64)?,/g;\nexport const MAX_ATTRIBUTE_VALUE_CHAR_LENGTH = 24000;\nexport function isLongDataUrl(url) {\n if (url.length <= MAX_ATTRIBUTE_VALUE_CHAR_LENGTH) {\n return false;\n }\n else if (url.substring(0, 5) === 'data:') {\n // Avoid String.match RangeError: Maximum call stack size exceeded\n url = url.substring(0, MAX_ATTRIBUTE_VALUE_CHAR_LENGTH);\n return true;\n }\n return false;\n}\nexport function sanitizeDataUrl(url) {\n return `${url.match(DATA_URL_REGEX)[0]}[...]`;\n}\n//# sourceMappingURL=resourceUtils.js.map","import { initFetchObservable, initXhrObservable, readBytesFromStream, elapsed, timeStampNow, tryToClone, } from '@datadog/browser-core';\nimport { isAllowedRequestUrl } from './resource/resourceUtils';\nimport { startTracer } from './tracing/tracer';\nlet nextRequestIndex = 1;\nexport function startRequestCollection(lifeCycle, configuration, sessionManager, getCommonContext) {\n const tracer = startTracer(configuration, sessionManager, getCommonContext);\n trackXhr(lifeCycle, configuration, tracer);\n trackFetch(lifeCycle, tracer);\n}\nexport function trackXhr(lifeCycle, configuration, tracer) {\n const subscription = initXhrObservable(configuration).subscribe((rawContext) => {\n const context = rawContext;\n if (!isAllowedRequestUrl(context.url)) {\n return;\n }\n switch (context.state) {\n case 'start':\n tracer.traceXhr(context, context.xhr);\n context.requestIndex = getNextRequestIndex();\n lifeCycle.notify(7 /* LifeCycleEventType.REQUEST_STARTED */, {\n requestIndex: context.requestIndex,\n url: context.url,\n });\n break;\n case 'complete':\n tracer.clearTracingIfNeeded(context);\n lifeCycle.notify(8 /* LifeCycleEventType.REQUEST_COMPLETED */, {\n duration: context.duration,\n method: context.method,\n requestIndex: context.requestIndex,\n spanId: context.spanId,\n startClocks: context.startClocks,\n status: context.status,\n traceId: context.traceId,\n traceSampled: context.traceSampled,\n type: \"xhr\" /* RequestType.XHR */,\n url: context.url,\n xhr: context.xhr,\n isAborted: context.isAborted,\n handlingStack: context.handlingStack,\n });\n break;\n }\n });\n return { stop: () => subscription.unsubscribe() };\n}\nexport function trackFetch(lifeCycle, tracer) {\n const subscription = initFetchObservable().subscribe((rawContext) => {\n const context = rawContext;\n if (!isAllowedRequestUrl(context.url)) {\n return;\n }\n switch (context.state) {\n case 'start':\n tracer.traceFetch(context);\n context.requestIndex = getNextRequestIndex();\n lifeCycle.notify(7 /* LifeCycleEventType.REQUEST_STARTED */, {\n requestIndex: context.requestIndex,\n url: context.url,\n });\n break;\n case 'resolve':\n waitForResponseToComplete(context, (duration) => {\n tracer.clearTracingIfNeeded(context);\n lifeCycle.notify(8 /* LifeCycleEventType.REQUEST_COMPLETED */, {\n duration,\n method: context.method,\n requestIndex: context.requestIndex,\n responseType: context.responseType,\n spanId: context.spanId,\n startClocks: context.startClocks,\n status: context.status,\n traceId: context.traceId,\n traceSampled: context.traceSampled,\n type: \"fetch\" /* RequestType.FETCH */,\n url: context.url,\n response: context.response,\n init: context.init,\n input: context.input,\n isAborted: context.isAborted,\n handlingStack: context.handlingStack,\n });\n });\n break;\n }\n });\n return { stop: () => subscription.unsubscribe() };\n}\nfunction getNextRequestIndex() {\n const result = nextRequestIndex;\n nextRequestIndex += 1;\n return result;\n}\nfunction waitForResponseToComplete(context, callback) {\n const clonedResponse = context.response && tryToClone(context.response);\n if (!clonedResponse || !clonedResponse.body) {\n // do not try to wait for the response if the clone failed, fetch error or null body\n callback(elapsed(context.startClocks.timeStamp, timeStampNow()));\n }\n else {\n readBytesFromStream(clonedResponse.body, () => {\n callback(elapsed(context.startClocks.timeStamp, timeStampNow()));\n }, {\n bytesLimit: Number.POSITIVE_INFINITY,\n collectStreamBody: false,\n });\n }\n}\n//# sourceMappingURL=requestCollection.js.map","import { isNumber } from '@datadog/browser-core';\nexport function discardNegativeDuration(duration) {\n return isNumber(duration) && duration < 0 ? undefined : duration;\n}\n//# sourceMappingURL=discardNegativeDuration.js.map","import { noop } from '@datadog/browser-core';\nexport function trackEventCounts({ lifeCycle, isChildEvent, onChange: callback = noop, }) {\n const eventCounts = {\n errorCount: 0,\n longTaskCount: 0,\n resourceCount: 0,\n actionCount: 0,\n frustrationCount: 0,\n };\n const subscription = lifeCycle.subscribe(13 /* LifeCycleEventType.RUM_EVENT_COLLECTED */, (event) => {\n var _a;\n if (event.type === 'view' || event.type === 'vital' || !isChildEvent(event)) {\n return;\n }\n switch (event.type) {\n case \"error\" /* RumEventType.ERROR */:\n eventCounts.errorCount += 1;\n callback();\n break;\n case \"action\" /* RumEventType.ACTION */:\n eventCounts.actionCount += 1;\n if (event.action.frustration) {\n eventCounts.frustrationCount += event.action.frustration.type.length;\n }\n callback();\n break;\n case \"long_task\" /* RumEventType.LONG_TASK */:\n eventCounts.longTaskCount += 1;\n callback();\n break;\n case \"resource\" /* RumEventType.RESOURCE */:\n if (!((_a = event._dd) === null || _a === void 0 ? void 0 : _a.discarded)) {\n eventCounts.resourceCount += 1;\n callback();\n }\n break;\n }\n });\n return {\n stop: () => {\n subscription.unsubscribe();\n },\n eventCounts,\n };\n}\n//# sourceMappingURL=trackEventCounts.js.map","import { addEventListeners, dateNow, relativeNow } from '@datadog/browser-core';\n/**\n * first-input timing entry polyfill based on\n * https://github.com/GoogleChrome/web-vitals/blob/master/src/lib/polyfills/firstInputPolyfill.ts\n */\nexport function retrieveFirstInputTiming(configuration, callback) {\n const startTimeStamp = dateNow();\n let timingSent = false;\n const { stop: removeEventListeners } = addEventListeners(configuration, window, [\"click\" /* DOM_EVENT.CLICK */, \"mousedown\" /* DOM_EVENT.MOUSE_DOWN */, \"keydown\" /* DOM_EVENT.KEY_DOWN */, \"touchstart\" /* DOM_EVENT.TOUCH_START */, \"pointerdown\" /* DOM_EVENT.POINTER_DOWN */], (evt) => {\n // Only count cancelable events, which should trigger behavior important to the user.\n if (!evt.cancelable) {\n return;\n }\n // This timing will be used to compute the \"first Input delay\", which is the delta between\n // when the system received the event (e.g. evt.timeStamp) and when it could run the callback\n // (e.g. performance.now()).\n const timing = {\n entryType: 'first-input',\n processingStart: relativeNow(),\n processingEnd: relativeNow(),\n startTime: evt.timeStamp,\n duration: 0, // arbitrary value to avoid nullable duration and simplify INP logic\n name: '',\n cancelable: false,\n target: null,\n toJSON: () => ({}),\n };\n if (evt.type === \"pointerdown\" /* DOM_EVENT.POINTER_DOWN */) {\n sendTimingIfPointerIsNotCancelled(configuration, timing);\n }\n else {\n sendTiming(timing);\n }\n }, { passive: true, capture: true });\n return { stop: removeEventListeners };\n /**\n * Pointer events are a special case, because they can trigger main or compositor thread behavior.\n * We differentiate these cases based on whether or not we see a pointercancel event, which are\n * fired when we scroll. If we're scrolling we don't need to report input delay since FID excludes\n * scrolling and pinch/zooming.\n */\n function sendTimingIfPointerIsNotCancelled(configuration, timing) {\n addEventListeners(configuration, window, [\"pointerup\" /* DOM_EVENT.POINTER_UP */, \"pointercancel\" /* DOM_EVENT.POINTER_CANCEL */], (event) => {\n if (event.type === \"pointerup\" /* DOM_EVENT.POINTER_UP */) {\n sendTiming(timing);\n }\n }, { once: true });\n }\n function sendTiming(timing) {\n if (!timingSent) {\n timingSent = true;\n removeEventListeners();\n // In some cases the recorded delay is clearly wrong, e.g. it's negative or it's larger than\n // the time between now and when the page was loaded.\n // - https://github.com/GoogleChromeLabs/first-input-delay/issues/4\n // - https://github.com/GoogleChromeLabs/first-input-delay/issues/6\n // - https://github.com/GoogleChromeLabs/first-input-delay/issues/7\n const delay = timing.processingStart - timing.startTime;\n if (delay >= 0 && delay < dateNow() - startTimeStamp) {\n callback(timing);\n }\n }\n }\n}\n//# sourceMappingURL=firstInputPolyfill.js.map","import { addEventListener, Observable, setTimeout, clearTimeout, monitor } from '@datadog/browser-core';\nimport { hasValidResourceEntryDuration, isAllowedRequestUrl } from '../domain/resource/resourceUtils';\nimport { retrieveFirstInputTiming } from './firstInputPolyfill';\n// We want to use a real enum (i.e. not a const enum) here, to be able to check whether an arbitrary\n// string is an expected performance entry\n// eslint-disable-next-line no-restricted-syntax\nexport var RumPerformanceEntryType;\n(function (RumPerformanceEntryType) {\n RumPerformanceEntryType[\"EVENT\"] = \"event\";\n RumPerformanceEntryType[\"FIRST_INPUT\"] = \"first-input\";\n RumPerformanceEntryType[\"LARGEST_CONTENTFUL_PAINT\"] = \"largest-contentful-paint\";\n RumPerformanceEntryType[\"LAYOUT_SHIFT\"] = \"layout-shift\";\n RumPerformanceEntryType[\"LONG_TASK\"] = \"longtask\";\n RumPerformanceEntryType[\"LONG_ANIMATION_FRAME\"] = \"long-animation-frame\";\n RumPerformanceEntryType[\"NAVIGATION\"] = \"navigation\";\n RumPerformanceEntryType[\"PAINT\"] = \"paint\";\n RumPerformanceEntryType[\"RESOURCE\"] = \"resource\";\n RumPerformanceEntryType[\"VISIBILITY_STATE\"] = \"visibility-state\";\n})(RumPerformanceEntryType || (RumPerformanceEntryType = {}));\nexport function createPerformanceObservable(configuration, options) {\n return new Observable((observable) => {\n if (!window.PerformanceObserver) {\n return;\n }\n const handlePerformanceEntries = (entries) => {\n const rumPerformanceEntries = filterRumPerformanceEntries(entries);\n if (rumPerformanceEntries.length > 0) {\n observable.notify(rumPerformanceEntries);\n }\n };\n let timeoutId;\n let isObserverInitializing = true;\n const observer = new PerformanceObserver(monitor((entries) => {\n // In Safari the performance observer callback is synchronous.\n // Because the buffered performance entry list can be quite large we delay the computation to prevent the SDK from blocking the main thread on init\n if (isObserverInitializing) {\n timeoutId = setTimeout(() => handlePerformanceEntries(entries.getEntries()));\n }\n else {\n handlePerformanceEntries(entries.getEntries());\n }\n }));\n try {\n observer.observe(options);\n }\n catch (_a) {\n // Some old browser versions (<= chrome 74 ) don't support the PerformanceObserver type and buffered options\n // In these cases, fallback to getEntriesByType and PerformanceObserver with entryTypes\n // TODO: remove this fallback in the next major version\n const fallbackSupportedEntryTypes = [\n RumPerformanceEntryType.RESOURCE,\n RumPerformanceEntryType.NAVIGATION,\n RumPerformanceEntryType.LONG_TASK,\n RumPerformanceEntryType.PAINT,\n ];\n if (fallbackSupportedEntryTypes.includes(options.type)) {\n if (options.buffered) {\n timeoutId = setTimeout(() => handlePerformanceEntries(performance.getEntriesByType(options.type)));\n }\n try {\n observer.observe({ entryTypes: [options.type] });\n }\n catch (_b) {\n // Old versions of Safari are throwing \"entryTypes contained only unsupported types\"\n // errors when observing only unsupported entry types.\n //\n // We could use `supportPerformanceTimingEvent` to make sure we don't invoke\n // `observer.observe` with an unsupported entry type, but Safari 11 and 12 don't support\n // `Performance.supportedEntryTypes`, so doing so would lose support for these versions\n // even if they do support the entry type.\n return;\n }\n }\n }\n isObserverInitializing = false;\n manageResourceTimingBufferFull(configuration);\n let stopFirstInputTiming;\n if (!supportPerformanceTimingEvent(RumPerformanceEntryType.FIRST_INPUT) &&\n options.type === RumPerformanceEntryType.FIRST_INPUT) {\n ;\n ({ stop: stopFirstInputTiming } = retrieveFirstInputTiming(configuration, (timing) => {\n handlePerformanceEntries([timing]);\n }));\n }\n return () => {\n observer.disconnect();\n if (stopFirstInputTiming) {\n stopFirstInputTiming();\n }\n clearTimeout(timeoutId);\n };\n });\n}\nlet resourceTimingBufferFullListener;\nfunction manageResourceTimingBufferFull(configuration) {\n if (!resourceTimingBufferFullListener && supportPerformanceObject() && 'addEventListener' in performance) {\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1559377\n resourceTimingBufferFullListener = addEventListener(configuration, performance, 'resourcetimingbufferfull', () => {\n performance.clearResourceTimings();\n });\n }\n return () => {\n resourceTimingBufferFullListener === null || resourceTimingBufferFullListener === void 0 ? void 0 : resourceTimingBufferFullListener.stop();\n };\n}\nfunction supportPerformanceObject() {\n return window.performance !== undefined && 'getEntries' in performance;\n}\nexport function supportPerformanceTimingEvent(entryType) {\n return (window.PerformanceObserver &&\n PerformanceObserver.supportedEntryTypes !== undefined &&\n PerformanceObserver.supportedEntryTypes.includes(entryType));\n}\nfunction filterRumPerformanceEntries(entries) {\n return entries.filter((entry) => !isForbiddenResource(entry));\n}\nfunction isForbiddenResource(entry) {\n return (entry.entryType === RumPerformanceEntryType.RESOURCE &&\n (!isAllowedRequestUrl(entry.name) || !hasValidResourceEntryDuration(entry)));\n}\n//# sourceMappingURL=performanceObservable.js.map","import { matchList, monitor, Observable, timeStampNow, setTimeout, clearTimeout } from '@datadog/browser-core';\nimport { createPerformanceObservable, RumPerformanceEntryType } from '../browser/performanceObservable';\n// Delay to wait for a page activity to validate the tracking process\nexport const PAGE_ACTIVITY_VALIDATION_DELAY = 100;\n// Delay to wait after a page activity to end the tracking process\nexport const PAGE_ACTIVITY_END_DELAY = 100;\n/**\n * Wait for the page activity end\n *\n * Detection lifecycle:\n * ```\n * Wait page activity end\n * .-------------------'--------------------.\n * v v\n * [Wait for a page activity ] [Wait for a maximum duration]\n * [timeout: VALIDATION_DELAY] [ timeout: maxDuration ]\n * / \\ |\n * v v |\n * [No page activity] [Page activity] |\n * | |,----------------------. |\n * v v | |\n * (Discard) [Wait for a page activity] | |\n * [ timeout: END_DELAY ] | |\n * / \\ | |\n * v v | |\n * [No page activity] [Page activity] | |\n * | | | |\n * | '------------' |\n * '-----------. ,--------------------'\n * v\n * (End)\n * ```\n *\n * Note: by assuming that maxDuration is greater than VALIDATION_DELAY, we are sure that if the\n * process is still alive after maxDuration, it has been validated.\n */\nexport function waitPageActivityEnd(lifeCycle, domMutationObservable, windowOpenObservable, configuration, pageActivityEndCallback, maxDuration) {\n const pageActivityObservable = createPageActivityObservable(lifeCycle, domMutationObservable, windowOpenObservable, configuration);\n return doWaitPageActivityEnd(pageActivityObservable, pageActivityEndCallback, maxDuration);\n}\nexport function doWaitPageActivityEnd(pageActivityObservable, pageActivityEndCallback, maxDuration) {\n let pageActivityEndTimeoutId;\n let hasCompleted = false;\n const validationTimeoutId = setTimeout(monitor(() => complete({ hadActivity: false })), PAGE_ACTIVITY_VALIDATION_DELAY);\n const maxDurationTimeoutId = maxDuration !== undefined\n ? setTimeout(monitor(() => complete({ hadActivity: true, end: timeStampNow() })), maxDuration)\n : undefined;\n const pageActivitySubscription = pageActivityObservable.subscribe(({ isBusy }) => {\n clearTimeout(validationTimeoutId);\n clearTimeout(pageActivityEndTimeoutId);\n const lastChangeTime = timeStampNow();\n if (!isBusy) {\n pageActivityEndTimeoutId = setTimeout(monitor(() => complete({ hadActivity: true, end: lastChangeTime })), PAGE_ACTIVITY_END_DELAY);\n }\n });\n const stop = () => {\n hasCompleted = true;\n clearTimeout(validationTimeoutId);\n clearTimeout(pageActivityEndTimeoutId);\n clearTimeout(maxDurationTimeoutId);\n pageActivitySubscription.unsubscribe();\n };\n function complete(event) {\n if (hasCompleted) {\n return;\n }\n stop();\n pageActivityEndCallback(event);\n }\n return { stop };\n}\nexport function createPageActivityObservable(lifeCycle, domMutationObservable, windowOpenObservable, configuration) {\n return new Observable((observable) => {\n const subscriptions = [];\n let firstRequestIndex;\n let pendingRequestsCount = 0;\n subscriptions.push(domMutationObservable.subscribe(notifyPageActivity), windowOpenObservable.subscribe(notifyPageActivity), createPerformanceObservable(configuration, { type: RumPerformanceEntryType.RESOURCE }).subscribe((entries) => {\n if (entries.some((entry) => !isExcludedUrl(configuration, entry.name))) {\n notifyPageActivity();\n }\n }), lifeCycle.subscribe(7 /* LifeCycleEventType.REQUEST_STARTED */, (startEvent) => {\n if (isExcludedUrl(configuration, startEvent.url)) {\n return;\n }\n if (firstRequestIndex === undefined) {\n firstRequestIndex = startEvent.requestIndex;\n }\n pendingRequestsCount += 1;\n notifyPageActivity();\n }), lifeCycle.subscribe(8 /* LifeCycleEventType.REQUEST_COMPLETED */, (request) => {\n if (isExcludedUrl(configuration, request.url) ||\n firstRequestIndex === undefined ||\n // If the request started before the tracking start, ignore it\n request.requestIndex < firstRequestIndex) {\n return;\n }\n pendingRequestsCount -= 1;\n notifyPageActivity();\n }));\n return () => {\n subscriptions.forEach((s) => s.unsubscribe());\n };\n function notifyPageActivity() {\n observable.notify({ isBusy: pendingRequestsCount > 0 });\n }\n });\n}\nfunction isExcludedUrl(configuration, requestUrl) {\n return matchList(configuration.excludedActivityUrls, requestUrl);\n}\n//# sourceMappingURL=waitPageActivityEnd.js.map","export function isTextNode(node) {\n return node.nodeType === Node.TEXT_NODE;\n}\nexport function isCommentNode(node) {\n return node.nodeType === Node.COMMENT_NODE;\n}\nexport function isElementNode(node) {\n return node.nodeType === Node.ELEMENT_NODE;\n}\nexport function isNodeShadowHost(node) {\n return isElementNode(node) && Boolean(node.shadowRoot);\n}\nexport function isNodeShadowRoot(node) {\n const shadowRoot = node;\n return !!shadowRoot.host && shadowRoot.nodeType === Node.DOCUMENT_FRAGMENT_NODE && isElementNode(shadowRoot.host);\n}\nexport function hasChildNodes(node) {\n return node.childNodes.length > 0 || isNodeShadowHost(node);\n}\nexport function forEachChildNodes(node, callback) {\n let child = node.firstChild;\n while (child) {\n callback(child);\n child = child.nextSibling;\n }\n if (isNodeShadowHost(node)) {\n callback(node.shadowRoot);\n }\n}\n/**\n * Return `host` in case if the current node is a shadow root otherwise will return the `parentNode`\n */\nexport function getParentNode(node) {\n return isNodeShadowRoot(node) ? node.host : node.parentNode;\n}\n//# sourceMappingURL=htmlDomUtils.js.map","import { DefaultPrivacyLevel } from '@datadog/browser-core';\nimport { isElementNode, getParentNode, isTextNode } from '../browser/htmlDomUtils';\nexport const NodePrivacyLevel = {\n IGNORE: 'ignore',\n HIDDEN: 'hidden',\n ALLOW: DefaultPrivacyLevel.ALLOW,\n MASK: DefaultPrivacyLevel.MASK,\n MASK_USER_INPUT: DefaultPrivacyLevel.MASK_USER_INPUT,\n};\nexport const PRIVACY_ATTR_NAME = 'data-dd-privacy';\n// Privacy Attrs\nexport const PRIVACY_ATTR_VALUE_ALLOW = 'allow';\nexport const PRIVACY_ATTR_VALUE_MASK = 'mask';\nexport const PRIVACY_ATTR_VALUE_MASK_USER_INPUT = 'mask-user-input';\nexport const PRIVACY_ATTR_VALUE_HIDDEN = 'hidden';\n// Privacy Classes - not all customers can set plain HTML attributes, so support classes too\nexport const PRIVACY_CLASS_PREFIX = 'dd-privacy-';\n// Private Replacement Templates\nexport const CENSORED_STRING_MARK = '***';\nexport const CENSORED_IMG_MARK = 'data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==';\nexport const FORM_PRIVATE_TAG_NAMES = {\n INPUT: true,\n OUTPUT: true,\n TEXTAREA: true,\n SELECT: true,\n OPTION: true,\n DATALIST: true,\n OPTGROUP: true,\n};\nconst TEXT_MASKING_CHAR = 'x';\n/**\n * Get node privacy level by iterating over its ancestors. When the direct parent privacy level is\n * know, it is best to use something like:\n *\n * derivePrivacyLevelGivenParent(getNodeSelfPrivacyLevel(node), parentNodePrivacyLevel)\n */\nexport function getNodePrivacyLevel(node, defaultPrivacyLevel, cache) {\n if (cache && cache.has(node)) {\n return cache.get(node);\n }\n const parentNode = getParentNode(node);\n const parentNodePrivacyLevel = parentNode\n ? getNodePrivacyLevel(parentNode, defaultPrivacyLevel, cache)\n : defaultPrivacyLevel;\n const selfNodePrivacyLevel = getNodeSelfPrivacyLevel(node);\n const nodePrivacyLevel = reducePrivacyLevel(selfNodePrivacyLevel, parentNodePrivacyLevel);\n if (cache) {\n cache.set(node, nodePrivacyLevel);\n }\n return nodePrivacyLevel;\n}\n/**\n * Reduces the next privacy level based on self + parent privacy levels\n */\nexport function reducePrivacyLevel(childPrivacyLevel, parentNodePrivacyLevel) {\n switch (parentNodePrivacyLevel) {\n // These values cannot be overridden\n case NodePrivacyLevel.HIDDEN:\n case NodePrivacyLevel.IGNORE:\n return parentNodePrivacyLevel;\n }\n switch (childPrivacyLevel) {\n case NodePrivacyLevel.ALLOW:\n case NodePrivacyLevel.MASK:\n case NodePrivacyLevel.MASK_USER_INPUT:\n case NodePrivacyLevel.HIDDEN:\n case NodePrivacyLevel.IGNORE:\n return childPrivacyLevel;\n default:\n return parentNodePrivacyLevel;\n }\n}\n/**\n * Determines the node's own privacy level without checking for ancestors.\n */\nexport function getNodeSelfPrivacyLevel(node) {\n // Only Element types can have a privacy level set\n if (!isElementNode(node)) {\n return;\n }\n // Overrules for replay purpose\n if (node.tagName === 'BASE') {\n return NodePrivacyLevel.ALLOW;\n }\n // Overrules to enforce end-user protection\n if (node.tagName === 'INPUT') {\n const inputElement = node;\n if (inputElement.type === 'password' || inputElement.type === 'email' || inputElement.type === 'tel') {\n return NodePrivacyLevel.MASK;\n }\n if (inputElement.type === 'hidden') {\n return NodePrivacyLevel.MASK;\n }\n const autocomplete = inputElement.getAttribute('autocomplete');\n // Handle input[autocomplete=cc-number/cc-csc/cc-exp/cc-exp-month/cc-exp-year/new-password/current-password]\n if (autocomplete && (autocomplete.startsWith('cc-') || autocomplete.endsWith('-password'))) {\n return NodePrivacyLevel.MASK;\n }\n }\n // Check HTML privacy attributes and classes\n if (node.matches(getPrivacySelector(NodePrivacyLevel.HIDDEN))) {\n return NodePrivacyLevel.HIDDEN;\n }\n if (node.matches(getPrivacySelector(NodePrivacyLevel.MASK))) {\n return NodePrivacyLevel.MASK;\n }\n if (node.matches(getPrivacySelector(NodePrivacyLevel.MASK_USER_INPUT))) {\n return NodePrivacyLevel.MASK_USER_INPUT;\n }\n if (node.matches(getPrivacySelector(NodePrivacyLevel.ALLOW))) {\n return NodePrivacyLevel.ALLOW;\n }\n if (shouldIgnoreElement(node)) {\n return NodePrivacyLevel.IGNORE;\n }\n}\n/**\n * Helper aiming to unify `mask` and `mask-user-input` privacy levels:\n *\n * In the `mask` case, it is trivial: we should mask the element.\n *\n * In the `mask-user-input` case, we should mask the element only if it is a \"form\" element or the\n * direct parent is a form element for text nodes).\n *\n * Other `shouldMaskNode` cases are edge cases that should not matter too much (ex: should we mask a\n * node if it is ignored or hidden? it doesn't matter since it won't be serialized).\n */\nexport function shouldMaskNode(node, privacyLevel) {\n switch (privacyLevel) {\n case NodePrivacyLevel.MASK:\n case NodePrivacyLevel.HIDDEN:\n case NodePrivacyLevel.IGNORE:\n return true;\n case NodePrivacyLevel.MASK_USER_INPUT:\n return isTextNode(node) ? isFormElement(node.parentNode) : isFormElement(node);\n default:\n return false;\n }\n}\nfunction isFormElement(node) {\n if (!node || node.nodeType !== node.ELEMENT_NODE) {\n return false;\n }\n const element = node;\n if (element.tagName === 'INPUT') {\n switch (element.type) {\n case 'button':\n case 'color':\n case 'reset':\n case 'submit':\n return false;\n }\n }\n return !!FORM_PRIVATE_TAG_NAMES[element.tagName];\n}\n/**\n * Text censoring non-destructively maintains whitespace characters in order to preserve text shape\n * during replay.\n */\nexport const censorText = (text) => text.replace(/\\S/g, TEXT_MASKING_CHAR);\nexport function getTextContent(textNode, ignoreWhiteSpace, parentNodePrivacyLevel) {\n var _a;\n // The parent node may not be a html element which has a tagName attribute.\n // So just let it be undefined which is ok in this use case.\n const parentTagName = (_a = textNode.parentElement) === null || _a === void 0 ? void 0 : _a.tagName;\n let textContent = textNode.textContent || '';\n if (ignoreWhiteSpace && !textContent.trim()) {\n return;\n }\n const nodePrivacyLevel = parentNodePrivacyLevel;\n const isScript = parentTagName === 'SCRIPT';\n if (isScript) {\n // For perf reasons, we don't record script (heuristic)\n textContent = CENSORED_STRING_MARK;\n }\n else if (nodePrivacyLevel === NodePrivacyLevel.HIDDEN) {\n // Should never occur, but just in case, we set to CENSORED_MARK.\n textContent = CENSORED_STRING_MARK;\n }\n else if (shouldMaskNode(textNode, nodePrivacyLevel)) {\n if (\n // Scrambling the child list breaks text nodes for DATALIST/SELECT/OPTGROUP\n parentTagName === 'DATALIST' ||\n parentTagName === 'SELECT' ||\n parentTagName === 'OPTGROUP') {\n if (!textContent.trim()) {\n return;\n }\n }\n else if (parentTagName === 'OPTION') {\n //