@microsoft/applicationinsights-react-js 3.3.5-nightly.2206-03 → 3.3.5-nightly.2207-01
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/applicationinsights-react-js.js +294 -243
- package/browser/applicationinsights-react-js.js.map +1 -1
- package/browser/applicationinsights-react-js.min.js +2 -2
- package/browser/applicationinsights-react-js.min.js.map +1 -1
- package/dist/applicationinsights-react-js.api.json +8 -2
- package/dist/applicationinsights-react-js.d.ts +1 -1
- package/dist/applicationinsights-react-js.js +294 -243
- package/dist/applicationinsights-react-js.js.map +1 -1
- package/dist/applicationinsights-react-js.min.js +2 -2
- package/dist/applicationinsights-react-js.min.js.map +1 -1
- package/dist/applicationinsights-react-js.rollup.d.ts +1 -1
- package/dist-esm/AppInsightsContext.js +1 -1
- package/dist-esm/AppInsightsErrorBoundary.js +1 -1
- package/dist-esm/Interfaces/IReactExtensionConfig.js +1 -1
- package/dist-esm/ReactPlugin.js +5 -5
- package/dist-esm/ReactPlugin.js.map +1 -1
- package/dist-esm/applicationinsights-react-js.js +1 -1
- package/dist-esm/useTrackEvent.js +2 -6
- package/dist-esm/useTrackEvent.js.map +1 -1
- package/dist-esm/useTrackMetric.js +2 -2
- package/dist-esm/useTrackMetric.js.map +1 -1
- package/dist-esm/withAITracking.js +1 -1
- package/package.json +6 -4
- package/src/ReactPlugin.ts +8 -8
- package/src/useTrackEvent.ts +4 -4
- package/src/useTrackMetric.ts +2 -2
- package/types/ReactPlugin.d.ts +5 -5
- package/types/tsdoc-metadata.json +1 -1
- package/types/useTrackEvent.d.ts +4 -4
- package/types/useTrackMetric.d.ts +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Application Insights JavaScript SDK - React Plugin, 3.3.5-nightly.
|
|
2
|
+
* Application Insights JavaScript SDK - React Plugin, 3.3.5-nightly.2207-01
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
(function (global, factory) {
|
|
@@ -369,14 +369,55 @@
|
|
|
369
369
|
};
|
|
370
370
|
dynamicProto[DynProtoDefaultOptions] = perfDefaults;
|
|
371
371
|
|
|
372
|
-
var
|
|
373
|
-
var
|
|
374
|
-
var
|
|
375
|
-
var
|
|
376
|
-
var
|
|
377
|
-
var
|
|
378
|
-
var
|
|
379
|
-
var
|
|
372
|
+
var _DYN_INITIALIZE = "initialize";
|
|
373
|
+
var _DYN_NAME = "name";
|
|
374
|
+
var _DYN_IDENTIFIER = "identifier";
|
|
375
|
+
var _DYN_PUSH = "push";
|
|
376
|
+
var _DYN_IS_INITIALIZED = "isInitialized";
|
|
377
|
+
var _DYN_CONFIG = "config";
|
|
378
|
+
var _DYN_LOGGER = "logger";
|
|
379
|
+
var _DYN_LENGTH = "length";
|
|
380
|
+
var _DYN_TIME = "time";
|
|
381
|
+
var _DYN_PROCESS_NEXT = "processNext";
|
|
382
|
+
var _DYN_GET_PROCESS_TEL_CONT0 = "getProcessTelContext";
|
|
383
|
+
var _DYN_GET_PLUGIN = "getPlugin";
|
|
384
|
+
var _DYN_TEARDOWN = "teardown";
|
|
385
|
+
var _DYN_MESSAGE_ID = "messageId";
|
|
386
|
+
var _DYN_MESSAGE = "message";
|
|
387
|
+
var _DYN_IS_ASYNC = "isAsync";
|
|
388
|
+
var _DYN__DO_TEARDOWN = "_doTeardown";
|
|
389
|
+
var _DYN_UPDATE = "update";
|
|
390
|
+
var _DYN_GET_NEXT = "getNext";
|
|
391
|
+
var _DYN_DIAG_LOG = "diagLog";
|
|
392
|
+
var _DYN_SET_NEXT_PLUGIN = "setNextPlugin";
|
|
393
|
+
var _DYN_CREATE_NEW = "createNew";
|
|
394
|
+
var _DYN_COOKIE_CFG = "cookieCfg";
|
|
395
|
+
var _DYN_INDEX_OF = "indexOf";
|
|
396
|
+
var _DYN_SUBSTRING = "substring";
|
|
397
|
+
var _DYN_USER_AGENT = "userAgent";
|
|
398
|
+
var _DYN_SPLIT = "split";
|
|
399
|
+
var _DYN_SET_ENABLED = "setEnabled";
|
|
400
|
+
var _DYN_REPLACE = "replace";
|
|
401
|
+
var _DYN_NODE_TYPE = "nodeType";
|
|
402
|
+
var _DYN_APPLY = "apply";
|
|
403
|
+
var _DYN_ENABLE_DEBUG_EXCEPTI4 = "enableDebugExceptions";
|
|
404
|
+
var _DYN_LOG_INTERNAL_MESSAGE = "logInternalMessage";
|
|
405
|
+
var _DYN_TO_LOWER_CASE = "toLowerCase";
|
|
406
|
+
var _DYN_CALL = "call";
|
|
407
|
+
var _DYN_IS_CHILD_EVT = "isChildEvt";
|
|
408
|
+
var _DYN_GET_CTX = "getCtx";
|
|
409
|
+
var _DYN_SET_CTX = "setCtx";
|
|
410
|
+
var _DYN_COMPLETE = "complete";
|
|
411
|
+
|
|
412
|
+
var STR_EMPTY = "";
|
|
413
|
+
var STR_CORE = "core";
|
|
414
|
+
var STR_DISABLED = "disabled";
|
|
415
|
+
var STR_EXTENSION_CONFIG = "extensionConfig";
|
|
416
|
+
var STR_PROCESS_TELEMETRY = "processTelemetry";
|
|
417
|
+
var STR_PRIORITY = "priority";
|
|
418
|
+
var STR_ERROR_TO_CONSOLE = "errorToConsole";
|
|
419
|
+
var STR_WARN_TO_CONSOLE = "warnToConsole";
|
|
420
|
+
var STR_GET_PERF_MGR = "getPerfMgr";
|
|
380
421
|
|
|
381
422
|
var cStrEndsWith = "endsWith";
|
|
382
423
|
var cStrTrim = "trim";
|
|
@@ -391,7 +432,7 @@
|
|
|
391
432
|
var _isArray = Array.isArray;
|
|
392
433
|
var _objToString = ObjProto[strToString];
|
|
393
434
|
var _fnToString = ObjHasOwnProperty[strToString];
|
|
394
|
-
var _objFunctionString = _fnToString
|
|
435
|
+
var _objFunctionString = _fnToString[_DYN_CALL ](ObjClass);
|
|
395
436
|
var rCamelCase = /-([a-z])/g;
|
|
396
437
|
var rNormalizeInvalid = /([^\w\d_$])/g;
|
|
397
438
|
var rLeadingNumeric = /^(\d+[\w\d_$])/;
|
|
@@ -426,11 +467,11 @@
|
|
|
426
467
|
function normalizeJsName(name) {
|
|
427
468
|
var value = name;
|
|
428
469
|
if (value && isString(value)) {
|
|
429
|
-
value = value
|
|
470
|
+
value = value[_DYN_REPLACE ](rCamelCase, function (_all, letter) {
|
|
430
471
|
return letter.toUpperCase();
|
|
431
472
|
});
|
|
432
|
-
value = value
|
|
433
|
-
value = value
|
|
473
|
+
value = value[_DYN_REPLACE ](rNormalizeInvalid, "_");
|
|
474
|
+
value = value[_DYN_REPLACE ](rLeadingNumeric, function (_all, match) {
|
|
434
475
|
return "_" + match;
|
|
435
476
|
});
|
|
436
477
|
}
|
|
@@ -439,8 +480,8 @@
|
|
|
439
480
|
function objForEachKey(target, callbackfn) {
|
|
440
481
|
if (target) {
|
|
441
482
|
for (var prop in target) {
|
|
442
|
-
if (ObjHasOwnProperty
|
|
443
|
-
callbackfn
|
|
483
|
+
if (ObjHasOwnProperty[_DYN_CALL ](target, prop)) {
|
|
484
|
+
callbackfn[_DYN_CALL ](target, prop, target[prop]);
|
|
444
485
|
}
|
|
445
486
|
}
|
|
446
487
|
}
|
|
@@ -454,8 +495,8 @@
|
|
|
454
495
|
}
|
|
455
496
|
function _strEndsWithPoly(value, search) {
|
|
456
497
|
var result = false;
|
|
457
|
-
var searchLen = search ? search
|
|
458
|
-
var valLen = value ? value
|
|
498
|
+
var searchLen = search ? search[_DYN_LENGTH ] : 0;
|
|
499
|
+
var valLen = value ? value[_DYN_LENGTH ] : 0;
|
|
459
500
|
if (searchLen && valLen && valLen >= searchLen && !(result = value === search)) {
|
|
460
501
|
var pos = valLen - 1;
|
|
461
502
|
for (var lp = searchLen - 1; lp >= 0; lp--) {
|
|
@@ -470,16 +511,16 @@
|
|
|
470
511
|
}
|
|
471
512
|
function strContains(value, search) {
|
|
472
513
|
if (value && search) {
|
|
473
|
-
return value
|
|
514
|
+
return value[_DYN_INDEX_OF ](search) !== -1;
|
|
474
515
|
}
|
|
475
516
|
return false;
|
|
476
517
|
}
|
|
477
518
|
var isArray = _isArray || _isArrayPoly;
|
|
478
519
|
function _isArrayPoly(obj) {
|
|
479
|
-
return !!(obj && _objToString
|
|
520
|
+
return !!(obj && _objToString[_DYN_CALL ](obj) === "[object Array]");
|
|
480
521
|
}
|
|
481
522
|
function isError(obj) {
|
|
482
|
-
return !!(obj && _objToString
|
|
523
|
+
return !!(obj && _objToString[_DYN_CALL ](obj) === "[object Error]");
|
|
483
524
|
}
|
|
484
525
|
function isString(value) {
|
|
485
526
|
return typeof value === "string";
|
|
@@ -495,20 +536,20 @@
|
|
|
495
536
|
result = true;
|
|
496
537
|
}
|
|
497
538
|
else {
|
|
498
|
-
if (proto[strConstructor] && ObjHasOwnProperty
|
|
539
|
+
if (proto[strConstructor] && ObjHasOwnProperty[_DYN_CALL ](proto, strConstructor)) {
|
|
499
540
|
proto = proto[strConstructor];
|
|
500
541
|
}
|
|
501
|
-
result = typeof proto === strShimFunction && _fnToString
|
|
542
|
+
result = typeof proto === strShimFunction && _fnToString[_DYN_CALL ](proto) === _objFunctionString;
|
|
502
543
|
}
|
|
503
544
|
}
|
|
504
545
|
return result;
|
|
505
546
|
}
|
|
506
547
|
function arrForEach(arr, callbackfn, thisArg) {
|
|
507
|
-
var len = arr
|
|
548
|
+
var len = arr[_DYN_LENGTH ];
|
|
508
549
|
try {
|
|
509
550
|
for (var idx = 0; idx < len; idx++) {
|
|
510
551
|
if (idx in arr) {
|
|
511
|
-
if (callbackfn
|
|
552
|
+
if (callbackfn[_DYN_CALL ](thisArg || arr, arr[idx], idx, arr) === -1) {
|
|
512
553
|
break;
|
|
513
554
|
}
|
|
514
555
|
}
|
|
@@ -519,7 +560,7 @@
|
|
|
519
560
|
}
|
|
520
561
|
function strTrim(str) {
|
|
521
562
|
if (str) {
|
|
522
|
-
str = (_strTrim && str[cStrTrim]) ? str[cStrTrim]() : (str
|
|
563
|
+
str = (_strTrim && str[cStrTrim]) ? str[cStrTrim]() : (str[_DYN_REPLACE ] ? str[_DYN_REPLACE ](/^\s+|\s+$/g, STR_EMPTY) : str);
|
|
523
564
|
}
|
|
524
565
|
return str;
|
|
525
566
|
}
|
|
@@ -564,9 +605,9 @@
|
|
|
564
605
|
}
|
|
565
606
|
function getExceptionName(object) {
|
|
566
607
|
if (isError(object)) {
|
|
567
|
-
return object
|
|
608
|
+
return object[_DYN_NAME ];
|
|
568
609
|
}
|
|
569
|
-
return
|
|
610
|
+
return STR_EMPTY;
|
|
570
611
|
}
|
|
571
612
|
function setValue(target, field, value, valChk, srcChk) {
|
|
572
613
|
var theValue = value;
|
|
@@ -579,6 +620,9 @@
|
|
|
579
620
|
}
|
|
580
621
|
return theValue;
|
|
581
622
|
}
|
|
623
|
+
function getCfgValue(theValue, defaultValue) {
|
|
624
|
+
return !isNullOrUndefined(theValue) ? theValue : defaultValue;
|
|
625
|
+
}
|
|
582
626
|
function isTruthy(value) {
|
|
583
627
|
return !!value;
|
|
584
628
|
}
|
|
@@ -597,7 +641,7 @@
|
|
|
597
641
|
src = srcFunc();
|
|
598
642
|
}
|
|
599
643
|
if (src) {
|
|
600
|
-
return src[funcName]
|
|
644
|
+
return src[funcName][_DYN_APPLY ](src, originalArguments);
|
|
601
645
|
}
|
|
602
646
|
};
|
|
603
647
|
}
|
|
@@ -621,7 +665,7 @@
|
|
|
621
665
|
function objExtend(obj1, obj2, obj3, obj4, obj5, obj6) {
|
|
622
666
|
var theArgs = arguments;
|
|
623
667
|
var extended = theArgs[0] || {};
|
|
624
|
-
var argLen = theArgs
|
|
668
|
+
var argLen = theArgs[_DYN_LENGTH ];
|
|
625
669
|
var deep = false;
|
|
626
670
|
var idx = 1;
|
|
627
671
|
if (argLen > 0 && isBoolean(extended)) {
|
|
@@ -637,7 +681,7 @@
|
|
|
637
681
|
var isArgArray = isArray(arg);
|
|
638
682
|
var isArgObj = isObject(arg);
|
|
639
683
|
for (var prop in arg) {
|
|
640
|
-
var propOk = (isArgArray && (prop in arg)) || (isArgObj && (ObjHasOwnProperty
|
|
684
|
+
var propOk = (isArgArray && (prop in arg)) || (isArgObj && (ObjHasOwnProperty[_DYN_CALL ](arg, prop)));
|
|
641
685
|
if (!propOk) {
|
|
642
686
|
continue;
|
|
643
687
|
}
|
|
@@ -751,18 +795,18 @@
|
|
|
751
795
|
}
|
|
752
796
|
function isIE() {
|
|
753
797
|
var nav = getNavigator();
|
|
754
|
-
if (nav && (nav
|
|
755
|
-
_navUserAgentCheck = nav
|
|
756
|
-
var userAgent = (_navUserAgentCheck ||
|
|
798
|
+
if (nav && (nav[_DYN_USER_AGENT ] !== _navUserAgentCheck || _isTrident === null)) {
|
|
799
|
+
_navUserAgentCheck = nav[_DYN_USER_AGENT ];
|
|
800
|
+
var userAgent = (_navUserAgentCheck || STR_EMPTY)[_DYN_TO_LOWER_CASE ]();
|
|
757
801
|
_isTrident = (strContains(userAgent, strMsie) || strContains(userAgent, strTrident));
|
|
758
802
|
}
|
|
759
803
|
return _isTrident;
|
|
760
804
|
}
|
|
761
805
|
function dumpObj(object) {
|
|
762
|
-
var objectTypeDump = Object[strShimPrototype].toString
|
|
763
|
-
var propertyValueDump =
|
|
806
|
+
var objectTypeDump = Object[strShimPrototype].toString[_DYN_CALL ](object);
|
|
807
|
+
var propertyValueDump = STR_EMPTY;
|
|
764
808
|
if (objectTypeDump === "[object Error]") {
|
|
765
|
-
propertyValueDump = "{ stack: '" + object.stack + "', message: '" + object.message + "', name: '" + object
|
|
809
|
+
propertyValueDump = "{ stack: '" + object.stack + "', message: '" + object.message + "', name: '" + object[_DYN_NAME ] + "'";
|
|
766
810
|
}
|
|
767
811
|
else if (hasJSON()) {
|
|
768
812
|
propertyValueDump = getJSON().stringify(object);
|
|
@@ -789,13 +833,11 @@
|
|
|
789
833
|
var AiNonUserActionablePrefix = "AI (Internal): ";
|
|
790
834
|
var AiUserActionablePrefix = "AI: ";
|
|
791
835
|
var AIInternalMessagePrefix = "AITR_";
|
|
792
|
-
var strErrorToConsole = "errorToConsole";
|
|
793
|
-
var strWarnToConsole = "warnToConsole";
|
|
794
836
|
function _sanitizeDiagnosticText(text) {
|
|
795
837
|
if (text) {
|
|
796
|
-
return "\"" + text
|
|
838
|
+
return "\"" + text[_DYN_REPLACE ](/\"/g, STR_EMPTY) + "\"";
|
|
797
839
|
}
|
|
798
|
-
return
|
|
840
|
+
return STR_EMPTY;
|
|
799
841
|
}
|
|
800
842
|
function _logToConsole(func, message) {
|
|
801
843
|
var theConsole = getConsole();
|
|
@@ -813,23 +855,23 @@
|
|
|
813
855
|
function _InternalLogMessage(msgId, msg, isUserAct, properties) {
|
|
814
856
|
if (isUserAct === void 0) { isUserAct = false; }
|
|
815
857
|
var _self = this;
|
|
816
|
-
_self
|
|
817
|
-
_self
|
|
858
|
+
_self[_DYN_MESSAGE_ID ] = msgId;
|
|
859
|
+
_self[_DYN_MESSAGE ] =
|
|
818
860
|
(isUserAct ? AiUserActionablePrefix : AiNonUserActionablePrefix) +
|
|
819
861
|
msgId;
|
|
820
|
-
var strProps =
|
|
862
|
+
var strProps = STR_EMPTY;
|
|
821
863
|
if (hasJSON()) {
|
|
822
864
|
strProps = getJSON().stringify(properties);
|
|
823
865
|
}
|
|
824
|
-
var diagnosticText = (msg ? " message:" + _sanitizeDiagnosticText(msg) :
|
|
825
|
-
(properties ? " props:" + _sanitizeDiagnosticText(strProps) :
|
|
826
|
-
_self
|
|
866
|
+
var diagnosticText = (msg ? " message:" + _sanitizeDiagnosticText(msg) : STR_EMPTY) +
|
|
867
|
+
(properties ? " props:" + _sanitizeDiagnosticText(strProps) : STR_EMPTY);
|
|
868
|
+
_self[_DYN_MESSAGE ] += diagnosticText;
|
|
827
869
|
}
|
|
828
870
|
_InternalLogMessage.dataType = "MessageData";
|
|
829
871
|
return _InternalLogMessage;
|
|
830
872
|
}());
|
|
831
873
|
function safeGetLogger(core, config) {
|
|
832
|
-
return (core || {})
|
|
874
|
+
return (core || {})[_DYN_LOGGER ] || new DiagnosticLogger(config);
|
|
833
875
|
}
|
|
834
876
|
var DiagnosticLogger = /** @class */ (function () {
|
|
835
877
|
function DiagnosticLogger(config) {
|
|
@@ -837,48 +879,49 @@
|
|
|
837
879
|
this.queue = [];
|
|
838
880
|
var _messageCount = 0;
|
|
839
881
|
var _messageLogged = {};
|
|
882
|
+
var _loggingLevelConsole;
|
|
883
|
+
var _loggingLevelTelemetry;
|
|
884
|
+
var _maxInternalMessageLimit;
|
|
885
|
+
var _enableDebugExceptions;
|
|
840
886
|
dynamicProto(DiagnosticLogger, this, function (_self) {
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
}
|
|
844
|
-
_self.
|
|
845
|
-
_self
|
|
846
|
-
_self.maxInternalMessageLimit = function () { return _getConfigValue("maxMessageLimit", 25); };
|
|
847
|
-
_self.enableDebugExceptions = function () { return _getConfigValue("enableDebugExceptions", false); };
|
|
887
|
+
_setDefaultsFromConfig(config || {});
|
|
888
|
+
_self.consoleLoggingLevel = function () { return _loggingLevelConsole; };
|
|
889
|
+
_self.telemetryLoggingLevel = function () { return _loggingLevelTelemetry; };
|
|
890
|
+
_self.maxInternalMessageLimit = function () { return _maxInternalMessageLimit; };
|
|
891
|
+
_self[_DYN_ENABLE_DEBUG_EXCEPTI4 ] = function () { return _enableDebugExceptions; };
|
|
848
892
|
_self.throwInternal = function (severity, msgId, msg, properties, isUserAct) {
|
|
849
893
|
if (isUserAct === void 0) { isUserAct = false; }
|
|
850
894
|
var message = new _InternalLogMessage(msgId, msg, isUserAct, properties);
|
|
851
|
-
if (
|
|
895
|
+
if (_enableDebugExceptions) {
|
|
852
896
|
throw dumpObj(message);
|
|
853
897
|
}
|
|
854
898
|
else {
|
|
855
|
-
var logFunc = severity === 1 ?
|
|
856
|
-
if (!isUndefined(message
|
|
857
|
-
var logLevel = _self.consoleLoggingLevel();
|
|
899
|
+
var logFunc = severity === 1 ? STR_ERROR_TO_CONSOLE : STR_WARN_TO_CONSOLE;
|
|
900
|
+
if (!isUndefined(message[_DYN_MESSAGE ])) {
|
|
858
901
|
if (isUserAct) {
|
|
859
|
-
var messageKey = +message
|
|
860
|
-
if (!_messageLogged[messageKey] &&
|
|
861
|
-
_self[logFunc](message
|
|
902
|
+
var messageKey = +message[_DYN_MESSAGE_ID ];
|
|
903
|
+
if (!_messageLogged[messageKey] && _loggingLevelConsole >= severity) {
|
|
904
|
+
_self[logFunc](message[_DYN_MESSAGE ]);
|
|
862
905
|
_messageLogged[messageKey] = true;
|
|
863
906
|
}
|
|
864
907
|
}
|
|
865
908
|
else {
|
|
866
|
-
if (
|
|
867
|
-
_self[logFunc](message
|
|
909
|
+
if (_loggingLevelConsole >= severity) {
|
|
910
|
+
_self[logFunc](message[_DYN_MESSAGE ]);
|
|
868
911
|
}
|
|
869
912
|
}
|
|
870
|
-
|
|
913
|
+
_logInternalMessage(severity, message);
|
|
871
914
|
}
|
|
872
915
|
else {
|
|
873
916
|
_debugExtMsg("throw" + (severity === 1 ? "Critical" : "Warning"), message);
|
|
874
917
|
}
|
|
875
918
|
}
|
|
876
919
|
};
|
|
877
|
-
_self
|
|
920
|
+
_self[STR_WARN_TO_CONSOLE ] = function (message) {
|
|
878
921
|
_logToConsole("warn", message);
|
|
879
922
|
_debugExtMsg("warning", message);
|
|
880
923
|
};
|
|
881
|
-
_self
|
|
924
|
+
_self[STR_ERROR_TO_CONSOLE ] = function (message) {
|
|
882
925
|
_logToConsole("error", message);
|
|
883
926
|
_debugExtMsg("error", message);
|
|
884
927
|
};
|
|
@@ -886,12 +929,13 @@
|
|
|
886
929
|
_messageCount = 0;
|
|
887
930
|
_messageLogged = {};
|
|
888
931
|
};
|
|
889
|
-
_self
|
|
932
|
+
_self[_DYN_LOG_INTERNAL_MESSAGE ] = _logInternalMessage;
|
|
933
|
+
function _logInternalMessage(severity, message) {
|
|
890
934
|
if (_areInternalMessagesThrottled()) {
|
|
891
935
|
return;
|
|
892
936
|
}
|
|
893
937
|
var logMessage = true;
|
|
894
|
-
var messageKey = AIInternalMessagePrefix + message
|
|
938
|
+
var messageKey = AIInternalMessagePrefix + message[_DYN_MESSAGE_ID ];
|
|
895
939
|
if (_messageLogged[messageKey]) {
|
|
896
940
|
logMessage = false;
|
|
897
941
|
}
|
|
@@ -899,38 +943,37 @@
|
|
|
899
943
|
_messageLogged[messageKey] = true;
|
|
900
944
|
}
|
|
901
945
|
if (logMessage) {
|
|
902
|
-
if (severity <=
|
|
903
|
-
_self.queue
|
|
946
|
+
if (severity <= _loggingLevelTelemetry) {
|
|
947
|
+
_self.queue[_DYN_PUSH ](message);
|
|
904
948
|
_messageCount++;
|
|
905
949
|
_debugExtMsg((severity === 1 ? "error" : "warn"), message);
|
|
906
950
|
}
|
|
907
|
-
if (_messageCount ===
|
|
951
|
+
if (_messageCount === _maxInternalMessageLimit) {
|
|
908
952
|
var throttleLimitMessage = "Internal events throttle limit per PageView reached for this app.";
|
|
909
953
|
var throttleMessage = new _InternalLogMessage(23 , throttleLimitMessage, false);
|
|
910
|
-
_self.queue
|
|
954
|
+
_self.queue[_DYN_PUSH ](throttleMessage);
|
|
911
955
|
if (severity === 1 ) {
|
|
912
|
-
_self
|
|
956
|
+
_self[STR_ERROR_TO_CONSOLE ](throttleLimitMessage);
|
|
913
957
|
}
|
|
914
958
|
else {
|
|
915
|
-
_self
|
|
959
|
+
_self[STR_WARN_TO_CONSOLE ](throttleLimitMessage);
|
|
916
960
|
}
|
|
917
961
|
}
|
|
918
962
|
}
|
|
919
|
-
}
|
|
920
|
-
function
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
return defValue;
|
|
963
|
+
}
|
|
964
|
+
function _setDefaultsFromConfig(config) {
|
|
965
|
+
_loggingLevelConsole = getCfgValue(config.loggingLevelConsole, 0);
|
|
966
|
+
_loggingLevelTelemetry = getCfgValue(config.loggingLevelTelemetry, 1);
|
|
967
|
+
_maxInternalMessageLimit = getCfgValue(config.maxMessageLimit, 25);
|
|
968
|
+
_enableDebugExceptions = getCfgValue(config[_DYN_ENABLE_DEBUG_EXCEPTI4 ], false);
|
|
926
969
|
}
|
|
927
970
|
function _areInternalMessagesThrottled() {
|
|
928
|
-
return _messageCount >=
|
|
971
|
+
return _messageCount >= _maxInternalMessageLimit;
|
|
929
972
|
}
|
|
930
973
|
function _debugExtMsg(name, data) {
|
|
931
|
-
var dbgExt = getDebugExt(config);
|
|
932
|
-
if (dbgExt && dbgExt
|
|
933
|
-
dbgExt
|
|
974
|
+
var dbgExt = getDebugExt(config || {});
|
|
975
|
+
if (dbgExt && dbgExt[_DYN_DIAG_LOG ]) {
|
|
976
|
+
dbgExt[_DYN_DIAG_LOG ](name, data);
|
|
934
977
|
}
|
|
935
978
|
}
|
|
936
979
|
});
|
|
@@ -938,20 +981,25 @@
|
|
|
938
981
|
DiagnosticLogger.__ieDyn=1;
|
|
939
982
|
return DiagnosticLogger;
|
|
940
983
|
}());
|
|
984
|
+
function _getLogger(logger) {
|
|
985
|
+
return (logger || new DiagnosticLogger());
|
|
986
|
+
}
|
|
941
987
|
function _throwInternal(logger, severity, msgId, msg, properties, isUserAct) {
|
|
942
988
|
if (isUserAct === void 0) { isUserAct = false; }
|
|
943
|
-
(logger
|
|
989
|
+
_getLogger(logger).throwInternal(severity, msgId, msg, properties, isUserAct);
|
|
944
990
|
}
|
|
945
991
|
|
|
946
992
|
var strExecutionContextKey = "ctx";
|
|
993
|
+
var strParentContextKey = "ParentContextKey";
|
|
994
|
+
var strChildrenContextKey = "ChildrenContextKey";
|
|
947
995
|
var PerfEvent = /** @class */ (function () {
|
|
948
996
|
function PerfEvent(name, payloadDetails, isAsync) {
|
|
949
997
|
var _self = this;
|
|
950
998
|
var accessorDefined = false;
|
|
951
999
|
_self.start = dateNow();
|
|
952
|
-
_self
|
|
953
|
-
_self
|
|
954
|
-
_self
|
|
1000
|
+
_self[_DYN_NAME ] = name;
|
|
1001
|
+
_self[_DYN_IS_ASYNC ] = isAsync;
|
|
1002
|
+
_self[_DYN_IS_CHILD_EVT ] = function () { return false; };
|
|
955
1003
|
if (isFunction(payloadDetails)) {
|
|
956
1004
|
var theDetails_1;
|
|
957
1005
|
accessorDefined = objDefineAccessors(_self, "payload", function () {
|
|
@@ -962,24 +1010,24 @@
|
|
|
962
1010
|
return theDetails_1;
|
|
963
1011
|
});
|
|
964
1012
|
}
|
|
965
|
-
_self
|
|
1013
|
+
_self[_DYN_GET_CTX ] = function (key) {
|
|
966
1014
|
if (key) {
|
|
967
|
-
if (key === PerfEvent
|
|
1015
|
+
if (key === PerfEvent[strParentContextKey] || key === PerfEvent[strChildrenContextKey]) {
|
|
968
1016
|
return _self[key];
|
|
969
1017
|
}
|
|
970
1018
|
return (_self[strExecutionContextKey] || {})[key];
|
|
971
1019
|
}
|
|
972
1020
|
return null;
|
|
973
1021
|
};
|
|
974
|
-
_self
|
|
1022
|
+
_self[_DYN_SET_CTX ] = function (key, value) {
|
|
975
1023
|
if (key) {
|
|
976
|
-
if (key === PerfEvent
|
|
1024
|
+
if (key === PerfEvent[strParentContextKey]) {
|
|
977
1025
|
if (!_self[key]) {
|
|
978
|
-
_self
|
|
1026
|
+
_self[_DYN_IS_CHILD_EVT ] = function () { return true; };
|
|
979
1027
|
}
|
|
980
1028
|
_self[key] = value;
|
|
981
1029
|
}
|
|
982
|
-
else if (key === PerfEvent
|
|
1030
|
+
else if (key === PerfEvent[strChildrenContextKey]) {
|
|
983
1031
|
_self[key] = value;
|
|
984
1032
|
}
|
|
985
1033
|
else {
|
|
@@ -988,20 +1036,20 @@
|
|
|
988
1036
|
}
|
|
989
1037
|
}
|
|
990
1038
|
};
|
|
991
|
-
_self
|
|
1039
|
+
_self[_DYN_COMPLETE ] = function () {
|
|
992
1040
|
var childTime = 0;
|
|
993
|
-
var childEvts = _self
|
|
1041
|
+
var childEvts = _self[_DYN_GET_CTX ](PerfEvent[strChildrenContextKey]);
|
|
994
1042
|
if (isArray(childEvts)) {
|
|
995
|
-
for (var lp = 0; lp < childEvts
|
|
1043
|
+
for (var lp = 0; lp < childEvts[_DYN_LENGTH ]; lp++) {
|
|
996
1044
|
var childEvt = childEvts[lp];
|
|
997
1045
|
if (childEvt) {
|
|
998
|
-
childTime += childEvt
|
|
1046
|
+
childTime += childEvt[_DYN_TIME ];
|
|
999
1047
|
}
|
|
1000
1048
|
}
|
|
1001
1049
|
}
|
|
1002
|
-
_self
|
|
1003
|
-
_self.exTime = _self
|
|
1004
|
-
_self
|
|
1050
|
+
_self[_DYN_TIME ] = dateNow() - _self.start;
|
|
1051
|
+
_self.exTime = _self[_DYN_TIME ] - childTime;
|
|
1052
|
+
_self[_DYN_COMPLETE ] = function () { };
|
|
1005
1053
|
if (!accessorDefined && isFunction(payloadDetails)) {
|
|
1006
1054
|
_self.payload = payloadDetails();
|
|
1007
1055
|
}
|
|
@@ -1015,40 +1063,40 @@
|
|
|
1015
1063
|
function doPerf(mgrSource, getSource, func, details, isAsync) {
|
|
1016
1064
|
if (mgrSource) {
|
|
1017
1065
|
var perfMgr = mgrSource;
|
|
1018
|
-
if (
|
|
1019
|
-
perfMgr = perfMgr[
|
|
1066
|
+
if (perfMgr[STR_GET_PERF_MGR]) {
|
|
1067
|
+
perfMgr = perfMgr[STR_GET_PERF_MGR]();
|
|
1020
1068
|
}
|
|
1021
1069
|
if (perfMgr) {
|
|
1022
1070
|
var perfEvt = void 0;
|
|
1023
|
-
var currentActive = perfMgr
|
|
1071
|
+
var currentActive = perfMgr[_DYN_GET_CTX ](doPerfActiveKey);
|
|
1024
1072
|
try {
|
|
1025
1073
|
perfEvt = perfMgr.create(getSource(), details, isAsync);
|
|
1026
1074
|
if (perfEvt) {
|
|
1027
|
-
if (currentActive && perfEvt
|
|
1028
|
-
perfEvt
|
|
1029
|
-
if (currentActive
|
|
1030
|
-
var children = currentActive
|
|
1075
|
+
if (currentActive && perfEvt[_DYN_SET_CTX ]) {
|
|
1076
|
+
perfEvt[_DYN_SET_CTX ](PerfEvent[strParentContextKey], currentActive);
|
|
1077
|
+
if (currentActive[_DYN_GET_CTX ] && currentActive[_DYN_SET_CTX ]) {
|
|
1078
|
+
var children = currentActive[_DYN_GET_CTX ](PerfEvent[strChildrenContextKey]);
|
|
1031
1079
|
if (!children) {
|
|
1032
1080
|
children = [];
|
|
1033
|
-
currentActive
|
|
1081
|
+
currentActive[_DYN_SET_CTX ](PerfEvent[strChildrenContextKey], children);
|
|
1034
1082
|
}
|
|
1035
|
-
children
|
|
1083
|
+
children[_DYN_PUSH ](perfEvt);
|
|
1036
1084
|
}
|
|
1037
1085
|
}
|
|
1038
|
-
perfMgr
|
|
1086
|
+
perfMgr[_DYN_SET_CTX ](doPerfActiveKey, perfEvt);
|
|
1039
1087
|
return func(perfEvt);
|
|
1040
1088
|
}
|
|
1041
1089
|
}
|
|
1042
1090
|
catch (ex) {
|
|
1043
|
-
if (perfEvt && perfEvt
|
|
1044
|
-
perfEvt
|
|
1091
|
+
if (perfEvt && perfEvt[_DYN_SET_CTX ]) {
|
|
1092
|
+
perfEvt[_DYN_SET_CTX ]("exception", ex);
|
|
1045
1093
|
}
|
|
1046
1094
|
}
|
|
1047
1095
|
finally {
|
|
1048
1096
|
if (perfEvt) {
|
|
1049
1097
|
perfMgr.fire(perfEvt);
|
|
1050
1098
|
}
|
|
1051
|
-
perfMgr
|
|
1099
|
+
perfMgr[_DYN_SET_CTX ](doPerfActiveKey, currentActive);
|
|
1052
1100
|
}
|
|
1053
1101
|
}
|
|
1054
1102
|
}
|
|
@@ -1110,8 +1158,8 @@
|
|
|
1110
1158
|
var base64chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
1111
1159
|
var number = random32() >>> 0;
|
|
1112
1160
|
var chars = 0;
|
|
1113
|
-
var result =
|
|
1114
|
-
while (result
|
|
1161
|
+
var result = STR_EMPTY;
|
|
1162
|
+
while (result[_DYN_LENGTH ] < maxLength) {
|
|
1115
1163
|
chars++;
|
|
1116
1164
|
result += base64chars.charAt(number & 0x3F);
|
|
1117
1165
|
number >>>= 6;
|
|
@@ -1124,7 +1172,7 @@
|
|
|
1124
1172
|
}
|
|
1125
1173
|
|
|
1126
1174
|
var _objDefineProperty = ObjDefineProperty;
|
|
1127
|
-
var version = "2.8.5-nightly.
|
|
1175
|
+
var version = "2.8.5-nightly.2207-01";
|
|
1128
1176
|
var instanceName = "." + newId(6);
|
|
1129
1177
|
var _dataUid = 0;
|
|
1130
1178
|
function _createAccessor(target, prop, value) {
|
|
@@ -1143,7 +1191,7 @@
|
|
|
1143
1191
|
return false;
|
|
1144
1192
|
}
|
|
1145
1193
|
function _canAcceptData(target) {
|
|
1146
|
-
return target
|
|
1194
|
+
return target[_DYN_NODE_TYPE ] === 1 || target[_DYN_NODE_TYPE ] === 9 || !(+target[_DYN_NODE_TYPE ]);
|
|
1147
1195
|
}
|
|
1148
1196
|
function _getCache(data, target) {
|
|
1149
1197
|
var theCache = target[data.id];
|
|
@@ -1163,11 +1211,11 @@
|
|
|
1163
1211
|
}
|
|
1164
1212
|
function createUniqueNamespace(name, includeVersion) {
|
|
1165
1213
|
if (includeVersion === void 0) { includeVersion = false; }
|
|
1166
|
-
return normalizeJsName(name + (_dataUid++) + (includeVersion ? "." + version :
|
|
1214
|
+
return normalizeJsName(name + (_dataUid++) + (includeVersion ? "." + version : STR_EMPTY) + instanceName);
|
|
1167
1215
|
}
|
|
1168
1216
|
function createElmNodeData(name) {
|
|
1169
1217
|
var data = {
|
|
1170
|
-
id: createUniqueNamespace("_aiData-" + (name ||
|
|
1218
|
+
id: createUniqueNamespace("_aiData-" + (name || STR_EMPTY) + "." + version),
|
|
1171
1219
|
accept: function (target) {
|
|
1172
1220
|
return _canAcceptData(target);
|
|
1173
1221
|
},
|
|
@@ -1224,7 +1272,7 @@
|
|
|
1224
1272
|
return true;
|
|
1225
1273
|
}
|
|
1226
1274
|
function _createCookieMgrConfig(rootConfig) {
|
|
1227
|
-
var cookieMgrCfg = rootConfig
|
|
1275
|
+
var cookieMgrCfg = rootConfig[_DYN_COOKIE_CFG ] = rootConfig[_DYN_COOKIE_CFG ] || {};
|
|
1228
1276
|
setValue(cookieMgrCfg, "domain", rootConfig.cookieDomain, isNotNullOrUndefined, isNullOrUndefined);
|
|
1229
1277
|
setValue(cookieMgrCfg, "path", rootConfig.cookiePath || "/", null, isNullOrUndefined);
|
|
1230
1278
|
if (isNullOrUndefined(cookieMgrCfg[strEnabled])) {
|
|
@@ -1245,7 +1293,7 @@
|
|
|
1245
1293
|
cookieMgr = core.getCookieMgr();
|
|
1246
1294
|
}
|
|
1247
1295
|
else if (config) {
|
|
1248
|
-
var cookieCfg = config
|
|
1296
|
+
var cookieCfg = config[_DYN_COOKIE_CFG ];
|
|
1249
1297
|
if (cookieCfg[strConfigCookieMgr]) {
|
|
1250
1298
|
cookieMgr = cookieCfg[strConfigCookieMgr];
|
|
1251
1299
|
}
|
|
@@ -1254,36 +1302,38 @@
|
|
|
1254
1302
|
}
|
|
1255
1303
|
}
|
|
1256
1304
|
if (!cookieMgr) {
|
|
1257
|
-
cookieMgr = _gblCookieMgr(config, (core || {})
|
|
1305
|
+
cookieMgr = _gblCookieMgr(config, (core || {})[_DYN_LOGGER ]);
|
|
1258
1306
|
}
|
|
1259
1307
|
return cookieMgr;
|
|
1260
1308
|
}
|
|
1261
1309
|
function createCookieMgr(rootConfig, logger) {
|
|
1310
|
+
var _a;
|
|
1262
1311
|
var cookieMgrConfig = _createCookieMgrConfig(rootConfig || _globalCookieConfig);
|
|
1263
1312
|
var _path = cookieMgrConfig.path || "/";
|
|
1264
1313
|
var _domain = cookieMgrConfig.domain;
|
|
1265
1314
|
var _enabled = cookieMgrConfig[strEnabled] !== false;
|
|
1266
|
-
var cookieMgr = {
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1315
|
+
var cookieMgr = (_a = {
|
|
1316
|
+
isEnabled: function () {
|
|
1317
|
+
var enabled = _enabled && areCookiesSupported(logger);
|
|
1318
|
+
var gblManager = _globalCookieConfig[strConfigCookieMgr];
|
|
1319
|
+
if (enabled && gblManager && cookieMgr !== gblManager) {
|
|
1320
|
+
enabled = _isMgrEnabled(gblManager);
|
|
1321
|
+
}
|
|
1322
|
+
return enabled;
|
|
1323
|
+
}
|
|
1274
1324
|
},
|
|
1275
|
-
|
|
1325
|
+
_a[_DYN_SET_ENABLED ] = function (value) {
|
|
1276
1326
|
_enabled = value !== false;
|
|
1277
1327
|
},
|
|
1278
|
-
set
|
|
1328
|
+
_a.set = function (name, value, maxAgeSec, domain, path) {
|
|
1279
1329
|
var result = false;
|
|
1280
1330
|
if (_isMgrEnabled(cookieMgr)) {
|
|
1281
1331
|
var values = {};
|
|
1282
|
-
var theValue = strTrim(value ||
|
|
1283
|
-
var idx = theValue
|
|
1332
|
+
var theValue = strTrim(value || STR_EMPTY);
|
|
1333
|
+
var idx = theValue[_DYN_INDEX_OF ](";");
|
|
1284
1334
|
if (idx !== -1) {
|
|
1285
|
-
theValue = strTrim(value
|
|
1286
|
-
values = _extractParts(value
|
|
1335
|
+
theValue = strTrim(value[_DYN_SUBSTRING ](0, idx));
|
|
1336
|
+
values = _extractParts(value[_DYN_SUBSTRING ](idx + 1));
|
|
1287
1337
|
}
|
|
1288
1338
|
setValue(values, "domain", domain || _domain, isTruthy, isUndefined);
|
|
1289
1339
|
if (!isNullOrUndefined(maxAgeSec)) {
|
|
@@ -1294,18 +1344,18 @@
|
|
|
1294
1344
|
if (expireMs > 0) {
|
|
1295
1345
|
var expiry = new Date();
|
|
1296
1346
|
expiry.setTime(expireMs);
|
|
1297
|
-
setValue(values, strExpires, _formatDate(expiry, !_isIE ? strToUTCString : strToGMTString) || _formatDate(expiry, _isIE ? strToGMTString : strToUTCString) ||
|
|
1347
|
+
setValue(values, strExpires, _formatDate(expiry, !_isIE ? strToUTCString : strToGMTString) || _formatDate(expiry, _isIE ? strToGMTString : strToUTCString) || STR_EMPTY, isTruthy);
|
|
1298
1348
|
}
|
|
1299
1349
|
}
|
|
1300
1350
|
if (!_isIE) {
|
|
1301
|
-
setValue(values, "max-age",
|
|
1351
|
+
setValue(values, "max-age", STR_EMPTY + maxAgeSec, null, isUndefined);
|
|
1302
1352
|
}
|
|
1303
1353
|
}
|
|
1304
1354
|
var location_1 = getLocation();
|
|
1305
1355
|
if (location_1 && location_1.protocol === "https:") {
|
|
1306
1356
|
setValue(values, "secure", null, null, isUndefined);
|
|
1307
1357
|
if (_allowUaSameSite === null) {
|
|
1308
|
-
_allowUaSameSite = !uaDisallowsSameSiteNone((getNavigator() || {})
|
|
1358
|
+
_allowUaSameSite = !uaDisallowsSameSiteNone((getNavigator() || {})[_DYN_USER_AGENT ]);
|
|
1309
1359
|
}
|
|
1310
1360
|
if (_allowUaSameSite) {
|
|
1311
1361
|
setValue(values, "SameSite", "None", null, isUndefined);
|
|
@@ -1318,21 +1368,21 @@
|
|
|
1318
1368
|
}
|
|
1319
1369
|
return result;
|
|
1320
1370
|
},
|
|
1321
|
-
get
|
|
1322
|
-
var value =
|
|
1371
|
+
_a.get = function (name) {
|
|
1372
|
+
var value = STR_EMPTY;
|
|
1323
1373
|
if (_isMgrEnabled(cookieMgr)) {
|
|
1324
1374
|
value = (cookieMgrConfig.getCookie || _getCookieValue)(name);
|
|
1325
1375
|
}
|
|
1326
1376
|
return value;
|
|
1327
1377
|
},
|
|
1328
|
-
del
|
|
1378
|
+
_a.del = function (name, path) {
|
|
1329
1379
|
var result = false;
|
|
1330
1380
|
if (_isMgrEnabled(cookieMgr)) {
|
|
1331
1381
|
result = cookieMgr.purge(name, path);
|
|
1332
1382
|
}
|
|
1333
1383
|
return result;
|
|
1334
1384
|
},
|
|
1335
|
-
purge
|
|
1385
|
+
_a.purge = function (name, path) {
|
|
1336
1386
|
var _a;
|
|
1337
1387
|
var result = false;
|
|
1338
1388
|
if (areCookiesSupported(logger)) {
|
|
@@ -1344,12 +1394,12 @@
|
|
|
1344
1394
|
values["max-age"] = "0";
|
|
1345
1395
|
}
|
|
1346
1396
|
var delCookie = cookieMgrConfig.delCookie || _setCookieValue;
|
|
1347
|
-
delCookie(name, _formatCookieValue(
|
|
1397
|
+
delCookie(name, _formatCookieValue(STR_EMPTY, values));
|
|
1348
1398
|
result = true;
|
|
1349
1399
|
}
|
|
1350
1400
|
return result;
|
|
1351
|
-
}
|
|
1352
|
-
|
|
1401
|
+
},
|
|
1402
|
+
_a);
|
|
1353
1403
|
cookieMgr[strConfigCookieMgr] = cookieMgr;
|
|
1354
1404
|
return cookieMgr;
|
|
1355
1405
|
}
|
|
@@ -1368,17 +1418,17 @@
|
|
|
1368
1418
|
}
|
|
1369
1419
|
function _extractParts(theValue) {
|
|
1370
1420
|
var values = {};
|
|
1371
|
-
if (theValue && theValue
|
|
1372
|
-
var parts = strTrim(theValue)
|
|
1421
|
+
if (theValue && theValue[_DYN_LENGTH ]) {
|
|
1422
|
+
var parts = strTrim(theValue)[_DYN_SPLIT ](";");
|
|
1373
1423
|
arrForEach(parts, function (thePart) {
|
|
1374
|
-
thePart = strTrim(thePart ||
|
|
1424
|
+
thePart = strTrim(thePart || STR_EMPTY);
|
|
1375
1425
|
if (thePart) {
|
|
1376
|
-
var idx = thePart
|
|
1426
|
+
var idx = thePart[_DYN_INDEX_OF ]("=");
|
|
1377
1427
|
if (idx === -1) {
|
|
1378
1428
|
values[thePart] = null;
|
|
1379
1429
|
}
|
|
1380
1430
|
else {
|
|
1381
|
-
values[strTrim(thePart
|
|
1431
|
+
values[strTrim(thePart[_DYN_SUBSTRING ](0, idx))] = strTrim(thePart[_DYN_SUBSTRING ](idx + 1));
|
|
1382
1432
|
}
|
|
1383
1433
|
}
|
|
1384
1434
|
});
|
|
@@ -1392,21 +1442,21 @@
|
|
|
1392
1442
|
return null;
|
|
1393
1443
|
}
|
|
1394
1444
|
function _formatCookieValue(value, values) {
|
|
1395
|
-
var cookieValue = value ||
|
|
1445
|
+
var cookieValue = value || STR_EMPTY;
|
|
1396
1446
|
objForEachKey(values, function (name, theValue) {
|
|
1397
|
-
cookieValue += "; " + name + (!isNullOrUndefined(theValue) ? "=" + theValue :
|
|
1447
|
+
cookieValue += "; " + name + (!isNullOrUndefined(theValue) ? "=" + theValue : STR_EMPTY);
|
|
1398
1448
|
});
|
|
1399
1449
|
return cookieValue;
|
|
1400
1450
|
}
|
|
1401
1451
|
function _getCookieValue(name) {
|
|
1402
|
-
var cookieValue =
|
|
1452
|
+
var cookieValue = STR_EMPTY;
|
|
1403
1453
|
if (_doc) {
|
|
1404
|
-
var theCookie = _doc[strCookie] ||
|
|
1454
|
+
var theCookie = _doc[strCookie] || STR_EMPTY;
|
|
1405
1455
|
if (_parsedCookieValue !== theCookie) {
|
|
1406
1456
|
_cookieCache = _extractParts(theCookie);
|
|
1407
1457
|
_parsedCookieValue = theCookie;
|
|
1408
1458
|
}
|
|
1409
|
-
cookieValue = strTrim(_cookieCache[name] ||
|
|
1459
|
+
cookieValue = strTrim(_cookieCache[name] || STR_EMPTY);
|
|
1410
1460
|
}
|
|
1411
1461
|
return cookieValue;
|
|
1412
1462
|
}
|
|
@@ -1451,12 +1501,12 @@
|
|
|
1451
1501
|
var _chainId = 0;
|
|
1452
1502
|
function _getNextProxyStart(proxy, core, startAt) {
|
|
1453
1503
|
while (proxy) {
|
|
1454
|
-
if (proxy
|
|
1504
|
+
if (proxy[_DYN_GET_PLUGIN ]() === startAt) {
|
|
1455
1505
|
return proxy;
|
|
1456
1506
|
}
|
|
1457
|
-
proxy = proxy
|
|
1507
|
+
proxy = proxy[_DYN_GET_NEXT ]();
|
|
1458
1508
|
}
|
|
1459
|
-
return createTelemetryProxyChain([startAt], core
|
|
1509
|
+
return createTelemetryProxyChain([startAt], core[_DYN_CONFIG ] || {}, core);
|
|
1460
1510
|
}
|
|
1461
1511
|
function _createInternalContext(telemetryChain, config, core, startAt) {
|
|
1462
1512
|
var _nextProxy = null;
|
|
@@ -1497,7 +1547,7 @@
|
|
|
1497
1547
|
args[_i - 2] = arguments[_i];
|
|
1498
1548
|
}
|
|
1499
1549
|
if (onComplete) {
|
|
1500
|
-
_onComplete
|
|
1550
|
+
_onComplete[_DYN_PUSH ]({
|
|
1501
1551
|
func: onComplete,
|
|
1502
1552
|
self: !isUndefined(that) ? that : context.ctx,
|
|
1503
1553
|
args: args
|
|
@@ -1506,16 +1556,16 @@
|
|
|
1506
1556
|
}
|
|
1507
1557
|
function _moveNext() {
|
|
1508
1558
|
var nextProxy = _nextProxy;
|
|
1509
|
-
_nextProxy = nextProxy ? nextProxy
|
|
1559
|
+
_nextProxy = nextProxy ? nextProxy[_DYN_GET_NEXT ]() : null;
|
|
1510
1560
|
if (!nextProxy) {
|
|
1511
1561
|
var onComplete = _onComplete;
|
|
1512
|
-
if (onComplete && onComplete
|
|
1562
|
+
if (onComplete && onComplete[_DYN_LENGTH ] > 0) {
|
|
1513
1563
|
arrForEach(onComplete, function (completeDetails) {
|
|
1514
1564
|
try {
|
|
1515
|
-
completeDetails.func
|
|
1565
|
+
completeDetails.func[_DYN_CALL ](completeDetails.self, completeDetails.args);
|
|
1516
1566
|
}
|
|
1517
1567
|
catch (e) {
|
|
1518
|
-
_throwInternal(core
|
|
1568
|
+
_throwInternal(core[_DYN_LOGGER ], 2 , 73 , "Unexpected Exception during onComplete - " + dumpObj(e));
|
|
1519
1569
|
}
|
|
1520
1570
|
});
|
|
1521
1571
|
_onComplete = [];
|
|
@@ -1528,7 +1578,7 @@
|
|
|
1528
1578
|
if (mergeDefault === void 0) { mergeDefault = 0 ; }
|
|
1529
1579
|
var theConfig;
|
|
1530
1580
|
if (config) {
|
|
1531
|
-
var extConfig = config
|
|
1581
|
+
var extConfig = config[STR_EXTENSION_CONFIG ];
|
|
1532
1582
|
if (extConfig && identifier) {
|
|
1533
1583
|
theConfig = extConfig[identifier];
|
|
1534
1584
|
}
|
|
@@ -1569,7 +1619,7 @@
|
|
|
1569
1619
|
function _iterateChain(cb) {
|
|
1570
1620
|
var nextPlugin;
|
|
1571
1621
|
while (!!(nextPlugin = context._next())) {
|
|
1572
|
-
var plugin = nextPlugin
|
|
1622
|
+
var plugin = nextPlugin[_DYN_GET_PLUGIN ]();
|
|
1573
1623
|
if (plugin) {
|
|
1574
1624
|
cb(plugin);
|
|
1575
1625
|
}
|
|
@@ -1582,7 +1632,7 @@
|
|
|
1582
1632
|
var context = internalContext.ctx;
|
|
1583
1633
|
function _processNext(env) {
|
|
1584
1634
|
var nextPlugin = internalContext._next();
|
|
1585
|
-
nextPlugin && nextPlugin
|
|
1635
|
+
nextPlugin && nextPlugin[STR_PROCESS_TELEMETRY ](env, context);
|
|
1586
1636
|
return !nextPlugin;
|
|
1587
1637
|
}
|
|
1588
1638
|
function _createNew(plugins, startAt) {
|
|
@@ -1590,14 +1640,14 @@
|
|
|
1590
1640
|
if (isArray(plugins)) {
|
|
1591
1641
|
plugins = createTelemetryProxyChain(plugins, config, core, startAt);
|
|
1592
1642
|
}
|
|
1593
|
-
return createProcessTelemetryContext(plugins || context
|
|
1643
|
+
return createProcessTelemetryContext(plugins || context[_DYN_GET_NEXT ](), config, core, startAt);
|
|
1594
1644
|
}
|
|
1595
|
-
context
|
|
1596
|
-
context
|
|
1645
|
+
context[_DYN_PROCESS_NEXT ] = _processNext;
|
|
1646
|
+
context[_DYN_CREATE_NEW ] = _createNew;
|
|
1597
1647
|
return context;
|
|
1598
1648
|
}
|
|
1599
1649
|
function createProcessTelemetryUnloadContext(telemetryChain, core, startAt) {
|
|
1600
|
-
var config = core
|
|
1650
|
+
var config = core[_DYN_CONFIG ] || {};
|
|
1601
1651
|
var internalContext = _createInternalContext(telemetryChain, config, core, startAt);
|
|
1602
1652
|
var context = internalContext.ctx;
|
|
1603
1653
|
function _processNext(unloadState) {
|
|
@@ -1610,20 +1660,20 @@
|
|
|
1610
1660
|
if (isArray(plugins)) {
|
|
1611
1661
|
plugins = createTelemetryProxyChain(plugins, config, core, startAt);
|
|
1612
1662
|
}
|
|
1613
|
-
return createProcessTelemetryUnloadContext(plugins || context
|
|
1663
|
+
return createProcessTelemetryUnloadContext(plugins || context[_DYN_GET_NEXT ](), core, startAt);
|
|
1614
1664
|
}
|
|
1615
|
-
context
|
|
1616
|
-
context
|
|
1665
|
+
context[_DYN_PROCESS_NEXT ] = _processNext;
|
|
1666
|
+
context[_DYN_CREATE_NEW ] = _createNew;
|
|
1617
1667
|
return context;
|
|
1618
1668
|
}
|
|
1619
1669
|
function createProcessTelemetryUpdateContext(telemetryChain, core, startAt) {
|
|
1620
|
-
var config = core
|
|
1670
|
+
var config = core[_DYN_CONFIG ] || {};
|
|
1621
1671
|
var internalContext = _createInternalContext(telemetryChain, config, core, startAt);
|
|
1622
1672
|
var context = internalContext.ctx;
|
|
1623
1673
|
function _processNext(updateState) {
|
|
1624
1674
|
return context.iterate(function (plugin) {
|
|
1625
|
-
if (isFunction(plugin
|
|
1626
|
-
plugin
|
|
1675
|
+
if (isFunction(plugin[_DYN_UPDATE ])) {
|
|
1676
|
+
plugin[_DYN_UPDATE ](context, updateState);
|
|
1627
1677
|
}
|
|
1628
1678
|
});
|
|
1629
1679
|
}
|
|
@@ -1632,22 +1682,22 @@
|
|
|
1632
1682
|
if (isArray(plugins)) {
|
|
1633
1683
|
plugins = createTelemetryProxyChain(plugins, config, core, startAt);
|
|
1634
1684
|
}
|
|
1635
|
-
return createProcessTelemetryUpdateContext(plugins || context
|
|
1685
|
+
return createProcessTelemetryUpdateContext(plugins || context[_DYN_GET_NEXT ](), core, startAt);
|
|
1636
1686
|
}
|
|
1637
|
-
context
|
|
1638
|
-
context
|
|
1687
|
+
context[_DYN_PROCESS_NEXT ] = _processNext;
|
|
1688
|
+
context[_DYN_CREATE_NEW ] = _createNew;
|
|
1639
1689
|
return context;
|
|
1640
1690
|
}
|
|
1641
1691
|
function createTelemetryProxyChain(plugins, config, core, startAt) {
|
|
1642
1692
|
var firstProxy = null;
|
|
1643
1693
|
var add = startAt ? false : true;
|
|
1644
|
-
if (isArray(plugins) && plugins
|
|
1694
|
+
if (isArray(plugins) && plugins[_DYN_LENGTH ] > 0) {
|
|
1645
1695
|
var lastProxy_1 = null;
|
|
1646
1696
|
arrForEach(plugins, function (thePlugin) {
|
|
1647
1697
|
if (!add && startAt === thePlugin) {
|
|
1648
1698
|
add = true;
|
|
1649
1699
|
}
|
|
1650
|
-
if (add && thePlugin && isFunction(thePlugin
|
|
1700
|
+
if (add && thePlugin && isFunction(thePlugin[STR_PROCESS_TELEMETRY ])) {
|
|
1651
1701
|
var newProxy = createTelemetryPluginProxy(thePlugin, config, core);
|
|
1652
1702
|
if (!firstProxy) {
|
|
1653
1703
|
firstProxy = newProxy;
|
|
@@ -1666,11 +1716,11 @@
|
|
|
1666
1716
|
}
|
|
1667
1717
|
function createTelemetryPluginProxy(plugin, config, core) {
|
|
1668
1718
|
var nextProxy = null;
|
|
1669
|
-
var hasProcessTelemetry = isFunction(plugin
|
|
1670
|
-
var hasSetNext = isFunction(plugin
|
|
1719
|
+
var hasProcessTelemetry = isFunction(plugin[STR_PROCESS_TELEMETRY ]);
|
|
1720
|
+
var hasSetNext = isFunction(plugin[_DYN_SET_NEXT_PLUGIN ]);
|
|
1671
1721
|
var chainId;
|
|
1672
1722
|
if (plugin) {
|
|
1673
|
-
chainId = plugin
|
|
1723
|
+
chainId = plugin[_DYN_IDENTIFIER ] + "-" + plugin[STR_PRIORITY ] + "-" + _chainId++;
|
|
1674
1724
|
}
|
|
1675
1725
|
else {
|
|
1676
1726
|
chainId = "Unknown-0-" + _chainId++;
|
|
@@ -1702,17 +1752,17 @@
|
|
|
1702
1752
|
}
|
|
1703
1753
|
function _processChain(itemCtx, processPluginFn, name, details, isAsync) {
|
|
1704
1754
|
var hasRun = false;
|
|
1705
|
-
var identifier = plugin ? plugin
|
|
1755
|
+
var identifier = plugin ? plugin[_DYN_IDENTIFIER ] : strTelemetryPluginChain;
|
|
1706
1756
|
var hasRunContext = itemCtx[strHasRunFlags];
|
|
1707
1757
|
if (!hasRunContext) {
|
|
1708
1758
|
hasRunContext = itemCtx[strHasRunFlags] = {};
|
|
1709
1759
|
}
|
|
1710
1760
|
itemCtx.setNext(nextProxy);
|
|
1711
1761
|
if (plugin) {
|
|
1712
|
-
doPerf(itemCtx[
|
|
1762
|
+
doPerf(itemCtx[STR_CORE ](), function () { return identifier + ":" + name; }, function () {
|
|
1713
1763
|
hasRunContext[chainId] = true;
|
|
1714
1764
|
try {
|
|
1715
|
-
var nextId = nextProxy ? nextProxy._id :
|
|
1765
|
+
var nextId = nextProxy ? nextProxy._id : STR_EMPTY;
|
|
1716
1766
|
if (nextId) {
|
|
1717
1767
|
hasRunContext[nextId] = false;
|
|
1718
1768
|
}
|
|
@@ -1724,7 +1774,7 @@
|
|
|
1724
1774
|
hasRun = true;
|
|
1725
1775
|
}
|
|
1726
1776
|
if (!nextProxy || !hasNextRun) {
|
|
1727
|
-
_throwInternal(itemCtx
|
|
1777
|
+
_throwInternal(itemCtx[_DYN_DIAG_LOG ](), 1 , 73 , "Plugin [" + identifier + "] failed during " + name + " - " + dumpObj(error) + ", run flags: " + dumpObj(hasRunContext));
|
|
1728
1778
|
}
|
|
1729
1779
|
}
|
|
1730
1780
|
}, details, isAsync);
|
|
@@ -1738,17 +1788,17 @@
|
|
|
1738
1788
|
return false;
|
|
1739
1789
|
}
|
|
1740
1790
|
var pluginState = _getPluginState(plugin);
|
|
1741
|
-
if (pluginState
|
|
1791
|
+
if (pluginState[_DYN_TEARDOWN ] || pluginState[STR_DISABLED]) {
|
|
1742
1792
|
return false;
|
|
1743
1793
|
}
|
|
1744
1794
|
if (hasSetNext) {
|
|
1745
|
-
plugin
|
|
1795
|
+
plugin[_DYN_SET_NEXT_PLUGIN ](nextProxy);
|
|
1746
1796
|
}
|
|
1747
|
-
plugin
|
|
1797
|
+
plugin[STR_PROCESS_TELEMETRY ](env, itemCtx);
|
|
1748
1798
|
return true;
|
|
1749
1799
|
}
|
|
1750
1800
|
if (!_processChain(itemCtx, _callProcessTelemetry, "processTelemetry", function () { return ({ item: env }); }, !(env.sync))) {
|
|
1751
|
-
itemCtx
|
|
1801
|
+
itemCtx[_DYN_PROCESS_NEXT ](env);
|
|
1752
1802
|
}
|
|
1753
1803
|
}
|
|
1754
1804
|
function _unloadPlugin(unloadCtx, unloadState) {
|
|
@@ -1756,20 +1806,20 @@
|
|
|
1756
1806
|
var hasRun = false;
|
|
1757
1807
|
if (plugin) {
|
|
1758
1808
|
var pluginState = _getPluginState(plugin);
|
|
1759
|
-
var pluginCore = plugin[
|
|
1760
|
-
if (plugin && (!pluginCore || pluginCore === unloadCtx
|
|
1761
|
-
pluginState[
|
|
1762
|
-
pluginState[
|
|
1763
|
-
pluginState[
|
|
1764
|
-
if (plugin[
|
|
1809
|
+
var pluginCore = plugin[STR_CORE] || pluginState[STR_CORE ];
|
|
1810
|
+
if (plugin && (!pluginCore || pluginCore === unloadCtx.core()) && !pluginState[_DYN_TEARDOWN ]) {
|
|
1811
|
+
pluginState[STR_CORE ] = null;
|
|
1812
|
+
pluginState[_DYN_TEARDOWN ] = true;
|
|
1813
|
+
pluginState[_DYN_IS_INITIALIZED ] = false;
|
|
1814
|
+
if (plugin[_DYN_TEARDOWN ] && plugin[_DYN_TEARDOWN ](unloadCtx, unloadState) === true) {
|
|
1765
1815
|
hasRun = true;
|
|
1766
1816
|
}
|
|
1767
1817
|
}
|
|
1768
1818
|
}
|
|
1769
1819
|
return hasRun;
|
|
1770
1820
|
}
|
|
1771
|
-
if (!_processChain(unloadCtx, _callTeardown, "unload", function () { }, unloadState
|
|
1772
|
-
unloadCtx
|
|
1821
|
+
if (!_processChain(unloadCtx, _callTeardown, "unload", function () { }, unloadState[_DYN_IS_ASYNC ])) {
|
|
1822
|
+
unloadCtx[_DYN_PROCESS_NEXT ](unloadState);
|
|
1773
1823
|
}
|
|
1774
1824
|
}
|
|
1775
1825
|
function _updatePlugin(updateCtx, updateState) {
|
|
@@ -1777,9 +1827,9 @@
|
|
|
1777
1827
|
var hasRun = false;
|
|
1778
1828
|
if (plugin) {
|
|
1779
1829
|
var pluginState = _getPluginState(plugin);
|
|
1780
|
-
var pluginCore = plugin[
|
|
1781
|
-
if (plugin && (!pluginCore || pluginCore === updateCtx
|
|
1782
|
-
if (plugin[
|
|
1830
|
+
var pluginCore = plugin[STR_CORE] || pluginState[STR_CORE ];
|
|
1831
|
+
if (plugin && (!pluginCore || pluginCore === updateCtx.core()) && !pluginState[_DYN_TEARDOWN ]) {
|
|
1832
|
+
if (plugin[_DYN_UPDATE ] && plugin[_DYN_UPDATE ](updateCtx, updateState) === true) {
|
|
1783
1833
|
hasRun = true;
|
|
1784
1834
|
}
|
|
1785
1835
|
}
|
|
@@ -1787,19 +1837,17 @@
|
|
|
1787
1837
|
return hasRun;
|
|
1788
1838
|
}
|
|
1789
1839
|
if (!_processChain(updateCtx, _callUpdate, "update", function () { }, false)) {
|
|
1790
|
-
updateCtx
|
|
1840
|
+
updateCtx[_DYN_PROCESS_NEXT ](updateState);
|
|
1791
1841
|
}
|
|
1792
1842
|
}
|
|
1793
1843
|
return objFreeze(proxyChain);
|
|
1794
1844
|
}
|
|
1795
1845
|
|
|
1796
|
-
var strExtensionConfig = "extensionConfig";
|
|
1797
|
-
|
|
1798
1846
|
function createUnloadHandlerContainer() {
|
|
1799
1847
|
var handlers = [];
|
|
1800
1848
|
function _addHandler(handler) {
|
|
1801
1849
|
if (handler) {
|
|
1802
|
-
handlers
|
|
1850
|
+
handlers[_DYN_PUSH ](handler);
|
|
1803
1851
|
}
|
|
1804
1852
|
}
|
|
1805
1853
|
function _runHandlers(unloadCtx, unloadState) {
|
|
@@ -1808,7 +1856,7 @@
|
|
|
1808
1856
|
handler(unloadCtx, unloadState);
|
|
1809
1857
|
}
|
|
1810
1858
|
catch (e) {
|
|
1811
|
-
_throwInternal(unloadCtx
|
|
1859
|
+
_throwInternal(unloadCtx[_DYN_DIAG_LOG ](), 2 , 73 , "Unexpected error calling unload handler - " + dumpObj(e));
|
|
1812
1860
|
}
|
|
1813
1861
|
});
|
|
1814
1862
|
handlers = [];
|
|
@@ -1830,37 +1878,40 @@
|
|
|
1830
1878
|
var _hooks;
|
|
1831
1879
|
_initDefaults();
|
|
1832
1880
|
dynamicProto(BaseTelemetryPlugin, _self, function (_self) {
|
|
1833
|
-
_self
|
|
1881
|
+
_self[_DYN_INITIALIZE ] = function (config, core, extensions, pluginChain) {
|
|
1834
1882
|
_setDefaults(config, core, pluginChain);
|
|
1835
1883
|
_isinitialized = true;
|
|
1836
1884
|
};
|
|
1837
|
-
_self
|
|
1838
|
-
var
|
|
1839
|
-
|
|
1885
|
+
_self[_DYN_TEARDOWN ] = function (unloadCtx, unloadState) {
|
|
1886
|
+
var _a;
|
|
1887
|
+
var core = _self[STR_CORE ];
|
|
1888
|
+
if (!core || (unloadCtx && core !== unloadCtx[STR_CORE ]())) {
|
|
1840
1889
|
return;
|
|
1841
1890
|
}
|
|
1842
1891
|
var result;
|
|
1843
1892
|
var unloadDone = false;
|
|
1844
1893
|
var theUnloadCtx = unloadCtx || createProcessTelemetryUnloadContext(null, core, _nextPlugin && _nextPlugin[strGetPlugin] ? _nextPlugin[strGetPlugin]() : _nextPlugin);
|
|
1845
|
-
var theUnloadState = unloadState || {
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1894
|
+
var theUnloadState = unloadState || (_a = {
|
|
1895
|
+
reason: 0
|
|
1896
|
+
},
|
|
1897
|
+
_a[_DYN_IS_ASYNC ] = false,
|
|
1898
|
+
_a);
|
|
1849
1899
|
function _unloadCallback() {
|
|
1850
1900
|
if (!unloadDone) {
|
|
1851
1901
|
unloadDone = true;
|
|
1852
1902
|
_unloadHandlerContainer.run(theUnloadCtx, unloadState);
|
|
1853
|
-
|
|
1903
|
+
var oldHooks = _hooks;
|
|
1904
|
+
_hooks = [];
|
|
1905
|
+
arrForEach(oldHooks, function (fn) {
|
|
1854
1906
|
fn.rm();
|
|
1855
1907
|
});
|
|
1856
|
-
_hooks = [];
|
|
1857
1908
|
if (result === true) {
|
|
1858
|
-
theUnloadCtx
|
|
1909
|
+
theUnloadCtx[_DYN_PROCESS_NEXT ](theUnloadState);
|
|
1859
1910
|
}
|
|
1860
1911
|
_initDefaults();
|
|
1861
1912
|
}
|
|
1862
1913
|
}
|
|
1863
|
-
if (!_self[
|
|
1914
|
+
if (!_self[_DYN__DO_TEARDOWN ] || _self[_DYN__DO_TEARDOWN ](theUnloadCtx, theUnloadState, _unloadCallback) !== true) {
|
|
1864
1915
|
_unloadCallback();
|
|
1865
1916
|
}
|
|
1866
1917
|
else {
|
|
@@ -1868,9 +1919,9 @@
|
|
|
1868
1919
|
}
|
|
1869
1920
|
return result;
|
|
1870
1921
|
};
|
|
1871
|
-
_self
|
|
1872
|
-
var core = _self
|
|
1873
|
-
if (!core || (updateCtx && core !== updateCtx
|
|
1922
|
+
_self[_DYN_UPDATE ] = function (updateCtx, updateState) {
|
|
1923
|
+
var core = _self[STR_CORE ];
|
|
1924
|
+
if (!core || (updateCtx && core !== updateCtx[STR_CORE ]())) {
|
|
1874
1925
|
return;
|
|
1875
1926
|
}
|
|
1876
1927
|
var result;
|
|
@@ -1882,7 +1933,7 @@
|
|
|
1882
1933
|
function _updateCallback() {
|
|
1883
1934
|
if (!updateDone) {
|
|
1884
1935
|
updateDone = true;
|
|
1885
|
-
_setDefaults(theUpdateCtx.getCfg(), theUpdateCtx.core(), theUpdateCtx
|
|
1936
|
+
_setDefaults(theUpdateCtx.getCfg(), theUpdateCtx.core(), theUpdateCtx[_DYN_GET_NEXT ]());
|
|
1886
1937
|
}
|
|
1887
1938
|
}
|
|
1888
1939
|
if (!_self._doUpdate || _self._doUpdate(theUpdateCtx, theUpdateState, _updateCallback) !== true) {
|
|
@@ -1899,30 +1950,30 @@
|
|
|
1899
1950
|
_hooks = _hooks.concat(hooks);
|
|
1900
1951
|
}
|
|
1901
1952
|
else {
|
|
1902
|
-
_hooks
|
|
1953
|
+
_hooks[_DYN_PUSH ](hooks);
|
|
1903
1954
|
}
|
|
1904
1955
|
}
|
|
1905
1956
|
};
|
|
1906
1957
|
proxyFunctionAs(_self, "_addUnloadCb", function () { return _unloadHandlerContainer; }, "add");
|
|
1907
1958
|
});
|
|
1908
|
-
_self
|
|
1909
|
-
return _getTelCtx(itemCtx)
|
|
1959
|
+
_self[_DYN_DIAG_LOG ] = function (itemCtx) {
|
|
1960
|
+
return _getTelCtx(itemCtx)[_DYN_DIAG_LOG ]();
|
|
1910
1961
|
};
|
|
1911
|
-
_self[
|
|
1962
|
+
_self[_DYN_IS_INITIALIZED ] = function () {
|
|
1912
1963
|
return _isinitialized;
|
|
1913
1964
|
};
|
|
1914
1965
|
_self.setInitialized = function (isInitialized) {
|
|
1915
1966
|
_isinitialized = isInitialized;
|
|
1916
1967
|
};
|
|
1917
|
-
_self[
|
|
1968
|
+
_self[_DYN_SET_NEXT_PLUGIN ] = function (next) {
|
|
1918
1969
|
_nextPlugin = next;
|
|
1919
1970
|
};
|
|
1920
|
-
_self
|
|
1971
|
+
_self[_DYN_PROCESS_NEXT ] = function (env, itemCtx) {
|
|
1921
1972
|
if (itemCtx) {
|
|
1922
|
-
itemCtx
|
|
1973
|
+
itemCtx[_DYN_PROCESS_NEXT ](env);
|
|
1923
1974
|
}
|
|
1924
|
-
else if (_nextPlugin && isFunction(_nextPlugin
|
|
1925
|
-
_nextPlugin
|
|
1975
|
+
else if (_nextPlugin && isFunction(_nextPlugin[STR_PROCESS_TELEMETRY ])) {
|
|
1976
|
+
_nextPlugin[STR_PROCESS_TELEMETRY ](env, null);
|
|
1926
1977
|
}
|
|
1927
1978
|
};
|
|
1928
1979
|
_self._getTelCtx = _getTelCtx;
|
|
@@ -1930,33 +1981,33 @@
|
|
|
1930
1981
|
if (currentCtx === void 0) { currentCtx = null; }
|
|
1931
1982
|
var itemCtx = currentCtx;
|
|
1932
1983
|
if (!itemCtx) {
|
|
1933
|
-
var rootCtx = _rootCtx || createProcessTelemetryContext(null, {}, _self
|
|
1984
|
+
var rootCtx = _rootCtx || createProcessTelemetryContext(null, {}, _self[STR_CORE ]);
|
|
1934
1985
|
if (_nextPlugin && _nextPlugin[strGetPlugin]) {
|
|
1935
|
-
itemCtx = rootCtx
|
|
1986
|
+
itemCtx = rootCtx[_DYN_CREATE_NEW ](null, _nextPlugin[strGetPlugin]);
|
|
1936
1987
|
}
|
|
1937
1988
|
else {
|
|
1938
|
-
itemCtx = rootCtx
|
|
1989
|
+
itemCtx = rootCtx[_DYN_CREATE_NEW ](null, _nextPlugin);
|
|
1939
1990
|
}
|
|
1940
1991
|
}
|
|
1941
1992
|
return itemCtx;
|
|
1942
1993
|
}
|
|
1943
1994
|
function _setDefaults(config, core, pluginChain) {
|
|
1944
1995
|
if (config) {
|
|
1945
|
-
setValue(config,
|
|
1996
|
+
setValue(config, STR_EXTENSION_CONFIG, [], null, isNullOrUndefined);
|
|
1946
1997
|
}
|
|
1947
1998
|
if (!pluginChain && core) {
|
|
1948
|
-
pluginChain = core
|
|
1999
|
+
pluginChain = core[_DYN_GET_PROCESS_TEL_CONT0 ]()[_DYN_GET_NEXT ]();
|
|
1949
2000
|
}
|
|
1950
2001
|
var nextPlugin = _nextPlugin;
|
|
1951
2002
|
if (_nextPlugin && _nextPlugin[strGetPlugin]) {
|
|
1952
2003
|
nextPlugin = _nextPlugin[strGetPlugin]();
|
|
1953
2004
|
}
|
|
1954
|
-
_self
|
|
2005
|
+
_self[STR_CORE ] = core;
|
|
1955
2006
|
_rootCtx = createProcessTelemetryContext(pluginChain, config, core, nextPlugin);
|
|
1956
2007
|
}
|
|
1957
2008
|
function _initDefaults() {
|
|
1958
2009
|
_isinitialized = false;
|
|
1959
|
-
_self
|
|
2010
|
+
_self[STR_CORE ] = null;
|
|
1960
2011
|
_rootCtx = null;
|
|
1961
2012
|
_nextPlugin = null;
|
|
1962
2013
|
_hooks = [];
|