(function(){vare,t,n,r,i=[].slice,s={}.hasOwnProperty,o=function(e,t){functionr(){this.constructor=e}for(varnint)s.call(t,n)&&(e[n]=t[n]);returnr.prototype=t.prototype,e.prototype=newr,e.__super__=t.prototype,e},u=function(e,t){returnfunction(){returne.apply(t,arguments)}},a=[].indexOf||function(e){for(vart=0,n=this.length;t<n;t++)if(tinthis&&this[t]===e)returnt;return-1};t=window.Morris={},e=jQuery,t.EventEmitter=function(){functione(){}returne.prototype.on=function(e,t){returnthis.handlers==null&&(this.handlers={}),this.handlers[e]==null&&(this.handlers[e]=[]),this.handlers[e].push(t)},e.prototype.fire=function(){vare,t,n,r,s,o,u;n=arguments[0],e=2<=arguments.length?i.call(arguments,1):[];if(this.handlers!=null&&this.handlers[n]!=null){o=this.handlers[n],u=[];for(r=0,s=o.length;r<s;r++)t=o[r],u.push(t.apply(null,e));returnu}},e}(),t.commas=function(e){vart,n,r,i;returne===null?"-":(r=e<0?"-":"",t=Math.abs(e),n=Math.floor(t).toFixed(0),r+=n.replace(/(?=(?:\d{3})+$)(?!^)/g,","),i=t.toString(),i.length>n.length&&(r+=i.slice(n.length)),r)},t.pad2=function(e){return(e<10?"0":"")+e},t.Grid=function(n){functionr(t){typeoft.element=="string"?this.el=e(document.getElementById(t.element)):this.el=e(t.element);if(this.el===null||this.el.length===0)thrownewError("Graph container element not found");this.options=e.extend({},this.gridDefaults,this.defaults||{},t);if(this.options.data===void0||this.options.data.length===0)return;typeofthis.options.units=="string"&&(this.options.postUnits=t.units),this.r=newRaphael(this.el[0]),this.elementWidth=null,this.elementHeight=null,this.dirty=!1,this.init&&this.init(),this.setData(this.options.data)}returno(r,n),r.prototype.gridDefaults={dateFormat:null,gridLineColor:"#aaa",gridStrokeWidth:.5,gridTextColor:"#888",gridTextSize:12,numLines:5,padding:25,parseTime:!0,postUnits:"",preUnits:"",ymax:"auto",ymin:"auto 0"},r.prototype.setData=function(n,r){vari,s,o=this;r==null&&(r=!0),i=this.cumulative?0:null,s=this.cumulative?0:null,this.data=e.map(n,function(e,n){varr,u,a,f,l;returnu={},u.label=e[o.options.xkey],o.options.parseTime?(u.x=t.parseDate(u.label),o.options.dateFormat?u.label=o.options.dateFormat(u.x):typeofu.label=="number"&&(u.label=(newDate(u.label)).toString())):u.x=n,a=0,u.y=function(){vart,n,o,u;o=this.options.ykeys,u=[];for(r=t=0,n=o.length;t<n;r=++t)f=o[r],l=e[f],typeofl=="string"&&(l=parseFloat(l)),typeofl!="number"&&(l=null),l!==null&&(this.cumulative?a+=l:i===null?i=s=l:(i=Math.max(l,i),s=Math.min(l,s))),this.cumulative&&a!==null&&(i=Math.max(a,i),s=Math.min(a,s)),u.push(l);returnu}.call(o),u}),this.options.parseTime&&(this.data=this.data.sort(function(e,t){return(e.x>t.x)-(t.x>e.x)})),this.xmin=this.data[0].x,this.xmax=this.data[this.data.length-1].x,this.xmin===this.xmax&&(this.xmin-=1,this.xmax+=1),typeofthis.options.ymax=="string"?this.options.ymax.slice(0,4)==="auto"?this.options.ymax.length>5?(this.ymax=parseInt(this.options.ymax.slice(5),10),i!==null&&(this.ymax=Math.max(i,this.ymax))):this.ymax=i!==null?i:0:this.ymax=parseInt(this.options.ymax,10):this.ymax=this.options.ymax,typeofthis.options.ymin=="string"?this.options.ymin.slice(0,4)==="auto"?this.options.ymin.length>5?(this.ymin=parseInt(this.options.ymin.slice(5),10),s!==null&&(this.ymin=Math.min(s,this.ymin))):this.ymin=s!==null?s:0:this.ymin=parseInt(this.options.ymin,10):this.ymin=this.options.ymin,this.ymin===this.ymax&&(s&&(this.ymin-=1),this.ymax+=1),this.yInterval=(this.ymax-this.ymin)/(this.options.numLines-1),this.yInterval>0&&this.yInterval<1?this.precision=-Math.floor(Math.log(this.yInterval)/Math.log(10)):this.precision=0,this.dirty=!0;if(r)returnthis.redraw()},r.prototype._calc=function(){vare,t,n,r;r=this.el.width(),e=this.el.height();if(this.elementWidth!==r||this.elementHeight!==e||this.dirty){this.elementWidth=r,this.elementHeight=e,this.dirty=!1,t=Math.max(this.measureText(this.yAxisFormat(this.ymin),this.options.gridTextSize).width,this.measureText(this.yAxisFormat(this.ymax),this.options.gridTextSize).width),typeofthis.options.padding=="string"?(n=this.o