if(typeof module!=="undefined"&&typeof exports!=="undefined"&&module.exports===exports){module.exports="monospaced.elastic"}angular.module("monospaced.elastic",[]).constant("msdElasticConfig",{append:""}).directive("msdElastic",["$timeout","$window","msdElasticConfig",function(b,c,a){return{require:"ngModel",restrict:"A, C",link:function(d,e,u,p){var n=e[0],l=e;if(n.nodeName!=="TEXTAREA"||!c.getComputedStyle){return}l.css({overflow:"hidden","overflow-y":"hidden","word-wrap":"break-word"});var q=n.value;n.value="";n.value=q;var z=u.msdElastic?u.msdElastic.replace(/\\n/g,"\n"):a.append,s=angular.element(c),A="position: absolute; top: -999px; right: auto; bottom: auto;left: 0; overflow: hidden; -webkit-box-sizing: content-box;-moz-box-sizing: content-box; box-sizing: content-box;min-height: 0 !important; height: 0 !important; padding: 0;word-wrap: break-word; border: 0;",w=angular.element('').data("elastic",true),r=w[0],m=getComputedStyle(n),B=m.getPropertyValue("resize"),o=m.getPropertyValue("box-sizing")==="border-box"||m.getPropertyValue("-moz-box-sizing")==="border-box"||m.getPropertyValue("-webkit-box-sizing")==="border-box",y=!o?{width:0,height:0}:{width:parseInt(m.getPropertyValue("border-right-width"),10)+parseInt(m.getPropertyValue("padding-right"),10)+parseInt(m.getPropertyValue("padding-left"),10)+parseInt(m.getPropertyValue("border-left-width"),10),height:parseInt(m.getPropertyValue("border-top-width"),10)+parseInt(m.getPropertyValue("padding-top"),10)+parseInt(m.getPropertyValue("padding-bottom"),10)+parseInt(m.getPropertyValue("border-bottom-width"),10)},f=parseInt(m.getPropertyValue("min-height"),10),x=parseInt(m.getPropertyValue("height"),10),j=Math.max(f,x)-y.height,t=parseInt(m.getPropertyValue("max-height"),10),k,i,g=["font-family","font-size","font-weight","font-style","letter-spacing","line-height","text-transform","word-spacing","text-indent"];if(l.data("elastic")){return}t=t&&t>0?t:90000;if(r.parentNode!==document.body){angular.element(document.body).append(r)}l.css({resize:(B==="none"||B==="vertical")?"none":"horizontal"}).data("elastic",true);function h(){var D=A;k=n;m=getComputedStyle(n);angular.forEach(g,function(E){D+=E+":"+m.getPropertyValue(E)+";"});r.setAttribute("style",D)}function v(){var G,D,E,F,H;if(k!==n){h()}if(!i){i=true;r.value=n.value+z;r.style.overflowY=n.style.overflowY;G=n.style.height===""?"auto":parseInt(n.style.height,10);D=getComputedStyle(n).getPropertyValue("width");if(D.substr(D.length-2,2)==="px"){F=parseInt(D,10)-y.width;r.style.width=F+"px"}E=r.scrollHeight;if(E>t){E=t;H="scroll"}else{if(E