مرحبا… أعمل بسكريبت يقوم باعتراض كل أجوبة الموقع على أساس أن يقوم بتحويلي إذا ظهر جواب واحد فقط، ولكن لم يعمل… أرجو المساعدة
(function() {
‘use strict’;
var _0x11a5fd = false;
var _0x4715ac = document.querySelector(".col-12.justify-content-center.text-center.pb-2");
if (document.querySelector(“a.h6”) !== null && sessionStorage.waitme == “true”) {Q
document.title = document.querySelector(“a.h6”).innerText.toUpperCase();
}
if (_0x4715ac !== null) {
_0x4715ac.innerHTML = “<h5 class=“col-12 alert alert-warning” style=‘display:none;’ id=‘sloer’>”;
}
if (window.location.href.toLowerCase().indexOf(“appointment/slotselection”) !== -1 ) {
function _0x5b2c7d() {
if (_0x11a5fd) {
return;
}
var _0x38d855 = XMLHttpRequest.prototype.open;
var _0x61bb62 = XMLHttpRequest.prototype.send;
XMLHttpRequest.prototype.open = function (_0x397046, _0x1ba43b) {
this._url = _0x1ba43b;
return _0x38d855.apply(this, arguments);
};
XMLHttpRequest.prototype.send = function () {
this.addEventListener(“readystatechange”, function () {
if (this.readyState === 4) {
if (this._url.includes(“appointment/GetAvailableSlotsByDate”) && this.status !== 200) {
const _0x1323c1 = {
color: “#bf8f2b”,
display: “block”
};
$("#sloer").text(“Heures Erreur " + this.status).css(_0x1323c1);
;
setTimeout(() => $(”#sloer").css(“display”, “none”), 5000);
}
}
});
return _0x61bb62.apply(this, arguments);
};
_0x11a5fd = true;
}
_0x5b2c7d();
var _0x30e077;
function _0x484512() {
$.ajax({
“url”: “/MAR/Appointment/PendingAppointment”,
“crossDomain”: true,
“method”: “post”,
“headers”: {
“accept”: “text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.7”,
“accept-language”: “es-ES”,
“cache-control”: “max-age=0”,
“priority”: “u=0, i”,
“upgrade-insecure-requests”: “1”
},
“contentType”: “application/x-www-form-urlencoded”,
“data”: {
“__RequestVerificationToken”: $(“input:hidden[name=”__RequestVerificationToken"]").val()
}
}).done(function (_0x4c80f7) {});
}
_0x484512();
$(“form”).first().on(“submit”, function (_0x5783af) {
_0x5783af.preventDefault();
clearInterval(_0x30e077);
var _0x148932 = _0x35715a($(this));
var _0x4bf7d7 = new URLSearchParams(_0x148932).toString();
fetch(document.querySelector(“form”).action, {
“method”: “POST”,
“headers”: {
“Accept”: “text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.7”,
“Content-Type”: “application/x-www-form-urlencoded”,
“Cache-Control”: “max-age=0”,
“Upgrade-Insecure-Requests”: “1”
},
“body”: _0x4bf7d7,
“redirect”:“manual”,
“credentials”: “include”
}).then(function (_0x106b93) {
HideLoader();
if (_0x106b93.status === 502 || _0x106b93.status === 503 || _0x106b93.status === 504) {
$("#sloer").text(“Fixement D’erreur Auto”).css({
“color”: “#bf8f2b”,
“display”: “block”
});
setTimeout(() => $("#sloer").css(“display”, “none”), 5000);
$("#btnSubmit").click();
_0x30e077 = setInterval(_0x2b68df, 1000);
} else {
if (_0x106b93.url.toLowerCase().includes("/appointment/applicantselection?data=")) {
$("#sloer").text(“Redirect vers Formulaire”).css({
“color”: “#2196F3”,
“display”: “block”
});
setTimeout(() => $("#sloer").css(“display”, “none”), 5000);
window.location.href = _0x106b93.url;
} else {
if (_0x106b93.url.toLowerCase().includes("/account/login")) {
$("#sloer").text(“Page Expirée”).css(“display”, “block”);
setTimeout(() => $("#sloer").css(“display”, “none”), 5000);
// window.location.href = _0x106b93.url;
} else {
if (_0x106b93.url.includes(“F1F%2FeJJE%2FITIGxN4cc%2Fo3fnDqGFHyaoofR%2Flj9Azn6ZPdIdI2u%2FYgTxX5%2B7DipGhRjvvLRnymTP%2BV49EWNqj3w”)) {
HideLoader();
const _0x2976a4 = {
color: “red”,
display: “block”
};
$("#sloer").text(“Your previous payment request is still pending. Please complete the payment”).css(_0x2976a4);
} else {
if (_0x106b93.url.includes(“pendingappointment?err=%2FY9TiTbfwUOn1x0ikWGpKA”)) {
HideLoader();
$("#sloer").text(“You have initiated an appointment from your account or IP address which is not yet completed”).css({
“color”: “#bf8f2b”,
“display”: “block”
});
} else {
HideLoader();
_0x30e077 = setInterval(_0x2b68df, 1000);
const _0x13763e = {
color: “#bf8f2b”,
display: “block”
};
$("#sloer").text(“The appointment date and time you selected are already taken by other applicants. Please choose a different date and time”).css(_0x13763e);
setTimeout(() => $("#sloer").css(“display”, “none”), 5000);
}
}
}
}
}
})[“catch”](function (_0x221f60) {
HideLoader();
_0x30e077 = setInterval(_0x2b68df, 1000);
$("#sloer").text(“The appointment date and time you selected are already taken by other applicants. Please choose a different date and time”).css({
“color”: “#bf8f2b”,
“display”: “block”
});
setTimeout(() => $("#sloer").css(“display”, “none”), 5000);
});
});
function _0x2b68df() {
const _0x144f64 = document.getElementById("dates-display");
const _0x180450 = document.querySelector(".navbar.navbar-expand-xl.z-index-9.navbar-divider");
_0x144f64?.["remove"]();
_0x180450.insertAdjacentHTML("afterend", "\n <div id=\"dates-display\" style=\"width:100%;padding:10px 0;background:#f8f9fa;white-space:nowrap;overflow-x:auto;text-align:center\">\n " + _0x45b95f.flatMap(_0xb80681 => _0xb80681.Date).map(_0x4a6632 => "<span style=\"display:inline-block;border:2px solid #2196F3;border-radius:5px;padding:3px 8px;margin:0 5px;color:#2196F3;font-weight:bold\">" + _0x4a6632 + "</span>").join('') + "\n </div>");
}
_0x2b68df();
_0x30e077 = setInterval(_0x2b68df, 1000);
}
function _0x35715a(_0x4576ed) {
var _0xeab382 = _0x4576ed.serializeArray();
var _0x4174c4 = {};
$.map(_0xeab382, function (_0x2dee80) {
_0x4174c4[_0x2dee80.name] = _0x2dee80.value;
});
return _0x4174c4;
}
})();