@microsoft/1ds-post-js 4.0.1 → 4.0.2-nightly3.2307-25
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.
- package/README.md +10 -26
- package/bundle/es5/{ms.post-4.0.1.gbl.js → ms.post-4.0.2-nightly3.2307-25.gbl.js} +507 -426
- package/bundle/es5/ms.post-4.0.2-nightly3.2307-25.gbl.js.map +1 -0
- package/bundle/es5/ms.post-4.0.2-nightly3.2307-25.gbl.min.js +7 -0
- package/bundle/es5/ms.post-4.0.2-nightly3.2307-25.gbl.min.js.map +1 -0
- package/bundle/es5/ms.post-4.0.2-nightly3.2307-25.integrity.json +46 -0
- package/bundle/es5/{ms.post-4.0.1.js → ms.post-4.0.2-nightly3.2307-25.js} +507 -426
- package/bundle/es5/ms.post-4.0.2-nightly3.2307-25.js.map +1 -0
- package/bundle/es5/ms.post-4.0.2-nightly3.2307-25.min.js +7 -0
- package/bundle/es5/ms.post-4.0.2-nightly3.2307-25.min.js.map +1 -0
- package/bundle/es5/ms.post.gbl.js +506 -425
- package/bundle/es5/ms.post.gbl.js.map +1 -1
- package/bundle/es5/ms.post.gbl.min.js +2 -2
- package/bundle/es5/ms.post.gbl.min.js.map +1 -1
- package/bundle/es5/ms.post.integrity.json +17 -17
- package/bundle/es5/ms.post.js +506 -425
- package/bundle/es5/ms.post.js.map +1 -1
- package/bundle/es5/ms.post.min.js +2 -2
- package/bundle/es5/ms.post.min.js.map +1 -1
- package/dist/es5/ms.post.js +504 -423
- package/dist/es5/ms.post.js.map +1 -1
- package/dist/es5/ms.post.min.js +2 -2
- package/dist/es5/ms.post.min.js.map +1 -1
- package/dist-es5/BatchNotificationActions.js +1 -1
- package/dist-es5/ClockSkewManager.js +8 -8
- package/dist-es5/ClockSkewManager.js.map +1 -1
- package/dist-es5/DataModels.js +1 -1
- package/dist-es5/EventBatch.js +13 -12
- package/dist-es5/EventBatch.js.map +1 -1
- package/dist-es5/HttpManager.js +173 -173
- package/dist-es5/HttpManager.js.map +1 -1
- package/dist-es5/Index.js +3 -3
- package/dist-es5/Index.js.map +1 -1
- package/dist-es5/InternalConstants.js +1 -1
- package/dist-es5/KillSwitch.js +8 -8
- package/dist-es5/KillSwitch.js.map +1 -1
- package/dist-es5/PostChannel.js +92 -90
- package/dist-es5/PostChannel.js.map +1 -1
- package/dist-es5/RetryPolicy.js +1 -1
- package/dist-es5/Serializer.js +4 -5
- package/dist-es5/Serializer.js.map +1 -1
- package/dist-es5/TimeoutOverrideWrapper.js +1 -1
- package/dist-es5/__DynamicConstants.js +83 -0
- package/dist-es5/__DynamicConstants.js.map +1 -0
- package/dist-es5/typings/XDomainRequest.js +1 -1
- package/package.json +39 -23
- package/types/1ds-post-js.d.ts +5 -3
- package/types/1ds-post-js.namespaced.d.ts +5 -3
- package/bundle/es5/ms.post-4.0.1.gbl.js.map +0 -1
- package/bundle/es5/ms.post-4.0.1.gbl.min.js +0 -7
- package/bundle/es5/ms.post-4.0.1.gbl.min.js.map +0 -1
- package/bundle/es5/ms.post-4.0.1.integrity.json +0 -46
- package/bundle/es5/ms.post-4.0.1.js.map +0 -1
- package/bundle/es5/ms.post-4.0.1.min.js +0 -7
- package/bundle/es5/ms.post-4.0.1.min.js.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* 1DS JS SDK POST plugin, 4.0.
|
|
2
|
+
* 1DS JS SDK POST plugin, 4.0.2-nightly3.2307-25
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
* (Microsoft Internal Only)
|
|
5
5
|
*/
|
|
6
6
|
(function (global, factory) {
|
|
7
7
|
var undef = "undefined";
|
|
8
|
-
var nsKey, key, nm, theExports = {}, modName = "
|
|
9
|
-
var mods={}, modDetail=mods[modName]={}, ver="4.0.
|
|
8
|
+
var nsKey, key, nm, theExports = {}, modName = "es5_ms_post_4_0_2_nightly3_2307_25", msMod="__ms$mod__";
|
|
9
|
+
var mods={}, modDetail=mods[modName]={}, ver="4.0.2-nightly3.2307-25";
|
|
10
10
|
// Versioned namespace "oneDS4"
|
|
11
11
|
var exportNs=global, nsKey="oneDS4", exportNs=exportNs[nsKey]=(exportNs[nsKey]||{});
|
|
12
12
|
// Global namespace "oneDS"
|
|
@@ -26,6 +26,10 @@
|
|
|
26
26
|
'use strict';
|
|
27
27
|
|
|
28
28
|
|
|
29
|
+
var RT_PROFILE = "REAL_TIME";
|
|
30
|
+
var NRT_PROFILE = "NEAR_REAL_TIME";
|
|
31
|
+
var BE_PROFILE = "BEST_EFFORT";
|
|
32
|
+
|
|
29
33
|
var strShimFunction = "function";
|
|
30
34
|
var strShimObject = "object";
|
|
31
35
|
var strShimUndefined = "undefined";
|
|
@@ -239,23 +243,43 @@ function dumpObj(object, format) {
|
|
|
239
243
|
return objToString(object) + ": " + propertyValueDump;
|
|
240
244
|
}
|
|
241
245
|
|
|
242
|
-
|
|
246
|
+
var _arrSlice = ArrProto[SLICE];
|
|
247
|
+
var _throwMissingFunction = function (funcName, thisArg) {
|
|
248
|
+
throwTypeError("'" + asString(funcName) + "' not defined for " + dumpObj(thisArg));
|
|
249
|
+
};
|
|
250
|
+
var _unwrapInstFunction = function (funcName) {
|
|
251
|
+
return function (thisArg) {
|
|
252
|
+
return thisArg[funcName].apply(thisArg, _arrSlice.call(arguments, 1));
|
|
253
|
+
};
|
|
254
|
+
};
|
|
255
|
+
var _unwrapFunction = function (funcName, clsProto) {
|
|
256
|
+
var clsFn = clsProto && clsProto[funcName];
|
|
257
|
+
return function (thisArg) {
|
|
258
|
+
var theFunc = (thisArg && thisArg[funcName]) || clsFn;
|
|
259
|
+
if (theFunc) {
|
|
260
|
+
return theFunc.apply(thisArg, _arrSlice.call(arguments, 1));
|
|
261
|
+
}
|
|
262
|
+
_throwMissingFunction(funcName, thisArg);
|
|
263
|
+
};
|
|
264
|
+
};
|
|
265
|
+
var _unwrapFunctionWithPoly = function (funcName, clsProto, polyFunc) {
|
|
266
|
+
var clsFn = clsProto && clsProto[funcName];
|
|
243
267
|
return function (thisArg) {
|
|
244
|
-
var theFunc = (thisArg && thisArg[funcName]) ||
|
|
268
|
+
var theFunc = (thisArg && thisArg[funcName]) || clsFn;
|
|
245
269
|
if (theFunc || polyFunc) {
|
|
246
270
|
var theArgs = arguments;
|
|
247
|
-
return (theFunc || polyFunc).apply(thisArg, theFunc ?
|
|
271
|
+
return (theFunc || polyFunc).apply(thisArg, theFunc ? _arrSlice.call(theArgs, 1) : theArgs);
|
|
248
272
|
}
|
|
249
|
-
|
|
273
|
+
_throwMissingFunction(funcName, thisArg);
|
|
250
274
|
};
|
|
251
|
-
}
|
|
275
|
+
};
|
|
252
276
|
|
|
253
277
|
var mathMax = MathCls.max;
|
|
254
278
|
|
|
255
279
|
var strSlice = _unwrapFunction(SLICE, StrProto);
|
|
256
280
|
|
|
257
281
|
var strSubstring = _unwrapFunction("substring", StrProto);
|
|
258
|
-
var strSubstr =
|
|
282
|
+
var strSubstr = _unwrapFunctionWithPoly("substr", StrProto, polyStrSubstr);
|
|
259
283
|
function polyStrSubstr(value, start, length) {
|
|
260
284
|
if (isNullOrUndefined(value)) {
|
|
261
285
|
throwTypeError("'polyStrSubstr called with invalid " + dumpObj(value));
|
|
@@ -276,7 +300,7 @@ function strLeft(value, count) {
|
|
|
276
300
|
return strSubstring(value, 0, count);
|
|
277
301
|
}
|
|
278
302
|
|
|
279
|
-
var strStartsWith =
|
|
303
|
+
var strStartsWith = _unwrapFunctionWithPoly("startsWith", StrProto, polyStrStartsWith);
|
|
280
304
|
function polyStrStartsWith(value, searchString, position) {
|
|
281
305
|
if (!isString(value)) {
|
|
282
306
|
throwTypeError("'" + dumpObj(value) + "' is not a string");
|
|
@@ -393,15 +417,13 @@ var _cachedWindow;
|
|
|
393
417
|
var _cachedDocument;
|
|
394
418
|
var _cachedNavigator;
|
|
395
419
|
var _isNode;
|
|
396
|
-
function
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
function getGlobal(useCached) {
|
|
400
|
-
(!_cachedGlobal || useCached === false || (_globalLazyTestHooks.lzy && !_cachedGlobal.b)) && (_cachedGlobal = safeGetLazy(_getGlobalValue, NULL_VALUE));
|
|
420
|
+
var lazySafeGetInst = function (name) { return safeGetLazy(function () { return getInst(name) || UNDEF_VALUE; }, UNDEF_VALUE); };
|
|
421
|
+
var getGlobal = function (useCached) {
|
|
422
|
+
(!_cachedGlobal || useCached === false || (_globalLazyTestHooks && _globalLazyTestHooks.lzy && !_cachedGlobal.b)) && (_cachedGlobal = safeGetLazy(_getGlobalValue, NULL_VALUE));
|
|
401
423
|
return _cachedGlobal.v;
|
|
402
|
-
}
|
|
403
|
-
function
|
|
404
|
-
var gbl = getGlobal(useCached);
|
|
424
|
+
};
|
|
425
|
+
var getInst = function (name, useCached) {
|
|
426
|
+
var gbl = (!_cachedGlobal || useCached === false) ? getGlobal(useCached) : _cachedGlobal.v;
|
|
405
427
|
if (gbl && gbl[name]) {
|
|
406
428
|
return gbl[name];
|
|
407
429
|
}
|
|
@@ -409,32 +431,26 @@ function getInst(name, useCached) {
|
|
|
409
431
|
return _cachedWindow.v;
|
|
410
432
|
}
|
|
411
433
|
return NULL_VALUE;
|
|
412
|
-
}
|
|
413
|
-
function
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
function getDocument() {
|
|
417
|
-
(!_cachedDocument || (_globalLazyTestHooks.lzy && !_cachedDocument.b)) && (_cachedDocument = lazySafeGetInst("document"));
|
|
434
|
+
};
|
|
435
|
+
var hasDocument = function () { return !!getDocument(); };
|
|
436
|
+
var getDocument = function () {
|
|
437
|
+
(!_cachedDocument || (_globalLazyTestHooks && _globalLazyTestHooks.lzy && !_cachedDocument.b)) && (_cachedDocument = lazySafeGetInst("document"));
|
|
418
438
|
return _cachedDocument.v;
|
|
419
|
-
}
|
|
420
|
-
function
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
function getWindow() {
|
|
424
|
-
(!_cachedWindow || (_globalLazyTestHooks.lzy && !_cachedWindow.b)) && (_cachedWindow = lazySafeGetInst(WINDOW));
|
|
439
|
+
};
|
|
440
|
+
var hasWindow = function () { return !!getWindow(); };
|
|
441
|
+
var getWindow = function () {
|
|
442
|
+
(!_cachedWindow || (_globalLazyTestHooks && _globalLazyTestHooks.lzy && !_cachedWindow.b)) && (_cachedWindow = lazySafeGetInst(WINDOW));
|
|
425
443
|
return _cachedWindow.v;
|
|
426
|
-
}
|
|
427
|
-
function
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
function getNavigator() {
|
|
431
|
-
(!_cachedNavigator || (_globalLazyTestHooks.lzy && !_cachedNavigator.b)) && (_cachedNavigator = lazySafeGetInst("navigator"));
|
|
444
|
+
};
|
|
445
|
+
var hasNavigator = function () { return !!getNavigator(); };
|
|
446
|
+
var getNavigator = function () {
|
|
447
|
+
(!_cachedNavigator || (_globalLazyTestHooks && _globalLazyTestHooks.lzy && !_cachedNavigator.b)) && (_cachedNavigator = lazySafeGetInst("navigator"));
|
|
432
448
|
return _cachedNavigator.v;
|
|
433
|
-
}
|
|
434
|
-
function
|
|
449
|
+
};
|
|
450
|
+
var isNode = function () {
|
|
435
451
|
!_isNode && (_isNode = safeGetLazy(function () { return !!(process && (process.versions || {}).node); }, false));
|
|
436
452
|
return _isNode.v;
|
|
437
|
-
}
|
|
453
|
+
};
|
|
438
454
|
|
|
439
455
|
var _symbol;
|
|
440
456
|
var _symbolFor;
|
|
@@ -475,36 +491,54 @@ function isIterable(value) {
|
|
|
475
491
|
return !isStrictNullOrUndefined(value) && isFunction(value[getKnownSymbol(3 )]);
|
|
476
492
|
}
|
|
477
493
|
|
|
494
|
+
var _iterSymbol;
|
|
478
495
|
function iterForOf(iter, callbackfn, thisArg) {
|
|
479
496
|
if (iter) {
|
|
480
497
|
if (!isIterator(iter)) {
|
|
481
|
-
|
|
482
|
-
iter = iter[
|
|
498
|
+
!_iterSymbol && (_iterSymbol = getLazy(function () { return getKnownSymbol(3 ); }));
|
|
499
|
+
iter = iter[_iterSymbol.v] ? iter[_iterSymbol.v]() : null;
|
|
483
500
|
}
|
|
484
501
|
if (isIterator(iter)) {
|
|
502
|
+
var err = void 0;
|
|
503
|
+
var iterResult = void 0;
|
|
485
504
|
try {
|
|
486
505
|
var count = 0;
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
if (callbackfn.call(thisArg || iter, value[VALUE], count, iter) === -1) {
|
|
506
|
+
while (!(iterResult = iter.next())[DONE]) {
|
|
507
|
+
if (callbackfn.call(thisArg || iter, iterResult[VALUE], count, iter) === -1) {
|
|
490
508
|
break;
|
|
491
509
|
}
|
|
492
510
|
count++;
|
|
493
|
-
value = iter.next();
|
|
494
511
|
}
|
|
495
|
-
iter.return && iter.return(value);
|
|
496
512
|
}
|
|
497
|
-
catch (
|
|
498
|
-
|
|
513
|
+
catch (failed) {
|
|
514
|
+
err = { e: failed };
|
|
515
|
+
if (iter.throw) {
|
|
516
|
+
iterResult = null;
|
|
517
|
+
iter.throw(err);
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
finally {
|
|
521
|
+
try {
|
|
522
|
+
if (iterResult && !iterResult[DONE]) {
|
|
523
|
+
iter.return && iter.return(iterResult);
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
finally {
|
|
527
|
+
if (err) {
|
|
528
|
+
throw err.e;
|
|
529
|
+
}
|
|
530
|
+
}
|
|
499
531
|
}
|
|
500
532
|
}
|
|
501
533
|
}
|
|
502
534
|
}
|
|
503
535
|
|
|
536
|
+
var fnApply = _unwrapInstFunction("apply");
|
|
537
|
+
|
|
504
538
|
function arrAppend(target, elms) {
|
|
505
539
|
if (!isUndefined(elms) && target) {
|
|
506
540
|
if (isArray(elms)) {
|
|
507
|
-
target.push
|
|
541
|
+
fnApply(target.push, target, elms);
|
|
508
542
|
}
|
|
509
543
|
else if (isIterator(elms) || isIterable(elms)) {
|
|
510
544
|
iterForOf(elms, function (elm) {
|
|
@@ -535,6 +569,8 @@ var arrIndexOf = _unwrapFunction(INDEX_OF, ArrProto);
|
|
|
535
569
|
|
|
536
570
|
var arrSlice = _unwrapFunction(SLICE, ArrProto);
|
|
537
571
|
|
|
572
|
+
var fnCall = _unwrapInstFunction("call");
|
|
573
|
+
|
|
538
574
|
var _objCreate = ObjClass["create"];
|
|
539
575
|
var objCreate = _objCreate || polyObjCreate;
|
|
540
576
|
function polyObjCreate(obj) {
|
|
@@ -595,7 +631,7 @@ function createCustomError(name, constructCb, errorBase) {
|
|
|
595
631
|
var _this = this;
|
|
596
632
|
try {
|
|
597
633
|
_safeSetName(theBaseClass, name);
|
|
598
|
-
var _self = theBaseClass
|
|
634
|
+
var _self = fnApply(theBaseClass, _this, arrSlice(arguments)) || _this;
|
|
599
635
|
if (_self !== _this) {
|
|
600
636
|
var orgProto = objGetPrototypeOf(_this);
|
|
601
637
|
if (orgProto !== objGetPrototypeOf(_self)) {
|
|
@@ -632,7 +668,7 @@ function _createTrimFn(exp) {
|
|
|
632
668
|
}
|
|
633
669
|
var polyStrTrim = _createTrimFn(/^\s+|(?=\s)\s+$/g);
|
|
634
670
|
|
|
635
|
-
var strTrim =
|
|
671
|
+
var strTrim = _unwrapFunctionWithPoly("trim", StrProto, polyStrTrim);
|
|
636
672
|
|
|
637
673
|
var _fnToString;
|
|
638
674
|
var _objCtrFnString;
|
|
@@ -648,7 +684,7 @@ function isPlainObject(value) {
|
|
|
648
684
|
if (value !== _gblWindow) {
|
|
649
685
|
if (!_objCtrFnString) {
|
|
650
686
|
_fnToString = Function[PROTOTYPE].toString;
|
|
651
|
-
_objCtrFnString = _fnToString
|
|
687
|
+
_objCtrFnString = fnCall(_fnToString, ObjClass);
|
|
652
688
|
}
|
|
653
689
|
try {
|
|
654
690
|
var proto = objGetPrototypeOf(value);
|
|
@@ -668,7 +704,7 @@ function isPlainObject(value) {
|
|
|
668
704
|
|
|
669
705
|
var _perf;
|
|
670
706
|
function getPerformance() {
|
|
671
|
-
(!_perf || (
|
|
707
|
+
(!_perf || (!_perf.b && _globalLazyTestHooks && _globalLazyTestHooks.lzy)) && (_perf = lazySafeGetInst("performance"));
|
|
672
708
|
return _perf.v;
|
|
673
709
|
}
|
|
674
710
|
function perfNow() {
|
|
@@ -750,7 +786,7 @@ function _createTimeoutWith(self, startTimer, overrideFn, theArgs) {
|
|
|
750
786
|
var timerFn = theArgs[0];
|
|
751
787
|
theArgs[0] = function () {
|
|
752
788
|
handler.dn();
|
|
753
|
-
timerFn
|
|
789
|
+
fnApply(timerFn, self, arrSlice(arguments));
|
|
754
790
|
};
|
|
755
791
|
var handler = _createTimerHandler(startTimer, function (timerId) {
|
|
756
792
|
if (timerId) {
|
|
@@ -758,11 +794,11 @@ function _createTimeoutWith(self, startTimer, overrideFn, theArgs) {
|
|
|
758
794
|
timerId.refresh();
|
|
759
795
|
return timerId;
|
|
760
796
|
}
|
|
761
|
-
clearFn
|
|
797
|
+
fnApply(clearFn, self, [timerId]);
|
|
762
798
|
}
|
|
763
|
-
return setFn
|
|
799
|
+
return fnApply(setFn, self, theArgs);
|
|
764
800
|
}, function (timerId) {
|
|
765
|
-
clearFn
|
|
801
|
+
fnApply(clearFn, self, [timerId]);
|
|
766
802
|
});
|
|
767
803
|
return handler.h;
|
|
768
804
|
}
|
|
@@ -1058,9 +1094,9 @@ var EventsDiscardedReason = createEnumStyle({
|
|
|
1058
1094
|
QueueFull: 5
|
|
1059
1095
|
});
|
|
1060
1096
|
|
|
1061
|
-
var _DYN_TO_LOWER_CASE = "toLowerCase";
|
|
1097
|
+
var _DYN_TO_LOWER_CASE$1 = "toLowerCase";
|
|
1062
1098
|
var _DYN_BLK_VAL = "blkVal";
|
|
1063
|
-
var _DYN_LENGTH = "length";
|
|
1099
|
+
var _DYN_LENGTH$2 = "length";
|
|
1064
1100
|
var _DYN_RD_ONLY = "rdOnly";
|
|
1065
1101
|
var _DYN_NOTIFY = "notify";
|
|
1066
1102
|
var _DYN_WARN_TO_CONSOLE = "warnToConsole";
|
|
@@ -1069,12 +1105,12 @@ var _DYN_SET_DF = "setDf";
|
|
|
1069
1105
|
var _DYN_WATCH = "watch";
|
|
1070
1106
|
var _DYN_LOGGER = "logger";
|
|
1071
1107
|
var _DYN_APPLY = "apply";
|
|
1072
|
-
var _DYN_PUSH = "push";
|
|
1073
|
-
var _DYN_SPLICE = "splice";
|
|
1108
|
+
var _DYN_PUSH$1 = "push";
|
|
1109
|
+
var _DYN_SPLICE$1 = "splice";
|
|
1074
1110
|
var _DYN_HDLR = "hdlr";
|
|
1075
1111
|
var _DYN_CANCEL = "cancel";
|
|
1076
|
-
var _DYN_INITIALIZE = "initialize";
|
|
1077
|
-
var _DYN_IDENTIFIER = "identifier";
|
|
1112
|
+
var _DYN_INITIALIZE$1 = "initialize";
|
|
1113
|
+
var _DYN_IDENTIFIER$1 = "identifier";
|
|
1078
1114
|
var _DYN_IS_INITIALIZED = "isInitialized";
|
|
1079
1115
|
var _DYN_GET_PLUGIN = "getPlugin";
|
|
1080
1116
|
var _DYN_NAME = "name";
|
|
@@ -1094,7 +1130,7 @@ var _DYN_UPDATE = "update";
|
|
|
1094
1130
|
var _DYN_GET_NEXT = "getNext";
|
|
1095
1131
|
var _DYN_SET_NEXT_PLUGIN = "setNextPlugin";
|
|
1096
1132
|
var _DYN_USER_AGENT = "userAgent";
|
|
1097
|
-
var _DYN_SPLIT = "split";
|
|
1133
|
+
var _DYN_SPLIT$1 = "split";
|
|
1098
1134
|
var _DYN_NODE_TYPE = "nodeType";
|
|
1099
1135
|
var _DYN_REPLACE = "replace";
|
|
1100
1136
|
var _DYN_LOG_INTERNAL_MESSAGE = "logInternalMessage";
|
|
@@ -1109,7 +1145,7 @@ var aggregationErrorType;
|
|
|
1109
1145
|
function throwAggregationError(message, sourceErrors) {
|
|
1110
1146
|
if (!aggregationErrorType) {
|
|
1111
1147
|
aggregationErrorType = createCustomError("AggregationError", function (self, args) {
|
|
1112
|
-
if (args[_DYN_LENGTH ] > 1) {
|
|
1148
|
+
if (args[_DYN_LENGTH$2 ] > 1) {
|
|
1113
1149
|
self.errors = args[1];
|
|
1114
1150
|
}
|
|
1115
1151
|
});
|
|
@@ -1121,13 +1157,6 @@ function throwAggregationError(message, sourceErrors) {
|
|
|
1121
1157
|
throw new aggregationErrorType(theMessage, sourceErrors || []);
|
|
1122
1158
|
}
|
|
1123
1159
|
|
|
1124
|
-
var _theLogger = null;
|
|
1125
|
-
function _debugLog(id, message) {
|
|
1126
|
-
if (_theLogger) {
|
|
1127
|
-
_theLogger(id, message);
|
|
1128
|
-
}
|
|
1129
|
-
}
|
|
1130
|
-
|
|
1131
1160
|
var STRING_STATES = [
|
|
1132
1161
|
"pending", "resolving", "resolved", "rejected"
|
|
1133
1162
|
];
|
|
@@ -1190,14 +1219,11 @@ function _createPromise(newPromise, processor, executor) {
|
|
|
1190
1219
|
_handled = true;
|
|
1191
1220
|
_unHandledRejectionHandler && _unHandledRejectionHandler.cancel();
|
|
1192
1221
|
_unHandledRejectionHandler = null;
|
|
1193
|
-
_debugLog(_toString(), "then(" + dumpFnObj(onResolved) + ", " + dumpFnObj(onResolved) + ")");
|
|
1194
1222
|
var thenPromise = newPromise(function (resolve, reject) {
|
|
1195
1223
|
_queue.push(function () {
|
|
1196
1224
|
try {
|
|
1197
|
-
_debugLog(_toString(), "Handling settled value " + dumpFnObj(_settledValue));
|
|
1198
1225
|
var handler = _state === 2 ? onResolved : onRejected;
|
|
1199
1226
|
var value = isUndefined(handler) ? _settledValue : (isFunction(handler) ? handler(_settledValue) : handler);
|
|
1200
|
-
_debugLog(_toString(), "Handling Result " + dumpFnObj(value));
|
|
1201
1227
|
if (isPromiseLike(value)) {
|
|
1202
1228
|
value.then(resolve, reject);
|
|
1203
1229
|
}
|
|
@@ -1215,12 +1241,10 @@ function _createPromise(newPromise, processor, executor) {
|
|
|
1215
1241
|
reject(e);
|
|
1216
1242
|
}
|
|
1217
1243
|
});
|
|
1218
|
-
_debugLog(_toString(), "Added to Queue " + _queue.length);
|
|
1219
1244
|
if (_hasResolved) {
|
|
1220
1245
|
_processQueue();
|
|
1221
1246
|
}
|
|
1222
1247
|
}, additionalArgs);
|
|
1223
|
-
_debugLog(_toString(), "Created -> " + thenPromise.toString());
|
|
1224
1248
|
return thenPromise;
|
|
1225
1249
|
}
|
|
1226
1250
|
finally {
|
|
@@ -1251,49 +1275,37 @@ function _createPromise(newPromise, processor, executor) {
|
|
|
1251
1275
|
if (_queue.length > 0) {
|
|
1252
1276
|
var pending = _queue.slice();
|
|
1253
1277
|
_queue = [];
|
|
1254
|
-
_debugLog(_toString(), "Processing queue " + pending.length);
|
|
1255
1278
|
_handled = true;
|
|
1256
1279
|
processor(pending);
|
|
1257
|
-
_debugLog(_toString(), "Processing done");
|
|
1258
1280
|
_unHandledRejectionHandler && _unHandledRejectionHandler.cancel();
|
|
1259
1281
|
_unHandledRejectionHandler = null;
|
|
1260
1282
|
}
|
|
1261
|
-
else {
|
|
1262
|
-
_debugLog(_toString(), "Empty Processing queue ");
|
|
1263
|
-
}
|
|
1264
1283
|
};
|
|
1265
1284
|
var _createSettleIfFn = function (newState, allowState) {
|
|
1266
1285
|
return function (theValue) {
|
|
1267
1286
|
if (_state === allowState) {
|
|
1268
1287
|
if (newState === 2 && isPromiseLike(theValue)) {
|
|
1269
1288
|
_state = 1 ;
|
|
1270
|
-
_debugLog(_toString(), "Resolving");
|
|
1271
1289
|
theValue.then(_createSettleIfFn(2 , 1 ), _createSettleIfFn(3 , 1 ));
|
|
1272
1290
|
return;
|
|
1273
1291
|
}
|
|
1274
1292
|
_state = newState;
|
|
1275
1293
|
_hasResolved = true;
|
|
1276
1294
|
_settledValue = theValue;
|
|
1277
|
-
_debugLog(_toString(), _strState());
|
|
1278
1295
|
_processQueue();
|
|
1279
1296
|
if (!_handled && newState === 3 && !_unHandledRejectionHandler) {
|
|
1280
1297
|
_unHandledRejectionHandler = scheduleTimeout(_notifyUnhandledRejection, _unhandledRejectionTimeout);
|
|
1281
1298
|
}
|
|
1282
1299
|
}
|
|
1283
|
-
else {
|
|
1284
|
-
_debugLog(_toString(), "Already " + _strState());
|
|
1285
|
-
}
|
|
1286
1300
|
};
|
|
1287
1301
|
};
|
|
1288
1302
|
var _notifyUnhandledRejection = function () {
|
|
1289
1303
|
if (!_handled) {
|
|
1290
1304
|
if (isNode()) {
|
|
1291
|
-
_debugLog(_toString(), "Emitting " + NODE_UNHANDLED_REJECTION);
|
|
1292
1305
|
process.emit(NODE_UNHANDLED_REJECTION, _settledValue, _thePromise);
|
|
1293
1306
|
}
|
|
1294
1307
|
else {
|
|
1295
1308
|
var gbl = getWindow() || getGlobal();
|
|
1296
|
-
_debugLog(_toString(), "Emitting " + UNHANDLED_REJECTION);
|
|
1297
1309
|
emitEvent(gbl, UNHANDLED_REJECTION, function (theEvt) {
|
|
1298
1310
|
objDefine(theEvt, "promise", { g: function () { return _thePromise; } });
|
|
1299
1311
|
theEvt.reason = _settledValue;
|
|
@@ -1323,14 +1335,12 @@ function _createPromise(newPromise, processor, executor) {
|
|
|
1323
1335
|
}
|
|
1324
1336
|
var _rejectFn = _createSettleIfFn(3 , 0 );
|
|
1325
1337
|
try {
|
|
1326
|
-
_debugLog(_toString(), "Executing");
|
|
1327
1338
|
executor.call(_thePromise, _createSettleIfFn(2 , 0 ), _rejectFn);
|
|
1328
1339
|
}
|
|
1329
1340
|
catch (e) {
|
|
1330
1341
|
_rejectFn(e);
|
|
1331
1342
|
}
|
|
1332
1343
|
})();
|
|
1333
|
-
_debugLog(_toString(), "Returning");
|
|
1334
1344
|
return _thePromise;
|
|
1335
1345
|
}
|
|
1336
1346
|
|
|
@@ -1554,13 +1564,13 @@ function isIE() {
|
|
|
1554
1564
|
var nav = getNavigator();
|
|
1555
1565
|
if (nav && (nav[_DYN_USER_AGENT ] !== _navUserAgentCheck || _isTrident === null)) {
|
|
1556
1566
|
_navUserAgentCheck = nav[_DYN_USER_AGENT ];
|
|
1557
|
-
var userAgent = (_navUserAgentCheck || STR_EMPTY$2)[_DYN_TO_LOWER_CASE ]();
|
|
1567
|
+
var userAgent = (_navUserAgentCheck || STR_EMPTY$2)[_DYN_TO_LOWER_CASE$1 ]();
|
|
1558
1568
|
_isTrident = (strContains(userAgent, strMsie) || strContains(userAgent, strTrident));
|
|
1559
1569
|
}
|
|
1560
1570
|
return _isTrident;
|
|
1561
1571
|
}
|
|
1562
|
-
function isBeaconsSupported() {
|
|
1563
|
-
if (_beaconsSupported === null) {
|
|
1572
|
+
function isBeaconsSupported(useCached) {
|
|
1573
|
+
if (_beaconsSupported === null || useCached === false) {
|
|
1564
1574
|
_beaconsSupported = hasNavigator() && Boolean(getNavigator().sendBeacon);
|
|
1565
1575
|
}
|
|
1566
1576
|
return _beaconsSupported;
|
|
@@ -1656,7 +1666,7 @@ function newId(maxLength) {
|
|
|
1656
1666
|
var number = random32() >>> 0;
|
|
1657
1667
|
var chars = 0;
|
|
1658
1668
|
var result = STR_EMPTY$2;
|
|
1659
|
-
while (result[_DYN_LENGTH ] < maxLength) {
|
|
1669
|
+
while (result[_DYN_LENGTH$2 ] < maxLength) {
|
|
1660
1670
|
chars++;
|
|
1661
1671
|
result += base64chars.charAt(number & 0x3F);
|
|
1662
1672
|
number >>>= 6;
|
|
@@ -1668,7 +1678,7 @@ function newId(maxLength) {
|
|
|
1668
1678
|
return result;
|
|
1669
1679
|
}
|
|
1670
1680
|
|
|
1671
|
-
var version = '3.0.
|
|
1681
|
+
var version = '3.0.3-nightly3.2307-25';
|
|
1672
1682
|
var instanceName = "." + newId(6);
|
|
1673
1683
|
var _dataUid = 0;
|
|
1674
1684
|
function _canAcceptData(target) {
|
|
@@ -1736,7 +1746,7 @@ function _getDefault(dynamicHandler, theConfig, cfgDefaults) {
|
|
|
1736
1746
|
if (!isArray(fallbacks)) {
|
|
1737
1747
|
fallbacks = [fallbacks];
|
|
1738
1748
|
}
|
|
1739
|
-
for (var lp = 0; lp < fallbacks[_DYN_LENGTH ]; lp++) {
|
|
1749
|
+
for (var lp = 0; lp < fallbacks[_DYN_LENGTH$2 ]; lp++) {
|
|
1740
1750
|
var fallback = fallbacks[lp];
|
|
1741
1751
|
var fbValue = theConfig[fallback];
|
|
1742
1752
|
if (isDefaultValid(fbValue)) {
|
|
@@ -1771,7 +1781,7 @@ function _resolveDefaultValue(dynamicHandler, theConfig, cfgDefaults) {
|
|
|
1771
1781
|
var newValue_1;
|
|
1772
1782
|
if (isArray(theValue)) {
|
|
1773
1783
|
newValue_1 = [];
|
|
1774
|
-
newValue_1[_DYN_LENGTH ] = theValue[_DYN_LENGTH ];
|
|
1784
|
+
newValue_1[_DYN_LENGTH$2 ] = theValue[_DYN_LENGTH$2 ];
|
|
1775
1785
|
}
|
|
1776
1786
|
else if (isPlainObject(theValue)) {
|
|
1777
1787
|
newValue_1 = {};
|
|
@@ -1862,7 +1872,7 @@ function _cfgDeepCopy(source) {
|
|
|
1862
1872
|
var target_1;
|
|
1863
1873
|
if (isArray(source)) {
|
|
1864
1874
|
target_1 = [];
|
|
1865
|
-
target_1[_DYN_LENGTH ] = source[_DYN_LENGTH ];
|
|
1875
|
+
target_1[_DYN_LENGTH$2 ] = source[_DYN_LENGTH$2 ];
|
|
1866
1876
|
}
|
|
1867
1877
|
else if (isPlainObject(source)) {
|
|
1868
1878
|
target_1 = {};
|
|
@@ -1946,7 +1956,7 @@ function _createDynamicProperty(state, theConfig, name, value) {
|
|
|
1946
1956
|
trk: function (handler) {
|
|
1947
1957
|
if (handler && handler.fn) {
|
|
1948
1958
|
if (arrIndexOf(detail.h, handler) === -1) {
|
|
1949
|
-
detail.h[_DYN_PUSH ](handler);
|
|
1959
|
+
detail.h[_DYN_PUSH$1 ](handler);
|
|
1950
1960
|
}
|
|
1951
1961
|
state.trk(handler, detail);
|
|
1952
1962
|
}
|
|
@@ -1954,7 +1964,7 @@ function _createDynamicProperty(state, theConfig, name, value) {
|
|
|
1954
1964
|
clr: function (handler) {
|
|
1955
1965
|
var idx = arrIndexOf(detail.h, handler);
|
|
1956
1966
|
if (idx !== -1) {
|
|
1957
|
-
detail.h[_DYN_SPLICE ](idx, 1);
|
|
1967
|
+
detail.h[_DYN_SPLICE$1 ](idx, 1);
|
|
1958
1968
|
}
|
|
1959
1969
|
}
|
|
1960
1970
|
};
|
|
@@ -2158,7 +2168,7 @@ function _createState(cfgHandler) {
|
|
|
2158
2168
|
_useHandler(handler, handler.fn);
|
|
2159
2169
|
}
|
|
2160
2170
|
catch (e) {
|
|
2161
|
-
watcherFailures_1[_DYN_PUSH ](e);
|
|
2171
|
+
watcherFailures_1[_DYN_PUSH$1 ](e);
|
|
2162
2172
|
}
|
|
2163
2173
|
}
|
|
2164
2174
|
}
|
|
@@ -2168,16 +2178,16 @@ function _createState(cfgHandler) {
|
|
|
2168
2178
|
_notifyWatchers();
|
|
2169
2179
|
}
|
|
2170
2180
|
catch (e) {
|
|
2171
|
-
watcherFailures_1[_DYN_PUSH ](e);
|
|
2181
|
+
watcherFailures_1[_DYN_PUSH$1 ](e);
|
|
2172
2182
|
}
|
|
2173
2183
|
}
|
|
2174
|
-
if (watcherFailures_1[_DYN_LENGTH ] > 0) {
|
|
2184
|
+
if (watcherFailures_1[_DYN_LENGTH$2 ] > 0) {
|
|
2175
2185
|
throwAggregationError("Watcher error(s): ", watcherFailures_1);
|
|
2176
2186
|
}
|
|
2177
2187
|
}
|
|
2178
2188
|
}
|
|
2179
2189
|
function _addWatcher(detail) {
|
|
2180
|
-
if (detail && detail.h[_DYN_LENGTH ] > 0) {
|
|
2190
|
+
if (detail && detail.h[_DYN_LENGTH$2 ] > 0) {
|
|
2181
2191
|
if (!_waitingHandlers) {
|
|
2182
2192
|
_waitingHandlers = [];
|
|
2183
2193
|
}
|
|
@@ -2187,10 +2197,10 @@ function _createState(cfgHandler) {
|
|
|
2187
2197
|
_notifyWatchers();
|
|
2188
2198
|
}, 0);
|
|
2189
2199
|
}
|
|
2190
|
-
for (var idx = 0; idx < detail.h[_DYN_LENGTH ]; idx++) {
|
|
2200
|
+
for (var idx = 0; idx < detail.h[_DYN_LENGTH$2 ]; idx++) {
|
|
2191
2201
|
var handler = detail.h[idx];
|
|
2192
2202
|
if (handler && arrIndexOf(_waitingHandlers, handler) === -1) {
|
|
2193
|
-
_waitingHandlers[_DYN_PUSH ](handler);
|
|
2203
|
+
_waitingHandlers[_DYN_PUSH$1 ](handler);
|
|
2194
2204
|
}
|
|
2195
2205
|
}
|
|
2196
2206
|
}
|
|
@@ -2199,7 +2209,7 @@ function _createState(cfgHandler) {
|
|
|
2199
2209
|
if (handler) {
|
|
2200
2210
|
var details = handler[dynamicPropertyDetail] = handler[dynamicPropertyDetail] || [];
|
|
2201
2211
|
if (arrIndexOf(details, detail) === -1) {
|
|
2202
|
-
details[_DYN_PUSH ](detail);
|
|
2212
|
+
details[_DYN_PUSH$1 ](detail);
|
|
2203
2213
|
}
|
|
2204
2214
|
}
|
|
2205
2215
|
}
|
|
@@ -2487,14 +2497,14 @@ var DiagnosticLogger = /** @class */ (function () {
|
|
|
2487
2497
|
}
|
|
2488
2498
|
if (logMessage) {
|
|
2489
2499
|
if (severity <= _loggingLevelTelemetry) {
|
|
2490
|
-
_self.queue[_DYN_PUSH ](message);
|
|
2500
|
+
_self.queue[_DYN_PUSH$1 ](message);
|
|
2491
2501
|
_messageCount++;
|
|
2492
2502
|
_debugExtMsg((severity === 1 ? "error" : "warn"), message);
|
|
2493
2503
|
}
|
|
2494
2504
|
if (_messageCount === _maxInternalMessageLimit) {
|
|
2495
2505
|
var throttleLimitMessage = "Internal events throttle limit per PageView reached for this app.";
|
|
2496
2506
|
var throttleMessage = new _InternalLogMessage(23 , throttleLimitMessage, false);
|
|
2497
|
-
_self.queue[_DYN_PUSH ](throttleMessage);
|
|
2507
|
+
_self.queue[_DYN_PUSH$1 ](throttleMessage);
|
|
2498
2508
|
if (severity === 1 ) {
|
|
2499
2509
|
_self.errorToConsole(throttleLimitMessage);
|
|
2500
2510
|
}
|
|
@@ -2590,7 +2600,7 @@ var PerfEvent = /** @class */ (function () {
|
|
|
2590
2600
|
var childTime = 0;
|
|
2591
2601
|
var childEvts = _self[_DYN_GET_CTX ](PerfEvent[strChildrenContextKey]);
|
|
2592
2602
|
if (isArray(childEvts)) {
|
|
2593
|
-
for (var lp = 0; lp < childEvts[_DYN_LENGTH ]; lp++) {
|
|
2603
|
+
for (var lp = 0; lp < childEvts[_DYN_LENGTH$2 ]; lp++) {
|
|
2594
2604
|
var childEvt = childEvts[lp];
|
|
2595
2605
|
if (childEvt) {
|
|
2596
2606
|
childTime += childEvt[_DYN_TIME ];
|
|
@@ -2627,7 +2637,7 @@ function doPerf(mgrSource, getSource, func, details, isAsync) {
|
|
|
2627
2637
|
children = [];
|
|
2628
2638
|
currentActive[_DYN_SET_CTX ](PerfEvent[strChildrenContextKey], children);
|
|
2629
2639
|
}
|
|
2630
|
-
children[_DYN_PUSH ](perfEvt);
|
|
2640
|
+
children[_DYN_PUSH$1 ](perfEvt);
|
|
2631
2641
|
}
|
|
2632
2642
|
}
|
|
2633
2643
|
perfMgr[_DYN_SET_CTX ](doPerfActiveKey, perfEvt);
|
|
@@ -2710,7 +2720,7 @@ function _createInternalContext(telemetryChain, dynamicHandler, core, startAt) {
|
|
|
2710
2720
|
args[_i - 2] = arguments[_i];
|
|
2711
2721
|
}
|
|
2712
2722
|
if (onComplete) {
|
|
2713
|
-
_onComplete[_DYN_PUSH ]({
|
|
2723
|
+
_onComplete[_DYN_PUSH$1 ]({
|
|
2714
2724
|
func: onComplete,
|
|
2715
2725
|
self: !isUndefined(that) ? that : context.ctx,
|
|
2716
2726
|
args: args
|
|
@@ -2722,7 +2732,7 @@ function _createInternalContext(telemetryChain, dynamicHandler, core, startAt) {
|
|
|
2722
2732
|
_nextProxy = nextProxy ? nextProxy[_DYN_GET_NEXT ]() : null;
|
|
2723
2733
|
if (!nextProxy) {
|
|
2724
2734
|
var onComplete = _onComplete;
|
|
2725
|
-
if (onComplete && onComplete[_DYN_LENGTH ] > 0) {
|
|
2735
|
+
if (onComplete && onComplete[_DYN_LENGTH$2 ] > 0) {
|
|
2726
2736
|
arrForEach(onComplete, function (completeDetails) {
|
|
2727
2737
|
try {
|
|
2728
2738
|
completeDetails.func.call(completeDetails.self, completeDetails.args);
|
|
@@ -2863,7 +2873,7 @@ function createProcessTelemetryUpdateContext(telemetryChain, core, startAt) {
|
|
|
2863
2873
|
function createTelemetryProxyChain(plugins, config, core, startAt) {
|
|
2864
2874
|
var firstProxy = null;
|
|
2865
2875
|
var add = startAt ? false : true;
|
|
2866
|
-
if (isArray(plugins) && plugins[_DYN_LENGTH ] > 0) {
|
|
2876
|
+
if (isArray(plugins) && plugins[_DYN_LENGTH$2 ] > 0) {
|
|
2867
2877
|
var lastProxy_1 = null;
|
|
2868
2878
|
arrForEach(plugins, function (thePlugin) {
|
|
2869
2879
|
if (!add && startAt === thePlugin) {
|
|
@@ -2892,7 +2902,7 @@ function createTelemetryPluginProxy(plugin, config, core) {
|
|
|
2892
2902
|
var hasSetNext = isFunction(plugin[_DYN_SET_NEXT_PLUGIN ]);
|
|
2893
2903
|
var chainId;
|
|
2894
2904
|
if (plugin) {
|
|
2895
|
-
chainId = plugin[_DYN_IDENTIFIER ] + "-" + plugin[STR_PRIORITY ] + "-" + _chainId++;
|
|
2905
|
+
chainId = plugin[_DYN_IDENTIFIER$1 ] + "-" + plugin[STR_PRIORITY ] + "-" + _chainId++;
|
|
2896
2906
|
}
|
|
2897
2907
|
else {
|
|
2898
2908
|
chainId = "Unknown-0-" + _chainId++;
|
|
@@ -2924,7 +2934,7 @@ function createTelemetryPluginProxy(plugin, config, core) {
|
|
|
2924
2934
|
}
|
|
2925
2935
|
function _processChain(itemCtx, processPluginFn, name, details, isAsync) {
|
|
2926
2936
|
var hasRun = false;
|
|
2927
|
-
var identifier = plugin ? plugin[_DYN_IDENTIFIER ] : strTelemetryPluginChain;
|
|
2937
|
+
var identifier = plugin ? plugin[_DYN_IDENTIFIER$1 ] : strTelemetryPluginChain;
|
|
2928
2938
|
var hasRunContext = itemCtx[strHasRunFlags];
|
|
2929
2939
|
if (!hasRunContext) {
|
|
2930
2940
|
hasRunContext = itemCtx[strHasRunFlags] = {};
|
|
@@ -3019,7 +3029,7 @@ function createUnloadHandlerContainer() {
|
|
|
3019
3029
|
var handlers = [];
|
|
3020
3030
|
function _addHandler(handler) {
|
|
3021
3031
|
if (handler) {
|
|
3022
|
-
handlers[_DYN_PUSH ](handler);
|
|
3032
|
+
handlers[_DYN_PUSH$1 ](handler);
|
|
3023
3033
|
}
|
|
3024
3034
|
}
|
|
3025
3035
|
function _runHandlers(unloadCtx, unloadState) {
|
|
@@ -3079,7 +3089,7 @@ var BaseTelemetryPlugin = /** @class */ (function () {
|
|
|
3079
3089
|
var _hookContainer;
|
|
3080
3090
|
_initDefaults();
|
|
3081
3091
|
dynamicProto(BaseTelemetryPlugin, _self, function (_self) {
|
|
3082
|
-
_self[_DYN_INITIALIZE ] = function (config, core, extensions, pluginChain) {
|
|
3092
|
+
_self[_DYN_INITIALIZE$1 ] = function (config, core, extensions, pluginChain) {
|
|
3083
3093
|
_setDefaults(config, core, pluginChain);
|
|
3084
3094
|
_isinitialized = true;
|
|
3085
3095
|
};
|
|
@@ -3258,7 +3268,7 @@ function _getEvtNamespace(eventName, evtNamespace) {
|
|
|
3258
3268
|
var parsedEvent = (eventNamespace.exec(eventName || STR_EMPTY$2) || []);
|
|
3259
3269
|
return _a = {},
|
|
3260
3270
|
_a[_DYN_TYPE ] = parsedEvent[1],
|
|
3261
|
-
_a.ns = ((parsedEvent[2] || STR_EMPTY$2).replace(rRemoveEmptyNs, ".").replace(rRemoveTrailingEmptyNs, STR_EMPTY$2)[_DYN_SPLIT ](".").sort()).join("."),
|
|
3271
|
+
_a.ns = ((parsedEvent[2] || STR_EMPTY$2).replace(rRemoveEmptyNs, ".").replace(rRemoveTrailingEmptyNs, STR_EMPTY$2)[_DYN_SPLIT$1 ](".").sort()).join("."),
|
|
3262
3272
|
_a;
|
|
3263
3273
|
}
|
|
3264
3274
|
function _getRegisteredEvents(target, evtName, addDefault) {
|
|
@@ -3295,14 +3305,14 @@ function _doAttach(obj, evtName, handlerRef, useCapture) {
|
|
|
3295
3305
|
return result;
|
|
3296
3306
|
}
|
|
3297
3307
|
function _doUnregister(target, events, evtName, unRegFn) {
|
|
3298
|
-
var idx = events[_DYN_LENGTH ];
|
|
3308
|
+
var idx = events[_DYN_LENGTH$2 ];
|
|
3299
3309
|
while (idx--) {
|
|
3300
3310
|
var theEvent = events[idx];
|
|
3301
3311
|
if (theEvent) {
|
|
3302
3312
|
if (!evtName.ns || evtName.ns === theEvent.evtName.ns) {
|
|
3303
3313
|
if (!unRegFn || unRegFn(theEvent)) {
|
|
3304
3314
|
_doDetach(target, theEvent.evtName, theEvent[_DYN_HANDLER ], theEvent.capture);
|
|
3305
|
-
events[_DYN_SPLICE ](idx, 1);
|
|
3315
|
+
events[_DYN_SPLICE$1 ](idx, 1);
|
|
3306
3316
|
}
|
|
3307
3317
|
}
|
|
3308
3318
|
}
|
|
@@ -3317,7 +3327,7 @@ function _unregisterEvents(target, evtName, unRegFn) {
|
|
|
3317
3327
|
objForEachKey(eventCache, function (evtType, events) {
|
|
3318
3328
|
_doUnregister(target, events, evtName, unRegFn);
|
|
3319
3329
|
});
|
|
3320
|
-
if (objKeys(eventCache)[_DYN_LENGTH ] === 0) {
|
|
3330
|
+
if (objKeys(eventCache)[_DYN_LENGTH$2 ] === 0) {
|
|
3321
3331
|
elmNodeData.kill(target, strEvents);
|
|
3322
3332
|
}
|
|
3323
3333
|
}
|
|
@@ -3331,7 +3341,7 @@ function mergeEvtNamespace(theNamespace, namespaces) {
|
|
|
3331
3341
|
else {
|
|
3332
3342
|
newNamespaces = [theNamespace, namespaces];
|
|
3333
3343
|
}
|
|
3334
|
-
newNamespaces = (_getEvtNamespace("xx", newNamespaces).ns)[_DYN_SPLIT ](".");
|
|
3344
|
+
newNamespaces = (_getEvtNamespace("xx", newNamespaces).ns)[_DYN_SPLIT$1 ](".");
|
|
3335
3345
|
}
|
|
3336
3346
|
else {
|
|
3337
3347
|
newNamespaces = theNamespace;
|
|
@@ -3354,7 +3364,7 @@ function eventOn(target, eventName, handlerRef, evtNamespace, useCapture) {
|
|
|
3354
3364
|
_a[_DYN_HANDLER ] = handlerRef,
|
|
3355
3365
|
_a.capture = useCapture,
|
|
3356
3366
|
_a);
|
|
3357
|
-
_getRegisteredEvents(target, evtName.type)[_DYN_PUSH ](registeredEvent);
|
|
3367
|
+
_getRegisteredEvents(target, evtName.type)[_DYN_PUSH$1 ](registeredEvent);
|
|
3358
3368
|
}
|
|
3359
3369
|
}
|
|
3360
3370
|
catch (e) {
|
|
@@ -3409,7 +3419,7 @@ function removeEventHandler(eventName, callback, evtNamespace) {
|
|
|
3409
3419
|
}
|
|
3410
3420
|
function _addEventListeners(events, listener, excludeEvents, evtNamespace) {
|
|
3411
3421
|
var added = false;
|
|
3412
|
-
if (listener && events && events[_DYN_LENGTH ] > 0) {
|
|
3422
|
+
if (listener && events && events[_DYN_LENGTH$2 ] > 0) {
|
|
3413
3423
|
arrForEach(events, function (name) {
|
|
3414
3424
|
if (name) {
|
|
3415
3425
|
if (!excludeEvents || arrIndexOf(excludeEvents, name) === -1) {
|
|
@@ -3424,7 +3434,7 @@ function addEventListeners(events, listener, excludeEvents, evtNamespace) {
|
|
|
3424
3434
|
var added = false;
|
|
3425
3435
|
if (listener && events && isArray(events)) {
|
|
3426
3436
|
added = _addEventListeners(events, listener, excludeEvents, evtNamespace);
|
|
3427
|
-
if (!added && excludeEvents && excludeEvents[_DYN_LENGTH ] > 0) {
|
|
3437
|
+
if (!added && excludeEvents && excludeEvents[_DYN_LENGTH$2 ] > 0) {
|
|
3428
3438
|
added = _addEventListeners(events, listener, null, evtNamespace);
|
|
3429
3439
|
}
|
|
3430
3440
|
}
|
|
@@ -3490,8 +3500,14 @@ function removePageShowEventListener(listener, evtNamespace) {
|
|
|
3490
3500
|
|
|
3491
3501
|
var STR_EMPTY$1 = "";
|
|
3492
3502
|
|
|
3503
|
+
var _DYN_TIMINGS$1 = "timings";
|
|
3504
|
+
var _DYN_VALUE = "value";
|
|
3505
|
+
var _DYN_KIND = "kind";
|
|
3506
|
+
var _DYN_LENGTH$1 = "length";
|
|
3507
|
+
var _DYN_PROCESS_TELEMETRY_ST0 = "processTelemetryStart";
|
|
3508
|
+
|
|
3493
3509
|
var _a$1;
|
|
3494
|
-
var Version = '4.0.
|
|
3510
|
+
var Version = '4.0.2-nightly3.2307-25';
|
|
3495
3511
|
var FullVersionString = "1DS-Web-JS-" + Version;
|
|
3496
3512
|
var ObjHasOwnProperty = ObjProto$1.hasOwnProperty;
|
|
3497
3513
|
var strDisabledPropertyName = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation";
|
|
@@ -3531,21 +3547,21 @@ function sanitizeProperty(name, property, stringifyObjects) {
|
|
|
3531
3547
|
else if (propType === "object" && !ObjHasOwnProperty.call(property, "value")) {
|
|
3532
3548
|
property = { value: stringifyObjects ? JSON.stringify(property) : property };
|
|
3533
3549
|
}
|
|
3534
|
-
else if (isNullOrUndefined(property
|
|
3535
|
-
|| property
|
|
3536
|
-
&& !isNumber(property
|
|
3537
|
-
&& !isArray(property
|
|
3550
|
+
else if (isNullOrUndefined(property[_DYN_VALUE ])
|
|
3551
|
+
|| property[_DYN_VALUE ] === STR_EMPTY$1 || (!isString(property[_DYN_VALUE ])
|
|
3552
|
+
&& !isNumber(property[_DYN_VALUE ]) && !isBoolean(property[_DYN_VALUE ])
|
|
3553
|
+
&& !isArray(property[_DYN_VALUE ]))) {
|
|
3538
3554
|
return null;
|
|
3539
3555
|
}
|
|
3540
|
-
if (isArray(property
|
|
3541
|
-
!isArrayValid(property
|
|
3556
|
+
if (isArray(property[_DYN_VALUE ]) &&
|
|
3557
|
+
!isArrayValid(property[_DYN_VALUE ])) {
|
|
3542
3558
|
return null;
|
|
3543
3559
|
}
|
|
3544
|
-
if (!isNullOrUndefined(property
|
|
3545
|
-
if (isArray(property
|
|
3560
|
+
if (!isNullOrUndefined(property[_DYN_KIND ])) {
|
|
3561
|
+
if (isArray(property[_DYN_VALUE ]) || !isValueKind(property[_DYN_KIND ])) {
|
|
3546
3562
|
return null;
|
|
3547
3563
|
}
|
|
3548
|
-
property
|
|
3564
|
+
property[_DYN_VALUE ] = property[_DYN_VALUE ].toString();
|
|
3549
3565
|
}
|
|
3550
3566
|
return property;
|
|
3551
3567
|
}
|
|
@@ -3582,7 +3598,7 @@ function extend(obj, obj2, obj3, obj4, obj5) {
|
|
|
3582
3598
|
var extended = {};
|
|
3583
3599
|
var deep = false;
|
|
3584
3600
|
var i = 0;
|
|
3585
|
-
var length = arguments
|
|
3601
|
+
var length = arguments[_DYN_LENGTH$1 ];
|
|
3586
3602
|
var theArgs = arguments;
|
|
3587
3603
|
if (isBoolean(theArgs[0])) {
|
|
3588
3604
|
deep = theArgs[0];
|
|
@@ -3628,13 +3644,13 @@ function isDataType(value) {
|
|
|
3628
3644
|
return false;
|
|
3629
3645
|
}
|
|
3630
3646
|
function isArrayValid(value) {
|
|
3631
|
-
return value
|
|
3647
|
+
return value[_DYN_LENGTH$1 ] > 0;
|
|
3632
3648
|
}
|
|
3633
3649
|
function setProcessTelemetryTimings(event, identifier) {
|
|
3634
3650
|
var evt = event;
|
|
3635
|
-
evt
|
|
3636
|
-
evt
|
|
3637
|
-
evt
|
|
3651
|
+
evt[_DYN_TIMINGS$1 ] = evt[_DYN_TIMINGS$1 ] || {};
|
|
3652
|
+
evt[_DYN_TIMINGS$1 ][_DYN_PROCESS_TELEMETRY_ST0 ] = evt[_DYN_TIMINGS$1 ][_DYN_PROCESS_TELEMETRY_ST0 ] || {};
|
|
3653
|
+
evt[_DYN_TIMINGS$1 ][_DYN_PROCESS_TELEMETRY_ST0 ][identifier] = getTime();
|
|
3638
3654
|
}
|
|
3639
3655
|
function getFieldValueType(value) {
|
|
3640
3656
|
var theType = 0 ;
|
|
@@ -3653,12 +3669,12 @@ function getFieldValueType(value) {
|
|
|
3653
3669
|
theType = 4 ;
|
|
3654
3670
|
if (isArray(value)) {
|
|
3655
3671
|
theType = 4096 ;
|
|
3656
|
-
if (value
|
|
3672
|
+
if (value[_DYN_LENGTH$1 ] > 0) {
|
|
3657
3673
|
theType |= getFieldValueType(value[0]);
|
|
3658
3674
|
}
|
|
3659
3675
|
}
|
|
3660
3676
|
else if (ObjHasOwnProperty.call(value, "value")) {
|
|
3661
|
-
theType = 8192 | getFieldValueType(value
|
|
3677
|
+
theType = 8192 | getFieldValueType(value[_DYN_VALUE ]);
|
|
3662
3678
|
}
|
|
3663
3679
|
}
|
|
3664
3680
|
}
|
|
@@ -3697,10 +3713,6 @@ function isGreaterThanZero(value) {
|
|
|
3697
3713
|
return value > 0;
|
|
3698
3714
|
}
|
|
3699
3715
|
|
|
3700
|
-
var RT_PROFILE = "REAL_TIME";
|
|
3701
|
-
var NRT_PROFILE = "NEAR_REAL_TIME";
|
|
3702
|
-
var BE_PROFILE = "BEST_EFFORT";
|
|
3703
|
-
|
|
3704
3716
|
var STR_EMPTY = "";
|
|
3705
3717
|
var STR_POST_METHOD = "POST";
|
|
3706
3718
|
var STR_DISABLED_PROPERTY_NAME = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation";
|
|
@@ -3729,6 +3741,75 @@ var STR_MSFPC = "msfpc";
|
|
|
3729
3741
|
var STR_TRACE = "trace";
|
|
3730
3742
|
var STR_USER = "user";
|
|
3731
3743
|
|
|
3744
|
+
var _DYN_ALLOW_REQUEST_SENDIN0 = "allowRequestSending";
|
|
3745
|
+
var _DYN_FIRST_REQUEST_SENT = "firstRequestSent";
|
|
3746
|
+
var _DYN_SHOULD_ADD_CLOCK_SKE1 = "shouldAddClockSkewHeaders";
|
|
3747
|
+
var _DYN_GET_CLOCK_SKEW_HEADE2 = "getClockSkewHeaderValue";
|
|
3748
|
+
var _DYN_SET_CLOCK_SKEW = "setClockSkew";
|
|
3749
|
+
var _DYN_DATA = "data";
|
|
3750
|
+
var _DYN_LENGTH = "length";
|
|
3751
|
+
var _DYN_CONCAT = "concat";
|
|
3752
|
+
var _DYN_I_KEY = "iKey";
|
|
3753
|
+
var _DYN_COUNT = "count";
|
|
3754
|
+
var _DYN_EVENTS = "events";
|
|
3755
|
+
var _DYN_PUSH = "push";
|
|
3756
|
+
var _DYN_SPLIT = "split";
|
|
3757
|
+
var _DYN_SPLICE = "splice";
|
|
3758
|
+
var _DYN_TO_LOWER_CASE = "toLowerCase";
|
|
3759
|
+
var _DYN_HDRS = "hdrs";
|
|
3760
|
+
var _DYN_USE_HDRS = "useHdrs";
|
|
3761
|
+
var _DYN_INITIALIZE = "initialize";
|
|
3762
|
+
var _DYN_SET_TIMEOUT_OVERRIDE = "setTimeoutOverride";
|
|
3763
|
+
var _DYN_CLEAR_TIMEOUT_OVERRI3 = "clearTimeoutOverride";
|
|
3764
|
+
var _DYN_PAYLOAD_PREPROCESSOR = "payloadPreprocessor";
|
|
3765
|
+
var _DYN_OVERRIDE_ENDPOINT_UR4 = "overrideEndpointUrl";
|
|
3766
|
+
var _DYN_AVOID_OPTIONS = "avoidOptions";
|
|
3767
|
+
var _DYN_DISABLE_EVENT_TIMING5 = "disableEventTimings";
|
|
3768
|
+
var _DYN_STRINGIFY_OBJECTS = "stringifyObjects";
|
|
3769
|
+
var _DYN_ENABLE_COMPOUND_KEY = "enableCompoundKey";
|
|
3770
|
+
var _DYN_DISABLE_XHR_SYNC = "disableXhrSync";
|
|
3771
|
+
var _DYN_DISABLE_FETCH_KEEP_A6 = "disableFetchKeepAlive";
|
|
3772
|
+
var _DYN_USE_SEND_BEACON = "useSendBeacon";
|
|
3773
|
+
var _DYN_ALWAYS_USE_XHR_OVERR7 = "alwaysUseXhrOverride";
|
|
3774
|
+
var _DYN_UNLOAD_TRANSPORTS = "unloadTransports";
|
|
3775
|
+
var _DYN_URL_STRING = "urlString";
|
|
3776
|
+
var _DYN_TIMEOUT = "timeout";
|
|
3777
|
+
var _DYN_ONTIMEOUT = "ontimeout";
|
|
3778
|
+
var _DYN__SEND_REASON = "_sendReason";
|
|
3779
|
+
var _DYN_HEADERS = "headers";
|
|
3780
|
+
var _DYN_GET_RESPONSE_HEADER = "getResponseHeader";
|
|
3781
|
+
var _DYN_GET_ALL_RESPONSE_HEA8 = "getAllResponseHeaders";
|
|
3782
|
+
var _DYN__THE_PAYLOAD = "_thePayload";
|
|
3783
|
+
var _DYN_BATCHES = "batches";
|
|
3784
|
+
var _DYN_SEND_TYPE = "sendType";
|
|
3785
|
+
var _DYN_CAN_SEND_REQUEST = "canSendRequest";
|
|
3786
|
+
var _DYN_SEND_QUEUED_REQUESTS = "sendQueuedRequests";
|
|
3787
|
+
var _DYN_IS_COMPLETELY_IDLE = "isCompletelyIdle";
|
|
3788
|
+
var _DYN_SET_UNLOADING = "setUnloading";
|
|
3789
|
+
var _DYN_IS_TENANT_KILLED = "isTenantKilled";
|
|
3790
|
+
var _DYN_SEND_SYNCHRONOUS_BAT9 = "sendSynchronousBatch";
|
|
3791
|
+
var _DYN__TRANSPORT = "_transport";
|
|
3792
|
+
var _DYN_GET_WPARAM = "getWParam";
|
|
3793
|
+
var _DYN_IS_BEACON = "isBeacon";
|
|
3794
|
+
var _DYN_TIMINGS = "timings";
|
|
3795
|
+
var _DYN_IS_TEARDOWN = "isTeardown";
|
|
3796
|
+
var _DYN_IS_SYNC = "isSync";
|
|
3797
|
+
var _DYN_SEND_POST = "sendPOST";
|
|
3798
|
+
var _DYN_SET_KILL_SWITCH_TENA10 = "setKillSwitchTenants";
|
|
3799
|
+
var _DYN__BACK_OFF_TRANSMISSI11 = "_backOffTransmission";
|
|
3800
|
+
var _DYN_IDENTIFIER = "identifier";
|
|
3801
|
+
var _DYN_DISABLE_OPTIMIZE_OBJ = "disableOptimizeObj";
|
|
3802
|
+
var _DYN_IGNORE_MC1_MS0_COOKI12 = "ignoreMc1Ms0CookieProcessing";
|
|
3803
|
+
var _DYN_EVENTS_LIMIT_IN_MEM = "eventsLimitInMem";
|
|
3804
|
+
var _DYN_AUTO_FLUSH_EVENTS_LI13 = "autoFlushEventsLimit";
|
|
3805
|
+
var _DYN_DISABLE_AUTO_BATCH_F14 = "disableAutoBatchFlushLimit";
|
|
3806
|
+
var _DYN_OVERRIDE_INSTRUMENTA15 = "overrideInstrumentationKey";
|
|
3807
|
+
var _DYN_DISABLE_TELEMETRY = "disableTelemetry";
|
|
3808
|
+
var _DYN_SEND_ATTEMPT = "sendAttempt";
|
|
3809
|
+
var _DYN_LATENCY = "latency";
|
|
3810
|
+
var _DYN_BASE_DATA = "baseData";
|
|
3811
|
+
var _DYN_SYNC = "sync";
|
|
3812
|
+
|
|
3732
3813
|
function _getEventMsfpc(theEvent) {
|
|
3733
3814
|
var intWeb = ((theEvent.ext || {})["intweb"]);
|
|
3734
3815
|
if (intWeb && isValueAssigned(intWeb[STR_MSFPC])) {
|
|
@@ -3738,31 +3819,31 @@ function _getEventMsfpc(theEvent) {
|
|
|
3738
3819
|
}
|
|
3739
3820
|
function _getMsfpc(theEvents) {
|
|
3740
3821
|
var msfpc = null;
|
|
3741
|
-
for (var lp = 0; msfpc === null && lp < theEvents
|
|
3822
|
+
for (var lp = 0; msfpc === null && lp < theEvents[_DYN_LENGTH ]; lp++) {
|
|
3742
3823
|
msfpc = _getEventMsfpc(theEvents[lp]);
|
|
3743
3824
|
}
|
|
3744
3825
|
return msfpc;
|
|
3745
3826
|
}
|
|
3746
3827
|
var EventBatch = /** @class */ (function () {
|
|
3747
3828
|
function EventBatch(iKey, addEvents) {
|
|
3748
|
-
var events = addEvents ? []
|
|
3829
|
+
var events = addEvents ? [][_DYN_CONCAT ](addEvents) : [];
|
|
3749
3830
|
var _self = this;
|
|
3750
3831
|
var _msfpc = _getMsfpc(events);
|
|
3751
|
-
_self
|
|
3832
|
+
_self[_DYN_I_KEY ] = function () {
|
|
3752
3833
|
return iKey;
|
|
3753
3834
|
};
|
|
3754
3835
|
_self.Msfpc = function () {
|
|
3755
3836
|
return _msfpc || STR_EMPTY;
|
|
3756
3837
|
};
|
|
3757
|
-
_self
|
|
3758
|
-
return events
|
|
3838
|
+
_self[_DYN_COUNT ] = function () {
|
|
3839
|
+
return events[_DYN_LENGTH ];
|
|
3759
3840
|
};
|
|
3760
|
-
_self
|
|
3841
|
+
_self[_DYN_EVENTS ] = function () {
|
|
3761
3842
|
return events;
|
|
3762
3843
|
};
|
|
3763
3844
|
_self.addEvent = function (theEvent) {
|
|
3764
3845
|
if (theEvent) {
|
|
3765
|
-
events
|
|
3846
|
+
events[_DYN_PUSH ](theEvent);
|
|
3766
3847
|
if (!_msfpc) {
|
|
3767
3848
|
_msfpc = _getEventMsfpc(theEvent);
|
|
3768
3849
|
}
|
|
@@ -3770,14 +3851,14 @@ var EventBatch = /** @class */ (function () {
|
|
|
3770
3851
|
}
|
|
3771
3852
|
return false;
|
|
3772
3853
|
};
|
|
3773
|
-
_self
|
|
3854
|
+
_self[_DYN_SPLIT ] = function (fromEvent, numEvents) {
|
|
3774
3855
|
var theEvents;
|
|
3775
|
-
if (fromEvent < events
|
|
3776
|
-
var cnt = events
|
|
3856
|
+
if (fromEvent < events[_DYN_LENGTH ]) {
|
|
3857
|
+
var cnt = events[_DYN_LENGTH ] - fromEvent;
|
|
3777
3858
|
if (!isNullOrUndefined(numEvents)) {
|
|
3778
3859
|
cnt = numEvents < cnt ? numEvents : cnt;
|
|
3779
3860
|
}
|
|
3780
|
-
theEvents = events
|
|
3861
|
+
theEvents = events[_DYN_SPLICE ](fromEvent, cnt);
|
|
3781
3862
|
_msfpc = _getMsfpc(events);
|
|
3782
3863
|
}
|
|
3783
3864
|
return new EventBatch(iKey, theEvents);
|
|
@@ -3797,10 +3878,10 @@ var ClockSkewManager = /** @class */ (function () {
|
|
|
3797
3878
|
var _clockSkewHeaderValue = "use-collector-delta";
|
|
3798
3879
|
var _clockSkewSet = false;
|
|
3799
3880
|
dynamicProto(ClockSkewManager, this, function (_self) {
|
|
3800
|
-
_self
|
|
3881
|
+
_self[_DYN_ALLOW_REQUEST_SENDIN0 ] = function () {
|
|
3801
3882
|
return _allowRequestSending;
|
|
3802
3883
|
};
|
|
3803
|
-
_self
|
|
3884
|
+
_self[_DYN_FIRST_REQUEST_SENT ] = function () {
|
|
3804
3885
|
if (_isFirstRequest) {
|
|
3805
3886
|
_isFirstRequest = false;
|
|
3806
3887
|
if (!_clockSkewSet) {
|
|
@@ -3808,13 +3889,13 @@ var ClockSkewManager = /** @class */ (function () {
|
|
|
3808
3889
|
}
|
|
3809
3890
|
}
|
|
3810
3891
|
};
|
|
3811
|
-
_self
|
|
3892
|
+
_self[_DYN_SHOULD_ADD_CLOCK_SKE1 ] = function () {
|
|
3812
3893
|
return _shouldAddClockSkewHeaders;
|
|
3813
3894
|
};
|
|
3814
|
-
_self
|
|
3895
|
+
_self[_DYN_GET_CLOCK_SKEW_HEADE2 ] = function () {
|
|
3815
3896
|
return _clockSkewHeaderValue;
|
|
3816
3897
|
};
|
|
3817
|
-
_self
|
|
3898
|
+
_self[_DYN_SET_CLOCK_SKEW ] = function (timeDeltaInMillis) {
|
|
3818
3899
|
if (!_clockSkewSet) {
|
|
3819
3900
|
if (timeDeltaInMillis) {
|
|
3820
3901
|
_clockSkewHeaderValue = timeDeltaInMillis;
|
|
@@ -3841,21 +3922,21 @@ var KillSwitch = /** @class */ (function () {
|
|
|
3841
3922
|
var result = [];
|
|
3842
3923
|
if (values) {
|
|
3843
3924
|
arrForEach(values, function (value) {
|
|
3844
|
-
result
|
|
3925
|
+
result[_DYN_PUSH ](strTrim(value));
|
|
3845
3926
|
});
|
|
3846
3927
|
}
|
|
3847
3928
|
return result;
|
|
3848
3929
|
}
|
|
3849
3930
|
dynamicProto(KillSwitch, this, function (_self) {
|
|
3850
|
-
_self
|
|
3931
|
+
_self[_DYN_SET_KILL_SWITCH_TENA10 ] = function (killTokens, killDuration) {
|
|
3851
3932
|
if (killTokens && killDuration) {
|
|
3852
3933
|
try {
|
|
3853
|
-
var killedTokens = _normalizeTenants(killTokens
|
|
3934
|
+
var killedTokens = _normalizeTenants(killTokens[_DYN_SPLIT ](","));
|
|
3854
3935
|
if (killDuration === "this-request-only") {
|
|
3855
3936
|
return killedTokens;
|
|
3856
3937
|
}
|
|
3857
3938
|
var durationMs = parseInt(killDuration, 10) * SecToMsMultiplier;
|
|
3858
|
-
for (var i = 0; i < killedTokens
|
|
3939
|
+
for (var i = 0; i < killedTokens[_DYN_LENGTH ]; ++i) {
|
|
3859
3940
|
_killedTokenDictionary[killedTokens[i]] = utcNow() + durationMs;
|
|
3860
3941
|
}
|
|
3861
3942
|
}
|
|
@@ -3865,7 +3946,7 @@ var KillSwitch = /** @class */ (function () {
|
|
|
3865
3946
|
}
|
|
3866
3947
|
return [];
|
|
3867
3948
|
};
|
|
3868
|
-
_self
|
|
3949
|
+
_self[_DYN_IS_TENANT_KILLED ] = function (tenantToken) {
|
|
3869
3950
|
var killDictionary = _killedTokenDictionary;
|
|
3870
3951
|
var name = strTrim(tenantToken);
|
|
3871
3952
|
if (killDictionary[name] !== undefined && killDictionary[name] > utcNow()) {
|
|
@@ -3988,10 +4069,10 @@ var Serializer = /** @class */ (function () {
|
|
|
3988
4069
|
}
|
|
3989
4070
|
lp++;
|
|
3990
4071
|
}
|
|
3991
|
-
if (sizeExceeded
|
|
4072
|
+
if (sizeExceeded.length > 0) {
|
|
3992
4073
|
payload.sizeExceed.push(EventBatch.create(theBatch.iKey(), sizeExceeded));
|
|
3993
4074
|
}
|
|
3994
|
-
if (failedEvts
|
|
4075
|
+
if (failedEvts.length > 0) {
|
|
3995
4076
|
payload.failedEvts.push(EventBatch.create(theBatch.iKey(), failedEvts));
|
|
3996
4077
|
}
|
|
3997
4078
|
if (eventsAdded) {
|
|
@@ -4159,7 +4240,7 @@ function createTimeoutWrapper(argSetTimeout, argClearTimeout) {
|
|
|
4159
4240
|
var _a;
|
|
4160
4241
|
var strSendAttempt = "sendAttempt";
|
|
4161
4242
|
var _noResponseQs = "&" + STR_NO_RESPONSE_BODY + "=true";
|
|
4162
|
-
var UrlQueryString = "?cors=true&" + STR_CONTENT_TYPE_HEADER
|
|
4243
|
+
var UrlQueryString = "?cors=true&" + STR_CONTENT_TYPE_HEADER[_DYN_TO_LOWER_CASE ]() + "=" + DEFAULT_CONTENT_TYPE;
|
|
4163
4244
|
var _eventActionMap = (_a = {},
|
|
4164
4245
|
_a[1 ] = STR_REQUEUE,
|
|
4165
4246
|
_a[100 ] = STR_REQUEUE,
|
|
@@ -4194,12 +4275,12 @@ function _hasHeader(headers, header) {
|
|
|
4194
4275
|
var hasHeader = false;
|
|
4195
4276
|
if (headers && header) {
|
|
4196
4277
|
var keys = objKeys(headers);
|
|
4197
|
-
if (keys && keys
|
|
4198
|
-
var lowerHeader = header
|
|
4199
|
-
for (var lp = 0; lp < keys
|
|
4278
|
+
if (keys && keys[_DYN_LENGTH ] > 0) {
|
|
4279
|
+
var lowerHeader = header[_DYN_TO_LOWER_CASE ]();
|
|
4280
|
+
for (var lp = 0; lp < keys[_DYN_LENGTH ]; lp++) {
|
|
4200
4281
|
var value = keys[lp];
|
|
4201
4282
|
if (value && objHasOwnProperty(header, value) &&
|
|
4202
|
-
value
|
|
4283
|
+
value[_DYN_TO_LOWER_CASE ]() === lowerHeader) {
|
|
4203
4284
|
hasHeader = true;
|
|
4204
4285
|
break;
|
|
4205
4286
|
}
|
|
@@ -4209,10 +4290,10 @@ function _hasHeader(headers, header) {
|
|
|
4209
4290
|
return hasHeader;
|
|
4210
4291
|
}
|
|
4211
4292
|
function _addRequestDetails(details, name, value, useHeaders) {
|
|
4212
|
-
if (name && value && value
|
|
4293
|
+
if (name && value && value[_DYN_LENGTH ] > 0) {
|
|
4213
4294
|
if (useHeaders && _collectorQsHeaders[name]) {
|
|
4214
|
-
details
|
|
4215
|
-
details
|
|
4295
|
+
details[_DYN_HDRS ][_collectorQsHeaders[name]] = value;
|
|
4296
|
+
details[_DYN_USE_HDRS ] = true;
|
|
4216
4297
|
}
|
|
4217
4298
|
else {
|
|
4218
4299
|
details.url += "&" + name + "=" + value;
|
|
@@ -4222,27 +4303,27 @@ function _addRequestDetails(details, name, value, useHeaders) {
|
|
|
4222
4303
|
function _prependTransports(theTransports, newTransports) {
|
|
4223
4304
|
if (newTransports) {
|
|
4224
4305
|
if (isNumber(newTransports)) {
|
|
4225
|
-
theTransports = [newTransports]
|
|
4306
|
+
theTransports = [newTransports][_DYN_CONCAT ](theTransports);
|
|
4226
4307
|
}
|
|
4227
4308
|
else if (isArray(newTransports)) {
|
|
4228
|
-
theTransports = newTransports
|
|
4309
|
+
theTransports = newTransports[_DYN_CONCAT ](theTransports);
|
|
4229
4310
|
}
|
|
4230
4311
|
}
|
|
4231
4312
|
return theTransports;
|
|
4232
4313
|
}
|
|
4233
4314
|
function _addQueryStringParameter(qsParams, name, value) {
|
|
4234
|
-
for (var i = 0; i < qsParams
|
|
4315
|
+
for (var i = 0; i < qsParams[_DYN_LENGTH ]; i++) {
|
|
4235
4316
|
if (qsParams[i].name === name) {
|
|
4236
4317
|
qsParams[i].value = value;
|
|
4237
4318
|
return;
|
|
4238
4319
|
}
|
|
4239
4320
|
}
|
|
4240
|
-
qsParams
|
|
4321
|
+
qsParams[_DYN_PUSH ]({ name: name, value: value });
|
|
4241
4322
|
}
|
|
4242
4323
|
function _removeQueryStringParameter(qsParams, name) {
|
|
4243
|
-
for (var i = 0; i < qsParams
|
|
4324
|
+
for (var i = 0; i < qsParams[_DYN_LENGTH ]; i++) {
|
|
4244
4325
|
if (qsParams[i].name === name) {
|
|
4245
|
-
qsParams
|
|
4326
|
+
qsParams[_DYN_SPLICE ](i, 1);
|
|
4246
4327
|
return;
|
|
4247
4328
|
}
|
|
4248
4329
|
}
|
|
@@ -4282,7 +4363,7 @@ var HttpManager = /** @class */ (function () {
|
|
|
4282
4363
|
dynamicProto(HttpManager, this, function (_self) {
|
|
4283
4364
|
_initDefaults();
|
|
4284
4365
|
var _sendCredentials = true;
|
|
4285
|
-
_self
|
|
4366
|
+
_self[_DYN_INITIALIZE ] = function (theConfig, core, postChannel) {
|
|
4286
4367
|
if (!_isInitialized) {
|
|
4287
4368
|
_core = core;
|
|
4288
4369
|
_cookieMgr = core.getCookieMgr();
|
|
@@ -4292,43 +4373,43 @@ var HttpManager = /** @class */ (function () {
|
|
|
4292
4373
|
var _a;
|
|
4293
4374
|
var coreConfig = details.cfg;
|
|
4294
4375
|
var channelConfig = details.cfg.extensionConfig[postChannel.identifier];
|
|
4295
|
-
_timeoutWrapper = createTimeoutWrapper(channelConfig
|
|
4376
|
+
_timeoutWrapper = createTimeoutWrapper(channelConfig[_DYN_SET_TIMEOUT_OVERRIDE ], channelConfig[_DYN_CLEAR_TIMEOUT_OVERRI3 ]);
|
|
4296
4377
|
if (isValueAssigned(coreConfig.anonCookieName)) {
|
|
4297
4378
|
_addQueryStringParameter(_queryStringParameters, "anoncknm", coreConfig.anonCookieName);
|
|
4298
4379
|
}
|
|
4299
4380
|
else {
|
|
4300
4381
|
_removeQueryStringParameter(_queryStringParameters, "anoncknm");
|
|
4301
4382
|
}
|
|
4302
|
-
_sendHook = channelConfig
|
|
4383
|
+
_sendHook = channelConfig[_DYN_PAYLOAD_PREPROCESSOR ];
|
|
4303
4384
|
_sendListener = channelConfig.payloadListener;
|
|
4304
4385
|
var httpInterface = channelConfig.httpXHROverride;
|
|
4305
|
-
var endpointUrl = channelConfig
|
|
4386
|
+
var endpointUrl = channelConfig[_DYN_OVERRIDE_ENDPOINT_UR4 ] ? channelConfig[_DYN_OVERRIDE_ENDPOINT_UR4 ] : coreConfig.endpointUrl;
|
|
4306
4387
|
_urlString = endpointUrl + UrlQueryString;
|
|
4307
|
-
_useHeaders = !isUndefined(channelConfig
|
|
4308
|
-
_enableEventTimings = !channelConfig
|
|
4388
|
+
_useHeaders = !isUndefined(channelConfig[_DYN_AVOID_OPTIONS ]) ? !channelConfig[_DYN_AVOID_OPTIONS ] : true;
|
|
4389
|
+
_enableEventTimings = !channelConfig[_DYN_DISABLE_EVENT_TIMING5 ];
|
|
4309
4390
|
var valueSanitizer = channelConfig.valueSanitizer;
|
|
4310
|
-
var stringifyObjects = channelConfig
|
|
4311
|
-
var enableCompoundKey = !!coreConfig
|
|
4312
|
-
if (!isUndefined(channelConfig
|
|
4313
|
-
enableCompoundKey = !!channelConfig
|
|
4391
|
+
var stringifyObjects = channelConfig[_DYN_STRINGIFY_OBJECTS ];
|
|
4392
|
+
var enableCompoundKey = !!coreConfig[_DYN_ENABLE_COMPOUND_KEY ];
|
|
4393
|
+
if (!isUndefined(channelConfig[_DYN_ENABLE_COMPOUND_KEY ])) {
|
|
4394
|
+
enableCompoundKey = !!channelConfig[_DYN_ENABLE_COMPOUND_KEY ];
|
|
4314
4395
|
}
|
|
4315
4396
|
_xhrTimeout = channelConfig.xhrTimeout;
|
|
4316
|
-
_disableXhrSync = !!channelConfig
|
|
4317
|
-
_disableFetchKeepAlive = !!channelConfig
|
|
4397
|
+
_disableXhrSync = !!channelConfig[_DYN_DISABLE_XHR_SYNC ];
|
|
4398
|
+
_disableFetchKeepAlive = !!channelConfig[_DYN_DISABLE_FETCH_KEEP_A6 ];
|
|
4318
4399
|
_addNoResponse = channelConfig.addNoResponse !== false;
|
|
4319
4400
|
_useBeacons = !isReactNative();
|
|
4320
4401
|
_serializer = new Serializer(_core, valueSanitizer, stringifyObjects, enableCompoundKey);
|
|
4321
|
-
if (!isNullOrUndefined(channelConfig
|
|
4322
|
-
_useBeacons = !!channelConfig
|
|
4402
|
+
if (!isNullOrUndefined(channelConfig[_DYN_USE_SEND_BEACON ])) {
|
|
4403
|
+
_useBeacons = !!channelConfig[_DYN_USE_SEND_BEACON ];
|
|
4323
4404
|
}
|
|
4324
4405
|
var syncHttpInterface = httpInterface;
|
|
4325
|
-
var beaconHttpInterface = channelConfig
|
|
4326
|
-
var fetchSyncHttpInterface = channelConfig
|
|
4406
|
+
var beaconHttpInterface = channelConfig[_DYN_ALWAYS_USE_XHR_OVERR7 ] ? httpInterface : null;
|
|
4407
|
+
var fetchSyncHttpInterface = channelConfig[_DYN_ALWAYS_USE_XHR_OVERR7 ] ? httpInterface : null;
|
|
4327
4408
|
var beaconUnloadTransports = [3 , 2 ];
|
|
4328
4409
|
if (!httpInterface) {
|
|
4329
4410
|
_customHttpInterface = false;
|
|
4330
4411
|
var location_1 = getLocation();
|
|
4331
|
-
if (location_1 && location_1.protocol && location_1.protocol
|
|
4412
|
+
if (location_1 && location_1.protocol && location_1.protocol[_DYN_TO_LOWER_CASE ]() === "file:") {
|
|
4332
4413
|
_sendCredentials = false;
|
|
4333
4414
|
}
|
|
4334
4415
|
var theTransports = [];
|
|
@@ -4347,7 +4428,7 @@ var HttpManager = /** @class */ (function () {
|
|
|
4347
4428
|
syncHttpInterface = _getSenderInterface(theTransports, true);
|
|
4348
4429
|
}
|
|
4349
4430
|
if (!beaconHttpInterface) {
|
|
4350
|
-
beaconUnloadTransports = _prependTransports(beaconUnloadTransports, channelConfig
|
|
4431
|
+
beaconUnloadTransports = _prependTransports(beaconUnloadTransports, channelConfig[_DYN_UNLOAD_TRANSPORTS ]);
|
|
4351
4432
|
beaconHttpInterface = _getSenderInterface(beaconUnloadTransports, true);
|
|
4352
4433
|
}
|
|
4353
4434
|
_canHaveReducedPayload = !_customHttpInterface && ((_useBeacons && isBeaconsSupported()) || (!_disableFetchKeepAlive && isFetchSupported(true)));
|
|
@@ -4362,12 +4443,12 @@ var HttpManager = /** @class */ (function () {
|
|
|
4362
4443
|
}
|
|
4363
4444
|
};
|
|
4364
4445
|
_self.addResponseHandler = function (responseHandler) {
|
|
4365
|
-
_responseHandlers
|
|
4446
|
+
_responseHandlers[_DYN_PUSH ](responseHandler);
|
|
4366
4447
|
return {
|
|
4367
4448
|
rm: function () {
|
|
4368
4449
|
var index = _responseHandlers.indexOf(responseHandler);
|
|
4369
4450
|
if (index >= 0) {
|
|
4370
|
-
_responseHandlers
|
|
4451
|
+
_responseHandlers[_DYN_SPLICE ](index, 1);
|
|
4371
4452
|
}
|
|
4372
4453
|
}
|
|
4373
4454
|
};
|
|
@@ -4376,7 +4457,7 @@ var HttpManager = /** @class */ (function () {
|
|
|
4376
4457
|
var transportType = 0 ;
|
|
4377
4458
|
var sendPostFunc = null;
|
|
4378
4459
|
var lp = 0;
|
|
4379
|
-
while (sendPostFunc == null && lp < transports
|
|
4460
|
+
while (sendPostFunc == null && lp < transports[_DYN_LENGTH ]) {
|
|
4380
4461
|
transportType = transports[lp];
|
|
4381
4462
|
if (transportType === 1 ) {
|
|
4382
4463
|
if (useXDomainRequest()) {
|
|
@@ -4408,9 +4489,9 @@ var HttpManager = /** @class */ (function () {
|
|
|
4408
4489
|
};
|
|
4409
4490
|
function _xdrSendPost(payload, oncomplete, sync) {
|
|
4410
4491
|
var xdr = new XDomainRequest();
|
|
4411
|
-
xdr.open(STR_POST_METHOD, payload
|
|
4412
|
-
if (payload
|
|
4413
|
-
xdr
|
|
4492
|
+
xdr.open(STR_POST_METHOD, payload[_DYN_URL_STRING ]);
|
|
4493
|
+
if (payload[_DYN_TIMEOUT ]) {
|
|
4494
|
+
xdr[_DYN_TIMEOUT ] = payload[_DYN_TIMEOUT ];
|
|
4414
4495
|
}
|
|
4415
4496
|
xdr.onload = function () {
|
|
4416
4497
|
var response = _getResponseText(xdr);
|
|
@@ -4420,16 +4501,16 @@ var HttpManager = /** @class */ (function () {
|
|
|
4420
4501
|
xdr.onerror = function () {
|
|
4421
4502
|
_doOnComplete(oncomplete, 400, {});
|
|
4422
4503
|
};
|
|
4423
|
-
xdr
|
|
4504
|
+
xdr[_DYN_ONTIMEOUT ] = function () {
|
|
4424
4505
|
_doOnComplete(oncomplete, 500, {});
|
|
4425
4506
|
};
|
|
4426
4507
|
xdr.onprogress = function () { };
|
|
4427
4508
|
if (sync) {
|
|
4428
|
-
xdr.send(payload
|
|
4509
|
+
xdr.send(payload[_DYN_DATA ]);
|
|
4429
4510
|
}
|
|
4430
4511
|
else {
|
|
4431
4512
|
_timeoutWrapper.set(function () {
|
|
4432
|
-
xdr.send(payload
|
|
4513
|
+
xdr.send(payload[_DYN_DATA ]);
|
|
4433
4514
|
}, 0);
|
|
4434
4515
|
}
|
|
4435
4516
|
}
|
|
@@ -4468,18 +4549,18 @@ var HttpManager = /** @class */ (function () {
|
|
|
4468
4549
|
}
|
|
4469
4550
|
function _fetchSendPost(payload, oncomplete, sync) {
|
|
4470
4551
|
var _a;
|
|
4471
|
-
var theUrl = payload
|
|
4552
|
+
var theUrl = payload[_DYN_URL_STRING ];
|
|
4472
4553
|
var ignoreResponse = false;
|
|
4473
4554
|
var responseHandled = false;
|
|
4474
4555
|
var requestInit = (_a = {
|
|
4475
|
-
body: payload
|
|
4556
|
+
body: payload[_DYN_DATA ],
|
|
4476
4557
|
method: STR_POST_METHOD
|
|
4477
4558
|
},
|
|
4478
4559
|
_a[STR_DISABLED_PROPERTY_NAME] = true,
|
|
4479
4560
|
_a);
|
|
4480
4561
|
if (sync) {
|
|
4481
4562
|
requestInit.keepalive = true;
|
|
4482
|
-
if (payload
|
|
4563
|
+
if (payload[_DYN__SEND_REASON ] === 2 ) {
|
|
4483
4564
|
ignoreResponse = true;
|
|
4484
4565
|
if (_addNoResponse) {
|
|
4485
4566
|
theUrl += _noResponseQs;
|
|
@@ -4489,13 +4570,13 @@ var HttpManager = /** @class */ (function () {
|
|
|
4489
4570
|
if (_sendCredentials) {
|
|
4490
4571
|
requestInit.credentials = "include";
|
|
4491
4572
|
}
|
|
4492
|
-
if (payload.headers && objKeys(payload.headers)
|
|
4493
|
-
requestInit
|
|
4573
|
+
if (payload.headers && objKeys(payload.headers)[_DYN_LENGTH ] > 0) {
|
|
4574
|
+
requestInit[_DYN_HEADERS ] = payload[_DYN_HEADERS ];
|
|
4494
4575
|
}
|
|
4495
4576
|
fetch(theUrl, requestInit).then(function (response) {
|
|
4496
4577
|
var headerMap = {};
|
|
4497
4578
|
var responseText = STR_EMPTY;
|
|
4498
|
-
var headers = response
|
|
4579
|
+
var headers = response[_DYN_HEADERS ];
|
|
4499
4580
|
if (headers) {
|
|
4500
4581
|
headers["forEach"](function (value, name) {
|
|
4501
4582
|
headerMap[name] = value;
|
|
@@ -4521,20 +4602,20 @@ var HttpManager = /** @class */ (function () {
|
|
|
4521
4602
|
responseHandled = true;
|
|
4522
4603
|
_doOnComplete(oncomplete, 200, {});
|
|
4523
4604
|
}
|
|
4524
|
-
if (!responseHandled && payload
|
|
4605
|
+
if (!responseHandled && payload[_DYN_TIMEOUT ] > 0) {
|
|
4525
4606
|
_timeoutWrapper.set(function () {
|
|
4526
4607
|
if (!responseHandled) {
|
|
4527
4608
|
responseHandled = true;
|
|
4528
4609
|
_doOnComplete(oncomplete, 500, {});
|
|
4529
4610
|
}
|
|
4530
|
-
}, payload
|
|
4611
|
+
}, payload[_DYN_TIMEOUT ]);
|
|
4531
4612
|
}
|
|
4532
4613
|
}
|
|
4533
4614
|
function _xhrSendPost(payload, oncomplete, sync) {
|
|
4534
|
-
var theUrl = payload
|
|
4615
|
+
var theUrl = payload[_DYN_URL_STRING ];
|
|
4535
4616
|
function _appendHeader(theHeaders, xhr, name) {
|
|
4536
|
-
if (!theHeaders[name] && xhr && xhr
|
|
4537
|
-
var value = xhr
|
|
4617
|
+
if (!theHeaders[name] && xhr && xhr[_DYN_GET_RESPONSE_HEADER ]) {
|
|
4618
|
+
var value = xhr[_DYN_GET_RESPONSE_HEADER ](name);
|
|
4538
4619
|
if (value) {
|
|
4539
4620
|
theHeaders[name] = strTrim(value);
|
|
4540
4621
|
}
|
|
@@ -4543,24 +4624,24 @@ var HttpManager = /** @class */ (function () {
|
|
|
4543
4624
|
}
|
|
4544
4625
|
function _getAllResponseHeaders(xhr) {
|
|
4545
4626
|
var theHeaders = {};
|
|
4546
|
-
if (!xhr
|
|
4627
|
+
if (!xhr[_DYN_GET_ALL_RESPONSE_HEA8 ]) {
|
|
4547
4628
|
theHeaders = _appendHeader(theHeaders, xhr, STR_TIME_DELTA_HEADER);
|
|
4548
4629
|
theHeaders = _appendHeader(theHeaders, xhr, STR_KILL_DURATION_HEADER);
|
|
4549
4630
|
theHeaders = _appendHeader(theHeaders, xhr, STR_KILL_DURATION_SECONDS_HEADER);
|
|
4550
4631
|
}
|
|
4551
4632
|
else {
|
|
4552
|
-
theHeaders = _convertAllHeadersToMap(xhr
|
|
4633
|
+
theHeaders = _convertAllHeadersToMap(xhr[_DYN_GET_ALL_RESPONSE_HEA8 ]());
|
|
4553
4634
|
}
|
|
4554
4635
|
return theHeaders;
|
|
4555
4636
|
}
|
|
4556
4637
|
function xhrComplete(xhr, responseTxt) {
|
|
4557
4638
|
_doOnComplete(oncomplete, xhr.status, _getAllResponseHeaders(xhr), responseTxt);
|
|
4558
4639
|
}
|
|
4559
|
-
if (sync && payload
|
|
4640
|
+
if (sync && payload[_DYN_DISABLE_XHR_SYNC ]) {
|
|
4560
4641
|
sync = false;
|
|
4561
4642
|
}
|
|
4562
|
-
var xhrRequest = openXhr(STR_POST_METHOD, theUrl, _sendCredentials, true, sync, payload
|
|
4563
|
-
objForEachKey(payload
|
|
4643
|
+
var xhrRequest = openXhr(STR_POST_METHOD, theUrl, _sendCredentials, true, sync, payload[_DYN_TIMEOUT ]);
|
|
4644
|
+
objForEachKey(payload[_DYN_HEADERS ], function (name, value) {
|
|
4564
4645
|
xhrRequest.setRequestHeader(name, value);
|
|
4565
4646
|
});
|
|
4566
4647
|
xhrRequest.onload = function () {
|
|
@@ -4571,10 +4652,10 @@ var HttpManager = /** @class */ (function () {
|
|
|
4571
4652
|
xhrRequest.onerror = function () {
|
|
4572
4653
|
xhrComplete(xhrRequest);
|
|
4573
4654
|
};
|
|
4574
|
-
xhrRequest
|
|
4655
|
+
xhrRequest[_DYN_ONTIMEOUT ] = function () {
|
|
4575
4656
|
xhrComplete(xhrRequest);
|
|
4576
4657
|
};
|
|
4577
|
-
xhrRequest.send(payload
|
|
4658
|
+
xhrRequest.send(payload[_DYN_DATA ]);
|
|
4578
4659
|
}
|
|
4579
4660
|
function _doOnComplete(oncomplete, status, headers, response) {
|
|
4580
4661
|
try {
|
|
@@ -4587,28 +4668,28 @@ var HttpManager = /** @class */ (function () {
|
|
|
4587
4668
|
function _beaconSendPost(payload, oncomplete, sync) {
|
|
4588
4669
|
var internalPayloadData = payload;
|
|
4589
4670
|
var status = 200;
|
|
4590
|
-
var thePayload = internalPayloadData
|
|
4591
|
-
var theUrl = payload
|
|
4671
|
+
var thePayload = internalPayloadData[_DYN__THE_PAYLOAD ];
|
|
4672
|
+
var theUrl = payload[_DYN_URL_STRING ] + (_addNoResponse ? _noResponseQs : STR_EMPTY);
|
|
4592
4673
|
try {
|
|
4593
4674
|
var nav_1 = getNavigator();
|
|
4594
|
-
if (!nav_1.sendBeacon(theUrl, payload
|
|
4675
|
+
if (!nav_1.sendBeacon(theUrl, payload[_DYN_DATA ])) {
|
|
4595
4676
|
if (thePayload) {
|
|
4596
4677
|
var droppedBatches_1 = [];
|
|
4597
|
-
arrForEach(thePayload
|
|
4598
|
-
if (droppedBatches_1 && theBatch && theBatch
|
|
4599
|
-
var theEvents = theBatch
|
|
4600
|
-
for (var lp = 0; lp < theEvents
|
|
4678
|
+
arrForEach(thePayload[_DYN_BATCHES ], function (theBatch) {
|
|
4679
|
+
if (droppedBatches_1 && theBatch && theBatch[_DYN_COUNT ]() > 0) {
|
|
4680
|
+
var theEvents = theBatch[_DYN_EVENTS ]();
|
|
4681
|
+
for (var lp = 0; lp < theEvents[_DYN_LENGTH ]; lp++) {
|
|
4601
4682
|
if (!nav_1.sendBeacon(theUrl, _serializer.getEventBlob(theEvents[lp]))) {
|
|
4602
|
-
droppedBatches_1
|
|
4683
|
+
droppedBatches_1[_DYN_PUSH ](theBatch[_DYN_SPLIT ](lp));
|
|
4603
4684
|
break;
|
|
4604
4685
|
}
|
|
4605
4686
|
}
|
|
4606
4687
|
}
|
|
4607
4688
|
else {
|
|
4608
|
-
droppedBatches_1
|
|
4689
|
+
droppedBatches_1[_DYN_PUSH ](theBatch[_DYN_SPLIT ](0));
|
|
4609
4690
|
}
|
|
4610
4691
|
});
|
|
4611
|
-
_sendBatchesNotification(droppedBatches_1, 8003 , thePayload
|
|
4692
|
+
_sendBatchesNotification(droppedBatches_1, 8003 , thePayload[_DYN_SEND_TYPE ], true);
|
|
4612
4693
|
}
|
|
4613
4694
|
else {
|
|
4614
4695
|
status = 0;
|
|
@@ -4635,10 +4716,10 @@ var HttpManager = /** @class */ (function () {
|
|
|
4635
4716
|
_self.addHeader = function (name, value) {
|
|
4636
4717
|
_headers[name] = value;
|
|
4637
4718
|
};
|
|
4638
|
-
_self
|
|
4639
|
-
return _hasIdleConnection() && _clockSkewManager
|
|
4719
|
+
_self[_DYN_CAN_SEND_REQUEST ] = function () {
|
|
4720
|
+
return _hasIdleConnection() && _clockSkewManager[_DYN_ALLOW_REQUEST_SENDIN0 ]();
|
|
4640
4721
|
};
|
|
4641
|
-
_self
|
|
4722
|
+
_self[_DYN_SEND_QUEUED_REQUESTS ] = function (sendType, sendReason) {
|
|
4642
4723
|
if (isUndefined(sendType)) {
|
|
4643
4724
|
sendType = 0 ;
|
|
4644
4725
|
}
|
|
@@ -4650,23 +4731,23 @@ var HttpManager = /** @class */ (function () {
|
|
|
4650
4731
|
_sendBatches(_clearQueue(), 0, false, sendType, sendReason || 0 );
|
|
4651
4732
|
}
|
|
4652
4733
|
};
|
|
4653
|
-
_self
|
|
4654
|
-
return !_paused && _outstandingRequests === 0 && _batchQueue
|
|
4734
|
+
_self[_DYN_IS_COMPLETELY_IDLE ] = function () {
|
|
4735
|
+
return !_paused && _outstandingRequests === 0 && _batchQueue[_DYN_LENGTH ] === 0;
|
|
4655
4736
|
};
|
|
4656
|
-
_self
|
|
4737
|
+
_self[_DYN_SET_UNLOADING ] = function (value) {
|
|
4657
4738
|
_isUnloading = value;
|
|
4658
4739
|
};
|
|
4659
4740
|
_self.addBatch = function (theBatch) {
|
|
4660
|
-
if (theBatch && theBatch
|
|
4661
|
-
if (_killSwitch.isTenantKilled(theBatch
|
|
4741
|
+
if (theBatch && theBatch[_DYN_COUNT ]() > 0) {
|
|
4742
|
+
if (_killSwitch.isTenantKilled(theBatch[_DYN_I_KEY ]())) {
|
|
4662
4743
|
return false;
|
|
4663
4744
|
}
|
|
4664
|
-
_batchQueue
|
|
4745
|
+
_batchQueue[_DYN_PUSH ](theBatch);
|
|
4665
4746
|
}
|
|
4666
4747
|
return true;
|
|
4667
4748
|
};
|
|
4668
4749
|
_self.teardown = function () {
|
|
4669
|
-
if (_batchQueue
|
|
4750
|
+
if (_batchQueue[_DYN_LENGTH ] > 0) {
|
|
4670
4751
|
_sendBatches(_clearQueue(), 0, true, 2 , 2 );
|
|
4671
4752
|
}
|
|
4672
4753
|
arrForEach(_unloadHooks, function (hook) {
|
|
@@ -4679,10 +4760,10 @@ var HttpManager = /** @class */ (function () {
|
|
|
4679
4760
|
};
|
|
4680
4761
|
_self.resume = function () {
|
|
4681
4762
|
_paused = false;
|
|
4682
|
-
_self
|
|
4763
|
+
_self[_DYN_SEND_QUEUED_REQUESTS ](0 , 4 );
|
|
4683
4764
|
};
|
|
4684
|
-
_self
|
|
4685
|
-
if (batch && batch
|
|
4765
|
+
_self[_DYN_SEND_SYNCHRONOUS_BAT9 ] = function (batch, sendType, sendReason) {
|
|
4766
|
+
if (batch && batch[_DYN_COUNT ]() > 0) {
|
|
4686
4767
|
if (isNullOrUndefined(sendType)) {
|
|
4687
4768
|
sendType = 1 ;
|
|
4688
4769
|
}
|
|
@@ -4703,8 +4784,8 @@ var HttpManager = /** @class */ (function () {
|
|
|
4703
4784
|
}
|
|
4704
4785
|
function _canSendPayload(theBatches, sendType, retryCnt) {
|
|
4705
4786
|
var result = false;
|
|
4706
|
-
if (theBatches && theBatches
|
|
4707
|
-
result = (sendType !== 0 ) || (_hasIdleConnection() && (retryCnt > 0 || _clockSkewManager
|
|
4787
|
+
if (theBatches && theBatches[_DYN_LENGTH ] > 0 && !_paused && _sendInterfaces[sendType] && _serializer) {
|
|
4788
|
+
result = (sendType !== 0 ) || (_hasIdleConnection() && (retryCnt > 0 || _clockSkewManager[_DYN_ALLOW_REQUEST_SENDIN0 ]()));
|
|
4708
4789
|
}
|
|
4709
4790
|
return result;
|
|
4710
4791
|
}
|
|
@@ -4713,15 +4794,15 @@ var HttpManager = /** @class */ (function () {
|
|
|
4713
4794
|
if (theBatches) {
|
|
4714
4795
|
arrForEach(theBatches, function (theBatch, idx) {
|
|
4715
4796
|
values[idx] = {
|
|
4716
|
-
iKey: theBatch
|
|
4717
|
-
evts: theBatch
|
|
4797
|
+
iKey: theBatch[_DYN_I_KEY ](),
|
|
4798
|
+
evts: theBatch[_DYN_EVENTS ]()
|
|
4718
4799
|
};
|
|
4719
4800
|
});
|
|
4720
4801
|
}
|
|
4721
4802
|
return values;
|
|
4722
4803
|
}
|
|
4723
4804
|
function _sendBatches(theBatches, retryCount, isTeardown, sendType, sendReason) {
|
|
4724
|
-
if (!theBatches || theBatches
|
|
4805
|
+
if (!theBatches || theBatches[_DYN_LENGTH ] === 0) {
|
|
4725
4806
|
return;
|
|
4726
4807
|
}
|
|
4727
4808
|
if (_paused) {
|
|
@@ -4740,21 +4821,21 @@ var HttpManager = /** @class */ (function () {
|
|
|
4740
4821
|
var thePayload = null;
|
|
4741
4822
|
var serializationStart = getTime();
|
|
4742
4823
|
var sendInterface = _sendInterfaces[sendType] || (isSynchronous_1 ? _sendInterfaces[1 ] : _sendInterfaces[0 ]);
|
|
4743
|
-
var sendTransport = sendInterface && sendInterface
|
|
4824
|
+
var sendTransport = sendInterface && sendInterface[_DYN__TRANSPORT ];
|
|
4744
4825
|
var isReducedPayload = _canHaveReducedPayload && (_isUnloading || _isBeaconPayload(sendType) || (sendTransport === 3 || (sendInterface._isSync && sendTransport === 2 )));
|
|
4745
4826
|
while (_canSendPayload(theBatches, sendType, retryCount)) {
|
|
4746
4827
|
var theBatch = theBatches.shift();
|
|
4747
|
-
if (theBatch && theBatch
|
|
4748
|
-
if (!_killSwitch.isTenantKilled(theBatch
|
|
4828
|
+
if (theBatch && theBatch[_DYN_COUNT ]() > 0) {
|
|
4829
|
+
if (!_killSwitch.isTenantKilled(theBatch[_DYN_I_KEY ]())) {
|
|
4749
4830
|
thePayload = thePayload || _serializer.createPayload(retryCount, isTeardown, isSynchronous_1, isReducedPayload, sendReason, sendType);
|
|
4750
4831
|
if (!_serializer.appendPayload(thePayload, theBatch, maxEventsPerBatch)) {
|
|
4751
4832
|
_doPayloadSend(thePayload, serializationStart, getTime(), sendReason);
|
|
4752
4833
|
serializationStart = getTime();
|
|
4753
|
-
theBatches = [theBatch]
|
|
4834
|
+
theBatches = [theBatch][_DYN_CONCAT ](theBatches);
|
|
4754
4835
|
thePayload = null;
|
|
4755
4836
|
}
|
|
4756
4837
|
else if (thePayload.overflow !== null) {
|
|
4757
|
-
theBatches = [thePayload.overflow]
|
|
4838
|
+
theBatches = [thePayload.overflow][_DYN_CONCAT ](theBatches);
|
|
4758
4839
|
thePayload.overflow = null;
|
|
4759
4840
|
_doPayloadSend(thePayload, serializationStart, getTime(), sendReason);
|
|
4760
4841
|
serializationStart = getTime();
|
|
@@ -4762,15 +4843,15 @@ var HttpManager = /** @class */ (function () {
|
|
|
4762
4843
|
}
|
|
4763
4844
|
}
|
|
4764
4845
|
else {
|
|
4765
|
-
droppedBatches
|
|
4846
|
+
droppedBatches[_DYN_PUSH ](theBatch);
|
|
4766
4847
|
}
|
|
4767
4848
|
}
|
|
4768
4849
|
}
|
|
4769
4850
|
if (thePayload) {
|
|
4770
4851
|
_doPayloadSend(thePayload, serializationStart, getTime(), sendReason);
|
|
4771
4852
|
}
|
|
4772
|
-
if (theBatches
|
|
4773
|
-
_batchQueue = theBatches
|
|
4853
|
+
if (theBatches[_DYN_LENGTH ] > 0) {
|
|
4854
|
+
_batchQueue = theBatches[_DYN_CONCAT ](_batchQueue);
|
|
4774
4855
|
}
|
|
4775
4856
|
_sendBatchesNotification(droppedBatches, 8004 , sendType);
|
|
4776
4857
|
}, function () { return ({ batches: _createDebugBatches(orgBatches_1), retryCount: retryCount, isTeardown: isTeardown, isSynchronous: isSynchronous_1, sendReason: sendReason, useSendBeacon: _isBeaconPayload(sendType), sendType: sendType }); }, !isSynchronous_1);
|
|
@@ -4791,20 +4872,20 @@ var HttpManager = /** @class */ (function () {
|
|
|
4791
4872
|
_addRequestDetails(requestDetails, _collectorHeaderToQs[name], value, false);
|
|
4792
4873
|
}
|
|
4793
4874
|
else {
|
|
4794
|
-
requestDetails
|
|
4795
|
-
requestDetails
|
|
4875
|
+
requestDetails[_DYN_HDRS ][name] = value;
|
|
4876
|
+
requestDetails[_DYN_USE_HDRS ] = true;
|
|
4796
4877
|
}
|
|
4797
4878
|
});
|
|
4798
4879
|
}
|
|
4799
4880
|
else {
|
|
4800
|
-
requestDetails
|
|
4801
|
-
requestDetails.useHdrs = (objKeys(requestDetails.hdrs)
|
|
4881
|
+
requestDetails[_DYN_HDRS ] = extend(requestDetails[_DYN_HDRS ], _headers);
|
|
4882
|
+
requestDetails.useHdrs = (objKeys(requestDetails.hdrs)[_DYN_LENGTH ] > 0);
|
|
4802
4883
|
}
|
|
4803
4884
|
_addRequestDetails(requestDetails, STR_CLIENT_ID, "NO_AUTH", useHeaders);
|
|
4804
4885
|
_addRequestDetails(requestDetails, STR_CLIENT_VERSION, FullVersionString, useHeaders);
|
|
4805
4886
|
var apiQsKeys = STR_EMPTY;
|
|
4806
4887
|
arrForEach(thePayload.apiKeys, function (apiKey) {
|
|
4807
|
-
if (apiQsKeys
|
|
4888
|
+
if (apiQsKeys[_DYN_LENGTH ] > 0) {
|
|
4808
4889
|
apiQsKeys += ",";
|
|
4809
4890
|
}
|
|
4810
4891
|
apiQsKeys += apiKey;
|
|
@@ -4815,16 +4896,16 @@ var HttpManager = /** @class */ (function () {
|
|
|
4815
4896
|
if (isValueAssigned(msfpc)) {
|
|
4816
4897
|
requestDetails.url += "&ext.intweb.msfpc=" + msfpc;
|
|
4817
4898
|
}
|
|
4818
|
-
if (_clockSkewManager
|
|
4819
|
-
_addRequestDetails(requestDetails, STR_TIME_DELTA_TO_APPLY, _clockSkewManager
|
|
4899
|
+
if (_clockSkewManager[_DYN_SHOULD_ADD_CLOCK_SKE1 ]()) {
|
|
4900
|
+
_addRequestDetails(requestDetails, STR_TIME_DELTA_TO_APPLY, _clockSkewManager[_DYN_GET_CLOCK_SKEW_HEADE2 ](), useHeaders);
|
|
4820
4901
|
}
|
|
4821
|
-
if (_core
|
|
4822
|
-
var wParam = _core
|
|
4902
|
+
if (_core[_DYN_GET_WPARAM ]) {
|
|
4903
|
+
var wParam = _core[_DYN_GET_WPARAM ]();
|
|
4823
4904
|
if (wParam >= 0) {
|
|
4824
4905
|
requestDetails.url += "&w=" + wParam;
|
|
4825
4906
|
}
|
|
4826
4907
|
}
|
|
4827
|
-
for (var i = 0; i < _queryStringParameters
|
|
4908
|
+
for (var i = 0; i < _queryStringParameters[_DYN_LENGTH ]; i++) {
|
|
4828
4909
|
requestDetails.url += "&" + _queryStringParameters[i].name + "=" + _queryStringParameters[i].value;
|
|
4829
4910
|
}
|
|
4830
4911
|
return requestDetails;
|
|
@@ -4834,27 +4915,27 @@ var HttpManager = /** @class */ (function () {
|
|
|
4834
4915
|
timings[name][_postManager.identifier] = value;
|
|
4835
4916
|
}
|
|
4836
4917
|
function _doPayloadSend(thePayload, serializationStart, serializationCompleted, sendReason) {
|
|
4837
|
-
if (thePayload && thePayload.payloadBlob && thePayload.payloadBlob
|
|
4918
|
+
if (thePayload && thePayload.payloadBlob && thePayload.payloadBlob[_DYN_LENGTH ] > 0) {
|
|
4838
4919
|
var useSendHook_1 = !!_sendHook;
|
|
4839
4920
|
var sendInterface_1 = _sendInterfaces[thePayload.sendType];
|
|
4840
|
-
if (!_isBeaconPayload(thePayload
|
|
4921
|
+
if (!_isBeaconPayload(thePayload[_DYN_SEND_TYPE ]) && thePayload[_DYN_IS_BEACON ] && thePayload.sendReason === 2 ) {
|
|
4841
4922
|
sendInterface_1 = _sendInterfaces[2 ] || _sendInterfaces[3 ] || sendInterface_1;
|
|
4842
4923
|
}
|
|
4843
4924
|
var useHeaders_1 = _useHeaders;
|
|
4844
|
-
if (thePayload.isBeacon || sendInterface_1
|
|
4925
|
+
if (thePayload.isBeacon || sendInterface_1[_DYN__TRANSPORT ] === 3 ) {
|
|
4845
4926
|
useHeaders_1 = false;
|
|
4846
4927
|
}
|
|
4847
4928
|
var requestDetails_1 = _buildRequestDetails(thePayload, useHeaders_1);
|
|
4848
|
-
useHeaders_1 = useHeaders_1 || requestDetails_1
|
|
4929
|
+
useHeaders_1 = useHeaders_1 || requestDetails_1[_DYN_USE_HDRS ];
|
|
4849
4930
|
var sendEventStart_1 = getTime();
|
|
4850
4931
|
doPerf(_core, function () { return "HttpManager:_doPayloadSend"; }, function () {
|
|
4851
|
-
for (var batchLp = 0; batchLp < thePayload.batches
|
|
4852
|
-
var theBatch = thePayload
|
|
4853
|
-
var theEvents = theBatch
|
|
4854
|
-
for (var evtLp = 0; evtLp < theEvents
|
|
4932
|
+
for (var batchLp = 0; batchLp < thePayload.batches[_DYN_LENGTH ]; batchLp++) {
|
|
4933
|
+
var theBatch = thePayload[_DYN_BATCHES ][batchLp];
|
|
4934
|
+
var theEvents = theBatch[_DYN_EVENTS ]();
|
|
4935
|
+
for (var evtLp = 0; evtLp < theEvents[_DYN_LENGTH ]; evtLp++) {
|
|
4855
4936
|
var telemetryItem = theEvents[evtLp];
|
|
4856
4937
|
if (_enableEventTimings) {
|
|
4857
|
-
var timings = telemetryItem
|
|
4938
|
+
var timings = telemetryItem[_DYN_TIMINGS ] = telemetryItem[_DYN_TIMINGS ] || {};
|
|
4858
4939
|
_setTimingValue(timings, "sendEventStart", sendEventStart_1);
|
|
4859
4940
|
_setTimingValue(timings, "serializationStart", serializationStart);
|
|
4860
4941
|
_setTimingValue(timings, "serializationCompleted", serializationCompleted);
|
|
@@ -4862,11 +4943,11 @@ var HttpManager = /** @class */ (function () {
|
|
|
4862
4943
|
telemetryItem[strSendAttempt] > 0 ? telemetryItem[strSendAttempt]++ : telemetryItem[strSendAttempt] = 1;
|
|
4863
4944
|
}
|
|
4864
4945
|
}
|
|
4865
|
-
_sendBatchesNotification(thePayload
|
|
4946
|
+
_sendBatchesNotification(thePayload[_DYN_BATCHES ], (1000 + (sendReason || 0 )), thePayload[_DYN_SEND_TYPE ], true);
|
|
4866
4947
|
var orgPayloadData = {
|
|
4867
4948
|
data: thePayload.payloadBlob,
|
|
4868
4949
|
urlString: requestDetails_1.url,
|
|
4869
|
-
headers: requestDetails_1
|
|
4950
|
+
headers: requestDetails_1[_DYN_HDRS ],
|
|
4870
4951
|
_thePayload: thePayload,
|
|
4871
4952
|
_sendReason: sendReason,
|
|
4872
4953
|
timeout: _xhrTimeout,
|
|
@@ -4874,25 +4955,25 @@ var HttpManager = /** @class */ (function () {
|
|
|
4874
4955
|
disableFetchKeepAlive: _disableFetchKeepAlive
|
|
4875
4956
|
};
|
|
4876
4957
|
if (useHeaders_1) {
|
|
4877
|
-
if (!_hasHeader(orgPayloadData
|
|
4878
|
-
orgPayloadData
|
|
4958
|
+
if (!_hasHeader(orgPayloadData[_DYN_HEADERS ], STR_CACHE_CONTROL)) {
|
|
4959
|
+
orgPayloadData[_DYN_HEADERS ][STR_CACHE_CONTROL] = DEFAULT_CACHE_CONTROL;
|
|
4879
4960
|
}
|
|
4880
|
-
if (!_hasHeader(orgPayloadData
|
|
4881
|
-
orgPayloadData
|
|
4961
|
+
if (!_hasHeader(orgPayloadData[_DYN_HEADERS ], STR_CONTENT_TYPE_HEADER)) {
|
|
4962
|
+
orgPayloadData[_DYN_HEADERS ][STR_CONTENT_TYPE_HEADER] = DEFAULT_CONTENT_TYPE;
|
|
4882
4963
|
}
|
|
4883
4964
|
}
|
|
4884
4965
|
var sender = null;
|
|
4885
4966
|
if (sendInterface_1) {
|
|
4886
4967
|
sender = function (payload) {
|
|
4887
|
-
_clockSkewManager
|
|
4968
|
+
_clockSkewManager[_DYN_FIRST_REQUEST_SENT ]();
|
|
4888
4969
|
var onComplete = function (status, headers) {
|
|
4889
4970
|
_retryRequestIfNeeded(status, headers, thePayload, sendReason);
|
|
4890
4971
|
};
|
|
4891
|
-
var isSync = thePayload
|
|
4972
|
+
var isSync = thePayload[_DYN_IS_TEARDOWN ] || thePayload[_DYN_IS_SYNC ];
|
|
4892
4973
|
try {
|
|
4893
|
-
sendInterface_1
|
|
4974
|
+
sendInterface_1[_DYN_SEND_POST ](payload, onComplete, isSync);
|
|
4894
4975
|
if (_sendListener) {
|
|
4895
|
-
_sendListener(orgPayloadData, payload, isSync, thePayload
|
|
4976
|
+
_sendListener(orgPayloadData, payload, isSync, thePayload[_DYN_IS_BEACON ]);
|
|
4896
4977
|
}
|
|
4897
4978
|
}
|
|
4898
4979
|
catch (ex) {
|
|
@@ -4903,29 +4984,29 @@ var HttpManager = /** @class */ (function () {
|
|
|
4903
4984
|
}
|
|
4904
4985
|
doPerf(_core, function () { return "HttpManager:_doPayloadSend.sender"; }, function () {
|
|
4905
4986
|
if (sender) {
|
|
4906
|
-
if (thePayload
|
|
4987
|
+
if (thePayload[_DYN_SEND_TYPE ] === 0 ) {
|
|
4907
4988
|
_outstandingRequests++;
|
|
4908
4989
|
}
|
|
4909
|
-
if (useSendHook_1 && !thePayload.isBeacon && sendInterface_1
|
|
4990
|
+
if (useSendHook_1 && !thePayload.isBeacon && sendInterface_1[_DYN__TRANSPORT ] !== 3 ) {
|
|
4910
4991
|
var hookData_1 = {
|
|
4911
|
-
data: orgPayloadData
|
|
4912
|
-
urlString: orgPayloadData
|
|
4913
|
-
headers: extend({}, orgPayloadData
|
|
4914
|
-
timeout: orgPayloadData
|
|
4915
|
-
disableXhrSync: orgPayloadData
|
|
4916
|
-
disableFetchKeepAlive: orgPayloadData
|
|
4992
|
+
data: orgPayloadData[_DYN_DATA ],
|
|
4993
|
+
urlString: orgPayloadData[_DYN_URL_STRING ],
|
|
4994
|
+
headers: extend({}, orgPayloadData[_DYN_HEADERS ]),
|
|
4995
|
+
timeout: orgPayloadData[_DYN_TIMEOUT ],
|
|
4996
|
+
disableXhrSync: orgPayloadData[_DYN_DISABLE_XHR_SYNC ],
|
|
4997
|
+
disableFetchKeepAlive: orgPayloadData[_DYN_DISABLE_FETCH_KEEP_A6 ]
|
|
4917
4998
|
};
|
|
4918
4999
|
var senderCalled_1 = false;
|
|
4919
5000
|
doPerf(_core, function () { return "HttpManager:_doPayloadSend.sendHook"; }, function () {
|
|
4920
5001
|
try {
|
|
4921
5002
|
_sendHook(hookData_1, function (payload) {
|
|
4922
5003
|
senderCalled_1 = true;
|
|
4923
|
-
if (!_customHttpInterface && !payload
|
|
4924
|
-
payload
|
|
4925
|
-
payload
|
|
5004
|
+
if (!_customHttpInterface && !payload[_DYN__THE_PAYLOAD ]) {
|
|
5005
|
+
payload[_DYN__THE_PAYLOAD ] = payload[_DYN__THE_PAYLOAD ] || orgPayloadData[_DYN__THE_PAYLOAD ];
|
|
5006
|
+
payload[_DYN__SEND_REASON ] = payload[_DYN__SEND_REASON ] || orgPayloadData[_DYN__SEND_REASON ];
|
|
4926
5007
|
}
|
|
4927
5008
|
sender(payload);
|
|
4928
|
-
}, thePayload.isSync || thePayload
|
|
5009
|
+
}, thePayload.isSync || thePayload[_DYN_IS_TEARDOWN ]);
|
|
4929
5010
|
}
|
|
4930
5011
|
catch (ex) {
|
|
4931
5012
|
if (!senderCalled_1) {
|
|
@@ -4939,19 +5020,19 @@ var HttpManager = /** @class */ (function () {
|
|
|
4939
5020
|
}
|
|
4940
5021
|
}
|
|
4941
5022
|
});
|
|
4942
|
-
}, function () { return ({ thePayload: thePayload, serializationStart: serializationStart, serializationCompleted: serializationCompleted, sendReason: sendReason }); }, thePayload
|
|
5023
|
+
}, function () { return ({ thePayload: thePayload, serializationStart: serializationStart, serializationCompleted: serializationCompleted, sendReason: sendReason }); }, thePayload[_DYN_IS_SYNC ]);
|
|
4943
5024
|
}
|
|
4944
|
-
if (thePayload.sizeExceed && thePayload.sizeExceed
|
|
4945
|
-
_sendBatchesNotification(thePayload.sizeExceed, 8003 , thePayload
|
|
5025
|
+
if (thePayload.sizeExceed && thePayload.sizeExceed[_DYN_LENGTH ] > 0) {
|
|
5026
|
+
_sendBatchesNotification(thePayload.sizeExceed, 8003 , thePayload[_DYN_SEND_TYPE ]);
|
|
4946
5027
|
}
|
|
4947
|
-
if (thePayload.failedEvts && thePayload.failedEvts
|
|
4948
|
-
_sendBatchesNotification(thePayload.failedEvts, 8002 , thePayload
|
|
5028
|
+
if (thePayload.failedEvts && thePayload.failedEvts[_DYN_LENGTH ] > 0) {
|
|
5029
|
+
_sendBatchesNotification(thePayload.failedEvts, 8002 , thePayload[_DYN_SEND_TYPE ]);
|
|
4949
5030
|
}
|
|
4950
5031
|
}
|
|
4951
5032
|
function _addEventCompletedTimings(theEvents, sendEventCompleted) {
|
|
4952
5033
|
if (_enableEventTimings) {
|
|
4953
5034
|
arrForEach(theEvents, function (theEvent) {
|
|
4954
|
-
var timings = theEvent
|
|
5035
|
+
var timings = theEvent[_DYN_TIMINGS ] = theEvent[_DYN_TIMINGS ] || {};
|
|
4955
5036
|
_setTimingValue(timings, "sendEventCompleted", sendEventCompleted);
|
|
4956
5037
|
});
|
|
4957
5038
|
}
|
|
@@ -4965,15 +5046,15 @@ var HttpManager = /** @class */ (function () {
|
|
|
4965
5046
|
var shouldRetry = true;
|
|
4966
5047
|
if (typeof status !== strShimUndefined) {
|
|
4967
5048
|
if (headers) {
|
|
4968
|
-
_clockSkewManager
|
|
5049
|
+
_clockSkewManager[_DYN_SET_CLOCK_SKEW ](headers[STR_TIME_DELTA_HEADER]);
|
|
4969
5050
|
var killDuration = headers[STR_KILL_DURATION_HEADER] || headers["kill-duration-seconds"];
|
|
4970
|
-
arrForEach(_killSwitch
|
|
4971
|
-
arrForEach(thePayload
|
|
4972
|
-
if (theBatch
|
|
5051
|
+
arrForEach(_killSwitch[_DYN_SET_KILL_SWITCH_TENA10 ](headers[STR_KILL_TOKENS_HEADER], killDuration), function (killToken) {
|
|
5052
|
+
arrForEach(thePayload[_DYN_BATCHES ], function (theBatch) {
|
|
5053
|
+
if (theBatch[_DYN_I_KEY ]() === killToken) {
|
|
4973
5054
|
droppedBatches = droppedBatches || [];
|
|
4974
|
-
var removedEvents = theBatch
|
|
4975
|
-
thePayload.numEvents -= removedEvents
|
|
4976
|
-
droppedBatches
|
|
5055
|
+
var removedEvents = theBatch[_DYN_SPLIT ](0);
|
|
5056
|
+
thePayload.numEvents -= removedEvents[_DYN_COUNT ]();
|
|
5057
|
+
droppedBatches[_DYN_PUSH ](removedEvents);
|
|
4977
5058
|
}
|
|
4978
5059
|
});
|
|
4979
5060
|
});
|
|
@@ -4990,14 +5071,14 @@ var HttpManager = /** @class */ (function () {
|
|
|
4990
5071
|
if (shouldRetry) {
|
|
4991
5072
|
reason = 100 ;
|
|
4992
5073
|
var retryCount_1 = thePayload.retryCnt;
|
|
4993
|
-
if (thePayload
|
|
5074
|
+
if (thePayload[_DYN_SEND_TYPE ] === 0 ) {
|
|
4994
5075
|
if (retryCount_1 < maxRequestRetriesBeforeBackoff) {
|
|
4995
5076
|
isRetrying = true;
|
|
4996
5077
|
_doAction(function () {
|
|
4997
|
-
if (thePayload
|
|
5078
|
+
if (thePayload[_DYN_SEND_TYPE ] === 0 ) {
|
|
4998
5079
|
_outstandingRequests--;
|
|
4999
5080
|
}
|
|
5000
|
-
_sendBatches(thePayload
|
|
5081
|
+
_sendBatches(thePayload[_DYN_BATCHES ], retryCount_1 + 1, thePayload[_DYN_IS_TEARDOWN ], _isUnloading ? 2 : thePayload[_DYN_SEND_TYPE ], 5 );
|
|
5001
5082
|
}, _isUnloading, retryPolicyGetMillisToBackoffForRetry(retryCount_1));
|
|
5002
5083
|
}
|
|
5003
5084
|
else {
|
|
@@ -5011,30 +5092,30 @@ var HttpManager = /** @class */ (function () {
|
|
|
5011
5092
|
}
|
|
5012
5093
|
finally {
|
|
5013
5094
|
if (!isRetrying) {
|
|
5014
|
-
_clockSkewManager
|
|
5095
|
+
_clockSkewManager[_DYN_SET_CLOCK_SKEW ]();
|
|
5015
5096
|
_handleRequestFinished(thePayload, reason, sendReason, backOffTrans);
|
|
5016
5097
|
}
|
|
5017
|
-
_sendBatchesNotification(droppedBatches, 8004 , thePayload
|
|
5098
|
+
_sendBatchesNotification(droppedBatches, 8004 , thePayload[_DYN_SEND_TYPE ]);
|
|
5018
5099
|
}
|
|
5019
5100
|
}
|
|
5020
5101
|
function _handleRequestFinished(thePayload, batchReason, sendReason, backOffTrans) {
|
|
5021
5102
|
try {
|
|
5022
5103
|
if (backOffTrans) {
|
|
5023
|
-
_postManager
|
|
5104
|
+
_postManager[_DYN__BACK_OFF_TRANSMISSI11 ]();
|
|
5024
5105
|
}
|
|
5025
5106
|
if (batchReason === 200 ) {
|
|
5026
|
-
if (!backOffTrans && !thePayload
|
|
5107
|
+
if (!backOffTrans && !thePayload[_DYN_IS_SYNC ]) {
|
|
5027
5108
|
_postManager._clearBackOff();
|
|
5028
5109
|
}
|
|
5029
|
-
_addCompleteTimings(thePayload
|
|
5110
|
+
_addCompleteTimings(thePayload[_DYN_BATCHES ]);
|
|
5030
5111
|
}
|
|
5031
|
-
_sendBatchesNotification(thePayload
|
|
5112
|
+
_sendBatchesNotification(thePayload[_DYN_BATCHES ], batchReason, thePayload[_DYN_SEND_TYPE ], true);
|
|
5032
5113
|
}
|
|
5033
5114
|
finally {
|
|
5034
|
-
if (thePayload
|
|
5115
|
+
if (thePayload[_DYN_SEND_TYPE ] === 0 ) {
|
|
5035
5116
|
_outstandingRequests--;
|
|
5036
5117
|
if (sendReason !== 5 ) {
|
|
5037
|
-
_self.sendQueuedRequests(thePayload
|
|
5118
|
+
_self.sendQueuedRequests(thePayload[_DYN_SEND_TYPE ], sendReason);
|
|
5038
5119
|
}
|
|
5039
5120
|
}
|
|
5040
5121
|
}
|
|
@@ -5043,8 +5124,8 @@ var HttpManager = /** @class */ (function () {
|
|
|
5043
5124
|
if (_enableEventTimings) {
|
|
5044
5125
|
var sendEventCompleted_1 = getTime();
|
|
5045
5126
|
arrForEach(theBatches, function (theBatch) {
|
|
5046
|
-
if (theBatch && theBatch
|
|
5047
|
-
_addEventCompletedTimings(theBatch
|
|
5127
|
+
if (theBatch && theBatch[_DYN_COUNT ]() > 0) {
|
|
5128
|
+
_addEventCompletedTimings(theBatch[_DYN_EVENTS ](), sendEventCompleted_1);
|
|
5048
5129
|
}
|
|
5049
5130
|
});
|
|
5050
5131
|
}
|
|
@@ -5060,12 +5141,12 @@ var HttpManager = /** @class */ (function () {
|
|
|
5060
5141
|
function _convertAllHeadersToMap(headersString) {
|
|
5061
5142
|
var headers = {};
|
|
5062
5143
|
if (isString(headersString)) {
|
|
5063
|
-
var headersArray = strTrim(headersString)
|
|
5144
|
+
var headersArray = strTrim(headersString)[_DYN_SPLIT ](/[\r\n]+/);
|
|
5064
5145
|
arrForEach(headersArray, function (headerEntry) {
|
|
5065
5146
|
if (headerEntry) {
|
|
5066
5147
|
var idx = headerEntry.indexOf(": ");
|
|
5067
5148
|
if (idx !== -1) {
|
|
5068
|
-
var header = strTrim(headerEntry.substring(0, idx))
|
|
5149
|
+
var header = strTrim(headerEntry.substring(0, idx))[_DYN_TO_LOWER_CASE ]();
|
|
5069
5150
|
var value = strTrim(headerEntry.substring(idx + 1));
|
|
5070
5151
|
headers[header] = value;
|
|
5071
5152
|
}
|
|
@@ -5078,8 +5159,8 @@ var HttpManager = /** @class */ (function () {
|
|
|
5078
5159
|
return headers;
|
|
5079
5160
|
}
|
|
5080
5161
|
function _getMsfpc(thePayload) {
|
|
5081
|
-
for (var lp = 0; lp < thePayload.batches
|
|
5082
|
-
var msfpc = thePayload
|
|
5162
|
+
for (var lp = 0; lp < thePayload.batches[_DYN_LENGTH ]; lp++) {
|
|
5163
|
+
var msfpc = thePayload[_DYN_BATCHES ][lp].Msfpc();
|
|
5083
5164
|
if (msfpc) {
|
|
5084
5165
|
return encodeURIComponent(msfpc);
|
|
5085
5166
|
}
|
|
@@ -5089,7 +5170,7 @@ var HttpManager = /** @class */ (function () {
|
|
|
5089
5170
|
function _handleCollectorResponse(responseText) {
|
|
5090
5171
|
var responseHandlers = _responseHandlers;
|
|
5091
5172
|
try {
|
|
5092
|
-
for (var i = 0; i < responseHandlers
|
|
5173
|
+
for (var i = 0; i < responseHandlers[_DYN_LENGTH ]; i++) {
|
|
5093
5174
|
try {
|
|
5094
5175
|
responseHandlers[i](responseText);
|
|
5095
5176
|
}
|
|
@@ -5108,7 +5189,7 @@ var HttpManager = /** @class */ (function () {
|
|
|
5108
5189
|
}
|
|
5109
5190
|
}
|
|
5110
5191
|
function _sendBatchesNotification(theBatches, batchReason, sendType, sendSync) {
|
|
5111
|
-
if (theBatches && theBatches
|
|
5192
|
+
if (theBatches && theBatches[_DYN_LENGTH ] > 0 && actions) {
|
|
5112
5193
|
var theAction_1 = actions[_getNotificationAction(batchReason)];
|
|
5113
5194
|
if (theAction_1) {
|
|
5114
5195
|
var isSyncRequest_1 = sendType !== 0 ;
|
|
@@ -5190,7 +5271,7 @@ var defaultPostChannelConfig = objDeepFreeze({
|
|
|
5190
5271
|
addNoResponse: undefValue
|
|
5191
5272
|
});
|
|
5192
5273
|
function isOverrideFn(httpXHROverride) {
|
|
5193
|
-
return httpXHROverride && httpXHROverride
|
|
5274
|
+
return httpXHROverride && httpXHROverride[_DYN_SEND_POST ];
|
|
5194
5275
|
}
|
|
5195
5276
|
var PostChannel = /** @class */ (function (_super) {
|
|
5196
5277
|
__extendsFn(PostChannel, _super);
|
|
@@ -5198,7 +5279,7 @@ var PostChannel = /** @class */ (function (_super) {
|
|
|
5198
5279
|
var _this = _super.call(this) || this;
|
|
5199
5280
|
_this.identifier = "PostChannel";
|
|
5200
5281
|
_this.priority = 1011;
|
|
5201
|
-
_this.version = '4.0.
|
|
5282
|
+
_this.version = '4.0.2-nightly3.2307-25';
|
|
5202
5283
|
var _postConfig;
|
|
5203
5284
|
var _isTeardownCalled = false;
|
|
5204
5285
|
var _flushCallbackQueue = [];
|
|
@@ -5237,29 +5318,29 @@ var PostChannel = /** @class */ (function (_super) {
|
|
|
5237
5318
|
_self["_getDbgPlgTargets"] = function () {
|
|
5238
5319
|
return [_httpManager, _postConfig];
|
|
5239
5320
|
};
|
|
5240
|
-
_self
|
|
5321
|
+
_self[_DYN_INITIALIZE ] = function (theConfig, core, extensions) {
|
|
5241
5322
|
doPerf(core, function () { return "PostChannel:initialize"; }, function () {
|
|
5242
|
-
_base
|
|
5323
|
+
_base[_DYN_INITIALIZE ](theConfig, core, extensions);
|
|
5243
5324
|
_notificationManager = core.getNotifyMgr();
|
|
5244
5325
|
try {
|
|
5245
|
-
_evtNamespace = mergeEvtNamespace(createUniqueNamespace(_self
|
|
5326
|
+
_evtNamespace = mergeEvtNamespace(createUniqueNamespace(_self[_DYN_IDENTIFIER ]), core.evtNamespace && core.evtNamespace());
|
|
5246
5327
|
_self._addHook(onConfigChange(theConfig, function (details) {
|
|
5247
5328
|
var coreConfig = details.cfg;
|
|
5248
5329
|
var ctx = createProcessTelemetryContext(null, coreConfig, core);
|
|
5249
|
-
_postConfig = ctx.getExtCfg(_self
|
|
5250
|
-
_timeoutWrapper = createTimeoutWrapper(_postConfig
|
|
5251
|
-
_optimizeObject = !_postConfig
|
|
5252
|
-
_ignoreMc1Ms0CookieProcessing = _postConfig
|
|
5330
|
+
_postConfig = ctx.getExtCfg(_self[_DYN_IDENTIFIER ], defaultPostChannelConfig);
|
|
5331
|
+
_timeoutWrapper = createTimeoutWrapper(_postConfig[_DYN_SET_TIMEOUT_OVERRIDE ], _postConfig[_DYN_CLEAR_TIMEOUT_OVERRI3 ]);
|
|
5332
|
+
_optimizeObject = !_postConfig[_DYN_DISABLE_OPTIMIZE_OBJ ] && isChromium();
|
|
5333
|
+
_ignoreMc1Ms0CookieProcessing = _postConfig[_DYN_IGNORE_MC1_MS0_COOKI12 ];
|
|
5253
5334
|
_hookWParam(core);
|
|
5254
|
-
_queueSizeLimit = _postConfig
|
|
5335
|
+
_queueSizeLimit = _postConfig[_DYN_EVENTS_LIMIT_IN_MEM ];
|
|
5255
5336
|
_immediateQueueSizeLimit = _postConfig.immediateEventLimit;
|
|
5256
|
-
_autoFlushEventsLimit = _postConfig
|
|
5337
|
+
_autoFlushEventsLimit = _postConfig[_DYN_AUTO_FLUSH_EVENTS_LI13 ];
|
|
5257
5338
|
_maxEventSendAttempts = _postConfig.maxEventRetryAttempts;
|
|
5258
5339
|
_maxUnloadEventSendAttempts = _postConfig.maxUnloadEventRetryAttempts;
|
|
5259
|
-
_disableAutoBatchFlushLimit = _postConfig
|
|
5340
|
+
_disableAutoBatchFlushLimit = _postConfig[_DYN_DISABLE_AUTO_BATCH_F14 ];
|
|
5260
5341
|
_setAutoLimits();
|
|
5261
|
-
_overrideInstrumentationKey = _postConfig
|
|
5262
|
-
_disableTelemetry = !!_postConfig
|
|
5342
|
+
_overrideInstrumentationKey = _postConfig[_DYN_OVERRIDE_INSTRUMENTA15 ];
|
|
5343
|
+
_disableTelemetry = !!_postConfig[_DYN_DISABLE_TELEMETRY ];
|
|
5263
5344
|
if (_unloadHandlersAdded) {
|
|
5264
5345
|
_removeUnloadHandlers();
|
|
5265
5346
|
}
|
|
@@ -5268,7 +5349,7 @@ var PostChannel = /** @class */ (function (_super) {
|
|
|
5268
5349
|
_unloadHandlersAdded = addPageHideEventListener(_handleUnloadEvents, excludePageUnloadEvents, _evtNamespace) || _unloadHandlersAdded;
|
|
5269
5350
|
_unloadHandlersAdded = addPageShowEventListener(_handleShowEvents, coreConfig.disablePageShowEvents, _evtNamespace) || _unloadHandlersAdded;
|
|
5270
5351
|
}));
|
|
5271
|
-
_httpManager
|
|
5352
|
+
_httpManager[_DYN_INITIALIZE ](theConfig, _self.core, _self);
|
|
5272
5353
|
}
|
|
5273
5354
|
catch (e) {
|
|
5274
5355
|
_self.setInitialized(false);
|
|
@@ -5277,12 +5358,12 @@ var PostChannel = /** @class */ (function (_super) {
|
|
|
5277
5358
|
}, function () { return ({ theConfig: theConfig, core: core, extensions: extensions }); });
|
|
5278
5359
|
};
|
|
5279
5360
|
_self.processTelemetry = function (ev, itemCtx) {
|
|
5280
|
-
setProcessTelemetryTimings(ev, _self
|
|
5361
|
+
setProcessTelemetryTimings(ev, _self[_DYN_IDENTIFIER ]);
|
|
5281
5362
|
itemCtx = itemCtx || _self._getTelCtx(itemCtx);
|
|
5282
5363
|
var event = ev;
|
|
5283
5364
|
if (!_disableTelemetry && !_isTeardownCalled) {
|
|
5284
5365
|
if (_overrideInstrumentationKey) {
|
|
5285
|
-
event
|
|
5366
|
+
event[_DYN_I_KEY ] = _overrideInstrumentationKey;
|
|
5286
5367
|
}
|
|
5287
5368
|
_addEventToQueues(event, true);
|
|
5288
5369
|
if (_isPageUnloadTriggered) {
|
|
@@ -5307,8 +5388,8 @@ var PostChannel = /** @class */ (function (_super) {
|
|
|
5307
5388
|
removePageShowEventListener(null, _evtNamespace);
|
|
5308
5389
|
}
|
|
5309
5390
|
function _hookWParam(core) {
|
|
5310
|
-
var existingGetWParamMethod = core
|
|
5311
|
-
core
|
|
5391
|
+
var existingGetWParamMethod = core[_DYN_GET_WPARAM ];
|
|
5392
|
+
core[_DYN_GET_WPARAM ] = function () {
|
|
5312
5393
|
var wparam = 0;
|
|
5313
5394
|
if (_ignoreMc1Ms0CookieProcessing) {
|
|
5314
5395
|
wparam = wparam | 2;
|
|
@@ -5320,20 +5401,20 @@ var PostChannel = /** @class */ (function (_super) {
|
|
|
5320
5401
|
var theEvt = evt || getWindow().event;
|
|
5321
5402
|
if (theEvt.type !== "beforeunload") {
|
|
5322
5403
|
_isPageUnloadTriggered = true;
|
|
5323
|
-
_httpManager
|
|
5404
|
+
_httpManager[_DYN_SET_UNLOADING ](_isPageUnloadTriggered);
|
|
5324
5405
|
}
|
|
5325
5406
|
_releaseAllQueues(2 , 2 );
|
|
5326
5407
|
}
|
|
5327
5408
|
function _handleShowEvents(evt) {
|
|
5328
5409
|
_isPageUnloadTriggered = false;
|
|
5329
|
-
_httpManager
|
|
5410
|
+
_httpManager[_DYN_SET_UNLOADING ](_isPageUnloadTriggered);
|
|
5330
5411
|
}
|
|
5331
5412
|
function _addEventToQueues(event, append) {
|
|
5332
|
-
if (!event
|
|
5333
|
-
event
|
|
5413
|
+
if (!event[_DYN_SEND_ATTEMPT ]) {
|
|
5414
|
+
event[_DYN_SEND_ATTEMPT ] = 0;
|
|
5334
5415
|
}
|
|
5335
|
-
if (!event
|
|
5336
|
-
event
|
|
5416
|
+
if (!event[_DYN_LATENCY ]) {
|
|
5417
|
+
event[_DYN_LATENCY ] = 1 ;
|
|
5337
5418
|
}
|
|
5338
5419
|
if (event.ext && event.ext[STR_TRACE]) {
|
|
5339
5420
|
delete (event.ext[STR_TRACE]);
|
|
@@ -5343,29 +5424,29 @@ var PostChannel = /** @class */ (function (_super) {
|
|
|
5343
5424
|
}
|
|
5344
5425
|
if (_optimizeObject) {
|
|
5345
5426
|
event.ext = optimizeObject(event.ext);
|
|
5346
|
-
if (event
|
|
5347
|
-
event
|
|
5427
|
+
if (event[_DYN_BASE_DATA ]) {
|
|
5428
|
+
event[_DYN_BASE_DATA ] = optimizeObject(event[_DYN_BASE_DATA ]);
|
|
5348
5429
|
}
|
|
5349
|
-
if (event
|
|
5350
|
-
event
|
|
5430
|
+
if (event[_DYN_DATA ]) {
|
|
5431
|
+
event[_DYN_DATA ] = optimizeObject(event[_DYN_DATA ]);
|
|
5351
5432
|
}
|
|
5352
5433
|
}
|
|
5353
|
-
if (event
|
|
5434
|
+
if (event[_DYN_SYNC ]) {
|
|
5354
5435
|
if (_currentBackoffCount || _paused) {
|
|
5355
|
-
event
|
|
5356
|
-
event
|
|
5436
|
+
event[_DYN_LATENCY ] = 3 ;
|
|
5437
|
+
event[_DYN_SYNC ] = false;
|
|
5357
5438
|
}
|
|
5358
5439
|
else {
|
|
5359
5440
|
if (_httpManager) {
|
|
5360
5441
|
if (_optimizeObject) {
|
|
5361
5442
|
event = optimizeObject(event);
|
|
5362
5443
|
}
|
|
5363
|
-
_httpManager
|
|
5444
|
+
_httpManager[_DYN_SEND_SYNCHRONOUS_BAT9 ](EventBatch.create(event[_DYN_I_KEY ], [event]), event[_DYN_SYNC ] === true ? 1 : event[_DYN_SYNC ], 3 );
|
|
5364
5445
|
return;
|
|
5365
5446
|
}
|
|
5366
5447
|
}
|
|
5367
5448
|
}
|
|
5368
|
-
var evtLatency = event
|
|
5449
|
+
var evtLatency = event[_DYN_LATENCY ];
|
|
5369
5450
|
var queueSize = _queueSize;
|
|
5370
5451
|
var queueLimit = _queueSizeLimit;
|
|
5371
5452
|
if (evtLatency === 4 ) {
|
|
@@ -5384,7 +5465,7 @@ var PostChannel = /** @class */ (function (_super) {
|
|
|
5384
5465
|
dropNumber = 1;
|
|
5385
5466
|
}
|
|
5386
5467
|
eventDropped = true;
|
|
5387
|
-
if (_dropEventWithLatencyOrLess(event
|
|
5468
|
+
if (_dropEventWithLatencyOrLess(event[_DYN_I_KEY ], event[_DYN_LATENCY ], dropLatency, dropNumber)) {
|
|
5388
5469
|
eventDropped = !_addEventToProperQueue(event, append);
|
|
5389
5470
|
}
|
|
5390
5471
|
}
|
|
@@ -5393,16 +5474,16 @@ var PostChannel = /** @class */ (function (_super) {
|
|
|
5393
5474
|
}
|
|
5394
5475
|
}
|
|
5395
5476
|
_self.setEventQueueLimits = function (eventLimit, autoFlushLimit) {
|
|
5396
|
-
_postConfig
|
|
5397
|
-
_postConfig
|
|
5477
|
+
_postConfig[_DYN_EVENTS_LIMIT_IN_MEM ] = _queueSizeLimit = isGreaterThanZero(eventLimit) ? eventLimit : MaxEventsLimitInMem;
|
|
5478
|
+
_postConfig[_DYN_AUTO_FLUSH_EVENTS_LI13 ] = _autoFlushEventsLimit = isGreaterThanZero(autoFlushLimit) ? autoFlushLimit : 0;
|
|
5398
5479
|
_setAutoLimits();
|
|
5399
5480
|
var doFlush = _queueSize > eventLimit;
|
|
5400
5481
|
if (!doFlush && _autoFlushBatchLimit > 0) {
|
|
5401
5482
|
for (var latency = 1 ; !doFlush && latency <= 3 ; latency++) {
|
|
5402
5483
|
var batchQueue = _batchQueues[latency];
|
|
5403
|
-
if (batchQueue && batchQueue
|
|
5404
|
-
arrForEach(batchQueue
|
|
5405
|
-
if (theBatch && theBatch
|
|
5484
|
+
if (batchQueue && batchQueue[_DYN_BATCHES ]) {
|
|
5485
|
+
arrForEach(batchQueue[_DYN_BATCHES ], function (theBatch) {
|
|
5486
|
+
if (theBatch && theBatch[_DYN_COUNT ]() >= _autoFlushBatchLimit) {
|
|
5406
5487
|
doFlush = true;
|
|
5407
5488
|
}
|
|
5408
5489
|
});
|
|
@@ -5424,10 +5505,10 @@ var PostChannel = /** @class */ (function (_super) {
|
|
|
5424
5505
|
_self._loadTransmitProfiles = function (profiles) {
|
|
5425
5506
|
_resetTransmitProfiles();
|
|
5426
5507
|
objForEachKey(profiles, function (profileName, profileValue) {
|
|
5427
|
-
var profLen = profileValue
|
|
5508
|
+
var profLen = profileValue[_DYN_LENGTH ];
|
|
5428
5509
|
if (profLen >= 2) {
|
|
5429
5510
|
var directValue = (profLen > 2 ? profileValue[2] : 0);
|
|
5430
|
-
profileValue
|
|
5511
|
+
profileValue[_DYN_SPLICE ](0, profLen - 2);
|
|
5431
5512
|
if (profileValue[1] < 0) {
|
|
5432
5513
|
profileValue[0] = -1;
|
|
5433
5514
|
}
|
|
@@ -5438,7 +5519,7 @@ var PostChannel = /** @class */ (function (_super) {
|
|
|
5438
5519
|
if (directValue >= 0 && profileValue[1] >= 0 && directValue > profileValue[1]) {
|
|
5439
5520
|
directValue = profileValue[1];
|
|
5440
5521
|
}
|
|
5441
|
-
profileValue
|
|
5522
|
+
profileValue[_DYN_PUSH ](directValue);
|
|
5442
5523
|
_profiles[profileName] = profileValue;
|
|
5443
5524
|
}
|
|
5444
5525
|
});
|
|
@@ -5463,7 +5544,7 @@ var PostChannel = /** @class */ (function (_super) {
|
|
|
5463
5544
|
}, 0);
|
|
5464
5545
|
}
|
|
5465
5546
|
else {
|
|
5466
|
-
_flushCallbackQueue
|
|
5547
|
+
_flushCallbackQueue[_DYN_PUSH ](callback);
|
|
5467
5548
|
}
|
|
5468
5549
|
}
|
|
5469
5550
|
else {
|
|
@@ -5491,7 +5572,7 @@ var PostChannel = /** @class */ (function (_super) {
|
|
|
5491
5572
|
proxyFunctions(_self, function () { return _httpManager; }, ["addResponseHandler"]);
|
|
5492
5573
|
function _sendEventsForLatencyAndAbove(latency, sendType, sendReason) {
|
|
5493
5574
|
var queued = _queueBatches(latency, sendType, sendReason);
|
|
5494
|
-
_httpManager
|
|
5575
|
+
_httpManager[_DYN_SEND_QUEUED_REQUESTS ](sendType, sendReason);
|
|
5495
5576
|
return queued;
|
|
5496
5577
|
}
|
|
5497
5578
|
function _hasEvents() {
|
|
@@ -5499,7 +5580,7 @@ var PostChannel = /** @class */ (function (_super) {
|
|
|
5499
5580
|
}
|
|
5500
5581
|
function _scheduleTimer() {
|
|
5501
5582
|
if (_delayedBatchSendLatency >= 0 && _queueBatches(_delayedBatchSendLatency, 0 , _delayedBatchReason)) {
|
|
5502
|
-
_httpManager
|
|
5583
|
+
_httpManager[_DYN_SEND_QUEUED_REQUESTS ](0 , _delayedBatchReason);
|
|
5503
5584
|
}
|
|
5504
5585
|
if (_immediateQueueSize > 0 && !_immediateTimer && !_paused) {
|
|
5505
5586
|
var immediateTimeOut = _profiles[_currentProfile][2];
|
|
@@ -5527,7 +5608,7 @@ var PostChannel = /** @class */ (function (_super) {
|
|
|
5527
5608
|
}
|
|
5528
5609
|
}
|
|
5529
5610
|
}
|
|
5530
|
-
_self
|
|
5611
|
+
_self[_DYN__BACK_OFF_TRANSMISSI11 ] = function () {
|
|
5531
5612
|
if (_currentBackoffCount < MaxBackoffCount) {
|
|
5532
5613
|
_currentBackoffCount++;
|
|
5533
5614
|
_clearScheduledTimer();
|
|
@@ -5639,13 +5720,13 @@ var PostChannel = /** @class */ (function (_super) {
|
|
|
5639
5720
|
var eventBatch = batchQueue.iKeyMap[iKey];
|
|
5640
5721
|
if (!eventBatch && create) {
|
|
5641
5722
|
eventBatch = EventBatch.create(iKey);
|
|
5642
|
-
batchQueue.batches
|
|
5723
|
+
batchQueue.batches[_DYN_PUSH ](eventBatch);
|
|
5643
5724
|
batchQueue.iKeyMap[iKey] = eventBatch;
|
|
5644
5725
|
}
|
|
5645
5726
|
return eventBatch;
|
|
5646
5727
|
}
|
|
5647
5728
|
function _performAutoFlush(isAsync, doFlush) {
|
|
5648
|
-
if (_httpManager
|
|
5729
|
+
if (_httpManager[_DYN_CAN_SEND_REQUEST ]() && !_currentBackoffCount) {
|
|
5649
5730
|
if (_autoFlushEventsLimit > 0 && _queueSize > _autoFlushEventsLimit) {
|
|
5650
5731
|
doFlush = true;
|
|
5651
5732
|
}
|
|
@@ -5658,13 +5739,13 @@ var PostChannel = /** @class */ (function (_super) {
|
|
|
5658
5739
|
if (_optimizeObject) {
|
|
5659
5740
|
event = optimizeObject(event);
|
|
5660
5741
|
}
|
|
5661
|
-
var latency = event
|
|
5662
|
-
var eventBatch = _getEventBatch(event
|
|
5742
|
+
var latency = event[_DYN_LATENCY ];
|
|
5743
|
+
var eventBatch = _getEventBatch(event[_DYN_I_KEY ], latency, true);
|
|
5663
5744
|
if (eventBatch.addEvent(event)) {
|
|
5664
5745
|
if (latency !== 4 ) {
|
|
5665
5746
|
_queueSize++;
|
|
5666
|
-
if (append && event
|
|
5667
|
-
_performAutoFlush(!event.sync, _autoFlushBatchLimit > 0 && eventBatch
|
|
5747
|
+
if (append && event[_DYN_SEND_ATTEMPT ] === 0) {
|
|
5748
|
+
_performAutoFlush(!event.sync, _autoFlushBatchLimit > 0 && eventBatch[_DYN_COUNT ]() >= _autoFlushBatchLimit);
|
|
5668
5749
|
}
|
|
5669
5750
|
}
|
|
5670
5751
|
else {
|
|
@@ -5677,9 +5758,9 @@ var PostChannel = /** @class */ (function (_super) {
|
|
|
5677
5758
|
function _dropEventWithLatencyOrLess(iKey, latency, currentLatency, dropNumber) {
|
|
5678
5759
|
while (currentLatency <= latency) {
|
|
5679
5760
|
var eventBatch = _getEventBatch(iKey, latency, true);
|
|
5680
|
-
if (eventBatch && eventBatch
|
|
5681
|
-
var droppedEvents = eventBatch
|
|
5682
|
-
var droppedCount = droppedEvents
|
|
5761
|
+
if (eventBatch && eventBatch[_DYN_COUNT ]() > 0) {
|
|
5762
|
+
var droppedEvents = eventBatch[_DYN_SPLIT ](0, dropNumber);
|
|
5763
|
+
var droppedCount = droppedEvents[_DYN_COUNT ]();
|
|
5683
5764
|
if (droppedCount > 0) {
|
|
5684
5765
|
if (currentLatency === 4 ) {
|
|
5685
5766
|
_immediateQueueSize -= droppedCount;
|
|
@@ -5701,13 +5782,13 @@ var PostChannel = /** @class */ (function (_super) {
|
|
|
5701
5782
|
var normalQueue = 0;
|
|
5702
5783
|
var _loop_1 = function (latency) {
|
|
5703
5784
|
var batchQueue = _batchQueues[latency];
|
|
5704
|
-
if (batchQueue && batchQueue
|
|
5705
|
-
arrForEach(batchQueue
|
|
5785
|
+
if (batchQueue && batchQueue[_DYN_BATCHES ]) {
|
|
5786
|
+
arrForEach(batchQueue[_DYN_BATCHES ], function (theBatch) {
|
|
5706
5787
|
if (latency === 4 ) {
|
|
5707
|
-
immediateQueue += theBatch
|
|
5788
|
+
immediateQueue += theBatch[_DYN_COUNT ]();
|
|
5708
5789
|
}
|
|
5709
5790
|
else {
|
|
5710
|
-
normalQueue += theBatch
|
|
5791
|
+
normalQueue += theBatch[_DYN_COUNT ]();
|
|
5711
5792
|
}
|
|
5712
5793
|
});
|
|
5713
5794
|
}
|
|
@@ -5721,33 +5802,33 @@ var PostChannel = /** @class */ (function (_super) {
|
|
|
5721
5802
|
function _queueBatches(latency, sendType, sendReason) {
|
|
5722
5803
|
var eventsQueued = false;
|
|
5723
5804
|
var isAsync = sendType === 0 ;
|
|
5724
|
-
if (!isAsync || _httpManager
|
|
5805
|
+
if (!isAsync || _httpManager[_DYN_CAN_SEND_REQUEST ]()) {
|
|
5725
5806
|
doPerf(_self.core, function () { return "PostChannel._queueBatches"; }, function () {
|
|
5726
5807
|
var droppedEvents = [];
|
|
5727
5808
|
var latencyToProcess = 4 ;
|
|
5728
5809
|
while (latencyToProcess >= latency) {
|
|
5729
5810
|
var batchQueue = _batchQueues[latencyToProcess];
|
|
5730
|
-
if (batchQueue && batchQueue.batches && batchQueue.batches
|
|
5731
|
-
arrForEach(batchQueue
|
|
5811
|
+
if (batchQueue && batchQueue.batches && batchQueue.batches[_DYN_LENGTH ] > 0) {
|
|
5812
|
+
arrForEach(batchQueue[_DYN_BATCHES ], function (theBatch) {
|
|
5732
5813
|
if (!_httpManager.addBatch(theBatch)) {
|
|
5733
|
-
droppedEvents = droppedEvents
|
|
5814
|
+
droppedEvents = droppedEvents[_DYN_CONCAT ](theBatch[_DYN_EVENTS ]());
|
|
5734
5815
|
}
|
|
5735
5816
|
else {
|
|
5736
|
-
eventsQueued = eventsQueued || (theBatch && theBatch
|
|
5817
|
+
eventsQueued = eventsQueued || (theBatch && theBatch[_DYN_COUNT ]() > 0);
|
|
5737
5818
|
}
|
|
5738
5819
|
if (latencyToProcess === 4 ) {
|
|
5739
|
-
_immediateQueueSize -= theBatch
|
|
5820
|
+
_immediateQueueSize -= theBatch[_DYN_COUNT ]();
|
|
5740
5821
|
}
|
|
5741
5822
|
else {
|
|
5742
|
-
_queueSize -= theBatch
|
|
5823
|
+
_queueSize -= theBatch[_DYN_COUNT ]();
|
|
5743
5824
|
}
|
|
5744
5825
|
});
|
|
5745
|
-
batchQueue
|
|
5826
|
+
batchQueue[_DYN_BATCHES ] = [];
|
|
5746
5827
|
batchQueue.iKeyMap = {};
|
|
5747
5828
|
}
|
|
5748
5829
|
latencyToProcess--;
|
|
5749
5830
|
}
|
|
5750
|
-
if (droppedEvents
|
|
5831
|
+
if (droppedEvents[_DYN_LENGTH ] > 0) {
|
|
5751
5832
|
_notifyEvents(strEventsDiscarded, droppedEvents, EventsDiscardedReason.KillSwitch);
|
|
5752
5833
|
}
|
|
5753
5834
|
if (eventsQueued && _delayedBatchSendLatency >= latency) {
|
|
@@ -5769,7 +5850,7 @@ var PostChannel = /** @class */ (function (_super) {
|
|
|
5769
5850
|
if (callback) {
|
|
5770
5851
|
callback();
|
|
5771
5852
|
}
|
|
5772
|
-
if (_flushCallbackQueue
|
|
5853
|
+
if (_flushCallbackQueue[_DYN_LENGTH ] > 0) {
|
|
5773
5854
|
_flushCallbackTimer = _createTimer(function () {
|
|
5774
5855
|
_flushCallbackTimer = null;
|
|
5775
5856
|
_flushImpl(_flushCallbackQueue.shift(), sendReason);
|
|
@@ -5782,7 +5863,7 @@ var PostChannel = /** @class */ (function (_super) {
|
|
|
5782
5863
|
});
|
|
5783
5864
|
}
|
|
5784
5865
|
function _waitForIdleManager(callback) {
|
|
5785
|
-
if (_httpManager
|
|
5866
|
+
if (_httpManager[_DYN_IS_COMPLETELY_IDLE ]()) {
|
|
5786
5867
|
callback();
|
|
5787
5868
|
}
|
|
5788
5869
|
else {
|
|
@@ -5811,25 +5892,25 @@ var PostChannel = /** @class */ (function (_super) {
|
|
|
5811
5892
|
maxSendAttempts = _maxUnloadEventSendAttempts;
|
|
5812
5893
|
}
|
|
5813
5894
|
arrForEach(batches, function (theBatch) {
|
|
5814
|
-
if (theBatch && theBatch
|
|
5815
|
-
arrForEach(theBatch
|
|
5895
|
+
if (theBatch && theBatch[_DYN_COUNT ]() > 0) {
|
|
5896
|
+
arrForEach(theBatch[_DYN_EVENTS ](), function (theEvent) {
|
|
5816
5897
|
if (theEvent) {
|
|
5817
|
-
if (theEvent
|
|
5818
|
-
theEvent
|
|
5819
|
-
theEvent
|
|
5898
|
+
if (theEvent[_DYN_SYNC ]) {
|
|
5899
|
+
theEvent[_DYN_LATENCY ] = 4 ;
|
|
5900
|
+
theEvent[_DYN_SYNC ] = false;
|
|
5820
5901
|
}
|
|
5821
|
-
if (theEvent
|
|
5822
|
-
setProcessTelemetryTimings(theEvent, _self
|
|
5902
|
+
if (theEvent[_DYN_SEND_ATTEMPT ] < maxSendAttempts) {
|
|
5903
|
+
setProcessTelemetryTimings(theEvent, _self[_DYN_IDENTIFIER ]);
|
|
5823
5904
|
_addEventToQueues(theEvent, false);
|
|
5824
5905
|
}
|
|
5825
5906
|
else {
|
|
5826
|
-
droppedEvents
|
|
5907
|
+
droppedEvents[_DYN_PUSH ](theEvent);
|
|
5827
5908
|
}
|
|
5828
5909
|
}
|
|
5829
5910
|
});
|
|
5830
5911
|
}
|
|
5831
5912
|
});
|
|
5832
|
-
if (droppedEvents
|
|
5913
|
+
if (droppedEvents[_DYN_LENGTH ] > 0) {
|
|
5833
5914
|
_notifyEvents(strEventsDiscarded, droppedEvents, EventsDiscardedReason.NonRetryableStatus);
|
|
5834
5915
|
}
|
|
5835
5916
|
if (_isPageUnloadTriggered) {
|
|
@@ -5853,8 +5934,8 @@ var PostChannel = /** @class */ (function (_super) {
|
|
|
5853
5934
|
for (var _i = 2; _i < arguments.length; _i++) {
|
|
5854
5935
|
extraArgs[_i - 2] = arguments[_i];
|
|
5855
5936
|
}
|
|
5856
|
-
if (theEvents && theEvents
|
|
5857
|
-
_callNotification(evtName, [theEvents]
|
|
5937
|
+
if (theEvents && theEvents[_DYN_LENGTH ] > 0) {
|
|
5938
|
+
_callNotification(evtName, [theEvents][_DYN_CONCAT ](extraArgs));
|
|
5858
5939
|
}
|
|
5859
5940
|
}
|
|
5860
5941
|
function _notifyBatchEvents(evtName, batches) {
|
|
@@ -5862,16 +5943,16 @@ var PostChannel = /** @class */ (function (_super) {
|
|
|
5862
5943
|
for (var _i = 2; _i < arguments.length; _i++) {
|
|
5863
5944
|
extraArgs[_i - 2] = arguments[_i];
|
|
5864
5945
|
}
|
|
5865
|
-
if (batches && batches
|
|
5946
|
+
if (batches && batches[_DYN_LENGTH ] > 0) {
|
|
5866
5947
|
arrForEach(batches, function (theBatch) {
|
|
5867
|
-
if (theBatch && theBatch
|
|
5868
|
-
_callNotification(evtName, [theBatch.events()]
|
|
5948
|
+
if (theBatch && theBatch[_DYN_COUNT ]() > 0) {
|
|
5949
|
+
_callNotification(evtName, [theBatch.events()][_DYN_CONCAT ](extraArgs));
|
|
5869
5950
|
}
|
|
5870
5951
|
});
|
|
5871
5952
|
}
|
|
5872
5953
|
}
|
|
5873
5954
|
function _sendingEvent(batches, reason, isSyncRequest) {
|
|
5874
|
-
if (batches && batches
|
|
5955
|
+
if (batches && batches[_DYN_LENGTH ] > 0) {
|
|
5875
5956
|
_callNotification("eventsSendRequest", [(reason >= 1000 && reason <= 1999 ?
|
|
5876
5957
|
reason - 1000 :
|
|
5877
5958
|
0 ), isSyncRequest !== true]);
|
|
@@ -5915,4 +5996,4 @@ exports.PostChannel = PostChannel;
|
|
|
5915
5996
|
exports.RT_PROFILE = RT_PROFILE;
|
|
5916
5997
|
|
|
5917
5998
|
}));
|
|
5918
|
-
//# sourceMappingURL=ms.post-4.0.
|
|
5999
|
+
//# sourceMappingURL=ms.post-4.0.2-nightly3.2307-25.gbl.js.map
|