import"./hoisted.Y4OMaTyp.js";import"./hoisted.D4VbvckG.js";import"./index.U3IA9L3b.js";document.addEventListener("astro:page-load",()=>{const e=document.querySelector(".single-article-leave-a-comment form");e?.addEventListener("submit",function(n){n.preventDefault();const o=e.querySelector("input[type='email']").value,a=e.querySelector('input[type="text"]').value,c=e.querySelector("textarea").value,r=e.querySelector('input[type="hidden"]').value,i=e.querySelector("button");i.innerText="... posting ...",fetch("https://admin.kelp.agency/wp-json/wp/v2/comments",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({post:r,author_name:a,author_email:o,content:c})}).then(t=>t.json()).then(t=>{console.log("Success:",t),e.innerHTML="Comment submitted!"}).catch(t=>{e.innerHTML=t})})});
