"use strict";

exports.__esModule = true;
exports.useCreatePickerModal = useCreatePickerModal;
exports.usePickerModal = usePickerModal;
var _hooks = require("../hooks");
var _bexCore = require("@wix/bex-core");
var _feEssentialsGiza = require("@wix/yoshi-flow-bm/fe-essentials-giza");
var _react = require("react");
function useCreatePickerModal() {
  const {
    errorMonitor,
    environment,
    createChildEssentials
  } = (0, _feEssentialsGiza.useEssentials)();
  const createPickerModalBase = (0, _hooks.useCreatePickerModal)();
  return (0, _react.useCallback)(params => {
    const {
      biLoggerFactory
    } = createChildEssentials({});
    return createPickerModalBase({
      errorMonitor,
      biLoggerFactory,
      ...params,
      environment: (0, _bexCore.wixPatternsEnvironment)({
        ...environment,
        ...(params == null ? void 0 : params.environment)
      })
    });
  }, []);
}
function usePickerModal(params) {
  const createPickerModal = useCreatePickerModal();
  const [state] = (0, _react.useState)(() => createPickerModal(params));
  (0, _hooks.useSyncPickerModalProps)(state, params);
  return state;
}
//# sourceMappingURL=usePickerModal.js.map