jQuery(document).on('click', 'input[id^="sb-day-enable-"]', function () {
    var isWorkday = jQuery(this).is(':checked');
    if (isWorkday) {
        jQuery(this).val(1);
        jQuery(this).closest('.form-table').find('.dependant').show()
    } else {
        jQuery(this).val(0);
        jQuery(this).closest('.form-table').find('.dependant').hide()
    }
});

function copyText() {
    const textarea = document.getElementById("debug-log-output");
    const text = textarea.value;

    if (navigator.clipboard) {
        navigator.clipboard.writeText(text)
            .then(() => alert("✅ Text copied!"))
            .catch(() => alert("❌ Error while copying"));
    }
}