1const u=async(a,r,t)=>{const e=document.querySelector("[data-form='"+a+"']");if(e==null)return;e.classList.add("loading");const n=new FormData(e);let o;o=await d(e.action,n,o);let s=l(e);if(o){if(o.status=="ok"){const c=e.getAttribute("data-redirect-url");if(c){window.location.href=window.location.origin+c,e.classList.remove("loading");return}e.insertAdjacentHTML("afterend",`<div class="g-recaptcha"><div class='pux-form-success-text alert alert-success'>${e.getAttribute("data-success-text")}</div>`),e.remove();return}i(o,s),r&&grecaptcha.reset(),e.classList.remove("loading")}else s.innerHTML=t,s.className="alert alert-danger mb-20";typeof grecaptcha!="undefined"&&grecaptcha.reset()};function i(a,r){const t=a.errors.map(e=>`<div>${e}</div>`).join("");r.innerHTML=t,r.className="alert alert-danger mb-20"}function l(a){let r=a.querySelector("[data-form-errors]");if(r==null){const t=document.createElement("div");t.setAttribute("data-form-errors",""),a.appendChild(t),r=t}return r.innerHTML="",r.className="",r}async function d(a,r,t){return await fetch(a,{method:"POST",body:r}).then(async e=>{try{t=await e.json()}catch(n){n instanceof SyntaxError?console.log("There was a SyntaxError in form post request (404/500?)",n):console.log("There was an error in form post request",n)}return t}).catch(e=>{console.log("There was an error in form post request",e)}),t}export{u as onFormSubmit};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.