{% set allowOverrides = allowOverrides ?? false %}

{% embed '_includes/forms/componentSelect.twig' with {
  options: options ?? craft.app.entries.getAllEntryTypes(),
  showHandles: true,
  showIndicators: showIndicators ?? allowOverrides,
  inputValueFn: et => allowOverrides ? et.toArray(['id', 'name', 'handle']) : null,
  createAction: (create ?? false) ? 'entry-types/edit' : null,
  jsClass: 'Craft.EntryTypeSelectInput',
  jsSettings: {
    allowOverrides,
  }|merge(jsSettings ?? {}),
} %}
  {% block chips %}
    {% for entryType in values %}
      <li>
        {% set chip = chip(entryType, {
          inputName: inputName ?? name ?? null,
          inputValue: allowOverrides ? {
            id: entryType.id,
            name: (entryType.original.name ?? entryType.name) != entryType.name ? entryType.name : null,
            handle: (entryType.original.handle ?? entryType.handle) != entryType.handle ? entryType.handle : null,
          }|filter|json_encode : null,
          checkbox: selectable ?? false,
          showActionMenu: showActionMenus,
          showHandle: showHandles,
          showIndicators: showIndicators,
          hyperlink: hyperlinks,
        }) %}
        {% if disabled %}
          {% set chip = chip|removeClass('removable') %}
        {% endif %}
        {{ chip|raw }}
      </li>
    {% endfor %}
  {% endblock %}
{% endembed %}
