imports:
  - { resource: ../common.yml }
services:
  _defaults:
    public: true

  oksydan.module.is_themecore.form.settings.general_type:
    class: 'Oksydan\Module\IsThemeCore\Form\Settings\GeneralType'
    parent: "form.type.translatable.aware"
    public: true
    arguments:
      $displayListChoices: '@=service("oksydan.module.is_themecore.form.choice_provider.list_display_choice_provider").getChoices()'
    tags:
      - { name: form.type }

  oksydan.module.is_themecore.form.settings.general_form_data_provider:
    class: 'Oksydan\Module\IsThemeCore\Form\Settings\GeneralFormDataProvider'
    arguments:
      - "@oksydan.module.is_themecore.form.settings.general_configuration"

  oksydan.module.is_themecore.form.settings.general_form_data_handler:
    class: 'PrestaShop\PrestaShop\Core\Form\Handler'
    arguments:
      - "@form.factory"
      - "@prestashop.core.hook.dispatcher"
      - "@oksydan.module.is_themecore.form.settings.general_form_data_provider"
      - 'Oksydan\Module\IsThemeCore\Form\Settings\GeneralType'
      - "General"

  oksydan.module.is_themecore.form.settings.webp_type:
    class: 'Oksydan\Module\IsThemeCore\Form\Settings\WebpType'
    parent: "form.type.translatable.aware"
    public: true
    arguments:
      $convertersList: '@=service("oksydan.module.is_themecore.form.choice_provider.webp_library_choice_provider").getChoices()'
      $convertersListFull: '@=service("oksydan.module.is_themecore.form.choice_provider.webp_library_choice_provider").getChoicesFull()'
      $router: "@router"
    tags:
      - { name: form.type }

  oksydan.module.is_themecore.form.settings.webp_form_data_provider:
    class: 'Oksydan\Module\IsThemeCore\Form\Settings\WebpFormDataProvider'
    arguments:
      - "@oksydan.module.is_themecore.form.settings.webp_configuration"

  oksydan.module.is_themecore.form.settings.webp_form_data_handler:
    class: 'PrestaShop\PrestaShop\Core\Form\Handler'
    arguments:
      - "@form.factory"
      - "@prestashop.core.hook.dispatcher"
      - "@oksydan.module.is_themecore.form.settings.webp_form_data_provider"
      - 'Oksydan\Module\IsThemeCore\Form\Settings\WebpType'
      - "Webp"

  oksydan.module.is_themecore.form.choice_provider.webp_library_choice_provider:
    class: Oksydan\Module\IsThemeCore\Form\ChoiceProvider\WebpLibraryChoiceProvider
    arguments:
      - "@oksydan.module.is_themecore.core.webp.webp_convert_libraries"

  oksydan.module.is_themecore.form.choice_provider.list_display_choice_provider:
    class: Oksydan\Module\IsThemeCore\Form\ChoiceProvider\ListDisplayChoiceProvider
    arguments:
      - "@oksydan.module.is_themecore.core.listing_display.theme_list_display"

  oksydan.module.is_themecore.form.settings.webp_configuration:
    class: Oksydan\Module\IsThemeCore\Form\Settings\WebpConfiguration
    arguments:
      - "@prestashop.adapter.legacy.configuration"

  oksydan.module.is_themecore.form.settings.general_configuration:
    class: Oksydan\Module\IsThemeCore\Form\Settings\GeneralConfiguration
    arguments:
      - "@prestashop.adapter.legacy.configuration"
      - "@prestashop.adapter.shop.context"
      - "@prestashop.adapter.multistore_feature"
