"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const aria = require("../../../constants/aria.js");
const event$1 = require("../../../constants/event.js");
const form = require("../../../constants/form.js");
const index$7 = require("../../../../node_modules/@vueuse/core/index.js");
const event = require("../../../utils/dom/event.js");
const types = require("../../../utils/types.js");
const error = require("../../../utils/error.js");
const scroll = require("../../../utils/dom/scroll.js");
const icon = require("../../../utils/vue/icon.js");
const index = require("../../../hooks/use-locale/index.js");
const index$2 = require("../../../hooks/use-namespace/index.js");
const index$1 = require("../../../hooks/use-id/index.js");
const index$5 = require("../../../hooks/use-focus-controller/index.js");
const index$4 = require("../../../hooks/use-composition/index.js");
const index$3 = require("../../../hooks/use-empty-values/index.js");
const useFormCommonProps = require("../../form/src/hooks/use-form-common-props.js");
const useFormItem = require("../../form/src/hooks/use-form-item.js");
const Vue = require("vue");
const shared_esmBundler = require("../../../../../@vue/shared/dist/shared.esm-bundler.js");
const castArray = require("../../../../../lodash-es/castArray.js");
const index$6 = require("../../../../node_modules/@vueuse/shared/index.js");
const isEqual = require("../../../../../lodash-es/isEqual.js");
const get = require("../../../../../lodash-es/get.js");
const isNil = require("../../../../../lodash-es/isNil.js");
const findLastIndex = require("../../../../../lodash-es/findLastIndex.js");
const clamp = require("../../../../../lodash-es/clamp.js");
const useSelect = (props, emit) => {
  const { t } = index.useLocale();
  const slots = Vue.useSlots();
  const contentId = index$1.useId();
  const nsSelect = index$2.useNamespace("select");
  const nsInput = index$2.useNamespace("input");
  const states = Vue.reactive({
    inputValue: "",
    options: /* @__PURE__ */ new Map(),
    cachedOptions: /* @__PURE__ */ new Map(),
    optionValues: [],
    selected: [],
    selectionWidth: 0,
    collapseItemWidth: 0,
    selectedLabel: "",
    hoveringIndex: -1,
    previousQuery: null,
    inputHovering: false,
    menuVisibleOnFocus: false,
    isBeforeHide: false
  });
  const selectRef = Vue.ref();
  const selectionRef = Vue.ref();
  const tooltipRef = Vue.ref();
  const tagTooltipRef = Vue.ref();
  const inputRef = Vue.ref();
  const prefixRef = Vue.ref();
  const suffixRef = Vue.ref();
  const menuRef = Vue.ref();
  const tagMenuRef = Vue.ref();
  const collapseItemRef = Vue.ref();
  const scrollbarRef = Vue.ref();
  const expanded = Vue.ref(false);
  const hoverOption = Vue.ref();
  const debouncing = Vue.ref(false);
  const { form: form$1, formItem } = useFormItem.useFormItem();
  const { inputId } = useFormItem.useFormItemInputId(props, { formItemContext: formItem });
  const { valueOnClear, isEmptyValue } = index$3.useEmptyValues(props);
  const { isComposing, handleCompositionStart, handleCompositionUpdate, handleCompositionEnd } = index$4.useComposition({ afterComposition: (e) => onInput(e) });
  const selectDisabled = useFormCommonProps.useFormDisabled();
  const { wrapperRef, isFocused, handleBlur } = index$5.useFocusController(inputRef, {
    disabled: selectDisabled,
    afterFocus() {
      if (props.automaticDropdown && !expanded.value) {
        expanded.value = true;
        states.menuVisibleOnFocus = true;
      }
    },
    beforeBlur(event2) {
      var _a, _b;
      return ((_a = tooltipRef.value) == null ? void 0 : _a.isFocusInsideContent(event2)) || ((_b = tagTooltipRef.value) == null ? void 0 : _b.isFocusInsideContent(event2));
    },
    afterBlur() {
      var _a;
      expanded.value = false;
      states.menuVisibleOnFocus = false;
      if (props.validateEvent) (_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "blur").catch((err) => error.debugWarn(err));
    }
  });
  const hasModelValue = Vue.computed(() => {
    return shared_esmBundler.isArray(props.modelValue) ? props.modelValue.length > 0 : !isEmptyValue(props.modelValue);
  });
  const needStatusIcon = Vue.computed(() => (form$1 == null ? void 0 : form$1.statusIcon) ?? false);
  const showClearBtn = Vue.computed(() => {
    return props.clearable && !selectDisabled.value && hasModelValue.value && (isFocused.value || states.inputHovering);
  });
  const iconComponent = Vue.computed(() => props.remote && props.filterable && !props.remoteShowSuffix ? "" : props.suffixIcon);
  const iconReverse = Vue.computed(() => nsSelect.is("reverse", !!(iconComponent.value && expanded.value)));
  const validateState = Vue.computed(() => (formItem == null ? void 0 : formItem.validateState) || "");
  const validateIcon = Vue.computed(() => validateState.value && icon.ValidateComponentsMap[validateState.value]);
  const debounce = Vue.computed(() => props.remote ? props.debounce : 0);
  const isRemoteSearchEmpty = Vue.computed(() => props.remote && !states.inputValue && states.options.size === 0);
  const emptyText = Vue.computed(() => {
    if (props.loading) return props.loadingText || t("el.select.loading");
    else {
      if (props.filterable && states.inputValue && states.options.size > 0 && filteredOptionsCount.value === 0) return props.noMatchText || t("el.select.noMatch");
      if (states.options.size === 0) return props.noDataText || t("el.select.noData");
    }
    return null;
  });
  const filteredOptionsCount = Vue.computed(() => optionsArray.value.filter((option) => option.visible).length);
  const optionsArray = Vue.computed(() => {
    const list = Array.from(states.options.values());
    const newList = [];
    states.optionValues.forEach((item) => {
      const index2 = list.findIndex((i) => i.value === item);
      if (index2 > -1) newList.push(list[index2]);
    });
    return newList.length >= list.length ? newList : list;
  });
  const cachedOptionsArray = Vue.computed(() => Array.from(states.cachedOptions.values()));
  const showNewOption = Vue.computed(() => {
    const hasExistingOption = optionsArray.value.filter((option) => {
      return !option.created;
    }).some((option) => {
      return option.currentLabel === states.inputValue;
    });
    return props.filterable && props.allowCreate && states.inputValue !== "" && !hasExistingOption;
  });
  const updateOptions = () => {
    if (props.filterable && shared_esmBundler.isFunction(props.filterMethod)) return;
    if (props.filterable && props.remote && shared_esmBundler.isFunction(props.remoteMethod)) return;
    optionsArray.value.forEach((option) => {
      var _a;
      (_a = option.updateOption) == null ? void 0 : _a.call(option, states.inputValue);
    });
  };
  const selectSize = useFormCommonProps.useFormSize();
  const collapseTagSize = Vue.computed(() => ["small"].includes(selectSize.value) ? "small" : "default");
  const dropdownMenuVisible = Vue.computed({
    get() {
      return expanded.value && (props.loading || !isRemoteSearchEmpty.value || props.remote && !!slots.empty) && (!debouncing.value || !types.isEmpty(states.previousQuery) || states.options.size > 0);
    },
    set(val) {
      expanded.value = val;
    }
  });
  const shouldShowPlaceholder = Vue.computed(() => {
    if (props.multiple && !types.isUndefined(props.modelValue)) return castArray.default(props.modelValue).length === 0 && !states.inputValue;
    const value = shared_esmBundler.isArray(props.modelValue) ? props.modelValue[0] : props.modelValue;
    return props.filterable || types.isUndefined(value) ? !states.inputValue : true;
  });
  const currentPlaceholder = Vue.computed(() => {
    const _placeholder = props.placeholder ?? t("el.select.placeholder");
    return props.multiple || !hasModelValue.value ? _placeholder : states.selectedLabel;
  });
  const mouseEnterEventName = Vue.computed(() => index$6.isIOS ? null : "mouseenter");
  Vue.watch(() => props.modelValue, (val, oldVal) => {
    if (props.multiple) {
      if (props.filterable && !props.reserveKeyword) {
        states.inputValue = "";
        handleQueryChange("");
      }
    }
    setSelected();
    if (!isEqual.default(val, oldVal) && props.validateEvent) formItem == null ? void 0 : formItem.validate("change").catch((err) => error.debugWarn(err));
  }, {
    flush: "post",
    deep: true
  });
  Vue.watch(() => expanded.value, (val) => {
    if (val) handleQueryChange(states.inputValue);
    else {
      states.inputValue = "";
      states.previousQuery = null;
      states.isBeforeHide = true;
      states.menuVisibleOnFocus = false;
    }
  });
  Vue.watch(() => states.options.entries(), () => {
    if (!index$6.isClient) return;
    setSelected();
    if (props.defaultFirstOption && (props.filterable || props.remote) && filteredOptionsCount.value) checkDefaultFirstOption();
  }, { flush: "post" });
  Vue.watch([() => states.hoveringIndex, optionsArray], ([val]) => {
    if (types.isNumber(val) && val > -1) hoverOption.value = optionsArray.value[val] || {};
    else hoverOption.value = {};
    optionsArray.value.forEach((option) => {
      option.hover = hoverOption.value === option;
    });
  });
  Vue.watchEffect(() => {
    if (states.isBeforeHide) return;
    updateOptions();
  });
  const handleQueryChange = (val) => {
    if (states.previousQuery === val || isComposing.value) return;
    states.previousQuery = val;
    if (props.filterable && shared_esmBundler.isFunction(props.filterMethod)) props.filterMethod(val);
    else if (props.filterable && props.remote && shared_esmBundler.isFunction(props.remoteMethod)) props.remoteMethod(val);
    if (props.defaultFirstOption && (props.filterable || props.remote) && filteredOptionsCount.value) Vue.nextTick(checkDefaultFirstOption);
    else Vue.nextTick(updateHoveringIndex);
  };
  const checkDefaultFirstOption = () => {
    const optionsInDropdown = optionsArray.value.filter((n) => n.visible && !n.disabled && !n.states.groupDisabled);
    const userCreatedOption = optionsInDropdown.find((n) => n.created);
    const firstOriginOption = optionsInDropdown[0];
    states.hoveringIndex = getValueIndex(optionsArray.value.map((item) => item.value), userCreatedOption || firstOriginOption);
  };
  const setSelected = () => {
    if (!props.multiple) {
      const option = getOption(shared_esmBundler.isArray(props.modelValue) ? props.modelValue[0] : props.modelValue);
      states.selectedLabel = option.currentLabel;
      states.selected = [option];
      return;
    } else states.selectedLabel = "";
    const result = [];
    if (!types.isUndefined(props.modelValue)) castArray.default(props.modelValue).forEach((value) => {
      result.push(getOption(value));
    });
    states.selected = result;
  };
  const getOption = (value) => {
    let option;
    const isObjectValue = shared_esmBundler.isPlainObject(value);
    for (let i = states.cachedOptions.size - 1; i >= 0; i--) {
      const cachedOption = cachedOptionsArray.value[i];
      if (isObjectValue ? get.default(cachedOption.value, props.valueKey) === get.default(value, props.valueKey) : cachedOption.value === value) {
        option = {
          index: optionsArray.value.filter((opt) => !opt.created).indexOf(cachedOption),
          value,
          currentLabel: cachedOption.currentLabel,
          get isDisabled() {
            return cachedOption.isDisabled;
          }
        };
        break;
      }
    }
    if (option) return option;
    return {
      index: -1,
      value,
      currentLabel: isObjectValue ? value.label : value ?? ""
    };
  };
  const updateHoveringIndex = () => {
    const length = states.selected.length;
    if (length > 0) {
      const lastOption = states.selected[length - 1];
      states.hoveringIndex = optionsArray.value.findIndex((item) => getValueKey(lastOption) === getValueKey(item));
    } else states.hoveringIndex = -1;
  };
  const resetSelectionWidth = () => {
    states.selectionWidth = Number.parseFloat(window.getComputedStyle(selectionRef.value).width);
  };
  const resetCollapseItemWidth = () => {
    states.collapseItemWidth = collapseItemRef.value.getBoundingClientRect().width;
  };
  const updateTooltip = () => {
    var _a, _b;
    (_b = (_a = tooltipRef.value) == null ? void 0 : _a.updatePopper) == null ? void 0 : _b.call(_a);
  };
  const updateTagTooltip = () => {
    var _a, _b;
    (_b = (_a = tagTooltipRef.value) == null ? void 0 : _a.updatePopper) == null ? void 0 : _b.call(_a);
  };
  const onInputChange = () => {
    if (states.inputValue.length > 0 && !expanded.value) expanded.value = true;
    handleQueryChange(states.inputValue);
  };
  const onInput = (event2) => {
    states.inputValue = event2.target.value;
    if (props.remote) {
      debouncing.value = true;
      debouncedOnInputChange();
    } else return onInputChange();
  };
  const debouncedOnInputChange = index$6.useDebounceFn(() => {
    onInputChange();
    debouncing.value = false;
  }, debounce);
  const emitChange = (val) => {
    if (!isEqual.default(props.modelValue, val)) emit(event$1.CHANGE_EVENT, val);
  };
  const getLastNotDisabledIndex = (value) => findLastIndex.default(value, (it) => {
    const option = states.cachedOptions.get(it);
    return !(option == null ? void 0 : option.disabled) && !(option == null ? void 0 : option.states.groupDisabled);
  });
  const deletePrevTag = (e) => {
    const code = event.getEventCode(e);
    if (!props.multiple) return;
    if (code === aria.EVENT_CODE.delete) return;
    if (e.target.value.length <= 0) {
      const value = castArray.default(props.modelValue).slice();
      const lastNotDisabledIndex = getLastNotDisabledIndex(value);
      if (lastNotDisabledIndex < 0) return;
      const removeTagValue = value[lastNotDisabledIndex];
      value.splice(lastNotDisabledIndex, 1);
      emit(event$1.UPDATE_MODEL_EVENT, value);
      emitChange(value);
      emit("remove-tag", removeTagValue);
    }
  };
  const deleteTag = (event2, tag) => {
    const index2 = states.selected.indexOf(tag);
    if (index2 > -1 && !selectDisabled.value) {
      const value = castArray.default(props.modelValue).slice();
      value.splice(index2, 1);
      emit(event$1.UPDATE_MODEL_EVENT, value);
      emitChange(value);
      emit("remove-tag", tag.value);
    }
    event2.stopPropagation();
    focus();
  };
  const deleteSelected = (event2) => {
    event2.stopPropagation();
    const value = props.multiple ? [] : valueOnClear.value;
    if (props.multiple) {
      for (const item of states.selected) if (item.isDisabled) value.push(item.value);
    }
    emit(event$1.UPDATE_MODEL_EVENT, value);
    emitChange(value);
    states.hoveringIndex = -1;
    expanded.value = false;
    emit("clear");
    focus();
  };
  const handleOptionSelect = (option) => {
    if (props.multiple) {
      const value = castArray.default(props.modelValue ?? []).slice();
      const optionIndex = getValueIndex(value, option);
      if (optionIndex > -1) value.splice(optionIndex, 1);
      else if (props.multipleLimit <= 0 || value.length < props.multipleLimit) value.push(option.value);
      emit(event$1.UPDATE_MODEL_EVENT, value);
      emitChange(value);
      if (option.created) handleQueryChange("");
      if (props.filterable && (option.created || !props.reserveKeyword)) states.inputValue = "";
    } else {
      !isEqual.default(props.modelValue, option.value) && emit(event$1.UPDATE_MODEL_EVENT, option.value);
      emitChange(option.value);
      expanded.value = false;
    }
    focus();
    if (expanded.value) return;
    Vue.nextTick(() => {
      scrollToOption(option);
    });
  };
  const getValueIndex = (arr, option) => {
    if (types.isUndefined(option)) return -1;
    if (!shared_esmBundler.isObject(option.value)) return arr.indexOf(option.value);
    return arr.findIndex((item) => {
      return isEqual.default(get.default(item, props.valueKey), getValueKey(option));
    });
  };
  const scrollToOption = (option) => {
    var _a, _b, _c, _d, _e;
    const targetOption = shared_esmBundler.isArray(option) ? option[option.length - 1] : option;
    let target = null;
    if (!isNil.default(targetOption == null ? void 0 : targetOption.value)) {
      const options = optionsArray.value.filter((item) => item.value === targetOption.value);
      if (options.length > 0) target = options[0].$el;
    }
    if (tooltipRef.value && target) {
      const menu = (_d = (_c = (_b = (_a = tooltipRef.value) == null ? void 0 : _a.popperRef) == null ? void 0 : _b.contentRef) == null ? void 0 : _c.querySelector) == null ? void 0 : _d.call(_c, `.${nsSelect.be("dropdown", "wrap")}`);
      if (menu) scroll.scrollIntoView(menu, target);
    }
    (_e = scrollbarRef.value) == null ? void 0 : _e.handleScroll();
  };
  const onOptionCreate = (vm) => {
    states.options.set(vm.value, vm);
    states.cachedOptions.set(vm.value, vm);
  };
  const onOptionDestroy = (key, vm) => {
    if (states.options.get(key) === vm) states.options.delete(key);
  };
  const popperRef = Vue.computed(() => {
    var _a, _b;
    return (_b = (_a = tooltipRef.value) == null ? void 0 : _a.popperRef) == null ? void 0 : _b.contentRef;
  });
  const handleMenuEnter = () => {
    states.isBeforeHide = false;
    Vue.nextTick(() => {
      var _a;
      (_a = scrollbarRef.value) == null ? void 0 : _a.update();
      scrollToOption(states.selected);
    });
  };
  const focus = () => {
    var _a;
    (_a = inputRef.value) == null ? void 0 : _a.focus();
  };
  const blur = () => {
    var _a;
    if (expanded.value) {
      expanded.value = false;
      Vue.nextTick(() => {
        var _a2;
        return (_a2 = inputRef.value) == null ? void 0 : _a2.blur();
      });
      return;
    }
    (_a = inputRef.value) == null ? void 0 : _a.blur();
  };
  const handleClearClick = (event2) => {
    deleteSelected(event2);
  };
  const handleClickOutside = (event2) => {
    expanded.value = false;
    if (isFocused.value) {
      const _event = new FocusEvent("blur", event2);
      Vue.nextTick(() => handleBlur(_event));
    }
  };
  const handleEsc = () => {
    if (states.inputValue.length > 0) states.inputValue = "";
    else expanded.value = false;
  };
  const toggleMenu = (event2) => {
    var _a;
    if (selectDisabled.value || props.filterable && expanded.value && event2 && !((_a = suffixRef.value) == null ? void 0 : _a.contains(event2.target))) return;
    if (index$6.isIOS) states.inputHovering = true;
    if (states.menuVisibleOnFocus) states.menuVisibleOnFocus = false;
    else expanded.value = !expanded.value;
  };
  const selectOption = () => {
    if (!expanded.value) toggleMenu();
    else {
      const option = optionsArray.value[states.hoveringIndex];
      if (option && !option.isDisabled) handleOptionSelect(option);
    }
  };
  const getValueKey = (item) => {
    return shared_esmBundler.isObject(item.value) ? get.default(item.value, props.valueKey) : item.value;
  };
  const optionsAllDisabled = Vue.computed(() => optionsArray.value.filter((option) => option.visible).every((option) => option.isDisabled));
  const showTagList = Vue.computed(() => {
    if (!props.multiple) return [];
    return props.collapseTags ? states.selected.slice(0, props.maxCollapseTags) : states.selected;
  });
  const collapseTagList = Vue.computed(() => {
    if (!props.multiple) return [];
    return props.collapseTags ? states.selected.slice(props.maxCollapseTags) : [];
  });
  const navigateOptions = (direction) => {
    if (!expanded.value) {
      expanded.value = true;
      return;
    }
    if (states.options.size === 0 || filteredOptionsCount.value === 0 || isComposing.value) return;
    if (!optionsAllDisabled.value) {
      if (direction === "next") {
        states.hoveringIndex++;
        if (states.hoveringIndex === states.options.size) states.hoveringIndex = 0;
      } else if (direction === "prev") {
        states.hoveringIndex--;
        if (states.hoveringIndex < 0) states.hoveringIndex = states.options.size - 1;
      }
      const option = optionsArray.value[states.hoveringIndex];
      if (option.isDisabled || !option.visible) navigateOptions(direction);
      Vue.nextTick(() => scrollToOption(hoverOption.value));
    }
  };
  const findFocusableIndex = (arr, start, step, len) => {
    for (let i = start; i >= 0 && i < len; i += step) {
      const obj = arr[i];
      if (!(obj == null ? void 0 : obj.isDisabled) && (obj == null ? void 0 : obj.visible)) return i;
    }
    return null;
  };
  const focusOption = (targetIndex, mode) => {
    const len = states.options.size;
    if (len === 0) return;
    const start = clamp.default(targetIndex, 0, len - 1);
    const options = optionsArray.value;
    const direction = mode === "up" ? -1 : 1;
    const newIndex = findFocusableIndex(options, start, direction, len) ?? findFocusableIndex(options, start - direction, -direction, len);
    if (newIndex != null) {
      states.hoveringIndex = newIndex;
      Vue.nextTick(() => scrollToOption(hoverOption.value));
    }
  };
  const handleKeydown = (e) => {
    const code = event.getEventCode(e);
    let isPreventDefault = true;
    switch (code) {
      case aria.EVENT_CODE.up:
        navigateOptions("prev");
        break;
      case aria.EVENT_CODE.down:
        navigateOptions("next");
        break;
      case aria.EVENT_CODE.enter:
      case aria.EVENT_CODE.numpadEnter:
        if (!isComposing.value) selectOption();
        break;
      case aria.EVENT_CODE.esc:
        handleEsc();
        break;
      case aria.EVENT_CODE.backspace:
        isPreventDefault = false;
        deletePrevTag(e);
        return;
      case aria.EVENT_CODE.home:
        if (!expanded.value) return;
        focusOption(0, "down");
        break;
      case aria.EVENT_CODE.end:
        if (!expanded.value) return;
        focusOption(states.options.size - 1, "up");
        break;
      case aria.EVENT_CODE.pageUp:
        if (!expanded.value) return;
        focusOption(states.hoveringIndex - 10, "up");
        break;
      case aria.EVENT_CODE.pageDown:
        if (!expanded.value) return;
        focusOption(states.hoveringIndex + 10, "down");
        break;
      default:
        isPreventDefault = false;
        break;
    }
    if (isPreventDefault) {
      e.preventDefault();
      e.stopPropagation();
    }
  };
  const getGapWidth = () => {
    if (!selectionRef.value) return 0;
    const style = window.getComputedStyle(selectionRef.value);
    return Number.parseFloat(style.gap || "6px");
  };
  const tagStyle = Vue.computed(() => {
    const gapWidth = getGapWidth();
    const inputSlotWidth = props.filterable ? gapWidth + form.MINIMUM_INPUT_WIDTH : 0;
    return { maxWidth: `${collapseItemRef.value && props.maxCollapseTags === 1 ? states.selectionWidth - states.collapseItemWidth - gapWidth - inputSlotWidth : states.selectionWidth - inputSlotWidth}px` };
  });
  const collapseTagStyle = Vue.computed(() => {
    return { maxWidth: `${states.selectionWidth}px` };
  });
  const popupScroll = (data) => {
    emit("popup-scroll", data);
  };
  index$7.useResizeObserver(selectionRef, resetSelectionWidth);
  index$7.useResizeObserver(wrapperRef, updateTooltip);
  index$7.useResizeObserver(tagMenuRef, updateTagTooltip);
  index$7.useResizeObserver(collapseItemRef, resetCollapseItemWidth);
  let stop;
  Vue.watch(() => dropdownMenuVisible.value, (newVal) => {
    if (newVal) stop = index$7.useResizeObserver(menuRef, updateTooltip).stop;
    else {
      stop == null ? void 0 : stop();
      stop = void 0;
    }
    emit("visible-change", newVal);
  });
  Vue.onMounted(() => {
    setSelected();
  });
  return {
    inputId,
    contentId,
    nsSelect,
    nsInput,
    states,
    isFocused,
    expanded,
    optionsArray,
    hoverOption,
    selectSize,
    filteredOptionsCount,
    updateTooltip,
    updateTagTooltip,
    debouncedOnInputChange,
    onInput,
    deletePrevTag,
    deleteTag,
    deleteSelected,
    handleOptionSelect,
    scrollToOption,
    hasModelValue,
    shouldShowPlaceholder,
    currentPlaceholder,
    mouseEnterEventName,
    needStatusIcon,
    showClearBtn,
    iconComponent,
    iconReverse,
    validateState,
    validateIcon,
    showNewOption,
    updateOptions,
    collapseTagSize,
    setSelected,
    selectDisabled,
    emptyText,
    handleCompositionStart,
    handleCompositionUpdate,
    handleCompositionEnd,
    handleKeydown,
    onOptionCreate,
    onOptionDestroy,
    handleMenuEnter,
    focus,
    blur,
    handleClearClick,
    handleClickOutside,
    handleEsc,
    toggleMenu,
    selectOption,
    getValueKey,
    navigateOptions,
    dropdownMenuVisible,
    showTagList,
    collapseTagList,
    popupScroll,
    getOption,
    tagStyle,
    collapseTagStyle,
    popperRef,
    inputRef,
    tooltipRef,
    tagTooltipRef,
    prefixRef,
    suffixRef,
    selectRef,
    wrapperRef,
    selectionRef,
    scrollbarRef,
    menuRef,
    tagMenuRef,
    collapseItemRef
  };
};
exports.useSelect = useSelect;
