/* eslint-disable */ /* © 2026 K2B NETWORK SOLUTIONS LLC. All rights reserved. Proprietary and confidential. Unauthorized copying, distribution, or use of this file, via any medium, is strictly prohibited. Original work product. */ // K2B Network Solutions — full Sales menu. Every item routes somewhere // (so the kit feels alive). Also publishes a tiny `K2BRouter` so other // screens can call `go("payroll")`. // ONE PATH: CRM — Leads is the front door (customers + deals are born // there); "Deal Pipeline" only views deals by stage. const SALES_MENU = [ { label: "CRM — Leads", target: "crm" }, { label: "Deal Pipeline", target: "deal" }, { label: "Customers", target: "customers" }, { label: "Inventory", target: "inventory" }, { label: "Trade Appraisal", target: "appraisal" }, { label: "Desking", target: "desking" }, { label: "Credit App", target: "creditapp" }, { label: "Worksheets", target: "worksheets" }, { label: "Forms", target: "forms" }, { label: "Service", target: "service" }, { label: "Parts", target: "parts" }, { label: "Accounting", target: "accounting" }, { label: "Accounts Receivable", target: "armenu" }, { label: "GM Accounting", target: "gmacct" }, { label: "Payroll", target: "payroll" }, { label: "Import / Export", target: "uploadtool" }, { label: "GMDS Export", target: "gmds" }, { label: "Controls", target: "controls" }, { label: "Setup", target: "settings" }, { label: "Back", target: "back" }, ]; const SalesMenu = ({ onPick, onClose }) => { const [focused, setFocused] = React.useState(0); React.useEffect(() => { const h = (e) => { // Audit A-08: ignore keys typed into any form field (e.g. the JB Helper // chat box) and keys pressed while a dialog is open. This component is // only mounted while the Sales menu is the active screen. if (window.jbKeyFromField && window.jbKeyFromField(e)) return; if (window.jbAnyModalOpen && window.jbAnyModalOpen()) return; if (e.altKey || e.ctrlKey || e.metaKey) return; if (e.key === "ArrowDown") { e.preventDefault(); setFocused(f => Math.min(SALES_MENU.length - 1, f + 1)); } else if (e.key === "ArrowUp") { e.preventDefault(); setFocused(f => Math.max(0, f - 1)); } else if (e.key === "Enter") { const it = SALES_MENU[focused]; if (it.target === "back") onClose(); else onPick(it.target); } else if (e.key === "Escape") onClose(); else if (/^[a-z]$/i.test(e.key)) { const idx = SALES_MENU.findIndex((it, k) => k > focused && it.label[0].toLowerCase() === e.key.toLowerCase()); const found = idx >= 0 ? idx : SALES_MENU.findIndex(it => it.label[0].toLowerCase() === e.key.toLowerCase()); if (found >= 0) setFocused(found); } }; window.addEventListener("keydown", h); return () => window.removeEventListener("keydown", h); }); return (