{"version":3,"sources":["webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-core-js@2.5.4/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/EnvUtils.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/tslib@1.14.1/node_modules/tslib/tslib.es6.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-core-js@2.5.4/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/CoreUtils.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-core-js@2.5.4/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Enums/LoggingEnums.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-core-js@2.5.4/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/DiagnosticLogger.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-core-js@2.5.4/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/TelemetryPluginChain.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-core-js@2.5.4/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/ProcessTelemetryContext.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-core-js@2.5.4/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/BaseTelemetryPlugin.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-core-js@2.5.4/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/TelemetryHelpers.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-core-js@2.5.4/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/ChannelController.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-common@2.5.4/node_modules/@microsoft/applicationinsights-common/dist-esm/Enums.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-core-js@2.5.4/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/BaseCore.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-core-js@2.5.4/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Enums/EventsDiscardedReason.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-core-js@2.5.4/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/NotificationManager.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-core-js@2.5.4/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/AppInsightsCore.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-common@2.5.4/node_modules/@microsoft/applicationinsights-common/dist-esm/RequestResponseHeaders.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-common@2.5.4/node_modules/@microsoft/applicationinsights-common/dist-esm/Telemetry/Common/DataSanitizer.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-common@2.5.4/node_modules/@microsoft/applicationinsights-common/dist-esm/Util.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-common@2.5.4/node_modules/@microsoft/applicationinsights-common/dist-esm/Interfaces/Contracts/Generated/DataPointType.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-common@2.5.4/node_modules/@microsoft/applicationinsights-common/dist-esm/Constants.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-common@2.5.4/node_modules/@microsoft/applicationinsights-common/dist-esm/ConnectionStringParser.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-common@2.5.4/node_modules/@microsoft/applicationinsights-common/dist-esm/Interfaces/Contracts/Generated/Base.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-common@2.5.4/node_modules/@microsoft/applicationinsights-common/dist-esm/Interfaces/Contracts/Generated/Data.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-common@2.5.4/node_modules/@microsoft/applicationinsights-common/dist-esm/Telemetry/Common/Envelope.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-common@2.5.4/node_modules/@microsoft/applicationinsights-common/dist-esm/Interfaces/Contracts/Generated/Envelope.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-common@2.5.4/node_modules/@microsoft/applicationinsights-common/dist-esm/Interfaces/Contracts/Generated/Domain.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-common@2.5.4/node_modules/@microsoft/applicationinsights-common/dist-esm/Interfaces/Contracts/Generated/EventData.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-common@2.5.4/node_modules/@microsoft/applicationinsights-common/dist-esm/Telemetry/Event.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-common@2.5.4/node_modules/@microsoft/applicationinsights-common/dist-esm/Interfaces/Contracts/Generated/StackFrame.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-common@2.5.4/node_modules/@microsoft/applicationinsights-common/dist-esm/Interfaces/Contracts/Generated/ExceptionDetails.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-common@2.5.4/node_modules/@microsoft/applicationinsights-common/dist-esm/Telemetry/Exception.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-common@2.5.4/node_modules/@microsoft/applicationinsights-common/dist-esm/Interfaces/Contracts/Generated/ExceptionData.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-common@2.5.4/node_modules/@microsoft/applicationinsights-common/dist-esm/Interfaces/Contracts/Generated/MetricData.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-common@2.5.4/node_modules/@microsoft/applicationinsights-common/dist-esm/Interfaces/Contracts/Generated/DataPoint.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-common@2.5.4/node_modules/@microsoft/applicationinsights-common/dist-esm/Interfaces/Contracts/Generated/SeverityLevel.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-common@2.5.4/node_modules/@microsoft/applicationinsights-common/dist-esm/Telemetry/Common/DataPoint.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-common@2.5.4/node_modules/@microsoft/applicationinsights-common/dist-esm/Telemetry/Metric.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-common@2.5.4/node_modules/@microsoft/applicationinsights-common/dist-esm/Interfaces/Contracts/Generated/PageViewData.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-common@2.5.4/node_modules/@microsoft/applicationinsights-common/dist-esm/Telemetry/PageView.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-common@2.5.4/node_modules/@microsoft/applicationinsights-common/dist-esm/Telemetry/RemoteDependencyData.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-common@2.5.4/node_modules/@microsoft/applicationinsights-common/dist-esm/Interfaces/Contracts/Generated/RemoteDependencyData.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-common@2.5.4/node_modules/@microsoft/applicationinsights-common/dist-esm/Telemetry/Trace.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-common@2.5.4/node_modules/@microsoft/applicationinsights-common/dist-esm/Interfaces/Contracts/Generated/MessageData.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-common@2.5.4/node_modules/@microsoft/applicationinsights-common/dist-esm/Telemetry/PageViewPerformance.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-common@2.5.4/node_modules/@microsoft/applicationinsights-common/dist-esm/Interfaces/Contracts/Generated/PageViewPerfData.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-common@2.5.4/node_modules/@microsoft/applicationinsights-common/dist-esm/Telemetry/Common/Data.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-common@2.5.4/node_modules/@microsoft/applicationinsights-common/dist-esm/Interfaces/IConfig.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-common@2.5.4/node_modules/@microsoft/applicationinsights-common/dist-esm/Interfaces/Contracts/Generated/ContextTagKeys.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-common@2.5.4/node_modules/@microsoft/applicationinsights-common/dist-esm/TelemetryItemCreator.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-common@2.5.4/node_modules/@microsoft/applicationinsights-common/dist-esm/Interfaces/PartAExtensions.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-common@2.5.4/node_modules/@microsoft/applicationinsights-common/dist-esm/applicationinsights-common.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+dynamicproto-js@0.5.3/node_modules/@microsoft/dynamicproto-js/lib/dist/esm/dynamicproto-js.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-analytics-js@2.5.4/node_modules/@microsoft/applicationinsights-analytics-js/dist-esm/JavaScriptSDK/Telemetry/PageViewManager.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-analytics-js@2.5.4/node_modules/@microsoft/applicationinsights-analytics-js/dist-esm/JavaScriptSDK/Telemetry/PageVisitTimeManager.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-analytics-js@2.5.4/node_modules/@microsoft/applicationinsights-analytics-js/dist-esm/JavaScriptSDK/Telemetry/PageViewPerformanceManager.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-analytics-js@2.5.4/node_modules/@microsoft/applicationinsights-analytics-js/dist-esm/JavaScriptSDK/ApplicationInsights.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-channel-js@2.5.4/node_modules/@microsoft/applicationinsights-channel-js/dist-esm/SendBuffer.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-channel-js@2.5.4/node_modules/@microsoft/applicationinsights-channel-js/dist-esm/EnvelopeCreator.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-channel-js@2.5.4/node_modules/@microsoft/applicationinsights-channel-js/dist-esm/Serializer.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-channel-js@2.5.4/node_modules/@microsoft/applicationinsights-channel-js/dist-esm/Offline.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-channel-js@2.5.4/node_modules/@microsoft/applicationinsights-channel-js/dist-esm/TelemetryProcessors/SamplingScoreGenerators/HashCodeScoreGenerator.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-channel-js@2.5.4/node_modules/@microsoft/applicationinsights-channel-js/dist-esm/TelemetryProcessors/SamplingScoreGenerators/SamplingScoreGenerator.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-channel-js@2.5.4/node_modules/@microsoft/applicationinsights-channel-js/dist-esm/TelemetryProcessors/Sample.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-channel-js@2.5.4/node_modules/@microsoft/applicationinsights-channel-js/dist-esm/Sender.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-properties-js@2.5.4/node_modules/@microsoft/applicationinsights-properties-js/dist-esm/Context/Session.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-properties-js@2.5.4/node_modules/@microsoft/applicationinsights-properties-js/dist-esm/Context/Application.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-properties-js@2.5.4/node_modules/@microsoft/applicationinsights-properties-js/dist-esm/Context/Device.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-properties-js@2.5.4/node_modules/@microsoft/applicationinsights-properties-js/dist-esm/Context/Internal.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-properties-js@2.5.4/node_modules/@microsoft/applicationinsights-properties-js/dist-esm/Context/User.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-properties-js@2.5.4/node_modules/@microsoft/applicationinsights-properties-js/dist-esm/Context/Location.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-properties-js@2.5.4/node_modules/@microsoft/applicationinsights-properties-js/dist-esm/Context/TelemetryTrace.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-properties-js@2.5.4/node_modules/@microsoft/applicationinsights-properties-js/dist-esm/TelemetryContext.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-properties-js@2.5.4/node_modules/@microsoft/applicationinsights-properties-js/dist-esm/PropertiesPlugin.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-core-js@2.5.4/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/InstrumentHooks.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-dependencies-js@2.5.4/node_modules/@microsoft/applicationinsights-dependencies-js/dist-esm/ajaxRecord.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-dependencies-js@2.5.4/node_modules/@microsoft/applicationinsights-dependencies-js/dist-esm/TraceParent.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-dependencies-js@2.5.4/node_modules/@microsoft/applicationinsights-dependencies-js/dist-esm/ajax.js","webpack:///C:/a/1/s/Cognito.Web.Client/node_modules/.pnpm/@microsoft+applicationinsights-web@2.5.4/node_modules/@microsoft/applicationinsights-web/dist-esm/Initialization.js"],"names":["strUndefined","strObject","strPrototype","strFunction","getGlobal","globalThis","self","window","global","getGlobalInst","name","gbl","hasWindow","Boolean","getWindow","hasDocument","document","getDocument","getNavigator","navigator","getHistory","history","getLocation","location","getPerformance","hasJSON","JSON","getJSON","extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","hasOwnProperty","__extends","__","this","constructor","prototype","create","__assign","assign","t","s","i","n","arguments","length","call","apply","_isTypeof","value","theType","_isUndefined","undefined","_isNullOrUndefined","_hasOwnProperty","obj","prop","_isObject","_isFunction","_attachEvent","eventNameWithoutOn","handlerRef","useCapture","result","e","_detachEvent","LoggingSeverity","CoreUtils","isDate","toString","isString","isNumber","isBoolean","disableCookies","_canUseCookies","newGuid","replace","GuidRegex","c","r","Math","random","toISOString","date","pad","num","String","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","toFixed","slice","arrForEach","arr","callbackfn","thisArg","len","idx","arrIndexOf","searchElement","fromIndex","from","lp","max","abs","arrMap","_this","results","arrReduce","initialValue","objCreate","TypeError","tmpFunc","objKeys","hasDontEnumBug","propertyIsEnumerable","push","dontEnums","dontEnumsLength","objDefineAccessors","target","getProp","setProp","defineProp","descriptor","enumerable","configurable","get","set","addEventHandler","eventName","callback","w","doc","EventHelper","Attach","isTypeof","isUndefined","isNullOrUndefined","isFunction","isObject","AttachEvent","Detach","DetachEvent","_InternalMessageId","_InternalLogMessage","msgId","msg","isUserAct","properties","messageId","message","AiUserActionablePrefix","AiNonUserActionablePrefix","strProps","stringify","diagnosticText","sanitizeDiagnosticText","text","dataType","DiagnosticLogger","config","queue","AIInternalMessagePrefix","_messageCount","_messageLogged","enableDebugExceptions","consoleLoggingLevel","telemetryLoggingLevel","maxInternalMessageLimit","loggingLevelConsole","loggingLevelTelemetry","maxMessageLimit","throwInternal","severity","messageKey","WARNING","warnToConsole","logInternalMessage","console","warn","log","resetInternalMessageCount","_areInternalMessagesThrottled","logMessage","throttleLimitMessage","throttleMessage","plugin","defItemCtx","_self","_nextProxy","_hasProcessTelemetry","processTelemetry","_hasSetNext","setNextPlugin","_hasRun","getPlugin","getNext","setNext","nextPlugin","env","itemCtx","error","hasRun","diagLog","CRITICAL","identifier","_createProxyChain","plugins","proxies","lastProxy","thePlugin","newProxy","ProcessTelemetryContext","core","startAt","proxy","add","_copyProxyChain","srcPlugins","_copyPluginChain","logger","getCfg","getExtCfg","defaultValue","theConfig","extConfig","extensionConfig","getConfig","field","theValue","hasNext","processNext","createNew","BaseTelemetryPlugin","_isinitialized","_rootCtx","_nextPlugin","_getTelCtx","isInitialized","setInitialized","next","currentCtx","rootCtx","_baseTelInit","extensions","pluginChain","getProcessTelContext","initialize","initializePlugins","processContext","initPlugins","lastPlugin","sortPlugins","sort","extA","extB","bHasProcess","_arrForEach","_objDefineAccessors","_addChannelQueue","channelQueues","queueItem","priority","Error","_checkQueuePriority","a","StorageType","FieldType","DistributedTracingModes","_super","ChannelController","item","_channelQueue","queues","getChannelControls","isCookieUseDisabled","channelQueue","channels","extensionQueue_1","_createChannelQueues","_staticInit","BaseCore","_isInitialized","_extensions","_channelController","_setInit","_eventQueue","notificationManager","instrumentationKey","channelController","addNotificationListener","listener","removeNotificationListener","eventsSent","events","eventsDiscarded","reason","_notificationManager","NotificationManager","allExtensions","concat","coreExtensions","channelExtensions","extPriorities","ext","extPriority","getTransmissionControls","track","telemetryItem","iKey","time","Date","ver","event","thePlugins","EventsDiscardedReason","listeners","index","splice","_loop_1","this_1","setTimeout","_loop_2","this_2","AppInsightsCore","_notifyInvalidEvent","_validateTelemetryItem","pollInternalLogs","interval","diagnosticLogInterval","setInterval","baseType","baseData","RequestHeaders","requestContextHeader","requestContextTargetKey","requestContextAppIdFormat","requestIdHeader","traceParentHeader","sdkContextHeader","sdkContextHeaderAppIdRequest","requestContextHeaderLowerCase","DataSanitizer","sanitizeKeyAndAddUniqueness","key","map","origLength","sanitizeKey","uniqueField","substring","MAX_NAME_LENGTH","padNumber","nameTrunc","trim","sanitizeString","maxLength","valueTrunc","MAX_STRING_LENGTH","sanitizeUrl","url","sanitizeInput","MAX_URL_LENGTH","sanitizeMessage","messageTrunc","MAX_MESSAGE_LENGTH","sanitizeException","exception","exceptionTrunc","MAX_EXCEPTION_LENGTH","sanitizeProperties","tempProps","MAX_PROPERTY_LENGTH","sanitizeMeasurements","measurements","tempMeasurements","measure","sanitizeId","id","MAX_ID_LENGTH","input","_msgId","inputTrunc","data","substr","str","_uaDisallowsSameSiteNone","DataPointType","Util","createDomEvent","Event","createEvent","initEvent","disableStorage","_canUseLocalStorage","_canUseSessionStorage","_getLocalStorageObject","canUseLocalStorage","_getVerifiedStorageObject","LocalStorage","storageType","fail","uid","storage","setItem","getItem","removeItem","isInternalApplicationInsightsEndpoint","endpointUrl","_internalEndpoints","indexOf","toLowerCase","getStorage","getExceptionName","dump","setStorage","removeStorage","_getSessionStorageObject","canUseSessionStorage","SessionStorage","getSessionStorageKeys","keys","getSessionStorage","setSessionStorage","removeSessionStorage","canUseCookies","cookie","disallowsSameSiteNone","userAgent","search","start","setCookie","domain","domainAttrib","secureAttrib","location_1","protocol","stringToBoolOrDefault","getCookie","cookieName","cookies","split","deleteCookie","newId","charAt","floor","random32","generateW3CId","tmp","hexValues","oct","clockSequenceHi","isArray","isError","getIEVersion","userAgentStr","myNav","parseInt","msToTimeSpan","totalms","isNaN","ms","round","sec","min","hour","days","isCrossOriginError","lineNumber","columnNumber","object","objectTypeDump","propertyValueDump","stack","IsBeaconApiSupported","sendBeacon","getExtension","extension","extIx","NotSpecified","toISOStringForIE8","UrlHelper","parseUrl","htmlAnchorElement","createElement","host","parseHost","href","getAbsoluteUrl","getPathName","pathname","getCompleteUrl","method","absoluteUrl","toUpperCase","match","CorrelationIdHelper","canIncludeCorrelationHeader","requestUrl","currentHost","disableCorrelationHeaders","requestHost","enableCorsCorrelation","matchExists_1","includedDomains","correlationHeaderDomains","regex","RegExp","test","excludedDomains","correlationHeaderExcludedDomains","getCorrelationContext","responseHeader","correlationId","getCorrelationContextValue","correlationIdPrefix","keyValues","keyValue","AjaxHelper","ParseDependencyPath","commandName","parsedUrl","pathName","DateTimeUtils","Now","perf","now","timing","navigationStart","getTime","GetDuration","end","DisabledPropertyName","SampleRate","ProcessLegacy","HttpMethod","DEFAULT_BREEZE_ENDPOINT","ConnectionStringParser","parse","connectionString","kvPairs","_FIELDS_SEPARATOR","fields","kv","kvParts","_FIELD_KEY_VALUE_SEPARATOR","endpointsuffix","locationPrefix","ingestionendpoint","Base","Data","Envelope","aiDataContract","Required","sampleRate","Hidden","tags","Domain","EventData","Default","envelopeType","StackFrame","ExceptionDetails","hasFullStack","parsedStack","Exception","severityLevel","exceptions","problemGroup","isManual","CreateFromInterface","ex","toInterface","_a","CreateSimpleException","typeName","assembly","fileName","details","line","ExceptionData","_ExceptionDetails","outerId","parseStack","frame","frames_1","level","totalSizeInBytes","parsedFrame","sizeInBytes","left","right","size","acceptedLeft","acceptedRight","howMany","_StackFrame","sourceFrame","matches","baseSize","MetricData","metrics","SeverityLevel","DataPoint","kind","count","stdDev","Measurement","Metric","dataPoint","PageViewData","PageView","durationMs","duration","RemoteDependencyData","success","resultCode","requestAPI","correlationContext","type","dependencyKind","dependencySource","dependencyTypeName","dependencyFields","Trace","MessageData","PageViewPerformance","unused","cs4BaseData","perfTotal","networkConnect","sentRequest","receivedResponse","domProcessing","PageViewPerfData","ConfigurationManager","configValue","ContextTagKeys","applicationVersion","applicationBuild","applicationTypeId","applicationId","applicationLayer","deviceId","deviceIp","deviceLanguage","deviceLocale","deviceModel","deviceFriendlyName","deviceNetwork","deviceNetworkName","deviceOEMName","deviceOS","deviceOSVersion","deviceRoleInstance","deviceRoleName","deviceScreenResolution","deviceType","deviceMachineName","deviceVMName","deviceBrowser","deviceBrowserVersion","locationIp","locationCountry","locationProvince","locationCity","operationId","operationName","operationParentId","operationRootId","operationSyntheticSource","operationCorrelationVector","sessionId","sessionIsFirst","sessionIsNew","userAccountAcquisitionDate","userAccountId","userId","userStoreRegion","userAuthUserId","userAnonymousUserAcquisitionDate","userAuthenticatedUserAcquisitionDate","cloudName","cloudRole","cloudRoleVer","cloudRoleInstance","cloudEnvironment","cloudLocation","cloudDeploymentUnit","internalNodeName","internalSdkVersion","internalAgentVersion","TelemetryItemCreator","envelopeName","customProperties","systemProperties","Extensions","UserExt","DeviceExt","TraceExt","WebExt","AppExt","OSExt","SessionExt","SDKExt","CtxTagKeys","PropertiesPluginIdentifier","BreezeChannelIdentifier","AnalyticsPluginIdentifier","_objGetPrototypeOf","_dynamicNames","_isObjectOrArrayPrototype","_isObjectArrayOrFunctionPrototype","Function","_getObjProto","newProto","_isDynamicCandidate","funcName","skipOwn","_throwTypeError","_hasVisited","values","_getObjName","unknownValue","theClass","delegateFunc","classProto","thisTarget","thisProto","_checkPrototype","className","instFuncs","_getInstanceFuncs","_instFuncProxy","theFunc","baseFuncs","baseProto","visited","_getBaseFuncs","proto","baseInstFuncs","_createDynamicPrototype","dynProtoProxy","instFunc","protoFunc","instFuncTable","_populatePrototype","PageViewManager","appInsights","overridePageViewDuration","pageViewPerformanceManager","_logger","intervalHandle","itemQueue","pageViewPerformanceSent","_flushChannels","q","flush","trackPageView","pageView","title","uri","isPerformanceTimingSupported","sendPageViewInternal","customDuration","cb","pageViewSent","getPerformanceTiming","shouldCollectDuration","processed","isPerformanceTimingDataReady","pageViewPerformance","populatePageViewPerformanceEvent","isValid","sendPageViewPerformanceInternal","allItems","doFlush","clearInterval","PageVisitTimeManager","pageVisitTimeTrackingHandler","prevPageVisitDataKeyName","trackPreviousPageVisit","currentPageName","currentPageUrl","prevPageVisitTimeData","restartPageVisitTimer","pageName","pageUrl","pageVisitTime","prevPageVisitData","stopPageVisitTimer","startPageVisitTimer","currPageVisitData","PageVisitData","currPageVisitDataStr","pageVisitEndTime","pageVisitDataJsonStr","pageVisitStartTime","PageViewPerformanceManager","MAX_DURATION_ALLOWED","navigationTiming","getPerformanceNavigationTiming","total","network","startTime","connectEnd","request","requestStart","responseStart","response","responseEnd","dom","loadEventEnd","isPerformanceNavigationTimingSupported","getEntriesByType","domainLookupStart","domLoading","durations","_i","_navigator","botAgentNames","isGoogleBot","_dispatchEvent","evnt","dispatchEvent","ApplicationInsights","autoRoutePVDelay","_trackAjaxAttempts","_prevUri","getDefaultConfig","sessionRenewalMs","sessionExpirationMs","disableExceptionTracking","autoTrackPageVisitTime","enableUnhandledPromiseRejectionTracking","samplingPercentage","isStorageUseDisabled","isBrowserLinkTrackingEnabled","enableAutoRouteTracking","namePrefix","doNotSendItem","telemetryInitializersCount","_telemetryInitializers","telemetryInitializer","trackEvent","startTrackEvent","_eventTracking","stopTrackEvent","stop","trackTrace","trace","trackMetric","metric","inPv","_pageViewManager","_pageVisitTimeManager","refUri","referrer","trackPageViewPerformance","_pageViewPerformanceManager","startTrackPage","_pageTracking","stopTrackPage","measurement","loc","sendExceptionInternal","exceptionPartB","trackException","_onerror","properties_1","URL","_sendCORSException","errorString","addTelemetryInitializer","ctx","_globalconfig","defaults","configGetters","accountId","cookieDomain","sdkExtension","appId","trackPageVisitTime","_addDefaultTelemetryInitializers","action","pageViewItem","f","_window","_history","_location","instance","autoExceptionInstrumented","originalOnError_1","onerror","handled","autoUnhandledPromiseInstrumented","originalOnUnhandledRejection_1","pushState","replaceState","_self_1","_properties","ret","addEventListener","context","telemetryTrace","traceID","_currUri","bind","PageName","PageUrl","average","sampleCount","browserLinkPaths_1","_addTelemetryInitializer","envelope","remoteData","Version","Timing","_name","_events","ArraySendBuffer","_config","_buffer","enqueue","payload","clear","getItems","batchPayloads","emitLineDelimitedJson","join","markAsSent","clearSent","SessionStorageSendBuffer","_bufferFullMessageSent","bufferItems","getBuffer","BUFFER_KEY","notDeliveredItems","SENT_BUFFER_KEY","MAX_BUFFER_SIZE","setBuffer","removePayloadsFromBuffer","sentElements","payloads","buffer","remaining","contains","j","prefixedKey","bufferJson","EnvelopeCreator","extractPropsAndMeasurements","createEnvelope","iKeyNoDashes","extractPartAExtensions","user","authId","localId","app","sesId","device","deviceClass","ip","web","browserLang","browserVer","browser","screenRes","userConsent","model","os","parentID","tgs","tg","DependencyEnvelopeCreator","Create","customMeasurements","bd","command","responseCode","EventEnvelopeCreator","ExceptionEnvelopeCreator","MetricEnvelopeCreator","props","PageViewEnvelopeCreator","currentContextId","pageType","isLoggedIn","pageTags","PageViewPerformanceEnvelopeCreator","TraceEnvelopeCreator","Serializer","serialize","output","_serializeObject","source","_serializeStringMap","_serializeArray","contract","isRequired","isHidden","isPresent","sources","expectedType","parseFloat","Offline","OfflineListener","_onlineStatus","_document","isListening","_setOnline","_setOffline","body","ononline","onoffline","isOnline","onLine","isOffline","HashCodeScoreGenerator","getHashCodeScore","getHashCode","INT_MAX_VALUE","MIN_INPUT_LENGTH","hash","charCodeAt","SamplingScoreGenerator","hashCodeGeneragor","getSamplingScore","Sample","samplingRate","samplingScoreGenerator","isSampledIn","xhr","responseText","Sender","_XMLHttpRequestSupported","constructEnvelope","orig","_getDefaultAppInsightsChannelConfig","maxBatchInterval","maxBatchSizeInBytes","disableTelemetry","enableSessionStorageBuffer","isRetryDisabled","isBeaconApiDisabled","onunloadDisableBeacon","_getEmptyAppInsightsChannelConfig","pause","resume","triggerSend","onunloadFlush","_senderConfig","_beaconSender","teardown","_serializer","_consecutiveErrors","_retryAt","_lastSend","_sender","defaultConfig","_sample","XMLHttpRequest","_xhrSender","XDomainRequest","_xdrSender","_isSampledIn","aiEnvelope_1","doNotSendItem_1","callBack","bufferPayload","batch","_setupTimer","_xhrReadyStateChange","countOfItemsInPayload","readyState","_appId","_parseResponse","status","_isRetriable","_resendPayload","_onError","_formatErrorMessageXhr","_onPartialSuccess","_onSuccess","async","forcedSender","clearTimeout","_timeoutHandle","failed","retry","errors_1","errors","reverse","extracted","statusCode","itemsAccepted","itemsReceived","_xdrOnLoad","xdr","_formatErrorMessageXdr","isAsync","plainTextBatch","Blob","endPointUrl","open","setRequestHeader","onreadystatechange","send","linearFactor","payload_1","_setRetryTime","delayInSeconds","backOffSlot","pow","backOffDelay","retryAfterTimeSpan","retryInterval","timerValue","onload","hostingProtocol","lastIndexOf","Session","_SessionManager","acquisitionSpan","renewalSpan","_storageNamePrefix","cookieNameConst","automaticSession","update","initializeAutomaticSession","acquisitionExpired","acquisitionDate","renewalExpired","renewalDate","renew","cookieUpdatedTimestamp","cookieUpdateInterval","backup","initializeAutomaticSessionWithData","sessionData","params","acq","renewal","guid","acquisitionExpiry","renewalExpiry","cookieExpiry","setTime","cookieDomnain","UTCString","toUTCString","Application","Device","Internal","sdkVersion","User","isNewUser","userCookieName","cookieSeparator","acqStr","accountAcquisitionDate","newCookie","name_1","authCookie","authUserCookieName","authCookieString","decodeURI","authenticatedId","setAuthenticatedUserContext","authenticatedUserId","storeInCookie","validateUserInput","encodeURI","clearAuthenticatedUserContext","Location","parentId","TelemetryContext","sessionManager","application","internal","session","applySessionContext","sessionContext","applyOperatingSystemContxt","applyApplicationContext","build","applyDeviceContext","applyInternalContext","agentVersion","applyLocationContext","applyOperationContext","applyWebContext","applyUserContext","cleanUp","PropertiesPlugin","_extensionConfig","_breezeChannel","_processTelemetryInternal","cbNames","_arrLoop","fn","_doCallbacks","hooks","callDetails","cbArgs","hookCtx","hook","cbks","inst","err","orgEx","hookErrorCb","InstrumentFunc","callbacks","checkPrototype","owner","_getOwner","aiHook_1","newFunc","aiHook","h","funcThis","orgArgs","funcArgs","_replaceArg","_createArgs","theArgs","arg","rslt","theHook","rm","_objKeys","_calcPerfDuration","resourceEntry","to","_setPerfDuration","_setPerfValue","XHRMonitoringState","openDone","setRequestHeaderDone","sendDone","abortDone","stateChangeAttached","ajaxRecord","spanID","perfMark","completed","requestHeadersSize","requestHeaders","responseReceivingDuration","callbackDuration","ajaxTotalDuration","aborted","requestSize","requestSentTime","responseStartedTime","responseFinishedTime","callbackFinishedTime","endTime","xhrMonitoringState","clientFailure","CreateTrackItem","ajaxType","enableRequestHeaderTracking","getResponse","dependency","ajaxData","perfTiming","propsSet","_isString","strRedirect","strRedirectStart","strRedirectEnd","strDomainLookup","strConnect","strRequest","strResponse","serverTiming","server_1","normalizeJsName","newValue","val","perfAttempts","_populatePerfData","headerMap","responseHeaders","responseType","statusText","Traceparent","traceId","spanId","traceFlag","DEFAULT_TRACE_FLAG","version","DEFAULT_VERSION","isValidTraceId","isValidSpanId","_markCount","_getFailedAjaxDiagnosticsMessage","_throwInternalCritical","ajaxMonitorInstance","_throwInternalWarning","_createErrorCallbackFunc","internalMessage","args","ajaxDiagnosticsMessage","_indexOf","AjaxMonitor","_context","_isUsingW3CHeaders","_isUsingAIHeaders","_markPrefix","_fetchInitialized","_xhrInitialized","_currentWindowHost","getEmptyConfig","_enableRequestHeaderTracking","_enableAjaxPerfTracking","_maxAjaxCallsPerView","_enableResponseHeaderTracking","_hooks","_disabledUrls","base","_hookProto","InstrumentProto","_isDisabledRequest","init","isDisabled","theUrl","idx2","_isMonitoredXhrInstance","excludeAjaxDataValidation","ajaxValidation","initialized","_getResponseText","_getAjaxCorrelationContext","responseHeadersString","getAllResponseHeaders","getResponseHeader","_createMarkId","performance_1","mark","markId","entries","getEntriesByName","_findPerfResourceEntry","initiatorType","trackCallback","reportError","performance","maxAttempts","maxAjaxPerfLookupAttempts","retryDelay","ajaxPerfLookupDelay","attempt","locateResourceTiming","getEntries","entry","entryType","clearMarks","_getFailedFetchDiagnosticsMessage","_reportFetchMetrics","_reportFetchError","failedProps","errorProps","_getFetchCorrelationContext","headers","fetchDiagnosticsMessage","ctx_1","defaultConfig_1","distributedTracingMode","enableAjaxPerfTracking","maxAjaxCallsPerView","enableResponseHeaderTracking","AI","AI_AND_W3C","W3C","disableAjaxTracking","abort","theOpen","_supportsAjaxMonitoring","req","_reportXhrError","ajaxResponse","responseHeaderMap_2","parts","header","shift","_onAjaxComplete","exceptionText","_attachToOnReadyStateChange","_openHandler","hkErr","includeCorrelationHeaders","fetch","_global","Request","isPolyfill","polyfill","disableFetchTracking","fetchData","Headers","forEach","_createFetchRecord","newInit","rsp","then","responseHeaderMap_1","_instrumentFetch","propExt","trackDependencyData","currentWindowHost","traceparent","enableAjaxErrorStatusText","emptyConfig","Initialization","snippet","cs","ingest","instrumentationkey","dependencies","getSKUDefaults","inPvp","channel","loadAppInsights","legacyMode","appInsightsChannel","_updateSnippetProperties","emptyQueue","addHousekeepingBeforeUnload","updateSnippetDefinitions","length_1","appInsightsInstance","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wxC,IACtDG,EAAQ,EAAU3xC,gBAAgB,WAAYwxC,IAAwBG,IAElEJ,EAAoB5qB,YAAYthB,KAAKO,OAAOhD,cAAc/G,EAAgB+I,SAAU7D,EAAwD,uDAI/IwwC,EAAoB5qB,YAAY3kB,OAAO4vC,sBAExC,EAAU5xC,gBAAgB,WAAYwxC,KAIlDlB,EAAev2C,UAAU62C,eAAiB,WAC1B/2C,KACNmI,OAAOyK,sBADD5S,KAEFmI,OAAOyK,uBAFL5S,KAEoCmI,OAAOyK,sBAAwB,EAFnE5S,KAE6EmI,OAAOyK,sBAAwB,KAErH6jC,EAnUwB","file":"172.d2b241a2ca0a78c2c29a.js","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\"use strict\";\r\n/**\r\n * This file exists to hold environment utilities that are requied to check and\r\n * validate the current operating environment. Unless otherwise required, please\r\n * only defined methods (functions) in this class so that users of these\r\n * functions/properties only need to include those that are used within their own modules.\r\n */\r\nexport var strUndefined = \"undefined\";\r\nexport var strObject = \"object\";\r\nexport var strPrototype = \"prototype\";\r\nexport var strFunction = \"function\";\r\nvar strWindow = \"window\";\r\nvar strDocument = \"document\";\r\nvar strNavigator = \"navigator\";\r\nvar strHistory = \"history\";\r\nvar strLocation = \"location\";\r\nvar strPerformance = \"performance\";\r\nvar strJSON = \"JSON\";\r\n/**\r\n * Returns the current global scope object, for a normal web page this will be the current\r\n * window, for a Web Worker this will be current worker global scope via \"self\". The internal\r\n * implementation returns the first available instance object in the following order\r\n * - globalThis (New standard)\r\n * - self (Will return the current window instance for supported browsers)\r\n * - window (fallback for older browser implementations)\r\n * - global (NodeJS standard)\r\n * - (When all else fails)\r\n * While the return type is a Window for the normal case, not all environments will support all\r\n * of the properties or functions.\r\n */\r\nexport function getGlobal() {\r\n if (typeof globalThis !== strUndefined && globalThis) {\r\n return globalThis;\r\n }\r\n if (typeof self !== strUndefined && self) {\r\n return self;\r\n }\r\n if (typeof window !== strUndefined && window) {\r\n return window;\r\n }\r\n if (typeof global !== strUndefined && global) {\r\n return global;\r\n }\r\n return null;\r\n}\r\n/**\r\n * Return the named global object if available, will return null if the object is not available.\r\n * @param name The globally named object\r\n */\r\nexport function getGlobalInst(name) {\r\n var gbl = getGlobal();\r\n if (gbl && gbl[name]) {\r\n return gbl[name];\r\n }\r\n // Test workaround, for environments where .window (when global == window) doesn't return the base window\r\n if (name === strWindow && hasWindow()) {\r\n // tslint:disable-next-line: no-angle-bracket-type-assertion\r\n return window;\r\n }\r\n return null;\r\n}\r\n/**\r\n * Checks if window object is available, this is required as we support the API running without a\r\n * window /document (eg. Node server, electron webworkers) and if we attempt to assign a window\r\n * object to a local variable or pass as an argument an \"Uncaught ReferenceError: window is not defined\"\r\n * exception will be thrown.\r\n * Defined as a function to support lazy / late binding environments.\r\n */\r\nexport function hasWindow() {\r\n return Boolean(typeof window === strObject && window);\r\n}\r\n/**\r\n * Returns the global window object if it is present otherwise null.\r\n * This helper is used to access the window object without causing an exception\r\n * \"Uncaught ReferenceError: window is not defined\"\r\n */\r\nexport function getWindow() {\r\n if (hasWindow()) {\r\n return window;\r\n }\r\n // Return the global instance or null\r\n return getGlobalInst(strWindow);\r\n}\r\n/**\r\n * Checks if document object is available, this is required as we support the API running without a\r\n * window /document (eg. Node server, electron webworkers) and if we attempt to assign a document\r\n * object to a local variable or pass as an argument an \"Uncaught ReferenceError: document is not defined\"\r\n * exception will be thrown.\r\n * Defined as a function to support lazy / late binding environments.\r\n */\r\nexport function hasDocument() {\r\n return Boolean(typeof document === strObject && document);\r\n}\r\n/**\r\n * Returns the global document object if it is present otherwise null.\r\n * This helper is used to access the document object without causing an exception\r\n * \"Uncaught ReferenceError: document is not defined\"\r\n */\r\nexport function getDocument() {\r\n if (hasDocument()) {\r\n return document;\r\n }\r\n return getGlobalInst(strDocument);\r\n}\r\n/**\r\n * Checks if navigator object is available, this is required as we support the API running without a\r\n * window /document (eg. Node server, electron webworkers) and if we attempt to assign a navigator\r\n * object to a local variable or pass as an argument an \"Uncaught ReferenceError: navigator is not defined\"\r\n * exception will be thrown.\r\n * Defined as a function to support lazy / late binding environments.\r\n */\r\nexport function hasNavigator() {\r\n return Boolean(typeof navigator === strObject && navigator);\r\n}\r\n/**\r\n * Returns the global navigator object if it is present otherwise null.\r\n * This helper is used to access the navigator object without causing an exception\r\n * \"Uncaught ReferenceError: navigator is not defined\"\r\n */\r\nexport function getNavigator() {\r\n if (hasNavigator()) {\r\n return navigator;\r\n }\r\n return getGlobalInst(strNavigator);\r\n}\r\n/**\r\n * Checks if history object is available, this is required as we support the API running without a\r\n * window /document (eg. Node server, electron webworkers) and if we attempt to assign a history\r\n * object to a local variable or pass as an argument an \"Uncaught ReferenceError: history is not defined\"\r\n * exception will be thrown.\r\n * Defined as a function to support lazy / late binding environments.\r\n */\r\nexport function hasHistory() {\r\n return Boolean(typeof history === strObject && history);\r\n}\r\n/**\r\n * Returns the global history object if it is present otherwise null.\r\n * This helper is used to access the history object without causing an exception\r\n * \"Uncaught ReferenceError: history is not defined\"\r\n */\r\nexport function getHistory() {\r\n if (hasHistory()) {\r\n return history;\r\n }\r\n return getGlobalInst(strHistory);\r\n}\r\n/**\r\n * Returns the global location object if it is present otherwise null.\r\n * This helper is used to access the location object without causing an exception\r\n * \"Uncaught ReferenceError: location is not defined\"\r\n */\r\nexport function getLocation() {\r\n if (typeof location === strObject && location) {\r\n return location;\r\n }\r\n return getGlobalInst(strLocation);\r\n}\r\n/**\r\n * Returns the performance object if it is present otherwise null.\r\n * This helper is used to access the performance object from the current\r\n * global instance which could be window or globalThis for a web worker\r\n */\r\nexport function getPerformance() {\r\n return getGlobalInst(strPerformance);\r\n}\r\n/**\r\n * Checks if JSON object is available, this is required as we support the API running without a\r\n * window /document (eg. Node server, electron webworkers) and if we attempt to assign a history\r\n * object to a local variable or pass as an argument an \"Uncaught ReferenceError: JSON is not defined\"\r\n * exception will be thrown.\r\n * Defined as a function to support lazy / late binding environments.\r\n */\r\nexport function hasJSON() {\r\n return Boolean((typeof JSON === strObject && JSON) || getGlobalInst(strJSON) !== null);\r\n}\r\n/**\r\n * Returns the global JSON object if it is present otherwise null.\r\n * This helper is used to access the JSON object without causing an exception\r\n * \"Uncaught ReferenceError: JSON is not defined\"\r\n */\r\nexport function getJSON() {\r\n if (hasJSON()) {\r\n return JSON || getGlobalInst(strJSON);\r\n }\r\n return null;\r\n}\r\n//# sourceMappingURL=EnvUtils.js.map","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\"use strict\";\r\nimport { getWindow, getDocument, strUndefined, strObject, strFunction, strPrototype } from './EnvUtils';\r\n// Added to help with minfication\r\nexport var Undefined = strUndefined;\r\nvar strOnPrefix = \"on\";\r\nvar strAttachEvent = \"attachEvent\";\r\nvar strAddEventHelper = \"addEventListener\";\r\nvar strDetachEvent = \"detachEvent\";\r\nvar strRemoveEventListener = \"removeEventListener\";\r\nfunction _isTypeof(value, theType) {\r\n return typeof value === theType;\r\n}\r\n;\r\nfunction _isUndefined(value) {\r\n return _isTypeof(value, strUndefined) || value === undefined;\r\n}\r\n;\r\nfunction _isNullOrUndefined(value) {\r\n return (_isUndefined(value) || value === null);\r\n}\r\nfunction _hasOwnProperty(obj, prop) {\r\n return obj && Object[strPrototype].hasOwnProperty.call(obj, prop);\r\n}\r\n;\r\nfunction _isObject(value) {\r\n return _isTypeof(value, strObject);\r\n}\r\n;\r\nfunction _isFunction(value) {\r\n return _isTypeof(value, strFunction);\r\n}\r\n;\r\n/**\r\n * Binds the specified function to an event, so that the function gets called whenever the event fires on the object\r\n * @param obj Object to add the event too.\r\n * @param eventNameWithoutOn String that specifies any of the standard DHTML Events without \"on\" prefix\r\n * @param handlerRef Pointer that specifies the function to call when event fires\r\n * @param useCapture [Optional] Defaults to false\r\n * @returns True if the function was bound successfully to the event, otherwise false\r\n */\r\nfunction _attachEvent(obj, eventNameWithoutOn, handlerRef, useCapture) {\r\n if (useCapture === void 0) { useCapture = false; }\r\n var result = false;\r\n if (!_isNullOrUndefined(obj)) {\r\n try {\r\n if (!_isNullOrUndefined(obj[strAddEventHelper])) {\r\n // all browsers except IE before version 9\r\n obj[strAddEventHelper](eventNameWithoutOn, handlerRef, useCapture);\r\n result = true;\r\n }\r\n else if (!_isNullOrUndefined(obj[strAttachEvent])) {\r\n // IE before version 9 \r\n obj[strAttachEvent](strOnPrefix + eventNameWithoutOn, handlerRef);\r\n result = true;\r\n }\r\n }\r\n catch (e) {\r\n // Just Ignore any error so that we don't break any execution path\r\n }\r\n }\r\n return result;\r\n}\r\n/**\r\n * Removes an event handler for the specified event\r\n * @param Object to remove the event from\r\n * @param eventNameWithoutOn {string} - The name of the event\r\n * @param handlerRef {any} - The callback function that needs to be executed for the given event\r\n * @param useCapture [Optional] Defaults to false\r\n */\r\nfunction _detachEvent(obj, eventNameWithoutOn, handlerRef, useCapture) {\r\n if (useCapture === void 0) { useCapture = false; }\r\n if (!_isNullOrUndefined(obj)) {\r\n try {\r\n if (!_isNullOrUndefined(obj[strRemoveEventListener])) {\r\n obj[strRemoveEventListener](eventNameWithoutOn, handlerRef, useCapture);\r\n }\r\n else if (!_isNullOrUndefined(obj[strDetachEvent])) {\r\n obj[strDetachEvent](strOnPrefix + eventNameWithoutOn, handlerRef);\r\n }\r\n }\r\n catch (e) {\r\n // Just Ignore any error so that we don't break any execution path\r\n }\r\n }\r\n}\r\n/**\r\n * Validates that the string name conforms to the JS IdentifierName specification and if not\r\n * normalizes the name so that it would. This method does not identify or change any keywords\r\n * meaning that if you pass in a known keyword the same value will be returned.\r\n * This is a simplified version\r\n * @param name The name to validate\r\n */\r\nexport function normalizeJsName(name) {\r\n var value = name;\r\n var match = /([^\\w\\d_$])/g;\r\n if (match.test(name)) {\r\n value = name.replace(match, \"_\");\r\n }\r\n return value;\r\n}\r\nvar CoreUtils = /** @class */ (function () {\r\n function CoreUtils() {\r\n }\r\n /**\r\n * Check if an object is of type Date\r\n */\r\n CoreUtils.isDate = function (obj) {\r\n return Object[strPrototype].toString.call(obj) === \"[object Date]\";\r\n };\r\n /**\r\n * Checks if the type of value is a string.\r\n * @param {any} value - Value to be checked.\r\n * @return {boolean} True if the value is a string, false otherwise.\r\n */\r\n CoreUtils.isString = function (value) {\r\n return _isTypeof(value, \"string\");\r\n };\r\n /**\r\n * Checks if the type of value is a number.\r\n * @param {any} value - Value to be checked.\r\n * @return {boolean} True if the value is a number, false otherwise.\r\n */\r\n CoreUtils.isNumber = function (value) {\r\n return _isTypeof(value, \"number\");\r\n };\r\n /**\r\n * Checks if the type of value is a boolean.\r\n * @param {any} value - Value to be checked.\r\n * @return {boolean} True if the value is a boolean, false otherwise.\r\n */\r\n CoreUtils.isBoolean = function (value) {\r\n return _isTypeof(value, \"boolean\");\r\n };\r\n /**\r\n * Creates a new GUID.\r\n * @return {string} A GUID.\r\n */\r\n CoreUtils.disableCookies = function () {\r\n CoreUtils._canUseCookies = false;\r\n };\r\n CoreUtils.newGuid = function () {\r\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(GuidRegex, function (c) {\r\n var r = (Math.random() * 16 | 0), v = (c === 'x' ? r : r & 0x3 | 0x8);\r\n return v.toString(16);\r\n });\r\n };\r\n /**\r\n * Convert a date to I.S.O. format in IE8\r\n */\r\n CoreUtils.toISOString = function (date) {\r\n if (CoreUtils.isDate(date)) {\r\n var pad = function (num) {\r\n var r = String(num);\r\n if (r.length === 1) {\r\n r = \"0\" + r;\r\n }\r\n return r;\r\n };\r\n return date.getUTCFullYear()\r\n + \"-\" + pad(date.getUTCMonth() + 1)\r\n + \"-\" + pad(date.getUTCDate())\r\n + \"T\" + pad(date.getUTCHours())\r\n + \":\" + pad(date.getUTCMinutes())\r\n + \":\" + pad(date.getUTCSeconds())\r\n + \".\" + String((date.getUTCMilliseconds() / 1000).toFixed(3)).slice(2, 5)\r\n + \"Z\";\r\n }\r\n };\r\n /**\r\n * Performs the specified action for each element in an array. This helper exists to avoid adding a polyfil for older browsers\r\n * that do not define Array.prototype.xxxx (eg. ES3 only, IE8) just in case any page checks for presence/absence of the prototype\r\n * implementation. Note: For consistency this will not use the Array.prototype.xxxx implementation if it exists as this would\r\n * cause a testing requirement to test with and without the implementations\r\n * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.\r\n * @param thisArg [Optional] An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\r\n */\r\n CoreUtils.arrForEach = function (arr, callbackfn, thisArg) {\r\n var len = arr.length;\r\n for (var idx = 0; idx < len; ++idx) {\r\n if (idx in arr) {\r\n callbackfn.call(thisArg || arr, arr[idx], idx, arr);\r\n }\r\n }\r\n };\r\n /**\r\n * Returns the index of the first occurrence of a value in an array. This helper exists to avoid adding a polyfil for older browsers\r\n * that do not define Array.prototype.xxxx (eg. ES3 only, IE8) just in case any page checks for presence/absence of the prototype\r\n * implementation. Note: For consistency this will not use the Array.prototype.xxxx implementation if it exists as this would\r\n * cause a testing requirement to test with and without the implementations\r\n * @param searchElement The value to locate in the array.\r\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.\r\n */\r\n CoreUtils.arrIndexOf = function (arr, searchElement, fromIndex) {\r\n var len = arr.length;\r\n var from = fromIndex || 0;\r\n for (var lp = Math.max(from >= 0 ? from : len - Math.abs(from), 0); lp < len; lp++) {\r\n if (lp in arr && arr[lp] === searchElement) {\r\n return lp;\r\n }\r\n }\r\n return -1;\r\n };\r\n /**\r\n * Calls a defined callback function on each element of an array, and returns an array that contains the results. This helper exists\r\n * to avoid adding a polyfil for older browsers that do not define Array.prototype.xxxx (eg. ES3 only, IE8) just in case any page\r\n * checks for presence/absence of the prototype implementation. Note: For consistency this will not use the Array.prototype.xxxx\r\n * implementation if it exists as this would cause a testing requirement to test with and without the implementations\r\n * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.\r\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\r\n */\r\n CoreUtils.arrMap = function (arr, callbackfn, thisArg) {\r\n var len = arr.length;\r\n var _this = thisArg || arr;\r\n var results = new Array(len);\r\n for (var lp = 0; lp < len; lp++) {\r\n if (lp in arr) {\r\n results[lp] = callbackfn.call(_this, arr[lp], arr);\r\n }\r\n }\r\n return results;\r\n };\r\n /**\r\n * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is\r\n * provided as an argument in the next call to the callback function. This helper exists to avoid adding a polyfil for older browsers that do not define\r\n * Array.prototype.xxxx (eg. ES3 only, IE8) just in case any page checks for presence/absence of the prototype implementation. Note: For consistency\r\n * this will not use the Array.prototype.xxxx implementation if it exists as this would cause a testing requirement to test with and without the implementations\r\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.\r\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\r\n */\r\n CoreUtils.arrReduce = function (arr, callbackfn, initialValue) {\r\n var len = arr.length;\r\n var lp = 0;\r\n var value;\r\n // Specifically checking the number of passed arguments as the value could be anything\r\n if (arguments.length >= 3) {\r\n value = arguments[2];\r\n }\r\n else {\r\n while (lp < len && !(lp in arr)) {\r\n lp++;\r\n }\r\n value = arr[lp++];\r\n }\r\n while (lp < len) {\r\n if (lp in arr) {\r\n value = callbackfn(value, arr[lp], lp, arr);\r\n }\r\n lp++;\r\n }\r\n return value;\r\n };\r\n /**\r\n * Creates an object that has the specified prototype, and that optionally contains specified properties. This helper exists to avoid adding a polyfil\r\n * for older browsers that do not define Object.create eg. ES3 only, IE8 just in case any page checks for presence/absence of the prototype implementation.\r\n * Note: For consistency this will not use the Object.create implementation if it exists as this would cause a testing requirement to test with and without the implementations\r\n * @param obj Object to use as a prototype. May be null\r\n */\r\n CoreUtils.objCreate = function (obj) {\r\n if (obj == null) {\r\n return {};\r\n }\r\n if (!_isObject(obj) && !_isFunction(obj)) {\r\n throw new TypeError('Object prototype may only be an Object: ' + obj);\r\n }\r\n function tmpFunc() { }\r\n ;\r\n tmpFunc[strPrototype] = obj;\r\n return new tmpFunc();\r\n };\r\n /**\r\n * Returns the names of the enumerable string properties and methods of an object. This helper exists to avoid adding a polyfil for older browsers\r\n * that do not define Object.keys eg. ES3 only, IE8 just in case any page checks for presence/absence of the prototype implementation.\r\n * Note: For consistency this will not use the Object.keys implementation if it exists as this would cause a testing requirement to test with and without the implementations\r\n * @param obj Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.\r\n */\r\n CoreUtils.objKeys = function (obj) {\r\n var hasDontEnumBug = !({ toString: null }).propertyIsEnumerable('toString');\r\n if (!_isFunction(obj) && (!_isObject(obj) || obj === null)) {\r\n throw new TypeError('objKeys called on non-object');\r\n }\r\n var result = [];\r\n for (var prop in obj) {\r\n if (_hasOwnProperty(obj, prop)) {\r\n result.push(prop);\r\n }\r\n }\r\n if (hasDontEnumBug) {\r\n var dontEnums = [\r\n 'toString',\r\n 'toLocaleString',\r\n 'valueOf',\r\n 'hasOwnProperty',\r\n 'isPrototypeOf',\r\n 'propertyIsEnumerable',\r\n 'constructor'\r\n ];\r\n var dontEnumsLength = dontEnums.length;\r\n for (var lp = 0; lp < dontEnumsLength; lp++) {\r\n if (_hasOwnProperty(obj, dontEnums[lp])) {\r\n result.push(dontEnums[lp]);\r\n }\r\n }\r\n }\r\n return result;\r\n };\r\n /**\r\n * Try to define get/set object property accessors for the target object/prototype, this will provide compatibility with\r\n * existing API definition when run within an ES5+ container that supports accessors but still enable the code to be loaded\r\n * and executed in an ES3 container, providing basic IE8 compatibility.\r\n * @param target The object on which to define the property.\r\n * @param prop The name of the property to be defined or modified.\r\n * @param getProp The getter function to wire against the getter.\r\n * @param setProp The setter function to wire against the setter.\r\n * @returns True if it was able to create the accessors otherwise false\r\n */\r\n CoreUtils.objDefineAccessors = function (target, prop, getProp, setProp) {\r\n var defineProp = Object[\"defineProperty\"];\r\n if (defineProp) {\r\n try {\r\n var descriptor = {\r\n enumerable: true,\r\n configurable: true\r\n };\r\n if (getProp) {\r\n descriptor.get = getProp;\r\n }\r\n if (setProp) {\r\n descriptor.set = setProp;\r\n }\r\n defineProp(target, prop, descriptor);\r\n return true;\r\n }\r\n catch (e) {\r\n // IE8 Defines a defineProperty on Object but it's only supported for DOM elements so it will throw\r\n // We will just ignore this here.\r\n }\r\n }\r\n return false;\r\n };\r\n /**\r\n * Trys to add an event handler for the specified event to the window, body and document\r\n * @param eventName {string} - The name of the event\r\n * @param callback {any} - The callback function that needs to be executed for the given event\r\n * @return {boolean} - true if the handler was successfully added\r\n */\r\n CoreUtils.addEventHandler = function (eventName, callback) {\r\n var result = false;\r\n var w = getWindow();\r\n if (w) {\r\n result = _attachEvent(w, eventName, callback);\r\n result = _attachEvent(w[\"body\"], eventName, callback) || result;\r\n }\r\n var doc = getDocument();\r\n if (doc) {\r\n result = EventHelper.Attach(doc, eventName, callback) || result;\r\n }\r\n return result;\r\n };\r\n CoreUtils.isTypeof = _isTypeof;\r\n CoreUtils.isUndefined = _isUndefined;\r\n CoreUtils.isNullOrUndefined = _isNullOrUndefined;\r\n CoreUtils.hasOwnProperty = _hasOwnProperty;\r\n /**\r\n * Checks if the passed of value is a function.\r\n * @param {any} value - Value to be checked.\r\n * @return {boolean} True if the value is a boolean, false otherwise.\r\n */\r\n CoreUtils.isFunction = _isFunction;\r\n /**\r\n * Checks if the passed of value is a function.\r\n * @param {any} value - Value to be checked.\r\n * @return {boolean} True if the value is a boolean, false otherwise.\r\n */\r\n CoreUtils.isObject = _isObject;\r\n return CoreUtils;\r\n}());\r\nexport { CoreUtils };\r\nvar GuidRegex = /[xy]/g;\r\nvar EventHelper = /** @class */ (function () {\r\n function EventHelper() {\r\n }\r\n /**\r\n * Binds the specified function to an event, so that the function gets called whenever the event fires on the object\r\n * @param obj Object to add the event too.\r\n * @param eventNameWithoutOn String that specifies any of the standard DHTML Events without \"on\" prefix\r\n * @param handlerRef Pointer that specifies the function to call when event fires\r\n * @returns True if the function was bound successfully to the event, otherwise false\r\n */\r\n EventHelper.Attach = _attachEvent;\r\n /**\r\n * Binds the specified function to an event, so that the function gets called whenever the event fires on the object\r\n * @deprecated Use {@link EventHelper#Attach} as we are already in a class call EventHelper the extra \"Event\" just causes a larger result\r\n * @param obj Object to add the event too.\r\n * @param eventNameWithoutOn String that specifies any of the standard DHTML Events without \"on\" prefix\r\n * @param handlerRef Pointer that specifies the function to call when event fires\r\n * @returns True if the function was bound successfully to the event, otherwise false\r\n */\r\n EventHelper.AttachEvent = _attachEvent;\r\n /**\r\n * Removes an event handler for the specified event\r\n * @param eventName {string} - The name of the event\r\n * @param callback {any} - The callback function that needs to be executed for the given event\r\n * @return {boolean} - true if the handler was successfully added\r\n */\r\n EventHelper.Detach = _detachEvent;\r\n /**\r\n * Removes an event handler for the specified event\r\n * @deprecated Use {@link EventHelper#Detach} as we are already in a class call EventHelper the extra \"Event\" just causes a larger result\r\n * @param eventName {string} - The name of the event\r\n * @param callback {any} - The callback function that needs to be executed for the given event\r\n * @return {boolean} - true if the handler was successfully added\r\n */\r\n EventHelper.DetachEvent = _detachEvent;\r\n return EventHelper;\r\n}());\r\nexport { EventHelper };\r\n//# sourceMappingURL=CoreUtils.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nexport var LoggingSeverity;\r\n(function (LoggingSeverity) {\r\n /**\r\n * Error will be sent as internal telemetry\r\n */\r\n LoggingSeverity[LoggingSeverity[\"CRITICAL\"] = 1] = \"CRITICAL\";\r\n /**\r\n * Error will NOT be sent as internal telemetry, and will only be shown in browser console\r\n */\r\n LoggingSeverity[LoggingSeverity[\"WARNING\"] = 2] = \"WARNING\";\r\n})(LoggingSeverity || (LoggingSeverity = {}));\r\n/**\r\n * Internal message ID. Please create a new one for every conceptually different message. Please keep alphabetically ordered\r\n */\r\nexport var _InternalMessageId = {\r\n // Non user actionable\r\n BrowserDoesNotSupportLocalStorage: 0,\r\n BrowserCannotReadLocalStorage: 1,\r\n BrowserCannotReadSessionStorage: 2,\r\n BrowserCannotWriteLocalStorage: 3,\r\n BrowserCannotWriteSessionStorage: 4,\r\n BrowserFailedRemovalFromLocalStorage: 5,\r\n BrowserFailedRemovalFromSessionStorage: 6,\r\n CannotSendEmptyTelemetry: 7,\r\n ClientPerformanceMathError: 8,\r\n ErrorParsingAISessionCookie: 9,\r\n ErrorPVCalc: 10,\r\n ExceptionWhileLoggingError: 11,\r\n FailedAddingTelemetryToBuffer: 12,\r\n FailedMonitorAjaxAbort: 13,\r\n FailedMonitorAjaxDur: 14,\r\n FailedMonitorAjaxOpen: 15,\r\n FailedMonitorAjaxRSC: 16,\r\n FailedMonitorAjaxSend: 17,\r\n FailedMonitorAjaxGetCorrelationHeader: 18,\r\n FailedToAddHandlerForOnBeforeUnload: 19,\r\n FailedToSendQueuedTelemetry: 20,\r\n FailedToReportDataLoss: 21,\r\n FlushFailed: 22,\r\n MessageLimitPerPVExceeded: 23,\r\n MissingRequiredFieldSpecification: 24,\r\n NavigationTimingNotSupported: 25,\r\n OnError: 26,\r\n SessionRenewalDateIsZero: 27,\r\n SenderNotInitialized: 28,\r\n StartTrackEventFailed: 29,\r\n StopTrackEventFailed: 30,\r\n StartTrackFailed: 31,\r\n StopTrackFailed: 32,\r\n TelemetrySampledAndNotSent: 33,\r\n TrackEventFailed: 34,\r\n TrackExceptionFailed: 35,\r\n TrackMetricFailed: 36,\r\n TrackPVFailed: 37,\r\n TrackPVFailedCalc: 38,\r\n TrackTraceFailed: 39,\r\n TransmissionFailed: 40,\r\n FailedToSetStorageBuffer: 41,\r\n FailedToRestoreStorageBuffer: 42,\r\n InvalidBackendResponse: 43,\r\n FailedToFixDepricatedValues: 44,\r\n InvalidDurationValue: 45,\r\n TelemetryEnvelopeInvalid: 46,\r\n CreateEnvelopeError: 47,\r\n // User actionable\r\n CannotSerializeObject: 48,\r\n CannotSerializeObjectNonSerializable: 49,\r\n CircularReferenceDetected: 50,\r\n ClearAuthContextFailed: 51,\r\n ExceptionTruncated: 52,\r\n IllegalCharsInName: 53,\r\n ItemNotInArray: 54,\r\n MaxAjaxPerPVExceeded: 55,\r\n MessageTruncated: 56,\r\n NameTooLong: 57,\r\n SampleRateOutOfRange: 58,\r\n SetAuthContextFailed: 59,\r\n SetAuthContextFailedAccountName: 60,\r\n StringValueTooLong: 61,\r\n StartCalledMoreThanOnce: 62,\r\n StopCalledWithoutStart: 63,\r\n TelemetryInitializerFailed: 64,\r\n TrackArgumentsNotSpecified: 65,\r\n UrlTooLong: 66,\r\n SessionStorageBufferFull: 67,\r\n CannotAccessCookie: 68,\r\n IdTooLong: 69,\r\n InvalidEvent: 70,\r\n FailedMonitorAjaxSetRequestHeader: 71,\r\n SendBrowserInfoOnUserInit: 72,\r\n PluginException: 73\r\n};\r\n//# sourceMappingURL=LoggingEnums.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\"use strict\";\r\nimport { _InternalMessageId, LoggingSeverity } from \"../JavaScriptSDK.Enums/LoggingEnums\";\r\nimport { CoreUtils } from \"./CoreUtils\";\r\nimport { hasJSON, getJSON } from \"./EnvUtils\";\r\nvar _InternalLogMessage = /** @class */ (function () {\r\n function _InternalLogMessage(msgId, msg, isUserAct, properties) {\r\n if (isUserAct === void 0) { isUserAct = false; }\r\n this.messageId = msgId;\r\n this.message =\r\n (isUserAct ? _InternalLogMessage.AiUserActionablePrefix : _InternalLogMessage.AiNonUserActionablePrefix) +\r\n msgId;\r\n var strProps = \"\";\r\n if (hasJSON()) {\r\n strProps = getJSON().stringify(properties);\r\n }\r\n var diagnosticText = (msg ? \" message:\" + _InternalLogMessage.sanitizeDiagnosticText(msg) : \"\") +\r\n (properties ? \" props:\" + _InternalLogMessage.sanitizeDiagnosticText(strProps) : \"\");\r\n this.message += diagnosticText;\r\n }\r\n _InternalLogMessage.sanitizeDiagnosticText = function (text) {\r\n if (text) {\r\n return \"\\\"\" + text.replace(/\\\"/g, \"\") + \"\\\"\";\r\n }\r\n return \"\";\r\n };\r\n _InternalLogMessage.dataType = \"MessageData\";\r\n /**\r\n * For user non actionable traces use AI Internal prefix.\r\n */\r\n _InternalLogMessage.AiNonUserActionablePrefix = \"AI (Internal): \";\r\n /**\r\n * Prefix of the traces in portal.\r\n */\r\n _InternalLogMessage.AiUserActionablePrefix = \"AI: \";\r\n return _InternalLogMessage;\r\n}());\r\nexport { _InternalLogMessage };\r\nvar DiagnosticLogger = /** @class */ (function () {\r\n function DiagnosticLogger(config) {\r\n /**\r\n * The internal logging queue\r\n */\r\n this.queue = [];\r\n /**\r\n * Session storage key for the prefix for the key indicating message type already logged\r\n */\r\n this.AIInternalMessagePrefix = \"AITR_\";\r\n /**\r\n * Count of internal messages sent\r\n */\r\n this._messageCount = 0;\r\n /**\r\n * Holds information about what message types were already logged to console or sent to server.\r\n */\r\n this._messageLogged = {};\r\n /**\r\n * When this is true the SDK will throw exceptions to aid in debugging.\r\n */\r\n this.enableDebugExceptions = function () { return false; };\r\n /**\r\n * 0: OFF (default)\r\n * 1: CRITICAL\r\n * 2: >= WARNING\r\n */\r\n this.consoleLoggingLevel = function () { return 0; };\r\n /**\r\n * 0: OFF\r\n * 1: CRITICAL (default)\r\n * 2: >= WARNING\r\n */\r\n this.telemetryLoggingLevel = function () { return 1; };\r\n /**\r\n * The maximum number of internal messages allowed to be sent per page view\r\n */\r\n this.maxInternalMessageLimit = function () { return 25; };\r\n if (CoreUtils.isNullOrUndefined(config)) {\r\n // TODO: Use default config\r\n // config = AppInsightsCore.defaultConfig;\r\n // For now, use defaults specified in DiagnosticLogger members;\r\n return;\r\n }\r\n if (!CoreUtils.isNullOrUndefined(config.loggingLevelConsole)) {\r\n this.consoleLoggingLevel = function () { return config.loggingLevelConsole; };\r\n }\r\n if (!CoreUtils.isNullOrUndefined(config.loggingLevelTelemetry)) {\r\n this.telemetryLoggingLevel = function () { return config.loggingLevelTelemetry; };\r\n }\r\n if (!CoreUtils.isNullOrUndefined(config.maxMessageLimit)) {\r\n this.maxInternalMessageLimit = function () { return config.maxMessageLimit; };\r\n }\r\n if (!CoreUtils.isNullOrUndefined(config.enableDebugExceptions)) {\r\n this.enableDebugExceptions = function () { return config.enableDebugExceptions; };\r\n }\r\n }\r\n /**\r\n * This method will throw exceptions in debug mode or attempt to log the error as a console warning.\r\n * @param severity {LoggingSeverity} - The severity of the log message\r\n * @param message {_InternalLogMessage} - The log message.\r\n */\r\n DiagnosticLogger.prototype.throwInternal = function (severity, msgId, msg, properties, isUserAct) {\r\n if (isUserAct === void 0) { isUserAct = false; }\r\n var message = new _InternalLogMessage(msgId, msg, isUserAct, properties);\r\n var _this = this;\r\n if (_this.enableDebugExceptions()) {\r\n throw message;\r\n }\r\n else {\r\n if (!CoreUtils.isUndefined(message) && !!message) {\r\n if (!CoreUtils.isUndefined(message.message)) {\r\n if (isUserAct) {\r\n // check if this message type was already logged to console for this page view and if so, don't log it again\r\n var messageKey = +message.messageId;\r\n if (!_this._messageLogged[messageKey] && _this.consoleLoggingLevel() >= LoggingSeverity.WARNING) {\r\n _this.warnToConsole(message.message);\r\n _this._messageLogged[messageKey] = true;\r\n }\r\n }\r\n else {\r\n // don't log internal AI traces in the console, unless the verbose logging is enabled\r\n if (_this.consoleLoggingLevel() >= LoggingSeverity.WARNING) {\r\n _this.warnToConsole(message.message);\r\n }\r\n }\r\n _this.logInternalMessage(severity, message);\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * This will write a warning to the console if possible\r\n * @param message {string} - The warning message\r\n */\r\n DiagnosticLogger.prototype.warnToConsole = function (message) {\r\n if (!CoreUtils.isUndefined(console) && !!console) {\r\n if (CoreUtils.isFunction(console.warn)) {\r\n console.warn(message);\r\n }\r\n else if (CoreUtils.isFunction(console.log)) {\r\n console.log(message);\r\n }\r\n }\r\n };\r\n /**\r\n * Resets the internal message count\r\n */\r\n DiagnosticLogger.prototype.resetInternalMessageCount = function () {\r\n this._messageCount = 0;\r\n this._messageLogged = {};\r\n };\r\n /**\r\n * Logs a message to the internal queue.\r\n * @param severity {LoggingSeverity} - The severity of the log message\r\n * @param message {_InternalLogMessage} - The message to log.\r\n */\r\n DiagnosticLogger.prototype.logInternalMessage = function (severity, message) {\r\n var _this = this;\r\n if (_this._areInternalMessagesThrottled()) {\r\n return;\r\n }\r\n // check if this message type was already logged for this session and if so, don't log it again\r\n var logMessage = true;\r\n var messageKey = _this.AIInternalMessagePrefix + message.messageId;\r\n // if the session storage is not available, limit to only one message type per page view\r\n if (_this._messageLogged[messageKey]) {\r\n logMessage = false;\r\n }\r\n else {\r\n _this._messageLogged[messageKey] = true;\r\n }\r\n if (logMessage) {\r\n // Push the event in the internal queue\r\n if (severity <= _this.telemetryLoggingLevel()) {\r\n _this.queue.push(message);\r\n _this._messageCount++;\r\n }\r\n // When throttle limit reached, send a special event\r\n if (_this._messageCount === _this.maxInternalMessageLimit()) {\r\n var throttleLimitMessage = \"Internal events throttle limit per PageView reached for this app.\";\r\n var throttleMessage = new _InternalLogMessage(_InternalMessageId.MessageLimitPerPVExceeded, throttleLimitMessage, false);\r\n _this.queue.push(throttleMessage);\r\n _this.warnToConsole(throttleLimitMessage);\r\n }\r\n }\r\n };\r\n /**\r\n * Indicates whether the internal events are throttled\r\n */\r\n DiagnosticLogger.prototype._areInternalMessagesThrottled = function () {\r\n return this._messageCount >= this.maxInternalMessageLimit();\r\n };\r\n return DiagnosticLogger;\r\n}());\r\nexport { DiagnosticLogger };\r\n//# sourceMappingURL=DiagnosticLogger.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\"use strict\";\r\nimport { CoreUtils } from \"./CoreUtils\";\r\nimport { LoggingSeverity, _InternalMessageId } from '../JavaScriptSDK.Enums/LoggingEnums';\r\nvar _isFunction = CoreUtils.isFunction;\r\nvar TelemetryPluginChain = /** @class */ (function () {\r\n function TelemetryPluginChain(plugin, defItemCtx) {\r\n var _self = this;\r\n var _nextProxy = null;\r\n var _hasProcessTelemetry = _isFunction(plugin.processTelemetry);\r\n var _hasSetNext = _isFunction(plugin.setNextPlugin);\r\n _self._hasRun = false;\r\n _self.getPlugin = function () {\r\n return plugin;\r\n };\r\n _self.getNext = function () {\r\n return _nextProxy;\r\n };\r\n _self.setNext = function (nextPlugin) {\r\n _nextProxy = nextPlugin;\r\n };\r\n _self.processTelemetry = function (env, itemCtx) {\r\n if (!itemCtx) {\r\n // Looks like a plugin didn't pass the (optional) context, so restore to the default\r\n itemCtx = defItemCtx;\r\n }\r\n if (plugin && _hasProcessTelemetry) {\r\n _self._hasRun = true;\r\n try {\r\n // Ensure that we keep the context in sync (for processNext()), just in case a plugin\r\n // doesn't calls processTelemetry() instead of itemContext.processNext() or some \r\n // other form of error occurred\r\n itemCtx.setNext(_nextProxy);\r\n if (_hasSetNext) {\r\n // Backward compatibility setting the next plugin on the instance\r\n plugin.setNextPlugin(_nextProxy);\r\n }\r\n // Set a flag on the next plugin so we know if it was attempted to be executed\r\n _nextProxy && (_nextProxy._hasRun = false);\r\n plugin.processTelemetry(env, itemCtx);\r\n }\r\n catch (error) {\r\n var hasRun = _nextProxy && _nextProxy._hasRun;\r\n if (!_nextProxy || !hasRun) {\r\n // Either we have no next plugin or the current one did not attempt to call the next plugin\r\n // Which means the current one is the root of the failure so log/report this failure\r\n itemCtx.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.PluginException, \"Plugin [\" + plugin.identifier + \"] failed during processTelemetry - \" + error);\r\n }\r\n if (_nextProxy && !hasRun) {\r\n // As part of the failure the current plugin did not attempt to call the next plugin in the cahin\r\n // So rather than leave the pipeline dead in the water we call the next plugin\r\n _nextProxy.processTelemetry(env, itemCtx);\r\n }\r\n }\r\n }\r\n else if (_nextProxy) {\r\n _self._hasRun = true;\r\n // The underlying plugin is either not defined or does not have a processTelemetry implementation\r\n // so we still want the next plugin to be executed.\r\n _nextProxy.processTelemetry(env, itemCtx);\r\n }\r\n };\r\n }\r\n return TelemetryPluginChain;\r\n}());\r\nexport { TelemetryPluginChain };\r\n//# sourceMappingURL=TelemetryPluginChain.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\"use strict\";\r\nimport { CoreUtils } from \"./CoreUtils\";\r\nimport { DiagnosticLogger } from \"./DiagnosticLogger\";\r\nimport { TelemetryPluginChain } from \"./TelemetryPluginChain\";\r\nvar _isNullOrUndefined = CoreUtils.isNullOrUndefined;\r\n/**\r\n * Creates the instance execution chain for the plugins\r\n */\r\nfunction _createProxyChain(plugins, itemCtx) {\r\n var proxies = [];\r\n if (plugins && plugins.length > 0) {\r\n // Create the proxies and wire up the next plugin chain\r\n var lastProxy = null;\r\n for (var idx = 0; idx < plugins.length; idx++) {\r\n var thePlugin = plugins[idx];\r\n if (thePlugin && CoreUtils.isFunction(thePlugin.processTelemetry)) {\r\n // Only add plugins that are processors\r\n var newProxy = new TelemetryPluginChain(thePlugin, itemCtx);\r\n proxies.push(newProxy);\r\n if (lastProxy) {\r\n // Set this new proxy as the next for the previous one\r\n lastProxy.setNext(newProxy);\r\n }\r\n lastProxy = newProxy;\r\n }\r\n }\r\n }\r\n return proxies.length > 0 ? proxies[0] : null;\r\n}\r\nfunction _copyProxyChain(proxy, itemCtx, startAt) {\r\n var plugins = [];\r\n var add = startAt ? false : true;\r\n if (proxy) {\r\n while (proxy) {\r\n var thePlugin = proxy.getPlugin();\r\n if (add || thePlugin === startAt) {\r\n add = true;\r\n plugins.push(thePlugin);\r\n }\r\n proxy = proxy.getNext();\r\n }\r\n }\r\n if (!add) {\r\n plugins.push(startAt);\r\n }\r\n return _createProxyChain(plugins, itemCtx);\r\n}\r\nfunction _copyPluginChain(srcPlugins, itemCtx, startAt) {\r\n var plugins = srcPlugins;\r\n var add = false;\r\n if (startAt && srcPlugins) {\r\n plugins = [];\r\n CoreUtils.arrForEach(srcPlugins, function (thePlugin) {\r\n if (add || thePlugin === startAt) {\r\n add = true;\r\n plugins.push(thePlugin);\r\n }\r\n });\r\n }\r\n if (startAt && !add) {\r\n if (!plugins) {\r\n plugins = [];\r\n }\r\n plugins.push(startAt);\r\n }\r\n return _createProxyChain(plugins, itemCtx);\r\n}\r\nvar ProcessTelemetryContext = /** @class */ (function () {\r\n /**\r\n * Creates a new Telemetry Item context with the current config, core and plugin execution chain\r\n * @param plugins - The plugin instances that will be executed\r\n * @param config - The current config\r\n * @param core - The current core instance\r\n */\r\n function ProcessTelemetryContext(plugins, config, core, startAt) {\r\n var _self = this;\r\n var _nextProxy = null; // Null == No next plugin\r\n // There is no next element (null) vs not defined (undefined)\r\n if (startAt !== null) {\r\n if (plugins && CoreUtils.isFunction(plugins.getPlugin)) {\r\n // We have a proxy chain object\r\n _nextProxy = _copyProxyChain(plugins, _self, startAt || plugins.getPlugin());\r\n }\r\n else {\r\n // We just have an array\r\n if (startAt) {\r\n _nextProxy = _copyPluginChain(plugins, _self, startAt);\r\n }\r\n else if (CoreUtils.isUndefined(startAt)) {\r\n // Undefined means copy the existing chain\r\n _nextProxy = _createProxyChain(plugins, _self);\r\n }\r\n }\r\n }\r\n _self.core = function () {\r\n return core;\r\n };\r\n _self.diagLog = function () {\r\n var logger = (core || {}).logger;\r\n if (!logger) {\r\n // Fallback so we always have a logger\r\n logger = new DiagnosticLogger(config || {});\r\n }\r\n return logger;\r\n };\r\n _self.getCfg = function () {\r\n return config;\r\n };\r\n _self.getExtCfg = function (identifier, defaultValue) {\r\n if (defaultValue === void 0) { defaultValue = {}; }\r\n var theConfig;\r\n if (config) {\r\n var extConfig = config.extensionConfig;\r\n if (extConfig && identifier) {\r\n theConfig = extConfig[identifier];\r\n }\r\n }\r\n return (theConfig ? theConfig : defaultValue);\r\n };\r\n _self.getConfig = function (identifier, field, defaultValue) {\r\n if (defaultValue === void 0) { defaultValue = false; }\r\n var theValue;\r\n var extConfig = _self.getExtCfg(identifier, null);\r\n if (extConfig && !_isNullOrUndefined(extConfig[field])) {\r\n theValue = extConfig[field];\r\n }\r\n else if (config && !_isNullOrUndefined(config[field])) {\r\n theValue = config[field];\r\n }\r\n return !_isNullOrUndefined(theValue) ? theValue : defaultValue;\r\n };\r\n _self.hasNext = function () {\r\n return _nextProxy != null;\r\n };\r\n _self.getNext = function () {\r\n return _nextProxy;\r\n };\r\n _self.setNext = function (nextPlugin) {\r\n _nextProxy = nextPlugin;\r\n };\r\n _self.processNext = function (env) {\r\n var nextPlugin = _nextProxy;\r\n if (nextPlugin) {\r\n // Automatically move to the next plugin\r\n _nextProxy = nextPlugin.getNext();\r\n nextPlugin.processTelemetry(env, _self);\r\n }\r\n };\r\n _self.createNew = function (plugins, startAt) {\r\n if (plugins === void 0) { plugins = null; }\r\n return new ProcessTelemetryContext(plugins || _nextProxy, config, core, startAt);\r\n };\r\n }\r\n return ProcessTelemetryContext;\r\n}());\r\nexport { ProcessTelemetryContext };\r\n//# sourceMappingURL=ProcessTelemetryContext.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\"use strict\";\r\nimport { CoreUtils } from \"./CoreUtils\";\r\nimport { ProcessTelemetryContext } from './ProcessTelemetryContext';\r\nvar _isFunction = CoreUtils.isFunction;\r\nvar getPlugin = \"getPlugin\";\r\n/**\r\n * BaseTelemetryPlugin provides a basic implementation of the ITelemetryPlugin interface so that plugins\r\n * can avoid implementation the same set of boiler plate code as well as provide a base\r\n * implementation so that new default implementations can be added without breaking all plugins.\r\n */\r\nvar BaseTelemetryPlugin = /** @class */ (function () {\r\n function BaseTelemetryPlugin() {\r\n var _self = this;\r\n var _isinitialized = false;\r\n var _rootCtx = null; // Used as the root context, holding the current config and initialized core\r\n var _nextPlugin = null; // Used for backward compatibility where plugins don't call the main pipeline\r\n _self.core = null;\r\n _self.diagLog = function (itemCtx) {\r\n return _self._getTelCtx(itemCtx).diagLog();\r\n };\r\n _self.isInitialized = function () {\r\n return _isinitialized;\r\n };\r\n _self.setInitialized = function (isInitialized) {\r\n _isinitialized = isInitialized;\r\n };\r\n // _self.getNextPlugin = () => DO NOT IMPLEMENT\r\n // Sub-classes of this base class *should* not be relying on this value and instead\r\n // should use processNext() function. If you require access to the plugin use the\r\n // IProcessTelemetryContext.getNext().getPlugin() while in the pipeline, Note getNext() may return null.\r\n _self.setNextPlugin = function (next) {\r\n _nextPlugin = next;\r\n };\r\n _self.processNext = function (env, itemCtx) {\r\n if (itemCtx) {\r\n // Normal core execution sequence\r\n itemCtx.processNext(env);\r\n }\r\n else if (_nextPlugin && _isFunction(_nextPlugin.processTelemetry)) {\r\n // Looks like backward compatibility or out of band processing. And as it looks \r\n // like a ITelemetryPlugin or ITelemetryPluginChain, just call processTelemetry\r\n _nextPlugin.processTelemetry(env, null);\r\n }\r\n };\r\n _self._getTelCtx = function (currentCtx) {\r\n if (currentCtx === void 0) { currentCtx = null; }\r\n var itemCtx = currentCtx;\r\n if (!itemCtx) {\r\n var rootCtx = _rootCtx || new ProcessTelemetryContext(null, {}, _self.core);\r\n // tslint:disable-next-line: prefer-conditional-expression\r\n if (_nextPlugin && _nextPlugin[getPlugin]) {\r\n // Looks like a chain object\r\n itemCtx = rootCtx.createNew(null, _nextPlugin[getPlugin]);\r\n }\r\n else {\r\n itemCtx = rootCtx.createNew(null, _nextPlugin);\r\n }\r\n }\r\n return itemCtx;\r\n };\r\n _self._baseTelInit = function (config, core, extensions, pluginChain) {\r\n if (config) {\r\n // Make sure the extensionConfig exists\r\n config.extensionConfig = config.extensionConfig || [];\r\n }\r\n if (!pluginChain && core) {\r\n // Get the first plugin from the core\r\n pluginChain = core.getProcessTelContext().getNext();\r\n }\r\n var nextPlugin = _nextPlugin;\r\n if (_nextPlugin && _nextPlugin[getPlugin]) {\r\n // If it looks like a proxy/chain then get the plugin\r\n nextPlugin = _nextPlugin[getPlugin]();\r\n }\r\n // Support legacy plugins where core was defined as a property\r\n _self.core = core;\r\n _rootCtx = new ProcessTelemetryContext(pluginChain, config, core, nextPlugin);\r\n _isinitialized = true;\r\n };\r\n }\r\n BaseTelemetryPlugin.prototype.initialize = function (config, core, extensions, pluginChain) {\r\n this._baseTelInit(config, core, extensions, pluginChain);\r\n };\r\n return BaseTelemetryPlugin;\r\n}());\r\nexport { BaseTelemetryPlugin };\r\n//# sourceMappingURL=BaseTelemetryPlugin.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\"use strict\";\r\nimport { CoreUtils } from \"./CoreUtils\";\r\nvar _isFunction = CoreUtils.isFunction;\r\nvar processTelemetry = \"processTelemetry\";\r\nvar priority = \"priority\";\r\nvar setNextPlugin = \"setNextPlugin\";\r\nvar isInitialized = \"isInitialized\";\r\n/**\r\n * Initialize the queue of plugins\r\n * @param plugins - The array of plugins to initialize and setting of the next plugin\r\n * @param config The current config for the instance\r\n * @param core THe current core instance\r\n * @param extensions The extensions\r\n */\r\nexport function initializePlugins(processContext, extensions) {\r\n // Set the next plugin and identified the uninitialized plugins\r\n var initPlugins = [];\r\n var lastPlugin = null;\r\n var proxy = processContext.getNext();\r\n while (proxy) {\r\n var thePlugin = proxy.getPlugin();\r\n if (thePlugin) {\r\n if (lastPlugin &&\r\n _isFunction(lastPlugin[setNextPlugin]) &&\r\n _isFunction(thePlugin[processTelemetry])) {\r\n // Set this plugin as the next for the previous one\r\n lastPlugin[setNextPlugin](thePlugin);\r\n }\r\n if (!_isFunction(thePlugin[isInitialized]) || !thePlugin[isInitialized]()) {\r\n initPlugins.push(thePlugin);\r\n }\r\n lastPlugin = thePlugin;\r\n proxy = proxy.getNext();\r\n }\r\n }\r\n // Now initiatilize the plugins\r\n CoreUtils.arrForEach(initPlugins, function (thePlugin) {\r\n thePlugin.initialize(processContext.getCfg(), processContext.core(), extensions, processContext.getNext());\r\n });\r\n}\r\nexport function sortPlugins(plugins) {\r\n // Sort by priority\r\n return plugins.sort(function (extA, extB) {\r\n var result = 0;\r\n var bHasProcess = _isFunction(extB[processTelemetry]);\r\n if (_isFunction(extA[processTelemetry])) {\r\n result = bHasProcess ? extA[priority] - extB[priority] : 1;\r\n }\r\n else if (bHasProcess) {\r\n result = -1;\r\n }\r\n return result;\r\n });\r\n // sort complete \r\n}\r\n//# sourceMappingURL=TelemetryHelpers.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\"use strict\";\r\nimport * as tslib_1 from \"tslib\";\r\nimport { CoreUtils } from \"./CoreUtils\";\r\nimport { BaseTelemetryPlugin } from './BaseTelemetryPlugin';\r\nimport { ProcessTelemetryContext } from './ProcessTelemetryContext';\r\nimport { initializePlugins } from './TelemetryHelpers';\r\nvar ChannelControllerPriority = 500;\r\nvar ChannelValidationMessage = \"Channel has invalid priority\";\r\nvar _arrForEach = CoreUtils.arrForEach;\r\nvar _objDefineAccessors = CoreUtils.objDefineAccessors;\r\nfunction _checkQueuePriority(queue) {\r\n _arrForEach(queue, function (queueItem) {\r\n if (queueItem.priority < ChannelControllerPriority) {\r\n throw Error(ChannelValidationMessage + queueItem.identifier);\r\n }\r\n });\r\n}\r\nfunction _addChannelQueue(channelQueues, queue) {\r\n if (queue && queue.length > 0) {\r\n queue = queue.sort(function (a, b) {\r\n return a.priority - b.priority;\r\n });\r\n _checkQueuePriority(queue);\r\n channelQueues.push(queue);\r\n }\r\n}\r\nfunction _createChannelQueues(channels, extensions) {\r\n var channelQueues = [];\r\n if (channels) {\r\n // Add and sort the configuration channel queues\r\n _arrForEach(channels, function (queue) { return _addChannelQueue(channelQueues, queue); });\r\n }\r\n if (extensions) {\r\n // Create a new channel queue for any extensions with a priority > the ChannelControllerPriority\r\n var extensionQueue_1 = [];\r\n _arrForEach(extensions, function (plugin) {\r\n if (plugin.priority > ChannelControllerPriority) {\r\n extensionQueue_1.push(plugin);\r\n }\r\n });\r\n _addChannelQueue(channelQueues, extensionQueue_1);\r\n }\r\n return channelQueues;\r\n}\r\nvar ChannelController = /** @class */ (function (_super) {\r\n tslib_1.__extends(ChannelController, _super);\r\n function ChannelController() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.identifier = \"ChannelControllerPlugin\";\r\n _this.priority = ChannelControllerPriority; // in reserved range 100 to 200\r\n return _this;\r\n }\r\n ChannelController.prototype.processTelemetry = function (item, itemCtx) {\r\n var _this = this;\r\n if (this._channelQueue) {\r\n _arrForEach(this._channelQueue, function (queues) {\r\n // pass on to first item in queue\r\n if (queues.length > 0) {\r\n // Copying the item context as we could have mutiple chains that are executing asynchronously\r\n // and calling _getDefTelCtx as it's possible that the caller doesn't pass any context\r\n var chainCtx = _this._getTelCtx(itemCtx).createNew(queues);\r\n chainCtx.processNext(item);\r\n }\r\n });\r\n }\r\n };\r\n ;\r\n ChannelController.prototype.getChannelControls = function () {\r\n return this._channelQueue;\r\n };\r\n ChannelController.prototype.initialize = function (config, core, extensions) {\r\n var _self = this;\r\n if (_self.isInitialized()) {\r\n // already initialized\r\n return;\r\n }\r\n _super.prototype.initialize.call(this, config, core, extensions);\r\n if (config.isCookieUseDisabled) {\r\n CoreUtils.disableCookies();\r\n }\r\n var channelQueue = _self._channelQueue = _createChannelQueues((config || {}).channels, extensions);\r\n // Initialize the Queues\r\n _arrForEach(channelQueue, function (queue) { return initializePlugins(new ProcessTelemetryContext(queue, config, core), extensions); });\r\n };\r\n /**\r\n * Static constructor, attempt to create accessors\r\n */\r\n // tslint:disable-next-line\r\n ChannelController._staticInit = (function () {\r\n // Dynamically create get/set property accessors\r\n _objDefineAccessors(ChannelController.prototype, \"ChannelControls\", ChannelController.prototype.getChannelControls);\r\n _objDefineAccessors(ChannelController.prototype, \"channelQueue\", ChannelController.prototype.getChannelControls);\r\n })();\r\n return ChannelController;\r\n}(BaseTelemetryPlugin));\r\nexport { ChannelController };\r\n//# sourceMappingURL=ChannelController.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n/**\r\n * Type of storage to differentiate between local storage and session storage\r\n */\r\nexport var StorageType;\r\n(function (StorageType) {\r\n StorageType[StorageType[\"LocalStorage\"] = 0] = \"LocalStorage\";\r\n StorageType[StorageType[\"SessionStorage\"] = 1] = \"SessionStorage\";\r\n})(StorageType || (StorageType = {}));\r\n/**\r\n * Enum is used in aiDataContract to describe how fields are serialized.\r\n * For instance: (Fieldtype.Required | FieldType.Array) will mark the field as required and indicate it's an array\r\n */\r\nexport var FieldType;\r\n(function (FieldType) {\r\n FieldType[FieldType[\"Default\"] = 0] = \"Default\";\r\n FieldType[FieldType[\"Required\"] = 1] = \"Required\";\r\n FieldType[FieldType[\"Array\"] = 2] = \"Array\";\r\n FieldType[FieldType[\"Hidden\"] = 4] = \"Hidden\";\r\n})(FieldType || (FieldType = {}));\r\n;\r\nexport var DistributedTracingModes;\r\n(function (DistributedTracingModes) {\r\n /**\r\n * (Default) Send Application Insights correlation headers\r\n */\r\n DistributedTracingModes[DistributedTracingModes[\"AI\"] = 0] = \"AI\";\r\n /**\r\n * Send both W3C Trace Context headers and back-compatibility Application Insights headers\r\n */\r\n DistributedTracingModes[DistributedTracingModes[\"AI_AND_W3C\"] = 1] = \"AI_AND_W3C\";\r\n /**\r\n * Send W3C Trace Context headers\r\n */\r\n DistributedTracingModes[DistributedTracingModes[\"W3C\"] = 2] = \"W3C\";\r\n})(DistributedTracingModes || (DistributedTracingModes = {}));\r\n//# sourceMappingURL=Enums.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\"use strict\";\r\nimport { CoreUtils } from \"./CoreUtils\";\r\nimport { ChannelController } from './ChannelController';\r\nimport { ProcessTelemetryContext } from './ProcessTelemetryContext';\r\nimport { initializePlugins, sortPlugins } from './TelemetryHelpers';\r\nvar validationError = \"Extensions must provide callback to initialize\";\r\nvar _arrForEach = CoreUtils.arrForEach;\r\nvar _isNullOrUndefined = CoreUtils.isNullOrUndefined;\r\nvar BaseCore = /** @class */ (function () {\r\n function BaseCore() {\r\n var _isInitialized = false;\r\n var _this = this;\r\n _this._extensions = new Array();\r\n _this._channelController = new ChannelController();\r\n _this.isInitialized = function () { return _isInitialized; };\r\n _this._setInit = function (value) { _isInitialized = value; };\r\n _this._eventQueue = [];\r\n }\r\n BaseCore.prototype.initialize = function (config, extensions, logger, notificationManager) {\r\n var _this = this;\r\n // Make sure core is only initialized once\r\n if (_this.isInitialized()) {\r\n throw Error(\"Core should not be initialized more than once\");\r\n }\r\n if (!config || _isNullOrUndefined(config.instrumentationKey)) {\r\n throw Error(\"Please provide instrumentation key\");\r\n }\r\n _this.config = config;\r\n var channelController = _this._channelController;\r\n if (!notificationManager) {\r\n // Create Dummy notification manager\r\n notificationManager = CoreUtils.objCreate({\r\n addNotificationListener: function (listener) { },\r\n removeNotificationListener: function (listener) { },\r\n eventsSent: function (events) { },\r\n eventsDiscarded: function (events, reason) { }\r\n });\r\n }\r\n _this._notificationManager = notificationManager;\r\n config.extensions = _isNullOrUndefined(config.extensions) ? [] : config.extensions;\r\n // add notification to the extensions in the config so other plugins can access it\r\n var extConfig = config.extensionConfig = _isNullOrUndefined(config.extensionConfig) ? {} : config.extensionConfig;\r\n extConfig.NotificationManager = notificationManager;\r\n if (!logger) {\r\n logger = CoreUtils.objCreate({\r\n throwInternal: function (severity, msgId, msg, properties, isUserAct) {\r\n if (isUserAct === void 0) { isUserAct = false; }\r\n },\r\n warnToConsole: function (message) { },\r\n resetInternalMessageCount: function () { }\r\n });\r\n }\r\n _this.logger = logger;\r\n // Concat all available extensions\r\n var allExtensions = [];\r\n allExtensions.push.apply(allExtensions, extensions.concat(config.extensions));\r\n allExtensions = sortPlugins(allExtensions);\r\n var coreExtensions = [];\r\n var channelExtensions = [];\r\n // Check if any two extensions have the same priority, then warn to console\r\n // And extract the local extensions from the \r\n var extPriorities = {};\r\n // Extension validation\r\n _arrForEach(allExtensions, function (ext) {\r\n if (_isNullOrUndefined(ext) || _isNullOrUndefined(ext.initialize)) {\r\n throw Error(validationError);\r\n }\r\n var extPriority = ext.priority;\r\n var identifier = ext.identifier;\r\n if (ext && extPriority) {\r\n if (!_isNullOrUndefined(extPriorities[extPriority])) {\r\n logger.warnToConsole(\"Two extensions have same priority #\" + extPriority + \" - \" + extPriorities[extPriority] + \", \" + identifier);\r\n }\r\n else {\r\n // set a value\r\n extPriorities[extPriority] = identifier;\r\n }\r\n }\r\n // Split extensions to core and channelController\r\n if (!extPriority || extPriority < channelController.priority) {\r\n // Add to core extension that will be managed by BaseCore\r\n coreExtensions.push(ext);\r\n }\r\n else {\r\n // Add all other extensions to be managed by the channel controller\r\n channelExtensions.push(ext);\r\n }\r\n });\r\n // Validation complete\r\n // Add the channelController to the complete extension collection and\r\n // to the end of the core extensions\r\n allExtensions.push(channelController);\r\n coreExtensions.push(channelController);\r\n // Sort the complete set of extensions by priority\r\n allExtensions = sortPlugins(allExtensions);\r\n _this._extensions = allExtensions;\r\n // initialize channel controller first, this will initialize all channel plugins\r\n initializePlugins(new ProcessTelemetryContext([channelController], config, _this), allExtensions);\r\n initializePlugins(new ProcessTelemetryContext(coreExtensions, config, _this), allExtensions);\r\n // Now reset the extensions to just those being managed by Basecore\r\n _this._extensions = coreExtensions;\r\n if (_this.getTransmissionControls().length === 0) {\r\n throw new Error(\"No channels available\");\r\n }\r\n _this._setInit(true);\r\n };\r\n BaseCore.prototype.getTransmissionControls = function () {\r\n return this._channelController.getChannelControls();\r\n };\r\n BaseCore.prototype.track = function (telemetryItem) {\r\n var _this = this;\r\n if (!telemetryItem.iKey) {\r\n // setup default iKey if not passed in\r\n telemetryItem.iKey = _this.config.instrumentationKey;\r\n }\r\n if (!telemetryItem.time) {\r\n // add default timestamp if not passed in\r\n telemetryItem.time = CoreUtils.toISOString(new Date());\r\n }\r\n if (_isNullOrUndefined(telemetryItem.ver)) {\r\n // CommonSchema 4.0\r\n telemetryItem.ver = \"4.0\";\r\n }\r\n if (_this.isInitialized()) {\r\n // Release queue\r\n if (_this._eventQueue.length > 0) {\r\n _arrForEach(_this._eventQueue, function (event) {\r\n _this.getProcessTelContext().processNext(event);\r\n });\r\n _this._eventQueue = [];\r\n }\r\n // Process the telemetry plugin chain\r\n _this.getProcessTelContext().processNext(telemetryItem);\r\n }\r\n else {\r\n // Queue events until all extensions are initialized\r\n _this._eventQueue.push(telemetryItem);\r\n }\r\n };\r\n BaseCore.prototype.getProcessTelContext = function () {\r\n var _this = this;\r\n var extensions = _this._extensions;\r\n var thePlugins = extensions;\r\n // invoke any common telemetry processors before sending through pipeline\r\n if (!extensions || extensions.length === 0) {\r\n // Pass to Channel controller so data is sent to correct channel queues\r\n thePlugins = [_this._channelController];\r\n }\r\n return new ProcessTelemetryContext(thePlugins, _this.config, _this);\r\n };\r\n return BaseCore;\r\n}());\r\nexport { BaseCore };\r\n//# sourceMappingURL=BaseCore.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n/**\r\n * The EventsDiscardedReason enumeration contains a set of values that specify the reason for discarding an event.\r\n */\r\nexport var EventsDiscardedReason = {\r\n /**\r\n * Unknown.\r\n */\r\n Unknown: 0,\r\n /**\r\n * Status set to non-retryable.\r\n */\r\n NonRetryableStatus: 1,\r\n /**\r\n * The event is invalid.\r\n */\r\n InvalidEvent: 2,\r\n /**\r\n * The size of the event is too large.\r\n */\r\n SizeLimitExceeded: 3,\r\n /**\r\n * The server is not accepting events from this instrumentation key.\r\n */\r\n KillSwitch: 4,\r\n /**\r\n * The event queue is full.\r\n */\r\n QueueFull: 5\r\n};\r\n//# sourceMappingURL=EventsDiscardedReason.js.map","import { CoreUtils } from \"./CoreUtils\";\r\n/**\r\n * Class to manage sending notifications to all the listeners.\r\n */\r\nvar NotificationManager = /** @class */ (function () {\r\n function NotificationManager() {\r\n this.listeners = [];\r\n }\r\n /**\r\n * Adds a notification listener.\r\n * @param {INotificationListener} listener - The notification listener to be added.\r\n */\r\n NotificationManager.prototype.addNotificationListener = function (listener) {\r\n this.listeners.push(listener);\r\n };\r\n /**\r\n * Removes all instances of the listener.\r\n * @param {INotificationListener} listener - AWTNotificationListener to remove.\r\n */\r\n NotificationManager.prototype.removeNotificationListener = function (listener) {\r\n var index = CoreUtils.arrIndexOf(this.listeners, listener);\r\n while (index > -1) {\r\n this.listeners.splice(index, 1);\r\n index = CoreUtils.arrIndexOf(this.listeners, listener);\r\n }\r\n };\r\n /**\r\n * Notification for events sent.\r\n * @param {ITelemetryItem[]} events - The array of events that have been sent.\r\n */\r\n NotificationManager.prototype.eventsSent = function (events) {\r\n var _this = this;\r\n var _loop_1 = function (i) {\r\n if (this_1.listeners[i].eventsSent) {\r\n setTimeout(function () { return _this.listeners[i].eventsSent(events); }, 0);\r\n }\r\n };\r\n var this_1 = this;\r\n for (var i = 0; i < this.listeners.length; ++i) {\r\n _loop_1(i);\r\n }\r\n };\r\n /**\r\n * Notification for events being discarded.\r\n * @param {ITelemetryItem[]} events - The array of events that have been discarded by the SDK.\r\n * @param {number} reason - The reason for which the SDK discarded the events. The EventsDiscardedReason\r\n * constant should be used to check the different values.\r\n */\r\n NotificationManager.prototype.eventsDiscarded = function (events, reason) {\r\n var _this = this;\r\n var _loop_2 = function (i) {\r\n if (this_2.listeners[i].eventsDiscarded) {\r\n setTimeout(function () { return _this.listeners[i].eventsDiscarded(events, reason); }, 0);\r\n }\r\n };\r\n var this_2 = this;\r\n for (var i = 0; i < this.listeners.length; ++i) {\r\n _loop_2(i);\r\n }\r\n };\r\n return NotificationManager;\r\n}());\r\nexport { NotificationManager };\r\n//# sourceMappingURL=NotificationManager.js.map","import * as tslib_1 from \"tslib\";\r\nimport { BaseCore } from './BaseCore';\r\nimport { EventsDiscardedReason } from \"../JavaScriptSDK.Enums/EventsDiscardedReason\";\r\nimport { NotificationManager } from \"./NotificationManager\";\r\nimport { CoreUtils } from \"./CoreUtils\";\r\nimport { _InternalLogMessage, DiagnosticLogger } from \"./DiagnosticLogger\";\r\n\"use strict\";\r\nvar AppInsightsCore = /** @class */ (function (_super) {\r\n tslib_1.__extends(AppInsightsCore, _super);\r\n function AppInsightsCore() {\r\n return _super.call(this) || this;\r\n }\r\n AppInsightsCore.prototype.initialize = function (config, extensions) {\r\n var _self = this;\r\n _self._notificationManager = new NotificationManager();\r\n _self.logger = new DiagnosticLogger(config);\r\n _self.config = config;\r\n _super.prototype.initialize.call(this, config, extensions, _self.logger, _self._notificationManager);\r\n };\r\n AppInsightsCore.prototype.getTransmissionControls = function () {\r\n return _super.prototype.getTransmissionControls.call(this);\r\n };\r\n AppInsightsCore.prototype.track = function (telemetryItem) {\r\n if (telemetryItem === null) {\r\n this._notifyInvalidEvent(telemetryItem);\r\n // throw error\r\n throw Error(\"Invalid telemetry item\");\r\n }\r\n // do basic validation before sending it through the pipeline\r\n this._validateTelemetryItem(telemetryItem);\r\n _super.prototype.track.call(this, telemetryItem);\r\n };\r\n /**\r\n * Adds a notification listener. The SDK calls methods on the listener when an appropriate notification is raised.\r\n * The added plugins must raise notifications. If the plugins do not implement the notifications, then no methods will be\r\n * called.\r\n * @param {INotificationListener} listener - An INotificationListener object.\r\n */\r\n AppInsightsCore.prototype.addNotificationListener = function (listener) {\r\n if (this._notificationManager) {\r\n this._notificationManager.addNotificationListener(listener);\r\n }\r\n };\r\n /**\r\n * Removes all instances of the listener.\r\n * @param {INotificationListener} listener - INotificationListener to remove.\r\n */\r\n AppInsightsCore.prototype.removeNotificationListener = function (listener) {\r\n if (this._notificationManager) {\r\n this._notificationManager.removeNotificationListener(listener);\r\n }\r\n };\r\n /**\r\n * Periodically check logger.queue for\r\n */\r\n AppInsightsCore.prototype.pollInternalLogs = function (eventName) {\r\n var _this = this;\r\n var interval = this.config.diagnosticLogInterval;\r\n if (!interval || !(interval > 0)) {\r\n interval = 10000;\r\n }\r\n return setInterval(function () {\r\n var _self = _this;\r\n var queue = _self.logger ? _self.logger.queue : [];\r\n CoreUtils.arrForEach(queue, function (logMessage) {\r\n var item = {\r\n name: eventName ? eventName : \"InternalMessageId: \" + logMessage.messageId,\r\n iKey: _self.config.instrumentationKey,\r\n time: CoreUtils.toISOString(new Date()),\r\n baseType: _InternalLogMessage.dataType,\r\n baseData: { message: logMessage.message }\r\n };\r\n _self.track(item);\r\n });\r\n queue.length = 0;\r\n }, interval);\r\n };\r\n AppInsightsCore.prototype._validateTelemetryItem = function (telemetryItem) {\r\n if (CoreUtils.isNullOrUndefined(telemetryItem.name)) {\r\n this._notifyInvalidEvent(telemetryItem);\r\n throw Error(\"telemetry name required\");\r\n }\r\n };\r\n AppInsightsCore.prototype._notifyInvalidEvent = function (telemetryItem) {\r\n if (this._notificationManager) {\r\n this._notificationManager.eventsDiscarded([telemetryItem], EventsDiscardedReason.InvalidEvent);\r\n }\r\n };\r\n return AppInsightsCore;\r\n}(BaseCore));\r\nexport { AppInsightsCore };\r\n//# sourceMappingURL=AppInsightsCore.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nvar RequestHeaders = /** @class */ (function () {\r\n function RequestHeaders() {\r\n }\r\n /**\r\n * Request-Context header\r\n */\r\n RequestHeaders.requestContextHeader = \"Request-Context\";\r\n /**\r\n * Target instrumentation header that is added to the response and retrieved by the\r\n * calling application when processing incoming responses.\r\n */\r\n RequestHeaders.requestContextTargetKey = \"appId\";\r\n /**\r\n * Request-Context appId format\r\n */\r\n RequestHeaders.requestContextAppIdFormat = \"appId=cid-v1:\";\r\n /**\r\n * Request-Id header\r\n */\r\n RequestHeaders.requestIdHeader = \"Request-Id\";\r\n /**\r\n * W3C distributed tracing protocol header\r\n */\r\n RequestHeaders.traceParentHeader = \"traceparent\";\r\n /**\r\n * Sdk-Context header\r\n * If this header passed with appId in content then appId will be returned back by the backend.\r\n */\r\n RequestHeaders.sdkContextHeader = \"Sdk-Context\";\r\n /**\r\n * String to pass in header for requesting appId back from the backend.\r\n */\r\n RequestHeaders.sdkContextHeaderAppIdRequest = \"appId\";\r\n RequestHeaders.requestContextHeaderLowerCase = \"request-context\";\r\n return RequestHeaders;\r\n}());\r\nexport { RequestHeaders };\r\n//# sourceMappingURL=RequestResponseHeaders.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { LoggingSeverity, _InternalMessageId, CoreUtils, hasJSON, getJSON } from '@microsoft/applicationinsights-core-js';\r\nvar DataSanitizer = /** @class */ (function () {\r\n function DataSanitizer() {\r\n }\r\n DataSanitizer.sanitizeKeyAndAddUniqueness = function (logger, key, map) {\r\n var origLength = key.length;\r\n var field = DataSanitizer.sanitizeKey(logger, key);\r\n // validation truncated the length. We need to add uniqueness\r\n if (field.length !== origLength) {\r\n var i = 0;\r\n var uniqueField = field;\r\n while (map[uniqueField] !== undefined) {\r\n i++;\r\n uniqueField = field.substring(0, DataSanitizer.MAX_NAME_LENGTH - 3) + DataSanitizer.padNumber(i);\r\n }\r\n field = uniqueField;\r\n }\r\n return field;\r\n };\r\n DataSanitizer.sanitizeKey = function (logger, name) {\r\n var nameTrunc;\r\n if (name) {\r\n // Remove any leading or trailing whitepace\r\n name = DataSanitizer.trim(name.toString());\r\n // truncate the string to 150 chars\r\n if (name.length > DataSanitizer.MAX_NAME_LENGTH) {\r\n nameTrunc = name.substring(0, DataSanitizer.MAX_NAME_LENGTH);\r\n logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.NameTooLong, \"name is too long. It has been truncated to \" + DataSanitizer.MAX_NAME_LENGTH + \" characters.\", { name: name }, true);\r\n }\r\n }\r\n return nameTrunc || name;\r\n };\r\n DataSanitizer.sanitizeString = function (logger, value, maxLength) {\r\n if (maxLength === void 0) { maxLength = DataSanitizer.MAX_STRING_LENGTH; }\r\n var valueTrunc;\r\n if (value) {\r\n maxLength = maxLength ? maxLength : DataSanitizer.MAX_STRING_LENGTH; // in case default parameters dont work\r\n value = DataSanitizer.trim(value);\r\n if (value.toString().length > maxLength) {\r\n valueTrunc = value.toString().substring(0, maxLength);\r\n logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.StringValueTooLong, \"string value is too long. It has been truncated to \" + maxLength + \" characters.\", { value: value }, true);\r\n }\r\n }\r\n return valueTrunc || value;\r\n };\r\n DataSanitizer.sanitizeUrl = function (logger, url) {\r\n return DataSanitizer.sanitizeInput(logger, url, DataSanitizer.MAX_URL_LENGTH, _InternalMessageId.UrlTooLong);\r\n };\r\n DataSanitizer.sanitizeMessage = function (logger, message) {\r\n var messageTrunc;\r\n if (message) {\r\n if (message.length > DataSanitizer.MAX_MESSAGE_LENGTH) {\r\n messageTrunc = message.substring(0, DataSanitizer.MAX_MESSAGE_LENGTH);\r\n logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.MessageTruncated, \"message is too long, it has been truncated to \" + DataSanitizer.MAX_MESSAGE_LENGTH + \" characters.\", { message: message }, true);\r\n }\r\n }\r\n return messageTrunc || message;\r\n };\r\n DataSanitizer.sanitizeException = function (logger, exception) {\r\n var exceptionTrunc;\r\n if (exception) {\r\n if (exception.length > DataSanitizer.MAX_EXCEPTION_LENGTH) {\r\n exceptionTrunc = exception.substring(0, DataSanitizer.MAX_EXCEPTION_LENGTH);\r\n logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.ExceptionTruncated, \"exception is too long, it has been truncated to \" + DataSanitizer.MAX_EXCEPTION_LENGTH + \" characters.\", { exception: exception }, true);\r\n }\r\n }\r\n return exceptionTrunc || exception;\r\n };\r\n DataSanitizer.sanitizeProperties = function (logger, properties) {\r\n if (properties) {\r\n var tempProps = {};\r\n for (var prop in properties) {\r\n var value = properties[prop];\r\n if (CoreUtils.isObject(value) && hasJSON()) {\r\n // Stringify any part C properties\r\n try {\r\n value = getJSON().stringify(value);\r\n }\r\n catch (e) {\r\n logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.CannotSerializeObjectNonSerializable, \"custom property is not valid\", { exception: e }, true);\r\n }\r\n }\r\n value = DataSanitizer.sanitizeString(logger, value, DataSanitizer.MAX_PROPERTY_LENGTH);\r\n prop = DataSanitizer.sanitizeKeyAndAddUniqueness(logger, prop, tempProps);\r\n tempProps[prop] = value;\r\n }\r\n properties = tempProps;\r\n }\r\n return properties;\r\n };\r\n DataSanitizer.sanitizeMeasurements = function (logger, measurements) {\r\n if (measurements) {\r\n var tempMeasurements = {};\r\n for (var measure in measurements) {\r\n var value = measurements[measure];\r\n measure = DataSanitizer.sanitizeKeyAndAddUniqueness(logger, measure, tempMeasurements);\r\n tempMeasurements[measure] = value;\r\n }\r\n measurements = tempMeasurements;\r\n }\r\n return measurements;\r\n };\r\n DataSanitizer.sanitizeId = function (logger, id) {\r\n return id ? DataSanitizer.sanitizeInput(logger, id, DataSanitizer.MAX_ID_LENGTH, _InternalMessageId.IdTooLong).toString() : id;\r\n };\r\n DataSanitizer.sanitizeInput = function (logger, input, maxLength, _msgId) {\r\n var inputTrunc;\r\n if (input) {\r\n input = DataSanitizer.trim(input);\r\n if (input.length > maxLength) {\r\n inputTrunc = input.substring(0, maxLength);\r\n logger.throwInternal(LoggingSeverity.WARNING, _msgId, \"input is too long, it has been truncated to \" + maxLength + \" characters.\", { data: input }, true);\r\n }\r\n }\r\n return inputTrunc || input;\r\n };\r\n DataSanitizer.padNumber = function (num) {\r\n var s = \"00\" + num;\r\n return s.substr(s.length - 3);\r\n };\r\n /**\r\n * helper method to trim strings (IE8 does not implement String.prototype.trim)\r\n */\r\n DataSanitizer.trim = function (str) {\r\n if (!CoreUtils.isString(str)) {\r\n return str;\r\n }\r\n return str.replace(/^\\s+|\\s+$/g, \"\");\r\n };\r\n /**\r\n * Max length allowed for custom names.\r\n */\r\n DataSanitizer.MAX_NAME_LENGTH = 150;\r\n /**\r\n * Max length allowed for Id field in page views.\r\n */\r\n DataSanitizer.MAX_ID_LENGTH = 128;\r\n /**\r\n * Max length allowed for custom values.\r\n */\r\n DataSanitizer.MAX_PROPERTY_LENGTH = 8192;\r\n /**\r\n * Max length allowed for names\r\n */\r\n DataSanitizer.MAX_STRING_LENGTH = 1024;\r\n /**\r\n * Max length allowed for url.\r\n */\r\n DataSanitizer.MAX_URL_LENGTH = 2048;\r\n /**\r\n * Max length allowed for messages.\r\n */\r\n DataSanitizer.MAX_MESSAGE_LENGTH = 32768;\r\n /**\r\n * Max length allowed for exceptions.\r\n */\r\n DataSanitizer.MAX_EXCEPTION_LENGTH = 32768;\r\n return DataSanitizer;\r\n}());\r\nexport { DataSanitizer };\r\n//# sourceMappingURL=DataSanitizer.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { StorageType } from \"./Enums\";\r\nimport { CoreUtils, EventHelper, _InternalMessageId, LoggingSeverity, getGlobal, getGlobalInst, getWindow, getDocument, getNavigator, getPerformance, getLocation, hasJSON, getJSON, strPrototype } from \"@microsoft/applicationinsights-core-js\";\r\nimport { RequestHeaders } from \"./RequestResponseHeaders\";\r\nimport { DataSanitizer } from \"./Telemetry/Common/DataSanitizer\";\r\nvar _navigator = getNavigator();\r\nvar _isString = CoreUtils.isString;\r\nvar _uaDisallowsSameSiteNone = null;\r\nfunction _endsWith(value, search) {\r\n var len = value.length;\r\n var start = len - search.length;\r\n return value.substring(start >= 0 ? start : 0, len) === search;\r\n}\r\nvar Util = /** @class */ (function () {\r\n function Util() {\r\n }\r\n Util.createDomEvent = function (eventName) {\r\n var event = null;\r\n if (CoreUtils.isFunction(Event)) {\r\n event = new Event(eventName);\r\n }\r\n else {\r\n var doc = getDocument();\r\n if (doc && doc.createEvent) {\r\n event = doc.createEvent(\"Event\");\r\n event.initEvent(eventName, true, true);\r\n }\r\n }\r\n return event;\r\n };\r\n /*\r\n * Force the SDK not to use local and session storage\r\n */\r\n Util.disableStorage = function () {\r\n Util._canUseLocalStorage = false;\r\n Util._canUseSessionStorage = false;\r\n };\r\n /**\r\n * Gets the localStorage object if available\r\n * @return {Storage} - Returns the storage object if available else returns null\r\n */\r\n Util._getLocalStorageObject = function () {\r\n if (Util.canUseLocalStorage()) {\r\n return Util._getVerifiedStorageObject(StorageType.LocalStorage);\r\n }\r\n return null;\r\n };\r\n /**\r\n * Tests storage object (localStorage or sessionStorage) to verify that it is usable\r\n * More details here: https://mathiasbynens.be/notes/localstorage-pattern\r\n * @param storageType Type of storage\r\n * @return {Storage} Returns storage object verified that it is usable\r\n */\r\n Util._getVerifiedStorageObject = function (storageType) {\r\n var storage = null;\r\n var fail;\r\n var uid;\r\n try {\r\n if (CoreUtils.isNullOrUndefined(getGlobal())) {\r\n return null;\r\n }\r\n uid = new Date;\r\n storage = storageType === StorageType.LocalStorage ? getGlobalInst(\"localStorage\") : getGlobalInst(\"sessionStorage\");\r\n storage.setItem(uid.toString(), uid.toString());\r\n fail = storage.getItem(uid.toString()) !== uid.toString();\r\n storage.removeItem(uid.toString());\r\n if (fail) {\r\n storage = null;\r\n }\r\n }\r\n catch (exception) {\r\n storage = null;\r\n }\r\n return storage;\r\n };\r\n /**\r\n * Checks if endpoint URL is application insights internal injestion service URL.\r\n *\r\n * @param endpointUrl Endpoint URL to check.\r\n * @returns {boolean} True if if endpoint URL is application insights internal injestion service URL.\r\n */\r\n Util.isInternalApplicationInsightsEndpoint = function (endpointUrl) {\r\n return Util._internalEndpoints.indexOf(endpointUrl.toLowerCase()) !== -1;\r\n };\r\n /**\r\n * Check if the browser supports local storage.\r\n *\r\n * @returns {boolean} True if local storage is supported.\r\n */\r\n Util.canUseLocalStorage = function () {\r\n if (Util._canUseLocalStorage === undefined) {\r\n Util._canUseLocalStorage = !!Util._getVerifiedStorageObject(StorageType.LocalStorage);\r\n }\r\n return Util._canUseLocalStorage;\r\n };\r\n /**\r\n * Get an object from the browser's local storage\r\n *\r\n * @param {string} name - the name of the object to get from storage\r\n * @returns {string} The contents of the storage object with the given name. Null if storage is not supported.\r\n */\r\n Util.getStorage = function (logger, name) {\r\n var storage = Util._getLocalStorageObject();\r\n if (storage !== null) {\r\n try {\r\n return storage.getItem(name);\r\n }\r\n catch (e) {\r\n Util._canUseLocalStorage = false;\r\n logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.BrowserCannotReadLocalStorage, \"Browser failed read of local storage. \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n }\r\n return null;\r\n };\r\n /**\r\n * Set the contents of an object in the browser's local storage\r\n *\r\n * @param {string} name - the name of the object to set in storage\r\n * @param {string} data - the contents of the object to set in storage\r\n * @returns {boolean} True if the storage object could be written.\r\n */\r\n Util.setStorage = function (logger, name, data) {\r\n var storage = Util._getLocalStorageObject();\r\n if (storage !== null) {\r\n try {\r\n storage.setItem(name, data);\r\n return true;\r\n }\r\n catch (e) {\r\n Util._canUseLocalStorage = false;\r\n logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.BrowserCannotWriteLocalStorage, \"Browser failed write to local storage. \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n }\r\n return false;\r\n };\r\n /**\r\n * Remove an object from the browser's local storage\r\n *\r\n * @param {string} name - the name of the object to remove from storage\r\n * @returns {boolean} True if the storage object could be removed.\r\n */\r\n Util.removeStorage = function (logger, name) {\r\n var storage = Util._getLocalStorageObject();\r\n if (storage !== null) {\r\n try {\r\n storage.removeItem(name);\r\n return true;\r\n }\r\n catch (e) {\r\n Util._canUseLocalStorage = false;\r\n logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.BrowserFailedRemovalFromLocalStorage, \"Browser failed removal of local storage item. \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n }\r\n return false;\r\n };\r\n /**\r\n * Gets the sessionStorage object if available\r\n * @return {Storage} - Returns the storage object if available else returns null\r\n */\r\n Util._getSessionStorageObject = function () {\r\n if (Util.canUseSessionStorage()) {\r\n return Util._getVerifiedStorageObject(StorageType.SessionStorage);\r\n }\r\n return null;\r\n };\r\n /**\r\n * Check if the browser supports session storage.\r\n *\r\n * @returns {boolean} True if session storage is supported.\r\n */\r\n Util.canUseSessionStorage = function () {\r\n if (Util._canUseSessionStorage === undefined) {\r\n Util._canUseSessionStorage = !!Util._getVerifiedStorageObject(StorageType.SessionStorage);\r\n }\r\n return Util._canUseSessionStorage;\r\n };\r\n /**\r\n * Gets the list of session storage keys\r\n *\r\n * @returns {string[]} List of session storage keys\r\n */\r\n Util.getSessionStorageKeys = function () {\r\n var keys = [];\r\n if (Util.canUseSessionStorage()) {\r\n for (var key in getGlobalInst(\"sessionStorage\")) {\r\n keys.push(key);\r\n }\r\n }\r\n return keys;\r\n };\r\n /**\r\n * Get an object from the browser's session storage\r\n *\r\n * @param {string} name - the name of the object to get from storage\r\n * @returns {string} The contents of the storage object with the given name. Null if storage is not supported.\r\n */\r\n Util.getSessionStorage = function (logger, name) {\r\n var storage = Util._getSessionStorageObject();\r\n if (storage !== null) {\r\n try {\r\n return storage.getItem(name);\r\n }\r\n catch (e) {\r\n Util._canUseSessionStorage = false;\r\n logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.BrowserCannotReadSessionStorage, \"Browser failed read of session storage. \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n }\r\n return null;\r\n };\r\n /**\r\n * Set the contents of an object in the browser's session storage\r\n *\r\n * @param {string} name - the name of the object to set in storage\r\n * @param {string} data - the contents of the object to set in storage\r\n * @returns {boolean} True if the storage object could be written.\r\n */\r\n Util.setSessionStorage = function (logger, name, data) {\r\n var storage = Util._getSessionStorageObject();\r\n if (storage !== null) {\r\n try {\r\n storage.setItem(name, data);\r\n return true;\r\n }\r\n catch (e) {\r\n Util._canUseSessionStorage = false;\r\n logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.BrowserCannotWriteSessionStorage, \"Browser failed write to session storage. \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n }\r\n return false;\r\n };\r\n /**\r\n * Remove an object from the browser's session storage\r\n *\r\n * @param {string} name - the name of the object to remove from storage\r\n * @returns {boolean} True if the storage object could be removed.\r\n */\r\n Util.removeSessionStorage = function (logger, name) {\r\n var storage = Util._getSessionStorageObject();\r\n if (storage !== null) {\r\n try {\r\n storage.removeItem(name);\r\n return true;\r\n }\r\n catch (e) {\r\n Util._canUseSessionStorage = false;\r\n logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.BrowserFailedRemovalFromSessionStorage, \"Browser failed removal of session storage item. \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n }\r\n return false;\r\n };\r\n /*\r\n * Force the SDK not to store and read any data from cookies\r\n */\r\n Util.disableCookies = function () {\r\n CoreUtils.disableCookies();\r\n };\r\n /*\r\n * helper method to tell if document.cookie object is available\r\n */\r\n Util.canUseCookies = function (logger) {\r\n if (CoreUtils._canUseCookies === undefined) {\r\n CoreUtils._canUseCookies = false;\r\n try {\r\n CoreUtils._canUseCookies = Util.document.cookie !== undefined;\r\n }\r\n catch (e) {\r\n logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.CannotAccessCookie, \"Cannot access document.cookie - \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n ;\r\n }\r\n return CoreUtils._canUseCookies;\r\n };\r\n Util.disallowsSameSiteNone = function (userAgent) {\r\n if (!_isString(userAgent)) {\r\n return false;\r\n }\r\n // Cover all iOS based browsers here. This includes:\r\n // - Safari on iOS 12 for iPhone, iPod Touch, iPad\r\n // - WkWebview on iOS 12 for iPhone, iPod Touch, iPad\r\n // - Chrome on iOS 12 for iPhone, iPod Touch, iPad\r\n // All of which are broken by SameSite=None, because they use the iOS networking stack\r\n if (userAgent.indexOf(\"CPU iPhone OS 12\") !== -1 || userAgent.indexOf(\"iPad; CPU OS 12\") !== -1) {\r\n return true;\r\n }\r\n // Cover Mac OS X based browsers that use the Mac OS networking stack. This includes:\r\n // - Safari on Mac OS X\r\n // This does not include:\r\n // - Internal browser on Mac OS X\r\n // - Chrome on Mac OS X\r\n // - Chromium on Mac OS X\r\n // Because they do not use the Mac OS networking stack.\r\n if (userAgent.indexOf(\"Macintosh; Intel Mac OS X 10_14\") !== -1 && userAgent.indexOf(\"Version/\") !== -1 && userAgent.indexOf(\"Safari\") !== -1) {\r\n return true;\r\n }\r\n // Cover Mac OS X internal browsers that use the Mac OS networking stack. This includes:\r\n // - Internal browser on Mac OS X\r\n // This does not include:\r\n // - Safari on Mac OS X\r\n // - Chrome on Mac OS X\r\n // - Chromium on Mac OS X\r\n // Because they do not use the Mac OS networking stack.\r\n if (userAgent.indexOf(\"Macintosh; Intel Mac OS X 10_14\") !== -1 && _endsWith(userAgent, \"AppleWebKit/605.1.15 (KHTML, like Gecko)\")) {\r\n return true;\r\n }\r\n // Cover Chrome 50-69, because some versions are broken by SameSite=None, and none in this range require it.\r\n // Note: this covers some pre-Chromium Edge versions, but pre-Chromim Edge does not require SameSite=None, so this is fine.\r\n // Note: this regex applies to Windows, Mac OS X, and Linux, deliberately.\r\n if (userAgent.indexOf(\"Chrome/5\") !== -1 || userAgent.indexOf(\"Chrome/6\") !== -1) {\r\n return true;\r\n }\r\n // Unreal Engine runs Chromium 59, but does not advertise as Chrome until 4.23. Treat versions of Unreal\r\n // that don't specify their Chrome version as lacking support for SameSite=None.\r\n if (userAgent.indexOf(\"UnrealEngine\") !== -1 && userAgent.indexOf(\"Chrome\") === -1) {\r\n return true;\r\n }\r\n // UCBrowser < 12.13.2 ignores Set-Cookie headers with SameSite=None\r\n // NB: this rule isn't complete - you need regex to make a complete rule.\r\n // See: https://www.chromium.org/updates/same-site/incompatible-clients\r\n if (userAgent.indexOf(\"UCBrowser/12\") !== -1 || userAgent.indexOf(\"UCBrowser/11\") !== -1) {\r\n return true;\r\n }\r\n return false;\r\n };\r\n /**\r\n * helper method to set userId and sessionId cookie\r\n */\r\n Util.setCookie = function (logger, name, value, domain) {\r\n if (Util.canUseCookies(logger)) {\r\n var domainAttrib = \"\";\r\n var secureAttrib = \"\";\r\n if (domain) {\r\n domainAttrib = \";domain=\" + domain;\r\n }\r\n var location_1 = getLocation();\r\n if (location_1 && location_1.protocol === \"https:\") {\r\n secureAttrib = \";secure\";\r\n if (_uaDisallowsSameSiteNone === null) {\r\n _uaDisallowsSameSiteNone = Util.disallowsSameSiteNone((getNavigator() || {}).userAgent);\r\n }\r\n if (!_uaDisallowsSameSiteNone) {\r\n value = value + \";SameSite=None\"; // SameSite can only be set on secure pages\r\n }\r\n }\r\n Util.document.cookie = name + \"=\" + value + domainAttrib + \";path=/\" + secureAttrib;\r\n }\r\n };\r\n Util.stringToBoolOrDefault = function (str, defaultValue) {\r\n if (defaultValue === void 0) { defaultValue = false; }\r\n if (str === undefined || str === null) {\r\n return defaultValue;\r\n }\r\n return str.toString().toLowerCase() === \"true\";\r\n };\r\n /**\r\n * helper method to access userId and sessionId cookie\r\n */\r\n Util.getCookie = function (logger, name) {\r\n if (!Util.canUseCookies(logger)) {\r\n return;\r\n }\r\n var value = \"\";\r\n if (name && name.length) {\r\n var cookieName = name + \"=\";\r\n var cookies = Util.document.cookie.split(\";\");\r\n for (var i = 0; i < cookies.length; i++) {\r\n var cookie = cookies[i];\r\n cookie = Util.trim(cookie);\r\n if (cookie && cookie.indexOf(cookieName) === 0) {\r\n value = cookie.substring(cookieName.length, cookies[i].length);\r\n break;\r\n }\r\n }\r\n }\r\n return value;\r\n };\r\n /**\r\n * Deletes a cookie by setting it's expiration time in the past.\r\n * @param name - The name of the cookie to delete.\r\n */\r\n Util.deleteCookie = function (logger, name) {\r\n if (Util.canUseCookies(logger)) {\r\n // Setting the expiration date in the past immediately removes the cookie\r\n Util.document.cookie = name + \"=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;\";\r\n }\r\n };\r\n /**\r\n * helper method to trim strings (IE8 does not implement String.prototype.trim)\r\n */\r\n Util.trim = function (str) {\r\n if (!_isString(str)) {\r\n return str;\r\n }\r\n return str.replace(/^\\s+|\\s+$/g, \"\");\r\n };\r\n /**\r\n * generate random id string\r\n */\r\n Util.newId = function () {\r\n var base64chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\r\n var result = \"\";\r\n // tslint:disable-next-line:insecure-random\r\n var random = Math.random() * 1073741824; // 5 symbols in base64, almost maxint\r\n while (random > 0) {\r\n var char = base64chars.charAt(random % 64);\r\n result += char;\r\n random = Math.floor(random / 64);\r\n }\r\n return result;\r\n };\r\n /**\r\n * generate a random 32bit number (-0x80000000..0x7FFFFFFF).\r\n */\r\n Util.random32 = function () {\r\n return (0x100000000 * Math.random()) | 0;\r\n };\r\n /**\r\n * generate W3C trace id\r\n */\r\n Util.generateW3CId = function () {\r\n var hexValues = [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"a\", \"b\", \"c\", \"d\", \"e\", \"f\"];\r\n // rfc4122 version 4 UUID without dashes and with lowercase letters\r\n var oct = \"\", tmp;\r\n for (var a = 0; a < 4; a++) {\r\n tmp = Util.random32();\r\n oct +=\r\n hexValues[tmp & 0xF] +\r\n hexValues[tmp >> 4 & 0xF] +\r\n hexValues[tmp >> 8 & 0xF] +\r\n hexValues[tmp >> 12 & 0xF] +\r\n hexValues[tmp >> 16 & 0xF] +\r\n hexValues[tmp >> 20 & 0xF] +\r\n hexValues[tmp >> 24 & 0xF] +\r\n hexValues[tmp >> 28 & 0xF];\r\n }\r\n // \"Set the two most significant bits (bits 6 and 7) of the clock_seq_hi_and_reserved to zero and one, respectively\"\r\n var clockSequenceHi = hexValues[8 + (Math.random() * 4) | 0];\r\n return oct.substr(0, 8) + oct.substr(9, 4) + \"4\" + oct.substr(13, 3) + clockSequenceHi + oct.substr(16, 3) + oct.substr(19, 12);\r\n };\r\n /**\r\n * Check if an object is of type Array\r\n */\r\n Util.isArray = function (obj) {\r\n return Object[strPrototype].toString.call(obj) === \"[object Array]\";\r\n };\r\n /**\r\n * Check if an object is of type Error\r\n */\r\n Util.isError = function (obj) {\r\n return Object[strPrototype].toString.call(obj) === \"[object Error]\";\r\n };\r\n /**\r\n * Gets IE version if we are running on IE, or null otherwise\r\n */\r\n Util.getIEVersion = function (userAgentStr) {\r\n if (userAgentStr === void 0) { userAgentStr = null; }\r\n var myNav = userAgentStr ? userAgentStr.toLowerCase() : (_navigator ? (_navigator.userAgent || \"\").toLowerCase() : \"\");\r\n return (myNav.indexOf('msie') !== -1) ? parseInt(myNav.split('msie')[1]) : null;\r\n };\r\n /**\r\n * Convert ms to c# time span format\r\n */\r\n Util.msToTimeSpan = function (totalms) {\r\n if (isNaN(totalms) || totalms < 0) {\r\n totalms = 0;\r\n }\r\n totalms = Math.round(totalms);\r\n var ms = \"\" + totalms % 1000;\r\n var sec = \"\" + Math.floor(totalms / 1000) % 60;\r\n var min = \"\" + Math.floor(totalms / (1000 * 60)) % 60;\r\n var hour = \"\" + Math.floor(totalms / (1000 * 60 * 60)) % 24;\r\n var days = Math.floor(totalms / (1000 * 60 * 60 * 24));\r\n ms = ms.length === 1 ? \"00\" + ms : ms.length === 2 ? \"0\" + ms : ms;\r\n sec = sec.length < 2 ? \"0\" + sec : sec;\r\n min = min.length < 2 ? \"0\" + min : min;\r\n hour = hour.length < 2 ? \"0\" + hour : hour;\r\n return (days > 0 ? days + \".\" : \"\") + hour + \":\" + min + \":\" + sec + \".\" + ms;\r\n };\r\n /**\r\n * Checks if error has no meaningful data inside. Ususally such errors are received by window.onerror when error\r\n * happens in a script from other domain (cross origin, CORS).\r\n */\r\n Util.isCrossOriginError = function (message, url, lineNumber, columnNumber, error) {\r\n return (message === \"Script error.\" || message === \"Script error\") && !error;\r\n };\r\n /**\r\n * Returns string representation of an object suitable for diagnostics logging.\r\n */\r\n Util.dump = function (object) {\r\n var objectTypeDump = Object[strPrototype].toString.call(object);\r\n var propertyValueDump = \"\";\r\n if (objectTypeDump === \"[object Error]\") {\r\n propertyValueDump = \"{ stack: '\" + object.stack + \"', message: '\" + object.message + \"', name: '\" + object.name + \"'\";\r\n }\r\n else if (hasJSON()) {\r\n propertyValueDump = getJSON().stringify(object);\r\n }\r\n return objectTypeDump + propertyValueDump;\r\n };\r\n /**\r\n * Returns the name of object if it's an Error. Otherwise, returns empty string.\r\n */\r\n Util.getExceptionName = function (object) {\r\n var objectTypeDump = Object[strPrototype].toString.call(object);\r\n if (objectTypeDump === \"[object Error]\") {\r\n return object.name;\r\n }\r\n return \"\";\r\n };\r\n /**\r\n * Adds an event handler for the specified event to the window\r\n * @param eventName {string} - The name of the event\r\n * @param callback {any} - The callback function that needs to be executed for the given event\r\n * @return {boolean} - true if the handler was successfully added\r\n */\r\n Util.addEventHandler = function (eventName, callback) {\r\n return EventHelper.Attach(getWindow(), eventName, callback);\r\n };\r\n /**\r\n * Tells if a browser supports a Beacon API\r\n */\r\n Util.IsBeaconApiSupported = function () {\r\n return ('sendBeacon' in _navigator && _navigator.sendBeacon);\r\n };\r\n Util.getExtension = function (extensions, identifier) {\r\n var extension = null;\r\n var extIx = 0;\r\n while (!extension && extIx < extensions.length) {\r\n if (extensions[extIx] && extensions[extIx].identifier === identifier) {\r\n extension = extensions[extIx];\r\n }\r\n extIx++;\r\n }\r\n return extension;\r\n };\r\n Util.document = getDocument() || {};\r\n Util._canUseLocalStorage = undefined;\r\n Util._canUseSessionStorage = undefined;\r\n // listing only non-geo specific locations\r\n Util._internalEndpoints = [\r\n \"https://dc.services.visualstudio.com/v2/track\",\r\n \"https://breeze.aimon.applicationinsights.io/v2/track\",\r\n \"https://dc-int.services.visualstudio.com/v2/track\"\r\n ];\r\n Util.NotSpecified = \"not_specified\";\r\n /**\r\n * Check if an object is of type Date\r\n */\r\n Util.isDate = CoreUtils.isDate;\r\n // Keeping this name for backward compatibility (for now)\r\n Util.toISOStringForIE8 = CoreUtils.toISOString;\r\n return Util;\r\n}());\r\nexport { Util };\r\nvar UrlHelper = /** @class */ (function () {\r\n function UrlHelper() {\r\n }\r\n UrlHelper.parseUrl = function (url) {\r\n if (!UrlHelper.htmlAnchorElement) {\r\n UrlHelper.htmlAnchorElement = !!UrlHelper.document.createElement ? UrlHelper.document.createElement('a') : { host: UrlHelper.parseHost(url) }; // fill host field in the fallback case as that is the only externally required field from this fn\r\n }\r\n UrlHelper.htmlAnchorElement.href = url;\r\n return UrlHelper.htmlAnchorElement;\r\n };\r\n UrlHelper.getAbsoluteUrl = function (url) {\r\n var result;\r\n var a = UrlHelper.parseUrl(url);\r\n if (a) {\r\n result = a.href;\r\n }\r\n return result;\r\n };\r\n UrlHelper.getPathName = function (url) {\r\n var result;\r\n var a = UrlHelper.parseUrl(url);\r\n if (a) {\r\n result = a.pathname;\r\n }\r\n return result;\r\n };\r\n UrlHelper.getCompleteUrl = function (method, absoluteUrl) {\r\n if (method) {\r\n return method.toUpperCase() + \" \" + absoluteUrl;\r\n }\r\n else {\r\n return absoluteUrl;\r\n }\r\n };\r\n // Fallback method to grab host from url if document.createElement method is not available\r\n UrlHelper.parseHost = function (url) {\r\n if (url) {\r\n var match = url.match(/:\\/\\/(www[0-9]?\\.)?(.[^/:]+)/i);\r\n if (match != null && match.length > 2 && _isString(match[2]) && match[2].length > 0) {\r\n return match[2];\r\n }\r\n }\r\n return null;\r\n };\r\n UrlHelper.document = getDocument() || {};\r\n return UrlHelper;\r\n}());\r\nexport { UrlHelper };\r\nvar CorrelationIdHelper = /** @class */ (function () {\r\n function CorrelationIdHelper() {\r\n }\r\n /**\r\n * Checks if a request url is not on a excluded domain list and if it is safe to add correlation headers.\r\n * Headers are always included if the current domain matches the request domain. If they do not match (CORS),\r\n * they are regexed across correlationHeaderDomains and correlationHeaderExcludedDomains to determine if headers are included.\r\n * Some environments don't give information on currentHost via window.location.host (e.g. Cordova). In these cases, the user must\r\n * manually supply domains to include correlation headers on. Else, no headers will be included at all.\r\n */\r\n CorrelationIdHelper.canIncludeCorrelationHeader = function (config, requestUrl, currentHost) {\r\n if (config && config.disableCorrelationHeaders) {\r\n return false;\r\n }\r\n if (!requestUrl) {\r\n return false;\r\n }\r\n var requestHost = UrlHelper.parseUrl(requestUrl).host.toLowerCase();\r\n if ((!config || !config.enableCorsCorrelation) && requestHost !== currentHost) {\r\n return false;\r\n }\r\n var includedDomains = config && config.correlationHeaderDomains;\r\n if (includedDomains) {\r\n var matchExists_1;\r\n CoreUtils.arrForEach(includedDomains, function (domain) {\r\n var regex = new RegExp(domain.toLowerCase().replace(/\\./g, \"\\.\").replace(/\\*/g, \".*\"));\r\n matchExists_1 = matchExists_1 || regex.test(requestHost);\r\n });\r\n if (!matchExists_1) {\r\n return false;\r\n }\r\n }\r\n var excludedDomains = config && config.correlationHeaderExcludedDomains;\r\n if (!excludedDomains || excludedDomains.length === 0) {\r\n return true;\r\n }\r\n for (var i = 0; i < excludedDomains.length; i++) {\r\n var regex = new RegExp(excludedDomains[i].toLowerCase().replace(/\\./g, \"\\.\").replace(/\\*/g, \".*\"));\r\n if (regex.test(requestHost)) {\r\n return false;\r\n }\r\n }\r\n // if we don't know anything about the requestHost, require the user to use included/excludedDomains.\r\n // Previously we always returned false for a falsy requestHost\r\n return requestHost && requestHost.length > 0;\r\n };\r\n /**\r\n * Combines target appId and target role name from response header.\r\n */\r\n CorrelationIdHelper.getCorrelationContext = function (responseHeader) {\r\n if (responseHeader) {\r\n var correlationId = CorrelationIdHelper.getCorrelationContextValue(responseHeader, RequestHeaders.requestContextTargetKey);\r\n if (correlationId && correlationId !== CorrelationIdHelper.correlationIdPrefix) {\r\n return correlationId;\r\n }\r\n }\r\n };\r\n /**\r\n * Gets key from correlation response header\r\n */\r\n CorrelationIdHelper.getCorrelationContextValue = function (responseHeader, key) {\r\n if (responseHeader) {\r\n var keyValues = responseHeader.split(\",\");\r\n for (var i = 0; i < keyValues.length; ++i) {\r\n var keyValue = keyValues[i].split(\"=\");\r\n if (keyValue.length === 2 && keyValue[0] === key) {\r\n return keyValue[1];\r\n }\r\n }\r\n }\r\n };\r\n CorrelationIdHelper.correlationIdPrefix = \"cid-v1:\";\r\n return CorrelationIdHelper;\r\n}());\r\nexport { CorrelationIdHelper };\r\nvar AjaxHelper = /** @class */ (function () {\r\n function AjaxHelper() {\r\n }\r\n AjaxHelper.ParseDependencyPath = function (logger, absoluteUrl, method, commandName) {\r\n var target, name = commandName, data = commandName;\r\n if (absoluteUrl && absoluteUrl.length > 0) {\r\n var parsedUrl = UrlHelper.parseUrl(absoluteUrl);\r\n target = parsedUrl.host;\r\n if (!name) {\r\n if (parsedUrl.pathname != null) {\r\n var pathName = (parsedUrl.pathname.length === 0) ? \"/\" : parsedUrl.pathname;\r\n if (pathName.charAt(0) !== '/') {\r\n pathName = \"/\" + pathName;\r\n }\r\n data = parsedUrl.pathname;\r\n name = DataSanitizer.sanitizeString(logger, method ? method + \" \" + pathName : pathName);\r\n }\r\n else {\r\n name = DataSanitizer.sanitizeString(logger, absoluteUrl);\r\n }\r\n }\r\n }\r\n else {\r\n target = commandName;\r\n name = commandName;\r\n }\r\n return {\r\n target: target,\r\n name: name,\r\n data: data\r\n };\r\n };\r\n return AjaxHelper;\r\n}());\r\nexport { AjaxHelper };\r\n/**\r\n * A utility class that helps getting time related parameters\r\n */\r\nvar DateTimeUtils = /** @class */ (function () {\r\n function DateTimeUtils() {\r\n }\r\n /**\r\n * Get the number of milliseconds since 1970/01/01 in local timezone\r\n */\r\n DateTimeUtils.Now = function () {\r\n // returns the window or webworker performance object\r\n var perf = getPerformance();\r\n if (perf && perf.now && perf.timing) {\r\n return perf.now() + perf.timing.navigationStart;\r\n }\r\n return new Date().getTime();\r\n };\r\n /**\r\n * Gets duration between two timestamps\r\n */\r\n DateTimeUtils.GetDuration = function (start, end) {\r\n var result = null;\r\n if (start !== 0 && end !== 0 && !CoreUtils.isNullOrUndefined(start) && !CoreUtils.isNullOrUndefined(end)) {\r\n result = end - start;\r\n }\r\n return result;\r\n };\r\n return DateTimeUtils;\r\n}());\r\nexport { DateTimeUtils };\r\n//# sourceMappingURL=Util.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n// THIS FILE WAS AUTOGENERATED\r\n/**\r\n * Type of the metric data measurement.\r\n */\r\nexport var DataPointType;\r\n(function (DataPointType) {\r\n DataPointType[DataPointType[\"Measurement\"] = 0] = \"Measurement\";\r\n DataPointType[DataPointType[\"Aggregation\"] = 1] = \"Aggregation\";\r\n})(DataPointType || (DataPointType = {}));\r\n//# sourceMappingURL=DataPointType.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n/**\r\n * This is an internal property used to cause internal (reporting) requests to be ignored from reporting\r\n * additional telemetry, to handle polyfil implementations ALL urls used with a disabled request will\r\n * also be ignored for future requests even when this property is not provided.\r\n * Tagging as Ignore as this is an internal value and is not expected to be used outside of the SDK\r\n * @ignore\r\n */\r\nexport var DisabledPropertyName = \"Microsoft_ApplicationInsights_BypassAjaxInstrumentation\";\r\nexport var SampleRate = \"sampleRate\";\r\nexport var ProcessLegacy = \"ProcessLegacy\";\r\nexport var HttpMethod = \"http.method\";\r\nexport var DEFAULT_BREEZE_ENDPOINT = \"https://dc.services.visualstudio.com\";\r\n//# sourceMappingURL=Constants.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { DEFAULT_BREEZE_ENDPOINT } from \"./Constants\";\r\nimport { CoreUtils } from \"@microsoft/applicationinsights-core-js\";\r\nvar ConnectionStringParser = /** @class */ (function () {\r\n function ConnectionStringParser() {\r\n }\r\n ConnectionStringParser.parse = function (connectionString) {\r\n if (!connectionString) {\r\n return {};\r\n }\r\n var kvPairs = connectionString.split(ConnectionStringParser._FIELDS_SEPARATOR);\r\n var result = CoreUtils.arrReduce(kvPairs, function (fields, kv) {\r\n var kvParts = kv.split(ConnectionStringParser._FIELD_KEY_VALUE_SEPARATOR);\r\n if (kvParts.length === 2) {\r\n var key = kvParts[0].toLowerCase();\r\n var value = kvParts[1];\r\n fields[key] = value;\r\n }\r\n return fields;\r\n }, {});\r\n if (CoreUtils.objKeys(result).length > 0) {\r\n // this is a valid connection string, so parse the results\r\n if (result.endpointsuffix) {\r\n // use endpoint suffix where overrides are not provided\r\n var locationPrefix = result.location ? result.location + \".\" : \"\";\r\n result.ingestionendpoint = result.ingestionendpoint || (\"https://\" + locationPrefix + \"dc.\" + result.endpointsuffix);\r\n }\r\n // apply the default endpoints\r\n result.ingestionendpoint = result.ingestionendpoint || DEFAULT_BREEZE_ENDPOINT;\r\n }\r\n return result;\r\n };\r\n ConnectionStringParser._FIELDS_SEPARATOR = \";\";\r\n ConnectionStringParser._FIELD_KEY_VALUE_SEPARATOR = \"=\";\r\n return ConnectionStringParser;\r\n}());\r\nexport { ConnectionStringParser };\r\n//# sourceMappingURL=ConnectionStringParser.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n// THIS FILE WAS AUTOGENERATED\r\n/**\r\n * Data struct to contain only C section with custom fields.\r\n */\r\nvar Base = /** @class */ (function () {\r\n function Base() {\r\n }\r\n return Base;\r\n}());\r\nexport { Base };\r\n//# sourceMappingURL=Base.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport * as tslib_1 from \"tslib\";\r\n// THIS FILE WAS AUTOGENERATED\r\nimport { Base } from './Base';\r\n/**\r\n * Data struct to contain both B and C sections.\r\n */\r\nvar Data = /** @class */ (function (_super) {\r\n tslib_1.__extends(Data, _super);\r\n function Data() {\r\n return _super.call(this) || this;\r\n }\r\n return Data;\r\n}(Base));\r\nexport { Data };\r\n//# sourceMappingURL=Data.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport * as tslib_1 from \"tslib\";\r\nimport { Envelope as AIEnvelope } from '../../Interfaces/Contracts/Generated/Envelope';\r\nimport { DataSanitizer } from './DataSanitizer';\r\nimport { FieldType } from '../../Enums';\r\nimport { Util } from '../../Util';\r\nimport { CoreUtils } from '@microsoft/applicationinsights-core-js';\r\nvar Envelope = /** @class */ (function (_super) {\r\n tslib_1.__extends(Envelope, _super);\r\n /**\r\n * Constructs a new instance of telemetry data.\r\n */\r\n function Envelope(logger, data, name) {\r\n var _this = _super.call(this) || this;\r\n _this.name = DataSanitizer.sanitizeString(logger, name) || Util.NotSpecified;\r\n _this.data = data;\r\n _this.time = CoreUtils.toISOString(new Date());\r\n _this.aiDataContract = {\r\n time: FieldType.Required,\r\n iKey: FieldType.Required,\r\n name: FieldType.Required,\r\n sampleRate: function () {\r\n return (_this.sampleRate === 100) ? FieldType.Hidden : FieldType.Required;\r\n },\r\n tags: FieldType.Required,\r\n data: FieldType.Required\r\n };\r\n return _this;\r\n }\r\n return Envelope;\r\n}(AIEnvelope));\r\nexport { Envelope };\r\n//# sourceMappingURL=Envelope.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n/**\r\n * System variables for a telemetry item.\r\n */\r\nvar Envelope = /** @class */ (function () {\r\n function Envelope() {\r\n this.ver = 1;\r\n this.sampleRate = 100.0;\r\n this.tags = {};\r\n }\r\n return Envelope;\r\n}());\r\nexport { Envelope };\r\n//# sourceMappingURL=Envelope.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n// THIS FILE WAS AUTOGENERATED\r\n/**\r\n * The abstract common base of all domains.\r\n */\r\nvar Domain = /** @class */ (function () {\r\n function Domain() {\r\n }\r\n return Domain;\r\n}());\r\nexport { Domain };\r\n//# sourceMappingURL=Domain.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport * as tslib_1 from \"tslib\";\r\n// THIS FILE WAS AUTOGENERATED\r\nimport { Domain } from './Domain';\r\n/**\r\n * Instances of Event represent structured event records that can be grouped and searched by their properties. Event data item also creates a metric of event count by name.\r\n */\r\nvar EventData = /** @class */ (function (_super) {\r\n tslib_1.__extends(EventData, _super);\r\n function EventData() {\r\n var _this = _super.call(this) || this;\r\n _this.ver = 2;\r\n _this.properties = {};\r\n _this.measurements = {};\r\n return _this;\r\n }\r\n return EventData;\r\n}(Domain));\r\nexport { EventData };\r\n//# sourceMappingURL=EventData.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport * as tslib_1 from \"tslib\";\r\nimport { EventData } from '../Interfaces/Contracts/Generated/EventData';\r\nimport { DataSanitizer } from './Common/DataSanitizer';\r\nimport { FieldType } from '../Enums';\r\nimport { Util } from '../Util';\r\nvar Event = /** @class */ (function (_super) {\r\n tslib_1.__extends(Event, _super);\r\n /**\r\n * Constructs a new instance of the EventTelemetry object\r\n */\r\n function Event(logger, name, properties, measurements) {\r\n var _this = _super.call(this) || this;\r\n _this.aiDataContract = {\r\n ver: FieldType.Required,\r\n name: FieldType.Required,\r\n properties: FieldType.Default,\r\n measurements: FieldType.Default\r\n };\r\n _this.name = DataSanitizer.sanitizeString(logger, name) || Util.NotSpecified;\r\n _this.properties = DataSanitizer.sanitizeProperties(logger, properties);\r\n _this.measurements = DataSanitizer.sanitizeMeasurements(logger, measurements);\r\n return _this;\r\n }\r\n Event.envelopeType = \"Microsoft.ApplicationInsights.{0}.Event\";\r\n Event.dataType = \"EventData\";\r\n return Event;\r\n}(EventData));\r\nexport { Event };\r\n//# sourceMappingURL=Event.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n// THIS FILE WAS AUTOGENERATED\r\n/**\r\n * Stack frame information.\r\n */\r\nvar StackFrame = /** @class */ (function () {\r\n function StackFrame() {\r\n }\r\n return StackFrame;\r\n}());\r\nexport { StackFrame };\r\n//# sourceMappingURL=StackFrame.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n/**\r\n * Exception details of the exception in a chain.\r\n */\r\nvar ExceptionDetails = /** @class */ (function () {\r\n function ExceptionDetails() {\r\n this.hasFullStack = true;\r\n this.parsedStack = [];\r\n }\r\n return ExceptionDetails;\r\n}());\r\nexport { ExceptionDetails };\r\n//# sourceMappingURL=ExceptionDetails.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport * as tslib_1 from \"tslib\";\r\nimport { StackFrame } from '../Interfaces/Contracts/Generated/StackFrame';\r\nimport { ExceptionData } from '../Interfaces/Contracts/Generated/ExceptionData';\r\nimport { ExceptionDetails } from '../Interfaces/Contracts/Generated/ExceptionDetails';\r\nimport { DataSanitizer } from './Common/DataSanitizer';\r\nimport { FieldType } from '../Enums';\r\nimport { Util } from '../Util';\r\nimport { CoreUtils } from '@microsoft/applicationinsights-core-js';\r\nvar Exception = /** @class */ (function (_super) {\r\n tslib_1.__extends(Exception, _super);\r\n /**\r\n * Constructs a new instance of the ExceptionTelemetry object\r\n */\r\n function Exception(logger, exception, properties, measurements, severityLevel, id) {\r\n var _this = _super.call(this) || this;\r\n _this.aiDataContract = {\r\n ver: FieldType.Required,\r\n exceptions: FieldType.Required,\r\n severityLevel: FieldType.Default,\r\n properties: FieldType.Default,\r\n measurements: FieldType.Default\r\n };\r\n if (exception instanceof Error) {\r\n _this.exceptions = [new _ExceptionDetails(logger, exception)];\r\n _this.properties = DataSanitizer.sanitizeProperties(logger, properties);\r\n _this.measurements = DataSanitizer.sanitizeMeasurements(logger, measurements);\r\n if (severityLevel) {\r\n _this.severityLevel = severityLevel;\r\n }\r\n if (id) {\r\n _this.id = id;\r\n }\r\n }\r\n else {\r\n _this.exceptions = exception.exceptions;\r\n _this.properties = exception.properties;\r\n _this.measurements = exception.measurements;\r\n if (exception.severityLevel) {\r\n _this.severityLevel = exception.severityLevel;\r\n }\r\n if (exception.id) {\r\n _this.id = exception.id;\r\n }\r\n if (exception.problemGroup) {\r\n _this.problemGroup = exception.problemGroup;\r\n }\r\n // bool/int types, use isNullOrUndefined\r\n _this.ver = 2; // TODO: handle the CS\"4.0\" ==> breeze 2 conversion in a better way\r\n if (!CoreUtils.isNullOrUndefined(exception.isManual)) {\r\n _this.isManual = exception.isManual;\r\n }\r\n }\r\n return _this;\r\n }\r\n Exception.CreateFromInterface = function (logger, exception) {\r\n var exceptions = exception.exceptions\r\n && CoreUtils.arrMap(exception.exceptions, function (ex) { return _ExceptionDetails.CreateFromInterface(logger, ex); });\r\n var exceptionData = new Exception(logger, tslib_1.__assign({}, exception, { exceptions: exceptions }));\r\n return exceptionData;\r\n };\r\n Exception.prototype.toInterface = function () {\r\n var _a = this, exceptions = _a.exceptions, properties = _a.properties, measurements = _a.measurements, severityLevel = _a.severityLevel, ver = _a.ver, problemGroup = _a.problemGroup, id = _a.id, isManual = _a.isManual;\r\n var exceptionDetailsInterface = exceptions instanceof Array\r\n && CoreUtils.arrMap(exceptions, function (exception) { return exception.toInterface(); })\r\n || undefined;\r\n return {\r\n ver: \"4.0\",\r\n exceptions: exceptionDetailsInterface,\r\n severityLevel: severityLevel,\r\n properties: properties,\r\n measurements: measurements,\r\n problemGroup: problemGroup,\r\n id: id,\r\n isManual: isManual\r\n };\r\n };\r\n /**\r\n * Creates a simple exception with 1 stack frame. Useful for manual constracting of exception.\r\n */\r\n Exception.CreateSimpleException = function (message, typeName, assembly, fileName, details, line) {\r\n return {\r\n exceptions: [\r\n {\r\n hasFullStack: true,\r\n message: message,\r\n stack: details,\r\n typeName: typeName\r\n }\r\n ]\r\n };\r\n };\r\n Exception.envelopeType = \"Microsoft.ApplicationInsights.{0}.Exception\";\r\n Exception.dataType = \"ExceptionData\";\r\n return Exception;\r\n}(ExceptionData));\r\nexport { Exception };\r\nvar _ExceptionDetails = /** @class */ (function (_super) {\r\n tslib_1.__extends(_ExceptionDetails, _super);\r\n function _ExceptionDetails(logger, exception) {\r\n var _this = _super.call(this) || this;\r\n _this.aiDataContract = {\r\n id: FieldType.Default,\r\n outerId: FieldType.Default,\r\n typeName: FieldType.Required,\r\n message: FieldType.Required,\r\n hasFullStack: FieldType.Default,\r\n stack: FieldType.Default,\r\n parsedStack: FieldType.Array\r\n };\r\n if (exception instanceof Error) {\r\n _this.typeName = DataSanitizer.sanitizeString(logger, exception.name) || Util.NotSpecified;\r\n _this.message = DataSanitizer.sanitizeMessage(logger, exception.message) || Util.NotSpecified;\r\n var stack = exception.stack;\r\n _this.parsedStack = _ExceptionDetails.parseStack(stack);\r\n _this.stack = DataSanitizer.sanitizeException(logger, stack);\r\n _this.hasFullStack = Util.isArray(_this.parsedStack) && _this.parsedStack.length > 0;\r\n }\r\n else {\r\n _this.typeName = exception.typeName;\r\n _this.message = exception.message;\r\n _this.stack = exception.stack;\r\n _this.parsedStack = exception.parsedStack;\r\n _this.hasFullStack = exception.hasFullStack;\r\n }\r\n return _this;\r\n }\r\n _ExceptionDetails.prototype.toInterface = function () {\r\n var parsedStack = this.parsedStack instanceof Array\r\n && CoreUtils.arrMap(this.parsedStack, function (frame) { return frame.toInterface(); });\r\n var exceptionDetailsInterface = {\r\n id: this.id,\r\n outerId: this.outerId,\r\n typeName: this.typeName,\r\n message: this.message,\r\n hasFullStack: this.hasFullStack,\r\n stack: this.stack,\r\n parsedStack: parsedStack || undefined\r\n };\r\n return exceptionDetailsInterface;\r\n };\r\n _ExceptionDetails.CreateFromInterface = function (logger, exception) {\r\n var parsedStack = (exception.parsedStack instanceof Array\r\n && CoreUtils.arrMap(exception.parsedStack, function (frame) { return _StackFrame.CreateFromInterface(frame); }))\r\n || exception.parsedStack;\r\n var exceptionDetails = new _ExceptionDetails(logger, tslib_1.__assign({}, exception, { parsedStack: parsedStack }));\r\n return exceptionDetails;\r\n };\r\n _ExceptionDetails.parseStack = function (stack) {\r\n var parsedStack;\r\n if (CoreUtils.isString(stack)) {\r\n var frames_1 = stack.split('\\n');\r\n parsedStack = [];\r\n var level = 0;\r\n var totalSizeInBytes = 0;\r\n for (var i = 0; i <= frames_1.length; i++) {\r\n var frame = frames_1[i];\r\n if (_StackFrame.regex.test(frame)) {\r\n var parsedFrame = new _StackFrame(frames_1[i], level++);\r\n totalSizeInBytes += parsedFrame.sizeInBytes;\r\n parsedStack.push(parsedFrame);\r\n }\r\n }\r\n // DP Constraint - exception parsed stack must be < 32KB\r\n // remove frames from the middle to meet the threshold\r\n var exceptionParsedStackThreshold = 32 * 1024;\r\n if (totalSizeInBytes > exceptionParsedStackThreshold) {\r\n var left = 0;\r\n var right = parsedStack.length - 1;\r\n var size = 0;\r\n var acceptedLeft = left;\r\n var acceptedRight = right;\r\n while (left < right) {\r\n // check size\r\n var lSize = parsedStack[left].sizeInBytes;\r\n var rSize = parsedStack[right].sizeInBytes;\r\n size += lSize + rSize;\r\n if (size > exceptionParsedStackThreshold) {\r\n // remove extra frames from the middle\r\n var howMany = acceptedRight - acceptedLeft + 1;\r\n parsedStack.splice(acceptedLeft, howMany);\r\n break;\r\n }\r\n // update pointers\r\n acceptedLeft = left;\r\n acceptedRight = right;\r\n left++;\r\n right--;\r\n }\r\n }\r\n }\r\n return parsedStack;\r\n };\r\n return _ExceptionDetails;\r\n}(ExceptionDetails));\r\nexport { _ExceptionDetails };\r\nvar _StackFrame = /** @class */ (function (_super) {\r\n tslib_1.__extends(_StackFrame, _super);\r\n function _StackFrame(sourceFrame, level) {\r\n var _this = _super.call(this) || this;\r\n _this.sizeInBytes = 0;\r\n _this.aiDataContract = {\r\n level: FieldType.Required,\r\n method: FieldType.Required,\r\n assembly: FieldType.Default,\r\n fileName: FieldType.Default,\r\n line: FieldType.Default\r\n };\r\n // Not converting this to CoreUtils.isString() as typescript uses this logic to \"understand\" the different\r\n // types for the 2 different code paths\r\n if (typeof sourceFrame === \"string\") {\r\n var frame = sourceFrame;\r\n _this.level = level;\r\n _this.method = \"\";\r\n _this.assembly = Util.trim(frame);\r\n _this.fileName = \"\";\r\n _this.line = 0;\r\n var matches = frame.match(_StackFrame.regex);\r\n if (matches && matches.length >= 5) {\r\n _this.method = Util.trim(matches[2]) || _this.method;\r\n _this.fileName = Util.trim(matches[4]);\r\n _this.line = parseInt(matches[5]) || 0;\r\n }\r\n }\r\n else {\r\n _this.level = sourceFrame.level;\r\n _this.method = sourceFrame.method;\r\n _this.assembly = sourceFrame.assembly;\r\n _this.fileName = sourceFrame.fileName;\r\n _this.line = sourceFrame.line;\r\n _this.sizeInBytes = 0;\r\n }\r\n _this.sizeInBytes += _this.method.length;\r\n _this.sizeInBytes += _this.fileName.length;\r\n _this.sizeInBytes += _this.assembly.length;\r\n // todo: these might need to be removed depending on how the back-end settles on their size calculation\r\n _this.sizeInBytes += _StackFrame.baseSize;\r\n _this.sizeInBytes += _this.level.toString().length;\r\n _this.sizeInBytes += _this.line.toString().length;\r\n return _this;\r\n }\r\n _StackFrame.CreateFromInterface = function (frame) {\r\n return new _StackFrame(frame, null /* level is available in frame interface */);\r\n };\r\n _StackFrame.prototype.toInterface = function () {\r\n return {\r\n level: this.level,\r\n method: this.method,\r\n assembly: this.assembly,\r\n fileName: this.fileName,\r\n line: this.line\r\n };\r\n };\r\n // regex to match stack frames from ie/chrome/ff\r\n // methodName=$2, fileName=$4, lineNo=$5, column=$6\r\n _StackFrame.regex = /^([\\s]+at)?(.*?)(\\@|\\s\\(|\\s)([^\\(\\@\\n]+):([0-9]+):([0-9]+)(\\)?)$/;\r\n _StackFrame.baseSize = 58; // '{\"method\":\"\",\"level\":,\"assembly\":\"\",\"fileName\":\"\",\"line\":}'.length\r\n return _StackFrame;\r\n}(StackFrame));\r\nexport { _StackFrame };\r\n//# sourceMappingURL=Exception.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport * as tslib_1 from \"tslib\";\r\nimport { Domain } from './Domain';\r\n/**\r\n * An instance of Exception represents a handled or unhandled exception that occurred during execution of the monitored application.\r\n */\r\nvar ExceptionData = /** @class */ (function (_super) {\r\n tslib_1.__extends(ExceptionData, _super);\r\n function ExceptionData() {\r\n var _this = _super.call(this) || this;\r\n _this.ver = 2;\r\n _this.exceptions = [];\r\n _this.properties = {};\r\n _this.measurements = {};\r\n return _this;\r\n }\r\n return ExceptionData;\r\n}(Domain));\r\nexport { ExceptionData };\r\n//# sourceMappingURL=ExceptionData.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport * as tslib_1 from \"tslib\";\r\n// THIS FILE WAS AUTOGENERATED\r\nimport { Domain } from './Domain';\r\n/**\r\n * An instance of the Metric item is a list of measurements (single data points) and/or aggregations.\r\n */\r\nvar MetricData = /** @class */ (function (_super) {\r\n tslib_1.__extends(MetricData, _super);\r\n function MetricData() {\r\n var _this = _super.call(this) || this;\r\n _this.ver = 2;\r\n _this.metrics = [];\r\n _this.properties = {};\r\n _this.measurements = {};\r\n return _this;\r\n }\r\n return MetricData;\r\n}(Domain));\r\nexport { MetricData };\r\n//# sourceMappingURL=MetricData.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n// THIS FILE WAS AUTOGENERATED\r\nimport { DataPointType } from './DataPointType';\r\n/**\r\n * Metric data single measurement.\r\n */\r\nvar DataPoint = /** @class */ (function () {\r\n function DataPoint() {\r\n this.kind = DataPointType.Measurement;\r\n }\r\n return DataPoint;\r\n}());\r\nexport { DataPoint };\r\n//# sourceMappingURL=DataPoint.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n// THIS FILE WAS AUTOGENERATED\r\n/**\r\n * Defines the level of severity for the event.\r\n */\r\nexport var SeverityLevel;\r\n(function (SeverityLevel) {\r\n SeverityLevel[SeverityLevel[\"Verbose\"] = 0] = \"Verbose\";\r\n SeverityLevel[SeverityLevel[\"Information\"] = 1] = \"Information\";\r\n SeverityLevel[SeverityLevel[\"Warning\"] = 2] = \"Warning\";\r\n SeverityLevel[SeverityLevel[\"Error\"] = 3] = \"Error\";\r\n SeverityLevel[SeverityLevel[\"Critical\"] = 4] = \"Critical\";\r\n})(SeverityLevel || (SeverityLevel = {}));\r\n//# sourceMappingURL=SeverityLevel.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport * as tslib_1 from \"tslib\";\r\nimport { DataPoint as AIDataPoint } from '../../Interfaces/Contracts/Generated/DataPoint';\r\nimport { FieldType } from '../../Enums';\r\nvar DataPoint = /** @class */ (function (_super) {\r\n tslib_1.__extends(DataPoint, _super);\r\n function DataPoint() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n /**\r\n * The data contract for serializing this object.\r\n */\r\n _this.aiDataContract = {\r\n name: FieldType.Required,\r\n kind: FieldType.Default,\r\n value: FieldType.Required,\r\n count: FieldType.Default,\r\n min: FieldType.Default,\r\n max: FieldType.Default,\r\n stdDev: FieldType.Default\r\n };\r\n return _this;\r\n }\r\n return DataPoint;\r\n}(AIDataPoint));\r\nexport { DataPoint };\r\n//# sourceMappingURL=DataPoint.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport * as tslib_1 from \"tslib\";\r\nimport { MetricData } from '../Interfaces/Contracts/Generated/MetricData';\r\nimport { DataSanitizer } from './Common/DataSanitizer';\r\nimport { FieldType } from '../Enums';\r\nimport { DataPoint } from './Common/DataPoint';\r\nimport { Util } from '../Util';\r\nvar Metric = /** @class */ (function (_super) {\r\n tslib_1.__extends(Metric, _super);\r\n /**\r\n * Constructs a new instance of the MetricTelemetry object\r\n */\r\n function Metric(logger, name, value, count, min, max, properties, measurements) {\r\n var _this = _super.call(this) || this;\r\n _this.aiDataContract = {\r\n ver: FieldType.Required,\r\n metrics: FieldType.Required,\r\n properties: FieldType.Default\r\n };\r\n var dataPoint = new DataPoint();\r\n dataPoint.count = count > 0 ? count : undefined;\r\n dataPoint.max = isNaN(max) || max === null ? undefined : max;\r\n dataPoint.min = isNaN(min) || min === null ? undefined : min;\r\n dataPoint.name = DataSanitizer.sanitizeString(logger, name) || Util.NotSpecified;\r\n dataPoint.value = value;\r\n _this.metrics = [dataPoint];\r\n _this.properties = DataSanitizer.sanitizeProperties(logger, properties);\r\n _this.measurements = DataSanitizer.sanitizeMeasurements(logger, measurements);\r\n return _this;\r\n }\r\n Metric.envelopeType = \"Microsoft.ApplicationInsights.{0}.Metric\";\r\n Metric.dataType = \"MetricData\";\r\n return Metric;\r\n}(MetricData));\r\nexport { Metric };\r\n//# sourceMappingURL=Metric.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport * as tslib_1 from \"tslib\";\r\n// THIS FILE WAS AUTOGENERATED\r\nimport { EventData } from './EventData';\r\n/**\r\n * An instance of PageView represents a generic action on a page like a button click. It is also the base type for PageView.\r\n */\r\nvar PageViewData = /** @class */ (function (_super) {\r\n tslib_1.__extends(PageViewData, _super);\r\n function PageViewData() {\r\n var _this = _super.call(this) || this;\r\n _this.ver = 2;\r\n _this.properties = {};\r\n _this.measurements = {};\r\n return _this;\r\n }\r\n return PageViewData;\r\n}(EventData));\r\nexport { PageViewData };\r\n//# sourceMappingURL=PageViewData.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport * as tslib_1 from \"tslib\";\r\nimport { PageViewData } from '../Interfaces/Contracts/Generated/PageViewData';\r\nimport { DataSanitizer } from './Common/DataSanitizer';\r\nimport { FieldType } from '../Enums';\r\nimport { Util } from '../Util';\r\nvar PageView = /** @class */ (function (_super) {\r\n tslib_1.__extends(PageView, _super);\r\n /**\r\n * Constructs a new instance of the PageEventTelemetry object\r\n */\r\n function PageView(logger, name, url, durationMs, properties, measurements, id) {\r\n var _this = _super.call(this) || this;\r\n _this.aiDataContract = {\r\n ver: FieldType.Required,\r\n name: FieldType.Default,\r\n url: FieldType.Default,\r\n duration: FieldType.Default,\r\n properties: FieldType.Default,\r\n measurements: FieldType.Default,\r\n id: FieldType.Default\r\n };\r\n _this.id = DataSanitizer.sanitizeId(logger, id);\r\n _this.url = DataSanitizer.sanitizeUrl(logger, url);\r\n _this.name = DataSanitizer.sanitizeString(logger, name) || Util.NotSpecified;\r\n if (!isNaN(durationMs)) {\r\n _this.duration = Util.msToTimeSpan(durationMs);\r\n }\r\n _this.properties = DataSanitizer.sanitizeProperties(logger, properties);\r\n _this.measurements = DataSanitizer.sanitizeMeasurements(logger, measurements);\r\n return _this;\r\n }\r\n PageView.envelopeType = \"Microsoft.ApplicationInsights.{0}.Pageview\";\r\n PageView.dataType = \"PageviewData\";\r\n return PageView;\r\n}(PageViewData));\r\nexport { PageView };\r\n//# sourceMappingURL=PageView.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport * as tslib_1 from \"tslib\";\r\nimport { DataSanitizer } from './Common/DataSanitizer';\r\nimport { FieldType } from '../Enums';\r\nimport { Util, AjaxHelper } from '../Util';\r\nimport { RemoteDependencyData as GeneratedRemoteDependencyData } from '../Interfaces/Contracts/Generated/RemoteDependencyData';\r\nvar RemoteDependencyData = /** @class */ (function (_super) {\r\n tslib_1.__extends(RemoteDependencyData, _super);\r\n /**\r\n * Constructs a new instance of the RemoteDependencyData object\r\n */\r\n function RemoteDependencyData(logger, id, absoluteUrl, commandName, value, success, resultCode, method, requestAPI, correlationContext, properties, measurements) {\r\n if (requestAPI === void 0) { requestAPI = \"Ajax\"; }\r\n var _this = _super.call(this) || this;\r\n _this.aiDataContract = {\r\n id: FieldType.Required,\r\n ver: FieldType.Required,\r\n name: FieldType.Default,\r\n resultCode: FieldType.Default,\r\n duration: FieldType.Default,\r\n success: FieldType.Default,\r\n data: FieldType.Default,\r\n target: FieldType.Default,\r\n type: FieldType.Default,\r\n properties: FieldType.Default,\r\n measurements: FieldType.Default,\r\n kind: FieldType.Default,\r\n value: FieldType.Default,\r\n count: FieldType.Default,\r\n min: FieldType.Default,\r\n max: FieldType.Default,\r\n stdDev: FieldType.Default,\r\n dependencyKind: FieldType.Default,\r\n dependencySource: FieldType.Default,\r\n commandName: FieldType.Default,\r\n dependencyTypeName: FieldType.Default\r\n };\r\n _this.id = id;\r\n _this.duration = Util.msToTimeSpan(value);\r\n _this.success = success;\r\n _this.resultCode = resultCode + \"\";\r\n _this.type = DataSanitizer.sanitizeString(logger, requestAPI);\r\n var dependencyFields = AjaxHelper.ParseDependencyPath(logger, absoluteUrl, method, commandName);\r\n _this.data = DataSanitizer.sanitizeUrl(logger, commandName) || dependencyFields.data; // get a value from hosturl if commandName not available\r\n _this.target = DataSanitizer.sanitizeString(logger, dependencyFields.target);\r\n if (correlationContext) {\r\n _this.target = _this.target + \" | \" + correlationContext;\r\n }\r\n _this.name = DataSanitizer.sanitizeString(logger, dependencyFields.name);\r\n _this.properties = DataSanitizer.sanitizeProperties(logger, properties);\r\n _this.measurements = DataSanitizer.sanitizeMeasurements(logger, measurements);\r\n return _this;\r\n }\r\n RemoteDependencyData.envelopeType = \"Microsoft.ApplicationInsights.{0}.RemoteDependency\";\r\n RemoteDependencyData.dataType = \"RemoteDependencyData\";\r\n return RemoteDependencyData;\r\n}(GeneratedRemoteDependencyData));\r\nexport { RemoteDependencyData };\r\n//# sourceMappingURL=RemoteDependencyData.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport * as tslib_1 from \"tslib\";\r\n// THIS FILE WAS AUTOGENERATED\r\nimport { Domain } from './Domain';\r\n/**\r\n * An instance of Remote Dependency represents an interaction of the monitored component with a remote component/service like SQL or an HTTP endpoint.\r\n */\r\nvar RemoteDependencyData = /** @class */ (function (_super) {\r\n tslib_1.__extends(RemoteDependencyData, _super);\r\n function RemoteDependencyData() {\r\n var _this = _super.call(this) || this;\r\n _this.ver = 2;\r\n _this.success = true;\r\n _this.properties = {};\r\n _this.measurements = {};\r\n return _this;\r\n }\r\n return RemoteDependencyData;\r\n}(Domain));\r\nexport { RemoteDependencyData };\r\n//# sourceMappingURL=RemoteDependencyData.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport * as tslib_1 from \"tslib\";\r\nimport { MessageData } from '../Interfaces/Contracts/Generated/MessageData';\r\nimport { DataSanitizer } from './Common/DataSanitizer';\r\nimport { FieldType } from '../Enums';\r\nimport { Util } from '../Util';\r\nvar Trace = /** @class */ (function (_super) {\r\n tslib_1.__extends(Trace, _super);\r\n /**\r\n * Constructs a new instance of the TraceTelemetry object\r\n */\r\n function Trace(logger, message, severityLevel, properties, measurements) {\r\n var _this = _super.call(this) || this;\r\n _this.aiDataContract = {\r\n ver: FieldType.Required,\r\n message: FieldType.Required,\r\n severityLevel: FieldType.Default,\r\n properties: FieldType.Default\r\n };\r\n message = message || Util.NotSpecified;\r\n _this.message = DataSanitizer.sanitizeMessage(logger, message);\r\n _this.properties = DataSanitizer.sanitizeProperties(logger, properties);\r\n _this.measurements = DataSanitizer.sanitizeMeasurements(logger, measurements);\r\n if (severityLevel) {\r\n _this.severityLevel = severityLevel;\r\n }\r\n return _this;\r\n }\r\n Trace.envelopeType = \"Microsoft.ApplicationInsights.{0}.Message\";\r\n Trace.dataType = \"MessageData\";\r\n return Trace;\r\n}(MessageData));\r\nexport { Trace };\r\n//# sourceMappingURL=Trace.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport * as tslib_1 from \"tslib\";\r\n// THIS FILE WAS AUTOGENERATED\r\nimport { Domain } from './Domain';\r\n/**\r\n * Instances of Message represent printf-like trace statements that are text-searched. Log4Net, NLog and other text-based log file entries are translated into intances of this type. The message does not have measurements.\r\n */\r\nvar MessageData = /** @class */ (function (_super) {\r\n tslib_1.__extends(MessageData, _super);\r\n function MessageData() {\r\n var _this = _super.call(this) || this;\r\n _this.ver = 2;\r\n _this.properties = {};\r\n _this.measurements = {};\r\n return _this;\r\n }\r\n return MessageData;\r\n}(Domain));\r\nexport { MessageData };\r\n//# sourceMappingURL=MessageData.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport * as tslib_1 from \"tslib\";\r\nimport { PageViewPerfData } from '../Interfaces/Contracts/Generated/PageViewPerfData';\r\nimport { FieldType } from '../Enums';\r\nimport { DataSanitizer } from './Common/DataSanitizer';\r\nimport { Util } from '../Util';\r\nvar PageViewPerformance = /** @class */ (function (_super) {\r\n tslib_1.__extends(PageViewPerformance, _super);\r\n /**\r\n * Constructs a new instance of the PageEventTelemetry object\r\n */\r\n function PageViewPerformance(logger, name, url, unused, properties, measurements, cs4BaseData) {\r\n var _this = _super.call(this) || this;\r\n _this.aiDataContract = {\r\n ver: FieldType.Required,\r\n name: FieldType.Default,\r\n url: FieldType.Default,\r\n duration: FieldType.Default,\r\n perfTotal: FieldType.Default,\r\n networkConnect: FieldType.Default,\r\n sentRequest: FieldType.Default,\r\n receivedResponse: FieldType.Default,\r\n domProcessing: FieldType.Default,\r\n properties: FieldType.Default,\r\n measurements: FieldType.Default\r\n };\r\n _this.url = DataSanitizer.sanitizeUrl(logger, url);\r\n _this.name = DataSanitizer.sanitizeString(logger, name) || Util.NotSpecified;\r\n _this.properties = DataSanitizer.sanitizeProperties(logger, properties);\r\n _this.measurements = DataSanitizer.sanitizeMeasurements(logger, measurements);\r\n if (cs4BaseData) {\r\n _this.domProcessing = cs4BaseData.domProcessing;\r\n _this.duration = cs4BaseData.duration;\r\n _this.networkConnect = cs4BaseData.networkConnect;\r\n _this.perfTotal = cs4BaseData.perfTotal;\r\n _this.receivedResponse = cs4BaseData.receivedResponse;\r\n _this.sentRequest = cs4BaseData.sentRequest;\r\n }\r\n return _this;\r\n }\r\n PageViewPerformance.envelopeType = \"Microsoft.ApplicationInsights.{0}.PageviewPerformance\";\r\n PageViewPerformance.dataType = \"PageviewPerformanceData\";\r\n return PageViewPerformance;\r\n}(PageViewPerfData));\r\nexport { PageViewPerformance };\r\n//# sourceMappingURL=PageViewPerformance.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport * as tslib_1 from \"tslib\";\r\n// THIS FILE WAS AUTOGENERATED\r\nimport { PageViewData } from './PageViewData';\r\n/**\r\n * An instance of PageViewPerf represents: a page view with no performance data, a page view with performance data, or just the performance data of an earlier page request.\r\n */\r\nvar PageViewPerfData = /** @class */ (function (_super) {\r\n tslib_1.__extends(PageViewPerfData, _super);\r\n function PageViewPerfData() {\r\n var _this = _super.call(this) || this;\r\n _this.ver = 2;\r\n _this.properties = {};\r\n _this.measurements = {};\r\n return _this;\r\n }\r\n return PageViewPerfData;\r\n}(PageViewData));\r\nexport { PageViewPerfData };\r\n//# sourceMappingURL=PageViewPerfData.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport * as tslib_1 from \"tslib\";\r\nimport { Data as AIData } from '../../Interfaces/Contracts/Generated/Data';\r\nimport { FieldType } from '../../Enums';\r\nvar Data = /** @class */ (function (_super) {\r\n tslib_1.__extends(Data, _super);\r\n /**\r\n * Constructs a new instance of telemetry data.\r\n */\r\n function Data(baseType, data) {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * The data contract for serializing this object.\r\n */\r\n _this.aiDataContract = {\r\n baseType: FieldType.Required,\r\n baseData: FieldType.Required\r\n };\r\n _this.baseType = baseType;\r\n _this.baseData = data;\r\n return _this;\r\n }\r\n return Data;\r\n}(AIData));\r\nexport { Data };\r\n//# sourceMappingURL=Data.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { CoreUtils } from '@microsoft/applicationinsights-core-js';\r\nvar ConfigurationManager = /** @class */ (function () {\r\n function ConfigurationManager() {\r\n }\r\n ConfigurationManager.getConfig = function (config, field, identifier, defaultValue) {\r\n if (defaultValue === void 0) { defaultValue = false; }\r\n var configValue;\r\n if (identifier && config.extensionConfig && config.extensionConfig[identifier] && !CoreUtils.isNullOrUndefined(config.extensionConfig[identifier][field])) {\r\n configValue = config.extensionConfig[identifier][field];\r\n }\r\n else {\r\n configValue = config[field];\r\n }\r\n return !CoreUtils.isNullOrUndefined(configValue) ? configValue : defaultValue;\r\n };\r\n return ConfigurationManager;\r\n}());\r\nexport { ConfigurationManager };\r\n//# sourceMappingURL=IConfig.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n// THIS FILE WAS AUTOGENERATED\r\nvar ContextTagKeys = /** @class */ (function () {\r\n function ContextTagKeys() {\r\n this.applicationVersion = \"ai.application.ver\";\r\n this.applicationBuild = \"ai.application.build\";\r\n this.applicationTypeId = \"ai.application.typeId\";\r\n this.applicationId = \"ai.application.applicationId\";\r\n this.applicationLayer = \"ai.application.layer\";\r\n this.deviceId = \"ai.device.id\";\r\n this.deviceIp = \"ai.device.ip\";\r\n this.deviceLanguage = \"ai.device.language\";\r\n this.deviceLocale = \"ai.device.locale\";\r\n this.deviceModel = \"ai.device.model\";\r\n this.deviceFriendlyName = \"ai.device.friendlyName\";\r\n this.deviceNetwork = \"ai.device.network\";\r\n this.deviceNetworkName = \"ai.device.networkName\";\r\n this.deviceOEMName = \"ai.device.oemName\";\r\n this.deviceOS = \"ai.device.os\";\r\n this.deviceOSVersion = \"ai.device.osVersion\";\r\n this.deviceRoleInstance = \"ai.device.roleInstance\";\r\n this.deviceRoleName = \"ai.device.roleName\";\r\n this.deviceScreenResolution = \"ai.device.screenResolution\";\r\n this.deviceType = \"ai.device.type\";\r\n this.deviceMachineName = \"ai.device.machineName\";\r\n this.deviceVMName = \"ai.device.vmName\";\r\n this.deviceBrowser = \"ai.device.browser\";\r\n this.deviceBrowserVersion = \"ai.device.browserVersion\";\r\n this.locationIp = \"ai.location.ip\";\r\n this.locationCountry = \"ai.location.country\";\r\n this.locationProvince = \"ai.location.province\";\r\n this.locationCity = \"ai.location.city\";\r\n this.operationId = \"ai.operation.id\";\r\n this.operationName = \"ai.operation.name\";\r\n this.operationParentId = \"ai.operation.parentId\";\r\n this.operationRootId = \"ai.operation.rootId\";\r\n this.operationSyntheticSource = \"ai.operation.syntheticSource\";\r\n this.operationCorrelationVector = \"ai.operation.correlationVector\";\r\n this.sessionId = \"ai.session.id\";\r\n this.sessionIsFirst = \"ai.session.isFirst\";\r\n this.sessionIsNew = \"ai.session.isNew\";\r\n this.userAccountAcquisitionDate = \"ai.user.accountAcquisitionDate\";\r\n this.userAccountId = \"ai.user.accountId\";\r\n this.userAgent = \"ai.user.userAgent\";\r\n this.userId = \"ai.user.id\";\r\n this.userStoreRegion = \"ai.user.storeRegion\";\r\n this.userAuthUserId = \"ai.user.authUserId\";\r\n this.userAnonymousUserAcquisitionDate = \"ai.user.anonUserAcquisitionDate\";\r\n this.userAuthenticatedUserAcquisitionDate = \"ai.user.authUserAcquisitionDate\";\r\n this.cloudName = \"ai.cloud.name\";\r\n this.cloudRole = \"ai.cloud.role\";\r\n this.cloudRoleVer = \"ai.cloud.roleVer\";\r\n this.cloudRoleInstance = \"ai.cloud.roleInstance\";\r\n this.cloudEnvironment = \"ai.cloud.environment\";\r\n this.cloudLocation = \"ai.cloud.location\";\r\n this.cloudDeploymentUnit = \"ai.cloud.deploymentUnit\";\r\n this.internalNodeName = \"ai.internal.nodeName\";\r\n this.internalSdkVersion = \"ai.internal.sdkVersion\";\r\n this.internalAgentVersion = \"ai.internal.agentVersion\";\r\n }\r\n return ContextTagKeys;\r\n}());\r\nexport { ContextTagKeys };\r\n//# sourceMappingURL=ContextTagKeys.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { Util } from \"./Util\";\r\nimport { DataSanitizer } from \"./Telemetry/Common/DataSanitizer\";\r\nimport { CoreUtils } from \"@microsoft/applicationinsights-core-js\";\r\nvar TelemetryItemCreator = /** @class */ (function () {\r\n function TelemetryItemCreator() {\r\n }\r\n /**\r\n * Create a telemetry item that the 1DS channel understands\r\n * @param item domain specific properties; part B\r\n * @param baseType telemetry item type. ie PageViewData\r\n * @param envelopeName name of the envelope. ie Microsoft.ApplicationInsights..PageView\r\n * @param customProperties user defined custom properties; part C\r\n * @param systemProperties system properties that are added to the context; part A\r\n * @returns ITelemetryItem that is sent to channel\r\n */\r\n TelemetryItemCreator.create = function (item, baseType, envelopeName, logger, customProperties, systemProperties) {\r\n envelopeName = DataSanitizer.sanitizeString(logger, envelopeName) || Util.NotSpecified;\r\n if (CoreUtils.isNullOrUndefined(item) ||\r\n CoreUtils.isNullOrUndefined(baseType) ||\r\n CoreUtils.isNullOrUndefined(envelopeName)) {\r\n throw Error(\"Input doesn't contain all required fields\");\r\n }\r\n var telemetryItem = {\r\n name: envelopeName,\r\n time: CoreUtils.toISOString(new Date()),\r\n iKey: \"\",\r\n ext: systemProperties ? systemProperties : {},\r\n tags: [],\r\n data: {},\r\n baseType: baseType,\r\n baseData: item // Part B\r\n };\r\n // Part C\r\n if (!CoreUtils.isNullOrUndefined(customProperties)) {\r\n for (var prop in customProperties) {\r\n if (customProperties.hasOwnProperty(prop)) {\r\n telemetryItem.data[prop] = customProperties[prop];\r\n }\r\n }\r\n }\r\n return telemetryItem;\r\n };\r\n return TelemetryItemCreator;\r\n}());\r\nexport { TelemetryItemCreator };\r\n//# sourceMappingURL=TelemetryItemCreator.js.map","import { ContextTagKeys } from \"./Contracts/Generated/ContextTagKeys\";\r\nvar Extensions = /** @class */ (function () {\r\n function Extensions() {\r\n }\r\n Extensions.UserExt = \"user\";\r\n Extensions.DeviceExt = \"device\";\r\n Extensions.TraceExt = \"trace\";\r\n Extensions.WebExt = \"web\";\r\n Extensions.AppExt = \"app\";\r\n Extensions.OSExt = \"os\";\r\n Extensions.SessionExt = \"ses\";\r\n Extensions.SDKExt = \"sdk\";\r\n return Extensions;\r\n}());\r\nexport { Extensions };\r\nexport var CtxTagKeys = new ContextTagKeys();\r\n//# sourceMappingURL=PartAExtensions.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nexport { Util, CorrelationIdHelper, UrlHelper, DateTimeUtils } from './Util';\r\nexport { ConnectionStringParser } from './ConnectionStringParser';\r\nexport { FieldType } from './Enums';\r\nexport { RequestHeaders } from './RequestResponseHeaders';\r\nexport { DisabledPropertyName, ProcessLegacy, SampleRate, HttpMethod, DEFAULT_BREEZE_ENDPOINT } from './Constants';\r\nexport { Data as AIData } from './Interfaces/Contracts/Generated/Data';\r\nexport { Base as AIBase } from './Interfaces/Contracts/Generated/Base';\r\nexport { Envelope } from './Telemetry/Common/Envelope';\r\nexport { Event } from './Telemetry/Event';\r\nexport { Exception } from './Telemetry/Exception';\r\nexport { Metric } from './Telemetry/Metric';\r\nexport { PageView } from './Telemetry/PageView';\r\nexport { PageViewData } from './Interfaces/Contracts/Generated/PageViewData';\r\nexport { RemoteDependencyData } from './Telemetry/RemoteDependencyData';\r\nexport { Trace } from './Telemetry/Trace';\r\nexport { PageViewPerformance } from './Telemetry/PageViewPerformance';\r\nexport { Data } from './Telemetry/Common/Data';\r\nexport { SeverityLevel } from './Interfaces/Contracts/Generated/SeverityLevel';\r\nexport { ConfigurationManager } from './Interfaces/IConfig';\r\nexport { ContextTagKeys } from './Interfaces/Contracts/Generated/ContextTagKeys';\r\nexport { DataSanitizer } from './Telemetry/Common/DataSanitizer';\r\nexport { TelemetryItemCreator } from './TelemetryItemCreator';\r\nexport { CtxTagKeys, Extensions } from './Interfaces/PartAExtensions';\r\nexport { DistributedTracingModes } from './Enums';\r\nexport var PropertiesPluginIdentifier = \"AppInsightsPropertiesPlugin\";\r\nexport var BreezeChannelIdentifier = \"AppInsightsChannelPlugin\";\r\nexport var AnalyticsPluginIdentifier = \"ApplicationInsightsAnalytics\";\r\n//# sourceMappingURL=applicationinsights-common.js.map","/*!\n * Microsoft Dynamic Proto Utility, 0.5.3\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n/**\r\n * Constant string defined to support minimization\r\n * @ignore\r\n */\r\nvar Constructor = 'constructor';\r\n/**\r\n * Constant string defined to support minimization\r\n * @ignore\r\n */\r\nvar Prototype = 'prototype';\r\n/**\r\n * Constant string defined to support minimization\r\n * @ignore\r\n */\r\nvar strFunction = 'function';\r\n/**\r\n * Used to define the name of the instance function lookup table\r\n * @ignore\r\n */\r\nvar DynInstFuncTable = '_dynInstFuncs';\r\n/**\r\n * Name used to tag the dynamic prototype function\r\n * @ignore\r\n */\r\nvar DynProxyTag = '_isDynProxy';\r\n/**\r\n * Name added to a prototype to define the dynamic prototype \"class\" name used to lookup the function table\r\n * @ignore\r\n */\r\nvar DynClassName = '_dynClass';\r\n/**\r\n * Prefix added to the classname to avoid any name clashes with other instance level properties\r\n * @ignore\r\n */\r\nvar DynClassNamePrefix = '_dynCls$';\r\n/**\r\n * Value used as the name of a class when it cannot be determined\r\n * @ignore\r\n */\r\nvar UnknownValue = '_unknown_';\r\n/**\r\n * Constant string defined to support minimization\r\n * @ignore\r\n */\r\nvar str__Proto = \"__proto__\";\r\n/**\r\n * Pre-lookup to check if we are running on a modern browser (i.e. not IE8)\r\n * @ignore\r\n */\r\nvar _objGetPrototypeOf = Object[\"getPrototypeOf\"];\r\n/**\r\n * Internal Global used to generate a unique dynamic class name, every new class will increase this value\r\n * @ignore\r\n */\r\nvar _dynamicNames = 0;\r\n/**\r\n * Helper to check if the object contains a property of the name\r\n * @ignore\r\n */\r\nfunction _hasOwnProperty(obj, prop) {\r\n return obj && Object[Prototype].hasOwnProperty.call(obj, prop);\r\n}\r\n/**\r\n * Checks if the passed of value is a function.\r\n * @param {any} value - Value to be checked.\r\n * @return {boolean} True if the value is a boolean, false otherwise.\r\n * @ignore\r\n */\r\nfunction _isFunction(value) {\r\n return typeof value === strFunction;\r\n}\r\n/**\r\n * Helper used to check whether the target is an Object prototype or Array prototype\r\n * @ignore\r\n */\r\nfunction _isObjectOrArrayPrototype(target) {\r\n return target && (target === Object[Prototype] || target === Array[Prototype]);\r\n}\r\n/**\r\n * Helper used to check whether the target is an Object prototype, Array prototype or Function prototype\r\n * @ignore\r\n */\r\nfunction _isObjectArrayOrFunctionPrototype(target) {\r\n return _isObjectOrArrayPrototype(target) || target === Function[Prototype];\r\n}\r\n/**\r\n * Helper used to get the prototype of the target object as getPrototypeOf is not available in an ES3 environment.\r\n * @ignore\r\n */\r\nfunction _getObjProto(target) {\r\n if (target) {\r\n // This method doesn't existing in older browsers (e.g. IE8)\r\n if (_objGetPrototypeOf) {\r\n return _objGetPrototypeOf(target);\r\n }\r\n // target[Constructor] May break if the constructor has been changed or removed\r\n var newProto = target[str__Proto] || target[Prototype] || target[Constructor];\r\n if (newProto) {\r\n return newProto;\r\n }\r\n }\r\n return null;\r\n}\r\n/**\r\n * Helper function to check whether the provided function name is a potential candidate for dynamic\r\n * callback and prototype generation.\r\n * @param target The target object, may be a prototpe or class object\r\n * @param funcName The function name\r\n * @param skipOwn Skips the check for own property\r\n * @ignore\r\n */\r\nfunction _isDynamicCandidate(target, funcName, skipOwn) {\r\n return (funcName !== Constructor && _isFunction(target[funcName]) && (skipOwn || _hasOwnProperty(target, funcName)));\r\n}\r\n/**\r\n * Helper to throw a TypeError exception\r\n * @param message the message\r\n * @ignore\r\n */\r\nfunction _throwTypeError(message) {\r\n throw new TypeError(\"DynamicProto: \" + message);\r\n}\r\n/**\r\n * Returns a collection of the instance functions that are defined directly on the thisTarget object, it does\r\n * not return any inherited functions\r\n * @param thisTarget The object to get the instance functions from\r\n * @ignore\r\n */\r\nfunction _getInstanceFuncs(thisTarget) {\r\n // Get the base proto\r\n var instFuncs = {};\r\n // Save any existing instance functions\r\n for (var name in thisTarget) {\r\n // Don't include any dynamic prototype instances - as we only want the real functions\r\n if (!instFuncs[name] && _isDynamicCandidate(thisTarget, name, false)) {\r\n // Create an instance callback for pasing the base function to the caller\r\n instFuncs[name] = thisTarget[name];\r\n }\r\n }\r\n return instFuncs;\r\n}\r\n/**\r\n * Returns whether the value is included in the array\r\n * @param values The array of values\r\n * @param value The value\r\n */\r\nfunction _hasVisited(values, value) {\r\n for (var lp = values.length - 1; lp >= 0; lp--) {\r\n if (values[lp] === value) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\n/**\r\n * Returns an object that contains callback functions for all \"base/super\" functions, this is used to \"save\"\r\n * enabling calling super.xxx() functions without requiring that the base \"class\" has defined a prototype references\r\n * @param target The current instance\r\n * @ignore\r\n */\r\nfunction _getBaseFuncs(classProto, thisTarget, instFuncs) {\r\n function _instFuncProxy(target, theFunc) {\r\n return function () {\r\n return theFunc.apply(target, arguments);\r\n };\r\n }\r\n // Start creating a new baseFuncs by creating proxies for the instance functions (as they may get replaced)\r\n var baseFuncs = {};\r\n for (var name in instFuncs) {\r\n // Create an instance callback for pasing the base function to the caller\r\n baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs[name]);\r\n }\r\n // Get the base prototype functions\r\n var baseProto = _getObjProto(classProto);\r\n var visited = [];\r\n // Don't include base object functions for Object, Array or Function\r\n while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) {\r\n // look for prototype functions\r\n for (var name in baseProto) {\r\n // Don't include any dynamic prototype instances - as we only want the real functions\r\n // For IE 7/8 the prototype lookup doesn't provide the full chain so we need to bypass the \r\n // hasOwnProperty check we get all of the methods, main difference is that IE7/8 doesn't return\r\n // the Object prototype methods while bypassing the check\r\n if (!baseFuncs[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf)) {\r\n // Create an instance callback for pasing the base function to the caller\r\n baseFuncs[name] = _instFuncProxy(thisTarget, baseProto[name]);\r\n }\r\n }\r\n // We need to find all possible functions that might be overloaded by walking the entire prototype chain\r\n // This avoids the caller from needing to check whether it's direct base class implements the function or not\r\n // by walking the entire chain it simplifies the usage and issues from upgrading any of the base classes.\r\n visited.push(baseProto);\r\n baseProto = _getObjProto(baseProto);\r\n }\r\n return baseFuncs;\r\n}\r\n/**\r\n * Add the required dynamic prototype methods to the the class prototype\r\n * @param proto The class prototype\r\n * @param className The instance classname\r\n * @param target The target instance\r\n * @param baseInstFuncs The base instance functions\r\n * @ignore\r\n */\r\nfunction _populatePrototype(proto, className, target, baseInstFuncs) {\r\n function _createDynamicPrototype(proto, funcName) {\r\n var dynProtoProxy = function () {\r\n var _this = this;\r\n // We need to check whether the class name is defined directly on this prototype otherwise\r\n // it will walk the proto chain and return any parent proto classname.\r\n if (_this && _hasOwnProperty(proto, DynClassName)) {\r\n var instFunc = ((_this[DynInstFuncTable] || {})[proto[DynClassName]] || {})[funcName];\r\n if (instFunc) {\r\n // Used the instance function property\r\n return instFunc.apply(_this, arguments);\r\n }\r\n // Avoid stack overflow from recursive calling the same function\r\n _throwTypeError(\"Missing [\" + funcName + \"] \" + strFunction);\r\n }\r\n var protoFunc = proto[funcName];\r\n // Check that the prototype function is not a self reference -- try to avoid stack overflow!\r\n if (protoFunc === dynProtoProxy) {\r\n // It is so lookup the base prototype\r\n protoFunc = _getObjProto(proto)[funcName];\r\n }\r\n if (!_isFunction(protoFunc)) {\r\n _throwTypeError(\"[\" + funcName + \"] is not a \" + strFunction);\r\n }\r\n return protoFunc.apply(_this, arguments);\r\n };\r\n // Tag this function as a proxy to support replacing dynamic proxy elements (primary use case is for unit testing\r\n // via which can dynamically replace the prototype function reference)\r\n dynProtoProxy[DynProxyTag] = 1;\r\n return dynProtoProxy;\r\n }\r\n if (!_isObjectOrArrayPrototype(proto)) {\r\n var instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || {};\r\n var instFuncs = instFuncTable[className] = (instFuncTable[className] || {}); // fetch and assign if as it may not exist yet\r\n for (var name in target) {\r\n // Only add overriden functions\r\n if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name]) {\r\n // Save the instance Function to the lookup table and remove it from the instance as it's not a dynamic proto function\r\n instFuncs[name] = target[name];\r\n delete target[name];\r\n // Add a dynamic proto if one doesn't exist or if a prototype function exists and it's not a dynamic one\r\n if (!_hasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) {\r\n proto[name] = _createDynamicPrototype(proto, name);\r\n }\r\n }\r\n }\r\n }\r\n}\r\n/**\r\n * Checks whether the passed prototype object appears to be correct by walking the prototype heirarchy of the instance\r\n * @param classProto The class prototype instance\r\n * @param thisTarget The current instance that will be checked whther the passed prototype instance is in the heirarchy\r\n * @ignore\r\n */\r\nfunction _checkPrototype(classProto, thisTarget) {\r\n var thisProto = _getObjProto(thisTarget);\r\n while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto)) {\r\n if (thisProto === classProto) {\r\n return true;\r\n }\r\n thisProto = _getObjProto(thisProto);\r\n }\r\n return false;\r\n}\r\n/**\r\n * Gets the current prototype name using the ES6 name if available otherwise falling back to a use unknown as the name.\r\n * It's not critical for this to return a name, it's used to decorate the generated unique name for easier debugging only.\r\n * @param target\r\n * @param unknownValue\r\n * @ignore\r\n */\r\nfunction _getObjName(target, unknownValue) {\r\n if (_hasOwnProperty(target, Prototype)) {\r\n // Look like a prototype\r\n return target.name || unknownValue || UnknownValue;\r\n }\r\n return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue;\r\n}\r\n/**\r\n * Helper function when creating dynamic (inline) functions for classes, this helper performs the following tasks :-\r\n * - Saves references to all defined base class functions\r\n * - Calls the delegateFunc with the current target (this) and a base object reference that can be used to call all \"super\" functions.\r\n * - Will populate the class prototype for all overridden functions to support class extension that call the prototype instance.\r\n * Callers should use this helper when declaring all function within the constructor of a class, as mentioned above the delegateFunc is\r\n * passed both the target \"this\" and an object that can be used to call any base (super) functions, using this based object in place of\r\n * super.XXX() (which gets expanded to _super.prototype.XXX()) provides a better minification outcome and also ensures the correct \"this\"\r\n * context is maintained as TypeScript creates incorrect references using super.XXXX() for dynamically defined functions i.e. Functions\r\n * defined in the constructor or some other function (rather than declared as complete typescript functions).\r\n * ### Usage\r\n * ```typescript\r\n * import dynamicProto from \"@microsoft/dynamicproto-js\";\r\n * class ExampleClass extends BaseClass {\r\n * constructor() {\r\n * dynamicProto(ExampleClass, this, (_self, base) => {\r\n * // This will define a function that will be converted to a prototype function\r\n * _self.newFunc = () => {\r\n * // Access any \"this\" instance property\r\n * if (_self.someProperty) {\r\n * ...\r\n * }\r\n * }\r\n * // This will define a function that will be converted to a prototype function\r\n * _self.myFunction = () => {\r\n * // Access any \"this\" instance property\r\n * if (_self.someProperty) {\r\n * // Call the base version of the function that we are overriding\r\n * base.myFunction();\r\n * }\r\n * ...\r\n * }\r\n * _self.initialize = () => {\r\n * ...\r\n * }\r\n * // Warnings: While the following will work as _self is simply a reference to\r\n * // this, if anyone overrides myFunction() the overridden will be called first\r\n * // as the normal JavaScript method resolution will occur and the defined\r\n * // _self.initialize() function is actually gets removed from the instance and\r\n * // a proxy prototype version is created to reference the created method.\r\n * _self.initialize();\r\n * });\r\n * }\r\n * }\r\n * ```\r\n * @typeparam DPType This is the generic type of the class, used to keep intellisense valid\r\n * @typeparam DPCls The type that contains the prototype of the current class\r\n * @param theClass This is the current class instance which contains the prototype for the current class\r\n * @param target The current \"this\" (target) reference, when the class has been extended this.prototype will not be the 'theClass' value.\r\n * @param delegateFunc The callback function (closure) that will create the dynamic function\r\n */\r\nfunction dynamicProto(theClass, target, delegateFunc) {\r\n // Make sure that the passed theClass argument looks correct\r\n if (!_hasOwnProperty(theClass, Prototype)) {\r\n _throwTypeError(\"theClass is an invalid class definition.\");\r\n }\r\n // Quick check to make sure that the passed theClass argument looks correct (this is a common copy/paste error)\r\n var classProto = theClass[Prototype];\r\n if (!_checkPrototype(classProto, target)) {\r\n _throwTypeError(\"[\" + _getObjName(theClass) + \"] is not in class heirarchy of [\" + _getObjName(target) + \"]\");\r\n }\r\n var className = null;\r\n if (_hasOwnProperty(classProto, DynClassName)) {\r\n // Only grab the class name if it's defined on this prototype (i.e. don't walk the prototype chain)\r\n className = classProto[DynClassName];\r\n }\r\n else {\r\n // As not all browser support name on the prototype creating a unique dynamic one if we have not already\r\n // assigned one, so we can use a simple string as the lookup rather than an object for the dynamic instance\r\n // function table lookup.\r\n className = DynClassNamePrefix + _getObjName(theClass, \"_\") + \"$\" + _dynamicNames;\r\n _dynamicNames++;\r\n classProto[DynClassName] = className;\r\n }\r\n // Get the current instance functions\r\n var instFuncs = _getInstanceFuncs(target);\r\n // Get all of the functions for any base instance (before they are potentially overriden)\r\n var baseFuncs = _getBaseFuncs(classProto, target, instFuncs);\r\n // Execute the delegate passing in both the current target \"this\" and \"base\" function references\r\n // Note casting the same type as we don't actually have the base class here and this will provide some intellisense support\r\n delegateFunc(target, baseFuncs);\r\n // Populate the Prototype for any overidden instance functions\r\n _populatePrototype(classProto, className, target, instFuncs);\r\n}\n\nexport default dynamicProto;\n//# sourceMappingURL=dynamicproto-js.js.map\n","/*!\n * Application Insights JavaScript SDK - Web Analytics, 2.5.4\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { DateTimeUtils, Util } from '@microsoft/applicationinsights-common';\r\nimport { CoreUtils, LoggingSeverity, _InternalMessageId, getDocument, getLocation } from '@microsoft/applicationinsights-core-js';\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\n/**\r\n * Class encapsulates sending page views and page view performance telemetry.\r\n */\r\nvar PageViewManager = /** @class */ (function () {\r\n function PageViewManager(appInsights, overridePageViewDuration, core, pageViewPerformanceManager) {\r\n dynamicProto(PageViewManager, this, function (_self) {\r\n var arrForEach = CoreUtils.arrForEach;\r\n var isNullOrUndefined = CoreUtils.isNullOrUndefined;\r\n var intervalHandle = null;\r\n var itemQueue = [];\r\n var pageViewPerformanceSent = false;\r\n var _logger;\r\n if (core) {\r\n _logger = core.logger;\r\n }\r\n function _flushChannels() {\r\n if (core) {\r\n arrForEach(core.getTransmissionControls(), function (queues) {\r\n arrForEach(queues, function (q) { return q.flush(true); });\r\n });\r\n }\r\n }\r\n function _addQueue(cb) {\r\n itemQueue.push(cb);\r\n if (!intervalHandle) {\r\n intervalHandle = setInterval((function () {\r\n var allItems = itemQueue.slice(0);\r\n var doFlush = false;\r\n itemQueue = [];\r\n arrForEach(allItems, function (item) {\r\n if (!item()) {\r\n // Not processed so rescheduled\r\n itemQueue.push(item);\r\n }\r\n else {\r\n doFlush = true;\r\n }\r\n });\r\n if (itemQueue.length === 0) {\r\n clearInterval(intervalHandle);\r\n intervalHandle = null;\r\n }\r\n if (doFlush) {\r\n // We process at least one item so flush the queue\r\n _flushChannels();\r\n }\r\n }), 100);\r\n }\r\n }\r\n _self.trackPageView = function (pageView, customProperties) {\r\n var name = pageView.name;\r\n if (isNullOrUndefined(name) || typeof name !== \"string\") {\r\n var doc = getDocument();\r\n name = pageView.name = doc && doc.title || \"\";\r\n }\r\n var uri = pageView.uri;\r\n if (isNullOrUndefined(uri) || typeof uri !== \"string\") {\r\n var location_1 = getLocation();\r\n uri = pageView.uri = location_1 && location_1.href || \"\";\r\n }\r\n // case 1a. if performance timing is not supported by the browser, send the page view telemetry with the duration provided by the user. If the user\r\n // do not provide the duration, set duration to undefined\r\n // Also this is case 4\r\n if (!pageViewPerformanceManager.isPerformanceTimingSupported()) {\r\n appInsights.sendPageViewInternal(pageView, customProperties);\r\n _flushChannels();\r\n // no navigation timing (IE 8, iOS Safari 8.4, Opera Mini 8 - see http://caniuse.com/#feat=nav-timing)\r\n _logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.NavigationTimingNotSupported, \"trackPageView: navigation timing API used for calculation of page duration is not supported in this browser. This page view will be collected without duration and timing info.\");\r\n return;\r\n }\r\n var pageViewSent = false;\r\n var customDuration;\r\n // if the performance timing is supported by the browser, calculate the custom duration\r\n var start = pageViewPerformanceManager.getPerformanceTiming().navigationStart;\r\n customDuration = DateTimeUtils.GetDuration(start, +new Date);\r\n if (!pageViewPerformanceManager.shouldCollectDuration(customDuration)) {\r\n customDuration = undefined;\r\n }\r\n // if the user has provided duration, send a page view telemetry with the provided duration. Otherwise, if\r\n // overridePageViewDuration is set to true, send a page view telemetry with the custom duration calculated earlier\r\n var duration;\r\n if (!isNullOrUndefined(customProperties) &&\r\n !isNullOrUndefined(customProperties.duration)) {\r\n duration = customProperties.duration;\r\n }\r\n if (overridePageViewDuration || !isNaN(duration)) {\r\n if (isNaN(duration)) {\r\n // case 3\r\n if (!customProperties) {\r\n customProperties = {};\r\n }\r\n customProperties[\"duration\"] = customDuration;\r\n }\r\n // case 2\r\n appInsights.sendPageViewInternal(pageView, customProperties);\r\n _flushChannels();\r\n pageViewSent = true;\r\n }\r\n // now try to send the page view performance telemetry\r\n var maxDurationLimit = 60000;\r\n if (!customProperties) {\r\n customProperties = {};\r\n }\r\n // Queue the event for processing\r\n _addQueue(function () {\r\n var processed = false;\r\n try {\r\n if (pageViewPerformanceManager.isPerformanceTimingDataReady()) {\r\n processed = true;\r\n var pageViewPerformance = {\r\n name: name,\r\n uri: uri\r\n };\r\n pageViewPerformanceManager.populatePageViewPerformanceEvent(pageViewPerformance);\r\n if (!pageViewPerformance.isValid && !pageViewSent) {\r\n // If navigation timing gives invalid numbers, then go back to \"override page view duration\" mode.\r\n // That's the best value we can get that makes sense.\r\n customProperties[\"duration\"] = customDuration;\r\n appInsights.sendPageViewInternal(pageView, customProperties);\r\n }\r\n else {\r\n if (!pageViewSent) {\r\n customProperties[\"duration\"] = pageViewPerformance.durationMs;\r\n appInsights.sendPageViewInternal(pageView, customProperties);\r\n }\r\n if (!pageViewPerformanceSent) {\r\n appInsights.sendPageViewPerformanceInternal(pageViewPerformance, customProperties);\r\n pageViewPerformanceSent = true;\r\n }\r\n }\r\n }\r\n else if (DateTimeUtils.GetDuration(start, +new Date) > maxDurationLimit) {\r\n // if performance timings are not ready but we exceeded the maximum duration limit, just log a page view telemetry\r\n // with the maximum duration limit. Otherwise, keep waiting until performance timings are ready\r\n processed = true;\r\n if (!pageViewSent) {\r\n customProperties[\"duration\"] = maxDurationLimit;\r\n appInsights.sendPageViewInternal(pageView, customProperties);\r\n }\r\n }\r\n }\r\n catch (e) {\r\n _logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TrackPVFailedCalc, \"trackPageView failed on page load calculation: \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n return processed;\r\n });\r\n };\r\n });\r\n }\r\n// Removed Stub for PageViewManager.prototype.trackPageView.\r\n return PageViewManager;\r\n}());\r\nexport { PageViewManager };\r\n//# sourceMappingURL=PageViewManager.js.map","/*!\n * Application Insights JavaScript SDK - Web Analytics, 2.5.4\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { Util } from '@microsoft/applicationinsights-common';\r\nimport { hasJSON, getJSON } from '@microsoft/applicationinsights-core-js';\r\n/**\r\n * Used to track page visit durations\r\n */\r\nvar PageVisitTimeManager = /** @class */ (function () {\r\n /**\r\n * Creates a new instance of PageVisitTimeManager\r\n * @param pageVisitTimeTrackingHandler Delegate that will be called to send telemetry data to AI (when trackPreviousPageVisit is called)\r\n * @returns {}\r\n */\r\n function PageVisitTimeManager(logger, pageVisitTimeTrackingHandler) {\r\n this.prevPageVisitDataKeyName = \"prevPageVisitData\";\r\n this.pageVisitTimeTrackingHandler = pageVisitTimeTrackingHandler;\r\n this._logger = logger;\r\n }\r\n /**\r\n * Tracks the previous page visit time telemetry (if exists) and starts timing of new page visit time\r\n * @param currentPageName Name of page to begin timing for visit duration\r\n * @param currentPageUrl Url of page to begin timing for visit duration\r\n */\r\n PageVisitTimeManager.prototype.trackPreviousPageVisit = function (currentPageName, currentPageUrl) {\r\n try {\r\n // Restart timer for new page view\r\n var prevPageVisitTimeData = this.restartPageVisitTimer(currentPageName, currentPageUrl);\r\n // If there was a page already being timed, track the visit time for it now.\r\n if (prevPageVisitTimeData) {\r\n this.pageVisitTimeTrackingHandler(prevPageVisitTimeData.pageName, prevPageVisitTimeData.pageUrl, prevPageVisitTimeData.pageVisitTime);\r\n }\r\n }\r\n catch (e) {\r\n this._logger.warnToConsole(\"Auto track page visit time failed, metric will not be collected: \" + Util.dump(e));\r\n }\r\n };\r\n /**\r\n * Stops timing of current page (if exists) and starts timing for duration of visit to pageName\r\n * @param pageName Name of page to begin timing visit duration\r\n * @returns {PageVisitData} Page visit data (including duration) of pageName from last call to start or restart, if exists. Null if not.\r\n */\r\n PageVisitTimeManager.prototype.restartPageVisitTimer = function (pageName, pageUrl) {\r\n try {\r\n var prevPageVisitData = this.stopPageVisitTimer();\r\n this.startPageVisitTimer(pageName, pageUrl);\r\n return prevPageVisitData;\r\n }\r\n catch (e) {\r\n this._logger.warnToConsole(\"Call to restart failed: \" + Util.dump(e));\r\n return null;\r\n }\r\n };\r\n /**\r\n * Starts timing visit duration of pageName\r\n * @param pageName\r\n * @returns {}\r\n */\r\n PageVisitTimeManager.prototype.startPageVisitTimer = function (pageName, pageUrl) {\r\n try {\r\n if (Util.canUseSessionStorage()) {\r\n if (Util.getSessionStorage(this._logger, this.prevPageVisitDataKeyName) != null) {\r\n throw new Error(\"Cannot call startPageVisit consecutively without first calling stopPageVisit\");\r\n }\r\n var currPageVisitData = new PageVisitData(pageName, pageUrl);\r\n var currPageVisitDataStr = getJSON().stringify(currPageVisitData);\r\n Util.setSessionStorage(this._logger, this.prevPageVisitDataKeyName, currPageVisitDataStr);\r\n }\r\n }\r\n catch (e) {\r\n // TODO: Remove this catch in next phase, since if start is called twice in a row the exception needs to be propagated out\r\n this._logger.warnToConsole(\"Call to start failed: \" + Util.dump(e));\r\n }\r\n };\r\n /**\r\n * Stops timing of current page, if exists.\r\n * @returns {PageVisitData} Page visit data (including duration) of pageName from call to start, if exists. Null if not.\r\n */\r\n PageVisitTimeManager.prototype.stopPageVisitTimer = function () {\r\n try {\r\n if (Util.canUseSessionStorage()) {\r\n // Define end time of page's visit\r\n var pageVisitEndTime = Date.now();\r\n // Try to retrieve page name and start time from session storage\r\n var pageVisitDataJsonStr = Util.getSessionStorage(this._logger, this.prevPageVisitDataKeyName);\r\n if (pageVisitDataJsonStr && hasJSON()) {\r\n // if previous page data exists, set end time of visit\r\n var prevPageVisitData = getJSON().parse(pageVisitDataJsonStr);\r\n prevPageVisitData.pageVisitTime = pageVisitEndTime - prevPageVisitData.pageVisitStartTime;\r\n // Remove data from storage since we already used it\r\n Util.removeSessionStorage(this._logger, this.prevPageVisitDataKeyName);\r\n // Return page visit data\r\n return prevPageVisitData;\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n return null;\r\n }\r\n catch (e) {\r\n this._logger.warnToConsole(\"Stop page visit timer failed: \" + Util.dump(e));\r\n return null;\r\n }\r\n };\r\n return PageVisitTimeManager;\r\n}());\r\nexport { PageVisitTimeManager };\r\nvar PageVisitData = /** @class */ (function () {\r\n function PageVisitData(pageName, pageUrl) {\r\n this.pageVisitStartTime = Date.now();\r\n this.pageName = pageName;\r\n this.pageUrl = pageUrl;\r\n }\r\n return PageVisitData;\r\n}());\r\nexport { PageVisitData };\r\n//# sourceMappingURL=PageVisitTimeManager.js.map","/*!\n * Application Insights JavaScript SDK - Web Analytics, 2.5.4\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { Util, DateTimeUtils } from '@microsoft/applicationinsights-common';\r\nimport { LoggingSeverity, _InternalMessageId, getNavigator, getPerformance } from '@microsoft/applicationinsights-core-js';\r\n/**\r\n * Class encapsulates sending page view performance telemetry.\r\n */\r\nvar PageViewPerformanceManager = /** @class */ (function () {\r\n function PageViewPerformanceManager(core) {\r\n this.MAX_DURATION_ALLOWED = 3600000; // 1h\r\n if (core) {\r\n this._logger = core.logger;\r\n }\r\n }\r\n PageViewPerformanceManager.prototype.populatePageViewPerformanceEvent = function (pageViewPerformance) {\r\n pageViewPerformance.isValid = false;\r\n /*\r\n * http://www.w3.org/TR/navigation-timing/#processing-model\r\n * |-navigationStart\r\n * | |-connectEnd\r\n * | ||-requestStart\r\n * | || |-responseStart\r\n * | || | |-responseEnd\r\n * | || | |\r\n * | || | | |-loadEventEnd\r\n * |---network---||---request---|---response---|---dom---|\r\n * |--------------------------total----------------------|\r\n */\r\n var navigationTiming = this.getPerformanceNavigationTiming();\r\n var timing = this.getPerformanceTiming();\r\n if (navigationTiming || timing) {\r\n if (navigationTiming) {\r\n var total = navigationTiming.duration;\r\n var network = DateTimeUtils.GetDuration(navigationTiming.startTime, navigationTiming.connectEnd);\r\n var request = DateTimeUtils.GetDuration(navigationTiming.requestStart, navigationTiming.responseStart);\r\n var response = DateTimeUtils.GetDuration(navigationTiming.responseStart, navigationTiming.responseEnd);\r\n var dom = DateTimeUtils.GetDuration(navigationTiming.responseEnd, navigationTiming.loadEventEnd);\r\n }\r\n else {\r\n var total = DateTimeUtils.GetDuration(timing.navigationStart, timing.loadEventEnd);\r\n var network = DateTimeUtils.GetDuration(timing.navigationStart, timing.connectEnd);\r\n var request = DateTimeUtils.GetDuration(timing.requestStart, timing.responseStart);\r\n var response = DateTimeUtils.GetDuration(timing.responseStart, timing.responseEnd);\r\n var dom = DateTimeUtils.GetDuration(timing.responseEnd, timing.loadEventEnd);\r\n }\r\n if (total === 0) {\r\n this._logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.ErrorPVCalc, \"error calculating page view performance.\", { total: total, network: network, request: request, response: response, dom: dom });\r\n }\r\n else if (!this.shouldCollectDuration(total, network, request, response, dom)) {\r\n this._logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.InvalidDurationValue, \"Invalid page load duration value. Browser perf data won't be sent.\", { total: total, network: network, request: request, response: response, dom: dom });\r\n }\r\n else if (total < Math.floor(network) + Math.floor(request) + Math.floor(response) + Math.floor(dom)) {\r\n // some browsers may report individual components incorrectly so that the sum of the parts will be bigger than total PLT\r\n // in this case, don't report client performance from this page\r\n this._logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.ClientPerformanceMathError, \"client performance math error.\", { total: total, network: network, request: request, response: response, dom: dom });\r\n }\r\n else {\r\n pageViewPerformance.durationMs = total;\r\n // // convert to timespans\r\n pageViewPerformance.perfTotal = pageViewPerformance.duration = Util.msToTimeSpan(total);\r\n pageViewPerformance.networkConnect = Util.msToTimeSpan(network);\r\n pageViewPerformance.sentRequest = Util.msToTimeSpan(request);\r\n pageViewPerformance.receivedResponse = Util.msToTimeSpan(response);\r\n pageViewPerformance.domProcessing = Util.msToTimeSpan(dom);\r\n pageViewPerformance.isValid = true;\r\n }\r\n }\r\n };\r\n PageViewPerformanceManager.prototype.getPerformanceTiming = function () {\r\n if (this.isPerformanceTimingSupported()) {\r\n return getPerformance().timing;\r\n }\r\n return null;\r\n };\r\n PageViewPerformanceManager.prototype.getPerformanceNavigationTiming = function () {\r\n if (this.isPerformanceNavigationTimingSupported()) {\r\n return getPerformance().getEntriesByType(\"navigation\")[0];\r\n }\r\n return null;\r\n };\r\n /**\r\n * Returns true is window PerformanceNavigationTiming API is supported, false otherwise.\r\n */\r\n PageViewPerformanceManager.prototype.isPerformanceNavigationTimingSupported = function () {\r\n var perf = getPerformance();\r\n return perf && perf.getEntriesByType && perf.getEntriesByType(\"navigation\").length > 0;\r\n };\r\n /**\r\n * Returns true is window performance timing API is supported, false otherwise.\r\n */\r\n PageViewPerformanceManager.prototype.isPerformanceTimingSupported = function () {\r\n var perf = getPerformance();\r\n return perf && perf.timing;\r\n };\r\n /**\r\n * As page loads different parts of performance timing numbers get set. When all of them are set we can report it.\r\n * Returns true if ready, false otherwise.\r\n */\r\n PageViewPerformanceManager.prototype.isPerformanceTimingDataReady = function () {\r\n var perf = getPerformance();\r\n var timing = perf ? perf.timing : 0;\r\n return timing\r\n && timing.domainLookupStart > 0\r\n && timing.navigationStart > 0\r\n && timing.responseStart > 0\r\n && timing.requestStart > 0\r\n && timing.loadEventEnd > 0\r\n && timing.responseEnd > 0\r\n && timing.connectEnd > 0\r\n && timing.domLoading > 0;\r\n };\r\n /**\r\n * This method tells if given durations should be excluded from collection.\r\n */\r\n PageViewPerformanceManager.prototype.shouldCollectDuration = function () {\r\n var durations = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n durations[_i] = arguments[_i];\r\n }\r\n var _navigator = getNavigator() || {};\r\n // a full list of Google crawlers user agent strings - https://support.google.com/webmasters/answer/1061943?hl=en\r\n var botAgentNames = ['googlebot', 'adsbot-google', 'apis-google', 'mediapartners-google'];\r\n var userAgent = _navigator.userAgent;\r\n var isGoogleBot = false;\r\n if (userAgent) {\r\n for (var i = 0; i < botAgentNames.length; i++) {\r\n isGoogleBot = isGoogleBot || userAgent.toLowerCase().indexOf(botAgentNames[i]) !== -1;\r\n }\r\n }\r\n if (isGoogleBot) {\r\n // Don't report durations for GoogleBot, it is returning invalid values in performance.timing API.\r\n return false;\r\n }\r\n else {\r\n // for other page views, don't report if it's outside of a reasonable range\r\n for (var i = 0; i < durations.length; i++) {\r\n if (durations[i] >= this.MAX_DURATION_ALLOWED) {\r\n return false;\r\n }\r\n }\r\n }\r\n return true;\r\n };\r\n return PageViewPerformanceManager;\r\n}());\r\nexport { PageViewPerformanceManager };\r\n//# sourceMappingURL=PageViewPerformanceManager.js.map","/*!\n * Application Insights JavaScript SDK - Web Analytics, 2.5.4\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n/**\r\n * ApplicationInsights.ts\r\n * @copyright Microsoft 2018\r\n */\r\nimport * as tslib_1 from \"tslib\";\r\nimport { Util, PageViewPerformance, PageView, RemoteDependencyData, Event as EventTelemetry, TelemetryItemCreator, Metric, Exception, SeverityLevel, Trace, DateTimeUtils, PropertiesPluginIdentifier, AnalyticsPluginIdentifier } from \"@microsoft/applicationinsights-common\";\r\nimport { BaseTelemetryPlugin, CoreUtils, LoggingSeverity, _InternalMessageId, getWindow, getDocument, getHistory, getLocation } from \"@microsoft/applicationinsights-core-js\";\r\nimport { PageViewManager } from \"./Telemetry/PageViewManager\";\r\nimport { PageVisitTimeManager } from \"./Telemetry/PageVisitTimeManager\";\r\nimport { PageViewPerformanceManager } from './Telemetry/PageViewPerformanceManager';\r\n\"use strict\";\r\nvar durationProperty = \"duration\";\r\nfunction _dispatchEvent(target, evnt) {\r\n if (target && target.dispatchEvent && evnt) {\r\n target.dispatchEvent(evnt);\r\n }\r\n}\r\nvar ApplicationInsights = /** @class */ (function (_super) {\r\n tslib_1.__extends(ApplicationInsights, _super);\r\n function ApplicationInsights() {\r\n var _this = _super.call(this) || this;\r\n _this.identifier = AnalyticsPluginIdentifier; // do not change name or priority\r\n _this.priority = 180; // take from reserved priority range 100- 200\r\n _this.autoRoutePVDelay = 500; // ms; Time to wait after a route change before triggering a pageview to allow DOM changes to take place\r\n // Counts number of trackAjax invokations.\r\n // By default we only monitor X ajax call per view to avoid too much load.\r\n // Default value is set in config.\r\n // This counter keeps increasing even after the limit is reached.\r\n _this._trackAjaxAttempts = 0;\r\n var location = getLocation();\r\n _this._prevUri = location && location.href || \"\";\r\n return _this;\r\n }\r\n ApplicationInsights.getDefaultConfig = function (config) {\r\n if (!config) {\r\n config = {};\r\n }\r\n // set default values\r\n config.sessionRenewalMs = 30 * 60 * 1000;\r\n config.sessionExpirationMs = 24 * 60 * 60 * 1000;\r\n config.disableExceptionTracking = Util.stringToBoolOrDefault(config.disableExceptionTracking);\r\n config.autoTrackPageVisitTime = Util.stringToBoolOrDefault(config.autoTrackPageVisitTime);\r\n config.overridePageViewDuration = Util.stringToBoolOrDefault(config.overridePageViewDuration);\r\n config.enableUnhandledPromiseRejectionTracking = Util.stringToBoolOrDefault(config.enableUnhandledPromiseRejectionTracking);\r\n if (isNaN(config.samplingPercentage) || config.samplingPercentage <= 0 || config.samplingPercentage >= 100) {\r\n config.samplingPercentage = 100;\r\n }\r\n config.isCookieUseDisabled = Util.stringToBoolOrDefault(config.isCookieUseDisabled);\r\n config.isStorageUseDisabled = Util.stringToBoolOrDefault(config.isStorageUseDisabled);\r\n config.isBrowserLinkTrackingEnabled = Util.stringToBoolOrDefault(config.isBrowserLinkTrackingEnabled);\r\n config.enableAutoRouteTracking = Util.stringToBoolOrDefault(config.enableAutoRouteTracking);\r\n config.namePrefix = config.namePrefix || \"\";\r\n return config;\r\n };\r\n ApplicationInsights.prototype.processTelemetry = function (env, itemCtx) {\r\n var doNotSendItem = false;\r\n var telemetryInitializersCount = this._telemetryInitializers.length;\r\n itemCtx = this._getTelCtx(itemCtx);\r\n for (var i = 0; i < telemetryInitializersCount; ++i) {\r\n var telemetryInitializer = this._telemetryInitializers[i];\r\n if (telemetryInitializer) {\r\n try {\r\n if (telemetryInitializer.apply(null, [env]) === false) {\r\n doNotSendItem = true;\r\n break;\r\n }\r\n }\r\n catch (e) {\r\n // log error but dont stop executing rest of the telemetry initializers\r\n // doNotSendItem = true;\r\n itemCtx.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TelemetryInitializerFailed, \"One of telemetry initializers failed, telemetry item will not be sent: \" + Util.getExceptionName(e), { exception: Util.dump(e) }, true);\r\n }\r\n }\r\n }\r\n if (!doNotSendItem) {\r\n this.processNext(env, itemCtx);\r\n }\r\n };\r\n ApplicationInsights.prototype.trackEvent = function (event, customProperties) {\r\n try {\r\n var telemetryItem = TelemetryItemCreator.create(event, EventTelemetry.dataType, EventTelemetry.envelopeType, this.diagLog(), customProperties);\r\n this.core.track(telemetryItem);\r\n }\r\n catch (e) {\r\n this.diagLog().throwInternal(LoggingSeverity.WARNING, _InternalMessageId.TrackTraceFailed, \"trackTrace failed, trace will not be collected: \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n };\r\n /**\r\n * Start timing an extended event. Call `stopTrackEvent` to log the event when it ends.\r\n * @param name A string that identifies this event uniquely within the document.\r\n */\r\n ApplicationInsights.prototype.startTrackEvent = function (name) {\r\n try {\r\n this._eventTracking.start(name);\r\n }\r\n catch (e) {\r\n this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.StartTrackEventFailed, \"startTrackEvent failed, event will not be collected: \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n };\r\n /**\r\n * Log an extended event that you started timing with `startTrackEvent`.\r\n * @param name The string you used to identify this event in `startTrackEvent`.\r\n * @param properties map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty.\r\n * @param measurements map[string, number] - metrics associated with this event, displayed in Metrics Explorer on the portal. Defaults to empty.\r\n */\r\n ApplicationInsights.prototype.stopTrackEvent = function (name, properties, measurements) {\r\n try {\r\n this._eventTracking.stop(name, undefined, properties); // Todo: Fix to pass measurements once type is updated\r\n }\r\n catch (e) {\r\n this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.StopTrackEventFailed, \"stopTrackEvent failed, event will not be collected: \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n };\r\n /**\r\n * @description Log a diagnostic message\r\n * @param {ITraceTelemetry} trace\r\n * @param ICustomProperties.\r\n * @memberof ApplicationInsights\r\n */\r\n ApplicationInsights.prototype.trackTrace = function (trace, customProperties) {\r\n try {\r\n var telemetryItem = TelemetryItemCreator.create(trace, Trace.dataType, Trace.envelopeType, this.diagLog(), customProperties);\r\n this.core.track(telemetryItem);\r\n }\r\n catch (e) {\r\n this.diagLog().throwInternal(LoggingSeverity.WARNING, _InternalMessageId.TrackTraceFailed, \"trackTrace failed, trace will not be collected: \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n };\r\n /**\r\n * @description Log a numeric value that is not associated with a specific event. Typically\r\n * used to send regular reports of performance indicators. To send single measurement, just\r\n * use the name and average fields of {@link IMetricTelemetry}. If you take measurements\r\n * frequently, you can reduce the telemetry bandwidth by aggregating multiple measurements\r\n * and sending the resulting average at intervals\r\n * @param {IMetricTelemetry} metric input object argument. Only name and average are mandatory.\r\n * @param {{[key: string]: any}} customProperties additional data used to filter metrics in the\r\n * portal. Defaults to empty.\r\n * @memberof ApplicationInsights\r\n */\r\n ApplicationInsights.prototype.trackMetric = function (metric, customProperties) {\r\n try {\r\n var telemetryItem = TelemetryItemCreator.create(metric, Metric.dataType, Metric.envelopeType, this.diagLog(), customProperties);\r\n this.core.track(telemetryItem);\r\n }\r\n catch (e) {\r\n this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TrackMetricFailed, \"trackMetric failed, metric will not be collected: \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n };\r\n /**\r\n * Logs that a page or other item was viewed.\r\n * @param IPageViewTelemetry The string you used as the name in startTrackPage. Defaults to the document title.\r\n * @param customProperties Additional data used to filter events and metrics. Defaults to empty.\r\n * If a user wants to provide duration for pageLoad, it'll have to be in pageView.properties.duration\r\n */\r\n ApplicationInsights.prototype.trackPageView = function (pageView, customProperties) {\r\n try {\r\n var inPv = pageView || {};\r\n this._pageViewManager.trackPageView(inPv, tslib_1.__assign({}, inPv.properties, inPv.measurements, customProperties));\r\n if (this.config.autoTrackPageVisitTime) {\r\n this._pageVisitTimeManager.trackPreviousPageVisit(inPv.name, inPv.uri);\r\n }\r\n }\r\n catch (e) {\r\n this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TrackPVFailed, \"trackPageView failed, page view will not be collected: \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n };\r\n /**\r\n * Create a page view telemetry item and send it to the SDK pipeline through the core.track API\r\n * @param pageView Page view item to be sent\r\n * @param properties Custom properties (Part C) that a user can add to the telemetry item\r\n * @param systemProperties System level properties (Part A) that a user can add to the telemetry item\r\n */\r\n ApplicationInsights.prototype.sendPageViewInternal = function (pageView, properties, systemProperties) {\r\n var doc = getDocument();\r\n if (doc) {\r\n pageView.refUri = pageView.refUri === undefined ? doc.referrer : pageView.refUri;\r\n }\r\n var telemetryItem = TelemetryItemCreator.create(pageView, PageView.dataType, PageView.envelopeType, this.diagLog(), properties, systemProperties);\r\n this.core.track(telemetryItem);\r\n // reset ajaxes counter\r\n this._trackAjaxAttempts = 0;\r\n };\r\n /**\r\n * @ignore INTERNAL ONLY\r\n * @param pageViewPerformance\r\n * @param properties\r\n */\r\n ApplicationInsights.prototype.sendPageViewPerformanceInternal = function (pageViewPerformance, properties, systemProperties) {\r\n var telemetryItem = TelemetryItemCreator.create(pageViewPerformance, PageViewPerformance.dataType, PageViewPerformance.envelopeType, this.diagLog(), properties, systemProperties);\r\n this.core.track(telemetryItem);\r\n };\r\n /**\r\n * Send browser performance metrics.\r\n * @param pageViewPerformance\r\n * @param customProperties\r\n */\r\n ApplicationInsights.prototype.trackPageViewPerformance = function (pageViewPerformance, customProperties) {\r\n try {\r\n this._pageViewPerformanceManager.populatePageViewPerformanceEvent(pageViewPerformance);\r\n this.sendPageViewPerformanceInternal(pageViewPerformance, customProperties);\r\n }\r\n catch (e) {\r\n this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TrackPVFailed, \"trackPageViewPerformance failed, page view will not be collected: \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n };\r\n /**\r\n * Starts the timer for tracking a page load time. Use this instead of `trackPageView` if you want to control when the page view timer starts and stops,\r\n * but don't want to calculate the duration yourself. This method doesn't send any telemetry. Call `stopTrackPage` to log the end of the page view\r\n * and send the event.\r\n * @param name A string that idenfities this item, unique within this HTML document. Defaults to the document title.\r\n */\r\n ApplicationInsights.prototype.startTrackPage = function (name) {\r\n try {\r\n if (typeof name !== \"string\") {\r\n var doc = getDocument();\r\n name = doc && doc.title || \"\";\r\n }\r\n this._pageTracking.start(name);\r\n }\r\n catch (e) {\r\n this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.StartTrackFailed, \"startTrackPage failed, page view may not be collected: \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n };\r\n /**\r\n * Stops the timer that was started by calling `startTrackPage` and sends the pageview load time telemetry with the specified properties and measurements.\r\n * The duration of the page view will be the time between calling `startTrackPage` and `stopTrackPage`.\r\n * @param name The string you used as the name in startTrackPage. Defaults to the document title.\r\n * @param url String - a relative or absolute URL that identifies the page or other item. Defaults to the window location.\r\n * @param properties map[string, string] - additional data used to filter pages and metrics in the portal. Defaults to empty.\r\n * @param measurements map[string, number] - metrics associated with this page, displayed in Metrics Explorer on the portal. Defaults to empty.\r\n */\r\n ApplicationInsights.prototype.stopTrackPage = function (name, url, properties, measurement) {\r\n try {\r\n if (typeof name !== \"string\") {\r\n var doc = getDocument();\r\n name = doc && doc.title || \"\";\r\n }\r\n if (typeof url !== \"string\") {\r\n var loc = getLocation();\r\n url = loc && loc.href || \"\";\r\n }\r\n this._pageTracking.stop(name, url, properties, measurement);\r\n if (this.config.autoTrackPageVisitTime) {\r\n this._pageVisitTimeManager.trackPreviousPageVisit(name, url);\r\n }\r\n }\r\n catch (e) {\r\n this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.StopTrackFailed, \"stopTrackPage failed, page view will not be collected: \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n };\r\n /**\r\n * @ignore INTERNAL ONLY\r\n * @param exception\r\n * @param properties\r\n * @param systemProperties\r\n */\r\n ApplicationInsights.prototype.sendExceptionInternal = function (exception, customProperties, systemProperties) {\r\n var exceptionPartB = new Exception(this.diagLog(), exception.exception || new Error(Util.NotSpecified), exception.properties, exception.measurements, exception.severityLevel, exception.id).toInterface();\r\n var telemetryItem = TelemetryItemCreator.create(exceptionPartB, Exception.dataType, Exception.envelopeType, this.diagLog(), customProperties, systemProperties);\r\n this.core.track(telemetryItem);\r\n };\r\n /**\r\n * Log an exception you have caught.\r\n *\r\n * @param {IExceptionTelemetry} exception Object which contains exception to be sent\r\n * @param {{[key: string]: any}} customProperties Additional data used to filter pages and metrics in the portal. Defaults to empty.\r\n *\r\n * Any property of type double will be considered a measurement, and will be treated by Application Insights as a metric.\r\n * @memberof ApplicationInsights\r\n */\r\n ApplicationInsights.prototype.trackException = function (exception, customProperties) {\r\n try {\r\n this.sendExceptionInternal(exception, customProperties);\r\n }\r\n catch (e) {\r\n this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TrackExceptionFailed, \"trackException failed, exception will not be collected: \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n };\r\n /**\r\n * @description Custom error handler for Application Insights Analytics\r\n * @param {IAutoExceptionTelemetry} exception\r\n * @memberof ApplicationInsights\r\n */\r\n ApplicationInsights.prototype._onerror = function (exception) {\r\n try {\r\n var properties_1 = {\r\n url: (exception && exception.url) || (getDocument() || {}).URL,\r\n lineNumber: exception.lineNumber,\r\n columnNumber: exception.columnNumber,\r\n message: exception.message\r\n };\r\n if (Util.isCrossOriginError(exception.message, exception.url, exception.lineNumber, exception.columnNumber, exception.error)) {\r\n this._sendCORSException(properties_1.url);\r\n }\r\n else {\r\n if (!Util.isError(exception.error)) {\r\n var stack = \"window.onerror@\" + properties_1.url + \":\" + exception.lineNumber + \":\" + (exception.columnNumber || 0);\r\n exception.error = new Error(exception.message);\r\n exception.error.stack = stack;\r\n }\r\n this.trackException({ exception: exception.error, severityLevel: SeverityLevel.Error }, properties_1);\r\n }\r\n }\r\n catch (e) {\r\n var errorString = exception.error ?\r\n (exception.error.name + \", \" + exception.error.message)\r\n : \"null\";\r\n this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.ExceptionWhileLoggingError, \"_onError threw exception while logging error, error will not be collected: \"\r\n + Util.getExceptionName(e), { exception: Util.dump(e), errorString: errorString });\r\n }\r\n };\r\n ApplicationInsights.prototype.addTelemetryInitializer = function (telemetryInitializer) {\r\n this._telemetryInitializers.push(telemetryInitializer);\r\n };\r\n ApplicationInsights.prototype.initialize = function (config, core, extensions, pluginChain) {\r\n var _this = this;\r\n if (this.isInitialized()) {\r\n return;\r\n }\r\n if (CoreUtils.isNullOrUndefined(core)) {\r\n throw Error(\"Error initializing\");\r\n }\r\n _super.prototype.initialize.call(this, config, core, extensions, pluginChain);\r\n this.setInitialized(false); // resetting the initialized state, just in case the following fails\r\n var ctx = this._getTelCtx();\r\n var identifier = this.identifier;\r\n this._globalconfig = {\r\n instrumentationKey: config.instrumentationKey,\r\n endpointUrl: config.endpointUrl || \"https://dc.services.visualstudio.com/v2/track\"\r\n };\r\n this.config = ctx.getExtCfg(identifier);\r\n // load default values if specified\r\n var defaults = ApplicationInsights.getDefaultConfig();\r\n if (defaults !== undefined) {\r\n for (var field in defaults) {\r\n // for each unspecified field, set the default value\r\n this.config[field] = ctx.getConfig(identifier, field, defaults[field]);\r\n }\r\n if (this._globalconfig) {\r\n for (var field in defaults) {\r\n if (this._globalconfig[field] === undefined) {\r\n this._globalconfig[field] = defaults[field];\r\n }\r\n }\r\n }\r\n }\r\n // Todo: move this out of static state\r\n if (this.config.isCookieUseDisabled) {\r\n Util.disableCookies();\r\n }\r\n // Todo: move this out of static state\r\n if (this.config.isStorageUseDisabled) {\r\n Util.disableStorage();\r\n }\r\n var configGetters = {\r\n instrumentationKey: function () { return config.instrumentationKey; },\r\n accountId: function () { return _this.config.accountId || config.accountId; },\r\n sessionRenewalMs: function () { return _this.config.sessionRenewalMs || config.sessionRenewalMs; },\r\n sessionExpirationMs: function () { return _this.config.sessionExpirationMs || config.sessionExpirationMs; },\r\n sampleRate: function () { return _this.config.samplingPercentage || config.samplingPercentage; },\r\n cookieDomain: function () { return _this.config.cookieDomain || config.cookieDomain; },\r\n sdkExtension: function () { return _this.config.sdkExtension || config.sdkExtension; },\r\n isBrowserLinkTrackingEnabled: function () { return _this.config.isBrowserLinkTrackingEnabled || config.isBrowserLinkTrackingEnabled; },\r\n appId: function () { return _this.config.appId || config.appId; }\r\n };\r\n this._pageViewPerformanceManager = new PageViewPerformanceManager(this.core);\r\n this._pageViewManager = new PageViewManager(this, this.config.overridePageViewDuration, this.core, this._pageViewPerformanceManager);\r\n this._pageVisitTimeManager = new PageVisitTimeManager(this.diagLog(), function (pageName, pageUrl, pageVisitTime) { return _this.trackPageVisitTime(pageName, pageUrl, pageVisitTime); });\r\n this._telemetryInitializers = this._telemetryInitializers || [];\r\n this._addDefaultTelemetryInitializers(configGetters);\r\n this._eventTracking = new Timing(this.diagLog(), \"trackEvent\");\r\n this._eventTracking.action =\r\n function (name, url, duration, properties) {\r\n if (!properties) {\r\n properties = {};\r\n }\r\n properties[durationProperty] = duration.toString();\r\n _this.trackEvent({ name: name, properties: properties });\r\n };\r\n // initialize page view timing\r\n this._pageTracking = new Timing(this.diagLog(), \"trackPageView\");\r\n this._pageTracking.action = function (name, url, duration, properties, measurements) {\r\n // duration must be a custom property in order for the collector to extract it\r\n if (CoreUtils.isNullOrUndefined(properties)) {\r\n properties = {};\r\n }\r\n properties[durationProperty] = duration.toString();\r\n var pageViewItem = {\r\n name: name,\r\n uri: url,\r\n properties: properties,\r\n measurements: measurements\r\n };\r\n _this.sendPageViewInternal(pageViewItem, properties);\r\n };\r\n var _window = getWindow();\r\n var _history = getHistory();\r\n var _location = getLocation();\r\n var instance = this;\r\n if (this.config.disableExceptionTracking === false &&\r\n !this.config.autoExceptionInstrumented && _window) {\r\n // We want to enable exception auto collection and it has not been done so yet\r\n var onerror_1 = \"onerror\";\r\n var originalOnError_1 = _window[onerror_1];\r\n _window.onerror = function (message, url, lineNumber, columnNumber, error) {\r\n var handled = originalOnError_1 && originalOnError_1(message, url, lineNumber, columnNumber, error);\r\n if (handled !== true) {\r\n instance._onerror({\r\n message: message,\r\n url: url,\r\n lineNumber: lineNumber,\r\n columnNumber: columnNumber,\r\n error: error\r\n });\r\n }\r\n return handled;\r\n };\r\n this.config.autoExceptionInstrumented = true;\r\n }\r\n if (this.config.disableExceptionTracking === false &&\r\n this.config.enableUnhandledPromiseRejectionTracking === true &&\r\n !this.config.autoUnhandledPromiseInstrumented && _window) {\r\n // We want to enable exception auto collection and it has not been done so yet\r\n var onunhandledrejection = \"onunhandledrejection\";\r\n var originalOnUnhandledRejection_1 = _window[onunhandledrejection];\r\n _window[onunhandledrejection] = function (error) {\r\n var handled = originalOnUnhandledRejection_1 && originalOnUnhandledRejection_1.call(_window, error);\r\n if (handled !== true) {\r\n instance._onerror({\r\n message: error.reason.toString(),\r\n error: error.reason instanceof Error ? error.reason : new Error(error.reason.toString()),\r\n url: _location ? _location.href : \"\",\r\n lineNumber: 0,\r\n columnNumber: 0\r\n });\r\n }\r\n return handled;\r\n };\r\n this.config.autoUnhandledPromiseInstrumented = true;\r\n }\r\n /**\r\n * Create a custom \"locationchange\" event which is triggered each time the history object is changed\r\n */\r\n if (this.config.enableAutoRouteTracking === true\r\n && _history && CoreUtils.isFunction(_history.pushState) && CoreUtils.isFunction(_history.replaceState)\r\n && _window\r\n && typeof Event !== \"undefined\") {\r\n var _self_1 = this;\r\n // Find the properties plugin\r\n CoreUtils.arrForEach(extensions, function (extension) {\r\n if (extension.identifier === PropertiesPluginIdentifier) {\r\n _this._properties = extension;\r\n }\r\n });\r\n _history.pushState = (function (f) { return function pushState() {\r\n var ret = f.apply(this, arguments);\r\n _dispatchEvent(_window, Util.createDomEvent(_self_1.config.namePrefix + \"pushState\"));\r\n _dispatchEvent(_window, Util.createDomEvent(_self_1.config.namePrefix + \"locationchange\"));\r\n return ret;\r\n }; })(_history.pushState);\r\n _history.replaceState = (function (f) { return function replaceState() {\r\n var ret = f.apply(this, arguments);\r\n _dispatchEvent(_window, Util.createDomEvent(_self_1.config.namePrefix + \"replaceState\"));\r\n _dispatchEvent(_window, Util.createDomEvent(_self_1.config.namePrefix + \"locationchange\"));\r\n return ret;\r\n }; })(_history.replaceState);\r\n if (_window.addEventListener) {\r\n _window.addEventListener(_self_1.config.namePrefix + \"popstate\", function () {\r\n _dispatchEvent(_window, Util.createDomEvent(_self_1.config.namePrefix + \"locationchange\"));\r\n });\r\n _window.addEventListener(_self_1.config.namePrefix + \"locationchange\", function () {\r\n if (_self_1._properties && _self_1._properties.context && _self_1._properties.context.telemetryTrace) {\r\n _self_1._properties.context.telemetryTrace.traceID = Util.generateW3CId();\r\n _self_1._properties.context.telemetryTrace.name = _location && _location.pathname || \"_unknown_\";\r\n }\r\n if (_this._currUri) {\r\n _this._prevUri = _this._currUri;\r\n _this._currUri = _location && _location.href || \"\";\r\n }\r\n else {\r\n _this._currUri = _location && _location.href || \"\";\r\n }\r\n setTimeout((function (uri) {\r\n // todo: override start time so that it is not affected by autoRoutePVDelay\r\n _self_1.trackPageView({ refUri: uri, properties: { duration: 0 } }); // SPA route change loading durations are undefined, so send 0\r\n }).bind(_this, _this._prevUri), _self_1.autoRoutePVDelay);\r\n });\r\n }\r\n }\r\n this.setInitialized(true);\r\n };\r\n /**\r\n * Log a page visit time\r\n * @param pageName Name of page\r\n * @param pageVisitDuration Duration of visit to the page in milleseconds\r\n */\r\n ApplicationInsights.prototype.trackPageVisitTime = function (pageName, pageUrl, pageVisitTime) {\r\n var properties = { PageName: pageName, PageUrl: pageUrl };\r\n this.trackMetric({\r\n name: \"PageVisitTime\",\r\n average: pageVisitTime,\r\n max: pageVisitTime,\r\n min: pageVisitTime,\r\n sampleCount: 1\r\n }, properties);\r\n };\r\n ApplicationInsights.prototype._addDefaultTelemetryInitializers = function (configGetters) {\r\n if (!configGetters.isBrowserLinkTrackingEnabled()) {\r\n var browserLinkPaths_1 = ['/browserLinkSignalR/', '/__browserLink/'];\r\n var dropBrowserLinkRequests = function (envelope) {\r\n if (envelope.baseType === RemoteDependencyData.dataType) {\r\n var remoteData = envelope.baseData;\r\n if (remoteData) {\r\n for (var i = 0; i < browserLinkPaths_1.length; i++) {\r\n if (remoteData.target && remoteData.target.indexOf(browserLinkPaths_1[i]) >= 0) {\r\n return false;\r\n }\r\n }\r\n }\r\n }\r\n return true;\r\n };\r\n this._addTelemetryInitializer(dropBrowserLinkRequests);\r\n }\r\n };\r\n ApplicationInsights.prototype._addTelemetryInitializer = function (telemetryInitializer) {\r\n this._telemetryInitializers.push(telemetryInitializer);\r\n };\r\n ApplicationInsights.prototype._sendCORSException = function (url) {\r\n var exception = {\r\n message: \"Script error: The browser's same-origin policy prevents us from getting the details of this exception. Consider using the 'crossorigin' attribute.\",\r\n url: url,\r\n lineNumber: 0,\r\n columnNumber: 0,\r\n error: undefined\r\n };\r\n var telemetryItem = TelemetryItemCreator.create(exception, Exception.dataType, Exception.envelopeType, this.diagLog(), { url: url });\r\n this.core.track(telemetryItem);\r\n };\r\n ApplicationInsights.Version = \"2.5.4\"; // Not currently used anywhere\r\n return ApplicationInsights;\r\n}(BaseTelemetryPlugin));\r\nexport { ApplicationInsights };\r\n/**\r\n * Used to record timed events and page views.\r\n */\r\nvar Timing = /** @class */ (function () {\r\n function Timing(logger, name) {\r\n this._name = name;\r\n this._events = {};\r\n this._logger = logger;\r\n }\r\n Timing.prototype.start = function (name) {\r\n if (typeof this._events[name] !== \"undefined\") {\r\n this._logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.StartCalledMoreThanOnce, \"start was called more than once for this event without calling stop.\", { name: this._name, key: name }, true);\r\n }\r\n this._events[name] = +new Date;\r\n };\r\n Timing.prototype.stop = function (name, url, properties, measurements) {\r\n var start = this._events[name];\r\n if (isNaN(start)) {\r\n this._logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.StopCalledWithoutStart, \"stop was called without a corresponding start.\", { name: this._name, key: name }, true);\r\n }\r\n else {\r\n var end = +new Date;\r\n var duration = DateTimeUtils.GetDuration(start, end);\r\n this.action(name, url, duration, properties, measurements);\r\n }\r\n delete this._events[name];\r\n this._events[name] = undefined;\r\n };\r\n return Timing;\r\n}());\r\n//# sourceMappingURL=ApplicationInsights.js.map","import { Util } from '@microsoft/applicationinsights-common';\r\nimport { LoggingSeverity, _InternalMessageId, getJSON } from '@microsoft/applicationinsights-core-js';\r\n/*\r\n * An array based send buffer.\r\n */\r\nvar ArraySendBuffer = /** @class */ (function () {\r\n function ArraySendBuffer(config) {\r\n this._config = config;\r\n this._buffer = [];\r\n }\r\n ArraySendBuffer.prototype.enqueue = function (payload) {\r\n this._buffer.push(payload);\r\n };\r\n ArraySendBuffer.prototype.count = function () {\r\n return this._buffer.length;\r\n };\r\n ArraySendBuffer.prototype.clear = function () {\r\n this._buffer.length = 0;\r\n };\r\n ArraySendBuffer.prototype.getItems = function () {\r\n return this._buffer.slice(0);\r\n };\r\n ArraySendBuffer.prototype.batchPayloads = function (payload) {\r\n if (payload && payload.length > 0) {\r\n var batch = this._config.emitLineDelimitedJson() ?\r\n payload.join(\"\\n\") :\r\n \"[\" + payload.join(\",\") + \"]\";\r\n return batch;\r\n }\r\n return null;\r\n };\r\n ArraySendBuffer.prototype.markAsSent = function (payload) {\r\n this.clear();\r\n };\r\n ArraySendBuffer.prototype.clearSent = function (payload) {\r\n // not supported\r\n };\r\n return ArraySendBuffer;\r\n}());\r\nexport { ArraySendBuffer };\r\n/*\r\n * Session storege buffer holds a copy of all unsent items in the browser session storage.\r\n */\r\nvar SessionStorageSendBuffer = /** @class */ (function () {\r\n function SessionStorageSendBuffer(logger, config) {\r\n this._bufferFullMessageSent = false;\r\n this._logger = logger;\r\n this._config = config;\r\n var bufferItems = this.getBuffer(SessionStorageSendBuffer.BUFFER_KEY);\r\n var notDeliveredItems = this.getBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY);\r\n this._buffer = bufferItems.concat(notDeliveredItems);\r\n // If the buffer has too many items, drop items from the end.\r\n if (this._buffer.length > SessionStorageSendBuffer.MAX_BUFFER_SIZE) {\r\n this._buffer.length = SessionStorageSendBuffer.MAX_BUFFER_SIZE;\r\n }\r\n // update DataLossAnalyzer with the number of recovered items\r\n // Uncomment if you want to use DataLossanalyzer\r\n // DataLossAnalyzer.itemsRestoredFromSessionBuffer = this._buffer.length;\r\n this.setBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY, []);\r\n this.setBuffer(SessionStorageSendBuffer.BUFFER_KEY, this._buffer);\r\n }\r\n SessionStorageSendBuffer.prototype.enqueue = function (payload) {\r\n if (this._buffer.length >= SessionStorageSendBuffer.MAX_BUFFER_SIZE) {\r\n // sent internal log only once per page view\r\n if (!this._bufferFullMessageSent) {\r\n this._logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.SessionStorageBufferFull, \"Maximum buffer size reached: \" + this._buffer.length, true);\r\n this._bufferFullMessageSent = true;\r\n }\r\n return;\r\n }\r\n this._buffer.push(payload);\r\n this.setBuffer(SessionStorageSendBuffer.BUFFER_KEY, this._buffer);\r\n };\r\n SessionStorageSendBuffer.prototype.count = function () {\r\n return this._buffer.length;\r\n };\r\n SessionStorageSendBuffer.prototype.clear = function () {\r\n this._buffer.length = 0;\r\n this.setBuffer(SessionStorageSendBuffer.BUFFER_KEY, []);\r\n this.setBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY, []);\r\n this._bufferFullMessageSent = false;\r\n };\r\n SessionStorageSendBuffer.prototype.getItems = function () {\r\n return this._buffer.slice(0);\r\n };\r\n SessionStorageSendBuffer.prototype.batchPayloads = function (payload) {\r\n if (payload && payload.length > 0) {\r\n var batch = this._config.emitLineDelimitedJson() ?\r\n payload.join(\"\\n\") :\r\n \"[\" + payload.join(\",\") + \"]\";\r\n return batch;\r\n }\r\n return null;\r\n };\r\n SessionStorageSendBuffer.prototype.markAsSent = function (payload) {\r\n this._buffer = this.removePayloadsFromBuffer(payload, this._buffer);\r\n this.setBuffer(SessionStorageSendBuffer.BUFFER_KEY, this._buffer);\r\n var sentElements = this.getBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY);\r\n if (sentElements instanceof Array && payload instanceof Array) {\r\n sentElements = sentElements.concat(payload);\r\n if (sentElements.length > SessionStorageSendBuffer.MAX_BUFFER_SIZE) {\r\n // We send telemetry normally. If the SENT_BUFFER is too big we don't add new elements\r\n // until we receive a response from the backend and the buffer has free space again (see clearSent method)\r\n this._logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.SessionStorageBufferFull, \"Sent buffer reached its maximum size: \" + sentElements.length, true);\r\n sentElements.length = SessionStorageSendBuffer.MAX_BUFFER_SIZE;\r\n }\r\n this.setBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY, sentElements);\r\n }\r\n };\r\n SessionStorageSendBuffer.prototype.clearSent = function (payload) {\r\n var sentElements = this.getBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY);\r\n sentElements = this.removePayloadsFromBuffer(payload, sentElements);\r\n this.setBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY, sentElements);\r\n };\r\n SessionStorageSendBuffer.prototype.removePayloadsFromBuffer = function (payloads, buffer) {\r\n var remaining = [];\r\n for (var i in buffer) {\r\n var contains = false;\r\n for (var j in payloads) {\r\n if (payloads[j] === buffer[i]) {\r\n contains = true;\r\n break;\r\n }\r\n }\r\n if (!contains) {\r\n remaining.push(buffer[i]);\r\n }\r\n }\r\n ;\r\n return remaining;\r\n };\r\n SessionStorageSendBuffer.prototype.getBuffer = function (key) {\r\n var prefixedKey = key;\r\n try {\r\n prefixedKey = this._config.namePrefix && this._config.namePrefix() ? this._config.namePrefix() + \"_\" + prefixedKey : prefixedKey;\r\n var bufferJson = Util.getSessionStorage(this._logger, prefixedKey);\r\n if (bufferJson) {\r\n var buffer = getJSON().parse(bufferJson);\r\n if (buffer) {\r\n return buffer;\r\n }\r\n }\r\n }\r\n catch (e) {\r\n this._logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.FailedToRestoreStorageBuffer, \" storage key: \" + prefixedKey + \", \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n return [];\r\n };\r\n SessionStorageSendBuffer.prototype.setBuffer = function (key, buffer) {\r\n var prefixedKey = key;\r\n try {\r\n prefixedKey = this._config.namePrefix && this._config.namePrefix() ? this._config.namePrefix() + \"_\" + prefixedKey : prefixedKey;\r\n var bufferJson = JSON.stringify(buffer);\r\n Util.setSessionStorage(this._logger, prefixedKey, bufferJson);\r\n }\r\n catch (e) {\r\n // if there was an error, clear the buffer\r\n // telemetry is stored in the _buffer array so we won't loose any items\r\n Util.setSessionStorage(this._logger, prefixedKey, JSON.stringify([]));\r\n this._logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.FailedToSetStorageBuffer, \" storage key: \" + prefixedKey + \", \" + Util.getExceptionName(e) + \". Buffer cleared\", { exception: Util.dump(e) });\r\n }\r\n };\r\n SessionStorageSendBuffer.BUFFER_KEY = \"AI_buffer\";\r\n SessionStorageSendBuffer.SENT_BUFFER_KEY = \"AI_sentBuffer\";\r\n // Maximum number of payloads stored in the buffer. If the buffer is full, new elements will be dropped.\r\n SessionStorageSendBuffer.MAX_BUFFER_SIZE = 2000;\r\n return SessionStorageSendBuffer;\r\n}());\r\nexport { SessionStorageSendBuffer };\r\n//# sourceMappingURL=SendBuffer.js.map","import * as tslib_1 from \"tslib\";\r\nimport { Data, Envelope, RemoteDependencyData, Event, Exception, Metric, PageView, Trace, PageViewPerformance, CtxTagKeys, HttpMethod, SampleRate } from '@microsoft/applicationinsights-common';\r\nimport { CoreUtils, LoggingSeverity, _InternalMessageId, hasJSON, getJSON } from '@microsoft/applicationinsights-core-js';\r\n// these two constants are used to filter out properties not needed when trying to extract custom properties and measurements from the incoming payload\r\nvar baseType = \"baseType\";\r\nvar baseData = \"baseData\";\r\nvar EnvelopeCreator = /** @class */ (function () {\r\n function EnvelopeCreator() {\r\n }\r\n EnvelopeCreator.extractPropsAndMeasurements = function (data, properties, measurements) {\r\n if (!CoreUtils.isNullOrUndefined(data)) {\r\n for (var key in data) {\r\n if (data.hasOwnProperty(key)) {\r\n var value = data[key];\r\n if (CoreUtils.isNumber(value)) {\r\n measurements[key] = value;\r\n }\r\n else if (CoreUtils.isString(value)) {\r\n properties[key] = value;\r\n }\r\n else if (hasJSON()) {\r\n properties[key] = getJSON().stringify(value);\r\n }\r\n }\r\n }\r\n }\r\n };\r\n // TODO: Do we want this to take logger as arg or use this._logger as nonstatic?\r\n EnvelopeCreator.createEnvelope = function (logger, envelopeType, telemetryItem, data) {\r\n var envelope = new Envelope(logger, data, envelopeType);\r\n if (telemetryItem[SampleRate]) {\r\n envelope.sampleRate = telemetryItem[SampleRate];\r\n }\r\n envelope.iKey = telemetryItem.iKey;\r\n var iKeyNoDashes = telemetryItem.iKey.replace(/-/g, \"\");\r\n envelope.name = envelope.name.replace(\"{0}\", iKeyNoDashes);\r\n // extract all extensions from ctx\r\n EnvelopeCreator.extractPartAExtensions(telemetryItem, envelope);\r\n // loop through the envelope tags (extension of Part A) and pick out the ones that should go in outgoing envelope tags\r\n if (!telemetryItem.tags) {\r\n telemetryItem.tags = [];\r\n }\r\n return envelope;\r\n };\r\n /*\r\n * Maps Part A data from CS 4.0\r\n */\r\n EnvelopeCreator.extractPartAExtensions = function (item, env) {\r\n // todo: switch to keys from common in this method\r\n if (!env.tags) {\r\n env.tags = {};\r\n }\r\n if (!item.ext) {\r\n item.ext = {};\r\n }\r\n if (!item.tags) {\r\n item.tags = [];\r\n }\r\n if (item.ext.user) {\r\n if (item.ext.user.authId) {\r\n env.tags[CtxTagKeys.userAuthUserId] = item.ext.user.authId;\r\n }\r\n var userId = item.ext.user.id || item.ext.user.localId;\r\n if (userId) {\r\n env.tags[CtxTagKeys.userId] = userId;\r\n }\r\n }\r\n if (item.ext.app) {\r\n if (item.ext.app.sesId) {\r\n env.tags[CtxTagKeys.sessionId] = item.ext.app.sesId;\r\n }\r\n }\r\n if (item.ext.device) {\r\n if (item.ext.device.id || item.ext.device.localId) {\r\n env.tags[CtxTagKeys.deviceId] = item.ext.device.id || item.ext.device.localId;\r\n }\r\n if (item.ext.device.deviceClass) {\r\n env.tags[CtxTagKeys.deviceType] = item.ext.device.deviceClass;\r\n }\r\n if (item.ext.device.ip) {\r\n env.tags[CtxTagKeys.deviceIp] = item.ext.device.ip;\r\n }\r\n }\r\n if (item.ext.web) {\r\n var web = item.ext.web;\r\n if (web.browserLang) {\r\n env.tags[CtxTagKeys.deviceLanguage] = web.browserLang;\r\n }\r\n if (web.browserVer) {\r\n env.tags[CtxTagKeys.deviceBrowserVersion] = web.browserVer;\r\n }\r\n if (web.browser) {\r\n env.tags[CtxTagKeys.deviceBrowser] = web.browser;\r\n }\r\n env.data = env.data || {};\r\n env.data.baseData = env.data.baseData || {};\r\n env.data.baseData.properties = env.data.baseData.properties || {};\r\n if (web.domain) {\r\n env.data.baseData.properties['domain'] = web.domain;\r\n }\r\n if (web.isManual) {\r\n env.data.baseData.properties['isManual'] = web.isManual.toString();\r\n }\r\n if (web.screenRes) {\r\n env.data.baseData.properties['screenRes'] = web.screenRes;\r\n }\r\n if (web.userConsent) {\r\n env.data.baseData.properties['userConsent'] = web.userConsent.toString();\r\n }\r\n }\r\n if (item.ext.device) {\r\n if (item.ext.device.model) {\r\n env.tags[CtxTagKeys.deviceModel] = item.ext.device.model;\r\n }\r\n }\r\n if (item.ext.os && item.ext.os.name) {\r\n env.tags[CtxTagKeys.deviceOS] = item.ext.os.name;\r\n }\r\n if (item.ext.device) {\r\n if (item.ext.device.deviceType) {\r\n env.tags[CtxTagKeys.deviceType] = item.ext.device.deviceType;\r\n }\r\n }\r\n // No support for mapping Trace.traceState to 2.0 as it is currently empty\r\n if (item.ext.trace) {\r\n if (item.ext.trace.parentID) {\r\n env.tags[CtxTagKeys.operationParentId] = item.ext.trace.parentID;\r\n }\r\n if (item.ext.trace.name) {\r\n env.tags[CtxTagKeys.operationName] = item.ext.trace.name;\r\n }\r\n if (item.ext.trace.traceID) {\r\n env.tags[CtxTagKeys.operationId] = item.ext.trace.traceID;\r\n }\r\n }\r\n // Sample 4.0 schema\r\n // {\r\n // \"time\" : \"2018-09-05T22:51:22.4936Z\",\r\n // \"name\" : \"MetricWithNamespace\",\r\n // \"iKey\" : \"ABC-5a4cbd20-e601-4ef5-a3c6-5d6577e4398e\",\r\n // \"ext\": { \"cloud\": {\r\n // \"role\": \"WATSON3\",\r\n // \"roleInstance\": \"CO4AEAP00000260\"\r\n // },\r\n // \"device\": {}, \"correlation\": {} },\r\n // \"tags\": [\r\n // { \"amazon.region\" : \"east2\" },\r\n // { \"os.expid\" : \"wp:02df239\" }\r\n // ]\r\n // }\r\n var tgs = {};\r\n var _loop_1 = function (i) {\r\n var tg = item.tags[i];\r\n // CoreUtils.objKeys returns an array of keys\r\n CoreUtils.arrForEach(CoreUtils.objKeys(tg), function (key) {\r\n tgs[key] = tg[key];\r\n });\r\n item.tags.splice(i, 1);\r\n };\r\n // deals with tags.push({object})\r\n for (var i = item.tags.length - 1; i >= 0; i--) {\r\n _loop_1(i);\r\n }\r\n // deals with tags[key]=value\r\n for (var tg in item.tags) {\r\n tgs[tg] = item.tags[tg];\r\n }\r\n env.tags = tslib_1.__assign({}, env.tags, tgs);\r\n if (!env.tags[CtxTagKeys.internalSdkVersion]) {\r\n // Append a version in case it is not already set\r\n env.tags[CtxTagKeys.internalSdkVersion] = \"javascript:\" + EnvelopeCreator.Version;\r\n }\r\n };\r\n EnvelopeCreator.Version = \"2.5.4\";\r\n return EnvelopeCreator;\r\n}());\r\nexport { EnvelopeCreator };\r\nvar DependencyEnvelopeCreator = /** @class */ (function (_super) {\r\n tslib_1.__extends(DependencyEnvelopeCreator, _super);\r\n function DependencyEnvelopeCreator() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n DependencyEnvelopeCreator.prototype.Create = function (logger, telemetryItem) {\r\n this._logger = logger;\r\n if (CoreUtils.isNullOrUndefined(telemetryItem.baseData)) {\r\n this._logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TelemetryEnvelopeInvalid, \"telemetryItem.baseData cannot be null.\");\r\n }\r\n var customMeasurements = telemetryItem.baseData.measurements || {};\r\n var customProperties = telemetryItem.baseData.properties || {};\r\n EnvelopeCreator.extractPropsAndMeasurements(telemetryItem.data, customProperties, customMeasurements);\r\n var bd = telemetryItem.baseData;\r\n if (CoreUtils.isNullOrUndefined(bd)) {\r\n logger.warnToConsole(\"Invalid input for dependency data\");\r\n return null;\r\n }\r\n var id = bd.id;\r\n var absoluteUrl = bd.target;\r\n var command = bd.name;\r\n var duration = bd.duration;\r\n var success = bd.success;\r\n var resultCode = bd.responseCode;\r\n var requestAPI = bd.type;\r\n var correlationContext = bd.correlationContext;\r\n var method = bd.properties && bd.properties[HttpMethod] ? bd.properties[HttpMethod] : \"GET\";\r\n var baseData = new RemoteDependencyData(logger, id, absoluteUrl, command, duration, success, resultCode, method, requestAPI, correlationContext, customProperties, customMeasurements);\r\n var data = new Data(RemoteDependencyData.dataType, baseData);\r\n return EnvelopeCreator.createEnvelope(logger, RemoteDependencyData.envelopeType, telemetryItem, data);\r\n };\r\n DependencyEnvelopeCreator.DependencyEnvelopeCreator = new DependencyEnvelopeCreator();\r\n return DependencyEnvelopeCreator;\r\n}(EnvelopeCreator));\r\nexport { DependencyEnvelopeCreator };\r\nvar EventEnvelopeCreator = /** @class */ (function (_super) {\r\n tslib_1.__extends(EventEnvelopeCreator, _super);\r\n function EventEnvelopeCreator() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n EventEnvelopeCreator.prototype.Create = function (logger, telemetryItem) {\r\n this._logger = logger;\r\n if (CoreUtils.isNullOrUndefined(telemetryItem.baseData)) {\r\n this._logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TelemetryEnvelopeInvalid, \"telemetryItem.baseData cannot be null.\");\r\n }\r\n var customProperties = {};\r\n var customMeasurements = {};\r\n if (telemetryItem.baseType !== Event.dataType) {\r\n customProperties['baseTypeSource'] = telemetryItem.baseType; // save the passed in base type as a property\r\n }\r\n if (telemetryItem.baseType === Event.dataType) {\r\n customProperties = telemetryItem.baseData.properties || {};\r\n customMeasurements = telemetryItem.baseData.measurements || {};\r\n }\r\n else {\r\n if (telemetryItem.baseData) {\r\n EnvelopeCreator.extractPropsAndMeasurements(telemetryItem.baseData, customProperties, customMeasurements);\r\n }\r\n }\r\n // Exract root level properties from part C telemetryItem.data\r\n EnvelopeCreator.extractPropsAndMeasurements(telemetryItem.data, customProperties, customMeasurements);\r\n var eventName = telemetryItem.baseData.name;\r\n var baseData = new Event(logger, eventName, customProperties, customMeasurements);\r\n var data = new Data(Event.dataType, baseData);\r\n return EnvelopeCreator.createEnvelope(logger, Event.envelopeType, telemetryItem, data);\r\n };\r\n EventEnvelopeCreator.EventEnvelopeCreator = new EventEnvelopeCreator();\r\n return EventEnvelopeCreator;\r\n}(EnvelopeCreator));\r\nexport { EventEnvelopeCreator };\r\nvar ExceptionEnvelopeCreator = /** @class */ (function (_super) {\r\n tslib_1.__extends(ExceptionEnvelopeCreator, _super);\r\n function ExceptionEnvelopeCreator() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n ExceptionEnvelopeCreator.prototype.Create = function (logger, telemetryItem) {\r\n this._logger = logger;\r\n if (CoreUtils.isNullOrUndefined(telemetryItem.baseData)) {\r\n this._logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TelemetryEnvelopeInvalid, \"telemetryItem.baseData cannot be null.\");\r\n }\r\n var bd = telemetryItem.baseData;\r\n var baseData = Exception.CreateFromInterface(logger, bd);\r\n var data = new Data(Exception.dataType, baseData);\r\n return EnvelopeCreator.createEnvelope(logger, Exception.envelopeType, telemetryItem, data);\r\n };\r\n ExceptionEnvelopeCreator.ExceptionEnvelopeCreator = new ExceptionEnvelopeCreator();\r\n return ExceptionEnvelopeCreator;\r\n}(EnvelopeCreator));\r\nexport { ExceptionEnvelopeCreator };\r\nvar MetricEnvelopeCreator = /** @class */ (function (_super) {\r\n tslib_1.__extends(MetricEnvelopeCreator, _super);\r\n function MetricEnvelopeCreator() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n MetricEnvelopeCreator.prototype.Create = function (logger, telemetryItem) {\r\n this._logger = logger;\r\n if (CoreUtils.isNullOrUndefined(telemetryItem.baseData)) {\r\n this._logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TelemetryEnvelopeInvalid, \"telemetryItem.baseData cannot be null.\");\r\n }\r\n var props = telemetryItem.baseData.properties || {};\r\n var measurements = telemetryItem.baseData.measurements || {};\r\n EnvelopeCreator.extractPropsAndMeasurements(telemetryItem.data, props, measurements);\r\n var name = telemetryItem.baseData.name;\r\n var average = telemetryItem.baseData.average;\r\n var sampleCount = telemetryItem.baseData.sampleCount;\r\n var min = telemetryItem.baseData.min;\r\n var max = telemetryItem.baseData.max;\r\n var baseData = new Metric(logger, name, average, sampleCount, min, max, props, measurements);\r\n var data = new Data(Metric.dataType, baseData);\r\n return EnvelopeCreator.createEnvelope(logger, Metric.envelopeType, telemetryItem, data);\r\n };\r\n MetricEnvelopeCreator.MetricEnvelopeCreator = new MetricEnvelopeCreator();\r\n return MetricEnvelopeCreator;\r\n}(EnvelopeCreator));\r\nexport { MetricEnvelopeCreator };\r\nvar PageViewEnvelopeCreator = /** @class */ (function (_super) {\r\n tslib_1.__extends(PageViewEnvelopeCreator, _super);\r\n function PageViewEnvelopeCreator() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n PageViewEnvelopeCreator.prototype.Create = function (logger, telemetryItem) {\r\n this._logger = logger;\r\n if (CoreUtils.isNullOrUndefined(telemetryItem.baseData)) {\r\n this._logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TelemetryEnvelopeInvalid, \"telemetryItem.baseData cannot be null.\");\r\n }\r\n // Since duration is not part of the domain properties in Common Schema, extract it from part C\r\n var duration;\r\n if (!CoreUtils.isNullOrUndefined(telemetryItem.baseData) &&\r\n !CoreUtils.isNullOrUndefined(telemetryItem.baseData.properties) &&\r\n !CoreUtils.isNullOrUndefined(telemetryItem.baseData.properties.duration)) {\r\n duration = telemetryItem.baseData.properties.duration;\r\n delete telemetryItem.baseData.properties.duration;\r\n }\r\n else if (!CoreUtils.isNullOrUndefined(telemetryItem.data) &&\r\n !CoreUtils.isNullOrUndefined(telemetryItem.data[\"duration\"])) {\r\n duration = telemetryItem.data[\"duration\"];\r\n delete telemetryItem.data[\"duration\"];\r\n }\r\n var bd = telemetryItem.baseData;\r\n // special case: pageview.id is grabbed from current operation id. Analytics plugin is decoupled from properties plugin, so this is done here instead. This can be made a default telemetry intializer instead if needed to be decoupled from channel\r\n var currentContextId;\r\n if (telemetryItem.ext && telemetryItem.ext.trace && telemetryItem.ext.trace.traceID) {\r\n currentContextId = telemetryItem.ext.trace.traceID;\r\n }\r\n var id = bd.id || currentContextId;\r\n var name = bd.name;\r\n var url = bd.uri;\r\n var properties = bd.properties || {};\r\n var measurements = bd.measurements || {};\r\n // refUri is a field that Breeze still does not recognize as part of Part B. For now, put it in Part C until it supports it as a domain property\r\n if (!CoreUtils.isNullOrUndefined(bd.refUri)) {\r\n properties[\"refUri\"] = bd.refUri;\r\n }\r\n // pageType is a field that Breeze still does not recognize as part of Part B. For now, put it in Part C until it supports it as a domain property\r\n if (!CoreUtils.isNullOrUndefined(bd.pageType)) {\r\n properties[\"pageType\"] = bd.pageType;\r\n }\r\n // isLoggedIn is a field that Breeze still does not recognize as part of Part B. For now, put it in Part C until it supports it as a domain property\r\n if (!CoreUtils.isNullOrUndefined(bd.isLoggedIn)) {\r\n properties[\"isLoggedIn\"] = bd.isLoggedIn.toString();\r\n }\r\n // pageTags is a field that Breeze still does not recognize as part of Part B. For now, put it in Part C until it supports it as a domain property\r\n if (!CoreUtils.isNullOrUndefined(bd.properties)) {\r\n var pageTags = bd.properties;\r\n for (var key in pageTags) {\r\n if (pageTags.hasOwnProperty(key)) {\r\n properties[key] = pageTags[key];\r\n }\r\n }\r\n }\r\n EnvelopeCreator.extractPropsAndMeasurements(telemetryItem.data, properties, measurements);\r\n var baseData = new PageView(logger, name, url, duration, properties, measurements, id);\r\n var data = new Data(PageView.dataType, baseData);\r\n return EnvelopeCreator.createEnvelope(logger, PageView.envelopeType, telemetryItem, data);\r\n };\r\n PageViewEnvelopeCreator.PageViewEnvelopeCreator = new PageViewEnvelopeCreator();\r\n return PageViewEnvelopeCreator;\r\n}(EnvelopeCreator));\r\nexport { PageViewEnvelopeCreator };\r\nvar PageViewPerformanceEnvelopeCreator = /** @class */ (function (_super) {\r\n tslib_1.__extends(PageViewPerformanceEnvelopeCreator, _super);\r\n function PageViewPerformanceEnvelopeCreator() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n PageViewPerformanceEnvelopeCreator.prototype.Create = function (logger, telemetryItem) {\r\n this._logger = logger;\r\n if (CoreUtils.isNullOrUndefined(telemetryItem.baseData)) {\r\n this._logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TelemetryEnvelopeInvalid, \"telemetryItem.baseData cannot be null.\");\r\n }\r\n var bd = telemetryItem.baseData;\r\n var name = bd.name;\r\n var url = bd.uri || bd.url;\r\n var properties = bd.properties || {};\r\n var measurements = bd.measurements || {};\r\n EnvelopeCreator.extractPropsAndMeasurements(telemetryItem.data, properties, measurements);\r\n var baseData = new PageViewPerformance(logger, name, url, undefined, properties, measurements, bd);\r\n var data = new Data(PageViewPerformance.dataType, baseData);\r\n return EnvelopeCreator.createEnvelope(logger, PageViewPerformance.envelopeType, telemetryItem, data);\r\n };\r\n PageViewPerformanceEnvelopeCreator.PageViewPerformanceEnvelopeCreator = new PageViewPerformanceEnvelopeCreator();\r\n return PageViewPerformanceEnvelopeCreator;\r\n}(EnvelopeCreator));\r\nexport { PageViewPerformanceEnvelopeCreator };\r\nvar TraceEnvelopeCreator = /** @class */ (function (_super) {\r\n tslib_1.__extends(TraceEnvelopeCreator, _super);\r\n function TraceEnvelopeCreator() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n TraceEnvelopeCreator.prototype.Create = function (logger, telemetryItem) {\r\n this._logger = logger;\r\n if (CoreUtils.isNullOrUndefined(telemetryItem.baseData)) {\r\n this._logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TelemetryEnvelopeInvalid, \"telemetryItem.baseData cannot be null.\");\r\n }\r\n var message = telemetryItem.baseData.message;\r\n var severityLevel = telemetryItem.baseData.severityLevel;\r\n var props = telemetryItem.baseData.properties || {};\r\n var measurements = telemetryItem.baseData.measurements || {};\r\n EnvelopeCreator.extractPropsAndMeasurements(telemetryItem.data, props, measurements);\r\n var baseData = new Trace(logger, message, severityLevel, props, measurements);\r\n var data = new Data(Trace.dataType, baseData);\r\n return EnvelopeCreator.createEnvelope(logger, Trace.envelopeType, telemetryItem, data);\r\n };\r\n TraceEnvelopeCreator.TraceEnvelopeCreator = new TraceEnvelopeCreator();\r\n return TraceEnvelopeCreator;\r\n}(EnvelopeCreator));\r\nexport { TraceEnvelopeCreator };\r\n//# sourceMappingURL=EnvelopeCreator.js.map","import { Util, FieldType } from '@microsoft/applicationinsights-common';\r\nimport { LoggingSeverity, _InternalMessageId, CoreUtils, getJSON } from '@microsoft/applicationinsights-core-js';\r\nvar Serializer = /** @class */ (function () {\r\n function Serializer(logger) {\r\n this._logger = logger;\r\n }\r\n /**\r\n * Serializes the current object to a JSON string.\r\n */\r\n Serializer.prototype.serialize = function (input) {\r\n var output = this._serializeObject(input, \"root\");\r\n try {\r\n return getJSON().stringify(output);\r\n }\r\n catch (e) {\r\n // if serialization fails return an empty string\r\n this._logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.CannotSerializeObject, (e && CoreUtils.isFunction(e.toString)) ? e.toString() : \"Error serializing object\", null, true);\r\n }\r\n };\r\n Serializer.prototype._serializeObject = function (source, name) {\r\n var circularReferenceCheck = \"__aiCircularRefCheck\";\r\n var output = {};\r\n if (!source) {\r\n this._logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.CannotSerializeObject, \"cannot serialize object because it is null or undefined\", { name: name }, true);\r\n return output;\r\n }\r\n if (source[circularReferenceCheck]) {\r\n this._logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.CircularReferenceDetected, \"Circular reference detected while serializing object\", { name: name }, true);\r\n return output;\r\n }\r\n if (!source.aiDataContract) {\r\n // special case for measurements/properties/tags\r\n if (name === \"measurements\") {\r\n output = this._serializeStringMap(source, \"number\", name);\r\n }\r\n else if (name === \"properties\") {\r\n output = this._serializeStringMap(source, \"string\", name);\r\n }\r\n else if (name === \"tags\") {\r\n output = this._serializeStringMap(source, \"string\", name);\r\n }\r\n else if (Util.isArray(source)) {\r\n output = this._serializeArray(source, name);\r\n }\r\n else {\r\n this._logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.CannotSerializeObjectNonSerializable, \"Attempting to serialize an object which does not implement ISerializable\", { name: name }, true);\r\n try {\r\n // verify that the object can be stringified\r\n getJSON().stringify(source);\r\n output = source;\r\n }\r\n catch (e) {\r\n // if serialization fails return an empty string\r\n this._logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.CannotSerializeObject, (e && CoreUtils.isFunction(e.toString)) ? e.toString() : \"Error serializing object\", null, true);\r\n }\r\n }\r\n return output;\r\n }\r\n source[circularReferenceCheck] = true;\r\n for (var field in source.aiDataContract) {\r\n var contract = source.aiDataContract[field];\r\n var isRequired = (CoreUtils.isFunction(contract)) ? (contract() & FieldType.Required) : (contract & FieldType.Required);\r\n var isHidden = (CoreUtils.isFunction(contract)) ? (contract() & FieldType.Hidden) : (contract & FieldType.Hidden);\r\n var isArray = contract & FieldType.Array;\r\n var isPresent = source[field] !== undefined;\r\n var isObject = CoreUtils.isObject(source[field]) && source[field] !== null;\r\n if (isRequired && !isPresent && !isArray) {\r\n this._logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.MissingRequiredFieldSpecification, \"Missing required field specification. The field is required but not present on source\", { field: field, name: name });\r\n // If not in debug mode, continue and hope the error is permissible\r\n continue;\r\n }\r\n if (isHidden) {\r\n // Don't serialize hidden fields\r\n continue;\r\n }\r\n var value = void 0;\r\n if (isObject) {\r\n if (isArray) {\r\n // special case; resurse on each object in the source array\r\n value = this._serializeArray(source[field], field);\r\n }\r\n else {\r\n // recurse on the source object in this field\r\n value = this._serializeObject(source[field], field);\r\n }\r\n }\r\n else {\r\n // assign the source field to the output even if undefined or required\r\n value = source[field];\r\n }\r\n // only emit this field if the value is defined\r\n if (value !== undefined) {\r\n output[field] = value;\r\n }\r\n }\r\n delete source[circularReferenceCheck];\r\n return output;\r\n };\r\n Serializer.prototype._serializeArray = function (sources, name) {\r\n var output;\r\n if (!!sources) {\r\n if (!Util.isArray(sources)) {\r\n this._logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.ItemNotInArray, \"This field was specified as an array in the contract but the item is not an array.\\r\\n\", { name: name }, true);\r\n }\r\n else {\r\n output = [];\r\n for (var i = 0; i < sources.length; i++) {\r\n var source = sources[i];\r\n var item = this._serializeObject(source, name + \"[\" + i + \"]\");\r\n output.push(item);\r\n }\r\n }\r\n }\r\n return output;\r\n };\r\n Serializer.prototype._serializeStringMap = function (map, expectedType, name) {\r\n var output;\r\n if (map) {\r\n output = {};\r\n for (var field in map) {\r\n var value = map[field];\r\n if (expectedType === \"string\") {\r\n if (value === undefined) {\r\n output[field] = \"undefined\";\r\n }\r\n else if (value === null) {\r\n output[field] = \"null\";\r\n }\r\n else if (!value.toString) {\r\n output[field] = \"invalid field: toString() is not defined.\";\r\n }\r\n else {\r\n output[field] = value.toString();\r\n }\r\n }\r\n else if (expectedType === \"number\") {\r\n if (value === undefined) {\r\n output[field] = \"undefined\";\r\n }\r\n else if (value === null) {\r\n output[field] = \"null\";\r\n }\r\n else {\r\n var num = parseFloat(value);\r\n if (isNaN(num)) {\r\n output[field] = \"NaN\";\r\n }\r\n else {\r\n output[field] = num;\r\n }\r\n }\r\n }\r\n else {\r\n output[field] = \"invalid field: \" + name + \" is of unknown type.\";\r\n this._logger.throwInternal(LoggingSeverity.CRITICAL, output[field], null, true);\r\n }\r\n }\r\n }\r\n return output;\r\n };\r\n return Serializer;\r\n}());\r\nexport { Serializer };\r\n//# sourceMappingURL=Serializer.js.map","import { CoreUtils, EventHelper, getWindow, getDocument, getNavigator } from '@microsoft/applicationinsights-core-js';\r\n/**\r\n * @description Monitors browser for offline events\r\n * @export default - Offline: Static instance of OfflineListener\r\n * @class OfflineListener\r\n */\r\nvar OfflineListener = /** @class */ (function () {\r\n function OfflineListener() {\r\n this._onlineStatus = true;\r\n var _window = getWindow();\r\n var _document = getDocument();\r\n var isListening = false;\r\n var _this = this;\r\n try {\r\n if (_window) {\r\n if (EventHelper.Attach(_window, 'online', this._setOnline.bind(_this))) {\r\n EventHelper.Attach(_window, 'offline', this._setOffline.bind(_this));\r\n isListening = true;\r\n }\r\n }\r\n if (_document) {\r\n // Also attach to the document.body or document\r\n var target = _document.body || _document;\r\n if (!CoreUtils.isUndefined(target.ononline)) {\r\n target.ononline = this._setOnline.bind(_this);\r\n target.onoffline = this._setOffline.bind(_this);\r\n isListening = true;\r\n }\r\n }\r\n }\r\n catch (e) {\r\n // this makes react-native less angry\r\n isListening = false;\r\n }\r\n this.isListening = isListening;\r\n }\r\n OfflineListener.prototype.isOnline = function () {\r\n var _navigator = getNavigator();\r\n if (this.isListening) {\r\n return this._onlineStatus;\r\n }\r\n else if (_navigator && !CoreUtils.isNullOrUndefined(_navigator.onLine)) {\r\n return _navigator.onLine;\r\n }\r\n else {\r\n // Cannot determine online status - report as online\r\n return true;\r\n }\r\n };\r\n OfflineListener.prototype.isOffline = function () {\r\n return !this.isOnline();\r\n };\r\n OfflineListener.prototype._setOnline = function () {\r\n this._onlineStatus = true;\r\n };\r\n OfflineListener.prototype._setOffline = function () {\r\n this._onlineStatus = false;\r\n };\r\n OfflineListener.Offline = new OfflineListener;\r\n return OfflineListener;\r\n}());\r\nexport { OfflineListener };\r\nexport var Offline = OfflineListener.Offline;\r\n//# sourceMappingURL=Offline.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nvar HashCodeScoreGenerator = /** @class */ (function () {\r\n function HashCodeScoreGenerator() {\r\n }\r\n HashCodeScoreGenerator.prototype.getHashCodeScore = function (key) {\r\n var score = this.getHashCode(key) / HashCodeScoreGenerator.INT_MAX_VALUE;\r\n return score * 100;\r\n };\r\n HashCodeScoreGenerator.prototype.getHashCode = function (input) {\r\n if (input === \"\") {\r\n return 0;\r\n }\r\n while (input.length < HashCodeScoreGenerator.MIN_INPUT_LENGTH) {\r\n input = input.concat(input);\r\n }\r\n // 5381 is a magic number: http://stackoverflow.com/questions/10696223/reason-for-5381-number-in-djb-hash-function\r\n var hash = 5381;\r\n for (var i = 0; i < input.length; ++i) {\r\n hash = ((hash << 5) + hash) + input.charCodeAt(i);\r\n // 'hash' is of number type which means 53 bit integer (http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types-number-type)\r\n // 'hash & hash' will keep it 32 bit integer - just to make it clearer what the result is.\r\n hash = hash & hash;\r\n }\r\n return Math.abs(hash);\r\n };\r\n // We're using 32 bit math, hence max value is (2^31 - 1)\r\n HashCodeScoreGenerator.INT_MAX_VALUE = 2147483647;\r\n // (Magic number) DJB algorithm can't work on shorter strings (results in poor distribution\r\n HashCodeScoreGenerator.MIN_INPUT_LENGTH = 8;\r\n return HashCodeScoreGenerator;\r\n}());\r\nexport { HashCodeScoreGenerator };\r\n//# sourceMappingURL=HashCodeScoreGenerator.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { HashCodeScoreGenerator } from './HashCodeScoreGenerator';\r\nimport { ContextTagKeys } from '@microsoft/applicationinsights-common';\r\nvar SamplingScoreGenerator = /** @class */ (function () {\r\n function SamplingScoreGenerator() {\r\n this.hashCodeGeneragor = new HashCodeScoreGenerator();\r\n this.keys = new ContextTagKeys();\r\n }\r\n SamplingScoreGenerator.prototype.getSamplingScore = function (item) {\r\n var score = 0;\r\n if (item.tags && item.tags[this.keys.userId]) {\r\n score = this.hashCodeGeneragor.getHashCodeScore(item.tags[this.keys.userId]);\r\n }\r\n else if (item.ext && item.ext.user && item.ext.user.id) {\r\n score = this.hashCodeGeneragor.getHashCodeScore(item.ext.user.id);\r\n }\r\n else if (item.tags && item.tags[this.keys.operationId]) {\r\n score = this.hashCodeGeneragor.getHashCodeScore(item.tags[this.keys.operationId]);\r\n }\r\n else if (item.ext && item.ext.telemetryTrace && item.ext.telemetryTrace.traceID) {\r\n score = this.hashCodeGeneragor.getHashCodeScore(item.ext.telemetryTrace.traceID);\r\n }\r\n else {\r\n // tslint:disable-next-line:insecure-random\r\n score = (Math.random() * 100);\r\n }\r\n return score;\r\n };\r\n return SamplingScoreGenerator;\r\n}());\r\nexport { SamplingScoreGenerator };\r\n//# sourceMappingURL=SamplingScoreGenerator.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { SamplingScoreGenerator } from './SamplingScoreGenerators/SamplingScoreGenerator';\r\nimport { Metric } from '@microsoft/applicationinsights-common';\r\nimport { _InternalMessageId, LoggingSeverity, DiagnosticLogger, CoreUtils } from '@microsoft/applicationinsights-core-js';\r\nvar Sample = /** @class */ (function () {\r\n function Sample(sampleRate, logger) {\r\n // We're using 32 bit math, hence max value is (2^31 - 1)\r\n this.INT_MAX_VALUE = 2147483647;\r\n this._logger = CoreUtils.isNullOrUndefined(logger) ? new DiagnosticLogger() : logger;\r\n if (sampleRate > 100 || sampleRate < 0) {\r\n this._logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.SampleRateOutOfRange, \"Sampling rate is out of range (0..100). Sampling will be disabled, you may be sending too much data which may affect your AI service level.\", { samplingRate: sampleRate }, true);\r\n this.sampleRate = 100;\r\n }\r\n this.sampleRate = sampleRate;\r\n this.samplingScoreGenerator = new SamplingScoreGenerator();\r\n }\r\n /**\r\n * Determines if an envelope is sampled in (i.e. will be sent) or not (i.e. will be dropped).\r\n */\r\n Sample.prototype.isSampledIn = function (envelope) {\r\n var samplingPercentage = this.sampleRate; // 0 - 100\r\n var isSampledIn = false;\r\n if (samplingPercentage === null || samplingPercentage === undefined || samplingPercentage >= 100) {\r\n return true;\r\n }\r\n else if (envelope.baseType === Metric.dataType) {\r\n // exclude MetricData telemetry from sampling\r\n return true;\r\n }\r\n isSampledIn = this.samplingScoreGenerator.getSamplingScore(envelope) < samplingPercentage;\r\n return isSampledIn;\r\n };\r\n return Sample;\r\n}());\r\nexport { Sample };\r\n//# sourceMappingURL=Sample.js.map","import * as tslib_1 from \"tslib\";\r\nimport { SessionStorageSendBuffer, ArraySendBuffer } from './SendBuffer';\r\nimport { DependencyEnvelopeCreator, EventEnvelopeCreator, ExceptionEnvelopeCreator, MetricEnvelopeCreator, PageViewEnvelopeCreator, PageViewPerformanceEnvelopeCreator, TraceEnvelopeCreator } from './EnvelopeCreator';\r\nimport { Serializer } from './Serializer'; // todo move to channel\r\nimport { DisabledPropertyName, RequestHeaders, Util, PageView, Event, Trace, Exception, Metric, PageViewPerformance, RemoteDependencyData, ProcessLegacy, BreezeChannelIdentifier, SampleRate } from '@microsoft/applicationinsights-common';\r\nimport { CoreUtils, _InternalMessageId, LoggingSeverity, getWindow, getNavigator, getJSON, BaseTelemetryPlugin } from '@microsoft/applicationinsights-core-js';\r\nimport { Offline } from './Offline';\r\nimport { Sample } from './TelemetryProcessors/Sample';\r\nfunction _getResponseText(xhr) {\r\n try {\r\n return xhr.responseText;\r\n }\r\n catch (e) {\r\n // Best effort, as XHR may throw while XDR wont so just ignore\r\n }\r\n return null;\r\n}\r\nvar Sender = /** @class */ (function (_super) {\r\n tslib_1.__extends(Sender, _super);\r\n function Sender() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.priority = 1001;\r\n _this.identifier = BreezeChannelIdentifier;\r\n /**\r\n * Whether XMLHttpRequest object is supported. Older version of IE (8,9) do not support it.\r\n */\r\n _this._XMLHttpRequestSupported = false;\r\n return _this;\r\n }\r\n Sender.constructEnvelope = function (orig, iKey, logger) {\r\n var envelope;\r\n if (iKey !== orig.iKey && !CoreUtils.isNullOrUndefined(iKey)) {\r\n envelope = tslib_1.__assign({}, orig, { iKey: iKey });\r\n }\r\n else {\r\n envelope = orig;\r\n }\r\n switch (envelope.baseType) {\r\n case Event.dataType:\r\n return EventEnvelopeCreator.EventEnvelopeCreator.Create(logger, envelope);\r\n case Trace.dataType:\r\n return TraceEnvelopeCreator.TraceEnvelopeCreator.Create(logger, envelope);\r\n case PageView.dataType:\r\n return PageViewEnvelopeCreator.PageViewEnvelopeCreator.Create(logger, envelope);\r\n case PageViewPerformance.dataType:\r\n return PageViewPerformanceEnvelopeCreator.PageViewPerformanceEnvelopeCreator.Create(logger, envelope);\r\n case Exception.dataType:\r\n return ExceptionEnvelopeCreator.ExceptionEnvelopeCreator.Create(logger, envelope);\r\n case Metric.dataType:\r\n return MetricEnvelopeCreator.MetricEnvelopeCreator.Create(logger, envelope);\r\n case RemoteDependencyData.dataType:\r\n return DependencyEnvelopeCreator.DependencyEnvelopeCreator.Create(logger, envelope);\r\n default:\r\n return EventEnvelopeCreator.EventEnvelopeCreator.Create(logger, envelope);\r\n }\r\n };\r\n Sender._getDefaultAppInsightsChannelConfig = function () {\r\n // set default values\r\n return {\r\n endpointUrl: function () { return \"https://dc.services.visualstudio.com/v2/track\"; },\r\n emitLineDelimitedJson: function () { return false; },\r\n maxBatchInterval: function () { return 15000; },\r\n maxBatchSizeInBytes: function () { return 102400; },\r\n disableTelemetry: function () { return false; },\r\n enableSessionStorageBuffer: function () { return true; },\r\n isRetryDisabled: function () { return false; },\r\n isBeaconApiDisabled: function () { return true; },\r\n onunloadDisableBeacon: function () { return false; },\r\n instrumentationKey: function () { return undefined; },\r\n namePrefix: function () { return undefined; },\r\n samplingPercentage: function () { return 100; }\r\n };\r\n };\r\n Sender._getEmptyAppInsightsChannelConfig = function () {\r\n return {\r\n endpointUrl: undefined,\r\n emitLineDelimitedJson: undefined,\r\n maxBatchInterval: undefined,\r\n maxBatchSizeInBytes: undefined,\r\n disableTelemetry: undefined,\r\n enableSessionStorageBuffer: undefined,\r\n isRetryDisabled: undefined,\r\n isBeaconApiDisabled: undefined,\r\n onunloadDisableBeacon: undefined,\r\n instrumentationKey: undefined,\r\n namePrefix: undefined,\r\n samplingPercentage: undefined\r\n };\r\n };\r\n Sender.prototype.pause = function () {\r\n throw new Error(\"Method not implemented.\");\r\n };\r\n Sender.prototype.resume = function () {\r\n throw new Error(\"Method not implemented.\");\r\n };\r\n Sender.prototype.flush = function () {\r\n try {\r\n this.triggerSend();\r\n }\r\n catch (e) {\r\n this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.FlushFailed, \"flush failed, telemetry will not be collected: \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n };\r\n Sender.prototype.onunloadFlush = function () {\r\n if ((this._senderConfig.onunloadDisableBeacon() === false || this._senderConfig.isBeaconApiDisabled() === false) && Util.IsBeaconApiSupported()) {\r\n try {\r\n this.triggerSend(true, this._beaconSender);\r\n }\r\n catch (e) {\r\n this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.FailedToSendQueuedTelemetry, \"failed to flush with beacon sender on page unload, telemetry will not be collected: \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n }\r\n else {\r\n this.flush();\r\n }\r\n };\r\n Sender.prototype.teardown = function () {\r\n throw new Error(\"Method not implemented.\");\r\n };\r\n Sender.prototype.initialize = function (config, core, extensions, pluginChain) {\r\n _super.prototype.initialize.call(this, config, core, extensions, pluginChain);\r\n var ctx = this._getTelCtx();\r\n var identifier = this.identifier;\r\n this._serializer = new Serializer(core.logger);\r\n this._consecutiveErrors = 0;\r\n this._retryAt = null;\r\n this._lastSend = 0;\r\n this._sender = null;\r\n var defaultConfig = Sender._getDefaultAppInsightsChannelConfig();\r\n this._senderConfig = Sender._getEmptyAppInsightsChannelConfig();\r\n var _loop_1 = function (field) {\r\n this_1._senderConfig[field] = function () { return ctx.getConfig(identifier, field, defaultConfig[field]()); };\r\n };\r\n var this_1 = this;\r\n for (var field in defaultConfig) {\r\n _loop_1(field);\r\n }\r\n this._buffer = (this._senderConfig.enableSessionStorageBuffer && Util.canUseSessionStorage())\r\n ? new SessionStorageSendBuffer(this.diagLog(), this._senderConfig) : new ArraySendBuffer(this._senderConfig);\r\n this._sample = new Sample(this._senderConfig.samplingPercentage(), this.diagLog());\r\n if (!this._senderConfig.isBeaconApiDisabled() && Util.IsBeaconApiSupported()) {\r\n this._sender = this._beaconSender;\r\n }\r\n else {\r\n if (!CoreUtils.isUndefined(XMLHttpRequest)) {\r\n var testXhr = new XMLHttpRequest();\r\n if (\"withCredentials\" in testXhr) {\r\n this._sender = this._xhrSender;\r\n this._XMLHttpRequestSupported = true;\r\n }\r\n else if (!CoreUtils.isUndefined(XDomainRequest)) {\r\n this._sender = this._xdrSender; // IE 8 and 9\r\n }\r\n }\r\n }\r\n };\r\n Sender.prototype.processTelemetry = function (telemetryItem, itemCtx) {\r\n itemCtx = this._getTelCtx(itemCtx);\r\n try {\r\n // if master off switch is set, don't send any data\r\n if (this._senderConfig.disableTelemetry()) {\r\n // Do not send/save data\r\n return;\r\n }\r\n // validate input\r\n if (!telemetryItem) {\r\n itemCtx.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.CannotSendEmptyTelemetry, \"Cannot send empty telemetry\");\r\n return;\r\n }\r\n // validate event\r\n if (telemetryItem.baseData && !telemetryItem.baseType) {\r\n itemCtx.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.InvalidEvent, \"Cannot send telemetry without baseData and baseType\");\r\n return;\r\n }\r\n if (!telemetryItem.baseType) {\r\n // Default\r\n telemetryItem.baseType = \"EventData\";\r\n }\r\n // ensure a sender was constructed\r\n if (!this._sender) {\r\n itemCtx.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.SenderNotInitialized, \"Sender was not initialized\");\r\n return;\r\n }\r\n // check if this item should be sampled in, else add sampleRate tag\r\n if (!this._isSampledIn(telemetryItem)) {\r\n // Item is sampled out, do not send it\r\n itemCtx.diagLog().throwInternal(LoggingSeverity.WARNING, _InternalMessageId.TelemetrySampledAndNotSent, \"Telemetry item was sampled out and not sent\", { SampleRate: this._sample.sampleRate });\r\n return;\r\n }\r\n else {\r\n telemetryItem[SampleRate] = this._sample.sampleRate;\r\n }\r\n // construct an envelope that Application Insights endpoint can understand\r\n var aiEnvelope_1 = Sender.constructEnvelope(telemetryItem, this._senderConfig.instrumentationKey(), itemCtx.diagLog());\r\n if (!aiEnvelope_1) {\r\n itemCtx.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.CreateEnvelopeError, \"Unable to create an AppInsights envelope\");\r\n return;\r\n }\r\n var doNotSendItem_1 = false;\r\n // this is for running in legacy mode, where customer may already have a custom initializer present\r\n if (telemetryItem.tags && telemetryItem.tags[ProcessLegacy]) {\r\n CoreUtils.arrForEach(telemetryItem.tags[ProcessLegacy], function (callBack) {\r\n try {\r\n if (callBack && callBack(aiEnvelope_1) === false) {\r\n doNotSendItem_1 = true;\r\n itemCtx.diagLog().warnToConsole(\"Telemetry processor check returns false\");\r\n }\r\n }\r\n catch (e) {\r\n // log error but dont stop executing rest of the telemetry initializers\r\n // doNotSendItem = true;\r\n itemCtx.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TelemetryInitializerFailed, \"One of telemetry initializers failed, telemetry item will not be sent: \" + Util.getExceptionName(e), { exception: Util.dump(e) }, true);\r\n }\r\n });\r\n delete telemetryItem.tags[ProcessLegacy];\r\n }\r\n if (doNotSendItem_1) {\r\n return; // do not send, no need to execute next plugin\r\n }\r\n // check if the incoming payload is too large, truncate if necessary\r\n var payload = this._serializer.serialize(aiEnvelope_1);\r\n // flush if we would exceed the max-size limit by adding this item\r\n var bufferPayload = this._buffer.getItems();\r\n var batch = this._buffer.batchPayloads(bufferPayload);\r\n if (batch && (batch.length + payload.length > this._senderConfig.maxBatchSizeInBytes())) {\r\n this.triggerSend();\r\n }\r\n // enqueue the payload\r\n this._buffer.enqueue(payload);\r\n // ensure an invocation timeout is set\r\n this._setupTimer();\r\n }\r\n catch (e) {\r\n itemCtx.diagLog().throwInternal(LoggingSeverity.WARNING, _InternalMessageId.FailedAddingTelemetryToBuffer, \"Failed adding telemetry to the sender's buffer, some telemetry will be lost: \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n // hand off the telemetry item to the next plugin\r\n this.processNext(telemetryItem, itemCtx);\r\n };\r\n /**\r\n * xhr state changes\r\n */\r\n Sender.prototype._xhrReadyStateChange = function (xhr, payload, countOfItemsInPayload) {\r\n if (xhr.readyState === 4) {\r\n var response = null;\r\n if (!this._appId) {\r\n response = this._parseResponse(_getResponseText(xhr) || xhr.response);\r\n if (response && response.appId) {\r\n this._appId = response.appId;\r\n }\r\n }\r\n if ((xhr.status < 200 || xhr.status >= 300) && xhr.status !== 0) {\r\n if (!this._senderConfig.isRetryDisabled() && this._isRetriable(xhr.status)) {\r\n this._resendPayload(payload);\r\n this.diagLog().throwInternal(LoggingSeverity.WARNING, _InternalMessageId.TransmissionFailed, \". \" +\r\n \"Response code \" + xhr.status + \". Will retry to send \" + payload.length + \" items.\");\r\n }\r\n else {\r\n this._onError(payload, this._formatErrorMessageXhr(xhr));\r\n }\r\n }\r\n else if (Offline.isOffline()) {\r\n // Note: Don't check for staus == 0, since adblock gives this code\r\n if (!this._senderConfig.isRetryDisabled()) {\r\n var offlineBackOffMultiplier = 10; // arbritrary number\r\n this._resendPayload(payload, offlineBackOffMultiplier);\r\n this.diagLog().throwInternal(LoggingSeverity.WARNING, _InternalMessageId.TransmissionFailed, \". Offline - Response Code: \" + xhr.status + \". Offline status: \" + Offline.isOffline() + \". Will retry to send \" + payload.length + \" items.\");\r\n }\r\n }\r\n else {\r\n if (xhr.status === 206) {\r\n if (!response) {\r\n response = this._parseResponse(_getResponseText(xhr) || xhr.response);\r\n }\r\n if (response && !this._senderConfig.isRetryDisabled()) {\r\n this._onPartialSuccess(payload, response);\r\n }\r\n else {\r\n this._onError(payload, this._formatErrorMessageXhr(xhr));\r\n }\r\n }\r\n else {\r\n this._consecutiveErrors = 0;\r\n this._onSuccess(payload, countOfItemsInPayload);\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * Immediately send buffered data\r\n * @param async {boolean} - Indicates if the events should be sent asynchronously\r\n * @param forcedSender {SenderFunction} - Indicates the forcedSender, undefined if not passed\r\n */\r\n Sender.prototype.triggerSend = function (async, forcedSender) {\r\n if (async === void 0) { async = true; }\r\n try {\r\n // Send data only if disableTelemetry is false\r\n if (!this._senderConfig.disableTelemetry()) {\r\n if (this._buffer.count() > 0) {\r\n var payload = this._buffer.getItems();\r\n // invoke send\r\n if (forcedSender) {\r\n forcedSender.call(this, payload, async);\r\n }\r\n else {\r\n this._sender(payload, async);\r\n }\r\n }\r\n // update lastSend time to enable throttling\r\n this._lastSend = +new Date;\r\n }\r\n else {\r\n this._buffer.clear();\r\n }\r\n clearTimeout(this._timeoutHandle);\r\n this._timeoutHandle = null;\r\n this._retryAt = null;\r\n }\r\n catch (e) {\r\n /* Ignore this error for IE under v10 */\r\n if (!Util.getIEVersion() || Util.getIEVersion() > 9) {\r\n this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TransmissionFailed, \"Telemetry transmission failed, some telemetry will be lost: \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n }\r\n };\r\n /**\r\n * error handler\r\n */\r\n Sender.prototype._onError = function (payload, message, event) {\r\n this.diagLog().throwInternal(LoggingSeverity.WARNING, _InternalMessageId.OnError, \"Failed to send telemetry.\", { message: message });\r\n this._buffer.clearSent(payload);\r\n };\r\n /**\r\n * partial success handler\r\n */\r\n Sender.prototype._onPartialSuccess = function (payload, results) {\r\n var failed = [];\r\n var retry = [];\r\n // Iterate through the reversed array of errors so that splicing doesn't have invalid indexes after the first item.\r\n var errors = results.errors.reverse();\r\n for (var _i = 0, errors_1 = errors; _i < errors_1.length; _i++) {\r\n var error = errors_1[_i];\r\n var extracted = payload.splice(error.index, 1)[0];\r\n if (this._isRetriable(error.statusCode)) {\r\n retry.push(extracted);\r\n }\r\n else {\r\n // All other errors, including: 402 (Monthly quota exceeded) and 439 (Too many requests and refresh cache).\r\n failed.push(extracted);\r\n }\r\n }\r\n if (payload.length > 0) {\r\n this._onSuccess(payload, results.itemsAccepted);\r\n }\r\n if (failed.length > 0) {\r\n this._onError(failed, this._formatErrorMessageXhr(null, ['partial success', results.itemsAccepted, 'of', results.itemsReceived].join(' ')));\r\n }\r\n if (retry.length > 0) {\r\n this._resendPayload(retry);\r\n this.diagLog().throwInternal(LoggingSeverity.WARNING, _InternalMessageId.TransmissionFailed, \"Partial success. \" +\r\n \"Delivered: \" + payload.length + \", Failed: \" + failed.length +\r\n \". Will retry to send \" + retry.length + \" our of \" + results.itemsReceived + \" items\");\r\n }\r\n };\r\n /**\r\n * success handler\r\n */\r\n Sender.prototype._onSuccess = function (payload, countOfItemsInPayload) {\r\n this._buffer.clearSent(payload);\r\n };\r\n /**\r\n * xdr state changes\r\n */\r\n Sender.prototype._xdrOnLoad = function (xdr, payload) {\r\n var responseText = _getResponseText(xdr);\r\n if (xdr && (responseText + \"\" === \"200\" || responseText === \"\")) {\r\n this._consecutiveErrors = 0;\r\n this._onSuccess(payload, 0);\r\n }\r\n else {\r\n var results = this._parseResponse(responseText);\r\n if (results && results.itemsReceived && results.itemsReceived > results.itemsAccepted\r\n && !this._senderConfig.isRetryDisabled()) {\r\n this._onPartialSuccess(payload, results);\r\n }\r\n else {\r\n this._onError(payload, this._formatErrorMessageXdr(xdr));\r\n }\r\n }\r\n };\r\n Sender.prototype._isSampledIn = function (envelope) {\r\n return this._sample.isSampledIn(envelope);\r\n };\r\n /**\r\n * Send Beacon API request\r\n * @param payload {string} - The data payload to be sent.\r\n * @param isAsync {boolean} - not used\r\n * Note: Beacon API does not support custom headers and we are not able to get\r\n * appId from the backend for the correct correlation.\r\n */\r\n Sender.prototype._beaconSender = function (payload, isAsync) {\r\n var url = this._senderConfig.endpointUrl();\r\n var batch = this._buffer.batchPayloads(payload);\r\n // Chrome only allows CORS-safelisted values for the sendBeacon data argument\r\n // see: https://bugs.chromium.org/p/chromium/issues/detail?id=720283\r\n var plainTextBatch = new Blob([batch], { type: 'text/plain;charset=UTF-8' });\r\n // The sendBeacon method returns true if the user agent is able to successfully queue the data for transfer. Otherwise it returns false.\r\n var queued = getNavigator().sendBeacon(url, plainTextBatch);\r\n if (queued) {\r\n this._buffer.markAsSent(payload);\r\n // no response from beaconSender, clear buffer\r\n this._onSuccess(payload, payload.length);\r\n }\r\n else {\r\n this._xhrSender(payload, true);\r\n this.diagLog().throwInternal(LoggingSeverity.WARNING, _InternalMessageId.TransmissionFailed, \". \" + \"Failed to send telemetry with Beacon API, retried with xhrSender.\");\r\n }\r\n };\r\n /**\r\n * Send XMLHttpRequest\r\n * @param payload {string} - The data payload to be sent.\r\n * @param isAsync {boolean} - Indicates if the request should be sent asynchronously\r\n */\r\n Sender.prototype._xhrSender = function (payload, isAsync) {\r\n var _this = this;\r\n var xhr = new XMLHttpRequest();\r\n var endPointUrl = this._senderConfig.endpointUrl();\r\n try {\r\n xhr[DisabledPropertyName] = true;\r\n }\r\n catch (e) {\r\n // If the environment has locked down the XMLHttpRequest (preventExtensions and/or freeze), this would\r\n // cause the request to fail and we no telemetry would be sent\r\n }\r\n xhr.open(\"POST\", endPointUrl, isAsync);\r\n xhr.setRequestHeader(\"Content-type\", \"application/json\");\r\n // append Sdk-Context request header only in case of breeze endpoint\r\n if (Util.isInternalApplicationInsightsEndpoint(endPointUrl)) {\r\n xhr.setRequestHeader(RequestHeaders.sdkContextHeader, RequestHeaders.sdkContextHeaderAppIdRequest);\r\n }\r\n xhr.onreadystatechange = function () { return _this._xhrReadyStateChange(xhr, payload, payload.length); };\r\n xhr.onerror = function (event) { return _this._onError(payload, _this._formatErrorMessageXhr(xhr), event); };\r\n // compose an array of payloads\r\n var batch = this._buffer.batchPayloads(payload);\r\n xhr.send(batch);\r\n this._buffer.markAsSent(payload);\r\n };\r\n /**\r\n * Parses the response from the backend.\r\n * @param response - XMLHttpRequest or XDomainRequest response\r\n */\r\n Sender.prototype._parseResponse = function (response) {\r\n try {\r\n if (response && response !== \"\") {\r\n var result = getJSON().parse(response);\r\n if (result && result.itemsReceived && result.itemsReceived >= result.itemsAccepted &&\r\n result.itemsReceived - result.itemsAccepted === result.errors.length) {\r\n return result;\r\n }\r\n }\r\n }\r\n catch (e) {\r\n this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.InvalidBackendResponse, \"Cannot parse the response. \" + Util.getExceptionName(e), {\r\n response: response\r\n });\r\n }\r\n return null;\r\n };\r\n /**\r\n * Resend payload. Adds payload back to the send buffer and setup a send timer (with exponential backoff).\r\n * @param payload\r\n */\r\n Sender.prototype._resendPayload = function (payload, linearFactor) {\r\n if (linearFactor === void 0) { linearFactor = 1; }\r\n if (!payload || payload.length === 0) {\r\n return;\r\n }\r\n this._buffer.clearSent(payload);\r\n this._consecutiveErrors++;\r\n for (var _i = 0, payload_1 = payload; _i < payload_1.length; _i++) {\r\n var item = payload_1[_i];\r\n this._buffer.enqueue(item);\r\n }\r\n // setup timer\r\n this._setRetryTime(linearFactor);\r\n this._setupTimer();\r\n };\r\n /**\r\n * Calculates the time to wait before retrying in case of an error based on\r\n * http://en.wikipedia.org/wiki/Exponential_backoff\r\n */\r\n Sender.prototype._setRetryTime = function (linearFactor) {\r\n var SlotDelayInSeconds = 10;\r\n var delayInSeconds;\r\n if (this._consecutiveErrors <= 1) {\r\n delayInSeconds = SlotDelayInSeconds;\r\n }\r\n else {\r\n var backOffSlot = (Math.pow(2, this._consecutiveErrors) - 1) / 2;\r\n // tslint:disable-next-line:insecure-random\r\n var backOffDelay = Math.floor(Math.random() * backOffSlot * SlotDelayInSeconds) + 1;\r\n backOffDelay = linearFactor * backOffDelay;\r\n delayInSeconds = Math.max(Math.min(backOffDelay, 3600), SlotDelayInSeconds);\r\n }\r\n // TODO: Log the backoff time like the C# version does.\r\n var retryAfterTimeSpan = Date.now() + (delayInSeconds * 1000);\r\n // TODO: Log the retry at time like the C# version does.\r\n this._retryAt = retryAfterTimeSpan;\r\n };\r\n /**\r\n * Sets up the timer which triggers actually sending the data.\r\n */\r\n Sender.prototype._setupTimer = function () {\r\n var _this = this;\r\n if (!this._timeoutHandle) {\r\n var retryInterval = this._retryAt ? Math.max(0, this._retryAt - Date.now()) : 0;\r\n var timerValue = Math.max(this._senderConfig.maxBatchInterval(), retryInterval);\r\n this._timeoutHandle = setTimeout(function () {\r\n _this.triggerSend();\r\n }, timerValue);\r\n }\r\n };\r\n /**\r\n * Checks if the SDK should resend the payload after receiving this status code from the backend.\r\n * @param statusCode\r\n */\r\n Sender.prototype._isRetriable = function (statusCode) {\r\n return statusCode === 408 // Timeout\r\n || statusCode === 429 // Too many requests.\r\n || statusCode === 500 // Internal server error.\r\n || statusCode === 503; // Service unavailable.\r\n };\r\n Sender.prototype._formatErrorMessageXhr = function (xhr, message) {\r\n if (xhr) {\r\n return \"XMLHttpRequest,Status:\" + xhr.status + \",Response:\" + _getResponseText(xhr) || xhr.response || \"\";\r\n }\r\n return message;\r\n };\r\n /**\r\n * Send XDomainRequest\r\n * @param payload {string} - The data payload to be sent.\r\n * @param isAsync {boolean} - Indicates if the request should be sent asynchronously\r\n *\r\n * Note: XDomainRequest does not support sync requests. This 'isAsync' parameter is added\r\n * to maintain consistency with the xhrSender's contract\r\n * Note: XDomainRequest does not support custom headers and we are not able to get\r\n * appId from the backend for the correct correlation.\r\n */\r\n Sender.prototype._xdrSender = function (payload, isAsync) {\r\n var _this = this;\r\n var _window = getWindow();\r\n var xdr = new XDomainRequest();\r\n xdr.onload = function () { return _this._xdrOnLoad(xdr, payload); };\r\n xdr.onerror = function (event) { return _this._onError(payload, _this._formatErrorMessageXdr(xdr), event); };\r\n // XDomainRequest requires the same protocol as the hosting page.\r\n // If the protocol doesn't match, we can't send the telemetry :(.\r\n var hostingProtocol = _window && _window.location && _window.location.protocol || \"\";\r\n if (this._senderConfig.endpointUrl().lastIndexOf(hostingProtocol, 0) !== 0) {\r\n this.diagLog().throwInternal(LoggingSeverity.WARNING, _InternalMessageId.TransmissionFailed, \". \" +\r\n \"Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol.\");\r\n this._buffer.clear();\r\n return;\r\n }\r\n var endpointUrl = this._senderConfig.endpointUrl().replace(/^(https?:)/, \"\");\r\n xdr.open('POST', endpointUrl);\r\n // compose an array of payloads\r\n var batch = this._buffer.batchPayloads(payload);\r\n xdr.send(batch);\r\n this._buffer.markAsSent(payload);\r\n };\r\n Sender.prototype._formatErrorMessageXdr = function (xdr, message) {\r\n if (xdr) {\r\n return \"XDomainRequest,Response:\" + _getResponseText(xdr) || \"\";\r\n }\r\n return message;\r\n };\r\n return Sender;\r\n}(BaseTelemetryPlugin));\r\nexport { Sender };\r\n//# sourceMappingURL=Sender.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { Util, DateTimeUtils } from '@microsoft/applicationinsights-common';\r\nimport { _InternalMessageId, LoggingSeverity, CoreUtils, DiagnosticLogger } from '@microsoft/applicationinsights-core-js';\r\nvar Session = /** @class */ (function () {\r\n function Session() {\r\n }\r\n return Session;\r\n}());\r\nexport { Session };\r\nvar _SessionManager = /** @class */ (function () {\r\n function _SessionManager(config, logger) {\r\n var _this = this;\r\n if (CoreUtils.isNullOrUndefined(logger)) {\r\n this._logger = new DiagnosticLogger();\r\n }\r\n else {\r\n this._logger = logger;\r\n }\r\n if (!config) {\r\n config = {};\r\n }\r\n if (!(typeof config.sessionExpirationMs === \"function\")) {\r\n config.sessionExpirationMs = function () { return _SessionManager.acquisitionSpan; };\r\n }\r\n if (!(typeof config.sessionRenewalMs === \"function\")) {\r\n config.sessionRenewalMs = function () { return _SessionManager.renewalSpan; };\r\n }\r\n this.config = config;\r\n this._storageNamePrefix = function () { return _this.config.namePrefix && _this.config.namePrefix() ? _SessionManager.cookieNameConst + _this.config.namePrefix() : _SessionManager.cookieNameConst; };\r\n this.automaticSession = new Session();\r\n }\r\n _SessionManager.prototype.update = function () {\r\n if (!this.automaticSession.id) {\r\n this.initializeAutomaticSession();\r\n }\r\n var now = DateTimeUtils.Now();\r\n var acquisitionExpired = this.config.sessionExpirationMs() === 0 ? false : now - this.automaticSession.acquisitionDate > this.config.sessionExpirationMs();\r\n var renewalExpired = this.config.sessionExpirationMs() === 0 ? false : now - this.automaticSession.renewalDate > this.config.sessionRenewalMs();\r\n // renew if acquisitionSpan or renewalSpan has ellapsed\r\n if (acquisitionExpired || renewalExpired) {\r\n // update automaticSession so session state has correct id\r\n this.renew();\r\n }\r\n else {\r\n // do not update the cookie more often than cookieUpdateInterval\r\n if (!this.cookieUpdatedTimestamp || now - this.cookieUpdatedTimestamp > _SessionManager.cookieUpdateInterval) {\r\n this.automaticSession.renewalDate = now;\r\n this.setCookie(this.automaticSession.id, this.automaticSession.acquisitionDate, this.automaticSession.renewalDate);\r\n }\r\n }\r\n };\r\n /**\r\n * Record the current state of the automatic session and store it in our cookie string format\r\n * into the browser's local storage. This is used to restore the session data when the cookie\r\n * expires.\r\n */\r\n _SessionManager.prototype.backup = function () {\r\n this.setStorage(this.automaticSession.id, this.automaticSession.acquisitionDate, this.automaticSession.renewalDate);\r\n };\r\n /**\r\n * Use config.namePrefix + ai_session cookie data or local storage data (when the cookie is unavailable) to\r\n * initialize the automatic session.\r\n */\r\n _SessionManager.prototype.initializeAutomaticSession = function () {\r\n var cookie = Util.getCookie(this._logger, this._storageNamePrefix());\r\n if (cookie && typeof cookie.split === \"function\") {\r\n this.initializeAutomaticSessionWithData(cookie);\r\n }\r\n else {\r\n // There's no cookie, but we might have session data in local storage\r\n // This can happen if the session expired or the user actively deleted the cookie\r\n // We only want to recover data if the cookie is missing from expiry. We should respect the user's wishes if the cookie was deleted actively.\r\n // The User class handles this for us and deletes our local storage object if the persistent user cookie was removed.\r\n var storage = Util.getStorage(this._logger, this._storageNamePrefix());\r\n if (storage) {\r\n this.initializeAutomaticSessionWithData(storage);\r\n }\r\n }\r\n if (!this.automaticSession.id) {\r\n this.renew();\r\n }\r\n };\r\n /**\r\n * Extract id, aquisitionDate, and renewalDate from an ai_session payload string and\r\n * use this data to initialize automaticSession.\r\n *\r\n * @param {string} sessionData - The string stored in an ai_session cookie or local storage backup\r\n */\r\n _SessionManager.prototype.initializeAutomaticSessionWithData = function (sessionData) {\r\n var params = sessionData.split(\"|\");\r\n if (params.length > 0) {\r\n this.automaticSession.id = params[0];\r\n }\r\n try {\r\n if (params.length > 1) {\r\n var acq = +params[1];\r\n this.automaticSession.acquisitionDate = +new Date(acq);\r\n this.automaticSession.acquisitionDate = this.automaticSession.acquisitionDate > 0 ? this.automaticSession.acquisitionDate : 0;\r\n }\r\n if (params.length > 2) {\r\n var renewal = +params[2];\r\n this.automaticSession.renewalDate = +new Date(renewal);\r\n this.automaticSession.renewalDate = this.automaticSession.renewalDate > 0 ? this.automaticSession.renewalDate : 0;\r\n }\r\n }\r\n catch (e) {\r\n this._logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.ErrorParsingAISessionCookie, \"Error parsing ai_session cookie, session will be reset: \" + Util.getExceptionName(e), { exception: Util.dump(e) });\r\n }\r\n if (this.automaticSession.renewalDate === 0) {\r\n this._logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.SessionRenewalDateIsZero, \"AI session renewal date is 0, session will be reset.\");\r\n }\r\n };\r\n _SessionManager.prototype.renew = function () {\r\n var now = DateTimeUtils.Now();\r\n this.automaticSession.id = Util.newId();\r\n this.automaticSession.acquisitionDate = now;\r\n this.automaticSession.renewalDate = now;\r\n this.setCookie(this.automaticSession.id, this.automaticSession.acquisitionDate, this.automaticSession.renewalDate);\r\n // If this browser does not support local storage, fire an internal log to keep track of it at this point\r\n if (!Util.canUseLocalStorage()) {\r\n this._logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.BrowserDoesNotSupportLocalStorage, \"Browser does not support local storage. Session durations will be inaccurate.\");\r\n }\r\n };\r\n _SessionManager.prototype.setCookie = function (guid, acq, renewal) {\r\n // Set cookie to expire after the session expiry time passes or the session renewal deadline, whichever is sooner\r\n // Expiring the cookie will cause the session to expire even if the user isn't on the page\r\n var acquisitionExpiry = acq + this.config.sessionExpirationMs();\r\n var renewalExpiry = renewal + this.config.sessionRenewalMs();\r\n var cookieExpiry = new Date();\r\n var cookie = [guid, acq, renewal];\r\n if (acquisitionExpiry < renewalExpiry) {\r\n cookieExpiry.setTime(acquisitionExpiry);\r\n }\r\n else {\r\n cookieExpiry.setTime(renewalExpiry);\r\n }\r\n var cookieDomnain = this.config.cookieDomain ? this.config.cookieDomain() : null;\r\n // if sessionExpirationMs is set to 0, it means the expiry is set to 0 for this session cookie\r\n // A cookie with 0 expiry in the session cookie will never expire for that browser session. If the browser is closed the cookie expires. \r\n // Another browser instance does not inherit this cookie.\r\n var UTCString = this.config.sessionExpirationMs() === 0 ? '0' : cookieExpiry.toUTCString();\r\n Util.setCookie(this._logger, this._storageNamePrefix(), cookie.join('|') + ';expires=' + UTCString, cookieDomnain);\r\n this.cookieUpdatedTimestamp = DateTimeUtils.Now();\r\n };\r\n _SessionManager.prototype.setStorage = function (guid, acq, renewal) {\r\n // Keep data in local storage to retain the last session id, allowing us to cleanly end the session when it expires\r\n // Browsers that don't support local storage won't be able to end sessions cleanly from the client\r\n // The server will notice this and end the sessions itself, with loss of accurate session duration\r\n Util.setStorage(this._logger, this._storageNamePrefix(), [guid, acq, renewal].join('|'));\r\n };\r\n _SessionManager.acquisitionSpan = 86400000; // 24 hours in ms\r\n _SessionManager.renewalSpan = 1800000; // 30 minutes in ms\r\n _SessionManager.cookieUpdateInterval = 60000; // 1 minute in ms\r\n _SessionManager.cookieNameConst = 'ai_session';\r\n return _SessionManager;\r\n}());\r\nexport { _SessionManager };\r\n//# sourceMappingURL=Session.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nvar Application = /** @class */ (function () {\r\n function Application() {\r\n }\r\n return Application;\r\n}());\r\nexport { Application };\r\n//# sourceMappingURL=Application.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nvar Device = /** @class */ (function () {\r\n /**\r\n * Constructs a new instance of the Device class\r\n */\r\n function Device() {\r\n // don't attempt to fingerprint browsers\r\n this.id = \"browser\";\r\n // Device type is a dimension in our data platform\r\n // Setting it to 'Browser' allows to separate client and server dependencies/exceptions\r\n this.deviceClass = \"Browser\";\r\n }\r\n return Device;\r\n}());\r\nexport { Device };\r\n//# sourceMappingURL=Device.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nvar Version = \"2.5.4\";\r\nvar Internal = /** @class */ (function () {\r\n /**\r\n * Constructs a new instance of the internal telemetry data class.\r\n */\r\n function Internal(config) {\r\n this.sdkVersion = (config.sdkExtension && config.sdkExtension() ? config.sdkExtension() + \"_\" : \"\") + \"javascript:\" + Version;\r\n }\r\n return Internal;\r\n}());\r\nexport { Internal };\r\n//# sourceMappingURL=Internal.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { Util } from '@microsoft/applicationinsights-common';\r\nimport { _InternalMessageId, LoggingSeverity, CoreUtils } from '@microsoft/applicationinsights-core-js';\r\nvar User = /** @class */ (function () {\r\n function User(config, logger) {\r\n this.isNewUser = false;\r\n this._logger = logger;\r\n // get userId or create new one if none exists\r\n var cookie = Util.getCookie(this._logger, User.userCookieName);\r\n if (cookie) {\r\n this.isNewUser = false;\r\n var params = cookie.split(User.cookieSeparator);\r\n if (params.length > 0) {\r\n this.id = params[0];\r\n }\r\n }\r\n this.config = config;\r\n if (!this.id) {\r\n this.id = Util.newId();\r\n var date = new Date();\r\n var acqStr = CoreUtils.toISOString(date);\r\n this.accountAcquisitionDate = acqStr;\r\n this.isNewUser = true;\r\n // without expiration, cookies expire at the end of the session\r\n // set it to 365 days from now\r\n // 365 * 24 * 60 * 60 * 1000 = 31536000000 \r\n date.setTime(date.getTime() + 31536000000);\r\n var newCookie = [this.id, acqStr];\r\n var cookieDomain = this.config.cookieDomain ? this.config.cookieDomain() : undefined;\r\n Util.setCookie(this._logger, User.userCookieName, newCookie.join(User.cookieSeparator) + ';expires=' + date.toUTCString(), cookieDomain);\r\n // If we have an config.namePrefix() + ai_session in local storage this means the user actively removed our cookies.\r\n // We should respect their wishes and clear ourselves from local storage\r\n var name_1 = config.namePrefix && config.namePrefix() ? config.namePrefix() + 'ai_session' : 'ai_session';\r\n Util.removeStorage(this._logger, name_1);\r\n }\r\n // We still take the account id from the ctor param for backward compatibility. \r\n // But if the the customer set the accountId through the newer setAuthenticatedUserContext API, we will override it.\r\n this.accountId = config.accountId ? config.accountId() : undefined;\r\n // Get the auth user id and account id from the cookie if exists\r\n // Cookie is in the pattern: |\r\n var authCookie = Util.getCookie(this._logger, User.authUserCookieName);\r\n if (authCookie) {\r\n authCookie = decodeURI(authCookie);\r\n var authCookieString = authCookie.split(User.cookieSeparator);\r\n if (authCookieString[0]) {\r\n this.authenticatedId = authCookieString[0];\r\n }\r\n if (authCookieString.length > 1 && authCookieString[1]) {\r\n this.accountId = authCookieString[1];\r\n }\r\n }\r\n }\r\n /**\r\n * Sets the authenticated user id and the account id in this session.\r\n *\r\n * @param authenticatedUserId {string} - The authenticated user id. A unique and persistent string that represents each authenticated user in the service.\r\n * @param accountId {string} - An optional string to represent the account associated with the authenticated user.\r\n */\r\n User.prototype.setAuthenticatedUserContext = function (authenticatedUserId, accountId, storeInCookie) {\r\n if (storeInCookie === void 0) { storeInCookie = false; }\r\n // Validate inputs to ensure no cookie control characters.\r\n var isInvalidInput = !this.validateUserInput(authenticatedUserId) || (accountId && !this.validateUserInput(accountId));\r\n if (isInvalidInput) {\r\n this._logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.SetAuthContextFailedAccountName, \"Setting auth user context failed. \" +\r\n \"User auth/account id should be of type string, and not contain commas, semi-colons, equal signs, spaces, or vertical-bars.\", true);\r\n return;\r\n }\r\n // Create cookie string.\r\n this.authenticatedId = authenticatedUserId;\r\n var authCookie = this.authenticatedId;\r\n if (accountId) {\r\n this.accountId = accountId;\r\n authCookie = [this.authenticatedId, this.accountId].join(User.cookieSeparator);\r\n }\r\n if (storeInCookie) {\r\n // Set the cookie. No expiration date because this is a session cookie (expires when browser closed).\r\n // Encoding the cookie to handle unexpected unicode characters.\r\n Util.setCookie(this._logger, User.authUserCookieName, encodeURI(authCookie), this.config.cookieDomain());\r\n }\r\n };\r\n /**\r\n * Clears the authenticated user id and the account id from the user context.\r\n * @returns {}\r\n */\r\n User.prototype.clearAuthenticatedUserContext = function () {\r\n this.authenticatedId = null;\r\n this.accountId = null;\r\n Util.deleteCookie(this._logger, User.authUserCookieName);\r\n };\r\n User.prototype.validateUserInput = function (id) {\r\n // Validate:\r\n // 1. Id is a non-empty string.\r\n // 2. It does not contain special characters for cookies.\r\n if (typeof id !== 'string' ||\r\n !id ||\r\n id.match(/,|;|=| |\\|/)) {\r\n return false;\r\n }\r\n return true;\r\n };\r\n User.cookieSeparator = '|';\r\n User.userCookieName = 'ai_user';\r\n User.authUserCookieName = 'ai_authUser';\r\n return User;\r\n}());\r\nexport { User };\r\n//# sourceMappingURL=User.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nvar Location = /** @class */ (function () {\r\n function Location() {\r\n }\r\n return Location;\r\n}());\r\nexport { Location };\r\n//# sourceMappingURL=Location.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { Util, DataSanitizer } from '@microsoft/applicationinsights-common';\r\nimport { getLocation } from '@microsoft/applicationinsights-core-js';\r\nvar TelemetryTrace = /** @class */ (function () {\r\n function TelemetryTrace(id, parentId, name, logger) {\r\n this.traceID = id || Util.generateW3CId();\r\n this.parentID = parentId;\r\n this.name = name;\r\n var location = getLocation();\r\n if (!name && location && location.pathname) {\r\n this.name = location.pathname;\r\n }\r\n this.name = DataSanitizer.sanitizeString(logger, this.name);\r\n }\r\n return TelemetryTrace;\r\n}());\r\nexport { TelemetryTrace };\r\n//# sourceMappingURL=TelemetryTrace.js.map","/**\r\n * PropertiesPlugin.ts\r\n * @copyright Microsoft 2018\r\n */\r\nimport { CoreUtils, hasWindow } from '@microsoft/applicationinsights-core-js';\r\nimport { Session, _SessionManager } from './Context/Session';\r\nimport { Extensions, CtxTagKeys } from '@microsoft/applicationinsights-common';\r\nimport { Application } from './Context/Application';\r\nimport { Device } from './Context/Device';\r\nimport { Internal } from './Context/Internal';\r\nimport { User } from './Context/User';\r\nimport { Location } from './Context/Location';\r\nimport { TelemetryTrace } from './Context/TelemetryTrace';\r\nvar TelemetryContext = /** @class */ (function () {\r\n function TelemetryContext(logger, defaultConfig) {\r\n if (hasWindow()) {\r\n this.sessionManager = new _SessionManager(defaultConfig, logger);\r\n this.application = new Application();\r\n this.device = new Device();\r\n this.internal = new Internal(defaultConfig);\r\n this.location = new Location();\r\n this.user = new User(defaultConfig, logger);\r\n this.telemetryTrace = new TelemetryTrace(undefined, undefined, undefined, logger);\r\n this.session = new Session();\r\n }\r\n this.appId = function () { return null; };\r\n }\r\n TelemetryContext.prototype.applySessionContext = function (event, itemCtx) {\r\n var sessionContext = this.session || (this.sessionManager && this.sessionManager.automaticSession);\r\n if (sessionContext) {\r\n if (typeof sessionContext.id === \"string\") {\r\n event.ext.app.sesId = sessionContext.id;\r\n }\r\n }\r\n if (this.session) {\r\n // If customer set session info, apply his context; otherwise apply context automatically generated\r\n if (typeof this.session.id === \"string\") {\r\n event.ext.app.sesId = this.session.id;\r\n }\r\n else {\r\n event.ext.app.sesId = this.sessionManager.automaticSession.id;\r\n }\r\n }\r\n };\r\n TelemetryContext.prototype.applyOperatingSystemContxt = function (event, itemCtx) {\r\n if (this.os && this.os.name) {\r\n event.ext.os = this.os;\r\n }\r\n };\r\n TelemetryContext.prototype.applyApplicationContext = function (event, itemCtx) {\r\n if (this.application) {\r\n if (typeof this.application.ver === \"string\") {\r\n event.tags[CtxTagKeys.applicationVersion] = this.application.ver;\r\n }\r\n if (typeof this.application.build === \"string\") {\r\n event.tags[CtxTagKeys.applicationBuild] = this.application.build;\r\n }\r\n }\r\n };\r\n TelemetryContext.prototype.applyDeviceContext = function (event, itemCtx) {\r\n if (this.device) {\r\n if (typeof this.device.id === \"string\") {\r\n event.ext.device.localId = this.device.id;\r\n }\r\n if (typeof this.device.ip === \"string\") {\r\n event.ext.device.ip = this.device.ip;\r\n }\r\n if (typeof this.device.model === \"string\") {\r\n event.ext.device.model = this.device.model;\r\n }\r\n if (typeof this.device.deviceClass === \"string\") {\r\n event.ext.device.deviceClass = this.device.deviceClass;\r\n }\r\n }\r\n };\r\n TelemetryContext.prototype.applyInternalContext = function (event, itemCtx) {\r\n if (this.internal) {\r\n if (typeof this.internal.agentVersion === \"string\") {\r\n event.tags[CtxTagKeys.internalAgentVersion] = this.internal.agentVersion; // not mapped in CS 4.0\r\n }\r\n if (typeof this.internal.sdkVersion === \"string\") {\r\n event.tags[CtxTagKeys.internalSdkVersion] = this.internal.sdkVersion;\r\n }\r\n }\r\n };\r\n TelemetryContext.prototype.applyLocationContext = function (event, itemCtx) {\r\n if (this.location) {\r\n if (typeof this.location.ip === \"string\") {\r\n event.tags[CtxTagKeys.locationIp] = this.location.ip;\r\n }\r\n }\r\n };\r\n TelemetryContext.prototype.applyOperationContext = function (event, itemCtx) {\r\n if (this.telemetryTrace) {\r\n var trace = event.ext.trace || { traceID: undefined, parentID: undefined };\r\n if (typeof this.telemetryTrace.traceID === \"string\") {\r\n trace.traceID = this.telemetryTrace.traceID;\r\n }\r\n if (typeof this.telemetryTrace.name === \"string\") {\r\n trace.name = this.telemetryTrace.name;\r\n }\r\n if (typeof this.telemetryTrace.parentID === \"string\") {\r\n trace.parentID = this.telemetryTrace.parentID;\r\n }\r\n event.ext.trace = trace;\r\n }\r\n };\r\n TelemetryContext.prototype.applyWebContext = function (event, itemCtx) {\r\n if (this.web) {\r\n event.ext.web = event.ext.web || {};\r\n event.ext.web = this.web;\r\n }\r\n };\r\n TelemetryContext.prototype.applyUserContext = function (event, itemCtx) {\r\n if (this.user) {\r\n if (!event.tags) {\r\n event.tags = [];\r\n }\r\n // stays in tags\r\n if (typeof this.user.accountId === \"string\") {\r\n var item = {};\r\n event.tags[CtxTagKeys.userAccountId] = this.user.accountId;\r\n }\r\n // CS 4.0\r\n if (typeof this.user.id === \"string\") {\r\n event.ext.user.id = this.user.id;\r\n }\r\n if (typeof this.user.authenticatedId === \"string\") {\r\n event.ext.user.authId = this.user.authenticatedId;\r\n }\r\n }\r\n };\r\n TelemetryContext.prototype.cleanUp = function (event, itemCtx) {\r\n if (event.ext[Extensions.DeviceExt] && CoreUtils.objKeys(event.ext[Extensions.DeviceExt]).length === 0) {\r\n delete event.ext[Extensions.DeviceExt];\r\n }\r\n if (event.ext[Extensions.UserExt] && CoreUtils.objKeys(event.ext[Extensions.UserExt]).length === 0) {\r\n delete event.ext[Extensions.UserExt];\r\n }\r\n if (event.ext[Extensions.WebExt] && CoreUtils.objKeys(event.ext[Extensions.WebExt]).length === 0) {\r\n delete event.ext[Extensions.WebExt];\r\n }\r\n if (event.ext[Extensions.OSExt] && CoreUtils.objKeys(event.ext[Extensions.OSExt]).length === 0) {\r\n delete event.ext[Extensions.OSExt];\r\n }\r\n if (event.ext[Extensions.AppExt] && CoreUtils.objKeys(event.ext[Extensions.AppExt]).length === 0) {\r\n delete event.ext[Extensions.AppExt];\r\n }\r\n if (event.ext[Extensions.TraceExt] && CoreUtils.objKeys(event.ext[Extensions.TraceExt]).length === 0) {\r\n delete event.ext[Extensions.TraceExt];\r\n }\r\n };\r\n return TelemetryContext;\r\n}());\r\nexport { TelemetryContext };\r\n//# sourceMappingURL=TelemetryContext.js.map","/**\r\n * PropertiesPlugin.ts\r\n * @copyright Microsoft 2018\r\n */\r\nimport * as tslib_1 from \"tslib\";\r\nimport { BaseTelemetryPlugin, CoreUtils, _InternalLogMessage, LoggingSeverity, _InternalMessageId, getNavigator } from '@microsoft/applicationinsights-core-js';\r\nimport { TelemetryContext } from './TelemetryContext';\r\nimport { PageView, BreezeChannelIdentifier, PropertiesPluginIdentifier, Extensions, Util } from '@microsoft/applicationinsights-common';\r\nvar PropertiesPlugin = /** @class */ (function (_super) {\r\n tslib_1.__extends(PropertiesPlugin, _super);\r\n function PropertiesPlugin() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.priority = 110;\r\n _this.identifier = PropertiesPluginIdentifier;\r\n return _this;\r\n }\r\n PropertiesPlugin.getDefaultConfig = function () {\r\n var defaultConfig = {\r\n instrumentationKey: function () { return undefined; },\r\n accountId: function () { return null; },\r\n sessionRenewalMs: function () { return 30 * 60 * 1000; },\r\n samplingPercentage: function () { return 100; },\r\n sessionExpirationMs: function () { return 24 * 60 * 60 * 1000; },\r\n cookieDomain: function () { return null; },\r\n sdkExtension: function () { return null; },\r\n isBrowserLinkTrackingEnabled: function () { return false; },\r\n appId: function () { return null; },\r\n namePrefix: function () { return undefined; }\r\n };\r\n return defaultConfig;\r\n };\r\n PropertiesPlugin.prototype.initialize = function (config, core, extensions, pluginChain) {\r\n var _this = this;\r\n _super.prototype.initialize.call(this, config, core, extensions, pluginChain);\r\n var ctx = this._getTelCtx();\r\n var identifier = this.identifier;\r\n var defaultConfig = PropertiesPlugin.getDefaultConfig();\r\n this._extensionConfig = this._extensionConfig || PropertiesPlugin.getDefaultConfig();\r\n var _loop_1 = function (field) {\r\n this_1._extensionConfig[field] = function () { return ctx.getConfig(identifier, field, defaultConfig[field]()); };\r\n };\r\n var this_1 = this;\r\n for (var field in defaultConfig) {\r\n _loop_1(field);\r\n }\r\n this.context = new TelemetryContext(core.logger, this._extensionConfig);\r\n this._breezeChannel = Util.getExtension(extensions, BreezeChannelIdentifier);\r\n this.context.appId = function () { return _this._breezeChannel ? _this._breezeChannel[\"_appId\"] : null; };\r\n };\r\n /**\r\n * Add Part A fields to the event\r\n * @param event The event that needs to be processed\r\n */\r\n PropertiesPlugin.prototype.processTelemetry = function (event, itemCtx) {\r\n if (CoreUtils.isNullOrUndefined(event)) {\r\n // TODO(barustum): throw an internal event once we have support for internal logging\r\n }\r\n else {\r\n itemCtx = this._getTelCtx(itemCtx);\r\n // If the envelope is PageView, reset the internal message count so that we can send internal telemetry for the new page.\r\n if (event.name === PageView.envelopeType) {\r\n itemCtx.diagLog().resetInternalMessageCount();\r\n }\r\n if (this.context.session) {\r\n // If customer did not provide custom session id update the session manager\r\n if (typeof this.context.session.id !== \"string\") {\r\n this.context.sessionManager.update();\r\n }\r\n }\r\n this._processTelemetryInternal(event, itemCtx);\r\n if (this.context && this.context.user && this.context.user.isNewUser) {\r\n this.context.user.isNewUser = false;\r\n var message = new _InternalLogMessage(_InternalMessageId.SendBrowserInfoOnUserInit, ((getNavigator() || {}).userAgent || \"\"));\r\n itemCtx.diagLog().logInternalMessage(LoggingSeverity.CRITICAL, message);\r\n }\r\n this.processNext(event, itemCtx);\r\n }\r\n };\r\n PropertiesPlugin.prototype._processTelemetryInternal = function (event, itemCtx) {\r\n // set part A fields\r\n if (!event.tags) {\r\n event.tags = [];\r\n }\r\n if (!event.ext) {\r\n event.ext = {};\r\n }\r\n var ext = event.ext;\r\n ext[Extensions.DeviceExt] = ext[Extensions.DeviceExt] || {};\r\n ext[Extensions.WebExt] = ext[Extensions.WebExt] || {};\r\n ext[Extensions.UserExt] = ext[Extensions.UserExt] || {};\r\n ext[Extensions.OSExt] = ext[Extensions.OSExt] || {};\r\n ext[Extensions.AppExt] = ext[Extensions.AppExt] || {};\r\n ext[Extensions.TraceExt] = ext[Extensions.TraceExt] || {};\r\n var context = this.context;\r\n context.applySessionContext(event, itemCtx);\r\n context.applyApplicationContext(event, itemCtx);\r\n context.applyDeviceContext(event, itemCtx);\r\n context.applyOperationContext(event, itemCtx);\r\n context.applyUserContext(event, itemCtx);\r\n context.applyOperatingSystemContxt(event, itemCtx);\r\n context.applyWebContext(event, itemCtx);\r\n context.applyLocationContext(event, itemCtx); // legacy tags\r\n context.applyInternalContext(event, itemCtx); // legacy tags\r\n context.cleanUp(event, itemCtx);\r\n };\r\n return PropertiesPlugin;\r\n}(BaseTelemetryPlugin));\r\nexport default PropertiesPlugin;\r\n//# sourceMappingURL=PropertiesPlugin.js.map","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { strFunction, strPrototype } from \"./EnvUtils\";\r\nimport { CoreUtils } from './CoreUtils';\r\nvar aiInstrumentHooks = \"_aiHooks\";\r\n;\r\nvar cbNames = [\r\n \"req\", \"rsp\", \"hkErr\", \"fnErr\"\r\n];\r\n/** @ignore */\r\nfunction _arrLoop(arr, fn) {\r\n if (arr) {\r\n for (var lp = 0; lp < arr.length; lp++) {\r\n if (fn(arr[lp], lp)) {\r\n break;\r\n }\r\n }\r\n }\r\n}\r\n/** @ignore */\r\nfunction _doCallbacks(hooks, callDetails, cbArgs, hookCtx, type) {\r\n if (type >= 0 /* Request */ && type <= 2 /* HookError */) {\r\n _arrLoop(hooks, function (hook, idx) {\r\n var cbks = hook.cbks;\r\n var cb = cbks[cbNames[type]];\r\n if (cb) {\r\n // Set the specific hook context implementation using a lazy creation pattern\r\n callDetails.ctx = function () {\r\n var ctx = hookCtx[idx] = (hookCtx[idx] || {});\r\n return ctx;\r\n };\r\n try {\r\n cb.apply(callDetails.inst, cbArgs);\r\n }\r\n catch (err) {\r\n var orgEx = callDetails.err;\r\n try {\r\n // Report Hook error via the callback\r\n var hookErrorCb = cbks[cbNames[2 /* HookError */]];\r\n if (hookErrorCb) {\r\n callDetails.err = err;\r\n hookErrorCb.apply(callDetails.inst, cbArgs);\r\n }\r\n }\r\n catch (e) {\r\n // Not much we can do here -- swallowing the exception to avoid crashing the hosting app\r\n }\r\n finally {\r\n // restore the original exception (if any)\r\n callDetails.err = orgEx;\r\n }\r\n }\r\n }\r\n });\r\n }\r\n}\r\n/** @ignore */\r\nfunction _createFunctionHook(aiHook) {\r\n // Define a temporary method that queues-up a the real method call\r\n return function () {\r\n var funcThis = this;\r\n // Capture the original arguments passed to the method\r\n var orgArgs = arguments;\r\n var hooks = aiHook.h;\r\n var funcArgs = {\r\n name: aiHook.n,\r\n inst: funcThis,\r\n ctx: null,\r\n set: _replaceArg\r\n };\r\n var hookCtx = [];\r\n var cbArgs = _createArgs([funcArgs], orgArgs);\r\n function _createArgs(target, theArgs) {\r\n _arrLoop(theArgs, function (arg) {\r\n target.push(arg);\r\n });\r\n return target;\r\n }\r\n function _replaceArg(idx, value) {\r\n orgArgs = _createArgs([], orgArgs);\r\n orgArgs[idx] = value;\r\n cbArgs = _createArgs([funcArgs], orgArgs);\r\n }\r\n // Call the pre-request hooks\r\n _doCallbacks(hooks, funcArgs, cbArgs, hookCtx, 0 /* Request */);\r\n // Call the original function was called\r\n var theFunc = aiHook.f;\r\n try {\r\n funcArgs.rslt = theFunc.apply(funcThis, orgArgs);\r\n }\r\n catch (err) {\r\n // Report the request callback\r\n funcArgs.err = err;\r\n _doCallbacks(hooks, funcArgs, cbArgs, hookCtx, 3 /* FunctionError */);\r\n // rethrow the original exception so anyone listening for it can catch the exception\r\n throw err;\r\n }\r\n // Call the post-request hooks\r\n _doCallbacks(hooks, funcArgs, cbArgs, hookCtx, 1 /* Response */);\r\n return funcArgs.rslt;\r\n };\r\n}\r\n/** @ignore */\r\nfunction _getOwner(target, name, checkPrototype) {\r\n var owner = null;\r\n if (target) {\r\n if (CoreUtils.hasOwnProperty(target, name)) {\r\n owner = target;\r\n }\r\n else if (checkPrototype) {\r\n owner = _getOwner(target[strPrototype], name, false);\r\n }\r\n }\r\n return owner;\r\n}\r\n/**\r\n * Intercept the named prototype functions for the target class / object\r\n * @param target - The target object\r\n * @param funcName - The function name\r\n * @param callbacks - The callbacks to configure and call whenever the function is called\r\n */\r\nexport function InstrumentProto(target, funcName, callbacks) {\r\n if (target) {\r\n return InstrumentFunc(target[strPrototype], funcName, callbacks, false);\r\n }\r\n return null;\r\n}\r\n/**\r\n * Intercept the named prototype functions for the target class / object\r\n * @param target - The target object\r\n * @param funcNames - The function names to intercept and call\r\n * @param callbacks - The callbacks to configure and call whenever the function is called\r\n */\r\nexport function InstrumentProtos(target, funcNames, callbacks) {\r\n if (target) {\r\n return InstrumentFuncs(target[strPrototype], funcNames, callbacks, false);\r\n }\r\n return null;\r\n}\r\n/**\r\n * Intercept the named prototype functions for the target class / object\r\n * @param target - The target object\r\n * @param funcName - The function name\r\n * @param callbacks - The callbacks to configure and call whenever the function is called\r\n * @param checkPrototype - If the function doesn't exist on the target should it attempt to hook the prototype function\r\n */\r\nexport function InstrumentFunc(target, funcName, callbacks, checkPrototype) {\r\n if (checkPrototype === void 0) { checkPrototype = true; }\r\n if (target && funcName && callbacks) {\r\n var owner = _getOwner(target, funcName, checkPrototype);\r\n var fn = owner[funcName];\r\n if (typeof fn === strFunction) {\r\n var aiHook_1 = fn[aiInstrumentHooks];\r\n if (!aiHook_1) {\r\n // Only hook the function once\r\n aiHook_1 = {\r\n i: 0,\r\n n: funcName,\r\n f: fn,\r\n h: []\r\n };\r\n // Override (hook) the original function\r\n var newFunc = _createFunctionHook(aiHook_1);\r\n newFunc[aiInstrumentHooks] = aiHook_1; // Tag and store the function hooks\r\n owner[funcName] = newFunc;\r\n }\r\n var theHook = {\r\n // tslint:disable:object-literal-shorthand\r\n id: aiHook_1.i,\r\n cbks: callbacks,\r\n rm: function () {\r\n // DO NOT Use () => { shorthand for the function as the this gets replaced\r\n // with the outer this and not the this for theHook instance.\r\n var id = this.id;\r\n _arrLoop(aiHook_1.h, function (hook, idx) {\r\n if (hook.id === id) {\r\n aiHook_1.h.splice(idx, 1);\r\n return 1;\r\n }\r\n });\r\n }\r\n // tslint:enable:object-literal-shorthand\r\n };\r\n aiHook_1.i++;\r\n aiHook_1.h.push(theHook);\r\n return theHook;\r\n }\r\n }\r\n return null;\r\n}\r\n/**\r\n * Intercept the named functions for the target class / object\r\n * @param target - The target object\r\n * @param funcNames - The function names to intercept and call\r\n * @param callbacks - The callbacks to configure and call whenever the function is called\r\n * @param checkPrototype - If the function doesn't exist on the target should it attempt to hook the prototype function\r\n */\r\nexport function InstrumentFuncs(target, funcNames, callbacks, checkPrototype) {\r\n if (checkPrototype === void 0) { checkPrototype = true; }\r\n var hooks = null;\r\n _arrLoop(funcNames, function (funcName) {\r\n var hook = InstrumentFunc(target, funcName, callbacks, checkPrototype);\r\n if (hook) {\r\n if (!hooks) {\r\n hooks = [];\r\n }\r\n hooks.push(hook);\r\n }\r\n });\r\n return hooks;\r\n}\r\n//# sourceMappingURL=InstrumentHooks.js.map","/*!\n * Application Insights JavaScript SDK - Dependencies Plugin, 2.5.4\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { DataSanitizer, UrlHelper, DateTimeUtils, Util } from '@microsoft/applicationinsights-common';\r\nimport { CoreUtils, normalizeJsName } from '@microsoft/applicationinsights-core-js';\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nvar strProperties = \"properties\";\r\nvar _objKeys = CoreUtils.objKeys;\r\nvar _arrForEach = CoreUtils.arrForEach;\r\n/** @ignore */\r\nfunction _calcPerfDuration(resourceEntry, start, end) {\r\n var result = 0;\r\n var from = resourceEntry[start];\r\n var to = resourceEntry[end];\r\n if (from && to) {\r\n result = DateTimeUtils.GetDuration(from, to);\r\n }\r\n return result;\r\n}\r\n/** @ignore */\r\nfunction _setPerfDuration(props, name, resourceEntry, start, end) {\r\n var result = 0;\r\n var value = _calcPerfDuration(resourceEntry, start, end);\r\n if (value) {\r\n result = _setPerfValue(props, name, Util.msToTimeSpan(value));\r\n }\r\n return result;\r\n}\r\n/** @ignore */\r\nfunction _setPerfValue(props, name, value) {\r\n var strPerf = \"ajaxPerf\";\r\n var result = 0;\r\n if (props && name && value) {\r\n var perfData = props[strPerf] = (props[strPerf] || {});\r\n perfData[name] = value;\r\n result = 1;\r\n }\r\n return result;\r\n}\r\n/** @ignore */\r\nfunction _populatePerfData(ajaxData, dependency) {\r\n /*\r\n * https://developer.mozilla.org/en-US/docs/Web/API/Resource_Timing_API/Using_the_Resource_Timing_API\r\n * | -startTime\r\n * | -redirectStart\r\n * | | -redirectEnd\r\n * | | | -fetchStart\r\n * | | | | -domainLookupStart\r\n * | | | | |- domainLookupEnd\r\n * | | | | | | -connectStart\r\n * | | | | | | | -secureConnectionStart\r\n * | | | | | | | | -connectEnd\r\n * | | | | | | | | | -requestStart\r\n * | | | | | | | | | | | -responseStart\r\n * | | | | | | | | | | | | | -responseEnd\r\n * +------------+-+---+----------------+-+--+--------+-+-----------+-+------------+-+\r\n * |--redirect--| |---|--domainLookup--| |--connect--| |--request--| |--response--| |\r\n * |-------------------networkConnect----------------|\r\n * | |---------sentRequest--------|\r\n * |------------------------------------perfTotal-----------------------------------|\r\n */\r\n var resourceEntry = ajaxData.perfTiming;\r\n var props = dependency[strProperties] || {};\r\n var propsSet = 0;\r\n var _isString = CoreUtils.isString;\r\n var strName = \"name\";\r\n var strStart = \"Start\";\r\n var strEnd = \"End\";\r\n var strDomainLookup = \"domainLookup\";\r\n var strConnect = \"connect\";\r\n var strRedirect = \"redirect\";\r\n var strRequest = \"request\";\r\n var strResponse = \"response\";\r\n var strDuration = \"duration\";\r\n var strStartTime = \"startTime\";\r\n var strDomainLookupStart = strDomainLookup + strStart;\r\n var strDomainLookupEnd = strDomainLookup + strEnd;\r\n var strConnectStart = strConnect + strStart;\r\n var strConnectEnd = strConnect + strEnd;\r\n var strRequestStart = strRequest + strStart;\r\n var strRequestEnd = strRequest + strEnd;\r\n var strResponseStart = strResponse + strStart;\r\n var strResponseEnd = strResponse + strEnd;\r\n var strRedirectStart = strRedirect + strStart;\r\n var strRedirectEnd = strRedirect = strEnd;\r\n var strTransferSize = \"transferSize\";\r\n var strEncodedBodySize = \"encodedBodySize\";\r\n var strDecodedBodySize = \"decodedBodySize\";\r\n var strServerTiming = \"serverTiming\";\r\n if (resourceEntry) {\r\n // redirect\r\n propsSet |= _setPerfDuration(props, strRedirect, resourceEntry, strRedirectStart, strRedirectEnd);\r\n // domainLookup\r\n propsSet |= _setPerfDuration(props, strDomainLookup, resourceEntry, strDomainLookupStart, strDomainLookupEnd);\r\n // connect\r\n propsSet |= _setPerfDuration(props, strConnect, resourceEntry, strConnectStart, strConnectEnd);\r\n // request\r\n propsSet |= _setPerfDuration(props, strRequest, resourceEntry, strRequestStart, strRequestEnd);\r\n // response\r\n propsSet |= _setPerfDuration(props, strResponse, resourceEntry, strResponseStart, strResponseEnd);\r\n // Network connection time\r\n propsSet |= _setPerfDuration(props, \"networkConnect\", resourceEntry, strStartTime, strConnectEnd);\r\n // Sent Request\r\n propsSet |= _setPerfDuration(props, \"sentRequest\", resourceEntry, strRequestStart, strResponseEnd);\r\n // PerfTotal / Duration\r\n var duration = resourceEntry[strDuration];\r\n if (!duration) {\r\n duration = _calcPerfDuration(resourceEntry, strStartTime, strResponseEnd) || 0;\r\n }\r\n propsSet |= _setPerfValue(props, strDuration, duration);\r\n propsSet |= _setPerfValue(props, \"perfTotal\", duration);\r\n var serverTiming = resourceEntry[strServerTiming];\r\n if (serverTiming) {\r\n var server_1 = {};\r\n _arrForEach(serverTiming, function (value, idx) {\r\n var name = normalizeJsName(value[strName] || \"\" + idx);\r\n var newValue = server_1[name] || {};\r\n _arrForEach(_objKeys(value), function (key) {\r\n var val = value[key];\r\n if (key !== strName && _isString(val) || CoreUtils.isNumber(val)) {\r\n if (newValue[key]) {\r\n val = newValue[key] + \";\" + val;\r\n }\r\n if (val || !_isString(val)) {\r\n // Only set the value if it has a value and it's not an empty string\r\n newValue[key] = val;\r\n }\r\n }\r\n });\r\n server_1[name] = newValue;\r\n });\r\n propsSet |= _setPerfValue(props, strServerTiming, server_1);\r\n }\r\n propsSet |= _setPerfValue(props, strTransferSize, resourceEntry[strTransferSize]);\r\n propsSet |= _setPerfValue(props, strEncodedBodySize, resourceEntry[strEncodedBodySize]);\r\n propsSet |= _setPerfValue(props, strDecodedBodySize, resourceEntry[strDecodedBodySize]);\r\n }\r\n else {\r\n if (ajaxData.perfMark) {\r\n propsSet |= _setPerfValue(props, \"missing\", ajaxData.perfAttempts);\r\n }\r\n }\r\n if (propsSet) {\r\n dependency[strProperties] = props;\r\n }\r\n}\r\nvar XHRMonitoringState = /** @class */ (function () {\r\n function XHRMonitoringState() {\r\n var self = this;\r\n self.openDone = false;\r\n self.setRequestHeaderDone = false;\r\n self.sendDone = false;\r\n self.abortDone = false;\r\n // True, if onreadyStateChangeCallback function attached to xhr, otherwise false\r\n self.stateChangeAttached = false;\r\n }\r\n return XHRMonitoringState;\r\n}());\r\nexport { XHRMonitoringState };\r\nvar ajaxRecord = /** @class */ (function () {\r\n function ajaxRecord(traceID, spanID, logger) {\r\n var self = this;\r\n var _logger = logger;\r\n var strResponseText = \"responseText\";\r\n // Assigning the initial/default values within the constructor to avoid typescript from creating a bunch of\r\n // this.XXXX = null\r\n self.perfMark = null;\r\n self.completed = false;\r\n self.requestHeadersSize = null;\r\n self.requestHeaders = null;\r\n self.responseReceivingDuration = null;\r\n self.callbackDuration = null;\r\n self.ajaxTotalDuration = null;\r\n self.aborted = 0;\r\n self.pageUrl = null;\r\n self.requestUrl = null;\r\n self.requestSize = 0;\r\n self.method = null;\r\n self.status = null;\r\n self.requestSentTime = null;\r\n self.responseStartedTime = null;\r\n self.responseFinishedTime = null;\r\n self.callbackFinishedTime = null;\r\n self.endTime = null;\r\n self.xhrMonitoringState = new XHRMonitoringState();\r\n self.clientFailure = 0;\r\n self.traceID = traceID;\r\n self.spanID = spanID;\r\n dynamicProto(ajaxRecord, self, function (self) {\r\n self.getAbsoluteUrl = function () {\r\n return self.requestUrl ? UrlHelper.getAbsoluteUrl(self.requestUrl) : null;\r\n };\r\n self.getPathName = function () {\r\n return self.requestUrl ? DataSanitizer.sanitizeUrl(_logger, UrlHelper.getCompleteUrl(self.method, self.requestUrl)) : null;\r\n };\r\n self.CreateTrackItem = function (ajaxType, enableRequestHeaderTracking, getResponse) {\r\n // round to 3 decimal points\r\n self.ajaxTotalDuration = Math.round(DateTimeUtils.GetDuration(self.requestSentTime, self.responseFinishedTime) * 1000) / 1000;\r\n if (self.ajaxTotalDuration < 0) {\r\n return null;\r\n }\r\n var dependency = (_a = {\r\n id: \"|\" + self.traceID + \".\" + self.spanID,\r\n target: self.getAbsoluteUrl(),\r\n name: self.getPathName(),\r\n type: ajaxType,\r\n duration: self.ajaxTotalDuration,\r\n success: (+(self.status)) >= 200 && (+(self.status)) < 400,\r\n responseCode: (+(self.status)),\r\n method: self.method\r\n },\r\n _a[strProperties] = { HttpMethod: self.method },\r\n _a);\r\n // Add Ajax perf details if available\r\n _populatePerfData(self, dependency);\r\n if (enableRequestHeaderTracking) {\r\n if (_objKeys(self.requestHeaders).length > 0) {\r\n dependency[strProperties] = dependency[strProperties] || {};\r\n dependency[strProperties].requestHeaders = self.requestHeaders;\r\n }\r\n }\r\n if (getResponse) {\r\n var response = getResponse();\r\n if (response) {\r\n // enrich dependency target with correlation context from the server\r\n var correlationContext = response.correlationContext;\r\n if (correlationContext) {\r\n dependency.correlationContext = /* dependency.target + \" | \" + */ correlationContext;\r\n }\r\n if (response.headerMap) {\r\n if (_objKeys(response.headerMap).length > 0) {\r\n dependency[strProperties] = dependency[strProperties] || {};\r\n dependency[strProperties].responseHeaders = response.headerMap;\r\n }\r\n }\r\n if (self.status >= 400) {\r\n var responseType = response.type;\r\n dependency[strProperties] = dependency[strProperties] || {};\r\n if (responseType === \"\" || responseType === \"text\") {\r\n dependency[strProperties][strResponseText] = response[strResponseText] ? response.statusText + \" - \" + response[strResponseText] : response.statusText;\r\n }\r\n if (responseType === \"json\") {\r\n dependency[strProperties][strResponseText] = response.response ? response.statusText + \" - \" + JSON.stringify(response.response) : response.statusText;\r\n }\r\n }\r\n }\r\n }\r\n return dependency;\r\n var _a;\r\n };\r\n });\r\n }\r\n// Removed Stub for ajaxRecord.prototype.getAbsoluteUrl.\r\n// Removed Stub for ajaxRecord.prototype.getPathName.\r\n// Removed Stub for ajaxRecord.prototype.CreateTrackItem.\r\n return ajaxRecord;\r\n}());\r\nexport { ajaxRecord };\r\n;\r\n//# sourceMappingURL=ajaxRecord.js.map","/*!\n * Application Insights JavaScript SDK - Dependencies Plugin, 2.5.4\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\nimport { Util } from '@microsoft/applicationinsights-common';\r\nvar Traceparent = /** @class */ (function () {\r\n function Traceparent(traceId, spanId) {\r\n var self = this;\r\n self.traceFlag = Traceparent.DEFAULT_TRACE_FLAG;\r\n self.version = Traceparent.DEFAULT_VERSION;\r\n if (traceId && Traceparent.isValidTraceId(traceId)) {\r\n self.traceId = traceId;\r\n }\r\n else {\r\n self.traceId = Util.generateW3CId();\r\n }\r\n if (spanId && Traceparent.isValidSpanId(spanId)) {\r\n self.spanId = spanId;\r\n }\r\n else {\r\n self.spanId = Util.generateW3CId().substr(0, 16);\r\n }\r\n }\r\n Traceparent.isValidTraceId = function (id) {\r\n return id.match(/^[0-9a-f]{32}$/) && id !== \"00000000000000000000000000000000\";\r\n };\r\n Traceparent.isValidSpanId = function (id) {\r\n return id.match(/^[0-9a-f]{16}$/) && id !== \"0000000000000000\";\r\n };\r\n Traceparent.prototype.toString = function () {\r\n var self = this;\r\n return self.version + \"-\" + self.traceId + \"-\" + self.spanId + \"-\" + self.traceFlag;\r\n };\r\n Traceparent.DEFAULT_TRACE_FLAG = \"01\";\r\n Traceparent.DEFAULT_VERSION = \"00\";\r\n return Traceparent;\r\n}());\r\nexport { Traceparent };\r\n//# sourceMappingURL=TraceParent.js.map","/*!\n * Application Insights JavaScript SDK - Dependencies Plugin, 2.5.4\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport * as tslib_1 from \"tslib\";\r\nimport { RequestHeaders, Util, CorrelationIdHelper, TelemetryItemCreator, RemoteDependencyData, DateTimeUtils, DisabledPropertyName, PropertiesPluginIdentifier, DistributedTracingModes } from '@microsoft/applicationinsights-common';\r\nimport { CoreUtils, LoggingSeverity, _InternalMessageId, BaseTelemetryPlugin, getLocation, getGlobal, strUndefined, strPrototype, InstrumentFunc, InstrumentProto, getPerformance } from '@microsoft/applicationinsights-core-js';\r\nimport { ajaxRecord } from './ajaxRecord';\r\nimport { EventHelper } from './ajaxUtils';\r\nimport { Traceparent } from './TraceParent';\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nvar AJAX_MONITOR_PREFIX = \"ai.ajxmn.\";\r\nvar strDiagLog = \"diagLog\";\r\nvar strAjaxData = \"ajaxData\";\r\nvar strThrowInternal = \"throwInternal\";\r\nvar strFetch = \"fetch\";\r\nvar _isNullOrUndefined = CoreUtils.isNullOrUndefined;\r\nvar _arrForEach = CoreUtils.arrForEach;\r\nvar _objKeys = CoreUtils.objKeys;\r\n// Using a global value so that to handle same iKey with multiple app insights instances (mostly for testing)\r\nvar _markCount = 0;\r\n/** @Ignore */\r\nfunction _supportsFetch() {\r\n var _global = getGlobal();\r\n if (!_global ||\r\n _isNullOrUndefined(_global.Request) ||\r\n _isNullOrUndefined(_global.Request[strPrototype]) ||\r\n _isNullOrUndefined(_global[strFetch])) {\r\n return null;\r\n }\r\n return _global[strFetch];\r\n}\r\n/**\r\n * Determines whether ajax monitoring can be enabled on this document\r\n * @returns True if Ajax monitoring is supported on this page, otherwise false\r\n * @ignore\r\n */\r\nfunction _supportsAjaxMonitoring(ajaxMonitorInstance) {\r\n var result = false;\r\n if (typeof XMLHttpRequest !== strUndefined && !_isNullOrUndefined(XMLHttpRequest)) {\r\n var proto = XMLHttpRequest[strPrototype];\r\n result = !_isNullOrUndefined(proto) &&\r\n !_isNullOrUndefined(proto.open) &&\r\n !_isNullOrUndefined(proto.send) &&\r\n !_isNullOrUndefined(proto.abort);\r\n }\r\n // disable in IE8 or older (https://www.w3schools.com/jsref/jsref_trim_string.asp)\r\n try {\r\n \" a \".trim();\r\n }\r\n catch (ex) {\r\n result = false;\r\n }\r\n if (result) {\r\n // Disable if the XmlHttpRequest can't be extended or hooked\r\n try {\r\n var xhr = new XMLHttpRequest();\r\n xhr[strAjaxData] = {};\r\n // Check that we can update the prototype\r\n var theOpen = XMLHttpRequest[strPrototype].open;\r\n XMLHttpRequest[strPrototype].open = theOpen;\r\n }\r\n catch (e) {\r\n // We can't decorate the xhr object so disable monitoring\r\n result = false;\r\n _throwInternalCritical(ajaxMonitorInstance, _InternalMessageId.FailedMonitorAjaxOpen, \"Failed to enable XMLHttpRequest monitoring, extension is not supported\", {\r\n exception: Util.dump(e)\r\n });\r\n }\r\n }\r\n return result;\r\n}\r\n/** @Ignore */\r\nfunction _getFailedAjaxDiagnosticsMessage(xhr) {\r\n var result = \"\";\r\n try {\r\n if (!_isNullOrUndefined(xhr) &&\r\n !_isNullOrUndefined(xhr[strAjaxData]) &&\r\n !_isNullOrUndefined(xhr[strAjaxData].requestUrl)) {\r\n result += \"(url: '\" + xhr[strAjaxData].requestUrl + \"')\";\r\n }\r\n }\r\n catch (e) { }\r\n return result;\r\n}\r\n/** @ignore */\r\nfunction _throwInternalCritical(ajaxMonitorInstance, msgId, message, properties, isUserAct) {\r\n ajaxMonitorInstance[strDiagLog]()[strThrowInternal](LoggingSeverity.CRITICAL, msgId, message, properties, isUserAct);\r\n}\r\n/** @ignore */\r\nfunction _throwInternalWarning(ajaxMonitorInstance, msgId, message, properties, isUserAct) {\r\n ajaxMonitorInstance[strDiagLog]()[strThrowInternal](LoggingSeverity.WARNING, msgId, message, properties, isUserAct);\r\n}\r\n/** @Ignore */\r\nfunction _createErrorCallbackFunc(ajaxMonitorInstance, internalMessage, message) {\r\n // tslint:disable-next-line\r\n return function (args) {\r\n _throwInternalCritical(ajaxMonitorInstance, internalMessage, message, {\r\n ajaxDiagnosticsMessage: _getFailedAjaxDiagnosticsMessage(args.inst),\r\n exception: Util.dump(args.err)\r\n });\r\n };\r\n}\r\nfunction _indexOf(value, match) {\r\n if (value && match) {\r\n return value.indexOf(match);\r\n }\r\n return -1;\r\n}\r\nvar AjaxMonitor = /** @class */ (function (_super) {\r\n tslib_1.__extends(AjaxMonitor, _super);\r\n function AjaxMonitor() {\r\n var _this = _super.call(this) || this;\r\n _this.identifier = AjaxMonitor.identifier;\r\n _this.priority = 120;\r\n var strTrackDependencyDataInternal = \"trackDependencyDataInternal\"; // Using string to help with minification\r\n var location = getLocation();\r\n var _fetchInitialized = false; // fetch monitoring initialized\r\n var _xhrInitialized = false; // XHR monitoring initialized\r\n var _currentWindowHost = location && location.host && location.host.toLowerCase();\r\n var _config = AjaxMonitor.getEmptyConfig();\r\n var _enableRequestHeaderTracking = false;\r\n var _trackAjaxAttempts = 0;\r\n var _context;\r\n var _isUsingW3CHeaders;\r\n var _isUsingAIHeaders;\r\n var _markPrefix;\r\n var _enableAjaxPerfTracking = false;\r\n var _maxAjaxCallsPerView = 0;\r\n var _enableResponseHeaderTracking = false;\r\n var _hooks = [];\r\n var _disabledUrls = {};\r\n dynamicProto(AjaxMonitor, _this, function (_self, base) {\r\n _self.initialize = function (config, core, extensions, pluginChain) {\r\n if (!_self.isInitialized()) {\r\n base.initialize(config, core, extensions, pluginChain);\r\n var ctx_1 = _self._getTelCtx();\r\n var defaultConfig_1 = AjaxMonitor.getDefaultConfig();\r\n _arrForEach(_objKeys(defaultConfig_1), function (field) {\r\n _config[field] = ctx_1.getConfig(AjaxMonitor.identifier, field, defaultConfig_1[field]);\r\n });\r\n var distributedTracingMode = _config.distributedTracingMode;\r\n _enableRequestHeaderTracking = _config.enableRequestHeaderTracking;\r\n _enableAjaxPerfTracking = _config.enableAjaxPerfTracking;\r\n _maxAjaxCallsPerView = _config.maxAjaxCallsPerView;\r\n _enableResponseHeaderTracking = _config.enableResponseHeaderTracking;\r\n _isUsingAIHeaders = distributedTracingMode === DistributedTracingModes.AI || distributedTracingMode === DistributedTracingModes.AI_AND_W3C;\r\n _isUsingW3CHeaders = distributedTracingMode === DistributedTracingModes.AI_AND_W3C || distributedTracingMode === DistributedTracingModes.W3C;\r\n if (_enableAjaxPerfTracking) {\r\n var iKey = config.instrumentationKey || \"unkwn\";\r\n if (iKey.length > 5) {\r\n _markPrefix = AJAX_MONITOR_PREFIX + iKey.substring(iKey.length - 5) + \".\";\r\n }\r\n else {\r\n _markPrefix = AJAX_MONITOR_PREFIX + iKey + \".\";\r\n }\r\n }\r\n if (_config.disableAjaxTracking === false) {\r\n _instrumentXhr();\r\n }\r\n _instrumentFetch();\r\n if (extensions.length > 0 && extensions) {\r\n var propExt = void 0, extIx = 0;\r\n while (!propExt && extIx < extensions.length) {\r\n if (extensions[extIx] && extensions[extIx].identifier === PropertiesPluginIdentifier) {\r\n propExt = extensions[extIx];\r\n }\r\n extIx++;\r\n }\r\n if (propExt) {\r\n _context = propExt.context; // we could move IPropertiesPlugin to common as well\r\n }\r\n }\r\n }\r\n };\r\n _self.teardown = function () {\r\n // Remove all instrumentation hooks\r\n _arrForEach(_hooks, function (fn) {\r\n fn.rm();\r\n });\r\n _hooks = [];\r\n _fetchInitialized = false;\r\n _xhrInitialized = false;\r\n _self.setInitialized(false);\r\n };\r\n _self.trackDependencyData = function (dependency, properties) {\r\n _self[strTrackDependencyDataInternal](dependency, properties);\r\n };\r\n _self.includeCorrelationHeaders = function (ajaxData, input, init, xhr) {\r\n // Test Hook to allow the overriding of the location host\r\n var currentWindowHost = _self[\"_currentWindowHost\"] || _currentWindowHost;\r\n if (input) {\r\n if (CorrelationIdHelper.canIncludeCorrelationHeader(_config, ajaxData.getAbsoluteUrl(), currentWindowHost)) {\r\n if (!init) {\r\n init = {};\r\n }\r\n // init headers override original request headers\r\n // so, if they exist use only them, otherwise use request's because they should have been applied in the first place\r\n // not using original request headers will result in them being lost\r\n init.headers = new Headers(init.headers || (input instanceof Request ? (input.headers || {}) : {}));\r\n if (_isUsingAIHeaders) {\r\n var id = \"|\" + ajaxData.traceID + \".\" + ajaxData.spanID;\r\n init.headers.set(RequestHeaders.requestIdHeader, id);\r\n if (_enableRequestHeaderTracking) {\r\n ajaxData.requestHeaders[RequestHeaders.requestIdHeader] = id;\r\n }\r\n }\r\n var appId = _config.appId || (_context && _context.appId());\r\n if (appId) {\r\n init.headers.set(RequestHeaders.requestContextHeader, RequestHeaders.requestContextAppIdFormat + appId);\r\n if (_enableRequestHeaderTracking) {\r\n ajaxData.requestHeaders[RequestHeaders.requestContextHeader] = RequestHeaders.requestContextAppIdFormat + appId;\r\n }\r\n }\r\n if (_isUsingW3CHeaders) {\r\n var traceparent = new Traceparent(ajaxData.traceID, ajaxData.spanID);\r\n init.headers.set(RequestHeaders.traceParentHeader, traceparent.toString());\r\n if (_enableRequestHeaderTracking) {\r\n ajaxData.requestHeaders[RequestHeaders.traceParentHeader] = traceparent.toString();\r\n }\r\n }\r\n }\r\n return init;\r\n }\r\n else if (xhr) {\r\n if (CorrelationIdHelper.canIncludeCorrelationHeader(_config, ajaxData.getAbsoluteUrl(), currentWindowHost)) {\r\n if (_isUsingAIHeaders) {\r\n var id = \"|\" + ajaxData.traceID + \".\" + ajaxData.spanID;\r\n xhr.setRequestHeader(RequestHeaders.requestIdHeader, id);\r\n if (_enableRequestHeaderTracking) {\r\n ajaxData.requestHeaders[RequestHeaders.requestIdHeader] = id;\r\n }\r\n }\r\n var appId = _config.appId || (_context && _context.appId());\r\n if (appId) {\r\n xhr.setRequestHeader(RequestHeaders.requestContextHeader, RequestHeaders.requestContextAppIdFormat + appId);\r\n if (_enableRequestHeaderTracking) {\r\n ajaxData.requestHeaders[RequestHeaders.requestContextHeader] = RequestHeaders.requestContextAppIdFormat + appId;\r\n }\r\n }\r\n if (_isUsingW3CHeaders) {\r\n var traceparent = new Traceparent(ajaxData.traceID, ajaxData.spanID);\r\n xhr.setRequestHeader(RequestHeaders.traceParentHeader, traceparent.toString());\r\n if (_enableRequestHeaderTracking) {\r\n ajaxData.requestHeaders[RequestHeaders.traceParentHeader] = traceparent.toString();\r\n }\r\n }\r\n }\r\n return xhr;\r\n }\r\n return undefined;\r\n };\r\n _self[strTrackDependencyDataInternal] = function (dependency, properties, systemProperties) {\r\n if (_maxAjaxCallsPerView === -1 || _trackAjaxAttempts < _maxAjaxCallsPerView) {\r\n // Hack since expected format in w3c mode is |abc.def.\r\n // Non-w3c format is |abc.def\r\n // @todo Remove if better solution is available, e.g. handle in portal \r\n if ((_config.distributedTracingMode === DistributedTracingModes.W3C\r\n || _config.distributedTracingMode === DistributedTracingModes.AI_AND_W3C)\r\n && typeof dependency.id === \"string\" && dependency.id[dependency.id.length - 1] !== \".\") {\r\n dependency.id += \".\";\r\n }\r\n var item = TelemetryItemCreator.create(dependency, RemoteDependencyData.dataType, RemoteDependencyData.envelopeType, _self[strDiagLog](), properties, systemProperties);\r\n _self.core.track(item);\r\n }\r\n else if (_trackAjaxAttempts === _maxAjaxCallsPerView) {\r\n _throwInternalCritical(_self, _InternalMessageId.MaxAjaxPerPVExceeded, \"Maximum ajax per page view limit reached, ajax monitoring is paused until the next trackPageView(). In order to increase the limit set the maxAjaxCallsPerView configuration parameter.\", true);\r\n }\r\n ++_trackAjaxAttempts;\r\n };\r\n // Fetch Stuff\r\n function _instrumentFetch() {\r\n var fetch = _supportsFetch();\r\n if (!fetch) {\r\n return;\r\n }\r\n var global = getGlobal();\r\n var isPolyfill = fetch.polyfill;\r\n if (_config.disableFetchTracking === false) {\r\n _hooks.push(InstrumentFunc(global, strFetch, {\r\n // Add request hook\r\n req: function (callDetails, input, init) {\r\n var fetchData;\r\n if (_fetchInitialized &&\r\n !_isDisabledRequest(null, input, init) &&\r\n // If we have a polyfil and XHR instrumented then let XHR report otherwise we get duplicates\r\n !(isPolyfill && _xhrInitialized)) {\r\n var ctx = callDetails.ctx();\r\n fetchData = _createFetchRecord(input, init);\r\n var newInit = _self.includeCorrelationHeaders(fetchData, input, init);\r\n if (newInit !== init) {\r\n callDetails.set(1, newInit);\r\n }\r\n ctx.data = fetchData;\r\n }\r\n },\r\n rsp: function (callDetails, input) {\r\n var fetchData = callDetails.ctx().data;\r\n if (fetchData) {\r\n // Replace the result with the new promise from this code\r\n callDetails.rslt = callDetails.rslt.then(function (response) {\r\n _reportFetchMetrics(callDetails, (response || {}).status, response, fetchData, function () {\r\n var ajaxResponse = {\r\n statusText: response.statusText,\r\n headerMap: null,\r\n correlationContext: _getFetchCorrelationContext(response)\r\n };\r\n if (_enableResponseHeaderTracking) {\r\n var responseHeaderMap_1 = {};\r\n response.headers.forEach(function (value, name) {\r\n responseHeaderMap_1[name] = value;\r\n });\r\n ajaxResponse.headerMap = responseHeaderMap_1;\r\n }\r\n return ajaxResponse;\r\n });\r\n return response;\r\n })[\"catch\"](function (reason) {\r\n _reportFetchMetrics(callDetails, 0, input, fetchData, null, { error: reason.message });\r\n throw reason;\r\n });\r\n }\r\n },\r\n // Create an error callback to report any hook errors\r\n hkErr: _createErrorCallbackFunc(_self, _InternalMessageId.FailedMonitorAjaxOpen, \"Failed to monitor Window.fetch, monitoring data for this fetch call may be incorrect.\")\r\n }));\r\n _fetchInitialized = true;\r\n }\r\n else if (isPolyfill) {\r\n // If fetch is a polyfill we need to capture the request to ensure that we correctly track\r\n // disabled request URLS (i.e. internal urls) to ensure we don't end up in a constant loop\r\n // of reporting ourselves, for example React Native uses a polyfill for fetch\r\n // Note: Polyfill implementations that don't support the \"poyyfill\" tag are not supported\r\n // the workaround is to add a polyfill property to your fetch implementation before initializing\r\n // App Insights\r\n _hooks.push(InstrumentFunc(global, strFetch, {\r\n req: function (callDetails, input, init) {\r\n // Just call so that we record any disabled URL\r\n _isDisabledRequest(null, input, init);\r\n }\r\n }));\r\n }\r\n if (isPolyfill) {\r\n // retag the instrumented fetch with the same polyfill settings this is mostly for testing\r\n // But also supports multiple App Insights usages\r\n global[strFetch].polyfill = isPolyfill;\r\n }\r\n }\r\n function _hookProto(target, funcName, callbacks) {\r\n _hooks.push(InstrumentProto(target, funcName, callbacks));\r\n }\r\n function _instrumentXhr() {\r\n if (_supportsAjaxMonitoring(_self) && !_xhrInitialized) {\r\n // Instrument open\r\n _hookProto(XMLHttpRequest, \"open\", {\r\n req: function (args, method, url, async) {\r\n var xhr = args.inst;\r\n var ajaxData = xhr[strAjaxData];\r\n if (!_isDisabledRequest(xhr, url) && _isMonitoredXhrInstance(xhr, true) &&\r\n (!ajaxData || !ajaxData.xhrMonitoringState.openDone)) {\r\n _openHandler(xhr, method, url, async);\r\n }\r\n },\r\n hkErr: _createErrorCallbackFunc(_self, _InternalMessageId.FailedMonitorAjaxOpen, \"Failed to monitor XMLHttpRequest.open, monitoring data for this ajax call may be incorrect.\")\r\n });\r\n // Instrument send\r\n _hookProto(XMLHttpRequest, \"send\", {\r\n req: function (args, context) {\r\n var xhr = args.inst;\r\n var ajaxData = xhr[strAjaxData];\r\n if (_isMonitoredXhrInstance(xhr) && !ajaxData.xhrMonitoringState.sendDone) {\r\n _createMarkId(\"xhr\", ajaxData);\r\n ajaxData.requestSentTime = DateTimeUtils.Now();\r\n xhr = _self.includeCorrelationHeaders(ajaxData, undefined, undefined, xhr);\r\n ajaxData.xhrMonitoringState.sendDone = true;\r\n }\r\n },\r\n hkErr: _createErrorCallbackFunc(_self, _InternalMessageId.FailedMonitorAjaxSend, \"Failed to monitor XMLHttpRequest, monitoring data for this ajax call may be incorrect.\")\r\n });\r\n // Instrument abort\r\n _hookProto(XMLHttpRequest, \"abort\", {\r\n req: function (args) {\r\n var xhr = args.inst;\r\n var ajaxData = xhr[strAjaxData];\r\n if (_isMonitoredXhrInstance(xhr) && !ajaxData.xhrMonitoringState.abortDone) {\r\n ajaxData.aborted = 1;\r\n ajaxData.xhrMonitoringState.abortDone = true;\r\n }\r\n },\r\n hkErr: _createErrorCallbackFunc(_self, _InternalMessageId.FailedMonitorAjaxAbort, \"Failed to monitor XMLHttpRequest.abort, monitoring data for this ajax call may be incorrect.\")\r\n });\r\n // Instrument setRequestHeader\r\n if (_enableRequestHeaderTracking) {\r\n _hookProto(XMLHttpRequest, \"setRequestHeader\", {\r\n req: function (args, header, value) {\r\n var xhr = args.inst;\r\n if (_isMonitoredXhrInstance(xhr)) {\r\n xhr[strAjaxData].requestHeaders[header] = value;\r\n }\r\n },\r\n hkErr: _createErrorCallbackFunc(_self, _InternalMessageId.FailedMonitorAjaxSetRequestHeader, \"Failed to monitor XMLHttpRequest.setRequestHeader, monitoring data for this ajax call may be incorrect.\")\r\n });\r\n }\r\n _xhrInitialized = true;\r\n }\r\n }\r\n function _isDisabledRequest(xhr, request, init) {\r\n var isDisabled = false;\r\n var theUrl = ((!CoreUtils.isString(request) ? (request || {}).url || \"\" : request) || \"\").toLowerCase();\r\n var idx = _indexOf(theUrl, \"?\");\r\n var idx2 = _indexOf(theUrl, \"#\");\r\n if (idx === -1 || (idx2 !== -1 && idx2 < idx)) {\r\n idx = idx2;\r\n }\r\n if (idx !== -1) {\r\n // Strip off any Query string\r\n theUrl = theUrl.substring(0, idx);\r\n }\r\n // check that this instance is not not used by ajax call performed inside client side monitoring to send data to collector\r\n if (!_isNullOrUndefined(xhr)) {\r\n // Look on the XMLHttpRequest of the URL string value\r\n isDisabled = xhr[DisabledPropertyName] === true || theUrl[DisabledPropertyName] === true;\r\n }\r\n else if (!_isNullOrUndefined(request)) {\r\n // Look for DisabledPropertyName in either Request or RequestInit\r\n isDisabled = (typeof request === 'object' ? request[DisabledPropertyName] === true : false) ||\r\n (init ? init[DisabledPropertyName] === true : false);\r\n }\r\n if (isDisabled) {\r\n // Add the disabled url if not present\r\n if (!_disabledUrls[theUrl]) {\r\n _disabledUrls[theUrl] = 1;\r\n }\r\n }\r\n else {\r\n // Check to see if the url is listed as disabled\r\n if (_disabledUrls[theUrl]) {\r\n isDisabled = true;\r\n }\r\n }\r\n return isDisabled;\r\n }\r\n /// Verifies that particalar instance of XMLHttpRequest needs to be monitored\r\n /// Optional parameter. True if ajaxData must be excluded from verification\r\n /// True if instance needs to be monitored, otherwise false\r\n function _isMonitoredXhrInstance(xhr, excludeAjaxDataValidation) {\r\n var ajaxValidation = true;\r\n var initialized = _xhrInitialized;\r\n if (!_isNullOrUndefined(xhr)) {\r\n ajaxValidation = excludeAjaxDataValidation === true || !_isNullOrUndefined(xhr[strAjaxData]);\r\n }\r\n // checking to see that all interested functions on xhr were instrumented\r\n return initialized\r\n // checking on ajaxData to see that it was not removed in user code\r\n && ajaxValidation;\r\n }\r\n function _openHandler(xhr, method, url, async) {\r\n var traceID = (_context && _context.telemetryTrace && _context.telemetryTrace.traceID) || Util.generateW3CId();\r\n var spanID = Util.generateW3CId().substr(0, 16);\r\n var ajaxData = new ajaxRecord(traceID, spanID, _self[strDiagLog]());\r\n ajaxData.method = method;\r\n ajaxData.requestUrl = url;\r\n ajaxData.xhrMonitoringState.openDone = true;\r\n ajaxData.requestHeaders = {};\r\n ajaxData.async = async;\r\n xhr[strAjaxData] = ajaxData;\r\n _attachToOnReadyStateChange(xhr);\r\n }\r\n function _attachToOnReadyStateChange(xhr) {\r\n xhr[strAjaxData].xhrMonitoringState.stateChangeAttached = EventHelper.Attach(xhr, \"readystatechange\", function () {\r\n try {\r\n if (xhr && xhr.readyState === 4 && _isMonitoredXhrInstance(xhr)) {\r\n _onAjaxComplete(xhr);\r\n }\r\n }\r\n catch (e) {\r\n var exceptionText = Util.dump(e);\r\n // ignore messages with c00c023f, as this a known IE9 XHR abort issue\r\n if (!exceptionText || _indexOf(exceptionText.toLowerCase(), \"c00c023f\") === -1) {\r\n _throwInternalCritical(_self, _InternalMessageId.FailedMonitorAjaxRSC, \"Failed to monitor XMLHttpRequest 'readystatechange' event handler, monitoring data for this ajax call may be incorrect.\", {\r\n ajaxDiagnosticsMessage: _getFailedAjaxDiagnosticsMessage(xhr),\r\n exception: exceptionText\r\n });\r\n }\r\n }\r\n });\r\n }\r\n function _getResponseText(xhr) {\r\n try {\r\n var responseType = xhr.responseType;\r\n if (responseType === \"\" || responseType === \"text\") {\r\n // As per the specification responseText is only valid if the type is an empty string or \"text\"\r\n return xhr.responseText;\r\n }\r\n }\r\n catch (e) {\r\n // This shouldn't happend because of the above check -- but just in case, so just ignore\r\n }\r\n return null;\r\n }\r\n function _onAjaxComplete(xhr) {\r\n var ajaxData = xhr[strAjaxData];\r\n ajaxData.responseFinishedTime = DateTimeUtils.Now();\r\n ajaxData.status = xhr.status;\r\n function _reportXhrError(e, failedProps) {\r\n var errorProps = failedProps || {};\r\n errorProps[\"ajaxDiagnosticsMessage\"] = _getFailedAjaxDiagnosticsMessage(xhr);\r\n if (e) {\r\n errorProps[\"exception\"] = Util.dump(e);\r\n }\r\n _throwInternalWarning(_self, _InternalMessageId.FailedMonitorAjaxDur, \"Failed to calculate the duration of the ajax call, monitoring data for this ajax call won't be sent.\", errorProps);\r\n }\r\n _findPerfResourceEntry(\"xmlhttprequest\", ajaxData, function () {\r\n try {\r\n var dependency = ajaxData.CreateTrackItem(\"Ajax\", _enableRequestHeaderTracking, function () {\r\n var ajaxResponse = {\r\n statusText: xhr.statusText,\r\n headerMap: null,\r\n correlationContext: _getAjaxCorrelationContext(xhr),\r\n type: xhr.responseType,\r\n responseText: _getResponseText(xhr),\r\n response: xhr.response\r\n };\r\n if (_enableResponseHeaderTracking) {\r\n var headers = xhr.getAllResponseHeaders();\r\n if (headers) {\r\n // xhr.getAllResponseHeaders() method returns all the response headers, separated by CRLF, as a string or null\r\n // the regex converts the header string into an array of individual headers\r\n var arr = headers.trim().split(/[\\r\\n]+/);\r\n var responseHeaderMap_2 = {};\r\n _arrForEach(arr, function (line) {\r\n var parts = line.split(': ');\r\n var header = parts.shift();\r\n var value = parts.join(': ');\r\n responseHeaderMap_2[header] = value;\r\n });\r\n ajaxResponse.headerMap = responseHeaderMap_2;\r\n }\r\n }\r\n return ajaxResponse;\r\n });\r\n if (dependency) {\r\n _self[strTrackDependencyDataInternal](dependency);\r\n }\r\n else {\r\n _reportXhrError(null, {\r\n requestSentTime: ajaxData.requestSentTime,\r\n responseFinishedTime: ajaxData.responseFinishedTime\r\n });\r\n }\r\n }\r\n finally {\r\n // cleanup telemetry data\r\n try {\r\n xhr[strAjaxData] = null;\r\n }\r\n catch (e) {\r\n // May throw in environments that prevent extension or freeze xhr\r\n }\r\n }\r\n }, function (e) {\r\n _reportXhrError(e, null);\r\n });\r\n }\r\n function _getAjaxCorrelationContext(xhr) {\r\n try {\r\n var responseHeadersString = xhr.getAllResponseHeaders();\r\n if (responseHeadersString !== null) {\r\n var index = _indexOf(responseHeadersString.toLowerCase(), RequestHeaders.requestContextHeaderLowerCase);\r\n if (index !== -1) {\r\n var responseHeader = xhr.getResponseHeader(RequestHeaders.requestContextHeader);\r\n return CorrelationIdHelper.getCorrelationContext(responseHeader);\r\n }\r\n }\r\n }\r\n catch (e) {\r\n _throwInternalWarning(_self, _InternalMessageId.FailedMonitorAjaxGetCorrelationHeader, \"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.\", {\r\n ajaxDiagnosticsMessage: _getFailedAjaxDiagnosticsMessage(xhr),\r\n exception: Util.dump(e)\r\n });\r\n }\r\n }\r\n function _createMarkId(type, ajaxData) {\r\n if (ajaxData.requestUrl && _markPrefix && _enableAjaxPerfTracking) {\r\n var performance_1 = getPerformance();\r\n if (performance_1 && CoreUtils.isFunction(performance_1.mark)) {\r\n _markCount++;\r\n var markId = _markPrefix + type + \"#\" + _markCount;\r\n performance_1.mark(markId);\r\n var entries = performance_1.getEntriesByName(markId);\r\n if (entries && entries.length === 1) {\r\n ajaxData.perfMark = entries[0];\r\n }\r\n }\r\n }\r\n }\r\n function _findPerfResourceEntry(initiatorType, ajaxData, trackCallback, reportError) {\r\n var perfMark = ajaxData.perfMark;\r\n var performance = getPerformance();\r\n var maxAttempts = _config.maxAjaxPerfLookupAttempts;\r\n var retryDelay = _config.ajaxPerfLookupDelay;\r\n var requestUrl = ajaxData.requestUrl;\r\n var attempt = 0;\r\n (function locateResourceTiming() {\r\n try {\r\n if (performance && perfMark) {\r\n attempt++;\r\n var perfTiming = null;\r\n var entries = performance.getEntries();\r\n for (var lp = entries.length - 1; lp >= 0; lp--) {\r\n var entry = entries[lp];\r\n if (entry) {\r\n if (entry.entryType === \"resource\") {\r\n if (entry.initiatorType === initiatorType &&\r\n (_indexOf(entry.name, requestUrl) !== -1 || _indexOf(requestUrl, entry.name) !== -1)) {\r\n perfTiming = entry;\r\n }\r\n }\r\n else if (entry.entryType === \"mark\" && entry.name === perfMark.name) {\r\n // We hit the start event\r\n ajaxData.perfTiming = perfTiming;\r\n break;\r\n }\r\n if (entry.startTime < perfMark.startTime - 1000) {\r\n // Fallback to try and reduce the time spent looking for the perf entry\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n if (!perfMark || // - we don't have a perfMark or\r\n ajaxData.perfTiming || // - we have not found the perf entry or \r\n attempt >= maxAttempts || // - we have tried too many attempts or\r\n ajaxData.async === false) {\r\n if (perfMark && CoreUtils.isFunction(performance.clearMarks)) {\r\n // Remove the mark so we don't fill up the performance resources too much\r\n performance.clearMarks(perfMark.name);\r\n }\r\n ajaxData.perfAttempts = attempt;\r\n // just continue and report the track event\r\n trackCallback();\r\n }\r\n else {\r\n // We need to wait for the browser to populate the window.performance entry\r\n // This needs to be at least 1ms as waiting <= 1 (on firefox) is not enough time for fetch or xhr, \r\n // this is a scheduling issue for the browser implementation\r\n setTimeout(locateResourceTiming, retryDelay);\r\n }\r\n }\r\n catch (e) {\r\n reportError(e);\r\n }\r\n })();\r\n }\r\n function _createFetchRecord(input, init) {\r\n var traceID = (_context && _context.telemetryTrace && _context.telemetryTrace.traceID) || Util.generateW3CId();\r\n var spanID = Util.generateW3CId().substr(0, 16);\r\n var ajaxData = new ajaxRecord(traceID, spanID, _self[strDiagLog]());\r\n ajaxData.requestSentTime = DateTimeUtils.Now();\r\n if (input instanceof Request) {\r\n ajaxData.requestUrl = input ? input.url : \"\";\r\n }\r\n else {\r\n ajaxData.requestUrl = input;\r\n }\r\n var method = \"GET\";\r\n if (init && init.method) {\r\n method = init.method;\r\n }\r\n else if (input && input instanceof Request) {\r\n method = input.method;\r\n }\r\n ajaxData.method = method;\r\n var requestHeaders = {};\r\n if (_enableRequestHeaderTracking) {\r\n var headers = new Headers((init ? init.headers : 0) || (input instanceof Request ? (input.headers || {}) : {}));\r\n headers.forEach(function (value, key) {\r\n requestHeaders[key] = value;\r\n });\r\n }\r\n ajaxData.requestHeaders = requestHeaders;\r\n _createMarkId(\"fetch\", ajaxData);\r\n return ajaxData;\r\n }\r\n function _getFailedFetchDiagnosticsMessage(input) {\r\n var result = \"\";\r\n try {\r\n if (!_isNullOrUndefined(input)) {\r\n if (typeof (input) === \"string\") {\r\n result += \"(url: '\" + input + \"')\";\r\n }\r\n else {\r\n result += \"(url: '\" + input.url + \"')\";\r\n }\r\n }\r\n }\r\n catch (e) {\r\n _throwInternalCritical(_self, _InternalMessageId.FailedMonitorAjaxOpen, \"Failed to grab failed fetch diagnostics message\", { exception: Util.dump(e) });\r\n }\r\n return result;\r\n }\r\n function _reportFetchMetrics(callDetails, status, input, ajaxData, getResponse, properties) {\r\n if (!ajaxData) {\r\n return;\r\n }\r\n function _reportFetchError(msgId, e, failedProps) {\r\n var errorProps = failedProps || {};\r\n errorProps[\"fetchDiagnosticsMessage\"] = _getFailedFetchDiagnosticsMessage(input);\r\n if (e) {\r\n errorProps[\"exception\"] = Util.dump(e);\r\n }\r\n _throwInternalWarning(_self, msgId, \"Failed to calculate the duration of the fetch call, monitoring data for this fetch call won't be sent.\", errorProps);\r\n }\r\n ajaxData.responseFinishedTime = DateTimeUtils.Now();\r\n ajaxData.status = status;\r\n _findPerfResourceEntry(\"fetch\", ajaxData, function () {\r\n var dependency = ajaxData.CreateTrackItem(\"Fetch\", _enableRequestHeaderTracking, getResponse);\r\n if (dependency) {\r\n _self[strTrackDependencyDataInternal](dependency);\r\n }\r\n else {\r\n _reportFetchError(_InternalMessageId.FailedMonitorAjaxDur, null, {\r\n requestSentTime: ajaxData.requestSentTime,\r\n responseFinishedTime: ajaxData.responseFinishedTime\r\n });\r\n }\r\n }, function (e) {\r\n _reportFetchError(_InternalMessageId.FailedMonitorAjaxGetCorrelationHeader, e, null);\r\n });\r\n }\r\n function _getFetchCorrelationContext(response) {\r\n if (response && response.headers) {\r\n try {\r\n var responseHeader = response.headers.get(RequestHeaders.requestContextHeader);\r\n return CorrelationIdHelper.getCorrelationContext(responseHeader);\r\n }\r\n catch (e) {\r\n _throwInternalWarning(_self, _InternalMessageId.FailedMonitorAjaxGetCorrelationHeader, \"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.\", {\r\n fetchDiagnosticsMessage: _getFailedFetchDiagnosticsMessage(response),\r\n exception: Util.dump(e)\r\n });\r\n }\r\n }\r\n }\r\n });\r\n return _this;\r\n }\r\n AjaxMonitor.getDefaultConfig = function () {\r\n var config = {\r\n maxAjaxCallsPerView: 500,\r\n disableAjaxTracking: false,\r\n disableFetchTracking: true,\r\n disableCorrelationHeaders: false,\r\n distributedTracingMode: DistributedTracingModes.AI,\r\n correlationHeaderExcludedDomains: [\r\n \"*.blob.core.windows.net\",\r\n \"*.blob.core.chinacloudapi.cn\",\r\n \"*.blob.core.cloudapi.de\",\r\n \"*.blob.core.usgovcloudapi.net\"\r\n ],\r\n correlationHeaderDomains: undefined,\r\n appId: undefined,\r\n enableCorsCorrelation: false,\r\n enableRequestHeaderTracking: false,\r\n enableResponseHeaderTracking: false,\r\n enableAjaxErrorStatusText: false,\r\n enableAjaxPerfTracking: false,\r\n maxAjaxPerfLookupAttempts: 3,\r\n ajaxPerfLookupDelay: 25\r\n };\r\n return config;\r\n };\r\n AjaxMonitor.getEmptyConfig = function () {\r\n var emptyConfig = this.getDefaultConfig();\r\n _arrForEach(_objKeys(emptyConfig), function (value) {\r\n emptyConfig[value] = undefined;\r\n });\r\n return emptyConfig;\r\n };\r\n// Removed Stub for AjaxMonitor.prototype.initialize.\r\n// Removed Stub for AjaxMonitor.prototype.teardown.\r\n AjaxMonitor.prototype.processTelemetry = function (item, itemCtx) {\r\n this.processNext(item, itemCtx);\r\n };\r\n// Removed Stub for AjaxMonitor.prototype.trackDependencyData.\r\n// Removed Stub for AjaxMonitor.prototype.includeCorrelationHeaders.\r\n// Removed Stub for AjaxMonitor.prototype.trackDependencyDataInternal.\r\n AjaxMonitor.identifier = \"AjaxDependencyPlugin\";\r\n return AjaxMonitor;\r\n}(BaseTelemetryPlugin));\r\nexport { AjaxMonitor };\r\n//# sourceMappingURL=ajax.js.map","/*!\n * Application Insights JavaScript SDK - Web, 2.5.4\n * Copyright (c) Microsoft and contributors. All rights reserved.\n */\n\r\n\r\nimport { CoreUtils, AppInsightsCore, LoggingSeverity, _InternalMessageId, hasWindow, hasDocument } from \"@microsoft/applicationinsights-core-js\";\r\nimport { ApplicationInsights } from \"@microsoft/applicationinsights-analytics-js\";\r\nimport { Sender } from \"@microsoft/applicationinsights-channel-js\";\r\nimport { PropertiesPlugin } from \"@microsoft/applicationinsights-properties-js\";\r\nimport { AjaxPlugin as DependenciesPlugin } from '@microsoft/applicationinsights-dependencies-js';\r\nimport * as Common from \"@microsoft/applicationinsights-common\";\r\n\"use strict\";\r\n;\r\n/**\r\n * Telemetry type classes, e.g. PageView, Exception, etc\r\n */\r\nexport var Telemetry = Common;\r\n/**\r\n * Application Insights API\r\n * @class Initialization\r\n * @implements {IApplicationInsights}\r\n */\r\nvar Initialization = /** @class */ (function () {\r\n function Initialization(snippet) {\r\n var _this = this;\r\n // initialize the queue and config in case they are undefined\r\n snippet.queue = snippet.queue || [];\r\n snippet.version = snippet.version || 2.0; // Default to new version\r\n var config = snippet.config || {};\r\n if (config.connectionString) {\r\n var cs = Common.ConnectionStringParser.parse(config.connectionString);\r\n var ingest = cs.ingestionendpoint;\r\n config.endpointUrl = ingest ? ingest + \"/v2/track\" : config.endpointUrl; // only add /v2/track when from connectionstring\r\n config.instrumentationKey = cs.instrumentationkey || config.instrumentationKey;\r\n }\r\n _this.appInsights = new ApplicationInsights();\r\n _this.properties = new PropertiesPlugin();\r\n _this.dependencies = new DependenciesPlugin();\r\n _this.core = new AppInsightsCore();\r\n _this.snippet = snippet;\r\n _this.config = config;\r\n _this.getSKUDefaults();\r\n }\r\n // Analytics Plugin\r\n /**\r\n * Log a user action or other occurrence.\r\n * @param {IEventTelemetry} event\r\n * @param {ICustomProperties} [customProperties]\r\n * @memberof Initialization\r\n */\r\n Initialization.prototype.trackEvent = function (event, customProperties) {\r\n this.appInsights.trackEvent(event, customProperties);\r\n };\r\n /**\r\n * Logs that a page, or similar container was displayed to the user.\r\n * @param {IPageViewTelemetry} pageView\r\n * @memberof Initialization\r\n */\r\n Initialization.prototype.trackPageView = function (pageView) {\r\n var inPv = pageView || {};\r\n this.appInsights.trackPageView(inPv);\r\n };\r\n /**\r\n * Log a bag of performance information via the customProperties field.\r\n * @param {IPageViewPerformanceTelemetry} pageViewPerformance\r\n * @memberof Initialization\r\n */\r\n Initialization.prototype.trackPageViewPerformance = function (pageViewPerformance) {\r\n var inPvp = pageViewPerformance || {};\r\n this.appInsights.trackPageViewPerformance(inPvp);\r\n };\r\n /**\r\n * Log an exception that you have caught.\r\n * @param {IExceptionTelemetry} exception\r\n * @memberof Initialization\r\n */\r\n Initialization.prototype.trackException = function (exception) {\r\n if (!exception.exception && exception.error) {\r\n exception.exception = exception.error;\r\n }\r\n this.appInsights.trackException(exception);\r\n };\r\n /**\r\n * Manually send uncaught exception telemetry. This method is automatically triggered\r\n * on a window.onerror event.\r\n * @param {IAutoExceptionTelemetry} exception\r\n * @memberof Initialization\r\n */\r\n Initialization.prototype._onerror = function (exception) {\r\n this.appInsights._onerror(exception);\r\n };\r\n /**\r\n * Log a diagnostic scenario such entering or leaving a function.\r\n * @param {ITraceTelemetry} trace\r\n * @param {ICustomProperties} [customProperties]\r\n * @memberof Initialization\r\n */\r\n Initialization.prototype.trackTrace = function (trace, customProperties) {\r\n this.appInsights.trackTrace(trace, customProperties);\r\n };\r\n /**\r\n * Log a numeric value that is not associated with a specific event. Typically used\r\n * to send regular reports of performance indicators.\r\n *\r\n * To send a single measurement, just use the `name` and `average` fields\r\n * of {@link IMetricTelemetry}.\r\n *\r\n * If you take measurements frequently, you can reduce the telemetry bandwidth by\r\n * aggregating multiple measurements and sending the resulting average and modifying\r\n * the `sampleCount` field of {@link IMetricTelemetry}.\r\n * @param {IMetricTelemetry} metric input object argument. Only `name` and `average` are mandatory.\r\n * @param {ICustomProperties} [customProperties]\r\n * @memberof Initialization\r\n */\r\n Initialization.prototype.trackMetric = function (metric, customProperties) {\r\n this.appInsights.trackMetric(metric, customProperties);\r\n };\r\n /**\r\n * Starts the timer for tracking a page load time. Use this instead of `trackPageView` if you want to control when the page view timer starts and stops,\r\n * but don't want to calculate the duration yourself. This method doesn't send any telemetry. Call `stopTrackPage` to log the end of the page view\r\n * and send the event.\r\n * @param name A string that idenfities this item, unique within this HTML document. Defaults to the document title.\r\n */\r\n Initialization.prototype.startTrackPage = function (name) {\r\n this.appInsights.startTrackPage(name);\r\n };\r\n /**\r\n * Stops the timer that was started by calling `startTrackPage` and sends the pageview load time telemetry with the specified properties and measurements.\r\n * The duration of the page view will be the time between calling `startTrackPage` and `stopTrackPage`.\r\n * @param name The string you used as the name in startTrackPage. Defaults to the document title.\r\n * @param url String - a relative or absolute URL that identifies the page or other item. Defaults to the window location.\r\n * @param properties map[string, string] - additional data used to filter pages and metrics in the portal. Defaults to empty.\r\n * @param measurements map[string, number] - metrics associated with this page, displayed in Metrics Explorer on the portal. Defaults to empty.\r\n */\r\n Initialization.prototype.stopTrackPage = function (name, url, customProperties, measurements) {\r\n this.appInsights.stopTrackPage(name, url, customProperties, measurements);\r\n };\r\n Initialization.prototype.startTrackEvent = function (name) {\r\n this.appInsights.startTrackEvent(name);\r\n };\r\n /**\r\n * Log an extended event that you started timing with `startTrackEvent`.\r\n * @param name The string you used to identify this event in `startTrackEvent`.\r\n * @param properties map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty.\r\n * @param measurements map[string, number] - metrics associated with this event, displayed in Metrics Explorer on the portal. Defaults to empty.\r\n */\r\n Initialization.prototype.stopTrackEvent = function (name, properties, measurements) {\r\n this.appInsights.stopTrackEvent(name, properties, measurements); // Todo: Fix to pass measurements once type is updated\r\n };\r\n Initialization.prototype.addTelemetryInitializer = function (telemetryInitializer) {\r\n return this.appInsights.addTelemetryInitializer(telemetryInitializer);\r\n };\r\n // Properties Plugin\r\n /**\r\n * Set the authenticated user id and the account id. Used for identifying a specific signed-in user. Parameters must not contain whitespace or ,;=|\r\n *\r\n * The method will only set the `authenticatedUserId` and `accountId` in the current page view. To set them for the whole session, you should set `storeInCookie = true`\r\n * @param {string} authenticatedUserId\r\n * @param {string} [accountId]\r\n * @param {boolean} [storeInCookie=false]\r\n * @memberof Initialization\r\n */\r\n Initialization.prototype.setAuthenticatedUserContext = function (authenticatedUserId, accountId, storeInCookie) {\r\n if (storeInCookie === void 0) { storeInCookie = false; }\r\n this.properties.context.user.setAuthenticatedUserContext(authenticatedUserId, accountId, storeInCookie);\r\n };\r\n /**\r\n * Clears the authenticated user id and account id. The associated cookie is cleared, if present.\r\n * @memberof Initialization\r\n */\r\n Initialization.prototype.clearAuthenticatedUserContext = function () {\r\n this.properties.context.user.clearAuthenticatedUserContext();\r\n };\r\n // Dependencies Plugin\r\n /**\r\n * Log a dependency call (e.g. ajax)\r\n * @param {IDependencyTelemetry} dependency\r\n * @memberof Initialization\r\n */\r\n Initialization.prototype.trackDependencyData = function (dependency) {\r\n this.dependencies.trackDependencyData(dependency);\r\n };\r\n // Misc\r\n /**\r\n * Manually trigger an immediate send of all telemetry still in the buffer.\r\n * @param {boolean} [async=true]\r\n * @memberof Initialization\r\n */\r\n Initialization.prototype.flush = function (async) {\r\n if (async === void 0) { async = true; }\r\n CoreUtils.arrForEach(this.core.getTransmissionControls(), function (channels) {\r\n CoreUtils.arrForEach(channels, function (channel) {\r\n channel.flush(async);\r\n });\r\n });\r\n };\r\n /**\r\n * Manually trigger an immediate send of all telemetry still in the buffer using beacon Sender.\r\n * Fall back to xhr sender if beacon is not supported.\r\n * @param {boolean} [async=true]\r\n * @memberof Initialization\r\n */\r\n Initialization.prototype.onunloadFlush = function (async) {\r\n if (async === void 0) { async = true; }\r\n CoreUtils.arrForEach(this.core.getTransmissionControls(), function (channels) {\r\n CoreUtils.arrForEach(channels, function (channel) {\r\n if (channel.onunloadFlush) {\r\n channel.onunloadFlush();\r\n }\r\n else {\r\n channel.flush(async);\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Initialize this instance of ApplicationInsights\r\n * @returns {IApplicationInsights}\r\n * @memberof Initialization\r\n */\r\n Initialization.prototype.loadAppInsights = function (legacyMode) {\r\n if (legacyMode === void 0) { legacyMode = false; }\r\n var _this = this;\r\n function _updateSnippetProperties(snippet) {\r\n if (snippet) {\r\n // apply updated properties to the global instance (snippet)\r\n for (var field in _this) {\r\n if (CoreUtils.isString(field) &&\r\n !CoreUtils.isFunction(_this[field]) &&\r\n field.substring(0, 1) !== \"_\") {\r\n snippet[field] = _this[field];\r\n }\r\n }\r\n }\r\n }\r\n // dont allow additional channels/other extensions for legacy mode; legacy mode is only to allow users to switch with no code changes!\r\n if (legacyMode && _this.config.extensions && _this.config.extensions.length > 0) {\r\n throw new Error(\"Extensions not allowed in legacy mode\");\r\n }\r\n var extensions = [];\r\n var appInsightsChannel = new Sender();\r\n extensions.push(appInsightsChannel);\r\n extensions.push(_this.properties);\r\n extensions.push(_this.dependencies);\r\n extensions.push(_this.appInsights);\r\n // initialize core\r\n _this.core.initialize(_this.config, extensions);\r\n _this.context = _this.properties.context;\r\n _updateSnippetProperties(_this.snippet);\r\n // Empty queue of all api calls logged prior to sdk download\r\n _this.emptyQueue();\r\n _this.pollInternalLogs();\r\n _this.addHousekeepingBeforeUnload(this);\r\n return _this;\r\n };\r\n /**\r\n * Overwrite the lazy loaded fields of global window snippet to contain the\r\n * actual initialized API methods\r\n * @param {Snippet} snippet\r\n * @memberof Initialization\r\n */\r\n Initialization.prototype.updateSnippetDefinitions = function (snippet) {\r\n // apply full appInsights to the global instance\r\n // Note: This must be called before loadAppInsights is called\r\n for (var field in this) {\r\n if (CoreUtils.isString(field)) {\r\n snippet[field] = this[field];\r\n }\r\n }\r\n };\r\n /**\r\n * Call any functions that were queued before the main script was loaded\r\n * @memberof Initialization\r\n */\r\n Initialization.prototype.emptyQueue = function () {\r\n var _this = this;\r\n // call functions that were queued before the main script was loaded\r\n try {\r\n if (Common.Util.isArray(_this.snippet.queue)) {\r\n // note: do not check length in the for-loop conditional in case something goes wrong and the stub methods are not overridden.\r\n var length_1 = _this.snippet.queue.length;\r\n for (var i = 0; i < length_1; i++) {\r\n var call = _this.snippet.queue[i];\r\n call();\r\n }\r\n _this.snippet.queue = undefined;\r\n delete _this.snippet.queue;\r\n }\r\n }\r\n catch (exception) {\r\n var properties = {};\r\n if (exception && CoreUtils.isFunction(exception.toString)) {\r\n properties.exception = exception.toString();\r\n }\r\n // need from core\r\n // Microsoft.ApplicationInsights._InternalLogging.throwInternal(\r\n // LoggingSeverity.WARNING,\r\n // _InternalMessageId.FailedToSendQueuedTelemetry,\r\n // \"Failed to send queued telemetry\",\r\n // properties);\r\n }\r\n };\r\n Initialization.prototype.pollInternalLogs = function () {\r\n this.core.pollInternalLogs();\r\n };\r\n Initialization.prototype.addHousekeepingBeforeUnload = function (appInsightsInstance) {\r\n // Add callback to push events when the user navigates away\r\n if (hasWindow() || hasDocument()) {\r\n var performHousekeeping = function () {\r\n // Adds the ability to flush all data before the page unloads.\r\n // Note: This approach tries to push a sync request with all the pending events onbeforeunload.\r\n // Firefox does not respect this.Other browsers DO push out the call with < 100% hit rate.\r\n // Telemetry here will help us analyze how effective this approach is.\r\n // Another approach would be to make this call sync with a acceptable timeout to reduce the\r\n // impact on user experience.\r\n // appInsightsInstance.context._sender.triggerSend();\r\n appInsightsInstance.onunloadFlush(false);\r\n // Back up the current session to local storage\r\n // This lets us close expired sessions after the cookies themselves expire\r\n var ext = appInsightsInstance.appInsights.core['_extensions'][Common.PropertiesPluginIdentifier];\r\n if (ext && ext.context && ext.context._sessionManager) {\r\n ext.context._sessionManager.backup();\r\n }\r\n };\r\n if (!appInsightsInstance.appInsights.config.disableFlushOnBeforeUnload) {\r\n // Hook the unload event for the document, window and body to ensure that the client events are flushed to the server\r\n // As just hooking the window does not always fire (on chrome) for page navigations.\r\n var added = CoreUtils.addEventHandler('beforeunload', performHousekeeping);\r\n added = CoreUtils.addEventHandler('pagehide', performHousekeeping) || added;\r\n if (!added) {\r\n appInsightsInstance.appInsights.core.logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.FailedToAddHandlerForOnBeforeUnload, 'Could not add handler for beforeunload and pagehide');\r\n }\r\n }\r\n // We also need to hook the pagehide event as not all versions of Safari support load/unload events.\r\n if (!appInsightsInstance.appInsights.config.disableFlushOnUnload) {\r\n // Not adding any telemetry as pagehide as it's not supported on all browsers\r\n CoreUtils.addEventHandler('pagehide', performHousekeeping);\r\n }\r\n }\r\n };\r\n Initialization.prototype.getSKUDefaults = function () {\r\n var _this = this;\r\n _this.config.diagnosticLogInterval =\r\n _this.config.diagnosticLogInterval && _this.config.diagnosticLogInterval > 0 ? _this.config.diagnosticLogInterval : 10000;\r\n };\r\n return Initialization;\r\n}());\r\nexport { Initialization };\r\n//# sourceMappingURL=Initialization.js.map"],"sourceRoot":""}