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

/** @var \Magento\Wishlist\Block\Item\configure $block */
?>

<div class="product-addto-links" data-role="add-to-links">
    <?php if ($this->helper(\Magento\Wishlist\Helper\Data::class)->isAllow()) : ?>
        <a href="#" data-post='<?= /* @noEscape */ $block->getUpdateParams() ?>' class="action towishlist updated" data-action="add-to-wishlist">
            <span><?= $block->escapeHtml(__('Update Wish List')) ?></span>
        </a>
    <?php endif; ?>
    <?php $_product = $block->getProduct(); ?>
    <?php $_compareUrl = $this->helper(\Magento\Catalog\Helper\Product\Compare::class)->getAddUrl($_product); ?>
    <?php if ($_compareUrl) : ?>
        <a href="<?= $block->escapeUrl($_compareUrl) ?>" class="action tocompare">
            <span><?= $block->escapeHtml(__('Add to Compare')) ?></span>
        </a>
    <?php endif; ?>
</div>
<script type="text/x-magento-init">
    {
        "body": {
            "addToWishlist": <?= /* @noEscape */ $this->helper(\Magento\Framework\Json\Helper\Data::class)->jsonEncode($block->getWishlistOptions()) ?>
        }
    }
</script>
