Слежение...

`;
};
window.lantern_popup = lantern_popup;
const displayPopup = (quizURL, alreadySet = false) => {
if (!quizURL || quizURL === "" || (ppfPopupShow & autoTriggerOnExitIntent) || (ppfPopupShow & autoTriggerOnScroll) || (ppfPopupShow & autoTriggerAfterXSeconds)) {
возвращать;
}
ppfPopupShow = true;
document.body.style.position = 'фиксированный';
document.body.style.top = '-${
window.scrollY
}px';
document.body.style.left = '0';
document.body.style.right = '0';
document.querySelector(".ppf-popup").style.display = "блок";
if (!alreadySet) {
document.querySelector(".ppf-popup").innerHTML += '`;
}
};
const hidePopup = () => {
document.querySelector(".ppf-popup").style.display = "нет";
document.querySelector(".ppf-popup").innerHTML = '`;
const scrollY = document.body.style.top;
document.body.style.position = '';
document.body.style.top = '';
document.body.style.left = '';
document.body.style.right = '';
window.scrollTo(0, parseInt(scrollY || '0') * -1);
};
const onExitIntent = (e) => {
if (e.clientY {
if (window.scrollY >= autoTriggerScrollValue) {
document.removeEventListener("прокрутка", onScroll);
updateLocalStorage();
const quizURL = "".replace("#open-quiz-", "");
displayPopup(quizURL, true);
}
};
const onTimeout = () => {
updateLocalStorage();
const quizURL = "".replace("#open-quiz-", "");
displayPopup(quizURL, true);
};
const popupFrequency = "один раз";
const autoTriggerOnExitIntent = false;
const autoTriggerOnScroll = false;
const autoTriggerScrollValue = 250;
const autoTriggerAfterXSeconds = false;
const autoTriggerTimeValue = 10;
const popupShow = localStorage.getItem("ppf-popup-shown");
const popupShownCount = localStorage.getItem("ppf-popup-shown-count");
const popupShownTimestamp = localStorage.getItem("ppf-popup-shown-timestamp");
const popupShownDate = new Date(parseInt(popupShownTimestamp));
const shouldShowPopup =
(popupFrequency === "once" & !popupShown) ||
(popupFrequency === "дважды" & (!popupShow || popupShownCount `;
}
document.addEventListener("mouseleave", onExitIntent);
}
if (shouldShowPopup & & autoTriggerOnScroll & autoTriggerScrollValue >= 0) {
const quizURL = "".replace("#open-quiz-", "");
if ( документ?. querySelector(".ppf-popup")?. innerHTML) {
document.querySelector(".ppf-popup").innerHTML += '`;
}
document.addEventListener("прокрутка", onScroll);
}
if (shouldShowPopup & & autoTriggerAfterXSeconds & autoTriggerTimeValue >= 0) {
const quizURL = "".replace("#open-quiz-", "");
if ( документ?. querySelector(".ppf-popup")?. innerHTML) {
document.querySelector(".ppf-popup").innerHTML += '`;
}
setTimeout(onTimeout, autoTriggerTimeValue * 1000);
}
document.addEventListener("щелчок", (e) => {
let targetElement = e.target;
while (targetElement & targetElement !== document) {
if (targetElement.tagName === 'A' & targetElement.getAttribute("href")?. startsWith("#open-quiz-")) {
e.preventDefault();
const quizURL = targetElement.getAttribute("href").replace("#open-quiz-", "");
displayPopup(quizURL);
возвращать;
}
if (targetElement.classList?. contains("ppf-popup-close")) {
hidePopup();
возвращать;
}
targetElement = targetElement.parentNode;
}
});
});