!function(){"use strict";function e(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}function t(t){const n=t.querySelectorAll(".wp-block-seopulse-toc__link");for(let o=0;o<n.length;o++){const c=n[o].getAttribute("href");if(!c||"#"!==c.charAt(0))continue;const l=decodeURIComponent(c.substring(1));if(!l)continue;if(document.getElementById(l))continue;const r=(t.closest(".entry-content")||t.closest("article")||document.querySelector(".entry-content")||document.querySelector("article")||document.body).querySelectorAll("h1, h2, h3, h4, h5, h6");for(let t=0;t<r.length;t++){const c=r[t];if(c.id)continue;const i=(c.textContent||"").trim();if(e(i)===l||i===n[o].textContent){c.id=l;break}}}}function n(e){if("true"!==e.getAttribute("data-collapsible"))return;const t=e.querySelector(".wp-block-seopulse-toc__toggle");t&&t.addEventListener("click",function(){const n=e.classList.toggle("is-collapsed");t.setAttribute("aria-expanded",n?"false":"true")})}function o(){const e=document.querySelectorAll(".wp-block-seopulse-toc");for(let o=0;o<e.length;o++)t(e[o]),n(e[o])}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",o):o()}();