"use client";
import { jsx } from "react/jsx-runtime";
import { useMemo } from "react";
import NextImage from "next/image";
import { useIsPagesRouter } from "../../hooks/use-is-pages-router";
import {
  FrameworkContext,
  versionedFetch
} from "../../../runtimes/react/components/framework-context";
import { MAKESWIFT_CACHE_TAG } from "../../cache";
import { context as appRouterContext } from "./app-router";
import { context as pagesRouterContext } from "./pages-router";
import { Link } from "./link";
function FrameworkProvider({
  children,
  forcePagesRouter
}) {
  const isPagesRouter = useIsPagesRouter() || forcePagesRouter;
  const context = useMemo(
    () => ({
      ...isPagesRouter ? pagesRouterContext : appRouterContext,
      Image: NextImage,
      Link,
      versionedFetch: (siteVersion) => (url, init) => versionedFetch(siteVersion)(url, { ...init, next: { tags: [MAKESWIFT_CACHE_TAG] } })
    }),
    [isPagesRouter]
  );
  return /* @__PURE__ */ jsx(FrameworkContext.Provider, { value: context, children });
}
export {
  FrameworkProvider
};
//# sourceMappingURL=index.js.map