( function( window, document ) {
  function job_seeker_resume_keepFocusInMenu() {
    document.addEventListener( 'keydown', function( e ) {
      const job_seeker_resume_nav = document.querySelector( '.sidenav' );
      if ( ! job_seeker_resume_nav || ! job_seeker_resume_nav.classList.contains( 'open' ) ) {
        return;
      }
      const elements = [...job_seeker_resume_nav.querySelectorAll( 'input, a, button' )],
        job_seeker_resume_lastEl = elements[ elements.length - 1 ],
        job_seeker_resume_firstEl = elements[0],
        job_seeker_resume_activeEl = document.activeElement,
        tabKey = e.keyCode === 9,
        shiftKey = e.shiftKey;
      if ( ! shiftKey && tabKey && job_seeker_resume_lastEl === job_seeker_resume_activeEl ) {
        e.preventDefault();
        job_seeker_resume_firstEl.focus();
      }
      if ( shiftKey && tabKey && job_seeker_resume_firstEl === job_seeker_resume_activeEl ) {
        e.preventDefault();
        job_seeker_resume_lastEl.focus();
      }
    } );
  }
  job_seeker_resume_keepFocusInMenu();
} )( window, document );