@salesforce/design-system-react 11.0.0-rc.1 → 11.0.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (248) hide show
  1. package/README.md +10 -2
  2. package/dist/cjs/components/accordion/index.cjs +1 -1
  3. package/dist/cjs/components/accordion/index.cjs.map +1 -1
  4. package/dist/cjs/components/accordion/panel.cjs.map +1 -1
  5. package/dist/cjs/components/builder-header/nav-dropdown.cjs.map +1 -1
  6. package/dist/cjs/components/builder-header/nav-link.cjs.map +1 -1
  7. package/dist/cjs/components/builder-header/toolbar.cjs.map +1 -1
  8. package/dist/cjs/components/button/index.cjs.map +1 -1
  9. package/dist/cjs/components/button-stateful/index.cjs.map +1 -1
  10. package/dist/cjs/components/checkbox/index.cjs.map +1 -1
  11. package/dist/cjs/components/color-picker/color-picker.cjs.map +1 -1
  12. package/dist/cjs/components/combobox/combobox.cjs +1 -1
  13. package/dist/cjs/components/combobox/combobox.cjs.map +1 -1
  14. package/dist/cjs/components/date-picker/date-picker.cjs +1 -1
  15. package/dist/cjs/components/date-picker/date-picker.cjs.map +1 -1
  16. package/dist/cjs/components/date-picker/index.cjs.map +1 -1
  17. package/dist/cjs/components/files/file.cjs.map +1 -1
  18. package/dist/cjs/components/icon/index.cjs.map +1 -1
  19. package/dist/cjs/components/icon/input-icon/index.cjs.map +1 -1
  20. package/dist/cjs/components/icon-settings/index.cjs.map +1 -1
  21. package/dist/cjs/components/input/index.cjs.map +1 -1
  22. package/dist/cjs/components/input/private/inner-input.cjs.map +1 -1
  23. package/dist/cjs/components/menu-dropdown/button-trigger.cjs.map +1 -1
  24. package/dist/cjs/components/menu-dropdown/menu-dropdown.cjs.map +1 -1
  25. package/dist/cjs/components/modal/index.cjs.map +1 -1
  26. package/dist/cjs/components/panel/filtering/group.cjs.map +1 -1
  27. package/dist/cjs/components/pill/index.cjs.map +1 -1
  28. package/dist/cjs/components/popover/edit-dialog.cjs.map +1 -1
  29. package/dist/cjs/components/popover/popover.cjs.map +1 -1
  30. package/dist/cjs/components/progress-indicator/index.cjs.map +1 -1
  31. package/dist/cjs/components/progress-ring/index.cjs.map +1 -1
  32. package/dist/cjs/components/radio/index.cjs.map +1 -1
  33. package/dist/cjs/components/radio-group/check-props.cjs.map +1 -1
  34. package/dist/cjs/components/radio-group/index.cjs.map +1 -1
  35. package/dist/cjs/components/scoped-notification/index.cjs.map +1 -1
  36. package/dist/cjs/components/setup-assistant/step.cjs.map +1 -1
  37. package/dist/cjs/components/slider/index.cjs.map +1 -1
  38. package/dist/cjs/components/split-view/header.cjs.map +1 -1
  39. package/dist/cjs/components/tabs/index.cjs.map +1 -1
  40. package/dist/cjs/components/tabs/panel.cjs.map +1 -1
  41. package/dist/cjs/components/textarea/index.cjs +1 -1
  42. package/dist/cjs/components/textarea/index.cjs.map +1 -1
  43. package/dist/cjs/components/tooltip/index.cjs.map +1 -1
  44. package/dist/cjs/components/tree/tree.cjs.map +1 -1
  45. package/dist/cjs/components/trial-bar/button.cjs.map +1 -1
  46. package/dist/cjs/components/trial-bar/dropdown.cjs.map +1 -1
  47. package/dist/cjs/components/utilities/menu-list/item-label.cjs.map +1 -1
  48. package/dist/cjs/utilities/get-component-doc.cjs +1 -1
  49. package/dist/cjs/utilities/get-component-doc.cjs.map +1 -1
  50. package/dist/cjs/utilities/warning/children-as-trigger.cjs +1 -1
  51. package/dist/cjs/utilities/warning/children-as-trigger.cjs.map +1 -1
  52. package/dist/cjs/utilities/warning/deprecated-property-value.cjs +1 -1
  53. package/dist/cjs/utilities/warning/deprecated-property-value.cjs.map +1 -1
  54. package/dist/cjs/utilities/warning/deprecated-property.cjs +1 -1
  55. package/dist/cjs/utilities/warning/deprecated-property.cjs.map +1 -1
  56. package/dist/cjs/utilities/warning/removal-version.cjs +2 -0
  57. package/dist/cjs/utilities/warning/removal-version.cjs.map +1 -0
  58. package/dist/es/components/accordion/index.js +7 -3
  59. package/dist/es/components/accordion/index.js.map +1 -1
  60. package/dist/es/components/accordion/panel.js.map +1 -1
  61. package/dist/es/components/builder-header/nav-dropdown.js.map +1 -1
  62. package/dist/es/components/builder-header/nav-link.js.map +1 -1
  63. package/dist/es/components/builder-header/toolbar.js.map +1 -1
  64. package/dist/es/components/button/index.js.map +1 -1
  65. package/dist/es/components/button-stateful/index.js.map +1 -1
  66. package/dist/es/components/checkbox/index.js.map +1 -1
  67. package/dist/es/components/color-picker/color-picker.js.map +1 -1
  68. package/dist/es/components/combobox/combobox.js +4 -2
  69. package/dist/es/components/combobox/combobox.js.map +1 -1
  70. package/dist/es/components/date-picker/date-picker.js +1 -1
  71. package/dist/es/components/date-picker/date-picker.js.map +1 -1
  72. package/dist/es/components/date-picker/index.js.map +1 -1
  73. package/dist/es/components/files/file.js.map +1 -1
  74. package/dist/es/components/icon/index.js.map +1 -1
  75. package/dist/es/components/icon/input-icon/index.js.map +1 -1
  76. package/dist/es/components/icon-settings/index.js.map +1 -1
  77. package/dist/es/components/input/index.js.map +1 -1
  78. package/dist/es/components/input/private/inner-input.js.map +1 -1
  79. package/dist/es/components/menu-dropdown/button-trigger.js.map +1 -1
  80. package/dist/es/components/menu-dropdown/menu-dropdown.js.map +1 -1
  81. package/dist/es/components/modal/index.js.map +1 -1
  82. package/dist/es/components/panel/filtering/group.js.map +1 -1
  83. package/dist/es/components/pill/index.js.map +1 -1
  84. package/dist/es/components/popover/edit-dialog.js.map +1 -1
  85. package/dist/es/components/popover/popover.js.map +1 -1
  86. package/dist/es/components/progress-indicator/index.js.map +1 -1
  87. package/dist/es/components/progress-ring/index.js.map +1 -1
  88. package/dist/es/components/radio/index.js.map +1 -1
  89. package/dist/es/components/radio-group/check-props.js.map +1 -1
  90. package/dist/es/components/radio-group/index.js.map +1 -1
  91. package/dist/es/components/scoped-notification/index.js.map +1 -1
  92. package/dist/es/components/setup-assistant/step.js.map +1 -1
  93. package/dist/es/components/slider/index.js.map +1 -1
  94. package/dist/es/components/split-view/header.js.map +1 -1
  95. package/dist/es/components/tabs/index.js.map +1 -1
  96. package/dist/es/components/tabs/panel.js.map +1 -1
  97. package/dist/es/components/textarea/index.js +29 -44
  98. package/dist/es/components/textarea/index.js.map +1 -1
  99. package/dist/es/components/tooltip/index.js.map +1 -1
  100. package/dist/es/components/tree/tree.js.map +1 -1
  101. package/dist/es/components/trial-bar/button.js.map +1 -1
  102. package/dist/es/components/trial-bar/dropdown.js.map +1 -1
  103. package/dist/es/components/utilities/menu-list/item-label.js.map +1 -1
  104. package/dist/es/utilities/get-component-doc.js +6 -6
  105. package/dist/es/utilities/get-component-doc.js.map +1 -1
  106. package/dist/es/utilities/warning/children-as-trigger.js +9 -8
  107. package/dist/es/utilities/warning/children-as-trigger.js.map +1 -1
  108. package/dist/es/utilities/warning/deprecated-property-value.js +11 -10
  109. package/dist/es/utilities/warning/deprecated-property-value.js.map +1 -1
  110. package/dist/es/utilities/warning/deprecated-property.js +9 -8
  111. package/dist/es/utilities/warning/deprecated-property.js.map +1 -1
  112. package/dist/es/utilities/warning/removal-version.js +6 -0
  113. package/dist/es/utilities/warning/removal-version.js.map +1 -0
  114. package/dist/llms/components/accordion.md +267 -0
  115. package/dist/llms/components/alert.md +228 -0
  116. package/dist/llms/components/avatar.md +167 -0
  117. package/dist/llms/components/badge.md +153 -0
  118. package/dist/llms/components/breadcrumb.md +148 -0
  119. package/dist/llms/components/builder-header.examples.md +239 -0
  120. package/dist/llms/components/builder-header.md +736 -0
  121. package/dist/llms/components/button-group.md +167 -0
  122. package/dist/llms/components/button-stateful.md +246 -0
  123. package/dist/llms/components/button.md +661 -0
  124. package/dist/llms/components/card.md +368 -0
  125. package/dist/llms/components/carousel.md +365 -0
  126. package/dist/llms/components/checkbox.md +887 -0
  127. package/dist/llms/components/color-picker.md +591 -0
  128. package/dist/llms/components/combobox.examples.md +802 -0
  129. package/dist/llms/components/combobox.md +929 -0
  130. package/dist/llms/components/date-picker.md +546 -0
  131. package/dist/llms/components/docked-composer.md +173 -0
  132. package/dist/llms/components/dynamic-icon.md +226 -0
  133. package/dist/llms/components/expandable-section.md +198 -0
  134. package/dist/llms/components/files.md +337 -0
  135. package/dist/llms/components/filter.md +775 -0
  136. package/dist/llms/components/icon-settings.md +301 -0
  137. package/dist/llms/components/icon.md +1040 -0
  138. package/dist/llms/components/input.md +746 -0
  139. package/dist/llms/components/media-object.md +125 -0
  140. package/dist/llms/components/menu-dropdown.md +732 -0
  141. package/dist/llms/components/modal.md +504 -0
  142. package/dist/llms/components/page-header.md +282 -0
  143. package/dist/llms/components/panel.md +256 -0
  144. package/dist/llms/components/pill-container.md +218 -0
  145. package/dist/llms/components/pill.md +266 -0
  146. package/dist/llms/components/popover.md +600 -0
  147. package/dist/llms/components/portal-settings.md +371 -0
  148. package/dist/llms/components/progress-bar.md +175 -0
  149. package/dist/llms/components/progress-indicator.md +399 -0
  150. package/dist/llms/components/progress-ring.md +146 -0
  151. package/dist/llms/components/radio-button-group.md +285 -0
  152. package/dist/llms/components/radio-group.md +242 -0
  153. package/dist/llms/components/radio.md +269 -0
  154. package/dist/llms/components/scoped-notification.md +156 -0
  155. package/dist/llms/components/setup-assistant.md +398 -0
  156. package/dist/llms/components/simple-data-table.examples.md +2773 -0
  157. package/dist/llms/components/simple-data-table.md +919 -0
  158. package/dist/llms/components/slider.md +217 -0
  159. package/dist/llms/components/spinner.md +232 -0
  160. package/dist/llms/components/split-view.md +350 -0
  161. package/dist/llms/components/tabs.md +311 -0
  162. package/dist/llms/components/textarea.md +331 -0
  163. package/dist/llms/components/toast.md +267 -0
  164. package/dist/llms/components/tooltip.md +470 -0
  165. package/dist/llms/components/tree.md +1011 -0
  166. package/dist/llms/components/trial-bar.md +383 -0
  167. package/dist/llms/components/vertical-navigation.md +196 -0
  168. package/dist/llms/components/visual-picker.md +362 -0
  169. package/dist/llms/components/welcome-mat.md +885 -0
  170. package/dist/llms/docs/migration-v11.md +471 -0
  171. package/dist/llms/llms-full.txt +6874 -0
  172. package/dist/llms/llms.txt +133 -0
  173. package/dist/llms/rules.md +36 -0
  174. package/dist/types/components/accordion/index.d.ts.map +1 -1
  175. package/dist/types/components/accordion/panel.d.ts +7 -7
  176. package/dist/types/components/builder-header/nav-dropdown.d.ts +1 -0
  177. package/dist/types/components/builder-header/nav-dropdown.d.ts.map +1 -1
  178. package/dist/types/components/builder-header/nav-link.d.ts +0 -1
  179. package/dist/types/components/builder-header/nav-link.d.ts.map +1 -1
  180. package/dist/types/components/builder-header/toolbar.d.ts +0 -1
  181. package/dist/types/components/builder-header/toolbar.d.ts.map +1 -1
  182. package/dist/types/components/button/index.d.ts +6 -3
  183. package/dist/types/components/button/index.d.ts.map +1 -1
  184. package/dist/types/components/button-stateful/index.d.ts +4 -1
  185. package/dist/types/components/button-stateful/index.d.ts.map +1 -1
  186. package/dist/types/components/checkbox/index.d.ts +19 -5
  187. package/dist/types/components/checkbox/index.d.ts.map +1 -1
  188. package/dist/types/components/color-picker/color-picker.d.ts +6 -4
  189. package/dist/types/components/color-picker/color-picker.d.ts.map +1 -1
  190. package/dist/types/components/color-picker/types.d.ts +2 -2
  191. package/dist/types/components/combobox/combobox.d.ts +22 -0
  192. package/dist/types/components/combobox/combobox.d.ts.map +1 -1
  193. package/dist/types/components/date-picker/date-picker.d.ts +16 -4
  194. package/dist/types/components/date-picker/date-picker.d.ts.map +1 -1
  195. package/dist/types/components/date-picker/index.d.ts +2 -6
  196. package/dist/types/components/date-picker/index.d.ts.map +1 -1
  197. package/dist/types/components/files/file.d.ts +1 -1
  198. package/dist/types/components/icon/index.d.ts +1 -0
  199. package/dist/types/components/icon/index.d.ts.map +1 -1
  200. package/dist/types/components/icon/input-icon/index.d.ts +3 -0
  201. package/dist/types/components/icon/input-icon/index.d.ts.map +1 -1
  202. package/dist/types/components/icon-settings/index.d.ts.map +1 -1
  203. package/dist/types/components/input/index.d.ts +2 -1
  204. package/dist/types/components/input/index.d.ts.map +1 -1
  205. package/dist/types/components/menu-dropdown/button-trigger.d.ts +5 -0
  206. package/dist/types/components/menu-dropdown/button-trigger.d.ts.map +1 -1
  207. package/dist/types/components/menu-dropdown/menu-dropdown.d.ts +4 -0
  208. package/dist/types/components/menu-dropdown/menu-dropdown.d.ts.map +1 -1
  209. package/dist/types/components/modal/index.d.ts +5 -5
  210. package/dist/types/components/page-header/types.d.ts +3 -0
  211. package/dist/types/components/page-header/types.d.ts.map +1 -1
  212. package/dist/types/components/panel/filtering/group.d.ts +2 -0
  213. package/dist/types/components/panel/filtering/group.d.ts.map +1 -1
  214. package/dist/types/components/pill/index.d.ts +1 -0
  215. package/dist/types/components/pill/index.d.ts.map +1 -1
  216. package/dist/types/components/popover/edit-dialog.d.ts +1 -3
  217. package/dist/types/components/popover/edit-dialog.d.ts.map +1 -1
  218. package/dist/types/components/popover/popover.d.ts +1 -0
  219. package/dist/types/components/popover/popover.d.ts.map +1 -1
  220. package/dist/types/components/progress-indicator/index.d.ts +1 -0
  221. package/dist/types/components/progress-indicator/index.d.ts.map +1 -1
  222. package/dist/types/components/progress-ring/index.d.ts +1 -0
  223. package/dist/types/components/progress-ring/index.d.ts.map +1 -1
  224. package/dist/types/components/radio/index.d.ts +2 -2
  225. package/dist/types/components/radio/index.d.ts.map +1 -1
  226. package/dist/types/components/radio-group/index.d.ts +2 -0
  227. package/dist/types/components/radio-group/index.d.ts.map +1 -1
  228. package/dist/types/components/scoped-notification/index.d.ts +1 -0
  229. package/dist/types/components/scoped-notification/index.d.ts.map +1 -1
  230. package/dist/types/components/setup-assistant/step.d.ts +0 -1
  231. package/dist/types/components/setup-assistant/step.d.ts.map +1 -1
  232. package/dist/types/components/simple-data-table/types.d.ts +1 -0
  233. package/dist/types/components/simple-data-table/types.d.ts.map +1 -1
  234. package/dist/types/components/slider/index.d.ts +4 -2
  235. package/dist/types/components/slider/index.d.ts.map +1 -1
  236. package/dist/types/components/tabs/index.d.ts +1 -0
  237. package/dist/types/components/tabs/index.d.ts.map +1 -1
  238. package/dist/types/components/tabs/panel.d.ts +2 -1
  239. package/dist/types/components/tabs/panel.d.ts.map +1 -1
  240. package/dist/types/components/textarea/index.d.ts +9 -40
  241. package/dist/types/components/textarea/index.d.ts.map +1 -1
  242. package/dist/types/components/tooltip/index.d.ts +5 -0
  243. package/dist/types/components/tooltip/index.d.ts.map +1 -1
  244. package/dist/types/components/tree/tree.d.ts +5 -0
  245. package/dist/types/components/tree/tree.d.ts.map +1 -1
  246. package/dist/types/components/utilities/menu-list/item-label.d.ts +12 -0
  247. package/dist/types/components/utilities/menu-list/item-label.d.ts.map +1 -1
  248. package/package.json +8 -5
@@ -1 +1 @@
1
- {"version":3,"file":"color-picker.js","names":[],"sources":["../../../../components/color-picker/color-picker.tsx"],"sourcesContent":["/* eslint-disable max-lines */\nimport React, {\n\tuseId,\n\tuseState,\n\tuseCallback,\n\tuseRef,\n\tuseEffect,\n\tuseMemo,\n} from 'react';\nimport classNames from 'classnames';\n\nimport checkProps from './check-props';\n\nimport CustomColor from './private/custom-color';\nimport Swatch from './private/swatch';\nimport SwatchPicker from './private/swatch-picker';\n\nimport Button from '../button';\nimport Input, { type InputChangeData } from '../input';\nimport TabsPanel from '../tabs/panel';\nimport ColorPickerTabs from './private/color-picker-tabs';\nimport Popover from '../popover';\nimport type { RadioGroupChangeHandler } from '../radio-group';\n\nimport ColorUtils from '../../utilities/color';\nimport { COLOR_PICKER } from '../../utilities/constants';\nimport { useControllableState, useLatestRef } from '../../utilities/hooks';\n\nimport {\n\tWorkingColor,\n\tColorPickerAssistiveText,\n\tColorPickerLabels,\n\tColorPickerChangeHandler,\n\tColorPickerEvents,\n\tColorPickerRequestCloseData,\n} from './types';\n\ninterface ColorPickerBaseProps {\n\t/** Assistive text for accessibility */\n\tassistiveText?: ColorPickerAssistiveText;\n\t/** CSS classes for the color-picker container */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** CSS classes for the popover menu */\n\tclassNameMenu?: string | string[] | Record<string, boolean>;\n\t/** Unique ID for the component */\n\tid?: string;\n\t/** Disables the input and button */\n\tdisabled?: boolean;\n\t/**\n\t * Error message for the outer input. When empty, the message is derived from `value`:\n\t * `labels.invalidColor` is shown while `value` fails validation (`validateColor`, or the\n\t * built-in hex/named-color check).\n\t */\n\terrorText?: string;\n\t/** Error message for the custom tab working color input */\n\terrorTextWorkingColor?: string;\n\t/** Disable flip behavior for popover alignment */\n\thasStaticAlignment?: boolean;\n\t/** Hides the text input */\n\thideInput?: boolean;\n\t/**\n\t * Initial open state of the popover when `isOpen` is not set (uncontrolled). Defaults to `false`.\n\t */\n\tdefaultIsOpen?: boolean;\n\t/**\n\t * Whether the popover is open. When set, the popover is controlled: it only opens or closes\n\t * when this prop changes, so update it from `onRequestOpen` and `onRequestClose`. When\n\t * `undefined`, the popover manages its own open state (see `defaultIsOpen`).\n\t */\n\tisOpen?: boolean;\n\t/** Text labels for internationalization */\n\tlabels?: ColorPickerLabels;\n\t/** Popover position strategy */\n\tmenuPosition?: 'absolute' | 'overflowBoundaryElement' | 'relative';\n\t/**\n\t * Current color as a hexadecimal string (or a CSS color name); `''` for no color. Required and\n\t * controlled: the summary input and swatch always render this value. Update it from\n\t * `events.onChange`, which fires when the user types in the input (`isValid` says whether the\n\t * text is a valid color) and when Done is clicked.\n\t */\n\tvalue: string;\n\t/**\n\t * Working color (the in-popover draft) as a hexadecimal string. When set, the working color\n\t * is controlled: update it from `events.onWorkingColorChange`. When `undefined`, the working\n\t * color is internal and is reset from `value` each time the popover opens.\n\t */\n\tvalueWorking?: string;\n\t/** @deprecated Use `events.onClose` instead. Still works, and warns. */\n\tonClose?: ColorPickerEvents['onClose'];\n\t/** @deprecated Use `events.onOpen` instead. Still works, and warns. */\n\tonOpen?: ColorPickerEvents['onOpen'];\n\t/** @deprecated Use `events.onRequestClose` instead. Still works, and warns. */\n\tonRequestClose?: ColorPickerEvents['onRequestClose'];\n\t/** @deprecated Use `events.onRequestOpen` instead. Still works, and warns. */\n\tonRequestOpen?: ColorPickerEvents['onRequestOpen'];\n\t/**\n\t * Replaces the built-in hex/named-color check for the summary input. Returns whether `hex`\n\t * is a valid color.\n\t */\n\tvalidateColor?: (hex: string) => boolean;\n\t/**\n\t * Replaces the built-in hex check for the custom tab's working color input. Returns whether\n\t * `hex` is a valid color.\n\t */\n\tvalidateWorkingColor?: (hex: string) => boolean;\n}\n\n/**\n * `variant` sets which tabs are present. `swatchColors` needs the swatch tab\n * and `defaultSelectedTab` only applies when both tabs are present.\n */\nexport type ColorPickerVariantProps =\n\t| {\n\t\t\t/** Both the swatch and custom tabs */\n\t\t\tvariant?: 'base';\n\t\t\t/** Array of hex color values for swatch options */\n\t\t\tswatchColors?: string[];\n\t\t\t/** Which tab is visible when dialog opens */\n\t\t\tdefaultSelectedTab?: 'swatches' | 'custom';\n\t }\n\t| {\n\t\t\t/** Only the swatch tab */\n\t\t\tvariant: 'swatches';\n\t\t\t/** Array of hex color values for swatch options */\n\t\t\tswatchColors?: string[];\n\t\t\tdefaultSelectedTab?: never;\n\t }\n\t| {\n\t\t\t/** Only the custom tab */\n\t\t\tvariant: 'custom';\n\t\t\tswatchColors?: never;\n\t\t\tdefaultSelectedTab?: never;\n\t };\n\n/**\n * `events.onChange` is required unless the color picker is `disabled`:\n * ColorPicker is controlled, so without it choosing a color does nothing.\n */\nexport type ColorPickerEventsProps =\n\t| {\n\t\t\t/** Event callbacks. `events.onChange` is required unless `disabled` is set. */\n\t\t\tevents: ColorPickerEvents & { onChange: ColorPickerChangeHandler };\n\t }\n\t| { disabled: true; events?: ColorPickerEvents };\n\nexport type ColorPickerProps = ColorPickerBaseProps &\n\tColorPickerVariantProps &\n\tColorPickerEventsProps;\n\nconst defaultLabels: ColorPickerLabels = {\n\tblueAbbreviated: 'B',\n\tcancelButton: 'Cancel',\n\tcustomTab: 'Custom',\n\tcustomTabActiveWorkingColorSwatch: 'Working Color',\n\tcustomTabTransparentSwatch: 'Transparent Swatch',\n\tgreenAbbreviated: 'G',\n\thexLabel: 'Hex',\n\tinvalidColor: 'The color entered is invalid',\n\tinvalidComponent: 'The value needs to be an integer from 0-255',\n\tredAbbreviated: 'R',\n\tsubmitButton: 'Done',\n\tswatchTab: 'Default',\n\tswatchTabTransparentSwatch: 'Transparent Swatch',\n};\n\nconst defaultAssistiveText: ColorPickerAssistiveText = {\n\tsaturationValueGrid:\n\t\t'Use arrow keys to select a saturation and brightness, on an x and y axis.',\n\thueSlider: 'Select Hue',\n};\n\nconst defaultSwatchColors = [\n\t'#e3abec',\n\t'#c2dbf7',\n\t'#9fd6ff',\n\t'#9de7da',\n\t'#9df0c0',\n\t'#fff099',\n\t'#fed49a',\n\t'#d073e0',\n\t'#86baf3',\n\t'#5ebbff',\n\t'#44d8be',\n\t'#3be282',\n\t'#ffe654',\n\t'#ffb758',\n\t'#bd35bd',\n\t'#5779c1',\n\t'#5679c0',\n\t'#00aea9',\n\t'#3cba4c',\n\t'#f5bc25',\n\t'#f99221',\n\t'#580d8c',\n\t'#001970',\n\t'#0a2399',\n\t'#0b7477',\n\t'#0b6b50',\n\t'#b67e11',\n\t'#b85d0d',\n\t'',\n];\n\ntype HexValidator = ((hex: string) => boolean) | undefined;\n\n// A module constant, so a missing `events` doesn't create a new object every render\nconst NO_EVENTS: ColorPickerEvents = {};\n\n/** Builds a working color from a color value, resolving CSS color names to hex. */\nconst getWorkingColorFromValue = (\n\tcolor: string,\n\tvalidator: HexValidator\n): WorkingColor => {\n\tconst namedColorHex = ColorUtils.getHexFromNamedColor(color);\n\treturn ColorUtils.getNewColor(\n\t\t{\n\t\t\thex: namedColorHex || color,\n\t\t\tname: namedColorHex ? color.toLowerCase() : null,\n\t\t} as { hex: string; name?: string | null },\n\t\tvalidator\n\t) as WorkingColor;\n};\n\n/** Whether `color` is valid for the summary input. */\nconst isValidColor = (color: string, validator: HexValidator): boolean => {\n\tif (validator) {\n\t\treturn !!validator(color);\n\t}\n\treturn ColorUtils.getHexFromNamedColor(color)\n\t\t? true\n\t\t: ColorUtils.isValidHex(color);\n};\n\n/**\n * The Unified Color Picker component allows for a fully accessible and\n * configurable color picker, allowing the user to pick from a set of\n * predefined colors (swatches), or to pick a custom color using a HSB\n * selection interface.\n */\nconst ColorPicker: React.FC<ColorPickerProps> = ({\n\tassistiveText: assistiveTextProp,\n\tclassName,\n\tclassNameMenu,\n\tid: idProp,\n\tdefaultIsOpen = false,\n\tdisabled = false,\n\terrorText: errorTextProp,\n\terrorTextWorkingColor,\n\tevents = NO_EVENTS,\n\thasStaticAlignment,\n\thideInput = false,\n\tisOpen: isOpenProp,\n\tlabels: labelsProp,\n\tmenuPosition = 'absolute',\n\tswatchColors = defaultSwatchColors,\n\tdefaultSelectedTab = 'swatches',\n\tvariant = 'base',\n\tvalue: valueProp,\n\tvalueWorking: valueWorkingProp,\n\tonClose,\n\tonOpen,\n\tonRequestClose,\n\tonRequestOpen,\n\tvalidateColor: validateColorProp,\n\tvalidateWorkingColor: validateWorkingColorProp,\n}) => {\n\t// Merge labels and assistive text with defaults\n\tconst labels = useMemo(\n\t\t() => ({ ...defaultLabels, ...labelsProp }),\n\t\t[labelsProp]\n\t);\n\tconst assistiveText = useMemo(\n\t\t() => ({ ...defaultAssistiveText, ...assistiveTextProp }),\n\t\t[assistiveTextProp]\n\t);\n\n\t// Generate stable ID\n\tconst generatedId = useId();\n\tconst componentId = idProp || generatedId;\n\n\t// Refs\n\tconst wrapperRef = useRef<HTMLDivElement>(null);\n\n\t// `value` is controlled data. A missing `value` (warned in `checkProps`) renders as no color.\n\tconst value = valueProp ?? '';\n\tconst validateColor = validateColorProp ?? events.onValidateColor;\n\tconst validateWorkingColor =\n\t\tvalidateWorkingColorProp ?? events.onValidateWorkingColor;\n\n\t// Handlers read the latest callbacks, so a new `events` object each render doesn't rebuild\n\t// them. The deprecated top-level callbacks are called after their `events` counterparts.\n\tconst eventsRef = useLatestRef(events);\n\tconst deprecatedEventsRef = useLatestRef({\n\t\tonClose,\n\t\tonOpen,\n\t\tonRequestClose,\n\t\tonRequestOpen,\n\t});\n\n\t// Popover open state is ephemeral UI: controlled when `isOpen` is set, internal otherwise\n\tconst [isOpen, setIsOpen] = useControllableState(isOpenProp, defaultIsOpen);\n\n\t// The in-popover working color is a draft of `value`. It is reset from `value` when the\n\t// popover opens and when `value` changes.\n\tconst [draftColor, setDraftColor] = useState<WorkingColor>(() =>\n\t\tgetWorkingColorFromValue(value, validateWorkingColor)\n\t);\n\tconst [previousWorkingColor, setPreviousWorkingColor] =\n\t\tuseState<WorkingColor>(draftColor);\n\tconst [syncedFrom, setSyncedFrom] = useState({ value, isOpen });\n\tif (syncedFrom.value !== value || syncedFrom.isOpen !== isOpen) {\n\t\t// Adjusting state while rendering, so the popover never shows a stale draft\n\t\tsetSyncedFrom({ value, isOpen });\n\t\tif (syncedFrom.value !== value || isOpen) {\n\t\t\tconst resetColor = getWorkingColorFromValue(value, validateWorkingColor);\n\t\t\tsetDraftColor(resetColor);\n\t\t\tsetPreviousWorkingColor(resetColor);\n\t\t}\n\t}\n\n\t// A controlled `valueWorking` always wins. The draft is only used for it while it describes\n\t// the same hex, so partial RGB input and hue are kept while the parent accepts each change.\n\tconst workingColor = useMemo(\n\t\t() =>\n\t\t\tvalueWorkingProp !== undefined && draftColor.hex !== valueWorkingProp\n\t\t\t\t? (ColorUtils.getNewColor(\n\t\t\t\t\t\t{ hex: valueWorkingProp },\n\t\t\t\t\t\tvalidateWorkingColor\n\t\t\t\t\t) as WorkingColor)\n\t\t\t\t: draftColor,\n\t\t[valueWorkingProp, draftColor, validateWorkingColor]\n\t);\n\n\t// Derived from `value` on every render rather than seeded once\n\tconst isValueValid = useMemo(\n\t\t() => isValidColor(value, validateColor),\n\t\t[value, validateColor]\n\t);\n\tconst colorErrorMessage =\n\t\terrorTextProp || (isValueValid ? '' : labels.invalidColor || '');\n\n\t// Check props on mount (development only)\n\tuseEffect(() => {\n\t\t// checkProps is a no-op in production\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t(checkProps as any)(\n\t\t\tCOLOR_PICKER,\n\t\t\t{\n\t\t\t\tassistiveText: assistiveTextProp,\n\t\t\t\tclassName,\n\t\t\t\tclassNameMenu,\n\t\t\t\tid: idProp,\n\t\t\t\tdisabled,\n\t\t\t\terrorText: errorTextProp,\n\t\t\t\terrorTextWorkingColor,\n\t\t\t\tevents,\n\t\t\t\thasStaticAlignment,\n\t\t\t\tonClose,\n\t\t\t\tonOpen,\n\t\t\t\tonRequestClose,\n\t\t\t\tonRequestOpen,\n\t\t\t\thideInput,\n\t\t\t\tisOpen: isOpenProp,\n\t\t\t\tlabels: labelsProp,\n\t\t\t\tmenuPosition,\n\t\t\t\tswatchColors,\n\t\t\t\tdefaultSelectedTab,\n\t\t\t\tvariant,\n\t\t\t\tvalue: valueProp,\n\t\t\t\tvalueWorking: valueWorkingProp,\n\t\t\t},\n\t\t\t{}\n\t\t);\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, []);\n\n\t// Report a new working color. The draft updates, but a controlled `valueWorking` still wins.\n\tconst setNextWorkingColor = useCallback(\n\t\t(event: React.SyntheticEvent, newColor: WorkingColor) => {\n\t\t\tsetPreviousWorkingColor(workingColor);\n\t\t\tsetDraftColor(newColor);\n\n\t\t\teventsRef.current.onWorkingColorChange?.(event, { color: newColor });\n\t\t},\n\t\t[eventsRef, workingColor]\n\t);\n\n\t// Helper to update working color\n\tconst updateWorkingColor = useCallback(\n\t\t(\n\t\t\tevent: React.SyntheticEvent,\n\t\t\tcolorOptions: {\n\t\t\t\thex?: string;\n\t\t\t\tred?: string | number;\n\t\t\t\tgreen?: string | number;\n\t\t\t\tblue?: string | number;\n\t\t\t\thue?: number | string;\n\t\t\t\tsaturation?: number;\n\t\t\t\tvalue?: number;\n\t\t\t}\n\t\t) => {\n\t\t\tsetNextWorkingColor(\n\t\t\t\tevent,\n\t\t\t\tColorUtils.getNewColor(\n\t\t\t\t\tcolorOptions,\n\t\t\t\t\tvalidateWorkingColor,\n\t\t\t\t\tworkingColor\n\t\t\t\t) as WorkingColor\n\t\t\t);\n\t\t},\n\t\t[setNextWorkingColor, validateWorkingColor, workingColor]\n\t);\n\n\t// Event handlers\n\tconst handleSwatchChange = useCallback<RadioGroupChangeHandler>(\n\t\t(event, data) => {\n\t\t\tupdateWorkingColor(event, { hex: data.value ?? '' });\n\t\t},\n\t\t[updateWorkingColor]\n\t);\n\n\t// Request a close before it happens. Uncontrolled, the popover then closes itself; controlled,\n\t// the parent decides.\n\tconst requestClose = useCallback(\n\t\t(event: React.SyntheticEvent, data: ColorPickerRequestCloseData) => {\n\t\t\teventsRef.current.onRequestClose?.(event, data);\n\t\t\tdeprecatedEventsRef.current.onRequestClose?.(event, data);\n\n\t\t\tsetIsOpen(false);\n\t\t},\n\t\t[eventsRef, deprecatedEventsRef, setIsOpen]\n\t);\n\n\tconst handleClose = useCallback(\n\t\t(\n\t\t\tevent: React.SyntheticEvent,\n\t\t\tdata: { trigger?: string; componentWillUnmount?: boolean }\n\t\t) => {\n\t\t\teventsRef.current.onClose?.(event, data);\n\t\t\tdeprecatedEventsRef.current.onClose?.(event, data);\n\t\t},\n\t\t[eventsRef, deprecatedEventsRef]\n\t);\n\n\tconst handleOpen = useCallback(\n\t\t(event: React.SyntheticEvent, data: { portal?: HTMLElement }) => {\n\t\t\teventsRef.current.onOpen?.(event, data);\n\t\t\tdeprecatedEventsRef.current.onOpen?.(event, data);\n\t\t},\n\t\t[eventsRef, deprecatedEventsRef]\n\t);\n\n\tconst handleCancel = useCallback(\n\t\t(event: React.MouseEvent) => {\n\t\t\trequestClose(event, { trigger: 'cancel' });\n\t\t},\n\t\t[requestClose]\n\t);\n\n\tconst handleColorChange = useCallback(\n\t\t(property: 'hex' | 'red' | 'green' | 'blue') =>\n\t\t\t(event: React.SyntheticEvent, data: InputChangeData) => {\n\t\t\t\tconst colorProperties: Record<string, string | number> = {};\n\t\t\t\tcolorProperties[property] = data.value;\n\t\t\t\tupdateWorkingColor(event, colorProperties);\n\t\t\t},\n\t\t[updateWorkingColor]\n\t);\n\n\tconst handleHueChange = useCallback(\n\t\t(event: React.ChangeEvent<HTMLInputElement>) => {\n\t\t\tupdateWorkingColor(event, { hue: event.target.value });\n\t\t},\n\t\t[updateWorkingColor]\n\t);\n\n\t// The summary input is controlled by `value`: report the typed text and let the parent decide\n\tconst handleHexInputChange = useCallback(\n\t\t(event: React.SyntheticEvent, data: InputChangeData) => {\n\t\t\tconst isValid = isValidColor(data.value, validateColor);\n\n\t\t\teventsRef.current.onChange?.(event, { color: data.value, isValid });\n\t\t},\n\t\t[eventsRef, validateColor]\n\t);\n\n\tconst handleNavigate = useCallback(\n\t\t(property: 'saturation' | 'value') =>\n\t\t\t(event: React.KeyboardEvent, data: { delta: number }) => {\n\t\t\t\tconst colorProperties: Record<string, number> = {};\n\t\t\t\tcolorProperties[property] = data.delta;\n\t\t\t\tsetNextWorkingColor(\n\t\t\t\t\tevent,\n\t\t\t\t\tColorUtils.getDeltaColor(\n\t\t\t\t\t\tcolorProperties,\n\t\t\t\t\t\tvalidateWorkingColor,\n\t\t\t\t\t\tworkingColor\n\t\t\t\t\t) as WorkingColor\n\t\t\t\t);\n\t\t\t},\n\t\t[setNextWorkingColor, validateWorkingColor, workingColor]\n\t);\n\n\tconst handleSaturationValueChange = useCallback(\n\t\t(\n\t\t\tevent: React.MouseEvent | React.KeyboardEvent,\n\t\t\tdata: { saturation: number; value: number }\n\t\t) => {\n\t\t\tupdateWorkingColor(event, {\n\t\t\t\tsaturation: data.saturation,\n\t\t\t\tvalue: data.value,\n\t\t\t});\n\t\t},\n\t\t[updateWorkingColor]\n\t);\n\n\tconst handleSubmitButtonClick = useCallback(\n\t\t(event: React.MouseEvent) => {\n\t\t\teventsRef.current.onChange?.(event, {\n\t\t\t\tcolor: workingColor.hex,\n\t\t\t\tisValid: true,\n\t\t\t});\n\n\t\t\trequestClose(event, { trigger: 'submit' });\n\t\t},\n\t\t[eventsRef, requestClose, workingColor.hex]\n\t);\n\n\t// While open, Popover has already requested a close (`triggerClick`) for this click\n\tconst handleSwatchButtonClick = useCallback(() => {\n\t\tif (!isOpen) {\n\t\t\teventsRef.current.onRequestOpen?.();\n\t\t\tdeprecatedEventsRef.current.onRequestOpen?.();\n\n\t\t\tsetIsOpen(true);\n\t\t}\n\t}, [eventsRef, deprecatedEventsRef, isOpen, setIsOpen]);\n\n\tconst handleSwatchSelect = useCallback(\n\t\t(event: React.MouseEvent | React.KeyboardEvent, data: { hex: string }) => {\n\t\t\tupdateWorkingColor(event, { hex: data.hex });\n\t\t},\n\t\t[updateWorkingColor]\n\t);\n\n\t// Render helpers\n\tconst renderInput = () => {\n\t\tif (hideInput) return null;\n\n\t\treturn (\n\t\t\t<Input\n\t\t\t\taria-describedby={\n\t\t\t\t\t!isOpen && colorErrorMessage\n\t\t\t\t\t\t? `color-picker-summary-error-${componentId}`\n\t\t\t\t\t\t: undefined\n\t\t\t\t}\n\t\t\t\tclassName={classNames(\n\t\t\t\t\t'slds-color-picker__summary-input',\n\t\t\t\t\t'slds-align-top',\n\t\t\t\t\t{\n\t\t\t\t\t\t'slds-has-error': !!colorErrorMessage,\n\t\t\t\t\t}\n\t\t\t\t)}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tid={`color-picker-summary-input-${componentId}`}\n\t\t\t\tonChange={handleHexInputChange}\n\t\t\t\tvalue={value}\n\t\t\t/>\n\t\t);\n\t};\n\n\tconst renderDefaultTab = () => {\n\t\tif (variant !== 'base' && variant !== 'swatches') return null;\n\n\t\treturn (\n\t\t\t<TabsPanel label={labels.swatchTab ?? ''}>\n\t\t\t\t<SwatchPicker\n\t\t\t\t\tcolor={workingColor}\n\t\t\t\t\tlabels={labels}\n\t\t\t\t\tonSelect={handleSwatchSelect}\n\t\t\t\t\tswatchColors={swatchColors}\n\t\t\t\t/>\n\t\t\t</TabsPanel>\n\t\t);\n\t};\n\n\tconst renderCustomTab = () => {\n\t\tif (variant !== 'base' && variant !== 'custom') return null;\n\n\t\treturn (\n\t\t\t<TabsPanel label={labels.customTab ?? ''}>\n\t\t\t\t<CustomColor\n\t\t\t\t\tassistiveText={assistiveText}\n\t\t\t\t\tid={componentId}\n\t\t\t\t\tcolor={workingColor}\n\t\t\t\t\terrorTextWorkingColor={errorTextWorkingColor}\n\t\t\t\t\tpreviousColor={previousWorkingColor}\n\t\t\t\t\tlabels={labels}\n\t\t\t\t\tonBlueChange={handleColorChange('blue')}\n\t\t\t\t\tonGreenChange={handleColorChange('green')}\n\t\t\t\t\tonHexChange={handleColorChange('hex')}\n\t\t\t\t\tonHueChange={handleHueChange}\n\t\t\t\t\tonRedChange={handleColorChange('red')}\n\t\t\t\t\tonSwatchChange={handleSwatchChange}\n\t\t\t\t\tonSaturationValueChange={handleSaturationValueChange}\n\t\t\t\t\tonSaturationNavigate={handleNavigate('saturation')}\n\t\t\t\t\tonValueNavigate={handleNavigate('value')}\n\t\t\t\t/>\n\t\t\t</TabsPanel>\n\t\t);\n\t};\n\n\tconst popoverBody = (\n\t\t<ColorPickerTabs\n\t\t\tid={`color-picker-tabs-${componentId}`}\n\t\t\tdefaultValue={defaultSelectedTab === 'custom' ? '1' : '0'}\n\t\t>\n\t\t\t{renderDefaultTab()}\n\t\t\t{renderCustomTab()}\n\t\t</ColorPickerTabs>\n\t);\n\n\tconst popoverFooter = (\n\t\t<div className=\"slds-color-picker__selector-footer\">\n\t\t\t<Button\n\t\t\t\tclassName=\"slds-color-picker__selector-cancel\"\n\t\t\t\tid={`color-picker-footer-cancel-${componentId}`}\n\t\t\t\tlabel={labels.cancelButton}\n\t\t\t\tonClick={handleCancel}\n\t\t\t\tvariant=\"neutral\"\n\t\t\t/>\n\t\t\t<Button\n\t\t\t\tclassName=\"slds-color-picker__selector-submit\"\n\t\t\t\tdisabled={Object.keys(workingColor.errors || {}).length > 0}\n\t\t\t\tid={`color-picker-footer-submit-${componentId}`}\n\t\t\t\tlabel={labels.submitButton}\n\t\t\t\tonClick={handleSubmitButtonClick}\n\t\t\t\tvariant=\"brand\"\n\t\t\t/>\n\t\t</div>\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames('slds-color-picker', className)}\n\t\t\tid={idProp}\n\t\t\tref={wrapperRef}\n\t\t>\n\t\t\t<div className=\"slds-color-picker__summary\">\n\t\t\t\t<label\n\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t'slds-color-picker__summary-label',\n\t\t\t\t\t\tassistiveText.label ? 'slds-assistive-text' : ''\n\t\t\t\t\t)}\n\t\t\t\t\thtmlFor={\n\t\t\t\t\t\t!hideInput ? `color-picker-summary-input-${componentId}` : undefined\n\t\t\t\t\t}\n\t\t\t\t\tid={`color-picker-label-${componentId}`}\n\t\t\t\t>\n\t\t\t\t\t{assistiveText.label ? assistiveText.label : labels.label}\n\t\t\t\t</label>\n\t\t\t\t<Popover\n\t\t\t\t\tariaLabelledby={`color-picker-label-${componentId}`}\n\t\t\t\t\talign=\"bottom left\"\n\t\t\t\t\tbody={popoverBody}\n\t\t\t\t\tclassNameDialog={classNames(\n\t\t\t\t\t\t'slds-color-picker__selector',\n\t\t\t\t\t\tclassNameMenu\n\t\t\t\t\t)}\n\t\t\t\t\tfooter={popoverFooter}\n\t\t\t\t\thasNoCloseButton\n\t\t\t\t\thasNoNubbin\n\t\t\t\t\thasStaticAlignment={hasStaticAlignment}\n\t\t\t\t\tid={`slds-color-picker__selector-${componentId}`}\n\t\t\t\t\tisOpen={isOpen}\n\t\t\t\t\tonClose={\n\t\t\t\t\t\thandleClose as unknown as (\n\t\t\t\t\t\t\tevent?: unknown,\n\t\t\t\t\t\t\tdata?: { componentWillUnmount?: boolean }\n\t\t\t\t\t\t) => void\n\t\t\t\t\t}\n\t\t\t\t\tonOpen={\n\t\t\t\t\t\thandleOpen as unknown as (\n\t\t\t\t\t\t\tevent?: unknown,\n\t\t\t\t\t\t\tdata?: { portal?: HTMLElement }\n\t\t\t\t\t\t) => void\n\t\t\t\t\t}\n\t\t\t\t\tonRequestClose={\n\t\t\t\t\t\trequestClose as unknown as\n\t\t\t\t\t\t\t| ((event?: unknown, data?: { trigger?: string }) => void)\n\t\t\t\t\t\t\t| undefined\n\t\t\t\t\t}\n\t\t\t\t\tposition={menuPosition}\n\t\t\t\t>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tclassName=\"slds-color-picker__summary-button\"\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\ticonClassName=\"slds-m-left_xx-small\"\n\t\t\t\t\t\ticonPosition=\"right\"\n\t\t\t\t\t\ticonVariant=\"more\"\n\t\t\t\t\t\tid={`slds-color-picker__summary-button-${componentId}`}\n\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t<span className=\"slds-assistive-text\">\n\t\t\t\t\t\t\t\t\t{assistiveText.label ? assistiveText.label : labels.label}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<Swatch color={value} labels={labels} />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonClick={handleSwatchButtonClick}\n\t\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\t/>\n\t\t\t\t</Popover>\n\t\t\t\t{renderInput()}\n\t\t\t\t{!isOpen && colorErrorMessage && (\n\t\t\t\t\t<p\n\t\t\t\t\t\tclassName=\"slds-form-error\"\n\t\t\t\t\t\tid={`color-picker-summary-error-${componentId}`}\n\t\t\t\t\t>\n\t\t\t\t\t\t{colorErrorMessage}\n\t\t\t\t\t</p>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nColorPicker.displayName = COLOR_PICKER;\n\nexport default ColorPicker;\n"],"mappings":";;;;;;;;;;;;;;;;;AAqJA,IAAM,KAAmC;CACxC,iBAAiB;CACjB,cAAc;CACd,WAAW;CACX,mCAAmC;CACnC,4BAA4B;CAC5B,kBAAkB;CAClB,UAAU;CACV,cAAc;CACd,kBAAkB;CAClB,gBAAgB;CAChB,cAAc;CACd,WAAW;CACX,4BAA4B;AAC7B,GAEM,KAAiD;CACtD,qBACC;CACD,WAAW;AACZ,GAEM,KAAsB,4PA8B5B,GAKM,KAA+B,CAAC,GAGhC,KACL,GACA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],"sources":["../../../../components/color-picker/color-picker.tsx"],"sourcesContent":["/* eslint-disable max-lines */\nimport React, {\n\tuseId,\n\tuseState,\n\tuseCallback,\n\tuseRef,\n\tuseEffect,\n\tuseMemo,\n} from 'react';\nimport classNames from 'classnames';\n\nimport checkProps from './check-props';\n\nimport CustomColor from './private/custom-color';\nimport Swatch from './private/swatch';\nimport SwatchPicker from './private/swatch-picker';\n\nimport Button from '../button';\nimport Input, { type InputChangeData } from '../input';\nimport TabsPanel from '../tabs/panel';\nimport ColorPickerTabs from './private/color-picker-tabs';\nimport Popover from '../popover';\nimport type { RadioGroupChangeHandler } from '../radio-group';\n\nimport ColorUtils from '../../utilities/color';\nimport { COLOR_PICKER } from '../../utilities/constants';\nimport { useControllableState, useLatestRef } from '../../utilities/hooks';\n\nimport {\n\tWorkingColor,\n\tColorPickerAssistiveText,\n\tColorPickerLabels,\n\tColorPickerChangeHandler,\n\tColorPickerEvents,\n\tColorPickerRequestCloseData,\n} from './types';\n\ninterface ColorPickerBaseProps {\n\t/** Assistive text for accessibility */\n\tassistiveText?: ColorPickerAssistiveText;\n\t/** CSS classes for the color-picker container */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** CSS classes for the popover menu */\n\tclassNameMenu?: string | string[] | Record<string, boolean>;\n\t/** Unique ID for the component */\n\tid?: string;\n\t/** Disables the input and button */\n\tdisabled?: boolean;\n\t/**\n\t * Error message for the outer input. When empty, the message is derived from `value`:\n\t * `labels.invalidColor` is shown while `value` fails validation (`validateColor`, or the\n\t * built-in hex/named-color check).\n\t */\n\terrorText?: string;\n\t/** Error message for the custom tab working color input */\n\terrorTextWorkingColor?: string;\n\t/** Disable flip behavior for popover alignment */\n\thasStaticAlignment?: boolean;\n\t/** Hides the text input */\n\thideInput?: boolean;\n\t/**\n\t * Initial open state of the popover when `isOpen` is not set (uncontrolled). Defaults to `false`.\n\t */\n\tdefaultIsOpen?: boolean;\n\t/**\n\t * Whether the popover is open. When set, the popover is controlled: it only opens or closes\n\t * when this prop changes, so update it from `onRequestOpen` and `onRequestClose`. When\n\t * `undefined`, the popover manages its own open state (see `defaultIsOpen`).\n\t */\n\tisOpen?: boolean;\n\t/** Text labels for internationalization */\n\tlabels?: ColorPickerLabels;\n\t/** Popover position strategy */\n\tmenuPosition?: 'absolute' | 'overflowBoundaryElement' | 'relative';\n\t/**\n\t * Current color as a hexadecimal string (or a CSS color name); `''` for no color. Required and\n\t * controlled: the summary input and swatch always render this value. Update it from\n\t * `events.onChange`, which fires when the user types in the input (`isValid` says whether the\n\t * text is a valid color) and when Done is clicked.\n\t */\n\tvalue: string;\n\t/**\n\t * Working color (the in-popover draft) as a hexadecimal string. When set, the working color\n\t * is controlled: update it from `events.onWorkingColorChange`. When `undefined`, the working\n\t * color is internal and is reset from `value` each time the popover opens.\n\t */\n\tvalueWorking?: string;\n\t/** @deprecated Use `events.onClose` instead. Works only in the 11.0.0 release candidates, and warns. */\n\tonClose?: ColorPickerEvents['onClose'];\n\t/** @deprecated Use `events.onOpen` instead. Works only in the 11.0.0 release candidates, and warns. */\n\tonOpen?: ColorPickerEvents['onOpen'];\n\t/** @deprecated Use `events.onRequestClose` instead. Works only in the 11.0.0 release candidates, and warns. */\n\tonRequestClose?: ColorPickerEvents['onRequestClose'];\n\t/** @deprecated Use `events.onRequestOpen` instead. Works only in the 11.0.0 release candidates, and warns. */\n\tonRequestOpen?: ColorPickerEvents['onRequestOpen'];\n\t/**\n\t * Replaces the built-in hex/named-color check for the summary input. Returns whether `hex`\n\t * is a valid color.\n\t */\n\tvalidateColor?: (hex: string) => boolean;\n\t/**\n\t * Replaces the built-in hex check for the custom tab's working color input. Returns whether\n\t * `hex` is a valid color.\n\t */\n\tvalidateWorkingColor?: (hex: string) => boolean;\n}\n\n/**\n * `variant` sets which tabs are present. `swatchColors` needs the swatch tab\n * and `defaultSelectedTab` only applies when both tabs are present.\n */\nexport type ColorPickerVariantProps =\n\t| {\n\t\t\t/** Both the swatch and custom tabs */\n\t\t\tvariant?: 'base';\n\t\t\t/** Array of hex color values for swatch options */\n\t\t\tswatchColors?: string[];\n\t\t\t/** Which tab is visible when dialog opens */\n\t\t\tdefaultSelectedTab?: 'swatches' | 'custom';\n\t }\n\t| {\n\t\t\t/** Only the swatch tab */\n\t\t\tvariant: 'swatches';\n\t\t\t/** Array of hex color values for swatch options */\n\t\t\tswatchColors?: string[];\n\t\t\tdefaultSelectedTab?: never;\n\t }\n\t| {\n\t\t\t/** Only the custom tab */\n\t\t\tvariant: 'custom';\n\t\t\tswatchColors?: never;\n\t\t\tdefaultSelectedTab?: never;\n\t };\n\n/**\n * `events.onChange` is required unless the color picker is `disabled`:\n * ColorPicker is controlled, so without it choosing a color does nothing.\n */\nexport type ColorPickerEventsProps =\n\t| {\n\t\t\t/** Event callbacks. `events.onChange` is required unless `disabled` is set. */\n\t\t\tevents: ColorPickerEvents & { onChange: ColorPickerChangeHandler };\n\t }\n\t| {\n\t\t\t/** Disables the color picker. */\n\t\t\tdisabled: true;\n\t\t\t/** Event callbacks. `events.onChange` is optional while disabled. */\n\t\t\tevents?: ColorPickerEvents;\n\t };\n\nexport type ColorPickerProps = ColorPickerBaseProps &\n\tColorPickerVariantProps &\n\tColorPickerEventsProps;\n\nconst defaultLabels: ColorPickerLabels = {\n\tblueAbbreviated: 'B',\n\tcancelButton: 'Cancel',\n\tcustomTab: 'Custom',\n\tcustomTabActiveWorkingColorSwatch: 'Working Color',\n\tcustomTabTransparentSwatch: 'Transparent Swatch',\n\tgreenAbbreviated: 'G',\n\thexLabel: 'Hex',\n\tinvalidColor: 'The color entered is invalid',\n\tinvalidComponent: 'The value needs to be an integer from 0-255',\n\tredAbbreviated: 'R',\n\tsubmitButton: 'Done',\n\tswatchTab: 'Default',\n\tswatchTabTransparentSwatch: 'Transparent Swatch',\n};\n\nconst defaultAssistiveText: ColorPickerAssistiveText = {\n\tsaturationValueGrid:\n\t\t'Use arrow keys to select a saturation and brightness, on an x and y axis.',\n\thueSlider: 'Select Hue',\n};\n\nconst defaultSwatchColors = [\n\t'#e3abec',\n\t'#c2dbf7',\n\t'#9fd6ff',\n\t'#9de7da',\n\t'#9df0c0',\n\t'#fff099',\n\t'#fed49a',\n\t'#d073e0',\n\t'#86baf3',\n\t'#5ebbff',\n\t'#44d8be',\n\t'#3be282',\n\t'#ffe654',\n\t'#ffb758',\n\t'#bd35bd',\n\t'#5779c1',\n\t'#5679c0',\n\t'#00aea9',\n\t'#3cba4c',\n\t'#f5bc25',\n\t'#f99221',\n\t'#580d8c',\n\t'#001970',\n\t'#0a2399',\n\t'#0b7477',\n\t'#0b6b50',\n\t'#b67e11',\n\t'#b85d0d',\n\t'',\n];\n\ntype HexValidator = ((hex: string) => boolean) | undefined;\n\n// A module constant, so a missing `events` doesn't create a new object every render\nconst NO_EVENTS: ColorPickerEvents = {};\n\n/** Builds a working color from a color value, resolving CSS color names to hex. */\nconst getWorkingColorFromValue = (\n\tcolor: string,\n\tvalidator: HexValidator\n): WorkingColor => {\n\tconst namedColorHex = ColorUtils.getHexFromNamedColor(color);\n\treturn ColorUtils.getNewColor(\n\t\t{\n\t\t\thex: namedColorHex || color,\n\t\t\tname: namedColorHex ? color.toLowerCase() : null,\n\t\t} as { hex: string; name?: string | null },\n\t\tvalidator\n\t) as WorkingColor;\n};\n\n/** Whether `color` is valid for the summary input. */\nconst isValidColor = (color: string, validator: HexValidator): boolean => {\n\tif (validator) {\n\t\treturn !!validator(color);\n\t}\n\treturn ColorUtils.getHexFromNamedColor(color)\n\t\t? true\n\t\t: ColorUtils.isValidHex(color);\n};\n\n/**\n * The Unified Color Picker component allows for a fully accessible and\n * configurable color picker, allowing the user to pick from a set of\n * predefined colors (swatches), or to pick a custom color using a HSB\n * selection interface.\n */\nconst ColorPicker: React.FC<ColorPickerProps> = ({\n\tassistiveText: assistiveTextProp,\n\tclassName,\n\tclassNameMenu,\n\tid: idProp,\n\tdefaultIsOpen = false,\n\tdisabled = false,\n\terrorText: errorTextProp,\n\terrorTextWorkingColor,\n\tevents = NO_EVENTS,\n\thasStaticAlignment,\n\thideInput = false,\n\tisOpen: isOpenProp,\n\tlabels: labelsProp,\n\tmenuPosition = 'absolute',\n\tswatchColors = defaultSwatchColors,\n\tdefaultSelectedTab = 'swatches',\n\tvariant = 'base',\n\tvalue: valueProp,\n\tvalueWorking: valueWorkingProp,\n\tonClose,\n\tonOpen,\n\tonRequestClose,\n\tonRequestOpen,\n\tvalidateColor: validateColorProp,\n\tvalidateWorkingColor: validateWorkingColorProp,\n}) => {\n\t// Merge labels and assistive text with defaults\n\tconst labels = useMemo(\n\t\t() => ({ ...defaultLabels, ...labelsProp }),\n\t\t[labelsProp]\n\t);\n\tconst assistiveText = useMemo(\n\t\t() => ({ ...defaultAssistiveText, ...assistiveTextProp }),\n\t\t[assistiveTextProp]\n\t);\n\n\t// Generate stable ID\n\tconst generatedId = useId();\n\tconst componentId = idProp || generatedId;\n\n\t// Refs\n\tconst wrapperRef = useRef<HTMLDivElement>(null);\n\n\t// `value` is controlled data. A missing `value` (warned in `checkProps`) renders as no color.\n\tconst value = valueProp ?? '';\n\tconst validateColor = validateColorProp ?? events.onValidateColor;\n\tconst validateWorkingColor =\n\t\tvalidateWorkingColorProp ?? events.onValidateWorkingColor;\n\n\t// Handlers read the latest callbacks, so a new `events` object each render doesn't rebuild\n\t// them. The deprecated top-level callbacks are called after their `events` counterparts.\n\tconst eventsRef = useLatestRef(events);\n\tconst deprecatedEventsRef = useLatestRef({\n\t\tonClose,\n\t\tonOpen,\n\t\tonRequestClose,\n\t\tonRequestOpen,\n\t});\n\n\t// Popover open state is ephemeral UI: controlled when `isOpen` is set, internal otherwise\n\tconst [isOpen, setIsOpen] = useControllableState(isOpenProp, defaultIsOpen);\n\n\t// The in-popover working color is a draft of `value`. It is reset from `value` when the\n\t// popover opens and when `value` changes.\n\tconst [draftColor, setDraftColor] = useState<WorkingColor>(() =>\n\t\tgetWorkingColorFromValue(value, validateWorkingColor)\n\t);\n\tconst [previousWorkingColor, setPreviousWorkingColor] =\n\t\tuseState<WorkingColor>(draftColor);\n\tconst [syncedFrom, setSyncedFrom] = useState({ value, isOpen });\n\tif (syncedFrom.value !== value || syncedFrom.isOpen !== isOpen) {\n\t\t// Adjusting state while rendering, so the popover never shows a stale draft\n\t\tsetSyncedFrom({ value, isOpen });\n\t\tif (syncedFrom.value !== value || isOpen) {\n\t\t\tconst resetColor = getWorkingColorFromValue(value, validateWorkingColor);\n\t\t\tsetDraftColor(resetColor);\n\t\t\tsetPreviousWorkingColor(resetColor);\n\t\t}\n\t}\n\n\t// A controlled `valueWorking` always wins. The draft is only used for it while it describes\n\t// the same hex, so partial RGB input and hue are kept while the parent accepts each change.\n\tconst workingColor = useMemo(\n\t\t() =>\n\t\t\tvalueWorkingProp !== undefined && draftColor.hex !== valueWorkingProp\n\t\t\t\t? (ColorUtils.getNewColor(\n\t\t\t\t\t\t{ hex: valueWorkingProp },\n\t\t\t\t\t\tvalidateWorkingColor\n\t\t\t\t\t) as WorkingColor)\n\t\t\t\t: draftColor,\n\t\t[valueWorkingProp, draftColor, validateWorkingColor]\n\t);\n\n\t// Derived from `value` on every render rather than seeded once\n\tconst isValueValid = useMemo(\n\t\t() => isValidColor(value, validateColor),\n\t\t[value, validateColor]\n\t);\n\tconst colorErrorMessage =\n\t\terrorTextProp || (isValueValid ? '' : labels.invalidColor || '');\n\n\t// Check props on mount (development only)\n\tuseEffect(() => {\n\t\t// checkProps is a no-op in production\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t(checkProps as any)(\n\t\t\tCOLOR_PICKER,\n\t\t\t{\n\t\t\t\tassistiveText: assistiveTextProp,\n\t\t\t\tclassName,\n\t\t\t\tclassNameMenu,\n\t\t\t\tid: idProp,\n\t\t\t\tdisabled,\n\t\t\t\terrorText: errorTextProp,\n\t\t\t\terrorTextWorkingColor,\n\t\t\t\tevents,\n\t\t\t\thasStaticAlignment,\n\t\t\t\tonClose,\n\t\t\t\tonOpen,\n\t\t\t\tonRequestClose,\n\t\t\t\tonRequestOpen,\n\t\t\t\thideInput,\n\t\t\t\tisOpen: isOpenProp,\n\t\t\t\tlabels: labelsProp,\n\t\t\t\tmenuPosition,\n\t\t\t\tswatchColors,\n\t\t\t\tdefaultSelectedTab,\n\t\t\t\tvariant,\n\t\t\t\tvalue: valueProp,\n\t\t\t\tvalueWorking: valueWorkingProp,\n\t\t\t},\n\t\t\t{}\n\t\t);\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, []);\n\n\t// Report a new working color. The draft updates, but a controlled `valueWorking` still wins.\n\tconst setNextWorkingColor = useCallback(\n\t\t(event: React.SyntheticEvent, newColor: WorkingColor) => {\n\t\t\tsetPreviousWorkingColor(workingColor);\n\t\t\tsetDraftColor(newColor);\n\n\t\t\teventsRef.current.onWorkingColorChange?.(event, { color: newColor });\n\t\t},\n\t\t[eventsRef, workingColor]\n\t);\n\n\t// Helper to update working color\n\tconst updateWorkingColor = useCallback(\n\t\t(\n\t\t\tevent: React.SyntheticEvent,\n\t\t\tcolorOptions: {\n\t\t\t\thex?: string;\n\t\t\t\tred?: string | number;\n\t\t\t\tgreen?: string | number;\n\t\t\t\tblue?: string | number;\n\t\t\t\thue?: number | string;\n\t\t\t\tsaturation?: number;\n\t\t\t\tvalue?: number;\n\t\t\t}\n\t\t) => {\n\t\t\tsetNextWorkingColor(\n\t\t\t\tevent,\n\t\t\t\tColorUtils.getNewColor(\n\t\t\t\t\tcolorOptions,\n\t\t\t\t\tvalidateWorkingColor,\n\t\t\t\t\tworkingColor\n\t\t\t\t) as WorkingColor\n\t\t\t);\n\t\t},\n\t\t[setNextWorkingColor, validateWorkingColor, workingColor]\n\t);\n\n\t// Event handlers\n\tconst handleSwatchChange = useCallback<RadioGroupChangeHandler>(\n\t\t(event, data) => {\n\t\t\tupdateWorkingColor(event, { hex: data.value ?? '' });\n\t\t},\n\t\t[updateWorkingColor]\n\t);\n\n\t// Request a close before it happens. Uncontrolled, the popover then closes itself; controlled,\n\t// the parent decides.\n\tconst requestClose = useCallback(\n\t\t(event: React.SyntheticEvent, data: ColorPickerRequestCloseData) => {\n\t\t\teventsRef.current.onRequestClose?.(event, data);\n\t\t\tdeprecatedEventsRef.current.onRequestClose?.(event, data);\n\n\t\t\tsetIsOpen(false);\n\t\t},\n\t\t[eventsRef, deprecatedEventsRef, setIsOpen]\n\t);\n\n\tconst handleClose = useCallback(\n\t\t(\n\t\t\tevent: React.SyntheticEvent,\n\t\t\tdata: { trigger?: string; componentWillUnmount?: boolean }\n\t\t) => {\n\t\t\teventsRef.current.onClose?.(event, data);\n\t\t\tdeprecatedEventsRef.current.onClose?.(event, data);\n\t\t},\n\t\t[eventsRef, deprecatedEventsRef]\n\t);\n\n\tconst handleOpen = useCallback(\n\t\t(event: React.SyntheticEvent, data: { portal?: HTMLElement }) => {\n\t\t\teventsRef.current.onOpen?.(event, data);\n\t\t\tdeprecatedEventsRef.current.onOpen?.(event, data);\n\t\t},\n\t\t[eventsRef, deprecatedEventsRef]\n\t);\n\n\tconst handleCancel = useCallback(\n\t\t(event: React.MouseEvent) => {\n\t\t\trequestClose(event, { trigger: 'cancel' });\n\t\t},\n\t\t[requestClose]\n\t);\n\n\tconst handleColorChange = useCallback(\n\t\t(property: 'hex' | 'red' | 'green' | 'blue') =>\n\t\t\t(event: React.SyntheticEvent, data: InputChangeData) => {\n\t\t\t\tconst colorProperties: Record<string, string | number> = {};\n\t\t\t\tcolorProperties[property] = data.value;\n\t\t\t\tupdateWorkingColor(event, colorProperties);\n\t\t\t},\n\t\t[updateWorkingColor]\n\t);\n\n\tconst handleHueChange = useCallback(\n\t\t(event: React.ChangeEvent<HTMLInputElement>) => {\n\t\t\tupdateWorkingColor(event, { hue: event.target.value });\n\t\t},\n\t\t[updateWorkingColor]\n\t);\n\n\t// The summary input is controlled by `value`: report the typed text and let the parent decide\n\tconst handleHexInputChange = useCallback(\n\t\t(event: React.SyntheticEvent, data: InputChangeData) => {\n\t\t\tconst isValid = isValidColor(data.value, validateColor);\n\n\t\t\teventsRef.current.onChange?.(event, { color: data.value, isValid });\n\t\t},\n\t\t[eventsRef, validateColor]\n\t);\n\n\tconst handleNavigate = useCallback(\n\t\t(property: 'saturation' | 'value') =>\n\t\t\t(event: React.KeyboardEvent, data: { delta: number }) => {\n\t\t\t\tconst colorProperties: Record<string, number> = {};\n\t\t\t\tcolorProperties[property] = data.delta;\n\t\t\t\tsetNextWorkingColor(\n\t\t\t\t\tevent,\n\t\t\t\t\tColorUtils.getDeltaColor(\n\t\t\t\t\t\tcolorProperties,\n\t\t\t\t\t\tvalidateWorkingColor,\n\t\t\t\t\t\tworkingColor\n\t\t\t\t\t) as WorkingColor\n\t\t\t\t);\n\t\t\t},\n\t\t[setNextWorkingColor, validateWorkingColor, workingColor]\n\t);\n\n\tconst handleSaturationValueChange = useCallback(\n\t\t(\n\t\t\tevent: React.MouseEvent | React.KeyboardEvent,\n\t\t\tdata: { saturation: number; value: number }\n\t\t) => {\n\t\t\tupdateWorkingColor(event, {\n\t\t\t\tsaturation: data.saturation,\n\t\t\t\tvalue: data.value,\n\t\t\t});\n\t\t},\n\t\t[updateWorkingColor]\n\t);\n\n\tconst handleSubmitButtonClick = useCallback(\n\t\t(event: React.MouseEvent) => {\n\t\t\teventsRef.current.onChange?.(event, {\n\t\t\t\tcolor: workingColor.hex,\n\t\t\t\tisValid: true,\n\t\t\t});\n\n\t\t\trequestClose(event, { trigger: 'submit' });\n\t\t},\n\t\t[eventsRef, requestClose, workingColor.hex]\n\t);\n\n\t// While open, Popover has already requested a close (`triggerClick`) for this click\n\tconst handleSwatchButtonClick = useCallback(() => {\n\t\tif (!isOpen) {\n\t\t\teventsRef.current.onRequestOpen?.();\n\t\t\tdeprecatedEventsRef.current.onRequestOpen?.();\n\n\t\t\tsetIsOpen(true);\n\t\t}\n\t}, [eventsRef, deprecatedEventsRef, isOpen, setIsOpen]);\n\n\tconst handleSwatchSelect = useCallback(\n\t\t(event: React.MouseEvent | React.KeyboardEvent, data: { hex: string }) => {\n\t\t\tupdateWorkingColor(event, { hex: data.hex });\n\t\t},\n\t\t[updateWorkingColor]\n\t);\n\n\t// Render helpers\n\tconst renderInput = () => {\n\t\tif (hideInput) return null;\n\n\t\treturn (\n\t\t\t<Input\n\t\t\t\taria-describedby={\n\t\t\t\t\t!isOpen && colorErrorMessage\n\t\t\t\t\t\t? `color-picker-summary-error-${componentId}`\n\t\t\t\t\t\t: undefined\n\t\t\t\t}\n\t\t\t\tclassName={classNames(\n\t\t\t\t\t'slds-color-picker__summary-input',\n\t\t\t\t\t'slds-align-top',\n\t\t\t\t\t{\n\t\t\t\t\t\t'slds-has-error': !!colorErrorMessage,\n\t\t\t\t\t}\n\t\t\t\t)}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tid={`color-picker-summary-input-${componentId}`}\n\t\t\t\tonChange={handleHexInputChange}\n\t\t\t\tvalue={value}\n\t\t\t/>\n\t\t);\n\t};\n\n\tconst renderDefaultTab = () => {\n\t\tif (variant !== 'base' && variant !== 'swatches') return null;\n\n\t\treturn (\n\t\t\t<TabsPanel label={labels.swatchTab ?? ''}>\n\t\t\t\t<SwatchPicker\n\t\t\t\t\tcolor={workingColor}\n\t\t\t\t\tlabels={labels}\n\t\t\t\t\tonSelect={handleSwatchSelect}\n\t\t\t\t\tswatchColors={swatchColors}\n\t\t\t\t/>\n\t\t\t</TabsPanel>\n\t\t);\n\t};\n\n\tconst renderCustomTab = () => {\n\t\tif (variant !== 'base' && variant !== 'custom') return null;\n\n\t\treturn (\n\t\t\t<TabsPanel label={labels.customTab ?? ''}>\n\t\t\t\t<CustomColor\n\t\t\t\t\tassistiveText={assistiveText}\n\t\t\t\t\tid={componentId}\n\t\t\t\t\tcolor={workingColor}\n\t\t\t\t\terrorTextWorkingColor={errorTextWorkingColor}\n\t\t\t\t\tpreviousColor={previousWorkingColor}\n\t\t\t\t\tlabels={labels}\n\t\t\t\t\tonBlueChange={handleColorChange('blue')}\n\t\t\t\t\tonGreenChange={handleColorChange('green')}\n\t\t\t\t\tonHexChange={handleColorChange('hex')}\n\t\t\t\t\tonHueChange={handleHueChange}\n\t\t\t\t\tonRedChange={handleColorChange('red')}\n\t\t\t\t\tonSwatchChange={handleSwatchChange}\n\t\t\t\t\tonSaturationValueChange={handleSaturationValueChange}\n\t\t\t\t\tonSaturationNavigate={handleNavigate('saturation')}\n\t\t\t\t\tonValueNavigate={handleNavigate('value')}\n\t\t\t\t/>\n\t\t\t</TabsPanel>\n\t\t);\n\t};\n\n\tconst popoverBody = (\n\t\t<ColorPickerTabs\n\t\t\tid={`color-picker-tabs-${componentId}`}\n\t\t\tdefaultValue={defaultSelectedTab === 'custom' ? '1' : '0'}\n\t\t>\n\t\t\t{renderDefaultTab()}\n\t\t\t{renderCustomTab()}\n\t\t</ColorPickerTabs>\n\t);\n\n\tconst popoverFooter = (\n\t\t<div className=\"slds-color-picker__selector-footer\">\n\t\t\t<Button\n\t\t\t\tclassName=\"slds-color-picker__selector-cancel\"\n\t\t\t\tid={`color-picker-footer-cancel-${componentId}`}\n\t\t\t\tlabel={labels.cancelButton}\n\t\t\t\tonClick={handleCancel}\n\t\t\t\tvariant=\"neutral\"\n\t\t\t/>\n\t\t\t<Button\n\t\t\t\tclassName=\"slds-color-picker__selector-submit\"\n\t\t\t\tdisabled={Object.keys(workingColor.errors || {}).length > 0}\n\t\t\t\tid={`color-picker-footer-submit-${componentId}`}\n\t\t\t\tlabel={labels.submitButton}\n\t\t\t\tonClick={handleSubmitButtonClick}\n\t\t\t\tvariant=\"brand\"\n\t\t\t/>\n\t\t</div>\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames('slds-color-picker', className)}\n\t\t\tid={idProp}\n\t\t\tref={wrapperRef}\n\t\t>\n\t\t\t<div className=\"slds-color-picker__summary\">\n\t\t\t\t<label\n\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t'slds-color-picker__summary-label',\n\t\t\t\t\t\tassistiveText.label ? 'slds-assistive-text' : ''\n\t\t\t\t\t)}\n\t\t\t\t\thtmlFor={\n\t\t\t\t\t\t!hideInput ? `color-picker-summary-input-${componentId}` : undefined\n\t\t\t\t\t}\n\t\t\t\t\tid={`color-picker-label-${componentId}`}\n\t\t\t\t>\n\t\t\t\t\t{assistiveText.label ? assistiveText.label : labels.label}\n\t\t\t\t</label>\n\t\t\t\t<Popover\n\t\t\t\t\tariaLabelledby={`color-picker-label-${componentId}`}\n\t\t\t\t\talign=\"bottom left\"\n\t\t\t\t\tbody={popoverBody}\n\t\t\t\t\tclassNameDialog={classNames(\n\t\t\t\t\t\t'slds-color-picker__selector',\n\t\t\t\t\t\tclassNameMenu\n\t\t\t\t\t)}\n\t\t\t\t\tfooter={popoverFooter}\n\t\t\t\t\thasNoCloseButton\n\t\t\t\t\thasNoNubbin\n\t\t\t\t\thasStaticAlignment={hasStaticAlignment}\n\t\t\t\t\tid={`slds-color-picker__selector-${componentId}`}\n\t\t\t\t\tisOpen={isOpen}\n\t\t\t\t\tonClose={\n\t\t\t\t\t\thandleClose as unknown as (\n\t\t\t\t\t\t\tevent?: unknown,\n\t\t\t\t\t\t\tdata?: { componentWillUnmount?: boolean }\n\t\t\t\t\t\t) => void\n\t\t\t\t\t}\n\t\t\t\t\tonOpen={\n\t\t\t\t\t\thandleOpen as unknown as (\n\t\t\t\t\t\t\tevent?: unknown,\n\t\t\t\t\t\t\tdata?: { portal?: HTMLElement }\n\t\t\t\t\t\t) => void\n\t\t\t\t\t}\n\t\t\t\t\tonRequestClose={\n\t\t\t\t\t\trequestClose as unknown as\n\t\t\t\t\t\t\t| ((event?: unknown, data?: { trigger?: string }) => void)\n\t\t\t\t\t\t\t| undefined\n\t\t\t\t\t}\n\t\t\t\t\tposition={menuPosition}\n\t\t\t\t>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tclassName=\"slds-color-picker__summary-button\"\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\ticonClassName=\"slds-m-left_xx-small\"\n\t\t\t\t\t\ticonPosition=\"right\"\n\t\t\t\t\t\ticonVariant=\"more\"\n\t\t\t\t\t\tid={`slds-color-picker__summary-button-${componentId}`}\n\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t<span className=\"slds-assistive-text\">\n\t\t\t\t\t\t\t\t\t{assistiveText.label ? assistiveText.label : labels.label}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<Swatch color={value} labels={labels} />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonClick={handleSwatchButtonClick}\n\t\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\t/>\n\t\t\t\t</Popover>\n\t\t\t\t{renderInput()}\n\t\t\t\t{!isOpen && colorErrorMessage && (\n\t\t\t\t\t<p\n\t\t\t\t\t\tclassName=\"slds-form-error\"\n\t\t\t\t\t\tid={`color-picker-summary-error-${componentId}`}\n\t\t\t\t\t>\n\t\t\t\t\t\t{colorErrorMessage}\n\t\t\t\t\t</p>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nColorPicker.displayName = COLOR_PICKER;\n\nexport default ColorPicker;\n"],"mappings":";;;;;;;;;;;;;;;;;AA0JA,IAAM,KAAmC;CACxC,iBAAiB;CACjB,cAAc;CACd,WAAW;CACX,mCAAmC;CACnC,4BAA4B;CAC5B,kBAAkB;CAClB,UAAU;CACV,cAAc;CACd,kBAAkB;CAClB,gBAAgB;CAChB,cAAc;CACd,WAAW;CACX,4BAA4B;AAC7B,GAEM,KAAiD;CACtD,qBACC;CACD,WAAW;AACZ,GAEM,KAAsB,4PA8B5B,GAKM,KAA+B,CAAC,GAGhC,KACL,GACA,MACkB;CAClB,IAAM,IAAgB,EAAW,qBAAqB,CAAK;CAC3D,OAAO,EAAW,YACjB;EACC,KAAK,KAAiB;EACtB,MAAM,IAAgB,EAAM,YAAY,IAAI;CAC7C,GACA,CACD;AACD,GAGM,KAAgB,GAAe,MAChC,IACI,CAAC,CAAC,EAAU,CAAK,IAElB,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GN,OACC,kBAAC,OAAD;EACC,WAAW,EAAW,qBAAqB,CAAS;EACpD,IAAI;EACJ,KAAK;EAEL,UAAA,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA;IACC,kBAAC,SAAD;KACC,WAAW,EACV,oCACA,EAAc,QAAQ,wBAAwB,EAC/C;KACA,SACE,IAA0D,KAAA,IAA9C,8BAA8B;KAE5C,IAAI,sBAAsB;KAEzB,UAAA,EAAc,QAAQ,EAAc,QAAQ,EAAO;IAC9C,CAAA;IACP,kBAAC,IAAD;KACC,gBAAgB,sBAAsB;KACtC,OAAM;KACN,MAAM;KACN,iBAAiB,EAChB,+BACA,CACD;KACA,QAAQ;KACR,kBAAA;KACA,aAAA;KACoB;KACpB,IAAI,+BAA+B;KAC3B;KACR,SACC;KAKD,QACC;KAKD,gBACC;KAID,UAAU;KAEV,UAAA,kBAAC,GAAD;MACC,WAAU;MACA;MACV,eAAc;MACd,cAAa;MACb,aAAY;MACZ,IAAI,qCAAqC;MACzC,OACC,kBAAC,OAAD,EAAA,UAAA,CACC,kBAAC,QAAD;OAAM,WAAU;OACd,UAAA,EAAc,QAAQ,EAAc,QAAQ,EAAO;MAC/C,CAAA,GACN,kBAAC,IAAD;OAAQ,OAAO;OAAe;MAAS,CAAA,CACnC,EAAA,CAAA;MAEN,SAAS;MACT,SAAQ;KACR,CAAA;IACO,CAAA;IACR,GAAY;IACZ,CAAC,KAAU,KACX,kBAAC,KAAD;KACC,WAAU;KACV,IAAI,8BAA8B;KAEjC,UAAA;IACC,CAAA;GAEA;;CACD,CAAA;AAEP;AAEA,EAAY,cAAc"}
@@ -97,8 +97,9 @@ var m, Ce = typeof document < "u", we = Symbol("actionItem"), Te = (e) => we in
97
97
  e === -1 ? (j(void 0), N(-1)) : e !== M && N(e);
98
98
  }
99
99
  let Dt = c(({ selection: e, option: t }) => !!xe(e, t), []), Ot = c(({ activeOptionIndex: e, offset: t, options: n }) => {
100
- let r = e + t, i = n.length > r && r >= 0 && n[r].type === "separator" ? r + t : r;
101
- return n.length > r && r >= 0 ? i : e;
100
+ let r = e + t;
101
+ for (; r >= 0 && r < n.length && n[r].type === "separator";) r += t;
102
+ return r >= 0 && r < n.length ? r : e;
102
103
  }, []), U = c((e, { trigger: t } = {}) => {
103
104
  if (bt.current) {
104
105
  if (yt || (bt.current = !1), xt.current = e, C === "popover" && t === "cancel") {
@@ -141,6 +142,7 @@ var m, Ce = typeof document < "u", we = Symbol("actionItem"), Te = (e) => we in
141
142
  C,
142
143
  W
143
144
  ]), At = c((e, { selection: t, option: n }) => {
145
+ if (n.type === "separator") return;
144
146
  if (Te(n)) {
145
147
  let t = n[we], r = e;
146
148
  t.onClick?.(r, { option: t }), E.current.onSelectActionItem?.(r, {
@@ -1 +1 @@
1
- {"version":3,"file":"combobox.js","names":[],"sources":["../../../../components/combobox/combobox.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, {\n\tuseId,\n\tuseState,\n\tuseRef,\n\tuseCallback,\n\tuseMemo,\n\tuseEffect,\n\tuseContext,\n\ttype ReactNode,\n\ttype ReactElement,\n} from 'react';\n\nimport assign from 'lodash.assign';\nimport find from 'lodash.find';\nimport reject from 'lodash.reject';\nimport { dequal as isEqual } from 'dequal';\nimport findIndex from 'lodash.findindex';\n\nimport classNames from 'classnames';\n\nimport Button from '../button';\nimport Dialog from '../utilities/dialog';\nimport InnerInput from '../input/private/inner-input';\nimport InputIcon from '../icon/input-icon';\nimport Menu, { getOptionLabel } from './private/menu';\nimport type {\n\tComboboxOption,\n\tComboboxItemOption,\n\tComboboxActionOption,\n\tComboboxDeselectOption,\n\tComboboxMenuRenderMenuItemData,\n\tComboboxOptionIcon,\n} from './types';\nimport Label from '../forms/private/label';\nimport Popover, { type PopoverProps } from '../popover';\nimport type { InputProps } from '../input';\nimport type { TooltipProps } from '../tooltip';\nimport SelectedListBox from '../pill-container/private/selected-listbox';\n\nimport FieldLevelHelpTooltip from '../tooltip/private/field-level-help-tooltip';\nimport KEYS from '../../utilities/key-code';\nimport KeyBuffer from '../../utilities/key-buffer';\nimport keyLetterMenuItemSelect from '../../utilities/key-letter-menu-item-select';\nimport mapKeyEventCallbacks from '../../utilities/key-callbacks';\nimport menuItemSelectScroll from '../../utilities/menu-item-select-scroll';\n\nimport checkProps from './check-props';\n\nimport { COMBOBOX } from '../../utilities/constants';\nimport type { SelectedListBoxOption } from '../pill-container/private/selected-listbox';\nimport componentDoc from './component.json';\nimport { IconSettingsContext } from '../icon-settings';\nimport { useControllableState, useLatestRef } from '../../utilities/hooks';\n\nlet currentOpenDropdown: { handleClose: () => void } | undefined;\nconst documentDefined = typeof document !== 'undefined';\n\n// ===== Types =====\n\nexport interface ComboboxAssistiveText {\n\tlabel?: string;\n\tloadingMenuItems?: string;\n\toptionSelectedInMenu?: string;\n\tpopoverLabel?: string;\n\tremoveSingleSelectedOption?: string;\n\tremovePill?: string;\n\tselectedListboxLabel?: string;\n}\n\nexport interface ComboboxLabels {\n\tdeselectOption?: string;\n\tlabel?: ReactNode | string;\n\tcancelButton?: string;\n\tdoneButton?: string;\n\tmultipleOptionsSelected?: string;\n\tnoOptionsFound?: ReactNode | string;\n\tplaceholder?: string;\n\tplaceholderReadOnly?: string;\n\tremovePillTitle?: string;\n\toptionDisabledTooltipLabel?: string;\n\tinputIconTitle?: string;\n}\n\nexport interface ComboboxEvents {\n\tonBlur?: (event: React.FocusEvent) => void;\n\tonChange?: (\n\t\tevent: React.ChangeEvent<HTMLInputElement>,\n\t\tdata: { value: string }\n\t) => void;\n\t/**\n\t * Fires after the menu has closed (uncontrolled), or when a controlled\n\t * `isOpen` changes to `false`. `event` is the event of the close request,\n\t * when there was one.\n\t */\n\tonClose?: (\n\t\tevent: React.SyntheticEvent | undefined,\n\t\tdata: Record<string, unknown>\n\t) => void;\n\tonFocus?: (event: React.FocusEvent, data: Record<string, unknown>) => void;\n\t/** Fires after the menu has opened and rendered, controlled or not. */\n\tonOpen?: (\n\t\tevent: React.SyntheticEvent | undefined,\n\t\tdata: Record<string, unknown>\n\t) => void;\n\t/**\n\t * Fires when the user asks to close the menu (Escape, blur, selecting an\n\t * option, the popover buttons). With a controlled `isOpen`, set it to\n\t * `false` to close.\n\t */\n\tonRequestClose?: (\n\t\tevent: React.SyntheticEvent,\n\t\tdata: Record<string, unknown>\n\t) => void;\n\t/**\n\t * Fires when the user asks to open the menu (typing, clicking the input,\n\t * Down, Enter) while it is closed. With a controlled `isOpen`, set it to\n\t * `true` to open.\n\t */\n\tonRequestOpen?: (\n\t\tevent: React.SyntheticEvent | undefined,\n\t\tdata: Record<string, unknown>\n\t) => void;\n\tonRequestRemoveSelectedOption?: (\n\t\tevent: React.SyntheticEvent,\n\t\tdata: { selection: ComboboxOption[] }\n\t) => void;\n\t/**\n\t * Fires with the requested selection when an option is chosen. `selection`\n\t * is controlled, so update it to accept the change.\n\t */\n\tonSelect?: (\n\t\tevent: React.SyntheticEvent,\n\t\tdata: { selection: ComboboxOption[] }\n\t) => void;\n\t/** Fires when an `optionsSearchEntity` or `optionsAddItem` row is chosen by\n\t * click or Enter. `value` is the current input text. */\n\tonSelectActionItem?: (\n\t\tevent: React.MouseEvent | React.KeyboardEvent,\n\t\tdata: { option: ComboboxActionItem; value: string }\n\t) => void;\n\tonSubmit?: (event: React.KeyboardEvent, data: { value: string }) => void;\n}\n\n/**\n * An action row in the menu: `optionsSearchEntity` items render above the\n * options, `optionsAddItem` items below them. Choosing one (click or Enter)\n * calls `events.onSelectActionItem` and closes the menu. Action rows are\n * commands, not records, so they never fire `onSelect` or enter the selection.\n */\nexport interface ComboboxActionItem {\n\tid?: string;\n\ticon?: ComboboxOptionIcon;\n\tlabel?: string | ((searchTerm: string) => ReactNode);\n\tdisabled?: boolean;\n\t/** @deprecated Use `events.onSelectActionItem`. If both are set, both are\n\t * called, this one first. */\n\tonClick?: (\n\t\tevent: React.MouseEvent | React.KeyboardEvent,\n\t\tdata: { option: ComboboxActionItem }\n\t) => void;\n}\n\n// A menu row built from a `ComboboxActionItem`. The original item is stored\n// under a module-private symbol, so consumer data in `options` (which may come\n// from untyped JS and carry arbitrary keys) can't impersonate one.\nconst ACTION_ITEM = Symbol('actionItem');\n\ntype ActionItemRow = ComboboxActionOption & {\n\t[ACTION_ITEM]: ComboboxActionItem;\n};\n\nconst isActionItemRow = (option: ComboboxOption): option is ActionItemRow =>\n\tACTION_ITEM in option;\n\nconst toActionItemRow = (\n\titem: ComboboxActionItem,\n\ttype: ActionItemRow['type']\n): ActionItemRow => ({\n\tid: item.id || '',\n\ticon: item.icon,\n\tlabel: item.label,\n\tdisabled: item.disabled,\n\ttype,\n\t[ACTION_ITEM]: item,\n});\n\n/**\n * Argument passed to `renderMenuItem`\n */\nexport interface ComboboxRenderMenuItemData extends ComboboxMenuRenderMenuItemData {\n\t/** The combobox's assistive text */\n\tassistiveText: ComboboxAssistiveText;\n}\n\n/**\n * Component accepted by the deprecated `onRenderMenuItem` and `menuItem` props\n */\ntype ComboboxLegacyMenuItem = React.ComponentType<{\n\tassistiveText?: ComboboxAssistiveText;\n\tselected: boolean;\n\t/** Custom renderers only receive selectable rows */\n\toption: ComboboxItemOption | ComboboxDeselectOption;\n}>;\n\ninterface ComboboxBaseProps {\n\t/** aria-describedby attribute */\n\t'aria-describedby'?: string;\n\t/** CSS classes for combobox container */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** CSS classes for top level container */\n\tclassNameContainer?: string | string[] | Record<string, boolean>;\n\t/** CSS classes for dropdown menu */\n\tclassNameMenu?: string | string[] | Record<string, boolean>;\n\t/** CSS classes for menu sub header */\n\tclassNameMenuSubHeader?: string | string[] | Record<string, boolean>;\n\t/**\n\t * Initial open state when `isOpen` is not set. Ignored when `isOpen` is\n\t * set.\n\t */\n\tdefaultIsOpen?: boolean;\n\t/** Disables the input and keeps the menu closed. Applies to every variant. */\n\tdisabled?: boolean;\n\t/** Entity combobox for grouped comboboxes */\n\tentityCombobox?: ReactNode;\n\t/** Error text to display */\n\terrorText?: string;\n\t/** Event callbacks */\n\tevents?: ComboboxEvents;\n\t/** Field level help tooltip */\n\tfieldLevelHelpTooltip?: ReactNode;\n\t/** Whether to show deselect option */\n\thasDeselect?: boolean;\n\t/** Whether to show input spinner */\n\thasInputSpinner?: boolean;\n\t/** Whether to show menu spinner */\n\thasMenuSpinner?: boolean;\n\t/** Whether to use static alignment */\n\thasStaticAlignment?: boolean;\n\t/** HTML id */\n\tid?: string;\n\t/** Sets dialog width inheritance */\n\tinheritWidthOf?: 'target' | 'menu' | 'none';\n\t/**\n\t * An `Input` element whose props are passed to the combobox's input. They win over the\n\t * combobox's own, except `onChange`, which is called with `(event, { value })` alongside\n\t * the combobox's handler.\n\t */\n\tinput?: ReactElement<Partial<InputProps>>;\n\t/** Callback to get input ref */\n\tinputRef?: (ref: HTMLInputElement | null) => void;\n\t/**\n\t * Whether the menu is open. Leave unset to let the combobox open and close\n\t * itself (start state from `defaultIsOpen`). When set, the combobox only\n\t * reports open and close requests through `events.onRequestOpen` and\n\t * `events.onRequestClose`; update `isOpen` to act on them.\n\t */\n\tisOpen?: boolean;\n\t/** Text labels */\n\tlabels?: ComboboxLabels;\n\t/** Menu item visible length */\n\tmenuItemVisibleLength?: 5 | 7 | 10;\n\t/** Menu max width */\n\tmenuMaxWidth?: string;\n\t/** Menu position */\n\tmenuPosition?: 'absolute' | 'overflowBoundaryElement' | 'relative';\n\t/** Whether multiple selection is allowed */\n\tmultiple?: boolean;\n\t/**\n\t * @deprecated Use `renderMenuItem`, which is called as a function with\n\t * `{ assistiveText, isSelected, option }`.\n\t */\n\tonRenderMenuItem?: ComboboxLegacyMenuItem;\n\t/** Action items shown below the options, such as \"New Account\" */\n\toptionsAddItem?: ComboboxActionItem[];\n\t/** Action items shown above the options, such as \"Search in Accounts\" */\n\toptionsSearchEntity?: ComboboxActionItem[];\n\t/** Whether only predefined options are allowed */\n\tpredefinedOptionsOnly?: boolean;\n\t/** Whether field is required */\n\trequired?: boolean;\n\t/**\n\t * Selected options. Controlled: `events.onSelect` and\n\t * `events.onRequestRemoveSelectedOption` report the requested selection;\n\t * update `selection` to accept it.\n\t */\n\tselection: ComboboxOption[];\n\t/** Callback to get selected listbox ref */\n\tselectedListboxRef?: (ref: HTMLUListElement | null) => void;\n\t/** @deprecated Use `disabled`, which now disables the input in every variant. */\n\tsingleInputDisabled?: boolean;\n\t/**\n\t * A `Tooltip` element shown on disabled menu items. Its props win over the combobox's\n\t * defaults; an option's `tooltipContent` wins over its `content`.\n\t */\n\ttooltipMenuItemDisabled?: ReactElement<Partial<TooltipProps>>;\n\t/**\n\t * Text in the input. Controlled: update it from `events.onChange`.\n\t * (`defaultValue` was removed in v11.)\n\t */\n\tvalue?: string;\n\t/**\n\t * Renders each option's content in place of the default label and icon.\n\t * Receives `{ assistiveText, isSelected, option }`.\n\t */\n\trenderMenuItem?: (data: ComboboxRenderMenuItemData) => ReactNode;\n\t/** @deprecated Use `renderMenuItem` instead. */\n\tmenuItem?: ComboboxLegacyMenuItem;\n}\n\n/**\n * `variant` decides where the menu content comes from: `options` for the\n * listbox variants, or a custom `popover` dialog.\n */\nexport type ComboboxVariantProps =\n\t| {\n\t\t\t/**\n\t\t\t * Listbox variants. Defaults to `base`. `inline-listbox` with\n\t\t\t * `multiple` is deprecated (SLDS deprecated the inline listbox):\n\t\t\t * use `base` with `multiple`, which lists the selections after the input.\n\t\t\t */\n\t\t\tvariant?: 'base' | 'inline-listbox' | 'readonly';\n\t\t\t/** Assistive text for accessibility */\n\t\t\tassistiveText?: ComboboxAssistiveText;\n\t\t\t/** Menu options */\n\t\t\toptions: ComboboxOption[];\n\t\t\tpopover?: never;\n\t }\n\t| {\n\t\t\t/** Custom dialog content instead of a listbox */\n\t\t\tvariant: 'popover';\n\t\t\t/** Assistive text for accessibility. `popoverLabel` labels the dialog. */\n\t\t\tassistiveText: ComboboxAssistiveText & { popoverLabel: string };\n\t\t\toptions?: never;\n\t\t\t/**\n\t\t\t * A `Popover` element rendered as the dialog. Its props win over the combobox's\n\t\t\t * defaults, except `body`, which the combobox wraps, and `children`, which the\n\t\t\t * combobox replaces with its input.\n\t\t\t */\n\t\t\tpopover: ReactElement<Partial<PopoverProps>>;\n\t };\n\nexport type ComboboxProps = ComboboxBaseProps & ComboboxVariantProps;\n\n// ===== Default Props =====\n\nconst defaultAssistiveText: Required<ComboboxAssistiveText> = {\n\tlabel: '',\n\tloadingMenuItems: 'Loading',\n\toptionSelectedInMenu: 'Current Selection:',\n\tpopoverLabel: '',\n\tremoveSingleSelectedOption: 'Remove selected option',\n\tremovePill: ', Press delete or backspace to remove',\n\tselectedListboxLabel: 'Selected Options:',\n};\n\nconst defaultLabels: Required<ComboboxLabels> = {\n\tdeselectOption: 'None',\n\tlabel: '',\n\tcancelButton: 'Cancel',\n\tdoneButton: 'Done',\n\tmultipleOptionsSelected: '',\n\tnoOptionsFound: 'No matches found.',\n\tplaceholder: '',\n\tplaceholderReadOnly: 'Select an Option',\n\tremovePillTitle: 'Remove',\n\toptionDisabledTooltipLabel: 'This option is disabled.',\n\tinputIconTitle: '',\n};\n\n// ===== Component =====\n\nconst Combobox: React.FC<ComboboxProps> = (props) => {\n\tconst {\n\t\tassistiveText: assistiveTextProp = {},\n\t\t'aria-describedby': ariaDescribedby,\n\t\tclassName,\n\t\tclassNameContainer,\n\t\tclassNameMenu,\n\t\tclassNameMenuSubHeader,\n\t\tdefaultIsOpen,\n\t\tdisabled,\n\t\tentityCombobox,\n\t\terrorText,\n\t\tevents: eventsProp,\n\t\tfieldLevelHelpTooltip,\n\t\thasDeselect,\n\t\thasInputSpinner,\n\t\thasMenuSpinner,\n\t\thasStaticAlignment,\n\t\tid: idProp,\n\t\tinheritWidthOf = 'target',\n\t\tinput,\n\t\tinputRef: inputRefCallback,\n\t\tisOpen: isOpenProp,\n\t\tlabels: labelsProp = {},\n\t\tmenuItemVisibleLength,\n\t\tmenuMaxWidth,\n\t\tmenuPosition = 'absolute',\n\t\tmultiple,\n\t\tonRenderMenuItem,\n\t\toptions = [],\n\t\toptionsAddItem = [],\n\t\toptionsSearchEntity = [],\n\t\tpopover,\n\t\tpredefinedOptionsOnly,\n\t\trequired = false,\n\t\tselection = [],\n\t\tselectedListboxRef: selectedListboxRefCallback,\n\t\tsingleInputDisabled = false,\n\t\ttooltipMenuItemDisabled,\n\t\tvalue,\n\t\tvariant = 'base',\n\t\trenderMenuItem: renderMenuItemProp,\n\t\tmenuItem,\n\t} = props;\n\n\t// Merge with defaults\n\tconst assistiveText = assign({}, defaultAssistiveText, assistiveTextProp);\n\tconst labels = assign({}, defaultLabels, labelsProp);\n\t// Handlers read the latest `events`, so a new `events` object each render doesn't rebuild them\n\tconst eventsRef = useLatestRef<ComboboxEvents>(eventsProp ?? {});\n\n\t// Context\n\tconst iconSettingsContext = useContext(IconSettingsContext);\n\n\t// Refs\n\tconst inputRef = useRef<HTMLInputElement | null>(null);\n\tconst menuRef = useRef<HTMLUListElement | null>(null);\n\tconst selectedListboxRef = useRef<HTMLUListElement | null>(null);\n\tconst activeSelectedOptionRef = useRef<HTMLElement | null>(null);\n\tconst buttonRef = useRef<HTMLButtonElement | null>(null);\n\tconst menuKeyBuffer = useRef(new KeyBuffer());\n\n\t// Generated IDs\n\tconst generatedId = useId();\n\tconst generatedErrorId = useId();\n\tconst getId = useCallback(() => idProp || generatedId, [idProp, generatedId]);\n\tconst deselectId = `${getId()}-deselect`;\n\n\t// State\n\tconst [activeOption, setActiveOption] = useState<ComboboxOption | undefined>(\n\t\tundefined\n\t);\n\tconst [activeOptionIndex, setActiveOptionIndex] = useState(-1);\n\tconst [activeSelectedOptionIndex, setActiveSelectedOptionIndex] = useState(0);\n\t// Keep the active pill, and so its roving tabindex, inside `selection`. When\n\t// a controlled parent shrinks `selection` through any path other than the\n\t// built-in remove handler, an index past the end would leave no pill with\n\t// tabindex=0 and the selected-pill listbox unreachable by keyboard (WCAG\n\t// 2.1.1 / 2.4.3). An emptied selection starts again from the first pill.\n\tconst maxSelectedOptionIndex = Math.max(selection.length - 1, 0);\n\tif (activeSelectedOptionIndex > maxSelectedOptionIndex) {\n\t\tsetActiveSelectedOptionIndex(maxSelectedOptionIndex);\n\t}\n\tconst activeSelectedOption = selection[activeSelectedOptionIndex];\n\tconst [listboxHasFocus, setListboxHasFocus] = useState(false);\n\t// `isOpen` is ephemeral UI state: controlled when the prop is set,\n\t// otherwise internal and seeded by `defaultIsOpen`.\n\tconst [isOpen, setIsOpen, isOpenControlled] = useControllableState(\n\t\tisOpenProp,\n\t\tdefaultIsOpen ?? false\n\t);\n\t// Latest `isOpen` for close requests made from timers and for swallowing a\n\t// duplicate request within one event.\n\tconst isOpenRef = useRef(isOpen);\n\tuseEffect(() => {\n\t\tisOpenRef.current = isOpen;\n\t}, [isOpen]);\n\t// Event of the latest close request, reported by `events.onClose`.\n\tconst closeEventRef = useRef<React.SyntheticEvent | undefined>(undefined);\n\t// Reset the highlighted option whenever the menu closes, however it closed.\n\tconst [prevIsOpen, setPrevIsOpen] = useState(isOpen);\n\tif (prevIsOpen !== isOpen) {\n\t\tsetPrevIsOpen(isOpen);\n\t\tif (!isOpen) {\n\t\t\tsetActiveOption(undefined);\n\t\t\tsetActiveOptionIndex(-1);\n\t\t}\n\t}\n\tconst [inputRendered, setInputRendered] = useState(false);\n\n\t// Check props on mount\n\tuseEffect(() => {\n\t\tcheckProps(\n\t\t\tCOMBOBOX,\n\t\t\tprops as unknown as Record<string, unknown>,\n\t\t\tcomponentDoc\n\t\t);\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, []);\n\n\t// Derived state\n\t// `singleInputDisabled` is the deprecated name for `disabled`.\n\tconst isInputDisabled = !!(disabled || singleInputDisabled);\n\tconst getIsOpen = useCallback(() => !!isOpen, [isOpen]);\n\n\tconst getIsActiveOption = useCallback(() => {\n\t\treturn activeOption && activeOptionIndex !== -1;\n\t}, [activeOption, activeOptionIndex]);\n\n\tconst getErrorId = useCallback(() => {\n\t\treturn ariaDescribedby || (errorText && generatedErrorId);\n\t}, [ariaDescribedby, errorText, generatedErrorId]);\n\n\t// Build options list\n\tconst getOptions = useCallback(() => {\n\t\tconst deselectOption: ComboboxOption = {\n\t\t\tid: deselectId,\n\t\t\tlabel: labels.deselectOption,\n\t\t\tvalue: '',\n\t\t\ttype: 'deselect',\n\t\t};\n\n\t\tconst localOptionsSearchEntity = optionsSearchEntity.map((item) =>\n\t\t\ttoActionItemRow(item, 'header')\n\t\t);\n\n\t\tconst localOptionsAddItem = optionsAddItem.map((item) =>\n\t\t\ttoActionItemRow(item, 'footer')\n\t\t);\n\n\t\treturn [\n\t\t\t...(localOptionsSearchEntity.length > 0 ? localOptionsSearchEntity : []),\n\t\t\t...(hasDeselect ? [deselectOption] : []),\n\t\t\t...(options && options.length > 0 ? options : []),\n\t\t\t...(localOptionsAddItem.length > 0 ? localOptionsAddItem : []),\n\t\t];\n\t}, [\n\t\tdeselectId,\n\t\tlabels.deselectOption,\n\t\toptionsSearchEntity,\n\t\toptionsAddItem,\n\t\thasDeselect,\n\t\toptions,\n\t]);\n\n\t// When the options change, keep the highlight on the same option, or clear\n\t// it if that option is gone. Only sets state when the index is out of date,\n\t// so it settles after one extra render.\n\tif (activeOption) {\n\t\tconst index = findIndex(getOptions(), (item) =>\n\t\t\tisEqual(item, activeOption)\n\t\t);\n\t\tif (index === -1) {\n\t\t\tsetActiveOption(undefined);\n\t\t\tsetActiveOptionIndex(-1);\n\t\t} else if (index !== activeOptionIndex) {\n\t\t\tsetActiveOptionIndex(index);\n\t\t}\n\t}\n\n\tconst isSelected = useCallback(\n\t\t({\n\t\t\tselection: sel,\n\t\t\toption,\n\t\t}: {\n\t\t\tselection: ComboboxOption[];\n\t\t\toption: ComboboxOption;\n\t\t}) => {\n\t\t\treturn !!find(sel, option);\n\t\t},\n\t\t[]\n\t);\n\n\t// Get new active option index (for navigation)\n\tconst getNewActiveOptionIndex = useCallback(\n\t\t({\n\t\t\tactiveOptionIndex: currentIndex,\n\t\t\toffset,\n\t\t\toptions: opts,\n\t\t}: {\n\t\t\tactiveOptionIndex: number;\n\t\t\toffset: number;\n\t\t\toptions: ComboboxOption[];\n\t\t}) => {\n\t\t\tconst nextIndex = currentIndex + offset;\n\t\t\tconst skipIndex =\n\t\t\t\topts.length > nextIndex &&\n\t\t\t\tnextIndex >= 0 &&\n\t\t\t\topts[nextIndex].type === 'separator';\n\t\t\tconst newIndex = skipIndex ? nextIndex + offset : nextIndex;\n\t\t\tconst hasNewIndex = opts.length > nextIndex && nextIndex >= 0;\n\t\t\treturn hasNewIndex ? newIndex : currentIndex;\n\t\t},\n\t\t[]\n\t);\n\n\t// ===== Event Handlers =====\n\n\t// Every internal close path (Escape, blur, selecting an option, the popover\n\t// buttons, a click outside) goes through `requestClose`. It reports the\n\t// request through `events.onRequestClose` and closes only when `isOpen` is\n\t// uncontrolled; a controlled `isOpen` closes when the parent updates it.\n\tconst requestClose = useCallback(\n\t\t(event?: React.SyntheticEvent, { trigger }: { trigger?: string } = {}) => {\n\t\t\tif (isOpenRef.current) {\n\t\t\t\tif (!isOpenControlled) {\n\t\t\t\t\t// Swallow a second request in the same event (for example\n\t\t\t\t\t// Escape handled by both the input and the popover).\n\t\t\t\t\tisOpenRef.current = false;\n\t\t\t\t}\n\t\t\t\tcloseEventRef.current = event;\n\n\t\t\t\tif (variant === 'popover' && trigger === 'cancel') {\n\t\t\t\t\tconst popoverProps = popover?.props as\n\t\t\t\t\t\t| { onClose?: (event: unknown, data: { trigger: string }) => void }\n\t\t\t\t\t\t| undefined;\n\t\t\t\t\tif (popoverProps?.onClose) {\n\t\t\t\t\t\tpopoverProps.onClose(event, { trigger });\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (eventsRef.current.onRequestClose) {\n\t\t\t\t\teventsRef.current.onRequestClose(event as React.SyntheticEvent, {});\n\t\t\t\t}\n\n\t\t\t\tsetIsOpen(false);\n\t\t\t}\n\t\t},\n\t\t[isOpenControlled, variant, popover, eventsRef, setIsOpen]\n\t);\n\n\t// Called by the menu `Dialog` (or `Popover`) once it has rendered, so\n\t// `events.onOpen` fires on a real open whether `isOpen` is controlled or not.\n\tconst handleOpen = useCallback(\n\t\t(event?: React.SyntheticEvent, data?: Record<string, unknown>) => {\n\t\t\tcurrentOpenDropdown = { handleClose: requestClose };\n\n\t\t\tif (eventsRef.current.onOpen) {\n\t\t\t\teventsRef.current.onOpen(event, data || {});\n\t\t\t}\n\n\t\t\tif (variant === 'readonly') {\n\t\t\t\tconst opts = getOptions();\n\t\t\t\tconst idx = findIndex(opts, (item) => isEqual(item, selection[0]));\n\n\t\t\t\tsetActiveOptionIndex(idx);\n\t\t\t\tsetActiveOption(selection[0]);\n\n\t\t\t\tif (menuRef.current !== null) {\n\t\t\t\t\tmenuItemSelectScroll({\n\t\t\t\t\t\tcontainer: menuRef.current,\n\t\t\t\t\t\tfocusedIndex: idx,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[requestClose, eventsRef, variant, getOptions, selection]\n\t);\n\n\t// Every internal open path (typing, clicking the input, Down, Enter) goes\n\t// through `requestOpen`. It reports the request through\n\t// `events.onRequestOpen` and opens only when `isOpen` is uncontrolled.\n\tconst requestOpen = useCallback(\n\t\t(event?: React.SyntheticEvent) => {\n\t\t\tif (!isOpen) {\n\t\t\t\tif (eventsRef.current.onRequestOpen) {\n\t\t\t\t\teventsRef.current.onRequestOpen(event, {});\n\t\t\t\t}\n\t\t\t\tsetIsOpen(true);\n\t\t\t}\n\t\t},\n\t\t[isOpen, eventsRef, setIsOpen]\n\t);\n\n\tconst requestOpenMenu = useCallback(\n\t\t(event?: React.SyntheticEvent) => {\n\t\t\tconst isInlineSingleSelectionAndIsNotSelected =\n\t\t\t\t!multiple && selection.length === 0 && variant === 'inline-listbox';\n\n\t\t\tif (\n\t\t\t\tisInlineSingleSelectionAndIsNotSelected ||\n\t\t\t\tmultiple ||\n\t\t\t\tvariant === 'readonly'\n\t\t\t) {\n\t\t\t\trequestOpen(event);\n\t\t\t}\n\t\t},\n\t\t[multiple, selection.length, variant, requestOpen]\n\t);\n\n\tconst handleSelect = useCallback(\n\t\t(\n\t\t\tevent: React.SyntheticEvent,\n\t\t\t{\n\t\t\t\tselection: sel,\n\t\t\t\toption,\n\t\t\t}: { selection: ComboboxOption[]; option: ComboboxOption }\n\t\t) => {\n\t\t\tif (isActionItemRow(option)) {\n\t\t\t\tconst actionItem = option[ACTION_ITEM];\n\t\t\t\tconst actionEvent = event as React.MouseEvent | React.KeyboardEvent;\n\t\t\t\tactionItem.onClick?.(actionEvent, { option: actionItem });\n\t\t\t\teventsRef.current.onSelectActionItem?.(actionEvent, {\n\t\t\t\t\toption: actionItem,\n\t\t\t\t\tvalue: value ?? '',\n\t\t\t\t});\n\t\t\t\trequestClose(event);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet newSelection: ComboboxOption[];\n\t\t\tconst selected = isSelected({ selection: sel, option });\n\t\t\tconst singleSelectAndSelectedWasNotClicked = !multiple && !selected;\n\t\t\tconst multiSelectAndSelectedWasNotClicked = multiple && !selected;\n\t\t\tconst deselectWasClicked = option.id === deselectId;\n\n\t\t\tif (deselectWasClicked) {\n\t\t\t\tnewSelection = [];\n\t\t\t} else if (singleSelectAndSelectedWasNotClicked) {\n\t\t\t\tnewSelection = [option];\n\t\t\t} else if (multiSelectAndSelectedWasNotClicked) {\n\t\t\t\tnewSelection = [...selection, option];\n\t\t\t} else {\n\t\t\t\tnewSelection = reject(selection, option);\n\t\t\t}\n\n\t\t\tif (eventsRef.current.onSelect) {\n\t\t\t\teventsRef.current.onSelect(event, { selection: newSelection });\n\t\t\t}\n\n\t\t\trequestClose(event);\n\t\t},\n\t\t[\n\t\t\tisSelected,\n\t\t\tmultiple,\n\t\t\tdeselectId,\n\t\t\tselection,\n\t\t\teventsRef,\n\t\t\trequestClose,\n\t\t\tvalue,\n\t\t]\n\t);\n\n\tconst handleInputBlur = useCallback(\n\t\t(event: React.FocusEvent) => {\n\t\t\tsetTimeout(() => {\n\t\t\t\tconst activeElement = documentDefined ? document.activeElement : null;\n\t\t\t\tif (\n\t\t\t\t\tactiveElement &&\n\t\t\t\t\tactiveElement.tagName === 'DIV' &&\n\t\t\t\t\tactiveElement.id === `${getId()}-listbox`\n\t\t\t\t) {\n\t\t\t\t\tif (inputRef.current) {\n\t\t\t\t\t\tinputRef.current.focus();\n\t\t\t\t\t}\n\t\t\t\t} else if (!popover) {\n\t\t\t\t\trequestClose(event);\n\t\t\t\t}\n\t\t\t}, 200);\n\n\t\t\tif (eventsRef.current.onBlur) {\n\t\t\t\teventsRef.current.onBlur(event);\n\t\t\t}\n\t\t},\n\t\t[getId, popover, requestClose, eventsRef]\n\t);\n\n\tconst handleInputChange = useCallback(\n\t\t(event: React.ChangeEvent<HTMLInputElement>) => {\n\t\t\trequestOpenMenu(event);\n\t\t\tif (eventsRef.current.onChange) {\n\t\t\t\teventsRef.current.onChange(event, { value: event.target.value });\n\t\t\t}\n\t\t},\n\t\t[requestOpenMenu, eventsRef]\n\t);\n\n\tconst handleInputFocus = useCallback(\n\t\t(event: React.FocusEvent) => {\n\t\t\tif (eventsRef.current.onFocus) {\n\t\t\t\teventsRef.current.onFocus(event, {});\n\t\t\t}\n\t\t},\n\t\t[eventsRef]\n\t);\n\n\tconst handleInputSubmit = useCallback(\n\t\t(event: React.KeyboardEvent) => {\n\t\t\tif (activeOption === undefined && activeOptionIndex === -1) {\n\t\t\t\tif (!isOpen) {\n\t\t\t\t\tif (!event.shiftKey) {\n\t\t\t\t\t\trequestOpen(event);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\trequestClose(event, { trigger: 'cancel' });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (activeOption?.disabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Legacy: `type: 'header' | 'footer'` rows passed directly in `options`\n\t\t\t// keep their pre-v11 Enter behavior of calling `option.onClick`.\n\t\t\tif (\n\t\t\t\tactiveOption &&\n\t\t\t\t!isActionItemRow(activeOption) &&\n\t\t\t\t(activeOption.type === 'header' || activeOption.type === 'footer')\n\t\t\t) {\n\t\t\t\tactiveOption.onClick?.(event as unknown as React.MouseEvent);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (activeOption && getIsActiveOption()) {\n\t\t\t\thandleSelect(event, {\n\t\t\t\t\toption: activeOption,\n\t\t\t\t\tselection,\n\t\t\t\t});\n\t\t\t} else if (\n\t\t\t\t!predefinedOptionsOnly &&\n\t\t\t\t(event.target as HTMLInputElement).value !== '' &&\n\t\t\t\teventsRef.current.onSubmit\n\t\t\t) {\n\t\t\t\teventsRef.current.onSubmit(event, {\n\t\t\t\t\tvalue: (event.target as HTMLInputElement).value,\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\t[\n\t\t\tactiveOption,\n\t\t\tactiveOptionIndex,\n\t\t\tisOpen,\n\t\t\trequestOpen,\n\t\t\trequestClose,\n\t\t\tgetIsActiveOption,\n\t\t\thandleSelect,\n\t\t\tselection,\n\t\t\tpredefinedOptionsOnly,\n\t\t\teventsRef,\n\t\t]\n\t);\n\n\tconst handleNavigateListboxMenu = useCallback(\n\t\t(\n\t\t\tevent: React.KeyboardEvent,\n\t\t\t{ direction }: { direction: 'next' | 'previous' }\n\t\t) => {\n\t\t\tconst offsets = { next: 1, previous: -1 };\n\t\t\tconst opts = getOptions();\n\t\t\tconst newIndex = getNewActiveOptionIndex({\n\t\t\t\tactiveOptionIndex,\n\t\t\t\toffset: offsets[direction],\n\t\t\t\toptions: opts,\n\t\t\t});\n\n\t\t\tif (getIsOpen() && menuRef.current) {\n\t\t\t\tmenuItemSelectScroll({\n\t\t\t\t\tcontainer: menuRef.current,\n\t\t\t\t\tfocusedIndex: newIndex,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tsetActiveOption(opts[newIndex]);\n\t\t\tsetActiveOptionIndex(newIndex);\n\t\t},\n\t\t[getOptions, getNewActiveOptionIndex, activeOptionIndex, getIsOpen]\n\t);\n\n\tconst handleNavigateSelectedListbox = useCallback(\n\t\t(\n\t\t\tevent: React.SyntheticEvent,\n\t\t\t{ direction }: { direction: 'next' | 'previous' }\n\t\t) => {\n\t\t\tconst offsets = { next: 1, previous: -1 };\n\t\t\tconst isLastOptionAndRightIsPressed =\n\t\t\t\tactiveSelectedOptionIndex + 1 === selection.length &&\n\t\t\t\tdirection === 'next';\n\t\t\tconst isFirstOptionAndLeftIsPressed =\n\t\t\t\tactiveSelectedOptionIndex === 0 && direction === 'previous';\n\n\t\t\tif (isLastOptionAndRightIsPressed) {\n\t\t\t\tsetActiveSelectedOptionIndex(0);\n\t\t\t\tsetListboxHasFocus(true);\n\t\t\t} else if (isFirstOptionAndLeftIsPressed) {\n\t\t\t\tsetActiveSelectedOptionIndex(selection.length - 1);\n\t\t\t\tsetListboxHasFocus(true);\n\t\t\t} else {\n\t\t\t\tconst newIndex = getNewActiveOptionIndex({\n\t\t\t\t\tactiveOptionIndex: activeSelectedOptionIndex,\n\t\t\t\t\toffset: offsets[direction],\n\t\t\t\t\toptions: selection,\n\t\t\t\t});\n\t\t\t\tsetActiveSelectedOptionIndex(newIndex);\n\t\t\t\tsetListboxHasFocus(true);\n\t\t\t}\n\t\t},\n\t\t[activeSelectedOptionIndex, selection, getNewActiveOptionIndex]\n\t);\n\n\tconst handleKeyDownDown = useCallback(\n\t\t(event: React.KeyboardEvent) => {\n\t\t\tif (!event.shiftKey) {\n\t\t\t\trequestOpen(event);\n\t\t\t}\n\n\t\t\tif (variant !== 'popover') {\n\t\t\t\thandleNavigateListboxMenu(event, { direction: 'next' });\n\t\t\t}\n\t\t},\n\t\t[requestOpen, variant, handleNavigateListboxMenu]\n\t);\n\n\tconst handleKeyDownUp = useCallback(\n\t\t(event: React.KeyboardEvent) => {\n\t\t\tif (!event.shiftKey && getIsOpen()) {\n\t\t\t\thandleNavigateListboxMenu(event, { direction: 'previous' });\n\t\t\t}\n\t\t},\n\t\t[getIsOpen, handleNavigateListboxMenu]\n\t);\n\n\tconst handleKeyDownTab = useCallback(() => {\n\t\tif (selectedListboxRef.current) {\n\t\t\tsetListboxHasFocus(true);\n\t\t}\n\t}, []);\n\n\tconst handleKeyDownOther = useCallback(\n\t\t(event: React.KeyboardEvent) => {\n\t\t\tconst opts = getOptions();\n\t\t\tconst newActiveOptionIndex = keyLetterMenuItemSelect({\n\t\t\t\tkey: event.key,\n\t\t\t\tkeyBuffer: menuKeyBuffer.current,\n\t\t\t\toptions: opts,\n\t\t\t});\n\n\t\t\tif (newActiveOptionIndex !== undefined) {\n\t\t\t\tif (getIsOpen() && menuRef.current) {\n\t\t\t\t\tmenuItemSelectScroll({\n\t\t\t\t\t\tcontainer: menuRef.current,\n\t\t\t\t\t\tfocusedIndex: newActiveOptionIndex,\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tsetActiveOption(opts[newActiveOptionIndex]);\n\t\t\t\tsetActiveOptionIndex(newActiveOptionIndex);\n\t\t\t}\n\t\t},\n\t\t[getOptions, getIsOpen]\n\t);\n\n\tconst handleKeyDown = useCallback(\n\t\t(event: React.KeyboardEvent) => {\n\t\t\tconst callbacks: Record<\n\t\t\t\tnumber | string,\n\t\t\t\t| {\n\t\t\t\t\t\tcallback: (e: React.KeyboardEvent) => void;\n\t\t\t\t\t\tstopPropagation?: boolean;\n\t\t\t\t }\n\t\t\t\t| undefined\n\t\t\t> = {\n\t\t\t\t[KEYS.DOWN]: { callback: handleKeyDownDown },\n\t\t\t\t[KEYS.ENTER]: { callback: handleInputSubmit },\n\t\t\t\t[KEYS.ESCAPE]: {\n\t\t\t\t\tcallback: requestClose as (e: React.KeyboardEvent) => void,\n\t\t\t\t},\n\t\t\t\t[KEYS.UP]: { callback: handleKeyDownUp },\n\t\t\t};\n\n\t\t\tif (variant === 'readonly') {\n\t\t\t\tif (selection.length > 2) {\n\t\t\t\t\tcallbacks[KEYS.TAB] = { callback: handleKeyDownTab };\n\t\t\t\t} else {\n\t\t\t\t\tcallbacks[KEYS.TAB] = undefined;\n\t\t\t\t}\n\t\t\t\tcallbacks.other = {\n\t\t\t\t\tcallback: handleKeyDownOther,\n\t\t\t\t\tstopPropagation: false,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst stopPropagation = getIsOpen();\n\n\t\t\tmapKeyEventCallbacks(event, { callbacks, stopPropagation });\n\t\t},\n\t\t[\n\t\t\thandleKeyDownDown,\n\t\t\thandleInputSubmit,\n\t\t\trequestClose,\n\t\t\thandleKeyDownUp,\n\t\t\tvariant,\n\t\t\tselection.length,\n\t\t\thandleKeyDownTab,\n\t\t\thandleKeyDownOther,\n\t\t\tgetIsOpen,\n\t\t]\n\t);\n\n\tconst handleBlurPill = useCallback(() => {\n\t\tsetListboxHasFocus(false);\n\t}, []);\n\n\tconst handlePillFocus = useCallback(\n\t\t(\n\t\t\tevent: React.FocusEvent,\n\t\t\t{ index }: { option: ComboboxOption; index: number }\n\t\t) => {\n\t\t\tif (!listboxHasFocus) {\n\t\t\t\tsetActiveSelectedOptionIndex(index);\n\t\t\t\tsetListboxHasFocus(true);\n\t\t\t}\n\t\t},\n\t\t[listboxHasFocus]\n\t);\n\n\tconst handleRemoveSelectedOption = useCallback(\n\t\t(\n\t\t\tevent: React.SyntheticEvent,\n\t\t\t{ option, index }: { option: ComboboxOption; index?: number }\n\t\t) => {\n\t\t\tevent.preventDefault();\n\t\t\tconst onlyOnePillAndInputExists = selection.length === 1;\n\t\t\tconst isReadOnlyAndTwoPillsExists =\n\t\t\t\tselection.length === 2 && variant === 'readonly' && multiple;\n\t\t\tconst lastPillWasRemoved =\n\t\t\t\tindex !== undefined && index + 1 === selection.length;\n\n\t\t\tif (\n\t\t\t\t(onlyOnePillAndInputExists || isReadOnlyAndTwoPillsExists) &&\n\t\t\t\tinputRef.current\n\t\t\t) {\n\t\t\t\tinputRef.current.focus();\n\t\t\t} else if (lastPillWasRemoved && index !== undefined) {\n\t\t\t\tsetActiveSelectedOptionIndex(index - 1);\n\t\t\t\tsetListboxHasFocus(true);\n\t\t\t} else if (index !== undefined) {\n\t\t\t\tsetActiveSelectedOptionIndex(index);\n\t\t\t\tsetListboxHasFocus(true);\n\t\t\t}\n\n\t\t\tif (eventsRef.current.onRequestRemoveSelectedOption) {\n\t\t\t\teventsRef.current.onRequestRemoveSelectedOption(event, {\n\t\t\t\t\tselection: reject(selection, option),\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\t[selection, variant, multiple, eventsRef]\n\t);\n\n\tconst handleRequestFocusSelectedListbox = useCallback(\n\t\t(event: React.SyntheticEvent, { ref }: { ref: HTMLElement | null }) => {\n\t\t\tif (ref) {\n\t\t\t\tactiveSelectedOptionRef.current = ref;\n\t\t\t\tactiveSelectedOptionRef.current.focus();\n\t\t\t}\n\t\t},\n\t\t[]\n\t);\n\n\t// ===== Refs =====\n\n\tconst setInputRefCallback = useCallback(\n\t\t(component: HTMLInputElement | null) => {\n\t\t\tinputRef.current = component;\n\t\t\tif (!inputRendered) {\n\t\t\t\tsetInputRendered(true);\n\t\t\t}\n\t\t\tif (inputRefCallback) {\n\t\t\t\tinputRefCallback(component);\n\t\t\t}\n\t\t},\n\t\t[inputRendered, inputRefCallback]\n\t);\n\n\tconst setSelectedListboxRefCallback = useCallback(\n\t\t(ref: HTMLUListElement | null) => {\n\t\t\tselectedListboxRef.current = ref;\n\t\t\tif (selectedListboxRefCallback) {\n\t\t\t\tselectedListboxRefCallback(ref);\n\t\t\t}\n\t\t},\n\t\t[selectedListboxRefCallback]\n\t);\n\n\tconst setMenuRefCallback = useCallback((ref: HTMLUListElement | null) => {\n\t\tmenuRef.current = ref;\n\t}, []);\n\n\tconst getTargetElement = useCallback(() => inputRef.current, []);\n\n\t// ===== Effects =====\n\n\t// `events.onClose` fires when the menu really closes: after an\n\t// uncontrolled close, or when the parent sets a controlled `isOpen` to\n\t// `false`. It does not fire for a close request a controlled parent ignores.\n\tconst wasOpenRef = useRef(isOpen);\n\tuseEffect(() => {\n\t\tif (wasOpenRef.current !== isOpen) {\n\t\t\twasOpenRef.current = isOpen;\n\t\t\tif (!isOpen) {\n\t\t\t\tif (\n\t\t\t\t\tcurrentOpenDropdown &&\n\t\t\t\t\tcurrentOpenDropdown.handleClose === requestClose\n\t\t\t\t) {\n\t\t\t\t\tcurrentOpenDropdown = undefined;\n\t\t\t\t}\n\t\t\t\tif (eventsRef.current.onClose) {\n\t\t\t\t\teventsRef.current.onClose(closeEventRef.current, {});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcloseEventRef.current = undefined;\n\t});\n\n\t// Cleanup on unmount\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\tif (\n\t\t\t\tcurrentOpenDropdown &&\n\t\t\t\tcurrentOpenDropdown.handleClose === requestClose\n\t\t\t) {\n\t\t\t\tcurrentOpenDropdown = undefined;\n\t\t\t}\n\t\t};\n\t}, [requestClose]);\n\n\t// ===== Render Helpers =====\n\n\tconst customPopoverProps = useMemo(() => {\n\t\tconst popoverPropsFromProp = popover?.props as\n\t\t\tRecord<string, unknown> | undefined;\n\t\tconst popoverBody = (\n\t\t\t<div>\n\t\t\t\t<div className=\"slds-assistive-text\" id={`${getId()}-label`}>\n\t\t\t\t\t{assistiveText.popoverLabel}\n\t\t\t\t</div>\n\t\t\t\t{popoverPropsFromProp?.body as ReactNode}\n\t\t\t</div>\n\t\t);\n\n\t\tconst popoverFooter = (\n\t\t\t<div>\n\t\t\t\t<Button\n\t\t\t\t\tlabel={labels.cancelButton}\n\t\t\t\t\tonClick={(e: React.MouseEvent) => {\n\t\t\t\t\t\trequestClose(e, { trigger: 'cancel' });\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t\t<Button\n\t\t\t\t\tlabel={labels.doneButton}\n\t\t\t\t\tvariant=\"brand\"\n\t\t\t\t\tonClick={(e: React.MouseEvent) => {\n\t\t\t\t\t\trequestClose(e);\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t);\n\n\t\tconst defaultPopoverProps: Record<string, unknown> = {\n\t\t\tariaLabelledby: `${getId()}-label`,\n\t\t\talign: 'bottom',\n\t\t\tbody: popoverBody,\n\t\t\tclassNameDialog: 'slds-popover_full-width',\n\t\t\tfooter: popoverFooter,\n\t\t\tclassNameFooter: 'slds-popover__footer_form',\n\t\t\thasNoNubbin: true,\n\t\t\tid: getId(),\n\t\t\tisOpen,\n\t\t\thasNoTriggerStyles: true,\n\t\t\tonOpen: handleOpen,\n\t\t\t// The combobox owns the popover's open state; `events.onClose` is\n\t\t\t// fired by the combobox itself when `isOpen` turns `false`.\n\t\t\tonRequestClose: (\n\t\t\t\tevent: React.SyntheticEvent,\n\t\t\t\tdata?: { trigger?: string }\n\t\t\t) => {\n\t\t\t\trequestClose(event, { trigger: data?.trigger });\n\t\t\t},\n\t\t};\n\n\t\tconst popoverProps: Record<string, unknown> = {\n\t\t\t...defaultPopoverProps,\n\t\t\t...popoverPropsFromProp,\n\t\t\tbody: popoverBody,\n\t\t};\n\n\t\tdelete popoverProps.children;\n\t\treturn popoverProps;\n\t}, [\n\t\tgetId,\n\t\tassistiveText.popoverLabel,\n\t\tlabels.cancelButton,\n\t\tlabels.doneButton,\n\t\trequestClose,\n\t\tisOpen,\n\t\thandleOpen,\n\t\tpopover,\n\t]);\n\n\t// The listbox only renders while open and enabled (see `getDialog`), so the\n\t// input must not report it as expanded or point `aria-controls` at it\n\t// otherwise.\n\tconst getIsListboxRendered = useCallback(\n\t\t() => !isInputDisabled && getIsOpen(),\n\t\t[isInputDisabled, getIsOpen]\n\t);\n\tconst getListboxControlsId = () =>\n\t\tgetIsListboxRendered() ? `${getId()}-listbox` : undefined;\n\n\t// ARIA 1.2 combobox role and state for the input. `popupId` is the id of the\n\t// rendered popup, or `undefined` while it isn't rendered.\n\tconst getComboboxAriaProps = (\n\t\tpopup: 'listbox' | 'dialog',\n\t\tpopupId: string | undefined\n\t) => ({\n\t\t'aria-controls': popupId,\n\t\t'aria-expanded': !!popupId,\n\t\t'aria-haspopup': popup,\n\t\trole: 'combobox',\n\t});\n\n\tconst getDialog = useCallback(\n\t\t({ menuRenderer }: { menuRenderer: ReactNode }) => {\n\t\t\tconst position = menuPosition;\n\n\t\t\tif (getIsListboxRendered()) {\n\t\t\t\tconst dialogProps = {\n\t\t\t\t\talign: 'bottom left' as const,\n\t\t\t\t\tcontext: iconSettingsContext,\n\t\t\t\t\thasStaticAlignment,\n\t\t\t\t\tinheritWidthOf,\n\t\t\t\t\tonMouseDown: (event: React.MouseEvent) => {\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t},\n\t\t\t\t\tonOpen: handleOpen,\n\t\t\t\t\tonRequestTargetElement: getTargetElement,\n\t\t\t\t\tposition,\n\t\t\t\t\tcontainerProps: {\n\t\t\t\t\t\tid: `${getId()}-listbox`,\n\t\t\t\t\t\trole: 'listbox',\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t\treturn (\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\t<Dialog {...(dialogProps as any)}>{menuRenderer}</Dialog>\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn null;\n\t\t},\n\t\t[\n\t\t\tmenuPosition,\n\t\t\tgetIsListboxRendered,\n\t\t\ticonSettingsContext,\n\t\t\thasStaticAlignment,\n\t\t\tinheritWidthOf,\n\t\t\thandleOpen,\n\t\t\tgetTargetElement,\n\t\t\tgetId,\n\t\t]\n\t);\n\n\t// `onRenderMenuItem` and `menuItem` are deprecated: they take a component instead of a function\n\tconst LegacyMenuItem = onRenderMenuItem || menuItem;\n\tlet renderMenuItem:\n\t\t((data: ComboboxMenuRenderMenuItemData) => ReactNode) | undefined;\n\tif (renderMenuItemProp) {\n\t\trenderMenuItem = (data) => renderMenuItemProp({ ...data, assistiveText });\n\t} else if (LegacyMenuItem) {\n\t\trenderMenuItem = ({ isSelected, option }) => (\n\t\t\t<LegacyMenuItem\n\t\t\t\tassistiveText={assistiveText}\n\t\t\t\tselected={isSelected}\n\t\t\t\toption={option}\n\t\t\t/>\n\t\t);\n\t}\n\n\tconst renderMenu = useCallback(() => {\n\t\tconst menuVariant: Record<string, 'icon-title-subtitle' | 'checkbox'> = {\n\t\t\tbase: 'icon-title-subtitle',\n\t\t\t'inline-listbox': 'icon-title-subtitle',\n\t\t\treadonly: 'checkbox',\n\t\t};\n\n\t\tconst readonlyItemVisibleLength = variant === 'readonly' ? 5 : null;\n\n\t\treturn (\n\t\t\t<Menu\n\t\t\t\tassistiveText={assistiveText}\n\t\t\t\tactiveOption={activeOption}\n\t\t\t\tactiveOptionIndex={activeOptionIndex}\n\t\t\t\tclassNameMenu={classNameMenu}\n\t\t\t\tclassNameMenuSubHeader={classNameMenuSubHeader}\n\t\t\t\tinheritWidthOf={inheritWidthOf}\n\t\t\t\tinputId={getId()}\n\t\t\t\tinputValue={value}\n\t\t\t\tisSelected={isSelected}\n\t\t\t\titemVisibleLength={menuItemVisibleLength || readonlyItemVisibleLength}\n\t\t\t\tlabels={{ noOptionsFound: labels.noOptionsFound || '' }}\n\t\t\t\thasMenuSpinner={hasMenuSpinner}\n\t\t\t\tmenuPosition={menuPosition}\n\t\t\t\tmenuRef={setMenuRefCallback}\n\t\t\t\tmaxWidth={menuMaxWidth}\n\t\t\t\toptions={getOptions()}\n\t\t\t\tonSelect={\n\t\t\t\t\thandleSelect as (\n\t\t\t\t\t\tevent: React.MouseEvent,\n\t\t\t\t\t\tdata: { option: ComboboxOption; selection?: ComboboxOption[] }\n\t\t\t\t\t) => void\n\t\t\t\t}\n\t\t\t\trenderMenuItem={renderMenuItem}\n\t\t\t\tselection={selection}\n\t\t\t\ttooltipMenuItemDisabled={tooltipMenuItemDisabled}\n\t\t\t\tvariant={menuVariant[variant]}\n\t\t\t/>\n\t\t);\n\t}, [\n\t\tvariant,\n\t\tassistiveText,\n\t\tactiveOption,\n\t\tactiveOptionIndex,\n\t\tclassNameMenu,\n\t\tclassNameMenuSubHeader,\n\t\tinheritWidthOf,\n\t\tgetId,\n\t\tvalue,\n\t\tisSelected,\n\t\tmenuItemVisibleLength,\n\t\tlabels.noOptionsFound,\n\t\thasMenuSpinner,\n\t\tmenuPosition,\n\t\tsetMenuRefCallback,\n\t\tmenuMaxWidth,\n\t\tgetOptions,\n\t\thandleSelect,\n\t\trenderMenuItem,\n\t\tselection,\n\t\ttooltipMenuItemDisabled,\n\t]);\n\n\t// The `input` element's props are spread last so they win, except `onChange`: `Input`'s\n\t// is `(event, data)` and InnerInput's is native, so call it alongside the combobox's own.\n\tconst { onChange: inputOnChange, ...userDefinedInputProps } = (input?.props ??\n\t\t{}) as Partial<InputProps> & Record<string, unknown>;\n\tconst handleInnerInputChange = useCallback(\n\t\t(event: React.ChangeEvent<HTMLInputElement>) => {\n\t\t\tinputOnChange?.(event, { value: event.target.value });\n\t\t\thandleInputChange(event);\n\t\t},\n\t\t[inputOnChange, handleInputChange]\n\t);\n\t// The single-selection variants ignore typing once an option is selected\n\tconst handleInnerInputChangeWhileUnselected = useCallback(\n\t\t(event: React.ChangeEvent<HTMLInputElement>) => {\n\t\t\tinputOnChange?.(event, { value: event.target.value });\n\t\t\tif (!selection.length) {\n\t\t\t\thandleInputChange(event);\n\t\t\t}\n\t\t},\n\t\t[inputOnChange, handleInputChange, selection.length]\n\t);\n\n\t// ===== Sub-renders =====\n\n\tconst renderBase = () => (\n\t\t<div className=\"slds-form-element__control\">\n\t\t\t<div className=\"slds-combobox_container\">\n\t\t\t\t<div\n\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t'slds-combobox',\n\t\t\t\t\t\t'slds-dropdown-trigger',\n\t\t\t\t\t\t'slds-dropdown-trigger_click',\n\t\t\t\t\t\t'ignore-react-onclickoutside',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'slds-is-open': getIsOpen(),\n\t\t\t\t\t\t\t'slds-has-error': errorText,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tclassName\n\t\t\t\t\t)}\n\t\t\t\t>\n\t\t\t\t\t<InnerInput\n\t\t\t\t\t\taria-autocomplete=\"list\"\n\t\t\t\t\t\t{...getComboboxAriaProps('listbox', getListboxControlsId())}\n\t\t\t\t\t\taria-activedescendant={\n\t\t\t\t\t\t\tactiveOption\n\t\t\t\t\t\t\t\t? `${getId()}-listbox-option-${activeOption.id}`\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\taria-describedby={getErrorId()}\n\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\tclassName=\"slds-combobox__input\"\n\t\t\t\t\t\tcontainerProps={{\n\t\t\t\t\t\t\tclassName: 'slds-combobox__form-element',\n\t\t\t\t\t\t\trole: 'none',\n\t\t\t\t\t\t}}\n\t\t\t\t\t\thasSpinner={hasInputSpinner}\n\t\t\t\t\t\ticonRight={\n\t\t\t\t\t\t\t<InputIcon\n\t\t\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\t\t\tname=\"search\"\n\t\t\t\t\t\t\t\ttitle={labels.inputIconTitle}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdisabled={isInputDisabled}\n\t\t\t\t\t\tid={getId()}\n\t\t\t\t\t\tonFocus={handleInputFocus}\n\t\t\t\t\t\tonBlur={handleInputBlur}\n\t\t\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\t\t\tinputRef={setInputRefCallback}\n\t\t\t\t\t\tonClick={(event: React.MouseEvent) => requestOpen(event)}\n\t\t\t\t\t\tonChange={handleInnerInputChange}\n\t\t\t\t\t\tplaceholder={labels.placeholder}\n\t\t\t\t\t\treadOnly={!!(predefinedOptionsOnly && activeOption)}\n\t\t\t\t\t\trequired={required}\n\t\t\t\t\t\tvalue={\n\t\t\t\t\t\t\tpredefinedOptionsOnly\n\t\t\t\t\t\t\t\t? getOptionLabel(activeOption) || value\n\t\t\t\t\t\t\t\t: value\n\t\t\t\t\t\t}\n\t\t\t\t\t\t{...userDefinedInputProps}\n\t\t\t\t\t/>\n\t\t\t\t\t{getDialog({ menuRenderer: renderMenu() })}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<SelectedListBox\n\t\t\t\tactiveOption={activeSelectedOption as SelectedListBoxOption}\n\t\t\t\tactiveOptionIndex={activeSelectedOptionIndex}\n\t\t\t\tassistiveText={\n\t\t\t\t\tassistiveText as unknown as {\n\t\t\t\t\t\tremovePill?: string;\n\t\t\t\t\t\tselectedListboxLabel?: string;\n\t\t\t\t\t\t[key: string]: unknown;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tevents={{\n\t\t\t\t\tonBlurPill: handleBlurPill,\n\t\t\t\t\tonPillFocus: handlePillFocus as (\n\t\t\t\t\t\tevent: React.FocusEvent,\n\t\t\t\t\t\tdata: { index: number; option: SelectedListBoxOption }\n\t\t\t\t\t) => void,\n\t\t\t\t\tonRequestFocus: handleRequestFocusSelectedListbox as (\n\t\t\t\t\t\tevent: unknown,\n\t\t\t\t\t\tdata: { ref: HTMLElement | null }\n\t\t\t\t\t) => void,\n\t\t\t\t\tonRequestFocusOnNextPill: handleNavigateSelectedListbox as (\n\t\t\t\t\t\tevent: React.SyntheticEvent,\n\t\t\t\t\t\tdata: { direction: 'next' | 'previous' }\n\t\t\t\t\t) => void,\n\t\t\t\t\tonRequestFocusOnPreviousPill: handleNavigateSelectedListbox as (\n\t\t\t\t\t\tevent: React.SyntheticEvent,\n\t\t\t\t\t\tdata: { direction: 'next' | 'previous' }\n\t\t\t\t\t) => void,\n\t\t\t\t\tonRequestRemove: handleRemoveSelectedOption as (\n\t\t\t\t\t\tevent:\n\t\t\t\t\t\t\tReact.MouseEvent | React.KeyboardEvent | React.SyntheticEvent,\n\t\t\t\t\t\tdata: { index?: number; option: SelectedListBoxOption }\n\t\t\t\t\t) => void,\n\t\t\t\t}}\n\t\t\t\tid={`${getId()}-selected-listbox`}\n\t\t\t\tlabels={labels}\n\t\t\t\tselectedListboxRef={setSelectedListboxRefCallback}\n\t\t\t\tselection={selection as SelectedListBoxOption[]}\n\t\t\t\tlistboxHasFocus={listboxHasFocus}\n\t\t\t\tmultiselectable={multiple}\n\t\t\t/>\n\t\t\t{errorText && (\n\t\t\t\t<div className=\"slds-has-error\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tid={getErrorId()}\n\t\t\t\t\t\tclassName=\"slds-form-element__help slds-has-error\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{errorText}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n\n\tconst renderInlineMultiple = () => (\n\t\t<div className=\"slds-form-element__control\">\n\t\t\t<div\n\t\t\t\tclassName={classNames('slds-combobox_container', {\n\t\t\t\t\t'slds-has-inline-listbox': selection.length,\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t{selection.length ? (\n\t\t\t\t\t<SelectedListBox\n\t\t\t\t\t\tactiveOption={activeSelectedOption as SelectedListBoxOption}\n\t\t\t\t\t\tactiveOptionIndex={activeSelectedOptionIndex}\n\t\t\t\t\t\tassistiveText={\n\t\t\t\t\t\t\tassistiveText as unknown as {\n\t\t\t\t\t\t\t\tremovePill?: string;\n\t\t\t\t\t\t\t\tselectedListboxLabel?: string;\n\t\t\t\t\t\t\t\t[key: string]: unknown;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontainerRole=\"listbox\"\n\t\t\t\t\t\tcontainerAriaOrientation=\"horizontal\"\n\t\t\t\t\t\tlistboxRole=\"group\"\n\t\t\t\t\t\tlistboxAriaOrientation={null}\n\t\t\t\t\t\tevents={{\n\t\t\t\t\t\t\tonBlurPill: handleBlurPill,\n\t\t\t\t\t\t\tonPillFocus: handlePillFocus as (\n\t\t\t\t\t\t\t\tevent: React.FocusEvent,\n\t\t\t\t\t\t\t\tdata: { index: number; option: SelectedListBoxOption }\n\t\t\t\t\t\t\t) => void,\n\t\t\t\t\t\t\tonRequestFocus: handleRequestFocusSelectedListbox as (\n\t\t\t\t\t\t\t\tevent: unknown,\n\t\t\t\t\t\t\t\tdata: { ref: HTMLElement | null }\n\t\t\t\t\t\t\t) => void,\n\t\t\t\t\t\t\tonRequestFocusOnNextPill: handleNavigateSelectedListbox as (\n\t\t\t\t\t\t\t\tevent: React.SyntheticEvent,\n\t\t\t\t\t\t\t\tdata: { direction: 'next' | 'previous' }\n\t\t\t\t\t\t\t) => void,\n\t\t\t\t\t\t\tonRequestFocusOnPreviousPill: handleNavigateSelectedListbox as (\n\t\t\t\t\t\t\t\tevent: React.SyntheticEvent,\n\t\t\t\t\t\t\t\tdata: { direction: 'next' | 'previous' }\n\t\t\t\t\t\t\t) => void,\n\t\t\t\t\t\t\tonRequestRemove: handleRemoveSelectedOption as (\n\t\t\t\t\t\t\t\tevent:\n\t\t\t\t\t\t\t\t\tReact.MouseEvent | React.KeyboardEvent | React.SyntheticEvent,\n\t\t\t\t\t\t\t\tdata: { index?: number; option: SelectedListBoxOption }\n\t\t\t\t\t\t\t) => void,\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tid={`${getId()}-selected-listbox`}\n\t\t\t\t\t\tlabels={labels}\n\t\t\t\t\t\tselectedListboxRef={setSelectedListboxRefCallback}\n\t\t\t\t\t\tselection={selection as SelectedListBoxOption[]}\n\t\t\t\t\t\tlistboxHasFocus={listboxHasFocus}\n\t\t\t\t\t\tmultiselectable={multiple}\n\t\t\t\t\t/>\n\t\t\t\t) : null}\n\t\t\t\t<div\n\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t'slds-combobox',\n\t\t\t\t\t\t'slds-dropdown-trigger',\n\t\t\t\t\t\t'slds-dropdown-trigger_click',\n\t\t\t\t\t\t'ignore-react-onclickoutside',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'slds-is-open': getIsOpen(),\n\t\t\t\t\t\t\t'slds-has-error': errorText,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tclassName\n\t\t\t\t\t)}\n\t\t\t\t>\n\t\t\t\t\t<InnerInput\n\t\t\t\t\t\taria-autocomplete=\"list\"\n\t\t\t\t\t\t{...getComboboxAriaProps('listbox', getListboxControlsId())}\n\t\t\t\t\t\taria-activedescendant={\n\t\t\t\t\t\t\tactiveOption\n\t\t\t\t\t\t\t\t? `${getId()}-listbox-option-${activeOption.id}`\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\taria-describedby={getErrorId()}\n\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\tclassName=\"slds-combobox__input\"\n\t\t\t\t\t\tcontainerProps={{\n\t\t\t\t\t\t\tclassName: 'slds-combobox__form-element',\n\t\t\t\t\t\t\trole: 'none',\n\t\t\t\t\t\t}}\n\t\t\t\t\t\thasSpinner={hasInputSpinner}\n\t\t\t\t\t\ticonRight={\n\t\t\t\t\t\t\t<InputIcon\n\t\t\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\t\t\tname=\"search\"\n\t\t\t\t\t\t\t\ttitle={labels.inputIconTitle}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdisabled={isInputDisabled}\n\t\t\t\t\t\tid={getId()}\n\t\t\t\t\t\tonFocus={handleInputFocus}\n\t\t\t\t\t\tonBlur={handleInputBlur}\n\t\t\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\t\t\tinputRef={setInputRefCallback}\n\t\t\t\t\t\tonClick={(event: React.MouseEvent) => requestOpen(event)}\n\t\t\t\t\t\tonChange={handleInnerInputChange}\n\t\t\t\t\t\tplaceholder={labels.placeholder}\n\t\t\t\t\t\treadOnly={!!(predefinedOptionsOnly && activeOption)}\n\t\t\t\t\t\trequired={required}\n\t\t\t\t\t\tvalue={\n\t\t\t\t\t\t\tpredefinedOptionsOnly\n\t\t\t\t\t\t\t\t? getOptionLabel(activeOption) || value\n\t\t\t\t\t\t\t\t: value\n\t\t\t\t\t\t}\n\t\t\t\t\t\t{...userDefinedInputProps}\n\t\t\t\t\t/>\n\t\t\t\t\t{getDialog({ menuRenderer: renderMenu() })}\n\t\t\t\t\t{errorText && (\n\t\t\t\t\t\t<div id={getErrorId()} className=\"slds-form-element__help\">\n\t\t\t\t\t\t\t{errorText}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n\n\tconst renderInlineSingle = () => {\n\t\tconst selectedIcon = selection[0]?.icon;\n\t\tconst iconLeft =\n\t\t\tselectedIcon && React.isValidElement(selectedIcon)\n\t\t\t\t? React.cloneElement(selectedIcon, {\n\t\t\t\t\t\tcontainerClassName: 'slds-combobox__input-entity-icon',\n\t\t\t\t\t} as Record<string, unknown>)\n\t\t\t\t: null;\n\n\t\tconst inputValue = selection[0]?.label\n\t\t\t? getOptionLabel(selection[0])\n\t\t\t: value;\n\n\t\treturn (\n\t\t\t<div className=\"slds-form-element__control\">\n\t\t\t\t<div\n\t\t\t\t\tclassName={classNames('slds-combobox_container', {\n\t\t\t\t\t\t'slds-has-inline-listbox': selection.length,\n\t\t\t\t\t})}\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t'slds-combobox',\n\t\t\t\t\t\t\t'slds-dropdown-trigger',\n\t\t\t\t\t\t\t'slds-dropdown-trigger_click',\n\t\t\t\t\t\t\t'ignore-react-onclickoutside',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'slds-is-open': getIsOpen(),\n\t\t\t\t\t\t\t\t'slds-has-error': errorText,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tclassName\n\t\t\t\t\t\t)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<InnerInput\n\t\t\t\t\t\t\taria-autocomplete=\"list\"\n\t\t\t\t\t\t\t{...getComboboxAriaProps('listbox', getListboxControlsId())}\n\t\t\t\t\t\t\taria-activedescendant={\n\t\t\t\t\t\t\t\tactiveOption\n\t\t\t\t\t\t\t\t\t? `${getId()}-listbox-option-${activeOption.id}`\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\taria-describedby={getErrorId()}\n\t\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\t\tclassName=\"slds-combobox__input\"\n\t\t\t\t\t\t\tcontainerProps={{\n\t\t\t\t\t\t\t\tclassName: 'slds-combobox__form-element',\n\t\t\t\t\t\t\t\trole: 'none',\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tdisabled={isInputDisabled}\n\t\t\t\t\t\t\thasSpinner={hasInputSpinner}\n\t\t\t\t\t\t\ticonRight={\n\t\t\t\t\t\t\t\tselection.length ? (\n\t\t\t\t\t\t\t\t\t<InputIcon\n\t\t\t\t\t\t\t\t\t\tassistiveText={{\n\t\t\t\t\t\t\t\t\t\t\ticon: assistiveText.removeSingleSelectedOption,\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\tbuttonRef={(component: HTMLButtonElement | null) => {\n\t\t\t\t\t\t\t\t\t\t\tbuttonRef.current = component;\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\t\t\t\t\ticonPosition=\"right\"\n\t\t\t\t\t\t\t\t\t\tname=\"close\"\n\t\t\t\t\t\t\t\t\t\tonClick={(event: React.MouseEvent) => {\n\t\t\t\t\t\t\t\t\t\t\thandleRemoveSelectedOption(event, {\n\t\t\t\t\t\t\t\t\t\t\t\toption: selection[0],\n\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<InputIcon category=\"utility\" name=\"search\" />\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ticonLeft={iconLeft}\n\t\t\t\t\t\t\tid={getId()}\n\t\t\t\t\t\t\tonFocus={handleInputFocus}\n\t\t\t\t\t\t\tonBlur={handleInputBlur}\n\t\t\t\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\t\t\t\tinputRef={setInputRefCallback}\n\t\t\t\t\t\t\tonClick={(event: React.MouseEvent) => requestOpenMenu(event)}\n\t\t\t\t\t\t\tonChange={handleInnerInputChangeWhileUnselected}\n\t\t\t\t\t\t\tplaceholder={labels.placeholder}\n\t\t\t\t\t\t\treadOnly={\n\t\t\t\t\t\t\t\t!!(predefinedOptionsOnly && activeOption) || !!selection.length\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\trequired={required}\n\t\t\t\t\t\t\tvalue={\n\t\t\t\t\t\t\t\tpredefinedOptionsOnly\n\t\t\t\t\t\t\t\t\t? getOptionLabel(activeOption) || value\n\t\t\t\t\t\t\t\t\t: inputValue\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t{...userDefinedInputProps}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{getDialog({ menuRenderer: renderMenu() })}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t{errorText && (\n\t\t\t\t\t<div className=\"slds-has-error\">\n\t\t\t\t\t\t<div id={getErrorId()} className=\"slds-form-element__help\">\n\t\t\t\t\t\t\t{errorText}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t);\n\t};\n\n\tconst renderPopover = () => {\n\t\tconst popoverProps = customPopoverProps;\n\t\t// Popover renders its dialog as `${id}-popover`, and `popover` props may\n\t\t// override the id.\n\t\tconst popoverId = (popover?.props as { id?: string } | undefined)?.id;\n\t\tconst popoverControlsId = getIsOpen()\n\t\t\t? `${popoverId ?? getId()}-popover`\n\t\t\t: undefined;\n\n\t\treturn (\n\t\t\t<div className=\"slds-form-element__control\">\n\t\t\t\t<div className=\"slds-combobox_container\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t'slds-combobox',\n\t\t\t\t\t\t\t'slds-dropdown-trigger',\n\t\t\t\t\t\t\t'slds-dropdown-trigger_click',\n\t\t\t\t\t\t\t'ignore-react-onclickoutside',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'slds-is-open': getIsOpen(),\n\t\t\t\t\t\t\t\t'slds-has-error': errorText,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tclassName\n\t\t\t\t\t\t)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{/* @ts-expect-error - popoverProps contains body from customPopoverProps */}\n\t\t\t\t\t\t<Popover {...popoverProps}>\n\t\t\t\t\t\t\t<InnerInput\n\t\t\t\t\t\t\t\t{...getComboboxAriaProps('dialog', popoverControlsId)}\n\t\t\t\t\t\t\t\taria-describedby={getErrorId()}\n\t\t\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\t\t\tclassName=\"slds-combobox__input\"\n\t\t\t\t\t\t\t\tcontainerProps={{\n\t\t\t\t\t\t\t\t\tclassName: 'slds-combobox__form-element',\n\t\t\t\t\t\t\t\t\trole: 'none',\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\ticonRight={\n\t\t\t\t\t\t\t\t\t<InputIcon\n\t\t\t\t\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\t\t\t\t\tname=\"down\"\n\t\t\t\t\t\t\t\t\t\tvariant=\"combobox\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdisabled={isInputDisabled}\n\t\t\t\t\t\t\t\tid={getId()}\n\t\t\t\t\t\t\t\tonFocus={handleInputFocus}\n\t\t\t\t\t\t\t\tonBlur={handleInputBlur}\n\t\t\t\t\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\t\t\t\t\tinputRef={setInputRefCallback}\n\t\t\t\t\t\t\t\tonClick={(event: React.MouseEvent) => requestOpen(event)}\n\t\t\t\t\t\t\t\tonChange={handleInnerInputChange}\n\t\t\t\t\t\t\t\tplaceholder={labels.placeholder}\n\t\t\t\t\t\t\t\treadOnly\n\t\t\t\t\t\t\t\trequired={required}\n\t\t\t\t\t\t\t\tvalue={value}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Popover>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t{errorText && (\n\t\t\t\t\t<div className=\"slds-has-error\">\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tid={getErrorId()}\n\t\t\t\t\t\t\tclassName=\"slds-form-element__help slds-has-error\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{errorText}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t);\n\t};\n\n\tconst renderReadOnlyMultiple = () => {\n\t\tconst displayValue =\n\t\t\tselection.length > 1\n\t\t\t\t? labels.multipleOptionsSelected ||\n\t\t\t\t\t`${selection.length} options selected`\n\t\t\t\t: getOptionLabel(selection[0]) || '';\n\n\t\treturn (\n\t\t\t<div className=\"slds-form-element__control\">\n\t\t\t\t<div className=\"slds-combobox_container\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t'slds-combobox',\n\t\t\t\t\t\t\t'slds-dropdown-trigger',\n\t\t\t\t\t\t\t'slds-dropdown-trigger_click',\n\t\t\t\t\t\t\t'ignore-react-onclickoutside',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'slds-is-open': getIsOpen(),\n\t\t\t\t\t\t\t\t'slds-has-error': errorText,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tclassName\n\t\t\t\t\t\t)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<InnerInput\n\t\t\t\t\t\t\t{...getComboboxAriaProps('listbox', getListboxControlsId())}\n\t\t\t\t\t\t\taria-activedescendant={\n\t\t\t\t\t\t\t\tactiveOption\n\t\t\t\t\t\t\t\t\t? `${getId()}-listbox-option-${activeOption.id}`\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\taria-describedby={getErrorId()}\n\t\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\t\tclassName=\"slds-combobox__input\"\n\t\t\t\t\t\t\tcontainerProps={{\n\t\t\t\t\t\t\t\tclassName: 'slds-combobox__form-element',\n\t\t\t\t\t\t\t\trole: 'none',\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\ticonRight={\n\t\t\t\t\t\t\t\t<InputIcon category=\"utility\" name=\"down\" variant=\"combobox\" />\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdisabled={isInputDisabled}\n\t\t\t\t\t\t\tid={getId()}\n\t\t\t\t\t\t\tonFocus={handleInputFocus}\n\t\t\t\t\t\t\tonBlur={handleInputBlur}\n\t\t\t\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\t\t\t\tinputRef={setInputRefCallback}\n\t\t\t\t\t\t\tonClick={(event: React.MouseEvent) => requestOpenMenu(event)}\n\t\t\t\t\t\t\tonChange={handleInnerInputChangeWhileUnselected}\n\t\t\t\t\t\t\tplaceholder={labels.placeholderReadOnly}\n\t\t\t\t\t\t\treadOnly\n\t\t\t\t\t\t\trequired={required}\n\t\t\t\t\t\t\tvalue={displayValue}\n\t\t\t\t\t\t\t{...userDefinedInputProps}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{getDialog({ menuRenderer: renderMenu() })}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<SelectedListBox\n\t\t\t\t\tactiveOption={activeSelectedOption as SelectedListBoxOption}\n\t\t\t\t\tactiveOptionIndex={activeSelectedOptionIndex}\n\t\t\t\t\tassistiveText={\n\t\t\t\t\t\tassistiveText as unknown as {\n\t\t\t\t\t\t\tremovePill?: string;\n\t\t\t\t\t\t\tselectedListboxLabel?: string;\n\t\t\t\t\t\t\t[key: string]: unknown;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tevents={{\n\t\t\t\t\t\tonBlurPill: handleBlurPill,\n\t\t\t\t\t\tonPillFocus: handlePillFocus as (\n\t\t\t\t\t\t\tevent: React.FocusEvent,\n\t\t\t\t\t\t\tdata: { index: number; option: SelectedListBoxOption }\n\t\t\t\t\t\t) => void,\n\t\t\t\t\t\tonRequestFocus: handleRequestFocusSelectedListbox as (\n\t\t\t\t\t\t\tevent: unknown,\n\t\t\t\t\t\t\tdata: { ref: HTMLElement | null }\n\t\t\t\t\t\t) => void,\n\t\t\t\t\t\tonRequestFocusOnNextPill: handleNavigateSelectedListbox as (\n\t\t\t\t\t\t\tevent: React.SyntheticEvent,\n\t\t\t\t\t\t\tdata: { direction: 'next' | 'previous' }\n\t\t\t\t\t\t) => void,\n\t\t\t\t\t\tonRequestFocusOnPreviousPill: handleNavigateSelectedListbox as (\n\t\t\t\t\t\t\tevent: React.SyntheticEvent,\n\t\t\t\t\t\t\tdata: { direction: 'next' | 'previous' }\n\t\t\t\t\t\t) => void,\n\t\t\t\t\t\tonRequestRemove: handleRemoveSelectedOption as (\n\t\t\t\t\t\t\tevent:\n\t\t\t\t\t\t\t\tReact.MouseEvent | React.KeyboardEvent | React.SyntheticEvent,\n\t\t\t\t\t\t\tdata: { index?: number; option: SelectedListBoxOption }\n\t\t\t\t\t\t) => void,\n\t\t\t\t\t}}\n\t\t\t\t\tid={`${getId()}-selected-listbox`}\n\t\t\t\t\tlabels={labels}\n\t\t\t\t\tselectedListboxRef={setSelectedListboxRefCallback}\n\t\t\t\t\tselection={selection as SelectedListBoxOption[]}\n\t\t\t\t\tlistboxHasFocus={listboxHasFocus}\n\t\t\t\t\tvariant={variant}\n\t\t\t\t\trenderAtSelectionLength={2}\n\t\t\t\t\tmultiselectable={multiple}\n\t\t\t\t/>\n\t\t\t\t{errorText && (\n\t\t\t\t\t<div className=\"slds-has-error\">\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tid={getErrorId()}\n\t\t\t\t\t\t\tclassName=\"slds-form-element__help slds-has-error\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{errorText}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t);\n\t};\n\n\tconst renderReadOnlySingle = () => {\n\t\tconst activeOptionLabel = getOptionLabel(activeOption);\n\t\tconst selectedOptionLabel = getOptionLabel(selection[0]);\n\t\tlet inputValue = activeOptionLabel || selectedOptionLabel || '';\n\n\t\tif (selection[0]?.value === '') {\n\t\t\tinputValue = '';\n\t\t}\n\n\t\treturn (\n\t\t\t<div className=\"slds-form-element__control\">\n\t\t\t\t<div className=\"slds-combobox_container\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t'slds-combobox',\n\t\t\t\t\t\t\t'slds-dropdown-trigger',\n\t\t\t\t\t\t\t'slds-dropdown-trigger_click',\n\t\t\t\t\t\t\t'ignore-react-onclickoutside',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'slds-is-open': getIsOpen(),\n\t\t\t\t\t\t\t\t'slds-has-error': errorText,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tclassName\n\t\t\t\t\t\t)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<InnerInput\n\t\t\t\t\t\t\t{...getComboboxAriaProps('listbox', getListboxControlsId())}\n\t\t\t\t\t\t\taria-activedescendant={\n\t\t\t\t\t\t\t\tactiveOption\n\t\t\t\t\t\t\t\t\t? `${getId()}-listbox-option-${activeOption.id}`\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\taria-describedby={getErrorId()}\n\t\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\t\tclassName=\"slds-combobox__input\"\n\t\t\t\t\t\t\tcontainerProps={{\n\t\t\t\t\t\t\t\tclassName: 'slds-combobox__form-element',\n\t\t\t\t\t\t\t\trole: 'none',\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tdisabled={isInputDisabled}\n\t\t\t\t\t\t\ticonRight={\n\t\t\t\t\t\t\t\t<InputIcon category=\"utility\" name=\"down\" variant=\"combobox\" />\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tid={getId()}\n\t\t\t\t\t\t\tonFocus={handleInputFocus}\n\t\t\t\t\t\t\tonBlur={handleInputBlur}\n\t\t\t\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\t\t\t\tinputRef={setInputRefCallback}\n\t\t\t\t\t\t\tonClick={(event: React.MouseEvent) => requestOpenMenu(event)}\n\t\t\t\t\t\t\tonChange={handleInnerInputChangeWhileUnselected}\n\t\t\t\t\t\t\tplaceholder={labels.placeholderReadOnly}\n\t\t\t\t\t\t\treadOnly\n\t\t\t\t\t\t\trequired={required}\n\t\t\t\t\t\t\tvalue={inputValue}\n\t\t\t\t\t\t\t{...userDefinedInputProps}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{getDialog({ menuRenderer: renderMenu() })}\n\t\t\t\t\t\t{errorText && (\n\t\t\t\t\t\t\t<div id={getErrorId()} className=\"slds-form-element__help\">\n\t\t\t\t\t\t\t\t{errorText}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t};\n\n\t// ===== Main Render =====\n\n\tconst hasRenderedLabel = labels.label || assistiveText?.label;\n\n\tconst subRenders: Record<string, Record<string, () => ReactNode>> = {\n\t\tbase: {\n\t\t\tmultiple: renderBase,\n\t\t\tsingle: renderBase,\n\t\t},\n\t\t'inline-listbox': {\n\t\t\tmultiple: renderInlineMultiple,\n\t\t\tsingle: renderInlineSingle,\n\t\t},\n\t\tpopover: {\n\t\t\tmultiple: renderPopover,\n\t\t\tsingle: renderPopover,\n\t\t},\n\t\treadonly: {\n\t\t\tmultiple: renderReadOnlyMultiple,\n\t\t\tsingle: renderReadOnlySingle,\n\t\t},\n\t};\n\n\tconst multipleOrSingle = multiple ? 'multiple' : 'single';\n\tconst variantRenderer = subRenders[variant]?.[multipleOrSingle];\n\n\tconst mainCombobox = (\n\t\t<div className={classNames('slds-form-element', classNameContainer)}>\n\t\t\t{entityCombobox ? null : (\n\t\t\t\t<Label\n\t\t\t\t\tassistiveText={\n\t\t\t\t\t\tassistiveText as unknown as {\n\t\t\t\t\t\t\tlabel?: string;\n\t\t\t\t\t\t\t[key: string]: unknown;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\thtmlFor={getId()}\n\t\t\t\t\tlabel={labels.label}\n\t\t\t\t\trequired={required}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t{fieldLevelHelpTooltip && hasRenderedLabel ? (\n\t\t\t\t<FieldLevelHelpTooltip\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\tfieldLevelHelpTooltip={fieldLevelHelpTooltip as any}\n\t\t\t\t/>\n\t\t\t) : null}\n\t\t\t{variantRenderer ? variantRenderer() : subRenders.base.multiple()}\n\t\t</div>\n\t);\n\n\treturn entityCombobox ? (\n\t\t<div className=\"slds-form-element\">\n\t\t\t<Label\n\t\t\t\tassistiveText={\n\t\t\t\t\tassistiveText as unknown as { label?: string; [key: string]: unknown }\n\t\t\t\t}\n\t\t\t\thtmlFor={getId()}\n\t\t\t\tlabel={labels.label}\n\t\t\t\trequired={required}\n\t\t\t/>\n\t\t\t<div className=\"slds-form-element__control\">\n\t\t\t\t<div className=\"slds-combobox-group\">\n\t\t\t\t\t<div className=\"slds-combobox_object-switcher slds-combobox-addon_start\">\n\t\t\t\t\t\t{entityCombobox}\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div className=\"slds-combobox_container slds-combobox-addon_end\">\n\t\t\t\t\t\t{mainCombobox}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t) : (\n\t\tmainCombobox\n\t);\n};\n\nCombobox.displayName = COMBOBOX;\n\nexport default Combobox;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;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IACf,OAAO,EAAO;IACJ;GACV,CAAA;GAED,MAAyB,KACzB,kBAAC,IAAD,EAEwB,0BACvB,CAAA,IACE;GACH,KAAkB,GAAgB,IAAI,GAAW,KAAK,SAAS;EAC5D;;CAGN,OAAO,KACN,kBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACC,kBAAC,IAAD;GAEE;GAED,SAAS,EAAM;GACf,OAAO,EAAO;GACJ;EACV,CAAA,GACD,kBAAC,OAAD;GAAK,WAAU;GACd,UAAA,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACC,kBAAC,OAAD;KAAK,WAAU;KACb,UAAA;IACG,CAAA,GAEL,kBAAC,OAAD;KAAK,WAAU;KACb,UAAA;IACG,CAAA,CACD;;EACD,CAAA,CACD;CAEL,CAAA,IAAA;AAEF;AAEA,GAAS,cAAc"}
1
+ {"version":3,"file":"combobox.js","names":[],"sources":["../../../../components/combobox/combobox.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, {\n\tuseId,\n\tuseState,\n\tuseRef,\n\tuseCallback,\n\tuseMemo,\n\tuseEffect,\n\tuseContext,\n\ttype ReactNode,\n\ttype ReactElement,\n} from 'react';\n\nimport assign from 'lodash.assign';\nimport find from 'lodash.find';\nimport reject from 'lodash.reject';\nimport { dequal as isEqual } from 'dequal';\nimport findIndex from 'lodash.findindex';\n\nimport classNames from 'classnames';\n\nimport Button from '../button';\nimport Dialog from '../utilities/dialog';\nimport InnerInput from '../input/private/inner-input';\nimport InputIcon from '../icon/input-icon';\nimport Menu, { getOptionLabel } from './private/menu';\nimport type {\n\tComboboxOption,\n\tComboboxItemOption,\n\tComboboxActionOption,\n\tComboboxDeselectOption,\n\tComboboxMenuRenderMenuItemData,\n\tComboboxOptionIcon,\n} from './types';\nimport Label from '../forms/private/label';\nimport Popover, { type PopoverProps } from '../popover';\nimport type { InputProps } from '../input';\nimport type { TooltipProps } from '../tooltip';\nimport SelectedListBox from '../pill-container/private/selected-listbox';\n\nimport FieldLevelHelpTooltip from '../tooltip/private/field-level-help-tooltip';\nimport KEYS from '../../utilities/key-code';\nimport KeyBuffer from '../../utilities/key-buffer';\nimport keyLetterMenuItemSelect from '../../utilities/key-letter-menu-item-select';\nimport mapKeyEventCallbacks from '../../utilities/key-callbacks';\nimport menuItemSelectScroll from '../../utilities/menu-item-select-scroll';\n\nimport checkProps from './check-props';\n\nimport { COMBOBOX } from '../../utilities/constants';\nimport type { SelectedListBoxOption } from '../pill-container/private/selected-listbox';\nimport componentDoc from './component.json';\nimport { IconSettingsContext } from '../icon-settings';\nimport { useControllableState, useLatestRef } from '../../utilities/hooks';\n\nlet currentOpenDropdown: { handleClose: () => void } | undefined;\nconst documentDefined = typeof document !== 'undefined';\n\n// ===== Types =====\n\nexport interface ComboboxAssistiveText {\n\t/** Visually hidden input label, used when there is no `labels.label`. */\n\tlabel?: string;\n\t/** Spinner label while `hasMenuSpinner` is set. Defaults to the English text `Loading`. */\n\tloadingMenuItems?: string;\n\t/** Read before the selected item in the menu of the `readonly` variant. Defaults to the English text `Current Selection:`. */\n\toptionSelectedInMenu?: string;\n\t/** `aria-label` of the `popover` variant's dialog. Required for that variant. */\n\tpopoverLabel?: string;\n\t/** Label of the button that removes the selected option in the single-select `inline-listbox` variant. Defaults to the English text `Remove selected option`. */\n\tremoveSingleSelectedOption?: string;\n\t/** Appended to each pill's label in multiple selection. Defaults to the English text `, Press delete or backspace to remove`. */\n\tremovePill?: string;\n\t/** Label of the listbox of selected pills in multiple selection. Defaults to the English text `Selected Options:`. */\n\tselectedListboxLabel?: string;\n}\n\nexport interface ComboboxLabels {\n\t/** First menu item of a single-select `readonly` combobox; choosing it clears the selection. Defaults to the English text `None`. */\n\tdeselectOption?: string;\n\t/** Visible label above the input. */\n\tlabel?: ReactNode | string;\n\t/** Cancel button in the `popover` variant's footer. Defaults to the English text `Cancel`. */\n\tcancelButton?: string;\n\t/** Done button in the `popover` variant's footer. Defaults to the English text `Done`. */\n\tdoneButton?: string;\n\t/** Input text of a multiple-selection `readonly` combobox with more than one option selected. Defaults to the English text `<n> options selected`. */\n\tmultipleOptionsSelected?: string;\n\t/** Shown in the menu when no options match. Defaults to the English text `No matches found.`. */\n\tnoOptionsFound?: ReactNode | string;\n\t/** Input placeholder. */\n\tplaceholder?: string;\n\t/** Input placeholder of the `readonly` variant. Defaults to the English text `Select an Option`. */\n\tplaceholderReadOnly?: string;\n\t/** Title of each pill's remove icon. Defaults to the English text `Remove`. */\n\tremovePillTitle?: string;\n\t/** Tooltip for disabled options. Defaults to the English text `This option is disabled.`. */\n\toptionDisabledTooltipLabel?: string;\n\t/** Title of the search icon in the input. */\n\tinputIconTitle?: string;\n}\n\nexport interface ComboboxEvents {\n\tonBlur?: (event: React.FocusEvent) => void;\n\tonChange?: (\n\t\tevent: React.ChangeEvent<HTMLInputElement>,\n\t\tdata: { value: string }\n\t) => void;\n\t/**\n\t * Fires after the menu has closed (uncontrolled), or when a controlled\n\t * `isOpen` changes to `false`. `event` is the event of the close request,\n\t * when there was one.\n\t */\n\tonClose?: (\n\t\tevent: React.SyntheticEvent | undefined,\n\t\tdata: Record<string, unknown>\n\t) => void;\n\tonFocus?: (event: React.FocusEvent, data: Record<string, unknown>) => void;\n\t/** Fires after the menu has opened and rendered, controlled or not. */\n\tonOpen?: (\n\t\tevent: React.SyntheticEvent | undefined,\n\t\tdata: Record<string, unknown>\n\t) => void;\n\t/**\n\t * Fires when the user asks to close the menu (Escape, blur, selecting an\n\t * option, the popover buttons). With a controlled `isOpen`, set it to\n\t * `false` to close.\n\t */\n\tonRequestClose?: (\n\t\tevent: React.SyntheticEvent,\n\t\tdata: Record<string, unknown>\n\t) => void;\n\t/**\n\t * Fires when the user asks to open the menu (typing, clicking the input,\n\t * Down, Enter) while it is closed. With a controlled `isOpen`, set it to\n\t * `true` to open.\n\t */\n\tonRequestOpen?: (\n\t\tevent: React.SyntheticEvent | undefined,\n\t\tdata: Record<string, unknown>\n\t) => void;\n\tonRequestRemoveSelectedOption?: (\n\t\tevent: React.SyntheticEvent,\n\t\tdata: { selection: ComboboxOption[] }\n\t) => void;\n\t/**\n\t * Fires with the requested selection when an option is chosen. `selection`\n\t * is controlled, so update it to accept the change.\n\t */\n\tonSelect?: (\n\t\tevent: React.SyntheticEvent,\n\t\tdata: { selection: ComboboxOption[] }\n\t) => void;\n\t/** Fires when an `optionsSearchEntity` or `optionsAddItem` row is chosen by\n\t * click or Enter. `value` is the current input text. */\n\tonSelectActionItem?: (\n\t\tevent: React.MouseEvent | React.KeyboardEvent,\n\t\tdata: { option: ComboboxActionItem; value: string }\n\t) => void;\n\tonSubmit?: (event: React.KeyboardEvent, data: { value: string }) => void;\n}\n\n/**\n * An action row in the menu: `optionsSearchEntity` items render above the\n * options, `optionsAddItem` items below them. Choosing one (click or Enter)\n * calls `events.onSelectActionItem` and closes the menu. Action rows are\n * commands, not records, so they never fire `onSelect` or enter the selection.\n */\nexport interface ComboboxActionItem {\n\tid?: string;\n\ticon?: ComboboxOptionIcon;\n\tlabel?: string | ((searchTerm: string) => ReactNode);\n\tdisabled?: boolean;\n\t/** @deprecated Use `events.onSelectActionItem`. If both are set, both are\n\t * called, this one first. */\n\tonClick?: (\n\t\tevent: React.MouseEvent | React.KeyboardEvent,\n\t\tdata: { option: ComboboxActionItem }\n\t) => void;\n}\n\n// A menu row built from a `ComboboxActionItem`. The original item is stored\n// under a module-private symbol, so consumer data in `options` (which may come\n// from untyped JS and carry arbitrary keys) can't impersonate one.\nconst ACTION_ITEM = Symbol('actionItem');\n\ntype ActionItemRow = ComboboxActionOption & {\n\t[ACTION_ITEM]: ComboboxActionItem;\n};\n\nconst isActionItemRow = (option: ComboboxOption): option is ActionItemRow =>\n\tACTION_ITEM in option;\n\nconst toActionItemRow = (\n\titem: ComboboxActionItem,\n\ttype: ActionItemRow['type']\n): ActionItemRow => ({\n\tid: item.id || '',\n\ticon: item.icon,\n\tlabel: item.label,\n\tdisabled: item.disabled,\n\ttype,\n\t[ACTION_ITEM]: item,\n});\n\n/**\n * Argument passed to `renderMenuItem`\n */\nexport interface ComboboxRenderMenuItemData extends ComboboxMenuRenderMenuItemData {\n\t/** The combobox's assistive text */\n\tassistiveText: ComboboxAssistiveText;\n}\n\n/**\n * Component accepted by the deprecated `onRenderMenuItem` and `menuItem` props\n */\ntype ComboboxLegacyMenuItem = React.ComponentType<{\n\tassistiveText?: ComboboxAssistiveText;\n\tselected: boolean;\n\t/** Custom renderers only receive selectable rows */\n\toption: ComboboxItemOption | ComboboxDeselectOption;\n}>;\n\ninterface ComboboxBaseProps {\n\t/** aria-describedby attribute */\n\t'aria-describedby'?: string;\n\t/** CSS classes for combobox container */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** CSS classes for top level container */\n\tclassNameContainer?: string | string[] | Record<string, boolean>;\n\t/** CSS classes for dropdown menu */\n\tclassNameMenu?: string | string[] | Record<string, boolean>;\n\t/** CSS classes for menu sub header */\n\tclassNameMenuSubHeader?: string | string[] | Record<string, boolean>;\n\t/**\n\t * Initial open state when `isOpen` is not set. Ignored when `isOpen` is\n\t * set.\n\t */\n\tdefaultIsOpen?: boolean;\n\t/** Disables the input and keeps the menu closed. Applies to every variant. */\n\tdisabled?: boolean;\n\t/** Entity combobox for grouped comboboxes */\n\tentityCombobox?: ReactNode;\n\t/** Error text to display */\n\terrorText?: string;\n\t/** Event callbacks */\n\tevents?: ComboboxEvents;\n\t/** Field level help tooltip */\n\tfieldLevelHelpTooltip?: ReactNode;\n\t/** Whether to show deselect option */\n\thasDeselect?: boolean;\n\t/** Whether to show input spinner */\n\thasInputSpinner?: boolean;\n\t/** Whether to show menu spinner */\n\thasMenuSpinner?: boolean;\n\t/** Whether to use static alignment */\n\thasStaticAlignment?: boolean;\n\t/** HTML id */\n\tid?: string;\n\t/** Sets dialog width inheritance */\n\tinheritWidthOf?: 'target' | 'menu' | 'none';\n\t/**\n\t * An `Input` element whose props are passed to the combobox's input. They win over the\n\t * combobox's own, except `onChange`, which is called with `(event, { value })` alongside\n\t * the combobox's handler.\n\t */\n\tinput?: ReactElement<Partial<InputProps>>;\n\t/** Callback to get input ref */\n\tinputRef?: (ref: HTMLInputElement | null) => void;\n\t/**\n\t * Whether the menu is open. Leave unset to let the combobox open and close\n\t * itself (start state from `defaultIsOpen`). When set, the combobox only\n\t * reports open and close requests through `events.onRequestOpen` and\n\t * `events.onRequestClose`; update `isOpen` to act on them.\n\t */\n\tisOpen?: boolean;\n\t/** Text labels */\n\tlabels?: ComboboxLabels;\n\t/** Menu item visible length */\n\tmenuItemVisibleLength?: 5 | 7 | 10;\n\t/** Menu max width */\n\tmenuMaxWidth?: string;\n\t/** Menu position */\n\tmenuPosition?: 'absolute' | 'overflowBoundaryElement' | 'relative';\n\t/** Whether multiple selection is allowed */\n\tmultiple?: boolean;\n\t/**\n\t * @deprecated Use `renderMenuItem`, which is called as a function with\n\t * `{ assistiveText, isSelected, option }`.\n\t */\n\tonRenderMenuItem?: ComboboxLegacyMenuItem;\n\t/** Action items shown below the options, such as \"New Account\" */\n\toptionsAddItem?: ComboboxActionItem[];\n\t/** Action items shown above the options, such as \"Search in Accounts\" */\n\toptionsSearchEntity?: ComboboxActionItem[];\n\t/** Whether only predefined options are allowed */\n\tpredefinedOptionsOnly?: boolean;\n\t/** Whether field is required */\n\trequired?: boolean;\n\t/**\n\t * Selected options. Controlled: `events.onSelect` and\n\t * `events.onRequestRemoveSelectedOption` report the requested selection;\n\t * update `selection` to accept it.\n\t */\n\tselection: ComboboxOption[];\n\t/** Callback to get selected listbox ref */\n\tselectedListboxRef?: (ref: HTMLUListElement | null) => void;\n\t/** @deprecated Use `disabled`, which now disables the input in every variant. */\n\tsingleInputDisabled?: boolean;\n\t/**\n\t * A `Tooltip` element shown on disabled menu items. Its props win over the combobox's\n\t * defaults; an option's `tooltipContent` wins over its `content`.\n\t */\n\ttooltipMenuItemDisabled?: ReactElement<Partial<TooltipProps>>;\n\t/**\n\t * Text in the input. Controlled: update it from `events.onChange`.\n\t * (`defaultValue` was removed in v11.)\n\t */\n\tvalue?: string;\n\t/**\n\t * Renders each option's content in place of the default label and icon.\n\t * Receives `{ assistiveText, isSelected, option }`.\n\t */\n\trenderMenuItem?: (data: ComboboxRenderMenuItemData) => ReactNode;\n\t/** @deprecated Use `renderMenuItem` instead. */\n\tmenuItem?: ComboboxLegacyMenuItem;\n}\n\n/**\n * `variant` decides where the menu content comes from: `options` for the\n * listbox variants, or a custom `popover` dialog.\n */\nexport type ComboboxVariantProps =\n\t| {\n\t\t\t/**\n\t\t\t * Listbox variants. Defaults to `base`. `inline-listbox` with\n\t\t\t * `multiple` is deprecated (SLDS deprecated the inline listbox):\n\t\t\t * use `base` with `multiple`, which lists the selections after the input.\n\t\t\t */\n\t\t\tvariant?: 'base' | 'inline-listbox' | 'readonly';\n\t\t\t/** Assistive text for accessibility */\n\t\t\tassistiveText?: ComboboxAssistiveText;\n\t\t\t/** Menu options */\n\t\t\toptions: ComboboxOption[];\n\t\t\tpopover?: never;\n\t }\n\t| {\n\t\t\t/** Custom dialog content instead of a listbox */\n\t\t\tvariant: 'popover';\n\t\t\t/** Assistive text for accessibility. `popoverLabel` labels the dialog. */\n\t\t\tassistiveText: ComboboxAssistiveText & { popoverLabel: string };\n\t\t\toptions?: never;\n\t\t\t/**\n\t\t\t * A `Popover` element rendered as the dialog. Its props win over the combobox's\n\t\t\t * defaults, except `body`, which the combobox wraps, and `children`, which the\n\t\t\t * combobox replaces with its input.\n\t\t\t */\n\t\t\tpopover: ReactElement<Partial<PopoverProps>>;\n\t };\n\nexport type ComboboxProps = ComboboxBaseProps & ComboboxVariantProps;\n\n// ===== Default Props =====\n\nconst defaultAssistiveText: Required<ComboboxAssistiveText> = {\n\tlabel: '',\n\tloadingMenuItems: 'Loading',\n\toptionSelectedInMenu: 'Current Selection:',\n\tpopoverLabel: '',\n\tremoveSingleSelectedOption: 'Remove selected option',\n\tremovePill: ', Press delete or backspace to remove',\n\tselectedListboxLabel: 'Selected Options:',\n};\n\nconst defaultLabels: Required<ComboboxLabels> = {\n\tdeselectOption: 'None',\n\tlabel: '',\n\tcancelButton: 'Cancel',\n\tdoneButton: 'Done',\n\tmultipleOptionsSelected: '',\n\tnoOptionsFound: 'No matches found.',\n\tplaceholder: '',\n\tplaceholderReadOnly: 'Select an Option',\n\tremovePillTitle: 'Remove',\n\toptionDisabledTooltipLabel: 'This option is disabled.',\n\tinputIconTitle: '',\n};\n\n// ===== Component =====\n\n/**\n * An input field that is either an autocomplete or read-only, with a listbox of\n * predefined options.\n */\nconst Combobox: React.FC<ComboboxProps> = (props) => {\n\tconst {\n\t\tassistiveText: assistiveTextProp = {},\n\t\t'aria-describedby': ariaDescribedby,\n\t\tclassName,\n\t\tclassNameContainer,\n\t\tclassNameMenu,\n\t\tclassNameMenuSubHeader,\n\t\tdefaultIsOpen,\n\t\tdisabled,\n\t\tentityCombobox,\n\t\terrorText,\n\t\tevents: eventsProp,\n\t\tfieldLevelHelpTooltip,\n\t\thasDeselect,\n\t\thasInputSpinner,\n\t\thasMenuSpinner,\n\t\thasStaticAlignment,\n\t\tid: idProp,\n\t\tinheritWidthOf = 'target',\n\t\tinput,\n\t\tinputRef: inputRefCallback,\n\t\tisOpen: isOpenProp,\n\t\tlabels: labelsProp = {},\n\t\tmenuItemVisibleLength,\n\t\tmenuMaxWidth,\n\t\tmenuPosition = 'absolute',\n\t\tmultiple,\n\t\tonRenderMenuItem,\n\t\toptions = [],\n\t\toptionsAddItem = [],\n\t\toptionsSearchEntity = [],\n\t\tpopover,\n\t\tpredefinedOptionsOnly,\n\t\trequired = false,\n\t\tselection = [],\n\t\tselectedListboxRef: selectedListboxRefCallback,\n\t\tsingleInputDisabled = false,\n\t\ttooltipMenuItemDisabled,\n\t\tvalue,\n\t\tvariant = 'base',\n\t\trenderMenuItem: renderMenuItemProp,\n\t\tmenuItem,\n\t} = props;\n\n\t// Merge with defaults\n\tconst assistiveText = assign({}, defaultAssistiveText, assistiveTextProp);\n\tconst labels = assign({}, defaultLabels, labelsProp);\n\t// Handlers read the latest `events`, so a new `events` object each render doesn't rebuild them\n\tconst eventsRef = useLatestRef<ComboboxEvents>(eventsProp ?? {});\n\n\t// Context\n\tconst iconSettingsContext = useContext(IconSettingsContext);\n\n\t// Refs\n\tconst inputRef = useRef<HTMLInputElement | null>(null);\n\tconst menuRef = useRef<HTMLUListElement | null>(null);\n\tconst selectedListboxRef = useRef<HTMLUListElement | null>(null);\n\tconst activeSelectedOptionRef = useRef<HTMLElement | null>(null);\n\tconst buttonRef = useRef<HTMLButtonElement | null>(null);\n\tconst menuKeyBuffer = useRef(new KeyBuffer());\n\n\t// Generated IDs\n\tconst generatedId = useId();\n\tconst generatedErrorId = useId();\n\tconst getId = useCallback(() => idProp || generatedId, [idProp, generatedId]);\n\tconst deselectId = `${getId()}-deselect`;\n\n\t// State\n\tconst [activeOption, setActiveOption] = useState<ComboboxOption | undefined>(\n\t\tundefined\n\t);\n\tconst [activeOptionIndex, setActiveOptionIndex] = useState(-1);\n\tconst [activeSelectedOptionIndex, setActiveSelectedOptionIndex] = useState(0);\n\t// Keep the active pill, and so its roving tabindex, inside `selection`. When\n\t// a controlled parent shrinks `selection` through any path other than the\n\t// built-in remove handler, an index past the end would leave no pill with\n\t// tabindex=0 and the selected-pill listbox unreachable by keyboard (WCAG\n\t// 2.1.1 / 2.4.3). An emptied selection starts again from the first pill.\n\tconst maxSelectedOptionIndex = Math.max(selection.length - 1, 0);\n\tif (activeSelectedOptionIndex > maxSelectedOptionIndex) {\n\t\tsetActiveSelectedOptionIndex(maxSelectedOptionIndex);\n\t}\n\tconst activeSelectedOption = selection[activeSelectedOptionIndex];\n\tconst [listboxHasFocus, setListboxHasFocus] = useState(false);\n\t// `isOpen` is ephemeral UI state: controlled when the prop is set,\n\t// otherwise internal and seeded by `defaultIsOpen`.\n\tconst [isOpen, setIsOpen, isOpenControlled] = useControllableState(\n\t\tisOpenProp,\n\t\tdefaultIsOpen ?? false\n\t);\n\t// Latest `isOpen` for close requests made from timers and for swallowing a\n\t// duplicate request within one event.\n\tconst isOpenRef = useRef(isOpen);\n\tuseEffect(() => {\n\t\tisOpenRef.current = isOpen;\n\t}, [isOpen]);\n\t// Event of the latest close request, reported by `events.onClose`.\n\tconst closeEventRef = useRef<React.SyntheticEvent | undefined>(undefined);\n\t// Reset the highlighted option whenever the menu closes, however it closed.\n\tconst [prevIsOpen, setPrevIsOpen] = useState(isOpen);\n\tif (prevIsOpen !== isOpen) {\n\t\tsetPrevIsOpen(isOpen);\n\t\tif (!isOpen) {\n\t\t\tsetActiveOption(undefined);\n\t\t\tsetActiveOptionIndex(-1);\n\t\t}\n\t}\n\tconst [inputRendered, setInputRendered] = useState(false);\n\n\t// Check props on mount\n\tuseEffect(() => {\n\t\tcheckProps(\n\t\t\tCOMBOBOX,\n\t\t\tprops as unknown as Record<string, unknown>,\n\t\t\tcomponentDoc\n\t\t);\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, []);\n\n\t// Derived state\n\t// `singleInputDisabled` is the deprecated name for `disabled`.\n\tconst isInputDisabled = !!(disabled || singleInputDisabled);\n\tconst getIsOpen = useCallback(() => !!isOpen, [isOpen]);\n\n\tconst getIsActiveOption = useCallback(() => {\n\t\treturn activeOption && activeOptionIndex !== -1;\n\t}, [activeOption, activeOptionIndex]);\n\n\tconst getErrorId = useCallback(() => {\n\t\treturn ariaDescribedby || (errorText && generatedErrorId);\n\t}, [ariaDescribedby, errorText, generatedErrorId]);\n\n\t// Build options list\n\tconst getOptions = useCallback(() => {\n\t\tconst deselectOption: ComboboxOption = {\n\t\t\tid: deselectId,\n\t\t\tlabel: labels.deselectOption,\n\t\t\tvalue: '',\n\t\t\ttype: 'deselect',\n\t\t};\n\n\t\tconst localOptionsSearchEntity = optionsSearchEntity.map((item) =>\n\t\t\ttoActionItemRow(item, 'header')\n\t\t);\n\n\t\tconst localOptionsAddItem = optionsAddItem.map((item) =>\n\t\t\ttoActionItemRow(item, 'footer')\n\t\t);\n\n\t\treturn [\n\t\t\t...(localOptionsSearchEntity.length > 0 ? localOptionsSearchEntity : []),\n\t\t\t...(hasDeselect ? [deselectOption] : []),\n\t\t\t...(options && options.length > 0 ? options : []),\n\t\t\t...(localOptionsAddItem.length > 0 ? localOptionsAddItem : []),\n\t\t];\n\t}, [\n\t\tdeselectId,\n\t\tlabels.deselectOption,\n\t\toptionsSearchEntity,\n\t\toptionsAddItem,\n\t\thasDeselect,\n\t\toptions,\n\t]);\n\n\t// When the options change, keep the highlight on the same option, or clear\n\t// it if that option is gone. Only sets state when the index is out of date,\n\t// so it settles after one extra render.\n\tif (activeOption) {\n\t\tconst index = findIndex(getOptions(), (item) =>\n\t\t\tisEqual(item, activeOption)\n\t\t);\n\t\tif (index === -1) {\n\t\t\tsetActiveOption(undefined);\n\t\t\tsetActiveOptionIndex(-1);\n\t\t} else if (index !== activeOptionIndex) {\n\t\t\tsetActiveOptionIndex(index);\n\t\t}\n\t}\n\n\tconst isSelected = useCallback(\n\t\t({\n\t\t\tselection: sel,\n\t\t\toption,\n\t\t}: {\n\t\t\tselection: ComboboxOption[];\n\t\t\toption: ComboboxOption;\n\t\t}) => {\n\t\t\treturn !!find(sel, option);\n\t\t},\n\t\t[]\n\t);\n\n\t// Get new active option index (for navigation)\n\tconst getNewActiveOptionIndex = useCallback(\n\t\t({\n\t\t\tactiveOptionIndex: currentIndex,\n\t\t\toffset,\n\t\t\toptions: opts,\n\t\t}: {\n\t\t\tactiveOptionIndex: number;\n\t\t\toffset: number;\n\t\t\toptions: ComboboxOption[];\n\t\t}) => {\n\t\t\t// Skip every separator in a row (`addSubheadings` keeps the\n\t\t\t// subheading of a category with no matches, so two can be adjacent),\n\t\t\t// and stay put when no option is left in that direction.\n\t\t\tlet newIndex = currentIndex + offset;\n\t\t\twhile (\n\t\t\t\tnewIndex >= 0 &&\n\t\t\t\tnewIndex < opts.length &&\n\t\t\t\topts[newIndex].type === 'separator'\n\t\t\t) {\n\t\t\t\tnewIndex += offset;\n\t\t\t}\n\t\t\treturn newIndex >= 0 && newIndex < opts.length ? newIndex : currentIndex;\n\t\t},\n\t\t[]\n\t);\n\n\t// ===== Event Handlers =====\n\n\t// Every internal close path (Escape, blur, selecting an option, the popover\n\t// buttons, a click outside) goes through `requestClose`. It reports the\n\t// request through `events.onRequestClose` and closes only when `isOpen` is\n\t// uncontrolled; a controlled `isOpen` closes when the parent updates it.\n\tconst requestClose = useCallback(\n\t\t(event?: React.SyntheticEvent, { trigger }: { trigger?: string } = {}) => {\n\t\t\tif (isOpenRef.current) {\n\t\t\t\tif (!isOpenControlled) {\n\t\t\t\t\t// Swallow a second request in the same event (for example\n\t\t\t\t\t// Escape handled by both the input and the popover).\n\t\t\t\t\tisOpenRef.current = false;\n\t\t\t\t}\n\t\t\t\tcloseEventRef.current = event;\n\n\t\t\t\tif (variant === 'popover' && trigger === 'cancel') {\n\t\t\t\t\tconst popoverProps = popover?.props as\n\t\t\t\t\t\t| { onClose?: (event: unknown, data: { trigger: string }) => void }\n\t\t\t\t\t\t| undefined;\n\t\t\t\t\tif (popoverProps?.onClose) {\n\t\t\t\t\t\tpopoverProps.onClose(event, { trigger });\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (eventsRef.current.onRequestClose) {\n\t\t\t\t\teventsRef.current.onRequestClose(event as React.SyntheticEvent, {});\n\t\t\t\t}\n\n\t\t\t\tsetIsOpen(false);\n\t\t\t}\n\t\t},\n\t\t[isOpenControlled, variant, popover, eventsRef, setIsOpen]\n\t);\n\n\t// Called by the menu `Dialog` (or `Popover`) once it has rendered, so\n\t// `events.onOpen` fires on a real open whether `isOpen` is controlled or not.\n\tconst handleOpen = useCallback(\n\t\t(event?: React.SyntheticEvent, data?: Record<string, unknown>) => {\n\t\t\tcurrentOpenDropdown = { handleClose: requestClose };\n\n\t\t\tif (eventsRef.current.onOpen) {\n\t\t\t\teventsRef.current.onOpen(event, data || {});\n\t\t\t}\n\n\t\t\tif (variant === 'readonly') {\n\t\t\t\tconst opts = getOptions();\n\t\t\t\tconst idx = findIndex(opts, (item) => isEqual(item, selection[0]));\n\n\t\t\t\tsetActiveOptionIndex(idx);\n\t\t\t\tsetActiveOption(selection[0]);\n\n\t\t\t\tif (menuRef.current !== null) {\n\t\t\t\t\tmenuItemSelectScroll({\n\t\t\t\t\t\tcontainer: menuRef.current,\n\t\t\t\t\t\tfocusedIndex: idx,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[requestClose, eventsRef, variant, getOptions, selection]\n\t);\n\n\t// Every internal open path (typing, clicking the input, Down, Enter) goes\n\t// through `requestOpen`. It reports the request through\n\t// `events.onRequestOpen` and opens only when `isOpen` is uncontrolled.\n\tconst requestOpen = useCallback(\n\t\t(event?: React.SyntheticEvent) => {\n\t\t\tif (!isOpen) {\n\t\t\t\tif (eventsRef.current.onRequestOpen) {\n\t\t\t\t\teventsRef.current.onRequestOpen(event, {});\n\t\t\t\t}\n\t\t\t\tsetIsOpen(true);\n\t\t\t}\n\t\t},\n\t\t[isOpen, eventsRef, setIsOpen]\n\t);\n\n\tconst requestOpenMenu = useCallback(\n\t\t(event?: React.SyntheticEvent) => {\n\t\t\tconst isInlineSingleSelectionAndIsNotSelected =\n\t\t\t\t!multiple && selection.length === 0 && variant === 'inline-listbox';\n\n\t\t\tif (\n\t\t\t\tisInlineSingleSelectionAndIsNotSelected ||\n\t\t\t\tmultiple ||\n\t\t\t\tvariant === 'readonly'\n\t\t\t) {\n\t\t\t\trequestOpen(event);\n\t\t\t}\n\t\t},\n\t\t[multiple, selection.length, variant, requestOpen]\n\t);\n\n\tconst handleSelect = useCallback(\n\t\t(\n\t\t\tevent: React.SyntheticEvent,\n\t\t\t{\n\t\t\t\tselection: sel,\n\t\t\t\toption,\n\t\t\t}: { selection: ComboboxOption[]; option: ComboboxOption }\n\t\t) => {\n\t\t\t// A separator is a subheading, never a selectable option\n\t\t\tif (option.type === 'separator') {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (isActionItemRow(option)) {\n\t\t\t\tconst actionItem = option[ACTION_ITEM];\n\t\t\t\tconst actionEvent = event as React.MouseEvent | React.KeyboardEvent;\n\t\t\t\tactionItem.onClick?.(actionEvent, { option: actionItem });\n\t\t\t\teventsRef.current.onSelectActionItem?.(actionEvent, {\n\t\t\t\t\toption: actionItem,\n\t\t\t\t\tvalue: value ?? '',\n\t\t\t\t});\n\t\t\t\trequestClose(event);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet newSelection: ComboboxOption[];\n\t\t\tconst selected = isSelected({ selection: sel, option });\n\t\t\tconst singleSelectAndSelectedWasNotClicked = !multiple && !selected;\n\t\t\tconst multiSelectAndSelectedWasNotClicked = multiple && !selected;\n\t\t\tconst deselectWasClicked = option.id === deselectId;\n\n\t\t\tif (deselectWasClicked) {\n\t\t\t\tnewSelection = [];\n\t\t\t} else if (singleSelectAndSelectedWasNotClicked) {\n\t\t\t\tnewSelection = [option];\n\t\t\t} else if (multiSelectAndSelectedWasNotClicked) {\n\t\t\t\tnewSelection = [...selection, option];\n\t\t\t} else {\n\t\t\t\tnewSelection = reject(selection, option);\n\t\t\t}\n\n\t\t\tif (eventsRef.current.onSelect) {\n\t\t\t\teventsRef.current.onSelect(event, { selection: newSelection });\n\t\t\t}\n\n\t\t\trequestClose(event);\n\t\t},\n\t\t[\n\t\t\tisSelected,\n\t\t\tmultiple,\n\t\t\tdeselectId,\n\t\t\tselection,\n\t\t\teventsRef,\n\t\t\trequestClose,\n\t\t\tvalue,\n\t\t]\n\t);\n\n\tconst handleInputBlur = useCallback(\n\t\t(event: React.FocusEvent) => {\n\t\t\tsetTimeout(() => {\n\t\t\t\tconst activeElement = documentDefined ? document.activeElement : null;\n\t\t\t\tif (\n\t\t\t\t\tactiveElement &&\n\t\t\t\t\tactiveElement.tagName === 'DIV' &&\n\t\t\t\t\tactiveElement.id === `${getId()}-listbox`\n\t\t\t\t) {\n\t\t\t\t\tif (inputRef.current) {\n\t\t\t\t\t\tinputRef.current.focus();\n\t\t\t\t\t}\n\t\t\t\t} else if (!popover) {\n\t\t\t\t\trequestClose(event);\n\t\t\t\t}\n\t\t\t}, 200);\n\n\t\t\tif (eventsRef.current.onBlur) {\n\t\t\t\teventsRef.current.onBlur(event);\n\t\t\t}\n\t\t},\n\t\t[getId, popover, requestClose, eventsRef]\n\t);\n\n\tconst handleInputChange = useCallback(\n\t\t(event: React.ChangeEvent<HTMLInputElement>) => {\n\t\t\trequestOpenMenu(event);\n\t\t\tif (eventsRef.current.onChange) {\n\t\t\t\teventsRef.current.onChange(event, { value: event.target.value });\n\t\t\t}\n\t\t},\n\t\t[requestOpenMenu, eventsRef]\n\t);\n\n\tconst handleInputFocus = useCallback(\n\t\t(event: React.FocusEvent) => {\n\t\t\tif (eventsRef.current.onFocus) {\n\t\t\t\teventsRef.current.onFocus(event, {});\n\t\t\t}\n\t\t},\n\t\t[eventsRef]\n\t);\n\n\tconst handleInputSubmit = useCallback(\n\t\t(event: React.KeyboardEvent) => {\n\t\t\tif (activeOption === undefined && activeOptionIndex === -1) {\n\t\t\t\tif (!isOpen) {\n\t\t\t\t\tif (!event.shiftKey) {\n\t\t\t\t\t\trequestOpen(event);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\trequestClose(event, { trigger: 'cancel' });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (activeOption?.disabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Legacy: `type: 'header' | 'footer'` rows passed directly in `options`\n\t\t\t// keep their pre-v11 Enter behavior of calling `option.onClick`.\n\t\t\tif (\n\t\t\t\tactiveOption &&\n\t\t\t\t!isActionItemRow(activeOption) &&\n\t\t\t\t(activeOption.type === 'header' || activeOption.type === 'footer')\n\t\t\t) {\n\t\t\t\tactiveOption.onClick?.(event as unknown as React.MouseEvent);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (activeOption && getIsActiveOption()) {\n\t\t\t\thandleSelect(event, {\n\t\t\t\t\toption: activeOption,\n\t\t\t\t\tselection,\n\t\t\t\t});\n\t\t\t} else if (\n\t\t\t\t!predefinedOptionsOnly &&\n\t\t\t\t(event.target as HTMLInputElement).value !== '' &&\n\t\t\t\teventsRef.current.onSubmit\n\t\t\t) {\n\t\t\t\teventsRef.current.onSubmit(event, {\n\t\t\t\t\tvalue: (event.target as HTMLInputElement).value,\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\t[\n\t\t\tactiveOption,\n\t\t\tactiveOptionIndex,\n\t\t\tisOpen,\n\t\t\trequestOpen,\n\t\t\trequestClose,\n\t\t\tgetIsActiveOption,\n\t\t\thandleSelect,\n\t\t\tselection,\n\t\t\tpredefinedOptionsOnly,\n\t\t\teventsRef,\n\t\t]\n\t);\n\n\tconst handleNavigateListboxMenu = useCallback(\n\t\t(\n\t\t\tevent: React.KeyboardEvent,\n\t\t\t{ direction }: { direction: 'next' | 'previous' }\n\t\t) => {\n\t\t\tconst offsets = { next: 1, previous: -1 };\n\t\t\tconst opts = getOptions();\n\t\t\tconst newIndex = getNewActiveOptionIndex({\n\t\t\t\tactiveOptionIndex,\n\t\t\t\toffset: offsets[direction],\n\t\t\t\toptions: opts,\n\t\t\t});\n\n\t\t\tif (getIsOpen() && menuRef.current) {\n\t\t\t\tmenuItemSelectScroll({\n\t\t\t\t\tcontainer: menuRef.current,\n\t\t\t\t\tfocusedIndex: newIndex,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tsetActiveOption(opts[newIndex]);\n\t\t\tsetActiveOptionIndex(newIndex);\n\t\t},\n\t\t[getOptions, getNewActiveOptionIndex, activeOptionIndex, getIsOpen]\n\t);\n\n\tconst handleNavigateSelectedListbox = useCallback(\n\t\t(\n\t\t\tevent: React.SyntheticEvent,\n\t\t\t{ direction }: { direction: 'next' | 'previous' }\n\t\t) => {\n\t\t\tconst offsets = { next: 1, previous: -1 };\n\t\t\tconst isLastOptionAndRightIsPressed =\n\t\t\t\tactiveSelectedOptionIndex + 1 === selection.length &&\n\t\t\t\tdirection === 'next';\n\t\t\tconst isFirstOptionAndLeftIsPressed =\n\t\t\t\tactiveSelectedOptionIndex === 0 && direction === 'previous';\n\n\t\t\tif (isLastOptionAndRightIsPressed) {\n\t\t\t\tsetActiveSelectedOptionIndex(0);\n\t\t\t\tsetListboxHasFocus(true);\n\t\t\t} else if (isFirstOptionAndLeftIsPressed) {\n\t\t\t\tsetActiveSelectedOptionIndex(selection.length - 1);\n\t\t\t\tsetListboxHasFocus(true);\n\t\t\t} else {\n\t\t\t\tconst newIndex = getNewActiveOptionIndex({\n\t\t\t\t\tactiveOptionIndex: activeSelectedOptionIndex,\n\t\t\t\t\toffset: offsets[direction],\n\t\t\t\t\toptions: selection,\n\t\t\t\t});\n\t\t\t\tsetActiveSelectedOptionIndex(newIndex);\n\t\t\t\tsetListboxHasFocus(true);\n\t\t\t}\n\t\t},\n\t\t[activeSelectedOptionIndex, selection, getNewActiveOptionIndex]\n\t);\n\n\tconst handleKeyDownDown = useCallback(\n\t\t(event: React.KeyboardEvent) => {\n\t\t\tif (!event.shiftKey) {\n\t\t\t\trequestOpen(event);\n\t\t\t}\n\n\t\t\tif (variant !== 'popover') {\n\t\t\t\thandleNavigateListboxMenu(event, { direction: 'next' });\n\t\t\t}\n\t\t},\n\t\t[requestOpen, variant, handleNavigateListboxMenu]\n\t);\n\n\tconst handleKeyDownUp = useCallback(\n\t\t(event: React.KeyboardEvent) => {\n\t\t\tif (!event.shiftKey && getIsOpen()) {\n\t\t\t\thandleNavigateListboxMenu(event, { direction: 'previous' });\n\t\t\t}\n\t\t},\n\t\t[getIsOpen, handleNavigateListboxMenu]\n\t);\n\n\tconst handleKeyDownTab = useCallback(() => {\n\t\tif (selectedListboxRef.current) {\n\t\t\tsetListboxHasFocus(true);\n\t\t}\n\t}, []);\n\n\tconst handleKeyDownOther = useCallback(\n\t\t(event: React.KeyboardEvent) => {\n\t\t\tconst opts = getOptions();\n\t\t\tconst newActiveOptionIndex = keyLetterMenuItemSelect({\n\t\t\t\tkey: event.key,\n\t\t\t\tkeyBuffer: menuKeyBuffer.current,\n\t\t\t\toptions: opts,\n\t\t\t});\n\n\t\t\tif (newActiveOptionIndex !== undefined) {\n\t\t\t\tif (getIsOpen() && menuRef.current) {\n\t\t\t\t\tmenuItemSelectScroll({\n\t\t\t\t\t\tcontainer: menuRef.current,\n\t\t\t\t\t\tfocusedIndex: newActiveOptionIndex,\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tsetActiveOption(opts[newActiveOptionIndex]);\n\t\t\t\tsetActiveOptionIndex(newActiveOptionIndex);\n\t\t\t}\n\t\t},\n\t\t[getOptions, getIsOpen]\n\t);\n\n\tconst handleKeyDown = useCallback(\n\t\t(event: React.KeyboardEvent) => {\n\t\t\tconst callbacks: Record<\n\t\t\t\tnumber | string,\n\t\t\t\t| {\n\t\t\t\t\t\tcallback: (e: React.KeyboardEvent) => void;\n\t\t\t\t\t\tstopPropagation?: boolean;\n\t\t\t\t }\n\t\t\t\t| undefined\n\t\t\t> = {\n\t\t\t\t[KEYS.DOWN]: { callback: handleKeyDownDown },\n\t\t\t\t[KEYS.ENTER]: { callback: handleInputSubmit },\n\t\t\t\t[KEYS.ESCAPE]: {\n\t\t\t\t\tcallback: requestClose as (e: React.KeyboardEvent) => void,\n\t\t\t\t},\n\t\t\t\t[KEYS.UP]: { callback: handleKeyDownUp },\n\t\t\t};\n\n\t\t\tif (variant === 'readonly') {\n\t\t\t\tif (selection.length > 2) {\n\t\t\t\t\tcallbacks[KEYS.TAB] = { callback: handleKeyDownTab };\n\t\t\t\t} else {\n\t\t\t\t\tcallbacks[KEYS.TAB] = undefined;\n\t\t\t\t}\n\t\t\t\tcallbacks.other = {\n\t\t\t\t\tcallback: handleKeyDownOther,\n\t\t\t\t\tstopPropagation: false,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst stopPropagation = getIsOpen();\n\n\t\t\tmapKeyEventCallbacks(event, { callbacks, stopPropagation });\n\t\t},\n\t\t[\n\t\t\thandleKeyDownDown,\n\t\t\thandleInputSubmit,\n\t\t\trequestClose,\n\t\t\thandleKeyDownUp,\n\t\t\tvariant,\n\t\t\tselection.length,\n\t\t\thandleKeyDownTab,\n\t\t\thandleKeyDownOther,\n\t\t\tgetIsOpen,\n\t\t]\n\t);\n\n\tconst handleBlurPill = useCallback(() => {\n\t\tsetListboxHasFocus(false);\n\t}, []);\n\n\tconst handlePillFocus = useCallback(\n\t\t(\n\t\t\tevent: React.FocusEvent,\n\t\t\t{ index }: { option: ComboboxOption; index: number }\n\t\t) => {\n\t\t\tif (!listboxHasFocus) {\n\t\t\t\tsetActiveSelectedOptionIndex(index);\n\t\t\t\tsetListboxHasFocus(true);\n\t\t\t}\n\t\t},\n\t\t[listboxHasFocus]\n\t);\n\n\tconst handleRemoveSelectedOption = useCallback(\n\t\t(\n\t\t\tevent: React.SyntheticEvent,\n\t\t\t{ option, index }: { option: ComboboxOption; index?: number }\n\t\t) => {\n\t\t\tevent.preventDefault();\n\t\t\tconst onlyOnePillAndInputExists = selection.length === 1;\n\t\t\tconst isReadOnlyAndTwoPillsExists =\n\t\t\t\tselection.length === 2 && variant === 'readonly' && multiple;\n\t\t\tconst lastPillWasRemoved =\n\t\t\t\tindex !== undefined && index + 1 === selection.length;\n\n\t\t\tif (\n\t\t\t\t(onlyOnePillAndInputExists || isReadOnlyAndTwoPillsExists) &&\n\t\t\t\tinputRef.current\n\t\t\t) {\n\t\t\t\tinputRef.current.focus();\n\t\t\t} else if (lastPillWasRemoved && index !== undefined) {\n\t\t\t\tsetActiveSelectedOptionIndex(index - 1);\n\t\t\t\tsetListboxHasFocus(true);\n\t\t\t} else if (index !== undefined) {\n\t\t\t\tsetActiveSelectedOptionIndex(index);\n\t\t\t\tsetListboxHasFocus(true);\n\t\t\t}\n\n\t\t\tif (eventsRef.current.onRequestRemoveSelectedOption) {\n\t\t\t\teventsRef.current.onRequestRemoveSelectedOption(event, {\n\t\t\t\t\tselection: reject(selection, option),\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\t[selection, variant, multiple, eventsRef]\n\t);\n\n\tconst handleRequestFocusSelectedListbox = useCallback(\n\t\t(event: React.SyntheticEvent, { ref }: { ref: HTMLElement | null }) => {\n\t\t\tif (ref) {\n\t\t\t\tactiveSelectedOptionRef.current = ref;\n\t\t\t\tactiveSelectedOptionRef.current.focus();\n\t\t\t}\n\t\t},\n\t\t[]\n\t);\n\n\t// ===== Refs =====\n\n\tconst setInputRefCallback = useCallback(\n\t\t(component: HTMLInputElement | null) => {\n\t\t\tinputRef.current = component;\n\t\t\tif (!inputRendered) {\n\t\t\t\tsetInputRendered(true);\n\t\t\t}\n\t\t\tif (inputRefCallback) {\n\t\t\t\tinputRefCallback(component);\n\t\t\t}\n\t\t},\n\t\t[inputRendered, inputRefCallback]\n\t);\n\n\tconst setSelectedListboxRefCallback = useCallback(\n\t\t(ref: HTMLUListElement | null) => {\n\t\t\tselectedListboxRef.current = ref;\n\t\t\tif (selectedListboxRefCallback) {\n\t\t\t\tselectedListboxRefCallback(ref);\n\t\t\t}\n\t\t},\n\t\t[selectedListboxRefCallback]\n\t);\n\n\tconst setMenuRefCallback = useCallback((ref: HTMLUListElement | null) => {\n\t\tmenuRef.current = ref;\n\t}, []);\n\n\tconst getTargetElement = useCallback(() => inputRef.current, []);\n\n\t// ===== Effects =====\n\n\t// `events.onClose` fires when the menu really closes: after an\n\t// uncontrolled close, or when the parent sets a controlled `isOpen` to\n\t// `false`. It does not fire for a close request a controlled parent ignores.\n\tconst wasOpenRef = useRef(isOpen);\n\tuseEffect(() => {\n\t\tif (wasOpenRef.current !== isOpen) {\n\t\t\twasOpenRef.current = isOpen;\n\t\t\tif (!isOpen) {\n\t\t\t\tif (\n\t\t\t\t\tcurrentOpenDropdown &&\n\t\t\t\t\tcurrentOpenDropdown.handleClose === requestClose\n\t\t\t\t) {\n\t\t\t\t\tcurrentOpenDropdown = undefined;\n\t\t\t\t}\n\t\t\t\tif (eventsRef.current.onClose) {\n\t\t\t\t\teventsRef.current.onClose(closeEventRef.current, {});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcloseEventRef.current = undefined;\n\t});\n\n\t// Cleanup on unmount\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\tif (\n\t\t\t\tcurrentOpenDropdown &&\n\t\t\t\tcurrentOpenDropdown.handleClose === requestClose\n\t\t\t) {\n\t\t\t\tcurrentOpenDropdown = undefined;\n\t\t\t}\n\t\t};\n\t}, [requestClose]);\n\n\t// ===== Render Helpers =====\n\n\tconst customPopoverProps = useMemo(() => {\n\t\tconst popoverPropsFromProp = popover?.props as\n\t\t\tRecord<string, unknown> | undefined;\n\t\tconst popoverBody = (\n\t\t\t<div>\n\t\t\t\t<div className=\"slds-assistive-text\" id={`${getId()}-label`}>\n\t\t\t\t\t{assistiveText.popoverLabel}\n\t\t\t\t</div>\n\t\t\t\t{popoverPropsFromProp?.body as ReactNode}\n\t\t\t</div>\n\t\t);\n\n\t\tconst popoverFooter = (\n\t\t\t<div>\n\t\t\t\t<Button\n\t\t\t\t\tlabel={labels.cancelButton}\n\t\t\t\t\tonClick={(e: React.MouseEvent) => {\n\t\t\t\t\t\trequestClose(e, { trigger: 'cancel' });\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t\t<Button\n\t\t\t\t\tlabel={labels.doneButton}\n\t\t\t\t\tvariant=\"brand\"\n\t\t\t\t\tonClick={(e: React.MouseEvent) => {\n\t\t\t\t\t\trequestClose(e);\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t);\n\n\t\tconst defaultPopoverProps: Record<string, unknown> = {\n\t\t\tariaLabelledby: `${getId()}-label`,\n\t\t\talign: 'bottom',\n\t\t\tbody: popoverBody,\n\t\t\tclassNameDialog: 'slds-popover_full-width',\n\t\t\tfooter: popoverFooter,\n\t\t\tclassNameFooter: 'slds-popover__footer_form',\n\t\t\thasNoNubbin: true,\n\t\t\tid: getId(),\n\t\t\tisOpen,\n\t\t\thasNoTriggerStyles: true,\n\t\t\tonOpen: handleOpen,\n\t\t\t// The combobox owns the popover's open state; `events.onClose` is\n\t\t\t// fired by the combobox itself when `isOpen` turns `false`.\n\t\t\tonRequestClose: (\n\t\t\t\tevent: React.SyntheticEvent,\n\t\t\t\tdata?: { trigger?: string }\n\t\t\t) => {\n\t\t\t\trequestClose(event, { trigger: data?.trigger });\n\t\t\t},\n\t\t};\n\n\t\tconst popoverProps: Record<string, unknown> = {\n\t\t\t...defaultPopoverProps,\n\t\t\t...popoverPropsFromProp,\n\t\t\tbody: popoverBody,\n\t\t};\n\n\t\tdelete popoverProps.children;\n\t\treturn popoverProps;\n\t}, [\n\t\tgetId,\n\t\tassistiveText.popoverLabel,\n\t\tlabels.cancelButton,\n\t\tlabels.doneButton,\n\t\trequestClose,\n\t\tisOpen,\n\t\thandleOpen,\n\t\tpopover,\n\t]);\n\n\t// The listbox only renders while open and enabled (see `getDialog`), so the\n\t// input must not report it as expanded or point `aria-controls` at it\n\t// otherwise.\n\tconst getIsListboxRendered = useCallback(\n\t\t() => !isInputDisabled && getIsOpen(),\n\t\t[isInputDisabled, getIsOpen]\n\t);\n\tconst getListboxControlsId = () =>\n\t\tgetIsListboxRendered() ? `${getId()}-listbox` : undefined;\n\n\t// ARIA 1.2 combobox role and state for the input. `popupId` is the id of the\n\t// rendered popup, or `undefined` while it isn't rendered.\n\tconst getComboboxAriaProps = (\n\t\tpopup: 'listbox' | 'dialog',\n\t\tpopupId: string | undefined\n\t) => ({\n\t\t'aria-controls': popupId,\n\t\t'aria-expanded': !!popupId,\n\t\t'aria-haspopup': popup,\n\t\trole: 'combobox',\n\t});\n\n\tconst getDialog = useCallback(\n\t\t({ menuRenderer }: { menuRenderer: ReactNode }) => {\n\t\t\tconst position = menuPosition;\n\n\t\t\tif (getIsListboxRendered()) {\n\t\t\t\tconst dialogProps = {\n\t\t\t\t\talign: 'bottom left' as const,\n\t\t\t\t\tcontext: iconSettingsContext,\n\t\t\t\t\thasStaticAlignment,\n\t\t\t\t\tinheritWidthOf,\n\t\t\t\t\tonMouseDown: (event: React.MouseEvent) => {\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t},\n\t\t\t\t\tonOpen: handleOpen,\n\t\t\t\t\tonRequestTargetElement: getTargetElement,\n\t\t\t\t\tposition,\n\t\t\t\t\tcontainerProps: {\n\t\t\t\t\t\tid: `${getId()}-listbox`,\n\t\t\t\t\t\trole: 'listbox',\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t\treturn (\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\t<Dialog {...(dialogProps as any)}>{menuRenderer}</Dialog>\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn null;\n\t\t},\n\t\t[\n\t\t\tmenuPosition,\n\t\t\tgetIsListboxRendered,\n\t\t\ticonSettingsContext,\n\t\t\thasStaticAlignment,\n\t\t\tinheritWidthOf,\n\t\t\thandleOpen,\n\t\t\tgetTargetElement,\n\t\t\tgetId,\n\t\t]\n\t);\n\n\t// `onRenderMenuItem` and `menuItem` are deprecated: they take a component instead of a function\n\tconst LegacyMenuItem = onRenderMenuItem || menuItem;\n\tlet renderMenuItem:\n\t\t((data: ComboboxMenuRenderMenuItemData) => ReactNode) | undefined;\n\tif (renderMenuItemProp) {\n\t\trenderMenuItem = (data) => renderMenuItemProp({ ...data, assistiveText });\n\t} else if (LegacyMenuItem) {\n\t\trenderMenuItem = ({ isSelected, option }) => (\n\t\t\t<LegacyMenuItem\n\t\t\t\tassistiveText={assistiveText}\n\t\t\t\tselected={isSelected}\n\t\t\t\toption={option}\n\t\t\t/>\n\t\t);\n\t}\n\n\tconst renderMenu = useCallback(() => {\n\t\tconst menuVariant: Record<string, 'icon-title-subtitle' | 'checkbox'> = {\n\t\t\tbase: 'icon-title-subtitle',\n\t\t\t'inline-listbox': 'icon-title-subtitle',\n\t\t\treadonly: 'checkbox',\n\t\t};\n\n\t\tconst readonlyItemVisibleLength = variant === 'readonly' ? 5 : null;\n\n\t\treturn (\n\t\t\t<Menu\n\t\t\t\tassistiveText={assistiveText}\n\t\t\t\tactiveOption={activeOption}\n\t\t\t\tactiveOptionIndex={activeOptionIndex}\n\t\t\t\tclassNameMenu={classNameMenu}\n\t\t\t\tclassNameMenuSubHeader={classNameMenuSubHeader}\n\t\t\t\tinheritWidthOf={inheritWidthOf}\n\t\t\t\tinputId={getId()}\n\t\t\t\tinputValue={value}\n\t\t\t\tisSelected={isSelected}\n\t\t\t\titemVisibleLength={menuItemVisibleLength || readonlyItemVisibleLength}\n\t\t\t\tlabels={{ noOptionsFound: labels.noOptionsFound || '' }}\n\t\t\t\thasMenuSpinner={hasMenuSpinner}\n\t\t\t\tmenuPosition={menuPosition}\n\t\t\t\tmenuRef={setMenuRefCallback}\n\t\t\t\tmaxWidth={menuMaxWidth}\n\t\t\t\toptions={getOptions()}\n\t\t\t\tonSelect={\n\t\t\t\t\thandleSelect as (\n\t\t\t\t\t\tevent: React.MouseEvent,\n\t\t\t\t\t\tdata: { option: ComboboxOption; selection?: ComboboxOption[] }\n\t\t\t\t\t) => void\n\t\t\t\t}\n\t\t\t\trenderMenuItem={renderMenuItem}\n\t\t\t\tselection={selection}\n\t\t\t\ttooltipMenuItemDisabled={tooltipMenuItemDisabled}\n\t\t\t\tvariant={menuVariant[variant]}\n\t\t\t/>\n\t\t);\n\t}, [\n\t\tvariant,\n\t\tassistiveText,\n\t\tactiveOption,\n\t\tactiveOptionIndex,\n\t\tclassNameMenu,\n\t\tclassNameMenuSubHeader,\n\t\tinheritWidthOf,\n\t\tgetId,\n\t\tvalue,\n\t\tisSelected,\n\t\tmenuItemVisibleLength,\n\t\tlabels.noOptionsFound,\n\t\thasMenuSpinner,\n\t\tmenuPosition,\n\t\tsetMenuRefCallback,\n\t\tmenuMaxWidth,\n\t\tgetOptions,\n\t\thandleSelect,\n\t\trenderMenuItem,\n\t\tselection,\n\t\ttooltipMenuItemDisabled,\n\t]);\n\n\t// The `input` element's props are spread last so they win, except `onChange`: `Input`'s\n\t// is `(event, data)` and InnerInput's is native, so call it alongside the combobox's own.\n\tconst { onChange: inputOnChange, ...userDefinedInputProps } = (input?.props ??\n\t\t{}) as Partial<InputProps> & Record<string, unknown>;\n\tconst handleInnerInputChange = useCallback(\n\t\t(event: React.ChangeEvent<HTMLInputElement>) => {\n\t\t\tinputOnChange?.(event, { value: event.target.value });\n\t\t\thandleInputChange(event);\n\t\t},\n\t\t[inputOnChange, handleInputChange]\n\t);\n\t// The single-selection variants ignore typing once an option is selected\n\tconst handleInnerInputChangeWhileUnselected = useCallback(\n\t\t(event: React.ChangeEvent<HTMLInputElement>) => {\n\t\t\tinputOnChange?.(event, { value: event.target.value });\n\t\t\tif (!selection.length) {\n\t\t\t\thandleInputChange(event);\n\t\t\t}\n\t\t},\n\t\t[inputOnChange, handleInputChange, selection.length]\n\t);\n\n\t// ===== Sub-renders =====\n\n\tconst renderBase = () => (\n\t\t<div className=\"slds-form-element__control\">\n\t\t\t<div className=\"slds-combobox_container\">\n\t\t\t\t<div\n\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t'slds-combobox',\n\t\t\t\t\t\t'slds-dropdown-trigger',\n\t\t\t\t\t\t'slds-dropdown-trigger_click',\n\t\t\t\t\t\t'ignore-react-onclickoutside',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'slds-is-open': getIsOpen(),\n\t\t\t\t\t\t\t'slds-has-error': errorText,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tclassName\n\t\t\t\t\t)}\n\t\t\t\t>\n\t\t\t\t\t<InnerInput\n\t\t\t\t\t\taria-autocomplete=\"list\"\n\t\t\t\t\t\t{...getComboboxAriaProps('listbox', getListboxControlsId())}\n\t\t\t\t\t\taria-activedescendant={\n\t\t\t\t\t\t\tactiveOption\n\t\t\t\t\t\t\t\t? `${getId()}-listbox-option-${activeOption.id}`\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\taria-describedby={getErrorId()}\n\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\tclassName=\"slds-combobox__input\"\n\t\t\t\t\t\tcontainerProps={{\n\t\t\t\t\t\t\tclassName: 'slds-combobox__form-element',\n\t\t\t\t\t\t\trole: 'none',\n\t\t\t\t\t\t}}\n\t\t\t\t\t\thasSpinner={hasInputSpinner}\n\t\t\t\t\t\ticonRight={\n\t\t\t\t\t\t\t<InputIcon\n\t\t\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\t\t\tname=\"search\"\n\t\t\t\t\t\t\t\ttitle={labels.inputIconTitle}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdisabled={isInputDisabled}\n\t\t\t\t\t\tid={getId()}\n\t\t\t\t\t\tonFocus={handleInputFocus}\n\t\t\t\t\t\tonBlur={handleInputBlur}\n\t\t\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\t\t\tinputRef={setInputRefCallback}\n\t\t\t\t\t\tonClick={(event: React.MouseEvent) => requestOpen(event)}\n\t\t\t\t\t\tonChange={handleInnerInputChange}\n\t\t\t\t\t\tplaceholder={labels.placeholder}\n\t\t\t\t\t\treadOnly={!!(predefinedOptionsOnly && activeOption)}\n\t\t\t\t\t\trequired={required}\n\t\t\t\t\t\tvalue={\n\t\t\t\t\t\t\tpredefinedOptionsOnly\n\t\t\t\t\t\t\t\t? getOptionLabel(activeOption) || value\n\t\t\t\t\t\t\t\t: value\n\t\t\t\t\t\t}\n\t\t\t\t\t\t{...userDefinedInputProps}\n\t\t\t\t\t/>\n\t\t\t\t\t{getDialog({ menuRenderer: renderMenu() })}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<SelectedListBox\n\t\t\t\tactiveOption={activeSelectedOption as SelectedListBoxOption}\n\t\t\t\tactiveOptionIndex={activeSelectedOptionIndex}\n\t\t\t\tassistiveText={\n\t\t\t\t\tassistiveText as unknown as {\n\t\t\t\t\t\tremovePill?: string;\n\t\t\t\t\t\tselectedListboxLabel?: string;\n\t\t\t\t\t\t[key: string]: unknown;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tevents={{\n\t\t\t\t\tonBlurPill: handleBlurPill,\n\t\t\t\t\tonPillFocus: handlePillFocus as (\n\t\t\t\t\t\tevent: React.FocusEvent,\n\t\t\t\t\t\tdata: { index: number; option: SelectedListBoxOption }\n\t\t\t\t\t) => void,\n\t\t\t\t\tonRequestFocus: handleRequestFocusSelectedListbox as (\n\t\t\t\t\t\tevent: unknown,\n\t\t\t\t\t\tdata: { ref: HTMLElement | null }\n\t\t\t\t\t) => void,\n\t\t\t\t\tonRequestFocusOnNextPill: handleNavigateSelectedListbox as (\n\t\t\t\t\t\tevent: React.SyntheticEvent,\n\t\t\t\t\t\tdata: { direction: 'next' | 'previous' }\n\t\t\t\t\t) => void,\n\t\t\t\t\tonRequestFocusOnPreviousPill: handleNavigateSelectedListbox as (\n\t\t\t\t\t\tevent: React.SyntheticEvent,\n\t\t\t\t\t\tdata: { direction: 'next' | 'previous' }\n\t\t\t\t\t) => void,\n\t\t\t\t\tonRequestRemove: handleRemoveSelectedOption as (\n\t\t\t\t\t\tevent:\n\t\t\t\t\t\t\tReact.MouseEvent | React.KeyboardEvent | React.SyntheticEvent,\n\t\t\t\t\t\tdata: { index?: number; option: SelectedListBoxOption }\n\t\t\t\t\t) => void,\n\t\t\t\t}}\n\t\t\t\tid={`${getId()}-selected-listbox`}\n\t\t\t\tlabels={labels}\n\t\t\t\tselectedListboxRef={setSelectedListboxRefCallback}\n\t\t\t\tselection={selection as SelectedListBoxOption[]}\n\t\t\t\tlistboxHasFocus={listboxHasFocus}\n\t\t\t\tmultiselectable={multiple}\n\t\t\t/>\n\t\t\t{errorText && (\n\t\t\t\t<div className=\"slds-has-error\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tid={getErrorId()}\n\t\t\t\t\t\tclassName=\"slds-form-element__help slds-has-error\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{errorText}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n\n\tconst renderInlineMultiple = () => (\n\t\t<div className=\"slds-form-element__control\">\n\t\t\t<div\n\t\t\t\tclassName={classNames('slds-combobox_container', {\n\t\t\t\t\t'slds-has-inline-listbox': selection.length,\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t{selection.length ? (\n\t\t\t\t\t<SelectedListBox\n\t\t\t\t\t\tactiveOption={activeSelectedOption as SelectedListBoxOption}\n\t\t\t\t\t\tactiveOptionIndex={activeSelectedOptionIndex}\n\t\t\t\t\t\tassistiveText={\n\t\t\t\t\t\t\tassistiveText as unknown as {\n\t\t\t\t\t\t\t\tremovePill?: string;\n\t\t\t\t\t\t\t\tselectedListboxLabel?: string;\n\t\t\t\t\t\t\t\t[key: string]: unknown;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontainerRole=\"listbox\"\n\t\t\t\t\t\tcontainerAriaOrientation=\"horizontal\"\n\t\t\t\t\t\tlistboxRole=\"group\"\n\t\t\t\t\t\tlistboxAriaOrientation={null}\n\t\t\t\t\t\tevents={{\n\t\t\t\t\t\t\tonBlurPill: handleBlurPill,\n\t\t\t\t\t\t\tonPillFocus: handlePillFocus as (\n\t\t\t\t\t\t\t\tevent: React.FocusEvent,\n\t\t\t\t\t\t\t\tdata: { index: number; option: SelectedListBoxOption }\n\t\t\t\t\t\t\t) => void,\n\t\t\t\t\t\t\tonRequestFocus: handleRequestFocusSelectedListbox as (\n\t\t\t\t\t\t\t\tevent: unknown,\n\t\t\t\t\t\t\t\tdata: { ref: HTMLElement | null }\n\t\t\t\t\t\t\t) => void,\n\t\t\t\t\t\t\tonRequestFocusOnNextPill: handleNavigateSelectedListbox as (\n\t\t\t\t\t\t\t\tevent: React.SyntheticEvent,\n\t\t\t\t\t\t\t\tdata: { direction: 'next' | 'previous' }\n\t\t\t\t\t\t\t) => void,\n\t\t\t\t\t\t\tonRequestFocusOnPreviousPill: handleNavigateSelectedListbox as (\n\t\t\t\t\t\t\t\tevent: React.SyntheticEvent,\n\t\t\t\t\t\t\t\tdata: { direction: 'next' | 'previous' }\n\t\t\t\t\t\t\t) => void,\n\t\t\t\t\t\t\tonRequestRemove: handleRemoveSelectedOption as (\n\t\t\t\t\t\t\t\tevent:\n\t\t\t\t\t\t\t\t\tReact.MouseEvent | React.KeyboardEvent | React.SyntheticEvent,\n\t\t\t\t\t\t\t\tdata: { index?: number; option: SelectedListBoxOption }\n\t\t\t\t\t\t\t) => void,\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tid={`${getId()}-selected-listbox`}\n\t\t\t\t\t\tlabels={labels}\n\t\t\t\t\t\tselectedListboxRef={setSelectedListboxRefCallback}\n\t\t\t\t\t\tselection={selection as SelectedListBoxOption[]}\n\t\t\t\t\t\tlistboxHasFocus={listboxHasFocus}\n\t\t\t\t\t\tmultiselectable={multiple}\n\t\t\t\t\t/>\n\t\t\t\t) : null}\n\t\t\t\t<div\n\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t'slds-combobox',\n\t\t\t\t\t\t'slds-dropdown-trigger',\n\t\t\t\t\t\t'slds-dropdown-trigger_click',\n\t\t\t\t\t\t'ignore-react-onclickoutside',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'slds-is-open': getIsOpen(),\n\t\t\t\t\t\t\t'slds-has-error': errorText,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tclassName\n\t\t\t\t\t)}\n\t\t\t\t>\n\t\t\t\t\t<InnerInput\n\t\t\t\t\t\taria-autocomplete=\"list\"\n\t\t\t\t\t\t{...getComboboxAriaProps('listbox', getListboxControlsId())}\n\t\t\t\t\t\taria-activedescendant={\n\t\t\t\t\t\t\tactiveOption\n\t\t\t\t\t\t\t\t? `${getId()}-listbox-option-${activeOption.id}`\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\taria-describedby={getErrorId()}\n\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\tclassName=\"slds-combobox__input\"\n\t\t\t\t\t\tcontainerProps={{\n\t\t\t\t\t\t\tclassName: 'slds-combobox__form-element',\n\t\t\t\t\t\t\trole: 'none',\n\t\t\t\t\t\t}}\n\t\t\t\t\t\thasSpinner={hasInputSpinner}\n\t\t\t\t\t\ticonRight={\n\t\t\t\t\t\t\t<InputIcon\n\t\t\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\t\t\tname=\"search\"\n\t\t\t\t\t\t\t\ttitle={labels.inputIconTitle}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdisabled={isInputDisabled}\n\t\t\t\t\t\tid={getId()}\n\t\t\t\t\t\tonFocus={handleInputFocus}\n\t\t\t\t\t\tonBlur={handleInputBlur}\n\t\t\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\t\t\tinputRef={setInputRefCallback}\n\t\t\t\t\t\tonClick={(event: React.MouseEvent) => requestOpen(event)}\n\t\t\t\t\t\tonChange={handleInnerInputChange}\n\t\t\t\t\t\tplaceholder={labels.placeholder}\n\t\t\t\t\t\treadOnly={!!(predefinedOptionsOnly && activeOption)}\n\t\t\t\t\t\trequired={required}\n\t\t\t\t\t\tvalue={\n\t\t\t\t\t\t\tpredefinedOptionsOnly\n\t\t\t\t\t\t\t\t? getOptionLabel(activeOption) || value\n\t\t\t\t\t\t\t\t: value\n\t\t\t\t\t\t}\n\t\t\t\t\t\t{...userDefinedInputProps}\n\t\t\t\t\t/>\n\t\t\t\t\t{getDialog({ menuRenderer: renderMenu() })}\n\t\t\t\t\t{errorText && (\n\t\t\t\t\t\t<div id={getErrorId()} className=\"slds-form-element__help\">\n\t\t\t\t\t\t\t{errorText}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n\n\tconst renderInlineSingle = () => {\n\t\tconst selectedIcon = selection[0]?.icon;\n\t\tconst iconLeft =\n\t\t\tselectedIcon && React.isValidElement(selectedIcon)\n\t\t\t\t? React.cloneElement(selectedIcon, {\n\t\t\t\t\t\tcontainerClassName: 'slds-combobox__input-entity-icon',\n\t\t\t\t\t} as Record<string, unknown>)\n\t\t\t\t: null;\n\n\t\tconst inputValue = selection[0]?.label\n\t\t\t? getOptionLabel(selection[0])\n\t\t\t: value;\n\n\t\treturn (\n\t\t\t<div className=\"slds-form-element__control\">\n\t\t\t\t<div\n\t\t\t\t\tclassName={classNames('slds-combobox_container', {\n\t\t\t\t\t\t'slds-has-inline-listbox': selection.length,\n\t\t\t\t\t})}\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t'slds-combobox',\n\t\t\t\t\t\t\t'slds-dropdown-trigger',\n\t\t\t\t\t\t\t'slds-dropdown-trigger_click',\n\t\t\t\t\t\t\t'ignore-react-onclickoutside',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'slds-is-open': getIsOpen(),\n\t\t\t\t\t\t\t\t'slds-has-error': errorText,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tclassName\n\t\t\t\t\t\t)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<InnerInput\n\t\t\t\t\t\t\taria-autocomplete=\"list\"\n\t\t\t\t\t\t\t{...getComboboxAriaProps('listbox', getListboxControlsId())}\n\t\t\t\t\t\t\taria-activedescendant={\n\t\t\t\t\t\t\t\tactiveOption\n\t\t\t\t\t\t\t\t\t? `${getId()}-listbox-option-${activeOption.id}`\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\taria-describedby={getErrorId()}\n\t\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\t\tclassName=\"slds-combobox__input\"\n\t\t\t\t\t\t\tcontainerProps={{\n\t\t\t\t\t\t\t\tclassName: 'slds-combobox__form-element',\n\t\t\t\t\t\t\t\trole: 'none',\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tdisabled={isInputDisabled}\n\t\t\t\t\t\t\thasSpinner={hasInputSpinner}\n\t\t\t\t\t\t\ticonRight={\n\t\t\t\t\t\t\t\tselection.length ? (\n\t\t\t\t\t\t\t\t\t<InputIcon\n\t\t\t\t\t\t\t\t\t\tassistiveText={{\n\t\t\t\t\t\t\t\t\t\t\ticon: assistiveText.removeSingleSelectedOption,\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\tbuttonRef={(component: HTMLButtonElement | null) => {\n\t\t\t\t\t\t\t\t\t\t\tbuttonRef.current = component;\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\t\t\t\t\ticonPosition=\"right\"\n\t\t\t\t\t\t\t\t\t\tname=\"close\"\n\t\t\t\t\t\t\t\t\t\tonClick={(event: React.MouseEvent) => {\n\t\t\t\t\t\t\t\t\t\t\thandleRemoveSelectedOption(event, {\n\t\t\t\t\t\t\t\t\t\t\t\toption: selection[0],\n\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<InputIcon category=\"utility\" name=\"search\" />\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ticonLeft={iconLeft}\n\t\t\t\t\t\t\tid={getId()}\n\t\t\t\t\t\t\tonFocus={handleInputFocus}\n\t\t\t\t\t\t\tonBlur={handleInputBlur}\n\t\t\t\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\t\t\t\tinputRef={setInputRefCallback}\n\t\t\t\t\t\t\tonClick={(event: React.MouseEvent) => requestOpenMenu(event)}\n\t\t\t\t\t\t\tonChange={handleInnerInputChangeWhileUnselected}\n\t\t\t\t\t\t\tplaceholder={labels.placeholder}\n\t\t\t\t\t\t\treadOnly={\n\t\t\t\t\t\t\t\t!!(predefinedOptionsOnly && activeOption) || !!selection.length\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\trequired={required}\n\t\t\t\t\t\t\tvalue={\n\t\t\t\t\t\t\t\tpredefinedOptionsOnly\n\t\t\t\t\t\t\t\t\t? getOptionLabel(activeOption) || value\n\t\t\t\t\t\t\t\t\t: inputValue\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t{...userDefinedInputProps}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{getDialog({ menuRenderer: renderMenu() })}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t{errorText && (\n\t\t\t\t\t<div className=\"slds-has-error\">\n\t\t\t\t\t\t<div id={getErrorId()} className=\"slds-form-element__help\">\n\t\t\t\t\t\t\t{errorText}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t);\n\t};\n\n\tconst renderPopover = () => {\n\t\tconst popoverProps = customPopoverProps;\n\t\t// Popover renders its dialog as `${id}-popover`, and `popover` props may\n\t\t// override the id.\n\t\tconst popoverId = (popover?.props as { id?: string } | undefined)?.id;\n\t\tconst popoverControlsId = getIsOpen()\n\t\t\t? `${popoverId ?? getId()}-popover`\n\t\t\t: undefined;\n\n\t\treturn (\n\t\t\t<div className=\"slds-form-element__control\">\n\t\t\t\t<div className=\"slds-combobox_container\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t'slds-combobox',\n\t\t\t\t\t\t\t'slds-dropdown-trigger',\n\t\t\t\t\t\t\t'slds-dropdown-trigger_click',\n\t\t\t\t\t\t\t'ignore-react-onclickoutside',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'slds-is-open': getIsOpen(),\n\t\t\t\t\t\t\t\t'slds-has-error': errorText,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tclassName\n\t\t\t\t\t\t)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{/* @ts-expect-error - popoverProps contains body from customPopoverProps */}\n\t\t\t\t\t\t<Popover {...popoverProps}>\n\t\t\t\t\t\t\t<InnerInput\n\t\t\t\t\t\t\t\t{...getComboboxAriaProps('dialog', popoverControlsId)}\n\t\t\t\t\t\t\t\taria-describedby={getErrorId()}\n\t\t\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\t\t\tclassName=\"slds-combobox__input\"\n\t\t\t\t\t\t\t\tcontainerProps={{\n\t\t\t\t\t\t\t\t\tclassName: 'slds-combobox__form-element',\n\t\t\t\t\t\t\t\t\trole: 'none',\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\ticonRight={\n\t\t\t\t\t\t\t\t\t<InputIcon\n\t\t\t\t\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\t\t\t\t\tname=\"down\"\n\t\t\t\t\t\t\t\t\t\tvariant=\"combobox\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdisabled={isInputDisabled}\n\t\t\t\t\t\t\t\tid={getId()}\n\t\t\t\t\t\t\t\tonFocus={handleInputFocus}\n\t\t\t\t\t\t\t\tonBlur={handleInputBlur}\n\t\t\t\t\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\t\t\t\t\tinputRef={setInputRefCallback}\n\t\t\t\t\t\t\t\tonClick={(event: React.MouseEvent) => requestOpen(event)}\n\t\t\t\t\t\t\t\tonChange={handleInnerInputChange}\n\t\t\t\t\t\t\t\tplaceholder={labels.placeholder}\n\t\t\t\t\t\t\t\treadOnly\n\t\t\t\t\t\t\t\trequired={required}\n\t\t\t\t\t\t\t\tvalue={value}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Popover>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t{errorText && (\n\t\t\t\t\t<div className=\"slds-has-error\">\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tid={getErrorId()}\n\t\t\t\t\t\t\tclassName=\"slds-form-element__help slds-has-error\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{errorText}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t);\n\t};\n\n\tconst renderReadOnlyMultiple = () => {\n\t\tconst displayValue =\n\t\t\tselection.length > 1\n\t\t\t\t? labels.multipleOptionsSelected ||\n\t\t\t\t\t`${selection.length} options selected`\n\t\t\t\t: getOptionLabel(selection[0]) || '';\n\n\t\treturn (\n\t\t\t<div className=\"slds-form-element__control\">\n\t\t\t\t<div className=\"slds-combobox_container\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t'slds-combobox',\n\t\t\t\t\t\t\t'slds-dropdown-trigger',\n\t\t\t\t\t\t\t'slds-dropdown-trigger_click',\n\t\t\t\t\t\t\t'ignore-react-onclickoutside',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'slds-is-open': getIsOpen(),\n\t\t\t\t\t\t\t\t'slds-has-error': errorText,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tclassName\n\t\t\t\t\t\t)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<InnerInput\n\t\t\t\t\t\t\t{...getComboboxAriaProps('listbox', getListboxControlsId())}\n\t\t\t\t\t\t\taria-activedescendant={\n\t\t\t\t\t\t\t\tactiveOption\n\t\t\t\t\t\t\t\t\t? `${getId()}-listbox-option-${activeOption.id}`\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\taria-describedby={getErrorId()}\n\t\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\t\tclassName=\"slds-combobox__input\"\n\t\t\t\t\t\t\tcontainerProps={{\n\t\t\t\t\t\t\t\tclassName: 'slds-combobox__form-element',\n\t\t\t\t\t\t\t\trole: 'none',\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\ticonRight={\n\t\t\t\t\t\t\t\t<InputIcon category=\"utility\" name=\"down\" variant=\"combobox\" />\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdisabled={isInputDisabled}\n\t\t\t\t\t\t\tid={getId()}\n\t\t\t\t\t\t\tonFocus={handleInputFocus}\n\t\t\t\t\t\t\tonBlur={handleInputBlur}\n\t\t\t\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\t\t\t\tinputRef={setInputRefCallback}\n\t\t\t\t\t\t\tonClick={(event: React.MouseEvent) => requestOpenMenu(event)}\n\t\t\t\t\t\t\tonChange={handleInnerInputChangeWhileUnselected}\n\t\t\t\t\t\t\tplaceholder={labels.placeholderReadOnly}\n\t\t\t\t\t\t\treadOnly\n\t\t\t\t\t\t\trequired={required}\n\t\t\t\t\t\t\tvalue={displayValue}\n\t\t\t\t\t\t\t{...userDefinedInputProps}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{getDialog({ menuRenderer: renderMenu() })}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<SelectedListBox\n\t\t\t\t\tactiveOption={activeSelectedOption as SelectedListBoxOption}\n\t\t\t\t\tactiveOptionIndex={activeSelectedOptionIndex}\n\t\t\t\t\tassistiveText={\n\t\t\t\t\t\tassistiveText as unknown as {\n\t\t\t\t\t\t\tremovePill?: string;\n\t\t\t\t\t\t\tselectedListboxLabel?: string;\n\t\t\t\t\t\t\t[key: string]: unknown;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tevents={{\n\t\t\t\t\t\tonBlurPill: handleBlurPill,\n\t\t\t\t\t\tonPillFocus: handlePillFocus as (\n\t\t\t\t\t\t\tevent: React.FocusEvent,\n\t\t\t\t\t\t\tdata: { index: number; option: SelectedListBoxOption }\n\t\t\t\t\t\t) => void,\n\t\t\t\t\t\tonRequestFocus: handleRequestFocusSelectedListbox as (\n\t\t\t\t\t\t\tevent: unknown,\n\t\t\t\t\t\t\tdata: { ref: HTMLElement | null }\n\t\t\t\t\t\t) => void,\n\t\t\t\t\t\tonRequestFocusOnNextPill: handleNavigateSelectedListbox as (\n\t\t\t\t\t\t\tevent: React.SyntheticEvent,\n\t\t\t\t\t\t\tdata: { direction: 'next' | 'previous' }\n\t\t\t\t\t\t) => void,\n\t\t\t\t\t\tonRequestFocusOnPreviousPill: handleNavigateSelectedListbox as (\n\t\t\t\t\t\t\tevent: React.SyntheticEvent,\n\t\t\t\t\t\t\tdata: { direction: 'next' | 'previous' }\n\t\t\t\t\t\t) => void,\n\t\t\t\t\t\tonRequestRemove: handleRemoveSelectedOption as (\n\t\t\t\t\t\t\tevent:\n\t\t\t\t\t\t\t\tReact.MouseEvent | React.KeyboardEvent | React.SyntheticEvent,\n\t\t\t\t\t\t\tdata: { index?: number; option: SelectedListBoxOption }\n\t\t\t\t\t\t) => void,\n\t\t\t\t\t}}\n\t\t\t\t\tid={`${getId()}-selected-listbox`}\n\t\t\t\t\tlabels={labels}\n\t\t\t\t\tselectedListboxRef={setSelectedListboxRefCallback}\n\t\t\t\t\tselection={selection as SelectedListBoxOption[]}\n\t\t\t\t\tlistboxHasFocus={listboxHasFocus}\n\t\t\t\t\tvariant={variant}\n\t\t\t\t\trenderAtSelectionLength={2}\n\t\t\t\t\tmultiselectable={multiple}\n\t\t\t\t/>\n\t\t\t\t{errorText && (\n\t\t\t\t\t<div className=\"slds-has-error\">\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tid={getErrorId()}\n\t\t\t\t\t\t\tclassName=\"slds-form-element__help slds-has-error\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{errorText}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t);\n\t};\n\n\tconst renderReadOnlySingle = () => {\n\t\tconst activeOptionLabel = getOptionLabel(activeOption);\n\t\tconst selectedOptionLabel = getOptionLabel(selection[0]);\n\t\tlet inputValue = activeOptionLabel || selectedOptionLabel || '';\n\n\t\tif (selection[0]?.value === '') {\n\t\t\tinputValue = '';\n\t\t}\n\n\t\treturn (\n\t\t\t<div className=\"slds-form-element__control\">\n\t\t\t\t<div className=\"slds-combobox_container\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t'slds-combobox',\n\t\t\t\t\t\t\t'slds-dropdown-trigger',\n\t\t\t\t\t\t\t'slds-dropdown-trigger_click',\n\t\t\t\t\t\t\t'ignore-react-onclickoutside',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'slds-is-open': getIsOpen(),\n\t\t\t\t\t\t\t\t'slds-has-error': errorText,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tclassName\n\t\t\t\t\t\t)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<InnerInput\n\t\t\t\t\t\t\t{...getComboboxAriaProps('listbox', getListboxControlsId())}\n\t\t\t\t\t\t\taria-activedescendant={\n\t\t\t\t\t\t\t\tactiveOption\n\t\t\t\t\t\t\t\t\t? `${getId()}-listbox-option-${activeOption.id}`\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\taria-describedby={getErrorId()}\n\t\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\t\tclassName=\"slds-combobox__input\"\n\t\t\t\t\t\t\tcontainerProps={{\n\t\t\t\t\t\t\t\tclassName: 'slds-combobox__form-element',\n\t\t\t\t\t\t\t\trole: 'none',\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tdisabled={isInputDisabled}\n\t\t\t\t\t\t\ticonRight={\n\t\t\t\t\t\t\t\t<InputIcon category=\"utility\" name=\"down\" variant=\"combobox\" />\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tid={getId()}\n\t\t\t\t\t\t\tonFocus={handleInputFocus}\n\t\t\t\t\t\t\tonBlur={handleInputBlur}\n\t\t\t\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\t\t\t\tinputRef={setInputRefCallback}\n\t\t\t\t\t\t\tonClick={(event: React.MouseEvent) => requestOpenMenu(event)}\n\t\t\t\t\t\t\tonChange={handleInnerInputChangeWhileUnselected}\n\t\t\t\t\t\t\tplaceholder={labels.placeholderReadOnly}\n\t\t\t\t\t\t\treadOnly\n\t\t\t\t\t\t\trequired={required}\n\t\t\t\t\t\t\tvalue={inputValue}\n\t\t\t\t\t\t\t{...userDefinedInputProps}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{getDialog({ menuRenderer: renderMenu() })}\n\t\t\t\t\t\t{errorText && (\n\t\t\t\t\t\t\t<div id={getErrorId()} className=\"slds-form-element__help\">\n\t\t\t\t\t\t\t\t{errorText}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t};\n\n\t// ===== Main Render =====\n\n\tconst hasRenderedLabel = labels.label || assistiveText?.label;\n\n\tconst subRenders: Record<string, Record<string, () => ReactNode>> = {\n\t\tbase: {\n\t\t\tmultiple: renderBase,\n\t\t\tsingle: renderBase,\n\t\t},\n\t\t'inline-listbox': {\n\t\t\tmultiple: renderInlineMultiple,\n\t\t\tsingle: renderInlineSingle,\n\t\t},\n\t\tpopover: {\n\t\t\tmultiple: renderPopover,\n\t\t\tsingle: renderPopover,\n\t\t},\n\t\treadonly: {\n\t\t\tmultiple: renderReadOnlyMultiple,\n\t\t\tsingle: renderReadOnlySingle,\n\t\t},\n\t};\n\n\tconst multipleOrSingle = multiple ? 'multiple' : 'single';\n\tconst variantRenderer = subRenders[variant]?.[multipleOrSingle];\n\n\tconst mainCombobox = (\n\t\t<div className={classNames('slds-form-element', classNameContainer)}>\n\t\t\t{entityCombobox ? null : (\n\t\t\t\t<Label\n\t\t\t\t\tassistiveText={\n\t\t\t\t\t\tassistiveText as unknown as {\n\t\t\t\t\t\t\tlabel?: string;\n\t\t\t\t\t\t\t[key: string]: unknown;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\thtmlFor={getId()}\n\t\t\t\t\tlabel={labels.label}\n\t\t\t\t\trequired={required}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t{fieldLevelHelpTooltip && hasRenderedLabel ? (\n\t\t\t\t<FieldLevelHelpTooltip\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\tfieldLevelHelpTooltip={fieldLevelHelpTooltip as any}\n\t\t\t\t/>\n\t\t\t) : null}\n\t\t\t{variantRenderer ? variantRenderer() : subRenders.base.multiple()}\n\t\t</div>\n\t);\n\n\treturn entityCombobox ? (\n\t\t<div className=\"slds-form-element\">\n\t\t\t<Label\n\t\t\t\tassistiveText={\n\t\t\t\t\tassistiveText as unknown as { label?: string; [key: string]: unknown }\n\t\t\t\t}\n\t\t\t\thtmlFor={getId()}\n\t\t\t\tlabel={labels.label}\n\t\t\t\trequired={required}\n\t\t\t/>\n\t\t\t<div className=\"slds-form-element__control\">\n\t\t\t\t<div className=\"slds-combobox-group\">\n\t\t\t\t\t<div className=\"slds-combobox_object-switcher slds-combobox-addon_start\">\n\t\t\t\t\t\t{entityCombobox}\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div className=\"slds-combobox_container slds-combobox-addon_end\">\n\t\t\t\t\t\t{mainCombobox}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t) : (\n\t\tmainCombobox\n\t);\n};\n\nCombobox.displayName = COMBOBOX;\n\nexport default Combobox;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyDA,IAAI,GACE,KAAkB,OAAO,WAAa,KAgItC,KAAc,OAAO,YAAY,GAMjC,MAAmB,MACxB,MAAe,GAEV,MACL,GACA,OACoB;CACpB,IAAI,EAAK,MAAM;CACf,MAAM,EAAK;CACX,OAAO,EAAK;CACZ,UAAU,EAAK;CACf;EACC,KAA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