{#
/**
 * @see core/modules/system/templates/form-element.html.twig
 */
#}
{%
  set classes = [
    'js-form-item',
    'form-item',
    'js-form-type-' ~ type|clean_class,
    'form-item-' ~ name|clean_class,
    'js-form-item-' ~ name|clean_class,
    title_display not in ['after', 'before'] ? 'form-no-label',
    disabled == 'disabled' ? 'form-disabled',
    errors ? 'form-item--error',
  ]
%}
{%
  set description_classes = [
    'description',
    description_display == 'invisible' ? 'visually-hidden',
  ]
%}
<div{{ attributes.addClass(classes) }}>
  {% if label_display in ['before'] %}
    <div class="label">
      {{ label }}
    </div>
  {% endif %}
  <div class="field">
    {% if prefix is not empty %}
      <span class="field-prefix">{{ prefix }}</span>
    {% endif %}
    {% if description_display == 'before' and description.content %}
      <div{{ description.attributes }}>
        {{ description.content }}
      </div>
    {% endif %}
    {{ children }}
    {% if suffix is not empty %}
      <span class="field-suffix">{{ suffix }}</span>
    {% endif %}
    {% if label_display in ['after', 'invisible'] %}
      {{ label }}
    {% endif %}
    {% if errors %}
      <div class="form-item--error-message">
        {{ errors }}
      </div>
    {% endif %}
    {% if description_display in ['after', 'invisible'] and description.content %}
      <div{{ description.attributes.addClass(description_classes) }}>
        {{ description.content }}
      </div>
    {% endif %}
  </div>
</div>
