text: //! Accordion
  const accordion = document.querySelector('.accordion-1');
  if (accordion) {
     for (let index = 1; index < 3; index++) {
        const accItems = accordion.querySelectorAll(`.accordion-item-${index}`);
        accItems.forEach(item => {
           item.addEventListener('click', e => {
              if (e.target.className == `accordion-title-${index}`) {
                 const accInner = item.querySelector(`.accordion-${index + 1}`);
                 accInner.classList.toggle('hidden');
              }
              if (e.target.dataset.id == 'subject') {
                 const modal = document.querySelector('[data-id="subject-modal"]'),
                    cancelBtn = modal.querySelector('.delete-btn');
                 modal.classList.remove('hidden');
                 cancelBtn.onclick = e => {
                    modal.classList.add('hidden');
                 }
              }
              if (e.target.dataset.id == 'subjectcat') {
                 const modal = document.querySelector('[data-id="subjectcat-modal"]'),
                    cancelBtn = modal.querySelector('.delete-btn'),
                    subjectInput = modal.querySelector('[data-id="subject"]');
                 modal.classList.remove('hidden');
                 subjectInput.value = e.target.dataset.subject;
                 cancelBtn.onclick = e => {
                    modal.classList.add('hidden');
                 }
              }
              if (e.target.dataset.id == 'material') {
                 const modal = document.querySelector('[data-id="material-modal"]'),
                    cancelBtn = modal.querySelector('.delete-btn'),
                    subjectInput = modal.querySelector('[data-id="subjectcat"]');
                 modal.classList.remove('hidden');
                 subjectInput.value = e.target.dataset.subjectcat;
                 cancelBtn.onclick = e => {
                    modal.classList.add('hidden');
                 }
              }
           })
        });
     }
     accordion.addEventListener('click', e => {
        if (e.target.classList.contains('accordion-link--delete')) {
           const modal = document.querySelector('[data-id="delete-modal"]'),
              cancelBtn = modal.querySelector('.cancel--btn'),
              deleteBtn = modal.querySelector('.delete-btn'),
              type = e.target.dataset.type,
              id = e.target.dataset.id,
              route = deleteBtn.href;
  
           deleteBtn.href = `${route}?type=${type}&action=delete&id=${id}`;
  
           modal.classList.remove('hidden');
           cancelBtn.onclick = e => {
              modal.classList.add('hidden');
           }
        }
        if (e.target.classList.contains('accordion-link--edit')) {
           const type = e.target.dataset.type,
              id = e.target.dataset.id,
              modal = document.querySelector(`[data-id="edit-modal"]`),
              cancelBtn = modal.querySelector('.delete-btn'),
              typeInput = modal.querySelector('#type'),
              idInput = modal.querySelector('#id');
  
           typeInput.value = type;
           idInput.value = id;
  
           modal.classList.remove('hidden');
           cancelBtn.onclick = e => {
              modal.classList.add('hidden');
           }
        }
     })
  }