import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
import * as __WEBPACK_EXTERNAL_MODULE__data_source_index_mjs__ from "../../data-source/index.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__schema_settings_VariableInput_hooks_useBlockCollection_mjs__ from "../../schema-settings/VariableInput/hooks/useBlockCollection.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__schema_settings_VariableInput_hooks_useDateVariable_mjs__ from "../../schema-settings/VariableInput/hooks/useDateVariable.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__schema_settings_VariableInput_hooks_useFormVariable_mjs__ from "../../schema-settings/VariableInput/hooks/useFormVariable.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__schema_settings_VariableInput_hooks_useIterationVariable_mjs__ from "../../schema-settings/VariableInput/hooks/useIterationVariable.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__schema_settings_VariableInput_hooks_useParentRecordVariable_mjs__ from "../../schema-settings/VariableInput/hooks/useParentRecordVariable.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__schema_settings_VariableInput_hooks_usePopupVariable_mjs__ from "../../schema-settings/VariableInput/hooks/usePopupVariable.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__schema_settings_VariableInput_hooks_useRecordVariable_mjs__ from "../../schema-settings/VariableInput/hooks/useRecordVariable.mjs";
const useLocalVariables = (props)=>{
    const { currentObjectCtx, shouldDisplayCurrentObject } = (0, __WEBPACK_EXTERNAL_MODULE__schema_settings_VariableInput_hooks_useIterationVariable_mjs__.useCurrentObjectVariable)();
    const { currentRecordCtx, collectionName: collectionNameOfRecord } = (0, __WEBPACK_EXTERNAL_MODULE__schema_settings_VariableInput_hooks_useRecordVariable_mjs__.useCurrentRecordVariable)();
    const { popupRecordCtx, collectionName: collectionNameOfPopupRecord } = (0, __WEBPACK_EXTERNAL_MODULE__schema_settings_VariableInput_hooks_usePopupVariable_mjs__.usePopupVariable)();
    const { currentParentRecordCtx, collectionName: collectionNameOfParentRecord } = (0, __WEBPACK_EXTERNAL_MODULE__schema_settings_VariableInput_hooks_useParentRecordVariable_mjs__.useCurrentParentRecordVariable)();
    const { datetimeCtx } = (0, __WEBPACK_EXTERNAL_MODULE__schema_settings_VariableInput_hooks_useDateVariable_mjs__.useDatetimeVariable)();
    const { currentFormCtx } = (0, __WEBPACK_EXTERNAL_MODULE__schema_settings_VariableInput_hooks_useFormVariable_mjs__.useCurrentFormVariable)({
        form: null == props ? void 0 : props.currentForm
    });
    const collection = (0, __WEBPACK_EXTERNAL_MODULE__data_source_index_mjs__.useCollection)();
    let { name } = (0, __WEBPACK_EXTERNAL_MODULE__schema_settings_VariableInput_hooks_useBlockCollection_mjs__.useBlockCollection)();
    if (null == props ? void 0 : props.collectionName) name = props.collectionName;
    return (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>[
            {
                name: '$nRecord',
                ctx: currentRecordCtx,
                collectionName: collectionNameOfRecord
            },
            {
                name: '$nParentRecord',
                ctx: currentParentRecordCtx,
                collectionName: collectionNameOfParentRecord
            },
            {
                name: '$nPopupRecord',
                ctx: popupRecordCtx,
                collectionName: collectionNameOfPopupRecord
            },
            {
                name: '$nForm',
                ctx: currentFormCtx,
                collectionName: name
            },
            {
                name: '$nDate',
                ctx: datetimeCtx
            },
            shouldDisplayCurrentObject && {
                name: '$iteration',
                ctx: currentObjectCtx,
                collectionName: null == collection ? void 0 : collection.name
            }
        ].filter(Boolean), [
        currentRecordCtx,
        collectionNameOfRecord,
        name,
        currentFormCtx,
        currentParentRecordCtx,
        collectionNameOfParentRecord,
        popupRecordCtx,
        collectionNameOfPopupRecord,
        datetimeCtx,
        shouldDisplayCurrentObject,
        currentObjectCtx,
        null == collection ? void 0 : collection.name
    ]);
};
const useLocalVariables_rslib_entry_ = useLocalVariables;
export { useLocalVariables_rslib_entry_ as default };
