services:
    _defaults:
        autoconfigure: true

    _instanceof:
        Contao\CoreBundle\Framework\FrameworkAwareInterface:
            calls:
                - [setFramework, ['@contao.framework']]

        Symfony\Bundle\FrameworkBundle\Controller\AbstractController:
            calls:
                - [setContainer, ['@Psr\Container\ContainerInterface']]

        Symfony\Component\DependencyInjection\ContainerAwareInterface:
            calls:
                - [setContainer, ['@service_container']]

    Contao\CoreBundle\Framework\ContaoFramework: '@contao.framework'
    Contao\CoreBundle\Image\ImageFactoryInterface: '@contao.image.image_factory'
    Contao\CoreBundle\Image\PictureFactoryInterface: '@contao.image.picture_factory'
    Contao\CoreBundle\Picker\PickerBuilderInterface: '@contao.picker.builder'
    Contao\CoreBundle\Config\ResourceFinderInterface: '@contao.resource_finder'
    Contao\CoreBundle\Routing\ScopeMatcher: '@contao.routing.scope_matcher'
    Contao\CoreBundle\Security\Authentication\Token\TokenChecker: '@contao.security.token_checker'
    Contao\CoreBundle\Security\TwoFactor\Authenticator: '@contao.security.two_factor.authenticator'
    Contao\CoreBundle\Security\TwoFactor\TrustedDeviceManager: '@contao.security.two_factor.trusted_device_manager'
    Contao\CoreBundle\Slug\Slug: '@contao.slug'

    # Backwards compatibility
    Contao\CoreBundle\Framework\ContaoFrameworkInterface: '@contao.framework'

    contao.assets.assets_context:
        class: Contao\CoreBundle\Asset\ContaoContext
        arguments:
            - '@request_stack'
            - '@contao.framework'
            - staticPlugins
            - '%kernel.debug%'
        public: true

    contao.assets.files_context:
        class: Contao\CoreBundle\Asset\ContaoContext
        arguments:
            - '@request_stack'
            - '@contao.framework'
            - staticFiles
            - '%kernel.debug%'
        public: true

    contao.cache.clear_internal:
        class: Contao\CoreBundle\Cache\ContaoCacheClearer
        arguments:
            - '@filesystem'
        public: true

    contao.cache.warm_internal:
        class: Contao\CoreBundle\Cache\ContaoCacheWarmer
        arguments:
            - '@filesystem'
            - '@contao.resource_finder'
            - '@contao.resource_locator'
            - '%kernel.project_dir%'
            - '@database_connection'
            - '@contao.framework'
            - '@Contao\CoreBundle\Intl\Locales'
        public: true

    Contao\CoreBundle\Controller\BackendController: ~

    Contao\CoreBundle\Controller\BackendCsvImportController:
        arguments:
            - '@contao.framework'
            - '@database_connection'
            - '@request_stack'
            - '@translator'
            - '%kernel.project_dir%'
        public: true

    Contao\CoreBundle\Controller\BackendPreviewController:
        arguments:
            - '%contao.preview_script%'
            - '@contao.security.frontend_preview_authenticator'
            - '@event_dispatcher'
            - '@security.authorization_checker'
        tags:
            - controller.service_arguments

    Contao\CoreBundle\Controller\BackendPreviewSwitchController:
        arguments:
            - '@contao.security.frontend_preview_authenticator'
            - '@contao.security.token_checker'
            - '@database_connection'
            - '@security.helper'
            - '@twig'
            - '@router'
            - '@Contao\CoreBundle\Csrf\ContaoCsrfTokenManager'
            - '%contao.csrf_token_name%'
        tags:
            - controller.service_arguments

    # Backwards compatibility
    contao.controller.backend_csv_import:
        alias: Contao\CoreBundle\Controller\BackendCsvImportController
        # TODO: re-enable this as soon as we are on Symfony 5 only
        # deprecated:
        #     package: contao/core-bundle
        #     version: 4.9
        #     message: Using the "%alias_id%" service ID has been deprecated and will no longer work in Contao 5.0. Please use "Contao\CoreBundle\Controller\BackendCsvImportController" instead.
        public: true

    Contao\CoreBundle\Controller\ContentElement\MarkdownController:
        tags:
            - { name: contao.content_element, category: texts }

    Contao\CoreBundle\Controller\FaviconController:
        arguments:
            - '@contao.framework'
            - '%kernel.project_dir%'
            - '@?fos_http_cache.http.symfony_response_tagger'
        tags:
            - controller.service_arguments

    Contao\CoreBundle\Controller\FrontendController:
        tags:
            - controller.service_arguments

    Contao\CoreBundle\Controller\FrontendModule\TwoFactorController:
        tags:
            - { name: contao.frontend_module, category: user }

    Contao\CoreBundle\Controller\ImagesController:
        arguments:
            - '@contao.image.image_factory'
            - '@contao.image.resizer'
            - '%contao.image.target_dir%'
            - '@?filesystem'
        tags:
            - controller.service_arguments

    Contao\CoreBundle\Controller\InitializeController:
        arguments:
            - '@contao.framework'
            - '@request_stack'
            - '@event_dispatcher'
            - '@http_kernel'
            - '@kernel'
        tags:
            - controller.service_arguments

    # Backwards compatibility
    contao.controller.images:
        alias: Contao\CoreBundle\Controller\ImagesController
        # TODO: re-enable this as soon as we are on Symfony 5 only
        # deprecated:
        #     package: contao/core-bundle
        #     version: 4.9
        #     message: Using the "%alias_id%" service ID has been deprecated and will no longer work in Contao 5.0. Please use "Contao\CoreBundle\Controller\ImagesController" instead.
        public: true

    Contao\CoreBundle\Controller\InsertTagsController:
        arguments:
            - '@contao.framework'
        tags:
            - controller.service_arguments

    # Backwards compatibility
    contao.controller.insert_tags:
        alias: Contao\CoreBundle\Controller\InsertTagsController
        # TODO: re-enable this as soon as we are on Symfony 5 only
        # deprecated:
        #     package: contao/core-bundle
        #     version: 4.9
        #     message: Using the "%alias_id%" service ID has been deprecated and will no longer work in Contao 5.0. Please use "Contao\CoreBundle\Controller\InsertTagsController" instead.
        public: true

    Contao\CoreBundle\Controller\RobotsTxtController:
        arguments:
            - '@contao.framework'
            - '@event_dispatcher'
        tags:
            - controller.service_arguments

    Contao\CoreBundle\Controller\SitemapController:
        arguments:
            - '@Contao\CoreBundle\Routing\Page\PageRegistry'
        tags:
            - controller.service_arguments
            - container.service_subscriber

    contao.controller_resolver:
        class: Contao\CoreBundle\HttpKernel\ControllerResolver
        decorates: controller_resolver
        arguments:
            - '@contao.controller_resolver.inner'
            - '@contao.fragment.registry'

    contao.cors.website_roots_config_provider:
        class: Contao\CoreBundle\Cors\WebsiteRootsConfigProvider
        arguments:
            - '@database_connection'
        tags:
            - nelmio_cors.options_provider

    contao.crawl.escargot_factory:
        class: Contao\CoreBundle\Crawl\Escargot\Factory
        arguments:
            - '@database_connection'
            - '@contao.framework'
        public: true

    contao.crawl.escargot_subscriber.broken_link_checker:
        class: Contao\CoreBundle\Crawl\Escargot\Subscriber\BrokenLinkCheckerSubscriber
        arguments:
            - '@translator'
        tags:
            - contao.escargot_subscriber

    contao.crawl.escargot_subscriber.search_index:
        class: Contao\CoreBundle\Crawl\Escargot\Subscriber\SearchIndexSubscriber
        arguments:
            - '@contao.search.indexer'
            - '@translator'
        tags:
            - contao.escargot_subscriber

    Contao\CoreBundle\Cron\Cron:
        arguments:
            - '@Contao\CoreBundle\Repository\CronJobRepository'
            - '@doctrine.orm.entity_manager'
            - '@?logger'
        public: true

    Contao\CoreBundle\Cron\LegacyCron:
        arguments:
            - '@contao.framework'

    Contao\CoreBundle\Cron\PurgeExpiredDataCron:
        arguments:
            - '@contao.framework'
            - '@database_connection'

    Contao\CoreBundle\Csrf\ContaoCsrfTokenManager:
        arguments:
            - '@request_stack'
            - '%contao.csrf_cookie_prefix%'
            - '@security.csrf.token_generator'
            - '@contao.csrf.token_storage'
        public: true
        tags:
            - { name: kernel.reset, method: reset }

    # Backwards compatibility
    contao.csrf.token_manager:
        alias: Contao\CoreBundle\Csrf\ContaoCsrfTokenManager
        deprecated: Using the "%alias_id%" service ID has been deprecated and will no longer work in Contao 5.0. Please use "Contao\CoreBundle\Csrf\ContaoCsrfTokenManager" instead.
        public: true

    contao.csrf.token_storage:
        class: Contao\CoreBundle\Csrf\MemoryTokenStorage
        tags:
            - { name: kernel.reset, method: reset }

    contao.data_collector:
        class: Contao\CoreBundle\DataCollector\ContaoDataCollector
        arguments:
            - '%contao.legacy_routing%'
            - '%kernel.project_dir%'
            - '%contao.prepend_locale%'
            - '%contao.url_suffix%'
        tags:
            - { name: data_collector, template: '@ContaoCore/Collector/contao.html.twig', id: contao }

    contao.doctrine.orm.fail_tolerant_proxy_cache_warmer:
        class: Contao\CoreBundle\Doctrine\ORM\FailTolerantProxyCacheWarmer
        decorates: doctrine.orm.proxy_cache_warmer
        arguments:
            - '@contao.doctrine.orm.fail_tolerant_proxy_cache_warmer.inner'
            - '@database_connection'

    contao.doctrine.schema_provider:
        class: Contao\CoreBundle\Doctrine\Schema\DcaSchemaProvider
        arguments:
            - '@contao.framework'
            - '@doctrine'
            - '@Contao\CoreBundle\Doctrine\Schema\SchemaProvider'

    Contao\CoreBundle\Doctrine\Schema\SchemaProvider:
        arguments:
            - '@doctrine.orm.default_entity_manager'

    contao.fragment.handler:
        class: Contao\CoreBundle\Fragment\FragmentHandler
        decorates: fragment.handler
        arguments:
            - ~ # fragment renderer locator
            - '@contao.fragment.handler.inner'
            - '@request_stack'
            - '@contao.fragment.registry'
            - '@contao.fragment.pre_handlers'
            - '%kernel.debug%'

    contao.fragment.pre_handlers:
        class: Symfony\Component\DependencyInjection\ServiceLocator
        arguments:
            - []

    contao.fragment.registry:
        class: Contao\CoreBundle\Fragment\FragmentRegistry

    contao.fragment.renderer.forward:
        class: Contao\CoreBundle\Fragment\ForwardFragmentRenderer
        arguments:
            - '@http_kernel'
            - '@event_dispatcher'
        calls:
            - [setFragmentPath, ['%fragment.path%']]
        tags:
            - { name: kernel.fragment_renderer, alias: forward }

    contao.framework:
        class: Contao\CoreBundle\Framework\ContaoFramework
        arguments:
            - '@request_stack'
            - '@contao.routing.scope_matcher'
            - '@contao.security.token_checker'
            - '@filesystem'
            - '%kernel.project_dir%'
            - '%contao.error_level%'
            - '%contao.legacy_routing%'
        public: true
        tags:
            - { name: kernel.reset, method: reset }

    contao.image.deferred_image_storage:
        class: Contao\Image\DeferredImageStorageFilesystem
        arguments:
            - '%contao.image.target_dir%'
            - '@?filesystem'

    contao.image.imagine.gd:
        class: Imagine\Gd\Imagine

    contao.image.imagine.gmagick:
        class: Imagine\Gmagick\Imagine

    contao.image.imagine.imagick:
        class: Imagine\Imagick\Imagine

    contao.image.imagine_svg:
        class: Contao\ImagineSvg\Imagine
        public: true

    contao.image.resize_calculator:
        class: Contao\Image\ResizeCalculator

    contao.image.resizer:
        class: Contao\CoreBundle\Image\LegacyResizer
        arguments:
            - '%contao.image.target_dir%'
            - '@contao.image.resize_calculator'
            - '@filesystem'
            - '@contao.image.deferred_image_storage'
        public: true

    contao.image.image_factory:
        class: Contao\CoreBundle\Image\ImageFactory
        arguments:
            - '@contao.image.resizer'
            - '@contao.image.imagine'
            - '@contao.image.imagine_svg'
            - '@filesystem'
            - '@contao.framework'
            - '%contao.image.bypass_cache%'
            - '%contao.image.imagine_options%'
            - '%contao.image.valid_extensions%'
            - '%kernel.project_dir%/%contao.upload_path%'
            - '@?logger'
        public: true

    contao.image.image_sizes:
        class: Contao\CoreBundle\Image\ImageSizes
        arguments:
            - '@database_connection'
            - '@event_dispatcher'
            - '@contao.framework'
            - '@contao.translation.translator'
        public: true
        tags:
            - { name: kernel.reset, method: reset }

    contao.image.picture_factory:
        class: Contao\CoreBundle\Image\PictureFactory
        arguments:
            - '@contao.image.picture_generator'
            - '@contao.image.image_factory'
            - '@contao.framework'
            - '%contao.image.bypass_cache%'
            - '%contao.image.imagine_options%'
        public: true

    contao.image.picture_generator:
        class: Contao\Image\PictureGenerator
        arguments:
            - '@contao.image.resizer'
            - '@?contao.image.resize_calculator'
        public: true

    Contao\CoreBundle\Image\Studio\FigureRenderer:
        arguments:
            - '@Contao\CoreBundle\Image\Studio\Studio'
            - '@twig'
        public: true

    Contao\CoreBundle\Image\Studio\Studio:
        arguments:
            - '@Psr\Container\ContainerInterface'
            - '%kernel.project_dir%'
            - '%contao.upload_path%'
            - '%contao.image.valid_extensions%'
        public: true
        tags:
            - { name: container.service_subscriber, id: contao.assets.files_context }
            - { name: container.service_subscriber, id: contao.image.resizer }

    Contao\CoreBundle\Intl\Countries:
        arguments:
            - '@translator'
            - '@request_stack'
            - '@contao.framework'
            - ~ # Default countries from IntlInstalledLocalesAndCountriesPass
            - '%contao.intl.countries%'
            - '%kernel.default_locale%'
        public: true

    Contao\CoreBundle\Intl\Locales:
        arguments:
            - '@translator'
            - '@request_stack'
            - '@contao.framework'
            - ~ # Default locales from IntlInstalledLocalesAndCountriesPass
            - ~ # Default enabled locales from IntlInstalledLocalesAndCountriesPass
            - '%contao.intl.locales%'
            - '%contao.intl.enabled_locales%'
            - '%kernel.default_locale%'
        public: true

    Contao\CoreBundle\Mailer\AvailableTransports:
        arguments:
            - '@?translator'

    Contao\CoreBundle\Mailer\ContaoMailer:
        decorates: mailer.mailer
        arguments:
            - '@Contao\CoreBundle\Mailer\ContaoMailer.inner'
            - '@Contao\CoreBundle\Mailer\AvailableTransports'
            - '@request_stack'

    contao.menu.backend_menu_builder:
        class: Contao\CoreBundle\Menu\BackendMenuBuilder
        arguments:
            - '@knp_menu.factory'
            - '@event_dispatcher'
        tags:
            - { name: knp_menu.menu_builder, method: buildMainMenu, alias: be_menu }
            - { name: knp_menu.menu_builder, method: buildHeaderMenu, alias: be_header_menu }
        public: true

    contao.menu.matcher:
        class: Knp\Menu\Matcher\Matcher

    contao.menu.renderer:
        class: Knp\Menu\Renderer\ListRenderer
        arguments:
            - '@contao.menu.matcher'
        public: true

    contao.model_argument_resolver:
        class: Contao\CoreBundle\HttpKernel\ModelArgumentResolver
        arguments:
            - '@contao.framework'
            - '@contao.routing.scope_matcher'
        tags:
            # The priority must be higher than the one of the request attribute value resolver (defaults to 100)
            - { name: controller.argument_value_resolver, priority: 101 }

    contao.monolog.handler:
        class: Contao\CoreBundle\Monolog\ContaoTableHandler
        arguments:
            - debug
            - false
        tags:
            - { name: monolog.logger, channel: contao }

    contao.monolog.processor:
        class: Contao\CoreBundle\Monolog\ContaoTableProcessor
        arguments:
            - '@request_stack'
            - '@security.token_storage'
            - '@contao.routing.scope_matcher'

    contao.opt-in:
        class: Contao\CoreBundle\OptIn\OptIn
        arguments:
            - '@contao.framework'
        public: true

    contao.picker.article_provider:
        class: Contao\CoreBundle\Picker\ArticlePickerProvider
        arguments:
            - '@knp_menu.factory'
            - '@router'
            - '@?translator'
            - '@security.helper'

    contao.picker.builder:
        class: Contao\CoreBundle\Picker\PickerBuilder
        arguments:
            - '@knp_menu.factory'
            - '@router'
        public: true

    contao.picker.file_provider:
        class: Contao\CoreBundle\Picker\FilePickerProvider
        arguments:
            - '@knp_menu.factory'
            - '@router'
            - '@translator'
            - '@security.helper'
            - '%contao.upload_path%'
        tags:
            - { name: contao.picker_provider, priority: 160 }

    contao.picker.page_provider:
        class: Contao\CoreBundle\Picker\PagePickerProvider
        arguments:
            - '@knp_menu.factory'
            - '@router'
            - '@?translator'
            - '@security.helper'
        tags:
            - { name: contao.picker_provider, priority: 192 }

    contao.picker.table_provider:
        class: Contao\CoreBundle\Picker\TablePickerProvider
        arguments:
            - '@contao.framework'
            - '@knp_menu.factory'
            - '@router'
            - '@translator'
            - '@database_connection'
        tags:
            - contao.picker_provider

    Contao\CoreBundle\Repository\CronJobRepository:
        arguments:
            - '@doctrine'

    contao.repository.remember_me:
        class: Contao\CoreBundle\Repository\RememberMeRepository
        arguments:
            - '@doctrine'

    contao.resource_finder:
        class: Contao\CoreBundle\Config\ResourceFinder
        arguments:
            - '%contao.resources_paths%'
        public: true

    contao.resource_locator:
        class: Symfony\Component\Config\FileLocator
        arguments:
            - '%contao.resources_paths%'
        public: true

    contao.routing.backend_matcher:
        class: Symfony\Component\HttpFoundation\RequestMatcher
        calls:
            - [matchAttribute, [_scope, backend]]

    contao.routing.candidates:
        class: Contao\CoreBundle\Routing\Candidates\PageCandidates
        arguments:
            - '@database_connection'
            - '@Contao\CoreBundle\Routing\Page\PageRegistry'

    contao.routing.locale_candidates:
        class: Contao\CoreBundle\Routing\Candidates\LocaleCandidates
        arguments:
            - '@Contao\CoreBundle\Routing\Page\PageRegistry'

    contao.routing.domain_filter:
        class: Contao\CoreBundle\Routing\Matcher\DomainFilter

    contao.routing.final_matcher:
        class: Contao\CoreBundle\Routing\Matcher\UrlMatcher

    contao.routing.frontend_matcher:
        class: Symfony\Component\HttpFoundation\RequestMatcher
        calls:
            - [matchAttribute, [_scope, frontend]]

    contao.routing.images_loader:
        class: Contao\CoreBundle\Routing\ImagesLoader
        arguments:
            - '%kernel.project_dir%'
            - '%contao.image.target_dir%'
        tags:
            - routing.loader

    contao.routing.input_enhancer:
        class: Contao\CoreBundle\Routing\Enhancer\InputEnhancer
        arguments:
            - '@contao.framework'
        tags:
            - contao.page_router_enhancer

    contao.routing.language_filter:
        class: Contao\CoreBundle\Routing\Matcher\LanguageFilter

    contao.routing.nested_matcher:
        class: Symfony\Cmf\Component\Routing\NestedMatcher\NestedMatcher
        arguments:
            - '@contao.routing.route_provider'
            - '@contao.routing.final_matcher'
        calls:
            - [addRouteFilter, ['@contao.routing.domain_filter']]
            - [addRouteFilter, ['@contao.routing.published_filter']]
            - [addRouteFilter, ['@contao.routing.language_filter']]
        public: true

    contao.routing.nested_404_matcher:
        class: Symfony\Cmf\Component\Routing\NestedMatcher\NestedMatcher
        arguments:
            - '@contao.routing.route_404_provider'
            - '@contao.routing.final_matcher'
        calls:
            - [addRouteFilter, ['@contao.routing.domain_filter']]
            - [addRouteFilter, ['@contao.routing.published_filter']]
        public: true

    Contao\CoreBundle\Routing\Page\PageRegistry:
        arguments:
            - '@database_connection'

    contao.routing.page_router:
        class: Symfony\Cmf\Component\Routing\DynamicRouter
        arguments:
            - '@router.request_context'
            - '@contao.routing.nested_matcher'
            - '@contao.routing.route_generator'
            - ''
            - '@event_dispatcher'
            - '@contao.routing.route_provider'
        tags:
            - { name: router, priority: 20 }

    contao.routing.page_404_router:
        class: Symfony\Cmf\Component\Routing\DynamicRouter
        arguments:
            - '@router.request_context'
            - '@contao.routing.nested_404_matcher'
            - '@contao.routing.route_generator'
            - ''
            - '@event_dispatcher'
            - '@contao.routing.route_404_provider'
        tags:
            - { name: router, priority: -200 }

    contao.routing.published_filter:
        class: Contao\CoreBundle\Routing\Matcher\PublishedFilter
        arguments:
            - '@contao.security.token_checker'

    contao.routing.route_generator:
        class: Contao\CoreBundle\Routing\PageUrlGenerator
        arguments:
            - '@contao.routing.route_provider'
            - '@Contao\CoreBundle\Routing\Page\PageRegistry'
            - '@?logger'

    contao.routing.route_provider:
        class: Contao\CoreBundle\Routing\RouteProvider
        arguments:
            - '@contao.framework'
            - '@contao.routing.candidates'
            - '@Contao\CoreBundle\Routing\Page\PageRegistry'
            - '%contao.legacy_routing%'
            - '%contao.prepend_locale%'

    contao.routing.route_404_provider:
        class: Contao\CoreBundle\Routing\Route404Provider
        arguments:
            - '@contao.framework'
            - '@contao.routing.locale_candidates'
            - '@Contao\CoreBundle\Routing\Page\PageRegistry'

    contao.routing.scope_matcher:
        class: Contao\CoreBundle\Routing\ScopeMatcher
        arguments:
            - '@contao.routing.backend_matcher'
            - '@contao.routing.frontend_matcher'
        public: true

    Contao\CoreBundle\Routing\ResponseContext\ResponseContextAccessor:
        arguments:
            - '@request_stack'
        public: true

    Contao\CoreBundle\Routing\ResponseContext\CoreResponseContextFactory:
        arguments:
            - '@Contao\CoreBundle\Routing\ResponseContext\ResponseContextAccessor'
            - '@event_dispatcher'
            - '@contao.security.token_checker'
        public: true

    contao.search.indexer.default:
        class: Contao\CoreBundle\Search\Indexer\DefaultIndexer
        arguments:
            - '@contao.framework'
            - '@database_connection'
        tags:
            - contao.search_indexer

    contao.search.indexer.delegating:
        class: Contao\CoreBundle\Search\Indexer\DelegatingIndexer

    contao.security.authentication_failure_handler:
        class: Contao\CoreBundle\Security\Authentication\AuthenticationFailureHandler
        arguments:
            - '@?logger'

    contao.security.authentication_listener:
        class: Contao\CoreBundle\Security\Authentication\ContaoLoginAuthenticationListener
        arguments:
            - '@security.token_storage'
            - '@security.authentication.manager'
            - '@security.authentication.session_strategy'
            - '@security.http_utils'
            - ~
            - '@contao.security.authentication_success_handler'
            - '@contao.security.authentication_failure_handler'
            - []
            - '@?logger'
            - '@?event_dispatcher'
        tags:
            - { name: monolog.logger, channel: security }

    contao.security.authentication_provider:
        class: Contao\CoreBundle\Security\Authentication\Provider\AuthenticationProvider
        abstract: true
        arguments:
            - ~ # user provider
            - ~ # user checker
            - ~ # provider-shared key
            - '@security.encoder_factory'
            - '@contao.framework'
            - ~ # 2FA authentication provider
            - '@scheb_two_factor.authenticated_token_handler'
            - '@scheb_two_factor.authentication_context_factory'
            - '@request_stack'
            - '@contao.security.two_factor.trusted_device_manager'

    contao.security.authentication_success_handler:
        class: Contao\CoreBundle\Security\Authentication\AuthenticationSuccessHandler
        arguments:
            - '@contao.framework'
            - '@contao.security.two_factor.trusted_device_manager'
            - '@security.firewall.map'
            - '@?logger'

    contao.security.backend_access_voter:
        class: Contao\CoreBundle\Security\Voter\BackendAccessVoter

    contao.security.backend_user_provider:
        class: Contao\CoreBundle\Security\User\ContaoUserProvider
        arguments:
            - '@contao.framework'
            - '@session'
            - Contao\BackendUser
            - '@?logger'

    contao.security.entry_point:
        class: Contao\CoreBundle\Security\Authentication\AuthenticationEntryPoint
        arguments:
            - '@router'
            - '@uri_signer'
            - '@contao.framework'
            - '@contao.routing.scope_matcher'

    contao.security.expiring_token_based_remember_me_services:
        class: Contao\CoreBundle\Security\Authentication\RememberMe\ExpiringTokenBasedRememberMeServices
        abstract: true
        arguments:
            - '@contao.repository.remember_me'
            - ~ # user Providers
            - ~ # shared Token Key
            - ~ # shared Provider Key
            - ~ # options
            - '@?logger'
        tags:
            - { name: monolog.logger, channel: security }

    contao.security.frontend_preview_authenticator:
        class: Contao\CoreBundle\Security\Authentication\FrontendPreviewAuthenticator
        arguments:
            - '@security.helper'
            - '@session'
            - '@contao.security.frontend_user_provider'
            - '@?logger'
        public: true

    contao.security.frontend_user_provider:
        class: Contao\CoreBundle\Security\User\ContaoUserProvider
        arguments:
            - '@contao.framework'
            - '@session'
            - Contao\FrontendUser
            - '@?logger'

    contao.security.logout_handler:
        class: Contao\CoreBundle\Security\Logout\LogoutHandler
        arguments:
            - '@contao.framework'
            - '@?logger'

    contao.security.logout_success_handler:
        class: Contao\CoreBundle\Security\Logout\LogoutSuccessHandler
        arguments:
            - '@security.http_utils'
            - '@contao.routing.scope_matcher'

    contao.security.token_checker:
        class: Contao\CoreBundle\Security\Authentication\Token\TokenChecker
        arguments:
            - '@request_stack'
            - '@security.firewall.map'
            - '@security.token_storage'
            - '@session'
            - '@security.authentication.trust_resolver'
            - ~ # Simple or Role Hierarchy Voter
        public: true

    contao.security.two_factor.authenticator:
        class: Contao\CoreBundle\Security\TwoFactor\Authenticator
        public: true

    Contao\CoreBundle\Security\TwoFactor\BackupCodeManager:
        public: true

    contao.security.two_factor.provider:
        class: Contao\CoreBundle\Security\TwoFactor\Provider
        arguments:
            - '@contao.security.two_factor.authenticator'
        tags:
            - { name: scheb_two_factor.provider, alias: contao }

    contao.security.two_factor.trusted_device_manager:
        class: Contao\CoreBundle\Security\TwoFactor\TrustedDeviceManager
        arguments:
            - '@request_stack'
            - '@scheb_two_factor.trusted_token_storage'
            - '@doctrine.orm.entity_manager'
        public: true

    contao.security.user_checker:
        class: Contao\CoreBundle\Security\User\UserChecker
        arguments:
            - '@contao.framework'

    Contao\CoreBundle\Security\Voter\MemberGroupVoter: ~

    contao.session.contao_backend:
        class: Contao\CoreBundle\Session\Attribute\ArrayAttributeBag
        arguments:
            - _contao_be_attributes
        calls:
            - [setName, [contao_backend]]

    contao.session.contao_frontend:
        class: Contao\CoreBundle\Session\Attribute\ArrayAttributeBag
        arguments:
            - _contao_fe_attributes
        calls:
            - [setName, [contao_frontend]]

    contao.slug:
        class: Contao\CoreBundle\Slug\Slug
        arguments:
            - '@contao.slug.generator'
            - '@contao.framework'
        public: true

    contao.slug.generator:
        class: Ausi\SlugGenerator\SlugGenerator
        arguments:
            - { validChars: 0-9a-z }
        public: true

    contao.slug.valid_characters:
        class: Contao\CoreBundle\Slug\ValidCharacters
        arguments:
            - '@event_dispatcher'
            - '@translator'
        public: true

    contao.token_generator:
        class: Symfony\Component\Security\Csrf\TokenGenerator\UriSafeTokenGenerator
        arguments:
            - 48

    contao.translation.translator:
        class: Contao\CoreBundle\Translation\Translator
        decorates: translator
        arguments:
            - '@contao.translation.translator.inner'
            - '@contao.framework'
            - '@contao.resource_finder'

    contao.translation.translator.data_collector:
        class: Contao\CoreBundle\Translation\DataCollectorTranslator
        arguments:
            - '@contao.translation.translator.data_collector.inner'
        autoconfigure: false
        tags:
            - { name: kernel.reset, method: reset }

    Contao\CoreBundle\Twig\Extension\ContaoExtension:
        arguments:
            - '@twig'
            - '@Contao\CoreBundle\Twig\Loader\ContaoFilesystemLoader'
        public: true

    contao.twig.interop.context_factory:
        class: Contao\CoreBundle\Twig\Interop\ContextFactory
        public: true

    Contao\CoreBundle\Twig\Loader\ThemeNamespace: ~

    Contao\CoreBundle\Twig\Loader\TemplateLocator:
        arguments:
            - '%kernel.project_dir%'
            - '%kernel.bundles%'
            - '%kernel.bundles_metadata%'
            - '@Contao\CoreBundle\Twig\Loader\ThemeNamespace'
            - '@database_connection'

    Contao\CoreBundle\Twig\Loader\FailTolerantFilesystemLoader:
        arguments:
            - []
            - '%kernel.project_dir%'
        tags:
            - { name: twig.loader, priority: 1 }

    Contao\CoreBundle\Twig\Loader\ContaoFilesystemLoader:
        arguments:
            - '@cache.system'
            - '@Contao\CoreBundle\Twig\Loader\TemplateLocator'
            - '@Contao\CoreBundle\Twig\Loader\ThemeNamespace'
            - '%kernel.project_dir%'
        tags:
            - { name: twig.loader, priority: 2 }
            - { name: kernel.reset, method: reset }

    Contao\CoreBundle\Twig\Loader\ContaoFilesystemLoaderWarmer:
        arguments:
            - '@Contao\CoreBundle\Twig\Loader\ContaoFilesystemLoader'
            - '@Contao\CoreBundle\Twig\Loader\TemplateLocator'
            - '%kernel.project_dir%'
            - '%kernel.environment%'
        tags:
            - { name: kernel.cache_warmer }
            - { name: kernel.event_listener, event: kernel.request, method: onKernelRequest }

    Contao\CoreBundle\Twig\Runtime\FigureRendererRuntime:
        arguments:
            - '@Contao\CoreBundle\Image\Studio\FigureRenderer'

    Contao\CoreBundle\Twig\Runtime\InsertTagRuntime:
        arguments:
            - '@contao.framework'

    Contao\CoreBundle\Twig\Runtime\LegacyTemplateFunctionsRuntime:
        arguments:
            - '@request_stack'
            - '@contao.framework'
            - '@contao.routing.scope_matcher'

    Contao\CoreBundle\Twig\Runtime\PictureConfigurationRuntime: ~

    Contao\CoreBundle\Twig\Runtime\SchemaOrgRuntime:
        arguments:
            - '@Contao\CoreBundle\Routing\ResponseContext\ResponseContextAccessor'

    Contao\CoreBundle\Util\SimpleTokenExpressionLanguage:
        arguments:
            - ~
            - !tagged_iterator contao.simple_token_extension

    Contao\CoreBundle\Util\SimpleTokenParser:
        arguments:
            - '@Contao\CoreBundle\Util\SimpleTokenExpressionLanguage'
        public: true
