<?php
/**
 * Copyright © Codazon, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

/** @var \Magento\Newsletter\Block\Subscribe $block */
?>

<?php
$ampHelper = $this->helper(\Codazon\GoogleAmpManager\Helper\Data::class);
?>
<div class="cdz-block cdz-block-newsletter">
    <label class="cdz-title" for="cdz-subscribe-email">
        <?= $block->escapeHtml(__('Sign Up for Our Newsletter')) ?>
    </label>
    <div class="cdz-content">
        <form class="cdz-amp-form cdz-subscribe-form" action-xhr="<?= $ampHelper->filterUrl($block->escapeUrl($block->getUrl('amp/amphandle_newsletter_subscriber/new'))) ?>" method="post" id="cdz-subscribe-form" on="submit-success: AMP.setState({page_message: event.response.message, page_message_type: event.response.message_type}), cdz-page-message-popup.show, cdz-subscribe-form.clear">
            <div class="field newsletter">
                <div class="control">
                    <input name="email" type="email" id="cdz-subscribe-email" placeholder="<?= $block->escapeHtmlAttr(__('Enter your email address')) ?>" class="input-large" required />
                </div>
            </div>
            <div class="actions">
                <button class="action subscribe primary"
                        title="<?= $block->escapeHtmlAttr(__('Subscribe')) ?>"
                        type="submit"
                        aria-label="Subscribe">
                    <span><?= $block->escapeHtml(__('Subscribe')) ?></span>
                </button>
            </div>
        </form>
    </div>
</div>
