import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
import * as __WEBPACK_EXTERNAL_MODULE__index_mjs__ from "../../../../index.mjs";
const useRoleResourceValues = (options)=>{
    const record = (0, __WEBPACK_EXTERNAL_MODULE__index_mjs__.useRecord)();
    const { visible } = (0, __WEBPACK_EXTERNAL_MODULE__index_mjs__.useActionContext)();
    const result = (0, __WEBPACK_EXTERNAL_MODULE__index_mjs__.useRequest)({
        resource: 'roles.resources',
        resourceOf: record.roleName,
        action: 'get',
        params: {
            appends: [
                'actions',
                'actions.scope'
            ],
            filterByTk: record.name
        }
    }, {
        ...options,
        manual: true
    });
    (0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
        if (!record.exists) {
            options.onSuccess({
                data: {}
            });
            return;
        }
        if (visible) result.run();
    }, [
        visible,
        record.exists
    ]);
    return result;
};
export { useRoleResourceValues };
