<div class="card mb-3 d-none d-sm-flex">
    <div class="card-header breadcrumb mb-0" id="categoryHeading">
        <h5 class="mb-0">
            <button class="btn btn-link text-dark" data-toggle="collapse" data-target="#category"
                    aria-expanded="true" aria-controls="category">
                <i class="fas fa-stream"></i>
                {{ trans("visiosoft.module.cats::addon.title") }}
            </button>
        </h5>
    </div>
    <div id="category" class="collapse show overflow-auto" aria-labelledby="categoryHeading" style="max-height: 300px;">
        <div class="list-group">
            {% for maincat in params.mainCats|reverse %}
                {% set citySlug = null %}
                {% set pathInfo = app.request.pathinfo|split('/') %}

                {% if pathInfo|length is same as(4) %}
                    {% set citySlug = pathInfo[3] %}
                {% endif %}

                {% set url = appendRequestURL(request_query(),url_route('adv_list_seo', [maincat.slug, citySlug]),{},['page']) %}

                {% if viewType == "map" %}
                    {% set url = appendRequestURL(request_query(),url_route('adv_list_seo'),{'cat':maincat.id},['page']) %}
                {% endif %}

                <a href="{{ url }}" class="list-group-item list-group-item-action text-truncate">
                    <i class="fas fa-dot-circle"></i>
                    {{ maincat.name }}
                </a>
                {% if maincat.id == params.category.id %}
                    {% for subcat in params.subCats %}
                        <div class="list-group pl-3 bg-light">

                            {% set url = appendRequestURL(request_query(),url_route('adv_list_seo', [subcat.slug, citySlug]),{},['page']) %}

                            {% if viewType == "map" %}
                                {% set url = appendRequestURL(request_query(),url_route('adv_list_seo'),{'cat':subcat.id},['page']) %}
                            {% endif %}

                            <a href="{{ url }}" class="list-group-item list-group-item-action text-truncate">
                                {{ subcat.name }}
                            </a>
                        </div>
                    {% endfor %}
                {% endif %}
            {% endfor %}
        </div>
    </div>
</div>