import e from"../../node_modules/lodash/isEmpty.js";import o from"../../node_modules/lodash/isNil.js";import t,{useMemo as r}from"react";import l from"./ObjectTypeahead.js";import a from"./StringTypeahead.js";function s({allowNew:s,disableSorting:m,labelKey:n,options:i,sortBy:p,...d}){const y=r((()=>m?i:o(p)?o(n)||e(i)||"string"!=typeof n(i[0])?[...i].sort():[...i].sort(((e,o)=>n(e).localeCompare(n(o)))):[...i].sort(p)),[m,p,n,i]),c=document.getElementById("portal-root");return!0===s?t.createElement(a,{...d,allowNew:!0,labelKey:n,menuPortalTarget:c,options:y}):t.createElement(l,{...d,labelKey:n,menuPortalTarget:c,options:y})}export{s as default};
//# sourceMappingURL=Typeahead.js.map
