{# Collapsible SQL panel with a rich Copy button (Copied! feedback + icon). Used by /opportunities/{id} and /failures/{id} for the "BigQuery query" pane. Heavier than ``_copy_pre`` because: - it's wrapped in a
so the panel is collapsible; - the copy button lives on top of the
 as an absolute,
       per-panel button with state feedback;
     - it scrolls inside a max-height container.

   Parameters:
     - id           (str) DOM id of the 
 the Copy button reads
     - title        (str) summary heading text
     - sql          (str) SQL body
     - caption      (str, optional) line of copy under the summary
     - open         (bool) default-open the 
; defaults to True #} {%- macro sql_panel(id, title, sql, caption=None, open=True) -%}

{{ title }}

{%- if caption %}

{{ caption }}

{%- endif %}
{{ sql }}
{%- endmacro %}