var e=[`letter-spacing`,`line-height`,`padding-top`,`padding-bottom`,`font-family`,`font-weight`,`font-size`,`font-variant`,`text-rendering`,`text-transform`,`width`,`text-indent`,`padding-left`,`padding-right`,`border-width`,`box-sizing`,`word-break`,`white-space`],t={},n;function r(n,r=!1){let i=n.getAttribute(`id`)||n.getAttribute(`data-reactid`)||n.getAttribute(`name`);if(r&&t[i])return t[i];let a=window.getComputedStyle(n),o=a.getPropertyValue(`box-sizing`)||a.getPropertyValue(`-moz-box-sizing`)||a.getPropertyValue(`-webkit-box-sizing`),s=Number.parseFloat(a.getPropertyValue(`padding-bottom`))+Number.parseFloat(a.getPropertyValue(`padding-top`)),c=Number.parseFloat(a.getPropertyValue(`border-bottom-width`))+Number.parseFloat(a.getPropertyValue(`border-top-width`)),l={sizingStyle:e.map(e=>`${e}:${a.getPropertyValue(e)}`).join(`;`),paddingSize:s,borderSize:c,boxSizing:o};return r&&i&&(t[i]=l),l}function i(e,t=!1,i=null,a=null){n||(n=document.createElement(`textarea`),n.setAttribute(`tab-index`,`-1`),n.setAttribute(`aria-hidden`,`true`),document.body.appendChild(n)),e.getAttribute(`wrap`)?n.setAttribute(`wrap`,e.getAttribute(`wrap`)):n.removeAttribute(`wrap`);let{paddingSize:o,borderSize:s,boxSizing:c,sizingStyle:l}=r(e,t);n.setAttribute(`style`,`${l};
  min-height:0 !important;
  max-height:none !important;
  height:0 !important;
  visibility:hidden !important;
  overflow:hidden !important;
  position:absolute !important;
  z-index:-1000 !important;
  top:0 !important;
  right:0 !important;
  pointer-events: none !important;
`),n.value=e.value||e.placeholder||``;let u,d,f,p=n.scrollHeight;if(c===`border-box`?p+=s:c===`content-box`&&(p-=o),i!==null||a!==null){n.value=` `;let e=n.scrollHeight-o;i!==null&&(u=e*i,c===`border-box`&&(u=u+o+s),p=Math.max(u,p)),a!==null&&(d=e*a,c===`border-box`&&(d=d+o+s),f=p>d?``:`hidden`,p=Math.min(d,p))}let m={height:`${p}px`,overflowY:f,resize:`none`};return u&&(m.minHeight=`${u}px`),d&&(m.maxHeight=`${d}px`),m}exports.calculateNodeStyling=r,exports.default=i;