/**
 * Shared page definitions - single source of truth for sitemap, page generator, and meta utilities.
 */

export const SITE_URL = "https://better-i18n.com";

export type ChangeFreq =
  | "always"
  | "hourly"
  | "daily"
  | "weekly"
  | "monthly"
  | "yearly"
  | "never";

export interface PageDefinition {
  readonly path: string;
  readonly priority: number;
  readonly changefreq: ChangeFreq;
  readonly prerender: boolean;
  /** When false, the page is excluded from the sitemap but still routable. */
  readonly sitemap?: boolean;
}

export const MARKETING_PAGES = [
  // Core pages
  { path: "", priority: 1.0, changefreq: "weekly", prerender: true },
  { path: "features", priority: 0.9, changefreq: "weekly", prerender: true },
  { path: "pricing", priority: 0.9, changefreq: "weekly", prerender: true },
  { path: "integrations", priority: 0.9, changefreq: "weekly", prerender: true },

  // Audience pages (8 high-value personas)
  { path: "for-developers", priority: 0.9, changefreq: "weekly", prerender: true },
  { path: "for-translators", priority: 0.9, changefreq: "weekly", prerender: true },
  { path: "for-product-teams", priority: 0.9, changefreq: "weekly", prerender: true },
  { path: "for-agencies", priority: 0.85, changefreq: "weekly", prerender: true },
  { path: "for-enterprises", priority: 0.85, changefreq: "weekly", prerender: true },
  { path: "for-startups", priority: 0.85, changefreq: "weekly", prerender: true },
  { path: "for-ecommerce", priority: 0.85, changefreq: "weekly", prerender: true },
  { path: "for-saas", priority: 0.85, changefreq: "weekly", prerender: true },

  // i18n Framework pages
  { path: "i18n", priority: 0.9, changefreq: "weekly", prerender: true },
  { path: "i18n/react", priority: 0.9, changefreq: "weekly", prerender: true },
  { path: "i18n/nextjs", priority: 0.9, changefreq: "weekly", prerender: true },
  { path: "i18n/vue", priority: 0.9, changefreq: "weekly", prerender: true },
  { path: "i18n/nuxt", priority: 0.8, changefreq: "weekly", prerender: true },
  { path: "i18n/angular", priority: 0.8, changefreq: "weekly", prerender: true },
  { path: "i18n/svelte", priority: 0.8, changefreq: "weekly", prerender: true },
  { path: "i18n/django", priority: 0.8, changefreq: "weekly", prerender: true },
  { path: "i18n/ruby", priority: 0.8, changefreq: "weekly", prerender: true },
  { path: "i18n/javascript", priority: 0.8, changefreq: "weekly", prerender: true },
  { path: "i18n/android", priority: 0.8, changefreq: "weekly", prerender: true },
  { path: "i18n/ios", priority: 0.8, changefreq: "weekly", prerender: true },
  { path: "i18n/flutter", priority: 0.8, changefreq: "weekly", prerender: true },
  { path: "i18n/expo", priority: 0.9, changefreq: "weekly", prerender: true },
  { path: "i18n/server", priority: 0.9, changefreq: "weekly", prerender: true },
  { path: "i18n/tanstack-start", priority: 0.9, changefreq: "weekly", prerender: true },
  { path: "i18n/vite", priority: 0.85, changefreq: "weekly", prerender: true },
  { path: "i18n/remix-hydrogen", priority: 0.85, changefreq: "weekly", prerender: true },
  { path: "i18n/best-tms", priority: 0.85, changefreq: "weekly", prerender: true },
  { path: "i18n/best-library", priority: 0.85, changefreq: "weekly", prerender: true },
  { path: "i18n/for-developers", priority: 0.85, changefreq: "weekly", prerender: true },
  { path: "i18n/complete-guide", priority: 0.9, changefreq: "weekly", prerender: true },

  // i18n SEO content pages — pillar pages only (cannibalized pages removed, see redirects.ts)
  { path: "i18n/localization-software", priority: 0.8, changefreq: "weekly", prerender: true },
  { path: "i18n/translation-management-system", priority: 0.8, changefreq: "weekly", prerender: true },
  { path: "i18n/website-localization", priority: 0.8, changefreq: "weekly", prerender: true },
  { path: "i18n/translation-solutions", priority: 0.8, changefreq: "weekly", prerender: true },
  { path: "i18n/international-seo", priority: 0.8, changefreq: "weekly", prerender: true },
  { path: "i18n/doctor", priority: 0.9, changefreq: "weekly", prerender: true },
  { path: "i18n/cli-code-scanning", priority: 0.8, changefreq: "weekly", prerender: true },
  { path: "i18n/react-native-localization", priority: 0.8, changefreq: "weekly", prerender: true },
  { path: "i18n/localization-vs-internationalization", priority: 0.8, changefreq: "weekly", prerender: true },
  { path: "i18n/content-localization", priority: 0.8, changefreq: "weekly", prerender: true },
  { path: "i18n/software-localization", priority: 0.8, changefreq: "weekly", prerender: true },
  { path: "i18n/cultural-adaptation", priority: 0.8, changefreq: "weekly", prerender: true },
  { path: "i18n/website-translation", priority: 0.8, changefreq: "weekly", prerender: true },

  // Comparison pages
  { path: "compare", priority: 0.8, changefreq: "weekly", prerender: true },
  { path: "compare/crowdin", priority: 0.85, changefreq: "weekly", prerender: true },
  { path: "compare/lokalise", priority: 0.85, changefreq: "weekly", prerender: true },
  { path: "compare/phrase", priority: 0.85, changefreq: "weekly", prerender: true },
  { path: "compare/transifex", priority: 0.85, changefreq: "weekly", prerender: true },
  { path: "compare/smartling", priority: 0.85, changefreq: "weekly", prerender: true },
  { path: "compare/xtm", priority: 0.85, changefreq: "weekly", prerender: true },
  { path: "compare/crowdin-vs-lokalise", priority: 0.85, changefreq: "weekly", prerender: true },

  // Educational pages
  { path: "what-is", priority: 0.85, changefreq: "monthly", prerender: true },
  { path: "what-is-internationalization", priority: 0.85, changefreq: "monthly", prerender: true },
  { path: "what-is-localization", priority: 0.85, changefreq: "monthly", prerender: true },

  // Free developer tools
  { path: "tools", priority: 0.8, changefreq: "monthly", prerender: true },
  { path: "tools/locale-explorer", priority: 0.9, changefreq: "monthly", prerender: true },
  { path: "tools/icu-playground", priority: 0.9, changefreq: "monthly", prerender: true },
  { path: "tools/translation-file-converter", priority: 0.9, changefreq: "monthly", prerender: true },
  { path: "tools/cost-calculator", priority: 0.9, changefreq: "monthly", prerender: true },
  { path: "tools/hreflang-generator", priority: 0.9, changefreq: "monthly", prerender: true },

  // Company pages — excluded from sitemap (not primary SEO assets)
  { path: "about", priority: 0.7, changefreq: "monthly", prerender: true, sitemap: false },
  { path: "careers", priority: 0.7, changefreq: "weekly", prerender: true, sitemap: false },
  { path: "status", priority: 0.6, changefreq: "daily", prerender: false, sitemap: false },
  { path: "changelog", priority: 0.8, changefreq: "daily", prerender: false, sitemap: false },

  // Legal pages — excluded from sitemap
  { path: "privacy", priority: 0.3, changefreq: "yearly", prerender: true, sitemap: false },
  { path: "terms", priority: 0.3, changefreq: "yearly", prerender: true, sitemap: false },
  { path: "cookies", priority: 0.3, changefreq: "yearly", prerender: true, sitemap: false },
] as const satisfies readonly PageDefinition[];
