{% macro init_frontend_loader() %}
    {% set fdow = app.user is not null ? app.user.firstDayOfWeek : 'monday' %}
    {% set configurations = javascript_configurations(app.user, app.request.locale)|merge({
        login: path('login'),
        direction: tabler_bundle.rightToLeft ? 'rtl' : 'ltr',
        first_dow_iso: iso_day_by_name(fdow),
    }) %}
    <script type="text/javascript">
        window.addEventListener('load', function() {
            const loader = new KimaiWebLoader({{ configurations|json_encode|raw }},{{ javascript_translations()|json_encode|raw }});
            window.kimai = loader.getKimai();
        });
    </script>
{% endmacro %}
