document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll(".ablocks-paypal-button__form").forEach(e=>{const t=e.getAttribute("data-ablocks__error-msg");e.addEventListener("submit",l=>{(function(e){const t=e.querySelector('input[name="business"]').value,l=e.querySelector('input[name="cmd"]').value,n=e.querySelector('input[name="item_name"]').value;return!!(t&&l&&n)})(e)||(l.preventDefault(),function(e,t){let l=e.querySelector(".ablocks-paypal-button__error");l||(l=document.createElement("p"),l.className="ablocks-paypal-button__error",l.style.color="red",l.style.fontSize="14px",l.style.textAlign="center",e.appendChild(l)),l.textContent=t||"Please fill in all required fields.",l.style.display="block"}(e,t))})})});