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

<aside role="dialog"
       class="modal-<%- data.type %> <%- data.modalClass %>
       <% if(data.responsive){ %><%- data.responsiveClass %><% } %>
       <% if(data.innerScroll){ %><%- data.innerScrollClass %><% } %>"
       <% if(data.title){ %> aria-labelledby="modal-title-<%- data.id %>"<% } %>
       aria-describedby="modal-content-<%- data.id %>"
       data-role="modal"
       data-type="<%- data.type %>"
       tabindex="0">
    <div data-role="focusable-start" tabindex="0"></div>
    <div class="modal-inner-wrap"
         data-role="focusable-scope">
        <header class="modal-header">
            <% if(data.title || data.subTitle){ %>
            <h1 id="modal-title-<%- data.id %>" class="modal-title"
                data-role="title">
                <% if(data.title){ %>
                    <%= data.title %>
                <% } %>

                <% if(data.subTitle){ %>
                <span class="modal-subtitle"
                      data-role="subTitle">
                    <%= data.subTitle %>
                </span>
                <% } %>
            </h1>
            <% } %>
            <button
                class="action-close"
                data-role="closeBtn"
                type="button">
                <span><%= data.closeText %></span>
            </button>
        </header>
        <div id="modal-content-<%- data.id %>" class="modal-content" data-role="content"></div>
        <% if(data.buttons.length > 0){ %>
        <footer class="modal-footer">
            <!-- Start WTAI Prompt Footer -->
            <div class="wtai-submit-actions"
                id="wtaiPromptFooter"
                data-bind="scope: 'wtaiPromptFooter'"
                data-mage-init='{"WriteTextAI_WriteTextAI/js/grid/massactions/prompt/footer": {}}'
            >
                <span class="wtai-subtitle-link">
                    <a href="https://writetext.ai/knowledge-base/plans-pricing/how-is-credit-cost-calculated"
                        target="_blank"
                        data-bind="i18n: 'How is credit cost calculated?'"
                    ></a>
                </span>
            </div>
            <!-- End WTAI Prompt Footer -->
            <% _.each(data.buttons, function(button) { %>
            <button class="<%- button.class %>"
                    type="button"
                    data-role="action">
                <span><%= button.text %></span>
            </button>
            <% }); %>
            <div class="wtai-empty-template-confirm"
                id="wtaiEmptyTemplateConfirm"
                data-bind="scope: 'wtaiEmptyTemplateConfirm', visible: isVisible"
                data-mage-init='{"WriteTextAI_WriteTextAI/js/grid/massactions/prompt/empty-template-confirm": {}}'
                style="display: none;"
            >
                <div class="wtai-empty-template-confirm-overlay"></div>
                <div class="wtai-empty-template-confirm-content">
                    <div class="wtai-empty-template-confirm-text" data-bind="i18n: 'You have not selected a template, if you continue without selecting a template the output may not be formatted according to your expectations.'"></div>
                    <div class="wtai-empty-template-confirm-buttons">
                        <button class="wtai-action-secondary action-back"
                                type="button"
                                data-role="action">
                            <span data-bind="i18n: 'Go back'"></span>
                        </button>
                        <button class="wtai-action-primary action-accept wtai-default-width"
                                type="button"
                                data-role="action">
                            <span data-bind="i18n: 'Continue'"></span>
                        </button>
                    </div>
                    <div class="wtai-arrow-bottom"></div>
                </div>
            </div>
        </footer>
        <% } %>
    </div>
    <div data-role="focusable-end" tabindex="0"></div>
</aside>
