{% import "system/macro/navigation/breadcrumb.html.twig" as breadcrumb %}

{% if not isPluginUnlocked() %}
    {{ messages() | raw }}
{% else %}
    {{ breadcrumb.component({items: [localized.breadcrumb.module]}, localized) }}

    {{ messages() | raw }}

    {% embed "system/embed/card/card-with-info-panel-below.html.twig" %}
        {% import "script-blocker/macro/script-blocker-table.html.twig" as script_blocker_table %}
        {% import "system/macro/card/card-heading.html.twig" as card_heading %}

        {% block mainHeader %}
            {{ card_heading.component({
                title: localized.headline.scriptBlockers,
                buttonText: localized.global.button.addNew,
                buttonLink: wpNonceUrl("?page=#{controllerId}&action=edit&id=-1", "#{controllerId}--1-edit"),
            }, localized) }}
        {% endblock %}

        {% block mainContent %}
            {{ script_blocker_table.component({
                controllerId: controllerId,
                scriptBlockers: data.scriptBlockers,
            }, localized) }}
        {% endblock %}

        {% block infoPanelHeader %}
            {{ localized.global.headline.thingsToKnow | raw }}
        {% endblock %}

        {% block infoPanelContent %}
            {% embed "system/embed/accordion/accordion-group.html.twig" %}
                {% block content %}
                    {% embed "system/embed/accordion/accordion-group.html.twig" %}
                        {% block content %}
                            {% embed "system/embed/accordion/accordion.html.twig" with { id: 'accordionScriptBlockerExplained', expanded: true } %}
                                {% block title %}
                                    {{ localized.thingsToKnow.headlinePurposeScriptBlockers | raw }}
                                {% endblock %}
                                {% block content %}
                                    <p>{{ localized.thingsToKnow.purposeScriptBlockersA | raw }}</p>
                                    <p>{{ localized.thingsToKnow.purposeScriptBlockersB | raw }}</p>
                                    <p>{{ localized.thingsToKnow.purposeScriptBlockersC | raw }}</p>
                                {% endblock %}
                            {% endembed %}

                            {% embed "system/embed/accordion/accordion.html.twig" with { id: 'accordionLanguageIndependent' } %}
                                {% block title %}
                                    {{ localized.thingsToKnow.languageIndependent | raw }}
                                {% endblock %}
                                {% block content %}
                                    {{ localized.thingsToKnow.languageIndependentExplained | raw }}
                                {% endblock %}
                            {% endembed %}

                            {% embed "system/embed/accordion/accordion.html.twig" with {id: 'accordionSymbolsExplained' } %}
                                {% import "system/macro/icons/edit.html.twig" as edit_icon %}
                                {% import "system/macro/icons/switch-off.html.twig" as switch_off %}
                                {% import "system/macro/icons/switch-on.html.twig" as switch_on %}
                                {% import "system/macro/icons/trash.html.twig" as trash_icon %}

                                {% block title %}
                                    {{ localized.thingsToKnow.headlineSymbolsExplained | raw }}
                                {% endblock %}
                                {% block content %}
                                    <ul class="bc-space-y-2 bc-text-left">
                                        <li>{{ switch_on.component({ color: 'bc-text-white', invertSlider: true }) }} {{ localized.thingsToKnow.symbolExplainedActive | raw }}</li>
                                        <li>{{ switch_off.component({ color: 'bc-text-white' }) }} {{ localized.thingsToKnow.symbolExplainedInactive | raw }}</li>
                                        <li>{{ trash_icon.component({}) }} {{ localized.thingsToKnow.symbolExplainedDelete | raw }}</li>
                                        <li>{{ edit_icon.component({}) }} {{ localized.thingsToKnow.symbolExplainedEdit | raw }}</li>
                                    </ul>
                                {% endblock %}
                            {% endembed %}
                        {% endblock %}
                    {% endembed %}
                {% endblock %}
            {% endembed %}
        {% endblock %}
    {% endembed %}
{% endif %}
