@microsoft/applicationinsights-teechannel-js 3.0.1-nightly3.2304-41 → 3.0.1-nightly3.2305-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.
Files changed (49) hide show
  1. package/browser/es5/{applicationinsights-teechannel-js.3.0.1-nightly3.2304-41.cjs.js → applicationinsights-teechannel-js.3.0.1-nightly3.2305-01.cjs.js} +318 -19
  2. package/browser/es5/applicationinsights-teechannel-js.3.0.1-nightly3.2305-01.cjs.js.map +1 -0
  3. package/browser/es5/applicationinsights-teechannel-js.3.0.1-nightly3.2305-01.cjs.min.js +6 -0
  4. package/browser/es5/applicationinsights-teechannel-js.3.0.1-nightly3.2305-01.cjs.min.js.map +1 -0
  5. package/browser/es5/{applicationinsights-teechannel-js.3.0.1-nightly3.2304-41.gbl.js → applicationinsights-teechannel-js.3.0.1-nightly3.2305-01.gbl.js} +318 -19
  6. package/browser/es5/applicationinsights-teechannel-js.3.0.1-nightly3.2305-01.gbl.js.map +1 -0
  7. package/browser/es5/applicationinsights-teechannel-js.3.0.1-nightly3.2305-01.gbl.min.js +6 -0
  8. package/browser/es5/applicationinsights-teechannel-js.3.0.1-nightly3.2305-01.gbl.min.js.map +1 -0
  9. package/browser/es5/applicationinsights-teechannel-js.3.0.1-nightly3.2305-01.integrity.json +66 -0
  10. package/browser/es5/{applicationinsights-teechannel-js.3.0.1-nightly3.2304-41.js → applicationinsights-teechannel-js.3.0.1-nightly3.2305-01.js} +318 -19
  11. package/browser/es5/applicationinsights-teechannel-js.3.0.1-nightly3.2305-01.js.map +1 -0
  12. package/browser/es5/applicationinsights-teechannel-js.3.0.1-nightly3.2305-01.min.js +6 -0
  13. package/browser/es5/applicationinsights-teechannel-js.3.0.1-nightly3.2305-01.min.js.map +1 -0
  14. package/browser/es5/applicationinsights-teechannel-js.3.cjs.js +317 -18
  15. package/browser/es5/applicationinsights-teechannel-js.3.cjs.js.map +1 -1
  16. package/browser/es5/applicationinsights-teechannel-js.3.cjs.min.js +2 -2
  17. package/browser/es5/applicationinsights-teechannel-js.3.cjs.min.js.map +1 -1
  18. package/browser/es5/applicationinsights-teechannel-js.3.gbl.js +317 -18
  19. package/browser/es5/applicationinsights-teechannel-js.3.gbl.js.map +1 -1
  20. package/browser/es5/applicationinsights-teechannel-js.3.gbl.min.js +2 -2
  21. package/browser/es5/applicationinsights-teechannel-js.3.gbl.min.js.map +1 -1
  22. package/browser/es5/applicationinsights-teechannel-js.3.js +317 -18
  23. package/browser/es5/applicationinsights-teechannel-js.3.js.map +1 -1
  24. package/browser/es5/applicationinsights-teechannel-js.3.min.js +2 -2
  25. package/browser/es5/applicationinsights-teechannel-js.3.min.js.map +1 -1
  26. package/dist/es5/applicationinsights-teechannel-js.js +317 -18
  27. package/dist/es5/applicationinsights-teechannel-js.js.map +1 -1
  28. package/dist/es5/applicationinsights-teechannel-js.min.js +2 -2
  29. package/dist/es5/applicationinsights-teechannel-js.min.js.map +1 -1
  30. package/dist-es5/ChannelController.js +9 -2
  31. package/dist-es5/ChannelController.js.map +1 -1
  32. package/dist-es5/Interfaces/ITeeChannelConfig.js +1 -1
  33. package/dist-es5/TeeChannel.js +1 -1
  34. package/dist-es5/TeeChannel.js.map +1 -1
  35. package/dist-es5/__DynamicConstants.js +1 -1
  36. package/dist-es5/applicationinsights-teechannel-js.js +1 -1
  37. package/package.json +5 -4
  38. package/types/applicationinsights-teechannel-js.d.ts +17 -4
  39. package/types/applicationinsights-teechannel-js.namespaced.d.ts +17 -4
  40. package/browser/es5/applicationinsights-teechannel-js.3.0.1-nightly3.2304-41.cjs.js.map +0 -1
  41. package/browser/es5/applicationinsights-teechannel-js.3.0.1-nightly3.2304-41.cjs.min.js +0 -6
  42. package/browser/es5/applicationinsights-teechannel-js.3.0.1-nightly3.2304-41.cjs.min.js.map +0 -1
  43. package/browser/es5/applicationinsights-teechannel-js.3.0.1-nightly3.2304-41.gbl.js.map +0 -1
  44. package/browser/es5/applicationinsights-teechannel-js.3.0.1-nightly3.2304-41.gbl.min.js +0 -6
  45. package/browser/es5/applicationinsights-teechannel-js.3.0.1-nightly3.2304-41.gbl.min.js.map +0 -1
  46. package/browser/es5/applicationinsights-teechannel-js.3.0.1-nightly3.2304-41.integrity.json +0 -66
  47. package/browser/es5/applicationinsights-teechannel-js.3.0.1-nightly3.2304-41.js.map +0 -1
  48. package/browser/es5/applicationinsights-teechannel-js.3.0.1-nightly3.2304-41.min.js +0 -6
  49. package/browser/es5/applicationinsights-teechannel-js.3.0.1-nightly3.2304-41.min.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Application Insights JavaScript SDK - Tee Channel, 3.0.1-nightly3.2304-41
2
+ * Application Insights JavaScript SDK - Tee Channel, 3.0.1-nightly3.2305-01
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  this.Microsoft = this.Microsoft || {};
@@ -37,7 +37,7 @@ this.Microsoft = this.Microsoft || {};
37
37
  var ArrCls = Array;
38
38
  var ArrProto = ArrCls[PROTOTYPE];
39
39
 
40
- function _safeGet(cb, defValue) {
40
+ function safeGet(cb, defValue) {
41
41
  var result = defValue;
42
42
  try {
43
43
  result = cb();
@@ -85,6 +85,9 @@ this.Microsoft = this.Microsoft || {};
85
85
  var isNumber = _createIs(NUMBER);
86
86
  var isBoolean = _createIs(BOOLEAN);
87
87
  var isError = _createObjIs("Error");
88
+ function isPromiseLike(value) {
89
+ return !!value && isFunction(value.then);
90
+ }
88
91
 
89
92
  var objGetOwnPropertyDescriptor = ObjClass.getOwnPropertyDescriptor;
90
93
 
@@ -311,19 +314,21 @@ this.Microsoft = this.Microsoft || {};
311
314
  return lazyValue;
312
315
  }
313
316
 
314
- function _lazySafeGet(cb, defValue) {
315
- return getLazy(function () { return _safeGet(cb, defValue); });
317
+ function safeGetLazy(cb, defValue) {
318
+ return getLazy(function () { return safeGet(cb, defValue); });
316
319
  }
317
320
 
318
321
  var WINDOW = "window";
319
322
  var _cachedGlobal;
320
323
  var _cachedWindow;
324
+ var _cachedDocument;
321
325
  var _cachedNavigator;
322
- function _lazySafeGetInst(name) {
323
- return _lazySafeGet(function () { return getInst(name) || UNDEF_VALUE; }, UNDEF_VALUE);
326
+ var _isNode;
327
+ function lazySafeGetInst(name) {
328
+ return safeGetLazy(function () { return getInst(name) || UNDEF_VALUE; }, UNDEF_VALUE);
324
329
  }
325
330
  function getGlobal(useCached) {
326
- (!_cachedGlobal || useCached === false || (_globalLazyTestHooks.lzy && !_cachedGlobal.b)) && (_cachedGlobal = _lazySafeGet(_getGlobalValue, null));
331
+ (!_cachedGlobal || useCached === false || (_globalLazyTestHooks.lzy && !_cachedGlobal.b)) && (_cachedGlobal = safeGetLazy(_getGlobalValue, null));
327
332
  return _cachedGlobal.v;
328
333
  }
329
334
  function getInst(name, useCached) {
@@ -336,29 +341,40 @@ this.Microsoft = this.Microsoft || {};
336
341
  }
337
342
  return null;
338
343
  }
344
+ function getDocument() {
345
+ (!_cachedDocument || (_globalLazyTestHooks.lzy && !_cachedDocument.b)) && (_cachedDocument = lazySafeGetInst("document"));
346
+ return _cachedDocument.v;
347
+ }
339
348
  function hasWindow() {
340
349
  return !!getWindow();
341
350
  }
342
351
  function getWindow() {
343
- (!_cachedWindow || (_globalLazyTestHooks.lzy && !_cachedWindow.b)) && (_cachedWindow = _lazySafeGetInst(WINDOW));
352
+ (!_cachedWindow || (_globalLazyTestHooks.lzy && !_cachedWindow.b)) && (_cachedWindow = lazySafeGetInst(WINDOW));
344
353
  return _cachedWindow.v;
345
354
  }
346
355
  function getNavigator() {
347
- (!_cachedNavigator || (_globalLazyTestHooks.lzy && !_cachedNavigator.b)) && (_cachedNavigator = _lazySafeGetInst("navigator"));
356
+ (!_cachedNavigator || (_globalLazyTestHooks.lzy && !_cachedNavigator.b)) && (_cachedNavigator = lazySafeGetInst("navigator"));
348
357
  return _cachedNavigator.v;
349
358
  }
359
+ function isNode() {
360
+ !_isNode && (_isNode = safeGetLazy(function () { return !!(process && (process.versions || {}).node); }, false));
361
+ return _isNode.v;
362
+ }
350
363
 
351
364
  var _symbol;
352
365
  var _symbolFor;
353
366
  var _symbolKeyFor;
354
367
  function _getSymbolValue(name) {
355
- return _lazySafeGet(function () {
368
+ return safeGetLazy(function () {
356
369
  return (_symbol.v ? _symbol[name] : UNDEF_VALUE);
357
370
  }, UNDEF_VALUE);
358
371
  }
372
+ function hasSymbol() {
373
+ return !!getSymbol();
374
+ }
359
375
  function getSymbol() {
360
376
  var resetCache = !_symbol || (_globalLazyTestHooks && _globalLazyTestHooks.lzy && !_symbol.b);
361
- resetCache && (_symbol = _lazySafeGetInst(SYMBOL));
377
+ resetCache && (_symbol = lazySafeGetInst(SYMBOL));
362
378
  (!_symbolFor || resetCache) && (_symbolFor = _getSymbolValue("for"));
363
379
  (!_symbolKeyFor || resetCache) && (_symbolKeyFor = _getSymbolValue("keyFor"));
364
380
  return _symbol.v;
@@ -930,6 +946,7 @@ this.Microsoft = this.Microsoft || {};
930
946
  var _DYN_TIME = "time";
931
947
  var _DYN_PROCESS_NEXT$1 = "processNext";
932
948
  var _DYN_GET_PROCESS_TEL_CONT0 = "getProcessTelContext";
949
+ var _DYN_UNLOAD = "unload";
933
950
  var _DYN_LOGGING_LEVEL_CONSOL4 = "loggingLevelConsole";
934
951
  var _DYN_CREATE_NEW = "createNew";
935
952
  var _DYN_TEARDOWN$1 = "teardown";
@@ -966,6 +983,278 @@ this.Microsoft = this.Microsoft || {};
966
983
  throw new aggregationErrorType(theMessage, sourceErrors || []);
967
984
  }
968
985
 
986
+ var _theLogger = null;
987
+ function _debugLog(id, message) {
988
+ if (_theLogger) {
989
+ _theLogger(id, message);
990
+ }
991
+ }
992
+
993
+ var STRING_STATES = [
994
+ "pending", "resolving", "resolved", "rejected"
995
+ ];
996
+
997
+ var DISPATCH_EVENT = "dispatchEvent";
998
+ var _hasInitEvent;
999
+ function emitEvent(target, evtName, populateEvent, useNewEvent) {
1000
+ var doc = getDocument();
1001
+ !_hasInitEvent && (_hasInitEvent = safeGetLazy(function () {
1002
+ var evt;
1003
+ if (doc && doc.createEvent) {
1004
+ evt = doc.createEvent("Event");
1005
+ }
1006
+ return (!!evt && evt.initEvent);
1007
+ }, null));
1008
+ var theEvt = _hasInitEvent.v ? doc.createEvent("Event") : (useNewEvent ? new Event(evtName) : {});
1009
+ populateEvent && populateEvent(theEvt);
1010
+ if (_hasInitEvent.v) {
1011
+ theEvt.initEvent(evtName, false, true);
1012
+ }
1013
+ if (theEvt && target[DISPATCH_EVENT]) {
1014
+ target[DISPATCH_EVENT](theEvt);
1015
+ }
1016
+ else {
1017
+ var handler = target["on" + evtName];
1018
+ if (handler) {
1019
+ handler(theEvt);
1020
+ }
1021
+ else {
1022
+ var theConsole = getInst("console");
1023
+ theConsole && (theConsole["error"] || theConsole["log"])(evtName, dumpObj(theEvt));
1024
+ }
1025
+ }
1026
+ }
1027
+
1028
+ var STR_PROMISE = "Promise";
1029
+
1030
+ var NODE_UNHANDLED_REJECTION = "unhandledRejection";
1031
+ var UNHANDLED_REJECTION = NODE_UNHANDLED_REJECTION.toLowerCase();
1032
+ var _unhandledRejectionTimeout = 10;
1033
+ var _hasPromiseRejectionEvent;
1034
+ function dumpFnObj(value) {
1035
+ if (isFunction(value)) {
1036
+ return value.toString();
1037
+ }
1038
+ return dumpObj(value);
1039
+ }
1040
+ function _createPromise(newPromise, processor, executor) {
1041
+ var additionalArgs = arrSlice(arguments, 3);
1042
+ var _state = 0 ;
1043
+ var _hasResolved = false;
1044
+ var _settledValue;
1045
+ var _queue = [];
1046
+ var _handled = false;
1047
+ var _unHandledRejectionHandler = null;
1048
+ var _thePromise;
1049
+ !_hasPromiseRejectionEvent && (_hasPromiseRejectionEvent = lazySafeGetInst(STR_PROMISE + "RejectionEvent"));
1050
+ var _then = function (onResolved, onRejected) {
1051
+ try {
1052
+ _handled = true;
1053
+ _unHandledRejectionHandler && _unHandledRejectionHandler.cancel();
1054
+ _unHandledRejectionHandler = null;
1055
+ _debugLog(_toString(), "then(" + dumpFnObj(onResolved) + ", " + dumpFnObj(onResolved) + ")");
1056
+ var thenPromise = newPromise(function (resolve, reject) {
1057
+ _queue.push(function () {
1058
+ try {
1059
+ _debugLog(_toString(), "Handling settled value " + dumpFnObj(_settledValue));
1060
+ var handler = _state === 2 ? onResolved : onRejected;
1061
+ var value = isUndefined(handler) ? _settledValue : (isFunction(handler) ? handler(_settledValue) : handler);
1062
+ _debugLog(_toString(), "Handling Result " + dumpFnObj(value));
1063
+ if (isPromiseLike(value)) {
1064
+ value.then(resolve, reject);
1065
+ }
1066
+ else if (handler) {
1067
+ resolve(value);
1068
+ }
1069
+ else if (_state === 3 ) {
1070
+ reject(value);
1071
+ }
1072
+ else {
1073
+ resolve(value);
1074
+ }
1075
+ }
1076
+ catch (e) {
1077
+ reject(e);
1078
+ }
1079
+ });
1080
+ _debugLog(_toString(), "Added to Queue " + _queue.length);
1081
+ if (_hasResolved) {
1082
+ _processQueue();
1083
+ }
1084
+ }, additionalArgs);
1085
+ _debugLog(_toString(), "Created -> " + thenPromise.toString());
1086
+ return thenPromise;
1087
+ }
1088
+ finally {
1089
+ }
1090
+ };
1091
+ var _catch = function (onRejected) {
1092
+ return _then(undefined, onRejected);
1093
+ };
1094
+ var _finally = function (onFinally) {
1095
+ var thenFinally = onFinally;
1096
+ var catchFinally = onFinally;
1097
+ if (isFunction(onFinally)) {
1098
+ thenFinally = function (value) {
1099
+ onFinally && onFinally();
1100
+ return value;
1101
+ };
1102
+ catchFinally = function (reason) {
1103
+ onFinally && onFinally();
1104
+ throw reason;
1105
+ };
1106
+ }
1107
+ return _then(thenFinally, catchFinally);
1108
+ };
1109
+ var _strState = function () {
1110
+ return STRING_STATES[_state];
1111
+ };
1112
+ var _processQueue = function () {
1113
+ if (_queue.length > 0) {
1114
+ var pending = _queue.slice();
1115
+ _queue = [];
1116
+ _debugLog(_toString(), "Processing queue " + pending.length);
1117
+ _handled = true;
1118
+ processor(pending);
1119
+ _debugLog(_toString(), "Processing done");
1120
+ _unHandledRejectionHandler && _unHandledRejectionHandler.cancel();
1121
+ _unHandledRejectionHandler = null;
1122
+ }
1123
+ else {
1124
+ _debugLog(_toString(), "Empty Processing queue ");
1125
+ }
1126
+ };
1127
+ var _createSettleIfFn = function (newState, allowState) {
1128
+ return function (theValue) {
1129
+ if (_state === allowState) {
1130
+ if (newState === 2 && isPromiseLike(theValue)) {
1131
+ _state = 1 ;
1132
+ _debugLog(_toString(), "Resolving");
1133
+ theValue.then(_createSettleIfFn(2 , 1 ), _createSettleIfFn(3 , 1 ));
1134
+ return;
1135
+ }
1136
+ _state = newState;
1137
+ _hasResolved = true;
1138
+ _settledValue = theValue;
1139
+ _debugLog(_toString(), _strState());
1140
+ _processQueue();
1141
+ if (!_handled && newState === 3 && !_unHandledRejectionHandler) {
1142
+ _unHandledRejectionHandler = scheduleTimeout(_notifyUnhandledRejection, _unhandledRejectionTimeout);
1143
+ }
1144
+ }
1145
+ else {
1146
+ _debugLog(_toString(), "Already " + _strState());
1147
+ }
1148
+ };
1149
+ };
1150
+ var _notifyUnhandledRejection = function () {
1151
+ if (!_handled) {
1152
+ if (isNode()) {
1153
+ _debugLog(_toString(), "Emitting " + NODE_UNHANDLED_REJECTION);
1154
+ process.emit(NODE_UNHANDLED_REJECTION, _settledValue, _thePromise);
1155
+ }
1156
+ else {
1157
+ var gbl = getWindow() || getGlobal();
1158
+ _debugLog(_toString(), "Emitting " + UNHANDLED_REJECTION);
1159
+ emitEvent(gbl, UNHANDLED_REJECTION, function (theEvt) {
1160
+ objDefine(theEvt, "promise", { g: function () { return _thePromise; } });
1161
+ theEvt.reason = _settledValue;
1162
+ return theEvt;
1163
+ }, !!_hasPromiseRejectionEvent.v);
1164
+ }
1165
+ }
1166
+ };
1167
+ _thePromise = {
1168
+ then: _then,
1169
+ "catch": _catch,
1170
+ finally: _finally
1171
+ };
1172
+ objDefineProp(_thePromise, "state", {
1173
+ get: _strState
1174
+ });
1175
+ if (hasSymbol()) {
1176
+ _thePromise[getKnownSymbol(11 )] = "IPromise";
1177
+ }
1178
+ var _toString = function () {
1179
+ return "IPromise" + ("") + " " + _strState() + (_hasResolved ? (" - " + dumpFnObj(_settledValue)) : "");
1180
+ };
1181
+ _thePromise.toString = _toString;
1182
+ (function _initialize() {
1183
+ if (!isFunction(executor)) {
1184
+ throwTypeError(STR_PROMISE + ": executor is not a function - " + dumpFnObj(executor));
1185
+ }
1186
+ var _rejectFn = _createSettleIfFn(3 , 0 );
1187
+ try {
1188
+ _debugLog(_toString(), "Executing");
1189
+ executor.call(_thePromise, _createSettleIfFn(2 , 0 ), _rejectFn);
1190
+ }
1191
+ catch (e) {
1192
+ _rejectFn(e);
1193
+ }
1194
+ })();
1195
+ _debugLog(_toString(), "Returning");
1196
+ return _thePromise;
1197
+ }
1198
+
1199
+ var _processPendingItems = function (pending) {
1200
+ arrForEach(pending, function (fn) {
1201
+ try {
1202
+ fn();
1203
+ }
1204
+ catch (e) {
1205
+ }
1206
+ });
1207
+ };
1208
+ function timeoutItemProcessor(timeout) {
1209
+ var callbackTimeout = isNumber(timeout) ? timeout : 0;
1210
+ return function (pending) {
1211
+ scheduleTimeout(function () {
1212
+ _processPendingItems(pending);
1213
+ }, callbackTimeout);
1214
+ };
1215
+ }
1216
+
1217
+ function createAsyncPromise(executor, timeout) {
1218
+ return _createPromise(createAsyncPromise, timeoutItemProcessor(timeout), executor, timeout);
1219
+ }
1220
+
1221
+ var _isPromiseSupported;
1222
+ function createNativePromise(executor, timeout) {
1223
+ !_isPromiseSupported && (_isPromiseSupported = lazySafeGetInst(STR_PROMISE));
1224
+ var PrmCls = _isPromiseSupported.v;
1225
+ if (!PrmCls) {
1226
+ return createAsyncPromise(executor);
1227
+ }
1228
+ if (!isFunction(executor)) {
1229
+ throwTypeError(STR_PROMISE + ": executor is not a function - " + dumpObj(executor));
1230
+ }
1231
+ var _state = 0 ;
1232
+ function _strState() {
1233
+ return STRING_STATES[_state];
1234
+ }
1235
+ var thePromise = new PrmCls(function (resolve, reject) {
1236
+ function _resolve(value) {
1237
+ _state = 2 ;
1238
+ resolve(value);
1239
+ }
1240
+ function _reject(reason) {
1241
+ _state = 3 ;
1242
+ reject(reason);
1243
+ }
1244
+ executor(_resolve, _reject);
1245
+ });
1246
+ objDefineProp(thePromise, "state", {
1247
+ get: _strState
1248
+ });
1249
+ return thePromise;
1250
+ }
1251
+
1252
+ var _promiseCreator;
1253
+ function createPromise(executor, timeout) {
1254
+ !_promiseCreator && (_promiseCreator = getLazy(function () { return createNativePromise; }));
1255
+ return _promiseCreator.v.call(this, executor, timeout);
1256
+ }
1257
+
969
1258
  var UNDEFINED_VALUE = undefined;
970
1259
  var STR_EMPTY = "";
971
1260
  var STR_CORE = "core";
@@ -1149,7 +1438,7 @@ this.Microsoft = this.Microsoft || {};
1149
1438
  return result;
1150
1439
  }
1151
1440
 
1152
- var version = "3.0.1-nightly3.2304-41";
1441
+ var version = "3.0.1-nightly3.2305-01";
1153
1442
  var instanceName = "." + newId(6);
1154
1443
  var _dataUid = 0;
1155
1444
  function _canAcceptData(target) {
@@ -1744,7 +2033,7 @@ this.Microsoft = this.Microsoft || {};
1744
2033
  return handler[_DYN_WATCH ](configHandler);
1745
2034
  }
1746
2035
  _logInvalidAccess(logger, STR_NOT_DYNAMIC_ERROR + dumpObj(config));
1747
- createDynamicConfig(config, null, logger)[_DYN_WATCH ](configHandler);
2036
+ return createDynamicConfig(config, null, logger)[_DYN_WATCH ](configHandler);
1748
2037
  }
1749
2038
 
1750
2039
  function _stringToBoolOrDefault(theValue, defaultValue, theConfig) {
@@ -1839,8 +2128,9 @@ this.Microsoft = this.Microsoft || {};
1839
2128
  var _loggingLevelTelemetry;
1840
2129
  var _maxInternalMessageLimit;
1841
2130
  var _enableDebug;
2131
+ var _unloadHandler;
1842
2132
  dynamicProto(DiagnosticLogger, this, function (_self) {
1843
- _setDefaultsFromConfig(config || {});
2133
+ _unloadHandler = _setDefaultsFromConfig(config || {});
1844
2134
  _self.consoleLoggingLevel = function () { return _loggingLevelConsole; };
1845
2135
  _self[_DYN_THROW_INTERNAL ] = function (severity, msgId, msg, properties, isUserAct) {
1846
2136
  if (isUserAct === void 0) { isUserAct = false; }
@@ -1883,6 +2173,10 @@ this.Microsoft = this.Microsoft || {};
1883
2173
  _messageLogged = {};
1884
2174
  };
1885
2175
  _self[_DYN_LOG_INTERNAL_MESSAGE ] = _logInternalMessage;
2176
+ _self[_DYN_UNLOAD ] = function (isAsync) {
2177
+ _unloadHandler && _unloadHandler.rm();
2178
+ _unloadHandler = null;
2179
+ };
1886
2180
  function _logInternalMessage(severity, message) {
1887
2181
  if (_areInternalMessagesThrottled()) {
1888
2182
  return;
@@ -1915,8 +2209,7 @@ this.Microsoft = this.Microsoft || {};
1915
2209
  }
1916
2210
  }
1917
2211
  function _setDefaultsFromConfig(config) {
1918
- var handler = createDynamicConfig(config, defaultValues$1, _self);
1919
- handler[_DYN_WATCH ](function (details) {
2212
+ return onConfigChange(createDynamicConfig(config, defaultValues$1, _self).cfg, function (details) {
1920
2213
  var config = details.cfg;
1921
2214
  _loggingLevelConsole = config[_DYN_LOGGING_LEVEL_CONSOL4 ];
1922
2215
  _loggingLevelTelemetry = config.loggingLevelTelemetry;
@@ -2266,7 +2559,7 @@ this.Microsoft = this.Microsoft || {};
2266
2559
  var context = internalContext.ctx;
2267
2560
  function _processNext(unloadState) {
2268
2561
  var nextPlugin = internalContext._next();
2269
- nextPlugin && nextPlugin.unload(context, unloadState);
2562
+ nextPlugin && nextPlugin[_DYN_UNLOAD ](context, unloadState);
2270
2563
  return !nextPlugin;
2271
2564
  }
2272
2565
  function _createNew(plugins, startAt) {
@@ -2765,7 +3058,13 @@ this.Microsoft = this.Microsoft || {};
2765
3058
  var waiting = 1;
2766
3059
  var doneIterating = false;
2767
3060
  var cbTimer = null;
3061
+ var result = true;
2768
3062
  cbTimeout = cbTimeout || 5000;
3063
+ if (isAsync && !callBack) {
3064
+ result = createPromise(function (resolve) {
3065
+ callBack = resolve;
3066
+ });
3067
+ }
2769
3068
  function doCallback() {
2770
3069
  waiting--;
2771
3070
  if (doneIterating && waiting === 0) {
@@ -2802,7 +3101,7 @@ this.Microsoft = this.Microsoft || {};
2802
3101
  doneIterating = true;
2803
3102
  doCallback();
2804
3103
  });
2805
- return true;
3104
+ return result;
2806
3105
  }
2807
3106
  };
2808
3107
  return channelController;