@microsoft/applicationinsights-debugplugin-js 2.7.5-nightly.2203-03 → 2.7.5
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.dbg.2.7.5-nightly.2203-03.cjs.js → ai.dbg.2.7.5.cjs.js} +483 -1040
- package/browser/ai.dbg.2.7.5.cjs.js.map +1 -0
- package/browser/ai.dbg.2.7.5.cjs.min.js +6 -0
- package/browser/ai.dbg.2.7.5.cjs.min.js.map +1 -0
- package/browser/{ai.dbg.2.7.5-nightly.2203-03.gbl.js → ai.dbg.2.7.5.gbl.js} +483 -1040
- package/browser/ai.dbg.2.7.5.gbl.js.map +1 -0
- package/browser/ai.dbg.2.7.5.gbl.min.js +6 -0
- package/browser/ai.dbg.2.7.5.gbl.min.js.map +1 -0
- package/browser/ai.dbg.2.7.5.integrity.json +66 -0
- package/browser/{ai.dbg.2.7.5-nightly.2203-03.js → ai.dbg.2.7.5.js} +483 -1040
- package/browser/ai.dbg.2.7.5.js.map +1 -0
- package/browser/ai.dbg.2.7.5.min.js +6 -0
- package/browser/ai.dbg.2.7.5.min.js.map +1 -0
- package/browser/ai.dbg.2.cjs.js +482 -1039
- package/browser/ai.dbg.2.cjs.js.map +1 -1
- package/browser/ai.dbg.2.cjs.min.js +2 -2
- package/browser/ai.dbg.2.cjs.min.js.map +1 -1
- package/browser/ai.dbg.2.gbl.js +482 -1039
- package/browser/ai.dbg.2.gbl.js.map +1 -1
- package/browser/ai.dbg.2.gbl.min.js +2 -2
- package/browser/ai.dbg.2.gbl.min.js.map +1 -1
- package/browser/ai.dbg.2.js +482 -1039
- package/browser/ai.dbg.2.js.map +1 -1
- package/browser/ai.dbg.2.min.js +2 -2
- package/browser/ai.dbg.2.min.js.map +1 -1
- package/dist/applicationinsights-debugplugin-js.api.json +17 -10
- package/dist/applicationinsights-debugplugin-js.d.ts +1 -1
- package/dist/applicationinsights-debugplugin-js.js +482 -1039
- package/dist/applicationinsights-debugplugin-js.js.map +1 -1
- package/dist/applicationinsights-debugplugin-js.min.js +2 -2
- package/dist/applicationinsights-debugplugin-js.min.js.map +1 -1
- package/dist/applicationinsights-debugplugin-js.rollup.d.ts +1 -1
- package/dist-esm/DebugPlugin.js +8 -8
- package/dist-esm/DebugPlugin.js.map +1 -1
- package/dist-esm/applicationinsights-debugplugin-js.js +1 -1
- package/dist-esm/components/Dashboard.js +5 -5
- package/dist-esm/components/Dashboard.js.map +1 -1
- package/dist-esm/components/LogEntry.js +3 -3
- package/dist-esm/components/LogEntry.js.map +1 -1
- package/dist-esm/components/debugBins.js +1 -1
- package/dist-esm/components/filterList.js +3 -2
- package/dist-esm/components/filterList.js.map +1 -1
- package/dist-esm/components/helpers.js +4 -4
- package/dist-esm/components/helpers.js.map +1 -1
- package/dist-esm/components/styleNodeSrc.js +1 -1
- package/dist-esm/interfaces/IDebugPluginConfig.js +1 -1
- package/package.json +54 -57
- package/src/DebugPlugin.ts +7 -7
- package/src/components/Dashboard.ts +4 -4
- package/src/components/LogEntry.ts +2 -2
- package/src/components/debugBins.ts +6 -7
- package/src/components/filterList.ts +3 -1
- package/src/components/helpers.ts +48 -58
- package/src/components/styleNodeSrc.ts +33 -33
- package/types/tsdoc-metadata.json +1 -1
- package/browser/ai.dbg.2.7.5-nightly.2203-03.cjs.js.map +0 -1
- package/browser/ai.dbg.2.7.5-nightly.2203-03.cjs.min.js +0 -6
- package/browser/ai.dbg.2.7.5-nightly.2203-03.cjs.min.js.map +0 -1
- package/browser/ai.dbg.2.7.5-nightly.2203-03.gbl.js.map +0 -1
- package/browser/ai.dbg.2.7.5-nightly.2203-03.gbl.min.js +0 -6
- package/browser/ai.dbg.2.7.5-nightly.2203-03.gbl.min.js.map +0 -1
- package/browser/ai.dbg.2.7.5-nightly.2203-03.integrity.json +0 -66
- package/browser/ai.dbg.2.7.5-nightly.2203-03.js.map +0 -1
- package/browser/ai.dbg.2.7.5-nightly.2203-03.min.js +0 -6
- package/browser/ai.dbg.2.7.5-nightly.2203-03.min.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Application Insights JavaScript SDK - Debug Plugin, 2.7.5
|
|
2
|
+
* Application Insights JavaScript SDK - Debug Plugin, 2.7.5
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
'use strict';
|
|
@@ -60,9 +60,7 @@ function objCreateFn(obj) {
|
|
|
60
60
|
(getGlobal() || {})["Reflect"];
|
|
61
61
|
var extendStaticsFn = function (d, b) {
|
|
62
62
|
extendStaticsFn = ObjClass["setPrototypeOf"] ||
|
|
63
|
-
({ __proto__: [] } instanceof Array && function (d, b) {
|
|
64
|
-
d.__proto__ = b;
|
|
65
|
-
}) ||
|
|
63
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
66
64
|
function (d, b) {
|
|
67
65
|
for (var p in b) {
|
|
68
66
|
if (b[strShimHasOwnProperty](p)) {
|
|
@@ -77,14 +75,12 @@ function __extendsFn(d, b) {
|
|
|
77
75
|
throwTypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
78
76
|
}
|
|
79
77
|
extendStaticsFn(d, b);
|
|
80
|
-
function __() {
|
|
81
|
-
this.constructor = d;
|
|
82
|
-
}
|
|
78
|
+
function __() { this.constructor = d; }
|
|
83
79
|
d[strShimPrototype] = b === null ? objCreateFn(b) : (__[strShimPrototype] = b[strShimPrototype], new __());
|
|
84
80
|
}
|
|
85
81
|
|
|
86
82
|
/*!
|
|
87
|
-
* Microsoft Dynamic Proto Utility, 1.1.
|
|
83
|
+
* Microsoft Dynamic Proto Utility, 1.1.5
|
|
88
84
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
89
85
|
*/
|
|
90
86
|
var Constructor = 'constructor';
|
|
@@ -97,6 +93,7 @@ var DynClassNamePrefix = '_dynCls$';
|
|
|
97
93
|
var DynInstChkTag = '_dynInstChk';
|
|
98
94
|
var DynAllowInstChkTag = DynInstChkTag;
|
|
99
95
|
var DynProtoDefaultOptions = '_dfOpts';
|
|
96
|
+
var DynProtoPolyProto = "_dynProto";
|
|
100
97
|
var UnknownValue = '_unknown_';
|
|
101
98
|
var str__Proto$1 = "__proto__";
|
|
102
99
|
var strUseBaseInst = 'useBaseInst';
|
|
@@ -118,8 +115,11 @@ function _getObjProto$1(target) {
|
|
|
118
115
|
if (_objGetPrototypeOf$1) {
|
|
119
116
|
return _objGetPrototypeOf$1(target);
|
|
120
117
|
}
|
|
121
|
-
var newProto = target[str__Proto$1] || target[Prototype] || (target[Constructor] ? target[Constructor][Prototype] : null);
|
|
118
|
+
var newProto = target[DynProtoPolyProto] || target[str__Proto$1] || target[Prototype] || (target[Constructor] ? target[Constructor][Prototype] : null);
|
|
122
119
|
if (newProto) {
|
|
120
|
+
if (!target[DynProtoPolyProto]) {
|
|
121
|
+
target[DynProtoPolyProto] = newProto;
|
|
122
|
+
}
|
|
123
123
|
return newProto;
|
|
124
124
|
}
|
|
125
125
|
}
|
|
@@ -278,8 +278,9 @@ function _checkPrototype(classProto, thisTarget) {
|
|
|
278
278
|
visited.push(thisProto);
|
|
279
279
|
thisProto = _getObjProto$1(thisProto);
|
|
280
280
|
}
|
|
281
|
+
return false;
|
|
281
282
|
}
|
|
282
|
-
return
|
|
283
|
+
return true;
|
|
283
284
|
}
|
|
284
285
|
function _getObjName(target, unknownValue) {
|
|
285
286
|
if (_hasOwnProperty(target, Prototype)) {
|
|
@@ -324,15 +325,99 @@ var perfDefaults = {
|
|
|
324
325
|
};
|
|
325
326
|
dynamicProto[DynProtoDefaultOptions] = perfDefaults;
|
|
326
327
|
|
|
327
|
-
var
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
var
|
|
333
|
-
|
|
334
|
-
|
|
328
|
+
var LoggingSeverity;
|
|
329
|
+
(function (LoggingSeverity) {
|
|
330
|
+
LoggingSeverity[LoggingSeverity["CRITICAL"] = 1] = "CRITICAL";
|
|
331
|
+
LoggingSeverity[LoggingSeverity["WARNING"] = 2] = "WARNING";
|
|
332
|
+
})(LoggingSeverity || (LoggingSeverity = {}));
|
|
333
|
+
var _InternalMessageId = {
|
|
334
|
+
BrowserDoesNotSupportLocalStorage: 0,
|
|
335
|
+
BrowserCannotReadLocalStorage: 1,
|
|
336
|
+
BrowserCannotReadSessionStorage: 2,
|
|
337
|
+
BrowserCannotWriteLocalStorage: 3,
|
|
338
|
+
BrowserCannotWriteSessionStorage: 4,
|
|
339
|
+
BrowserFailedRemovalFromLocalStorage: 5,
|
|
340
|
+
BrowserFailedRemovalFromSessionStorage: 6,
|
|
341
|
+
CannotSendEmptyTelemetry: 7,
|
|
342
|
+
ClientPerformanceMathError: 8,
|
|
343
|
+
ErrorParsingAISessionCookie: 9,
|
|
344
|
+
ErrorPVCalc: 10,
|
|
345
|
+
ExceptionWhileLoggingError: 11,
|
|
346
|
+
FailedAddingTelemetryToBuffer: 12,
|
|
347
|
+
FailedMonitorAjaxAbort: 13,
|
|
348
|
+
FailedMonitorAjaxDur: 14,
|
|
349
|
+
FailedMonitorAjaxOpen: 15,
|
|
350
|
+
FailedMonitorAjaxRSC: 16,
|
|
351
|
+
FailedMonitorAjaxSend: 17,
|
|
352
|
+
FailedMonitorAjaxGetCorrelationHeader: 18,
|
|
353
|
+
FailedToAddHandlerForOnBeforeUnload: 19,
|
|
354
|
+
FailedToSendQueuedTelemetry: 20,
|
|
355
|
+
FailedToReportDataLoss: 21,
|
|
356
|
+
FlushFailed: 22,
|
|
357
|
+
MessageLimitPerPVExceeded: 23,
|
|
358
|
+
MissingRequiredFieldSpecification: 24,
|
|
359
|
+
NavigationTimingNotSupported: 25,
|
|
360
|
+
OnError: 26,
|
|
361
|
+
SessionRenewalDateIsZero: 27,
|
|
362
|
+
SenderNotInitialized: 28,
|
|
363
|
+
StartTrackEventFailed: 29,
|
|
364
|
+
StopTrackEventFailed: 30,
|
|
365
|
+
StartTrackFailed: 31,
|
|
366
|
+
StopTrackFailed: 32,
|
|
367
|
+
TelemetrySampledAndNotSent: 33,
|
|
368
|
+
TrackEventFailed: 34,
|
|
369
|
+
TrackExceptionFailed: 35,
|
|
370
|
+
TrackMetricFailed: 36,
|
|
371
|
+
TrackPVFailed: 37,
|
|
372
|
+
TrackPVFailedCalc: 38,
|
|
373
|
+
TrackTraceFailed: 39,
|
|
374
|
+
TransmissionFailed: 40,
|
|
375
|
+
FailedToSetStorageBuffer: 41,
|
|
376
|
+
FailedToRestoreStorageBuffer: 42,
|
|
377
|
+
InvalidBackendResponse: 43,
|
|
378
|
+
FailedToFixDepricatedValues: 44,
|
|
379
|
+
InvalidDurationValue: 45,
|
|
380
|
+
TelemetryEnvelopeInvalid: 46,
|
|
381
|
+
CreateEnvelopeError: 47,
|
|
382
|
+
CannotSerializeObject: 48,
|
|
383
|
+
CannotSerializeObjectNonSerializable: 49,
|
|
384
|
+
CircularReferenceDetected: 50,
|
|
385
|
+
ClearAuthContextFailed: 51,
|
|
386
|
+
ExceptionTruncated: 52,
|
|
387
|
+
IllegalCharsInName: 53,
|
|
388
|
+
ItemNotInArray: 54,
|
|
389
|
+
MaxAjaxPerPVExceeded: 55,
|
|
390
|
+
MessageTruncated: 56,
|
|
391
|
+
NameTooLong: 57,
|
|
392
|
+
SampleRateOutOfRange: 58,
|
|
393
|
+
SetAuthContextFailed: 59,
|
|
394
|
+
SetAuthContextFailedAccountName: 60,
|
|
395
|
+
StringValueTooLong: 61,
|
|
396
|
+
StartCalledMoreThanOnce: 62,
|
|
397
|
+
StopCalledWithoutStart: 63,
|
|
398
|
+
TelemetryInitializerFailed: 64,
|
|
399
|
+
TrackArgumentsNotSpecified: 65,
|
|
400
|
+
UrlTooLong: 66,
|
|
401
|
+
SessionStorageBufferFull: 67,
|
|
402
|
+
CannotAccessCookie: 68,
|
|
403
|
+
IdTooLong: 69,
|
|
404
|
+
InvalidEvent: 70,
|
|
405
|
+
FailedMonitorAjaxSetRequestHeader: 71,
|
|
406
|
+
SendBrowserInfoOnUserInit: 72,
|
|
407
|
+
PluginException: 73,
|
|
408
|
+
NotificationException: 74,
|
|
409
|
+
SnippetScriptLoadFailure: 99,
|
|
410
|
+
InvalidInstrumentationKey: 100,
|
|
411
|
+
CannotParseAiBlobValue: 101,
|
|
412
|
+
InvalidContentBlob: 102,
|
|
413
|
+
TrackPageActionEventFailed: 103,
|
|
414
|
+
FailedAddingCustomDefinedRequestContext: 104,
|
|
415
|
+
InMemoryStorageBufferFull: 105
|
|
416
|
+
};
|
|
335
417
|
|
|
418
|
+
var strOnPrefix = "on";
|
|
419
|
+
var strAttachEvent = "attachEvent";
|
|
420
|
+
var strAddEventHelper = "addEventListener";
|
|
336
421
|
var strToISOString = "toISOString";
|
|
337
422
|
var cStrEndsWith = "endsWith";
|
|
338
423
|
var strIndexOf = "indexOf";
|
|
@@ -342,8 +427,7 @@ var cStrTrim = "trim";
|
|
|
342
427
|
var strToString = "toString";
|
|
343
428
|
var str__Proto = "__proto__";
|
|
344
429
|
var strConstructor$1 = "constructor";
|
|
345
|
-
var _objDefineProperty
|
|
346
|
-
var _objFreeze = ObjClass.freeze;
|
|
430
|
+
var _objDefineProperty = ObjDefineProperty;
|
|
347
431
|
var _objKeys = ObjClass.keys;
|
|
348
432
|
var StringProto = String[strShimPrototype];
|
|
349
433
|
var _strTrim = StringProto[cStrTrim];
|
|
@@ -353,10 +437,7 @@ var _dataToISOString = DateProto[strToISOString];
|
|
|
353
437
|
var _isArray = Array.isArray;
|
|
354
438
|
var _objToString = ObjProto[strToString];
|
|
355
439
|
var _fnToString = ObjHasOwnProperty[strToString];
|
|
356
|
-
|
|
357
|
-
var rCamelCase = /-([a-z])/g;
|
|
358
|
-
var rNormalizeInvalid = /([^\w\d_$])/g;
|
|
359
|
-
var rLeadingNumeric = /^(\d+[\w\d_$])/;
|
|
440
|
+
_fnToString.call(ObjClass);
|
|
360
441
|
var _objGetPrototypeOf = Object["getPrototypeOf"];
|
|
361
442
|
function _getObjProto(target) {
|
|
362
443
|
if (target) {
|
|
@@ -370,9 +451,6 @@ function _getObjProto(target) {
|
|
|
370
451
|
}
|
|
371
452
|
return null;
|
|
372
453
|
}
|
|
373
|
-
function objToString(obj) {
|
|
374
|
-
return _objToString.call(obj);
|
|
375
|
-
}
|
|
376
454
|
function isTypeof(value, theType) {
|
|
377
455
|
return typeof value === theType;
|
|
378
456
|
}
|
|
@@ -394,18 +472,24 @@ function isObject(value) {
|
|
|
394
472
|
function isFunction(value) {
|
|
395
473
|
return !!(value && typeof value === strShimFunction);
|
|
396
474
|
}
|
|
397
|
-
function
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
475
|
+
function attachEvent(obj, eventNameWithoutOn, handlerRef, useCapture) {
|
|
476
|
+
if (useCapture === void 0) { useCapture = false; }
|
|
477
|
+
var result = false;
|
|
478
|
+
if (!isNullOrUndefined(obj)) {
|
|
479
|
+
try {
|
|
480
|
+
if (!isNullOrUndefined(obj[strAddEventHelper])) {
|
|
481
|
+
obj[strAddEventHelper](eventNameWithoutOn, handlerRef, useCapture);
|
|
482
|
+
result = true;
|
|
483
|
+
}
|
|
484
|
+
else if (!isNullOrUndefined(obj[strAttachEvent])) {
|
|
485
|
+
obj[strAttachEvent](strOnPrefix + eventNameWithoutOn, handlerRef);
|
|
486
|
+
result = true;
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
catch (e) {
|
|
490
|
+
}
|
|
407
491
|
}
|
|
408
|
-
return
|
|
492
|
+
return result;
|
|
409
493
|
}
|
|
410
494
|
function objForEachKey(target, callbackfn) {
|
|
411
495
|
if (target) {
|
|
@@ -467,22 +551,6 @@ function isBoolean(value) {
|
|
|
467
551
|
function isSymbol(value) {
|
|
468
552
|
return typeof value === "symbol";
|
|
469
553
|
}
|
|
470
|
-
function isPlainObject(value) {
|
|
471
|
-
var result = false;
|
|
472
|
-
if (value && typeof value === "object") {
|
|
473
|
-
var proto = _objGetPrototypeOf ? _objGetPrototypeOf(value) : _getObjProto(value);
|
|
474
|
-
if (!proto) {
|
|
475
|
-
result = true;
|
|
476
|
-
}
|
|
477
|
-
else {
|
|
478
|
-
if (proto[strConstructor$1] && ObjHasOwnProperty.call(proto, strConstructor$1)) {
|
|
479
|
-
proto = proto[strConstructor$1];
|
|
480
|
-
}
|
|
481
|
-
result = typeof proto === strShimFunction && _fnToString.call(proto) === _objFunctionString;
|
|
482
|
-
}
|
|
483
|
-
}
|
|
484
|
-
return result;
|
|
485
|
-
}
|
|
486
554
|
function toISOString(date) {
|
|
487
555
|
if (date) {
|
|
488
556
|
return _dataToISOString ? date[strToISOString]() : _toISOStringPoly(date);
|
|
@@ -628,7 +696,7 @@ function objKeys(obj) {
|
|
|
628
696
|
return result;
|
|
629
697
|
}
|
|
630
698
|
function objDefineAccessors(target, prop, getProp, setProp) {
|
|
631
|
-
if (_objDefineProperty
|
|
699
|
+
if (_objDefineProperty) {
|
|
632
700
|
try {
|
|
633
701
|
var descriptor = {
|
|
634
702
|
enumerable: true,
|
|
@@ -640,7 +708,7 @@ function objDefineAccessors(target, prop, getProp, setProp) {
|
|
|
640
708
|
if (setProp) {
|
|
641
709
|
descriptor.set = setProp;
|
|
642
710
|
}
|
|
643
|
-
_objDefineProperty
|
|
711
|
+
_objDefineProperty(target, prop, descriptor);
|
|
644
712
|
return true;
|
|
645
713
|
}
|
|
646
714
|
catch (e) {
|
|
@@ -648,10 +716,6 @@ function objDefineAccessors(target, prop, getProp, setProp) {
|
|
|
648
716
|
}
|
|
649
717
|
return false;
|
|
650
718
|
}
|
|
651
|
-
function _doNothing(value) {
|
|
652
|
-
return value;
|
|
653
|
-
}
|
|
654
|
-
var objFreeze = _objFreeze || _doNothing;
|
|
655
719
|
function dateNow() {
|
|
656
720
|
var dt = Date;
|
|
657
721
|
return dt.now ? dt.now() : new dt().getTime();
|
|
@@ -660,7 +724,7 @@ function getExceptionName(object) {
|
|
|
660
724
|
if (isError(object)) {
|
|
661
725
|
return object.name;
|
|
662
726
|
}
|
|
663
|
-
return
|
|
727
|
+
return "";
|
|
664
728
|
}
|
|
665
729
|
function setValue(target, field, value, valChk, srcChk) {
|
|
666
730
|
var theValue = value;
|
|
@@ -676,91 +740,6 @@ function setValue(target, field, value, valChk, srcChk) {
|
|
|
676
740
|
function isTruthy(value) {
|
|
677
741
|
return !!value;
|
|
678
742
|
}
|
|
679
|
-
function throwError(message) {
|
|
680
|
-
throw new Error(message);
|
|
681
|
-
}
|
|
682
|
-
function _createProxyFunction(source, funcName) {
|
|
683
|
-
var srcFunc = null;
|
|
684
|
-
var src = null;
|
|
685
|
-
if (isFunction(source)) {
|
|
686
|
-
srcFunc = source;
|
|
687
|
-
}
|
|
688
|
-
else {
|
|
689
|
-
src = source;
|
|
690
|
-
}
|
|
691
|
-
return function () {
|
|
692
|
-
var originalArguments = arguments;
|
|
693
|
-
if (srcFunc) {
|
|
694
|
-
src = srcFunc();
|
|
695
|
-
}
|
|
696
|
-
if (src) {
|
|
697
|
-
return src[funcName].apply(src, originalArguments);
|
|
698
|
-
}
|
|
699
|
-
};
|
|
700
|
-
}
|
|
701
|
-
function proxyFunctionAs(target, name, source, theFunc, overwriteTarget) {
|
|
702
|
-
if (overwriteTarget === void 0) { overwriteTarget = true; }
|
|
703
|
-
if (target && name && source) {
|
|
704
|
-
if (overwriteTarget || isUndefined(target[name])) {
|
|
705
|
-
target[name] = _createProxyFunction(source, theFunc);
|
|
706
|
-
}
|
|
707
|
-
}
|
|
708
|
-
}
|
|
709
|
-
function createEnumStyle(values) {
|
|
710
|
-
var enumClass = {};
|
|
711
|
-
objForEachKey(values, function (field, value) {
|
|
712
|
-
enumClass[field] = value;
|
|
713
|
-
if (!isUndefined(enumClass[value])) {
|
|
714
|
-
throwError("[" + value + "] exists for " + field);
|
|
715
|
-
}
|
|
716
|
-
enumClass[value] = field;
|
|
717
|
-
});
|
|
718
|
-
return objFreeze(enumClass);
|
|
719
|
-
}
|
|
720
|
-
function objExtend(obj1, obj2, obj3, obj4, obj5, obj6) {
|
|
721
|
-
var theArgs = arguments;
|
|
722
|
-
var extended = theArgs[0] || {};
|
|
723
|
-
var argLen = theArgs.length;
|
|
724
|
-
var deep = false;
|
|
725
|
-
var idx = 1;
|
|
726
|
-
if (argLen > 0 && isBoolean(extended)) {
|
|
727
|
-
deep = extended;
|
|
728
|
-
extended = theArgs[idx] || {};
|
|
729
|
-
idx++;
|
|
730
|
-
}
|
|
731
|
-
if (!isObject(extended)) {
|
|
732
|
-
extended = {};
|
|
733
|
-
}
|
|
734
|
-
for (; idx < argLen; idx++) {
|
|
735
|
-
var arg = theArgs[idx];
|
|
736
|
-
var isArgArray = isArray(arg);
|
|
737
|
-
var isArgObj = isObject(arg);
|
|
738
|
-
for (var prop in arg) {
|
|
739
|
-
var propOk = (isArgArray && (prop in arg)) || (isArgObj && (ObjHasOwnProperty.call(arg, prop)));
|
|
740
|
-
if (!propOk) {
|
|
741
|
-
continue;
|
|
742
|
-
}
|
|
743
|
-
var newValue = arg[prop];
|
|
744
|
-
var isNewArray = void 0;
|
|
745
|
-
if (deep && newValue && ((isNewArray = isArray(newValue)) || isPlainObject(newValue))) {
|
|
746
|
-
var clone = extended[prop];
|
|
747
|
-
if (isNewArray) {
|
|
748
|
-
if (!isArray(clone)) {
|
|
749
|
-
clone = [];
|
|
750
|
-
}
|
|
751
|
-
}
|
|
752
|
-
else if (!isPlainObject(clone)) {
|
|
753
|
-
clone = {};
|
|
754
|
-
}
|
|
755
|
-
newValue = objExtend(deep, clone, newValue);
|
|
756
|
-
}
|
|
757
|
-
if (newValue !== undefined) {
|
|
758
|
-
extended[prop] = newValue;
|
|
759
|
-
}
|
|
760
|
-
}
|
|
761
|
-
}
|
|
762
|
-
return extended;
|
|
763
|
-
}
|
|
764
743
|
|
|
765
744
|
var strWindow = "window";
|
|
766
745
|
var strDocument = "document";
|
|
@@ -855,7 +834,7 @@ function isIE() {
|
|
|
855
834
|
var nav = getNavigator();
|
|
856
835
|
if (nav && (nav.userAgent !== _navUserAgentCheck || _isTrident === null)) {
|
|
857
836
|
_navUserAgentCheck = nav.userAgent;
|
|
858
|
-
var userAgent = (_navUserAgentCheck ||
|
|
837
|
+
var userAgent = (_navUserAgentCheck || "").toLowerCase();
|
|
859
838
|
_isTrident = (strContains(userAgent, strMsie) || strContains(userAgent, strTrident));
|
|
860
839
|
}
|
|
861
840
|
return _isTrident;
|
|
@@ -864,9 +843,9 @@ function getIEVersion(userAgentStr) {
|
|
|
864
843
|
if (userAgentStr === void 0) { userAgentStr = null; }
|
|
865
844
|
if (!userAgentStr) {
|
|
866
845
|
var navigator_1 = getNavigator() || {};
|
|
867
|
-
userAgentStr = navigator_1 ? (navigator_1.userAgent ||
|
|
846
|
+
userAgentStr = navigator_1 ? (navigator_1.userAgent || "").toLowerCase() : "";
|
|
868
847
|
}
|
|
869
|
-
var ua = (userAgentStr ||
|
|
848
|
+
var ua = (userAgentStr || "").toLowerCase();
|
|
870
849
|
if (strContains(ua, strMsie)) {
|
|
871
850
|
var doc = getDocument() || {};
|
|
872
851
|
return Math.max(parseInt(ua.split(strMsie)[1]), (doc[strDocumentMode] || 0));
|
|
@@ -881,7 +860,7 @@ function getIEVersion(userAgentStr) {
|
|
|
881
860
|
}
|
|
882
861
|
function dumpObj(object) {
|
|
883
862
|
var objectTypeDump = Object[strShimPrototype].toString.call(object);
|
|
884
|
-
var propertyValueDump =
|
|
863
|
+
var propertyValueDump = "";
|
|
885
864
|
if (objectTypeDump === "[object Error]") {
|
|
886
865
|
propertyValueDump = "{ stack: '" + object.stack + "', message: '" + object.message + "', name: '" + object.name + "'";
|
|
887
866
|
}
|
|
@@ -920,9 +899,9 @@ var strErrorToConsole = "errorToConsole";
|
|
|
920
899
|
var strWarnToConsole = "warnToConsole";
|
|
921
900
|
function _sanitizeDiagnosticText(text) {
|
|
922
901
|
if (text) {
|
|
923
|
-
return "\"" + text.replace(/\"/g,
|
|
902
|
+
return "\"" + text.replace(/\"/g, "") + "\"";
|
|
924
903
|
}
|
|
925
|
-
return
|
|
904
|
+
return "";
|
|
926
905
|
}
|
|
927
906
|
function _logToConsole(func, message) {
|
|
928
907
|
var theConsole = getConsole();
|
|
@@ -944,12 +923,12 @@ var _InternalLogMessage = /** @class */ (function () {
|
|
|
944
923
|
_self.message =
|
|
945
924
|
(isUserAct ? AiUserActionablePrefix : AiNonUserActionablePrefix) +
|
|
946
925
|
msgId;
|
|
947
|
-
var strProps =
|
|
926
|
+
var strProps = "";
|
|
948
927
|
if (hasJSON()) {
|
|
949
928
|
strProps = getJSON().stringify(properties);
|
|
950
929
|
}
|
|
951
|
-
var diagnosticText = (msg ? " message:" + _sanitizeDiagnosticText(msg) :
|
|
952
|
-
(properties ? " props:" + _sanitizeDiagnosticText(strProps) :
|
|
930
|
+
var diagnosticText = (msg ? " message:" + _sanitizeDiagnosticText(msg) : "") +
|
|
931
|
+
(properties ? " props:" + _sanitizeDiagnosticText(strProps) : "");
|
|
953
932
|
_self.message += diagnosticText;
|
|
954
933
|
}
|
|
955
934
|
_InternalLogMessage.dataType = "MessageData";
|
|
@@ -976,10 +955,10 @@ var DiagnosticLogger = /** @class */ (function () {
|
|
|
976
955
|
if (isUserAct === void 0) { isUserAct = false; }
|
|
977
956
|
var message = new _InternalLogMessage(msgId, msg, isUserAct, properties);
|
|
978
957
|
if (_self.enableDebugExceptions()) {
|
|
979
|
-
throw message;
|
|
958
|
+
throw dumpObj(message);
|
|
980
959
|
}
|
|
981
960
|
else {
|
|
982
|
-
var logFunc = severity ===
|
|
961
|
+
var logFunc = severity === LoggingSeverity.CRITICAL ? strErrorToConsole : strWarnToConsole;
|
|
983
962
|
if (!isUndefined(message.message)) {
|
|
984
963
|
var logLevel = _self.consoleLoggingLevel();
|
|
985
964
|
if (isUserAct) {
|
|
@@ -997,7 +976,7 @@ var DiagnosticLogger = /** @class */ (function () {
|
|
|
997
976
|
_self.logInternalMessage(severity, message);
|
|
998
977
|
}
|
|
999
978
|
else {
|
|
1000
|
-
_debugExtMsg("throw" + (severity ===
|
|
979
|
+
_debugExtMsg("throw" + (severity === LoggingSeverity.CRITICAL ? "Critical" : "Warning"), message);
|
|
1001
980
|
}
|
|
1002
981
|
}
|
|
1003
982
|
};
|
|
@@ -1029,13 +1008,13 @@ var DiagnosticLogger = /** @class */ (function () {
|
|
|
1029
1008
|
if (severity <= _self.telemetryLoggingLevel()) {
|
|
1030
1009
|
_self.queue.push(message);
|
|
1031
1010
|
_messageCount++;
|
|
1032
|
-
_debugExtMsg((severity ===
|
|
1011
|
+
_debugExtMsg((severity === LoggingSeverity.CRITICAL ? "error" : "warn"), message);
|
|
1033
1012
|
}
|
|
1034
1013
|
if (_messageCount === _self.maxInternalMessageLimit()) {
|
|
1035
1014
|
var throttleLimitMessage = "Internal events throttle limit per PageView reached for this app.";
|
|
1036
|
-
var throttleMessage = new _InternalLogMessage(
|
|
1015
|
+
var throttleMessage = new _InternalLogMessage(_InternalMessageId.MessageLimitPerPVExceeded, throttleLimitMessage, false);
|
|
1037
1016
|
_self.queue.push(throttleMessage);
|
|
1038
|
-
if (severity ===
|
|
1017
|
+
if (severity === LoggingSeverity.CRITICAL) {
|
|
1039
1018
|
_self.errorToConsole(throttleLimitMessage);
|
|
1040
1019
|
}
|
|
1041
1020
|
else {
|
|
@@ -1064,10 +1043,6 @@ var DiagnosticLogger = /** @class */ (function () {
|
|
|
1064
1043
|
}
|
|
1065
1044
|
return DiagnosticLogger;
|
|
1066
1045
|
}());
|
|
1067
|
-
function _throwInternal(logger, severity, msgId, msg, properties, isUserAct) {
|
|
1068
|
-
if (isUserAct === void 0) { isUserAct = false; }
|
|
1069
|
-
(logger || new DiagnosticLogger()).throwInternal(severity, msgId, msg, properties, isUserAct);
|
|
1070
|
-
}
|
|
1071
1046
|
|
|
1072
1047
|
var strExecutionContextKey = "ctx";
|
|
1073
1048
|
var PerfEvent = /** @class */ (function () {
|
|
@@ -1181,509 +1156,252 @@ function doPerf(mgrSource, getSource, func, details, isAsync) {
|
|
|
1181
1156
|
return func();
|
|
1182
1157
|
}
|
|
1183
1158
|
|
|
1184
|
-
var
|
|
1185
|
-
|
|
1186
|
-
var
|
|
1187
|
-
var
|
|
1188
|
-
var
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
}
|
|
1197
|
-
function
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
}
|
|
1204
|
-
}
|
|
1205
|
-
function randomValue(maxValue) {
|
|
1206
|
-
if (maxValue > 0) {
|
|
1207
|
-
return Math.floor((random32() / MaxUInt32) * (maxValue + 1)) >>> 0;
|
|
1208
|
-
}
|
|
1209
|
-
return 0;
|
|
1210
|
-
}
|
|
1211
|
-
function random32(signed) {
|
|
1212
|
-
var value = 0;
|
|
1213
|
-
var c = getCrypto() || getMsCrypto();
|
|
1214
|
-
if (c && c.getRandomValues) {
|
|
1215
|
-
value = c.getRandomValues(new Uint32Array(1))[0] & MaxUInt32;
|
|
1216
|
-
}
|
|
1217
|
-
if (value === 0 && isIE()) {
|
|
1218
|
-
if (!_mwcSeeded) {
|
|
1219
|
-
_autoSeedMwc();
|
|
1220
|
-
}
|
|
1221
|
-
value = mwcRandom32() & MaxUInt32;
|
|
1222
|
-
}
|
|
1223
|
-
if (value === 0) {
|
|
1224
|
-
value = Math.floor((UInt32Mask * Math.random()) | 0);
|
|
1225
|
-
}
|
|
1226
|
-
if (!signed) {
|
|
1227
|
-
value >>>= 0;
|
|
1228
|
-
}
|
|
1229
|
-
return value;
|
|
1230
|
-
}
|
|
1231
|
-
function mwcRandomSeed(value) {
|
|
1232
|
-
if (!value) {
|
|
1233
|
-
_autoSeedMwc();
|
|
1234
|
-
}
|
|
1235
|
-
else {
|
|
1236
|
-
_mwcSeed(value);
|
|
1237
|
-
}
|
|
1238
|
-
}
|
|
1239
|
-
function mwcRandom32(signed) {
|
|
1240
|
-
_mwcZ = (36969 * (_mwcZ & 0xFFFF) + (_mwcZ >> 16)) & MaxUInt32;
|
|
1241
|
-
_mwcW = (18000 * (_mwcW & 0xFFFF) + (_mwcW >> 16)) & MaxUInt32;
|
|
1242
|
-
var value = (((_mwcZ << 16) + (_mwcW & 0xFFFF)) >>> 0) & MaxUInt32 | 0;
|
|
1243
|
-
if (!signed) {
|
|
1244
|
-
value >>>= 0;
|
|
1245
|
-
}
|
|
1246
|
-
return value;
|
|
1247
|
-
}
|
|
1248
|
-
function newId(maxLength) {
|
|
1249
|
-
if (maxLength === void 0) { maxLength = 22; }
|
|
1250
|
-
var base64chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
1251
|
-
var number = random32() >>> 0;
|
|
1252
|
-
var chars = 0;
|
|
1253
|
-
var result = strEmpty$1;
|
|
1254
|
-
while (result.length < maxLength) {
|
|
1255
|
-
chars++;
|
|
1256
|
-
result += base64chars.charAt(number & 0x3F);
|
|
1257
|
-
number >>>= 6;
|
|
1258
|
-
if (chars === 5) {
|
|
1259
|
-
number = (((random32() << 2) & 0xFFFFFFFF) | (number & 0x03)) >>> 0;
|
|
1260
|
-
chars = 0;
|
|
1261
|
-
}
|
|
1262
|
-
}
|
|
1263
|
-
return result;
|
|
1264
|
-
}
|
|
1265
|
-
|
|
1266
|
-
var _objDefineProperty = ObjDefineProperty;
|
|
1267
|
-
var version = "2.7.5-nightly.2203-03";
|
|
1268
|
-
var instanceName = "." + newId(6);
|
|
1269
|
-
var _dataUid = 0;
|
|
1270
|
-
function _createAccessor(target, prop, value) {
|
|
1271
|
-
if (_objDefineProperty) {
|
|
1272
|
-
try {
|
|
1273
|
-
_objDefineProperty(target, prop, {
|
|
1274
|
-
value: value,
|
|
1275
|
-
enumerable: false,
|
|
1276
|
-
configurable: true
|
|
1277
|
-
});
|
|
1278
|
-
return true;
|
|
1279
|
-
}
|
|
1280
|
-
catch (e) {
|
|
1281
|
-
}
|
|
1282
|
-
}
|
|
1283
|
-
return false;
|
|
1284
|
-
}
|
|
1285
|
-
function _canAcceptData(target) {
|
|
1286
|
-
return target.nodeType === 1 || target.nodeType === 9 || !(+target.nodeType);
|
|
1287
|
-
}
|
|
1288
|
-
function _getCache(data, target) {
|
|
1289
|
-
var theCache = target[data.id];
|
|
1290
|
-
if (!theCache) {
|
|
1291
|
-
theCache = {};
|
|
1292
|
-
try {
|
|
1293
|
-
if (_canAcceptData(target)) {
|
|
1294
|
-
if (!_createAccessor(target, data.id, theCache)) {
|
|
1295
|
-
target[data.id] = theCache;
|
|
1296
|
-
}
|
|
1297
|
-
}
|
|
1298
|
-
}
|
|
1299
|
-
catch (e) {
|
|
1300
|
-
}
|
|
1301
|
-
}
|
|
1302
|
-
return theCache;
|
|
1303
|
-
}
|
|
1304
|
-
function createUniqueNamespace(name, includeVersion) {
|
|
1305
|
-
if (includeVersion === void 0) { includeVersion = false; }
|
|
1306
|
-
return normalizeJsName(name + (_dataUid++) + (includeVersion ? "." + version : "") + instanceName);
|
|
1307
|
-
}
|
|
1308
|
-
function createElmNodeData(name) {
|
|
1309
|
-
var data = {
|
|
1310
|
-
id: createUniqueNamespace("_aiData-" + (name || "") + "." + version),
|
|
1311
|
-
accept: function (target) {
|
|
1312
|
-
return _canAcceptData(target);
|
|
1313
|
-
},
|
|
1314
|
-
get: function (target, name, defValue, addDefault) {
|
|
1315
|
-
var theCache = target[data.id];
|
|
1316
|
-
if (!theCache) {
|
|
1317
|
-
if (addDefault) {
|
|
1318
|
-
theCache = _getCache(data, target);
|
|
1319
|
-
theCache[normalizeJsName(name)] = defValue;
|
|
1320
|
-
}
|
|
1321
|
-
return defValue;
|
|
1322
|
-
}
|
|
1323
|
-
return theCache[normalizeJsName(name)];
|
|
1324
|
-
},
|
|
1325
|
-
kill: function (target, name) {
|
|
1326
|
-
if (target && target[name]) {
|
|
1327
|
-
try {
|
|
1328
|
-
delete target[name];
|
|
1329
|
-
}
|
|
1330
|
-
catch (e) {
|
|
1331
|
-
}
|
|
1159
|
+
var TelemetryPluginChain = /** @class */ (function () {
|
|
1160
|
+
function TelemetryPluginChain(plugin, defItemCtx) {
|
|
1161
|
+
var _self = this;
|
|
1162
|
+
var _nextProxy = null;
|
|
1163
|
+
var _hasProcessTelemetry = isFunction(plugin.processTelemetry);
|
|
1164
|
+
var _hasSetNext = isFunction(plugin.setNextPlugin);
|
|
1165
|
+
_self._hasRun = false;
|
|
1166
|
+
_self.getPlugin = function () {
|
|
1167
|
+
return plugin;
|
|
1168
|
+
};
|
|
1169
|
+
_self.getNext = function () {
|
|
1170
|
+
return _nextProxy;
|
|
1171
|
+
};
|
|
1172
|
+
_self.setNext = function (nextPlugin) {
|
|
1173
|
+
_nextProxy = nextPlugin;
|
|
1174
|
+
};
|
|
1175
|
+
_self.processTelemetry = function (env, itemCtx) {
|
|
1176
|
+
if (!itemCtx) {
|
|
1177
|
+
itemCtx = defItemCtx;
|
|
1332
1178
|
}
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
var pluginStateData = createElmNodeData("plugin");
|
|
1339
|
-
function _getPluginState(plugin) {
|
|
1340
|
-
return pluginStateData.get(plugin, "state", {}, true);
|
|
1341
|
-
}
|
|
1342
|
-
|
|
1343
|
-
var strTelemetryPluginChain = "TelemetryPluginChain";
|
|
1344
|
-
var strHasRunFlags = "_hasRun";
|
|
1345
|
-
var strGetTelCtx = "_getTelCtx";
|
|
1346
|
-
var _chainId = 0;
|
|
1347
|
-
function _getNextProxyStart(proxy, config, core, startAt) {
|
|
1348
|
-
while (proxy) {
|
|
1349
|
-
if (proxy.getPlugin() === startAt) {
|
|
1350
|
-
return proxy;
|
|
1351
|
-
}
|
|
1352
|
-
proxy = proxy.getNext();
|
|
1353
|
-
}
|
|
1354
|
-
return createTelemetryProxyChain([startAt], config, core);
|
|
1355
|
-
}
|
|
1356
|
-
function _createInternalContext(telemetryChain, config, core, startAt) {
|
|
1357
|
-
var _nextProxy = null;
|
|
1358
|
-
var _onComplete = [];
|
|
1359
|
-
if (startAt !== null) {
|
|
1360
|
-
_nextProxy = startAt ? _getNextProxyStart(telemetryChain, config, core, startAt) : telemetryChain;
|
|
1361
|
-
}
|
|
1362
|
-
var context = {
|
|
1363
|
-
_next: _moveNext,
|
|
1364
|
-
ctx: {
|
|
1365
|
-
core: function () {
|
|
1366
|
-
return core;
|
|
1367
|
-
},
|
|
1368
|
-
diagLog: function () {
|
|
1369
|
-
return safeGetLogger(core, config);
|
|
1370
|
-
},
|
|
1371
|
-
getCfg: function () {
|
|
1372
|
-
return config;
|
|
1373
|
-
},
|
|
1374
|
-
getExtCfg: _getExtCfg,
|
|
1375
|
-
getConfig: _getConfig,
|
|
1376
|
-
hasNext: function () {
|
|
1377
|
-
return !!_nextProxy;
|
|
1378
|
-
},
|
|
1379
|
-
getNext: function () {
|
|
1380
|
-
return _nextProxy;
|
|
1381
|
-
},
|
|
1382
|
-
setNext: function (nextPlugin) {
|
|
1383
|
-
_nextProxy = nextPlugin;
|
|
1384
|
-
},
|
|
1385
|
-
iterate: _iterateChain,
|
|
1386
|
-
onComplete: _addOnComplete
|
|
1387
|
-
}
|
|
1388
|
-
};
|
|
1389
|
-
function _addOnComplete(onComplete, that) {
|
|
1390
|
-
var args = [];
|
|
1391
|
-
for (var _i = 2; _i < arguments.length; _i++) {
|
|
1392
|
-
args[_i - 2] = arguments[_i];
|
|
1393
|
-
}
|
|
1394
|
-
if (onComplete) {
|
|
1395
|
-
_onComplete.push({
|
|
1396
|
-
func: onComplete,
|
|
1397
|
-
self: !isUndefined(that) ? that : context.ctx,
|
|
1398
|
-
args: args
|
|
1399
|
-
});
|
|
1400
|
-
}
|
|
1401
|
-
}
|
|
1402
|
-
function _moveNext() {
|
|
1403
|
-
var nextProxy = _nextProxy;
|
|
1404
|
-
_nextProxy = nextProxy ? nextProxy.getNext() : null;
|
|
1405
|
-
if (!nextProxy) {
|
|
1406
|
-
var onComplete = _onComplete;
|
|
1407
|
-
if (onComplete && onComplete.length > 0) {
|
|
1408
|
-
arrForEach(onComplete, function (completeDetails) {
|
|
1179
|
+
var identifier = plugin ? plugin.identifier : "TelemetryPluginChain";
|
|
1180
|
+
doPerf(itemCtx ? itemCtx.core() : null, function () { return identifier + ":processTelemetry"; }, function () {
|
|
1181
|
+
if (plugin && _hasProcessTelemetry) {
|
|
1182
|
+
_self._hasRun = true;
|
|
1409
1183
|
try {
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1184
|
+
itemCtx.setNext(_nextProxy);
|
|
1185
|
+
if (_hasSetNext) {
|
|
1186
|
+
plugin.setNextPlugin(_nextProxy);
|
|
1187
|
+
}
|
|
1188
|
+
_nextProxy && (_nextProxy._hasRun = false);
|
|
1189
|
+
plugin.processTelemetry(env, itemCtx);
|
|
1414
1190
|
}
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
return nextProxy;
|
|
1420
|
-
}
|
|
1421
|
-
function _getExtCfg(identifier, defaultValue, mergeDefault) {
|
|
1422
|
-
if (defaultValue === void 0) { defaultValue = {}; }
|
|
1423
|
-
if (mergeDefault === void 0) { mergeDefault = 0 ; }
|
|
1424
|
-
var theConfig;
|
|
1425
|
-
if (config) {
|
|
1426
|
-
var extConfig = config.extensionConfig;
|
|
1427
|
-
if (extConfig && identifier) {
|
|
1428
|
-
theConfig = extConfig[identifier];
|
|
1429
|
-
}
|
|
1430
|
-
}
|
|
1431
|
-
if (!theConfig) {
|
|
1432
|
-
theConfig = defaultValue;
|
|
1433
|
-
}
|
|
1434
|
-
else if (isObject(defaultValue)) {
|
|
1435
|
-
if (mergeDefault !== 0 ) {
|
|
1436
|
-
var newConfig_1 = objExtend(true, defaultValue, theConfig);
|
|
1437
|
-
if (config && mergeDefault === 2 ) {
|
|
1438
|
-
objForEachKey(defaultValue, function (field) {
|
|
1439
|
-
if (isNullOrUndefined(newConfig_1[field])) {
|
|
1440
|
-
var cfgValue = config[field];
|
|
1441
|
-
if (!isNullOrUndefined(cfgValue)) {
|
|
1442
|
-
newConfig_1[field] = cfgValue;
|
|
1443
|
-
}
|
|
1191
|
+
catch (error) {
|
|
1192
|
+
var hasRun = _nextProxy && _nextProxy._hasRun;
|
|
1193
|
+
if (!_nextProxy || !hasRun) {
|
|
1194
|
+
itemCtx.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.PluginException, "Plugin [" + plugin.identifier + "] failed during processTelemetry - " + dumpObj(error));
|
|
1444
1195
|
}
|
|
1445
|
-
|
|
1196
|
+
if (_nextProxy && !hasRun) {
|
|
1197
|
+
_nextProxy.processTelemetry(env, itemCtx);
|
|
1198
|
+
}
|
|
1199
|
+
}
|
|
1446
1200
|
}
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
var theValue;
|
|
1454
|
-
var extConfig = _getExtCfg(identifier, null);
|
|
1455
|
-
if (extConfig && !isNullOrUndefined(extConfig[field])) {
|
|
1456
|
-
theValue = extConfig[field];
|
|
1457
|
-
}
|
|
1458
|
-
else if (config && !isNullOrUndefined(config[field])) {
|
|
1459
|
-
theValue = config[field];
|
|
1460
|
-
}
|
|
1461
|
-
return !isNullOrUndefined(theValue) ? theValue : defaultValue;
|
|
1201
|
+
else if (_nextProxy) {
|
|
1202
|
+
_self._hasRun = true;
|
|
1203
|
+
_nextProxy.processTelemetry(env, itemCtx);
|
|
1204
|
+
}
|
|
1205
|
+
}, function () { return ({ item: env }); }, !(env.sync));
|
|
1206
|
+
};
|
|
1462
1207
|
}
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1208
|
+
return TelemetryPluginChain;
|
|
1209
|
+
}());
|
|
1210
|
+
|
|
1211
|
+
function _createProxyChain(plugins, itemCtx) {
|
|
1212
|
+
var proxies = [];
|
|
1213
|
+
if (plugins && plugins.length > 0) {
|
|
1214
|
+
var lastProxy = null;
|
|
1215
|
+
for (var idx = 0; idx < plugins.length; idx++) {
|
|
1216
|
+
var thePlugin = plugins[idx];
|
|
1217
|
+
if (thePlugin && isFunction(thePlugin.processTelemetry)) {
|
|
1218
|
+
var newProxy = new TelemetryPluginChain(thePlugin, itemCtx);
|
|
1219
|
+
proxies.push(newProxy);
|
|
1220
|
+
if (lastProxy) {
|
|
1221
|
+
lastProxy.setNext(newProxy);
|
|
1222
|
+
}
|
|
1223
|
+
lastProxy = newProxy;
|
|
1469
1224
|
}
|
|
1470
1225
|
}
|
|
1471
1226
|
}
|
|
1472
|
-
return
|
|
1227
|
+
return proxies.length > 0 ? proxies[0] : null;
|
|
1473
1228
|
}
|
|
1474
|
-
function
|
|
1475
|
-
var
|
|
1476
|
-
var
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
plugins = createTelemetryProxyChain(plugins, config, core, startAt);
|
|
1229
|
+
function _copyProxyChain(proxy, itemCtx, startAt) {
|
|
1230
|
+
var plugins = [];
|
|
1231
|
+
var add = startAt ? false : true;
|
|
1232
|
+
if (proxy) {
|
|
1233
|
+
while (proxy) {
|
|
1234
|
+
var thePlugin = proxy.getPlugin();
|
|
1235
|
+
if (add || thePlugin === startAt) {
|
|
1236
|
+
add = true;
|
|
1237
|
+
plugins.push(thePlugin);
|
|
1238
|
+
}
|
|
1239
|
+
proxy = proxy.getNext();
|
|
1486
1240
|
}
|
|
1487
|
-
return createProcessTelemetryContext(plugins || context.getNext(), config, core, startAt);
|
|
1488
1241
|
}
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
return context;
|
|
1492
|
-
}
|
|
1493
|
-
function createProcessTelemetryUnloadContext(telemetryChain, config, core, startAt) {
|
|
1494
|
-
var internalContext = _createInternalContext(telemetryChain, config, core, startAt);
|
|
1495
|
-
var context = internalContext.ctx;
|
|
1496
|
-
function _processNext(unloadState) {
|
|
1497
|
-
var nextPlugin = internalContext._next();
|
|
1498
|
-
nextPlugin && nextPlugin.unload(context, unloadState);
|
|
1499
|
-
return !nextPlugin;
|
|
1500
|
-
}
|
|
1501
|
-
function _createNew(plugins, startAt) {
|
|
1502
|
-
if (plugins === void 0) { plugins = null; }
|
|
1503
|
-
if (isArray(plugins)) {
|
|
1504
|
-
plugins = createTelemetryProxyChain(plugins, config, core, startAt);
|
|
1505
|
-
}
|
|
1506
|
-
return createProcessTelemetryUnloadContext(plugins || context.getNext(), config, core, startAt);
|
|
1242
|
+
if (!add) {
|
|
1243
|
+
plugins.push(startAt);
|
|
1507
1244
|
}
|
|
1508
|
-
|
|
1509
|
-
context.createNew = _createNew;
|
|
1510
|
-
return context;
|
|
1245
|
+
return _createProxyChain(plugins, itemCtx);
|
|
1511
1246
|
}
|
|
1512
|
-
function
|
|
1513
|
-
var
|
|
1514
|
-
var
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1247
|
+
function _copyPluginChain(srcPlugins, itemCtx, startAt) {
|
|
1248
|
+
var plugins = srcPlugins;
|
|
1249
|
+
var add = false;
|
|
1250
|
+
if (startAt && srcPlugins) {
|
|
1251
|
+
plugins = [];
|
|
1252
|
+
arrForEach(srcPlugins, function (thePlugin) {
|
|
1253
|
+
if (add || thePlugin === startAt) {
|
|
1254
|
+
add = true;
|
|
1255
|
+
plugins.push(thePlugin);
|
|
1519
1256
|
}
|
|
1520
1257
|
});
|
|
1521
1258
|
}
|
|
1522
|
-
|
|
1523
|
-
if (plugins
|
|
1524
|
-
|
|
1525
|
-
plugins = createTelemetryProxyChain(plugins, config, core, startAt);
|
|
1259
|
+
if (startAt && !add) {
|
|
1260
|
+
if (!plugins) {
|
|
1261
|
+
plugins = [];
|
|
1526
1262
|
}
|
|
1527
|
-
|
|
1263
|
+
plugins.push(startAt);
|
|
1528
1264
|
}
|
|
1529
|
-
|
|
1530
|
-
context.createNew = _createNew;
|
|
1531
|
-
return context;
|
|
1265
|
+
return _createProxyChain(plugins, itemCtx);
|
|
1532
1266
|
}
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
add = true;
|
|
1267
|
+
var ProcessTelemetryContext = /** @class */ (function () {
|
|
1268
|
+
function ProcessTelemetryContext(plugins, config, core, startAt) {
|
|
1269
|
+
var _self = this;
|
|
1270
|
+
var _nextProxy = null;
|
|
1271
|
+
if (startAt !== null) {
|
|
1272
|
+
if (plugins && isFunction(plugins.getPlugin)) {
|
|
1273
|
+
_nextProxy = _copyProxyChain(plugins, _self, startAt || plugins.getPlugin());
|
|
1541
1274
|
}
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
firstProxy = newProxy;
|
|
1275
|
+
else {
|
|
1276
|
+
if (startAt) {
|
|
1277
|
+
_nextProxy = _copyPluginChain(plugins, _self, startAt);
|
|
1546
1278
|
}
|
|
1547
|
-
if (
|
|
1548
|
-
|
|
1279
|
+
else if (isUndefined(startAt)) {
|
|
1280
|
+
_nextProxy = _createProxyChain(plugins, _self);
|
|
1549
1281
|
}
|
|
1550
|
-
lastProxy_1 = newProxy;
|
|
1551
1282
|
}
|
|
1552
|
-
});
|
|
1553
|
-
}
|
|
1554
|
-
if (startAt && !firstProxy) {
|
|
1555
|
-
return createTelemetryProxyChain([startAt], config, core);
|
|
1556
|
-
}
|
|
1557
|
-
return firstProxy;
|
|
1558
|
-
}
|
|
1559
|
-
function createTelemetryPluginProxy(plugin, config, core) {
|
|
1560
|
-
var nextProxy = null;
|
|
1561
|
-
var hasProcessTelemetry = isFunction(plugin.processTelemetry);
|
|
1562
|
-
var hasSetNext = isFunction(plugin.setNextPlugin);
|
|
1563
|
-
var chainId;
|
|
1564
|
-
if (plugin) {
|
|
1565
|
-
chainId = plugin.identifier + "-" + plugin.priority + "-" + _chainId++;
|
|
1566
|
-
}
|
|
1567
|
-
else {
|
|
1568
|
-
chainId = "Unknown-0-" + _chainId++;
|
|
1569
|
-
}
|
|
1570
|
-
var proxyChain = {
|
|
1571
|
-
getPlugin: function () {
|
|
1572
|
-
return plugin;
|
|
1573
|
-
},
|
|
1574
|
-
getNext: function () {
|
|
1575
|
-
return nextProxy;
|
|
1576
|
-
},
|
|
1577
|
-
processTelemetry: _processTelemetry,
|
|
1578
|
-
unload: _unloadPlugin,
|
|
1579
|
-
update: _updatePlugin,
|
|
1580
|
-
_id: chainId,
|
|
1581
|
-
_setNext: function (nextPlugin) {
|
|
1582
|
-
nextProxy = nextPlugin;
|
|
1583
1283
|
}
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
}
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
}
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
hasRunContext = itemCtx[strHasRunFlags] = {};
|
|
1601
|
-
}
|
|
1602
|
-
itemCtx.setNext(nextProxy);
|
|
1603
|
-
if (plugin) {
|
|
1604
|
-
doPerf(itemCtx[strCore](), function () { return identifier + ":" + name; }, function () {
|
|
1605
|
-
hasRunContext[chainId] = true;
|
|
1606
|
-
try {
|
|
1607
|
-
var nextId = nextProxy ? nextProxy._id : strEmpty$1;
|
|
1608
|
-
if (nextId) {
|
|
1609
|
-
hasRunContext[nextId] = false;
|
|
1610
|
-
}
|
|
1611
|
-
hasRun = processPluginFn(itemCtx);
|
|
1612
|
-
}
|
|
1613
|
-
catch (error) {
|
|
1614
|
-
var hasNextRun = nextProxy ? hasRunContext[nextProxy._id] : true;
|
|
1615
|
-
if (hasNextRun) {
|
|
1616
|
-
hasRun = true;
|
|
1617
|
-
}
|
|
1618
|
-
if (!nextProxy || !hasNextRun) {
|
|
1619
|
-
_throwInternal(itemCtx.diagLog(), 1 , 73 , "Plugin [" + plugin.identifier + "] failed during " + name + " - " + dumpObj(error) + ", run flags: " + dumpObj(hasRunContext));
|
|
1620
|
-
}
|
|
1284
|
+
_self.core = function () {
|
|
1285
|
+
return core;
|
|
1286
|
+
};
|
|
1287
|
+
_self.diagLog = function () {
|
|
1288
|
+
return safeGetLogger(core, config);
|
|
1289
|
+
};
|
|
1290
|
+
_self.getCfg = function () {
|
|
1291
|
+
return config;
|
|
1292
|
+
};
|
|
1293
|
+
_self.getExtCfg = function (identifier, defaultValue) {
|
|
1294
|
+
if (defaultValue === void 0) { defaultValue = {}; }
|
|
1295
|
+
var theConfig;
|
|
1296
|
+
if (config) {
|
|
1297
|
+
var extConfig = config.extensionConfig;
|
|
1298
|
+
if (extConfig && identifier) {
|
|
1299
|
+
theConfig = extConfig[identifier];
|
|
1621
1300
|
}
|
|
1622
|
-
}, details, isAsync);
|
|
1623
|
-
}
|
|
1624
|
-
return hasRun;
|
|
1625
|
-
}
|
|
1626
|
-
function _processTelemetry(env, itemCtx) {
|
|
1627
|
-
itemCtx = itemCtx || _getTelCtx();
|
|
1628
|
-
function _callProcessTelemetry(itemCtx) {
|
|
1629
|
-
if (!plugin || !hasProcessTelemetry) {
|
|
1630
|
-
return false;
|
|
1631
1301
|
}
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1302
|
+
return (theConfig ? theConfig : defaultValue);
|
|
1303
|
+
};
|
|
1304
|
+
_self.getConfig = function (identifier, field, defaultValue) {
|
|
1305
|
+
if (defaultValue === void 0) { defaultValue = false; }
|
|
1306
|
+
var theValue;
|
|
1307
|
+
var extConfig = _self.getExtCfg(identifier, null);
|
|
1308
|
+
if (extConfig && !isNullOrUndefined(extConfig[field])) {
|
|
1309
|
+
theValue = extConfig[field];
|
|
1635
1310
|
}
|
|
1636
|
-
if (
|
|
1637
|
-
|
|
1311
|
+
else if (config && !isNullOrUndefined(config[field])) {
|
|
1312
|
+
theValue = config[field];
|
|
1638
1313
|
}
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
function
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
pluginState[strIsInitialized] = false;
|
|
1656
|
-
if (plugin[strTeardown] && plugin[strTeardown](unloadCtx, unloadState) === true) {
|
|
1657
|
-
hasRun = true;
|
|
1658
|
-
}
|
|
1659
|
-
}
|
|
1314
|
+
return !isNullOrUndefined(theValue) ? theValue : defaultValue;
|
|
1315
|
+
};
|
|
1316
|
+
_self.hasNext = function () {
|
|
1317
|
+
return _nextProxy != null;
|
|
1318
|
+
};
|
|
1319
|
+
_self.getNext = function () {
|
|
1320
|
+
return _nextProxy;
|
|
1321
|
+
};
|
|
1322
|
+
_self.setNext = function (nextPlugin) {
|
|
1323
|
+
_nextProxy = nextPlugin;
|
|
1324
|
+
};
|
|
1325
|
+
_self.processNext = function (env) {
|
|
1326
|
+
var nextPlugin = _nextProxy;
|
|
1327
|
+
if (nextPlugin) {
|
|
1328
|
+
_nextProxy = nextPlugin.getNext();
|
|
1329
|
+
nextPlugin.processTelemetry(env, _self);
|
|
1660
1330
|
}
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
}
|
|
1331
|
+
};
|
|
1332
|
+
_self.createNew = function (plugins, startAt) {
|
|
1333
|
+
if (plugins === void 0) { plugins = null; }
|
|
1334
|
+
return new ProcessTelemetryContext(plugins || _nextProxy, config, core, startAt);
|
|
1335
|
+
};
|
|
1666
1336
|
}
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1337
|
+
return ProcessTelemetryContext;
|
|
1338
|
+
}());
|
|
1339
|
+
|
|
1340
|
+
var strExtensionConfig = "extensionConfig";
|
|
1341
|
+
|
|
1342
|
+
var strGetPlugin = "getPlugin";
|
|
1343
|
+
var BaseTelemetryPlugin = /** @class */ (function () {
|
|
1344
|
+
function BaseTelemetryPlugin() {
|
|
1345
|
+
var _self = this;
|
|
1346
|
+
var _isinitialized = false;
|
|
1347
|
+
var _rootCtx = null;
|
|
1348
|
+
var _nextPlugin = null;
|
|
1349
|
+
_self.core = null;
|
|
1350
|
+
_self.diagLog = function (itemCtx) {
|
|
1351
|
+
return _self._getTelCtx(itemCtx).diagLog();
|
|
1352
|
+
};
|
|
1353
|
+
_self.isInitialized = function () {
|
|
1354
|
+
return _isinitialized;
|
|
1355
|
+
};
|
|
1356
|
+
_self.setInitialized = function (isInitialized) {
|
|
1357
|
+
_isinitialized = isInitialized;
|
|
1358
|
+
};
|
|
1359
|
+
_self.setNextPlugin = function (next) {
|
|
1360
|
+
_nextPlugin = next;
|
|
1361
|
+
};
|
|
1362
|
+
_self.processNext = function (env, itemCtx) {
|
|
1363
|
+
if (itemCtx) {
|
|
1364
|
+
itemCtx.processNext(env);
|
|
1365
|
+
}
|
|
1366
|
+
else if (_nextPlugin && isFunction(_nextPlugin.processTelemetry)) {
|
|
1367
|
+
_nextPlugin.processTelemetry(env, null);
|
|
1368
|
+
}
|
|
1369
|
+
};
|
|
1370
|
+
_self._getTelCtx = function (currentCtx) {
|
|
1371
|
+
if (currentCtx === void 0) { currentCtx = null; }
|
|
1372
|
+
var itemCtx = currentCtx;
|
|
1373
|
+
if (!itemCtx) {
|
|
1374
|
+
var rootCtx = _rootCtx || new ProcessTelemetryContext(null, {}, _self.core);
|
|
1375
|
+
if (_nextPlugin && _nextPlugin[strGetPlugin]) {
|
|
1376
|
+
itemCtx = rootCtx.createNew(null, _nextPlugin[strGetPlugin]);
|
|
1377
|
+
}
|
|
1378
|
+
else {
|
|
1379
|
+
itemCtx = rootCtx.createNew(null, _nextPlugin);
|
|
1677
1380
|
}
|
|
1678
1381
|
}
|
|
1679
|
-
return
|
|
1680
|
-
}
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1382
|
+
return itemCtx;
|
|
1383
|
+
};
|
|
1384
|
+
_self._baseTelInit = function (config, core, extensions, pluginChain) {
|
|
1385
|
+
if (config) {
|
|
1386
|
+
setValue(config, strExtensionConfig, [], null, isNullOrUndefined);
|
|
1387
|
+
}
|
|
1388
|
+
if (!pluginChain && core) {
|
|
1389
|
+
pluginChain = core.getProcessTelContext().getNext();
|
|
1390
|
+
}
|
|
1391
|
+
var nextPlugin = _nextPlugin;
|
|
1392
|
+
if (_nextPlugin && _nextPlugin[strGetPlugin]) {
|
|
1393
|
+
nextPlugin = _nextPlugin[strGetPlugin]();
|
|
1394
|
+
}
|
|
1395
|
+
_self.core = core;
|
|
1396
|
+
_rootCtx = new ProcessTelemetryContext(pluginChain, config, core, nextPlugin);
|
|
1397
|
+
_isinitialized = true;
|
|
1398
|
+
};
|
|
1684
1399
|
}
|
|
1685
|
-
|
|
1686
|
-
|
|
1400
|
+
BaseTelemetryPlugin.prototype.initialize = function (config, core, extensions, pluginChain) {
|
|
1401
|
+
this._baseTelInit(config, core, extensions, pluginChain);
|
|
1402
|
+
};
|
|
1403
|
+
return BaseTelemetryPlugin;
|
|
1404
|
+
}());
|
|
1687
1405
|
|
|
1688
1406
|
var strToGMTString = "toGMTString";
|
|
1689
1407
|
var strToUTCString = "toUTCString";
|
|
@@ -1693,6 +1411,7 @@ var strEnabled = "enabled";
|
|
|
1693
1411
|
var strIsCookieUseDisabled = "isCookieUseDisabled";
|
|
1694
1412
|
var strDisableCookiesUsage = "disableCookiesUsage";
|
|
1695
1413
|
var strConfigCookieMgr = "_ckMgr";
|
|
1414
|
+
var strEmpty = "";
|
|
1696
1415
|
var _supportsCookies = null;
|
|
1697
1416
|
var _allowUaSameSite = null;
|
|
1698
1417
|
var _parsedCookieValue = null;
|
|
@@ -1750,7 +1469,7 @@ function createCookieMgr(rootConfig, logger) {
|
|
|
1750
1469
|
var result = false;
|
|
1751
1470
|
if (_isMgrEnabled(cookieMgr)) {
|
|
1752
1471
|
var values = {};
|
|
1753
|
-
var theValue = strTrim(value || strEmpty
|
|
1472
|
+
var theValue = strTrim(value || strEmpty);
|
|
1754
1473
|
var idx = theValue.indexOf(";");
|
|
1755
1474
|
if (idx !== -1) {
|
|
1756
1475
|
theValue = strTrim(value.substring(0, idx));
|
|
@@ -1765,11 +1484,11 @@ function createCookieMgr(rootConfig, logger) {
|
|
|
1765
1484
|
if (expireMs > 0) {
|
|
1766
1485
|
var expiry = new Date();
|
|
1767
1486
|
expiry.setTime(expireMs);
|
|
1768
|
-
setValue(values, strExpires, _formatDate(expiry, !_isIE ? strToUTCString : strToGMTString) || _formatDate(expiry, _isIE ? strToGMTString : strToUTCString) || strEmpty
|
|
1487
|
+
setValue(values, strExpires, _formatDate(expiry, !_isIE ? strToUTCString : strToGMTString) || _formatDate(expiry, _isIE ? strToGMTString : strToUTCString) || strEmpty, isTruthy);
|
|
1769
1488
|
}
|
|
1770
1489
|
}
|
|
1771
1490
|
if (!_isIE) {
|
|
1772
|
-
setValue(values, "max-age", strEmpty
|
|
1491
|
+
setValue(values, "max-age", strEmpty + maxAgeSec, null, isUndefined);
|
|
1773
1492
|
}
|
|
1774
1493
|
}
|
|
1775
1494
|
var location_1 = getLocation();
|
|
@@ -1790,7 +1509,7 @@ function createCookieMgr(rootConfig, logger) {
|
|
|
1790
1509
|
return result;
|
|
1791
1510
|
},
|
|
1792
1511
|
get: function (name) {
|
|
1793
|
-
var value = strEmpty
|
|
1512
|
+
var value = strEmpty;
|
|
1794
1513
|
if (_isMgrEnabled(cookieMgr)) {
|
|
1795
1514
|
value = (cookieMgrConfig.getCookie || _getCookieValue)(name);
|
|
1796
1515
|
}
|
|
@@ -1815,7 +1534,7 @@ function createCookieMgr(rootConfig, logger) {
|
|
|
1815
1534
|
values["max-age"] = "0";
|
|
1816
1535
|
}
|
|
1817
1536
|
var delCookie = cookieMgrConfig.delCookie || _setCookieValue;
|
|
1818
|
-
delCookie(name, _formatCookieValue(strEmpty
|
|
1537
|
+
delCookie(name, _formatCookieValue(strEmpty, values));
|
|
1819
1538
|
result = true;
|
|
1820
1539
|
}
|
|
1821
1540
|
return result;
|
|
@@ -1832,7 +1551,7 @@ function areCookiesSupported(logger) {
|
|
|
1832
1551
|
_supportsCookies = doc[strCookie] !== undefined;
|
|
1833
1552
|
}
|
|
1834
1553
|
catch (e) {
|
|
1835
|
-
|
|
1554
|
+
logger && logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.CannotAccessCookie, "Cannot access document.cookie - " + getExceptionName(e), { exception: dumpObj(e) });
|
|
1836
1555
|
}
|
|
1837
1556
|
}
|
|
1838
1557
|
return _supportsCookies;
|
|
@@ -1842,7 +1561,7 @@ function _extractParts(theValue) {
|
|
|
1842
1561
|
if (theValue && theValue.length) {
|
|
1843
1562
|
var parts = strTrim(theValue).split(";");
|
|
1844
1563
|
arrForEach(parts, function (thePart) {
|
|
1845
|
-
thePart = strTrim(thePart || strEmpty
|
|
1564
|
+
thePart = strTrim(thePart || strEmpty);
|
|
1846
1565
|
if (thePart) {
|
|
1847
1566
|
var idx = thePart.indexOf("=");
|
|
1848
1567
|
if (idx === -1) {
|
|
@@ -1863,21 +1582,21 @@ function _formatDate(theDate, func) {
|
|
|
1863
1582
|
return null;
|
|
1864
1583
|
}
|
|
1865
1584
|
function _formatCookieValue(value, values) {
|
|
1866
|
-
var cookieValue = value || strEmpty
|
|
1585
|
+
var cookieValue = value || strEmpty;
|
|
1867
1586
|
objForEachKey(values, function (name, theValue) {
|
|
1868
|
-
cookieValue += "; " + name + (!isNullOrUndefined(theValue) ? "=" + theValue : strEmpty
|
|
1587
|
+
cookieValue += "; " + name + (!isNullOrUndefined(theValue) ? "=" + theValue : strEmpty);
|
|
1869
1588
|
});
|
|
1870
1589
|
return cookieValue;
|
|
1871
1590
|
}
|
|
1872
1591
|
function _getCookieValue(name) {
|
|
1873
|
-
var cookieValue = strEmpty
|
|
1592
|
+
var cookieValue = strEmpty;
|
|
1874
1593
|
if (_doc) {
|
|
1875
|
-
var theCookie = _doc[strCookie] || strEmpty
|
|
1594
|
+
var theCookie = _doc[strCookie] || strEmpty;
|
|
1876
1595
|
if (_parsedCookieValue !== theCookie) {
|
|
1877
1596
|
_cookieCache = _extractParts(theCookie);
|
|
1878
1597
|
_parsedCookieValue = theCookie;
|
|
1879
1598
|
}
|
|
1880
|
-
cookieValue = strTrim(_cookieCache[name] || strEmpty
|
|
1599
|
+
cookieValue = strTrim(_cookieCache[name] || strEmpty);
|
|
1881
1600
|
}
|
|
1882
1601
|
return cookieValue;
|
|
1883
1602
|
}
|
|
@@ -1911,290 +1630,86 @@ function uaDisallowsSameSiteNone(userAgent) {
|
|
|
1911
1630
|
return false;
|
|
1912
1631
|
}
|
|
1913
1632
|
|
|
1914
|
-
var
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
}
|
|
1923
|
-
function _runHandlers(unloadCtx, unloadState) {
|
|
1924
|
-
arrForEach(handlers, function (handler) {
|
|
1925
|
-
try {
|
|
1926
|
-
handler(unloadCtx, unloadState);
|
|
1927
|
-
}
|
|
1928
|
-
catch (e) {
|
|
1929
|
-
_throwInternal(unloadCtx.diagLog(), 2 , 73 , "Unexpected error calling unload handler - " + dumpObj(e));
|
|
1930
|
-
}
|
|
1931
|
-
});
|
|
1932
|
-
handlers = [];
|
|
1633
|
+
var UInt32Mask = 0x100000000;
|
|
1634
|
+
var MaxUInt32 = 0xffffffff;
|
|
1635
|
+
var _mwcSeeded = false;
|
|
1636
|
+
var _mwcW = 123456789;
|
|
1637
|
+
var _mwcZ = 987654321;
|
|
1638
|
+
function _mwcSeed(seedValue) {
|
|
1639
|
+
if (seedValue < 0) {
|
|
1640
|
+
seedValue >>>= 0;
|
|
1933
1641
|
}
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
};
|
|
1642
|
+
_mwcW = (123456789 + seedValue) & MaxUInt32;
|
|
1643
|
+
_mwcZ = (987654321 - seedValue) & MaxUInt32;
|
|
1644
|
+
_mwcSeeded = true;
|
|
1938
1645
|
}
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
var
|
|
1942
|
-
|
|
1943
|
-
var _self = this;
|
|
1944
|
-
var _isinitialized;
|
|
1945
|
-
var _rootCtx;
|
|
1946
|
-
var _nextPlugin;
|
|
1947
|
-
var _unloadHandlerContainer;
|
|
1948
|
-
var _hooks;
|
|
1949
|
-
_initDefaults();
|
|
1950
|
-
dynamicProto(BaseTelemetryPlugin, _self, function (_self) {
|
|
1951
|
-
_self.initialize = function (config, core, extensions, pluginChain) {
|
|
1952
|
-
_setDefaults(config, core, pluginChain);
|
|
1953
|
-
_isinitialized = true;
|
|
1954
|
-
};
|
|
1955
|
-
_self.teardown = function (unloadCtx, unloadState) {
|
|
1956
|
-
if (!_self.core || (unloadCtx && _self.core !== unloadCtx.core())) {
|
|
1957
|
-
return;
|
|
1958
|
-
}
|
|
1959
|
-
var result;
|
|
1960
|
-
var unloadDone = false;
|
|
1961
|
-
var theUnloadCtx = unloadCtx || createProcessTelemetryUnloadContext(null, {}, _self.core, _nextPlugin && _nextPlugin[strGetPlugin] ? _nextPlugin[strGetPlugin]() : _nextPlugin);
|
|
1962
|
-
var theUnloadState = unloadState || {
|
|
1963
|
-
reason: 0 ,
|
|
1964
|
-
isAsync: false
|
|
1965
|
-
};
|
|
1966
|
-
function _unloadCallback() {
|
|
1967
|
-
if (!unloadDone) {
|
|
1968
|
-
unloadDone = true;
|
|
1969
|
-
_unloadHandlerContainer.run(theUnloadCtx, unloadState);
|
|
1970
|
-
arrForEach(_hooks, function (fn) {
|
|
1971
|
-
fn.rm();
|
|
1972
|
-
});
|
|
1973
|
-
_hooks = [];
|
|
1974
|
-
if (result === true) {
|
|
1975
|
-
theUnloadCtx.processNext(theUnloadState);
|
|
1976
|
-
}
|
|
1977
|
-
_initDefaults();
|
|
1978
|
-
}
|
|
1979
|
-
}
|
|
1980
|
-
if (!_self[strDoTeardown] || _self[strDoTeardown](theUnloadCtx, theUnloadState, _unloadCallback) !== true) {
|
|
1981
|
-
_unloadCallback();
|
|
1982
|
-
}
|
|
1983
|
-
else {
|
|
1984
|
-
result = true;
|
|
1985
|
-
}
|
|
1986
|
-
return result;
|
|
1987
|
-
};
|
|
1988
|
-
_self.update = function (updateCtx, updateState) {
|
|
1989
|
-
if (!_self.core || (updateCtx && _self.core !== updateCtx.core())) {
|
|
1990
|
-
return;
|
|
1991
|
-
}
|
|
1992
|
-
var result;
|
|
1993
|
-
var updateDone = false;
|
|
1994
|
-
var theUpdateCtx = updateCtx || createProcessTelemetryUpdateContext(null, {}, _self.core, _nextPlugin && _nextPlugin[strGetPlugin] ? _nextPlugin[strGetPlugin]() : _nextPlugin);
|
|
1995
|
-
var theUpdateState = updateState || {
|
|
1996
|
-
reason: 0
|
|
1997
|
-
};
|
|
1998
|
-
function _updateCallback() {
|
|
1999
|
-
if (!updateDone) {
|
|
2000
|
-
updateDone = true;
|
|
2001
|
-
_setDefaults(theUpdateCtx.getCfg(), theUpdateCtx.core(), theUpdateCtx.getNext());
|
|
2002
|
-
}
|
|
2003
|
-
}
|
|
2004
|
-
if (!_self._doUpdate || _self._doUpdate(theUpdateCtx, theUpdateState, _updateCallback) !== true) {
|
|
2005
|
-
_updateCallback();
|
|
2006
|
-
}
|
|
2007
|
-
else {
|
|
2008
|
-
result = true;
|
|
2009
|
-
}
|
|
2010
|
-
return result;
|
|
2011
|
-
};
|
|
2012
|
-
_self._addHook = function (hooks) {
|
|
2013
|
-
if (hooks) {
|
|
2014
|
-
if (isArray(hooks)) {
|
|
2015
|
-
_hooks = _hooks.concat(hooks);
|
|
2016
|
-
}
|
|
2017
|
-
else {
|
|
2018
|
-
_hooks.push(hooks);
|
|
2019
|
-
}
|
|
2020
|
-
}
|
|
2021
|
-
};
|
|
2022
|
-
proxyFunctionAs(_self, "_addUnloadCb", function () { return _unloadHandlerContainer; }, "add");
|
|
2023
|
-
});
|
|
2024
|
-
_self.diagLog = function (itemCtx) {
|
|
2025
|
-
return _getTelCtx(itemCtx).diagLog();
|
|
2026
|
-
};
|
|
2027
|
-
_self[strIsInitialized] = function () {
|
|
2028
|
-
return _isinitialized;
|
|
2029
|
-
};
|
|
2030
|
-
_self.setInitialized = function (isInitialized) {
|
|
2031
|
-
_isinitialized = isInitialized;
|
|
2032
|
-
};
|
|
2033
|
-
_self[strSetNextPlugin] = function (next) {
|
|
2034
|
-
_nextPlugin = next;
|
|
2035
|
-
};
|
|
2036
|
-
_self.processNext = function (env, itemCtx) {
|
|
2037
|
-
if (itemCtx) {
|
|
2038
|
-
itemCtx.processNext(env);
|
|
2039
|
-
}
|
|
2040
|
-
else if (_nextPlugin && isFunction(_nextPlugin.processTelemetry)) {
|
|
2041
|
-
_nextPlugin.processTelemetry(env, null);
|
|
2042
|
-
}
|
|
2043
|
-
};
|
|
2044
|
-
_self._getTelCtx = _getTelCtx;
|
|
2045
|
-
function _getTelCtx(currentCtx) {
|
|
2046
|
-
if (currentCtx === void 0) { currentCtx = null; }
|
|
2047
|
-
var itemCtx = currentCtx;
|
|
2048
|
-
if (!itemCtx) {
|
|
2049
|
-
var rootCtx = _rootCtx || createProcessTelemetryContext(null, {}, _self.core);
|
|
2050
|
-
if (_nextPlugin && _nextPlugin[strGetPlugin]) {
|
|
2051
|
-
itemCtx = rootCtx.createNew(null, _nextPlugin[strGetPlugin]);
|
|
2052
|
-
}
|
|
2053
|
-
else {
|
|
2054
|
-
itemCtx = rootCtx.createNew(null, _nextPlugin);
|
|
2055
|
-
}
|
|
2056
|
-
}
|
|
2057
|
-
return itemCtx;
|
|
2058
|
-
}
|
|
2059
|
-
function _setDefaults(config, core, pluginChain) {
|
|
2060
|
-
if (config) {
|
|
2061
|
-
setValue(config, strExtensionConfig, [], null, isNullOrUndefined);
|
|
2062
|
-
}
|
|
2063
|
-
if (!pluginChain && core) {
|
|
2064
|
-
pluginChain = core.getProcessTelContext().getNext();
|
|
2065
|
-
}
|
|
2066
|
-
var nextPlugin = _nextPlugin;
|
|
2067
|
-
if (_nextPlugin && _nextPlugin[strGetPlugin]) {
|
|
2068
|
-
nextPlugin = _nextPlugin[strGetPlugin]();
|
|
2069
|
-
}
|
|
2070
|
-
_self.core = core;
|
|
2071
|
-
_rootCtx = createProcessTelemetryContext(pluginChain, config, core, nextPlugin);
|
|
2072
|
-
}
|
|
2073
|
-
function _initDefaults() {
|
|
2074
|
-
_isinitialized = false;
|
|
2075
|
-
_self.core = null;
|
|
2076
|
-
_rootCtx = null;
|
|
2077
|
-
_nextPlugin = null;
|
|
2078
|
-
_hooks = [];
|
|
2079
|
-
_unloadHandlerContainer = createUnloadHandlerContainer();
|
|
2080
|
-
}
|
|
1646
|
+
function _autoSeedMwc() {
|
|
1647
|
+
try {
|
|
1648
|
+
var now = dateNow() & 0x7fffffff;
|
|
1649
|
+
_mwcSeed(((Math.random() * UInt32Mask) ^ now) + now);
|
|
2081
1650
|
}
|
|
2082
|
-
|
|
2083
|
-
}());
|
|
2084
|
-
|
|
2085
|
-
var strOnPrefix = "on";
|
|
2086
|
-
var strAttachEvent = "attachEvent";
|
|
2087
|
-
var strAddEventHelper = "addEventListener";
|
|
2088
|
-
var strEvents = "events";
|
|
2089
|
-
createUniqueNamespace("aiEvtPageHide");
|
|
2090
|
-
createUniqueNamespace("aiEvtPageShow");
|
|
2091
|
-
var rRemoveEmptyNs = /\.[\.]+/g;
|
|
2092
|
-
var rRemoveTrailingEmptyNs = /[\.]+$/;
|
|
2093
|
-
var _guid = 1;
|
|
2094
|
-
var elmNodeData = createElmNodeData("events");
|
|
2095
|
-
var eventNamespace = /^([^.]*)(?:\.(.+)|)/;
|
|
2096
|
-
function _normalizeNamespace(name) {
|
|
2097
|
-
if (name && name.replace) {
|
|
2098
|
-
return name.replace(/^\s*\.*|\.*\s*$/g, "");
|
|
2099
|
-
}
|
|
2100
|
-
return name;
|
|
2101
|
-
}
|
|
2102
|
-
function _getEvtNamespace(eventName, evtNamespace) {
|
|
2103
|
-
if (evtNamespace) {
|
|
2104
|
-
var theNamespace_1 = "";
|
|
2105
|
-
if (isArray(evtNamespace)) {
|
|
2106
|
-
theNamespace_1 = "";
|
|
2107
|
-
arrForEach(evtNamespace, function (name) {
|
|
2108
|
-
name = _normalizeNamespace(name);
|
|
2109
|
-
if (name) {
|
|
2110
|
-
if (name[0] !== ".") {
|
|
2111
|
-
name = "." + name;
|
|
2112
|
-
}
|
|
2113
|
-
theNamespace_1 += name;
|
|
2114
|
-
}
|
|
2115
|
-
});
|
|
2116
|
-
}
|
|
2117
|
-
else {
|
|
2118
|
-
theNamespace_1 = _normalizeNamespace(evtNamespace);
|
|
2119
|
-
}
|
|
2120
|
-
if (theNamespace_1) {
|
|
2121
|
-
if (theNamespace_1[0] !== ".") {
|
|
2122
|
-
theNamespace_1 = "." + theNamespace_1;
|
|
2123
|
-
}
|
|
2124
|
-
eventName = (eventName || "") + theNamespace_1;
|
|
2125
|
-
}
|
|
1651
|
+
catch (e) {
|
|
2126
1652
|
}
|
|
2127
|
-
var parsedEvent = (eventNamespace.exec(eventName || "") || []);
|
|
2128
|
-
return {
|
|
2129
|
-
type: parsedEvent[1],
|
|
2130
|
-
ns: ((parsedEvent[2] || "").replace(rRemoveEmptyNs, ".").replace(rRemoveTrailingEmptyNs, "").split(".").sort()).join(".")
|
|
2131
|
-
};
|
|
2132
1653
|
}
|
|
2133
|
-
function
|
|
2134
|
-
if (
|
|
2135
|
-
|
|
2136
|
-
var registeredEvents = aiEvts[evtName];
|
|
2137
|
-
if (!registeredEvents) {
|
|
2138
|
-
registeredEvents = aiEvts[evtName] = [];
|
|
1654
|
+
function randomValue(maxValue) {
|
|
1655
|
+
if (maxValue > 0) {
|
|
1656
|
+
return Math.floor((random32() / MaxUInt32) * (maxValue + 1)) >>> 0;
|
|
2139
1657
|
}
|
|
2140
|
-
return
|
|
1658
|
+
return 0;
|
|
2141
1659
|
}
|
|
2142
|
-
function
|
|
2143
|
-
var
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
result = true;
|
|
1660
|
+
function random32(signed) {
|
|
1661
|
+
var value;
|
|
1662
|
+
var c = getCrypto() || getMsCrypto();
|
|
1663
|
+
if (c && c.getRandomValues) {
|
|
1664
|
+
value = c.getRandomValues(new Uint32Array(1))[0] & MaxUInt32;
|
|
1665
|
+
}
|
|
1666
|
+
else if (isIE()) {
|
|
1667
|
+
if (!_mwcSeeded) {
|
|
1668
|
+
_autoSeedMwc();
|
|
2152
1669
|
}
|
|
1670
|
+
value = mwcRandom32() & MaxUInt32;
|
|
2153
1671
|
}
|
|
2154
|
-
|
|
1672
|
+
else {
|
|
1673
|
+
value = Math.floor((UInt32Mask * Math.random()) | 0);
|
|
1674
|
+
}
|
|
1675
|
+
if (!signed) {
|
|
1676
|
+
value >>>= 0;
|
|
1677
|
+
}
|
|
1678
|
+
return value;
|
|
2155
1679
|
}
|
|
2156
|
-
function
|
|
2157
|
-
if (
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
result = _doAttach(target, evtName, handlerRef, useCapture);
|
|
2163
|
-
if (result && elmNodeData.accept(target)) {
|
|
2164
|
-
var registeredEvent = {
|
|
2165
|
-
guid: _guid++,
|
|
2166
|
-
evtName: evtName,
|
|
2167
|
-
handler: handlerRef,
|
|
2168
|
-
capture: useCapture
|
|
2169
|
-
};
|
|
2170
|
-
_getRegisteredEvents(target, evtName.type).push(registeredEvent);
|
|
2171
|
-
}
|
|
2172
|
-
}
|
|
2173
|
-
catch (e) {
|
|
2174
|
-
}
|
|
1680
|
+
function mwcRandomSeed(value) {
|
|
1681
|
+
if (!value) {
|
|
1682
|
+
_autoSeedMwc();
|
|
1683
|
+
}
|
|
1684
|
+
else {
|
|
1685
|
+
_mwcSeed(value);
|
|
2175
1686
|
}
|
|
2176
|
-
return result;
|
|
2177
1687
|
}
|
|
2178
|
-
function
|
|
2179
|
-
|
|
2180
|
-
|
|
1688
|
+
function mwcRandom32(signed) {
|
|
1689
|
+
_mwcZ = (36969 * (_mwcZ & 0xFFFF) + (_mwcZ >> 16)) & MaxUInt32;
|
|
1690
|
+
_mwcW = (18000 * (_mwcW & 0xFFFF) + (_mwcW >> 16)) & MaxUInt32;
|
|
1691
|
+
var value = (((_mwcZ << 16) + (_mwcW & 0xFFFF)) >>> 0) & MaxUInt32 | 0;
|
|
1692
|
+
if (!signed) {
|
|
1693
|
+
value >>>= 0;
|
|
1694
|
+
}
|
|
1695
|
+
return value;
|
|
2181
1696
|
}
|
|
2182
|
-
|
|
1697
|
+
|
|
1698
|
+
var _cookieMgrs = null;
|
|
1699
|
+
var _canUseCookies;
|
|
1700
|
+
function addEventHandler(eventName, callback) {
|
|
2183
1701
|
var result = false;
|
|
2184
1702
|
var w = getWindow();
|
|
2185
1703
|
if (w) {
|
|
2186
|
-
result =
|
|
2187
|
-
result =
|
|
1704
|
+
result = attachEvent(w, eventName, callback);
|
|
1705
|
+
result = attachEvent(w["body"], eventName, callback) || result;
|
|
2188
1706
|
}
|
|
2189
1707
|
var doc = getDocument();
|
|
2190
1708
|
if (doc) {
|
|
2191
|
-
result =
|
|
1709
|
+
result = attachEvent(doc, eventName, callback) || result;
|
|
2192
1710
|
}
|
|
2193
1711
|
return result;
|
|
2194
1712
|
}
|
|
2195
|
-
|
|
2196
|
-
var _cookieMgrs = null;
|
|
2197
|
-
var _canUseCookies;
|
|
2198
1713
|
function newGuid() {
|
|
2199
1714
|
function randomHexDigit() {
|
|
2200
1715
|
return randomValue(15);
|
|
@@ -2211,9 +1726,26 @@ function perfNow() {
|
|
|
2211
1726
|
}
|
|
2212
1727
|
return dateNow();
|
|
2213
1728
|
}
|
|
1729
|
+
function newId(maxLength) {
|
|
1730
|
+
if (maxLength === void 0) { maxLength = 22; }
|
|
1731
|
+
var base64chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
1732
|
+
var number = random32() >>> 0;
|
|
1733
|
+
var chars = 0;
|
|
1734
|
+
var result = "";
|
|
1735
|
+
while (result.length < maxLength) {
|
|
1736
|
+
chars++;
|
|
1737
|
+
result += base64chars.charAt(number & 0x3F);
|
|
1738
|
+
number >>>= 6;
|
|
1739
|
+
if (chars === 5) {
|
|
1740
|
+
number = (((random32() << 2) & 0xFFFFFFFF) | (number & 0x03)) >>> 0;
|
|
1741
|
+
chars = 0;
|
|
1742
|
+
}
|
|
1743
|
+
}
|
|
1744
|
+
return result;
|
|
1745
|
+
}
|
|
2214
1746
|
function generateW3CId() {
|
|
2215
1747
|
var hexValues = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"];
|
|
2216
|
-
var oct =
|
|
1748
|
+
var oct = "", tmp;
|
|
2217
1749
|
for (var a = 0; a < 4; a++) {
|
|
2218
1750
|
tmp = random32();
|
|
2219
1751
|
oct +=
|
|
@@ -2308,95 +1840,6 @@ function deleteCookie(logger, name) {
|
|
|
2308
1840
|
return _legacyCookieMgr(null, logger).del(name);
|
|
2309
1841
|
}
|
|
2310
1842
|
|
|
2311
|
-
createEnumStyle({
|
|
2312
|
-
CRITICAL: 1 ,
|
|
2313
|
-
WARNING: 2
|
|
2314
|
-
});
|
|
2315
|
-
var _InternalMessageId = createEnumStyle({
|
|
2316
|
-
BrowserDoesNotSupportLocalStorage: 0 ,
|
|
2317
|
-
BrowserCannotReadLocalStorage: 1 ,
|
|
2318
|
-
BrowserCannotReadSessionStorage: 2 ,
|
|
2319
|
-
BrowserCannotWriteLocalStorage: 3 ,
|
|
2320
|
-
BrowserCannotWriteSessionStorage: 4 ,
|
|
2321
|
-
BrowserFailedRemovalFromLocalStorage: 5 ,
|
|
2322
|
-
BrowserFailedRemovalFromSessionStorage: 6 ,
|
|
2323
|
-
CannotSendEmptyTelemetry: 7 ,
|
|
2324
|
-
ClientPerformanceMathError: 8 ,
|
|
2325
|
-
ErrorParsingAISessionCookie: 9 ,
|
|
2326
|
-
ErrorPVCalc: 10 ,
|
|
2327
|
-
ExceptionWhileLoggingError: 11 ,
|
|
2328
|
-
FailedAddingTelemetryToBuffer: 12 ,
|
|
2329
|
-
FailedMonitorAjaxAbort: 13 ,
|
|
2330
|
-
FailedMonitorAjaxDur: 14 ,
|
|
2331
|
-
FailedMonitorAjaxOpen: 15 ,
|
|
2332
|
-
FailedMonitorAjaxRSC: 16 ,
|
|
2333
|
-
FailedMonitorAjaxSend: 17 ,
|
|
2334
|
-
FailedMonitorAjaxGetCorrelationHeader: 18 ,
|
|
2335
|
-
FailedToAddHandlerForOnBeforeUnload: 19 ,
|
|
2336
|
-
FailedToSendQueuedTelemetry: 20 ,
|
|
2337
|
-
FailedToReportDataLoss: 21 ,
|
|
2338
|
-
FlushFailed: 22 ,
|
|
2339
|
-
MessageLimitPerPVExceeded: 23 ,
|
|
2340
|
-
MissingRequiredFieldSpecification: 24 ,
|
|
2341
|
-
NavigationTimingNotSupported: 25 ,
|
|
2342
|
-
OnError: 26 ,
|
|
2343
|
-
SessionRenewalDateIsZero: 27 ,
|
|
2344
|
-
SenderNotInitialized: 28 ,
|
|
2345
|
-
StartTrackEventFailed: 29 ,
|
|
2346
|
-
StopTrackEventFailed: 30 ,
|
|
2347
|
-
StartTrackFailed: 31 ,
|
|
2348
|
-
StopTrackFailed: 32 ,
|
|
2349
|
-
TelemetrySampledAndNotSent: 33 ,
|
|
2350
|
-
TrackEventFailed: 34 ,
|
|
2351
|
-
TrackExceptionFailed: 35 ,
|
|
2352
|
-
TrackMetricFailed: 36 ,
|
|
2353
|
-
TrackPVFailed: 37 ,
|
|
2354
|
-
TrackPVFailedCalc: 38 ,
|
|
2355
|
-
TrackTraceFailed: 39 ,
|
|
2356
|
-
TransmissionFailed: 40 ,
|
|
2357
|
-
FailedToSetStorageBuffer: 41 ,
|
|
2358
|
-
FailedToRestoreStorageBuffer: 42 ,
|
|
2359
|
-
InvalidBackendResponse: 43 ,
|
|
2360
|
-
FailedToFixDepricatedValues: 44 ,
|
|
2361
|
-
InvalidDurationValue: 45 ,
|
|
2362
|
-
TelemetryEnvelopeInvalid: 46 ,
|
|
2363
|
-
CreateEnvelopeError: 47 ,
|
|
2364
|
-
CannotSerializeObject: 48 ,
|
|
2365
|
-
CannotSerializeObjectNonSerializable: 49 ,
|
|
2366
|
-
CircularReferenceDetected: 50 ,
|
|
2367
|
-
ClearAuthContextFailed: 51 ,
|
|
2368
|
-
ExceptionTruncated: 52 ,
|
|
2369
|
-
IllegalCharsInName: 53 ,
|
|
2370
|
-
ItemNotInArray: 54 ,
|
|
2371
|
-
MaxAjaxPerPVExceeded: 55 ,
|
|
2372
|
-
MessageTruncated: 56 ,
|
|
2373
|
-
NameTooLong: 57 ,
|
|
2374
|
-
SampleRateOutOfRange: 58 ,
|
|
2375
|
-
SetAuthContextFailed: 59 ,
|
|
2376
|
-
SetAuthContextFailedAccountName: 60 ,
|
|
2377
|
-
StringValueTooLong: 61 ,
|
|
2378
|
-
StartCalledMoreThanOnce: 62 ,
|
|
2379
|
-
StopCalledWithoutStart: 63 ,
|
|
2380
|
-
TelemetryInitializerFailed: 64 ,
|
|
2381
|
-
TrackArgumentsNotSpecified: 65 ,
|
|
2382
|
-
UrlTooLong: 66 ,
|
|
2383
|
-
SessionStorageBufferFull: 67 ,
|
|
2384
|
-
CannotAccessCookie: 68 ,
|
|
2385
|
-
IdTooLong: 69 ,
|
|
2386
|
-
InvalidEvent: 70 ,
|
|
2387
|
-
FailedMonitorAjaxSetRequestHeader: 71 ,
|
|
2388
|
-
SendBrowserInfoOnUserInit: 72 ,
|
|
2389
|
-
PluginException: 73 ,
|
|
2390
|
-
NotificationException: 74 ,
|
|
2391
|
-
SnippetScriptLoadFailure: 99 ,
|
|
2392
|
-
InvalidInstrumentationKey: 100 ,
|
|
2393
|
-
CannotParseAiBlobValue: 101 ,
|
|
2394
|
-
InvalidContentBlob: 102 ,
|
|
2395
|
-
TrackPageActionEventFailed: 103 ,
|
|
2396
|
-
FailedAddingCustomDefinedRequestContext: 104 ,
|
|
2397
|
-
InMemoryStorageBufferFull: 105
|
|
2398
|
-
});
|
|
2399
|
-
|
|
2400
1843
|
var aiInstrumentHooks = "_aiHooks";
|
|
2401
1844
|
var cbNames = [
|
|
2402
1845
|
"req", "rsp", "hkErr", "fnErr"
|
|
@@ -2455,7 +1898,6 @@ function _createFunctionHook(aiHook) {
|
|
|
2455
1898
|
};
|
|
2456
1899
|
var hookCtx = [];
|
|
2457
1900
|
var cbArgs = _createArgs([funcArgs], orgArgs);
|
|
2458
|
-
funcArgs.evt = getGlobalInst("event");
|
|
2459
1901
|
function _createArgs(target, theArgs) {
|
|
2460
1902
|
_arrLoop(theArgs, function (arg) {
|
|
2461
1903
|
target.push(arg);
|
|
@@ -2549,7 +1991,6 @@ function createDomEvent(eventName) {
|
|
|
2549
1991
|
return event;
|
|
2550
1992
|
}
|
|
2551
1993
|
|
|
2552
|
-
var strEmpty = "";
|
|
2553
1994
|
function stringToBoolOrDefault(str, defaultValue) {
|
|
2554
1995
|
if (defaultValue === void 0) { defaultValue = false; }
|
|
2555
1996
|
if (str === undefined || str === null) {
|
|
@@ -2562,16 +2003,16 @@ function msToTimeSpan(totalms) {
|
|
|
2562
2003
|
totalms = 0;
|
|
2563
2004
|
}
|
|
2564
2005
|
totalms = Math.round(totalms);
|
|
2565
|
-
var ms =
|
|
2566
|
-
var sec =
|
|
2567
|
-
var min =
|
|
2568
|
-
var hour =
|
|
2006
|
+
var ms = "" + totalms % 1000;
|
|
2007
|
+
var sec = "" + Math.floor(totalms / 1000) % 60;
|
|
2008
|
+
var min = "" + Math.floor(totalms / (1000 * 60)) % 60;
|
|
2009
|
+
var hour = "" + Math.floor(totalms / (1000 * 60 * 60)) % 24;
|
|
2569
2010
|
var days = Math.floor(totalms / (1000 * 60 * 60 * 24));
|
|
2570
2011
|
ms = ms.length === 1 ? "00" + ms : ms.length === 2 ? "0" + ms : ms;
|
|
2571
2012
|
sec = sec.length < 2 ? "0" + sec : sec;
|
|
2572
2013
|
min = min.length < 2 ? "0" + min : min;
|
|
2573
2014
|
hour = hour.length < 2 ? "0" + hour : hour;
|
|
2574
|
-
return (days > 0 ? days + "." :
|
|
2015
|
+
return (days > 0 ? days + "." : "") + hour + ":" + min + ":" + sec + "." + ms;
|
|
2575
2016
|
}
|
|
2576
2017
|
function getExtensionByName(extensions, identifier) {
|
|
2577
2018
|
var extension = null;
|
|
@@ -2589,15 +2030,17 @@ function isCrossOriginError(message, url, lineNumber, columnNumber, error) {
|
|
|
2589
2030
|
|
|
2590
2031
|
var strNotSpecified = "not_specified";
|
|
2591
2032
|
|
|
2592
|
-
var StorageType
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2033
|
+
var StorageType;
|
|
2034
|
+
(function (StorageType) {
|
|
2035
|
+
StorageType[StorageType["LocalStorage"] = 0] = "LocalStorage";
|
|
2036
|
+
StorageType[StorageType["SessionStorage"] = 1] = "SessionStorage";
|
|
2037
|
+
})(StorageType || (StorageType = {}));
|
|
2038
|
+
var DistributedTracingModes;
|
|
2039
|
+
(function (DistributedTracingModes) {
|
|
2040
|
+
DistributedTracingModes[DistributedTracingModes["AI"] = 0] = "AI";
|
|
2041
|
+
DistributedTracingModes[DistributedTracingModes["AI_AND_W3C"] = 1] = "AI_AND_W3C";
|
|
2042
|
+
DistributedTracingModes[DistributedTracingModes["W3C"] = 2] = "W3C";
|
|
2043
|
+
})(DistributedTracingModes || (DistributedTracingModes = {}));
|
|
2601
2044
|
|
|
2602
2045
|
var _canUseLocalStorage = undefined;
|
|
2603
2046
|
var _canUseSessionStorage = undefined;
|
|
@@ -2635,8 +2078,8 @@ function utlDisableStorage() {
|
|
|
2635
2078
|
_canUseLocalStorage = false;
|
|
2636
2079
|
_canUseSessionStorage = false;
|
|
2637
2080
|
}
|
|
2638
|
-
function utlCanUseLocalStorage(
|
|
2639
|
-
if (
|
|
2081
|
+
function utlCanUseLocalStorage() {
|
|
2082
|
+
if (_canUseLocalStorage === undefined) {
|
|
2640
2083
|
_canUseLocalStorage = !!_getVerifiedStorageObject(StorageType.LocalStorage);
|
|
2641
2084
|
}
|
|
2642
2085
|
return _canUseLocalStorage;
|
|
@@ -2649,7 +2092,7 @@ function utlGetLocalStorage(logger, name) {
|
|
|
2649
2092
|
}
|
|
2650
2093
|
catch (e) {
|
|
2651
2094
|
_canUseLocalStorage = false;
|
|
2652
|
-
|
|
2095
|
+
logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.BrowserCannotReadLocalStorage, "Browser failed read of local storage. " + getExceptionName(e), { exception: dumpObj(e) });
|
|
2653
2096
|
}
|
|
2654
2097
|
}
|
|
2655
2098
|
return null;
|
|
@@ -2663,7 +2106,7 @@ function utlSetLocalStorage(logger, name, data) {
|
|
|
2663
2106
|
}
|
|
2664
2107
|
catch (e) {
|
|
2665
2108
|
_canUseLocalStorage = false;
|
|
2666
|
-
|
|
2109
|
+
logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.BrowserCannotWriteLocalStorage, "Browser failed write to local storage. " + getExceptionName(e), { exception: dumpObj(e) });
|
|
2667
2110
|
}
|
|
2668
2111
|
}
|
|
2669
2112
|
return false;
|
|
@@ -2677,13 +2120,13 @@ function utlRemoveStorage(logger, name) {
|
|
|
2677
2120
|
}
|
|
2678
2121
|
catch (e) {
|
|
2679
2122
|
_canUseLocalStorage = false;
|
|
2680
|
-
|
|
2123
|
+
logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.BrowserFailedRemovalFromLocalStorage, "Browser failed removal of local storage item. " + getExceptionName(e), { exception: dumpObj(e) });
|
|
2681
2124
|
}
|
|
2682
2125
|
}
|
|
2683
2126
|
return false;
|
|
2684
2127
|
}
|
|
2685
|
-
function utlCanUseSessionStorage(
|
|
2686
|
-
if (
|
|
2128
|
+
function utlCanUseSessionStorage() {
|
|
2129
|
+
if (_canUseSessionStorage === undefined) {
|
|
2687
2130
|
_canUseSessionStorage = !!_getVerifiedStorageObject(StorageType.SessionStorage);
|
|
2688
2131
|
}
|
|
2689
2132
|
return _canUseSessionStorage;
|
|
@@ -2705,7 +2148,7 @@ function utlGetSessionStorage(logger, name) {
|
|
|
2705
2148
|
}
|
|
2706
2149
|
catch (e) {
|
|
2707
2150
|
_canUseSessionStorage = false;
|
|
2708
|
-
|
|
2151
|
+
logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.BrowserCannotReadSessionStorage, "Browser failed read of session storage. " + getExceptionName(e), { exception: dumpObj(e) });
|
|
2709
2152
|
}
|
|
2710
2153
|
}
|
|
2711
2154
|
return null;
|
|
@@ -2719,7 +2162,7 @@ function utlSetSessionStorage(logger, name, data) {
|
|
|
2719
2162
|
}
|
|
2720
2163
|
catch (e) {
|
|
2721
2164
|
_canUseSessionStorage = false;
|
|
2722
|
-
|
|
2165
|
+
logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.BrowserCannotWriteSessionStorage, "Browser failed write to session storage. " + getExceptionName(e), { exception: dumpObj(e) });
|
|
2723
2166
|
}
|
|
2724
2167
|
}
|
|
2725
2168
|
return false;
|
|
@@ -2733,7 +2176,7 @@ function utlRemoveSessionStorage(logger, name) {
|
|
|
2733
2176
|
}
|
|
2734
2177
|
catch (e) {
|
|
2735
2178
|
_canUseSessionStorage = false;
|
|
2736
|
-
|
|
2179
|
+
logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.BrowserFailedRemovalFromSessionStorage, "Browser failed removal of session storage item. " + getExceptionName(e), { exception: dumpObj(e) });
|
|
2737
2180
|
}
|
|
2738
2181
|
}
|
|
2739
2182
|
return false;
|
|
@@ -2745,7 +2188,7 @@ var _internalEndpoints = [
|
|
|
2745
2188
|
"https://dc-int.services.visualstudio.com/v2/track"
|
|
2746
2189
|
];
|
|
2747
2190
|
function isInternalApplicationInsightsEndpoint(endpointUrl) {
|
|
2748
|
-
return _internalEndpoints
|
|
2191
|
+
return arrIndexOf(_internalEndpoints, endpointUrl.toLowerCase()) !== -1;
|
|
2749
2192
|
}
|
|
2750
2193
|
var Util = {
|
|
2751
2194
|
NotSpecified: strNotSpecified,
|
|
@@ -2864,7 +2307,7 @@ var FilterList = /** @class */ (function () {
|
|
|
2864
2307
|
ch.childNodes[0].className = "checkbox off";
|
|
2865
2308
|
}
|
|
2866
2309
|
}
|
|
2867
|
-
_self.filterList.splice(_self.filterList
|
|
2310
|
+
_self.filterList.splice(arrIndexOf(_self.filterList, t), 1);
|
|
2868
2311
|
checkbox.className = "checkbox on";
|
|
2869
2312
|
}
|
|
2870
2313
|
else {
|
|
@@ -3114,7 +2557,7 @@ function getTargetKeys(target, excludedKeys, includeFunctions) {
|
|
|
3114
2557
|
if (propKeys) {
|
|
3115
2558
|
arrForEach(propKeys, function (key) {
|
|
3116
2559
|
var theKey = _toString(key);
|
|
3117
|
-
if (theKey && keys
|
|
2560
|
+
if (theKey && arrIndexOf(keys, theKey) === -1) {
|
|
3118
2561
|
keys.push(key);
|
|
3119
2562
|
}
|
|
3120
2563
|
});
|
|
@@ -3130,7 +2573,7 @@ function getTargetKeys(target, excludedKeys, includeFunctions) {
|
|
|
3130
2573
|
return;
|
|
3131
2574
|
}
|
|
3132
2575
|
var theKey = _toString(key);
|
|
3133
|
-
if (theKey && excludedKeys
|
|
2576
|
+
if (theKey && arrIndexOf(excludedKeys, theKey) === -1) {
|
|
3134
2577
|
theKeys.push(theKey);
|
|
3135
2578
|
}
|
|
3136
2579
|
});
|
|
@@ -3172,7 +2615,7 @@ function formatLogElements(target, tmLabel, key, level, textFilter, excludeKeys,
|
|
|
3172
2615
|
}
|
|
3173
2616
|
for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {
|
|
3174
2617
|
var key_1 = keys_1[_i];
|
|
3175
|
-
if (excludeKeys
|
|
2618
|
+
if (arrIndexOf(excludeKeys, key_1) !== -1) {
|
|
3176
2619
|
continue;
|
|
3177
2620
|
}
|
|
3178
2621
|
var targetValue = target[key_1];
|
|
@@ -3362,7 +2805,7 @@ var LogEntry = /** @class */ (function () {
|
|
|
3362
2805
|
}
|
|
3363
2806
|
}
|
|
3364
2807
|
else if (isString(value) || isNumber(value) || isBoolean(value)) {
|
|
3365
|
-
return _testValue(rg,
|
|
2808
|
+
return _testValue(rg, value.toString());
|
|
3366
2809
|
}
|
|
3367
2810
|
}
|
|
3368
2811
|
return false;
|
|
@@ -3505,11 +2948,11 @@ var Dashboard = /** @class */ (function () {
|
|
|
3505
2948
|
return;
|
|
3506
2949
|
}
|
|
3507
2950
|
var type = entry.getKind();
|
|
3508
|
-
var allowOther = excludedTypes_1
|
|
3509
|
-
if (trackers
|
|
2951
|
+
var allowOther = arrIndexOf(excludedTypes_1, "other") === -1;
|
|
2952
|
+
if (arrIndexOf(trackers, type) === -1 && !allowOther) {
|
|
3510
2953
|
return;
|
|
3511
2954
|
}
|
|
3512
|
-
else if (excludedTypes_1
|
|
2955
|
+
else if (arrIndexOf(excludedTypes_1, type) !== -1) {
|
|
3513
2956
|
return;
|
|
3514
2957
|
}
|
|
3515
2958
|
var newEl = entry.render(textFilter, config.excludeKeys, config.includeFunctions);
|
|
@@ -3783,16 +3226,16 @@ var DebugPlugin = /** @class */ (function (_super) {
|
|
|
3783
3226
|
dashboard.newLogEntry(perfEvent, dateNow() - startTime, evtName, 0, "perfEvent");
|
|
3784
3227
|
}
|
|
3785
3228
|
});
|
|
3786
|
-
if (trackers
|
|
3229
|
+
if (arrIndexOf(trackers, "eventsSent") !== -1) {
|
|
3787
3230
|
foundTrackers_1.push("eventsSent");
|
|
3788
3231
|
}
|
|
3789
|
-
if (trackers
|
|
3232
|
+
if (arrIndexOf(trackers, "eventsSendRequest") !== -1) {
|
|
3790
3233
|
foundTrackers_1.push("eventsSendRequest");
|
|
3791
3234
|
}
|
|
3792
|
-
if (trackers
|
|
3235
|
+
if (arrIndexOf(trackers, "eventsDiscarded") !== -1) {
|
|
3793
3236
|
foundTrackers_1.push("eventsDiscarded");
|
|
3794
3237
|
}
|
|
3795
|
-
if (trackers
|
|
3238
|
+
if (arrIndexOf(trackers, "perfEvent") !== -1) {
|
|
3796
3239
|
foundTrackers_1.push("perfEvent");
|
|
3797
3240
|
}
|
|
3798
3241
|
}
|
|
@@ -3828,7 +3271,7 @@ var DebugPlugin = /** @class */ (function (_super) {
|
|
|
3828
3271
|
rsp: _handleInstPostHook()
|
|
3829
3272
|
}, true);
|
|
3830
3273
|
if (val) {
|
|
3831
|
-
if (foundTrackers_1
|
|
3274
|
+
if (arrIndexOf(foundTrackers_1, tracker) === -1) {
|
|
3832
3275
|
foundTrackers_1.push(tracker);
|
|
3833
3276
|
}
|
|
3834
3277
|
}
|
|
@@ -3865,7 +3308,7 @@ var DebugPlugin = /** @class */ (function (_super) {
|
|
|
3865
3308
|
}
|
|
3866
3309
|
};
|
|
3867
3310
|
function _addTarget(targetObjects, ext) {
|
|
3868
|
-
if (ext && targetObjects
|
|
3311
|
+
if (ext && arrIndexOf(targetObjects, ext) === -1) {
|
|
3869
3312
|
targetObjects.push(ext);
|
|
3870
3313
|
return true;
|
|
3871
3314
|
}
|
|
@@ -3968,4 +3411,4 @@ var DebugPlugin = /** @class */ (function (_super) {
|
|
|
3968
3411
|
var DebugPlugin$1 = DebugPlugin;
|
|
3969
3412
|
|
|
3970
3413
|
exports.DebugPlugin = DebugPlugin$1;
|
|
3971
|
-
//# sourceMappingURL=ai.dbg.2.7.5
|
|
3414
|
+
//# sourceMappingURL=ai.dbg.2.7.5.cjs.js.map
|