function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
  try {
    var info = gen[key](arg);
    var value = info.value;
  } catch (error) {
    reject(error);
    return;
  }
  if (info.done) {
    resolve(value);
  } else {
    Promise.resolve(value).then(_next, _throw);
  }
}
function _asyncToGenerator(fn) {
  return function () {
    var self = this,
      args = arguments;
    return new Promise(function (resolve, reject) {
      var gen = fn.apply(self, args);
      function _next(value) {
        asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
      }
      function _throw(err) {
        asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
      }
      _next(undefined);
    });
  };
}

/**
 * Copyright (c) 2014-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

var Op = Object.prototype;
var hasOwn = Op.hasOwnProperty;
var undefined$1; // More compressible than void 0.
var $Symbol = typeof Symbol === "function" ? Symbol : {};
var iteratorSymbol = $Symbol.iterator || "@@iterator";
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
function wrap(innerFn, outerFn, self, tryLocsList) {
  // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
  var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
  var generator = Object.create(protoGenerator.prototype);
  var context = new Context(tryLocsList || []);

  // The ._invoke method unifies the implementations of the .next,
  // .throw, and .return methods.
  generator._invoke = makeInvokeMethod(innerFn, self, context);
  return generator;
}

// Try/catch helper to minimize deoptimizations. Returns a completion
// record like context.tryEntries[i].completion. This interface could
// have been (and was previously) designed to take a closure to be
// invoked without arguments, but in all the cases we care about we
// already have an existing method we want to call, so there's no need
// to create a new function object. We can even get away with assuming
// the method takes exactly one argument, since that happens to be true
// in every case, so we don't have to touch the arguments object. The
// only additional allocation required is the completion record, which
// has a stable shape and so hopefully should be cheap to allocate.
function tryCatch(fn, obj, arg) {
  try {
    return {
      type: "normal",
      arg: fn.call(obj, arg)
    };
  } catch (err) {
    return {
      type: "throw",
      arg: err
    };
  }
}
var GenStateSuspendedStart = "suspendedStart";
var GenStateSuspendedYield = "suspendedYield";
var GenStateExecuting = "executing";
var GenStateCompleted = "completed";

// Returning this object from the innerFn has the same effect as
// breaking out of the dispatch switch statement.
var ContinueSentinel = {};

// Dummy constructor functions that we use as the .constructor and
// .constructor.prototype properties for functions that return Generator
// objects. For full spec compliance, you may wish to configure your
// minifier not to mangle the names of these two functions.
function Generator() {}
function GeneratorFunction() {}
function GeneratorFunctionPrototype() {}

// This is a polyfill for %IteratorPrototype% for environments that
// don't natively support it.
var IteratorPrototype = {};
IteratorPrototype[iteratorSymbol] = function () {
  return this;
};
var getProto = Object.getPrototypeOf;
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
  // This environment has a native %IteratorPrototype%; use it instead
  // of the polyfill.
  IteratorPrototype = NativeIteratorPrototype;
}
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
GeneratorFunctionPrototype.constructor = GeneratorFunction;
GeneratorFunctionPrototype[toStringTagSymbol] = GeneratorFunction.displayName = "GeneratorFunction";

// Helper for defining the .next, .throw, and .return methods of the
// Iterator interface in terms of a single ._invoke method.
function defineIteratorMethods(prototype) {
  ["next", "throw", "return"].forEach(function (method) {
    prototype[method] = function (arg) {
      return this._invoke(method, arg);
    };
  });
}
function isGeneratorFunction(genFun) {
  var ctor = typeof genFun === "function" && genFun.constructor;
  return ctor ? ctor === GeneratorFunction ||
  // For the native GeneratorFunction constructor, the best we can
  // do is to check its .name property.
  (ctor.displayName || ctor.name) === "GeneratorFunction" : false;
}
function mark(genFun) {
  if (Object.setPrototypeOf) {
    Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
  } else {
    genFun.__proto__ = GeneratorFunctionPrototype;
    if (!(toStringTagSymbol in genFun)) {
      genFun[toStringTagSymbol] = "GeneratorFunction";
    }
  }
  genFun.prototype = Object.create(Gp);
  return genFun;
}

// Within the body of any async function, `await x` is transformed to
// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
// `hasOwn.call(value, "__await")` to determine if the yielded value is
// meant to be awaited.
function awrap(arg) {
  return {
    __await: arg
  };
}
function AsyncIterator(generator, PromiseImpl) {
  function invoke(method, arg, resolve, reject) {
    var record = tryCatch(generator[method], generator, arg);
    if (record.type === "throw") {
      reject(record.arg);
    } else {
      var result = record.arg;
      var value = result.value;
      if (value && typeof value === "object" && hasOwn.call(value, "__await")) {
        return PromiseImpl.resolve(value.__await).then(function (value) {
          invoke("next", value, resolve, reject);
        }, function (err) {
          invoke("throw", err, resolve, reject);
        });
      }
      return PromiseImpl.resolve(value).then(function (unwrapped) {
        // When a yielded Promise is resolved, its final value becomes
        // the .value of the Promise<{value,done}> result for the
        // current iteration.
        result.value = unwrapped;
        resolve(result);
      }, function (error) {
        // If a rejected Promise was yielded, throw the rejection back
        // into the async generator function so it can be handled there.
        return invoke("throw", error, resolve, reject);
      });
    }
  }
  var previousPromise;
  function enqueue(method, arg) {
    function callInvokeWithMethodAndArg() {
      return new PromiseImpl(function (resolve, reject) {
        invoke(method, arg, resolve, reject);
      });
    }
    return previousPromise =
    // If enqueue has been called before, then we want to wait until
    // all previous Promises have been resolved before calling invoke,
    // so that results are always delivered in the correct order. If
    // enqueue has not been called before, then it is important to
    // call invoke immediately, without waiting on a callback to fire,
    // so that the async generator function has the opportunity to do
    // any necessary setup in a predictable way. This predictability
    // is why the Promise constructor synchronously invokes its
    // executor callback, and why async functions synchronously
    // execute code before the first await. Since we implement simple
    // async functions in terms of async generators, it is especially
    // important to get this right, even though it requires care.
    previousPromise ? previousPromise.then(callInvokeWithMethodAndArg,
    // Avoid propagating failures to Promises returned by later
    // invocations of the iterator.
    callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
  }

  // Define the unified helper method that is used to implement .next,
  // .throw, and .return (see defineIteratorMethods).
  this._invoke = enqueue;
}
defineIteratorMethods(AsyncIterator.prototype);
AsyncIterator.prototype[asyncIteratorSymbol] = function () {
  return this;
};

// Note that simple async functions are implemented on top of
// AsyncIterator objects; they just return a Promise for the value of
// the final result produced by the iterator.
function async(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
  if (PromiseImpl === void 0) PromiseImpl = Promise;
  var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
  return isGeneratorFunction(outerFn) ? iter // If outerFn is a generator, return the full iterator.
  : iter.next().then(function (result) {
    return result.done ? result.value : iter.next();
  });
}
function makeInvokeMethod(innerFn, self, context) {
  var state = GenStateSuspendedStart;
  return function invoke(method, arg) {
    if (state === GenStateExecuting) {
      throw new Error("Generator is already running");
    }
    if (state === GenStateCompleted) {
      if (method === "throw") {
        throw arg;
      }

      // Be forgiving, per 25.3.3.3.3 of the spec:
      // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
      return doneResult();
    }
    context.method = method;
    context.arg = arg;
    while (true) {
      var delegate = context.delegate;
      if (delegate) {
        var delegateResult = maybeInvokeDelegate(delegate, context);
        if (delegateResult) {
          if (delegateResult === ContinueSentinel) continue;
          return delegateResult;
        }
      }
      if (context.method === "next") {
        // Setting context._sent for legacy support of Babel's
        // function.sent implementation.
        context.sent = context._sent = context.arg;
      } else if (context.method === "throw") {
        if (state === GenStateSuspendedStart) {
          state = GenStateCompleted;
          throw context.arg;
        }
        context.dispatchException(context.arg);
      } else if (context.method === "return") {
        context.abrupt("return", context.arg);
      }
      state = GenStateExecuting;
      var record = tryCatch(innerFn, self, context);
      if (record.type === "normal") {
        // If an exception is thrown from innerFn, we leave state ===
        // GenStateExecuting and loop back for another invocation.
        state = context.done ? GenStateCompleted : GenStateSuspendedYield;
        if (record.arg === ContinueSentinel) {
          continue;
        }
        return {
          value: record.arg,
          done: context.done
        };
      } else if (record.type === "throw") {
        state = GenStateCompleted;
        // Dispatch the exception by looping back around to the
        // context.dispatchException(context.arg) call above.
        context.method = "throw";
        context.arg = record.arg;
      }
    }
  };
}

// Call delegate.iterator[context.method](context.arg) and handle the
// result, either by returning a { value, done } result from the
// delegate iterator, or by modifying context.method and context.arg,
// setting context.delegate to null, and returning the ContinueSentinel.
function maybeInvokeDelegate(delegate, context) {
  var method = delegate.iterator[context.method];
  if (method === undefined$1) {
    // A .throw or .return when the delegate iterator has no .throw
    // method always terminates the yield* loop.
    context.delegate = null;
    if (context.method === "throw") {
      // Note: ["return"] must be used for ES3 parsing compatibility.
      if (delegate.iterator["return"]) {
        // If the delegate iterator has a return method, give it a
        // chance to clean up.
        context.method = "return";
        context.arg = undefined$1;
        maybeInvokeDelegate(delegate, context);
        if (context.method === "throw") {
          // If maybeInvokeDelegate(context) changed context.method from
          // "return" to "throw", let that override the TypeError below.
          return ContinueSentinel;
        }
      }
      context.method = "throw";
      context.arg = new TypeError("The iterator does not provide a 'throw' method");
    }
    return ContinueSentinel;
  }
  var record = tryCatch(method, delegate.iterator, context.arg);
  if (record.type === "throw") {
    context.method = "throw";
    context.arg = record.arg;
    context.delegate = null;
    return ContinueSentinel;
  }
  var info = record.arg;
  if (!info) {
    context.method = "throw";
    context.arg = new TypeError("iterator result is not an object");
    context.delegate = null;
    return ContinueSentinel;
  }
  if (info.done) {
    // Assign the result of the finished delegate to the temporary
    // variable specified by delegate.resultName (see delegateYield).
    context[delegate.resultName] = info.value;

    // Resume execution at the desired location (see delegateYield).
    context.next = delegate.nextLoc;

    // If context.method was "throw" but the delegate handled the
    // exception, let the outer generator proceed normally. If
    // context.method was "next", forget context.arg since it has been
    // "consumed" by the delegate iterator. If context.method was
    // "return", allow the original .return call to continue in the
    // outer generator.
    if (context.method !== "return") {
      context.method = "next";
      context.arg = undefined$1;
    }
  } else {
    // Re-yield the result returned by the delegate method.
    return info;
  }

  // The delegate iterator is finished, so forget it and continue with
  // the outer generator.
  context.delegate = null;
  return ContinueSentinel;
}

// Define Generator.prototype.{next,throw,return} in terms of the
// unified ._invoke helper method.
defineIteratorMethods(Gp);
Gp[toStringTagSymbol] = "Generator";

// A Generator should always return itself as the iterator object when the
// @@iterator function is called on it. Some browsers' implementations of the
// iterator prototype chain incorrectly implement this, causing the Generator
// object to not be returned from this call. This ensures that doesn't happen.
// See https://github.com/facebook/regenerator/issues/274 for more details.
Gp[iteratorSymbol] = function () {
  return this;
};
Gp.toString = function () {
  return "[object Generator]";
};
function pushTryEntry(locs) {
  var entry = {
    tryLoc: locs[0]
  };
  if (1 in locs) {
    entry.catchLoc = locs[1];
  }
  if (2 in locs) {
    entry.finallyLoc = locs[2];
    entry.afterLoc = locs[3];
  }
  this.tryEntries.push(entry);
}
function resetTryEntry(entry) {
  var record = entry.completion || {};
  record.type = "normal";
  delete record.arg;
  entry.completion = record;
}
function Context(tryLocsList) {
  // The root entry object (effectively a try statement without a catch
  // or a finally block) gives us a place to store values thrown from
  // locations where there is no enclosing try statement.
  this.tryEntries = [{
    tryLoc: "root"
  }];
  tryLocsList.forEach(pushTryEntry, this);
  this.reset(true);
}
function keys(object) {
  var keys = [];
  for (var key in object) {
    keys.push(key);
  }
  keys.reverse();

  // Rather than returning an object with a next method, we keep
  // things simple and return the next function itself.
  return function next() {
    while (keys.length) {
      var key = keys.pop();
      if (key in object) {
        next.value = key;
        next.done = false;
        return next;
      }
    }

    // To avoid creating an additional object, we just hang the .value
    // and .done properties off the next function object itself. This
    // also ensures that the minifier will not anonymize the function.
    next.done = true;
    return next;
  };
}
function values(iterable) {
  if (iterable) {
    var iteratorMethod = iterable[iteratorSymbol];
    if (iteratorMethod) {
      return iteratorMethod.call(iterable);
    }
    if (typeof iterable.next === "function") {
      return iterable;
    }
    if (!isNaN(iterable.length)) {
      var i = -1,
        next = function next() {
          while (++i < iterable.length) {
            if (hasOwn.call(iterable, i)) {
              next.value = iterable[i];
              next.done = false;
              return next;
            }
          }
          next.value = undefined$1;
          next.done = true;
          return next;
        };
      return next.next = next;
    }
  }

  // Return an iterator with no values.
  return {
    next: doneResult
  };
}
function doneResult() {
  return {
    value: undefined$1,
    done: true
  };
}
Context.prototype = {
  constructor: Context,
  reset: function reset(skipTempReset) {
    this.prev = 0;
    this.next = 0;
    // Resetting context._sent for legacy support of Babel's
    // function.sent implementation.
    this.sent = this._sent = undefined$1;
    this.done = false;
    this.delegate = null;
    this.method = "next";
    this.arg = undefined$1;
    this.tryEntries.forEach(resetTryEntry);
    if (!skipTempReset) {
      for (var name in this) {
        // Not sure about the optimal order of these conditions:
        if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) {
          this[name] = undefined$1;
        }
      }
    }
  },
  stop: function stop() {
    this.done = true;
    var rootEntry = this.tryEntries[0];
    var rootRecord = rootEntry.completion;
    if (rootRecord.type === "throw") {
      throw rootRecord.arg;
    }
    return this.rval;
  },
  dispatchException: function dispatchException(exception) {
    if (this.done) {
      throw exception;
    }
    var context = this;
    function handle(loc, caught) {
      record.type = "throw";
      record.arg = exception;
      context.next = loc;
      if (caught) {
        // If the dispatched exception was caught by a catch block,
        // then let that catch block handle the exception normally.
        context.method = "next";
        context.arg = undefined$1;
      }
      return !!caught;
    }
    for (var i = this.tryEntries.length - 1; i >= 0; --i) {
      var entry = this.tryEntries[i];
      var record = entry.completion;
      if (entry.tryLoc === "root") {
        // Exception thrown outside of any try block that could handle
        // it, so set the completion value of the entire function to
        // throw the exception.
        return handle("end");
      }
      if (entry.tryLoc <= this.prev) {
        var hasCatch = hasOwn.call(entry, "catchLoc");
        var hasFinally = hasOwn.call(entry, "finallyLoc");
        if (hasCatch && hasFinally) {
          if (this.prev < entry.catchLoc) {
            return handle(entry.catchLoc, true);
          } else if (this.prev < entry.finallyLoc) {
            return handle(entry.finallyLoc);
          }
        } else if (hasCatch) {
          if (this.prev < entry.catchLoc) {
            return handle(entry.catchLoc, true);
          }
        } else if (hasFinally) {
          if (this.prev < entry.finallyLoc) {
            return handle(entry.finallyLoc);
          }
        } else {
          throw new Error("try statement without catch or finally");
        }
      }
    }
  },
  abrupt: function abrupt(type, arg) {
    for (var i = this.tryEntries.length - 1; i >= 0; --i) {
      var entry = this.tryEntries[i];
      if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
        var finallyEntry = entry;
        break;
      }
    }
    if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) {
      // Ignore the finally entry if control is not jumping to a
      // location outside the try/catch block.
      finallyEntry = null;
    }
    var record = finallyEntry ? finallyEntry.completion : {};
    record.type = type;
    record.arg = arg;
    if (finallyEntry) {
      this.method = "next";
      this.next = finallyEntry.finallyLoc;
      return ContinueSentinel;
    }
    return this.complete(record);
  },
  complete: function complete(record, afterLoc) {
    if (record.type === "throw") {
      throw record.arg;
    }
    if (record.type === "break" || record.type === "continue") {
      this.next = record.arg;
    } else if (record.type === "return") {
      this.rval = this.arg = record.arg;
      this.method = "return";
      this.next = "end";
    } else if (record.type === "normal" && afterLoc) {
      this.next = afterLoc;
    }
    return ContinueSentinel;
  },
  finish: function finish(finallyLoc) {
    for (var i = this.tryEntries.length - 1; i >= 0; --i) {
      var entry = this.tryEntries[i];
      if (entry.finallyLoc === finallyLoc) {
        this.complete(entry.completion, entry.afterLoc);
        resetTryEntry(entry);
        return ContinueSentinel;
      }
    }
  },
  "catch": function _catch(tryLoc) {
    for (var i = this.tryEntries.length - 1; i >= 0; --i) {
      var entry = this.tryEntries[i];
      if (entry.tryLoc === tryLoc) {
        var record = entry.completion;
        if (record.type === "throw") {
          var thrown = record.arg;
          resetTryEntry(entry);
        }
        return thrown;
      }
    }

    // The context.catch method must only be called with a location
    // argument that corresponds to a known catch block.
    throw new Error("illegal catch attempt");
  },
  delegateYield: function delegateYield(iterable, resultName, nextLoc) {
    this.delegate = {
      iterator: values(iterable),
      resultName: resultName,
      nextLoc: nextLoc
    };
    if (this.method === "next") {
      // Deliberately forget the last sent value so that we don't
      // accidentally pass it on to the delegate.
      this.arg = undefined$1;
    }
    return ContinueSentinel;
  }
};

// Export a default namespace that plays well with Rollup
var _regeneratorRuntime = {
  wrap,
  isGeneratorFunction,
  AsyncIterator,
  mark,
  awrap,
  async,
  keys,
  values
};

var EOL = {},
  EOF = {},
  QUOTE = 34,
  NEWLINE = 10,
  RETURN = 13;
function objectConverter(columns) {
  return new Function("d", "return {" + columns.map(function (name, i) {
    return JSON.stringify(name) + ": d[" + i + "] || \"\"";
  }).join(",") + "}");
}
function customConverter(columns, f) {
  var object = objectConverter(columns);
  return function (row, i) {
    return f(object(row), i, columns);
  };
}

// Compute unique columns in order of discovery.
function inferColumns(rows) {
  var columnSet = Object.create(null),
    columns = [];
  rows.forEach(function (row) {
    for (var column in row) {
      if (!(column in columnSet)) {
        columns.push(columnSet[column] = column);
      }
    }
  });
  return columns;
}
function pad(value, width) {
  var s = value + "",
    length = s.length;
  return length < width ? new Array(width - length + 1).join(0) + s : s;
}
function formatYear(year) {
  return year < 0 ? "-" + pad(-year, 6) : year > 9999 ? "+" + pad(year, 6) : pad(year, 4);
}
function formatDate(date) {
  var hours = date.getUTCHours(),
    minutes = date.getUTCMinutes(),
    seconds = date.getUTCSeconds(),
    milliseconds = date.getUTCMilliseconds();
  return isNaN(date) ? "Invalid Date" : formatYear(date.getUTCFullYear()) + "-" + pad(date.getUTCMonth() + 1, 2) + "-" + pad(date.getUTCDate(), 2) + (milliseconds ? "T" + pad(hours, 2) + ":" + pad(minutes, 2) + ":" + pad(seconds, 2) + "." + pad(milliseconds, 3) + "Z" : seconds ? "T" + pad(hours, 2) + ":" + pad(minutes, 2) + ":" + pad(seconds, 2) + "Z" : minutes || hours ? "T" + pad(hours, 2) + ":" + pad(minutes, 2) + "Z" : "");
}
function dsv (delimiter) {
  var reFormat = new RegExp("[\"" + delimiter + "\n\r]"),
    DELIMITER = delimiter.charCodeAt(0);
  function parse(text, f) {
    var convert,
      columns,
      rows = parseRows(text, function (row, i) {
        if (convert) return convert(row, i - 1);
        columns = row, convert = f ? customConverter(row, f) : objectConverter(row);
      });
    rows.columns = columns || [];
    return rows;
  }
  function parseRows(text, f) {
    var rows = [],
      // output rows
      N = text.length,
      I = 0,
      // current character index
      n = 0,
      // current line number
      t,
      // current token
      eof = N <= 0,
      // current token followed by EOF?
      eol = false; // current token followed by EOL?

    // Strip the trailing newline.
    if (text.charCodeAt(N - 1) === NEWLINE) --N;
    if (text.charCodeAt(N - 1) === RETURN) --N;
    function token() {
      if (eof) return EOF;
      if (eol) return eol = false, EOL;

      // Unescape quotes.
      var i,
        j = I,
        c;
      if (text.charCodeAt(j) === QUOTE) {
        while (I++ < N && text.charCodeAt(I) !== QUOTE || text.charCodeAt(++I) === QUOTE);
        if ((i = I) >= N) eof = true;else if ((c = text.charCodeAt(I++)) === NEWLINE) eol = true;else if (c === RETURN) {
          eol = true;
          if (text.charCodeAt(I) === NEWLINE) ++I;
        }
        return text.slice(j + 1, i - 1).replace(/""/g, "\"");
      }

      // Find next delimiter or newline.
      while (I < N) {
        if ((c = text.charCodeAt(i = I++)) === NEWLINE) eol = true;else if (c === RETURN) {
          eol = true;
          if (text.charCodeAt(I) === NEWLINE) ++I;
        } else if (c !== DELIMITER) continue;
        return text.slice(j, i);
      }

      // Return last token before EOF.
      return eof = true, text.slice(j, N);
    }
    while ((t = token()) !== EOF) {
      var row = [];
      while (t !== EOL && t !== EOF) row.push(t), t = token();
      if (f && (row = f(row, n++)) == null) continue;
      rows.push(row);
    }
    return rows;
  }
  function preformatBody(rows, columns) {
    return rows.map(function (row) {
      return columns.map(function (column) {
        return formatValue(row[column]);
      }).join(delimiter);
    });
  }
  function format(rows, columns) {
    if (columns == null) columns = inferColumns(rows);
    return [columns.map(formatValue).join(delimiter)].concat(preformatBody(rows, columns)).join("\n");
  }
  function formatBody(rows, columns) {
    if (columns == null) columns = inferColumns(rows);
    return preformatBody(rows, columns).join("\n");
  }
  function formatRows(rows) {
    return rows.map(formatRow).join("\n");
  }
  function formatRow(row) {
    return row.map(formatValue).join(delimiter);
  }
  function formatValue(value) {
    return value == null ? "" : value instanceof Date ? formatDate(value) : reFormat.test(value += "") ? "\"" + value.replace(/"/g, "\"\"") + "\"" : value;
  }
  return {
    parse: parse,
    parseRows: parseRows,
    format: format,
    formatBody: formatBody,
    formatRows: formatRows,
    formatRow: formatRow,
    formatValue: formatValue
  };
}

var csv = dsv(",");
var csvParse = csv.parse;
var csvParseRows = csv.parseRows;
var csvFormat = csv.format;
var csvFormatBody = csv.formatBody;
var csvFormatRows = csv.formatRows;
var csvFormatRow = csv.formatRow;
var csvFormatValue = csv.formatValue;

var tsv = dsv("\t");
var tsvParse = tsv.parse;
var tsvParseRows = tsv.parseRows;
var tsvFormat = tsv.format;
var tsvFormatBody = tsv.formatBody;
var tsvFormatRows = tsv.formatRows;
var tsvFormatRow = tsv.formatRow;
var tsvFormatValue = tsv.formatValue;

function autoType(object) {
  for (var key in object) {
    var value = object[key].trim(),
      number,
      m;
    if (!value) value = null;else if (value === "true") value = true;else if (value === "false") value = false;else if (value === "NaN") value = NaN;else if (!isNaN(number = +value)) value = number;else if (m = value.match(/^([-+]\d{2})?\d{4}(-\d{2}(-\d{2})?)?(T\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/)) {
      if (fixtz && !!m[4] && !m[7]) value = value.replace(/-/g, "/").replace(/T/, " ");
      value = new Date(value);
    } else continue;
    object[key] = value;
  }
  return object;
}

// https://github.com/d3/d3-dsv/issues/45
var fixtz = new Date("2019-01-01T00:00").getHours() || new Date("2019-07-01T00:00").getHours();

var d3 = /*#__PURE__*/Object.freeze({
  __proto__: null,
  autoType: autoType,
  csvFormat: csvFormat,
  csvFormatBody: csvFormatBody,
  csvFormatRow: csvFormatRow,
  csvFormatRows: csvFormatRows,
  csvFormatValue: csvFormatValue,
  csvParse: csvParse,
  csvParseRows: csvParseRows,
  dsvFormat: dsv,
  tsvFormat: tsvFormat,
  tsvFormatBody: tsvFormatBody,
  tsvFormatRow: tsvFormatRow,
  tsvFormatRows: tsvFormatRows,
  tsvFormatValue: tsvFormatValue,
  tsvParse: tsvParse,
  tsvParseRows: tsvParseRows
});

var version = "2.7.0";

var urls = {
  'annual-precip.json': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/annual-precip.json"),
  'anscombe.json': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/anscombe.json"),
  'barley.json': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/barley.json"),
  'budget.json': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/budget.json"),
  'budgets.json': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/budgets.json"),
  'burtin.json': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/burtin.json"),
  'cars.json': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/cars.json"),
  'countries.json': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/countries.json"),
  'crimea.json': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/crimea.json"),
  'driving.json': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/driving.json"),
  'earthquakes.json': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/earthquakes.json"),
  'flare-dependencies.json': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/flare-dependencies.json"),
  'flare.json': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/flare.json"),
  'flights-10k.json': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/flights-10k.json"),
  'flights-200k.json': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/flights-200k.json"),
  'flights-20k.json': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/flights-20k.json"),
  'flights-2k.json': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/flights-2k.json"),
  'flights-5k.json': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/flights-5k.json"),
  'football.json': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/football.json"),
  'gapminder.json': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/gapminder.json"),
  'income.json': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/income.json"),
  'jobs.json': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/jobs.json"),
  'londonBoroughs.json': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/londonBoroughs.json"),
  'londonCentroids.json': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/londonCentroids.json"),
  'londonTubeLines.json': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/londonTubeLines.json"),
  'miserables.json': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/miserables.json"),
  'monarchs.json': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/monarchs.json"),
  'movies.json': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/movies.json"),
  'normal-2d.json': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/normal-2d.json"),
  'obesity.json': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/obesity.json"),
  'ohlc.json': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/ohlc.json"),
  'penguins.json': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/penguins.json"),
  'platformer-terrain.json': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/platformer-terrain.json"),
  'points.json': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/points.json"),
  'political-contributions.json': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/political-contributions.json"),
  'population.json': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/population.json"),
  'udistrict.json': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/udistrict.json"),
  'unemployment-across-industries.json': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/unemployment-across-industries.json"),
  'uniform-2d.json': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/uniform-2d.json"),
  'us-10m.json': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/us-10m.json"),
  'us-state-capitals.json': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/us-state-capitals.json"),
  'volcano.json': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/volcano.json"),
  'weather.json': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/weather.json"),
  'wheat.json': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/wheat.json"),
  'world-110m.json': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/world-110m.json"),
  'airports.csv': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/airports.csv"),
  'birdstrikes.csv': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/birdstrikes.csv"),
  'co2-concentration.csv': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/co2-concentration.csv"),
  'disasters.csv': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/disasters.csv"),
  'flights-3m.csv': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/flights-3m.csv"),
  'flights-airport.csv': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/flights-airport.csv"),
  'gapminder-health-income.csv': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/gapminder-health-income.csv"),
  'github.csv': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/github.csv"),
  'iowa-electricity.csv': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/iowa-electricity.csv"),
  'la-riots.csv': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/la-riots.csv"),
  'lookup_groups.csv': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/lookup_groups.csv"),
  'lookup_people.csv': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/lookup_people.csv"),
  'population_engineers_hurricanes.csv': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/population_engineers_hurricanes.csv"),
  'seattle-weather-hourly-normals.csv': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/seattle-weather-hourly-normals.csv"),
  'seattle-weather.csv': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/seattle-weather.csv"),
  'sp500-2000.csv': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/sp500-2000.csv"),
  'sp500.csv': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/sp500.csv"),
  'stocks.csv': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/stocks.csv"),
  'us-employment.csv': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/us-employment.csv"),
  'weather.csv': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/weather.csv"),
  'windvectors.csv': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/windvectors.csv"),
  'zipcodes.csv': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/zipcodes.csv"),
  'unemployment.tsv': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/unemployment.tsv"),
  'flights-200k.arrow': "https://cdn.jsdelivr.net/npm/vega-datasets@".concat(version, "/data/flights-200k.arrow")
};

var data = {
  version
};
var _loop = function _loop() {
  var name = _arr[_i];
  var url = urls[name];
  var f = /*#__PURE__*/function () {
    var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
      var result;
      return _regeneratorRuntime.wrap(function _callee$(_context) {
        while (1) switch (_context.prev = _context.next) {
          case 0:
            _context.next = 2;
            return fetch(url);
          case 2:
            result = _context.sent;
            if (!name.endsWith(".json")) {
              _context.next = 9;
              break;
            }
            _context.next = 6;
            return result.json();
          case 6:
            return _context.abrupt("return", _context.sent);
          case 9:
            if (!name.endsWith(".csv")) {
              _context.next = 18;
              break;
            }
            _context.t0 = d3;
            _context.next = 13;
            return result.text();
          case 13:
            _context.t1 = _context.sent;
            _context.t2 = autoType;
            return _context.abrupt("return", _context.t0.csvParse.call(_context.t0, _context.t1, _context.t2));
          case 18:
            _context.next = 20;
            return result.text();
          case 20:
            return _context.abrupt("return", _context.sent);
          case 21:
          case "end":
            return _context.stop();
        }
      }, _callee);
    }));
    return function f() {
      return _ref.apply(this, arguments);
    };
  }();
  f.url = url;
  data[name] = f;
};
for (var _i = 0, _arr = Object.keys(urls); _i < _arr.length; _i++) {
  _loop();
}

export { data as default };
//# sourceMappingURL=vega-datasets.module.js.map
