import l from "./_SetCache.mjs";
import w from "./_arrayIncludes.mjs";
import y from "./_arrayIncludesWith.mjs";
import A from "./_arrayMap.mjs";
import R from "./_baseUnary.mjs";
import b from "./_cacheHas.mjs";
var C = 200;
function x(s, r, i, o) {
  var e = -1, t = w, m = !0, g = s.length, n = [], c = r.length;
  if (!g)
    return n;
  i && (r = A(r, R(i))), o ? (t = y, m = !1) : r.length >= C && (t = b, m = !1, r = new l(r));
  r:
    for (; ++e < g; ) {
      var f = s[e], h = i == null ? f : i(f);
      if (f = o || f !== 0 ? f : 0, m && h === h) {
        for (var p = c; p--; )
          if (r[p] === h)
            continue r;
        n.push(f);
      } else
        t(r, h, o) || n.push(f);
    }
  return n;
}
export {
  x as default
};
