'use strict';

var _commonjsHelpers = require('./_commonjsHelpers-06173234.js');
var core_getIteratorMethod = require('./core.get-iterator-method-5643aa10.js');
var _iterDetect = require('./_iter-detect-b1df62f0.js');

var _anInstance = function (it, Constructor, name, forbiddenField) {
  if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {
    throw TypeError(name + ': incorrect invocation!');
  } return it;
};

var _forOf = _commonjsHelpers.createCommonjsModule(function (module) {
var BREAK = {};
var RETURN = {};
var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {
  var iterFn = ITERATOR ? function () { return iterable; } : core_getIteratorMethod.core_getIteratorMethod(iterable);
  var f = core_getIteratorMethod._ctx(fn, that, entries ? 2 : 1);
  var index = 0;
  var length, step, iterator, result;
  if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');
  // fast case for arrays with default iterator
  if (_iterDetect._isArrayIter(iterFn)) for (length = core_getIteratorMethod._toLength(iterable.length); length > index; index++) {
    result = entries ? f(core_getIteratorMethod._anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);
    if (result === BREAK || result === RETURN) return result;
  } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {
    result = _iterDetect._iterCall(iterator, f, step.value, entries);
    if (result === BREAK || result === RETURN) return result;
  }
};
exports.BREAK = BREAK;
exports.RETURN = RETURN;
});

var _redefineAll = function (target, src, safe) {
  for (var key in src) {
    if (safe && target[key]) target[key] = src[key];
    else core_getIteratorMethod._hide(target, key, src[key]);
  } return target;
};

var SPECIES = core_getIteratorMethod._wks('species');

var _setSpecies = function (KEY) {
  var C = typeof core_getIteratorMethod._core[KEY] == 'function' ? core_getIteratorMethod._core[KEY] : core_getIteratorMethod._global[KEY];
  if (core_getIteratorMethod._descriptors && C && !C[SPECIES]) core_getIteratorMethod._objectDp.f(C, SPECIES, {
    configurable: true,
    get: function () { return this; }
  });
};

exports._anInstance = _anInstance;
exports._forOf = _forOf;
exports._redefineAll = _redefineAll;
exports._setSpecies = _setSpecies;
