import{o as e}from"./rolldown-runtime.C0FnF6B9.js";import{r as t}from"./emotion-is-prop-valid.esm.CuYlOKOk.js";import{$ as n,at as r,et as i,it as a,nt as o,ot as s,tt as c,x as l}from"./Tooltip.CcubhKj6.js";import{n as u}from"./useLabel.DizWobrd.js";import{t as d}from"./Autocomplete.kV4wwzw9.js";import{t as f}from"./Hidden.tKmNEkoU.js";import{t as p}from"./Text.CLxOerZw.js";import{n as m}from"./useField.DDXsKsmK.js";import{n as h}from"./useFormValidation.BcvRvPA1.js";import{i as g,t as _}from"./Input.Bqq6kcs8.js";import{t as v}from"./useTextField.CS2ef5HH.js";var y=e(t(),1),b=(0,y.createContext)({}),x=(0,y.createContext)(null),S=f(function(e,t){[e,t]=i(e,t,x);let{validationBehavior:f}=s(h)||{},S=e.validationBehavior??f??`native`,C=(0,y.useRef)(null);[e,C]=i(e,C,d);let[w,T]=o(!e[`aria-label`]&&!e[`aria-labelledby`]),[E,D]=(0,y.useState)(`input`),{labelProps:O,inputProps:k,descriptionProps:A,errorMessageProps:j,...M}=v({...r(e),inputElementType:E,label:T,validationBehavior:S},C),N=(0,y.useCallback)(e=>{C.current=e,e&&D(e instanceof HTMLTextAreaElement?`textarea`:`input`)},[C]),P=c({...e,values:{isDisabled:e.isDisabled||!1,isInvalid:M.isInvalid,isReadOnly:e.isReadOnly||!1,isRequired:e.isRequired||!1},defaultClassName:`react-aria-TextField`}),F=l(e,{global:!0});return delete F.id,y.createElement(a.div,{...F,...P,ref:t,slot:e.slot||void 0,"data-disabled":e.isDisabled||void 0,"data-invalid":M.isInvalid||void 0,"data-readonly":e.isReadOnly||void 0,"data-required":e.isRequired||void 0},y.createElement(n,{values:[[u,{...O,ref:w}],[_,{...k,ref:N}],[b,{...k,ref:N}],[g,{role:`presentation`,isInvalid:M.isInvalid,isDisabled:e.isDisabled||!1}],[p,{slots:{description:A,errorMessage:j}}],[m,M]]},P.children))});export{S as t};