import{s as N}from"./chunk-DZLz74EQ.js";import{t as _}from"./react-BcIddLXZ.js";import{n as k,t as D}from"./jsx-runtime-DvsdsEjx.js";import{t as R}from"./cn-C5VTNYKf.js";import{r as S}from"./button-nRVaalxL.js";import{v as T}from"./Combination-DR4iFoRS.js";import{t as V}from"./useDebounce-BDmbJDbT.js";var w=N(k(),1),v=N(_(),1),b=N(D(),1),y=v.forwardRef((i,d)=>{let e=(0,w.c)(16),l,r,a;e[0]===i?(l=e[1],r=e[2],a=e[3]):({className:r,bottomAdornment:l,...a}=i,e[0]=i,e[1]=l,e[2]=r,e[3]=a);let o;e[4]===r?o=e[5]:(o=R("shadow-xs-solid hover:shadow-sm-solid disabled:shadow-xs-solid focus-visible:shadow-md-solid","flex w-full mb-1 rounded-sm border border-input bg-background px-3 py-2 text-sm font-code ring-offset-background placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring focus-visible:border-accent disabled:cursor-not-allowed disabled:opacity-50 min-h-6",r),e[4]=r,e[5]=o);let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=S.stopPropagation(),e[6]=m):m=e[6];let s;e[7]!==a||e[8]!==d||e[9]!==o?(s=(0,b.jsx)("textarea",{className:o,onClick:m,ref:d,...a}),e[7]=a,e[8]=d,e[9]=o,e[10]=s):s=e[10];let t;e[11]===l?t=e[12]:(t=l&&(0,b.jsx)("div",{className:"absolute right-0 bottom-1 flex items-center pr-[6px] pointer-events-none text-muted-foreground h-6",children:l}),e[11]=l,e[12]=t);let n;return e[13]!==s||e[14]!==t?(n=(0,b.jsxs)("div",{className:"relative",children:[s,t]}),e[13]=s,e[14]=t,e[15]=n):n=e[15],n});y.displayName="Textarea";const C=v.forwardRef((i,d)=>{let e=(0,w.c)(16),l,r,a;e[0]===i?(l=e[1],r=e[2],a=e[3]):({className:l,onValueChange:r,...a}=i,e[0]=i,e[1]=l,e[2]=r,e[3]=a);let o;e[4]!==r||e[5]!==a.delay||e[6]!==a.value?(o={initialValue:a.value,delay:a.delay,onChange:r},e[4]=r,e[5]=a.delay,e[6]=a.value,e[7]=o):o=e[7];let{value:m,onChange:s}=V(o),t;e[8]===s?t=e[9]:(t=u=>s(u.target.value),e[8]=s,e[9]=t);let n;return e[10]!==l||e[11]!==a||e[12]!==d||e[13]!==t||e[14]!==m?(n=(0,b.jsx)(y,{ref:d,className:l,...a,onChange:t,value:m}),e[10]=l,e[11]=a,e[12]=d,e[13]=t,e[14]=m,e[15]=n):n=e[15],n});C.displayName="DebouncedTextarea";const j=v.forwardRef((i,d)=>{let e=(0,w.c)(23),l,r,a;e[0]===i?(l=e[1],r=e[2],a=e[3]):({className:l,onValueChange:r,...a}=i,e[0]=i,e[1]=l,e[2]=r,e[3]=a);let[o,m]=v.useState(a.value),s;e[4]!==o||e[5]!==r||e[6]!==a.value?(s={prop:a.value,defaultProp:o,onChange:r},e[4]=o,e[5]=r,e[6]=a.value,e[7]=s):s=e[7];let[t,n]=T(s),u,h;e[8]===t?(u=e[9],h=e[10]):(u=()=>{m(t||"")},h=[t],e[8]=t,e[9]=u,e[10]=h),v.useEffect(u,h);let g;e[11]===Symbol.for("react.memo_cache_sentinel")?(g=p=>m(p.target.value),e[11]=g):g=e[11];let c,f;e[12]!==o||e[13]!==n?(c=()=>n(o),f=p=>{p.ctrlKey&&p.key==="Enter"&&(p.preventDefault(),n(o))},e[12]=o,e[13]=n,e[14]=c,e[15]=f):(c=e[14],f=e[15]);let x;return e[16]!==l||e[17]!==o||e[18]!==a||e[19]!==d||e[20]!==c||e[21]!==f?(x=(0,b.jsx)(y,{ref:d,className:l,...a,value:o,onChange:g,onBlur:c,onKeyDown:f}),e[16]=l,e[17]=o,e[18]=a,e[19]=d,e[20]=c,e[21]=f,e[22]=x):x=e[22],x});j.displayName="OnBlurredTextarea";export{j as n,y as r,C as t};
