<?php
/**
 * @author 1902 Software
 * @copyright Copyright © 2023 1902 Software (https://1902software.com/magento/)
 * @package WriteTextAI_WriteTextAI
 */
?>

<?php
    use WriteTextAI\WriteTextAI\ViewModel\Popups;
?>

<?php
    /** @var Popups $popups */
    $popups = $block->getPopups();
    $showByConfig = $popups->showPopup('welcome_new_version');

    $showPopup = $showByConfig;
?>

<div class="wtai-welcome-new-version-popup-modal" data-bind="
    scope: 'wtaiWelcomeNewVersionPopup'
" style="display: none;">
    <div class="wtai-popup-content">
        <div class="wtai-popup-image">
            <img src="<?= /* @noEscape */ $block->getViewFileUrl(
                'WriteTextAI_WriteTextAI/images/welcome_bannerv2.png'
            ) ?>" alt="Welcome new version">
        </div>
        <div class="wtai-popup-text">
            <div class="wtai-popup-title">
                <?= /* @noEscape */ __("Welcome to version 3.7") ?>
            </div>
            
            <div>
                <p>
                    <?= /* @noEscape */ __(
                        "You’ll notice improvements to how bulk workflows and queues behave, along with small but meaningful usability updates such as:"
                    ) ?>
                </p>
                <p class="wtai-check-item">
                    <span class="wtai-check-icon"></span>
                    <span>
                        <?= /* @noEscape */ __("Clearer statuses and progress feedback") ?>
                    </span>
                </p>
                <p class="wtai-check-item">
                    <span class="wtai-check-icon"></span>
                    <span>
                        <?= /* @noEscape */ __("Improved bulk action handling") ?>
                    </span>
                </p>
                <p class="wtai-check-item">
                    <span class="wtai-check-icon"></span>
                    <span>
                        <?= /* @noEscape */ __("Refined help text and general bug fixes") ?>
                    </span>
                </p>
                <p class="wtai-check-item">
                    <span class="wtai-check-icon"></span>
                    <span>
                        <?= /* @noEscape */ __("UI and performance improvements") ?>
                    </span>
                </p>
            </div>
            <div class="wtai-popup-buttons">
                <button type="button" class="action-primary primary" data-bind="click: closeNewVersionPopup">
                    <?= $block->escapeHtml(__('Got it')) ?>
                </button>
            </div>
        </div>
    </div>
</div>
<script type="text/x-magento-init">
    {
        "*": {
            "Magento_Ui/js/core/app": {
                "components": {
                    "wtaiWelcomeNewVersionPopup": {
                        "component": "WriteTextAI_WriteTextAI/js/popups/welcome-new-version",
                        "saveUrl": "<?= $block->escapeJs($block->getUrl('wtai/settings/popups')) ?>",
                        "showPopupOnLoad": <?= /* @noEscape */ $showPopup ? 'true' : 'false' ?>
                    }
                }
            }
        }
    }
</script>