{% if this.isEnabled %}
    <div {{ attributes.defaults({ class: 'theme-shop-partner', 'aria-live': 'polite' }) }}>
        {% if this.isActive %}
            <div class="theme-shop-partner__panel theme-shop-partner__panel--active">
                <div class="theme-shop-partner__status" aria-hidden="true">
                    <svg viewBox="0 0 24 24" focusable="false">
                        <path d="m5 12.5 4.2 4.2L19 7" />
                    </svg>
                </div>

                <div class="theme-shop-partner__content">
                    <div class="theme-shop-partner__title">{{ 'shop.partner_area'|trans }}</div>
                    <div class="theme-shop-partner__text">
                        {{ 'shop.view_partner_price'|trans({'%code%': currentGroupName|default(currentCode), '%group%': currentGroupName|default(currentCode)}) }}
                    </div>
                </div>

                <button
                    type="button"
                    data-action="live#action"
                    data-live-action-param="reset"
                    class="theme-shop-partner__reset"
                    title="{{ 'shop.reset_partner_code'|trans }}">
                    <svg viewBox="0 0 24 24" aria-hidden="true" focusable="false">
                        <path d="M4.9 7.8A8 8 0 1 1 4 14" />
                        <path d="M4 4v4h4" />
                    </svg>
                    {{ 'shop.reset'|trans }}
                </button>
            </div>
        {% else %}
            <div class="theme-shop-partner__panel">
                <div class="theme-shop-partner__title">{{ 'shop.partner_area'|trans }}</div>
                <div class="theme-shop-partner__form">
                    <input
                        type="text"
                        data-model="norender|code"
                        value="{{ code }}"
                        placeholder="{{ 'shop.group_code_placeholder'|trans }}"
                        class="theme-shop-input">
                    <button
                        type="button"
                        data-action="live#action"
                        data-live-action-param="apply"
                        class="theme-button-fill theme-hover-link-effect">
                        {{ 'shop.partner_valid'|trans }}
                    </button>
                </div>

                {% if errorMessage %}
                    <div class="theme-shop-partner__error">
                        {{ errorMessage }}
                    </div>
                {% endif %}
            </div>
        {% endif %}
    </div>
{% endif %}
