@microsoft/applicationinsights-clickanalytics-js 2.8.0-nightly.2202-06 → 2.8.0-nightly.2204-04
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/ai.clck.2.8.0-nightly.2204-04.cjs.js +2883 -0
- package/browser/ai.clck.2.8.0-nightly.2204-04.cjs.js.map +1 -0
- package/browser/ai.clck.2.8.0-nightly.2204-04.cjs.min.js +6 -0
- package/browser/ai.clck.2.8.0-nightly.2204-04.cjs.min.js.map +1 -0
- package/browser/ai.clck.2.8.0-nightly.2204-04.gbl.js +2887 -0
- package/browser/ai.clck.2.8.0-nightly.2204-04.gbl.js.map +1 -0
- package/browser/ai.clck.2.8.0-nightly.2204-04.gbl.min.js +6 -0
- package/browser/ai.clck.2.8.0-nightly.2204-04.gbl.min.js.map +1 -0
- package/browser/ai.clck.2.8.0-nightly.2204-04.integrity.json +66 -0
- package/browser/ai.clck.2.8.0-nightly.2204-04.js +2889 -0
- package/browser/ai.clck.2.8.0-nightly.2204-04.js.map +1 -0
- package/browser/ai.clck.2.8.0-nightly.2204-04.min.js +6 -0
- package/browser/ai.clck.2.8.0-nightly.2204-04.min.js.map +1 -0
- package/browser/ai.clck.2.cjs.js +1685 -808
- package/browser/ai.clck.2.cjs.js.map +1 -1
- package/browser/ai.clck.2.cjs.min.js +2 -2
- package/browser/ai.clck.2.cjs.min.js.map +1 -1
- package/browser/ai.clck.2.gbl.js +1685 -808
- package/browser/ai.clck.2.gbl.js.map +1 -1
- package/browser/ai.clck.2.gbl.min.js +2 -2
- package/browser/ai.clck.2.gbl.min.js.map +1 -1
- package/browser/ai.clck.2.js +1685 -808
- package/browser/ai.clck.2.js.map +1 -1
- package/browser/ai.clck.2.min.js +2 -2
- package/browser/ai.clck.2.min.js.map +1 -1
- package/dist/applicationinsights-clickanalytics-js.api.json +38 -13
- package/dist/applicationinsights-clickanalytics-js.api.md +1 -0
- package/dist/applicationinsights-clickanalytics-js.d.ts +2 -5
- package/dist/applicationinsights-clickanalytics-js.js +1685 -808
- package/dist/applicationinsights-clickanalytics-js.js.map +1 -1
- package/dist/applicationinsights-clickanalytics-js.min.js +2 -2
- package/dist/applicationinsights-clickanalytics-js.min.js.map +1 -1
- package/dist/applicationinsights-clickanalytics-js.rollup.d.ts +2 -5
- package/dist-esm/Behaviours.js +1 -1
- package/dist-esm/ClickAnalyticsPlugin.js +74 -50
- package/dist-esm/ClickAnalyticsPlugin.js.map +1 -1
- package/dist-esm/DataCollector.js +4 -2
- package/dist-esm/DataCollector.js.map +1 -1
- package/dist-esm/Enums.js +1 -1
- package/dist-esm/Interfaces/Datamodel.js +1 -1
- package/dist-esm/applicationinsights-clickanalytics-js.js +1 -1
- package/dist-esm/common/Utils.js +1 -1
- package/dist-esm/events/PageAction.js +128 -126
- package/dist-esm/events/PageAction.js.map +1 -1
- package/dist-esm/events/WebEvent.js +109 -94
- package/dist-esm/events/WebEvent.js.map +1 -1
- package/dist-esm/handlers/AutoCaptureHandler.js +85 -83
- package/dist-esm/handlers/AutoCaptureHandler.js.map +1 -1
- package/dist-esm/handlers/DomContentHandler.js +279 -276
- package/dist-esm/handlers/DomContentHandler.js.map +1 -1
- package/package.json +5 -5
- package/src/ClickAnalyticsPlugin.ts +92 -47
- package/src/DataCollector.ts +24 -22
- package/src/Interfaces/Datamodel.ts +20 -21
- package/src/common/Utils.ts +8 -8
- package/src/events/PageAction.ts +165 -131
- package/src/events/WebEvent.ts +147 -78
- package/src/handlers/AutoCaptureHandler.ts +89 -79
- package/src/handlers/DomContentHandler.ts +336 -303
- package/types/ClickAnalyticsPlugin.d.ts +1 -4
- package/types/Interfaces/Datamodel.d.ts +3 -2
- package/types/events/PageAction.d.ts +6 -6
- package/types/events/WebEvent.d.ts +17 -17
- package/types/handlers/AutoCaptureHandler.d.ts +2 -10
- package/types/handlers/DomContentHandler.d.ts +3 -50
- package/types/tsdoc-metadata.json +1 -1
- package/browser/ai.clck.2.8.0-nightly.2202-06.cjs.js +0 -2006
- package/browser/ai.clck.2.8.0-nightly.2202-06.cjs.js.map +0 -1
- package/browser/ai.clck.2.8.0-nightly.2202-06.cjs.min.js +0 -6
- package/browser/ai.clck.2.8.0-nightly.2202-06.cjs.min.js.map +0 -1
- package/browser/ai.clck.2.8.0-nightly.2202-06.gbl.js +0 -2010
- package/browser/ai.clck.2.8.0-nightly.2202-06.gbl.js.map +0 -1
- package/browser/ai.clck.2.8.0-nightly.2202-06.gbl.min.js +0 -6
- package/browser/ai.clck.2.8.0-nightly.2202-06.gbl.min.js.map +0 -1
- package/browser/ai.clck.2.8.0-nightly.2202-06.integrity.json +0 -66
- package/browser/ai.clck.2.8.0-nightly.2202-06.js +0 -2012
- package/browser/ai.clck.2.8.0-nightly.2202-06.js.map +0 -1
- package/browser/ai.clck.2.8.0-nightly.2202-06.min.js +0 -6
- package/browser/ai.clck.2.8.0-nightly.2202-06.min.js.map +0 -1
|
@@ -1,2010 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Application Insights JavaScript SDK - Click Analytics, 2.8.0-nightly.2202-06
|
|
3
|
-
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
|
-
*/
|
|
5
|
-
this.Microsoft = this.Microsoft || {};
|
|
6
|
-
(function (exports) {
|
|
7
|
-
'use strict';
|
|
8
|
-
|
|
9
|
-
var strShimFunction = "function";
|
|
10
|
-
var strShimObject = "object";
|
|
11
|
-
var strShimUndefined = "undefined";
|
|
12
|
-
var strShimPrototype = "prototype";
|
|
13
|
-
var strShimHasOwnProperty = "hasOwnProperty";
|
|
14
|
-
var ObjClass = Object;
|
|
15
|
-
var ObjProto = ObjClass[strShimPrototype];
|
|
16
|
-
var ObjAssign = ObjClass["assign"];
|
|
17
|
-
var ObjCreate = ObjClass["create"];
|
|
18
|
-
var ObjDefineProperty = ObjClass["defineProperty"];
|
|
19
|
-
var ObjHasOwnProperty = ObjProto[strShimHasOwnProperty];
|
|
20
|
-
|
|
21
|
-
var _cachedGlobal = null;
|
|
22
|
-
function getGlobal(useCached) {
|
|
23
|
-
if (useCached === void 0) { useCached = true; }
|
|
24
|
-
if (!_cachedGlobal || !useCached) {
|
|
25
|
-
if (typeof globalThis !== strShimUndefined && globalThis) {
|
|
26
|
-
_cachedGlobal = globalThis;
|
|
27
|
-
}
|
|
28
|
-
if (typeof self !== strShimUndefined && self) {
|
|
29
|
-
_cachedGlobal = self;
|
|
30
|
-
}
|
|
31
|
-
if (typeof window !== strShimUndefined && window) {
|
|
32
|
-
_cachedGlobal = window;
|
|
33
|
-
}
|
|
34
|
-
if (typeof global !== strShimUndefined && global) {
|
|
35
|
-
_cachedGlobal = global;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
return _cachedGlobal;
|
|
39
|
-
}
|
|
40
|
-
function throwTypeError(message) {
|
|
41
|
-
throw new TypeError(message);
|
|
42
|
-
}
|
|
43
|
-
function objCreateFn(obj) {
|
|
44
|
-
var func = ObjCreate;
|
|
45
|
-
if (func) {
|
|
46
|
-
return func(obj);
|
|
47
|
-
}
|
|
48
|
-
if (obj == null) {
|
|
49
|
-
return {};
|
|
50
|
-
}
|
|
51
|
-
var type = typeof obj;
|
|
52
|
-
if (type !== strShimObject && type !== strShimFunction) {
|
|
53
|
-
throwTypeError("Object prototype may only be an Object:" + obj);
|
|
54
|
-
}
|
|
55
|
-
function tmpFunc() { }
|
|
56
|
-
tmpFunc[strShimPrototype] = obj;
|
|
57
|
-
return new tmpFunc();
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
(getGlobal() || {})["Symbol"];
|
|
61
|
-
(getGlobal() || {})["Reflect"];
|
|
62
|
-
var __objAssignFnImpl = function (t) {
|
|
63
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
64
|
-
s = arguments[i];
|
|
65
|
-
for (var p in s) {
|
|
66
|
-
if (ObjProto[strShimHasOwnProperty].call(s, p)) {
|
|
67
|
-
t[p] = s[p];
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
return t;
|
|
72
|
-
};
|
|
73
|
-
var __assignFn = ObjAssign || __objAssignFnImpl;
|
|
74
|
-
var extendStaticsFn = function (d, b) {
|
|
75
|
-
extendStaticsFn = ObjClass["setPrototypeOf"] ||
|
|
76
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
77
|
-
function (d, b) {
|
|
78
|
-
for (var p in b) {
|
|
79
|
-
if (b[strShimHasOwnProperty](p)) {
|
|
80
|
-
d[p] = b[p];
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
return extendStaticsFn(d, b);
|
|
85
|
-
};
|
|
86
|
-
function __extendsFn(d, b) {
|
|
87
|
-
if (typeof b !== strShimFunction && b !== null) {
|
|
88
|
-
throwTypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
89
|
-
}
|
|
90
|
-
extendStaticsFn(d, b);
|
|
91
|
-
function __() { this.constructor = d; }
|
|
92
|
-
d[strShimPrototype] = b === null ? objCreateFn(b) : (__[strShimPrototype] = b[strShimPrototype], new __());
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
/*!
|
|
96
|
-
* Microsoft Dynamic Proto Utility, 1.1.4
|
|
97
|
-
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
98
|
-
*/
|
|
99
|
-
var Constructor = 'constructor';
|
|
100
|
-
var Prototype$1 = 'prototype';
|
|
101
|
-
var strFunction = 'function';
|
|
102
|
-
var DynInstFuncTable = '_dynInstFuncs';
|
|
103
|
-
var DynProxyTag = '_isDynProxy';
|
|
104
|
-
var DynClassName = '_dynClass';
|
|
105
|
-
var DynClassNamePrefix = '_dynCls$';
|
|
106
|
-
var DynInstChkTag = '_dynInstChk';
|
|
107
|
-
var DynAllowInstChkTag = DynInstChkTag;
|
|
108
|
-
var DynProtoDefaultOptions = '_dfOpts';
|
|
109
|
-
var UnknownValue = '_unknown_';
|
|
110
|
-
var str__Proto = "__proto__";
|
|
111
|
-
var strUseBaseInst = 'useBaseInst';
|
|
112
|
-
var strSetInstFuncs = 'setInstFuncs';
|
|
113
|
-
var Obj = Object;
|
|
114
|
-
var _objGetPrototypeOf = Obj["getPrototypeOf"];
|
|
115
|
-
var _dynamicNames = 0;
|
|
116
|
-
function _hasOwnProperty(obj, prop) {
|
|
117
|
-
return obj && Obj[Prototype$1].hasOwnProperty.call(obj, prop);
|
|
118
|
-
}
|
|
119
|
-
function _isObjectOrArrayPrototype(target) {
|
|
120
|
-
return target && (target === Obj[Prototype$1] || target === Array[Prototype$1]);
|
|
121
|
-
}
|
|
122
|
-
function _isObjectArrayOrFunctionPrototype(target) {
|
|
123
|
-
return _isObjectOrArrayPrototype(target) || target === Function[Prototype$1];
|
|
124
|
-
}
|
|
125
|
-
function _getObjProto(target) {
|
|
126
|
-
if (target) {
|
|
127
|
-
if (_objGetPrototypeOf) {
|
|
128
|
-
return _objGetPrototypeOf(target);
|
|
129
|
-
}
|
|
130
|
-
var newProto = target[str__Proto] || target[Prototype$1] || (target[Constructor] ? target[Constructor][Prototype$1] : null);
|
|
131
|
-
if (newProto) {
|
|
132
|
-
return newProto;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
return null;
|
|
136
|
-
}
|
|
137
|
-
function _forEachProp(target, func) {
|
|
138
|
-
var props = [];
|
|
139
|
-
var getOwnProps = Obj["getOwnPropertyNames"];
|
|
140
|
-
if (getOwnProps) {
|
|
141
|
-
props = getOwnProps(target);
|
|
142
|
-
}
|
|
143
|
-
else {
|
|
144
|
-
for (var name_1 in target) {
|
|
145
|
-
if (typeof name_1 === "string" && _hasOwnProperty(target, name_1)) {
|
|
146
|
-
props.push(name_1);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
if (props && props.length > 0) {
|
|
151
|
-
for (var lp = 0; lp < props.length; lp++) {
|
|
152
|
-
func(props[lp]);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
function _isDynamicCandidate(target, funcName, skipOwn) {
|
|
157
|
-
return (funcName !== Constructor && typeof target[funcName] === strFunction && (skipOwn || _hasOwnProperty(target, funcName)));
|
|
158
|
-
}
|
|
159
|
-
function _throwTypeError(message) {
|
|
160
|
-
throw new TypeError("DynamicProto: " + message);
|
|
161
|
-
}
|
|
162
|
-
function _getInstanceFuncs(thisTarget) {
|
|
163
|
-
var instFuncs = {};
|
|
164
|
-
_forEachProp(thisTarget, function (name) {
|
|
165
|
-
if (!instFuncs[name] && _isDynamicCandidate(thisTarget, name, false)) {
|
|
166
|
-
instFuncs[name] = thisTarget[name];
|
|
167
|
-
}
|
|
168
|
-
});
|
|
169
|
-
return instFuncs;
|
|
170
|
-
}
|
|
171
|
-
function _hasVisited(values, value) {
|
|
172
|
-
for (var lp = values.length - 1; lp >= 0; lp--) {
|
|
173
|
-
if (values[lp] === value) {
|
|
174
|
-
return true;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
return false;
|
|
178
|
-
}
|
|
179
|
-
function _getBaseFuncs(classProto, thisTarget, instFuncs, useBaseInst) {
|
|
180
|
-
function _instFuncProxy(target, funcHost, funcName) {
|
|
181
|
-
var theFunc = funcHost[funcName];
|
|
182
|
-
if (theFunc[DynProxyTag] && useBaseInst) {
|
|
183
|
-
var instFuncTable = target[DynInstFuncTable] || {};
|
|
184
|
-
if (instFuncTable[DynAllowInstChkTag] !== false) {
|
|
185
|
-
theFunc = (instFuncTable[funcHost[DynClassName]] || {})[funcName] || theFunc;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
return function () {
|
|
189
|
-
return theFunc.apply(target, arguments);
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
|
-
var baseFuncs = {};
|
|
193
|
-
_forEachProp(instFuncs, function (name) {
|
|
194
|
-
baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name);
|
|
195
|
-
});
|
|
196
|
-
var baseProto = _getObjProto(classProto);
|
|
197
|
-
var visited = [];
|
|
198
|
-
while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) {
|
|
199
|
-
_forEachProp(baseProto, function (name) {
|
|
200
|
-
if (!baseFuncs[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf)) {
|
|
201
|
-
baseFuncs[name] = _instFuncProxy(thisTarget, baseProto, name);
|
|
202
|
-
}
|
|
203
|
-
});
|
|
204
|
-
visited.push(baseProto);
|
|
205
|
-
baseProto = _getObjProto(baseProto);
|
|
206
|
-
}
|
|
207
|
-
return baseFuncs;
|
|
208
|
-
}
|
|
209
|
-
function _getInstFunc(target, funcName, proto, currentDynProtoProxy) {
|
|
210
|
-
var instFunc = null;
|
|
211
|
-
if (target && _hasOwnProperty(proto, DynClassName)) {
|
|
212
|
-
var instFuncTable = target[DynInstFuncTable] || {};
|
|
213
|
-
instFunc = (instFuncTable[proto[DynClassName]] || {})[funcName];
|
|
214
|
-
if (!instFunc) {
|
|
215
|
-
_throwTypeError("Missing [" + funcName + "] " + strFunction);
|
|
216
|
-
}
|
|
217
|
-
if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) {
|
|
218
|
-
var canAddInst = !_hasOwnProperty(target, funcName);
|
|
219
|
-
var objProto = _getObjProto(target);
|
|
220
|
-
var visited = [];
|
|
221
|
-
while (canAddInst && objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) {
|
|
222
|
-
var protoFunc = objProto[funcName];
|
|
223
|
-
if (protoFunc) {
|
|
224
|
-
canAddInst = (protoFunc === currentDynProtoProxy);
|
|
225
|
-
break;
|
|
226
|
-
}
|
|
227
|
-
visited.push(objProto);
|
|
228
|
-
objProto = _getObjProto(objProto);
|
|
229
|
-
}
|
|
230
|
-
try {
|
|
231
|
-
if (canAddInst) {
|
|
232
|
-
target[funcName] = instFunc;
|
|
233
|
-
}
|
|
234
|
-
instFunc[DynInstChkTag] = 1;
|
|
235
|
-
}
|
|
236
|
-
catch (e) {
|
|
237
|
-
instFuncTable[DynAllowInstChkTag] = false;
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
return instFunc;
|
|
242
|
-
}
|
|
243
|
-
function _getProtoFunc(funcName, proto, currentDynProtoProxy) {
|
|
244
|
-
var protoFunc = proto[funcName];
|
|
245
|
-
if (protoFunc === currentDynProtoProxy) {
|
|
246
|
-
protoFunc = _getObjProto(proto)[funcName];
|
|
247
|
-
}
|
|
248
|
-
if (typeof protoFunc !== strFunction) {
|
|
249
|
-
_throwTypeError("[" + funcName + "] is not a " + strFunction);
|
|
250
|
-
}
|
|
251
|
-
return protoFunc;
|
|
252
|
-
}
|
|
253
|
-
function _populatePrototype(proto, className, target, baseInstFuncs, setInstanceFunc) {
|
|
254
|
-
function _createDynamicPrototype(proto, funcName) {
|
|
255
|
-
var dynProtoProxy = function () {
|
|
256
|
-
var instFunc = _getInstFunc(this, funcName, proto, dynProtoProxy) || _getProtoFunc(funcName, proto, dynProtoProxy);
|
|
257
|
-
return instFunc.apply(this, arguments);
|
|
258
|
-
};
|
|
259
|
-
dynProtoProxy[DynProxyTag] = 1;
|
|
260
|
-
return dynProtoProxy;
|
|
261
|
-
}
|
|
262
|
-
if (!_isObjectOrArrayPrototype(proto)) {
|
|
263
|
-
var instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || {};
|
|
264
|
-
var instFuncs_1 = instFuncTable[className] = (instFuncTable[className] || {});
|
|
265
|
-
if (instFuncTable[DynAllowInstChkTag] !== false) {
|
|
266
|
-
instFuncTable[DynAllowInstChkTag] = !!setInstanceFunc;
|
|
267
|
-
}
|
|
268
|
-
_forEachProp(target, function (name) {
|
|
269
|
-
if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name]) {
|
|
270
|
-
instFuncs_1[name] = target[name];
|
|
271
|
-
delete target[name];
|
|
272
|
-
if (!_hasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) {
|
|
273
|
-
proto[name] = _createDynamicPrototype(proto, name);
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
});
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
function _checkPrototype(classProto, thisTarget) {
|
|
280
|
-
if (_objGetPrototypeOf) {
|
|
281
|
-
var visited = [];
|
|
282
|
-
var thisProto = _getObjProto(thisTarget);
|
|
283
|
-
while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto) && !_hasVisited(visited, thisProto)) {
|
|
284
|
-
if (thisProto === classProto) {
|
|
285
|
-
return true;
|
|
286
|
-
}
|
|
287
|
-
visited.push(thisProto);
|
|
288
|
-
thisProto = _getObjProto(thisProto);
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
return false;
|
|
292
|
-
}
|
|
293
|
-
function _getObjName(target, unknownValue) {
|
|
294
|
-
if (_hasOwnProperty(target, Prototype$1)) {
|
|
295
|
-
return target.name || unknownValue || UnknownValue;
|
|
296
|
-
}
|
|
297
|
-
return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue;
|
|
298
|
-
}
|
|
299
|
-
function dynamicProto(theClass, target, delegateFunc, options) {
|
|
300
|
-
if (!_hasOwnProperty(theClass, Prototype$1)) {
|
|
301
|
-
_throwTypeError("theClass is an invalid class definition.");
|
|
302
|
-
}
|
|
303
|
-
var classProto = theClass[Prototype$1];
|
|
304
|
-
if (!_checkPrototype(classProto, target)) {
|
|
305
|
-
_throwTypeError("[" + _getObjName(theClass) + "] is not in class hierarchy of [" + _getObjName(target) + "]");
|
|
306
|
-
}
|
|
307
|
-
var className = null;
|
|
308
|
-
if (_hasOwnProperty(classProto, DynClassName)) {
|
|
309
|
-
className = classProto[DynClassName];
|
|
310
|
-
}
|
|
311
|
-
else {
|
|
312
|
-
className = DynClassNamePrefix + _getObjName(theClass, "_") + "$" + _dynamicNames;
|
|
313
|
-
_dynamicNames++;
|
|
314
|
-
classProto[DynClassName] = className;
|
|
315
|
-
}
|
|
316
|
-
var perfOptions = dynamicProto[DynProtoDefaultOptions];
|
|
317
|
-
var useBaseInst = !!perfOptions[strUseBaseInst];
|
|
318
|
-
if (useBaseInst && options && options[strUseBaseInst] !== undefined) {
|
|
319
|
-
useBaseInst = !!options[strUseBaseInst];
|
|
320
|
-
}
|
|
321
|
-
var instFuncs = _getInstanceFuncs(target);
|
|
322
|
-
var baseFuncs = _getBaseFuncs(classProto, target, instFuncs, useBaseInst);
|
|
323
|
-
delegateFunc(target, baseFuncs);
|
|
324
|
-
var setInstanceFunc = !!_objGetPrototypeOf && !!perfOptions[strSetInstFuncs];
|
|
325
|
-
if (setInstanceFunc && options) {
|
|
326
|
-
setInstanceFunc = !!options[strSetInstFuncs];
|
|
327
|
-
}
|
|
328
|
-
_populatePrototype(classProto, className, target, instFuncs, setInstanceFunc !== false);
|
|
329
|
-
}
|
|
330
|
-
var perfDefaults = {
|
|
331
|
-
setInstFuncs: true,
|
|
332
|
-
useBaseInst: true
|
|
333
|
-
};
|
|
334
|
-
dynamicProto[DynProtoDefaultOptions] = perfDefaults;
|
|
335
|
-
|
|
336
|
-
var LoggingSeverity;
|
|
337
|
-
(function (LoggingSeverity) {
|
|
338
|
-
LoggingSeverity[LoggingSeverity["CRITICAL"] = 1] = "CRITICAL";
|
|
339
|
-
LoggingSeverity[LoggingSeverity["WARNING"] = 2] = "WARNING";
|
|
340
|
-
})(LoggingSeverity || (LoggingSeverity = {}));
|
|
341
|
-
var _InternalMessageId = {
|
|
342
|
-
BrowserDoesNotSupportLocalStorage: 0,
|
|
343
|
-
BrowserCannotReadLocalStorage: 1,
|
|
344
|
-
BrowserCannotReadSessionStorage: 2,
|
|
345
|
-
BrowserCannotWriteLocalStorage: 3,
|
|
346
|
-
BrowserCannotWriteSessionStorage: 4,
|
|
347
|
-
BrowserFailedRemovalFromLocalStorage: 5,
|
|
348
|
-
BrowserFailedRemovalFromSessionStorage: 6,
|
|
349
|
-
CannotSendEmptyTelemetry: 7,
|
|
350
|
-
ClientPerformanceMathError: 8,
|
|
351
|
-
ErrorParsingAISessionCookie: 9,
|
|
352
|
-
ErrorPVCalc: 10,
|
|
353
|
-
ExceptionWhileLoggingError: 11,
|
|
354
|
-
FailedAddingTelemetryToBuffer: 12,
|
|
355
|
-
FailedMonitorAjaxAbort: 13,
|
|
356
|
-
FailedMonitorAjaxDur: 14,
|
|
357
|
-
FailedMonitorAjaxOpen: 15,
|
|
358
|
-
FailedMonitorAjaxRSC: 16,
|
|
359
|
-
FailedMonitorAjaxSend: 17,
|
|
360
|
-
FailedMonitorAjaxGetCorrelationHeader: 18,
|
|
361
|
-
FailedToAddHandlerForOnBeforeUnload: 19,
|
|
362
|
-
FailedToSendQueuedTelemetry: 20,
|
|
363
|
-
FailedToReportDataLoss: 21,
|
|
364
|
-
FlushFailed: 22,
|
|
365
|
-
MessageLimitPerPVExceeded: 23,
|
|
366
|
-
MissingRequiredFieldSpecification: 24,
|
|
367
|
-
NavigationTimingNotSupported: 25,
|
|
368
|
-
OnError: 26,
|
|
369
|
-
SessionRenewalDateIsZero: 27,
|
|
370
|
-
SenderNotInitialized: 28,
|
|
371
|
-
StartTrackEventFailed: 29,
|
|
372
|
-
StopTrackEventFailed: 30,
|
|
373
|
-
StartTrackFailed: 31,
|
|
374
|
-
StopTrackFailed: 32,
|
|
375
|
-
TelemetrySampledAndNotSent: 33,
|
|
376
|
-
TrackEventFailed: 34,
|
|
377
|
-
TrackExceptionFailed: 35,
|
|
378
|
-
TrackMetricFailed: 36,
|
|
379
|
-
TrackPVFailed: 37,
|
|
380
|
-
TrackPVFailedCalc: 38,
|
|
381
|
-
TrackTraceFailed: 39,
|
|
382
|
-
TransmissionFailed: 40,
|
|
383
|
-
FailedToSetStorageBuffer: 41,
|
|
384
|
-
FailedToRestoreStorageBuffer: 42,
|
|
385
|
-
InvalidBackendResponse: 43,
|
|
386
|
-
FailedToFixDepricatedValues: 44,
|
|
387
|
-
InvalidDurationValue: 45,
|
|
388
|
-
TelemetryEnvelopeInvalid: 46,
|
|
389
|
-
CreateEnvelopeError: 47,
|
|
390
|
-
CannotSerializeObject: 48,
|
|
391
|
-
CannotSerializeObjectNonSerializable: 49,
|
|
392
|
-
CircularReferenceDetected: 50,
|
|
393
|
-
ClearAuthContextFailed: 51,
|
|
394
|
-
ExceptionTruncated: 52,
|
|
395
|
-
IllegalCharsInName: 53,
|
|
396
|
-
ItemNotInArray: 54,
|
|
397
|
-
MaxAjaxPerPVExceeded: 55,
|
|
398
|
-
MessageTruncated: 56,
|
|
399
|
-
NameTooLong: 57,
|
|
400
|
-
SampleRateOutOfRange: 58,
|
|
401
|
-
SetAuthContextFailed: 59,
|
|
402
|
-
SetAuthContextFailedAccountName: 60,
|
|
403
|
-
StringValueTooLong: 61,
|
|
404
|
-
StartCalledMoreThanOnce: 62,
|
|
405
|
-
StopCalledWithoutStart: 63,
|
|
406
|
-
TelemetryInitializerFailed: 64,
|
|
407
|
-
TrackArgumentsNotSpecified: 65,
|
|
408
|
-
UrlTooLong: 66,
|
|
409
|
-
SessionStorageBufferFull: 67,
|
|
410
|
-
CannotAccessCookie: 68,
|
|
411
|
-
IdTooLong: 69,
|
|
412
|
-
InvalidEvent: 70,
|
|
413
|
-
FailedMonitorAjaxSetRequestHeader: 71,
|
|
414
|
-
SendBrowserInfoOnUserInit: 72,
|
|
415
|
-
PluginException: 73,
|
|
416
|
-
NotificationException: 74,
|
|
417
|
-
SnippetScriptLoadFailure: 99,
|
|
418
|
-
InvalidInstrumentationKey: 100,
|
|
419
|
-
CannotParseAiBlobValue: 101,
|
|
420
|
-
InvalidContentBlob: 102,
|
|
421
|
-
TrackPageActionEventFailed: 103,
|
|
422
|
-
FailedAddingCustomDefinedRequestContext: 104,
|
|
423
|
-
InMemoryStorageBufferFull: 105
|
|
424
|
-
};
|
|
425
|
-
|
|
426
|
-
var strOnPrefix = "on";
|
|
427
|
-
var strAttachEvent = "attachEvent";
|
|
428
|
-
var strAddEventHelper = "addEventListener";
|
|
429
|
-
var strToString = "toString";
|
|
430
|
-
var _objDefineProperty = ObjDefineProperty;
|
|
431
|
-
var _isArray = Array.isArray;
|
|
432
|
-
var _objToString = ObjProto[strToString];
|
|
433
|
-
var _fnToString = ObjHasOwnProperty[strToString];
|
|
434
|
-
_fnToString.call(ObjClass);
|
|
435
|
-
function isUndefined(value) {
|
|
436
|
-
return value === undefined || typeof value === strShimUndefined;
|
|
437
|
-
}
|
|
438
|
-
function isNullOrUndefined(value) {
|
|
439
|
-
return (value === null || isUndefined(value));
|
|
440
|
-
}
|
|
441
|
-
function hasOwnProperty(obj, prop) {
|
|
442
|
-
return !!(obj && ObjHasOwnProperty.call(obj, prop));
|
|
443
|
-
}
|
|
444
|
-
function isFunction(value) {
|
|
445
|
-
return !!(value && typeof value === strShimFunction);
|
|
446
|
-
}
|
|
447
|
-
function attachEvent(obj, eventNameWithoutOn, handlerRef, useCapture) {
|
|
448
|
-
if (useCapture === void 0) { useCapture = false; }
|
|
449
|
-
var result = false;
|
|
450
|
-
if (!isNullOrUndefined(obj)) {
|
|
451
|
-
try {
|
|
452
|
-
if (!isNullOrUndefined(obj[strAddEventHelper])) {
|
|
453
|
-
obj[strAddEventHelper](eventNameWithoutOn, handlerRef, useCapture);
|
|
454
|
-
result = true;
|
|
455
|
-
}
|
|
456
|
-
else if (!isNullOrUndefined(obj[strAttachEvent])) {
|
|
457
|
-
obj[strAttachEvent](strOnPrefix + eventNameWithoutOn, handlerRef);
|
|
458
|
-
result = true;
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
catch (e) {
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
return result;
|
|
465
|
-
}
|
|
466
|
-
function objForEachKey(target, callbackfn) {
|
|
467
|
-
if (target) {
|
|
468
|
-
for (var prop in target) {
|
|
469
|
-
if (ObjHasOwnProperty.call(target, prop)) {
|
|
470
|
-
callbackfn.call(target, prop, target[prop]);
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
|
-
}
|
|
474
|
-
}
|
|
475
|
-
var isArray = _isArray || _isArrayPoly;
|
|
476
|
-
function _isArrayPoly(obj) {
|
|
477
|
-
return !!(obj && _objToString.call(obj) === "[object Array]");
|
|
478
|
-
}
|
|
479
|
-
function isError(obj) {
|
|
480
|
-
return !!(obj && _objToString.call(obj) === "[object Error]");
|
|
481
|
-
}
|
|
482
|
-
function arrForEach(arr, callbackfn, thisArg) {
|
|
483
|
-
var len = arr.length;
|
|
484
|
-
try {
|
|
485
|
-
for (var idx = 0; idx < len; idx++) {
|
|
486
|
-
if (idx in arr) {
|
|
487
|
-
if (callbackfn.call(thisArg || arr, arr[idx], idx, arr) === -1) {
|
|
488
|
-
break;
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
catch (e) {
|
|
494
|
-
}
|
|
495
|
-
}
|
|
496
|
-
function objDefineAccessors(target, prop, getProp, setProp) {
|
|
497
|
-
if (_objDefineProperty) {
|
|
498
|
-
try {
|
|
499
|
-
var descriptor = {
|
|
500
|
-
enumerable: true,
|
|
501
|
-
configurable: true
|
|
502
|
-
};
|
|
503
|
-
if (getProp) {
|
|
504
|
-
descriptor.get = getProp;
|
|
505
|
-
}
|
|
506
|
-
if (setProp) {
|
|
507
|
-
descriptor.set = setProp;
|
|
508
|
-
}
|
|
509
|
-
_objDefineProperty(target, prop, descriptor);
|
|
510
|
-
return true;
|
|
511
|
-
}
|
|
512
|
-
catch (e) {
|
|
513
|
-
}
|
|
514
|
-
}
|
|
515
|
-
return false;
|
|
516
|
-
}
|
|
517
|
-
function dateNow() {
|
|
518
|
-
var dt = Date;
|
|
519
|
-
return dt.now ? dt.now() : new dt().getTime();
|
|
520
|
-
}
|
|
521
|
-
function getExceptionName(object) {
|
|
522
|
-
if (isError(object)) {
|
|
523
|
-
return object.name;
|
|
524
|
-
}
|
|
525
|
-
return "";
|
|
526
|
-
}
|
|
527
|
-
function setValue(target, field, value, valChk, srcChk) {
|
|
528
|
-
var theValue = value;
|
|
529
|
-
if (target) {
|
|
530
|
-
theValue = target[field];
|
|
531
|
-
if (theValue !== value && (!srcChk || srcChk(theValue)) && (!valChk || valChk(value))) {
|
|
532
|
-
theValue = value;
|
|
533
|
-
target[field] = theValue;
|
|
534
|
-
}
|
|
535
|
-
}
|
|
536
|
-
return theValue;
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
var strWindow = "window";
|
|
540
|
-
var strDocument = "document";
|
|
541
|
-
var strLocation = "location";
|
|
542
|
-
var strConsole = "console";
|
|
543
|
-
var strPerformance = "performance";
|
|
544
|
-
var strJSON = "JSON";
|
|
545
|
-
var _enableMocks = false;
|
|
546
|
-
function getGlobalInst(name) {
|
|
547
|
-
var gbl = getGlobal();
|
|
548
|
-
if (gbl && gbl[name]) {
|
|
549
|
-
return gbl[name];
|
|
550
|
-
}
|
|
551
|
-
if (name === strWindow && hasWindow()) {
|
|
552
|
-
return window;
|
|
553
|
-
}
|
|
554
|
-
return null;
|
|
555
|
-
}
|
|
556
|
-
function hasWindow() {
|
|
557
|
-
return Boolean(typeof window === strShimObject && window);
|
|
558
|
-
}
|
|
559
|
-
function getWindow() {
|
|
560
|
-
if (hasWindow()) {
|
|
561
|
-
return window;
|
|
562
|
-
}
|
|
563
|
-
return getGlobalInst(strWindow);
|
|
564
|
-
}
|
|
565
|
-
function hasDocument() {
|
|
566
|
-
return Boolean(typeof document === strShimObject && document);
|
|
567
|
-
}
|
|
568
|
-
function getDocument() {
|
|
569
|
-
if (hasDocument()) {
|
|
570
|
-
return document;
|
|
571
|
-
}
|
|
572
|
-
return getGlobalInst(strDocument);
|
|
573
|
-
}
|
|
574
|
-
function getLocation(checkForMock) {
|
|
575
|
-
if (checkForMock && _enableMocks) {
|
|
576
|
-
var mockLocation = getGlobalInst("__mockLocation");
|
|
577
|
-
if (mockLocation) {
|
|
578
|
-
return mockLocation;
|
|
579
|
-
}
|
|
580
|
-
}
|
|
581
|
-
if (typeof location === strShimObject && location) {
|
|
582
|
-
return location;
|
|
583
|
-
}
|
|
584
|
-
return getGlobalInst(strLocation);
|
|
585
|
-
}
|
|
586
|
-
function getConsole() {
|
|
587
|
-
if (typeof console !== strShimUndefined) {
|
|
588
|
-
return console;
|
|
589
|
-
}
|
|
590
|
-
return getGlobalInst(strConsole);
|
|
591
|
-
}
|
|
592
|
-
function getPerformance() {
|
|
593
|
-
return getGlobalInst(strPerformance);
|
|
594
|
-
}
|
|
595
|
-
function hasJSON() {
|
|
596
|
-
return Boolean((typeof JSON === strShimObject && JSON) || getGlobalInst(strJSON) !== null);
|
|
597
|
-
}
|
|
598
|
-
function getJSON() {
|
|
599
|
-
if (hasJSON()) {
|
|
600
|
-
return JSON || getGlobalInst(strJSON);
|
|
601
|
-
}
|
|
602
|
-
return null;
|
|
603
|
-
}
|
|
604
|
-
function dumpObj(object) {
|
|
605
|
-
var objectTypeDump = Object[strShimPrototype].toString.call(object);
|
|
606
|
-
var propertyValueDump = "";
|
|
607
|
-
if (objectTypeDump === "[object Error]") {
|
|
608
|
-
propertyValueDump = "{ stack: '" + object.stack + "', message: '" + object.message + "', name: '" + object.name + "'";
|
|
609
|
-
}
|
|
610
|
-
else if (hasJSON()) {
|
|
611
|
-
propertyValueDump = getJSON().stringify(object);
|
|
612
|
-
}
|
|
613
|
-
return objectTypeDump + propertyValueDump;
|
|
614
|
-
}
|
|
615
|
-
|
|
616
|
-
var _aiNamespace = null;
|
|
617
|
-
function _getExtensionNamespace() {
|
|
618
|
-
var target = getGlobalInst("Microsoft");
|
|
619
|
-
if (target) {
|
|
620
|
-
_aiNamespace = target["ApplicationInsights"];
|
|
621
|
-
}
|
|
622
|
-
return _aiNamespace;
|
|
623
|
-
}
|
|
624
|
-
function getDebugExt(config) {
|
|
625
|
-
var ns = _aiNamespace;
|
|
626
|
-
if (!ns && config.disableDbgExt !== true) {
|
|
627
|
-
ns = _aiNamespace || _getExtensionNamespace();
|
|
628
|
-
}
|
|
629
|
-
return ns ? ns["ChromeDbgExt"] : null;
|
|
630
|
-
}
|
|
631
|
-
|
|
632
|
-
var AiNonUserActionablePrefix = "AI (Internal): ";
|
|
633
|
-
var AiUserActionablePrefix = "AI: ";
|
|
634
|
-
var AIInternalMessagePrefix = "AITR_";
|
|
635
|
-
var strErrorToConsole = "errorToConsole";
|
|
636
|
-
var strWarnToConsole = "warnToConsole";
|
|
637
|
-
function _sanitizeDiagnosticText(text) {
|
|
638
|
-
if (text) {
|
|
639
|
-
return "\"" + text.replace(/\"/g, "") + "\"";
|
|
640
|
-
}
|
|
641
|
-
return "";
|
|
642
|
-
}
|
|
643
|
-
function _logToConsole(func, message) {
|
|
644
|
-
var theConsole = getConsole();
|
|
645
|
-
if (!!theConsole) {
|
|
646
|
-
var logFunc = "log";
|
|
647
|
-
if (theConsole[func]) {
|
|
648
|
-
logFunc = func;
|
|
649
|
-
}
|
|
650
|
-
if (isFunction(theConsole[logFunc])) {
|
|
651
|
-
theConsole[logFunc](message);
|
|
652
|
-
}
|
|
653
|
-
}
|
|
654
|
-
}
|
|
655
|
-
var _InternalLogMessage = /** @class */ (function () {
|
|
656
|
-
function _InternalLogMessage(msgId, msg, isUserAct, properties) {
|
|
657
|
-
if (isUserAct === void 0) { isUserAct = false; }
|
|
658
|
-
var _self = this;
|
|
659
|
-
_self.messageId = msgId;
|
|
660
|
-
_self.message =
|
|
661
|
-
(isUserAct ? AiUserActionablePrefix : AiNonUserActionablePrefix) +
|
|
662
|
-
msgId;
|
|
663
|
-
var strProps = "";
|
|
664
|
-
if (hasJSON()) {
|
|
665
|
-
strProps = getJSON().stringify(properties);
|
|
666
|
-
}
|
|
667
|
-
var diagnosticText = (msg ? " message:" + _sanitizeDiagnosticText(msg) : "") +
|
|
668
|
-
(properties ? " props:" + _sanitizeDiagnosticText(strProps) : "");
|
|
669
|
-
_self.message += diagnosticText;
|
|
670
|
-
}
|
|
671
|
-
_InternalLogMessage.dataType = "MessageData";
|
|
672
|
-
return _InternalLogMessage;
|
|
673
|
-
}());
|
|
674
|
-
function safeGetLogger(core, config) {
|
|
675
|
-
return (core || {}).logger || new DiagnosticLogger(config);
|
|
676
|
-
}
|
|
677
|
-
var DiagnosticLogger = /** @class */ (function () {
|
|
678
|
-
function DiagnosticLogger(config) {
|
|
679
|
-
this.identifier = "DiagnosticLogger";
|
|
680
|
-
this.queue = [];
|
|
681
|
-
var _messageCount = 0;
|
|
682
|
-
var _messageLogged = {};
|
|
683
|
-
dynamicProto(DiagnosticLogger, this, function (_self) {
|
|
684
|
-
if (isNullOrUndefined(config)) {
|
|
685
|
-
config = {};
|
|
686
|
-
}
|
|
687
|
-
_self.consoleLoggingLevel = function () { return _getConfigValue("loggingLevelConsole", 0); };
|
|
688
|
-
_self.telemetryLoggingLevel = function () { return _getConfigValue("loggingLevelTelemetry", 1); };
|
|
689
|
-
_self.maxInternalMessageLimit = function () { return _getConfigValue("maxMessageLimit", 25); };
|
|
690
|
-
_self.enableDebugExceptions = function () { return _getConfigValue("enableDebugExceptions", false); };
|
|
691
|
-
_self.throwInternal = function (severity, msgId, msg, properties, isUserAct) {
|
|
692
|
-
if (isUserAct === void 0) { isUserAct = false; }
|
|
693
|
-
var message = new _InternalLogMessage(msgId, msg, isUserAct, properties);
|
|
694
|
-
if (_self.enableDebugExceptions()) {
|
|
695
|
-
throw message;
|
|
696
|
-
}
|
|
697
|
-
else {
|
|
698
|
-
var logFunc = severity === LoggingSeverity.CRITICAL ? strErrorToConsole : strWarnToConsole;
|
|
699
|
-
if (!isUndefined(message.message)) {
|
|
700
|
-
var logLevel = _self.consoleLoggingLevel();
|
|
701
|
-
if (isUserAct) {
|
|
702
|
-
var messageKey = +message.messageId;
|
|
703
|
-
if (!_messageLogged[messageKey] && logLevel >= severity) {
|
|
704
|
-
_self[logFunc](message.message);
|
|
705
|
-
_messageLogged[messageKey] = true;
|
|
706
|
-
}
|
|
707
|
-
}
|
|
708
|
-
else {
|
|
709
|
-
if (logLevel >= severity) {
|
|
710
|
-
_self[logFunc](message.message);
|
|
711
|
-
}
|
|
712
|
-
}
|
|
713
|
-
_self.logInternalMessage(severity, message);
|
|
714
|
-
}
|
|
715
|
-
else {
|
|
716
|
-
_debugExtMsg("throw" + (severity === LoggingSeverity.CRITICAL ? "Critical" : "Warning"), message);
|
|
717
|
-
}
|
|
718
|
-
}
|
|
719
|
-
};
|
|
720
|
-
_self.warnToConsole = function (message) {
|
|
721
|
-
_logToConsole("warn", message);
|
|
722
|
-
_debugExtMsg("warning", message);
|
|
723
|
-
};
|
|
724
|
-
_self.errorToConsole = function (message) {
|
|
725
|
-
_logToConsole("error", message);
|
|
726
|
-
_debugExtMsg("error", message);
|
|
727
|
-
};
|
|
728
|
-
_self.resetInternalMessageCount = function () {
|
|
729
|
-
_messageCount = 0;
|
|
730
|
-
_messageLogged = {};
|
|
731
|
-
};
|
|
732
|
-
_self.logInternalMessage = function (severity, message) {
|
|
733
|
-
if (_areInternalMessagesThrottled()) {
|
|
734
|
-
return;
|
|
735
|
-
}
|
|
736
|
-
var logMessage = true;
|
|
737
|
-
var messageKey = AIInternalMessagePrefix + message.messageId;
|
|
738
|
-
if (_messageLogged[messageKey]) {
|
|
739
|
-
logMessage = false;
|
|
740
|
-
}
|
|
741
|
-
else {
|
|
742
|
-
_messageLogged[messageKey] = true;
|
|
743
|
-
}
|
|
744
|
-
if (logMessage) {
|
|
745
|
-
if (severity <= _self.telemetryLoggingLevel()) {
|
|
746
|
-
_self.queue.push(message);
|
|
747
|
-
_messageCount++;
|
|
748
|
-
_debugExtMsg((severity === LoggingSeverity.CRITICAL ? "error" : "warn"), message);
|
|
749
|
-
}
|
|
750
|
-
if (_messageCount === _self.maxInternalMessageLimit()) {
|
|
751
|
-
var throttleLimitMessage = "Internal events throttle limit per PageView reached for this app.";
|
|
752
|
-
var throttleMessage = new _InternalLogMessage(_InternalMessageId.MessageLimitPerPVExceeded, throttleLimitMessage, false);
|
|
753
|
-
_self.queue.push(throttleMessage);
|
|
754
|
-
if (severity === LoggingSeverity.CRITICAL) {
|
|
755
|
-
_self.errorToConsole(throttleLimitMessage);
|
|
756
|
-
}
|
|
757
|
-
else {
|
|
758
|
-
_self.warnToConsole(throttleLimitMessage);
|
|
759
|
-
}
|
|
760
|
-
}
|
|
761
|
-
}
|
|
762
|
-
};
|
|
763
|
-
function _getConfigValue(name, defValue) {
|
|
764
|
-
var value = config[name];
|
|
765
|
-
if (!isNullOrUndefined(value)) {
|
|
766
|
-
return value;
|
|
767
|
-
}
|
|
768
|
-
return defValue;
|
|
769
|
-
}
|
|
770
|
-
function _areInternalMessagesThrottled() {
|
|
771
|
-
return _messageCount >= _self.maxInternalMessageLimit();
|
|
772
|
-
}
|
|
773
|
-
function _debugExtMsg(name, data) {
|
|
774
|
-
var dbgExt = getDebugExt(config);
|
|
775
|
-
if (dbgExt && dbgExt.diagLog) {
|
|
776
|
-
dbgExt.diagLog(name, data);
|
|
777
|
-
}
|
|
778
|
-
}
|
|
779
|
-
});
|
|
780
|
-
}
|
|
781
|
-
return DiagnosticLogger;
|
|
782
|
-
}());
|
|
783
|
-
|
|
784
|
-
var strExecutionContextKey = "ctx";
|
|
785
|
-
var PerfEvent = /** @class */ (function () {
|
|
786
|
-
function PerfEvent(name, payloadDetails, isAsync) {
|
|
787
|
-
var _self = this;
|
|
788
|
-
var accessorDefined = false;
|
|
789
|
-
_self.start = dateNow();
|
|
790
|
-
_self.name = name;
|
|
791
|
-
_self.isAsync = isAsync;
|
|
792
|
-
_self.isChildEvt = function () { return false; };
|
|
793
|
-
if (isFunction(payloadDetails)) {
|
|
794
|
-
var theDetails_1;
|
|
795
|
-
accessorDefined = objDefineAccessors(_self, "payload", function () {
|
|
796
|
-
if (!theDetails_1 && isFunction(payloadDetails)) {
|
|
797
|
-
theDetails_1 = payloadDetails();
|
|
798
|
-
payloadDetails = null;
|
|
799
|
-
}
|
|
800
|
-
return theDetails_1;
|
|
801
|
-
});
|
|
802
|
-
}
|
|
803
|
-
_self.getCtx = function (key) {
|
|
804
|
-
if (key) {
|
|
805
|
-
if (key === PerfEvent.ParentContextKey || key === PerfEvent.ChildrenContextKey) {
|
|
806
|
-
return _self[key];
|
|
807
|
-
}
|
|
808
|
-
return (_self[strExecutionContextKey] || {})[key];
|
|
809
|
-
}
|
|
810
|
-
return null;
|
|
811
|
-
};
|
|
812
|
-
_self.setCtx = function (key, value) {
|
|
813
|
-
if (key) {
|
|
814
|
-
if (key === PerfEvent.ParentContextKey) {
|
|
815
|
-
if (!_self[key]) {
|
|
816
|
-
_self.isChildEvt = function () { return true; };
|
|
817
|
-
}
|
|
818
|
-
_self[key] = value;
|
|
819
|
-
}
|
|
820
|
-
else if (key === PerfEvent.ChildrenContextKey) {
|
|
821
|
-
_self[key] = value;
|
|
822
|
-
}
|
|
823
|
-
else {
|
|
824
|
-
var ctx = _self[strExecutionContextKey] = _self[strExecutionContextKey] || {};
|
|
825
|
-
ctx[key] = value;
|
|
826
|
-
}
|
|
827
|
-
}
|
|
828
|
-
};
|
|
829
|
-
_self.complete = function () {
|
|
830
|
-
var childTime = 0;
|
|
831
|
-
var childEvts = _self.getCtx(PerfEvent.ChildrenContextKey);
|
|
832
|
-
if (isArray(childEvts)) {
|
|
833
|
-
for (var lp = 0; lp < childEvts.length; lp++) {
|
|
834
|
-
var childEvt = childEvts[lp];
|
|
835
|
-
if (childEvt) {
|
|
836
|
-
childTime += childEvt.time;
|
|
837
|
-
}
|
|
838
|
-
}
|
|
839
|
-
}
|
|
840
|
-
_self.time = dateNow() - _self.start;
|
|
841
|
-
_self.exTime = _self.time - childTime;
|
|
842
|
-
_self.complete = function () { };
|
|
843
|
-
if (!accessorDefined && isFunction(payloadDetails)) {
|
|
844
|
-
_self.payload = payloadDetails();
|
|
845
|
-
}
|
|
846
|
-
};
|
|
847
|
-
}
|
|
848
|
-
PerfEvent.ParentContextKey = "parent";
|
|
849
|
-
PerfEvent.ChildrenContextKey = "childEvts";
|
|
850
|
-
return PerfEvent;
|
|
851
|
-
}());
|
|
852
|
-
var doPerfActiveKey = "CoreUtils.doPerf";
|
|
853
|
-
function doPerf(mgrSource, getSource, func, details, isAsync) {
|
|
854
|
-
if (mgrSource) {
|
|
855
|
-
var perfMgr = mgrSource;
|
|
856
|
-
if (isFunction(perfMgr["getPerfMgr"])) {
|
|
857
|
-
perfMgr = perfMgr["getPerfMgr"]();
|
|
858
|
-
}
|
|
859
|
-
if (perfMgr) {
|
|
860
|
-
var perfEvt = void 0;
|
|
861
|
-
var currentActive = perfMgr.getCtx(doPerfActiveKey);
|
|
862
|
-
try {
|
|
863
|
-
perfEvt = perfMgr.create(getSource(), details, isAsync);
|
|
864
|
-
if (perfEvt) {
|
|
865
|
-
if (currentActive && perfEvt.setCtx) {
|
|
866
|
-
perfEvt.setCtx(PerfEvent.ParentContextKey, currentActive);
|
|
867
|
-
if (currentActive.getCtx && currentActive.setCtx) {
|
|
868
|
-
var children = currentActive.getCtx(PerfEvent.ChildrenContextKey);
|
|
869
|
-
if (!children) {
|
|
870
|
-
children = [];
|
|
871
|
-
currentActive.setCtx(PerfEvent.ChildrenContextKey, children);
|
|
872
|
-
}
|
|
873
|
-
children.push(perfEvt);
|
|
874
|
-
}
|
|
875
|
-
}
|
|
876
|
-
perfMgr.setCtx(doPerfActiveKey, perfEvt);
|
|
877
|
-
return func(perfEvt);
|
|
878
|
-
}
|
|
879
|
-
}
|
|
880
|
-
catch (ex) {
|
|
881
|
-
if (perfEvt && perfEvt.setCtx) {
|
|
882
|
-
perfEvt.setCtx("exception", ex);
|
|
883
|
-
}
|
|
884
|
-
}
|
|
885
|
-
finally {
|
|
886
|
-
if (perfEvt) {
|
|
887
|
-
perfMgr.fire(perfEvt);
|
|
888
|
-
}
|
|
889
|
-
perfMgr.setCtx(doPerfActiveKey, currentActive);
|
|
890
|
-
}
|
|
891
|
-
}
|
|
892
|
-
}
|
|
893
|
-
return func();
|
|
894
|
-
}
|
|
895
|
-
|
|
896
|
-
var TelemetryPluginChain = /** @class */ (function () {
|
|
897
|
-
function TelemetryPluginChain(plugin, defItemCtx) {
|
|
898
|
-
var _self = this;
|
|
899
|
-
var _nextProxy = null;
|
|
900
|
-
var _hasProcessTelemetry = isFunction(plugin.processTelemetry);
|
|
901
|
-
var _hasSetNext = isFunction(plugin.setNextPlugin);
|
|
902
|
-
_self._hasRun = false;
|
|
903
|
-
_self.getPlugin = function () {
|
|
904
|
-
return plugin;
|
|
905
|
-
};
|
|
906
|
-
_self.getNext = function () {
|
|
907
|
-
return _nextProxy;
|
|
908
|
-
};
|
|
909
|
-
_self.setNext = function (nextPlugin) {
|
|
910
|
-
_nextProxy = nextPlugin;
|
|
911
|
-
};
|
|
912
|
-
_self.processTelemetry = function (env, itemCtx) {
|
|
913
|
-
if (!itemCtx) {
|
|
914
|
-
itemCtx = defItemCtx;
|
|
915
|
-
}
|
|
916
|
-
var identifier = plugin ? plugin.identifier : "TelemetryPluginChain";
|
|
917
|
-
doPerf(itemCtx ? itemCtx.core() : null, function () { return identifier + ":processTelemetry"; }, function () {
|
|
918
|
-
if (plugin && _hasProcessTelemetry) {
|
|
919
|
-
_self._hasRun = true;
|
|
920
|
-
try {
|
|
921
|
-
itemCtx.setNext(_nextProxy);
|
|
922
|
-
if (_hasSetNext) {
|
|
923
|
-
plugin.setNextPlugin(_nextProxy);
|
|
924
|
-
}
|
|
925
|
-
_nextProxy && (_nextProxy._hasRun = false);
|
|
926
|
-
plugin.processTelemetry(env, itemCtx);
|
|
927
|
-
}
|
|
928
|
-
catch (error) {
|
|
929
|
-
var hasRun = _nextProxy && _nextProxy._hasRun;
|
|
930
|
-
if (!_nextProxy || !hasRun) {
|
|
931
|
-
itemCtx.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.PluginException, "Plugin [" + plugin.identifier + "] failed during processTelemetry - " + dumpObj(error));
|
|
932
|
-
}
|
|
933
|
-
if (_nextProxy && !hasRun) {
|
|
934
|
-
_nextProxy.processTelemetry(env, itemCtx);
|
|
935
|
-
}
|
|
936
|
-
}
|
|
937
|
-
}
|
|
938
|
-
else if (_nextProxy) {
|
|
939
|
-
_self._hasRun = true;
|
|
940
|
-
_nextProxy.processTelemetry(env, itemCtx);
|
|
941
|
-
}
|
|
942
|
-
}, function () { return ({ item: env }); }, !(env.sync));
|
|
943
|
-
};
|
|
944
|
-
}
|
|
945
|
-
return TelemetryPluginChain;
|
|
946
|
-
}());
|
|
947
|
-
|
|
948
|
-
function _createProxyChain(plugins, itemCtx) {
|
|
949
|
-
var proxies = [];
|
|
950
|
-
if (plugins && plugins.length > 0) {
|
|
951
|
-
var lastProxy = null;
|
|
952
|
-
for (var idx = 0; idx < plugins.length; idx++) {
|
|
953
|
-
var thePlugin = plugins[idx];
|
|
954
|
-
if (thePlugin && isFunction(thePlugin.processTelemetry)) {
|
|
955
|
-
var newProxy = new TelemetryPluginChain(thePlugin, itemCtx);
|
|
956
|
-
proxies.push(newProxy);
|
|
957
|
-
if (lastProxy) {
|
|
958
|
-
lastProxy.setNext(newProxy);
|
|
959
|
-
}
|
|
960
|
-
lastProxy = newProxy;
|
|
961
|
-
}
|
|
962
|
-
}
|
|
963
|
-
}
|
|
964
|
-
return proxies.length > 0 ? proxies[0] : null;
|
|
965
|
-
}
|
|
966
|
-
function _copyProxyChain(proxy, itemCtx, startAt) {
|
|
967
|
-
var plugins = [];
|
|
968
|
-
var add = startAt ? false : true;
|
|
969
|
-
if (proxy) {
|
|
970
|
-
while (proxy) {
|
|
971
|
-
var thePlugin = proxy.getPlugin();
|
|
972
|
-
if (add || thePlugin === startAt) {
|
|
973
|
-
add = true;
|
|
974
|
-
plugins.push(thePlugin);
|
|
975
|
-
}
|
|
976
|
-
proxy = proxy.getNext();
|
|
977
|
-
}
|
|
978
|
-
}
|
|
979
|
-
if (!add) {
|
|
980
|
-
plugins.push(startAt);
|
|
981
|
-
}
|
|
982
|
-
return _createProxyChain(plugins, itemCtx);
|
|
983
|
-
}
|
|
984
|
-
function _copyPluginChain(srcPlugins, itemCtx, startAt) {
|
|
985
|
-
var plugins = srcPlugins;
|
|
986
|
-
var add = false;
|
|
987
|
-
if (startAt && srcPlugins) {
|
|
988
|
-
plugins = [];
|
|
989
|
-
arrForEach(srcPlugins, function (thePlugin) {
|
|
990
|
-
if (add || thePlugin === startAt) {
|
|
991
|
-
add = true;
|
|
992
|
-
plugins.push(thePlugin);
|
|
993
|
-
}
|
|
994
|
-
});
|
|
995
|
-
}
|
|
996
|
-
if (startAt && !add) {
|
|
997
|
-
if (!plugins) {
|
|
998
|
-
plugins = [];
|
|
999
|
-
}
|
|
1000
|
-
plugins.push(startAt);
|
|
1001
|
-
}
|
|
1002
|
-
return _createProxyChain(plugins, itemCtx);
|
|
1003
|
-
}
|
|
1004
|
-
var ProcessTelemetryContext = /** @class */ (function () {
|
|
1005
|
-
function ProcessTelemetryContext(plugins, config, core, startAt) {
|
|
1006
|
-
var _self = this;
|
|
1007
|
-
var _nextProxy = null;
|
|
1008
|
-
if (startAt !== null) {
|
|
1009
|
-
if (plugins && isFunction(plugins.getPlugin)) {
|
|
1010
|
-
_nextProxy = _copyProxyChain(plugins, _self, startAt || plugins.getPlugin());
|
|
1011
|
-
}
|
|
1012
|
-
else {
|
|
1013
|
-
if (startAt) {
|
|
1014
|
-
_nextProxy = _copyPluginChain(plugins, _self, startAt);
|
|
1015
|
-
}
|
|
1016
|
-
else if (isUndefined(startAt)) {
|
|
1017
|
-
_nextProxy = _createProxyChain(plugins, _self);
|
|
1018
|
-
}
|
|
1019
|
-
}
|
|
1020
|
-
}
|
|
1021
|
-
_self.core = function () {
|
|
1022
|
-
return core;
|
|
1023
|
-
};
|
|
1024
|
-
_self.diagLog = function () {
|
|
1025
|
-
return safeGetLogger(core, config);
|
|
1026
|
-
};
|
|
1027
|
-
_self.getCfg = function () {
|
|
1028
|
-
return config;
|
|
1029
|
-
};
|
|
1030
|
-
_self.getExtCfg = function (identifier, defaultValue) {
|
|
1031
|
-
if (defaultValue === void 0) { defaultValue = {}; }
|
|
1032
|
-
var theConfig;
|
|
1033
|
-
if (config) {
|
|
1034
|
-
var extConfig = config.extensionConfig;
|
|
1035
|
-
if (extConfig && identifier) {
|
|
1036
|
-
theConfig = extConfig[identifier];
|
|
1037
|
-
}
|
|
1038
|
-
}
|
|
1039
|
-
return (theConfig ? theConfig : defaultValue);
|
|
1040
|
-
};
|
|
1041
|
-
_self.getConfig = function (identifier, field, defaultValue) {
|
|
1042
|
-
if (defaultValue === void 0) { defaultValue = false; }
|
|
1043
|
-
var theValue;
|
|
1044
|
-
var extConfig = _self.getExtCfg(identifier, null);
|
|
1045
|
-
if (extConfig && !isNullOrUndefined(extConfig[field])) {
|
|
1046
|
-
theValue = extConfig[field];
|
|
1047
|
-
}
|
|
1048
|
-
else if (config && !isNullOrUndefined(config[field])) {
|
|
1049
|
-
theValue = config[field];
|
|
1050
|
-
}
|
|
1051
|
-
return !isNullOrUndefined(theValue) ? theValue : defaultValue;
|
|
1052
|
-
};
|
|
1053
|
-
_self.hasNext = function () {
|
|
1054
|
-
return _nextProxy != null;
|
|
1055
|
-
};
|
|
1056
|
-
_self.getNext = function () {
|
|
1057
|
-
return _nextProxy;
|
|
1058
|
-
};
|
|
1059
|
-
_self.setNext = function (nextPlugin) {
|
|
1060
|
-
_nextProxy = nextPlugin;
|
|
1061
|
-
};
|
|
1062
|
-
_self.processNext = function (env) {
|
|
1063
|
-
var nextPlugin = _nextProxy;
|
|
1064
|
-
if (nextPlugin) {
|
|
1065
|
-
_nextProxy = nextPlugin.getNext();
|
|
1066
|
-
nextPlugin.processTelemetry(env, _self);
|
|
1067
|
-
}
|
|
1068
|
-
};
|
|
1069
|
-
_self.createNew = function (plugins, startAt) {
|
|
1070
|
-
if (plugins === void 0) { plugins = null; }
|
|
1071
|
-
return new ProcessTelemetryContext(plugins || _nextProxy, config, core, startAt);
|
|
1072
|
-
};
|
|
1073
|
-
}
|
|
1074
|
-
return ProcessTelemetryContext;
|
|
1075
|
-
}());
|
|
1076
|
-
|
|
1077
|
-
var strExtensionConfig = "extensionConfig";
|
|
1078
|
-
|
|
1079
|
-
var strGetPlugin = "getPlugin";
|
|
1080
|
-
var BaseTelemetryPlugin = /** @class */ (function () {
|
|
1081
|
-
function BaseTelemetryPlugin() {
|
|
1082
|
-
var _self = this;
|
|
1083
|
-
var _isinitialized = false;
|
|
1084
|
-
var _rootCtx = null;
|
|
1085
|
-
var _nextPlugin = null;
|
|
1086
|
-
_self.core = null;
|
|
1087
|
-
_self.diagLog = function (itemCtx) {
|
|
1088
|
-
return _self._getTelCtx(itemCtx).diagLog();
|
|
1089
|
-
};
|
|
1090
|
-
_self.isInitialized = function () {
|
|
1091
|
-
return _isinitialized;
|
|
1092
|
-
};
|
|
1093
|
-
_self.setInitialized = function (isInitialized) {
|
|
1094
|
-
_isinitialized = isInitialized;
|
|
1095
|
-
};
|
|
1096
|
-
_self.setNextPlugin = function (next) {
|
|
1097
|
-
_nextPlugin = next;
|
|
1098
|
-
};
|
|
1099
|
-
_self.processNext = function (env, itemCtx) {
|
|
1100
|
-
if (itemCtx) {
|
|
1101
|
-
itemCtx.processNext(env);
|
|
1102
|
-
}
|
|
1103
|
-
else if (_nextPlugin && isFunction(_nextPlugin.processTelemetry)) {
|
|
1104
|
-
_nextPlugin.processTelemetry(env, null);
|
|
1105
|
-
}
|
|
1106
|
-
};
|
|
1107
|
-
_self._getTelCtx = function (currentCtx) {
|
|
1108
|
-
if (currentCtx === void 0) { currentCtx = null; }
|
|
1109
|
-
var itemCtx = currentCtx;
|
|
1110
|
-
if (!itemCtx) {
|
|
1111
|
-
var rootCtx = _rootCtx || new ProcessTelemetryContext(null, {}, _self.core);
|
|
1112
|
-
if (_nextPlugin && _nextPlugin[strGetPlugin]) {
|
|
1113
|
-
itemCtx = rootCtx.createNew(null, _nextPlugin[strGetPlugin]);
|
|
1114
|
-
}
|
|
1115
|
-
else {
|
|
1116
|
-
itemCtx = rootCtx.createNew(null, _nextPlugin);
|
|
1117
|
-
}
|
|
1118
|
-
}
|
|
1119
|
-
return itemCtx;
|
|
1120
|
-
};
|
|
1121
|
-
_self._baseTelInit = function (config, core, extensions, pluginChain) {
|
|
1122
|
-
if (config) {
|
|
1123
|
-
setValue(config, strExtensionConfig, [], null, isNullOrUndefined);
|
|
1124
|
-
}
|
|
1125
|
-
if (!pluginChain && core) {
|
|
1126
|
-
pluginChain = core.getProcessTelContext().getNext();
|
|
1127
|
-
}
|
|
1128
|
-
var nextPlugin = _nextPlugin;
|
|
1129
|
-
if (_nextPlugin && _nextPlugin[strGetPlugin]) {
|
|
1130
|
-
nextPlugin = _nextPlugin[strGetPlugin]();
|
|
1131
|
-
}
|
|
1132
|
-
_self.core = core;
|
|
1133
|
-
_rootCtx = new ProcessTelemetryContext(pluginChain, config, core, nextPlugin);
|
|
1134
|
-
_isinitialized = true;
|
|
1135
|
-
};
|
|
1136
|
-
}
|
|
1137
|
-
BaseTelemetryPlugin.prototype.initialize = function (config, core, extensions, pluginChain) {
|
|
1138
|
-
this._baseTelInit(config, core, extensions, pluginChain);
|
|
1139
|
-
};
|
|
1140
|
-
return BaseTelemetryPlugin;
|
|
1141
|
-
}());
|
|
1142
|
-
|
|
1143
|
-
var strNotSpecified = "not_specified";
|
|
1144
|
-
|
|
1145
|
-
var PropertiesPluginIdentifier = "AppInsightsPropertiesPlugin";
|
|
1146
|
-
|
|
1147
|
-
var Prototype = "prototype";
|
|
1148
|
-
var DEFAULT_DONOT_TRACK_TAG = "ai-dnt";
|
|
1149
|
-
var DEFAULT_AI_BLOB_ATTRIBUTE_TAG = "ai-blob";
|
|
1150
|
-
var DEFAULT_DATA_PREFIX = "data-";
|
|
1151
|
-
var _ExtendedInternalMessageId = __assignFn(__assignFn({}, _InternalMessageId), { CannotParseAiBlobValue: 101, InvalidContentBlob: 102, TrackPageActionEventFailed: 103 });
|
|
1152
|
-
function removeNonObjectsAndInvalidElements(overrideConfig, attributeNamesExpectedObjects) {
|
|
1153
|
-
removeInvalidElements(overrideConfig);
|
|
1154
|
-
for (var i in attributeNamesExpectedObjects) {
|
|
1155
|
-
if (attributeNamesExpectedObjects.hasOwnProperty(i)) {
|
|
1156
|
-
var objectName = attributeNamesExpectedObjects[i];
|
|
1157
|
-
if (typeof overrideConfig[objectName] === "object") {
|
|
1158
|
-
removeInvalidElements(overrideConfig[objectName]);
|
|
1159
|
-
}
|
|
1160
|
-
else {
|
|
1161
|
-
delete overrideConfig[objectName];
|
|
1162
|
-
}
|
|
1163
|
-
}
|
|
1164
|
-
}
|
|
1165
|
-
}
|
|
1166
|
-
function removeInvalidElements(object) {
|
|
1167
|
-
for (var property in object) {
|
|
1168
|
-
if (!isValueAssigned(object[property]) ||
|
|
1169
|
-
(JSON.stringify(object[property]) === "{}" && (property !== "callback"))) {
|
|
1170
|
-
delete object[property];
|
|
1171
|
-
}
|
|
1172
|
-
}
|
|
1173
|
-
}
|
|
1174
|
-
function isValueAssigned(value) {
|
|
1175
|
-
return !(isNullOrUndefined(value) || value === "");
|
|
1176
|
-
}
|
|
1177
|
-
function isRightClick(evt) {
|
|
1178
|
-
try {
|
|
1179
|
-
if ("which" in evt) {
|
|
1180
|
-
return (evt.which === 3);
|
|
1181
|
-
}
|
|
1182
|
-
else if ("button" in evt) {
|
|
1183
|
-
return (evt.button === 2);
|
|
1184
|
-
}
|
|
1185
|
-
}
|
|
1186
|
-
catch (e) {
|
|
1187
|
-
}
|
|
1188
|
-
}
|
|
1189
|
-
function isLeftClick(evt) {
|
|
1190
|
-
try {
|
|
1191
|
-
if ("which" in evt) {
|
|
1192
|
-
return (evt.which === 1);
|
|
1193
|
-
}
|
|
1194
|
-
else if ("button" in evt) {
|
|
1195
|
-
return (evt.button === 1);
|
|
1196
|
-
}
|
|
1197
|
-
}
|
|
1198
|
-
catch (e) {
|
|
1199
|
-
}
|
|
1200
|
-
}
|
|
1201
|
-
function isMiddleClick(evt) {
|
|
1202
|
-
try {
|
|
1203
|
-
if ("which" in evt) {
|
|
1204
|
-
return (evt.which === 2);
|
|
1205
|
-
}
|
|
1206
|
-
else if ("button" in evt) {
|
|
1207
|
-
return (evt.button === 4);
|
|
1208
|
-
}
|
|
1209
|
-
}
|
|
1210
|
-
catch (e) {
|
|
1211
|
-
}
|
|
1212
|
-
}
|
|
1213
|
-
function isKeyboardEnter(evt) {
|
|
1214
|
-
try {
|
|
1215
|
-
if ("keyCode" in evt) {
|
|
1216
|
-
return (evt.keyCode === 13);
|
|
1217
|
-
}
|
|
1218
|
-
}
|
|
1219
|
-
catch (e) {
|
|
1220
|
-
}
|
|
1221
|
-
}
|
|
1222
|
-
function isKeyboardSpace(evt) {
|
|
1223
|
-
try {
|
|
1224
|
-
if ("keyCode" in evt) {
|
|
1225
|
-
return (evt.keyCode === 32);
|
|
1226
|
-
}
|
|
1227
|
-
}
|
|
1228
|
-
catch (e) {
|
|
1229
|
-
}
|
|
1230
|
-
}
|
|
1231
|
-
function isElementDnt(element, doNotTrackFieldName) {
|
|
1232
|
-
var dntElement = findClosestByAttribute(element, doNotTrackFieldName);
|
|
1233
|
-
if (!isValueAssigned(dntElement)) {
|
|
1234
|
-
return false;
|
|
1235
|
-
}
|
|
1236
|
-
return true;
|
|
1237
|
-
}
|
|
1238
|
-
function findClosestByAttribute(el, attribute) {
|
|
1239
|
-
return walkUpDomChainWithElementValidation(el, isAttributeInElement, attribute);
|
|
1240
|
-
}
|
|
1241
|
-
function isAttributeInElement(element, attributeToLookFor) {
|
|
1242
|
-
var value = element.getAttribute(attributeToLookFor);
|
|
1243
|
-
return isValueAssigned(value);
|
|
1244
|
-
}
|
|
1245
|
-
function walkUpDomChainWithElementValidation(el, validationMethod, validationMethodParam) {
|
|
1246
|
-
var element = el;
|
|
1247
|
-
if (element) {
|
|
1248
|
-
while (!validationMethod(element, validationMethodParam)) {
|
|
1249
|
-
element = element.parentNode;
|
|
1250
|
-
if (!element || !(element.getAttribute)) {
|
|
1251
|
-
return null;
|
|
1252
|
-
}
|
|
1253
|
-
}
|
|
1254
|
-
return element;
|
|
1255
|
-
}
|
|
1256
|
-
}
|
|
1257
|
-
function isElementAnAnchor(element) {
|
|
1258
|
-
return element.nodeName === "A";
|
|
1259
|
-
}
|
|
1260
|
-
function findClosestAnchor(element) {
|
|
1261
|
-
return walkUpDomChainWithElementValidation(element, isElementAnAnchor);
|
|
1262
|
-
}
|
|
1263
|
-
function extractFieldFromObject(obj, fieldName) {
|
|
1264
|
-
var fieldValue;
|
|
1265
|
-
if (obj && obj[fieldName]) {
|
|
1266
|
-
fieldValue = obj[fieldName];
|
|
1267
|
-
delete obj[fieldName];
|
|
1268
|
-
}
|
|
1269
|
-
return fieldValue;
|
|
1270
|
-
}
|
|
1271
|
-
function bracketIt(str) {
|
|
1272
|
-
return "[" + str + "]";
|
|
1273
|
-
}
|
|
1274
|
-
function extend(obj, obj2, obj3, obj4, obj5) {
|
|
1275
|
-
var extended = {};
|
|
1276
|
-
var deep = false;
|
|
1277
|
-
var i = 0;
|
|
1278
|
-
var length = arguments.length;
|
|
1279
|
-
var objProto = Object[Prototype];
|
|
1280
|
-
var theArgs = arguments;
|
|
1281
|
-
if (objProto.toString.call(theArgs[0]) === "[object Boolean]") {
|
|
1282
|
-
deep = theArgs[0];
|
|
1283
|
-
i++;
|
|
1284
|
-
}
|
|
1285
|
-
var merge = function (obj) {
|
|
1286
|
-
for (var prop in obj) {
|
|
1287
|
-
if (hasOwnProperty(obj, prop)) {
|
|
1288
|
-
if (deep && objProto.toString.call(obj[prop]) === "[object Object]") {
|
|
1289
|
-
extended[prop] = extend(true, extended[prop], obj[prop]);
|
|
1290
|
-
}
|
|
1291
|
-
else {
|
|
1292
|
-
extended[prop] = obj[prop];
|
|
1293
|
-
}
|
|
1294
|
-
}
|
|
1295
|
-
}
|
|
1296
|
-
};
|
|
1297
|
-
for (; i < length; i++) {
|
|
1298
|
-
var obj = theArgs[i];
|
|
1299
|
-
merge(obj);
|
|
1300
|
-
}
|
|
1301
|
-
return extended;
|
|
1302
|
-
}
|
|
1303
|
-
function validateContentNamePrefix(config, defaultDataPrefix) {
|
|
1304
|
-
return isValueAssigned(config.dataTags.customDataPrefix) && (config.dataTags.customDataPrefix.indexOf(defaultDataPrefix) === 0);
|
|
1305
|
-
}
|
|
1306
|
-
function mergeConfig(overrideConfig) {
|
|
1307
|
-
var defaultConfig = {
|
|
1308
|
-
autoCapture: true,
|
|
1309
|
-
callback: {
|
|
1310
|
-
pageActionPageTags: null
|
|
1311
|
-
},
|
|
1312
|
-
pageTags: {},
|
|
1313
|
-
coreData: {
|
|
1314
|
-
referrerUri: hasDocument ? document.referrer : "",
|
|
1315
|
-
requestUri: "",
|
|
1316
|
-
pageName: "",
|
|
1317
|
-
pageType: ""
|
|
1318
|
-
},
|
|
1319
|
-
dataTags: {
|
|
1320
|
-
useDefaultContentNameOrId: false,
|
|
1321
|
-
aiBlobAttributeTag: DEFAULT_AI_BLOB_ATTRIBUTE_TAG,
|
|
1322
|
-
customDataPrefix: DEFAULT_DATA_PREFIX,
|
|
1323
|
-
captureAllMetaDataContent: false,
|
|
1324
|
-
dntDataTag: DEFAULT_DONOT_TRACK_TAG
|
|
1325
|
-
},
|
|
1326
|
-
behaviorValidator: function (key) { return key || ""; },
|
|
1327
|
-
defaultRightClickBhvr: "",
|
|
1328
|
-
dropInvalidEvents: false
|
|
1329
|
-
};
|
|
1330
|
-
var attributesThatAreObjectsInConfig = [];
|
|
1331
|
-
for (var attribute in defaultConfig) {
|
|
1332
|
-
if (typeof defaultConfig[attribute] === "object") {
|
|
1333
|
-
attributesThatAreObjectsInConfig.push(attribute);
|
|
1334
|
-
}
|
|
1335
|
-
}
|
|
1336
|
-
if (overrideConfig) {
|
|
1337
|
-
removeNonObjectsAndInvalidElements(overrideConfig, attributesThatAreObjectsInConfig);
|
|
1338
|
-
if (isValueAssigned(overrideConfig.dataTags)) {
|
|
1339
|
-
overrideConfig.dataTags.customDataPrefix = validateContentNamePrefix(overrideConfig, DEFAULT_DATA_PREFIX) ? overrideConfig.dataTags.customDataPrefix : DEFAULT_DATA_PREFIX;
|
|
1340
|
-
}
|
|
1341
|
-
return extend(true, defaultConfig, overrideConfig);
|
|
1342
|
-
}
|
|
1343
|
-
}
|
|
1344
|
-
function BehaviorMapValidator(map) {
|
|
1345
|
-
return function (key) { return map[key] || ""; };
|
|
1346
|
-
}
|
|
1347
|
-
function BehaviorValueValidator(behaviorArray) {
|
|
1348
|
-
return function (key) {
|
|
1349
|
-
var result;
|
|
1350
|
-
arrForEach(behaviorArray, function (value) {
|
|
1351
|
-
if (value === key) {
|
|
1352
|
-
result = value;
|
|
1353
|
-
return -1;
|
|
1354
|
-
}
|
|
1355
|
-
});
|
|
1356
|
-
return result || "";
|
|
1357
|
-
};
|
|
1358
|
-
}
|
|
1359
|
-
function BehaviorEnumValidator(enumObj) {
|
|
1360
|
-
return function (key) { return enumObj[key] || ""; };
|
|
1361
|
-
}
|
|
1362
|
-
|
|
1363
|
-
var clickCaptureInputTypes$1 = { BUTTON: true, CHECKBOX: true, RADIO: true, RESET: true, SUBMIT: true };
|
|
1364
|
-
function getImageHref(element) {
|
|
1365
|
-
var temp = element;
|
|
1366
|
-
if (temp) {
|
|
1367
|
-
var parent = findClosestAnchor(temp);
|
|
1368
|
-
if (parent.length === 1) {
|
|
1369
|
-
var firstParent = parent[0];
|
|
1370
|
-
if (firstParent.href) {
|
|
1371
|
-
return firstParent.href;
|
|
1372
|
-
}
|
|
1373
|
-
else if (firstParent.src) {
|
|
1374
|
-
return (firstParent.src);
|
|
1375
|
-
}
|
|
1376
|
-
}
|
|
1377
|
-
}
|
|
1378
|
-
return "";
|
|
1379
|
-
}
|
|
1380
|
-
function getClickTarget(element) {
|
|
1381
|
-
var clickTarget = "";
|
|
1382
|
-
switch (element.tagName) {
|
|
1383
|
-
case "A":
|
|
1384
|
-
case "AREA":
|
|
1385
|
-
clickTarget = element.href || "";
|
|
1386
|
-
break;
|
|
1387
|
-
case "IMG":
|
|
1388
|
-
clickTarget = getImageHref(element);
|
|
1389
|
-
break;
|
|
1390
|
-
case "INPUT":
|
|
1391
|
-
var type = element.type;
|
|
1392
|
-
if (type && (clickCaptureInputTypes$1[type.toUpperCase()])) {
|
|
1393
|
-
var loc = getLocation() || {};
|
|
1394
|
-
if (element.form) {
|
|
1395
|
-
clickTarget = element.form.action || (loc.pathname || "");
|
|
1396
|
-
}
|
|
1397
|
-
else {
|
|
1398
|
-
clickTarget = loc.pathname || "";
|
|
1399
|
-
}
|
|
1400
|
-
}
|
|
1401
|
-
break;
|
|
1402
|
-
}
|
|
1403
|
-
return clickTarget;
|
|
1404
|
-
}
|
|
1405
|
-
function getPageName(config, overrideValues) {
|
|
1406
|
-
if (overrideValues && overrideValues.pageName) {
|
|
1407
|
-
return overrideValues.pageName;
|
|
1408
|
-
}
|
|
1409
|
-
else if (config.callback && isFunction(config.callback.pageName)) {
|
|
1410
|
-
return config.callback.pageName();
|
|
1411
|
-
}
|
|
1412
|
-
else if (config.coreData && config.coreData.pageName) {
|
|
1413
|
-
return config.coreData.pageName;
|
|
1414
|
-
}
|
|
1415
|
-
else {
|
|
1416
|
-
var doc = getDocument();
|
|
1417
|
-
return doc && doc.title || "";
|
|
1418
|
-
}
|
|
1419
|
-
}
|
|
1420
|
-
function sanitizeUrl(config, location) {
|
|
1421
|
-
if (!location) {
|
|
1422
|
-
return null;
|
|
1423
|
-
}
|
|
1424
|
-
var url = location.protocol + "//" + (location.hostname || location.host) +
|
|
1425
|
-
(isValueAssigned(location.port) ? ":" + location.port : "") +
|
|
1426
|
-
location.pathname;
|
|
1427
|
-
return url;
|
|
1428
|
-
}
|
|
1429
|
-
function getUri(config, location) {
|
|
1430
|
-
if (config.coreData && config.coreData.requestUri && config.coreData.requestUri !== "") {
|
|
1431
|
-
return config.coreData.requestUri;
|
|
1432
|
-
}
|
|
1433
|
-
return sanitizeUrl(config, location);
|
|
1434
|
-
}
|
|
1435
|
-
|
|
1436
|
-
var WebEvent = /** @class */ (function () {
|
|
1437
|
-
function WebEvent(_clickAnalyticsPlugin, _config, _contentHandler, _pageTagsCallback, _metaTags, _traceLogger) {
|
|
1438
|
-
this._clickAnalyticsPlugin = _clickAnalyticsPlugin;
|
|
1439
|
-
this._config = _config;
|
|
1440
|
-
this._contentHandler = _contentHandler;
|
|
1441
|
-
this._pageTagsCallback = _pageTagsCallback;
|
|
1442
|
-
this._metaTags = _metaTags;
|
|
1443
|
-
this._traceLogger = _traceLogger;
|
|
1444
|
-
this._pageTags = {};
|
|
1445
|
-
}
|
|
1446
|
-
WebEvent.prototype.setBasicProperties = function (event, overrideValues) {
|
|
1447
|
-
if (!isValueAssigned(event.name)) {
|
|
1448
|
-
event.pageName = getPageName(this._config, overrideValues);
|
|
1449
|
-
}
|
|
1450
|
-
if (!isValueAssigned(event.uri) && hasWindow) {
|
|
1451
|
-
event.uri = getUri(this._config, getLocation());
|
|
1452
|
-
}
|
|
1453
|
-
};
|
|
1454
|
-
WebEvent.prototype.setCommonProperties = function (event, overrideValues) {
|
|
1455
|
-
this.setBasicProperties(event, overrideValues);
|
|
1456
|
-
this._setPageTags(event, overrideValues);
|
|
1457
|
-
this._pageTypeMetaTag = this._getMetaData(this._metaTags, this._config.coreData, "pageType");
|
|
1458
|
-
this._behaviorMetaTag = this._getMetaData(this._metaTags, this._config.coreData, "behavior");
|
|
1459
|
-
if (isValueAssigned(overrideValues.pageType)) {
|
|
1460
|
-
event.pageType = overrideValues.pageType;
|
|
1461
|
-
}
|
|
1462
|
-
if (isValueAssigned(this._pageTypeMetaTag) && !isValueAssigned(event.pageType)) {
|
|
1463
|
-
event.pageType = this._pageTypeMetaTag;
|
|
1464
|
-
}
|
|
1465
|
-
};
|
|
1466
|
-
WebEvent.prototype._setPageTags = function (event, overrideValues) {
|
|
1467
|
-
if (this._pageTagsCallback) {
|
|
1468
|
-
this._pageTags = extend(true, this._pageTags, this._pageTagsCallback());
|
|
1469
|
-
}
|
|
1470
|
-
if (isValueAssigned(overrideValues.pageTags)) {
|
|
1471
|
-
this._pageTags = extend(true, this._pageTags, overrideValues.pageTags);
|
|
1472
|
-
}
|
|
1473
|
-
if (this._metaTags) {
|
|
1474
|
-
this._pageTags.metaTags = {};
|
|
1475
|
-
for (var metaTag in this._metaTags) {
|
|
1476
|
-
if (metaTag != "behavior" && metaTag != "market" && metaTag != "pageType") {
|
|
1477
|
-
this._pageTags.metaTags[metaTag] = this._metaTags[metaTag];
|
|
1478
|
-
}
|
|
1479
|
-
}
|
|
1480
|
-
}
|
|
1481
|
-
event.properties = event.properties || {};
|
|
1482
|
-
event.properties["pageTags"] = this._pageTags;
|
|
1483
|
-
};
|
|
1484
|
-
WebEvent.prototype._getBehavior = function (overrideValues) {
|
|
1485
|
-
var behavior;
|
|
1486
|
-
if (overrideValues && isValueAssigned(overrideValues.behavior)) {
|
|
1487
|
-
behavior = overrideValues.behavior;
|
|
1488
|
-
}
|
|
1489
|
-
else if (isValueAssigned(this._behaviorMetaTag)) {
|
|
1490
|
-
behavior = this._behaviorMetaTag;
|
|
1491
|
-
}
|
|
1492
|
-
return this._getValidBehavior(behavior);
|
|
1493
|
-
};
|
|
1494
|
-
WebEvent.prototype._getValidBehavior = function (behavior) {
|
|
1495
|
-
return this._config.behaviorValidator(behavior);
|
|
1496
|
-
};
|
|
1497
|
-
WebEvent.prototype._getMetaData = function (metaTags, coreData, metaTagName) {
|
|
1498
|
-
if (coreData && coreData[metaTagName]) {
|
|
1499
|
-
return coreData[metaTagName];
|
|
1500
|
-
}
|
|
1501
|
-
else if (metaTags) {
|
|
1502
|
-
return metaTags[metaTagName];
|
|
1503
|
-
}
|
|
1504
|
-
return "";
|
|
1505
|
-
};
|
|
1506
|
-
return WebEvent;
|
|
1507
|
-
}());
|
|
1508
|
-
|
|
1509
|
-
var PageAction = /** @class */ (function (_super) {
|
|
1510
|
-
__extendsFn(PageAction, _super);
|
|
1511
|
-
function PageAction() {
|
|
1512
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
1513
|
-
}
|
|
1514
|
-
PageAction.prototype.trackPageAction = function (pageActionEvent, properties) {
|
|
1515
|
-
var _this = this;
|
|
1516
|
-
var ext = {};
|
|
1517
|
-
ext["web"] = {};
|
|
1518
|
-
var event = {
|
|
1519
|
-
name: "Microsoft.ApplicationInsights.{0}.Event",
|
|
1520
|
-
baseType: "EventData",
|
|
1521
|
-
ext: ext,
|
|
1522
|
-
data: {},
|
|
1523
|
-
baseData: {}
|
|
1524
|
-
};
|
|
1525
|
-
this._populateEventDataIfPresent(event.baseData, "name", pageActionEvent.name);
|
|
1526
|
-
this._populateEventDataIfPresent(event.data, "baseTypeSource", "ClickEvent");
|
|
1527
|
-
this._populateEventDataIfPresent(event.data, "uri", pageActionEvent.uri);
|
|
1528
|
-
this._populateEventDataIfPresent(event.data, "pageType", pageActionEvent.pageType);
|
|
1529
|
-
this._populateEventDataIfPresent(event.data, "properties", pageActionEvent.properties);
|
|
1530
|
-
this._populateEventDataIfPresent(event.data, "actionType", pageActionEvent.actionType);
|
|
1531
|
-
this._populateEventDataIfPresent(event.data, "behavior", pageActionEvent.behavior);
|
|
1532
|
-
this._populateEventDataIfPresent(event.data, "clickCoordinates", pageActionEvent.clickCoordinates);
|
|
1533
|
-
this._populateEventDataIfPresent(event.data, "content", pageActionEvent.content);
|
|
1534
|
-
this._populateEventDataIfPresent(event.data, "targetUri", pageActionEvent.targetUri);
|
|
1535
|
-
this._populateEventDataIfPresent(event.data, "timeToAction", pageActionEvent.timeToAction);
|
|
1536
|
-
this._populateEventDataIfPresent(event.data, "refUri", pageActionEvent.refUri);
|
|
1537
|
-
this._populateEventDataIfPresent(event.data, "pageName", pageActionEvent.pageName);
|
|
1538
|
-
this._populateEventDataIfPresent(event.data, "parentId", pageActionEvent.parentId);
|
|
1539
|
-
if (properties) {
|
|
1540
|
-
objForEachKey(properties, function (property, value) {
|
|
1541
|
-
if (!event.data[property]) {
|
|
1542
|
-
_this._populateEventDataIfPresent(event.data, property, value);
|
|
1543
|
-
}
|
|
1544
|
-
});
|
|
1545
|
-
}
|
|
1546
|
-
this._clickAnalyticsPlugin.core.track(event);
|
|
1547
|
-
};
|
|
1548
|
-
PageAction.prototype.capturePageAction = function (element, overrideValues, customProperties, isRightClick) {
|
|
1549
|
-
overrideValues = !isValueAssigned(overrideValues) ? {} : overrideValues;
|
|
1550
|
-
var pageActionEvent = { name: "" };
|
|
1551
|
-
var pageActionProperties = isValueAssigned(customProperties) ? customProperties : {};
|
|
1552
|
-
this.setCommonProperties(pageActionEvent, overrideValues);
|
|
1553
|
-
pageActionEvent.behavior = this._getBehavior(overrideValues);
|
|
1554
|
-
var elementContent = {};
|
|
1555
|
-
if (isRightClick) {
|
|
1556
|
-
pageActionEvent.behavior = this._config.defaultRightClickBhvr;
|
|
1557
|
-
}
|
|
1558
|
-
if (element) {
|
|
1559
|
-
pageActionEvent.targetUri = getClickTarget(element);
|
|
1560
|
-
elementContent = this._contentHandler.getElementContent(element);
|
|
1561
|
-
if (elementContent.bhvr && !isValueAssigned(overrideValues.behavior)) {
|
|
1562
|
-
var currentBehavior = extractFieldFromObject(elementContent, "bhvr");
|
|
1563
|
-
pageActionEvent.behavior = this._getValidBehavior(currentBehavior);
|
|
1564
|
-
}
|
|
1565
|
-
if (!isValueAssigned(elementContent.id) && !isValueAssigned(elementContent.contentName)) {
|
|
1566
|
-
this._traceLogger.throwInternal(LoggingSeverity.WARNING, _ExtendedInternalMessageId.InvalidContentBlob, "Missing attributes id or contentName in click event. Click event information will still be collected!");
|
|
1567
|
-
}
|
|
1568
|
-
}
|
|
1569
|
-
pageActionEvent.name = elementContent.id || elementContent.contentName || strNotSpecified;
|
|
1570
|
-
pageActionEvent.parentId = elementContent.parentid || elementContent.parentName || strNotSpecified;
|
|
1571
|
-
if (isValueAssigned(overrideValues.actionType)) {
|
|
1572
|
-
pageActionEvent.actionType = overrideValues.actionType;
|
|
1573
|
-
}
|
|
1574
|
-
if (isValueAssigned(overrideValues.clickCoordinateX) && isValueAssigned(overrideValues.clickCoordinateY)) {
|
|
1575
|
-
pageActionEvent.clickCoordinates = overrideValues.clickCoordinateX + "X" + overrideValues.clickCoordinateY;
|
|
1576
|
-
}
|
|
1577
|
-
this._sanitizePageActionEventContent(elementContent);
|
|
1578
|
-
pageActionEvent.content = bracketIt(JSON.stringify(extend(elementContent, overrideValues && overrideValues.contentTags ? overrideValues.contentTags : {})));
|
|
1579
|
-
pageActionEvent.timeToAction = this._getTimeToClick();
|
|
1580
|
-
pageActionEvent.refUri = isValueAssigned(overrideValues.refUri) ? overrideValues.refUri : this._config.coreData.referrerUri;
|
|
1581
|
-
if (this._isUndefinedEvent(pageActionEvent))
|
|
1582
|
-
return;
|
|
1583
|
-
this.trackPageAction(pageActionEvent, pageActionProperties);
|
|
1584
|
-
};
|
|
1585
|
-
PageAction.prototype._getTimeToClick = function () {
|
|
1586
|
-
var perf = getPerformance();
|
|
1587
|
-
if (perf && perf.timing) {
|
|
1588
|
-
var isNavigationStart = perf.timing.navigationStart;
|
|
1589
|
-
if (isNavigationStart && isNavigationStart !== 0) {
|
|
1590
|
-
return new Date().getTime() - isNavigationStart;
|
|
1591
|
-
}
|
|
1592
|
-
}
|
|
1593
|
-
return -1;
|
|
1594
|
-
};
|
|
1595
|
-
PageAction.prototype._populateEventDataIfPresent = function (obj, property, value) {
|
|
1596
|
-
if (isValueAssigned(value)) {
|
|
1597
|
-
obj[property] = value;
|
|
1598
|
-
}
|
|
1599
|
-
};
|
|
1600
|
-
PageAction.prototype._sanitizePageActionEventContent = function (pageActionContent) {
|
|
1601
|
-
if (pageActionContent) {
|
|
1602
|
-
delete pageActionContent.id;
|
|
1603
|
-
delete pageActionContent.parentid;
|
|
1604
|
-
delete pageActionContent.parentname;
|
|
1605
|
-
if (this._config && this._config.dataTags && isValueAssigned(this._config.dataTags.parentDataTag)) {
|
|
1606
|
-
delete pageActionContent[this._config.dataTags.parentDataTag];
|
|
1607
|
-
}
|
|
1608
|
-
}
|
|
1609
|
-
};
|
|
1610
|
-
PageAction.prototype._isUndefinedEvent = function (pageActionEvent) {
|
|
1611
|
-
if (this._config.dropInvalidEvents) {
|
|
1612
|
-
if (pageActionEvent.name === strNotSpecified
|
|
1613
|
-
&& pageActionEvent.parentId === strNotSpecified
|
|
1614
|
-
&& pageActionEvent.content === "[{}]")
|
|
1615
|
-
return true;
|
|
1616
|
-
}
|
|
1617
|
-
return false;
|
|
1618
|
-
};
|
|
1619
|
-
return PageAction;
|
|
1620
|
-
}(WebEvent));
|
|
1621
|
-
|
|
1622
|
-
var ActionType = {
|
|
1623
|
-
CLICKLEFT: "CL",
|
|
1624
|
-
CLICKRIGHT: "CR",
|
|
1625
|
-
CLICKMIDDLE: "CM",
|
|
1626
|
-
SCROLL: "S",
|
|
1627
|
-
ZOOM: "Z",
|
|
1628
|
-
RESIZE: "R",
|
|
1629
|
-
KEYBOARDENTER: "KE",
|
|
1630
|
-
KEYBOARDSPACE: "KS",
|
|
1631
|
-
OTHER: "O"
|
|
1632
|
-
};
|
|
1633
|
-
|
|
1634
|
-
var clickCaptureInputTypes = { BUTTON: true, CHECKBOX: true, RADIO: true, RESET: true, SUBMIT: true };
|
|
1635
|
-
var AutoCaptureHandler = /** @class */ (function () {
|
|
1636
|
-
function AutoCaptureHandler(_analyticsPlugin, _config, _pageAction, _traceLogger) {
|
|
1637
|
-
this._analyticsPlugin = _analyticsPlugin;
|
|
1638
|
-
this._config = _config;
|
|
1639
|
-
this._pageAction = _pageAction;
|
|
1640
|
-
this._traceLogger = _traceLogger;
|
|
1641
|
-
}
|
|
1642
|
-
AutoCaptureHandler.prototype.click = function () {
|
|
1643
|
-
var _this = this;
|
|
1644
|
-
var win = getWindow();
|
|
1645
|
-
var doc = getDocument();
|
|
1646
|
-
if (win) {
|
|
1647
|
-
var event_1 = (navigator.appVersion.indexOf("MSIE") !== -1) ? "click" : "mousedown";
|
|
1648
|
-
attachEvent(win, event_1, function (evt) { _this._processClick(evt); });
|
|
1649
|
-
attachEvent(win, "keyup", function (evt) { _this._processClick(evt); });
|
|
1650
|
-
}
|
|
1651
|
-
else if (doc) {
|
|
1652
|
-
attachEvent(doc, "click", function (evt) { _this._processClick(evt); });
|
|
1653
|
-
attachEvent(doc, "keyup", function (evt) { _this._processClick(evt); });
|
|
1654
|
-
}
|
|
1655
|
-
};
|
|
1656
|
-
AutoCaptureHandler.prototype.capturePageAction = function (element, overrideValues, customProperties, isRightClick) {
|
|
1657
|
-
var donotTrackTag = this._config.dataTags.customDataPrefix + this._config.dataTags.dntDataTag;
|
|
1658
|
-
if (!isElementDnt(element, donotTrackTag)) {
|
|
1659
|
-
this._pageAction.capturePageAction(element, overrideValues, customProperties, isRightClick);
|
|
1660
|
-
}
|
|
1661
|
-
};
|
|
1662
|
-
AutoCaptureHandler.prototype._processClick = function (clickEvent) {
|
|
1663
|
-
var clickCaptureElements = { A: true, BUTTON: true, AREA: true, INPUT: true };
|
|
1664
|
-
var win = getWindow();
|
|
1665
|
-
if (isNullOrUndefined(clickEvent) && win) {
|
|
1666
|
-
clickEvent = win.event;
|
|
1667
|
-
}
|
|
1668
|
-
if (clickEvent) {
|
|
1669
|
-
var element = clickEvent.srcElement || clickEvent.target;
|
|
1670
|
-
var overrideValues = {
|
|
1671
|
-
clickCoordinateX: clickEvent.pageX,
|
|
1672
|
-
clickCoordinateY: clickEvent.pageY
|
|
1673
|
-
};
|
|
1674
|
-
var isRightClickObj = isRightClick(clickEvent);
|
|
1675
|
-
if (isRightClickObj) {
|
|
1676
|
-
overrideValues.actionType = ActionType.CLICKRIGHT;
|
|
1677
|
-
}
|
|
1678
|
-
else if (isLeftClick(clickEvent)) {
|
|
1679
|
-
overrideValues.actionType = ActionType.CLICKLEFT;
|
|
1680
|
-
}
|
|
1681
|
-
else if (isKeyboardEnter(clickEvent)) {
|
|
1682
|
-
overrideValues.actionType = ActionType.KEYBOARDENTER;
|
|
1683
|
-
}
|
|
1684
|
-
else if (isKeyboardSpace(clickEvent)) {
|
|
1685
|
-
overrideValues.actionType = ActionType.KEYBOARDSPACE;
|
|
1686
|
-
}
|
|
1687
|
-
else if (isMiddleClick(clickEvent)) {
|
|
1688
|
-
overrideValues.actionType = ActionType.CLICKMIDDLE;
|
|
1689
|
-
}
|
|
1690
|
-
else {
|
|
1691
|
-
return;
|
|
1692
|
-
}
|
|
1693
|
-
while (element && element.tagName) {
|
|
1694
|
-
if (element.control && clickCaptureElements[element.control.tagName.toUpperCase()]) {
|
|
1695
|
-
element = element.control;
|
|
1696
|
-
}
|
|
1697
|
-
var tagNameUpperCased = element.tagName.toUpperCase();
|
|
1698
|
-
if (!clickCaptureElements[tagNameUpperCased]) {
|
|
1699
|
-
element = element.parentElement || element.parentNode;
|
|
1700
|
-
continue;
|
|
1701
|
-
}
|
|
1702
|
-
else {
|
|
1703
|
-
var sendEvent = tagNameUpperCased === "INPUT" ? clickCaptureInputTypes[element.type.toUpperCase()] : true;
|
|
1704
|
-
if (sendEvent) {
|
|
1705
|
-
this.capturePageAction(element, overrideValues, {}, isRightClickObj);
|
|
1706
|
-
}
|
|
1707
|
-
break;
|
|
1708
|
-
}
|
|
1709
|
-
}
|
|
1710
|
-
}
|
|
1711
|
-
};
|
|
1712
|
-
return AutoCaptureHandler;
|
|
1713
|
-
}());
|
|
1714
|
-
|
|
1715
|
-
var MAX_CONTENTNAME_LENGTH = 200;
|
|
1716
|
-
var DomContentHandler = /** @class */ (function () {
|
|
1717
|
-
function DomContentHandler(_config, _traceLogger) {
|
|
1718
|
-
this._config = _config;
|
|
1719
|
-
this._traceLogger = _traceLogger;
|
|
1720
|
-
}
|
|
1721
|
-
DomContentHandler.prototype.getMetadata = function () {
|
|
1722
|
-
var metaTags = {};
|
|
1723
|
-
if (hasDocument) {
|
|
1724
|
-
metaTags = isValueAssigned(this._config.dataTags.metaDataPrefix) ? this._getMetaDataFromDOM(this._config.dataTags.captureAllMetaDataContent, this._config.dataTags.metaDataPrefix, false) :
|
|
1725
|
-
this._getMetaDataFromDOM(this._config.dataTags.captureAllMetaDataContent, "", false);
|
|
1726
|
-
}
|
|
1727
|
-
return metaTags;
|
|
1728
|
-
};
|
|
1729
|
-
DomContentHandler.prototype.getElementContent = function (element) {
|
|
1730
|
-
if (!element) {
|
|
1731
|
-
return {};
|
|
1732
|
-
}
|
|
1733
|
-
var elementContent = {};
|
|
1734
|
-
var biBlobValue;
|
|
1735
|
-
var parentDataTagPrefix;
|
|
1736
|
-
var dataTagPrefix = this._config.dataTags.customDataPrefix;
|
|
1737
|
-
var aiBlobAttributeTag = dataTagPrefix + this._config.dataTags.aiBlobAttributeTag;
|
|
1738
|
-
if (isValueAssigned(this._config.dataTags.parentDataTag)) {
|
|
1739
|
-
parentDataTagPrefix = dataTagPrefix + this._config.dataTags.parentDataTag;
|
|
1740
|
-
}
|
|
1741
|
-
if (!this._isTracked(element, dataTagPrefix, aiBlobAttributeTag)) {
|
|
1742
|
-
biBlobValue = element.getAttribute(aiBlobAttributeTag);
|
|
1743
|
-
if (biBlobValue) {
|
|
1744
|
-
try {
|
|
1745
|
-
elementContent = JSON.parse(biBlobValue);
|
|
1746
|
-
}
|
|
1747
|
-
catch (e) {
|
|
1748
|
-
this._traceLogger.throwInternal(LoggingSeverity.CRITICAL, _ExtendedInternalMessageId.CannotParseAiBlobValue, "Can not parse " + biBlobValue);
|
|
1749
|
-
}
|
|
1750
|
-
}
|
|
1751
|
-
else {
|
|
1752
|
-
elementContent = extend(elementContent, this._populateElementContent(element, dataTagPrefix, parentDataTagPrefix, aiBlobAttributeTag));
|
|
1753
|
-
}
|
|
1754
|
-
}
|
|
1755
|
-
else {
|
|
1756
|
-
elementContent = extend(elementContent, this._populateElementContentwithDataTag(element, dataTagPrefix, parentDataTagPrefix, aiBlobAttributeTag));
|
|
1757
|
-
}
|
|
1758
|
-
removeInvalidElements(elementContent);
|
|
1759
|
-
if (parentDataTagPrefix) {
|
|
1760
|
-
elementContent = extend(elementContent, this._getParentDetails(element, elementContent, dataTagPrefix, aiBlobAttributeTag));
|
|
1761
|
-
}
|
|
1762
|
-
return elementContent;
|
|
1763
|
-
};
|
|
1764
|
-
DomContentHandler.prototype._captureElementContentWithDataTag = function (contentElement, elementContent, dataTagPrefix) {
|
|
1765
|
-
for (var i = 0, attrib; i < contentElement.attributes.length; i++) {
|
|
1766
|
-
attrib = contentElement.attributes[i];
|
|
1767
|
-
if (attrib.name.indexOf(dataTagPrefix) !== 0) {
|
|
1768
|
-
continue;
|
|
1769
|
-
}
|
|
1770
|
-
var attribName = attrib.name.replace(dataTagPrefix, "");
|
|
1771
|
-
elementContent[attribName] = attrib.value;
|
|
1772
|
-
}
|
|
1773
|
-
};
|
|
1774
|
-
DomContentHandler.prototype._walkUpDomChainCaptureData = function (el, elementContent, dataTagPrefix, parentDataTagPrefix, aiBlobAttributeTag) {
|
|
1775
|
-
var element = el;
|
|
1776
|
-
var parentDataTagFound = false;
|
|
1777
|
-
var elementLevelFlag = false;
|
|
1778
|
-
while (!isNullOrUndefined(element) && !isNullOrUndefined(element.attributes)) {
|
|
1779
|
-
var attributes = element.attributes;
|
|
1780
|
-
for (var i = 0; i < attributes.length; i++) {
|
|
1781
|
-
var attrib = attributes[i];
|
|
1782
|
-
if (attrib.name.indexOf(dataTagPrefix) !== 0) {
|
|
1783
|
-
continue;
|
|
1784
|
-
}
|
|
1785
|
-
if (attrib.name.indexOf(parentDataTagPrefix) === 0) {
|
|
1786
|
-
parentDataTagFound = true;
|
|
1787
|
-
}
|
|
1788
|
-
if (attrib.name.indexOf(aiBlobAttributeTag) === 0) {
|
|
1789
|
-
continue;
|
|
1790
|
-
}
|
|
1791
|
-
var attribName = attrib.name.replace(dataTagPrefix, "");
|
|
1792
|
-
if (elementLevelFlag && attribName === "id")
|
|
1793
|
-
continue;
|
|
1794
|
-
if (!isValueAssigned(elementContent[attribName])) {
|
|
1795
|
-
elementContent[attribName] = attrib.value;
|
|
1796
|
-
}
|
|
1797
|
-
}
|
|
1798
|
-
if (parentDataTagFound) {
|
|
1799
|
-
break;
|
|
1800
|
-
}
|
|
1801
|
-
elementLevelFlag = true;
|
|
1802
|
-
element = element.parentNode;
|
|
1803
|
-
}
|
|
1804
|
-
};
|
|
1805
|
-
DomContentHandler.prototype._populateElementContent = function (element, dataTagPrefix, parentDataTagPrefix, aiBlobAttributeTag) {
|
|
1806
|
-
var elementContent = {};
|
|
1807
|
-
if (!element)
|
|
1808
|
-
return elementContent;
|
|
1809
|
-
var htmlContent = this._getHtmlIdAndContentName(element);
|
|
1810
|
-
elementContent = {
|
|
1811
|
-
id: htmlContent.id || "",
|
|
1812
|
-
contentName: htmlContent.contentName || ""
|
|
1813
|
-
};
|
|
1814
|
-
if (isValueAssigned(parentDataTagPrefix)) {
|
|
1815
|
-
this._walkUpDomChainCaptureData(element, elementContent, dataTagPrefix, parentDataTagPrefix, aiBlobAttributeTag);
|
|
1816
|
-
}
|
|
1817
|
-
if (!elementContent.id && !elementContent.contentName) {
|
|
1818
|
-
this._traceLogger.throwInternal(LoggingSeverity.WARNING, _ExtendedInternalMessageId.InvalidContentBlob, "Invalid content blob. Missing required attributes (id, contentName. " +
|
|
1819
|
-
" Content information will still be collected!");
|
|
1820
|
-
}
|
|
1821
|
-
return elementContent;
|
|
1822
|
-
};
|
|
1823
|
-
DomContentHandler.prototype._populateElementContentwithDataTag = function (element, dataTagPrefix, parentDataTagPrefix, aiBlobAttributeTag) {
|
|
1824
|
-
var elementContent = {};
|
|
1825
|
-
if (!element)
|
|
1826
|
-
return elementContent;
|
|
1827
|
-
var htmlContent = this._getHtmlIdAndContentName(element);
|
|
1828
|
-
if (isValueAssigned(parentDataTagPrefix)) {
|
|
1829
|
-
this._walkUpDomChainCaptureData(element, elementContent, dataTagPrefix, parentDataTagPrefix, aiBlobAttributeTag);
|
|
1830
|
-
}
|
|
1831
|
-
else {
|
|
1832
|
-
this._captureElementContentWithDataTag(element, elementContent, dataTagPrefix);
|
|
1833
|
-
}
|
|
1834
|
-
if (this._config.dataTags.useDefaultContentNameOrId) {
|
|
1835
|
-
if (!isValueAssigned(elementContent.id)) {
|
|
1836
|
-
elementContent.id = htmlContent.id || "";
|
|
1837
|
-
}
|
|
1838
|
-
elementContent.contentName = htmlContent.contentName || "";
|
|
1839
|
-
}
|
|
1840
|
-
if (!elementContent.id && !elementContent.contentName) {
|
|
1841
|
-
this._traceLogger.throwInternal(LoggingSeverity.WARNING, _ExtendedInternalMessageId.InvalidContentBlob, "Invalid content blob. Missing required attributes (id, contentName. " +
|
|
1842
|
-
" Content information will still be collected!");
|
|
1843
|
-
}
|
|
1844
|
-
return elementContent;
|
|
1845
|
-
};
|
|
1846
|
-
DomContentHandler.prototype._getMetaDataFromDOM = function (captureAllMetaDataContent, prefix, removePrefix) {
|
|
1847
|
-
var metaElements;
|
|
1848
|
-
var metaData = {};
|
|
1849
|
-
if (hasDocument) {
|
|
1850
|
-
metaElements = document.querySelectorAll("meta");
|
|
1851
|
-
for (var i = 0; i < metaElements.length; i++) {
|
|
1852
|
-
var meta = metaElements[i];
|
|
1853
|
-
if (meta.name) {
|
|
1854
|
-
if (captureAllMetaDataContent || meta.name.indexOf(prefix) === 0) {
|
|
1855
|
-
var name_1 = removePrefix ? meta.name.replace(prefix, "") : meta.name;
|
|
1856
|
-
metaData[name_1] = meta.content;
|
|
1857
|
-
}
|
|
1858
|
-
}
|
|
1859
|
-
}
|
|
1860
|
-
}
|
|
1861
|
-
return metaData;
|
|
1862
|
-
};
|
|
1863
|
-
DomContentHandler.prototype._getDefaultContentName = function (element, useDefaultContentName) {
|
|
1864
|
-
if (useDefaultContentName === false || !element.tagName) {
|
|
1865
|
-
return "";
|
|
1866
|
-
}
|
|
1867
|
-
var doc = getDocument() || {};
|
|
1868
|
-
var contentName;
|
|
1869
|
-
switch (element.tagName) {
|
|
1870
|
-
case "A":
|
|
1871
|
-
contentName = doc.all ? element.innerText || element.innerHTML : element.text || element.innerHTML;
|
|
1872
|
-
break;
|
|
1873
|
-
case "IMG":
|
|
1874
|
-
case "AREA":
|
|
1875
|
-
contentName = element.alt;
|
|
1876
|
-
break;
|
|
1877
|
-
default:
|
|
1878
|
-
contentName = element.value || element.name || element.alt || element.innerText || element.id;
|
|
1879
|
-
}
|
|
1880
|
-
return contentName.substring(0, MAX_CONTENTNAME_LENGTH);
|
|
1881
|
-
};
|
|
1882
|
-
DomContentHandler.prototype._isTracked = function (element, dataTag, aiBlobAttributeTag) {
|
|
1883
|
-
var attrs = element.attributes;
|
|
1884
|
-
var dataTagFound = false;
|
|
1885
|
-
for (var i = 0; i < attrs.length; i++) {
|
|
1886
|
-
var attributeName = attrs[i].name;
|
|
1887
|
-
if (attributeName === aiBlobAttributeTag) {
|
|
1888
|
-
return false;
|
|
1889
|
-
}
|
|
1890
|
-
else if (attributeName.indexOf(dataTag) === 0) {
|
|
1891
|
-
dataTagFound = true;
|
|
1892
|
-
}
|
|
1893
|
-
}
|
|
1894
|
-
return dataTagFound;
|
|
1895
|
-
};
|
|
1896
|
-
DomContentHandler.prototype._getHtmlIdAndContentName = function (element) {
|
|
1897
|
-
var htmlContent = {};
|
|
1898
|
-
if (!element)
|
|
1899
|
-
return htmlContent;
|
|
1900
|
-
if (this._config.dataTags.useDefaultContentNameOrId) {
|
|
1901
|
-
var customizedContentName = this._config.callback.contentName ? this._config.callback.contentName(element, this._config.dataTags.useDefaultContentNameOrId) : "";
|
|
1902
|
-
var defaultContentName = this._getDefaultContentName(element, this._config.dataTags.useDefaultContentNameOrId);
|
|
1903
|
-
htmlContent = {
|
|
1904
|
-
id: element.id,
|
|
1905
|
-
contentName: customizedContentName || defaultContentName || element.getAttribute("alt")
|
|
1906
|
-
};
|
|
1907
|
-
}
|
|
1908
|
-
return htmlContent;
|
|
1909
|
-
};
|
|
1910
|
-
DomContentHandler.prototype._getParentDetails = function (element, elementContent, dataTagPrefix, aiBlobAttributeTag) {
|
|
1911
|
-
var parentId = elementContent["parentid"];
|
|
1912
|
-
var parentName = elementContent["parentname"];
|
|
1913
|
-
var parentInfo = {};
|
|
1914
|
-
if (parentId || parentName || !element) {
|
|
1915
|
-
return parentInfo;
|
|
1916
|
-
}
|
|
1917
|
-
return this._populateParentInfo(element, dataTagPrefix, aiBlobAttributeTag);
|
|
1918
|
-
};
|
|
1919
|
-
DomContentHandler.prototype._populateParentInfo = function (element, dataTagPrefix, aiBlobAttributeTag) {
|
|
1920
|
-
var parentInfo = {};
|
|
1921
|
-
var parentId;
|
|
1922
|
-
var closestParentElement = walkUpDomChainWithElementValidation(element.parentElement, this._isTracked, dataTagPrefix);
|
|
1923
|
-
if (closestParentElement) {
|
|
1924
|
-
var dataAttr = closestParentElement.getAttribute(aiBlobAttributeTag) || element[aiBlobAttributeTag];
|
|
1925
|
-
if (dataAttr) {
|
|
1926
|
-
try {
|
|
1927
|
-
var telemetryObject = JSON.parse(dataAttr);
|
|
1928
|
-
}
|
|
1929
|
-
catch (e) {
|
|
1930
|
-
this._traceLogger.throwInternal(LoggingSeverity.CRITICAL, _ExtendedInternalMessageId.CannotParseAiBlobValue, "Can not parse " + dataAttr);
|
|
1931
|
-
}
|
|
1932
|
-
if (telemetryObject) {
|
|
1933
|
-
parentId = telemetryObject.id;
|
|
1934
|
-
}
|
|
1935
|
-
}
|
|
1936
|
-
else {
|
|
1937
|
-
parentId = closestParentElement.getAttribute(dataTagPrefix + "id");
|
|
1938
|
-
}
|
|
1939
|
-
}
|
|
1940
|
-
if (parentId) {
|
|
1941
|
-
parentInfo["parentid"] = parentId;
|
|
1942
|
-
}
|
|
1943
|
-
else {
|
|
1944
|
-
var htmlContent = this._getHtmlIdAndContentName(element.parentElement);
|
|
1945
|
-
parentInfo["parentid"] = htmlContent.id;
|
|
1946
|
-
parentInfo["parentname"] = htmlContent.contentName;
|
|
1947
|
-
}
|
|
1948
|
-
return parentInfo;
|
|
1949
|
-
};
|
|
1950
|
-
return DomContentHandler;
|
|
1951
|
-
}());
|
|
1952
|
-
|
|
1953
|
-
var ClickAnalyticsPlugin = /** @class */ (function (_super) {
|
|
1954
|
-
__extendsFn(ClickAnalyticsPlugin, _super);
|
|
1955
|
-
function ClickAnalyticsPlugin() {
|
|
1956
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
1957
|
-
_this.identifier = "ClickAnalyticsPlugin";
|
|
1958
|
-
_this.priority = 181;
|
|
1959
|
-
return _this;
|
|
1960
|
-
}
|
|
1961
|
-
ClickAnalyticsPlugin.prototype.initialize = function (config, core, extensions, pluginChain) {
|
|
1962
|
-
if (isNullOrUndefined(core)) {
|
|
1963
|
-
throw Error("Error initializing");
|
|
1964
|
-
}
|
|
1965
|
-
config.extensionConfig = config.extensionConfig || [];
|
|
1966
|
-
config.extensionConfig[this.identifier] = config.extensionConfig[this.identifier] || {};
|
|
1967
|
-
this._config = mergeConfig(config.extensionConfig[this.identifier]);
|
|
1968
|
-
_super.prototype.initialize.call(this, config, core, extensions, pluginChain);
|
|
1969
|
-
this._contentHandler = this._contentHandler ? this._contentHandler : new DomContentHandler(this._config, this.diagLog());
|
|
1970
|
-
var metaTags = this._contentHandler.getMetadata();
|
|
1971
|
-
this.pageAction = new PageAction(this, this._config, this._contentHandler, this._config.callback.pageActionPageTags, metaTags, this.diagLog());
|
|
1972
|
-
this._autoCaptureHandler = this._autoCaptureHandler ? this._autoCaptureHandler : new AutoCaptureHandler(this, this._config, this.pageAction, this.diagLog());
|
|
1973
|
-
if (this._config.autoCapture) {
|
|
1974
|
-
this._autoCaptureHandler.click();
|
|
1975
|
-
}
|
|
1976
|
-
var _propertiesExtension;
|
|
1977
|
-
arrForEach(extensions, function (extension) {
|
|
1978
|
-
if (extension.identifier === PropertiesPluginIdentifier) {
|
|
1979
|
-
_propertiesExtension = extension;
|
|
1980
|
-
}
|
|
1981
|
-
});
|
|
1982
|
-
if (_propertiesExtension && _propertiesExtension.context &&
|
|
1983
|
-
_propertiesExtension.context.internal && _propertiesExtension.context.internal.sdkVersion) {
|
|
1984
|
-
_propertiesExtension.context.internal.sdkVersion += "_ClickPlugin" + ClickAnalyticsPlugin.Version;
|
|
1985
|
-
}
|
|
1986
|
-
};
|
|
1987
|
-
ClickAnalyticsPlugin.prototype.processTelemetry = function (env, itemCtx) {
|
|
1988
|
-
this.processNext(env, itemCtx);
|
|
1989
|
-
};
|
|
1990
|
-
ClickAnalyticsPlugin.prototype.trackPageAction = function (pageAction, customProperties) {
|
|
1991
|
-
try {
|
|
1992
|
-
this.pageAction.trackPageAction(pageAction, customProperties);
|
|
1993
|
-
}
|
|
1994
|
-
catch (e) {
|
|
1995
|
-
this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _ExtendedInternalMessageId.TrackPageActionEventFailed, "trackPageAction failed, page action event will not be collected: " + getExceptionName(e), { exception: dumpObj(e) });
|
|
1996
|
-
}
|
|
1997
|
-
};
|
|
1998
|
-
ClickAnalyticsPlugin.Version = "2.8.0-nightly.2202-06";
|
|
1999
|
-
return ClickAnalyticsPlugin;
|
|
2000
|
-
}(BaseTelemetryPlugin));
|
|
2001
|
-
|
|
2002
|
-
exports.BehaviorEnumValidator = BehaviorEnumValidator;
|
|
2003
|
-
exports.BehaviorMapValidator = BehaviorMapValidator;
|
|
2004
|
-
exports.BehaviorValueValidator = BehaviorValueValidator;
|
|
2005
|
-
exports.ClickAnalyticsPlugin = ClickAnalyticsPlugin;
|
|
2006
|
-
|
|
2007
|
-
(function(obj, prop, descriptor) { /* ai_es3_polyfil defineProperty */ var func = Object["defineProperty"]; if (func) { try { return func(obj, prop, descriptor); } catch(e) { /* IE8 defines defineProperty, but will throw */ } } if (descriptor && typeof descriptor.value !== undefined) { obj[prop] = descriptor.value; } return obj; })(exports, '__esModule', { value: true });
|
|
2008
|
-
|
|
2009
|
-
})(this.Microsoft.ApplicationInsights = this.Microsoft.ApplicationInsights || {});
|
|
2010
|
-
//# sourceMappingURL=ai.clck.2.8.0-nightly.2202-06.gbl.js.map
|