{% macro menu_links(parentId, links, liClass = "main-menu__item", aclass = "main-menu__link") %}
{% if links.parents[parentId]|length > 0 %}
{% for itemId in links.parents[parentId] %}
{% set item = links.items[itemId] %}
<li data-mobile-menu-item>
{% if links.parents[itemId] is defined %}
<div class="accordion">
<div class="accordion-item">
<h2 class="accordion-header" id="panelsStayOpen-headingOne">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#panelsStayOpen-collapseOne" aria-expanded="true" aria-controls="panelsStayOpen-collapseOne">
{{ item.getTitle() }}
</button>
</h2>
<div id="panelsStayOpen-collapseOne" class="accordion-collapse collapse" aria-labelledby="panelsStayOpen-headingOne">
<div class="accordion-body">
<ul class="list-unstyled fast-inner-overlay-menu">
{% import _self as m %}
{{ m.menu_links(itemId, links, 'menu__item', 'menu_link') }}
</ul>
</div>
</div>
</div>
</div>
{% endif %}
{% if links.parents[itemId] is not defined %}
<a href="{{ path(item.getRouteName()) }}" data-mobile-menu-trigger>{{ item.getTitle() }}</a>
{% endif %}
</li>
{% endfor %}
{% endif %}
{% endmacro %}
<ul class="list-unstyled fast-overlay-menu">
{{ _self.menu_links(0, links) }}
</ul>