<%= stylesheet_link_tag 'redmine_ux_toolkit', plugin: 'redmine_ux_toolkit' %>
<%= javascript_include_tag 'redmine_ux_toolkit', plugin: 'redmine_ux_toolkit' %>
<% attachment_preview = RedmineUxToolkit::Services::AttachmentPreview %>
<% attachment_preview_settings = Setting.plugin_redmine_ux_toolkit || {} %>
<% if attachment_preview.enabled?(attachment_preview_settings) %>
  <% preview_config = {
       images: attachment_preview.images_enabled?(attachment_preview_settings),
       pdfs: attachment_preview.pdfs_enabled?(attachment_preview_settings),
       gallery: attachment_preview.gallery_enabled?(attachment_preview_settings),
       download: attachment_preview.download_enabled?(attachment_preview_settings),
       closeLabel: l(:button_close),
       previousLabel: l(:label_previous),
       nextLabel: l(:label_next),
       downloadLabel: l(:button_download),
       previewLabel: l(:label_ux_toolkit_attachment_preview),
       errorMessage: l(:text_ux_toolkit_attachment_preview_error)
     } %>
  <%= tag.meta name: 'ux-toolkit-attachment-preview', content: preview_config.to_json %>
  <%= stylesheet_link_tag 'redmine_ux_toolkit/attachment_preview', plugin: 'redmine_ux_toolkit' %>
  <%= javascript_include_tag 'redmine_ux_toolkit/attachment_preview', plugin: 'redmine_ux_toolkit' %>
<% end %>
<% custom_css = RedmineUxToolkit::Services::CustomCss.sanitized_css %>
<% if custom_css.present? && !RedmineUxToolkit::Services::CustomCss.legacy_renderer_active? %>
  <style type="text/css"><%= custom_css.html_safe %></style>
<% end %>
<% custom_javascript = RedmineUxToolkit::Services::CustomCss.javascript %>
<% if custom_javascript.present? %>
  <%= javascript_tag custom_javascript %>
<% end %>
<% modern_ui_settings = Setting.plugin_redmine_ux_toolkit || {} %>
<% modern_ui = ux_toolkit_modern_ui %>
<% if modern_ui && modern_ui.enabled?(modern_ui_settings) %>
  <%= stylesheet_link_tag 'redmine_ux_toolkit/modern_ui_common', plugin: 'redmine_ux_toolkit' %>
  <%= stylesheet_link_tag modern_ui.adapter_stylesheet, plugin: 'redmine_ux_toolkit' %>
<% end %>
