/*! For license information please see jquery.autosize.js.LICENSE.txt */
!function(e,t){if("function"==typeof define&&define.amd)define(["exports","module"],t);else if("undefined"!=typeof exports&&"undefined"!=typeof module)t(exports,module);else{var o={exports:{}};t(0,o),e.autosize=o.exports}}(this,(function(e,t){"use strict";function o(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName){var t=document.createEvent("Event");t.initEvent("autosize:destroy",!0,!1),e.dispatchEvent(t)}}function n(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName){var t=document.createEvent("Event");t.initEvent("autosize:update",!0,!1),e.dispatchEvent(t)}}var i=null;"function"!=typeof window.getComputedStyle?((i=function(e){return e}).destroy=function(e){return e},i.update=function(e){return e}):(i=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],(function(e){return function(e){var t=void 0===arguments[1]?{}:arguments[1],o=t.setOverflowX,n=void 0===o||o,i=t.setOverflowY,r=void 0===i||i;if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!e.hasAttribute("data-autosize-on")){var d=null,s="hidden",l=function(t){window.removeEventListener("resize",v),e.removeEventListener("input",v),e.removeEventListener("keyup",v),e.removeAttribute("data-autosize-on"),e.removeEventListener("autosize:destroy",l),Object.keys(t).forEach((function(o){e.style[o]=t[o]}))}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",l),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",v),window.addEventListener("resize",v),e.addEventListener("input",v),e.addEventListener("autosize:update",v),e.setAttribute("data-autosize-on",!0),r&&(e.style.overflowY="hidden"),n&&(e.style.overflowX="hidden",e.style.wordWrap="break-word"),a()}function a(){var t=window.getComputedStyle(e,null);"vertical"===t.resize?e.style.resize="none":"both"===t.resize&&(e.style.resize="horizontal"),d="content-box"===t.boxSizing?-(parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)):parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth),v()}function u(t){var o=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=o,s=t,r&&(e.style.overflowY=t),v()}function v(){var t=e.style.height,o=document.documentElement.scrollTop,n=document.body.scrollTop,i=e.style.height;e.style.height="auto";var r=e.scrollHeight+d;if(0!==e.scrollHeight){if(e.style.height=r+"px",document.documentElement.scrollTop=o,document.body.scrollTop=n,window.getComputedStyle(e,null).height!==e.style.height){if("visible"!==s)return void u("visible")}else if("hidden"!==s)return void u("hidden");if(t!==e.style.height){var l=document.createEvent("Event");l.initEvent("autosize:resized",!0,!1),e.dispatchEvent(l)}}else e.style.height=i}}(e,t)})),e},i.destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],o),e},i.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],n),e}),t.exports=i}));