{#
Renders HTML that loads BokehJS JavaScript code and CSS according to the
configuration in a Resources object.

:param hashes: a map of filenames for to SRI hashes
:type hashes: dict[str, str]

:param js_files: a list of URIs for JS files to include
:type js_files: list[str]

:param js_modules: a list of URIs for JS modules to include
:type js_files: list[str]

:param js_raw: a list of raw JS snippets to put between ``<script>`` tags
:type js_raw: list[str]

#}
<script type="esms-options">{"shimMode": true}</script>

{% for file in js_files %}
<script type="text/javascript" src="{{ file }}"></script>
{% endfor %}

{% for file in js_modules %}
<script type="module" src="{{ file }}"></script>
{% endfor %}

{%- for name, file in js_module_exports.items() %}
<script type="module">
  import {{ name }} from "{% if not file.startswith('http') %}./{% endif %}{{ file }}";
  window.{{ name }} = {{ name }}
</script>
{%- endfor %}

{%- for js in js_raw %}
<script type="text/javascript">
  {{ js }}
</script>
{%- endfor %}
