@microsoft/applicationinsights-clickanalytics-js 2.8.0-beta.2202-06 → 2.8.0-beta.2203-02
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/{ai.clck.2.8.0-beta.2202-06.cjs.js → ai.clck.2.8.0-beta.2203-02.cjs.js} +607 -214
- package/browser/ai.clck.2.8.0-beta.2203-02.cjs.js.map +1 -0
- package/browser/ai.clck.2.8.0-beta.2203-02.cjs.min.js +6 -0
- package/browser/ai.clck.2.8.0-beta.2203-02.cjs.min.js.map +1 -0
- package/browser/{ai.clck.2.8.0-beta.2202-06.gbl.js → ai.clck.2.8.0-beta.2203-02.gbl.js} +607 -214
- package/browser/ai.clck.2.8.0-beta.2203-02.gbl.js.map +1 -0
- package/browser/ai.clck.2.8.0-beta.2203-02.gbl.min.js +6 -0
- package/browser/ai.clck.2.8.0-beta.2203-02.gbl.min.js.map +1 -0
- package/browser/ai.clck.2.8.0-beta.2203-02.integrity.json +66 -0
- package/browser/{ai.clck.2.8.0-beta.2202-06.js → ai.clck.2.8.0-beta.2203-02.js} +607 -214
- package/browser/ai.clck.2.8.0-beta.2203-02.js.map +1 -0
- package/browser/ai.clck.2.8.0-beta.2203-02.min.js +6 -0
- package/browser/ai.clck.2.8.0-beta.2203-02.min.js.map +1 -0
- package/browser/ai.clck.2.cjs.js +606 -213
- package/browser/ai.clck.2.cjs.js.map +1 -1
- package/browser/ai.clck.2.cjs.min.js +2 -2
- package/browser/ai.clck.2.cjs.min.js.map +1 -1
- package/browser/ai.clck.2.gbl.js +606 -213
- package/browser/ai.clck.2.gbl.js.map +1 -1
- package/browser/ai.clck.2.gbl.min.js +2 -2
- package/browser/ai.clck.2.gbl.min.js.map +1 -1
- package/browser/ai.clck.2.js +606 -213
- package/browser/ai.clck.2.js.map +1 -1
- package/browser/ai.clck.2.min.js +2 -2
- package/browser/ai.clck.2.min.js.map +1 -1
- package/dist/applicationinsights-clickanalytics-js.d.ts +1 -1
- package/dist/applicationinsights-clickanalytics-js.js +606 -213
- package/dist/applicationinsights-clickanalytics-js.js.map +1 -1
- package/dist/applicationinsights-clickanalytics-js.min.js +2 -2
- package/dist/applicationinsights-clickanalytics-js.min.js.map +1 -1
- package/dist/applicationinsights-clickanalytics-js.rollup.d.ts +1 -1
- package/dist-esm/Behaviours.js +1 -1
- package/dist-esm/ClickAnalyticsPlugin.js +2 -2
- package/dist-esm/ClickAnalyticsPlugin.js.map +1 -1
- package/dist-esm/DataCollector.js +1 -1
- package/dist-esm/Enums.js +1 -1
- package/dist-esm/Interfaces/Datamodel.js +1 -1
- package/dist-esm/applicationinsights-clickanalytics-js.js +1 -1
- package/dist-esm/common/Utils.js +1 -1
- package/dist-esm/events/PageAction.js +1 -1
- package/dist-esm/events/WebEvent.js +1 -1
- package/dist-esm/handlers/AutoCaptureHandler.js +1 -1
- package/dist-esm/handlers/DomContentHandler.js +1 -1
- package/package.json +4 -4
- package/src/ClickAnalyticsPlugin.ts +1 -1
- package/browser/ai.clck.2.8.0-beta.2202-06.cjs.js.map +0 -1
- package/browser/ai.clck.2.8.0-beta.2202-06.cjs.min.js +0 -6
- package/browser/ai.clck.2.8.0-beta.2202-06.cjs.min.js.map +0 -1
- package/browser/ai.clck.2.8.0-beta.2202-06.gbl.js.map +0 -1
- package/browser/ai.clck.2.8.0-beta.2202-06.gbl.min.js +0 -6
- package/browser/ai.clck.2.8.0-beta.2202-06.gbl.min.js.map +0 -1
- package/browser/ai.clck.2.8.0-beta.2202-06.integrity.json +0 -66
- package/browser/ai.clck.2.8.0-beta.2202-06.js.map +0 -1
- package/browser/ai.clck.2.8.0-beta.2202-06.min.js +0 -6
- package/browser/ai.clck.2.8.0-beta.2202-06.min.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Application Insights JavaScript SDK - Click Analytics, 2.8.0-beta.
|
|
2
|
+
* Application Insights JavaScript SDK - Click Analytics, 2.8.0-beta.2203-02
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
this.Microsoft = this.Microsoft || {};
|
|
@@ -333,108 +333,26 @@ this.Microsoft = this.Microsoft || {};
|
|
|
333
333
|
};
|
|
334
334
|
dynamicProto[DynProtoDefaultOptions] = perfDefaults;
|
|
335
335
|
|
|
336
|
-
var
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
var
|
|
342
|
-
|
|
343
|
-
BrowserCannotReadLocalStorage: 1,
|
|
344
|
-
BrowserCannotReadSessionStorage: 2,
|
|
345
|
-
BrowserCannotWriteLocalStorage: 3,
|
|
346
|
-
BrowserCannotWriteSessionStorage: 4,
|
|
347
|
-
BrowserFailedRemovalFromLocalStorage: 5,
|
|
348
|
-
BrowserFailedRemovalFromSessionStorage: 6,
|
|
349
|
-
CannotSendEmptyTelemetry: 7,
|
|
350
|
-
ClientPerformanceMathError: 8,
|
|
351
|
-
ErrorParsingAISessionCookie: 9,
|
|
352
|
-
ErrorPVCalc: 10,
|
|
353
|
-
ExceptionWhileLoggingError: 11,
|
|
354
|
-
FailedAddingTelemetryToBuffer: 12,
|
|
355
|
-
FailedMonitorAjaxAbort: 13,
|
|
356
|
-
FailedMonitorAjaxDur: 14,
|
|
357
|
-
FailedMonitorAjaxOpen: 15,
|
|
358
|
-
FailedMonitorAjaxRSC: 16,
|
|
359
|
-
FailedMonitorAjaxSend: 17,
|
|
360
|
-
FailedMonitorAjaxGetCorrelationHeader: 18,
|
|
361
|
-
FailedToAddHandlerForOnBeforeUnload: 19,
|
|
362
|
-
FailedToSendQueuedTelemetry: 20,
|
|
363
|
-
FailedToReportDataLoss: 21,
|
|
364
|
-
FlushFailed: 22,
|
|
365
|
-
MessageLimitPerPVExceeded: 23,
|
|
366
|
-
MissingRequiredFieldSpecification: 24,
|
|
367
|
-
NavigationTimingNotSupported: 25,
|
|
368
|
-
OnError: 26,
|
|
369
|
-
SessionRenewalDateIsZero: 27,
|
|
370
|
-
SenderNotInitialized: 28,
|
|
371
|
-
StartTrackEventFailed: 29,
|
|
372
|
-
StopTrackEventFailed: 30,
|
|
373
|
-
StartTrackFailed: 31,
|
|
374
|
-
StopTrackFailed: 32,
|
|
375
|
-
TelemetrySampledAndNotSent: 33,
|
|
376
|
-
TrackEventFailed: 34,
|
|
377
|
-
TrackExceptionFailed: 35,
|
|
378
|
-
TrackMetricFailed: 36,
|
|
379
|
-
TrackPVFailed: 37,
|
|
380
|
-
TrackPVFailedCalc: 38,
|
|
381
|
-
TrackTraceFailed: 39,
|
|
382
|
-
TransmissionFailed: 40,
|
|
383
|
-
FailedToSetStorageBuffer: 41,
|
|
384
|
-
FailedToRestoreStorageBuffer: 42,
|
|
385
|
-
InvalidBackendResponse: 43,
|
|
386
|
-
FailedToFixDepricatedValues: 44,
|
|
387
|
-
InvalidDurationValue: 45,
|
|
388
|
-
TelemetryEnvelopeInvalid: 46,
|
|
389
|
-
CreateEnvelopeError: 47,
|
|
390
|
-
CannotSerializeObject: 48,
|
|
391
|
-
CannotSerializeObjectNonSerializable: 49,
|
|
392
|
-
CircularReferenceDetected: 50,
|
|
393
|
-
ClearAuthContextFailed: 51,
|
|
394
|
-
ExceptionTruncated: 52,
|
|
395
|
-
IllegalCharsInName: 53,
|
|
396
|
-
ItemNotInArray: 54,
|
|
397
|
-
MaxAjaxPerPVExceeded: 55,
|
|
398
|
-
MessageTruncated: 56,
|
|
399
|
-
NameTooLong: 57,
|
|
400
|
-
SampleRateOutOfRange: 58,
|
|
401
|
-
SetAuthContextFailed: 59,
|
|
402
|
-
SetAuthContextFailedAccountName: 60,
|
|
403
|
-
StringValueTooLong: 61,
|
|
404
|
-
StartCalledMoreThanOnce: 62,
|
|
405
|
-
StopCalledWithoutStart: 63,
|
|
406
|
-
TelemetryInitializerFailed: 64,
|
|
407
|
-
TrackArgumentsNotSpecified: 65,
|
|
408
|
-
UrlTooLong: 66,
|
|
409
|
-
SessionStorageBufferFull: 67,
|
|
410
|
-
CannotAccessCookie: 68,
|
|
411
|
-
IdTooLong: 69,
|
|
412
|
-
InvalidEvent: 70,
|
|
413
|
-
FailedMonitorAjaxSetRequestHeader: 71,
|
|
414
|
-
SendBrowserInfoOnUserInit: 72,
|
|
415
|
-
PluginException: 73,
|
|
416
|
-
NotificationException: 74,
|
|
417
|
-
SnippetScriptLoadFailure: 99,
|
|
418
|
-
InvalidInstrumentationKey: 100,
|
|
419
|
-
CannotParseAiBlobValue: 101,
|
|
420
|
-
InvalidContentBlob: 102,
|
|
421
|
-
TrackPageActionEventFailed: 103,
|
|
422
|
-
FailedAddingCustomDefinedRequestContext: 104,
|
|
423
|
-
InMemoryStorageBufferFull: 105
|
|
424
|
-
};
|
|
336
|
+
var strEmpty = "";
|
|
337
|
+
var strSetNextPlugin = "setNextPlugin";
|
|
338
|
+
var strIsInitialized = "isInitialized";
|
|
339
|
+
var strTeardown = "teardown";
|
|
340
|
+
var strCore = "core";
|
|
341
|
+
var strDisabled = "disabled";
|
|
342
|
+
var strDoTeardown = "_doTeardown";
|
|
425
343
|
|
|
426
|
-
var strOnPrefix = "on";
|
|
427
|
-
var strAttachEvent = "attachEvent";
|
|
428
|
-
var strAddEventHelper = "addEventListener";
|
|
429
344
|
var strToString = "toString";
|
|
430
345
|
var str__Proto = "__proto__";
|
|
431
346
|
var strConstructor = "constructor";
|
|
432
|
-
var _objDefineProperty = ObjDefineProperty;
|
|
347
|
+
var _objDefineProperty$1 = ObjDefineProperty;
|
|
433
348
|
var _objFreeze = ObjClass.freeze;
|
|
434
349
|
var _isArray = Array.isArray;
|
|
435
350
|
var _objToString = ObjProto[strToString];
|
|
436
351
|
var _fnToString = ObjHasOwnProperty[strToString];
|
|
437
352
|
var _objFunctionString = _fnToString.call(ObjClass);
|
|
353
|
+
var rCamelCase = /-([a-z])/g;
|
|
354
|
+
var rNormalizeInvalid = /([^\w\d_$])/g;
|
|
355
|
+
var rLeadingNumeric = /^(\d+[\w\d_$])/;
|
|
438
356
|
var _objGetPrototypeOf = Object["getPrototypeOf"];
|
|
439
357
|
function _getObjProto(target) {
|
|
440
358
|
if (target) {
|
|
@@ -463,24 +381,18 @@ this.Microsoft = this.Microsoft || {};
|
|
|
463
381
|
function isFunction(value) {
|
|
464
382
|
return !!(value && typeof value === strShimFunction);
|
|
465
383
|
}
|
|
466
|
-
function
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
obj[strAttachEvent](strOnPrefix + eventNameWithoutOn, handlerRef);
|
|
477
|
-
result = true;
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
catch (e) {
|
|
481
|
-
}
|
|
384
|
+
function normalizeJsName(name) {
|
|
385
|
+
var value = name;
|
|
386
|
+
if (value && isString(value)) {
|
|
387
|
+
value = value.replace(rCamelCase, function (_all, letter) {
|
|
388
|
+
return letter.toUpperCase();
|
|
389
|
+
});
|
|
390
|
+
value = value.replace(rNormalizeInvalid, "_");
|
|
391
|
+
value = value.replace(rLeadingNumeric, function (_all, match) {
|
|
392
|
+
return "_" + match;
|
|
393
|
+
});
|
|
482
394
|
}
|
|
483
|
-
return
|
|
395
|
+
return value;
|
|
484
396
|
}
|
|
485
397
|
function objForEachKey(target, callbackfn) {
|
|
486
398
|
if (target) {
|
|
@@ -491,6 +403,12 @@ this.Microsoft = this.Microsoft || {};
|
|
|
491
403
|
}
|
|
492
404
|
}
|
|
493
405
|
}
|
|
406
|
+
function strContains(value, search) {
|
|
407
|
+
if (value && search) {
|
|
408
|
+
return value.indexOf(search) !== -1;
|
|
409
|
+
}
|
|
410
|
+
return false;
|
|
411
|
+
}
|
|
494
412
|
var isArray = _isArray || _isArrayPoly;
|
|
495
413
|
function _isArrayPoly(obj) {
|
|
496
414
|
return !!(obj && _objToString.call(obj) === "[object Array]");
|
|
@@ -498,6 +416,9 @@ this.Microsoft = this.Microsoft || {};
|
|
|
498
416
|
function isError(obj) {
|
|
499
417
|
return !!(obj && _objToString.call(obj) === "[object Error]");
|
|
500
418
|
}
|
|
419
|
+
function isString(value) {
|
|
420
|
+
return typeof value === "string";
|
|
421
|
+
}
|
|
501
422
|
function isBoolean(value) {
|
|
502
423
|
return typeof value === "boolean";
|
|
503
424
|
}
|
|
@@ -532,7 +453,7 @@ this.Microsoft = this.Microsoft || {};
|
|
|
532
453
|
}
|
|
533
454
|
}
|
|
534
455
|
function objDefineAccessors(target, prop, getProp, setProp) {
|
|
535
|
-
if (_objDefineProperty) {
|
|
456
|
+
if (_objDefineProperty$1) {
|
|
536
457
|
try {
|
|
537
458
|
var descriptor = {
|
|
538
459
|
enumerable: true,
|
|
@@ -544,7 +465,7 @@ this.Microsoft = this.Microsoft || {};
|
|
|
544
465
|
if (setProp) {
|
|
545
466
|
descriptor.set = setProp;
|
|
546
467
|
}
|
|
547
|
-
_objDefineProperty(target, prop, descriptor);
|
|
468
|
+
_objDefineProperty$1(target, prop, descriptor);
|
|
548
469
|
return true;
|
|
549
470
|
}
|
|
550
471
|
catch (e) {
|
|
@@ -564,7 +485,7 @@ this.Microsoft = this.Microsoft || {};
|
|
|
564
485
|
if (isError(object)) {
|
|
565
486
|
return object.name;
|
|
566
487
|
}
|
|
567
|
-
return
|
|
488
|
+
return strEmpty;
|
|
568
489
|
}
|
|
569
490
|
function setValue(target, field, value, valChk, srcChk) {
|
|
570
491
|
var theValue = value;
|
|
@@ -577,6 +498,20 @@ this.Microsoft = this.Microsoft || {};
|
|
|
577
498
|
}
|
|
578
499
|
return theValue;
|
|
579
500
|
}
|
|
501
|
+
function throwError(message) {
|
|
502
|
+
throw new Error(message);
|
|
503
|
+
}
|
|
504
|
+
function createEnumStyle(values) {
|
|
505
|
+
var enumClass = {};
|
|
506
|
+
objForEachKey(values, function (field, value) {
|
|
507
|
+
enumClass[field] = value;
|
|
508
|
+
if (!isUndefined(enumClass[value])) {
|
|
509
|
+
throwError("Value: [" + value + "] already exists for " + field);
|
|
510
|
+
}
|
|
511
|
+
enumClass[value] = field;
|
|
512
|
+
});
|
|
513
|
+
return objFreeze(enumClass);
|
|
514
|
+
}
|
|
580
515
|
function objExtend(obj, obj2, obj3, obj4, obj5, obj6) {
|
|
581
516
|
var theArgs = arguments;
|
|
582
517
|
var extended = theArgs[0] || {};
|
|
@@ -624,10 +559,17 @@ this.Microsoft = this.Microsoft || {};
|
|
|
624
559
|
|
|
625
560
|
var strWindow = "window";
|
|
626
561
|
var strDocument = "document";
|
|
562
|
+
var strNavigator = "navigator";
|
|
627
563
|
var strLocation = "location";
|
|
628
564
|
var strConsole = "console";
|
|
629
565
|
var strPerformance = "performance";
|
|
630
566
|
var strJSON = "JSON";
|
|
567
|
+
var strCrypto = "crypto";
|
|
568
|
+
var strMsCrypto = "msCrypto";
|
|
569
|
+
var strMsie = "msie";
|
|
570
|
+
var strTrident = "trident/";
|
|
571
|
+
var _isTrident = null;
|
|
572
|
+
var _navUserAgentCheck = null;
|
|
631
573
|
var _enableMocks = false;
|
|
632
574
|
function getGlobalInst(name) {
|
|
633
575
|
var gbl = getGlobal();
|
|
@@ -657,6 +599,15 @@ this.Microsoft = this.Microsoft || {};
|
|
|
657
599
|
}
|
|
658
600
|
return getGlobalInst(strDocument);
|
|
659
601
|
}
|
|
602
|
+
function hasNavigator() {
|
|
603
|
+
return Boolean(typeof navigator === strShimObject && navigator);
|
|
604
|
+
}
|
|
605
|
+
function getNavigator() {
|
|
606
|
+
if (hasNavigator()) {
|
|
607
|
+
return navigator;
|
|
608
|
+
}
|
|
609
|
+
return getGlobalInst(strNavigator);
|
|
610
|
+
}
|
|
660
611
|
function getLocation(checkForMock) {
|
|
661
612
|
if (checkForMock && _enableMocks) {
|
|
662
613
|
var mockLocation = getGlobalInst("__mockLocation");
|
|
@@ -687,9 +638,24 @@ this.Microsoft = this.Microsoft || {};
|
|
|
687
638
|
}
|
|
688
639
|
return null;
|
|
689
640
|
}
|
|
641
|
+
function getCrypto() {
|
|
642
|
+
return getGlobalInst(strCrypto);
|
|
643
|
+
}
|
|
644
|
+
function getMsCrypto() {
|
|
645
|
+
return getGlobalInst(strMsCrypto);
|
|
646
|
+
}
|
|
647
|
+
function isIE() {
|
|
648
|
+
var nav = getNavigator();
|
|
649
|
+
if (nav && (nav.userAgent !== _navUserAgentCheck || _isTrident === null)) {
|
|
650
|
+
_navUserAgentCheck = nav.userAgent;
|
|
651
|
+
var userAgent = (_navUserAgentCheck || strEmpty).toLowerCase();
|
|
652
|
+
_isTrident = (strContains(userAgent, strMsie) || strContains(userAgent, strTrident));
|
|
653
|
+
}
|
|
654
|
+
return _isTrident;
|
|
655
|
+
}
|
|
690
656
|
function dumpObj(object) {
|
|
691
657
|
var objectTypeDump = Object[strShimPrototype].toString.call(object);
|
|
692
|
-
var propertyValueDump =
|
|
658
|
+
var propertyValueDump = strEmpty;
|
|
693
659
|
if (objectTypeDump === "[object Error]") {
|
|
694
660
|
propertyValueDump = "{ stack: '" + object.stack + "', message: '" + object.message + "', name: '" + object.name + "'";
|
|
695
661
|
}
|
|
@@ -722,9 +688,9 @@ this.Microsoft = this.Microsoft || {};
|
|
|
722
688
|
var strWarnToConsole = "warnToConsole";
|
|
723
689
|
function _sanitizeDiagnosticText(text) {
|
|
724
690
|
if (text) {
|
|
725
|
-
return "\"" + text.replace(/\"/g,
|
|
691
|
+
return "\"" + text.replace(/\"/g, strEmpty) + "\"";
|
|
726
692
|
}
|
|
727
|
-
return
|
|
693
|
+
return strEmpty;
|
|
728
694
|
}
|
|
729
695
|
function _logToConsole(func, message) {
|
|
730
696
|
var theConsole = getConsole();
|
|
@@ -746,12 +712,12 @@ this.Microsoft = this.Microsoft || {};
|
|
|
746
712
|
_self.message =
|
|
747
713
|
(isUserAct ? AiUserActionablePrefix : AiNonUserActionablePrefix) +
|
|
748
714
|
msgId;
|
|
749
|
-
var strProps =
|
|
715
|
+
var strProps = strEmpty;
|
|
750
716
|
if (hasJSON()) {
|
|
751
717
|
strProps = getJSON().stringify(properties);
|
|
752
718
|
}
|
|
753
|
-
var diagnosticText = (msg ? " message:" + _sanitizeDiagnosticText(msg) :
|
|
754
|
-
(properties ? " props:" + _sanitizeDiagnosticText(strProps) :
|
|
719
|
+
var diagnosticText = (msg ? " message:" + _sanitizeDiagnosticText(msg) : strEmpty) +
|
|
720
|
+
(properties ? " props:" + _sanitizeDiagnosticText(strProps) : strEmpty);
|
|
755
721
|
_self.message += diagnosticText;
|
|
756
722
|
}
|
|
757
723
|
_InternalLogMessage.dataType = "MessageData";
|
|
@@ -781,7 +747,7 @@ this.Microsoft = this.Microsoft || {};
|
|
|
781
747
|
throw message;
|
|
782
748
|
}
|
|
783
749
|
else {
|
|
784
|
-
var logFunc = severity ===
|
|
750
|
+
var logFunc = severity === 1 ? strErrorToConsole : strWarnToConsole;
|
|
785
751
|
if (!isUndefined(message.message)) {
|
|
786
752
|
var logLevel = _self.consoleLoggingLevel();
|
|
787
753
|
if (isUserAct) {
|
|
@@ -799,7 +765,7 @@ this.Microsoft = this.Microsoft || {};
|
|
|
799
765
|
_self.logInternalMessage(severity, message);
|
|
800
766
|
}
|
|
801
767
|
else {
|
|
802
|
-
_debugExtMsg("throw" + (severity ===
|
|
768
|
+
_debugExtMsg("throw" + (severity === 1 ? "Critical" : "Warning"), message);
|
|
803
769
|
}
|
|
804
770
|
}
|
|
805
771
|
};
|
|
@@ -831,13 +797,13 @@ this.Microsoft = this.Microsoft || {};
|
|
|
831
797
|
if (severity <= _self.telemetryLoggingLevel()) {
|
|
832
798
|
_self.queue.push(message);
|
|
833
799
|
_messageCount++;
|
|
834
|
-
_debugExtMsg((severity ===
|
|
800
|
+
_debugExtMsg((severity === 1 ? "error" : "warn"), message);
|
|
835
801
|
}
|
|
836
802
|
if (_messageCount === _self.maxInternalMessageLimit()) {
|
|
837
803
|
var throttleLimitMessage = "Internal events throttle limit per PageView reached for this app.";
|
|
838
|
-
var throttleMessage = new _InternalLogMessage(
|
|
804
|
+
var throttleMessage = new _InternalLogMessage(23 , throttleLimitMessage, false);
|
|
839
805
|
_self.queue.push(throttleMessage);
|
|
840
|
-
if (severity ===
|
|
806
|
+
if (severity === 1 ) {
|
|
841
807
|
_self.errorToConsole(throttleLimitMessage);
|
|
842
808
|
}
|
|
843
809
|
else {
|
|
@@ -979,6 +945,151 @@ this.Microsoft = this.Microsoft || {};
|
|
|
979
945
|
return func();
|
|
980
946
|
}
|
|
981
947
|
|
|
948
|
+
var UInt32Mask = 0x100000000;
|
|
949
|
+
var MaxUInt32 = 0xffffffff;
|
|
950
|
+
var _mwcSeeded = false;
|
|
951
|
+
var _mwcW = 123456789;
|
|
952
|
+
var _mwcZ = 987654321;
|
|
953
|
+
function _mwcSeed(seedValue) {
|
|
954
|
+
if (seedValue < 0) {
|
|
955
|
+
seedValue >>>= 0;
|
|
956
|
+
}
|
|
957
|
+
_mwcW = (123456789 + seedValue) & MaxUInt32;
|
|
958
|
+
_mwcZ = (987654321 - seedValue) & MaxUInt32;
|
|
959
|
+
_mwcSeeded = true;
|
|
960
|
+
}
|
|
961
|
+
function _autoSeedMwc() {
|
|
962
|
+
try {
|
|
963
|
+
var now = dateNow() & 0x7fffffff;
|
|
964
|
+
_mwcSeed(((Math.random() * UInt32Mask) ^ now) + now);
|
|
965
|
+
}
|
|
966
|
+
catch (e) {
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
function random32(signed) {
|
|
970
|
+
var value = 0;
|
|
971
|
+
var c = getCrypto() || getMsCrypto();
|
|
972
|
+
if (c && c.getRandomValues) {
|
|
973
|
+
value = c.getRandomValues(new Uint32Array(1))[0] & MaxUInt32;
|
|
974
|
+
}
|
|
975
|
+
if (value === 0 && isIE()) {
|
|
976
|
+
if (!_mwcSeeded) {
|
|
977
|
+
_autoSeedMwc();
|
|
978
|
+
}
|
|
979
|
+
value = mwcRandom32() & MaxUInt32;
|
|
980
|
+
}
|
|
981
|
+
if (value === 0) {
|
|
982
|
+
value = Math.floor((UInt32Mask * Math.random()) | 0);
|
|
983
|
+
}
|
|
984
|
+
if (!signed) {
|
|
985
|
+
value >>>= 0;
|
|
986
|
+
}
|
|
987
|
+
return value;
|
|
988
|
+
}
|
|
989
|
+
function mwcRandom32(signed) {
|
|
990
|
+
_mwcZ = (36969 * (_mwcZ & 0xFFFF) + (_mwcZ >> 16)) & MaxUInt32;
|
|
991
|
+
_mwcW = (18000 * (_mwcW & 0xFFFF) + (_mwcW >> 16)) & MaxUInt32;
|
|
992
|
+
var value = (((_mwcZ << 16) + (_mwcW & 0xFFFF)) >>> 0) & MaxUInt32 | 0;
|
|
993
|
+
if (!signed) {
|
|
994
|
+
value >>>= 0;
|
|
995
|
+
}
|
|
996
|
+
return value;
|
|
997
|
+
}
|
|
998
|
+
function newId(maxLength) {
|
|
999
|
+
if (maxLength === void 0) { maxLength = 22; }
|
|
1000
|
+
var base64chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
1001
|
+
var number = random32() >>> 0;
|
|
1002
|
+
var chars = 0;
|
|
1003
|
+
var result = strEmpty;
|
|
1004
|
+
while (result.length < maxLength) {
|
|
1005
|
+
chars++;
|
|
1006
|
+
result += base64chars.charAt(number & 0x3F);
|
|
1007
|
+
number >>>= 6;
|
|
1008
|
+
if (chars === 5) {
|
|
1009
|
+
number = (((random32() << 2) & 0xFFFFFFFF) | (number & 0x03)) >>> 0;
|
|
1010
|
+
chars = 0;
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
return result;
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
var _objDefineProperty = ObjDefineProperty;
|
|
1017
|
+
var version = "2.7.3";
|
|
1018
|
+
var instanceName = "." + newId(6);
|
|
1019
|
+
var _dataUid = 0;
|
|
1020
|
+
function _createAccessor(target, prop, value) {
|
|
1021
|
+
if (_objDefineProperty) {
|
|
1022
|
+
try {
|
|
1023
|
+
_objDefineProperty(target, prop, {
|
|
1024
|
+
value: value,
|
|
1025
|
+
enumerable: false,
|
|
1026
|
+
configurable: true
|
|
1027
|
+
});
|
|
1028
|
+
return true;
|
|
1029
|
+
}
|
|
1030
|
+
catch (e) {
|
|
1031
|
+
}
|
|
1032
|
+
}
|
|
1033
|
+
return false;
|
|
1034
|
+
}
|
|
1035
|
+
function _canAcceptData(target) {
|
|
1036
|
+
return target.nodeType === 1 || target.nodeType === 9 || !(+target.nodeType);
|
|
1037
|
+
}
|
|
1038
|
+
function _getCache(data, target) {
|
|
1039
|
+
var theCache = target[data.id];
|
|
1040
|
+
if (!theCache) {
|
|
1041
|
+
theCache = {};
|
|
1042
|
+
try {
|
|
1043
|
+
if (_canAcceptData(target)) {
|
|
1044
|
+
if (!_createAccessor(target, data.id, theCache)) {
|
|
1045
|
+
target[data.id] = theCache;
|
|
1046
|
+
}
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
catch (e) {
|
|
1050
|
+
}
|
|
1051
|
+
}
|
|
1052
|
+
return theCache;
|
|
1053
|
+
}
|
|
1054
|
+
function createUniqueNamespace(name, includeVersion) {
|
|
1055
|
+
if (includeVersion === void 0) { includeVersion = false; }
|
|
1056
|
+
return normalizeJsName(name + (_dataUid++) + (includeVersion ? "." + version : "") + instanceName);
|
|
1057
|
+
}
|
|
1058
|
+
function createElmNodeData(name) {
|
|
1059
|
+
var data = {
|
|
1060
|
+
id: createUniqueNamespace("_aiData-" + (name || "") + "." + version),
|
|
1061
|
+
accept: function (target) {
|
|
1062
|
+
return _canAcceptData(target);
|
|
1063
|
+
},
|
|
1064
|
+
get: function (target, name, defValue, addDefault) {
|
|
1065
|
+
var theCache = target[data.id];
|
|
1066
|
+
if (!theCache) {
|
|
1067
|
+
if (addDefault) {
|
|
1068
|
+
theCache = _getCache(data, target);
|
|
1069
|
+
theCache[normalizeJsName(name)] = defValue;
|
|
1070
|
+
}
|
|
1071
|
+
return defValue;
|
|
1072
|
+
}
|
|
1073
|
+
return theCache[normalizeJsName(name)];
|
|
1074
|
+
},
|
|
1075
|
+
kill: function (target, name) {
|
|
1076
|
+
if (target && target[name]) {
|
|
1077
|
+
try {
|
|
1078
|
+
delete target[name];
|
|
1079
|
+
}
|
|
1080
|
+
catch (e) {
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1084
|
+
};
|
|
1085
|
+
return data;
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
var pluginStateData = createElmNodeData("plugin");
|
|
1089
|
+
function _getPluginState(plugin) {
|
|
1090
|
+
return pluginStateData.get(plugin, "state", {}, true);
|
|
1091
|
+
}
|
|
1092
|
+
|
|
982
1093
|
var strTelemetryPluginChain = "TelemetryPluginChain";
|
|
983
1094
|
var strHasRunFlags = "_hasRun";
|
|
984
1095
|
var strGetTelCtx = "_getTelCtx";
|
|
@@ -992,53 +1103,66 @@ this.Microsoft = this.Microsoft || {};
|
|
|
992
1103
|
}
|
|
993
1104
|
return createTelemetryProxyChain([startAt], config, core);
|
|
994
1105
|
}
|
|
995
|
-
function
|
|
996
|
-
var _nextProxy =
|
|
997
|
-
var _onComplete =
|
|
998
|
-
if (startAt) {
|
|
999
|
-
_nextProxy = _getNextProxyStart(telemetryChain, config, core, startAt);
|
|
1000
|
-
}
|
|
1001
|
-
else {
|
|
1002
|
-
_nextProxy = telemetryChain;
|
|
1003
|
-
}
|
|
1106
|
+
function _createInternalContext(telemetryChain, config, core, startAt) {
|
|
1107
|
+
var _nextProxy = startAt ? _getNextProxyStart(telemetryChain, config, core, startAt) : telemetryChain;
|
|
1108
|
+
var _onComplete = [];
|
|
1004
1109
|
var context = {
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1110
|
+
_next: _moveNext,
|
|
1111
|
+
ctx: {
|
|
1112
|
+
core: function () { return core; },
|
|
1113
|
+
diagLog: function () {
|
|
1114
|
+
return safeGetLogger(core, config);
|
|
1115
|
+
},
|
|
1116
|
+
getCfg: function () {
|
|
1117
|
+
return config;
|
|
1118
|
+
},
|
|
1119
|
+
getExtCfg: _getExtCfg,
|
|
1120
|
+
getConfig: _getConfig,
|
|
1121
|
+
hasNext: function () {
|
|
1122
|
+
return !!_nextProxy;
|
|
1123
|
+
},
|
|
1124
|
+
getNext: function () {
|
|
1125
|
+
return _nextProxy;
|
|
1126
|
+
},
|
|
1127
|
+
setNext: function (nextPlugin) {
|
|
1128
|
+
_nextProxy = nextPlugin;
|
|
1129
|
+
},
|
|
1130
|
+
iterate: _iterateChain,
|
|
1131
|
+
onComplete: _addOnComplete
|
|
1132
|
+
}
|
|
1133
|
+
};
|
|
1134
|
+
function _addOnComplete(onComplete, that) {
|
|
1135
|
+
var args = [];
|
|
1136
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
|
1137
|
+
args[_i - 2] = arguments[_i];
|
|
1138
|
+
}
|
|
1139
|
+
if (onComplete) {
|
|
1140
|
+
_onComplete.push({
|
|
1141
|
+
func: onComplete,
|
|
1142
|
+
self: !isUndefined(that) ? that : context.ctx,
|
|
1143
|
+
args: args
|
|
1028
1144
|
});
|
|
1029
|
-
}
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
function _moveNext() {
|
|
1148
|
+
var nextProxy = _nextProxy;
|
|
1149
|
+
_nextProxy = nextProxy ? nextProxy.getNext() : null;
|
|
1150
|
+
if (!nextProxy) {
|
|
1151
|
+
var onComplete = _onComplete;
|
|
1152
|
+
if (onComplete && onComplete.length > 0) {
|
|
1153
|
+
arrForEach(onComplete, function (completeDetails) {
|
|
1154
|
+
try {
|
|
1155
|
+
completeDetails.func.call(completeDetails.self, completeDetails.args);
|
|
1156
|
+
}
|
|
1157
|
+
catch (e) {
|
|
1158
|
+
core.logger.throwInternal(2 , 73 , "Unexpected Exception during onComplete - " + dumpObj(e));
|
|
1159
|
+
}
|
|
1160
|
+
});
|
|
1161
|
+
_onComplete = [];
|
|
1035
1162
|
}
|
|
1036
|
-
return createProcessTelemetryContext(plugins || _nextProxy, config, core, startAt);
|
|
1037
|
-
},
|
|
1038
|
-
onComplete: function (onComplete) {
|
|
1039
|
-
_onComplete = onComplete;
|
|
1040
1163
|
}
|
|
1041
|
-
|
|
1164
|
+
return nextProxy;
|
|
1165
|
+
}
|
|
1042
1166
|
function _getExtCfg(identifier, defaultValue, mergeDefault) {
|
|
1043
1167
|
if (defaultValue === void 0) { defaultValue = {}; }
|
|
1044
1168
|
if (mergeDefault === void 0) { mergeDefault = 0 ; }
|
|
@@ -1081,29 +1205,53 @@ this.Microsoft = this.Microsoft || {};
|
|
|
1081
1205
|
}
|
|
1082
1206
|
return !isNullOrUndefined(theValue) ? theValue : defaultValue;
|
|
1083
1207
|
}
|
|
1084
|
-
function
|
|
1085
|
-
var nextPlugin
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
else {
|
|
1091
|
-
if (_onComplete) {
|
|
1092
|
-
_onComplete();
|
|
1093
|
-
_onComplete = null;
|
|
1208
|
+
function _iterateChain(cb) {
|
|
1209
|
+
var nextPlugin;
|
|
1210
|
+
while (!!(nextPlugin = context._next())) {
|
|
1211
|
+
var plugin = nextPlugin.getPlugin();
|
|
1212
|
+
if (plugin) {
|
|
1213
|
+
cb(plugin);
|
|
1094
1214
|
}
|
|
1095
1215
|
}
|
|
1096
1216
|
}
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1217
|
+
return context;
|
|
1218
|
+
}
|
|
1219
|
+
function createProcessTelemetryContext(telemetryChain, config, core, startAt) {
|
|
1220
|
+
var internalContext = _createInternalContext(telemetryChain, config, core, startAt);
|
|
1221
|
+
var context = internalContext.ctx;
|
|
1222
|
+
function _processNext(env) {
|
|
1223
|
+
var nextPlugin = internalContext._next();
|
|
1224
|
+
nextPlugin && nextPlugin.processTelemetry(env, context);
|
|
1225
|
+
return !nextPlugin;
|
|
1226
|
+
}
|
|
1227
|
+
function _createNew(plugins, startAt) {
|
|
1228
|
+
if (plugins === void 0) { plugins = null; }
|
|
1229
|
+
if (isArray(plugins)) {
|
|
1230
|
+
plugins = createTelemetryProxyChain(plugins, config, core, startAt);
|
|
1231
|
+
}
|
|
1232
|
+
return createProcessTelemetryContext(plugins || context.getNext(), config, core, startAt);
|
|
1233
|
+
}
|
|
1234
|
+
context.processNext = _processNext;
|
|
1235
|
+
context.createNew = _createNew;
|
|
1236
|
+
return context;
|
|
1237
|
+
}
|
|
1238
|
+
function createProcessTelemetryUnloadContext(telemetryChain, config, core, startAt) {
|
|
1239
|
+
var internalContext = _createInternalContext(telemetryChain, config, core, startAt);
|
|
1240
|
+
var context = internalContext.ctx;
|
|
1241
|
+
function _processNext(unloadState) {
|
|
1242
|
+
var nextPlugin = internalContext._next();
|
|
1243
|
+
nextPlugin && nextPlugin.unload(context, unloadState);
|
|
1244
|
+
return !nextPlugin;
|
|
1245
|
+
}
|
|
1246
|
+
function _createNew(plugins, startAt) {
|
|
1247
|
+
if (plugins === void 0) { plugins = null; }
|
|
1248
|
+
if (isArray(plugins)) {
|
|
1249
|
+
plugins = createTelemetryProxyChain(plugins, config, core, startAt);
|
|
1105
1250
|
}
|
|
1251
|
+
return createProcessTelemetryUnloadContext(plugins || context.getNext(), config, core, startAt);
|
|
1106
1252
|
}
|
|
1253
|
+
context.processNext = _processNext;
|
|
1254
|
+
context.createNew = _createNew;
|
|
1107
1255
|
return context;
|
|
1108
1256
|
}
|
|
1109
1257
|
function createTelemetryProxyChain(plugins, config, core, startAt) {
|
|
@@ -1151,32 +1299,35 @@ this.Microsoft = this.Microsoft || {};
|
|
|
1151
1299
|
return nextProxy;
|
|
1152
1300
|
},
|
|
1153
1301
|
processTelemetry: _processTelemetry,
|
|
1302
|
+
unload: _unloadPlugin,
|
|
1154
1303
|
_id: chainId,
|
|
1155
1304
|
_setNext: function (nextPlugin) {
|
|
1156
1305
|
nextProxy = nextPlugin;
|
|
1157
1306
|
}
|
|
1158
1307
|
};
|
|
1159
|
-
function
|
|
1308
|
+
function _getTelCtx() {
|
|
1309
|
+
var itemCtx;
|
|
1310
|
+
if (plugin && isFunction(plugin[strGetTelCtx])) {
|
|
1311
|
+
itemCtx = plugin[strGetTelCtx]();
|
|
1312
|
+
}
|
|
1160
1313
|
if (!itemCtx) {
|
|
1161
|
-
|
|
1162
|
-
itemCtx = plugin[strGetTelCtx]();
|
|
1163
|
-
}
|
|
1164
|
-
if (!itemCtx) {
|
|
1165
|
-
itemCtx = createProcessTelemetryContext(proxyChain, config, core);
|
|
1166
|
-
}
|
|
1314
|
+
itemCtx = createProcessTelemetryContext(proxyChain, config, core);
|
|
1167
1315
|
}
|
|
1316
|
+
return itemCtx;
|
|
1317
|
+
}
|
|
1318
|
+
function _processChain(itemCtx, processPluginFn, name, details, isAsync) {
|
|
1319
|
+
var hasRun = false;
|
|
1168
1320
|
var identifier = plugin ? plugin.identifier : strTelemetryPluginChain;
|
|
1169
1321
|
var hasRunContext = itemCtx[strHasRunFlags];
|
|
1170
1322
|
if (!hasRunContext) {
|
|
1171
1323
|
hasRunContext = itemCtx[strHasRunFlags] = {};
|
|
1172
1324
|
}
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
if (plugin) {
|
|
1325
|
+
itemCtx.setNext(nextProxy);
|
|
1326
|
+
if (plugin) {
|
|
1327
|
+
doPerf(itemCtx[strCore](), function () { return identifier + ":" + name; }, function () {
|
|
1328
|
+
hasRunContext[chainId] = true;
|
|
1178
1329
|
try {
|
|
1179
|
-
var nextId = nextProxy ? nextProxy._id :
|
|
1330
|
+
var nextId = nextProxy ? nextProxy._id : strEmpty;
|
|
1180
1331
|
if (nextId) {
|
|
1181
1332
|
hasRunContext[nextId] = false;
|
|
1182
1333
|
}
|
|
@@ -1188,18 +1339,21 @@ this.Microsoft = this.Microsoft || {};
|
|
|
1188
1339
|
hasRun = true;
|
|
1189
1340
|
}
|
|
1190
1341
|
if (!nextProxy || !hasNextRun) {
|
|
1191
|
-
itemCtx.diagLog().throwInternal(
|
|
1342
|
+
itemCtx.diagLog().throwInternal(1 , 73 , "Plugin [" + plugin.identifier + "] failed during " + name + " - " + dumpObj(error) + ", run flags: " + dumpObj(hasRunContext));
|
|
1192
1343
|
}
|
|
1193
1344
|
}
|
|
1194
|
-
}
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
}
|
|
1198
|
-
}, details, isAsync);
|
|
1345
|
+
}, details, isAsync);
|
|
1346
|
+
}
|
|
1347
|
+
return hasRun;
|
|
1199
1348
|
}
|
|
1200
1349
|
function _processTelemetry(env, itemCtx) {
|
|
1201
|
-
|
|
1202
|
-
|
|
1350
|
+
itemCtx = itemCtx || _getTelCtx();
|
|
1351
|
+
function _callProcessTelemetry(itemCtx) {
|
|
1352
|
+
if (!plugin || !hasProcessTelemetry) {
|
|
1353
|
+
return false;
|
|
1354
|
+
}
|
|
1355
|
+
var pluginState = _getPluginState(plugin);
|
|
1356
|
+
if (pluginState[strTeardown] || pluginState[strDisabled]) {
|
|
1203
1357
|
return false;
|
|
1204
1358
|
}
|
|
1205
1359
|
if (hasSetNext) {
|
|
@@ -1207,9 +1361,31 @@ this.Microsoft = this.Microsoft || {};
|
|
|
1207
1361
|
}
|
|
1208
1362
|
plugin.processTelemetry(env, itemCtx);
|
|
1209
1363
|
return true;
|
|
1210
|
-
}
|
|
1211
|
-
|
|
1212
|
-
|
|
1364
|
+
}
|
|
1365
|
+
if (!_processChain(itemCtx, _callProcessTelemetry, "processTelemetry", function () { return ({ item: env }); }, !(env.sync))) {
|
|
1366
|
+
itemCtx.processNext(env);
|
|
1367
|
+
}
|
|
1368
|
+
}
|
|
1369
|
+
function _unloadPlugin(unloadCtx, unloadState) {
|
|
1370
|
+
function _callTeardown() {
|
|
1371
|
+
var hasRun = false;
|
|
1372
|
+
if (plugin) {
|
|
1373
|
+
var pluginState = _getPluginState(plugin);
|
|
1374
|
+
var pluginCore = plugin[strCore] || pluginState.core;
|
|
1375
|
+
if (plugin && (!pluginCore || pluginCore === unloadCtx[strCore]()) && !pluginState[strTeardown]) {
|
|
1376
|
+
pluginState[strCore] = null;
|
|
1377
|
+
pluginState[strTeardown] = true;
|
|
1378
|
+
pluginState[strIsInitialized] = false;
|
|
1379
|
+
if (plugin[strTeardown] && plugin[strTeardown](unloadCtx, unloadState) === true) {
|
|
1380
|
+
hasRun = true;
|
|
1381
|
+
}
|
|
1382
|
+
}
|
|
1383
|
+
}
|
|
1384
|
+
return hasRun;
|
|
1385
|
+
}
|
|
1386
|
+
if (!_processChain(unloadCtx, _callTeardown, "unload", function () { }, unloadState.isAsync)) {
|
|
1387
|
+
unloadCtx.processNext(unloadState);
|
|
1388
|
+
}
|
|
1213
1389
|
}
|
|
1214
1390
|
return objFreeze(proxyChain);
|
|
1215
1391
|
}
|
|
@@ -1230,6 +1406,38 @@ this.Microsoft = this.Microsoft || {};
|
|
|
1230
1406
|
_setDefaults(config, core, pluginChain);
|
|
1231
1407
|
_isinitialized = true;
|
|
1232
1408
|
};
|
|
1409
|
+
_self.teardown = function (unloadCtx, unloadState) {
|
|
1410
|
+
if (!_self.core || (unloadCtx && _self.core !== unloadCtx.core())) {
|
|
1411
|
+
return;
|
|
1412
|
+
}
|
|
1413
|
+
var result;
|
|
1414
|
+
var unloadDone = false;
|
|
1415
|
+
var theUnloadCtx = unloadCtx || createProcessTelemetryUnloadContext(null, {}, _self.core, _nextPlugin && _nextPlugin[strGetPlugin] ? _nextPlugin[strGetPlugin]() : _nextPlugin);
|
|
1416
|
+
var theUnloadState = unloadState || {
|
|
1417
|
+
reason: 0 ,
|
|
1418
|
+
isAsync: false
|
|
1419
|
+
};
|
|
1420
|
+
function _unloadCallback() {
|
|
1421
|
+
if (!unloadDone) {
|
|
1422
|
+
unloadDone = true;
|
|
1423
|
+
arrForEach(_hooks, function (fn) {
|
|
1424
|
+
fn.rm();
|
|
1425
|
+
});
|
|
1426
|
+
_hooks = [];
|
|
1427
|
+
if (result === true) {
|
|
1428
|
+
theUnloadCtx.processNext(theUnloadState);
|
|
1429
|
+
}
|
|
1430
|
+
_initDefaults();
|
|
1431
|
+
}
|
|
1432
|
+
}
|
|
1433
|
+
if (!_self[strDoTeardown] || _self[strDoTeardown](theUnloadCtx, theUnloadState, _unloadCallback) !== true) {
|
|
1434
|
+
_unloadCallback();
|
|
1435
|
+
}
|
|
1436
|
+
else {
|
|
1437
|
+
result = true;
|
|
1438
|
+
}
|
|
1439
|
+
return result;
|
|
1440
|
+
};
|
|
1233
1441
|
_self._addHook = function (hooks) {
|
|
1234
1442
|
if (hooks) {
|
|
1235
1443
|
if (isArray(hooks)) {
|
|
@@ -1244,13 +1452,13 @@ this.Microsoft = this.Microsoft || {};
|
|
|
1244
1452
|
_self.diagLog = function (itemCtx) {
|
|
1245
1453
|
return _getTelCtx(itemCtx).diagLog();
|
|
1246
1454
|
};
|
|
1247
|
-
_self
|
|
1455
|
+
_self[strIsInitialized] = function () {
|
|
1248
1456
|
return _isinitialized;
|
|
1249
1457
|
};
|
|
1250
1458
|
_self.setInitialized = function (isInitialized) {
|
|
1251
1459
|
_isinitialized = isInitialized;
|
|
1252
1460
|
};
|
|
1253
|
-
_self
|
|
1461
|
+
_self[strSetNextPlugin] = function (next) {
|
|
1254
1462
|
_nextPlugin = next;
|
|
1255
1463
|
};
|
|
1256
1464
|
_self.processNext = function (env, itemCtx) {
|
|
@@ -1301,6 +1509,191 @@ this.Microsoft = this.Microsoft || {};
|
|
|
1301
1509
|
return BaseTelemetryPlugin;
|
|
1302
1510
|
}());
|
|
1303
1511
|
|
|
1512
|
+
var strOnPrefix = "on";
|
|
1513
|
+
var strAttachEvent = "attachEvent";
|
|
1514
|
+
var strAddEventHelper = "addEventListener";
|
|
1515
|
+
var strEvents = "events";
|
|
1516
|
+
createUniqueNamespace("aiEvtPageHide");
|
|
1517
|
+
createUniqueNamespace("aiEvtPageShow");
|
|
1518
|
+
var _guid = 1;
|
|
1519
|
+
var elmNodeData = createElmNodeData("events");
|
|
1520
|
+
var eventNamespace = /^([^.]*)(?:\.(.+)|)/;
|
|
1521
|
+
function _normalizeNamespace(name) {
|
|
1522
|
+
if (name && name.replace) {
|
|
1523
|
+
return name.replace(/^\s*\.*|\.*\s*$/g, "");
|
|
1524
|
+
}
|
|
1525
|
+
return name;
|
|
1526
|
+
}
|
|
1527
|
+
function _getEvtNamespace(eventName, namespaces) {
|
|
1528
|
+
if (namespaces) {
|
|
1529
|
+
var theNamespace_1 = "";
|
|
1530
|
+
if (isArray(namespaces)) {
|
|
1531
|
+
theNamespace_1 = "";
|
|
1532
|
+
arrForEach(namespaces, function (name) {
|
|
1533
|
+
name = _normalizeNamespace(name);
|
|
1534
|
+
if (name) {
|
|
1535
|
+
if (name[0] !== ".") {
|
|
1536
|
+
name = "." + name;
|
|
1537
|
+
}
|
|
1538
|
+
theNamespace_1 += name;
|
|
1539
|
+
}
|
|
1540
|
+
});
|
|
1541
|
+
}
|
|
1542
|
+
else {
|
|
1543
|
+
theNamespace_1 = _normalizeNamespace(namespaces);
|
|
1544
|
+
}
|
|
1545
|
+
if (theNamespace_1) {
|
|
1546
|
+
if (theNamespace_1[0] !== ".") {
|
|
1547
|
+
theNamespace_1 = "." + theNamespace_1;
|
|
1548
|
+
}
|
|
1549
|
+
eventName = (eventName || "") + theNamespace_1;
|
|
1550
|
+
}
|
|
1551
|
+
}
|
|
1552
|
+
var parsedEvent = (eventNamespace.exec(eventName) || []);
|
|
1553
|
+
return {
|
|
1554
|
+
type: parsedEvent[1],
|
|
1555
|
+
ns: ((parsedEvent[2] || "").split(".").sort()).join(".")
|
|
1556
|
+
};
|
|
1557
|
+
}
|
|
1558
|
+
function _getRegisteredEvents(target, evtName, addDefault) {
|
|
1559
|
+
if (addDefault === void 0) { addDefault = true; }
|
|
1560
|
+
var aiEvts = elmNodeData.get(target, strEvents, {}, addDefault);
|
|
1561
|
+
var registeredEvents = aiEvts[evtName];
|
|
1562
|
+
if (!registeredEvents) {
|
|
1563
|
+
registeredEvents = aiEvts[evtName] = [];
|
|
1564
|
+
}
|
|
1565
|
+
return registeredEvents;
|
|
1566
|
+
}
|
|
1567
|
+
function _doAttach(obj, evtName, handlerRef, useCapture) {
|
|
1568
|
+
var result = false;
|
|
1569
|
+
if (obj && evtName && evtName.type && handlerRef) {
|
|
1570
|
+
if (obj[strAddEventHelper]) {
|
|
1571
|
+
obj[strAddEventHelper](evtName.type, handlerRef, useCapture);
|
|
1572
|
+
result = true;
|
|
1573
|
+
}
|
|
1574
|
+
else if (obj[strAttachEvent]) {
|
|
1575
|
+
obj[strAttachEvent](strOnPrefix + evtName.type, handlerRef);
|
|
1576
|
+
result = true;
|
|
1577
|
+
}
|
|
1578
|
+
}
|
|
1579
|
+
return result;
|
|
1580
|
+
}
|
|
1581
|
+
function eventOn(target, eventName, handlerRef, evtNamespace, useCapture) {
|
|
1582
|
+
if (useCapture === void 0) { useCapture = false; }
|
|
1583
|
+
var result = false;
|
|
1584
|
+
if (target) {
|
|
1585
|
+
try {
|
|
1586
|
+
var evtName = _getEvtNamespace(eventName, evtNamespace);
|
|
1587
|
+
result = _doAttach(target, evtName, handlerRef, useCapture);
|
|
1588
|
+
if (result && elmNodeData.accept(target)) {
|
|
1589
|
+
var registeredEvent = {
|
|
1590
|
+
guid: _guid++,
|
|
1591
|
+
evtName: evtName,
|
|
1592
|
+
handler: handlerRef,
|
|
1593
|
+
capture: useCapture
|
|
1594
|
+
};
|
|
1595
|
+
_getRegisteredEvents(target, evtName.type).push(registeredEvent);
|
|
1596
|
+
}
|
|
1597
|
+
}
|
|
1598
|
+
catch (e) {
|
|
1599
|
+
}
|
|
1600
|
+
}
|
|
1601
|
+
return result;
|
|
1602
|
+
}
|
|
1603
|
+
function attachEvent(obj, eventNameWithoutOn, handlerRef, useCapture) {
|
|
1604
|
+
if (useCapture === void 0) { useCapture = false; }
|
|
1605
|
+
return eventOn(obj, eventNameWithoutOn, handlerRef, null, useCapture);
|
|
1606
|
+
}
|
|
1607
|
+
|
|
1608
|
+
var LoggingSeverity = createEnumStyle({
|
|
1609
|
+
CRITICAL: 1 ,
|
|
1610
|
+
WARNING: 2
|
|
1611
|
+
});
|
|
1612
|
+
var _InternalMessageId = createEnumStyle({
|
|
1613
|
+
BrowserDoesNotSupportLocalStorage: 0 ,
|
|
1614
|
+
BrowserCannotReadLocalStorage: 1 ,
|
|
1615
|
+
BrowserCannotReadSessionStorage: 2 ,
|
|
1616
|
+
BrowserCannotWriteLocalStorage: 3 ,
|
|
1617
|
+
BrowserCannotWriteSessionStorage: 4 ,
|
|
1618
|
+
BrowserFailedRemovalFromLocalStorage: 5 ,
|
|
1619
|
+
BrowserFailedRemovalFromSessionStorage: 6 ,
|
|
1620
|
+
CannotSendEmptyTelemetry: 7 ,
|
|
1621
|
+
ClientPerformanceMathError: 8 ,
|
|
1622
|
+
ErrorParsingAISessionCookie: 9 ,
|
|
1623
|
+
ErrorPVCalc: 10 ,
|
|
1624
|
+
ExceptionWhileLoggingError: 11 ,
|
|
1625
|
+
FailedAddingTelemetryToBuffer: 12 ,
|
|
1626
|
+
FailedMonitorAjaxAbort: 13 ,
|
|
1627
|
+
FailedMonitorAjaxDur: 14 ,
|
|
1628
|
+
FailedMonitorAjaxOpen: 15 ,
|
|
1629
|
+
FailedMonitorAjaxRSC: 16 ,
|
|
1630
|
+
FailedMonitorAjaxSend: 17 ,
|
|
1631
|
+
FailedMonitorAjaxGetCorrelationHeader: 18 ,
|
|
1632
|
+
FailedToAddHandlerForOnBeforeUnload: 19 ,
|
|
1633
|
+
FailedToSendQueuedTelemetry: 20 ,
|
|
1634
|
+
FailedToReportDataLoss: 21 ,
|
|
1635
|
+
FlushFailed: 22 ,
|
|
1636
|
+
MessageLimitPerPVExceeded: 23 ,
|
|
1637
|
+
MissingRequiredFieldSpecification: 24 ,
|
|
1638
|
+
NavigationTimingNotSupported: 25 ,
|
|
1639
|
+
OnError: 26 ,
|
|
1640
|
+
SessionRenewalDateIsZero: 27 ,
|
|
1641
|
+
SenderNotInitialized: 28 ,
|
|
1642
|
+
StartTrackEventFailed: 29 ,
|
|
1643
|
+
StopTrackEventFailed: 30 ,
|
|
1644
|
+
StartTrackFailed: 31 ,
|
|
1645
|
+
StopTrackFailed: 32 ,
|
|
1646
|
+
TelemetrySampledAndNotSent: 33 ,
|
|
1647
|
+
TrackEventFailed: 34 ,
|
|
1648
|
+
TrackExceptionFailed: 35 ,
|
|
1649
|
+
TrackMetricFailed: 36 ,
|
|
1650
|
+
TrackPVFailed: 37 ,
|
|
1651
|
+
TrackPVFailedCalc: 38 ,
|
|
1652
|
+
TrackTraceFailed: 39 ,
|
|
1653
|
+
TransmissionFailed: 40 ,
|
|
1654
|
+
FailedToSetStorageBuffer: 41 ,
|
|
1655
|
+
FailedToRestoreStorageBuffer: 42 ,
|
|
1656
|
+
InvalidBackendResponse: 43 ,
|
|
1657
|
+
FailedToFixDepricatedValues: 44 ,
|
|
1658
|
+
InvalidDurationValue: 45 ,
|
|
1659
|
+
TelemetryEnvelopeInvalid: 46 ,
|
|
1660
|
+
CreateEnvelopeError: 47 ,
|
|
1661
|
+
CannotSerializeObject: 48 ,
|
|
1662
|
+
CannotSerializeObjectNonSerializable: 49 ,
|
|
1663
|
+
CircularReferenceDetected: 50 ,
|
|
1664
|
+
ClearAuthContextFailed: 51 ,
|
|
1665
|
+
ExceptionTruncated: 52 ,
|
|
1666
|
+
IllegalCharsInName: 53 ,
|
|
1667
|
+
ItemNotInArray: 54 ,
|
|
1668
|
+
MaxAjaxPerPVExceeded: 55 ,
|
|
1669
|
+
MessageTruncated: 56 ,
|
|
1670
|
+
NameTooLong: 57 ,
|
|
1671
|
+
SampleRateOutOfRange: 58 ,
|
|
1672
|
+
SetAuthContextFailed: 59 ,
|
|
1673
|
+
SetAuthContextFailedAccountName: 60 ,
|
|
1674
|
+
StringValueTooLong: 61 ,
|
|
1675
|
+
StartCalledMoreThanOnce: 62 ,
|
|
1676
|
+
StopCalledWithoutStart: 63 ,
|
|
1677
|
+
TelemetryInitializerFailed: 64 ,
|
|
1678
|
+
TrackArgumentsNotSpecified: 65 ,
|
|
1679
|
+
UrlTooLong: 66 ,
|
|
1680
|
+
SessionStorageBufferFull: 67 ,
|
|
1681
|
+
CannotAccessCookie: 68 ,
|
|
1682
|
+
IdTooLong: 69 ,
|
|
1683
|
+
InvalidEvent: 70 ,
|
|
1684
|
+
FailedMonitorAjaxSetRequestHeader: 71 ,
|
|
1685
|
+
SendBrowserInfoOnUserInit: 72 ,
|
|
1686
|
+
PluginException: 73 ,
|
|
1687
|
+
NotificationException: 74 ,
|
|
1688
|
+
SnippetScriptLoadFailure: 99 ,
|
|
1689
|
+
InvalidInstrumentationKey: 100 ,
|
|
1690
|
+
CannotParseAiBlobValue: 101 ,
|
|
1691
|
+
InvalidContentBlob: 102 ,
|
|
1692
|
+
TrackPageActionEventFailed: 103 ,
|
|
1693
|
+
FailedAddingCustomDefinedRequestContext: 104 ,
|
|
1694
|
+
InMemoryStorageBufferFull: 105
|
|
1695
|
+
});
|
|
1696
|
+
|
|
1304
1697
|
var strNotSpecified = "not_specified";
|
|
1305
1698
|
|
|
1306
1699
|
var PropertiesPluginIdentifier = "AppInsightsPropertiesPlugin";
|
|
@@ -2156,7 +2549,7 @@ this.Microsoft = this.Microsoft || {};
|
|
|
2156
2549
|
this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _ExtendedInternalMessageId.TrackPageActionEventFailed, "trackPageAction failed, page action event will not be collected: " + getExceptionName(e), { exception: dumpObj(e) });
|
|
2157
2550
|
}
|
|
2158
2551
|
};
|
|
2159
|
-
ClickAnalyticsPlugin.Version = "2.8.0-beta.
|
|
2552
|
+
ClickAnalyticsPlugin.Version = "2.8.0-beta.2203-02";
|
|
2160
2553
|
return ClickAnalyticsPlugin;
|
|
2161
2554
|
}(BaseTelemetryPlugin));
|
|
2162
2555
|
|
|
@@ -2168,4 +2561,4 @@ this.Microsoft = this.Microsoft || {};
|
|
|
2168
2561
|
(function(obj, prop, descriptor) { /* ai_es3_polyfil defineProperty */ var func = Object["defineProperty"]; if (func) { try { return func(obj, prop, descriptor); } catch(e) { /* IE8 defines defineProperty, but will throw */ } } if (descriptor && typeof descriptor.value !== undefined) { obj[prop] = descriptor.value; } return obj; })(exports, '__esModule', { value: true });
|
|
2169
2562
|
|
|
2170
2563
|
})(this.Microsoft.ApplicationInsights = this.Microsoft.ApplicationInsights || {});
|
|
2171
|
-
//# sourceMappingURL=ai.clck.2.8.0-beta.
|
|
2564
|
+
//# sourceMappingURL=ai.clck.2.8.0-beta.2203-02.gbl.js.map
|