import { jsx as p } from "react/jsx-runtime";
import { useReducer as u, useCallback as r, useMemo as g } from "react";
import l from "./utils/navigationReducer.js";
import { DialogNavigationProvider as m } from "../../context/DialogNavigationContext.js";
const v = ({ initialStep: i, children: n }) => {
  const [t, e] = u(l, { currentStep: i, history: [] }), a = r((s) => {
    e({ type: "navigate", step: s });
  }, []), o = r(() => {
    e({ type: "back" });
  }, []), c = g(
    () => ({
      currentStep: t.currentStep,
      canGoBack: t.history.length > 0,
      navigateTo: a,
      navigateBack: o
    }),
    [t.currentStep, t.history.length, a, o]
  );
  return /* @__PURE__ */ p(m, { value: c, children: n });
};
v.displayName = "DialogNavigation";
export {
  v as default
};
//# sourceMappingURL=DialogNavigation.js.map
