import isObject_default from "./isObject.js";
import _assignValue_default from "./_assignValue.js";
import _isIndex_default from "./_isIndex.js";
import _castPath_default from "./_castPath.js";
import _toKey_default from "./_toKey.js";
function baseSet(a, o, s, c) {
	if (!isObject_default(a)) return a;
	o = _castPath_default(o, a);
	for (var l = -1, u = o.length, d = u - 1, f = a; f != null && ++l < u;) {
		var p = _toKey_default(o[l]), m = s;
		if (p === "__proto__" || p === "constructor" || p === "prototype") return a;
		if (l != d) {
			var h = f[p];
			m = c ? c(h, p, f) : void 0, m === void 0 && (m = isObject_default(h) ? h : _isIndex_default(o[l + 1]) ? [] : {});
		}
		_assignValue_default(f, p, m), f = f[p];
	}
	return a;
}
var _baseSet_default = baseSet;
export { _baseSet_default as default };
