RegExp.escape=function(r){returnr.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")},function(){"use strict";varp;(p="undefined"!=typeofjQuery&&jQuery?jQuery:{}).csv={defaults:{separator:",",delimiter:'"',headers:!0},hooks:{castToScalar:function(r,e){if(isNaN(r))returnr;if(/\./.test(r))returnparseFloat(r);vara=parseInt(r);returnisNaN(a)?null:a}},parsers:{parse:function(r,e){vara=e.separator,t=e.delimiter;e.state.rowNum||(e.state.rowNum=1),e.state.colNum||(e.state.colNum=1);varo=[],s=[],n=0,i="",l=!1;functionu(){if(n=0,i="",e.start&&e.state.rowNum<e.start)returns=[],e.state.rowNum++,void(e.state.colNum=1);if(void0===e.onParseEntry)o.push(s);else{varr=e.onParseEntry(s,e.state);!1!==r&&o.push(r)}s=[],e.end&&e.state.rowNum>=e.end&&(l=!0),e.state.rowNum++,e.state.colNum=1}functionc(){if(void0===e.onParseValue)s.push(i);elseif(e.headers&&1===e.state.rowNum)s.push(i);else{varr=e.onParseValue(i,e.state);!1!==r&&s.push(r)}i="",n=0,e.state.colNum++}varf=RegExp.escape(a),d=RegExp.escape(t),m=/(D|S|\r\n|\n|\r|[^DS\r\n]+)/,p=m.source;returnp=(p=p.replace(/S/g,f)).replace(/D/g,d),m=newRegExp(p,"gm"),r.replace(m,function(r){if(!l)switch(n){case0:if(r===a){i+="",c();break}if(r===t){n=1;break}if(/^(\r\n|\n|\r)$/.test(r)){c(),u();break}i+=r,n=3;break;case1:if(r===t){n=2;break}i+=r,n=1;break;case2:if(r===t){i+=r,n=1;break}if(r===a){c();break}if(/^(\r\n|\n|\r)$/.test(r)){c(),u();break}throwError("CSVDataError: Illegal State [Row:"+e.state.rowNum+"][Col:"+e.state.colNum+"]");case3:if(r===a){c();break}if(/^(\r\n|\n|\r)$/.test(r)){c(),u();break}if(r===t)throwError("CSVDataError: Illegal Quote [Row:"+e.state.rowNum+"][Col:"+e.state.colNum+"]");throwError("CSVDataError: Illegal Data [Row:"+e.state.rowNum+"][Col:"+e.state.colNum+"]");default:throwError("CSVDataError: Unknown State [Row:"+e.state.rowNum+"][Col:"+e.state.colNum+"]")}}),0!==s.length&&(c(),u()),o},splitLines:function(r,a){if(r){vart=(a=a||{}).separator||p.csv.defaults.separator,o=a.delimiter||p.csv.defaults.delimiter;a.state=a.state||{},a.state.rowNum||(a.state.rowNum=1);vare=[],s=0,n="",i=!1,l=RegExp.escape(t),u=RegExp.escape(o),c=/(D|S|\n|\r|[^DS\r\n]+)/,f=c.source;returnf=(f=f.replace(/S/g,l)).replace(/D/g,u),c=newRegExp(f,"gm"),r.replace(c,function(r){if(!i)switch(s){case0:if(r===t){n+=r,s=0;break}if(r===o){n+=r,s=1;break}if("\n"===r){d();break}if(/^\r$/.test(r))break;n+=r,s=3;break;case1:if(r===o){n+=r,s=2;break}n+=r,s=1;break;case2:vare=n.substr(n.length-1);if(r===o&&e===o){n+=r,s=1;break}if(r===t){n+=r,s=0;break}if("\n"===r){d();break}if("\r"===r)break;throwError("CSVDataError: Illegal state [Row:"+a.state.rowNum+"]");case3:if(r===t){n+=r,s=0;break}if("\n"===r){d();break}if("\r"===r)break;if(r===o)throwError("CSVDataError: Illegal quote [Row:"+a.state.rowNum+"]");throwError("CSVDataError: Illegal state [Row:"+a.state.rowNum+"]");default:throwError("CSVDataError: Unknown state [Row:"+a.state.rowNum+"]")}}),""!==n&&d(),e}functiond(){if(s=0,a.start&&a.state.rowNum<a.start)returnn="",voida.state.rowNum++;if(void0===a.onParseEntry)e.push(n);else{varr=a.onParseEntry(n,a.state);!1!==r&&e.push(r)}n="",a.end&&a.state.rowNum>=a.end&&(i=!0),a.state.rowNum++}},parseEntry:function(r,e){vara=e.separator,t=e.delimiter;e.state.rowNum||(e.state.rowNum=1),e.state.colNum||(e.state.colNum=1);varo=[],s=0,n="";functioni(){if(void0===e.onParseValue)o.push(n);else{varr=e.onParseValue(n,e.state);!1!==r&&o.push(r)}n="",s=0,e.state.colNum++}if(!e.match){varl=RegExp.escape(a),u=RegExp.escape(t),c=/(D|S|\n|\r|[^DS\r\n]+)/.source;c=(c=c.replace(/S/g,l)).replace(/D/g,u),e.match=newRegExp(c,"gm")}returnr.replace(e.match,function(r){switch(s){case0:if(r===a){n+="",i();break}if(r===t){s=1;break}if("\n"===r||"\r"===r)break;n+=r,s=3;break;case1:if(r===t){s=2;break}n+=r,s=1;break;case2:if(r===t){n+=r,s=1;break}if(r===a){i();break}if("\n"===r||"\r"===r)break;throwError("CSVDataError: Illegal State [Row:"+e.state.rowNum+"][Col:"+e.state.colNum+"]");case3:if(r===a){i();break}if("\n"===r||"\r"===r)break;if(r===t)throwError("CSVDataError: Illegal Quote [Row:"+e.state.