services:
    _defaults:
        autoconfigure: true

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

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

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

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

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

    contao.cache.entity_tags:
        class: Contao\CoreBundle\Cache\EntityCacheTags
        public: true
        arguments:
            - '@doctrine.orm.default_entity_manager'
            - '@?fos_http_cache.http.symfony_response_tagger'
            - '@?fos_http_cache.cache_manager'

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

    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.broken_link_checker_subscriber:
        class: Contao\CoreBundle\Crawl\Escargot\Subscriber\BrokenLinkCheckerSubscriber
        arguments:
            - '@translator'
        tags:
            - contao.escargot_subscriber

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

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

    contao.cron:
        class: Contao\CoreBundle\Cron\Cron
        public: true
        arguments:
            - !service_closure '@contao.repository.cron_job'
            - !service_closure '@doctrine.orm.entity_manager'
            - '@?logger'

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

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

    contao.cron.purge_preview_links:
        class: Contao\CoreBundle\Cron\PurgePreviewLinksCron
        arguments:
            - '@database_connection'

    contao.csrf.token_manager:
        class: Contao\CoreBundle\Csrf\ContaoCsrfTokenManager
        public: true
        arguments:
            - '@request_stack'
            - '%contao.csrf_cookie_prefix%'
            - '@security.csrf.token_generator'
            - '@contao.csrf.token_storage'
            - ~
            - '%contao.csrf_token_name%'

    contao.csrf.token_storage:
        class: Contao\CoreBundle\Csrf\MemoryTokenStorage

    contao.data_collector:
        class: Contao\CoreBundle\DataCollector\ContaoDataCollector
        arguments:
            - '@contao.security.token_checker'
            - '%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.backup.dumper:
        class: Contao\CoreBundle\Doctrine\Backup\Dumper

    contao.doctrine.backup.retention_policy:
        class: Contao\CoreBundle\Doctrine\Backup\RetentionPolicy
        arguments:
            - ~
            - ~

    contao.doctrine.backup_manager:
        class: Contao\CoreBundle\Doctrine\Backup\BackupManager
        arguments:
            - '@database_connection'
            - '@contao.doctrine.backup.dumper'
            - '@contao.filesystem.virtual.backups'
            - ~
            - '@contao.doctrine.backup.retention_policy'

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

    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.mysql_innodb_row_size_calculator:
        class: Contao\CoreBundle\Doctrine\Schema\MysqlInnodbRowSizeCalculator
        arguments:
            - '@database_connection'

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

    contao.filesystem.dbafs_factory:
        class: Contao\CoreBundle\Filesystem\Dbafs\DbafsFactory
        arguments:
            - '@database_connection'
            - '@event_dispatcher'

    contao.filesystem.dbafs_manager:
        class: Contao\CoreBundle\Filesystem\Dbafs\DbafsManager
        public: true

    contao.filesystem.mount_manager:
        class: Contao\CoreBundle\Filesystem\MountManager
        arguments:
            - !tagged_iterator contao.public_file_uri_provider

    contao.filesystem.public_uri.symlinked_local_files_provider:
        class: Contao\CoreBundle\Filesystem\PublicUri\SymlinkedLocalFilesProvider
        arguments:
            - '@contao.filesystem.adapter.files'
            - '%contao.upload_path%'
            - '@request_stack'
        tags:
            - { name: contao.public_file_uri_provider }

    contao.filesystem.virtual_factory:
        class: Contao\CoreBundle\Filesystem\VirtualFilesystemFactory
        arguments:
            - '@contao.filesystem.mount_manager'
            - '@contao.filesystem.dbafs_manager'

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

    contao.fragment.handler:
        class: Contao\CoreBundle\Fragment\FragmentHandler
        decorates: fragment.handler
        arguments:
            - !tagged_locator { tag: kernel.fragment_renderer, index_by: alias }
            - '@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.framework:
        class: Contao\CoreBundle\Framework\ContaoFramework
        public: true
        arguments:
            - '@request_stack'
            - '@contao.routing.scope_matcher'
            - '@contao.security.token_checker'
            - '@filesystem'
            - '@router'
            - '%kernel.project_dir%'
            - '%contao.error_level%'
            - '%contao.legacy_routing%'

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

    contao.image.factory:
        class: Contao\CoreBundle\Image\ImageFactory
        public: true
        arguments:
            - '@contao.image.legacy_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'
        tags:
            - { name: monolog.logger, channel: contao.error }

    contao.image.fallback_preview_provider:
        class: Contao\CoreBundle\Image\Preview\FallbackPreviewProvider
        tags:
            - { name: contao.preview_provider, priority: -1024 }

    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_preview_provider:
        class: Contao\CoreBundle\Image\Preview\ImaginePreviewProvider
        arguments:
            - '@contao.image.imagine'
        tags:
            - { name: contao.preview_provider, priority: 0 }

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

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

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

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

    contao.image.preview_factory:
        class: Contao\CoreBundle\Image\Preview\PreviewFactory
        public: true
        arguments:
            - !tagged_iterator contao.preview_provider
            - '@contao.image.factory'
            - '@contao.image.picture_factory'
            - '@contao.image.studio'
            - '@contao.framework'
            - '%kernel.secret%'
            - '%contao.image.preview.target_dir%'
            - '%contao.image.valid_extensions%'
            - '%contao.image.preview.default_size%'
            - '%contao.image.preview.max_size%'

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

    contao.image.sizes:
        class: Contao\CoreBundle\Image\ImageSizes
        public: true
        arguments:
            - '@database_connection'
            - '@event_dispatcher'
            - '@contao.framework'
            - '@contao.translation.translator'

    contao.image.studio:
        class: Contao\CoreBundle\Image\Studio\Studio
        public: true
        arguments:
            - !service_locator
              contao.image.studio: '@contao.image.studio'
              contao.image.picture_factory: '@contao.image.picture_factory'
              contao.image.factory: '@contao.image.factory'
              contao.image.legacy_resizer: '@contao.image.legacy_resizer'
              contao.assets.files_context: '@contao.assets.files_context'
              contao.framework: '@contao.framework'
              event_dispatcher: '@event_dispatcher'
            - '%kernel.project_dir%'
            - '%contao.upload_path%'
            - '%contao.web_dir%'
            - '%contao.image.valid_extensions%'

    contao.image.studio.figure_renderer:
        class: Contao\CoreBundle\Image\Studio\FigureRenderer
        public: true
        arguments:
            - '@contao.image.studio'
            - '@twig'

    contao.insert_tag.parser:
        class: Contao\CoreBundle\InsertTag\InsertTagParser
        public: true
        arguments:
            - '@contao.framework'

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

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

    contao.mailer:
        class: Contao\CoreBundle\Mailer\ContaoMailer
        decorates: mailer.mailer
        arguments:
            - '@contao.mailer.inner'
            - '@contao.mailer.available_transports'
            - '@request_stack'
            - '@contao.framework'

    contao.mailer.available_transports:
        class: Contao\CoreBundle\Mailer\AvailableTransports
        public: true
        arguments:
            - '@?translator'

    contao.menu.backend_builder:
        class: Contao\CoreBundle\Menu\BackendMenuBuilder
        public: true
        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 }

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

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

    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
        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
        public: true
        arguments:
            - '@contao.framework'

    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
        public: true
        arguments:
            - '@knp_menu.factory'
            - '@router'

    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.rate_limit.member_password_factory:
        class: Symfony\Component\RateLimiter\RateLimiterFactory
        public: true
        arguments:
            - { id: contao.member_password_reset, policy: fixed_window, limit: 3, interval: 15 minutes }
            - '@contao.rate_limit.member_password_storage'
            - '@?lock_factory'

    contao.rate_limit.member_password_storage:
        class: Symfony\Component\RateLimiter\Storage\CacheStorage
        arguments:
            - '@cache.rate_limiter'

    contao.repository.cron_job:
        class: Contao\CoreBundle\Repository\CronJobRepository
        arguments:
            - '@doctrine'

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

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

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

    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.routing.page_registry'

    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.locale_candidates:
        class: Contao\CoreBundle\Routing\Candidates\LocaleCandidates
        arguments:
            - '@contao.routing.page_registry'

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

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

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

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

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

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

    contao.routing.page_registry:
        class: Contao\CoreBundle\Routing\Page\PageRegistry
        public: true
        arguments:
            - '@database_connection'

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

    contao.routing.page_url_generator:
        class: Contao\CoreBundle\Routing\PageUrlGenerator
        arguments:
            - '@contao.routing.route_provider'
            - '@contao.routing.page_registry'
            - '@?logger'

    contao.routing.response_context_accessor:
        class: Contao\CoreBundle\Routing\ResponseContext\ResponseContextAccessor
        public: true
        arguments:
            - '@request_stack'

    contao.routing.response_context_factory:
        class: Contao\CoreBundle\Routing\ResponseContext\CoreResponseContextFactory
        public: true
        arguments:
            - '@contao.routing.response_context_accessor'
            - '@event_dispatcher'
            - '@contao.security.token_checker'
            - '@contao.string.html_decoder'
            - '@request_stack'
            - '@contao.insert_tag.parser'

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

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

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

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

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

    contao.search.delegating_indexer:
        class: Contao\CoreBundle\Search\Indexer\DelegatingIndexer

    contao.security.access_decision_manager:
        decorates: security.access.decision_manager
        class: Contao\CoreBundle\Security\Authentication\AccessDecisionManager
        arguments:
            - '@.inner'
            - '@contao.security.access_decision_manager.priority'
            - '@request_stack'
            - '@security.firewall.map'

    contao.security.access_decision_manager.priority:
        class: Symfony\Component\Security\Core\Authorization\AccessDecisionManager
        arguments:
            - !tagged_iterator security.voter
            - !php/const Symfony\Component\Security\Core\Authorization\AccessDecisionManager::STRATEGY_PRIORITY

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

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

    contao.security.authentication_provider:
        class: Contao\CoreBundle\Security\Authentication\Provider\AuthenticationProvider
        abstract: true
        arguments:
            - ~
            - ~
            - ~
            - '@security.password_hasher_factory'
            - '@contao.framework'
            - ~
            - '@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
        arguments:
            - '@contao.framework'

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

    contao.security.expiring_token_based_remember_me_services:
        class: Contao\CoreBundle\Security\Authentication\RememberMe\ExpiringTokenBasedRememberMeServices
        abstract: true
        arguments:
            - '@contao.repository.remember_me'
            - ~
            - ~
            - ~
            - ~
            - '@?logger'
        tags:
            - { name: monolog.logger, channel: security }

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

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

    contao.security.login_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.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.member_group_voter:
        class: Contao\CoreBundle\Security\Voter\MemberGroupVoter

    contao.security.token_checker:
        public: true
        class: Contao\CoreBundle\Security\Authentication\Token\TokenChecker
        arguments:
            - '@request_stack'
            - '@security.firewall.map'
            - '@security.token_storage'
            - '@session'
            - '@security.authentication.trust_resolver'
            - ~
            - '@database_connection'

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

    contao.security.two_factor.backup_code_manager:
        class: 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
        public: true
        arguments:
            - '@request_stack'
            - '@scheb_two_factor.trusted_token_storage'
            - '@doctrine.orm.entity_manager'

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

    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
        public: true
        arguments:
            - '@contao.slug.generator'
            - '@contao.framework'

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

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

    contao.string.html_decoder:
        class: Contao\CoreBundle\String\HtmlDecoder
        public: true
        arguments:
            - '@contao.insert_tag.parser'

    contao.string.simple_token_expression_language:
        class: Contao\CoreBundle\String\SimpleTokenExpressionLanguage
        arguments:
            - ~
            - !tagged_iterator contao.simple_token_extension

    contao.string.simple_token_parser:
        class: Contao\CoreBundle\String\SimpleTokenParser
        public: true
        arguments:
            - '@contao.string.simple_token_expression_language'

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

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

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

    contao.twig.extension:
        class: Contao\CoreBundle\Twig\Extension\ContaoExtension
        public: true
        arguments:
            - '@twig'
            - '@contao.twig.filesystem_loader'

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

    contao.twig.figure_renderer_runtime:
        class: Contao\CoreBundle\Twig\Runtime\FigureRendererRuntime
        arguments:
            - '@contao.image.studio.figure_renderer'

    contao.twig.filesystem_loader:
        class: Contao\CoreBundle\Twig\Loader\ContaoFilesystemLoader
        public: true
        arguments:
            - '@cache.system'
            - '@contao.twig.loader.template_locator'
            - '@contao.twig.loader.theme_namespace'
            - '%kernel.project_dir%'
        tags:
            - { name: twig.loader, priority: 2 }

    contao.twig.filesystem_loader_warmer:
        class: Contao\CoreBundle\Twig\Loader\ContaoFilesystemLoaderWarmer
        arguments:
            - '@contao.twig.filesystem_loader'
            - '%kernel.cache_dir%'
            - '%kernel.environment%'
        tags:
            - { name: kernel.cache_warmer }

    contao.twig.finder_factory:
        class: Contao\CoreBundle\Twig\Finder\FinderFactory
        arguments:
            - '@contao.twig.filesystem_loader'
            - '@contao.twig.loader.theme_namespace'
            - '@translator'

    contao.twig.insert_tag_runtime:
        class: Contao\CoreBundle\Twig\Runtime\InsertTagRuntime
        arguments:
            - '@contao.insert_tag.parser'

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

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

    contao.twig.loader.template_locator:
        class: Contao\CoreBundle\Twig\Loader\TemplateLocator
        arguments:
            - '%kernel.project_dir%'
            - '%kernel.bundles%'
            - '%kernel.bundles_metadata%'
            - '@contao.twig.loader.theme_namespace'
            - '@database_connection'

    contao.twig.loader.theme_namespace:
        class: Contao\CoreBundle\Twig\Loader\ThemeNamespace

    contao.twig.picture_configuration_runtime:
        class: Contao\CoreBundle\Twig\Runtime\PictureConfigurationRuntime

    contao.twig.schema_org_runtime:
        class: Contao\CoreBundle\Twig\Runtime\SchemaOrgRuntime
        arguments:
            - '@contao.routing.response_context_accessor'

    # Autowiring aliases
    Contao\CoreBundle\Cache\EntityCacheTags: '@contao.cache.entity_tags'
    Contao\CoreBundle\Config\ResourceFinderInterface: '@contao.resource_finder'
    Contao\CoreBundle\Csrf\ContaoCsrfTokenManager:
        alias: contao.csrf.token_manager
        public: true # backwards compatibility
    Contao\CoreBundle\Doctrine\Backup\DumperInterface: '@contao.doctrine.backup.dumper'
    Contao\CoreBundle\Framework\ContaoFramework: '@contao.framework'
    Contao\CoreBundle\Image\ImageFactoryInterface: '@contao.image.factory'
    Contao\CoreBundle\Image\ImageSizes: '@contao.image.sizes'
    Contao\CoreBundle\Image\PictureFactoryInterface: '@contao.image.picture_factory'
    Contao\CoreBundle\Image\Preview\PreviewFactory: '@contao.image.preview_factory'
    Contao\CoreBundle\Image\Studio\Studio:
        alias: contao.image.studio
        public: true # backwards compatibility
    Contao\CoreBundle\InsertTag\InsertTagParser: '@contao.insert_tag.parser'
    Contao\CoreBundle\Intl\Countries:
        alias: contao.intl.countries
        public: true # backwards compatibility
    Contao\CoreBundle\Intl\Locales:
        alias: contao.intl.locales
        public: true # backwards compatibility
    Contao\CoreBundle\Mailer\AvailableTransports:
        alias: contao.mailer.available_transports
        public: true # backwards compatibility
    Contao\CoreBundle\OptIn\OptIn:
        alias: contao.opt_in
        public: true # backwards compatibility
    Contao\CoreBundle\Picker\PickerBuilderInterface: '@contao.picker.builder'
    Contao\CoreBundle\Routing\Page\PageRegistry:
        alias: contao.routing.page_registry
        public: true # backwards compatibility
    Contao\CoreBundle\Routing\ResponseContext\ResponseContextAccessor:
        alias: contao.routing.response_context_accessor
        public: true  # backwards compatibility
    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'
    Contao\CoreBundle\String\HtmlDecoder: '@contao.string.html_decoder'
    Contao\CoreBundle\String\SimpleTokenParser: '@contao.string.simple_token_parser'
    Contao\CoreBundle\Twig\Loader\ContaoFilesystemLoader: '@contao.twig.filesystem_loader'

    # Backwards compatibility
    contao.cache.clear_internal:
        alias: contao.cache.clearer
        public: true
        deprecated:
            package: contao/core-bundle
            version: 4.13
            message: Using the "%alias_id%" service ID has been deprecated and will no longer work in Contao 5.0. Please use "contao.cache.clearer" instead.

    contao.cache.warm_internal:
        alias: contao.cache.warmer
        public: true
        deprecated:
            package: contao/core-bundle
            version: 4.13
            message: Using the "%alias_id%" service ID has been deprecated and will no longer work in Contao 5.0. Please use "contao.cache.warmer" instead.

    contao.crawl.escargot_factory:
        alias: contao.crawl.escargot.factory
        public: true
        deprecated:
            package: contao/core-bundle
            version: 4.13
            message: Using the "%alias_id%" service ID has been deprecated and will no longer work in Contao 5.0. Please use "contao.crawl.escargot.factory" instead.

    contao.image.image_factory:
        alias: contao.image.factory
        public: true
        deprecated:
            package: contao/core-bundle
            version: 4.13
            message: Using the "%alias_id%" service ID has been deprecated and will no longer work in Contao 5.0. Please use "contao.image.factory" instead.

    contao.image.image_sizes:
        alias: contao.image.sizes
        public: true
        deprecated:
            package: contao/core-bundle
            version: 4.13
            message: Using the "%alias_id%" service ID has been deprecated and will no longer work in Contao 5.0. Please use "contao.image.sizes" instead.

    contao.image.resizer:
        alias: contao.image.legacy_resizer
        public: true
        deprecated:
            package: contao/core-bundle
            version: 4.13
            message: Using the "%alias_id%" service ID has been deprecated and will no longer work in Contao 5.0. Please use "contao.image.legacy_resizer" instead.

    contao.opt-in:
        alias: contao.opt_in
        public: true
        deprecated:
            package: contao/core-bundle
            version: 4.13
            message: Using the "%alias_id%" service ID has been deprecated and will no longer work in Contao 5.0. Please use "contao.opt_in" instead.

    Contao\CoreBundle\Cron\Cron:
        alias: contao.cron
        public: true
        deprecated:
            package: contao/core-bundle
            version: 4.13
            message: Using the "%alias_id%" service ID has been deprecated and will no longer work in Contao 5.0. Please use "contao.cron" instead.

    Contao\CoreBundle\Framework\ContaoFrameworkInterface:
        alias: contao.framework
        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.framework" instead.

    Contao\CoreBundle\Image\Studio\FigureRenderer:
        alias: contao.image.studio.figure_renderer
        public: true
        deprecated:
            package: contao/core-bundle
            version: 4.13
            message: Using the "%alias_id%" service ID has been deprecated and will no longer work in Contao 5.0. Please use "contao.image.studio.figure_renderer" instead.

    Contao\CoreBundle\Routing\ResponseContext\CoreResponseContextFactory:
        alias: contao.routing.response_context_factory
        public: true
        deprecated:
            package: contao/core-bundle
            version: 4.13
            message: Using the "%alias_id%" service ID has been deprecated and will no longer work in Contao 5.0. Please use "contao.routing.response_context_factory" instead.

    Contao\CoreBundle\Security\TwoFactor\BackupCodeManager:
        alias: contao.security.two_factor.backup_code_manager
        public: true
        deprecated:
            package: contao/core-bundle
            version: 4.13
            message: Using the "%alias_id%" service ID has been deprecated and will no longer work in Contao 5.0. Please use "contao.security.two_factor.backup_code_manager" instead.

    Contao\CoreBundle\Twig\Extension\ContaoExtension:
        alias: contao.twig.extension
        public: true
        deprecated:
            package: contao/core-bundle
            version: 4.13
            message: Using the "%alias_id%" service ID has been deprecated and will no longer work in Contao 5.0. Please use "contao.twig.extension" instead.

    Contao\CoreBundle\Twig\Loader\ThemeNamespace:
        alias: contao.twig.loader.theme_namespace
        deprecated:
            package: contao/core-bundle
            version: 4.13
            message: Using the "%alias_id%" service ID has been deprecated and will no longer work in Contao 5.0. Please use "contao.twig.loader.theme_namespace" instead.

    Contao\CoreBundle\Twig\Loader\TemplateLocator:
        alias: contao.twig.loader.template_locator
        deprecated:
            package: contao/core-bundle
            version: 4.13
            message: Using the "%alias_id%" service ID has been deprecated and will no longer work in Contao 5.0. Please use "contao.twig.loader.template_locator" instead.

    Contao\CoreBundle\Twig\Loader\ContaoFilesystemLoaderWarmer:
        alias: contao.twig.filesystem_loader_warmer
        deprecated:
            package: contao/core-bundle
            version: 4.13
            message: Using the "%alias_id%" service ID has been deprecated and will no longer work in Contao 5.0. Please use "contao.twig.filesystem_loader_warmer" instead.

    Contao\CoreBundle\Util\SimpleTokenExpressionLanguage:
        alias: contao.string.simple_token_expression_language
        deprecated:
            package: contao/core-bundle
            version: 4.13
            message: Using the "%alias_id%" service ID has been deprecated and will no longer work in Contao 5.0. Please use "contao.string.simple_token_expression_language" instead.

    Contao\CoreBundle\Util\SimpleTokenParser:
        alias: contao.string.simple_token_parser
        public: true
        deprecated:
            package: contao/core-bundle
            version: 4.13
            message: Using the "%alias_id%" service ID has been deprecated and will no longer work in Contao 5.0. Please use "contao.string.simple_token_parser" instead.
