/**
 * Leadite SLA Notice dismissal logic.
 */
(function () {
    var notice = document.getElementById('leadite-sla-notice');
    if (!notice) return;
    notice.addEventListener('click', function (e) {
        if (e.target.classList.contains('notice-dismiss') || e.target.closest('.notice-dismiss')) {
            fetch(leaditeAdmin.ajaxUrl, {
                method: 'POST',
                headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
                body: 'action=leadite_dismiss_sla_notice&security=' + encodeURIComponent(leaditeAdmin.slaNoticeNonce)
            });
        }
    });
})();