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