From 0e0ee8dcfa5e11f251c12b377ebf572d49c8800c Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Fri, 16 Jan 2015 13:13:47 -0700 Subject: [PATCH] Build, version 4.1.0 --- LICENSE | 2 +- package.json | 2 +- papaparse.js | 2 +- papaparse.min.js | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/LICENSE b/LICENSE index 0d04dcdc..12f5b350 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2014 Matthew Holt +Copyright (c) 2015 Matthew Holt Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/package.json b/package.json index ea0b5996..e818a282 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "papaparse", - "version": "4.0.7", + "version": "4.1.0", "description": "Fast and powerful CSV parser for the browser that supports web workers and streaming large files. Converts CSV to JSON and JSON to CSV.", "keywords": [ "csv", diff --git a/papaparse.js b/papaparse.js index 770d5481..e445f789 100644 --- a/papaparse.js +++ b/papaparse.js @@ -1,6 +1,6 @@ /*! Papa Parse - v4.0.7 + v4.1.0 https://github.com/mholt/PapaParse */ (function(global) diff --git a/papaparse.min.js b/papaparse.min.js index 26ca0609..102c82a2 100644 --- a/papaparse.min.js +++ b/papaparse.min.js @@ -1,6 +1,6 @@ /*! Papa Parse - v4.0.7 + v4.1.0 https://github.com/mholt/PapaParse */ -!function(a){"use strict";function b(b,c){var g=p?c:l(c),h=g.worker&&Papa.WORKERS_SUPPORTED&&o;if(h){var j=i();j.userStep=g.step,j.userChunk=g.chunk,j.userComplete=g.complete,j.userError=g.error,g.step=n(g.step),g.chunk=n(g.chunk),g.complete=n(g.complete),g.error=n(g.error),delete g.worker,j.postMessage({input:b,config:g,workerId:j.id})}else if("string"==typeof b){if(!g.download){var k=new f(g),m=k.parse(b);return m}var q=new d(g);q.stream(b)}else if(a.File&&b instanceof File||b instanceof Object)if(g.step||g.chunk){var q=new e(g);q.stream(b)}else{var k=new f(g);if(p){var r=new FileReaderSync,s=r.readAsText(b,g.encoding);return k.parse(s)}r=new FileReader,r.onload=function(a){{var b=new f(g);b.parse(a.target.result)}},r.onerror=function(){n(g.error)&&g.error(r.error,b)},r.readAsText(b,g.encoding)}}function c(b,c){function d(){"object"==typeof c&&("string"==typeof c.delimiter&&1==c.delimiter.length&&-1==a.Papa.BAD_DELIMITERS.indexOf(c.delimiter)&&(j=c.delimiter),("boolean"==typeof c.quotes||c.quotes instanceof Array)&&(i=c.quotes),"string"==typeof c.newline&&(k=c.newline))}function e(a){if("object"!=typeof a)return[];var b=[];for(var c in a)b.push(c);return b}function f(a,b){var c="";"string"==typeof a&&(a=JSON.parse(a)),"string"==typeof b&&(b=JSON.parse(b));var d=a instanceof Array&&a.length>0,e=!(b[0]instanceof Array);if(d){for(var f=0;f0&&(c+=j),c+=g(a[f],f);b.length>0&&(c+=k)}for(var h=0;hl;l++){l>0&&(c+=j);var m=d&&e?a[l]:l;c+=g(b[h][m],l)}h-1||" "==b.charAt(0)||" "==b.charAt(b.length-1);return d?'"'+b+'"':b}function h(a,b){for(var c=0;c-1)return!0;return!1}var i=!1,j=",",k="\r\n";if(d(),"string"==typeof b&&(b=JSON.parse(b)),b instanceof Array){if(!b.length||b[0]instanceof Array)return f(null,b);if("object"==typeof b[0])return f(e(b[0]),b)}else if("object"==typeof b)return"string"==typeof b.data&&(b.data=JSON.parse(b.data)),b.data instanceof Array&&(b.fields||(b.fields=b.data[0]instanceof Array?b.fields:e(b.data[0])),b.data[0]instanceof Array||"object"==typeof b.data[0]||(b.data=[b.data])),f(b.fields||[],b.data||[]);throw"exception: Unable to serialize unrecognized input"}function d(b){function c(){if(l)return void d();if(i=new XMLHttpRequest,p||(i.onload=d,i.onerror=e),i.open("GET",j,!p),b.step||b.chunk){var a=s+r.chunkSize-1;t&&a>t&&(a=t),i.setRequestHeader("Range","bytes="+s+"-"+a)}try{i.send()}catch(c){e(c.message)}p&&0==i.status?e():s+=r.chunkSize}function d(){if(4==i.readyState){if(i.status<200||i.status>=400)return void e();if(v+=w+i.responseText,w="",l=!b.step&&!b.chunk||s>g(i),!l){var c=v.lastIndexOf("\r");if(-1==c&&(c=v.lastIndexOf("\n")),-1==c)return void k();w=v.substring(c+1),v=v.substring(0,c)}var d=q.parse(v);v="",d&&d.data&&(u+=d.data.length);var f=l||r.preview&&u>=r.preview;p?a.postMessage({results:d,workerId:Papa.WORKER_ID,finished:f}):n(b.chunk)&&(b.chunk(d,q),d=void 0),n(o)&&f&&o(d),f||d&&d.meta.paused||k()}}function e(c){var d=i.statusText||c;n(b.error)?b.error(d):p&&b.error&&a.postMessage({workerId:Papa.WORKER_ID,error:d,finished:!1})}function g(a){var b=a.getResponseHeader("Content-Range");return parseInt(b.substr(b.lastIndexOf("/")+1))}function h(a){r=m(a),o=r.complete,r.complete=void 0,r.chunkSize=parseInt(r.chunkSize),q=new f(r),q.streamer=this}b=b||{},b.chunkSize||(b.chunkSize=Papa.RemoteChunkSize);var i,j,k,l,o,q,r,s=0,t=0,u=0,v="",w="";h(b),this.resume=function(){paused=!1,k()},this.finished=function(){return l},this.pause=function(){paused=!0},this.abort=function(){l=!0,n(o)&&o({data:[],errors:[],meta:{aborted:!0}})},this.stream=function(a){j=a,(k=p?function(){c(),d()}:function(){c()})()}}function e(b){function c(){l||r.preview&&!(v=i.size,!l){var e=t.lastIndexOf("\r");if(-1==e&&(e=t.lastIndexOf("\n")),-1==e)return void c();u=t.substring(e+1),t=t.substring(0,e)}var f=q.parse(t);t="",f&&f.data&&(v+=f.data.length);var g=l||r.preview&&v>=r.preview;if(p)a.postMessage({results:f,workerId:Papa.WORKER_ID,finished:g});else if(n(b.chunk)){if(b.chunk(f,x,i),w)return;f=void 0}n(o)&&g&&o(f),g||f&&f.meta.paused||c()}function g(){n(b.error)?b.error(k.error,i):p&&b.error&&a.postMessage({workerId:Papa.WORKER_ID,error:k.error,file:i,finished:!1})}function h(a){r=m(a),o=r.complete,r.complete=void 0,r.chunkSize=parseInt(r.chunkSize),q=new f(r),q.streamer=this}b=b||{},b.chunkSize||(b.chunkSize=Papa.LocalChunkSize);var i,j,k,c,j,l,o,q,r,s=0,t="",u="",v=0,w=!1,x=this;h(b);var y="undefined"!=typeof FileReader;this.stream=function(a){i=a,j=i.slice||i.webkitSlice||i.mozSlice,y?(k=new FileReader,k.onload=e,k.onerror=g):k=new FileReaderSync,c()},this.finished=function(){return l},this.pause=function(){w=!0},this.resume=function(){w=!1,c()},this.abort=function(){l=!0,n(o)&&o({data:[],errors:[],meta:{aborted:!0}})}}function f(a){function b(){if(u&&o&&(j("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+Papa.DefaultDelimiter+"'"),o=!1),a.skipEmptyLines)for(var b=0;b=t.length?(c.__parsed_extra||(c.__parsed_extra=[]),c.__parsed_extra.push(u.data[b][d])):c[t[d]]=u.data[b][d])}a.header&&(u.data[b]=c,d>t.length?j("FieldMismatch","TooManyFields","Too many fields: expected "+t.length+" fields but parsed "+d,b):d1&&(j+=Math.abs(n-e),e=n):e=n}k/=l.data.length,("undefined"==typeof d||d>j)&&k>1.99&&(d=j,c=i)}return a.delimiter=c,{successful:!!c,bestDelimiter:c}}function h(a){a=a.substr(0,1048576);var b=a.split("\r");if(1==b.length)return"\n";for(var c=0,d=0;d=b.length/2?"\r\n":"\r"}function i(a){var b=p.test(a);return b?parseFloat(a):a}function j(a,b,c,d){u.errors.push({type:a,code:b,message:c,row:d})}var k,l,o,p=/^\s*-?(\d*\.?\d+|\d+\.?\d*)(e[-+]?\d+)?\s*$/i,q=this,r=0,s=!1,t=[],u={data:[],errors:[],meta:{}};if(n(a.step)){var v=a.step;a.step=function(d){if(u=d,c())b();else{if(b(),0==u.data.length)return;r+=d.data.length,a.preview&&r>a.preview?l.abort():v(u,q)}}}this.parse=function(c){if(a.newline||(a.newline=h(c)),o=!1,!a.delimiter){var d=f(c);d.successful?a.delimiter=d.bestDelimiter:(o=!0,a.delimiter=Papa.DefaultDelimiter),u.meta.delimiter=a.delimiter}var e=m(a);return a.preview&&a.header&&e.preview++,k=c,l=new g(e),u=l.parse(k),b(),!n(a.complete)||s||q.streamer&&!q.streamer.finished()||a.complete(u),s?{meta:{paused:!0}}:u||{meta:{paused:!1}}},this.pause=function(){s=!0,l.abort(),k=k.substr(l.getCharIndex())},this.resume=function(){s=!1,l=new g(a),l.parse(k),s||(q.streamer&&!q.streamer.finished()?q.streamer.resume():n(a.complete)&&a.complete(u))},this.abort=function(){l.abort(),n(a.complete)&&a.complete(u),k=""}}function g(a){a=a||{};var b=a.delimiter,c=a.newline,d=a.comments,e=a.step,f=a.preview,g=a.fastMode;if(("string"!=typeof b||1!=b.length||Papa.BAD_DELIMITERS.indexOf(b)>-1)&&(b=","),d===b)throw"Comment character same as delimiter";d===!0?d="#":("string"!=typeof d||Papa.BAD_DELIMITERS.indexOf(d)>-1)&&(d=!1),"\n"!=c&&"\r"!=c&&"\r\n"!=c&&(c="\n");var h=0,i=!1;this.parse=function(a){function j(){return u.push(a.substr(h)),s.push(u),h=n,r&&m(),l()}function k(b){s.push(u),u=[],h=b,y=a.indexOf(c,h)}function l(a){return{data:s,errors:t,meta:{delimiter:b,linebreak:c,aborted:i,truncated:!!a}}}function m(){e(l()),s=[],t=[]}if("string"!=typeof a)throw"Input must be a string";var n=a.length,o=b.length,p=c.length,q=d.length,r="function"==typeof e;h=0;var s=[],t=[],u=[];if(!a)return l();if(g){for(var v=a.split(c),w=0;w=f)return s=s.slice(0,f),l(!0)}return l()}for(var x=a.indexOf(b,h),y=a.indexOf(c,h);;)if('"'!=a[h])if(d&&0===u.length&&a.substr(h,q)===d){if(-1==y)return l();h=y+p,y=a.indexOf(c,h),x=a.indexOf(b,h)}else if(-1!==x&&(y>x||-1===y))u.push(a.substring(h,x)),h=x+o,x=a.indexOf(b,h);else{if(-1===y)break;if(u.push(a.substring(h,y)),k(y+p),r&&(m(),i))return l();if(f&&s.length>=f)return l(!0)}else{var z=h;for(h++;;){var z=a.indexOf('"',z+1);if(-1===z)return t.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:s.length,index:h}),j();if(z===n-1)return u.push(a.substring(h,z).replace(/""/g,'"')),s.push(u),r&&m(),l();if('"'!=a[z+1]){if(a[z+1]==b){u.push(a.substring(h,z).replace(/""/g,'"')),h=z+1+o,x=a.indexOf(b,h),y=a.indexOf(c,h);break}if(a.substr(z+1,p)===c){if(u.push(a.substring(h,z).replace(/""/g,'"')),k(z+1+p),x=a.indexOf(b,h),r&&(m(),i))return l();if(f&&s.length>=f)return l(!0);break}}else z++}}return j()},this.abort=function(){i=!0},this.getCharIndex=function(){return h}}function h(){var a="worker"+String(Math.random()).substr(2);return document.write(''),document.getElementById(a).previousSibling.src}function i(){if(!Papa.WORKERS_SUPPORTED)return!1;var b=new a.Worker(o);return b.onmessage=j,b.id=r++,q[b.id]=b,b}function j(a){var b=a.data,c=q[b.workerId];if(b.error)c.userError(b.error,b.file);else if(b.results&&b.results.data)if(n(c.userStep)){for(var d=0;d-1)&&(b.delimiter=s.delimiter),"\n"!=b.newline&&"\r"!=b.newline&&"\r\n"!=b.newline&&(b.newline=s.newline),"boolean"!=typeof b.header&&(b.header=s.header),"boolean"!=typeof b.dynamicTyping&&(b.dynamicTyping=s.dynamicTyping),"number"!=typeof b.preview&&(b.preview=s.preview),"function"!=typeof b.step&&(b.step=s.step),"function"!=typeof b.complete&&(b.complete=s.complete),"function"!=typeof b.error&&(b.error=s.error),"string"!=typeof b.encoding&&(b.encoding=s.encoding),"boolean"!=typeof b.worker&&(b.worker=s.worker),"boolean"!=typeof b.download&&(b.download=s.download),"boolean"!=typeof b.skipEmptyLines&&(b.skipEmptyLines=s.skipEmptyLines),"boolean"!=typeof b.fastMode&&(b.fastMode=s.fastMode),b}function m(a){if("object"!=typeof a)return a;var b=a instanceof Array?[]:{};for(var c in a)b[c]=m(a[c]);return b}function n(a){return"function"==typeof a}var o,p=!a.document,q={},r=0,s={delimiter:"",newline:"",header:!1,dynamicTyping:!1,preview:0,step:void 0,encoding:"",worker:!1,comments:!1,complete:void 0,error:void 0,download:!1,chunk:void 0,skipEmptyLines:!1,fastMode:!1};if(a.Papa={},a.Papa.parse=b,a.Papa.unparse=c,a.Papa.RECORD_SEP=String.fromCharCode(30),a.Papa.UNIT_SEP=String.fromCharCode(31),a.Papa.BYTE_ORDER_MARK="",a.Papa.BAD_DELIMITERS=["\r","\n",'"',a.Papa.BYTE_ORDER_MARK],a.Papa.WORKERS_SUPPORTED=!!a.Worker,a.Papa.LocalChunkSize=10485760,a.Papa.RemoteChunkSize=5242880,a.Papa.DefaultDelimiter=",",a.Papa.Parser=g,a.Papa.ParserHandle=f,a.Papa.NetworkStreamer=d,a.Papa.FileStreamer=e,a.jQuery){var t=a.jQuery;t.fn.parse=function(b){function c(){if(0==g.length)return void(n(b.complete)&&b.complete());var a=g[0];if(n(b.before)){var c=b.before(a.file,a.inputElem);if("object"==typeof c){if("abort"==c.action)return void d("AbortError",a.file,a.inputElem,c.reason);if("skip"==c.action)return void e();"object"==typeof c.config&&(a.instanceConfig=t.extend(a.instanceConfig,c.config))}else if("skip"==c)return void e()}var f=a.instanceConfig.complete;a.instanceConfig.complete=function(b){n(f)&&f(b,a.file,a.inputElem),e()},Papa.parse(a.file,a.instanceConfig)}function d(a,c,d,e){n(b.error)&&b.error({name:a},c,d,e)}function e(){g.splice(0,1),c()}var f=b.config||{},g=[];return this.each(function(){var b="INPUT"==t(this).prop("tagName").toUpperCase()&&"file"==t(this).attr("type").toLowerCase()&&a.FileReader;if(!b||!this.files||0==this.files.length)return!0;for(var c=0;c0;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 r(e){var t=E(e);t.chunkSize=parseInt(t.chunkSize);this._handle=new p(t);this._handle.streamer=this;this._config=t}this._handle=null;this._paused=false;this._finished=false;this._input=null;this._baseIndex=0;this._partialLine="";this._rowCount=0;this._start=0;this._nextChunk=null;r.call(this,n);this.parseChunk=function(n){var r=this._partialLine+n;this._partialLine="";var i=this._handle.parse(r,this._baseIndex,!this._finished);if(this._handle.paused())return;var s=i.meta.cursor;if(!this._finished){this._partialLine=r.substring(s-this._baseIndex);this._baseIndex=s}if(i&&i.data)this._rowCount+=i.data.length;var o=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(t){e.postMessage({results:i,workerId:Papa.WORKER_ID,finished:o})}else if(x(this._config.chunk)){this._config.chunk(i,this._handle);if(this._paused)return;i=undefined}if(o&&x(this._config.complete)&&(!i||!i.meta.aborted))this._config.complete(i);if(!o&&(!i||!i.meta.paused))this._nextChunk();return i};this._sendError=function(n){if(x(this._config.error))this._config.error(n);else if(t&&this._config.error){e.postMessage({workerId:Papa.WORKER_ID,error:n,finished:false})}}}function l(e){function r(e){var t=e.getResponseHeader("Content-Range");return parseInt(t.substr(t.lastIndexOf("/")+1))}e=e||{};if(!e.chunkSize)e.chunkSize=Papa.RemoteChunkSize;f.call(this,e);var n;if(t){this._nextChunk=function(){this._readChunk();this._chunkLoaded()}}else{this._nextChunk=function(){this._readChunk()}}this.stream=function(e){this._input=e;this._nextChunk()};this._readChunk=function(){if(this._finished){this._chunkLoaded();return}n=new XMLHttpRequest;if(!t){n.onload=S(this._chunkLoaded,this);n.onerror=S(this._chunkError,this)}n.open("GET",this._input,!t);if(this._config.step||this._config.chunk){var e=this._start+this._config.chunkSize-1;n.setRequestHeader("Range","bytes="+this._start+"-"+e);n.setRequestHeader("If-None-Match","webkit-no-cache")}try{n.send()}catch(r){this._chunkError(r.message)}if(t&&n.status==0)this._chunkError();else this._start+=this._config.chunkSize};this._chunkLoaded=function(){if(n.readyState!=4)return;if(n.status<200||n.status>=400){this._chunkError();return}this._finished=!this._config.step&&!this._config.chunk||this._start>r(n);this.parseChunk(n.responseText)};this._chunkError=function(e){var t=n.statusText||e;this._sendError(t)}}function c(e){e=e||{};if(!e.chunkSize)e.chunkSize=Papa.LocalChunkSize;f.call(this,e);var t,n;var r=typeof FileReader!=="undefined";this.stream=function(e){this._input=e;n=e.slice||e.webkitSlice||e.mozSlice;if(r){t=new FileReader;t.onload=S(this._chunkLoaded,this);t.onerror=S(this._chunkError,this)}else t=new FileReaderSync;this._nextChunk()};this._nextChunk=function(){if(!this._finished&&(!this._config.preview||this._rowCount=this._input.size;this.parseChunk(e.target.result)};this._chunkError=function(){this._sendError(t.error)}}function h(e){e=e||{};f.call(this,e);var t;var n;this.stream=function(e){t=e;n=e;return this._nextChunk()};this._nextChunk=function(){if(this._finished)return;var e=this._config.chunkSize;var t=e?n.substr(0,e):n;n=e?n.substr(e):"";this._finished=!n;return this.parseChunk(t)}}function p(e){function c(){if(f&&u){b("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+Papa.DefaultDelimiter+"'");u=false}if(e.skipEmptyLines){for(var t=0;t=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)b("FieldMismatch","TooManyFields","Too many fields: expected "+a.length+" fields but parsed "+r,t);else if(r1){a+=Math.abs(h-s);s=h}}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){e=e.substr(0,1024*1024);var t=e.split("\r");if(t.length==1)return"\n";var n=0;for(var r=0;r=t.length/2?"\r\n":"\r"}function y(e){var n=t.test(e);return n?parseFloat(e):e}function b(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(x(e.step)){var l=e.step;e.step=function(t){f=t;if(h())c();else{c();if(f.data.length==0)return;r+=t.data.length;if(e.preview&&r>e.preview)s.abort();else l(f,n)}}}this.parse=function(t,n,r){if(!e.newline)e.newline=g(t);u=false;if(!e.delimiter){var a=m(t);if(a.successful)e.delimiter=a.bestDelimiter;else{u=true;e.delimiter=Papa.DefaultDelimiter}f.meta.delimiter=e.delimiter}var l=E(e);if(e.preview&&e.header)l.preview++;i=t;s=new d(l);f=s.parse(i,n,r);c();return o?{meta:{paused:true}}:f||{meta:{paused:false}}};this.paused=function(){return o};this.pause=function(){o=true;s.abort();i=i.substr(s.getCharIndex())};this.resume=function(){o=false;n.streamer.parseChunk(i)};this.abort=function(){s.abort();if(x(e.complete))e.complete(f);i=""}}function d(e){e=e||{};var t=e.delimiter;var n=e.newline;var r=e.comments;var i=e.step;var s=e.preview;var o=e.fastMode;if(typeof t!=="string"||t.length!=1||Papa.BAD_DELIMITERS.indexOf(t)>-1)t=",";if(r===t)throw"Comment character same as delimiter";else if(r===true)r="#";else if(typeof r!=="string"||Papa.BAD_DELIMITERS.indexOf(r)>-1)r=false;if(n!="\n"&&n!="\r"&&n!="\r\n")n="\n";var u=0;var a=false;this.parse=function(e,f,l){function C(e){m.push(e);b=u}function k(t){if(l)return A();if(!t)t=e.substr(u);y.push(t);u=c;C(y);if(v)O();return A()}function L(t){u=t;C(y);y=[];x=e.indexOf(n,u)}function A(e){return{data:m,errors:g,meta:{delimiter:t,linebreak:n,aborted:a,truncated:!!e,cursor:b+(f||0)}}}function O(){i(A());m=[],g=[]}if(typeof e!=="string")throw"Input must be a string";var c=e.length,h=t.length,p=n.length,d=r.length;var v=typeof i==="function";u=0;var m=[],g=[],y=[],b=0;if(!e)return A();if(o||o!==false&&e.indexOf('"')===-1){var w=e.split(n);for(var E=0;E=s){m=m.slice(0,s);return A(true)}}return A()}var S=e.indexOf(t,u);var x=e.indexOf(n,u);for(;;){if(e[u]=='"'){var T=u;u++;for(;;){var T=e.indexOf('"',T+1);if(T===-1){if(!l){g.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:m.length,index:u})}return k()}if(T===c-1){var N=e.substring(u,T).replace(/""/g,'"');return k(N)}if(e[T+1]=='"'){T++;continue}if(e[T+1]==t){y.push(e.substring(u,T).replace(/""/g,'"'));u=T+1+h;S=e.indexOf(t,u);x=e.indexOf(n,u);break}if(e.substr(T+1,p)===n){y.push(e.substring(u,T).replace(/""/g,'"'));L(T+1+p);S=e.indexOf(t,u);if(v){O();if(a)return A()}if(s&&m.length>=s)return A(true);break}}continue}if(r&&y.length===0&&e.substr(u,d)===r){if(x==-1)return A();u=x+p;x=e.indexOf(n,u);S=e.indexOf(t,u);continue}if(S!==-1&&(S=s)return A(true);continue}break}return k()};this.abort=function(){a=true};this.getCharIndex=function(){return u}}function v(){var e=document.getElementsByTagName("script");return e.length?e[e.length-1].src:""}function m(){if(!Papa.WORKERS_SUPPORTED)return false;if(!n&&Papa.SCRIPT_PATH===null)throw new Error("Script path cannot be determined automatically when Papa Parse is loaded asynchronously. "+"You need to set Papa.SCRIPT_PATH manually.");var t=new e.Worker(Papa.SCRIPT_PATH||r);t.onmessage=g;t.id=s++;i[t.id]=t;return t}function g(e){var t=e.data;var n=i[t.workerId];var r=false;if(t.error)n.userError(t.error,t.file);else if(t.results&&t.results.data){var s=function(){r=true;y(t.workerId,{data:[],errors:[],meta:{aborted:true}})};var o={abort:s,pause:b,resume:b};if(x(n.userStep)){for(var u=0;u