<?xml version="1.0"?>
<!--
/**
 * @author 1902 Software
 * @copyright Copyright © 2023 1902 Software (https://1902software.com/magento/)
 * @package WriteTextAI_WriteTextAI
 */
-->

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <update handle="wtai_edit_block"/>
    <update handle="wtai_footer_block"/>
    <head>
        <script src="WriteTextAI_WriteTextAI::js/messages.js"/>
        <css src="WriteTextAI_WriteTextAI::css/owl.carousel.min.css"/>
    </head>
    <body>
		<referenceContainer name="header">
            <block name="wtai.grid.history" template="WriteTextAI_WriteTextAI::grid/history_log_button.phtml"/>
        </referenceContainer>
		<referenceContainer name="content">
            <block name="wtai.review.notice" class="WriteTextAI\WriteTextAI\Block\Adminhtml\ReviewNotice"
                template="WriteTextAI_WriteTextAI::review_notice.phtml" before="wtai.history.log">
                <arguments>
                    <argument name="premium" xsi:type="object">WriteTextAI\WriteTextAI\ViewModel\Premium</argument>
                </arguments>
            </block>
            <block name="wtai.history.log" template="WriteTextAI_WriteTextAI::edit/history_log.phtml" />
            <block name="wtai.image.upload.progressbar"
                   template="WriteTextAI_WriteTextAI::grid/popups/image_upload_progressbar.phtml"
            />
			<block name="wtai.progress.bar"
                class="WriteTextAI\WriteTextAI\Block\Adminhtml\Grid\ProgressBar"
                template="WriteTextAI_WriteTextAI::grid/popups/progressbar.phtml"
            >
                <arguments>
                    <argument name="cron_status_view_model" xsi:type="object">WriteTextAI\WriteTextAI\ViewModel\CronStatus</argument>
                </arguments>
            </block>
			<block name="wtai.signalr"
                class="WriteTextAI\WriteTextAI\Block\Adminhtml\Grid\ProgressBar"
                template="WriteTextAI_WriteTextAI::grid/popups/signalr.phtml"
            >
                <arguments>
                    <argument name="entity_type" xsi:type="string">Product</argument>
                </arguments>
            </block>
            <block name="wtai.cannibalization.analyzer" template="WriteTextAI_WriteTextAI::cannibalization/analyzer.phtml" before="-"/>
            <block name="wtai.slug.notice" template="WriteTextAI_WriteTextAI::grid/slug_notice.phtml">
                <arguments>
                    <argument name="entity_type" xsi:type="string">Product</argument>
                </arguments>
            </block>
            <uiComponent name="wtai_products_grid_listing" />
            <block name="wtai.grid.error.messages" template="WriteTextAI_WriteTextAI::grid/messages.phtml" />
            <block name="wtai.upload.images.loader" template="WriteTextAI_WriteTextAI::grid/popups/upload_images_loader.phtml" />
            <block name="wtai.grid.invalid.image.popup" template="WriteTextAI_WriteTextAI::grid/popups/invalid_image_popup.phtml" />
            <block name="wtai.grid.keyword.invalid.image.popup" template="WriteTextAI_WriteTextAI::grid/popups/keyword_invalid_image_popup.phtml" />
            <block name="wtai.premium.popup" template="WriteTextAI_WriteTextAI::grid/popups/premium_popup.phtml">
                <arguments>
                    <argument name="premium" xsi:type="object">WriteTextAI\WriteTextAI\ViewModel\Premium</argument>
                </arguments>
            </block>
            <block name="wtai.welcome.pro.popup" template="WriteTextAI_WriteTextAI::popups/welcome_pro.phtml">
                <arguments>
                    <argument name="premium" xsi:type="object">WriteTextAI\WriteTextAI\ViewModel\Premium</argument>
                </arguments>
            </block>
            <block name="wtai.welcome.enterprise.popup" template="WriteTextAI_WriteTextAI::popups/welcome_enterprise.phtml">
                <arguments>
                    <argument name="premium" xsi:type="object">WriteTextAI\WriteTextAI\ViewModel\Premium</argument>
                </arguments>
            </block>
            <block name="wtai.welcome.starter.popup" template="WriteTextAI_WriteTextAI::popups/welcome_starter.phtml">
                <arguments>
                    <argument name="premium" xsi:type="object">WriteTextAI\WriteTextAI\ViewModel\Premium</argument>
                </arguments>
            </block>
            <block name="wtai.start.trial.popup" template="WriteTextAI_WriteTextAI::popups/start_trial.phtml">
                <arguments>
                    <argument name="premium" xsi:type="object">WriteTextAI\WriteTextAI\ViewModel\Premium</argument>
                    <argument name="popups" xsi:type="object">WriteTextAI\WriteTextAI\ViewModel\Popups</argument>
                </arguments>
            </block>
            <block name="wtai.end.trial.popup" template="WriteTextAI_WriteTextAI::popups/end_trial.phtml">
                <arguments>
                    <argument name="premium" xsi:type="object">WriteTextAI\WriteTextAI\ViewModel\Premium</argument>
                    <argument name="popups" xsi:type="object">WriteTextAI\WriteTextAI\ViewModel\Popups</argument>
                </arguments>
            </block>
            <block name="wtai.no.more.trial.credits.popup" template="WriteTextAI_WriteTextAI::popups/no_more_trial_credits.phtml">
                <arguments>
                    <argument name="premium" xsi:type="object">WriteTextAI\WriteTextAI\ViewModel\Premium</argument>
                    <argument name="popups" xsi:type="object">WriteTextAI\WriteTextAI\ViewModel\Popups</argument>
                </arguments>
            </block>
            <block name="wtai.welcome.new.version.popup" template="WriteTextAI_WriteTextAI::popups/welcome_new_version.phtml">
                <arguments>
                    <argument name="popups" xsi:type="object">WriteTextAI\WriteTextAI\ViewModel\Popups</argument>
                </arguments>
            </block>
            <block name="wtai-last-load-data" template="WriteTextAI_WriteTextAI::grid/last_load_data.phtml">
                <arguments>
                    <argument name="entity_type" xsi:type="string">Product</argument>
                </arguments>
            </block>
		</referenceContainer>

		<move element="wtai.grid.history" after="global.search" destination="header.inner.right" />
        <move element="page.main.container" after="messages.wrapper" destination="page.content" />
        <move element="wtai.grid.error.messages" before="messages.wrapper" destination="page.content" />

        <referenceBlock name="global.search" remove="true" />
	</body>
</page>