{"version":3,"sources":["../../src/components/Autofill/Autofill.tsx","../../src/components/ComboBox/ComboBox.tsx","../../src/components/ComboBox/ComboBox.styles.ts","../../src/components/ComboBox/ComboBox.classNames.ts","../../src/getChildren.ts"],"names":["Autofill","_super","props","_this","call","_inputElement","React","_autoFillEnabled","_onCompositionStart","ev","setState","isComposing","_onCompositionUpdate","isIE11","_updateValue","_getCurrentInputValue","_onCompositionEnd","inputValue","_tryEnableAutofill","value","_async","setTimeout","_onClick","_onKeyDown","onKeyDown","nativeEvent","which","KeyCodes","backspace","left","right","suggestedDisplayValue","enableAutofillOnKeyPress","indexOf","_onInputChanged","state","nativeEventComposing","undefined","_onChanged","newValue","composing","_a","onInputChange","onInputValueChange","updateValueInWillReceiveProps","initializeComponentRef","Async","defaultVisibleValue","__extends","getDerivedStateFromProps","updatedInputValue","__assign","Object","defineProperty","prototype","this","current","inputElement","selectionDirection","selectionEnd","selectionStart","Boolean","_getControlledValue","componentDidUpdate","_","_1","cursor","shouldSelectFullInputValueInComponentDidUpdate","differenceIndex","preventValueSelection","document","activeElement","_doesTextStartWith","shouldSelectFullRange","setSelectionRange","length","toLocaleLowerCase","start","end","dir","componentWillUnmount","dispose","render","nativeProps","getNativeProps","inputProperties","style","fontFamily","autoCapitalize","autoComplete","ref","_getDisplayValue","onCompositionStart","onCompositionUpdate","onCompositionEnd","onChange","onInput","onClick","focus","clear","getSnapshotBeforeUpdate","inel","_b","target","oldValue","isComposed","displayValue","console","warn","toString","defaultProps","down","up","text","startWith","SearchDirection","HoverStatus","getDisabledStyles","memoizeFunction","theme","semanticColors","backgroundColor","disabledBackground","color","disabledText","selectors","borderColor","HighContrastSelector","listOptionHighContrastStyles","getHighContrastNoAdjustStyle","inputHighContrastStyles","getOptionStyles","customStylesForAllOptions","customOptionStylesForCurrentOption","isPending","isHidden","isSelected","palette","option","textHoveredColor","menuItemTextHovered","textSelectedColor","neutralDark","textDisabledColor","backgroundHoveredColor","menuItemBackgroundHovered","backgroundPressedColor","menuItemBackgroundPressed","optionStyles","root","fonts","medium","boxSizing","display","width","height","minHeight","lineHeight","padding","position","borderWidth","borderStyle","borderRadius","wordWrap","overflowWrap","textAlign","border","alignItems","getFocusStyle","inset","isFocusedOnly","rootHovered","rootFocused","rootDisabled","optionText","overflow","whiteSpace","textOverflow","minWidth","maxWidth","optionTextWrapper","concatStyleSets","getCaretDownButtonStyles","customStyles","caret","buttonTextColor","bodySubtext","buttonTextHoveredCheckedColor","buttonTextChecked","buttonBackgroundHoveredColor","listItemBackgroundHovered","buttonBackgroundCheckedColor","listItemBackgroundChecked","buttonBackgroundCheckedHoveredColor","listItemBackgroundCheckedHovered","buttonHighContrastStyles","styles","fontSize","small","top","icon","rootPressed","rootChecked","rootCheckedHovered","getStyles","comboBoxOptionWidth","effects","textColor","inputText","inputBorder","borderHoveredColor","inputBorderHovered","borderPressedColor","inputFocusBorderAlt","borderFocusedColor","inputBackground","erroredColor","errorText","headerTextColor","menuHeader","dividerBorderColor","bodyDivider","placeholderHighContrastStyles","placeholderStyles","inputPlaceholderText","placeholderStylesHovered","inputTextHovered","disabledPlaceholderStyles","ComboBoxRootHighContrastFocused","focusBorderStyles","getInputFocusStyle","roundedCorner2","container","label","labelDisabled","boxShadow","marginLeft","paddingRight","paddingLeft","outline","userSelect","marginBottom","pointerEvents","content","bottom","_c","getPlaceholderStyles","_d","_e","rootError","rootDisallowFreeForm","input","font","inputDisabled","errorMessage","marginTop","callout","elevation8","optionsContainerWrapper","optionsContainer","screenReaderText","hiddenContentStyle","header","fontWeight","FontWeights","semibold","_f","divider","getClassNames","className","isOpen","disabled","required","focused","allowFreeForm","hasErrorMessage","mergeStyles","getComboBoxOptionClassNames","ComboBoxOptionWrapper","oldProps","__rest","newProps","shallowCompare","DEFAULT_PROPS","options","allowFreeform","buttonIconProps","iconName","useOptionsState","defaultSelectedKey","selectedKey","getSelectedIndices","selectedKeys","buildSelectedKeys","buildDefaultSelectedKeys","selectedIndices","setSelectedIndices","currentOptions","setCurrentOptions","setSuggestedDisplayValue","indices","ComboBox","propsWithoutDefaults","forwardedRef","getPropsWithDefaults","rootRef","mergedRootRef","useMergedRefs","ComboBoxInternal","hoisted","findFirstDescendant","element","match","children","parent","allowVirtualChildren","i","push","item","isVirtualElement","apply","_virtual","getChildren","index","child","candidate","displayName","_autofill","_comboBoxWrapper","_comboBoxMenu","_selectedElement","shouldOpenOnFocus","useFocusAsync","focusAsync","_hasFocus","focusState","dismissMenu","_onUpdateValueInAutofillWillReceiveProps","comboBox","normalizeToString","_currentVisibleValue","_renderComboBoxWrapper","multiselectAccessibleText","errorMessageId","ariaLabel","ariaDescribedBy","isButtonAriaHidden","title","placeholderProp","placeholder","tabIndex","autofill","iconButtonProps","ariaActiveDescendantValue","multiSelect","labelledBy","_id","join","trim","labelProps","id","_classNames","componentRef","type","onFocus","_onFocus","onBlur","_onBlur","_onInputKeyDown","onKeyUp","_onInputKeyUp","_onAutofillClick","onTouchStart","_onTouchStart","_onInputChange","_getAriaAutoCompleteValue","role","readOnly","mergeAriaAttributeValues","spellCheck","_onShouldSelectFullInputValueInAutofillComponentDidUpdate","IconButton","_getCaretButtonStyles","_onComboBoxClick","iconProps","checked","_getVisibleValue","allowFreeInput","currentPendingValueValidIndex","currentPendingValue","currentPendingIndexValid","indexWithinBounds","_getPendingString","_getMultiselectDisplayString","_getFirstSelectedIndex","getPreviewText","updatedValue","_handleInputWhenDisabled","_processInputChangeWithFreeform","_processInputChangeWithoutFreeform","select","_onResolveOptions","onResolveOptions","newOptions_1","__spreadArray","Array","isArray","then","_currentPromise","newOptionsFromPromise","event","relatedTarget","isBlurFromComboBoxTitle","contains","isBlurFromComboBoxMenu","isBlurFromComboBoxMenuAncestor","findElementRecursive","_submitPendingValue","preventDefault","stopPropagation","_onRenderContainer","defaultRender","onRenderList","calloutProps","dropdownWidth","dropdownMaxWidth","onRenderUpperContent","_onRenderUpperContent","onRenderLowerContent","_onRenderLowerContent","useComboBoxAsMenuWidth","persistMenu","shouldRestoreFocus","comboBoxMenuWidth","clientWidth","Callout","isBeakVisible","gapSpace","doNotLayer","directionalHint","DirectionalHint","bottomLeftEdge","directionalHintFixed","onLayerMounted","_onLayerMounted","css","onDismiss","_onDismiss","onMouseDown","_onCalloutMouseDown","onScroll","_onScroll","setInitialFocus","calloutWidth","calloutMaxWidth","hidden","_onRenderList","_onCalloutLayerMounted","_scrollIntoView","_onRenderLabel","onRenderLabelProps","Label","onRenderItem","_onRenderItem","queue","items","renderedList","emptyQueue","newGroup","key","forEach","itemType","SelectableOptionMenuItemType","Header","id_1","Divider","placeRenderedOptionIntoQueue","_renderSeparator","_renderHeader","_renderOption","onRenderOption","_onRenderOptionContent","_isOptionSelected","isChecked","_isOptionChecked","isIndeterminate","_isOptionIndeterminate","_getCurrentOptionStyles","optionClassNames","Checkbox","ariaLabelledBy","_onItemClick","indeterminate","onRenderLabel","_renderCheckboxLabel","bind","inputProps","CommandButton","onMouseEnter","_onOptionMouseEnter","onMouseMove","_onOptionMouseMove","onMouseLeave","_onOptionMouseLeave","data","_isScrollIdle","_scrollIdleTimeoutId","clearTimeout","_onRenderMultiselectOptionContent","onMenuDismiss","_setOpenStateAndFocusOnClose","_resetSelectedIndex","_onAfterClearPendingInfo","_processingClearPendingInfo","currentPendingValueValidIndexOnHover","_lastKeyDownWasAltOrMeta","isAltOrMeta","_getPendingSelectedIndex","enter","tab","escape","clearAll","altKey","metaKey","_setPendingInfoFromIndexAndDirection","backward","forward","home","directionToSearch","space","keyCode","alt","keyPressIsAltOrMetaAlone","shouldHandleKey","isMac","isIOS","openOnKeyboardFocus","_shouldIgnoreMouseEvent","_processingTouch","_handleTouchAndPointerEvent","_onPointerDown","pointerType","stopImmediatePropagation","_events","EventGroup","warnMutuallyExclusive","getId","_gotMouseMove","default","getAllSelectedOptions","componentDidMount","on","prevProps","prevState","onMenuOpen","onMenuDismissed","_focusInputAfterClose","_notifyPendingValueChanged","newCurrentPendingValueValidIndex","map","_updateAutocompleteIndexWithoutFreeform","descendantText","onRenderContainer","_g","divProps","divProperties","comboBoxWrapper","displayValues","idx","SelectAll","multiSelectDelimiter","filter","isNormalOption","_setPendingInfo","originalUpdatedValue","newSuggestedDisplayValue","_autoCompleteTimeout","matchingIndex","_setPendingInfoFromIndex","_getNextSelectableIndex","searchDirection","newIndex","Math","max","min","isSelectableOption","none","_setSelectedIndex","submitPendingValueEvent","onPendingValueChanged","initialIndices","slice","changedOptions","selected","currentOption","selectAllOption","o","selectAllState","_isSelectAllChecked","selectAllIndex_1","persist","_hasPendingValue","_clearPendingInfo","pendingOptionText","isValueSelected","newOption","newOptions","concat","_isOptionHighlighted","testIndices","find","selectAllIndex","compareSelectedIndices","selectableOptions","includeCurrentPendingValue","onScrollToItem","scrollSelectedToTop","currentPendingSelectedIndex","scrollToElement","dataset","offsetParent","alignToTop","scrollableParent","offsetHeight","offsetTop","parentOffsetHeight","scrollTop","isBelow","scrollTo","scrollIntoView","onItemClick","selectedIndex","indexUpdate","newPendingIndex","newPendingValue","focusInputAfterClose","_lastTouchTimeoutId","customCaretDownButtonStyles","caretDownButtonStyles","comboBoxOptionStyles","customStylesForCurrentOption","_isPendingOption","__decorate","customizable","findIndex","_i","selectedKeys_1","keys","Number","sort","useAriaLabelAsText"],"mappings":"+MAqBAA,EAAA,SAAAC,GAuBE,SAAAD,EAAYE,GAAZ,IAAAC,EACEF,EAAAG,KAAA,KAAMF,IAAM,K,OAnBNC,EAAAE,cAAgBC,cAChBH,EAAAI,kBAAmB,EAoKnBJ,EAAAK,oBAAsB,SAACC,GAC7BN,EAAKO,SAAS,CAAEC,aAAa,IAC7BR,EAAKI,kBAAmB,GAMlBJ,EAAAS,qBAAuB,WACzBC,eACFV,EAAKW,aAAaX,EAAKY,yBAAyB,IAO5CZ,EAAAa,kBAAoB,SAACP,GAC3B,IAAMQ,EAAad,EAAKY,wBACxBZ,EAAKe,mBAAmBD,EAAYd,EAAKgB,OAAO,GAAO,GACvDhB,EAAKO,SAAS,CAAEC,aAAa,IAG7BR,EAAKiB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,C,EAAlBC,EAAAD,IAOtB,OAAOjlB,OAAOmlB,KAAKhW,GAAiBwQ,IAAIyF,QAAQC,OAqBlD,SAASpW,GAAkBH,GACzB,YAAoB7P,IAAhB6P,EACK,GAIDA,aAAuBmH,MAAQnH,EAAc,CAACA,GAGxD,SAASiD,GAAkBhU,GACzB,OAAOA,GAAS,GASlB,SAASoX,GAAkB3G,EAAwCuC,GACjE,QAASvC,GAAWuC,GAAS,GAAKA,EAAQvC,EAAQjN,OAIpD,SAASif,GAAelb,GACtB,OACEA,EAAO6U,WAAaC,IAA6BC,QACjD/U,EAAO6U,WAAaC,IAA6BG,SACjDjV,EAAO6U,WAAaC,IAA6BiG,UAKrD,SAASgB,GAAmB/b,GAC1B,OACEA,EAAO6U,WAAaC,IAA6BC,QAAU/U,EAAO6U,WAAaC,IAA6BG,QAShH,SAAShF,GAAe7E,GACtB,OAAOA,EAAK4U,oBAAsB5U,EAAK0B,UAAY1B,EAAK0B,UAAY1B,EAAK7M,KAM3E,SAASmZ,GAAY3f,GAEnB,OAAOA,EAAGiB,QAAUC,IAASwf,KAAkB,SAAX1gB,EAAG4c","file":"static/js/5.613aa231.chunk.js","sourcesContent":["import * as React from 'react';\nimport { Async, getNativeProps, initializeComponentRef, inputProperties, isIE11, KeyCodes } from '../../Utilities';\nimport type { IAutofill, IAutofillProps } from './Autofill.types';\n\nexport interface IAutofillState {\n  inputValue: string;\n  isComposing: boolean;\n}\n\ninterface ICursorLocation {\n  start: number;\n  end: number;\n  dir: 'forward' | 'backward' | 'none' | undefined;\n}\n\nconst SELECTION_FORWARD = 'forward';\nconst SELECTION_BACKWARD = 'backward';\n\n/**\n * {@docCategory Autofill}\n */\nexport class Autofill extends React.Component<IAutofillProps, IAutofillState> implements IAutofill {\n  public static defaultProps = {\n    enableAutofillOnKeyPress: [KeyCodes.down, KeyCodes.up] as KeyCodes[],\n  };\n\n  private _inputElement = React.createRef<HTMLInputElement>();\n  private _autoFillEnabled = true;\n  private _async: Async;\n\n  public static getDerivedStateFromProps(props: IAutofillProps, state: IAutofillState): IAutofillState | null {\n    // eslint-disable-next-line deprecation/deprecation\n    if (props.updateValueInWillReceiveProps) {\n      // eslint-disable-next-line deprecation/deprecation\n      const updatedInputValue = props.updateValueInWillReceiveProps();\n      // Don't update if we have a null value or the value isn't changing\n      // the value should still update if an empty string is passed in\n      if (updatedInputValue !== null && updatedInputValue !== state.inputValue && !state.isComposing) {\n        return { ...state, inputValue: updatedInputValue };\n      }\n    }\n    return null;\n  }\n\n  constructor(props: IAutofillProps) {\n    super(props);\n\n    initializeComponentRef(this);\n    this._async = new Async(this);\n\n    this.state = {\n      inputValue: props.defaultVisibleValue || '',\n      isComposing: false,\n    };\n  }\n\n  public get cursorLocation(): number | null {\n    if (this._inputElement.current) {\n      const inputElement = this._inputElement.current;\n      if (inputElement.selectionDirection !== SELECTION_FORWARD) {\n        return inputElement.selectionEnd;\n      } else {\n        return inputElement.selectionStart;\n      }\n    } else {\n      return -1;\n    }\n  }\n\n  public get isValueSelected(): boolean {\n    return Boolean(this.inputElement && this.inputElement.selectionStart !== this.inputElement.selectionEnd);\n  }\n\n  public get value(): string {\n    return this._getControlledValue() || this.state.inputValue || '';\n  }\n\n  public get selectionStart(): number | null {\n    return this._inputElement.current ? this._inputElement.current.selectionStart : -1;\n  }\n\n  public get selectionEnd(): number | null {\n    return this._inputElement.current ? this._inputElement.current.selectionEnd : -1;\n  }\n\n  public get inputElement(): HTMLInputElement | null {\n    return this._inputElement.current;\n  }\n\n  public componentDidUpdate(_: any, _1: any, cursor: ICursorLocation | null) {\n    const { suggestedDisplayValue, shouldSelectFullInputValueInComponentDidUpdate, preventValueSelection } = this.props;\n    let differenceIndex = 0;\n\n    if (preventValueSelection) {\n      return;\n    }\n\n    const isFocused = this._inputElement.current && this._inputElement.current === document.activeElement;\n\n    if (\n      isFocused &&\n      this._autoFillEnabled &&\n      this.value &&\n      suggestedDisplayValue &&\n      _doesTextStartWith(suggestedDisplayValue, this.value)\n    ) {\n      let shouldSelectFullRange = false;\n\n      if (shouldSelectFullInputValueInComponentDidUpdate) {\n        shouldSelectFullRange = shouldSelectFullInputValueInComponentDidUpdate();\n      }\n\n      if (shouldSelectFullRange) {\n        this._inputElement.current!.setSelectionRange(0, suggestedDisplayValue.length, SELECTION_BACKWARD);\n      } else {\n        while (\n          differenceIndex < this.value.length &&\n          this.value[differenceIndex].toLocaleLowerCase() === suggestedDisplayValue[differenceIndex].toLocaleLowerCase()\n        ) {\n          differenceIndex++;\n        }\n        if (differenceIndex > 0) {\n          this._inputElement.current!.setSelectionRange(\n            differenceIndex,\n            suggestedDisplayValue.length,\n            SELECTION_BACKWARD,\n          );\n        }\n      }\n    } else if (this._inputElement.current) {\n      if (cursor !== null && !this._autoFillEnabled && !this.state.isComposing) {\n        this._inputElement.current.setSelectionRange(cursor.start, cursor.end, cursor.dir);\n      }\n    }\n  }\n\n  public componentWillUnmount(): void {\n    this._async.dispose();\n  }\n\n  public render(): JSX.Element {\n    const nativeProps = getNativeProps<React.InputHTMLAttributes<HTMLInputElement>>(this.props, inputProperties);\n    const style = { ...this.props.style, fontFamily: 'inherit' };\n    return (\n      <input\n        autoCapitalize=\"off\"\n        autoComplete=\"off\"\n        aria-autocomplete={'both'}\n        {...nativeProps}\n        style={style}\n        ref={this._inputElement}\n        value={this._getDisplayValue()}\n        onCompositionStart={this._onCompositionStart}\n        onCompositionUpdate={this._onCompositionUpdate}\n        onCompositionEnd={this._onCompositionEnd}\n        // TODO (Fabric 8?) - switch to calling only onChange. See notes in TextField._onInputChange.\n        onChange={this._onChanged}\n        onInput={this._onInputChanged}\n        onKeyDown={this._onKeyDown}\n        onClick={this.props.onClick ? this.props.onClick : this._onClick}\n        data-lpignore={true}\n      />\n    );\n  }\n\n  public focus() {\n    this._inputElement.current && this._inputElement.current.focus();\n  }\n\n  public clear() {\n    this._autoFillEnabled = true;\n    this._updateValue('', false);\n    this._inputElement.current && this._inputElement.current.setSelectionRange(0, 0);\n  }\n\n  public getSnapshotBeforeUpdate(): ICursorLocation | null {\n    const inel = this._inputElement.current;\n\n    if (inel && inel.selectionStart !== this.value.length) {\n      return {\n        start: inel.selectionStart ?? inel.value.length,\n        end: inel.selectionEnd ?? inel.value.length,\n        dir: (inel.selectionDirection as 'forward') || 'backward' || 'none',\n      };\n    }\n    return null;\n  }\n\n  // Composition events are used when the character/text requires several keystrokes to be completed.\n  // Some examples of this are mobile text input and languages like Japanese or Arabic.\n  // Find out more at https://developer.mozilla.org/en-US/docs/Web/Events/compositionstart\n  private _onCompositionStart = (ev: React.CompositionEvent<HTMLInputElement>) => {\n    this.setState({ isComposing: true });\n    this._autoFillEnabled = false;\n  };\n\n  // Composition events are used when the character/text requires several keystrokes to be completed.\n  // Some examples of this are mobile text input and languages like Japanese or Arabic.\n  // Find out more at https://developer.mozilla.org/en-US/docs/Web/Events/compositionstart\n  private _onCompositionUpdate = () => {\n    if (isIE11()) {\n      this._updateValue(this._getCurrentInputValue(), true);\n    }\n  };\n\n  // Composition events are used when the character/text requires several keystrokes to be completed.\n  // Some examples of this are mobile text input and languages like Japanese or Arabic.\n  // Find out more at https://developer.mozilla.org/en-US/docs/Web/Events/compositionstart\n  private _onCompositionEnd = (ev: React.CompositionEvent<HTMLInputElement>) => {\n    const inputValue = this._getCurrentInputValue();\n    this._tryEnableAutofill(inputValue, this.value, false, true);\n    this.setState({ isComposing: false });\n\n    // Due to timing, this needs to be async, otherwise no text will be selected.\n    this._async.setTimeout(() => {\n      // it's technically possible that the value of isComposing is reset during this timeout,\n      // so explicitly trigger this with composing=true here, since it is supposed to be the\n      // update for composition end\n      this._updateValue(this._getCurrentInputValue(), false);\n    }, 0);\n  };\n\n  private _onClick = () => {\n    if (this.value && this.value !== '' && this._autoFillEnabled) {\n      this._autoFillEnabled = false;\n    }\n  };\n\n  private _onKeyDown = (ev: React.KeyboardEvent<HTMLInputElement>) => {\n    if (this.props.onKeyDown) {\n      this.props.onKeyDown(ev);\n    }\n\n    // If the event is actively being composed, then don't alert autofill.\n    // Right now typing does not have isComposing, once that has been fixed any should be removed.\n\n    if (!(ev.nativeEvent as any).isComposing) {\n      // eslint-disable-next-line deprecation/deprecation\n      switch (ev.which) {\n        case KeyCodes.backspace:\n          this._autoFillEnabled = false;\n          break;\n        case KeyCodes.left:\n        case KeyCodes.right:\n          if (this._autoFillEnabled) {\n            this.setState({ inputValue: this.props.suggestedDisplayValue || '' });\n            this._autoFillEnabled = false;\n          }\n          break;\n        default:\n          if (!this._autoFillEnabled) {\n            // eslint-disable-next-line deprecation/deprecation\n            if (this.props.enableAutofillOnKeyPress!.indexOf(ev.which) !== -1) {\n              this._autoFillEnabled = true;\n            }\n          }\n          break;\n      }\n    }\n  };\n\n  private _onInputChanged = (ev: React.FormEvent<HTMLElement>) => {\n    const value: string = this._getCurrentInputValue(ev);\n\n    if (!this.state.isComposing) {\n      this._tryEnableAutofill(value, this.value, (ev.nativeEvent as any).isComposing);\n    }\n\n    // If it is not IE11 and currently composing, update the value\n    if (!(isIE11() && this.state.isComposing)) {\n      const nativeEventComposing = (ev.nativeEvent as any).isComposing;\n      const isComposing = nativeEventComposing === undefined ? this.state.isComposing : nativeEventComposing;\n      this._updateValue(value, isComposing);\n    }\n  };\n\n  private _onChanged = (): void => {\n    // Swallow this event, we don't care about it\n    // We must provide it because React PropTypes marks it as required, but onInput serves the correct purpose\n    return;\n  };\n\n  private _getCurrentInputValue(ev?: React.FormEvent<HTMLElement>): string {\n    if (ev && ev.target && (ev.target as HTMLInputElement).value) {\n      return (ev.target as HTMLInputElement).value;\n    } else if (this.inputElement && this.inputElement.value) {\n      return this.inputElement.value;\n    } else {\n      return '';\n    }\n  }\n\n  /**\n   * Attempts to enable autofill. Whether or not autofill is enabled depends on the input value,\n   * whether or not any text is selected, and only if the new input value is longer than the old input value.\n   * Autofill should never be set to true if the value is composing. Once compositionEnd is called, then\n   * it should be completed.\n   * See https://developer.mozilla.org/en-US/docs/Web/API/CompositionEvent for more information on composition.\n   * @param newValue - new input value\n   * @param oldValue - old input value\n   * @param isComposing - if true then the text is actively being composed and it has not completed.\n   * @param isComposed - if the text is a composed text value.\n   */\n  private _tryEnableAutofill(newValue: string, oldValue: string, isComposing?: boolean, isComposed?: boolean): void {\n    if (\n      !isComposing &&\n      newValue &&\n      this._inputElement.current &&\n      this._inputElement.current.selectionStart === newValue.length &&\n      !this._autoFillEnabled &&\n      (newValue.length > oldValue.length || isComposed)\n    ) {\n      this._autoFillEnabled = true;\n    }\n  }\n\n  /**\n   * Updates the current input value as well as getting a new display value.\n   * @param newValue - The new value from the input\n   */\n  private _updateValue = (newValue: string, composing: boolean) => {\n    // Only proceed if the value is nonempty and is different from the old value\n    // This is to work around the fact that, in IE 11, inputs with a placeholder fire an onInput event on focus\n    if (!newValue && newValue === this.value) {\n      return;\n    }\n\n    // eslint-disable-next-line deprecation/deprecation\n    const { onInputChange, onInputValueChange, updateValueInWillReceiveProps } = this.props;\n    if (onInputChange) {\n      newValue = onInputChange?.(newValue, composing) || '';\n    }\n\n    // if value is controlled in updateValueInWillReceiveProps, then we should not update the value in state now\n    // https://github.com/microsoft/fluentui/issues/18499\n    updateValueInWillReceiveProps\n      ? onInputValueChange?.(newValue, composing)\n      : this.setState({ inputValue: newValue }, () => onInputValueChange?.(newValue, composing));\n  };\n\n  private _getDisplayValue(): string {\n    if (this._autoFillEnabled) {\n      return _getDisplayValue(this.value, this.props.suggestedDisplayValue);\n    }\n\n    return this.value;\n  }\n\n  private _getControlledValue(): string | undefined {\n    const { value } = this.props;\n    if (value === undefined || typeof value === 'string') {\n      return value;\n    }\n\n    // eslint-disable-next-line no-console\n    console.warn(`props.value of Autofill should be a string, but it is ${value} with type of ${typeof value}`);\n\n    return value.toString();\n  }\n}\n/**\n * Returns a string that should be used as the display value.\n * It evaluates this based on whether or not the suggested value starts with the input value\n * and whether or not autofill is enabled.\n * @param inputValue - the value that the input currently has.\n * @param suggestedDisplayValue - the possible full value\n */\nfunction _getDisplayValue(inputValue: string, suggestedDisplayValue?: string): string {\n  let displayValue = inputValue;\n  if (suggestedDisplayValue && inputValue && _doesTextStartWith(suggestedDisplayValue, displayValue)) {\n    displayValue = suggestedDisplayValue;\n  }\n  return displayValue;\n}\n\nfunction _doesTextStartWith(text: string, startWith: string): boolean {\n  if (!text || !startWith) {\n    return false;\n  }\n\n  if (process.env.NODE_ENV !== 'production') {\n    for (const val of [text, startWith]) {\n      if (typeof val !== 'string') {\n        throw new Error(\n          `${\n            Autofill.name\n            // eslint-disable-next-line @fluentui/max-len\n          } received non-string value \"${val}\" of type ${typeof val} from either input's value or suggestedDisplayValue`,\n        );\n      }\n    }\n  }\n\n  return text.toLocaleLowerCase().indexOf(startWith.toLocaleLowerCase()) === 0;\n}\n","import * as React from 'react';\nimport { Autofill } from '../../Autofill';\nimport {\n  initializeComponentRef,\n  css,\n  customizable,\n  divProperties,\n  findElementRecursive,\n  findIndex,\n  focusAsync,\n  getId,\n  getNativeProps,\n  isIOS,\n  isMac,\n  KeyCodes,\n  shallowCompare,\n  mergeAriaAttributeValues,\n  warnMutuallyExclusive,\n  Async,\n  EventGroup,\n  getPropsWithDefaults,\n} from '../../Utilities';\nimport { Callout, DirectionalHint } from '../../Callout';\nimport { Checkbox } from '../../Checkbox';\nimport { getCaretDownButtonStyles, getOptionStyles, getStyles } from './ComboBox.styles';\nimport { getClassNames, getComboBoxOptionClassNames } from './ComboBox.classNames';\nimport { Label } from '../../Label';\nimport { SelectableOptionMenuItemType, getAllSelectedOptions } from '../../SelectableOption';\nimport { BaseButton, Button, CommandButton, IconButton } from '../../Button';\nimport { useMergedRefs } from '@fluentui/react-hooks';\nimport type { IAutofill } from '../../Autofill';\nimport type { IRenderFunction } from '../../Utilities';\nimport type { IComboBoxClassNames } from './ComboBox.classNames';\nimport type {\n  IComboBoxOption,\n  IComboBoxOptionStyles,\n  IComboBoxProps,\n  IOnRenderComboBoxLabelProps,\n  IComboBox,\n} from './ComboBox.types';\nimport type { IButtonStyles } from '../../Button';\nimport type { ICalloutProps } from '../../Callout';\nimport { getChildren } from '@fluentui/utilities';\n\nexport interface IComboBoxState {\n  /** The open state */\n  isOpen?: boolean;\n\n  /** The focused state of the combo box */\n  focusState?: 'none' | 'focused' | 'focusing';\n\n  /**\n   * When taking input, this will store the index that the options input matches\n   * (-1 if no input or match)\n   */\n  currentPendingValueValidIndex: number;\n\n  /**\n   * Stores the hovered over value in the dropdown\n   * (used for styling the options without updating the input)\n   */\n  currentPendingValueValidIndexOnHover: number;\n\n  /** When taking input, this will store the actual text that is being entered */\n  currentPendingValue?: string;\n\n  /**\n   * The id of the current focused combo item, otherwise the id of the currently selected element,\n   * null otherwise\n   */\n  ariaActiveDescendantValue?: string;\n}\n\nenum SearchDirection {\n  backward = -1,\n  none = 0,\n  forward = 1,\n}\n\nenum HoverStatus {\n  /** Used when the user was hovering and has since moused out of the menu items */\n  clearAll = -2,\n  /** Default \"normal\" state, when no hover has happened or a hover is in progress */\n  default = -1,\n}\n\nconst ScrollIdleDelay = 250; /* ms */\nconst TouchIdleDelay = 500; /* ms */\n\n/**\n * This is used to clear any pending autocomplete text (used when autocomplete is true and\n * allowFreeform is false)\n */\nconst ReadOnlyPendingAutoCompleteTimeout = 1000; /* ms */\n\ninterface IComboBoxOptionWrapperProps extends IComboBoxOption {\n  /** True if the option is currently selected */\n  isSelected: boolean;\n\n  /** True if the option is currently checked (multi-select) */\n  isChecked: boolean;\n\n  /** True if the option is currently indeterminate (multi-select select all option) */\n  isIndeterminate: boolean;\n\n  /**\n   * A function that returns the children of the OptionWrapper. We pass this in as a function to ensure that\n   * children methods don't get called unnecessarily if the component doesn't need to be updated. This leads\n   * to a significant performance increase in ComboBoxes with many options and/or complex onRenderOption functions\n   */\n  render: () => JSX.Element;\n}\n\n/**\n * Internal component that is used to wrap all ComboBox options.\n * This is used to customize when we want to re-render components,\n * so we don't re-render every option every time render is executed.\n */\nconst ComboBoxOptionWrapper = React.memo(\n  ({ render }: IComboBoxOptionWrapperProps) => render(),\n  (\n    { render: oldRender, ...oldProps }: IComboBoxOptionWrapperProps,\n    { render: newRender, ...newProps }: IComboBoxOptionWrapperProps,\n  ) =>\n    // The render function will always be different, so we ignore that prop\n    shallowCompare(oldProps, newProps),\n);\n\nconst COMPONENT_NAME = 'ComboBox';\nconst DEFAULT_PROPS: Partial<IComboBoxProps> = {\n  options: [],\n  allowFreeform: false,\n  autoComplete: 'on',\n  buttonIconProps: { iconName: 'ChevronDown' },\n};\n\nfunction useOptionsState({ options, defaultSelectedKey, selectedKey }: IComboBoxProps) {\n  /** The currently selected indices */\n  const [selectedIndices, setSelectedIndices] = React.useState<number[]>(() =>\n    getSelectedIndices(options, buildDefaultSelectedKeys(defaultSelectedKey, selectedKey)),\n  );\n  /** The options currently available for the callout */\n  const [currentOptions, setCurrentOptions] = React.useState<IComboBoxOption[]>(options);\n  /** This value is used for the autocomplete hint value */\n  const [suggestedDisplayValue, setSuggestedDisplayValue] = React.useState<string>();\n\n  React.useEffect(() => {\n    if (selectedKey !== undefined) {\n      const selectedKeys: string[] | number[] = buildSelectedKeys(selectedKey);\n      const indices: number[] = getSelectedIndices(options, selectedKeys);\n\n      setSelectedIndices(indices);\n    }\n    setCurrentOptions(options);\n  }, [options, selectedKey]);\n\n  React.useEffect(() => {\n    if (selectedKey === null) {\n      setSuggestedDisplayValue(undefined);\n    }\n  }, [selectedKey]);\n\n  return [\n    selectedIndices,\n    setSelectedIndices,\n    currentOptions,\n    setCurrentOptions,\n    suggestedDisplayValue,\n    setSuggestedDisplayValue,\n  ] as const;\n}\n\nexport const ComboBox: React.FunctionComponent<IComboBoxProps> = React.forwardRef<HTMLDivElement, IComboBoxProps>(\n  (propsWithoutDefaults: IComboBoxProps, forwardedRef: React.Ref<HTMLDivElement>) => {\n    const { ref, ...props } = getPropsWithDefaults(DEFAULT_PROPS, propsWithoutDefaults);\n    const rootRef = React.useRef<HTMLDivElement>(null);\n\n    const mergedRootRef = useMergedRefs(rootRef, forwardedRef);\n\n    const [\n      selectedIndices,\n      setSelectedIndices,\n      currentOptions,\n      setCurrentOptions,\n      suggestedDisplayValue,\n      setSuggestedDisplayValue,\n    ] = useOptionsState(props);\n\n    return (\n      <ComboBoxInternal\n        {...props}\n        hoisted={{\n          mergedRootRef,\n          rootRef,\n          selectedIndices,\n          setSelectedIndices,\n          currentOptions,\n          setCurrentOptions,\n          suggestedDisplayValue,\n          setSuggestedDisplayValue,\n        }}\n      />\n    );\n  },\n);\nComboBox.displayName = COMPONENT_NAME;\n\ninterface IComboBoxInternalProps extends Omit<IComboBoxProps, 'ref'> {\n  hoisted: {\n    mergedRootRef: React.Ref<HTMLDivElement>;\n    rootRef: React.RefObject<HTMLDivElement>;\n    selectedIndices: number[];\n    currentOptions: IComboBoxOption[];\n    suggestedDisplayValue?: string;\n    setSelectedIndices: React.Dispatch<React.SetStateAction<number[]>>;\n    setCurrentOptions: React.Dispatch<React.SetStateAction<IComboBoxOption[]>>;\n    setSuggestedDisplayValue: React.Dispatch<React.SetStateAction<string | undefined>>;\n  };\n}\n\n/**\n * Depth-first search to find the first descendant element where the match function returns true.\n * @param element - element to start searching at\n * @param match - the function that determines if the element is a match\n * @returns the matched element or null no match was found\n */\nfunction findFirstDescendant(element: HTMLElement, match: (element: HTMLElement) => boolean): HTMLElement | null {\n  const children = getChildren(element);\n\n  // For loop is used because forEach cannot be stopped.\n  for (let index = 0; index < children.length; index++) {\n    const child = children[index];\n    if (match(child)) {\n      return child;\n    }\n    const candidate = findFirstDescendant(child, match);\n    if (candidate) {\n      return candidate;\n    }\n  }\n  return null;\n}\n\n@customizable('ComboBox', ['theme', 'styles'], true)\nclass ComboBoxInternal extends React.Component<IComboBoxInternalProps, IComboBoxState> implements IComboBox {\n  /** The input aspect of the combo box */\n  private _autofill = React.createRef<IAutofill>();\n\n  /** The wrapping div of the input and button */\n  private _comboBoxWrapper = React.createRef<HTMLDivElement>();\n\n  /** The callout element */\n  private _comboBoxMenu = React.createRef<HTMLDivElement>();\n\n  /** The menu item element that is currently selected */\n  private _selectedElement = React.createRef<HTMLSpanElement>();\n\n  /** The base id for the ComboBox */\n  private _id: string;\n\n  /**\n   * After a character is inserted when autocomplete is true and allowFreeform is false,\n   * remember the task that will clear the pending string of characters.\n   */\n  private _autoCompleteTimeout: number | undefined;\n\n  /** Promise used when resolving the comboBox options */\n  private _currentPromise: PromiseLike<IComboBoxOption[]>;\n\n  /** The current visible value sent to the auto fill on render */\n  private _currentVisibleValue: string | undefined;\n  private _classNames: IComboBoxClassNames;\n  private _isScrollIdle: boolean;\n  private _hasPendingValue: boolean;\n  private _scrollIdleTimeoutId: number | undefined;\n  private _processingTouch: boolean;\n  private _lastTouchTimeoutId: number | undefined;\n  /** True if the most recent keydown event was for alt (option) or meta (command). */\n  private _lastKeyDownWasAltOrMeta: boolean | undefined;\n\n  /**\n   * Determines if we should be setting focus back to the input when the menu closes.\n   * The general rule of thumb is if the menu was launched via the keyboard focus should go back\n   * to the input, if it was dropped via the mouse focus should not be forced back to the input.\n   */\n  private _focusInputAfterClose: boolean;\n\n  /** Flag for when we get the first mouseMove */\n  private _gotMouseMove: boolean;\n\n  private _processingClearPendingInfo: boolean;\n\n  private _async: Async;\n  private _events: EventGroup;\n\n  constructor(props: IComboBoxInternalProps) {\n    super(props);\n\n    initializeComponentRef(this);\n    this._async = new Async(this);\n    this._events = new EventGroup(this);\n\n    warnMutuallyExclusive(COMPONENT_NAME, props, {\n      defaultSelectedKey: 'selectedKey',\n      text: 'defaultSelectedKey',\n      selectedKey: 'value',\n      dropdownWidth: 'useComboBoxAsMenuWidth',\n      ariaLabel: 'label',\n    });\n\n    this._id = props.id || getId('ComboBox');\n\n    this._isScrollIdle = true;\n    this._processingTouch = false;\n    this._gotMouseMove = false;\n    this._processingClearPendingInfo = false;\n\n    this.state = {\n      isOpen: false,\n      focusState: 'none',\n      currentPendingValueValidIndex: -1,\n      currentPendingValue: undefined,\n      currentPendingValueValidIndexOnHover: HoverStatus.default,\n    };\n  }\n\n  /**\n   * All selected options\n   */\n  public get selectedOptions(): IComboBoxOption[] {\n    const { currentOptions, selectedIndices } = this.props.hoisted;\n\n    return getAllSelectedOptions(currentOptions, selectedIndices!);\n  }\n\n  public componentDidMount(): void {\n    if (this._comboBoxWrapper.current && !this.props.disabled) {\n      // hook up resolving the options if needed on focus\n      this._events.on(this._comboBoxWrapper.current, 'focus', this._onResolveOptions, true);\n      if ('onpointerdown' in this._comboBoxWrapper.current) {\n        // For ComboBoxes, touching anywhere in the combo box should drop the dropdown, including the input element.\n        // This gives more hit target space for touch environments. We're setting the onpointerdown here, because React\n        // does not support Pointer events yet.\n        this._events.on(this._comboBoxWrapper.current, 'pointerdown', this._onPointerDown, true);\n      }\n    }\n  }\n\n  public componentDidUpdate(prevProps: IComboBoxInternalProps, prevState: IComboBoxState) {\n    const {\n      allowFreeform,\n      allowFreeInput,\n      text,\n      onMenuOpen,\n      onMenuDismissed,\n      hoisted: { currentOptions, selectedIndices },\n    } = this.props;\n    const { currentPendingValue, currentPendingValueValidIndex, isOpen } = this.state;\n\n    // If we are newly open or are open and the pending valid index changed,\n    // make sure the currently selected/pending option is scrolled into view\n    if (isOpen && (!prevState.isOpen || prevState.currentPendingValueValidIndex !== currentPendingValueValidIndex)) {\n      // Need this timeout so that the selectedElement ref is correctly updated\n      this._async.setTimeout(() => this._scrollIntoView(), 0);\n    }\n\n    // if an action is taken that put focus in the ComboBox\n    // and If we are open or we are just closed, shouldFocusAfterClose is set,\n    // but we are not the activeElement set focus on the input\n    if (\n      this._hasFocus() &&\n      (isOpen ||\n        (prevState.isOpen &&\n          !isOpen &&\n          this._focusInputAfterClose &&\n          this._autofill.current &&\n          document.activeElement !== this._autofill.current.inputElement))\n    ) {\n      this.focus(undefined /*shouldOpenOnFocus*/, true /*useFocusAsync*/);\n    }\n\n    // If we should focusAfterClose AND\n    //   just opened/closed the menu OR\n    //   are focused AND\n    //     updated the selectedIndex with the menu closed OR\n    //     are not allowing freeform or free input OR\n    //     the value changed\n    // we need to set selection\n    if (\n      this._focusInputAfterClose &&\n      ((prevState.isOpen && !isOpen) ||\n        (this._hasFocus() &&\n          ((!isOpen &&\n            !this.props.multiSelect &&\n            prevProps.hoisted.selectedIndices &&\n            selectedIndices &&\n            prevProps.hoisted.selectedIndices[0] !== selectedIndices[0]) ||\n            (!allowFreeform && !allowFreeInput) ||\n            text !== prevProps.text)))\n    ) {\n      this._onFocus();\n    }\n\n    this._notifyPendingValueChanged(prevState);\n\n    if (isOpen && !prevState.isOpen && onMenuOpen) {\n      onMenuOpen();\n    }\n\n    if (!isOpen && prevState.isOpen && onMenuDismissed) {\n      onMenuDismissed();\n    }\n\n    let newCurrentPendingValueValidIndex = currentPendingValueValidIndex;\n    const options = currentOptions.map((item, index) => ({ ...item, index }));\n\n    // If currentOptions differs from the previous currentOptions we need to update the currentPendingValueValidIndex\n    // otherwise, it will be out of sync with the currentOptions. This can happen when the options are filtered.\n    if (!shallowCompare(prevProps.hoisted.currentOptions, currentOptions) && currentPendingValue) {\n      newCurrentPendingValueValidIndex =\n        this.props.allowFreeform || this.props.allowFreeInput\n          ? this._processInputChangeWithFreeform(currentPendingValue)\n          : this._updateAutocompleteIndexWithoutFreeform(currentPendingValue);\n    }\n\n    let descendantText = undefined;\n\n    if (isOpen && selectedIndices.length) {\n      descendantText = options[selectedIndices[0]]?.id ?? this._id + '-list' + selectedIndices[0];\n    } else if (isOpen && this._hasFocus() && newCurrentPendingValueValidIndex !== -1) {\n      descendantText =\n        options[newCurrentPendingValueValidIndex].id ?? this._id + '-list' + newCurrentPendingValueValidIndex;\n    }\n\n    if (descendantText !== this.state.ariaActiveDescendantValue) {\n      this.setState({\n        ariaActiveDescendantValue: descendantText,\n      });\n    }\n  }\n\n  public componentWillUnmount(): void {\n    this._async.dispose();\n    this._events.dispose();\n  }\n\n  // Primary Render\n  public render(): JSX.Element {\n    const id = this._id;\n    const errorMessageId = id + '-error';\n    const {\n      className,\n      disabled,\n      required,\n      errorMessage,\n      onRenderContainer = this._onRenderContainer,\n      onRenderLabel = this._onRenderLabel,\n      onRenderList = this._onRenderList,\n      onRenderItem = this._onRenderItem,\n      onRenderOption = this._onRenderOptionContent,\n      allowFreeform,\n      styles: customStyles,\n      theme,\n      persistMenu,\n      multiSelect,\n      hoisted: { suggestedDisplayValue, selectedIndices, currentOptions },\n    } = this.props;\n    const { isOpen } = this.state;\n    this._currentVisibleValue = this._getVisibleValue();\n\n    // Single select is already accessible since the whole text is selected\n    // when focus enters the input. Since multiselect appears to clear the input\n    // it needs special accessible text\n    const multiselectAccessibleText = multiSelect\n      ? this._getMultiselectDisplayString(selectedIndices, currentOptions, suggestedDisplayValue)\n      : undefined;\n\n    const divProps = getNativeProps<React.HTMLAttributes<HTMLDivElement>>(this.props, divProperties, [\n      'onChange',\n      'value',\n      'aria-describedby',\n      'aria-labelledby',\n    ]);\n\n    const hasErrorMessage = errorMessage && errorMessage.length > 0 ? true : false;\n\n    this._classNames = this.props.getClassNames\n      ? this.props.getClassNames(\n          theme!,\n          !!isOpen,\n          !!disabled,\n          !!required,\n          !!this._hasFocus(),\n          !!allowFreeform,\n          !!hasErrorMessage,\n          className,\n        )\n      : getClassNames(\n          getStyles(theme!, customStyles),\n          className!,\n          !!isOpen,\n          !!disabled,\n          !!required,\n          !!this._hasFocus(),\n          !!allowFreeform,\n          !!hasErrorMessage,\n        );\n\n    const comboBoxWrapper = this._renderComboBoxWrapper(multiselectAccessibleText, errorMessageId);\n\n    return (\n      <div {...divProps} ref={this.props.hoisted.mergedRootRef} className={this._classNames.container}>\n        {onRenderLabel({ props: this.props, multiselectAccessibleText }, this._onRenderLabel)}\n        {comboBoxWrapper}\n        {(persistMenu || isOpen) &&\n          onRenderContainer(\n            {\n              ...this.props,\n              onRenderList,\n              onRenderItem,\n              onRenderOption,\n              options: currentOptions.map((item, index) => ({ ...item, index })),\n              onDismiss: this._onDismiss,\n            },\n            this._onRenderContainer,\n          )}\n        {hasErrorMessage && (\n          <div role=\"alert\" id={errorMessageId} className={this._classNames.errorMessage}>\n            {errorMessage}\n          </div>\n        )}\n      </div>\n    );\n  }\n\n  /**\n   * {@inheritdoc}\n   */\n  public focus = (shouldOpenOnFocus?: boolean, useFocusAsync?: boolean): void => {\n    if (this.props.disabled) {\n      return;\n    }\n\n    if (this._autofill.current) {\n      if (useFocusAsync) {\n        focusAsync(this._autofill.current);\n      } else {\n        this._autofill.current.focus();\n      }\n\n      if (shouldOpenOnFocus) {\n        this.setState({\n          isOpen: true,\n        });\n      }\n    }\n\n    // Programmatically setting focus means that there is nothing else that needs to be done\n    // Focus is now contained\n    if (!this._hasFocus()) {\n      this.setState({ focusState: 'focused' });\n    }\n  };\n\n  /**\n   * Close menu callout if it is open\n   */\n  public dismissMenu = (): void => {\n    const { isOpen } = this.state;\n    isOpen && this.setState({ isOpen: false });\n  };\n\n  /**\n   * componentWillReceiveProps handler for the auto fill component\n   * Checks/updates the input value to set, if needed\n   * @param defaultVisibleValue - the defaultVisibleValue that got passed\n   *  in to the auto fill's componentWillReceiveProps\n   * @returns - the updated value to set, if needed\n   */\n  private _onUpdateValueInAutofillWillReceiveProps = (): string | null => {\n    const comboBox = this._autofill.current;\n\n    if (!comboBox) {\n      return null;\n    }\n\n    if (comboBox.value === null || comboBox.value === undefined) {\n      return null;\n    }\n\n    return normalizeToString(this._currentVisibleValue);\n  };\n\n  private _renderComboBoxWrapper = (\n    multiselectAccessibleText: string | undefined,\n    errorMessageId: string,\n  ): JSX.Element => {\n    const {\n      label,\n      disabled,\n      ariaLabel,\n      ariaDescribedBy = this.props['aria-describedby'],\n      required,\n      errorMessage,\n      buttonIconProps,\n      isButtonAriaHidden,\n      title,\n      placeholder: placeholderProp,\n      tabIndex,\n      autofill,\n      iconButtonProps,\n      hoisted: { suggestedDisplayValue },\n    } = this.props;\n\n    const { ariaActiveDescendantValue, isOpen } = this.state;\n\n    // If the combo box has focus, is multiselect, and has a display string, then use that placeholder\n    // so that the selected items don't appear to vanish. This is not ideal but it's the only reasonable way\n    // to correct the behavior where the input is cleared so the user can type. If a full refactor is done, then this\n    // should be removed and the multiselect combo box should behave like a picker.\n    const placeholder =\n      this._hasFocus() && this.props.multiSelect && multiselectAccessibleText\n        ? multiselectAccessibleText\n        : placeholderProp;\n\n    const labelledBy = [this.props['aria-labelledby'], label && this._id + '-label'].join(' ').trim();\n    const labelProps = {\n      'aria-labelledby': labelledBy ? labelledBy : undefined,\n      'aria-label': ariaLabel && !label ? ariaLabel : undefined,\n    };\n\n    return (\n      <div\n        data-ktp-target={true}\n        ref={this._comboBoxWrapper}\n        id={this._id + 'wrapper'}\n        className={this._classNames.root}\n        aria-owns={isOpen ? this._id + '-list' : undefined}\n      >\n        <Autofill\n          data-ktp-execute-target={true}\n          data-is-interactable={!disabled}\n          componentRef={this._autofill}\n          id={this._id + '-input'}\n          className={this._classNames.input}\n          type=\"text\"\n          onFocus={this._onFocus}\n          onBlur={this._onBlur}\n          onKeyDown={this._onInputKeyDown}\n          onKeyUp={this._onInputKeyUp}\n          onClick={this._onAutofillClick}\n          onTouchStart={this._onTouchStart}\n          onInputValueChange={this._onInputChange}\n          aria-expanded={isOpen}\n          aria-autocomplete={this._getAriaAutoCompleteValue()}\n          role=\"combobox\"\n          readOnly={disabled}\n          {...labelProps}\n          aria-describedby={\n            errorMessage !== undefined ? mergeAriaAttributeValues(ariaDescribedBy, errorMessageId) : ariaDescribedBy\n          }\n          aria-activedescendant={ariaActiveDescendantValue}\n          aria-required={required}\n          aria-disabled={disabled}\n          aria-controls={isOpen ? this._id + '-list' : undefined}\n          spellCheck={false}\n          defaultVisibleValue={this._currentVisibleValue}\n          suggestedDisplayValue={suggestedDisplayValue}\n          updateValueInWillReceiveProps={this._onUpdateValueInAutofillWillReceiveProps}\n          shouldSelectFullInputValueInComponentDidUpdate={\n            this._onShouldSelectFullInputValueInAutofillComponentDidUpdate\n          }\n          title={title}\n          preventValueSelection={!this._hasFocus()}\n          placeholder={placeholder}\n          tabIndex={disabled ? -1 : tabIndex}\n          {...autofill}\n        />\n        <IconButton\n          className={'ms-ComboBox-CaretDown-button'}\n          styles={this._getCaretButtonStyles()}\n          role={isButtonAriaHidden ? 'presentation' : undefined}\n          aria-hidden={isButtonAriaHidden}\n          {...(!isButtonAriaHidden ? labelProps : undefined)}\n          data-is-focusable={false}\n          tabIndex={-1}\n          onClick={this._onComboBoxClick}\n          onBlur={this._onBlur}\n          iconProps={buttonIconProps}\n          disabled={disabled}\n          checked={isOpen}\n          {...iconButtonProps}\n        />\n      </div>\n    );\n  };\n\n  /**\n   * componentDidUpdate handler for the auto fill component\n   *\n   * @param defaultVisibleValue - the current defaultVisibleValue in the auto fill's componentDidUpdate\n   * @param suggestedDisplayValue - the current suggestedDisplayValue in the auto fill's componentDidUpdate\n   * @returns - should the full value of the input be selected?\n   * True if the defaultVisibleValue equals the suggestedDisplayValue, false otherwise\n   */\n  private _onShouldSelectFullInputValueInAutofillComponentDidUpdate = (): boolean => {\n    return this._currentVisibleValue === this.props.hoisted.suggestedDisplayValue;\n  };\n\n  /**\n   * Get the correct value to pass to the input\n   * to show to the user based off of the current props and state\n   * @returns the value to pass to the input\n   */\n  private _getVisibleValue = (): string | undefined => {\n    const {\n      text,\n      allowFreeform,\n      allowFreeInput,\n      autoComplete,\n      hoisted: { suggestedDisplayValue, selectedIndices, currentOptions },\n    } = this.props;\n    const { currentPendingValueValidIndex, currentPendingValue, isOpen } = this.state;\n\n    const currentPendingIndexValid = indexWithinBounds(currentOptions, currentPendingValueValidIndex);\n\n    // If the user passed is a value prop, use that\n    // unless we are open and have a valid current pending index\n    if (\n      !(isOpen && currentPendingIndexValid) &&\n      (text || text === '') &&\n      (currentPendingValue === null || currentPendingValue === undefined)\n    ) {\n      return text;\n    }\n\n    if (this.props.multiSelect) {\n      // Multi-select\n      if (this._hasFocus()) {\n        let index = -1;\n        if (autoComplete === 'on' && currentPendingIndexValid) {\n          index = currentPendingValueValidIndex;\n        }\n        return this._getPendingString(currentPendingValue, currentOptions, index);\n      } else {\n        return this._getMultiselectDisplayString(selectedIndices, currentOptions, suggestedDisplayValue);\n      }\n    } else {\n      // Single-select\n      let index: number = this._getFirstSelectedIndex();\n      if (allowFreeform || allowFreeInput) {\n        // If we are allowing freeform/free input and autocomplete is also true\n        // and we've got a pending value that matches an option, remember\n        // the matched option's index\n        if (autoComplete === 'on' && currentPendingIndexValid) {\n          index = currentPendingValueValidIndex;\n        }\n\n        // Since we are allowing freeform, if there is currently a pending value, use that\n        // otherwise use the index determined above (falling back to '' if we did not get a valid index)\n        return this._getPendingString(currentPendingValue, currentOptions, index);\n      } else {\n        // If we are not allowing freeform and have a valid index that matches the pending value,\n        // we know we will need some version of the pending value\n        if (currentPendingIndexValid && autoComplete === 'on') {\n          // If autoComplete is on, return the raw pending value, otherwise remember\n          // the matched option's index\n          index = currentPendingValueValidIndex;\n          return normalizeToString(currentPendingValue);\n        } else if (!this.state.isOpen && currentPendingValue) {\n          return indexWithinBounds(currentOptions, index)\n            ? currentPendingValue\n            : normalizeToString(suggestedDisplayValue);\n        } else {\n          return indexWithinBounds(currentOptions, index)\n            ? getPreviewText(currentOptions[index])\n            : normalizeToString(suggestedDisplayValue);\n        }\n      }\n    }\n  };\n\n  private _getPendingString(\n    currentPendingValue: string | null | undefined,\n    currentOptions: IComboBoxOption[],\n    index: number,\n  ) {\n    return currentPendingValue !== null && currentPendingValue !== undefined\n      ? currentPendingValue\n      : indexWithinBounds(currentOptions, index)\n      ? getPreviewText(currentOptions[index])\n      : '';\n  }\n\n  /**\n   * Returns a string that concatenates all of the selected values\n   * for multiselect combo box.\n   */\n  private _getMultiselectDisplayString(\n    selectedIndices: number[] | undefined,\n    currentOptions: IComboBoxOption[],\n    suggestedDisplayValue: string | undefined,\n  ) {\n    const displayValues = [];\n    for (let idx = 0; selectedIndices && idx < selectedIndices.length; idx++) {\n      const index: number = selectedIndices[idx];\n      if (currentOptions[index].itemType !== SelectableOptionMenuItemType.SelectAll) {\n        displayValues.push(\n          indexWithinBounds(currentOptions, index)\n            ? currentOptions[index].text\n            : normalizeToString(suggestedDisplayValue),\n        );\n      }\n    }\n    const { multiSelectDelimiter = ', ' } = this.props;\n    return displayValues.join(multiSelectDelimiter);\n  }\n\n  /**\n   * Handler for typing changes on the input\n   * @param updatedValue - the newly changed value\n   */\n  private _onInputChange = (updatedValue: string): void => {\n    if (this.props.disabled) {\n      this._handleInputWhenDisabled(null /* event */);\n      return;\n    }\n\n    if (this.props.onInputValueChange) {\n      this.props.onInputValueChange(updatedValue);\n    }\n\n    this.props.allowFreeform || this.props.allowFreeInput\n      ? this._processInputChangeWithFreeform(updatedValue)\n      : this._processInputChangeWithoutFreeform(updatedValue);\n  };\n\n  /**\n   * Process the new input's new value when the combo box allows freeform entry\n   * @param updatedValue - the input's newly changed value\n   * @returns the index of the matched option, -1 if no match was found\n   */\n  private _processInputChangeWithFreeform(updatedValue: string): number {\n    const { currentOptions } = this.props.hoisted;\n    let newCurrentPendingValueValidIndex = -1;\n\n    // if the new value is empty, see if we have an exact match and then set the pending info\n    if (updatedValue === '') {\n      const items = currentOptions\n        .map((item, index) => ({ ...item, index }))\n        .filter(option => isNormalOption(option) && !option.disabled && getPreviewText(option) === updatedValue);\n\n      // if we found a match remember the index\n      if (items.length === 1) {\n        newCurrentPendingValueValidIndex = items[0].index;\n      }\n\n      this._setPendingInfo(updatedValue, newCurrentPendingValueValidIndex, updatedValue);\n      return newCurrentPendingValueValidIndex;\n    }\n\n    // Remember the original value and then make the value lowercase for comparison\n    const originalUpdatedValue: string = updatedValue;\n    updatedValue = updatedValue.toLocaleLowerCase();\n\n    let newSuggestedDisplayValue = '';\n\n    // If autoComplete is on, attempt to find a match from the available options\n    if (this.props.autoComplete === 'on') {\n      // If autoComplete is on, attempt to find a match where the text of an option starts with the updated value\n      const items = currentOptions\n        .map((item, index) => ({ ...item, index }))\n        .filter(\n          option =>\n            isNormalOption(option) &&\n            !option.disabled &&\n            getPreviewText(option).toLocaleLowerCase().indexOf(updatedValue) === 0,\n        );\n      if (items.length > 0) {\n        // use ariaLabel as the value when the option is set\n        const text: string = getPreviewText(items[0]);\n\n        // If the user typed out the complete option text, we don't need any suggested display text anymore\n        newSuggestedDisplayValue = text.toLocaleLowerCase() !== updatedValue ? text : '';\n\n        // remember the index of the match we found\n        newCurrentPendingValueValidIndex = items[0].index;\n      }\n    } else {\n      // If autoComplete is off, attempt to find a match only when the value is exactly equal to the text of an option\n      const items = currentOptions\n        .map((item, index) => ({ ...item, index }))\n        .filter(\n          option =>\n            isNormalOption(option) && !option.disabled && getPreviewText(option).toLocaleLowerCase() === updatedValue,\n        );\n\n      // if we found a match remember the index\n      if (items.length === 1) {\n        newCurrentPendingValueValidIndex = items[0].index;\n      }\n    }\n\n    // Set the updated state\n    this._setPendingInfo(originalUpdatedValue, newCurrentPendingValueValidIndex, newSuggestedDisplayValue);\n    return newCurrentPendingValueValidIndex;\n  }\n\n  /**\n   * Process the new input's new value when the combo box does not allow freeform entry\n   * @param updatedValue - the input's newly changed value\n   * @returns the index of the matched option\n   */\n  private _processInputChangeWithoutFreeform(updatedValue: string): number {\n    const { currentPendingValue, currentPendingValueValidIndex } = this.state;\n\n    if (this.props.autoComplete === 'on') {\n      // If autoComplete is on while allow freeform is off,\n      // we will remember the key press and build up a string to attempt to match\n      // as long as characters are typed within a the timeout span of each other,\n      // otherwise we will clear the string and start building a new one on the next keypress.\n      // Also, only do this processing if we have a non-empty value\n      if (updatedValue !== '') {\n        // If we have a pending autocomplete clearing task,\n        // we know that the user is typing with key press happening\n        // within the timeout of each other so remove the clearing task\n        // and continue building the pending value with the updated value\n        if (this._autoCompleteTimeout) {\n          this._async.clearTimeout(this._autoCompleteTimeout);\n          this._autoCompleteTimeout = undefined;\n          updatedValue = normalizeToString(currentPendingValue) + updatedValue;\n        }\n\n        const matchingIndex = this._updateAutocompleteIndexWithoutFreeform(updatedValue);\n\n        // Schedule a timeout to clear the pending value after the timeout span\n        this._autoCompleteTimeout = this._async.setTimeout(() => {\n          this._autoCompleteTimeout = undefined;\n        }, ReadOnlyPendingAutoCompleteTimeout);\n\n        return matchingIndex;\n      }\n    }\n\n    // If we get here, autoComplete is off.\n    // Remember we are not allowing freeform, so at this point, if we have a pending valid value index\n    // use that; otherwise use the selectedIndex\n    const index = currentPendingValueValidIndex >= 0 ? currentPendingValueValidIndex : this._getFirstSelectedIndex();\n\n    // Since we are not allowing freeform, we need to\n    // set both the pending and suggested values/index\n    // to allow us to select all content in the input to\n    // give the illusion that we are readonly (e.g. freeform off)\n    this._setPendingInfoFromIndex(index);\n    return index;\n  }\n\n  private _updateAutocompleteIndexWithoutFreeform(updatedValue: string): number {\n    const { currentOptions } = this.props.hoisted;\n    const originalUpdatedValue: string = updatedValue;\n    updatedValue = updatedValue.toLocaleLowerCase();\n\n    // If autoComplete is on, attempt to find a match where the text of an option starts with the updated value\n    const items = currentOptions\n      .map((item, i) => ({ ...item, index: i }))\n\n      .filter(\n        option =>\n          isNormalOption(option) && !option.disabled && option.text.toLocaleLowerCase().indexOf(updatedValue) === 0,\n      );\n\n    // If we found a match, update the state\n    if (items.length > 0) {\n      this._setPendingInfo(originalUpdatedValue, items[0].index, getPreviewText(items[0]));\n      return items[0].index;\n    }\n\n    return -1;\n  }\n\n  private _getFirstSelectedIndex(): number {\n    const { selectedIndices } = this.props.hoisted;\n    return selectedIndices?.length ? selectedIndices[0] : -1;\n  }\n\n  /**\n   * Walk along the options starting at the index, stepping by the delta (positive or negative)\n   * looking for the next valid selectable index (e.g. skipping headings and dividers)\n   * @param index - the index to get the next selectable index from\n   * @param delta - optional delta to step by when finding the next index, defaults to 0\n   * @returns - the next valid selectable index. If the new index is outside of the bounds,\n   * it will snap to the edge of the options array. If delta == 0 and the given index is not selectable\n   */\n  private _getNextSelectableIndex(index: number, searchDirection: SearchDirection): number {\n    const { currentOptions } = this.props.hoisted;\n\n    let newIndex = index + searchDirection;\n\n    newIndex = Math.max(0, Math.min(currentOptions.length - 1, newIndex));\n\n    if (!indexWithinBounds(currentOptions, newIndex)) {\n      return -1;\n    }\n\n    const option: IComboBoxOption = currentOptions[newIndex];\n\n    if (!isSelectableOption(option) || option.hidden === true) {\n      // Should we continue looking for an index to select?\n      if (\n        searchDirection !== SearchDirection.none &&\n        ((newIndex > 0 && searchDirection < SearchDirection.none) ||\n          (newIndex >= 0 && newIndex < currentOptions.length && searchDirection > SearchDirection.none))\n      ) {\n        newIndex = this._getNextSelectableIndex(newIndex, searchDirection);\n      } else {\n        // If we cannot perform a useful search just return the index we were given\n        return index;\n      }\n    }\n\n    // We have the next valid selectable index, return it\n    return newIndex;\n  }\n\n  /**\n   * Set the selected index. Note, this is\n   * the \"real\" selected index, not the pending selected index\n   * @param index - the index to set (or the index to set from if a search direction is provided)\n   * @param searchDirection - the direction to search along the options from the given index\n   */\n  private _setSelectedIndex(\n    index: number,\n    submitPendingValueEvent: React.SyntheticEvent<any>,\n    searchDirection: SearchDirection = SearchDirection.none,\n  ): void {\n    const {\n      onChange,\n      onPendingValueChanged,\n      hoisted: { selectedIndices: initialIndices, currentOptions },\n    } = this.props;\n\n    // Clone currentOptions and selectedIndices so we don't mutate state\n    let selectedIndices = initialIndices ? initialIndices.slice() : [];\n    let changedOptions = currentOptions.slice();\n\n    // Find the next selectable index, if searchDirection is none\n    // we will get our starting index back\n    index = this._getNextSelectableIndex(index, searchDirection);\n\n    if (!indexWithinBounds(currentOptions, index)) {\n      return;\n    }\n\n    // Are we at a new index? If so, update the state, otherwise\n    // there is nothing to do\n    if (\n      this.props.multiSelect ||\n      selectedIndices.length < 1 ||\n      (selectedIndices.length === 1 && selectedIndices[0] !== index)\n    ) {\n      const option: IComboBoxOption = { ...currentOptions[index] };\n      // if option doesn't existing, or option is disabled, we noop\n      if (!option || option.disabled) {\n        return;\n      }\n      if (this.props.multiSelect) {\n        // Setting the initial state of option.selected in Multi-select combo box by checking the\n        // selectedIndices array and overriding the undefined issue\n        option.selected = option.selected !== undefined ? !option.selected : selectedIndices.indexOf(index) < 0;\n\n        // handle changing all options if SelectAll is changed\n        if (option.itemType === SelectableOptionMenuItemType.SelectAll) {\n          selectedIndices = [];\n          // if select all is set to checked, push all selectable option indices\n          if (option.selected) {\n            currentOptions.forEach((currentOption, i) => {\n              if (!currentOption.disabled && isSelectableOption(currentOption)) {\n                selectedIndices.push(i);\n                changedOptions[i] = { ...currentOption, selected: true };\n              }\n            });\n          }\n          // otherwise un-check all options\n          else {\n            changedOptions = currentOptions.map(currentOption => ({ ...currentOption, selected: false }));\n          }\n        }\n        // otherwise update the individual option\n        else {\n          if (option.selected && selectedIndices.indexOf(index) < 0) {\n            selectedIndices.push(index);\n          } else if (!option.selected && selectedIndices.indexOf(index) >= 0) {\n            selectedIndices = selectedIndices.filter((value: number) => value !== index);\n          }\n          changedOptions[index] = option;\n\n          // If SelectAll exists and another option was toggled, update the SelectAll option's state\n          const selectAllOption = changedOptions.filter(o => o.itemType === SelectableOptionMenuItemType.SelectAll)[0];\n          if (selectAllOption) {\n            const selectAllState = this._isSelectAllChecked(selectedIndices);\n            const selectAllIndex = changedOptions.indexOf(selectAllOption);\n            if (selectAllState) {\n              selectedIndices.push(selectAllIndex);\n              changedOptions[selectAllIndex] = { ...selectAllOption, selected: true };\n            } else {\n              selectedIndices = selectedIndices.filter((value: number) => value !== selectAllIndex);\n              changedOptions[selectAllIndex] = { ...selectAllOption, selected: false };\n            }\n          }\n        }\n      } else {\n        selectedIndices[0] = index;\n      }\n\n      submitPendingValueEvent.persist();\n\n      // Only setState if combo box is uncontrolled.\n      if (this.props.selectedKey || this.props.selectedKey === null) {\n        // If combo box value is changed, revert preview first\n        if (this._hasPendingValue && onPendingValueChanged) {\n          onPendingValueChanged();\n          this._hasPendingValue = false;\n        }\n      } else {\n        this.props.hoisted.setSelectedIndices(selectedIndices);\n        this.props.hoisted.setCurrentOptions(changedOptions);\n\n        // If ComboBox value is changed, revert preview first\n        if (this._hasPendingValue && onPendingValueChanged) {\n          onPendingValueChanged();\n          this._hasPendingValue = false;\n        }\n      }\n\n      // Call onChange after state is updated\n      if (onChange) {\n        onChange(submitPendingValueEvent, option, index, getPreviewText(option));\n      }\n    }\n    if (this.props.multiSelect && this.state.isOpen) {\n      return;\n    }\n    // clear all of the pending info\n    this._clearPendingInfo();\n  }\n\n  /**\n   * Focus (and select) the content of the input\n   * and set the focused state\n   */\n  private _onFocus = (): void => {\n    this._autofill.current?.inputElement?.select();\n\n    if (!this._hasFocus()) {\n      this.setState({ focusState: 'focusing' });\n    }\n  };\n\n  /**\n   * Callback issued when the options should be resolved, if they have been updated or\n   * if they need to be passed in the first time. This only does work if an onResolveOptions\n   * callback was passed in\n   */\n  private _onResolveOptions = (): void => {\n    if (this.props.onResolveOptions) {\n      // get the options\n      const newOptions = this.props.onResolveOptions([...this.props.hoisted.currentOptions]);\n\n      // Check to see if the returned value is an array, if it is update the state\n      // If the returned value is not an array then check to see if it's a promise or PromiseLike.\n      // If it is then resolve it asynchronously.\n      if (Array.isArray(newOptions)) {\n        this.props.hoisted.setCurrentOptions(newOptions);\n      } else if (newOptions && (newOptions as PromiseLike<IComboBoxOption[]>).then) {\n        // Ensure that the promise will only use the callback if it was the most recent one\n        // and update the state when the promise returns\n        this._currentPromise = newOptions;\n        newOptions.then((newOptionsFromPromise: IComboBoxOption[]) => {\n          if (newOptions === this._currentPromise) {\n            this.props.hoisted.setCurrentOptions(newOptionsFromPromise);\n          }\n        });\n      }\n    }\n  };\n\n  /**\n   * OnBlur handler. Set the focused state to false\n   * and submit any pending value\n   */\n  // eslint-disable-next-line deprecation/deprecation\n  private _onBlur = (event: React.FocusEvent<HTMLElement | Autofill | BaseButton | Button>): void => {\n    // Do nothing if the blur is coming from something\n    // inside the comboBox root or the comboBox menu since\n    // it we are not really blurring from the whole comboBox\n    let relatedTarget = event.relatedTarget;\n    if (event.relatedTarget === null) {\n      // In IE11, due to lack of support, event.relatedTarget is always\n      // null making every onBlur call to be \"outside\" of the ComboBox\n      // even when it's not. Using document.activeElement is another way\n      // for us to be able to get what the relatedTarget without relying\n      // on the event\n      relatedTarget = document.activeElement as Element;\n    }\n\n    if (relatedTarget) {\n      const isBlurFromComboBoxTitle = this.props.hoisted.rootRef.current?.contains(relatedTarget as HTMLElement);\n      const isBlurFromComboBoxMenu = this._comboBoxMenu.current?.contains(relatedTarget as HTMLElement);\n      const isBlurFromComboBoxMenuAncestor =\n        this._comboBoxMenu.current &&\n        findElementRecursive(this._comboBoxMenu.current, (element: HTMLElement) => element === relatedTarget);\n\n      if (isBlurFromComboBoxTitle || isBlurFromComboBoxMenu || isBlurFromComboBoxMenuAncestor) {\n        if (\n          isBlurFromComboBoxMenuAncestor &&\n          this._hasFocus() &&\n          (!this.props.multiSelect || this.props.allowFreeform)\n        ) {\n          this._submitPendingValue(event);\n        }\n        event.preventDefault();\n        event.stopPropagation();\n        return;\n      }\n    }\n\n    if (this._hasFocus()) {\n      this.setState({ focusState: 'none' });\n      if (!this.props.multiSelect || this.props.allowFreeform) {\n        this._submitPendingValue(event);\n      }\n    }\n  };\n\n  /**\n   * Submit a pending value if there is one\n   */\n  private _submitPendingValue(submitPendingValueEvent: React.SyntheticEvent<any>): void {\n    const { onChange, allowFreeform, autoComplete, multiSelect, hoisted } = this.props;\n    const { currentOptions } = hoisted;\n    const { currentPendingValue, currentPendingValueValidIndex, currentPendingValueValidIndexOnHover } = this.state;\n    let { selectedIndices } = this.props.hoisted;\n\n    // Do not submit any pending value if we\n    // have already initiated clearing the pending info\n    if (this._processingClearPendingInfo) {\n      return;\n    }\n\n    // If we allow freeform we need to handle that\n    if (allowFreeform) {\n      // if currentPendingValue is null or undefined the user did not submit anything\n      // (not even empty because we would have stored that as the pending value)\n      if (currentPendingValue === null || currentPendingValue === undefined) {\n        // if a user did not type anything they may just hovered over an item\n        if (currentPendingValueValidIndexOnHover >= 0) {\n          this._setSelectedIndex(currentPendingValueValidIndexOnHover, submitPendingValueEvent);\n          this._clearPendingInfo();\n        }\n\n        return;\n      }\n\n      // Check to see if the user typed an exact match\n      if (indexWithinBounds(currentOptions, currentPendingValueValidIndex)) {\n        const pendingOptionText = getPreviewText(currentOptions[currentPendingValueValidIndex]).toLocaleLowerCase();\n        const autofill = this._autofill.current;\n\n        // By exact match, that means: our pending value is the same as the pending option text OR\n        // the pending option starts with the pending value and we have an \"autoComplete\" selection\n        // where the total length is equal to pending option length OR\n        // the live value in the underlying input matches the pending option; update the state\n        if (\n          currentPendingValue.toLocaleLowerCase() === pendingOptionText ||\n          (autoComplete &&\n            pendingOptionText.indexOf(currentPendingValue.toLocaleLowerCase()) === 0 &&\n            autofill?.isValueSelected &&\n            currentPendingValue.length + (autofill.selectionEnd! - autofill.selectionStart!) ===\n              pendingOptionText.length) ||\n          autofill?.inputElement?.value.toLocaleLowerCase() === pendingOptionText\n        ) {\n          this._setSelectedIndex(currentPendingValueValidIndex, submitPendingValueEvent);\n          if (multiSelect && this.state.isOpen) {\n            return;\n          }\n          this._clearPendingInfo();\n          return;\n        }\n      }\n\n      if (onChange) {\n        if (onChange) {\n          // trigger onChange to clear value\n          onChange(submitPendingValueEvent, undefined, undefined, currentPendingValue);\n        }\n      } else {\n        // If we are not controlled, create a new selected option\n        const newOption: IComboBoxOption = {\n          key: currentPendingValue || getId(),\n          text: normalizeToString(currentPendingValue),\n        };\n        // If it's multiselect, set selected state to true\n        if (multiSelect) {\n          newOption.selected = true;\n        }\n        const newOptions: IComboBoxOption[] = currentOptions.concat([newOption]);\n        if (selectedIndices) {\n          if (!multiSelect) {\n            selectedIndices = [];\n          }\n          selectedIndices.push(newOptions.length - 1);\n        }\n        hoisted.setCurrentOptions(newOptions);\n        hoisted.setSelectedIndices(selectedIndices);\n      }\n    } else if (currentPendingValueValidIndex >= 0) {\n      // Since we are not allowing freeform, we must have a matching\n      // to be able to update state\n      this._setSelectedIndex(currentPendingValueValidIndex, submitPendingValueEvent);\n    } else if (currentPendingValueValidIndexOnHover >= 0) {\n      // If all else failed and we were hovering over an item, select it\n      this._setSelectedIndex(currentPendingValueValidIndexOnHover, submitPendingValueEvent);\n    }\n\n    // Finally, clear the pending info\n    this._clearPendingInfo();\n  }\n\n  // Render Callout container and pass in list\n  private _onRenderContainer = (props: IComboBoxProps, defaultRender: IRenderFunction<IComboBoxProps>): JSX.Element => {\n    const {\n      onRenderList,\n      calloutProps,\n      dropdownWidth,\n      dropdownMaxWidth,\n      onRenderUpperContent = this._onRenderUpperContent,\n      onRenderLowerContent = this._onRenderLowerContent,\n      useComboBoxAsMenuWidth,\n      persistMenu,\n      shouldRestoreFocus = true,\n    } = props;\n\n    const { isOpen } = this.state;\n    const id = this._id;\n\n    const comboBoxMenuWidth =\n      useComboBoxAsMenuWidth && this._comboBoxWrapper.current\n        ? this._comboBoxWrapper.current.clientWidth + 2\n        : undefined;\n\n    return (\n      <Callout\n        isBeakVisible={false}\n        gapSpace={0}\n        doNotLayer={false}\n        directionalHint={DirectionalHint.bottomLeftEdge}\n        directionalHintFixed={false}\n        {...calloutProps}\n        onLayerMounted={this._onLayerMounted}\n        className={css(this._classNames.callout, calloutProps?.className)}\n        target={this._comboBoxWrapper.current}\n        onDismiss={this._onDismiss}\n        onMouseDown={this._onCalloutMouseDown}\n        onScroll={this._onScroll}\n        setInitialFocus={false}\n        calloutWidth={\n          useComboBoxAsMenuWidth && this._comboBoxWrapper.current\n            ? comboBoxMenuWidth && comboBoxMenuWidth\n            : dropdownWidth\n        }\n        calloutMaxWidth={dropdownMaxWidth ? dropdownMaxWidth : comboBoxMenuWidth}\n        hidden={persistMenu ? !isOpen : undefined}\n        shouldRestoreFocus={shouldRestoreFocus}\n      >\n        {onRenderUpperContent(this.props, this._onRenderUpperContent)}\n        <div className={this._classNames.optionsContainerWrapper} ref={this._comboBoxMenu}>\n          {onRenderList?.({ ...props, id }, this._onRenderList)}\n        </div>\n        {onRenderLowerContent(this.props, this._onRenderLowerContent)}\n      </Callout>\n    );\n  };\n\n  private _onCalloutLayerMounted() {\n    // In persistMenu mode _onLayerMounted is only called once for the lifetime\n    // of the component. Any functionality required for callout \"on mount\" can\n    // go here so that we can also call it again during callout dismissal to reset\n    // object state.\n    this._gotMouseMove = false;\n  }\n\n  private _onLayerMounted = () => {\n    this._onCalloutLayerMounted();\n\n    // need to call this again here to get the correct scroll parent dimensions\n    // when the callout is first opened\n    this._async.setTimeout(() => {\n      this._scrollIntoView();\n    }, 0);\n\n    if (this.props.calloutProps && this.props.calloutProps.onLayerMounted) {\n      this.props.calloutProps.onLayerMounted();\n    }\n  };\n\n  private _onRenderLabel = (onRenderLabelProps: IOnRenderComboBoxLabelProps): JSX.Element | null => {\n    const { label, disabled, required } = onRenderLabelProps.props;\n\n    if (label) {\n      return (\n        <Label id={this._id + '-label'} disabled={disabled} required={required} className={this._classNames.label}>\n          {label}\n          {onRenderLabelProps.multiselectAccessibleText && (\n            <span className={this._classNames.screenReaderText}>{onRenderLabelProps.multiselectAccessibleText}</span>\n          )}\n        </Label>\n      );\n    }\n\n    return null;\n  };\n\n  // Render List of items\n  private _onRenderList = (props: IComboBoxProps): JSX.Element => {\n    const { onRenderItem = this._onRenderItem, label, ariaLabel, multiSelect } = props;\n\n    let queue: { id?: string; items: JSX.Element[] } = { items: [] };\n    let renderedList: JSX.Element[] = [];\n\n    const emptyQueue = (): void => {\n      const newGroup = queue.id\n        ? [\n            <div role=\"group\" key={queue.id} aria-labelledby={queue.id}>\n              {queue.items}\n            </div>,\n          ]\n        : queue.items;\n\n      renderedList = [...renderedList, ...newGroup];\n      // Flush items and id\n      queue = { items: [] };\n    };\n\n    const placeRenderedOptionIntoQueue = (item: IComboBoxOption, index: number) => {\n      /*\n        Case Header\n          empty queue if it's not already empty\n          ensure unique ID for header and set queue ID\n          push header into queue\n        Case Divider\n          push divider into queue if not first item\n          empty queue if not already empty\n        Default\n          push item into queue\n      */\n      switch (item.itemType) {\n        case SelectableOptionMenuItemType.Header:\n          queue.items.length > 0 && emptyQueue();\n\n          const id = this._id + item.key;\n          queue.items.push(onRenderItem({ id, ...item, index }, this._onRenderItem)!);\n          queue.id = id;\n          break;\n        case SelectableOptionMenuItemType.Divider:\n          index > 0 && queue.items.push(onRenderItem({ ...item, index }, this._onRenderItem)!);\n\n          queue.items.length > 0 && emptyQueue();\n          break;\n        default:\n          queue.items.push(onRenderItem({ ...item, index }, this._onRenderItem)!);\n      }\n    };\n\n    // Place options into the queue. Queue will be emptied anytime a Header or Divider is encountered\n    props.options.forEach((item: IComboBoxOption, index: number) => {\n      placeRenderedOptionIntoQueue(item, index);\n    });\n\n    // Push remaining items into all renderedList\n    queue.items.length > 0 && emptyQueue();\n\n    const id = this._id;\n    return (\n      <div\n        id={id + '-list'}\n        className={this._classNames.optionsContainer}\n        aria-labelledby={label && id + '-label'}\n        aria-label={ariaLabel && !label ? ariaLabel : undefined}\n        aria-multiselectable={multiSelect ? 'true' : undefined}\n        role=\"listbox\"\n      >\n        {renderedList}\n      </div>\n    );\n  };\n\n  // Render items\n  private _onRenderItem = (item: IComboBoxOption): JSX.Element | null => {\n    switch (item.itemType) {\n      case SelectableOptionMenuItemType.Divider:\n        return this._renderSeparator(item);\n      case SelectableOptionMenuItemType.Header:\n        return this._renderHeader(item);\n      default:\n        return this._renderOption(item);\n    }\n  };\n\n  // Default _onRenderLowerContent function returns nothing\n  private _onRenderLowerContent = (): null => {\n    return null;\n  };\n\n  // Default _onRenderUpperContent function returns nothing\n  private _onRenderUpperContent = (): null => {\n    return null;\n  };\n\n  // Render separator\n  private _renderSeparator(item: IComboBoxOption): JSX.Element | null {\n    const { index, key } = item;\n\n    if (index && index > 0) {\n      return <div role=\"separator\" key={key} className={this._classNames.divider} />;\n    }\n    return null;\n  }\n\n  private _renderHeader(item: IComboBoxOption): JSX.Element {\n    const { onRenderOption = this._onRenderOptionContent } = this.props;\n\n    return (\n      <div id={item.id} key={item.key} className={this._classNames.header}>\n        {onRenderOption(item, this._onRenderOptionContent)}\n      </div>\n    );\n  }\n\n  private _renderCheckboxLabel(item: IComboBoxOption): JSX.Element | null {\n    const { onRenderOption = this._onRenderMultiselectOptionContent } = this.props;\n    return onRenderOption(item, this._onRenderMultiselectOptionContent);\n  }\n\n  private _renderOption = (item: IComboBoxOption): JSX.Element => {\n    const { onRenderOption = this._onRenderOptionContent } = this.props;\n    const id = item.id ?? this._id + '-list' + item.index;\n    const isSelected: boolean = this._isOptionSelected(item.index);\n    const isChecked: boolean = this._isOptionChecked(item.index);\n    const isIndeterminate: boolean = this._isOptionIndeterminate(item.index);\n    const optionStyles = this._getCurrentOptionStyles(item);\n    const optionClassNames = getComboBoxOptionClassNames(this._getCurrentOptionStyles(item));\n    const title = item.title;\n\n    const getOptionComponent = () => {\n      return !this.props.multiSelect ? (\n        <CommandButton\n          id={id}\n          key={item.key}\n          data-index={item.index}\n          styles={optionStyles}\n          checked={isSelected}\n          className={'ms-ComboBox-option'}\n          onClick={this._onItemClick(item)}\n          // eslint-disable-next-line react/jsx-no-bind\n          onMouseEnter={this._onOptionMouseEnter.bind(this, item.index)}\n          // eslint-disable-next-line react/jsx-no-bind\n          onMouseMove={this._onOptionMouseMove.bind(this, item.index)}\n          onMouseLeave={this._onOptionMouseLeave}\n          role=\"option\"\n          // aria-selected should only be applied to checked items, not hovered items\n          aria-selected={isSelected ? 'true' : 'false'}\n          ariaLabel={item.ariaLabel}\n          disabled={item.disabled}\n          title={title}\n        >\n          {\n            <span className={optionClassNames.optionTextWrapper} ref={isSelected ? this._selectedElement : undefined}>\n              {onRenderOption(item, this._onRenderOptionContent)}\n            </span>\n          }\n        </CommandButton>\n      ) : (\n        <Checkbox\n          id={id}\n          ariaLabel={item.ariaLabel}\n          ariaLabelledBy={item.ariaLabel ? undefined : id + '-label'}\n          key={item.key}\n          styles={optionStyles}\n          className={'ms-ComboBox-option'}\n          onChange={this._onItemClick(item)}\n          label={item.text}\n          checked={isChecked}\n          indeterminate={isIndeterminate}\n          title={title}\n          disabled={item.disabled}\n          // eslint-disable-next-line react/jsx-no-bind\n          onRenderLabel={this._renderCheckboxLabel.bind(this, { ...item, id: id + '-label' })}\n          inputProps={{\n            // aria-selected should only be applied to checked items, not hovered items\n            'aria-selected': isChecked ? 'true' : 'false',\n            role: 'option',\n            ...({\n              'data-index': item.index,\n              'data-is-focusable': true,\n            } as any),\n          }}\n        />\n      );\n    };\n\n    return (\n      <ComboBoxOptionWrapper\n        key={item.key}\n        index={item.index}\n        disabled={item.disabled}\n        isSelected={isSelected}\n        isChecked={isChecked}\n        isIndeterminate={isIndeterminate}\n        text={item.text}\n        // eslint-disable-next-line react/jsx-no-bind\n        render={getOptionComponent}\n        data={item.data}\n      />\n    );\n  };\n\n  /**\n   * If we are coming from a mouseOut:\n   * there is no visible selected option.\n   *\n   * Else if We are hovering over an item:\n   * that gets the selected look.\n   *\n   * Else:\n   * Use the current valid pending index if it exists OR\n   * we do not have a valid index and we currently have a pending input value,\n   * otherwise use the selected index\n   * */\n  private _isOptionHighlighted(index: number | undefined): boolean {\n    const { currentPendingValueValidIndexOnHover } = this.state;\n\n    // If the hover state is set to clearAll, don't show a selected index.\n    // Note, this happens when the user moused out of the menu items\n    if (currentPendingValueValidIndexOnHover === HoverStatus.clearAll) {\n      return false;\n    }\n\n    return currentPendingValueValidIndexOnHover >= 0\n      ? currentPendingValueValidIndexOnHover === index\n      : this._isOptionSelected(index);\n  }\n\n  private _isOptionSelected(index: number | undefined): boolean {\n    return this._getPendingSelectedIndex(true /* includePendingValue */) === index;\n  }\n\n  private _isOptionChecked(index: number | undefined): boolean {\n    if (this.props.multiSelect && index !== undefined && this.props.hoisted.selectedIndices) {\n      let idxOfSelectedIndex = -1;\n\n      idxOfSelectedIndex = this.props.hoisted.selectedIndices.indexOf(index);\n      return idxOfSelectedIndex >= 0;\n    }\n    return false;\n  }\n\n  private _isOptionIndeterminate(index: number | undefined): boolean {\n    const { multiSelect, hoisted } = this.props;\n\n    if (multiSelect && index !== undefined && hoisted.selectedIndices && hoisted.currentOptions) {\n      const option = hoisted.currentOptions[index];\n      if (option && option.itemType === SelectableOptionMenuItemType.SelectAll) {\n        return hoisted.selectedIndices.length > 0 && !this._isSelectAllChecked();\n      }\n    }\n\n    return false;\n  }\n\n  private _isSelectAllChecked(testIndices?: number[]): boolean {\n    const { multiSelect, hoisted } = this.props;\n    const selectAllOption = hoisted.currentOptions.find(\n      option => option.itemType === SelectableOptionMenuItemType.SelectAll,\n    );\n    const selectedIndices = testIndices || hoisted.selectedIndices;\n\n    if (!multiSelect || !selectedIndices || !selectAllOption) {\n      return false;\n    }\n\n    // start by not including the select all option itself\n    const selectAllIndex = hoisted.currentOptions.indexOf(selectAllOption);\n    const compareSelectedIndices = selectedIndices.filter(value => value !== selectAllIndex);\n\n    // get array of selectable options, excluding disabled options, headers, and dividers\n    const selectableOptions = hoisted.currentOptions.filter(\n      option =>\n        !option.disabled && option.itemType !== SelectableOptionMenuItemType.SelectAll && isSelectableOption(option),\n    );\n\n    return compareSelectedIndices.length === selectableOptions.length;\n  }\n\n  /**\n   * Gets the pending selected index taking into account valueValidIndex and selectedIndex\n   * @param includeCurrentPendingValue - Should we include the currentPendingValue when\n   * finding the index\n   */\n  private _getPendingSelectedIndex(includeCurrentPendingValue: boolean): number {\n    const { currentPendingValueValidIndex, currentPendingValue } = this.state;\n\n    return currentPendingValueValidIndex >= 0 ||\n      (includeCurrentPendingValue && currentPendingValue !== null && currentPendingValue !== undefined)\n      ? currentPendingValueValidIndex\n      : this.props.multiSelect\n      ? -1\n      : this._getFirstSelectedIndex();\n  }\n\n  /**\n   * Mouse clicks to headers, dividers and scrollbar should not make input lose focus\n   */\n  private _onCalloutMouseDown: ICalloutProps['onMouseDown'] = ev => {\n    ev.preventDefault();\n  };\n\n  /**\n   * Scroll handler for the callout to make sure the mouse events\n   * for updating focus are not interacting during scroll\n   */\n  private _onScroll = () => {\n    if (!this._isScrollIdle && this._scrollIdleTimeoutId !== undefined) {\n      this._async.clearTimeout(this._scrollIdleTimeoutId);\n      this._scrollIdleTimeoutId = undefined;\n    } else {\n      this._isScrollIdle = false;\n    }\n\n    if (this.props.calloutProps?.onScroll) {\n      this.props.calloutProps.onScroll();\n    }\n\n    this._scrollIdleTimeoutId = this._async.setTimeout(() => {\n      this._isScrollIdle = true;\n    }, ScrollIdleDelay);\n  };\n\n  /**\n   * Scroll the selected element into view\n   */\n  private _scrollIntoView(): void {\n    const { onScrollToItem, scrollSelectedToTop } = this.props;\n\n    const currentPendingSelectedIndex = this._getPendingSelectedIndex(true);\n\n    if (onScrollToItem) {\n      // Use the custom scroll handler\n      onScrollToItem(currentPendingSelectedIndex >= 0 ? currentPendingSelectedIndex : this._getFirstSelectedIndex());\n      return;\n    }\n\n    let scrollToElement: HTMLElement | null = this._selectedElement.current as HTMLElement;\n\n    // in multi-select there are multiple selected elements, so we use the pending select index\n    // to locate the option to scroll to.\n    if (this.props.multiSelect && this._comboBoxMenu.current) {\n      scrollToElement = findFirstDescendant(this._comboBoxMenu.current, (element: HTMLElement) => {\n        return element.dataset?.index === currentPendingSelectedIndex.toString();\n      });\n    }\n\n    if (scrollToElement && scrollToElement.offsetParent) {\n      let alignToTop = true;\n\n      // We are using refs, scroll the ref into view\n      if (this._comboBoxMenu.current && this._comboBoxMenu.current.offsetParent) {\n        const scrollableParent = this._comboBoxMenu.current.offsetParent;\n        const selectedElement = scrollToElement.offsetParent;\n\n        const { offsetHeight, offsetTop } = selectedElement as HTMLElement;\n        const { offsetHeight: parentOffsetHeight, scrollTop } = scrollableParent as HTMLElement;\n\n        const isAbove = offsetTop < scrollTop;\n        const isBelow = offsetTop + offsetHeight > scrollTop + parentOffsetHeight;\n\n        if (isAbove || scrollSelectedToTop) {\n          alignToTop = false;\n          scrollableParent.scrollTo(0, offsetTop);\n        } else if (isBelow) {\n          scrollableParent.scrollTo(0, offsetTop - parentOffsetHeight + offsetHeight);\n        }\n      }\n\n      // if _comboboxMenu doesn't exist, fall back to scrollIntoView\n      else {\n        scrollToElement.offsetParent.scrollIntoView(alignToTop);\n      }\n    }\n  }\n\n  private _onRenderOptionContent = (item: IComboBoxOption): JSX.Element => {\n    const optionClassNames = getComboBoxOptionClassNames(this._getCurrentOptionStyles(item));\n    return <span className={optionClassNames.optionText}>{item.text}</span>;\n  };\n\n  /*\n   * Render content of a multiselect item label.\n   * Text within the label is aria-hidden, to prevent duplicate input/label exposure\n   */\n  private _onRenderMultiselectOptionContent = (item: IComboBoxOption): JSX.Element => {\n    const optionClassNames = getComboBoxOptionClassNames(this._getCurrentOptionStyles(item));\n    return (\n      <span id={item.id} aria-hidden=\"true\" className={optionClassNames.optionText}>\n        {item.text}\n      </span>\n    );\n  };\n\n  /**\n   * Click handler for the menu items\n   * to select the item and also close the menu\n   * @param index - the index of the item that was clicked\n   */\n  private _onItemClick(item: IComboBoxOption): (ev: React.MouseEvent<any>) => void {\n    const { onItemClick } = this.props;\n    const { index } = item;\n    return (ev: React.MouseEvent<any>): void => {\n      // only close the callout when it's in single-select mode\n      if (!this.props.multiSelect) {\n        // ensure that focus returns to the input, not the button\n        this._autofill.current && this._autofill.current.focus();\n        this.setState({\n          isOpen: false,\n        });\n      }\n\n      // Continue processing the click only after\n      // performing menu close / control focus(inner working)\n      onItemClick && onItemClick(ev, item, index);\n      this._setSelectedIndex(index as number, ev);\n    };\n  }\n\n  /**\n   * Handles dismissing (cancelling) the menu\n   */\n  private _onDismiss = (): void => {\n    const { onMenuDismiss } = this.props;\n    if (onMenuDismiss) {\n      onMenuDismiss();\n    }\n\n    // In persistMode we need to simulate callout layer mount\n    // since that only happens once. We do it on dismiss since\n    // it works either way.\n    if (this.props.persistMenu) {\n      this._onCalloutLayerMounted();\n    }\n\n    // close the menu\n    this._setOpenStateAndFocusOnClose(false /* isOpen */, false /* focusInputAfterClose */);\n\n    // reset the selected index\n    // to the last value state\n    this._resetSelectedIndex();\n  };\n\n  /**\n   * Reset the selected index by clearing the\n   * input (of any pending text), clearing the pending state,\n   * and setting the suggested display value to the last\n   * selected state text\n   */\n  private _resetSelectedIndex(): void {\n    const { currentOptions } = this.props.hoisted;\n    this._clearPendingInfo();\n\n    const selectedIndex: number = this._getFirstSelectedIndex();\n    if (selectedIndex > 0 && selectedIndex < currentOptions.length) {\n      this.props.hoisted.setSuggestedDisplayValue(currentOptions[selectedIndex].text);\n    } else if (this.props.text) {\n      // If we had a value initially, restore it\n      this.props.hoisted.setSuggestedDisplayValue(this.props.text);\n    }\n  }\n\n  /**\n   * Clears the pending info state\n   */\n  private _clearPendingInfo(): void {\n    this._processingClearPendingInfo = true;\n\n    this.props.hoisted.setSuggestedDisplayValue(undefined);\n    this.setState(\n      {\n        currentPendingValue: undefined,\n        currentPendingValueValidIndex: -1,\n        currentPendingValueValidIndexOnHover: HoverStatus.default,\n      },\n      this._onAfterClearPendingInfo,\n    );\n  }\n\n  private _onAfterClearPendingInfo = () => {\n    this._processingClearPendingInfo = false;\n  };\n\n  /**\n   * Set the pending info\n   * @param currentPendingValue - new pending value to set\n   * @param currentPendingValueValidIndex - new pending value index to set\n   * @param suggestedDisplayValue - new suggest display value to set\n   */\n  private _setPendingInfo(\n    currentPendingValue?: string,\n    currentPendingValueValidIndex: number = -1,\n    suggestedDisplayValue?: string,\n  ): void {\n    if (this._processingClearPendingInfo) {\n      return;\n    }\n\n    this.props.hoisted.setSuggestedDisplayValue(suggestedDisplayValue);\n    this.setState({\n      currentPendingValue: normalizeToString(currentPendingValue),\n      currentPendingValueValidIndex,\n      currentPendingValueValidIndexOnHover: HoverStatus.default,\n    });\n  }\n\n  /**\n   * Set the pending info from the given index\n   * @param index - the index to set the pending info from\n   */\n  private _setPendingInfoFromIndex(index: number): void {\n    const { currentOptions } = this.props.hoisted;\n\n    if (index >= 0 && index < currentOptions.length) {\n      const option = currentOptions[index];\n      this._setPendingInfo(getPreviewText(option), index, getPreviewText(option));\n    } else {\n      this._clearPendingInfo();\n    }\n  }\n\n  /**\n   * Sets the pending info for the combo box\n   * @param index - the index to search from\n   * @param searchDirection - the direction to search\n   */\n  private _setPendingInfoFromIndexAndDirection(index: number, searchDirection: SearchDirection): void {\n    const { currentOptions } = this.props.hoisted;\n\n    // update index to allow content to wrap\n    if (searchDirection === SearchDirection.forward && index >= currentOptions.length - 1) {\n      index = -1;\n    } else if (searchDirection === SearchDirection.backward && index <= 0) {\n      index = currentOptions.length;\n    }\n\n    // get the next \"valid\" index\n    const indexUpdate = this._getNextSelectableIndex(index, searchDirection);\n\n    // if the two indices are equal we didn't move and\n    // we should attempt to get  get the first/last \"valid\" index to use\n    // (Note, this takes care of the potential cases where the first/last\n    // item is not focusable), otherwise use the updated index\n    if (index === indexUpdate) {\n      if (searchDirection === SearchDirection.forward) {\n        index = this._getNextSelectableIndex(-1, searchDirection);\n      } else if (searchDirection === SearchDirection.backward) {\n        index = this._getNextSelectableIndex(currentOptions.length, searchDirection);\n      }\n    } else {\n      index = indexUpdate;\n    }\n\n    if (indexWithinBounds(currentOptions, index)) {\n      this._setPendingInfoFromIndex(index);\n    }\n  }\n\n  private _notifyPendingValueChanged(prevState: IComboBoxState): void {\n    const { onPendingValueChanged } = this.props;\n\n    if (!onPendingValueChanged) {\n      return;\n    }\n\n    const { currentOptions } = this.props.hoisted;\n    const { currentPendingValue, currentPendingValueValidIndex, currentPendingValueValidIndexOnHover } = this.state;\n\n    let newPendingIndex: number | undefined = undefined;\n    let newPendingValue: string | undefined = undefined;\n\n    if (\n      currentPendingValueValidIndexOnHover !== prevState.currentPendingValueValidIndexOnHover &&\n      indexWithinBounds(currentOptions, currentPendingValueValidIndexOnHover)\n    ) {\n      // Set new pending index if hover index was changed\n      newPendingIndex = currentPendingValueValidIndexOnHover;\n    } else if (\n      currentPendingValueValidIndex !== prevState.currentPendingValueValidIndex &&\n      indexWithinBounds(currentOptions, currentPendingValueValidIndex)\n    ) {\n      // Set new pending index if currentPendingValueValidIndex was changed\n      newPendingIndex = currentPendingValueValidIndex;\n    } else if (currentPendingValue !== prevState.currentPendingValue) {\n      // Set pendingValue in the case it was changed and no index was changed\n      newPendingValue = currentPendingValue;\n    }\n\n    // Notify when there is a new pending index/value. Also, if there is a pending value, it needs to send undefined.\n    if (newPendingIndex !== undefined || newPendingValue !== undefined || this._hasPendingValue) {\n      onPendingValueChanged(\n        newPendingIndex !== undefined ? currentOptions[newPendingIndex] : undefined,\n        newPendingIndex,\n        newPendingValue,\n      );\n      this._hasPendingValue = newPendingIndex !== undefined || newPendingValue !== undefined;\n    }\n  }\n\n  /**\n   * Sets the isOpen state and updates focusInputAfterClose\n   */\n  private _setOpenStateAndFocusOnClose(isOpen: boolean, focusInputAfterClose: boolean): void {\n    this._focusInputAfterClose = focusInputAfterClose;\n    this.setState({ isOpen });\n  }\n\n  /**\n   * Handle keydown on the input\n   * @param ev - The keyboard event that was fired\n   */\n  private _onInputKeyDown = (ev: React.KeyboardEvent<HTMLElement | Autofill>): void => {\n    const {\n      disabled,\n      allowFreeform,\n      allowFreeInput,\n      autoComplete,\n      hoisted: { currentOptions },\n    } = this.props;\n    const { isOpen, currentPendingValueValidIndexOnHover } = this.state;\n\n    // Take note if we are processing an alt (option) or meta (command) keydown.\n    // See comment in _onInputKeyUp for reasoning.\n    this._lastKeyDownWasAltOrMeta = isAltOrMeta(ev);\n\n    if (disabled) {\n      this._handleInputWhenDisabled(ev);\n      return;\n    }\n\n    let index = this._getPendingSelectedIndex(false /* includeCurrentPendingValue */);\n\n    // eslint-disable-next-line deprecation/deprecation\n    switch (ev.which) {\n      case KeyCodes.enter:\n        if (this._autofill.current && this._autofill.current.inputElement) {\n          this._autofill.current.inputElement.select();\n        }\n\n        this._submitPendingValue(ev);\n        if (this.props.multiSelect && isOpen) {\n          this.setState({\n            currentPendingValueValidIndex: index,\n          });\n        } else {\n          // On enter submit the pending value\n          if (\n            isOpen ||\n            ((!allowFreeform ||\n              this.state.currentPendingValue === undefined ||\n              this.state.currentPendingValue === null ||\n              this.state.currentPendingValue.length <= 0) &&\n              this.state.currentPendingValueValidIndex < 0)\n          ) {\n            // if we are open or\n            // if we are not allowing freeform or\n            // our we have no pending value\n            // and no valid pending index\n            // flip the open state\n            this.setState({\n              isOpen: !isOpen,\n            });\n          }\n        }\n        break;\n\n      case KeyCodes.tab:\n        // On enter submit the pending value\n        if (!this.props.multiSelect) {\n          this._submitPendingValue(ev);\n        }\n\n        // If we are not allowing freeform\n        // or the combo box is open, flip the open state\n        if (isOpen) {\n          this._setOpenStateAndFocusOnClose(!isOpen, false /* focusInputAfterClose */);\n        }\n\n        // Allow TAB to propagate\n        return;\n\n      case KeyCodes.escape:\n        // reset the selected index\n        this._resetSelectedIndex();\n\n        // Close the menu if opened\n        if (isOpen) {\n          this.setState({\n            isOpen: false,\n          });\n        } else {\n          return;\n        }\n        break;\n\n      case KeyCodes.up:\n        // if we are in clearAll state (e.g. the user as hovering\n        // and has since mousedOut of the menu items),\n        // go to the last index\n        if (currentPendingValueValidIndexOnHover === HoverStatus.clearAll) {\n          index = this.props.hoisted.currentOptions.length;\n        }\n\n        if (ev.altKey || ev.metaKey) {\n          // Close the menu if it is open and break so\n          // that the event get stopPropagation and prevent default.\n          // Otherwise, we need to let the event continue to propagate\n          if (isOpen) {\n            this._setOpenStateAndFocusOnClose(!isOpen, true /* focusInputAfterClose */);\n            break;\n          }\n\n          return;\n        }\n\n        // do not scroll page\n        ev.preventDefault();\n\n        // Go to the previous option\n        this._setPendingInfoFromIndexAndDirection(index, SearchDirection.backward);\n        break;\n\n      case KeyCodes.down:\n        // Expand the combo box on ALT + DownArrow\n        if (ev.altKey || ev.metaKey) {\n          this._setOpenStateAndFocusOnClose(true /* isOpen */, true /* focusInputAfterClose */);\n        } else {\n          // if we are in clearAll state (e.g. the user as hovering\n          // and has since mousedOut of the menu items),\n          // go to the first index\n          if (currentPendingValueValidIndexOnHover === HoverStatus.clearAll) {\n            index = -1;\n          }\n\n          // do not scroll page\n          ev.preventDefault();\n\n          // Got to the next option\n          this._setPendingInfoFromIndexAndDirection(index, SearchDirection.forward);\n        }\n        break;\n\n      case KeyCodes.home:\n      case KeyCodes.end:\n        if (allowFreeform || allowFreeInput) {\n          return;\n        }\n\n        // Set the initial values to respond to HOME\n        // which goes to the first selectable option\n        index = -1;\n        let directionToSearch = SearchDirection.forward;\n\n        // If end, update the values to respond to END\n        // which goes to the last selectable option\n        // eslint-disable-next-line deprecation/deprecation\n        if (ev.which === KeyCodes.end) {\n          index = currentOptions.length;\n          directionToSearch = SearchDirection.backward;\n        }\n\n        this._setPendingInfoFromIndexAndDirection(index, directionToSearch);\n        break;\n\n      /* eslint-disable no-fallthrough */\n      case KeyCodes.space:\n        // event handled in _onComboBoxKeyUp\n        if (!allowFreeform && !allowFreeInput && autoComplete === 'off') {\n          break;\n        }\n\n      default:\n        /* eslint-enable no-fallthrough */\n        // are we processing a function key? if so bail out\n        // eslint-disable-next-line deprecation/deprecation\n        if (ev.which >= 112 /* F1 */ && ev.which <= 123 /* F12 */) {\n          return;\n        }\n\n        // If we get here and we got either and ALT key\n        // or meta key, let the event propagate\n        // eslint-disable-next-line deprecation/deprecation\n        if (ev.keyCode === KeyCodes.alt || ev.key === 'Meta' /* && isOpen */) {\n          return;\n        }\n\n        // If we are not allowing freeform or free input and\n        // allowing autoComplete, handle the input here\n        if (!allowFreeform && !allowFreeInput && autoComplete === 'on') {\n          this._onInputChange(ev.key);\n          break;\n        }\n\n        // allow the key to propagate by default\n        return;\n    }\n\n    ev.stopPropagation();\n    ev.preventDefault();\n  };\n\n  /**\n   * Handle keyup on the input\n   * @param ev - the keyboard event that was fired\n   */\n  private _onInputKeyUp = (ev: React.KeyboardEvent<HTMLElement | Autofill>): void => {\n    const { disabled, allowFreeform, allowFreeInput, autoComplete } = this.props;\n    const isOpen = this.state.isOpen;\n\n    // We close the menu on key up only if ALL of the following are true:\n    // - Most recent key down was alt or meta (command)\n    // - The alt/meta key down was NOT followed by some other key (such as down/up arrow to\n    //   expand/collapse the menu)\n    // - We're not on a Mac (or iOS)\n    // This is because on Windows, pressing alt moves focus to the application menu bar or similar,\n    // closing any open context menus. There is not a similar behavior on Macs.\n    const keyPressIsAltOrMetaAlone = this._lastKeyDownWasAltOrMeta && isAltOrMeta(ev);\n    this._lastKeyDownWasAltOrMeta = false;\n    const shouldHandleKey = keyPressIsAltOrMetaAlone && !(isMac() || isIOS());\n\n    if (disabled) {\n      this._handleInputWhenDisabled(ev);\n      return;\n    }\n\n    // eslint-disable-next-line deprecation/deprecation\n    switch (ev.which) {\n      case KeyCodes.space:\n        // If we are not allowing freeform or free input, and autoComplete is off\n        // make space expand/collapse the combo box\n        // and allow the event to propagate\n        if (!allowFreeform && !allowFreeInput && autoComplete === 'off') {\n          this._setOpenStateAndFocusOnClose(!isOpen, !!isOpen);\n        }\n        return;\n      default:\n        if (shouldHandleKey && isOpen) {\n          this._setOpenStateAndFocusOnClose(!isOpen, true /* focusInputAfterClose */);\n        } else {\n          if (this.state.focusState === 'focusing' && this.props.openOnKeyboardFocus) {\n            this.setState({ isOpen: true });\n          }\n          if (this.state.focusState !== 'focused') {\n            this.setState({ focusState: 'focused' });\n          }\n        }\n        return;\n    }\n  };\n\n  private _onOptionMouseEnter(index: number): void {\n    if (this._shouldIgnoreMouseEvent()) {\n      return;\n    }\n\n    this.setState({\n      currentPendingValueValidIndexOnHover: index,\n    });\n  }\n\n  private _onOptionMouseMove(index: number): void {\n    this._gotMouseMove = true;\n\n    if (!this._isScrollIdle || this.state.currentPendingValueValidIndexOnHover === index) {\n      return;\n    }\n\n    this.setState({\n      currentPendingValueValidIndexOnHover: index,\n    });\n  }\n\n  private _onOptionMouseLeave = () => {\n    if (this._shouldIgnoreMouseEvent()) {\n      return;\n    }\n\n    // Ignore the event in persistMenu mode if the callout has\n    // closed. This is to avoid clearing the visuals on item click.\n    if (this.props.persistMenu && !this.state.isOpen) {\n      return;\n    }\n\n    this.setState({\n      currentPendingValueValidIndexOnHover: HoverStatus.clearAll,\n    });\n  };\n\n  private _shouldIgnoreMouseEvent(): boolean {\n    return !this._isScrollIdle || !this._gotMouseMove;\n  }\n\n  /**\n   * Handle dismissing the menu and eating the required key event when disabled\n   * @param ev - the keyboard event that was fired\n   */\n  private _handleInputWhenDisabled(ev: React.KeyboardEvent<HTMLElement | Autofill> | null): void {\n    // If we are disabled, close the menu (if needed)\n    // and eat all keystrokes other than TAB or ESC\n    if (this.props.disabled) {\n      if (this.state.isOpen) {\n        this.setState({ isOpen: false });\n      }\n\n      // When disabled stop propagation and prevent default\n      // of the event unless we have a tab, escape, or function key\n      if (\n        ev !== null &&\n        // eslint-disable-next-line deprecation/deprecation\n        ev.which !== KeyCodes.tab &&\n        // eslint-disable-next-line deprecation/deprecation\n        ev.which !== KeyCodes.escape &&\n        // eslint-disable-next-line deprecation/deprecation\n        (ev.which < 112 /* F1 */ || ev.which > 123) /* F12 */\n      ) {\n        ev.stopPropagation();\n        ev.preventDefault();\n      }\n    }\n  }\n\n  /**\n   * Click handler for the button of the combo box and the input when not allowing freeform.\n   * This toggles the expand/collapse state of the combo box (if enabled).\n   */\n  private _onComboBoxClick = (): void => {\n    const { disabled } = this.props;\n    const { isOpen } = this.state;\n\n    if (!disabled) {\n      this._setOpenStateAndFocusOnClose(!isOpen, false /* focusInputAfterClose */);\n      this.setState({ focusState: 'focused' });\n    }\n  };\n\n  /**\n   * Click handler for the autofill.\n   */\n  private _onAutofillClick = (): void => {\n    const { disabled, allowFreeform } = this.props;\n    if (allowFreeform && !disabled) {\n      this.focus(this.state.isOpen || this._processingTouch);\n    } else {\n      this._onComboBoxClick();\n    }\n  };\n\n  private _onTouchStart: () => void = () => {\n    if (this._comboBoxWrapper.current && !('onpointerdown' in this._comboBoxWrapper)) {\n      this._handleTouchAndPointerEvent();\n    }\n  };\n\n  private _onPointerDown = (ev: PointerEvent): void => {\n    if (ev.pointerType === 'touch') {\n      this._handleTouchAndPointerEvent();\n\n      ev.preventDefault();\n      ev.stopImmediatePropagation();\n    }\n  };\n\n  private _handleTouchAndPointerEvent() {\n    // If we already have an existing timeout from a previous touch and pointer event\n    // cancel that timeout so we can set a nwe one.\n    if (this._lastTouchTimeoutId !== undefined) {\n      this._async.clearTimeout(this._lastTouchTimeoutId);\n      this._lastTouchTimeoutId = undefined;\n    }\n    this._processingTouch = true;\n\n    this._lastTouchTimeoutId = this._async.setTimeout(() => {\n      this._processingTouch = false;\n      this._lastTouchTimeoutId = undefined;\n    }, TouchIdleDelay);\n  }\n\n  /**\n   * Get the styles for the current option.\n   * @param item - Item props for the current option\n   */\n  private _getCaretButtonStyles(): IButtonStyles {\n    const { caretDownButtonStyles: customCaretDownButtonStyles } = this.props;\n    return getCaretDownButtonStyles(this.props.theme!, customCaretDownButtonStyles);\n  }\n\n  /**\n   * Get the styles for the current option.\n   * @param item - Item props for the current option\n   */\n  private _getCurrentOptionStyles(item: IComboBoxOption): Partial<IComboBoxOptionStyles> {\n    const { comboBoxOptionStyles: customStylesForAllOptions } = this.props;\n    const { styles: customStylesForCurrentOption } = item;\n\n    return getOptionStyles(\n      this.props.theme!,\n      customStylesForAllOptions,\n      customStylesForCurrentOption,\n      this._isPendingOption(item),\n      item.hidden,\n      this._isOptionHighlighted(item.index),\n    );\n  }\n\n  /**\n   * Get the aria autocomplete value for the combo box\n   * @returns 'inline' if auto-complete automatically dynamic, 'both' if we have a list of possible values to pick from\n   * and can dynamically populate input, and 'list' if auto-complete is not enabled as selection is the only option.\n   * Ideally, this should be 'none' if auto-complete is not enabled, but there is a known bug in Edge\n   * where the callout may appear over the combo box if this attribute is set to 'none'\n   */\n  private _getAriaAutoCompleteValue(): 'none' | 'inline' | 'list' | 'both' | undefined {\n    const autoComplete = !this.props.disabled && this.props.autoComplete === 'on';\n    return autoComplete ? (this.props.allowFreeform ? 'inline' : 'both') : 'list';\n  }\n\n  private _isPendingOption(item: IComboBoxOption): boolean {\n    return item && item.index === this.state.currentPendingValueValidIndex;\n  }\n\n  /**\n   * Returns true if the component has some kind of focus. If it's either focusing or if it's focused\n   */\n  private _hasFocus() {\n    return this.state.focusState !== 'none';\n  }\n}\n\n/**\n * Get the indices of the options that are marked as selected\n * @param options - the combo box options\n * @param selectedKeys - the known selected keys to find\n * @returns - an array of the indices of the selected options, empty array if nothing is selected\n */\nfunction getSelectedIndices(\n  options: IComboBoxOption[] | undefined,\n  selectedKeys: (string | number | undefined)[],\n): number[] {\n  if (!options || !selectedKeys) {\n    return [];\n  }\n\n  const selectedIndices: { [key: number]: boolean } = {};\n  options.forEach((option: IComboBoxOption, index: number) => {\n    if (option.selected) {\n      selectedIndices[index] = true;\n    }\n  });\n\n  for (const selectedKey of selectedKeys) {\n    const index = findIndex(options, option => option.key === selectedKey);\n    if (index > -1) {\n      selectedIndices[index] = true;\n    }\n  }\n\n  return Object.keys(selectedIndices).map(Number).sort();\n}\n\n/**\n * Given default selected key(s) and selected key(s), return the selected keys(s).\n * When default selected key(s) are available, they take precedence and return them instead of selected key(s).\n *\n * @returns No matter what specific types the input parameters are, always return an array of\n *  either strings or numbers instead of primitive type.  This normalization makes caller's logic easier.\n */\nfunction buildDefaultSelectedKeys(\n  defaultSelectedKey: string | number | string[] | number[] | null | undefined,\n  selectedKey: string | number | string[] | number[] | null | undefined,\n): string[] | number[] {\n  const selectedKeys: string[] | number[] = buildSelectedKeys(defaultSelectedKey);\n  if (selectedKeys.length) {\n    return selectedKeys;\n  }\n  return buildSelectedKeys(selectedKey);\n}\n\nfunction buildSelectedKeys(selectedKey: string | number | string[] | number[] | null | undefined): string[] | number[] {\n  if (selectedKey === undefined) {\n    return [];\n  }\n\n  // need to cast here so typescript does not complain\n  return (selectedKey instanceof Array ? selectedKey : [selectedKey]) as string[] | number[];\n}\n\nfunction normalizeToString(value: string | undefined) {\n  return value || '';\n}\n\n/**\n * Is the index within the bounds of the array?\n * @param options - options to check if the index is valid for\n * @param index - the index to check\n * @returns - true if the index is valid for the given options, false otherwise\n */\nfunction indexWithinBounds(options: IComboBoxOption[] | undefined, index: number): boolean {\n  return !!options && index >= 0 && index < options.length;\n}\n\n/** Whether this is a normal option, not a header or divider or select all. */\nfunction isNormalOption(option: IComboBoxOption) {\n  return (\n    option.itemType !== SelectableOptionMenuItemType.Header &&\n    option.itemType !== SelectableOptionMenuItemType.Divider &&\n    option.itemType !== SelectableOptionMenuItemType.SelectAll\n  );\n}\n\n/** Whether this is a selectable option, not a header or divider. */\nfunction isSelectableOption(option: IComboBoxOption) {\n  return (\n    option.itemType !== SelectableOptionMenuItemType.Header && option.itemType !== SelectableOptionMenuItemType.Divider\n  );\n}\n\n/**\n * For scenarios where the option's `text` prop contains embedded styles, we use the option's\n * `ariaLabel` value as the text in the input and for autocomplete matching. We know to use this\n * when the `useAriaLabelAsText` prop is set to true.\n */\nfunction getPreviewText(item: IComboBoxOption): string {\n  return item.useAriaLabelAsText && item.ariaLabel ? item.ariaLabel : item.text;\n}\n\n/**\n * Returns true if the key for the event is alt (Mac option) or meta (Mac command).\n */\nfunction isAltOrMeta(ev: React.KeyboardEvent<HTMLElement | Autofill>): boolean {\n  // eslint-disable-next-line deprecation/deprecation\n  return ev.which === KeyCodes.alt || ev.key === 'Meta';\n}\n","import {\n  FontWeights,\n  concatStyleSets,\n  getFocusStyle,\n  HighContrastSelector,\n  getPlaceholderStyles,\n  hiddenContentStyle,\n  getInputFocusStyle,\n  getHighContrastNoAdjustStyle,\n} from '../../Styling';\nimport { memoizeFunction } from '../../Utilities';\nimport type { IRawStyle, ITheme, IStyle } from '../../Styling';\nimport type { IComboBoxOptionStyles, IComboBoxStyles } from './ComboBox.types';\nimport type { IButtonStyles } from '../../Button';\n\nconst ComboBoxHeight = 32;\nconst ComboBoxLineHeight = 30;\nconst ComboBoxCaretDownWidth = 32;\nconst ComboBoxOptionHeight = 36;\n\nconst getDisabledStyles = memoizeFunction((theme: ITheme): IRawStyle => {\n  const { semanticColors } = theme;\n\n  return {\n    backgroundColor: semanticColors.disabledBackground,\n    color: semanticColors.disabledText,\n    cursor: 'default',\n    selectors: {\n      ':after': {\n        borderColor: semanticColors.disabledBackground,\n      },\n      [HighContrastSelector]: {\n        color: 'GrayText',\n        selectors: {\n          ':after': {\n            borderColor: 'GrayText',\n          },\n        },\n      },\n    },\n  };\n});\n\nconst listOptionHighContrastStyles: IRawStyle = {\n  selectors: {\n    [HighContrastSelector]: {\n      backgroundColor: 'Highlight',\n      borderColor: 'Highlight',\n      color: 'HighlightText',\n      ...getHighContrastNoAdjustStyle(),\n    },\n  },\n};\n\nconst inputHighContrastStyles: IRawStyle = {\n  selectors: {\n    [HighContrastSelector]: {\n      color: 'WindowText',\n      backgroundColor: 'Window',\n      ...getHighContrastNoAdjustStyle(),\n    },\n  },\n};\n\nexport const getOptionStyles = memoizeFunction(\n  (\n    theme: ITheme,\n    customStylesForAllOptions?: Partial<IComboBoxOptionStyles>,\n    customOptionStylesForCurrentOption?: Partial<IComboBoxOptionStyles>,\n    isPending?: boolean,\n    isHidden?: boolean,\n    isSelected?: boolean,\n  ): Partial<IComboBoxOptionStyles> => {\n    const { palette, semanticColors } = theme;\n\n    const option = {\n      textHoveredColor: semanticColors.menuItemTextHovered,\n      textSelectedColor: palette.neutralDark,\n      textDisabledColor: semanticColors.disabledText,\n      backgroundHoveredColor: semanticColors.menuItemBackgroundHovered,\n      backgroundPressedColor: semanticColors.menuItemBackgroundPressed,\n    };\n\n    const optionStyles: IComboBoxOptionStyles = {\n      root: [\n        theme.fonts.medium,\n        {\n          backgroundColor: isPending ? option.backgroundHoveredColor : 'transparent',\n          boxSizing: 'border-box',\n          cursor: 'pointer',\n          display: isHidden ? 'none' : 'block',\n          width: '100%',\n          height: 'auto',\n          minHeight: ComboBoxOptionHeight,\n          lineHeight: '20px',\n          padding: '0 8px',\n          position: 'relative',\n          borderWidth: '1px',\n          borderStyle: 'solid',\n          borderColor: 'transparent',\n          borderRadius: 0,\n          wordWrap: 'break-word',\n          overflowWrap: 'break-word',\n          textAlign: 'left',\n          selectors: {\n            [HighContrastSelector]: {\n              border: 'none',\n              borderColor: 'Background',\n            },\n            ...(!isHidden && {\n              '&.ms-Checkbox': {\n                display: 'flex',\n                alignItems: 'center',\n              },\n            }),\n            '&.ms-Button--command:hover:active': {\n              backgroundColor: option.backgroundPressedColor,\n            },\n            '.ms-Checkbox-label': {\n              width: '100%',\n            },\n          },\n        },\n        isSelected\n          ? [\n              {\n                backgroundColor: 'transparent',\n                color: option.textSelectedColor,\n                selectors: {\n                  ':hover': [\n                    {\n                      backgroundColor: option.backgroundHoveredColor,\n                    },\n                    listOptionHighContrastStyles,\n                  ],\n                },\n              },\n              getFocusStyle(theme, { inset: -1, isFocusedOnly: false }),\n              listOptionHighContrastStyles,\n            ]\n          : [],\n      ],\n      rootHovered: {\n        backgroundColor: option.backgroundHoveredColor,\n        color: option.textHoveredColor,\n      },\n      rootFocused: {\n        backgroundColor: option.backgroundHoveredColor,\n      },\n      rootDisabled: {\n        color: option.textDisabledColor,\n        cursor: 'default',\n      },\n      optionText: {\n        overflow: 'hidden',\n        whiteSpace: 'nowrap',\n        textOverflow: 'ellipsis',\n        minWidth: '0px',\n        maxWidth: '100%',\n        wordWrap: 'break-word',\n        overflowWrap: 'break-word',\n        display: 'inline-block',\n      },\n      optionTextWrapper: {\n        maxWidth: '100%',\n        display: 'flex',\n        alignItems: 'center',\n      },\n    };\n\n    return concatStyleSets(optionStyles, customStylesForAllOptions, customOptionStylesForCurrentOption);\n  },\n);\n\nexport const getCaretDownButtonStyles = memoizeFunction(\n  (theme: ITheme, customStyles?: Partial<IButtonStyles>): IButtonStyles => {\n    const { semanticColors, fonts } = theme;\n\n    const caret = {\n      buttonTextColor: semanticColors.bodySubtext,\n      buttonTextHoveredCheckedColor: semanticColors.buttonTextChecked,\n      buttonBackgroundHoveredColor: semanticColors.listItemBackgroundHovered,\n      buttonBackgroundCheckedColor: semanticColors.listItemBackgroundChecked,\n      buttonBackgroundCheckedHoveredColor: semanticColors.listItemBackgroundCheckedHovered,\n    };\n\n    const buttonHighContrastStyles: IStyle = {\n      selectors: {\n        [HighContrastSelector]: {\n          backgroundColor: 'Highlight',\n          borderColor: 'Highlight',\n          color: 'HighlightText',\n          ...getHighContrastNoAdjustStyle(),\n        },\n      },\n    };\n\n    const styles: IButtonStyles = {\n      root: {\n        color: caret.buttonTextColor,\n        fontSize: fonts.small.fontSize,\n        position: 'absolute',\n        top: 0,\n        height: '100%',\n        lineHeight: ComboBoxLineHeight,\n        width: ComboBoxCaretDownWidth,\n        textAlign: 'center',\n        cursor: 'default',\n        selectors: {\n          [HighContrastSelector]: {\n            backgroundColor: 'ButtonFace',\n            borderColor: 'ButtonText',\n            color: 'ButtonText',\n            ...getHighContrastNoAdjustStyle(),\n          },\n        },\n      },\n      icon: {\n        fontSize: fonts.small.fontSize,\n      },\n      rootHovered: [\n        {\n          backgroundColor: caret.buttonBackgroundHoveredColor,\n          color: caret.buttonTextHoveredCheckedColor,\n          cursor: 'pointer',\n        },\n        buttonHighContrastStyles,\n      ],\n      rootPressed: [\n        {\n          backgroundColor: caret.buttonBackgroundCheckedColor,\n          color: caret.buttonTextHoveredCheckedColor,\n        },\n        buttonHighContrastStyles,\n      ],\n      rootChecked: [\n        {\n          backgroundColor: caret.buttonBackgroundCheckedColor,\n          color: caret.buttonTextHoveredCheckedColor,\n        },\n        buttonHighContrastStyles,\n      ],\n      rootCheckedHovered: [\n        {\n          backgroundColor: caret.buttonBackgroundCheckedHoveredColor,\n          color: caret.buttonTextHoveredCheckedColor,\n        },\n        buttonHighContrastStyles,\n      ],\n      rootDisabled: [\n        getDisabledStyles(theme),\n        {\n          position: 'absolute',\n        },\n      ],\n    };\n    return concatStyleSets(styles, customStyles);\n  },\n);\n\nexport const getStyles = memoizeFunction(\n  (theme: ITheme, customStyles?: Partial<IComboBoxStyles>, comboBoxOptionWidth?: string): Partial<IComboBoxStyles> => {\n    const { semanticColors, fonts, effects } = theme;\n\n    const root = {\n      textColor: semanticColors.inputText,\n      borderColor: semanticColors.inputBorder,\n      borderHoveredColor: semanticColors.inputBorderHovered,\n      borderPressedColor: semanticColors.inputFocusBorderAlt,\n      borderFocusedColor: semanticColors.inputFocusBorderAlt,\n      backgroundColor: semanticColors.inputBackground,\n      erroredColor: semanticColors.errorText,\n    };\n\n    const option = {\n      headerTextColor: semanticColors.menuHeader,\n      dividerBorderColor: semanticColors.bodyDivider,\n    };\n\n    // placeholder style variables\n    const placeholderHighContrastStyles: IRawStyle = {\n      selectors: {\n        [HighContrastSelector]: {\n          color: 'GrayText',\n        },\n      },\n    };\n    const placeholderStyles: IStyle = [\n      {\n        color: semanticColors.inputPlaceholderText,\n      },\n      placeholderHighContrastStyles,\n    ];\n    const placeholderStylesHovered: IStyle = [\n      {\n        color: semanticColors.inputTextHovered,\n      },\n      placeholderHighContrastStyles,\n    ];\n    const disabledPlaceholderStyles: IStyle = [\n      {\n        color: semanticColors.disabledText,\n      },\n      placeholderHighContrastStyles,\n    ];\n\n    const ComboBoxRootHighContrastFocused = {\n      color: 'HighlightText',\n      backgroundColor: 'Window',\n      ...getHighContrastNoAdjustStyle(),\n      selectors: {\n        ':after': {\n          borderColor: 'Highlight',\n        },\n      },\n    };\n\n    const focusBorderStyles: IStyle = getInputFocusStyle(root.borderPressedColor, effects.roundedCorner2, 'border', 0);\n\n    const styles: IComboBoxStyles = {\n      container: {},\n      label: {},\n      labelDisabled: {},\n      root: [\n        theme.fonts.medium,\n        {\n          boxShadow: 'none',\n          marginLeft: '0',\n          paddingRight: ComboBoxCaretDownWidth,\n          paddingLeft: 9,\n          color: root.textColor,\n          position: 'relative',\n          outline: '0',\n          userSelect: 'none',\n          backgroundColor: root.backgroundColor,\n          cursor: 'text',\n          display: 'block',\n          height: ComboBoxHeight,\n          whiteSpace: 'nowrap',\n          textOverflow: 'ellipsis',\n          boxSizing: 'border-box', // Border-box matches Dropdown and TextField\n          selectors: {\n            '.ms-Label': {\n              display: 'inline-block',\n              marginBottom: '8px',\n            },\n            '&.is-open': {\n              selectors: {\n                [HighContrastSelector]: ComboBoxRootHighContrastFocused,\n              },\n            },\n            // setting border using pseudo-element here in order to\n            // prevent chevron button to overlap ComboBox border under certain resolutions\n            ':after': {\n              pointerEvents: 'none',\n              content: \"''\",\n              position: 'absolute',\n              left: 0,\n              top: 0,\n              bottom: 0,\n              right: 0,\n              borderWidth: '1px',\n              borderStyle: 'solid',\n              borderColor: root.borderColor,\n              borderRadius: effects.roundedCorner2,\n            },\n          },\n        },\n      ],\n\n      rootHovered: {\n        selectors: {\n          ':after': {\n            borderColor: root.borderHoveredColor,\n          },\n          '.ms-ComboBox-Input': [\n            {\n              color: semanticColors.inputTextHovered,\n            },\n            getPlaceholderStyles(placeholderStylesHovered),\n            inputHighContrastStyles,\n          ],\n          [HighContrastSelector]: {\n            color: 'HighlightText',\n            backgroundColor: 'Window',\n            ...getHighContrastNoAdjustStyle(),\n            selectors: {\n              ':after': {\n                borderColor: 'Highlight',\n              },\n            },\n          },\n        },\n      },\n\n      rootPressed: [\n        {\n          position: 'relative',\n          selectors: {\n            [HighContrastSelector]: ComboBoxRootHighContrastFocused,\n          },\n        },\n      ],\n\n      rootFocused: [\n        {\n          selectors: {\n            '.ms-ComboBox-Input': [\n              {\n                color: semanticColors.inputTextHovered,\n              },\n              inputHighContrastStyles,\n            ],\n            [HighContrastSelector]: ComboBoxRootHighContrastFocused,\n          },\n        },\n        focusBorderStyles,\n      ],\n\n      rootDisabled: getDisabledStyles(theme),\n\n      rootError: {\n        selectors: {\n          ':after': {\n            borderColor: root.erroredColor,\n          },\n          ':hover:after': {\n            borderColor: semanticColors.inputBorderHovered,\n          },\n        },\n      },\n\n      rootDisallowFreeForm: {},\n\n      input: [\n        getPlaceholderStyles(placeholderStyles),\n        {\n          backgroundColor: root.backgroundColor,\n          color: root.textColor,\n          boxSizing: 'border-box',\n          width: '100%',\n          height: '100%',\n          borderStyle: 'none',\n          outline: 'none',\n          font: 'inherit',\n          textOverflow: 'ellipsis',\n          padding: '0',\n          selectors: {\n            '::-ms-clear': {\n              display: 'none',\n            },\n          },\n        },\n        inputHighContrastStyles,\n      ],\n\n      inputDisabled: [getDisabledStyles(theme), getPlaceholderStyles(disabledPlaceholderStyles)],\n      errorMessage: [\n        theme.fonts.small,\n        {\n          color: root.erroredColor,\n          marginTop: '5px',\n        },\n      ],\n\n      callout: {\n        boxShadow: effects.elevation8,\n      },\n\n      optionsContainerWrapper: {\n        width: comboBoxOptionWidth,\n      },\n\n      optionsContainer: {\n        display: 'block',\n      },\n      screenReaderText: hiddenContentStyle,\n\n      header: [\n        fonts.medium,\n        {\n          fontWeight: FontWeights.semibold,\n          color: option.headerTextColor,\n          backgroundColor: 'none',\n          borderStyle: 'none',\n          height: ComboBoxOptionHeight,\n          lineHeight: ComboBoxOptionHeight,\n          cursor: 'default',\n          padding: '0 8px',\n          userSelect: 'none',\n          textAlign: 'left',\n          selectors: {\n            [HighContrastSelector]: {\n              color: 'GrayText',\n              ...getHighContrastNoAdjustStyle(),\n            },\n          },\n        },\n      ],\n\n      divider: {\n        height: 1,\n        backgroundColor: option.dividerBorderColor,\n      },\n    };\n\n    return concatStyleSets(styles, customStyles);\n  },\n);\n","import { memoizeFunction } from '../../Utilities';\nimport { mergeStyles } from '../../Styling';\nimport type { IComboBoxStyles, IComboBoxOptionStyles } from './ComboBox.types';\n\nexport interface IComboBoxClassNames {\n  container: string;\n  label: string;\n  root: string;\n  input: string;\n  errorMessage: string;\n  callout: string;\n  optionsContainer: string;\n  header: string;\n  divider: string;\n  optionsContainerWrapper: string;\n  screenReaderText: string;\n}\n\nexport interface IComboBoxOptionClassNames {\n  optionText: string;\n  root: string;\n  optionTextWrapper: string;\n}\n\nexport const getClassNames = memoizeFunction(\n  (\n    styles: Partial<IComboBoxStyles>,\n    className: string,\n    isOpen: boolean,\n    disabled: boolean,\n    required: boolean,\n    focused: boolean,\n    allowFreeForm: boolean,\n    hasErrorMessage: boolean,\n  ): IComboBoxClassNames => {\n    return {\n      container: mergeStyles('ms-ComboBox-container', className, styles.container),\n      label: mergeStyles(styles.label, disabled && styles.labelDisabled),\n      root: mergeStyles(\n        'ms-ComboBox',\n        hasErrorMessage ? styles.rootError : isOpen && 'is-open',\n        required && 'is-required',\n        styles.root,\n        !allowFreeForm && styles.rootDisallowFreeForm,\n        hasErrorMessage && !focused ? styles.rootError : !disabled && focused && styles.rootFocused,\n        !disabled && {\n          selectors: {\n            ':hover': hasErrorMessage ? styles.rootError : !isOpen && !focused && styles.rootHovered,\n            ':active': hasErrorMessage ? styles.rootError : styles.rootPressed,\n            ':focus': hasErrorMessage ? styles.rootError : styles.rootFocused,\n          },\n        },\n        disabled && ['is-disabled', styles.rootDisabled],\n      ),\n      input: mergeStyles('ms-ComboBox-Input', styles.input, disabled && styles.inputDisabled),\n      errorMessage: mergeStyles(styles.errorMessage),\n      callout: mergeStyles('ms-ComboBox-callout', styles.callout),\n      optionsContainerWrapper: mergeStyles('ms-ComboBox-optionsContainerWrapper', styles.optionsContainerWrapper),\n      optionsContainer: mergeStyles('ms-ComboBox-optionsContainer', styles.optionsContainer),\n      header: mergeStyles('ms-ComboBox-header', styles.header),\n      divider: mergeStyles('ms-ComboBox-divider', styles.divider),\n      screenReaderText: mergeStyles(styles.screenReaderText),\n    };\n  },\n);\n\nexport const getComboBoxOptionClassNames = memoizeFunction(\n  (styles: Partial<IComboBoxOptionStyles>): IComboBoxOptionClassNames => {\n    return {\n      optionText: mergeStyles('ms-ComboBox-optionText', styles.optionText),\n      root: mergeStyles('ms-ComboBox-option', styles.root, {\n        selectors: {\n          ':hover': styles.rootHovered,\n          ':focus': styles.rootFocused,\n          ':active': styles.rootPressed,\n        },\n      }),\n      optionTextWrapper: mergeStyles(styles.optionTextWrapper),\n    };\n  },\n);\n","import { isVirtualElement } from './isVirtualElement';\n/**\n * Gets the elements which are child elements of the given element.\n * If `allowVirtualChildren` is `true`, this method enumerates virtual child elements\n * after the original children.\n * @param parent - The element to get the children of.\n * @param allowVirtualChildren - true if the method should enumerate virtual child elements.\n */\nexport function getChildren(parent: HTMLElement, allowVirtualChildren: boolean = true): HTMLElement[] {\n  const children: HTMLElement[] = [];\n  if (parent) {\n    for (let i = 0; i < parent.children.length; i++) {\n      children.push(parent.children.item(i) as HTMLElement);\n    }\n    if (allowVirtualChildren && isVirtualElement(parent)) {\n      children.push(...parent._virtual.children);\n    }\n  }\n  return children;\n}\n"],"sourceRoot":""}