'use strict';

var _commonjsHelpers = require('./_commonjsHelpers-06173234.js');
var _toObject = require('./_to-object-329a650b.js');
var es6_string_iterator = require('./es6.string.iterator-cc0bbaa4.js');
var core_getIteratorMethod = require('./core.get-iterator-method-f62321d4.js');
require('./web.dom.iterable-a0e279c1.js');

var ITERATOR = es6_string_iterator._wks('iterator');

var core_isIterable = _toObject._core.isIterable = function (it) {
  var O = Object(it);
  return O[ITERATOR] !== undefined
    || '@@iterator' in O
    // eslint-disable-next-line no-prototype-builtins
    || es6_string_iterator._iterators.hasOwnProperty(core_getIteratorMethod._classof(O));
};

var isIterable = core_isIterable;

var isIterable$1 = _commonjsHelpers.createCommonjsModule(function (module) {
module.exports = { "default": isIterable, __esModule: true };
});

_commonjsHelpers.unwrapExports(isIterable$1);

var core_getIterator = _toObject._core.getIterator = function (it) {
  var iterFn = core_getIteratorMethod.core_getIteratorMethod(it);
  if (typeof iterFn != 'function') throw TypeError(it + ' is not iterable!');
  return _toObject._anObject(iterFn.call(it));
};

var getIterator = core_getIterator;

var getIterator$1 = _commonjsHelpers.createCommonjsModule(function (module) {
module.exports = { "default": getIterator, __esModule: true };
});

var _getIterator = _commonjsHelpers.unwrapExports(getIterator$1);

var slicedToArray = _commonjsHelpers.createCommonjsModule(function (module, exports) {

exports.__esModule = true;



var _isIterable3 = _interopRequireDefault(isIterable$1);



var _getIterator3 = _interopRequireDefault(getIterator$1);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

exports.default = function () {
  function sliceIterator(arr, i) {
    var _arr = [];
    var _n = true;
    var _d = false;
    var _e = undefined;

    try {
      for (var _i = (0, _getIterator3.default)(arr), _s; !(_n = (_s = _i.next()).done); _n = true) {
        _arr.push(_s.value);

        if (i && _arr.length === i) break;
      }
    } catch (err) {
      _d = true;
      _e = err;
    } finally {
      try {
        if (!_n && _i["return"]) _i["return"]();
      } finally {
        if (_d) throw _e;
      }
    }

    return _arr;
  }

  return function (arr, i) {
    if (Array.isArray(arr)) {
      return arr;
    } else if ((0, _isIterable3.default)(Object(arr))) {
      return sliceIterator(arr, i);
    } else {
      throw new TypeError("Invalid attempt to destructure non-iterable instance");
    }
  };
}();
});

var _slicedToArray = _commonjsHelpers.unwrapExports(slicedToArray);

exports._getIterator = _getIterator;
exports._slicedToArray = _slicedToArray;
