import { SlotsProvider } from "nano-slots";
import React, { useContext, useReducer } from "react";
import { defaultState, reducer } from "./reducer";
var PMAXContext = /*#__PURE__*/React.createContext(null);

function PMAXCreationModalProvider(_ref) {
  var children = _ref.children;
  var stateDispatch = useReducer(reducer, defaultState);
  return /*#__PURE__*/React.createElement(SlotsProvider, null, /*#__PURE__*/React.createElement(PMAXContext.Provider, {
    value: stateDispatch
  }, children));
}

export function usePMaxState() {
  return useContext(PMAXContext);
}
export default PMAXCreationModalProvider;