Roadblock: your email platform demands First/Last but the form sends "Jane Marie Doe". This handles middle names, single names, and stray spaces.
const parts = (inputData.fullName || "").trim().split(/\s+/);
const firstName = parts[0] || "";
const lastName = parts.length > 1 ? parts[parts.length - 1] : "";
output = { firstName, lastName };