import { configureTracking } from "@agent-native/core/client/analytics"; import { appPath } from "@agent-native/core/client/api-path"; import { AppProviders, createAgentNativeQueryClient, useDbSync, getBrowserTabId, useSession, } from "@agent-native/core/client/hooks"; import { getLocaleInitScript, useT } from "@agent-native/core/client/i18n"; import { CommandMenu, useCommandMenuShortcut, } from "@agent-native/core/client/navigation"; import { getThemeInitScript } from "@agent-native/core/client/ui"; import { IconHierarchy2, IconSun, IconMoon } from "@tabler/icons-react"; import { useQueryClient } from "@tanstack/react-query"; import { useTheme } from "next-themes"; import { useCallback, useState } from "react"; import { Links, Meta, Outlet, Scripts, ScrollRestoration, useLocation, useNavigate, } from "react-router"; import type { LinksFunction } from "react-router"; import { Layout as AppLayout } from "@/components/layout/Layout"; import { Toaster } from "@/components/ui/sonner"; import { AppToolkitProvider } from "@/components/ui/toolkit-provider"; import changelog from "../CHANGELOG.md?raw"; import { i18nCatalog } from "./i18n"; import { isPublicDesignAppPath } from "./public-routes"; import stylesheet from "./global.css?url"; configureTracking({ llmConnectionStatus: typeof window === "undefined" || !isPublicDesignAppPath(window.location.pathname), getDefaultProps: (_name, properties) => ({ ...properties, app: "design", }), }); export const links: LinksFunction = () => [ { rel: "stylesheet", href: stylesheet }, ]; const THEME_INIT_SCRIPT = getThemeInitScript(); const LOCALE_INIT_SCRIPT = getLocaleInitScript(); export function Layout({ children }: { children: React.ReactNode }) { return (