// src/utils/humanity-signals.ts
var HONEYPOT_FIELD = "contact_url_confirm";
var ELAPSED_MS_FIELD = "form_elapsed_ms";
var DEFAULT_MIN_FILL_MS = 700;
function extractHumanitySignals(body) {
  const b = body ?? {};
  const rawHp = b[HONEYPOT_FIELD];
  const honeypot = rawHp == null ? "" : String(rawHp);
  const rawMs = b[ELAPSED_MS_FIELD];
  const elapsedMs = typeof rawMs === "number" && Number.isFinite(rawMs) ? rawMs : null;
  return { honeypot, elapsedMs };
}
function evaluateHumanitySignals(body, opts) {
  const { honeypot, elapsedMs } = extractHumanitySignals(body);
  if (honeypot.trim() !== "") return { ok: false, reason: "honeypot" };
  if (elapsedMs !== null && elapsedMs < opts.minFillMs) return { ok: false, reason: "too_fast" };
  return { ok: true };
}
var splitCsvEnv = (s) => s?.split(",").map((t) => t.trim()).filter(Boolean) ?? [];

export { DEFAULT_MIN_FILL_MS, ELAPSED_MS_FIELD, HONEYPOT_FIELD, evaluateHumanitySignals, extractHumanitySignals, splitCsvEnv };
//# sourceMappingURL=humanity-signals.js.map
//# sourceMappingURL=humanity-signals.js.map