@microsoft/applicationinsights-react-js 3.2.0-beta.1 → 3.2.1-nightly.202110-04

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.
@@ -1,12 +1,12 @@
1
1
  /*!
2
- * Application Insights JavaScript SDK - React Plugin, 3.2.0-beta.1
2
+ * Application Insights JavaScript SDK - React Plugin, 3.2.1-nightly.202110-04
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  (function (global, factory) {
6
6
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
7
7
  typeof define === 'function' && define.amd ? define(['exports', 'react'], factory) :
8
8
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.Microsoft = global.Microsoft || {}, global.Microsoft.ApplicationInsights = global.Microsoft.ApplicationInsights || {}), global.React));
9
- }(this, (function (exports, React) { 'use strict';
9
+ })(this, (function (exports, React) { 'use strict';
10
10
 
11
11
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
12
12
 
@@ -19,14 +19,12 @@
19
19
  var d = (function(obj, prop) { /* ai_es3_polyfil getOwnPropertyDescriptor */var func = Object["getOwnPropertyDescriptor"]; if (func) { return func(obj, prop); } return undefined; })(e, k);
20
20
  (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; })(n, k, d.get ? d : {
21
21
  enumerable: true,
22
- get: function () {
23
- return e[k];
24
- }
22
+ get: function () { return e[k]; }
25
23
  });
26
24
  }
27
25
  });
28
26
  }
29
- n['default'] = e;
27
+ n["default"] = e;
30
28
  return n;
31
29
  }
32
30
 
@@ -448,8 +446,6 @@
448
446
  var strOnPrefix = "on";
449
447
  var strAttachEvent = "attachEvent";
450
448
  var strAddEventHelper = "addEventListener";
451
- var strDetachEvent = "detachEvent";
452
- var strRemoveEventListener = "removeEventListener";
453
449
  var _objDefineProperty = ObjDefineProperty;
454
450
  function objToString(obj) {
455
451
  return ObjProto.toString.call(obj);
@@ -494,21 +490,6 @@
494
490
  }
495
491
  return result;
496
492
  }
497
- function detachEvent(obj, eventNameWithoutOn, handlerRef, useCapture) {
498
- if (useCapture === void 0) { useCapture = false; }
499
- if (!isNullOrUndefined(obj)) {
500
- try {
501
- if (!isNullOrUndefined(obj[strRemoveEventListener])) {
502
- obj[strRemoveEventListener](eventNameWithoutOn, handlerRef, useCapture);
503
- }
504
- else if (!isNullOrUndefined(obj[strDetachEvent])) {
505
- obj[strDetachEvent](strOnPrefix + eventNameWithoutOn, handlerRef);
506
- }
507
- }
508
- catch (e) {
509
- }
510
- }
511
- }
512
493
  function objForEachKey(target, callbackfn) {
513
494
  if (target) {
514
495
  for (var prop in target) {
@@ -583,33 +564,45 @@
583
564
  }
584
565
  function arrForEach(arr, callbackfn, thisArg) {
585
566
  var len = arr.length;
586
- for (var idx = 0; idx < len; idx++) {
587
- if (idx in arr) {
588
- if (callbackfn.call(thisArg || arr, arr[idx], idx, arr) === -1) {
589
- break;
567
+ try {
568
+ for (var idx = 0; idx < len; idx++) {
569
+ if (idx in arr) {
570
+ if (callbackfn.call(thisArg || arr, arr[idx], idx, arr) === -1) {
571
+ break;
572
+ }
590
573
  }
591
574
  }
592
575
  }
576
+ catch (e) {
577
+ }
593
578
  }
594
579
  function arrIndexOf(arr, searchElement, fromIndex) {
595
580
  var len = arr.length;
596
581
  var from = fromIndex || 0;
597
- for (var lp = Math.max(from >= 0 ? from : len - Math.abs(from), 0); lp < len; lp++) {
598
- if (lp in arr && arr[lp] === searchElement) {
599
- return lp;
582
+ try {
583
+ for (var lp = Math.max(from >= 0 ? from : len - Math.abs(from), 0); lp < len; lp++) {
584
+ if (lp in arr && arr[lp] === searchElement) {
585
+ return lp;
586
+ }
600
587
  }
601
588
  }
589
+ catch (e) {
590
+ }
602
591
  return -1;
603
592
  }
604
593
  function arrMap(arr, callbackfn, thisArg) {
605
594
  var len = arr.length;
606
595
  var _this = thisArg || arr;
607
596
  var results = new Array(len);
608
- for (var lp = 0; lp < len; lp++) {
609
- if (lp in arr) {
610
- results[lp] = callbackfn.call(_this, arr[lp], arr);
597
+ try {
598
+ for (var lp = 0; lp < len; lp++) {
599
+ if (lp in arr) {
600
+ results[lp] = callbackfn.call(_this, arr[lp], arr);
601
+ }
611
602
  }
612
603
  }
604
+ catch (e) {
605
+ }
613
606
  return results;
614
607
  }
615
608
  function arrReduce(arr, callbackfn, initialValue) {
@@ -1100,7 +1093,7 @@
1100
1093
  catch (error) {
1101
1094
  var hasRun = _nextProxy && _nextProxy._hasRun;
1102
1095
  if (!_nextProxy || !hasRun) {
1103
- itemCtx.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.PluginException, "Plugin [" + plugin.identifier + "] failed during processTelemetry - " + error);
1096
+ itemCtx.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.PluginException, "Plugin [" + plugin.identifier + "] failed during processTelemetry - " + dumpObj(error));
1104
1097
  }
1105
1098
  if (_nextProxy && !hasRun) {
1106
1099
  _nextProxy.processTelemetry(env, itemCtx);
@@ -1634,7 +1627,7 @@
1634
1627
  }
1635
1628
  var doc = getDocument();
1636
1629
  if (doc) {
1637
- result = EventHelper.Attach(doc, eventName, callback) || result;
1630
+ result = attachEvent(doc, eventName, callback) || result;
1638
1631
  }
1639
1632
  return result;
1640
1633
  }
@@ -1726,12 +1719,6 @@
1726
1719
  generateW3CId: generateW3CId
1727
1720
  };
1728
1721
  var GuidRegex = /[xy]/g;
1729
- var EventHelper = {
1730
- Attach: attachEvent,
1731
- AttachEvent: attachEvent,
1732
- Detach: detachEvent,
1733
- DetachEvent: detachEvent
1734
- };
1735
1722
  function _legacyCookieMgr(config, logger) {
1736
1723
  var cookieMgr = _gblCookieMgr(config, logger);
1737
1724
  var legacyCanUseCookies = CoreUtils._canUseCookies;
@@ -1953,12 +1940,12 @@
1953
1940
  AppInsightsErrorBoundary.prototype.render = function () {
1954
1941
  if (this.state.hasError) {
1955
1942
  var onError = this.props.onError;
1956
- return React__default['default'].createElement(onError);
1943
+ return React__default["default"].createElement(onError);
1957
1944
  }
1958
1945
  return this.props.children;
1959
1946
  };
1960
1947
  return AppInsightsErrorBoundary;
1961
- }(React__default['default'].Component));
1948
+ }(React__default["default"].Component));
1962
1949
  var AppInsightsErrorBoundary$1 = AppInsightsErrorBoundary;
1963
1950
 
1964
1951
  var AppInsightsContext = React.createContext(undefined);
@@ -2057,5 +2044,5 @@
2057
2044
 
2058
2045
  (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 });
2059
2046
 
2060
- })));
2047
+ }));
2061
2048
  //# sourceMappingURL=applicationinsights-react-js.js.map