/**
 * Flexoptix Supported Vendors — Complete Seed Data
 *
 * ALL ~300 vendors that Flexoptix programs transceivers for.
 * Source: https://www.flexoptix.net/en/supported-vendors/
 *
 * Categories:
 *   - network_switching   — Switches, routers (Cisco, Arista, Juniper, etc.)
 *   - network_security    — Firewalls, UTM (Fortinet, Palo Alto, Check Point)
 *   - network_wireless    — WiFi, wireless (Aruba, Cambium, Ubiquiti)
 *   - network_carrier     — Telecom/SP equipment (Nokia, Ericsson, Ciena)
 *   - network_sdwan       — SD-WAN appliances (Versa, Cisco Viptela)
 *   - storage             — SAN/NAS (NetApp, Pure, Dell EMC, QNAP)
 *   - server              — Server/compute (Supermicro, Lenovo, Dell)
 *   - broadcast_av        — Broadcast/AV/video (Evertz, Grass Valley, Riedel)
 *   - industrial          — Industrial networking (Hirschmann, Moxa, Phoenix)
 *   - monitoring          — Network monitoring/TAP (Gigamon, Keysight, VIAVI)
 *   - load_balancer       — ADC/load balancers (F5, Citrix, Kemp)
 *   - nic                 — NICs/HBAs (Intel, Broadcom, Chelsio, Solarflare)
 *   - whitebox            — Whitebox/ODM (Edgecore, Quanta, Asterfusion)
 *   - other               — Other categories
 */
import { pool, ensureVendor } from "../utils/db";

interface FlexoptixVendor {
  name: string;
  category: string;
  website?: string;
  vendorType: "oem" | "manufacturer" | "distributor" | "compatible";
  notes?: string;
}

export const FLEXOPTIX_VENDORS: FlexoptixVendor[] = [
  // ═══════════════════════════════════════════════════════
  // NETWORK — SWITCHING & ROUTING
  // ═══════════════════════════════════════════════════════
  { name: "Cisco Systems", category: "network_switching", website: "https://www.cisco.com", vendorType: "oem" },
  { name: "Cisco Mod.", category: "network_switching", website: "https://www.cisco.com", vendorType: "oem", notes: "Cisco modules/line cards" },
  { name: "Cisco OneAccess (Ekinops)", category: "network_switching", website: "https://www.ekinops.com", vendorType: "oem" },
  { name: "Cisco Siemon", category: "network_switching", vendorType: "oem" },
  { name: "Cisco Systems (ex. Linksys)", category: "network_switching", website: "https://www.cisco.com", vendorType: "oem" },
  { name: "Cisco Systems (ex. Viptela)", category: "network_sdwan", website: "https://www.cisco.com", vendorType: "oem" },
  { name: "Cisco (ex. Meraki)", category: "network_wireless", website: "https://meraki.cisco.com", vendorType: "oem" },
  { name: "Arista", category: "network_switching", website: "https://www.arista.com", vendorType: "oem" },
  { name: "Arista 3rd_Party", category: "network_switching", website: "https://www.arista.com", vendorType: "oem", notes: "Third-party optics on Arista" },
  { name: "Juniper", category: "network_switching", website: "https://www.juniper.net", vendorType: "oem" },
  { name: "Extreme", category: "network_switching", website: "https://www.extremenetworks.com", vendorType: "oem" },
  { name: "Extreme (ex. Enterasys)", category: "network_switching", website: "https://www.extremenetworks.com", vendorType: "oem" },
  { name: "Huawei", category: "network_switching", website: "https://e.huawei.com", vendorType: "oem" },
  { name: "Nokia (ex. Alcatel-Lucent)", category: "network_carrier", website: "https://www.nokia.com", vendorType: "oem" },
  { name: "Nokia Networks", category: "network_carrier", website: "https://www.nokia.com", vendorType: "oem" },
  { name: "Nokia Siemens Networks", category: "network_carrier", website: "https://www.nokia.com", vendorType: "oem" },
  { name: "Nokia-Siemens (ex. Atrica)", category: "network_carrier", website: "https://www.nokia.com", vendorType: "oem" },
  { name: "Alcatel-Lucent Ent.", category: "network_switching", website: "https://www.al-enterprise.com", vendorType: "oem" },
  { name: "Dell", category: "network_switching", website: "https://www.dell.com", vendorType: "oem" },
  { name: "Dell (ex. Force10)", category: "network_switching", website: "https://www.dell.com", vendorType: "oem" },
  { name: "Lenovo", category: "server", website: "https://www.lenovo.com", vendorType: "oem" },
  { name: "Lenovo (ex. Blade Network)", category: "network_switching", website: "https://www.lenovo.com", vendorType: "oem" },
  { name: "Lenovo (ex. IBM)", category: "server", website: "https://www.lenovo.com", vendorType: "oem" },
  { name: "Nvidia (ex. Mellanox)", category: "network_switching", website: "https://www.nvidia.com/networking", vendorType: "oem" },
  { name: "H3C (ex. 3COM)", category: "network_switching", website: "https://www.h3c.com", vendorType: "oem" },
  { name: "HP H3C", category: "network_switching", vendorType: "oem" },
  { name: "Aruba Networks", category: "network_wireless", website: "https://www.arubanetworks.com", vendorType: "oem" },
  { name: "Aruba Networks(ex. HP Network)", category: "network_switching", website: "https://www.arubanetworks.com", vendorType: "oem" },
  { name: "Brocade", category: "network_switching", website: "https://www.broadcom.com", vendorType: "oem" },
  { name: "Brocade / Ruckus", category: "network_wireless", vendorType: "oem" },
  { name: "Force10 / Brocade", category: "network_switching", vendorType: "oem" },
  { name: "Force10 / Juniper", category: "network_switching", vendorType: "oem" },
  { name: "Nortel / Juniper / NSN", category: "network_switching", vendorType: "oem" },
  { name: "Avaya (ex. Nortel)", category: "network_switching", website: "https://www.avaya.com", vendorType: "oem" },
  { name: "MikroTik", category: "network_switching", website: "https://mikrotik.com", vendorType: "oem" },
  { name: "Netgear", category: "network_switching", website: "https://www.netgear.com", vendorType: "oem" },
  { name: "D-LINK", category: "network_switching", website: "https://www.dlink.com", vendorType: "oem" },
  { name: "TP-LINK", category: "network_switching", website: "https://www.tp-link.com", vendorType: "oem" },
  { name: "Zyxel", category: "network_switching", website: "https://www.zyxel.com", vendorType: "oem" },
  { name: "Allied Telesis", category: "network_switching", website: "https://www.alliedtelesis.com", vendorType: "oem" },
  { name: "Planet", category: "network_switching", website: "https://www.planet.com.tw", vendorType: "oem" },
  { name: "LANCOM", category: "network_switching", website: "https://www.lancom-systems.de", vendorType: "oem" },
  { name: "Ruijie Networks", category: "network_switching", website: "https://www.ruijienetworks.com", vendorType: "oem" },
  { name: "Ubiquiti Networks", category: "network_wireless", website: "https://www.ui.com", vendorType: "oem" },
  { name: "Cambium Networks", category: "network_wireless", website: "https://www.cambiumnetworks.com", vendorType: "oem" },
  { name: "Aerohive Networks", category: "network_wireless", vendorType: "oem" },
  { name: "Peplink", category: "network_sdwan", website: "https://www.peplink.com", vendorType: "oem" },
  { name: "DrayTek", category: "network_switching", website: "https://www.draytek.com", vendorType: "oem" },
  { name: "LevelOne", category: "network_switching", website: "https://www.level1.com", vendorType: "oem" },
  { name: "TRENDnet", category: "network_switching", website: "https://www.trendnet.com", vendorType: "oem" },
  { name: "Allnet", category: "network_switching", website: "https://www.allnet.de", vendorType: "oem" },
  { name: "Longshine", category: "network_switching", vendorType: "oem" },
  { name: "KTI Networks", category: "network_switching", vendorType: "oem" },
  { name: "Volktek", category: "network_switching", vendorType: "oem" },
  { name: "Araknis Networks", category: "network_switching", vendorType: "oem" },
  { name: "Netonix", category: "network_switching", vendorType: "oem" },
  { name: "ReadyLinks", category: "network_switching", vendorType: "oem" },
  { name: "Riverstone", category: "network_switching", vendorType: "oem" },
  { name: "Marconi", category: "network_switching", vendorType: "oem" },
  { name: "Star", category: "network_switching", vendorType: "oem" },
  { name: "pakedge", category: "network_switching", vendorType: "oem" },
  { name: "Wi-Tek", category: "network_switching", vendorType: "oem" },
  { name: "Waystream (ex. Packetfront)", category: "network_switching", website: "https://www.waystream.com", vendorType: "oem" },
  { name: "Big Switch Networks", category: "network_switching", vendorType: "oem" },
  { name: "Cumulus Networks", category: "network_switching", website: "https://www.nvidia.com/networking", vendorType: "oem" },
  { name: "IP Infusion", category: "network_switching", website: "https://www.ipinfusion.com", vendorType: "oem" },
  { name: "NoviFlow", category: "network_switching", website: "https://noviflow.com", vendorType: "oem" },
  { name: "Bintec", category: "network_switching", vendorType: "oem" },
  { name: "Fujitsu", category: "network_switching", website: "https://www.fujitsu.com", vendorType: "oem" },
  { name: "NEC", category: "network_switching", website: "https://www.nec.com", vendorType: "oem" },
  { name: "ZTE", category: "network_carrier", website: "https://www.zte.com.cn", vendorType: "oem" },

  // ═══════════════════════════════════════════════════════
  // WHITEBOX / ODM
  // ═══════════════════════════════════════════════════════
  { name: "Edge Core", category: "whitebox", website: "https://www.edge-core.com", vendorType: "manufacturer" },
  { name: "Accton", category: "whitebox", website: "https://www.accton.com", vendorType: "manufacturer" },
  { name: "Quanta", category: "whitebox", website: "https://www.qct.io", vendorType: "manufacturer" },
  { name: "Asterfusion", category: "whitebox", website: "https://www.asterfusion.com", vendorType: "manufacturer" },
  { name: "Centec", category: "whitebox", website: "https://www.centecnetworks.com", vendorType: "manufacturer" },
  { name: "Penguin Computing", category: "whitebox", website: "https://www.penguincomputing.com", vendorType: "manufacturer" },
  { name: "SolidRun", category: "whitebox", website: "https://www.solid-run.com", vendorType: "manufacturer" },

  // ═══════════════════════════════════════════════════════
  // NETWORK SECURITY — Firewalls, UTM, VPN
  // ═══════════════════════════════════════════════════════
  { name: "Fortinet", category: "network_security", website: "https://www.fortinet.com", vendorType: "oem" },
  { name: "Palo Alto Networks", category: "network_security", website: "https://www.paloaltonetworks.com", vendorType: "oem" },
  { name: "Check Point", category: "network_security", website: "https://www.checkpoint.com", vendorType: "oem" },
  { name: "SonicWALL", category: "network_security", website: "https://www.sonicwall.com", vendorType: "oem" },
  { name: "WatchGuard", category: "network_security", website: "https://www.watchguard.com", vendorType: "oem" },
  { name: "Barracuda Networks", category: "network_security", website: "https://www.barracuda.com", vendorType: "oem" },
  { name: "Sophos", category: "network_security", website: "https://www.sophos.com", vendorType: "oem" },
  { name: "Fireeye", category: "network_security", website: "https://www.trellix.com", vendorType: "oem" },
  { name: "Bluecoat", category: "network_security", vendorType: "oem", notes: "Now Symantec/Broadcom" },
  { name: "Forcepoint", category: "network_security", website: "https://www.forcepoint.com", vendorType: "oem" },
  { name: "Hillstone", category: "network_security", website: "https://www.hillstonenet.com", vendorType: "oem" },
  { name: "Clavister", category: "network_security", website: "https://www.clavister.com", vendorType: "oem" },
  { name: "Stormshield", category: "network_security", website: "https://www.stormshield.com", vendorType: "oem" },
  { name: "secunet", category: "network_security", website: "https://www.secunet.com", vendorType: "oem" },
  { name: "Securepoint", category: "network_security", website: "https://www.securepoint.de", vendorType: "oem" },
  { name: "Senetas", category: "network_security", website: "https://www.senetas.com", vendorType: "oem" },
  { name: "Thales (ex. Gemalto)", category: "network_security", website: "https://www.thalesgroup.com", vendorType: "oem" },
  { name: "McAfee", category: "network_security", vendorType: "oem" },
  { name: "Symantec", category: "network_security", vendorType: "oem" },
  { name: "PulseSecure", category: "network_security", website: "https://www.ivanti.com", vendorType: "oem" },
  { name: "Nozomi Networks", category: "network_security", website: "https://www.nozominetworks.com", vendorType: "oem" },
  { name: "Trend Micro (ex. TippingPoint)", category: "network_security", website: "https://www.trendmicro.com", vendorType: "oem" },
  { name: "Netgate", category: "network_security", website: "https://www.netgate.com", vendorType: "oem", notes: "pfSense" },
  { name: "OPNsense", category: "network_security", website: "https://opnsense.org", vendorType: "oem" },
  { name: "Deciso", category: "network_security", website: "https://www.deciso.com", vendorType: "oem", notes: "OPNsense hardware" },
  { name: "Turris Omnia", category: "network_security", website: "https://www.turris.com", vendorType: "oem" },
  { name: "Sandvine", category: "network_security", website: "https://www.sandvine.com", vendorType: "oem" },

  // ═══════════════════════════════════════════════════════
  // CARRIER / TELECOM / OPTICAL TRANSPORT
  // ═══════════════════════════════════════════════════════
  { name: "Ciena", category: "network_carrier", website: "https://www.ciena.com", vendorType: "oem" },
  { name: "Ciena (ex. Nortel)", category: "network_carrier", website: "https://www.ciena.com", vendorType: "oem" },
  { name: "ADVA", category: "network_carrier", website: "https://www.adtran.com", vendorType: "oem", notes: "Now part of ADTRAN" },
  { name: "ADTRAN", category: "network_carrier", website: "https://www.adtran.com", vendorType: "oem" },
  { name: "Infinera", category: "network_carrier", website: "https://www.infinera.com", vendorType: "oem" },
  { name: "Infinera (ex. Coriant)", category: "network_carrier", website: "https://www.infinera.com", vendorType: "oem" },
  { name: "Infinera (ex. Transmode)", category: "network_carrier", website: "https://www.infinera.com", vendorType: "oem" },
  { name: "Coriant (ex. Tellabs)", category: "network_carrier", vendorType: "oem" },
  { name: "Ericsson", category: "network_carrier", website: "https://www.ericsson.com", vendorType: "oem" },
  { name: "Ceragon", category: "network_carrier", website: "https://www.ceragon.com", vendorType: "oem" },
  { name: "Ribbon (ex. ECI)", category: "network_carrier", website: "https://www.ribboncommunications.com", vendorType: "oem" },
  { name: "Ribbon (ex. Sonus)", category: "network_carrier", website: "https://www.ribboncommunications.com", vendorType: "oem" },
  { name: "Calix", category: "network_carrier", website: "https://www.calix.com", vendorType: "oem" },
  { name: "RAD", category: "network_carrier", website: "https://www.rad.com", vendorType: "oem" },
  { name: "Raisecom", category: "network_carrier", website: "https://www.raisecom.com", vendorType: "oem" },
  { name: "Packetlight", category: "network_carrier", website: "https://www.packetlight.com", vendorType: "oem" },
  { name: "Telco Systems", category: "network_carrier", website: "https://www.telco.com", vendorType: "oem" },
  { name: "TelcoBridges", category: "network_carrier", website: "https://www.telcobridges.com", vendorType: "oem" },
  { name: "Overture", category: "network_carrier", vendorType: "oem" },
  { name: "Cyan", category: "network_carrier", vendorType: "oem" },
  { name: "Orckit-Corrigent", category: "network_carrier", vendorType: "oem" },
  { name: "Redback", category: "network_carrier", vendorType: "oem" },
  { name: "Sorrento Networks", category: "network_carrier", vendorType: "oem" },
  { name: "Xtera Communications", category: "network_carrier", vendorType: "oem" },
  { name: "Zhone", category: "network_carrier", vendorType: "oem" },
  { name: "PBN", category: "network_carrier", vendorType: "oem" },
  { name: "Casa Systems", category: "network_carrier", website: "https://www.casa-systems.com", vendorType: "oem" },
  { name: "Genband", category: "network_carrier", vendorType: "oem" },
  { name: "Actelis", category: "network_carrier", vendorType: "oem" },
  { name: "Keymile", category: "network_carrier", vendorType: "oem" },
  { name: "Aviat Networks", category: "network_carrier", website: "https://www.aviatnetworks.com", vendorType: "oem" },
  { name: "SAF Tehnika", category: "network_carrier", website: "https://www.saftehnika.com", vendorType: "oem" },
  { name: "Siklu", category: "network_carrier", website: "https://www.siklu.com", vendorType: "oem" },
  { name: "Net Insight", category: "network_carrier", website: "https://www.netinsight.net", vendorType: "oem" },
  { name: "Nextivity", category: "network_carrier", vendorType: "oem" },
  { name: "AudioCodes", category: "network_carrier", website: "https://www.audiocodes.com", vendorType: "oem" },
  { name: "SagemCOM", category: "network_carrier", website: "https://www.sagemcom.com", vendorType: "oem" },
  { name: "Freebox", category: "network_carrier", vendorType: "oem", notes: "Free (Iliad) ISP hardware" },
  { name: "NTT Devices", category: "network_carrier", vendorType: "oem" },
  { name: "Teleste", category: "network_carrier", website: "https://www.teleste.com", vendorType: "oem" },
  { name: "Teltonika", category: "network_carrier", website: "https://teltonika-networks.com", vendorType: "oem" },
  { name: "Accedian Networks", category: "network_carrier", website: "https://www.accedian.com", vendorType: "oem" },
  { name: "OTN Systems", category: "network_carrier", website: "https://www.otnsystems.com", vendorType: "oem" },
  { name: "FibroLAN", category: "network_carrier", website: "https://www.fibrolan.com", vendorType: "oem" },
  { name: "Optonet", category: "network_carrier", vendorType: "oem" },
  { name: "ComNet", category: "network_carrier", website: "https://www.comnet.net", vendorType: "oem" },

  // ═══════════════════════════════════════════════════════
  // SD-WAN
  // ═══════════════════════════════════════════════════════
  { name: "Versa Networks", category: "network_sdwan", website: "https://www.versa-networks.com", vendorType: "oem" },

  // ═══════════════════════════════════════════════════════
  // STORAGE
  // ═══════════════════════════════════════════════════════
  { name: "NetApp", category: "storage", website: "https://www.netapp.com", vendorType: "oem" },
  { name: "Pure Storage", category: "storage", website: "https://www.purestorage.com", vendorType: "oem" },
  { name: "EMC", category: "storage", website: "https://www.dell.com/emc", vendorType: "oem" },
  { name: "HP Storage (B-Series)", category: "storage", vendorType: "oem" },
  { name: "HP Storage (C-Series)", category: "storage", vendorType: "oem" },
  { name: "HP Storage (H-Series)", category: "storage", vendorType: "oem" },
  { name: "IBM Storage", category: "storage", website: "https://www.ibm.com/storage", vendorType: "oem" },
  { name: "Nimblestorage", category: "storage", vendorType: "oem", notes: "Now HPE" },
  { name: "Infortrend", category: "storage", website: "https://www.infortrend.com", vendorType: "oem" },
  { name: "QNAP", category: "storage", website: "https://www.qnap.com", vendorType: "oem" },
  { name: "QSAN", category: "storage", website: "https://www.qsan.com", vendorType: "oem" },
  { name: "Synology", category: "storage", website: "https://www.synology.com", vendorType: "oem" },
  { name: "Oracle", category: "storage", website: "https://www.oracle.com", vendorType: "oem" },
  { name: "Nutanix", category: "storage", website: "https://www.nutanix.com", vendorType: "oem" },
  { name: "Rubirk", category: "storage", website: "https://www.rubrik.com", vendorType: "oem" },
  { name: "Rubrik", category: "storage", website: "https://www.rubrik.com", vendorType: "oem" },
  { name: "FAST LTA", category: "storage", website: "https://www.fast-lta.de", vendorType: "oem" },

  // ═══════════════════════════════════════════════════════
  // SERVERS / COMPUTE
  // ═══════════════════════════════════════════════════════
  { name: "Supermicro", category: "server", website: "https://www.supermicro.com", vendorType: "oem" },
  { name: "Sun", category: "server", vendorType: "oem", notes: "Now Oracle" },
  { name: "Hitachi", category: "server", website: "https://www.hitachivantara.com", vendorType: "oem" },

  // ═══════════════════════════════════════════════════════
  // LOAD BALANCERS / ADC
  // ═══════════════════════════════════════════════════════
  { name: "F5 Networks", category: "load_balancer", website: "https://www.f5.com", vendorType: "oem" },
  { name: "Citrix Netscaler", category: "load_balancer", website: "https://www.cloud.com", vendorType: "oem" },
  { name: "Kemp Technologies", category: "load_balancer", website: "https://www.progress.com/kemp", vendorType: "oem" },
  { name: "A10networks", category: "load_balancer", website: "https://www.a10networks.com", vendorType: "oem" },
  { name: "Radware", category: "load_balancer", website: "https://www.radware.com", vendorType: "oem" },
  { name: "Arbor Networks", category: "load_balancer", vendorType: "oem", notes: "DDoS protection, now Netscout" },

  // ═══════════════════════════════════════════════════════
  // NICs / HBAs / NETWORK ADAPTERS
  // ═══════════════════════════════════════════════════════
  { name: "Intel", category: "nic", website: "https://www.intel.com", vendorType: "manufacturer" },
  { name: "Intel Netscaler", category: "nic", vendorType: "manufacturer" },
  { name: "Broadcom", category: "nic", website: "https://www.broadcom.com", vendorType: "manufacturer" },
  { name: "Chelsio", category: "nic", website: "https://www.chelsio.com", vendorType: "manufacturer" },
  { name: "Solarflare", category: "nic", website: "https://www.xilinx.com", vendorType: "manufacturer", notes: "Now AMD/Xilinx" },
  { name: "QLogic", category: "nic", vendorType: "manufacturer", notes: "Now Marvell" },
  { name: "Emulex", category: "nic", vendorType: "manufacturer", notes: "Now Broadcom" },
  { name: "Myricom", category: "nic", vendorType: "manufacturer" },
  { name: "ATTO", category: "nic", website: "https://www.atto.com", vendorType: "manufacturer" },
  { name: "napatech", category: "nic", website: "https://www.napatech.com", vendorType: "manufacturer" },
  { name: "Netxen", category: "nic", vendorType: "manufacturer" },
  { name: "Xilinx", category: "nic", website: "https://www.amd.com/xilinx", vendorType: "manufacturer" },
  { name: "Bittware", category: "nic", website: "https://www.bittware.com", vendorType: "manufacturer" },
  { name: "Winyao", category: "nic", vendorType: "manufacturer" },

  // ═══════════════════════════════════════════════════════
  // MONITORING / TAP / TEST & MEASUREMENT
  // ═══════════════════════════════════════════════════════
  { name: "Gigamon", category: "monitoring", website: "https://www.gigamon.com", vendorType: "oem" },
  { name: "Keysight (ex. Ixia)", category: "monitoring", website: "https://www.keysight.com", vendorType: "oem" },
  { name: "Viavi (ex. JDSU)", category: "monitoring", website: "https://www.viavisolutions.com", vendorType: "oem" },
  { name: "Spirent", category: "monitoring", website: "https://www.spirent.com", vendorType: "oem" },
  { name: "NetOptics", category: "monitoring", vendorType: "oem" },
  { name: "Netscout", category: "monitoring", website: "https://www.netscout.com", vendorType: "oem" },
  { name: "Fluke Networks", category: "monitoring", website: "https://www.flukenetworks.com", vendorType: "oem" },
  { name: "Garland Technology", category: "monitoring", website: "https://www.garlandtechnology.com", vendorType: "oem" },
  { name: "ProfiTap", category: "monitoring", website: "https://www.profitap.com", vendorType: "oem" },
  { name: "VSS monitoring", category: "monitoring", vendorType: "oem" },
  { name: "VeEX", category: "monitoring", website: "https://www.veexinc.com", vendorType: "oem" },
  { name: "Trend Networks", category: "monitoring", website: "https://www.trend-networks.com", vendorType: "oem" },
  { name: "xtramus", category: "monitoring", vendorType: "oem" },
  { name: "Wildpackets", category: "monitoring", vendorType: "oem" },

  // ═══════════════════════════════════════════════════════
  // BROADCAST / AV / VIDEO
  // ═══════════════════════════════════════════════════════
  { name: "Evertz", category: "broadcast_av", website: "https://www.evertz.com", vendorType: "oem" },
  { name: "Grassvalley", category: "broadcast_av", website: "https://www.grassvalley.com", vendorType: "oem" },
  { name: "Riedel", category: "broadcast_av", website: "https://www.riedel.net", vendorType: "oem" },
  { name: "Blackmagic Design", category: "broadcast_av", website: "https://www.blackmagicdesign.com", vendorType: "oem" },
  { name: "EVS", category: "broadcast_av", website: "https://www.evs.com", vendorType: "oem" },
  { name: "Nevion", category: "broadcast_av", website: "https://www.nevion.com", vendorType: "oem" },
  { name: "LAWO", category: "broadcast_av", website: "https://www.lawo.com", vendorType: "oem" },
  { name: "Harmonic", category: "broadcast_av", website: "https://www.harmonicinc.com", vendorType: "oem" },
  { name: "Clear-Com", category: "broadcast_av", website: "https://www.clearcom.com", vendorType: "oem" },
  { name: "Barnfind", category: "broadcast_av", website: "https://www.barnfind.no", vendorType: "oem" },
  { name: "DirectOut", category: "broadcast_av", website: "https://www.directout.eu", vendorType: "oem" },
  { name: "Ferrofish", category: "broadcast_av", website: "https://www.ferrofish.com", vendorType: "oem" },
  { name: "Luminex", category: "broadcast_av", website: "https://www.luminex.be", vendorType: "oem" },
  { name: "Lynx", category: "broadcast_av", vendorType: "oem" },
  { name: "ZeeVee", category: "broadcast_av", website: "https://www.zeevee.com", vendorType: "oem" },
  { name: "Sony", category: "broadcast_av", website: "https://pro.sony", vendorType: "oem" },
  { name: "Novastar", category: "broadcast_av", website: "https://www.novastar.tech", vendorType: "oem" },
  { name: "Matrox", category: "broadcast_av", website: "https://www.matrox.com", vendorType: "oem" },
  { name: "IDK Corporation", category: "broadcast_av", website: "https://www.idk.co.jp", vendorType: "oem" },
  { name: "Guntermann & Drunck", category: "broadcast_av", website: "https://www.gdsys.de", vendorType: "oem" },
  { name: "kvm-tec", category: "broadcast_av", website: "https://www.kvm-tec.com", vendorType: "oem" },
  { name: "FieldCast", category: "broadcast_av", website: "https://www.fieldcast.com", vendorType: "oem" },
  { name: "FiberPlex", category: "broadcast_av", website: "https://www.fiberplex.com", vendorType: "oem" },
  { name: "Yamaha", category: "broadcast_av", website: "https://www.yamaha.com", vendorType: "oem" },

  // ═══════════════════════════════════════════════════════
  // INDUSTRIAL NETWORKING
  // ═══════════════════════════════════════════════════════
  { name: "Hirschmann", category: "industrial", website: "https://www.hirschmann.com", vendorType: "oem" },
  { name: "Moxa", category: "industrial", website: "https://www.moxa.com", vendorType: "oem" },
  { name: "Phoenix Contact", category: "industrial", website: "https://www.phoenixcontact.com", vendorType: "oem" },
  { name: "Siemens", category: "industrial", website: "https://www.siemens.com", vendorType: "oem" },
  { name: "Korenix", category: "industrial", website: "https://www.korenix.com", vendorType: "oem" },
  { name: "Westermo", category: "industrial", website: "https://www.westermo.com", vendorType: "oem" },
  { name: "Weidmüller", category: "industrial", website: "https://www.weidmueller.com", vendorType: "oem" },
  { name: "Rockwell", category: "industrial", website: "https://www.rockwellautomation.com", vendorType: "oem" },
  { name: "GE (General Electric)", category: "industrial", website: "https://www.ge.com", vendorType: "oem" },
  { name: "ABB", category: "industrial", website: "https://new.abb.com", vendorType: "oem" },
  { name: "Wago", category: "industrial", website: "https://www.wago.com", vendorType: "oem" },
  { name: "Redlion", category: "industrial", website: "https://www.redlion.net", vendorType: "oem" },
  { name: "Redlion (ex. Sixnet)", category: "industrial", website: "https://www.redlion.net", vendorType: "oem" },
  { name: "CTC Union", category: "industrial", website: "https://www.ctcu.com", vendorType: "oem" },
  { name: "Advantech", category: "industrial", website: "https://www.advantech.com", vendorType: "oem" },
  { name: "Advantech B+B SmartWorx", category: "industrial", website: "https://www.advantech.com", vendorType: "oem" },
  { name: "Microsens", category: "industrial", website: "https://www.microsens.com", vendorType: "oem" },
  { name: "eks Engel", category: "industrial", website: "https://www.eks-engel.de", vendorType: "oem" },
  { name: "barox", category: "industrial", website: "https://www.barox.de", vendorType: "oem" },
  { name: "Omnitron", category: "industrial", website: "https://www.omnitron-systems.com", vendorType: "oem" },
  { name: "Transition Networks", category: "industrial", website: "https://www.transition.com", vendorType: "oem" },
  { name: "Perle", category: "industrial", website: "https://www.perle.com", vendorType: "oem" },
  { name: "IMC", category: "industrial", vendorType: "oem" },
  { name: "Niveo", category: "industrial", vendorType: "oem" },
  { name: "Cerio", category: "industrial", vendorType: "oem" },

  // ═══════════════════════════════════════════════════════
  // SURVEILLANCE / IP CAMERAS
  // ═══════════════════════════════════════════════════════
  { name: "Axis", category: "surveillance", website: "https://www.axis.com", vendorType: "oem" },
  { name: "Dahua", category: "surveillance", website: "https://www.dahuasecurity.com", vendorType: "oem" },
  { name: "eneo", category: "surveillance", website: "https://www.eneo-security.com", vendorType: "oem" },
  { name: "AMG Systems", category: "surveillance", website: "https://www.amgsystems.com", vendorType: "oem" },

  // ═══════════════════════════════════════════════════════
  // MISC / CONNECTIVITY / ACCESSORIES
  // ═══════════════════════════════════════════════════════
  { name: "Blackbox", category: "other", website: "https://www.blackbox.com", vendorType: "oem" },
  { name: "Commscope", category: "other", website: "https://www.commscope.com", vendorType: "oem" },
  { name: "CommScope (ex. Arris)", category: "other", website: "https://www.commscope.com", vendorType: "oem" },
  { name: "Nexans", category: "other", website: "https://www.nexans.com", vendorType: "oem" },
  { name: "LINDY", category: "other", website: "https://www.lindy.com", vendorType: "oem" },
  { name: "Delock", category: "other", website: "https://www.delock.de", vendorType: "oem" },
  { name: "Digitus", category: "other", website: "https://www.digitus.info", vendorType: "oem" },
  { name: "StarTech", category: "other", website: "https://www.startech.com", vendorType: "oem" },
  { name: "Ugreen", category: "other", website: "https://www.ugreen.com", vendorType: "oem" },
  { name: "Sonnet Technologies", category: "other", website: "https://www.sonnettech.com", vendorType: "oem" },
  { name: "ASUS", category: "other", website: "https://www.asus.com", vendorType: "oem" },
  { name: "AVM", category: "other", website: "https://www.avm.de", vendorType: "oem", notes: "FRITZ!Box" },
  { name: "Datto", category: "other", website: "https://www.datto.com", vendorType: "oem" },
  { name: "Lantronix", category: "other", website: "https://www.lantronix.com", vendorType: "oem" },
  { name: "OpenGear", category: "other", website: "https://www.opengear.com", vendorType: "oem" },
  { name: "ZPE Systems", category: "other", website: "https://www.zpesystems.com", vendorType: "oem" },
  { name: "Grandstream", category: "other", website: "https://www.grandstream.com", vendorType: "oem" },
  { name: "Riverbed", category: "other", website: "https://www.riverbed.com", vendorType: "oem" },
  { name: "Digicomm", category: "other", vendorType: "oem" },
  { name: "Avara", category: "other", vendorType: "oem" },
  { name: "Axon", category: "other", vendorType: "oem" },
  { name: "Motorola", category: "other", website: "https://www.motorola.com", vendorType: "oem" },
  { name: "MRV", category: "other", vendorType: "oem" },
  { name: "voleatech", category: "other", vendorType: "oem" },
  { name: "emcore", category: "other", vendorType: "oem" },
  { name: "Motorola", category: "other", vendorType: "oem" },
];

export async function seedFlexoptixVendors(): Promise<void> {
  console.log(`\n=== Seeding ${FLEXOPTIX_VENDORS.length} Flexoptix Supported Vendors ===\n`);

  let created = 0;
  let updated = 0;

  for (const v of FLEXOPTIX_VENDORS) {
    try {
      const existing = await pool.query(
        `SELECT id FROM vendors WHERE name ILIKE $1`,
        [v.name]
      );

      if (existing.rows.length > 0) {
        // Mark as flexoptix-supported and update category
        await pool.query(
          `UPDATE vendors SET
            flexoptix_supported = TRUE,
            vendor_category = COALESCE($2, vendor_category),
            website = COALESCE($3, website),
            notes = COALESCE($4, notes),
            updated_at = NOW()
           WHERE id = $1`,
          [existing.rows[0].id, v.category, v.website || null, v.notes || null]
        );
        updated++;
      } else {
        const slug = v.name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/-+$/, "");
        await pool.query(
          `INSERT INTO vendors (name, slug, type, website, vendor_category, flexoptix_supported, notes)
           VALUES ($1, $2, $3, $4, $5, TRUE, $6)
           ON CONFLICT (slug) DO UPDATE SET
             flexoptix_supported = TRUE,
             vendor_category = COALESCE($5, vendors.vendor_category),
             updated_at = NOW()`,
          [v.name, slug, v.vendorType, v.website || null, v.category, v.notes || null]
        );
        created++;
        console.log(`  + ${v.name} [${v.category}]`);
      }
    } catch (err) {
      console.error(`  ! Error: ${v.name}:`, err);
    }
  }

  console.log(`\n  Created: ${created}, Updated: ${updated}, Total: ${FLEXOPTIX_VENDORS.length}`);

  // Summary by category
  const cats: Record<string, number> = {};
  for (const v of FLEXOPTIX_VENDORS) {
    cats[v.category] = (cats[v.category] || 0) + 1;
  }
  console.log("\n  Breakdown by category:");
  for (const [cat, count] of Object.entries(cats).sort((a, b) => b[1] - a[1])) {
    console.log(`    ${cat}: ${count}`);
  }
  console.log();
}
