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