import { nakedCellRowModeAlign } from "../Field/field-wrapper.js";
import { resolvePerson, buildPersonProfileCard } from "./person-display.js";
const PEOPLE_PICKER_LENGTH1_WRAPPER_CLASS = `flex-1 min-w-0 inline-flex items-center ${nakedCellRowModeAlign}`;
function getPeoplePickerTagWrapperClass(selectedCount) {
  return selectedCount === 1 ? PEOPLE_PICKER_LENGTH1_WRAPPER_CLASS : "-ml-0.5 first:ml-0 relative inline-flex group/avatar";
}
function personToSelectOption(person) {
  const p = resolvePerson(person);
  return {
    value: p.name,
    label: p.name,
    avatar: { src: p.avatarUrl, alt: p.name, hoverCard: buildPersonProfileCard(p) },
    description: p.description
  };
}
function findPerson(people, name) {
  return people.find((p) => resolvePerson(p).name === name) ?? name;
}
export {
  PEOPLE_PICKER_LENGTH1_WRAPPER_CLASS,
  findPerson,
  getPeoplePickerTagWrapperClass,
  personToSelectOption
};
//# sourceMappingURL=people-picker-helpers.js.map
