{%
  set classes = [
    'bef-links',
    is_nested ? 'bef-nested'
  ]
%}
{% set is_nested = true %}
{% for name, value in hiddens %}
<input type="hidden" name="{{ name }}" value="{{ value }}" />
{% endfor %}
<div{{ attributes.removeClass('form-select').addClass(classes) }}>
  {% set current_nesting_level = 0 %}
  {% for child in children %}
    {% set item = attribute(element, child) %}
    {% if child in selected %}
      {% set new_nesting_level = attribute(depth, child) ?? 0 %}
    {% endif %}
    {% set new_nesting_level = attribute(depth, child) ?? 0%}
    {% include '@better_exposed_filters/bef-nested-elements.html.twig' %}
    {% set current_nesting_level = new_nesting_level %}
  {% endfor %}
</div>
