(function(n){var u={className:"autosizejs",id:"autosizejs",append:"",callback:!1,resizeDelay:10,placeholder:!0},r=["fontFamily","fontSize","fontWeight","fontStyle","letterSpacing","textTransform","wordSpacing","textIndent"],i,t=n('<textarea tabindex="-1" style="position:absolute; top:-999px; left:0; right:auto; bottom:auto; border:0; padding: 0; -moz-box-sizing:content-box; -webkit-box-sizing:content-box; box-sizing:content-box; word-wrap:break-word; height:0 !important; min-height:0 !important; overflow:hidden; transition:none; -webkit-transition:none; -moz-transition:none;"/>').data("autosize",!0)[0];t.style.lineHeight="99px";n(t).css("lineHeight")==="99px"&&r.push("lineHeight");t.style.lineHeight="";n.fn.autosize=function(f){return this.length?(f=n.extend({},u,f||{}),t.parentNode!==document.body&&n(document.body).append(t),this.each(function(){function v(){var i,r=window.getComputedStyle?window.getComputedStyle(e,null):!1;r?(i=e.getBoundingClientRect().width,i===0&&(i=parseInt(r.width,10)),n.each(["paddingLeft","paddingRight","borderLeftWidth","borderRightWidth"],function(n,t){i-=parseInt(r[t],10)})):i=Math.max(u.width(),0);t.style.width=i+"px"}function b(){var o={},h,c;i=e;t.className=f.className;t.id=f.id;s=parseInt(u.css("maxHeight"),10);n.each(r,function(n,t){o[t]=u.css(t)});n(t).css(o).attr("wrap",u.attr("wrap"));v();window.chrome&&(h=e.style.width,e.style.width="0px",c=e.offsetWidth,e.style.width=h)}function o(){var n,r;i!==e?b():v();t.value=!e.value&&f.placeholder?(u.attr("placeholder")||"")+f.append:e.value+f.append;t.style.overflowY=e.style.overflowY;r=parseInt(e.style.height,10);t.scrollTop=0;t.scrollTop=9e4;n=t.scrollTop;s&&n>s?(e.style.overflowY="scroll",n=s):(e.style.overflowY="hidden",n<h&&(n=h));n+=c;r!==n&&(e.style.height=n+"px",p&&f.callback.call(e,e))}function y(){clearTimeout(l);l=setTimeout(function(){var n=u.width();n!==a&&(a=n,o())},parseInt(f.resizeDelay,10))}var e=this,u=n(e),s,h,c=0,p=n.isFunction(f.callback),w={height:e.style.height,overflow:e.style.overflow,overflowY:e.style.overflowY,wordWrap:e.style.wordWrap,resize:e.style.resize},l,a=u.width();if(!u.data("autosize")){if(u.data("autosize",!0),(u.css("box-sizing")==="border-box"||u.css("-moz-box-sizing")==="border-box"||u.css("-webkit-box-sizing")==="border-box")&&(c=u.outerHeight()-u.height()),h=Math.max(parseInt(u.css("minHeight"),10)-c||0,u.height()),u.css({overflow:"hidden",overflowY:"hidden",wordWrap:"break-word",resize:u.css("resize")==="none"||u.css("resize")==="vertical"?"none":"horizontal"}),"onpropertychange"in e)if("oninput"in e)u.on("input.autosize keyup.autosize",o);else u.on("propertychange.autosize",function(){event.propertyName==="value"&&o()});else u.on("input.autosize",o);if(f.resizeDelay!==!1)n(window).on("resize.autosize",y);u.on("autosize.resize",o);u.on("autosize.resizeIncludeStyle",function(){i=null;o()});u.on("autosize.destroy",function(){i=null;clearTimeout(l);n(window).off("resize",y);u.off("autosize").off(".autosize").css(w).removeData("autosize")});o()}})):this}})(window.jQuery||window.$)