apxor-qe 1.2.1 → 1.2.3
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 +415 -413
- package/dist/apxor.qe.min.js +1 -1
- package/package.json +2 -2
package/dist/apxor.qe.js.bak
CHANGED
|
@@ -2,39 +2,39 @@
|
|
|
2
2
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('apxor')) :
|
|
3
3
|
typeof define === 'function' && define.amd ? define(['apxor'], factory) :
|
|
4
4
|
(global = global || self, global['apxor-qe'] = factory(global.Apxor));
|
|
5
|
-
}(this, function (Apxor) { 'use strict';
|
|
5
|
+
}(this, (function (Apxor) { 'use strict';
|
|
6
6
|
|
|
7
|
-
Apxor = Apxor &&
|
|
7
|
+
Apxor = Apxor && Object.prototype.hasOwnProperty.call(Apxor, 'default') ? Apxor['default'] : Apxor;
|
|
8
8
|
|
|
9
|
-
function ownKeys(
|
|
10
|
-
var
|
|
9
|
+
function ownKeys(e, r) {
|
|
10
|
+
var t = Object.keys(e);
|
|
11
11
|
if (Object.getOwnPropertySymbols) {
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
return Object.getOwnPropertyDescriptor(
|
|
15
|
-
})),
|
|
12
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
13
|
+
r && (o = o.filter(function (r) {
|
|
14
|
+
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
15
|
+
})), t.push.apply(t, o);
|
|
16
16
|
}
|
|
17
|
-
return
|
|
17
|
+
return t;
|
|
18
18
|
}
|
|
19
|
-
function _objectSpread2(
|
|
20
|
-
for (var
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
_defineProperty(
|
|
24
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(
|
|
25
|
-
Object.defineProperty(
|
|
19
|
+
function _objectSpread2(e) {
|
|
20
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
21
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
22
|
+
r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
|
|
23
|
+
_defineProperty(e, r, t[r]);
|
|
24
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
|
|
25
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
|
-
return
|
|
28
|
+
return e;
|
|
29
29
|
}
|
|
30
|
-
function _typeof(
|
|
30
|
+
function _typeof(o) {
|
|
31
31
|
"@babel/helpers - typeof";
|
|
32
32
|
|
|
33
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (
|
|
34
|
-
return typeof
|
|
35
|
-
} : function (
|
|
36
|
-
return
|
|
37
|
-
}, _typeof(
|
|
33
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
34
|
+
return typeof o;
|
|
35
|
+
} : function (o) {
|
|
36
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
37
|
+
}, _typeof(o);
|
|
38
38
|
}
|
|
39
39
|
function _classCallCheck(instance, Constructor) {
|
|
40
40
|
if (!(instance instanceof Constructor)) {
|
|
@@ -238,16 +238,16 @@
|
|
|
238
238
|
var Audience = /*#__PURE__*/_createClass(function Audience() {
|
|
239
239
|
var _this = this;
|
|
240
240
|
_classCallCheck(this, Audience);
|
|
241
|
-
_defineProperty(this, "
|
|
242
|
-
_defineProperty(this, "
|
|
243
|
-
_defineProperty(this, "
|
|
241
|
+
_defineProperty(this, "pSoD", "ALL");
|
|
242
|
+
_defineProperty(this, "MNNc", []);
|
|
243
|
+
_defineProperty(this, "AZyK", []);
|
|
244
244
|
_defineProperty(this, "parse", function () {
|
|
245
245
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
246
246
|
try {
|
|
247
|
-
_this.
|
|
248
|
-
_this.
|
|
249
|
-
_this.
|
|
250
|
-
if (!Array.isArray(_this.
|
|
247
|
+
_this.pSoD = config.audience.audience_type;
|
|
248
|
+
_this.MNNc = config.audience.attributes.user;
|
|
249
|
+
_this.AZyK = config.audience.attributes.session;
|
|
250
|
+
if (!Array.isArray(_this.MNNc) || !Array.isArray(_this.AZyK)) {
|
|
251
251
|
Logger.error("No attributes");
|
|
252
252
|
return false;
|
|
253
253
|
}
|
|
@@ -259,49 +259,50 @@
|
|
|
259
259
|
});
|
|
260
260
|
_defineProperty(this, "validate", function (user, session) {
|
|
261
261
|
var status = true;
|
|
262
|
-
if (_this.
|
|
262
|
+
if (_this.pSoD === "FTU") {
|
|
263
263
|
status = Apxor.getController().getSessionInfo().is_first_session;
|
|
264
264
|
}
|
|
265
|
-
return status && _this.
|
|
265
|
+
return status && _this.NqMe(user, _this.MNNc) && _this.NqMe(session, _this.AZyK);
|
|
266
266
|
});
|
|
267
|
-
_defineProperty(this, "
|
|
267
|
+
_defineProperty(this, "NqMe", function (attributes, expected) {
|
|
268
268
|
var length = expected.length;
|
|
269
269
|
var status = true;
|
|
270
270
|
try {
|
|
271
271
|
var _loop = function _loop() {
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
}
|
|
278
|
-
var operator = item.operator;
|
|
279
|
-
var type = item.type;
|
|
280
|
-
var values = item.value.map(function (value) {
|
|
281
|
-
if (type === "s") {
|
|
282
|
-
return value;
|
|
283
|
-
} else if (type === "l") {
|
|
284
|
-
return parseInt(value);
|
|
285
|
-
} else if (type === "f") {
|
|
286
|
-
return parseFloat(value);
|
|
272
|
+
var item = expected[index];
|
|
273
|
+
if (!attributes[item.name] || status === false) {
|
|
274
|
+
return {
|
|
275
|
+
v: false
|
|
276
|
+
};
|
|
287
277
|
}
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
278
|
+
var operator = item.operator;
|
|
279
|
+
var type = item.type;
|
|
280
|
+
var values = item.value.map(function (value) {
|
|
281
|
+
if (type === "s") {
|
|
282
|
+
return value;
|
|
283
|
+
} else if (type === "l") {
|
|
284
|
+
return parseInt(value);
|
|
285
|
+
} else if (type === "f") {
|
|
286
|
+
return parseFloat(value);
|
|
287
|
+
}
|
|
298
288
|
});
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
289
|
+
var loggedValues = [];
|
|
290
|
+
if (Array.isArray(attributes[item.name])) {
|
|
291
|
+
loggedValues = attributes[item.name];
|
|
292
|
+
} else {
|
|
293
|
+
loggedValues = [attributes[item.name]];
|
|
294
|
+
}
|
|
295
|
+
var match = loggedValues.some(function (loggedValue) {
|
|
296
|
+
return values.some(function (configValue) {
|
|
297
|
+
return compare(loggedValue, configValue, operator);
|
|
298
|
+
});
|
|
299
|
+
});
|
|
300
|
+
status = status && match;
|
|
301
|
+
},
|
|
302
|
+
_ret;
|
|
302
303
|
for (var index = 0; index < length; index++) {
|
|
303
|
-
|
|
304
|
-
if (
|
|
304
|
+
_ret = _loop();
|
|
305
|
+
if (_ret) return _ret.v;
|
|
305
306
|
}
|
|
306
307
|
} catch (error) {
|
|
307
308
|
Logger.error(error);
|
|
@@ -315,34 +316,34 @@
|
|
|
315
316
|
var Frequency = /*#__PURE__*/_createClass(function Frequency() {
|
|
316
317
|
var _this = this;
|
|
317
318
|
_classCallCheck(this, Frequency);
|
|
318
|
-
_defineProperty(this, "
|
|
319
|
-
_defineProperty(this, "
|
|
320
|
-
_defineProperty(this, "
|
|
321
|
-
_defineProperty(this, "
|
|
322
|
-
_defineProperty(this, "
|
|
323
|
-
_defineProperty(this, "
|
|
319
|
+
_defineProperty(this, "zwQc", 0);
|
|
320
|
+
_defineProperty(this, "ZPtZ", 0);
|
|
321
|
+
_defineProperty(this, "WkRn", "SESSION");
|
|
322
|
+
_defineProperty(this, "SzTO", 0);
|
|
323
|
+
_defineProperty(this, "FWAX", 0);
|
|
324
|
+
_defineProperty(this, "czAG", 0);
|
|
324
325
|
_defineProperty(this, "parse", function () {
|
|
325
326
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
326
327
|
try {
|
|
327
|
-
_this.
|
|
328
|
-
_this.
|
|
329
|
-
_this.
|
|
330
|
-
_this.
|
|
331
|
-
_this.
|
|
328
|
+
_this.zwQc = config.frequency.count;
|
|
329
|
+
_this.czAG = _this.zwQc;
|
|
330
|
+
_this.ZPtZ = config.frequency.time_interval;
|
|
331
|
+
_this.WkRn = config.frequency.validity;
|
|
332
|
+
_this.FWAX = config.frequency.ses_lmt;
|
|
332
333
|
_this._dayCount = config.frequency.day_lmt;
|
|
333
334
|
// let data = Apxor.getController().getFromStorage(QE_STATE);
|
|
334
335
|
// let qe_state = JSON.parse(decode(Apxor.getSiteId(), data));
|
|
335
336
|
var qe_state = CE.getInstance().getQeState();
|
|
336
337
|
if (!isDefined(qe_state) || !isDefined(qe_state[config._id])) return true;
|
|
337
|
-
if (_this.
|
|
338
|
-
_this.
|
|
339
|
-
if (_this.
|
|
338
|
+
if (_this.WkRn === "SESSION") {
|
|
339
|
+
_this.zwQc = parseInt(_this.zwQc) - parseInt(qe_state[config._id]["SESSION"]);
|
|
340
|
+
if (_this.zwQc <= 0) {
|
|
340
341
|
console.warn("Max count limit reached for session:" + config._id);
|
|
341
342
|
return false;
|
|
342
343
|
}
|
|
343
|
-
} else if (_this.
|
|
344
|
-
_this.
|
|
345
|
-
if (_this.
|
|
344
|
+
} else if (_this.WkRn === "OVERALL") {
|
|
345
|
+
_this.zwQc = parseInt(_this.zwQc) - parseInt(qe_state[config._id]["OVERALL"]);
|
|
346
|
+
if (_this.zwQc <= 0) {
|
|
346
347
|
console.warn("Max count limit reached for overall:" + config._id);
|
|
347
348
|
return false;
|
|
348
349
|
}
|
|
@@ -356,28 +357,28 @@
|
|
|
356
357
|
}
|
|
357
358
|
return true;
|
|
358
359
|
});
|
|
359
|
-
_defineProperty(this, "
|
|
360
|
-
_this.
|
|
360
|
+
_defineProperty(this, "IwRA", function () {
|
|
361
|
+
_this.zwQc = _this.zwQc - 1;
|
|
361
362
|
});
|
|
362
363
|
_defineProperty(this, "getFrequencyCount", function () {
|
|
363
|
-
return _this.
|
|
364
|
+
return _this.zwQc;
|
|
364
365
|
});
|
|
365
|
-
_defineProperty(this, "
|
|
366
|
-
if (_this.
|
|
367
|
-
_this.
|
|
366
|
+
_defineProperty(this, "UYRW", function () {
|
|
367
|
+
if (_this.WkRn === "SESSION") {
|
|
368
|
+
_this.zwQc = _this.czAG;
|
|
368
369
|
Logger$1.info("Campaign Limit reset");
|
|
369
370
|
}
|
|
370
371
|
});
|
|
371
372
|
/**
|
|
372
|
-
* @function
|
|
373
|
+
* @function FwkM
|
|
373
374
|
* @description Validates if the campaign count is with in the limits set in the config.
|
|
374
375
|
* @param {string} Config id
|
|
375
376
|
* @returns {boolean} true - If the Campaign limits are not reached
|
|
376
377
|
* false - Otherwise
|
|
377
378
|
*/
|
|
378
|
-
_defineProperty(this, "
|
|
379
|
+
_defineProperty(this, "FwkM", function (id) {
|
|
379
380
|
try {
|
|
380
|
-
if (_this.
|
|
381
|
+
if (_this.zwQc <= 0) {
|
|
381
382
|
return false;
|
|
382
383
|
}
|
|
383
384
|
|
|
@@ -388,8 +389,8 @@
|
|
|
388
389
|
if (!isDefined(qe_state) || !isDefined(qe_state[id])) return true;
|
|
389
390
|
|
|
390
391
|
//If the config has a session count limit set
|
|
391
|
-
if (_this.
|
|
392
|
-
var sessionCountInConfig = parseInt(_this.
|
|
392
|
+
if (_this.FWAX !== 0) {
|
|
393
|
+
var sessionCountInConfig = parseInt(_this.FWAX);
|
|
393
394
|
var thisSessionCount = parseInt(qe_state[id]["SESSION"]);
|
|
394
395
|
if (sessionCountInConfig - thisSessionCount <= 0) {
|
|
395
396
|
return false;
|
|
@@ -416,14 +417,14 @@
|
|
|
416
417
|
var Meta = /*#__PURE__*/_createClass(function Meta() {
|
|
417
418
|
var _this = this;
|
|
418
419
|
_classCallCheck(this, Meta);
|
|
419
|
-
_defineProperty(this, "
|
|
420
|
-
_defineProperty(this, "
|
|
420
|
+
_defineProperty(this, "XiTx", "");
|
|
421
|
+
_defineProperty(this, "pSoD", "");
|
|
421
422
|
_defineProperty(this, "parse", function () {
|
|
422
423
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
423
424
|
try {
|
|
424
425
|
var _config$meta;
|
|
425
|
-
_this.
|
|
426
|
-
_this.
|
|
426
|
+
_this.XiTx = config.meta.name;
|
|
427
|
+
_this.pSoD = config.meta.type;
|
|
427
428
|
_this._only_context = config.meta.only_context;
|
|
428
429
|
_this._attr = ((_config$meta = config.meta) === null || _config$meta === void 0 ? void 0 : _config$meta.attr) || {};
|
|
429
430
|
} catch (error) {
|
|
@@ -438,11 +439,11 @@
|
|
|
438
439
|
var Validity = /*#__PURE__*/_createClass(function Validity() {
|
|
439
440
|
var _this = this;
|
|
440
441
|
_classCallCheck(this, Validity);
|
|
441
|
-
_defineProperty(this, "
|
|
442
|
-
_defineProperty(this, "
|
|
443
|
-
_defineProperty(this, "
|
|
444
|
-
_defineProperty(this, "
|
|
445
|
-
_defineProperty(this, "
|
|
442
|
+
_defineProperty(this, "Dpxa", -1);
|
|
443
|
+
_defineProperty(this, "YMiy", -1);
|
|
444
|
+
_defineProperty(this, "wPDl", -1);
|
|
445
|
+
_defineProperty(this, "SeqK", -1);
|
|
446
|
+
_defineProperty(this, "XgJJ", false);
|
|
446
447
|
_defineProperty(this, "parse", function () {
|
|
447
448
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
448
449
|
try {
|
|
@@ -450,17 +451,17 @@
|
|
|
450
451
|
Logger$2.error("Not valid dates");
|
|
451
452
|
return false;
|
|
452
453
|
}
|
|
453
|
-
_this.
|
|
454
|
-
_this.
|
|
454
|
+
_this.Dpxa = Date.parse(config.validity.start_date);
|
|
455
|
+
_this.YMiy = Date.parse(config.validity.end_date);
|
|
455
456
|
if (isDefined(config.time_limits_in_day)) {
|
|
456
|
-
_this.
|
|
457
|
-
if (_this.
|
|
457
|
+
_this.XgJJ = config.time_limits_in_day;
|
|
458
|
+
if (_this.XgJJ && isDefined(config.time_limits)) {
|
|
458
459
|
var currentDate = new Date().toISOString().split("T")[0];
|
|
459
|
-
_this.
|
|
460
|
-
_this.
|
|
460
|
+
_this.wPDl = Date.parse(currentDate + "T" + config.time_limits.start_time + ".000Z");
|
|
461
|
+
_this.SeqK = Date.parse(currentDate + "T" + config.time_limits.end_time + ".000Z");
|
|
461
462
|
|
|
462
463
|
// If invalid format is passed, return false
|
|
463
|
-
if (isNaN(_this.
|
|
464
|
+
if (isNaN(_this.wPDl) || isNaN(_this.SeqK)) {
|
|
464
465
|
Logger$2.error("Not valid times");
|
|
465
466
|
return false;
|
|
466
467
|
}
|
|
@@ -474,8 +475,8 @@
|
|
|
474
475
|
});
|
|
475
476
|
_defineProperty(this, "validate", function () {
|
|
476
477
|
var currentTime = Date.now();
|
|
477
|
-
if (currentTime > _this.
|
|
478
|
-
return !_this.
|
|
478
|
+
if (currentTime > _this.Dpxa && currentTime < _this.YMiy) {
|
|
479
|
+
return !_this.XgJJ || currentTime >= _this.wPDl && currentTime <= _this.SeqK;
|
|
479
480
|
}
|
|
480
481
|
return false;
|
|
481
482
|
});
|
|
@@ -484,13 +485,13 @@
|
|
|
484
485
|
var Details = /*#__PURE__*/_createClass(function Details() {
|
|
485
486
|
var _this = this;
|
|
486
487
|
_classCallCheck(this, Details);
|
|
487
|
-
_defineProperty(this, "
|
|
488
|
-
_defineProperty(this, "
|
|
488
|
+
_defineProperty(this, "XiTx", "");
|
|
489
|
+
_defineProperty(this, "BKuT", {});
|
|
489
490
|
_defineProperty(this, "parse", function () {
|
|
490
491
|
var details = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
491
492
|
try {
|
|
492
|
-
_this.
|
|
493
|
-
_this.
|
|
493
|
+
_this.XiTx = details.name;
|
|
494
|
+
_this.BKuT = details.additional_info;
|
|
494
495
|
} catch (error) {
|
|
495
496
|
return false;
|
|
496
497
|
}
|
|
@@ -501,14 +502,14 @@
|
|
|
501
502
|
var Timebounds = /*#__PURE__*/_createClass(function Timebounds() {
|
|
502
503
|
var _this = this;
|
|
503
504
|
_classCallCheck(this, Timebounds);
|
|
504
|
-
_defineProperty(this, "
|
|
505
|
-
_defineProperty(this, "
|
|
505
|
+
_defineProperty(this, "EDYb", 0);
|
|
506
|
+
_defineProperty(this, "qEcy", 0);
|
|
506
507
|
_defineProperty(this, "parse", function () {
|
|
507
508
|
var timeBounds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
508
509
|
try {
|
|
509
|
-
_this.
|
|
510
|
-
_this.
|
|
511
|
-
if (isNaN(_this.
|
|
510
|
+
_this.EDYb = Number(timeBounds.lower);
|
|
511
|
+
_this.qEcy = Number(timeBounds.upper);
|
|
512
|
+
if (isNaN(_this.EDYb) || isNaN(_this.qEcy)) {
|
|
512
513
|
return false;
|
|
513
514
|
}
|
|
514
515
|
} catch (error) {
|
|
@@ -521,17 +522,17 @@
|
|
|
521
522
|
var PreCondition = /*#__PURE__*/_createClass(function PreCondition() {
|
|
522
523
|
var _this = this;
|
|
523
524
|
_classCallCheck(this, PreCondition);
|
|
524
|
-
_defineProperty(this, "
|
|
525
|
-
_defineProperty(this, "
|
|
526
|
-
_defineProperty(this, "
|
|
527
|
-
_defineProperty(this, "
|
|
528
|
-
_defineProperty(this, "
|
|
525
|
+
_defineProperty(this, "Psjs", 0);
|
|
526
|
+
_defineProperty(this, "phws", "");
|
|
527
|
+
_defineProperty(this, "nxGv", "");
|
|
528
|
+
_defineProperty(this, "UJWO", new Details());
|
|
529
|
+
_defineProperty(this, "YrXX", new Timebounds());
|
|
529
530
|
_defineProperty(this, "parse", function () {
|
|
530
531
|
var precondition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
531
532
|
try {
|
|
532
|
-
_this.
|
|
533
|
-
_this.
|
|
534
|
-
return _this.
|
|
533
|
+
_this.phws = precondition.event_type;
|
|
534
|
+
_this.nxGv = precondition.activity;
|
|
535
|
+
return _this.UJWO.parse(precondition.details) && _this.YrXX.parse(precondition.time_bounds);
|
|
535
536
|
} catch (error) {
|
|
536
537
|
return false;
|
|
537
538
|
}
|
|
@@ -542,29 +543,29 @@
|
|
|
542
543
|
var Condition = /*#__PURE__*/_createClass(function Condition() {
|
|
543
544
|
var _this = this;
|
|
544
545
|
_classCallCheck(this, Condition);
|
|
545
|
-
_defineProperty(this, "
|
|
546
|
-
_defineProperty(this, "
|
|
547
|
-
_defineProperty(this, "
|
|
548
|
-
_defineProperty(this, "
|
|
549
|
-
_defineProperty(this, "
|
|
550
|
-
_defineProperty(this, "
|
|
551
|
-
_defineProperty(this, "
|
|
552
|
-
_defineProperty(this, "
|
|
553
|
-
_defineProperty(this, "
|
|
554
|
-
_defineProperty(this, "
|
|
555
|
-
_defineProperty(this, "
|
|
556
|
-
_defineProperty(this, "
|
|
546
|
+
_defineProperty(this, "Psjs", 0);
|
|
547
|
+
_defineProperty(this, "xJVh", -1);
|
|
548
|
+
_defineProperty(this, "zwQc", 0);
|
|
549
|
+
_defineProperty(this, "kxcj", "");
|
|
550
|
+
_defineProperty(this, "nxGv", "");
|
|
551
|
+
_defineProperty(this, "phws", "");
|
|
552
|
+
_defineProperty(this, "YrXX", new Timebounds());
|
|
553
|
+
_defineProperty(this, "UJWO", new Details());
|
|
554
|
+
_defineProperty(this, "pHAk", new PreCondition());
|
|
555
|
+
_defineProperty(this, "JJoS", "AND");
|
|
556
|
+
_defineProperty(this, "VNBK", false);
|
|
557
|
+
_defineProperty(this, "pSoD", void 0);
|
|
557
558
|
_defineProperty(this, "parse", function () {
|
|
558
559
|
var condition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
559
560
|
try {
|
|
560
|
-
_this.
|
|
561
|
-
_this.
|
|
562
|
-
_this.
|
|
563
|
-
_this.
|
|
564
|
-
_this.
|
|
565
|
-
_this.
|
|
566
|
-
_this.
|
|
567
|
-
return _this.
|
|
561
|
+
_this.xJVh = condition.sequence;
|
|
562
|
+
_this.zwQc = condition.count_config.count;
|
|
563
|
+
_this.kxcj = condition.count_config.operator;
|
|
564
|
+
_this.nxGv = condition.activity;
|
|
565
|
+
_this.phws = condition.event_type;
|
|
566
|
+
_this.JJoS = condition.combine_operator;
|
|
567
|
+
_this.pSoD = condition.type;
|
|
568
|
+
return _this.UJWO.parse(condition.details) && _this.pHAk.parse(condition.trigger) && _this.YrXX.parse(condition.time_bounds);
|
|
568
569
|
} catch (error) {
|
|
569
570
|
Logger$3.error(error);
|
|
570
571
|
return false;
|
|
@@ -578,19 +579,19 @@
|
|
|
578
579
|
function ConditionValidator() {
|
|
579
580
|
var _this = this;
|
|
580
581
|
_classCallCheck(this, ConditionValidator);
|
|
581
|
-
_defineProperty(this, "
|
|
582
|
-
_defineProperty(this, "
|
|
583
|
-
_defineProperty(this, "
|
|
584
|
-
_defineProperty(this, "
|
|
585
|
-
_defineProperty(this, "
|
|
586
|
-
_defineProperty(this, "
|
|
587
|
-
_defineProperty(this, "
|
|
588
|
-
_defineProperty(this, "
|
|
589
|
-
_defineProperty(this, "
|
|
590
|
-
_defineProperty(this, "
|
|
591
|
-
_defineProperty(this, "
|
|
582
|
+
_defineProperty(this, "GFNv", 0);
|
|
583
|
+
_defineProperty(this, "Eusd", "");
|
|
584
|
+
_defineProperty(this, "FdIU", new Condition());
|
|
585
|
+
_defineProperty(this, "KoRY", false);
|
|
586
|
+
_defineProperty(this, "gCiS", false);
|
|
587
|
+
_defineProperty(this, "lVAx", 0);
|
|
588
|
+
_defineProperty(this, "JJoS", "AND");
|
|
589
|
+
_defineProperty(this, "Fqrt", -1);
|
|
590
|
+
_defineProperty(this, "IoCi", []);
|
|
591
|
+
_defineProperty(this, "bGlk", {});
|
|
592
|
+
_defineProperty(this, "PLjP", false);
|
|
592
593
|
/**
|
|
593
|
-
* If respectSequence is true, don't auto-
|
|
594
|
+
* If respectSequence is true, don't auto-alSx to events except for the condition whose index is 0
|
|
594
595
|
*
|
|
595
596
|
* @param condition
|
|
596
597
|
* @param type
|
|
@@ -605,155 +606,155 @@
|
|
|
605
606
|
var index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
606
607
|
var respectSequence = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
607
608
|
var noKpiArray = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
|
|
608
|
-
_this.
|
|
609
|
-
_this.
|
|
610
|
-
_this.
|
|
611
|
-
var result = _this.
|
|
609
|
+
_this.Eusd = id;
|
|
610
|
+
_this.lVAx = index;
|
|
611
|
+
_this.IoCi = noKpiArray;
|
|
612
|
+
var result = _this.FdIU.parse(condition);
|
|
612
613
|
if (result) {
|
|
613
|
-
_this.
|
|
614
|
+
_this.JJoS = _this.FdIU.JJoS;
|
|
614
615
|
|
|
615
616
|
// FIXME: Why this code is written? Don't see any usecase
|
|
616
|
-
if (_this.
|
|
617
|
-
var eventName = _this.
|
|
617
|
+
if (_this.FdIU.VNBK) {
|
|
618
|
+
var eventName = _this.FdIU.UJWO.XiTx;
|
|
618
619
|
if (eventName === "APX_PAGE_OPENED") {
|
|
619
|
-
eventName = _this.
|
|
620
|
-
eventName = isDefined(eventName) ? eventName : _this.
|
|
620
|
+
eventName = _this.FdIU.UJWO.BKuT["navigation_id"];
|
|
621
|
+
eventName = isDefined(eventName) ? eventName : _this.FdIU.UJWO.XiTx;
|
|
621
622
|
}
|
|
622
|
-
_this.
|
|
623
|
-
var count = _this.
|
|
624
|
-
var operator = _this.
|
|
625
|
-
_this.
|
|
626
|
-
_this.
|
|
627
|
-
// If the condition is already satisfied and if it is page view, no need to
|
|
623
|
+
_this.Fqrt = Apxor.getController().getEventCount(eventName);
|
|
624
|
+
var count = _this.FdIU.zwQc;
|
|
625
|
+
var operator = _this.FdIU.kxcj;
|
|
626
|
+
_this.gCiS = _this.HAgk(_this.Fqrt - 1, count, operator, false);
|
|
627
|
+
_this.KoRY = _this.gCiS;
|
|
628
|
+
// If the condition is already satisfied and if it is page view, no need to alSx
|
|
628
629
|
// This only applies for NAVIGATION_EVENTS
|
|
629
|
-
if (_this.
|
|
630
|
+
if (_this.gCiS && _this.FdIU.UJWO.XiTx === "APX_PAGE_OPENED") {
|
|
630
631
|
return true;
|
|
631
632
|
}
|
|
632
633
|
}
|
|
633
634
|
if (!respectSequence || index === 0) {
|
|
634
|
-
_this.
|
|
635
|
+
_this.alSx();
|
|
635
636
|
}
|
|
636
637
|
return true;
|
|
637
638
|
}
|
|
638
639
|
return false;
|
|
639
640
|
});
|
|
640
|
-
_defineProperty(this, "
|
|
641
|
-
var condition = _this.
|
|
642
|
-
var precondition = condition.
|
|
641
|
+
_defineProperty(this, "alSx", function () {
|
|
642
|
+
var condition = _this.FdIU;
|
|
643
|
+
var precondition = condition.pHAk;
|
|
643
644
|
var ceInstance = CE.getInstance();
|
|
644
|
-
if (precondition.
|
|
645
|
-
_this.
|
|
646
|
-
ceInstance.registerForEvent(generateKey(condition.
|
|
645
|
+
if (precondition.phws === "app_start") {
|
|
646
|
+
_this.KoRY = true;
|
|
647
|
+
ceInstance.registerForEvent(generateKey(condition.phws) + "___" + condition.UJWO.XiTx, _this.HcVn);
|
|
647
648
|
} else {
|
|
648
|
-
ceInstance.registerForEvent(generateKey(condition.
|
|
649
|
+
ceInstance.registerForEvent(generateKey(condition.phws) + "___" + precondition.UJWO.XiTx, _this.HcVn);
|
|
649
650
|
}
|
|
650
651
|
});
|
|
651
|
-
_defineProperty(this, "
|
|
652
|
-
var _this$
|
|
652
|
+
_defineProperty(this, "GNlE", function (type, name, time, additionalInfo) {
|
|
653
|
+
var _this$FdIU;
|
|
653
654
|
var eventTime = Date.now();
|
|
654
|
-
var time_differnce = (eventTime - _this.
|
|
655
|
-
var time_fromConfig = ((_this$
|
|
655
|
+
var time_differnce = (eventTime - _this.bGlk[name]) / 1000;
|
|
656
|
+
var time_fromConfig = ((_this$FdIU = _this.FdIU) === null || _this$FdIU === void 0 || (_this$FdIU = _this$FdIU.UJWO) === null || _this$FdIU === void 0 || (_this$FdIU = _this$FdIU.BKuT) === null || _this$FdIU === void 0 ? void 0 : _this$FdIU.time) / 1000;
|
|
656
657
|
if (time_fromConfig > time_differnce) {
|
|
657
658
|
_this._displayCampaign(time);
|
|
658
659
|
}
|
|
659
660
|
});
|
|
660
|
-
_defineProperty(this, "
|
|
661
|
-
var _this$_condition2, _this$
|
|
662
|
-
_this.
|
|
661
|
+
_defineProperty(this, "zRAr", function (type, name, time, additionalInfo) {
|
|
662
|
+
var _this$_condition2, _this$_condition3;
|
|
663
|
+
_this.PLjP = true;
|
|
663
664
|
var currentTime = Date.now();
|
|
664
|
-
var eventName = (_this$_condition2 = _this.
|
|
665
|
-
var eventTime = _this.
|
|
665
|
+
var eventName = (_this$_condition2 = _this.FdIU) === null || _this$_condition2 === void 0 || (_this$_condition2 = _this$_condition2.pHAk) === null || _this$_condition2 === void 0 ? void 0 : _this$_condition2.UJWO.XiTx;
|
|
666
|
+
var eventTime = _this.bGlk[eventName];
|
|
666
667
|
var time_differnce = (currentTime - eventTime) / 1000;
|
|
667
|
-
var time_fromConfig = (_this$_condition3 = _this.
|
|
668
|
+
var time_fromConfig = (_this$_condition3 = _this.FdIU) === null || _this$_condition3 === void 0 || (_this$_condition3 = _this$_condition3.UJWO) === null || _this$_condition3 === void 0 || (_this$_condition3 = _this$_condition3.BKuT) === null || _this$_condition3 === void 0 ? void 0 : _this$_condition3.time;
|
|
668
669
|
time_fromConfig = time_fromConfig / 1000;
|
|
669
670
|
if (time_fromConfig > time_differnce) {
|
|
670
671
|
_this._displayCampaign(time);
|
|
671
672
|
}
|
|
672
673
|
//unregister the event
|
|
673
674
|
});
|
|
674
|
-
_defineProperty(this, "
|
|
675
|
+
_defineProperty(this, "HcVn", function (type, name, time, additionalInfo) {
|
|
675
676
|
var ceInstance = CE.getInstance();
|
|
676
|
-
if (!_this.
|
|
677
|
+
if (!_this.KoRY) {
|
|
677
678
|
// Validate Precondition
|
|
678
|
-
_this.
|
|
679
|
-
if (_this.
|
|
680
|
-
var condition = _this.
|
|
681
|
-
var precondition = condition.
|
|
682
|
-
precondition.
|
|
679
|
+
_this.KoRY = _this.mAby(type, name, time, additionalInfo);
|
|
680
|
+
if (_this.KoRY) {
|
|
681
|
+
var condition = _this.FdIU;
|
|
682
|
+
var precondition = condition.pHAk;
|
|
683
|
+
precondition.Psjs = time;
|
|
683
684
|
//events will be registred by its type activity event_type: "activity_time"
|
|
684
|
-
if ((condition === null || condition === void 0 ? void 0 : condition.
|
|
685
|
-
var
|
|
686
|
-
var event_time = condition === null || condition === void 0
|
|
687
|
-
if ((condition === null || condition === void 0
|
|
685
|
+
if ((condition === null || condition === void 0 ? void 0 : condition.phws) === "activity_time") {
|
|
686
|
+
var FdIU$UJWO, FdIU$_details2, FdIU$_details3;
|
|
687
|
+
var event_time = condition === null || condition === void 0 || (FdIU$UJWO = condition.UJWO) === null || FdIU$UJWO === void 0 || (FdIU$UJWO = FdIU$UJWO.BKuT) === null || FdIU$UJWO === void 0 ? void 0 : FdIU$UJWO.time;
|
|
688
|
+
if ((condition === null || condition === void 0 || (FdIU$_details2 = condition.UJWO) === null || FdIU$_details2 === void 0 || (FdIU$_details2 = FdIU$_details2.BKuT) === null || FdIU$_details2 === void 0 ? void 0 : FdIU$_details2.nkpi.length) > 0) {
|
|
688
689
|
setTimeout(function () {
|
|
689
|
-
if (!_this.
|
|
690
|
-
_this.
|
|
691
|
-
if (_this.
|
|
692
|
-
_this.
|
|
693
|
-
_this.
|
|
694
|
-
if (_this.
|
|
695
|
-
_this.
|
|
696
|
-
ceInstance.validate(_this.
|
|
690
|
+
if (!_this.PLjP) {
|
|
691
|
+
_this.gCiS = true;
|
|
692
|
+
if (_this.gCiS) {
|
|
693
|
+
_this.GFNv += 1;
|
|
694
|
+
_this.gCiS = _this.HAgk(_this.GFNv, _this.FdIU.zwQc, _this.FdIU.kxcj);
|
|
695
|
+
if (_this.gCiS) {
|
|
696
|
+
_this.FdIU.Psjs = time;
|
|
697
|
+
ceInstance.validate(_this.Eusd, _this.lVAx);
|
|
697
698
|
}
|
|
698
699
|
}
|
|
699
700
|
}
|
|
700
|
-
condition.
|
|
701
|
-
ceInstance.unregisterFromEvent(toUpperCase(condition.
|
|
701
|
+
condition.UJWO.BKuT.nkpi.map(function (nokpi) {
|
|
702
|
+
ceInstance.unregisterFromEvent(toUpperCase(condition.UJWO.BKuT.et) + "___" + nokpi, _this);
|
|
702
703
|
});
|
|
703
704
|
}, event_time);
|
|
704
|
-
condition.
|
|
705
|
-
ceInstance.registerForEvent(toUpperCase(condition.
|
|
705
|
+
condition.UJWO.BKuT.nkpi.map(function (nokpi) {
|
|
706
|
+
ceInstance.registerForEvent(toUpperCase(condition.UJWO.BKuT.et) + "___" + nokpi, _this.zRAr);
|
|
706
707
|
});
|
|
707
708
|
}
|
|
708
709
|
//it is for unregistering the events did case after completing the time imit
|
|
709
|
-
if ((condition === null || condition === void 0
|
|
710
|
+
if ((condition === null || condition === void 0 || (FdIU$_details3 = condition.UJWO) === null || FdIU$_details3 === void 0 || (FdIU$_details3 = FdIU$_details3.BKuT) === null || FdIU$_details3 === void 0 ? void 0 : FdIU$_details3.kpi.length) > 0) {
|
|
710
711
|
setTimeout(function () {
|
|
711
|
-
condition.
|
|
712
|
-
ceInstance.unregisterFromEvent(toUpperCase(condition.
|
|
712
|
+
condition.UJWO.BKuT.kpi.map(function (kpi) {
|
|
713
|
+
ceInstance.unregisterFromEvent(toUpperCase(condition.UJWO.BKuT.et) + "___" + kpi, _this);
|
|
713
714
|
});
|
|
714
715
|
}, event_time);
|
|
715
|
-
condition.
|
|
716
|
-
if (kpi === condition.
|
|
716
|
+
condition.UJWO.BKuT.kpi.map(function (kpi) {
|
|
717
|
+
if (kpi === condition.pHAk.UJWO.XiTx) {
|
|
717
718
|
//unregister the previous event
|
|
718
|
-
ceInstance.unregisterFromEvent(generateKey(precondition.
|
|
719
|
-
ceInstance.registerForEvent(toUpperCase(condition.
|
|
719
|
+
ceInstance.unregisterFromEvent(generateKey(precondition.phws) + "___" + precondition.UJWO.XiTx, _this);
|
|
720
|
+
ceInstance.registerForEvent(toUpperCase(condition.UJWO.BKuT.et) + "___" + kpi, _this.GNlE);
|
|
720
721
|
} else {
|
|
721
|
-
ceInstance.registerForEvent(toUpperCase(condition.
|
|
722
|
+
ceInstance.registerForEvent(toUpperCase(condition.UJWO.BKuT.et) + "___" + kpi, _this.zRAr);
|
|
722
723
|
}
|
|
723
724
|
});
|
|
724
725
|
}
|
|
725
726
|
} else {
|
|
726
|
-
ceInstance.unregisterFromEvent(generateKey(precondition.
|
|
727
|
-
ceInstance.registerForEvent(generateKey(condition.
|
|
727
|
+
ceInstance.unregisterFromEvent(generateKey(precondition.phws) + "___" + precondition.UJWO.XiTx, _this);
|
|
728
|
+
ceInstance.registerForEvent(generateKey(condition.phws) + "___" + condition.UJWO.XiTx, _this);
|
|
728
729
|
}
|
|
729
|
-
_this.
|
|
730
|
+
_this.bGlk[name] = Date.now();
|
|
730
731
|
}
|
|
731
732
|
return;
|
|
732
733
|
}
|
|
733
734
|
|
|
734
735
|
// Validate Condition
|
|
735
|
-
var validationStatus = generateKey(_this.
|
|
736
|
+
var validationStatus = generateKey(_this.FdIU.phws) === type && _this.INmv(time - _this.FdIU.pHAk.Psjs, _this.FdIU.YrXX) && _this.FdIU.UJWO.XiTx === name && _this.FRhW(_this.FdIU.UJWO.BKuT, additionalInfo);
|
|
736
737
|
if (validationStatus) {
|
|
737
|
-
_this.
|
|
738
|
-
_this.
|
|
739
|
-
if (_this.
|
|
740
|
-
_this.
|
|
741
|
-
ceInstance.validate(_this.
|
|
738
|
+
_this.GFNv += 1;
|
|
739
|
+
_this.gCiS = _this.HAgk(_this.GFNv, _this.FdIU.zwQc, _this.FdIU.kxcj);
|
|
740
|
+
if (_this.gCiS) {
|
|
741
|
+
_this.FdIU.Psjs = time;
|
|
742
|
+
ceInstance.validate(_this.Eusd, _this.lVAx);
|
|
742
743
|
}
|
|
743
744
|
}
|
|
744
745
|
});
|
|
745
|
-
_defineProperty(this, "
|
|
746
|
-
var precondition = _this.
|
|
747
|
-
return generateKey(precondition.
|
|
746
|
+
_defineProperty(this, "mAby", function (type, name, time, additionalInfo) {
|
|
747
|
+
var precondition = _this.FdIU.pHAk;
|
|
748
|
+
return generateKey(precondition.phws) === type && precondition.UJWO.XiTx === name && _this.INmv(time, precondition.YrXX) && _this.FRhW(precondition.UJWO.BKuT, additionalInfo);
|
|
748
749
|
});
|
|
749
|
-
_defineProperty(this, "
|
|
750
|
+
_defineProperty(this, "INmv", function (time, timeBounds) {
|
|
750
751
|
var currentTime = Math.ceil(time);
|
|
751
|
-
return currentTime > timeBounds.
|
|
752
|
+
return currentTime > timeBounds.EDYb && currentTime < timeBounds.qEcy;
|
|
752
753
|
});
|
|
753
|
-
_defineProperty(this, "
|
|
754
|
+
_defineProperty(this, "HAgk", function (current, required, operator) {
|
|
754
755
|
var checkOld = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
755
|
-
if (checkOld && _this.
|
|
756
|
-
current = current + _this.
|
|
756
|
+
if (checkOld && _this.FdIU.VNBK) {
|
|
757
|
+
current = current + _this.Fqrt;
|
|
757
758
|
}
|
|
758
759
|
switch (operator) {
|
|
759
760
|
case "EQ":
|
|
@@ -770,41 +771,42 @@
|
|
|
770
771
|
return false;
|
|
771
772
|
}
|
|
772
773
|
});
|
|
773
|
-
_defineProperty(this, "
|
|
774
|
+
_defineProperty(this, "FRhW", function (expected, received) {
|
|
774
775
|
var status = true;
|
|
775
776
|
try {
|
|
776
777
|
var _loop = function _loop() {
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
}
|
|
782
|
-
if (_typeof(expected[item]) === "object") {
|
|
783
|
-
var operator = expected[item].op;
|
|
784
|
-
var type = expected[item].t;
|
|
785
|
-
var expectedValue;
|
|
786
|
-
if (type === "s") {
|
|
787
|
-
expectedValue = expected[item].val;
|
|
788
|
-
} else if (type === "l" || type === "f") {
|
|
789
|
-
expectedValue = parseFloat(expected[item].val);
|
|
778
|
+
if (!received[item] || status === false) {
|
|
779
|
+
return {
|
|
780
|
+
v: false
|
|
781
|
+
};
|
|
790
782
|
}
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
783
|
+
if (_typeof(expected[item]) === "object") {
|
|
784
|
+
var operator = expected[item].op;
|
|
785
|
+
var type = expected[item].t;
|
|
786
|
+
var expectedValue;
|
|
787
|
+
if (type === "s") {
|
|
788
|
+
expectedValue = expected[item].val;
|
|
789
|
+
} else if (type === "l" || type === "f") {
|
|
790
|
+
expectedValue = parseFloat(expected[item].val);
|
|
791
|
+
}
|
|
792
|
+
var loggedValues = [];
|
|
793
|
+
if (Array.isArray(received[item])) {
|
|
794
|
+
loggedValues = received[item];
|
|
795
|
+
} else {
|
|
796
|
+
loggedValues = [received[item]];
|
|
797
|
+
}
|
|
798
|
+
var match = loggedValues.some(function (loggedValue) {
|
|
799
|
+
return compare(loggedValue, expectedValue, operator);
|
|
800
|
+
});
|
|
801
|
+
status = status && match;
|
|
794
802
|
} else {
|
|
795
|
-
|
|
803
|
+
status = status && compare(received[item], expected[item], "EQ");
|
|
796
804
|
}
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
});
|
|
800
|
-
status = status && match;
|
|
801
|
-
} else {
|
|
802
|
-
status = status && compare(received[item], expected[item], "EQ");
|
|
803
|
-
}
|
|
804
|
-
};
|
|
805
|
+
},
|
|
806
|
+
_ret;
|
|
805
807
|
for (var item in expected) {
|
|
806
|
-
|
|
807
|
-
if (
|
|
808
|
+
_ret = _loop();
|
|
809
|
+
if (_ret) return _ret.v;
|
|
808
810
|
}
|
|
809
811
|
} catch (error) {
|
|
810
812
|
Logger$4.error(error);
|
|
@@ -817,13 +819,13 @@
|
|
|
817
819
|
key: "_displayCampaign",
|
|
818
820
|
value: function _displayCampaign(time) {
|
|
819
821
|
var ceInstance = CE.getInstance();
|
|
820
|
-
this.
|
|
821
|
-
if (this.
|
|
822
|
-
this.
|
|
823
|
-
this.
|
|
824
|
-
if (this.
|
|
825
|
-
this.
|
|
826
|
-
ceInstance.validate(this.
|
|
822
|
+
this.gCiS = true;
|
|
823
|
+
if (this.gCiS) {
|
|
824
|
+
this.GFNv += 1;
|
|
825
|
+
this.gCiS = this.HAgk(this.GFNv, this.FdIU.zwQc, this.FdIU.kxcj);
|
|
826
|
+
if (this.gCiS) {
|
|
827
|
+
this.FdIU.Psjs = time;
|
|
828
|
+
ceInstance.validate(this.Eusd, this.lVAx);
|
|
827
829
|
}
|
|
828
830
|
}
|
|
829
831
|
}
|
|
@@ -840,20 +842,20 @@
|
|
|
840
842
|
var OverallConfig = /*#__PURE__*/_createClass(function OverallConfig() {
|
|
841
843
|
var _this = this;
|
|
842
844
|
_classCallCheck(this, OverallConfig);
|
|
843
|
-
_defineProperty(this, "
|
|
845
|
+
_defineProperty(this, "VJYi", []);
|
|
844
846
|
_defineProperty(this, "_ret_day", {});
|
|
845
|
-
_defineProperty(this, "
|
|
846
|
-
_defineProperty(this, "
|
|
847
|
-
_defineProperty(this, "
|
|
847
|
+
_defineProperty(this, "EsoR", {});
|
|
848
|
+
_defineProperty(this, "sVml", false);
|
|
849
|
+
_defineProperty(this, "stSX", false);
|
|
848
850
|
_defineProperty(this, "parse", function () {
|
|
849
851
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
850
852
|
try {
|
|
851
|
-
_this.
|
|
853
|
+
_this.VJYi = config.overall_cfg.events;
|
|
852
854
|
_this._ret_day = config.overall_cfg.ret_day;
|
|
853
|
-
_this.
|
|
854
|
-
_this.
|
|
855
|
-
_this.
|
|
856
|
-
_this.
|
|
855
|
+
_this.EsoR = config.overall_cfg.session;
|
|
856
|
+
_this.sVml = config.overall_cfg.toggleRetDay;
|
|
857
|
+
_this.VJYi = config.overall_cfg.events;
|
|
858
|
+
_this.stSX = config.overall_cfg.toggleSession;
|
|
857
859
|
} catch (error) {
|
|
858
860
|
Logger$5.error(error);
|
|
859
861
|
return false;
|
|
@@ -863,10 +865,10 @@
|
|
|
863
865
|
_defineProperty(this, "validate", function () {
|
|
864
866
|
var retainedDays = parseInt(Apxor.getController().getFromStorage(APX_RETAINED_DAYS));
|
|
865
867
|
var retainedSession = parseInt(Apxor.getController().getFromStorage(APX_RETAINED_SESSIONS));
|
|
866
|
-
if (_this.
|
|
868
|
+
if (_this.sVml && !isNaN(retainedDays) && !(retainedDays >= _this._ret_day.from && retainedDays <= _this._ret_day.to)) {
|
|
867
869
|
return false;
|
|
868
870
|
}
|
|
869
|
-
if (_this.
|
|
871
|
+
if (_this.stSX && !isNaN(retainedSession) && !(retainedSession >= _this.EsoR.from && retainedSession <= _this.EsoR.to)) {
|
|
870
872
|
return false;
|
|
871
873
|
}
|
|
872
874
|
try {
|
|
@@ -874,8 +876,8 @@
|
|
|
874
876
|
var data = Apxor.getController().getFromStorage("_apx_lt_count");
|
|
875
877
|
var siteid = Apxor.getSiteId();
|
|
876
878
|
var LtCountObjDecoded = JSON.parse(decode(siteid, data));
|
|
877
|
-
for (var i = 0; i < _this.
|
|
878
|
-
var evName = _this.
|
|
879
|
+
for (var i = 0; i < _this.VJYi.length; i++) {
|
|
880
|
+
var evName = _this.VJYi[i].name.replace("'", "").replace("’", "");
|
|
879
881
|
if (LtCountObjDecoded[evName]) {
|
|
880
882
|
return false;
|
|
881
883
|
}
|
|
@@ -891,15 +893,15 @@
|
|
|
891
893
|
var ConfigItem = /*#__PURE__*/_createClass(function ConfigItem() {
|
|
892
894
|
var _this = this;
|
|
893
895
|
_classCallCheck(this, ConfigItem);
|
|
894
|
-
_defineProperty(this, "
|
|
895
|
-
_defineProperty(this, "
|
|
896
|
-
_defineProperty(this, "
|
|
897
|
-
_defineProperty(this, "
|
|
898
|
-
_defineProperty(this, "
|
|
899
|
-
_defineProperty(this, "
|
|
900
|
-
_defineProperty(this, "
|
|
901
|
-
_defineProperty(this, "
|
|
902
|
-
_defineProperty(this, "
|
|
896
|
+
_defineProperty(this, "HMDi", []);
|
|
897
|
+
_defineProperty(this, "Eusd", "");
|
|
898
|
+
_defineProperty(this, "TZgO", new Meta());
|
|
899
|
+
_defineProperty(this, "ygTF", new Audience());
|
|
900
|
+
_defineProperty(this, "WkRn", new Validity());
|
|
901
|
+
_defineProperty(this, "JOfv", new Frequency());
|
|
902
|
+
_defineProperty(this, "OLfY", new OverallConfig());
|
|
903
|
+
_defineProperty(this, "vZax", false);
|
|
904
|
+
_defineProperty(this, "fyZj", []);
|
|
903
905
|
_defineProperty(this, "parse", function () {
|
|
904
906
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
905
907
|
try {
|
|
@@ -916,7 +918,7 @@
|
|
|
916
918
|
}
|
|
917
919
|
|
|
918
920
|
// If META, VALIDITY, FREQUENCY and AUDIENCE is not parsed properly, throw it out
|
|
919
|
-
if (!(_this.
|
|
921
|
+
if (!(_this.TZgO.parse(config) && _this.WkRn.parse(config) && _this.JOfv.parse(config) && _this.ygTF.parse(config) && _this.OLfY.parse(config))) {
|
|
920
922
|
return false;
|
|
921
923
|
}
|
|
922
924
|
|
|
@@ -925,9 +927,9 @@
|
|
|
925
927
|
Logger$6.error("No valid conditions", config.conditions);
|
|
926
928
|
return false;
|
|
927
929
|
}
|
|
928
|
-
_this.
|
|
929
|
-
_this.
|
|
930
|
-
if (_this.
|
|
930
|
+
_this.Eusd = config._id;
|
|
931
|
+
_this.vZax = isDefined(config.sequence_enabled) ? config.sequence_enabled : false;
|
|
932
|
+
if (_this.vZax) {
|
|
931
933
|
// iff respectSequence is true, Sort the Conditions by their sequence order
|
|
932
934
|
// We need to sort, if server sends them in orderless manner
|
|
933
935
|
config.conditions.sort(function (prev, current) {
|
|
@@ -939,17 +941,17 @@
|
|
|
939
941
|
var conditions = config.conditions;
|
|
940
942
|
var length = conditions.length;
|
|
941
943
|
for (var index = 0; index < length; index++) {
|
|
942
|
-
_this.
|
|
944
|
+
_this.fyZj = [];
|
|
943
945
|
var condition = conditions[index];
|
|
944
946
|
if (condition.type === "didn't") {
|
|
945
|
-
var
|
|
947
|
+
var FdIU$details;
|
|
946
948
|
var obj = {
|
|
947
949
|
trigger_key: condition.trigger.details.name,
|
|
948
|
-
no_kpi_array: condition === null || condition === void 0
|
|
950
|
+
no_kpi_array: condition === null || condition === void 0 || (FdIU$details = condition.details) === null || FdIU$details === void 0 || (FdIU$details = FdIU$details.additional_info) === null || FdIU$details === void 0 ? void 0 : FdIU$details.nkpi,
|
|
949
951
|
condition_id: condition === null || condition === void 0 ? void 0 : condition._id,
|
|
950
952
|
time_bounds: condition.time_bounds.upper
|
|
951
953
|
};
|
|
952
|
-
_this.
|
|
954
|
+
_this.fyZj = [].concat(_toConsumableArray(_this.fyZj), [obj]);
|
|
953
955
|
//this will be the key
|
|
954
956
|
//when event occur check this array and then then check the time
|
|
955
957
|
//check the time diffrence
|
|
@@ -958,57 +960,57 @@
|
|
|
958
960
|
}
|
|
959
961
|
|
|
960
962
|
var conditionValidator = new ConditionValidator();
|
|
961
|
-
if (conditionValidator.initialize(condition, _this.
|
|
962
|
-
_this.
|
|
963
|
+
if (conditionValidator.initialize(condition, _this.Eusd, index, _this.vZax, _this.fyZj)) {
|
|
964
|
+
_this.HMDi.push(conditionValidator);
|
|
963
965
|
}
|
|
964
966
|
}
|
|
965
|
-
return _this.
|
|
967
|
+
return _this.HMDi.length > 0;
|
|
966
968
|
} catch (error) {
|
|
967
969
|
Logger$6.error(error);
|
|
968
970
|
return false;
|
|
969
971
|
}
|
|
970
972
|
});
|
|
971
|
-
_defineProperty(this, "
|
|
973
|
+
_defineProperty(this, "ZsYF", function (index) {
|
|
972
974
|
if (index < 0) {
|
|
973
975
|
return;
|
|
974
976
|
}
|
|
975
|
-
if (_this.
|
|
976
|
-
var conditionValidator = _this.
|
|
977
|
-
if (isDefined(conditionValidator) && conditionValidator.
|
|
977
|
+
if (_this.vZax) {
|
|
978
|
+
var conditionValidator = _this.HMDi[index];
|
|
979
|
+
if (isDefined(conditionValidator) && conditionValidator.gCiS) {
|
|
978
980
|
// Check if previous validator is satisfied
|
|
979
|
-
var prevValidator = _this.
|
|
980
|
-
if (isDefined(prevValidator) && !prevValidator.
|
|
981
|
+
var prevValidator = _this.HMDi[index - 1];
|
|
982
|
+
if (isDefined(prevValidator) && !prevValidator.gCiS) {
|
|
981
983
|
// TODO: If current index is satisfied before previous one, do something
|
|
982
984
|
// either unregister all conditions or remove this item from ConfigLookup
|
|
983
985
|
return;
|
|
984
986
|
}
|
|
985
|
-
var nextValidator = _this.
|
|
987
|
+
var nextValidator = _this.HMDi[index + 1];
|
|
986
988
|
if (!isDefined(nextValidator)) {
|
|
987
989
|
// It means this is the last condition
|
|
988
990
|
// Validate all conditions
|
|
989
|
-
_this.
|
|
991
|
+
_this.wcgW();
|
|
990
992
|
} else {
|
|
991
|
-
nextValidator.
|
|
993
|
+
nextValidator.alSx();
|
|
992
994
|
}
|
|
993
995
|
}
|
|
994
996
|
} else {
|
|
995
997
|
// Validate all conditions
|
|
996
|
-
_this.
|
|
998
|
+
_this.wcgW();
|
|
997
999
|
}
|
|
998
1000
|
});
|
|
999
|
-
_defineProperty(this, "
|
|
1001
|
+
_defineProperty(this, "wcgW", function () {
|
|
1000
1002
|
// Check If Audience, Validity is satisfied or not
|
|
1001
1003
|
var userAttributes = Apxor.getController().getUserAttributes();
|
|
1002
1004
|
var sessionAttributes = Apxor.getController().getSessionAttributes();
|
|
1003
|
-
if (!_this.
|
|
1005
|
+
if (!_this.WkRn.validate() || !_this.ygTF.validate(userAttributes, sessionAttributes) || !_this.OLfY.validate()) {
|
|
1004
1006
|
return;
|
|
1005
1007
|
}
|
|
1006
|
-
var length = _this.
|
|
1008
|
+
var length = _this.HMDi.length;
|
|
1007
1009
|
var isSatisfied = length < 1;
|
|
1008
1010
|
var combineOperator = "";
|
|
1009
1011
|
for (var index = 0; index < length; index++) {
|
|
1010
|
-
var validator = _this.
|
|
1011
|
-
var currentResult = validator.
|
|
1012
|
+
var validator = _this.HMDi[index];
|
|
1013
|
+
var currentResult = validator.gCiS;
|
|
1012
1014
|
if (combineOperator.trim() === "") {
|
|
1013
1015
|
isSatisfied = currentResult;
|
|
1014
1016
|
} else {
|
|
@@ -1021,47 +1023,47 @@
|
|
|
1021
1023
|
break;
|
|
1022
1024
|
}
|
|
1023
1025
|
}
|
|
1024
|
-
combineOperator = validator.
|
|
1026
|
+
combineOperator = validator.JJoS;
|
|
1025
1027
|
}
|
|
1026
1028
|
if (isSatisfied) {
|
|
1027
1029
|
console.debug("onCondition satisfied");
|
|
1028
1030
|
// Check if count reached it's maximum
|
|
1029
|
-
if (!_this.
|
|
1030
|
-
console.warn("Maximum limit reached", _this.
|
|
1031
|
+
if (!_this.JOfv.FwkM(_this.Eusd)) {
|
|
1032
|
+
console.warn("Maximum limit reached", _this.Eusd);
|
|
1031
1033
|
return;
|
|
1032
1034
|
}
|
|
1033
|
-
console.log("Dispatching event", _this.
|
|
1034
|
-
if (_this.
|
|
1035
|
-
Apxor.logEvent(APX_CONTEXT_EVALUATED, _objectSpread2(_objectSpread2({}, _this.
|
|
1036
|
-
message_name: _this.
|
|
1037
|
-
id: _this.
|
|
1035
|
+
console.log("Dispatching event", _this.TZgO.pSoD);
|
|
1036
|
+
if (_this.TZgO._only_context === true) {
|
|
1037
|
+
Apxor.logEvent(APX_CONTEXT_EVALUATED, _objectSpread2(_objectSpread2({}, _this.TZgO._attr), {}, {
|
|
1038
|
+
message_name: _this.TZgO.XiTx,
|
|
1039
|
+
id: _this.Eusd
|
|
1038
1040
|
}));
|
|
1039
1041
|
}
|
|
1040
1042
|
// Emit event
|
|
1041
|
-
Apxor.getController().dispatchEvent(_this.
|
|
1042
|
-
name: _this.
|
|
1043
|
+
Apxor.getController().dispatchEvent(_this.TZgO.pSoD, {
|
|
1044
|
+
name: _this.TZgO.pSoD,
|
|
1043
1045
|
additional_info: {
|
|
1044
|
-
uuid: _this.
|
|
1045
|
-
name: _this.
|
|
1046
|
+
uuid: _this.Eusd,
|
|
1047
|
+
name: _this.TZgO.XiTx
|
|
1046
1048
|
}
|
|
1047
1049
|
});
|
|
1048
1050
|
}
|
|
1049
1051
|
});
|
|
1050
|
-
_defineProperty(this, "
|
|
1051
|
-
_this.
|
|
1052
|
+
_defineProperty(this, "IwRA", function () {
|
|
1053
|
+
_this.JOfv.IwRA();
|
|
1052
1054
|
});
|
|
1053
1055
|
_defineProperty(this, "getFrequencyCount", function () {
|
|
1054
|
-
return _this.
|
|
1056
|
+
return _this.JOfv.getFrequencyCount();
|
|
1055
1057
|
});
|
|
1056
|
-
_defineProperty(this, "
|
|
1057
|
-
return _this.
|
|
1058
|
+
_defineProperty(this, "Dith", function () {
|
|
1059
|
+
return _this.JOfv.UYRW();
|
|
1058
1060
|
});
|
|
1059
1061
|
});
|
|
1060
1062
|
|
|
1061
1063
|
var ConfigLookup = /*#__PURE__*/_createClass(function ConfigLookup() {
|
|
1062
1064
|
var _this = this;
|
|
1063
1065
|
_classCallCheck(this, ConfigLookup);
|
|
1064
|
-
_defineProperty(this, "
|
|
1066
|
+
_defineProperty(this, "ooiv", {});
|
|
1065
1067
|
_defineProperty(this, "parse", function () {
|
|
1066
1068
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
1067
1069
|
configs: []
|
|
@@ -1084,7 +1086,7 @@
|
|
|
1084
1086
|
var configId = _config._id;
|
|
1085
1087
|
var configItem = new ConfigItem();
|
|
1086
1088
|
if (configItem.parse(_config)) {
|
|
1087
|
-
_this.
|
|
1089
|
+
_this.ooiv[configId] = configItem;
|
|
1088
1090
|
} else {
|
|
1089
1091
|
console.warn("Failed to parse cfg", configId);
|
|
1090
1092
|
}
|
|
@@ -1092,31 +1094,31 @@
|
|
|
1092
1094
|
}
|
|
1093
1095
|
});
|
|
1094
1096
|
_defineProperty(this, "validate", function (id, index) {
|
|
1095
|
-
if (_this.
|
|
1096
|
-
var configItem = _this.
|
|
1097
|
-
configItem.
|
|
1097
|
+
if (_this.ooiv[id]) {
|
|
1098
|
+
var configItem = _this.ooiv[id];
|
|
1099
|
+
configItem.ZsYF(index);
|
|
1098
1100
|
}
|
|
1099
1101
|
});
|
|
1100
|
-
_defineProperty(this, "
|
|
1101
|
-
var campiagnConfig = _this.
|
|
1102
|
-
campiagnConfig.
|
|
1102
|
+
_defineProperty(this, "IwRA", function (id) {
|
|
1103
|
+
var campiagnConfig = _this.ooiv[id];
|
|
1104
|
+
campiagnConfig.IwRA();
|
|
1103
1105
|
});
|
|
1104
1106
|
_defineProperty(this, "getFrequencyCount", function (id) {
|
|
1105
|
-
var campiagnConfig = _this.
|
|
1107
|
+
var campiagnConfig = _this.ooiv[id];
|
|
1106
1108
|
return campiagnConfig.getFrequencyCount();
|
|
1107
1109
|
});
|
|
1108
1110
|
_defineProperty(this, "resetFrequencyCounts", function () {
|
|
1109
|
-
var configs = _this.
|
|
1111
|
+
var configs = _this.ooiv;
|
|
1110
1112
|
for (var configId in configs) {
|
|
1111
|
-
configs[configId].
|
|
1113
|
+
configs[configId].Dith();
|
|
1112
1114
|
}
|
|
1113
1115
|
});
|
|
1114
|
-
_defineProperty(this, "
|
|
1116
|
+
_defineProperty(this, "NrmJ", function (campaignId) {
|
|
1115
1117
|
try {
|
|
1116
|
-
if (_this.
|
|
1117
|
-
var configItem = _this.
|
|
1118
|
-
if (configItem && configItem.
|
|
1119
|
-
return configItem.
|
|
1118
|
+
if (_this.ooiv) {
|
|
1119
|
+
var configItem = _this.ooiv[campaignId];
|
|
1120
|
+
if (configItem && configItem.TZgO) {
|
|
1121
|
+
return configItem.TZgO;
|
|
1120
1122
|
}
|
|
1121
1123
|
}
|
|
1122
1124
|
} catch (e) {
|
|
@@ -1132,42 +1134,42 @@
|
|
|
1132
1134
|
var EventsListener = /*#__PURE__*/_createClass(function EventsListener() {
|
|
1133
1135
|
var _this = this;
|
|
1134
1136
|
_classCallCheck(this, EventsListener);
|
|
1135
|
-
_defineProperty(this, "
|
|
1136
|
-
_defineProperty(this, "
|
|
1137
|
-
_defineProperty(this, "
|
|
1137
|
+
_defineProperty(this, "fJga", {});
|
|
1138
|
+
_defineProperty(this, "mDlm", []);
|
|
1139
|
+
_defineProperty(this, "UAPh", false);
|
|
1138
1140
|
_defineProperty(this, "initialize", function () {
|
|
1139
1141
|
var controller = Apxor.getController();
|
|
1140
1142
|
controller.registerForEvent(APP_EVENT, function (event) {
|
|
1141
|
-
return _this.
|
|
1143
|
+
return _this.IjTE(event, "AE");
|
|
1142
1144
|
});
|
|
1143
1145
|
controller.registerForEvent(CLIENT_EVENT, function (event) {
|
|
1144
|
-
return _this.
|
|
1146
|
+
return _this.IjTE(event, "CE");
|
|
1145
1147
|
});
|
|
1146
1148
|
});
|
|
1147
|
-
_defineProperty(this, "
|
|
1149
|
+
_defineProperty(this, "xcoZ", function () {
|
|
1148
1150
|
// Clear Buffer
|
|
1149
|
-
for (var item in _this.
|
|
1150
|
-
_this.
|
|
1151
|
+
for (var item in _this.mDlm) {
|
|
1152
|
+
_this.Ywjj(item.event, item.key, item.type);
|
|
1151
1153
|
}
|
|
1152
|
-
_this.
|
|
1154
|
+
_this.UAPh = true;
|
|
1153
1155
|
});
|
|
1154
|
-
_defineProperty(this, "
|
|
1156
|
+
_defineProperty(this, "Pdms", function (event, callback) {
|
|
1155
1157
|
if (!isFunction(callback)) {
|
|
1156
1158
|
return;
|
|
1157
1159
|
}
|
|
1158
1160
|
var listeners;
|
|
1159
|
-
if (_this.
|
|
1160
|
-
listeners = _this.
|
|
1161
|
+
if (_this.fJga[event]) {
|
|
1162
|
+
listeners = _this.fJga[event];
|
|
1161
1163
|
} else {
|
|
1162
1164
|
listeners = [];
|
|
1163
1165
|
}
|
|
1164
1166
|
listeners.push(callback);
|
|
1165
|
-
_this.
|
|
1166
|
-
Logger$7.debug("Listeners list: ", _this.
|
|
1167
|
+
_this.fJga[event] = listeners;
|
|
1168
|
+
Logger$7.debug("Listeners list: ", _this.fJga);
|
|
1167
1169
|
});
|
|
1168
1170
|
_defineProperty(this, "unregisterFromEvent", function (event, callback) {
|
|
1169
|
-
if (_this.
|
|
1170
|
-
var listeners = _this.
|
|
1171
|
+
if (_this.fJga[event]) {
|
|
1172
|
+
var listeners = _this.fJga[event];
|
|
1171
1173
|
var updatedListeners = [];
|
|
1172
1174
|
for (var index = 0; index < listeners.length; index++) {
|
|
1173
1175
|
var listener = listeners[index];
|
|
@@ -1175,25 +1177,25 @@
|
|
|
1175
1177
|
updatedListeners.push(listener);
|
|
1176
1178
|
}
|
|
1177
1179
|
}
|
|
1178
|
-
_this.
|
|
1180
|
+
_this.fJga[event] = updatedListeners;
|
|
1179
1181
|
}
|
|
1180
1182
|
});
|
|
1181
|
-
_defineProperty(this, "
|
|
1183
|
+
_defineProperty(this, "IjTE", function (event) {
|
|
1182
1184
|
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "AE";
|
|
1183
1185
|
var key = type + "___" + event.name;
|
|
1184
|
-
_this.
|
|
1186
|
+
_this.Ywjj(event, key, type);
|
|
1185
1187
|
});
|
|
1186
|
-
_defineProperty(this, "
|
|
1187
|
-
if (!_this.
|
|
1188
|
-
_this.
|
|
1188
|
+
_defineProperty(this, "Ywjj", function (event, key, type) {
|
|
1189
|
+
if (!_this.UAPh) {
|
|
1190
|
+
_this.mDlm.push({
|
|
1189
1191
|
event: event,
|
|
1190
1192
|
key: key,
|
|
1191
1193
|
type: type
|
|
1192
1194
|
});
|
|
1193
1195
|
} else {
|
|
1194
|
-
Logger$7.debug("Notifying listeners for event: " + event + ", " + key, _this.
|
|
1195
|
-
if (_this.
|
|
1196
|
-
var listeners = _this.
|
|
1196
|
+
Logger$7.debug("Notifying listeners for event: " + event + ", " + key, _this.fJga);
|
|
1197
|
+
if (_this.fJga[key]) {
|
|
1198
|
+
var listeners = _this.fJga[key];
|
|
1197
1199
|
var time = Apxor.getController().getSDKRunningTimeInSec();
|
|
1198
1200
|
for (var index = 0; index < listeners.length; index++) {
|
|
1199
1201
|
var listener = listeners[index];
|
|
@@ -1209,17 +1211,17 @@
|
|
|
1209
1211
|
function CE() {
|
|
1210
1212
|
var _this = this;
|
|
1211
1213
|
_classCallCheck(this, CE);
|
|
1212
|
-
_defineProperty(this, "
|
|
1213
|
-
_defineProperty(this, "
|
|
1214
|
-
_defineProperty(this, "
|
|
1215
|
-
_defineProperty(this, "
|
|
1216
|
-
_defineProperty(this, "
|
|
1214
|
+
_defineProperty(this, "UcJD", false);
|
|
1215
|
+
_defineProperty(this, "hvcM", null);
|
|
1216
|
+
_defineProperty(this, "OfTR", getDateInDDMMYYYY());
|
|
1217
|
+
_defineProperty(this, "pcQK", new EventsListener());
|
|
1218
|
+
_defineProperty(this, "rtEJ", Apxor.getSiteId());
|
|
1217
1219
|
_defineProperty(this, "_qeState", {});
|
|
1218
1220
|
_defineProperty(this, "getQeState", function () {
|
|
1219
1221
|
try {
|
|
1220
1222
|
var data = Apxor.getController().getFromStorage(QE_STATE);
|
|
1221
1223
|
if (data) {
|
|
1222
|
-
return JSON.parse(decode(_this.
|
|
1224
|
+
return JSON.parse(decode(_this.rtEJ, data));
|
|
1223
1225
|
} else {
|
|
1224
1226
|
_this._qeState = {};
|
|
1225
1227
|
return _this.setQeState();
|
|
@@ -1248,10 +1250,10 @@
|
|
|
1248
1250
|
return _this._qeState;
|
|
1249
1251
|
});
|
|
1250
1252
|
_defineProperty(this, "initialize", function () {
|
|
1251
|
-
if (!_this.
|
|
1252
|
-
_this.
|
|
1253
|
-
_this.
|
|
1254
|
-
_this.
|
|
1253
|
+
if (!_this.UcJD) {
|
|
1254
|
+
_this.UcJD = true;
|
|
1255
|
+
_this.hvcM = new ConfigLookup();
|
|
1256
|
+
_this.pcQK.initialize();
|
|
1255
1257
|
_this._qeState = _this.getQeState();
|
|
1256
1258
|
Logger$8.info("QE Initialized..");
|
|
1257
1259
|
}
|
|
@@ -1262,12 +1264,12 @@
|
|
|
1262
1264
|
* @param config
|
|
1263
1265
|
*/
|
|
1264
1266
|
_defineProperty(this, "parse", function (config) {
|
|
1265
|
-
if (!_this.
|
|
1267
|
+
if (!_this.ZzAy()) {
|
|
1266
1268
|
Logger$8.warn("Must call init first. Unable to proceed");
|
|
1267
1269
|
return;
|
|
1268
1270
|
}
|
|
1269
|
-
_this.
|
|
1270
|
-
_this.
|
|
1271
|
+
_this.hvcM.parse(config);
|
|
1272
|
+
_this.pcQK.xcoZ();
|
|
1271
1273
|
});
|
|
1272
1274
|
/**
|
|
1273
1275
|
* Validates all conditions for given config ID
|
|
@@ -1276,10 +1278,10 @@
|
|
|
1276
1278
|
* @param index
|
|
1277
1279
|
*/
|
|
1278
1280
|
_defineProperty(this, "validate", function (id, index) {
|
|
1279
|
-
if (!_this.
|
|
1281
|
+
if (!_this.ZzAy()) {
|
|
1280
1282
|
return;
|
|
1281
1283
|
}
|
|
1282
|
-
_this.
|
|
1284
|
+
_this.hvcM.validate(id, index);
|
|
1283
1285
|
});
|
|
1284
1286
|
_defineProperty(this, "updateCount", function (id) {
|
|
1285
1287
|
try {
|
|
@@ -1288,22 +1290,22 @@
|
|
|
1288
1290
|
}
|
|
1289
1291
|
_this.incrementFrequencies(id);
|
|
1290
1292
|
_this.setQeState(id);
|
|
1291
|
-
_this.
|
|
1293
|
+
_this.hvcM.IwRA(id);
|
|
1292
1294
|
} catch (e) {
|
|
1293
1295
|
console.log("Could not update the count config:".concat(e));
|
|
1294
1296
|
}
|
|
1295
1297
|
});
|
|
1296
1298
|
_defineProperty(this, "resetFrequencyCounts", function () {
|
|
1297
|
-
_this.
|
|
1299
|
+
_this.hvcM.resetFrequencyCounts();
|
|
1298
1300
|
});
|
|
1299
1301
|
_defineProperty(this, "getFrequencyCount", function (id) {
|
|
1300
|
-
return _this.
|
|
1302
|
+
return _this.hvcM.getFrequencyCount(id);
|
|
1301
1303
|
});
|
|
1302
1304
|
_defineProperty(this, "registerForEvent", function (event, callback) {
|
|
1303
|
-
_this.
|
|
1305
|
+
_this.pcQK.Pdms(event, callback);
|
|
1304
1306
|
});
|
|
1305
1307
|
_defineProperty(this, "unregisterFromEvent", function (event, callback) {
|
|
1306
|
-
_this.
|
|
1308
|
+
_this.pcQK.unregisterFromEvent(event, callback);
|
|
1307
1309
|
});
|
|
1308
1310
|
/**
|
|
1309
1311
|
* Fetches the config from Server
|
|
@@ -1316,14 +1318,14 @@
|
|
|
1316
1318
|
_defineProperty(this, "fetch", function (type, validateUrl, apiUrl, callback) {
|
|
1317
1319
|
Apxor.getController().fetchConfiguration(type, validateUrl, apiUrl, callback);
|
|
1318
1320
|
});
|
|
1319
|
-
_defineProperty(this, "
|
|
1320
|
-
return _this.
|
|
1321
|
+
_defineProperty(this, "ZzAy", function () {
|
|
1322
|
+
return _this.UcJD;
|
|
1321
1323
|
});
|
|
1322
1324
|
_defineProperty(this, "getCampaignMetaFromQueryEngine", function (campaignId) {
|
|
1323
|
-
return _this.
|
|
1325
|
+
return _this.hvcM.NrmJ(campaignId);
|
|
1324
1326
|
});
|
|
1325
|
-
_defineProperty(this, "
|
|
1326
|
-
return _this.
|
|
1327
|
+
_defineProperty(this, "PSuD", function () {
|
|
1328
|
+
return _this.OfTR;
|
|
1327
1329
|
});
|
|
1328
1330
|
if (!CE.instance) {
|
|
1329
1331
|
CE.instance = this;
|
|
@@ -1347,7 +1349,7 @@
|
|
|
1347
1349
|
OVERALL: 0,
|
|
1348
1350
|
DATES: {}
|
|
1349
1351
|
};
|
|
1350
|
-
if (this.
|
|
1352
|
+
if (this.OfTR) this._qeState[id].DATES[this.OfTR] = 0;
|
|
1351
1353
|
this.setQeState(id);
|
|
1352
1354
|
}
|
|
1353
1355
|
} catch (e) {
|
|
@@ -1366,12 +1368,12 @@
|
|
|
1366
1368
|
|
|
1367
1369
|
// Increment the DATES count for this particular date by 1. If the date changes reset.
|
|
1368
1370
|
var currentDate = getDateInDDMMYYYY();
|
|
1369
|
-
if (currentDate !== this.
|
|
1370
|
-
this.
|
|
1371
|
+
if (currentDate !== this.OfTR || !(configFrequency.DATES && configFrequency.DATES[currentDate])) {
|
|
1372
|
+
this.OfTR = currentDate;
|
|
1371
1373
|
configFrequency.DATES = {};
|
|
1372
|
-
configFrequency.DATES[this.
|
|
1374
|
+
configFrequency.DATES[this.OfTR] = 0;
|
|
1373
1375
|
}
|
|
1374
|
-
configFrequency.DATES[this.
|
|
1376
|
+
configFrequency.DATES[this.OfTR] = configFrequency.DATES[this.OfTR] + 1;
|
|
1375
1377
|
}
|
|
1376
1378
|
}], [{
|
|
1377
1379
|
key: "getInstance",
|
|
@@ -1390,7 +1392,7 @@
|
|
|
1390
1392
|
|
|
1391
1393
|
/* eslint-disable no-empty */
|
|
1392
1394
|
|
|
1393
|
-
window.ceVersion =
|
|
1395
|
+
window.ceVersion = 123;
|
|
1394
1396
|
try {
|
|
1395
1397
|
if (exports !== undefined || exports !== null) {
|
|
1396
1398
|
exports["default"] = CE;
|
|
@@ -1400,4 +1402,4 @@
|
|
|
1400
1402
|
|
|
1401
1403
|
return CE;
|
|
1402
1404
|
|
|
1403
|
-
}));
|
|
1405
|
+
})));
|