import { useTranslation } from "react-i18next";
import { useAPIClient } from "../../../api-client/index.mjs";
import { useBaseVariable } from "./useBaseVariable.mjs";
const useRoleVariable = (param)=>{
    let { collectionField, uiSchema, noDisabled, targetFieldSchema, maxDepth = 0 } = param;
    const { t } = useTranslation();
    const result = useBaseVariable({
        collectionField,
        uiSchema,
        maxDepth,
        name: '$nRole',
        title: t('Current role'),
        collectionName: 'roles',
        noDisabled,
        targetFieldSchema,
        noChildren: true
    });
    return result;
};
const useCurrentRoleVariable = function() {
    let { collectionField, uiSchema, noDisabled, targetFieldSchema, maxDepth = 0 } = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
    var _apiClient_auth;
    const { t } = useTranslation();
    const apiClient = useAPIClient();
    const currentRoleSettings = useBaseVariable({
        collectionField,
        uiSchema,
        maxDepth,
        name: '$nRole',
        title: t('Current role'),
        collectionName: 'roles',
        noDisabled,
        targetFieldSchema,
        noChildren: true
    });
    return {
        currentRoleSettings,
        currentRoleCtx: null == (_apiClient_auth = apiClient.auth) ? void 0 : _apiClient_auth.role
    };
};
export { useCurrentRoleVariable, useRoleVariable };
