// Eye tracker — STUB.
//
// Conforms to the Tracker interface but emits no poses. When you switch the
// hands-free source to "eye", the cursor will simply freeze at its last
// position. This file is the single integration point for a real gaze model
// later (e.g., MediaPipe iris/gaze, WebGazer, a custom TF.js model).
//
// To make this a real eye tracker:
//   1. In init(): load your gaze model (similar to head-tracker's MediaPipe init).
//   2. In start(): begin a setInterval (~30 Hz) reading from `video` and
//      computing gaze direction.
//   3. Convert gaze output into { yaw, pitch } using the same scale as the
//      head tracker — normalized offsets relative to inter-eye distance —
//      so the shared pipeline's tuning constants (DEADZONE, ACCEL_FACTOR,
//      VEL_SMOOTH, MAX_SPEED, SENS_X/Y) keep their current feel.
//   4. Call poseCb({ yaw, pitch }) per frame, or poseCb(null) when gaze is lost.

import { log } from "./log.js";

export function createEyeTracker({ video: _video }) {
  let running = false;
  let poseCb = null;

  return {
    async init() {
      log("EyeTracker stub initialized — replace with real implementation");
    },
    start() {
      if (running) return;
      running = true;
      log("EyeTracker stub started — emitting no poses");
      // Reference suppress to keep param alive for future use.
      void _video;
      void poseCb;
    },
    stop() {
      running = false;
      log("EyeTracker stub stopped");
    },
    onPose(cb) {
      poseCb = cb;
    },
  };
}
