{% set embedded = embedded | default(False) %}
{% set person = person | default(entity) %}
{% set person_context = entity_contexts['person'] %}
{% set label_as_link = not embedded and person_context != person and person is persistent_entity_id and person is public %}
{% if label_as_link -%}
    <a href="{{ person | url }}">
{%- endif %}
{% if person.private -%}
    <span class="private" title="{% trans %}This person's details are unavailable to protect their privacy.{% endtrans %}">{% trans %}private{% endtrans %}</span>
{%- else -%}
    {%- if person.names | length -%}
        {% with person_name = person.names | select('public') | first | default(person.names | first), embedded=True %}
            {% include 'entity/label--person-name.html.j2' %}
        {% endwith %}
    {%- else -%}
        <span class="nn" title="{% trans %}This person's name is unknown.{% endtrans %}">n.n.</span>
    {%- endif -%}
{%- endif -%}
{%- if label_as_link -%}
    </a>
{%- endif -%}
