{# Match the existing central login redirect state; these links do not grant access. #}
{% set website_signed_in = app.session and (app.session.get('userEmail') or app.session.get('userId')) %}
{% if website_signed_in %}
<a class="hbp-companies-link" href="{{ path('central_landing') }}">My companies</a>
<details class="hbp-account">
{% set account_name = app.session.get('userName')|default('Account', true)|trim %}
<summary title="{{ account_name }}" aria-label="{{ account_name }} account menu"><span class="hbp-account-label"><span class="hbp-account-full" aria-hidden="true">{{ account_name }}</span><span class="hbp-account-short" aria-hidden="true">{{ account_name|split(' ')|last }}</span></span><span class="hbp-account-chevron" aria-hidden="true"></span></summary>
<div>
<a href="{{ path('honeybee_tool', {'slug':'rooftop-estimate'}) }}">Public Solar Studio</a>
{% if app.session.get('userType') == 8 %}<a href="{{ path('hb360_my_estimate') }}">My Solar Estimates</a>{% endif %}
<a href="{{ path('honeybee_my_freelancer_profile') }}">Profile</a>
<a href="{{ path('ticket_list') }}">My tickets</a>
{% if app.session.get('buddybeeAdminLevel', 0) >= 1 or app.session.has('actualUserIsAdmin') %}
<a href="{{ path('central_landing') }}#account-switch-user">Switch user</a>
{% endif %}
{% if app.session.get('buddybeeAdminLevel', 0) >= 1 %}
<a href="{{ path('super_admin_command_center') }}">Super Admin</a>
<a href="{{ path('datev_home') }}">Datev Control</a>
{% endif %}
{% if app.session.get('buddybeeAdminLevel', 0) > 1 %}
<a href="{{ path('admin_demo_pending_list') }}">Demo requests</a>
<a href="{{ path('admin_demo_all_list') }}">All bookings</a>
{% endif %}
<a href="{{ path('user_logout') }}">Sign out</a>
</div>
</details>
{% else %}
<a class="hbp-signin-link" href="{{ path('user_login') }}">Sign in</a>
{% endif %}