var __hasProp={}.hasOwnProperty,__extends=function(e,t){function r(){this.constructor=e}for(var n in t)__hasProp.call(t,n)&&(e[n]=t[n]);return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e};define(["highcharts","underscore","backbone","charts/options"],function(e,t,n,r){var i,s,o,u,a,f,l,c,h,p,d;l={el:"chart.renderTo",type:"chart.type",height:"chart.height",width:"chart.width",labelFormatter:"plotOptions.series.dataLabels.formatter",tooltipFormatter:"tooltip.formatter",animate:"plotOptions.series.animation",categories:"xAxis.categories",title:"title.text",subtitle:"subtitle.text",xAxis:"xAxis.title.text",yAxis:"yAxis.title.text",stacking:"plotOptions.series.stacking",legend:"legend.enabled",suffix:"tooltip.valueSuffix",prefix:"tooltip.valuePrefix",series:"series"},u=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return __extends(n,t),n.prototype.className="chart",n.prototype.chartOptions=r.defaults,n.prototype.initialize=function(e){var t,n;e.el==null&&(e.el=this.el),this.chartOptions=$.extend(!0,{},this.chartOptions,e.options);for(t in e)n=e[t],l[t]&&this.setOption(l[t],n)},n.prototype.setOption=function(e,t){var n,r,i,s,o,u;r=this.chartOptions,s=e.split("."),n=s.pop();for(o=0,u=s.length;o<u;o++)i=s[o],r[i]==null&&(r[i]={}),r=r[i];return r[n]=t},n.prototype.render=function(){return this.chart&&this.chart.destroy(),this.model?(this.chartOptions.series=[$.extend(!0,{},this.model.toJSON())],this.model.categories&&this.setOption("xAxis.categories",this.model.categories)):this.collection&&(this.collection instanceof Series?this.chartOptions.series=[$.extend(!0,{},this.collection.toJSON())]:this.chartOptions.series=$.extend(!0,[],this.collection.toJSON()),this.collection.categories&&this.setOption("xAxis.categories",this.collection.categories)),this.chart=new e.Chart(this.chartOptions),this.$el},n}(n.View),u.setDefaultOption=function(e,n){var r,i,s,o,u,a,f,l;i=this.prototype.chartOptions=t.clone(this.prototype.chartOptions),a=e.split("."),r=a.pop(),s=null,o=null;for(f=0,l=a.length;f<l;f++)u=a[f],s=i,s[u]!=null?i=t.clone(s[u]):i={},s[u]=i;return i[r]=n},i=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return __extends(t,e),t}(u),i.setDefaultOption("chart.type","area"),s=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return __extends(t,e),t}(u),s.setDefaultOption("chart.type","areaspline"),o=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return __extends(t,e),t}(u),o.setDefaultOption("chart.type","bar"),a=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return __extends(t,e),t}(u),a.setDefaultOption("chart.type","column"),f=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return __extends(t,e),t}(u),f.setDefaultOption("chart.type","line"),c=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return __extends(t,e),t}(u),c.setDefaultOption("chart.type","pie"),c.setDefaultOption("legend.enabled",!0),h=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return __extends(t,e),t}(u),h.setDefaultOption("chart.type","scatter"),d=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return __extends(t,e),t}(u),d.setDefaultOption("chart.type","spline"),p=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return __extends(t,e),t.prototype.className="sparkline",t.prototype.chartOptions=r.sparkline,t}(u),n.Chart=u,n.AreaChart=i,n.AreaSplineChart=s,n.BarChart=o,n.ColumnChart=a,n.LineChart=f,n.PieChart=c,n.ScatterChart=h,n.SplineChart=d,n.Sparkline=p})