import { FieldTypeFactory, ComponentTypeFactory } from '@sentecacommerce-theme/base';
import { ComponentTypeEnum, AggregationTypeEnum } from '@sentecacommerce-theme/lib';
var Aggregate = {
  label: FieldTypeFactory.text({
    required: true
  }),
  aggregationType: FieldTypeFactory.enum({
    required: true,
    of: [{
      value: AggregationTypeEnum.Terms,
      label: 'Terms'
    }, {
      value: AggregationTypeEnum.Ranges,
      label: 'Ranges'
    }, {
      value: AggregationTypeEnum.Stats,
      label: 'Stats'
    }]
  }),
  aggregationDefinition: FieldTypeFactory.text({
    required: true
  }),
  filterDefinition: FieldTypeFactory.text({
    required: true
  }),
  order: FieldTypeFactory.number({
    required: true
  }),
  collapsed: FieldTypeFactory.boolean({
    defaultValue: false
  }),
  component: FieldTypeFactory.enum({
    required: true,
    of: [{
      value: ComponentTypeEnum.Autocomplete,
      label: 'Autocomplete'
    }, {
      value: ComponentTypeEnum.Checkbox,
      label: 'Checkbox'
    }, {
      value: ComponentTypeEnum.Color,
      label: 'Color'
    }, {
      value: ComponentTypeEnum.Dropdown,
      label: 'Dropdown'
    }, {
      value: ComponentTypeEnum.Text,
      label: 'Text'
    }, {
      value: ComponentTypeEnum.TextWithLink,
      label: 'Text with Link'
    }, {
      value: ComponentTypeEnum.AttributeCheckbox,
      label: 'Attribute Checkbox'
    }]
  })
};
export var ListingPageType = ComponentTypeFactory.create('ListingPage', {
  seoAggregates: Aggregate,
  categoryTreeConfig: Aggregate,
  aggregates: FieldTypeFactory.list({
    of: Aggregate
  }),
  sortOptions: FieldTypeFactory.list({
    of: {
      key: FieldTypeFactory.text({
        required: true
      }),
      label: FieldTypeFactory.text({
        required: true
      })
    }
  }),
  defaultSortKey: FieldTypeFactory.text({
    required: true
  }),
  labels: {
    noMatchingItems: FieldTypeFactory.text(),
    seeMore: FieldTypeFactory.text(),
    seeLess: FieldTypeFactory.text(),
    resetAll: FieldTypeFactory.text(),
    clearAllFilters: FieldTypeFactory.text(),
    filters: FieldTypeFactory.text(),
    showResults: FieldTypeFactory.text(),
    show: FieldTypeFactory.text(),
    results: FieldTypeFactory.text(),
    sortBy: FieldTypeFactory.text()
  },
  productsPerPage: FieldTypeFactory.number({
    required: false,
    defaultValue: 24
  })
});
//# sourceMappingURL=listingPage.type.js.map