apxor-qe 1.3.0 → 1.4.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 +656 -357
- package/dist/apxor.qe.min.js +1 -1
- package/package.json +2 -2
package/dist/apxor.qe.js.bak
CHANGED
|
@@ -203,7 +203,7 @@
|
|
|
203
203
|
var toUpperCase = function toUpperCase(key) {
|
|
204
204
|
return key.toUpperCase();
|
|
205
205
|
};
|
|
206
|
-
var
|
|
206
|
+
var qjgz = function qjgz(actual, expected, operator) {
|
|
207
207
|
switch (operator) {
|
|
208
208
|
case "EQ":
|
|
209
209
|
return actual === expected;
|
|
@@ -242,20 +242,38 @@
|
|
|
242
242
|
return dateDDMMYYYY;
|
|
243
243
|
};
|
|
244
244
|
|
|
245
|
+
/**
|
|
246
|
+
* @function getDateInMMDDYYYY
|
|
247
|
+
* @description Returns the current date in MM/DD/YYYY Format
|
|
248
|
+
* @returns {string}
|
|
249
|
+
*/
|
|
250
|
+
var getDateInMMDDYYYY = function getDateInMMDDYYYY() {
|
|
251
|
+
var currentDate = new Date();
|
|
252
|
+
var dateDDMMYYYY = currentDate.getMonth() + "/" + currentDate.getDate() + "/" + currentDate.getFullYear();
|
|
253
|
+
return dateDDMMYYYY;
|
|
254
|
+
};
|
|
255
|
+
var _getTime = function _getTime() {
|
|
256
|
+
var currentTime = new Date();
|
|
257
|
+
return {
|
|
258
|
+
hours: currentTime.getHours(),
|
|
259
|
+
mins: currentTime.getMinutes()
|
|
260
|
+
};
|
|
261
|
+
};
|
|
262
|
+
|
|
245
263
|
var Logger = window.ApxorLogger;
|
|
246
264
|
var Audience = /*#__PURE__*/_createClass(function Audience() {
|
|
247
265
|
var _this = this;
|
|
248
266
|
_classCallCheck(this, Audience);
|
|
249
|
-
_defineProperty(this, "
|
|
250
|
-
_defineProperty(this, "
|
|
251
|
-
_defineProperty(this, "
|
|
267
|
+
_defineProperty(this, "pfyk", "ALL");
|
|
268
|
+
_defineProperty(this, "oyin", []);
|
|
269
|
+
_defineProperty(this, "Pifw", []);
|
|
252
270
|
_defineProperty(this, "parse", function () {
|
|
253
271
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
254
272
|
try {
|
|
255
|
-
_this.
|
|
256
|
-
_this.
|
|
257
|
-
_this.
|
|
258
|
-
if (!Array.isArray(_this.
|
|
273
|
+
_this.pfyk = config.audience.audience_type;
|
|
274
|
+
_this.oyin = config.audience.attributes.user;
|
|
275
|
+
_this.Pifw = config.audience.attributes.session;
|
|
276
|
+
if (!Array.isArray(_this.oyin) || !Array.isArray(_this.Pifw)) {
|
|
259
277
|
Logger.error("No attributes");
|
|
260
278
|
return false;
|
|
261
279
|
}
|
|
@@ -267,12 +285,12 @@
|
|
|
267
285
|
});
|
|
268
286
|
_defineProperty(this, "validate", function (user, session) {
|
|
269
287
|
var status = true;
|
|
270
|
-
if (_this.
|
|
288
|
+
if (_this.pfyk === "FTU") {
|
|
271
289
|
status = Apxor.getController().getSessionInfo().is_first_session;
|
|
272
290
|
}
|
|
273
|
-
return status && _this.
|
|
291
|
+
return status && _this.larY(user, _this.oyin) && _this.larY(session, _this.Pifw);
|
|
274
292
|
});
|
|
275
|
-
_defineProperty(this, "
|
|
293
|
+
_defineProperty(this, "larY", function (attributes, expected) {
|
|
276
294
|
var length = expected.length;
|
|
277
295
|
var status = true;
|
|
278
296
|
try {
|
|
@@ -302,7 +320,7 @@
|
|
|
302
320
|
}
|
|
303
321
|
var match = loggedValues.some(function (loggedValue) {
|
|
304
322
|
return values.some(function (configValue) {
|
|
305
|
-
return
|
|
323
|
+
return qjgz(loggedValue, configValue, operator);
|
|
306
324
|
});
|
|
307
325
|
});
|
|
308
326
|
status = status && match;
|
|
@@ -324,34 +342,37 @@
|
|
|
324
342
|
var Frequency = /*#__PURE__*/_createClass(function Frequency() {
|
|
325
343
|
var _this = this;
|
|
326
344
|
_classCallCheck(this, Frequency);
|
|
327
|
-
_defineProperty(this, "
|
|
328
|
-
_defineProperty(this, "
|
|
329
|
-
_defineProperty(this, "
|
|
330
|
-
_defineProperty(this, "
|
|
331
|
-
_defineProperty(this, "
|
|
332
|
-
_defineProperty(this, "
|
|
345
|
+
_defineProperty(this, "kedV", 0);
|
|
346
|
+
_defineProperty(this, "VSmt", 0);
|
|
347
|
+
_defineProperty(this, "YTxk", "SESSION");
|
|
348
|
+
_defineProperty(this, "zwPH", 0);
|
|
349
|
+
_defineProperty(this, "gMHQ", 0);
|
|
350
|
+
_defineProperty(this, "amzH", 0);
|
|
333
351
|
_defineProperty(this, "parse", function () {
|
|
334
352
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
335
353
|
try {
|
|
336
|
-
_this.
|
|
337
|
-
_this.
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
_this.
|
|
354
|
+
_this.kedV = config.frequency.count;
|
|
355
|
+
if (_this.kedV === -1) {
|
|
356
|
+
_this.kedV = 1000;
|
|
357
|
+
}
|
|
358
|
+
_this.amzH = _this.kedV;
|
|
359
|
+
_this.VSmt = config.frequency.time_interval;
|
|
360
|
+
_this.YTxk = config.frequency.validity;
|
|
361
|
+
_this.gMHQ = config.frequency.ses_lmt;
|
|
341
362
|
_this._dayCount = config.frequency.day_lmt;
|
|
342
363
|
// let data = Apxor.getController().getFromStorage(QE_STATE);
|
|
343
364
|
// let qe_state = JSON.parse(decode(Apxor.getSiteId(), data));
|
|
344
365
|
var qe_state = CE.getInstance().getQeState();
|
|
345
366
|
if (!isDefined(qe_state) || !isDefined(qe_state[config._id])) return true;
|
|
346
|
-
if (_this.
|
|
347
|
-
_this.
|
|
348
|
-
if (_this.
|
|
367
|
+
if (_this.YTxk === "SESSION") {
|
|
368
|
+
_this.kedV = parseInt(_this.kedV) - parseInt(qe_state[config._id]["SESSION"]);
|
|
369
|
+
if (_this.kedV <= 0) {
|
|
349
370
|
console.warn("Max count limit reached for session:" + config._id);
|
|
350
371
|
return false;
|
|
351
372
|
}
|
|
352
|
-
} else if (_this.
|
|
353
|
-
_this.
|
|
354
|
-
if (_this.
|
|
373
|
+
} else if (_this.YTxk === "OVERALL") {
|
|
374
|
+
_this.kedV = parseInt(_this.kedV) - parseInt(qe_state[config._id]["OVERALL"]);
|
|
375
|
+
if (_this.kedV <= 0) {
|
|
355
376
|
console.warn("Max count limit reached for overall:" + config._id);
|
|
356
377
|
return false;
|
|
357
378
|
}
|
|
@@ -365,28 +386,28 @@
|
|
|
365
386
|
}
|
|
366
387
|
return true;
|
|
367
388
|
});
|
|
368
|
-
_defineProperty(this, "
|
|
369
|
-
_this.
|
|
389
|
+
_defineProperty(this, "oDrA", function () {
|
|
390
|
+
_this.kedV = _this.kedV - 1;
|
|
370
391
|
});
|
|
371
392
|
_defineProperty(this, "getFrequencyCount", function () {
|
|
372
|
-
return _this.
|
|
393
|
+
return _this.kedV;
|
|
373
394
|
});
|
|
374
|
-
_defineProperty(this, "
|
|
375
|
-
if (_this.
|
|
376
|
-
_this.
|
|
395
|
+
_defineProperty(this, "XbPF", function () {
|
|
396
|
+
if (_this.YTxk === "SESSION") {
|
|
397
|
+
_this.kedV = _this.amzH;
|
|
377
398
|
Logger$1.info("Campaign Limit reset");
|
|
378
399
|
}
|
|
379
400
|
});
|
|
380
401
|
/**
|
|
381
|
-
* @function
|
|
402
|
+
* @function WTEf
|
|
382
403
|
* @description Validates if the campaign count is with in the limits set in the config.
|
|
383
404
|
* @param {string} Config id
|
|
384
405
|
* @returns {boolean} true - If the Campaign limits are not reached
|
|
385
406
|
* false - Otherwise
|
|
386
407
|
*/
|
|
387
|
-
_defineProperty(this, "
|
|
408
|
+
_defineProperty(this, "WTEf", function (id) {
|
|
388
409
|
try {
|
|
389
|
-
if (_this.
|
|
410
|
+
if (_this.kedV <= 0) {
|
|
390
411
|
return false;
|
|
391
412
|
}
|
|
392
413
|
|
|
@@ -397,8 +418,8 @@
|
|
|
397
418
|
if (!isDefined(qe_state) || !isDefined(qe_state[id])) return true;
|
|
398
419
|
|
|
399
420
|
//If the config has a session count limit set
|
|
400
|
-
if (_this.
|
|
401
|
-
var sessionCountInConfig = parseInt(_this.
|
|
421
|
+
if (_this.gMHQ !== 0) {
|
|
422
|
+
var sessionCountInConfig = parseInt(_this.gMHQ);
|
|
402
423
|
var thisSessionCount = parseInt(qe_state[id]["SESSION"]);
|
|
403
424
|
if (sessionCountInConfig - thisSessionCount <= 0) {
|
|
404
425
|
return false;
|
|
@@ -425,14 +446,14 @@
|
|
|
425
446
|
var Meta = /*#__PURE__*/_createClass(function Meta() {
|
|
426
447
|
var _this = this;
|
|
427
448
|
_classCallCheck(this, Meta);
|
|
428
|
-
_defineProperty(this, "
|
|
429
|
-
_defineProperty(this, "
|
|
449
|
+
_defineProperty(this, "EDaN", "");
|
|
450
|
+
_defineProperty(this, "pfyk", "");
|
|
430
451
|
_defineProperty(this, "parse", function () {
|
|
431
452
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
432
453
|
try {
|
|
433
454
|
var _config$meta;
|
|
434
|
-
_this.
|
|
435
|
-
_this.
|
|
455
|
+
_this.EDaN = config.meta.name;
|
|
456
|
+
_this.pfyk = config.meta.type;
|
|
436
457
|
_this._only_context = config.meta.only_context;
|
|
437
458
|
_this._attr = ((_config$meta = config.meta) === null || _config$meta === void 0 ? void 0 : _config$meta.attr) || {};
|
|
438
459
|
} catch (error) {
|
|
@@ -447,11 +468,11 @@
|
|
|
447
468
|
var Validity = /*#__PURE__*/_createClass(function Validity() {
|
|
448
469
|
var _this = this;
|
|
449
470
|
_classCallCheck(this, Validity);
|
|
450
|
-
_defineProperty(this, "
|
|
451
|
-
_defineProperty(this, "
|
|
452
|
-
_defineProperty(this, "
|
|
453
|
-
_defineProperty(this, "
|
|
454
|
-
_defineProperty(this, "
|
|
471
|
+
_defineProperty(this, "isju", -1);
|
|
472
|
+
_defineProperty(this, "eexF", -1);
|
|
473
|
+
_defineProperty(this, "Xmbz", -1);
|
|
474
|
+
_defineProperty(this, "IRGG", -1);
|
|
475
|
+
_defineProperty(this, "jPEb", false);
|
|
455
476
|
_defineProperty(this, "parse", function () {
|
|
456
477
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
457
478
|
try {
|
|
@@ -459,17 +480,17 @@
|
|
|
459
480
|
Logger$2.error("Not valid dates");
|
|
460
481
|
return false;
|
|
461
482
|
}
|
|
462
|
-
_this.
|
|
463
|
-
_this.
|
|
483
|
+
_this.isju = Date.parse(config.validity.start_date);
|
|
484
|
+
_this.eexF = Date.parse(config.validity.end_date);
|
|
464
485
|
if (isDefined(config.time_limits_in_day)) {
|
|
465
|
-
_this.
|
|
466
|
-
if (_this.
|
|
486
|
+
_this.jPEb = config.time_limits_in_day;
|
|
487
|
+
if (_this.jPEb && isDefined(config.time_limits)) {
|
|
467
488
|
var currentDate = new Date().toISOString().split("T")[0];
|
|
468
|
-
_this.
|
|
469
|
-
_this.
|
|
489
|
+
_this.Xmbz = Date.parse(currentDate + "T" + config.time_limits.start_time + ".000Z");
|
|
490
|
+
_this.IRGG = Date.parse(currentDate + "T" + config.time_limits.end_time + ".000Z");
|
|
470
491
|
|
|
471
492
|
// If invalid format is passed, return false
|
|
472
|
-
if (isNaN(_this.
|
|
493
|
+
if (isNaN(_this.Xmbz) || isNaN(_this.IRGG)) {
|
|
473
494
|
Logger$2.error("Not valid times");
|
|
474
495
|
return false;
|
|
475
496
|
}
|
|
@@ -483,8 +504,8 @@
|
|
|
483
504
|
});
|
|
484
505
|
_defineProperty(this, "validate", function () {
|
|
485
506
|
var currentTime = Date.now();
|
|
486
|
-
if (currentTime > _this.
|
|
487
|
-
return !_this.
|
|
507
|
+
if (currentTime > _this.isju && currentTime < _this.eexF) {
|
|
508
|
+
return !_this.jPEb || currentTime >= _this.Xmbz && currentTime <= _this.IRGG;
|
|
488
509
|
}
|
|
489
510
|
return false;
|
|
490
511
|
});
|
|
@@ -493,13 +514,13 @@
|
|
|
493
514
|
var Details = /*#__PURE__*/_createClass(function Details() {
|
|
494
515
|
var _this = this;
|
|
495
516
|
_classCallCheck(this, Details);
|
|
496
|
-
_defineProperty(this, "
|
|
497
|
-
_defineProperty(this, "
|
|
517
|
+
_defineProperty(this, "EDaN", "");
|
|
518
|
+
_defineProperty(this, "EpkX", {});
|
|
498
519
|
_defineProperty(this, "parse", function () {
|
|
499
520
|
var details = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
500
521
|
try {
|
|
501
|
-
_this.
|
|
502
|
-
_this.
|
|
522
|
+
_this.EDaN = details.name;
|
|
523
|
+
_this.EpkX = details.additional_info;
|
|
503
524
|
} catch (error) {
|
|
504
525
|
return false;
|
|
505
526
|
}
|
|
@@ -510,14 +531,14 @@
|
|
|
510
531
|
var Timebounds = /*#__PURE__*/_createClass(function Timebounds() {
|
|
511
532
|
var _this = this;
|
|
512
533
|
_classCallCheck(this, Timebounds);
|
|
513
|
-
_defineProperty(this, "
|
|
514
|
-
_defineProperty(this, "
|
|
534
|
+
_defineProperty(this, "vQNe", 0);
|
|
535
|
+
_defineProperty(this, "idSb", 0);
|
|
515
536
|
_defineProperty(this, "parse", function () {
|
|
516
537
|
var timeBounds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
517
538
|
try {
|
|
518
|
-
_this.
|
|
519
|
-
_this.
|
|
520
|
-
if (isNaN(_this.
|
|
539
|
+
_this.vQNe = Number(timeBounds.lower);
|
|
540
|
+
_this.idSb = Number(timeBounds.upper);
|
|
541
|
+
if (isNaN(_this.vQNe) || isNaN(_this.idSb)) {
|
|
521
542
|
return false;
|
|
522
543
|
}
|
|
523
544
|
} catch (error) {
|
|
@@ -530,17 +551,17 @@
|
|
|
530
551
|
var PreCondition = /*#__PURE__*/_createClass(function PreCondition() {
|
|
531
552
|
var _this = this;
|
|
532
553
|
_classCallCheck(this, PreCondition);
|
|
533
|
-
_defineProperty(this, "
|
|
534
|
-
_defineProperty(this, "
|
|
535
|
-
_defineProperty(this, "
|
|
536
|
-
_defineProperty(this, "
|
|
537
|
-
_defineProperty(this, "
|
|
554
|
+
_defineProperty(this, "dAXx", 0);
|
|
555
|
+
_defineProperty(this, "QksQ", "");
|
|
556
|
+
_defineProperty(this, "SmWY", "");
|
|
557
|
+
_defineProperty(this, "SbdV", new Details());
|
|
558
|
+
_defineProperty(this, "OuAR", new Timebounds());
|
|
538
559
|
_defineProperty(this, "parse", function () {
|
|
539
560
|
var precondition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
540
561
|
try {
|
|
541
|
-
_this.
|
|
542
|
-
_this.
|
|
543
|
-
return _this.
|
|
562
|
+
_this.QksQ = precondition.event_type;
|
|
563
|
+
_this.SmWY = precondition.activity;
|
|
564
|
+
return _this.SbdV.parse(precondition.details) && _this.OuAR.parse(precondition.time_bounds);
|
|
544
565
|
} catch (error) {
|
|
545
566
|
return false;
|
|
546
567
|
}
|
|
@@ -551,29 +572,29 @@
|
|
|
551
572
|
var Condition = /*#__PURE__*/_createClass(function Condition() {
|
|
552
573
|
var _this = this;
|
|
553
574
|
_classCallCheck(this, Condition);
|
|
554
|
-
_defineProperty(this, "
|
|
555
|
-
_defineProperty(this, "
|
|
556
|
-
_defineProperty(this, "
|
|
557
|
-
_defineProperty(this, "
|
|
558
|
-
_defineProperty(this, "
|
|
559
|
-
_defineProperty(this, "
|
|
560
|
-
_defineProperty(this, "
|
|
561
|
-
_defineProperty(this, "
|
|
562
|
-
_defineProperty(this, "
|
|
563
|
-
_defineProperty(this, "
|
|
564
|
-
_defineProperty(this, "
|
|
565
|
-
_defineProperty(this, "
|
|
575
|
+
_defineProperty(this, "dAXx", 0);
|
|
576
|
+
_defineProperty(this, "kVOA", -1);
|
|
577
|
+
_defineProperty(this, "kedV", 0);
|
|
578
|
+
_defineProperty(this, "oakv", "");
|
|
579
|
+
_defineProperty(this, "SmWY", "");
|
|
580
|
+
_defineProperty(this, "QksQ", "");
|
|
581
|
+
_defineProperty(this, "OuAR", new Timebounds());
|
|
582
|
+
_defineProperty(this, "SbdV", new Details());
|
|
583
|
+
_defineProperty(this, "YEhB", new PreCondition());
|
|
584
|
+
_defineProperty(this, "yHRM", "AND");
|
|
585
|
+
_defineProperty(this, "Pkry", false);
|
|
586
|
+
_defineProperty(this, "pfyk", void 0);
|
|
566
587
|
_defineProperty(this, "parse", function () {
|
|
567
588
|
var condition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
568
589
|
try {
|
|
569
|
-
_this.
|
|
570
|
-
_this.
|
|
571
|
-
_this.
|
|
572
|
-
_this.
|
|
573
|
-
_this.
|
|
574
|
-
_this.
|
|
575
|
-
_this.
|
|
576
|
-
return _this.
|
|
590
|
+
_this.kVOA = condition.sequence;
|
|
591
|
+
_this.kedV = condition.count_config.count;
|
|
592
|
+
_this.oakv = condition.count_config.operator;
|
|
593
|
+
_this.SmWY = condition.activity;
|
|
594
|
+
_this.QksQ = condition.event_type;
|
|
595
|
+
_this.yHRM = condition.combine_operator;
|
|
596
|
+
_this.pfyk = condition.type;
|
|
597
|
+
return _this.SbdV.parse(condition.details) && _this.YEhB.parse(condition.trigger) && _this.OuAR.parse(condition.time_bounds);
|
|
577
598
|
} catch (error) {
|
|
578
599
|
Logger$3.error(error);
|
|
579
600
|
return false;
|
|
@@ -581,25 +602,51 @@
|
|
|
581
602
|
});
|
|
582
603
|
});
|
|
583
604
|
|
|
584
|
-
/* eslint-disable no-unused-vars */
|
|
585
605
|
var Logger$4 = window.ApxorLogger;
|
|
606
|
+
var GoalEvent = /*#__PURE__*/_createClass(function GoalEvent() {
|
|
607
|
+
var _this = this;
|
|
608
|
+
_classCallCheck(this, GoalEvent);
|
|
609
|
+
_defineProperty(this, "kedV", 0);
|
|
610
|
+
_defineProperty(this, "oakv", "");
|
|
611
|
+
_defineProperty(this, "QksQ", "");
|
|
612
|
+
_defineProperty(this, "OuAR", new Timebounds());
|
|
613
|
+
_defineProperty(this, "SbdV", new Details());
|
|
614
|
+
_defineProperty(this, "yHRM", "AND");
|
|
615
|
+
_defineProperty(this, "parse", function (data) {
|
|
616
|
+
try {
|
|
617
|
+
_this.kedV = data.count_config.count;
|
|
618
|
+
_this.oakv = data.count_config.operator;
|
|
619
|
+
_this.QksQ = data.event_type;
|
|
620
|
+
_this.yHRM = data.combine_operator;
|
|
621
|
+
return _this.SbdV.parse(data.details) && _this.OuAR.parse(data.time_bounds);
|
|
622
|
+
} catch (error) {
|
|
623
|
+
Logger$4.error(error);
|
|
624
|
+
return false;
|
|
625
|
+
}
|
|
626
|
+
});
|
|
627
|
+
});
|
|
628
|
+
|
|
629
|
+
/* eslint-disable no-unused-vars */
|
|
630
|
+
var Logger$5 = window.ApxorLogger;
|
|
586
631
|
var ConditionValidator = /*#__PURE__*/function () {
|
|
587
632
|
function ConditionValidator() {
|
|
588
633
|
var _this = this;
|
|
589
634
|
_classCallCheck(this, ConditionValidator);
|
|
590
|
-
_defineProperty(this, "
|
|
591
|
-
_defineProperty(this, "
|
|
592
|
-
_defineProperty(this, "
|
|
593
|
-
_defineProperty(this, "
|
|
594
|
-
_defineProperty(this, "
|
|
595
|
-
_defineProperty(this, "
|
|
596
|
-
_defineProperty(this, "
|
|
597
|
-
_defineProperty(this, "
|
|
598
|
-
_defineProperty(this, "
|
|
599
|
-
_defineProperty(this, "
|
|
600
|
-
_defineProperty(this, "
|
|
635
|
+
_defineProperty(this, "XsTp", 0);
|
|
636
|
+
_defineProperty(this, "jaGt", "");
|
|
637
|
+
_defineProperty(this, "qXKr", new Condition());
|
|
638
|
+
_defineProperty(this, "yIMt", new GoalEvent());
|
|
639
|
+
_defineProperty(this, "gZba", false);
|
|
640
|
+
_defineProperty(this, "HPUo", false);
|
|
641
|
+
_defineProperty(this, "RIDN", 0);
|
|
642
|
+
_defineProperty(this, "yHRM", "AND");
|
|
643
|
+
_defineProperty(this, "mCal", "OR");
|
|
644
|
+
_defineProperty(this, "fTSz", -1);
|
|
645
|
+
_defineProperty(this, "eiXR", []);
|
|
646
|
+
_defineProperty(this, "JfUj", {});
|
|
647
|
+
_defineProperty(this, "rduQ", false);
|
|
601
648
|
/**
|
|
602
|
-
* If respectSequence is true, don't auto-
|
|
649
|
+
* If respectSequence is true, don't auto-OJSD to events except for the condition whose index is 0
|
|
603
650
|
*
|
|
604
651
|
* @param condition
|
|
605
652
|
* @param type
|
|
@@ -614,155 +661,181 @@
|
|
|
614
661
|
var index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
615
662
|
var respectSequence = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
616
663
|
var noKpiArray = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
|
|
617
|
-
|
|
618
|
-
_this.
|
|
619
|
-
_this.
|
|
620
|
-
|
|
621
|
-
if (
|
|
622
|
-
|
|
664
|
+
var flag = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : "";
|
|
665
|
+
_this.jaGt = id;
|
|
666
|
+
_this.RIDN = index;
|
|
667
|
+
_this.eiXR = noKpiArray;
|
|
668
|
+
if (flag !== "termination" || flag === "") {
|
|
669
|
+
var result = _this.qXKr.parse(condition);
|
|
670
|
+
if (result) {
|
|
671
|
+
_this.yHRM = _this.qXKr.yHRM;
|
|
623
672
|
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
673
|
+
// FIXME: Why this code is written? Don't see any usecase
|
|
674
|
+
if (_this.qXKr.Pkry) {
|
|
675
|
+
var eventName = _this.qXKr.SbdV.EDaN;
|
|
676
|
+
if (eventName === "APX_PAGE_OPENED") {
|
|
677
|
+
eventName = _this.qXKr.SbdV.EpkX["navigation_id"];
|
|
678
|
+
eventName = isDefined(eventName) ? eventName : _this.qXKr.SbdV.EDaN;
|
|
679
|
+
}
|
|
680
|
+
_this.fTSz = Apxor.getController().getEventCount(eventName);
|
|
681
|
+
var count = _this.qXKr.kedV;
|
|
682
|
+
var operator = _this.qXKr.oakv;
|
|
683
|
+
_this.HPUo = _this.jjDO(_this.fTSz - 1, count, operator, false);
|
|
684
|
+
_this.gZba = _this.HPUo;
|
|
685
|
+
// If the condition is already satisfied and if it is page view, no need to OJSD
|
|
686
|
+
// This only applies for NAVIGATION_EVENTS
|
|
687
|
+
if (_this.HPUo && _this.qXKr.SbdV.EDaN === "APX_PAGE_OPENED") {
|
|
688
|
+
return true;
|
|
689
|
+
}
|
|
630
690
|
}
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
var operator = _this.dqkJ.LXVx;
|
|
634
|
-
_this.xVdJ = _this.LzlO(_this.sqsm - 1, count, operator, false);
|
|
635
|
-
_this.AhjD = _this.xVdJ;
|
|
636
|
-
// If the condition is already satisfied and if it is page view, no need to qqsE
|
|
637
|
-
// This only applies for NAVIGATION_EVENTS
|
|
638
|
-
if (_this.xVdJ && _this.dqkJ.QYMC.CtPY === "APX_PAGE_OPENED") {
|
|
639
|
-
return true;
|
|
691
|
+
if (!respectSequence || index === 0) {
|
|
692
|
+
_this.OJSD();
|
|
640
693
|
}
|
|
694
|
+
return true;
|
|
641
695
|
}
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
696
|
+
} else {
|
|
697
|
+
var _result = _this.yIMt.parse(condition);
|
|
698
|
+
_this.mCal = _this.yIMt.yHRM;
|
|
699
|
+
_this.IIJM();
|
|
645
700
|
return true;
|
|
646
701
|
}
|
|
647
702
|
return false;
|
|
648
703
|
});
|
|
649
|
-
_defineProperty(this, "
|
|
650
|
-
var condition = _this.
|
|
651
|
-
var precondition = condition.
|
|
704
|
+
_defineProperty(this, "OJSD", function () {
|
|
705
|
+
var condition = _this.qXKr;
|
|
706
|
+
var precondition = condition.YEhB;
|
|
652
707
|
var ceInstance = CE.getInstance();
|
|
653
|
-
if (precondition.
|
|
654
|
-
_this.
|
|
655
|
-
ceInstance.registerForEvent(generateKey(condition.
|
|
708
|
+
if (precondition.QksQ === "app_start") {
|
|
709
|
+
_this.gZba = true;
|
|
710
|
+
ceInstance.registerForEvent(generateKey(condition.QksQ) + "___" + condition.SbdV.EDaN, _this.vJpn);
|
|
656
711
|
} else {
|
|
657
|
-
ceInstance.registerForEvent(generateKey(condition.
|
|
712
|
+
ceInstance.registerForEvent(generateKey(condition.QksQ) + "___" + precondition.SbdV.EDaN, _this.vJpn);
|
|
658
713
|
}
|
|
659
714
|
});
|
|
660
|
-
_defineProperty(this, "
|
|
661
|
-
var _this
|
|
715
|
+
_defineProperty(this, "IIJM", function () {
|
|
716
|
+
var condition = _this.yIMt;
|
|
717
|
+
var ceInstance = CE.getInstance();
|
|
718
|
+
_this.gZba = true;
|
|
719
|
+
ceInstance.registerForEvent(generateKey(condition.QksQ) + "___" + condition.SbdV.EDaN, _this.nTnW);
|
|
720
|
+
});
|
|
721
|
+
_defineProperty(this, "aZcq", function (type, name, time, additionalInfo) {
|
|
722
|
+
var _this$qXKr;
|
|
662
723
|
var eventTime = Date.now();
|
|
663
|
-
var time_differnce = (eventTime - _this.
|
|
664
|
-
var time_fromConfig = ((_this$
|
|
724
|
+
var time_differnce = (eventTime - _this.JfUj[name]) / 1000;
|
|
725
|
+
var time_fromConfig = ((_this$qXKr = _this.qXKr) === null || _this$qXKr === void 0 || (_this$qXKr = _this$qXKr.SbdV) === null || _this$qXKr === void 0 || (_this$qXKr = _this$qXKr.EpkX) === null || _this$qXKr === void 0 ? void 0 : _this$qXKr.time) / 1000;
|
|
665
726
|
if (time_fromConfig > time_differnce) {
|
|
666
727
|
_this._displayCampaign(time);
|
|
667
728
|
}
|
|
668
729
|
});
|
|
669
|
-
_defineProperty(this, "
|
|
730
|
+
_defineProperty(this, "EfFk", function (type, name, time, additionalInfo) {
|
|
670
731
|
var _this$_condition2, _this$_condition3;
|
|
671
|
-
_this.
|
|
732
|
+
_this.rduQ = true;
|
|
672
733
|
var currentTime = Date.now();
|
|
673
|
-
var eventName = (_this$_condition2 = _this.
|
|
674
|
-
var eventTime = _this.
|
|
734
|
+
var eventName = (_this$_condition2 = _this.qXKr) === null || _this$_condition2 === void 0 || (_this$_condition2 = _this$_condition2.YEhB) === null || _this$_condition2 === void 0 ? void 0 : _this$_condition2.SbdV.EDaN;
|
|
735
|
+
var eventTime = _this.JfUj[eventName];
|
|
675
736
|
var time_differnce = (currentTime - eventTime) / 1000;
|
|
676
|
-
var time_fromConfig = (_this$_condition3 = _this.
|
|
737
|
+
var time_fromConfig = (_this$_condition3 = _this.qXKr) === null || _this$_condition3 === void 0 || (_this$_condition3 = _this$_condition3.SbdV) === null || _this$_condition3 === void 0 || (_this$_condition3 = _this$_condition3.EpkX) === null || _this$_condition3 === void 0 ? void 0 : _this$_condition3.time;
|
|
677
738
|
time_fromConfig = time_fromConfig / 1000;
|
|
678
739
|
if (time_fromConfig > time_differnce) {
|
|
679
740
|
_this._displayCampaign(time);
|
|
680
741
|
}
|
|
681
742
|
//unregister the event
|
|
682
743
|
});
|
|
683
|
-
_defineProperty(this, "
|
|
744
|
+
_defineProperty(this, "vJpn", function (type, name, time, additionalInfo) {
|
|
684
745
|
var ceInstance = CE.getInstance();
|
|
685
|
-
if (!_this.
|
|
746
|
+
if (!_this.gZba) {
|
|
686
747
|
// Validate Precondition
|
|
687
|
-
_this.
|
|
688
|
-
if (_this.
|
|
689
|
-
var condition = _this.
|
|
690
|
-
var precondition = condition.
|
|
691
|
-
precondition.
|
|
748
|
+
_this.gZba = _this.alII(type, name, time, additionalInfo);
|
|
749
|
+
if (_this.gZba) {
|
|
750
|
+
var condition = _this.qXKr;
|
|
751
|
+
var precondition = condition.YEhB;
|
|
752
|
+
precondition.dAXx = time;
|
|
692
753
|
//events will be registred by its type activity event_type: "activity_time"
|
|
693
|
-
if ((condition === null || condition === void 0 ? void 0 : condition.
|
|
694
|
-
var
|
|
695
|
-
var event_time = condition === null || condition === void 0 || (
|
|
696
|
-
if ((condition === null || condition === void 0 || (
|
|
754
|
+
if ((condition === null || condition === void 0 ? void 0 : condition.QksQ) === "activity_time") {
|
|
755
|
+
var qXKr$SbdV, qXKr$_details2, qXKr$_details3;
|
|
756
|
+
var event_time = condition === null || condition === void 0 || (qXKr$SbdV = condition.SbdV) === null || qXKr$SbdV === void 0 || (qXKr$SbdV = qXKr$SbdV.EpkX) === null || qXKr$SbdV === void 0 ? void 0 : qXKr$SbdV.time;
|
|
757
|
+
if ((condition === null || condition === void 0 || (qXKr$_details2 = condition.SbdV) === null || qXKr$_details2 === void 0 || (qXKr$_details2 = qXKr$_details2.EpkX) === null || qXKr$_details2 === void 0 ? void 0 : qXKr$_details2.nkpi.length) > 0) {
|
|
697
758
|
setTimeout(function () {
|
|
698
|
-
if (!_this.
|
|
699
|
-
_this.
|
|
700
|
-
if (_this.
|
|
701
|
-
_this.
|
|
702
|
-
_this.
|
|
703
|
-
if (_this.
|
|
704
|
-
_this.
|
|
705
|
-
ceInstance.validate(_this.
|
|
759
|
+
if (!_this.rduQ) {
|
|
760
|
+
_this.HPUo = true;
|
|
761
|
+
if (_this.HPUo) {
|
|
762
|
+
_this.XsTp += 1;
|
|
763
|
+
_this.HPUo = _this.jjDO(_this.XsTp, _this.qXKr.kedV, _this.qXKr.oakv);
|
|
764
|
+
if (_this.HPUo) {
|
|
765
|
+
_this.qXKr.dAXx = time;
|
|
766
|
+
ceInstance.validate(_this.jaGt, _this.RIDN);
|
|
706
767
|
}
|
|
707
768
|
}
|
|
708
769
|
}
|
|
709
|
-
condition.
|
|
710
|
-
ceInstance.unregisterFromEvent(toUpperCase(condition.
|
|
770
|
+
condition.SbdV.EpkX.nkpi.map(function (nokpi) {
|
|
771
|
+
ceInstance.unregisterFromEvent(toUpperCase(condition.SbdV.EpkX.et) + "___" + nokpi, _this);
|
|
711
772
|
});
|
|
712
773
|
}, event_time);
|
|
713
|
-
condition.
|
|
714
|
-
ceInstance.registerForEvent(toUpperCase(condition.
|
|
774
|
+
condition.SbdV.EpkX.nkpi.map(function (nokpi) {
|
|
775
|
+
ceInstance.registerForEvent(toUpperCase(condition.SbdV.EpkX.et) + "___" + nokpi, _this.EfFk);
|
|
715
776
|
});
|
|
716
777
|
}
|
|
717
778
|
//it is for unregistering the events did case after completing the time imit
|
|
718
|
-
if ((condition === null || condition === void 0 || (
|
|
779
|
+
if ((condition === null || condition === void 0 || (qXKr$_details3 = condition.SbdV) === null || qXKr$_details3 === void 0 || (qXKr$_details3 = qXKr$_details3.EpkX) === null || qXKr$_details3 === void 0 ? void 0 : qXKr$_details3.kpi.length) > 0) {
|
|
719
780
|
setTimeout(function () {
|
|
720
|
-
condition.
|
|
721
|
-
ceInstance.unregisterFromEvent(toUpperCase(condition.
|
|
781
|
+
condition.SbdV.EpkX.kpi.map(function (kpi) {
|
|
782
|
+
ceInstance.unregisterFromEvent(toUpperCase(condition.SbdV.EpkX.et) + "___" + kpi, _this);
|
|
722
783
|
});
|
|
723
784
|
}, event_time);
|
|
724
|
-
condition.
|
|
725
|
-
if (kpi === condition.
|
|
785
|
+
condition.SbdV.EpkX.kpi.map(function (kpi) {
|
|
786
|
+
if (kpi === condition.YEhB.SbdV.EDaN) {
|
|
726
787
|
//unregister the previous event
|
|
727
|
-
ceInstance.unregisterFromEvent(generateKey(precondition.
|
|
728
|
-
ceInstance.registerForEvent(toUpperCase(condition.
|
|
788
|
+
ceInstance.unregisterFromEvent(generateKey(precondition.QksQ) + "___" + precondition.SbdV.EDaN, _this);
|
|
789
|
+
ceInstance.registerForEvent(toUpperCase(condition.SbdV.EpkX.et) + "___" + kpi, _this.aZcq);
|
|
729
790
|
} else {
|
|
730
|
-
ceInstance.registerForEvent(toUpperCase(condition.
|
|
791
|
+
ceInstance.registerForEvent(toUpperCase(condition.SbdV.EpkX.et) + "___" + kpi, _this.EfFk);
|
|
731
792
|
}
|
|
732
793
|
});
|
|
733
794
|
}
|
|
734
795
|
} else {
|
|
735
|
-
ceInstance.unregisterFromEvent(generateKey(precondition.
|
|
736
|
-
ceInstance.registerForEvent(generateKey(condition.
|
|
796
|
+
ceInstance.unregisterFromEvent(generateKey(precondition.QksQ) + "___" + precondition.SbdV.EDaN, _this);
|
|
797
|
+
ceInstance.registerForEvent(generateKey(condition.QksQ) + "___" + condition.SbdV.EDaN, _this);
|
|
737
798
|
}
|
|
738
|
-
_this.
|
|
799
|
+
_this.JfUj[name] = Date.now();
|
|
739
800
|
}
|
|
740
801
|
return;
|
|
741
802
|
}
|
|
742
803
|
|
|
743
804
|
// Validate Condition
|
|
744
|
-
var validationStatus = generateKey(_this.
|
|
805
|
+
var validationStatus = generateKey(_this.qXKr.QksQ) === type && _this.oLnh(time - _this.qXKr.YEhB.dAXx, _this.qXKr.OuAR) && _this.qXKr.SbdV.EDaN === name && _this.MUef(_this.qXKr.SbdV.EpkX, additionalInfo);
|
|
745
806
|
if (validationStatus) {
|
|
746
|
-
_this.
|
|
747
|
-
_this.
|
|
748
|
-
if (_this.
|
|
749
|
-
_this.
|
|
750
|
-
ceInstance.validate(_this.
|
|
807
|
+
_this.XsTp += 1;
|
|
808
|
+
_this.HPUo = _this.jjDO(_this.XsTp, _this.qXKr.kedV, _this.qXKr.oakv);
|
|
809
|
+
if (_this.HPUo) {
|
|
810
|
+
_this.qXKr.dAXx = time;
|
|
811
|
+
ceInstance.validate(_this.jaGt, _this.RIDN);
|
|
751
812
|
}
|
|
752
813
|
}
|
|
753
814
|
});
|
|
754
|
-
_defineProperty(this, "
|
|
755
|
-
var
|
|
756
|
-
|
|
815
|
+
_defineProperty(this, "nTnW", function (type, name, time, additionalInfo) {
|
|
816
|
+
var ceInstance = CE.getInstance();
|
|
817
|
+
var validationStatus = generateKey(_this.yIMt.QksQ) === type && _this.oLnh(time, _this.yIMt.OuAR) && _this.yIMt.SbdV.EDaN === name && _this.MUef(_this.yIMt.SbdV.EpkX, additionalInfo);
|
|
818
|
+
if (validationStatus) {
|
|
819
|
+
_this.XsTp += 1;
|
|
820
|
+
_this.HPUo = _this.jjDO(_this.XsTp, _this.yIMt.kedV, _this.yIMt.oakv);
|
|
821
|
+
if (_this.HPUo) {
|
|
822
|
+
_this.yIMt.dAXx = time;
|
|
823
|
+
ceInstance.validateForTermination(_this.jaGt, _this.RIDN);
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
});
|
|
827
|
+
_defineProperty(this, "alII", function (type, name, time, additionalInfo) {
|
|
828
|
+
var precondition = _this.qXKr.YEhB;
|
|
829
|
+
return generateKey(precondition.QksQ) === type && precondition.SbdV.EDaN === name && _this.oLnh(time, precondition.OuAR) && _this.MUef(precondition.SbdV.EpkX, additionalInfo);
|
|
757
830
|
});
|
|
758
|
-
_defineProperty(this, "
|
|
831
|
+
_defineProperty(this, "oLnh", function (time, timeBounds) {
|
|
759
832
|
var currentTime = Math.ceil(time);
|
|
760
|
-
return currentTime > timeBounds.
|
|
833
|
+
return currentTime > timeBounds.vQNe && currentTime < timeBounds.idSb;
|
|
761
834
|
});
|
|
762
|
-
_defineProperty(this, "
|
|
835
|
+
_defineProperty(this, "jjDO", function (current, required, operator) {
|
|
763
836
|
var checkOld = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
764
|
-
if (checkOld && _this.
|
|
765
|
-
current = current + _this.
|
|
837
|
+
if (checkOld && _this.qXKr.Pkry) {
|
|
838
|
+
current = current + _this.fTSz;
|
|
766
839
|
}
|
|
767
840
|
switch (operator) {
|
|
768
841
|
case "EQ":
|
|
@@ -779,7 +852,7 @@
|
|
|
779
852
|
return false;
|
|
780
853
|
}
|
|
781
854
|
});
|
|
782
|
-
_defineProperty(this, "
|
|
855
|
+
_defineProperty(this, "MUef", function (expected, received) {
|
|
783
856
|
var status = true;
|
|
784
857
|
try {
|
|
785
858
|
var _loop = function _loop() {
|
|
@@ -804,11 +877,11 @@
|
|
|
804
877
|
loggedValues = [received[item]];
|
|
805
878
|
}
|
|
806
879
|
var match = loggedValues.some(function (loggedValue) {
|
|
807
|
-
return
|
|
880
|
+
return qjgz(loggedValue, expectedValue, operator);
|
|
808
881
|
});
|
|
809
882
|
status = status && match;
|
|
810
883
|
} else {
|
|
811
|
-
status = status &&
|
|
884
|
+
status = status && qjgz(received[item], expected[item], "EQ");
|
|
812
885
|
}
|
|
813
886
|
},
|
|
814
887
|
_ret;
|
|
@@ -817,7 +890,7 @@
|
|
|
817
890
|
if (_ret) return _ret.v;
|
|
818
891
|
}
|
|
819
892
|
} catch (error) {
|
|
820
|
-
Logger$
|
|
893
|
+
Logger$5.error(error);
|
|
821
894
|
status = false;
|
|
822
895
|
}
|
|
823
896
|
return status;
|
|
@@ -827,13 +900,13 @@
|
|
|
827
900
|
key: "_displayCampaign",
|
|
828
901
|
value: function _displayCampaign(time) {
|
|
829
902
|
var ceInstance = CE.getInstance();
|
|
830
|
-
this.
|
|
831
|
-
if (this.
|
|
832
|
-
this.
|
|
833
|
-
this.
|
|
834
|
-
if (this.
|
|
835
|
-
this.
|
|
836
|
-
ceInstance.validate(this.
|
|
903
|
+
this.HPUo = true;
|
|
904
|
+
if (this.HPUo) {
|
|
905
|
+
this.XsTp += 1;
|
|
906
|
+
this.HPUo = this.jjDO(this.XsTp, this.qXKr.kedV, this.qXKr.oakv);
|
|
907
|
+
if (this.HPUo) {
|
|
908
|
+
this.qXKr.dAXx = time;
|
|
909
|
+
ceInstance.validate(this.jaGt, this.RIDN);
|
|
837
910
|
}
|
|
838
911
|
}
|
|
839
912
|
}
|
|
@@ -846,26 +919,26 @@
|
|
|
846
919
|
var APX_RETAINED_DAYS = "apx_retained_days";
|
|
847
920
|
var APX_CONTEXT_EVALUATED = "apx_context_evaluated";
|
|
848
921
|
|
|
849
|
-
var Logger$
|
|
922
|
+
var Logger$6 = window.ApxorLogger;
|
|
850
923
|
var OverallConfig = /*#__PURE__*/_createClass(function OverallConfig() {
|
|
851
924
|
var _this = this;
|
|
852
925
|
_classCallCheck(this, OverallConfig);
|
|
853
|
-
_defineProperty(this, "
|
|
926
|
+
_defineProperty(this, "kgNo", []);
|
|
854
927
|
_defineProperty(this, "_ret_day", {});
|
|
855
|
-
_defineProperty(this, "
|
|
856
|
-
_defineProperty(this, "
|
|
857
|
-
_defineProperty(this, "
|
|
928
|
+
_defineProperty(this, "mequ", {});
|
|
929
|
+
_defineProperty(this, "CRUL", false);
|
|
930
|
+
_defineProperty(this, "mxWo", false);
|
|
858
931
|
_defineProperty(this, "parse", function () {
|
|
859
932
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
860
933
|
try {
|
|
861
|
-
_this.
|
|
934
|
+
_this.kgNo = config.overall_cfg.events;
|
|
862
935
|
_this._ret_day = config.overall_cfg.ret_day;
|
|
863
|
-
_this.
|
|
864
|
-
_this.
|
|
865
|
-
_this.
|
|
866
|
-
_this.
|
|
936
|
+
_this.mequ = config.overall_cfg.session;
|
|
937
|
+
_this.CRUL = config.overall_cfg.toggleRetDay;
|
|
938
|
+
_this.kgNo = config.overall_cfg.events;
|
|
939
|
+
_this.mxWo = config.overall_cfg.toggleSession;
|
|
867
940
|
} catch (error) {
|
|
868
|
-
Logger$
|
|
941
|
+
Logger$6.error(error);
|
|
869
942
|
return false;
|
|
870
943
|
}
|
|
871
944
|
return true;
|
|
@@ -873,10 +946,10 @@
|
|
|
873
946
|
_defineProperty(this, "validate", function () {
|
|
874
947
|
var retainedDays = parseInt(Apxor.getController().getFromStorage(APX_RETAINED_DAYS));
|
|
875
948
|
var retainedSession = parseInt(Apxor.getController().getFromStorage(APX_RETAINED_SESSIONS));
|
|
876
|
-
if (_this.
|
|
949
|
+
if (_this.CRUL && !isNaN(retainedDays) && !(retainedDays >= _this._ret_day.from && retainedDays <= _this._ret_day.to)) {
|
|
877
950
|
return false;
|
|
878
951
|
}
|
|
879
|
-
if (_this.
|
|
952
|
+
if (_this.mxWo && !isNaN(retainedSession) && !(retainedSession >= _this.mequ.from && retainedSession <= _this.mequ.to)) {
|
|
880
953
|
return false;
|
|
881
954
|
}
|
|
882
955
|
try {
|
|
@@ -884,60 +957,203 @@
|
|
|
884
957
|
var data = Apxor.getController().getFromStorage("_apx_lt_count");
|
|
885
958
|
var siteid = Apxor.getSiteId();
|
|
886
959
|
var LtCountObjDecoded = JSON.parse(new TextDecoder().decode(stringToArrayBuffer(decode(siteid, data))));
|
|
887
|
-
for (var i = 0; i < _this.
|
|
888
|
-
var evName = _this.
|
|
960
|
+
for (var i = 0; i < _this.kgNo.length; i++) {
|
|
961
|
+
var evName = _this.kgNo[i].name.replace("'", "").replace("’", "");
|
|
889
962
|
if (LtCountObjDecoded[evName]) {
|
|
890
963
|
return false;
|
|
891
964
|
}
|
|
892
965
|
}
|
|
893
966
|
} catch (e) {
|
|
894
|
-
Logger$
|
|
967
|
+
Logger$6.error("Failed to validate the lt count:" + e);
|
|
895
968
|
}
|
|
896
969
|
return true;
|
|
897
970
|
});
|
|
898
971
|
});
|
|
899
972
|
|
|
900
|
-
var Logger$
|
|
973
|
+
var Logger$7 = window.ApxorLogger;
|
|
974
|
+
var Attributes = /*#__PURE__*/_createClass(function Attributes() {
|
|
975
|
+
var _this = this;
|
|
976
|
+
_classCallCheck(this, Attributes);
|
|
977
|
+
_defineProperty(this, "oyin", []);
|
|
978
|
+
_defineProperty(this, "Pifw", []);
|
|
979
|
+
_defineProperty(this, "parse", function () {
|
|
980
|
+
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
981
|
+
try {
|
|
982
|
+
_this.oyin = config.attributes.user;
|
|
983
|
+
_this.Pifw = config.attributes.session;
|
|
984
|
+
if (!Array.isArray(_this.oyin) || !Array.isArray(_this.Pifw)) {
|
|
985
|
+
Logger$7.error("No attributes");
|
|
986
|
+
return false;
|
|
987
|
+
}
|
|
988
|
+
} catch (error) {
|
|
989
|
+
Logger$7.error(error);
|
|
990
|
+
return false;
|
|
991
|
+
}
|
|
992
|
+
return true;
|
|
993
|
+
});
|
|
994
|
+
_defineProperty(this, "validate", function (user, session) {
|
|
995
|
+
return _this.larY(user, _this.oyin) && _this.larY(session, _this.Pifw);
|
|
996
|
+
});
|
|
997
|
+
_defineProperty(this, "larY", function (attributes, expected) {
|
|
998
|
+
var length = expected.length;
|
|
999
|
+
var status = true;
|
|
1000
|
+
try {
|
|
1001
|
+
var _loop = function _loop() {
|
|
1002
|
+
var item = expected[index];
|
|
1003
|
+
if (!attributes[item.name] || status === false) {
|
|
1004
|
+
return {
|
|
1005
|
+
v: false
|
|
1006
|
+
};
|
|
1007
|
+
}
|
|
1008
|
+
var operator = item.operator;
|
|
1009
|
+
var type = item.type;
|
|
1010
|
+
var values = item.value.map(function (value) {
|
|
1011
|
+
if (type === "s") {
|
|
1012
|
+
return value;
|
|
1013
|
+
} else if (type === "l") {
|
|
1014
|
+
return parseInt(value);
|
|
1015
|
+
} else if (type === "f") {
|
|
1016
|
+
return parseFloat(value);
|
|
1017
|
+
}
|
|
1018
|
+
});
|
|
1019
|
+
var loggedValues = [];
|
|
1020
|
+
if (Array.isArray(attributes[item.name])) {
|
|
1021
|
+
loggedValues = attributes[item.name];
|
|
1022
|
+
} else {
|
|
1023
|
+
loggedValues = [attributes[item.name]];
|
|
1024
|
+
}
|
|
1025
|
+
var match = loggedValues.some(function (loggedValue) {
|
|
1026
|
+
return values.some(function (configValue) {
|
|
1027
|
+
return qjgz(loggedValue, configValue, operator);
|
|
1028
|
+
});
|
|
1029
|
+
});
|
|
1030
|
+
status = status && match;
|
|
1031
|
+
},
|
|
1032
|
+
_ret;
|
|
1033
|
+
for (var index = 0; index < length; index++) {
|
|
1034
|
+
_ret = _loop();
|
|
1035
|
+
if (_ret) return _ret.v;
|
|
1036
|
+
}
|
|
1037
|
+
} catch (error) {
|
|
1038
|
+
Logger$7.error(error);
|
|
1039
|
+
status = false;
|
|
1040
|
+
}
|
|
1041
|
+
return status;
|
|
1042
|
+
});
|
|
1043
|
+
});
|
|
1044
|
+
|
|
1045
|
+
//TERMINATION KEYS
|
|
1046
|
+
var APX_TERMINATION_ID = "apx_termination_ID";
|
|
1047
|
+
|
|
1048
|
+
var TimeBasedTermination = /*#__PURE__*/_createClass(function TimeBasedTermination() {
|
|
1049
|
+
var _this = this;
|
|
1050
|
+
_classCallCheck(this, TimeBasedTermination);
|
|
1051
|
+
_defineProperty(this, "NURV", Apxor.getController());
|
|
1052
|
+
_defineProperty(this, "type", "");
|
|
1053
|
+
_defineProperty(this, "_duration_seconds", 0);
|
|
1054
|
+
_defineProperty(this, "eUbV", 1);
|
|
1055
|
+
_defineProperty(this, "parse", function (config) {
|
|
1056
|
+
try {
|
|
1057
|
+
var _config$terminate_inf, _config$terminate_inf2, _config$terminate_inf3;
|
|
1058
|
+
_this.pfyk = (_config$terminate_inf = config.terminate_info.time_based) === null || _config$terminate_inf === void 0 ? void 0 : _config$terminate_inf.type;
|
|
1059
|
+
_this._duration_seconds = (_config$terminate_inf2 = config.terminate_info) === null || _config$terminate_inf2 === void 0 ? void 0 : _config$terminate_inf2.time_based.duration_seconds;
|
|
1060
|
+
_this.eUbV = (_config$terminate_inf3 = config.terminate_info.time_based) === null || _config$terminate_inf3 === void 0 ? void 0 : _config$terminate_inf3.days;
|
|
1061
|
+
if (_this.qjgz(config._id)) {
|
|
1062
|
+
_this.NURV.persistTerminationInfoLocally(config._id);
|
|
1063
|
+
return false;
|
|
1064
|
+
}
|
|
1065
|
+
} catch (_unused) {
|
|
1066
|
+
return false;
|
|
1067
|
+
}
|
|
1068
|
+
return true;
|
|
1069
|
+
});
|
|
1070
|
+
_defineProperty(this, "qjgz", function (id) {
|
|
1071
|
+
var _Data$id;
|
|
1072
|
+
var Data = JSON.parse(_this.NURV.getFromStorage(APX_TERMINATION_ID));
|
|
1073
|
+
if (!Data[id] || !((_Data$id = Data[id]) !== null && _Data$id !== void 0 && _Data$id.startDate)) return false;
|
|
1074
|
+
var startDate = new Date(Data[id].startDate);
|
|
1075
|
+
var presentDate = new Date(getDateInMMDDYYYY());
|
|
1076
|
+
var diff = parseInt((presentDate - startDate) / (1000 * 60 * 60 * 24), 10);
|
|
1077
|
+
var currentTime = _getTime();
|
|
1078
|
+
var Xmbz = Data[id].Xmbz;
|
|
1079
|
+
return diff === _this.eUbV && currentTime.hours >= Xmbz.hours || diff > _this.eUbV || Data[id].goalAcheived;
|
|
1080
|
+
});
|
|
1081
|
+
});
|
|
1082
|
+
|
|
1083
|
+
var TerminationInfo = /*#__PURE__*/_createClass(function TerminationInfo() {
|
|
1084
|
+
var _this = this;
|
|
1085
|
+
_classCallCheck(this, TerminationInfo);
|
|
1086
|
+
_defineProperty(this, "enable_goal_events", false);
|
|
1087
|
+
_defineProperty(this, "attributes", {});
|
|
1088
|
+
_defineProperty(this, "WnkR", new Attributes());
|
|
1089
|
+
_defineProperty(this, "jcBj", new TimeBasedTermination());
|
|
1090
|
+
_defineProperty(this, "parse", function () {
|
|
1091
|
+
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1092
|
+
try {
|
|
1093
|
+
var _config$terminate_inf, _config$terminate_inf2, _config$terminate_inf3;
|
|
1094
|
+
_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;
|
|
1095
|
+
if (_this.enable_time_based && !_this.jcBj.parse(config)) {
|
|
1096
|
+
return false;
|
|
1097
|
+
}
|
|
1098
|
+
_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;
|
|
1099
|
+
_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;
|
|
1100
|
+
if (_this.enable_attributes && !_this.WnkR.parse(config.terminate_info)) {
|
|
1101
|
+
return false;
|
|
1102
|
+
}
|
|
1103
|
+
} catch (error) {
|
|
1104
|
+
window.ApxorLogger.error(error);
|
|
1105
|
+
return false;
|
|
1106
|
+
}
|
|
1107
|
+
return true;
|
|
1108
|
+
});
|
|
1109
|
+
_defineProperty(this, "validate", function (user, session) {
|
|
1110
|
+
return _this.WnkR.validate(user, session);
|
|
1111
|
+
});
|
|
1112
|
+
});
|
|
1113
|
+
|
|
1114
|
+
var Logger$8 = window.ApxorLogger;
|
|
901
1115
|
var ConfigItem = /*#__PURE__*/_createClass(function ConfigItem() {
|
|
902
1116
|
var _this = this;
|
|
903
1117
|
_classCallCheck(this, ConfigItem);
|
|
904
|
-
_defineProperty(this, "
|
|
905
|
-
_defineProperty(this, "
|
|
906
|
-
_defineProperty(this, "
|
|
907
|
-
_defineProperty(this, "
|
|
908
|
-
_defineProperty(this, "
|
|
909
|
-
_defineProperty(this, "
|
|
910
|
-
_defineProperty(this, "
|
|
911
|
-
_defineProperty(this, "
|
|
912
|
-
_defineProperty(this, "
|
|
1118
|
+
_defineProperty(this, "oWeW", []);
|
|
1119
|
+
_defineProperty(this, "bwHJ", []);
|
|
1120
|
+
_defineProperty(this, "jaGt", "");
|
|
1121
|
+
_defineProperty(this, "ylID", new Meta());
|
|
1122
|
+
_defineProperty(this, "fGtu", new Audience());
|
|
1123
|
+
_defineProperty(this, "YTxk", new Validity());
|
|
1124
|
+
_defineProperty(this, "CWOw", new Frequency());
|
|
1125
|
+
_defineProperty(this, "VUII", new OverallConfig());
|
|
1126
|
+
_defineProperty(this, "xoSz", new TerminationInfo());
|
|
1127
|
+
_defineProperty(this, "uZEl", false);
|
|
1128
|
+
_defineProperty(this, "TYUY", []);
|
|
913
1129
|
_defineProperty(this, "parse", function () {
|
|
914
1130
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
915
1131
|
try {
|
|
916
1132
|
// If ID is not present, throw it out
|
|
917
1133
|
if (!isDefined(config._id)) {
|
|
918
|
-
Logger$
|
|
1134
|
+
Logger$8.error("No Id");
|
|
919
1135
|
return false;
|
|
920
1136
|
}
|
|
921
1137
|
|
|
922
1138
|
// If config is disabled, throw it out
|
|
923
1139
|
if (!isDefined(config.enabled) || !config.enabled) {
|
|
924
|
-
Logger$
|
|
1140
|
+
Logger$8.error("Not enabled");
|
|
925
1141
|
return false;
|
|
926
1142
|
}
|
|
927
1143
|
|
|
928
1144
|
// If META, VALIDITY, FREQUENCY and AUDIENCE is not parsed properly, throw it out
|
|
929
|
-
if (!(_this.
|
|
1145
|
+
if (!(_this.ylID.parse(config) && _this.YTxk.parse(config) && _this.CWOw.parse(config) && _this.fGtu.parse(config) && _this.VUII.parse(config) && _this.xoSz.parse(config))) {
|
|
930
1146
|
return false;
|
|
931
1147
|
}
|
|
932
1148
|
|
|
933
1149
|
// If there are no conditions, throw it out
|
|
934
1150
|
if (!isDefined(config.conditions) || !Array.isArray(config.conditions)) {
|
|
935
|
-
Logger$
|
|
1151
|
+
Logger$8.error("No valid conditions", config.conditions);
|
|
936
1152
|
return false;
|
|
937
1153
|
}
|
|
938
|
-
_this.
|
|
939
|
-
_this.
|
|
940
|
-
if (_this.
|
|
1154
|
+
_this.jaGt = config._id;
|
|
1155
|
+
_this.uZEl = isDefined(config.sequence_enabled) ? config.sequence_enabled : false;
|
|
1156
|
+
if (_this.uZEl) {
|
|
941
1157
|
// iff respectSequence is true, Sort the Conditions by their sequence order
|
|
942
1158
|
// We need to sort, if server sends them in orderless manner
|
|
943
1159
|
config.conditions.sort(function (prev, current) {
|
|
@@ -949,17 +1165,17 @@
|
|
|
949
1165
|
var conditions = config.conditions;
|
|
950
1166
|
var length = conditions.length;
|
|
951
1167
|
for (var index = 0; index < length; index++) {
|
|
952
|
-
_this.
|
|
1168
|
+
_this.TYUY = [];
|
|
953
1169
|
var condition = conditions[index];
|
|
954
1170
|
if (condition.type === "didn't") {
|
|
955
|
-
var
|
|
1171
|
+
var qXKr$details;
|
|
956
1172
|
var obj = {
|
|
957
1173
|
trigger_key: condition.trigger.details.name,
|
|
958
|
-
no_kpi_array: condition === null || condition === void 0 || (
|
|
1174
|
+
no_kpi_array: condition === null || condition === void 0 || (qXKr$details = condition.details) === null || qXKr$details === void 0 || (qXKr$details = qXKr$details.additional_info) === null || qXKr$details === void 0 ? void 0 : qXKr$details.nkpi,
|
|
959
1175
|
condition_id: condition === null || condition === void 0 ? void 0 : condition._id,
|
|
960
1176
|
time_bounds: condition.time_bounds.upper
|
|
961
1177
|
};
|
|
962
|
-
_this.
|
|
1178
|
+
_this.TYUY = [].concat(_toConsumableArray(_this.TYUY), [obj]);
|
|
963
1179
|
//this will be the key
|
|
964
1180
|
//when event occur check this array and then then check the time
|
|
965
1181
|
//check the time diffrence
|
|
@@ -968,57 +1184,73 @@
|
|
|
968
1184
|
}
|
|
969
1185
|
|
|
970
1186
|
var conditionValidator = new ConditionValidator();
|
|
971
|
-
if (conditionValidator.initialize(condition, _this.
|
|
972
|
-
_this.
|
|
1187
|
+
if (conditionValidator.initialize(condition, _this.jaGt, index, _this.uZEl, _this.TYUY)) {
|
|
1188
|
+
_this.oWeW.push(conditionValidator);
|
|
973
1189
|
}
|
|
974
1190
|
}
|
|
975
|
-
|
|
1191
|
+
if (_this.xoSz.enable_goal_events) {
|
|
1192
|
+
var goal_events = config.terminate_info.goal_events.events;
|
|
1193
|
+
var goaleventslength = goal_events.length;
|
|
1194
|
+
for (var i = 0; i < goaleventslength; i++) {
|
|
1195
|
+
var _conditionValidator = new ConditionValidator();
|
|
1196
|
+
if (_conditionValidator.initialize(goal_events[i], _this.jaGt, i, true, [], "termination")) {
|
|
1197
|
+
_this.bwHJ.push(_conditionValidator);
|
|
1198
|
+
}
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
return _this.oWeW.length > 0;
|
|
976
1202
|
} catch (error) {
|
|
977
|
-
Logger$
|
|
1203
|
+
Logger$8.error(error);
|
|
978
1204
|
return false;
|
|
979
1205
|
}
|
|
980
1206
|
});
|
|
981
|
-
_defineProperty(this, "
|
|
1207
|
+
_defineProperty(this, "Adtv", function (index) {
|
|
982
1208
|
if (index < 0) {
|
|
983
1209
|
return;
|
|
984
1210
|
}
|
|
985
|
-
if (_this.
|
|
986
|
-
var conditionValidator = _this.
|
|
987
|
-
if (isDefined(conditionValidator) && conditionValidator.
|
|
1211
|
+
if (_this.uZEl) {
|
|
1212
|
+
var conditionValidator = _this.oWeW[index];
|
|
1213
|
+
if (isDefined(conditionValidator) && conditionValidator.HPUo) {
|
|
988
1214
|
// Check if previous validator is satisfied
|
|
989
|
-
var prevValidator = _this.
|
|
990
|
-
if (isDefined(prevValidator) && !prevValidator.
|
|
1215
|
+
var prevValidator = _this.oWeW[index - 1];
|
|
1216
|
+
if (isDefined(prevValidator) && !prevValidator.HPUo) {
|
|
991
1217
|
// TODO: If current index is satisfied before previous one, do something
|
|
992
1218
|
// either unregister all conditions or remove this item from ConfigLookup
|
|
993
1219
|
return;
|
|
994
1220
|
}
|
|
995
|
-
var nextValidator = _this.
|
|
1221
|
+
var nextValidator = _this.oWeW[index + 1];
|
|
996
1222
|
if (!isDefined(nextValidator)) {
|
|
997
1223
|
// It means this is the last condition
|
|
998
1224
|
// Validate all conditions
|
|
999
|
-
_this.
|
|
1225
|
+
_this.BmHg();
|
|
1000
1226
|
} else {
|
|
1001
|
-
nextValidator.
|
|
1227
|
+
nextValidator.OJSD();
|
|
1002
1228
|
}
|
|
1003
1229
|
}
|
|
1004
1230
|
} else {
|
|
1005
1231
|
// Validate all conditions
|
|
1006
|
-
_this.
|
|
1232
|
+
_this.BmHg();
|
|
1007
1233
|
}
|
|
1008
1234
|
});
|
|
1009
|
-
_defineProperty(this, "
|
|
1235
|
+
_defineProperty(this, "RbFI", function (index) {
|
|
1236
|
+
if (index < 0) {
|
|
1237
|
+
return;
|
|
1238
|
+
}
|
|
1239
|
+
_this.GuEG();
|
|
1240
|
+
});
|
|
1241
|
+
_defineProperty(this, "BmHg", function () {
|
|
1010
1242
|
// Check If Audience, Validity is satisfied or not
|
|
1011
1243
|
var userAttributes = Apxor.getController().getUserAttributes();
|
|
1012
1244
|
var sessionAttributes = Apxor.getController().getSessionAttributes();
|
|
1013
|
-
if (!_this.
|
|
1245
|
+
if (!_this.YTxk.validate() || !_this.fGtu.validate(userAttributes, sessionAttributes) || !_this.VUII.validate()) {
|
|
1014
1246
|
return;
|
|
1015
1247
|
}
|
|
1016
|
-
var length = _this.
|
|
1248
|
+
var length = _this.oWeW.length;
|
|
1017
1249
|
var isSatisfied = length < 1;
|
|
1018
1250
|
var combineOperator = "";
|
|
1019
1251
|
for (var index = 0; index < length; index++) {
|
|
1020
|
-
var validator = _this.
|
|
1021
|
-
var currentResult = validator.
|
|
1252
|
+
var validator = _this.oWeW[index];
|
|
1253
|
+
var currentResult = validator.HPUo;
|
|
1022
1254
|
if (combineOperator.trim() === "") {
|
|
1023
1255
|
isSatisfied = currentResult;
|
|
1024
1256
|
} else {
|
|
@@ -1031,47 +1263,92 @@
|
|
|
1031
1263
|
break;
|
|
1032
1264
|
}
|
|
1033
1265
|
}
|
|
1034
|
-
combineOperator = validator.
|
|
1266
|
+
combineOperator = validator.yHRM;
|
|
1035
1267
|
}
|
|
1036
1268
|
if (isSatisfied) {
|
|
1037
1269
|
console.debug("onCondition satisfied");
|
|
1038
1270
|
// Check if count reached it's maximum
|
|
1039
|
-
if (!_this.
|
|
1040
|
-
console.warn("Maximum limit reached", _this.
|
|
1271
|
+
if (!_this.CWOw.WTEf(_this.jaGt)) {
|
|
1272
|
+
console.warn("Maximum limit reached", _this.jaGt);
|
|
1041
1273
|
return;
|
|
1042
1274
|
}
|
|
1043
|
-
console.log("Dispatching event", _this.
|
|
1044
|
-
if (_this.
|
|
1045
|
-
Apxor.logEvent(APX_CONTEXT_EVALUATED, _objectSpread2(_objectSpread2({}, _this.
|
|
1046
|
-
message_name: _this.
|
|
1047
|
-
id: _this.
|
|
1275
|
+
console.log("Dispatching event", _this.ylID.pfyk);
|
|
1276
|
+
if (_this.ylID._only_context === true) {
|
|
1277
|
+
Apxor.logEvent(APX_CONTEXT_EVALUATED, _objectSpread2(_objectSpread2({}, _this.ylID._attr), {}, {
|
|
1278
|
+
message_name: _this.ylID.EDaN,
|
|
1279
|
+
id: _this.jaGt
|
|
1048
1280
|
}));
|
|
1049
1281
|
}
|
|
1050
1282
|
// Emit event
|
|
1051
|
-
Apxor.getController().dispatchEvent(_this.
|
|
1052
|
-
name: _this.
|
|
1283
|
+
Apxor.getController().dispatchEvent(_this.ylID.pfyk, {
|
|
1284
|
+
name: _this.ylID.pfyk,
|
|
1053
1285
|
additional_info: {
|
|
1054
|
-
uuid: _this.
|
|
1055
|
-
name: _this.
|
|
1286
|
+
uuid: _this.jaGt,
|
|
1287
|
+
name: _this.ylID.EDaN
|
|
1056
1288
|
}
|
|
1057
1289
|
});
|
|
1058
1290
|
}
|
|
1059
1291
|
});
|
|
1060
|
-
_defineProperty(this, "
|
|
1061
|
-
_this.
|
|
1292
|
+
_defineProperty(this, "GuEG", function () {
|
|
1293
|
+
var length = _this.bwHJ.length;
|
|
1294
|
+
var isSatisfied = length < 1;
|
|
1295
|
+
var combineOperator = "";
|
|
1296
|
+
for (var index = 0; index < length; index++) {
|
|
1297
|
+
var validator = _this.bwHJ[index];
|
|
1298
|
+
var currentResult = validator.HPUo;
|
|
1299
|
+
if (combineOperator.trim() === "") {
|
|
1300
|
+
isSatisfied = currentResult;
|
|
1301
|
+
} else {
|
|
1302
|
+
switch (combineOperator) {
|
|
1303
|
+
case "AND":
|
|
1304
|
+
isSatisfied = isSatisfied && currentResult;
|
|
1305
|
+
break;
|
|
1306
|
+
case "OR":
|
|
1307
|
+
isSatisfied = isSatisfied || currentResult;
|
|
1308
|
+
break;
|
|
1309
|
+
}
|
|
1310
|
+
}
|
|
1311
|
+
combineOperator = validator.mCal;
|
|
1312
|
+
}
|
|
1313
|
+
if (isSatisfied) {
|
|
1314
|
+
console.log("Dispatching event", _this.ylID.pfyk);
|
|
1315
|
+
Apxor.getController().persistTerminationInfoLocally(_this.jaGt);
|
|
1316
|
+
if (_this.ylID._only_context === true) {
|
|
1317
|
+
Apxor.logEvent(APX_CONTEXT_EVALUATED, _objectSpread2(_objectSpread2({}, _this.ylID._attr), {}, {
|
|
1318
|
+
message_name: _this.ylID.EDaN,
|
|
1319
|
+
id: _this.jaGt
|
|
1320
|
+
}));
|
|
1321
|
+
}
|
|
1322
|
+
// Emit event
|
|
1323
|
+
Apxor.getController().dispatchEvent(_this.ylID.pfyk, {
|
|
1324
|
+
name: _this.ylID.pfyk,
|
|
1325
|
+
additional_info: {
|
|
1326
|
+
uuid: _this.jaGt,
|
|
1327
|
+
name: _this.ylID.EDaN
|
|
1328
|
+
}
|
|
1329
|
+
});
|
|
1330
|
+
}
|
|
1331
|
+
});
|
|
1332
|
+
_defineProperty(this, "validateForTerminationAttributes", function () {
|
|
1333
|
+
var userAttributes = Apxor.getController().getUserAttributes();
|
|
1334
|
+
var sessionAttributes = Apxor.getController().getSessionAttributes();
|
|
1335
|
+
return _this.xoSz.validate(userAttributes, sessionAttributes);
|
|
1336
|
+
});
|
|
1337
|
+
_defineProperty(this, "oDrA", function () {
|
|
1338
|
+
_this.CWOw.oDrA();
|
|
1062
1339
|
});
|
|
1063
1340
|
_defineProperty(this, "getFrequencyCount", function () {
|
|
1064
|
-
return _this.
|
|
1341
|
+
return _this.CWOw.getFrequencyCount();
|
|
1065
1342
|
});
|
|
1066
|
-
_defineProperty(this, "
|
|
1067
|
-
return _this.
|
|
1343
|
+
_defineProperty(this, "XgXS", function () {
|
|
1344
|
+
return _this.CWOw.XbPF();
|
|
1068
1345
|
});
|
|
1069
1346
|
});
|
|
1070
1347
|
|
|
1071
1348
|
var ConfigLookup = /*#__PURE__*/_createClass(function ConfigLookup() {
|
|
1072
1349
|
var _this = this;
|
|
1073
1350
|
_classCallCheck(this, ConfigLookup);
|
|
1074
|
-
_defineProperty(this, "
|
|
1351
|
+
_defineProperty(this, "IZYQ", {});
|
|
1075
1352
|
_defineProperty(this, "parse", function () {
|
|
1076
1353
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
1077
1354
|
configs: []
|
|
@@ -1094,7 +1371,7 @@
|
|
|
1094
1371
|
var configId = _config._id;
|
|
1095
1372
|
var configItem = new ConfigItem();
|
|
1096
1373
|
if (configItem.parse(_config)) {
|
|
1097
|
-
_this.
|
|
1374
|
+
_this.IZYQ[configId] = configItem;
|
|
1098
1375
|
} else {
|
|
1099
1376
|
console.warn("Failed to parse cfg", configId);
|
|
1100
1377
|
}
|
|
@@ -1102,31 +1379,44 @@
|
|
|
1102
1379
|
}
|
|
1103
1380
|
});
|
|
1104
1381
|
_defineProperty(this, "validate", function (id, index) {
|
|
1105
|
-
if (_this.
|
|
1106
|
-
var configItem = _this.
|
|
1107
|
-
configItem.
|
|
1382
|
+
if (_this.IZYQ[id]) {
|
|
1383
|
+
var configItem = _this.IZYQ[id];
|
|
1384
|
+
configItem.Adtv(index);
|
|
1108
1385
|
}
|
|
1109
1386
|
});
|
|
1110
|
-
_defineProperty(this, "
|
|
1111
|
-
|
|
1112
|
-
|
|
1387
|
+
_defineProperty(this, "validateForTermination", function (id, index) {
|
|
1388
|
+
if (_this.IZYQ[id]) {
|
|
1389
|
+
var configItem = _this.IZYQ[id];
|
|
1390
|
+
configItem.RbFI(index);
|
|
1391
|
+
}
|
|
1392
|
+
});
|
|
1393
|
+
_defineProperty(this, "validateForTerminationAttributes", function (id) {
|
|
1394
|
+
if (_this.IZYQ[id]) {
|
|
1395
|
+
var configItem = _this.IZYQ[id];
|
|
1396
|
+
return configItem.validateForTerminationAttributes();
|
|
1397
|
+
}
|
|
1398
|
+
return false;
|
|
1399
|
+
});
|
|
1400
|
+
_defineProperty(this, "oDrA", function (id) {
|
|
1401
|
+
var campiagnConfig = _this.IZYQ[id];
|
|
1402
|
+
campiagnConfig.oDrA();
|
|
1113
1403
|
});
|
|
1114
1404
|
_defineProperty(this, "getFrequencyCount", function (id) {
|
|
1115
|
-
var campiagnConfig = _this.
|
|
1405
|
+
var campiagnConfig = _this.IZYQ[id];
|
|
1116
1406
|
return campiagnConfig.getFrequencyCount();
|
|
1117
1407
|
});
|
|
1118
1408
|
_defineProperty(this, "resetFrequencyCounts", function () {
|
|
1119
|
-
var configs = _this.
|
|
1409
|
+
var configs = _this.IZYQ;
|
|
1120
1410
|
for (var configId in configs) {
|
|
1121
|
-
configs[configId].
|
|
1411
|
+
configs[configId].XgXS();
|
|
1122
1412
|
}
|
|
1123
1413
|
});
|
|
1124
|
-
_defineProperty(this, "
|
|
1414
|
+
_defineProperty(this, "NveP", function (campaignId) {
|
|
1125
1415
|
try {
|
|
1126
|
-
if (_this.
|
|
1127
|
-
var configItem = _this.
|
|
1128
|
-
if (configItem && configItem.
|
|
1129
|
-
return configItem.
|
|
1416
|
+
if (_this.IZYQ) {
|
|
1417
|
+
var configItem = _this.IZYQ[campaignId];
|
|
1418
|
+
if (configItem && configItem.ylID) {
|
|
1419
|
+
return configItem.ylID;
|
|
1130
1420
|
}
|
|
1131
1421
|
}
|
|
1132
1422
|
} catch (e) {
|
|
@@ -1138,46 +1428,46 @@
|
|
|
1138
1428
|
|
|
1139
1429
|
var APP_EVENT = "APP_EVENT";
|
|
1140
1430
|
var CLIENT_EVENT = "CLIENT_EVENT";
|
|
1141
|
-
var Logger$
|
|
1431
|
+
var Logger$9 = window.ApxorLogger;
|
|
1142
1432
|
var EventsListener = /*#__PURE__*/_createClass(function EventsListener() {
|
|
1143
1433
|
var _this = this;
|
|
1144
1434
|
_classCallCheck(this, EventsListener);
|
|
1145
|
-
_defineProperty(this, "
|
|
1146
|
-
_defineProperty(this, "
|
|
1147
|
-
_defineProperty(this, "
|
|
1435
|
+
_defineProperty(this, "FDcv", {});
|
|
1436
|
+
_defineProperty(this, "kJex", []);
|
|
1437
|
+
_defineProperty(this, "qMxr", false);
|
|
1148
1438
|
_defineProperty(this, "initialize", function () {
|
|
1149
1439
|
var controller = Apxor.getController();
|
|
1150
1440
|
controller.registerForEvent(APP_EVENT, function (event) {
|
|
1151
|
-
return _this.
|
|
1441
|
+
return _this.LtdS(event, "AE");
|
|
1152
1442
|
});
|
|
1153
1443
|
controller.registerForEvent(CLIENT_EVENT, function (event) {
|
|
1154
|
-
return _this.
|
|
1444
|
+
return _this.LtdS(event, "CE");
|
|
1155
1445
|
});
|
|
1156
1446
|
});
|
|
1157
|
-
_defineProperty(this, "
|
|
1447
|
+
_defineProperty(this, "zgeH", function () {
|
|
1158
1448
|
// Clear Buffer
|
|
1159
|
-
for (var item in _this.
|
|
1160
|
-
_this.
|
|
1449
|
+
for (var item in _this.kJex) {
|
|
1450
|
+
_this.rqKD(item.event, item.key, item.type);
|
|
1161
1451
|
}
|
|
1162
|
-
_this.
|
|
1452
|
+
_this.qMxr = true;
|
|
1163
1453
|
});
|
|
1164
|
-
_defineProperty(this, "
|
|
1454
|
+
_defineProperty(this, "Weok", function (event, callback) {
|
|
1165
1455
|
if (!isFunction(callback)) {
|
|
1166
1456
|
return;
|
|
1167
1457
|
}
|
|
1168
1458
|
var listeners;
|
|
1169
|
-
if (_this.
|
|
1170
|
-
listeners = _this.
|
|
1459
|
+
if (_this.FDcv[event]) {
|
|
1460
|
+
listeners = _this.FDcv[event];
|
|
1171
1461
|
} else {
|
|
1172
1462
|
listeners = [];
|
|
1173
1463
|
}
|
|
1174
1464
|
listeners.push(callback);
|
|
1175
|
-
_this.
|
|
1176
|
-
Logger$
|
|
1465
|
+
_this.FDcv[event] = listeners;
|
|
1466
|
+
Logger$9.debug("Listeners list: ", _this.FDcv);
|
|
1177
1467
|
});
|
|
1178
1468
|
_defineProperty(this, "unregisterFromEvent", function (event, callback) {
|
|
1179
|
-
if (_this.
|
|
1180
|
-
var listeners = _this.
|
|
1469
|
+
if (_this.FDcv[event]) {
|
|
1470
|
+
var listeners = _this.FDcv[event];
|
|
1181
1471
|
var updatedListeners = [];
|
|
1182
1472
|
for (var index = 0; index < listeners.length; index++) {
|
|
1183
1473
|
var listener = listeners[index];
|
|
@@ -1185,25 +1475,25 @@
|
|
|
1185
1475
|
updatedListeners.push(listener);
|
|
1186
1476
|
}
|
|
1187
1477
|
}
|
|
1188
|
-
_this.
|
|
1478
|
+
_this.FDcv[event] = updatedListeners;
|
|
1189
1479
|
}
|
|
1190
1480
|
});
|
|
1191
|
-
_defineProperty(this, "
|
|
1481
|
+
_defineProperty(this, "LtdS", function (event) {
|
|
1192
1482
|
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "AE";
|
|
1193
1483
|
var key = type + "___" + event.name;
|
|
1194
|
-
_this.
|
|
1484
|
+
_this.rqKD(event, key, type);
|
|
1195
1485
|
});
|
|
1196
|
-
_defineProperty(this, "
|
|
1197
|
-
if (!_this.
|
|
1198
|
-
_this.
|
|
1486
|
+
_defineProperty(this, "rqKD", function (event, key, type) {
|
|
1487
|
+
if (!_this.qMxr) {
|
|
1488
|
+
_this.kJex.push({
|
|
1199
1489
|
event: event,
|
|
1200
1490
|
key: key,
|
|
1201
1491
|
type: type
|
|
1202
1492
|
});
|
|
1203
1493
|
} else {
|
|
1204
|
-
Logger$
|
|
1205
|
-
if (_this.
|
|
1206
|
-
var listeners = _this.
|
|
1494
|
+
Logger$9.debug("Notifying listeners for event: " + event + ", " + key, _this.FDcv);
|
|
1495
|
+
if (_this.FDcv[key]) {
|
|
1496
|
+
var listeners = _this.FDcv[key];
|
|
1207
1497
|
var time = Apxor.getController().getSDKRunningTimeInSec();
|
|
1208
1498
|
for (var index = 0; index < listeners.length; index++) {
|
|
1209
1499
|
var listener = listeners[index];
|
|
@@ -1214,22 +1504,22 @@
|
|
|
1214
1504
|
});
|
|
1215
1505
|
});
|
|
1216
1506
|
|
|
1217
|
-
var Logger$
|
|
1507
|
+
var Logger$a = window.ApxorLogger;
|
|
1218
1508
|
var CE = /*#__PURE__*/function () {
|
|
1219
1509
|
function CE() {
|
|
1220
1510
|
var _this = this;
|
|
1221
1511
|
_classCallCheck(this, CE);
|
|
1222
|
-
_defineProperty(this, "
|
|
1223
|
-
_defineProperty(this, "
|
|
1224
|
-
_defineProperty(this, "
|
|
1225
|
-
_defineProperty(this, "
|
|
1226
|
-
_defineProperty(this, "
|
|
1512
|
+
_defineProperty(this, "EXbT", false);
|
|
1513
|
+
_defineProperty(this, "OqkB", null);
|
|
1514
|
+
_defineProperty(this, "wsiO", getDateInDDMMYYYY());
|
|
1515
|
+
_defineProperty(this, "DGNj", new EventsListener());
|
|
1516
|
+
_defineProperty(this, "nawG", Apxor.getSiteId());
|
|
1227
1517
|
_defineProperty(this, "_qeState", {});
|
|
1228
1518
|
_defineProperty(this, "getQeState", function () {
|
|
1229
1519
|
try {
|
|
1230
1520
|
var data = Apxor.getController().getFromStorage(QE_STATE);
|
|
1231
1521
|
if (data) {
|
|
1232
|
-
return JSON.parse(decode(_this.
|
|
1522
|
+
return JSON.parse(decode(_this.nawG, data));
|
|
1233
1523
|
} else {
|
|
1234
1524
|
_this._qeState = {};
|
|
1235
1525
|
return _this.setQeState();
|
|
@@ -1258,12 +1548,12 @@
|
|
|
1258
1548
|
return _this._qeState;
|
|
1259
1549
|
});
|
|
1260
1550
|
_defineProperty(this, "initialize", function () {
|
|
1261
|
-
if (!_this.
|
|
1262
|
-
_this.
|
|
1263
|
-
_this.
|
|
1264
|
-
_this.
|
|
1551
|
+
if (!_this.EXbT) {
|
|
1552
|
+
_this.EXbT = true;
|
|
1553
|
+
_this.OqkB = new ConfigLookup();
|
|
1554
|
+
_this.DGNj.initialize();
|
|
1265
1555
|
_this._qeState = _this.getQeState();
|
|
1266
|
-
Logger$
|
|
1556
|
+
Logger$a.info("QE Initialized..");
|
|
1267
1557
|
}
|
|
1268
1558
|
});
|
|
1269
1559
|
/**
|
|
@@ -1272,12 +1562,12 @@
|
|
|
1272
1562
|
* @param config
|
|
1273
1563
|
*/
|
|
1274
1564
|
_defineProperty(this, "parse", function (config) {
|
|
1275
|
-
if (!_this.
|
|
1276
|
-
Logger$
|
|
1565
|
+
if (!_this.TrIj()) {
|
|
1566
|
+
Logger$a.warn("Must call init first. Unable to proceed");
|
|
1277
1567
|
return;
|
|
1278
1568
|
}
|
|
1279
|
-
_this.
|
|
1280
|
-
_this.
|
|
1569
|
+
_this.OqkB.parse(config);
|
|
1570
|
+
_this.DGNj.zgeH();
|
|
1281
1571
|
});
|
|
1282
1572
|
/**
|
|
1283
1573
|
* Validates all conditions for given config ID
|
|
@@ -1286,10 +1576,19 @@
|
|
|
1286
1576
|
* @param index
|
|
1287
1577
|
*/
|
|
1288
1578
|
_defineProperty(this, "validate", function (id, index) {
|
|
1289
|
-
if (!_this.
|
|
1579
|
+
if (!_this.TrIj()) {
|
|
1290
1580
|
return;
|
|
1291
1581
|
}
|
|
1292
|
-
_this.
|
|
1582
|
+
_this.OqkB.validate(id, index);
|
|
1583
|
+
});
|
|
1584
|
+
_defineProperty(this, "validateForTermination", function (id, index) {
|
|
1585
|
+
if (!_this.TrIj()) {
|
|
1586
|
+
return;
|
|
1587
|
+
}
|
|
1588
|
+
_this.OqkB.validateForTermination(id, index);
|
|
1589
|
+
});
|
|
1590
|
+
_defineProperty(this, "validateForTerminationAttributes", function (user, session) {
|
|
1591
|
+
return _this.OqkB.validateForTerminationAttributes(user, session);
|
|
1293
1592
|
});
|
|
1294
1593
|
_defineProperty(this, "updateCount", function (id) {
|
|
1295
1594
|
try {
|
|
@@ -1298,22 +1597,22 @@
|
|
|
1298
1597
|
}
|
|
1299
1598
|
_this.incrementFrequencies(id);
|
|
1300
1599
|
_this.setQeState(id);
|
|
1301
|
-
_this.
|
|
1600
|
+
_this.OqkB.oDrA(id);
|
|
1302
1601
|
} catch (e) {
|
|
1303
1602
|
console.log("Could not update the count config:".concat(e));
|
|
1304
1603
|
}
|
|
1305
1604
|
});
|
|
1306
1605
|
_defineProperty(this, "resetFrequencyCounts", function () {
|
|
1307
|
-
_this.
|
|
1606
|
+
_this.OqkB.resetFrequencyCounts();
|
|
1308
1607
|
});
|
|
1309
1608
|
_defineProperty(this, "getFrequencyCount", function (id) {
|
|
1310
|
-
return _this.
|
|
1609
|
+
return _this.OqkB.getFrequencyCount(id);
|
|
1311
1610
|
});
|
|
1312
1611
|
_defineProperty(this, "registerForEvent", function (event, callback) {
|
|
1313
|
-
_this.
|
|
1612
|
+
_this.DGNj.Weok(event, callback);
|
|
1314
1613
|
});
|
|
1315
1614
|
_defineProperty(this, "unregisterFromEvent", function (event, callback) {
|
|
1316
|
-
_this.
|
|
1615
|
+
_this.DGNj.unregisterFromEvent(event, callback);
|
|
1317
1616
|
});
|
|
1318
1617
|
/**
|
|
1319
1618
|
* Fetches the config from Server
|
|
@@ -1326,14 +1625,14 @@
|
|
|
1326
1625
|
_defineProperty(this, "fetch", function (type, validateUrl, apiUrl, callback) {
|
|
1327
1626
|
Apxor.getController().fetchConfiguration(type, validateUrl, apiUrl, callback);
|
|
1328
1627
|
});
|
|
1329
|
-
_defineProperty(this, "
|
|
1330
|
-
return _this.
|
|
1628
|
+
_defineProperty(this, "TrIj", function () {
|
|
1629
|
+
return _this.EXbT;
|
|
1331
1630
|
});
|
|
1332
1631
|
_defineProperty(this, "getCampaignMetaFromQueryEngine", function (campaignId) {
|
|
1333
|
-
return _this.
|
|
1632
|
+
return _this.OqkB.NveP(campaignId);
|
|
1334
1633
|
});
|
|
1335
|
-
_defineProperty(this, "
|
|
1336
|
-
return _this.
|
|
1634
|
+
_defineProperty(this, "ZCjh", function () {
|
|
1635
|
+
return _this.wsiO;
|
|
1337
1636
|
});
|
|
1338
1637
|
if (!CE.instance) {
|
|
1339
1638
|
CE.instance = this;
|
|
@@ -1357,11 +1656,11 @@
|
|
|
1357
1656
|
OVERALL: 0,
|
|
1358
1657
|
DATES: {}
|
|
1359
1658
|
};
|
|
1360
|
-
if (this.
|
|
1659
|
+
if (this.wsiO) this._qeState[id].DATES[this.wsiO] = 0;
|
|
1361
1660
|
this.setQeState(id);
|
|
1362
1661
|
}
|
|
1363
1662
|
} catch (e) {
|
|
1364
|
-
Logger$
|
|
1663
|
+
Logger$a.error("Can not create the frequency count object:" + e);
|
|
1365
1664
|
}
|
|
1366
1665
|
}
|
|
1367
1666
|
}, {
|
|
@@ -1376,12 +1675,12 @@
|
|
|
1376
1675
|
|
|
1377
1676
|
// Increment the DATES count for this particular date by 1. If the date changes reset.
|
|
1378
1677
|
var currentDate = getDateInDDMMYYYY();
|
|
1379
|
-
if (currentDate !== this.
|
|
1380
|
-
this.
|
|
1678
|
+
if (currentDate !== this.wsiO || !(configFrequency.DATES && configFrequency.DATES[currentDate])) {
|
|
1679
|
+
this.wsiO = currentDate;
|
|
1381
1680
|
configFrequency.DATES = {};
|
|
1382
|
-
configFrequency.DATES[this.
|
|
1681
|
+
configFrequency.DATES[this.wsiO] = 0;
|
|
1383
1682
|
}
|
|
1384
|
-
configFrequency.DATES[this.
|
|
1683
|
+
configFrequency.DATES[this.wsiO] = configFrequency.DATES[this.wsiO] + 1;
|
|
1385
1684
|
}
|
|
1386
1685
|
}], [{
|
|
1387
1686
|
key: "getInstance",
|
|
@@ -1400,7 +1699,7 @@
|
|
|
1400
1699
|
|
|
1401
1700
|
/* eslint-disable no-empty */
|
|
1402
1701
|
|
|
1403
|
-
window.ceVersion =
|
|
1702
|
+
window.ceVersion = 140;
|
|
1404
1703
|
try {
|
|
1405
1704
|
if (exports !== undefined || exports !== null) {
|
|
1406
1705
|
exports["default"] = CE;
|