{% extends aa_content_templates.base_layout %}

{% block header %}
  {% include './_layout/_header.html.twig' %}
{% endblock %}

{% block stylesheets_head %}
  {{ parent() }}
  <script>
    function getCookie(name) {
      const cookieString = decodeURIComponent(document.cookie);
      const cookies = cookieString.split(';');
      for (let i = 0; i < cookies.length; i++) {
        const cookie = cookies[i].trim();
        if (cookie.startsWith(name + '=')) {
          return cookie.substring(name.length + 1);
        }
      }
      return null;
    }

    function isAllowedToLoadJs() {
      return parseInt(getCookie('aa_is_bot')) !== 1;
    }
  </script>
{% endblock %}

 {% block javascripts_body %}
   {{ parent() }}
   <script type="text/javascript" src="{{ asset('/public/app.min.js')|aa_add_cache_suffix }}"></script>
 {% endblock %}

{% block body_attr %}
  class="{% block body_classes %}{% endblock %}"
  data-analytics-id="{% block body_analytics_id %}{% endblock %}"
  data-analytics-config="{% block body_analytics_config %}{% endblock %}"
{% endblock %}

{% block body %}
  <div class="body">
    {{ parent() }}
  </div>
{% endblock %}

{% block body_wrap_end %}
  {{ parent() }}

  {% include './_partials/gdpr_banner.html.twig' %}
{% endblock %}

{% block footer %}
  {% include './_layout/_footer.html.twig' %}
{% endblock %}