/* pages-manifest.jsx — route registry. Loads LAST: every component is window-exported by the page-*.jsx files before this runs. Extracted verbatim from pages.jsx. */
const PAGES = {
  // GA
  "ga-dashboard": GADashboard,
  "ga-countries": CountriesList,
  "ga-country-detail": CountryDetail,   // B: read-only Network detail (row-click + default target)
  "ga-country-edit": CountryEdit,       // B: editable form (Edit-button target, GA-only)
  "ga-country-flags": CountryFlags,
  // ga-country-onboarding removed — onboarding checklist now embedded in Country Detail Onboarding tab (C-5 reversal, 2026-06-02)
  "ga-country-wizard":     CountrySetupWizard,
  "ga-areas":       AreasList,    // B: Network Areas list (replaces 'areas' Stub fallback)
  "ga-area-detail": AreaDetail,   // B: read-only Network detail (row-click + default target)
  "ga-area-edit":   AreaEdit,     // B: editable form (Edit-button target)
  "ga-area-new":    AreaEdit,     // B: create form (same component, new mode)
  "ga-franchisees": FranchiseesList,
  "ga-franchisee-edit": FranchiseeEdit,
  "ga-franchisee-detail": FranchiseeDetail,
  "cm-franchisees": FranchiseeDetail,   // non-GA: read-only "My Franchise" (own-scope resolution)
  "am-franchisees": FranchiseeDetail,
  "om-franchisees": FranchiseeDetail,
  "ga-outlets": OutletsGlobalList,
  "ga-outlet-edit": OutletEdit,
  "ga-outlet-detail": OutletDetail,
  "ga-orders": OrdersList,           // B-Orders: GA orders list (was Stub — ga-orders route was missing)
  "ga-order-detail": OrdersList,     // drawer-host shim: OrdersList reads payload id and auto-opens the drawer
  "ga-customers": CustomersList,        // Customers collapse: GA customers list (was Stub); detail is the drawer
  "ga-users": UsersList,
  "ga-user-detail": UserDetail,
  "ga-user-edit": UserEditor,
  "ga-products": SKUCatalog,          // B-3: was ga-skus
  "ga-rewards": RewardList,    // repointed: PartnerRewards → RewardList (page-rewards.jsx)
  "ga-ai-companion": AIContent,
  "ga-messenger":    MessengerList,
  "cm-ai-companion": AIContent,
  "am-ai-companion": AIContent,
  "am-messenger":    MessengerList,
  "om-ai-companion": AIContent,
  "om-messenger":    MessengerList,
  "ga-translations": TranslationMatrix,
  "ga-translations-preview": TranslationPreview,
  "ga-custom-options": CustomOptions,       // B-7: GA-only config — per-market option lists + loyalty config
  "ga-integrations": PaymentStatusGlobal,  // B-3: was ga-payments
  // ga-reconciliation removed per Review 8 — Reconciliation lives at AM-080 and OM-090 only.
  "ga-audit": AuditLog,
  "ga-export-log": ExportLog,
  "ga-promotions":     PromotionsList,  // rebuilt: in-drawer create/edit, no separate edit page
  // CM
  "cm-dashboard":       Dashboard,
  "cm-countries":       CountryDetail,    // B: CM lands on own-country Detail, read-only (role from router)
  "cm-areas":           AreasList,      // B: CM sees own-country Areas list (many areas → list, unlike cm-countries → Detail)
  "cm-area-detail":     AreaDetail,
  "cm-area-edit":       AreaEdit,
  "cm-area-new":        AreaEdit,
  "cm-outlets":         OutletsList,
  "cm-outlet-edit":     OutletEdit,
  "cm-outlet-detail":   OutletDetail,
  "cm-users":           UsersList,
  "cm-user-detail":     UserDetail,
  "cm-user-edit":       UserEditor,
  "cm-orders":          OrdersList,
  "cm-order-detail":    OrdersList,    // drawer-host shim: OrdersList reads payload id and auto-opens the drawer
  "cm-customers":       CustomersList,
  // cm-customer-detail removed — customer detail is now the DetailDrawer, not a full page (Customers collapse)
  "cm-promotions":      PromotionsList,  // rebuilt: in-drawer create/edit, no separate edit page
  "cm-products":        SKUCatalog,      // B-3: CM Products catalog (was missing)
  "cm-messenger":       MessengerList,   // B-3: was cm-notifications (CMPush removed; unified MessengerList)
  "cm-rewards":         RewardList,      // repointed: CMPartnerReward → RewardList (page-rewards.jsx)
  "ga-loyalty":         Loyalty,   // B-Loyalty: GA global ledger
  "cm-loyalty":         Loyalty,   // B-Loyalty: was CMLoyaltyReports (US-054 reports → Dashboard hand-off #9)
  "am-loyalty":         Loyalty,   // B-Loyalty: AM area ledger
  "om-loyalty":         Loyalty,   // B-Loyalty: OM outlet ledger (reduced cols, no GeoScope)
  "ga-wallet":          WalletLedger,  // B-Wallet: GA global SG ledger
  "cm-wallet":          WalletLedger,  // B-Wallet: CM own-country (SG) ledger
  "am-wallet":          WalletLedger,  // B-Wallet: AM own-area ledger
  "om-wallet":          WalletLedger,  // B-Wallet: OM own-outlet ledger (reduced cols)
  "ga-gifts":           GiftItemsList,   // B-Gifts: GA global gift catalogue
  "cm-gifts":           GiftItemsList,   // B-Gifts: CM own-country gift catalogue
  "am-gifts":           GiftItemsList,   // B-Gifts: AM own-area gift catalogue
  "om-gifts":           GiftItemsList,   // B-Gifts: OM own-outlet gift catalogue (read-only)
  "ga-purchases":       ExchangesList,   // B-Exchanges: GA global exchanges ledger (nav key: purchases)
  "cm-purchases":       ExchangesList,   // B-Exchanges: CM own-country exchanges
  "am-purchases":       ExchangesList,   // B-Exchanges: AM own-area exchanges
  "om-purchases":       ExchangesList,   // B-Exchanges: OM own-outlet exchanges (read-only)
  "cm-integrations":    CMPaymentStatus, // B-3: was cm-payments
  // B-1/B-2/B-4 removed: cm-reports, cm-audit, cm-export-log, cm-config
  // AM
  "am-dashboard":       Dashboard,
  "am-countries":       CountryDetail,    // B: AM lands on own-country Detail, read-only (nav-broad doctrine; role from router)
  "am-areas":           AreasList,      // B: AM sees own-scope Areas list (read-only — no am-area-edit)
  "am-area-detail":     AreaDetail,
  "am-outlets":         OutletsList,
  "am-outlet-edit":     OutletEdit,
  "am-outlet-detail":   OutletDetail,
  "am-users":           UsersList,
  "am-user-detail":     UserDetail,
  "am-user-edit":       UserEditor,
  "am-orders":          OrdersList,
  "am-order-detail":    OrdersList,    // drawer-host shim: OrdersList reads payload id and auto-opens the drawer
  "am-customers":       CustomersList,
  // am-customer-detail removed — customer detail is now the DetailDrawer, not a full page (Customers collapse)
  "am-products":        SKUCatalog,      // B-3: was am-skus
  "am-promotions":      PromotionsList,  // AM can propose promotions (promotion.propose RBAC)
  "am-settings":        AMAreaSettings,  // B-5: pulled from nav, kept for AM-outlet-detail deep-link until B-16/B-62
  // B-1/B-2 removed: am-reports, am-reconciliation, am-audit
  // OM
  "om-dashboard":       OMDashboard,
  "om-orders-live":     OrdersList,    // OMOrdersLive folded into OrdersList (role-branched); repointed
  "om-order-detail":   OrdersList,    // drawer-host shim: OrdersList reads payload id and auto-opens the drawer
  "om-products":        SKUCatalog,        // B-3: rerouted from OMSkuAvailability → SKUCatalog (role-branched)
  "om-outlets":         OutletDetail,      // B-6: OM "My Outlet" = role-branched OutletDetail (read-only); OMHours stub retired
  "om-users":           UserDetail,        // OM has no list — lands on own UserDetail ("Me"), mirrors om-outlets→OutletDetail
  "om-customers":       CustomersList,   // Customers collapse: OM uses the unified CustomersList (role-branched), not OMCustomers
  "om-promotions":      PromotionsList,  // OM read-only view via role-branched PromotionsList
  "om-redemptions":     RedemptionList,  // repointed: OMRedemptions → RedemptionList (page-rewards.jsx)
  "ga-redemptions":     RedemptionList,  // new route
  "cm-redemptions":     RedemptionList,  // new route
  "am-redemptions":     RedemptionList,  // new route
  "am-rewards":         RewardList,      // new route (AM partner rewards)
  "om-rewards":         RewardList,      // new route (OM read-only active)
  "om-integrations":    OMPaymentStatus,   // B-3: was om-payment
  "ga-partnerships":      PartnershipsList,   // Partnerships module — role-branched (GA/CM author, AM/OM read)
  "cm-partnerships":      PartnershipsList,
  "am-partnerships":      PartnershipsList,
  "om-partnerships":      PartnershipsList,
  "ga-refunds": RefundsList,   // Refunds module — all 4 roles share one component (role-branched)
  "cm-refunds": RefundsList,
  "am-refunds": RefundsList,
  "om-refunds": RefundsList,
  "ga-automations": AutomationsList,   // Automations (Config) — GA authors; CM/AM/OM read-only within scope
  "cm-automations": AutomationsList,
  "am-automations": AutomationsList,
  "om-automations": AutomationsList,
  // B-2 removed: om-reconciliation
  // X
  "x-notification": InboxPage,   // B-3: was x-inbox
  "x-profile": ProfilePage,
  "x-help": HelpPage,
  "login": LoginPage,
  "403": Error403,
};

window.PAGES = PAGES;
window.LoginPage = LoginPage;
window.Error403 = Error403;
