/* Papa Parse v3.1.4 https://github.com/mholt/PapaParse */ ;(function(e){"use strict";function u(r,i){var s=t?i:g(i);var o=s.worker&&Papa.WORKERS_SUPPORTED&&n;if(o){var u=d();u.userStep=s.step;u.userChunk=s.chunk;u.userComplete=s.complete;u.userError=s.error;s.step=b(s.step);s.chunk=b(s.chunk);s.complete=b(s.complete);s.error=b(s.error);delete s.worker;u.postMessage({input:r,config:s,workerId:u.id})}else{if(typeof r==="string"){if(s.download){var a=new f(s);a.stream(r)}else{var h=new c(s);var p=h.parse(r);return p}}else if(e.File&&r instanceof File||r instanceof Object){if(s.step||s.chunk){var a=new l(s);a.stream(r)}else{var h=new c(s);if(t){var v=new FileReaderSync;var m=v.readAsText(r,s.encoding);return h.parse(m)}else{v=new FileReader;v.onload=function(e){var t=new c(s);var n=t.parse(e.target.result)};v.onerror=function(){if(b(s.error))s.error(v.error,r)};v.readAsText(r,s.encoding)}}}}}function a(t,n){function a(){if(typeof n!=="object")return;if(typeof n.delimiter==="string"&&n.delimiter.length==1&&e.Papa.BAD_DELIMITERS.indexOf(n.delimiter)==-1){o=n.delimiter}if(typeof n.quotes==="boolean"||n.quotes instanceof Array)s=n.quotes;if(typeof n.newline==="string")u=n.newline}function f(e){if(typeof e!=="object")return[];var t=[];for(var n in e)t.push(n);return t}function l(e,t){var n="";if(typeof e==="string")e=JSON.parse(e);if(typeof t==="string")t=JSON.parse(t);var r=e instanceof Array&&e.length>0;var i=!(t[0]instanceof Array);if(r){for(var s=0;s0)n+=o;n+=c(e[s],s)}if(t.length>0)n+=u}for(var a=0;a0)n+=o;var h=r&&i?e[l]:l;n+=c(t[a][h],l)}if(a-1||t.charAt(0)==" "||t.charAt(t.length-1)==" ";return r?'"'+t+'"':t}function h(e,t){for(var n=0;n-1)return true;return false}var r="";var i=[];var s=false;var o=",";var u="\r\n";a();if(typeof t==="string")t=JSON.parse(t);if(t instanceof Array){if(!t.length||t[0]instanceof Array)return l(null,t);else if(typeof t[0]==="object")return l(f(t[0]),t)}else if(typeof t==="object"){if(typeof t.data==="string")t.data=JSON.parse(t.data);if(t.data instanceof Array){if(!t.fields)t.fields=t.data[0]instanceof Array?t.fields:f(t.data[0]);if(!(t.data[0]instanceof Array)&&typeof t.data[0]!=="object")t.data=[t.data]}return l(t.fields||[],t.data||[])}throw"exception: Unable to serialize unrecognized input"}function f(n){function p(){if(l){d();return}u=new XMLHttpRequest;if(!t){u.onload=d;u.onerror=v}u.open("GET",a,!t);if(n.step){var e=r+n.chunkSize-1;if(i&&e>i)e=i;u.setRequestHeader("Range","bytes="+r+"-"+e)}u.send();if(t&&u.status==0)v();else r+=n.chunkSize}function d(){if(u.readyState!=4)return;if(u.status<200||u.status>=400){v();return}s+=o+u.responseText;o="";l=!n.step||r>m(u);if(!l){var i=s.lastIndexOf("\n");if(i<0)i=s.lastIndexOf("\r");if(i>-1){o=s.substring(i+1);s=s.substring(0,i)}else{f();return}}var a=h.parse(s);s="";if(t){e.postMessage({results:a,workerId:Papa.WORKER_ID,finished:l})}else if(b(n.chunk)){console.log("CHUNKED");n.chunk(a);a=undefined}if(!l&&!a.meta.paused)f()}function v(){if(b(n.error))n.error(u.statusText);else if(t&&n.error){e.postMessage({workerId:Papa.WORKER_ID,error:u.statusText,finished:false})}}function m(e){var t=e.getResponseHeader("Content-Range");return parseInt(t.substr(t.lastIndexOf("/")+1))}n=n||{};if(!n.chunkSize)n.chunkSize=Papa.RemoteChunkSize;var r=0,i=0;var s="";var o="";var u,a,f,l;var h=new c(y(n));h.streamer=this;this.resume=function(){f()};this.finished=function(){return l};this.stream=function(e){a=e;if(t){f=function(){p();d()}}else{f=function(){p()}}f()}}function l(n){function f(){if(!l)d()}function d(){var e=Math.min(r+n.chunkSize,i.size);var t=a.readAsText(s.call(i,r,e),n.encoding);if(!p)v({target:{result:t}})}function v(s){r+=n.chunkSize;o+=u+s.target.result;u="";l=r>=i.size;if(!l){var a=o.lastIndexOf("\n");if(a<0)a=o.lastIndexOf("\r");if(a>-1){u=o.substring(a+1);o=o.substring(0,a)}else{f();return}}var c=h.parse(o);o="";if(t){e.postMessage({results:c,workerId:Papa.WORKER_ID,finished:l})}else if(b(n.chunk)){n.chunk(c,i);c=undefined}if(!c||!c.meta.paused)f()}function m(){if(b(n.error))n.error(a.error,i);else if(t&&n.error){e.postMessage({workerId:Papa.WORKER_ID,error:a.error,file:i,finished:false})}}n=n||{};if(!n.chunkSize)n.chunkSize=Papa.LocalChunkSize;var r=0;var i;var s;var o="";var u="";var a,f,s,l;var h=new c(y(n));h.streamer=this;var p=typeof FileReader!=="undefined";this.stream=function(e){i=e;s=i.slice||i.webkitSlice||i.mozSlice;if(p){a=new FileReader;a.onload=v;a.onerror=m}else a=new FileReaderSync;f()};this.finished=function(){return l};this.resume=function(){f()}}function c(e){function c(){if(f&&u){w("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+Papa.DefaultDelimiter+"'");u=false}if(p())d();return v()}function p(){return e.header&&a.length==0}function d(){if(!f)return;for(var e=0;p()&&e=a.length){if(!n["__parsed_extra"])n["__parsed_extra"]=[];n["__parsed_extra"].push(f.data[t][r])}else n[a[r]]=f.data[t][r]}}if(e.header){f.data[t]=n;if(r>a.length)w("FieldMismatch","TooManyFields","Too many fields: expected "+a.length+" fields but parsed "+r,t);else if(r1){a+=Math.abs(p-s);s=p}}f/=l.data.length;if((typeof i==="undefined"||a1.99){i=a;r=u}}e.delimiter=r;return{successful:!!r,bestDelimiter:r}}function g(e){var n=t.test(e);return n?parseFloat(e):e}function w(e,t,n,r){f.errors.push({type:e,code:t,message:n,row:r})}var t=/^\s*-?(\d*\.?\d+|\d+\.?\d*)(e[-+]?\d+)?\s*$/i;var n=this;var r=0;var i;var s;var o=false;var u;var a=[];var f={data:[],errors:[],meta:{}};if(b(e.step)){var l=e.step;e.step=function(t){f=t;if(p())c();else{r+=t.data.length;if(e.preview&&r>e.preview)s.abort();else l(c(),n)}}}this.parse=function(t){u=false;if(!e.delimiter){var r=m(t);if(r.successful)e.delimiter=r.bestDelimiter;else{u=true;e.delimiter=Papa.DefaultDelimiter}f.meta.delimiter=e.delimiter}var a=y(e);if(e.preview&&e.header)a.preview++;i=t;s=new h(a);f=s.parse(i);c();if(b(e.complete)&&!o&&(!n.streamer||n.streamer.finished()))e.complete(f);return o?{meta:{paused:true}}:f||{meta:{paused:false}}};this.pause=function(){o=true;s.abort();i=i.substr(s.getCharIndex())};this.resume=function(){o=false;s=new h(e);s.parse(i);if(!o){if(n.streamer&&!n.streamer.finished())n.streamer.resume();else if(b(e.complete))e.complete(f)}};this.abort=function(){s.abort();if(b(e.complete))e.complete(f);i=""}}function h(e){function y(){while(f0&&m>=u)break;if(a=='"')S();else if(l)x();else T();w()}return E()}function w(){f++;a=n[f]}function E(){if(g)j("Abort","ParseAbort","Parsing was aborted by the user's step function");if(l)j("Quotes","MissingQuotes","Unescaped or mismatched quotes");O();if(!b(s))return q()}function S(){if(H()&&!P())l=!l;else{k();if(l&&P())f++;else j("Quotes","UnexpectedQuotes","Unexpected quotes")}}function x(){if(_(f)||D(f))c++;k()}function T(){if(a==r)L();else if(_(f)){A();w()}else if(D(f))A();else if(N())C();else k()}function N(){if(!i)return false;var e=f==0||D(f-1)||_(f-2);return e&&n[f]===i}function C(){while(!_(f)&&!D(f)&&f=n.length||t==r||t=="\r"||t=="\n"}function j(e,t,n){p.push({type:e,code:t,message:n,line:c,row:d,index:f})}function F(e){n=e;l=false;f=0,m=0,c=1;I();h=[[""]];a=n[f]}function I(){h=[];p=[];d=0;v=0}function q(){return{data:h,errors:p,meta:{lines:c,delimiter:r,aborted:g,truncated:u>0&&f-1)r=",";if(i===true)i="#";else if(typeof i!=="string"||i.length!=1||Papa.BAD_DELIMITERS.indexOf(i)>-1||i==r)i=false;this.parse=function(e){if(typeof e!=="string")throw"Input must be a string";F(e);return y()};this.abort=function(){g=true};this.getCharIndex=function(){return f}}function p(){var e="worker"+String(Math.random()).substr(2);document.write('