/**
 * Minified by jsDelivr using Terser v5.37.0.
 * Original file: /npm/expanding-textareas@1.0.2/dist/expanding.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.Expanding=t()}(this,(function(){"use strict";var e=window.navigator.userAgent,t=function(){var t=-1;"Microsoft Internet Explorer"===window.navigator.appName&&(null!==new RegExp("MSIE ([0-9]{1,}[\\.0-9]{0,})").exec(e)&&(t=parseFloat(RegExp.$1)));return t}(),n="oninput"in document.createElement("input")&&9!==t?"input":"keyup",i=/iPad|iPhone|iPod/.test(e)&&!window.MSStream;function l(e,t){for(var n in t)e.style[n]=t[n]}function r(e){this.element=e,this._eventListeners={}}r.prototype={style:function(e){l(this.element,e)},styles:function(){return{position:"absolute",top:0,left:0,height:"100%",resize:"none",overflow:"auto"}},value:function(e){if(0===arguments.length)return this.element.value.replace(/\r\n/g,"\n");this.element.value=e},on:function(e,t){this.element.addEventListener(e,t),this._eventListeners[e]=t},off:function(e){if(0===arguments.length)for(var t in this._eventListeners)this.off(t);else this.element.removeEventListener(e,this._eventListeners[e]),delete this._eventListeners[e]},destroy:function(){this.element.setAttribute("style",this.oldStyleAttribute||""),this.off()}};var o={borderBottomWidth:null,borderLeftWidth:null,borderRightWidth:null,borderTopWidth:null,direction:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStyle:null,fontWeight:null,letterSpacing:null,lineHeight:null,maxHeight:null,paddingBottom:null,paddingLeft:a,paddingRight:a,paddingTop:null,textAlign:null,textDecoration:null,textTransform:null,wordBreak:null,wordSpacing:null,wordWrap:null};function a(e){return i?parseFloat(e)+3+"px":e}function s(){this.element=document.createElement("pre"),this.element.className="expanding-clone",this.innerElement=document.createElement("span"),this.element.appendChild(this.innerElement),this.element.appendChild(document.createElement("br"))}function u(e){var t;this.element=((t=document.createElement("div")).className="expanding-wrapper",t.style.position="relative",t),this.textarea=new r(e),this.textareaClone=new s,this.textarea.oldStyleAttribute=e.getAttribute("style"),h.call(this),d.call(this),function(e,t){e.parentNode.insertBefore(t,e),t.appendChild(e)}(e,this.element),this.element.appendChild(this.textareaClone.element);var i=this.update.bind(this);this.textarea.on(n,i),this.textarea.on("change",i),this.update()}function h(){var e={margin:0,webkitBoxSizing:"border-box",mozBoxSizing:"border-box",boxSizing:"border-box",width:"100%"};this.textareaClone.style({minHeight:this.textarea.element.offsetHeight+"px"}),this.textareaClone.style(e),this.textarea.style(e)}function d(){this.textareaClone.style(this.textareaClone.styles(this.textarea.element)),this.textarea.style(this.textarea.styles())}return s.prototype={value:function(e){if(0===arguments.length)return this.innerElement.textContent;this.innerElement.textContent=e},style:function(e){l(this.element,e)},styles:function(e){var t=e.getAttribute("wrap"),n={display:"block",border:"0 solid",visibility:"hidden",overflowX:"off"===t?"scroll":"hidden",whiteSpace:"off"===t?"pre":"pre-wrap"},i=window.getComputedStyle(e);for(var l in o){var r=o[l],a=i[l];n[l]=r?r(a):a}return n}},u.prototype={update:function(){this.textareaClone.value(this.textarea.value()),function(e,t){t=t||{};var n=document.createEvent("Event");n.initEvent(e,!0,!0===t.cancelable),n.data=null!=t.data?t.data:{},(null!=t.target?t.target:document).dispatchEvent(n)}("expanding:update",{target:this.textarea.element})},refresh:function(){d.call(this)},destroy:function(){this.element.removeChild(this.textareaClone.element),this.element.parentNode.insertBefore(this.textarea.element,this.element),this.element.parentNode.removeChild(this.element),this.textarea.destroy()}},u}));
//# sourceMappingURL=/sm/fe9c0c8b2a0e8c52e9eb71e29a0fb70ed1cf49e978d3674690f8d9941d337f2e.map