{% set toc_label %}
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
    <path d="m12 5.37-.44-.06L6 14.9c.24.21.4.48.47.78h11.06c.07-.3.23-.57.47-.78l-5.56-9.59zM6.6 16.53l4.28 2.53c.29-.27.69-.43 1.12-.43s.83.16 1.12.43l4.28-2.53zM12 22a1.68 1.68 0 0 1-1.68-1.68l.09-.56-4.3-2.55c-.31.36-.76.58-1.27.58a1.68 1.68 0 0 1-1.68-1.68c0-.79.53-1.45 1.26-1.64V9.36c-.83-.11-1.47-.82-1.47-1.68A1.68 1.68 0 0 1 4.63 6c.55 0 1.03.26 1.34.66l4.41-2.53-.06-.45c0-.93.75-1.68 1.68-1.68s1.68.75 1.68 1.68l-.06.45 4.41 2.53c.31-.4.79-.66 1.34-.66a1.68 1.68 0 0 1 1.68 1.68c0 .86-.64 1.57-1.47 1.68v5.11c.73.19 1.26.85 1.26 1.64a1.68 1.68 0 0 1-1.68 1.68c-.51 0-.96-.22-1.27-.58l-4.3 2.55.09.56A1.68 1.68 0 0 1 12 22M10.8 4.86 6.3 7.44l.02.24c0 .71-.44 1.32-1.06 1.57l.03 5.25zm2.4 0 5.51 9.64.03-5.25c-.62-.25-1.06-.86-1.06-1.57l.02-.24z">
    </path>
  </svg>
  <span class="md-ellipsis" style="vertical-align: top;">Dependency Graph</span>
{% endset %}
{% filter heading(context.options.start_level+1, id="dependency_graph", toc_label=toc_label) %}
  <span class="md-icon" style="vertical-align: middle; display: inline-block">{{ ":material-graphql:"|convert_markdown(3) }}</span><span style="vertical-align: middle;">Dependency Graph</span>
{% endfilter %}
{# djlint:off #}
{% filter convert_markdown(0) %}
{% set graph = context.dependency_graph %}
```mermaid
flowchart LR
    {# Nodes (predicates) #}
    {%- for predicate in graph.all %}
    {{ predicate }}(["{{ predicate }}"])
    {%- endfor %}

    {# Edges (dependencies) #}
    {% for (from, to) in graph.positives %}
    {{ from }} --> {{ to }}
    {%- endfor %}
    {% for (from, to) in graph.negatives %}
    {{ from }} -.-> {{ to }}
    {%- endfor %}
    classDef all fill:#00000000;
    classDef out stroke:#52BF54,stroke-width:3px;
    classDef aux stroke:#848484,stroke-width:0.2px;
    classDef in stroke:#9178C6,stroke-width:3px;
    {# Some coloring for all nodes #}
    {% if graph.all %}
    class {% for predicate in graph.all %}{{ predicate }}{% if not loop.last %},{% endif %}{%- endfor %} all;
    {% endif %}

    {# Predicates that are shown #}
    {% if graph.outputs %}
    class {% for predicate in graph.outputs %}{{ predicate }}{% if not loop.last %},{% endif %}{%- endfor %} out;
    {% endif %}

    {# Predicates that are generated in the encoding but are not shown #}
    {% if graph.auxiliaries %}
    class {% for predicate in graph.auxiliaries %}{{ predicate }}{% if not loop.last %},{% endif %}{%- endfor %} aux;
    {% endif %}

    {# Predicates that are used in the encoding but aren't generated in it. They're provided by input files. #}
    {% if graph.inputs %}
    class {% for predicate in graph.inputs %}{{ predicate }}{% if not loop.last %},{% endif %}{%- endfor %} in;
    {% endif %}
```
{% endfilter %}
{# djlint:on #}
