<div class="card">
  <div class="card-body p-2">
    {% if args is mapping %}
    <div class="arguments-list">
      {% for key, value in args.items() %}
      <div class="argument-item mb-2">
        <div class="d-flex justify-content-between argument-header">
          <strong class="argument-key">{{ key }}</strong>
          {% if value is mapping or value is string and value.startswith('{') or
          value is string and value.startswith('[') %}
          <button
            class="btn btn-sm btn-outline-secondary"
            data-bs-toggle="collapse"
            data-bs-target="#arg-value-{{ id_prefix }}-{{ loop.index }}"
          >
            Toggle
          </button>
          {% endif %}
        </div>

        {% if value is mapping or value is string and value.startswith('{') or
        value is string and value.startswith('[') %}
        <div
          class="collapse mt-1"
          id="arg-value-{{ id_prefix }}-{{ loop.index }}"
        >
          <div class="card">
            <div class="card-body p-2 bg-light">
              <pre class="m-0 argument-value"><code>{{ value }}</code></pre>
            </div>
          </div>
        </div>
        {% else %}
        <div class="mt-1 ps-3 text-muted argument-simple-value">
          {{ value }}
        </div>
        {% endif %}
      </div>
      {% endfor %}
    </div>
    {% else %}
    <pre class="m-0"><code>{{ args }}</code></pre>
    {% endif %}
  </div>
</div>
