@microsoft/applicationinsights-web-basic 3.1.1 → 3.1.2
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/{aib.3.1.1.cjs.js → aib.3.1.2.cjs.js} +674 -663
- package/browser/es5/aib.3.1.2.cjs.js.map +1 -0
- package/browser/es5/aib.3.1.2.cjs.min.js +6 -0
- package/browser/es5/aib.3.1.2.cjs.min.js.map +1 -0
- package/browser/es5/{aib.3.1.1.gbl.js → aib.3.1.2.gbl.js} +695 -684
- package/browser/es5/aib.3.1.2.gbl.js.map +1 -0
- package/browser/es5/aib.3.1.2.gbl.min.js +6 -0
- package/browser/es5/aib.3.1.2.gbl.min.js.map +1 -0
- package/browser/es5/aib.3.1.2.integrity.json +66 -0
- package/browser/es5/{aib.3.1.1.js → aib.3.1.2.js} +695 -684
- package/browser/es5/aib.3.1.2.js.map +1 -0
- package/browser/es5/aib.3.1.2.min.js +6 -0
- package/browser/es5/aib.3.1.2.min.js.map +1 -0
- package/browser/es5/aib.3.cjs.js +673 -662
- package/browser/es5/aib.3.cjs.js.map +1 -1
- package/browser/es5/aib.3.cjs.min.js +2 -2
- package/browser/es5/aib.3.cjs.min.js.map +1 -1
- package/browser/es5/aib.3.gbl.js +694 -683
- package/browser/es5/aib.3.gbl.js.map +1 -1
- package/browser/es5/aib.3.gbl.min.js +2 -2
- package/browser/es5/aib.3.gbl.min.js.map +1 -1
- package/browser/es5/aib.3.integrity.json +25 -25
- package/browser/es5/aib.3.js +694 -683
- package/browser/es5/aib.3.js.map +1 -1
- package/browser/es5/aib.3.min.js +2 -2
- package/browser/es5/aib.3.min.js.map +1 -1
- package/dist/es5/applicationinsights-web-basic.js +673 -662
- package/dist/es5/applicationinsights-web-basic.js.map +1 -1
- package/dist/es5/applicationinsights-web-basic.min.js +2 -2
- package/dist/es5/applicationinsights-web-basic.min.js.map +1 -1
- package/dist-es5/__DynamicConstants.js +1 -1
- package/dist-es5/index.js +1 -1
- package/package.json +5 -5
- package/types/applicationinsights-web-basic.d.ts +1 -1
- package/types/applicationinsights-web-basic.namespaced.d.ts +2 -1
- package/browser/es5/aib.3.1.1.cjs.js.map +0 -1
- package/browser/es5/aib.3.1.1.cjs.min.js +0 -6
- package/browser/es5/aib.3.1.1.cjs.min.js.map +0 -1
- package/browser/es5/aib.3.1.1.gbl.js.map +0 -1
- package/browser/es5/aib.3.1.1.gbl.min.js +0 -6
- package/browser/es5/aib.3.1.1.gbl.min.js.map +0 -1
- package/browser/es5/aib.3.1.1.integrity.json +0 -66
- package/browser/es5/aib.3.1.1.js.map +0 -1
- package/browser/es5/aib.3.1.1.min.js +0 -6
- package/browser/es5/aib.3.1.1.min.js.map +0 -1
package/browser/es5/aib.3.gbl.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Application Insights JavaScript Web SDK - Basic, 3.1.
|
|
2
|
+
* Application Insights JavaScript Web SDK - Basic, 3.1.2
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
(function (global, factory) {
|
|
6
6
|
var undef = "undefined";
|
|
7
|
-
var nsKey, key, nm, theExports = {}, modName = "
|
|
8
|
-
var mods={}, modDetail=mods[modName]={}, ver="3.1.
|
|
7
|
+
var nsKey, key, nm, theExports = {}, modName = "es5_aib_3_1_2", msMod="__ms$mod__";
|
|
8
|
+
var mods={}, modDetail=mods[modName]={}, ver="3.1.2";
|
|
9
9
|
var baseNs=global, nsKey="Microsoft", baseNs=baseNs[nsKey]=(baseNs[nsKey]||{});
|
|
10
10
|
// Versioned namespace "Microsoft.ApplicationInsights3"
|
|
11
11
|
var exportNs=baseNs, nsKey="ApplicationInsights3", exportNs=exportNs[nsKey]=(exportNs[nsKey]||{});
|
|
@@ -29,23 +29,16 @@
|
|
|
29
29
|
var UNDEF_VALUE = undefined;
|
|
30
30
|
var NULL_VALUE = null;
|
|
31
31
|
var EMPTY = "";
|
|
32
|
-
var BOOLEAN = "boolean";
|
|
33
32
|
var FUNCTION = "function";
|
|
34
|
-
var NUMBER = "number";
|
|
35
33
|
var OBJECT = "object";
|
|
36
34
|
var PROTOTYPE = "prototype";
|
|
37
35
|
var __PROTO__ = "__proto__";
|
|
38
|
-
var STRING = "string";
|
|
39
36
|
var UNDEFINED = "undefined";
|
|
40
37
|
var CONSTRUCTOR = "constructor";
|
|
41
38
|
var SYMBOL = "Symbol";
|
|
42
39
|
var POLYFILL_TAG = "_polyfill";
|
|
43
|
-
var INDEX_OF = "indexOf";
|
|
44
40
|
var LENGTH = "length";
|
|
45
|
-
var DONE = "done";
|
|
46
|
-
var VALUE = "value";
|
|
47
41
|
var NAME = "name";
|
|
48
|
-
var SLICE = "slice";
|
|
49
42
|
var CALL = "call";
|
|
50
43
|
var TO_STRING = "toString";
|
|
51
44
|
var ObjClass$1 = Object;
|
|
@@ -55,6 +48,7 @@ var StrProto = StrCls[PROTOTYPE];
|
|
|
55
48
|
var MathCls = Math;
|
|
56
49
|
var ArrCls = Array;
|
|
57
50
|
var ArrProto = ArrCls[PROTOTYPE];
|
|
51
|
+
var ArrSlice = ArrProto["slice"];
|
|
58
52
|
|
|
59
53
|
function safe(func, argArray) {
|
|
60
54
|
try {
|
|
@@ -67,12 +61,13 @@ function safe(func, argArray) {
|
|
|
67
61
|
}
|
|
68
62
|
}
|
|
69
63
|
|
|
64
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
70
65
|
function safeGet(cb, defValue) {
|
|
71
66
|
var result = safe(cb);
|
|
72
67
|
return result.e ? defValue : result.v;
|
|
73
68
|
}
|
|
74
69
|
|
|
75
|
-
var
|
|
70
|
+
var _primitiveTypes;
|
|
76
71
|
/*#__NO_SIDE_EFFECTS__*/
|
|
77
72
|
function _createIs(theType) {
|
|
78
73
|
return function (value) {
|
|
@@ -108,9 +103,10 @@ function isDefined(arg) {
|
|
|
108
103
|
}
|
|
109
104
|
/*#__NO_SIDE_EFFECTS__*/
|
|
110
105
|
function isPrimitiveType(theType) {
|
|
111
|
-
|
|
106
|
+
!_primitiveTypes && (_primitiveTypes = ["string", "number", "boolean", UNDEFINED, "symbol", "bigint"]);
|
|
107
|
+
return theType !== OBJECT && _primitiveTypes.indexOf(theType) !== -1;
|
|
112
108
|
}
|
|
113
|
-
var isString = ( /*#__PURE__*/_createIs(
|
|
109
|
+
var isString = ( /*#__PURE__*/_createIs("string"));
|
|
114
110
|
var isFunction = ( /*#__PURE__*/_createIs(FUNCTION));
|
|
115
111
|
/*#__NO_SIDE_EFFECTS__*/
|
|
116
112
|
function isObject(value) {
|
|
@@ -121,8 +117,8 @@ function isObject(value) {
|
|
|
121
117
|
}
|
|
122
118
|
var isArray = ArrCls.isArray;
|
|
123
119
|
var isDate = ( /*#__PURE__*/_createObjIs("Date"));
|
|
124
|
-
var isNumber = ( /*#__PURE__*/_createIs(
|
|
125
|
-
var isBoolean = ( /*#__PURE__*/_createIs(
|
|
120
|
+
var isNumber = ( /*#__PURE__*/_createIs("number"));
|
|
121
|
+
var isBoolean = ( /*#__PURE__*/_createIs("boolean"));
|
|
126
122
|
var isError = ( /*#__PURE__*/_createObjIs("Error"));
|
|
127
123
|
/*#__NO_SIDE_EFFECTS__*/
|
|
128
124
|
function isPromiseLike(value) {
|
|
@@ -240,6 +236,7 @@ var asString = StrCls;
|
|
|
240
236
|
|
|
241
237
|
var GLOBAL_CONFIG_KEY = "__tsUtils$gblCfg";
|
|
242
238
|
var _globalCfg;
|
|
239
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
243
240
|
function _getGlobalValue() {
|
|
244
241
|
var result;
|
|
245
242
|
if (typeof globalThis !== UNDEFINED) {
|
|
@@ -274,7 +271,7 @@ function dumpObj(object, format) {
|
|
|
274
271
|
object = { stack: asString(object.stack), message: asString(object.message), name: asString(object.name) };
|
|
275
272
|
}
|
|
276
273
|
try {
|
|
277
|
-
propertyValueDump = JSON.stringify(object, NULL_VALUE, format ? ((typeof format ===
|
|
274
|
+
propertyValueDump = JSON.stringify(object, NULL_VALUE, format ? ((typeof format === "number") ? format : 4) : UNDEF_VALUE);
|
|
278
275
|
propertyValueDump = (propertyValueDump && propertyValueDump.replace(/"(\w+)"\s*:\s{0,1}/g, "$1: ")) || asString(object);
|
|
279
276
|
}
|
|
280
277
|
catch (e) {
|
|
@@ -283,18 +280,15 @@ function dumpObj(object, format) {
|
|
|
283
280
|
return objType + ": " + propertyValueDump;
|
|
284
281
|
}
|
|
285
282
|
|
|
286
|
-
var _slice;
|
|
287
|
-
var _unwrapInstFunction = _unwrapFunctionWithPoly;
|
|
288
283
|
var _unwrapFunction = _unwrapFunctionWithPoly;
|
|
289
284
|
/*#__NO_SIDE_EFFECTS__*/
|
|
290
285
|
function _unwrapFunctionWithPoly(funcName, clsProto, polyFunc) {
|
|
291
|
-
_slice = _slice || ArrProto[SLICE];
|
|
292
286
|
var clsFn = clsProto && clsProto[funcName];
|
|
293
287
|
return function (thisArg) {
|
|
294
288
|
var theFunc = (thisArg && thisArg[funcName]) || clsFn;
|
|
295
289
|
if (theFunc || polyFunc) {
|
|
296
290
|
var theArgs = arguments;
|
|
297
|
-
return (theFunc || polyFunc).apply(thisArg, theFunc ?
|
|
291
|
+
return (theFunc || polyFunc).apply(thisArg, theFunc ? ArrSlice[CALL](theArgs, 1) : theArgs);
|
|
298
292
|
}
|
|
299
293
|
throwTypeError("\"" + asString(funcName) + "\" not defined for " + dumpObj(thisArg));
|
|
300
294
|
};
|
|
@@ -308,7 +302,7 @@ function _unwrapProp(propName) {
|
|
|
308
302
|
|
|
309
303
|
var mathMax = MathCls.max;
|
|
310
304
|
|
|
311
|
-
var strSlice = ( /*#__PURE__*/_unwrapFunction(
|
|
305
|
+
var strSlice = ( /*#__PURE__*/_unwrapFunction("slice", StrProto));
|
|
312
306
|
|
|
313
307
|
var strSubstring = ( /*#__PURE__*/_unwrapFunction("substring", StrProto));
|
|
314
308
|
var strSubstr = ( /*#__PURE__*/_unwrapFunctionWithPoly("substr", StrProto, polyStrSubstr));
|
|
@@ -380,7 +374,7 @@ function polyGetKnownSymbol(name) {
|
|
|
380
374
|
var propMap = {
|
|
381
375
|
e: "enumerable",
|
|
382
376
|
c: "configurable",
|
|
383
|
-
v:
|
|
377
|
+
v: "value",
|
|
384
378
|
w: "writable",
|
|
385
379
|
g: "get",
|
|
386
380
|
s: "set"
|
|
@@ -413,6 +407,7 @@ var _globalLazyTestHooks;
|
|
|
413
407
|
function _initTestHooks() {
|
|
414
408
|
_globalLazyTestHooks = _getGlobalConfig();
|
|
415
409
|
}
|
|
410
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
416
411
|
function getLazy(cb) {
|
|
417
412
|
var lazyValue = {};
|
|
418
413
|
!_globalLazyTestHooks && _initTestHooks();
|
|
@@ -450,10 +445,14 @@ function createCachedValue(value) {
|
|
|
450
445
|
|
|
451
446
|
var WINDOW = "window";
|
|
452
447
|
var _cachedGlobal;
|
|
453
|
-
|
|
454
|
-
var
|
|
455
|
-
|
|
456
|
-
|
|
448
|
+
function _getGlobalInstFn(getFn, theArgs) {
|
|
449
|
+
var cachedValue;
|
|
450
|
+
return function () {
|
|
451
|
+
!_globalLazyTestHooks && _initTestHooks();
|
|
452
|
+
(!cachedValue || _globalLazyTestHooks.lzy) && (cachedValue = createCachedValue(safe(getFn, theArgs).v));
|
|
453
|
+
return cachedValue.v;
|
|
454
|
+
};
|
|
455
|
+
}
|
|
457
456
|
/*#__NO_SIDE_EFFECTS__*/
|
|
458
457
|
function lazySafeGetInst(name) {
|
|
459
458
|
return getLazy(function () { return safe((getInst), [name]).v || UNDEF_VALUE; });
|
|
@@ -470,8 +469,8 @@ function getInst(name, useCached) {
|
|
|
470
469
|
if (gbl && gbl[name]) {
|
|
471
470
|
return gbl[name];
|
|
472
471
|
}
|
|
473
|
-
if (name === WINDOW
|
|
474
|
-
return
|
|
472
|
+
if (name === WINDOW) {
|
|
473
|
+
return getWindow();
|
|
475
474
|
}
|
|
476
475
|
return NULL_VALUE;
|
|
477
476
|
}
|
|
@@ -479,36 +478,20 @@ function getInst(name, useCached) {
|
|
|
479
478
|
function hasDocument() {
|
|
480
479
|
return !!getDocument();
|
|
481
480
|
}
|
|
482
|
-
/*#
|
|
483
|
-
function getDocument() {
|
|
484
|
-
!_globalLazyTestHooks && _initTestHooks();
|
|
485
|
-
(!_cachedDocument || _globalLazyTestHooks.lzy) && (_cachedDocument = createCachedValue(safe((getInst), ["document"]).v));
|
|
486
|
-
return _cachedDocument.v;
|
|
487
|
-
}
|
|
481
|
+
var getDocument = ( /*#__PURE__*/_getGlobalInstFn(getInst, ["document"]));
|
|
488
482
|
/*#__NO_SIDE_EFFECTS__*/
|
|
489
483
|
function hasWindow() {
|
|
490
484
|
return !!getWindow();
|
|
491
485
|
}
|
|
492
|
-
/*#
|
|
493
|
-
function getWindow() {
|
|
494
|
-
!_globalLazyTestHooks && _initTestHooks();
|
|
495
|
-
(!_cachedWindow || _globalLazyTestHooks.lzy) && (_cachedWindow = createCachedValue(safe((getInst), [WINDOW]).v));
|
|
496
|
-
return _cachedWindow.v;
|
|
497
|
-
}
|
|
486
|
+
var getWindow = ( /*#__PURE__*/_getGlobalInstFn(getInst, [WINDOW]));
|
|
498
487
|
/*#__NO_SIDE_EFFECTS__*/
|
|
499
488
|
function hasNavigator() {
|
|
500
489
|
return !!getNavigator();
|
|
501
490
|
}
|
|
502
|
-
/*#
|
|
503
|
-
function
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
return _cachedNavigator.v;
|
|
507
|
-
}
|
|
508
|
-
function isNode() {
|
|
509
|
-
!_isNode && (_isNode = createCachedValue(!!safe(function () { return (process && (process.versions || {}).node); }).v));
|
|
510
|
-
return _isNode.v;
|
|
511
|
-
}
|
|
491
|
+
var getNavigator = ( /*#__PURE__*/_getGlobalInstFn(getInst, ["navigator"]));
|
|
492
|
+
var isNode = ( /*#__PURE__*/_getGlobalInstFn(function () {
|
|
493
|
+
return !!safe(function () { return (process && (process.versions || {}).node); }).v;
|
|
494
|
+
}));
|
|
512
495
|
|
|
513
496
|
var _symbol;
|
|
514
497
|
var _symbolFor;
|
|
@@ -569,8 +552,8 @@ function iterForOf(iter, callbackfn, thisArg) {
|
|
|
569
552
|
var iterResult = void 0;
|
|
570
553
|
try {
|
|
571
554
|
var count = 0;
|
|
572
|
-
while (!(iterResult = iter.next())
|
|
573
|
-
if (callbackfn[CALL](thisArg || iter, iterResult
|
|
555
|
+
while (!(iterResult = iter.next()).done) {
|
|
556
|
+
if (callbackfn[CALL](thisArg || iter, iterResult.value, count, iter) === -1) {
|
|
574
557
|
break;
|
|
575
558
|
}
|
|
576
559
|
count++;
|
|
@@ -585,7 +568,7 @@ function iterForOf(iter, callbackfn, thisArg) {
|
|
|
585
568
|
}
|
|
586
569
|
finally {
|
|
587
570
|
try {
|
|
588
|
-
if (iterResult && !iterResult
|
|
571
|
+
if (iterResult && !iterResult.done) {
|
|
589
572
|
iter.return && iter.return(iterResult);
|
|
590
573
|
}
|
|
591
574
|
}
|
|
@@ -599,7 +582,9 @@ function iterForOf(iter, callbackfn, thisArg) {
|
|
|
599
582
|
}
|
|
600
583
|
}
|
|
601
584
|
|
|
602
|
-
|
|
585
|
+
function fnApply(fn, thisArg, argArray) {
|
|
586
|
+
return fn.apply(thisArg, argArray);
|
|
587
|
+
}
|
|
603
588
|
|
|
604
589
|
function arrAppend(target, elms) {
|
|
605
590
|
if (!isUndefined(elms) && target) {
|
|
@@ -631,11 +616,13 @@ function arrForEach(theArray, callbackfn, thisArg) {
|
|
|
631
616
|
}
|
|
632
617
|
}
|
|
633
618
|
|
|
634
|
-
var arrIndexOf = ( /*#__PURE__*/_unwrapFunction(
|
|
619
|
+
var arrIndexOf = ( /*#__PURE__*/_unwrapFunction("indexOf", ArrProto));
|
|
635
620
|
|
|
636
621
|
var arrMap = ( /*#__PURE__*/_unwrapFunction("map", ArrProto));
|
|
637
622
|
|
|
638
|
-
|
|
623
|
+
function arrSlice(theArray, start, end) {
|
|
624
|
+
return ((theArray && theArray["slice"]) || ArrSlice).apply(theArray, ArrSlice[CALL](arguments, 1));
|
|
625
|
+
}
|
|
639
626
|
|
|
640
627
|
var arrReduce = ( /*#__PURE__*/_unwrapFunction("reduce", ArrProto));
|
|
641
628
|
|
|
@@ -667,6 +654,7 @@ function objSetPrototypeOf(obj, proto) {
|
|
|
667
654
|
return fn(obj, proto);
|
|
668
655
|
}
|
|
669
656
|
|
|
657
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
670
658
|
function _createCustomError(name, d, b) {
|
|
671
659
|
safe(objDefine, [d, NAME, { v: name, c: true, e: false }]);
|
|
672
660
|
d = objSetPrototypeOf(d, b);
|
|
@@ -690,7 +678,7 @@ function createCustomError(name, constructCb, errorBase) {
|
|
|
690
678
|
var theArgs = arguments;
|
|
691
679
|
try {
|
|
692
680
|
safe(_setName, [theBaseClass, name]);
|
|
693
|
-
var _self = fnApply(theBaseClass, _this,
|
|
681
|
+
var _self = fnApply(theBaseClass, _this, ArrSlice[CALL](theArgs)) || _this;
|
|
694
682
|
if (_self !== _this) {
|
|
695
683
|
var orgProto = objGetPrototypeOf(_this);
|
|
696
684
|
if (orgProto !== objGetPrototypeOf(_self)) {
|
|
@@ -765,16 +753,18 @@ function isPlainObject(value) {
|
|
|
765
753
|
return result;
|
|
766
754
|
}
|
|
767
755
|
|
|
768
|
-
|
|
756
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
757
|
+
function _defaultDeepCopyHandler(details) {
|
|
769
758
|
details.value && plainObjDeepCopyHandler(details);
|
|
770
759
|
return true;
|
|
771
|
-
}
|
|
760
|
+
}
|
|
772
761
|
var defaultDeepCopyHandlers = [
|
|
773
762
|
arrayDeepCopyHandler,
|
|
774
763
|
plainObjDeepCopyHandler,
|
|
775
764
|
functionDeepCopyHandler,
|
|
776
765
|
dateDeepCopyHandler
|
|
777
766
|
];
|
|
767
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
778
768
|
function _getSetVisited(visitMap, source, newPath, cb) {
|
|
779
769
|
var theEntry;
|
|
780
770
|
arrForEach(visitMap, function (entry) {
|
|
@@ -909,7 +899,7 @@ function _doExtend(target, theArgs) {
|
|
|
909
899
|
return target;
|
|
910
900
|
}
|
|
911
901
|
function deepExtend(target, obj1, obj2, obj3, obj4, obj5, obj6) {
|
|
912
|
-
return _doExtend(objDeepCopy(target) || {},
|
|
902
|
+
return _doExtend(objDeepCopy(target) || {}, ArrSlice[CALL](arguments));
|
|
913
903
|
}
|
|
914
904
|
|
|
915
905
|
var getLength = ( /*#__PURE__*/_unwrapProp(LENGTH));
|
|
@@ -925,58 +915,54 @@ function polyStrEndsWith(value, searchString, length) {
|
|
|
925
915
|
return strSubstring(value, end - searchValue[LENGTH], end) === searchValue;
|
|
926
916
|
}
|
|
927
917
|
|
|
928
|
-
var strIndexOf = ( /*#__PURE__*/_unwrapFunction(
|
|
918
|
+
var strIndexOf = ( /*#__PURE__*/_unwrapFunction("indexOf", StrProto));
|
|
929
919
|
|
|
930
920
|
var REF = "ref";
|
|
931
|
-
var UNREF = "
|
|
921
|
+
var UNREF = "unref";
|
|
932
922
|
var HAS_REF = "hasRef";
|
|
933
923
|
var ENABLED = "enabled";
|
|
924
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
934
925
|
function _createTimerHandler(startTimer, refreshFn, cancelFn) {
|
|
935
|
-
var _a;
|
|
936
926
|
var ref = true;
|
|
937
927
|
var timerId = startTimer ? refreshFn(NULL_VALUE) : NULL_VALUE;
|
|
938
928
|
var theTimerHandler;
|
|
939
|
-
|
|
929
|
+
function _unref() {
|
|
940
930
|
ref = false;
|
|
941
931
|
timerId && timerId[UNREF] && timerId[UNREF]();
|
|
942
932
|
return theTimerHandler;
|
|
943
|
-
}
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
timerId
|
|
933
|
+
}
|
|
934
|
+
function _cancel() {
|
|
935
|
+
timerId && cancelFn(timerId);
|
|
936
|
+
timerId = NULL_VALUE;
|
|
937
|
+
}
|
|
938
|
+
function _refresh() {
|
|
939
|
+
timerId = refreshFn(timerId);
|
|
940
|
+
if (!ref) {
|
|
941
|
+
_unref();
|
|
942
|
+
}
|
|
947
943
|
return theTimerHandler;
|
|
944
|
+
}
|
|
945
|
+
function _setEnabled(value) {
|
|
946
|
+
!value && timerId && _cancel();
|
|
947
|
+
value && !timerId && _refresh();
|
|
948
|
+
}
|
|
949
|
+
theTimerHandler = {
|
|
950
|
+
cancel: _cancel,
|
|
951
|
+
refresh: _refresh
|
|
948
952
|
};
|
|
949
|
-
|
|
953
|
+
theTimerHandler[HAS_REF] = function () {
|
|
950
954
|
if (timerId && timerId[HAS_REF]) {
|
|
951
955
|
return timerId[HAS_REF]();
|
|
952
956
|
}
|
|
953
957
|
return ref;
|
|
954
958
|
};
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
_unref();
|
|
959
|
-
}
|
|
959
|
+
theTimerHandler[REF] = function () {
|
|
960
|
+
ref = true;
|
|
961
|
+
timerId && timerId[REF] && timerId[REF]();
|
|
960
962
|
return theTimerHandler;
|
|
961
963
|
};
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
timerId = NULL_VALUE;
|
|
965
|
-
};
|
|
966
|
-
var _setEnabled = function (value) {
|
|
967
|
-
!value && timerId && _cancel();
|
|
968
|
-
value && !timerId && _refresh();
|
|
969
|
-
};
|
|
970
|
-
theTimerHandler = (_a = {
|
|
971
|
-
cancel: _cancel,
|
|
972
|
-
refresh: _refresh
|
|
973
|
-
},
|
|
974
|
-
_a[HAS_REF] = _hasRef,
|
|
975
|
-
_a[REF] = _ref,
|
|
976
|
-
_a[UNREF] = _unref,
|
|
977
|
-
_a[ENABLED] = false,
|
|
978
|
-
_a);
|
|
979
|
-
objDefineProp(theTimerHandler, ENABLED, {
|
|
964
|
+
theTimerHandler[UNREF] = _unref;
|
|
965
|
+
theTimerHandler = objDefineProp(theTimerHandler, ENABLED, {
|
|
980
966
|
get: function () { return !!timerId; },
|
|
981
967
|
set: _setEnabled
|
|
982
968
|
});
|
|
@@ -988,7 +974,7 @@ function _createTimerHandler(startTimer, refreshFn, cancelFn) {
|
|
|
988
974
|
};
|
|
989
975
|
}
|
|
990
976
|
|
|
991
|
-
function _createTimeoutWith(
|
|
977
|
+
function _createTimeoutWith(startTimer, overrideFn, theArgs) {
|
|
992
978
|
var isArr = isArray(overrideFn);
|
|
993
979
|
var len = isArr ? overrideFn.length : 0;
|
|
994
980
|
var setFn = (len > 0 ? overrideFn[0] : (!isArr ? overrideFn : UNDEF_VALUE)) || setTimeout;
|
|
@@ -996,7 +982,7 @@ function _createTimeoutWith(self, startTimer, overrideFn, theArgs) {
|
|
|
996
982
|
var timerFn = theArgs[0];
|
|
997
983
|
theArgs[0] = function () {
|
|
998
984
|
handler.dn();
|
|
999
|
-
fnApply(timerFn,
|
|
985
|
+
fnApply(timerFn, UNDEF_VALUE, ArrSlice[CALL](arguments));
|
|
1000
986
|
};
|
|
1001
987
|
var handler = _createTimerHandler(startTimer, function (timerId) {
|
|
1002
988
|
if (timerId) {
|
|
@@ -1004,19 +990,19 @@ function _createTimeoutWith(self, startTimer, overrideFn, theArgs) {
|
|
|
1004
990
|
timerId.refresh();
|
|
1005
991
|
return timerId;
|
|
1006
992
|
}
|
|
1007
|
-
fnApply(clearFn,
|
|
993
|
+
fnApply(clearFn, UNDEF_VALUE, [timerId]);
|
|
1008
994
|
}
|
|
1009
|
-
return fnApply(setFn,
|
|
995
|
+
return fnApply(setFn, UNDEF_VALUE, theArgs);
|
|
1010
996
|
}, function (timerId) {
|
|
1011
|
-
fnApply(clearFn,
|
|
997
|
+
fnApply(clearFn, UNDEF_VALUE, [timerId]);
|
|
1012
998
|
});
|
|
1013
999
|
return handler.h;
|
|
1014
1000
|
}
|
|
1015
1001
|
function scheduleTimeout(callback, timeout) {
|
|
1016
|
-
return _createTimeoutWith(
|
|
1002
|
+
return _createTimeoutWith(true, UNDEF_VALUE, ArrSlice[CALL](arguments));
|
|
1017
1003
|
}
|
|
1018
1004
|
function createTimeout(callback, timeout) {
|
|
1019
|
-
return _createTimeoutWith(
|
|
1005
|
+
return _createTimeoutWith(false, UNDEF_VALUE, ArrSlice[CALL](arguments));
|
|
1020
1006
|
}
|
|
1021
1007
|
|
|
1022
1008
|
var _a$5;
|
|
@@ -1340,16 +1326,16 @@ var _DYN_HDLR = "hdlr";
|
|
|
1340
1326
|
var _DYN_CANCEL = "cancel";
|
|
1341
1327
|
var _DYN_INITIALIZE$1 = "initialize";
|
|
1342
1328
|
var _DYN_IDENTIFIER = "identifier";
|
|
1329
|
+
var _DYN_REMOVE_NOTIFICATION_0 = "removeNotificationListener";
|
|
1330
|
+
var _DYN_ADD_NOTIFICATION_LIS1 = "addNotificationListener";
|
|
1343
1331
|
var _DYN_IS_INITIALIZED = "isInitialized";
|
|
1332
|
+
var _DYN_GET_NOTIFY_MGR = "getNotifyMgr";
|
|
1344
1333
|
var _DYN_GET_PLUGIN = "getPlugin";
|
|
1345
1334
|
var _DYN_POLL_INTERNAL_LOGS = "pollInternalLogs";
|
|
1346
1335
|
var _DYN_NAME$2 = "name";
|
|
1347
1336
|
var _DYN_TIME = "time";
|
|
1348
1337
|
var _DYN_PROCESS_NEXT = "processNext";
|
|
1349
|
-
var
|
|
1350
|
-
var _DYN_GET_NOTIFY_MGR = "getNotifyMgr";
|
|
1351
|
-
var _DYN_ADD_NOTIFICATION_LIS1 = "addNotificationListener";
|
|
1352
|
-
var _DYN_REMOVE_NOTIFICATION_2 = "removeNotificationListener";
|
|
1338
|
+
var _DYN_GET_PROCESS_TEL_CONT2 = "getProcessTelContext";
|
|
1353
1339
|
var _DYN_ENABLED = "enabled";
|
|
1354
1340
|
var _DYN_STOP_POLLING_INTERNA3 = "stopPollingInternalLogs";
|
|
1355
1341
|
var _DYN_UNLOAD = "unload";
|
|
@@ -1375,7 +1361,6 @@ var _DYN_LOG_INTERNAL_MESSAGE = "logInternalMessage";
|
|
|
1375
1361
|
var _DYN_TYPE = "type";
|
|
1376
1362
|
var _DYN_HANDLER = "handler";
|
|
1377
1363
|
var _DYN_STATUS = "status";
|
|
1378
|
-
var _DYN_ITEMS_RECEIVED$1 = "itemsReceived";
|
|
1379
1364
|
var _DYN_GET_RESPONSE_HEADER = "getResponseHeader";
|
|
1380
1365
|
var _DYN_GET_ALL_RESPONSE_HEA5 = "getAllResponseHeaders";
|
|
1381
1366
|
var _DYN_IS_CHILD_EVT = "isChildEvt";
|
|
@@ -1383,6 +1368,7 @@ var _DYN_DATA$1 = "data";
|
|
|
1383
1368
|
var _DYN_GET_CTX = "getCtx";
|
|
1384
1369
|
var _DYN_SET_CTX = "setCtx";
|
|
1385
1370
|
var _DYN_COMPLETE = "complete";
|
|
1371
|
+
var _DYN_ITEMS_RECEIVED$1 = "itemsReceived";
|
|
1386
1372
|
var _DYN_URL_STRING = "urlString";
|
|
1387
1373
|
var _DYN_SEND_POST = "sendPOST";
|
|
1388
1374
|
var _DYN_HEADERS = "headers";
|
|
@@ -1760,482 +1746,119 @@ var STR_DOMAIN = "domain";
|
|
|
1760
1746
|
var STR_PATH = "path";
|
|
1761
1747
|
var STR_NOT_DYNAMIC_ERROR = "Not dynamic - ";
|
|
1762
1748
|
|
|
1763
|
-
var
|
|
1764
|
-
var
|
|
1765
|
-
var
|
|
1766
|
-
function
|
|
1767
|
-
return
|
|
1768
|
-
var args = arguments;
|
|
1769
|
-
var dbgExt = getDebugExt(config);
|
|
1770
|
-
if (dbgExt) {
|
|
1771
|
-
var listener = dbgExt.listener;
|
|
1772
|
-
if (listener && listener[name]) {
|
|
1773
|
-
listener[name][_DYN_APPLY ](listener, args);
|
|
1774
|
-
}
|
|
1775
|
-
}
|
|
1776
|
-
};
|
|
1749
|
+
var rCamelCase = /-([a-z])/g;
|
|
1750
|
+
var rNormalizeInvalid = /([^\w\d_$])/g;
|
|
1751
|
+
var rLeadingNumeric = /^(\d+[\w\d_$])/;
|
|
1752
|
+
function isNotNullOrUndefined(value) {
|
|
1753
|
+
return !isNullOrUndefined(value);
|
|
1777
1754
|
}
|
|
1778
|
-
function
|
|
1779
|
-
var
|
|
1780
|
-
if (
|
|
1781
|
-
|
|
1755
|
+
function normalizeJsName(name) {
|
|
1756
|
+
var value = name;
|
|
1757
|
+
if (value && isString(value)) {
|
|
1758
|
+
value = value[_DYN_REPLACE ](rCamelCase, function (_all, letter) {
|
|
1759
|
+
return letter.toUpperCase();
|
|
1760
|
+
});
|
|
1761
|
+
value = value[_DYN_REPLACE ](rNormalizeInvalid, "_");
|
|
1762
|
+
value = value[_DYN_REPLACE ](rLeadingNumeric, function (_all, match) {
|
|
1763
|
+
return "_" + match;
|
|
1764
|
+
});
|
|
1782
1765
|
}
|
|
1783
|
-
return
|
|
1766
|
+
return value;
|
|
1784
1767
|
}
|
|
1785
|
-
function
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
ns = _aiNamespace || _getExtensionNamespace();
|
|
1768
|
+
function strContains(value, search) {
|
|
1769
|
+
if (value && search) {
|
|
1770
|
+
return strIndexOf(value, search) !== -1;
|
|
1789
1771
|
}
|
|
1790
|
-
return
|
|
1772
|
+
return false;
|
|
1791
1773
|
}
|
|
1792
|
-
function
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1774
|
+
function toISOString(date) {
|
|
1775
|
+
return date && date.toISOString() || "";
|
|
1776
|
+
}
|
|
1777
|
+
function getExceptionName(object) {
|
|
1778
|
+
if (isError(object)) {
|
|
1779
|
+
return object[_DYN_NAME$2 ];
|
|
1798
1780
|
}
|
|
1799
|
-
return
|
|
1781
|
+
return STR_EMPTY$1;
|
|
1800
1782
|
}
|
|
1801
|
-
|
|
1802
|
-
var
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
var strMsie = "msie";
|
|
1809
|
-
var strTrident = "trident/";
|
|
1810
|
-
var strXMLHttpRequest = "XMLHttpRequest";
|
|
1811
|
-
var _isTrident = null;
|
|
1812
|
-
var _navUserAgentCheck = null;
|
|
1813
|
-
var _enableMocks = false;
|
|
1814
|
-
var _useXDomainRequest = null;
|
|
1815
|
-
var _beaconsSupported = null;
|
|
1816
|
-
function _hasProperty(theClass, property) {
|
|
1817
|
-
var supported = false;
|
|
1818
|
-
if (theClass) {
|
|
1819
|
-
try {
|
|
1820
|
-
supported = property in theClass;
|
|
1821
|
-
if (!supported) {
|
|
1822
|
-
var proto = theClass[strShimPrototype];
|
|
1823
|
-
if (proto) {
|
|
1824
|
-
supported = property in proto;
|
|
1825
|
-
}
|
|
1826
|
-
}
|
|
1827
|
-
}
|
|
1828
|
-
catch (e) {
|
|
1829
|
-
}
|
|
1830
|
-
if (!supported) {
|
|
1831
|
-
try {
|
|
1832
|
-
var tmp = new theClass();
|
|
1833
|
-
supported = !isUndefined(tmp[property]);
|
|
1834
|
-
}
|
|
1835
|
-
catch (e) {
|
|
1836
|
-
}
|
|
1783
|
+
function setValue(target, field, value, valChk, srcChk) {
|
|
1784
|
+
var theValue = value;
|
|
1785
|
+
if (target) {
|
|
1786
|
+
theValue = target[field];
|
|
1787
|
+
if (theValue !== value && (!srcChk || srcChk(theValue)) && (!valChk || valChk(value))) {
|
|
1788
|
+
theValue = value;
|
|
1789
|
+
target[field] = theValue;
|
|
1837
1790
|
}
|
|
1838
1791
|
}
|
|
1839
|
-
return
|
|
1792
|
+
return theValue;
|
|
1840
1793
|
}
|
|
1841
|
-
function
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1794
|
+
function getSetValue(target, field, defValue) {
|
|
1795
|
+
var theValue;
|
|
1796
|
+
if (target) {
|
|
1797
|
+
theValue = target[field];
|
|
1798
|
+
if (!theValue && isNullOrUndefined(theValue)) {
|
|
1799
|
+
theValue = !isUndefined(defValue) ? defValue : {};
|
|
1800
|
+
target[field] = theValue;
|
|
1846
1801
|
}
|
|
1847
1802
|
}
|
|
1848
|
-
|
|
1849
|
-
|
|
1803
|
+
else {
|
|
1804
|
+
theValue = !isUndefined(defValue) ? defValue : {};
|
|
1850
1805
|
}
|
|
1851
|
-
return
|
|
1806
|
+
return theValue;
|
|
1852
1807
|
}
|
|
1853
|
-
function
|
|
1854
|
-
|
|
1855
|
-
|
|
1808
|
+
function _createProxyFunction(source, funcName) {
|
|
1809
|
+
var srcFunc = null;
|
|
1810
|
+
var src = null;
|
|
1811
|
+
if (isFunction(source)) {
|
|
1812
|
+
srcFunc = source;
|
|
1856
1813
|
}
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
return
|
|
1814
|
+
else {
|
|
1815
|
+
src = source;
|
|
1816
|
+
}
|
|
1817
|
+
return function () {
|
|
1818
|
+
var originalArguments = arguments;
|
|
1819
|
+
if (srcFunc) {
|
|
1820
|
+
src = srcFunc();
|
|
1821
|
+
}
|
|
1822
|
+
if (src) {
|
|
1823
|
+
return src[funcName][_DYN_APPLY ](src, originalArguments);
|
|
1824
|
+
}
|
|
1825
|
+
};
|
|
1861
1826
|
}
|
|
1862
|
-
function
|
|
1863
|
-
if (
|
|
1864
|
-
|
|
1827
|
+
function proxyFunctionAs(target, name, source, theFunc, overwriteTarget) {
|
|
1828
|
+
if (target && name && source) {
|
|
1829
|
+
if (overwriteTarget !== false || isUndefined(target[name])) {
|
|
1830
|
+
target[name] = _createProxyFunction(source, theFunc);
|
|
1831
|
+
}
|
|
1865
1832
|
}
|
|
1866
|
-
return null;
|
|
1867
1833
|
}
|
|
1868
|
-
function
|
|
1869
|
-
|
|
1834
|
+
function proxyFunctions(target, source, functionsToProxy, overwriteTarget) {
|
|
1835
|
+
if (target && source && isObject(target) && isArray(functionsToProxy)) {
|
|
1836
|
+
arrForEach(functionsToProxy, function (theFuncName) {
|
|
1837
|
+
if (isString(theFuncName)) {
|
|
1838
|
+
proxyFunctionAs(target, theFuncName, source, theFuncName, overwriteTarget);
|
|
1839
|
+
}
|
|
1840
|
+
});
|
|
1841
|
+
}
|
|
1842
|
+
return target;
|
|
1870
1843
|
}
|
|
1871
|
-
function
|
|
1872
|
-
return
|
|
1844
|
+
function createClassFromInterface(defaults) {
|
|
1845
|
+
return /** @class */ (function () {
|
|
1846
|
+
function class_1() {
|
|
1847
|
+
var _this = this;
|
|
1848
|
+
if (defaults) {
|
|
1849
|
+
objForEachKey(defaults, function (field, value) {
|
|
1850
|
+
_this[field] = value;
|
|
1851
|
+
});
|
|
1852
|
+
}
|
|
1853
|
+
}
|
|
1854
|
+
return class_1;
|
|
1855
|
+
}());
|
|
1873
1856
|
}
|
|
1874
|
-
function
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
_navUserAgentCheck = nav[_DYN_USER_AGENT ];
|
|
1878
|
-
var userAgent = (_navUserAgentCheck || STR_EMPTY$1)[_DYN_TO_LOWER_CASE$1 ]();
|
|
1879
|
-
_isTrident = (strContains(userAgent, strMsie) || strContains(userAgent, strTrident));
|
|
1857
|
+
function optimizeObject(theObject) {
|
|
1858
|
+
if (theObject && objAssign) {
|
|
1859
|
+
theObject = ObjClass(objAssign({}, theObject));
|
|
1880
1860
|
}
|
|
1881
|
-
return
|
|
1882
|
-
}
|
|
1883
|
-
function getIEVersion(userAgentStr) {
|
|
1884
|
-
if (userAgentStr === void 0) { userAgentStr = null; }
|
|
1885
|
-
if (!userAgentStr) {
|
|
1886
|
-
var navigator_1 = getNavigator() || {};
|
|
1887
|
-
userAgentStr = navigator_1 ? (navigator_1.userAgent || STR_EMPTY$1)[_DYN_TO_LOWER_CASE$1 ]() : STR_EMPTY$1;
|
|
1888
|
-
}
|
|
1889
|
-
var ua = (userAgentStr || STR_EMPTY$1)[_DYN_TO_LOWER_CASE$1 ]();
|
|
1890
|
-
if (strContains(ua, strMsie)) {
|
|
1891
|
-
var doc = getDocument() || {};
|
|
1892
|
-
return Math.max(parseInt(ua[_DYN_SPLIT$1 ](strMsie)[1]), (doc[strDocumentMode] || 0));
|
|
1893
|
-
}
|
|
1894
|
-
else if (strContains(ua, strTrident)) {
|
|
1895
|
-
var tridentVer = parseInt(ua[_DYN_SPLIT$1 ](strTrident)[1]);
|
|
1896
|
-
if (tridentVer) {
|
|
1897
|
-
return tridentVer + 4;
|
|
1898
|
-
}
|
|
1899
|
-
}
|
|
1900
|
-
return null;
|
|
1901
|
-
}
|
|
1902
|
-
function isBeaconsSupported(useCached) {
|
|
1903
|
-
if (_beaconsSupported === null || useCached === false) {
|
|
1904
|
-
_beaconsSupported = hasNavigator() && Boolean(getNavigator().sendBeacon);
|
|
1905
|
-
}
|
|
1906
|
-
return _beaconsSupported;
|
|
1907
|
-
}
|
|
1908
|
-
function isFetchSupported(withKeepAlive) {
|
|
1909
|
-
var isSupported = false;
|
|
1910
|
-
try {
|
|
1911
|
-
isSupported = !!getInst("fetch");
|
|
1912
|
-
var request = getInst("Request");
|
|
1913
|
-
if (isSupported && withKeepAlive && request) {
|
|
1914
|
-
isSupported = _hasProperty(request, "keepalive");
|
|
1915
|
-
}
|
|
1916
|
-
}
|
|
1917
|
-
catch (e) {
|
|
1918
|
-
}
|
|
1919
|
-
return isSupported;
|
|
1920
|
-
}
|
|
1921
|
-
function useXDomainRequest() {
|
|
1922
|
-
if (_useXDomainRequest === null) {
|
|
1923
|
-
_useXDomainRequest = (typeof XDomainRequest !== strShimUndefined);
|
|
1924
|
-
if (_useXDomainRequest && isXhrSupported()) {
|
|
1925
|
-
_useXDomainRequest = _useXDomainRequest && !_hasProperty(getInst(strXMLHttpRequest), "withCredentials");
|
|
1926
|
-
}
|
|
1927
|
-
}
|
|
1928
|
-
return _useXDomainRequest;
|
|
1929
|
-
}
|
|
1930
|
-
function isXhrSupported() {
|
|
1931
|
-
var isSupported = false;
|
|
1932
|
-
try {
|
|
1933
|
-
var xmlHttpRequest = getInst(strXMLHttpRequest);
|
|
1934
|
-
isSupported = !!xmlHttpRequest;
|
|
1935
|
-
}
|
|
1936
|
-
catch (e) {
|
|
1937
|
-
}
|
|
1938
|
-
return isSupported;
|
|
1939
|
-
}
|
|
1940
|
-
|
|
1941
|
-
var _a$4;
|
|
1942
|
-
var STR_WARN_TO_CONSOLE = "warnToConsole";
|
|
1943
|
-
var AiNonUserActionablePrefix = "AI (Internal): ";
|
|
1944
|
-
var AiUserActionablePrefix = "AI: ";
|
|
1945
|
-
var AIInternalMessagePrefix = "AITR_";
|
|
1946
|
-
var defaultValues$2 = {
|
|
1947
|
-
loggingLevelConsole: 0,
|
|
1948
|
-
loggingLevelTelemetry: 1,
|
|
1949
|
-
maxMessageLimit: 25,
|
|
1950
|
-
enableDebug: false
|
|
1951
|
-
};
|
|
1952
|
-
var _logFuncs = (_a$4 = {},
|
|
1953
|
-
_a$4[0 ] = null,
|
|
1954
|
-
_a$4[1 ] = "errorToConsole",
|
|
1955
|
-
_a$4[2 ] = STR_WARN_TO_CONSOLE,
|
|
1956
|
-
_a$4[3 ] = "debugToConsole",
|
|
1957
|
-
_a$4);
|
|
1958
|
-
function _sanitizeDiagnosticText(text) {
|
|
1959
|
-
if (text) {
|
|
1960
|
-
return "\"" + text[_DYN_REPLACE ](/\"/g, STR_EMPTY$1) + "\"";
|
|
1961
|
-
}
|
|
1962
|
-
return STR_EMPTY$1;
|
|
1963
|
-
}
|
|
1964
|
-
function _logToConsole(func, message) {
|
|
1965
|
-
var theConsole = getConsole();
|
|
1966
|
-
if (!!theConsole) {
|
|
1967
|
-
var logFunc = "log";
|
|
1968
|
-
if (theConsole[func]) {
|
|
1969
|
-
logFunc = func;
|
|
1970
|
-
}
|
|
1971
|
-
if (isFunction(theConsole[logFunc])) {
|
|
1972
|
-
theConsole[logFunc](message);
|
|
1973
|
-
}
|
|
1974
|
-
}
|
|
1975
|
-
}
|
|
1976
|
-
var _InternalLogMessage = /** @class */ (function () {
|
|
1977
|
-
function _InternalLogMessage(msgId, msg, isUserAct, properties) {
|
|
1978
|
-
if (isUserAct === void 0) { isUserAct = false; }
|
|
1979
|
-
var _self = this;
|
|
1980
|
-
_self[_DYN_MESSAGE_ID ] = msgId;
|
|
1981
|
-
_self[_DYN_MESSAGE$1 ] =
|
|
1982
|
-
(isUserAct ? AiUserActionablePrefix : AiNonUserActionablePrefix) +
|
|
1983
|
-
msgId;
|
|
1984
|
-
var strProps = STR_EMPTY$1;
|
|
1985
|
-
if (hasJSON()) {
|
|
1986
|
-
strProps = getJSON().stringify(properties);
|
|
1987
|
-
}
|
|
1988
|
-
var diagnosticText = (msg ? " message:" + _sanitizeDiagnosticText(msg) : STR_EMPTY$1) +
|
|
1989
|
-
(properties ? " props:" + _sanitizeDiagnosticText(strProps) : STR_EMPTY$1);
|
|
1990
|
-
_self[_DYN_MESSAGE$1 ] += diagnosticText;
|
|
1991
|
-
}
|
|
1992
|
-
_InternalLogMessage.dataType = "MessageData";
|
|
1993
|
-
return _InternalLogMessage;
|
|
1994
|
-
}());
|
|
1995
|
-
function safeGetLogger(core, config) {
|
|
1996
|
-
return (core || {})[_DYN_LOGGER ] || new DiagnosticLogger(config);
|
|
1997
|
-
}
|
|
1998
|
-
var DiagnosticLogger = /** @class */ (function () {
|
|
1999
|
-
function DiagnosticLogger(config) {
|
|
2000
|
-
this.identifier = "DiagnosticLogger";
|
|
2001
|
-
this.queue = [];
|
|
2002
|
-
var _messageCount = 0;
|
|
2003
|
-
var _messageLogged = {};
|
|
2004
|
-
var _loggingLevelConsole;
|
|
2005
|
-
var _loggingLevelTelemetry;
|
|
2006
|
-
var _maxInternalMessageLimit;
|
|
2007
|
-
var _enableDebug;
|
|
2008
|
-
var _unloadHandler;
|
|
2009
|
-
dynamicProto(DiagnosticLogger, this, function (_self) {
|
|
2010
|
-
_unloadHandler = _setDefaultsFromConfig(config || {});
|
|
2011
|
-
_self.consoleLoggingLevel = function () { return _loggingLevelConsole; };
|
|
2012
|
-
_self[_DYN_THROW_INTERNAL ] = function (severity, msgId, msg, properties, isUserAct) {
|
|
2013
|
-
if (isUserAct === void 0) { isUserAct = false; }
|
|
2014
|
-
var message = new _InternalLogMessage(msgId, msg, isUserAct, properties);
|
|
2015
|
-
if (_enableDebug) {
|
|
2016
|
-
throw dumpObj(message);
|
|
2017
|
-
}
|
|
2018
|
-
else {
|
|
2019
|
-
var logFunc = _logFuncs[severity] || STR_WARN_TO_CONSOLE;
|
|
2020
|
-
if (!isUndefined(message[_DYN_MESSAGE$1 ])) {
|
|
2021
|
-
if (isUserAct) {
|
|
2022
|
-
var messageKey = +message[_DYN_MESSAGE_ID ];
|
|
2023
|
-
if (!_messageLogged[messageKey] && _loggingLevelConsole >= severity) {
|
|
2024
|
-
_self[logFunc](message[_DYN_MESSAGE$1 ]);
|
|
2025
|
-
_messageLogged[messageKey] = true;
|
|
2026
|
-
}
|
|
2027
|
-
}
|
|
2028
|
-
else {
|
|
2029
|
-
if (_loggingLevelConsole >= severity) {
|
|
2030
|
-
_self[logFunc](message[_DYN_MESSAGE$1 ]);
|
|
2031
|
-
}
|
|
2032
|
-
}
|
|
2033
|
-
_logInternalMessage(severity, message);
|
|
2034
|
-
}
|
|
2035
|
-
else {
|
|
2036
|
-
_debugExtMsg("throw" + (severity === 1 ? "Critical" : "Warning"), message);
|
|
2037
|
-
}
|
|
2038
|
-
}
|
|
2039
|
-
};
|
|
2040
|
-
_self.debugToConsole = function (message) {
|
|
2041
|
-
_logToConsole("debug", message);
|
|
2042
|
-
_debugExtMsg("warning", message);
|
|
2043
|
-
};
|
|
2044
|
-
_self[_DYN_WARN_TO_CONSOLE ] = function (message) {
|
|
2045
|
-
_logToConsole("warn", message);
|
|
2046
|
-
_debugExtMsg("warning", message);
|
|
2047
|
-
};
|
|
2048
|
-
_self.errorToConsole = function (message) {
|
|
2049
|
-
_logToConsole("error", message);
|
|
2050
|
-
_debugExtMsg("error", message);
|
|
2051
|
-
};
|
|
2052
|
-
_self.resetInternalMessageCount = function () {
|
|
2053
|
-
_messageCount = 0;
|
|
2054
|
-
_messageLogged = {};
|
|
2055
|
-
};
|
|
2056
|
-
_self[_DYN_LOG_INTERNAL_MESSAGE ] = _logInternalMessage;
|
|
2057
|
-
_self[_DYN_UNLOAD ] = function (isAsync) {
|
|
2058
|
-
_unloadHandler && _unloadHandler.rm();
|
|
2059
|
-
_unloadHandler = null;
|
|
2060
|
-
};
|
|
2061
|
-
function _logInternalMessage(severity, message) {
|
|
2062
|
-
if (_areInternalMessagesThrottled()) {
|
|
2063
|
-
return;
|
|
2064
|
-
}
|
|
2065
|
-
var logMessage = true;
|
|
2066
|
-
var messageKey = AIInternalMessagePrefix + message[_DYN_MESSAGE_ID ];
|
|
2067
|
-
if (_messageLogged[messageKey]) {
|
|
2068
|
-
logMessage = false;
|
|
2069
|
-
}
|
|
2070
|
-
else {
|
|
2071
|
-
_messageLogged[messageKey] = true;
|
|
2072
|
-
}
|
|
2073
|
-
if (logMessage) {
|
|
2074
|
-
if (severity <= _loggingLevelTelemetry) {
|
|
2075
|
-
_self.queue[_DYN_PUSH$2 ](message);
|
|
2076
|
-
_messageCount++;
|
|
2077
|
-
_debugExtMsg((severity === 1 ? "error" : "warn"), message);
|
|
2078
|
-
}
|
|
2079
|
-
if (_messageCount === _maxInternalMessageLimit) {
|
|
2080
|
-
var throttleLimitMessage = "Internal events throttle limit per PageView reached for this app.";
|
|
2081
|
-
var throttleMessage = new _InternalLogMessage(23 , throttleLimitMessage, false);
|
|
2082
|
-
_self.queue[_DYN_PUSH$2 ](throttleMessage);
|
|
2083
|
-
if (severity === 1 ) {
|
|
2084
|
-
_self.errorToConsole(throttleLimitMessage);
|
|
2085
|
-
}
|
|
2086
|
-
else {
|
|
2087
|
-
_self[_DYN_WARN_TO_CONSOLE ](throttleLimitMessage);
|
|
2088
|
-
}
|
|
2089
|
-
}
|
|
2090
|
-
}
|
|
2091
|
-
}
|
|
2092
|
-
function _setDefaultsFromConfig(config) {
|
|
2093
|
-
return onConfigChange(createDynamicConfig(config, defaultValues$2, _self).cfg, function (details) {
|
|
2094
|
-
var config = details.cfg;
|
|
2095
|
-
_loggingLevelConsole = config[_DYN_LOGGING_LEVEL_CONSOL4 ];
|
|
2096
|
-
_loggingLevelTelemetry = config.loggingLevelTelemetry;
|
|
2097
|
-
_maxInternalMessageLimit = config.maxMessageLimit;
|
|
2098
|
-
_enableDebug = config.enableDebug;
|
|
2099
|
-
});
|
|
2100
|
-
}
|
|
2101
|
-
function _areInternalMessagesThrottled() {
|
|
2102
|
-
return _messageCount >= _maxInternalMessageLimit;
|
|
2103
|
-
}
|
|
2104
|
-
function _debugExtMsg(name, data) {
|
|
2105
|
-
var dbgExt = getDebugExt(config || {});
|
|
2106
|
-
if (dbgExt && dbgExt[_DYN_DIAG_LOG$1 ]) {
|
|
2107
|
-
dbgExt[_DYN_DIAG_LOG$1 ](name, data);
|
|
2108
|
-
}
|
|
2109
|
-
}
|
|
2110
|
-
});
|
|
2111
|
-
}
|
|
2112
|
-
DiagnosticLogger.__ieDyn=1;
|
|
2113
|
-
return DiagnosticLogger;
|
|
2114
|
-
}());
|
|
2115
|
-
function _getLogger(logger) {
|
|
2116
|
-
return (logger || new DiagnosticLogger());
|
|
2117
|
-
}
|
|
2118
|
-
function _throwInternal(logger, severity, msgId, msg, properties, isUserAct) {
|
|
2119
|
-
if (isUserAct === void 0) { isUserAct = false; }
|
|
2120
|
-
_getLogger(logger)[_DYN_THROW_INTERNAL ](severity, msgId, msg, properties, isUserAct);
|
|
2121
|
-
}
|
|
2122
|
-
function _warnToConsole(logger, message) {
|
|
2123
|
-
_getLogger(logger)[_DYN_WARN_TO_CONSOLE ](message);
|
|
2124
|
-
}
|
|
2125
|
-
|
|
2126
|
-
var rCamelCase = /-([a-z])/g;
|
|
2127
|
-
var rNormalizeInvalid = /([^\w\d_$])/g;
|
|
2128
|
-
var rLeadingNumeric = /^(\d+[\w\d_$])/;
|
|
2129
|
-
function isNotNullOrUndefined(value) {
|
|
2130
|
-
return !isNullOrUndefined(value);
|
|
2131
|
-
}
|
|
2132
|
-
function normalizeJsName(name) {
|
|
2133
|
-
var value = name;
|
|
2134
|
-
if (value && isString(value)) {
|
|
2135
|
-
value = value[_DYN_REPLACE ](rCamelCase, function (_all, letter) {
|
|
2136
|
-
return letter.toUpperCase();
|
|
2137
|
-
});
|
|
2138
|
-
value = value[_DYN_REPLACE ](rNormalizeInvalid, "_");
|
|
2139
|
-
value = value[_DYN_REPLACE ](rLeadingNumeric, function (_all, match) {
|
|
2140
|
-
return "_" + match;
|
|
2141
|
-
});
|
|
2142
|
-
}
|
|
2143
|
-
return value;
|
|
2144
|
-
}
|
|
2145
|
-
function strContains(value, search) {
|
|
2146
|
-
if (value && search) {
|
|
2147
|
-
return strIndexOf(value, search) !== -1;
|
|
2148
|
-
}
|
|
2149
|
-
return false;
|
|
2150
|
-
}
|
|
2151
|
-
function toISOString(date) {
|
|
2152
|
-
return date && date.toISOString() || "";
|
|
2153
|
-
}
|
|
2154
|
-
function getExceptionName(object) {
|
|
2155
|
-
if (isError(object)) {
|
|
2156
|
-
return object[_DYN_NAME$2 ];
|
|
2157
|
-
}
|
|
2158
|
-
return STR_EMPTY$1;
|
|
2159
|
-
}
|
|
2160
|
-
function setValue(target, field, value, valChk, srcChk) {
|
|
2161
|
-
var theValue = value;
|
|
2162
|
-
if (target) {
|
|
2163
|
-
theValue = target[field];
|
|
2164
|
-
if (theValue !== value && (!srcChk || srcChk(theValue)) && (!valChk || valChk(value))) {
|
|
2165
|
-
theValue = value;
|
|
2166
|
-
target[field] = theValue;
|
|
2167
|
-
}
|
|
2168
|
-
}
|
|
2169
|
-
return theValue;
|
|
2170
|
-
}
|
|
2171
|
-
function getSetValue(target, field, defValue) {
|
|
2172
|
-
var theValue;
|
|
2173
|
-
if (target) {
|
|
2174
|
-
theValue = target[field];
|
|
2175
|
-
if (!theValue && isNullOrUndefined(theValue)) {
|
|
2176
|
-
theValue = !isUndefined(defValue) ? defValue : {};
|
|
2177
|
-
target[field] = theValue;
|
|
2178
|
-
}
|
|
2179
|
-
}
|
|
2180
|
-
else {
|
|
2181
|
-
theValue = !isUndefined(defValue) ? defValue : {};
|
|
2182
|
-
}
|
|
2183
|
-
return theValue;
|
|
2184
|
-
}
|
|
2185
|
-
function _createProxyFunction(source, funcName) {
|
|
2186
|
-
var srcFunc = null;
|
|
2187
|
-
var src = null;
|
|
2188
|
-
if (isFunction(source)) {
|
|
2189
|
-
srcFunc = source;
|
|
2190
|
-
}
|
|
2191
|
-
else {
|
|
2192
|
-
src = source;
|
|
2193
|
-
}
|
|
2194
|
-
return function () {
|
|
2195
|
-
var originalArguments = arguments;
|
|
2196
|
-
if (srcFunc) {
|
|
2197
|
-
src = srcFunc();
|
|
2198
|
-
}
|
|
2199
|
-
if (src) {
|
|
2200
|
-
return src[funcName][_DYN_APPLY ](src, originalArguments);
|
|
2201
|
-
}
|
|
2202
|
-
};
|
|
2203
|
-
}
|
|
2204
|
-
function proxyFunctionAs(target, name, source, theFunc, overwriteTarget) {
|
|
2205
|
-
if (target && name && source) {
|
|
2206
|
-
if (overwriteTarget !== false || isUndefined(target[name])) {
|
|
2207
|
-
target[name] = _createProxyFunction(source, theFunc);
|
|
2208
|
-
}
|
|
2209
|
-
}
|
|
2210
|
-
}
|
|
2211
|
-
function proxyFunctions(target, source, functionsToProxy, overwriteTarget) {
|
|
2212
|
-
if (target && source && isObject(target) && isArray(functionsToProxy)) {
|
|
2213
|
-
arrForEach(functionsToProxy, function (theFuncName) {
|
|
2214
|
-
if (isString(theFuncName)) {
|
|
2215
|
-
proxyFunctionAs(target, theFuncName, source, theFuncName, overwriteTarget);
|
|
2216
|
-
}
|
|
2217
|
-
});
|
|
2218
|
-
}
|
|
2219
|
-
return target;
|
|
2220
|
-
}
|
|
2221
|
-
function createClassFromInterface(defaults) {
|
|
2222
|
-
return /** @class */ (function () {
|
|
2223
|
-
function class_1() {
|
|
2224
|
-
var _this = this;
|
|
2225
|
-
if (defaults) {
|
|
2226
|
-
objForEachKey(defaults, function (field, value) {
|
|
2227
|
-
_this[field] = value;
|
|
2228
|
-
});
|
|
2229
|
-
}
|
|
2230
|
-
}
|
|
2231
|
-
return class_1;
|
|
2232
|
-
}());
|
|
2233
|
-
}
|
|
2234
|
-
function optimizeObject(theObject) {
|
|
2235
|
-
if (theObject && objAssign) {
|
|
2236
|
-
theObject = ObjClass(objAssign({}, theObject));
|
|
2237
|
-
}
|
|
2238
|
-
return theObject;
|
|
1861
|
+
return theObject;
|
|
2239
1862
|
}
|
|
2240
1863
|
function objExtend(obj1, obj2, obj3, obj4, obj5, obj6) {
|
|
2241
1864
|
var theArgs = arguments;
|
|
@@ -2312,23 +1935,6 @@ function prependTransports(theTransports, newTransports) {
|
|
|
2312
1935
|
}
|
|
2313
1936
|
return theTransports;
|
|
2314
1937
|
}
|
|
2315
|
-
function parseResponse(response, diagLog) {
|
|
2316
|
-
try {
|
|
2317
|
-
if (response && response !== "") {
|
|
2318
|
-
var result = getJSON().parse(response);
|
|
2319
|
-
if (result && result[_DYN_ITEMS_RECEIVED$1 ] && result[_DYN_ITEMS_RECEIVED$1 ] >= result.itemsAccepted &&
|
|
2320
|
-
result.itemsReceived - result.itemsAccepted === result.errors[_DYN_LENGTH$2 ]) {
|
|
2321
|
-
return result;
|
|
2322
|
-
}
|
|
2323
|
-
}
|
|
2324
|
-
}
|
|
2325
|
-
catch (e) {
|
|
2326
|
-
_throwInternal(diagLog, 1 , 43 , "Cannot parse the response. " + getExceptionName(e), {
|
|
2327
|
-
response: response
|
|
2328
|
-
});
|
|
2329
|
-
}
|
|
2330
|
-
return null;
|
|
2331
|
-
}
|
|
2332
1938
|
var strDisabledPropertyName = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation";
|
|
2333
1939
|
var strWithCredentials = "withCredentials";
|
|
2334
1940
|
var strTimeout = "timeout";
|
|
@@ -2405,6 +2011,145 @@ function _getAllResponseHeaders(xhr, isOneDs) {
|
|
|
2405
2011
|
return theHeaders;
|
|
2406
2012
|
}
|
|
2407
2013
|
|
|
2014
|
+
var strDocumentMode = "documentMode";
|
|
2015
|
+
var strLocation = "location";
|
|
2016
|
+
var strConsole = "console";
|
|
2017
|
+
var strJSON = "JSON";
|
|
2018
|
+
var strCrypto = "crypto";
|
|
2019
|
+
var strMsCrypto = "msCrypto";
|
|
2020
|
+
var strMsie = "msie";
|
|
2021
|
+
var strTrident = "trident/";
|
|
2022
|
+
var strXMLHttpRequest = "XMLHttpRequest";
|
|
2023
|
+
var _isTrident = null;
|
|
2024
|
+
var _navUserAgentCheck = null;
|
|
2025
|
+
var _enableMocks = false;
|
|
2026
|
+
var _useXDomainRequest = null;
|
|
2027
|
+
var _beaconsSupported = null;
|
|
2028
|
+
function _hasProperty(theClass, property) {
|
|
2029
|
+
var supported = false;
|
|
2030
|
+
if (theClass) {
|
|
2031
|
+
try {
|
|
2032
|
+
supported = property in theClass;
|
|
2033
|
+
if (!supported) {
|
|
2034
|
+
var proto = theClass[strShimPrototype];
|
|
2035
|
+
if (proto) {
|
|
2036
|
+
supported = property in proto;
|
|
2037
|
+
}
|
|
2038
|
+
}
|
|
2039
|
+
}
|
|
2040
|
+
catch (e) {
|
|
2041
|
+
}
|
|
2042
|
+
if (!supported) {
|
|
2043
|
+
try {
|
|
2044
|
+
var tmp = new theClass();
|
|
2045
|
+
supported = !isUndefined(tmp[property]);
|
|
2046
|
+
}
|
|
2047
|
+
catch (e) {
|
|
2048
|
+
}
|
|
2049
|
+
}
|
|
2050
|
+
}
|
|
2051
|
+
return supported;
|
|
2052
|
+
}
|
|
2053
|
+
function getLocation(checkForMock) {
|
|
2054
|
+
if (checkForMock && _enableMocks) {
|
|
2055
|
+
var mockLocation = getInst("__mockLocation");
|
|
2056
|
+
if (mockLocation) {
|
|
2057
|
+
return mockLocation;
|
|
2058
|
+
}
|
|
2059
|
+
}
|
|
2060
|
+
if (typeof location === strShimObject && location) {
|
|
2061
|
+
return location;
|
|
2062
|
+
}
|
|
2063
|
+
return getInst(strLocation);
|
|
2064
|
+
}
|
|
2065
|
+
function getConsole() {
|
|
2066
|
+
if (typeof console !== strShimUndefined) {
|
|
2067
|
+
return console;
|
|
2068
|
+
}
|
|
2069
|
+
return getInst(strConsole);
|
|
2070
|
+
}
|
|
2071
|
+
function hasJSON() {
|
|
2072
|
+
return Boolean((typeof JSON === strShimObject && JSON) || getInst(strJSON) !== null);
|
|
2073
|
+
}
|
|
2074
|
+
function getJSON() {
|
|
2075
|
+
if (hasJSON()) {
|
|
2076
|
+
return JSON || getInst(strJSON);
|
|
2077
|
+
}
|
|
2078
|
+
return null;
|
|
2079
|
+
}
|
|
2080
|
+
function getCrypto() {
|
|
2081
|
+
return getInst(strCrypto);
|
|
2082
|
+
}
|
|
2083
|
+
function getMsCrypto() {
|
|
2084
|
+
return getInst(strMsCrypto);
|
|
2085
|
+
}
|
|
2086
|
+
function isIE() {
|
|
2087
|
+
var nav = getNavigator();
|
|
2088
|
+
if (nav && (nav[_DYN_USER_AGENT ] !== _navUserAgentCheck || _isTrident === null)) {
|
|
2089
|
+
_navUserAgentCheck = nav[_DYN_USER_AGENT ];
|
|
2090
|
+
var userAgent = (_navUserAgentCheck || STR_EMPTY$1)[_DYN_TO_LOWER_CASE$1 ]();
|
|
2091
|
+
_isTrident = (strContains(userAgent, strMsie) || strContains(userAgent, strTrident));
|
|
2092
|
+
}
|
|
2093
|
+
return _isTrident;
|
|
2094
|
+
}
|
|
2095
|
+
function getIEVersion(userAgentStr) {
|
|
2096
|
+
if (userAgentStr === void 0) { userAgentStr = null; }
|
|
2097
|
+
if (!userAgentStr) {
|
|
2098
|
+
var navigator_1 = getNavigator() || {};
|
|
2099
|
+
userAgentStr = navigator_1 ? (navigator_1.userAgent || STR_EMPTY$1)[_DYN_TO_LOWER_CASE$1 ]() : STR_EMPTY$1;
|
|
2100
|
+
}
|
|
2101
|
+
var ua = (userAgentStr || STR_EMPTY$1)[_DYN_TO_LOWER_CASE$1 ]();
|
|
2102
|
+
if (strContains(ua, strMsie)) {
|
|
2103
|
+
var doc = getDocument() || {};
|
|
2104
|
+
return Math.max(parseInt(ua[_DYN_SPLIT$1 ](strMsie)[1]), (doc[strDocumentMode] || 0));
|
|
2105
|
+
}
|
|
2106
|
+
else if (strContains(ua, strTrident)) {
|
|
2107
|
+
var tridentVer = parseInt(ua[_DYN_SPLIT$1 ](strTrident)[1]);
|
|
2108
|
+
if (tridentVer) {
|
|
2109
|
+
return tridentVer + 4;
|
|
2110
|
+
}
|
|
2111
|
+
}
|
|
2112
|
+
return null;
|
|
2113
|
+
}
|
|
2114
|
+
function isBeaconsSupported(useCached) {
|
|
2115
|
+
if (_beaconsSupported === null || useCached === false) {
|
|
2116
|
+
_beaconsSupported = hasNavigator() && Boolean(getNavigator().sendBeacon);
|
|
2117
|
+
}
|
|
2118
|
+
return _beaconsSupported;
|
|
2119
|
+
}
|
|
2120
|
+
function isFetchSupported(withKeepAlive) {
|
|
2121
|
+
var isSupported = false;
|
|
2122
|
+
try {
|
|
2123
|
+
isSupported = !!getInst("fetch");
|
|
2124
|
+
var request = getInst("Request");
|
|
2125
|
+
if (isSupported && withKeepAlive && request) {
|
|
2126
|
+
isSupported = _hasProperty(request, "keepalive");
|
|
2127
|
+
}
|
|
2128
|
+
}
|
|
2129
|
+
catch (e) {
|
|
2130
|
+
}
|
|
2131
|
+
return isSupported;
|
|
2132
|
+
}
|
|
2133
|
+
function useXDomainRequest() {
|
|
2134
|
+
if (_useXDomainRequest === null) {
|
|
2135
|
+
_useXDomainRequest = (typeof XDomainRequest !== strShimUndefined);
|
|
2136
|
+
if (_useXDomainRequest && isXhrSupported()) {
|
|
2137
|
+
_useXDomainRequest = _useXDomainRequest && !_hasProperty(getInst(strXMLHttpRequest), "withCredentials");
|
|
2138
|
+
}
|
|
2139
|
+
}
|
|
2140
|
+
return _useXDomainRequest;
|
|
2141
|
+
}
|
|
2142
|
+
function isXhrSupported() {
|
|
2143
|
+
var isSupported = false;
|
|
2144
|
+
try {
|
|
2145
|
+
var xmlHttpRequest = getInst(strXMLHttpRequest);
|
|
2146
|
+
isSupported = !!xmlHttpRequest;
|
|
2147
|
+
}
|
|
2148
|
+
catch (e) {
|
|
2149
|
+
}
|
|
2150
|
+
return isSupported;
|
|
2151
|
+
}
|
|
2152
|
+
|
|
2408
2153
|
var UInt32Mask = 0x100000000;
|
|
2409
2154
|
var MaxUInt32 = 0xffffffff;
|
|
2410
2155
|
var SEED1 = 123456789;
|
|
@@ -3034,6 +2779,7 @@ function _createAndUseHandler(state, configHandler) {
|
|
|
3034
2779
|
configHandler = null;
|
|
3035
2780
|
}
|
|
3036
2781
|
};
|
|
2782
|
+
objDefine(handler, "toJSON", { v: function () { return "WatcherHandler" + (handler.fn ? "" : "[X]"); } });
|
|
3037
2783
|
state.use(handler, configHandler);
|
|
3038
2784
|
return handler;
|
|
3039
2785
|
}
|
|
@@ -3140,64 +2886,288 @@ function onConfigChange(config, configHandler, logger) {
|
|
|
3140
2886
|
if (handler.cfg && (handler.cfg === config || handler.cfg[CFG_HANDLER_LINK] === handler)) {
|
|
3141
2887
|
return handler[_DYN_WATCH ](configHandler);
|
|
3142
2888
|
}
|
|
3143
|
-
_logInvalidAccess(logger, STR_NOT_DYNAMIC_ERROR + dumpObj(config));
|
|
3144
|
-
return createDynamicConfig(config, null, logger)[_DYN_WATCH ](configHandler);
|
|
2889
|
+
_logInvalidAccess(logger, STR_NOT_DYNAMIC_ERROR + dumpObj(config));
|
|
2890
|
+
return createDynamicConfig(config, null, logger)[_DYN_WATCH ](configHandler);
|
|
2891
|
+
}
|
|
2892
|
+
|
|
2893
|
+
function runTargetUnload(target, isAsync) {
|
|
2894
|
+
if (target && target[_DYN_UNLOAD ]) {
|
|
2895
|
+
return target[_DYN_UNLOAD ](isAsync);
|
|
2896
|
+
}
|
|
2897
|
+
}
|
|
2898
|
+
function doUnloadAll(targets, isAsync, done) {
|
|
2899
|
+
var result;
|
|
2900
|
+
if (!done) {
|
|
2901
|
+
result = createPromise(function (resolved) {
|
|
2902
|
+
done = resolved;
|
|
2903
|
+
});
|
|
2904
|
+
}
|
|
2905
|
+
if (targets && getLength(targets) > 0) {
|
|
2906
|
+
doAwaitResponse(runTargetUnload(targets[0], isAsync), function () {
|
|
2907
|
+
doUnloadAll(arrSlice(targets, 1), isAsync, done);
|
|
2908
|
+
});
|
|
2909
|
+
}
|
|
2910
|
+
else {
|
|
2911
|
+
done();
|
|
2912
|
+
}
|
|
2913
|
+
return result;
|
|
2914
|
+
}
|
|
2915
|
+
|
|
2916
|
+
var ChannelControllerPriority = 500;
|
|
2917
|
+
var DisabledPropertyName = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation";
|
|
2918
|
+
|
|
2919
|
+
function _stringToBoolOrDefault(theValue, defaultValue, theConfig) {
|
|
2920
|
+
if (!theValue && isNullOrUndefined(theValue)) {
|
|
2921
|
+
return defaultValue;
|
|
2922
|
+
}
|
|
2923
|
+
if (isBoolean(theValue)) {
|
|
2924
|
+
return theValue;
|
|
2925
|
+
}
|
|
2926
|
+
return asString(theValue)[_DYN_TO_LOWER_CASE$1 ]() === "true";
|
|
2927
|
+
}
|
|
2928
|
+
function cfgDfMerge(defaultValue) {
|
|
2929
|
+
return {
|
|
2930
|
+
mrg: true,
|
|
2931
|
+
v: defaultValue
|
|
2932
|
+
};
|
|
2933
|
+
}
|
|
2934
|
+
function cfgDfValidate(validator, defaultValue, fallBackName) {
|
|
2935
|
+
return {
|
|
2936
|
+
fb: fallBackName,
|
|
2937
|
+
isVal: validator,
|
|
2938
|
+
v: defaultValue
|
|
2939
|
+
};
|
|
2940
|
+
}
|
|
2941
|
+
function cfgDfBoolean(defaultValue, fallBackName) {
|
|
2942
|
+
return {
|
|
2943
|
+
fb: fallBackName,
|
|
2944
|
+
set: _stringToBoolOrDefault,
|
|
2945
|
+
v: !!defaultValue
|
|
2946
|
+
};
|
|
2947
|
+
}
|
|
2948
|
+
|
|
2949
|
+
var listenerFuncs = [STR_EVENTS_SENT, STR_EVENTS_DISCARDED, STR_EVENTS_SEND_REQUEST, STR_PERF_EVENT];
|
|
2950
|
+
var _aiNamespace = null;
|
|
2951
|
+
var _debugListener;
|
|
2952
|
+
function _listenerProxyFunc(name, config) {
|
|
2953
|
+
return function () {
|
|
2954
|
+
var args = arguments;
|
|
2955
|
+
var dbgExt = getDebugExt(config);
|
|
2956
|
+
if (dbgExt) {
|
|
2957
|
+
var listener = dbgExt.listener;
|
|
2958
|
+
if (listener && listener[name]) {
|
|
2959
|
+
listener[name][_DYN_APPLY ](listener, args);
|
|
2960
|
+
}
|
|
2961
|
+
}
|
|
2962
|
+
};
|
|
2963
|
+
}
|
|
2964
|
+
function _getExtensionNamespace() {
|
|
2965
|
+
var target = getInst("Microsoft");
|
|
2966
|
+
if (target) {
|
|
2967
|
+
_aiNamespace = target["ApplicationInsights"];
|
|
2968
|
+
}
|
|
2969
|
+
return _aiNamespace;
|
|
2970
|
+
}
|
|
2971
|
+
function getDebugExt(config) {
|
|
2972
|
+
var ns = _aiNamespace;
|
|
2973
|
+
if (!ns && config.disableDbgExt !== true) {
|
|
2974
|
+
ns = _aiNamespace || _getExtensionNamespace();
|
|
2975
|
+
}
|
|
2976
|
+
return ns ? ns["ChromeDbgExt"] : null;
|
|
2977
|
+
}
|
|
2978
|
+
function getDebugListener(config) {
|
|
2979
|
+
if (!_debugListener) {
|
|
2980
|
+
_debugListener = {};
|
|
2981
|
+
for (var lp = 0; lp < listenerFuncs[_DYN_LENGTH$2 ]; lp++) {
|
|
2982
|
+
_debugListener[listenerFuncs[lp]] = _listenerProxyFunc(listenerFuncs[lp], config);
|
|
2983
|
+
}
|
|
2984
|
+
}
|
|
2985
|
+
return _debugListener;
|
|
2986
|
+
}
|
|
2987
|
+
|
|
2988
|
+
var _a$4;
|
|
2989
|
+
var STR_WARN_TO_CONSOLE = "warnToConsole";
|
|
2990
|
+
var AiNonUserActionablePrefix = "AI (Internal): ";
|
|
2991
|
+
var AiUserActionablePrefix = "AI: ";
|
|
2992
|
+
var AIInternalMessagePrefix = "AITR_";
|
|
2993
|
+
var defaultValues$2 = {
|
|
2994
|
+
loggingLevelConsole: 0,
|
|
2995
|
+
loggingLevelTelemetry: 1,
|
|
2996
|
+
maxMessageLimit: 25,
|
|
2997
|
+
enableDebug: false
|
|
2998
|
+
};
|
|
2999
|
+
var _logFuncs = (_a$4 = {},
|
|
3000
|
+
_a$4[0 ] = null,
|
|
3001
|
+
_a$4[1 ] = "errorToConsole",
|
|
3002
|
+
_a$4[2 ] = STR_WARN_TO_CONSOLE,
|
|
3003
|
+
_a$4[3 ] = "debugToConsole",
|
|
3004
|
+
_a$4);
|
|
3005
|
+
function _sanitizeDiagnosticText(text) {
|
|
3006
|
+
if (text) {
|
|
3007
|
+
return "\"" + text[_DYN_REPLACE ](/\"/g, STR_EMPTY$1) + "\"";
|
|
3008
|
+
}
|
|
3009
|
+
return STR_EMPTY$1;
|
|
3145
3010
|
}
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
if (
|
|
3149
|
-
|
|
3011
|
+
function _logToConsole(func, message) {
|
|
3012
|
+
var theConsole = getConsole();
|
|
3013
|
+
if (!!theConsole) {
|
|
3014
|
+
var logFunc = "log";
|
|
3015
|
+
if (theConsole[func]) {
|
|
3016
|
+
logFunc = func;
|
|
3017
|
+
}
|
|
3018
|
+
if (isFunction(theConsole[logFunc])) {
|
|
3019
|
+
theConsole[logFunc](message);
|
|
3020
|
+
}
|
|
3150
3021
|
}
|
|
3151
3022
|
}
|
|
3152
|
-
function
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3023
|
+
var _InternalLogMessage = /** @class */ (function () {
|
|
3024
|
+
function _InternalLogMessage(msgId, msg, isUserAct, properties) {
|
|
3025
|
+
if (isUserAct === void 0) { isUserAct = false; }
|
|
3026
|
+
var _self = this;
|
|
3027
|
+
_self[_DYN_MESSAGE_ID ] = msgId;
|
|
3028
|
+
_self[_DYN_MESSAGE$1 ] =
|
|
3029
|
+
(isUserAct ? AiUserActionablePrefix : AiNonUserActionablePrefix) +
|
|
3030
|
+
msgId;
|
|
3031
|
+
var strProps = STR_EMPTY$1;
|
|
3032
|
+
if (hasJSON()) {
|
|
3033
|
+
strProps = getJSON().stringify(properties);
|
|
3034
|
+
}
|
|
3035
|
+
var diagnosticText = (msg ? " message:" + _sanitizeDiagnosticText(msg) : STR_EMPTY$1) +
|
|
3036
|
+
(properties ? " props:" + _sanitizeDiagnosticText(strProps) : STR_EMPTY$1);
|
|
3037
|
+
_self[_DYN_MESSAGE$1 ] += diagnosticText;
|
|
3166
3038
|
}
|
|
3167
|
-
|
|
3039
|
+
_InternalLogMessage.dataType = "MessageData";
|
|
3040
|
+
return _InternalLogMessage;
|
|
3041
|
+
}());
|
|
3042
|
+
function safeGetLogger(core, config) {
|
|
3043
|
+
return (core || {})[_DYN_LOGGER ] || new DiagnosticLogger(config);
|
|
3168
3044
|
}
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3045
|
+
var DiagnosticLogger = /** @class */ (function () {
|
|
3046
|
+
function DiagnosticLogger(config) {
|
|
3047
|
+
this.identifier = "DiagnosticLogger";
|
|
3048
|
+
this.queue = [];
|
|
3049
|
+
var _messageCount = 0;
|
|
3050
|
+
var _messageLogged = {};
|
|
3051
|
+
var _loggingLevelConsole;
|
|
3052
|
+
var _loggingLevelTelemetry;
|
|
3053
|
+
var _maxInternalMessageLimit;
|
|
3054
|
+
var _enableDebug;
|
|
3055
|
+
var _unloadHandler;
|
|
3056
|
+
dynamicProto(DiagnosticLogger, this, function (_self) {
|
|
3057
|
+
_unloadHandler = _setDefaultsFromConfig(config || {});
|
|
3058
|
+
_self.consoleLoggingLevel = function () { return _loggingLevelConsole; };
|
|
3059
|
+
_self[_DYN_THROW_INTERNAL ] = function (severity, msgId, msg, properties, isUserAct) {
|
|
3060
|
+
if (isUserAct === void 0) { isUserAct = false; }
|
|
3061
|
+
var message = new _InternalLogMessage(msgId, msg, isUserAct, properties);
|
|
3062
|
+
if (_enableDebug) {
|
|
3063
|
+
throw dumpObj(message);
|
|
3064
|
+
}
|
|
3065
|
+
else {
|
|
3066
|
+
var logFunc = _logFuncs[severity] || STR_WARN_TO_CONSOLE;
|
|
3067
|
+
if (!isUndefined(message[_DYN_MESSAGE$1 ])) {
|
|
3068
|
+
if (isUserAct) {
|
|
3069
|
+
var messageKey = +message[_DYN_MESSAGE_ID ];
|
|
3070
|
+
if (!_messageLogged[messageKey] && _loggingLevelConsole >= severity) {
|
|
3071
|
+
_self[logFunc](message[_DYN_MESSAGE$1 ]);
|
|
3072
|
+
_messageLogged[messageKey] = true;
|
|
3073
|
+
}
|
|
3074
|
+
}
|
|
3075
|
+
else {
|
|
3076
|
+
if (_loggingLevelConsole >= severity) {
|
|
3077
|
+
_self[logFunc](message[_DYN_MESSAGE$1 ]);
|
|
3078
|
+
}
|
|
3079
|
+
}
|
|
3080
|
+
_logInternalMessage(severity, message);
|
|
3081
|
+
}
|
|
3082
|
+
else {
|
|
3083
|
+
_debugExtMsg("throw" + (severity === 1 ? "Critical" : "Warning"), message);
|
|
3084
|
+
}
|
|
3085
|
+
}
|
|
3086
|
+
};
|
|
3087
|
+
_self.debugToConsole = function (message) {
|
|
3088
|
+
_logToConsole("debug", message);
|
|
3089
|
+
_debugExtMsg("warning", message);
|
|
3090
|
+
};
|
|
3091
|
+
_self[_DYN_WARN_TO_CONSOLE ] = function (message) {
|
|
3092
|
+
_logToConsole("warn", message);
|
|
3093
|
+
_debugExtMsg("warning", message);
|
|
3094
|
+
};
|
|
3095
|
+
_self.errorToConsole = function (message) {
|
|
3096
|
+
_logToConsole("error", message);
|
|
3097
|
+
_debugExtMsg("error", message);
|
|
3098
|
+
};
|
|
3099
|
+
_self.resetInternalMessageCount = function () {
|
|
3100
|
+
_messageCount = 0;
|
|
3101
|
+
_messageLogged = {};
|
|
3102
|
+
};
|
|
3103
|
+
_self[_DYN_LOG_INTERNAL_MESSAGE ] = _logInternalMessage;
|
|
3104
|
+
_self[_DYN_UNLOAD ] = function (isAsync) {
|
|
3105
|
+
_unloadHandler && _unloadHandler.rm();
|
|
3106
|
+
_unloadHandler = null;
|
|
3107
|
+
};
|
|
3108
|
+
function _logInternalMessage(severity, message) {
|
|
3109
|
+
if (_areInternalMessagesThrottled()) {
|
|
3110
|
+
return;
|
|
3111
|
+
}
|
|
3112
|
+
var logMessage = true;
|
|
3113
|
+
var messageKey = AIInternalMessagePrefix + message[_DYN_MESSAGE_ID ];
|
|
3114
|
+
if (_messageLogged[messageKey]) {
|
|
3115
|
+
logMessage = false;
|
|
3116
|
+
}
|
|
3117
|
+
else {
|
|
3118
|
+
_messageLogged[messageKey] = true;
|
|
3119
|
+
}
|
|
3120
|
+
if (logMessage) {
|
|
3121
|
+
if (severity <= _loggingLevelTelemetry) {
|
|
3122
|
+
_self.queue[_DYN_PUSH$2 ](message);
|
|
3123
|
+
_messageCount++;
|
|
3124
|
+
_debugExtMsg((severity === 1 ? "error" : "warn"), message);
|
|
3125
|
+
}
|
|
3126
|
+
if (_messageCount === _maxInternalMessageLimit) {
|
|
3127
|
+
var throttleLimitMessage = "Internal events throttle limit per PageView reached for this app.";
|
|
3128
|
+
var throttleMessage = new _InternalLogMessage(23 , throttleLimitMessage, false);
|
|
3129
|
+
_self.queue[_DYN_PUSH$2 ](throttleMessage);
|
|
3130
|
+
if (severity === 1 ) {
|
|
3131
|
+
_self.errorToConsole(throttleLimitMessage);
|
|
3132
|
+
}
|
|
3133
|
+
else {
|
|
3134
|
+
_self[_DYN_WARN_TO_CONSOLE ](throttleLimitMessage);
|
|
3135
|
+
}
|
|
3136
|
+
}
|
|
3137
|
+
}
|
|
3138
|
+
}
|
|
3139
|
+
function _setDefaultsFromConfig(config) {
|
|
3140
|
+
return onConfigChange(createDynamicConfig(config, defaultValues$2, _self).cfg, function (details) {
|
|
3141
|
+
var config = details.cfg;
|
|
3142
|
+
_loggingLevelConsole = config[_DYN_LOGGING_LEVEL_CONSOL4 ];
|
|
3143
|
+
_loggingLevelTelemetry = config.loggingLevelTelemetry;
|
|
3144
|
+
_maxInternalMessageLimit = config.maxMessageLimit;
|
|
3145
|
+
_enableDebug = config.enableDebug;
|
|
3146
|
+
});
|
|
3147
|
+
}
|
|
3148
|
+
function _areInternalMessagesThrottled() {
|
|
3149
|
+
return _messageCount >= _maxInternalMessageLimit;
|
|
3150
|
+
}
|
|
3151
|
+
function _debugExtMsg(name, data) {
|
|
3152
|
+
var dbgExt = getDebugExt(config || {});
|
|
3153
|
+
if (dbgExt && dbgExt[_DYN_DIAG_LOG$1 ]) {
|
|
3154
|
+
dbgExt[_DYN_DIAG_LOG$1 ](name, data);
|
|
3155
|
+
}
|
|
3156
|
+
}
|
|
3157
|
+
});
|
|
3179
3158
|
}
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
v: defaultValue
|
|
3186
|
-
};
|
|
3159
|
+
DiagnosticLogger.__ieDyn=1;
|
|
3160
|
+
return DiagnosticLogger;
|
|
3161
|
+
}());
|
|
3162
|
+
function _getLogger(logger) {
|
|
3163
|
+
return (logger || new DiagnosticLogger());
|
|
3187
3164
|
}
|
|
3188
|
-
function
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
isVal: validator,
|
|
3192
|
-
v: defaultValue
|
|
3193
|
-
};
|
|
3165
|
+
function _throwInternal(logger, severity, msgId, msg, properties, isUserAct) {
|
|
3166
|
+
if (isUserAct === void 0) { isUserAct = false; }
|
|
3167
|
+
_getLogger(logger)[_DYN_THROW_INTERNAL ](severity, msgId, msg, properties, isUserAct);
|
|
3194
3168
|
}
|
|
3195
|
-
function
|
|
3196
|
-
|
|
3197
|
-
fb: fallBackName,
|
|
3198
|
-
set: _stringToBoolOrDefault,
|
|
3199
|
-
v: !!defaultValue
|
|
3200
|
-
};
|
|
3169
|
+
function _warnToConsole(logger, message) {
|
|
3170
|
+
_getLogger(logger)[_DYN_WARN_TO_CONSOLE ](message);
|
|
3201
3171
|
}
|
|
3202
3172
|
|
|
3203
3173
|
var _a$3, _b$1;
|
|
@@ -3472,18 +3442,26 @@ function uaDisallowsSameSiteNone(userAgent) {
|
|
|
3472
3442
|
var defaultValues$1 = {
|
|
3473
3443
|
perfEvtsSendAll: false
|
|
3474
3444
|
};
|
|
3475
|
-
function
|
|
3445
|
+
function _runScheduledListeners(asyncNotifications) {
|
|
3446
|
+
asyncNotifications.h = null;
|
|
3447
|
+
var callbacks = asyncNotifications.cb;
|
|
3448
|
+
asyncNotifications.cb = [];
|
|
3449
|
+
arrForEach(callbacks, function (cb) {
|
|
3450
|
+
safe(cb.fn, [cb.arg]);
|
|
3451
|
+
});
|
|
3452
|
+
}
|
|
3453
|
+
function _runListeners(listeners, name, asyncNotifications, callback) {
|
|
3476
3454
|
arrForEach(listeners, function (listener) {
|
|
3477
3455
|
if (listener && listener[name]) {
|
|
3478
|
-
if (
|
|
3479
|
-
|
|
3456
|
+
if (asyncNotifications) {
|
|
3457
|
+
asyncNotifications.cb[_DYN_PUSH$2 ]({
|
|
3458
|
+
fn: callback,
|
|
3459
|
+
arg: listener
|
|
3460
|
+
});
|
|
3461
|
+
asyncNotifications.h = asyncNotifications.h || scheduleTimeout(_runScheduledListeners, 0, asyncNotifications);
|
|
3480
3462
|
}
|
|
3481
3463
|
else {
|
|
3482
|
-
|
|
3483
|
-
callback(listener);
|
|
3484
|
-
}
|
|
3485
|
-
catch (e) {
|
|
3486
|
-
}
|
|
3464
|
+
safe(callback, [listener]);
|
|
3487
3465
|
}
|
|
3488
3466
|
}
|
|
3489
3467
|
});
|
|
@@ -3494,6 +3472,10 @@ var NotificationManager = /** @class */ (function () {
|
|
|
3494
3472
|
var perfEvtsSendAll;
|
|
3495
3473
|
var unloadHandler;
|
|
3496
3474
|
var _listeners = [];
|
|
3475
|
+
var _asyncNotifications = {
|
|
3476
|
+
h: null,
|
|
3477
|
+
cb: []
|
|
3478
|
+
};
|
|
3497
3479
|
var cfgHandler = createDynamicConfig(config, defaultValues$1);
|
|
3498
3480
|
unloadHandler = cfgHandler[_DYN_WATCH ](function (details) {
|
|
3499
3481
|
perfEvtsSendAll = !!details.cfg.perfEvtsSendAll;
|
|
@@ -3505,7 +3487,7 @@ var NotificationManager = /** @class */ (function () {
|
|
|
3505
3487
|
_self[_DYN_ADD_NOTIFICATION_LIS1 ] = function (listener) {
|
|
3506
3488
|
_listeners[_DYN_PUSH$2 ](listener);
|
|
3507
3489
|
};
|
|
3508
|
-
_self[
|
|
3490
|
+
_self[_DYN_REMOVE_NOTIFICATION_0 ] = function (listener) {
|
|
3509
3491
|
var index = arrIndexOf(_listeners, listener);
|
|
3510
3492
|
while (index > -1) {
|
|
3511
3493
|
_listeners[_DYN_SPLICE ](index, 1);
|
|
@@ -3513,24 +3495,24 @@ var NotificationManager = /** @class */ (function () {
|
|
|
3513
3495
|
}
|
|
3514
3496
|
};
|
|
3515
3497
|
_self[STR_EVENTS_SENT ] = function (events) {
|
|
3516
|
-
_runListeners(_listeners, STR_EVENTS_SENT,
|
|
3498
|
+
_runListeners(_listeners, STR_EVENTS_SENT, _asyncNotifications, function (listener) {
|
|
3517
3499
|
listener[STR_EVENTS_SENT ](events);
|
|
3518
3500
|
});
|
|
3519
3501
|
};
|
|
3520
3502
|
_self[STR_EVENTS_DISCARDED ] = function (events, reason) {
|
|
3521
|
-
_runListeners(_listeners, STR_EVENTS_DISCARDED,
|
|
3503
|
+
_runListeners(_listeners, STR_EVENTS_DISCARDED, _asyncNotifications, function (listener) {
|
|
3522
3504
|
listener[STR_EVENTS_DISCARDED ](events, reason);
|
|
3523
3505
|
});
|
|
3524
3506
|
};
|
|
3525
3507
|
_self[STR_EVENTS_SEND_REQUEST ] = function (sendReason, isAsync) {
|
|
3526
|
-
_runListeners(_listeners, STR_EVENTS_SEND_REQUEST, isAsync, function (listener) {
|
|
3508
|
+
_runListeners(_listeners, STR_EVENTS_SEND_REQUEST, isAsync ? _asyncNotifications : null, function (listener) {
|
|
3527
3509
|
listener[STR_EVENTS_SEND_REQUEST ](sendReason, isAsync);
|
|
3528
3510
|
});
|
|
3529
3511
|
};
|
|
3530
3512
|
_self[STR_PERF_EVENT ] = function (perfEvent) {
|
|
3531
3513
|
if (perfEvent) {
|
|
3532
3514
|
if (perfEvtsSendAll || !perfEvent[_DYN_IS_CHILD_EVT ]()) {
|
|
3533
|
-
_runListeners(_listeners, STR_PERF_EVENT,
|
|
3515
|
+
_runListeners(_listeners, STR_PERF_EVENT, null, function (listener) {
|
|
3534
3516
|
if (perfEvent[_DYN_IS_ASYNC ]) {
|
|
3535
3517
|
scheduleTimeout(function () { return listener[STR_PERF_EVENT ](perfEvent); }, 0);
|
|
3536
3518
|
}
|
|
@@ -3543,14 +3525,14 @@ var NotificationManager = /** @class */ (function () {
|
|
|
3543
3525
|
};
|
|
3544
3526
|
_self[STR_OFFLINE_STORE ] = function (events) {
|
|
3545
3527
|
if (events && events[_DYN_LENGTH$2 ]) {
|
|
3546
|
-
_runListeners(_listeners, STR_OFFLINE_STORE,
|
|
3528
|
+
_runListeners(_listeners, STR_OFFLINE_STORE, _asyncNotifications, function (listener) {
|
|
3547
3529
|
listener[STR_OFFLINE_STORE ](events);
|
|
3548
3530
|
});
|
|
3549
3531
|
}
|
|
3550
3532
|
};
|
|
3551
3533
|
_self[STR_OFFLINE_SENT ] = function (batch) {
|
|
3552
3534
|
if (batch && batch[_DYN_DATA$1 ]) {
|
|
3553
|
-
_runListeners(_listeners, STR_OFFLINE_SENT,
|
|
3535
|
+
_runListeners(_listeners, STR_OFFLINE_SENT, _asyncNotifications, function (listener) {
|
|
3554
3536
|
listener[STR_OFFLINE_SENT ](batch);
|
|
3555
3537
|
});
|
|
3556
3538
|
}
|
|
@@ -3558,7 +3540,7 @@ var NotificationManager = /** @class */ (function () {
|
|
|
3558
3540
|
_self[STR_OFFLINE_DROP ] = function (cnt, reason) {
|
|
3559
3541
|
if (cnt > 0) {
|
|
3560
3542
|
var rn_1 = reason || 0;
|
|
3561
|
-
_runListeners(_listeners, STR_OFFLINE_DROP,
|
|
3543
|
+
_runListeners(_listeners, STR_OFFLINE_DROP, _asyncNotifications, function (listener) {
|
|
3562
3544
|
listener[STR_OFFLINE_DROP ](cnt, rn_1);
|
|
3563
3545
|
});
|
|
3564
3546
|
}
|
|
@@ -3568,9 +3550,12 @@ var NotificationManager = /** @class */ (function () {
|
|
|
3568
3550
|
unloadHandler && unloadHandler.rm();
|
|
3569
3551
|
unloadHandler = null;
|
|
3570
3552
|
_listeners = [];
|
|
3553
|
+
_asyncNotifications.h && _asyncNotifications.h[_DYN_CANCEL ]();
|
|
3554
|
+
_asyncNotifications.h = null;
|
|
3555
|
+
_asyncNotifications.cb = [];
|
|
3571
3556
|
};
|
|
3572
3557
|
var waiting;
|
|
3573
|
-
_runListeners(_listeners, "unload",
|
|
3558
|
+
_runListeners(_listeners, "unload", null, function (listener) {
|
|
3574
3559
|
var asyncUnload = listener[_DYN_UNLOAD ](isAsync);
|
|
3575
3560
|
if (asyncUnload) {
|
|
3576
3561
|
if (!waiting) {
|
|
@@ -4379,7 +4364,7 @@ var BaseTelemetryPlugin = /** @class */ (function () {
|
|
|
4379
4364
|
function _setDefaults(config, core, pluginChain) {
|
|
4380
4365
|
createDynamicConfig(config, defaultValues, safeGetLogger(core));
|
|
4381
4366
|
if (!pluginChain && core) {
|
|
4382
|
-
pluginChain = core[
|
|
4367
|
+
pluginChain = core[_DYN_GET_PROCESS_TEL_CONT2 ]()[_DYN_GET_NEXT ]();
|
|
4383
4368
|
}
|
|
4384
4369
|
var nextPlugin = _nextPlugin;
|
|
4385
4370
|
if (_nextPlugin && _nextPlugin[strGetPlugin]) {
|
|
@@ -4583,6 +4568,27 @@ function _registerDelayedCfgListener(config, listeners, logger) {
|
|
|
4583
4568
|
};
|
|
4584
4569
|
});
|
|
4585
4570
|
}
|
|
4571
|
+
function _initDebugListener(configHandler, unloadContainer, notificationManager, debugListener) {
|
|
4572
|
+
unloadContainer.add(configHandler[_DYN_WATCH ](function (details) {
|
|
4573
|
+
var disableDbgExt = details.cfg.disableDbgExt;
|
|
4574
|
+
if (disableDbgExt === true && debugListener) {
|
|
4575
|
+
notificationManager[_DYN_REMOVE_NOTIFICATION_0 ](debugListener);
|
|
4576
|
+
debugListener = null;
|
|
4577
|
+
}
|
|
4578
|
+
if (notificationManager && !debugListener && disableDbgExt !== true) {
|
|
4579
|
+
debugListener = getDebugListener(details.cfg);
|
|
4580
|
+
notificationManager[_DYN_ADD_NOTIFICATION_LIS1 ](debugListener);
|
|
4581
|
+
}
|
|
4582
|
+
}));
|
|
4583
|
+
return debugListener;
|
|
4584
|
+
}
|
|
4585
|
+
function _createUnloadHook(unloadHook) {
|
|
4586
|
+
return objDefine({
|
|
4587
|
+
rm: function () {
|
|
4588
|
+
unloadHook.rm();
|
|
4589
|
+
}
|
|
4590
|
+
}, "toJSON", { v: function () { return "aicore::onCfgChange<" + JSON.stringify(unloadHook) + ">"; } });
|
|
4591
|
+
}
|
|
4586
4592
|
var AppInsightsCore = /** @class */ (function () {
|
|
4587
4593
|
function AppInsightsCore() {
|
|
4588
4594
|
var _configHandler;
|
|
@@ -4639,7 +4645,7 @@ var AppInsightsCore = /** @class */ (function () {
|
|
|
4639
4645
|
}
|
|
4640
4646
|
}));
|
|
4641
4647
|
_notificationManager = notificationManager;
|
|
4642
|
-
_initDebugListener();
|
|
4648
|
+
_debugListener = _initDebugListener(_configHandler, _hookContainer, _notificationManager && _self[_DYN_GET_NOTIFY_MGR ](), _debugListener);
|
|
4643
4649
|
_initPerfManager();
|
|
4644
4650
|
_self[_DYN_LOGGER ] = logger;
|
|
4645
4651
|
var cfgExtensions = config[STR_EXTENSIONS ];
|
|
@@ -4692,7 +4698,7 @@ var AppInsightsCore = /** @class */ (function () {
|
|
|
4692
4698
|
}
|
|
4693
4699
|
}, function () { return ({ item: telemetryItem }); }, !(telemetryItem.sync));
|
|
4694
4700
|
};
|
|
4695
|
-
_self[
|
|
4701
|
+
_self[_DYN_GET_PROCESS_TEL_CONT2 ] = _createTelCtx;
|
|
4696
4702
|
_self[_DYN_GET_NOTIFY_MGR ] = function () {
|
|
4697
4703
|
if (!_notificationManager) {
|
|
4698
4704
|
_notificationManager = new NotificationManager(_configHandler.cfg);
|
|
@@ -4701,11 +4707,11 @@ var AppInsightsCore = /** @class */ (function () {
|
|
|
4701
4707
|
return _notificationManager;
|
|
4702
4708
|
};
|
|
4703
4709
|
_self[_DYN_ADD_NOTIFICATION_LIS1 ] = function (listener) {
|
|
4704
|
-
_self
|
|
4710
|
+
_self.getNotifyMgr()[_DYN_ADD_NOTIFICATION_LIS1 ](listener);
|
|
4705
4711
|
};
|
|
4706
|
-
_self[
|
|
4712
|
+
_self[_DYN_REMOVE_NOTIFICATION_0 ] = function (listener) {
|
|
4707
4713
|
if (_notificationManager) {
|
|
4708
|
-
_notificationManager[
|
|
4714
|
+
_notificationManager[_DYN_REMOVE_NOTIFICATION_0 ](listener);
|
|
4709
4715
|
}
|
|
4710
4716
|
};
|
|
4711
4717
|
_self.getCookieMgr = function () {
|
|
@@ -4721,16 +4727,6 @@ var AppInsightsCore = /** @class */ (function () {
|
|
|
4721
4727
|
}
|
|
4722
4728
|
};
|
|
4723
4729
|
_self[STR_GET_PERF_MGR ] = function () {
|
|
4724
|
-
if (!_perfManager && !_cfgPerfManager) {
|
|
4725
|
-
_addUnloadHook(_configHandler[_DYN_WATCH ](function (details) {
|
|
4726
|
-
if (details.cfg.enablePerfMgr) {
|
|
4727
|
-
var createPerfMgr = details.cfg[STR_CREATE_PERF_MGR ];
|
|
4728
|
-
if (isFunction(createPerfMgr)) {
|
|
4729
|
-
_cfgPerfManager = createPerfMgr(_self, _self[_DYN_GET_NOTIFY_MGR ]());
|
|
4730
|
-
}
|
|
4731
|
-
}
|
|
4732
|
-
}));
|
|
4733
|
-
}
|
|
4734
4730
|
return _perfManager || _cfgPerfManager || getGblPerfMgr();
|
|
4735
4731
|
};
|
|
4736
4732
|
_self.setPerfMgr = function (perfMgr) {
|
|
@@ -4925,11 +4921,7 @@ var AppInsightsCore = /** @class */ (function () {
|
|
|
4925
4921
|
else {
|
|
4926
4922
|
unloadHook = onConfigChange(_configHandler.cfg, handler, _self[_DYN_LOGGER ]);
|
|
4927
4923
|
}
|
|
4928
|
-
return
|
|
4929
|
-
rm: function () {
|
|
4930
|
-
unloadHook.rm();
|
|
4931
|
-
}
|
|
4932
|
-
};
|
|
4924
|
+
return _createUnloadHook(unloadHook);
|
|
4933
4925
|
};
|
|
4934
4926
|
_self.getWParam = function () {
|
|
4935
4927
|
return (hasDocument() || !!_configHandler.cfg.enableWParam) ? 0 : -1;
|
|
@@ -5029,6 +5021,8 @@ var AppInsightsCore = /** @class */ (function () {
|
|
|
5029
5021
|
_pluginVersionString = null;
|
|
5030
5022
|
_pluginVersionStringArr = null;
|
|
5031
5023
|
_forceStopInternalLogPoller = false;
|
|
5024
|
+
_internalLogPoller = null;
|
|
5025
|
+
_internalLogPollerListening = false;
|
|
5032
5026
|
}
|
|
5033
5027
|
function _createTelCtx() {
|
|
5034
5028
|
var theCtx = createProcessTelemetryContext(_getPluginChain(), _configHandler.cfg, _self);
|
|
@@ -5223,28 +5217,27 @@ var AppInsightsCore = /** @class */ (function () {
|
|
|
5223
5217
|
doCallback();
|
|
5224
5218
|
return true;
|
|
5225
5219
|
}
|
|
5226
|
-
function _initDebugListener() {
|
|
5227
|
-
!_notificationManager && _self[_DYN_GET_NOTIFY_MGR ]();
|
|
5228
|
-
_addUnloadHook(_configHandler[_DYN_WATCH ](function (details) {
|
|
5229
|
-
var disableDbgExt = details.cfg.disableDbgExt;
|
|
5230
|
-
if (disableDbgExt === true && _debugListener) {
|
|
5231
|
-
_notificationManager[_DYN_REMOVE_NOTIFICATION_2 ](_debugListener);
|
|
5232
|
-
_debugListener = null;
|
|
5233
|
-
}
|
|
5234
|
-
if (_notificationManager && !_debugListener && disableDbgExt !== true) {
|
|
5235
|
-
_debugListener = getDebugListener(details.cfg);
|
|
5236
|
-
_notificationManager[_DYN_ADD_NOTIFICATION_LIS1 ](_debugListener);
|
|
5237
|
-
}
|
|
5238
|
-
}));
|
|
5239
|
-
}
|
|
5240
5220
|
function _initPerfManager() {
|
|
5221
|
+
var prevCfgPerfMgr;
|
|
5241
5222
|
_addUnloadHook(_configHandler[_DYN_WATCH ](function (details) {
|
|
5242
5223
|
var enablePerfMgr = details.cfg.enablePerfMgr;
|
|
5243
|
-
if (!enablePerfMgr && _cfgPerfManager) {
|
|
5244
|
-
_cfgPerfManager = null;
|
|
5245
|
-
}
|
|
5246
5224
|
if (enablePerfMgr) {
|
|
5247
|
-
|
|
5225
|
+
var createPerfMgr = details.cfg[STR_CREATE_PERF_MGR ];
|
|
5226
|
+
if (prevCfgPerfMgr !== createPerfMgr) {
|
|
5227
|
+
if (!createPerfMgr) {
|
|
5228
|
+
createPerfMgr = _createPerfManager;
|
|
5229
|
+
}
|
|
5230
|
+
getSetValue(details.cfg, STR_CREATE_PERF_MGR, createPerfMgr);
|
|
5231
|
+
prevCfgPerfMgr = createPerfMgr;
|
|
5232
|
+
_cfgPerfManager = null;
|
|
5233
|
+
}
|
|
5234
|
+
if (!_perfManager && !_cfgPerfManager && isFunction(createPerfMgr)) {
|
|
5235
|
+
_cfgPerfManager = createPerfMgr(_self, _self[_DYN_GET_NOTIFY_MGR ]());
|
|
5236
|
+
}
|
|
5237
|
+
}
|
|
5238
|
+
else {
|
|
5239
|
+
_cfgPerfManager = null;
|
|
5240
|
+
prevCfgPerfMgr = null;
|
|
5248
5241
|
}
|
|
5249
5242
|
}));
|
|
5250
5243
|
}
|
|
@@ -5280,6 +5273,24 @@ var AppInsightsCore = /** @class */ (function () {
|
|
|
5280
5273
|
return AppInsightsCore;
|
|
5281
5274
|
}());
|
|
5282
5275
|
|
|
5276
|
+
function parseResponse(response, diagLog) {
|
|
5277
|
+
try {
|
|
5278
|
+
if (response && response !== "") {
|
|
5279
|
+
var result = getJSON().parse(response);
|
|
5280
|
+
if (result && result[_DYN_ITEMS_RECEIVED$1 ] && result[_DYN_ITEMS_RECEIVED$1 ] >= result.itemsAccepted &&
|
|
5281
|
+
result.itemsReceived - result.itemsAccepted === result.errors[_DYN_LENGTH$2 ]) {
|
|
5282
|
+
return result;
|
|
5283
|
+
}
|
|
5284
|
+
}
|
|
5285
|
+
}
|
|
5286
|
+
catch (e) {
|
|
5287
|
+
_throwInternal(diagLog, 1 , 43 , "Cannot parse the response. " + (e[_DYN_NAME$2 ] || dumpObj(e)), {
|
|
5288
|
+
response: response
|
|
5289
|
+
});
|
|
5290
|
+
}
|
|
5291
|
+
return null;
|
|
5292
|
+
}
|
|
5293
|
+
|
|
5283
5294
|
var STR_EMPTY = "";
|
|
5284
5295
|
var STR_NO_RESPONSE_BODY = "NoResponseBody";
|
|
5285
5296
|
var _noResponseQs = "&" + STR_NO_RESPONSE_BODY + "=true";
|
|
@@ -7334,7 +7345,7 @@ function EnvelopeCreatorInit(logger, telemetryItem) {
|
|
|
7334
7345
|
}
|
|
7335
7346
|
}
|
|
7336
7347
|
var EnvelopeCreator = {
|
|
7337
|
-
Version: '3.1.
|
|
7348
|
+
Version: '3.1.2'
|
|
7338
7349
|
};
|
|
7339
7350
|
function DependencyEnvelopeCreator(logger, telemetryItem, customUndefinedValue) {
|
|
7340
7351
|
EnvelopeCreatorInit(logger, telemetryItem);
|