local H={configs={};chains={}}function H.set(e,H,A,K)if e.configs[H]==nil then e.configs[H]={}end e.configs[H][A]=K or{}end function H.set_execution_chain(K,H,A)if K.chains[H]==nil then K.chains[H]={}end K.chains[H]=A end function H.get_config(H)local A={}local K={}for H,e in pairs(H.configs)do if A[H]==nil then A[H]={}end K=vim.tbl_extend("\102\111\114\099\101",K,e)A[H]=vim.tbl_keys(e)end for H,K in pairs(H.chains)do A[H]=K end return{formatters_by_ft=A;formatters=K}end return H
--- this module contains configuration for conform.nvim
--- https://github.com/stevearc/conform.nvim/blob/master/doc/recipes.md#lazy-loading-with-lazynvim

local M = {
  configs = {},
  chains = {},
}

function M:set(language, formatter, config)
  if self.configs[language] == nil then
    self.configs[language] = {}
  end

  self.configs[language][formatter] = config or {}
end

function M:set_execution_chain(language, chain)
  if self.chains[language] == nil then
    self.chains[language] = {}
  end

  self.chains[language] = chain
end

function M:get_config()
  local chains = {}
  local configs = {}

  for lang, conf in pairs(self.configs) do
    if chains[lang] == nil then
      chains[lang] = {}
    end

    configs = vim.tbl_extend("force", configs, conf)
    chains[lang] = vim.tbl_keys(conf)
  end

  for lang, chain in pairs(self.chains) do
    chains[lang] = chain
  end

  return {
    formatters_by_ft = chains,
    formatters = configs,
  }
end

return M
