var HIDDEN_TEXTAREA_STYLE="\n  min-height:0 !important;\n  max-height:none !important;\n  height:0 !important;\n  visibility:hidden !important;\n  overflow:hidden !important;\n  position:absolute !important;\n  z-index:-1000 !important;\n  top:0 !important;\n  right:0 !important\n",SIZING_STYLE=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"],computedStyleCache={},hiddenTextarea=void 0;function calculateNodeStyling(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=e.getAttribute("id")||e.getAttribute("data-reactid")||e.getAttribute("name");if(t&&computedStyleCache[i])return computedStyleCache[i];var r=window.getComputedStyle(e),a=r.getPropertyValue("box-sizing")||r.getPropertyValue("-moz-box-sizing")||r.getPropertyValue("-webkit-box-sizing"),n=parseFloat(r.getPropertyValue("padding-bottom"))+parseFloat(r.getPropertyValue("padding-top")),o=parseFloat(r.getPropertyValue("border-bottom-width"))+parseFloat(r.getPropertyValue("border-top-width")),d={sizingStyle:SIZING_STYLE.map(function(e){return e+":"+r.getPropertyValue(e)}).join(";"),paddingSize:n,borderSize:o,boxSizing:a};return t&&i&&(computedStyleCache[i]=d),d}export default function calculateNodeHeight(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;hiddenTextarea||(hiddenTextarea=document.createElement("textarea"),document.body.appendChild(hiddenTextarea)),e.getAttribute("wrap")?hiddenTextarea.setAttribute("wrap",e.getAttribute("wrap")):hiddenTextarea.removeAttribute("wrap");var a=calculateNodeStyling(e,t),n=a.paddingSize,o=a.borderSize,d=a.boxSizing,l=a.sizingStyle;hiddenTextarea.setAttribute("style",l+";"+HIDDEN_TEXTAREA_STYLE),hiddenTextarea.value=e.value||e.placeholder||"";var g=Number.MIN_SAFE_INTEGER,h=Number.MAX_SAFE_INTEGER,p=hiddenTextarea.scrollHeight,u=void 0;if("border-box"===d?p+=o:"content-box"===d&&(p-=n),null!==i||null!==r){hiddenTextarea.value=" ";var b=hiddenTextarea.scrollHeight-n;null!==i&&(g=b*i,"border-box"===d&&(g=g+n+o),p=Math.max(g,p)),null!==r&&(h=b*r,"border-box"===d&&(h=h+n+o),u=p>h?"":"hidden",p=Math.min(h,p))}return r||(u="hidden"),{height:p,minHeight:g,maxHeight:h,overflowY:u}};