@rudderstack/analytics-js 3.0.0-beta.19 → 3.0.0-beta.20
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/CHANGELOG.md +7 -0
- package/dist/npm/index.d.ts +30 -16
- package/dist/npm/legacy/cjs/index.js +193 -206
- package/dist/npm/legacy/esm/index.js +193 -206
- package/dist/npm/legacy/umd/index.js +193 -206
- package/dist/npm/modern/bundled/cjs/index.js +139 -130
- package/dist/npm/modern/bundled/esm/index.js +139 -130
- package/dist/npm/modern/bundled/umd/index.js +139 -130
- package/dist/npm/modern/cjs/index.js +55 -48
- package/dist/npm/modern/content-script/cjs/index.js +138 -129
- package/dist/npm/modern/content-script/esm/index.js +138 -129
- package/dist/npm/modern/content-script/umd/index.js +138 -129
- package/dist/npm/modern/esm/index.js +55 -48
- package/dist/npm/modern/umd/index.js +55 -48
- package/package.json +1 -1
@@ -1,5 +1,23 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
+
function _callSuper(t, o, e) {
|
4
|
+
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
|
5
|
+
}
|
6
|
+
function _construct(t, e, r) {
|
7
|
+
if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
|
8
|
+
var o = [null];
|
9
|
+
o.push.apply(o, e);
|
10
|
+
var p = new (t.bind.apply(t, o))();
|
11
|
+
return r && _setPrototypeOf(p, r.prototype), p;
|
12
|
+
}
|
13
|
+
function _isNativeReflectConstruct() {
|
14
|
+
try {
|
15
|
+
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
16
|
+
} catch (t) {}
|
17
|
+
return (_isNativeReflectConstruct = function () {
|
18
|
+
return !!t;
|
19
|
+
})();
|
20
|
+
}
|
3
21
|
function ownKeys(e, r) {
|
4
22
|
var t = Object.keys(e);
|
5
23
|
if (Object.getOwnPropertySymbols) {
|
@@ -322,6 +340,20 @@ function _regeneratorRuntime() {
|
|
322
340
|
}
|
323
341
|
}, e;
|
324
342
|
}
|
343
|
+
function _toPrimitive(t, r) {
|
344
|
+
if ("object" != typeof t || !t) return t;
|
345
|
+
var e = t[Symbol.toPrimitive];
|
346
|
+
if (void 0 !== e) {
|
347
|
+
var i = e.call(t, r || "default");
|
348
|
+
if ("object" != typeof i) return i;
|
349
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
350
|
+
}
|
351
|
+
return ("string" === r ? String : Number)(t);
|
352
|
+
}
|
353
|
+
function _toPropertyKey(t) {
|
354
|
+
var i = _toPrimitive(t, "string");
|
355
|
+
return "symbol" == typeof i ? i : String(i);
|
356
|
+
}
|
325
357
|
function _typeof(o) {
|
326
358
|
"@babel/helpers - typeof";
|
327
359
|
|
@@ -426,32 +458,6 @@ function _setPrototypeOf(o, p) {
|
|
426
458
|
};
|
427
459
|
return _setPrototypeOf(o, p);
|
428
460
|
}
|
429
|
-
function _isNativeReflectConstruct() {
|
430
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
431
|
-
if (Reflect.construct.sham) return false;
|
432
|
-
if (typeof Proxy === "function") return true;
|
433
|
-
try {
|
434
|
-
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
435
|
-
return true;
|
436
|
-
} catch (e) {
|
437
|
-
return false;
|
438
|
-
}
|
439
|
-
}
|
440
|
-
function _construct(Parent, args, Class) {
|
441
|
-
if (_isNativeReflectConstruct()) {
|
442
|
-
_construct = Reflect.construct.bind();
|
443
|
-
} else {
|
444
|
-
_construct = function _construct(Parent, args, Class) {
|
445
|
-
var a = [null];
|
446
|
-
a.push.apply(a, args);
|
447
|
-
var Constructor = Function.bind.apply(Parent, a);
|
448
|
-
var instance = new Constructor();
|
449
|
-
if (Class) _setPrototypeOf(instance, Class.prototype);
|
450
|
-
return instance;
|
451
|
-
};
|
452
|
-
}
|
453
|
-
return _construct.apply(null, arguments);
|
454
|
-
}
|
455
461
|
function _assertThisInitialized(self) {
|
456
462
|
if (self === void 0) {
|
457
463
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
@@ -466,20 +472,6 @@ function _possibleConstructorReturn(self, call) {
|
|
466
472
|
}
|
467
473
|
return _assertThisInitialized(self);
|
468
474
|
}
|
469
|
-
function _createSuper(Derived) {
|
470
|
-
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
471
|
-
return function _createSuperInternal() {
|
472
|
-
var Super = _getPrototypeOf(Derived),
|
473
|
-
result;
|
474
|
-
if (hasNativeReflectConstruct) {
|
475
|
-
var NewTarget = _getPrototypeOf(this).constructor;
|
476
|
-
result = Reflect.construct(Super, arguments, NewTarget);
|
477
|
-
} else {
|
478
|
-
result = Super.apply(this, arguments);
|
479
|
-
}
|
480
|
-
return _possibleConstructorReturn(this, result);
|
481
|
-
};
|
482
|
-
}
|
483
475
|
function _superPropBase(object, property) {
|
484
476
|
while (!Object.prototype.hasOwnProperty.call(object, property)) {
|
485
477
|
object = _getPrototypeOf(object);
|
@@ -528,20 +520,6 @@ function _arrayLikeToArray(arr, len) {
|
|
528
520
|
function _nonIterableSpread() {
|
529
521
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
530
522
|
}
|
531
|
-
function _toPrimitive(input, hint) {
|
532
|
-
if (typeof input !== "object" || input === null) return input;
|
533
|
-
var prim = input[Symbol.toPrimitive];
|
534
|
-
if (prim !== undefined) {
|
535
|
-
var res = prim.call(input, hint || "default");
|
536
|
-
if (typeof res !== "object") return res;
|
537
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
538
|
-
}
|
539
|
-
return (hint === "string" ? String : Number)(input);
|
540
|
-
}
|
541
|
-
function _toPropertyKey(arg) {
|
542
|
-
var key = _toPrimitive(arg, "string");
|
543
|
-
return typeof key === "symbol" ? key : String(key);
|
544
|
-
}
|
545
523
|
|
546
524
|
function _isPlaceholder(a){return a!=null&&_typeof(a)==='object'&&a['@@functional/placeholder']===true;}
|
547
525
|
|
@@ -599,7 +577,7 @@ function _has(prop,obj){return Object.prototype.hasOwnProperty.call(obj,prop);}
|
|
599
577
|
* R.type(() => {}); //=> "Function"
|
600
578
|
* R.type(async () => {}); //=> "AsyncFunction"
|
601
579
|
* R.type(undefined); //=> "Undefined"
|
602
|
-
*/var type=/*#__PURE__*/_curry1(function type(val){return val===null?'Null':val===undefined?'Undefined':Object.prototype.toString.call(val).slice(8,-1);});
|
580
|
+
*/var type=/*#__PURE__*/_curry1(function type(val){return val===null?'Null':val===undefined?'Undefined':Object.prototype.toString.call(val).slice(8,-1);});
|
603
581
|
|
604
582
|
function _isObject(x){return Object.prototype.toString.call(x)==='[object Object]';}
|
605
583
|
|
@@ -639,7 +617,7 @@ function _isString(x){return Object.prototype.toString.call(x)==='[object String
|
|
639
617
|
* @symb R.nth(-1, [a, b, c]) = c
|
640
618
|
* @symb R.nth(0, [a, b, c]) = a
|
641
619
|
* @symb R.nth(1, [a, b, c]) = b
|
642
|
-
*/var nth=/*#__PURE__*/_curry2(function nth(offset,list){var idx=offset<0?list.length+offset:offset;return _isString(list)?list.charAt(idx):list[idx];});
|
620
|
+
*/var nth=/*#__PURE__*/_curry2(function nth(offset,list){var idx=offset<0?list.length+offset:offset;return _isString(list)?list.charAt(idx):list[idx];});
|
643
621
|
|
644
622
|
function _cloneRegExp(pattern){return new RegExp(pattern.source,pattern.flags?pattern.flags:(pattern.global?'g':'')+(pattern.ignoreCase?'i':'')+(pattern.multiline?'m':'')+(pattern.sticky?'y':'')+(pattern.unicode?'u':'')+(pattern.dotAll?'s':''));}
|
645
623
|
|
@@ -652,7 +630,7 @@ function _cloneRegExp(pattern){return new RegExp(pattern.source,pattern.flags?pa
|
|
652
630
|
* @return {*} The copied value.
|
653
631
|
*/function _clone(value,deep,map){map||(map=new _ObjectMap());// this avoids the slower switch with a quick if decision removing some milliseconds in each run.
|
654
632
|
if(_isPrimitive(value)){return value;}var copy=function copy(copiedValue){// Check for circular and same references on the object graph and return its corresponding clone.
|
655
|
-
var cachedCopy=map.get(value);if(cachedCopy){return cachedCopy;}map.set(value,copiedValue);for(var key in value){if(Object.prototype.hasOwnProperty.call(value,key)){copiedValue[key]=deep?_clone(value[key],true,map):value[key];}}return copiedValue;};switch(type
|
633
|
+
var cachedCopy=map.get(value);if(cachedCopy){return cachedCopy;}map.set(value,copiedValue);for(var key in value){if(Object.prototype.hasOwnProperty.call(value,key)){copiedValue[key]=deep?_clone(value[key],true,map):value[key];}}return copiedValue;};switch(type(value)){case'Object':return copy(Object.create(Object.getPrototypeOf(value)));case'Array':return copy([]);case'Date':return new Date(value.valueOf());case'RegExp':return _cloneRegExp(value);case'Int8Array':case'Uint8Array':case'Uint8ClampedArray':case'Int16Array':case'Uint16Array':case'Int32Array':case'Uint32Array':case'Float32Array':case'Float64Array':case'BigInt64Array':case'BigUint64Array':return value.slice();default:return value;}}function _isPrimitive(param){var type=_typeof(param);return param==null||type!='object'&&type!='function';}var _ObjectMap=/*#__PURE__*/function(){function _ObjectMap(){this.map={};this.length=0;}_ObjectMap.prototype.set=function(key,value){var hashedKey=this.hash(key);var bucket=this.map[hashedKey];if(!bucket){this.map[hashedKey]=bucket=[];}bucket.push([key,value]);this.length+=1;};_ObjectMap.prototype.hash=function(key){var hashedKey=[];for(var value in key){hashedKey.push(Object.prototype.toString.call(key[value]));}return hashedKey.join();};_ObjectMap.prototype.get=function(key){/**
|
656
634
|
* depending on the number of objects to be cloned is faster to just iterate over the items in the map just because the hash function is so costly,
|
657
635
|
* on my tests this number is 180, anything above that using the hash function is faster.
|
658
636
|
*/if(this.length<=180){for(var p in this.map){var _bucket=this.map[p];for(var i=0;i<_bucket.length;i+=1){var element=_bucket[i];if(element[0]===key){return element[1];}}}return;}var hashedKey=this.hash(key);var bucket=this.map[hashedKey];if(!bucket){return;}for(var _i=0;_i<bucket.length;_i+=1){var _element=bucket[_i];if(_element[0]===key){return _element[1];}}};return _ObjectMap;}();
|
@@ -683,7 +661,7 @@ var cachedCopy=map.get(value);if(cachedCopy){return cachedCopy;}map.set(value,co
|
|
683
661
|
* const objectsClone = R.clone(objects);
|
684
662
|
* objects === objectsClone; //=> false
|
685
663
|
* objects[0] === objectsClone[0]; //=> false
|
686
|
-
*/var clone=/*#__PURE__*/_curry1(function clone(value){return value!=null&&typeof value.clone==='function'?value.clone():_clone(value,true);});
|
664
|
+
*/var clone=/*#__PURE__*/_curry1(function clone(value){return value!=null&&typeof value.clone==='function'?value.clone():_clone(value,true);});
|
687
665
|
|
688
666
|
/**
|
689
667
|
* Retrieves the values at given paths of an object.
|
@@ -702,7 +680,7 @@ var cachedCopy=map.get(value);if(cachedCopy){return cachedCopy;}map.set(value,co
|
|
702
680
|
*
|
703
681
|
* R.paths([['a', 'b'], ['p', 0, 'q']], {a: {b: 2}, p: [{q: 3}]}); //=> [2, 3]
|
704
682
|
* R.paths([['a', 'b'], ['p', 'r']], {a: {b: 2}, p: [{q: 3}]}); //=> [2, undefined]
|
705
|
-
*/var paths=/*#__PURE__*/_curry2(function paths(pathsArray,obj){return pathsArray.map(function(paths){var val=obj;var idx=0;var p;while(idx<paths.length){if(val==null){return;}p=paths[idx];val=_isInteger(p)?nth
|
683
|
+
*/var paths=/*#__PURE__*/_curry2(function paths(pathsArray,obj){return pathsArray.map(function(paths){var val=obj;var idx=0;var p;while(idx<paths.length){if(val==null){return;}p=paths[idx];val=_isInteger(p)?nth(p,val):val[p];idx+=1;}return val;});});
|
706
684
|
|
707
685
|
/**
|
708
686
|
* Retrieves the value at a given path. The nodes of the path can be arbitrary strings or non-negative integers.
|
@@ -727,7 +705,7 @@ var cachedCopy=map.get(value);if(cachedCopy){return cachedCopy;}map.set(value,co
|
|
727
705
|
* R.path(['a', 'b', -2], {a: {b: [1, 2, 3]}}); //=> 2
|
728
706
|
* R.path([2], {'2': 2}); //=> 2
|
729
707
|
* R.path([-2], {'-2': 'a'}); //=> undefined
|
730
|
-
*/var path=/*#__PURE__*/_curry2(function path(pathAr,obj){return paths
|
708
|
+
*/var path=/*#__PURE__*/_curry2(function path(pathAr,obj){return paths([pathAr],obj)[0];});
|
731
709
|
|
732
710
|
/**
|
733
711
|
* Creates a new object with the own properties of the two provided objects. If
|
@@ -753,7 +731,7 @@ var cachedCopy=map.get(value);if(cachedCopy){return cachedCopy;}map.set(value,co
|
|
753
731
|
* { b: true, thing: 'bar', values: [15, 35] });
|
754
732
|
* //=> { a: true, b: true, thing: 'bar', values: [10, 20, 15, 35] }
|
755
733
|
* @symb R.mergeWithKey(f, { x: 1, y: 2 }, { y: 5, z: 3 }) = { x: 1, y: f('y', 2, 5), z: 3 }
|
756
|
-
*/var mergeWithKey=/*#__PURE__*/_curry3(function mergeWithKey(fn,l,r){var result={};var k;l=l||{};r=r||{};for(k in l){if(_has(k,l)){result[k]=_has(k,r)?fn(k,l[k],r[k]):l[k];}}for(k in r){if(_has(k,r)&&!_has(k,result)){result[k]=r[k];}}return result;});
|
734
|
+
*/var mergeWithKey=/*#__PURE__*/_curry3(function mergeWithKey(fn,l,r){var result={};var k;l=l||{};r=r||{};for(k in l){if(_has(k,l)){result[k]=_has(k,r)?fn(k,l[k],r[k]):l[k];}}for(k in r){if(_has(k,r)&&!_has(k,result)){result[k]=r[k];}}return result;});
|
757
735
|
|
758
736
|
/**
|
759
737
|
* Creates a new object with the own properties of the two provided objects.
|
@@ -782,7 +760,7 @@ var cachedCopy=map.get(value);if(cachedCopy){return cachedCopy;}map.set(value,co
|
|
782
760
|
* { a: true, c: { thing: 'foo', values: [10, 20] }},
|
783
761
|
* { b: true, c: { thing: 'bar', values: [15, 35] }});
|
784
762
|
* //=> { a: true, b: true, c: { thing: 'bar', values: [10, 20, 15, 35] }}
|
785
|
-
*/var mergeDeepWithKey=/*#__PURE__*/_curry3(function mergeDeepWithKey(fn,lObj,rObj){return mergeWithKey
|
763
|
+
*/var mergeDeepWithKey=/*#__PURE__*/_curry3(function mergeDeepWithKey(fn,lObj,rObj){return mergeWithKey(function(k,lVal,rVal){if(_isObject(lVal)&&_isObject(rVal)){return mergeDeepWithKey(fn,lVal,rVal);}else {return fn(k,lVal,rVal);}},lObj,rObj);});
|
786
764
|
|
787
765
|
/**
|
788
766
|
* Creates a new object with the own properties of the two provided objects.
|
@@ -810,7 +788,7 @@ var cachedCopy=map.get(value);if(cachedCopy){return cachedCopy;}map.set(value,co
|
|
810
788
|
* { a: true, c: { values: [10, 20] }},
|
811
789
|
* { b: true, c: { values: [15, 35] }});
|
812
790
|
* //=> { a: true, b: true, c: { values: [10, 20, 15, 35] }}
|
813
|
-
*/var mergeDeepWith=/*#__PURE__*/_curry3(function mergeDeepWith(fn,lObj,rObj){return mergeDeepWithKey
|
791
|
+
*/var mergeDeepWith=/*#__PURE__*/_curry3(function mergeDeepWith(fn,lObj,rObj){return mergeDeepWithKey(function(k,lVal,rVal){return fn(lVal,rVal);},lObj,rObj);});
|
814
792
|
|
815
793
|
/**
|
816
794
|
* Returns a partial copy of an object containing only the keys that satisfy
|
@@ -831,7 +809,7 @@ var cachedCopy=map.get(value);if(cachedCopy){return cachedCopy;}map.set(value,co
|
|
831
809
|
*
|
832
810
|
* const isUpperCase = (val, key) => key.toUpperCase() === key;
|
833
811
|
* R.pickBy(isUpperCase, {a: 1, b: 2, A: 3, B: 4}); //=> {A: 3, B: 4}
|
834
|
-
*/var pickBy=/*#__PURE__*/_curry2(function pickBy(test,obj){var result={};for(var prop in obj){if(test(obj[prop],prop,obj)){result[prop]=obj[prop];}}return result;});
|
812
|
+
*/var pickBy=/*#__PURE__*/_curry2(function pickBy(test,obj){var result={};for(var prop in obj){if(test(obj[prop],prop,obj)){result[prop]=obj[prop];}}return result;});
|
835
813
|
|
836
814
|
/**
|
837
815
|
* A function to check given value is a function
|
@@ -872,7 +850,7 @@ var isFunction=function isFunction(value){return typeof value==='function'&&Bool
|
|
872
850
|
* @returns true if the input is an instance of Error and false otherwise
|
873
851
|
*/var isTypeOfError=function isTypeOfError(obj){return obj instanceof Error;};
|
874
852
|
|
875
|
-
var getValueByPath=function getValueByPath(obj,keyPath){var pathParts=keyPath.split('.');return path
|
853
|
+
var getValueByPath=function getValueByPath(obj,keyPath){var pathParts=keyPath.split('.');return path(pathParts,obj);};var hasValueByPath=function hasValueByPath(obj,path){return Boolean(getValueByPath(obj,path));};/**
|
876
854
|
* Checks if the input is an object literal or built-in object type and not null
|
877
855
|
* @param value Input value
|
878
856
|
* @returns true if the input is an object and not null
|
@@ -880,8 +858,8 @@ var getValueByPath=function getValueByPath(obj,keyPath){var pathParts=keyPath.sp
|
|
880
858
|
* Checks if the input is an object literal and not null
|
881
859
|
* @param value Input value
|
882
860
|
* @returns true if the input is an object and not null
|
883
|
-
*/var isObjectLiteralAndNotNull=function isObjectLiteralAndNotNull(value){return !isNull(value)&&Object.prototype.toString.call(value)==='[object Object]';};var mergeDeepRightObjectArrays=function mergeDeepRightObjectArrays(leftValue,rightValue){if(!Array.isArray(leftValue)||!Array.isArray(rightValue)){return clone
|
884
|
-
mergeDeepRight(mergedArray[index],value):value;});return mergedArray;};var mergeDeepRight=function mergeDeepRight(leftObject,rightObject){return mergeDeepWith
|
861
|
+
*/var isObjectLiteralAndNotNull=function isObjectLiteralAndNotNull(value){return !isNull(value)&&Object.prototype.toString.call(value)==='[object Object]';};var mergeDeepRightObjectArrays=function mergeDeepRightObjectArrays(leftValue,rightValue){if(!Array.isArray(leftValue)||!Array.isArray(rightValue)){return clone(rightValue);}var mergedArray=clone(leftValue);rightValue.forEach(function(value,index){mergedArray[index]=Array.isArray(value)||isObjectAndNotNull(value)?// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
862
|
+
mergeDeepRight(mergedArray[index],value):value;});return mergedArray;};var mergeDeepRight=function mergeDeepRight(leftObject,rightObject){return mergeDeepWith(mergeDeepRightObjectArrays,leftObject,rightObject);};/**
|
885
863
|
Checks if the input is a non-empty object literal type and not undefined or null
|
886
864
|
* @param value input any
|
887
865
|
* @returns boolean
|
@@ -889,11 +867,11 @@ mergeDeepRight(mergedArray[index],value):value;});return mergedArray;};var merge
|
|
889
867
|
* A utility to recursively remove undefined values from an object
|
890
868
|
* @param obj input object
|
891
869
|
* @returns a new object
|
892
|
-
*/var removeUndefinedValues=function removeUndefinedValues(obj){var result=pickBy
|
870
|
+
*/var removeUndefinedValues=function removeUndefinedValues(obj){var result=pickBy(isDefined,obj);Object.keys(result).forEach(function(key){var value=result[key];if(isObjectLiteralAndNotNull(value)){result[key]=removeUndefinedValues(value);}});return result;};/**
|
893
871
|
* A utility to recursively remove undefined and null values from an object
|
894
872
|
* @param obj input object
|
895
873
|
* @returns a new object
|
896
|
-
*/var removeUndefinedAndNullValues=function removeUndefinedAndNullValues(obj){var result=pickBy
|
874
|
+
*/var removeUndefinedAndNullValues=function removeUndefinedAndNullValues(obj){var result=pickBy(isDefinedAndNotNull,obj);Object.keys(result).forEach(function(key){var value=result[key];if(isObjectLiteralAndNotNull(value)){result[key]=removeUndefinedAndNullValues(value);}});return result;};
|
897
875
|
|
898
876
|
var trim=function trim(value){return value.replace(/^\s+|\s+$/gm,'');};var removeDoubleSpaces=function removeDoubleSpaces(value){return value.replace(/ {2,}/g,' ');};/**
|
899
877
|
* A function to convert values to string
|
@@ -927,25 +905,25 @@ var trim=function trim(value){return value.replace(/^\s+|\s+$/gm,'');};var remov
|
|
927
905
|
if(isString(category)&&!isString(name)){delete payload.category;payload.name=category;}// Rest of the code is just to clean up undefined values
|
928
906
|
// and set some proper defaults
|
929
907
|
// Also, to clone the incoming object type arguments
|
930
|
-
if(!isDefined(payload.category)){delete payload.category;}if(!isDefined(payload.name)){delete payload.name;}payload.properties=payload.properties?clone
|
908
|
+
if(!isDefined(payload.category)){delete payload.category;}if(!isDefined(payload.name)){delete payload.name;}payload.properties=payload.properties?clone(payload.properties):{};if(isDefined(payload.options)){payload.options=clone(payload.options);}else {delete payload.options;}// add name and category to properties
|
931
909
|
payload.properties=mergeDeepRight(isObjectLiteralAndNotNull(payload.properties)?payload.properties:{},{name:isString(payload.name)?payload.name:null,category:isString(payload.category)?payload.category:null});return payload;};/*
|
932
910
|
* Normalise the overloaded arguments of the track call facade
|
933
911
|
*/var trackArgumentsToCallOptions=function trackArgumentsToCallOptions(event,properties,options,callback){var payload={name:event,properties:properties,options:options};if(isFunction(callback)){payload.callback=callback;}if(isFunction(options)){payload.properties=properties;delete payload.options;payload.callback=options;}if(isFunction(properties)){delete payload.properties;delete payload.options;payload.callback=properties;}// Rest of the code is just to clean up undefined values
|
934
912
|
// and set some proper defaults
|
935
913
|
// Also, to clone the incoming object type arguments
|
936
|
-
payload.properties=isDefinedAndNotNull(payload.properties)?clone
|
914
|
+
payload.properties=isDefinedAndNotNull(payload.properties)?clone(payload.properties):{};if(isDefined(payload.options)){payload.options=clone(payload.options);}else {delete payload.options;}return payload;};/*
|
937
915
|
* Normalise the overloaded arguments of the identify call facade
|
938
916
|
*/var identifyArgumentsToCallOptions=function identifyArgumentsToCallOptions(userId,traits,options,callback){var payload={userId:userId,traits:traits,options:options};if(isFunction(callback)){payload.callback=callback;}if(isFunction(options)){payload.userId=userId;payload.traits=traits;delete payload.options;payload.callback=options;}if(isFunction(traits)){payload.userId=userId;delete payload.traits;delete payload.options;payload.callback=traits;}if(isObjectLiteralAndNotNull(userId)||isNull(userId)){// Explicitly set null to prevent resetting the existing value
|
939
917
|
// in the Analytics class
|
940
918
|
payload.userId=null;payload.traits=userId;payload.options=traits;}// Rest of the code is just to clean up undefined values
|
941
919
|
// and set some proper defaults
|
942
920
|
// Also, to clone the incoming object type arguments
|
943
|
-
if(isDefined(payload.userId)){payload.userId=tryStringify(payload.userId);}else {delete payload.userId;}if(isObjectLiteralAndNotNull(payload.traits)){payload.traits=clone
|
921
|
+
if(isDefined(payload.userId)){payload.userId=tryStringify(payload.userId);}else {delete payload.userId;}if(isObjectLiteralAndNotNull(payload.traits)){payload.traits=clone(payload.traits);}else {delete payload.traits;}if(isDefined(payload.options)){payload.options=clone(payload.options);}else {delete payload.options;}return payload;};/*
|
944
922
|
* Normalise the overloaded arguments of the alias call facade
|
945
923
|
*/var aliasArgumentsToCallOptions=function aliasArgumentsToCallOptions(to,from,options,callback){var payload={to:to,from:from,options:options};if(isFunction(callback)){payload.callback=callback;}if(isFunction(options)){payload.to=to;payload.from=from;delete payload.options;payload.callback=options;}if(isFunction(from)){payload.to=to;delete payload.from;delete payload.options;payload.callback=from;}else if(isObjectLiteralAndNotNull(from)||isNull(from)){payload.to=to;delete payload.from;payload.options=from;}if(isFunction(to)){delete payload.to;delete payload.from;delete payload.options;payload.callback=to;}else if(isObjectLiteralAndNotNull(to)||isNull(to)){delete payload.to;delete payload.from;payload.options=to;}// Rest of the code is just to clean up undefined values
|
946
924
|
// and set some proper defaults
|
947
925
|
// Also, to clone the incoming object type arguments
|
948
|
-
if(isDefined(payload.to)){payload.to=tryStringify(payload.to);}else {delete payload.to;}if(isDefined(payload.from)){payload.from=tryStringify(payload.from);}else {delete payload.from;}if(isDefined(payload.options)){payload.options=clone
|
926
|
+
if(isDefined(payload.to)){payload.to=tryStringify(payload.to);}else {delete payload.to;}if(isDefined(payload.from)){payload.from=tryStringify(payload.from);}else {delete payload.from;}if(isDefined(payload.options)){payload.options=clone(payload.options);}else {delete payload.options;}return payload;};/*
|
949
927
|
* Normalise the overloaded arguments of the group call facade
|
950
928
|
*/var groupArgumentsToCallOptions=function groupArgumentsToCallOptions(groupId,traits,options,callback){var payload={groupId:groupId,traits:traits,options:options};if(isFunction(callback)){payload.callback=callback;}if(isFunction(options)){payload.groupId=groupId;payload.traits=traits;delete payload.options;payload.callback=options;}if(isFunction(traits)){payload.groupId=groupId;delete payload.traits;delete payload.options;payload.callback=traits;}// TODO: why do we enable overload for group that only passes callback? is there any use case?
|
951
929
|
if(isFunction(groupId)){// Explicitly set null to prevent resetting the existing value
|
@@ -954,11 +932,11 @@ payload.groupId=null;delete payload.traits;delete payload.options;payload.callba
|
|
954
932
|
payload.groupId=null;payload.traits=groupId;payload.options=!isFunction(traits)?traits:null;}// Rest of the code is just to clean up undefined values
|
955
933
|
// and set some proper defaults
|
956
934
|
// Also, to clone the incoming object type arguments
|
957
|
-
if(isDefined(payload.groupId)){payload.groupId=tryStringify(payload.groupId);}else {delete payload.groupId;}payload.traits=isObjectLiteralAndNotNull(payload.traits)?clone
|
935
|
+
if(isDefined(payload.groupId)){payload.groupId=tryStringify(payload.groupId);}else {delete payload.groupId;}payload.traits=isObjectLiteralAndNotNull(payload.traits)?clone(payload.traits):{};if(isDefined(payload.options)){payload.options=clone(payload.options);}else {delete payload.options;}return payload;};
|
958
936
|
|
959
937
|
var CAPABILITIES_MANAGER='CapabilitiesManager';var CONFIG_MANAGER='ConfigManager';var EVENT_MANAGER='EventManager';var PLUGINS_MANAGER='PluginsManager';var USER_SESSION_MANAGER='UserSessionManager';var ERROR_HANDLER='ErrorHandler';var PLUGIN_ENGINE='PluginEngine';var STORE_MANAGER='StoreManager';var READY_API='readyApi';var EVENT_REPOSITORY='EventRepository';var EXTERNAL_SRC_LOADER='ExternalSrcLoader';var HTTP_CLIENT='HttpClient';var RS_APP='RudderStackApplication';var ANALYTICS_CORE='AnalyticsCore';
|
960
938
|
|
961
|
-
var APP_NAME='RudderLabs JavaScript SDK';var APP_VERSION='3.0.0-beta.
|
939
|
+
var APP_NAME='RudderLabs JavaScript SDK';var APP_VERSION='3.0.0-beta.20';var APP_NAMESPACE='com.rudderlabs.javascript';var MODULE_TYPE='npm';var ADBLOCK_PAGE_CATEGORY='RudderJS-Initiated';var ADBLOCK_PAGE_NAME='ad-block page request';var ADBLOCK_PAGE_PATH='/ad-blocked';var GLOBAL_PRELOAD_BUFFER='preloadedEventsBuffer';var CONSENT_TRACK_EVENT_NAME='Consent Management Interaction';
|
962
940
|
|
963
941
|
var QUERY_PARAM_TRAIT_PREFIX='ajs_trait_';var QUERY_PARAM_PROPERTY_PREFIX='ajs_prop_';var QUERY_PARAM_ANONYMOUS_ID_KEY='ajs_aid';var QUERY_PARAM_USER_ID_KEY='ajs_uid';var QUERY_PARAM_TRACK_EVENT_NAME_KEY='ajs_event';
|
964
942
|
|
@@ -991,7 +969,7 @@ if(queryObject.get(QUERY_PARAM_ANONYMOUS_ID_KEY)){argumentsArray.unshift(['setAn
|
|
991
969
|
* Retrieve an existing buffered load method call and remove from the existing array
|
992
970
|
*/var getPreloadedLoadEvent=function getPreloadedLoadEvent(preloadedEventsArray){var loadMethodName='load';var loadEvent=[];/**
|
993
971
|
* Iterate the buffered API calls until we find load call and process it separately
|
994
|
-
*/var i=0;while(i<preloadedEventsArray.length){if(preloadedEventsArray[i]&&preloadedEventsArray[i][0]===loadMethodName){loadEvent=clone
|
972
|
+
*/var i=0;while(i<preloadedEventsArray.length){if(preloadedEventsArray[i]&&preloadedEventsArray[i][0]===loadMethodName){loadEvent=clone(preloadedEventsArray[i]);preloadedEventsArray.splice(i,1);break;}i+=1;}return loadEvent;};/**
|
995
973
|
* Promote consent events to the top of the preloaded events array
|
996
974
|
* @param preloadedEventsArray Preloaded events array
|
997
975
|
* @returns None
|
@@ -1074,6 +1052,10 @@ timeoutID=globalThis.setTimeout(function(){reject(new Error(SCRIPT_LOAD_TIMEOUT_
|
|
1074
1052
|
|
1075
1053
|
function i$2(){throw new Error("Cycle detected");}var t$1=Symbol.for("preact-signals");function r(){if(!(v>1)){var i,t=!1;while(void 0!==f){var r=f;f=void 0;e++;while(void 0!==r){var n=r.o;r.o=void 0;r.f&=-3;if(!(8&r.f)&&l(r))try{r.c();}catch(r){if(!t){i=r;t=!0;}}r=n;}}e=0;v--;if(t)throw i;}else v--;}function n(i){if(v>0)return i();v++;try{return i();}finally{r();}}var o=void 0;var f=void 0,v=0,e=0,u=0;function c(i){if(void 0!==o){var t=i.n;if(void 0===t||t.t!==o){t={i:0,S:i,p:o.s,n:void 0,t:o,e:void 0,x:void 0,r:t};if(void 0!==o.s)o.s.n=t;o.s=t;i.n=t;if(32&o.f)i.S(t);return t;}else if(-1===t.i){t.i=0;if(void 0!==t.n){t.n.p=t.p;if(void 0!==t.p)t.p.n=t.n;t.p=o.s;t.n=void 0;o.s.n=t;o.s=t;}return t;}}}function d$1(i){this.v=i;this.i=0;this.n=void 0;this.t=void 0;}d$1.prototype.brand=t$1;d$1.prototype.h=function(){return !0;};d$1.prototype.S=function(i){if(this.t!==i&&void 0===i.e){i.x=this.t;if(void 0!==this.t)this.t.e=i;this.t=i;}};d$1.prototype.U=function(i){if(void 0!==this.t){var t=i.e,r=i.x;if(void 0!==t){t.x=r;i.e=void 0;}if(void 0!==r){r.e=t;i.x=void 0;}if(i===this.t)this.t=r;}};d$1.prototype.subscribe=function(i){var t=this;return O(function(){var r=t.value,n=32&this.f;this.f&=-33;try{i(r);}finally{this.f|=n;}});};d$1.prototype.valueOf=function(){return this.value;};d$1.prototype.toString=function(){return this.value+"";};d$1.prototype.toJSON=function(){return this.value;};d$1.prototype.peek=function(){return this.v;};Object.defineProperty(d$1.prototype,"value",{get:function get(){var i=c(this);if(void 0!==i)i.i=this.i;return this.v;},set:function set(t){if(o instanceof _)!function(){throw new Error("Computed cannot have side-effects");}();if(t!==this.v){if(e>100)i$2();this.v=t;this.i++;u++;v++;try{for(var n=this.t;void 0!==n;n=n.x)n.t.N();}finally{r();}}}});function a(i){return new d$1(i);}function l(i){for(var t=i.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return !0;return !1;}function y(i){for(var t=i.s;void 0!==t;t=t.n){var r=t.S.n;if(void 0!==r)t.r=r;t.S.n=t;t.i=-1;if(void 0===t.n){i.s=t;break;}}}function w(i){var t=i.s,r=void 0;while(void 0!==t){var n=t.p;if(-1===t.i){t.S.U(t);if(void 0!==n)n.n=t.n;if(void 0!==t.n)t.n.p=n;}else r=t;t.S.n=t.r;if(void 0!==t.r)t.r=void 0;t=n;}i.s=r;}function _(i){d$1.call(this,void 0);this.x=i;this.s=void 0;this.g=u-1;this.f=4;}(_.prototype=new d$1()).h=function(){this.f&=-3;if(1&this.f)return !1;if(32==(36&this.f))return !0;this.f&=-5;if(this.g===u)return !0;this.g=u;this.f|=1;if(this.i>0&&!l(this)){this.f&=-2;return !0;}var i=o;try{y(this);o=this;var t=this.x();if(16&this.f||this.v!==t||0===this.i){this.v=t;this.f&=-17;this.i++;}}catch(i){this.v=i;this.f|=16;this.i++;}o=i;w(this);this.f&=-2;return !0;};_.prototype.S=function(i){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t);}d$1.prototype.S.call(this,i);};_.prototype.U=function(i){if(void 0!==this.t){d$1.prototype.U.call(this,i);if(void 0===this.t){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t);}}};_.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var i=this.t;void 0!==i;i=i.x)i.t.N();}};_.prototype.peek=function(){if(!this.h())i$2();if(16&this.f)throw this.v;return this.v;};Object.defineProperty(_.prototype,"value",{get:function get(){if(1&this.f)i$2();var t=c(this);this.h();if(void 0!==t)t.i=this.i;if(16&this.f)throw this.v;return this.v;}});function g(i){var t=i.u;i.u=void 0;if("function"==typeof t){v++;var n=o;o=void 0;try{t();}catch(t){i.f&=-2;i.f|=8;b(i);throw t;}finally{o=n;r();}}}function b(i){for(var t=i.s;void 0!==t;t=t.n)t.S.U(t);i.x=void 0;i.s=void 0;g(i);}function x$1(i){if(o!==this)throw new Error("Out-of-order effect");w(this);o=i;this.f&=-2;if(8&this.f)b(this);r();}function E(i){this.x=i;this.u=void 0;this.s=void 0;this.o=void 0;this.f=32;}E.prototype.c=function(){var i=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var t=this.x();if("function"==typeof t)this.u=t;}finally{i();}};E.prototype.S=function(){if(1&this.f)i$2();this.f|=1;this.f&=-9;g(this);y(this);v++;var t=o;o=this;return x$1.bind(this,t);};E.prototype.N=function(){if(!(2&this.f)){this.f|=2;this.o=f;f=this;}};E.prototype.d=function(){this.f|=8;if(!(1&this.f))b(this);};function O(i){var t=new E(i);try{t.c();}catch(i){t.d();throw i;}return t.d.bind(t);}
|
1076
1054
|
|
1055
|
+
/**
|
1056
|
+
* A buffer queue to serve as a store for any type of data
|
1057
|
+
*/var BufferQueue=/*#__PURE__*/function(){function BufferQueue(){_classCallCheck(this,BufferQueue);this.items=[];}_createClass(BufferQueue,[{key:"enqueue",value:function enqueue(item){this.items.push(item);}},{key:"dequeue",value:function dequeue(){if(this.items.length===0){return null;}return this.items.shift();}},{key:"isEmpty",value:function isEmpty(){return this.items.length===0;}},{key:"size",value:function size(){return this.items.length;}},{key:"clear",value:function clear(){this.items=[];}}]);return BufferQueue;}();
|
1058
|
+
|
1077
1059
|
var LOG_LEVEL_MAP={LOG:0,INFO:1,DEBUG:2,WARN:3,ERROR:4,NONE:5};var DEFAULT_LOG_LEVEL='ERROR';var LOG_MSG_PREFIX='RS SDK';var LOG_MSG_PREFIX_STYLE='font-weight: bold; background: black; color: white;';var LOG_MSG_STYLE='font-weight: normal;';/**
|
1078
1060
|
* Service to log messages/data to output provider, default is console
|
1079
1061
|
*/var Logger=/*#__PURE__*/function(){function Logger(){var minLogLevel=arguments.length>0&&arguments[0]!==undefined?arguments[0]:DEFAULT_LOG_LEVEL;var scope=arguments.length>1&&arguments[1]!==undefined?arguments[1]:'';var logProvider=arguments.length>2&&arguments[2]!==undefined?arguments[2]:console;_classCallCheck(this,Logger);this.minLogLevel=LOG_LEVEL_MAP[minLogLevel];this.scope=scope;this.logProvider=logProvider;}_createClass(Logger,[{key:"log",value:function log(){for(var _len=arguments.length,data=new Array(_len),_key=0;_key<_len;_key++){data[_key]=arguments[_key];}this.outputLog('LOG',data);}},{key:"info",value:function info(){for(var _len2=arguments.length,data=new Array(_len2),_key2=0;_key2<_len2;_key2++){data[_key2]=arguments[_key2];}this.outputLog('INFO',data);}},{key:"debug",value:function debug(){for(var _len3=arguments.length,data=new Array(_len3),_key3=0;_key3<_len3;_key3++){data[_key3]=arguments[_key3];}this.outputLog('DEBUG',data);}},{key:"warn",value:function warn(){for(var _len4=arguments.length,data=new Array(_len4),_key4=0;_key4<_len4;_key4++){data[_key4]=arguments[_key4];}this.outputLog('WARN',data);}},{key:"error",value:function error(){for(var _len5=arguments.length,data=new Array(_len5),_key5=0;_key5<_len5;_key5++){data[_key5]=arguments[_key5];}this.outputLog('ERROR',data);}},{key:"outputLog",value:function outputLog(logMethod,data){if(this.minLogLevel<=LOG_LEVEL_MAP[logMethod]){var _this$logProvider,_this$logProvider2;(_this$logProvider=(_this$logProvider2=this.logProvider)[logMethod.toLowerCase()])===null||_this$logProvider===void 0||_this$logProvider.call.apply(_this$logProvider,[_this$logProvider2].concat(_toConsumableArray(this.formatLogData(data))));}}},{key:"setScope",value:function setScope(scopeVal){this.scope=scopeVal||this.scope;}// TODO: should we allow to change the level via global variable on run time
|
@@ -1106,7 +1088,7 @@ var DEFAULT_CONFIG_BE_URL='https://api.rudderstack.com';
|
|
1106
1088
|
|
1107
1089
|
var DEFAULT_ERROR_REPORTING_PROVIDER='bugsnag';var DEFAULT_STORAGE_ENCRYPTION_VERSION='v3';var ConsentManagersToPluginNameMap={oneTrust:'OneTrustConsentManager',ketch:'KetchConsentManager',custom:'CustomConsentManager'};var ErrorReportingProvidersToPluginNameMap=_defineProperty({},DEFAULT_ERROR_REPORTING_PROVIDER,'Bugsnag');var StorageEncryptionVersionsToPluginNameMap=_defineProperty(_defineProperty({},DEFAULT_STORAGE_ENCRYPTION_VERSION,'StorageEncryption'),"legacy",'StorageEncryptionLegacy');
|
1108
1090
|
|
1109
|
-
var defaultLoadOptions={logLevel:'ERROR',configUrl:DEFAULT_CONFIG_BE_URL,loadIntegration:true,sessions:{autoTrack:true,timeout:DEFAULT_SESSION_TIMEOUT_MS},sameSiteCookie:'Lax',polyfillIfRequired:true,integrations:{All:true},useBeacon:false,beaconQueueOptions:{},destinationsQueueOptions:{},queueOptions:{},lockIntegrationsVersion:false,uaChTrackLevel:'none',plugins:[],useGlobalIntegrationsConfigInEvents:false,bufferDataPlaneEventsUntilReady:false,dataPlaneEventsBufferTimeout:DEFAULT_DATA_PLANE_EVENTS_BUFFER_TIMEOUT_MS,storage:{encryption:{version:DEFAULT_STORAGE_ENCRYPTION_VERSION},migrate:false},sendAdblockPageOptions:{}};var loadOptionsState=a(clone
|
1091
|
+
var defaultLoadOptions={logLevel:'ERROR',configUrl:DEFAULT_CONFIG_BE_URL,loadIntegration:true,sessions:{autoTrack:true,timeout:DEFAULT_SESSION_TIMEOUT_MS},sameSiteCookie:'Lax',polyfillIfRequired:true,integrations:{All:true},useBeacon:false,beaconQueueOptions:{},destinationsQueueOptions:{},queueOptions:{},lockIntegrationsVersion:false,uaChTrackLevel:'none',plugins:[],useGlobalIntegrationsConfigInEvents:false,bufferDataPlaneEventsUntilReady:false,dataPlaneEventsBufferTimeout:DEFAULT_DATA_PLANE_EVENTS_BUFFER_TIMEOUT_MS,storage:{encryption:{version:DEFAULT_STORAGE_ENCRYPTION_VERSION},migrate:false},sendAdblockPageOptions:{}};var loadOptionsState=a(clone(defaultLoadOptions));
|
1110
1092
|
|
1111
1093
|
var USER_SESSION_STORAGE_KEYS={userId:'rl_user_id',userTraits:'rl_trait',anonymousId:'rl_anonymous_id',groupId:'rl_group_id',groupTraits:'rl_group_trait',initialReferrer:'rl_page_init_referrer',initialReferringDomain:'rl_page_init_referring_domain',sessionInfo:'rl_session',authToken:'rl_auth_token'};var DEFAULT_USER_SESSION_VALUES={userId:'',userTraits:{},anonymousId:'',groupId:'',groupTraits:{},initialReferrer:'',initialReferringDomain:'',sessionInfo:{},authToken:null};
|
1112
1094
|
|
@@ -1114,7 +1096,7 @@ var defaultSessionInfo={autoTrack:true,timeout:DEFAULT_SESSION_TIMEOUT_MS};var s
|
|
1114
1096
|
|
1115
1097
|
var capabilitiesState={isOnline:a(true),storage:{isLocalStorageAvailable:a(false),isCookieStorageAvailable:a(false),isSessionStorageAvailable:a(false)},isBeaconAvailable:a(false),isLegacyDOM:a(false),isUaCHAvailable:a(false),isCryptoAvailable:a(false),isIE11:a(false),isAdBlocked:a(false)};
|
1116
1098
|
|
1117
|
-
var reportingState={isErrorReportingEnabled:a(false),isMetricsReportingEnabled:a(false),errorReportingProviderPluginName:a(undefined)};
|
1099
|
+
var reportingState={isErrorReportingEnabled:a(false),isMetricsReportingEnabled:a(false),errorReportingProviderPluginName:a(undefined),isErrorReportingPluginLoaded:a(false)};
|
1118
1100
|
|
1119
1101
|
var sourceConfigState=a(undefined);
|
1120
1102
|
|
@@ -1134,7 +1116,7 @@ var pluginsState={ready:a(false),loadedPlugins:a([]),failedPlugins:a([]),plugins
|
|
1134
1116
|
|
1135
1117
|
var storageState={encryptionPluginName:a(undefined),migrate:a(false),type:a(undefined),cookie:a(undefined),entries:a({}),trulyAnonymousTracking:a(false)};
|
1136
1118
|
|
1137
|
-
var defaultStateValues={capabilities:capabilitiesState,consents:consentsState,context:contextState,eventBuffer:eventBufferState,lifecycle:lifecycleState,loadOptions:loadOptionsState,metrics:metricsState,nativeDestinations:nativeDestinationsState,plugins:pluginsState,reporting:reportingState,session:sessionState,source:sourceConfigState,storage:storageState};var state=_objectSpread2({},clone
|
1119
|
+
var defaultStateValues={capabilities:capabilitiesState,consents:consentsState,context:contextState,eventBuffer:eventBufferState,lifecycle:lifecycleState,loadOptions:loadOptionsState,metrics:metricsState,nativeDestinations:nativeDestinationsState,plugins:pluginsState,reporting:reportingState,session:sessionState,source:sourceConfigState,storage:storageState};var state=_objectSpread2({},clone(defaultStateValues));
|
1138
1120
|
|
1139
1121
|
// to next or return the value if it is the last one instead of an array per
|
1140
1122
|
// plugin that is the normal invoke
|
@@ -1148,9 +1130,14 @@ if(throws){throw err;}else {var _this2$logger;(_this2$logger=_this2.logger)===nu
|
|
1148
1130
|
|
1149
1131
|
var FAILED_REQUEST_ERR_MSG_PREFIX='The request failed';var ERROR_MESSAGES_TO_BE_FILTERED=[FAILED_REQUEST_ERR_MSG_PREFIX];
|
1150
1132
|
|
1133
|
+
var LOAD_ORIGIN='RS_JS_SDK';
|
1134
|
+
|
1151
1135
|
/**
|
1152
1136
|
* Utility method to normalise errors
|
1153
|
-
*/var processError=function processError(error){var errorMessage;try{if(isString(error)){errorMessage=error;}else if(error instanceof Error){errorMessage=error.message;}else {errorMessage=error.message
|
1137
|
+
*/var processError=function processError(error){var errorMessage;try{if(isString(error)){errorMessage=error;}else if(error instanceof Error){errorMessage=error.message;}else if(error instanceof ErrorEvent){errorMessage=error.message;}// TODO: remove this block once all device mode integrations start using the v3 script loader module (TS)
|
1138
|
+
else if(error instanceof Event){var eventTarget=error.target;// Discard all the non-script loading errors
|
1139
|
+
if(eventTarget&&eventTarget.localName!=='script'){return '';}// Discard script errors that are not originated at SDK or from native SDKs
|
1140
|
+
if(eventTarget!==null&&eventTarget!==void 0&&eventTarget.dataset&&(eventTarget.dataset.loader!==LOAD_ORIGIN||eventTarget.dataset.isnonnativesdk!=='true')){return '';}errorMessage="Error in loading a third-party script from URL ".concat(eventTarget===null||eventTarget===void 0?void 0:eventTarget.src," with ID ").concat(eventTarget===null||eventTarget===void 0?void 0:eventTarget.id,".");}else {errorMessage=error.message?error.message:stringifyWithoutCircular(error);}}catch(e){errorMessage="Unknown error: ".concat(e.message);}return errorMessage;};/**
|
1154
1141
|
* A function to determine whether the error should be promoted to notify or not
|
1155
1142
|
* @param {Error} error
|
1156
1143
|
* @returns
|
@@ -1159,10 +1146,12 @@ var FAILED_REQUEST_ERR_MSG_PREFIX='The request failed';var ERROR_MESSAGES_TO_BE_
|
|
1159
1146
|
/**
|
1160
1147
|
* A service to handle errors
|
1161
1148
|
*/var ErrorHandler=/*#__PURE__*/function(){// If no logger is passed errors will be thrown as unhandled error
|
1162
|
-
function ErrorHandler(logger,pluginEngine){_classCallCheck(this,ErrorHandler);this.logger=logger;this.pluginEngine=pluginEngine;}_createClass(ErrorHandler,[{key:"init",value:function init(externalSrcLoader){var
|
1149
|
+
function ErrorHandler(logger,pluginEngine){_classCallCheck(this,ErrorHandler);this.logger=logger;this.pluginEngine=pluginEngine;this.errorBuffer=new BufferQueue();this.attachEffect();}_createClass(ErrorHandler,[{key:"attachEffect",value:function attachEffect(){if(state.reporting.isErrorReportingPluginLoaded.value===true){while(this.errorBuffer.size()>0){this.errorBuffer.dequeue();}}}},{key:"attachErrorListeners",value:function attachErrorListeners(){var _this=this;if('addEventListener'in globalThis){globalThis.addEventListener('error',function(event){_this.onError(event,undefined,undefined,undefined,'unhandledException');});globalThis.addEventListener('unhandledrejection',function(event){_this.onError(event,undefined,undefined,undefined,'unhandledPromiseRejection');});}else {var _this$logger;(_this$logger=this.logger)===null||_this$logger===void 0||_this$logger.debug("Failed to attach global error listeners.");}}},{key:"init",value:function init(externalSrcLoader){var _this2=this;if(!this.pluginEngine){return;}try{var extPoint='errorReporting.init';var errReportingInitVal=this.pluginEngine.invokeSingle(extPoint,state,this.pluginEngine,externalSrcLoader,this.logger);if(errReportingInitVal instanceof Promise){errReportingInitVal.then(function(client){_this2.errReportingClient=client;}).catch(function(err){var _this2$logger;(_this2$logger=_this2.logger)===null||_this2$logger===void 0||_this2$logger.error(REPORTING_PLUGIN_INIT_FAILURE_ERROR(ERROR_HANDLER),err);});}}catch(err){this.onError(err,ERROR_HANDLER);}}},{key:"onError",value:function onError(error){var context=arguments.length>1&&arguments[1]!==undefined?arguments[1]:'';var customMessage=arguments.length>2&&arguments[2]!==undefined?arguments[2]:'';var shouldAlwaysThrow=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var errorType=arguments.length>4&&arguments[4]!==undefined?arguments[4]:'handled';// Error handling is already implemented in processError method
|
1163
1150
|
var errorMessage=processError(error);// If no error message after we normalize, then we swallow/ignore the errors
|
1164
|
-
if(!errorMessage){return;}
|
1165
|
-
|
1151
|
+
if(!errorMessage){return;}// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
1152
|
+
errorMessage=removeDoubleSpaces("".concat(context).concat(LOG_CONTEXT_SEPARATOR).concat(customMessage," ").concat(errorMessage));var normalizedError=new Error(errorMessage);if(isTypeOfError(error)){normalizedError=Object.create(error,{message:{value:errorMessage}});}if(errorType==='handled'){// TODO: Remove the below line once the new Reporting plugin is ready
|
1153
|
+
this.notifyError(normalizedError);if(this.logger){this.logger.error(errorMessage);if(shouldAlwaysThrow){throw normalizedError;}}else {throw normalizedError;}}// eslint-disable-next-line sonarjs/no-all-duplicated-branches
|
1154
|
+
if(state.reporting.isErrorReportingEnabled.value&&!state.reporting.isErrorReportingPluginLoaded.value);}/**
|
1166
1155
|
* Add breadcrumbs to add insight of a user's journey before an error
|
1167
1156
|
* occurred and send to external error monitoring service via a plugin
|
1168
1157
|
*
|
@@ -1229,7 +1218,7 @@ var EVENT_PAYLOAD_SIZE_CHECK_FAIL_WARNING=function EVENT_PAYLOAD_SIZE_CHECK_FAIL
|
|
1229
1218
|
* Updates certain parameters like sentAt timestamp, integrations config etc.
|
1230
1219
|
* @param event RudderEvent object
|
1231
1220
|
* @returns Final event ready to be delivered
|
1232
|
-
*/var getFinalEventForDeliveryMutator=function getFinalEventForDeliveryMutator(event,currentTime){var finalEvent=clone
|
1221
|
+
*/var getFinalEventForDeliveryMutator=function getFinalEventForDeliveryMutator(event,currentTime){var finalEvent=clone(event);// Update sentAt timestamp to the latest timestamp
|
1233
1222
|
finalEvent.sentAt=currentTime;return finalEvent;};
|
1234
1223
|
|
1235
1224
|
var ENCRYPTION_PREFIX_V3='RS_ENC_v3_';
|
@@ -1394,7 +1383,7 @@ event.context='Script load failures';}// eslint-disable-next-line no-param-reass
|
|
1394
1383
|
event.severity='error';};var onError=function onError(state){var _state$source$value;var metadataSource=(_state$source$value=state.source.value)===null||_state$source$value===void 0?void 0:_state$source$value.id;return function(event){try{// Discard the event if it's not originated at the SDK
|
1395
1384
|
if(!isRudderSDKError(event)){return false;}enhanceErrorEventMutator(event,metadataSource);return true;}catch(_unused){// Drop the error event if it couldn't be filtered as
|
1396
1385
|
// it is most likely a non-SDK error
|
1397
|
-
return false;}};};var getReleaseStage=function getReleaseStage(){var host=globalThis.location.hostname;return host&&DEV_HOSTS.includes(host)?'development':'production';};var getGlobalBugsnagLibInstance=function getGlobalBugsnagLibInstance(){return globalThis[BUGSNAG_LIB_INSTANCE_GLOBAL_KEY_NAME];};var getNewClient=function getNewClient(state,logger){var globalBugsnagLibInstance=getGlobalBugsnagLibInstance();var clientConfig={apiKey:API_KEY,appVersion:'3.0.0-beta.
|
1386
|
+
return false;}};};var getReleaseStage=function getReleaseStage(){var host=globalThis.location.hostname;return host&&DEV_HOSTS.includes(host)?'development':'production';};var getGlobalBugsnagLibInstance=function getGlobalBugsnagLibInstance(){return globalThis[BUGSNAG_LIB_INSTANCE_GLOBAL_KEY_NAME];};var getNewClient=function getNewClient(state,logger){var globalBugsnagLibInstance=getGlobalBugsnagLibInstance();var clientConfig={apiKey:API_KEY,appVersion:'3.0.0-beta.20',// Set SDK version as the app version from build config
|
1398
1387
|
metaData:{SDK:{name:'JS',installType:'npm'}},beforeSend:onError(state),autoCaptureSessions:false,// auto capture sessions is disabled
|
1399
1388
|
collectUserIp:false,// collecting user's IP is disabled
|
1400
1389
|
// enabledBreadcrumbTypes: ['error', 'log', 'user'], // for v7 and above
|
@@ -1418,158 +1407,160 @@ if(!(cmpConfig!==null&&cmpConfig!==void 0&&cmpConfig.consents)){return true;}var
|
|
1418
1407
|
// the configured resolution strategy
|
1419
1408
|
var matchPredicate=function matchPredicate(consent){return allowedConsentIds.includes(consent);};switch(resolutionStrategy){case'or':return configuredConsents.some(matchPredicate)||configuredConsents.length===0;case'and':default:return configuredConsents.every(matchPredicate);}}catch(err){errorHandler===null||errorHandler===void 0||errorHandler.onError(err,CUSTOM_CONSENT_MANAGER_PLUGIN,DESTINATION_CONSENT_STATUS_ERROR$2);return true;}}}};};
|
1420
1409
|
|
1421
|
-
var DIR_NAME$
|
1410
|
+
var DIR_NAME$1b='AdobeAnalytics';var NAME$1b='ADOBE_ANALYTICS';var DISPLAY_NAME$1b='Adobe Analytics';_defineProperty({},DISPLAY_NAME$1b,DIR_NAME$1b);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({'Adobe Analytics':NAME$1b,ADOBEANALYTICS:NAME$1b,'ADOBE ANALYTICS':NAME$1b},NAME$1b,NAME$1b),"AdobeAnalytics",NAME$1b),"adobeanalytics",NAME$1b),'adobe analytics',NAME$1b),'Adobe analytics',NAME$1b),'adobe Analytics',NAME$1b);
|
1411
|
+
|
1412
|
+
var DIR_NAME$1a='Amplitude';var NAME$1a='AM';var DISPLAY_NAME$1a='Amplitude';_defineProperty({},DISPLAY_NAME$1a,DIR_NAME$1a);_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$1a,NAME$1a),"AMPLITUDE",NAME$1a),"Amplitude",NAME$1a),"am",NAME$1a);
|
1422
1413
|
|
1423
|
-
var DIR_NAME$19='
|
1414
|
+
var DIR_NAME$19='Appcues';var NAME$19='APPCUES';var DISPLAY_NAME$19='Appcues';_defineProperty({},DISPLAY_NAME$19,DIR_NAME$19);_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$19,NAME$19),"Appcues",NAME$19),'App Cues',NAME$19),"appcues",NAME$19);
|
1424
1415
|
|
1425
|
-
var DIR_NAME$18='
|
1416
|
+
var DIR_NAME$18='BingAds';var NAME$18='BINGADS';var DISPLAY_NAME$18='Bing Ads';_defineProperty({},DISPLAY_NAME$18,DIR_NAME$18);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$18,NAME$18),"BingAds",NAME$18),"bingads",NAME$18),'Bing Ads',NAME$18),'Bing ads',NAME$18),'bing Ads',NAME$18),'bing ads',NAME$18);
|
1426
1417
|
|
1427
|
-
var DIR_NAME$17='
|
1418
|
+
var DIR_NAME$17='Braze';var NAME$17='BRAZE';var DISPLAY_NAME$17='Braze';_defineProperty({},DISPLAY_NAME$17,DIR_NAME$17);_defineProperty(_defineProperty(_defineProperty({},NAME$17,NAME$17),"Braze",NAME$17),"braze",NAME$17);
|
1428
1419
|
|
1429
|
-
var DIR_NAME$16='
|
1420
|
+
var DIR_NAME$16='Bugsnag';var NAME$16='BUGSNAG';var DISPLAY_NAME$16='Bugsnag';_defineProperty({},DISPLAY_NAME$16,DIR_NAME$16);_defineProperty(_defineProperty(_defineProperty({},NAME$16,NAME$16),"bugsnag",NAME$16),"Bugsnag",NAME$16);
|
1430
1421
|
|
1431
|
-
var DIR_NAME$15='
|
1422
|
+
var DIR_NAME$15='Chartbeat';var NAME$15='CHARTBEAT';var DISPLAY_NAME$15='Chartbeat';_defineProperty({},DISPLAY_NAME$15,DIR_NAME$15);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$15,NAME$15),"Chartbeat",NAME$15),"chartbeat",NAME$15),'Chart Beat',NAME$15),'chart beat',NAME$15);
|
1432
1423
|
|
1433
|
-
var DIR_NAME$14='
|
1424
|
+
var DIR_NAME$14='Clevertap';var NAME$14='CLEVERTAP';var DISPLAY_NAME$14='CleverTap';_defineProperty({},DISPLAY_NAME$14,DIR_NAME$14);_defineProperty(_defineProperty(_defineProperty({},NAME$14,NAME$14),"Clevertap",NAME$14),"clevertap",NAME$14);
|
1434
1425
|
|
1435
|
-
var DIR_NAME$13='
|
1426
|
+
var DIR_NAME$13='Comscore';var NAME$13='COMSCORE';var DISPLAY_NAME$13='Comscore';_defineProperty({},DISPLAY_NAME$13,DIR_NAME$13);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$13,NAME$13),"Comscore",NAME$13),'Com Score',NAME$13),'com Score',NAME$13),'com score',NAME$13),'Com score',NAME$13);
|
1436
1427
|
|
1437
|
-
var DIR_NAME$12='
|
1428
|
+
var DIR_NAME$12='Criteo';var NAME$12='CRITEO';var DISPLAY_NAME$12='Criteo';_defineProperty({},DISPLAY_NAME$12,DIR_NAME$12);_defineProperty(_defineProperty(_defineProperty({},NAME$12,NAME$12),"Criteo",NAME$12),"criteo",NAME$12);
|
1438
1429
|
|
1439
|
-
var DIR_NAME$11='
|
1430
|
+
var DIR_NAME$11='CustomerIO';var NAME$11='CUSTOMERIO';var DISPLAY_NAME$11='Customer IO';_defineProperty({},DISPLAY_NAME$11,DIR_NAME$11);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$11,NAME$11),"Customerio",NAME$11),'Customer.io',NAME$11),'CUSTOMER.IO',NAME$11),'customer.io',NAME$11);
|
1440
1431
|
|
1441
|
-
var DIR_NAME$10='
|
1432
|
+
var DIR_NAME$10='Drip';var NAME$10='DRIP';var DISPLAY_NAME$10='Drip';_defineProperty({},DISPLAY_NAME$10,DIR_NAME$10);_defineProperty(_defineProperty(_defineProperty({},NAME$10,NAME$10),"Drip",NAME$10),"drip",NAME$10);
|
1442
1433
|
|
1443
|
-
var DIR_NAME$$='
|
1434
|
+
var DIR_NAME$$='FacebookPixel';var NAME$$='FACEBOOK_PIXEL';var DISPLAY_NAME$$='Facebook Pixel';_defineProperty({},DISPLAY_NAME$$,DIR_NAME$$);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$$,NAME$$),'FB Pixel',NAME$$),'Facebook Pixel',NAME$$),'facebook pixel',NAME$$),"fbpixel",NAME$$),"FBPIXEL",NAME$$),"FB_PIXEL",NAME$$);
|
1444
1435
|
|
1445
|
-
var DIR_NAME$_='
|
1436
|
+
var DIR_NAME$_='Fullstory';var NAME$_='FULLSTORY';var DISPLAY_NAME$_='Fullstory';_defineProperty({},DISPLAY_NAME$_,DIR_NAME$_);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$_,NAME$_),"Fullstory",NAME$_),"FullStory",NAME$_),'full Story',NAME$_),'Full Story',NAME$_),'Full story',NAME$_),'full story',NAME$_),"fullstory",NAME$_);
|
1446
1437
|
|
1447
|
-
var DIR_NAME$Z='
|
1438
|
+
var DIR_NAME$Z='GA';var NAME$Z='GA';var DISPLAY_NAME$Z='Google Analytics';_defineProperty({},DISPLAY_NAME$Z,DIR_NAME$Z);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$Z,NAME$Z),'Google Analytics',NAME$Z),"GoogleAnalytics",NAME$Z),'GOOGLE ANALYTICS',NAME$Z),'google analytics',NAME$Z);
|
1448
1439
|
|
1449
|
-
var DIR_NAME$Y='
|
1440
|
+
var DIR_NAME$Y='GA4';var NAME$Y='GA4';var DISPLAY_NAME$Y='Google Analytics 4 (GA4)';_defineProperty({},DISPLAY_NAME$Y,DIR_NAME$Y);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$Y,NAME$Y),'Google Analytics 4',NAME$Y),'Google analytics 4',NAME$Y),'google analytics 4',NAME$Y),'Google Analytics4',NAME$Y),'Google analytics4',NAME$Y),'google analytics4',NAME$Y),'Google Analytics 4 (GA4)',NAME$Y),'google analytics 4 (ga4)',NAME$Y),"GoogleAnalytics4",NAME$Y);
|
1450
1441
|
|
1451
|
-
var DIR_NAME$X='
|
1442
|
+
var DIR_NAME$X='GoogleAds';var NAME$X='GOOGLEADS';var DISPLAY_NAME$X='Google Ads';_defineProperty({},DISPLAY_NAME$X,DIR_NAME$X);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$X,NAME$X),'Google Ads',NAME$X),"GoogleAds",NAME$X),'GOOGLE ADS',NAME$X),'google ads',NAME$X),"googleads",NAME$X);
|
1452
1443
|
|
1453
|
-
var DIR_NAME$W='
|
1444
|
+
var DIR_NAME$W='GoogleOptimize';var NAME$W='GOOGLE_OPTIMIZE';var DISPLAY_NAME$W='Google Optimize';_defineProperty({},DISPLAY_NAME$W,DIR_NAME$W);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$W,NAME$W),'Google Optimize',NAME$W),"GoogleOptimize",NAME$W),"Googleoptimize",NAME$W),"GOOGLEOPTIMIZE",NAME$W),'google optimize',NAME$W),'Google optimize',NAME$W),'GOOGLE OPTIMIZE',NAME$W);
|
1454
1445
|
|
1455
|
-
var DIR_NAME$V='
|
1446
|
+
var DIR_NAME$V='GoogleTagManager';var NAME$V='GTM';var DISPLAY_NAME$V='Google Tag Manager';_defineProperty({},DISPLAY_NAME$V,DIR_NAME$V);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$V,NAME$V),'Google Tag Manager',NAME$V),'google tag manager',NAME$V),'googletag manager',NAME$V),"googletagmanager",NAME$V);
|
1456
1447
|
|
1457
|
-
var DIR_NAME$U='
|
1448
|
+
var DIR_NAME$U='Heap';var NAME$U='HEAP';var DISPLAY_NAME$U='Heap.io';_defineProperty({},DISPLAY_NAME$U,DIR_NAME$U);_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$U,NAME$U),"Heap",NAME$U),"heap",NAME$U),'Heap.io',NAME$U);
|
1458
1449
|
|
1459
|
-
var DIR_NAME$T='
|
1450
|
+
var DIR_NAME$T='Hotjar';var NAME$T='HOTJAR';var DISPLAY_NAME$T='Hotjar';_defineProperty({},DISPLAY_NAME$T,DIR_NAME$T);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$T,NAME$T),"Hotjar",NAME$T),"hotjar",NAME$T),'Hot Jar',NAME$T),'hot jar',NAME$T);
|
1460
1451
|
|
1461
|
-
var DIR_NAME$S='
|
1452
|
+
var DIR_NAME$S='HubSpot';var NAME$S='HS';var DISPLAY_NAME$S='HubSpot';_defineProperty({},DISPLAY_NAME$S,DIR_NAME$S);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$S,NAME$S),"Hubspot",NAME$S),"HUBSPOT",NAME$S),'hub spot',NAME$S),'Hub Spot',NAME$S),'Hub spot',NAME$S);
|
1462
1453
|
|
1463
|
-
var DIR_NAME$R='
|
1454
|
+
var DIR_NAME$R='INTERCOM';var NAME$R='INTERCOM';var DISPLAY_NAME$R='Intercom';_defineProperty({},DISPLAY_NAME$R,DIR_NAME$R);_defineProperty(_defineProperty(_defineProperty({},NAME$R,NAME$R),"Intercom",NAME$R),"intercom",NAME$R);
|
1464
1455
|
|
1465
|
-
var DIR_NAME$Q='
|
1456
|
+
var DIR_NAME$Q='Keen';var NAME$Q='KEEN';var DISPLAY_NAME$Q='Keen';_defineProperty({},DISPLAY_NAME$Q,DIR_NAME$Q);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$Q,NAME$Q),"Keen",NAME$Q),'Keen.io',NAME$Q),"keen",NAME$Q),'keen.io',NAME$Q);
|
1466
1457
|
|
1467
|
-
var DIR_NAME$P='
|
1458
|
+
var DIR_NAME$P='Kissmetrics';var NAME$P='KISSMETRICS';var DISPLAY_NAME$P='Kiss Metrics';_defineProperty({},DISPLAY_NAME$P,DIR_NAME$P);_defineProperty(_defineProperty(_defineProperty({},NAME$P,NAME$P),"Kissmetrics",NAME$P),"kissmetrics",NAME$P);
|
1468
1459
|
|
1469
|
-
var DIR_NAME$O='
|
1460
|
+
var DIR_NAME$O='Klaviyo';var NAME$O='KLAVIYO';var DISPLAY_NAME$O='Klaviyo';_defineProperty({},DISPLAY_NAME$O,DIR_NAME$O);_defineProperty(_defineProperty(_defineProperty({},NAME$O,NAME$O),"Klaviyo",NAME$O),"klaviyo",NAME$O);
|
1470
1461
|
|
1471
|
-
var DIR_NAME$N='
|
1462
|
+
var DIR_NAME$N='LaunchDarkly';var NAME$N='LAUNCHDARKLY';var DISPLAY_NAME$N='LaunchDarkly';_defineProperty({},DISPLAY_NAME$N,DIR_NAME$N);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$N,NAME$N),"LaunchDarkly",NAME$N),"Launch_Darkly",NAME$N),'Launch Darkly',NAME$N),"launchDarkly",NAME$N),'launch darkly',NAME$N);
|
1472
1463
|
|
1473
|
-
var DIR_NAME$M='
|
1464
|
+
var _CNameMapping$1;var DIR_NAME$M='LinkedInInsightTag';var NAME$M='LINKEDIN_INSIGHT_TAG';var DISPLAY_NAME$M='Linkedin Insight Tag';_defineProperty({},DISPLAY_NAME$M,DIR_NAME$M);(_CNameMapping$1={},_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_CNameMapping$1,NAME$M,NAME$M),'LinkedIn Insight Tag',NAME$M),'LinkedIn insight tag',NAME$M),'linkedIn insight tag',NAME$M),"Linkedin_insight_tag",NAME$M),"LinkedinInsighttag",NAME$M),"LinkedinInsightTag",NAME$M),"LinkedInInsightTag",NAME$M),"Linkedininsighttag",NAME$M),"LINKEDININSIGHTTAG",NAME$M),_defineProperty(_CNameMapping$1,"linkedininsighttag",NAME$M));
|
1474
1465
|
|
1475
|
-
var
|
1466
|
+
var DIR_NAME$L='Lotame';var NAME$L='LOTAME';var DISPLAY_NAME$L='Lotame';_defineProperty({},DISPLAY_NAME$L,DIR_NAME$L);_defineProperty(_defineProperty(_defineProperty({},NAME$L,NAME$L),"Lotame",NAME$L),"lotame",NAME$L);
|
1476
1467
|
|
1477
|
-
var DIR_NAME$K='
|
1468
|
+
var DIR_NAME$K='Lytics';var NAME$K='LYTICS';var DISPLAY_NAME$K='Lytics';_defineProperty({},DISPLAY_NAME$K,DIR_NAME$K);_defineProperty(_defineProperty(_defineProperty({},NAME$K,NAME$K),"Lytics",NAME$K),"lytics",NAME$K);
|
1478
1469
|
|
1479
|
-
var DIR_NAME$J='
|
1470
|
+
var DIR_NAME$J='Mixpanel';var NAME$J='MP';var DISPLAY_NAME$J='Mixpanel';_defineProperty({},DISPLAY_NAME$J,DIR_NAME$J);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$J,NAME$J),"MIXPANEL",NAME$J),"Mixpanel",NAME$J),'MIX PANEL',NAME$J),'Mix panel',NAME$J),'Mix Panel',NAME$J);
|
1480
1471
|
|
1481
|
-
var DIR_NAME$I='
|
1472
|
+
var DIR_NAME$I='MoEngage';var NAME$I='MOENGAGE';var DISPLAY_NAME$I='MoEngage';_defineProperty({},DISPLAY_NAME$I,DIR_NAME$I);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$I,NAME$I),"MoEngage",NAME$I),"moengage",NAME$I),"Moengage",NAME$I),'Mo Engage',NAME$I),'mo engage',NAME$I),'Mo engage',NAME$I);
|
1482
1473
|
|
1483
|
-
var DIR_NAME$H='
|
1474
|
+
var DIR_NAME$H='Optimizely';var NAME$H='OPTIMIZELY';var DISPLAY_NAME$H='Optimizely Web';_defineProperty({},DISPLAY_NAME$H,DIR_NAME$H);_defineProperty(_defineProperty(_defineProperty({},NAME$H,NAME$H),"Optimizely",NAME$H),"optimizely",NAME$H);
|
1484
1475
|
|
1485
|
-
var DIR_NAME$G='
|
1476
|
+
var DIR_NAME$G='Pendo';var NAME$G='PENDO';var DISPLAY_NAME$G='Pendo';_defineProperty({},DISPLAY_NAME$G,DIR_NAME$G);_defineProperty(_defineProperty(_defineProperty({},NAME$G,NAME$G),"Pendo",NAME$G),"pendo",NAME$G);
|
1486
1477
|
|
1487
|
-
var DIR_NAME$F='
|
1478
|
+
var _CNameMapping;var DIR_NAME$F='PinterestTag';var NAME$F='PINTEREST_TAG';var DISPLAY_NAME$F='Pinterest Tag';_defineProperty({},DISPLAY_NAME$F,DIR_NAME$F);(_CNameMapping={},_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_CNameMapping,NAME$F,NAME$F),"PinterestTag",NAME$F),"Pinterest_Tag",NAME$F),"PINTERESTTAG",NAME$F),"pinterest",NAME$F),"PinterestAds",NAME$F),"Pinterest_Ads",NAME$F),"Pinterest",NAME$F),'Pinterest Tag',NAME$F),'Pinterest tag',NAME$F),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_CNameMapping,'PINTEREST TAG',NAME$F),'pinterest tag',NAME$F),'Pinterest Ads',NAME$F),'Pinterest ads',NAME$F));
|
1488
1479
|
|
1489
|
-
var
|
1480
|
+
var DIR_NAME$E='PostAffiliatePro';var NAME$E='POST_AFFILIATE_PRO';var DISPLAY_NAME$E='Post Affiliate Pro';_defineProperty({},DISPLAY_NAME$E,DIR_NAME$E);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$E,NAME$E),"PostAffiliatePro",NAME$E),"Post_affiliate_pro",NAME$E),'Post Affiliate Pro',NAME$E),'Post affiliate pro',NAME$E),'post affiliate pro',NAME$E),"postaffiliatepro",NAME$E),"POSTAFFILIATEPRO",NAME$E);
|
1490
1481
|
|
1491
|
-
var DIR_NAME$D='
|
1482
|
+
var DIR_NAME$D='Posthog';var NAME$D='POSTHOG';var DISPLAY_NAME$D='PostHog';_defineProperty({},DISPLAY_NAME$D,DIR_NAME$D);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$D,NAME$D),"PostHog",NAME$D),"Posthog",NAME$D),"posthog",NAME$D),'Post Hog',NAME$D),'Post hog',NAME$D),'post hog',NAME$D);
|
1492
1483
|
|
1493
|
-
var DIR_NAME$C='
|
1484
|
+
var DIR_NAME$C='ProfitWell';var NAME$C='PROFITWELL';var DISPLAY_NAME$C='ProfitWell';_defineProperty({},DISPLAY_NAME$C,DIR_NAME$C);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$C,NAME$C),"ProfitWell",NAME$C),"profitwell",NAME$C),"Profitwell",NAME$C),'Profit Well',NAME$C),'profit well',NAME$C),'Profit well',NAME$C);
|
1494
1485
|
|
1495
|
-
var DIR_NAME$B='
|
1486
|
+
var DIR_NAME$B='Qualtrics';var NAME$B='QUALTRICS';var DISPLAY_NAME$B='Qualtrics';_defineProperty({},DISPLAY_NAME$B,DIR_NAME$B);_defineProperty(_defineProperty(_defineProperty({},NAME$B,NAME$B),"Qualtrics",NAME$B),"qualtrics",NAME$B);
|
1496
1487
|
|
1497
|
-
var DIR_NAME$A='
|
1488
|
+
var DIR_NAME$A='QuantumMetric';var NAME$A='QUANTUMMETRIC';var DISPLAY_NAME$A='Quantum Metric';_defineProperty({},DISPLAY_NAME$A,DIR_NAME$A);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$A,NAME$A),'Quantum Metric',NAME$A),'quantum Metric',NAME$A),'quantum metric',NAME$A),"QuantumMetric",NAME$A),"quantumMetric",NAME$A),"quantummetric",NAME$A),"Quantum_Metric",NAME$A);
|
1498
1489
|
|
1499
|
-
var DIR_NAME$z='
|
1490
|
+
var DIR_NAME$z='RedditPixel';var NAME$z='REDDIT_PIXEL';var DISPLAY_NAME$z='Reddit Pixel';_defineProperty({},DISPLAY_NAME$z,DIR_NAME$z);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$z,NAME$z),"Reddit_Pixel",NAME$z),"RedditPixel",NAME$z),"REDDITPIXEL",NAME$z),"redditpixel",NAME$z),'Reddit Pixel',NAME$z),'REDDIT PIXEL',NAME$z),'reddit pixel',NAME$z);
|
1500
1491
|
|
1501
|
-
var DIR_NAME$y='
|
1492
|
+
var DIR_NAME$y='Sentry';var NAME$y='SENTRY';var DISPLAY_NAME$y='Sentry';_defineProperty({},DISPLAY_NAME$y,DIR_NAME$y);_defineProperty(_defineProperty(_defineProperty({},NAME$y,NAME$y),"sentry",NAME$y),"Sentry",NAME$y);
|
1502
1493
|
|
1503
|
-
var DIR_NAME$x='
|
1494
|
+
var DIR_NAME$x='SnapPixel';var NAME$x='SNAP_PIXEL';var DISPLAY_NAME$x='Snap Pixel';_defineProperty({},DISPLAY_NAME$x,DIR_NAME$x);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$x,NAME$x),"Snap_Pixel",NAME$x),"SnapPixel",NAME$x),"SNAPPIXEL",NAME$x),"snappixel",NAME$x),'Snap Pixel',NAME$x),'SNAP PIXEL',NAME$x),'snap pixel',NAME$x);
|
1504
1495
|
|
1505
|
-
var DIR_NAME$w='
|
1496
|
+
var DIR_NAME$w='TVSquared';var NAME$w='TVSQUARED';var DISPLAY_NAME$w='TVSquared';_defineProperty({},DISPLAY_NAME$w,DIR_NAME$w);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$w,NAME$w),"TVSquared",NAME$w),"tvsquared",NAME$w),"tvSquared",NAME$w),"TvSquared",NAME$w),"Tvsquared",NAME$w),'TV Squared',NAME$w),'tv squared',NAME$w),'tv Squared',NAME$w);
|
1506
1497
|
|
1507
|
-
var DIR_NAME$v='
|
1498
|
+
var DIR_NAME$v='VWO';var NAME$v='VWO';var DISPLAY_NAME$v='VWO';_defineProperty({},DISPLAY_NAME$v,DIR_NAME$v);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$v,NAME$v),"VisualWebsiteOptimizer",NAME$v),"Visualwebsiteoptimizer",NAME$v),"visualwebsiteoptimizer",NAME$v),"vwo",NAME$v),'Visual Website Optimizer',NAME$v),'Visual website optimizer',NAME$v),'visual website optimizer',NAME$v);
|
1508
1499
|
|
1509
|
-
var DIR_NAME$u='
|
1500
|
+
var DIR_NAME$u='GA360';var NAME$u='GA360';var DISPLAY_NAME$u='Google Analytics 360';_defineProperty({},DISPLAY_NAME$u,DIR_NAME$u);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$u,NAME$u),'Google Analytics 360',NAME$u),'Google analytics 360',NAME$u),'google analytics 360',NAME$u),'Google Analytics360',NAME$u),'Google analytics360',NAME$u),'google analytics360',NAME$u),"GoogleAnalytics360",NAME$u),'GA 360',NAME$u);
|
1510
1501
|
|
1511
|
-
var DIR_NAME$t='
|
1502
|
+
var DIR_NAME$t='Adroll';var NAME$t='ADROLL';var DISPLAY_NAME$t='Adroll';_defineProperty({},DISPLAY_NAME$t,DIR_NAME$t);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$t,NAME$t),"Adroll",NAME$t),'Ad roll',NAME$t),'ad roll',NAME$t),"adroll",NAME$t);
|
1512
1503
|
|
1513
|
-
var DIR_NAME$s='
|
1504
|
+
var DIR_NAME$s='DCMFloodlight';var NAME$s='DCM_FLOODLIGHT';var DISPLAY_NAME$s='DCM Floodlight';_defineProperty({},DISPLAY_NAME$s,DIR_NAME$s);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$s,NAME$s),'DCM Floodlight',NAME$s),'dcm floodlight',NAME$s),'Dcm Floodlight',NAME$s),"DCMFloodlight",NAME$s),"dcmfloodlight",NAME$s),"DcmFloodlight",NAME$s),"dcm_floodlight",NAME$s),"DCM_Floodlight",NAME$s);
|
1514
1505
|
|
1515
|
-
var DIR_NAME$r='
|
1506
|
+
var DIR_NAME$r='Matomo';var NAME$r='MATOMO';var DISPLAY_NAME$r='Matomo';_defineProperty({},DISPLAY_NAME$r,DIR_NAME$r);_defineProperty(_defineProperty(_defineProperty({},NAME$r,NAME$r),"Matomo",NAME$r),"matomo",NAME$r);
|
1516
1507
|
|
1517
|
-
var DIR_NAME$q='
|
1508
|
+
var DIR_NAME$q='Vero';var NAME$q='VERO';var DISPLAY_NAME$q='Vero';_defineProperty({},DISPLAY_NAME$q,DIR_NAME$q);_defineProperty(_defineProperty(_defineProperty({},NAME$q,NAME$q),"Vero",NAME$q),"vero",NAME$q);
|
1518
1509
|
|
1519
|
-
var DIR_NAME$p='
|
1510
|
+
var DIR_NAME$p='Mouseflow';var NAME$p='MOUSEFLOW';var DISPLAY_NAME$p='Mouseflow';_defineProperty({},DISPLAY_NAME$p,DIR_NAME$p);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$p,NAME$p),"Mouseflow",NAME$p),"mouseflow",NAME$p),"mouseFlow",NAME$p),"MouseFlow",NAME$p),'Mouse flow',NAME$p),'mouse flow',NAME$p),'mouse Flow',NAME$p),'Mouse Flow',NAME$p);
|
1520
1511
|
|
1521
|
-
var DIR_NAME$o='
|
1512
|
+
var DIR_NAME$o='Rockerbox';var NAME$o='ROCKERBOX';var DISPLAY_NAME$o='Rockerbox';_defineProperty({},DISPLAY_NAME$o,DIR_NAME$o);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$o,NAME$o),"Rockerbox",NAME$o),"rockerbox",NAME$o),"RockerBox",NAME$o),'Rocker box',NAME$o),'rocker box',NAME$o),'Rocker Box',NAME$o);
|
1522
1513
|
|
1523
|
-
var DIR_NAME$n='
|
1514
|
+
var DIR_NAME$n='ConvertFlow';var NAME$n='CONVERTFLOW';var DISPLAY_NAME$n='ConvertFlow';_defineProperty({},DISPLAY_NAME$n,DIR_NAME$n);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$n,NAME$n),"Convertflow",NAME$n),"convertflow",NAME$n),"convertFlow",NAME$n),"ConvertFlow",NAME$n),'Convert flow',NAME$n),'convert flow',NAME$n),'convert Flow',NAME$n),'Convert Flow',NAME$n),'CONVERT FLOW',NAME$n);
|
1524
1515
|
|
1525
|
-
var DIR_NAME$m='
|
1516
|
+
var DIR_NAME$m='SnapEngage';var NAME$m='SNAPENGAGE';var DISPLAY_NAME$m='SnapEngage';_defineProperty({},DISPLAY_NAME$m,DIR_NAME$m);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$m,NAME$m),"SnapEngage",NAME$m),"Snap_Engage",NAME$m),"snapengage",NAME$m),'SNAP ENGAGE',NAME$m),'Snap Engage',NAME$m),'snap engage',NAME$m);
|
1526
1517
|
|
1527
|
-
var DIR_NAME$l='
|
1518
|
+
var DIR_NAME$l='LiveChat';var NAME$l='LIVECHAT';var DISPLAY_NAME$l='LiveChat';_defineProperty({},DISPLAY_NAME$l,DIR_NAME$l);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$l,NAME$l),"LiveChat",NAME$l),"Live_Chat",NAME$l),"livechat",NAME$l),'LIVE CHAT',NAME$l),'Live Chat',NAME$l),'live chat',NAME$l);
|
1528
1519
|
|
1529
|
-
var DIR_NAME$k='
|
1520
|
+
var DIR_NAME$k='Shynet';var NAME$k='SHYNET';var DISPLAY_NAME$k='Shynet';_defineProperty({},DISPLAY_NAME$k,DIR_NAME$k);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$k,NAME$k),"shynet",NAME$k),"ShyNet",NAME$k),"shyNet",NAME$k),"Shynet",NAME$k),'shy net',NAME$k),'Shy Net',NAME$k),'shy Net',NAME$k),'Shy net',NAME$k);
|
1530
1521
|
|
1531
|
-
var DIR_NAME$j='
|
1522
|
+
var DIR_NAME$j='Woopra';var NAME$j='WOOPRA';var DISPLAY_NAME$j='Woopra';_defineProperty({},DISPLAY_NAME$j,DIR_NAME$j);_defineProperty(_defineProperty(_defineProperty({},NAME$j,NAME$j),"Woopra",NAME$j),"woopra",NAME$j);
|
1532
1523
|
|
1533
|
-
var DIR_NAME$i='
|
1524
|
+
var DIR_NAME$i='RollBar';var NAME$i='ROLLBAR';var DISPLAY_NAME$i='RollBar';_defineProperty({},DISPLAY_NAME$i,DIR_NAME$i);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$i,NAME$i),"RollBar",NAME$i),"Roll_Bar",NAME$i),"rollbar",NAME$i),"Rollbar",NAME$i),'ROLL BAR',NAME$i),'Roll Bar',NAME$i),'roll bar',NAME$i);
|
1534
1525
|
|
1535
|
-
var DIR_NAME$h='
|
1526
|
+
var DIR_NAME$h='QuoraPixel';var NAME$h='QUORA_PIXEL';var DISPLAY_NAME$h='Quora Pixel';_defineProperty({},DISPLAY_NAME$h,DIR_NAME$h);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$h,NAME$h),'Quora Pixel',NAME$h),'Quora pixel',NAME$h),'QUORA PIXEL',NAME$h),"QuoraPixel",NAME$h),"Quorapixel",NAME$h),"QUORAPIXEL",NAME$h),"Quora_Pixel",NAME$h),"quora_pixel",NAME$h),"Quora",NAME$h);
|
1536
1527
|
|
1537
|
-
var DIR_NAME$g='
|
1528
|
+
var DIR_NAME$g='June';var NAME$g='JUNE';var DISPLAY_NAME$g='June';_defineProperty({},DISPLAY_NAME$g,DIR_NAME$g);_defineProperty(_defineProperty(_defineProperty({},NAME$g,NAME$g),"June",NAME$g),"june",NAME$g);
|
1538
1529
|
|
1539
|
-
var DIR_NAME$f='
|
1530
|
+
var DIR_NAME$f='Engage';var NAME$f='ENGAGE';var DISPLAY_NAME$f='Engage';_defineProperty({},DISPLAY_NAME$f,DIR_NAME$f);_defineProperty(_defineProperty(_defineProperty({},NAME$f,NAME$f),"Engage",NAME$f),"engage",NAME$f);
|
1540
1531
|
|
1541
|
-
var DIR_NAME$e='
|
1532
|
+
var DIR_NAME$e='Iterable';var NAME$e='ITERABLE';var DISPLAY_NAME$e='Iterable';_defineProperty({},DISPLAY_NAME$e,DIR_NAME$e);_defineProperty(_defineProperty(_defineProperty({},NAME$e,NAME$e),"Iterable",NAME$e),"iterable",NAME$e);
|
1542
1533
|
|
1543
|
-
var DIR_NAME$d='
|
1534
|
+
var DIR_NAME$d='YandexMetrica';var NAME$d='YANDEX_METRICA';var DISPLAY_NAME$d='Yandex.Metrica';_defineProperty({},DISPLAY_NAME$d,DIR_NAME$d);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$d,NAME$d),"Yandexmetrica",NAME$d),"yandexmetrica",NAME$d),"yandexMetrica",NAME$d),"YandexMetrica",NAME$d);
|
1544
1535
|
|
1545
|
-
var DIR_NAME$c='
|
1536
|
+
var DIR_NAME$c='Refiner';var NAME$c='REFINER';var DISPLAY_NAME$c='Refiner';_defineProperty({},DISPLAY_NAME$c,DIR_NAME$c);_defineProperty(_defineProperty(_defineProperty({},NAME$c,NAME$c),"Refiner",NAME$c),"refiner",NAME$c);
|
1546
1537
|
|
1547
|
-
var DIR_NAME$b='
|
1538
|
+
var DIR_NAME$b='Qualaroo';var NAME$b='QUALAROO';var DISPLAY_NAME$b='Qualaroo';_defineProperty({},DISPLAY_NAME$b,DIR_NAME$b);_defineProperty(_defineProperty(_defineProperty({},NAME$b,NAME$b),"Qualaroo",NAME$b),"qualaroo",NAME$b);
|
1548
1539
|
|
1549
|
-
var DIR_NAME$a='
|
1540
|
+
var DIR_NAME$a='Podsights';var NAME$a='PODSIGHTS';var DISPLAY_NAME$a='Podsights';_defineProperty({},DISPLAY_NAME$a,DIR_NAME$a);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$a,NAME$a),"Podsights",NAME$a),"PodSights",NAME$a),'pod Sights',NAME$a),'Pod Sights',NAME$a),'pod sights',NAME$a),'POD SIGHTS',NAME$a),'Pod sights',NAME$a);
|
1550
1541
|
|
1551
|
-
var DIR_NAME$9='
|
1542
|
+
var DIR_NAME$9='Axeptio';var NAME$9='AXEPTIO';var DISPLAY_NAME$9='Axeptio';_defineProperty({},DISPLAY_NAME$9,DIR_NAME$9);_defineProperty(_defineProperty(_defineProperty({},NAME$9,NAME$9),"Axeptio",NAME$9),"axeptio",NAME$9);
|
1552
1543
|
|
1553
|
-
var DIR_NAME$8='
|
1544
|
+
var DIR_NAME$8='Satismeter';var NAME$8='SATISMETER';var DISPLAY_NAME$8='Satismeter';_defineProperty({},DISPLAY_NAME$8,DIR_NAME$8);_defineProperty(_defineProperty(_defineProperty({},NAME$8,NAME$8),"Satismeter",NAME$8),"SatisMeter",NAME$8);
|
1554
1545
|
|
1555
|
-
var DIR_NAME$7='
|
1546
|
+
var DIR_NAME$7='MicrosoftClarity';var NAME$7='MICROSOFT_CLARITY';var DISPLAY_NAME$7='Microsoft Clarity';_defineProperty({},DISPLAY_NAME$7,DIR_NAME$7);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$7,NAME$7),'Microsoft Clarity',NAME$7),'Microsoft clarity',NAME$7),'microsoft clarity',NAME$7),"Microsoft_clarity",NAME$7),"MicrosoftClarity",NAME$7),"MICROSOFTCLARITY",NAME$7),"microsoftclarity",NAME$7),"microsoftClarity",NAME$7);
|
1556
1547
|
|
1557
|
-
var DIR_NAME$6='
|
1548
|
+
var DIR_NAME$6='Sendinblue';var NAME$6='SENDINBLUE';var DISPLAY_NAME$6='Sendinblue';_defineProperty({},DISPLAY_NAME$6,DIR_NAME$6);_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$6,NAME$6),"Sendinblue",NAME$6),"sendinblue",NAME$6),"SendinBlue",NAME$6);
|
1558
1549
|
|
1559
|
-
var DIR_NAME$5='
|
1550
|
+
var DIR_NAME$5='Olark';var NAME$5='OLARK';var DISPLAY_NAME$5='Olark';_defineProperty({},DISPLAY_NAME$5,DIR_NAME$5);_defineProperty(_defineProperty(_defineProperty({},NAME$5,NAME$5),"Olark",NAME$5),"olark",NAME$5);
|
1560
1551
|
|
1561
|
-
var DIR_NAME$4='
|
1552
|
+
var DIR_NAME$4='Lemnisk';var NAME$4='LEMNISK';var DISPLAY_NAME$4='Lemnisk';_defineProperty({},DISPLAY_NAME$4,DIR_NAME$4);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$4,NAME$4),"LEMNISK_MARKETING_AUTOMATION",NAME$4),'Lemnisk Marketing Automation',NAME$4),"LemniskMarketingAutomation",NAME$4),"lemniskmarketingautomation",NAME$4),"lemniskMarketingAutomation",NAME$4),"lemnisk",NAME$4),"Lemnisk",NAME$4);
|
1562
1553
|
|
1563
|
-
var DIR_NAME$3='
|
1554
|
+
var DIR_NAME$3='TiktokAds';var NAME$3='TIKTOK_ADS';var DISPLAY_NAME$3='TikTok Ads';_defineProperty({},DISPLAY_NAME$3,DIR_NAME$3);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$3,NAME$3),"TiktokAds",NAME$3),'Tiktok ads',NAME$3),'Tiktok Ads',NAME$3),'Tik Tok Ads',NAME$3),'tik tok ads',NAME$3),"tiktokads",NAME$3);
|
1564
1555
|
|
1565
|
-
var DIR_NAME$2='
|
1556
|
+
var DIR_NAME$2='ActiveCampaign';var NAME$2='ACTIVE_CAMPAIGN';var DISPLAY_NAME$2='Active Campaign';_defineProperty({},DISPLAY_NAME$2,DIR_NAME$2);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({ActiveCampaign:NAME$2,'Active Campaign':NAME$2,'ACTIVE CAMPAIGN':NAME$2},NAME$2,NAME$2),"activecampaign",NAME$2),'active campaign',NAME$2),'Active campaign',NAME$2),'active Campaign',NAME$2),"active_campaign",NAME$2);
|
1566
1557
|
|
1567
|
-
var DIR_NAME$1='
|
1558
|
+
var DIR_NAME$1='Sprig';var NAME$1='SPRIG';var DISPLAY_NAME$1='Sprig';_defineProperty({},DISPLAY_NAME$1,DIR_NAME$1);_defineProperty(_defineProperty(_defineProperty({},NAME$1,NAME$1),"Sprig",NAME$1),"sprig",NAME$1);
|
1568
1559
|
|
1569
|
-
var DIR_NAME='
|
1560
|
+
var DIR_NAME='SpotifyPixel';var NAME='SPOTIFYPIXEL';var DISPLAY_NAME='Spotify Pixel';_defineProperty({},DISPLAY_NAME,DIR_NAME);_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME,NAME),'Spotify Pixel',NAME),'spotify pixel',NAME),"SPOTIFY_PIXEL",NAME);
|
1570
1561
|
|
1571
1562
|
var _destDisplayNamesToFi;// map of the destination display names to the destination directory names
|
1572
|
-
var destDisplayNamesToFileNamesMap=(_destDisplayNamesToFi={},_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_destDisplayNamesToFi,DISPLAY_NAME$
|
1563
|
+
var destDisplayNamesToFileNamesMap=(_destDisplayNamesToFi={},_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_destDisplayNamesToFi,DISPLAY_NAME$S,DIR_NAME$S),DISPLAY_NAME$Z,DIR_NAME$Z),DISPLAY_NAME$T,DIR_NAME$T),DISPLAY_NAME$X,DIR_NAME$X),DISPLAY_NAME$v,DIR_NAME$v),DISPLAY_NAME$V,DIR_NAME$V),DISPLAY_NAME$17,DIR_NAME$17),DISPLAY_NAME$R,DIR_NAME$R),DISPLAY_NAME$Q,DIR_NAME$Q),DISPLAY_NAME$P,DIR_NAME$P),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_destDisplayNamesToFi,DISPLAY_NAME$11,DIR_NAME$11),DISPLAY_NAME$15,DIR_NAME$15),DISPLAY_NAME$13,DIR_NAME$13),DISPLAY_NAME$$,DIR_NAME$$),DISPLAY_NAME$L,DIR_NAME$L),DISPLAY_NAME$H,DIR_NAME$H),DISPLAY_NAME$16,DIR_NAME$16),DISPLAY_NAME$_,DIR_NAME$_),DISPLAY_NAME$w,DIR_NAME$w),DISPLAY_NAME$Y,DIR_NAME$Y),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_destDisplayNamesToFi,DISPLAY_NAME$I,DIR_NAME$I),DISPLAY_NAME$1a,DIR_NAME$1a),DISPLAY_NAME$G,DIR_NAME$G),DISPLAY_NAME$K,DIR_NAME$K),DISPLAY_NAME$19,DIR_NAME$19),DISPLAY_NAME$D,DIR_NAME$D),DISPLAY_NAME$O,DIR_NAME$O),DISPLAY_NAME$14,DIR_NAME$14),DISPLAY_NAME$18,DIR_NAME$18),DISPLAY_NAME$F,DIR_NAME$F),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_destDisplayNamesToFi,DISPLAY_NAME$1b,DIR_NAME$1b),DISPLAY_NAME$M,DIR_NAME$M),DISPLAY_NAME$z,DIR_NAME$z),DISPLAY_NAME$10,DIR_NAME$10),DISPLAY_NAME$U,DIR_NAME$U),DISPLAY_NAME$12,DIR_NAME$12),DISPLAY_NAME$J,DIR_NAME$J),DISPLAY_NAME$B,DIR_NAME$B),DISPLAY_NAME$C,DIR_NAME$C),DISPLAY_NAME$y,DIR_NAME$y),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_destDisplayNamesToFi,DISPLAY_NAME$A,DIR_NAME$A),DISPLAY_NAME$x,DIR_NAME$x),DISPLAY_NAME$E,DIR_NAME$E),DISPLAY_NAME$W,DIR_NAME$W),DISPLAY_NAME$N,DIR_NAME$N),DISPLAY_NAME$u,DIR_NAME$u),DISPLAY_NAME$t,DIR_NAME$t),DISPLAY_NAME$s,DIR_NAME$s),DISPLAY_NAME$r,DIR_NAME$r),DISPLAY_NAME$q,DIR_NAME$q),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_destDisplayNamesToFi,DISPLAY_NAME$p,DIR_NAME$p),DISPLAY_NAME$o,DIR_NAME$o),DISPLAY_NAME$n,DIR_NAME$n),DISPLAY_NAME$m,DIR_NAME$m),DISPLAY_NAME$l,DIR_NAME$l),DISPLAY_NAME$k,DIR_NAME$k),DISPLAY_NAME$j,DIR_NAME$j),DISPLAY_NAME$i,DIR_NAME$i),DISPLAY_NAME$h,DIR_NAME$h),DISPLAY_NAME$g,DIR_NAME$g),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_destDisplayNamesToFi,DISPLAY_NAME$f,DIR_NAME$f),DISPLAY_NAME$e,DIR_NAME$e),DISPLAY_NAME$d,DIR_NAME$d),DISPLAY_NAME$c,DIR_NAME$c),DISPLAY_NAME$b,DIR_NAME$b),DISPLAY_NAME$a,DIR_NAME$a),DISPLAY_NAME$9,DIR_NAME$9),DISPLAY_NAME$8,DIR_NAME$8),DISPLAY_NAME$7,DIR_NAME$7),DISPLAY_NAME$6,DIR_NAME$6),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_destDisplayNamesToFi,DISPLAY_NAME$5,DIR_NAME$5),DISPLAY_NAME$4,DIR_NAME$4),DISPLAY_NAME$3,DIR_NAME$3),DISPLAY_NAME$2,DIR_NAME$2),DISPLAY_NAME$1,DIR_NAME$1),DISPLAY_NAME,DIR_NAME));
|
1573
1564
|
|
1574
1565
|
var DEFAULT_INTEGRATIONS_CONFIG={All:true};
|
1575
1566
|
|
@@ -1592,19 +1583,19 @@ var DESTINATION_NOT_SUPPORTED_ERROR=function DESTINATION_NOT_SUPPORTED_ERROR(des
|
|
1592
1583
|
* @param sdkTypeName The name of the destination SDK type
|
1593
1584
|
* @param logger Logger instance
|
1594
1585
|
* @returns true if the destination SDK code is evaluated, false otherwise
|
1595
|
-
*/var isDestinationSDKMounted=function isDestinationSDKMounted(destSDKIdentifier,sdkTypeName,logger){return Boolean(globalThis[destSDKIdentifier]&&globalThis[destSDKIdentifier][sdkTypeName]&&globalThis[destSDKIdentifier][sdkTypeName].prototype&&typeof globalThis[destSDKIdentifier][sdkTypeName].prototype.constructor!=='undefined');};var createDestinationInstance=function createDestinationInstance(destSDKIdentifier,sdkTypeName,dest,state){var _state$consents$postC,_state$consents$postC2;var rAnalytics=globalThis.rudderanalytics;var analytics=rAnalytics.getAnalyticsInstance(state.lifecycle.writeKey.value);return new globalThis[destSDKIdentifier][sdkTypeName](clone
|
1586
|
+
*/var isDestinationSDKMounted=function isDestinationSDKMounted(destSDKIdentifier,sdkTypeName,logger){return Boolean(globalThis[destSDKIdentifier]&&globalThis[destSDKIdentifier][sdkTypeName]&&globalThis[destSDKIdentifier][sdkTypeName].prototype&&typeof globalThis[destSDKIdentifier][sdkTypeName].prototype.constructor!=='undefined');};var createDestinationInstance=function createDestinationInstance(destSDKIdentifier,sdkTypeName,dest,state){var _state$consents$postC,_state$consents$postC2;var rAnalytics=globalThis.rudderanalytics;var analytics=rAnalytics.getAnalyticsInstance(state.lifecycle.writeKey.value);return new globalThis[destSDKIdentifier][sdkTypeName](clone(dest.config),{loadIntegration:state.nativeDestinations.loadIntegration.value,logLevel:state.lifecycle.logLevel.value,loadOnlyIntegrations:(_state$consents$postC=(_state$consents$postC2=state.consents.postConsent.value)===null||_state$consents$postC2===void 0?void 0:_state$consents$postC2.integrations)!==null&&_state$consents$postC!==void 0?_state$consents$postC:state.nativeDestinations.loadOnlyIntegrations.value,page:function page(category,name,properties,options,callback){return analytics.page(pageArgumentsToCallOptions(category,name,properties,options,callback));},track:function track(event,properties,options,callback){return analytics.track(trackArgumentsToCallOptions(event,properties,options,callback));},identify:function identify(userId,traits,options,callback){return analytics.identify(identifyArgumentsToCallOptions(userId,traits,options,callback));},alias:function alias(to,from,options,callback){return analytics.alias(aliasArgumentsToCallOptions(to,from,options,callback));},group:function group(groupId,traits,options,callback){return analytics.group(groupArgumentsToCallOptions(groupId,traits,options,callback));},getAnonymousId:function getAnonymousId(){return analytics.getAnonymousId();},getUserId:function getUserId(){return analytics.getUserId();},getUserTraits:function getUserTraits(){return analytics.getUserTraits();},getGroupId:function getGroupId(){return analytics.getGroupId();},getGroupTraits:function getGroupTraits(){return analytics.getGroupTraits();},getSessionId:function getSessionId(){return analytics.getSessionId();}},{shouldApplyDeviceModeTransformation:dest.shouldApplyDeviceModeTransformation,propagateEventsUntransformedOnError:dest.propagateEventsUntransformedOnError,destinationId:dest.id});};var isDestinationReady=function isDestinationReady(dest){return new Promise(function(resolve,reject){var instance=dest.instance;var handleNumber;var checkReady=function checkReady(){if(instance.isLoaded()&&(!instance.isReady||instance.isReady())){resolve(true);}else {handleNumber=globalThis.requestAnimationFrame(checkReady);}};checkReady();setTimeout(function(){globalThis.cancelAnimationFrame(handleNumber);reject(new Error(DESTINATION_READY_TIMEOUT_ERROR(READY_CHECK_TIMEOUT_MS,dest.userFriendlyId)));},READY_CHECK_TIMEOUT_MS);});};/**
|
1596
1587
|
* Extracts the integration config, if any, from the given destination
|
1597
1588
|
* and merges it with the current integrations config
|
1598
1589
|
* @param dest Destination object
|
1599
1590
|
* @param curDestIntgConfig Current destinations integration config
|
1600
1591
|
* @param logger Logger object
|
1601
1592
|
* @returns Combined destinations integrations config
|
1602
|
-
*/var getCumulativeIntegrationsConfig=function getCumulativeIntegrationsConfig(dest,curDestIntgConfig,errorHandler){var _dest$instance;var integrationsConfig=curDestIntgConfig;if(isFunction((_dest$instance=dest.instance)===null||_dest$instance===void 0?void 0:_dest$instance.getDataForIntegrationsObject)){try{var _dest$instance2;integrationsConfig=mergeDeepRight(curDestIntgConfig,(_dest$instance2=dest.instance)===null||_dest$instance2===void 0?void 0:_dest$instance2.getDataForIntegrationsObject());}catch(err){errorHandler===null||errorHandler===void 0||errorHandler.onError(err,DEVICE_MODE_DESTINATIONS_PLUGIN,DESTINATION_INTEGRATIONS_DATA_ERROR(dest.userFriendlyId));}}return integrationsConfig;};var initializeDestination=function initializeDestination(dest,state,destSDKIdentifier,sdkTypeName,errorHandler,logger){try{var initializedDestination=clone
|
1593
|
+
*/var getCumulativeIntegrationsConfig=function getCumulativeIntegrationsConfig(dest,curDestIntgConfig,errorHandler){var _dest$instance;var integrationsConfig=curDestIntgConfig;if(isFunction((_dest$instance=dest.instance)===null||_dest$instance===void 0?void 0:_dest$instance.getDataForIntegrationsObject)){try{var _dest$instance2;integrationsConfig=mergeDeepRight(curDestIntgConfig,(_dest$instance2=dest.instance)===null||_dest$instance2===void 0?void 0:_dest$instance2.getDataForIntegrationsObject());}catch(err){errorHandler===null||errorHandler===void 0||errorHandler.onError(err,DEVICE_MODE_DESTINATIONS_PLUGIN,DESTINATION_INTEGRATIONS_DATA_ERROR(dest.userFriendlyId));}}return integrationsConfig;};var initializeDestination=function initializeDestination(dest,state,destSDKIdentifier,sdkTypeName,errorHandler,logger){try{var initializedDestination=clone(dest);var destInstance=createDestinationInstance(destSDKIdentifier,sdkTypeName,dest,state);initializedDestination.instance=destInstance;destInstance.init();isDestinationReady(initializedDestination).then(function(){// Collect the integrations data for the hybrid mode destinations
|
1603
1594
|
if(isHybridModeDestination(initializedDestination)){state.nativeDestinations.integrationsConfig.value=getCumulativeIntegrationsConfig(initializedDestination,state.nativeDestinations.integrationsConfig.value,errorHandler);}state.nativeDestinations.initializedDestinations.value=[].concat(_toConsumableArray(state.nativeDestinations.initializedDestinations.value),[initializedDestination]);}).catch(function(err){state.nativeDestinations.failedDestinations.value=[].concat(_toConsumableArray(state.nativeDestinations.failedDestinations.value),[dest]);// The error message is already formatted in the isDestinationReady function
|
1604
1595
|
logger===null||logger===void 0||logger.error(err);});}catch(err){state.nativeDestinations.failedDestinations.value=[].concat(_toConsumableArray(state.nativeDestinations.failedDestinations.value),[dest]);errorHandler===null||errorHandler===void 0||errorHandler.onError(err,DEVICE_MODE_DESTINATIONS_PLUGIN,DESTINATION_INIT_ERROR(dest.userFriendlyId));}};
|
1605
1596
|
|
1606
1597
|
var pluginName$b='DeviceModeDestinations';var DeviceModeDestinations=function DeviceModeDestinations(){return {name:pluginName$b,initialize:function initialize(state){state.plugins.loadedPlugins.value=[].concat(_toConsumableArray(state.plugins.loadedPlugins.value),[pluginName$b]);},nativeDestinations:{setActiveDestinations:function setActiveDestinations(state,pluginsManager,errorHandler,logger){var _clone,_state$consents$postC,_state$consents$postC2;// Normalize the integration options from the load API call
|
1607
|
-
state.nativeDestinations.loadOnlyIntegrations.value=(_clone=clone
|
1598
|
+
state.nativeDestinations.loadOnlyIntegrations.value=(_clone=clone(state.loadOptions.value.integrations))!==null&&_clone!==void 0?_clone:DEFAULT_INTEGRATIONS_CONFIG;state.nativeDestinations.loadIntegration.value=state.loadOptions.value.loadIntegration;// Filter destination that doesn't have mapping config-->Integration names
|
1608
1599
|
var configSupportedDestinations=state.nativeDestinations.configuredDestinations.value.filter(function(configDest){if(destDisplayNamesToFileNamesMap[configDest.displayName]){return true;}errorHandler===null||errorHandler===void 0||errorHandler.onError(new Error(DESTINATION_NOT_SUPPORTED_ERROR(configDest.userFriendlyId)),DEVICE_MODE_DESTINATIONS_PLUGIN);return false;});// Filter destinations that are disabled through load or consent API options
|
1609
1600
|
var destinationsToLoad=filterDestinations((_state$consents$postC=(_state$consents$postC2=state.consents.postConsent.value)===null||_state$consents$postC2===void 0?void 0:_state$consents$postC2.integrations)!==null&&_state$consents$postC!==void 0?_state$consents$postC:state.nativeDestinations.loadOnlyIntegrations.value,configSupportedDestinations);var consentedDestinations=destinationsToLoad.filter(function(dest){var _pluginsManager$invok;return(// if consent manager is not configured, then default to load the destination
|
1610
1601
|
(_pluginsManager$invok=pluginsManager.invokeSingle("consentManager.isDestinationConsented",state,dest.config,errorHandler,logger))!==null&&_pluginsManager$invok!==void 0?_pluginsManager$invok:true);});state.nativeDestinations.activeDestinations.value=consentedDestinations;},load:function load(state,externalSrcLoader,errorHandler,logger,externalScriptOnLoad){var integrationsCDNPath=state.lifecycle.integrationsCDNPath.value;var activeDestinations=state.nativeDestinations.activeDestinations.value;activeDestinations.forEach(function(dest){var sdkName=destDisplayNamesToFileNamesMap[dest.displayName];var destSDKIdentifier="".concat(sdkName,"_RS");// this is the name of the object loaded on the window
|
@@ -1787,7 +1778,7 @@ var pluginName$5='NativeDestinationQueue';var NativeDestinationQueue=function Na
|
|
1787
1778
|
* @returns IQueue instance
|
1788
1779
|
*/init:function init(state,pluginsManager,storeManager,dmtQueue,errorHandler,logger){var finalQOpts=getNormalizedQueueOptions$1(state.loadOptions.value.destinationsQueueOptions);var writeKey=state.lifecycle.writeKey.value;var eventsQueue=new RetryQueue(// adding write key to the queue name to avoid conflicts
|
1789
1780
|
"".concat(QUEUE_NAME$1,"_").concat(writeKey),finalQOpts,function(rudderEvent,done){var destinationsToSend=filterDestinations(rudderEvent.integrations,state.nativeDestinations.initializedDestinations.value);// list of destinations which are enable for DMT
|
1790
|
-
var destWithTransformationEnabled=[];var clonedRudderEvent=clone
|
1781
|
+
var destWithTransformationEnabled=[];var clonedRudderEvent=clone(rudderEvent);destinationsToSend.forEach(function(dest){try{var sendEvent=!isEventDenyListed(clonedRudderEvent.type,clonedRudderEvent.event,dest);if(!sendEvent){logger===null||logger===void 0||logger.warn(DESTINATION_EVENT_FILTERING_WARNING(NATIVE_DESTINATION_QUEUE_PLUGIN,clonedRudderEvent.event,dest.userFriendlyId));return;}if(dest.shouldApplyDeviceModeTransformation){destWithTransformationEnabled.push(dest);}else {sendEventToDestination(clonedRudderEvent,dest,errorHandler,logger);}}catch(e){errorHandler===null||errorHandler===void 0||errorHandler.onError(e,NATIVE_DESTINATION_QUEUE_PLUGIN);}});if(destWithTransformationEnabled.length>0){pluginsManager.invokeSingle('transformEvent.enqueue',state,dmtQueue,clonedRudderEvent,destWithTransformationEnabled,errorHandler,logger);}// Mark success always
|
1791
1782
|
done(null);},storeManager,MEMORY_STORAGE);// TODO: This seems to not work as expected. Need to investigate
|
1792
1783
|
// effect(() => {
|
1793
1784
|
// if (state.nativeDestinations.clientDestinationsReady.value === true) {
|
@@ -1875,7 +1866,7 @@ randomWordArray=function randomWordArray(nBytes){var words=[];var r=function r(m
|
|
1875
1866
|
*
|
1876
1867
|
* @property {Array} words The array of 32-bit words.
|
1877
1868
|
* @property {number} sigBytes The number of significant bytes in this word array.
|
1878
|
-
*/var WordArray=/*#__PURE__*/function(_Base){_inherits(WordArray,_Base)
|
1869
|
+
*/var WordArray=/*#__PURE__*/function(_Base){_inherits(WordArray,_Base);/**
|
1879
1870
|
* Initializes a newly created word array.
|
1880
1871
|
*
|
1881
1872
|
* @param {Array} words (Optional) An array of 32-bit words.
|
@@ -1886,7 +1877,7 @@ randomWordArray=function randomWordArray(nBytes){var words=[];var r=function r(m
|
|
1886
1877
|
* var wordArray = CryptoJS.lib.WordArray.create();
|
1887
1878
|
* var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);
|
1888
1879
|
* var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);
|
1889
|
-
*/function WordArray(){var _this;var words=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var sigBytes=arguments.length>1&&arguments[1]!==undefined?arguments[1]:words.length*4;_classCallCheck(this,WordArray);_this=
|
1880
|
+
*/function WordArray(){var _this;var words=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var sigBytes=arguments.length>1&&arguments[1]!==undefined?arguments[1]:words.length*4;_classCallCheck(this,WordArray);_this=_callSuper(this,WordArray);var typedArray=words;// Convert buffers to uint8
|
1890
1881
|
if(typedArray instanceof ArrayBuffer){typedArray=new Uint8Array(typedArray);}// Convert other array views to uint8
|
1891
1882
|
if(typedArray instanceof Int8Array||typedArray instanceof Uint8ClampedArray||typedArray instanceof Int16Array||typedArray instanceof Uint16Array||typedArray instanceof Int32Array||typedArray instanceof Uint32Array||typedArray instanceof Float32Array||typedArray instanceof Float64Array){typedArray=new Uint8Array(typedArray.buffer,typedArray.byteOffset,typedArray.byteLength);}// Handle Uint8Array
|
1892
1883
|
if(typedArray instanceof Uint8Array){// Shortcut
|
@@ -2043,7 +2034,7 @@ var words=[];for(var i=0;i<latin1StrLength;i+=1){words[i>>>2]|=(latin1Str.charCo
|
|
2043
2034
|
* @property {number} _minBufferSize
|
2044
2035
|
*
|
2045
2036
|
* The number of blocks that should be kept unprocessed in the buffer. Default: 0
|
2046
|
-
*/var BufferedBlockAlgorithm=/*#__PURE__*/function(_Base2){_inherits(BufferedBlockAlgorithm,_Base2);
|
2037
|
+
*/var BufferedBlockAlgorithm=/*#__PURE__*/function(_Base2){_inherits(BufferedBlockAlgorithm,_Base2);function BufferedBlockAlgorithm(){var _this2;_classCallCheck(this,BufferedBlockAlgorithm);_this2=_callSuper(this,BufferedBlockAlgorithm);_this2._minBufferSize=0;return _this2;}/**
|
2047
2038
|
* Resets this block algorithm's data buffer to its initial state.
|
2048
2039
|
*
|
2049
2040
|
* @example
|
@@ -2101,7 +2092,7 @@ return new WordArray(processedWords,nBytesReady);}/**
|
|
2101
2092
|
* @property {number} blockSize
|
2102
2093
|
*
|
2103
2094
|
* The number of 32-bit words this hasher operates on. Default: 16 (512 bits)
|
2104
|
-
*/var Hasher=/*#__PURE__*/function(_BufferedBlockAlgorit){_inherits(Hasher,_BufferedBlockAlgorit);
|
2095
|
+
*/var Hasher=/*#__PURE__*/function(_BufferedBlockAlgorit){_inherits(Hasher,_BufferedBlockAlgorit);function Hasher(cfg){var _this3;_classCallCheck(this,Hasher);_this3=_callSuper(this,Hasher);_this3.blockSize=512/32;/**
|
2105
2096
|
* Configuration options.
|
2106
2097
|
*/_this3.cfg=Object.assign(new Base(),cfg);// Set initial values
|
2107
2098
|
_this3.reset();return _this3;}/**
|
@@ -2167,7 +2158,7 @@ var hash=this._doFinalize();return hash;}}],[{key:"_createHelper",value:function
|
|
2167
2158
|
* var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);
|
2168
2159
|
*/},{key:"_createHmacHelper",value:function _createHmacHelper(SubHasher){return function(message,key){return new HMAC(SubHasher,key).finalize(message);};}}]);return Hasher;}(BufferedBlockAlgorithm);/**
|
2169
2160
|
* HMAC algorithm.
|
2170
|
-
*/var HMAC=/*#__PURE__*/function(_Base3){_inherits(HMAC,_Base3)
|
2161
|
+
*/var HMAC=/*#__PURE__*/function(_Base3){_inherits(HMAC,_Base3);/**
|
2171
2162
|
* Initializes a newly created HMAC.
|
2172
2163
|
*
|
2173
2164
|
* @param {Hasher} SubHasher The hash algorithm to use.
|
@@ -2176,7 +2167,7 @@ var hash=this._doFinalize();return hash;}}],[{key:"_createHelper",value:function
|
|
2176
2167
|
* @example
|
2177
2168
|
*
|
2178
2169
|
* var hmacHasher = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, key);
|
2179
|
-
*/function HMAC(SubHasher,key){var _this4;_classCallCheck(this,HMAC);_this4=
|
2170
|
+
*/function HMAC(SubHasher,key){var _this4;_classCallCheck(this,HMAC);_this4=_callSuper(this,HMAC);var hasher=new SubHasher();_this4._hasher=hasher;// Convert string to WordArray, else assume WordArray already
|
2180
2171
|
var _key=key;if(typeof _key==='string'){_key=Utf8.parse(_key);}// Shortcuts
|
2181
2172
|
var hasherBlockSize=hasher.blockSize;var hasherBlockSizeBytes=hasherBlockSize*4;// Allow arbitrary length keys
|
2182
2173
|
if(_key.sigBytes>hasherBlockSizeBytes){_key=hasher.finalize(key);}// Clamp excess bits
|
@@ -2259,7 +2250,7 @@ return parseLoop(base64Str,base64StrLength,reverseMap);},_map:'ABCDEFGHIJKLMNOPQ
|
|
2259
2250
|
var T=[];// Compute constants
|
2260
2251
|
for(var i$1=0;i$1<64;i$1+=1){T[i$1]=Math.abs(Math.sin(i$1+1))*0x100000000|0;}var FF=function FF(a,b,c,d,x,s,t){var n=a+(b&c|~b&d)+x+t;return (n<<s|n>>>32-s)+b;};var GG=function GG(a,b,c,d,x,s,t){var n=a+(b&d|c&~d)+x+t;return (n<<s|n>>>32-s)+b;};var HH=function HH(a,b,c,d,x,s,t){var n=a+(b^c^d)+x+t;return (n<<s|n>>>32-s)+b;};var II=function II(a,b,c,d,x,s,t){var n=a+(c^(b|~d))+x+t;return (n<<s|n>>>32-s)+b;};/**
|
2261
2252
|
* MD5 hash algorithm.
|
2262
|
-
*/var MD5Algo=/*#__PURE__*/function(_Hasher){_inherits(MD5Algo,_Hasher);
|
2253
|
+
*/var MD5Algo=/*#__PURE__*/function(_Hasher){_inherits(MD5Algo,_Hasher);function MD5Algo(){_classCallCheck(this,MD5Algo);return _callSuper(this,MD5Algo,arguments);}_createClass(MD5Algo,[{key:"_doReset",value:function _doReset(){this._hash=new WordArray([0x67452301,0xefcdab89,0x98badcfe,0x10325476]);}},{key:"_doProcessBlock",value:function _doProcessBlock(M,offset){var _M=M;// Swap endian
|
2263
2254
|
for(var _i=0;_i<16;_i+=1){// Shortcuts
|
2264
2255
|
var offset_i=offset+_i;var M_offset_i=M[offset_i];_M[offset_i]=(M_offset_i<<8|M_offset_i>>>24)&0x00ff00ff|(M_offset_i<<24|M_offset_i>>>8)&0xff00ff00;}// Shortcuts
|
2265
2256
|
var H=this._hash.words;var M_offset_0=_M[offset+0];var M_offset_1=_M[offset+1];var M_offset_2=_M[offset+2];var M_offset_3=_M[offset+3];var M_offset_4=_M[offset+4];var M_offset_5=_M[offset+5];var M_offset_6=_M[offset+6];var M_offset_7=_M[offset+7];var M_offset_8=_M[offset+8];var M_offset_9=_M[offset+9];var M_offset_10=_M[offset+10];var M_offset_11=_M[offset+11];var M_offset_12=_M[offset+12];var M_offset_13=_M[offset+13];var M_offset_14=_M[offset+14];var M_offset_15=_M[offset+15];// Working varialbes
|
@@ -2303,7 +2294,7 @@ return hash;}},{key:"clone",value:function clone(){var clone=_get(_getPrototypeO
|
|
2303
2294
|
/**
|
2304
2295
|
* This key derivation function is meant to conform with EVP_BytesToKey.
|
2305
2296
|
* www.openssl.org/docs/crypto/EVP_BytesToKey.html
|
2306
|
-
*/var EvpKDFAlgo=/*#__PURE__*/function(_Base){_inherits(EvpKDFAlgo,_Base)
|
2297
|
+
*/var EvpKDFAlgo=/*#__PURE__*/function(_Base){_inherits(EvpKDFAlgo,_Base);/**
|
2307
2298
|
* Initializes a newly created key derivation function.
|
2308
2299
|
*
|
2309
2300
|
* @param {Object} cfg (Optional) The configuration options to use for the derivation.
|
@@ -2313,7 +2304,7 @@ return hash;}},{key:"clone",value:function clone(){var clone=_get(_getPrototypeO
|
|
2313
2304
|
* const kdf = CryptoJS.algo.EvpKDF.create();
|
2314
2305
|
* const kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8 });
|
2315
2306
|
* const kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8, iterations: 1000 });
|
2316
|
-
*/function EvpKDFAlgo(cfg){var _this;_classCallCheck(this,EvpKDFAlgo);_this=
|
2307
|
+
*/function EvpKDFAlgo(cfg){var _this;_classCallCheck(this,EvpKDFAlgo);_this=_callSuper(this,EvpKDFAlgo);/**
|
2317
2308
|
* Configuration options.
|
2318
2309
|
*
|
2319
2310
|
* @property {number} keySize The key size in words to generate. Default: 4 (128 bits)
|
@@ -2345,7 +2336,7 @@ var ObjectAssign=typeof Object.assign!=="function"?function(target){if(target==n
|
|
2345
2336
|
* @property {number} ivSize This cipher's IV size. Default: 4 (128 bits)
|
2346
2337
|
* @property {number} _ENC_XFORM_MODE A constant representing encryption mode.
|
2347
2338
|
* @property {number} _DEC_XFORM_MODE A constant representing decryption mode.
|
2348
|
-
*/var Cipher=/*#__PURE__*/function(_BufferedBlockAlgorit){_inherits(Cipher,_BufferedBlockAlgorit)
|
2339
|
+
*/var Cipher=/*#__PURE__*/function(_BufferedBlockAlgorit){_inherits(Cipher,_BufferedBlockAlgorit);/**
|
2349
2340
|
* Initializes a newly created cipher.
|
2350
2341
|
*
|
2351
2342
|
* @param {number} xformMode Either the encryption or decryption transormation mode constant.
|
@@ -2357,7 +2348,7 @@ var ObjectAssign=typeof Object.assign!=="function"?function(target){if(target==n
|
|
2357
2348
|
* const cipher = CryptoJS.algo.AES.create(
|
2358
2349
|
* CryptoJS.algo.AES._ENC_XFORM_MODE, keyWordArray, { iv: ivWordArray }
|
2359
2350
|
* );
|
2360
|
-
*/function Cipher(xformMode,key,cfg){var _this;_classCallCheck(this,Cipher);_this=
|
2351
|
+
*/function Cipher(xformMode,key,cfg){var _this;_classCallCheck(this,Cipher);_this=_callSuper(this,Cipher);/**
|
2361
2352
|
* Configuration options.
|
2362
2353
|
*
|
2363
2354
|
* @property {WordArray} iv The IV to use for this operation.
|
@@ -2439,7 +2430,7 @@ var finalProcessedData=this._doFinalize();return finalProcessedData;}}],[{key:"c
|
|
2439
2430
|
* const AES = CryptoJS.lib.Cipher._createHelper(CryptoJS.algo.AES);
|
2440
2431
|
*/},{key:"_createHelper",value:function _createHelper(SubCipher){var selectCipherStrategy=function selectCipherStrategy(key){if(typeof key==='string'){return PasswordBasedCipher;}return SerializableCipher;};return {encrypt:function encrypt(message,key,cfg){return selectCipherStrategy(key).encrypt(SubCipher,message,key,cfg);},decrypt:function decrypt(ciphertext,key,cfg){return selectCipherStrategy(key).decrypt(SubCipher,ciphertext,key,cfg);}};}}]);return Cipher;}(BufferedBlockAlgorithm);Cipher._ENC_XFORM_MODE=1;Cipher._DEC_XFORM_MODE=2;Cipher.keySize=128/32;Cipher.ivSize=128/32;/**
|
2441
2432
|
* Abstract base block cipher mode template.
|
2442
|
-
*/var BlockCipherMode=/*#__PURE__*/function(_Base){_inherits(BlockCipherMode,_Base)
|
2433
|
+
*/var BlockCipherMode=/*#__PURE__*/function(_Base){_inherits(BlockCipherMode,_Base);/**
|
2443
2434
|
* Initializes a newly created mode.
|
2444
2435
|
*
|
2445
2436
|
* @param {Cipher} cipher A block cipher instance.
|
@@ -2448,7 +2439,7 @@ var finalProcessedData=this._doFinalize();return finalProcessedData;}}],[{key:"c
|
|
2448
2439
|
* @example
|
2449
2440
|
*
|
2450
2441
|
* const mode = CryptoJS.mode.CBC.Encryptor.create(cipher, iv.words);
|
2451
|
-
*/function BlockCipherMode(cipher,iv){var _this3;_classCallCheck(this,BlockCipherMode);_this3=
|
2442
|
+
*/function BlockCipherMode(cipher,iv){var _this3;_classCallCheck(this,BlockCipherMode);_this3=_callSuper(this,BlockCipherMode);_this3._cipher=cipher;_this3._iv=iv;return _this3;}/**
|
2452
2443
|
* Creates this mode for encryption.
|
2453
2444
|
*
|
2454
2445
|
* @param {Cipher} cipher A block cipher instance.
|
@@ -2478,9 +2469,9 @@ for(var i=0;i<blockSize;i+=1){_words[offset+i]^=block[i];}}/**
|
|
2478
2469
|
* Cipher Block Chaining mode.
|
2479
2470
|
*/ /**
|
2480
2471
|
* Abstract base CBC mode.
|
2481
|
-
*/var CBC=/*#__PURE__*/function(_BlockCipherMode){_inherits(CBC,_BlockCipherMode);
|
2472
|
+
*/var CBC=/*#__PURE__*/function(_BlockCipherMode){_inherits(CBC,_BlockCipherMode);function CBC(){_classCallCheck(this,CBC);return _callSuper(this,CBC,arguments);}return _createClass(CBC);}(BlockCipherMode);/**
|
2482
2473
|
* CBC encryptor.
|
2483
|
-
*/CBC.Encryptor=/*#__PURE__*/function(_CBC){_inherits(_class,_CBC);
|
2474
|
+
*/CBC.Encryptor=/*#__PURE__*/function(_CBC){_inherits(_class,_CBC);function _class(){_classCallCheck(this,_class);return _callSuper(this,_class,arguments);}_createClass(_class,[{key:"processBlock",value:/**
|
2484
2475
|
* Processes the data block at offset.
|
2485
2476
|
*
|
2486
2477
|
* @param {Array} words The data words to operate on.
|
@@ -2494,7 +2485,7 @@ var cipher=this._cipher;var blockSize=cipher.blockSize;// XOR and encrypt
|
|
2494
2485
|
xorBlock.call(this,words,offset,blockSize);cipher.encryptBlock(words,offset);// Remember this block to use with next block
|
2495
2486
|
this._prevBlock=words.slice(offset,offset+blockSize);}}]);return _class;}(CBC);/**
|
2496
2487
|
* CBC decryptor.
|
2497
|
-
*/CBC.Decryptor=/*#__PURE__*/function(_CBC2){_inherits(_class2,_CBC2);
|
2488
|
+
*/CBC.Decryptor=/*#__PURE__*/function(_CBC2){_inherits(_class2,_CBC2);function _class2(){_classCallCheck(this,_class2);return _callSuper(this,_class2,arguments);}_createClass(_class2,[{key:"processBlock",value:/**
|
2498
2489
|
* Processes the data block at offset.
|
2499
2490
|
*
|
2500
2491
|
* @param {Array} words The data words to operate on.
|
@@ -2543,12 +2534,12 @@ _data.sigBytes-=nPaddingBytes;}};/**
|
|
2543
2534
|
* @property {number} blockSize
|
2544
2535
|
*
|
2545
2536
|
* The number of 32-bit words this cipher operates on. Default: 4 (128 bits)
|
2546
|
-
*/var BlockCipher=/*#__PURE__*/function(_Cipher2){_inherits(BlockCipher,_Cipher2);
|
2537
|
+
*/var BlockCipher=/*#__PURE__*/function(_Cipher2){_inherits(BlockCipher,_Cipher2);function BlockCipher(xformMode,key,cfg){var _this4;_classCallCheck(this,BlockCipher);/**
|
2547
2538
|
* Configuration options.
|
2548
2539
|
*
|
2549
2540
|
* @property {Mode} mode The block mode to use. Default: CBC
|
2550
2541
|
* @property {Padding} padding The padding strategy to use. Default: Pkcs7
|
2551
|
-
*/_this4=
|
2542
|
+
*/_this4=_callSuper(this,BlockCipher,[xformMode,key,ObjectAssign({mode:CBC,padding:Pkcs7},cfg)]);_this4.blockSize=128/32;return _this4;}_createClass(BlockCipher,[{key:"reset",value:function reset(){var modeCreator;// Reset cipher
|
2552
2543
|
_get(_getPrototypeOf(BlockCipher.prototype),"reset",this).call(this);// Shortcuts
|
2553
2544
|
var cfg=this.cfg;var iv=cfg.iv,mode=cfg.mode;// Reset block mode
|
2554
2545
|
if(this._xformMode===this.constructor._ENC_XFORM_MODE){modeCreator=mode.createEncryptor;}else/* if (this._xformMode == this._DEC_XFORM_MODE) */{modeCreator=mode.createDecryptor;// Keep at least one block in the buffer for unpadding
|
@@ -2571,7 +2562,7 @@ padding.unpad(finalProcessedBlocks);}return finalProcessedBlocks;}}]);return Blo
|
|
2571
2562
|
* @property {number} blockSize The block size of the cipher.
|
2572
2563
|
* @property {Format} formatter
|
2573
2564
|
* The default formatting strategy to convert this cipher params object to a string.
|
2574
|
-
*/var CipherParams=/*#__PURE__*/function(_Base2){_inherits(CipherParams,_Base2)
|
2565
|
+
*/var CipherParams=/*#__PURE__*/function(_Base2){_inherits(CipherParams,_Base2);/**
|
2575
2566
|
* Initializes a newly created cipher params object.
|
2576
2567
|
*
|
2577
2568
|
* @param {Object} cipherParams An object with any of the possible cipher parameters.
|
@@ -2589,7 +2580,7 @@ padding.unpad(finalProcessedBlocks);}return finalProcessedBlocks;}}]);return Blo
|
|
2589
2580
|
* blockSize: 4,
|
2590
2581
|
* formatter: CryptoJS.format.OpenSSL
|
2591
2582
|
* });
|
2592
|
-
*/function CipherParams(cipherParams){var _this5;_classCallCheck(this,CipherParams);_this5=
|
2583
|
+
*/function CipherParams(cipherParams){var _this5;_classCallCheck(this,CipherParams);_this5=_callSuper(this,CipherParams);_this5.mixIn(cipherParams);return _this5;}/**
|
2593
2584
|
* Converts this cipher params object to a string.
|
2594
2585
|
*
|
2595
2586
|
* @param {Format} formatter (Optional) The formatting strategy to use.
|
@@ -2638,7 +2629,7 @@ if(ciphertextWords[0]===0x53616c74&&ciphertextWords[1]===0x65645f5f){// Extract
|
|
2638
2629
|
salt=WordArray.create(ciphertextWords.slice(2,4));// Remove salt from ciphertext
|
2639
2630
|
ciphertextWords.splice(0,4);ciphertext.sigBytes-=16;}return CipherParams.create({ciphertext:ciphertext,salt:salt});}};/**
|
2640
2631
|
* A cipher wrapper that returns ciphertext as a serializable cipher params object.
|
2641
|
-
*/var SerializableCipher=/*#__PURE__*/function(_Base3){_inherits(SerializableCipher,_Base3);
|
2632
|
+
*/var SerializableCipher=/*#__PURE__*/function(_Base3){_inherits(SerializableCipher,_Base3);function SerializableCipher(){_classCallCheck(this,SerializableCipher);return _callSuper(this,SerializableCipher,arguments);}_createClass(SerializableCipher,null,[{key:"encrypt",value:/**
|
2642
2633
|
* Encrypts a message.
|
2643
2634
|
*
|
2644
2635
|
* @param {Cipher} cipher The cipher algorithm to use.
|
@@ -2733,7 +2724,7 @@ var iv=WordArray.create(key.words.slice(keySize),ivSize*4);key.sigBytes=keySize*
|
|
2733
2724
|
return CipherParams.create({key:key,iv:iv,salt:_salt});}};/**
|
2734
2725
|
* A serializable cipher wrapper that derives the key from a password,
|
2735
2726
|
* and returns ciphertext as a serializable cipher params object.
|
2736
|
-
*/var PasswordBasedCipher=/*#__PURE__*/function(_SerializableCipher){_inherits(PasswordBasedCipher,_SerializableCipher);
|
2727
|
+
*/var PasswordBasedCipher=/*#__PURE__*/function(_SerializableCipher){_inherits(PasswordBasedCipher,_SerializableCipher);function PasswordBasedCipher(){_classCallCheck(this,PasswordBasedCipher);return _callSuper(this,PasswordBasedCipher,arguments);}_createClass(PasswordBasedCipher,null,[{key:"encrypt",value:/**
|
2737
2728
|
* Encrypts a message using a password.
|
2738
2729
|
*
|
2739
2730
|
* @param {Cipher} cipher The cipher algorithm to use.
|
@@ -2800,7 +2791,7 @@ t=x8*0x1010101^x4*0x10001^x2*0x101^x*0x1010100;INV_SUB_MIX_0[sx]=t<<24|t>>>8;INV
|
|
2800
2791
|
if(!x){xi=1;x=xi;}else {x=x2^d[d[d[x8^x2]]];xi^=d[d[xi]];}}// Precomputed Rcon lookup
|
2801
2792
|
var RCON=[0x00,0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80,0x1b,0x36];/**
|
2802
2793
|
* AES block cipher algorithm.
|
2803
|
-
*/var AESAlgo=/*#__PURE__*/function(_BlockCipher){_inherits(AESAlgo,_BlockCipher);
|
2794
|
+
*/var AESAlgo=/*#__PURE__*/function(_BlockCipher){_inherits(AESAlgo,_BlockCipher);function AESAlgo(){_classCallCheck(this,AESAlgo);return _callSuper(this,AESAlgo,arguments);}_createClass(AESAlgo,[{key:"_doReset",value:function _doReset(){var t;// Skip reset of nRounds has been set before and key did not change
|
2804
2795
|
if(this._nRounds&&this._keyPriorReset===this._key){return;}// Shortcuts
|
2805
2796
|
this._keyPriorReset=this._key;var key=this._keyPriorReset;var keyWords=key.words;var keySize=key.sigBytes/4;// Compute number of rounds
|
2806
2797
|
this._nRounds=keySize+6;var nRounds=this._nRounds;// Compute number of key schedule rows
|
@@ -2849,7 +2840,7 @@ var DATA_PLANE_API_VERSION='v1';var QUEUE_NAME='rudder';var XHR_QUEUE_PLUGIN='Xh
|
|
2849
2840
|
|
2850
2841
|
var EVENT_DELIVERY_FAILURE_ERROR_PREFIX=function EVENT_DELIVERY_FAILURE_ERROR_PREFIX(context,url){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Failed to deliver event(s) to ").concat(url,".");};
|
2851
2842
|
|
2852
|
-
var getBatchDeliveryPayload=function getBatchDeliveryPayload(events,currentTime,logger){var batchPayload={batch:events,sentAt:currentTime};return stringifyWithoutCircular(batchPayload,true,undefined,logger);};var getNormalizedQueueOptions=function getNormalizedQueueOptions(queueOpts){return mergeDeepRight(DEFAULT_RETRY_QUEUE_OPTIONS,queueOpts);};var getDeliveryUrl=function getDeliveryUrl(dataplaneUrl,endpoint){var dpUrl=new URL(dataplaneUrl);return new URL(removeDuplicateSlashes([dpUrl.pathname,'/',DATA_PLANE_API_VERSION,'/',endpoint].join('')),dpUrl).href;};var getBatchDeliveryUrl=function getBatchDeliveryUrl(dataplaneUrl){return getDeliveryUrl(dataplaneUrl,'batch');};var logErrorOnFailure=function logErrorOnFailure(details,url,willBeRetried,attemptNumber,maxRetryAttempts,logger){if(isUndefined(details===null||details===void 0?void 0:details.error)||isUndefined(logger)){return;}var isRetryableFailure=isErrRetryable(details);var errMsg=EVENT_DELIVERY_FAILURE_ERROR_PREFIX(XHR_QUEUE_PLUGIN,url);var dropMsg="The event(s) will be dropped.";if(isRetryableFailure){if(willBeRetried){errMsg="".concat(errMsg," It/they will be retried.");if(attemptNumber>0){errMsg="".concat(errMsg," Retry attempt ").concat(attemptNumber," of ").concat(maxRetryAttempts,".");}}else {errMsg="".concat(errMsg," Retries exhausted (").concat(maxRetryAttempts,"). ").concat(dropMsg);}}else {errMsg="".concat(errMsg," ").concat(dropMsg);}logger===null||logger===void 0||logger.error(errMsg);};var getRequestInfo=function getRequestInfo(itemData,state,logger){var data;var headers;var url;var currentTime=getCurrentTimeFormatted();if(Array.isArray(itemData)){var finalEvents=itemData.map(function(queueItemData){return getFinalEventForDeliveryMutator(queueItemData.event,currentTime);});data=getBatchDeliveryPayload(finalEvents,currentTime,logger);headers=itemData[0]?clone
|
2843
|
+
var getBatchDeliveryPayload=function getBatchDeliveryPayload(events,currentTime,logger){var batchPayload={batch:events,sentAt:currentTime};return stringifyWithoutCircular(batchPayload,true,undefined,logger);};var getNormalizedQueueOptions=function getNormalizedQueueOptions(queueOpts){return mergeDeepRight(DEFAULT_RETRY_QUEUE_OPTIONS,queueOpts);};var getDeliveryUrl=function getDeliveryUrl(dataplaneUrl,endpoint){var dpUrl=new URL(dataplaneUrl);return new URL(removeDuplicateSlashes([dpUrl.pathname,'/',DATA_PLANE_API_VERSION,'/',endpoint].join('')),dpUrl).href;};var getBatchDeliveryUrl=function getBatchDeliveryUrl(dataplaneUrl){return getDeliveryUrl(dataplaneUrl,'batch');};var logErrorOnFailure=function logErrorOnFailure(details,url,willBeRetried,attemptNumber,maxRetryAttempts,logger){if(isUndefined(details===null||details===void 0?void 0:details.error)||isUndefined(logger)){return;}var isRetryableFailure=isErrRetryable(details);var errMsg=EVENT_DELIVERY_FAILURE_ERROR_PREFIX(XHR_QUEUE_PLUGIN,url);var dropMsg="The event(s) will be dropped.";if(isRetryableFailure){if(willBeRetried){errMsg="".concat(errMsg," It/they will be retried.");if(attemptNumber>0){errMsg="".concat(errMsg," Retry attempt ").concat(attemptNumber," of ").concat(maxRetryAttempts,".");}}else {errMsg="".concat(errMsg," Retries exhausted (").concat(maxRetryAttempts,"). ").concat(dropMsg);}}else {errMsg="".concat(errMsg," ").concat(dropMsg);}logger===null||logger===void 0||logger.error(errMsg);};var getRequestInfo=function getRequestInfo(itemData,state,logger){var data;var headers;var url;var currentTime=getCurrentTimeFormatted();if(Array.isArray(itemData)){var finalEvents=itemData.map(function(queueItemData){return getFinalEventForDeliveryMutator(queueItemData.event,currentTime);});data=getBatchDeliveryPayload(finalEvents,currentTime,logger);headers=itemData[0]?clone(itemData[0].headers):{};url=getBatchDeliveryUrl(state.lifecycle.activeDataplaneUrl.value);}else {var eventUrl=itemData.url,event=itemData.event,eventHeaders=itemData.headers;var finalEvent=getFinalEventForDeliveryMutator(event,currentTime);data=getDeliveryPayload(finalEvent,logger);headers=clone(eventHeaders);url=eventUrl;}return {data:data,headers:headers,url:url};};
|
2853
2844
|
|
2854
2845
|
var pluginName='XhrQueue';var XhrQueue=function XhrQueue(){return {name:pluginName,deps:[],initialize:function initialize(state){state.plugins.loadedPlugins.value=[].concat(_toConsumableArray(state.plugins.loadedPlugins.value),[pluginName]);},dataplaneEventsQueue:{/**
|
2855
2846
|
* Initialize the queue for delivery
|
@@ -3197,7 +3188,7 @@ var validateWriteKey=function validateWriteKey(writeKey){if(!isString(writeKey)|
|
|
3197
3188
|
*/var isPositiveInteger=function isPositiveInteger(num){return isNumber(num)&&num>=0&&Number.isInteger(num);};
|
3198
3189
|
|
3199
3190
|
var normalizeLoadOptions=function normalizeLoadOptions(loadOptionsFromState,loadOptions){var _normalizedLoadOpts$p,_normalizedLoadOpts$s2;// TODO: Maybe add warnings for invalid values
|
3200
|
-
var normalizedLoadOpts=clone
|
3191
|
+
var normalizedLoadOpts=clone(loadOptions);if(!isString(normalizedLoadOpts.setCookieDomain)){delete normalizedLoadOpts.setCookieDomain;}var cookieSameSiteValues=['Strict','Lax','None'];if(!cookieSameSiteValues.includes(normalizedLoadOpts.sameSiteCookie)){delete normalizedLoadOpts.sameSiteCookie;}normalizedLoadOpts.secureCookie=normalizedLoadOpts.secureCookie===true;var uaChTrackLevels=['none','default','full'];if(!uaChTrackLevels.includes(normalizedLoadOpts.uaChTrackLevel)){delete normalizedLoadOpts.uaChTrackLevel;}if(!isObjectLiteralAndNotNull(normalizedLoadOpts.integrations)){delete normalizedLoadOpts.integrations;}normalizedLoadOpts.plugins=(_normalizedLoadOpts$p=normalizedLoadOpts.plugins)!==null&&_normalizedLoadOpts$p!==void 0?_normalizedLoadOpts$p:defaultOptionalPluginsList;normalizedLoadOpts.useGlobalIntegrationsConfigInEvents=normalizedLoadOpts.useGlobalIntegrationsConfigInEvents===true;normalizedLoadOpts.bufferDataPlaneEventsUntilReady=normalizedLoadOpts.bufferDataPlaneEventsUntilReady===true;normalizedLoadOpts.sendAdblockPage=normalizedLoadOpts.sendAdblockPage===true;if(!isObjectLiteralAndNotNull(normalizedLoadOpts.sendAdblockPageOptions)){delete normalizedLoadOpts.sendAdblockPageOptions;}if(!isDefined(normalizedLoadOpts.loadIntegration)){delete normalizedLoadOpts.loadIntegration;}else {normalizedLoadOpts.loadIntegration=normalizedLoadOpts.loadIntegration===true;}if(!isObjectLiteralAndNotNull(normalizedLoadOpts.storage)){delete normalizedLoadOpts.storage;}else {var _normalizedLoadOpts$s;normalizedLoadOpts.storage=removeUndefinedAndNullValues(normalizedLoadOpts.storage);normalizedLoadOpts.storage.migrate=((_normalizedLoadOpts$s=normalizedLoadOpts.storage)===null||_normalizedLoadOpts$s===void 0?void 0:_normalizedLoadOpts$s.migrate)===true;}if(!isObjectLiteralAndNotNull(normalizedLoadOpts.beaconQueueOptions)){delete normalizedLoadOpts.beaconQueueOptions;}else {normalizedLoadOpts.beaconQueueOptions=removeUndefinedAndNullValues(normalizedLoadOpts.beaconQueueOptions);}if(!isObjectLiteralAndNotNull(normalizedLoadOpts.destinationsQueueOptions)){delete normalizedLoadOpts.destinationsQueueOptions;}else {normalizedLoadOpts.destinationsQueueOptions=removeUndefinedAndNullValues(normalizedLoadOpts.destinationsQueueOptions);}if(!isObjectLiteralAndNotNull(normalizedLoadOpts.queueOptions)){delete normalizedLoadOpts.queueOptions;}else {normalizedLoadOpts.queueOptions=removeUndefinedAndNullValues(normalizedLoadOpts.queueOptions);}normalizedLoadOpts.lockIntegrationsVersion=normalizedLoadOpts.lockIntegrationsVersion===true;if(!isNumber(normalizedLoadOpts.dataPlaneEventsBufferTimeout)){delete normalizedLoadOpts.dataPlaneEventsBufferTimeout;}if(!isObjectLiteralAndNotNull((_normalizedLoadOpts$s2=normalizedLoadOpts.storage)===null||_normalizedLoadOpts$s2===void 0?void 0:_normalizedLoadOpts$s2.cookie)){var _normalizedLoadOpts$s3;(_normalizedLoadOpts$s3=normalizedLoadOpts.storage)===null||_normalizedLoadOpts$s3===void 0||delete _normalizedLoadOpts$s3.cookie;}else {var _normalizedLoadOpts$s4;normalizedLoadOpts.storage.cookie=removeUndefinedAndNullValues((_normalizedLoadOpts$s4=normalizedLoadOpts.storage)===null||_normalizedLoadOpts$s4===void 0?void 0:_normalizedLoadOpts$s4.cookie);}if(!isObjectLiteralAndNotNull(normalizedLoadOpts.preConsent)){delete normalizedLoadOpts.preConsent;}else {normalizedLoadOpts.preConsent=removeUndefinedAndNullValues(normalizedLoadOpts.preConsent);}var mergedLoadOptions=mergeDeepRight(loadOptionsFromState,normalizedLoadOpts);return mergedLoadOptions;};var getSourceConfigURL=function getSourceConfigURL(configUrl,writeKey,lockIntegrationsVersion,logger){var defSearchParams=new URLSearchParams({p:MODULE_TYPE,v:APP_VERSION,build:BUILD_TYPE,writeKey:writeKey,lockIntegrationsVersion:lockIntegrationsVersion.toString()});var origin=DEFAULT_CONFIG_BE_URL;var searchParams=defSearchParams;var pathname='/sourceConfig/';var hash='';// Ideally, this check is not required but URL polyfill
|
3201
3192
|
// doesn't seem to throw errors for empty URLs
|
3202
3193
|
// TODO: Need to improve this check to find out if the URL is valid or not
|
3203
3194
|
if(configUrl){try{var configUrlInstance=new URL(configUrl);if(!removeTrailingSlashes(configUrlInstance.pathname).endsWith('/sourceConfig')){configUrlInstance.pathname="".concat(removeTrailingSlashes(configUrlInstance.pathname),"/sourceConfig/");}configUrlInstance.pathname=removeDuplicateSlashes(configUrlInstance.pathname);defSearchParams.forEach(function(value,key){if(configUrlInstance.searchParams.get(key)===null){configUrlInstance.searchParams.set(key,value);}});origin=configUrlInstance.origin;pathname=configUrlInstance.pathname;searchParams=configUrlInstance.searchParams;hash=configUrlInstance.hash;}catch(err){logger===null||logger===void 0||logger.warn(INVALID_CONFIG_URL_WARNING(CONFIG_MANAGER,configUrl));}}return "".concat(origin).concat(pathname,"?").concat(searchParams).concat(hash);};
|
@@ -3238,7 +3229,7 @@ var isErrorReportingEnabled=function isErrorReportingEnabled(sourceConfig){var _
|
|
3238
3229
|
* Validates and normalizes the consent options provided by the user
|
3239
3230
|
* @param options Consent options provided by the user
|
3240
3231
|
* @returns Validated and normalized consent options
|
3241
|
-
*/var getValidPostConsentOptions=function getValidPostConsentOptions(options){var validOptions={sendPageEvent:false,trackConsent:false,discardPreConsentEvents:false};if(isObjectLiteralAndNotNull(options)){var clonedOptions=clone
|
3232
|
+
*/var getValidPostConsentOptions=function getValidPostConsentOptions(options){var validOptions={sendPageEvent:false,trackConsent:false,discardPreConsentEvents:false};if(isObjectLiteralAndNotNull(options)){var clonedOptions=clone(options);validOptions.storage=clonedOptions.storage;if(isDefined(clonedOptions.integrations)){validOptions.integrations=isObjectLiteralAndNotNull(clonedOptions.integrations)?clonedOptions.integrations:DEFAULT_INTEGRATIONS_CONFIG;}validOptions.discardPreConsentEvents=clonedOptions.discardPreConsentEvents===true;validOptions.sendPageEvent=clonedOptions.sendPageEvent===true;validOptions.trackConsent=clonedOptions.trackConsent===true;if(isNonEmptyObject(clonedOptions.consentManagement)){// Override enabled value with the current state value
|
3242
3233
|
validOptions.consentManagement=mergeDeepRight(clonedOptions.consentManagement,{enabled:state.consents.enabled.value});}}return validOptions;};/**
|
3243
3234
|
* Validates if the input is a valid consents data
|
3244
3235
|
* @param value Input consents data
|
@@ -3278,7 +3269,7 @@ enabled:((_state$loadOptions$va=state.loadOptions.value.preConsent)===null||_sta
|
|
3278
3269
|
* @param resp Source config response
|
3279
3270
|
* @param logger Logger instance
|
3280
3271
|
*/var updateConsentsState=function updateConsentsState(resp){var resolutionStrategy=state.consents.resolutionStrategy.value;var cmpMetadata;if(isObjectLiteralAndNotNull(resp.consentManagementMetadata)){if(state.consents.provider.value){var _resp$consentManageme,_resp$consentManageme2;resolutionStrategy=(_resp$consentManageme=(_resp$consentManageme2=resp.consentManagementMetadata.providers.find(function(p){return p.provider===state.consents.provider.value;}))===null||_resp$consentManageme2===void 0?void 0:_resp$consentManageme2.resolutionStrategy)!==null&&_resp$consentManageme!==void 0?_resp$consentManageme:state.consents.resolutionStrategy.value;}cmpMetadata=resp.consentManagementMetadata;}// If the provider is custom, then the resolution strategy is not applicable
|
3281
|
-
if(state.consents.provider.value==='custom'){resolutionStrategy=undefined;}n(function(){state.consents.metadata.value=clone
|
3272
|
+
if(state.consents.provider.value==='custom'){resolutionStrategy=undefined;}n(function(){state.consents.metadata.value=clone(cmpMetadata);state.consents.resolutionStrategy.value=resolutionStrategy;});};
|
3282
3273
|
|
3283
3274
|
/**
|
3284
3275
|
* A function that determines integration SDK loading path
|
@@ -3453,17 +3444,17 @@ rudderEvent.context=getMergedContext(rudderEvent.context,options);}};/**
|
|
3453
3444
|
* Returns the final integrations config for the event based on the global config and event's config
|
3454
3445
|
* @param integrationsConfig Event's integrations config
|
3455
3446
|
* @returns Final integrations config
|
3456
|
-
*/var getEventIntegrationsConfig=function getEventIntegrationsConfig(integrationsConfig){var finalIntgConfig;if(shouldUseGlobalIntegrationsConfigInEvents()){var _state$consents$postC2,_state$consents$postC3;finalIntgConfig=clone
|
3447
|
+
*/var getEventIntegrationsConfig=function getEventIntegrationsConfig(integrationsConfig){var finalIntgConfig;if(shouldUseGlobalIntegrationsConfigInEvents()){var _state$consents$postC2,_state$consents$postC3;finalIntgConfig=clone((_state$consents$postC2=(_state$consents$postC3=state.consents.postConsent.value)===null||_state$consents$postC3===void 0?void 0:_state$consents$postC3.integrations)!==null&&_state$consents$postC2!==void 0?_state$consents$postC2:state.nativeDestinations.loadOnlyIntegrations.value);}else if(isObjectLiteralAndNotNull(integrationsConfig)){finalIntgConfig=integrationsConfig;}else {finalIntgConfig=DEFAULT_INTEGRATIONS_CONFIG;}return finalIntgConfig;};/**
|
3457
3448
|
* Enrich the base event object with data from state and the API options
|
3458
3449
|
* @param rudderEvent RudderEvent object
|
3459
3450
|
* @param options API options
|
3460
3451
|
* @param pageProps Page properties
|
3461
3452
|
* @param logger logger
|
3462
3453
|
* @returns Enriched RudderEvent object
|
3463
|
-
*/var getEnrichedEvent=function getEnrichedEvent(rudderEvent,options,pageProps,logger){var _state$storage$entrie;var commonEventData={channel:CHANNEL,context:_objectSpread2(_objectSpread2({traits:clone
|
3454
|
+
*/var getEnrichedEvent=function getEnrichedEvent(rudderEvent,options,pageProps,logger){var _state$storage$entrie;var commonEventData={channel:CHANNEL,context:_objectSpread2(_objectSpread2({traits:clone(state.session.userTraits.value),sessionId:state.session.sessionInfo.value.id||undefined,sessionStart:state.session.sessionInfo.value.sessionStart||undefined},state.consents.enabled.value&&{consentManagement:{deniedConsentIds:clone(state.consents.data.value.deniedConsentIds),allowedConsentIds:clone(state.consents.data.value.allowedConsentIds),provider:state.consents.provider.value,resolutionStrategy:state.consents.resolutionStrategy.value}}),{},{'ua-ch':state.context['ua-ch'].value,app:state.context.app.value,library:state.context.library.value,userAgent:state.context.userAgent.value,os:state.context.os.value,locale:state.context.locale.value,screen:state.context.screen.value,campaign:extractUTMParameters(globalThis.location.href),page:getContextPageProperties(pageProps),timezone:state.context.timezone.value}),originalTimestamp:getCurrentTimeFormatted(),integrations:DEFAULT_INTEGRATIONS_CONFIG,messageId:generateUUID(),userId:rudderEvent.userId||state.session.userId.value};if(!isStorageTypeValidForStoringData((_state$storage$entrie=state.storage.entries.value.anonymousId)===null||_state$storage$entrie===void 0?void 0:_state$storage$entrie.type)){// Generate new anonymous id for each request
|
3464
3455
|
commonEventData.anonymousId=generateAnonymousId();}else {// Type casting to string as the user session manager will take care of initializing the value
|
3465
3456
|
commonEventData.anonymousId=state.session.anonymousId.value;}// set truly anonymous tracking flag
|
3466
|
-
if(state.storage.trulyAnonymousTracking.value){commonEventData.context.trulyAnonymousTracking=true;}if(rudderEvent.type==='identify'){var _state$storage$entrie2;commonEventData.context.traits=((_state$storage$entrie2=state.storage.entries.value.userTraits)===null||_state$storage$entrie2===void 0?void 0:_state$storage$entrie2.type)!==NO_STORAGE?clone
|
3457
|
+
if(state.storage.trulyAnonymousTracking.value){commonEventData.context.trulyAnonymousTracking=true;}if(rudderEvent.type==='identify'){var _state$storage$entrie2;commonEventData.context.traits=((_state$storage$entrie2=state.storage.entries.value.userTraits)===null||_state$storage$entrie2===void 0?void 0:_state$storage$entrie2.type)!==NO_STORAGE?clone(state.session.userTraits.value):rudderEvent.context.traits;}if(rudderEvent.type==='group'){if(rudderEvent.groupId||state.session.groupId.value){commonEventData.groupId=rudderEvent.groupId||state.session.groupId.value;}if(rudderEvent.traits||state.session.groupTraits.value){var _state$storage$entrie3;commonEventData.traits=((_state$storage$entrie3=state.storage.entries.value.groupTraits)===null||_state$storage$entrie3===void 0?void 0:_state$storage$entrie3.type)!==NO_STORAGE?clone(state.session.groupTraits.value):rudderEvent.traits;}}var processedEvent=mergeDeepRight(rudderEvent,commonEventData);// Set the default values for the event properties
|
3467
3458
|
// matching with v1.1 payload
|
3468
3459
|
if(processedEvent.event===undefined){processedEvent.event=null;}if(processedEvent.properties===undefined){processedEvent.properties=null;}processOptions(processedEvent,options);checkForReservedElements(processedEvent,logger);// Update the integrations config for the event
|
3469
3460
|
processedEvent.integrations=getEventIntegrationsConfig(processedEvent.integrations);return processedEvent;};
|
@@ -3624,10 +3615,6 @@ if(state.session.sessionInfo.value.autoTrack){this.startOrRenewAutoTracking();}}
|
|
3624
3615
|
* @param userId
|
3625
3616
|
*/},{key:"setAuthToken",value:function setAuthToken(token){state.session.authToken.value=this.isPersistenceEnabledForStorageEntry('authToken')&&token?token:DEFAULT_USER_SESSION_VALUES.authToken;}}]);return UserSessionManager;}();
|
3626
3617
|
|
3627
|
-
/**
|
3628
|
-
* A buffer queue to serve as a store for any type of data
|
3629
|
-
*/var BufferQueue=/*#__PURE__*/function(){function BufferQueue(){_classCallCheck(this,BufferQueue);this.items=[];}_createClass(BufferQueue,[{key:"enqueue",value:function enqueue(item){this.items.push(item);}},{key:"dequeue",value:function dequeue(){if(this.items.length===0){return null;}return this.items.shift();}},{key:"isEmpty",value:function isEmpty(){return this.items.length===0;}},{key:"size",value:function size(){return this.items.length;}},{key:"clear",value:function clear(){this.items=[];}}]);return BufferQueue;}();
|
3630
|
-
|
3631
3618
|
var DATA_PLANE_QUEUE_EXT_POINT_PREFIX='dataplaneEventsQueue';var DESTINATIONS_QUEUE_EXT_POINT_PREFIX='destinationsEventsQueue';var DMT_EXT_POINT_PREFIX='transformEvent';
|
3632
3619
|
|
3633
3620
|
/**
|
@@ -3635,12 +3622,12 @@ var DATA_PLANE_QUEUE_EXT_POINT_PREFIX='dataplaneEventsQueue';var DESTINATIONS_QU
|
|
3635
3622
|
* @param eventIntgConfig User supplied integrations config at event level
|
3636
3623
|
* @param destinationsIntgConfig Cumulative integrations config from all destinations
|
3637
3624
|
* @returns Filtered user supplied integrations config
|
3638
|
-
*/var getOverriddenIntegrationOptions=function getOverriddenIntegrationOptions(eventIntgConfig,destinationsIntgConfig){return Object.keys(eventIntgConfig).filter(function(intgName){return eventIntgConfig[intgName]!==true||!destinationsIntgConfig[intgName];}).reduce(function(obj,key){var retVal=clone
|
3625
|
+
*/var getOverriddenIntegrationOptions=function getOverriddenIntegrationOptions(eventIntgConfig,destinationsIntgConfig){return Object.keys(eventIntgConfig).filter(function(intgName){return eventIntgConfig[intgName]!==true||!destinationsIntgConfig[intgName];}).reduce(function(obj,key){var retVal=clone(obj);retVal[key]=eventIntgConfig[key];return retVal;},{});};/**
|
3639
3626
|
* Returns the event object with final integrations config
|
3640
3627
|
* @param event RudderEvent object
|
3641
3628
|
* @param state Application state
|
3642
3629
|
* @returns Mutated event with final integrations config
|
3643
|
-
*/var getFinalEvent=function getFinalEvent(event,state){var _event$integrations;var finalEvent=clone
|
3630
|
+
*/var getFinalEvent=function getFinalEvent(event,state){var _event$integrations;var finalEvent=clone(event);// Merge the destination specific integrations config with the event's integrations config
|
3644
3631
|
// In general, the preference is given to the event's integrations config
|
3645
3632
|
var eventIntgConfig=(_event$integrations=event.integrations)!==null&&_event$integrations!==void 0?_event$integrations:DEFAULT_INTEGRATIONS_CONFIG;var destinationsIntgConfig=state.nativeDestinations.integrationsConfig.value;var overriddenIntgOpts=getOverriddenIntegrationOptions(eventIntgConfig,destinationsIntgConfig);finalEvent.integrations=mergeDeepRight(destinationsIntgConfig,overriddenIntgOpts);return finalEvent;};var shouldBufferEventsForPreConsent=function shouldBufferEventsForPreConsent(state){var _state$consents$preCo,_state$consents$preCo2,_state$consents$preCo3;return state.consents.preConsent.value.enabled&&((_state$consents$preCo=state.consents.preConsent.value.events)===null||_state$consents$preCo===void 0?void 0:_state$consents$preCo.delivery)==='buffer'&&(((_state$consents$preCo2=state.consents.preConsent.value.storage)===null||_state$consents$preCo2===void 0?void 0:_state$consents$preCo2.strategy)==='session'||((_state$consents$preCo3=state.consents.preConsent.value.storage)===null||_state$consents$preCo3===void 0?void 0:_state$consents$preCo3.strategy)==='none');};
|
3646
3633
|
|
@@ -3664,7 +3651,7 @@ if(state.loadOptions.value.bufferDataPlaneEventsUntilReady===true){timeoutId=glo
|
|
3664
3651
|
* Enqueues the event for processing
|
3665
3652
|
* @param event RudderEvent object
|
3666
3653
|
* @param callback API callback function
|
3667
|
-
*/},{key:"enqueue",value:function enqueue(event,callback){var dpQEvent;try{dpQEvent=getFinalEvent(event,state);this.pluginsManager.invokeSingle("".concat(DATA_PLANE_QUEUE_EXT_POINT_PREFIX,".enqueue"),state,this.dataplaneEventsQueue,dpQEvent,this.errorHandler,this.logger);}catch(e){this.onError(e,DATAPLANE_PLUGIN_ENQUEUE_ERROR);}try{var dQEvent=clone
|
3654
|
+
*/},{key:"enqueue",value:function enqueue(event,callback){var dpQEvent;try{dpQEvent=getFinalEvent(event,state);this.pluginsManager.invokeSingle("".concat(DATA_PLANE_QUEUE_EXT_POINT_PREFIX,".enqueue"),state,this.dataplaneEventsQueue,dpQEvent,this.errorHandler,this.logger);}catch(e){this.onError(e,DATAPLANE_PLUGIN_ENQUEUE_ERROR);}try{var dQEvent=clone(event);this.pluginsManager.invokeSingle("".concat(DESTINATIONS_QUEUE_EXT_POINT_PREFIX,".enqueue"),state,this.destinationsEventsQueue,dQEvent,this.errorHandler,this.logger);}catch(e){this.onError(e,NATIVE_DEST_PLUGIN_ENQUEUE_ERROR);}// Invoke the callback if it exists
|
3668
3655
|
try{// Using the event sent to the data plane queue here
|
3669
3656
|
// to ensure the mutated (if any) event is sent to the callback
|
3670
3657
|
callback===null||callback===void 0||callback(dpQEvent);}catch(error){this.onError(error,API_CALLBACK_INVOKE_ERROR);}}/**
|
@@ -3682,7 +3669,7 @@ var dispatchSDKEvent=function dispatchSDKEvent(event){var customEvent=new Custom
|
|
3682
3669
|
* Initialize services and components or use default ones if singletons
|
3683
3670
|
*/function Analytics(){_classCallCheck(this,Analytics);this.preloadBuffer=new BufferQueue();this.initialized=false;this.errorHandler=defaultErrorHandler;this.logger=defaultLogger;this.externalSrcLoader=new ExternalSrcLoader(this.errorHandler,this.logger);this.capabilitiesManager=new CapabilitiesManager(this.errorHandler,this.logger);this.httpClient=defaultHttpClient;}/**
|
3684
3671
|
* Start application lifecycle if not already started
|
3685
|
-
*/_createClass(Analytics,[{key:"load",value:function load(writeKey,dataPlaneUrl){var loadOptions=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};if(state.lifecycle.status.value){return;}var clonedDataPlaneUrl=clone
|
3672
|
+
*/_createClass(Analytics,[{key:"load",value:function load(writeKey,dataPlaneUrl){var loadOptions=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};if(state.lifecycle.status.value){return;}var clonedDataPlaneUrl=clone(dataPlaneUrl);var clonedLoadOptions=clone(loadOptions);// dataPlaneUrl is not provided
|
3686
3673
|
if(isObjectAndNotNull(dataPlaneUrl)){clonedLoadOptions=dataPlaneUrl;clonedDataPlaneUrl=undefined;}// Set initial state values
|
3687
3674
|
n(function(){state.lifecycle.writeKey.value=writeKey;state.lifecycle.dataPlaneUrl.value=clonedDataPlaneUrl;state.loadOptions.value=normalizeLoadOptions(state.loadOptions.value,clonedLoadOptions);state.lifecycle.status.value='mounted';});// set log level as early as possible
|
3688
3675
|
if(state.loadOptions.value.logLevel){var _this$logger;(_this$logger=this.logger)===null||_this$logger===void 0||_this$logger.setMinLogLevel(state.loadOptions.value.logLevel);}// Expose state to global objects
|
@@ -3697,7 +3684,7 @@ if(state.consents.preConsent.value.enabled===true){state.lifecycle.status.value=
|
|
3697
3684
|
* Load browser polyfill if required
|
3698
3685
|
*/},{key:"onMounted",value:function onMounted(){this.capabilitiesManager.init();}/**
|
3699
3686
|
* Enqueue in SDK preload buffer events, used from preloadBuffer component
|
3700
|
-
*/},{key:"enqueuePreloadBufferEvents",value:function enqueuePreloadBufferEvents(bufferedEvents){var _this2=this;if(Array.isArray(bufferedEvents)){bufferedEvents.forEach(function(bufferedEvent){return _this2.preloadBuffer.enqueue(clone
|
3687
|
+
*/},{key:"enqueuePreloadBufferEvents",value:function enqueuePreloadBufferEvents(bufferedEvents){var _this2=this;if(Array.isArray(bufferedEvents)){bufferedEvents.forEach(function(bufferedEvent){return _this2.preloadBuffer.enqueue(clone(bufferedEvent));});}}/**
|
3701
3688
|
* Process the buffer preloaded events by passing their arguments to the respective facade methods
|
3702
3689
|
*/},{key:"processDataInPreloadBuffer",value:function processDataInPreloadBuffer(){while(this.preloadBuffer.size()>0){var eventToProcess=this.preloadBuffer.dequeue();if(eventToProcess){consumePreloadBufferedEvent(_toConsumableArray(eventToProcess),this);}}}},{key:"prepareInternalServices",value:function prepareInternalServices(){this.pluginsManager=new PluginsManager(defaultPluginEngine,this.errorHandler,this.logger);this.storeManager=new StoreManager(this.pluginsManager,this.errorHandler,this.logger);this.configManager=new ConfigManager(this.httpClient,this.errorHandler,this.logger);this.userSessionManager=new UserSessionManager(this.errorHandler,this.logger,this.pluginsManager,this.storeManager);this.eventRepository=new EventRepository(this.pluginsManager,this.storeManager,this.errorHandler,this.logger);this.eventManager=new EventManager(this.eventRepository,this.userSessionManager,this.errorHandler,this.logger);}/**
|
3703
3690
|
* Load configuration
|
@@ -3776,7 +3763,7 @@ if(state.consents.postConsent.value.trackConsent){var trackOptions=trackArgument
|
|
3776
3763
|
function RudderAnalytics(){_classCallCheck(this,RudderAnalytics);_defineProperty(this,"analyticsInstances",{});_defineProperty(this,"defaultAnalyticsKey",'');_defineProperty(this,"logger",defaultLogger);if(RudderAnalytics.globalSingleton){// START-NO-SONAR-SCAN
|
3777
3764
|
// eslint-disable-next-line no-constructor-return
|
3778
3765
|
return RudderAnalytics.globalSingleton;// END-NO-SONAR-SCAN
|
3779
|
-
}this.setDefaultInstanceKey=this.setDefaultInstanceKey.bind(this);this.getAnalyticsInstance=this.getAnalyticsInstance.bind(this);this.load=this.load.bind(this);this.ready=this.ready.bind(this);this.triggerBufferedLoadEvent=this.triggerBufferedLoadEvent.bind(this);this.page=this.page.bind(this);this.track=this.track.bind(this);this.identify=this.identify.bind(this);this.alias=this.alias.bind(this);this.group=this.group.bind(this);this.reset=this.reset.bind(this);this.getAnonymousId=this.getAnonymousId.bind(this);this.setAnonymousId=this.setAnonymousId.bind(this);this.getUserId=this.getUserId.bind(this);this.getUserTraits=this.getUserTraits.bind(this);this.getGroupId=this.getGroupId.bind(this);this.getGroupTraits=this.getGroupTraits.bind(this);this.startSession=this.startSession.bind(this);this.endSession=this.endSession.bind(this);this.getSessionId=this.getSessionId.bind(this);this.setAuthToken=this.setAuthToken.bind(this);this.consent=this.consent.bind(this);RudderAnalytics.globalSingleton=this;// start loading if a load event was buffered or wait for explicit load call
|
3766
|
+
}defaultErrorHandler.attachErrorListeners();this.setDefaultInstanceKey=this.setDefaultInstanceKey.bind(this);this.getAnalyticsInstance=this.getAnalyticsInstance.bind(this);this.load=this.load.bind(this);this.ready=this.ready.bind(this);this.triggerBufferedLoadEvent=this.triggerBufferedLoadEvent.bind(this);this.page=this.page.bind(this);this.track=this.track.bind(this);this.identify=this.identify.bind(this);this.alias=this.alias.bind(this);this.group=this.group.bind(this);this.reset=this.reset.bind(this);this.getAnonymousId=this.getAnonymousId.bind(this);this.setAnonymousId=this.setAnonymousId.bind(this);this.getUserId=this.getUserId.bind(this);this.getUserTraits=this.getUserTraits.bind(this);this.getGroupId=this.getGroupId.bind(this);this.getGroupTraits=this.getGroupTraits.bind(this);this.startSession=this.startSession.bind(this);this.endSession=this.endSession.bind(this);this.getSessionId=this.getSessionId.bind(this);this.setAuthToken=this.setAuthToken.bind(this);this.consent=this.consent.bind(this);RudderAnalytics.globalSingleton=this;// start loading if a load event was buffered or wait for explicit load call
|
3780
3767
|
this.triggerBufferedLoadEvent();}/**
|
3781
3768
|
* Set instance to use if no specific writeKey is provided in methods
|
3782
3769
|
* automatically for the first created instance
|
@@ -3793,7 +3780,7 @@ promotePreloadedConsentEventsToTop(preloadedEventsArray);// Get any load method
|
|
3793
3780
|
// BTW, load method is also removed from the array
|
3794
3781
|
// So, the Analytics object can directly consume the remaining events
|
3795
3782
|
var loadEvent=getPreloadedLoadEvent(preloadedEventsArray);// Set the final preloaded events array in global object
|
3796
|
-
setExposedGlobal(GLOBAL_PRELOAD_BUFFER,clone
|
3783
|
+
setExposedGlobal(GLOBAL_PRELOAD_BUFFER,clone(preloadedEventsArray));// Process load method if present in the buffered requests
|
3797
3784
|
if(loadEvent.length>0){// Remove the event name from the Buffered Event array and keep only arguments
|
3798
3785
|
loadEvent.shift();// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
3799
3786
|
// @ts-ignore
|