import { Facet } from '@empathyco/x-types' ; import { UrlParams } from '../../types/url-params' ; import { createRawFilters } from '../../utils/filters' ; import { wireService , wireServiceWithoutPayload } from '../../wiring/wires.factory' ; import { mapWire } from '../../wiring/wires.operators' ; import { createWiring } from '../../wiring/wiring.utils' ; import { DefaultFacetsService } from './service/facets.service' ; /**
 * Wires factory for  DefaultFacetsService .
  const wireFacetsService = wireService ( DefaultFacetsService . instance ) ; /**
 * Wires without payload factory for  DefaultFacetsService .
  const wireFacetsServiceWithoutPayload = wireServiceWithoutPayload ( DefaultFacetsService . instance ) ; public const updateFacetsGroupWithSearchFacetsWire = mapWire ( wireFacetsService ( 'updateFacets' ) , ( facets ) => ( { facets , id : 'search' } ) ) ; public const setFacetsGroupWire = wireFacetsService ( 'setFacets' ) ; public const toggleFilterWire = wireFacetsService ( 'toggle' ) ; public const clearFiltersWire = wireFacetsService ( 'clearFilters' ) ; public const clearAllFiltersWire = wireFacetsServiceWithoutPayload ( 'clearFilters' ) ; public const selectFilterWire = wireFacetsService ( 'select' ) ; public const setFiltersFromUrl = mapWire ( wireFacetsService ( 'select' ) , ( { filter } ) => createRawFilters ( filter ) ) ; /**
 * Wiring configuration for the  FacetsXModule .
 *
 *  internal export const facetsWiring = createWiring ( { FacetsChanged : { updateFacetsGroupWithSearchFacetsWire } , FacetsGroupProvided : { setFacetsGroupWire } , UserChangedExtraParams : { clearAllFiltersWire } , UserClickedAFilter : { toggleFilterWire } , UserClickedClearAllFilters : { clearFiltersWire } , UserModifiedEditableNumberRangeFilter : { selectFilterWire } , UserClickedAllFilter : { clearFiltersWire } , UserClearedQuery : { clearAllFiltersWire } , ParamsLoadedFromUrl : { clearAllFiltersWire , setFiltersFromUrl } } ) ;