"use client";
import{a as g,e as v,f as T,g as h,h as L,i as C,j as O,k as y}from"./chunk-2QTVE2XY.js";import{b as P}from"./chunk-SUBVXXYD.js";import{i as b}from"./chunk-CLTGASR6.js";import{s as f}from"./chunk-KEPQUAOX.js";import{forwardRef as K,useRef as Q}from"react";import o from"clsx";import{cloneElement as G,isValidElement as J}from"react";function V({endAdornment:n,ref:l,startAdornment:p}){let a=e=>e&&J(e)?G(e,{...e.props,onClick:e.props.onClick||(()=>l.current?.focus())}):e;return{endAdornment:a(n),startAdornment:a(p)}}import{jsx as t,jsxs as u}from"react/jsx-runtime";var W=K((n,l)=>{let{className:p,endAdornment:a,fullWidth:e,id:s,infoText:A,label:d,loading:m,loadingColorType:k,loadingWidthOverride:w,placeholder:I,rtl:E,startAdornment:B,variant:F,warning:H,...i}=n,N=F||"body1",M=w||"100%",c=Q(null),{disabled:U,error:j,focused:$,getInputProps:q,getRootProps:z}=P({...n,inputRef:c}),R=q(),D=b(l,R.ref),r=g({disabled:U,error:j,focused:$,fullWidth:e,loading:m,noLabel:!d,placeholder:I,rtl:E,shrinkLabel:!!m,value:c.current?.value||i.defaultValue||i.value,warning:H}),{endAdornment:S,startAdornment:x}=V({endAdornment:a,ref:c,startAdornment:B});return u(v,{className:o(p,r.root),children:[u(T,{...z(),className:o(r.wrapper),children:[x&&t(f,{className:o(r.startAdornment),children:x}),u(h,{className:o(r.inner),children:[d&&t(L,{className:o(r.label),htmlFor:s,id:s&&`${s}-label`,children:d}),m?t(y,{colorType:k,fontVariant:N,widthOverride:M}):t(C,{...i,...R,className:o(r.input),id:s,placeholder:I,ref:D,variant:N})]}),S&&t(f,{className:o(r.endAdornment),children:S})]}),A&&t(O,{className:o(r.infoText),children:A})]})});W.displayName="Input";var X=W;export{X as a};
