<script id="eln-product-category-filter-template" type="text/x-magento-template">
    <div class="eln-filter-item filter-options-item" attribute-code="categories">
        <div data-role="title" class="filter-options-title"><?php echo __("Categories"); ?></div>
        <div class="eln-filter-content filter-options-content" data-role="eln-product-category-filter-content">
            <ul></ul>
        </div>
    </div>
</script>

<script id="eln-product-category-filter-item-template" type="text/x-magento-template">
    <li<% if (category.children) { %> class="children <% if (category.count < 0) { %>disabled<% } %>"<% } %> category-id="<%= category.id %>" data-role="eln-product-category-filter-item-filter-content">
        <span class="tree"/>
        <a href="#" class="eln-filter-option filter-option <% if (category.count < 0) { %>disabled<% } %>" style="display:block" attribute-code="categories_ids" option-id="<%= category.id %>">
          <input type="checkbox" <% if (selected) { %>checked="checked"<% } %>/>
          <div title="<%= category.label %><% if (showResultsCount == 1 && category.count > 0) { %> (<%= category.count %>)<% } %>" style="float: none;max-width: 100%;width: 100%;">
            <span class="title <% if (selected) { %>selected<% } %>" category-id="<%= category.id %>"><%= category.label %></span><% if (showResultsCount == 1 && category.count > 0) { %><span class="count"><%= category.count %></span><% } %>
          </div>
        </a>
        <ul id="eln-category-<%= category.id %>"></ul>
    </li>
</script>
