"use strict";(self.webpackChunkschedula_form=self.webpackChunkschedula_form||[]).push([[1363],{71747:function(e,t,r){var n=r(29439),u=r(87462),o=r(63366),a=r(72791),i=r(54164),l=r(47563),s=r(27979),c=r(93981),f=r(75721),d=r(80184),h=["onChange","maxRows","minRows","style","value"];function v(e,t){return parseInt(e[t],10)||0}var b={visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"};function w(e){return void 0===e||null===e||0===Object.keys(e).length}var g=a.forwardRef((function(e,t){var r=e.onChange,g=e.maxRows,m=e.minRows,p=void 0===m?1:m,y=e.style,x=e.value,Z=(0,o.Z)(e,h),R=a.useRef(null!=x).current,C=a.useRef(null),S=(0,l.Z)(t,C),k=a.useRef(null),H=a.useRef(0),z=a.useState({}),M=(0,n.Z)(z,2),j=M[0],E=M[1],N=a.useCallback((function(){var t=C.current,r=(0,s.Z)(t).getComputedStyle(t);if("0px"===r.width)return{};var n=k.current;n.style.width=r.width,n.value=t.value||e.placeholder||"x","\n"===n.value.slice(-1)&&(n.value+=" ");var u=r["box-sizing"],o=v(r,"padding-bottom")+v(r,"padding-top"),a=v(r,"border-bottom-width")+v(r,"border-top-width"),i=n.scrollHeight;n.value="x";var l=n.scrollHeight,c=i;return p&&(c=Math.max(Number(p)*l,c)),g&&(c=Math.min(Number(g)*l,c)),{outerHeightStyle:(c=Math.max(c,l))+("border-box"===u?o+a:0),overflow:Math.abs(c-i)<=1}}),[g,p,e.placeholder]),O=function(e,t){var r=t.outerHeightStyle,n=t.overflow;return H.current<20&&(r>0&&Math.abs((e.outerHeightStyle||0)-r)>1||e.overflow!==n)?(H.current+=1,{overflow:n,outerHeightStyle:r}):e},I=a.useCallback((function(){var e=N();w(e)||E((function(t){return O(t,e)}))}),[N]);a.useEffect((function(){var e,t=(0,c.Z)((function(){H.current=0,C.current&&function(){var e=N();w(e)||(0,i.flushSync)((function(){E((function(t){return O(t,e)}))}))}()})),r=(0,s.Z)(C.current);return r.addEventListener("resize",t),"undefined"!==typeof ResizeObserver&&(e=new ResizeObserver(t)).observe(C.current),function(){t.clear(),r.removeEventListener("resize",t),e&&e.disconnect()}})),(0,f.Z)((function(){I()})),a.useEffect((function(){H.current=0}),[x]);return(0,d.jsxs)(a.Fragment,{children:[(0,d.jsx)("textarea",(0,u.Z)({value:x,onChange:function(e){H.current=0,R||I(),r&&r(e)},ref:S,rows:p,style:(0,u.Z)({height:j.outerHeightStyle,overflow:j.overflow?"hidden":null},y)},Z)),(0,d.jsx)("textarea",{"aria-hidden":!0,className:e.className,readOnly:!0,ref:k,tabIndex:-1,style:(0,u.Z)({},b,y,{padding:0})})]})}));t.Z=g},91363:function(e,t,r){r.r(t),r.d(t,{default:function(){return n.Z}});var n=r(71747)}}]);
//# sourceMappingURL=1363.fac3266a.chunk.js.map