(()=>{const t=document.currentScript?.dataset.nonce;document.addEventListener("DOMContentLoaded",(()=>{document.querySelectorAll(".toggle-status").forEach((e=>{e.addEventListener("change",(function(){const n=this.getAttribute("data-post-id"),o=this.checked?"publish":"draft",s=e.closest("td")?.querySelector(".status-label");s.textContent="Updating...",fetch(ajaxurl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:"action=convertforce_toggle_post_status&post_id="+n+"&status="+o+"&nonce="+t}).then((t=>t.json())).then((t=>{t.success?s.textContent="publish"===o?"Published":"Draft":s.textContent="Error"}))}))}))}))})();