import _Symbol_default from "./_Symbol.js";
import eq_default from "./eq.js";
import _Uint8Array_default from "./_Uint8Array.js";
import _equalArrays_default from "./_equalArrays.js";
import _mapToArray_default from "./_mapToArray.js";
import _setToArray_default from "./_setToArray.js";
var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2, boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", mapTag = "[object Map]", numberTag = "[object Number]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", symbolProto = _Symbol_default ? _Symbol_default.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
function equalByTag(e, b, x, S, C, w, T) {
	switch (x) {
		case dataViewTag:
			if (e.byteLength != b.byteLength || e.byteOffset != b.byteOffset) return !1;
			e = e.buffer, b = b.buffer;
		case arrayBufferTag: return !(e.byteLength != b.byteLength || !w(new _Uint8Array_default(e), new _Uint8Array_default(b)));
		case boolTag:
		case dateTag:
		case numberTag: return eq_default(+e, +b);
		case errorTag: return e.name == b.name && e.message == b.message;
		case regexpTag:
		case stringTag: return e == b + "";
		case mapTag: var E = _mapToArray_default;
		case setTag:
			var D = S & COMPARE_PARTIAL_FLAG;
			if (E ||= _setToArray_default, e.size != b.size && !D) return !1;
			var O = T.get(e);
			if (O) return O == b;
			S |= COMPARE_UNORDERED_FLAG, T.set(e, b);
			var k = _equalArrays_default(E(e), E(b), S, C, w, T);
			return T.delete(e), k;
		case symbolTag: if (symbolValueOf) return symbolValueOf.call(e) == symbolValueOf.call(b);
	}
	return !1;
}
var _equalByTag_default = equalByTag;
export { _equalByTag_default as default };
