<?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 WriteText.ai 4.3") ?>
            </div>
            <div>
                <p class="wtai-popup-text-description">
                    <?= /* @noEscape */ __(
                        'Version 4.3 brings full support for different product types,'
                        . ' integrated People Also Ask data, and a set of configuration and workflow improvements.'
                    ) ?>
                </p>
                <p class="wtai-check-item">
                    <span class="wtai-check-icon wtai-check-icon-top" ></span>
                    <span>
                    <?= /* @noEscape */ __(
                        '<strong>Get content suited to each product type</strong>: '
                         . 'simple, bundled, grouped, configurable, virtual, and downloadable.'
                    ) ?>
                    </span>
                </p>
                 <p class="wtai-check-item">
                    <span class="wtai-check-icon wtai-check-icon-top"></span>
                    <span>
                       <?= /* @noEscape */ __(
                           '<strong>Add People Also Ask (PAA) questions</strong>'
                           . ' as individual content blocks or FAQ basis, '
                           . 'each with a focused answer structured for direct answer formats and '
                           . 'AI-generated results for AEO and GEO visibility.'
                       ) ?>
                    </span>
                </p>
                <p class="wtai-check-item">
                    <span class="wtai-check-icon wtai-check-icon-top"></span>
                    <span>
                        <?= /* @noEscape */ __(
                            '<strong>And more</strong>: save global settings in one click, '
                            . 'edit brand voices, include product tags as a data source, '
                            . 'and filter by category in the bulk grid.'
                        ) ?>
                    </span>
                </p>
            </div>
            <div class="wtai-popup-buttons">
                <button type="button" class="action-primary primary" data-bind="click: closeNewVersionPopup">
                    <?= $escaper->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": "<?= $escaper->escapeJs($block->getUrl('wtai/settings/popups')) ?>",
                        "showPopupOnLoad": <?= /* @noEscape */ $showPopup ? 'true' : 'false' ?>
                    }
                }
            }
        }
    }
</script>