apxor-qe 1.6.0 → 1.6.2-qa.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 +886 -562
- package/dist/apxor.qe.min.js +1 -1
- package/package.json +2 -2
package/dist/apxor.qe.js.bak
CHANGED
|
@@ -112,6 +112,7 @@
|
|
|
112
112
|
return typeof key === "symbol" ? key : String(key);
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
+
var Logger = window.ApxorLogger;
|
|
115
116
|
var isUndefined = function isUndefined(term) {
|
|
116
117
|
return typeof term === "undefined";
|
|
117
118
|
};
|
|
@@ -207,7 +208,7 @@
|
|
|
207
208
|
var toUpperCase = function toUpperCase(key) {
|
|
208
209
|
return key.toUpperCase();
|
|
209
210
|
};
|
|
210
|
-
var
|
|
211
|
+
var FrGM = function FrGM(actual, expected, operator) {
|
|
211
212
|
switch (operator) {
|
|
212
213
|
case "EQ":
|
|
213
214
|
return actual === expected;
|
|
@@ -263,39 +264,243 @@
|
|
|
263
264
|
mins: currentTime.getMinutes()
|
|
264
265
|
};
|
|
265
266
|
};
|
|
267
|
+
var _doesUrlMatchSkeleton = function _doesUrlMatchSkeleton(currenturl, skeleton, variable) {
|
|
268
|
+
var startsWith = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
269
|
+
var variablePattern = "([^/]+)";
|
|
270
|
+
var escapedVariable = variable ?
|
|
271
|
+
// eslint-disable-next-line no-useless-escape
|
|
272
|
+
variable.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&") : "";
|
|
273
|
+
var pattern = skeleton.replace(new RegExp(escapedVariable, "g"), variablePattern);
|
|
274
|
+
// Adjust regex based on startsWith
|
|
275
|
+
var regex = new RegExp("^".concat(pattern) + (startsWith ? "" : "$"));
|
|
276
|
+
var match = currenturl.match(regex);
|
|
277
|
+
return match !== null;
|
|
278
|
+
};
|
|
266
279
|
|
|
267
|
-
|
|
280
|
+
// Checks if the given element is in viewport or not.
|
|
281
|
+
var isElementInViewport = function isElementInViewport(el) {
|
|
282
|
+
var elementOffsetHight = el.offsetHeight;
|
|
283
|
+
var elementOffsetWidth = el.offsetWidth;
|
|
284
|
+
var boundingRect = el.getBoundingClientRect();
|
|
285
|
+
if (boundingRect.left >= -elementOffsetWidth && boundingRect.top >= -elementOffsetHight && boundingRect.right <= (window.innerWidth || document.documentElement.clientWidth) + elementOffsetWidth && boundingRect.bottom <= (window.innerHeight || document.documentElement.clientHeight) + elementOffsetHight) {
|
|
286
|
+
return true;
|
|
287
|
+
} else {
|
|
288
|
+
return false;
|
|
289
|
+
}
|
|
290
|
+
};
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* @function _findTargetElement
|
|
294
|
+
* @private
|
|
295
|
+
* @description Finds the target element in the DOM.
|
|
296
|
+
* @param {function} targetFoundCallback
|
|
297
|
+
*/
|
|
298
|
+
function _findTargetElement(id) {
|
|
299
|
+
var frame_id = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
300
|
+
var enable_retry = arguments.length > 2 ? arguments[2] : undefined;
|
|
301
|
+
var interval = arguments.length > 3 ? arguments[3] : undefined;
|
|
302
|
+
var max_retries = arguments.length > 4 ? arguments[4] : undefined;
|
|
303
|
+
var targetElement = getElementFromSelector(id, frame_id);
|
|
304
|
+
if (!targetElement) {
|
|
305
|
+
if (enable_retry) {
|
|
306
|
+
Logger.info("Not found yet. Rechecking the DOM.");
|
|
307
|
+
return _retryFindingTargetElement(max_retries, interval, id, frame_id);
|
|
308
|
+
} else {
|
|
309
|
+
Logger.info("Element with selector:".concat(id, " not found."));
|
|
310
|
+
return false;
|
|
311
|
+
}
|
|
312
|
+
} else {
|
|
313
|
+
var targetFoundCallback = function targetFoundCallback() {
|
|
314
|
+
var isElementVisible = _isElementVisible(targetElement);
|
|
315
|
+
if (isElementVisible) {
|
|
316
|
+
// Attch a click callback to the target. If the target dismiss config is true, it will dismiss the tooltip
|
|
317
|
+
// let targetClickCallback = this._targetClickCallback.bind(this);
|
|
318
|
+
// this.targetElement.addEventListener("click", targetClickCallback);
|
|
319
|
+
var targetValidCallback = function targetValidCallback(targetElement) {
|
|
320
|
+
//Once the target is found then scroll into it.
|
|
321
|
+
return _scrollIntoTargetIfNeeded(targetElement);
|
|
322
|
+
};
|
|
323
|
+
return targetValidCallback(targetElement);
|
|
324
|
+
} else {
|
|
325
|
+
Logger.info("Invalid target element. Width and height are 0 for element: ".concat(id, ". Can't show tooltip"));
|
|
326
|
+
return false;
|
|
327
|
+
//_resetRTMAction();
|
|
328
|
+
}
|
|
329
|
+
};
|
|
330
|
+
|
|
331
|
+
return targetFoundCallback();
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* @function _retryFindingTargetElement
|
|
337
|
+
* @private
|
|
338
|
+
* @description Continuously rechecks the DOM for the target element after every retry_interval.
|
|
339
|
+
* Maximum times it checks is configured through max_retries
|
|
340
|
+
* @param {function} targetFoundCallback
|
|
341
|
+
*/
|
|
342
|
+
function _retryFindingTargetElement(max_retries, interval, id) {
|
|
343
|
+
var frame_id = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "";
|
|
344
|
+
//After every find_interval check the DOM for target element.
|
|
345
|
+
var elementRecheckIntervalId = setInterval(function () {
|
|
346
|
+
var targetElement = getElementFromSelector(id, frame_id);
|
|
347
|
+
//If the element is found, stop checking the DOM.
|
|
348
|
+
if (targetElement) {
|
|
349
|
+
clearInterval(elementRecheckIntervalId);
|
|
350
|
+
var targetFoundCallback = function targetFoundCallback() {
|
|
351
|
+
var isElementVisible = _isElementVisible();
|
|
352
|
+
if (isElementVisible) {
|
|
353
|
+
// Attch a click callback to the target. If the target dismiss config is true, it will dismiss the tooltip
|
|
354
|
+
// let targetClickCallback = this._targetClickCallback.bind(this);
|
|
355
|
+
// this.targetElement.addEventListener("click", targetClickCallback);
|
|
356
|
+
var targetValidCallback = function targetValidCallback() {
|
|
357
|
+
//Once the target is found then scroll into it.
|
|
358
|
+
_scrollIntoTargetIfNeeded();
|
|
359
|
+
};
|
|
360
|
+
targetValidCallback();
|
|
361
|
+
} else {
|
|
362
|
+
Logger.info("Invalid target element. Width and height are 0 for element: ".concat(id, ". Can't show tooltip"));
|
|
363
|
+
//this._resetRTMAction();
|
|
364
|
+
}
|
|
365
|
+
};
|
|
366
|
+
|
|
367
|
+
targetFoundCallback(targetElement);
|
|
368
|
+
} else {
|
|
369
|
+
max_retries = max_retries - 1;
|
|
370
|
+
// If the element is not found even after max interval, stop checking
|
|
371
|
+
if (max_retries <= 0) {
|
|
372
|
+
clearInterval(elementRecheckIntervalId);
|
|
373
|
+
console.warn("Element with selector:".concat(id, " not found."));
|
|
374
|
+
//this._resetRTMAction();
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
}, interval);
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
/**
|
|
381
|
+
* @function getElementFromSelector
|
|
382
|
+
* @description Finds the element in DOM for a given selector. Selector can be an ID, or any css selector. It can also be an XPath.
|
|
383
|
+
* @param {string} selector
|
|
384
|
+
* @returns {HTMLElement} Returns the HTML element that matches the given selector
|
|
385
|
+
*/
|
|
386
|
+
var getElementFromSelector = function getElementFromSelector(selector) {
|
|
387
|
+
var iframe_id = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
388
|
+
// Given selector can be an ID.
|
|
389
|
+
var element = document.getElementById(selector);
|
|
390
|
+
if (!element) {
|
|
391
|
+
try {
|
|
392
|
+
element = document.querySelector(selector);
|
|
393
|
+
} catch (e) {
|
|
394
|
+
//If there is an exception, it means it is not a valid selector.
|
|
395
|
+
window.ApxorLogger.error("Error finding element in DOM:" + e);
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
// If no element is found till now, it means it is neither an ID nor a valid css selector. It could be an XPath.
|
|
399
|
+
if (!element) {
|
|
400
|
+
element = getElementByXPath(selector);
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
// If no element is found, it means the selector is not an ID. It could be a css selector
|
|
404
|
+
if (!element && iframe_id.length > 0) {
|
|
405
|
+
var _document$getElementB;
|
|
406
|
+
element = (_document$getElementB = document.getElementById(iframe_id)) === null || _document$getElementB === void 0 || (_document$getElementB = _document$getElementB.contentWindow) === null || _document$getElementB === void 0 || (_document$getElementB = _document$getElementB.document) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.querySelector(selector);
|
|
407
|
+
}
|
|
408
|
+
return element;
|
|
409
|
+
};
|
|
410
|
+
var getElementByXPath = function getElementByXPath(path) {
|
|
411
|
+
var index = path.indexOf("svg");
|
|
412
|
+
if (index !== -1) {
|
|
413
|
+
path = path.substring(0, index) + "svg:svg";
|
|
414
|
+
}
|
|
415
|
+
try {
|
|
416
|
+
return document.xOwj(path, document, function (prefix) {
|
|
417
|
+
if (prefix === "svg") {
|
|
418
|
+
return "http://www.w3.org/2000/svg";
|
|
419
|
+
} else {
|
|
420
|
+
return null;
|
|
421
|
+
}
|
|
422
|
+
}, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
|
|
423
|
+
} catch (e) {
|
|
424
|
+
window.ApxorLogger.error("Error finding element in DOM:" + e);
|
|
425
|
+
}
|
|
426
|
+
return null;
|
|
427
|
+
};
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* @function _isElementVisible
|
|
431
|
+
* @private
|
|
432
|
+
* @description Checks if the element has a visible height and width
|
|
433
|
+
* @returns {boolean} true - If element is visible
|
|
434
|
+
* false - If the element is not visible
|
|
435
|
+
*/
|
|
436
|
+
function _isElementVisible(targetElement) {
|
|
437
|
+
try {
|
|
438
|
+
var rect = targetElement.getBoundingClientRect();
|
|
439
|
+
if (rect.width === 0 || rect.height === 0) {
|
|
440
|
+
return false;
|
|
441
|
+
}
|
|
442
|
+
} catch (e) {
|
|
443
|
+
return false;
|
|
444
|
+
}
|
|
445
|
+
return true;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
/**
|
|
449
|
+
* @function _scrollIntoTargetIfNeeded
|
|
450
|
+
* @private
|
|
451
|
+
* @description Scrolls into the target element if needed.
|
|
452
|
+
* @param {function} targetReachedCallback
|
|
453
|
+
*/
|
|
454
|
+
function _scrollIntoTargetIfNeeded(targetElement) {
|
|
455
|
+
var isTargetInViewPort = isElementInViewport(targetElement);
|
|
456
|
+
// If the element is not in the viewport. scroll into the target element only if the config says so.
|
|
457
|
+
if (isTargetInViewPort) {
|
|
458
|
+
return true;
|
|
459
|
+
} else {
|
|
460
|
+
return false;
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
var feedBackMessagePopUpCE = function feedBackMessagePopUpCE(message) {
|
|
464
|
+
var feedbackModal = "\n <style> \n .apx-container{\n padding:10px;\n }\n </style>\n <div id=\"apx-innerElement\" class=\"apx-container\">\n <div id=\"close-button\" style=\"cursor: pointer;position:absolute;top:9px;right:9px;\"><svg width=\"11\" height=\"11\" viewBox=\"0 0 18 18\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path opacity=\"0.5\" d=\"M11.0962 9.07071L17.8586 15.8331L15.8331 17.8586L9.0707 11.0962L8.99999 11.0255L8.92928 11.0962L2.16693 17.8586L0.141421 15.8331L6.90379 9.07071L6.9745 9L6.90379 8.92929L0.141421 2.16694L2.16693 0.141422L8.92928 6.9038L8.99999 6.97451L9.0707 6.9038L15.8331 0.141422L17.8586 2.16694L11.0962 8.92929L11.0255 9L11.0962 9.07071Z\" fill=\"white\" stroke=\"#002845\" stroke-width=\"0.2\"/>\n </svg>\n </div>\n <div style=\"font-family: inherit;font-style: normal;font-weight: 600;font-size: 16px;line-height: 22px;\n color: #FFFFFF; display: flex; gap: 12px;\"><svg xmlns=\"http://www.w3.org/2000/svg\" class=\"icon icon-tabler icon-tabler-circle-check-filled\" width=\"33\" height=\"33\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"#ffffff\" fill=\"none\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/>\n <path d=\"M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-1.293 5.953a1 1 0 0 0 -1.32 -.083l-.094 .083l-3.293 3.292l-1.293 -1.292l-.094 -.083a1 1 0 0 0 -1.403 1.403l.083 .094l2 2l.094 .083a1 1 0 0 0 1.226 0l.094 -.083l4 -4l.083 -.094a1 1 0 0 0 -.083 -1.32z\" stroke-width=\"0\" fill=\"currentColor\" />\n</svg><div style = \"align-self: center;padding-right:20px;\">".concat(message, "</div></div>\n </div>\n ");
|
|
465
|
+
var feedbackParentDiv = document.createElement("div");
|
|
466
|
+
feedbackParentDiv.style = "\n z-index:99999999;\n background:#16202f;\n position:fixed;\n top:1%;\n right:1%;\n border-radius: 12px;\n ";
|
|
467
|
+
feedbackParentDiv.innerHTML = feedbackModal;
|
|
468
|
+
feedbackParentDiv.id = "apx-container";
|
|
469
|
+
document.body.appendChild(feedbackParentDiv);
|
|
470
|
+
};
|
|
471
|
+
|
|
472
|
+
var Logger$1 = window.ApxorLogger;
|
|
268
473
|
var Audience = /*#__PURE__*/_createClass(function Audience() {
|
|
269
474
|
var _this = this;
|
|
270
475
|
_classCallCheck(this, Audience);
|
|
271
|
-
_defineProperty(this, "
|
|
272
|
-
_defineProperty(this, "
|
|
273
|
-
_defineProperty(this, "
|
|
476
|
+
_defineProperty(this, "MLcB", "ALL");
|
|
477
|
+
_defineProperty(this, "dsWR", []);
|
|
478
|
+
_defineProperty(this, "LTNO", []);
|
|
274
479
|
_defineProperty(this, "userAttributesValidated", true);
|
|
275
480
|
_defineProperty(this, "sessionAttributeValidated", true);
|
|
276
481
|
_defineProperty(this, "parse", function () {
|
|
277
482
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
278
483
|
try {
|
|
279
|
-
_this.
|
|
280
|
-
_this.
|
|
281
|
-
_this.
|
|
282
|
-
if (!Array.isArray(_this.
|
|
283
|
-
Logger.error("No attributes");
|
|
484
|
+
_this.MLcB = config.audience.audience_type;
|
|
485
|
+
_this.dsWR = config.audience.attributes.user;
|
|
486
|
+
_this.LTNO = config.audience.attributes.session;
|
|
487
|
+
if (!Array.isArray(_this.dsWR) || !Array.isArray(_this.LTNO)) {
|
|
488
|
+
Logger$1.error("No attributes");
|
|
284
489
|
return false;
|
|
285
490
|
}
|
|
286
491
|
} catch (error) {
|
|
287
|
-
Logger.error(error);
|
|
492
|
+
Logger$1.error(error);
|
|
288
493
|
return false;
|
|
289
494
|
}
|
|
290
495
|
return true;
|
|
291
496
|
});
|
|
292
497
|
_defineProperty(this, "validate", function (user, session) {
|
|
293
498
|
var status = true;
|
|
294
|
-
if (_this.
|
|
499
|
+
if (_this.MLcB === "FTU") {
|
|
295
500
|
status = Apxor.getController().getSessionInfo().is_first_session;
|
|
296
501
|
}
|
|
297
|
-
var userAttributesCompare = _this.
|
|
298
|
-
var sessionAttributesCompare = _this.
|
|
502
|
+
var userAttributesCompare = _this.oQgb(user, _this.dsWR);
|
|
503
|
+
var sessionAttributesCompare = _this.oQgb(session, _this.LTNO);
|
|
299
504
|
if (!userAttributesCompare) {
|
|
300
505
|
_this.userAttributesValidated = false;
|
|
301
506
|
}
|
|
@@ -304,7 +509,7 @@
|
|
|
304
509
|
}
|
|
305
510
|
return status && userAttributesCompare && sessionAttributesCompare;
|
|
306
511
|
});
|
|
307
|
-
_defineProperty(this, "
|
|
512
|
+
_defineProperty(this, "oQgb", function (attributes, expected) {
|
|
308
513
|
var length = expected.length;
|
|
309
514
|
var status = true;
|
|
310
515
|
try {
|
|
@@ -352,7 +557,7 @@
|
|
|
352
557
|
} else if (type === "b") {
|
|
353
558
|
loggedValue = !!loggedValue;
|
|
354
559
|
}
|
|
355
|
-
return
|
|
560
|
+
return FrGM(loggedValue, configValue, operator);
|
|
356
561
|
});
|
|
357
562
|
});
|
|
358
563
|
status = status && match;
|
|
@@ -363,83 +568,98 @@
|
|
|
363
568
|
if (_ret) return _ret.v;
|
|
364
569
|
}
|
|
365
570
|
} catch (error) {
|
|
366
|
-
Logger.error(error);
|
|
571
|
+
Logger$1.error(error);
|
|
367
572
|
status = false;
|
|
368
573
|
}
|
|
369
574
|
return status;
|
|
370
575
|
});
|
|
371
576
|
});
|
|
372
577
|
|
|
373
|
-
var
|
|
578
|
+
var QE_STATE = "qe_state";
|
|
579
|
+
var APX_RETAINED_SESSIONS = "apx_retained_session";
|
|
580
|
+
var APX_RETAINED_DAYS = "apx_retained_days";
|
|
581
|
+
var APX_CONTEXT_EVALUATED = "apx_context_evaluated";
|
|
582
|
+
var APX_VARIANT_CODE = "apx_variant_code";
|
|
583
|
+
|
|
584
|
+
var Logger$2 = window.ApxorLogger;
|
|
374
585
|
var Frequency = /*#__PURE__*/_createClass(function Frequency() {
|
|
375
586
|
var _this = this;
|
|
376
587
|
_classCallCheck(this, Frequency);
|
|
377
|
-
_defineProperty(this, "
|
|
378
|
-
_defineProperty(this, "
|
|
379
|
-
_defineProperty(this, "
|
|
380
|
-
_defineProperty(this, "
|
|
381
|
-
_defineProperty(this, "
|
|
382
|
-
_defineProperty(this, "
|
|
588
|
+
_defineProperty(this, "ansI", 0);
|
|
589
|
+
_defineProperty(this, "XsJV", 0);
|
|
590
|
+
_defineProperty(this, "FXvj", "SESSION");
|
|
591
|
+
_defineProperty(this, "DALS", 0);
|
|
592
|
+
_defineProperty(this, "hPUi", 0);
|
|
593
|
+
_defineProperty(this, "fckB", 0);
|
|
383
594
|
_defineProperty(this, "parse", function () {
|
|
384
595
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
385
596
|
try {
|
|
386
|
-
_this.
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
_this.
|
|
393
|
-
_this.
|
|
597
|
+
_this.xKIU = config._id;
|
|
598
|
+
_this.UzYn = config.meta;
|
|
599
|
+
_this.ansI = config.frequency.count;
|
|
600
|
+
if (_this.ansI === -1) {
|
|
601
|
+
_this.ansI = 1000;
|
|
602
|
+
}
|
|
603
|
+
_this.fckB = _this.ansI;
|
|
604
|
+
_this.XsJV = config.frequency.time_interval;
|
|
605
|
+
_this.FXvj = config.frequency.validity;
|
|
606
|
+
_this.hPUi = config.frequency.ses_lmt;
|
|
394
607
|
_this._dayCount = config.frequency.day_lmt;
|
|
395
608
|
// let data = Apxor.getController().getFromStorage(QE_STATE);
|
|
396
609
|
// let qe_state = JSON.parse(decode(Apxor.getSiteId(), data));
|
|
397
610
|
var qe_state = CE.getInstance().getQeState();
|
|
398
611
|
if (!isDefined(qe_state) || !isDefined(qe_state[config._id])) return true;
|
|
399
|
-
if (_this.
|
|
400
|
-
_this.
|
|
401
|
-
if (_this.
|
|
612
|
+
if (_this.FXvj === "SESSION") {
|
|
613
|
+
_this.ansI = parseInt(_this.ansI) - parseInt(qe_state[config._id]["SESSION"]);
|
|
614
|
+
if (_this.ansI <= 0) {
|
|
615
|
+
_this.QyOa("Session limit reached");
|
|
402
616
|
console.warn("Max count limit reached for session:" + config._id);
|
|
403
617
|
return false;
|
|
404
618
|
}
|
|
405
|
-
} else if (_this.
|
|
406
|
-
_this.
|
|
407
|
-
if (_this.
|
|
619
|
+
} else if (_this.FXvj === "OVERALL") {
|
|
620
|
+
_this.ansI = parseInt(_this.ansI) - parseInt(qe_state[config._id]["OVERALL"]);
|
|
621
|
+
if (_this.ansI <= 0) {
|
|
622
|
+
_this.QyOa("Overall limit reached");
|
|
408
623
|
console.warn("Max count limit reached for overall:" + config._id);
|
|
409
624
|
return false;
|
|
410
625
|
}
|
|
411
626
|
} else {
|
|
412
|
-
Logger$
|
|
627
|
+
Logger$2.info("Invalid config.");
|
|
413
628
|
return false;
|
|
414
629
|
}
|
|
415
630
|
} catch (error) {
|
|
416
|
-
Logger$
|
|
631
|
+
Logger$2.error(error);
|
|
417
632
|
return false;
|
|
418
633
|
}
|
|
419
634
|
return true;
|
|
420
635
|
});
|
|
421
|
-
_defineProperty(this, "
|
|
422
|
-
_this.
|
|
636
|
+
_defineProperty(this, "PrTa", function () {
|
|
637
|
+
_this.ansI = _this.ansI - 1;
|
|
423
638
|
});
|
|
424
639
|
_defineProperty(this, "getFrequencyCount", function () {
|
|
425
|
-
return _this.
|
|
640
|
+
return _this.ansI;
|
|
426
641
|
});
|
|
427
|
-
_defineProperty(this, "
|
|
428
|
-
if (_this.
|
|
429
|
-
_this.
|
|
430
|
-
Logger$
|
|
642
|
+
_defineProperty(this, "hYCk", function () {
|
|
643
|
+
if (_this.FXvj === "SESSION") {
|
|
644
|
+
_this.ansI = _this.fckB;
|
|
645
|
+
Logger$2.info("Campaign Limit reset");
|
|
431
646
|
}
|
|
432
647
|
});
|
|
433
648
|
/**
|
|
434
|
-
* @function
|
|
649
|
+
* @function fhhD
|
|
435
650
|
* @description Validates if the campaign count is with in the limits set in the config.
|
|
436
651
|
* @param {string} Config id
|
|
437
652
|
* @returns {boolean} true - If the Campaign limits are not reached
|
|
438
653
|
* false - Otherwise
|
|
439
654
|
*/
|
|
440
|
-
_defineProperty(this, "
|
|
655
|
+
_defineProperty(this, "fhhD", function (id) {
|
|
441
656
|
try {
|
|
442
|
-
if (_this.
|
|
657
|
+
if (_this.ansI <= 0) {
|
|
658
|
+
if (_this.FXvj === "OVERALL") {
|
|
659
|
+
_this.QyOa("Overall limit reached");
|
|
660
|
+
} else if (_this.FXvj === "SESSION") {
|
|
661
|
+
_this.QyOa("Session limit reached");
|
|
662
|
+
}
|
|
443
663
|
return false;
|
|
444
664
|
}
|
|
445
665
|
|
|
@@ -450,10 +670,11 @@
|
|
|
450
670
|
if (!isDefined(qe_state) || !isDefined(qe_state[id])) return true;
|
|
451
671
|
|
|
452
672
|
//If the config has a session count limit set
|
|
453
|
-
if (_this.
|
|
454
|
-
var sessionCountInConfig = parseInt(_this.
|
|
673
|
+
if (_this.hPUi !== 0) {
|
|
674
|
+
var sessionCountInConfig = parseInt(_this.hPUi);
|
|
455
675
|
var thisSessionCount = parseInt(qe_state[id]["SESSION"]);
|
|
456
676
|
if (sessionCountInConfig - thisSessionCount <= 0) {
|
|
677
|
+
_this.QyOa("Session limit reached");
|
|
457
678
|
return false;
|
|
458
679
|
}
|
|
459
680
|
}
|
|
@@ -465,27 +686,40 @@
|
|
|
465
686
|
var dayCountInConfig = parseInt(_this._dayCount);
|
|
466
687
|
var thisDayCount = parseInt(((_qe_state$id = qe_state[id]) === null || _qe_state$id === void 0 ? void 0 : _qe_state$id.DATES[date]) || 0);
|
|
467
688
|
if (dayCountInConfig - thisDayCount <= 0) {
|
|
689
|
+
_this.QyOa("Day limit reached");
|
|
468
690
|
return false;
|
|
469
691
|
}
|
|
470
692
|
}
|
|
471
693
|
} catch (e) {
|
|
472
|
-
|
|
694
|
+
_this.QyOa("Error validating the frequency: ".concat(e));
|
|
695
|
+
Logger$2.error("Error validating the frequency:" + e);
|
|
473
696
|
}
|
|
474
697
|
return true;
|
|
475
698
|
});
|
|
699
|
+
_defineProperty(this, "QyOa", function (reason) {
|
|
700
|
+
var _this$UzYn$attr;
|
|
701
|
+
Apxor === null || Apxor === void 0 || Apxor.logEvent("apx_non_eligible_user", {
|
|
702
|
+
apx_nudge_type: _this.UzYn.type === "SURVEY" ? "survey" : "campaign",
|
|
703
|
+
apx_nudge_id: _this.xKIU,
|
|
704
|
+
apx_nudge_name: _this.UzYn.name,
|
|
705
|
+
apx_variant_code: _this.UzYn.isExperiment || _this.UzYn.only_context ? (_this$UzYn$attr = _this.UzYn.attr) === null || _this$UzYn$attr === void 0 ? void 0 : _this$UzYn$attr[APX_VARIANT_CODE] : "TG",
|
|
706
|
+
apx_failure_type: "warn",
|
|
707
|
+
apx_reason: reason
|
|
708
|
+
});
|
|
709
|
+
});
|
|
476
710
|
});
|
|
477
711
|
|
|
478
712
|
var Meta = /*#__PURE__*/_createClass(function Meta() {
|
|
479
713
|
var _this = this;
|
|
480
714
|
_classCallCheck(this, Meta);
|
|
481
|
-
_defineProperty(this, "
|
|
482
|
-
_defineProperty(this, "
|
|
715
|
+
_defineProperty(this, "hqtt", "");
|
|
716
|
+
_defineProperty(this, "MLcB", "");
|
|
483
717
|
_defineProperty(this, "parse", function () {
|
|
484
718
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
485
719
|
try {
|
|
486
720
|
var _config$meta, _config$meta2;
|
|
487
|
-
_this.
|
|
488
|
-
_this.
|
|
721
|
+
_this.hqtt = config.meta.name;
|
|
722
|
+
_this.MLcB = config.meta.type;
|
|
489
723
|
_this._only_context = config.meta.only_context;
|
|
490
724
|
_this._attr = ((_config$meta = config.meta) === null || _config$meta === void 0 ? void 0 : _config$meta.attr) || {};
|
|
491
725
|
_this._isExperiment = (_config$meta2 = config.meta) === null || _config$meta2 === void 0 ? void 0 : _config$meta2.isExperiment;
|
|
@@ -497,53 +731,57 @@
|
|
|
497
731
|
});
|
|
498
732
|
});
|
|
499
733
|
|
|
500
|
-
var Logger$
|
|
734
|
+
var Logger$3 = window.ApxorLogger;
|
|
501
735
|
var Validity = /*#__PURE__*/_createClass(function Validity() {
|
|
502
736
|
var _this = this;
|
|
503
737
|
_classCallCheck(this, Validity);
|
|
504
|
-
_defineProperty(this, "
|
|
505
|
-
_defineProperty(this, "
|
|
506
|
-
_defineProperty(this, "
|
|
507
|
-
_defineProperty(this, "
|
|
508
|
-
_defineProperty(this, "
|
|
738
|
+
_defineProperty(this, "pOyH", -1);
|
|
739
|
+
_defineProperty(this, "PSJt", -1);
|
|
740
|
+
_defineProperty(this, "LHUD", -1);
|
|
741
|
+
_defineProperty(this, "SuFC", -1);
|
|
742
|
+
_defineProperty(this, "CtxV", false);
|
|
509
743
|
_defineProperty(this, "_nudge_expired", false);
|
|
510
744
|
_defineProperty(this, "_not_yet_active", false);
|
|
745
|
+
_defineProperty(this, "_not_in_specified_time", false);
|
|
511
746
|
_defineProperty(this, "parse", function () {
|
|
512
747
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
513
748
|
try {
|
|
514
749
|
if (isNaN(Date.parse(config.validity.start_date)) || isNaN(Date.parse(config.validity.end_date))) {
|
|
515
|
-
Logger$
|
|
750
|
+
Logger$3.error("Not valid dates");
|
|
516
751
|
return false;
|
|
517
752
|
}
|
|
518
|
-
_this.
|
|
519
|
-
_this.
|
|
520
|
-
if (isDefined(config.
|
|
521
|
-
_this.
|
|
522
|
-
if (_this.
|
|
753
|
+
_this.pOyH = Date.parse(config.validity.start_date);
|
|
754
|
+
_this.PSJt = Date.parse(config.validity.end_date);
|
|
755
|
+
if (isDefined(config.at_specific_time)) {
|
|
756
|
+
_this.CtxV = config.at_specific_time;
|
|
757
|
+
if (_this.CtxV && isDefined(config.time_limits)) {
|
|
523
758
|
var currentDate = new Date().toISOString().split("T")[0];
|
|
524
|
-
_this.
|
|
525
|
-
_this.
|
|
759
|
+
_this.LHUD = Date.parse(currentDate + "T" + config.time_limits.start_time + ":00.000Z");
|
|
760
|
+
_this.SuFC = Date.parse(currentDate + "T" + config.time_limits.end_time + ":00.000Z");
|
|
526
761
|
|
|
527
762
|
// If invalid format is passed, return false
|
|
528
|
-
if (isNaN(_this.
|
|
529
|
-
Logger$
|
|
763
|
+
if (isNaN(_this.LHUD) || isNaN(_this.SuFC)) {
|
|
764
|
+
Logger$3.error("Not valid times");
|
|
530
765
|
return false;
|
|
531
766
|
}
|
|
532
767
|
}
|
|
533
768
|
}
|
|
534
769
|
} catch (error) {
|
|
535
|
-
Logger$
|
|
770
|
+
Logger$3.error(error);
|
|
536
771
|
return false;
|
|
537
772
|
}
|
|
538
773
|
return true;
|
|
539
774
|
});
|
|
540
775
|
_defineProperty(this, "validate", function () {
|
|
541
776
|
var currentTime = Date.now();
|
|
542
|
-
if (currentTime > _this.
|
|
543
|
-
|
|
544
|
-
|
|
777
|
+
if (currentTime > _this.pOyH && currentTime < _this.PSJt) {
|
|
778
|
+
if (_this.CtxV && !(currentTime >= _this.LHUD && currentTime <= _this.SuFC)) {
|
|
779
|
+
_this._not_in_specified_time = true;
|
|
780
|
+
}
|
|
781
|
+
return !_this.CtxV || currentTime >= _this.LHUD && currentTime <= _this.SuFC;
|
|
782
|
+
} else if (currentTime < _this.pOyH) {
|
|
545
783
|
_this._not_yet_active = true;
|
|
546
|
-
} else if (currentTime > _this.
|
|
784
|
+
} else if (currentTime > _this.PSJt) {
|
|
547
785
|
_this._nudge_expired = true;
|
|
548
786
|
}
|
|
549
787
|
return false;
|
|
@@ -553,13 +791,13 @@
|
|
|
553
791
|
var Details = /*#__PURE__*/_createClass(function Details() {
|
|
554
792
|
var _this = this;
|
|
555
793
|
_classCallCheck(this, Details);
|
|
556
|
-
_defineProperty(this, "
|
|
557
|
-
_defineProperty(this, "
|
|
794
|
+
_defineProperty(this, "hqtt", "");
|
|
795
|
+
_defineProperty(this, "XKvc", {});
|
|
558
796
|
_defineProperty(this, "parse", function () {
|
|
559
797
|
var details = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
560
798
|
try {
|
|
561
|
-
_this.
|
|
562
|
-
_this.
|
|
799
|
+
_this.hqtt = details.name;
|
|
800
|
+
_this.XKvc = details.additional_info;
|
|
563
801
|
} catch (error) {
|
|
564
802
|
return false;
|
|
565
803
|
}
|
|
@@ -570,14 +808,14 @@
|
|
|
570
808
|
var Timebounds = /*#__PURE__*/_createClass(function Timebounds() {
|
|
571
809
|
var _this = this;
|
|
572
810
|
_classCallCheck(this, Timebounds);
|
|
573
|
-
_defineProperty(this, "
|
|
574
|
-
_defineProperty(this, "
|
|
811
|
+
_defineProperty(this, "xBDg", 0);
|
|
812
|
+
_defineProperty(this, "sjKZ", 0);
|
|
575
813
|
_defineProperty(this, "parse", function () {
|
|
576
814
|
var timeBounds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
577
815
|
try {
|
|
578
|
-
_this.
|
|
579
|
-
_this.
|
|
580
|
-
if (isNaN(_this.
|
|
816
|
+
_this.xBDg = Number(timeBounds.lower);
|
|
817
|
+
_this.sjKZ = Number(timeBounds.upper);
|
|
818
|
+
if (isNaN(_this.xBDg) || isNaN(_this.sjKZ)) {
|
|
581
819
|
return false;
|
|
582
820
|
}
|
|
583
821
|
} catch (error) {
|
|
@@ -590,102 +828,102 @@
|
|
|
590
828
|
var PreCondition = /*#__PURE__*/_createClass(function PreCondition() {
|
|
591
829
|
var _this = this;
|
|
592
830
|
_classCallCheck(this, PreCondition);
|
|
593
|
-
_defineProperty(this, "
|
|
594
|
-
_defineProperty(this, "
|
|
595
|
-
_defineProperty(this, "
|
|
596
|
-
_defineProperty(this, "
|
|
597
|
-
_defineProperty(this, "
|
|
831
|
+
_defineProperty(this, "BXjF", 0);
|
|
832
|
+
_defineProperty(this, "rNjl", "");
|
|
833
|
+
_defineProperty(this, "PWJL", "");
|
|
834
|
+
_defineProperty(this, "VfDz", new Details());
|
|
835
|
+
_defineProperty(this, "jJSu", new Timebounds());
|
|
598
836
|
_defineProperty(this, "parse", function () {
|
|
599
837
|
var precondition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
600
838
|
try {
|
|
601
|
-
_this.
|
|
602
|
-
_this.
|
|
603
|
-
return _this.
|
|
839
|
+
_this.rNjl = precondition.event_type;
|
|
840
|
+
_this.PWJL = precondition.activity;
|
|
841
|
+
return _this.VfDz.parse(precondition.details) && _this.jJSu.parse(precondition.time_bounds);
|
|
604
842
|
} catch (error) {
|
|
605
843
|
return false;
|
|
606
844
|
}
|
|
607
845
|
});
|
|
608
846
|
});
|
|
609
847
|
|
|
610
|
-
var Logger$
|
|
848
|
+
var Logger$4 = window.ApxorLogger;
|
|
611
849
|
var Condition = /*#__PURE__*/_createClass(function Condition() {
|
|
612
850
|
var _this = this;
|
|
613
851
|
_classCallCheck(this, Condition);
|
|
614
|
-
_defineProperty(this, "
|
|
615
|
-
_defineProperty(this, "
|
|
616
|
-
_defineProperty(this, "
|
|
617
|
-
_defineProperty(this, "
|
|
618
|
-
_defineProperty(this, "
|
|
619
|
-
_defineProperty(this, "
|
|
620
|
-
_defineProperty(this, "
|
|
621
|
-
_defineProperty(this, "
|
|
622
|
-
_defineProperty(this, "
|
|
623
|
-
_defineProperty(this, "
|
|
624
|
-
_defineProperty(this, "
|
|
625
|
-
_defineProperty(this, "
|
|
852
|
+
_defineProperty(this, "BXjF", 0);
|
|
853
|
+
_defineProperty(this, "eXhV", -1);
|
|
854
|
+
_defineProperty(this, "ansI", 0);
|
|
855
|
+
_defineProperty(this, "cLqc", "");
|
|
856
|
+
_defineProperty(this, "PWJL", "");
|
|
857
|
+
_defineProperty(this, "rNjl", "");
|
|
858
|
+
_defineProperty(this, "jJSu", new Timebounds());
|
|
859
|
+
_defineProperty(this, "VfDz", new Details());
|
|
860
|
+
_defineProperty(this, "wYau", new PreCondition());
|
|
861
|
+
_defineProperty(this, "NcmX", "AND");
|
|
862
|
+
_defineProperty(this, "GWHp", false);
|
|
863
|
+
_defineProperty(this, "MLcB", void 0);
|
|
626
864
|
_defineProperty(this, "parse", function () {
|
|
627
865
|
var condition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
628
866
|
try {
|
|
629
|
-
_this.
|
|
630
|
-
_this.
|
|
631
|
-
_this.
|
|
632
|
-
_this.
|
|
633
|
-
_this.
|
|
634
|
-
_this.
|
|
635
|
-
_this.
|
|
636
|
-
return _this.
|
|
867
|
+
_this.eXhV = condition.sequence;
|
|
868
|
+
_this.ansI = condition.count_config.count;
|
|
869
|
+
_this.cLqc = condition.count_config.operator;
|
|
870
|
+
_this.PWJL = condition.activity;
|
|
871
|
+
_this.rNjl = condition.event_type;
|
|
872
|
+
_this.NcmX = condition.combine_operator;
|
|
873
|
+
_this.MLcB = condition.type;
|
|
874
|
+
return _this.VfDz.parse(condition.details) && _this.wYau.parse(condition.trigger) && _this.jJSu.parse(condition.time_bounds);
|
|
637
875
|
} catch (error) {
|
|
638
|
-
Logger$
|
|
876
|
+
Logger$4.error(error);
|
|
639
877
|
return false;
|
|
640
878
|
}
|
|
641
879
|
});
|
|
642
880
|
});
|
|
643
881
|
|
|
644
|
-
var Logger$
|
|
882
|
+
var Logger$5 = window.ApxorLogger;
|
|
645
883
|
var GoalEvent = /*#__PURE__*/_createClass(function GoalEvent() {
|
|
646
884
|
var _this = this;
|
|
647
885
|
_classCallCheck(this, GoalEvent);
|
|
648
|
-
_defineProperty(this, "
|
|
649
|
-
_defineProperty(this, "
|
|
650
|
-
_defineProperty(this, "
|
|
651
|
-
_defineProperty(this, "
|
|
652
|
-
_defineProperty(this, "
|
|
653
|
-
_defineProperty(this, "
|
|
886
|
+
_defineProperty(this, "ansI", 0);
|
|
887
|
+
_defineProperty(this, "cLqc", "");
|
|
888
|
+
_defineProperty(this, "rNjl", "");
|
|
889
|
+
_defineProperty(this, "jJSu", new Timebounds());
|
|
890
|
+
_defineProperty(this, "VfDz", new Details());
|
|
891
|
+
_defineProperty(this, "NcmX", "AND");
|
|
654
892
|
_defineProperty(this, "parse", function (data) {
|
|
655
893
|
try {
|
|
656
|
-
_this.
|
|
657
|
-
_this.
|
|
658
|
-
_this.
|
|
659
|
-
_this.
|
|
660
|
-
return _this.
|
|
894
|
+
_this.ansI = data.count_config.count;
|
|
895
|
+
_this.cLqc = data.count_config.operator;
|
|
896
|
+
_this.rNjl = data.event_type;
|
|
897
|
+
_this.NcmX = data.combine_operator;
|
|
898
|
+
return _this.VfDz.parse(data.details) && _this.jJSu.parse(data.time_bounds);
|
|
661
899
|
} catch (error) {
|
|
662
|
-
Logger$
|
|
900
|
+
Logger$5.error(error);
|
|
663
901
|
return false;
|
|
664
902
|
}
|
|
665
903
|
});
|
|
666
904
|
});
|
|
667
905
|
|
|
668
906
|
/* eslint-disable no-unused-vars */
|
|
669
|
-
var Logger$
|
|
907
|
+
var Logger$6 = window.ApxorLogger;
|
|
670
908
|
var ConditionValidator = /*#__PURE__*/function () {
|
|
671
909
|
function ConditionValidator() {
|
|
672
910
|
var _this = this;
|
|
673
911
|
_classCallCheck(this, ConditionValidator);
|
|
674
|
-
_defineProperty(this, "
|
|
675
|
-
_defineProperty(this, "
|
|
676
|
-
_defineProperty(this, "
|
|
677
|
-
_defineProperty(this, "
|
|
678
|
-
_defineProperty(this, "
|
|
679
|
-
_defineProperty(this, "
|
|
680
|
-
_defineProperty(this, "
|
|
681
|
-
_defineProperty(this, "
|
|
682
|
-
_defineProperty(this, "
|
|
683
|
-
_defineProperty(this, "
|
|
684
|
-
_defineProperty(this, "
|
|
685
|
-
_defineProperty(this, "
|
|
686
|
-
_defineProperty(this, "
|
|
912
|
+
_defineProperty(this, "EdOZ", 0);
|
|
913
|
+
_defineProperty(this, "xKIU", "");
|
|
914
|
+
_defineProperty(this, "HPBH", new Condition());
|
|
915
|
+
_defineProperty(this, "FcCI", new GoalEvent());
|
|
916
|
+
_defineProperty(this, "BkRH", false);
|
|
917
|
+
_defineProperty(this, "lAQm", false);
|
|
918
|
+
_defineProperty(this, "vJCV", 0);
|
|
919
|
+
_defineProperty(this, "NcmX", "AND");
|
|
920
|
+
_defineProperty(this, "cTHv", "OR");
|
|
921
|
+
_defineProperty(this, "SIsf", -1);
|
|
922
|
+
_defineProperty(this, "WNGW", []);
|
|
923
|
+
_defineProperty(this, "MHiS", {});
|
|
924
|
+
_defineProperty(this, "CwKf", false);
|
|
687
925
|
/**
|
|
688
|
-
* If respectSequence is true, don't auto-
|
|
926
|
+
* If respectSequence is true, don't auto-GRBk to events except for the condition whose index is 0
|
|
689
927
|
*
|
|
690
928
|
* @param condition
|
|
691
929
|
* @param type
|
|
@@ -701,191 +939,191 @@
|
|
|
701
939
|
var respectSequence = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
702
940
|
var noKpiArray = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
|
|
703
941
|
var flag = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : "";
|
|
704
|
-
_this.
|
|
705
|
-
_this.
|
|
706
|
-
_this.
|
|
942
|
+
_this.xKIU = id;
|
|
943
|
+
_this.vJCV = index;
|
|
944
|
+
_this.WNGW = noKpiArray;
|
|
707
945
|
if (flag !== "termination" || flag === "") {
|
|
708
|
-
var result = _this.
|
|
946
|
+
var result = _this.HPBH.parse(condition);
|
|
709
947
|
if (result) {
|
|
710
|
-
_this.
|
|
948
|
+
_this.NcmX = _this.HPBH.NcmX;
|
|
711
949
|
|
|
712
950
|
// FIXME: Why this code is written? Don't see any usecase
|
|
713
|
-
if (_this.
|
|
714
|
-
var eventName = _this.
|
|
951
|
+
if (_this.HPBH.GWHp) {
|
|
952
|
+
var eventName = _this.HPBH.VfDz.hqtt;
|
|
715
953
|
if (eventName === "APX_PAGE_OPENED") {
|
|
716
|
-
eventName = _this.
|
|
717
|
-
eventName = isDefined(eventName) ? eventName : _this.
|
|
954
|
+
eventName = _this.HPBH.VfDz.XKvc["navigation_id"];
|
|
955
|
+
eventName = isDefined(eventName) ? eventName : _this.HPBH.VfDz.hqtt;
|
|
718
956
|
}
|
|
719
|
-
_this.
|
|
720
|
-
var count = _this.
|
|
721
|
-
var operator = _this.
|
|
722
|
-
_this.
|
|
723
|
-
_this.
|
|
724
|
-
// If the condition is already satisfied and if it is page view, no need to
|
|
957
|
+
_this.SIsf = Apxor.getController().getEventCount(eventName);
|
|
958
|
+
var count = _this.HPBH.ansI;
|
|
959
|
+
var operator = _this.HPBH.cLqc;
|
|
960
|
+
_this.lAQm = _this.cCpn(_this.SIsf - 1, count, operator, false);
|
|
961
|
+
_this.BkRH = _this.lAQm;
|
|
962
|
+
// If the condition is already satisfied and if it is page view, no need to GRBk
|
|
725
963
|
// This only applies for NAVIGATION_EVENTS
|
|
726
|
-
if (_this.
|
|
964
|
+
if (_this.lAQm && _this.HPBH.VfDz.hqtt === "APX_PAGE_OPENED") {
|
|
727
965
|
return true;
|
|
728
966
|
}
|
|
729
967
|
}
|
|
730
968
|
if (!respectSequence || index === 0) {
|
|
731
|
-
_this.
|
|
969
|
+
_this.GRBk();
|
|
732
970
|
}
|
|
733
971
|
return true;
|
|
734
972
|
}
|
|
735
973
|
} else {
|
|
736
|
-
var _result = _this.
|
|
737
|
-
_this.
|
|
738
|
-
_this.
|
|
974
|
+
var _result = _this.FcCI.parse(condition);
|
|
975
|
+
_this.cTHv = _this.FcCI.NcmX;
|
|
976
|
+
_this.jVsY();
|
|
739
977
|
return true;
|
|
740
978
|
}
|
|
741
979
|
return false;
|
|
742
980
|
});
|
|
743
|
-
_defineProperty(this, "
|
|
981
|
+
_defineProperty(this, "GRBk", function () {
|
|
744
982
|
var _window$ApxorRTM;
|
|
745
|
-
var condition = _this.
|
|
746
|
-
var precondition = condition.
|
|
983
|
+
var condition = _this.HPBH;
|
|
984
|
+
var precondition = condition.wYau;
|
|
747
985
|
var ceInstance = CE.getInstance();
|
|
748
|
-
if (precondition.
|
|
749
|
-
_this.
|
|
750
|
-
ceInstance.registerForEvent(generateKey(condition.
|
|
986
|
+
if (precondition.rNjl === "app_start") {
|
|
987
|
+
_this.BkRH = true;
|
|
988
|
+
ceInstance.registerForEvent(generateKey(condition.rNjl) + "___" + condition.VfDz.hqtt, _this.rXqr);
|
|
751
989
|
} else {
|
|
752
|
-
ceInstance.registerForEvent(generateKey(condition.
|
|
990
|
+
ceInstance.registerForEvent(generateKey(condition.rNjl) + "___" + precondition.VfDz.hqtt, _this.rXqr);
|
|
753
991
|
}
|
|
754
|
-
if ((_window$ApxorRTM = window.ApxorRTM) !== null && _window$ApxorRTM !== void 0 && _window$ApxorRTM.badgesLists.includes(_this.
|
|
755
|
-
ceInstance.registerForEvent(generateKey(condition.
|
|
992
|
+
if ((_window$ApxorRTM = window.ApxorRTM) !== null && _window$ApxorRTM !== void 0 && _window$ApxorRTM.badgesLists.includes(_this.xKIU)) {
|
|
993
|
+
ceInstance.registerForEvent(generateKey(condition.rNjl) + "___" + "apxor-badge-container-".concat("-".concat(_this.xKIU).replaceAll(" ", "").replace(/[^\w\s]/gi, "")), _this.rXqr);
|
|
756
994
|
}
|
|
757
995
|
});
|
|
758
|
-
_defineProperty(this, "
|
|
759
|
-
var condition = _this.
|
|
996
|
+
_defineProperty(this, "jVsY", function () {
|
|
997
|
+
var condition = _this.FcCI;
|
|
760
998
|
var ceInstance = CE.getInstance();
|
|
761
|
-
_this.
|
|
762
|
-
ceInstance.registerForEvent(generateKey(condition.
|
|
999
|
+
_this.BkRH = true;
|
|
1000
|
+
ceInstance.registerForEvent(generateKey(condition.rNjl) + "___" + condition.VfDz.hqtt, _this.nCho);
|
|
763
1001
|
});
|
|
764
|
-
_defineProperty(this, "
|
|
765
|
-
var _this$
|
|
1002
|
+
_defineProperty(this, "sDtI", function (type, name, time, additionalInfo) {
|
|
1003
|
+
var _this$HPBH;
|
|
766
1004
|
var eventTime = Date.now();
|
|
767
|
-
var time_differnce = (eventTime - _this.
|
|
768
|
-
var time_fromConfig = ((_this$
|
|
1005
|
+
var time_differnce = (eventTime - _this.MHiS[name]) / 1000;
|
|
1006
|
+
var time_fromConfig = ((_this$HPBH = _this.HPBH) === null || _this$HPBH === void 0 || (_this$HPBH = _this$HPBH.VfDz) === null || _this$HPBH === void 0 || (_this$HPBH = _this$HPBH.XKvc) === null || _this$HPBH === void 0 ? void 0 : _this$HPBH.time) / 1000;
|
|
769
1007
|
if (time_fromConfig > time_differnce) {
|
|
770
1008
|
_this._displayCampaign(time);
|
|
771
1009
|
}
|
|
772
1010
|
});
|
|
773
|
-
_defineProperty(this, "
|
|
1011
|
+
_defineProperty(this, "hyIv", function (type, name, time, additionalInfo) {
|
|
774
1012
|
var _this$_condition2, _this$_condition3;
|
|
775
|
-
_this.
|
|
1013
|
+
_this.CwKf = true;
|
|
776
1014
|
var currentTime = Date.now();
|
|
777
|
-
var eventName = (_this$_condition2 = _this.
|
|
778
|
-
var eventTime = _this.
|
|
1015
|
+
var eventName = (_this$_condition2 = _this.HPBH) === null || _this$_condition2 === void 0 || (_this$_condition2 = _this$_condition2.wYau) === null || _this$_condition2 === void 0 ? void 0 : _this$_condition2.VfDz.hqtt;
|
|
1016
|
+
var eventTime = _this.MHiS[eventName];
|
|
779
1017
|
var time_differnce = (currentTime - eventTime) / 1000;
|
|
780
|
-
var time_fromConfig = (_this$_condition3 = _this.
|
|
1018
|
+
var time_fromConfig = (_this$_condition3 = _this.HPBH) === null || _this$_condition3 === void 0 || (_this$_condition3 = _this$_condition3.VfDz) === null || _this$_condition3 === void 0 || (_this$_condition3 = _this$_condition3.XKvc) === null || _this$_condition3 === void 0 ? void 0 : _this$_condition3.time;
|
|
781
1019
|
time_fromConfig = time_fromConfig / 1000;
|
|
782
1020
|
if (time_fromConfig > time_differnce) {
|
|
783
1021
|
_this._displayCampaign(time);
|
|
784
1022
|
}
|
|
785
1023
|
//unregister the event
|
|
786
1024
|
});
|
|
787
|
-
_defineProperty(this, "
|
|
1025
|
+
_defineProperty(this, "rXqr", function (type, name, time, additionalInfo) {
|
|
788
1026
|
var _window$ApxorRTM2, _window$ApxorRTM3;
|
|
789
1027
|
var ceInstance = CE.getInstance();
|
|
790
|
-
if (!_this.
|
|
1028
|
+
if (!_this.BkRH) {
|
|
791
1029
|
// Validate Precondition
|
|
792
|
-
_this.
|
|
793
|
-
if (_this.
|
|
794
|
-
var condition = _this.
|
|
795
|
-
var precondition = condition.
|
|
796
|
-
precondition.
|
|
1030
|
+
_this.BkRH = _this.pNGQ(type, name, time, additionalInfo);
|
|
1031
|
+
if (_this.BkRH) {
|
|
1032
|
+
var condition = _this.HPBH;
|
|
1033
|
+
var precondition = condition.wYau;
|
|
1034
|
+
precondition.BXjF = time;
|
|
797
1035
|
//events will be registred by its type activity event_type: "activity_time"
|
|
798
|
-
if ((condition === null || condition === void 0 ? void 0 : condition.
|
|
799
|
-
var
|
|
800
|
-
var event_time = condition === null || condition === void 0 || (
|
|
801
|
-
if ((condition === null || condition === void 0 || (
|
|
1036
|
+
if ((condition === null || condition === void 0 ? void 0 : condition.rNjl) === "activity_time") {
|
|
1037
|
+
var HPBH$VfDz, HPBH$_details2, HPBH$_details3;
|
|
1038
|
+
var event_time = condition === null || condition === void 0 || (HPBH$VfDz = condition.VfDz) === null || HPBH$VfDz === void 0 || (HPBH$VfDz = HPBH$VfDz.XKvc) === null || HPBH$VfDz === void 0 ? void 0 : HPBH$VfDz.time;
|
|
1039
|
+
if ((condition === null || condition === void 0 || (HPBH$_details2 = condition.VfDz) === null || HPBH$_details2 === void 0 || (HPBH$_details2 = HPBH$_details2.XKvc) === null || HPBH$_details2 === void 0 ? void 0 : HPBH$_details2.nkpi.length) > 0) {
|
|
802
1040
|
setTimeout(function () {
|
|
803
|
-
if (!_this.
|
|
804
|
-
_this.
|
|
805
|
-
if (_this.
|
|
806
|
-
_this.
|
|
807
|
-
_this.
|
|
808
|
-
if (_this.
|
|
809
|
-
_this.
|
|
810
|
-
ceInstance.validate(_this.
|
|
1041
|
+
if (!_this.CwKf) {
|
|
1042
|
+
_this.lAQm = true;
|
|
1043
|
+
if (_this.lAQm) {
|
|
1044
|
+
_this.EdOZ += 1;
|
|
1045
|
+
_this.lAQm = _this.cCpn(_this.EdOZ, _this.HPBH.ansI, _this.HPBH.cLqc);
|
|
1046
|
+
if (_this.lAQm) {
|
|
1047
|
+
_this.HPBH.BXjF = time;
|
|
1048
|
+
ceInstance.validate(_this.xKIU, _this.vJCV);
|
|
811
1049
|
}
|
|
812
1050
|
}
|
|
813
1051
|
}
|
|
814
|
-
condition.
|
|
815
|
-
ceInstance.unregisterFromEvent(toUpperCase(condition.
|
|
1052
|
+
condition.VfDz.XKvc.nkpi.map(function (nokpi) {
|
|
1053
|
+
ceInstance.unregisterFromEvent(toUpperCase(condition.VfDz.XKvc.et) + "___" + nokpi, _this);
|
|
816
1054
|
});
|
|
817
1055
|
}, event_time);
|
|
818
|
-
condition.
|
|
819
|
-
ceInstance.registerForEvent(toUpperCase(condition.
|
|
1056
|
+
condition.VfDz.XKvc.nkpi.map(function (nokpi) {
|
|
1057
|
+
ceInstance.registerForEvent(toUpperCase(condition.VfDz.XKvc.et) + "___" + nokpi, _this.hyIv);
|
|
820
1058
|
});
|
|
821
1059
|
}
|
|
822
1060
|
//it is for unregistering the events did case after completing the time imit
|
|
823
|
-
if ((condition === null || condition === void 0 || (
|
|
1061
|
+
if ((condition === null || condition === void 0 || (HPBH$_details3 = condition.VfDz) === null || HPBH$_details3 === void 0 || (HPBH$_details3 = HPBH$_details3.XKvc) === null || HPBH$_details3 === void 0 ? void 0 : HPBH$_details3.kpi.length) > 0) {
|
|
824
1062
|
setTimeout(function () {
|
|
825
|
-
condition.
|
|
826
|
-
ceInstance.unregisterFromEvent(toUpperCase(condition.
|
|
1063
|
+
condition.VfDz.XKvc.kpi.map(function (kpi) {
|
|
1064
|
+
ceInstance.unregisterFromEvent(toUpperCase(condition.VfDz.XKvc.et) + "___" + kpi, _this);
|
|
827
1065
|
});
|
|
828
1066
|
}, event_time);
|
|
829
|
-
condition.
|
|
830
|
-
if (kpi === condition.
|
|
1067
|
+
condition.VfDz.XKvc.kpi.map(function (kpi) {
|
|
1068
|
+
if (kpi === condition.wYau.VfDz.hqtt) {
|
|
831
1069
|
//unregister the previous event
|
|
832
|
-
ceInstance.unregisterFromEvent(generateKey(precondition.
|
|
833
|
-
ceInstance.registerForEvent(toUpperCase(condition.
|
|
1070
|
+
ceInstance.unregisterFromEvent(generateKey(precondition.rNjl) + "___" + precondition.VfDz.hqtt, _this);
|
|
1071
|
+
ceInstance.registerForEvent(toUpperCase(condition.VfDz.XKvc.et) + "___" + kpi, _this.sDtI);
|
|
834
1072
|
} else {
|
|
835
|
-
ceInstance.registerForEvent(toUpperCase(condition.
|
|
1073
|
+
ceInstance.registerForEvent(toUpperCase(condition.VfDz.XKvc.et) + "___" + kpi, _this.hyIv);
|
|
836
1074
|
}
|
|
837
1075
|
});
|
|
838
1076
|
}
|
|
839
1077
|
} else {
|
|
840
|
-
ceInstance.unregisterFromEvent(generateKey(precondition.
|
|
841
|
-
ceInstance.registerForEvent(generateKey(condition.
|
|
1078
|
+
ceInstance.unregisterFromEvent(generateKey(precondition.rNjl) + "___" + precondition.VfDz.hqtt, _this);
|
|
1079
|
+
ceInstance.registerForEvent(generateKey(condition.rNjl) + "___" + condition.VfDz.hqtt, _this);
|
|
842
1080
|
}
|
|
843
|
-
_this.
|
|
1081
|
+
_this.MHiS[name] = Date.now();
|
|
844
1082
|
}
|
|
845
1083
|
return;
|
|
846
1084
|
}
|
|
847
|
-
if ((_window$ApxorRTM2 = window.ApxorRTM) !== null && _window$ApxorRTM2 !== void 0 && _window$ApxorRTM2.isBadgePresent && (_window$ApxorRTM3 = window.ApxorRTM) !== null && _window$ApxorRTM3 !== void 0 && _window$ApxorRTM3.badgesLists.includes(_this.
|
|
848
|
-
_this.
|
|
849
|
-
_this.
|
|
850
|
-
ceInstance.validate(_this.
|
|
1085
|
+
if ((_window$ApxorRTM2 = window.ApxorRTM) !== null && _window$ApxorRTM2 !== void 0 && _window$ApxorRTM2.isBadgePresent && (_window$ApxorRTM3 = window.ApxorRTM) !== null && _window$ApxorRTM3 !== void 0 && _window$ApxorRTM3.badgesLists.includes(_this.xKIU) && Apxor.getController().isBadgeTriggerSatisfied(_this.xKIU)) {
|
|
1086
|
+
_this.lAQm = true;
|
|
1087
|
+
_this.HPBH.BXjF = time;
|
|
1088
|
+
ceInstance.validate(_this.xKIU, _this.vJCV);
|
|
851
1089
|
return;
|
|
852
1090
|
}
|
|
853
1091
|
|
|
854
1092
|
// Validate Condition
|
|
855
|
-
var validationStatus = generateKey(_this.
|
|
1093
|
+
var validationStatus = generateKey(_this.HPBH.rNjl) === type && _this.mBlI(time - _this.HPBH.wYau.BXjF, _this.HPBH.jJSu) && _this.HPBH.VfDz.hqtt === name && _this.dpga(_this.HPBH.VfDz.XKvc, additionalInfo);
|
|
856
1094
|
if (validationStatus) {
|
|
857
|
-
_this.
|
|
858
|
-
_this.
|
|
859
|
-
if (_this.
|
|
860
|
-
_this.
|
|
861
|
-
ceInstance.validate(_this.
|
|
1095
|
+
_this.EdOZ += 1;
|
|
1096
|
+
_this.lAQm = _this.cCpn(_this.EdOZ, _this.HPBH.ansI, _this.HPBH.cLqc);
|
|
1097
|
+
if (_this.lAQm) {
|
|
1098
|
+
_this.HPBH.BXjF = time;
|
|
1099
|
+
ceInstance.validate(_this.xKIU, _this.vJCV);
|
|
862
1100
|
}
|
|
863
1101
|
}
|
|
864
1102
|
});
|
|
865
|
-
_defineProperty(this, "
|
|
1103
|
+
_defineProperty(this, "nCho", function (type, name, time, additionalInfo) {
|
|
866
1104
|
var ceInstance = CE.getInstance();
|
|
867
|
-
var validationStatus = generateKey(_this.
|
|
1105
|
+
var validationStatus = generateKey(_this.FcCI.rNjl) === type && _this.mBlI(time, _this.FcCI.jJSu) && _this.FcCI.VfDz.hqtt === name && _this.dpga(_this.FcCI.VfDz.XKvc, additionalInfo);
|
|
868
1106
|
if (validationStatus) {
|
|
869
|
-
_this.
|
|
870
|
-
_this.
|
|
871
|
-
if (_this.
|
|
872
|
-
_this.
|
|
873
|
-
ceInstance.validateForTermination(_this.
|
|
1107
|
+
_this.EdOZ += 1;
|
|
1108
|
+
_this.lAQm = _this.cCpn(_this.EdOZ, _this.FcCI.ansI, _this.FcCI.cLqc);
|
|
1109
|
+
if (_this.lAQm) {
|
|
1110
|
+
_this.FcCI.BXjF = time;
|
|
1111
|
+
ceInstance.validateForTermination(_this.xKIU, _this.vJCV);
|
|
874
1112
|
}
|
|
875
1113
|
}
|
|
876
1114
|
});
|
|
877
|
-
_defineProperty(this, "
|
|
878
|
-
var precondition = _this.
|
|
879
|
-
return generateKey(precondition.
|
|
1115
|
+
_defineProperty(this, "pNGQ", function (type, name, time, additionalInfo) {
|
|
1116
|
+
var precondition = _this.HPBH.wYau;
|
|
1117
|
+
return generateKey(precondition.rNjl) === type && precondition.VfDz.hqtt === name && _this.mBlI(time, precondition.jJSu) && _this.dpga(precondition.VfDz.XKvc, additionalInfo);
|
|
880
1118
|
});
|
|
881
|
-
_defineProperty(this, "
|
|
1119
|
+
_defineProperty(this, "mBlI", function (time, timeBounds) {
|
|
882
1120
|
var currentTime = Math.ceil(time);
|
|
883
|
-
return currentTime > timeBounds.
|
|
1121
|
+
return currentTime > timeBounds.xBDg && currentTime < timeBounds.sjKZ;
|
|
884
1122
|
});
|
|
885
|
-
_defineProperty(this, "
|
|
1123
|
+
_defineProperty(this, "cCpn", function (current, required, operator) {
|
|
886
1124
|
var checkOld = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
887
|
-
if (checkOld && _this.
|
|
888
|
-
current = current + _this.
|
|
1125
|
+
if (checkOld && _this.HPBH.GWHp) {
|
|
1126
|
+
current = current + _this.SIsf;
|
|
889
1127
|
}
|
|
890
1128
|
switch (operator) {
|
|
891
1129
|
case "EQ":
|
|
@@ -902,7 +1140,7 @@
|
|
|
902
1140
|
return false;
|
|
903
1141
|
}
|
|
904
1142
|
});
|
|
905
|
-
_defineProperty(this, "
|
|
1143
|
+
_defineProperty(this, "dpga", function (expected, received) {
|
|
906
1144
|
var status = true;
|
|
907
1145
|
try {
|
|
908
1146
|
var _loop = function _loop() {
|
|
@@ -947,14 +1185,14 @@
|
|
|
947
1185
|
} else if (type === "b") {
|
|
948
1186
|
loggedValue = !!loggedValue;
|
|
949
1187
|
}
|
|
950
|
-
return
|
|
1188
|
+
return FrGM(loggedValue, expectedValue, operator);
|
|
951
1189
|
}
|
|
952
|
-
//
|
|
1190
|
+
// FrGM(loggedValue, expectedValue, operator)
|
|
953
1191
|
);
|
|
954
1192
|
|
|
955
1193
|
status = status && match;
|
|
956
1194
|
} else {
|
|
957
|
-
status = status &&
|
|
1195
|
+
status = status && FrGM(received[item], expected[item], "EQ");
|
|
958
1196
|
}
|
|
959
1197
|
},
|
|
960
1198
|
_ret;
|
|
@@ -963,7 +1201,7 @@
|
|
|
963
1201
|
if (_ret) return _ret.v;
|
|
964
1202
|
}
|
|
965
1203
|
} catch (error) {
|
|
966
|
-
Logger$
|
|
1204
|
+
Logger$6.error(error);
|
|
967
1205
|
status = false;
|
|
968
1206
|
}
|
|
969
1207
|
return status;
|
|
@@ -973,13 +1211,13 @@
|
|
|
973
1211
|
key: "_displayCampaign",
|
|
974
1212
|
value: function _displayCampaign(time) {
|
|
975
1213
|
var ceInstance = CE.getInstance();
|
|
976
|
-
this.
|
|
977
|
-
if (this.
|
|
978
|
-
this.
|
|
979
|
-
this.
|
|
980
|
-
if (this.
|
|
981
|
-
this.
|
|
982
|
-
ceInstance.validate(this.
|
|
1214
|
+
this.lAQm = true;
|
|
1215
|
+
if (this.lAQm) {
|
|
1216
|
+
this.EdOZ += 1;
|
|
1217
|
+
this.lAQm = this.cCpn(this.EdOZ, this.HPBH.ansI, this.HPBH.cLqc);
|
|
1218
|
+
if (this.lAQm) {
|
|
1219
|
+
this.HPBH.BXjF = time;
|
|
1220
|
+
ceInstance.validate(this.xKIU, this.vJCV);
|
|
983
1221
|
}
|
|
984
1222
|
}
|
|
985
1223
|
}
|
|
@@ -987,21 +1225,15 @@
|
|
|
987
1225
|
return ConditionValidator;
|
|
988
1226
|
}();
|
|
989
1227
|
|
|
990
|
-
var
|
|
991
|
-
var APX_RETAINED_SESSIONS = "apx_retained_session";
|
|
992
|
-
var APX_RETAINED_DAYS = "apx_retained_days";
|
|
993
|
-
var APX_CONTEXT_EVALUATED = "apx_context_evaluated";
|
|
994
|
-
var APX_VARIANT_CODE = "apx_variant_code";
|
|
995
|
-
|
|
996
|
-
var Logger$6 = window.ApxorLogger;
|
|
1228
|
+
var Logger$7 = window.ApxorLogger;
|
|
997
1229
|
var OverallConfig = /*#__PURE__*/_createClass(function OverallConfig() {
|
|
998
1230
|
var _this = this;
|
|
999
1231
|
_classCallCheck(this, OverallConfig);
|
|
1000
|
-
_defineProperty(this, "
|
|
1232
|
+
_defineProperty(this, "SxPK", []);
|
|
1001
1233
|
_defineProperty(this, "_ret_day", {});
|
|
1002
|
-
_defineProperty(this, "
|
|
1003
|
-
_defineProperty(this, "
|
|
1004
|
-
_defineProperty(this, "
|
|
1234
|
+
_defineProperty(this, "rPFc", {});
|
|
1235
|
+
_defineProperty(this, "nhio", false);
|
|
1236
|
+
_defineProperty(this, "ANMQ", false);
|
|
1005
1237
|
_defineProperty(this, "retainedDaysValidated", true);
|
|
1006
1238
|
_defineProperty(this, "retainedSessionValidated", true);
|
|
1007
1239
|
_defineProperty(this, "eventDoneInLT", false);
|
|
@@ -1009,13 +1241,13 @@
|
|
|
1009
1241
|
_defineProperty(this, "parse", function () {
|
|
1010
1242
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1011
1243
|
try {
|
|
1012
|
-
_this.
|
|
1244
|
+
_this.SxPK = config.overall_cfg.events;
|
|
1013
1245
|
_this._ret_day = config.overall_cfg.ret_day;
|
|
1014
|
-
_this.
|
|
1015
|
-
_this.
|
|
1016
|
-
_this.
|
|
1246
|
+
_this.rPFc = config.overall_cfg.session;
|
|
1247
|
+
_this.nhio = config.overall_cfg.toggleRetDay;
|
|
1248
|
+
_this.ANMQ = config.overall_cfg.toggleSession;
|
|
1017
1249
|
} catch (error) {
|
|
1018
|
-
Logger$
|
|
1250
|
+
Logger$7.error(error);
|
|
1019
1251
|
return false;
|
|
1020
1252
|
}
|
|
1021
1253
|
return true;
|
|
@@ -1023,11 +1255,11 @@
|
|
|
1023
1255
|
_defineProperty(this, "validate", function () {
|
|
1024
1256
|
var retainedDays = parseInt(Apxor.getController().getFromStorage(APX_RETAINED_DAYS));
|
|
1025
1257
|
var retainedSession = parseInt(Apxor.getController().getFromStorage(APX_RETAINED_SESSIONS));
|
|
1026
|
-
if (_this.
|
|
1258
|
+
if (_this.nhio && !isNaN(retainedDays) && !(retainedDays >= _this._ret_day.from && retainedDays <= _this._ret_day.to)) {
|
|
1027
1259
|
_this.retainedDaysValidated = false;
|
|
1028
1260
|
return false;
|
|
1029
1261
|
}
|
|
1030
|
-
if (_this.
|
|
1262
|
+
if (_this.ANMQ && !isNaN(retainedSession) && !(retainedSession >= _this.rPFc.from && retainedSession <= _this.rPFc.to)) {
|
|
1031
1263
|
_this.retainedSessionValidated = false;
|
|
1032
1264
|
return false;
|
|
1033
1265
|
}
|
|
@@ -1036,45 +1268,45 @@
|
|
|
1036
1268
|
var data = Apxor.getController().getFromStorage("_apx_lt_count");
|
|
1037
1269
|
var siteid = Apxor.getSiteId();
|
|
1038
1270
|
var LtCountObjDecoded = JSON.parse(new TextDecoder().decode(stringToArrayBuffer(decode(siteid, data))));
|
|
1039
|
-
for (var i = 0; i < _this.
|
|
1040
|
-
var evName = _this.
|
|
1271
|
+
for (var i = 0; i < _this.SxPK.length; i++) {
|
|
1272
|
+
var evName = _this.SxPK[i].name.replace("'", "").replace("’", "");
|
|
1041
1273
|
if (LtCountObjDecoded[evName]) {
|
|
1042
1274
|
_this.eventDoneInLT = true;
|
|
1043
1275
|
return false;
|
|
1044
1276
|
}
|
|
1045
1277
|
}
|
|
1046
1278
|
} catch (e) {
|
|
1047
|
-
Logger$
|
|
1279
|
+
Logger$7.error("Failed to validate the lt count:" + e);
|
|
1048
1280
|
}
|
|
1049
1281
|
return true;
|
|
1050
1282
|
});
|
|
1051
1283
|
});
|
|
1052
1284
|
|
|
1053
|
-
var Logger$
|
|
1285
|
+
var Logger$8 = window.ApxorLogger;
|
|
1054
1286
|
var Attributes = /*#__PURE__*/_createClass(function Attributes() {
|
|
1055
1287
|
var _this = this;
|
|
1056
1288
|
_classCallCheck(this, Attributes);
|
|
1057
|
-
_defineProperty(this, "
|
|
1058
|
-
_defineProperty(this, "
|
|
1289
|
+
_defineProperty(this, "dsWR", []);
|
|
1290
|
+
_defineProperty(this, "LTNO", []);
|
|
1059
1291
|
_defineProperty(this, "parse", function () {
|
|
1060
1292
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1061
1293
|
try {
|
|
1062
|
-
_this.
|
|
1063
|
-
_this.
|
|
1064
|
-
if (!Array.isArray(_this.
|
|
1065
|
-
Logger$
|
|
1294
|
+
_this.dsWR = config.attributes.user;
|
|
1295
|
+
_this.LTNO = config.attributes.session;
|
|
1296
|
+
if (!Array.isArray(_this.dsWR) || !Array.isArray(_this.LTNO)) {
|
|
1297
|
+
Logger$8.error("No attributes");
|
|
1066
1298
|
return false;
|
|
1067
1299
|
}
|
|
1068
1300
|
} catch (error) {
|
|
1069
|
-
Logger$
|
|
1301
|
+
Logger$8.error(error);
|
|
1070
1302
|
return false;
|
|
1071
1303
|
}
|
|
1072
1304
|
return true;
|
|
1073
1305
|
});
|
|
1074
1306
|
_defineProperty(this, "validate", function (user, session) {
|
|
1075
|
-
return _this.
|
|
1307
|
+
return _this.oQgb(user, _this.dsWR) && _this.oQgb(session, _this.LTNO);
|
|
1076
1308
|
});
|
|
1077
|
-
_defineProperty(this, "
|
|
1309
|
+
_defineProperty(this, "oQgb", function (attributes, expected) {
|
|
1078
1310
|
var length = expected.length;
|
|
1079
1311
|
var status = true;
|
|
1080
1312
|
try {
|
|
@@ -1104,7 +1336,7 @@
|
|
|
1104
1336
|
}
|
|
1105
1337
|
var match = loggedValues.some(function (loggedValue) {
|
|
1106
1338
|
return values.some(function (configValue) {
|
|
1107
|
-
return
|
|
1339
|
+
return FrGM(loggedValue, configValue, operator);
|
|
1108
1340
|
});
|
|
1109
1341
|
});
|
|
1110
1342
|
status = status && match;
|
|
@@ -1115,7 +1347,7 @@
|
|
|
1115
1347
|
if (_ret) return _ret.v;
|
|
1116
1348
|
}
|
|
1117
1349
|
} catch (error) {
|
|
1118
|
-
Logger$
|
|
1350
|
+
Logger$8.error(error);
|
|
1119
1351
|
status = false;
|
|
1120
1352
|
}
|
|
1121
1353
|
return status;
|
|
@@ -1128,18 +1360,18 @@
|
|
|
1128
1360
|
var TimeBasedTermination = /*#__PURE__*/_createClass(function TimeBasedTermination() {
|
|
1129
1361
|
var _this = this;
|
|
1130
1362
|
_classCallCheck(this, TimeBasedTermination);
|
|
1131
|
-
_defineProperty(this, "
|
|
1363
|
+
_defineProperty(this, "qHaI", Apxor.getController());
|
|
1132
1364
|
_defineProperty(this, "type", "");
|
|
1133
1365
|
_defineProperty(this, "_duration_seconds", 0);
|
|
1134
|
-
_defineProperty(this, "
|
|
1366
|
+
_defineProperty(this, "wNpm", 1);
|
|
1135
1367
|
_defineProperty(this, "parse", function (config) {
|
|
1136
1368
|
try {
|
|
1137
1369
|
var _config$terminate_inf, _config$terminate_inf2, _config$terminate_inf3;
|
|
1138
|
-
_this.
|
|
1370
|
+
_this.MLcB = (_config$terminate_inf = config.terminate_info.time_based) === null || _config$terminate_inf === void 0 ? void 0 : _config$terminate_inf.type;
|
|
1139
1371
|
_this._duration_seconds = (_config$terminate_inf2 = config.terminate_info) === null || _config$terminate_inf2 === void 0 ? void 0 : _config$terminate_inf2.time_based.duration_seconds;
|
|
1140
|
-
_this.
|
|
1141
|
-
if (_this.
|
|
1142
|
-
_this.
|
|
1372
|
+
_this.wNpm = (_config$terminate_inf3 = config.terminate_info.time_based) === null || _config$terminate_inf3 === void 0 ? void 0 : _config$terminate_inf3.days;
|
|
1373
|
+
if (_this.FrGM(config._id)) {
|
|
1374
|
+
_this.qHaI.persistTerminationInfoLocally(config._id);
|
|
1143
1375
|
return false;
|
|
1144
1376
|
}
|
|
1145
1377
|
} catch (_unused) {
|
|
@@ -1147,16 +1379,16 @@
|
|
|
1147
1379
|
}
|
|
1148
1380
|
return true;
|
|
1149
1381
|
});
|
|
1150
|
-
_defineProperty(this, "
|
|
1382
|
+
_defineProperty(this, "FrGM", function (id) {
|
|
1151
1383
|
var _Data$id;
|
|
1152
|
-
var Data = JSON.parse(_this.
|
|
1384
|
+
var Data = JSON.parse(_this.qHaI.getFromStorage(APX_TERMINATION_ID));
|
|
1153
1385
|
if (!Data[id] || !((_Data$id = Data[id]) !== null && _Data$id !== void 0 && _Data$id.startDate)) return false;
|
|
1154
1386
|
var startDate = new Date(Data[id].startDate);
|
|
1155
1387
|
var presentDate = new Date(getDateInMMDDYYYY());
|
|
1156
1388
|
var diff = parseInt((presentDate - startDate) / (1000 * 60 * 60 * 24), 10);
|
|
1157
1389
|
var currentTime = _getTime();
|
|
1158
|
-
var
|
|
1159
|
-
return diff === _this.
|
|
1390
|
+
var LHUD = Data[id].LHUD;
|
|
1391
|
+
return diff === _this.wNpm && currentTime.hours >= LHUD.hours || diff > _this.wNpm || Data[id].goalAcheived;
|
|
1160
1392
|
});
|
|
1161
1393
|
});
|
|
1162
1394
|
|
|
@@ -1165,19 +1397,19 @@
|
|
|
1165
1397
|
_classCallCheck(this, TerminationInfo);
|
|
1166
1398
|
_defineProperty(this, "enable_goal_events", false);
|
|
1167
1399
|
_defineProperty(this, "attributes", {});
|
|
1168
|
-
_defineProperty(this, "
|
|
1169
|
-
_defineProperty(this, "
|
|
1400
|
+
_defineProperty(this, "mnOu", new Attributes());
|
|
1401
|
+
_defineProperty(this, "hHRZ", new TimeBasedTermination());
|
|
1170
1402
|
_defineProperty(this, "parse", function () {
|
|
1171
1403
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1172
1404
|
try {
|
|
1173
1405
|
var _config$terminate_inf, _config$terminate_inf2, _config$terminate_inf3;
|
|
1174
1406
|
_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;
|
|
1175
|
-
if (_this.enable_time_based && !_this.
|
|
1407
|
+
if (_this.enable_time_based && !_this.hHRZ.parse(config)) {
|
|
1176
1408
|
return false;
|
|
1177
1409
|
}
|
|
1178
1410
|
_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;
|
|
1179
1411
|
_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;
|
|
1180
|
-
if (_this.enable_attributes && !_this.
|
|
1412
|
+
if (_this.enable_attributes && !_this.mnOu.parse(config.terminate_info)) {
|
|
1181
1413
|
return false;
|
|
1182
1414
|
}
|
|
1183
1415
|
} catch (error) {
|
|
@@ -1187,55 +1419,129 @@
|
|
|
1187
1419
|
return true;
|
|
1188
1420
|
});
|
|
1189
1421
|
_defineProperty(this, "validate", function (user, session) {
|
|
1190
|
-
return _this.
|
|
1422
|
+
return _this.mnOu.validate(user, session);
|
|
1191
1423
|
});
|
|
1192
1424
|
});
|
|
1193
1425
|
|
|
1194
|
-
var
|
|
1426
|
+
var Binding = /*#__PURE__*/_createClass(function Binding() {
|
|
1427
|
+
var _this = this;
|
|
1428
|
+
_classCallCheck(this, Binding);
|
|
1429
|
+
_defineProperty(this, "zciv", "");
|
|
1430
|
+
_defineProperty(this, "DDKo", "");
|
|
1431
|
+
_defineProperty(this, "TZPK", "");
|
|
1432
|
+
_defineProperty(this, "UqJE", "");
|
|
1433
|
+
_defineProperty(this, "parse", function () {
|
|
1434
|
+
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1435
|
+
try {
|
|
1436
|
+
_this.zciv = config === null || config === void 0 ? void 0 : config.screen_binding;
|
|
1437
|
+
if (!_this.zciv) {
|
|
1438
|
+
return true;
|
|
1439
|
+
} else {
|
|
1440
|
+
_this.DDKo = config === null || config === void 0 ? void 0 : config.binding.url;
|
|
1441
|
+
_this.TZPK = config === null || config === void 0 ? void 0 : config.binding["var"];
|
|
1442
|
+
_this.UqJE = config === null || config === void 0 ? void 0 : config.binding.operator;
|
|
1443
|
+
return true;
|
|
1444
|
+
}
|
|
1445
|
+
} catch (error) {
|
|
1446
|
+
window.ApxorLogger.error(error);
|
|
1447
|
+
return false;
|
|
1448
|
+
}
|
|
1449
|
+
});
|
|
1450
|
+
/**
|
|
1451
|
+
* compares the current url with url from config based on the operator
|
|
1452
|
+
* url :Screen binding url from config
|
|
1453
|
+
* variable :variable is the dynamic part of the url which we get in config which is by default "$"
|
|
1454
|
+
* operator :operator can be either "EQ" used for equality comparision or "SW" used for startswith comparision
|
|
1455
|
+
*/
|
|
1456
|
+
_defineProperty(this, "validate", function () {
|
|
1457
|
+
var url = _this.DDKo;
|
|
1458
|
+
var variable = _this.TZPK;
|
|
1459
|
+
var operator = _this.UqJE;
|
|
1460
|
+
var currentUrl = window.location.href;
|
|
1461
|
+
if (!_this.zciv) {
|
|
1462
|
+
return true;
|
|
1463
|
+
} else {
|
|
1464
|
+
if (operator === "EQ") {
|
|
1465
|
+
if (!url.includes(variable)) {
|
|
1466
|
+
if (currentUrl === url) {
|
|
1467
|
+
return true;
|
|
1468
|
+
} else {
|
|
1469
|
+
return false;
|
|
1470
|
+
}
|
|
1471
|
+
} else {
|
|
1472
|
+
var matched = _doesUrlMatchSkeleton(currentUrl, url, variable, false);
|
|
1473
|
+
if (matched) {
|
|
1474
|
+
return true;
|
|
1475
|
+
} else {
|
|
1476
|
+
return false;
|
|
1477
|
+
}
|
|
1478
|
+
}
|
|
1479
|
+
} else if (operator === "SW") {
|
|
1480
|
+
if (!url.includes(variable)) {
|
|
1481
|
+
if (currentUrl.startsWith(url)) {
|
|
1482
|
+
return true;
|
|
1483
|
+
} else {
|
|
1484
|
+
return false;
|
|
1485
|
+
}
|
|
1486
|
+
} else {
|
|
1487
|
+
var _matched = _doesUrlMatchSkeleton(currentUrl, url, variable, true);
|
|
1488
|
+
if (_matched) {
|
|
1489
|
+
return true;
|
|
1490
|
+
} else {
|
|
1491
|
+
return false;
|
|
1492
|
+
}
|
|
1493
|
+
}
|
|
1494
|
+
}
|
|
1495
|
+
}
|
|
1496
|
+
});
|
|
1497
|
+
});
|
|
1498
|
+
|
|
1499
|
+
var Logger$9 = window.ApxorLogger;
|
|
1195
1500
|
var ConfigItem = /*#__PURE__*/_createClass(function ConfigItem() {
|
|
1196
1501
|
var _this = this;
|
|
1197
1502
|
_classCallCheck(this, ConfigItem);
|
|
1198
|
-
_defineProperty(this, "
|
|
1199
|
-
_defineProperty(this, "
|
|
1200
|
-
_defineProperty(this, "
|
|
1201
|
-
_defineProperty(this, "
|
|
1202
|
-
_defineProperty(this, "
|
|
1203
|
-
_defineProperty(this, "
|
|
1204
|
-
_defineProperty(this, "
|
|
1205
|
-
_defineProperty(this, "
|
|
1206
|
-
_defineProperty(this, "
|
|
1207
|
-
_defineProperty(this, "
|
|
1208
|
-
_defineProperty(this, "
|
|
1503
|
+
_defineProperty(this, "pZCC", []);
|
|
1504
|
+
_defineProperty(this, "eCJJ", []);
|
|
1505
|
+
_defineProperty(this, "xKIU", "");
|
|
1506
|
+
_defineProperty(this, "UzYn", new Meta());
|
|
1507
|
+
_defineProperty(this, "trWM", new Audience());
|
|
1508
|
+
_defineProperty(this, "FXvj", new Validity());
|
|
1509
|
+
_defineProperty(this, "rQSF", new Frequency());
|
|
1510
|
+
_defineProperty(this, "ZIao", new OverallConfig());
|
|
1511
|
+
_defineProperty(this, "TgFO", new TerminationInfo());
|
|
1512
|
+
_defineProperty(this, "kpCc", new Binding());
|
|
1513
|
+
_defineProperty(this, "wOSL", false);
|
|
1514
|
+
_defineProperty(this, "IsFF", []);
|
|
1209
1515
|
_defineProperty(this, "_variant_code", "");
|
|
1210
1516
|
_defineProperty(this, "parse", function () {
|
|
1211
1517
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1212
1518
|
try {
|
|
1213
|
-
var _this$
|
|
1519
|
+
var _this$UzYn$_attr;
|
|
1214
1520
|
// If ID is not present, throw it out
|
|
1215
1521
|
if (!isDefined(config._id)) {
|
|
1216
|
-
Logger$
|
|
1522
|
+
Logger$9.error("No Id");
|
|
1217
1523
|
return false;
|
|
1218
1524
|
}
|
|
1219
1525
|
|
|
1220
1526
|
// If config is disabled, throw it out
|
|
1221
1527
|
if (!isDefined(config.enabled) || !config.enabled) {
|
|
1222
|
-
Logger$
|
|
1528
|
+
Logger$9.error("Not enabled");
|
|
1223
1529
|
return false;
|
|
1224
1530
|
}
|
|
1225
1531
|
|
|
1226
1532
|
// If META, VALIDITY, FREQUENCY and AUDIENCE is not parsed properly, throw it out
|
|
1227
|
-
if (!(_this.
|
|
1533
|
+
if (!(_this.UzYn.parse(config) && _this.FXvj.parse(config) && _this.rQSF.parse(config) && _this.trWM.parse(config) && _this.ZIao.parse(config) && _this.TgFO.parse(config) && _this.kpCc.parse(config))) {
|
|
1228
1534
|
return false;
|
|
1229
1535
|
}
|
|
1230
|
-
_this._variant_code = _this.
|
|
1536
|
+
_this._variant_code = _this.UzYn._isExperiment || _this.UzYn._only_context ? (_this$UzYn$_attr = _this.UzYn._attr) === null || _this$UzYn$_attr === void 0 ? void 0 : _this$UzYn$_attr[APX_VARIANT_CODE] : "TG";
|
|
1231
1537
|
// If there are no conditions, throw it out
|
|
1232
1538
|
if (!isDefined(config.conditions) || !Array.isArray(config.conditions)) {
|
|
1233
|
-
Logger$
|
|
1539
|
+
Logger$9.error("No valid conditions", config.conditions);
|
|
1234
1540
|
return false;
|
|
1235
1541
|
}
|
|
1236
|
-
_this.
|
|
1237
|
-
_this.
|
|
1238
|
-
if (_this.
|
|
1542
|
+
_this.xKIU = config._id;
|
|
1543
|
+
_this.wOSL = isDefined(config.sequence_enabled) ? config.sequence_enabled : false;
|
|
1544
|
+
if (_this.wOSL) {
|
|
1239
1545
|
// iff respectSequence is true, Sort the Conditions by their sequence order
|
|
1240
1546
|
// We need to sort, if server sends them in orderless manner
|
|
1241
1547
|
config.conditions.sort(function (prev, current) {
|
|
@@ -1246,18 +1552,22 @@
|
|
|
1246
1552
|
// Parse all conditions now
|
|
1247
1553
|
var conditions = config.conditions;
|
|
1248
1554
|
var length = conditions.length;
|
|
1249
|
-
|
|
1250
|
-
|
|
1555
|
+
var no_context_enabled = config === null || config === void 0 ? void 0 : config.no_context_enabled;
|
|
1556
|
+
if (length === 0 && no_context_enabled) {
|
|
1557
|
+
_this.evpT();
|
|
1558
|
+
}
|
|
1559
|
+
var _loop = function _loop() {
|
|
1560
|
+
_this.IsFF = [];
|
|
1251
1561
|
var condition = conditions[index];
|
|
1252
1562
|
if (condition.type === "didn't") {
|
|
1253
|
-
var
|
|
1563
|
+
var HPBH$details;
|
|
1254
1564
|
var obj = {
|
|
1255
1565
|
trigger_key: condition.trigger.details.name,
|
|
1256
|
-
no_kpi_array: condition === null || condition === void 0 || (
|
|
1566
|
+
no_kpi_array: condition === null || condition === void 0 || (HPBH$details = condition.details) === null || HPBH$details === void 0 || (HPBH$details = HPBH$details.additional_info) === null || HPBH$details === void 0 ? void 0 : HPBH$details.nkpi,
|
|
1257
1567
|
condition_id: condition === null || condition === void 0 ? void 0 : condition._id,
|
|
1258
1568
|
time_bounds: condition.time_bounds.upper
|
|
1259
1569
|
};
|
|
1260
|
-
_this.
|
|
1570
|
+
_this.IsFF = [].concat(_toConsumableArray(_this.IsFF), [obj]);
|
|
1261
1571
|
//this will be the key
|
|
1262
1572
|
//when event occur check this array and then then check the time
|
|
1263
1573
|
//check the time diffrence
|
|
@@ -1266,143 +1576,144 @@
|
|
|
1266
1576
|
}
|
|
1267
1577
|
|
|
1268
1578
|
var conditionValidator = new ConditionValidator();
|
|
1269
|
-
if (conditionValidator.initialize(condition, _this.
|
|
1270
|
-
_this.
|
|
1579
|
+
if (conditionValidator.initialize(condition, _this.xKIU, index, _this.wOSL, _this.IsFF)) {
|
|
1580
|
+
_this.pZCC.push(conditionValidator);
|
|
1581
|
+
var max_retries = (condition === null || condition === void 0 ? void 0 : condition.timeout) / (condition === null || condition === void 0 ? void 0 : condition.findinterval);
|
|
1582
|
+
var frame_id = (condition === null || condition === void 0 ? void 0 : condition.frameid) || "";
|
|
1583
|
+
var url = condition === null || condition === void 0 ? void 0 : condition.url;
|
|
1584
|
+
if (window.location.href === url) {
|
|
1585
|
+
if (condition.event_type === "view_visibility") {
|
|
1586
|
+
if (_findTargetElement(condition.view_id, frame_id, condition === null || condition === void 0 ? void 0 : condition.enable_retry, condition === null || condition === void 0 ? void 0 : condition.findinterval, max_retries) === true) {
|
|
1587
|
+
//this.GRBk();
|
|
1588
|
+
_this.evpT(true);
|
|
1589
|
+
}
|
|
1590
|
+
}
|
|
1591
|
+
}
|
|
1592
|
+
// eslint-disable-next-line no-unused-vars
|
|
1593
|
+
window.addEventListener("navigate", function (event) {
|
|
1594
|
+
var url = condition === null || condition === void 0 ? void 0 : condition.url;
|
|
1595
|
+
if (window.location.href === url) {
|
|
1596
|
+
if (condition.event_type === "view_visibility") {
|
|
1597
|
+
if (_findTargetElement(condition.view_id, frame_id, condition === null || condition === void 0 ? void 0 : condition.enable_retry, condition === null || condition === void 0 ? void 0 : condition.findinterval, max_retries) === true) {
|
|
1598
|
+
//this.GRBk();
|
|
1599
|
+
_this.evpT(true);
|
|
1600
|
+
}
|
|
1601
|
+
}
|
|
1602
|
+
}
|
|
1603
|
+
});
|
|
1271
1604
|
}
|
|
1605
|
+
};
|
|
1606
|
+
for (var index = 0; index < length; index++) {
|
|
1607
|
+
_loop();
|
|
1272
1608
|
}
|
|
1273
|
-
if (_this.
|
|
1609
|
+
if (_this.TgFO.enable_goal_events) {
|
|
1274
1610
|
var goal_events = config.terminate_info.goal_events.events;
|
|
1275
1611
|
var goaleventslength = goal_events.length;
|
|
1276
1612
|
for (var i = 0; i < goaleventslength; i++) {
|
|
1277
|
-
var
|
|
1278
|
-
if (
|
|
1279
|
-
_this.
|
|
1613
|
+
var conditionValidator = new ConditionValidator();
|
|
1614
|
+
if (conditionValidator.initialize(goal_events[i], _this.xKIU, i, true, [], "termination")) {
|
|
1615
|
+
_this.eCJJ.push(conditionValidator);
|
|
1280
1616
|
}
|
|
1281
1617
|
}
|
|
1282
1618
|
}
|
|
1283
|
-
return _this.
|
|
1619
|
+
return _this.pZCC.length > 0;
|
|
1284
1620
|
} catch (error) {
|
|
1285
|
-
Logger$
|
|
1621
|
+
Logger$9.error(error);
|
|
1286
1622
|
return false;
|
|
1287
1623
|
}
|
|
1288
1624
|
});
|
|
1289
|
-
_defineProperty(this, "
|
|
1625
|
+
_defineProperty(this, "xOwj", function (index) {
|
|
1290
1626
|
if (index < 0) {
|
|
1291
1627
|
return;
|
|
1292
1628
|
}
|
|
1293
|
-
if (_this.
|
|
1294
|
-
var conditionValidator = _this.
|
|
1295
|
-
if (isDefined(conditionValidator) && conditionValidator.
|
|
1629
|
+
if (_this.wOSL) {
|
|
1630
|
+
var conditionValidator = _this.pZCC[index];
|
|
1631
|
+
if (isDefined(conditionValidator) && conditionValidator.lAQm) {
|
|
1296
1632
|
// Check if previous validator is satisfied
|
|
1297
|
-
var prevValidator = _this.
|
|
1298
|
-
if (isDefined(prevValidator) && !prevValidator.
|
|
1633
|
+
var prevValidator = _this.pZCC[index - 1];
|
|
1634
|
+
if (isDefined(prevValidator) && !prevValidator.lAQm) {
|
|
1299
1635
|
// TODO: If current index is satisfied before previous one, do something
|
|
1300
1636
|
// either unregister all conditions or remove this item from ConfigLookup
|
|
1301
1637
|
return;
|
|
1302
1638
|
}
|
|
1303
|
-
var nextValidator = _this.
|
|
1639
|
+
var nextValidator = _this.pZCC[index + 1];
|
|
1304
1640
|
if (!isDefined(nextValidator)) {
|
|
1305
1641
|
// It means this is the last condition
|
|
1306
1642
|
// Validate all conditions
|
|
1307
|
-
_this.
|
|
1643
|
+
_this.evpT();
|
|
1308
1644
|
} else {
|
|
1309
|
-
nextValidator.
|
|
1645
|
+
nextValidator.GRBk();
|
|
1310
1646
|
}
|
|
1311
1647
|
}
|
|
1312
1648
|
} else {
|
|
1313
1649
|
// Validate all conditions
|
|
1314
|
-
_this.
|
|
1650
|
+
_this.evpT();
|
|
1315
1651
|
}
|
|
1316
1652
|
});
|
|
1317
|
-
_defineProperty(this, "
|
|
1653
|
+
_defineProperty(this, "YTOO", function (index) {
|
|
1318
1654
|
if (index < 0) {
|
|
1319
1655
|
return;
|
|
1320
1656
|
}
|
|
1321
|
-
_this.
|
|
1657
|
+
_this.cClV();
|
|
1322
1658
|
});
|
|
1323
|
-
_defineProperty(this, "
|
|
1659
|
+
_defineProperty(this, "evpT", function () {
|
|
1660
|
+
var _window$ApxorRTM, _window$ApxorRTM2;
|
|
1661
|
+
var view_visibility = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
1324
1662
|
// Check If Audience, Validity is satisfied or not
|
|
1325
1663
|
var userAttributes = Apxor.getController().getUserAttributes();
|
|
1326
1664
|
var sessionAttributes = Apxor.getController().getSessionAttributes();
|
|
1327
|
-
if (!
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1665
|
+
if (!((_window$ApxorRTM = window.ApxorRTM) !== null && _window$ApxorRTM !== void 0 && _window$ApxorRTM.isBadgePresent && (_window$ApxorRTM2 = window.ApxorRTM) !== null && _window$ApxorRTM2 !== void 0 && _window$ApxorRTM2.badgesLists.includes(_this.xKIU) && Apxor.getController().isBadgeTriggerSatisfied(_this.xKIU))) {
|
|
1666
|
+
Apxor === null || Apxor === void 0 || Apxor.logEvent("apx_trigger_satisfied", {
|
|
1667
|
+
apx_nudge_type: _this.UzYn.MLcB === "SURVEY" ? "survey" : "campaign",
|
|
1668
|
+
apx_nudge_id: _this.xKIU,
|
|
1669
|
+
apx_nudge_name: _this.UzYn.hqtt,
|
|
1670
|
+
apx_variant_code: _this.UzYn._isExperiment || _this.UzYn._only_context ? _this.UzYn._attr[APX_VARIANT_CODE] : "TG"
|
|
1671
|
+
});
|
|
1672
|
+
}
|
|
1673
|
+
if (!_this.FXvj.validate() || !_this.trWM.validate(userAttributes, sessionAttributes) || !_this.ZIao.validate() || !_this.kpCc.validate()) {
|
|
1674
|
+
if (!_this.ZIao.retainedDaysValidated) {
|
|
1675
|
+
_this.QyOa("Retained day criteria not met");
|
|
1676
|
+
return;
|
|
1337
1677
|
}
|
|
1338
|
-
if (!_this.
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
apx_nudge_id: _this.HaKf,
|
|
1342
|
-
apx_nudge_name: _this.tEDn.oMsP,
|
|
1343
|
-
apx_variant_code: _this.tEDn._isExperiment || _this.tEDn._only_context ? _this.tEDn._attr[APX_VARIANT_CODE] : "TG",
|
|
1344
|
-
apx_failure_type: "warn",
|
|
1345
|
-
apx_reason: "User session criteria not met"
|
|
1346
|
-
});
|
|
1678
|
+
if (!_this.ZIao.retainedSessionValidated) {
|
|
1679
|
+
_this.QyOa("User session criteria not met");
|
|
1680
|
+
return;
|
|
1347
1681
|
}
|
|
1348
|
-
if (_this.
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
apx_nudge_id: _this.HaKf,
|
|
1352
|
-
apx_nudge_name: _this.tEDn.oMsP,
|
|
1353
|
-
apx_variant_code: _this.tEDn._isExperiment || _this.tEDn._only_context ? _this.tEDn._attr[APX_VARIANT_CODE] : "TG",
|
|
1354
|
-
apx_failure_type: "warn",
|
|
1355
|
-
apx_reason: "Event done in life time"
|
|
1356
|
-
});
|
|
1682
|
+
if (_this.ZIao.eventDoneInLT) {
|
|
1683
|
+
_this.QyOa("Event done in life time");
|
|
1684
|
+
return;
|
|
1357
1685
|
}
|
|
1358
|
-
if (!_this.
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
apx_nudge_id: _this.HaKf,
|
|
1362
|
-
apx_nudge_name: _this.tEDn.oMsP,
|
|
1363
|
-
apx_variant_code: _this.tEDn._isExperiment || _this.tEDn._only_context ? _this.tEDn._attr[APX_VARIANT_CODE] : "TG",
|
|
1364
|
-
apx_failure_type: "warn",
|
|
1365
|
-
apx_reason: "User property filter not met"
|
|
1366
|
-
});
|
|
1686
|
+
if (!_this.trWM.userAttributesValidated) {
|
|
1687
|
+
_this.QyOa("User property filter not met");
|
|
1688
|
+
return;
|
|
1367
1689
|
}
|
|
1368
|
-
if (!_this.
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
apx_nudge_id: _this.HaKf,
|
|
1372
|
-
apx_nudge_name: _this.tEDn.oMsP,
|
|
1373
|
-
apx_variant_code: _this.tEDn._isExperiment || _this.tEDn._only_context ? _this.tEDn._attr[APX_VARIANT_CODE] : "TG",
|
|
1374
|
-
apx_failure_type: "warn",
|
|
1375
|
-
apx_reason: "Session property filter not met"
|
|
1376
|
-
});
|
|
1690
|
+
if (!_this.trWM.sessionAttributeValidated) {
|
|
1691
|
+
_this.QyOa("Session property filter not met");
|
|
1692
|
+
return;
|
|
1377
1693
|
}
|
|
1378
|
-
if (_this.
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
apx_nudge_id: _this.HaKf,
|
|
1382
|
-
apx_nudge_name: _this.tEDn.oMsP,
|
|
1383
|
-
apx_variant_code: _this.tEDn._isExperiment || _this.tEDn._only_context ? _this.tEDn._attr[APX_VARIANT_CODE] : "TG",
|
|
1384
|
-
apx_failure_type: "warn",
|
|
1385
|
-
apx_reason: "nudge not yet active"
|
|
1386
|
-
});
|
|
1694
|
+
if (_this.FXvj._not_in_specified_time) {
|
|
1695
|
+
_this.QyOa("Time limits check failed");
|
|
1696
|
+
return;
|
|
1387
1697
|
}
|
|
1388
|
-
if (_this.
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
apx_reason: "nudge expired"
|
|
1396
|
-
});
|
|
1698
|
+
if (_this.FXvj._not_yet_active) {
|
|
1699
|
+
_this.QyOa("not in the scheduled time");
|
|
1700
|
+
return;
|
|
1701
|
+
}
|
|
1702
|
+
if (_this.FXvj._nudge_expired) {
|
|
1703
|
+
_this.QyOa("nudge expired");
|
|
1704
|
+
return;
|
|
1397
1705
|
}
|
|
1398
1706
|
return;
|
|
1399
1707
|
}
|
|
1400
|
-
var length = _this.
|
|
1708
|
+
var length = _this.pZCC.length;
|
|
1401
1709
|
var isSatisfied = length < 1;
|
|
1402
1710
|
var combineOperator = "";
|
|
1711
|
+
if (length === 0) {
|
|
1712
|
+
isSatisfied = true;
|
|
1713
|
+
}
|
|
1403
1714
|
for (var index = 0; index < length; index++) {
|
|
1404
|
-
var validator = _this.
|
|
1405
|
-
var currentResult = validator.
|
|
1715
|
+
var validator = _this.pZCC[index];
|
|
1716
|
+
var currentResult = validator.lAQm;
|
|
1406
1717
|
if (combineOperator.trim() === "") {
|
|
1407
1718
|
isSatisfied = currentResult;
|
|
1408
1719
|
} else {
|
|
@@ -1415,59 +1726,61 @@
|
|
|
1415
1726
|
break;
|
|
1416
1727
|
}
|
|
1417
1728
|
}
|
|
1418
|
-
combineOperator = validator.
|
|
1729
|
+
combineOperator = validator.NcmX;
|
|
1730
|
+
}
|
|
1731
|
+
if (view_visibility === true) {
|
|
1732
|
+
isSatisfied = true;
|
|
1419
1733
|
}
|
|
1420
1734
|
if (isSatisfied) {
|
|
1421
|
-
var _window$ApxorRTM, _window$ApxorRTM2;
|
|
1422
1735
|
console.debug("onCondition satisfied");
|
|
1423
1736
|
// Check if count reached it's maximum
|
|
1424
|
-
if (!_this.
|
|
1425
|
-
console.warn("Maximum limit reached", _this.
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1737
|
+
if (!_this.rQSF.fhhD(_this.xKIU)) {
|
|
1738
|
+
console.warn("Maximum limit reached", _this.xKIU);
|
|
1739
|
+
if (Apxor.getController().isTestDevice()) {
|
|
1740
|
+
feedBackMessagePopUpCE("Maximum limit reached for campaign name ".concat(_this.UzYn.hqtt));
|
|
1741
|
+
var closeButton = document.getElementById("close-button");
|
|
1742
|
+
var dismissCallback = function dismissCallback() {
|
|
1743
|
+
var modal_popup_container = document.getElementById("apx-container");
|
|
1744
|
+
modal_popup_container === null || modal_popup_container === void 0 || modal_popup_container.remove();
|
|
1745
|
+
};
|
|
1746
|
+
closeButton === null || closeButton === void 0 || closeButton.addEventListener("click", dismissCallback);
|
|
1747
|
+
window.setTimeout(dismissCallback, 20000);
|
|
1748
|
+
}
|
|
1435
1749
|
return;
|
|
1436
1750
|
}
|
|
1437
1751
|
|
|
1438
1752
|
//logging event for view not found for test device
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
}
|
|
1753
|
+
|
|
1754
|
+
console.log("Dispatching event", _this.UzYn.MLcB);
|
|
1755
|
+
|
|
1756
|
+
//if (this.UzYn._only_context === true) {
|
|
1757
|
+
Apxor.logEvent(APX_CONTEXT_EVALUATED, _objectSpread2(_objectSpread2({
|
|
1758
|
+
apx_nudge_type: _this.UzYn.MLcB === "SURVEY" ? "survey" : "campaign",
|
|
1759
|
+
apx_nudge_id: _this.xKIU,
|
|
1760
|
+
apx_nudge_name: _this.UzYn.hqtt,
|
|
1761
|
+
apx_variant_code: _this.UzYn._isExperiment || _this.UzYn._only_context ? _this.UzYn._attr[APX_VARIANT_CODE] : "TG"
|
|
1762
|
+
}, _this.UzYn._attr), {}, {
|
|
1763
|
+
message_name: _this.UzYn.hqtt,
|
|
1764
|
+
id: _this.xKIU
|
|
1765
|
+
}));
|
|
1766
|
+
//}
|
|
1454
1767
|
// Emit event
|
|
1455
|
-
Apxor.getController().dispatchEvent(_this.
|
|
1456
|
-
name: _this.
|
|
1768
|
+
Apxor.getController().dispatchEvent(_this.UzYn.MLcB, {
|
|
1769
|
+
name: _this.UzYn.MLcB,
|
|
1457
1770
|
additional_info: {
|
|
1458
|
-
uuid: _this.
|
|
1459
|
-
name: _this.
|
|
1771
|
+
uuid: _this.xKIU,
|
|
1772
|
+
name: _this.UzYn.hqtt
|
|
1460
1773
|
}
|
|
1461
1774
|
});
|
|
1462
1775
|
}
|
|
1463
1776
|
});
|
|
1464
|
-
_defineProperty(this, "
|
|
1465
|
-
var length = _this.
|
|
1777
|
+
_defineProperty(this, "cClV", function () {
|
|
1778
|
+
var length = _this.eCJJ.length;
|
|
1466
1779
|
var isSatisfied = length < 1;
|
|
1467
1780
|
var combineOperator = "";
|
|
1468
1781
|
for (var index = 0; index < length; index++) {
|
|
1469
|
-
var validator = _this.
|
|
1470
|
-
var currentResult = validator.
|
|
1782
|
+
var validator = _this.eCJJ[index];
|
|
1783
|
+
var currentResult = validator.lAQm;
|
|
1471
1784
|
if (combineOperator.trim() === "") {
|
|
1472
1785
|
isSatisfied = currentResult;
|
|
1473
1786
|
} else {
|
|
@@ -1480,23 +1793,23 @@
|
|
|
1480
1793
|
break;
|
|
1481
1794
|
}
|
|
1482
1795
|
}
|
|
1483
|
-
combineOperator = validator.
|
|
1796
|
+
combineOperator = validator.cTHv;
|
|
1484
1797
|
}
|
|
1485
1798
|
if (isSatisfied) {
|
|
1486
|
-
console.log("Dispatching event", _this.
|
|
1487
|
-
Apxor.getController().persistTerminationInfoLocally(_this.
|
|
1488
|
-
if (_this.
|
|
1489
|
-
Apxor.logEvent(APX_CONTEXT_EVALUATED, _objectSpread2(_objectSpread2({}, _this.
|
|
1490
|
-
message_name: _this.
|
|
1491
|
-
id: _this.
|
|
1799
|
+
console.log("Dispatching event", _this.UzYn.MLcB);
|
|
1800
|
+
Apxor.getController().persistTerminationInfoLocally(_this.xKIU);
|
|
1801
|
+
if (_this.UzYn._only_context === true) {
|
|
1802
|
+
Apxor.logEvent(APX_CONTEXT_EVALUATED, _objectSpread2(_objectSpread2({}, _this.UzYn._attr), {}, {
|
|
1803
|
+
message_name: _this.UzYn.hqtt,
|
|
1804
|
+
id: _this.xKIU
|
|
1492
1805
|
}));
|
|
1493
1806
|
}
|
|
1494
1807
|
// Emit event
|
|
1495
|
-
Apxor.getController().dispatchEvent(_this.
|
|
1496
|
-
name: _this.
|
|
1808
|
+
Apxor.getController().dispatchEvent(_this.UzYn.MLcB, {
|
|
1809
|
+
name: _this.UzYn.MLcB,
|
|
1497
1810
|
additional_info: {
|
|
1498
|
-
uuid: _this.
|
|
1499
|
-
name: _this.
|
|
1811
|
+
uuid: _this.xKIU,
|
|
1812
|
+
name: _this.UzYn.hqtt
|
|
1500
1813
|
}
|
|
1501
1814
|
});
|
|
1502
1815
|
}
|
|
@@ -1504,23 +1817,34 @@
|
|
|
1504
1817
|
_defineProperty(this, "validateForTerminationAttributes", function () {
|
|
1505
1818
|
var userAttributes = Apxor.getController().getUserAttributes();
|
|
1506
1819
|
var sessionAttributes = Apxor.getController().getSessionAttributes();
|
|
1507
|
-
return _this.
|
|
1820
|
+
return _this.TgFO.validate(userAttributes, sessionAttributes);
|
|
1508
1821
|
});
|
|
1509
|
-
_defineProperty(this, "
|
|
1510
|
-
_this.
|
|
1822
|
+
_defineProperty(this, "PrTa", function () {
|
|
1823
|
+
_this.rQSF.PrTa();
|
|
1511
1824
|
});
|
|
1512
1825
|
_defineProperty(this, "getFrequencyCount", function () {
|
|
1513
|
-
return _this.
|
|
1826
|
+
return _this.rQSF.getFrequencyCount();
|
|
1827
|
+
});
|
|
1828
|
+
_defineProperty(this, "TDWH", function () {
|
|
1829
|
+
return _this.rQSF.hYCk();
|
|
1514
1830
|
});
|
|
1515
|
-
_defineProperty(this, "
|
|
1516
|
-
|
|
1831
|
+
_defineProperty(this, "QyOa", function (reason) {
|
|
1832
|
+
var _this$UzYn$_attr2;
|
|
1833
|
+
Apxor === null || Apxor === void 0 || Apxor.logEvent("apx_non_eligible_user", {
|
|
1834
|
+
apx_nudge_type: _this.UzYn.MLcB === "SURVEY" ? "survey" : "campaign",
|
|
1835
|
+
apx_nudge_id: _this.xKIU,
|
|
1836
|
+
apx_nudge_name: _this.UzYn.hqtt,
|
|
1837
|
+
apx_variant_code: _this.UzYn._isExperiment || _this.UzYn._only_context ? (_this$UzYn$_attr2 = _this.UzYn._attr) === null || _this$UzYn$_attr2 === void 0 ? void 0 : _this$UzYn$_attr2[APX_VARIANT_CODE] : "TG",
|
|
1838
|
+
apx_failure_type: "warn",
|
|
1839
|
+
apx_reason: reason
|
|
1840
|
+
});
|
|
1517
1841
|
});
|
|
1518
1842
|
});
|
|
1519
1843
|
|
|
1520
1844
|
var ConfigLookup = /*#__PURE__*/_createClass(function ConfigLookup() {
|
|
1521
1845
|
var _this = this;
|
|
1522
1846
|
_classCallCheck(this, ConfigLookup);
|
|
1523
|
-
_defineProperty(this, "
|
|
1847
|
+
_defineProperty(this, "rDWk", {});
|
|
1524
1848
|
_defineProperty(this, "parse", function () {
|
|
1525
1849
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
1526
1850
|
configs: []
|
|
@@ -1543,7 +1867,7 @@
|
|
|
1543
1867
|
var configId = _config._id;
|
|
1544
1868
|
var configItem = new ConfigItem();
|
|
1545
1869
|
if (configItem.parse(_config)) {
|
|
1546
|
-
_this.
|
|
1870
|
+
_this.rDWk[configId] = configItem;
|
|
1547
1871
|
} else {
|
|
1548
1872
|
console.warn("Failed to parse cfg", configId);
|
|
1549
1873
|
}
|
|
@@ -1551,51 +1875,51 @@
|
|
|
1551
1875
|
}
|
|
1552
1876
|
});
|
|
1553
1877
|
_defineProperty(this, "validate", function (id, index) {
|
|
1554
|
-
if (_this.
|
|
1555
|
-
var configItem = _this.
|
|
1556
|
-
configItem.
|
|
1878
|
+
if (_this.rDWk[id]) {
|
|
1879
|
+
var configItem = _this.rDWk[id];
|
|
1880
|
+
configItem.xOwj(index);
|
|
1557
1881
|
}
|
|
1558
1882
|
});
|
|
1559
1883
|
_defineProperty(this, "getVariantCode", function (id) {
|
|
1560
|
-
if (_this.
|
|
1561
|
-
var configItem = _this.
|
|
1884
|
+
if (_this.rDWk[id]) {
|
|
1885
|
+
var configItem = _this.rDWk[id];
|
|
1562
1886
|
return configItem._variant_code;
|
|
1563
1887
|
}
|
|
1564
1888
|
return "";
|
|
1565
1889
|
});
|
|
1566
1890
|
_defineProperty(this, "validateForTermination", function (id, index) {
|
|
1567
|
-
if (_this.
|
|
1568
|
-
var configItem = _this.
|
|
1569
|
-
configItem.
|
|
1891
|
+
if (_this.rDWk[id]) {
|
|
1892
|
+
var configItem = _this.rDWk[id];
|
|
1893
|
+
configItem.YTOO(index);
|
|
1570
1894
|
}
|
|
1571
1895
|
});
|
|
1572
1896
|
_defineProperty(this, "validateForTerminationAttributes", function (id) {
|
|
1573
|
-
if (_this.
|
|
1574
|
-
var configItem = _this.
|
|
1897
|
+
if (_this.rDWk[id]) {
|
|
1898
|
+
var configItem = _this.rDWk[id];
|
|
1575
1899
|
return configItem.validateForTerminationAttributes();
|
|
1576
1900
|
}
|
|
1577
1901
|
return false;
|
|
1578
1902
|
});
|
|
1579
|
-
_defineProperty(this, "
|
|
1580
|
-
var campiagnConfig = _this.
|
|
1581
|
-
campiagnConfig.
|
|
1903
|
+
_defineProperty(this, "PrTa", function (id) {
|
|
1904
|
+
var campiagnConfig = _this.rDWk[id];
|
|
1905
|
+
campiagnConfig.PrTa();
|
|
1582
1906
|
});
|
|
1583
1907
|
_defineProperty(this, "getFrequencyCount", function (id) {
|
|
1584
|
-
var campiagnConfig = _this.
|
|
1585
|
-
return campiagnConfig.getFrequencyCount();
|
|
1908
|
+
var campiagnConfig = _this.rDWk[id];
|
|
1909
|
+
if (campiagnConfig != undefined) return campiagnConfig.getFrequencyCount();
|
|
1586
1910
|
});
|
|
1587
1911
|
_defineProperty(this, "resetFrequencyCounts", function () {
|
|
1588
|
-
var configs = _this.
|
|
1912
|
+
var configs = _this.rDWk;
|
|
1589
1913
|
for (var configId in configs) {
|
|
1590
|
-
configs[configId].
|
|
1914
|
+
configs[configId].TDWH();
|
|
1591
1915
|
}
|
|
1592
1916
|
});
|
|
1593
|
-
_defineProperty(this, "
|
|
1917
|
+
_defineProperty(this, "zmqm", function (campaignId) {
|
|
1594
1918
|
try {
|
|
1595
|
-
if (_this.
|
|
1596
|
-
var configItem = _this.
|
|
1597
|
-
if (configItem && configItem.
|
|
1598
|
-
return configItem.
|
|
1919
|
+
if (_this.rDWk) {
|
|
1920
|
+
var configItem = _this.rDWk[campaignId];
|
|
1921
|
+
if (configItem && configItem.UzYn) {
|
|
1922
|
+
return configItem.UzYn;
|
|
1599
1923
|
}
|
|
1600
1924
|
}
|
|
1601
1925
|
} catch (e) {
|
|
@@ -1607,46 +1931,46 @@
|
|
|
1607
1931
|
|
|
1608
1932
|
var APP_EVENT = "APP_EVENT";
|
|
1609
1933
|
var CLIENT_EVENT = "CLIENT_EVENT";
|
|
1610
|
-
var Logger$
|
|
1934
|
+
var Logger$a = window.ApxorLogger;
|
|
1611
1935
|
var EventsListener = /*#__PURE__*/_createClass(function EventsListener() {
|
|
1612
1936
|
var _this = this;
|
|
1613
1937
|
_classCallCheck(this, EventsListener);
|
|
1614
|
-
_defineProperty(this, "
|
|
1615
|
-
_defineProperty(this, "
|
|
1616
|
-
_defineProperty(this, "
|
|
1938
|
+
_defineProperty(this, "xUEh", {});
|
|
1939
|
+
_defineProperty(this, "asOE", []);
|
|
1940
|
+
_defineProperty(this, "CQYb", false);
|
|
1617
1941
|
_defineProperty(this, "initialize", function () {
|
|
1618
1942
|
var controller = Apxor.getController();
|
|
1619
1943
|
controller.registerForEvent(APP_EVENT, function (event) {
|
|
1620
|
-
return _this.
|
|
1944
|
+
return _this.Xijx(event, "AE");
|
|
1621
1945
|
});
|
|
1622
1946
|
controller.registerForEvent(CLIENT_EVENT, function (event) {
|
|
1623
|
-
return _this.
|
|
1947
|
+
return _this.Xijx(event, "CE");
|
|
1624
1948
|
});
|
|
1625
1949
|
});
|
|
1626
|
-
_defineProperty(this, "
|
|
1950
|
+
_defineProperty(this, "QENl", function () {
|
|
1627
1951
|
// Clear Buffer
|
|
1628
|
-
for (var item in _this.
|
|
1629
|
-
_this.
|
|
1952
|
+
for (var item in _this.asOE) {
|
|
1953
|
+
_this.hpBl(item.event, item.key, item.type);
|
|
1630
1954
|
}
|
|
1631
|
-
_this.
|
|
1955
|
+
_this.CQYb = true;
|
|
1632
1956
|
});
|
|
1633
|
-
_defineProperty(this, "
|
|
1957
|
+
_defineProperty(this, "Cbqw", function (event, callback) {
|
|
1634
1958
|
if (!isFunction(callback)) {
|
|
1635
1959
|
return;
|
|
1636
1960
|
}
|
|
1637
1961
|
var listeners;
|
|
1638
|
-
if (_this.
|
|
1639
|
-
listeners = _this.
|
|
1962
|
+
if (_this.xUEh[event]) {
|
|
1963
|
+
listeners = _this.xUEh[event];
|
|
1640
1964
|
} else {
|
|
1641
1965
|
listeners = [];
|
|
1642
1966
|
}
|
|
1643
1967
|
listeners.push(callback);
|
|
1644
|
-
_this.
|
|
1645
|
-
Logger$
|
|
1968
|
+
_this.xUEh[event] = listeners;
|
|
1969
|
+
Logger$a.debug("Listeners list: ", _this.xUEh);
|
|
1646
1970
|
});
|
|
1647
1971
|
_defineProperty(this, "unregisterFromEvent", function (event, callback) {
|
|
1648
|
-
if (_this.
|
|
1649
|
-
var listeners = _this.
|
|
1972
|
+
if (_this.xUEh[event]) {
|
|
1973
|
+
var listeners = _this.xUEh[event];
|
|
1650
1974
|
var updatedListeners = [];
|
|
1651
1975
|
for (var index = 0; index < listeners.length; index++) {
|
|
1652
1976
|
var listener = listeners[index];
|
|
@@ -1654,25 +1978,25 @@
|
|
|
1654
1978
|
updatedListeners.push(listener);
|
|
1655
1979
|
}
|
|
1656
1980
|
}
|
|
1657
|
-
_this.
|
|
1981
|
+
_this.xUEh[event] = updatedListeners;
|
|
1658
1982
|
}
|
|
1659
1983
|
});
|
|
1660
|
-
_defineProperty(this, "
|
|
1984
|
+
_defineProperty(this, "Xijx", function (event) {
|
|
1661
1985
|
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "AE";
|
|
1662
1986
|
var key = type + "___" + event.name;
|
|
1663
|
-
_this.
|
|
1987
|
+
_this.hpBl(event, key, type);
|
|
1664
1988
|
});
|
|
1665
|
-
_defineProperty(this, "
|
|
1666
|
-
if (!_this.
|
|
1667
|
-
_this.
|
|
1989
|
+
_defineProperty(this, "hpBl", function (event, key, type) {
|
|
1990
|
+
if (!_this.CQYb) {
|
|
1991
|
+
_this.asOE.push({
|
|
1668
1992
|
event: event,
|
|
1669
1993
|
key: key,
|
|
1670
1994
|
type: type
|
|
1671
1995
|
});
|
|
1672
1996
|
} else {
|
|
1673
|
-
Logger$
|
|
1674
|
-
if (_this.
|
|
1675
|
-
var listeners = _this.
|
|
1997
|
+
Logger$a.debug("Notifying listeners for event: " + event + ", " + key, _this.xUEh);
|
|
1998
|
+
if (_this.xUEh[key]) {
|
|
1999
|
+
var listeners = _this.xUEh[key];
|
|
1676
2000
|
var time = Apxor.getController().getSDKRunningTimeInSec();
|
|
1677
2001
|
for (var index = 0; index < listeners.length; index++) {
|
|
1678
2002
|
var listener = listeners[index];
|
|
@@ -1683,22 +2007,22 @@
|
|
|
1683
2007
|
});
|
|
1684
2008
|
});
|
|
1685
2009
|
|
|
1686
|
-
var Logger$
|
|
2010
|
+
var Logger$b = window.ApxorLogger;
|
|
1687
2011
|
var CE = /*#__PURE__*/function () {
|
|
1688
2012
|
function CE() {
|
|
1689
2013
|
var _this = this;
|
|
1690
2014
|
_classCallCheck(this, CE);
|
|
1691
|
-
_defineProperty(this, "
|
|
1692
|
-
_defineProperty(this, "
|
|
1693
|
-
_defineProperty(this, "
|
|
1694
|
-
_defineProperty(this, "
|
|
1695
|
-
_defineProperty(this, "
|
|
2015
|
+
_defineProperty(this, "CjwR", false);
|
|
2016
|
+
_defineProperty(this, "GcQU", null);
|
|
2017
|
+
_defineProperty(this, "zyPd", getDateInDDMMYYYY());
|
|
2018
|
+
_defineProperty(this, "ZcbS", new EventsListener());
|
|
2019
|
+
_defineProperty(this, "XlUq", Apxor.getSiteId());
|
|
1696
2020
|
_defineProperty(this, "_qeState", {});
|
|
1697
2021
|
_defineProperty(this, "getQeState", function () {
|
|
1698
2022
|
try {
|
|
1699
2023
|
var data = Apxor.getController().getFromStorage(QE_STATE);
|
|
1700
2024
|
if (data) {
|
|
1701
|
-
return JSON.parse(decode(_this.
|
|
2025
|
+
return JSON.parse(decode(_this.XlUq, data));
|
|
1702
2026
|
} else {
|
|
1703
2027
|
_this._qeState = {};
|
|
1704
2028
|
return _this.setQeState();
|
|
@@ -1727,12 +2051,12 @@
|
|
|
1727
2051
|
return _this._qeState;
|
|
1728
2052
|
});
|
|
1729
2053
|
_defineProperty(this, "initialize", function () {
|
|
1730
|
-
if (!_this.
|
|
1731
|
-
_this.
|
|
1732
|
-
_this.
|
|
1733
|
-
_this.
|
|
2054
|
+
if (!_this.CjwR) {
|
|
2055
|
+
_this.CjwR = true;
|
|
2056
|
+
_this.GcQU = new ConfigLookup();
|
|
2057
|
+
_this.ZcbS.initialize();
|
|
1734
2058
|
_this._qeState = _this.getQeState();
|
|
1735
|
-
Logger$
|
|
2059
|
+
Logger$b.info("QE Initialized..");
|
|
1736
2060
|
}
|
|
1737
2061
|
});
|
|
1738
2062
|
/**
|
|
@@ -1741,12 +2065,12 @@
|
|
|
1741
2065
|
* @param config
|
|
1742
2066
|
*/
|
|
1743
2067
|
_defineProperty(this, "parse", function (config) {
|
|
1744
|
-
if (!_this.
|
|
1745
|
-
Logger$
|
|
2068
|
+
if (!_this.Ctkq()) {
|
|
2069
|
+
Logger$b.warn("Must call init first. Unable to proceed");
|
|
1746
2070
|
return;
|
|
1747
2071
|
}
|
|
1748
|
-
_this.
|
|
1749
|
-
_this.
|
|
2072
|
+
_this.GcQU.parse(config);
|
|
2073
|
+
_this.ZcbS.QENl();
|
|
1750
2074
|
});
|
|
1751
2075
|
/**
|
|
1752
2076
|
* Validates all conditions for given config ID
|
|
@@ -1755,22 +2079,22 @@
|
|
|
1755
2079
|
* @param index
|
|
1756
2080
|
*/
|
|
1757
2081
|
_defineProperty(this, "validate", function (id, index) {
|
|
1758
|
-
if (!_this.
|
|
2082
|
+
if (!_this.Ctkq()) {
|
|
1759
2083
|
return;
|
|
1760
2084
|
}
|
|
1761
|
-
_this.
|
|
2085
|
+
_this.GcQU.validate(id, index);
|
|
1762
2086
|
});
|
|
1763
2087
|
_defineProperty(this, "getVariantCode", function (id) {
|
|
1764
|
-
return _this.
|
|
2088
|
+
return _this.GcQU.getVariantCode(id);
|
|
1765
2089
|
});
|
|
1766
2090
|
_defineProperty(this, "validateForTermination", function (id, index) {
|
|
1767
|
-
if (!_this.
|
|
2091
|
+
if (!_this.Ctkq()) {
|
|
1768
2092
|
return;
|
|
1769
2093
|
}
|
|
1770
|
-
_this.
|
|
2094
|
+
_this.GcQU.validateForTermination(id, index);
|
|
1771
2095
|
});
|
|
1772
2096
|
_defineProperty(this, "validateForTerminationAttributes", function (user, session) {
|
|
1773
|
-
return _this.
|
|
2097
|
+
return _this.GcQU.validateForTerminationAttributes(user, session);
|
|
1774
2098
|
});
|
|
1775
2099
|
_defineProperty(this, "updateCount", function (id) {
|
|
1776
2100
|
try {
|
|
@@ -1779,25 +2103,25 @@
|
|
|
1779
2103
|
}
|
|
1780
2104
|
_this.incrementFrequencies(id);
|
|
1781
2105
|
_this.setQeState(id);
|
|
1782
|
-
_this.
|
|
2106
|
+
_this.GcQU.PrTa(id);
|
|
1783
2107
|
} catch (e) {
|
|
1784
2108
|
console.log("Could not update the count config:".concat(e));
|
|
1785
2109
|
}
|
|
1786
2110
|
});
|
|
1787
2111
|
_defineProperty(this, "resetFrequencyCounts", function () {
|
|
1788
|
-
_this.
|
|
2112
|
+
_this.GcQU.resetFrequencyCounts();
|
|
1789
2113
|
});
|
|
1790
2114
|
_defineProperty(this, "getFrequencyCount", function (id) {
|
|
1791
|
-
return _this.
|
|
2115
|
+
return _this.GcQU.getFrequencyCount(id);
|
|
1792
2116
|
});
|
|
1793
2117
|
_defineProperty(this, "registerForEvent", function (event, callback) {
|
|
1794
|
-
_this.
|
|
2118
|
+
_this.ZcbS.Cbqw(event, callback);
|
|
1795
2119
|
});
|
|
1796
2120
|
_defineProperty(this, "unregisterFromEvent", function (event, callback) {
|
|
1797
|
-
_this.
|
|
2121
|
+
_this.ZcbS.unregisterFromEvent(event, callback);
|
|
1798
2122
|
});
|
|
1799
2123
|
_defineProperty(this, "notifyEventListener", function (event) {
|
|
1800
|
-
_this.
|
|
2124
|
+
_this.ZcbS.Xijx(event);
|
|
1801
2125
|
});
|
|
1802
2126
|
/**
|
|
1803
2127
|
* Fetches the config from Server
|
|
@@ -1810,14 +2134,14 @@
|
|
|
1810
2134
|
_defineProperty(this, "fetch", function (type, validateUrl, apiUrl, callback) {
|
|
1811
2135
|
Apxor.getController().fetchConfiguration(type, validateUrl, apiUrl, callback);
|
|
1812
2136
|
});
|
|
1813
|
-
_defineProperty(this, "
|
|
1814
|
-
return _this.
|
|
2137
|
+
_defineProperty(this, "Ctkq", function () {
|
|
2138
|
+
return _this.CjwR;
|
|
1815
2139
|
});
|
|
1816
2140
|
_defineProperty(this, "getCampaignMetaFromQueryEngine", function (campaignId) {
|
|
1817
|
-
return _this.
|
|
2141
|
+
return _this.GcQU.zmqm(campaignId);
|
|
1818
2142
|
});
|
|
1819
|
-
_defineProperty(this, "
|
|
1820
|
-
return _this.
|
|
2143
|
+
_defineProperty(this, "DdpW", function () {
|
|
2144
|
+
return _this.zyPd;
|
|
1821
2145
|
});
|
|
1822
2146
|
if (!CE.instance) {
|
|
1823
2147
|
CE.instance = this;
|
|
@@ -1841,11 +2165,11 @@
|
|
|
1841
2165
|
OVERALL: 0,
|
|
1842
2166
|
DATES: {}
|
|
1843
2167
|
};
|
|
1844
|
-
if (this.
|
|
2168
|
+
if (this.zyPd) this._qeState[id].DATES[this.zyPd] = 0;
|
|
1845
2169
|
this.setQeState(id);
|
|
1846
2170
|
}
|
|
1847
2171
|
} catch (e) {
|
|
1848
|
-
Logger$
|
|
2172
|
+
Logger$b.error("Can not create the frequency count object:" + e);
|
|
1849
2173
|
}
|
|
1850
2174
|
}
|
|
1851
2175
|
}, {
|
|
@@ -1860,12 +2184,12 @@
|
|
|
1860
2184
|
|
|
1861
2185
|
// Increment the DATES count for this particular date by 1. If the date changes reset.
|
|
1862
2186
|
var currentDate = getDateInDDMMYYYY();
|
|
1863
|
-
if (currentDate !== this.
|
|
1864
|
-
this.
|
|
2187
|
+
if (currentDate !== this.zyPd || !(configFrequency.DATES && configFrequency.DATES[currentDate])) {
|
|
2188
|
+
this.zyPd = currentDate;
|
|
1865
2189
|
configFrequency.DATES = {};
|
|
1866
|
-
configFrequency.DATES[this.
|
|
2190
|
+
configFrequency.DATES[this.zyPd] = 0;
|
|
1867
2191
|
}
|
|
1868
|
-
configFrequency.DATES[this.
|
|
2192
|
+
configFrequency.DATES[this.zyPd] = configFrequency.DATES[this.zyPd] + 1;
|
|
1869
2193
|
}
|
|
1870
2194
|
}], [{
|
|
1871
2195
|
key: "getInstance",
|