<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <!--HELP-->
    <preference for="Mirasvit\Core\Api\Service\ManualServiceInterface" type="Mirasvit\Core\Service\ManualService"/>

    <!--INTERFACES-->

    <!--SERVICES-->
    <preference for="Mirasvit\Core\Api\Service\ValidationServiceInterface" type="Mirasvit\Core\Service\ValidationService"/>
    <preference for="Mirasvit\Core\Api\Service\CronServiceInterface" type="Mirasvit\Core\Service\CronService"/>

    <type name="Magento\Backend\Model\View\Result\Page">
        <plugin name="Mirasvit_Core::addAdminThemeClass" type="Mirasvit\Core\Plugin\AddAdminThemeClassPlugin" sortOrder="100"/>
    </type>

    <type name="Mirasvit\Core\Api\Service\ValidationServiceInterface">
        <arguments>
            <argument name="validators" xsi:type="array">
                <item name="core" xsi:type="object">Mirasvit\Core\Service\GeneralValidationService</item>
            </argument>
        </arguments>
    </type>

    <!-- CLI Commands -->
    <!-- Proxies: every command is built on every bin/magento run. -->
    <type name="Mirasvit\Core\Console\Command\LicenseCheckCommand">
        <arguments>
            <argument name="notificationCheckCron" xsi:type="object">Mirasvit\Core\Cron\NotificationCheckCron\Proxy</argument>
            <argument name="messageCheckCron" xsi:type="object">Mirasvit\Core\Cron\MessageCheckCron\Proxy</argument>
        </arguments>
    </type>

    <type name="Magento\Framework\Console\CommandListInterface">
        <arguments>
            <argument name="commands" xsi:type="array">
                <item name="mstCoreValidation" xsi:type="object">Mirasvit\Core\Console\Command\ValidationCommand</item>
                <item name="mstCoreInternalization" xsi:type="object">Mirasvit\Core\Console\Command\I18nFrontCollectPhrasesCommand</item>
                <item name="mstCoreLicenseCheck" xsi:type="object">Mirasvit\Core\Console\Command\LicenseCheckCommand</item>
                <item name="mstCoreDegradationReport" xsi:type="object">Mirasvit\Core\Console\Command\DegradationReportCommand</item>
            </argument>
        </arguments>
    </type>

    <!--UI-->
    <type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
        <arguments>
            <argument name="collections" xsi:type="array">
                <item name="mst_core_cron_job_listing_data_source" xsi:type="string">Mirasvit\Core\Model\ResourceModel\Job\Grid</item>
            </argument>
        </arguments>
    </type>

</config>
