(function () {
  'use strict';
  if (window.__alertDismissBound) {
    return;
  }
  window.__alertDismissBound = true;

  document.addEventListener('click', function (event) {
    var btn = event.target.closest('[data-alert-dismiss]');
    if (!btn) {
      return;
    }
    var alert = btn.closest('[data-alert]');
    if (alert && alert.parentNode) {
      alert.parentNode.removeChild(alert);
    }
  });
})();
