import { jsx } from "react/jsx-runtime";
import { isServer } from "@tanstack/router-core/isServer";
import { useRouter } from "./useRouter.js";
function ScriptOnce({ children }) {
  const router = useRouter();
  if (!(isServer ?? router.isServer)) {
    return null;
  }
  return /* @__PURE__ */ jsx(
    "script",
    {
      nonce: router.options.ssr?.nonce,
      dangerouslySetInnerHTML: {
        __html: children + ";document.currentScript.remove()"
      }
    }
  );
}
export {
  ScriptOnce
};//# sourceMappingURL=https://main.vscode-cdn.net/sourcemaps/ecfbad74d93962fc8ca485d93ab9b4f3d4cb6cf8/node_modules/@tanstack/react-router/dist/esm/ScriptOnce.js.map
