import { __require as requireCallBindApplyHelpers } from "../call-bind-apply-helpers/index.js";
import { __require as requireGopd } from "../gopd/index.js";
import { __require as requireType } from "../es-errors/type.js";
var set;
var hasRequiredSet;
function requireSet() {
  if (hasRequiredSet) return set;
  hasRequiredSet = 1;
  var callBind = requireCallBindApplyHelpers();
  var gOPD = requireGopd();
  var $TypeError = requireType();
  var obj = {};
  try {
    obj.__proto__ = null;
  } catch (e) {
    if (!e || typeof e !== "object" || !("code" in e) || e.code !== "ERR_PROTO_ACCESS") {
      throw e;
    }
  }
  var hasProtoMutator = !("toString" in obj);
  var desc = gOPD && gOPD(
    Object.prototype,
    /** @type {keyof typeof Object.prototype} */
    "__proto__"
  );
  set = hasProtoMutator && // eslint-disable-next-line no-extra-parens
  (!!desc && typeof desc.set === "function" && /** @type {import('./set')} */
  callBind([desc.set]) || /** @type {import('./set')} */
  function setDunder(object, proto) {
    if (object == null) {
      throw new $TypeError("set Object.prototype.__proto__ called on null or undefined");
    }
    object.__proto__ = proto;
    return proto;
  });
  return set;
}
export {
  requireSet as __require
};
