!function(h){function n(t,e){this.init(t,e)}var m=h.each;h.extend(n.prototype,{init:function(t,e){this.options=t,this.chartOptions=e,this.columns=t.columns||this.rowsToColumns(t.rows)||[],this.columns.length?this.dataFound():(this.parseCSV(),this.parseTable(),this.parseGoogleSpreadsheet())},getColumnDistribution:function(){function e(t){return(h.seriesTypes[t||"line"].prototype.pointArrayMap||[0]).length}var t=this.chartOptions,n=t&&t.chart&&t.chart.type,i=[];m(t&&t.series||[],function(t){i.push(e(t.type||n))}),this.valueCount={global:e(n),individual:i}},dataFound:function(){this.parseTypes(),this.findHeaderRow(),this.parsed(),this.complete()},parseCSV:function(){var t,o=this,r=this.options,e=r.csv,a=this.columns,l=r.startRow||0,u=r.endRow||Number.MAX_VALUE,h=r.startColumn||0,c=r.endColumn||Number.MAX_VALUE,p=0;e&&(t=e.replace(/\r\n/g,"\n").replace(/\r/g,"\n").split(r.lineDelimiter||"\n"),m(t,function(t,e){var n,i=o.trim(t),s=0===i.indexOf("#");!(l<=e&&e<=u)||s||""===i||(n=t.split(r.itemDelimiter||","),m(n,function(t,e){h<=e&&e<=c&&(a[e-h]||(a[e-h]=[]),a[e-h][p]=t)}),p+=1)}),this.dataFound())},parseTable:function(){var n,t=this.options,e=t.table,i=this.columns,s=t.startRow||0,o=t.endRow||Number.MAX_VALUE,r=t.startColumn||0,a=t.endColumn||Number.MAX_VALUE;e&&("string"==typeof e&&(e=document.getElementById(e)),m(e.getElementsByTagName("tr"),function(t,e){n=0,s<=e&&e<=o&&m(t.childNodes,function(t){("TD"===t.tagName||"TH"===t.tagName)&&r<=n&&n<=a&&(i[n]||(i[n]=[]),i[n][e-s]=t.innerHTML,n+=1)})}),this.dataFound())},parseGoogleSpreadsheet:function(){var a,l,u=this,t=this.options,e=t.googleSpreadsheetKey,h=this.columns,c=t.startRow||0,p=t.endRow||Number.MAX_VALUE,m=t.startColumn||0,d=t.endColumn||Number.MAX_VALUE;e&&jQuery.getJSON("https://spreadsheets.google.com/feeds/cells/"+e+"/"+(t.googleSpreadsheetWorksheet||"od6")+"/public/values?alt=json-in-script&callback=?",function(t){var e,n,i=t.feed.entry,s=i.length,o=0,r=0;for(n=0;n