function g(){document.querySelectorAll("[data-seo-input]").forEach(n=>{const s=n.dataset.seoInput,c=()=>{const o=(n.value||"").trim();if(document.querySelectorAll(`[data-seo-preview="${s}"]`).forEach(t=>{t.textContent=o||t.dataset.seoEmpty||""}),s==="og_image"){const t=document.querySelector('[data-seo-preview-img="og_image"]');t&&(o?(t.style.backgroundImage=`url('${o}')`,t.style.backgroundSize="cover",t.style.backgroundPosition="center",t.textContent=""):(t.style.backgroundImage="",t.textContent="No OG image set"))}const e=document.querySelector(`[data-seo-counter="${s}"]`);if(e){const t=o.length;e.textContent=String(t);const i=e.dataset.target;if(i){const[r,l]=i.split("-").map(Number),a=t>=r&&t<=l;e.classList.toggle("text-ink-500",a),e.classList.toggle("text-accent-amber",!a&&t>0),e.classList.toggle("font-semibold",!a&&t>0)}}};n.addEventListener("input",c),c()})}export{g as default};
