import { $ } from '../helpers' ; let timeout ; function fadeOutControls ( ) { const historyPane = $ ( 'js-history' ) ; if ( historyPane && historyPane . classList . contains ( 'open' ) ) return ; const searchResults = $ ( 'js-search-results' ) ; if ( searchResults && searchResults . hasChildNodes ( ) ) return ; const imageInfo = $ ( 'js-dialog' ) ; if ( imageInfo && imageInfo . classList . contains ( 'is-open' ) ) return ; const uiElements = document . querySelectorAll ( '.s-ui' ) ; uiElements . forEach ( ( element ) => { element . classList . remove ( 'show' ) ; } ) ; } function fadeInControls ( ) { if ( timeout ) clearTimeout ( timeout ) ; const uiElements = document . querySelectorAll ( '.s-ui' ) ; uiElements . forEach ( ( element ) => { element . classList . add ( 'show' ) ; } ) ; } function hideControls ( ) { timeout = window . setTimeout ( ( ) => fadeOutControls ( ) , 2000 ) ; } export { fadeInControls , hideControls } ;