<?php
/**
 * @author 1902 Software
 * @copyright Copyright © 2023 1902 Software (https://1902software.com/magento/)
 * @package WriteTextAI_WriteTextAI
 */
?>
<fieldset class="wtai-fieldset wtai-col wtai-input-col">
    <?= /* @noEscape */ $block->createBlockContent(
        'WriteTextAI_WriteTextAI::notification/custom_text_warning.phtml'
    ); ?>
    <div class="wtai-field-rows">
        <div class="wtai-field">
            <div class="wtai-fieldset-title">
                <?= $escaper->escapeHtml(__('Description')) ?>
            </div>
            <p><?= $escaper->escapeHtml(__('Target length (in words)')) ?></p>
        </div>
        <div class="wtai-field admin__field row">
            <div class="wtai-control">
                <label class="wtai-label"><?= $escaper->escapeHtml(__('Min')) ?></label>
                <input type="number"
                    class="admin__control-text wtai-input-number"
                    name="description_min"
                    data-bind="
                        value: descMin,
                        event: {
                            blur: validateMinMax,
                            keypress: ensureNumerical
                        }, attr: {
                            min: rules().minOutputWords,
                            max: descMax() - 1
                        },
                        enable: wordsAllowed
                    "
                />
                <div class="wtai-error-message"></div>
            </div>
            <div class="wtai-control">
                <label class="wtai-label"><?= $escaper->escapeHtml(__('Max')) ?></label>
                <input type="number"
                    class="admin__control-text wtai-input-number"
                    name="description_max"
                    data-bind="
                        value: descMax,
                        event: {
                            blur: validateMinMax,
                            keypress: ensureNumerical
                        },
                        attr: {
                            min: Number(descMin()) + 1,
                            max: rules().maxOutputWords
                        },
                        enable: wordsAllowed
                    "
                />
                <div class="wtai-error-message"></div>
            </div>
        </div>
    </div>
    <div class="wtai-field-rows">
        <div class="wtai-field">
            <div class="wtai-fieldset-title">
                <?= $escaper->escapeHtml(__('Short description')) ?>
            </div>
            <p><?= $escaper->escapeHtml(__('Target length (in words)')) ?></p>
        </div>
        <div class="wtai-field admin__field row">
            <div class="wtai-control">
                <label class="wtai-label"><?= $escaper->escapeHtml(__('Min')) ?></label>
                <input type="number"
                    class="admin__control-text wtai-input-number"
                    name="excerpt_min"
                    data-bind="
                        value: excMin,
                        event: {
                            blur: validateMinMax,
                            keypress: ensureNumerical
                        },
                        attr: {
                            min: rules().minOutputWords,
                            max: excMax() - 1
                        },
                        enable: wordsAllowed
                    "
                />
                <div class="wtai-error-message"></div>
            </div>
            <div class="wtai-control">
                <label class="wtai-label"><?= $escaper->escapeHtml(__('Max')) ?></label>
                <input type="number"
                    class="admin__control-text wtai-input-number"
                    name="excerpt_max"
                    data-bind="
                        value: excMax,
                        event: {
                            blur: validateMinMax,
                            keypress: ensureNumerical
                        },
                        attr: {
                            min: Number(excMin()) + 1,
                            max: rules().maxOutputWords
                        },
                        enable: wordsAllowed
                    "
                />
                <div class="wtai-error-message"></div>
            </div>
        </div>
    </div>
</fieldset>