<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());

    if (taxPercent > 0 && isLoggedIn) {
        if (sameState) { %>
    <p class="vat-field bp-control__commission2" data-cond="test.2.1">
        <span>Sales Tax: <%- taxPercent %>% Sales Tax on item price &amp; buyer's premium</span>
    </p>
    <%  } else { %>
    <p class="vat-field bp-control__commission2" data-cond="test.2.1">
        <span>Sales Tax: 0%</span>
    </p>
    <%  }
    } else if (taxPercent > 0 && !isLoggedIn) {
        // Not logged in, tax is configured but don't show to anonymous users
    } else if (taxPercent === 0) {
        // No tax configured at all - show nothing
    }
    %>
</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>
