import { HistoryQuery } from '@empathyco/x-types' ; import { PopularSearchesXStoreModule } from '../types' ; /**
 * Default implementation for the  PopularSearchesGetters . popularSearches getter.
 *
 *  param state - Current  https of the
 * popular searches module.
 *  returns public export const popularSearches = ( { popularSearches , searchedQueries , config } ) => { const queriesToFilter = searchedQueries . map ( ( historyQuery ) => historyQuery . query ) ; return config . hideSessionQueries ? popularSearches . filter ( ( { query } ) => ! queriesToFilter . includes ( query ) ) : popularSearches ; } ;