/**
 * Shared mock data: vessels (VesselData)
 *
 * Sources:
 *   - Dashboard.tsx          TOP_RISK_VESSELS (8)
 *   - DarkVesselDetection.tsx DATA (7 suspects)
 *   - LiveMapView.tsx        AIS_VESSELS (9) + mockEvents (3 event vessels)
 *
 * Risk scores are normalised to 0-100 integer scale.
 * Coordinates are [lat, lng].
 */

export interface VesselData {
  id: string;
  mmsi: string;
  name: string;
  type: string;        // 중국어선, 화물선, 미상 등
  flag: string;        // CN, KR, UNKNOWN 등
  lat: number;
  lng: number;
  speed?: number;
  heading?: number;
  tonnage?: number;
  risk: number;        // 0-100 integer scale
  status: string;      // 추적중, 감시중, 정상 등
  pattern?: string;    // AIS 차단, MMSI 변조 등
  lastSignal?: string;
}

// ────────────────────────────────────────────
// Combined & deduplicated vessel list
// ────────────────────────────────────────────
export const MOCK_VESSELS: VesselData[] = [
  // --- TOP_RISK_VESSELS (Dashboard) merged with DarkVesselDetection & LiveMapView ---
  {
    id: 'V-2024-0142',
    mmsi: '412345678',
    name: '鲁荣渔56555',
    type: '중국어선',
    flag: 'CN',
    lat: 37.2012,
    lng: 124.6345,
    speed: 8.2,
    heading: 225,
    tonnage: 127,
    risk: 96,
    status: '추적중',
    pattern: 'EEZ 침범',
    lastSignal: '2분 전',
  },
  {
    id: 'DV-001',
    mmsi: '미상',
    name: '미상선박-A',
    type: '미상',
    flag: 'UNKNOWN',
    lat: 37.75,
    lng: 125.02,
    speed: 6.1,
    heading: 180,
    tonnage: undefined,
    risk: 96,
    status: '추적중',
    pattern: 'AIS 완전차단',
    lastSignal: '6h+ 소실',
  },
  {
    id: 'V-2024-0231',
    mmsi: '412777888',
    name: '浙岱渔02856',
    type: '중국어선',
    flag: 'CN',
    lat: 37.0567,
    lng: 124.9234,
    speed: 4.5,
    heading: 45,
    tonnage: 219,
    risk: 92,
    status: '추적중',
    pattern: '선단침범',
    lastSignal: '5분 전',
  },
  {
    id: 'DV-002',
    mmsi: '412345678',
    name: '浙甬渔60651',
    type: '중국어선',
    flag: 'CN',
    lat: 35.87,
    lng: 125.50,
    speed: 5.8,
    heading: 135,
    tonnage: 258,
    risk: 94,
    status: '감시중',
    pattern: 'MMSI 3회 변경',
    lastSignal: '8분 전',
  },
  {
    id: 'DV-007',
    mmsi: '미상',
    name: '미상선박-B',
    type: '미상',
    flag: 'UNKNOWN',
    lat: 38.03,
    lng: 129.25,
    speed: 11.2,
    heading: 310,
    tonnage: undefined,
    risk: 93,
    status: '추적중',
    pattern: 'AIS 완전차단',
    lastSignal: '12h+ 소실',
  },
  {
    id: 'DV-006',
    mmsi: '412333444',
    name: '津塘渔03966',
    type: '중국어선',
    flag: 'CN',
    lat: 35.95,
    lng: 125.80,
    speed: 4.2,
    heading: 45,
    tonnage: undefined,
    risk: 91,
    status: '감시중',
    pattern: '국적 위장 의심',
    lastSignal: '3분 전',
  },
  {
    id: 'V-2024-0156',
    mmsi: '412987654',
    name: '冀黄港渔05001',
    type: '중국어선',
    flag: 'CN',
    lat: 36.60,
    lng: 125.40,
    speed: 2.1,
    heading: 0,
    tonnage: 106,
    risk: 89,
    status: '확인중',
    pattern: '불법환적',
    lastSignal: '42분 전',
  },
  {
    id: 'DV-003',
    mmsi: '412111222',
    name: '鲁荣渔51277',
    type: '중국어선',
    flag: 'CN',
    lat: 36.25,
    lng: 130.13,
    speed: 18.1,
    heading: 290,
    tonnage: 126,
    risk: 88,
    status: '추적중',
    pattern: '급격 속력변화',
    lastSignal: '1분 전',
  },
  {
    id: 'DV-004',
    mmsi: '412987654',
    name: '冀黄港渔05001-B',
    type: '중국어선',
    flag: 'CN',
    lat: 36.80,
    lng: 124.37,
    speed: 0.3,
    heading: 90,
    tonnage: 106,
    risk: 82,
    status: '확인중',
    pattern: '신호 간헐송출',
    lastSignal: '42분 전',
  },
  {
    id: 'V-2024-0312',
    mmsi: '412333886',
    name: '津塘渔03886',
    type: '중국어선',
    flag: 'CN',
    lat: 37.30,
    lng: 124.75,
    speed: 6.7,
    heading: 200,
    tonnage: 148,
    risk: 80,
    status: '감시중',
    pattern: 'EEZ 침범',
    lastSignal: '3분 전',
  },
  // --- LiveMapView event vessels ---
  {
    id: 'EVT-V-001',
    mmsi: 'MMSI 412xxxx',
    name: '浙江렌센號',
    type: '중국어선',
    flag: 'CN',
    lat: 37.20,
    lng: 124.63,
    speed: undefined,
    heading: undefined,
    tonnage: undefined,
    risk: 94,
    status: '추적중',
    pattern: 'EEZ 침범',
    lastSignal: '14:23 UTC',
  },
  {
    id: 'EVT-V-003',
    mmsi: 'MMSI 412345xxx',
    name: '福建海丰號',
    type: '중국어선',
    flag: 'CN',
    lat: 36.48,
    lng: 124.38,
    speed: undefined,
    heading: undefined,
    tonnage: undefined,
    risk: 88,
    status: '감시중',
    pattern: 'AIS 신호 소실',
    lastSignal: '13:58 UTC',
  },
  // --- LiveMapView AIS vessels (non-hostile) ---
  {
    id: 'AIS-001',
    mmsi: '',
    name: '3009함',
    type: '경비함',
    flag: 'KR',
    lat: 37.45,
    lng: 125.30,
    speed: 18,
    heading: 225,
    risk: 0,
    status: '작전중',
  },
  {
    id: 'AIS-002',
    mmsi: '',
    name: '5001함 삼봉',
    type: '경비함',
    flag: 'KR',
    lat: 36.80,
    lng: 125.60,
    speed: 14,
    heading: 180,
    risk: 0,
    status: '작전중',
  },
  {
    id: 'AIS-003',
    mmsi: '',
    name: '한라호',
    type: '순찰선',
    flag: 'KR',
    lat: 37.10,
    lng: 126.20,
    speed: 12,
    heading: 270,
    risk: 0,
    status: '작전중',
  },
  {
    id: 'AIS-004',
    mmsi: '',
    name: '辽庄渔55567',
    type: '중국어선',
    flag: 'CN',
    lat: 37.55,
    lng: 124.80,
    speed: 3.8,
    heading: 135,
    risk: 35,
    status: '정상',
    pattern: '비정기 신호',
  },
  {
    id: 'DV-005',
    mmsi: '440123456',
    name: '한국어선-12',
    type: '한국어선',
    flag: 'KR',
    lat: 34.80,
    lng: 128.60,
    speed: 5.5,
    heading: 315,
    risk: 35,
    status: '정상',
    pattern: '비정기 신호',
    lastSignal: '5분 전',
  },
  {
    id: 'AIS-006',
    mmsi: '',
    name: '제7동진호',
    type: '한국어선',
    flag: 'KR',
    lat: 35.50,
    lng: 126.50,
    speed: 5.5,
    heading: 315,
    risk: 0,
    status: '정상',
  },
  {
    id: 'AIS-007',
    mmsi: '',
    name: '새한울호',
    type: '한국어선',
    flag: 'KR',
    lat: 37.00,
    lng: 125.85,
    speed: 7.2,
    heading: 200,
    risk: 0,
    status: '정상',
  },
];

// ────────────────────────────────────────────
// Derived: suspects only (risk >= 80)
// ────────────────────────────────────────────
export const MOCK_SUSPECTS: VesselData[] = MOCK_VESSELS.filter(
  (v) => v.risk >= 80,
);
