/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports"],(function(e){"use strict";const n=/^\s*"([\S\s]*)"\s*$/,t=/""/g,o="\n",r=[","," ",";","|","\t"];function*i(e,n,t){let o=0;for(;o<=e.length;){const r=e.indexOf(n,o),i=e.substring(o,r>-1?r:void 0);o+=i.length+n.length,t&&!i.trim()||(yield i)}}function s(e){const n=e.includes("\r\n")?"\r\n":o;return i(e,n,!0)}function c(e,n){return i(e,n,!1)}function l(e){const n=e.trim();let t=0,o="";for(const i of r){const e=n.split(i).length;e>t&&(t=e,o=i)}return""===o?null:o}function*f(e,r,i,s=(()=>Object.create(null))){let l="",f="",d=0,a=s(),g=0;e:for(const p of e){const e=c(p,i);for(const o of e)if(l+=f+o,f="",d+=u(o),d%2==0){if(d>0){const e=n.exec(l);if(!e){a=s(),g=0,l="",d=0;continue e}a[r[g]]=e[1].replace(t,'"'),g++}else a[r[g]]=l,g++;l="",d=0}else f=i;0===d?(yield a,a=s(),g=0):f=o}}function u(e){let n=0,t=0;for(t=e.indexOf('"',t);t>=0;)n++,t=e.indexOf('"',t+1);return n}e.inferDelimiter=l,e.parseRows=f,e.readRowParts=c,e.readRows=s,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
