@microsoft/applicationinsights-debugplugin-js 2.7.4-nightly.2202-07 → 2.8.0-beta.2202-06

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 (51) hide show
  1. package/browser/{ai.dbg.2.7.4-nightly.2202-07.cjs.js → ai.dbg.2.8.0-beta.2202-06.cjs.js} +381 -240
  2. package/browser/ai.dbg.2.8.0-beta.2202-06.cjs.js.map +1 -0
  3. package/browser/ai.dbg.2.8.0-beta.2202-06.cjs.min.js +6 -0
  4. package/browser/ai.dbg.2.8.0-beta.2202-06.cjs.min.js.map +1 -0
  5. package/browser/{ai.dbg.2.7.4-nightly.2202-07.gbl.js → ai.dbg.2.8.0-beta.2202-06.gbl.js} +381 -240
  6. package/browser/ai.dbg.2.8.0-beta.2202-06.gbl.js.map +1 -0
  7. package/browser/ai.dbg.2.8.0-beta.2202-06.gbl.min.js +6 -0
  8. package/browser/ai.dbg.2.8.0-beta.2202-06.gbl.min.js.map +1 -0
  9. package/browser/ai.dbg.2.8.0-beta.2202-06.integrity.json +66 -0
  10. package/browser/{ai.dbg.2.7.4-nightly.2202-07.js → ai.dbg.2.8.0-beta.2202-06.js} +381 -240
  11. package/browser/ai.dbg.2.8.0-beta.2202-06.js.map +1 -0
  12. package/browser/ai.dbg.2.8.0-beta.2202-06.min.js +6 -0
  13. package/browser/ai.dbg.2.8.0-beta.2202-06.min.js.map +1 -0
  14. package/browser/ai.dbg.2.cjs.js +380 -239
  15. package/browser/ai.dbg.2.cjs.js.map +1 -1
  16. package/browser/ai.dbg.2.cjs.min.js +2 -2
  17. package/browser/ai.dbg.2.cjs.min.js.map +1 -1
  18. package/browser/ai.dbg.2.gbl.js +380 -239
  19. package/browser/ai.dbg.2.gbl.js.map +1 -1
  20. package/browser/ai.dbg.2.gbl.min.js +2 -2
  21. package/browser/ai.dbg.2.gbl.min.js.map +1 -1
  22. package/browser/ai.dbg.2.js +380 -239
  23. package/browser/ai.dbg.2.js.map +1 -1
  24. package/browser/ai.dbg.2.min.js +2 -2
  25. package/browser/ai.dbg.2.min.js.map +1 -1
  26. package/dist/applicationinsights-debugplugin-js.d.ts +1 -1
  27. package/dist/applicationinsights-debugplugin-js.js +380 -239
  28. package/dist/applicationinsights-debugplugin-js.js.map +1 -1
  29. package/dist/applicationinsights-debugplugin-js.min.js +2 -2
  30. package/dist/applicationinsights-debugplugin-js.min.js.map +1 -1
  31. package/dist/applicationinsights-debugplugin-js.rollup.d.ts +1 -1
  32. package/dist-esm/DebugPlugin.js +1 -1
  33. package/dist-esm/applicationinsights-debugplugin-js.js +1 -1
  34. package/dist-esm/components/Dashboard.js +1 -1
  35. package/dist-esm/components/LogEntry.js +1 -1
  36. package/dist-esm/components/debugBins.js +1 -1
  37. package/dist-esm/components/filterList.js +1 -1
  38. package/dist-esm/components/helpers.js +1 -1
  39. package/dist-esm/components/styleNodeSrc.js +1 -1
  40. package/dist-esm/interfaces/IDebugPluginConfig.js +1 -1
  41. package/package.json +4 -4
  42. package/browser/ai.dbg.2.7.4-nightly.2202-07.cjs.js.map +0 -1
  43. package/browser/ai.dbg.2.7.4-nightly.2202-07.cjs.min.js +0 -6
  44. package/browser/ai.dbg.2.7.4-nightly.2202-07.cjs.min.js.map +0 -1
  45. package/browser/ai.dbg.2.7.4-nightly.2202-07.gbl.js.map +0 -1
  46. package/browser/ai.dbg.2.7.4-nightly.2202-07.gbl.min.js +0 -6
  47. package/browser/ai.dbg.2.7.4-nightly.2202-07.gbl.min.js.map +0 -1
  48. package/browser/ai.dbg.2.7.4-nightly.2202-07.integrity.json +0 -66
  49. package/browser/ai.dbg.2.7.4-nightly.2202-07.js.map +0 -1
  50. package/browser/ai.dbg.2.7.4-nightly.2202-07.min.js +0 -6
  51. package/browser/ai.dbg.2.7.4-nightly.2202-07.min.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Application Insights JavaScript SDK - Debug Plugin, 2.7.4-nightly.2202-07
2
+ * Application Insights JavaScript SDK - Debug Plugin, 2.8.0-beta.2202-06
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  (function (global, factory) {
@@ -425,6 +425,7 @@
425
425
  var str__Proto = "__proto__";
426
426
  var strConstructor$1 = "constructor";
427
427
  var _objDefineProperty = ObjDefineProperty;
428
+ var _objFreeze = ObjClass.freeze;
428
429
  var _objKeys = ObjClass.keys;
429
430
  var StringProto = String[strShimPrototype];
430
431
  var _strTrim = StringProto[cStrTrim];
@@ -434,7 +435,7 @@
434
435
  var _isArray = Array.isArray;
435
436
  var _objToString = ObjProto[strToString];
436
437
  var _fnToString = ObjHasOwnProperty[strToString];
437
- _fnToString.call(ObjClass);
438
+ var _objFunctionString = _fnToString.call(ObjClass);
438
439
  var _objGetPrototypeOf = Object["getPrototypeOf"];
439
440
  function _getObjProto(target) {
440
441
  if (target) {
@@ -548,6 +549,22 @@
548
549
  function isSymbol(value) {
549
550
  return typeof value === "symbol";
550
551
  }
552
+ function isPlainObject(value) {
553
+ var result = false;
554
+ if (value && typeof value === "object") {
555
+ var proto = _objGetPrototypeOf ? _objGetPrototypeOf(value) : _getObjProto(value);
556
+ if (!proto) {
557
+ result = true;
558
+ }
559
+ else {
560
+ if (proto[strConstructor$1] && ObjHasOwnProperty.call(proto, strConstructor$1)) {
561
+ proto = proto[strConstructor$1];
562
+ }
563
+ result = typeof proto === strShimFunction && _fnToString.call(proto) === _objFunctionString;
564
+ }
565
+ }
566
+ return result;
567
+ }
551
568
  function toISOString(date) {
552
569
  if (date) {
553
570
  return _dataToISOString ? date[strToISOString]() : _toISOStringPoly(date);
@@ -713,6 +730,10 @@
713
730
  }
714
731
  return false;
715
732
  }
733
+ function _doNothing(value) {
734
+ return value;
735
+ }
736
+ var objFreeze = _objFreeze || _doNothing;
716
737
  function dateNow() {
717
738
  var dt = Date;
718
739
  return dt.now ? dt.now() : new dt().getTime();
@@ -737,6 +758,50 @@
737
758
  function isTruthy(value) {
738
759
  return !!value;
739
760
  }
761
+ function objExtend(obj, obj2, obj3, obj4, obj5, obj6) {
762
+ var theArgs = arguments;
763
+ var extended = theArgs[0] || {};
764
+ var argLen = theArgs.length;
765
+ var deep = false;
766
+ var idx = 1;
767
+ if (argLen > 0 && isBoolean(extended)) {
768
+ deep = extended;
769
+ extended = theArgs[idx] || {};
770
+ idx++;
771
+ }
772
+ if (!isObject(extended)) {
773
+ extended = {};
774
+ }
775
+ for (; idx < argLen; idx++) {
776
+ var arg = theArgs[idx];
777
+ var isArgArray = isArray(arg);
778
+ var isArgObj = isObject(arg);
779
+ for (var prop in arg) {
780
+ var propOk = (isArgArray && (prop in arg)) || (isArgObj && (ObjHasOwnProperty.call(arg, prop)));
781
+ if (!propOk) {
782
+ continue;
783
+ }
784
+ var newValue = arg[prop];
785
+ var isNewArray = void 0;
786
+ if (deep && newValue && ((isNewArray = isArray(newValue)) || isPlainObject(newValue))) {
787
+ var clone = extended[prop];
788
+ if (isNewArray) {
789
+ if (!isArray(clone)) {
790
+ clone = [];
791
+ }
792
+ }
793
+ else if (!isPlainObject(clone)) {
794
+ clone = {};
795
+ }
796
+ newValue = objExtend(deep, clone, newValue);
797
+ }
798
+ if (newValue !== undefined) {
799
+ extended[prop] = newValue;
800
+ }
801
+ }
802
+ }
803
+ return extended;
804
+ }
740
805
 
741
806
  var strWindow = "window";
742
807
  var strDocument = "document";
@@ -1153,252 +1218,240 @@
1153
1218
  return func();
1154
1219
  }
1155
1220
 
1156
- var TelemetryPluginChain = /** @class */ (function () {
1157
- function TelemetryPluginChain(plugin, defItemCtx) {
1158
- var _self = this;
1159
- var _nextProxy = null;
1160
- var _hasProcessTelemetry = isFunction(plugin.processTelemetry);
1161
- var _hasSetNext = isFunction(plugin.setNextPlugin);
1162
- _self._hasRun = false;
1163
- _self.getPlugin = function () {
1164
- return plugin;
1165
- };
1166
- _self.getNext = function () {
1221
+ var strTelemetryPluginChain = "TelemetryPluginChain";
1222
+ var strHasRunFlags = "_hasRun";
1223
+ var strGetTelCtx = "_getTelCtx";
1224
+ var _chainId = 0;
1225
+ function _getNextProxyStart(proxy, config, core, startAt) {
1226
+ while (proxy) {
1227
+ if (proxy.getPlugin() === startAt) {
1228
+ return proxy;
1229
+ }
1230
+ proxy = proxy.getNext();
1231
+ }
1232
+ return createTelemetryProxyChain([startAt], config, core);
1233
+ }
1234
+ function createProcessTelemetryContext(telemetryChain, config, core, startAt) {
1235
+ var _nextProxy = null;
1236
+ var _onComplete = null;
1237
+ if (startAt) {
1238
+ _nextProxy = _getNextProxyStart(telemetryChain, config, core, startAt);
1239
+ }
1240
+ else {
1241
+ _nextProxy = telemetryChain;
1242
+ }
1243
+ var context = {
1244
+ core: function () {
1245
+ return core;
1246
+ },
1247
+ diagLog: function () {
1248
+ return safeGetLogger(core, config);
1249
+ },
1250
+ getCfg: function () {
1251
+ return config;
1252
+ },
1253
+ getExtCfg: _getExtCfg,
1254
+ getConfig: _getConfig,
1255
+ hasNext: function () {
1256
+ return _nextProxy != null;
1257
+ },
1258
+ getNext: function () {
1167
1259
  return _nextProxy;
1168
- };
1169
- _self.setNext = function (nextPlugin) {
1260
+ },
1261
+ setNext: function (nextPlugin) {
1170
1262
  _nextProxy = nextPlugin;
1171
- };
1172
- _self.processTelemetry = function (env, itemCtx) {
1173
- if (!itemCtx) {
1174
- itemCtx = defItemCtx;
1263
+ },
1264
+ processNext: function (env) {
1265
+ _processChain(function (nextPlugin) {
1266
+ nextPlugin.processTelemetry(env, context);
1267
+ });
1268
+ },
1269
+ iterate: _iterateChain,
1270
+ createNew: function (plugins, startAt) {
1271
+ if (plugins === void 0) { plugins = null; }
1272
+ if (isArray(plugins)) {
1273
+ plugins = createTelemetryProxyChain(plugins, config, core, startAt);
1175
1274
  }
1176
- var identifier = plugin ? plugin.identifier : "TelemetryPluginChain";
1177
- doPerf(itemCtx ? itemCtx.core() : null, function () { return identifier + ":processTelemetry"; }, function () {
1178
- if (plugin && _hasProcessTelemetry) {
1179
- _self._hasRun = true;
1180
- try {
1181
- itemCtx.setNext(_nextProxy);
1182
- if (_hasSetNext) {
1183
- plugin.setNextPlugin(_nextProxy);
1184
- }
1185
- _nextProxy && (_nextProxy._hasRun = false);
1186
- plugin.processTelemetry(env, itemCtx);
1187
- }
1188
- catch (error) {
1189
- var hasRun = _nextProxy && _nextProxy._hasRun;
1190
- if (!_nextProxy || !hasRun) {
1191
- itemCtx.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.PluginException, "Plugin [" + plugin.identifier + "] failed during processTelemetry - " + dumpObj(error));
1192
- }
1193
- if (_nextProxy && !hasRun) {
1194
- _nextProxy.processTelemetry(env, itemCtx);
1275
+ return createProcessTelemetryContext(plugins || _nextProxy, config, core, startAt);
1276
+ },
1277
+ onComplete: function (onComplete) {
1278
+ _onComplete = onComplete;
1279
+ }
1280
+ };
1281
+ function _getExtCfg(identifier, defaultValue, mergeDefault) {
1282
+ if (defaultValue === void 0) { defaultValue = {}; }
1283
+ if (mergeDefault === void 0) { mergeDefault = 0 ; }
1284
+ var theConfig;
1285
+ if (config) {
1286
+ var extConfig = config.extensionConfig;
1287
+ if (extConfig && identifier) {
1288
+ theConfig = extConfig[identifier];
1289
+ }
1290
+ }
1291
+ if (!theConfig) {
1292
+ theConfig = defaultValue;
1293
+ }
1294
+ else if (isObject(defaultValue)) {
1295
+ if (mergeDefault !== 0 ) {
1296
+ var newConfig_1 = objExtend(true, defaultValue, theConfig);
1297
+ if (config && mergeDefault === 2 ) {
1298
+ objForEachKey(defaultValue, function (field) {
1299
+ if (isNullOrUndefined(newConfig_1[field])) {
1300
+ var cfgValue = config[field];
1301
+ if (!isNullOrUndefined(cfgValue)) {
1302
+ newConfig_1[field] = cfgValue;
1303
+ }
1195
1304
  }
1196
- }
1197
- }
1198
- else if (_nextProxy) {
1199
- _self._hasRun = true;
1200
- _nextProxy.processTelemetry(env, itemCtx);
1201
- }
1202
- }, function () { return ({ item: env }); }, !(env.sync));
1203
- };
1204
- }
1205
- return TelemetryPluginChain;
1206
- }());
1207
-
1208
- function _createProxyChain(plugins, itemCtx) {
1209
- var proxies = [];
1210
- if (plugins && plugins.length > 0) {
1211
- var lastProxy = null;
1212
- for (var idx = 0; idx < plugins.length; idx++) {
1213
- var thePlugin = plugins[idx];
1214
- if (thePlugin && isFunction(thePlugin.processTelemetry)) {
1215
- var newProxy = new TelemetryPluginChain(thePlugin, itemCtx);
1216
- proxies.push(newProxy);
1217
- if (lastProxy) {
1218
- lastProxy.setNext(newProxy);
1305
+ });
1219
1306
  }
1220
- lastProxy = newProxy;
1221
1307
  }
1222
1308
  }
1309
+ return theConfig;
1223
1310
  }
1224
- return proxies.length > 0 ? proxies[0] : null;
1225
- }
1226
- function _copyProxyChain(proxy, itemCtx, startAt) {
1227
- var plugins = [];
1228
- var add = startAt ? false : true;
1229
- if (proxy) {
1230
- while (proxy) {
1231
- var thePlugin = proxy.getPlugin();
1232
- if (add || thePlugin === startAt) {
1233
- add = true;
1234
- plugins.push(thePlugin);
1235
- }
1236
- proxy = proxy.getNext();
1311
+ function _getConfig(identifier, field, defaultValue) {
1312
+ if (defaultValue === void 0) { defaultValue = false; }
1313
+ var theValue;
1314
+ var extConfig = _getExtCfg(identifier, null);
1315
+ if (extConfig && !isNullOrUndefined(extConfig[field])) {
1316
+ theValue = extConfig[field];
1237
1317
  }
1318
+ else if (config && !isNullOrUndefined(config[field])) {
1319
+ theValue = config[field];
1320
+ }
1321
+ return !isNullOrUndefined(theValue) ? theValue : defaultValue;
1238
1322
  }
1239
- if (!add) {
1240
- plugins.push(startAt);
1241
- }
1242
- return _createProxyChain(plugins, itemCtx);
1243
- }
1244
- function _copyPluginChain(srcPlugins, itemCtx, startAt) {
1245
- var plugins = srcPlugins;
1246
- var add = false;
1247
- if (startAt && srcPlugins) {
1248
- plugins = [];
1249
- arrForEach(srcPlugins, function (thePlugin) {
1250
- if (add || thePlugin === startAt) {
1251
- add = true;
1252
- plugins.push(thePlugin);
1323
+ function _processChain(cb) {
1324
+ var nextPlugin = _nextProxy;
1325
+ if (nextPlugin) {
1326
+ _nextProxy = nextPlugin.getNext();
1327
+ cb(nextPlugin);
1328
+ }
1329
+ else {
1330
+ if (_onComplete) {
1331
+ _onComplete();
1332
+ _onComplete = null;
1253
1333
  }
1254
- });
1334
+ }
1255
1335
  }
1256
- if (startAt && !add) {
1257
- if (!plugins) {
1258
- plugins = [];
1336
+ function _iterateChain(cb) {
1337
+ while (_nextProxy) {
1338
+ _processChain(function (nextPlugin) {
1339
+ var plugin = nextPlugin.getPlugin();
1340
+ if (plugin) {
1341
+ cb(plugin);
1342
+ }
1343
+ });
1259
1344
  }
1260
- plugins.push(startAt);
1261
1345
  }
1262
- return _createProxyChain(plugins, itemCtx);
1346
+ return context;
1263
1347
  }
1264
- var ProcessTelemetryContext = /** @class */ (function () {
1265
- function ProcessTelemetryContext(plugins, config, core, startAt) {
1266
- var _self = this;
1267
- var _nextProxy = null;
1268
- if (startAt !== null) {
1269
- if (plugins && isFunction(plugins.getPlugin)) {
1270
- _nextProxy = _copyProxyChain(plugins, _self, startAt || plugins.getPlugin());
1348
+ function createTelemetryProxyChain(plugins, config, core, startAt) {
1349
+ var firstProxy = null;
1350
+ var add = startAt ? false : true;
1351
+ if (isArray(plugins) && plugins.length > 0) {
1352
+ var lastProxy_1 = null;
1353
+ arrForEach(plugins, function (thePlugin) {
1354
+ if (!add && startAt === thePlugin) {
1355
+ add = true;
1271
1356
  }
1272
- else {
1273
- if (startAt) {
1274
- _nextProxy = _copyPluginChain(plugins, _self, startAt);
1275
- }
1276
- else if (isUndefined(startAt)) {
1277
- _nextProxy = _createProxyChain(plugins, _self);
1357
+ if (add && thePlugin && isFunction(thePlugin.processTelemetry)) {
1358
+ var newProxy = createTelemetryPluginProxy(thePlugin, config, core);
1359
+ if (!firstProxy) {
1360
+ firstProxy = newProxy;
1278
1361
  }
1279
- }
1280
- }
1281
- _self.core = function () {
1282
- return core;
1283
- };
1284
- _self.diagLog = function () {
1285
- return safeGetLogger(core, config);
1286
- };
1287
- _self.getCfg = function () {
1288
- return config;
1289
- };
1290
- _self.getExtCfg = function (identifier, defaultValue) {
1291
- if (defaultValue === void 0) { defaultValue = {}; }
1292
- var theConfig;
1293
- if (config) {
1294
- var extConfig = config.extensionConfig;
1295
- if (extConfig && identifier) {
1296
- theConfig = extConfig[identifier];
1362
+ if (lastProxy_1) {
1363
+ lastProxy_1._setNext(newProxy);
1297
1364
  }
1365
+ lastProxy_1 = newProxy;
1298
1366
  }
1299
- return (theConfig ? theConfig : defaultValue);
1300
- };
1301
- _self.getConfig = function (identifier, field, defaultValue) {
1302
- if (defaultValue === void 0) { defaultValue = false; }
1303
- var theValue;
1304
- var extConfig = _self.getExtCfg(identifier, null);
1305
- if (extConfig && !isNullOrUndefined(extConfig[field])) {
1306
- theValue = extConfig[field];
1307
- }
1308
- else if (config && !isNullOrUndefined(config[field])) {
1309
- theValue = config[field];
1310
- }
1311
- return !isNullOrUndefined(theValue) ? theValue : defaultValue;
1312
- };
1313
- _self.hasNext = function () {
1314
- return _nextProxy != null;
1315
- };
1316
- _self.getNext = function () {
1317
- return _nextProxy;
1318
- };
1319
- _self.setNext = function (nextPlugin) {
1320
- _nextProxy = nextPlugin;
1321
- };
1322
- _self.processNext = function (env) {
1323
- var nextPlugin = _nextProxy;
1324
- if (nextPlugin) {
1325
- _nextProxy = nextPlugin.getNext();
1326
- nextPlugin.processTelemetry(env, _self);
1327
- }
1328
- };
1329
- _self.createNew = function (plugins, startAt) {
1330
- if (plugins === void 0) { plugins = null; }
1331
- return new ProcessTelemetryContext(plugins || _nextProxy, config, core, startAt);
1332
- };
1367
+ });
1333
1368
  }
1334
- return ProcessTelemetryContext;
1335
- }());
1336
-
1337
- var strExtensionConfig = "extensionConfig";
1338
-
1339
- var strGetPlugin = "getPlugin";
1340
- var BaseTelemetryPlugin = /** @class */ (function () {
1341
- function BaseTelemetryPlugin() {
1342
- var _self = this;
1343
- var _isinitialized = false;
1344
- var _rootCtx = null;
1345
- var _nextPlugin = null;
1346
- _self.core = null;
1347
- _self.diagLog = function (itemCtx) {
1348
- return _self._getTelCtx(itemCtx).diagLog();
1349
- };
1350
- _self.isInitialized = function () {
1351
- return _isinitialized;
1352
- };
1353
- _self.setInitialized = function (isInitialized) {
1354
- _isinitialized = isInitialized;
1355
- };
1356
- _self.setNextPlugin = function (next) {
1357
- _nextPlugin = next;
1358
- };
1359
- _self.processNext = function (env, itemCtx) {
1360
- if (itemCtx) {
1361
- itemCtx.processNext(env);
1362
- }
1363
- else if (_nextPlugin && isFunction(_nextPlugin.processTelemetry)) {
1364
- _nextPlugin.processTelemetry(env, null);
1369
+ if (startAt && !firstProxy) {
1370
+ return createTelemetryProxyChain([startAt], config, core);
1371
+ }
1372
+ return firstProxy;
1373
+ }
1374
+ function createTelemetryPluginProxy(plugin, config, core) {
1375
+ var nextProxy = null;
1376
+ var hasProcessTelemetry = isFunction(plugin.processTelemetry);
1377
+ var hasSetNext = isFunction(plugin.setNextPlugin);
1378
+ var chainId;
1379
+ if (plugin) {
1380
+ chainId = plugin.identifier + "-" + plugin.priority + "-" + _chainId++;
1381
+ }
1382
+ else {
1383
+ chainId = "Unknown-0-" + _chainId++;
1384
+ }
1385
+ var proxyChain = {
1386
+ getPlugin: function () {
1387
+ return plugin;
1388
+ },
1389
+ getNext: function () {
1390
+ return nextProxy;
1391
+ },
1392
+ processTelemetry: _processTelemetry,
1393
+ _id: chainId,
1394
+ _setNext: function (nextPlugin) {
1395
+ nextProxy = nextPlugin;
1396
+ }
1397
+ };
1398
+ function _processChain(itemCtx, processPluginFn, processProxyFn, name, details, isAsync) {
1399
+ if (!itemCtx) {
1400
+ if (plugin && isFunction(plugin[strGetTelCtx])) {
1401
+ itemCtx = plugin[strGetTelCtx]();
1365
1402
  }
1366
- };
1367
- _self._getTelCtx = function (currentCtx) {
1368
- if (currentCtx === void 0) { currentCtx = null; }
1369
- var itemCtx = currentCtx;
1370
1403
  if (!itemCtx) {
1371
- var rootCtx = _rootCtx || new ProcessTelemetryContext(null, {}, _self.core);
1372
- if (_nextPlugin && _nextPlugin[strGetPlugin]) {
1373
- itemCtx = rootCtx.createNew(null, _nextPlugin[strGetPlugin]);
1404
+ itemCtx = createProcessTelemetryContext(proxyChain, config, core);
1405
+ }
1406
+ }
1407
+ var identifier = plugin ? plugin.identifier : strTelemetryPluginChain;
1408
+ var hasRunContext = itemCtx[strHasRunFlags];
1409
+ if (!hasRunContext) {
1410
+ hasRunContext = itemCtx[strHasRunFlags] = {};
1411
+ }
1412
+ doPerf(itemCtx.core(), function () { return identifier + ":" + name; }, function () {
1413
+ hasRunContext[chainId] = true;
1414
+ var hasRun = false;
1415
+ itemCtx.setNext(nextProxy);
1416
+ if (plugin) {
1417
+ try {
1418
+ var nextId = nextProxy ? nextProxy._id : "";
1419
+ if (nextId) {
1420
+ hasRunContext[nextId] = false;
1421
+ }
1422
+ hasRun = processPluginFn(itemCtx);
1374
1423
  }
1375
- else {
1376
- itemCtx = rootCtx.createNew(null, _nextPlugin);
1424
+ catch (error) {
1425
+ var hasNextRun = nextProxy ? hasRunContext[nextProxy._id] : true;
1426
+ if (hasNextRun) {
1427
+ hasRun = true;
1428
+ }
1429
+ if (!nextProxy || !hasNextRun) {
1430
+ itemCtx.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.PluginException, "Plugin [" + plugin.identifier + "] failed during " + name + " - " + dumpObj(error) + ", run flags: " + dumpObj(hasRunContext));
1431
+ }
1377
1432
  }
1378
1433
  }
1379
- return itemCtx;
1380
- };
1381
- _self._baseTelInit = function (config, core, extensions, pluginChain) {
1382
- if (config) {
1383
- setValue(config, strExtensionConfig, [], null, isNullOrUndefined);
1434
+ if (nextProxy && !hasRun) {
1435
+ processProxyFn(itemCtx);
1384
1436
  }
1385
- if (!pluginChain && core) {
1386
- pluginChain = core.getProcessTelContext().getNext();
1437
+ }, details, isAsync);
1438
+ }
1439
+ function _processTelemetry(env, itemCtx) {
1440
+ _processChain(itemCtx, function (itemCtx) {
1441
+ if (!hasProcessTelemetry) {
1442
+ return false;
1387
1443
  }
1388
- var nextPlugin = _nextPlugin;
1389
- if (_nextPlugin && _nextPlugin[strGetPlugin]) {
1390
- nextPlugin = _nextPlugin[strGetPlugin]();
1444
+ if (hasSetNext) {
1445
+ plugin.setNextPlugin(nextProxy);
1391
1446
  }
1392
- _self.core = core;
1393
- _rootCtx = new ProcessTelemetryContext(pluginChain, config, core, nextPlugin);
1394
- _isinitialized = true;
1395
- };
1447
+ plugin.processTelemetry(env, itemCtx);
1448
+ return true;
1449
+ }, function (itemCtx) {
1450
+ nextProxy.processTelemetry(env, itemCtx);
1451
+ }, "processTelemetry", function () { return ({ item: env }); }, !(env.sync));
1396
1452
  }
1397
- BaseTelemetryPlugin.prototype.initialize = function (config, core, extensions, pluginChain) {
1398
- this._baseTelInit(config, core, extensions, pluginChain);
1399
- };
1400
- return BaseTelemetryPlugin;
1401
- }());
1453
+ return objFreeze(proxyChain);
1454
+ }
1402
1455
 
1403
1456
  var strToGMTString = "toGMTString";
1404
1457
  var strToUTCString = "toUTCString";
@@ -1627,6 +1680,93 @@
1627
1680
  return false;
1628
1681
  }
1629
1682
 
1683
+ var strExtensionConfig = "extensionConfig";
1684
+
1685
+ var strGetPlugin = "getPlugin";
1686
+ var BaseTelemetryPlugin = /** @class */ (function () {
1687
+ function BaseTelemetryPlugin() {
1688
+ var _self = this;
1689
+ var _isinitialized;
1690
+ var _rootCtx;
1691
+ var _nextPlugin;
1692
+ var _hooks;
1693
+ _initDefaults();
1694
+ dynamicProto(BaseTelemetryPlugin, _self, function (_self) {
1695
+ _self.initialize = function (config, core, extensions, pluginChain) {
1696
+ _setDefaults(config, core, pluginChain);
1697
+ _isinitialized = true;
1698
+ };
1699
+ _self._addHook = function (hooks) {
1700
+ if (hooks) {
1701
+ if (isArray(hooks)) {
1702
+ _hooks = _hooks.concat(hooks);
1703
+ }
1704
+ else {
1705
+ _hooks.push(hooks);
1706
+ }
1707
+ }
1708
+ };
1709
+ });
1710
+ _self.diagLog = function (itemCtx) {
1711
+ return _getTelCtx(itemCtx).diagLog();
1712
+ };
1713
+ _self.isInitialized = function () {
1714
+ return _isinitialized;
1715
+ };
1716
+ _self.setInitialized = function (isInitialized) {
1717
+ _isinitialized = isInitialized;
1718
+ };
1719
+ _self.setNextPlugin = function (next) {
1720
+ _nextPlugin = next;
1721
+ };
1722
+ _self.processNext = function (env, itemCtx) {
1723
+ if (itemCtx) {
1724
+ itemCtx.processNext(env);
1725
+ }
1726
+ else if (_nextPlugin && isFunction(_nextPlugin.processTelemetry)) {
1727
+ _nextPlugin.processTelemetry(env, null);
1728
+ }
1729
+ };
1730
+ _self._getTelCtx = _getTelCtx;
1731
+ function _getTelCtx(currentCtx) {
1732
+ if (currentCtx === void 0) { currentCtx = null; }
1733
+ var itemCtx = currentCtx;
1734
+ if (!itemCtx) {
1735
+ var rootCtx = _rootCtx || createProcessTelemetryContext(null, {}, _self.core);
1736
+ if (_nextPlugin && _nextPlugin[strGetPlugin]) {
1737
+ itemCtx = rootCtx.createNew(null, _nextPlugin[strGetPlugin]);
1738
+ }
1739
+ else {
1740
+ itemCtx = rootCtx.createNew(null, _nextPlugin);
1741
+ }
1742
+ }
1743
+ return itemCtx;
1744
+ }
1745
+ function _setDefaults(config, core, pluginChain) {
1746
+ if (config) {
1747
+ setValue(config, strExtensionConfig, [], null, isNullOrUndefined);
1748
+ }
1749
+ if (!pluginChain && core) {
1750
+ pluginChain = core.getProcessTelContext().getNext();
1751
+ }
1752
+ var nextPlugin = _nextPlugin;
1753
+ if (_nextPlugin && _nextPlugin[strGetPlugin]) {
1754
+ nextPlugin = _nextPlugin[strGetPlugin]();
1755
+ }
1756
+ _self.core = core;
1757
+ _rootCtx = createProcessTelemetryContext(pluginChain, config, core, nextPlugin);
1758
+ }
1759
+ function _initDefaults() {
1760
+ _isinitialized = false;
1761
+ _self.core = null;
1762
+ _rootCtx = null;
1763
+ _nextPlugin = null;
1764
+ _hooks = [];
1765
+ }
1766
+ }
1767
+ return BaseTelemetryPlugin;
1768
+ }());
1769
+
1630
1770
  var UInt32Mask = 0x100000000;
1631
1771
  var MaxUInt32 = 0xffffffff;
1632
1772
  var _mwcSeeded = false;
@@ -1655,18 +1795,18 @@
1655
1795
  return 0;
1656
1796
  }
1657
1797
  function random32(signed) {
1658
- var value;
1798
+ var value = 0;
1659
1799
  var c = getCrypto() || getMsCrypto();
1660
1800
  if (c && c.getRandomValues) {
1661
1801
  value = c.getRandomValues(new Uint32Array(1))[0] & MaxUInt32;
1662
1802
  }
1663
- else if (isIE()) {
1803
+ if (value === 0 && isIE()) {
1664
1804
  if (!_mwcSeeded) {
1665
1805
  _autoSeedMwc();
1666
1806
  }
1667
1807
  value = mwcRandom32() & MaxUInt32;
1668
1808
  }
1669
- else {
1809
+ if (value === 0) {
1670
1810
  value = Math.floor((UInt32Mask * Math.random()) | 0);
1671
1811
  }
1672
1812
  if (!signed) {
@@ -1691,6 +1831,23 @@
1691
1831
  }
1692
1832
  return value;
1693
1833
  }
1834
+ function newId(maxLength) {
1835
+ if (maxLength === void 0) { maxLength = 22; }
1836
+ var base64chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
1837
+ var number = random32() >>> 0;
1838
+ var chars = 0;
1839
+ var result = "";
1840
+ while (result.length < maxLength) {
1841
+ chars++;
1842
+ result += base64chars.charAt(number & 0x3F);
1843
+ number >>>= 6;
1844
+ if (chars === 5) {
1845
+ number = (((random32() << 2) & 0xFFFFFFFF) | (number & 0x03)) >>> 0;
1846
+ chars = 0;
1847
+ }
1848
+ }
1849
+ return result;
1850
+ }
1694
1851
 
1695
1852
  var _cookieMgrs = null;
1696
1853
  var _canUseCookies;
@@ -1723,23 +1880,6 @@
1723
1880
  }
1724
1881
  return dateNow();
1725
1882
  }
1726
- function newId(maxLength) {
1727
- if (maxLength === void 0) { maxLength = 22; }
1728
- var base64chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
1729
- var number = random32() >>> 0;
1730
- var chars = 0;
1731
- var result = "";
1732
- while (result.length < maxLength) {
1733
- chars++;
1734
- result += base64chars.charAt(number & 0x3F);
1735
- number >>>= 6;
1736
- if (chars === 5) {
1737
- number = (((random32() << 2) & 0xFFFFFFFF) | (number & 0x03)) >>> 0;
1738
- chars = 0;
1739
- }
1740
- }
1741
- return result;
1742
- }
1743
1883
  function generateW3CId() {
1744
1884
  var hexValues = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"];
1745
1885
  var oct = "", tmp;
@@ -1895,6 +2035,7 @@
1895
2035
  };
1896
2036
  var hookCtx = [];
1897
2037
  var cbArgs = _createArgs([funcArgs], orgArgs);
2038
+ funcArgs.evt = getGlobalInst("event");
1898
2039
  function _createArgs(target, theArgs) {
1899
2040
  _arrLoop(theArgs, function (arg) {
1900
2041
  target.push(arg);
@@ -3412,4 +3553,4 @@
3412
3553
  (function(obj, prop, descriptor) { /* ai_es3_polyfil defineProperty */ var func = Object["defineProperty"]; if (func) { try { return func(obj, prop, descriptor); } catch(e) { /* IE8 defines defineProperty, but will throw */ } } if (descriptor && typeof descriptor.value !== undefined) { obj[prop] = descriptor.value; } return obj; })(exports, '__esModule', { value: true });
3413
3554
 
3414
3555
  }));
3415
- //# sourceMappingURL=ai.dbg.2.7.4-nightly.2202-07.js.map
3556
+ //# sourceMappingURL=ai.dbg.2.8.0-beta.2202-06.js.map