"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxDevRuntime = require("react/jsx-dev-runtime");
const ui = require("@contember/ui");
const reactBinding = require("@contember/react-binding");
const reactRouting = require("@contember/react-routing");
const NavigationProvider = (props) => {
  const env = reactBinding.useEnvironment();
  const linkFactory = reactRouting.useRoutingLinkFactory();
  return /* @__PURE__ */ jsxDevRuntime.jsxDEV(
    ui.NavigationContext.Provider,
    {
      value: (val) => {
        if (!reactRouting.isRoutingLinkTarget(val)) {
          throw new reactRouting.PageNotFound("Invalid request");
        }
        return linkFactory(reactRouting.parseLinkTarget(val, env));
      },
      children: props.children
    },
    void 0,
    false,
    {
      fileName: "/__w/interface/interface/packages/admin/src/components/NavigationProvider/NavigationProvider.tsx",
      lineNumber: 15,
      columnNumber: 3
    },
    void 0
  );
};
exports.NavigationProvider = NavigationProvider;
//# sourceMappingURL=NavigationProvider.cjs.map
