"use strict";const I=require("./utils-Bv1frUk6.cjs.js"),M=require("./mergeProps-CxnHrnow.cjs.js"),S=require("./filterDOMProps-WUskt27c.cjs.js"),V=require("./useFormReset-COoih4uI.cjs.js"),D=require("./useControlledState-D0L6S_5r.cjs.js"),r=require("react"),O=require("./useField-lK6K_h1G.cjs.js"),R=require("./useFocusable-C7VjcJHL.cjs.js"),f=require("./useFormValidation-BfTV0EQ1.cjs.js");function L(e,a){let{inputElementType:$="input",isDisabled:b=!1,isRequired:l=!1,isReadOnly:v=!1,type:m="text",validationBehavior:d="aria"}=e,[i,u]=D.$458b0a5536c1a7cf$export$40bfa8c7b0832715(e.value,e.defaultValue||"",e.onChange),{focusableProps:C}=R.$f645667febf57a63$export$4c014de7c8940b4c(e,a),s=f.$e5be200c675c3b3a$export$fc1a364ae1f3ff10({...e,value:i}),{isInvalid:n,validationErrors:c,validationDetails:P}=s.displayValidation,{labelProps:g,fieldProps:y,descriptionProps:h,errorMessageProps:x}=O.$2baaea4c71418dea$export$294aa081a6c6f55d({...e,isInvalid:n,errorMessage:e.errorMessage||c}),q=S.$65484d02dcb7eb3e$export$457c3d6518dd4c6f(e,{labelable:!0});const p={type:m,pattern:e.pattern};let[E]=r.useState(i);var o;return V.$99facab73266f662$export$5add1d006293d136(a,(o=e.defaultValue)!==null&&o!==void 0?o:E,u),f.$e93e671b31057976$export$b8473d3665f3a75a(e,s,a),r.useEffect(()=>{if(a.current instanceof I.$431fbd86ca7dc216$export$f21a1ffae260145a(a.current).HTMLTextAreaElement){let t=a.current;Object.defineProperty(t,"defaultValue",{get:()=>t.value,set:()=>{},configurable:!0})}},[a]),{labelProps:g,inputProps:M.$3ef42575df84b30b$export$9d1611c77c2fe928(q,$==="input"?p:void 0,{disabled:b,readOnly:v,required:l&&d==="native","aria-required":l&&d==="aria"||void 0,"aria-invalid":n||void 0,"aria-errormessage":e["aria-errormessage"],"aria-activedescendant":e["aria-activedescendant"],"aria-autocomplete":e["aria-autocomplete"],"aria-haspopup":e["aria-haspopup"],"aria-controls":e["aria-controls"],value:i,onChange:t=>u(t.target.value),autoComplete:e.autoComplete,autoCapitalize:e.autoCapitalize,maxLength:e.maxLength,minLength:e.minLength,name:e.name,form:e.form,placeholder:e.placeholder,inputMode:e.inputMode,autoCorrect:e.autoCorrect,spellCheck:e.spellCheck,[parseInt(r.version,10)>=17?"enterKeyHint":"enterkeyhint"]:e.enterKeyHint,onCopy:e.onCopy,onCut:e.onCut,onPaste:e.onPaste,onCompositionEnd:e.onCompositionEnd,onCompositionStart:e.onCompositionStart,onCompositionUpdate:e.onCompositionUpdate,onSelect:e.onSelect,onBeforeInput:e.onBeforeInput,onInput:e.onInput,...C,...y}),descriptionProps:h,errorMessageProps:x,isInvalid:n,validationErrors:c,validationDetails:P}}exports.$2d73ec29415bd339$export$712718f7aec83d5=L;
//# sourceMappingURL=useTextField-B1RrrtMI.cjs.js.map
