const $createABusinessAccount = $('.account-form');
const $editBusinessAccount = $('.page-edit-business-account');
const cancelBtnClass = '.btn-cancel-change';
const submitBtnClass = '.btn-submit';
const accountForm = '.account-form';
const $btnDelete = $('.btn-delete');

function initEditAccountHubForm() {
  if (!$editBusinessAccount.length) {
    return;
  }

  $btnDelete.on('click', () => {
    Wick.LeaveEvent.removeLeaveEvent();
  });
}

function initBusinessAccountForm() {
  if (!$createABusinessAccount.length) {
    return;
  }

  initEditAccountHubForm();
  Wick.LeaveEvent.bindEvent(accountForm, cancelBtnClass, submitBtnClass);
}

$(document).ready(function () {
  initBusinessAccountForm();
});
