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

// phpcs:disable Magento2.Templates.ThisInTemplate

/** @var \Magento\Sales\Block\Adminhtml\Order\Create\Giftmessage $block */
?>
<?php if ($this->helper(\Magento\GiftMessage\Helper\Message::class)->isMessagesAllowed('main', $block->getQuote(), $block->getStoreId())) : ?>
    <?php $_items = $block->getItems(); ?>
    <div id="order-giftmessage" class="giftmessage-order-create">
        <fieldset class="admin__fieldset">
            <legend class="admin__legend"><span><?= $block->escapeHtml(__('Gift Message for the Entire Order')) ?></span></legend>
            <br>
            <?php if ($this->helper(\Magento\GiftMessage\Helper\Message::class)->isMessagesAllowed('main', $block->getQuote(), $block->getStoreId())) : ?>
                <p><?= $block->escapeHtml(__('Leave this box blank if you don\'t want to leave a gift message for the entire order.')) ?></p>
                <?= $block->getFormHtml($block->getQuote(), 'main') ?>
            <?php endif; ?>
        </fieldset>
        <script>
        require(['Magento_Sales/order/create/form'], function(){
            order.giftmessageFieldsBind('order-giftmessage');
        });
        </script>
    </div>
<?php endif; ?>
