HEX
Server: Apache
System: Linux elegant-goodall 5.15.0-107-generic #117-Ubuntu SMP Fri Apr 26 12:26:49 UTC 2024 x86_64
User: allende-losmares.com_h71qfkqzx8k (10002)
PHP: 8.0.30
Disabled: opcache_get_status
Upload Files
File: /var/www/vhosts/allende-losmares.com/httpdocs/wp-content/plugins/mailster/assets/js/form.min.js
(function(){"use strict";var e=document.querySelectorAll(".mailster-ajax-form");Array.prototype.forEach.call(e,function(e,r){e.addEventListener("submit",function(r){r.preventDefault();var s=t(e),i,a=e.querySelector(".mailster-form-info");if(!a){a=document.createElement("div");a.classList.add("mailster-form-info")}if("function"===typeof window.mailster_pre_submit){i=window.mailster_pre_submit.call(this,s);if(i===false)return false;if(typeof i!=="undefined")s=i}e.classList.add("loading");e.setAttribute("disabled",true);fetch(e.getAttribute("action"),{method:"POST",headers:{"x-requested-with":"XMLHttpRequest","Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},body:s}).then(function(e){if(e.ok){return e.json()}return Promise.reject(e)}).then(o).catch(function(e){var t;try{t=JSON.parse(e);if(!t.data.html){t={data:{html:"There was an error with the response:<br><code>["+t.data.code+"] "+t.data.message+"</code>"},success:false}}}catch(e){t={data:{html:"There was an error while parsing the response:<br><code>"+e+"</code>"},success:false}}o(t)});function o(t){e.classList.remove("loading");e.classList.remove("has-errors");e.removeAttribute("disabled");e.querySelector(".submit-button").removeAttribute("disabled");[].forEach.call(document.querySelectorAll("div.mailster-wrapper"),function(e){e.classList.remove("error")});a.remove();a.classList.remove("error");a.classList.remove("success");if("function"===typeof window.mailster_post_submit){i=window.mailster_post_submit.call(e[0],t);if(i===false)return false;if(typeof i!=="undefined")t=i}if(t.data.html){a.innerHTML=t.data.html}if((window.pageYOffset||document.documentElement.scrollTop)<e.getBoundingClientRect().top){e.insertBefore(a,e.firstChild)}else{e.insertBefore(a,e.lastChild)}if(t.success){setTimeout(function(){a.classList.add("success")},0);if(t.data.redirect){window.location.href=t.data.redirect;return}if(!e.classList.contains("is-profile")){e.classList.add("completed");e.reset()}}else{if(t.data.fields){e.classList.add("has-errors");Object.keys(t.data.fields).forEach(function(t){var r=e.querySelector(".mailster-"+t+"-wrapper");r&&r.classList.add("error")})}setTimeout(function(){a.classList.add("error")},0)}}})});function t(e){var t={};var r=new FormData(e);for(var s of r.keys()){t[s]=r.getAll(s).slice(-1)[0]}return Object.keys(t).map(function(e){return encodeURIComponent(e)+"="+encodeURIComponent(t[e])}).join("&")}})();