{% comment %}
Renders the "Create new option" element if enabled.
{% endcomment %}
{% load i18n %}
option_create: function(data, escape) {
    {% if 'create_with_htmx' in widget.keys and widget.create_with_htmx %}
        return `<div class="create"
                    hx-post="{% url 'create' %}"
                    hx-swap="outerHTML"
                    hx-trigger="click"
                    hx-target="#id_{{ name }}"
                    role="option"
                    aria-label="{% translate 'Create new item' %}">${escape(data.input)}</div>`;
    {% else %}
        return `<div class="create" role="option">
            {% translate "Add" %} <strong>${escape(data.input)}</strong>&hellip;
        </div>`;
    {% endif %}
},
