apxor-qe 1.6.3-qa.1 → 1.7.0
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/dist/apxor.qe.js.bak +524 -512
- package/dist/apxor.qe.min.js +1 -1
- package/package.json +2 -2
package/dist/apxor.qe.js.bak
CHANGED
|
@@ -208,7 +208,7 @@
|
|
|
208
208
|
var toUpperCase = function toUpperCase(key) {
|
|
209
209
|
return key.toUpperCase();
|
|
210
210
|
};
|
|
211
|
-
var
|
|
211
|
+
var rCJW = function rCJW(actual, expected, operator) {
|
|
212
212
|
switch (operator) {
|
|
213
213
|
case "EQ":
|
|
214
214
|
return actual === expected;
|
|
@@ -266,15 +266,25 @@
|
|
|
266
266
|
};
|
|
267
267
|
var _doesUrlMatchSkeleton = function _doesUrlMatchSkeleton(currenturl, skeleton, variable) {
|
|
268
268
|
var startsWith = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
269
|
-
|
|
270
|
-
|
|
269
|
+
if (!currenturl || !skeleton || !variable) {
|
|
270
|
+
return false;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
// Escape special characters in the variable
|
|
271
274
|
// eslint-disable-next-line no-useless-escape
|
|
272
|
-
variable.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&")
|
|
273
|
-
|
|
274
|
-
//
|
|
275
|
-
var
|
|
276
|
-
|
|
277
|
-
|
|
275
|
+
var escapedVariable = variable.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
|
|
276
|
+
|
|
277
|
+
// Replace custom wildcard in skeleton with regex pattern
|
|
278
|
+
var pattern = skeleton.replace(new RegExp(escapedVariable, "g"), "(.+)");
|
|
279
|
+
|
|
280
|
+
// Construct regex pattern with startsWith option
|
|
281
|
+
var regexPattern = startsWith ? "^".concat(pattern) : "".concat(pattern, "$");
|
|
282
|
+
|
|
283
|
+
// Create regex
|
|
284
|
+
var regex = new RegExp(regexPattern);
|
|
285
|
+
|
|
286
|
+
// Test if current URL matches regex pattern
|
|
287
|
+
return regex.test(currenturl);
|
|
278
288
|
};
|
|
279
289
|
|
|
280
290
|
// Checks if the given element is in viewport or not.
|
|
@@ -413,7 +423,7 @@
|
|
|
413
423
|
path = path.substring(0, index) + "svg:svg";
|
|
414
424
|
}
|
|
415
425
|
try {
|
|
416
|
-
return document.
|
|
426
|
+
return document.oDyD(path, document, function (prefix) {
|
|
417
427
|
if (prefix === "svg") {
|
|
418
428
|
return "http://www.w3.org/2000/svg";
|
|
419
429
|
} else {
|
|
@@ -473,18 +483,18 @@
|
|
|
473
483
|
var Audience = /*#__PURE__*/_createClass(function Audience() {
|
|
474
484
|
var _this = this;
|
|
475
485
|
_classCallCheck(this, Audience);
|
|
476
|
-
_defineProperty(this, "
|
|
477
|
-
_defineProperty(this, "
|
|
478
|
-
_defineProperty(this, "
|
|
486
|
+
_defineProperty(this, "vQHr", "ALL");
|
|
487
|
+
_defineProperty(this, "EkUf", []);
|
|
488
|
+
_defineProperty(this, "NGJy", []);
|
|
479
489
|
_defineProperty(this, "userAttributesValidated", true);
|
|
480
490
|
_defineProperty(this, "sessionAttributeValidated", true);
|
|
481
491
|
_defineProperty(this, "parse", function () {
|
|
482
492
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
483
493
|
try {
|
|
484
|
-
_this.
|
|
485
|
-
_this.
|
|
486
|
-
_this.
|
|
487
|
-
if (!Array.isArray(_this.
|
|
494
|
+
_this.vQHr = config.audience.audience_type;
|
|
495
|
+
_this.EkUf = config.audience.attributes.user;
|
|
496
|
+
_this.NGJy = config.audience.attributes.session;
|
|
497
|
+
if (!Array.isArray(_this.EkUf) || !Array.isArray(_this.NGJy)) {
|
|
488
498
|
Logger$1.error("No attributes");
|
|
489
499
|
return false;
|
|
490
500
|
}
|
|
@@ -496,11 +506,11 @@
|
|
|
496
506
|
});
|
|
497
507
|
_defineProperty(this, "validate", function (user, session) {
|
|
498
508
|
var status = true;
|
|
499
|
-
if (_this.
|
|
509
|
+
if (_this.vQHr === "FTU") {
|
|
500
510
|
status = Apxor.getController().getSessionInfo().is_first_session;
|
|
501
511
|
}
|
|
502
|
-
var userAttributesCompare = _this.
|
|
503
|
-
var sessionAttributesCompare = _this.
|
|
512
|
+
var userAttributesCompare = _this.mewV(user, _this.EkUf);
|
|
513
|
+
var sessionAttributesCompare = _this.mewV(session, _this.NGJy);
|
|
504
514
|
if (!userAttributesCompare) {
|
|
505
515
|
_this.userAttributesValidated = false;
|
|
506
516
|
}
|
|
@@ -509,7 +519,7 @@
|
|
|
509
519
|
}
|
|
510
520
|
return status && userAttributesCompare && sessionAttributesCompare;
|
|
511
521
|
});
|
|
512
|
-
_defineProperty(this, "
|
|
522
|
+
_defineProperty(this, "mewV", function (attributes, expected) {
|
|
513
523
|
var length = expected.length;
|
|
514
524
|
var status = true;
|
|
515
525
|
try {
|
|
@@ -557,7 +567,7 @@
|
|
|
557
567
|
} else if (type === "b") {
|
|
558
568
|
loggedValue = !!loggedValue;
|
|
559
569
|
}
|
|
560
|
-
return
|
|
570
|
+
return rCJW(loggedValue, configValue, operator);
|
|
561
571
|
});
|
|
562
572
|
});
|
|
563
573
|
status = status && match;
|
|
@@ -585,41 +595,41 @@
|
|
|
585
595
|
var Frequency = /*#__PURE__*/_createClass(function Frequency() {
|
|
586
596
|
var _this = this;
|
|
587
597
|
_classCallCheck(this, Frequency);
|
|
588
|
-
_defineProperty(this, "
|
|
589
|
-
_defineProperty(this, "
|
|
590
|
-
_defineProperty(this, "
|
|
591
|
-
_defineProperty(this, "
|
|
592
|
-
_defineProperty(this, "
|
|
593
|
-
_defineProperty(this, "
|
|
598
|
+
_defineProperty(this, "zsDa", 0);
|
|
599
|
+
_defineProperty(this, "Zbae", 0);
|
|
600
|
+
_defineProperty(this, "pZvl", "SESSION");
|
|
601
|
+
_defineProperty(this, "EOKT", 0);
|
|
602
|
+
_defineProperty(this, "ICpH", 0);
|
|
603
|
+
_defineProperty(this, "VzBo", 0);
|
|
594
604
|
_defineProperty(this, "parse", function () {
|
|
595
605
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
596
606
|
try {
|
|
597
|
-
_this.
|
|
598
|
-
_this.
|
|
599
|
-
_this.
|
|
600
|
-
if (_this.
|
|
601
|
-
_this.
|
|
602
|
-
}
|
|
603
|
-
_this.
|
|
604
|
-
_this.
|
|
605
|
-
_this.
|
|
606
|
-
_this.
|
|
607
|
+
_this.AoNu = config._id;
|
|
608
|
+
_this.jphx = config.meta;
|
|
609
|
+
_this.zsDa = config.frequency.count;
|
|
610
|
+
if (_this.zsDa === -1) {
|
|
611
|
+
_this.zsDa = 1000;
|
|
612
|
+
}
|
|
613
|
+
_this.VzBo = _this.zsDa;
|
|
614
|
+
_this.Zbae = config.frequency.time_interval;
|
|
615
|
+
_this.pZvl = config.frequency.validity;
|
|
616
|
+
_this.ICpH = config.frequency.ses_lmt;
|
|
607
617
|
_this._dayCount = config.frequency.day_lmt;
|
|
608
618
|
// let data = Apxor.getController().getFromStorage(QE_STATE);
|
|
609
619
|
// let qe_state = JSON.parse(decode(Apxor.getSiteId(), data));
|
|
610
620
|
var qe_state = CE.getInstance().getQeState();
|
|
611
621
|
if (!isDefined(qe_state) || !isDefined(qe_state[config._id])) return true;
|
|
612
|
-
if (_this.
|
|
613
|
-
_this.
|
|
614
|
-
if (_this.
|
|
615
|
-
_this.
|
|
622
|
+
if (_this.pZvl === "SESSION") {
|
|
623
|
+
_this.zsDa = parseInt(_this.zsDa) - parseInt(qe_state[config._id]["SESSION"]);
|
|
624
|
+
if (_this.zsDa <= 0) {
|
|
625
|
+
_this.zUZc("Session limit reached");
|
|
616
626
|
console.warn("Max count limit reached for session:" + config._id);
|
|
617
627
|
return false;
|
|
618
628
|
}
|
|
619
|
-
} else if (_this.
|
|
620
|
-
_this.
|
|
621
|
-
if (_this.
|
|
622
|
-
_this.
|
|
629
|
+
} else if (_this.pZvl === "OVERALL") {
|
|
630
|
+
_this.zsDa = parseInt(_this.zsDa) - parseInt(qe_state[config._id]["OVERALL"]);
|
|
631
|
+
if (_this.zsDa <= 0) {
|
|
632
|
+
_this.zUZc("Overall limit reached");
|
|
623
633
|
console.warn("Max count limit reached for overall:" + config._id);
|
|
624
634
|
return false;
|
|
625
635
|
}
|
|
@@ -633,32 +643,32 @@
|
|
|
633
643
|
}
|
|
634
644
|
return true;
|
|
635
645
|
});
|
|
636
|
-
_defineProperty(this, "
|
|
637
|
-
_this.
|
|
646
|
+
_defineProperty(this, "IwqI", function () {
|
|
647
|
+
_this.zsDa = _this.zsDa - 1;
|
|
638
648
|
});
|
|
639
649
|
_defineProperty(this, "getFrequencyCount", function () {
|
|
640
|
-
return _this.
|
|
650
|
+
return _this.zsDa;
|
|
641
651
|
});
|
|
642
|
-
_defineProperty(this, "
|
|
643
|
-
if (_this.
|
|
644
|
-
_this.
|
|
652
|
+
_defineProperty(this, "kPEn", function () {
|
|
653
|
+
if (_this.pZvl === "SESSION") {
|
|
654
|
+
_this.zsDa = _this.VzBo;
|
|
645
655
|
Logger$2.info("Campaign Limit reset");
|
|
646
656
|
}
|
|
647
657
|
});
|
|
648
658
|
/**
|
|
649
|
-
* @function
|
|
659
|
+
* @function mZDO
|
|
650
660
|
* @description Validates if the campaign count is with in the limits set in the config.
|
|
651
661
|
* @param {string} Config id
|
|
652
662
|
* @returns {boolean} true - If the Campaign limits are not reached
|
|
653
663
|
* false - Otherwise
|
|
654
664
|
*/
|
|
655
|
-
_defineProperty(this, "
|
|
665
|
+
_defineProperty(this, "mZDO", function (id) {
|
|
656
666
|
try {
|
|
657
|
-
if (_this.
|
|
658
|
-
if (_this.
|
|
659
|
-
_this.
|
|
660
|
-
} else if (_this.
|
|
661
|
-
_this.
|
|
667
|
+
if (_this.zsDa <= 0) {
|
|
668
|
+
if (_this.pZvl === "OVERALL") {
|
|
669
|
+
_this.zUZc("Overall limit reached");
|
|
670
|
+
} else if (_this.pZvl === "SESSION") {
|
|
671
|
+
_this.zUZc("Session limit reached");
|
|
662
672
|
}
|
|
663
673
|
return false;
|
|
664
674
|
}
|
|
@@ -670,11 +680,11 @@
|
|
|
670
680
|
if (!isDefined(qe_state) || !isDefined(qe_state[id])) return true;
|
|
671
681
|
|
|
672
682
|
//If the config has a session count limit set
|
|
673
|
-
if (_this.
|
|
674
|
-
var sessionCountInConfig = parseInt(_this.
|
|
683
|
+
if (_this.ICpH !== 0) {
|
|
684
|
+
var sessionCountInConfig = parseInt(_this.ICpH);
|
|
675
685
|
var thisSessionCount = parseInt(qe_state[id]["SESSION"]);
|
|
676
686
|
if (sessionCountInConfig - thisSessionCount <= 0) {
|
|
677
|
-
_this.
|
|
687
|
+
_this.zUZc("Session limit reached");
|
|
678
688
|
return false;
|
|
679
689
|
}
|
|
680
690
|
}
|
|
@@ -686,23 +696,23 @@
|
|
|
686
696
|
var dayCountInConfig = parseInt(_this._dayCount);
|
|
687
697
|
var thisDayCount = parseInt(((_qe_state$id = qe_state[id]) === null || _qe_state$id === void 0 ? void 0 : _qe_state$id.DATES[date]) || 0);
|
|
688
698
|
if (dayCountInConfig - thisDayCount <= 0) {
|
|
689
|
-
_this.
|
|
699
|
+
_this.zUZc("Day limit reached");
|
|
690
700
|
return false;
|
|
691
701
|
}
|
|
692
702
|
}
|
|
693
703
|
} catch (e) {
|
|
694
|
-
_this.
|
|
704
|
+
_this.zUZc("Error validating the frequency: ".concat(e));
|
|
695
705
|
Logger$2.error("Error validating the frequency:" + e);
|
|
696
706
|
}
|
|
697
707
|
return true;
|
|
698
708
|
});
|
|
699
|
-
_defineProperty(this, "
|
|
700
|
-
var _this$
|
|
709
|
+
_defineProperty(this, "zUZc", function (reason) {
|
|
710
|
+
var _this$jphx$attr;
|
|
701
711
|
Apxor === null || Apxor === void 0 || Apxor.logEvent("apx_non_eligible_user", {
|
|
702
|
-
apx_nudge_type: _this.
|
|
703
|
-
apx_nudge_id: _this.
|
|
704
|
-
apx_nudge_name: _this.
|
|
705
|
-
apx_variant_code: _this.
|
|
712
|
+
apx_nudge_type: _this.jphx.type === "SURVEY" ? "survey" : "campaign",
|
|
713
|
+
apx_nudge_id: _this.AoNu,
|
|
714
|
+
apx_nudge_name: _this.jphx.name,
|
|
715
|
+
apx_variant_code: _this.jphx.isExperiment || _this.jphx.only_context ? (_this$jphx$attr = _this.jphx.attr) === null || _this$jphx$attr === void 0 ? void 0 : _this$jphx$attr[APX_VARIANT_CODE] : "TG",
|
|
706
716
|
apx_failure_type: "warn",
|
|
707
717
|
apx_reason: reason
|
|
708
718
|
});
|
|
@@ -712,14 +722,14 @@
|
|
|
712
722
|
var Meta = /*#__PURE__*/_createClass(function Meta() {
|
|
713
723
|
var _this = this;
|
|
714
724
|
_classCallCheck(this, Meta);
|
|
715
|
-
_defineProperty(this, "
|
|
716
|
-
_defineProperty(this, "
|
|
725
|
+
_defineProperty(this, "gupk", "");
|
|
726
|
+
_defineProperty(this, "vQHr", "");
|
|
717
727
|
_defineProperty(this, "parse", function () {
|
|
718
728
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
719
729
|
try {
|
|
720
730
|
var _config$meta, _config$meta2;
|
|
721
|
-
_this.
|
|
722
|
-
_this.
|
|
731
|
+
_this.gupk = config.meta.name;
|
|
732
|
+
_this.vQHr = config.meta.type;
|
|
723
733
|
_this._only_context = config.meta.only_context;
|
|
724
734
|
_this._attr = ((_config$meta = config.meta) === null || _config$meta === void 0 ? void 0 : _config$meta.attr) || {};
|
|
725
735
|
_this._isExperiment = (_config$meta2 = config.meta) === null || _config$meta2 === void 0 ? void 0 : _config$meta2.isExperiment;
|
|
@@ -735,11 +745,11 @@
|
|
|
735
745
|
var Validity = /*#__PURE__*/_createClass(function Validity() {
|
|
736
746
|
var _this = this;
|
|
737
747
|
_classCallCheck(this, Validity);
|
|
738
|
-
_defineProperty(this, "
|
|
739
|
-
_defineProperty(this, "
|
|
740
|
-
_defineProperty(this, "
|
|
741
|
-
_defineProperty(this, "
|
|
742
|
-
_defineProperty(this, "
|
|
748
|
+
_defineProperty(this, "nrOa", -1);
|
|
749
|
+
_defineProperty(this, "qxkZ", -1);
|
|
750
|
+
_defineProperty(this, "FArj", -1);
|
|
751
|
+
_defineProperty(this, "olRt", -1);
|
|
752
|
+
_defineProperty(this, "VuyM", false);
|
|
743
753
|
_defineProperty(this, "_nudge_expired", false);
|
|
744
754
|
_defineProperty(this, "_not_yet_active", false);
|
|
745
755
|
_defineProperty(this, "_not_in_specified_time", false);
|
|
@@ -750,17 +760,17 @@
|
|
|
750
760
|
Logger$3.error("Not valid dates");
|
|
751
761
|
return false;
|
|
752
762
|
}
|
|
753
|
-
_this.
|
|
754
|
-
_this.
|
|
763
|
+
_this.nrOa = Date.parse(config.validity.start_date);
|
|
764
|
+
_this.qxkZ = Date.parse(config.validity.end_date);
|
|
755
765
|
if (isDefined(config.at_specific_time)) {
|
|
756
|
-
_this.
|
|
757
|
-
if (_this.
|
|
766
|
+
_this.VuyM = config.at_specific_time;
|
|
767
|
+
if (_this.VuyM && isDefined(config.time_limits)) {
|
|
758
768
|
var currentDate = new Date().toISOString().split("T")[0];
|
|
759
|
-
_this.
|
|
760
|
-
_this.
|
|
769
|
+
_this.FArj = Date.parse(currentDate + "T" + config.time_limits.start_time + ":00.000Z");
|
|
770
|
+
_this.olRt = Date.parse(currentDate + "T" + config.time_limits.end_time + ":00.000Z");
|
|
761
771
|
|
|
762
772
|
// If invalid format is passed, return false
|
|
763
|
-
if (isNaN(_this.
|
|
773
|
+
if (isNaN(_this.FArj) || isNaN(_this.olRt)) {
|
|
764
774
|
Logger$3.error("Not valid times");
|
|
765
775
|
return false;
|
|
766
776
|
}
|
|
@@ -774,14 +784,14 @@
|
|
|
774
784
|
});
|
|
775
785
|
_defineProperty(this, "validate", function () {
|
|
776
786
|
var currentTime = Date.now();
|
|
777
|
-
if (currentTime > _this.
|
|
778
|
-
if (_this.
|
|
787
|
+
if (currentTime > _this.nrOa && currentTime < _this.qxkZ) {
|
|
788
|
+
if (_this.VuyM && !(currentTime >= _this.FArj && currentTime <= _this.olRt)) {
|
|
779
789
|
_this._not_in_specified_time = true;
|
|
780
790
|
}
|
|
781
|
-
return !_this.
|
|
782
|
-
} else if (currentTime < _this.
|
|
791
|
+
return !_this.VuyM || currentTime >= _this.FArj && currentTime <= _this.olRt;
|
|
792
|
+
} else if (currentTime < _this.nrOa) {
|
|
783
793
|
_this._not_yet_active = true;
|
|
784
|
-
} else if (currentTime > _this.
|
|
794
|
+
} else if (currentTime > _this.qxkZ) {
|
|
785
795
|
_this._nudge_expired = true;
|
|
786
796
|
}
|
|
787
797
|
return false;
|
|
@@ -791,13 +801,13 @@
|
|
|
791
801
|
var Details = /*#__PURE__*/_createClass(function Details() {
|
|
792
802
|
var _this = this;
|
|
793
803
|
_classCallCheck(this, Details);
|
|
794
|
-
_defineProperty(this, "
|
|
795
|
-
_defineProperty(this, "
|
|
804
|
+
_defineProperty(this, "gupk", "");
|
|
805
|
+
_defineProperty(this, "KpkN", {});
|
|
796
806
|
_defineProperty(this, "parse", function () {
|
|
797
807
|
var details = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
798
808
|
try {
|
|
799
|
-
_this.
|
|
800
|
-
_this.
|
|
809
|
+
_this.gupk = details.name;
|
|
810
|
+
_this.KpkN = details.additional_info;
|
|
801
811
|
} catch (error) {
|
|
802
812
|
return false;
|
|
803
813
|
}
|
|
@@ -808,14 +818,14 @@
|
|
|
808
818
|
var Timebounds = /*#__PURE__*/_createClass(function Timebounds() {
|
|
809
819
|
var _this = this;
|
|
810
820
|
_classCallCheck(this, Timebounds);
|
|
811
|
-
_defineProperty(this, "
|
|
812
|
-
_defineProperty(this, "
|
|
821
|
+
_defineProperty(this, "yKaM", 0);
|
|
822
|
+
_defineProperty(this, "vQpB", 0);
|
|
813
823
|
_defineProperty(this, "parse", function () {
|
|
814
824
|
var timeBounds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
815
825
|
try {
|
|
816
|
-
_this.
|
|
817
|
-
_this.
|
|
818
|
-
if (isNaN(_this.
|
|
826
|
+
_this.yKaM = Number(timeBounds.lower);
|
|
827
|
+
_this.vQpB = Number(timeBounds.upper);
|
|
828
|
+
if (isNaN(_this.yKaM) || isNaN(_this.vQpB)) {
|
|
819
829
|
return false;
|
|
820
830
|
}
|
|
821
831
|
} catch (error) {
|
|
@@ -828,17 +838,17 @@
|
|
|
828
838
|
var PreCondition = /*#__PURE__*/_createClass(function PreCondition() {
|
|
829
839
|
var _this = this;
|
|
830
840
|
_classCallCheck(this, PreCondition);
|
|
831
|
-
_defineProperty(this, "
|
|
832
|
-
_defineProperty(this, "
|
|
833
|
-
_defineProperty(this, "
|
|
834
|
-
_defineProperty(this, "
|
|
835
|
-
_defineProperty(this, "
|
|
841
|
+
_defineProperty(this, "OEsw", 0);
|
|
842
|
+
_defineProperty(this, "WbUx", "");
|
|
843
|
+
_defineProperty(this, "OetQ", "");
|
|
844
|
+
_defineProperty(this, "CFvi", new Details());
|
|
845
|
+
_defineProperty(this, "Wgfq", new Timebounds());
|
|
836
846
|
_defineProperty(this, "parse", function () {
|
|
837
847
|
var precondition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
838
848
|
try {
|
|
839
|
-
_this.
|
|
840
|
-
_this.
|
|
841
|
-
return _this.
|
|
849
|
+
_this.WbUx = precondition.event_type;
|
|
850
|
+
_this.OetQ = precondition.activity;
|
|
851
|
+
return _this.CFvi.parse(precondition.details) && _this.Wgfq.parse(precondition.time_bounds);
|
|
842
852
|
} catch (error) {
|
|
843
853
|
return false;
|
|
844
854
|
}
|
|
@@ -849,29 +859,29 @@
|
|
|
849
859
|
var Condition = /*#__PURE__*/_createClass(function Condition() {
|
|
850
860
|
var _this = this;
|
|
851
861
|
_classCallCheck(this, Condition);
|
|
852
|
-
_defineProperty(this, "
|
|
853
|
-
_defineProperty(this, "
|
|
854
|
-
_defineProperty(this, "
|
|
855
|
-
_defineProperty(this, "
|
|
856
|
-
_defineProperty(this, "
|
|
857
|
-
_defineProperty(this, "
|
|
858
|
-
_defineProperty(this, "
|
|
859
|
-
_defineProperty(this, "
|
|
860
|
-
_defineProperty(this, "
|
|
861
|
-
_defineProperty(this, "
|
|
862
|
-
_defineProperty(this, "
|
|
863
|
-
_defineProperty(this, "
|
|
862
|
+
_defineProperty(this, "OEsw", 0);
|
|
863
|
+
_defineProperty(this, "BjRo", -1);
|
|
864
|
+
_defineProperty(this, "zsDa", 0);
|
|
865
|
+
_defineProperty(this, "MswC", "");
|
|
866
|
+
_defineProperty(this, "OetQ", "");
|
|
867
|
+
_defineProperty(this, "WbUx", "");
|
|
868
|
+
_defineProperty(this, "Wgfq", new Timebounds());
|
|
869
|
+
_defineProperty(this, "CFvi", new Details());
|
|
870
|
+
_defineProperty(this, "HNyi", new PreCondition());
|
|
871
|
+
_defineProperty(this, "FFrw", "AND");
|
|
872
|
+
_defineProperty(this, "WPkH", false);
|
|
873
|
+
_defineProperty(this, "vQHr", void 0);
|
|
864
874
|
_defineProperty(this, "parse", function () {
|
|
865
875
|
var condition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
866
876
|
try {
|
|
867
|
-
_this.
|
|
868
|
-
_this.
|
|
869
|
-
_this.
|
|
870
|
-
_this.
|
|
871
|
-
_this.
|
|
872
|
-
_this.
|
|
873
|
-
_this.
|
|
874
|
-
return _this.
|
|
877
|
+
_this.BjRo = condition.sequence;
|
|
878
|
+
_this.zsDa = condition.count_config.count;
|
|
879
|
+
_this.MswC = condition.count_config.operator;
|
|
880
|
+
_this.OetQ = condition.activity;
|
|
881
|
+
_this.WbUx = condition.event_type;
|
|
882
|
+
_this.FFrw = condition.combine_operator;
|
|
883
|
+
_this.vQHr = condition.type;
|
|
884
|
+
return _this.CFvi.parse(condition.details) && _this.HNyi.parse(condition.trigger) && _this.Wgfq.parse(condition.time_bounds);
|
|
875
885
|
} catch (error) {
|
|
876
886
|
Logger$4.error(error);
|
|
877
887
|
return false;
|
|
@@ -883,19 +893,19 @@
|
|
|
883
893
|
var GoalEvent = /*#__PURE__*/_createClass(function GoalEvent() {
|
|
884
894
|
var _this = this;
|
|
885
895
|
_classCallCheck(this, GoalEvent);
|
|
886
|
-
_defineProperty(this, "
|
|
887
|
-
_defineProperty(this, "
|
|
888
|
-
_defineProperty(this, "
|
|
889
|
-
_defineProperty(this, "
|
|
890
|
-
_defineProperty(this, "
|
|
891
|
-
_defineProperty(this, "
|
|
896
|
+
_defineProperty(this, "zsDa", 0);
|
|
897
|
+
_defineProperty(this, "MswC", "");
|
|
898
|
+
_defineProperty(this, "WbUx", "");
|
|
899
|
+
_defineProperty(this, "Wgfq", new Timebounds());
|
|
900
|
+
_defineProperty(this, "CFvi", new Details());
|
|
901
|
+
_defineProperty(this, "FFrw", "AND");
|
|
892
902
|
_defineProperty(this, "parse", function (data) {
|
|
893
903
|
try {
|
|
894
|
-
_this.
|
|
895
|
-
_this.
|
|
896
|
-
_this.
|
|
897
|
-
_this.
|
|
898
|
-
return _this.
|
|
904
|
+
_this.zsDa = data.count_config.count;
|
|
905
|
+
_this.MswC = data.count_config.operator;
|
|
906
|
+
_this.WbUx = data.event_type;
|
|
907
|
+
_this.FFrw = data.combine_operator;
|
|
908
|
+
return _this.CFvi.parse(data.details) && _this.Wgfq.parse(data.time_bounds);
|
|
899
909
|
} catch (error) {
|
|
900
910
|
Logger$5.error(error);
|
|
901
911
|
return false;
|
|
@@ -909,21 +919,21 @@
|
|
|
909
919
|
function ConditionValidator() {
|
|
910
920
|
var _this = this;
|
|
911
921
|
_classCallCheck(this, ConditionValidator);
|
|
912
|
-
_defineProperty(this, "
|
|
913
|
-
_defineProperty(this, "
|
|
914
|
-
_defineProperty(this, "
|
|
915
|
-
_defineProperty(this, "
|
|
916
|
-
_defineProperty(this, "
|
|
917
|
-
_defineProperty(this, "
|
|
918
|
-
_defineProperty(this, "
|
|
919
|
-
_defineProperty(this, "
|
|
920
|
-
_defineProperty(this, "
|
|
921
|
-
_defineProperty(this, "
|
|
922
|
-
_defineProperty(this, "
|
|
923
|
-
_defineProperty(this, "
|
|
924
|
-
_defineProperty(this, "
|
|
922
|
+
_defineProperty(this, "pNtt", 0);
|
|
923
|
+
_defineProperty(this, "AoNu", "");
|
|
924
|
+
_defineProperty(this, "iMyo", new Condition());
|
|
925
|
+
_defineProperty(this, "DyWf", new GoalEvent());
|
|
926
|
+
_defineProperty(this, "KdMS", false);
|
|
927
|
+
_defineProperty(this, "fhfE", false);
|
|
928
|
+
_defineProperty(this, "rcqQ", 0);
|
|
929
|
+
_defineProperty(this, "FFrw", "AND");
|
|
930
|
+
_defineProperty(this, "eaiu", "OR");
|
|
931
|
+
_defineProperty(this, "LVWF", -1);
|
|
932
|
+
_defineProperty(this, "bwYu", []);
|
|
933
|
+
_defineProperty(this, "yutB", {});
|
|
934
|
+
_defineProperty(this, "PhyY", false);
|
|
925
935
|
/**
|
|
926
|
-
* If respectSequence is true, don't auto-
|
|
936
|
+
* If respectSequence is true, don't auto-YsUo to events except for the condition whose index is 0
|
|
927
937
|
*
|
|
928
938
|
* @param condition
|
|
929
939
|
* @param type
|
|
@@ -939,191 +949,191 @@
|
|
|
939
949
|
var respectSequence = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
940
950
|
var noKpiArray = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
|
|
941
951
|
var flag = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : "";
|
|
942
|
-
_this.
|
|
943
|
-
_this.
|
|
944
|
-
_this.
|
|
952
|
+
_this.AoNu = id;
|
|
953
|
+
_this.rcqQ = index;
|
|
954
|
+
_this.bwYu = noKpiArray;
|
|
945
955
|
if (flag !== "termination" || flag === "") {
|
|
946
|
-
var result = _this.
|
|
956
|
+
var result = _this.iMyo.parse(condition);
|
|
947
957
|
if (result) {
|
|
948
|
-
_this.
|
|
958
|
+
_this.FFrw = _this.iMyo.FFrw;
|
|
949
959
|
|
|
950
960
|
// FIXME: Why this code is written? Don't see any usecase
|
|
951
|
-
if (_this.
|
|
952
|
-
var eventName = _this.
|
|
961
|
+
if (_this.iMyo.WPkH) {
|
|
962
|
+
var eventName = _this.iMyo.CFvi.gupk;
|
|
953
963
|
if (eventName === "APX_PAGE_OPENED") {
|
|
954
|
-
eventName = _this.
|
|
955
|
-
eventName = isDefined(eventName) ? eventName : _this.
|
|
964
|
+
eventName = _this.iMyo.CFvi.KpkN["navigation_id"];
|
|
965
|
+
eventName = isDefined(eventName) ? eventName : _this.iMyo.CFvi.gupk;
|
|
956
966
|
}
|
|
957
|
-
_this.
|
|
958
|
-
var count = _this.
|
|
959
|
-
var operator = _this.
|
|
960
|
-
_this.
|
|
961
|
-
_this.
|
|
962
|
-
// If the condition is already satisfied and if it is page view, no need to
|
|
967
|
+
_this.LVWF = Apxor.getController().getEventCount(eventName);
|
|
968
|
+
var count = _this.iMyo.zsDa;
|
|
969
|
+
var operator = _this.iMyo.MswC;
|
|
970
|
+
_this.fhfE = _this.MLKC(_this.LVWF - 1, count, operator, false);
|
|
971
|
+
_this.KdMS = _this.fhfE;
|
|
972
|
+
// If the condition is already satisfied and if it is page view, no need to YsUo
|
|
963
973
|
// This only applies for NAVIGATION_EVENTS
|
|
964
|
-
if (_this.
|
|
974
|
+
if (_this.fhfE && _this.iMyo.CFvi.gupk === "APX_PAGE_OPENED") {
|
|
965
975
|
return true;
|
|
966
976
|
}
|
|
967
977
|
}
|
|
968
978
|
if (!respectSequence || index === 0) {
|
|
969
|
-
_this.
|
|
979
|
+
_this.YsUo();
|
|
970
980
|
}
|
|
971
981
|
return true;
|
|
972
982
|
}
|
|
973
983
|
} else {
|
|
974
|
-
var _result = _this.
|
|
975
|
-
_this.
|
|
976
|
-
_this.
|
|
984
|
+
var _result = _this.DyWf.parse(condition);
|
|
985
|
+
_this.eaiu = _this.DyWf.FFrw;
|
|
986
|
+
_this.LxhK();
|
|
977
987
|
return true;
|
|
978
988
|
}
|
|
979
989
|
return false;
|
|
980
990
|
});
|
|
981
|
-
_defineProperty(this, "
|
|
991
|
+
_defineProperty(this, "YsUo", function () {
|
|
982
992
|
var _window$ApxorRTM;
|
|
983
|
-
var condition = _this.
|
|
984
|
-
var precondition = condition.
|
|
993
|
+
var condition = _this.iMyo;
|
|
994
|
+
var precondition = condition.HNyi;
|
|
985
995
|
var ceInstance = CE.getInstance();
|
|
986
|
-
if (precondition.
|
|
987
|
-
_this.
|
|
988
|
-
ceInstance.registerForEvent(generateKey(condition.
|
|
996
|
+
if (precondition.WbUx === "app_start") {
|
|
997
|
+
_this.KdMS = true;
|
|
998
|
+
ceInstance.registerForEvent(generateKey(condition.WbUx) + "___" + condition.CFvi.gupk, _this.hHrw);
|
|
989
999
|
} else {
|
|
990
|
-
ceInstance.registerForEvent(generateKey(condition.
|
|
1000
|
+
ceInstance.registerForEvent(generateKey(condition.WbUx) + "___" + precondition.CFvi.gupk, _this.hHrw);
|
|
991
1001
|
}
|
|
992
|
-
if ((_window$ApxorRTM = window.ApxorRTM) !== null && _window$ApxorRTM !== void 0 && _window$ApxorRTM.badgesLists.includes(_this.
|
|
993
|
-
ceInstance.registerForEvent(generateKey(condition.
|
|
1002
|
+
if ((_window$ApxorRTM = window.ApxorRTM) !== null && _window$ApxorRTM !== void 0 && _window$ApxorRTM.badgesLists.includes(_this.AoNu)) {
|
|
1003
|
+
ceInstance.registerForEvent(generateKey(condition.WbUx) + "___" + "apxor-badge-container-".concat("-".concat(_this.AoNu).replaceAll(" ", "").replace(/[^\w\s]/gi, "")), _this.hHrw);
|
|
994
1004
|
}
|
|
995
1005
|
});
|
|
996
|
-
_defineProperty(this, "
|
|
997
|
-
var condition = _this.
|
|
1006
|
+
_defineProperty(this, "LxhK", function () {
|
|
1007
|
+
var condition = _this.DyWf;
|
|
998
1008
|
var ceInstance = CE.getInstance();
|
|
999
|
-
_this.
|
|
1000
|
-
ceInstance.registerForEvent(generateKey(condition.
|
|
1009
|
+
_this.KdMS = true;
|
|
1010
|
+
ceInstance.registerForEvent(generateKey(condition.WbUx) + "___" + condition.CFvi.gupk, _this.genu);
|
|
1001
1011
|
});
|
|
1002
|
-
_defineProperty(this, "
|
|
1003
|
-
var _this$
|
|
1012
|
+
_defineProperty(this, "IrBm", function (type, name, time, additionalInfo) {
|
|
1013
|
+
var _this$iMyo;
|
|
1004
1014
|
var eventTime = Date.now();
|
|
1005
|
-
var time_differnce = (eventTime - _this.
|
|
1006
|
-
var time_fromConfig = ((_this$
|
|
1015
|
+
var time_differnce = (eventTime - _this.yutB[name]) / 1000;
|
|
1016
|
+
var time_fromConfig = ((_this$iMyo = _this.iMyo) === null || _this$iMyo === void 0 || (_this$iMyo = _this$iMyo.CFvi) === null || _this$iMyo === void 0 || (_this$iMyo = _this$iMyo.KpkN) === null || _this$iMyo === void 0 ? void 0 : _this$iMyo.time) / 1000;
|
|
1007
1017
|
if (time_fromConfig > time_differnce) {
|
|
1008
1018
|
_this._displayCampaign(time);
|
|
1009
1019
|
}
|
|
1010
1020
|
});
|
|
1011
|
-
_defineProperty(this, "
|
|
1021
|
+
_defineProperty(this, "yYUn", function (type, name, time, additionalInfo) {
|
|
1012
1022
|
var _this$_condition2, _this$_condition3;
|
|
1013
|
-
_this.
|
|
1023
|
+
_this.PhyY = true;
|
|
1014
1024
|
var currentTime = Date.now();
|
|
1015
|
-
var eventName = (_this$_condition2 = _this.
|
|
1016
|
-
var eventTime = _this.
|
|
1025
|
+
var eventName = (_this$_condition2 = _this.iMyo) === null || _this$_condition2 === void 0 || (_this$_condition2 = _this$_condition2.HNyi) === null || _this$_condition2 === void 0 ? void 0 : _this$_condition2.CFvi.gupk;
|
|
1026
|
+
var eventTime = _this.yutB[eventName];
|
|
1017
1027
|
var time_differnce = (currentTime - eventTime) / 1000;
|
|
1018
|
-
var time_fromConfig = (_this$_condition3 = _this.
|
|
1028
|
+
var time_fromConfig = (_this$_condition3 = _this.iMyo) === null || _this$_condition3 === void 0 || (_this$_condition3 = _this$_condition3.CFvi) === null || _this$_condition3 === void 0 || (_this$_condition3 = _this$_condition3.KpkN) === null || _this$_condition3 === void 0 ? void 0 : _this$_condition3.time;
|
|
1019
1029
|
time_fromConfig = time_fromConfig / 1000;
|
|
1020
1030
|
if (time_fromConfig > time_differnce) {
|
|
1021
1031
|
_this._displayCampaign(time);
|
|
1022
1032
|
}
|
|
1023
1033
|
//unregister the event
|
|
1024
1034
|
});
|
|
1025
|
-
_defineProperty(this, "
|
|
1035
|
+
_defineProperty(this, "hHrw", function (type, name, time, additionalInfo) {
|
|
1026
1036
|
var _window$ApxorRTM2, _window$ApxorRTM3;
|
|
1027
1037
|
var ceInstance = CE.getInstance();
|
|
1028
|
-
if (!_this.
|
|
1038
|
+
if (!_this.KdMS) {
|
|
1029
1039
|
// Validate Precondition
|
|
1030
|
-
_this.
|
|
1031
|
-
if (_this.
|
|
1032
|
-
var condition = _this.
|
|
1033
|
-
var precondition = condition.
|
|
1034
|
-
precondition.
|
|
1040
|
+
_this.KdMS = _this.LkpV(type, name, time, additionalInfo);
|
|
1041
|
+
if (_this.KdMS) {
|
|
1042
|
+
var condition = _this.iMyo;
|
|
1043
|
+
var precondition = condition.HNyi;
|
|
1044
|
+
precondition.OEsw = time;
|
|
1035
1045
|
//events will be registred by its type activity event_type: "activity_time"
|
|
1036
|
-
if ((condition === null || condition === void 0 ? void 0 : condition.
|
|
1037
|
-
var
|
|
1038
|
-
var event_time = condition === null || condition === void 0 || (
|
|
1039
|
-
if ((condition === null || condition === void 0 || (
|
|
1046
|
+
if ((condition === null || condition === void 0 ? void 0 : condition.WbUx) === "activity_time") {
|
|
1047
|
+
var iMyo$CFvi, iMyo$_details2, iMyo$_details3;
|
|
1048
|
+
var event_time = condition === null || condition === void 0 || (iMyo$CFvi = condition.CFvi) === null || iMyo$CFvi === void 0 || (iMyo$CFvi = iMyo$CFvi.KpkN) === null || iMyo$CFvi === void 0 ? void 0 : iMyo$CFvi.time;
|
|
1049
|
+
if ((condition === null || condition === void 0 || (iMyo$_details2 = condition.CFvi) === null || iMyo$_details2 === void 0 || (iMyo$_details2 = iMyo$_details2.KpkN) === null || iMyo$_details2 === void 0 ? void 0 : iMyo$_details2.nkpi.length) > 0) {
|
|
1040
1050
|
setTimeout(function () {
|
|
1041
|
-
if (!_this.
|
|
1042
|
-
_this.
|
|
1043
|
-
if (_this.
|
|
1044
|
-
_this.
|
|
1045
|
-
_this.
|
|
1046
|
-
if (_this.
|
|
1047
|
-
_this.
|
|
1048
|
-
ceInstance.validate(_this.
|
|
1051
|
+
if (!_this.PhyY) {
|
|
1052
|
+
_this.fhfE = true;
|
|
1053
|
+
if (_this.fhfE) {
|
|
1054
|
+
_this.pNtt += 1;
|
|
1055
|
+
_this.fhfE = _this.MLKC(_this.pNtt, _this.iMyo.zsDa, _this.iMyo.MswC);
|
|
1056
|
+
if (_this.fhfE) {
|
|
1057
|
+
_this.iMyo.OEsw = time;
|
|
1058
|
+
ceInstance.validate(_this.AoNu, _this.rcqQ);
|
|
1049
1059
|
}
|
|
1050
1060
|
}
|
|
1051
1061
|
}
|
|
1052
|
-
condition.
|
|
1053
|
-
ceInstance.unregisterFromEvent(toUpperCase(condition.
|
|
1062
|
+
condition.CFvi.KpkN.nkpi.map(function (nokpi) {
|
|
1063
|
+
ceInstance.unregisterFromEvent(toUpperCase(condition.CFvi.KpkN.et) + "___" + nokpi, _this);
|
|
1054
1064
|
});
|
|
1055
1065
|
}, event_time);
|
|
1056
|
-
condition.
|
|
1057
|
-
ceInstance.registerForEvent(toUpperCase(condition.
|
|
1066
|
+
condition.CFvi.KpkN.nkpi.map(function (nokpi) {
|
|
1067
|
+
ceInstance.registerForEvent(toUpperCase(condition.CFvi.KpkN.et) + "___" + nokpi, _this.yYUn);
|
|
1058
1068
|
});
|
|
1059
1069
|
}
|
|
1060
1070
|
//it is for unregistering the events did case after completing the time imit
|
|
1061
|
-
if ((condition === null || condition === void 0 || (
|
|
1071
|
+
if ((condition === null || condition === void 0 || (iMyo$_details3 = condition.CFvi) === null || iMyo$_details3 === void 0 || (iMyo$_details3 = iMyo$_details3.KpkN) === null || iMyo$_details3 === void 0 ? void 0 : iMyo$_details3.kpi.length) > 0) {
|
|
1062
1072
|
setTimeout(function () {
|
|
1063
|
-
condition.
|
|
1064
|
-
ceInstance.unregisterFromEvent(toUpperCase(condition.
|
|
1073
|
+
condition.CFvi.KpkN.kpi.map(function (kpi) {
|
|
1074
|
+
ceInstance.unregisterFromEvent(toUpperCase(condition.CFvi.KpkN.et) + "___" + kpi, _this);
|
|
1065
1075
|
});
|
|
1066
1076
|
}, event_time);
|
|
1067
|
-
condition.
|
|
1068
|
-
if (kpi === condition.
|
|
1077
|
+
condition.CFvi.KpkN.kpi.map(function (kpi) {
|
|
1078
|
+
if (kpi === condition.HNyi.CFvi.gupk) {
|
|
1069
1079
|
//unregister the previous event
|
|
1070
|
-
ceInstance.unregisterFromEvent(generateKey(precondition.
|
|
1071
|
-
ceInstance.registerForEvent(toUpperCase(condition.
|
|
1080
|
+
ceInstance.unregisterFromEvent(generateKey(precondition.WbUx) + "___" + precondition.CFvi.gupk, _this);
|
|
1081
|
+
ceInstance.registerForEvent(toUpperCase(condition.CFvi.KpkN.et) + "___" + kpi, _this.IrBm);
|
|
1072
1082
|
} else {
|
|
1073
|
-
ceInstance.registerForEvent(toUpperCase(condition.
|
|
1083
|
+
ceInstance.registerForEvent(toUpperCase(condition.CFvi.KpkN.et) + "___" + kpi, _this.yYUn);
|
|
1074
1084
|
}
|
|
1075
1085
|
});
|
|
1076
1086
|
}
|
|
1077
1087
|
} else {
|
|
1078
|
-
ceInstance.unregisterFromEvent(generateKey(precondition.
|
|
1079
|
-
ceInstance.registerForEvent(generateKey(condition.
|
|
1088
|
+
ceInstance.unregisterFromEvent(generateKey(precondition.WbUx) + "___" + precondition.CFvi.gupk, _this);
|
|
1089
|
+
ceInstance.registerForEvent(generateKey(condition.WbUx) + "___" + condition.CFvi.gupk, _this);
|
|
1080
1090
|
}
|
|
1081
|
-
_this.
|
|
1091
|
+
_this.yutB[name] = Date.now();
|
|
1082
1092
|
}
|
|
1083
1093
|
return;
|
|
1084
1094
|
}
|
|
1085
|
-
if ((_window$ApxorRTM2 = window.ApxorRTM) !== null && _window$ApxorRTM2 !== void 0 && _window$ApxorRTM2.isBadgePresent && (_window$ApxorRTM3 = window.ApxorRTM) !== null && _window$ApxorRTM3 !== void 0 && _window$ApxorRTM3.badgesLists.includes(_this.
|
|
1086
|
-
_this.
|
|
1087
|
-
_this.
|
|
1088
|
-
ceInstance.validate(_this.
|
|
1095
|
+
if ((_window$ApxorRTM2 = window.ApxorRTM) !== null && _window$ApxorRTM2 !== void 0 && _window$ApxorRTM2.isBadgePresent && (_window$ApxorRTM3 = window.ApxorRTM) !== null && _window$ApxorRTM3 !== void 0 && _window$ApxorRTM3.badgesLists.includes(_this.AoNu) && Apxor.getController().isBadgeTriggerSatisfied(_this.AoNu)) {
|
|
1096
|
+
_this.fhfE = true;
|
|
1097
|
+
_this.iMyo.OEsw = time;
|
|
1098
|
+
ceInstance.validate(_this.AoNu, _this.rcqQ);
|
|
1089
1099
|
return;
|
|
1090
1100
|
}
|
|
1091
1101
|
|
|
1092
1102
|
// Validate Condition
|
|
1093
|
-
var validationStatus = generateKey(_this.
|
|
1103
|
+
var validationStatus = generateKey(_this.iMyo.WbUx) === type && _this.mail(time - _this.iMyo.HNyi.OEsw, _this.iMyo.Wgfq) && _this.iMyo.CFvi.gupk === name && _this.lIBK(_this.iMyo.CFvi.KpkN, additionalInfo);
|
|
1094
1104
|
if (validationStatus) {
|
|
1095
|
-
_this.
|
|
1096
|
-
_this.
|
|
1097
|
-
if (_this.
|
|
1098
|
-
_this.
|
|
1099
|
-
ceInstance.validate(_this.
|
|
1105
|
+
_this.pNtt += 1;
|
|
1106
|
+
_this.fhfE = _this.MLKC(_this.pNtt, _this.iMyo.zsDa, _this.iMyo.MswC);
|
|
1107
|
+
if (_this.fhfE) {
|
|
1108
|
+
_this.iMyo.OEsw = time;
|
|
1109
|
+
ceInstance.validate(_this.AoNu, _this.rcqQ);
|
|
1100
1110
|
}
|
|
1101
1111
|
}
|
|
1102
1112
|
});
|
|
1103
|
-
_defineProperty(this, "
|
|
1113
|
+
_defineProperty(this, "genu", function (type, name, time, additionalInfo) {
|
|
1104
1114
|
var ceInstance = CE.getInstance();
|
|
1105
|
-
var validationStatus = generateKey(_this.
|
|
1115
|
+
var validationStatus = generateKey(_this.DyWf.WbUx) === type && _this.mail(time, _this.DyWf.Wgfq) && _this.DyWf.CFvi.gupk === name && _this.lIBK(_this.DyWf.CFvi.KpkN, additionalInfo);
|
|
1106
1116
|
if (validationStatus) {
|
|
1107
|
-
_this.
|
|
1108
|
-
_this.
|
|
1109
|
-
if (_this.
|
|
1110
|
-
_this.
|
|
1111
|
-
ceInstance.validateForTermination(_this.
|
|
1117
|
+
_this.pNtt += 1;
|
|
1118
|
+
_this.fhfE = _this.MLKC(_this.pNtt, _this.DyWf.zsDa, _this.DyWf.MswC);
|
|
1119
|
+
if (_this.fhfE) {
|
|
1120
|
+
_this.DyWf.OEsw = time;
|
|
1121
|
+
ceInstance.validateForTermination(_this.AoNu, _this.rcqQ);
|
|
1112
1122
|
}
|
|
1113
1123
|
}
|
|
1114
1124
|
});
|
|
1115
|
-
_defineProperty(this, "
|
|
1116
|
-
var precondition = _this.
|
|
1117
|
-
return generateKey(precondition.
|
|
1125
|
+
_defineProperty(this, "LkpV", function (type, name, time, additionalInfo) {
|
|
1126
|
+
var precondition = _this.iMyo.HNyi;
|
|
1127
|
+
return generateKey(precondition.WbUx) === type && precondition.CFvi.gupk === name && _this.mail(time, precondition.Wgfq) && _this.lIBK(precondition.CFvi.KpkN, additionalInfo);
|
|
1118
1128
|
});
|
|
1119
|
-
_defineProperty(this, "
|
|
1129
|
+
_defineProperty(this, "mail", function (time, timeBounds) {
|
|
1120
1130
|
var currentTime = Math.ceil(time);
|
|
1121
|
-
return currentTime > timeBounds.
|
|
1131
|
+
return currentTime > timeBounds.yKaM && currentTime < timeBounds.vQpB;
|
|
1122
1132
|
});
|
|
1123
|
-
_defineProperty(this, "
|
|
1133
|
+
_defineProperty(this, "MLKC", function (current, required, operator) {
|
|
1124
1134
|
var checkOld = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
1125
|
-
if (checkOld && _this.
|
|
1126
|
-
current = current + _this.
|
|
1135
|
+
if (checkOld && _this.iMyo.WPkH) {
|
|
1136
|
+
current = current + _this.LVWF;
|
|
1127
1137
|
}
|
|
1128
1138
|
switch (operator) {
|
|
1129
1139
|
case "EQ":
|
|
@@ -1140,7 +1150,7 @@
|
|
|
1140
1150
|
return false;
|
|
1141
1151
|
}
|
|
1142
1152
|
});
|
|
1143
|
-
_defineProperty(this, "
|
|
1153
|
+
_defineProperty(this, "lIBK", function (expected, received) {
|
|
1144
1154
|
var status = true;
|
|
1145
1155
|
try {
|
|
1146
1156
|
var _loop = function _loop() {
|
|
@@ -1185,14 +1195,14 @@
|
|
|
1185
1195
|
} else if (type === "b") {
|
|
1186
1196
|
loggedValue = !!loggedValue;
|
|
1187
1197
|
}
|
|
1188
|
-
return
|
|
1198
|
+
return rCJW(loggedValue, expectedValue, operator);
|
|
1189
1199
|
}
|
|
1190
|
-
//
|
|
1200
|
+
// rCJW(loggedValue, expectedValue, operator)
|
|
1191
1201
|
);
|
|
1192
1202
|
|
|
1193
1203
|
status = status && match;
|
|
1194
1204
|
} else {
|
|
1195
|
-
status = status &&
|
|
1205
|
+
status = status && rCJW(received[item], expected[item], "EQ");
|
|
1196
1206
|
}
|
|
1197
1207
|
},
|
|
1198
1208
|
_ret;
|
|
@@ -1211,13 +1221,13 @@
|
|
|
1211
1221
|
key: "_displayCampaign",
|
|
1212
1222
|
value: function _displayCampaign(time) {
|
|
1213
1223
|
var ceInstance = CE.getInstance();
|
|
1214
|
-
this.
|
|
1215
|
-
if (this.
|
|
1216
|
-
this.
|
|
1217
|
-
this.
|
|
1218
|
-
if (this.
|
|
1219
|
-
this.
|
|
1220
|
-
ceInstance.validate(this.
|
|
1224
|
+
this.fhfE = true;
|
|
1225
|
+
if (this.fhfE) {
|
|
1226
|
+
this.pNtt += 1;
|
|
1227
|
+
this.fhfE = this.MLKC(this.pNtt, this.iMyo.zsDa, this.iMyo.MswC);
|
|
1228
|
+
if (this.fhfE) {
|
|
1229
|
+
this.iMyo.OEsw = time;
|
|
1230
|
+
ceInstance.validate(this.AoNu, this.rcqQ);
|
|
1221
1231
|
}
|
|
1222
1232
|
}
|
|
1223
1233
|
}
|
|
@@ -1229,11 +1239,11 @@
|
|
|
1229
1239
|
var OverallConfig = /*#__PURE__*/_createClass(function OverallConfig() {
|
|
1230
1240
|
var _this = this;
|
|
1231
1241
|
_classCallCheck(this, OverallConfig);
|
|
1232
|
-
_defineProperty(this, "
|
|
1242
|
+
_defineProperty(this, "QZJr", []);
|
|
1233
1243
|
_defineProperty(this, "_ret_day", {});
|
|
1234
|
-
_defineProperty(this, "
|
|
1235
|
-
_defineProperty(this, "
|
|
1236
|
-
_defineProperty(this, "
|
|
1244
|
+
_defineProperty(this, "iruA", {});
|
|
1245
|
+
_defineProperty(this, "cSvr", false);
|
|
1246
|
+
_defineProperty(this, "KIXo", false);
|
|
1237
1247
|
_defineProperty(this, "retainedDaysValidated", true);
|
|
1238
1248
|
_defineProperty(this, "retainedSessionValidated", true);
|
|
1239
1249
|
_defineProperty(this, "eventDoneInLT", false);
|
|
@@ -1241,11 +1251,11 @@
|
|
|
1241
1251
|
_defineProperty(this, "parse", function () {
|
|
1242
1252
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1243
1253
|
try {
|
|
1244
|
-
_this.
|
|
1254
|
+
_this.QZJr = config.overall_cfg.events;
|
|
1245
1255
|
_this._ret_day = config.overall_cfg.ret_day;
|
|
1246
|
-
_this.
|
|
1247
|
-
_this.
|
|
1248
|
-
_this.
|
|
1256
|
+
_this.iruA = config.overall_cfg.session;
|
|
1257
|
+
_this.cSvr = config.overall_cfg.toggleRetDay;
|
|
1258
|
+
_this.KIXo = config.overall_cfg.toggleSession;
|
|
1249
1259
|
} catch (error) {
|
|
1250
1260
|
Logger$7.error(error);
|
|
1251
1261
|
return false;
|
|
@@ -1255,11 +1265,11 @@
|
|
|
1255
1265
|
_defineProperty(this, "validate", function () {
|
|
1256
1266
|
var retainedDays = parseInt(Apxor.getController().getFromStorage(APX_RETAINED_DAYS));
|
|
1257
1267
|
var retainedSession = parseInt(Apxor.getController().getFromStorage(APX_RETAINED_SESSIONS));
|
|
1258
|
-
if (_this.
|
|
1268
|
+
if (_this.cSvr && !isNaN(retainedDays) && !(retainedDays >= _this._ret_day.from && retainedDays <= _this._ret_day.to)) {
|
|
1259
1269
|
_this.retainedDaysValidated = false;
|
|
1260
1270
|
return false;
|
|
1261
1271
|
}
|
|
1262
|
-
if (_this.
|
|
1272
|
+
if (_this.KIXo && !isNaN(retainedSession) && !(retainedSession >= _this.iruA.from && retainedSession <= _this.iruA.to)) {
|
|
1263
1273
|
_this.retainedSessionValidated = false;
|
|
1264
1274
|
return false;
|
|
1265
1275
|
}
|
|
@@ -1268,8 +1278,8 @@
|
|
|
1268
1278
|
var data = Apxor.getController().getFromStorage("_apx_lt_count");
|
|
1269
1279
|
var siteid = Apxor.getSiteId();
|
|
1270
1280
|
var LtCountObjDecoded = JSON.parse(new TextDecoder().decode(stringToArrayBuffer(decode(siteid, data))));
|
|
1271
|
-
for (var i = 0; i < _this.
|
|
1272
|
-
var evName = _this.
|
|
1281
|
+
for (var i = 0; i < _this.QZJr.length; i++) {
|
|
1282
|
+
var evName = _this.QZJr[i].name.replace("'", "").replace("’", "");
|
|
1273
1283
|
if (LtCountObjDecoded[evName]) {
|
|
1274
1284
|
_this.eventDoneInLT = true;
|
|
1275
1285
|
return false;
|
|
@@ -1286,14 +1296,14 @@
|
|
|
1286
1296
|
var Attributes = /*#__PURE__*/_createClass(function Attributes() {
|
|
1287
1297
|
var _this = this;
|
|
1288
1298
|
_classCallCheck(this, Attributes);
|
|
1289
|
-
_defineProperty(this, "
|
|
1290
|
-
_defineProperty(this, "
|
|
1299
|
+
_defineProperty(this, "EkUf", []);
|
|
1300
|
+
_defineProperty(this, "NGJy", []);
|
|
1291
1301
|
_defineProperty(this, "parse", function () {
|
|
1292
1302
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1293
1303
|
try {
|
|
1294
|
-
_this.
|
|
1295
|
-
_this.
|
|
1296
|
-
if (!Array.isArray(_this.
|
|
1304
|
+
_this.EkUf = config.attributes.user;
|
|
1305
|
+
_this.NGJy = config.attributes.session;
|
|
1306
|
+
if (!Array.isArray(_this.EkUf) || !Array.isArray(_this.NGJy)) {
|
|
1297
1307
|
Logger$8.error("No attributes");
|
|
1298
1308
|
return false;
|
|
1299
1309
|
}
|
|
@@ -1304,9 +1314,9 @@
|
|
|
1304
1314
|
return true;
|
|
1305
1315
|
});
|
|
1306
1316
|
_defineProperty(this, "validate", function (user, session) {
|
|
1307
|
-
return _this.
|
|
1317
|
+
return _this.mewV(user, _this.EkUf) && _this.mewV(session, _this.NGJy);
|
|
1308
1318
|
});
|
|
1309
|
-
_defineProperty(this, "
|
|
1319
|
+
_defineProperty(this, "mewV", function (attributes, expected) {
|
|
1310
1320
|
var length = expected.length;
|
|
1311
1321
|
var status = true;
|
|
1312
1322
|
try {
|
|
@@ -1336,7 +1346,7 @@
|
|
|
1336
1346
|
}
|
|
1337
1347
|
var match = loggedValues.some(function (loggedValue) {
|
|
1338
1348
|
return values.some(function (configValue) {
|
|
1339
|
-
return
|
|
1349
|
+
return rCJW(loggedValue, configValue, operator);
|
|
1340
1350
|
});
|
|
1341
1351
|
});
|
|
1342
1352
|
status = status && match;
|
|
@@ -1360,18 +1370,18 @@
|
|
|
1360
1370
|
var TimeBasedTermination = /*#__PURE__*/_createClass(function TimeBasedTermination() {
|
|
1361
1371
|
var _this = this;
|
|
1362
1372
|
_classCallCheck(this, TimeBasedTermination);
|
|
1363
|
-
_defineProperty(this, "
|
|
1373
|
+
_defineProperty(this, "NFlA", Apxor.getController());
|
|
1364
1374
|
_defineProperty(this, "type", "");
|
|
1365
1375
|
_defineProperty(this, "_duration_seconds", 0);
|
|
1366
|
-
_defineProperty(this, "
|
|
1376
|
+
_defineProperty(this, "Ndvf", 1);
|
|
1367
1377
|
_defineProperty(this, "parse", function (config) {
|
|
1368
1378
|
try {
|
|
1369
1379
|
var _config$terminate_inf, _config$terminate_inf2, _config$terminate_inf3;
|
|
1370
|
-
_this.
|
|
1380
|
+
_this.vQHr = (_config$terminate_inf = config.terminate_info.time_based) === null || _config$terminate_inf === void 0 ? void 0 : _config$terminate_inf.type;
|
|
1371
1381
|
_this._duration_seconds = (_config$terminate_inf2 = config.terminate_info) === null || _config$terminate_inf2 === void 0 ? void 0 : _config$terminate_inf2.time_based.duration_seconds;
|
|
1372
|
-
_this.
|
|
1373
|
-
if (_this.
|
|
1374
|
-
_this.
|
|
1382
|
+
_this.Ndvf = (_config$terminate_inf3 = config.terminate_info.time_based) === null || _config$terminate_inf3 === void 0 ? void 0 : _config$terminate_inf3.days;
|
|
1383
|
+
if (_this.rCJW(config._id)) {
|
|
1384
|
+
_this.NFlA.persistTerminationInfoLocally(config._id);
|
|
1375
1385
|
return false;
|
|
1376
1386
|
}
|
|
1377
1387
|
} catch (_unused) {
|
|
@@ -1379,16 +1389,16 @@
|
|
|
1379
1389
|
}
|
|
1380
1390
|
return true;
|
|
1381
1391
|
});
|
|
1382
|
-
_defineProperty(this, "
|
|
1392
|
+
_defineProperty(this, "rCJW", function (id) {
|
|
1383
1393
|
var _Data$id;
|
|
1384
|
-
var Data = JSON.parse(_this.
|
|
1394
|
+
var Data = JSON.parse(_this.NFlA.getFromStorage(APX_TERMINATION_ID));
|
|
1385
1395
|
if (!Data[id] || !((_Data$id = Data[id]) !== null && _Data$id !== void 0 && _Data$id.startDate)) return false;
|
|
1386
1396
|
var startDate = new Date(Data[id].startDate);
|
|
1387
1397
|
var presentDate = new Date(getDateInMMDDYYYY());
|
|
1388
1398
|
var diff = parseInt((presentDate - startDate) / (1000 * 60 * 60 * 24), 10);
|
|
1389
1399
|
var currentTime = _getTime();
|
|
1390
|
-
var
|
|
1391
|
-
return diff === _this.
|
|
1400
|
+
var FArj = Data[id].FArj;
|
|
1401
|
+
return diff === _this.Ndvf && currentTime.hours >= FArj.hours || diff > _this.Ndvf || Data[id].goalAcheived;
|
|
1392
1402
|
});
|
|
1393
1403
|
});
|
|
1394
1404
|
|
|
@@ -1397,19 +1407,19 @@
|
|
|
1397
1407
|
_classCallCheck(this, TerminationInfo);
|
|
1398
1408
|
_defineProperty(this, "enable_goal_events", false);
|
|
1399
1409
|
_defineProperty(this, "attributes", {});
|
|
1400
|
-
_defineProperty(this, "
|
|
1401
|
-
_defineProperty(this, "
|
|
1410
|
+
_defineProperty(this, "pVMm", new Attributes());
|
|
1411
|
+
_defineProperty(this, "nZhZ", new TimeBasedTermination());
|
|
1402
1412
|
_defineProperty(this, "parse", function () {
|
|
1403
1413
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1404
1414
|
try {
|
|
1405
1415
|
var _config$terminate_inf, _config$terminate_inf2, _config$terminate_inf3;
|
|
1406
1416
|
_this.enable_time_based = config === null || config === void 0 || (_config$terminate_inf = config.terminate_info) === null || _config$terminate_inf === void 0 ? void 0 : _config$terminate_inf.enable_time_based;
|
|
1407
|
-
if (_this.enable_time_based && !_this.
|
|
1417
|
+
if (_this.enable_time_based && !_this.nZhZ.parse(config)) {
|
|
1408
1418
|
return false;
|
|
1409
1419
|
}
|
|
1410
1420
|
_this.enable_goal_events = config === null || config === void 0 || (_config$terminate_inf2 = config.terminate_info) === null || _config$terminate_inf2 === void 0 ? void 0 : _config$terminate_inf2.enable_goal_events;
|
|
1411
1421
|
_this.enable_attributes = config === null || config === void 0 || (_config$terminate_inf3 = config.terminate_info) === null || _config$terminate_inf3 === void 0 ? void 0 : _config$terminate_inf3.enable_attributes;
|
|
1412
|
-
if (_this.enable_attributes && !_this.
|
|
1422
|
+
if (_this.enable_attributes && !_this.pVMm.parse(config.terminate_info)) {
|
|
1413
1423
|
return false;
|
|
1414
1424
|
}
|
|
1415
1425
|
} catch (error) {
|
|
@@ -1419,27 +1429,27 @@
|
|
|
1419
1429
|
return true;
|
|
1420
1430
|
});
|
|
1421
1431
|
_defineProperty(this, "validate", function (user, session) {
|
|
1422
|
-
return _this.
|
|
1432
|
+
return _this.pVMm.validate(user, session);
|
|
1423
1433
|
});
|
|
1424
1434
|
});
|
|
1425
1435
|
|
|
1426
1436
|
var Binding = /*#__PURE__*/_createClass(function Binding() {
|
|
1427
1437
|
var _this = this;
|
|
1428
1438
|
_classCallCheck(this, Binding);
|
|
1429
|
-
_defineProperty(this, "
|
|
1430
|
-
_defineProperty(this, "
|
|
1431
|
-
_defineProperty(this, "
|
|
1432
|
-
_defineProperty(this, "
|
|
1439
|
+
_defineProperty(this, "eEaP", "");
|
|
1440
|
+
_defineProperty(this, "IEWp", "");
|
|
1441
|
+
_defineProperty(this, "kMxy", "");
|
|
1442
|
+
_defineProperty(this, "jAzF", "");
|
|
1433
1443
|
_defineProperty(this, "parse", function () {
|
|
1434
1444
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1435
1445
|
try {
|
|
1436
|
-
_this.
|
|
1437
|
-
if (!_this.
|
|
1446
|
+
_this.eEaP = config === null || config === void 0 ? void 0 : config.screen_binding;
|
|
1447
|
+
if (!_this.eEaP) {
|
|
1438
1448
|
return true;
|
|
1439
1449
|
} else {
|
|
1440
|
-
_this.
|
|
1441
|
-
_this.
|
|
1442
|
-
_this.
|
|
1450
|
+
_this.IEWp = config === null || config === void 0 ? void 0 : config.binding.url;
|
|
1451
|
+
_this.kMxy = config === null || config === void 0 ? void 0 : config.binding["var"];
|
|
1452
|
+
_this.jAzF = config === null || config === void 0 ? void 0 : config.binding.operator;
|
|
1443
1453
|
return true;
|
|
1444
1454
|
}
|
|
1445
1455
|
} catch (error) {
|
|
@@ -1454,11 +1464,11 @@
|
|
|
1454
1464
|
* operator :operator can be either "EQ" used for equality comparision or "SW" used for startswith comparision
|
|
1455
1465
|
*/
|
|
1456
1466
|
_defineProperty(this, "validate", function () {
|
|
1457
|
-
var url = _this.
|
|
1458
|
-
var variable = _this.
|
|
1459
|
-
var operator = _this.
|
|
1467
|
+
var url = _this.IEWp;
|
|
1468
|
+
var variable = _this.kMxy;
|
|
1469
|
+
var operator = _this.jAzF;
|
|
1460
1470
|
var currentUrl = window.location.href;
|
|
1461
|
-
if (!_this.
|
|
1471
|
+
if (!_this.eEaP) {
|
|
1462
1472
|
return true;
|
|
1463
1473
|
} else {
|
|
1464
1474
|
if (operator === "EQ") {
|
|
@@ -1500,23 +1510,23 @@
|
|
|
1500
1510
|
var ConfigItem = /*#__PURE__*/_createClass(function ConfigItem() {
|
|
1501
1511
|
var _this = this;
|
|
1502
1512
|
_classCallCheck(this, ConfigItem);
|
|
1503
|
-
_defineProperty(this, "
|
|
1504
|
-
_defineProperty(this, "
|
|
1505
|
-
_defineProperty(this, "
|
|
1506
|
-
_defineProperty(this, "
|
|
1507
|
-
_defineProperty(this, "
|
|
1508
|
-
_defineProperty(this, "
|
|
1509
|
-
_defineProperty(this, "
|
|
1510
|
-
_defineProperty(this, "
|
|
1511
|
-
_defineProperty(this, "
|
|
1512
|
-
_defineProperty(this, "
|
|
1513
|
-
_defineProperty(this, "
|
|
1514
|
-
_defineProperty(this, "
|
|
1513
|
+
_defineProperty(this, "wRix", []);
|
|
1514
|
+
_defineProperty(this, "Gmqy", []);
|
|
1515
|
+
_defineProperty(this, "AoNu", "");
|
|
1516
|
+
_defineProperty(this, "jphx", new Meta());
|
|
1517
|
+
_defineProperty(this, "TYjL", new Audience());
|
|
1518
|
+
_defineProperty(this, "pZvl", new Validity());
|
|
1519
|
+
_defineProperty(this, "vQCW", new Frequency());
|
|
1520
|
+
_defineProperty(this, "iNsG", new OverallConfig());
|
|
1521
|
+
_defineProperty(this, "puda", new TerminationInfo());
|
|
1522
|
+
_defineProperty(this, "FDsA", new Binding());
|
|
1523
|
+
_defineProperty(this, "WoBx", false);
|
|
1524
|
+
_defineProperty(this, "LIOs", []);
|
|
1515
1525
|
_defineProperty(this, "_variant_code", "");
|
|
1516
1526
|
_defineProperty(this, "parse", function () {
|
|
1517
1527
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1518
1528
|
try {
|
|
1519
|
-
var _this$
|
|
1529
|
+
var _this$jphx$_attr;
|
|
1520
1530
|
// If ID is not present, throw it out
|
|
1521
1531
|
if (!isDefined(config._id)) {
|
|
1522
1532
|
Logger$9.error("No Id");
|
|
@@ -1530,18 +1540,18 @@
|
|
|
1530
1540
|
}
|
|
1531
1541
|
|
|
1532
1542
|
// If META, VALIDITY, FREQUENCY and AUDIENCE is not parsed properly, throw it out
|
|
1533
|
-
if (!(_this.
|
|
1543
|
+
if (!(_this.jphx.parse(config) && _this.pZvl.parse(config) && _this.vQCW.parse(config) && _this.TYjL.parse(config) && _this.iNsG.parse(config) && _this.puda.parse(config) && _this.FDsA.parse(config))) {
|
|
1534
1544
|
return false;
|
|
1535
1545
|
}
|
|
1536
|
-
_this._variant_code = _this.
|
|
1546
|
+
_this._variant_code = _this.jphx._isExperiment || _this.jphx._only_context ? (_this$jphx$_attr = _this.jphx._attr) === null || _this$jphx$_attr === void 0 ? void 0 : _this$jphx$_attr[APX_VARIANT_CODE] : "TG";
|
|
1537
1547
|
// If there are no conditions, throw it out
|
|
1538
1548
|
if (!isDefined(config.conditions) || !Array.isArray(config.conditions)) {
|
|
1539
1549
|
Logger$9.error("No valid conditions", config.conditions);
|
|
1540
1550
|
return false;
|
|
1541
1551
|
}
|
|
1542
|
-
_this.
|
|
1543
|
-
_this.
|
|
1544
|
-
if (_this.
|
|
1552
|
+
_this.AoNu = config._id;
|
|
1553
|
+
_this.WoBx = isDefined(config.sequence_enabled) ? config.sequence_enabled : false;
|
|
1554
|
+
if (_this.WoBx) {
|
|
1545
1555
|
// iff respectSequence is true, Sort the Conditions by their sequence order
|
|
1546
1556
|
// We need to sort, if server sends them in orderless manner
|
|
1547
1557
|
config.conditions.sort(function (prev, current) {
|
|
@@ -1554,20 +1564,22 @@
|
|
|
1554
1564
|
var length = conditions.length;
|
|
1555
1565
|
var no_context_enabled = config === null || config === void 0 ? void 0 : config.no_context_enabled;
|
|
1556
1566
|
if (length === 0 && no_context_enabled) {
|
|
1557
|
-
|
|
1567
|
+
setTimeout(function () {
|
|
1568
|
+
_this.zThy();
|
|
1569
|
+
}, 10);
|
|
1558
1570
|
}
|
|
1559
1571
|
var _loop = function _loop() {
|
|
1560
|
-
_this.
|
|
1572
|
+
_this.LIOs = [];
|
|
1561
1573
|
var condition = conditions[index];
|
|
1562
1574
|
if (condition.type === "didn't") {
|
|
1563
|
-
var
|
|
1575
|
+
var iMyo$details;
|
|
1564
1576
|
var obj = {
|
|
1565
1577
|
trigger_key: condition.trigger.details.name,
|
|
1566
|
-
no_kpi_array: condition === null || condition === void 0 || (
|
|
1578
|
+
no_kpi_array: condition === null || condition === void 0 || (iMyo$details = condition.details) === null || iMyo$details === void 0 || (iMyo$details = iMyo$details.additional_info) === null || iMyo$details === void 0 ? void 0 : iMyo$details.nkpi,
|
|
1567
1579
|
condition_id: condition === null || condition === void 0 ? void 0 : condition._id,
|
|
1568
1580
|
time_bounds: condition.time_bounds.upper
|
|
1569
1581
|
};
|
|
1570
|
-
_this.
|
|
1582
|
+
_this.LIOs = [].concat(_toConsumableArray(_this.LIOs), [obj]);
|
|
1571
1583
|
//this will be the key
|
|
1572
1584
|
//when event occur check this array and then then check the time
|
|
1573
1585
|
//check the time diffrence
|
|
@@ -1576,16 +1588,16 @@
|
|
|
1576
1588
|
}
|
|
1577
1589
|
|
|
1578
1590
|
var conditionValidator = new ConditionValidator();
|
|
1579
|
-
if (conditionValidator.initialize(condition, _this.
|
|
1580
|
-
_this.
|
|
1591
|
+
if (conditionValidator.initialize(condition, _this.AoNu, index, _this.WoBx, _this.LIOs)) {
|
|
1592
|
+
_this.wRix.push(conditionValidator);
|
|
1581
1593
|
var max_retries = (condition === null || condition === void 0 ? void 0 : condition.timeout) / (condition === null || condition === void 0 ? void 0 : condition.findinterval);
|
|
1582
1594
|
var frame_id = (condition === null || condition === void 0 ? void 0 : condition.frameid) || "";
|
|
1583
1595
|
var url = condition === null || condition === void 0 ? void 0 : condition.url;
|
|
1584
1596
|
if (window.location.href === url) {
|
|
1585
1597
|
if (condition.event_type === "view_visibility") {
|
|
1586
1598
|
if (_findTargetElement(condition.view_id, frame_id, condition === null || condition === void 0 ? void 0 : condition.enable_retry, condition === null || condition === void 0 ? void 0 : condition.findinterval, max_retries) === true) {
|
|
1587
|
-
//this.
|
|
1588
|
-
_this.
|
|
1599
|
+
//this.YsUo();
|
|
1600
|
+
_this.zThy(true);
|
|
1589
1601
|
}
|
|
1590
1602
|
}
|
|
1591
1603
|
}
|
|
@@ -1595,8 +1607,8 @@
|
|
|
1595
1607
|
if (window.location.href === url) {
|
|
1596
1608
|
if (condition.event_type === "view_visibility") {
|
|
1597
1609
|
if (_findTargetElement(condition.view_id, frame_id, condition === null || condition === void 0 ? void 0 : condition.enable_retry, condition === null || condition === void 0 ? void 0 : condition.findinterval, max_retries) === true) {
|
|
1598
|
-
//this.
|
|
1599
|
-
_this.
|
|
1610
|
+
//this.YsUo();
|
|
1611
|
+
_this.zThy(true);
|
|
1600
1612
|
}
|
|
1601
1613
|
}
|
|
1602
1614
|
}
|
|
@@ -1606,114 +1618,114 @@
|
|
|
1606
1618
|
for (var index = 0; index < length; index++) {
|
|
1607
1619
|
_loop();
|
|
1608
1620
|
}
|
|
1609
|
-
if (_this.
|
|
1621
|
+
if (_this.puda.enable_goal_events) {
|
|
1610
1622
|
var goal_events = config.terminate_info.goal_events.events;
|
|
1611
1623
|
var goaleventslength = goal_events.length;
|
|
1612
1624
|
for (var i = 0; i < goaleventslength; i++) {
|
|
1613
1625
|
var conditionValidator = new ConditionValidator();
|
|
1614
|
-
if (conditionValidator.initialize(goal_events[i], _this.
|
|
1615
|
-
_this.
|
|
1626
|
+
if (conditionValidator.initialize(goal_events[i], _this.AoNu, i, true, [], "termination")) {
|
|
1627
|
+
_this.Gmqy.push(conditionValidator);
|
|
1616
1628
|
}
|
|
1617
1629
|
}
|
|
1618
1630
|
}
|
|
1619
|
-
return _this.
|
|
1631
|
+
return _this.wRix.length > 0;
|
|
1620
1632
|
} catch (error) {
|
|
1621
1633
|
Logger$9.error(error);
|
|
1622
1634
|
return false;
|
|
1623
1635
|
}
|
|
1624
1636
|
});
|
|
1625
|
-
_defineProperty(this, "
|
|
1637
|
+
_defineProperty(this, "oDyD", function (index) {
|
|
1626
1638
|
if (index < 0) {
|
|
1627
1639
|
return;
|
|
1628
1640
|
}
|
|
1629
|
-
if (_this.
|
|
1630
|
-
var conditionValidator = _this.
|
|
1631
|
-
if (isDefined(conditionValidator) && conditionValidator.
|
|
1641
|
+
if (_this.WoBx) {
|
|
1642
|
+
var conditionValidator = _this.wRix[index];
|
|
1643
|
+
if (isDefined(conditionValidator) && conditionValidator.fhfE) {
|
|
1632
1644
|
// Check if previous validator is satisfied
|
|
1633
|
-
var prevValidator = _this.
|
|
1634
|
-
if (isDefined(prevValidator) && !prevValidator.
|
|
1645
|
+
var prevValidator = _this.wRix[index - 1];
|
|
1646
|
+
if (isDefined(prevValidator) && !prevValidator.fhfE) {
|
|
1635
1647
|
// TODO: If current index is satisfied before previous one, do something
|
|
1636
1648
|
// either unregister all conditions or remove this item from ConfigLookup
|
|
1637
1649
|
return;
|
|
1638
1650
|
}
|
|
1639
|
-
var nextValidator = _this.
|
|
1651
|
+
var nextValidator = _this.wRix[index + 1];
|
|
1640
1652
|
if (!isDefined(nextValidator)) {
|
|
1641
1653
|
// It means this is the last condition
|
|
1642
1654
|
// Validate all conditions
|
|
1643
|
-
_this.
|
|
1655
|
+
_this.zThy();
|
|
1644
1656
|
} else {
|
|
1645
|
-
nextValidator.
|
|
1657
|
+
nextValidator.YsUo();
|
|
1646
1658
|
}
|
|
1647
1659
|
}
|
|
1648
1660
|
} else {
|
|
1649
1661
|
// Validate all conditions
|
|
1650
|
-
_this.
|
|
1662
|
+
_this.zThy();
|
|
1651
1663
|
}
|
|
1652
1664
|
});
|
|
1653
|
-
_defineProperty(this, "
|
|
1665
|
+
_defineProperty(this, "rdeg", function (index) {
|
|
1654
1666
|
if (index < 0) {
|
|
1655
1667
|
return;
|
|
1656
1668
|
}
|
|
1657
|
-
_this.
|
|
1669
|
+
_this.UkVP();
|
|
1658
1670
|
});
|
|
1659
|
-
_defineProperty(this, "
|
|
1671
|
+
_defineProperty(this, "zThy", function () {
|
|
1660
1672
|
var _window$ApxorRTM, _window$ApxorRTM2;
|
|
1661
1673
|
var view_visibility = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
1662
1674
|
// Check If Audience, Validity is satisfied or not
|
|
1663
1675
|
var userAttributes = Apxor.getController().getUserAttributes();
|
|
1664
1676
|
var sessionAttributes = Apxor.getController().getSessionAttributes();
|
|
1665
|
-
if (!((_window$ApxorRTM = window.ApxorRTM) !== null && _window$ApxorRTM !== void 0 && _window$ApxorRTM.isBadgePresent && (_window$ApxorRTM2 = window.ApxorRTM) !== null && _window$ApxorRTM2 !== void 0 && _window$ApxorRTM2.badgesLists.includes(_this.
|
|
1677
|
+
if (!((_window$ApxorRTM = window.ApxorRTM) !== null && _window$ApxorRTM !== void 0 && _window$ApxorRTM.isBadgePresent && (_window$ApxorRTM2 = window.ApxorRTM) !== null && _window$ApxorRTM2 !== void 0 && _window$ApxorRTM2.badgesLists.includes(_this.AoNu) && Apxor.getController().isBadgeTriggerSatisfied(_this.AoNu))) {
|
|
1666
1678
|
Apxor === null || Apxor === void 0 || Apxor.logEvent("apx_trigger_satisfied", {
|
|
1667
|
-
apx_nudge_type: _this.
|
|
1668
|
-
apx_nudge_id: _this.
|
|
1669
|
-
apx_nudge_name: _this.
|
|
1670
|
-
apx_variant_code: _this.
|
|
1679
|
+
apx_nudge_type: _this.jphx.vQHr === "SURVEY" ? "survey" : "campaign",
|
|
1680
|
+
apx_nudge_id: _this.AoNu,
|
|
1681
|
+
apx_nudge_name: _this.jphx.gupk,
|
|
1682
|
+
apx_variant_code: _this.jphx._isExperiment || _this.jphx._only_context ? _this.jphx._attr[APX_VARIANT_CODE] : "TG"
|
|
1671
1683
|
});
|
|
1672
1684
|
}
|
|
1673
|
-
if (!_this.
|
|
1674
|
-
if (!_this.
|
|
1675
|
-
_this.
|
|
1685
|
+
if (!_this.pZvl.validate() || !_this.TYjL.validate(userAttributes, sessionAttributes) || !_this.iNsG.validate() || !_this.FDsA.validate()) {
|
|
1686
|
+
if (!_this.iNsG.retainedDaysValidated) {
|
|
1687
|
+
_this.zUZc("Retained day criteria not met");
|
|
1676
1688
|
return;
|
|
1677
1689
|
}
|
|
1678
|
-
if (!_this.
|
|
1679
|
-
_this.
|
|
1690
|
+
if (!_this.iNsG.retainedSessionValidated) {
|
|
1691
|
+
_this.zUZc("User session criteria not met");
|
|
1680
1692
|
return;
|
|
1681
1693
|
}
|
|
1682
|
-
if (_this.
|
|
1683
|
-
_this.
|
|
1694
|
+
if (_this.iNsG.eventDoneInLT) {
|
|
1695
|
+
_this.zUZc("Event done in life time");
|
|
1684
1696
|
return;
|
|
1685
1697
|
}
|
|
1686
|
-
if (!_this.
|
|
1687
|
-
_this.
|
|
1698
|
+
if (!_this.TYjL.userAttributesValidated) {
|
|
1699
|
+
_this.zUZc("User property filter not met");
|
|
1688
1700
|
return;
|
|
1689
1701
|
}
|
|
1690
|
-
if (!_this.
|
|
1691
|
-
_this.
|
|
1702
|
+
if (!_this.TYjL.sessionAttributeValidated) {
|
|
1703
|
+
_this.zUZc("Session property filter not met");
|
|
1692
1704
|
return;
|
|
1693
1705
|
}
|
|
1694
|
-
if (_this.
|
|
1695
|
-
_this.
|
|
1706
|
+
if (_this.pZvl._not_in_specified_time) {
|
|
1707
|
+
_this.zUZc("Time limits check failed");
|
|
1696
1708
|
return;
|
|
1697
1709
|
}
|
|
1698
|
-
if (_this.
|
|
1699
|
-
_this.
|
|
1710
|
+
if (_this.pZvl._not_yet_active) {
|
|
1711
|
+
_this.zUZc("not in the scheduled time");
|
|
1700
1712
|
return;
|
|
1701
1713
|
}
|
|
1702
|
-
if (_this.
|
|
1703
|
-
_this.
|
|
1714
|
+
if (_this.pZvl._nudge_expired) {
|
|
1715
|
+
_this.zUZc("nudge expired");
|
|
1704
1716
|
return;
|
|
1705
1717
|
}
|
|
1706
1718
|
return;
|
|
1707
1719
|
}
|
|
1708
|
-
var length = _this.
|
|
1720
|
+
var length = _this.wRix.length;
|
|
1709
1721
|
var isSatisfied = length < 1;
|
|
1710
1722
|
var combineOperator = "";
|
|
1711
1723
|
if (length === 0) {
|
|
1712
1724
|
isSatisfied = true;
|
|
1713
1725
|
}
|
|
1714
1726
|
for (var index = 0; index < length; index++) {
|
|
1715
|
-
var validator = _this.
|
|
1716
|
-
var currentResult = validator.
|
|
1727
|
+
var validator = _this.wRix[index];
|
|
1728
|
+
var currentResult = validator.fhfE;
|
|
1717
1729
|
if (combineOperator.trim() === "") {
|
|
1718
1730
|
isSatisfied = currentResult;
|
|
1719
1731
|
} else {
|
|
@@ -1726,7 +1738,7 @@
|
|
|
1726
1738
|
break;
|
|
1727
1739
|
}
|
|
1728
1740
|
}
|
|
1729
|
-
combineOperator = validator.
|
|
1741
|
+
combineOperator = validator.FFrw;
|
|
1730
1742
|
}
|
|
1731
1743
|
if (view_visibility === true) {
|
|
1732
1744
|
isSatisfied = true;
|
|
@@ -1734,10 +1746,10 @@
|
|
|
1734
1746
|
if (isSatisfied) {
|
|
1735
1747
|
console.debug("onCondition satisfied");
|
|
1736
1748
|
// Check if count reached it's maximum
|
|
1737
|
-
if (!_this.
|
|
1738
|
-
console.warn("Maximum limit reached", _this.
|
|
1749
|
+
if (!_this.vQCW.mZDO(_this.AoNu)) {
|
|
1750
|
+
console.warn("Maximum limit reached", _this.AoNu);
|
|
1739
1751
|
if (Apxor.getController().isTestDevice()) {
|
|
1740
|
-
feedBackMessagePopUpCE("Maximum limit reached for campaign name ".concat(_this.
|
|
1752
|
+
feedBackMessagePopUpCE("Maximum limit reached for campaign name ".concat(_this.jphx.gupk));
|
|
1741
1753
|
var closeButton = document.getElementById("close-button");
|
|
1742
1754
|
var dismissCallback = function dismissCallback() {
|
|
1743
1755
|
var modal_popup_container = document.getElementById("apx-container");
|
|
@@ -1751,36 +1763,36 @@
|
|
|
1751
1763
|
|
|
1752
1764
|
//logging event for view not found for test device
|
|
1753
1765
|
|
|
1754
|
-
console.log("Dispatching event", _this.
|
|
1766
|
+
console.log("Dispatching event", _this.jphx.vQHr);
|
|
1755
1767
|
|
|
1756
|
-
//if (this.
|
|
1768
|
+
//if (this.jphx._only_context === true) {
|
|
1757
1769
|
Apxor.logEvent(APX_CONTEXT_EVALUATED, _objectSpread2(_objectSpread2({
|
|
1758
|
-
apx_nudge_type: _this.
|
|
1759
|
-
apx_nudge_id: _this.
|
|
1760
|
-
apx_nudge_name: _this.
|
|
1761
|
-
apx_variant_code: _this.
|
|
1762
|
-
}, _this.
|
|
1763
|
-
message_name: _this.
|
|
1764
|
-
id: _this.
|
|
1770
|
+
apx_nudge_type: _this.jphx.vQHr === "SURVEY" ? "survey" : "campaign",
|
|
1771
|
+
apx_nudge_id: _this.AoNu,
|
|
1772
|
+
apx_nudge_name: _this.jphx.gupk,
|
|
1773
|
+
apx_variant_code: _this.jphx._isExperiment || _this.jphx._only_context ? _this.jphx._attr[APX_VARIANT_CODE] : "TG"
|
|
1774
|
+
}, _this.jphx._attr), {}, {
|
|
1775
|
+
message_name: _this.jphx.gupk,
|
|
1776
|
+
id: _this.AoNu
|
|
1765
1777
|
}));
|
|
1766
1778
|
//}
|
|
1767
1779
|
// Emit event
|
|
1768
|
-
Apxor.getController().dispatchEvent(_this.
|
|
1769
|
-
name: _this.
|
|
1780
|
+
Apxor.getController().dispatchEvent(_this.jphx.vQHr, {
|
|
1781
|
+
name: _this.jphx.vQHr,
|
|
1770
1782
|
additional_info: {
|
|
1771
|
-
uuid: _this.
|
|
1772
|
-
name: _this.
|
|
1783
|
+
uuid: _this.AoNu,
|
|
1784
|
+
name: _this.jphx.gupk
|
|
1773
1785
|
}
|
|
1774
1786
|
});
|
|
1775
1787
|
}
|
|
1776
1788
|
});
|
|
1777
|
-
_defineProperty(this, "
|
|
1778
|
-
var length = _this.
|
|
1789
|
+
_defineProperty(this, "UkVP", function () {
|
|
1790
|
+
var length = _this.Gmqy.length;
|
|
1779
1791
|
var isSatisfied = length < 1;
|
|
1780
1792
|
var combineOperator = "";
|
|
1781
1793
|
for (var index = 0; index < length; index++) {
|
|
1782
|
-
var validator = _this.
|
|
1783
|
-
var currentResult = validator.
|
|
1794
|
+
var validator = _this.Gmqy[index];
|
|
1795
|
+
var currentResult = validator.fhfE;
|
|
1784
1796
|
if (combineOperator.trim() === "") {
|
|
1785
1797
|
isSatisfied = currentResult;
|
|
1786
1798
|
} else {
|
|
@@ -1793,23 +1805,23 @@
|
|
|
1793
1805
|
break;
|
|
1794
1806
|
}
|
|
1795
1807
|
}
|
|
1796
|
-
combineOperator = validator.
|
|
1808
|
+
combineOperator = validator.eaiu;
|
|
1797
1809
|
}
|
|
1798
1810
|
if (isSatisfied) {
|
|
1799
|
-
console.log("Dispatching event", _this.
|
|
1800
|
-
Apxor.getController().persistTerminationInfoLocally(_this.
|
|
1801
|
-
if (_this.
|
|
1802
|
-
Apxor.logEvent(APX_CONTEXT_EVALUATED, _objectSpread2(_objectSpread2({}, _this.
|
|
1803
|
-
message_name: _this.
|
|
1804
|
-
id: _this.
|
|
1811
|
+
console.log("Dispatching event", _this.jphx.vQHr);
|
|
1812
|
+
Apxor.getController().persistTerminationInfoLocally(_this.AoNu);
|
|
1813
|
+
if (_this.jphx._only_context === true) {
|
|
1814
|
+
Apxor.logEvent(APX_CONTEXT_EVALUATED, _objectSpread2(_objectSpread2({}, _this.jphx._attr), {}, {
|
|
1815
|
+
message_name: _this.jphx.gupk,
|
|
1816
|
+
id: _this.AoNu
|
|
1805
1817
|
}));
|
|
1806
1818
|
}
|
|
1807
1819
|
// Emit event
|
|
1808
|
-
Apxor.getController().dispatchEvent(_this.
|
|
1809
|
-
name: _this.
|
|
1820
|
+
Apxor.getController().dispatchEvent(_this.jphx.vQHr, {
|
|
1821
|
+
name: _this.jphx.vQHr,
|
|
1810
1822
|
additional_info: {
|
|
1811
|
-
uuid: _this.
|
|
1812
|
-
name: _this.
|
|
1823
|
+
uuid: _this.AoNu,
|
|
1824
|
+
name: _this.jphx.gupk
|
|
1813
1825
|
}
|
|
1814
1826
|
});
|
|
1815
1827
|
}
|
|
@@ -1817,24 +1829,24 @@
|
|
|
1817
1829
|
_defineProperty(this, "validateForTerminationAttributes", function () {
|
|
1818
1830
|
var userAttributes = Apxor.getController().getUserAttributes();
|
|
1819
1831
|
var sessionAttributes = Apxor.getController().getSessionAttributes();
|
|
1820
|
-
return _this.
|
|
1832
|
+
return _this.puda.validate(userAttributes, sessionAttributes);
|
|
1821
1833
|
});
|
|
1822
|
-
_defineProperty(this, "
|
|
1823
|
-
_this.
|
|
1834
|
+
_defineProperty(this, "IwqI", function () {
|
|
1835
|
+
_this.vQCW.IwqI();
|
|
1824
1836
|
});
|
|
1825
1837
|
_defineProperty(this, "getFrequencyCount", function () {
|
|
1826
|
-
return _this.
|
|
1838
|
+
return _this.vQCW.getFrequencyCount();
|
|
1827
1839
|
});
|
|
1828
|
-
_defineProperty(this, "
|
|
1829
|
-
return _this.
|
|
1840
|
+
_defineProperty(this, "HsUR", function () {
|
|
1841
|
+
return _this.vQCW.kPEn();
|
|
1830
1842
|
});
|
|
1831
|
-
_defineProperty(this, "
|
|
1832
|
-
var _this$
|
|
1843
|
+
_defineProperty(this, "zUZc", function (reason) {
|
|
1844
|
+
var _this$jphx$_attr2;
|
|
1833
1845
|
Apxor === null || Apxor === void 0 || Apxor.logEvent("apx_non_eligible_user", {
|
|
1834
|
-
apx_nudge_type: _this.
|
|
1835
|
-
apx_nudge_id: _this.
|
|
1836
|
-
apx_nudge_name: _this.
|
|
1837
|
-
apx_variant_code: _this.
|
|
1846
|
+
apx_nudge_type: _this.jphx.vQHr === "SURVEY" ? "survey" : "campaign",
|
|
1847
|
+
apx_nudge_id: _this.AoNu,
|
|
1848
|
+
apx_nudge_name: _this.jphx.gupk,
|
|
1849
|
+
apx_variant_code: _this.jphx._isExperiment || _this.jphx._only_context ? (_this$jphx$_attr2 = _this.jphx._attr) === null || _this$jphx$_attr2 === void 0 ? void 0 : _this$jphx$_attr2[APX_VARIANT_CODE] : "TG",
|
|
1838
1850
|
apx_failure_type: "warn",
|
|
1839
1851
|
apx_reason: reason
|
|
1840
1852
|
});
|
|
@@ -1844,7 +1856,7 @@
|
|
|
1844
1856
|
var ConfigLookup = /*#__PURE__*/_createClass(function ConfigLookup() {
|
|
1845
1857
|
var _this = this;
|
|
1846
1858
|
_classCallCheck(this, ConfigLookup);
|
|
1847
|
-
_defineProperty(this, "
|
|
1859
|
+
_defineProperty(this, "suWy", {});
|
|
1848
1860
|
_defineProperty(this, "parse", function () {
|
|
1849
1861
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
1850
1862
|
configs: []
|
|
@@ -1867,7 +1879,7 @@
|
|
|
1867
1879
|
var configId = _config._id;
|
|
1868
1880
|
var configItem = new ConfigItem();
|
|
1869
1881
|
if (configItem.parse(_config)) {
|
|
1870
|
-
_this.
|
|
1882
|
+
_this.suWy[configId] = configItem;
|
|
1871
1883
|
} else {
|
|
1872
1884
|
console.warn("Failed to parse cfg", configId);
|
|
1873
1885
|
}
|
|
@@ -1875,51 +1887,51 @@
|
|
|
1875
1887
|
}
|
|
1876
1888
|
});
|
|
1877
1889
|
_defineProperty(this, "validate", function (id, index) {
|
|
1878
|
-
if (_this.
|
|
1879
|
-
var configItem = _this.
|
|
1880
|
-
configItem.
|
|
1890
|
+
if (_this.suWy[id]) {
|
|
1891
|
+
var configItem = _this.suWy[id];
|
|
1892
|
+
configItem.oDyD(index);
|
|
1881
1893
|
}
|
|
1882
1894
|
});
|
|
1883
1895
|
_defineProperty(this, "getVariantCode", function (id) {
|
|
1884
|
-
if (_this.
|
|
1885
|
-
var configItem = _this.
|
|
1896
|
+
if (_this.suWy[id]) {
|
|
1897
|
+
var configItem = _this.suWy[id];
|
|
1886
1898
|
return configItem._variant_code;
|
|
1887
1899
|
}
|
|
1888
1900
|
return "";
|
|
1889
1901
|
});
|
|
1890
1902
|
_defineProperty(this, "validateForTermination", function (id, index) {
|
|
1891
|
-
if (_this.
|
|
1892
|
-
var configItem = _this.
|
|
1893
|
-
configItem.
|
|
1903
|
+
if (_this.suWy[id]) {
|
|
1904
|
+
var configItem = _this.suWy[id];
|
|
1905
|
+
configItem.rdeg(index);
|
|
1894
1906
|
}
|
|
1895
1907
|
});
|
|
1896
1908
|
_defineProperty(this, "validateForTerminationAttributes", function (id) {
|
|
1897
|
-
if (_this.
|
|
1898
|
-
var configItem = _this.
|
|
1909
|
+
if (_this.suWy[id]) {
|
|
1910
|
+
var configItem = _this.suWy[id];
|
|
1899
1911
|
return configItem.validateForTerminationAttributes();
|
|
1900
1912
|
}
|
|
1901
1913
|
return false;
|
|
1902
1914
|
});
|
|
1903
|
-
_defineProperty(this, "
|
|
1904
|
-
var campiagnConfig = _this.
|
|
1905
|
-
campiagnConfig.
|
|
1915
|
+
_defineProperty(this, "IwqI", function (id) {
|
|
1916
|
+
var campiagnConfig = _this.suWy[id];
|
|
1917
|
+
campiagnConfig.IwqI();
|
|
1906
1918
|
});
|
|
1907
1919
|
_defineProperty(this, "getFrequencyCount", function (id) {
|
|
1908
|
-
var campiagnConfig = _this.
|
|
1920
|
+
var campiagnConfig = _this.suWy[id];
|
|
1909
1921
|
if (campiagnConfig != undefined) return campiagnConfig.getFrequencyCount();
|
|
1910
1922
|
});
|
|
1911
1923
|
_defineProperty(this, "resetFrequencyCounts", function () {
|
|
1912
|
-
var configs = _this.
|
|
1924
|
+
var configs = _this.suWy;
|
|
1913
1925
|
for (var configId in configs) {
|
|
1914
|
-
configs[configId].
|
|
1926
|
+
configs[configId].HsUR();
|
|
1915
1927
|
}
|
|
1916
1928
|
});
|
|
1917
|
-
_defineProperty(this, "
|
|
1929
|
+
_defineProperty(this, "Bxsp", function (campaignId) {
|
|
1918
1930
|
try {
|
|
1919
|
-
if (_this.
|
|
1920
|
-
var configItem = _this.
|
|
1921
|
-
if (configItem && configItem.
|
|
1922
|
-
return configItem.
|
|
1931
|
+
if (_this.suWy) {
|
|
1932
|
+
var configItem = _this.suWy[campaignId];
|
|
1933
|
+
if (configItem && configItem.jphx) {
|
|
1934
|
+
return configItem.jphx;
|
|
1923
1935
|
}
|
|
1924
1936
|
}
|
|
1925
1937
|
} catch (e) {
|
|
@@ -1935,42 +1947,42 @@
|
|
|
1935
1947
|
var EventsListener = /*#__PURE__*/_createClass(function EventsListener() {
|
|
1936
1948
|
var _this = this;
|
|
1937
1949
|
_classCallCheck(this, EventsListener);
|
|
1938
|
-
_defineProperty(this, "
|
|
1939
|
-
_defineProperty(this, "
|
|
1940
|
-
_defineProperty(this, "
|
|
1950
|
+
_defineProperty(this, "MTzy", {});
|
|
1951
|
+
_defineProperty(this, "SHsz", []);
|
|
1952
|
+
_defineProperty(this, "WFhi", false);
|
|
1941
1953
|
_defineProperty(this, "initialize", function () {
|
|
1942
1954
|
var controller = Apxor.getController();
|
|
1943
1955
|
controller.registerForEvent(APP_EVENT, function (event) {
|
|
1944
|
-
return _this.
|
|
1956
|
+
return _this.kJmP(event, "AE");
|
|
1945
1957
|
});
|
|
1946
1958
|
controller.registerForEvent(CLIENT_EVENT, function (event) {
|
|
1947
|
-
return _this.
|
|
1959
|
+
return _this.kJmP(event, "CE");
|
|
1948
1960
|
});
|
|
1949
1961
|
});
|
|
1950
|
-
_defineProperty(this, "
|
|
1962
|
+
_defineProperty(this, "XEHq", function () {
|
|
1951
1963
|
// Clear Buffer
|
|
1952
|
-
for (var item in _this.
|
|
1953
|
-
_this.
|
|
1964
|
+
for (var item in _this.SHsz) {
|
|
1965
|
+
_this.fxeJ(item.event, item.key, item.type);
|
|
1954
1966
|
}
|
|
1955
|
-
_this.
|
|
1967
|
+
_this.WFhi = true;
|
|
1956
1968
|
});
|
|
1957
|
-
_defineProperty(this, "
|
|
1969
|
+
_defineProperty(this, "pUOV", function (event, callback) {
|
|
1958
1970
|
if (!isFunction(callback)) {
|
|
1959
1971
|
return;
|
|
1960
1972
|
}
|
|
1961
1973
|
var listeners;
|
|
1962
|
-
if (_this.
|
|
1963
|
-
listeners = _this.
|
|
1974
|
+
if (_this.MTzy[event]) {
|
|
1975
|
+
listeners = _this.MTzy[event];
|
|
1964
1976
|
} else {
|
|
1965
1977
|
listeners = [];
|
|
1966
1978
|
}
|
|
1967
1979
|
listeners.push(callback);
|
|
1968
|
-
_this.
|
|
1969
|
-
Logger$a.debug("Listeners list: ", _this.
|
|
1980
|
+
_this.MTzy[event] = listeners;
|
|
1981
|
+
Logger$a.debug("Listeners list: ", _this.MTzy);
|
|
1970
1982
|
});
|
|
1971
1983
|
_defineProperty(this, "unregisterFromEvent", function (event, callback) {
|
|
1972
|
-
if (_this.
|
|
1973
|
-
var listeners = _this.
|
|
1984
|
+
if (_this.MTzy[event]) {
|
|
1985
|
+
var listeners = _this.MTzy[event];
|
|
1974
1986
|
var updatedListeners = [];
|
|
1975
1987
|
for (var index = 0; index < listeners.length; index++) {
|
|
1976
1988
|
var listener = listeners[index];
|
|
@@ -1978,25 +1990,25 @@
|
|
|
1978
1990
|
updatedListeners.push(listener);
|
|
1979
1991
|
}
|
|
1980
1992
|
}
|
|
1981
|
-
_this.
|
|
1993
|
+
_this.MTzy[event] = updatedListeners;
|
|
1982
1994
|
}
|
|
1983
1995
|
});
|
|
1984
|
-
_defineProperty(this, "
|
|
1996
|
+
_defineProperty(this, "kJmP", function (event) {
|
|
1985
1997
|
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "AE";
|
|
1986
1998
|
var key = type + "___" + event.name;
|
|
1987
|
-
_this.
|
|
1999
|
+
_this.fxeJ(event, key, type);
|
|
1988
2000
|
});
|
|
1989
|
-
_defineProperty(this, "
|
|
1990
|
-
if (!_this.
|
|
1991
|
-
_this.
|
|
2001
|
+
_defineProperty(this, "fxeJ", function (event, key, type) {
|
|
2002
|
+
if (!_this.WFhi) {
|
|
2003
|
+
_this.SHsz.push({
|
|
1992
2004
|
event: event,
|
|
1993
2005
|
key: key,
|
|
1994
2006
|
type: type
|
|
1995
2007
|
});
|
|
1996
2008
|
} else {
|
|
1997
|
-
Logger$a.debug("Notifying listeners for event: " + event + ", " + key, _this.
|
|
1998
|
-
if (_this.
|
|
1999
|
-
var listeners = _this.
|
|
2009
|
+
Logger$a.debug("Notifying listeners for event: " + event + ", " + key, _this.MTzy);
|
|
2010
|
+
if (_this.MTzy[key]) {
|
|
2011
|
+
var listeners = _this.MTzy[key];
|
|
2000
2012
|
var time = Apxor.getController().getSDKRunningTimeInSec();
|
|
2001
2013
|
for (var index = 0; index < listeners.length; index++) {
|
|
2002
2014
|
var listener = listeners[index];
|
|
@@ -2012,17 +2024,17 @@
|
|
|
2012
2024
|
function CE() {
|
|
2013
2025
|
var _this = this;
|
|
2014
2026
|
_classCallCheck(this, CE);
|
|
2015
|
-
_defineProperty(this, "
|
|
2016
|
-
_defineProperty(this, "
|
|
2017
|
-
_defineProperty(this, "
|
|
2018
|
-
_defineProperty(this, "
|
|
2019
|
-
_defineProperty(this, "
|
|
2027
|
+
_defineProperty(this, "ELmN", false);
|
|
2028
|
+
_defineProperty(this, "MtjW", null);
|
|
2029
|
+
_defineProperty(this, "tADd", getDateInDDMMYYYY());
|
|
2030
|
+
_defineProperty(this, "oovS", new EventsListener());
|
|
2031
|
+
_defineProperty(this, "wPUv", Apxor.getSiteId());
|
|
2020
2032
|
_defineProperty(this, "_qeState", {});
|
|
2021
2033
|
_defineProperty(this, "getQeState", function () {
|
|
2022
2034
|
try {
|
|
2023
2035
|
var data = Apxor.getController().getFromStorage(QE_STATE);
|
|
2024
2036
|
if (data) {
|
|
2025
|
-
return JSON.parse(decode(_this.
|
|
2037
|
+
return JSON.parse(decode(_this.wPUv, data));
|
|
2026
2038
|
} else {
|
|
2027
2039
|
_this._qeState = {};
|
|
2028
2040
|
return _this.setQeState();
|
|
@@ -2051,10 +2063,10 @@
|
|
|
2051
2063
|
return _this._qeState;
|
|
2052
2064
|
});
|
|
2053
2065
|
_defineProperty(this, "initialize", function () {
|
|
2054
|
-
if (!_this.
|
|
2055
|
-
_this.
|
|
2056
|
-
_this.
|
|
2057
|
-
_this.
|
|
2066
|
+
if (!_this.ELmN) {
|
|
2067
|
+
_this.ELmN = true;
|
|
2068
|
+
_this.MtjW = new ConfigLookup();
|
|
2069
|
+
_this.oovS.initialize();
|
|
2058
2070
|
_this._qeState = _this.getQeState();
|
|
2059
2071
|
Logger$b.info("QE Initialized..");
|
|
2060
2072
|
}
|
|
@@ -2065,12 +2077,12 @@
|
|
|
2065
2077
|
* @param config
|
|
2066
2078
|
*/
|
|
2067
2079
|
_defineProperty(this, "parse", function (config) {
|
|
2068
|
-
if (!_this.
|
|
2080
|
+
if (!_this.cETX()) {
|
|
2069
2081
|
Logger$b.warn("Must call init first. Unable to proceed");
|
|
2070
2082
|
return;
|
|
2071
2083
|
}
|
|
2072
|
-
_this.
|
|
2073
|
-
_this.
|
|
2084
|
+
_this.MtjW.parse(config);
|
|
2085
|
+
_this.oovS.XEHq();
|
|
2074
2086
|
});
|
|
2075
2087
|
/**
|
|
2076
2088
|
* Validates all conditions for given config ID
|
|
@@ -2079,22 +2091,22 @@
|
|
|
2079
2091
|
* @param index
|
|
2080
2092
|
*/
|
|
2081
2093
|
_defineProperty(this, "validate", function (id, index) {
|
|
2082
|
-
if (!_this.
|
|
2094
|
+
if (!_this.cETX()) {
|
|
2083
2095
|
return;
|
|
2084
2096
|
}
|
|
2085
|
-
_this.
|
|
2097
|
+
_this.MtjW.validate(id, index);
|
|
2086
2098
|
});
|
|
2087
2099
|
_defineProperty(this, "getVariantCode", function (id) {
|
|
2088
|
-
return _this.
|
|
2100
|
+
return _this.MtjW.getVariantCode(id);
|
|
2089
2101
|
});
|
|
2090
2102
|
_defineProperty(this, "validateForTermination", function (id, index) {
|
|
2091
|
-
if (!_this.
|
|
2103
|
+
if (!_this.cETX()) {
|
|
2092
2104
|
return;
|
|
2093
2105
|
}
|
|
2094
|
-
_this.
|
|
2106
|
+
_this.MtjW.validateForTermination(id, index);
|
|
2095
2107
|
});
|
|
2096
2108
|
_defineProperty(this, "validateForTerminationAttributes", function (user, session) {
|
|
2097
|
-
return _this.
|
|
2109
|
+
return _this.MtjW.validateForTerminationAttributes(user, session);
|
|
2098
2110
|
});
|
|
2099
2111
|
_defineProperty(this, "updateCount", function (id) {
|
|
2100
2112
|
try {
|
|
@@ -2103,25 +2115,25 @@
|
|
|
2103
2115
|
}
|
|
2104
2116
|
_this.incrementFrequencies(id);
|
|
2105
2117
|
_this.setQeState(id);
|
|
2106
|
-
_this.
|
|
2118
|
+
_this.MtjW.IwqI(id);
|
|
2107
2119
|
} catch (e) {
|
|
2108
2120
|
console.log("Could not update the count config:".concat(e));
|
|
2109
2121
|
}
|
|
2110
2122
|
});
|
|
2111
2123
|
_defineProperty(this, "resetFrequencyCounts", function () {
|
|
2112
|
-
_this.
|
|
2124
|
+
_this.MtjW.resetFrequencyCounts();
|
|
2113
2125
|
});
|
|
2114
2126
|
_defineProperty(this, "getFrequencyCount", function (id) {
|
|
2115
|
-
return _this.
|
|
2127
|
+
return _this.MtjW.getFrequencyCount(id);
|
|
2116
2128
|
});
|
|
2117
2129
|
_defineProperty(this, "registerForEvent", function (event, callback) {
|
|
2118
|
-
_this.
|
|
2130
|
+
_this.oovS.pUOV(event, callback);
|
|
2119
2131
|
});
|
|
2120
2132
|
_defineProperty(this, "unregisterFromEvent", function (event, callback) {
|
|
2121
|
-
_this.
|
|
2133
|
+
_this.oovS.unregisterFromEvent(event, callback);
|
|
2122
2134
|
});
|
|
2123
2135
|
_defineProperty(this, "notifyEventListener", function (event) {
|
|
2124
|
-
_this.
|
|
2136
|
+
_this.oovS.kJmP(event);
|
|
2125
2137
|
});
|
|
2126
2138
|
/**
|
|
2127
2139
|
* Fetches the config from Server
|
|
@@ -2134,14 +2146,14 @@
|
|
|
2134
2146
|
_defineProperty(this, "fetch", function (type, validateUrl, apiUrl, callback) {
|
|
2135
2147
|
Apxor.getController().fetchConfiguration(type, validateUrl, apiUrl, callback);
|
|
2136
2148
|
});
|
|
2137
|
-
_defineProperty(this, "
|
|
2138
|
-
return _this.
|
|
2149
|
+
_defineProperty(this, "cETX", function () {
|
|
2150
|
+
return _this.ELmN;
|
|
2139
2151
|
});
|
|
2140
2152
|
_defineProperty(this, "getCampaignMetaFromQueryEngine", function (campaignId) {
|
|
2141
|
-
return _this.
|
|
2153
|
+
return _this.MtjW.Bxsp(campaignId);
|
|
2142
2154
|
});
|
|
2143
|
-
_defineProperty(this, "
|
|
2144
|
-
return _this.
|
|
2155
|
+
_defineProperty(this, "zjQc", function () {
|
|
2156
|
+
return _this.tADd;
|
|
2145
2157
|
});
|
|
2146
2158
|
if (!CE.instance) {
|
|
2147
2159
|
CE.instance = this;
|
|
@@ -2165,7 +2177,7 @@
|
|
|
2165
2177
|
OVERALL: 0,
|
|
2166
2178
|
DATES: {}
|
|
2167
2179
|
};
|
|
2168
|
-
if (this.
|
|
2180
|
+
if (this.tADd) this._qeState[id].DATES[this.tADd] = 0;
|
|
2169
2181
|
this.setQeState(id);
|
|
2170
2182
|
}
|
|
2171
2183
|
} catch (e) {
|
|
@@ -2184,12 +2196,12 @@
|
|
|
2184
2196
|
|
|
2185
2197
|
// Increment the DATES count for this particular date by 1. If the date changes reset.
|
|
2186
2198
|
var currentDate = getDateInDDMMYYYY();
|
|
2187
|
-
if (currentDate !== this.
|
|
2188
|
-
this.
|
|
2199
|
+
if (currentDate !== this.tADd || !(configFrequency.DATES && configFrequency.DATES[currentDate])) {
|
|
2200
|
+
this.tADd = currentDate;
|
|
2189
2201
|
configFrequency.DATES = {};
|
|
2190
|
-
configFrequency.DATES[this.
|
|
2202
|
+
configFrequency.DATES[this.tADd] = 0;
|
|
2191
2203
|
}
|
|
2192
|
-
configFrequency.DATES[this.
|
|
2204
|
+
configFrequency.DATES[this.tADd] = configFrequency.DATES[this.tADd] + 1;
|
|
2193
2205
|
}
|
|
2194
2206
|
}], [{
|
|
2195
2207
|
key: "getInstance",
|
|
@@ -2208,7 +2220,7 @@
|
|
|
2208
2220
|
|
|
2209
2221
|
/* eslint-disable no-empty */
|
|
2210
2222
|
|
|
2211
|
-
window.ceVersion =
|
|
2223
|
+
window.ceVersion = 170;
|
|
2212
2224
|
try {
|
|
2213
2225
|
if (exports !== undefined || exports !== null) {
|
|
2214
2226
|
exports["default"] = CE;
|