// File-type → icon associations for the file tree.
//
// The bulk of the mapping is vendored from `catppuccin/vscode-icons` (see
// `associations.gen.js`). On top of that we layer a few crates.io-specific files
// that the upstream set does not know about. Values are bare icon names from the
// `@iconify-json/catppuccin` set; the runtime symbol ids are these names prefixed
// with `catppuccin-` (see `index.js`).

export const byFileExtension = {
  '7z': 'zip',
  asciidoc: 'asciidoc',
  asm: 'assembly',
  avif: 'image',
  bash: 'bash',
  bazel: 'bazel',
  bmp: 'image',
  bz2: 'zip',
  bzl: 'bazel',
  c: 'c',
  cc: 'cpp',
  cfg: 'properties',
  cjs: 'javascript',
  cmake: 'cmake',
  cmd: 'batch',
  conf: 'properties',
  cpp: 'cpp',
  crt: 'certificate',
  csh: 'bash',
  css: 'css',
  csv: 'csv',
  cts: 'typescript',
  cu: 'cuda',
  cuh: 'cuda',
  cxx: 'cpp',
  db: 'zip',
  dockerfile: 'docker',
  dockerignore: 'docker-ignore',
  dtd: 'xml',
  env: 'env',
  eot: 'font',
  fish: 'bash',
  'frag.glsl': 'shader',
  frag: 'shader',
  'fragment.glsl': 'shader',
  fragmentshader: 'shader',
  'fs.glsl': 'shader',
  'geom.glsl': 'shader',
  'geom.hlsl': 'shader',
  geom: 'shader',
  'geometry.glsl': 'shader',
  'geometry.hlsl': 'shader',
  geometryshader: 'shader',
  gif: 'image',
  'gitlab-ci.yaml': 'gitlab',
  'gitlab-ci.yml': 'gitlab',
  gleam: 'gleam',
  glsl: 'shader',
  go: 'go',
  gpg: 'key',
  'gs.glsl': 'shader',
  gz: 'zip',
  h: 'c-header',
  hbs: 'handlebars',
  hh: 'cpp-header',
  hlsl: 'shader',
  hpp: 'cpp-header',
  htm: 'html',
  html: 'html',
  hxx: 'cpp-header',
  icns: 'image',
  ico: 'image',
  ini: 'properties',
  j2: 'jinja',
  jinja2: 'jinja',
  jinja: 'jinja',
  jpeg: 'image',
  jpg: 'image',
  js: 'javascript',
  json5: 'json',
  json: 'json',
  jsonc: 'json',
  jsonl: 'json',
  just: 'just',
  kdl: 'kdl',
  log: 'log',
  markdown: 'markdown',
  md: 'markdown',
  mdx: 'markdown-mdx',
  mermaid: 'mermaid',
  mjs: 'javascript',
  mk: 'makefile',
  mmd: 'mermaid',
  mts: 'typescript',
  nix: 'nix',
  otf: 'font',
  pem: 'key',
  pfx: 'certificate',
  png: 'image',
  proto: 'proto',
  ps1: 'powershell',
  pub: 'key',
  py: 'python',
  rar: 'zip',
  rs: 'rust',
  rst: 'markdown',
  'schema.json': 'json-schema',
  sh: 'bash',
  sql: 'database',
  sqlite3: 'database',
  sqlite: 'database',
  svelte: 'svelte',
  svg: 'svg',
  swift: 'swift',
  tar: 'zip',
  tauri: 'tauri',
  tgz: 'zip',
  tif: 'image',
  tiff: 'image',
  toml: 'toml',
  'ts.glsl': 'shader',
  ts: 'typescript',
  tsv: 'csv',
  ttf: 'font',
  txt: 'text',
  'vert.glsl': 'shader',
  vert: 'shader',
  'vertex.glsl': 'shader',
  vertexshader: 'shader',
  vhd: 'verilog',
  'vs.glsl': 'shader',
  wasm: 'web-assembly',
  wat: 'web-assembly',
  webmanifest: 'json',
  webp: 'image',
  wgsl: 'shader',
  woff2: 'font',
  woff: 'font',
  xhtml: 'html',
  xml: 'xml',
  xz: 'zip',
  yaml: 'yaml',
  yml: 'yaml',
  zig: 'zig',
  zip: 'zip',
  zsh: 'bash',
  zst: 'zip',
};

export const byFileName = {
  '.cargo_vcs_info.json': 'git',
  '.devcontainer.json': 'devcontainer',
  '.editorconfig': 'editorconfig',
  '.git': 'git',
  '.git-blame-ignore': 'git',
  '.git-blame-ignore-revs': 'git',
  '.git-for-windows-updater': 'git',
  '.gitattributes': 'git',
  '.gitconfig': 'git',
  '.gitignore': 'git',
  '.gitinclude': 'git',
  '.gitkeep': 'git',
  '.gitmessage': 'git',
  '.gitmodules': 'git',
  '.gitpreserve': 'git',
  '.justfile': 'just',
  '.keep': 'git',
  '.renovaterc': 'renovate',
  '.renovaterc.json': 'renovate',
  '.ruff.toml': 'ruff',
  '.rustfmt.toml': 'rust-config',
  '.taurignore': 'tauri-ignore',
  'book.toml': 'mdbook',
  'cargo.lock': 'cargo-lock',
  'cargo.toml': 'cargo',
  'cargo.toml.orig': 'cargo',
  'changelog.md': 'changelog',
  'changelog.rst': 'changelog',
  'changelog.txt': 'changelog',
  changelog: 'changelog',
  'changes.md': 'changelog',
  'changes.rst': 'changelog',
  'changes.txt': 'changelog',
  changes: 'changelog',
  'circle.yml': 'circle-ci',
  'cliff.toml': 'git-cliff',
  'clippy.toml': 'rust-config',
  'cmakecache.txt': 'cmake',
  'cmakelists.txt': 'cmake',
  CNAME: 'http',
  'code_of_conduct.md': 'code-of-conduct',
  'code_of_conduct.txt': 'code-of-conduct',
  code_of_conduct: 'code-of-conduct',
  codeowners: 'codeowners',
  'contributing.md': 'contributing',
  'contributing.rst': 'contributing',
  'contributing.txt': 'contributing',
  contributing: 'contributing',
  'copying.md': 'license',
  'copying.rst': 'license',
  'copying.txt': 'license',
  copying: 'license',
  'copyright.md': 'license',
  'copyright.rst': 'license',
  'copyright.txt': 'license',
  copyright: 'license',
  'dependabot.yaml': 'dependabot',
  'dependabot.yml': 'dependabot',
  'devcontainer.json': 'devcontainer',
  dockerfile: 'docker',
  'flake.lock': 'nix-lock',
  'git-history': 'git',
  justfile: 'just',
  'licence-agpl': 'license',
  'licence-apache': 'license',
  'licence-bsd': 'license',
  'licence-gpl': 'license',
  'licence-lgpl': 'license',
  'licence-mit': 'license',
  'licence.md': 'license',
  'licence.rst': 'license',
  'licence.txt': 'license',
  licence: 'license',
  'license-agpl': 'license',
  'license-apache': 'license',
  'license-bsd': 'license',
  'license-gpl': 'license',
  'license-lgpl': 'license',
  'license-mit': 'license',
  'license.md': 'license',
  'license.rst': 'license',
  'license.txt': 'license',
  license: 'license',
  makefile: 'makefile',
  'package.json': 'package-json',
  'pnpm-lock.yaml': 'pnpm-lock',
  'pnpm-workspace.yaml': 'pnpm',
  'readme.md': 'readme',
  'readme.rst': 'readme',
  'readme.txt': 'readme',
  readme: 'readme',
  'renovate-config.json': 'renovate',
  'renovate.json': 'renovate',
  'renovate.json5': 'renovate',
  'ruff.toml': 'ruff',
  'rust-toolchain.toml': 'rust-config',
  'rustfmt.toml': 'rust-config',
  'security.md': 'security',
  'security.txt': 'security',
  security: 'security',
  'tauri.conf.json': 'tauri',
  'tauri.conf.json5': 'tauri',
  'tauri.config.json': 'tauri',
  'tauri.linux.conf.json': 'tauri',
  'tauri.macos.conf.json': 'tauri',
  'Tauri.toml': 'tauri',
  'tauri.windows.conf.json': 'tauri',
  unlicence: 'license',
  unlicense: 'license',
};

// Unique, sorted list of every icon name referenced above. This is the input to
// the sprite generator, so only the glyphs we actually map get a sprite.
export const iconNames = [
  ...new Set(['file', ...Object.values(byFileExtension), ...Object.values(byFileName)]),
].toSorted();
