/** * Spinner helpers — no dependencies. * * Usage: * showSpinner(container) // replace content with spinner * hideSpinner(container, html) // restore container with new html * spinnerHtml() // returns raw spinner html string (for innerHTML) */ (function () { if (!document.getElementById("spinner-styles")) { const style = document.createElement("style"); style.id = "spinner-styles"; style.textContent = ` .spinner-wrap { display: flex; justify-content: center; align-items: center; padding: 40px 20px; } .spinner { width: 36px; height: 36px; border: 3px solid #e0e0e0; border-top-color: #0077c8; border-radius: 50%; animation: _spin 0.7s linear infinite; flex-shrink: 0; } .spinner.spinner-sm { width: 20px; height: 20px; border-width: 2px; } @keyframes _spin { to { transform: rotate(360deg); } } `; document.head.appendChild(style); } window.spinnerHtml = function (small = false) { return `