@microsoft/applicationinsights-analytics-js 2.8.0-beta.2203-16 → 2.8.0-nightly.2204-05

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 (31) hide show
  1. package/browser/applicationinsights-analytics-js.integrity.json +9 -9
  2. package/browser/applicationinsights-analytics-js.js +544 -730
  3. package/browser/applicationinsights-analytics-js.js.map +1 -1
  4. package/browser/applicationinsights-analytics-js.min.js +2 -2
  5. package/browser/applicationinsights-analytics-js.min.js.map +1 -1
  6. package/dist/applicationinsights-analytics-js.api.json +90 -46
  7. package/dist/applicationinsights-analytics-js.d.ts +1 -1
  8. package/dist/applicationinsights-analytics-js.js +544 -730
  9. package/dist/applicationinsights-analytics-js.js.map +1 -1
  10. package/dist/applicationinsights-analytics-js.min.js +2 -2
  11. package/dist/applicationinsights-analytics-js.min.js.map +1 -1
  12. package/dist/applicationinsights-analytics-js.rollup.d.ts +1 -1
  13. package/dist-esm/JavaScriptSDK/AnalyticsPlugin.js +14 -14
  14. package/dist-esm/JavaScriptSDK/AnalyticsPlugin.js.map +1 -1
  15. package/dist-esm/JavaScriptSDK/Telemetry/PageViewManager.js +4 -4
  16. package/dist-esm/JavaScriptSDK/Telemetry/PageViewManager.js.map +1 -1
  17. package/dist-esm/JavaScriptSDK/Telemetry/PageViewPerformanceManager.js +6 -5
  18. package/dist-esm/JavaScriptSDK/Telemetry/PageViewPerformanceManager.js.map +1 -1
  19. package/dist-esm/JavaScriptSDK/Telemetry/PageVisitTimeManager.js +6 -6
  20. package/dist-esm/JavaScriptSDK/Telemetry/PageVisitTimeManager.js.map +1 -1
  21. package/dist-esm/JavaScriptSDK/Timing.js +4 -4
  22. package/dist-esm/JavaScriptSDK/Timing.js.map +1 -1
  23. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryConfig.js +1 -1
  24. package/dist-esm/applicationinsights-analytics-js.js +1 -1
  25. package/package.json +6 -6
  26. package/src/JavaScriptSDK/AnalyticsPlugin.ts +25 -25
  27. package/src/JavaScriptSDK/Telemetry/PageViewManager.ts +8 -8
  28. package/src/JavaScriptSDK/Telemetry/PageViewPerformanceManager.ts +13 -11
  29. package/src/JavaScriptSDK/Telemetry/PageVisitTimeManager.ts +5 -5
  30. package/src/JavaScriptSDK/Timing.ts +3 -3
  31. package/types/tsdoc-metadata.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Application Insights JavaScript SDK - Web Analytics, 2.8.0-beta.2203-16
2
+ * Application Insights JavaScript SDK - Web Analytics, 2.8.0-nightly.2204-05
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  (function (global, factory) {
@@ -98,247 +98,6 @@
98
98
  d[strShimPrototype] = b === null ? objCreateFn(b) : (__[strShimPrototype] = b[strShimPrototype], new __());
99
99
  }
100
100
 
101
- /*!
102
- * Microsoft Dynamic Proto Utility, 1.1.4
103
- * Copyright (c) Microsoft and contributors. All rights reserved.
104
- */
105
- var Constructor = 'constructor';
106
- var Prototype = 'prototype';
107
- var strFunction = 'function';
108
- var DynInstFuncTable = '_dynInstFuncs';
109
- var DynProxyTag = '_isDynProxy';
110
- var DynClassName = '_dynClass';
111
- var DynClassNamePrefix = '_dynCls$';
112
- var DynInstChkTag = '_dynInstChk';
113
- var DynAllowInstChkTag = DynInstChkTag;
114
- var DynProtoDefaultOptions = '_dfOpts';
115
- var UnknownValue = '_unknown_';
116
- var str__Proto$1 = "__proto__";
117
- var strUseBaseInst = 'useBaseInst';
118
- var strSetInstFuncs = 'setInstFuncs';
119
- var Obj = Object;
120
- var _objGetPrototypeOf$1 = Obj["getPrototypeOf"];
121
- var _dynamicNames = 0;
122
- function _hasOwnProperty(obj, prop) {
123
- return obj && Obj[Prototype].hasOwnProperty.call(obj, prop);
124
- }
125
- function _isObjectOrArrayPrototype(target) {
126
- return target && (target === Obj[Prototype] || target === Array[Prototype]);
127
- }
128
- function _isObjectArrayOrFunctionPrototype(target) {
129
- return _isObjectOrArrayPrototype(target) || target === Function[Prototype];
130
- }
131
- function _getObjProto$1(target) {
132
- if (target) {
133
- if (_objGetPrototypeOf$1) {
134
- return _objGetPrototypeOf$1(target);
135
- }
136
- var newProto = target[str__Proto$1] || target[Prototype] || (target[Constructor] ? target[Constructor][Prototype] : null);
137
- if (newProto) {
138
- return newProto;
139
- }
140
- }
141
- return null;
142
- }
143
- function _forEachProp(target, func) {
144
- var props = [];
145
- var getOwnProps = Obj["getOwnPropertyNames"];
146
- if (getOwnProps) {
147
- props = getOwnProps(target);
148
- }
149
- else {
150
- for (var name_1 in target) {
151
- if (typeof name_1 === "string" && _hasOwnProperty(target, name_1)) {
152
- props.push(name_1);
153
- }
154
- }
155
- }
156
- if (props && props.length > 0) {
157
- for (var lp = 0; lp < props.length; lp++) {
158
- func(props[lp]);
159
- }
160
- }
161
- }
162
- function _isDynamicCandidate(target, funcName, skipOwn) {
163
- return (funcName !== Constructor && typeof target[funcName] === strFunction && (skipOwn || _hasOwnProperty(target, funcName)));
164
- }
165
- function _throwTypeError(message) {
166
- throw new TypeError("DynamicProto: " + message);
167
- }
168
- function _getInstanceFuncs(thisTarget) {
169
- var instFuncs = {};
170
- _forEachProp(thisTarget, function (name) {
171
- if (!instFuncs[name] && _isDynamicCandidate(thisTarget, name, false)) {
172
- instFuncs[name] = thisTarget[name];
173
- }
174
- });
175
- return instFuncs;
176
- }
177
- function _hasVisited(values, value) {
178
- for (var lp = values.length - 1; lp >= 0; lp--) {
179
- if (values[lp] === value) {
180
- return true;
181
- }
182
- }
183
- return false;
184
- }
185
- function _getBaseFuncs(classProto, thisTarget, instFuncs, useBaseInst) {
186
- function _instFuncProxy(target, funcHost, funcName) {
187
- var theFunc = funcHost[funcName];
188
- if (theFunc[DynProxyTag] && useBaseInst) {
189
- var instFuncTable = target[DynInstFuncTable] || {};
190
- if (instFuncTable[DynAllowInstChkTag] !== false) {
191
- theFunc = (instFuncTable[funcHost[DynClassName]] || {})[funcName] || theFunc;
192
- }
193
- }
194
- return function () {
195
- return theFunc.apply(target, arguments);
196
- };
197
- }
198
- var baseFuncs = {};
199
- _forEachProp(instFuncs, function (name) {
200
- baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name);
201
- });
202
- var baseProto = _getObjProto$1(classProto);
203
- var visited = [];
204
- while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) {
205
- _forEachProp(baseProto, function (name) {
206
- if (!baseFuncs[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf$1)) {
207
- baseFuncs[name] = _instFuncProxy(thisTarget, baseProto, name);
208
- }
209
- });
210
- visited.push(baseProto);
211
- baseProto = _getObjProto$1(baseProto);
212
- }
213
- return baseFuncs;
214
- }
215
- function _getInstFunc(target, funcName, proto, currentDynProtoProxy) {
216
- var instFunc = null;
217
- if (target && _hasOwnProperty(proto, DynClassName)) {
218
- var instFuncTable = target[DynInstFuncTable] || {};
219
- instFunc = (instFuncTable[proto[DynClassName]] || {})[funcName];
220
- if (!instFunc) {
221
- _throwTypeError("Missing [" + funcName + "] " + strFunction);
222
- }
223
- if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) {
224
- var canAddInst = !_hasOwnProperty(target, funcName);
225
- var objProto = _getObjProto$1(target);
226
- var visited = [];
227
- while (canAddInst && objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) {
228
- var protoFunc = objProto[funcName];
229
- if (protoFunc) {
230
- canAddInst = (protoFunc === currentDynProtoProxy);
231
- break;
232
- }
233
- visited.push(objProto);
234
- objProto = _getObjProto$1(objProto);
235
- }
236
- try {
237
- if (canAddInst) {
238
- target[funcName] = instFunc;
239
- }
240
- instFunc[DynInstChkTag] = 1;
241
- }
242
- catch (e) {
243
- instFuncTable[DynAllowInstChkTag] = false;
244
- }
245
- }
246
- }
247
- return instFunc;
248
- }
249
- function _getProtoFunc(funcName, proto, currentDynProtoProxy) {
250
- var protoFunc = proto[funcName];
251
- if (protoFunc === currentDynProtoProxy) {
252
- protoFunc = _getObjProto$1(proto)[funcName];
253
- }
254
- if (typeof protoFunc !== strFunction) {
255
- _throwTypeError("[" + funcName + "] is not a " + strFunction);
256
- }
257
- return protoFunc;
258
- }
259
- function _populatePrototype(proto, className, target, baseInstFuncs, setInstanceFunc) {
260
- function _createDynamicPrototype(proto, funcName) {
261
- var dynProtoProxy = function () {
262
- var instFunc = _getInstFunc(this, funcName, proto, dynProtoProxy) || _getProtoFunc(funcName, proto, dynProtoProxy);
263
- return instFunc.apply(this, arguments);
264
- };
265
- dynProtoProxy[DynProxyTag] = 1;
266
- return dynProtoProxy;
267
- }
268
- if (!_isObjectOrArrayPrototype(proto)) {
269
- var instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || {};
270
- var instFuncs_1 = instFuncTable[className] = (instFuncTable[className] || {});
271
- if (instFuncTable[DynAllowInstChkTag] !== false) {
272
- instFuncTable[DynAllowInstChkTag] = !!setInstanceFunc;
273
- }
274
- _forEachProp(target, function (name) {
275
- if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name]) {
276
- instFuncs_1[name] = target[name];
277
- delete target[name];
278
- if (!_hasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) {
279
- proto[name] = _createDynamicPrototype(proto, name);
280
- }
281
- }
282
- });
283
- }
284
- }
285
- function _checkPrototype(classProto, thisTarget) {
286
- if (_objGetPrototypeOf$1) {
287
- var visited = [];
288
- var thisProto = _getObjProto$1(thisTarget);
289
- while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto) && !_hasVisited(visited, thisProto)) {
290
- if (thisProto === classProto) {
291
- return true;
292
- }
293
- visited.push(thisProto);
294
- thisProto = _getObjProto$1(thisProto);
295
- }
296
- }
297
- return false;
298
- }
299
- function _getObjName(target, unknownValue) {
300
- if (_hasOwnProperty(target, Prototype)) {
301
- return target.name || unknownValue || UnknownValue;
302
- }
303
- return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue;
304
- }
305
- function dynamicProto(theClass, target, delegateFunc, options) {
306
- if (!_hasOwnProperty(theClass, Prototype)) {
307
- _throwTypeError("theClass is an invalid class definition.");
308
- }
309
- var classProto = theClass[Prototype];
310
- if (!_checkPrototype(classProto, target)) {
311
- _throwTypeError("[" + _getObjName(theClass) + "] is not in class hierarchy of [" + _getObjName(target) + "]");
312
- }
313
- var className = null;
314
- if (_hasOwnProperty(classProto, DynClassName)) {
315
- className = classProto[DynClassName];
316
- }
317
- else {
318
- className = DynClassNamePrefix + _getObjName(theClass, "_") + "$" + _dynamicNames;
319
- _dynamicNames++;
320
- classProto[DynClassName] = className;
321
- }
322
- var perfOptions = dynamicProto[DynProtoDefaultOptions];
323
- var useBaseInst = !!perfOptions[strUseBaseInst];
324
- if (useBaseInst && options && options[strUseBaseInst] !== undefined) {
325
- useBaseInst = !!options[strUseBaseInst];
326
- }
327
- var instFuncs = _getInstanceFuncs(target);
328
- var baseFuncs = _getBaseFuncs(classProto, target, instFuncs, useBaseInst);
329
- delegateFunc(target, baseFuncs);
330
- var setInstanceFunc = !!_objGetPrototypeOf$1 && !!perfOptions[strSetInstFuncs];
331
- if (setInstanceFunc && options) {
332
- setInstanceFunc = !!options[strSetInstFuncs];
333
- }
334
- _populatePrototype(classProto, className, target, instFuncs, setInstanceFunc !== false);
335
- }
336
- var perfDefaults = {
337
- setInstFuncs: true,
338
- useBaseInst: true
339
- };
340
- dynamicProto[DynProtoDefaultOptions] = perfDefaults;
341
-
342
101
  var strEmpty$1 = "";
343
102
  var strSetNextPlugin = "setNextPlugin";
344
103
  var strIsInitialized = "isInitialized";
@@ -353,7 +112,7 @@
353
112
  var strMap = "map";
354
113
  var cStrTrim = "trim";
355
114
  var strToString = "toString";
356
- var str__Proto = "__proto__";
115
+ var str__Proto$1 = "__proto__";
357
116
  var strConstructor = "constructor";
358
117
  var _objDefineProperty$1 = ObjDefineProperty;
359
118
  var _objFreeze = ObjClass.freeze;
@@ -370,13 +129,13 @@
370
129
  var rCamelCase = /-([a-z])/g;
371
130
  var rNormalizeInvalid = /([^\w\d_$])/g;
372
131
  var rLeadingNumeric = /^(\d+[\w\d_$])/;
373
- var _objGetPrototypeOf = Object["getPrototypeOf"];
374
- function _getObjProto(target) {
132
+ var _objGetPrototypeOf$1 = Object["getPrototypeOf"];
133
+ function _getObjProto$1(target) {
375
134
  if (target) {
376
- if (_objGetPrototypeOf) {
377
- return _objGetPrototypeOf(target);
135
+ if (_objGetPrototypeOf$1) {
136
+ return _objGetPrototypeOf$1(target);
378
137
  }
379
- var newProto = target[str__Proto] || target[strShimPrototype] || target[strConstructor];
138
+ var newProto = target[str__Proto$1] || target[strShimPrototype] || target[strConstructor];
380
139
  if (newProto) {
381
140
  return newProto;
382
141
  }
@@ -468,7 +227,7 @@
468
227
  function isPlainObject(value) {
469
228
  var result = false;
470
229
  if (value && typeof value === "object") {
471
- var proto = _objGetPrototypeOf ? _objGetPrototypeOf(value) : _getObjProto(value);
230
+ var proto = _objGetPrototypeOf$1 ? _objGetPrototypeOf$1(value) : _getObjProto$1(value);
472
231
  if (!proto) {
473
232
  result = true;
474
233
  }
@@ -590,130 +349,378 @@
590
349
  if (getProp) {
591
350
  descriptor.get = getProp;
592
351
  }
593
- if (setProp) {
594
- descriptor.set = setProp;
352
+ if (setProp) {
353
+ descriptor.set = setProp;
354
+ }
355
+ _objDefineProperty$1(target, prop, descriptor);
356
+ return true;
357
+ }
358
+ catch (e) {
359
+ }
360
+ }
361
+ return false;
362
+ }
363
+ function _doNothing(value) {
364
+ return value;
365
+ }
366
+ function deepFreeze(obj) {
367
+ if (_objFreeze) {
368
+ objForEachKey(obj, function (name, value) {
369
+ if (isArray(value) || isObject(value)) {
370
+ _objFreeze(value);
371
+ }
372
+ });
373
+ }
374
+ return objFreeze(obj);
375
+ }
376
+ var objFreeze = _objFreeze || _doNothing;
377
+ function dateNow() {
378
+ var dt = Date;
379
+ return dt.now ? dt.now() : new dt().getTime();
380
+ }
381
+ function getExceptionName(object) {
382
+ if (isError(object)) {
383
+ return object.name;
384
+ }
385
+ return strEmpty$1;
386
+ }
387
+ function setValue(target, field, value, valChk, srcChk) {
388
+ var theValue = value;
389
+ if (target) {
390
+ theValue = target[field];
391
+ if (theValue !== value && (!srcChk || srcChk(theValue)) && (!valChk || valChk(value))) {
392
+ theValue = value;
393
+ target[field] = theValue;
394
+ }
395
+ }
396
+ return theValue;
397
+ }
398
+ function isTruthy(value) {
399
+ return !!value;
400
+ }
401
+ function throwError(message) {
402
+ throw new Error(message);
403
+ }
404
+ function _createProxyFunction(source, funcName) {
405
+ var srcFunc = null;
406
+ var src = null;
407
+ if (isFunction(source)) {
408
+ srcFunc = source;
409
+ }
410
+ else {
411
+ src = source;
412
+ }
413
+ return function () {
414
+ var originalArguments = arguments;
415
+ if (srcFunc) {
416
+ src = srcFunc();
417
+ }
418
+ if (src) {
419
+ return src[funcName].apply(src, originalArguments);
420
+ }
421
+ };
422
+ }
423
+ function proxyFunctionAs(target, name, source, theFunc, overwriteTarget) {
424
+ if (target && name && source) {
425
+ if (overwriteTarget !== false || isUndefined(target[name])) {
426
+ target[name] = _createProxyFunction(source, theFunc);
427
+ }
428
+ }
429
+ }
430
+ function objExtend(obj1, obj2, obj3, obj4, obj5, obj6) {
431
+ var theArgs = arguments;
432
+ var extended = theArgs[0] || {};
433
+ var argLen = theArgs.length;
434
+ var deep = false;
435
+ var idx = 1;
436
+ if (argLen > 0 && isBoolean(extended)) {
437
+ deep = extended;
438
+ extended = theArgs[idx] || {};
439
+ idx++;
440
+ }
441
+ if (!isObject(extended)) {
442
+ extended = {};
443
+ }
444
+ for (; idx < argLen; idx++) {
445
+ var arg = theArgs[idx];
446
+ var isArgArray = isArray(arg);
447
+ var isArgObj = isObject(arg);
448
+ for (var prop in arg) {
449
+ var propOk = (isArgArray && (prop in arg)) || (isArgObj && (ObjHasOwnProperty.call(arg, prop)));
450
+ if (!propOk) {
451
+ continue;
452
+ }
453
+ var newValue = arg[prop];
454
+ var isNewArray = void 0;
455
+ if (deep && newValue && ((isNewArray = isArray(newValue)) || isPlainObject(newValue))) {
456
+ var clone = extended[prop];
457
+ if (isNewArray) {
458
+ if (!isArray(clone)) {
459
+ clone = [];
460
+ }
461
+ }
462
+ else if (!isPlainObject(clone)) {
463
+ clone = {};
464
+ }
465
+ newValue = objExtend(deep, clone, newValue);
466
+ }
467
+ if (newValue !== undefined) {
468
+ extended[prop] = newValue;
469
+ }
470
+ }
471
+ }
472
+ return extended;
473
+ }
474
+
475
+ function createEnumStyle(values) {
476
+ var enumClass = {};
477
+ objForEachKey(values, function (field, value) {
478
+ enumClass[field] = value;
479
+ enumClass[value] = field;
480
+ });
481
+ return deepFreeze(enumClass);
482
+ }
483
+
484
+ /*!
485
+ * Microsoft Dynamic Proto Utility, 1.1.4
486
+ * Copyright (c) Microsoft and contributors. All rights reserved.
487
+ */
488
+ var Constructor = 'constructor';
489
+ var Prototype = 'prototype';
490
+ var strFunction = 'function';
491
+ var DynInstFuncTable = '_dynInstFuncs';
492
+ var DynProxyTag = '_isDynProxy';
493
+ var DynClassName = '_dynClass';
494
+ var DynClassNamePrefix = '_dynCls$';
495
+ var DynInstChkTag = '_dynInstChk';
496
+ var DynAllowInstChkTag = DynInstChkTag;
497
+ var DynProtoDefaultOptions = '_dfOpts';
498
+ var UnknownValue = '_unknown_';
499
+ var str__Proto = "__proto__";
500
+ var strUseBaseInst = 'useBaseInst';
501
+ var strSetInstFuncs = 'setInstFuncs';
502
+ var Obj = Object;
503
+ var _objGetPrototypeOf = Obj["getPrototypeOf"];
504
+ var _dynamicNames = 0;
505
+ function _hasOwnProperty(obj, prop) {
506
+ return obj && Obj[Prototype].hasOwnProperty.call(obj, prop);
507
+ }
508
+ function _isObjectOrArrayPrototype(target) {
509
+ return target && (target === Obj[Prototype] || target === Array[Prototype]);
510
+ }
511
+ function _isObjectArrayOrFunctionPrototype(target) {
512
+ return _isObjectOrArrayPrototype(target) || target === Function[Prototype];
513
+ }
514
+ function _getObjProto(target) {
515
+ if (target) {
516
+ if (_objGetPrototypeOf) {
517
+ return _objGetPrototypeOf(target);
518
+ }
519
+ var newProto = target[str__Proto] || target[Prototype] || (target[Constructor] ? target[Constructor][Prototype] : null);
520
+ if (newProto) {
521
+ return newProto;
522
+ }
523
+ }
524
+ return null;
525
+ }
526
+ function _forEachProp(target, func) {
527
+ var props = [];
528
+ var getOwnProps = Obj["getOwnPropertyNames"];
529
+ if (getOwnProps) {
530
+ props = getOwnProps(target);
531
+ }
532
+ else {
533
+ for (var name_1 in target) {
534
+ if (typeof name_1 === "string" && _hasOwnProperty(target, name_1)) {
535
+ props.push(name_1);
536
+ }
537
+ }
538
+ }
539
+ if (props && props.length > 0) {
540
+ for (var lp = 0; lp < props.length; lp++) {
541
+ func(props[lp]);
542
+ }
543
+ }
544
+ }
545
+ function _isDynamicCandidate(target, funcName, skipOwn) {
546
+ return (funcName !== Constructor && typeof target[funcName] === strFunction && (skipOwn || _hasOwnProperty(target, funcName)));
547
+ }
548
+ function _throwTypeError(message) {
549
+ throw new TypeError("DynamicProto: " + message);
550
+ }
551
+ function _getInstanceFuncs(thisTarget) {
552
+ var instFuncs = {};
553
+ _forEachProp(thisTarget, function (name) {
554
+ if (!instFuncs[name] && _isDynamicCandidate(thisTarget, name, false)) {
555
+ instFuncs[name] = thisTarget[name];
556
+ }
557
+ });
558
+ return instFuncs;
559
+ }
560
+ function _hasVisited(values, value) {
561
+ for (var lp = values.length - 1; lp >= 0; lp--) {
562
+ if (values[lp] === value) {
563
+ return true;
564
+ }
565
+ }
566
+ return false;
567
+ }
568
+ function _getBaseFuncs(classProto, thisTarget, instFuncs, useBaseInst) {
569
+ function _instFuncProxy(target, funcHost, funcName) {
570
+ var theFunc = funcHost[funcName];
571
+ if (theFunc[DynProxyTag] && useBaseInst) {
572
+ var instFuncTable = target[DynInstFuncTable] || {};
573
+ if (instFuncTable[DynAllowInstChkTag] !== false) {
574
+ theFunc = (instFuncTable[funcHost[DynClassName]] || {})[funcName] || theFunc;
575
+ }
576
+ }
577
+ return function () {
578
+ return theFunc.apply(target, arguments);
579
+ };
580
+ }
581
+ var baseFuncs = {};
582
+ _forEachProp(instFuncs, function (name) {
583
+ baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name);
584
+ });
585
+ var baseProto = _getObjProto(classProto);
586
+ var visited = [];
587
+ while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) {
588
+ _forEachProp(baseProto, function (name) {
589
+ if (!baseFuncs[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf)) {
590
+ baseFuncs[name] = _instFuncProxy(thisTarget, baseProto, name);
591
+ }
592
+ });
593
+ visited.push(baseProto);
594
+ baseProto = _getObjProto(baseProto);
595
+ }
596
+ return baseFuncs;
597
+ }
598
+ function _getInstFunc(target, funcName, proto, currentDynProtoProxy) {
599
+ var instFunc = null;
600
+ if (target && _hasOwnProperty(proto, DynClassName)) {
601
+ var instFuncTable = target[DynInstFuncTable] || {};
602
+ instFunc = (instFuncTable[proto[DynClassName]] || {})[funcName];
603
+ if (!instFunc) {
604
+ _throwTypeError("Missing [" + funcName + "] " + strFunction);
605
+ }
606
+ if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) {
607
+ var canAddInst = !_hasOwnProperty(target, funcName);
608
+ var objProto = _getObjProto(target);
609
+ var visited = [];
610
+ while (canAddInst && objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) {
611
+ var protoFunc = objProto[funcName];
612
+ if (protoFunc) {
613
+ canAddInst = (protoFunc === currentDynProtoProxy);
614
+ break;
615
+ }
616
+ visited.push(objProto);
617
+ objProto = _getObjProto(objProto);
618
+ }
619
+ try {
620
+ if (canAddInst) {
621
+ target[funcName] = instFunc;
622
+ }
623
+ instFunc[DynInstChkTag] = 1;
624
+ }
625
+ catch (e) {
626
+ instFuncTable[DynAllowInstChkTag] = false;
595
627
  }
596
- _objDefineProperty$1(target, prop, descriptor);
597
- return true;
598
- }
599
- catch (e) {
600
628
  }
601
629
  }
602
- return false;
603
- }
604
- function _doNothing(value) {
605
- return value;
606
- }
607
- var objFreeze = _objFreeze || _doNothing;
608
- function dateNow() {
609
- var dt = Date;
610
- return dt.now ? dt.now() : new dt().getTime();
630
+ return instFunc;
611
631
  }
612
- function getExceptionName(object) {
613
- if (isError(object)) {
614
- return object.name;
632
+ function _getProtoFunc(funcName, proto, currentDynProtoProxy) {
633
+ var protoFunc = proto[funcName];
634
+ if (protoFunc === currentDynProtoProxy) {
635
+ protoFunc = _getObjProto(proto)[funcName];
615
636
  }
616
- return strEmpty$1;
617
- }
618
- function setValue(target, field, value, valChk, srcChk) {
619
- var theValue = value;
620
- if (target) {
621
- theValue = target[field];
622
- if (theValue !== value && (!srcChk || srcChk(theValue)) && (!valChk || valChk(value))) {
623
- theValue = value;
624
- target[field] = theValue;
625
- }
637
+ if (typeof protoFunc !== strFunction) {
638
+ _throwTypeError("[" + funcName + "] is not a " + strFunction);
626
639
  }
627
- return theValue;
628
- }
629
- function isTruthy(value) {
630
- return !!value;
631
- }
632
- function throwError(message) {
633
- throw new Error(message);
640
+ return protoFunc;
634
641
  }
635
- function _createProxyFunction(source, funcName) {
636
- var srcFunc = null;
637
- var src = null;
638
- if (isFunction(source)) {
639
- srcFunc = source;
640
- }
641
- else {
642
- src = source;
642
+ function _populatePrototype(proto, className, target, baseInstFuncs, setInstanceFunc) {
643
+ function _createDynamicPrototype(proto, funcName) {
644
+ var dynProtoProxy = function () {
645
+ var instFunc = _getInstFunc(this, funcName, proto, dynProtoProxy) || _getProtoFunc(funcName, proto, dynProtoProxy);
646
+ return instFunc.apply(this, arguments);
647
+ };
648
+ dynProtoProxy[DynProxyTag] = 1;
649
+ return dynProtoProxy;
643
650
  }
644
- return function () {
645
- var originalArguments = arguments;
646
- if (srcFunc) {
647
- src = srcFunc();
648
- }
649
- if (src) {
650
- return src[funcName].apply(src, originalArguments);
651
+ if (!_isObjectOrArrayPrototype(proto)) {
652
+ var instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || {};
653
+ var instFuncs_1 = instFuncTable[className] = (instFuncTable[className] || {});
654
+ if (instFuncTable[DynAllowInstChkTag] !== false) {
655
+ instFuncTable[DynAllowInstChkTag] = !!setInstanceFunc;
651
656
  }
652
- };
657
+ _forEachProp(target, function (name) {
658
+ if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name]) {
659
+ instFuncs_1[name] = target[name];
660
+ delete target[name];
661
+ if (!_hasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) {
662
+ proto[name] = _createDynamicPrototype(proto, name);
663
+ }
664
+ }
665
+ });
666
+ }
653
667
  }
654
- function proxyFunctionAs(target, name, source, theFunc, overwriteTarget) {
655
- if (overwriteTarget === void 0) { overwriteTarget = true; }
656
- if (target && name && source) {
657
- if (overwriteTarget || isUndefined(target[name])) {
658
- target[name] = _createProxyFunction(source, theFunc);
668
+ function _checkPrototype(classProto, thisTarget) {
669
+ if (_objGetPrototypeOf) {
670
+ var visited = [];
671
+ var thisProto = _getObjProto(thisTarget);
672
+ while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto) && !_hasVisited(visited, thisProto)) {
673
+ if (thisProto === classProto) {
674
+ return true;
675
+ }
676
+ visited.push(thisProto);
677
+ thisProto = _getObjProto(thisProto);
659
678
  }
660
679
  }
680
+ return false;
661
681
  }
662
- function createEnumStyle(values) {
663
- var enumClass = {};
664
- objForEachKey(values, function (field, value) {
665
- enumClass[field] = value;
666
- if (!isUndefined(enumClass[value])) {
667
- throwError("[" + value + "] exists for " + field);
668
- }
669
- enumClass[value] = field;
670
- });
671
- return objFreeze(enumClass);
682
+ function _getObjName(target, unknownValue) {
683
+ if (_hasOwnProperty(target, Prototype)) {
684
+ return target.name || unknownValue || UnknownValue;
685
+ }
686
+ return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue;
672
687
  }
673
- function objExtend(obj1, obj2, obj3, obj4, obj5, obj6) {
674
- var theArgs = arguments;
675
- var extended = theArgs[0] || {};
676
- var argLen = theArgs.length;
677
- var deep = false;
678
- var idx = 1;
679
- if (argLen > 0 && isBoolean(extended)) {
680
- deep = extended;
681
- extended = theArgs[idx] || {};
682
- idx++;
688
+ function dynamicProto(theClass, target, delegateFunc, options) {
689
+ if (!_hasOwnProperty(theClass, Prototype)) {
690
+ _throwTypeError("theClass is an invalid class definition.");
683
691
  }
684
- if (!isObject(extended)) {
685
- extended = {};
692
+ var classProto = theClass[Prototype];
693
+ if (!_checkPrototype(classProto, target)) {
694
+ _throwTypeError("[" + _getObjName(theClass) + "] is not in class hierarchy of [" + _getObjName(target) + "]");
686
695
  }
687
- for (; idx < argLen; idx++) {
688
- var arg = theArgs[idx];
689
- var isArgArray = isArray(arg);
690
- var isArgObj = isObject(arg);
691
- for (var prop in arg) {
692
- var propOk = (isArgArray && (prop in arg)) || (isArgObj && (ObjHasOwnProperty.call(arg, prop)));
693
- if (!propOk) {
694
- continue;
695
- }
696
- var newValue = arg[prop];
697
- var isNewArray = void 0;
698
- if (deep && newValue && ((isNewArray = isArray(newValue)) || isPlainObject(newValue))) {
699
- var clone = extended[prop];
700
- if (isNewArray) {
701
- if (!isArray(clone)) {
702
- clone = [];
703
- }
704
- }
705
- else if (!isPlainObject(clone)) {
706
- clone = {};
707
- }
708
- newValue = objExtend(deep, clone, newValue);
709
- }
710
- if (newValue !== undefined) {
711
- extended[prop] = newValue;
712
- }
713
- }
696
+ var className = null;
697
+ if (_hasOwnProperty(classProto, DynClassName)) {
698
+ className = classProto[DynClassName];
714
699
  }
715
- return extended;
700
+ else {
701
+ className = DynClassNamePrefix + _getObjName(theClass, "_") + "$" + _dynamicNames;
702
+ _dynamicNames++;
703
+ classProto[DynClassName] = className;
704
+ }
705
+ var perfOptions = dynamicProto[DynProtoDefaultOptions];
706
+ var useBaseInst = !!perfOptions[strUseBaseInst];
707
+ if (useBaseInst && options && options[strUseBaseInst] !== undefined) {
708
+ useBaseInst = !!options[strUseBaseInst];
709
+ }
710
+ var instFuncs = _getInstanceFuncs(target);
711
+ var baseFuncs = _getBaseFuncs(classProto, target, instFuncs, useBaseInst);
712
+ delegateFunc(target, baseFuncs);
713
+ var setInstanceFunc = !!_objGetPrototypeOf && !!perfOptions[strSetInstFuncs];
714
+ if (setInstanceFunc && options) {
715
+ setInstanceFunc = !!options[strSetInstFuncs];
716
+ }
717
+ _populatePrototype(classProto, className, target, instFuncs, setInstanceFunc !== false);
716
718
  }
719
+ var perfDefaults = {
720
+ setInstFuncs: true,
721
+ useBaseInst: true
722
+ };
723
+ dynamicProto[DynProtoDefaultOptions] = perfDefaults;
717
724
 
718
725
  var strWindow = "window";
719
726
  var strDocument = "document";
@@ -1000,10 +1007,16 @@
1000
1007
  }
1001
1008
  return DiagnosticLogger;
1002
1009
  }());
1010
+ function _getLogger(logger) {
1011
+ return (logger || new DiagnosticLogger());
1012
+ }
1003
1013
  function _throwInternal(logger, severity, msgId, msg, properties, isUserAct) {
1004
1014
  if (isUserAct === void 0) { isUserAct = false; }
1005
1015
  (logger || new DiagnosticLogger()).throwInternal(severity, msgId, msg, properties, isUserAct);
1006
1016
  }
1017
+ function _warnToConsole(logger, message) {
1018
+ _getLogger(logger).warnToConsole(message);
1019
+ }
1007
1020
 
1008
1021
  var strExecutionContextKey = "ctx";
1009
1022
  var PerfEvent = /** @class */ (function () {
@@ -1186,7 +1199,7 @@
1186
1199
  }
1187
1200
 
1188
1201
  var _objDefineProperty = ObjDefineProperty;
1189
- var version = "2.8.0-beta.2203-16";
1202
+ var version = "2.8.0-nightly.2204-05";
1190
1203
  var instanceName = "." + newId(6);
1191
1204
  var _dataUid = 0;
1192
1205
  function _createAccessor(target, prop, value) {
@@ -2213,95 +2226,6 @@
2213
2226
  return oct.substr(0, 8) + oct.substr(9, 4) + "4" + oct.substr(13, 3) + clockSequenceHi + oct.substr(16, 3) + oct.substr(19, 12);
2214
2227
  }
2215
2228
 
2216
- var LoggingSeverity = createEnumStyle({
2217
- CRITICAL: 1 ,
2218
- WARNING: 2
2219
- });
2220
- var _InternalMessageId = createEnumStyle({
2221
- BrowserDoesNotSupportLocalStorage: 0 ,
2222
- BrowserCannotReadLocalStorage: 1 ,
2223
- BrowserCannotReadSessionStorage: 2 ,
2224
- BrowserCannotWriteLocalStorage: 3 ,
2225
- BrowserCannotWriteSessionStorage: 4 ,
2226
- BrowserFailedRemovalFromLocalStorage: 5 ,
2227
- BrowserFailedRemovalFromSessionStorage: 6 ,
2228
- CannotSendEmptyTelemetry: 7 ,
2229
- ClientPerformanceMathError: 8 ,
2230
- ErrorParsingAISessionCookie: 9 ,
2231
- ErrorPVCalc: 10 ,
2232
- ExceptionWhileLoggingError: 11 ,
2233
- FailedAddingTelemetryToBuffer: 12 ,
2234
- FailedMonitorAjaxAbort: 13 ,
2235
- FailedMonitorAjaxDur: 14 ,
2236
- FailedMonitorAjaxOpen: 15 ,
2237
- FailedMonitorAjaxRSC: 16 ,
2238
- FailedMonitorAjaxSend: 17 ,
2239
- FailedMonitorAjaxGetCorrelationHeader: 18 ,
2240
- FailedToAddHandlerForOnBeforeUnload: 19 ,
2241
- FailedToSendQueuedTelemetry: 20 ,
2242
- FailedToReportDataLoss: 21 ,
2243
- FlushFailed: 22 ,
2244
- MessageLimitPerPVExceeded: 23 ,
2245
- MissingRequiredFieldSpecification: 24 ,
2246
- NavigationTimingNotSupported: 25 ,
2247
- OnError: 26 ,
2248
- SessionRenewalDateIsZero: 27 ,
2249
- SenderNotInitialized: 28 ,
2250
- StartTrackEventFailed: 29 ,
2251
- StopTrackEventFailed: 30 ,
2252
- StartTrackFailed: 31 ,
2253
- StopTrackFailed: 32 ,
2254
- TelemetrySampledAndNotSent: 33 ,
2255
- TrackEventFailed: 34 ,
2256
- TrackExceptionFailed: 35 ,
2257
- TrackMetricFailed: 36 ,
2258
- TrackPVFailed: 37 ,
2259
- TrackPVFailedCalc: 38 ,
2260
- TrackTraceFailed: 39 ,
2261
- TransmissionFailed: 40 ,
2262
- FailedToSetStorageBuffer: 41 ,
2263
- FailedToRestoreStorageBuffer: 42 ,
2264
- InvalidBackendResponse: 43 ,
2265
- FailedToFixDepricatedValues: 44 ,
2266
- InvalidDurationValue: 45 ,
2267
- TelemetryEnvelopeInvalid: 46 ,
2268
- CreateEnvelopeError: 47 ,
2269
- CannotSerializeObject: 48 ,
2270
- CannotSerializeObjectNonSerializable: 49 ,
2271
- CircularReferenceDetected: 50 ,
2272
- ClearAuthContextFailed: 51 ,
2273
- ExceptionTruncated: 52 ,
2274
- IllegalCharsInName: 53 ,
2275
- ItemNotInArray: 54 ,
2276
- MaxAjaxPerPVExceeded: 55 ,
2277
- MessageTruncated: 56 ,
2278
- NameTooLong: 57 ,
2279
- SampleRateOutOfRange: 58 ,
2280
- SetAuthContextFailed: 59 ,
2281
- SetAuthContextFailedAccountName: 60 ,
2282
- StringValueTooLong: 61 ,
2283
- StartCalledMoreThanOnce: 62 ,
2284
- StopCalledWithoutStart: 63 ,
2285
- TelemetryInitializerFailed: 64 ,
2286
- TrackArgumentsNotSpecified: 65 ,
2287
- UrlTooLong: 66 ,
2288
- SessionStorageBufferFull: 67 ,
2289
- CannotAccessCookie: 68 ,
2290
- IdTooLong: 69 ,
2291
- InvalidEvent: 70 ,
2292
- FailedMonitorAjaxSetRequestHeader: 71 ,
2293
- SendBrowserInfoOnUserInit: 72 ,
2294
- PluginException: 73 ,
2295
- NotificationException: 74 ,
2296
- SnippetScriptLoadFailure: 99 ,
2297
- InvalidInstrumentationKey: 100 ,
2298
- CannotParseAiBlobValue: 101 ,
2299
- InvalidContentBlob: 102 ,
2300
- TrackPageActionEventFailed: 103 ,
2301
- FailedAddingCustomDefinedRequestContext: 104 ,
2302
- InMemoryStorageBufferFull: 105
2303
- });
2304
-
2305
2229
  var aiInstrumentHooks = "_aiHooks";
2306
2230
  var cbNames = [
2307
2231
  "req", "rsp", "hkErr", "fnErr"
@@ -2393,7 +2317,7 @@
2393
2317
  owner = target;
2394
2318
  }
2395
2319
  else if (checkPrototype) {
2396
- owner = _getOwner(_getObjProto(target), name, false);
2320
+ owner = _getOwner(_getObjProto$1(target), name, false);
2397
2321
  }
2398
2322
  }
2399
2323
  return owner;
@@ -2459,7 +2383,7 @@
2459
2383
  name = strTrim(name.toString());
2460
2384
  if (name.length > 150 ) {
2461
2385
  nameTrunc = name.substring(0, 150 );
2462
- _throwInternal(logger, 2 , _InternalMessageId.NameTooLong, "name is too long. It has been truncated to " + 150 + " characters.", { name: name }, true);
2386
+ _throwInternal(logger, 2 , 57 , "name is too long. It has been truncated to " + 150 + " characters.", { name: name }, true);
2463
2387
  }
2464
2388
  }
2465
2389
  return nameTrunc || name;
@@ -2472,20 +2396,20 @@
2472
2396
  value = strTrim(value);
2473
2397
  if (value.toString().length > maxLength) {
2474
2398
  valueTrunc = value.toString().substring(0, maxLength);
2475
- _throwInternal(logger, 2 , _InternalMessageId.StringValueTooLong, "string value is too long. It has been truncated to " + maxLength + " characters.", { value: value }, true);
2399
+ _throwInternal(logger, 2 , 61 , "string value is too long. It has been truncated to " + maxLength + " characters.", { value: value }, true);
2476
2400
  }
2477
2401
  }
2478
2402
  return valueTrunc || value;
2479
2403
  }
2480
2404
  function dataSanitizeUrl(logger, url) {
2481
- return dataSanitizeInput(logger, url, 2048 , _InternalMessageId.UrlTooLong);
2405
+ return dataSanitizeInput(logger, url, 2048 , 66 );
2482
2406
  }
2483
2407
  function dataSanitizeMessage(logger, message) {
2484
2408
  var messageTrunc;
2485
2409
  if (message) {
2486
2410
  if (message.length > 32768 ) {
2487
2411
  messageTrunc = message.substring(0, 32768 );
2488
- _throwInternal(logger, 2 , _InternalMessageId.MessageTruncated, "message is too long, it has been truncated to " + 32768 + " characters.", { message: message }, true);
2412
+ _throwInternal(logger, 2 , 56 , "message is too long, it has been truncated to " + 32768 + " characters.", { message: message }, true);
2489
2413
  }
2490
2414
  }
2491
2415
  return messageTrunc || message;
@@ -2496,7 +2420,7 @@
2496
2420
  var value = "" + exception;
2497
2421
  if (value.length > 32768 ) {
2498
2422
  exceptionTrunc = value.substring(0, 32768 );
2499
- _throwInternal(logger, 2 , _InternalMessageId.ExceptionTruncated, "exception is too long, it has been truncated to " + 32768 + " characters.", { exception: exception }, true);
2423
+ _throwInternal(logger, 2 , 52 , "exception is too long, it has been truncated to " + 32768 + " characters.", { exception: exception }, true);
2500
2424
  }
2501
2425
  }
2502
2426
  return exceptionTrunc || exception;
@@ -2510,7 +2434,7 @@
2510
2434
  value = getJSON().stringify(value);
2511
2435
  }
2512
2436
  catch (e) {
2513
- _throwInternal(logger, 2 , _InternalMessageId.CannotSerializeObjectNonSerializable, "custom property is not valid", { exception: e }, true);
2437
+ _throwInternal(logger, 2 , 49 , "custom property is not valid", { exception: e }, true);
2514
2438
  }
2515
2439
  }
2516
2440
  value = dataSanitizeString(logger, value, 8192 );
@@ -2533,7 +2457,7 @@
2533
2457
  return measurements;
2534
2458
  }
2535
2459
  function dataSanitizeId(logger, id) {
2536
- return id ? dataSanitizeInput(logger, id, 128 , _InternalMessageId.IdTooLong).toString() : id;
2460
+ return id ? dataSanitizeInput(logger, id, 128 , 69 ).toString() : id;
2537
2461
  }
2538
2462
  function dataSanitizeInput(logger, input, maxLength, _msgId) {
2539
2463
  var inputTrunc;
@@ -2661,7 +2585,7 @@
2661
2585
  }
2662
2586
  catch (e) {
2663
2587
  _canUseSessionStorage = false;
2664
- _throwInternal(logger, 2 , _InternalMessageId.BrowserCannotReadSessionStorage, "Browser failed read of session storage. " + getExceptionName(e), { exception: dumpObj(e) });
2588
+ _throwInternal(logger, 2 , 2 , "Browser failed read of session storage. " + getExceptionName(e), { exception: dumpObj(e) });
2665
2589
  }
2666
2590
  }
2667
2591
  return null;
@@ -2675,7 +2599,7 @@
2675
2599
  }
2676
2600
  catch (e) {
2677
2601
  _canUseSessionStorage = false;
2678
- _throwInternal(logger, 2 , _InternalMessageId.BrowserCannotWriteSessionStorage, "Browser failed write to session storage. " + getExceptionName(e), { exception: dumpObj(e) });
2602
+ _throwInternal(logger, 2 , 4 , "Browser failed write to session storage. " + getExceptionName(e), { exception: dumpObj(e) });
2679
2603
  }
2680
2604
  }
2681
2605
  return false;
@@ -2689,7 +2613,7 @@
2689
2613
  }
2690
2614
  catch (e) {
2691
2615
  _canUseSessionStorage = false;
2692
- _throwInternal(logger, 2 , _InternalMessageId.BrowserFailedRemovalFromSessionStorage, "Browser failed removal of session storage item. " + getExceptionName(e), { exception: dumpObj(e) });
2616
+ _throwInternal(logger, 2 , 6 , "Browser failed removal of session storage item. " + getExceptionName(e), { exception: dumpObj(e) });
2693
2617
  }
2694
2618
  }
2695
2619
  return false;
@@ -2785,57 +2709,23 @@
2785
2709
  return result;
2786
2710
  }
2787
2711
 
2788
- var EventData = /** @class */ (function () {
2789
- function EventData() {
2790
- this.ver = 2;
2791
- this.properties = {};
2792
- this.measurements = {};
2793
- }
2794
- return EventData;
2795
- }());
2796
-
2797
- var Event$1 = /** @class */ (function (_super) {
2798
- __extendsFn(Event, _super);
2712
+ var Event$1 = /** @class */ (function () {
2799
2713
  function Event(logger, name, properties, measurements) {
2800
- var _this = _super.call(this) || this;
2801
- _this.aiDataContract = {
2714
+ this.aiDataContract = {
2802
2715
  ver: 1 ,
2803
2716
  name: 1 ,
2804
2717
  properties: 0 ,
2805
2718
  measurements: 0
2806
2719
  };
2807
- _this.name = dataSanitizeString(logger, name) || strNotSpecified;
2808
- _this.properties = dataSanitizeProperties(logger, properties);
2809
- _this.measurements = dataSanitizeMeasurements(logger, measurements);
2810
- return _this;
2720
+ var _self = this;
2721
+ _self.ver = 2;
2722
+ _self.name = dataSanitizeString(logger, name) || strNotSpecified;
2723
+ _self.properties = dataSanitizeProperties(logger, properties);
2724
+ _self.measurements = dataSanitizeMeasurements(logger, measurements);
2811
2725
  }
2812
2726
  Event.envelopeType = "Microsoft.ApplicationInsights.{0}.Event";
2813
2727
  Event.dataType = "EventData";
2814
2728
  return Event;
2815
- }(EventData));
2816
-
2817
- var StackFrame = /** @class */ (function () {
2818
- function StackFrame() {
2819
- }
2820
- return StackFrame;
2821
- }());
2822
-
2823
- var ExceptionData = /** @class */ (function () {
2824
- function ExceptionData() {
2825
- this.ver = 2;
2826
- this.exceptions = [];
2827
- this.properties = {};
2828
- this.measurements = {};
2829
- }
2830
- return ExceptionData;
2831
- }());
2832
-
2833
- var ExceptionDetails = /** @class */ (function () {
2834
- function ExceptionDetails() {
2835
- this.hasFullStack = true;
2836
- this.parsedStack = [];
2837
- }
2838
- return ExceptionDetails;
2839
2729
  }());
2840
2730
 
2841
2731
  var NoMethod = "<no_method>";
@@ -3079,50 +2969,48 @@
3079
2969
  }
3080
2970
  return "" + (errorObj || "");
3081
2971
  }
3082
- var Exception = /** @class */ (function (_super) {
3083
- __extendsFn(Exception, _super);
2972
+ var Exception = /** @class */ (function () {
3084
2973
  function Exception(logger, exception, properties, measurements, severityLevel, id) {
3085
- var _this = _super.call(this) || this;
3086
- _this.aiDataContract = {
2974
+ this.aiDataContract = {
3087
2975
  ver: 1 ,
3088
2976
  exceptions: 1 ,
3089
2977
  severityLevel: 0 ,
3090
2978
  properties: 0 ,
3091
2979
  measurements: 0
3092
2980
  };
2981
+ var _self = this;
2982
+ _self.ver = 2;
3093
2983
  if (!_isExceptionInternal(exception)) {
3094
2984
  if (!properties) {
3095
2985
  properties = {};
3096
2986
  }
3097
- _this.exceptions = [new _ExceptionDetails(logger, exception, properties)];
3098
- _this.properties = dataSanitizeProperties(logger, properties);
3099
- _this.measurements = dataSanitizeMeasurements(logger, measurements);
2987
+ _self.exceptions = [new _ExceptionDetails(logger, exception, properties)];
2988
+ _self.properties = dataSanitizeProperties(logger, properties);
2989
+ _self.measurements = dataSanitizeMeasurements(logger, measurements);
3100
2990
  if (severityLevel) {
3101
- _this.severityLevel = severityLevel;
2991
+ _self.severityLevel = severityLevel;
3102
2992
  }
3103
2993
  if (id) {
3104
- _this.id = id;
2994
+ _self.id = id;
3105
2995
  }
3106
2996
  }
3107
2997
  else {
3108
- _this.exceptions = exception.exceptions;
3109
- _this.properties = exception.properties;
3110
- _this.measurements = exception.measurements;
2998
+ _self.exceptions = exception.exceptions || [];
2999
+ _self.properties = exception.properties;
3000
+ _self.measurements = exception.measurements;
3111
3001
  if (exception.severityLevel) {
3112
- _this.severityLevel = exception.severityLevel;
3002
+ _self.severityLevel = exception.severityLevel;
3113
3003
  }
3114
3004
  if (exception.id) {
3115
- _this.id = exception.id;
3005
+ _self.id = exception.id;
3116
3006
  }
3117
3007
  if (exception.problemGroup) {
3118
- _this.problemGroup = exception.problemGroup;
3008
+ _self.problemGroup = exception.problemGroup;
3119
3009
  }
3120
- _this.ver = 2;
3121
3010
  if (!isNullOrUndefined(exception.isManual)) {
3122
- _this.isManual = exception.isManual;
3011
+ _self.isManual = exception.isManual;
3123
3012
  }
3124
3013
  }
3125
- return _this;
3126
3014
  }
3127
3015
  Exception.CreateAutoException = function (message, url, lineNumber, columnNumber, error, evt, stack, errorSrc) {
3128
3016
  var errorType = _getErrorType(error || evt || message);
@@ -3176,12 +3064,10 @@
3176
3064
  Exception.dataType = "ExceptionData";
3177
3065
  Exception.formatError = _formatErrorCode;
3178
3066
  return Exception;
3179
- }(ExceptionData));
3180
- var _ExceptionDetails = /** @class */ (function (_super) {
3181
- __extendsFn(_ExceptionDetails, _super);
3067
+ }());
3068
+ var _ExceptionDetails = /** @class */ (function () {
3182
3069
  function _ExceptionDetails(logger, exception, properties) {
3183
- var _this = _super.call(this) || this;
3184
- _this.aiDataContract = {
3070
+ this.aiDataContract = {
3185
3071
  id: 0 ,
3186
3072
  outerId: 0 ,
3187
3073
  typeName: 1 ,
@@ -3190,41 +3076,42 @@
3190
3076
  stack: 0 ,
3191
3077
  parsedStack: 2
3192
3078
  };
3079
+ var _self = this;
3193
3080
  if (!_isExceptionDetailsInternal(exception)) {
3194
3081
  var error = exception;
3195
3082
  var evt = error && error.evt;
3196
3083
  if (!isError(error)) {
3197
3084
  error = error[strError] || evt || error;
3198
3085
  }
3199
- _this.typeName = dataSanitizeString(logger, _getErrorType(error)) || strNotSpecified;
3200
- _this.message = dataSanitizeMessage(logger, _formatMessage(exception || error, _this.typeName)) || strNotSpecified;
3086
+ _self.typeName = dataSanitizeString(logger, _getErrorType(error)) || strNotSpecified;
3087
+ _self.message = dataSanitizeMessage(logger, _formatMessage(exception || error, _self.typeName)) || strNotSpecified;
3201
3088
  var stack = exception[strStackDetails] || _getStackFromErrorObj(exception);
3202
- _this.parsedStack = _parseStack(stack);
3203
- _this[strStack] = dataSanitizeException(logger, _formatStackTrace(stack));
3204
- _this.hasFullStack = isArray(_this.parsedStack) && _this.parsedStack.length > 0;
3089
+ _self.parsedStack = _parseStack(stack);
3090
+ _self[strStack] = dataSanitizeException(logger, _formatStackTrace(stack));
3091
+ _self.hasFullStack = isArray(_self.parsedStack) && _self.parsedStack.length > 0;
3205
3092
  if (properties) {
3206
- properties.typeName = properties.typeName || _this.typeName;
3093
+ properties.typeName = properties.typeName || _self.typeName;
3207
3094
  }
3208
3095
  }
3209
3096
  else {
3210
- _this.typeName = exception.typeName;
3211
- _this.message = exception.message;
3212
- _this[strStack] = exception[strStack];
3213
- _this.parsedStack = exception.parsedStack;
3214
- _this.hasFullStack = exception.hasFullStack;
3097
+ _self.typeName = exception.typeName;
3098
+ _self.message = exception.message;
3099
+ _self[strStack] = exception[strStack];
3100
+ _self.parsedStack = exception.parsedStack || [];
3101
+ _self.hasFullStack = exception.hasFullStack;
3215
3102
  }
3216
- return _this;
3217
3103
  }
3218
3104
  _ExceptionDetails.prototype.toInterface = function () {
3219
- var parsedStack = this.parsedStack instanceof Array
3220
- && arrMap(this.parsedStack, function (frame) { return frame.toInterface(); });
3105
+ var _self = this;
3106
+ var parsedStack = _self.parsedStack instanceof Array
3107
+ && arrMap(_self.parsedStack, function (frame) { return frame.toInterface(); });
3221
3108
  var exceptionDetailsInterface = {
3222
- id: this.id,
3223
- outerId: this.outerId,
3224
- typeName: this.typeName,
3225
- message: this.message,
3226
- hasFullStack: this.hasFullStack,
3227
- stack: this[strStack],
3109
+ id: _self.id,
3110
+ outerId: _self.outerId,
3111
+ typeName: _self.typeName,
3112
+ message: _self.message,
3113
+ hasFullStack: _self.hasFullStack,
3114
+ stack: _self[strStack],
3228
3115
  parsedStack: parsedStack || undefined
3229
3116
  };
3230
3117
  return exceptionDetailsInterface;
@@ -3237,94 +3124,68 @@
3237
3124
  return exceptionDetails;
3238
3125
  };
3239
3126
  return _ExceptionDetails;
3240
- }(ExceptionDetails));
3241
- var _StackFrame = /** @class */ (function (_super) {
3242
- __extendsFn(_StackFrame, _super);
3127
+ }());
3128
+ var _StackFrame = /** @class */ (function () {
3243
3129
  function _StackFrame(sourceFrame, level) {
3244
- var _this = _super.call(this) || this;
3245
- _this.sizeInBytes = 0;
3246
- _this.aiDataContract = {
3130
+ this.aiDataContract = {
3247
3131
  level: 1 ,
3248
3132
  method: 1 ,
3249
3133
  assembly: 0 ,
3250
3134
  fileName: 0 ,
3251
3135
  line: 0
3252
3136
  };
3137
+ var _self = this;
3138
+ _self.sizeInBytes = 0;
3253
3139
  if (typeof sourceFrame === "string") {
3254
3140
  var frame = sourceFrame;
3255
- _this.level = level;
3256
- _this.method = NoMethod;
3257
- _this.assembly = strTrim(frame);
3258
- _this.fileName = "";
3259
- _this.line = 0;
3141
+ _self.level = level;
3142
+ _self.method = NoMethod;
3143
+ _self.assembly = strTrim(frame);
3144
+ _self.fileName = "";
3145
+ _self.line = 0;
3260
3146
  var matches = frame.match(_StackFrame.regex);
3261
3147
  if (matches && matches.length >= 5) {
3262
- _this.method = strTrim(matches[2]) || _this.method;
3263
- _this.fileName = strTrim(matches[4]);
3264
- _this.line = parseInt(matches[5]) || 0;
3148
+ _self.method = strTrim(matches[2]) || _self.method;
3149
+ _self.fileName = strTrim(matches[4]);
3150
+ _self.line = parseInt(matches[5]) || 0;
3265
3151
  }
3266
3152
  }
3267
3153
  else {
3268
- _this.level = sourceFrame.level;
3269
- _this.method = sourceFrame.method;
3270
- _this.assembly = sourceFrame.assembly;
3271
- _this.fileName = sourceFrame.fileName;
3272
- _this.line = sourceFrame.line;
3273
- _this.sizeInBytes = 0;
3274
- }
3275
- _this.sizeInBytes += _this.method.length;
3276
- _this.sizeInBytes += _this.fileName.length;
3277
- _this.sizeInBytes += _this.assembly.length;
3278
- _this.sizeInBytes += _StackFrame.baseSize;
3279
- _this.sizeInBytes += _this.level.toString().length;
3280
- _this.sizeInBytes += _this.line.toString().length;
3281
- return _this;
3154
+ _self.level = sourceFrame.level;
3155
+ _self.method = sourceFrame.method;
3156
+ _self.assembly = sourceFrame.assembly;
3157
+ _self.fileName = sourceFrame.fileName;
3158
+ _self.line = sourceFrame.line;
3159
+ _self.sizeInBytes = 0;
3160
+ }
3161
+ _self.sizeInBytes += _self.method.length;
3162
+ _self.sizeInBytes += _self.fileName.length;
3163
+ _self.sizeInBytes += _self.assembly.length;
3164
+ _self.sizeInBytes += _StackFrame.baseSize;
3165
+ _self.sizeInBytes += _self.level.toString().length;
3166
+ _self.sizeInBytes += _self.line.toString().length;
3282
3167
  }
3283
3168
  _StackFrame.CreateFromInterface = function (frame) {
3284
3169
  return new _StackFrame(frame, null );
3285
3170
  };
3286
3171
  _StackFrame.prototype.toInterface = function () {
3172
+ var _self = this;
3287
3173
  return {
3288
- level: this.level,
3289
- method: this.method,
3290
- assembly: this.assembly,
3291
- fileName: this.fileName,
3292
- line: this.line
3174
+ level: _self.level,
3175
+ method: _self.method,
3176
+ assembly: _self.assembly,
3177
+ fileName: _self.fileName,
3178
+ line: _self.line
3293
3179
  };
3294
3180
  };
3295
3181
  _StackFrame.regex = /^([\s]+at)?[\s]{0,50}([^\@\()]+?)[\s]{0,50}(\@|\()([^\(\n]+):([0-9]+):([0-9]+)(\)?)$/;
3296
3182
  _StackFrame.baseSize = 58;
3297
3183
  return _StackFrame;
3298
- }(StackFrame));
3299
-
3300
- var MetricData = /** @class */ (function () {
3301
- function MetricData() {
3302
- this.ver = 2;
3303
- this.metrics = [];
3304
- this.properties = {};
3305
- this.measurements = {};
3306
- }
3307
- return MetricData;
3308
- }());
3309
-
3310
- var DataPointType;
3311
- (function (DataPointType) {
3312
- DataPointType[DataPointType["Measurement"] = 0] = "Measurement";
3313
- DataPointType[DataPointType["Aggregation"] = 1] = "Aggregation";
3314
- })(DataPointType || (DataPointType = {}));
3315
-
3316
- var DataPoint$1 = /** @class */ (function () {
3317
- function DataPoint() {
3318
- this.kind = DataPointType.Measurement;
3319
- }
3320
- return DataPoint;
3321
3184
  }());
3322
3185
 
3323
- var DataPoint = /** @class */ (function (_super) {
3324
- __extendsFn(DataPoint, _super);
3186
+ var DataPoint = /** @class */ (function () {
3325
3187
  function DataPoint() {
3326
- var _this = _super !== null && _super.apply(this, arguments) || this;
3327
- _this.aiDataContract = {
3188
+ this.aiDataContract = {
3328
3189
  name: 1 ,
3329
3190
  kind: 0 ,
3330
3191
  value: 1 ,
@@ -3333,20 +3194,20 @@
3333
3194
  max: 0 ,
3334
3195
  stdDev: 0
3335
3196
  };
3336
- return _this;
3197
+ this.kind = 0 ;
3337
3198
  }
3338
3199
  return DataPoint;
3339
- }(DataPoint$1));
3200
+ }());
3340
3201
 
3341
- var Metric = /** @class */ (function (_super) {
3342
- __extendsFn(Metric, _super);
3202
+ var Metric = /** @class */ (function () {
3343
3203
  function Metric(logger, name, value, count, min, max, stdDev, properties, measurements) {
3344
- var _this = _super.call(this) || this;
3345
- _this.aiDataContract = {
3204
+ this.aiDataContract = {
3346
3205
  ver: 1 ,
3347
3206
  metrics: 1 ,
3348
3207
  properties: 0
3349
3208
  };
3209
+ var _self = this;
3210
+ _self.ver = 2;
3350
3211
  var dataPoint = new DataPoint();
3351
3212
  dataPoint.count = count > 0 ? count : undefined;
3352
3213
  dataPoint.max = isNaN(max) || max === null ? undefined : max;
@@ -3354,33 +3215,18 @@
3354
3215
  dataPoint.name = dataSanitizeString(logger, name) || strNotSpecified;
3355
3216
  dataPoint.value = value;
3356
3217
  dataPoint.stdDev = isNaN(stdDev) || stdDev === null ? undefined : stdDev;
3357
- _this.metrics = [dataPoint];
3358
- _this.properties = dataSanitizeProperties(logger, properties);
3359
- _this.measurements = dataSanitizeMeasurements(logger, measurements);
3360
- return _this;
3218
+ _self.metrics = [dataPoint];
3219
+ _self.properties = dataSanitizeProperties(logger, properties);
3220
+ _self.measurements = dataSanitizeMeasurements(logger, measurements);
3361
3221
  }
3362
3222
  Metric.envelopeType = "Microsoft.ApplicationInsights.{0}.Metric";
3363
3223
  Metric.dataType = "MetricData";
3364
3224
  return Metric;
3365
- }(MetricData));
3366
-
3367
- var PageViewData = /** @class */ (function (_super) {
3368
- __extendsFn(PageViewData, _super);
3369
- function PageViewData() {
3370
- var _this = _super.call(this) || this;
3371
- _this.ver = 2;
3372
- _this.properties = {};
3373
- _this.measurements = {};
3374
- return _this;
3375
- }
3376
- return PageViewData;
3377
- }(EventData));
3225
+ }());
3378
3226
 
3379
- var PageView = /** @class */ (function (_super) {
3380
- __extendsFn(PageView, _super);
3227
+ var PageView = /** @class */ (function () {
3381
3228
  function PageView(logger, name, url, durationMs, properties, measurements, id) {
3382
- var _this = _super.call(this) || this;
3383
- _this.aiDataContract = {
3229
+ this.aiDataContract = {
3384
3230
  ver: 1 ,
3385
3231
  name: 0 ,
3386
3232
  url: 0 ,
@@ -3389,37 +3235,26 @@
3389
3235
  measurements: 0 ,
3390
3236
  id: 0
3391
3237
  };
3392
- _this.id = dataSanitizeId(logger, id);
3393
- _this.url = dataSanitizeUrl(logger, url);
3394
- _this.name = dataSanitizeString(logger, name) || strNotSpecified;
3238
+ var _self = this;
3239
+ _self.ver = 2;
3240
+ _self.id = dataSanitizeId(logger, id);
3241
+ _self.url = dataSanitizeUrl(logger, url);
3242
+ _self.name = dataSanitizeString(logger, name) || strNotSpecified;
3395
3243
  if (!isNaN(durationMs)) {
3396
- _this.duration = msToTimeSpan(durationMs);
3244
+ _self.duration = msToTimeSpan(durationMs);
3397
3245
  }
3398
- _this.properties = dataSanitizeProperties(logger, properties);
3399
- _this.measurements = dataSanitizeMeasurements(logger, measurements);
3400
- return _this;
3246
+ _self.properties = dataSanitizeProperties(logger, properties);
3247
+ _self.measurements = dataSanitizeMeasurements(logger, measurements);
3401
3248
  }
3402
3249
  PageView.envelopeType = "Microsoft.ApplicationInsights.{0}.Pageview";
3403
3250
  PageView.dataType = "PageviewData";
3404
3251
  return PageView;
3405
- }(PageViewData));
3406
-
3407
- var RemoteDependencyData$1 = /** @class */ (function () {
3408
- function RemoteDependencyData() {
3409
- this.ver = 2;
3410
- this.success = true;
3411
- this.properties = {};
3412
- this.measurements = {};
3413
- }
3414
- return RemoteDependencyData;
3415
3252
  }());
3416
3253
 
3417
- var RemoteDependencyData = /** @class */ (function (_super) {
3418
- __extendsFn(RemoteDependencyData, _super);
3254
+ var RemoteDependencyData = /** @class */ (function () {
3419
3255
  function RemoteDependencyData(logger, id, absoluteUrl, commandName, value, success, resultCode, method, requestAPI, correlationContext, properties, measurements) {
3420
3256
  if (requestAPI === void 0) { requestAPI = "Ajax"; }
3421
- var _this = _super.call(this) || this;
3422
- _this.aiDataContract = {
3257
+ this.aiDataContract = {
3423
3258
  id: 1 ,
3424
3259
  ver: 1 ,
3425
3260
  name: 0 ,
@@ -3442,77 +3277,54 @@
3442
3277
  commandName: 0 ,
3443
3278
  dependencyTypeName: 0
3444
3279
  };
3445
- _this.id = id;
3446
- _this.duration = msToTimeSpan(value);
3447
- _this.success = success;
3448
- _this.resultCode = resultCode + "";
3449
- _this.type = dataSanitizeString(logger, requestAPI);
3280
+ var _self = this;
3281
+ _self.ver = 2;
3282
+ _self.id = id;
3283
+ _self.duration = msToTimeSpan(value);
3284
+ _self.success = success;
3285
+ _self.resultCode = resultCode + "";
3286
+ _self.type = dataSanitizeString(logger, requestAPI);
3450
3287
  var dependencyFields = AjaxHelperParseDependencyPath(logger, absoluteUrl, method, commandName);
3451
- _this.data = dataSanitizeUrl(logger, commandName) || dependencyFields.data;
3452
- _this.target = dataSanitizeString(logger, dependencyFields.target);
3288
+ _self.data = dataSanitizeUrl(logger, commandName) || dependencyFields.data;
3289
+ _self.target = dataSanitizeString(logger, dependencyFields.target);
3453
3290
  if (correlationContext) {
3454
- _this.target = "".concat(_this.target, " | ").concat(correlationContext);
3291
+ _self.target = "".concat(_self.target, " | ").concat(correlationContext);
3455
3292
  }
3456
- _this.name = dataSanitizeString(logger, dependencyFields.name);
3457
- _this.properties = dataSanitizeProperties(logger, properties);
3458
- _this.measurements = dataSanitizeMeasurements(logger, measurements);
3459
- return _this;
3293
+ _self.name = dataSanitizeString(logger, dependencyFields.name);
3294
+ _self.properties = dataSanitizeProperties(logger, properties);
3295
+ _self.measurements = dataSanitizeMeasurements(logger, measurements);
3460
3296
  }
3461
3297
  RemoteDependencyData.envelopeType = "Microsoft.ApplicationInsights.{0}.RemoteDependency";
3462
3298
  RemoteDependencyData.dataType = "RemoteDependencyData";
3463
3299
  return RemoteDependencyData;
3464
- }(RemoteDependencyData$1));
3465
-
3466
- var MessageData = /** @class */ (function () {
3467
- function MessageData() {
3468
- this.ver = 2;
3469
- this.properties = {};
3470
- this.measurements = {};
3471
- }
3472
- return MessageData;
3473
3300
  }());
3474
3301
 
3475
- var Trace = /** @class */ (function (_super) {
3476
- __extendsFn(Trace, _super);
3302
+ var Trace = /** @class */ (function () {
3477
3303
  function Trace(logger, message, severityLevel, properties, measurements) {
3478
- var _this = _super.call(this) || this;
3479
- _this.aiDataContract = {
3304
+ this.aiDataContract = {
3480
3305
  ver: 1 ,
3481
3306
  message: 1 ,
3482
3307
  severityLevel: 0 ,
3483
3308
  properties: 0
3484
3309
  };
3310
+ var _self = this;
3311
+ _self.ver = 2;
3485
3312
  message = message || strNotSpecified;
3486
- _this.message = dataSanitizeMessage(logger, message);
3487
- _this.properties = dataSanitizeProperties(logger, properties);
3488
- _this.measurements = dataSanitizeMeasurements(logger, measurements);
3313
+ _self.message = dataSanitizeMessage(logger, message);
3314
+ _self.properties = dataSanitizeProperties(logger, properties);
3315
+ _self.measurements = dataSanitizeMeasurements(logger, measurements);
3489
3316
  if (severityLevel) {
3490
- _this.severityLevel = severityLevel;
3317
+ _self.severityLevel = severityLevel;
3491
3318
  }
3492
- return _this;
3493
3319
  }
3494
3320
  Trace.envelopeType = "Microsoft.ApplicationInsights.{0}.Message";
3495
3321
  Trace.dataType = "MessageData";
3496
3322
  return Trace;
3497
- }(MessageData));
3498
-
3499
- var PageViewPerfData = /** @class */ (function (_super) {
3500
- __extendsFn(PageViewPerfData, _super);
3501
- function PageViewPerfData() {
3502
- var _this = _super.call(this) || this;
3503
- _this.ver = 2;
3504
- _this.properties = {};
3505
- _this.measurements = {};
3506
- return _this;
3507
- }
3508
- return PageViewPerfData;
3509
- }(PageViewData));
3323
+ }());
3510
3324
 
3511
- var PageViewPerformance = /** @class */ (function (_super) {
3512
- __extendsFn(PageViewPerformance, _super);
3325
+ var PageViewPerformance = /** @class */ (function () {
3513
3326
  function PageViewPerformance(logger, name, url, unused, properties, measurements, cs4BaseData) {
3514
- var _this = _super.call(this) || this;
3515
- _this.aiDataContract = {
3327
+ this.aiDataContract = {
3516
3328
  ver: 1 ,
3517
3329
  name: 0 ,
3518
3330
  url: 0 ,
@@ -3525,24 +3337,25 @@
3525
3337
  properties: 0 ,
3526
3338
  measurements: 0
3527
3339
  };
3528
- _this.url = dataSanitizeUrl(logger, url);
3529
- _this.name = dataSanitizeString(logger, name) || strNotSpecified;
3530
- _this.properties = dataSanitizeProperties(logger, properties);
3531
- _this.measurements = dataSanitizeMeasurements(logger, measurements);
3340
+ var _self = this;
3341
+ _self.ver = 2;
3342
+ _self.url = dataSanitizeUrl(logger, url);
3343
+ _self.name = dataSanitizeString(logger, name) || strNotSpecified;
3344
+ _self.properties = dataSanitizeProperties(logger, properties);
3345
+ _self.measurements = dataSanitizeMeasurements(logger, measurements);
3532
3346
  if (cs4BaseData) {
3533
- _this.domProcessing = cs4BaseData.domProcessing;
3534
- _this.duration = cs4BaseData.duration;
3535
- _this.networkConnect = cs4BaseData.networkConnect;
3536
- _this.perfTotal = cs4BaseData.perfTotal;
3537
- _this.receivedResponse = cs4BaseData.receivedResponse;
3538
- _this.sentRequest = cs4BaseData.sentRequest;
3347
+ _self.domProcessing = cs4BaseData.domProcessing;
3348
+ _self.duration = cs4BaseData.duration;
3349
+ _self.networkConnect = cs4BaseData.networkConnect;
3350
+ _self.perfTotal = cs4BaseData.perfTotal;
3351
+ _self.receivedResponse = cs4BaseData.receivedResponse;
3352
+ _self.sentRequest = cs4BaseData.sentRequest;
3539
3353
  }
3540
- return _this;
3541
3354
  }
3542
3355
  PageViewPerformance.envelopeType = "Microsoft.ApplicationInsights.{0}.PageviewPerformance";
3543
3356
  PageViewPerformance.dataType = "PageviewPerformanceData";
3544
3357
  return PageViewPerformance;
3545
- }(PageViewPerfData));
3358
+ }());
3546
3359
 
3547
3360
  var SeverityLevel;
3548
3361
  (function (SeverityLevel) {
@@ -3645,7 +3458,7 @@
3645
3458
  if (!pageViewPerformanceManager.isPerformanceTimingSupported()) {
3646
3459
  appInsights.sendPageViewInternal(pageView, customProperties);
3647
3460
  _flushChannels(true);
3648
- _logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.NavigationTimingNotSupported, "trackPageView: navigation timing API used for calculation of page duration is not supported in this browser. This page view will be collected without duration and timing info.");
3461
+ _throwInternal(_logger, 2 , 25 , "trackPageView: navigation timing API used for calculation of page duration is not supported in this browser. This page view will be collected without duration and timing info.");
3649
3462
  return;
3650
3463
  }
3651
3464
  var pageViewSent = false;
@@ -3711,7 +3524,7 @@
3711
3524
  }
3712
3525
  }
3713
3526
  catch (e) {
3714
- _logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TrackPVFailedCalc, "trackPageView failed on page load calculation: " + getExceptionName(e), { exception: dumpObj(e) });
3527
+ _throwInternal(_logger, 1 , 38 , "trackPageView failed on page load calculation: " + getExceptionName(e), { exception: dumpObj(e) });
3715
3528
  }
3716
3529
  return processed;
3717
3530
  });
@@ -3746,7 +3559,7 @@
3746
3559
  }
3747
3560
  }
3748
3561
  catch (e) {
3749
- this._logger.warnToConsole("Auto track page visit time failed, metric will not be collected: " + dumpObj(e));
3562
+ _warnToConsole(this._logger, "Auto track page visit time failed, metric will not be collected: " + dumpObj(e));
3750
3563
  }
3751
3564
  };
3752
3565
  PageVisitTimeManager.prototype.restartPageVisitTimer = function (pageName, pageUrl) {
@@ -3756,7 +3569,7 @@
3756
3569
  return prevPageVisitData;
3757
3570
  }
3758
3571
  catch (e) {
3759
- this._logger.warnToConsole("Call to restart failed: " + dumpObj(e));
3572
+ _warnToConsole(this._logger, "Call to restart failed: " + dumpObj(e));
3760
3573
  return null;
3761
3574
  }
3762
3575
  };
@@ -3772,7 +3585,7 @@
3772
3585
  }
3773
3586
  }
3774
3587
  catch (e) {
3775
- this._logger.warnToConsole("Call to start failed: " + dumpObj(e));
3588
+ _warnToConsole(this._logger, "Call to start failed: " + dumpObj(e));
3776
3589
  }
3777
3590
  };
3778
3591
  PageVisitTimeManager.prototype.stopPageVisitTimer = function () {
@@ -3793,7 +3606,7 @@
3793
3606
  return null;
3794
3607
  }
3795
3608
  catch (e) {
3796
- this._logger.warnToConsole("Stop page visit timer failed: " + dumpObj(e));
3609
+ _warnToConsole(this._logger, "Stop page visit timer failed: " + dumpObj(e));
3797
3610
  return null;
3798
3611
  }
3799
3612
  };
@@ -3839,14 +3652,15 @@
3839
3652
  response = dateTimeUtilsDuration(timing.responseStart, timing.responseEnd);
3840
3653
  dom = dateTimeUtilsDuration(timing.responseEnd, timing.loadEventEnd);
3841
3654
  }
3655
+ var logger = this._logger;
3842
3656
  if (total === 0) {
3843
- this._logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.ErrorPVCalc, "error calculating page view performance.", { total: total, network: network, request: request, response: response, dom: dom });
3657
+ _throwInternal(logger, 2 , 10 , "error calculating page view performance.", { total: total, network: network, request: request, response: response, dom: dom });
3844
3658
  }
3845
3659
  else if (!this.shouldCollectDuration(total, network, request, response, dom)) {
3846
- this._logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.InvalidDurationValue, "Invalid page load duration value. Browser perf data won't be sent.", { total: total, network: network, request: request, response: response, dom: dom });
3660
+ _throwInternal(logger, 2 , 45 , "Invalid page load duration value. Browser perf data won't be sent.", { total: total, network: network, request: request, response: response, dom: dom });
3847
3661
  }
3848
3662
  else if (total < Math.floor(network) + Math.floor(request) + Math.floor(response) + Math.floor(dom)) {
3849
- this._logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.ClientPerformanceMathError, "client performance math error.", { total: total, network: network, request: request, response: response, dom: dom });
3663
+ _throwInternal(logger, 2 , 8 , "client performance math error.", { total: total, network: network, request: request, response: response, dom: dom });
3850
3664
  }
3851
3665
  else {
3852
3666
  pageViewPerformance.durationMs = total;
@@ -3927,14 +3741,14 @@
3927
3741
  var _events = {};
3928
3742
  _self.start = function (name) {
3929
3743
  if (typeof _events[name] !== "undefined") {
3930
- _throwInternal(logger, LoggingSeverity.WARNING, _InternalMessageId.StartCalledMoreThanOnce, "start was called more than once for this event without calling stop.", { name: name, key: name }, true);
3744
+ _throwInternal(logger, 2 , 62 , "start was called more than once for this event without calling stop.", { name: name, key: name }, true);
3931
3745
  }
3932
3746
  _events[name] = +new Date;
3933
3747
  };
3934
3748
  _self.stop = function (name, url, properties, measurements) {
3935
3749
  var start = _events[name];
3936
3750
  if (isNaN(start)) {
3937
- _throwInternal(logger, LoggingSeverity.WARNING, _InternalMessageId.StopCalledWithoutStart, "stop was called without a corresponding start.", { name: name, key: name }, true);
3751
+ _throwInternal(logger, 2 , 63 , "stop was called without a corresponding start.", { name: name, key: name }, true);
3938
3752
  }
3939
3753
  else {
3940
3754
  var end = +new Date;
@@ -4044,7 +3858,7 @@
4044
3858
  _self.core.track(telemetryItem);
4045
3859
  }
4046
3860
  catch (e) {
4047
- _throwInternal(LoggingSeverity.WARNING, _InternalMessageId.TrackTraceFailed, "trackTrace failed, trace will not be collected: " + getExceptionName(e), { exception: dumpObj(e) });
3861
+ _throwInternal(2 , 39 , "trackTrace failed, trace will not be collected: " + getExceptionName(e), { exception: dumpObj(e) });
4048
3862
  }
4049
3863
  };
4050
3864
  _self.startTrackEvent = function (name) {
@@ -4052,7 +3866,7 @@
4052
3866
  _eventTracking.start(name);
4053
3867
  }
4054
3868
  catch (e) {
4055
- _throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.StartTrackEventFailed, "startTrackEvent failed, event will not be collected: " + getExceptionName(e), { exception: dumpObj(e) });
3869
+ _throwInternal(1 , 29 , "startTrackEvent failed, event will not be collected: " + getExceptionName(e), { exception: dumpObj(e) });
4056
3870
  }
4057
3871
  };
4058
3872
  _self.stopTrackEvent = function (name, properties, measurements) {
@@ -4060,7 +3874,7 @@
4060
3874
  _eventTracking.stop(name, undefined, properties);
4061
3875
  }
4062
3876
  catch (e) {
4063
- _throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.StopTrackEventFailed, "stopTrackEvent failed, event will not be collected: " + getExceptionName(e), { exception: dumpObj(e) });
3877
+ _throwInternal(1 , 30 , "stopTrackEvent failed, event will not be collected: " + getExceptionName(e), { exception: dumpObj(e) });
4064
3878
  }
4065
3879
  };
4066
3880
  _self.trackTrace = function (trace, customProperties) {
@@ -4069,7 +3883,7 @@
4069
3883
  _self.core.track(telemetryItem);
4070
3884
  }
4071
3885
  catch (e) {
4072
- _throwInternal(LoggingSeverity.WARNING, _InternalMessageId.TrackTraceFailed, "trackTrace failed, trace will not be collected: " + getExceptionName(e), { exception: dumpObj(e) });
3886
+ _throwInternal(2 , 39 , "trackTrace failed, trace will not be collected: " + getExceptionName(e), { exception: dumpObj(e) });
4073
3887
  }
4074
3888
  };
4075
3889
  _self.trackMetric = function (metric, customProperties) {
@@ -4078,7 +3892,7 @@
4078
3892
  _self.core.track(telemetryItem);
4079
3893
  }
4080
3894
  catch (e) {
4081
- _throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TrackMetricFailed, "trackMetric failed, metric will not be collected: " + getExceptionName(e), { exception: dumpObj(e) });
3895
+ _throwInternal(1 , 36 , "trackMetric failed, metric will not be collected: " + getExceptionName(e), { exception: dumpObj(e) });
4082
3896
  }
4083
3897
  };
4084
3898
  _self.trackPageView = function (pageView, customProperties) {
@@ -4090,7 +3904,7 @@
4090
3904
  }
4091
3905
  }
4092
3906
  catch (e) {
4093
- _throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TrackPVFailed, "trackPageView failed, page view will not be collected: " + getExceptionName(e), { exception: dumpObj(e) });
3907
+ _throwInternal(1 , 37 , "trackPageView failed, page view will not be collected: " + getExceptionName(e), { exception: dumpObj(e) });
4094
3908
  }
4095
3909
  };
4096
3910
  _self.sendPageViewInternal = function (pageView, properties, systemProperties) {
@@ -4112,7 +3926,7 @@
4112
3926
  _self.sendPageViewPerformanceInternal(inPvp, customProperties);
4113
3927
  }
4114
3928
  catch (e) {
4115
- _throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TrackPVFailed, "trackPageViewPerformance failed, page view will not be collected: " + getExceptionName(e), { exception: dumpObj(e) });
3929
+ _throwInternal(1 , 37 , "trackPageViewPerformance failed, page view will not be collected: " + getExceptionName(e), { exception: dumpObj(e) });
4116
3930
  }
4117
3931
  };
4118
3932
  _self.startTrackPage = function (name) {
@@ -4124,7 +3938,7 @@
4124
3938
  _pageTracking.start(name);
4125
3939
  }
4126
3940
  catch (e) {
4127
- _throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.StartTrackFailed, "startTrackPage failed, page view may not be collected: " + getExceptionName(e), { exception: dumpObj(e) });
3941
+ _throwInternal(1 , 31 , "startTrackPage failed, page view may not be collected: " + getExceptionName(e), { exception: dumpObj(e) });
4128
3942
  }
4129
3943
  };
4130
3944
  _self.stopTrackPage = function (name, url, properties, measurement) {
@@ -4143,7 +3957,7 @@
4143
3957
  }
4144
3958
  }
4145
3959
  catch (e) {
4146
- _throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.StopTrackFailed, "stopTrackPage failed, page view will not be collected: " + getExceptionName(e), { exception: dumpObj(e) });
3960
+ _throwInternal(1 , 32 , "stopTrackPage failed, page view will not be collected: " + getExceptionName(e), { exception: dumpObj(e) });
4147
3961
  }
4148
3962
  };
4149
3963
  _self.sendExceptionInternal = function (exception, customProperties, systemProperties) {
@@ -4160,7 +3974,7 @@
4160
3974
  _self.sendExceptionInternal(exception, customProperties);
4161
3975
  }
4162
3976
  catch (e) {
4163
- _throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TrackExceptionFailed, "trackException failed, exception will not be collected: " + getExceptionName(e), { exception: dumpObj(e) });
3977
+ _throwInternal(1 , 35 , "trackException failed, exception will not be collected: " + getExceptionName(e), { exception: dumpObj(e) });
4164
3978
  }
4165
3979
  };
4166
3980
  _self._onerror = function (exception) {
@@ -4194,7 +4008,7 @@
4194
4008
  }
4195
4009
  catch (e) {
4196
4010
  var errorString = error ? (error.name + ", " + error.message) : "null";
4197
- _throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.ExceptionWhileLoggingError, "_onError threw exception while logging error, error will not be collected: "
4011
+ _throwInternal(1 , 11 , "_onError threw exception while logging error, error will not be collected: "
4198
4012
  + getExceptionName(e), { exception: dumpObj(e), errorString: errorString });
4199
4013
  }
4200
4014
  };
@@ -4449,7 +4263,7 @@
4449
4263
  });
4450
4264
  return _this;
4451
4265
  }
4452
- AnalyticsPlugin.Version = "2.8.0-beta.2203-16";
4266
+ AnalyticsPlugin.Version = "2.8.0-nightly.2204-05";
4453
4267
  AnalyticsPlugin.getDefaultConfig = _getDefaultConfig;
4454
4268
  return AnalyticsPlugin;
4455
4269
  }(BaseTelemetryPlugin));