@microsoft/applicationinsights-react-js 3.4.1-nightly.2212-10 → 3.4.1-nightly.2212-12

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,5 +1,5 @@
1
1
  /*!
2
- * Application Insights JavaScript SDK - React Plugin, 3.4.1-nightly.2212-10
2
+ * Application Insights JavaScript SDK - React Plugin, 3.4.1-nightly.2212-12
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  (function (global, factory) {
@@ -46,21 +46,23 @@
46
46
  var _cachedGlobal = null;
47
47
  function getGlobal(useCached) {
48
48
  if (useCached === void 0) { useCached = true; }
49
- if (!_cachedGlobal || !useCached) {
50
- if (typeof globalThis !== strShimUndefined && globalThis) {
51
- _cachedGlobal = globalThis;
49
+ var result = useCached === false ? null : _cachedGlobal;
50
+ if (!result) {
51
+ if (typeof globalThis !== strShimUndefined) {
52
+ result = globalThis;
52
53
  }
53
- if (typeof self !== strShimUndefined && self) {
54
- _cachedGlobal = self;
54
+ if (!result && typeof self !== strShimUndefined) {
55
+ result = self;
55
56
  }
56
- if (typeof window !== strShimUndefined && window) {
57
- _cachedGlobal = window;
57
+ if (!result && typeof window !== strShimUndefined) {
58
+ result = window;
58
59
  }
59
- if (typeof global !== strShimUndefined && global) {
60
- _cachedGlobal = global;
60
+ if (!result && typeof global !== strShimUndefined) {
61
+ result = global;
61
62
  }
63
+ _cachedGlobal = result;
62
64
  }
63
- return _cachedGlobal;
65
+ return result;
64
66
  }
65
67
  function throwTypeError(message) {
66
68
  throw new TypeError(message);
@@ -98,7 +100,9 @@
98
100
  var __assignFn = ObjAssign || __objAssignFnImpl;
99
101
  var extendStaticsFn = function (d, b) {
100
102
  extendStaticsFn = ObjClass["setPrototypeOf"] ||
101
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
103
+ ({ __proto__: [] } instanceof Array && function (d, b) {
104
+ d.__proto__ = b;
105
+ }) ||
102
106
  function (d, b) {
103
107
  for (var p in b) {
104
108
  if (b[strShimHasOwnProperty](p)) {
@@ -113,14 +117,18 @@
113
117
  throwTypeError("Class extends value " + String(b) + " is not a constructor or null");
114
118
  }
115
119
  extendStaticsFn(d, b);
116
- function __() { this.constructor = d; }
120
+ function __() {
121
+ this.constructor = d;
122
+ }
117
123
  d[strShimPrototype] = b === null ? objCreateFn(b) : (__[strShimPrototype] = b[strShimPrototype], new __());
118
124
  }
119
125
 
120
126
  /*!
121
- * Microsoft Dynamic Proto Utility, 1.1.6
127
+ * Microsoft Dynamic Proto Utility, 1.1.7
122
128
  * Copyright (c) Microsoft and contributors. All rights reserved.
123
129
  */
130
+ var _a;
131
+ var UNDEFINED = "undefined";
124
132
  var Constructor = 'constructor';
125
133
  var Prototype = 'prototype';
126
134
  var strFunction = 'function';
@@ -134,13 +142,37 @@
134
142
  var UnknownValue = '_unknown_';
135
143
  var str__Proto$1 = "__proto__";
136
144
  var DynProtoBaseProto = "_dyn" + str__Proto$1;
145
+ var DynProtoGlobalSettings = "__dynProto$Gbl";
137
146
  var DynProtoCurrent = "_dynInstProto";
138
147
  var strUseBaseInst = 'useBaseInst';
139
148
  var strSetInstFuncs = 'setInstFuncs';
140
149
  var Obj = Object;
141
150
  var _objGetPrototypeOf$1 = Obj["getPrototypeOf"];
142
151
  var _objGetOwnProps = Obj["getOwnPropertyNames"];
143
- var _dynamicNames = 0;
152
+ function _getGlobal() {
153
+ var result;
154
+ if (typeof globalThis !== UNDEFINED) {
155
+ result = globalThis;
156
+ }
157
+ if (!result && typeof self !== UNDEFINED) {
158
+ result = self;
159
+ }
160
+ if (!result && typeof window !== UNDEFINED) {
161
+ result = window;
162
+ }
163
+ if (!result && typeof global !== UNDEFINED) {
164
+ result = global;
165
+ }
166
+ return result || {};
167
+ }
168
+ var _gbl = _getGlobal();
169
+ var _gblInst = _gbl[DynProtoGlobalSettings] || (_gbl[DynProtoGlobalSettings] = {
170
+ o: (_a = {},
171
+ _a[strSetInstFuncs] = true,
172
+ _a[strUseBaseInst] = true,
173
+ _a),
174
+ n: 1000
175
+ });
144
176
  function _hasOwnProperty(obj, prop) {
145
177
  return obj && Obj[Prototype].hasOwnProperty.call(obj, prop);
146
178
  }
@@ -334,15 +366,15 @@
334
366
  }
335
367
  var classProto = theClass[Prototype];
336
368
  if (!_checkPrototype(classProto, target)) {
337
- _throwTypeError("[" + _getObjName(theClass) + "] is not in class hierarchy of [" + _getObjName(target) + "]");
369
+ _throwTypeError("[" + _getObjName(theClass) + "] not in hierarchy of [" + _getObjName(target) + "]");
338
370
  }
339
371
  var className = null;
340
372
  if (_hasOwnProperty(classProto, DynClassName)) {
341
373
  className = classProto[DynClassName];
342
374
  }
343
375
  else {
344
- className = DynClassNamePrefix + _getObjName(theClass, "_") + "$" + _dynamicNames;
345
- _dynamicNames++;
376
+ className = DynClassNamePrefix + _getObjName(theClass, "_") + "$" + _gblInst.n;
377
+ _gblInst.n++;
346
378
  classProto[DynClassName] = className;
347
379
  }
348
380
  var perfOptions = dynamicProto[DynProtoDefaultOptions];
@@ -359,11 +391,7 @@
359
391
  }
360
392
  _populatePrototype(classProto, className, target, instFuncs, setInstanceFunc !== false);
361
393
  }
362
- var perfDefaults = {
363
- setInstFuncs: true,
364
- useBaseInst: true
365
- };
366
- dynamicProto[DynProtoDefaultOptions] = perfDefaults;
394
+ dynamicProto[DynProtoDefaultOptions] = _gblInst.o;
367
395
 
368
396
  var _DYN_INITIALIZE = "initialize";
369
397
  var _DYN_NAME = "name";
@@ -556,7 +584,7 @@
556
584
  }
557
585
  function strTrim(str) {
558
586
  if (str) {
559
- str = (_strTrim && str[cStrTrim]) ? str[cStrTrim]() : (str[_DYN_REPLACE ] ? str[_DYN_REPLACE ](/^\s+|\s+$/g, STR_EMPTY) : str);
587
+ str = (_strTrim && str[cStrTrim]) ? str[cStrTrim]() : (str[_DYN_REPLACE ] ? str[_DYN_REPLACE ](/^\s+|(?=\s)\s+$/g, STR_EMPTY) : str);
560
588
  }
561
589
  return str;
562
590
  }
@@ -1168,7 +1196,7 @@
1168
1196
  }
1169
1197
 
1170
1198
  var _objDefineProperty = ObjDefineProperty;
1171
- var version = '2.8.6';
1199
+ var version = '2.8.9';
1172
1200
  var instanceName = "." + newId(6);
1173
1201
  var _dataUid = 0;
1174
1202
  function _createAccessor(target, prop, value) {
@@ -1283,6 +1311,20 @@
1283
1311
  }
1284
1312
  return cookieMgrCfg;
1285
1313
  }
1314
+ function _isIgnoredCookie(cookieMgrCfg, name) {
1315
+ if (name && cookieMgrCfg && isArray(cookieMgrCfg.ignoreCookies)) {
1316
+ return cookieMgrCfg.ignoreCookies[_DYN_INDEX_OF ](name) !== -1;
1317
+ }
1318
+ return false;
1319
+ }
1320
+ function _isBlockedCookie(cookieMgrCfg, name) {
1321
+ if (name && cookieMgrCfg && isArray(cookieMgrCfg.blockedCookies)) {
1322
+ if (cookieMgrCfg.blockedCookies[_DYN_INDEX_OF ](name) !== -1) {
1323
+ return true;
1324
+ }
1325
+ }
1326
+ return _isIgnoredCookie(cookieMgrCfg, name);
1327
+ }
1286
1328
  function safeGetCookieMgr(core, config) {
1287
1329
  var cookieMgr;
1288
1330
  if (core) {
@@ -1323,7 +1365,7 @@
1323
1365
  },
1324
1366
  _a.set = function (name, value, maxAgeSec, domain, path) {
1325
1367
  var result = false;
1326
- if (_isMgrEnabled(cookieMgr)) {
1368
+ if (_isMgrEnabled(cookieMgr) && !_isBlockedCookie(cookieMgrConfig, name)) {
1327
1369
  var values = {};
1328
1370
  var theValue = strTrim(value || STR_EMPTY);
1329
1371
  var idx = theValue[_DYN_INDEX_OF ](";");
@@ -1366,7 +1408,7 @@
1366
1408
  },
1367
1409
  _a.get = function (name) {
1368
1410
  var value = STR_EMPTY;
1369
- if (_isMgrEnabled(cookieMgr)) {
1411
+ if (_isMgrEnabled(cookieMgr) && !_isIgnoredCookie(cookieMgrConfig, name)) {
1370
1412
  value = (cookieMgrConfig.getCookie || _getCookieValue)(name);
1371
1413
  }
1372
1414
  return value;