import { isRecord as l } from "../../../isRecord.js";
import { coerceId as r, coerceBoolean as s } from "./helpers/guards/guards.js";
function f(e) {
  if (!l(e))
    return null;
  const o = r(e.id);
  if (o === void 0)
    return null;
  let i;
  if (typeof e.label == "string" && e.label.trim() !== "" ? i = e.label : typeof e.name == "string" && e.name.trim() !== "" ? i = e.name : typeof e.value == "string" && e.value.trim() !== "" && (i = e.value), i === void 0)
    return null;
  const t = { id: o, label: i };
  typeof e.value == "string" && (t.value = e.value);
  const n = s(e.disabled);
  return n !== void 0 && (t.disabled = n), typeof e.description == "string" && (t.description = e.description), t;
}
function c(e) {
  if (!Array.isArray(e))
    return [];
  const o = [];
  for (const i of e) {
    const t = f(i);
    t && o.push(t);
  }
  return o;
}
export {
  c as normalizeFieldOptionsForCheckableList
};
