import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
import * as __WEBPACK_EXTERNAL_MODULE__tachybase_utils_client__ from "@tachybase/utils/client";
import * as __WEBPACK_EXTERNAL_MODULE__schema_settings_index_mjs__ from "../../schema-settings/index.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__schema_settings_VariableInput_hooks_useRoleVariable_mjs__ from "../../schema-settings/VariableInput/hooks/useRoleVariable.mjs";
const useBuiltInVariables = ()=>{
    const { currentUserCtx } = (0, __WEBPACK_EXTERNAL_MODULE__schema_settings_index_mjs__.useCurrentUserVariable)();
    const { currentRoleCtx } = (0, __WEBPACK_EXTERNAL_MODULE__schema_settings_VariableInput_hooks_useRoleVariable_mjs__.useCurrentRoleVariable)();
    const { datetimeCtx } = (0, __WEBPACK_EXTERNAL_MODULE__schema_settings_index_mjs__.useDatetimeVariable)();
    const builtinVariables = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>[
            {
                name: '$user',
                ctx: currentUserCtx,
                collectionName: 'users'
            },
            {
                name: '$nRole',
                ctx: currentRoleCtx,
                collectionName: 'roles'
            },
            {
                name: 'currentUser',
                ctx: currentUserCtx,
                collectionName: 'users'
            },
            {
                name: '$nDate',
                ctx: datetimeCtx
            },
            {
                name: '$date',
                ctx: datetimeCtx
            },
            {
                name: '$system',
                ctx: {
                    now: ()=>(0, __WEBPACK_EXTERNAL_MODULE__tachybase_utils_client__.dayjs)().toISOString()
                }
            },
            {
                name: 'currentTime',
                ctx: ()=>(0, __WEBPACK_EXTERNAL_MODULE__tachybase_utils_client__.dayjs)().toISOString()
            }
        ], [
        currentUserCtx
    ]);
    return {
        builtinVariables
    };
};
const useBuiltinVariables_rslib_entry_ = useBuiltInVariables;
export { useBuiltinVariables_rslib_entry_ as default };
