import { jsx } from "react/jsx-runtime";
import { createContext, useMemo, use } from "react";
var OpenApiRouter;
((OpenApiRouter2) => {
  const Context = createContext(null);
  OpenApiRouter2.Provider = ({ children, replace }) => {
    const value = useMemo(() => ({ replace }), [replace]);
    return /* @__PURE__ */ jsx(Context, { value, children });
  };
  OpenApiRouter2.useRouter = () => {
    const context = use(Context);
    if (!context) {
      throw new Error("useRouter must be used within an OpenApiRouter.Provider");
    }
    return context;
  };
})(OpenApiRouter || (OpenApiRouter = {}));
export {
  OpenApiRouter
};
