import _Stack_default from "./_Stack.js";
import isArray_default from "./isArray.js";
import isBuffer_default from "./isBuffer.js";
import isTypedArray_default from "./isTypedArray.js";
import _getTag_default from "./_getTag.js";
import _equalArrays_default from "./_equalArrays.js";
import _equalByTag_default from "./_equalByTag.js";
import _equalObjects_default from "./_equalObjects.js";
var COMPARE_PARTIAL_FLAG = 1, argsTag = "[object Arguments]", arrayTag = "[object Array]", objectTag = "[object Object]", hasOwnProperty = Object.prototype.hasOwnProperty;
function baseIsEqualDeep(p, m, h, g, _, v) {
	var y = isArray_default(p), b = isArray_default(m), x = y ? arrayTag : _getTag_default(p), S = b ? arrayTag : _getTag_default(m);
	x = x == argsTag ? objectTag : x, S = S == argsTag ? objectTag : S;
	var C = x == objectTag, w = S == objectTag, T = x == S;
	if (T && isBuffer_default(p)) {
		if (!isBuffer_default(m)) return !1;
		y = !0, C = !1;
	}
	if (T && !C) return v ||= new _Stack_default(), y || isTypedArray_default(p) ? _equalArrays_default(p, m, h, g, _, v) : _equalByTag_default(p, m, x, h, g, _, v);
	if (!(h & COMPARE_PARTIAL_FLAG)) {
		var E = C && hasOwnProperty.call(p, "__wrapped__"), D = w && hasOwnProperty.call(m, "__wrapped__");
		if (E || D) {
			var O = E ? p.value() : p, k = D ? m.value() : m;
			return v ||= new _Stack_default(), _(O, k, h, g, v);
		}
	}
	return T ? (v ||= new _Stack_default(), _equalObjects_default(p, m, h, g, _, v)) : !1;
}
var _baseIsEqualDeep_default = baseIsEqualDeep;
export { _baseIsEqualDeep_default as default };
