$(document).ready(function() {
  const checkconfirmationDelete = document.getElementById('ftr-confirmationDelete');
  const btnDeleteAccountConfirmation = document.querySelector('.ftr-js-deleteAccount-confirmation');

  if(btnDeleteAccountConfirmation){
    btnDeleteAccountConfirmation.onclick = function(event) {
      if(checkconfirmationDelete.checked == true){
        var $this = $(this),
          messages = $this.data('messages'),
          value = $this.val() === '1' ? 0 : 1;

        $.ajax({
          url: 'index.php?route=account/account/deleteAccount',
          type: 'POST',
          success: function (data) {
            if(data.success){
              console.log(data);
              document.location.reload();
            }
          }
        });
      }else{
        notificationMsg( 'Para prosseguir é necessário concordar com as condições.' , 'warning');
      }
    }
  }



});
