<div class="trace trace-as-html">
    <table class="trace-details">
        <thead class="trace-head">
            <tr>
                <th class="sf-toggle" data-toggle-selector="#trace-html-{{ index }}" data-toggle-initial="{{ expand ? 'display' }}">
                    <h3 class="trace-class">
                        <span class="trace-namespace">
                            {{ exception.class|split('\\')|slice(0, -1)|join('\\') }}
                            {{- exception.class|split('\\')|length > 1 ? '\\' }}
                        </span>
                        {{ exception.class|split('\\')|last }}

                        <span class="icon icon-close">{{ include('@Twig/images/icon-minus-square-o.svg') }}</span>
                        <span class="icon icon-open">{{ include('@Twig/images/icon-plus-square-o.svg') }}</span>
                    </h3>

                    {% if exception.message is not empty and index > 1 %}
                        <p class="break-long-words trace-message">{{ exception.message }}</p>
                    {% endif %}
                </th>
            </tr>
        </thead>

        <tbody id="trace-html-{{ index }}" class="sf-toggle-content">
        {% set _is_first_user_code = true %}
        {% for i, trace in exception.trace %}
            {% set _display_code_snippet = _is_first_user_code and ('/vendor/' not in trace.file) and ('/var/cache/' not in trace.file) and (trace.file is not empty) %}
            {% if _display_code_snippet %}{% set _is_first_user_code = false %}{% endif %}
            <tr>
                <td class="trace-line {{ trace.file|default(false) ? 'sf-toggle' }}" data-toggle-selector="#trace-html-{{ index }}-{{ i }}" data-toggle-initial="{{ _display_code_snippet ? 'display' }}">
                    {{ include('@Twig/Exception/trace.html.twig', { prefix: index, i: i, trace: trace }, with_context = false) }}
                </td>
            </tr>
        {% endfor %}
        </tbody>
    </table>
</div>
