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,KAAK;QAC5B;QAEF,gBAAgB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAW,GAAG;QACzC,yBAAyB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAW,GAAG;sBAEpD,0DAAC,CAAA,GAAA,qCAAU;QACR,GAAG,YAAY;QAChB,UAAU;0BAAC;wBAAc;QAAU;QACnC,wBAAA;QACA,uBAAA;QACA,qBAAA;QACA,QAAQ;QACR,OAAO;QACP,uBAAA;QACA,kBAAkB,IAChB,iBAAiB,2BACf,0DAAC;gBAAK,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAuB,GAAG;eACnD,gBAAgB,MAAM,CAAC;QAI9B,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAuB,GAAG;QACvD,KAAK;QACL,UAAU;QACV,YAAY;QACZ,WAAW;sBAEb,0DAAC,CAAA,GAAA,qCAAY;QAAE,WAAW;;AAIlC","sources":["packages/@adobe/react-spectrum/src/autocomplete/MobileSearchAutocomplete.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport AlertMedium from '@spectrum-icons/ui/AlertMedium';\nimport {AriaButtonProps, useButton} from 'react-aria/useButton';\nimport CheckmarkMedium from '@spectrum-icons/ui/CheckmarkMedium';\nimport {classNames} from '../utils/classNames';\nimport {ClearButton} from '../button/ClearButton';\nimport {ComboBoxState, useComboBoxState} from 'react-stately/useComboBoxState';\nimport {DismissButton} from 'react-aria/Overlay';\nimport {Field} from '../label/Field';\nimport {FocusableRef, ValidationState} from '@react-types/shared';\nimport {focusSafely} from 'react-aria/private/interactions/focusSafely';\nimport {FocusScope} from 'react-aria/FocusScope';\nimport {getActiveElement} from 'react-aria/private/utils/shadowdom/DOMFunctions';\nimport intlMessages from '../../intl/autocomplete/*.json';\nimport {ListBoxBase, useListBoxLayout} from '../listbox/ListBoxBase';\nimport Magnifier from '@spectrum-icons/ui/Magnifier';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {ProgressCircle} from '../progress/ProgressCircle';\nimport React, {\n  HTMLAttributes,\n  InputHTMLAttributes,\n  ReactElement,\n  ReactNode,\n  useCallback,\n  useEffect,\n  useRef,\n  useState\n} from 'react';\nimport searchAutocompleteStyles from './searchautocomplete.css';\nimport searchStyles from '@adobe/spectrum-css-temp/components/search/vars.css';\n// @ts-ignore\nimport {setInteractionModality} from 'react-aria/private/interactions/useFocusVisible';\nimport {SpectrumSearchAutocompleteProps} from './SearchAutocomplete';\nimport styles from '@adobe/spectrum-css-temp/components/inputgroup/vars.css';\nimport {TextFieldBase} from '../textfield/TextFieldBase';\nimport textfieldStyles from '@adobe/spectrum-css-temp/components/textfield/vars.css';\nimport {Tray} from '../overlays/Tray';\nimport {useDialog} from 'react-aria/useDialog';\nimport {useField} from 'react-aria/useField';\nimport {useFilter} from 'react-aria/useFilter';\nimport {useFocusableRef} from '../utils/useDOMRef';\nimport {useFocusRing} from 'react-aria/useFocusRing';\nimport {useFormReset} from 'react-aria/private/utils/useFormReset';\nimport {useFormValidation} from 'react-aria/private/form/useFormValidation';\nimport {useHover} from 'react-aria/useHover';\nimport {useId} from 'react-aria/useId';\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\nimport {useOverlayTrigger} from 'react-aria/useOverlayTrigger';\nimport {useProviderProps} from '../provider/Provider';\nimport {useSearchAutocomplete} from 'react-aria/private/autocomplete/useSearchAutocomplete';\n\nfunction ForwardMobileSearchAutocomplete<T extends object>(\n  props: SpectrumSearchAutocompleteProps<T>,\n  ref: FocusableRef<HTMLElement>\n) {\n  props = useProviderProps(props);\n\n  let {\n    isQuiet,\n    isDisabled,\n    isRequired,\n    validationBehavior,\n    validate,\n    name,\n    isReadOnly,\n    onSubmit = () => {}\n  } = props;\n\n  let {contains} = useFilter({sensitivity: 'base'});\n  let state = useComboBoxState({\n    ...props,\n    defaultFilter: contains,\n    allowsEmptyCollection: true,\n    // Needs to be false here otherwise we double up on commitSelection/commitCustomValue calls when\n    // user taps on underlay (i.e. initial tap will call setFocused(false) -> commitSelection/commitCustomValue via onBlur,\n    // then the closing of the tray will call setFocused(false) again due to cleanup effect)\n    shouldCloseOnBlur: false,\n    allowsCustomValue: true,\n    onSelectionChange: key => key !== null && onSubmit(null, key),\n    selectedKey: undefined,\n    defaultSelectedKey: undefined,\n    validate: useCallback(v => validate?.(v.inputValue), [validate])\n  });\n\n  let buttonRef = useRef<HTMLDivElement>(null);\n  let domRef = useFocusableRef(ref, buttonRef);\n  let {triggerProps, overlayProps} = useOverlayTrigger({type: 'listbox'}, state, buttonRef);\n\n  let inputRef = useRef<HTMLInputElement>(null);\n  useFormValidation(\n    {\n      ...props,\n      focus: () => buttonRef.current?.focus()\n    },\n    state,\n    inputRef\n  );\n  let {isInvalid, validationErrors, validationDetails} = state.displayValidation;\n  let validationState = props.validationState || (isInvalid ? 'invalid' : undefined);\n  let errorMessage = props.errorMessage ?? validationErrors.join(' ');\n\n  let {labelProps, fieldProps, descriptionProps, errorMessageProps} = useField({\n    ...props,\n    labelElementType: 'span',\n    isInvalid,\n    errorMessage\n  });\n\n  // Focus the button and show focus ring when clicking on the label\n  labelProps.onClick = () => {\n    if (!props.isDisabled && buttonRef.current) {\n      buttonRef.current.focus();\n      setInteractionModality('keyboard');\n    }\n  };\n\n  let inputProps: InputHTMLAttributes<HTMLInputElement> = {\n    type: 'hidden',\n    name,\n    value: state.inputValue\n  };\n\n  if (validationBehavior === 'native') {\n    // Use a hidden <input type=\"text\"> rather than <input type=\"hidden\">\n    // so that an empty value blocks HTML form submission when the field is required.\n    inputProps.type = 'text';\n    inputProps.hidden = true;\n    inputProps.required = isRequired;\n    // Ignore react warning.\n    inputProps.onChange = () => {};\n  }\n\n  useFormReset(inputRef, state.defaultInputValue, state.setInputValue);\n\n  return (\n    <>\n      <Field\n        {...props}\n        labelProps={labelProps}\n        descriptionProps={descriptionProps}\n        errorMessageProps={errorMessageProps}\n        isInvalid={isInvalid}\n        validationErrors={validationErrors}\n        validationDetails={validationDetails}\n        elementType=\"span\"\n        ref={domRef}\n        includeNecessityIndicatorInAccessibilityName>\n        <SearchAutocompleteButton\n          {...mergeProps(triggerProps, fieldProps, {autoFocus: props.autoFocus, icon: props.icon})}\n          ref={buttonRef}\n          isQuiet={isQuiet}\n          isDisabled={isDisabled}\n          isReadOnly={isReadOnly}\n          isPlaceholder={!state.inputValue}\n          validationState={validationState}\n          inputValue={state.inputValue}\n          clearInput={() => state.setInputValue('')}\n          onPress={() => !isReadOnly && state.open(null, 'manual')}>\n          {state.inputValue || props.placeholder || ''}\n        </SearchAutocompleteButton>\n      </Field>\n      <input {...inputProps} ref={inputRef} />\n      <Tray state={state} isFixedHeight {...overlayProps}>\n        <SearchAutocompleteTray\n          {...props}\n          onClose={state.close}\n          overlayProps={overlayProps}\n          state={state}\n        />\n      </Tray>\n    </>\n  );\n}\n\nexport let MobileSearchAutocomplete = React.forwardRef(ForwardMobileSearchAutocomplete) as <T>(\n  props: SpectrumSearchAutocompleteProps<T> & {ref?: FocusableRef<HTMLElement>}\n) => ReactElement;\n\ninterface SearchAutocompleteButtonProps extends AriaButtonProps {\n  icon?: ReactElement | null;\n  isQuiet?: boolean;\n  isDisabled?: boolean;\n  isReadOnly?: boolean;\n  isPlaceholder?: boolean;\n  validationState?: ValidationState;\n  inputValue?: string;\n  clearInput?: () => void;\n  children?: ReactNode;\n  style?: React.CSSProperties;\n  className?: string;\n}\n\n// any type is because we don't want to call useObjectRef because this is an internal component and we know\n// we are always passing an object ref\nconst SearchAutocompleteButton = React.forwardRef(function SearchAutocompleteButton(\n  props: SearchAutocompleteButtonProps,\n  ref: any\n) {\n  let searchIcon = <Magnifier data-testid=\"searchicon\" />;\n\n  let {\n    icon = searchIcon,\n    isQuiet,\n    isDisabled,\n    isReadOnly,\n    isPlaceholder,\n    validationState,\n    inputValue,\n    clearInput,\n    children,\n    style,\n    className\n  } = props;\n  let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/autocomplete');\n  let valueId = useId();\n  let invalidId = useId();\n  let validationIcon =\n    validationState === 'invalid' ? (\n      <AlertMedium id={invalidId} aria-label={stringFormatter.format('invalid')} />\n    ) : (\n      <CheckmarkMedium />\n    );\n\n  if (icon) {\n    icon = React.cloneElement(icon, {\n      UNSAFE_className: classNames(textfieldStyles, 'spectrum-Textfield-icon'),\n      size: 'S'\n    });\n  }\n\n  let clearButton = (\n    <ClearButton\n      onPress={e => {\n        clearInput?.();\n        props?.onPress?.(e);\n      }}\n      preventFocus\n      aria-label={stringFormatter.format('clear')}\n      excludeFromTabOrder\n      UNSAFE_className={classNames(searchStyles, 'spectrum-ClearButton')}\n      isDisabled={isDisabled}\n    />\n  );\n\n  let validation = React.cloneElement(validationIcon, {\n    UNSAFE_className: classNames(\n      textfieldStyles,\n      'spectrum-Textfield-validationIcon',\n      classNames(styles, 'spectrum-InputGroup-input-validationIcon'),\n      classNames(searchStyles, 'spectrum-Search-validationIcon')\n    )\n  });\n\n  let {hoverProps, isHovered} = useHover({});\n  let {isFocused, isFocusVisible, focusProps} = useFocusRing();\n  let {buttonProps} = useButton(\n    {\n      ...props,\n      'aria-labelledby': [\n        props['aria-labelledby'],\n        props['aria-label'] && !props['aria-labelledby'] ? props.id : null,\n        valueId,\n        validationState === 'invalid' ? invalidId : null\n      ]\n        .filter(Boolean)\n        .join(' '),\n      elementType: 'div'\n    },\n    ref\n  );\n\n  return (\n    <div\n      {...mergeProps(hoverProps, focusProps, buttonProps)}\n      aria-haspopup=\"dialog\"\n      ref={ref}\n      style={{...style, outline: 'none'}}\n      className={classNames(\n        styles,\n        'spectrum-InputGroup',\n        {\n          'spectrum-InputGroup--quiet': isQuiet,\n          'is-disabled': isDisabled,\n          'spectrum-InputGroup--invalid': validationState === 'invalid' && !isDisabled,\n          'is-hovered': isHovered,\n          'is-focused': isFocused,\n          'focus-ring': isFocusVisible\n        },\n        classNames(searchAutocompleteStyles, 'searchautocomplete', 'mobile-searchautocomplete'),\n        className\n      )}>\n      <div\n        className={classNames(\n          textfieldStyles,\n          'spectrum-Textfield',\n          {\n            'spectrum-Textfield--invalid': validationState === 'invalid' && !isDisabled,\n            'spectrum-Textfield--valid': validationState === 'valid' && !isDisabled,\n            'spectrum-Textfield--quiet': isQuiet\n          },\n          classNames(searchStyles, 'spectrum-Search', 'spectrum-Search--loadable', {\n            'is-disabled': isDisabled,\n            'is-quiet': isQuiet,\n            'spectrum-Search--invalid': validationState === 'invalid' && !isDisabled,\n            'spectrum-Search--valid': validationState === 'valid' && !isDisabled\n          }),\n          classNames(styles, 'spectrum-InputGroup-field')\n        )}>\n        <div\n          className={classNames(\n            textfieldStyles,\n            'spectrum-Textfield-input',\n            {\n              'spectrum-Textfield-inputIcon': !!icon,\n              'is-hovered': isHovered,\n              'is-placeholder': isPlaceholder,\n              'is-disabled': isDisabled,\n              'is-quiet': isQuiet,\n              'is-focused': isFocused\n            },\n            classNames(searchStyles, 'spectrum-Search-input'),\n            classNames(searchAutocompleteStyles, 'mobile-input')\n          )}>\n          {icon}\n          <span id={valueId} className={classNames(searchAutocompleteStyles, 'mobile-value')}>\n            {children}\n          </span>\n        </div>\n        {validationState && !isDisabled ? validation : null}\n        {(inputValue !== '' || validationState != null) && !isReadOnly && clearButton}\n      </div>\n    </div>\n  );\n});\n\ninterface SearchAutocompleteTrayProps<T> extends SpectrumSearchAutocompleteProps<T> {\n  state: ComboBoxState<T>;\n  overlayProps: HTMLAttributes<HTMLElement>;\n  loadingIndicator?: ReactElement;\n  onClose: () => void;\n}\n\nfunction SearchAutocompleteTray<T>(props: SearchAutocompleteTrayProps<T>) {\n  let searchIcon = <Magnifier data-testid=\"searchicon\" />;\n\n  let {\n    // completionMode = 'suggest',\n    state,\n    icon = searchIcon,\n    isDisabled,\n    validationState,\n    label,\n    overlayProps,\n    loadingState,\n    onLoadMore,\n    onClose,\n    onSubmit\n  } = props;\n\n  let timeout = useRef<ReturnType<typeof setTimeout> | null>(null);\n  let [showLoading, setShowLoading] = useState(false);\n  let inputRef = useRef<HTMLInputElement>(null);\n  let popoverRef = useRef<HTMLDivElement>(null);\n  let listBoxRef = useRef<HTMLDivElement>(null);\n  let isLoading = loadingState === 'loading' || loadingState === 'loadingMore';\n  let layout = useListBoxLayout();\n  let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/autocomplete');\n\n  let {inputProps, listBoxProps, labelProps, clearButtonProps} = useSearchAutocomplete<T>(\n    {\n      ...props,\n      layoutDelegate: layout,\n      popoverRef: popoverRef,\n      listBoxRef,\n      inputRef,\n      // Handled outside the tray.\n      name: undefined\n    },\n    state\n  );\n\n  React.useEffect(() => {\n    if (inputRef.current) {\n      focusSafely(inputRef.current);\n    }\n  }, []);\n\n  React.useEffect(() => {\n    // When the tray closes, set state.isFocused (i.e. the tray input's focus tracker) to false.\n    // This is to prevent state.isFocused from being set to true when the tray closes via tapping on the underlay\n    // (FocusScope attempts to restore focus to the tray input when tapping outside the tray due to \"contain\")\n    // Have to do this manually since React doesn't call onBlur when a component is unmounted: https://github.com/facebook/react/issues/12363\n    if (!state.isOpen && state.isFocused) {\n      state.setFocused(false);\n    }\n  });\n\n  let {dialogProps} = useDialog(\n    {\n      'aria-labelledby': useId(labelProps.id)\n    },\n    popoverRef\n  );\n\n  // Override the role of the input to \"searchbox\" instead of \"combobox\".\n  // Since the listbox is always visible, the combobox role doesn't really give us anything.\n  // VoiceOver on iOS reads \"double tap to collapse\" when focused on the input rather than\n  // \"double tap to edit text\", as with a textbox or searchbox. We'd like double tapping to\n  // open the virtual keyboard rather than closing the tray.\n  inputProps.role = 'searchbox';\n  inputProps['aria-haspopup'] = 'listbox';\n  delete inputProps.onTouchEnd;\n\n  let clearButton = (\n    <ClearButton\n      {...clearButtonProps}\n      preventFocus\n      aria-label={stringFormatter.format('clear')}\n      excludeFromTabOrder\n      UNSAFE_className={classNames(searchStyles, 'spectrum-ClearButton')}\n      isDisabled={isDisabled}\n    />\n  );\n\n  let loadingCircle = (\n    <ProgressCircle\n      aria-label={stringFormatter.format('loading')}\n      size=\"S\"\n      isIndeterminate\n      UNSAFE_className={classNames(\n        searchStyles,\n        'spectrum-Search-circleLoader',\n        classNames(textfieldStyles, 'spectrum-Textfield-circleLoader')\n      )}\n    />\n  );\n\n  // Close the software keyboard on scroll to give the user a bigger area to scroll.\n  // But only do this if scrolling with touch, otherwise it can cause issues with touch\n  // screen readers.\n  let isTouchDown = useRef(false);\n  let onTouchStart = () => {\n    isTouchDown.current = true;\n  };\n\n  let onTouchEnd = () => {\n    isTouchDown.current = false;\n  };\n\n  let onScroll = useCallback(() => {\n    if (!inputRef.current || getActiveElement() !== inputRef.current || !isTouchDown.current) {\n      return;\n    }\n\n    if (popoverRef.current) {\n      popoverRef.current.focus();\n    }\n  }, [inputRef, popoverRef, isTouchDown]);\n\n  let inputValue = inputProps.value;\n  let lastInputValue = useRef(inputValue);\n  useEffect(() => {\n    if (loadingState === 'filtering' && !showLoading) {\n      if (timeout.current === null) {\n        timeout.current = setTimeout(() => {\n          setShowLoading(true);\n        }, 500);\n      }\n\n      // If user is typing, clear the timer and restart since it is a new request\n      if (inputValue !== lastInputValue.current) {\n        clearTimeout(timeout.current);\n        timeout.current = setTimeout(() => {\n          setShowLoading(true);\n        }, 500);\n      }\n    } else if (loadingState !== 'filtering') {\n      // If loading is no longer happening, clear any timers and hide the loading circle\n      setShowLoading(false);\n      if (timeout.current !== null) {\n        clearTimeout(timeout.current);\n        timeout.current = null;\n      }\n    }\n\n    lastInputValue.current = inputValue;\n  }, [loadingState, inputValue, showLoading]);\n\n  let onKeyDown = e => {\n    // Close virtual keyboard, close tray, and fire onSubmit if user hits Enter w/o any focused options\n    if (e.key === 'Enter' && state.selectionManager.focusedKey == null) {\n      popoverRef.current?.focus();\n      if (onClose) {\n        onClose();\n      }\n      if (onSubmit) {\n        onSubmit(inputValue == null ? null : inputValue.toString(), null);\n      }\n    } else {\n      if (inputProps.onKeyDown) {\n        inputProps.onKeyDown(e);\n      }\n    }\n  };\n\n  if (icon) {\n    icon = React.cloneElement(icon, {\n      UNSAFE_className: classNames(textfieldStyles, 'spectrum-Textfield-icon'),\n      size: 'S'\n    });\n  }\n\n  return (\n    <FocusScope restoreFocus contain>\n      <div\n        {...mergeProps(overlayProps, dialogProps)}\n        ref={popoverRef}\n        className={classNames(searchAutocompleteStyles, 'tray-dialog')}>\n        <DismissButton onDismiss={onClose} />\n        <TextFieldBase\n          label={label}\n          labelProps={labelProps}\n          inputProps={{...inputProps, onKeyDown}}\n          inputRef={inputRef}\n          isDisabled={isDisabled}\n          isLoading={showLoading && loadingState === 'filtering'}\n          loadingIndicator={loadingState != null ? loadingCircle : undefined}\n          validationState={validationState}\n          wrapperChildren={\n            (state.inputValue !== '' || loadingState === 'filtering' || validationState != null) &&\n            !props.isReadOnly\n              ? clearButton\n              : undefined\n          }\n          icon={icon}\n          UNSAFE_className={classNames(\n            searchStyles,\n            'spectrum-Search',\n            'spectrum-Textfield',\n            'spectrum-Search--loadable',\n            {\n              'spectrum-Search--invalid': validationState === 'invalid' && !isDisabled,\n              'spectrum-Search--valid': validationState === 'valid' && !isDisabled\n            },\n            classNames(searchAutocompleteStyles, 'tray-textfield', {\n              'has-label': !!props.label\n            })\n          )}\n          inputClassName={classNames(searchStyles, 'spectrum-Search-input')}\n          validationIconClassName={classNames(searchStyles, 'spectrum-Search-validationIcon')}\n        />\n        <ListBoxBase\n          {...listBoxProps}\n          domProps={{onTouchStart, onTouchEnd}}\n          disallowEmptySelection\n          shouldSelectOnPressUp\n          focusOnPointerEnter\n          layout={layout}\n          state={state}\n          shouldUseVirtualFocus\n          renderEmptyState={() =>\n            loadingState !== 'loading' && (\n              <span className={classNames(searchAutocompleteStyles, 'no-results')}>\n                {stringFormatter.format('noResults')}\n              </span>\n            )\n          }\n          UNSAFE_className={classNames(searchAutocompleteStyles, 'tray-listbox')}\n          ref={listBoxRef}\n          onScroll={onScroll}\n          onLoadMore={onLoadMore}\n          isLoading={isLoading}\n        />\n        <DismissButton onDismiss={onClose} />\n      </div>\n    </FocusScope>\n  );\n}\n"],"names":[],"version":3,"file":"MobileSearchAutocomplete.cjs.map"}