<?php
/**
 * Hyvä Themes - https://hyva.io
 * Copyright © Hyvä Themes 2020-present. All rights reserved.
 * This product is licensed per Magento install
 * See https://hyva.io/license
 */

use Magento\Framework\Pricing\Render\Amount;
use Magento\Framework\Escaper;

/** @var Amount $block */
/** @var Escaper $escaper */
?>
<span
    <?php if ($block->getPriceId()): ?>x-data x-id="['<?= $escaper->escapeJs($block->getPriceId()) ?>']"<?php endif; ?>
    class="price-container <?= $escaper->escapeHtmlAttr($block->getAdjustmentCssClasses()) ?>"
        <?= $block->getSchema() ? ' itemprop="offers" itemscope itemtype="https://schema.org/Offer"' : '' ?>
>
    <?php if ($block->getDisplayLabel()): ?>
        <span class="price-label hidden"><?= $escaper->escapeHtml($block->getDisplayLabel()) ?></span>
    <?php endif; ?>
    <span <?php if ($block->getPriceId()): ?> :id="$id('<?= $escaper->escapeJs($block->getPriceId()) ?>')"<?php endif; ?>
        <?= ($block->getPriceDisplayLabel()) ? 'data-label="' . $escaper->escapeHtmlAttr($block->getPriceDisplayLabel() . $block->getPriceDisplayInclExclTaxes()) . '"' : '' ?>
        data-price-amount="<?= $escaper->escapeHtmlAttr($block->getDisplayValue()) ?>"
        data-price-type="<?= $escaper->escapeHtmlAttr($block->getPriceType()) ?>"
        class="price-wrapper <?= $escaper->escapeHtmlAttr($block->getPriceWrapperCss()) ?>"
    ><?= $escaper->escapeHtml($block->formatCurrency($block->getDisplayValue(), (bool)$block->getIncludeContainer()), ['span']) ?></span>

    <?php if ($block->hasAdjustmentsHtml()): ?>
        <?= $block->getAdjustmentsHtml() ?>
    <?php endif; ?>
    <?php if ($block->getSchema()): ?>
        <meta itemprop="price" content="<?= $escaper->escapeHtmlAttr($block->getDisplayValue()) ?>" />
        <meta itemprop="priceCurrency" content="<?= $escaper->escapeHtmlAttr($block->getDisplayCurrencyCode()) ?>" />
    <?php endif; ?>
</span>
