@microsoft/applicationinsights-common 3.0.0-beta.2210-17 → 3.0.0-beta.2210-19

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.
Files changed (92) hide show
  1. package/browser/applicationinsights-common.integrity.json +9 -9
  2. package/browser/applicationinsights-common.js +159 -103
  3. package/browser/applicationinsights-common.js.map +1 -1
  4. package/browser/applicationinsights-common.min.js +2 -2
  5. package/browser/applicationinsights-common.min.js.map +1 -1
  6. package/dist/applicationinsights-common.d.ts +1 -1
  7. package/dist/applicationinsights-common.js +159 -103
  8. package/dist/applicationinsights-common.js.map +1 -1
  9. package/dist/applicationinsights-common.min.js +2 -2
  10. package/dist/applicationinsights-common.min.js.map +1 -1
  11. package/dist/applicationinsights-common.rollup.d.ts +1 -1
  12. package/dist-esm/ConnectionStringParser.js +1 -1
  13. package/dist-esm/Constants.js +1 -1
  14. package/dist-esm/DomHelperFuncs.js +1 -1
  15. package/dist-esm/Enums.js +1 -1
  16. package/dist-esm/HelperFuncs.js +1 -1
  17. package/dist-esm/Interfaces/ConnectionString.js +1 -1
  18. package/dist-esm/Interfaces/Context/IApplication.js +1 -1
  19. package/dist-esm/Interfaces/Context/IDevice.js +1 -1
  20. package/dist-esm/Interfaces/Context/IInternal.js +1 -1
  21. package/dist-esm/Interfaces/Context/ILocation.js +1 -1
  22. package/dist-esm/Interfaces/Context/IOperatingSystem.js +1 -1
  23. package/dist-esm/Interfaces/Context/ISample.js +1 -1
  24. package/dist-esm/Interfaces/Context/ISession.js +1 -1
  25. package/dist-esm/Interfaces/Context/ITelemetryTrace.js +1 -1
  26. package/dist-esm/Interfaces/Context/IUser.js +1 -1
  27. package/dist-esm/Interfaces/Context/IWeb.js +1 -1
  28. package/dist-esm/Interfaces/Contracts/AvailabilityData.js +1 -1
  29. package/dist-esm/Interfaces/Contracts/ContextTagKeys.js +1 -1
  30. package/dist-esm/Interfaces/Contracts/DataPointType.js +1 -1
  31. package/dist-esm/Interfaces/Contracts/DependencyKind.js +1 -1
  32. package/dist-esm/Interfaces/Contracts/DependencySourceType.js +1 -1
  33. package/dist-esm/Interfaces/Contracts/IBase.js +1 -1
  34. package/dist-esm/Interfaces/Contracts/IData.js +1 -1
  35. package/dist-esm/Interfaces/Contracts/IDataPoint.js +1 -1
  36. package/dist-esm/Interfaces/Contracts/IDomain.js +1 -1
  37. package/dist-esm/Interfaces/Contracts/IEnvelope.js +1 -1
  38. package/dist-esm/Interfaces/Contracts/IEventData.js +1 -1
  39. package/dist-esm/Interfaces/Contracts/IExceptionData.js +1 -1
  40. package/dist-esm/Interfaces/Contracts/IExceptionDetails.js +1 -1
  41. package/dist-esm/Interfaces/Contracts/IMessageData.js +1 -1
  42. package/dist-esm/Interfaces/Contracts/IMetricData.js +1 -1
  43. package/dist-esm/Interfaces/Contracts/IPageViewData.js +1 -1
  44. package/dist-esm/Interfaces/Contracts/IPageViewPerfData.js +1 -1
  45. package/dist-esm/Interfaces/Contracts/IRemoteDependencyData.js +1 -1
  46. package/dist-esm/Interfaces/Contracts/IStackFrame.js +1 -1
  47. package/dist-esm/Interfaces/Contracts/RequestData.js +1 -1
  48. package/dist-esm/Interfaces/Contracts/SeverityLevel.js +1 -1
  49. package/dist-esm/Interfaces/IAppInsights.js +1 -1
  50. package/dist-esm/Interfaces/IChannelControlsAI.js +1 -1
  51. package/dist-esm/Interfaces/IConfig.js +1 -1
  52. package/dist-esm/Interfaces/ICorrelationConfig.js +1 -1
  53. package/dist-esm/Interfaces/IDependencyTelemetry.js +1 -1
  54. package/dist-esm/Interfaces/IEventTelemetry.js +1 -1
  55. package/dist-esm/Interfaces/IExceptionTelemetry.js +1 -1
  56. package/dist-esm/Interfaces/IMetricTelemetry.js +1 -1
  57. package/dist-esm/Interfaces/IPageViewPerformanceTelemetry.js +1 -1
  58. package/dist-esm/Interfaces/IPageViewTelemetry.js +1 -1
  59. package/dist-esm/Interfaces/IPartC.js +1 -1
  60. package/dist-esm/Interfaces/IPropertiesPlugin.js +1 -1
  61. package/dist-esm/Interfaces/IRequestContext.js +1 -1
  62. package/dist-esm/Interfaces/ITelemetryContext.js +1 -1
  63. package/dist-esm/Interfaces/ITraceTelemetry.js +1 -1
  64. package/dist-esm/Interfaces/PartAExtensions.js +1 -1
  65. package/dist-esm/Interfaces/Telemetry/IEnvelope.js +1 -1
  66. package/dist-esm/Interfaces/Telemetry/ISerializable.js +1 -1
  67. package/dist-esm/RequestResponseHeaders.js +1 -1
  68. package/dist-esm/StorageHelperFuncs.js +1 -1
  69. package/dist-esm/Telemetry/Common/Data.js +1 -1
  70. package/dist-esm/Telemetry/Common/DataPoint.js +1 -1
  71. package/dist-esm/Telemetry/Common/DataSanitizer.js +1 -1
  72. package/dist-esm/Telemetry/Common/Envelope.js +1 -1
  73. package/dist-esm/Telemetry/Event.js +1 -1
  74. package/dist-esm/Telemetry/Exception.js +5 -4
  75. package/dist-esm/Telemetry/Exception.js.map +1 -1
  76. package/dist-esm/Telemetry/Metric.js +1 -1
  77. package/dist-esm/Telemetry/PageView.js +1 -1
  78. package/dist-esm/Telemetry/PageViewPerformance.js +1 -1
  79. package/dist-esm/Telemetry/RemoteDependencyData.js +1 -1
  80. package/dist-esm/Telemetry/Trace.js +1 -1
  81. package/dist-esm/TelemetryItemCreator.js +1 -1
  82. package/dist-esm/UrlHelperFuncs.js +1 -1
  83. package/dist-esm/Util.js +4 -3
  84. package/dist-esm/Util.js.map +1 -1
  85. package/dist-esm/__DynamicConstants.js +1 -2
  86. package/dist-esm/__DynamicConstants.js.map +1 -1
  87. package/dist-esm/applicationinsights-common.js +1 -1
  88. package/package.json +2 -2
  89. package/src/Telemetry/Exception.ts +3 -2
  90. package/src/Util.ts +2 -1
  91. package/src/__DynamicConstants.ts +0 -1
  92. package/types/__DynamicConstants.d.ts +0 -1
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Microsoft Application Insights Common JavaScript Library, 3.0.0-beta.2210-17
2
+ * Microsoft Application Insights Common JavaScript Library, 3.0.0-beta.2210-19
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  *
5
5
  * Microsoft Application Insights Team
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Application Insights JavaScript SDK - Common, 3.0.0-beta.2210-17
2
+ * Application Insights JavaScript SDK - Common, 3.0.0-beta.2210-19
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  (function (global, factory) {
@@ -16,6 +16,7 @@
16
16
  var PROTOTYPE = "prototype";
17
17
  var STRING = "string";
18
18
  var UNDEFINED$1 = "undefined";
19
+ var CONSTRUCTOR = "constructor";
19
20
  var HAS_OWN_PROPERTY = "hasOwnProperty";
20
21
  var SYMBOL = "Symbol";
21
22
  var POLYFILL_TAG = "_polyfill";
@@ -84,7 +85,7 @@
84
85
  return objHasOwnProperty(obj, prop) || !!objGetOwnPropertyDescriptor(obj, prop);
85
86
  }
86
87
 
87
- function objForEachKey$1(theObject, callbackfn, thisArg) {
88
+ function objForEachKey(theObject, callbackfn, thisArg) {
88
89
  if (theObject && isObject(theObject)) {
89
90
  for (var prop in theObject) {
90
91
  if (objHasOwn(theObject, prop)) {
@@ -115,7 +116,7 @@
115
116
  }
116
117
  function objDeepFreeze(value) {
117
118
  if (_objFreeze) {
118
- objForEachKey$1(value, function (key, value) {
119
+ objForEachKey(value, function (key, value) {
119
120
  if (isArray(value) || isObject(value)) {
120
121
  _objFreeze(value);
121
122
  }
@@ -124,10 +125,11 @@
124
125
  return objFreeze(value);
125
126
  }
126
127
  var objFreeze = _objFreeze || _doNothing;
128
+ var objGetPrototypeOf = ObjClass$1["getPrototypeOf"] || _doNothing;
127
129
 
128
130
  function createEnum(values) {
129
131
  var theEnum = {};
130
- objForEachKey$1(values, function (field, value) {
132
+ objForEachKey(values, function (field, value) {
131
133
  theEnum[field] = value;
132
134
  theEnum[value] = field;
133
135
  });
@@ -135,7 +137,7 @@
135
137
  }
136
138
  function createSimpleMap(values) {
137
139
  var mapClass = {};
138
- objForEachKey$1(values, function (field, value) {
140
+ objForEachKey(values, function (field, value) {
139
141
  mapClass[field] = value[1];
140
142
  mapClass[value[0]] = value[1];
141
143
  });
@@ -205,7 +207,7 @@
205
207
  d.__proto__ = b;
206
208
  }) ||
207
209
  function (d, b) {
208
- objForEachKey$1(b, function (key, value) {
210
+ objForEachKey(b, function (key, value) {
209
211
  d[key] = value;
210
212
  });
211
213
  };
@@ -368,6 +370,13 @@
368
370
  (!_cachedDocument || (_globalLazyTestHooks.lzy && !_cachedDocument.b)) && (_cachedDocument = _lazySafeGet(function () { return getInst(DOCUMENT); }, UNDEF_VALUE));
369
371
  return _cachedDocument.v;
370
372
  }
373
+ function hasWindow() {
374
+ return !!getWindow();
375
+ }
376
+ function getWindow() {
377
+ (!_cachedWindow || (_globalLazyTestHooks.lzy && !_cachedWindow.b)) && (_cachedWindow = _lazySafeGet(function () { return getInst(WINDOW); }, UNDEF_VALUE));
378
+ return _cachedWindow.v;
379
+ }
371
380
  function hasNavigator() {
372
381
  return !!getNavigator();
373
382
  }
@@ -427,11 +436,57 @@
427
436
 
428
437
  var arrReduce = _unwrapFunction("reduce");
429
438
 
439
+ function utcNow() {
440
+ return (Date.now || polyUtcNow)();
441
+ }
442
+ function polyUtcNow() {
443
+ return new Date().getTime();
444
+ }
445
+
446
+ var _fnToString$1;
447
+ var _objCtrFnString;
448
+ var _gblWindow;
449
+ function isPlainObject(value) {
450
+ if (!value || typeof value !== OBJECT) {
451
+ return false;
452
+ }
453
+ if (!_gblWindow) {
454
+ _gblWindow = hasWindow() ? getWindow() : true;
455
+ }
456
+ var result = false;
457
+ if (value !== _gblWindow) {
458
+ if (!_objCtrFnString) {
459
+ _fnToString$1 = Function[PROTOTYPE].toString;
460
+ _objCtrFnString = _fnToString$1.call(ObjClass$1);
461
+ }
462
+ try {
463
+ var proto = objGetPrototypeOf(value);
464
+ result = !proto;
465
+ if (!result) {
466
+ if (objHasOwnProperty(proto, CONSTRUCTOR)) {
467
+ proto = proto[CONSTRUCTOR];
468
+ }
469
+ result = proto && typeof proto === FUNCTION && _fnToString$1.call(proto) === _objCtrFnString;
470
+ }
471
+ }
472
+ catch (ex) {
473
+ }
474
+ }
475
+ return result;
476
+ }
477
+
478
+ var _perf;
479
+ function getPerformance() {
480
+ (!_perf || (_globalLazyTestHooks.lzy && !_perf.b)) && (_perf = _lazySafeGet(function () { return getInst("performance"); }, UNDEF_VALUE));
481
+ return _perf.v;
482
+ }
483
+
430
484
  var mathMax = MathCls.max;
431
485
 
432
486
  var strSlice = _unwrapFunction("slice");
433
487
 
434
488
  var SUB_STR = "substr";
489
+ var strSubstring = _unwrapFunction("substring");
435
490
  var strSubstr = StrProto[SUB_STR] ? _unwrapFunction(SUB_STR) : polyStrSubstr;
436
491
  function polyStrSubstr(value, start, length) {
437
492
  if (isNullOrUndefined(value)) {
@@ -449,6 +504,9 @@
449
504
  }
450
505
  return strSlice(value, start, start + length);
451
506
  }
507
+ function strLeft(value, count) {
508
+ return strSubstring(value, 0, count);
509
+ }
452
510
 
453
511
  var strIndexOf = _unwrapFunction(INDEX_OF);
454
512
 
@@ -506,8 +564,8 @@
506
564
  var _DYN_CONFIGURABLE = "configurable";
507
565
  var _DYN_ENUMERABLE = "enumerable";
508
566
  var _DYN_APPLY = "apply";
509
- var _DYN_INDEX_OF$1 = "indexOf";
510
567
  var _DYN_PUSH = "push";
568
+ var _DYN_SPLICE = "splice";
511
569
  var _DYN_NAME$1 = "name";
512
570
  var _DYN_CALL = "call";
513
571
  var _DYN_LOGGING_LEVEL_CONSOL4 = "loggingLevelConsole";
@@ -689,7 +747,7 @@
689
747
  function _isObjectArrayOrFunctionPrototype(target) {
690
748
  return _isObjectOrArrayPrototype(target) || target === Function[Prototype];
691
749
  }
692
- function _getObjProto$1(target) {
750
+ function _getObjProto(target) {
693
751
  var newProto;
694
752
  if (target) {
695
753
  if (_objGetPrototypeOf) {
@@ -763,7 +821,7 @@
763
821
  _forEachProp(instFuncs, function (name) {
764
822
  baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name);
765
823
  });
766
- var baseProto = _getObjProto$1(classProto);
824
+ var baseProto = _getObjProto(classProto);
767
825
  var visited = [];
768
826
  while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) {
769
827
  _forEachProp(baseProto, function (name) {
@@ -772,7 +830,7 @@
772
830
  }
773
831
  });
774
832
  visited.push(baseProto);
775
- baseProto = _getObjProto$1(baseProto);
833
+ baseProto = _getObjProto(baseProto);
776
834
  }
777
835
  return baseFuncs;
778
836
  }
@@ -786,7 +844,7 @@
786
844
  }
787
845
  if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) {
788
846
  var canAddInst = !_hasOwnProperty(target, funcName);
789
- var objProto = _getObjProto$1(target);
847
+ var objProto = _getObjProto(target);
790
848
  var visited = [];
791
849
  while (canAddInst && objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) {
792
850
  var protoFunc = objProto[funcName];
@@ -795,7 +853,7 @@
795
853
  break;
796
854
  }
797
855
  visited.push(objProto);
798
- objProto = _getObjProto$1(objProto);
856
+ objProto = _getObjProto(objProto);
799
857
  }
800
858
  try {
801
859
  if (canAddInst) {
@@ -813,7 +871,7 @@
813
871
  function _getProtoFunc(funcName, proto, currentDynProtoProxy) {
814
872
  var protoFunc = proto[funcName];
815
873
  if (protoFunc === currentDynProtoProxy) {
816
- protoFunc = _getObjProto$1(proto)[funcName];
874
+ protoFunc = _getObjProto(proto)[funcName];
817
875
  }
818
876
  if (typeof protoFunc !== strFunction) {
819
877
  _throwTypeError("[" + funcName + "] is not a " + strFunction);
@@ -849,13 +907,13 @@
849
907
  function _checkPrototype(classProto, thisTarget) {
850
908
  if (_objGetPrototypeOf) {
851
909
  var visited = [];
852
- var thisProto = _getObjProto$1(thisTarget);
910
+ var thisProto = _getObjProto(thisTarget);
853
911
  while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto) && !_hasVisited(visited, thisProto)) {
854
912
  if (thisProto === classProto) {
855
913
  return true;
856
914
  }
857
915
  visited.push(thisProto);
858
- thisProto = _getObjProto$1(thisProto);
916
+ thisProto = _getObjProto(thisProto);
859
917
  }
860
918
  return false;
861
919
  }
@@ -900,20 +958,16 @@
900
958
  }
901
959
  dynamicProto[DynProtoDefaultOptions] = _gblInst.o;
902
960
 
903
- var UNDEFINED_VALUE = undefined;
904
961
  var STR_EMPTY = "";
905
962
  var STR_ERROR_TO_CONSOLE = "errorToConsole";
906
963
  var STR_WARN_TO_CONSOLE = "warnToConsole";
907
964
 
908
965
  var strToString = "toString";
909
- var strGetPrototypeOf = "getPrototypeOf";
910
- var strConstructor = "constructor";
911
966
  var _fnToString = ObjClass[strToString];
912
- var _objFunctionString = _fnToString[_DYN_CALL ](ObjClass);
967
+ _fnToString[_DYN_CALL ](ObjClass);
913
968
  var rCamelCase = /-([a-z])/g;
914
969
  var rNormalizeInvalid = /([^\w\d_$])/g;
915
970
  var rLeadingNumeric = /^(\d+[\w\d_$])/;
916
- var _getObjProto = Object[strGetPrototypeOf];
917
971
  function normalizeJsName(name) {
918
972
  var value = name;
919
973
  if (value && isString(value)) {
@@ -927,36 +981,15 @@
927
981
  }
928
982
  return value;
929
983
  }
930
- var objForEachKey = objForEachKey$1;
931
984
  function strContains(value, search) {
932
985
  if (value && search) {
933
986
  return strIndexOf(value, search) !== -1;
934
987
  }
935
988
  return false;
936
989
  }
937
- function isPlainObject(value) {
938
- var result = false;
939
- if (value && typeof value === "object") {
940
- var proto = _getObjProto(value);
941
- if (!proto) {
942
- result = true;
943
- }
944
- else {
945
- if (proto[strConstructor] && objHasOwnProperty(proto, strConstructor)) {
946
- proto = proto[strConstructor];
947
- }
948
- result = typeof proto === strShimFunction && _fnToString[_DYN_CALL ](proto) === _objFunctionString;
949
- }
950
- }
951
- return result;
952
- }
953
990
  function toISOString(date) {
954
991
  return date && date.toISOString() || "";
955
992
  }
956
- function dateNow() {
957
- var dt = Date;
958
- return dt.now ? dt.now() : new dt().getTime();
959
- }
960
993
  function getExceptionName(object) {
961
994
  if (isError(object)) {
962
995
  return object[_DYN_NAME$1 ];
@@ -978,7 +1011,6 @@
978
1011
  }
979
1012
 
980
1013
  var strConsole = "console";
981
- var strPerformance = "performance";
982
1014
  var strJSON = "JSON";
983
1015
  var strCrypto = "crypto";
984
1016
  var strMsCrypto = "msCrypto";
@@ -993,9 +1025,6 @@
993
1025
  }
994
1026
  return getInst(strConsole);
995
1027
  }
996
- function getPerformance() {
997
- return getInst(strPerformance);
998
- }
999
1028
  function hasJSON() {
1000
1029
  return Boolean((typeof JSON === strShimObject && JSON) || getInst(strJSON) !== null);
1001
1030
  }
@@ -1071,7 +1100,7 @@
1071
1100
  }
1072
1101
  function _autoSeedMwc() {
1073
1102
  try {
1074
- var now = dateNow() & 0x7fffffff;
1103
+ var now = utcNow() & 0x7fffffff;
1075
1104
  _mwcSeed(((Math.random() * UInt32Mask) ^ now) + now);
1076
1105
  }
1077
1106
  catch (e) {
@@ -1124,7 +1153,7 @@
1124
1153
  return result;
1125
1154
  }
1126
1155
 
1127
- var version = "3.0.0-beta.2210-17";
1156
+ var version = "3.0.0-beta.2210-19";
1128
1157
  var instanceName = "." + newId(6);
1129
1158
  var _dataUid = 0;
1130
1159
  function createUniqueNamespace(name, includeVersion) {
@@ -1144,7 +1173,7 @@
1144
1173
  target_1 = {};
1145
1174
  }
1146
1175
  if (target_1) {
1147
- objForEachKey$1(source, function (key, value) {
1176
+ objForEachKey(source, function (key, value) {
1148
1177
  target_1[key] = _cfgDeepCopy(value);
1149
1178
  });
1150
1179
  return target_1;
@@ -1259,9 +1288,18 @@
1259
1288
  var detail = {
1260
1289
  n: name,
1261
1290
  h: [],
1262
- add: function (handler) {
1263
- if (handler && handler.fn && detail.h[_DYN_INDEX_OF$1 ](handler) === -1) {
1264
- detail.h[_DYN_PUSH ](handler);
1291
+ trk: function (handler) {
1292
+ if (handler && handler.fn) {
1293
+ if (arrIndexOf(detail.h, handler) === -1) {
1294
+ detail.h[_DYN_PUSH ](handler);
1295
+ }
1296
+ state.trk(handler, detail);
1297
+ }
1298
+ },
1299
+ clr: function (handler) {
1300
+ var idx = arrIndexOf(detail.h, handler);
1301
+ if (idx !== -1) {
1302
+ detail.h[_DYN_SPLICE ](idx, 1);
1265
1303
  }
1266
1304
  }
1267
1305
  };
@@ -1275,25 +1313,28 @@
1275
1313
  }
1276
1314
  var activeHandler = state.act;
1277
1315
  if (activeHandler) {
1278
- detail.add(activeHandler);
1316
+ detail.trk(activeHandler);
1279
1317
  }
1280
1318
  return value;
1281
1319
  }
1282
- _getProperty[state.prop] = true;
1320
+ _getProperty[state.prop] = {
1321
+ chng: function () {
1322
+ state.add(detail);
1323
+ }
1324
+ };
1283
1325
  function _setProperty(newValue) {
1284
1326
  if (value !== newValue) {
1285
1327
  if (!!_setProperty[state.ro] && state.upd) {
1286
1328
  throwInvalidAccess("[" + name + "] is sealed from " + dumpObj(theConfig));
1287
1329
  }
1288
1330
  if (value && value[CFG_HANDLER_LINK]) {
1289
- if (isPlainObject(value)) {
1290
- objForEachKey$1(value, function (key) {
1291
- value[key] = UNDEFINED_VALUE;
1292
- });
1293
- }
1294
- else if (isArray(value)) {
1295
- arrForEach(value, function (propValue, idx) {
1296
- value[idx] = UNDEFINED_VALUE;
1331
+ if (isPlainObject(value) || isArray(value)) {
1332
+ objForEachKey(value, function (key) {
1333
+ var propDesc = objGetOwnPropertyDescriptor(value, key);
1334
+ if (propDesc && propDesc.get) {
1335
+ var valueState = propDesc.get[state.prop];
1336
+ valueState && valueState.chng();
1337
+ }
1297
1338
  });
1298
1339
  }
1299
1340
  }
@@ -1325,7 +1366,7 @@
1325
1366
  }
1326
1367
  function _makeDynamicObject(state, target ) {
1327
1368
  var _a;
1328
- objForEachKey$1( target, function (key, value) {
1369
+ objForEachKey( target, function (key, value) {
1329
1370
  _setDynamicProperty(state, target, key, value);
1330
1371
  });
1331
1372
  if (!target[CFG_HANDLER_LINK]) {
@@ -1343,19 +1384,10 @@
1343
1384
 
1344
1385
  var symPrefix = "[[ai_";
1345
1386
  var symPostfix = "]]";
1346
- function _insertWatcher(watchers, theDetail) {
1347
- if (theDetail && theDetail.h && theDetail.h[_DYN_LENGTH$1 ] > 0) {
1348
- arrForEach(theDetail.h, function (handler) {
1349
- if (handler && handler.fn && watchers[_DYN_INDEX_OF$1 ](handler) === -1) {
1350
- watchers[_DYN_PUSH ](handler);
1351
- }
1352
- });
1353
- }
1354
- }
1355
1387
  function _createState(cfgHandler) {
1356
- var _a;
1357
1388
  var dynamicPropertySymbol = newSymbol(symPrefix + "get" + cfgHandler.uid + symPostfix);
1358
1389
  var dynamicPropertyReadOnly = newSymbol(symPrefix + "ro" + cfgHandler.uid + symPostfix);
1390
+ var dynamicPropertyDetail = newSymbol(symPrefix + "dtl" + cfgHandler.uid + symPostfix);
1359
1391
  var _waitingHandlers = null;
1360
1392
  var _watcherTimer = null;
1361
1393
  var theState;
@@ -1363,6 +1395,12 @@
1363
1395
  var prevWatcher = theState.act;
1364
1396
  try {
1365
1397
  theState.act = activeHandler;
1398
+ if (activeHandler && activeHandler[dynamicPropertyDetail]) {
1399
+ arrForEach(activeHandler[dynamicPropertyDetail], function (detail) {
1400
+ detail.clr(activeHandler);
1401
+ });
1402
+ activeHandler[dynamicPropertyDetail] = [];
1403
+ }
1366
1404
  callback({
1367
1405
  cfg: cfgHandler.cfg,
1368
1406
  set: cfgHandler.set.bind(cfgHandler),
@@ -1372,7 +1410,7 @@
1372
1410
  catch (e) {
1373
1411
  var logger = cfgHandler[_DYN_LOGGER ];
1374
1412
  if (logger) {
1375
- logger[_DYN_THROW_INTERNAL ](1 , 107 , "Watcher [" + dumpObj(callback) + "] failed [" + dumpObj(e) + "]");
1413
+ logger[_DYN_THROW_INTERNAL ](1 , 107 , dumpObj(e));
1376
1414
  }
1377
1415
  throw e;
1378
1416
  }
@@ -1384,18 +1422,24 @@
1384
1422
  if (_waitingHandlers) {
1385
1423
  var notifyHandlers = _waitingHandlers;
1386
1424
  _waitingHandlers = null;
1387
- if (_watcherTimer) {
1388
- _watcherTimer.cancel();
1389
- _watcherTimer = null;
1390
- }
1425
+ _watcherTimer && _watcherTimer.cancel();
1426
+ _watcherTimer = null;
1391
1427
  var watcherFailures_1 = [];
1392
1428
  arrForEach(notifyHandlers, function (handler) {
1393
- if (handler.fn) {
1394
- try {
1395
- _useHandler(handler, handler.fn);
1429
+ if (handler) {
1430
+ if (handler[dynamicPropertyDetail]) {
1431
+ arrForEach(handler[dynamicPropertyDetail], function (detail) {
1432
+ detail.clr(handler);
1433
+ });
1434
+ handler[dynamicPropertyDetail] = null;
1396
1435
  }
1397
- catch (e) {
1398
- watcherFailures_1[_DYN_PUSH ](e);
1436
+ if (handler.fn) {
1437
+ try {
1438
+ _useHandler(handler, handler.fn);
1439
+ }
1440
+ catch (e) {
1441
+ watcherFailures_1[_DYN_PUSH ](e);
1442
+ }
1399
1443
  }
1400
1444
  }
1401
1445
  });
@@ -1408,7 +1452,7 @@
1408
1452
  }
1409
1453
  }
1410
1454
  if (watcherFailures_1[_DYN_LENGTH$1 ] > 0) {
1411
- throwAggregationError("Unexpected watcher error occurred: ", watcherFailures_1);
1455
+ throwAggregationError("Watcher error(s): ", watcherFailures_1);
1412
1456
  }
1413
1457
  }
1414
1458
  }
@@ -1423,18 +1467,31 @@
1423
1467
  _notifyWatchers();
1424
1468
  }, 0);
1425
1469
  }
1426
- _insertWatcher(_waitingHandlers, detail);
1470
+ for (var idx = 0; idx < detail.h[_DYN_LENGTH$1 ]; idx++) {
1471
+ var handler = detail.h[idx];
1472
+ if (handler && arrIndexOf(_waitingHandlers, handler) === -1) {
1473
+ _waitingHandlers[_DYN_PUSH ](handler);
1474
+ }
1475
+ }
1427
1476
  }
1428
1477
  }
1429
- theState = (_a = {
1430
- prop: dynamicPropertySymbol,
1431
- ro: dynamicPropertyReadOnly,
1432
- hdlr: cfgHandler,
1433
- add: _addWatcher
1434
- },
1435
- _a[_DYN_NOTIFY ] = _notifyWatchers,
1436
- _a.use = _useHandler,
1437
- _a);
1478
+ function _trackHandler(handler, detail) {
1479
+ if (handler) {
1480
+ var details = handler[dynamicPropertyDetail] = handler[dynamicPropertyDetail] || [];
1481
+ if (arrIndexOf(details, detail) === -1) {
1482
+ details[_DYN_PUSH ](detail);
1483
+ }
1484
+ }
1485
+ }
1486
+ theState = {
1487
+ prop: dynamicPropertySymbol,
1488
+ ro: dynamicPropertyReadOnly,
1489
+ hdlr: cfgHandler,
1490
+ add: _addWatcher,
1491
+ notify: _notifyWatchers,
1492
+ use: _useHandler,
1493
+ trk: _trackHandler
1494
+ };
1438
1495
  return theState;
1439
1496
  }
1440
1497
 
@@ -1744,7 +1801,7 @@
1744
1801
  return _a = {},
1745
1802
  _a[_DYN_VERSION ] = _isValid(version, 2, INVALID_VERSION) ? version : DEFAULT_VERSION,
1746
1803
  _a[_DYN_TRACE_ID ] = isValidTraceId(traceId) ? traceId : generateW3CId(),
1747
- _a[_DYN_SPAN_ID ] = isValidSpanId(spanId) ? spanId : generateW3CId().substr(0, 16),
1804
+ _a[_DYN_SPAN_ID ] = isValidSpanId(spanId) ? spanId : strLeft(generateW3CId(), 16),
1748
1805
  _a.traceFlags = flags >= 0 && flags <= 0xFF ? flags : 1,
1749
1806
  _a;
1750
1807
  }
@@ -1849,7 +1906,6 @@
1849
1906
  var _DYN_NAME = "name";
1850
1907
  var _DYN_PATHNAME = "pathname";
1851
1908
  var _DYN_CORRELATION_HEADER_E0 = "correlationHeaderExcludePatterns";
1852
- var _DYN_INDEX_OF = "indexOf";
1853
1909
  var _DYN_EXTENSION_CONFIG = "extensionConfig";
1854
1910
  var _DYN_EXCEPTIONS = "exceptions";
1855
1911
  var _DYN_PARSED_STACK = "parsedStack";
@@ -1938,7 +1994,7 @@
1938
1994
  function dataSanitizeProperties(logger, properties) {
1939
1995
  if (properties) {
1940
1996
  var tempProps_1 = {};
1941
- objForEachKey$1(properties, function (prop, value) {
1997
+ objForEachKey(properties, function (prop, value) {
1942
1998
  if (isObject(value) && hasJSON()) {
1943
1999
  try {
1944
2000
  value = getJSON()[_DYN_STRINGIFY ](value);
@@ -1958,7 +2014,7 @@
1958
2014
  function dataSanitizeMeasurements(logger, measurements) {
1959
2015
  if (measurements) {
1960
2016
  var tempMeasurements_1 = {};
1961
- objForEachKey$1(measurements, function (measure, value) {
2017
+ objForEachKey(measurements, function (measure, value) {
1962
2018
  measure = dataSanitizeKeyAndAddUniqueness(logger, measure, tempMeasurements_1);
1963
2019
  tempMeasurements_1[measure] = value;
1964
2020
  });
@@ -2087,7 +2143,7 @@
2087
2143
  }
2088
2144
  }
2089
2145
  var requestHost = urlParseUrl(requestUrl).host[_DYN_TO_LOWER_CASE ]();
2090
- if (requestHost && (requestHost[_DYN_INDEX_OF ](":443") !== -1 || requestHost[_DYN_INDEX_OF ](":80") !== -1)) {
2146
+ if (requestHost && (strIndexOf(requestHost, ":443") !== -1 || strIndexOf(requestHost, ":80") !== -1)) {
2091
2147
  requestHost = (urlParseFullHost(requestUrl, true) || "")[_DYN_TO_LOWER_CASE ]();
2092
2148
  }
2093
2149
  if ((!config || !config.enableCorsCorrelation) && (requestHost && requestHost !== currentHost)) {
@@ -2172,7 +2228,7 @@
2172
2228
  return now;
2173
2229
  }
2174
2230
  }
2175
- return dateNow();
2231
+ return utcNow();
2176
2232
  }
2177
2233
  function dateTimeUtilsDuration(start, end) {
2178
2234
  var result = null;
@@ -2331,7 +2387,7 @@
2331
2387
  evtMessage = evtMessage + " @" + (theEvent["filename"] || "") + ":" + (theEvent["lineno"] || "?") + ":" + (theEvent["colno"] || "?");
2332
2388
  }
2333
2389
  }
2334
- if (errorType && errorType !== "String" && errorType !== "Object" && errorType !== "Error" && (evtMessage || "")[_DYN_INDEX_OF ](errorType) === -1) {
2390
+ if (errorType && errorType !== "String" && errorType !== "Object" && errorType !== "Error" && strIndexOf(evtMessage || "", errorType) === -1) {
2335
2391
  evtMessage = errorType + ": " + evtMessage;
2336
2392
  }
2337
2393
  return evtMessage || "";
@@ -2524,7 +2580,7 @@
2524
2580
  }
2525
2581
  result = _stringify(errorObj, true);
2526
2582
  }
2527
- if (result[_DYN_INDEX_OF ](errorType) !== 0 && errorType !== "String") {
2583
+ if (strIndexOf(result, errorType) !== 0 && errorType !== "String") {
2528
2584
  return errorType + ":" + result;
2529
2585
  }
2530
2586
  return result;
@@ -3109,7 +3165,7 @@
3109
3165
  ,
3110
3166
  _a);
3111
3167
  if (!isNullOrUndefined(customProperties)) {
3112
- objForEachKey$1(customProperties, function (prop, value) {
3168
+ objForEachKey(customProperties, function (prop, value) {
3113
3169
  telemetryItem.data[prop] = value;
3114
3170
  });
3115
3171
  }
@@ -3255,7 +3311,7 @@
3255
3311
  function utlGetSessionStorageKeys() {
3256
3312
  var keys = [];
3257
3313
  if (utlCanUseSessionStorage()) {
3258
- objForEachKey$1(getInst("sessionStorage"), function (key) {
3314
+ objForEachKey(getInst("sessionStorage"), function (key) {
3259
3315
  keys.push(key);
3260
3316
  });
3261
3317
  }