"use client";import{useFocusRing as E}from"@react-aria/focus";import{useHover as v}from"@react-aria/interactions";import{useMemo as A}from"react";import{useActivePress as g}from'../../hooks/use-active-press.js';import{useId as _}from'../../hooks/use-id.js';import{useDisabled as D}from'../../internal/disabled.js';import{useProvidedId as F}from'../../internal/id.js';import{forwardRefWithAs as L,mergeProps as R,render as C}from'../../utils/render.js';import{useDescribedBy as x}from'../description/description.js';import{useLabelledBy as h}from'../label/label.js';let H="select";function B(a,i){let p=_(),d=F(),n=D(),{id:c=d||`headlessui-select-${p}`,disabled:e=n||!1,invalid:t=!1,autoFocus:o=!1,...f}=a,m=h(),u=x(),{isFocusVisible:r,focusProps:T}=E({autoFocus:o}),{isHovered:l,hoverProps:b}=v({isDisabled:e}),{pressed:s,pressProps:y}=g({disabled:e}),P=R({ref:i,id:c,"aria-labelledby":m,"aria-describedby":u,"aria-invalid":t?"":void 0,disabled:e||void 0,autoFocus:o},T,b,y),S=A(()=>({disabled:e,invalid:t,hover:l,focus:r,active:s,autofocus:o}),[e,t,l,r,s,o]);return C({ourProps:P,theirProps:f,slot:S,defaultTag:H,name:"Select"})}let $=L(B);export{$ as Select};
