"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const react = require("react");
const reactClient = require("@contember/react-client");
const useIdentity = require("../components/Identity/useIdentity.cjs");
const useProjectUserRoles = () => {
  const identity = useIdentity.useIdentity();
  const projectSlug = reactClient.useProjectSlug();
  return react.useMemo(() => {
    if (!projectSlug) {
      return /* @__PURE__ */ new Set();
    }
    const targetProject = identity.projects.find((project) => project.slug === projectSlug);
    if (targetProject === void 0) {
      return /* @__PURE__ */ new Set();
    }
    return new Set(targetProject.roles);
  }, [identity.projects, projectSlug]);
};
exports.useProjectUserRoles = useProjectUserRoles;
//# sourceMappingURL=useProjectUserRoles.cjs.map
