<script>
    document.querySelectorAll('#settings-form-6in1 .close-settings').forEach(button => {
        button.addEventListener('click', () => {
            let form = button.closest('.sports-plugin-settings-form');
            form.classList.remove('active');

            // Remove the shortcode parameter from the URL
            let newUrl = new URL(window.location);
            newUrl.searchParams.delete('shortcode');
            window.history.pushState({}, '', newUrl);
        });
    });
</script>