import{s as w}from"./chunk-LvLJmgfZ.js";import{t as _}from"./react-Bj1aDYRI.js";import{t as k}from"./compiler-runtime-B3qBwwSJ.js";import{t as D}from"./cn-DYvqRARy.js";import{t as R}from"./jsx-runtime-Blw4afVn.js";import{y as S}from"./fullscreen-CTDqNQr6.js";import{r as T}from"./button-DDGiD1NW.js";import{t as V}from"./useDebounce-JDKr83KO.js";var N=k(),v=w(_(),1),b=w(R(),1),y=v.forwardRef((i,d)=>{let e=(0,N.c)(16),r,l,a;e[0]===i?(r=e[1],l=e[2],a=e[3]):({className:l,bottomAdornment:r,...a}=i,e[0]=i,e[1]=r,e[2]=l,e[3]=a);let o;e[4]===l?o=e[5]:(o=D("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",l),e[4]=l,e[5]=o);let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=T.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]===r?t=e[12]:(t=r&&(0,b.jsx)("div",{className:"absolute right-0 bottom-1 flex items-center pr-[6px] pointer-events-none text-muted-foreground h-6",children:r}),e[11]=r,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,N.c)(16),r,l,a;e[0]===i?(r=e[1],l=e[2],a=e[3]):({className:r,onValueChange:l,...a}=i,e[0]=i,e[1]=r,e[2]=l,e[3]=a);let o;e[4]!==l||e[5]!==a.delay||e[6]!==a.value?(o={initialValue:a.value,delay:a.delay,onChange:l},e[4]=l,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]!==r||e[11]!==a||e[12]!==d||e[13]!==t||e[14]!==m?(n=(0,b.jsx)(y,{ref:d,className:r,...a,onChange:t,value:m}),e[10]=r,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,N.c)(23),r,l,a;e[0]===i?(r=e[1],l=e[2],a=e[3]):({className:r,onValueChange:l,...a}=i,e[0]=i,e[1]=r,e[2]=l,e[3]=a);let[o,m]=v.useState(a.value),s;e[4]!==o||e[5]!==l||e[6]!==a.value?(s={prop:a.value,defaultProp:o,onChange:l},e[4]=o,e[5]=l,e[6]=a.value,e[7]=s):s=e[7];let[t,n]=S(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]!==r||e[17]!==o||e[18]!==a||e[19]!==d||e[20]!==c||e[21]!==f?(x=(0,b.jsx)(y,{ref:d,className:r,...a,value:o,onChange:g,onBlur:c,onKeyDown:f}),e[16]=r,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};
