import { useVariable } from "../../../modules/variable/useVariable.mjs";
import { useBaseVariable } from "./useBaseVariable.mjs";
const usePopupVariable = function() {
    let props = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
    const { value, title, collection } = useVariable('$nPopupRecord');
    const settings = useBaseVariable({
        collectionField: props.collectionField,
        uiSchema: props.schema,
        name: '$nPopupRecord',
        title,
        collectionName: null == collection ? void 0 : collection.name,
        noDisabled: props.noDisabled,
        targetFieldSchema: props.targetFieldSchema,
        dataSource: null == collection ? void 0 : collection.dataSource
    });
    return {
        settings,
        popupRecordCtx: value,
        shouldDisplayPopupRecord: !!value,
        collectionName: null == collection ? void 0 : collection.name,
        dataSource: null == collection ? void 0 : collection.dataSource
    };
};
export { usePopupVariable };
