{% import _self as e %}
{% macro star_filled() %}
  <svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path d="M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z"/></svg>
{% endmacro %}
{% macro star_empty() %}
  <svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path d="M528.1 171.5L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6zM388.6 312.3l23.7 138.4L288 385.4l-124.3 65.3 23.7-138.4-100.6-98 139-20.2 62.2-126 62.2 126 139 20.2-100.6 98z"/></svg>
{% endmacro %}
{% if not design.image.disable %}
<div class='bde-fancy-testimonial_image'>
  {{ macros.image(content.content.image, content.content.image_options.size, content.content.image_options.alt) }}
</div>
{% endif %}
<div class='bde-fancy-testimonial_content'>
  {% if content.content.title %}
  <div class='bde-fancy-testimonial_title' {{ dataContentEditablePropertyPath('content.content.title') }}>
    {{ content.content.title }}
  </div>
  {% endif %}

  <div class='bde-fancy-testimonial_text'>
    {% if design.quotes.icon.svgCode %}
    <div class="bde-fancy-testimonial_quote" aria-hidden="true">{{ design.quotes.icon.svgCode }}</div>
    <div class="bde-fancy-testimonial_quote" aria-hidden="true">{{ design.quotes.icon.svgCode }}</div>
    {% endif %}
    <p {{ dataContentEditablePropertyPath('content.content.testimonial') }} class='bde-fancy-testimonial_text_text'>{{ content.content.testimonial }}</p>
  </div>
  {% if content.content.stars %}
    {% set stars_map = {
      'one': 1,
      'two': 2,
      'three': 3,
      'four': 4,
      'five': 5
    } %}
    {% set stars_count = stars_map[content.content.stars]|default(0) %}
    <div class='bde-fancy-testimonial_rate' role="img" aria-label="{{ stars_count }} out of 5 stars">
      {% for i in 1..5 %}
        {% if i <= stars_count %}
          {{ e.star_filled() }}
        {% else %}
          {{ e.star_empty() }}
        {% endif %}
      {% endfor %}
    </div>
  {% endif %}
  {% if content.content.name %}
  <div class='bde-fancy-testimonial_name' {{ dataContentEditablePropertyPath('content.content.name') }}>
    {{ content.content.name }}
  </div>
  {% endif %}
  {% if content.content.occupation %}
  <div class='bde-fancy-testimonial_occupation' {{ dataContentEditablePropertyPath('content.content.occupation') }}>
    {{ content.content.occupation }}
  </div>
  {% endif %}
  {% if content.content.button.text %}
    <div class='bde-fancy-testimonial-button-wrapper'>
      {{ macros.atomV1ButtonHtml(content.content.button, 'bde-fancy-testimonial-button', design.button, 'content.content.button.text') }}
    </div>
  {% endif %}
</div>
