<script type="text/template" id="vat-and-commission-template">
    <%
    var taxPercent = (typeof settings !== 'undefined' && settings.vat) ? parseFloat(settings.vat) : 0;
    var houseState = (typeof window.bs_data !== 'undefined' && window.bs_data.auction_house_state) ? window.bs_data.auction_house_state : '';
    var isLoggedIn = (typeof bidspiritUser !== 'undefined' && bidspiritUser !== null);
    var userState = '';
    if (isLoggedIn && bidspiritUser.address && bidspiritUser.address.countryCode === 'US') {
        userState = bidspiritUser.address.stateCode || bidspiritUser.address.state || '';
    }
    var sameState = (houseState !== '' && userState !== '' && houseState.toUpperCase() === userState.toUpperCase());
    var useSalesTax = (houseState !== '');

    if (taxPercent > 0) {
        if (useSalesTax) {
            if (isLoggedIn) {
                if (sameState) { %>
    <p class="vat-field bp-control__commission2">
        <span>Sales Tax: <%- taxPercent %>% Sales Tax on item price &amp; buyer's premium</span>
    </p>
    <%          } else { %>
    <p class="vat-field bp-control__commission2">
        <span>Sales Tax: 0%</span>
    </p>
    <%          }
            }
        } else { %>
    <?php if (isset($displayVatField) && $displayVatField == 'on') { ?>
    <% if (typeof auctionHouseData !== 'undefined' && auctionHouseData.houseCommissionVatRule === 'SHOULD_ADD_VAT') { %>
    <p class="vat-field bp-control__commission2">
        <span><?php echo __('VAT', 'auctionforge'); ?>: <%- taxPercent %>% <?php echo __('on item price and commission', 'auctionforge'); ?></span>
    </p>
    <% } else if (typeof auctionHouseData !== 'undefined' && auctionHouseData.houseCommissionVatRule === 'EXEMPTED_FROM_VAT') { %>
    <p class="vat-field bp-control__commission2">
        <span><?php echo __('VAT', 'auctionforge'); ?>: <%- taxPercent %>% <?php echo __('on item price only', 'auctionforge'); ?></span>
    </p>
    <% } else { %>
    <p class="vat-field bp-control__commission2">
        <span><?php echo __('VAT', 'auctionforge'); ?>: <%- taxPercent %>%</span>
    </p>
    <% } %>
    <?php } ?>
    <%  }
    }
    %>
</script>
<script type="text/template" id="full-price-template">
    <p class="vat-field modal__content__item bp-d-flex bp-label" data-cond="test.1">
        <span data-cond="test.1.1"><%- fullPriceInfo.totalPriceInfo.label %></span>
        &nbsp;<span><%- formattedPrice(fullPriceInfo.totalPriceInfo.price, currencySymbol) %>&nbsp;<%- text %></span>
    </p>
</script>
