@microsoft/applicationinsights-clickanalytics-js 3.3.6-nightly3.2502-14 → 3.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/es5/{ai.clck.3.3.6-nightly3.2502-14.cjs.js → ai.clck.3.3.6.cjs.js} +138 -168
- package/browser/es5/ai.clck.3.3.6.cjs.js.map +1 -0
- package/browser/es5/ai.clck.3.3.6.cjs.min.js +6 -0
- package/browser/es5/ai.clck.3.3.6.cjs.min.js.map +1 -0
- package/browser/es5/{ai.clck.3.3.6-nightly3.2502-14.gbl.js → ai.clck.3.3.6.gbl.js} +140 -170
- package/browser/es5/ai.clck.3.3.6.gbl.js.map +1 -0
- package/browser/es5/ai.clck.3.3.6.gbl.min.js +6 -0
- package/browser/es5/ai.clck.3.3.6.gbl.min.js.map +1 -0
- package/browser/es5/ai.clck.3.3.6.integrity.json +66 -0
- package/browser/es5/{ai.clck.3.3.6-nightly3.2502-14.js → ai.clck.3.3.6.js} +140 -170
- package/browser/es5/ai.clck.3.3.6.js.map +1 -0
- package/browser/es5/ai.clck.3.3.6.min.js +6 -0
- package/browser/es5/ai.clck.3.3.6.min.js.map +1 -0
- package/browser/es5/ai.clck.3.cjs.js +137 -167
- package/browser/es5/ai.clck.3.cjs.js.map +1 -1
- package/browser/es5/ai.clck.3.cjs.min.js +2 -2
- package/browser/es5/ai.clck.3.cjs.min.js.map +1 -1
- package/browser/es5/ai.clck.3.gbl.js +139 -169
- package/browser/es5/ai.clck.3.gbl.js.map +1 -1
- package/browser/es5/ai.clck.3.gbl.min.js +2 -2
- package/browser/es5/ai.clck.3.gbl.min.js.map +1 -1
- package/browser/es5/ai.clck.3.integrity.json +25 -25
- package/browser/es5/ai.clck.3.js +139 -169
- package/browser/es5/ai.clck.3.js.map +1 -1
- package/browser/es5/ai.clck.3.min.js +2 -2
- package/browser/es5/ai.clck.3.min.js.map +1 -1
- package/dist/es5/applicationinsights-clickanalytics-js.js +137 -167
- package/dist/es5/applicationinsights-clickanalytics-js.js.map +1 -1
- package/dist/es5/applicationinsights-clickanalytics-js.min.js +2 -2
- package/dist/es5/applicationinsights-clickanalytics-js.min.js.map +1 -1
- package/dist-es5/Behaviours.js +1 -1
- package/dist-es5/ClickAnalyticsPlugin.js +28 -29
- package/dist-es5/ClickAnalyticsPlugin.js.map +1 -1
- package/dist-es5/DataCollector.js +9 -9
- package/dist-es5/DataCollector.js.map +1 -1
- package/dist-es5/Enums.js +1 -1
- package/dist-es5/Interfaces/Datamodel.js +1 -1
- package/dist-es5/__DynamicConstants.js +12 -23
- package/dist-es5/__DynamicConstants.js.map +1 -1
- package/dist-es5/applicationinsights-clickanalytics-js.js +1 -1
- package/dist-es5/common/Utils.js +1 -1
- package/dist-es5/events/PageAction.js +14 -14
- package/dist-es5/events/PageAction.js.map +1 -1
- package/dist-es5/events/WebEvent.js +7 -7
- package/dist-es5/events/WebEvent.js.map +1 -1
- package/dist-es5/handlers/AutoCaptureHandler.js +4 -4
- package/dist-es5/handlers/AutoCaptureHandler.js.map +1 -1
- package/dist-es5/handlers/DomContentHandler.js +13 -15
- package/dist-es5/handlers/DomContentHandler.js.map +1 -1
- package/package.json +65 -68
- package/types/applicationinsights-clickanalytics-js.d.ts +1 -1
- package/types/applicationinsights-clickanalytics-js.namespaced.d.ts +1 -1
- package/browser/es5/ai.clck.3.3.6-nightly3.2502-14.cjs.js.map +0 -1
- package/browser/es5/ai.clck.3.3.6-nightly3.2502-14.cjs.min.js +0 -6
- package/browser/es5/ai.clck.3.3.6-nightly3.2502-14.cjs.min.js.map +0 -1
- package/browser/es5/ai.clck.3.3.6-nightly3.2502-14.gbl.js.map +0 -1
- package/browser/es5/ai.clck.3.3.6-nightly3.2502-14.gbl.min.js +0 -6
- package/browser/es5/ai.clck.3.3.6-nightly3.2502-14.gbl.min.js.map +0 -1
- package/browser/es5/ai.clck.3.3.6-nightly3.2502-14.integrity.json +0 -66
- package/browser/es5/ai.clck.3.3.6-nightly3.2502-14.js.map +0 -1
- package/browser/es5/ai.clck.3.3.6-nightly3.2502-14.min.js +0 -6
- package/browser/es5/ai.clck.3.3.6-nightly3.2502-14.min.js.map +0 -1
package/dist-es5/Behaviours.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Application Insights JavaScript SDK - Click Analytics, 3.3.6
|
|
2
|
+
* Application Insights JavaScript SDK - Click Analytics, 3.3.6
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @copyright Microsoft 2020
|
|
7
7
|
*/
|
|
8
|
-
var _a, _b
|
|
8
|
+
var _a, _b;
|
|
9
9
|
import { __extendsFn as __extends } from "@microsoft/applicationinsights-shims";
|
|
10
10
|
import dynamicProto from "@microsoft/dynamicproto-js";
|
|
11
11
|
import { PropertiesPluginIdentifier } from "@microsoft/applicationinsights-common";
|
|
12
12
|
import { BaseTelemetryPlugin, _throwInternal, arrForEach, cfgDfFunc, cfgDfMerge, cfgDfString, cfgDfValidate, createProcessTelemetryContext, dumpObj, getExceptionName, isNullOrUndefined, onConfigChange, throwError, unloadComponents } from "@microsoft/applicationinsights-core-js";
|
|
13
13
|
import { getDocument, hasDocument, objDeepFreeze, strSubstring, strTrim } from "@nevware21/ts-utils";
|
|
14
|
-
import {
|
|
14
|
+
import { _DYN_CAPTURE_ALL_META_DAT1, _DYN_DEFAULT_RIGHT_CLICK_2, _DYN_INDEX_OF, _DYN_LENGTH, _DYN_META_DATA_PREFIX, _DYN_PARENT_DATA_TAG, _DYN_TRACK_PAGE_ACTION, _DYN_USE_DEFAULT_CONTENT_0 } from "./__DynamicConstants";
|
|
15
15
|
import { BehaviorEnumValidator, BehaviorMapValidator, BehaviorValueValidator, DEFAULT_AI_BLOB_ATTRIBUTE_TAG, DEFAULT_DATA_PREFIX, DEFAULT_DONOT_TRACK_TAG } from "./common/Utils";
|
|
16
16
|
import { PageAction } from "./events/PageAction";
|
|
17
17
|
import { AutoCaptureHandler } from "./handlers/AutoCaptureHandler";
|
|
@@ -19,31 +19,30 @@ import { DomContentHandler } from "./handlers/DomContentHandler";
|
|
|
19
19
|
export { BehaviorMapValidator, BehaviorValueValidator, BehaviorEnumValidator };
|
|
20
20
|
var defaultValues = objDeepFreeze((_a = {
|
|
21
21
|
autoCapture: true,
|
|
22
|
-
callback: cfgDfMerge(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
callback: cfgDfMerge({
|
|
23
|
+
pageActionPageTags: cfgDfFunc(),
|
|
24
|
+
pageName: cfgDfFunc(),
|
|
25
|
+
contentName: cfgDfFunc()
|
|
26
|
+
}),
|
|
27
27
|
pageTags: {},
|
|
28
|
-
coreData: cfgDfMerge(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
28
|
+
coreData: cfgDfMerge({
|
|
29
|
+
referrerUri: hasDocument() ? getDocument().referrer : "",
|
|
30
|
+
requestUri: cfgDfString(),
|
|
31
|
+
pageName: cfgDfString(),
|
|
32
|
+
pageType: cfgDfString()
|
|
33
|
+
}),
|
|
34
|
+
dataTags: cfgDfMerge((_b = {},
|
|
35
|
+
_b[_DYN_USE_DEFAULT_CONTENT_0 /* @min:useDefaultContentNameOrId */] = false,
|
|
36
|
+
_b.aiBlobAttributeTag = DEFAULT_AI_BLOB_ATTRIBUTE_TAG,
|
|
37
|
+
_b.customDataPrefix = cfgDfValidate(_dataPrefixChk, DEFAULT_DATA_PREFIX),
|
|
38
|
+
_b[_DYN_CAPTURE_ALL_META_DAT1 /* @min:captureAllMetaDataContent */] = false,
|
|
39
|
+
_b.dntDataTag = DEFAULT_DONOT_TRACK_TAG,
|
|
40
|
+
_b[_DYN_META_DATA_PREFIX /* @min:metaDataPrefix */] = cfgDfString(),
|
|
41
|
+
_b[_DYN_PARENT_DATA_TAG /* @min:parentDataTag */] = cfgDfString(),
|
|
42
|
+
_b)),
|
|
43
|
+
behaviorValidator: cfgDfFunc(function (key) { return key || ""; })
|
|
44
44
|
},
|
|
45
|
-
_a[
|
|
46
|
-
_a[_DYN_DEFAULT_RIGHT_CLICK_3 /* @min:defaultRightClickBhvr */] = cfgDfString(),
|
|
45
|
+
_a[_DYN_DEFAULT_RIGHT_CLICK_2 /* @min:defaultRightClickBhvr */] = cfgDfString(),
|
|
47
46
|
_a.dropInvalidEvents = false,
|
|
48
47
|
_a.urlCollectHash = false,
|
|
49
48
|
_a.urlCollectQuery = false,
|
|
@@ -120,10 +119,10 @@ var ClickAnalyticsPlugin = /** @class */ (function (_super) {
|
|
|
120
119
|
var logger = _self.diagLog();
|
|
121
120
|
_contentHandler = new DomContentHandler(_config, logger);
|
|
122
121
|
var metaTags = _contentHandler.getMetadata();
|
|
123
|
-
_pageAction = new PageAction(_self, _config, _contentHandler, _config.callback
|
|
122
|
+
_pageAction = new PageAction(_self, _config, _contentHandler, _config.callback.pageActionPageTags, metaTags, logger);
|
|
124
123
|
// Default to DOM autoCapture handler
|
|
125
124
|
if (_autoCaptureHandler) {
|
|
126
|
-
_autoCaptureHandler
|
|
125
|
+
_autoCaptureHandler._doUnload();
|
|
127
126
|
}
|
|
128
127
|
_autoCaptureHandler = new AutoCaptureHandler(_self, _config, _pageAction, logger);
|
|
129
128
|
var autoCapture = !!_config.autoCapture;
|
|
@@ -146,7 +145,7 @@ var ClickAnalyticsPlugin = /** @class */ (function (_super) {
|
|
|
146
145
|
// Removed Stub for ClickAnalyticsPlugin.prototype.initialize.
|
|
147
146
|
// Removed Stub for ClickAnalyticsPlugin.prototype.processTelemetry.
|
|
148
147
|
// Removed Stub for ClickAnalyticsPlugin.prototype.trackPageAction.
|
|
149
|
-
ClickAnalyticsPlugin.Version = '3.3.6
|
|
148
|
+
ClickAnalyticsPlugin.Version = '3.3.6';
|
|
150
149
|
return ClickAnalyticsPlugin;
|
|
151
150
|
}(BaseTelemetryPlugin));
|
|
152
151
|
export { ClickAnalyticsPlugin };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClickAnalyticsPlugin.js.map","sources":["ClickAnalyticsPlugin.js"],"sourcesContent":["/**\r\n* @copyright Microsoft 2020\r\n*/\r\nvar _a, _b, _c, _d;\r\nimport { __extends } from \"tslib\";\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { PropertiesPluginIdentifier } from \"@microsoft/applicationinsights-common\";\r\nimport { BaseTelemetryPlugin, _throwInternal, arrForEach, cfgDfFunc, cfgDfMerge, cfgDfString, cfgDfValidate, createProcessTelemetryContext, dumpObj, getExceptionName, isNullOrUndefined, onConfigChange, throwError, unloadComponents } from \"@microsoft/applicationinsights-core-js\";\r\nimport { getDocument, hasDocument, objDeepFreeze, strSubstring, strTrim } from \"@nevware21/ts-utils\";\r\nimport { _DYN_BEHAVIOR_VALIDATOR, _DYN_CAPTURE_ALL_META_DAT2, _DYN_CONTENT_NAME, _DYN_DEFAULT_RIGHT_CLICK_3, _DYN_INDEX_OF, _DYN_LENGTH, _DYN_META_DATA_PREFIX, _DYN_PAGE_ACTION_PAGE_TAG0, _DYN_PAGE_NAME, _DYN_PAGE_TYPE, _DYN_PARENT_DATA_TAG, _DYN_REQUEST_URI, _DYN_TRACK_PAGE_ACTION, _DYN_USE_DEFAULT_CONTENT_1, _DYN__DO_UNLOAD } from \"./__DynamicConstants\";\r\nimport { BehaviorEnumValidator, BehaviorMapValidator, BehaviorValueValidator, DEFAULT_AI_BLOB_ATTRIBUTE_TAG, DEFAULT_DATA_PREFIX, DEFAULT_DONOT_TRACK_TAG } from \"./common/Utils\";\r\nimport { PageAction } from \"./events/PageAction\";\r\nimport { AutoCaptureHandler } from \"./handlers/AutoCaptureHandler\";\r\nimport { DomContentHandler } from \"./handlers/DomContentHandler\";\r\nexport { BehaviorMapValidator, BehaviorValueValidator, BehaviorEnumValidator };\r\nvar defaultValues = objDeepFreeze((_a = {\r\n autoCapture: true,\r\n callback: cfgDfMerge((_b = {},\r\n _b[_DYN_PAGE_ACTION_PAGE_TAG0 /* @min:pageActionPageTags */] = cfgDfFunc(),\r\n _b[_DYN_PAGE_NAME /* @min:pageName */] = cfgDfFunc(),\r\n _b[_DYN_CONTENT_NAME /* @min:contentName */] = cfgDfFunc(),\r\n _b)),\r\n pageTags: {},\r\n coreData: cfgDfMerge((_c = {\r\n referrerUri: hasDocument() ? getDocument().referrer : \"\"\r\n },\r\n _c[_DYN_REQUEST_URI /* @min:requestUri */] = cfgDfString(),\r\n _c[_DYN_PAGE_NAME /* @min:pageName */] = cfgDfString(),\r\n _c[_DYN_PAGE_TYPE /* @min:pageType */] = cfgDfString(),\r\n _c)),\r\n dataTags: cfgDfMerge((_d = {},\r\n _d[_DYN_USE_DEFAULT_CONTENT_1 /* @min:useDefaultContentNameOrId */] = false,\r\n _d.aiBlobAttributeTag = DEFAULT_AI_BLOB_ATTRIBUTE_TAG,\r\n _d.customDataPrefix = cfgDfValidate(_dataPrefixChk, DEFAULT_DATA_PREFIX),\r\n _d[_DYN_CAPTURE_ALL_META_DAT2 /* @min:captureAllMetaDataContent */] = false,\r\n _d.dntDataTag = DEFAULT_DONOT_TRACK_TAG,\r\n _d[_DYN_META_DATA_PREFIX /* @min:metaDataPrefix */] = cfgDfString(),\r\n _d[_DYN_PARENT_DATA_TAG /* @min:parentDataTag */] = cfgDfString(),\r\n _d))\r\n },\r\n _a[_DYN_BEHAVIOR_VALIDATOR /* @min:behaviorValidator */] = cfgDfFunc(function (key) { return key || \"\"; }),\r\n _a[_DYN_DEFAULT_RIGHT_CLICK_3 /* @min:defaultRightClickBhvr */] = cfgDfString(),\r\n _a.dropInvalidEvents = false,\r\n _a.urlCollectHash = false,\r\n _a.urlCollectQuery = false,\r\n _a));\r\nfunction _dataPrefixChk(val) {\r\n return val && val[_DYN_INDEX_OF /* @min:%2eindexOf */](DEFAULT_DATA_PREFIX) === 0;\r\n}\r\nvar ClickAnalyticsPlugin = /** @class */ (function (_super) {\r\n __extends(ClickAnalyticsPlugin, _super);\r\n function ClickAnalyticsPlugin() {\r\n var _this = _super.call(this) || this;\r\n _this.identifier = \"ClickAnalyticsPlugin\";\r\n _this.priority = 181;\r\n var _config;\r\n var _pageAction;\r\n var _autoCaptureHandler;\r\n var _contentHandler;\r\n var _autoCapture;\r\n dynamicProto(ClickAnalyticsPlugin, _this, function (_self, _base) {\r\n var _identifier = _self.identifier;\r\n _initDefaults();\r\n _self.initialize = function (config, core, extensions, pluginChain) {\r\n if (isNullOrUndefined(core)) {\r\n throwError(\"Error initializing\");\r\n }\r\n _super.prototype.initialize.call(_this, config, core, extensions, pluginChain);\r\n _populateDefaults(config);\r\n // Find the properties plugin.\r\n var _propertiesExtension;\r\n arrForEach(extensions, function (extension) {\r\n if (extension.identifier === PropertiesPluginIdentifier) {\r\n _propertiesExtension = extension;\r\n }\r\n });\r\n // Append Click Analytics Plugin Version to SDK version.\r\n if (_propertiesExtension && _propertiesExtension.context && _propertiesExtension.context.internal) {\r\n var theVersion = _propertiesExtension.context.internal.sdkVersion;\r\n if (theVersion) {\r\n theVersion += \"_ClickPlugin\" + ClickAnalyticsPlugin.Version;\r\n if (theVersion[_DYN_LENGTH /* @min:%2elength */] > 64) {\r\n theVersion = strTrim(strSubstring(theVersion, 0, 64));\r\n }\r\n _propertiesExtension.context.internal.sdkVersion = theVersion;\r\n }\r\n }\r\n };\r\n _self.processTelemetry = function (env, itemCtx) {\r\n _self.processNext(env, itemCtx);\r\n };\r\n _self[_DYN_TRACK_PAGE_ACTION /* @min:%2etrackPageAction */] = function (pageAction, customProperties) {\r\n try {\r\n _pageAction[_DYN_TRACK_PAGE_ACTION /* @min:%2etrackPageAction */](pageAction, customProperties);\r\n }\r\n catch (e) {\r\n _throwInternal(_self.diagLog(), 1 /* eLoggingSeverity.CRITICAL */, 103 /* _eInternalMessageId.TrackPageActionEventFailed */, \"trackPageAction failed, page action event will not be collected: \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n };\r\n _self._doTeardown = function (unloadCtx, unloadState, asyncCallback) {\r\n return unloadComponents([\r\n _autoCaptureHandler,\r\n _contentHandler,\r\n _pageAction\r\n ], unloadCtx, unloadState, function () {\r\n _initDefaults();\r\n asyncCallback && asyncCallback();\r\n });\r\n };\r\n function _populateDefaults(config) {\r\n var core = _self.core;\r\n _self._addHook(onConfigChange(config, function (details) {\r\n var config = details.cfg;\r\n var ctx = createProcessTelemetryContext(null, config, core);\r\n var _config = ctx.getExtCfg(_identifier, defaultValues);\r\n var logger = _self.diagLog();\r\n _contentHandler = new DomContentHandler(_config, logger);\r\n var metaTags = _contentHandler.getMetadata();\r\n _pageAction = new PageAction(_self, _config, _contentHandler, _config.callback[_DYN_PAGE_ACTION_PAGE_TAG0 /* @min:%2epageActionPageTags */], metaTags, logger);\r\n // Default to DOM autoCapture handler\r\n if (_autoCaptureHandler) {\r\n _autoCaptureHandler[_DYN__DO_UNLOAD /* @min:%2e_doUnload */]();\r\n }\r\n _autoCaptureHandler = new AutoCaptureHandler(_self, _config, _pageAction, logger);\r\n var autoCapture = !!_config.autoCapture;\r\n if (!_autoCapture && autoCapture) {\r\n _autoCaptureHandler.click();\r\n }\r\n _autoCapture = autoCapture;\r\n }));\r\n }\r\n function _initDefaults() {\r\n _config = null;\r\n _pageAction = null;\r\n _autoCaptureHandler = null;\r\n _contentHandler = null;\r\n _autoCapture = false;\r\n }\r\n });\r\n return _this;\r\n }\r\n ClickAnalyticsPlugin.prototype.initialize = function (config, core, extensions, pluginChain) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n ClickAnalyticsPlugin.prototype.processTelemetry = function (env, itemCtx) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Logs a page action event.\r\n * @param IPageActionTelemetry - The page action event to log.\r\n * @param customProperties - Additional data used to filter events and metrics. Defaults to empty.\r\n */\r\n ClickAnalyticsPlugin.prototype.trackPageAction = function (pageAction, customProperties) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n ClickAnalyticsPlugin.Version = '3.3.6-nightly3.2502-14';\r\n return ClickAnalyticsPlugin;\r\n}(BaseTelemetryPlugin));\r\nexport { ClickAnalyticsPlugin };\r\n//# sourceMappingURL=ClickAnalyticsPlugin.js.map"],"names":[],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA,gFAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;mEAaM;AACN;AACA;AACA;AACA;AACA"}
|
|
1
|
+
{"version":3,"file":"ClickAnalyticsPlugin.js.map","sources":["ClickAnalyticsPlugin.js"],"sourcesContent":["/**\r\n* @copyright Microsoft 2020\r\n*/\r\nvar _a, _b;\r\nimport { __extends } from \"tslib\";\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { PropertiesPluginIdentifier } from \"@microsoft/applicationinsights-common\";\r\nimport { BaseTelemetryPlugin, _throwInternal, arrForEach, cfgDfFunc, cfgDfMerge, cfgDfString, cfgDfValidate, createProcessTelemetryContext, dumpObj, getExceptionName, isNullOrUndefined, onConfigChange, throwError, unloadComponents } from \"@microsoft/applicationinsights-core-js\";\r\nimport { getDocument, hasDocument, objDeepFreeze, strSubstring, strTrim } from \"@nevware21/ts-utils\";\r\nimport { _DYN_CAPTURE_ALL_META_DAT1, _DYN_DEFAULT_RIGHT_CLICK_2, _DYN_INDEX_OF, _DYN_LENGTH, _DYN_META_DATA_PREFIX, _DYN_PARENT_DATA_TAG, _DYN_TRACK_PAGE_ACTION, _DYN_USE_DEFAULT_CONTENT_0 } from \"./__DynamicConstants\";\r\nimport { BehaviorEnumValidator, BehaviorMapValidator, BehaviorValueValidator, DEFAULT_AI_BLOB_ATTRIBUTE_TAG, DEFAULT_DATA_PREFIX, DEFAULT_DONOT_TRACK_TAG } from \"./common/Utils\";\r\nimport { PageAction } from \"./events/PageAction\";\r\nimport { AutoCaptureHandler } from \"./handlers/AutoCaptureHandler\";\r\nimport { DomContentHandler } from \"./handlers/DomContentHandler\";\r\nexport { BehaviorMapValidator, BehaviorValueValidator, BehaviorEnumValidator };\r\nvar defaultValues = objDeepFreeze((_a = {\r\n autoCapture: true,\r\n callback: cfgDfMerge({\r\n pageActionPageTags: cfgDfFunc(),\r\n pageName: cfgDfFunc(),\r\n contentName: cfgDfFunc()\r\n }),\r\n pageTags: {},\r\n coreData: cfgDfMerge({\r\n referrerUri: hasDocument() ? getDocument().referrer : \"\",\r\n requestUri: cfgDfString(),\r\n pageName: cfgDfString(),\r\n pageType: cfgDfString()\r\n }),\r\n dataTags: cfgDfMerge((_b = {},\r\n _b[_DYN_USE_DEFAULT_CONTENT_0 /* @min:useDefaultContentNameOrId */] = false,\r\n _b.aiBlobAttributeTag = DEFAULT_AI_BLOB_ATTRIBUTE_TAG,\r\n _b.customDataPrefix = cfgDfValidate(_dataPrefixChk, DEFAULT_DATA_PREFIX),\r\n _b[_DYN_CAPTURE_ALL_META_DAT1 /* @min:captureAllMetaDataContent */] = false,\r\n _b.dntDataTag = DEFAULT_DONOT_TRACK_TAG,\r\n _b[_DYN_META_DATA_PREFIX /* @min:metaDataPrefix */] = cfgDfString(),\r\n _b[_DYN_PARENT_DATA_TAG /* @min:parentDataTag */] = cfgDfString(),\r\n _b)),\r\n behaviorValidator: cfgDfFunc(function (key) { return key || \"\"; })\r\n },\r\n _a[_DYN_DEFAULT_RIGHT_CLICK_2 /* @min:defaultRightClickBhvr */] = cfgDfString(),\r\n _a.dropInvalidEvents = false,\r\n _a.urlCollectHash = false,\r\n _a.urlCollectQuery = false,\r\n _a));\r\nfunction _dataPrefixChk(val) {\r\n return val && val[_DYN_INDEX_OF /* @min:%2eindexOf */](DEFAULT_DATA_PREFIX) === 0;\r\n}\r\nvar ClickAnalyticsPlugin = /** @class */ (function (_super) {\r\n __extends(ClickAnalyticsPlugin, _super);\r\n function ClickAnalyticsPlugin() {\r\n var _this = _super.call(this) || this;\r\n _this.identifier = \"ClickAnalyticsPlugin\";\r\n _this.priority = 181;\r\n var _config;\r\n var _pageAction;\r\n var _autoCaptureHandler;\r\n var _contentHandler;\r\n var _autoCapture;\r\n dynamicProto(ClickAnalyticsPlugin, _this, function (_self, _base) {\r\n var _identifier = _self.identifier;\r\n _initDefaults();\r\n _self.initialize = function (config, core, extensions, pluginChain) {\r\n if (isNullOrUndefined(core)) {\r\n throwError(\"Error initializing\");\r\n }\r\n _super.prototype.initialize.call(_this, config, core, extensions, pluginChain);\r\n _populateDefaults(config);\r\n // Find the properties plugin.\r\n var _propertiesExtension;\r\n arrForEach(extensions, function (extension) {\r\n if (extension.identifier === PropertiesPluginIdentifier) {\r\n _propertiesExtension = extension;\r\n }\r\n });\r\n // Append Click Analytics Plugin Version to SDK version.\r\n if (_propertiesExtension && _propertiesExtension.context && _propertiesExtension.context.internal) {\r\n var theVersion = _propertiesExtension.context.internal.sdkVersion;\r\n if (theVersion) {\r\n theVersion += \"_ClickPlugin\" + ClickAnalyticsPlugin.Version;\r\n if (theVersion[_DYN_LENGTH /* @min:%2elength */] > 64) {\r\n theVersion = strTrim(strSubstring(theVersion, 0, 64));\r\n }\r\n _propertiesExtension.context.internal.sdkVersion = theVersion;\r\n }\r\n }\r\n };\r\n _self.processTelemetry = function (env, itemCtx) {\r\n _self.processNext(env, itemCtx);\r\n };\r\n _self[_DYN_TRACK_PAGE_ACTION /* @min:%2etrackPageAction */] = function (pageAction, customProperties) {\r\n try {\r\n _pageAction[_DYN_TRACK_PAGE_ACTION /* @min:%2etrackPageAction */](pageAction, customProperties);\r\n }\r\n catch (e) {\r\n _throwInternal(_self.diagLog(), 1 /* eLoggingSeverity.CRITICAL */, 103 /* _eInternalMessageId.TrackPageActionEventFailed */, \"trackPageAction failed, page action event will not be collected: \" + getExceptionName(e), { exception: dumpObj(e) });\r\n }\r\n };\r\n _self._doTeardown = function (unloadCtx, unloadState, asyncCallback) {\r\n return unloadComponents([\r\n _autoCaptureHandler,\r\n _contentHandler,\r\n _pageAction\r\n ], unloadCtx, unloadState, function () {\r\n _initDefaults();\r\n asyncCallback && asyncCallback();\r\n });\r\n };\r\n function _populateDefaults(config) {\r\n var core = _self.core;\r\n _self._addHook(onConfigChange(config, function (details) {\r\n var config = details.cfg;\r\n var ctx = createProcessTelemetryContext(null, config, core);\r\n var _config = ctx.getExtCfg(_identifier, defaultValues);\r\n var logger = _self.diagLog();\r\n _contentHandler = new DomContentHandler(_config, logger);\r\n var metaTags = _contentHandler.getMetadata();\r\n _pageAction = new PageAction(_self, _config, _contentHandler, _config.callback.pageActionPageTags, metaTags, logger);\r\n // Default to DOM autoCapture handler\r\n if (_autoCaptureHandler) {\r\n _autoCaptureHandler._doUnload();\r\n }\r\n _autoCaptureHandler = new AutoCaptureHandler(_self, _config, _pageAction, logger);\r\n var autoCapture = !!_config.autoCapture;\r\n if (!_autoCapture && autoCapture) {\r\n _autoCaptureHandler.click();\r\n }\r\n _autoCapture = autoCapture;\r\n }));\r\n }\r\n function _initDefaults() {\r\n _config = null;\r\n _pageAction = null;\r\n _autoCaptureHandler = null;\r\n _contentHandler = null;\r\n _autoCapture = false;\r\n }\r\n });\r\n return _this;\r\n }\r\n ClickAnalyticsPlugin.prototype.initialize = function (config, core, extensions, pluginChain) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n ClickAnalyticsPlugin.prototype.processTelemetry = function (env, itemCtx) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Logs a page action event.\r\n * @param IPageActionTelemetry - The page action event to log.\r\n * @param customProperties - Additional data used to filter events and metrics. Defaults to empty.\r\n */\r\n ClickAnalyticsPlugin.prototype.trackPageAction = function (pageAction, customProperties) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n ClickAnalyticsPlugin.Version = '3.3.6';\r\n return ClickAnalyticsPlugin;\r\n}(BaseTelemetryPlugin));\r\nexport { ClickAnalyticsPlugin };\r\n//# sourceMappingURL=ClickAnalyticsPlugin.js.map"],"names":[],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA,gFAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;mEAaM;AACN;AACA;AACA;AACA;AACA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Application Insights JavaScript SDK - Click Analytics, 3.3.6
|
|
2
|
+
* Application Insights JavaScript SDK - Click Analytics, 3.3.6
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { getDocument, getLocation, getWindow, hasDocument, isFunction } from "@microsoft/applicationinsights-core-js";
|
|
9
9
|
import { scheduleTimeout } from "@nevware21/ts-utils";
|
|
10
|
-
import {
|
|
10
|
+
import { _DYN_CORE_DATA, _DYN_LENGTH, _DYN_PAGE_NAME, _DYN_REQUEST_URI, _DYN_TAG_NAME, _DYN_TO_UPPER_CASE } from "./__DynamicConstants";
|
|
11
11
|
import { findClosestAnchor, isValueAssigned } from "./common/Utils";
|
|
12
12
|
var clickCaptureInputTypes = { BUTTON: true, CHECKBOX: true, RADIO: true, RESET: true, SUBMIT: true };
|
|
13
13
|
/**
|
|
@@ -50,10 +50,10 @@ export function getClickTarget(element) {
|
|
|
50
50
|
if (type && (clickCaptureInputTypes[type[_DYN_TO_UPPER_CASE /* @min:%2etoUpperCase */]()])) {
|
|
51
51
|
var loc = getLocation() || {};
|
|
52
52
|
if (element.form) {
|
|
53
|
-
clickTarget = element.form.action || (loc
|
|
53
|
+
clickTarget = element.form.action || (loc.pathname || "");
|
|
54
54
|
}
|
|
55
55
|
else {
|
|
56
|
-
clickTarget = loc
|
|
56
|
+
clickTarget = loc.pathname || "";
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
break;
|
|
@@ -73,8 +73,8 @@ export function onDomLoaded(callback) {
|
|
|
73
73
|
else {
|
|
74
74
|
var win = getWindow();
|
|
75
75
|
if (win) {
|
|
76
|
-
if (win
|
|
77
|
-
win
|
|
76
|
+
if (win.addEventListener) {
|
|
77
|
+
win.addEventListener("load", function () {
|
|
78
78
|
callback();
|
|
79
79
|
}); // NB **not** 'onload'
|
|
80
80
|
}
|
|
@@ -131,7 +131,7 @@ export function sanitizeUrl(config, location) {
|
|
|
131
131
|
}
|
|
132
132
|
var url = location.protocol + "//" + (location.hostname || location.host) + // location.hostname is not supported on Opera and Opera for Android
|
|
133
133
|
(isValueAssigned(location.port) ? ":" + location.port : "") +
|
|
134
|
-
location
|
|
134
|
+
location.pathname;
|
|
135
135
|
if (!!config.urlCollectHash) { // false by default
|
|
136
136
|
url += (isValueAssigned(location.hash) ? location.hash : "");
|
|
137
137
|
}
|
|
@@ -147,8 +147,8 @@ export function sanitizeUrl(config, location) {
|
|
|
147
147
|
* @returns Flag indicating if an element is market PII.
|
|
148
148
|
*/
|
|
149
149
|
export function getUri(config, location) {
|
|
150
|
-
if (config
|
|
151
|
-
return config
|
|
150
|
+
if (config[_DYN_CORE_DATA /* @min:%2ecoreData */] && config[_DYN_CORE_DATA /* @min:%2ecoreData */][_DYN_REQUEST_URI /* @min:%2erequestUri */] && config[_DYN_CORE_DATA /* @min:%2ecoreData */][_DYN_REQUEST_URI /* @min:%2erequestUri */] !== "") {
|
|
151
|
+
return config[_DYN_CORE_DATA /* @min:%2ecoreData */][_DYN_REQUEST_URI /* @min:%2erequestUri */];
|
|
152
152
|
}
|
|
153
153
|
return sanitizeUrl(config, location);
|
|
154
154
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataCollector.js.map","sources":["DataCollector.js"],"sourcesContent":["/**\r\n* @copyright Microsoft 2020\r\n*/\r\nimport { getDocument, getLocation, getWindow, hasDocument, isFunction } from \"@microsoft/applicationinsights-core-js\";\r\nimport { scheduleTimeout } from \"@nevware21/ts-utils\";\r\nimport {
|
|
1
|
+
{"version":3,"file":"DataCollector.js.map","sources":["DataCollector.js"],"sourcesContent":["/**\r\n* @copyright Microsoft 2020\r\n*/\r\nimport { getDocument, getLocation, getWindow, hasDocument, isFunction } from \"@microsoft/applicationinsights-core-js\";\r\nimport { scheduleTimeout } from \"@nevware21/ts-utils\";\r\nimport { _DYN_CORE_DATA, _DYN_LENGTH, _DYN_PAGE_NAME, _DYN_REQUEST_URI, _DYN_TAG_NAME, _DYN_TO_UPPER_CASE } from \"./__DynamicConstants\";\r\nimport { findClosestAnchor, isValueAssigned } from \"./common/Utils\";\r\nvar clickCaptureInputTypes = { BUTTON: true, CHECKBOX: true, RADIO: true, RESET: true, SUBMIT: true };\r\n/**\r\n * Get Image href of a given HTMLImageElement\r\n * @param element - An html image element\r\n * @returns Href value.\r\n */\r\nexport function getImageHref(element) {\r\n var temp = element;\r\n if (temp) {\r\n var parent = findClosestAnchor(temp);\r\n if (parent[_DYN_LENGTH /* @min:%2elength */] === 1) {\r\n var firstParent = parent[0];\r\n if (firstParent.href) {\r\n return firstParent.href;\r\n }\r\n else if (firstParent.src) {\r\n return (firstParent.src);\r\n }\r\n }\r\n }\r\n return \"\";\r\n}\r\n/**\r\n * Get click target\r\n * @returns Click target URI\r\n */\r\nexport function getClickTarget(element) {\r\n var clickTarget = \"\";\r\n switch (element[_DYN_TAG_NAME /* @min:%2etagName */]) {\r\n case \"A\":\r\n case \"AREA\":\r\n clickTarget = element.href || \"\";\r\n break;\r\n case \"IMG\":\r\n clickTarget = getImageHref(element);\r\n break;\r\n case \"INPUT\":\r\n var type = element.type;\r\n if (type && (clickCaptureInputTypes[type[_DYN_TO_UPPER_CASE /* @min:%2etoUpperCase */]()])) {\r\n var loc = getLocation() || {};\r\n if (element.form) {\r\n clickTarget = element.form.action || (loc.pathname || \"\");\r\n }\r\n else {\r\n clickTarget = loc.pathname || \"\";\r\n }\r\n }\r\n break;\r\n default:\r\n break;\r\n }\r\n return clickTarget;\r\n}\r\n/**\r\n * Execute callback when DOM finish loading\r\n */\r\nexport function onDomLoaded(callback) {\r\n onDomReadyDo(function () {\r\n if (hasDocument() && getDocument().readyState === \"complete\") {\r\n callback();\r\n }\r\n else {\r\n var win = getWindow();\r\n if (win) {\r\n if (win.addEventListener) {\r\n win.addEventListener(\"load\", function () {\r\n callback();\r\n }); // NB **not** 'onload'\r\n }\r\n else if (win.attachEvent) {\r\n win.attachEvent(\"onload\", function () {\r\n callback();\r\n }); // IE8\r\n }\r\n }\r\n }\r\n });\r\n}\r\n// use smallest domready ever for IE8. When IE8 is deprecated, use addEventListener('DomContentLoaded')\r\nfunction onDomReadyDo(f) {\r\n /// <summary> fires function f on domRead </summary>\r\n /// <param type='function'>function to call on domRead</param>\r\n var doc = getDocument() || {};\r\n /in/.test(doc.readyState) ? scheduleTimeout(function () {\r\n onDomReadyDo(f);\r\n }, 100) : f.call();\r\n}\r\n/**\r\n * Gets the pageName from the DOM or by calling a override if set.\r\n * @param config - configuration object\r\n * @returns Page name.\r\n */\r\nexport function getPageName(config, overrideValues) {\r\n /// <summary>\r\n /// Gets the pageName from the DOM or by calling a override if set.\r\n /// </summary>\r\n if (overrideValues && overrideValues[_DYN_PAGE_NAME /* @min:%2epageName */]) {\r\n return overrideValues[_DYN_PAGE_NAME /* @min:%2epageName */];\r\n }\r\n else if (config.callback && isFunction(config.callback[_DYN_PAGE_NAME /* @min:%2epageName */])) {\r\n return config.callback[_DYN_PAGE_NAME /* @min:%2epageName */]();\r\n }\r\n else if (config.coreData && config.coreData[_DYN_PAGE_NAME /* @min:%2epageName */]) {\r\n return config.coreData[_DYN_PAGE_NAME /* @min:%2epageName */];\r\n }\r\n else {\r\n var doc = getDocument();\r\n return doc && doc.title || \"\";\r\n }\r\n}\r\n/**\r\n * Sanitize URL values\r\n * @param config - Configuration\r\n * @param location - window.location or document.location\r\n * @returns Flag indicating if an element is market PII.\r\n */\r\nexport function sanitizeUrl(config, location) {\r\n if (!location) {\r\n return null;\r\n }\r\n var url = location.protocol + \"//\" + (location.hostname || location.host) + // location.hostname is not supported on Opera and Opera for Android\r\n (isValueAssigned(location.port) ? \":\" + location.port : \"\") +\r\n location.pathname;\r\n if (!!config.urlCollectHash) { // false by default\r\n url += (isValueAssigned(location.hash) ? location.hash : \"\");\r\n }\r\n if (!!config.urlCollectQuery) { // false by default\r\n url += (isValueAssigned(location.search) ? location.search : \"\");\r\n }\r\n return url;\r\n}\r\n/**\r\n * Get URI, sanitize the value if configured on\r\n * @param config - Configuration\r\n * @param location - window.location or document.location\r\n * @returns Flag indicating if an element is market PII.\r\n */\r\nexport function getUri(config, location) {\r\n if (config[_DYN_CORE_DATA /* @min:%2ecoreData */] && config[_DYN_CORE_DATA /* @min:%2ecoreData */][_DYN_REQUEST_URI /* @min:%2erequestUri */] && config[_DYN_CORE_DATA /* @min:%2ecoreData */][_DYN_REQUEST_URI /* @min:%2erequestUri */] !== \"\") {\r\n return config[_DYN_CORE_DATA /* @min:%2ecoreData */][_DYN_REQUEST_URI /* @min:%2erequestUri */];\r\n }\r\n return sanitizeUrl(config, location);\r\n}\r\n//# sourceMappingURL=DataCollector.js.map"],"names":[],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
|
package/dist-es5/Enums.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Application Insights JavaScript SDK - Click Analytics, 3.3.6
|
|
2
|
+
* Application Insights JavaScript SDK - Click Analytics, 3.3.6
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -8,45 +8,35 @@
|
|
|
8
8
|
// ##############################################################
|
|
9
9
|
// AUTO GENERATED FILE: This file is Auto Generated during build.
|
|
10
10
|
// ##############################################################
|
|
11
|
-
//
|
|
12
|
-
// Note: DON'T Export these const from the package as we are still targeting
|
|
13
|
-
//
|
|
11
|
+
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
12
|
+
// Note: DON'T Export these const from the package as we are still targeting ES5 which can result in a mutable variables that someone could change!!!
|
|
13
|
+
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
14
14
|
export var _DYN_INDEX_OF = "indexOf"; // Count: 9
|
|
15
15
|
export var _DYN_LENGTH = "length"; // Count: 6
|
|
16
16
|
export var _DYN_TRACK_PAGE_ACTION = "trackPageAction"; // Count: 4
|
|
17
|
-
export var
|
|
18
|
-
export var
|
|
19
|
-
export var _DYN_PAGE_NAME = "pageName"; // Count: 10
|
|
20
|
-
export var _DYN_CONTENT_NAME = "contentName"; // Count: 13
|
|
21
|
-
export var _DYN_REQUEST_URI = "requestUri"; // Count: 4
|
|
22
|
-
export var _DYN_PAGE_TYPE = "pageType"; // Count: 7
|
|
23
|
-
export var _DYN_USE_DEFAULT_CONTENT_1 = "useDefaultContentNameOrId"; // Count: 5
|
|
24
|
-
export var _DYN_CAPTURE_ALL_META_DAT2 = "captureAllMetaDataContent"; // Count: 3
|
|
17
|
+
export var _DYN_USE_DEFAULT_CONTENT_0 = "useDefaultContentNameOrId"; // Count: 5
|
|
18
|
+
export var _DYN_CAPTURE_ALL_META_DAT1 = "captureAllMetaDataContent"; // Count: 3
|
|
25
19
|
export var _DYN_META_DATA_PREFIX = "metaDataPrefix"; // Count: 3
|
|
26
20
|
export var _DYN_PARENT_DATA_TAG = "parentDataTag"; // Count: 4
|
|
27
|
-
export var
|
|
28
|
-
export var _DYN_DEFAULT_RIGHT_CLICK_3 = "defaultRightClickBhvr"; // Count: 2
|
|
21
|
+
export var _DYN_DEFAULT_RIGHT_CLICK_2 = "defaultRightClickBhvr"; // Count: 2
|
|
29
22
|
export var _DYN_TAG_NAME = "tagName"; // Count: 4
|
|
30
23
|
export var _DYN_TO_UPPER_CASE = "toUpperCase"; // Count: 4
|
|
31
|
-
export var
|
|
32
|
-
export var _DYN_ADD_EVENT_LISTENER = "addEventListener"; // Count: 2
|
|
24
|
+
export var _DYN_PAGE_NAME = "pageName"; // Count: 8
|
|
33
25
|
export var _DYN_CORE_DATA = "coreData"; // Count: 4
|
|
26
|
+
export var _DYN_REQUEST_URI = "requestUri"; // Count: 3
|
|
34
27
|
export var _DYN_GET_ATTRIBUTE = "getAttribute"; // Count: 6
|
|
35
28
|
export var _DYN_PARENT_NODE = "parentNode"; // Count: 3
|
|
36
29
|
export var _DYN_CUSTOM_DATA_PREFIX = "customDataPrefix"; // Count: 3
|
|
37
30
|
export var _DYN_NAME = "name"; // Count: 8
|
|
38
31
|
export var _DYN_DATA = "data"; // Count: 15
|
|
32
|
+
export var _DYN_PAGE_TYPE = "pageType"; // Count: 6
|
|
39
33
|
export var _DYN_PROPERTIES = "properties"; // Count: 4
|
|
40
34
|
export var _DYN_ACTION_TYPE = "actionType"; // Count: 9
|
|
41
35
|
export var _DYN_BEHAVIOR = "behavior"; // Count: 7
|
|
42
|
-
export var _DYN_CLICK_COORDINATES = "clickCoordinates"; // Count: 2
|
|
43
36
|
export var _DYN_CONTENT = "content"; // Count: 4
|
|
44
|
-
export var
|
|
45
|
-
export var _DYN_PARENT_ID = "parentId"; // Count: 3
|
|
46
|
-
export var _DYN_CAPTURE_PAGE_ACTION = "capturePageAction"; // Count: 2
|
|
47
|
-
export var _DYN_SET_COMMON_PROPERTIE4 = "setCommonProperties"; // Count: 2
|
|
48
|
-
export var _DYN_GET_ELEMENT_CONTENT = "getElementContent"; // Count: 2
|
|
37
|
+
export var _DYN_SET_COMMON_PROPERTIE3 = "setCommonProperties"; // Count: 2
|
|
49
38
|
export var _DYN__GET_VALID_BEHAVIOR = "_getValidBehavior"; // Count: 3
|
|
39
|
+
export var _DYN_CONTENT_NAME = "contentName"; // Count: 10
|
|
50
40
|
export var _DYN__TRACE_LOGGER = "_traceLogger"; // Count: 3
|
|
51
41
|
export var _DYN_CLICK_COORDINATE_X = "clickCoordinateX"; // Count: 3
|
|
52
42
|
export var _DYN_CLICK_COORDINATE_Y = "clickCoordinateY"; // Count: 3
|
|
@@ -55,7 +45,6 @@ export var _DYN_DATA_TAGS = "dataTags"; // Count: 6
|
|
|
55
45
|
export var _DYN__PAGE_TAGS = "_pageTags"; // Count: 6
|
|
56
46
|
export var _DYN__PAGE_TAGS_CALLBACK = "_pageTagsCallback"; // Count: 3
|
|
57
47
|
export var _DYN__META_TAGS = "_metaTags"; // Count: 6
|
|
58
|
-
export var _DYN_SET_BASIC_PROPERTIES = "setBasicProperties"; // Count: 2
|
|
59
48
|
export var _DYN__PAGE_TYPE_META_TAG = "_pageTypeMetaTag"; // Count: 3
|
|
60
49
|
export var _DYN__BEHAVIOR_META_TAG = "_behaviorMetaTag"; // Count: 3
|
|
61
50
|
export var _DYN_PARENT_ELEMENT = "parentElement"; // Count: 3
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"__DynamicConstants.js.map","sources":["__DynamicConstants.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n// @skip-file-minify\r\n// ##############################################################\r\n// AUTO GENERATED FILE: This file is Auto Generated during build.\r\n// ##############################################################\r\n//
|
|
1
|
+
{"version":3,"file":"__DynamicConstants.js.map","sources":["__DynamicConstants.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n// @skip-file-minify\r\n// ##############################################################\r\n// AUTO GENERATED FILE: This file is Auto Generated during build.\r\n// ##############################################################\r\n// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n// Note: DON'T Export these const from the package as we are still targeting ES5 which can result in a mutable variables that someone could change!!!\r\n// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\nexport var _DYN_INDEX_OF = \"indexOf\"; // Count: 9\r\nexport var _DYN_LENGTH = \"length\"; // Count: 6\r\nexport var _DYN_TRACK_PAGE_ACTION = \"trackPageAction\"; // Count: 4\r\nexport var _DYN_USE_DEFAULT_CONTENT_0 = \"useDefaultContentNameOrId\"; // Count: 5\r\nexport var _DYN_CAPTURE_ALL_META_DAT1 = \"captureAllMetaDataContent\"; // Count: 3\r\nexport var _DYN_META_DATA_PREFIX = \"metaDataPrefix\"; // Count: 3\r\nexport var _DYN_PARENT_DATA_TAG = \"parentDataTag\"; // Count: 4\r\nexport var _DYN_DEFAULT_RIGHT_CLICK_2 = \"defaultRightClickBhvr\"; // Count: 2\r\nexport var _DYN_TAG_NAME = \"tagName\"; // Count: 4\r\nexport var _DYN_TO_UPPER_CASE = \"toUpperCase\"; // Count: 4\r\nexport var _DYN_PAGE_NAME = \"pageName\"; // Count: 8\r\nexport var _DYN_CORE_DATA = \"coreData\"; // Count: 4\r\nexport var _DYN_REQUEST_URI = \"requestUri\"; // Count: 3\r\nexport var _DYN_GET_ATTRIBUTE = \"getAttribute\"; // Count: 6\r\nexport var _DYN_PARENT_NODE = \"parentNode\"; // Count: 3\r\nexport var _DYN_CUSTOM_DATA_PREFIX = \"customDataPrefix\"; // Count: 3\r\nexport var _DYN_NAME = \"name\"; // Count: 8\r\nexport var _DYN_DATA = \"data\"; // Count: 15\r\nexport var _DYN_PAGE_TYPE = \"pageType\"; // Count: 6\r\nexport var _DYN_PROPERTIES = \"properties\"; // Count: 4\r\nexport var _DYN_ACTION_TYPE = \"actionType\"; // Count: 9\r\nexport var _DYN_BEHAVIOR = \"behavior\"; // Count: 7\r\nexport var _DYN_CONTENT = \"content\"; // Count: 4\r\nexport var _DYN_SET_COMMON_PROPERTIE3 = \"setCommonProperties\"; // Count: 2\r\nexport var _DYN__GET_VALID_BEHAVIOR = \"_getValidBehavior\"; // Count: 3\r\nexport var _DYN_CONTENT_NAME = \"contentName\"; // Count: 10\r\nexport var _DYN__TRACE_LOGGER = \"_traceLogger\"; // Count: 3\r\nexport var _DYN_CLICK_COORDINATE_X = \"clickCoordinateX\"; // Count: 3\r\nexport var _DYN_CLICK_COORDINATE_Y = \"clickCoordinateY\"; // Count: 3\r\nexport var _DYN__CONFIG = \"_config\"; // Count: 9\r\nexport var _DYN_DATA_TAGS = \"dataTags\"; // Count: 6\r\nexport var _DYN__PAGE_TAGS = \"_pageTags\"; // Count: 6\r\nexport var _DYN__PAGE_TAGS_CALLBACK = \"_pageTagsCallback\"; // Count: 3\r\nexport var _DYN__META_TAGS = \"_metaTags\"; // Count: 6\r\nexport var _DYN__PAGE_TYPE_META_TAG = \"_pageTypeMetaTag\"; // Count: 3\r\nexport var _DYN__BEHAVIOR_META_TAG = \"_behaviorMetaTag\"; // Count: 3\r\nexport var _DYN_PARENT_ELEMENT = \"parentElement\"; // Count: 3\r\nexport var _DYN_ATTRIBUTES = \"attributes\"; // Count: 4\r\n//# sourceMappingURL=__DynamicConstants.js.map"],"names":[],"mappings":";;;;AAA4D;AAC1B;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
|
package/dist-es5/common/Utils.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Application Insights JavaScript SDK - Click Analytics, 3.3.6
|
|
2
|
+
* Application Insights JavaScript SDK - Click Analytics, 3.3.6
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
@@ -10,7 +10,7 @@ import dynamicProto from "@microsoft/dynamicproto-js";
|
|
|
10
10
|
import { strNotSpecified } from "@microsoft/applicationinsights-common";
|
|
11
11
|
import { _throwInternal, getPerformance, objExtend, objForEachKey } from "@microsoft/applicationinsights-core-js";
|
|
12
12
|
import { getClickTarget } from "../DataCollector";
|
|
13
|
-
import { _DYN_ACTION_TYPE, _DYN_BEHAVIOR,
|
|
13
|
+
import { _DYN_ACTION_TYPE, _DYN_BEHAVIOR, _DYN_CLICK_COORDINATE_X, _DYN_CLICK_COORDINATE_Y, _DYN_CONTENT, _DYN_CONTENT_NAME, _DYN_CORE_DATA, _DYN_DATA, _DYN_DATA_TAGS, _DYN_DEFAULT_RIGHT_CLICK_2, _DYN_NAME, _DYN_PAGE_NAME, _DYN_PAGE_TYPE, _DYN_PARENT_DATA_TAG, _DYN_PROPERTIES, _DYN_SET_COMMON_PROPERTIE3, _DYN_TRACK_PAGE_ACTION, _DYN__CONFIG, _DYN__GET_VALID_BEHAVIOR, _DYN__TRACE_LOGGER } from "../__DynamicConstants";
|
|
14
14
|
import { bracketIt, extractFieldFromObject, isValueAssigned } from "../common/Utils";
|
|
15
15
|
import { WebEvent } from "./WebEvent";
|
|
16
16
|
var PageAction = /** @class */ (function (_super) {
|
|
@@ -32,17 +32,17 @@ var PageAction = /** @class */ (function (_super) {
|
|
|
32
32
|
_populateEventDataIfPresent(event.baseData, "name", pageActionEvent[_DYN_NAME /* @min:%2ename */]);
|
|
33
33
|
_populateEventDataIfPresent(event[_DYN_DATA /* @min:%2edata */], "baseTypeSource", "ClickEvent");
|
|
34
34
|
_populateEventDataIfPresent(event[_DYN_DATA /* @min:%2edata */], "uri", pageActionEvent.uri);
|
|
35
|
-
_populateEventDataIfPresent(event
|
|
35
|
+
_populateEventDataIfPresent(event[_DYN_DATA /* @min:%2edata */], "pageType", pageActionEvent[_DYN_PAGE_TYPE /* @min:%2epageType */]);
|
|
36
36
|
_populateEventDataIfPresent(event[_DYN_DATA /* @min:%2edata */], "properties", pageActionEvent[_DYN_PROPERTIES /* @min:%2eproperties */]);
|
|
37
37
|
_populateEventDataIfPresent(event[_DYN_DATA /* @min:%2edata */], "actionType", pageActionEvent[_DYN_ACTION_TYPE /* @min:%2eactionType */]);
|
|
38
38
|
_populateEventDataIfPresent(event[_DYN_DATA /* @min:%2edata */], "behavior", pageActionEvent[_DYN_BEHAVIOR /* @min:%2ebehavior */]);
|
|
39
|
-
_populateEventDataIfPresent(event[_DYN_DATA /* @min:%2edata */], "clickCoordinates", pageActionEvent
|
|
39
|
+
_populateEventDataIfPresent(event[_DYN_DATA /* @min:%2edata */], "clickCoordinates", pageActionEvent.clickCoordinates);
|
|
40
40
|
_populateEventDataIfPresent(event[_DYN_DATA /* @min:%2edata */], "content", pageActionEvent[_DYN_CONTENT /* @min:%2econtent */]);
|
|
41
41
|
_populateEventDataIfPresent(event[_DYN_DATA /* @min:%2edata */], "targetUri", pageActionEvent.targetUri);
|
|
42
42
|
_populateEventDataIfPresent(event[_DYN_DATA /* @min:%2edata */], "timeToAction", pageActionEvent.timeToAction);
|
|
43
|
-
_populateEventDataIfPresent(event[_DYN_DATA /* @min:%2edata */], "refUri", pageActionEvent
|
|
43
|
+
_populateEventDataIfPresent(event[_DYN_DATA /* @min:%2edata */], "refUri", pageActionEvent.refUri);
|
|
44
44
|
_populateEventDataIfPresent(event.data, "pageName", pageActionEvent[_DYN_PAGE_NAME /* @min:%2epageName */]);
|
|
45
|
-
_populateEventDataIfPresent(event[_DYN_DATA /* @min:%2edata */], "parentId", pageActionEvent
|
|
45
|
+
_populateEventDataIfPresent(event[_DYN_DATA /* @min:%2edata */], "parentId", pageActionEvent.parentId);
|
|
46
46
|
if (properties) {
|
|
47
47
|
objForEachKey(properties, function (property, value) {
|
|
48
48
|
if (!event[_DYN_DATA /* @min:%2edata */][property]) {
|
|
@@ -59,23 +59,23 @@ var PageAction = /** @class */ (function (_super) {
|
|
|
59
59
|
* @param customProperties - Custom properties(Part C)
|
|
60
60
|
* @param isRightClick - Flag for mouse right clicks
|
|
61
61
|
*/
|
|
62
|
-
_self
|
|
62
|
+
_self.capturePageAction = function (element, overrideValues, customProperties, isRightClick) {
|
|
63
63
|
overrideValues = !isValueAssigned(overrideValues) ? {} : overrideValues;
|
|
64
64
|
var pageActionEvent = { name: "" };
|
|
65
65
|
var pageActionProperties = isValueAssigned(customProperties) ? customProperties : {};
|
|
66
|
-
_self[
|
|
66
|
+
_self[_DYN_SET_COMMON_PROPERTIE3 /* @min:%2esetCommonProperties */](pageActionEvent, overrideValues);
|
|
67
67
|
pageActionEvent[_DYN_BEHAVIOR /* @min:%2ebehavior */] = _self._getBehavior(overrideValues);
|
|
68
68
|
// element in scope is needed for below properties. We cannot pass element into the plugin call chain.
|
|
69
69
|
// process them here.
|
|
70
70
|
var elementContent = {};
|
|
71
71
|
if (isRightClick) {
|
|
72
72
|
// Default behavior for righ click
|
|
73
|
-
pageActionEvent.behavior = _self._config[
|
|
73
|
+
pageActionEvent.behavior = _self._config[_DYN_DEFAULT_RIGHT_CLICK_2 /* @min:%2edefaultRightClickBhvr */];
|
|
74
74
|
}
|
|
75
75
|
// Fill PartB
|
|
76
76
|
if (element) {
|
|
77
77
|
pageActionEvent.targetUri = getClickTarget(element);
|
|
78
|
-
elementContent = _self._contentHandler
|
|
78
|
+
elementContent = _self._contentHandler.getElementContent(element); // collect id,cn tags
|
|
79
79
|
// if the element has a data-*-bhvr attrib defined, use it.
|
|
80
80
|
if (elementContent.bhvr && !isValueAssigned(overrideValues[_DYN_BEHAVIOR /* @min:%2ebehavior */])) {
|
|
81
81
|
var currentBehavior = extractFieldFromObject(elementContent, "bhvr");
|
|
@@ -88,13 +88,13 @@ var PageAction = /** @class */ (function (_super) {
|
|
|
88
88
|
_throwInternal(_self[_DYN__TRACE_LOGGER /* @min:%2e_traceLogger */], 2 /* eLoggingSeverity.WARNING */, 102 /* _eInternalMessageId.InvalidContentBlob */, "Missing attributes id or contentName in click event. Click event information will still be collected!");
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
-
pageActionEvent
|
|
92
|
-
pageActionEvent
|
|
91
|
+
pageActionEvent[_DYN_NAME /* @min:%2ename */] = elementContent.id || elementContent[_DYN_CONTENT_NAME /* @min:%2econtentName */] || strNotSpecified;
|
|
92
|
+
pageActionEvent.parentId = elementContent.parentid || elementContent.parentName || strNotSpecified;
|
|
93
93
|
if (isValueAssigned(overrideValues[_DYN_ACTION_TYPE /* @min:%2eactionType */])) {
|
|
94
94
|
pageActionEvent[_DYN_ACTION_TYPE /* @min:%2eactionType */] = overrideValues[_DYN_ACTION_TYPE /* @min:%2eactionType */];
|
|
95
95
|
}
|
|
96
96
|
if (isValueAssigned(overrideValues[_DYN_CLICK_COORDINATE_X /* @min:%2eclickCoordinateX */]) && isValueAssigned(overrideValues[_DYN_CLICK_COORDINATE_Y /* @min:%2eclickCoordinateY */])) {
|
|
97
|
-
pageActionEvent
|
|
97
|
+
pageActionEvent.clickCoordinates = overrideValues[_DYN_CLICK_COORDINATE_X /* @min:%2eclickCoordinateX */] + "X" + overrideValues[_DYN_CLICK_COORDINATE_Y /* @min:%2eclickCoordinateY */];
|
|
98
98
|
}
|
|
99
99
|
_sanitizePageActionEventContent(elementContent);
|
|
100
100
|
pageActionEvent[_DYN_CONTENT /* @min:%2econtent */] = bracketIt(JSON.stringify(objExtend(elementContent, overrideValues && overrideValues.contentTags ? overrideValues.contentTags : {})));
|
|
@@ -134,7 +134,7 @@ var PageAction = /** @class */ (function (_super) {
|
|
|
134
134
|
function _isUndefinedEvent(pageActionEvent) {
|
|
135
135
|
if (_self[_DYN__CONFIG /* @min:%2e_config */].dropInvalidEvents) {
|
|
136
136
|
if (pageActionEvent[_DYN_NAME /* @min:%2ename */] === strNotSpecified
|
|
137
|
-
&& pageActionEvent
|
|
137
|
+
&& pageActionEvent.parentId === strNotSpecified
|
|
138
138
|
&& pageActionEvent[_DYN_CONTENT /* @min:%2econtent */] === "[{}]") {
|
|
139
139
|
return true;
|
|
140
140
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageAction.js.map","sources":["PageAction.js"],"sourcesContent":["/**\r\n* @copyright Microsoft 2020\r\n*/\r\nimport { __extends } from \"tslib\";\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { strNotSpecified } from \"@microsoft/applicationinsights-common\";\r\nimport { _throwInternal, getPerformance, objExtend, objForEachKey } from \"@microsoft/applicationinsights-core-js\";\r\nimport { getClickTarget } from \"../DataCollector\";\r\nimport { _DYN_ACTION_TYPE, _DYN_BEHAVIOR, _DYN_CAPTURE_PAGE_ACTION, _DYN_CLICK_COORDINATES, _DYN_CLICK_COORDINATE_X, _DYN_CLICK_COORDINATE_Y, _DYN_CONTENT, _DYN_CONTENT_NAME, _DYN_CORE_DATA, _DYN_DATA, _DYN_DATA_TAGS, _DYN_DEFAULT_RIGHT_CLICK_3, _DYN_GET_ELEMENT_CONTENT, _DYN_NAME, _DYN_PAGE_NAME, _DYN_PAGE_TYPE, _DYN_PARENT_DATA_TAG, _DYN_PARENT_ID, _DYN_PROPERTIES, _DYN_REF_URI, _DYN_SET_COMMON_PROPERTIE4, _DYN_TRACK_PAGE_ACTION, _DYN__CONFIG, _DYN__GET_VALID_BEHAVIOR, _DYN__TRACE_LOGGER } from \"../__DynamicConstants\";\r\nimport { bracketIt, extractFieldFromObject, isValueAssigned } from \"../common/Utils\";\r\nimport { WebEvent } from \"./WebEvent\";\r\nvar PageAction = /** @class */ (function (_super) {\r\n __extends(PageAction, _super);\r\n function PageAction(clickAnalyticsPlugin, config, contentHandler, pageTagsCallback, metaTags, traceLogger) {\r\n var _this = _super.call(this, clickAnalyticsPlugin, config, contentHandler, pageTagsCallback, metaTags, traceLogger) || this;\r\n dynamicProto(PageAction, _this, function (_self, _base) {\r\n _self[_DYN_TRACK_PAGE_ACTION /* @min:%2etrackPageAction */] = function (pageActionEvent, properties) {\r\n // Get part A properties\r\n var ext = {};\r\n ext[\"web\"] = {};\r\n var event = {\r\n name: \"Microsoft.ApplicationInsights.{0}.Event\",\r\n baseType: \"EventData\",\r\n ext: ext,\r\n data: {},\r\n baseData: {}\r\n };\r\n _populateEventDataIfPresent(event.baseData, \"name\", pageActionEvent[_DYN_NAME /* @min:%2ename */]);\r\n _populateEventDataIfPresent(event[_DYN_DATA /* @min:%2edata */], \"baseTypeSource\", \"ClickEvent\");\r\n _populateEventDataIfPresent(event[_DYN_DATA /* @min:%2edata */], \"uri\", pageActionEvent.uri);\r\n _populateEventDataIfPresent(event.data, \"pageType\", pageActionEvent[_DYN_PAGE_TYPE /* @min:%2epageType */]);\r\n _populateEventDataIfPresent(event[_DYN_DATA /* @min:%2edata */], \"properties\", pageActionEvent[_DYN_PROPERTIES /* @min:%2eproperties */]);\r\n _populateEventDataIfPresent(event[_DYN_DATA /* @min:%2edata */], \"actionType\", pageActionEvent[_DYN_ACTION_TYPE /* @min:%2eactionType */]);\r\n _populateEventDataIfPresent(event[_DYN_DATA /* @min:%2edata */], \"behavior\", pageActionEvent[_DYN_BEHAVIOR /* @min:%2ebehavior */]);\r\n _populateEventDataIfPresent(event[_DYN_DATA /* @min:%2edata */], \"clickCoordinates\", pageActionEvent[_DYN_CLICK_COORDINATES /* @min:%2eclickCoordinates */]);\r\n _populateEventDataIfPresent(event[_DYN_DATA /* @min:%2edata */], \"content\", pageActionEvent[_DYN_CONTENT /* @min:%2econtent */]);\r\n _populateEventDataIfPresent(event[_DYN_DATA /* @min:%2edata */], \"targetUri\", pageActionEvent.targetUri);\r\n _populateEventDataIfPresent(event[_DYN_DATA /* @min:%2edata */], \"timeToAction\", pageActionEvent.timeToAction);\r\n _populateEventDataIfPresent(event[_DYN_DATA /* @min:%2edata */], \"refUri\", pageActionEvent[_DYN_REF_URI /* @min:%2erefUri */]);\r\n _populateEventDataIfPresent(event.data, \"pageName\", pageActionEvent[_DYN_PAGE_NAME /* @min:%2epageName */]);\r\n _populateEventDataIfPresent(event[_DYN_DATA /* @min:%2edata */], \"parentId\", pageActionEvent[_DYN_PARENT_ID /* @min:%2eparentId */]);\r\n if (properties) {\r\n objForEachKey(properties, function (property, value) {\r\n if (!event[_DYN_DATA /* @min:%2edata */][property]) {\r\n _populateEventDataIfPresent(event[_DYN_DATA /* @min:%2edata */], property, value);\r\n }\r\n });\r\n }\r\n _self._clickAnalyticsPlugin.core.track(event);\r\n };\r\n /**\r\n * API to create and send a populated PageAction event\r\n * @param element - DOM element\r\n * @param overrideValues - PageAction overrides\r\n * @param customProperties - Custom properties(Part C)\r\n * @param isRightClick - Flag for mouse right clicks\r\n */\r\n _self[_DYN_CAPTURE_PAGE_ACTION /* @min:%2ecapturePageAction */] = function (element, overrideValues, customProperties, isRightClick) {\r\n overrideValues = !isValueAssigned(overrideValues) ? {} : overrideValues;\r\n var pageActionEvent = { name: \"\" };\r\n var pageActionProperties = isValueAssigned(customProperties) ? customProperties : {};\r\n _self[_DYN_SET_COMMON_PROPERTIE4 /* @min:%2esetCommonProperties */](pageActionEvent, overrideValues);\r\n pageActionEvent[_DYN_BEHAVIOR /* @min:%2ebehavior */] = _self._getBehavior(overrideValues);\r\n // element in scope is needed for below properties. We cannot pass element into the plugin call chain.\r\n // process them here.\r\n var elementContent = {};\r\n if (isRightClick) {\r\n // Default behavior for righ click\r\n pageActionEvent.behavior = _self._config[_DYN_DEFAULT_RIGHT_CLICK_3 /* @min:%2edefaultRightClickBhvr */];\r\n }\r\n // Fill PartB\r\n if (element) {\r\n pageActionEvent.targetUri = getClickTarget(element);\r\n elementContent = _self._contentHandler[_DYN_GET_ELEMENT_CONTENT /* @min:%2egetElementContent */](element); // collect id,cn tags\r\n // if the element has a data-*-bhvr attrib defined, use it.\r\n if (elementContent.bhvr && !isValueAssigned(overrideValues[_DYN_BEHAVIOR /* @min:%2ebehavior */])) {\r\n var currentBehavior = extractFieldFromObject(elementContent, \"bhvr\");\r\n pageActionEvent[_DYN_BEHAVIOR /* @min:%2ebehavior */] = _self[_DYN__GET_VALID_BEHAVIOR /* @min:%2e_getValidBehavior */](currentBehavior);\r\n }\r\n // Validate to ensure the minimum required field 'contentName' or 'id' is present. However,\r\n // requiring these fields would result in majority of adopter's content from being collected.\r\n // Just throw a warning and continue collection.\r\n if (!isValueAssigned(elementContent.id) && !isValueAssigned(elementContent[_DYN_CONTENT_NAME /* @min:%2econtentName */])) {\r\n _throwInternal(_self[_DYN__TRACE_LOGGER /* @min:%2e_traceLogger */], 2 /* eLoggingSeverity.WARNING */, 102 /* _eInternalMessageId.InvalidContentBlob */, \"Missing attributes id or contentName in click event. Click event information will still be collected!\");\r\n }\r\n }\r\n pageActionEvent.name = elementContent.id || elementContent[_DYN_CONTENT_NAME /* @min:%2econtentName */] || strNotSpecified;\r\n pageActionEvent[_DYN_PARENT_ID /* @min:%2eparentId */] = elementContent.parentid || elementContent.parentName || strNotSpecified;\r\n if (isValueAssigned(overrideValues[_DYN_ACTION_TYPE /* @min:%2eactionType */])) {\r\n pageActionEvent[_DYN_ACTION_TYPE /* @min:%2eactionType */] = overrideValues[_DYN_ACTION_TYPE /* @min:%2eactionType */];\r\n }\r\n if (isValueAssigned(overrideValues[_DYN_CLICK_COORDINATE_X /* @min:%2eclickCoordinateX */]) && isValueAssigned(overrideValues[_DYN_CLICK_COORDINATE_Y /* @min:%2eclickCoordinateY */])) {\r\n pageActionEvent[_DYN_CLICK_COORDINATES /* @min:%2eclickCoordinates */] = overrideValues[_DYN_CLICK_COORDINATE_X /* @min:%2eclickCoordinateX */] + \"X\" + overrideValues[_DYN_CLICK_COORDINATE_Y /* @min:%2eclickCoordinateY */];\r\n }\r\n _sanitizePageActionEventContent(elementContent);\r\n pageActionEvent[_DYN_CONTENT /* @min:%2econtent */] = bracketIt(JSON.stringify(objExtend(elementContent, overrideValues && overrideValues.contentTags ? overrideValues.contentTags : {})));\r\n pageActionEvent.timeToAction = _getTimeToClick();\r\n pageActionEvent.refUri = isValueAssigned(overrideValues.refUri) ? overrideValues.refUri : _self._config[_DYN_CORE_DATA /* @min:%2ecoreData */].referrerUri;\r\n if (_isUndefinedEvent(pageActionEvent)) {\r\n return;\r\n }\r\n _self[_DYN_TRACK_PAGE_ACTION /* @min:%2etrackPageAction */](pageActionEvent, pageActionProperties);\r\n };\r\n // capture performance data into PageTags\r\n function _getTimeToClick() {\r\n var perf = getPerformance();\r\n if (perf && perf.timing) {\r\n var isNavigationStart = perf.timing.navigationStart;\r\n if (isNavigationStart && isNavigationStart !== 0) {\r\n return new Date().getTime() - isNavigationStart;\r\n }\r\n }\r\n return -1;\r\n }\r\n function _populateEventDataIfPresent(obj, property, value) {\r\n if (isValueAssigned(value)) {\r\n obj[property] = value;\r\n }\r\n }\r\n function _sanitizePageActionEventContent(pageActionContent) {\r\n if (pageActionContent) {\r\n delete pageActionContent.id;\r\n delete pageActionContent.parentid;\r\n delete pageActionContent.parentname;\r\n if (_self._config && _self._config.dataTags && isValueAssigned(_self._config.dataTags[_DYN_PARENT_DATA_TAG /* @min:%2eparentDataTag */])) {\r\n delete pageActionContent[_self[_DYN__CONFIG /* @min:%2e_config */][_DYN_DATA_TAGS /* @min:%2edataTags */].parentDataTag];\r\n }\r\n }\r\n }\r\n function _isUndefinedEvent(pageActionEvent) {\r\n if (_self[_DYN__CONFIG /* @min:%2e_config */].dropInvalidEvents) {\r\n if (pageActionEvent[_DYN_NAME /* @min:%2ename */] === strNotSpecified\r\n && pageActionEvent[_DYN_PARENT_ID /* @min:%2eparentId */] === strNotSpecified\r\n && pageActionEvent[_DYN_CONTENT /* @min:%2econtent */] === \"[{}]\") {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n });\r\n return _this;\r\n }\r\n /**\r\n * API to send pageAction event\r\n * @param pageActionEvent - PageAction event\r\n * @param properties - PageAction properties(Part C)\r\n */\r\n PageAction.prototype.trackPageAction = function (pageActionEvent, properties) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * API to create and send a populated PageAction event\r\n * @param element - DOM element\r\n * @param overrideValues - PageAction overrides\r\n * @param customProperties - Custom properties(Part C)\r\n * @param isRightClick - Flag for mouse right clicks\r\n */\r\n PageAction.prototype.capturePageAction = function (element, overrideValues, customProperties, isRightClick) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n return PageAction;\r\n}(WebEvent));\r\nexport { PageAction };\r\n//# sourceMappingURL=PageAction.js.map"],"names":[],"mappings":";;;;AAAA;AACA;AACA;AACA,gFAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;2DAiBM,CAAC;;;;;sBACe;AACtB;AACA;AACA"}
|
|
1
|
+
{"version":3,"file":"PageAction.js.map","sources":["PageAction.js"],"sourcesContent":["/**\r\n* @copyright Microsoft 2020\r\n*/\r\nimport { __extends } from \"tslib\";\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { strNotSpecified } from \"@microsoft/applicationinsights-common\";\r\nimport { _throwInternal, getPerformance, objExtend, objForEachKey } from \"@microsoft/applicationinsights-core-js\";\r\nimport { getClickTarget } from \"../DataCollector\";\r\nimport { _DYN_ACTION_TYPE, _DYN_BEHAVIOR, _DYN_CLICK_COORDINATE_X, _DYN_CLICK_COORDINATE_Y, _DYN_CONTENT, _DYN_CONTENT_NAME, _DYN_CORE_DATA, _DYN_DATA, _DYN_DATA_TAGS, _DYN_DEFAULT_RIGHT_CLICK_2, _DYN_NAME, _DYN_PAGE_NAME, _DYN_PAGE_TYPE, _DYN_PARENT_DATA_TAG, _DYN_PROPERTIES, _DYN_SET_COMMON_PROPERTIE3, _DYN_TRACK_PAGE_ACTION, _DYN__CONFIG, _DYN__GET_VALID_BEHAVIOR, _DYN__TRACE_LOGGER } from \"../__DynamicConstants\";\r\nimport { bracketIt, extractFieldFromObject, isValueAssigned } from \"../common/Utils\";\r\nimport { WebEvent } from \"./WebEvent\";\r\nvar PageAction = /** @class */ (function (_super) {\r\n __extends(PageAction, _super);\r\n function PageAction(clickAnalyticsPlugin, config, contentHandler, pageTagsCallback, metaTags, traceLogger) {\r\n var _this = _super.call(this, clickAnalyticsPlugin, config, contentHandler, pageTagsCallback, metaTags, traceLogger) || this;\r\n dynamicProto(PageAction, _this, function (_self, _base) {\r\n _self[_DYN_TRACK_PAGE_ACTION /* @min:%2etrackPageAction */] = function (pageActionEvent, properties) {\r\n // Get part A properties\r\n var ext = {};\r\n ext[\"web\"] = {};\r\n var event = {\r\n name: \"Microsoft.ApplicationInsights.{0}.Event\",\r\n baseType: \"EventData\",\r\n ext: ext,\r\n data: {},\r\n baseData: {}\r\n };\r\n _populateEventDataIfPresent(event.baseData, \"name\", pageActionEvent[_DYN_NAME /* @min:%2ename */]);\r\n _populateEventDataIfPresent(event[_DYN_DATA /* @min:%2edata */], \"baseTypeSource\", \"ClickEvent\");\r\n _populateEventDataIfPresent(event[_DYN_DATA /* @min:%2edata */], \"uri\", pageActionEvent.uri);\r\n _populateEventDataIfPresent(event[_DYN_DATA /* @min:%2edata */], \"pageType\", pageActionEvent[_DYN_PAGE_TYPE /* @min:%2epageType */]);\r\n _populateEventDataIfPresent(event[_DYN_DATA /* @min:%2edata */], \"properties\", pageActionEvent[_DYN_PROPERTIES /* @min:%2eproperties */]);\r\n _populateEventDataIfPresent(event[_DYN_DATA /* @min:%2edata */], \"actionType\", pageActionEvent[_DYN_ACTION_TYPE /* @min:%2eactionType */]);\r\n _populateEventDataIfPresent(event[_DYN_DATA /* @min:%2edata */], \"behavior\", pageActionEvent[_DYN_BEHAVIOR /* @min:%2ebehavior */]);\r\n _populateEventDataIfPresent(event[_DYN_DATA /* @min:%2edata */], \"clickCoordinates\", pageActionEvent.clickCoordinates);\r\n _populateEventDataIfPresent(event[_DYN_DATA /* @min:%2edata */], \"content\", pageActionEvent[_DYN_CONTENT /* @min:%2econtent */]);\r\n _populateEventDataIfPresent(event[_DYN_DATA /* @min:%2edata */], \"targetUri\", pageActionEvent.targetUri);\r\n _populateEventDataIfPresent(event[_DYN_DATA /* @min:%2edata */], \"timeToAction\", pageActionEvent.timeToAction);\r\n _populateEventDataIfPresent(event[_DYN_DATA /* @min:%2edata */], \"refUri\", pageActionEvent.refUri);\r\n _populateEventDataIfPresent(event.data, \"pageName\", pageActionEvent[_DYN_PAGE_NAME /* @min:%2epageName */]);\r\n _populateEventDataIfPresent(event[_DYN_DATA /* @min:%2edata */], \"parentId\", pageActionEvent.parentId);\r\n if (properties) {\r\n objForEachKey(properties, function (property, value) {\r\n if (!event[_DYN_DATA /* @min:%2edata */][property]) {\r\n _populateEventDataIfPresent(event[_DYN_DATA /* @min:%2edata */], property, value);\r\n }\r\n });\r\n }\r\n _self._clickAnalyticsPlugin.core.track(event);\r\n };\r\n /**\r\n * API to create and send a populated PageAction event\r\n * @param element - DOM element\r\n * @param overrideValues - PageAction overrides\r\n * @param customProperties - Custom properties(Part C)\r\n * @param isRightClick - Flag for mouse right clicks\r\n */\r\n _self.capturePageAction = function (element, overrideValues, customProperties, isRightClick) {\r\n overrideValues = !isValueAssigned(overrideValues) ? {} : overrideValues;\r\n var pageActionEvent = { name: \"\" };\r\n var pageActionProperties = isValueAssigned(customProperties) ? customProperties : {};\r\n _self[_DYN_SET_COMMON_PROPERTIE3 /* @min:%2esetCommonProperties */](pageActionEvent, overrideValues);\r\n pageActionEvent[_DYN_BEHAVIOR /* @min:%2ebehavior */] = _self._getBehavior(overrideValues);\r\n // element in scope is needed for below properties. We cannot pass element into the plugin call chain.\r\n // process them here.\r\n var elementContent = {};\r\n if (isRightClick) {\r\n // Default behavior for righ click\r\n pageActionEvent.behavior = _self._config[_DYN_DEFAULT_RIGHT_CLICK_2 /* @min:%2edefaultRightClickBhvr */];\r\n }\r\n // Fill PartB\r\n if (element) {\r\n pageActionEvent.targetUri = getClickTarget(element);\r\n elementContent = _self._contentHandler.getElementContent(element); // collect id,cn tags\r\n // if the element has a data-*-bhvr attrib defined, use it.\r\n if (elementContent.bhvr && !isValueAssigned(overrideValues[_DYN_BEHAVIOR /* @min:%2ebehavior */])) {\r\n var currentBehavior = extractFieldFromObject(elementContent, \"bhvr\");\r\n pageActionEvent[_DYN_BEHAVIOR /* @min:%2ebehavior */] = _self[_DYN__GET_VALID_BEHAVIOR /* @min:%2e_getValidBehavior */](currentBehavior);\r\n }\r\n // Validate to ensure the minimum required field 'contentName' or 'id' is present. However,\r\n // requiring these fields would result in majority of adopter's content from being collected.\r\n // Just throw a warning and continue collection.\r\n if (!isValueAssigned(elementContent.id) && !isValueAssigned(elementContent[_DYN_CONTENT_NAME /* @min:%2econtentName */])) {\r\n _throwInternal(_self[_DYN__TRACE_LOGGER /* @min:%2e_traceLogger */], 2 /* eLoggingSeverity.WARNING */, 102 /* _eInternalMessageId.InvalidContentBlob */, \"Missing attributes id or contentName in click event. Click event information will still be collected!\");\r\n }\r\n }\r\n pageActionEvent[_DYN_NAME /* @min:%2ename */] = elementContent.id || elementContent[_DYN_CONTENT_NAME /* @min:%2econtentName */] || strNotSpecified;\r\n pageActionEvent.parentId = elementContent.parentid || elementContent.parentName || strNotSpecified;\r\n if (isValueAssigned(overrideValues[_DYN_ACTION_TYPE /* @min:%2eactionType */])) {\r\n pageActionEvent[_DYN_ACTION_TYPE /* @min:%2eactionType */] = overrideValues[_DYN_ACTION_TYPE /* @min:%2eactionType */];\r\n }\r\n if (isValueAssigned(overrideValues[_DYN_CLICK_COORDINATE_X /* @min:%2eclickCoordinateX */]) && isValueAssigned(overrideValues[_DYN_CLICK_COORDINATE_Y /* @min:%2eclickCoordinateY */])) {\r\n pageActionEvent.clickCoordinates = overrideValues[_DYN_CLICK_COORDINATE_X /* @min:%2eclickCoordinateX */] + \"X\" + overrideValues[_DYN_CLICK_COORDINATE_Y /* @min:%2eclickCoordinateY */];\r\n }\r\n _sanitizePageActionEventContent(elementContent);\r\n pageActionEvent[_DYN_CONTENT /* @min:%2econtent */] = bracketIt(JSON.stringify(objExtend(elementContent, overrideValues && overrideValues.contentTags ? overrideValues.contentTags : {})));\r\n pageActionEvent.timeToAction = _getTimeToClick();\r\n pageActionEvent.refUri = isValueAssigned(overrideValues.refUri) ? overrideValues.refUri : _self._config[_DYN_CORE_DATA /* @min:%2ecoreData */].referrerUri;\r\n if (_isUndefinedEvent(pageActionEvent)) {\r\n return;\r\n }\r\n _self[_DYN_TRACK_PAGE_ACTION /* @min:%2etrackPageAction */](pageActionEvent, pageActionProperties);\r\n };\r\n // capture performance data into PageTags\r\n function _getTimeToClick() {\r\n var perf = getPerformance();\r\n if (perf && perf.timing) {\r\n var isNavigationStart = perf.timing.navigationStart;\r\n if (isNavigationStart && isNavigationStart !== 0) {\r\n return new Date().getTime() - isNavigationStart;\r\n }\r\n }\r\n return -1;\r\n }\r\n function _populateEventDataIfPresent(obj, property, value) {\r\n if (isValueAssigned(value)) {\r\n obj[property] = value;\r\n }\r\n }\r\n function _sanitizePageActionEventContent(pageActionContent) {\r\n if (pageActionContent) {\r\n delete pageActionContent.id;\r\n delete pageActionContent.parentid;\r\n delete pageActionContent.parentname;\r\n if (_self._config && _self._config.dataTags && isValueAssigned(_self._config.dataTags[_DYN_PARENT_DATA_TAG /* @min:%2eparentDataTag */])) {\r\n delete pageActionContent[_self[_DYN__CONFIG /* @min:%2e_config */][_DYN_DATA_TAGS /* @min:%2edataTags */].parentDataTag];\r\n }\r\n }\r\n }\r\n function _isUndefinedEvent(pageActionEvent) {\r\n if (_self[_DYN__CONFIG /* @min:%2e_config */].dropInvalidEvents) {\r\n if (pageActionEvent[_DYN_NAME /* @min:%2ename */] === strNotSpecified\r\n && pageActionEvent.parentId === strNotSpecified\r\n && pageActionEvent[_DYN_CONTENT /* @min:%2econtent */] === \"[{}]\") {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n });\r\n return _this;\r\n }\r\n /**\r\n * API to send pageAction event\r\n * @param pageActionEvent - PageAction event\r\n * @param properties - PageAction properties(Part C)\r\n */\r\n PageAction.prototype.trackPageAction = function (pageActionEvent, properties) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * API to create and send a populated PageAction event\r\n * @param element - DOM element\r\n * @param overrideValues - PageAction overrides\r\n * @param customProperties - Custom properties(Part C)\r\n * @param isRightClick - Flag for mouse right clicks\r\n */\r\n PageAction.prototype.capturePageAction = function (element, overrideValues, customProperties, isRightClick) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n return PageAction;\r\n}(WebEvent));\r\nexport { PageAction };\r\n//# sourceMappingURL=PageAction.js.map"],"names":[],"mappings":";;;;AAAA;AACA;AACA;AACA,gFAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;2DAiBM,CAAC;;;;;sBACe;AACtB;AACA;AACA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Application Insights JavaScript SDK - Click Analytics, 3.3.6
|
|
2
|
+
* Application Insights JavaScript SDK - Click Analytics, 3.3.6
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import dynamicProto from "@microsoft/dynamicproto-js";
|
|
9
9
|
import { getLocation, hasWindow, objExtend } from "@microsoft/applicationinsights-core-js";
|
|
10
10
|
import { getPageName, getUri } from "../DataCollector";
|
|
11
|
-
import { _DYN_BEHAVIOR,
|
|
11
|
+
import { _DYN_BEHAVIOR, _DYN_CORE_DATA, _DYN_NAME, _DYN_PAGE_NAME, _DYN_PAGE_TYPE, _DYN_PROPERTIES, _DYN_SET_COMMON_PROPERTIE3, _DYN__BEHAVIOR_META_TAG, _DYN__CONFIG, _DYN__GET_VALID_BEHAVIOR, _DYN__META_TAGS, _DYN__PAGE_TAGS, _DYN__PAGE_TAGS_CALLBACK, _DYN__PAGE_TYPE_META_TAG, _DYN__TRACE_LOGGER } from "../__DynamicConstants";
|
|
12
12
|
import { isValueAssigned } from "../common/Utils";
|
|
13
13
|
var WebEvent = /** @class */ (function () {
|
|
14
14
|
/**
|
|
@@ -32,7 +32,7 @@ var WebEvent = /** @class */ (function () {
|
|
|
32
32
|
_self[_DYN__META_TAGS /* @min:%2e_metaTags */] = metaTags;
|
|
33
33
|
_self[_DYN__TRACE_LOGGER /* @min:%2e_traceLogger */] = traceLogger;
|
|
34
34
|
}
|
|
35
|
-
_self
|
|
35
|
+
_self.setBasicProperties = function (event, overrideValues) {
|
|
36
36
|
if (!isValueAssigned(event[_DYN_NAME /* @min:%2ename */])) {
|
|
37
37
|
event[_DYN_PAGE_NAME /* @min:%2epageName */] = getPageName(_self[_DYN__CONFIG /* @min:%2e_config */], overrideValues);
|
|
38
38
|
}
|
|
@@ -44,8 +44,8 @@ var WebEvent = /** @class */ (function () {
|
|
|
44
44
|
* Sets common properties for events that are based on the WebEvent schema.
|
|
45
45
|
* @param event - The event
|
|
46
46
|
*/
|
|
47
|
-
_self[
|
|
48
|
-
_self
|
|
47
|
+
_self[_DYN_SET_COMMON_PROPERTIE3 /* @min:%2esetCommonProperties */] = function (event, overrideValues) {
|
|
48
|
+
_self.setBasicProperties(event, overrideValues);
|
|
49
49
|
_self._setPageTags(event, overrideValues);
|
|
50
50
|
// extract specific meta tags out of the pageTags.metaTags collection. These will go into assigned first class fields in the event.
|
|
51
51
|
// the rest will go into pageTags.metaTags collection as is.
|
|
@@ -98,9 +98,9 @@ var WebEvent = /** @class */ (function () {
|
|
|
98
98
|
return _self[_DYN__GET_VALID_BEHAVIOR /* @min:%2e_getValidBehavior */](behavior);
|
|
99
99
|
};
|
|
100
100
|
_self[_DYN__GET_VALID_BEHAVIOR /* @min:%2e_getValidBehavior */] = function (behavior) {
|
|
101
|
-
return _self
|
|
101
|
+
return _self[_DYN__CONFIG /* @min:%2e_config */].behaviorValidator(behavior);
|
|
102
102
|
};
|
|
103
|
-
_self
|
|
103
|
+
_self._doUnload = function (unloadCtx, unloadState, asyncCallback) {
|
|
104
104
|
_initDefaults();
|
|
105
105
|
};
|
|
106
106
|
/**
|