import { useCreatePickerModal as useCreatePickerModalBase, useSyncPickerModalProps, } from '../hooks';
import { wixPatternsEnvironment, } from '@wix/bex-core';
import { useEssentials } from '@wix/fe-essentials/react';
import { useCallback, useState } from 'react';
export function useCreatePickerModal() {
    const { errorMonitor, environment, biLoggerFactory } = useEssentials();
    const createPickerModalBase = useCreatePickerModalBase();
    return useCallback((params) => createPickerModalBase({
        errorMonitor,
        biLoggerFactory,
        ...params,
        environment: wixPatternsEnvironment({
            ...environment,
            ...params?.environment,
        }),
    }), []);
}
export function usePickerModal(params) {
    const createPickerModal = useCreatePickerModal();
    const [state] = useState(() => createPickerModal(params));
    useSyncPickerModalProps(state, params);
    return state;
}
//# sourceMappingURL=usePickerModal.js.map