shell bypass 403
!function(){"use strict";var e=class{constructor(e){this.form=e,this.anchor=e.querySelector(".wp-block-button"),this.anchor?.classList.add("has-submit-msg"),this.msgElem=document.createElement("div"),this.msgElem.classList.add("o-form-server-response"),this.anchor.appendChild(this.msgElem),this.isVisible=!1,this.visibilityTimeout=void 0,this.visibilityDuration=12e3}toggle(e){this.isVisible=void 0!==e?e:!this.isVisible,this.msgElem.style.display=this.isVisible?"block":"none"}getMsgBySlug(e){return window?.themeisleGutenbergForm?.messages[e]||"Messages are missing!"}pullMsg(e,t){return this.setMsg(this.getMsgBySlug(e),t)}setMsg(e,t=""){switch(this.msgElem.innerHTML=e,this.clean(),t){case"error":this.msgElem.classList.toggle("o-error",!0);break;case"warning":this.msgElem.classList.toggle("o-warning",!0);break;default:this.msgElem.classList.toggle("o-success",!0)}return this}show(e){clearTimeout(this.visibilityTimeout),this.toggle(!0),this.visibilityTimeout=setTimeout((()=>{this.toggle(!1)}),e||this.visibilityDuration)}clean(){this.msgElem.classList.toggle("o-error",!1),this.msgElem.classList.toggle("o-warning",!1),this.msgElem.classList.toggle("o-success",!1)}};let t=null,o="permanent";const i=e=>{const t=[...e?.querySelectorAll(":scope > .otter-form__container .wp-block-themeisle-blocks-form")];return[...e?.querySelectorAll(":scope > .otter-form__container .wp-block-themeisle-blocks-form-input, :scope > .otter-form__container .wp-block-themeisle-blocks-form-textarea, :scope > .otter-form__container .wp-block-themeisle-blocks-form-multiple-choice, :scope > .otter-form__container .wp-block-themeisle-blocks-form-file, :scope > .otter-form__container .wp-block-themeisle-blocks-form-hidden-field, :scope > .otter-form__container .wp-block-themeisle-blocks-form-stripe-field")].filter((e=>!t?.some((t=>t?.contains(e)))))},s=(e,t,o,i,s)=>{e.then((e=>e.json())).then((e=>{const r=e;if("0"===r?.code||"1"===r?.code||r?.success)o?.(r,t);else{let e="";"110"===r.code?t.setMsg(r?.reasons?.join(""),"error").show():"12"===r.code||"13"===r.code?t.pullMsg("invalid-file","error").show():0<r?.displayError?.length?(e=r?.displayError,t.setMsg(e,"error").show()):t.setMsg(r?.reasons?.join(""),"error").show(),i?.(r,t),console.error(`(${r?.code}) ${r?.reasons?.join("")}`)}s?.()}))?.catch((e=>{console.error(e),t.pullMsg("try-again","error").show(),i?.(e,t)}))},r=e=>{const t=document.createElement("span");return t.classList.add("spinner"),{show:()=>{e.appendChild(t)},hide:()=>{e.contains(t)&&e.removeChild(t)}}},n=async(e,n,a)=>{const l=e?.id,c={},{formFieldsData:d}=await(async e=>{const t=[{label:window?.themeisleGutenbergForm?.messages["form-submission"]||"Form submission from",value:window.location.href,metadata:{position:0}}],s=i(e);return s?.forEach(((e,i)=>{const s=e.querySelector(".otter-form-input-label"),r=(null!=s?s:e).querySelector(".otter-form-input-label__label, .otter-form-textarea-label__label");let n,a,l,c=`${(null!=r?r:s)?.innerHTML?.replace(/<[^>]*>?/gm,"")}`,d={};const{id:m}=e,u=e.querySelector('.otter-form-input:not([type="checkbox"], [type="radio"], [type="file"], [type="hidden"]), .otter-form-textarea-input');if(null!==u)n=u?.value,a=u?.type,l=u?.name;else{const s=e.querySelector("select");l=s?.name;const r=e.querySelector('input[type="file"]'),u=e.querySelector('input[type="hidden"]'),h=e.classList.contains("wp-block-themeisle-blocks-form-stripe-field");if(r){const e=r?.files,o=r?.name;for(let s=0;s<e.length;s++)t.push({label:c,value:`${e[s].name} (${(e[s].size/1048576).toFixed(4)} MB)`,type:r.type,id:m,metadata:{version:1,name:e[s].name,size:e[s].size,file:e[s],fieldOptionName:r?.dataset?.fieldOptionName,position:i+1,mappedName:o}})}else if(s)n=[...s.selectedOptions].map((e=>e?.label))?.filter((e=>Boolean(e))).join(", "),a="multiple-choice";else if(u){const e=u?.dataset?.paramName;if(l=u?.name,e){const t=new URLSearchParams(window.location.search);t.has(e)&&(u.value=t.get(e))}u?.value&&(n=u.value,a="hidden")}else if(h)c=`${e.querySelector(".o-stripe-checkout-description h3")?.innerHTML?.replace(/<[^>]*>?/gm,"")}`,n=e.querySelector(".o-stripe-checkout-description h5")?.innerHTML?.replace(/<[^>]*>?/gm,""),a="stripe-field",l=e.name,d={fieldOptionName:e?.dataset?.fieldOptionName},o="temporary";else{const t=e.querySelectorAll(".o-form-multiple-choice-field > label"),o=e.querySelectorAll(".o-form-multiple-choice-field > input");l=o[0]?.name,n=[...t].filter(((e,t)=>o[t]?.checked)).map((e=>e.innerHTML)).join(", "),a="multiple-choice"}}n&&t.push({label:c||"(No label)",value:n,type:a,id:m,metadata:{...d,version:1,position:i+1,mappedName:l}})})),{formFieldsData:t}})(e),m=2>d?.length,u=e?.classList?.contains("has-captcha"),h=l&&window.themeisleGutenberg?.tokens?.[l]?.token,p=r(n);if(m)return n.disabled=!1,void p.hide();const f=function(e){const t=`.protection #${e.id||""}_nonce_field`;return e.querySelector(t)?.value}(e),b=function(e){let t=!0;const o=i(e);for(const e of o)if(e.classList.contains("wp-block-themeisle-blocks-form-input")){const o=e.querySelector("input");if(!o?.checkValidity()){o?.reportValidity(),t=!1;break}}else if(e.classList.contains("wp-block-themeisle-blocks-form-textarea")){const o=e.querySelector("textarea");if(!o?.checkValidity()){o?.reportValidity(),t=!1;break}}else if(e.classList.contains("wp-block-themeisle-blocks-form-multiple-choice")){const o=e.querySelector("select");if(o?.hasAttribute("required")&&!o?.checkValidity()){o?.reportValidity(),t=!1;break}const i=e.querySelectorAll('.o-form-multiple-choice-field input[type="radio"]');if(i?.length&&i[0]?.hasAttribute("required")&&![...i].some((e=>e.checked))){i[0]?.reportValidity(),t=!1;break}const s=e.querySelectorAll('.o-form-multiple-choice-field input[type="checkbox"]');if(s?.length&&s[0]?.hasAttribute("required")&&![...s].some((e=>e.checked))){s[0]?.reportValidity(),t=!1;break}}else if(e.classList.contains("wp-block-themeisle-blocks-form-file")){const o=e.querySelector("input");if(!o?.checkValidity()){o?.reportValidity(),t=!1;break}}return t}(e);if(u&&!h){const e=window.hasOwnProperty("grecaptcha")?"check-captcha":"captcha-not-loaded";a.pullMsg(e,"error").show()}if(!b||u&&!h)n.disabled=!1,n.removeChild(p);else{var w;c.formInputsData=d,h&&(c.token=window.themeisleGutenberg?.tokens?.[l].token),""!==e?.dataset?.emailSubject&&(c.emailSubject=e?.dataset?.emailSubject),e?.dataset?.optionName&&(c.formOption=e?.dataset?.optionName),e?.id&&(c.formId=e?.id),f&&(c.nonceValue=f),c.antiSpamTime=Date.now()-(null!=t?t:Date.now()),c.antiSpamHoneyPot=Boolean(null!==(w=e.querySelector(":scope > .otter-form__container > .protection .o-anti-bot")?.checked)&&void 0!==w&&w),c.postUrl=window.location.href,c.postId=(()=>{const e=document.querySelector("body"),t=e?.classList?.value?.split(" "),o=t?.find((e=>e.includes("postid-")||e.includes("page-id-")));if(o){const e=o.split("-").pop();if(e)return parseInt(e)}return 0})(),e.classList.contains("can-submit-and-subscribe")&&(c.action="submit-subscribe",c.consent=e.querySelector(".otter-form-consent input")?.checked||!1);const i=(window?.themeisleGutenbergForm?.root||window.location.origin+"/wp-json/")+"otter/v1/form/frontend",r=(e=>{const t=new FormData;return e?.payload?.formInputsData?.forEach(((o,i)=>{if("file"===o.type){const s="file__"+o.metadata.position+"_"+i;t.append(s,o.metadata.file),e.payload.formInputsData[i].metadata.file=void 0,e.payload.formInputsData[i].metadata.data=s}})),t.append("form_data",JSON.stringify(e)),t})({handler:"submit",payload:c});try{const t=fetch(i,{method:"POST",headers:{"X-WP-Nonce":window?.themeisleGutenbergForm?.nonce,"O-Form-Save-Mode":o},credentials:"include",body:r});p.show(),s(t,a,((t,o)=>{if(0<t?.frontend_external_confirmation_url?.length)return void window.open(t.frontend_external_confirmation_url,"_blank");const i=t?.submitMessage?t.submitMessage:"Success";o.setMsg(i).show(),e?.querySelector("form")?.reset(),0<t?.redirectLink?.length&&(e.setAttribute("data-redirect",t.redirectLink),setTimeout((()=>{window.location.href=t.redirectLink}),1e3))}),((e,t)=>{}),(()=>{window.themeisleGutenberg?.tokens?.[l].reset&&window.themeisleGutenberg?.tokens?.[l].reset(),n.disabled=!1,p.hide()}))}catch(e){console.error(e),a.pullMsg("try-again","error").show(),n.disabled=!1,p.hide()}}};var a;a=()=>{const o=document.querySelectorAll(".wp-block-themeisle-blocks-form");(e=>{if(!window.hasOwnProperty("grecaptcha")&&window?.themeisleGutenbergForm?.reRecaptchaSitekey){const t=document.createElement("script");t.id="recaptcha",document.body.appendChild(t),t.addEventListener("load",(()=>{const t=setInterval((()=>{window.hasOwnProperty("grecaptcha")&&window.grecaptcha.hasOwnProperty("render")&&(e.forEach((e=>{e?.classList?.contains("has-captcha")&&(e=>{if(!window.hasOwnProperty("grecaptcha"))return;const{id:t}=e,o=document.createElement("div"),i=e.querySelector(".otter-form__container");i?.insertBefore(o,i.lastChild);const s=window.grecaptcha?.render(o,{sitekey:window?.themeisleGutenbergForm?.reRecaptchaSitekey,callback:e=>{window.themeisleGutenberg||(window.themeisleGutenberg={}),window.themeisleGutenberg?.tokens||(window.themeisleGutenberg.tokens={}),window.themeisleGutenberg.tokens[t]={token:e,reset:()=>window.grecaptcha?.reset(s)}},"expired-callback":()=>{window.themeisleGutenberg?.tokens||(window.themeisleGutenberg={},window.themeisleGutenberg.tokens={}),window.themeisleGutenberg.tokens[t]={token:null,reset:()=>null}}})})(e)})),clearInterval(t))}),200)})),t.src=window?.themeisleGutenbergForm?.reRecaptchaAPIURL}})(o),t=Date.now(),o.forEach((t=>{t.classList.contains("can-submit-and-subscribe")&&(e=>{const t=e.querySelector(".otter-form__container"),o=e.querySelector(".wp-block-button"),i=document.createElement("div");i.classList.add("otter-form-consent"),t.insertBefore(i,o);const s=document.createElement("input");s.type="checkbox",s.name="o-consent",s.id="o-consent";const r=document.createElement("label");r.innerHTML=window?.themeisleGutenbergForm?.messages?.privacy||"I have read and agree to the privacy statement.",r.htmlFor="o-consent",i.appendChild(s),i.appendChild(r)})(t);const o=t.querySelector("button"),i=new e(t);if(new URLSearchParams(window.location.search).has("stripe_checkout")){o.disabled=!0;const e=o.innerHTML;o.innerHTML=i.getMsgBySlug("confirmingSubmission");const n=r(o);n.show(),s((async()=>{const e=new URLSearchParams(window.location.search).get("stripe_checkout"),t=(window?.themeisleGutenbergForm?.root||window.location.origin+"/wp-json/")+"otter/v1/form/confirm";return await fetch(t+`?stripe_checkout=${e}`,{method:"GET",credentials:"include"})})(),i,((e,o)=>{const i=e?.submitMessage?e.submitMessage:"Success";o.setMsg(i).show(),0<e?.redirectLink?.length&&(t.setAttribute("data-redirect",e.redirectLink),setTimeout((()=>{window.location.href=e.redirectLink}),1e3))}),(()=>{}),(()=>{o.disabled=!1,n.hide(),o.innerHTML=e}))}t.querySelector(':scope > form > button[type="submit"]')?t?.addEventListener("submit",(e=>{e.preventDefault(),o.disabled||(o.disabled=!0,n(t,o,i))}),!1):o?.addEventListener("click",(e=>{e.preventDefault(),o.disabled||(o.disabled=!0,n(t,o,i))}),!1)})),o.forEach((e=>{i(e).forEach((e=>{const t=e.querySelector("input");if("file"===t?.type){const{maxFilesNumber:e,maxFileSize:o}=t.dataset;t.addEventListener("change",(i=>{let s=!0;const{files:r}=i.target;if(e&&r.length>e&&(t.setCustomValidity(window.themeisleGutenbergForm?.messages?.["too-many-files"]+e),s=!1),s&&o)for(const e of r)if(e.size>1024*o*1024){t.setCustomValidity(window.themeisleGutenbergForm?.messages?.["big-file"]+" "+o+"MB."),s=!1;break}s?t.setCustomValidity(""):(t.reportValidity(),t.value="")}))}}))}))},"undefined"!=typeof document&&("complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",a):a())}();