HEX
Server: nginx/1.28.1
System: Linux VM-0-12-opencloudos 6.6.117-45.oc9.x86_64 #1 SMP Thu Dec 4 10:26:39 CST 2025 x86_64
User: www (1000)
PHP: 7.4.33
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/wwwroot/www.waciwang.com/wp-content/plugins/gutenberg/build/modules/route/index.js.map
{
  "version": 3,
  "sources": ["vendor-external:react/jsx-runtime", "vendor-external:react", "../../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js", "../../../node_modules/use-sync-external-store/shim/index.js", "../../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js", "../../../node_modules/use-sync-external-store/shim/with-selector.js", "vendor-external:react-dom", "package-external:@wordpress/private-apis", "../../../node_modules/@tanstack/store/src/scheduler.ts", "../../../node_modules/@tanstack/store/src/types.ts", "../../../node_modules/@tanstack/store/src/store.ts", "../../../node_modules/@tanstack/history/src/index.ts", "../../../node_modules/@tanstack/router-core/src/utils.ts", "../../../node_modules/tiny-invariant/dist/esm/tiny-invariant.js", "../../../node_modules/@tanstack/router-core/src/path.ts", "../../../node_modules/@tanstack/router-core/src/process-route-tree.ts", "../../../node_modules/@tanstack/router-core/src/not-found.ts", "../../../node_modules/@tanstack/router-core/src/scroll-restoration.ts", "../../../node_modules/@tanstack/router-core/src/qss.ts", "../../../node_modules/@tanstack/router-core/src/searchParams.ts", "../../../node_modules/@tanstack/router-core/src/root.ts", "../../../node_modules/@tanstack/router-core/src/redirect.ts", "../../../node_modules/@tanstack/router-core/src/lru-cache.ts", "../../../node_modules/@tanstack/router-core/src/load-matches.ts", "../../../node_modules/@tanstack/router-core/src/rewrite.ts", "../../../node_modules/@tanstack/router-core/src/router.ts", "../../../node_modules/@tanstack/router-core/src/link.ts", "../../../node_modules/@tanstack/router-core/src/route.ts", "../../../node_modules/@tanstack/react-router/src/CatchBoundary.tsx", "../../../node_modules/@tanstack/react-router/src/ClientOnly.tsx", "../../../node_modules/tiny-warning/dist/tiny-warning.esm.js", "../../../node_modules/@tanstack/react-store/src/index.ts", "../../../node_modules/@tanstack/react-router/src/routerContext.tsx", "../../../node_modules/@tanstack/react-router/src/useRouter.tsx", "../../../node_modules/@tanstack/react-router/src/useRouterState.tsx", "../../../node_modules/@tanstack/react-router/src/matchContext.tsx", "../../../node_modules/@tanstack/react-router/src/useMatch.tsx", "../../../node_modules/@tanstack/react-router/src/useLoaderData.tsx", "../../../node_modules/@tanstack/react-router/src/useLoaderDeps.tsx", "../../../node_modules/@tanstack/react-router/src/useParams.tsx", "../../../node_modules/@tanstack/react-router/src/useSearch.tsx", "../../../node_modules/@tanstack/react-router/src/useNavigate.tsx", "../../../node_modules/@tanstack/react-router/src/utils.ts", "../../../node_modules/@tanstack/react-router/src/link.tsx", "../../../node_modules/@tanstack/react-router/src/route.tsx", "../../../node_modules/@tanstack/react-router/src/fileRoute.ts", "../../../node_modules/@tanstack/react-router/src/Transitioner.tsx", "../../../node_modules/@tanstack/react-router/src/not-found.tsx", "../../../node_modules/@tanstack/react-router/src/SafeFragment.tsx", "../../../node_modules/@tanstack/react-router/src/renderRouteNotFound.tsx", "../../../node_modules/@tanstack/react-router/src/ScriptOnce.tsx", "../../../node_modules/@tanstack/react-router/src/scroll-restoration.tsx", "../../../node_modules/@tanstack/react-router/src/Match.tsx", "../../../node_modules/@tanstack/react-router/src/Matches.tsx", "../../../node_modules/@tanstack/react-router/src/router.ts", "../../../node_modules/@tanstack/react-router/src/RouterProvider.tsx", "../../../node_modules/@tanstack/react-router/src/useLocation.tsx", "../../../node_modules/@tanstack/react-router/src/useCanGoBack.ts", "../../../packages/route/src/lock-unlock.ts", "../../../packages/route/src/private-apis.ts", "../../../packages/route/src/index.ts"],
  "sourcesContent": ["module.exports = window.ReactJSXRuntime;", "module.exports = window.React;", "/**\n * @license React\n * use-sync-external-store-shim.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n  (function () {\n    function is(x, y) {\n      return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n    }\n    function useSyncExternalStore$2(subscribe, getSnapshot) {\n      didWarnOld18Alpha ||\n        void 0 === React.startTransition ||\n        ((didWarnOld18Alpha = !0),\n        console.error(\n          \"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release.\"\n        ));\n      var value = getSnapshot();\n      if (!didWarnUncachedGetSnapshot) {\n        var cachedValue = getSnapshot();\n        objectIs(value, cachedValue) ||\n          (console.error(\n            \"The result of getSnapshot should be cached to avoid an infinite loop\"\n          ),\n          (didWarnUncachedGetSnapshot = !0));\n      }\n      cachedValue = useState({\n        inst: { value: value, getSnapshot: getSnapshot }\n      });\n      var inst = cachedValue[0].inst,\n        forceUpdate = cachedValue[1];\n      useLayoutEffect(\n        function () {\n          inst.value = value;\n          inst.getSnapshot = getSnapshot;\n          checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n        },\n        [subscribe, value, getSnapshot]\n      );\n      useEffect(\n        function () {\n          checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n          return subscribe(function () {\n            checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n          });\n        },\n        [subscribe]\n      );\n      useDebugValue(value);\n      return value;\n    }\n    function checkIfSnapshotChanged(inst) {\n      var latestGetSnapshot = inst.getSnapshot;\n      inst = inst.value;\n      try {\n        var nextValue = latestGetSnapshot();\n        return !objectIs(inst, nextValue);\n      } catch (error) {\n        return !0;\n      }\n    }\n    function useSyncExternalStore$1(subscribe, getSnapshot) {\n      return getSnapshot();\n    }\n    \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n      \"function\" ===\n        typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&\n      __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());\n    var React = require(\"react\"),\n      objectIs = \"function\" === typeof Object.is ? Object.is : is,\n      useState = React.useState,\n      useEffect = React.useEffect,\n      useLayoutEffect = React.useLayoutEffect,\n      useDebugValue = React.useDebugValue,\n      didWarnOld18Alpha = !1,\n      didWarnUncachedGetSnapshot = !1,\n      shim =\n        \"undefined\" === typeof window ||\n        \"undefined\" === typeof window.document ||\n        \"undefined\" === typeof window.document.createElement\n          ? useSyncExternalStore$1\n          : useSyncExternalStore$2;\n    exports.useSyncExternalStore =\n      void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;\n    \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n      \"function\" ===\n        typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&\n      __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());\n  })();\n", "'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n  module.exports = require('../cjs/use-sync-external-store-shim.production.js');\n} else {\n  module.exports = require('../cjs/use-sync-external-store-shim.development.js');\n}\n", "/**\n * @license React\n * use-sync-external-store-shim/with-selector.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n  (function () {\n    function is(x, y) {\n      return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n    }\n    \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n      \"function\" ===\n        typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&\n      __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());\n    var React = require(\"react\"),\n      shim = require(\"use-sync-external-store/shim\"),\n      objectIs = \"function\" === typeof Object.is ? Object.is : is,\n      useSyncExternalStore = shim.useSyncExternalStore,\n      useRef = React.useRef,\n      useEffect = React.useEffect,\n      useMemo = React.useMemo,\n      useDebugValue = React.useDebugValue;\n    exports.useSyncExternalStoreWithSelector = function (\n      subscribe,\n      getSnapshot,\n      getServerSnapshot,\n      selector,\n      isEqual\n    ) {\n      var instRef = useRef(null);\n      if (null === instRef.current) {\n        var inst = { hasValue: !1, value: null };\n        instRef.current = inst;\n      } else inst = instRef.current;\n      instRef = useMemo(\n        function () {\n          function memoizedSelector(nextSnapshot) {\n            if (!hasMemo) {\n              hasMemo = !0;\n              memoizedSnapshot = nextSnapshot;\n              nextSnapshot = selector(nextSnapshot);\n              if (void 0 !== isEqual && inst.hasValue) {\n                var currentSelection = inst.value;\n                if (isEqual(currentSelection, nextSnapshot))\n                  return (memoizedSelection = currentSelection);\n              }\n              return (memoizedSelection = nextSnapshot);\n            }\n            currentSelection = memoizedSelection;\n            if (objectIs(memoizedSnapshot, nextSnapshot))\n              return currentSelection;\n            var nextSelection = selector(nextSnapshot);\n            if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))\n              return (memoizedSnapshot = nextSnapshot), currentSelection;\n            memoizedSnapshot = nextSnapshot;\n            return (memoizedSelection = nextSelection);\n          }\n          var hasMemo = !1,\n            memoizedSnapshot,\n            memoizedSelection,\n            maybeGetServerSnapshot =\n              void 0 === getServerSnapshot ? null : getServerSnapshot;\n          return [\n            function () {\n              return memoizedSelector(getSnapshot());\n            },\n            null === maybeGetServerSnapshot\n              ? void 0\n              : function () {\n                  return memoizedSelector(maybeGetServerSnapshot());\n                }\n          ];\n        },\n        [getSnapshot, getServerSnapshot, selector, isEqual]\n      );\n      var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);\n      useEffect(\n        function () {\n          inst.hasValue = !0;\n          inst.value = value;\n        },\n        [value]\n      );\n      useDebugValue(value);\n      return value;\n    };\n    \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n      \"function\" ===\n        typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&\n      __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());\n  })();\n", "'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n  module.exports = require('../cjs/use-sync-external-store-shim/with-selector.production.js');\n} else {\n  module.exports = require('../cjs/use-sync-external-store-shim/with-selector.development.js');\n}\n", "module.exports = window.ReactDOM;", "module.exports = window.wp.privateApis;", "import type { Derived } from './derived'\nimport type { Store } from './store'\n\n/**\n * This is here to solve the pyramid dependency problem where:\n *       A\n *      / \\\n *     B   C\n *      \\ /\n *       D\n *\n * Where we deeply traverse this tree, how do we avoid D being recomputed twice; once when B is updated, once when C is.\n *\n * To solve this, we create linkedDeps that allows us to sync avoid writes to the state until all of the deps have been\n * resolved.\n *\n * This is a record of stores, because derived stores are not able to write values to, but stores are\n */\nexport const __storeToDerived = new WeakMap<\n  Store<unknown>,\n  Array<Derived<unknown>>\n>()\nexport const __derivedToStore = new WeakMap<\n  Derived<unknown>,\n  Set<Store<unknown>>\n>()\n\nexport const __depsThatHaveWrittenThisTick = {\n  current: [] as Array<Derived<unknown> | Store<unknown>>,\n}\n\nlet __isFlushing = false\nlet __batchDepth = 0\nconst __pendingUpdates = new Set<Store<unknown>>()\n// Add a map to store initial values before batch\nconst __initialBatchValues = new Map<Store<unknown>, unknown>()\n\nfunction __flush_internals(relatedVals: ReadonlyArray<Derived<unknown>>) {\n  for (const derived of relatedVals) {\n    if (__depsThatHaveWrittenThisTick.current.includes(derived)) {\n      continue\n    }\n\n    __depsThatHaveWrittenThisTick.current.push(derived)\n    derived.recompute()\n\n    const stores = __derivedToStore.get(derived)\n    if (stores) {\n      for (const store of stores) {\n        const relatedLinkedDerivedVals = __storeToDerived.get(store)\n        if (!relatedLinkedDerivedVals?.length) continue\n        __flush_internals(relatedLinkedDerivedVals)\n      }\n    }\n  }\n}\n\nfunction __notifyListeners(store: Store<unknown>) {\n  const value = {\n    prevVal: store.prevState as never,\n    currentVal: store.state as never,\n  }\n  for (const listener of store.listeners) {\n    listener(value)\n  }\n}\n\nfunction __notifyDerivedListeners(derived: Derived<unknown>) {\n  const value = {\n    prevVal: derived.prevState as never,\n    currentVal: derived.state as never,\n  }\n  for (const listener of derived.listeners) {\n    listener(value)\n  }\n}\n\n/**\n * @private only to be called from `Store` on write\n */\nexport function __flush(store: Store<unknown>) {\n  // If we're starting a batch, store the initial values\n  if (__batchDepth > 0 && !__initialBatchValues.has(store)) {\n    __initialBatchValues.set(store, store.prevState)\n  }\n\n  __pendingUpdates.add(store)\n\n  if (__batchDepth > 0) return\n  if (__isFlushing) return\n\n  try {\n    __isFlushing = true\n\n    while (__pendingUpdates.size > 0) {\n      const stores = Array.from(__pendingUpdates)\n      __pendingUpdates.clear()\n\n      // First notify listeners with updated values\n      for (const store of stores) {\n        // Use initial batch values for prevState if we have them\n        const prevState = __initialBatchValues.get(store) ?? store.prevState\n        store.prevState = prevState\n        __notifyListeners(store)\n      }\n\n      // Then update all derived values\n      for (const store of stores) {\n        const derivedVals = __storeToDerived.get(store)\n        if (!derivedVals) continue\n\n        __depsThatHaveWrittenThisTick.current.push(store)\n        __flush_internals(derivedVals)\n      }\n\n      // Notify derived listeners after recomputing\n      for (const store of stores) {\n        const derivedVals = __storeToDerived.get(store)\n        if (!derivedVals) continue\n\n        for (const derived of derivedVals) {\n          __notifyDerivedListeners(derived)\n        }\n      }\n    }\n  } finally {\n    __isFlushing = false\n    __depsThatHaveWrittenThisTick.current = []\n    __initialBatchValues.clear()\n  }\n}\n\nexport function batch(fn: () => void) {\n  __batchDepth++\n  try {\n    fn()\n  } finally {\n    __batchDepth--\n    if (__batchDepth === 0) {\n      const pendingUpdateToFlush = __pendingUpdates.values().next().value\n      if (pendingUpdateToFlush) {\n        __flush(pendingUpdateToFlush) // Trigger flush of all pending updates\n      }\n    }\n  }\n}\n", "/**\n * @private\n */\nexport type AnyUpdater = (prev: any) => any\n\n/**\n * Type-safe updater that can be either a function or direct value\n */\nexport type Updater<T> = ((prev: T) => T) | T\n\n/**\n * @private\n */\nexport interface ListenerValue<T> {\n  readonly prevVal: T\n  readonly currentVal: T\n}\n\n/**\n * @private\n */\nexport type Listener<T> = (value: ListenerValue<T>) => void\n\n/**\n * Type guard to check if updater is a function\n */\nexport function isUpdaterFunction<T>(\n  updater: Updater<T>,\n): updater is (prev: T) => T {\n  return typeof updater === 'function'\n}\n", "import { __flush } from './scheduler'\nimport { isUpdaterFunction } from './types'\nimport type { AnyUpdater, Listener, Updater } from './types'\n\nexport interface StoreOptions<\n  TState,\n  TUpdater extends AnyUpdater = (cb: TState) => TState,\n> {\n  /**\n   * Replace the default update function with a custom one.\n   */\n  updateFn?: (previous: TState) => (updater: TUpdater) => TState\n  /**\n   * Called when a listener subscribes to the store.\n   *\n   * @return a function to unsubscribe the listener\n   */\n  onSubscribe?: (\n    listener: Listener<TState>,\n    store: Store<TState, TUpdater>,\n  ) => () => void\n  /**\n   * Called after the state has been updated, used to derive other state.\n   */\n  onUpdate?: () => void\n}\n\nexport class Store<\n  TState,\n  TUpdater extends AnyUpdater = (cb: TState) => TState,\n> {\n  listeners = new Set<Listener<TState>>()\n  state: TState\n  prevState: TState\n  options?: StoreOptions<TState, TUpdater>\n\n  constructor(initialState: TState, options?: StoreOptions<TState, TUpdater>) {\n    this.prevState = initialState\n    this.state = initialState\n    this.options = options\n  }\n\n  subscribe = (listener: Listener<TState>) => {\n    this.listeners.add(listener)\n    const unsub = this.options?.onSubscribe?.(listener, this)\n    return () => {\n      this.listeners.delete(listener)\n      unsub?.()\n    }\n  }\n\n  /**\n   * Update the store state safely with improved type checking\n   */\n  setState(updater: (prevState: TState) => TState): void\n  setState(updater: TState): void\n  setState(updater: TUpdater): void\n  setState(updater: Updater<TState> | TUpdater): void {\n    this.prevState = this.state\n\n    if (this.options?.updateFn) {\n      this.state = this.options.updateFn(this.prevState)(updater as TUpdater)\n    } else {\n      if (isUpdaterFunction(updater)) {\n        this.state = updater(this.prevState)\n      } else {\n        this.state = updater as TState\n      }\n    }\n\n    // Always run onUpdate, regardless of batching\n    this.options?.onUpdate?.()\n\n    // Attempt to flush\n    __flush(this as never)\n  }\n}\n", "// While the public API was clearly inspired by the \"history\" npm package,\n// This implementation attempts to be more lightweight by\n// making assumptions about the way TanStack Router works\n\nexport interface NavigateOptions {\n  ignoreBlocker?: boolean\n}\n\ntype SubscriberHistoryAction =\n  | {\n      type: Exclude<HistoryAction, 'GO'>\n    }\n  | {\n      type: 'GO'\n      index: number\n    }\n\ntype SubscriberArgs = {\n  location: HistoryLocation\n  action: SubscriberHistoryAction\n}\n\nexport interface RouterHistory {\n  location: HistoryLocation\n  length: number\n  subscribers: Set<(opts: SubscriberArgs) => void>\n  subscribe: (cb: (opts: SubscriberArgs) => void) => () => void\n  push: (path: string, state?: any, navigateOpts?: NavigateOptions) => void\n  replace: (path: string, state?: any, navigateOpts?: NavigateOptions) => void\n  go: (index: number, navigateOpts?: NavigateOptions) => void\n  back: (navigateOpts?: NavigateOptions) => void\n  forward: (navigateOpts?: NavigateOptions) => void\n  canGoBack: () => boolean\n  createHref: (href: string) => string\n  block: (blocker: NavigationBlocker) => () => void\n  flush: () => void\n  destroy: () => void\n  notify: (action: SubscriberHistoryAction) => void\n  _ignoreSubscribers?: boolean\n}\n\nexport interface HistoryLocation extends ParsedPath {\n  state: ParsedHistoryState\n}\n\nexport interface ParsedPath {\n  href: string\n  pathname: string\n  search: string\n  hash: string\n}\n\nexport interface HistoryState {}\n\nexport type ParsedHistoryState = HistoryState & {\n  key?: string // TODO: Remove in v2 - use __TSR_key instead\n  __TSR_key?: string\n  __TSR_index: number\n}\n\ntype ShouldAllowNavigation = any\n\nexport type HistoryAction = 'PUSH' | 'REPLACE' | 'FORWARD' | 'BACK' | 'GO'\n\nexport type BlockerFnArgs = {\n  currentLocation: HistoryLocation\n  nextLocation: HistoryLocation\n  action: HistoryAction\n}\n\nexport type BlockerFn = (\n  args: BlockerFnArgs,\n) => Promise<ShouldAllowNavigation> | ShouldAllowNavigation\n\nexport type NavigationBlocker = {\n  blockerFn: BlockerFn\n  enableBeforeUnload?: (() => boolean) | boolean\n}\n\ntype TryNavigateArgs = {\n  task: () => void\n  type: 'PUSH' | 'REPLACE' | 'BACK' | 'FORWARD' | 'GO'\n  navigateOpts?: NavigateOptions\n} & (\n  | {\n      type: 'PUSH' | 'REPLACE'\n      path: string\n      state: any\n    }\n  | {\n      type: 'BACK' | 'FORWARD' | 'GO'\n    }\n)\n\nconst stateIndexKey = '__TSR_index'\nconst popStateEvent = 'popstate'\nconst beforeUnloadEvent = 'beforeunload'\n\nexport function createHistory(opts: {\n  getLocation: () => HistoryLocation\n  getLength: () => number\n  pushState: (path: string, state: any) => void\n  replaceState: (path: string, state: any) => void\n  go: (n: number) => void\n  back: (ignoreBlocker: boolean) => void\n  forward: (ignoreBlocker: boolean) => void\n  createHref: (path: string) => string\n  flush?: () => void\n  destroy?: () => void\n  onBlocked?: () => void\n  getBlockers?: () => Array<NavigationBlocker>\n  setBlockers?: (blockers: Array<NavigationBlocker>) => void\n  // Avoid notifying on forward/back/go, used for browser history as we already get notified by the popstate event\n  notifyOnIndexChange?: boolean\n}): RouterHistory {\n  let location = opts.getLocation()\n  const subscribers = new Set<(opts: SubscriberArgs) => void>()\n\n  const notify = (action: SubscriberHistoryAction) => {\n    location = opts.getLocation()\n    subscribers.forEach((subscriber) => subscriber({ location, action }))\n  }\n\n  const handleIndexChange = (action: SubscriberHistoryAction) => {\n    if (opts.notifyOnIndexChange ?? true) notify(action)\n    else location = opts.getLocation()\n  }\n\n  const tryNavigation = async ({\n    task,\n    navigateOpts,\n    ...actionInfo\n  }: TryNavigateArgs) => {\n    const ignoreBlocker = navigateOpts?.ignoreBlocker ?? false\n    if (ignoreBlocker) {\n      task()\n      return\n    }\n\n    const blockers = opts.getBlockers?.() ?? []\n    const isPushOrReplace =\n      actionInfo.type === 'PUSH' || actionInfo.type === 'REPLACE'\n    if (typeof document !== 'undefined' && blockers.length && isPushOrReplace) {\n      for (const blocker of blockers) {\n        const nextLocation = parseHref(actionInfo.path, actionInfo.state)\n        const isBlocked = await blocker.blockerFn({\n          currentLocation: location,\n          nextLocation,\n          action: actionInfo.type,\n        })\n        if (isBlocked) {\n          opts.onBlocked?.()\n          return\n        }\n      }\n    }\n\n    task()\n  }\n\n  return {\n    get location() {\n      return location\n    },\n    get length() {\n      return opts.getLength()\n    },\n    subscribers,\n    subscribe: (cb: (opts: SubscriberArgs) => void) => {\n      subscribers.add(cb)\n\n      return () => {\n        subscribers.delete(cb)\n      }\n    },\n    push: (path, state, navigateOpts) => {\n      const currentIndex = location.state[stateIndexKey]\n      state = assignKeyAndIndex(currentIndex + 1, state)\n      tryNavigation({\n        task: () => {\n          opts.pushState(path, state)\n          notify({ type: 'PUSH' })\n        },\n        navigateOpts,\n        type: 'PUSH',\n        path,\n        state,\n      })\n    },\n    replace: (path, state, navigateOpts) => {\n      const currentIndex = location.state[stateIndexKey]\n      state = assignKeyAndIndex(currentIndex, state)\n      tryNavigation({\n        task: () => {\n          opts.replaceState(path, state)\n          notify({ type: 'REPLACE' })\n        },\n        navigateOpts,\n        type: 'REPLACE',\n        path,\n        state,\n      })\n    },\n    go: (index, navigateOpts) => {\n      tryNavigation({\n        task: () => {\n          opts.go(index)\n          handleIndexChange({ type: 'GO', index })\n        },\n        navigateOpts,\n        type: 'GO',\n      })\n    },\n    back: (navigateOpts) => {\n      tryNavigation({\n        task: () => {\n          opts.back(navigateOpts?.ignoreBlocker ?? false)\n          handleIndexChange({ type: 'BACK' })\n        },\n        navigateOpts,\n        type: 'BACK',\n      })\n    },\n    forward: (navigateOpts) => {\n      tryNavigation({\n        task: () => {\n          opts.forward(navigateOpts?.ignoreBlocker ?? false)\n          handleIndexChange({ type: 'FORWARD' })\n        },\n        navigateOpts,\n        type: 'FORWARD',\n      })\n    },\n    canGoBack: () => location.state[stateIndexKey] !== 0,\n    createHref: (str) => opts.createHref(str),\n    block: (blocker) => {\n      if (!opts.setBlockers) return () => {}\n      const blockers = opts.getBlockers?.() ?? []\n      opts.setBlockers([...blockers, blocker])\n\n      return () => {\n        const blockers = opts.getBlockers?.() ?? []\n        opts.setBlockers?.(blockers.filter((b) => b !== blocker))\n      }\n    },\n    flush: () => opts.flush?.(),\n    destroy: () => opts.destroy?.(),\n    notify,\n  }\n}\n\nfunction assignKeyAndIndex(index: number, state: HistoryState | undefined) {\n  if (!state) {\n    state = {} as HistoryState\n  }\n  const key = createRandomKey()\n  return {\n    ...state,\n    key, // TODO: Remove in v2 - use __TSR_key instead\n    __TSR_key: key,\n    [stateIndexKey]: index,\n  } as ParsedHistoryState\n}\n\n/**\n * Creates a history object that can be used to interact with the browser's\n * navigation. This is a lightweight API wrapping the browser's native methods.\n * It is designed to work with TanStack Router, but could be used as a standalone API as well.\n * IMPORTANT: This API implements history throttling via a microtask to prevent\n * excessive calls to the history API. In some browsers, calling history.pushState or\n * history.replaceState in quick succession can cause the browser to ignore subsequent\n * calls. This API smooths out those differences and ensures that your application\n * state will *eventually* match the browser state. In most cases, this is not a problem,\n * but if you need to ensure that the browser state is up to date, you can use the\n * `history.flush` method to immediately flush all pending state changes to the browser URL.\n * @param opts\n * @param opts.getHref A function that returns the current href (path + search + hash)\n * @param opts.createHref A function that takes a path and returns a href (path + search + hash)\n * @returns A history instance\n */\nexport function createBrowserHistory(opts?: {\n  parseLocation?: () => HistoryLocation\n  createHref?: (path: string) => string\n  window?: any\n}): RouterHistory {\n  const win =\n    opts?.window ??\n    (typeof document !== 'undefined' ? window : (undefined as any))\n\n  const originalPushState = win.history.pushState\n  const originalReplaceState = win.history.replaceState\n\n  let blockers: Array<NavigationBlocker> = []\n  const _getBlockers = () => blockers\n  const _setBlockers = (newBlockers: Array<NavigationBlocker>) =>\n    (blockers = newBlockers)\n\n  const createHref = opts?.createHref ?? ((path) => path)\n  const parseLocation =\n    opts?.parseLocation ??\n    (() =>\n      parseHref(\n        `${win.location.pathname}${win.location.search}${win.location.hash}`,\n        win.history.state,\n      ))\n\n  // Ensure there is always a key to start\n  if (!win.history.state?.__TSR_key && !win.history.state?.key) {\n    const addedKey = createRandomKey()\n    win.history.replaceState(\n      {\n        [stateIndexKey]: 0,\n        key: addedKey, // TODO: Remove in v2 - use __TSR_key instead\n        __TSR_key: addedKey,\n      },\n      '',\n    )\n  }\n\n  let currentLocation = parseLocation()\n  let rollbackLocation: HistoryLocation | undefined\n\n  let nextPopIsGo = false\n  let ignoreNextPop = false\n  let skipBlockerNextPop = false\n  let ignoreNextBeforeUnload = false\n\n  const getLocation = () => currentLocation\n\n  let next:\n    | undefined\n    | {\n        // This is the latest location that we were attempting to push/replace\n        href: string\n        // This is the latest state that we were attempting to push/replace\n        state: any\n        // This is the latest type that we were attempting to push/replace\n        isPush: boolean\n      }\n\n  // We need to track the current scheduled update to prevent\n  // multiple updates from being scheduled at the same time.\n  let scheduled: Promise<void> | undefined\n\n  // This function flushes the next update to the browser history\n  const flush = () => {\n    if (!next) {\n      return\n    }\n\n    // We need to ignore any updates to the subscribers while we update the browser history\n    history._ignoreSubscribers = true\n\n    // Update the browser history\n    ;(next.isPush ? win.history.pushState : win.history.replaceState)(\n      next.state,\n      '',\n      next.href,\n    )\n\n    // Stop ignoring subscriber updates\n    history._ignoreSubscribers = false\n\n    // Reset the nextIsPush flag and clear the scheduled update\n    next = undefined\n    scheduled = undefined\n    rollbackLocation = undefined\n  }\n\n  // This function queues up a call to update the browser history\n  const queueHistoryAction = (\n    type: 'push' | 'replace',\n    destHref: string,\n    state: any,\n  ) => {\n    const href = createHref(destHref)\n\n    if (!scheduled) {\n      rollbackLocation = currentLocation\n    }\n\n    // Update the location in memory\n    currentLocation = parseHref(destHref, state)\n\n    // Keep track of the next location we need to flush to the URL\n    next = {\n      href,\n      state,\n      isPush: next?.isPush || type === 'push',\n    }\n\n    if (!scheduled) {\n      // Schedule an update to the browser history\n      scheduled = Promise.resolve().then(() => flush())\n    }\n  }\n\n  // NOTE: this function can probably be removed\n  const onPushPop = (type: 'PUSH' | 'REPLACE') => {\n    currentLocation = parseLocation()\n    history.notify({ type })\n  }\n\n  const onPushPopEvent = async () => {\n    if (ignoreNextPop) {\n      ignoreNextPop = false\n      return\n    }\n\n    const nextLocation = parseLocation()\n    const delta =\n      nextLocation.state[stateIndexKey] - currentLocation.state[stateIndexKey]\n    const isForward = delta === 1\n    const isBack = delta === -1\n    const isGo = (!isForward && !isBack) || nextPopIsGo\n    nextPopIsGo = false\n\n    const action = isGo ? 'GO' : isBack ? 'BACK' : 'FORWARD'\n    const notify: SubscriberHistoryAction = isGo\n      ? {\n          type: 'GO',\n          index: delta,\n        }\n      : {\n          type: isBack ? 'BACK' : 'FORWARD',\n        }\n\n    if (skipBlockerNextPop) {\n      skipBlockerNextPop = false\n    } else {\n      const blockers = _getBlockers()\n      if (typeof document !== 'undefined' && blockers.length) {\n        for (const blocker of blockers) {\n          const isBlocked = await blocker.blockerFn({\n            currentLocation,\n            nextLocation,\n            action,\n          })\n          if (isBlocked) {\n            ignoreNextPop = true\n            win.history.go(1)\n            history.notify(notify)\n            return\n          }\n        }\n      }\n    }\n\n    currentLocation = parseLocation()\n    history.notify(notify)\n  }\n\n  const onBeforeUnload = (e: BeforeUnloadEvent) => {\n    if (ignoreNextBeforeUnload) {\n      ignoreNextBeforeUnload = false\n      return\n    }\n\n    let shouldBlock = false\n\n    // If one blocker has a non-disabled beforeUnload, we should block\n    const blockers = _getBlockers()\n    if (typeof document !== 'undefined' && blockers.length) {\n      for (const blocker of blockers) {\n        const shouldHaveBeforeUnload = blocker.enableBeforeUnload ?? true\n        if (shouldHaveBeforeUnload === true) {\n          shouldBlock = true\n          break\n        }\n\n        if (\n          typeof shouldHaveBeforeUnload === 'function' &&\n          shouldHaveBeforeUnload() === true\n        ) {\n          shouldBlock = true\n          break\n        }\n      }\n    }\n\n    if (shouldBlock) {\n      e.preventDefault()\n      return (e.returnValue = '')\n    }\n    return\n  }\n\n  const history = createHistory({\n    getLocation,\n    getLength: () => win.history.length,\n    pushState: (href, state) => queueHistoryAction('push', href, state),\n    replaceState: (href, state) => queueHistoryAction('replace', href, state),\n    back: (ignoreBlocker) => {\n      if (ignoreBlocker) skipBlockerNextPop = true\n      ignoreNextBeforeUnload = true\n      return win.history.back()\n    },\n    forward: (ignoreBlocker) => {\n      if (ignoreBlocker) skipBlockerNextPop = true\n      ignoreNextBeforeUnload = true\n      win.history.forward()\n    },\n    go: (n) => {\n      nextPopIsGo = true\n      win.history.go(n)\n    },\n    createHref: (href) => createHref(href),\n    flush,\n    destroy: () => {\n      win.history.pushState = originalPushState\n      win.history.replaceState = originalReplaceState\n      win.removeEventListener(beforeUnloadEvent, onBeforeUnload, {\n        capture: true,\n      })\n      win.removeEventListener(popStateEvent, onPushPopEvent)\n    },\n    onBlocked: () => {\n      // If a navigation is blocked, we need to rollback the location\n      // that we optimistically updated in memory.\n      if (rollbackLocation && currentLocation !== rollbackLocation) {\n        currentLocation = rollbackLocation\n      }\n    },\n    getBlockers: _getBlockers,\n    setBlockers: _setBlockers,\n    notifyOnIndexChange: false,\n  })\n\n  win.addEventListener(beforeUnloadEvent, onBeforeUnload, { capture: true })\n  win.addEventListener(popStateEvent, onPushPopEvent)\n\n  win.history.pushState = function (...args: Array<any>) {\n    const res = originalPushState.apply(win.history, args as any)\n    if (!history._ignoreSubscribers) onPushPop('PUSH')\n    return res\n  }\n\n  win.history.replaceState = function (...args: Array<any>) {\n    const res = originalReplaceState.apply(win.history, args as any)\n    if (!history._ignoreSubscribers) onPushPop('REPLACE')\n    return res\n  }\n\n  return history\n}\n\n/**\n * Create a hash-based history implementation.\n * Useful for static hosts or environments without server URL rewriting.\n * @link https://tanstack.com/router/latest/docs/framework/react/guide/history-types\n */\nexport function createHashHistory(opts?: { window?: any }): RouterHistory {\n  const win =\n    opts?.window ??\n    (typeof document !== 'undefined' ? window : (undefined as any))\n  return createBrowserHistory({\n    window: win,\n    parseLocation: () => {\n      const hashSplit = win.location.hash.split('#').slice(1)\n      const pathPart = hashSplit[0] ?? '/'\n      const searchPart = win.location.search\n      const hashEntries = hashSplit.slice(1)\n      const hashPart =\n        hashEntries.length === 0 ? '' : `#${hashEntries.join('#')}`\n      const hashHref = `${pathPart}${searchPart}${hashPart}`\n      return parseHref(hashHref, win.history.state)\n    },\n    createHref: (href) =>\n      `${win.location.pathname}${win.location.search}#${href}`,\n  })\n}\n\n/**\n * Create an in-memory history implementation.\n * Ideal for server rendering, tests, and non-DOM environments.\n * @link https://tanstack.com/router/latest/docs/framework/react/guide/history-types\n */\nexport function createMemoryHistory(\n  opts: {\n    initialEntries: Array<string>\n    initialIndex?: number\n  } = {\n    initialEntries: ['/'],\n  },\n): RouterHistory {\n  const entries = opts.initialEntries\n  let index = opts.initialIndex\n    ? Math.min(Math.max(opts.initialIndex, 0), entries.length - 1)\n    : entries.length - 1\n  const states = entries.map((_entry, index) =>\n    assignKeyAndIndex(index, undefined),\n  )\n\n  const getLocation = () => parseHref(entries[index]!, states[index])\n\n  return createHistory({\n    getLocation,\n    getLength: () => entries.length,\n    pushState: (path, state) => {\n      // Removes all subsequent entries after the current index to start a new branch\n      if (index < entries.length - 1) {\n        entries.splice(index + 1)\n        states.splice(index + 1)\n      }\n      states.push(state)\n      entries.push(path)\n      index = Math.max(entries.length - 1, 0)\n    },\n    replaceState: (path, state) => {\n      states[index] = state\n      entries[index] = path\n    },\n    back: () => {\n      index = Math.max(index - 1, 0)\n    },\n    forward: () => {\n      index = Math.min(index + 1, entries.length - 1)\n    },\n    go: (n) => {\n      index = Math.min(Math.max(index + n, 0), entries.length - 1)\n    },\n    createHref: (path) => path,\n  })\n}\n\nexport function parseHref(\n  href: string,\n  state: ParsedHistoryState | undefined,\n): HistoryLocation {\n  const hashIndex = href.indexOf('#')\n  const searchIndex = href.indexOf('?')\n\n  const addedKey = createRandomKey()\n\n  return {\n    href,\n    pathname: href.substring(\n      0,\n      hashIndex > 0\n        ? searchIndex > 0\n          ? Math.min(hashIndex, searchIndex)\n          : hashIndex\n        : searchIndex > 0\n          ? searchIndex\n          : href.length,\n    ),\n    hash: hashIndex > -1 ? href.substring(hashIndex) : '',\n    search:\n      searchIndex > -1\n        ? href.slice(searchIndex, hashIndex === -1 ? undefined : hashIndex)\n        : '',\n    state: state || { [stateIndexKey]: 0, key: addedKey, __TSR_key: addedKey },\n  }\n}\n\n// Thanks co-pilot!\nfunction createRandomKey() {\n  return (Math.random() + 1).toString(36).substring(7)\n}\n", "import type { RouteIds } from './routeInfo'\nimport type { AnyRouter } from './router'\n\nexport type Awaitable<T> = T | Promise<T>\nexport type NoInfer<T> = [T][T extends any ? 0 : never]\nexport type IsAny<TValue, TYesResult, TNoResult = TValue> = 1 extends 0 & TValue\n  ? TYesResult\n  : TNoResult\n\nexport type PickAsRequired<TValue, TKey extends keyof TValue> = Omit<\n  TValue,\n  TKey\n> &\n  Required<Pick<TValue, TKey>>\n\nexport type PickRequired<T> = {\n  [K in keyof T as undefined extends T[K] ? never : K]: T[K]\n}\n\nexport type PickOptional<T> = {\n  [K in keyof T as undefined extends T[K] ? K : never]: T[K]\n}\n\n// from https://stackoverflow.com/a/76458160\nexport type WithoutEmpty<T> = T extends any ? ({} extends T ? never : T) : never\n\nexport type Expand<T> = T extends object\n  ? T extends infer O\n    ? O extends Function\n      ? O\n      : { [K in keyof O]: O[K] }\n    : never\n  : T\n\nexport type DeepPartial<T> = T extends object\n  ? {\n      [P in keyof T]?: DeepPartial<T[P]>\n    }\n  : T\n\nexport type MakeDifferenceOptional<TLeft, TRight> = keyof TLeft &\n  keyof TRight extends never\n  ? TRight\n  : Omit<TRight, keyof TLeft & keyof TRight> & {\n      [K in keyof TLeft & keyof TRight]?: TRight[K]\n    }\n\n// from https://stackoverflow.com/a/53955431\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport type IsUnion<T, U extends T = T> = (\n  T extends any ? (U extends T ? false : true) : never\n) extends false\n  ? false\n  : true\n\nexport type IsNonEmptyObject<T> = T extends object\n  ? keyof T extends never\n    ? false\n    : true\n  : false\n\nexport type Assign<TLeft, TRight> = TLeft extends any\n  ? TRight extends any\n    ? IsNonEmptyObject<TLeft> extends false\n      ? TRight\n      : IsNonEmptyObject<TRight> extends false\n        ? TLeft\n        : keyof TLeft & keyof TRight extends never\n          ? TLeft & TRight\n          : Omit<TLeft, keyof TRight> & TRight\n    : never\n  : never\n\nexport type IntersectAssign<TLeft, TRight> = TLeft extends any\n  ? TRight extends any\n    ? IsNonEmptyObject<TLeft> extends false\n      ? TRight\n      : IsNonEmptyObject<TRight> extends false\n        ? TLeft\n        : TRight & TLeft\n    : never\n  : never\n\nexport type Timeout = ReturnType<typeof setTimeout>\n\nexport type Updater<TPrevious, TResult = TPrevious> =\n  | TResult\n  | ((prev?: TPrevious) => TResult)\n\nexport type NonNullableUpdater<TPrevious, TResult = TPrevious> =\n  | TResult\n  | ((prev: TPrevious) => TResult)\n\nexport type ExtractObjects<TUnion> = TUnion extends MergeAllPrimitive\n  ? never\n  : TUnion\n\nexport type PartialMergeAllObject<TUnion> =\n  ExtractObjects<TUnion> extends infer TObj\n    ? [TObj] extends [never]\n      ? never\n      : {\n          [TKey in TObj extends any ? keyof TObj : never]?: TObj extends any\n            ? TKey extends keyof TObj\n              ? TObj[TKey]\n              : never\n            : never\n        }\n    : never\n\nexport type MergeAllPrimitive =\n  | ReadonlyArray<any>\n  | number\n  | string\n  | bigint\n  | boolean\n  | symbol\n  | undefined\n  | null\n\nexport type ExtractPrimitives<TUnion> = TUnion extends MergeAllPrimitive\n  ? TUnion\n  : TUnion extends object\n    ? never\n    : TUnion\n\nexport type PartialMergeAll<TUnion> =\n  | ExtractPrimitives<TUnion>\n  | PartialMergeAllObject<TUnion>\n\nexport type Constrain<T, TConstraint, TDefault = TConstraint> =\n  | (T extends TConstraint ? T : never)\n  | TDefault\n\nexport type ConstrainLiteral<T, TConstraint, TDefault = TConstraint> =\n  | (T & TConstraint)\n  | TDefault\n\n/**\n * To be added to router types\n */\nexport type UnionToIntersection<T> = (\n  T extends any ? (arg: T) => any : never\n) extends (arg: infer T) => any\n  ? T\n  : never\n\n/**\n * Merges everything in a union into one object.\n * This mapped type is homomorphic which means it preserves stuff! :)\n */\nexport type MergeAllObjects<\n  TUnion,\n  TIntersected = UnionToIntersection<ExtractObjects<TUnion>>,\n> = [keyof TIntersected] extends [never]\n  ? never\n  : {\n      [TKey in keyof TIntersected]: TUnion extends any\n        ? TUnion[TKey & keyof TUnion]\n        : never\n    }\n\nexport type MergeAll<TUnion> =\n  | MergeAllObjects<TUnion>\n  | ExtractPrimitives<TUnion>\n\nexport type ValidateJSON<T> = ((...args: Array<any>) => any) extends T\n  ? unknown extends T\n    ? never\n    : 'Function is not serializable'\n  : { [K in keyof T]: ValidateJSON<T[K]> }\n\nexport type LooseReturnType<T> = T extends (\n  ...args: Array<any>\n) => infer TReturn\n  ? TReturn\n  : never\n\nexport type LooseAsyncReturnType<T> = T extends (\n  ...args: Array<any>\n) => infer TReturn\n  ? TReturn extends Promise<infer TReturn>\n    ? TReturn\n    : TReturn\n  : never\n\n/**\n * Return the last element of an array.\n * Intended for non-empty arrays used within router internals.\n */\nexport function last<T>(arr: Array<T>) {\n  return arr[arr.length - 1]\n}\n\nfunction isFunction(d: any): d is Function {\n  return typeof d === 'function'\n}\n\n/**\n * Apply a value-or-updater to a previous value.\n * Accepts either a literal value or a function of the previous value.\n */\nexport function functionalUpdate<TPrevious, TResult = TPrevious>(\n  updater: Updater<TPrevious, TResult> | NonNullableUpdater<TPrevious, TResult>,\n  previous: TPrevious,\n): TResult {\n  if (isFunction(updater)) {\n    return updater(previous)\n  }\n\n  return updater\n}\n\nconst hasOwn = Object.prototype.hasOwnProperty\n\n/**\n * This function returns `prev` if `_next` is deeply equal.\n * If not, it will replace any deeply equal children of `b` with those of `a`.\n * This can be used for structural sharing between immutable JSON values for example.\n * Do not use this with signals\n */\nexport function replaceEqualDeep<T>(prev: any, _next: T): T {\n  if (prev === _next) {\n    return prev\n  }\n\n  const next = _next as any\n\n  const array = isPlainArray(prev) && isPlainArray(next)\n\n  if (!array && !(isPlainObject(prev) && isPlainObject(next))) return next\n\n  const prevItems = array ? prev : getEnumerableOwnKeys(prev)\n  if (!prevItems) return next\n  const nextItems = array ? next : getEnumerableOwnKeys(next)\n  if (!nextItems) return next\n  const prevSize = prevItems.length\n  const nextSize = nextItems.length\n  const copy: any = array ? new Array(nextSize) : {}\n\n  let equalItems = 0\n\n  for (let i = 0; i < nextSize; i++) {\n    const key = array ? i : (nextItems[i] as any)\n    const p = prev[key]\n    const n = next[key]\n\n    if (p === n) {\n      copy[key] = p\n      if (array ? i < prevSize : hasOwn.call(prev, key)) equalItems++\n      continue\n    }\n\n    if (\n      p === null ||\n      n === null ||\n      typeof p !== 'object' ||\n      typeof n !== 'object'\n    ) {\n      copy[key] = n\n      continue\n    }\n\n    const v = replaceEqualDeep(p, n)\n    copy[key] = v\n    if (v === p) equalItems++\n  }\n\n  return prevSize === nextSize && equalItems === prevSize ? prev : copy\n}\n\n/**\n * Equivalent to `Reflect.ownKeys`, but ensures that objects are \"clone-friendly\":\n * will return false if object has any non-enumerable properties.\n */\nfunction getEnumerableOwnKeys(o: object) {\n  const keys = []\n  const names = Object.getOwnPropertyNames(o)\n  for (const name of names) {\n    if (!Object.prototype.propertyIsEnumerable.call(o, name)) return false\n    keys.push(name)\n  }\n  const symbols = Object.getOwnPropertySymbols(o)\n  for (const symbol of symbols) {\n    if (!Object.prototype.propertyIsEnumerable.call(o, symbol)) return false\n    keys.push(symbol)\n  }\n  return keys\n}\n\n// Copied from: https://github.com/jonschlinkert/is-plain-object\nexport function isPlainObject(o: any) {\n  if (!hasObjectPrototype(o)) {\n    return false\n  }\n\n  // If has modified constructor\n  const ctor = o.constructor\n  if (typeof ctor === 'undefined') {\n    return true\n  }\n\n  // If has modified prototype\n  const prot = ctor.prototype\n  if (!hasObjectPrototype(prot)) {\n    return false\n  }\n\n  // If constructor does not have an Object-specific method\n  if (!prot.hasOwnProperty('isPrototypeOf')) {\n    return false\n  }\n\n  // Most likely a plain Object\n  return true\n}\n\nfunction hasObjectPrototype(o: any) {\n  return Object.prototype.toString.call(o) === '[object Object]'\n}\n\n/**\n * Check if a value is a \"plain\" array (no extra enumerable keys).\n */\nexport function isPlainArray(value: unknown): value is Array<unknown> {\n  return Array.isArray(value) && value.length === Object.keys(value).length\n}\n\n/**\n * Perform a deep equality check with options for partial comparison and\n * ignoring `undefined` values. Optimized for router state comparisons.\n */\nexport function deepEqual(\n  a: any,\n  b: any,\n  opts?: { partial?: boolean; ignoreUndefined?: boolean },\n): boolean {\n  if (a === b) {\n    return true\n  }\n\n  if (typeof a !== typeof b) {\n    return false\n  }\n\n  if (Array.isArray(a) && Array.isArray(b)) {\n    if (a.length !== b.length) return false\n    for (let i = 0, l = a.length; i < l; i++) {\n      if (!deepEqual(a[i], b[i], opts)) return false\n    }\n    return true\n  }\n\n  if (isPlainObject(a) && isPlainObject(b)) {\n    const ignoreUndefined = opts?.ignoreUndefined ?? true\n\n    if (opts?.partial) {\n      for (const k in b) {\n        if (!ignoreUndefined || b[k] !== undefined) {\n          if (!deepEqual(a[k], b[k], opts)) return false\n        }\n      }\n      return true\n    }\n\n    let aCount = 0\n    if (!ignoreUndefined) {\n      aCount = Object.keys(a).length\n    } else {\n      for (const k in a) {\n        if (a[k] !== undefined) aCount++\n      }\n    }\n\n    let bCount = 0\n    for (const k in b) {\n      if (!ignoreUndefined || b[k] !== undefined) {\n        bCount++\n        if (bCount > aCount || !deepEqual(a[k], b[k], opts)) return false\n      }\n    }\n\n    return aCount === bCount\n  }\n\n  return false\n}\n\nexport type StringLiteral<T> = T extends string\n  ? string extends T\n    ? string\n    : T\n  : never\n\nexport type ThrowOrOptional<T, TThrow extends boolean> = TThrow extends true\n  ? T\n  : T | undefined\n\nexport type StrictOrFrom<\n  TRouter extends AnyRouter,\n  TFrom,\n  TStrict extends boolean = true,\n> = TStrict extends false\n  ? {\n      from?: never\n      strict: TStrict\n    }\n  : {\n      from: ConstrainLiteral<TFrom, RouteIds<TRouter['routeTree']>>\n      strict?: TStrict\n    }\n\nexport type ThrowConstraint<\n  TStrict extends boolean,\n  TThrow extends boolean,\n> = TStrict extends false ? (TThrow extends true ? never : TThrow) : TThrow\n\nexport type ControlledPromise<T> = Promise<T> & {\n  resolve: (value: T) => void\n  reject: (value: any) => void\n  status: 'pending' | 'resolved' | 'rejected'\n  value?: T\n}\n\n/**\n * Create a promise with exposed resolve/reject and status fields.\n * Useful for coordinating async router lifecycle operations.\n */\nexport function createControlledPromise<T>(onResolve?: (value: T) => void) {\n  let resolveLoadPromise!: (value: T) => void\n  let rejectLoadPromise!: (value: any) => void\n\n  const controlledPromise = new Promise<T>((resolve, reject) => {\n    resolveLoadPromise = resolve\n    rejectLoadPromise = reject\n  }) as ControlledPromise<T>\n\n  controlledPromise.status = 'pending'\n\n  controlledPromise.resolve = (value: T) => {\n    controlledPromise.status = 'resolved'\n    controlledPromise.value = value\n    resolveLoadPromise(value)\n    onResolve?.(value)\n  }\n\n  controlledPromise.reject = (e) => {\n    controlledPromise.status = 'rejected'\n    rejectLoadPromise(e)\n  }\n\n  return controlledPromise\n}\n\n/**\n * Heuristically detect dynamic import \"module not found\" errors\n * across major browsers for lazy route component handling.\n */\nexport function isModuleNotFoundError(error: any): boolean {\n  // chrome: \"Failed to fetch dynamically imported module: http://localhost:5173/src/routes/posts.index.tsx?tsr-split\"\n  // firefox: \"error loading dynamically imported module: http://localhost:5173/src/routes/posts.index.tsx?tsr-split\"\n  // safari: \"Importing a module script failed.\"\n  if (typeof error?.message !== 'string') return false\n  return (\n    error.message.startsWith('Failed to fetch dynamically imported module') ||\n    error.message.startsWith('error loading dynamically imported module') ||\n    error.message.startsWith('Importing a module script failed')\n  )\n}\n\nexport function isPromise<T>(\n  value: Promise<Awaited<T>> | T,\n): value is Promise<Awaited<T>> {\n  return Boolean(\n    value &&\n      typeof value === 'object' &&\n      typeof (value as Promise<T>).then === 'function',\n  )\n}\n\nexport function findLast<T>(\n  array: ReadonlyArray<T>,\n  predicate: (item: T) => boolean,\n): T | undefined {\n  for (let i = array.length - 1; i >= 0; i--) {\n    const item = array[i]!\n    if (predicate(item)) return item\n  }\n  return undefined\n}\n\nconst DECODE_IGNORE_LIST = Array.from(\n  new Map([\n    ['%', '%25'],\n    ['\\\\', '%5C'],\n    ['/', '%2F'],\n    [';', '%3B'],\n    [':', '%3A'],\n    ['@', '%40'],\n    ['&', '%26'],\n    ['=', '%3D'],\n    ['+', '%2B'],\n    ['$', '%24'],\n    [',', '%2C'],\n  ]).values(),\n)\n\nexport function decodePathSegment(\n  part: string,\n  decodeIgnore: Array<string> = DECODE_IGNORE_LIST,\n  startIndex = 0,\n): string {\n  function decode(part: string): string {\n    try {\n      return decodeURIComponent(part)\n    } catch {\n      // if the decoding fails, try to decode the various parts leaving the malformed tags in place\n      return part.replaceAll(/%[0-9A-Fa-f]{2}/g, (match) => {\n        try {\n          return decodeURIComponent(match)\n        } catch {\n          return match\n        }\n      })\n    }\n  }\n\n  // if the path segment does not contain any encoded uri components return the path as is\n  if (part === '' || !part.match(/%[0-9A-Fa-f]{2}/g)) return part\n\n  // decode the path / path segment by splitting it into parts defined by the ignore list.\n  // once these pieces have been decoded, join them back together to form the final decoded path segment with the ignored character in place.\n  // we walk through the ignore list linearly, breaking the segment up into pieces and decoding each piece individually.\n  // use index traversal to avoid making unnecessary copies of the array.\n  for (let i = startIndex; i < decodeIgnore.length; i++) {\n    const char = decodeIgnore[i]\n\n    // check if the part includes the current ignore character\n    // if it doesn't continue to the next ignore character\n    if (char && part.includes(char)) {\n      // split the part into pieces that needs to be checked and decoded\n      const partsToDecode = part.split(char)\n      const partsToJoin: Array<string> = []\n\n      // now check and decode each piece individually taking into consideration the remaining ignored characters.\n      // since we are walking through the list linearly, we only need to consider ignore items not yet traversed.\n      for (const partToDecode of partsToDecode) {\n        // once we have traversed the entire ignore list, each decoded part is returned.\n        partsToJoin.push(decodePathSegment(partToDecode, decodeIgnore, i + 1))\n      }\n\n      // and join them back together to form the final decoded path segment with the ignored character in place.\n      return partsToJoin.join(char)\n    }\n  }\n\n  // once we have reached the end of the ignore list, we start walking back returning each decoded part.\n  // should there be no matching characters, the path segment as a whole will be decoded.\n  return decode(part)\n}\n", "var isProduction = process.env.NODE_ENV === 'production';\nvar prefix = 'Invariant failed';\nfunction invariant(condition, message) {\n    if (condition) {\n        return;\n    }\n    if (isProduction) {\n        throw new Error(prefix);\n    }\n    var provided = typeof message === 'function' ? message() : message;\n    var value = provided ? \"\".concat(prefix, \": \").concat(provided) : prefix;\n    throw new Error(value);\n}\n\nexport { invariant as default };\n", "import { decodePathSegment, last } from './utils'\nimport type { LRUCache } from './lru-cache'\nimport type { MatchLocation } from './RouterProvider'\nimport type { AnyPathParams } from './route'\n\nexport const SEGMENT_TYPE_PATHNAME = 0\nexport const SEGMENT_TYPE_PARAM = 1\nexport const SEGMENT_TYPE_WILDCARD = 2\nexport const SEGMENT_TYPE_OPTIONAL_PARAM = 3\n\nexport interface Segment {\n  readonly type:\n    | typeof SEGMENT_TYPE_PATHNAME\n    | typeof SEGMENT_TYPE_PARAM\n    | typeof SEGMENT_TYPE_WILDCARD\n    | typeof SEGMENT_TYPE_OPTIONAL_PARAM\n  readonly value: string\n  readonly prefixSegment?: string\n  readonly suffixSegment?: string\n  // Indicates if there is a static segment after this required/optional param\n  readonly hasStaticAfter?: boolean\n}\n\n/** Join path segments, cleaning duplicate slashes between parts. */\n/** Join path segments, cleaning duplicate slashes between parts. */\nexport function joinPaths(paths: Array<string | undefined>) {\n  return cleanPath(\n    paths\n      .filter((val) => {\n        return val !== undefined\n      })\n      .join('/'),\n  )\n}\n\n/** Remove repeated slashes from a path string. */\n/** Remove repeated slashes from a path string. */\nexport function cleanPath(path: string) {\n  // remove double slashes\n  return path.replace(/\\/{2,}/g, '/')\n}\n\n/** Trim leading slashes (except preserving root '/'). */\n/** Trim leading slashes (except preserving root '/'). */\nexport function trimPathLeft(path: string) {\n  return path === '/' ? path : path.replace(/^\\/{1,}/, '')\n}\n\n/** Trim trailing slashes (except preserving root '/'). */\n/** Trim trailing slashes (except preserving root '/'). */\nexport function trimPathRight(path: string) {\n  return path === '/' ? path : path.replace(/\\/{1,}$/, '')\n}\n\n/** Trim both leading and trailing slashes. */\n/** Trim both leading and trailing slashes. */\nexport function trimPath(path: string) {\n  return trimPathRight(trimPathLeft(path))\n}\n\n/** Remove a trailing slash from value when appropriate for comparisons. */\nexport function removeTrailingSlash(value: string, basepath: string): string {\n  if (value?.endsWith('/') && value !== '/' && value !== `${basepath}/`) {\n    return value.slice(0, -1)\n  }\n  return value\n}\n\n// intended to only compare path name\n// see the usage in the isActive under useLinkProps\n// /sample/path1 = /sample/path1/\n// /sample/path1/some <> /sample/path1\n/**\n * Compare two pathnames for exact equality after normalizing trailing slashes\n * relative to the provided `basepath`.\n */\n/**\n * Compare two pathnames for exact equality after normalizing trailing slashes\n * relative to the provided `basepath`.\n */\nexport function exactPathTest(\n  pathName1: string,\n  pathName2: string,\n  basepath: string,\n): boolean {\n  return (\n    removeTrailingSlash(pathName1, basepath) ===\n    removeTrailingSlash(pathName2, basepath)\n  )\n}\n\n// When resolving relative paths, we treat all paths as if they are trailing slash\n// documents. All trailing slashes are removed after the path is resolved.\n// Here are a few examples:\n//\n// /a/b/c + ./d = /a/b/c/d\n// /a/b/c + ../d = /a/b/d\n// /a/b/c + ./d/ = /a/b/c/d\n// /a/b/c + ../d/ = /a/b/d\n// /a/b/c + ./ = /a/b/c\n//\n// Absolute paths that start with `/` short circuit the resolution process to the root\n// path.\n//\n// Here are some examples:\n//\n// /a/b/c + /d = /d\n// /a/b/c + /d/ = /d\n// /a/b/c + / = /\n//\n// Non-.-prefixed paths are still treated as relative paths, resolved like `./`\n//\n// Here are some examples:\n//\n// /a/b/c + d = /a/b/c/d\n// /a/b/c + d/ = /a/b/c/d\n// /a/b/c + d/e = /a/b/c/d/e\ninterface ResolvePathOptions {\n  base: string\n  to: string\n  trailingSlash?: 'always' | 'never' | 'preserve'\n  parseCache?: ParsePathnameCache\n}\n\nfunction segmentToString(segment: Segment): string {\n  const { type, value } = segment\n  if (type === SEGMENT_TYPE_PATHNAME) {\n    return value\n  }\n\n  const { prefixSegment, suffixSegment } = segment\n\n  if (type === SEGMENT_TYPE_PARAM) {\n    const param = value.substring(1)\n    if (prefixSegment && suffixSegment) {\n      return `${prefixSegment}{$${param}}${suffixSegment}`\n    } else if (prefixSegment) {\n      return `${prefixSegment}{$${param}}`\n    } else if (suffixSegment) {\n      return `{$${param}}${suffixSegment}`\n    }\n  }\n\n  if (type === SEGMENT_TYPE_OPTIONAL_PARAM) {\n    const param = value.substring(1)\n    if (prefixSegment && suffixSegment) {\n      return `${prefixSegment}{-$${param}}${suffixSegment}`\n    } else if (prefixSegment) {\n      return `${prefixSegment}{-$${param}}`\n    } else if (suffixSegment) {\n      return `{-$${param}}${suffixSegment}`\n    }\n    return `{-$${param}}`\n  }\n\n  if (type === SEGMENT_TYPE_WILDCARD) {\n    if (prefixSegment && suffixSegment) {\n      return `${prefixSegment}{$}${suffixSegment}`\n    } else if (prefixSegment) {\n      return `${prefixSegment}{$}`\n    } else if (suffixSegment) {\n      return `{$}${suffixSegment}`\n    }\n  }\n\n  // This case should never happen, should we throw instead?\n  return value\n}\n\n/**\n * Resolve a destination path against a base, honoring trailing-slash policy\n * and supporting relative segments (`.`/`..`) and absolute `to` values.\n */\nexport function resolvePath({\n  base,\n  to,\n  trailingSlash = 'never',\n  parseCache,\n}: ResolvePathOptions) {\n  let baseSegments = parsePathname(base, parseCache).slice()\n  const toSegments = parsePathname(to, parseCache)\n\n  if (baseSegments.length > 1 && last(baseSegments)?.value === '/') {\n    baseSegments.pop()\n  }\n\n  for (let index = 0, length = toSegments.length; index < length; index++) {\n    const toSegment = toSegments[index]!\n    const value = toSegment.value\n    if (value === '/') {\n      if (!index) {\n        // Leading slash\n        baseSegments = [toSegment]\n      } else if (index === length - 1) {\n        // Trailing Slash\n        baseSegments.push(toSegment)\n      } else {\n        // ignore inter-slashes\n      }\n    } else if (value === '..') {\n      baseSegments.pop()\n    } else if (value === '.') {\n      // ignore\n    } else {\n      baseSegments.push(toSegment)\n    }\n  }\n\n  if (baseSegments.length > 1) {\n    if (last(baseSegments)!.value === '/') {\n      if (trailingSlash === 'never') {\n        baseSegments.pop()\n      }\n    } else if (trailingSlash === 'always') {\n      baseSegments.push({ type: SEGMENT_TYPE_PATHNAME, value: '/' })\n    }\n  }\n\n  const segmentValues = baseSegments.map(segmentToString)\n  // const joined = joinPaths([basepath, ...segmentValues])\n  const joined = joinPaths(segmentValues)\n  return joined\n}\n\nexport type ParsePathnameCache = LRUCache<string, ReadonlyArray<Segment>>\n\n/**\n * Parse a pathname into an array of typed segments used by the router's\n * matcher. Results are optionally cached via an LRU cache.\n */\n/**\n * Parse a pathname into an array of typed segments used by the router's\n * matcher. Results are optionally cached via an LRU cache.\n */\nexport const parsePathname = (\n  pathname?: string,\n  cache?: ParsePathnameCache,\n): ReadonlyArray<Segment> => {\n  if (!pathname) return []\n  const cached = cache?.get(pathname)\n  if (cached) return cached\n  const parsed = baseParsePathname(pathname)\n  cache?.set(pathname, parsed)\n  return parsed\n}\n\nconst PARAM_RE = /^\\$.{1,}$/ // $paramName\nconst PARAM_W_CURLY_BRACES_RE = /^(.*?)\\{(\\$[a-zA-Z_$][a-zA-Z0-9_$]*)\\}(.*)$/ // prefix{$paramName}suffix\nconst OPTIONAL_PARAM_W_CURLY_BRACES_RE =\n  /^(.*?)\\{-(\\$[a-zA-Z_$][a-zA-Z0-9_$]*)\\}(.*)$/ // prefix{-$paramName}suffix\n\nconst WILDCARD_RE = /^\\$$/ // $\nconst WILDCARD_W_CURLY_BRACES_RE = /^(.*?)\\{\\$\\}(.*)$/ // prefix{$}suffix\n\n/**\n * Required: `/foo/$bar` ✅\n * Prefix and Suffix: `/foo/prefix${bar}suffix` ✅\n * Wildcard: `/foo/$` ✅\n * Wildcard with Prefix and Suffix: `/foo/prefix{$}suffix` ✅\n *\n * Optional param: `/foo/{-$bar}`\n * Optional param with Prefix and Suffix: `/foo/prefix{-$bar}suffix`\n\n * Future:\n * Optional named segment: `/foo/{bar}`\n * Optional named segment with Prefix and Suffix: `/foo/prefix{-bar}suffix`\n * Escape special characters:\n * - `/foo/[$]` - Static route\n * - `/foo/[$]{$foo} - Dynamic route with a static prefix of `$`\n * - `/foo/{$foo}[$]` - Dynamic route with a static suffix of `$`\n */\nfunction baseParsePathname(pathname: string): ReadonlyArray<Segment> {\n  pathname = cleanPath(pathname)\n\n  const segments: Array<Segment> = []\n\n  if (pathname.slice(0, 1) === '/') {\n    pathname = pathname.substring(1)\n    segments.push({\n      type: SEGMENT_TYPE_PATHNAME,\n      value: '/',\n    })\n  }\n\n  if (!pathname) {\n    return segments\n  }\n\n  // Remove empty segments and '.' segments\n  const split = pathname.split('/').filter(Boolean)\n\n  segments.push(\n    ...split.map((part): Segment => {\n      // Check for wildcard with curly braces: prefix{$}suffix\n      const wildcardBracesMatch = part.match(WILDCARD_W_CURLY_BRACES_RE)\n      if (wildcardBracesMatch) {\n        const prefix = wildcardBracesMatch[1]\n        const suffix = wildcardBracesMatch[2]\n        return {\n          type: SEGMENT_TYPE_WILDCARD,\n          value: '$',\n          prefixSegment: prefix || undefined,\n          suffixSegment: suffix || undefined,\n        }\n      }\n\n      // Check for optional parameter format: prefix{-$paramName}suffix\n      const optionalParamBracesMatch = part.match(\n        OPTIONAL_PARAM_W_CURLY_BRACES_RE,\n      )\n      if (optionalParamBracesMatch) {\n        const prefix = optionalParamBracesMatch[1]\n        const paramName = optionalParamBracesMatch[2]!\n        const suffix = optionalParamBracesMatch[3]\n        return {\n          type: SEGMENT_TYPE_OPTIONAL_PARAM,\n          value: paramName, // Now just $paramName (no prefix)\n          prefixSegment: prefix || undefined,\n          suffixSegment: suffix || undefined,\n        }\n      }\n\n      // Check for the new parameter format: prefix{$paramName}suffix\n      const paramBracesMatch = part.match(PARAM_W_CURLY_BRACES_RE)\n      if (paramBracesMatch) {\n        const prefix = paramBracesMatch[1]\n        const paramName = paramBracesMatch[2]\n        const suffix = paramBracesMatch[3]\n        return {\n          type: SEGMENT_TYPE_PARAM,\n          value: '' + paramName,\n          prefixSegment: prefix || undefined,\n          suffixSegment: suffix || undefined,\n        }\n      }\n\n      // Check for bare parameter format: $paramName (without curly braces)\n      if (PARAM_RE.test(part)) {\n        const paramName = part.substring(1)\n        return {\n          type: SEGMENT_TYPE_PARAM,\n          value: '$' + paramName,\n          prefixSegment: undefined,\n          suffixSegment: undefined,\n        }\n      }\n\n      // Check for bare wildcard: $ (without curly braces)\n      if (WILDCARD_RE.test(part)) {\n        return {\n          type: SEGMENT_TYPE_WILDCARD,\n          value: '$',\n          prefixSegment: undefined,\n          suffixSegment: undefined,\n        }\n      }\n\n      // Handle regular pathname segment\n      return {\n        type: SEGMENT_TYPE_PATHNAME,\n        value: decodePathSegment(part),\n      }\n    }),\n  )\n\n  if (pathname.slice(-1) === '/') {\n    pathname = pathname.substring(1)\n    segments.push({\n      type: SEGMENT_TYPE_PATHNAME,\n      value: '/',\n    })\n  }\n\n  return segments\n}\n\ninterface InterpolatePathOptions {\n  path?: string\n  params: Record<string, unknown>\n  leaveWildcards?: boolean\n  leaveParams?: boolean\n  // Map of encoded chars to decoded chars (e.g. '%40' -> '@') that should remain decoded in path params\n  decodeCharMap?: Map<string, string>\n  parseCache?: ParsePathnameCache\n}\n\ntype InterPolatePathResult = {\n  interpolatedPath: string\n  usedParams: Record<string, unknown>\n  isMissingParams: boolean // true if any params were not available when being looked up in the params object\n}\n/**\n * Interpolate params and wildcards into a route path template.\n *\n * - Encodes params safely (configurable allowed characters)\n * - Supports `{-$optional}` segments, `{prefix{$id}suffix}` and `{$}` wildcards\n * - Optionally leaves placeholders or wildcards in place\n */\n/**\n * Interpolate params and wildcards into a route path template.\n * Encodes safely and supports optional params and custom decode char maps.\n */\nexport function interpolatePath({\n  path,\n  params,\n  leaveWildcards,\n  leaveParams,\n  decodeCharMap,\n  parseCache,\n}: InterpolatePathOptions): InterPolatePathResult {\n  const interpolatedPathSegments = parsePathname(path, parseCache)\n\n  function encodeParam(key: string): any {\n    const value = params[key]\n    const isValueString = typeof value === 'string'\n\n    if (key === '*' || key === '_splat') {\n      // the splat/catch-all routes shouldn't have the '/' encoded out\n      return isValueString ? encodeURI(value) : value\n    } else {\n      return isValueString ? encodePathParam(value, decodeCharMap) : value\n    }\n  }\n\n  // Tracking if any params are missing in the `params` object\n  // when interpolating the path\n  let isMissingParams = false\n\n  const usedParams: Record<string, unknown> = {}\n  const interpolatedPath = joinPaths(\n    interpolatedPathSegments.map((segment) => {\n      if (segment.type === SEGMENT_TYPE_PATHNAME) {\n        return segment.value\n      }\n\n      if (segment.type === SEGMENT_TYPE_WILDCARD) {\n        usedParams._splat = params._splat\n\n        // TODO: Deprecate *\n        usedParams['*'] = params._splat\n\n        const segmentPrefix = segment.prefixSegment || ''\n        const segmentSuffix = segment.suffixSegment || ''\n\n        // Check if _splat parameter is missing. _splat could be missing if undefined or an empty string or some other falsy value.\n        if (!params._splat) {\n          isMissingParams = true\n          // For missing splat parameters, just return the prefix and suffix without the wildcard\n          if (leaveWildcards) {\n            return `${segmentPrefix}${segment.value}${segmentSuffix}`\n          }\n          // If there is a prefix or suffix, return them joined, otherwise omit the segment\n          if (segmentPrefix || segmentSuffix) {\n            return `${segmentPrefix}${segmentSuffix}`\n          }\n          return undefined\n        }\n\n        const value = encodeParam('_splat')\n        if (leaveWildcards) {\n          return `${segmentPrefix}${segment.value}${value ?? ''}${segmentSuffix}`\n        }\n        return `${segmentPrefix}${value}${segmentSuffix}`\n      }\n\n      if (segment.type === SEGMENT_TYPE_PARAM) {\n        const key = segment.value.substring(1)\n        if (!isMissingParams && !(key in params)) {\n          isMissingParams = true\n        }\n        usedParams[key] = params[key]\n\n        const segmentPrefix = segment.prefixSegment || ''\n        const segmentSuffix = segment.suffixSegment || ''\n        if (leaveParams) {\n          const value = encodeParam(segment.value)\n          return `${segmentPrefix}${segment.value}${value ?? ''}${segmentSuffix}`\n        }\n        return `${segmentPrefix}${encodeParam(key) ?? 'undefined'}${segmentSuffix}`\n      }\n\n      if (segment.type === SEGMENT_TYPE_OPTIONAL_PARAM) {\n        const key = segment.value.substring(1)\n\n        const segmentPrefix = segment.prefixSegment || ''\n        const segmentSuffix = segment.suffixSegment || ''\n\n        // Check if optional parameter is missing or undefined\n        if (!(key in params) || params[key] == null) {\n          if (leaveWildcards) {\n            return `${segmentPrefix}${key}${segmentSuffix}`\n          }\n          // For optional params with prefix/suffix, keep the prefix/suffix but omit the param\n          if (segmentPrefix || segmentSuffix) {\n            return `${segmentPrefix}${segmentSuffix}`\n          }\n          // If no prefix/suffix, omit the entire segment\n          return undefined\n        }\n\n        usedParams[key] = params[key]\n\n        if (leaveParams) {\n          const value = encodeParam(segment.value)\n          return `${segmentPrefix}${segment.value}${value ?? ''}${segmentSuffix}`\n        }\n        if (leaveWildcards) {\n          return `${segmentPrefix}${key}${encodeParam(key) ?? ''}${segmentSuffix}`\n        }\n        return `${segmentPrefix}${encodeParam(key) ?? ''}${segmentSuffix}`\n      }\n\n      return segment.value\n    }),\n  )\n  return { usedParams, interpolatedPath, isMissingParams }\n}\n\nfunction encodePathParam(value: string, decodeCharMap?: Map<string, string>) {\n  let encoded = encodeURIComponent(value)\n  if (decodeCharMap) {\n    for (const [encodedChar, char] of decodeCharMap) {\n      encoded = encoded.replaceAll(encodedChar, char)\n    }\n  }\n  return encoded\n}\n\n/**\n * Match a pathname against a route destination and return extracted params\n * or `undefined`. Uses the same parsing as the router for consistency.\n */\n/**\n * Match a pathname against a route destination and return extracted params\n * or `undefined`. Uses the same parsing as the router for consistency.\n */\nexport function matchPathname(\n  currentPathname: string,\n  matchLocation: Pick<MatchLocation, 'to' | 'fuzzy' | 'caseSensitive'>,\n  parseCache?: ParsePathnameCache,\n): AnyPathParams | undefined {\n  const pathParams = matchByPath(currentPathname, matchLocation, parseCache)\n  // const searchMatched = matchBySearch(location.search, matchLocation)\n\n  if (matchLocation.to && !pathParams) {\n    return\n  }\n\n  return pathParams ?? {}\n}\n\n/** Low-level matcher that compares two path strings and extracts params. */\n/** Low-level matcher that compares two path strings and extracts params. */\nexport function matchByPath(\n  from: string,\n  {\n    to,\n    fuzzy,\n    caseSensitive,\n  }: Pick<MatchLocation, 'to' | 'caseSensitive' | 'fuzzy'>,\n  parseCache?: ParsePathnameCache,\n): Record<string, string> | undefined {\n  const stringTo = to as string\n\n  // Parse the from and to\n  const baseSegments = parsePathname(\n    from.startsWith('/') ? from : `/${from}`,\n    parseCache,\n  )\n  const routeSegments = parsePathname(\n    stringTo.startsWith('/') ? stringTo : `/${stringTo}`,\n    parseCache,\n  )\n\n  const params: Record<string, string> = {}\n\n  const result = isMatch(\n    baseSegments,\n    routeSegments,\n    params,\n    fuzzy,\n    caseSensitive,\n  )\n\n  return result ? params : undefined\n}\n\nfunction isMatch(\n  baseSegments: ReadonlyArray<Segment>,\n  routeSegments: ReadonlyArray<Segment>,\n  params: Record<string, string>,\n  fuzzy?: boolean,\n  caseSensitive?: boolean,\n): boolean {\n  let baseIndex = 0\n  let routeIndex = 0\n\n  while (baseIndex < baseSegments.length || routeIndex < routeSegments.length) {\n    const baseSegment = baseSegments[baseIndex]\n    const routeSegment = routeSegments[routeIndex]\n\n    if (routeSegment) {\n      if (routeSegment.type === SEGMENT_TYPE_WILDCARD) {\n        // Capture all remaining segments for a wildcard\n        const remainingBaseSegments = baseSegments.slice(baseIndex)\n\n        let _splat: string\n\n        // If this is a wildcard with prefix/suffix, we need to handle the first segment specially\n        if (routeSegment.prefixSegment || routeSegment.suffixSegment) {\n          if (!baseSegment) return false\n\n          const prefix = routeSegment.prefixSegment || ''\n          const suffix = routeSegment.suffixSegment || ''\n\n          // Check if the base segment starts with prefix and ends with suffix\n          const baseValue = baseSegment.value\n          if ('prefixSegment' in routeSegment) {\n            if (!baseValue.startsWith(prefix)) {\n              return false\n            }\n          }\n          if ('suffixSegment' in routeSegment) {\n            if (\n              !baseSegments[baseSegments.length - 1]?.value.endsWith(suffix)\n            ) {\n              return false\n            }\n          }\n\n          let rejoinedSplat = decodeURI(\n            joinPaths(remainingBaseSegments.map((d) => d.value)),\n          )\n\n          // Remove the prefix and suffix from the rejoined splat\n          if (prefix && rejoinedSplat.startsWith(prefix)) {\n            rejoinedSplat = rejoinedSplat.slice(prefix.length)\n          }\n\n          if (suffix && rejoinedSplat.endsWith(suffix)) {\n            rejoinedSplat = rejoinedSplat.slice(\n              0,\n              rejoinedSplat.length - suffix.length,\n            )\n          }\n\n          _splat = rejoinedSplat\n        } else {\n          // If no prefix/suffix, just rejoin the remaining segments\n          _splat = decodeURI(\n            joinPaths(remainingBaseSegments.map((d) => d.value)),\n          )\n        }\n\n        // TODO: Deprecate *\n        params['*'] = _splat\n        params['_splat'] = _splat\n        return true\n      }\n\n      if (routeSegment.type === SEGMENT_TYPE_PATHNAME) {\n        if (routeSegment.value === '/' && !baseSegment?.value) {\n          routeIndex++\n          continue\n        }\n\n        if (baseSegment) {\n          if (caseSensitive) {\n            if (routeSegment.value !== baseSegment.value) {\n              return false\n            }\n          } else if (\n            routeSegment.value.toLowerCase() !== baseSegment.value.toLowerCase()\n          ) {\n            return false\n          }\n          baseIndex++\n          routeIndex++\n          continue\n        } else {\n          return false\n        }\n      }\n\n      if (routeSegment.type === SEGMENT_TYPE_PARAM) {\n        if (!baseSegment) {\n          return false\n        }\n\n        if (baseSegment.value === '/') {\n          return false\n        }\n\n        let _paramValue = ''\n        let matched = false\n\n        // If this param has prefix/suffix, we need to extract the actual parameter value\n        if (routeSegment.prefixSegment || routeSegment.suffixSegment) {\n          const prefix = routeSegment.prefixSegment || ''\n          const suffix = routeSegment.suffixSegment || ''\n\n          // Check if the base segment starts with prefix and ends with suffix\n          const baseValue = baseSegment.value\n          if (prefix && !baseValue.startsWith(prefix)) {\n            return false\n          }\n          if (suffix && !baseValue.endsWith(suffix)) {\n            return false\n          }\n\n          let paramValue = baseValue\n          if (prefix && paramValue.startsWith(prefix)) {\n            paramValue = paramValue.slice(prefix.length)\n          }\n          if (suffix && paramValue.endsWith(suffix)) {\n            paramValue = paramValue.slice(0, paramValue.length - suffix.length)\n          }\n\n          _paramValue = decodeURIComponent(paramValue)\n          matched = true\n        } else {\n          // If no prefix/suffix, just decode the base segment value\n          _paramValue = decodeURIComponent(baseSegment.value)\n          matched = true\n        }\n\n        if (matched) {\n          params[routeSegment.value.substring(1)] = _paramValue\n          baseIndex++\n        }\n\n        routeIndex++\n        continue\n      }\n\n      if (routeSegment.type === SEGMENT_TYPE_OPTIONAL_PARAM) {\n        // Optional parameters can be missing - don't fail the match\n        if (!baseSegment) {\n          // No base segment for optional param - skip this route segment\n          routeIndex++\n          continue\n        }\n\n        if (baseSegment.value === '/') {\n          // Skip slash segments for optional params\n          routeIndex++\n          continue\n        }\n\n        let _paramValue = ''\n        let matched = false\n\n        // If this optional param has prefix/suffix, we need to extract the actual parameter value\n        if (routeSegment.prefixSegment || routeSegment.suffixSegment) {\n          const prefix = routeSegment.prefixSegment || ''\n          const suffix = routeSegment.suffixSegment || ''\n\n          // Check if the base segment starts with prefix and ends with suffix\n          const baseValue = baseSegment.value\n          if (\n            (!prefix || baseValue.startsWith(prefix)) &&\n            (!suffix || baseValue.endsWith(suffix))\n          ) {\n            let paramValue = baseValue\n            if (prefix && paramValue.startsWith(prefix)) {\n              paramValue = paramValue.slice(prefix.length)\n            }\n            if (suffix && paramValue.endsWith(suffix)) {\n              paramValue = paramValue.slice(\n                0,\n                paramValue.length - suffix.length,\n              )\n            }\n\n            _paramValue = decodeURIComponent(paramValue)\n            matched = true\n          }\n        } else {\n          // For optional params without prefix/suffix, we need to check if the current\n          // base segment should match this optional param or a later route segment\n\n          // Look ahead to see if there's a later route segment that matches the current base segment\n          let shouldMatchOptional = true\n          for (\n            let lookAhead = routeIndex + 1;\n            lookAhead < routeSegments.length;\n            lookAhead++\n          ) {\n            const futureRouteSegment = routeSegments[lookAhead]\n            if (\n              futureRouteSegment?.type === SEGMENT_TYPE_PATHNAME &&\n              futureRouteSegment.value === baseSegment.value\n            ) {\n              // The current base segment matches a future pathname segment,\n              // so we should skip this optional parameter\n              shouldMatchOptional = false\n              break\n            }\n\n            // If we encounter a required param or wildcard, stop looking ahead\n            if (\n              futureRouteSegment?.type === SEGMENT_TYPE_PARAM ||\n              futureRouteSegment?.type === SEGMENT_TYPE_WILDCARD\n            ) {\n              if (baseSegments.length < routeSegments.length) {\n                shouldMatchOptional = false\n              }\n              break\n            }\n          }\n\n          if (shouldMatchOptional) {\n            // If no prefix/suffix, just decode the base segment value\n            _paramValue = decodeURIComponent(baseSegment.value)\n            matched = true\n          }\n        }\n\n        if (matched) {\n          params[routeSegment.value.substring(1)] = _paramValue\n          baseIndex++\n        }\n\n        routeIndex++\n        continue\n      }\n    }\n\n    // If we have base segments left but no route segments, it's a fuzzy match\n    if (baseIndex < baseSegments.length && routeIndex >= routeSegments.length) {\n      params['**'] = joinPaths(\n        baseSegments.slice(baseIndex).map((d) => d.value),\n      )\n      return !!fuzzy && routeSegments[routeSegments.length - 1]?.value !== '/'\n    }\n\n    // If we have route segments left but no base segments, check if remaining are optional\n    if (routeIndex < routeSegments.length && baseIndex >= baseSegments.length) {\n      // Check if all remaining route segments are optional\n      for (let i = routeIndex; i < routeSegments.length; i++) {\n        if (routeSegments[i]?.type !== SEGMENT_TYPE_OPTIONAL_PARAM) {\n          return false\n        }\n      }\n      // All remaining are optional, so we can finish\n      break\n    }\n\n    break\n  }\n\n  return true\n}\n", "import invariant from 'tiny-invariant'\nimport {\n  SEGMENT_TYPE_OPTIONAL_PARAM,\n  SEGMENT_TYPE_PARAM,\n  SEGMENT_TYPE_PATHNAME,\n  parsePathname,\n  trimPathLeft,\n  trimPathRight,\n} from './path'\nimport type { Segment } from './path'\nimport type { RouteLike } from './route'\n\nconst SLASH_SCORE = 0.75\nconst STATIC_SEGMENT_SCORE = 1\nconst REQUIRED_PARAM_BASE_SCORE = 0.5\nconst OPTIONAL_PARAM_BASE_SCORE = 0.4\nconst WILDCARD_PARAM_BASE_SCORE = 0.25\nconst STATIC_AFTER_DYNAMIC_BONUS_SCORE = 0.2\nconst BOTH_PRESENCE_BASE_SCORE = 0.05\nconst PREFIX_PRESENCE_BASE_SCORE = 0.02\nconst SUFFIX_PRESENCE_BASE_SCORE = 0.01\nconst PREFIX_LENGTH_SCORE_MULTIPLIER = 0.0002\nconst SUFFIX_LENGTH_SCORE_MULTIPLIER = 0.0001\n\nfunction handleParam(segment: Segment, baseScore: number) {\n  if (segment.prefixSegment && segment.suffixSegment) {\n    return (\n      baseScore +\n      BOTH_PRESENCE_BASE_SCORE +\n      PREFIX_LENGTH_SCORE_MULTIPLIER * segment.prefixSegment.length +\n      SUFFIX_LENGTH_SCORE_MULTIPLIER * segment.suffixSegment.length\n    )\n  }\n\n  if (segment.prefixSegment) {\n    return (\n      baseScore +\n      PREFIX_PRESENCE_BASE_SCORE +\n      PREFIX_LENGTH_SCORE_MULTIPLIER * segment.prefixSegment.length\n    )\n  }\n\n  if (segment.suffixSegment) {\n    return (\n      baseScore +\n      SUFFIX_PRESENCE_BASE_SCORE +\n      SUFFIX_LENGTH_SCORE_MULTIPLIER * segment.suffixSegment.length\n    )\n  }\n\n  return baseScore\n}\n\nfunction sortRoutes<TRouteLike extends RouteLike>(\n  routes: ReadonlyArray<TRouteLike>,\n): Array<TRouteLike> {\n  const scoredRoutes: Array<{\n    child: TRouteLike\n    trimmed: string\n    parsed: ReadonlyArray<Segment>\n    index: number\n    scores: Array<number>\n    hasStaticAfter: boolean\n    optionalParamCount: number\n  }> = []\n\n  routes.forEach((d, i) => {\n    if (d.isRoot || !d.path) {\n      return\n    }\n\n    const trimmed = trimPathLeft(d.fullPath)\n    let parsed = parsePathname(trimmed)\n\n    // Removes the leading slash if it is not the only remaining segment\n    let skip = 0\n    while (parsed.length > skip + 1 && parsed[skip]?.value === '/') {\n      skip++\n    }\n    if (skip > 0) parsed = parsed.slice(skip)\n\n    let optionalParamCount = 0\n    let hasStaticAfter = false\n    const scores = parsed.map((segment, index) => {\n      if (segment.value === '/') {\n        return SLASH_SCORE\n      }\n\n      if (segment.type === SEGMENT_TYPE_PATHNAME) {\n        return STATIC_SEGMENT_SCORE\n      }\n\n      let baseScore: number | undefined = undefined\n      if (segment.type === SEGMENT_TYPE_PARAM) {\n        baseScore = REQUIRED_PARAM_BASE_SCORE\n      } else if (segment.type === SEGMENT_TYPE_OPTIONAL_PARAM) {\n        baseScore = OPTIONAL_PARAM_BASE_SCORE\n        optionalParamCount++\n      } else {\n        baseScore = WILDCARD_PARAM_BASE_SCORE\n      }\n\n      // if there is any static segment (that is not an index) after a required / optional param,\n      // we will boost this param so it ranks higher than a required/optional param without a static segment after it\n      // JUST FOR SORTING, NOT FOR MATCHING\n      for (let i = index + 1; i < parsed.length; i++) {\n        const nextSegment = parsed[i]!\n        if (\n          nextSegment.type === SEGMENT_TYPE_PATHNAME &&\n          nextSegment.value !== '/'\n        ) {\n          hasStaticAfter = true\n          return handleParam(\n            segment,\n            baseScore + STATIC_AFTER_DYNAMIC_BONUS_SCORE,\n          )\n        }\n      }\n\n      return handleParam(segment, baseScore)\n    })\n\n    scoredRoutes.push({\n      child: d,\n      trimmed,\n      parsed,\n      index: i,\n      scores,\n      optionalParamCount,\n      hasStaticAfter,\n    })\n  })\n\n  const flatRoutes = scoredRoutes\n    .sort((a, b) => {\n      const minLength = Math.min(a.scores.length, b.scores.length)\n\n      // Sort by segment-by-segment score comparison ONLY for the common prefix\n      for (let i = 0; i < minLength; i++) {\n        if (a.scores[i] !== b.scores[i]) {\n          return b.scores[i]! - a.scores[i]!\n        }\n      }\n\n      // If all common segments have equal scores, then consider length and specificity\n      if (a.scores.length !== b.scores.length) {\n        // If different number of optional parameters, fewer optional parameters wins (more specific)\n        // only if both or none of the routes has static segments after the params\n        if (a.optionalParamCount !== b.optionalParamCount) {\n          if (a.hasStaticAfter === b.hasStaticAfter) {\n            return a.optionalParamCount - b.optionalParamCount\n          } else if (a.hasStaticAfter && !b.hasStaticAfter) {\n            return -1\n          } else if (!a.hasStaticAfter && b.hasStaticAfter) {\n            return 1\n          }\n        }\n\n        // If same number of optional parameters, longer path wins (for static segments)\n        return b.scores.length - a.scores.length\n      }\n\n      // Sort by min available parsed value for alphabetical ordering\n      for (let i = 0; i < minLength; i++) {\n        if (a.parsed[i]!.value !== b.parsed[i]!.value) {\n          return a.parsed[i]!.value > b.parsed[i]!.value ? 1 : -1\n        }\n      }\n\n      // Sort by original index\n      return a.index - b.index\n    })\n    .map((d, i) => {\n      d.child.rank = i\n      return d.child\n    })\n\n  return flatRoutes\n}\n\nexport type ProcessRouteTreeResult<TRouteLike extends RouteLike> = {\n  routesById: Record<string, TRouteLike>\n  routesByPath: Record<string, TRouteLike>\n  flatRoutes: Array<TRouteLike>\n}\n\n/**\n * Build lookup maps and a specificity-sorted flat list from a route tree.\n * Returns `routesById`, `routesByPath`, and `flatRoutes`.\n */\n/**\n * Build lookup maps and a specificity-sorted flat list from a route tree.\n * Returns `routesById`, `routesByPath`, and `flatRoutes`.\n */\nexport function processRouteTree<TRouteLike extends RouteLike>({\n  routeTree,\n  initRoute,\n}: {\n  routeTree: TRouteLike\n  initRoute?: (route: TRouteLike, index: number) => void\n}): ProcessRouteTreeResult<TRouteLike> {\n  const routesById = {} as Record<string, TRouteLike>\n  const routesByPath = {} as Record<string, TRouteLike>\n\n  const recurseRoutes = (childRoutes: Array<TRouteLike>) => {\n    childRoutes.forEach((childRoute, i) => {\n      initRoute?.(childRoute, i)\n\n      const existingRoute = routesById[childRoute.id]\n\n      invariant(\n        !existingRoute,\n        `Duplicate routes found with id: ${String(childRoute.id)}`,\n      )\n\n      routesById[childRoute.id] = childRoute\n\n      if (!childRoute.isRoot && childRoute.path) {\n        const trimmedFullPath = trimPathRight(childRoute.fullPath)\n        if (\n          !routesByPath[trimmedFullPath] ||\n          childRoute.fullPath.endsWith('/')\n        ) {\n          routesByPath[trimmedFullPath] = childRoute\n        }\n      }\n\n      const children = childRoute.children as Array<TRouteLike>\n\n      if (children?.length) {\n        recurseRoutes(children)\n      }\n    })\n  }\n\n  recurseRoutes([routeTree])\n\n  const flatRoutes = sortRoutes(Object.values(routesById))\n\n  return { routesById, routesByPath, flatRoutes }\n}\n", "import type { RouteIds } from './routeInfo'\nimport type { RegisteredRouter } from './router'\n\nexport type NotFoundError = {\n  /**\n    @deprecated\n    Use `routeId: rootRouteId` instead\n  */\n  global?: boolean\n  /**\n    @private\n    Do not use this. It's used internally to indicate a path matching error\n  */\n  _global?: boolean\n  data?: any\n  throw?: boolean\n  routeId?: RouteIds<RegisteredRouter['routeTree']>\n  headers?: HeadersInit\n}\n\n/**\n * Create a not-found error object recognized by TanStack Router.\n *\n * Throw this from loaders/actions to trigger the nearest `notFoundComponent`.\n * Use `routeId` to target a specific route's not-found boundary. If `throw`\n * is true, the error is thrown instead of returned.\n *\n * @param options Optional settings including `routeId`, `headers`, and `throw`.\n * @returns A not-found error object that can be thrown or returned.\n * @link https://tanstack.com/router/latest/docs/router/framework/react/api/router/notFoundFunction\n */\nexport function notFound(options: NotFoundError = {}) {\n  ;(options as any).isNotFound = true\n  if (options.throw) throw options\n  return options\n}\n\n/** Determine if a value is a TanStack Router not-found error. */\nexport function isNotFound(obj: any): obj is NotFoundError {\n  return !!obj?.isNotFound\n}\n", "import { functionalUpdate } from './utils'\nimport type { AnyRouter } from './router'\nimport type { ParsedLocation } from './location'\nimport type { NonNullableUpdater } from './utils'\nimport type { HistoryLocation } from '@tanstack/history'\n\nexport type ScrollRestorationEntry = { scrollX: number; scrollY: number }\n\nexport type ScrollRestorationByElement = Record<string, ScrollRestorationEntry>\n\nexport type ScrollRestorationByKey = Record<string, ScrollRestorationByElement>\n\nexport type ScrollRestorationCache = {\n  state: ScrollRestorationByKey\n  set: (updater: NonNullableUpdater<ScrollRestorationByKey>) => void\n}\nexport type ScrollRestorationOptions = {\n  getKey?: (location: ParsedLocation) => string\n  scrollBehavior?: ScrollToOptions['behavior']\n}\n\nfunction getSafeSessionStorage() {\n  try {\n    if (\n      typeof window !== 'undefined' &&\n      typeof window.sessionStorage === 'object'\n    ) {\n      return window.sessionStorage\n    }\n  } catch {\n    // silent\n  }\n  return undefined\n}\n\n/** SessionStorage key used to persist scroll restoration state. */\n/** SessionStorage key used to store scroll positions across navigations. */\n/** SessionStorage key used to store scroll positions across navigations. */\nexport const storageKey = 'tsr-scroll-restoration-v1_3'\n\nconst throttle = (fn: (...args: Array<any>) => void, wait: number) => {\n  let timeout: any\n  return (...args: Array<any>) => {\n    if (!timeout) {\n      timeout = setTimeout(() => {\n        fn(...args)\n        timeout = null\n      }, wait)\n    }\n  }\n}\n\nfunction createScrollRestorationCache(): ScrollRestorationCache | null {\n  const safeSessionStorage = getSafeSessionStorage()\n  if (!safeSessionStorage) {\n    return null\n  }\n\n  const persistedState = safeSessionStorage.getItem(storageKey)\n  let state: ScrollRestorationByKey = persistedState\n    ? JSON.parse(persistedState)\n    : {}\n\n  return {\n    state,\n    // This setter is simply to make sure that we set the sessionStorage right\n    // after the state is updated. It doesn't necessarily need to be a functional\n    // update.\n    set: (updater) => (\n      (state = functionalUpdate(updater, state) || state),\n      safeSessionStorage.setItem(storageKey, JSON.stringify(state))\n    ),\n  }\n}\n\n/** In-memory handle to the persisted scroll restoration cache. */\n/** In-memory handle to the persisted scroll restoration cache. */\n/** In-memory handle to the persisted scroll restoration cache. */\nexport const scrollRestorationCache = createScrollRestorationCache()\n\n/**\n * The default `getKey` function for `useScrollRestoration`.\n * It returns the `key` from the location state or the `href` of the location.\n *\n * The `location.href` is used as a fallback to support the use case where the location state is not available like the initial render.\n */\n\n/**\n * Default scroll restoration cache key: location state key or full href.\n */\n/**\n * Default scroll restoration cache key: location state key or full href.\n */\n/**\n * Default scroll restoration cache key: location state key or full href.\n */\nexport const defaultGetScrollRestorationKey = (location: ParsedLocation) => {\n  return location.state.__TSR_key! || location.href\n}\n\n/** Best-effort nth-child CSS selector for a given element. */\nexport function getCssSelector(el: any): string {\n  const path = []\n  let parent: HTMLElement\n  while ((parent = el.parentNode)) {\n    path.push(\n      `${el.tagName}:nth-child(${Array.prototype.indexOf.call(parent.children, el) + 1})`,\n    )\n    el = parent\n  }\n  return `${path.reverse().join(' > ')}`.toLowerCase()\n}\n\nlet ignoreScroll = false\n\n// NOTE: This function must remain pure and not use any outside variables\n// unless they are passed in as arguments. Why? Because we need to be able to\n// toString() it into a script tag to execute as early as possible in the browser\n// during SSR. Additionally, we also call it from within the router lifecycle\n/**\n * Restore scroll positions for window/elements based on cached entries.\n */\n/**\n * Restore scroll positions for window/elements based on cached entries.\n */\nexport function restoreScroll({\n  storageKey,\n  key,\n  behavior,\n  shouldScrollRestoration,\n  scrollToTopSelectors,\n  location,\n}: {\n  storageKey: string\n  key?: string\n  behavior?: ScrollToOptions['behavior']\n  shouldScrollRestoration?: boolean\n  scrollToTopSelectors?: Array<string | (() => Element | null | undefined)>\n  location?: HistoryLocation\n}) {\n  let byKey: ScrollRestorationByKey\n\n  try {\n    byKey = JSON.parse(sessionStorage.getItem(storageKey) || '{}')\n  } catch (error) {\n    console.error(error)\n    return\n  }\n\n  const resolvedKey = key || window.history.state?.__TSR_key\n  const elementEntries = byKey[resolvedKey]\n\n  //\n  ignoreScroll = true\n\n  //\n  scroll: {\n    // If we have a cached entry for this location state,\n    // we always need to prefer that over the hash scroll.\n    if (\n      shouldScrollRestoration &&\n      elementEntries &&\n      Object.keys(elementEntries).length > 0\n    ) {\n      for (const elementSelector in elementEntries) {\n        const entry = elementEntries[elementSelector]!\n        if (elementSelector === 'window') {\n          window.scrollTo({\n            top: entry.scrollY,\n            left: entry.scrollX,\n            behavior,\n          })\n        } else if (elementSelector) {\n          const element = document.querySelector(elementSelector)\n          if (element) {\n            element.scrollLeft = entry.scrollX\n            element.scrollTop = entry.scrollY\n          }\n        }\n      }\n\n      break scroll\n    }\n\n    // If we don't have a cached entry for the hash,\n    // Which means we've never seen this location before,\n    // we need to check if there is a hash in the URL.\n    // If there is, we need to scroll it's ID into view.\n    const hash = (location ?? window.location).hash.split('#', 2)[1]\n\n    if (hash) {\n      const hashScrollIntoViewOptions =\n        window.history.state?.__hashScrollIntoViewOptions ?? true\n\n      if (hashScrollIntoViewOptions) {\n        const el = document.getElementById(hash)\n        if (el) {\n          el.scrollIntoView(hashScrollIntoViewOptions)\n        }\n      }\n\n      break scroll\n    }\n\n    // If there is no cached entry for the hash and there is no hash in the URL,\n    // we need to scroll to the top of the page for every scrollToTop element\n    const scrollOptions = { top: 0, left: 0, behavior }\n    window.scrollTo(scrollOptions)\n    if (scrollToTopSelectors) {\n      for (const selector of scrollToTopSelectors) {\n        if (selector === 'window') continue\n        const element =\n          typeof selector === 'function'\n            ? selector()\n            : document.querySelector(selector)\n        if (element) element.scrollTo(scrollOptions)\n      }\n    }\n  }\n\n  //\n  ignoreScroll = false\n}\n\n/** Setup global listeners and hooks to support scroll restoration. */\n/** Setup global listeners and hooks to support scroll restoration. */\nexport function setupScrollRestoration(router: AnyRouter, force?: boolean) {\n  if (!scrollRestorationCache && !router.isServer) {\n    return\n  }\n  const shouldScrollRestoration =\n    force ?? router.options.scrollRestoration ?? false\n\n  if (shouldScrollRestoration) {\n    router.isScrollRestoring = true\n  }\n\n  if (\n    router.isServer ||\n    router.isScrollRestorationSetup ||\n    !scrollRestorationCache\n  ) {\n    return\n  }\n\n  router.isScrollRestorationSetup = true\n\n  //\n  ignoreScroll = false\n\n  const getKey =\n    router.options.getScrollRestorationKey || defaultGetScrollRestorationKey\n\n  window.history.scrollRestoration = 'manual'\n\n  // // Create a MutationObserver to monitor DOM changes\n  // const mutationObserver = new MutationObserver(() => {\n  //   ;ignoreScroll = true\n  //   requestAnimationFrame(() => {\n  //     ;ignoreScroll = false\n\n  //     // Attempt to restore scroll position on each dom\n  //     // mutation until the user scrolls. We do this\n  //     // because dynamic content may come in at different\n  //     // ticks after the initial render and we want to\n  //     // keep up with that content as much as possible.\n  //     // As soon as the user scrolls, we no longer need\n  //     // to attempt router.\n  //     // console.log('mutation observer restoreScroll')\n  //     restoreScroll(\n  //       storageKey,\n  //       getKey(router.state.location),\n  //       router.options.scrollRestorationBehavior,\n  //     )\n  //   })\n  // })\n\n  // const observeDom = () => {\n  //   // Observe changes to the entire document\n  //   mutationObserver.observe(document, {\n  //     childList: true, // Detect added or removed child nodes\n  //     subtree: true, // Monitor all descendants\n  //     characterData: true, // Detect text content changes\n  //   })\n  // }\n\n  // const unobserveDom = () => {\n  //   mutationObserver.disconnect()\n  // }\n\n  // observeDom()\n\n  const onScroll = (event: Event) => {\n    // unobserveDom()\n\n    if (ignoreScroll || !router.isScrollRestoring) {\n      return\n    }\n\n    let elementSelector = ''\n\n    if (event.target === document || event.target === window) {\n      elementSelector = 'window'\n    } else {\n      const attrId = (event.target as Element).getAttribute(\n        'data-scroll-restoration-id',\n      )\n\n      if (attrId) {\n        elementSelector = `[data-scroll-restoration-id=\"${attrId}\"]`\n      } else {\n        elementSelector = getCssSelector(event.target)\n      }\n    }\n\n    const restoreKey = getKey(router.state.location)\n\n    scrollRestorationCache.set((state) => {\n      const keyEntry = (state[restoreKey] ||= {} as ScrollRestorationByElement)\n\n      const elementEntry = (keyEntry[elementSelector] ||=\n        {} as ScrollRestorationEntry)\n\n      if (elementSelector === 'window') {\n        elementEntry.scrollX = window.scrollX || 0\n        elementEntry.scrollY = window.scrollY || 0\n      } else if (elementSelector) {\n        const element = document.querySelector(elementSelector)\n        if (element) {\n          elementEntry.scrollX = element.scrollLeft || 0\n          elementEntry.scrollY = element.scrollTop || 0\n        }\n      }\n\n      return state\n    })\n  }\n\n  // Throttle the scroll event to avoid excessive updates\n  if (typeof document !== 'undefined') {\n    document.addEventListener('scroll', throttle(onScroll, 100), true)\n  }\n\n  router.subscribe('onRendered', (event) => {\n    // unobserveDom()\n\n    const cacheKey = getKey(event.toLocation)\n\n    // If the user doesn't want to restore the scroll position,\n    // we don't need to do anything.\n    if (!router.resetNextScroll) {\n      router.resetNextScroll = true\n      return\n    }\n    if (typeof router.options.scrollRestoration === 'function') {\n      const shouldRestore = router.options.scrollRestoration({\n        location: router.latestLocation,\n      })\n      if (!shouldRestore) {\n        return\n      }\n    }\n\n    restoreScroll({\n      storageKey,\n      key: cacheKey,\n      behavior: router.options.scrollRestorationBehavior,\n      shouldScrollRestoration: router.isScrollRestoring,\n      scrollToTopSelectors: router.options.scrollToTopSelectors,\n      location: router.history.location,\n    })\n\n    if (router.isScrollRestoring) {\n      // Mark the location as having been seen\n      scrollRestorationCache.set((state) => {\n        state[cacheKey] ||= {} as ScrollRestorationByElement\n\n        return state\n      })\n    }\n  })\n}\n\n/**\n * @private\n * Handles hash-based scrolling after navigation completes.\n * To be used in framework-specific <Transitioner> components during the onResolved event.\n *\n * Provides hash scrolling for programmatic navigation when default browser handling is prevented.\n * @param router The router instance containing current location and state\n */\n/**\n * @private\n * Handles hash-based scrolling after navigation completes.\n * To be used in framework-specific <Transitioner> components during the onResolved event.\n *\n * Provides hash scrolling for programmatic navigation when default browser handling is prevented.\n * @param router The router instance containing current location and state\n */\n/**\n * @private\n * Handles hash-based scrolling after navigation completes.\n * To be used in framework-specific Transitioners.\n */\nexport function handleHashScroll(router: AnyRouter) {\n  if (typeof document !== 'undefined' && (document as any).querySelector) {\n    const hashScrollIntoViewOptions =\n      router.state.location.state.__hashScrollIntoViewOptions ?? true\n\n    if (hashScrollIntoViewOptions && router.state.location.hash !== '') {\n      const el = document.getElementById(router.state.location.hash)\n      if (el) {\n        el.scrollIntoView(hashScrollIntoViewOptions)\n      }\n    }\n  }\n}\n", "/**\n * Program is a reimplementation of the `qss` package:\n * Copyright (c) Luke Edwards luke.edwards05@gmail.com, MIT License\n * https://github.com/lukeed/qss/blob/master/license.md\n *\n * This reimplementation uses modern browser APIs\n * (namely URLSearchParams) and TypeScript while still\n * maintaining the original functionality and interface.\n *\n * Update: this implementation has also been mangled to\n * fit exactly our use-case (single value per key in encoding).\n */\n\n/**\n * Encodes an object into a query string.\n * @param obj - The object to encode into a query string.\n * @param stringify - An optional custom stringify function.\n * @returns The encoded query string.\n * @example\n * ```\n * // Example input: encode({ token: 'foo', key: 'value' })\n * // Expected output: \"token=foo&key=value\"\n * ```\n */\n/** Encode a plain object into a URL query string using URLSearchParams. */\nexport function encode(\n  obj: Record<string, any>,\n  stringify: (value: any) => string = String,\n): string {\n  const result = new URLSearchParams()\n\n  for (const key in obj) {\n    const val = obj[key]\n    if (val !== undefined) {\n      result.set(key, stringify(val))\n    }\n  }\n\n  return result.toString()\n}\n\n/**\n * Converts a string value to its appropriate type (string, number, boolean).\n * @param mix - The string value to convert.\n * @returns The converted value.\n * @example\n * // Example input: toValue(\"123\")\n * // Expected output: 123\n */\n/** Convert a string into a primitive boolean/number when possible. */\nfunction toValue(str: unknown) {\n  if (!str) return ''\n\n  if (str === 'false') return false\n  if (str === 'true') return true\n  return +str * 0 === 0 && +str + '' === str ? +str : str\n}\n\n/**\n * Decodes a query string into an object.\n * @param str - The query string to decode.\n * @returns The decoded key-value pairs in an object format.\n * @example\n * // Example input: decode(\"token=foo&key=value\")\n * // Expected output: { \"token\": \"foo\", \"key\": \"value\" }\n */\n/** Decode a URL query string into an object with basic type coercion. */\nexport function decode(str: any): any {\n  const searchParams = new URLSearchParams(str)\n\n  const result: Record<string, unknown> = {}\n\n  for (const [key, value] of searchParams.entries()) {\n    const previousValue = result[key]\n    if (previousValue == null) {\n      result[key] = toValue(value)\n    } else if (Array.isArray(previousValue)) {\n      previousValue.push(toValue(value))\n    } else {\n      result[key] = [previousValue, toValue(value)]\n    }\n  }\n\n  return result\n}\n", "import { decode, encode } from './qss'\nimport type { AnySchema } from './validators'\n\n/** Default `parseSearch` that strips leading '?' and JSON-parses values. */\n/** Default `parseSearch` that strips leading '?' and JSON-parses values. */\n/** Default `parseSearch` that strips leading '?' and JSON-parses values. */\nexport const defaultParseSearch = parseSearchWith(JSON.parse)\n/** Default `stringifySearch` using JSON.stringify for complex values. */\nexport const defaultStringifySearch = stringifySearchWith(\n  JSON.stringify,\n  JSON.parse,\n)\n\n/**\n * Build a `parseSearch` function using a provided JSON-like parser.\n *\n * The returned function strips a leading `?`, decodes values, and attempts to\n * JSON-parse string values using the given `parser`.\n *\n * @param parser Function to parse a string value (e.g. `JSON.parse`).\n * @returns A `parseSearch` function compatible with `Router` options.\n * @link https://tanstack.com/router/latest/docs/framework/react/guide/custom-search-param-serialization\n */\n/** Build a parseSearch function using a provided JSON-like parser. */\nexport function parseSearchWith(parser: (str: string) => any) {\n  return (searchStr: string): AnySchema => {\n    if (searchStr[0] === '?') {\n      searchStr = searchStr.substring(1)\n    }\n\n    const query: Record<string, unknown> = decode(searchStr)\n\n    // Try to parse any query params that might be json\n    for (const key in query) {\n      const value = query[key]\n      if (typeof value === 'string') {\n        try {\n          query[key] = parser(value)\n        } catch (_err) {\n          // silent\n        }\n      }\n    }\n\n    return query\n  }\n}\n\n/**\n * Build a `stringifySearch` function using a provided serializer.\n *\n * Non-primitive values are serialized with `stringify`. If a `parser` is\n * supplied, string values that are parseable are re-serialized to ensure\n * symmetry with `parseSearch`.\n *\n * @param stringify Function to serialize a value (e.g. `JSON.stringify`).\n * @param parser Optional parser to detect parseable strings.\n * @returns A `stringifySearch` function compatible with `Router` options.\n * @link https://tanstack.com/router/latest/docs/framework/react/guide/custom-search-param-serialization\n */\n/** Build a stringifySearch function using a provided serializer/parser. */\nexport function stringifySearchWith(\n  stringify: (search: any) => string,\n  parser?: (str: string) => any,\n) {\n  const hasParser = typeof parser === 'function'\n  function stringifyValue(val: any) {\n    if (typeof val === 'object' && val !== null) {\n      try {\n        return stringify(val)\n      } catch (_err) {\n        // silent\n      }\n    } else if (hasParser && typeof val === 'string') {\n      try {\n        // Check if it's a valid parseable string.\n        // If it is, then stringify it again.\n        parser(val)\n        return stringify(val)\n      } catch (_err) {\n        // silent\n      }\n    }\n    return val\n  }\n\n  return (search: Record<string, any>) => {\n    const searchStr = encode(search, stringifyValue)\n    return searchStr ? `?${searchStr}` : ''\n  }\n}\n\nexport type SearchSerializer = (searchObj: Record<string, any>) => string\nexport type SearchParser = (searchStr: string) => Record<string, any>\n", "/** Stable identifier used for the root route in a route tree. */\nexport const rootRouteId = '__root__'\nexport type RootRouteId = typeof rootRouteId\n", "import type { NavigateOptions } from './link'\nimport type { AnyRouter, RegisteredRouter } from './router'\n\nexport type AnyRedirect = Redirect<any, any, any, any, any>\n\n/**\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RedirectType)\n */\nexport type Redirect<\n  TRouter extends AnyRouter = RegisteredRouter,\n  TFrom extends string = string,\n  TTo extends string | undefined = undefined,\n  TMaskFrom extends string = TFrom,\n  TMaskTo extends string = '.',\n> = Response & {\n  options: NavigateOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>\n  redirectHandled?: boolean\n}\n\nexport type RedirectOptions<\n  TRouter extends AnyRouter = RegisteredRouter,\n  TFrom extends string = string,\n  TTo extends string | undefined = undefined,\n  TMaskFrom extends string = TFrom,\n  TMaskTo extends string = '.',\n> = {\n  href?: string\n  /**\n   * @deprecated Use `statusCode` instead\n   **/\n  code?: number\n  /**\n   * The HTTP status code to use when redirecting.\n   * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RedirectType#statuscode-property)\n   */\n  statusCode?: number\n  /**\n   * If provided, will throw the redirect object instead of returning it. This can be useful in places where `throwing` in a function might cause it to have a return type of `never`. In that case, you can use `redirect({ throw: true })` to throw the redirect object instead of returning it.\n   * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RedirectType#throw-property)\n   */\n  throw?: any\n  /**\n   * The HTTP headers to use when redirecting.\n   * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RedirectType#headers-property)\n   */\n  headers?: HeadersInit\n} & NavigateOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>\n\nexport type ResolvedRedirect<\n  TRouter extends AnyRouter = RegisteredRouter,\n  TFrom extends string = string,\n  TTo extends string = '',\n  TMaskFrom extends string = TFrom,\n  TMaskTo extends string = '',\n> = Redirect<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>\n\n/**\n * Create a redirect Response understood by TanStack Router.\n *\n * Use from route `loader`/`beforeLoad` or server functions to trigger a\n * navigation. If `throw: true` is set, the redirect is thrown instead of\n * returned. When an absolute `href` is supplied and `reloadDocument` is not\n * set, a full-document navigation is inferred.\n *\n * @param opts Options for the redirect. Common fields:\n * - `href`: absolute URL for external redirects; infers `reloadDocument`.\n * - `statusCode`: HTTP status code to use (defaults to 307).\n * - `headers`: additional headers to include on the Response.\n * - Standard navigation options like `to`, `params`, `search`, `replace`,\n *   and `reloadDocument` for internal redirects.\n * @returns A Response augmented with router navigation options.\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/redirectFunction\n */\n/**\n * Create a redirect Response understood by TanStack Router.\n * Use inside loaders/beforeLoad or server handlers to trigger navigation.\n */\nexport function redirect<\n  TRouter extends AnyRouter = RegisteredRouter,\n  const TTo extends string | undefined = '.',\n  const TFrom extends string = string,\n  const TMaskFrom extends string = TFrom,\n  const TMaskTo extends string = '',\n>(\n  opts: RedirectOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>,\n): Redirect<TRouter, TFrom, TTo, TMaskFrom, TMaskTo> {\n  opts.statusCode = opts.statusCode || opts.code || 307\n\n  if (!opts.reloadDocument && typeof opts.href === 'string') {\n    try {\n      new URL(opts.href)\n      opts.reloadDocument = true\n    } catch {}\n  }\n\n  const headers = new Headers(opts.headers)\n  if (opts.href && headers.get('Location') === null) {\n    headers.set('Location', opts.href)\n  }\n\n  const response = new Response(null, {\n    status: opts.statusCode,\n    headers,\n  })\n\n  ;(response as Redirect<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>).options =\n    opts\n\n  if (opts.throw) {\n    throw response\n  }\n\n  return response as Redirect<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>\n}\n\n/** Check whether a value is a TanStack Router redirect Response. */\n/** Check whether a value is a TanStack Router redirect Response. */\nexport function isRedirect(obj: any): obj is AnyRedirect {\n  return obj instanceof Response && !!(obj as any).options\n}\n\n/** True if value is a redirect with a resolved `href` location. */\n/** True if value is a redirect with a resolved `href` location. */\nexport function isResolvedRedirect(\n  obj: any,\n): obj is AnyRedirect & { options: { href: string } } {\n  return isRedirect(obj) && !!obj.options.href\n}\n\n/** Parse a serialized redirect object back into a redirect Response. */\n/** Parse a serialized redirect object back into a redirect Response. */\nexport function parseRedirect(obj: any) {\n  if (obj !== null && typeof obj === 'object' && obj.isSerializedRedirect) {\n    return redirect(obj)\n  }\n\n  return undefined\n}\n", "export type LRUCache<TKey, TValue> = {\n  get: (key: TKey) => TValue | undefined\n  set: (key: TKey, value: TValue) => void\n}\n\nexport function createLRUCache<TKey, TValue>(\n  max: number,\n): LRUCache<TKey, TValue> {\n  type Node = { prev?: Node; next?: Node; key: TKey; value: TValue }\n  const cache = new Map<TKey, Node>()\n  let oldest: Node | undefined\n  let newest: Node | undefined\n\n  const touch = (entry: Node) => {\n    if (!entry.next) return\n    if (!entry.prev) {\n      entry.next.prev = undefined\n      oldest = entry.next\n      entry.next = undefined\n      if (newest) {\n        entry.prev = newest\n        newest.next = entry\n      }\n    } else {\n      entry.prev.next = entry.next\n      entry.next.prev = entry.prev\n      entry.next = undefined\n      if (newest) {\n        newest.next = entry\n        entry.prev = newest\n      }\n    }\n    newest = entry\n  }\n\n  return {\n    get(key) {\n      const entry = cache.get(key)\n      if (!entry) return undefined\n      touch(entry)\n      return entry.value\n    },\n    set(key, value) {\n      if (cache.size >= max && oldest) {\n        const toDelete = oldest\n        cache.delete(toDelete.key)\n        if (toDelete.next) {\n          oldest = toDelete.next\n          toDelete.next.prev = undefined\n        }\n        if (toDelete === newest) {\n          newest = undefined\n        }\n      }\n      const existing = cache.get(key)\n      if (existing) {\n        existing.value = value\n        touch(existing)\n      } else {\n        const entry: Node = { key, value, prev: newest }\n        if (newest) newest.next = entry\n        newest = entry\n        if (!oldest) oldest = entry\n        cache.set(key, entry)\n      }\n    },\n  }\n}\n", "import { batch } from '@tanstack/store'\nimport invariant from 'tiny-invariant'\nimport { createControlledPromise, isPromise } from './utils'\nimport { isNotFound } from './not-found'\nimport { rootRouteId } from './root'\nimport { isRedirect } from './redirect'\nimport type { NotFoundError } from './not-found'\nimport type { ParsedLocation } from './location'\nimport type {\n  AnyRoute,\n  BeforeLoadContextOptions,\n  LoaderFnContext,\n  SsrContextOptions,\n} from './route'\nimport type { AnyRouteMatch, MakeRouteMatch } from './Matches'\nimport type { AnyRouter, SSROption, UpdateMatchFn } from './router'\n\n/**\n * An object of this shape is created when calling `loadMatches`.\n * It contains everything we need for all other functions in this file\n * to work. (It's basically the function's argument, plus a few mutable states)\n */\ntype InnerLoadContext = {\n  /** the calling router instance */\n  router: AnyRouter\n  location: ParsedLocation\n  /** mutable state, scoped to a `loadMatches` call */\n  firstBadMatchIndex?: number\n  /** mutable state, scoped to a `loadMatches` call */\n  rendered?: boolean\n  updateMatch: UpdateMatchFn\n  matches: Array<AnyRouteMatch>\n  preload?: boolean\n  onReady?: () => Promise<void>\n  sync?: boolean\n  /** mutable state, scoped to a `loadMatches` call */\n  matchPromises: Array<Promise<AnyRouteMatch>>\n}\n\nconst triggerOnReady = (inner: InnerLoadContext): void | Promise<void> => {\n  if (!inner.rendered) {\n    inner.rendered = true\n    return inner.onReady?.()\n  }\n}\n\nconst resolvePreload = (inner: InnerLoadContext, matchId: string): boolean => {\n  return !!(\n    inner.preload && !inner.router.state.matches.some((d) => d.id === matchId)\n  )\n}\n\nconst _handleNotFound = (inner: InnerLoadContext, err: NotFoundError) => {\n  // Find the route that should handle the not found error\n  // First check if a specific route is requested to show the error\n  const routeCursor =\n    inner.router.routesById[err.routeId ?? ''] ?? inner.router.routeTree\n\n  // Ensure a NotFoundComponent exists on the route\n  if (\n    !routeCursor.options.notFoundComponent &&\n    (inner.router.options as any)?.defaultNotFoundComponent\n  ) {\n    routeCursor.options.notFoundComponent = (\n      inner.router.options as any\n    ).defaultNotFoundComponent\n  }\n\n  // Ensure we have a notFoundComponent\n  invariant(\n    routeCursor.options.notFoundComponent,\n    'No notFoundComponent found. Please set a notFoundComponent on your route or provide a defaultNotFoundComponent to the router.',\n  )\n\n  // Find the match for this route\n  const matchForRoute = inner.matches.find((m) => m.routeId === routeCursor.id)\n\n  invariant(matchForRoute, 'Could not find match for route: ' + routeCursor.id)\n\n  // Assign the error to the match - using non-null assertion since we've checked with invariant\n  inner.updateMatch(matchForRoute.id, (prev) => ({\n    ...prev,\n    status: 'notFound',\n    error: err,\n    isFetching: false,\n  }))\n\n  if ((err as any).routerCode === 'BEFORE_LOAD' && routeCursor.parentRoute) {\n    err.routeId = routeCursor.parentRoute.id\n    _handleNotFound(inner, err)\n  }\n}\n\nconst handleRedirectAndNotFound = (\n  inner: InnerLoadContext,\n  match: AnyRouteMatch | undefined,\n  err: unknown,\n): void => {\n  if (!isRedirect(err) && !isNotFound(err)) return\n\n  if (isRedirect(err) && err.redirectHandled && !err.options.reloadDocument) {\n    throw err\n  }\n\n  // in case of a redirecting match during preload, the match does not exist\n  if (match) {\n    match._nonReactive.beforeLoadPromise?.resolve()\n    match._nonReactive.loaderPromise?.resolve()\n    match._nonReactive.beforeLoadPromise = undefined\n    match._nonReactive.loaderPromise = undefined\n\n    const status = isRedirect(err) ? 'redirected' : 'notFound'\n\n    inner.updateMatch(match.id, (prev) => ({\n      ...prev,\n      status,\n      isFetching: false,\n      error: err,\n    }))\n\n    if (isNotFound(err) && !err.routeId) {\n      err.routeId = match.routeId\n    }\n\n    match._nonReactive.loadPromise?.resolve()\n  }\n\n  if (isRedirect(err)) {\n    inner.rendered = true\n    err.options._fromLocation = inner.location\n    err.redirectHandled = true\n    err = inner.router.resolveRedirect(err)\n    throw err\n  } else {\n    _handleNotFound(inner, err)\n    throw err\n  }\n}\n\nconst shouldSkipLoader = (\n  inner: InnerLoadContext,\n  matchId: string,\n): boolean => {\n  const match = inner.router.getMatch(matchId)!\n  // upon hydration, we skip the loader if the match has been dehydrated on the server\n  if (!inner.router.isServer && match._nonReactive.dehydrated) {\n    return true\n  }\n\n  if (inner.router.isServer && match.ssr === false) {\n    return true\n  }\n\n  return false\n}\n\nconst handleSerialError = (\n  inner: InnerLoadContext,\n  index: number,\n  err: any,\n  routerCode: string,\n): void => {\n  const { id: matchId, routeId } = inner.matches[index]!\n  const route = inner.router.looseRoutesById[routeId]!\n\n  // Much like suspense, we use a promise here to know if\n  // we've been outdated by a new loadMatches call and\n  // should abort the current async operation\n  if (err instanceof Promise) {\n    throw err\n  }\n\n  err.routerCode = routerCode\n  inner.firstBadMatchIndex ??= index\n  handleRedirectAndNotFound(inner, inner.router.getMatch(matchId), err)\n\n  try {\n    route.options.onError?.(err)\n  } catch (errorHandlerErr) {\n    err = errorHandlerErr\n    handleRedirectAndNotFound(inner, inner.router.getMatch(matchId), err)\n  }\n\n  inner.updateMatch(matchId, (prev) => {\n    prev._nonReactive.beforeLoadPromise?.resolve()\n    prev._nonReactive.beforeLoadPromise = undefined\n    prev._nonReactive.loadPromise?.resolve()\n\n    return {\n      ...prev,\n      error: err,\n      status: 'error',\n      isFetching: false,\n      updatedAt: Date.now(),\n      abortController: new AbortController(),\n    }\n  })\n}\n\nconst isBeforeLoadSsr = (\n  inner: InnerLoadContext,\n  matchId: string,\n  index: number,\n  route: AnyRoute,\n): void | Promise<void> => {\n  const existingMatch = inner.router.getMatch(matchId)!\n  const parentMatchId = inner.matches[index - 1]?.id\n  const parentMatch = parentMatchId\n    ? inner.router.getMatch(parentMatchId)!\n    : undefined\n\n  // in SPA mode, only SSR the root route\n  if (inner.router.isShell()) {\n    existingMatch.ssr = matchId === rootRouteId\n    return\n  }\n\n  if (parentMatch?.ssr === false) {\n    existingMatch.ssr = false\n    return\n  }\n\n  const parentOverride = (tempSsr: SSROption) => {\n    if (tempSsr === true && parentMatch?.ssr === 'data-only') {\n      return 'data-only'\n    }\n    return tempSsr\n  }\n\n  const defaultSsr = inner.router.options.defaultSsr ?? true\n\n  if (route.options.ssr === undefined) {\n    existingMatch.ssr = parentOverride(defaultSsr)\n    return\n  }\n\n  if (typeof route.options.ssr !== 'function') {\n    existingMatch.ssr = parentOverride(route.options.ssr)\n    return\n  }\n  const { search, params } = existingMatch\n\n  const ssrFnContext: SsrContextOptions<any, any, any> = {\n    search: makeMaybe(search, existingMatch.searchError),\n    params: makeMaybe(params, existingMatch.paramsError),\n    location: inner.location,\n    matches: inner.matches.map((match) => ({\n      index: match.index,\n      pathname: match.pathname,\n      fullPath: match.fullPath,\n      staticData: match.staticData,\n      id: match.id,\n      routeId: match.routeId,\n      search: makeMaybe(match.search, match.searchError),\n      params: makeMaybe(match.params, match.paramsError),\n      ssr: match.ssr,\n    })),\n  }\n\n  const tempSsr = route.options.ssr(ssrFnContext)\n  if (isPromise(tempSsr)) {\n    return tempSsr.then((ssr) => {\n      existingMatch.ssr = parentOverride(ssr ?? defaultSsr)\n    })\n  }\n\n  existingMatch.ssr = parentOverride(tempSsr ?? defaultSsr)\n  return\n}\n\nconst setupPendingTimeout = (\n  inner: InnerLoadContext,\n  matchId: string,\n  route: AnyRoute,\n  match: AnyRouteMatch,\n): void => {\n  if (match._nonReactive.pendingTimeout !== undefined) return\n\n  const pendingMs =\n    route.options.pendingMs ?? inner.router.options.defaultPendingMs\n  const shouldPending = !!(\n    inner.onReady &&\n    !inner.router.isServer &&\n    !resolvePreload(inner, matchId) &&\n    (route.options.loader ||\n      route.options.beforeLoad ||\n      routeNeedsPreload(route)) &&\n    typeof pendingMs === 'number' &&\n    pendingMs !== Infinity &&\n    (route.options.pendingComponent ??\n      (inner.router.options as any)?.defaultPendingComponent)\n  )\n\n  if (shouldPending) {\n    const pendingTimeout = setTimeout(() => {\n      // Update the match and prematurely resolve the loadMatches promise so that\n      // the pending component can start rendering\n      triggerOnReady(inner)\n    }, pendingMs)\n    match._nonReactive.pendingTimeout = pendingTimeout\n  }\n}\n\nconst preBeforeLoadSetup = (\n  inner: InnerLoadContext,\n  matchId: string,\n  route: AnyRoute,\n): void | Promise<void> => {\n  const existingMatch = inner.router.getMatch(matchId)!\n\n  // If we are in the middle of a load, either of these will be present\n  // (not to be confused with `loadPromise`, which is always defined)\n  if (\n    !existingMatch._nonReactive.beforeLoadPromise &&\n    !existingMatch._nonReactive.loaderPromise\n  )\n    return\n\n  setupPendingTimeout(inner, matchId, route, existingMatch)\n\n  const then = () => {\n    const match = inner.router.getMatch(matchId)!\n    if (\n      match.preload &&\n      (match.status === 'redirected' || match.status === 'notFound')\n    ) {\n      handleRedirectAndNotFound(inner, match, match.error)\n    }\n  }\n\n  // Wait for the previous beforeLoad to resolve before we continue\n  return existingMatch._nonReactive.beforeLoadPromise\n    ? existingMatch._nonReactive.beforeLoadPromise.then(then)\n    : then()\n}\n\nconst executeBeforeLoad = (\n  inner: InnerLoadContext,\n  matchId: string,\n  index: number,\n  route: AnyRoute,\n): void | Promise<void> => {\n  const match = inner.router.getMatch(matchId)!\n\n  // explicitly capture the previous loadPromise\n  const prevLoadPromise = match._nonReactive.loadPromise\n  match._nonReactive.loadPromise = createControlledPromise<void>(() => {\n    prevLoadPromise?.resolve()\n  })\n\n  const { paramsError, searchError } = match\n\n  if (paramsError) {\n    handleSerialError(inner, index, paramsError, 'PARSE_PARAMS')\n  }\n\n  if (searchError) {\n    handleSerialError(inner, index, searchError, 'VALIDATE_SEARCH')\n  }\n\n  setupPendingTimeout(inner, matchId, route, match)\n\n  const abortController = new AbortController()\n\n  const parentMatchId = inner.matches[index - 1]?.id\n  const parentMatch = parentMatchId\n    ? inner.router.getMatch(parentMatchId)!\n    : undefined\n  const parentMatchContext =\n    parentMatch?.context ?? inner.router.options.context ?? undefined\n\n  const context = { ...parentMatchContext, ...match.__routeContext }\n\n  let isPending = false\n  const pending = () => {\n    if (isPending) return\n    isPending = true\n    inner.updateMatch(matchId, (prev) => ({\n      ...prev,\n      isFetching: 'beforeLoad',\n      fetchCount: prev.fetchCount + 1,\n      abortController,\n      context,\n    }))\n  }\n\n  const resolve = () => {\n    match._nonReactive.beforeLoadPromise?.resolve()\n    match._nonReactive.beforeLoadPromise = undefined\n    inner.updateMatch(matchId, (prev) => ({\n      ...prev,\n      isFetching: false,\n    }))\n  }\n\n  // if there is no `beforeLoad` option, skip everything, batch update the store, return early\n  if (!route.options.beforeLoad) {\n    batch(() => {\n      pending()\n      resolve()\n    })\n    return\n  }\n\n  match._nonReactive.beforeLoadPromise = createControlledPromise<void>()\n\n  const { search, params, cause } = match\n  const preload = resolvePreload(inner, matchId)\n  const beforeLoadFnContext: BeforeLoadContextOptions<\n    any,\n    any,\n    any,\n    any,\n    any,\n    any,\n    any,\n    any\n  > = {\n    search,\n    abortController,\n    params,\n    preload,\n    context,\n    location: inner.location,\n    navigate: (opts: any) =>\n      inner.router.navigate({\n        ...opts,\n        _fromLocation: inner.location,\n      }),\n    buildLocation: inner.router.buildLocation,\n    cause: preload ? 'preload' : cause,\n    matches: inner.matches,\n    ...inner.router.options.additionalContext,\n  }\n\n  const updateContext = (beforeLoadContext: any) => {\n    if (beforeLoadContext === undefined) {\n      batch(() => {\n        pending()\n        resolve()\n      })\n      return\n    }\n    if (isRedirect(beforeLoadContext) || isNotFound(beforeLoadContext)) {\n      pending()\n      handleSerialError(inner, index, beforeLoadContext, 'BEFORE_LOAD')\n    }\n\n    batch(() => {\n      pending()\n      inner.updateMatch(matchId, (prev) => ({\n        ...prev,\n        __beforeLoadContext: beforeLoadContext,\n        context: {\n          ...prev.context,\n          ...beforeLoadContext,\n        },\n      }))\n      resolve()\n    })\n  }\n\n  let beforeLoadContext\n  try {\n    beforeLoadContext = route.options.beforeLoad(beforeLoadFnContext)\n    if (isPromise(beforeLoadContext)) {\n      pending()\n      return beforeLoadContext\n        .catch((err) => {\n          handleSerialError(inner, index, err, 'BEFORE_LOAD')\n        })\n        .then(updateContext)\n    }\n  } catch (err) {\n    pending()\n    handleSerialError(inner, index, err, 'BEFORE_LOAD')\n  }\n\n  updateContext(beforeLoadContext)\n  return\n}\n\nconst handleBeforeLoad = (\n  inner: InnerLoadContext,\n  index: number,\n): void | Promise<void> => {\n  const { id: matchId, routeId } = inner.matches[index]!\n  const route = inner.router.looseRoutesById[routeId]!\n\n  const serverSsr = () => {\n    // on the server, determine whether SSR the current match or not\n    if (inner.router.isServer) {\n      const maybePromise = isBeforeLoadSsr(inner, matchId, index, route)\n      if (isPromise(maybePromise)) return maybePromise.then(queueExecution)\n    }\n    return queueExecution()\n  }\n\n  const execute = () => executeBeforeLoad(inner, matchId, index, route)\n\n  const queueExecution = () => {\n    if (shouldSkipLoader(inner, matchId)) return\n    const result = preBeforeLoadSetup(inner, matchId, route)\n    return isPromise(result) ? result.then(execute) : execute()\n  }\n\n  return serverSsr()\n}\n\nconst executeHead = (\n  inner: InnerLoadContext,\n  matchId: string,\n  route: AnyRoute,\n): void | Promise<\n  Pick<\n    AnyRouteMatch,\n    'meta' | 'links' | 'headScripts' | 'headers' | 'scripts' | 'styles'\n  >\n> => {\n  const match = inner.router.getMatch(matchId)\n  // in case of a redirecting match during preload, the match does not exist\n  if (!match) {\n    return\n  }\n  if (!route.options.head && !route.options.scripts && !route.options.headers) {\n    return\n  }\n  const assetContext = {\n    matches: inner.matches,\n    match,\n    params: match.params,\n    loaderData: match.loaderData,\n  }\n\n  return Promise.all([\n    route.options.head?.(assetContext),\n    route.options.scripts?.(assetContext),\n    route.options.headers?.(assetContext),\n  ]).then(([headFnContent, scripts, headers]) => {\n    const meta = headFnContent?.meta\n    const links = headFnContent?.links\n    const headScripts = headFnContent?.scripts\n    const styles = headFnContent?.styles\n\n    return {\n      meta,\n      links,\n      headScripts,\n      headers,\n      scripts,\n      styles,\n    }\n  })\n}\n\nconst getLoaderContext = (\n  inner: InnerLoadContext,\n  matchId: string,\n  index: number,\n  route: AnyRoute,\n): LoaderFnContext => {\n  const parentMatchPromise = inner.matchPromises[index - 1] as any\n  const { params, loaderDeps, abortController, context, cause } =\n    inner.router.getMatch(matchId)!\n\n  const preload = resolvePreload(inner, matchId)\n\n  return {\n    params,\n    deps: loaderDeps,\n    preload: !!preload,\n    parentMatchPromise,\n    abortController,\n    context,\n    location: inner.location,\n    navigate: (opts) =>\n      inner.router.navigate({\n        ...opts,\n        _fromLocation: inner.location,\n      }),\n    cause: preload ? 'preload' : cause,\n    route,\n    ...inner.router.options.additionalContext,\n  }\n}\n\nconst runLoader = async (\n  inner: InnerLoadContext,\n  matchId: string,\n  index: number,\n  route: AnyRoute,\n): Promise<void> => {\n  try {\n    // If the Matches component rendered\n    // the pending component and needs to show it for\n    // a minimum duration, we''ll wait for it to resolve\n    // before committing to the match and resolving\n    // the loadPromise\n\n    const match = inner.router.getMatch(matchId)!\n\n    // Actually run the loader and handle the result\n    try {\n      if (!inner.router.isServer || match.ssr === true) {\n        loadRouteChunk(route)\n      }\n\n      // Kick off the loader!\n      const loaderResult = route.options.loader?.(\n        getLoaderContext(inner, matchId, index, route),\n      )\n      const loaderResultIsPromise =\n        route.options.loader && isPromise(loaderResult)\n\n      const willLoadSomething = !!(\n        loaderResultIsPromise ||\n        route._lazyPromise ||\n        route._componentsPromise ||\n        route.options.head ||\n        route.options.scripts ||\n        route.options.headers ||\n        match._nonReactive.minPendingPromise\n      )\n\n      if (willLoadSomething) {\n        inner.updateMatch(matchId, (prev) => ({\n          ...prev,\n          isFetching: 'loader',\n        }))\n      }\n\n      if (route.options.loader) {\n        const loaderData = loaderResultIsPromise\n          ? await loaderResult\n          : loaderResult\n\n        handleRedirectAndNotFound(\n          inner,\n          inner.router.getMatch(matchId),\n          loaderData,\n        )\n        if (loaderData !== undefined) {\n          inner.updateMatch(matchId, (prev) => ({\n            ...prev,\n            loaderData,\n          }))\n        }\n      }\n\n      // Lazy option can modify the route options,\n      // so we need to wait for it to resolve before\n      // we can use the options\n      if (route._lazyPromise) await route._lazyPromise\n      const headResult = executeHead(inner, matchId, route)\n      const head = headResult ? await headResult : undefined\n      const pendingPromise = match._nonReactive.minPendingPromise\n      if (pendingPromise) await pendingPromise\n\n      // Last but not least, wait for the the components\n      // to be preloaded before we resolve the match\n      if (route._componentsPromise) await route._componentsPromise\n      inner.updateMatch(matchId, (prev) => ({\n        ...prev,\n        error: undefined,\n        status: 'success',\n        isFetching: false,\n        updatedAt: Date.now(),\n        ...head,\n      }))\n    } catch (e) {\n      let error = e\n\n      const pendingPromise = match._nonReactive.minPendingPromise\n      if (pendingPromise) await pendingPromise\n\n      if (isNotFound(e)) {\n        await (route.options.notFoundComponent as any)?.preload?.()\n      }\n\n      handleRedirectAndNotFound(inner, inner.router.getMatch(matchId), e)\n\n      try {\n        route.options.onError?.(e)\n      } catch (onErrorError) {\n        error = onErrorError\n        handleRedirectAndNotFound(\n          inner,\n          inner.router.getMatch(matchId),\n          onErrorError,\n        )\n      }\n      const headResult = executeHead(inner, matchId, route)\n      const head = headResult ? await headResult : undefined\n      inner.updateMatch(matchId, (prev) => ({\n        ...prev,\n        error,\n        status: 'error',\n        isFetching: false,\n        ...head,\n      }))\n    }\n  } catch (err) {\n    const match = inner.router.getMatch(matchId)\n    // in case of a redirecting match during preload, the match does not exist\n    if (match) {\n      const headResult = executeHead(inner, matchId, route)\n      if (headResult) {\n        const head = await headResult\n        inner.updateMatch(matchId, (prev) => ({\n          ...prev,\n          ...head,\n        }))\n      }\n      match._nonReactive.loaderPromise = undefined\n    }\n    handleRedirectAndNotFound(inner, match, err)\n  }\n}\n\nconst loadRouteMatch = async (\n  inner: InnerLoadContext,\n  index: number,\n): Promise<AnyRouteMatch> => {\n  const { id: matchId, routeId } = inner.matches[index]!\n  let loaderShouldRunAsync = false\n  let loaderIsRunningAsync = false\n  const route = inner.router.looseRoutesById[routeId]!\n\n  if (shouldSkipLoader(inner, matchId)) {\n    if (inner.router.isServer) {\n      const headResult = executeHead(inner, matchId, route)\n      if (headResult) {\n        const head = await headResult\n        inner.updateMatch(matchId, (prev) => ({\n          ...prev,\n          ...head,\n        }))\n      }\n      return inner.router.getMatch(matchId)!\n    }\n  } else {\n    const prevMatch = inner.router.getMatch(matchId)!\n    // there is a loaderPromise, so we are in the middle of a load\n    if (prevMatch._nonReactive.loaderPromise) {\n      // do not block if we already have stale data we can show\n      // but only if the ongoing load is not a preload since error handling is different for preloads\n      // and we don't want to swallow errors\n      if (prevMatch.status === 'success' && !inner.sync && !prevMatch.preload) {\n        return prevMatch\n      }\n      await prevMatch._nonReactive.loaderPromise\n      const match = inner.router.getMatch(matchId)!\n      if (match.error) {\n        handleRedirectAndNotFound(inner, match, match.error)\n      }\n    } else {\n      // This is where all of the stale-while-revalidate magic happens\n      const age = Date.now() - prevMatch.updatedAt\n\n      const preload = resolvePreload(inner, matchId)\n\n      const staleAge = preload\n        ? (route.options.preloadStaleTime ??\n          inner.router.options.defaultPreloadStaleTime ??\n          30_000) // 30 seconds for preloads by default\n        : (route.options.staleTime ??\n          inner.router.options.defaultStaleTime ??\n          0)\n\n      const shouldReloadOption = route.options.shouldReload\n\n      // Default to reloading the route all the time\n      // Allow shouldReload to get the last say,\n      // if provided.\n      const shouldReload =\n        typeof shouldReloadOption === 'function'\n          ? shouldReloadOption(getLoaderContext(inner, matchId, index, route))\n          : shouldReloadOption\n\n      const nextPreload =\n        !!preload && !inner.router.state.matches.some((d) => d.id === matchId)\n      const match = inner.router.getMatch(matchId)!\n      match._nonReactive.loaderPromise = createControlledPromise<void>()\n      if (nextPreload !== match.preload) {\n        inner.updateMatch(matchId, (prev) => ({\n          ...prev,\n          preload: nextPreload,\n        }))\n      }\n\n      // If the route is successful and still fresh, just resolve\n      const { status, invalid } = match\n      loaderShouldRunAsync =\n        status === 'success' && (invalid || (shouldReload ?? age > staleAge))\n      if (preload && route.options.preload === false) {\n        // Do nothing\n      } else if (loaderShouldRunAsync && !inner.sync) {\n        loaderIsRunningAsync = true\n        ;(async () => {\n          try {\n            await runLoader(inner, matchId, index, route)\n            const match = inner.router.getMatch(matchId)!\n            match._nonReactive.loaderPromise?.resolve()\n            match._nonReactive.loadPromise?.resolve()\n            match._nonReactive.loaderPromise = undefined\n          } catch (err) {\n            if (isRedirect(err)) {\n              await inner.router.navigate(err.options)\n            }\n          }\n        })()\n      } else if (status !== 'success' || (loaderShouldRunAsync && inner.sync)) {\n        await runLoader(inner, matchId, index, route)\n      } else {\n        // if the loader did not run, still update head.\n        // reason: parent's beforeLoad may have changed the route context\n        // and only now do we know the route context (and that the loader would not run)\n        const headResult = executeHead(inner, matchId, route)\n        if (headResult) {\n          const head = await headResult\n          inner.updateMatch(matchId, (prev) => ({\n            ...prev,\n            ...head,\n          }))\n        }\n      }\n    }\n  }\n  const match = inner.router.getMatch(matchId)!\n  if (!loaderIsRunningAsync) {\n    match._nonReactive.loaderPromise?.resolve()\n    match._nonReactive.loadPromise?.resolve()\n  }\n\n  clearTimeout(match._nonReactive.pendingTimeout)\n  match._nonReactive.pendingTimeout = undefined\n  if (!loaderIsRunningAsync) match._nonReactive.loaderPromise = undefined\n  match._nonReactive.dehydrated = undefined\n  const nextIsFetching = loaderIsRunningAsync ? match.isFetching : false\n  if (nextIsFetching !== match.isFetching || match.invalid !== false) {\n    inner.updateMatch(matchId, (prev) => ({\n      ...prev,\n      isFetching: nextIsFetching,\n      invalid: false,\n    }))\n    return inner.router.getMatch(matchId)!\n  } else {\n    return match\n  }\n}\n\nexport async function loadMatches(arg: {\n  router: AnyRouter\n  location: ParsedLocation\n  matches: Array<AnyRouteMatch>\n  preload?: boolean\n  onReady?: () => Promise<void>\n  updateMatch: UpdateMatchFn\n  sync?: boolean\n}): Promise<Array<MakeRouteMatch>> {\n  const inner: InnerLoadContext = Object.assign(arg, {\n    matchPromises: [],\n  })\n\n  // make sure the pending component is immediately rendered when hydrating a match that is not SSRed\n  // the pending component was already rendered on the server and we want to keep it shown on the client until minPendingMs is reached\n  if (\n    !inner.router.isServer &&\n    inner.router.state.matches.some((d) => d._forcePending)\n  ) {\n    triggerOnReady(inner)\n  }\n\n  try {\n    // Execute all beforeLoads one by one\n    for (let i = 0; i < inner.matches.length; i++) {\n      const beforeLoad = handleBeforeLoad(inner, i)\n      if (isPromise(beforeLoad)) await beforeLoad\n    }\n\n    // Execute all loaders in parallel\n    const max = inner.firstBadMatchIndex ?? inner.matches.length\n    for (let i = 0; i < max; i++) {\n      inner.matchPromises.push(loadRouteMatch(inner, i))\n    }\n    await Promise.all(inner.matchPromises)\n\n    const readyPromise = triggerOnReady(inner)\n    if (isPromise(readyPromise)) await readyPromise\n  } catch (err) {\n    if (isNotFound(err) && !inner.preload) {\n      const readyPromise = triggerOnReady(inner)\n      if (isPromise(readyPromise)) await readyPromise\n      throw err\n    }\n    if (isRedirect(err)) {\n      throw err\n    }\n  }\n\n  return inner.matches\n}\n\nexport async function loadRouteChunk(route: AnyRoute) {\n  if (!route._lazyLoaded && route._lazyPromise === undefined) {\n    if (route.lazyFn) {\n      route._lazyPromise = route.lazyFn().then((lazyRoute) => {\n        // explicitly don't copy over the lazy route's id\n        const { id: _id, ...options } = lazyRoute.options\n        Object.assign(route.options, options)\n        route._lazyLoaded = true\n        route._lazyPromise = undefined // gc promise, we won't need it anymore\n      })\n    } else {\n      route._lazyLoaded = true\n    }\n  }\n\n  // If for some reason lazy resolves more lazy components...\n  // We'll wait for that before we attempt to preload the\n  // components themselves.\n  if (!route._componentsLoaded && route._componentsPromise === undefined) {\n    const loadComponents = () => {\n      const preloads = []\n      for (const type of componentTypes) {\n        const preload = (route.options[type] as any)?.preload\n        if (preload) preloads.push(preload())\n      }\n      if (preloads.length)\n        return Promise.all(preloads).then(() => {\n          route._componentsLoaded = true\n          route._componentsPromise = undefined // gc promise, we won't need it anymore\n        })\n      route._componentsLoaded = true\n      route._componentsPromise = undefined // gc promise, we won't need it anymore\n      return\n    }\n    route._componentsPromise = route._lazyPromise\n      ? route._lazyPromise.then(loadComponents)\n      : loadComponents()\n  }\n  return route._componentsPromise\n}\n\nfunction makeMaybe<TValue, TError>(\n  value: TValue,\n  error: TError,\n): { status: 'success'; value: TValue } | { status: 'error'; error: TError } {\n  if (error) {\n    return { status: 'error' as const, error }\n  }\n  return { status: 'success' as const, value }\n}\n\nexport function routeNeedsPreload(route: AnyRoute) {\n  for (const componentType of componentTypes) {\n    if ((route.options[componentType] as any)?.preload) {\n      return true\n    }\n  }\n  return false\n}\n\nexport const componentTypes = [\n  'component',\n  'errorComponent',\n  'pendingComponent',\n  'notFoundComponent',\n] as const\n", "import { joinPaths, trimPath } from './path'\nimport type { LocationRewrite } from './router'\n\n/** Compose multiple rewrite pairs into a single in/out rewrite. */\n/** Compose multiple rewrite pairs into a single in/out rewrite. */\nexport function composeRewrites(rewrites: Array<LocationRewrite>) {\n  return {\n    input: ({ url }) => {\n      for (const rewrite of rewrites) {\n        url = executeRewriteInput(rewrite, url)\n      }\n      return url\n    },\n    output: ({ url }) => {\n      for (let i = rewrites.length - 1; i >= 0; i--) {\n        url = executeRewriteOutput(rewrites[i], url)\n      }\n      return url\n    },\n  } satisfies LocationRewrite\n}\n\n/** Create a rewrite pair that strips/adds a basepath on input/output. */\n/** Create a rewrite pair that strips/adds a basepath on input/output. */\nexport function rewriteBasepath(opts: {\n  basepath: string\n  caseSensitive?: boolean\n}) {\n  const trimmedBasepath = trimPath(opts.basepath)\n  const normalizedBasepath = `/${trimmedBasepath}`\n  const normalizedBasepathWithSlash = `${normalizedBasepath}/`\n  const checkBasepath = opts.caseSensitive\n    ? normalizedBasepath\n    : normalizedBasepath.toLowerCase()\n  const checkBasepathWithSlash = opts.caseSensitive\n    ? normalizedBasepathWithSlash\n    : normalizedBasepathWithSlash.toLowerCase()\n\n  return {\n    input: ({ url }) => {\n      const pathname = opts.caseSensitive\n        ? url.pathname\n        : url.pathname.toLowerCase()\n\n      // Handle exact basepath match (e.g., /my-app -> /)\n      if (pathname === checkBasepath) {\n        url.pathname = '/'\n      } else if (pathname.startsWith(checkBasepathWithSlash)) {\n        // Handle basepath with trailing content (e.g., /my-app/users -> /users)\n        url.pathname = url.pathname.slice(normalizedBasepath.length)\n      }\n      return url\n    },\n    output: ({ url }) => {\n      url.pathname = joinPaths(['/', trimmedBasepath, url.pathname])\n      return url\n    },\n  } satisfies LocationRewrite\n}\n\n/** Execute a location input rewrite if provided. */\n/** Execute a location input rewrite if provided. */\nexport function executeRewriteInput(\n  rewrite: LocationRewrite | undefined,\n  url: URL,\n): URL {\n  const res = rewrite?.input?.({ url })\n  if (res) {\n    if (typeof res === 'string') {\n      return new URL(res)\n    } else if (res instanceof URL) {\n      return res\n    }\n  }\n  return url\n}\n\n/** Execute a location output rewrite if provided. */\n/** Execute a location output rewrite if provided. */\nexport function executeRewriteOutput(\n  rewrite: LocationRewrite | undefined,\n  url: URL,\n): URL {\n  const res = rewrite?.output?.({ url })\n  if (res) {\n    if (typeof res === 'string') {\n      return new URL(res)\n    } else if (res instanceof URL) {\n      return res\n    }\n  }\n  return url\n}\n", "import { Store, batch } from '@tanstack/store'\nimport { createBrowserHistory, parseHref } from '@tanstack/history'\nimport {\n  createControlledPromise,\n  decodePathSegment,\n  deepEqual,\n  findLast,\n  functionalUpdate,\n  last,\n  replaceEqualDeep,\n} from './utils'\nimport { processRouteTree } from './process-route-tree'\nimport {\n  cleanPath,\n  interpolatePath,\n  matchPathname,\n  resolvePath,\n  trimPath,\n  trimPathRight,\n} from './path'\nimport { isNotFound } from './not-found'\nimport { setupScrollRestoration } from './scroll-restoration'\nimport { defaultParseSearch, defaultStringifySearch } from './searchParams'\nimport { rootRouteId } from './root'\nimport { isRedirect, redirect } from './redirect'\nimport { createLRUCache } from './lru-cache'\nimport { loadMatches, loadRouteChunk, routeNeedsPreload } from './load-matches'\nimport {\n  composeRewrites,\n  executeRewriteInput,\n  executeRewriteOutput,\n  rewriteBasepath,\n} from './rewrite'\nimport type { ParsePathnameCache } from './path'\nimport type { SearchParser, SearchSerializer } from './searchParams'\nimport type { AnyRedirect, ResolvedRedirect } from './redirect'\nimport type {\n  HistoryLocation,\n  HistoryState,\n  ParsedHistoryState,\n  RouterHistory,\n} from '@tanstack/history'\nimport type {\n  Awaitable,\n  Constrain,\n  ControlledPromise,\n  NoInfer,\n  NonNullableUpdater,\n  PickAsRequired,\n  Updater,\n} from './utils'\nimport type { ParsedLocation } from './location'\nimport type {\n  AnyContext,\n  AnyRoute,\n  AnyRouteWithContext,\n  MakeRemountDepsOptionsUnion,\n  RouteContextOptions,\n  RouteLike,\n  RouteMask,\n  SearchMiddleware,\n} from './route'\nimport type {\n  FullSearchSchema,\n  RouteById,\n  RoutePaths,\n  RoutesById,\n  RoutesByPath,\n} from './routeInfo'\nimport type {\n  AnyRouteMatch,\n  MakeRouteMatch,\n  MakeRouteMatchUnion,\n  MatchRouteOptions,\n} from './Matches'\nimport type {\n  BuildLocationFn,\n  CommitLocationOptions,\n  NavigateFn,\n} from './RouterProvider'\nimport type { Manifest } from './manifest'\nimport type { AnySchema, AnyValidator } from './validators'\nimport type { NavigateOptions, ResolveRelativePath, ToOptions } from './link'\nimport type { NotFoundError } from './not-found'\nimport type {\n  AnySerializationAdapter,\n  ValidateSerializableInput,\n} from './ssr/serializer/transformer'\n// import type { AnyRouterConfig } from './config'\n\nexport type ControllablePromise<T = any> = Promise<T> & {\n  resolve: (value: T) => void\n  reject: (value?: any) => void\n}\n\nexport type InjectedHtmlEntry = Promise<string>\n\nexport interface Register {\n  // Lots of things on here like...\n  // router\n  // config\n  // ssr\n}\n\nexport type RegisteredSsr<TRegister = Register> = TRegister extends {\n  ssr: infer TSSR\n}\n  ? TSSR\n  : false\n\nexport type RegisteredRouter<TRegister = Register> = TRegister extends {\n  router: infer TRouter\n}\n  ? TRouter\n  : AnyRouter\n\nexport type RegisteredConfigType<TRegister, TKey> = TRegister extends {\n  config: infer TConfig\n}\n  ? TConfig extends {\n      '~types': infer TTypes\n    }\n    ? TKey extends keyof TTypes\n      ? TTypes[TKey]\n      : unknown\n    : unknown\n  : unknown\n\nexport type DefaultRemountDepsFn<TRouteTree extends AnyRoute> = (\n  opts: MakeRemountDepsOptionsUnion<TRouteTree>,\n) => any\n\nexport interface DefaultRouterOptionsExtensions {}\n\nexport interface RouterOptionsExtensions\n  extends DefaultRouterOptionsExtensions {}\n\nexport type SSROption = boolean | 'data-only'\n\nexport interface RouterOptions<\n  TRouteTree extends AnyRoute,\n  TTrailingSlashOption extends TrailingSlashOption,\n  TDefaultStructuralSharingOption extends boolean = false,\n  TRouterHistory extends RouterHistory = RouterHistory,\n  TDehydrated = undefined,\n> extends RouterOptionsExtensions {\n  /**\n   * The history object that will be used to manage the browser history.\n   *\n   * If not provided, a new createBrowserHistory instance will be created and used.\n   *\n   * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#history-property)\n   * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/history-types)\n   */\n  history?: TRouterHistory\n  /**\n   * A function that will be used to stringify search params when generating links.\n   *\n   * @default defaultStringifySearch\n   * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#stringifysearch-method)\n   * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/custom-search-param-serialization)\n   */\n  stringifySearch?: SearchSerializer\n  /**\n   * A function that will be used to parse search params when parsing the current location.\n   *\n   * @default defaultParseSearch\n   * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#parsesearch-method)\n   * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/custom-search-param-serialization)\n   */\n  parseSearch?: SearchParser\n  /**\n   * If `false`, routes will not be preloaded by default in any way.\n   *\n   * If `'intent'`, routes will be preloaded by default when the user hovers over a link or a `touchstart` event is detected on a `<Link>`.\n   *\n   * If `'viewport'`, routes will be preloaded by default when they are within the viewport.\n   *\n   * @default false\n   * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultpreload-property)\n   * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/preloading)\n   */\n  defaultPreload?: false | 'intent' | 'viewport' | 'render'\n  /**\n   * The delay in milliseconds that a route must be hovered over or touched before it is preloaded.\n   *\n   * @default 50\n   * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultpreloaddelay-property)\n   * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/preloading#preload-delay)\n   */\n  defaultPreloadDelay?: number\n  /**\n   * The default `preloadIntentProximity` a route should use if no preloadIntentProximity is provided.\n   *\n   * @default 0\n   * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultpreloadintentproximity-property)\n   * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/preloading#preload-intent-proximity)\n   */\n  defaultPreloadIntentProximity?: number\n  /**\n   * The default `pendingMs` a route should use if no pendingMs is provided.\n   *\n   * @default 1000\n   * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultpendingms-property)\n   * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/data-loading#avoiding-pending-component-flash)\n   */\n  defaultPendingMs?: number\n  /**\n   * The default `pendingMinMs` a route should use if no pendingMinMs is provided.\n   *\n   * @default 500\n   * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultpendingminms-property)\n   * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/data-loading#avoiding-pending-component-flash)\n   */\n  defaultPendingMinMs?: number\n  /**\n   * The default `staleTime` a route should use if no staleTime is provided. This is the time in milliseconds that a route will be considered fresh.\n   *\n   * @default 0\n   * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultstaletime-property)\n   * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/data-loading#key-options)\n   */\n  defaultStaleTime?: number\n  /**\n   * The default `preloadStaleTime` a route should use if no preloadStaleTime is provided.\n   *\n   * @default 30_000 `(30 seconds)`\n   * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultpreloadstaletime-property)\n   * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/preloading)\n   */\n  defaultPreloadStaleTime?: number\n  /**\n   * The default `defaultPreloadGcTime` a route should use if no preloadGcTime is provided.\n   *\n   * @default 1_800_000 `(30 minutes)`\n   * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultpreloadgctime-property)\n   * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/preloading)\n   */\n  defaultPreloadGcTime?: number\n  /**\n   * If `true`, route navigations will called using `document.startViewTransition()`.\n   *\n   * If the browser does not support this api, this option will be ignored.\n   *\n   * See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Document/startViewTransition) for more information on how this function works.\n   *\n   * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultviewtransition-property)\n   */\n  defaultViewTransition?: boolean | ViewTransitionOptions\n  /**\n   * The default `hashScrollIntoView` a route should use if no hashScrollIntoView is provided while navigating\n   *\n   * See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView) for more information on `ScrollIntoViewOptions`.\n   *\n   * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaulthashscrollintoview-property)\n   */\n  defaultHashScrollIntoView?: boolean | ScrollIntoViewOptions\n  /**\n   * @default 'fuzzy'\n   * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#notfoundmode-property)\n   * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/not-found-errors#the-notfoundmode-option)\n   */\n  notFoundMode?: 'root' | 'fuzzy'\n  /**\n   * The default `gcTime` a route should use if no gcTime is provided.\n   *\n   * @default 1_800_000 `(30 minutes)`\n   * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultgctime-property)\n   * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/data-loading#key-options)\n   */\n  defaultGcTime?: number\n  /**\n   * If `true`, all routes will be matched as case-sensitive.\n   *\n   * @default false\n   * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#casesensitive-property)\n   */\n  caseSensitive?: boolean\n  /**\n   *\n   * The route tree that will be used to configure the router instance.\n   *\n   * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#routetree-property)\n   * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/routing/route-trees)\n   */\n  routeTree?: TRouteTree\n  /**\n   * The basepath for then entire router. This is useful for mounting a router instance at a subpath.\n   * ```\n   * @default '/'\n   * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#basepath-property)\n   */\n  basepath?: string\n  /**\n   * The root context that will be provided to all routes in the route tree.\n   *\n   * This can be used to provide a context to all routes in the tree without having to provide it to each route individually.\n   *\n   * Optional or required if the root route was created with [`createRootRouteWithContext()`](https://tanstack.com/router/latest/docs/framework/react/api/router/createRootRouteWithContextFunction).\n   *\n   * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#context-property)\n   * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/router-context)\n   */\n  context?: InferRouterContext<TRouteTree>\n\n  additionalContext?: any\n\n  /**\n   * A function that will be called when the router is dehydrated.\n   *\n   * The return value of this function will be serialized and stored in the router's dehydrated state.\n   *\n   * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#dehydrate-method)\n   * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/external-data-loading#critical-dehydrationhydration)\n   */\n  dehydrate?: () => Constrain<\n    TDehydrated,\n    ValidateSerializableInput<Register, TDehydrated>\n  >\n  /**\n   * A function that will be called when the router is hydrated.\n   *\n   * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#hydrate-method)\n   * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/external-data-loading#critical-dehydrationhydration)\n   */\n  hydrate?: (dehydrated: TDehydrated) => Awaitable<void>\n  /**\n   * An array of route masks that will be used to mask routes in the route tree.\n   *\n   * Route masking is when you display a route at a different path than the one it is configured to match, like a modal popup that when shared will unmask to the modal's content instead of the modal's context.\n   *\n   * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#routemasks-property)\n   * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/route-masking)\n   */\n  routeMasks?: Array<RouteMask<TRouteTree>>\n  /**\n   * If `true`, route masks will, by default, be removed when the page is reloaded.\n   *\n   * This can be overridden on a per-mask basis by setting the `unmaskOnReload` option on the mask, or on a per-navigation basis by setting the `unmaskOnReload` option in the `Navigate` options.\n   *\n   * @default false\n   * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#unmaskonreload-property)\n   * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/route-masking#unmasking-on-page-reload)\n   */\n  unmaskOnReload?: boolean\n\n  /**\n   * Use `notFoundComponent` instead.\n   *\n   * @deprecated\n   * See https://tanstack.com/router/v1/docs/guide/not-found-errors#migrating-from-notfoundroute for more info.\n   * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#notfoundroute-property)\n   */\n  notFoundRoute?: AnyRoute\n  /**\n   * Configures how trailing slashes are treated.\n   *\n   * - `'always'` will add a trailing slash if not present\n   * - `'never'` will remove the trailing slash if present\n   * - `'preserve'` will not modify the trailing slash.\n   *\n   * @default 'never'\n   * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#trailingslash-property)\n   */\n  trailingSlash?: TTrailingSlashOption\n  /**\n   * While usually automatic, sometimes it can be useful to force the router into a server-side state, e.g. when using the router in a non-browser environment that has access to a global.document object.\n   *\n   * @default typeof document !== 'undefined'\n   * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#isserver-property)\n   */\n  isServer?: boolean\n\n  /**\n   * @default false\n   */\n  isShell?: boolean\n\n  /**\n   * @default false\n   */\n  isPrerendering?: boolean\n\n  /**\n   * The default `ssr` a route should use if no `ssr` is provided.\n   *\n   * @default true\n   */\n  defaultSsr?: SSROption\n\n  search?: {\n    /**\n     * Configures how unknown search params (= not returned by any `validateSearch`) are treated.\n     *\n     * @default false\n     * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#search.strict-property)\n     */\n    strict?: boolean\n  }\n\n  /**\n   * Configures whether structural sharing is enabled by default for fine-grained selectors.\n   *\n   * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultstructuralsharing-property)\n   */\n  defaultStructuralSharing?: TDefaultStructuralSharingOption\n\n  /**\n   * Configures which URI characters are allowed in path params that would ordinarily be escaped by encodeURIComponent.\n   *\n   * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#pathparamsallowedcharacters-property)\n   * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/path-params#allowed-characters)\n   */\n  pathParamsAllowedCharacters?: Array<\n    ';' | ':' | '@' | '&' | '=' | '+' | '$' | ','\n  >\n\n  defaultRemountDeps?: DefaultRemountDepsFn<TRouteTree>\n\n  /**\n   * If `true`, scroll restoration will be enabled\n   *\n   * @default false\n   */\n  scrollRestoration?:\n    | boolean\n    | ((opts: { location: ParsedLocation }) => boolean)\n\n  /**\n   * A function that will be called to get the key for the scroll restoration cache.\n   *\n   * @default (location) => location.href\n   */\n  getScrollRestorationKey?: (location: ParsedLocation) => string\n  /**\n   * The default behavior for scroll restoration.\n   *\n   * @default 'auto'\n   */\n  scrollRestorationBehavior?: ScrollBehavior\n  /**\n   * An array of selectors that will be used to scroll to the top of the page in addition to `window`\n   *\n   * @default ['window']\n   */\n  scrollToTopSelectors?: Array<string | (() => Element | null | undefined)>\n\n  /**\n   * When `true`, disables the global catch boundary that normally wraps all route matches.\n   * This allows unhandled errors to bubble up to top-level error handlers in the browser.\n   *\n   * Useful for testing tools (like Storybook Test Runner), error reporting services,\n   * and debugging scenarios where you want errors to reach the browser's global error handlers.\n   *\n   * @default false\n   */\n  disableGlobalCatchBoundary?: boolean\n\n  serializationAdapters?: ReadonlyArray<AnySerializationAdapter>\n  /**\n   * Configures how the router will rewrite the location between the actual href and the internal href of the router.\n   *\n   * @default undefined\n   * @description You can provide a custom rewrite pair (in/out).\n   * This is useful for shifting data from the origin to the path (for things like subdomain routing), or other advanced use cases.\n   */\n  rewrite?: LocationRewrite\n  origin?: string\n  ssr?: {\n    nonce?: string\n  }\n}\n\nexport type LocationRewrite = {\n  /**\n   * A function that will be called to rewrite the URL before it is interpreted by the router from the history instance.\n   *\n   * @default undefined\n   */\n  input?: LocationRewriteFunction\n  /**\n   * A function that will be called to rewrite the URL before it is committed to the actual history instance from the router.\n   *\n   * @default undefined\n   */\n  output?: LocationRewriteFunction\n}\n\n/**\n * A function that will be called to rewrite the URL.\n *\n * @param url The URL to rewrite.\n * @returns The rewritten URL (as a URL instance or full href string) or undefined if no rewrite is needed.\n */\nexport type LocationRewriteFunction = ({\n  url,\n}: {\n  url: URL\n}) => undefined | string | URL\n\nexport interface RouterState<\n  in out TRouteTree extends AnyRoute = AnyRoute,\n  in out TRouteMatch = MakeRouteMatchUnion,\n> {\n  status: 'pending' | 'idle'\n  loadedAt: number\n  isLoading: boolean\n  isTransitioning: boolean\n  matches: Array<TRouteMatch>\n  pendingMatches?: Array<TRouteMatch>\n  cachedMatches: Array<TRouteMatch>\n  location: ParsedLocation<FullSearchSchema<TRouteTree>>\n  resolvedLocation?: ParsedLocation<FullSearchSchema<TRouteTree>>\n  statusCode: number\n  redirect?: AnyRedirect\n}\n\nexport interface BuildNextOptions {\n  to?: string | number | null\n  params?: true | Updater<unknown>\n  search?: true | Updater<unknown>\n  hash?: true | Updater<string>\n  state?: true | NonNullableUpdater<ParsedHistoryState, HistoryState>\n  mask?: {\n    to?: string | number | null\n    params?: true | Updater<unknown>\n    search?: true | Updater<unknown>\n    hash?: true | Updater<string>\n    state?: true | NonNullableUpdater<ParsedHistoryState, HistoryState>\n    unmaskOnReload?: boolean\n  }\n  from?: string\n  href?: string\n  _fromLocation?: ParsedLocation\n  unsafeRelative?: 'path'\n  _isNavigate?: boolean\n}\n\ntype NavigationEventInfo = {\n  fromLocation?: ParsedLocation\n  toLocation: ParsedLocation\n  pathChanged: boolean\n  hrefChanged: boolean\n  hashChanged: boolean\n}\n\nexport interface RouterEvents {\n  onBeforeNavigate: {\n    type: 'onBeforeNavigate'\n  } & NavigationEventInfo\n  onBeforeLoad: {\n    type: 'onBeforeLoad'\n  } & NavigationEventInfo\n  onLoad: {\n    type: 'onLoad'\n  } & NavigationEventInfo\n  onResolved: {\n    type: 'onResolved'\n  } & NavigationEventInfo\n  onBeforeRouteMount: {\n    type: 'onBeforeRouteMount'\n  } & NavigationEventInfo\n  onRendered: {\n    type: 'onRendered'\n  } & NavigationEventInfo\n}\n\nexport type RouterEvent = RouterEvents[keyof RouterEvents]\n\nexport type ListenerFn<TEvent extends RouterEvent> = (event: TEvent) => void\n\nexport type RouterListener<TRouterEvent extends RouterEvent> = {\n  eventType: TRouterEvent['type']\n  fn: ListenerFn<TRouterEvent>\n}\n\nexport type SubscribeFn = <TType extends keyof RouterEvents>(\n  eventType: TType,\n  fn: ListenerFn<RouterEvents[TType]>,\n) => () => void\n\nexport interface MatchRoutesOpts {\n  preload?: boolean\n  throwOnError?: boolean\n  _buildLocation?: boolean\n  dest?: BuildNextOptions\n}\n\nexport type InferRouterContext<TRouteTree extends AnyRoute> =\n  TRouteTree['types']['routerContext']\n\nexport type RouterContextOptions<TRouteTree extends AnyRoute> =\n  AnyContext extends InferRouterContext<TRouteTree>\n    ? {\n        context?: InferRouterContext<TRouteTree>\n      }\n    : {\n        context: InferRouterContext<TRouteTree>\n      }\n\nexport type RouterConstructorOptions<\n  TRouteTree extends AnyRoute,\n  TTrailingSlashOption extends TrailingSlashOption,\n  TDefaultStructuralSharingOption extends boolean,\n  TRouterHistory extends RouterHistory,\n  TDehydrated extends Record<string, any>,\n> = Omit<\n  RouterOptions<\n    TRouteTree,\n    TTrailingSlashOption,\n    TDefaultStructuralSharingOption,\n    TRouterHistory,\n    TDehydrated\n  >,\n  'context' | 'serializationAdapters' | 'defaultSsr'\n> &\n  RouterContextOptions<TRouteTree>\n\nexport type PreloadRouteFn<\n  TRouteTree extends AnyRoute,\n  TTrailingSlashOption extends TrailingSlashOption,\n  TDefaultStructuralSharingOption extends boolean,\n  TRouterHistory extends RouterHistory,\n> = <\n  TFrom extends RoutePaths<TRouteTree> | string = string,\n  TTo extends string | undefined = undefined,\n  TMaskFrom extends RoutePaths<TRouteTree> | string = TFrom,\n  TMaskTo extends string = '',\n>(\n  opts: NavigateOptions<\n    RouterCore<\n      TRouteTree,\n      TTrailingSlashOption,\n      TDefaultStructuralSharingOption,\n      TRouterHistory\n    >,\n    TFrom,\n    TTo,\n    TMaskFrom,\n    TMaskTo\n  >,\n) => Promise<Array<AnyRouteMatch> | undefined>\n\nexport type MatchRouteFn<\n  TRouteTree extends AnyRoute,\n  TTrailingSlashOption extends TrailingSlashOption,\n  TDefaultStructuralSharingOption extends boolean,\n  TRouterHistory extends RouterHistory,\n> = <\n  TFrom extends RoutePaths<TRouteTree> = '/',\n  TTo extends string | undefined = undefined,\n  TResolved = ResolveRelativePath<TFrom, NoInfer<TTo>>,\n>(\n  location: ToOptions<\n    RouterCore<\n      TRouteTree,\n      TTrailingSlashOption,\n      TDefaultStructuralSharingOption,\n      TRouterHistory\n    >,\n    TFrom,\n    TTo\n  >,\n  opts?: MatchRouteOptions,\n) => false | RouteById<TRouteTree, TResolved>['types']['allParams']\n\nexport type UpdateFn<\n  TRouteTree extends AnyRoute,\n  TTrailingSlashOption extends TrailingSlashOption,\n  TDefaultStructuralSharingOption extends boolean,\n  TRouterHistory extends RouterHistory,\n  TDehydrated extends Record<string, any>,\n> = (\n  newOptions: RouterConstructorOptions<\n    TRouteTree,\n    TTrailingSlashOption,\n    TDefaultStructuralSharingOption,\n    TRouterHistory,\n    TDehydrated\n  >,\n) => void\n\nexport type InvalidateFn<TRouter extends AnyRouter> = (opts?: {\n  filter?: (d: MakeRouteMatchUnion<TRouter>) => boolean\n  sync?: boolean\n  forcePending?: boolean\n}) => Promise<void>\n\nexport type ParseLocationFn<TRouteTree extends AnyRoute> = (\n  locationToParse: HistoryLocation,\n  previousLocation?: ParsedLocation<FullSearchSchema<TRouteTree>>,\n) => ParsedLocation<FullSearchSchema<TRouteTree>>\n\nexport type GetMatchRoutesFn = (\n  pathname: string,\n  routePathname: string | undefined,\n) => {\n  matchedRoutes: Array<AnyRoute>\n  routeParams: Record<string, string>\n  foundRoute: AnyRoute | undefined\n}\n\nexport type EmitFn = (routerEvent: RouterEvent) => void\n\nexport type LoadFn = (opts?: { sync?: boolean }) => Promise<void>\n\nexport type CommitLocationFn = ({\n  viewTransition,\n  ignoreBlocker,\n  ...next\n}: ParsedLocation & CommitLocationOptions) => Promise<void>\n\nexport type StartTransitionFn = (fn: () => void) => void\n\nexport interface MatchRoutesFn {\n  (\n    pathname: string,\n    locationSearch?: AnySchema,\n    opts?: MatchRoutesOpts,\n  ): Array<MakeRouteMatchUnion>\n  /**\n   * @deprecated use the following signature instead\n   */\n  (next: ParsedLocation, opts?: MatchRoutesOpts): Array<AnyRouteMatch>\n  (\n    pathnameOrNext: string | ParsedLocation,\n    locationSearchOrOpts?: AnySchema | MatchRoutesOpts,\n    opts?: MatchRoutesOpts,\n  ): Array<AnyRouteMatch>\n}\n\nexport type GetMatchFn = (matchId: string) => AnyRouteMatch | undefined\n\nexport type UpdateMatchFn = (\n  id: string,\n  updater: (match: AnyRouteMatch) => AnyRouteMatch,\n) => void\n\nexport type LoadRouteChunkFn = (route: AnyRoute) => Promise<Array<void>>\n\nexport type ResolveRedirect = (err: AnyRedirect) => ResolvedRedirect\n\nexport type ClearCacheFn<TRouter extends AnyRouter> = (opts?: {\n  filter?: (d: MakeRouteMatchUnion<TRouter>) => boolean\n}) => void\n\nexport interface ServerSsr {\n  injectedHtml: Array<InjectedHtmlEntry>\n  injectHtml: (getHtml: () => string | Promise<string>) => Promise<void>\n  injectScript: (\n    getScript: () => string | Promise<string>,\n    opts?: { logScript?: boolean },\n  ) => Promise<void>\n  isDehydrated: () => boolean\n  onRenderFinished: (listener: () => void) => void\n  dehydrate: () => Promise<void>\n}\n\nexport type AnyRouterWithContext<TContext> = RouterCore<\n  AnyRouteWithContext<TContext>,\n  any,\n  any,\n  any,\n  any\n>\n\nexport type AnyRouter = RouterCore<any, any, any, any, any>\n\nexport interface ViewTransitionOptions {\n  types:\n    | Array<string>\n    | ((locationChangeInfo: {\n        fromLocation?: ParsedLocation\n        toLocation: ParsedLocation\n        pathChanged: boolean\n        hrefChanged: boolean\n        hashChanged: boolean\n      }) => Array<string> | false)\n}\n\n// TODO where is this used? can we remove this?\n/**\n * Convert an unknown error into a minimal, serializable object.\n * Includes name and message (and stack in development).\n */\nexport function defaultSerializeError(err: unknown) {\n  if (err instanceof Error) {\n    const obj = {\n      name: err.name,\n      message: err.message,\n    }\n\n    if (process.env.NODE_ENV === 'development') {\n      ;(obj as any).stack = err.stack\n    }\n\n    return obj\n  }\n\n  return {\n    data: err,\n  }\n}\n\n/** Options for configuring trailing-slash behavior. */\nexport const trailingSlashOptions = {\n  always: 'always',\n  never: 'never',\n  preserve: 'preserve',\n} as const\n\nexport type TrailingSlashOption =\n  (typeof trailingSlashOptions)[keyof typeof trailingSlashOptions]\n\n/**\n * Compute whether path, href or hash changed between previous and current\n * resolved locations in router state.\n */\nexport function getLocationChangeInfo(routerState: {\n  resolvedLocation?: ParsedLocation\n  location: ParsedLocation\n}) {\n  const fromLocation = routerState.resolvedLocation\n  const toLocation = routerState.location\n  const pathChanged = fromLocation?.pathname !== toLocation.pathname\n  const hrefChanged = fromLocation?.href !== toLocation.href\n  const hashChanged = fromLocation?.hash !== toLocation.hash\n  return { fromLocation, toLocation, pathChanged, hrefChanged, hashChanged }\n}\n\nexport type CreateRouterFn = <\n  TRouteTree extends AnyRoute,\n  TTrailingSlashOption extends TrailingSlashOption = 'never',\n  TDefaultStructuralSharingOption extends boolean = false,\n  TRouterHistory extends RouterHistory = RouterHistory,\n  TDehydrated extends Record<string, any> = Record<string, any>,\n>(\n  options: undefined extends number\n    ? 'strictNullChecks must be enabled in tsconfig.json'\n    : RouterConstructorOptions<\n        TRouteTree,\n        TTrailingSlashOption,\n        TDefaultStructuralSharingOption,\n        TRouterHistory,\n        TDehydrated\n      >,\n) => RouterCore<\n  TRouteTree,\n  TTrailingSlashOption,\n  TDefaultStructuralSharingOption,\n  TRouterHistory,\n  TDehydrated\n>\n\n/**\n * Core, framework-agnostic router engine that powers TanStack Router.\n *\n * Provides navigation, matching, loading, preloading, caching and event APIs\n * used by framework adapters (React/Solid). Prefer framework helpers like\n * `createRouter` in app code.\n *\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/RouterType\n */\nexport class RouterCore<\n  in out TRouteTree extends AnyRoute,\n  in out TTrailingSlashOption extends TrailingSlashOption,\n  in out TDefaultStructuralSharingOption extends boolean,\n  in out TRouterHistory extends RouterHistory = RouterHistory,\n  in out TDehydrated extends Record<string, any> = Record<string, any>,\n> {\n  // Option-independent properties\n  tempLocationKey: string | undefined = `${Math.round(\n    Math.random() * 10000000,\n  )}`\n  resetNextScroll = true\n  shouldViewTransition?: boolean | ViewTransitionOptions = undefined\n  isViewTransitionTypesSupported?: boolean = undefined\n  subscribers = new Set<RouterListener<RouterEvent>>()\n  viewTransitionPromise?: ControlledPromise<true>\n  isScrollRestoring = false\n  isScrollRestorationSetup = false\n\n  // Must build in constructor\n  __store!: Store<RouterState<TRouteTree>>\n  options!: PickAsRequired<\n    RouterOptions<\n      TRouteTree,\n      TTrailingSlashOption,\n      TDefaultStructuralSharingOption,\n      TRouterHistory,\n      TDehydrated\n    >,\n    'stringifySearch' | 'parseSearch' | 'context'\n  >\n  history!: TRouterHistory\n  rewrite?: LocationRewrite\n  origin?: string\n  latestLocation!: ParsedLocation<FullSearchSchema<TRouteTree>>\n  basepath!: string\n  routeTree!: TRouteTree\n  routesById!: RoutesById<TRouteTree>\n  routesByPath!: RoutesByPath<TRouteTree>\n  flatRoutes!: Array<AnyRoute>\n  isServer!: boolean\n  pathParamsDecodeCharMap?: Map<string, string>\n\n  /**\n   * @deprecated Use the `createRouter` function instead\n   */\n  constructor(\n    options: RouterConstructorOptions<\n      TRouteTree,\n      TTrailingSlashOption,\n      TDefaultStructuralSharingOption,\n      TRouterHistory,\n      TDehydrated\n    >,\n  ) {\n    this.update({\n      defaultPreloadDelay: 50,\n      defaultPendingMs: 1000,\n      defaultPendingMinMs: 500,\n      context: undefined!,\n      ...options,\n      caseSensitive: options.caseSensitive ?? false,\n      notFoundMode: options.notFoundMode ?? 'fuzzy',\n      stringifySearch: options.stringifySearch ?? defaultStringifySearch,\n      parseSearch: options.parseSearch ?? defaultParseSearch,\n    })\n\n    if (typeof document !== 'undefined') {\n      self.__TSR_ROUTER__ = this\n    }\n  }\n\n  // These are default implementations that can optionally be overridden\n  // by the router provider once rendered. We provide these so that the\n  // router can be used in a non-react environment if necessary\n  startTransition: StartTransitionFn = (fn) => fn()\n\n  isShell() {\n    return !!this.options.isShell\n  }\n\n  isPrerendering() {\n    return !!this.options.isPrerendering\n  }\n\n  update: UpdateFn<\n    TRouteTree,\n    TTrailingSlashOption,\n    TDefaultStructuralSharingOption,\n    TRouterHistory,\n    TDehydrated\n  > = (newOptions) => {\n    if (newOptions.notFoundRoute) {\n      console.warn(\n        'The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.',\n      )\n    }\n\n    const prevOptions = this.options\n    const prevBasepath = this.basepath ?? prevOptions?.basepath ?? '/'\n    const basepathWasUnset = this.basepath === undefined\n    const prevRewriteOption = prevOptions?.rewrite\n\n    this.options = {\n      ...prevOptions,\n      ...newOptions,\n    }\n\n    this.isServer = this.options.isServer ?? typeof document === 'undefined'\n\n    this.pathParamsDecodeCharMap = this.options.pathParamsAllowedCharacters\n      ? new Map(\n          this.options.pathParamsAllowedCharacters.map((char) => [\n            encodeURIComponent(char),\n            char,\n          ]),\n        )\n      : undefined\n\n    if (\n      !this.history ||\n      (this.options.history && this.options.history !== this.history)\n    ) {\n      if (!this.options.history) {\n        if (!this.isServer) {\n          this.history = createBrowserHistory() as TRouterHistory\n        }\n      } else {\n        this.history = this.options.history\n      }\n    }\n\n    this.origin = this.options.origin\n    if (!this.origin) {\n      if (!this.isServer && window?.origin && window.origin !== 'null') {\n        this.origin = window.origin\n      } else {\n        // fallback for the server, can be overridden by calling router.update({origin}) on the server\n        this.origin = 'http://localhost'\n      }\n    }\n\n    if (this.history) {\n      this.updateLatestLocation()\n    }\n\n    if (this.options.routeTree !== this.routeTree) {\n      this.routeTree = this.options.routeTree as TRouteTree\n      this.buildRouteTree()\n    }\n\n    if (!this.__store && this.latestLocation) {\n      this.__store = new Store(getInitialRouterState(this.latestLocation), {\n        onUpdate: () => {\n          this.__store.state = {\n            ...this.state,\n            cachedMatches: this.state.cachedMatches.filter(\n              (d) => !['redirected'].includes(d.status),\n            ),\n          }\n        },\n      })\n\n      setupScrollRestoration(this)\n    }\n\n    let needsLocationUpdate = false\n    const nextBasepath = this.options.basepath ?? '/'\n    const nextRewriteOption = this.options.rewrite\n    const basepathChanged = basepathWasUnset || prevBasepath !== nextBasepath\n    const rewriteChanged = prevRewriteOption !== nextRewriteOption\n\n    if (basepathChanged || rewriteChanged) {\n      this.basepath = nextBasepath\n\n      const rewrites: Array<LocationRewrite> = []\n      if (trimPath(nextBasepath) !== '') {\n        rewrites.push(\n          rewriteBasepath({\n            basepath: nextBasepath,\n          }),\n        )\n      }\n      if (nextRewriteOption) {\n        rewrites.push(nextRewriteOption)\n      }\n\n      this.rewrite =\n        rewrites.length === 0\n          ? undefined\n          : rewrites.length === 1\n            ? rewrites[0]\n            : composeRewrites(rewrites)\n\n      if (this.history) {\n        this.updateLatestLocation()\n      }\n\n      needsLocationUpdate = true\n    }\n\n    if (needsLocationUpdate && this.__store) {\n      this.__store.state = {\n        ...this.state,\n        location: this.latestLocation,\n      }\n    }\n\n    if (\n      typeof window !== 'undefined' &&\n      'CSS' in window &&\n      typeof window.CSS?.supports === 'function'\n    ) {\n      this.isViewTransitionTypesSupported = window.CSS.supports(\n        'selector(:active-view-transition-type(a)',\n      )\n    }\n  }\n\n  get state(): RouterState<TRouteTree> {\n    return this.__store.state\n  }\n\n  updateLatestLocation = () => {\n    this.latestLocation = this.parseLocation(\n      this.history.location,\n      this.latestLocation,\n    )\n  }\n\n  buildRouteTree = () => {\n    const { routesById, routesByPath, flatRoutes } = processRouteTree({\n      routeTree: this.routeTree,\n      initRoute: (route, i) => {\n        route.init({\n          originalIndex: i,\n        })\n      },\n    })\n\n    this.routesById = routesById as RoutesById<TRouteTree>\n    this.routesByPath = routesByPath as RoutesByPath<TRouteTree>\n    this.flatRoutes = flatRoutes as Array<AnyRoute>\n\n    const notFoundRoute = this.options.notFoundRoute\n\n    if (notFoundRoute) {\n      notFoundRoute.init({\n        originalIndex: 99999999999,\n      })\n      this.routesById[notFoundRoute.id] = notFoundRoute\n    }\n  }\n\n  /**\n   * Subscribe to router lifecycle events like `onBeforeNavigate`, `onLoad`,\n   * `onResolved`, etc. Returns an unsubscribe function.\n   *\n   * @link https://tanstack.com/router/latest/docs/framework/react/api/router/RouterEventsType\n   */\n  subscribe: SubscribeFn = (eventType, fn) => {\n    const listener: RouterListener<any> = {\n      eventType,\n      fn,\n    }\n\n    this.subscribers.add(listener)\n\n    return () => {\n      this.subscribers.delete(listener)\n    }\n  }\n\n  emit: EmitFn = (routerEvent) => {\n    this.subscribers.forEach((listener) => {\n      if (listener.eventType === routerEvent.type) {\n        listener.fn(routerEvent)\n      }\n    })\n  }\n\n  /**\n   * Parse a HistoryLocation into a strongly-typed ParsedLocation using the\n   * current router options, rewrite rules and search parser/stringifier.\n   */\n  parseLocation: ParseLocationFn<TRouteTree> = (\n    locationToParse,\n    previousLocation,\n  ) => {\n    const parse = ({\n      href,\n      state,\n    }: HistoryLocation): ParsedLocation<FullSearchSchema<TRouteTree>> => {\n      // Before we do any processing, we need to allow rewrites to modify the URL\n      // build up the full URL by combining the href from history with the router's origin\n      const fullUrl = new URL(href, this.origin)\n      const url = executeRewriteInput(this.rewrite, fullUrl)\n\n      const parsedSearch = this.options.parseSearch(url.search)\n      const searchStr = this.options.stringifySearch(parsedSearch)\n      // Make sure our final url uses the re-stringified pathname, search, and has for consistency\n      // (We were already doing this, so just keeping it for now)\n      url.search = searchStr\n\n      const fullPath = url.href.replace(url.origin, '')\n\n      const { pathname, hash } = url\n\n      return {\n        href: fullPath,\n        publicHref: href,\n        url: url.href,\n        pathname,\n        searchStr,\n        search: replaceEqualDeep(previousLocation?.search, parsedSearch) as any,\n        hash: hash.split('#').reverse()[0] ?? '',\n        state: replaceEqualDeep(previousLocation?.state, state),\n      }\n    }\n\n    const location = parse(locationToParse)\n\n    const { __tempLocation, __tempKey } = location.state\n\n    if (__tempLocation && (!__tempKey || __tempKey === this.tempLocationKey)) {\n      // Sync up the location keys\n      const parsedTempLocation = parse(__tempLocation) as any\n      parsedTempLocation.state.key = location.state.key // TODO: Remove in v2 - use __TSR_key instead\n      parsedTempLocation.state.__TSR_key = location.state.__TSR_key\n\n      delete parsedTempLocation.state.__tempLocation\n\n      return {\n        ...parsedTempLocation,\n        maskedLocation: location,\n      }\n    }\n    return location\n  }\n\n  /** Resolve a path against the router basepath and trailing-slash policy. */\n  resolvePathWithBase = (from: string, path: string) => {\n    const resolvedPath = resolvePath({\n      base: from,\n      to: cleanPath(path),\n      trailingSlash: this.options.trailingSlash,\n      parseCache: this.parsePathnameCache,\n    })\n    return resolvedPath\n  }\n\n  get looseRoutesById() {\n    return this.routesById as Record<string, AnyRoute>\n  }\n\n  matchRoutes: MatchRoutesFn = (\n    pathnameOrNext: string | ParsedLocation,\n    locationSearchOrOpts?: AnySchema | MatchRoutesOpts,\n    opts?: MatchRoutesOpts,\n  ) => {\n    if (typeof pathnameOrNext === 'string') {\n      return this.matchRoutesInternal(\n        {\n          pathname: pathnameOrNext,\n          search: locationSearchOrOpts,\n        } as ParsedLocation,\n        opts,\n      )\n    }\n\n    return this.matchRoutesInternal(pathnameOrNext, locationSearchOrOpts)\n  }\n\n  private matchRoutesInternal(\n    next: ParsedLocation,\n    opts?: MatchRoutesOpts,\n  ): Array<AnyRouteMatch> {\n    const { foundRoute, matchedRoutes, routeParams } = this.getMatchedRoutes(\n      next.pathname,\n      opts?.dest?.to as string,\n    )\n    let isGlobalNotFound = false\n\n    // Check to see if the route needs a 404 entry\n    if (\n      // If we found a route, and it's not an index route and we have left over path\n      foundRoute\n        ? foundRoute.path !== '/' && routeParams['**']\n        : // Or if we didn't find a route and we have left over path\n          trimPathRight(next.pathname)\n    ) {\n      // If the user has defined an (old) 404 route, use it\n      if (this.options.notFoundRoute) {\n        matchedRoutes.push(this.options.notFoundRoute)\n      } else {\n        // If there is no routes found during path matching\n        isGlobalNotFound = true\n      }\n    }\n\n    const globalNotFoundRouteId = (() => {\n      if (!isGlobalNotFound) {\n        return undefined\n      }\n\n      if (this.options.notFoundMode !== 'root') {\n        for (let i = matchedRoutes.length - 1; i >= 0; i--) {\n          const route = matchedRoutes[i]!\n          if (route.children) {\n            return route.id\n          }\n        }\n      }\n\n      return rootRouteId\n    })()\n\n    const matches: Array<AnyRouteMatch> = []\n\n    const getParentContext = (parentMatch?: AnyRouteMatch) => {\n      const parentMatchId = parentMatch?.id\n\n      const parentContext = !parentMatchId\n        ? ((this.options.context as any) ?? undefined)\n        : (parentMatch.context ?? this.options.context ?? undefined)\n\n      return parentContext\n    }\n\n    matchedRoutes.forEach((route, index) => {\n      // Take each matched route and resolve + validate its search params\n      // This has to happen serially because each route's search params\n      // can depend on the parent route's search params\n      // It must also happen before we create the match so that we can\n      // pass the search params to the route's potential key function\n      // which is used to uniquely identify the route match in state\n\n      const parentMatch = matches[index - 1]\n\n      const [preMatchSearch, strictMatchSearch, searchError]: [\n        Record<string, any>,\n        Record<string, any>,\n        any,\n      ] = (() => {\n        // Validate the search params and stabilize them\n        const parentSearch = parentMatch?.search ?? next.search\n        const parentStrictSearch = parentMatch?._strictSearch ?? undefined\n\n        try {\n          const strictSearch =\n            validateSearch(route.options.validateSearch, { ...parentSearch }) ??\n            undefined\n\n          return [\n            {\n              ...parentSearch,\n              ...strictSearch,\n            },\n            { ...parentStrictSearch, ...strictSearch },\n            undefined,\n          ]\n        } catch (err: any) {\n          let searchParamError = err\n          if (!(err instanceof SearchParamError)) {\n            searchParamError = new SearchParamError(err.message, {\n              cause: err,\n            })\n          }\n\n          if (opts?.throwOnError) {\n            throw searchParamError\n          }\n\n          return [parentSearch, {}, searchParamError]\n        }\n      })()\n\n      // This is where we need to call route.options.loaderDeps() to get any additional\n      // deps that the route's loader function might need to run. We need to do this\n      // before we create the match so that we can pass the deps to the route's\n      // potential key function which is used to uniquely identify the route match in state\n\n      const loaderDeps =\n        route.options.loaderDeps?.({\n          search: preMatchSearch,\n        }) ?? ''\n\n      const loaderDepsHash = loaderDeps ? JSON.stringify(loaderDeps) : ''\n\n      const { interpolatedPath, usedParams } = interpolatePath({\n        path: route.fullPath,\n        params: routeParams,\n        decodeCharMap: this.pathParamsDecodeCharMap,\n      })\n\n      // Waste not, want not. If we already have a match for this route,\n      // reuse it. This is important for layout routes, which might stick\n      // around between navigation actions that only change leaf routes.\n\n      // Existing matches are matches that are already loaded along with\n      // pending matches that are still loading\n      const matchId =\n        interpolatePath({\n          path: route.id,\n          params: routeParams,\n          leaveWildcards: true,\n          decodeCharMap: this.pathParamsDecodeCharMap,\n          parseCache: this.parsePathnameCache,\n        }).interpolatedPath + loaderDepsHash\n\n      const existingMatch = this.getMatch(matchId)\n\n      const previousMatch = this.state.matches.find(\n        (d) => d.routeId === route.id,\n      )\n\n      const strictParams = existingMatch?._strictParams ?? usedParams\n\n      let paramsError: PathParamError | undefined = undefined\n\n      if (!existingMatch) {\n        const strictParseParams =\n          route.options.params?.parse ?? route.options.parseParams\n\n        if (strictParseParams) {\n          try {\n            Object.assign(\n              strictParams,\n              strictParseParams(strictParams as Record<string, string>),\n            )\n          } catch (err: any) {\n            paramsError = new PathParamError(err.message, {\n              cause: err,\n            })\n\n            if (opts?.throwOnError) {\n              throw paramsError\n            }\n          }\n        }\n      }\n\n      Object.assign(routeParams, strictParams)\n\n      const cause = previousMatch ? 'stay' : 'enter'\n\n      let match: AnyRouteMatch\n\n      if (existingMatch) {\n        match = {\n          ...existingMatch,\n          cause,\n          params: previousMatch\n            ? replaceEqualDeep(previousMatch.params, routeParams)\n            : routeParams,\n          _strictParams: strictParams,\n          search: previousMatch\n            ? replaceEqualDeep(previousMatch.search, preMatchSearch)\n            : replaceEqualDeep(existingMatch.search, preMatchSearch),\n          _strictSearch: strictMatchSearch,\n        }\n      } else {\n        const status =\n          route.options.loader ||\n          route.options.beforeLoad ||\n          route.lazyFn ||\n          routeNeedsPreload(route)\n            ? 'pending'\n            : 'success'\n\n        match = {\n          id: matchId,\n          index,\n          routeId: route.id,\n          params: previousMatch\n            ? replaceEqualDeep(previousMatch.params, routeParams)\n            : routeParams,\n          _strictParams: strictParams,\n          pathname: interpolatedPath,\n          updatedAt: Date.now(),\n          search: previousMatch\n            ? replaceEqualDeep(previousMatch.search, preMatchSearch)\n            : preMatchSearch,\n          _strictSearch: strictMatchSearch,\n          searchError: undefined,\n          status,\n          isFetching: false,\n          error: undefined,\n          paramsError,\n          __routeContext: undefined,\n          _nonReactive: {\n            loadPromise: createControlledPromise(),\n          },\n          __beforeLoadContext: undefined,\n          context: {},\n          abortController: new AbortController(),\n          fetchCount: 0,\n          cause,\n          loaderDeps: previousMatch\n            ? replaceEqualDeep(previousMatch.loaderDeps, loaderDeps)\n            : loaderDeps,\n          invalid: false,\n          preload: false,\n          links: undefined,\n          scripts: undefined,\n          headScripts: undefined,\n          meta: undefined,\n          staticData: route.options.staticData || {},\n          fullPath: route.fullPath,\n        }\n      }\n\n      if (!opts?.preload) {\n        // If we have a global not found, mark the right match as global not found\n        match.globalNotFound = globalNotFoundRouteId === route.id\n      }\n\n      // update the searchError if there is one\n      match.searchError = searchError\n\n      const parentContext = getParentContext(parentMatch)\n\n      match.context = {\n        ...parentContext,\n        ...match.__routeContext,\n        ...match.__beforeLoadContext,\n      }\n\n      matches.push(match)\n    })\n\n    matches.forEach((match, index) => {\n      const route = this.looseRoutesById[match.routeId]!\n      const existingMatch = this.getMatch(match.id)\n\n      // only execute `context` if we are not calling from router.buildLocation\n\n      if (!existingMatch && opts?._buildLocation !== true) {\n        const parentMatch = matches[index - 1]\n        const parentContext = getParentContext(parentMatch)\n\n        // Update the match's context\n\n        if (route.options.context) {\n          const contextFnContext: RouteContextOptions<any, any, any, any> = {\n            deps: match.loaderDeps,\n            params: match.params,\n            context: parentContext ?? {},\n            location: next,\n            navigate: (opts: any) =>\n              this.navigate({ ...opts, _fromLocation: next }),\n            buildLocation: this.buildLocation,\n            cause: match.cause,\n            abortController: match.abortController,\n            preload: !!match.preload,\n            matches,\n          }\n          // Get the route context\n          match.__routeContext =\n            route.options.context(contextFnContext) ?? undefined\n        }\n\n        match.context = {\n          ...parentContext,\n          ...match.__routeContext,\n          ...match.__beforeLoadContext,\n        }\n      }\n    })\n\n    return matches\n  }\n\n  /** a cache for `parsePathname` */\n  private parsePathnameCache: ParsePathnameCache = createLRUCache(1000)\n\n  getMatchedRoutes: GetMatchRoutesFn = (\n    pathname: string,\n    routePathname: string | undefined,\n  ) => {\n    return getMatchedRoutes({\n      pathname,\n      routePathname,\n      caseSensitive: this.options.caseSensitive,\n      routesByPath: this.routesByPath,\n      routesById: this.routesById,\n      flatRoutes: this.flatRoutes,\n      parseCache: this.parsePathnameCache,\n    })\n  }\n\n  cancelMatch = (id: string) => {\n    const match = this.getMatch(id)\n\n    if (!match) return\n\n    match.abortController.abort()\n    clearTimeout(match._nonReactive.pendingTimeout)\n    match._nonReactive.pendingTimeout = undefined\n  }\n\n  cancelMatches = () => {\n    this.state.pendingMatches?.forEach((match) => {\n      this.cancelMatch(match.id)\n    })\n  }\n\n  /**\n   * Build the next ParsedLocation from navigation options without committing.\n   * Resolves `to`/`from`, params/search/hash/state, applies search validation\n   * and middlewares, and returns a stable, stringified location object.\n   *\n   * @link https://tanstack.com/router/latest/docs/framework/react/api/router/RouterType#buildlocation-method\n   */\n  buildLocation: BuildLocationFn = (opts) => {\n    const build = (\n      dest: BuildNextOptions & {\n        unmaskOnReload?: boolean\n      } = {},\n    ): ParsedLocation => {\n      // We allow the caller to override the current location\n      const currentLocation = dest._fromLocation || this.latestLocation\n\n      const allCurrentLocationMatches = this.matchRoutes(currentLocation, {\n        _buildLocation: true,\n      })\n\n      // Now let's find the starting pathname\n      // This should default to the current location if no from is provided\n      const lastMatch = last(allCurrentLocationMatches)!\n\n      // check that from path exists in the current route tree\n      // do this check only on navigations during test or development\n      if (\n        dest.from &&\n        process.env.NODE_ENV !== 'production' &&\n        dest._isNavigate\n      ) {\n        const allFromMatches = this.getMatchedRoutes(\n          dest.from,\n          undefined,\n        ).matchedRoutes\n\n        const matchedFrom = findLast(allCurrentLocationMatches, (d) => {\n          return comparePaths(d.fullPath, dest.from!)\n        })\n\n        const matchedCurrent = findLast(allFromMatches, (d) => {\n          return comparePaths(d.fullPath, lastMatch.fullPath)\n        })\n\n        // for from to be invalid it shouldn't just be unmatched to currentLocation\n        // but the currentLocation should also be unmatched to from\n        if (!matchedFrom && !matchedCurrent) {\n          console.warn(`Could not find match for from: ${dest.from}`)\n        }\n      }\n\n      const defaultedFromPath =\n        dest.unsafeRelative === 'path'\n          ? currentLocation.pathname\n          : (dest.from ?? lastMatch.fullPath)\n\n      // ensure this includes the basePath if set\n      const fromPath = this.resolvePathWithBase(defaultedFromPath, '.')\n\n      // From search should always use the current location\n      const fromSearch = lastMatch.search\n      // Same with params. It can't hurt to provide as many as possible\n      const fromParams = { ...lastMatch.params }\n\n      // Resolve the next to\n      // ensure this includes the basePath if set\n      const nextTo = dest.to\n        ? this.resolvePathWithBase(fromPath, `${dest.to}`)\n        : this.resolvePathWithBase(fromPath, '.')\n\n      // Resolve the next params\n      const nextParams =\n        dest.params === false || dest.params === null\n          ? {}\n          : (dest.params ?? true) === true\n            ? fromParams\n            : Object.assign(\n                fromParams,\n                functionalUpdate(dest.params as any, fromParams),\n              )\n\n      // Interpolate the path first to get the actual resolved path, then match against that\n      const interpolatedNextTo = interpolatePath({\n        path: nextTo,\n        params: nextParams,\n        parseCache: this.parsePathnameCache,\n      }).interpolatedPath\n\n      const destRoutes = this.matchRoutes(interpolatedNextTo, undefined, {\n        _buildLocation: true,\n      }).map((d) => this.looseRoutesById[d.routeId]!)\n\n      // If there are any params, we need to stringify them\n      if (Object.keys(nextParams).length > 0) {\n        for (const route of destRoutes) {\n          const fn =\n            route.options.params?.stringify ?? route.options.stringifyParams\n          if (fn) {\n            Object.assign(nextParams, fn(nextParams))\n          }\n        }\n      }\n\n      const nextPathname = decodePathSegment(\n        interpolatePath({\n          // Use the original template path for interpolation\n          // This preserves the original parameter syntax including optional parameters\n          path: nextTo,\n          params: nextParams,\n          leaveWildcards: false,\n          leaveParams: opts.leaveParams,\n          decodeCharMap: this.pathParamsDecodeCharMap,\n          parseCache: this.parsePathnameCache,\n        }).interpolatedPath,\n      )\n\n      // Resolve the next search\n      let nextSearch = fromSearch\n      if (opts._includeValidateSearch && this.options.search?.strict) {\n        const validatedSearch = {}\n        destRoutes.forEach((route) => {\n          if (route.options.validateSearch) {\n            try {\n              Object.assign(\n                validatedSearch,\n                validateSearch(route.options.validateSearch, {\n                  ...validatedSearch,\n                  ...nextSearch,\n                }),\n              )\n            } catch {\n              // ignore errors here because they are already handled in matchRoutes\n            }\n          }\n        })\n        nextSearch = validatedSearch\n      }\n\n      nextSearch = applySearchMiddleware({\n        search: nextSearch,\n        dest,\n        destRoutes,\n        _includeValidateSearch: opts._includeValidateSearch,\n      })\n\n      // Replace the equal deep\n      nextSearch = replaceEqualDeep(fromSearch, nextSearch)\n\n      // Stringify the next search\n      const searchStr = this.options.stringifySearch(nextSearch)\n\n      // Resolve the next hash\n      const hash =\n        dest.hash === true\n          ? currentLocation.hash\n          : dest.hash\n            ? functionalUpdate(dest.hash, currentLocation.hash)\n            : undefined\n\n      // Resolve the next hash string\n      const hashStr = hash ? `#${hash}` : ''\n\n      // Resolve the next state\n      let nextState =\n        dest.state === true\n          ? currentLocation.state\n          : dest.state\n            ? functionalUpdate(dest.state, currentLocation.state)\n            : {}\n\n      // Replace the equal deep\n      nextState = replaceEqualDeep(currentLocation.state, nextState)\n\n      // Create the full path of the location\n      const fullPath = `${nextPathname}${searchStr}${hashStr}`\n\n      // Create the new href with full origin\n      const url = new URL(fullPath, this.origin)\n\n      // If a rewrite function is provided, use it to rewrite the URL\n      const rewrittenUrl = executeRewriteOutput(this.rewrite, url)\n\n      return {\n        publicHref:\n          rewrittenUrl.pathname + rewrittenUrl.search + rewrittenUrl.hash,\n        href: fullPath,\n        url: rewrittenUrl.href,\n        pathname: nextPathname,\n        search: nextSearch,\n        searchStr,\n        state: nextState as any,\n        hash: hash ?? '',\n        unmaskOnReload: dest.unmaskOnReload,\n      }\n    }\n\n    const buildWithMatches = (\n      dest: BuildNextOptions = {},\n      maskedDest?: BuildNextOptions,\n    ) => {\n      const next = build(dest)\n\n      let maskedNext = maskedDest ? build(maskedDest) : undefined\n\n      if (!maskedNext) {\n        let params = {}\n\n        const foundMask = this.options.routeMasks?.find((d) => {\n          const match = matchPathname(\n            next.pathname,\n            {\n              to: d.from,\n              caseSensitive: false,\n              fuzzy: false,\n            },\n            this.parsePathnameCache,\n          )\n\n          if (match) {\n            params = match\n            return true\n          }\n\n          return false\n        })\n\n        if (foundMask) {\n          const { from: _from, ...maskProps } = foundMask\n          maskedDest = {\n            from: opts.from,\n            ...maskProps,\n            params,\n          }\n          maskedNext = build(maskedDest)\n        }\n      }\n\n      if (maskedNext) {\n        next.maskedLocation = maskedNext\n      }\n\n      return next\n    }\n\n    if (opts.mask) {\n      return buildWithMatches(opts, {\n        from: opts.from,\n        ...opts.mask,\n      })\n    }\n\n    return buildWithMatches(opts)\n  }\n\n  commitLocationPromise: undefined | ControlledPromise<void>\n\n  /**\n   * Commit a previously built location to history (push/replace), optionally\n   * using view transitions and scroll restoration options.\n   */\n  commitLocation: CommitLocationFn = ({\n    viewTransition,\n    ignoreBlocker,\n    ...next\n  }) => {\n    const isSameState = () => {\n      // the following props are ignored but may still be provided when navigating,\n      // temporarily add the previous values to the next state so they don't affect\n      // the comparison\n      const ignoredProps = [\n        'key', // TODO: Remove in v2 - use __TSR_key instead\n        '__TSR_key',\n        '__TSR_index',\n        '__hashScrollIntoViewOptions',\n      ] as const\n      ignoredProps.forEach((prop) => {\n        ;(next.state as any)[prop] = this.latestLocation.state[prop]\n      })\n      const isEqual = deepEqual(next.state, this.latestLocation.state)\n      ignoredProps.forEach((prop) => {\n        delete next.state[prop]\n      })\n      return isEqual\n    }\n\n    const isSameUrl =\n      trimPathRight(this.latestLocation.href) === trimPathRight(next.href)\n\n    const previousCommitPromise = this.commitLocationPromise\n    this.commitLocationPromise = createControlledPromise<void>(() => {\n      previousCommitPromise?.resolve()\n    })\n\n    // Don't commit to history if nothing changed\n    if (isSameUrl && isSameState()) {\n      this.load()\n    } else {\n      // eslint-disable-next-line prefer-const\n      let { maskedLocation, hashScrollIntoView, ...nextHistory } = next\n\n      if (maskedLocation) {\n        nextHistory = {\n          ...maskedLocation,\n          state: {\n            ...maskedLocation.state,\n            __tempKey: undefined,\n            __tempLocation: {\n              ...nextHistory,\n              search: nextHistory.searchStr,\n              state: {\n                ...nextHistory.state,\n                __tempKey: undefined!,\n                __tempLocation: undefined!,\n                __TSR_key: undefined!,\n                key: undefined!, // TODO: Remove in v2 - use __TSR_key instead\n              },\n            },\n          },\n        }\n\n        if (\n          nextHistory.unmaskOnReload ??\n          this.options.unmaskOnReload ??\n          false\n        ) {\n          nextHistory.state.__tempKey = this.tempLocationKey\n        }\n      }\n\n      nextHistory.state.__hashScrollIntoViewOptions =\n        hashScrollIntoView ?? this.options.defaultHashScrollIntoView ?? true\n\n      this.shouldViewTransition = viewTransition\n\n      this.history[next.replace ? 'replace' : 'push'](\n        nextHistory.publicHref,\n        nextHistory.state,\n        { ignoreBlocker },\n      )\n    }\n\n    this.resetNextScroll = next.resetScroll ?? true\n\n    if (!this.history.subscribers.size) {\n      this.load()\n    }\n\n    return this.commitLocationPromise\n  }\n\n  /** Convenience helper: build a location from options, then commit it. */\n  buildAndCommitLocation = ({\n    replace,\n    resetScroll,\n    hashScrollIntoView,\n    viewTransition,\n    ignoreBlocker,\n    href,\n    ...rest\n  }: BuildNextOptions & CommitLocationOptions = {}) => {\n    if (href) {\n      const currentIndex = this.history.location.state.__TSR_index\n\n      const parsed = parseHref(href, {\n        __TSR_index: replace ? currentIndex : currentIndex + 1,\n      })\n      rest.to = parsed.pathname\n      rest.search = this.options.parseSearch(parsed.search)\n      // remove the leading `#` from the hash\n      rest.hash = parsed.hash.slice(1)\n    }\n\n    const location = this.buildLocation({\n      ...(rest as any),\n      _includeValidateSearch: true,\n    })\n\n    return this.commitLocation({\n      ...location,\n      viewTransition,\n      replace,\n      resetScroll,\n      hashScrollIntoView,\n      ignoreBlocker,\n    })\n  }\n\n  /**\n   * Imperatively navigate using standard `NavigateOptions`. When `reloadDocument`\n   * or an absolute `href` is provided, performs a full document navigation.\n   * Otherwise, builds and commits a client-side location.\n   *\n   * @link https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType\n   */\n  navigate: NavigateFn = ({ to, reloadDocument, href, ...rest }) => {\n    if (!reloadDocument && href) {\n      try {\n        new URL(`${href}`)\n        reloadDocument = true\n      } catch {}\n    }\n\n    if (reloadDocument) {\n      if (!href) {\n        const location = this.buildLocation({ to, ...rest } as any)\n        href = location.url\n      }\n      if (rest.replace) {\n        window.location.replace(href)\n      } else {\n        window.location.href = href\n      }\n      return Promise.resolve()\n    }\n\n    return this.buildAndCommitLocation({\n      ...rest,\n      href,\n      to: to as string,\n      _isNavigate: true,\n    })\n  }\n\n  latestLoadPromise: undefined | Promise<void>\n\n  beforeLoad = () => {\n    // Cancel any pending matches\n    this.cancelMatches()\n    this.updateLatestLocation()\n\n    if (this.isServer) {\n      // for SPAs on the initial load, this is handled by the Transitioner\n      const nextLocation = this.buildLocation({\n        to: this.latestLocation.pathname,\n        search: true,\n        params: true,\n        hash: true,\n        state: true,\n        _includeValidateSearch: true,\n      })\n\n      // Normalize URLs for comparison to handle encoding differences\n      // Browser history always stores encoded URLs while buildLocation may produce decoded URLs\n      const normalizeUrl = (url: string) => {\n        try {\n          return encodeURI(decodeURI(url))\n        } catch {\n          return url\n        }\n      }\n\n      if (\n        trimPath(normalizeUrl(this.latestLocation.href)) !==\n        trimPath(normalizeUrl(nextLocation.href))\n      ) {\n        let href = nextLocation.url\n        if (this.origin && href.startsWith(this.origin)) {\n          href = href.replace(this.origin, '') || '/'\n        }\n\n        throw redirect({ href })\n      }\n    }\n\n    // Match the routes\n    const pendingMatches = this.matchRoutes(this.latestLocation)\n\n    // Ingest the new matches\n    this.__store.setState((s) => ({\n      ...s,\n      status: 'pending',\n      statusCode: 200,\n      isLoading: true,\n      location: this.latestLocation,\n      pendingMatches,\n      // If a cached moved to pendingMatches, remove it from cachedMatches\n      cachedMatches: s.cachedMatches.filter(\n        (d) => !pendingMatches.some((e) => e.id === d.id),\n      ),\n    }))\n  }\n\n  load: LoadFn = async (opts?: { sync?: boolean }): Promise<void> => {\n    let redirect: AnyRedirect | undefined\n    let notFound: NotFoundError | undefined\n    let loadPromise: Promise<void>\n\n    // eslint-disable-next-line prefer-const\n    loadPromise = new Promise<void>((resolve) => {\n      this.startTransition(async () => {\n        try {\n          this.beforeLoad()\n          const next = this.latestLocation\n          const prevLocation = this.state.resolvedLocation\n\n          if (!this.state.redirect) {\n            this.emit({\n              type: 'onBeforeNavigate',\n              ...getLocationChangeInfo({\n                resolvedLocation: prevLocation,\n                location: next,\n              }),\n            })\n          }\n\n          this.emit({\n            type: 'onBeforeLoad',\n            ...getLocationChangeInfo({\n              resolvedLocation: prevLocation,\n              location: next,\n            }),\n          })\n\n          await loadMatches({\n            router: this,\n            sync: opts?.sync,\n            matches: this.state.pendingMatches as Array<AnyRouteMatch>,\n            location: next,\n            updateMatch: this.updateMatch,\n            // eslint-disable-next-line @typescript-eslint/require-await\n            onReady: async () => {\n              // eslint-disable-next-line @typescript-eslint/require-await\n              this.startViewTransition(async () => {\n                // this.viewTransitionPromise = createControlledPromise<true>()\n\n                // Commit the pending matches. If a previous match was\n                // removed, place it in the cachedMatches\n                let exitingMatches!: Array<AnyRouteMatch>\n                let enteringMatches!: Array<AnyRouteMatch>\n                let stayingMatches!: Array<AnyRouteMatch>\n\n                batch(() => {\n                  this.__store.setState((s) => {\n                    const previousMatches = s.matches\n                    const newMatches = s.pendingMatches || s.matches\n\n                    exitingMatches = previousMatches.filter(\n                      (match) => !newMatches.some((d) => d.id === match.id),\n                    )\n                    enteringMatches = newMatches.filter(\n                      (match) =>\n                        !previousMatches.some((d) => d.id === match.id),\n                    )\n                    stayingMatches = previousMatches.filter((match) =>\n                      newMatches.some((d) => d.id === match.id),\n                    )\n\n                    return {\n                      ...s,\n                      isLoading: false,\n                      loadedAt: Date.now(),\n                      matches: newMatches,\n                      pendingMatches: undefined,\n                      cachedMatches: [\n                        ...s.cachedMatches,\n                        ...exitingMatches.filter((d) => d.status !== 'error'),\n                      ],\n                    }\n                  })\n                  this.clearExpiredCache()\n                })\n\n                //\n                ;(\n                  [\n                    [exitingMatches, 'onLeave'],\n                    [enteringMatches, 'onEnter'],\n                    [stayingMatches, 'onStay'],\n                  ] as const\n                ).forEach(([matches, hook]) => {\n                  matches.forEach((match) => {\n                    this.looseRoutesById[match.routeId]!.options[hook]?.(match)\n                  })\n                })\n              })\n            },\n          })\n        } catch (err) {\n          if (isRedirect(err)) {\n            redirect = err\n            if (!this.isServer) {\n              this.navigate({\n                ...redirect.options,\n                replace: true,\n                ignoreBlocker: true,\n              })\n            }\n          } else if (isNotFound(err)) {\n            notFound = err\n          }\n\n          this.__store.setState((s) => ({\n            ...s,\n            statusCode: redirect\n              ? redirect.status\n              : notFound\n                ? 404\n                : s.matches.some((d) => d.status === 'error')\n                  ? 500\n                  : 200,\n            redirect,\n          }))\n        }\n\n        if (this.latestLoadPromise === loadPromise) {\n          this.commitLocationPromise?.resolve()\n          this.latestLoadPromise = undefined\n          this.commitLocationPromise = undefined\n        }\n\n        resolve()\n      })\n    })\n\n    this.latestLoadPromise = loadPromise\n\n    await loadPromise\n\n    while (\n      (this.latestLoadPromise as any) &&\n      loadPromise !== this.latestLoadPromise\n    ) {\n      await this.latestLoadPromise\n    }\n\n    let newStatusCode: number | undefined = undefined\n    if (this.hasNotFoundMatch()) {\n      newStatusCode = 404\n    } else if (this.__store.state.matches.some((d) => d.status === 'error')) {\n      newStatusCode = 500\n    }\n    if (newStatusCode !== undefined) {\n      this.__store.setState((s) => ({\n        ...s,\n        statusCode: newStatusCode,\n      }))\n    }\n  }\n\n  startViewTransition = (fn: () => Promise<void>) => {\n    // Determine if we should start a view transition from the navigation\n    // or from the router default\n    const shouldViewTransition =\n      this.shouldViewTransition ?? this.options.defaultViewTransition\n\n    // Reset the view transition flag\n    delete this.shouldViewTransition\n    // Attempt to start a view transition (or just apply the changes if we can't)\n    if (\n      shouldViewTransition &&\n      typeof document !== 'undefined' &&\n      'startViewTransition' in document &&\n      typeof document.startViewTransition === 'function'\n    ) {\n      // lib.dom.ts doesn't support viewTransition types variant yet.\n      // TODO: Fix this when dom types are updated\n      let startViewTransitionParams: any\n\n      if (\n        typeof shouldViewTransition === 'object' &&\n        this.isViewTransitionTypesSupported\n      ) {\n        const next = this.latestLocation\n        const prevLocation = this.state.resolvedLocation\n\n        const resolvedViewTransitionTypes =\n          typeof shouldViewTransition.types === 'function'\n            ? shouldViewTransition.types(\n                getLocationChangeInfo({\n                  resolvedLocation: prevLocation,\n                  location: next,\n                }),\n              )\n            : shouldViewTransition.types\n\n        if (resolvedViewTransitionTypes === false) {\n          fn()\n          return\n        }\n\n        startViewTransitionParams = {\n          update: fn,\n          types: resolvedViewTransitionTypes,\n        }\n      } else {\n        startViewTransitionParams = fn\n      }\n\n      document.startViewTransition(startViewTransitionParams)\n    } else {\n      fn()\n    }\n  }\n\n  updateMatch: UpdateMatchFn = (id, updater) => {\n    const matchesKey = this.state.pendingMatches?.some((d) => d.id === id)\n      ? 'pendingMatches'\n      : this.state.matches.some((d) => d.id === id)\n        ? 'matches'\n        : this.state.cachedMatches.some((d) => d.id === id)\n          ? 'cachedMatches'\n          : ''\n\n    if (matchesKey) {\n      this.__store.setState((s) => ({\n        ...s,\n        [matchesKey]: s[matchesKey]?.map((d) => (d.id === id ? updater(d) : d)),\n      }))\n    }\n  }\n\n  getMatch: GetMatchFn = (matchId: string) => {\n    const findFn = (d: { id: string }) => d.id === matchId\n    return (\n      this.state.cachedMatches.find(findFn) ??\n      this.state.pendingMatches?.find(findFn) ??\n      this.state.matches.find(findFn)\n    )\n  }\n\n  invalidate: InvalidateFn<\n    RouterCore<\n      TRouteTree,\n      TTrailingSlashOption,\n      TDefaultStructuralSharingOption,\n      TRouterHistory,\n      TDehydrated\n    >\n  > = (opts) => {\n    const invalidate = (d: MakeRouteMatch<TRouteTree>) => {\n      if (opts?.filter?.(d as MakeRouteMatchUnion<this>) ?? true) {\n        return {\n          ...d,\n          invalid: true,\n          ...(opts?.forcePending || d.status === 'error'\n            ? ({ status: 'pending', error: undefined } as const)\n            : undefined),\n        }\n      }\n      return d\n    }\n\n    this.__store.setState((s) => ({\n      ...s,\n      matches: s.matches.map(invalidate),\n      cachedMatches: s.cachedMatches.map(invalidate),\n      pendingMatches: s.pendingMatches?.map(invalidate),\n    }))\n\n    this.shouldViewTransition = false\n    return this.load({ sync: opts?.sync })\n  }\n\n  resolveRedirect = (redirect: AnyRedirect): AnyRedirect => {\n    if (!redirect.options.href) {\n      const location = this.buildLocation(redirect.options)\n      let href = location.url\n      if (this.origin && href.startsWith(this.origin)) {\n        href = href.replace(this.origin, '') || '/'\n      }\n      redirect.options.href = location.href\n      redirect.headers.set('Location', href)\n    }\n    if (!redirect.headers.get('Location')) {\n      redirect.headers.set('Location', redirect.options.href)\n    }\n    return redirect\n  }\n\n  clearCache: ClearCacheFn<this> = (opts) => {\n    const filter = opts?.filter\n    if (filter !== undefined) {\n      this.__store.setState((s) => {\n        return {\n          ...s,\n          cachedMatches: s.cachedMatches.filter(\n            (m) => !filter(m as MakeRouteMatchUnion<this>),\n          ),\n        }\n      })\n    } else {\n      this.__store.setState((s) => {\n        return {\n          ...s,\n          cachedMatches: [],\n        }\n      })\n    }\n  }\n\n  clearExpiredCache = () => {\n    // This is where all of the garbage collection magic happens\n    const filter = (d: MakeRouteMatch<TRouteTree>) => {\n      const route = this.looseRoutesById[d.routeId]!\n\n      if (!route.options.loader) {\n        return true\n      }\n\n      // If the route was preloaded, use the preloadGcTime\n      // otherwise, use the gcTime\n      const gcTime =\n        (d.preload\n          ? (route.options.preloadGcTime ?? this.options.defaultPreloadGcTime)\n          : (route.options.gcTime ?? this.options.defaultGcTime)) ??\n        5 * 60 * 1000\n\n      const isError = d.status === 'error'\n      if (isError) return true\n\n      const gcEligible = Date.now() - d.updatedAt >= gcTime\n      return gcEligible\n    }\n    this.clearCache({ filter })\n  }\n\n  loadRouteChunk = loadRouteChunk\n\n  preloadRoute: PreloadRouteFn<\n    TRouteTree,\n    TTrailingSlashOption,\n    TDefaultStructuralSharingOption,\n    TRouterHistory\n  > = async (opts) => {\n    const next = this.buildLocation(opts as any)\n\n    let matches = this.matchRoutes(next, {\n      throwOnError: true,\n      preload: true,\n      dest: opts,\n    })\n\n    const activeMatchIds = new Set(\n      [...this.state.matches, ...(this.state.pendingMatches ?? [])].map(\n        (d) => d.id,\n      ),\n    )\n\n    const loadedMatchIds = new Set([\n      ...activeMatchIds,\n      ...this.state.cachedMatches.map((d) => d.id),\n    ])\n\n    // If the matches are already loaded, we need to add them to the cachedMatches\n    batch(() => {\n      matches.forEach((match) => {\n        if (!loadedMatchIds.has(match.id)) {\n          this.__store.setState((s) => ({\n            ...s,\n            cachedMatches: [...(s.cachedMatches as any), match],\n          }))\n        }\n      })\n    })\n\n    try {\n      matches = await loadMatches({\n        router: this,\n        matches,\n        location: next,\n        preload: true,\n        updateMatch: (id, updater) => {\n          // Don't update the match if it's currently loaded\n          if (activeMatchIds.has(id)) {\n            matches = matches.map((d) => (d.id === id ? updater(d) : d))\n          } else {\n            this.updateMatch(id, updater)\n          }\n        },\n      })\n\n      return matches\n    } catch (err) {\n      if (isRedirect(err)) {\n        if (err.options.reloadDocument) {\n          return undefined\n        }\n\n        return await this.preloadRoute({\n          ...err.options,\n          _fromLocation: next,\n        })\n      }\n      if (!isNotFound(err)) {\n        // Preload errors are not fatal, but we should still log them\n        console.error(err)\n      }\n      return undefined\n    }\n  }\n\n  matchRoute: MatchRouteFn<\n    TRouteTree,\n    TTrailingSlashOption,\n    TDefaultStructuralSharingOption,\n    TRouterHistory\n  > = (location, opts) => {\n    const matchLocation = {\n      ...location,\n      to: location.to\n        ? this.resolvePathWithBase(\n            (location.from || '') as string,\n            location.to as string,\n          )\n        : undefined,\n      params: location.params || {},\n      leaveParams: true,\n    }\n    const next = this.buildLocation(matchLocation as any)\n\n    if (opts?.pending && this.state.status !== 'pending') {\n      return false\n    }\n\n    const pending =\n      opts?.pending === undefined ? !this.state.isLoading : opts.pending\n\n    const baseLocation = pending\n      ? this.latestLocation\n      : this.state.resolvedLocation || this.state.location\n\n    const match = matchPathname(\n      baseLocation.pathname,\n      {\n        ...opts,\n        to: next.pathname,\n      },\n      this.parsePathnameCache,\n    ) as any\n\n    if (!match) {\n      return false\n    }\n    if (location.params) {\n      if (!deepEqual(match, location.params, { partial: true })) {\n        return false\n      }\n    }\n\n    if (match && (opts?.includeSearch ?? true)) {\n      return deepEqual(baseLocation.search, next.search, { partial: true })\n        ? match\n        : false\n    }\n\n    return match\n  }\n\n  ssr?: {\n    manifest: Manifest | undefined\n  }\n\n  serverSsr?: ServerSsr\n\n  hasNotFoundMatch = () => {\n    return this.__store.state.matches.some(\n      (d) => d.status === 'notFound' || d.globalNotFound,\n    )\n  }\n}\n\n/** Error thrown when search parameter validation fails. */\nexport class SearchParamError extends Error {}\n\n/** Error thrown when path parameter parsing/validation fails. */\nexport class PathParamError extends Error {}\n\nconst normalize = (str: string) =>\n  str.endsWith('/') && str.length > 1 ? str.slice(0, -1) : str\nfunction comparePaths(a: string, b: string) {\n  return normalize(a) === normalize(b)\n}\n\n/**\n * Lazily import a module function and forward arguments to it, retaining\n * parameter and return types for the selected export key.\n */\nexport function lazyFn<\n  T extends Record<string, (...args: Array<any>) => any>,\n  TKey extends keyof T = 'default',\n>(fn: () => Promise<T>, key?: TKey) {\n  return async (\n    ...args: Parameters<T[TKey]>\n  ): Promise<Awaited<ReturnType<T[TKey]>>> => {\n    const imported = await fn()\n    return imported[key || 'default'](...args)\n  }\n}\n\n/** Create an initial RouterState from a parsed location. */\nexport function getInitialRouterState(\n  location: ParsedLocation,\n): RouterState<any> {\n  return {\n    loadedAt: 0,\n    isLoading: false,\n    isTransitioning: false,\n    status: 'idle',\n    resolvedLocation: undefined,\n    location,\n    matches: [],\n    pendingMatches: [],\n    cachedMatches: [],\n    statusCode: 200,\n  }\n}\n\nfunction validateSearch(validateSearch: AnyValidator, input: unknown): unknown {\n  if (validateSearch == null) return {}\n\n  if ('~standard' in validateSearch) {\n    const result = validateSearch['~standard'].validate(input)\n\n    if (result instanceof Promise)\n      throw new SearchParamError('Async validation not supported')\n\n    if (result.issues)\n      throw new SearchParamError(JSON.stringify(result.issues, undefined, 2), {\n        cause: result,\n      })\n\n    return result.value\n  }\n\n  if ('parse' in validateSearch) {\n    return validateSearch.parse(input)\n  }\n\n  if (typeof validateSearch === 'function') {\n    return validateSearch(input)\n  }\n\n  return {}\n}\n\n/**\n * Build the matched route chain and extract params for a pathname.\n * Falls back to the root route if no specific route is found.\n */\nexport function getMatchedRoutes<TRouteLike extends RouteLike>({\n  pathname,\n  routePathname,\n  caseSensitive,\n  routesByPath,\n  routesById,\n  flatRoutes,\n  parseCache,\n}: {\n  pathname: string\n  routePathname?: string\n  caseSensitive?: boolean\n  routesByPath: Record<string, TRouteLike>\n  routesById: Record<string, TRouteLike>\n  flatRoutes: Array<TRouteLike>\n  parseCache?: ParsePathnameCache\n}) {\n  let routeParams: Record<string, string> = {}\n  const trimmedPath = trimPathRight(pathname)\n  const getMatchedParams = (route: TRouteLike) => {\n    const result = matchPathname(\n      trimmedPath,\n      {\n        to: route.fullPath,\n        caseSensitive: route.options?.caseSensitive ?? caseSensitive,\n        // we need fuzzy matching for `notFoundMode: 'fuzzy'`\n        fuzzy: true,\n      },\n      parseCache,\n    )\n    return result\n  }\n\n  let foundRoute: TRouteLike | undefined =\n    routePathname !== undefined ? routesByPath[routePathname] : undefined\n  if (foundRoute) {\n    routeParams = getMatchedParams(foundRoute)!\n  } else {\n    // iterate over flatRoutes to find the best match\n    // if we find a fuzzy matching route, keep looking for a perfect fit\n    let fuzzyMatch:\n      | { foundRoute: TRouteLike; routeParams: Record<string, string> }\n      | undefined = undefined\n    for (const route of flatRoutes) {\n      const matchedParams = getMatchedParams(route)\n\n      if (matchedParams) {\n        if (\n          route.path !== '/' &&\n          (matchedParams as Record<string, string>)['**']\n        ) {\n          if (!fuzzyMatch) {\n            fuzzyMatch = { foundRoute: route, routeParams: matchedParams }\n          }\n        } else {\n          foundRoute = route\n          routeParams = matchedParams\n          break\n        }\n      }\n    }\n    // did not find a perfect fit, so take the fuzzy matching route if it exists\n    if (!foundRoute && fuzzyMatch) {\n      foundRoute = fuzzyMatch.foundRoute\n      routeParams = fuzzyMatch.routeParams\n    }\n  }\n\n  let routeCursor: TRouteLike = foundRoute || routesById[rootRouteId]!\n\n  const matchedRoutes: Array<TRouteLike> = [routeCursor]\n\n  while (routeCursor.parentRoute) {\n    routeCursor = routeCursor.parentRoute as TRouteLike\n    matchedRoutes.push(routeCursor)\n  }\n  matchedRoutes.reverse()\n\n  return { matchedRoutes, routeParams, foundRoute }\n}\n\nfunction applySearchMiddleware({\n  search,\n  dest,\n  destRoutes,\n  _includeValidateSearch,\n}: {\n  search: any\n  dest: BuildNextOptions\n  destRoutes: Array<AnyRoute>\n  _includeValidateSearch: boolean | undefined\n}) {\n  const allMiddlewares =\n    destRoutes.reduce(\n      (acc, route) => {\n        const middlewares: Array<SearchMiddleware<any>> = []\n\n        if ('search' in route.options) {\n          if (route.options.search?.middlewares) {\n            middlewares.push(...route.options.search.middlewares)\n          }\n        }\n        // TODO remove preSearchFilters and postSearchFilters in v2\n        else if (\n          route.options.preSearchFilters ||\n          route.options.postSearchFilters\n        ) {\n          const legacyMiddleware: SearchMiddleware<any> = ({\n            search,\n            next,\n          }) => {\n            let nextSearch = search\n\n            if (\n              'preSearchFilters' in route.options &&\n              route.options.preSearchFilters\n            ) {\n              nextSearch = route.options.preSearchFilters.reduce(\n                (prev, next) => next(prev),\n                search,\n              )\n            }\n\n            const result = next(nextSearch)\n\n            if (\n              'postSearchFilters' in route.options &&\n              route.options.postSearchFilters\n            ) {\n              return route.options.postSearchFilters.reduce(\n                (prev, next) => next(prev),\n                result,\n              )\n            }\n\n            return result\n          }\n          middlewares.push(legacyMiddleware)\n        }\n\n        if (_includeValidateSearch && route.options.validateSearch) {\n          const validate: SearchMiddleware<any> = ({ search, next }) => {\n            const result = next(search)\n            try {\n              const validatedSearch = {\n                ...result,\n                ...(validateSearch(route.options.validateSearch, result) ??\n                  undefined),\n              }\n              return validatedSearch\n            } catch {\n              // ignore errors here because they are already handled in matchRoutes\n              return result\n            }\n          }\n\n          middlewares.push(validate)\n        }\n\n        return acc.concat(middlewares)\n      },\n      [] as Array<SearchMiddleware<any>>,\n    ) ?? []\n\n  // the chain ends here since `next` is not called\n  const final: SearchMiddleware<any> = ({ search }) => {\n    if (!dest.search) {\n      return {}\n    }\n    if (dest.search === true) {\n      return search\n    }\n    return functionalUpdate(dest.search, search)\n  }\n\n  allMiddlewares.push(final)\n\n  const applyNext = (index: number, currentSearch: any): any => {\n    // no more middlewares left, return the current search\n    if (index >= allMiddlewares.length) {\n      return currentSearch\n    }\n\n    const middleware = allMiddlewares[index]!\n\n    const next = (newSearch: any): any => {\n      return applyNext(index + 1, newSearch)\n    }\n\n    return middleware({ search: currentSearch, next })\n  }\n\n  // Start applying middlewares\n  return applyNext(0, search)\n}\n", "import type { HistoryState, ParsedHistoryState } from '@tanstack/history'\nimport type {\n  AllParams,\n  CatchAllPaths,\n  CurrentPath,\n  FullSearchSchema,\n  FullSearchSchemaInput,\n  ParentPath,\n  RouteByPath,\n  RouteByToPath,\n  RoutePaths,\n  RouteToPath,\n  ToPath,\n} from './routeInfo'\nimport type {\n  AnyRouter,\n  RegisteredRouter,\n  ViewTransitionOptions,\n} from './router'\nimport type {\n  ConstrainLiteral,\n  Expand,\n  MakeDifferenceOptional,\n  NoInfer,\n  NonNullableUpdater,\n  Updater,\n} from './utils'\nimport type { ParsedLocation } from './location'\n\nexport type IsRequiredParams<TParams> =\n  Record<never, never> extends TParams ? never : true\n\nexport interface ParsePathParamsResult<\n  in out TRequired,\n  in out TOptional,\n  in out TRest,\n> {\n  required: TRequired\n  optional: TOptional\n  rest: TRest\n}\n\nexport type AnyParsePathParamsResult = ParsePathParamsResult<\n  string,\n  string,\n  string\n>\n\nexport type ParsePathParamsBoundaryStart<T extends string> =\n  T extends `${infer TLeft}{-${infer TRight}`\n    ? ParsePathParamsResult<\n        ParsePathParams<TLeft>['required'],\n        | ParsePathParams<TLeft>['optional']\n        | ParsePathParams<TRight>['required']\n        | ParsePathParams<TRight>['optional'],\n        ParsePathParams<TRight>['rest']\n      >\n    : T extends `${infer TLeft}{${infer TRight}`\n      ? ParsePathParamsResult<\n          | ParsePathParams<TLeft>['required']\n          | ParsePathParams<TRight>['required'],\n          | ParsePathParams<TLeft>['optional']\n          | ParsePathParams<TRight>['optional'],\n          ParsePathParams<TRight>['rest']\n        >\n      : never\n\nexport type ParsePathParamsSymbol<T extends string> =\n  T extends `${string}$${infer TRight}`\n    ? TRight extends `${string}/${string}`\n      ? TRight extends `${infer TParam}/${infer TRest}`\n        ? TParam extends ''\n          ? ParsePathParamsResult<\n              ParsePathParams<TRest>['required'],\n              '_splat' | ParsePathParams<TRest>['optional'],\n              ParsePathParams<TRest>['rest']\n            >\n          : ParsePathParamsResult<\n              TParam | ParsePathParams<TRest>['required'],\n              ParsePathParams<TRest>['optional'],\n              ParsePathParams<TRest>['rest']\n            >\n        : never\n      : TRight extends ''\n        ? ParsePathParamsResult<never, '_splat', never>\n        : ParsePathParamsResult<TRight, never, never>\n    : never\n\nexport type ParsePathParamsBoundaryEnd<T extends string> =\n  T extends `${infer TLeft}}${infer TRight}`\n    ? ParsePathParamsResult<\n        | ParsePathParams<TLeft>['required']\n        | ParsePathParams<TRight>['required'],\n        | ParsePathParams<TLeft>['optional']\n        | ParsePathParams<TRight>['optional'],\n        ParsePathParams<TRight>['rest']\n      >\n    : never\n\nexport type ParsePathParamsEscapeStart<T extends string> =\n  T extends `${infer TLeft}[${infer TRight}`\n    ? ParsePathParamsResult<\n        | ParsePathParams<TLeft>['required']\n        | ParsePathParams<TRight>['required'],\n        | ParsePathParams<TLeft>['optional']\n        | ParsePathParams<TRight>['optional'],\n        ParsePathParams<TRight>['rest']\n      >\n    : never\n\nexport type ParsePathParamsEscapeEnd<T extends string> =\n  T extends `${string}]${infer TRight}` ? ParsePathParams<TRight> : never\n\nexport type ParsePathParams<T extends string> = T extends `${string}[${string}`\n  ? ParsePathParamsEscapeStart<T>\n  : T extends `${string}]${string}`\n    ? ParsePathParamsEscapeEnd<T>\n    : T extends `${string}}${string}`\n      ? ParsePathParamsBoundaryEnd<T>\n      : T extends `${string}{${string}`\n        ? ParsePathParamsBoundaryStart<T>\n        : T extends `${string}$${string}`\n          ? ParsePathParamsSymbol<T>\n          : never\n\nexport type AddTrailingSlash<T> = T extends `${string}/` ? T : `${T & string}/`\n\nexport type RemoveTrailingSlashes<T> = T & `${string}/` extends never\n  ? T\n  : T extends `${infer R}/`\n    ? R\n    : T\n\nexport type AddLeadingSlash<T> = T & `/${string}` extends never\n  ? `/${T & string}`\n  : T\n\nexport type RemoveLeadingSlashes<T> = T & `/${string}` extends never\n  ? T\n  : T extends `/${infer R}`\n    ? R\n    : T\n\ntype JoinPath<TLeft extends string, TRight extends string> = TRight extends ''\n  ? TLeft\n  : TLeft extends ''\n    ? TRight\n    : `${RemoveTrailingSlashes<TLeft>}/${RemoveLeadingSlashes<TRight>}`\n\ntype RemoveLastSegment<\n  T extends string,\n  TAcc extends string = '',\n> = T extends `${infer TSegment}/${infer TRest}`\n  ? TRest & `${string}/${string}` extends never\n    ? TRest extends ''\n      ? TAcc\n      : `${TAcc}${TSegment}`\n    : RemoveLastSegment<TRest, `${TAcc}${TSegment}/`>\n  : TAcc\n\nexport type ResolveCurrentPath<\n  TFrom extends string,\n  TTo extends string,\n> = TTo extends '.'\n  ? TFrom\n  : TTo extends './'\n    ? AddTrailingSlash<TFrom>\n    : TTo & `./${string}` extends never\n      ? never\n      : TTo extends `./${infer TRest}`\n        ? AddLeadingSlash<JoinPath<TFrom, TRest>>\n        : never\n\nexport type ResolveParentPath<\n  TFrom extends string,\n  TTo extends string,\n> = TTo extends '../' | '..'\n  ? TFrom extends '' | '/'\n    ? never\n    : AddLeadingSlash<RemoveLastSegment<TFrom>>\n  : TTo & `../${string}` extends never\n    ? AddLeadingSlash<JoinPath<TFrom, TTo>>\n    : TFrom extends '' | '/'\n      ? never\n      : TTo extends `../${infer ToRest}`\n        ? ResolveParentPath<RemoveLastSegment<TFrom>, ToRest>\n        : AddLeadingSlash<JoinPath<TFrom, TTo>>\n\nexport type ResolveRelativePath<TFrom, TTo = '.'> = string extends TFrom\n  ? TTo\n  : string extends TTo\n    ? TFrom\n    : undefined extends TTo\n      ? TFrom\n      : TTo extends string\n        ? TFrom extends string\n          ? TTo extends `/${string}`\n            ? TTo\n            : TTo extends `..${string}`\n              ? ResolveParentPath<TFrom, TTo>\n              : TTo extends `.${string}`\n                ? ResolveCurrentPath<TFrom, TTo>\n                : AddLeadingSlash<JoinPath<TFrom, TTo>>\n          : never\n        : never\n\nexport type FindDescendantToPaths<\n  TRouter extends AnyRouter,\n  TPrefix extends string,\n> = `${TPrefix}/${string}` & RouteToPath<TRouter>\n\nexport type InferDescendantToPaths<\n  TRouter extends AnyRouter,\n  TPrefix extends string,\n  TPaths = FindDescendantToPaths<TRouter, TPrefix>,\n> = TPaths extends `${TPrefix}/`\n  ? never\n  : TPaths extends `${TPrefix}/${infer TRest}`\n    ? TRest\n    : never\n\nexport type RelativeToPath<\n  TRouter extends AnyRouter,\n  TTo extends string,\n  TResolvedPath extends string,\n> =\n  | (TResolvedPath & RouteToPath<TRouter> extends never\n      ? never\n      : ToPath<TRouter, TTo>)\n  | `${RemoveTrailingSlashes<TTo>}/${InferDescendantToPaths<TRouter, RemoveTrailingSlashes<TResolvedPath>>}`\n\nexport type RelativeToParentPath<\n  TRouter extends AnyRouter,\n  TFrom extends string,\n  TTo extends string,\n  TResolvedPath extends string = ResolveRelativePath<TFrom, TTo>,\n> =\n  | RelativeToPath<TRouter, TTo, TResolvedPath>\n  | (TTo extends `${string}..` | `${string}../`\n      ? TResolvedPath extends '/' | ''\n        ? never\n        : FindDescendantToPaths<\n              TRouter,\n              RemoveTrailingSlashes<TResolvedPath>\n            > extends never\n          ? never\n          : `${RemoveTrailingSlashes<TTo>}/${ParentPath<TRouter>}`\n      : never)\n\nexport type RelativeToCurrentPath<\n  TRouter extends AnyRouter,\n  TFrom extends string,\n  TTo extends string,\n  TResolvedPath extends string = ResolveRelativePath<TFrom, TTo>,\n> = RelativeToPath<TRouter, TTo, TResolvedPath> | CurrentPath<TRouter>\n\nexport type AbsoluteToPath<TRouter extends AnyRouter, TFrom extends string> =\n  | (string extends TFrom\n      ? CurrentPath<TRouter>\n      : TFrom extends `/`\n        ? never\n        : CurrentPath<TRouter>)\n  | (string extends TFrom\n      ? ParentPath<TRouter>\n      : TFrom extends `/`\n        ? never\n        : ParentPath<TRouter>)\n  | RouteToPath<TRouter>\n  | (TFrom extends '/'\n      ? never\n      : string extends TFrom\n        ? never\n        : InferDescendantToPaths<TRouter, RemoveTrailingSlashes<TFrom>>)\n\nexport type RelativeToPathAutoComplete<\n  TRouter extends AnyRouter,\n  TFrom extends string,\n  TTo extends string,\n> = string extends TTo\n  ? string\n  : string extends TFrom\n    ? AbsoluteToPath<TRouter, TFrom>\n    : TTo & `..${string}` extends never\n      ? TTo & `.${string}` extends never\n        ? AbsoluteToPath<TRouter, TFrom>\n        : RelativeToCurrentPath<TRouter, TFrom, TTo>\n      : RelativeToParentPath<TRouter, TFrom, TTo>\n\nexport type NavigateOptions<\n  TRouter extends AnyRouter = RegisteredRouter,\n  TFrom extends string = string,\n  TTo extends string | undefined = '.',\n  TMaskFrom extends string = TFrom,\n  TMaskTo extends string = '.',\n> = ToOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo> & NavigateOptionProps\n\n/**\n * The NavigateOptions type is used to describe the options that can be used when describing a navigation action in TanStack Router.\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType)\n */\nexport interface NavigateOptionProps {\n  /**\n   * If set to `true`, the router will scroll the element with an id matching the hash into view with default `ScrollIntoViewOptions`.\n   * If set to `false`, the router will not scroll the element with an id matching the hash into view.\n   * If set to `ScrollIntoViewOptions`, the router will scroll the element with an id matching the hash into view with the provided options.\n   * @default true\n   * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType#hashscrollintoview)\n   * @see [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView)\n   */\n  hashScrollIntoView?: boolean | ScrollIntoViewOptions\n  /**\n   * `replace` is a boolean that determines whether the navigation should replace the current history entry or push a new one.\n   * @default false\n   * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType#replace)\n   */\n  replace?: boolean\n  /**\n   * Defaults to `true` so that the scroll position will be reset to 0,0 after the location is committed to the browser history.\n   * If `false`, the scroll position will not be reset to 0,0 after the location is committed to history.\n   * @default true\n   * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType#resetscroll)\n   */\n  resetScroll?: boolean\n  /** @deprecated All navigations now use startTransition under the hood */\n  startTransition?: boolean\n  /**\n   * If set to `true`, the router will wrap the resulting navigation in a `document.startViewTransition()` call.\n   * If `ViewTransitionOptions`, route navigations will be called using `document.startViewTransition({update, types})`\n   * where `types` will be the strings array passed with `ViewTransitionOptions[\"types\"]`.\n   * If the browser does not support viewTransition types, the navigation will fall back to normal `document.startTransition()`, same as if `true` was passed.\n   *\n   * If the browser does not support this api, this option will be ignored.\n   * @default false\n   * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType#viewtransition)\n   * @see [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Document/startViewTransition)\n   * @see [Google](https://developer.chrome.com/docs/web-platform/view-transitions/same-document#view-transition-types)\n   */\n  viewTransition?: boolean | ViewTransitionOptions\n  /**\n   * If `true`, navigation will ignore any blockers that might prevent it.\n   * @default false\n   * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType#ignoreblocker)\n   */\n  ignoreBlocker?: boolean\n  /**\n   * If `true`, navigation to a route inside of router will trigger a full page load instead of the traditional SPA navigation.\n   * @default false\n   * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType#reloaddocument)\n   */\n  reloadDocument?: boolean\n  /**\n   * This can be used instead of `to` to navigate to a fully built href, e.g. pointing to an external target.\n   * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType#href)\n   */\n  href?: string\n}\n\nexport type ToOptions<\n  TRouter extends AnyRouter = RegisteredRouter,\n  TFrom extends string = string,\n  TTo extends string | undefined = '.',\n  TMaskFrom extends string = TFrom,\n  TMaskTo extends string = '.',\n> = ToSubOptions<TRouter, TFrom, TTo> & MaskOptions<TRouter, TMaskFrom, TMaskTo>\n\nexport interface MaskOptions<\n  in out TRouter extends AnyRouter,\n  in out TMaskFrom extends string,\n  in out TMaskTo extends string,\n> {\n  _fromLocation?: ParsedLocation\n  mask?: ToMaskOptions<TRouter, TMaskFrom, TMaskTo>\n}\n\nexport type ToMaskOptions<\n  TRouter extends AnyRouter = RegisteredRouter,\n  TMaskFrom extends string = string,\n  TMaskTo extends string = '.',\n> = ToSubOptions<TRouter, TMaskFrom, TMaskTo> & {\n  unmaskOnReload?: boolean\n}\n\nexport type ToSubOptions<\n  TRouter extends AnyRouter = RegisteredRouter,\n  TFrom extends string = string,\n  TTo extends string | undefined = '.',\n> = ToSubOptionsProps<TRouter, TFrom, TTo> &\n  SearchParamOptions<TRouter, TFrom, TTo> &\n  PathParamOptions<TRouter, TFrom, TTo>\n\nexport interface RequiredToOptions<\n  in out TRouter extends AnyRouter,\n  in out TFrom extends string,\n  in out TTo extends string | undefined,\n> {\n  /**\n   * The internal route path to navigate to. This should be a relative or absolute path within your application.\n   * For external URLs, use the `href` property instead.\n   * @example \"/dashboard\" or \"../profile\"\n   * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType#href)\n   */\n  to: ToPathOption<TRouter, TFrom, TTo> & {}\n}\n\nexport interface OptionalToOptions<\n  in out TRouter extends AnyRouter,\n  in out TFrom extends string,\n  in out TTo extends string | undefined,\n> {\n  /**\n   * The internal route path to navigate to. This should be a relative or absolute path within your application.\n   * For external URLs, use the `href` property instead.\n   * @example \"/dashboard\" or \"../profile\"\n   * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType#href)\n   */\n  to?: ToPathOption<TRouter, TFrom, TTo> & {}\n}\n\nexport type MakeToRequired<\n  TRouter extends AnyRouter,\n  TFrom extends string,\n  TTo extends string | undefined,\n> = string extends TFrom\n  ? string extends TTo\n    ? OptionalToOptions<TRouter, TFrom, TTo>\n    : TTo & CatchAllPaths<TRouter> extends never\n      ? RequiredToOptions<TRouter, TFrom, TTo>\n      : OptionalToOptions<TRouter, TFrom, TTo>\n  : OptionalToOptions<TRouter, TFrom, TTo>\n\nexport type ToSubOptionsProps<\n  TRouter extends AnyRouter = RegisteredRouter,\n  TFrom extends RoutePaths<TRouter['routeTree']> | string = string,\n  TTo extends string | undefined = '.',\n> = MakeToRequired<TRouter, TFrom, TTo> & {\n  hash?: true | Updater<string>\n  state?: true | NonNullableUpdater<ParsedHistoryState, HistoryState>\n  from?: FromPathOption<TRouter, TFrom> & {}\n  unsafeRelative?: 'path'\n}\n\nexport type ParamsReducerFn<\n  in out TRouter extends AnyRouter,\n  in out TParamVariant extends ParamVariant,\n  in out TFrom,\n  in out TTo,\n> = (\n  current: Expand<ResolveFromParams<TRouter, TParamVariant, TFrom>>,\n) => Expand<ResolveRelativeToParams<TRouter, TParamVariant, TFrom, TTo>>\n\ntype ParamsReducer<\n  TRouter extends AnyRouter,\n  TParamVariant extends ParamVariant,\n  TFrom,\n  TTo,\n> =\n  | Expand<ResolveRelativeToParams<TRouter, TParamVariant, TFrom, TTo>>\n  | (ParamsReducerFn<TRouter, TParamVariant, TFrom, TTo> & {})\n\ntype ParamVariant = 'PATH' | 'SEARCH'\n\nexport type ResolveRoute<\n  TRouter extends AnyRouter,\n  TFrom,\n  TTo,\n  TPath = ResolveRelativePath<TFrom, TTo>,\n> = TPath extends string\n  ? TFrom extends TPath\n    ? RouteByPath<TRouter['routeTree'], TPath>\n    : RouteByToPath<TRouter, TPath>\n  : never\n\ntype ResolveFromParamType<TParamVariant extends ParamVariant> =\n  TParamVariant extends 'PATH' ? 'allParams' : 'fullSearchSchema'\n\ntype ResolveFromAllParams<\n  TRouter extends AnyRouter,\n  TParamVariant extends ParamVariant,\n> = TParamVariant extends 'PATH'\n  ? AllParams<TRouter['routeTree']>\n  : FullSearchSchema<TRouter['routeTree']>\n\ntype ResolveFromParams<\n  TRouter extends AnyRouter,\n  TParamVariant extends ParamVariant,\n  TFrom,\n> = string extends TFrom\n  ? ResolveFromAllParams<TRouter, TParamVariant>\n  : RouteByPath<\n      TRouter['routeTree'],\n      TFrom\n    >['types'][ResolveFromParamType<TParamVariant>]\n\ntype ResolveToParamType<TParamVariant extends ParamVariant> =\n  TParamVariant extends 'PATH' ? 'allParams' : 'fullSearchSchemaInput'\n\ntype ResolveAllToParams<\n  TRouter extends AnyRouter,\n  TParamVariant extends ParamVariant,\n> = TParamVariant extends 'PATH'\n  ? AllParams<TRouter['routeTree']>\n  : FullSearchSchemaInput<TRouter['routeTree']>\n\nexport type ResolveToParams<\n  TRouter extends AnyRouter,\n  TParamVariant extends ParamVariant,\n  TFrom,\n  TTo,\n> =\n  ResolveRelativePath<TFrom, TTo> extends infer TPath\n    ? undefined extends TPath\n      ? never\n      : string extends TPath\n        ? ResolveAllToParams<TRouter, TParamVariant>\n        : TPath extends CatchAllPaths<TRouter>\n          ? ResolveAllToParams<TRouter, TParamVariant>\n          : ResolveRoute<\n              TRouter,\n              TFrom,\n              TTo\n            >['types'][ResolveToParamType<TParamVariant>]\n    : never\n\ntype ResolveRelativeToParams<\n  TRouter extends AnyRouter,\n  TParamVariant extends ParamVariant,\n  TFrom,\n  TTo,\n  TToParams = ResolveToParams<TRouter, TParamVariant, TFrom, TTo>,\n> = TParamVariant extends 'SEARCH'\n  ? TToParams\n  : string extends TFrom\n    ? TToParams\n    : MakeDifferenceOptional<\n        ResolveFromParams<TRouter, TParamVariant, TFrom>,\n        TToParams\n      >\n\nexport interface MakeOptionalSearchParams<\n  in out TRouter extends AnyRouter,\n  in out TFrom,\n  in out TTo,\n> {\n  search?: true | (ParamsReducer<TRouter, 'SEARCH', TFrom, TTo> & {})\n}\n\nexport interface MakeOptionalPathParams<\n  in out TRouter extends AnyRouter,\n  in out TFrom,\n  in out TTo,\n> {\n  params?: true | (ParamsReducer<TRouter, 'PATH', TFrom, TTo> & {})\n}\n\ntype MakeRequiredParamsReducer<\n  TRouter extends AnyRouter,\n  TParamVariant extends ParamVariant,\n  TFrom,\n  TTo,\n> =\n  | (string extends TFrom\n      ? never\n      : ResolveFromParams<\n            TRouter,\n            TParamVariant,\n            TFrom\n          > extends ResolveRelativeToParams<TRouter, TParamVariant, TFrom, TTo>\n        ? true\n        : never)\n  | (ParamsReducer<TRouter, TParamVariant, TFrom, TTo> & {})\n\nexport interface MakeRequiredPathParams<\n  in out TRouter extends AnyRouter,\n  in out TFrom,\n  in out TTo,\n> {\n  params: MakeRequiredParamsReducer<TRouter, 'PATH', TFrom, TTo> & {}\n}\n\nexport interface MakeRequiredSearchParams<\n  in out TRouter extends AnyRouter,\n  in out TFrom,\n  in out TTo,\n> {\n  search: MakeRequiredParamsReducer<TRouter, 'SEARCH', TFrom, TTo> & {}\n}\n\nexport type IsRequired<\n  TRouter extends AnyRouter,\n  TParamVariant extends ParamVariant,\n  TFrom,\n  TTo,\n> =\n  ResolveRelativePath<TFrom, TTo> extends infer TPath\n    ? undefined extends TPath\n      ? never\n      : TPath extends CatchAllPaths<TRouter>\n        ? never\n        : IsRequiredParams<\n            ResolveRelativeToParams<TRouter, TParamVariant, TFrom, TTo>\n          >\n    : never\n\nexport type SearchParamOptions<TRouter extends AnyRouter, TFrom, TTo> =\n  IsRequired<TRouter, 'SEARCH', TFrom, TTo> extends never\n    ? MakeOptionalSearchParams<TRouter, TFrom, TTo>\n    : MakeRequiredSearchParams<TRouter, TFrom, TTo>\n\nexport type PathParamOptions<TRouter extends AnyRouter, TFrom, TTo> =\n  IsRequired<TRouter, 'PATH', TFrom, TTo> extends never\n    ? MakeOptionalPathParams<TRouter, TFrom, TTo>\n    : MakeRequiredPathParams<TRouter, TFrom, TTo>\n\nexport type ToPathOption<\n  TRouter extends AnyRouter = AnyRouter,\n  TFrom extends string = string,\n  TTo extends string | undefined = string,\n> = ConstrainLiteral<\n  TTo,\n  RelativeToPathAutoComplete<\n    TRouter,\n    NoInfer<TFrom> extends string ? NoInfer<TFrom> : '',\n    NoInfer<TTo> & string\n  >\n>\n\nexport type FromPathOption<TRouter extends AnyRouter, TFrom> = ConstrainLiteral<\n  TFrom,\n  RoutePaths<TRouter['routeTree']>\n>\n\n/**\n * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/navigation#active-options)\n */\nexport interface ActiveOptions {\n  /**\n   * If true, the link will be active if the current route matches the `to` route path exactly (no children routes)\n   * @default false\n   */\n  exact?: boolean\n  /**\n   * If true, the link will only be active if the current URL hash matches the `hash` prop\n   * @default false\n   */\n  includeHash?: boolean\n  /**\n   * If true, the link will only be active if the current URL search params inclusively match the `search` prop\n   * @default true\n   */\n  includeSearch?: boolean\n  /**\n   * This modifies the `includeSearch` behavior.\n   * If true,  properties in `search` that are explicitly `undefined` must NOT be present in the current URL search params for the link to be active.\n   * @default false\n   */\n  explicitUndefined?: boolean\n}\n\nexport interface LinkOptionsProps {\n  /**\n   * The standard anchor tag target attribute\n   */\n  target?: HTMLAnchorElement['target']\n  /**\n   * Configurable options to determine if the link should be considered active or not\n   * @default {exact:true,includeHash:true}\n   */\n  activeOptions?: ActiveOptions\n  /**\n   * The preloading strategy for this link\n   * - `false` - No preloading\n   * - `'intent'` - Preload the linked route on hover and cache it for this many milliseconds in hopes that the user will eventually navigate there.\n   * - `'viewport'` - Preload the linked route when it enters the viewport\n   */\n  preload?: false | 'intent' | 'viewport' | 'render'\n  /**\n   * When a preload strategy is set, this delays the preload by this many milliseconds.\n   * If the user exits the link before this delay, the preload will be cancelled.\n   */\n  preloadDelay?: number\n  /**\n   * Control whether the link should be disabled or not\n   * If set to `true`, the link will be rendered without an `href` attribute\n   * @default false\n   */\n  disabled?: boolean\n  /**\n   * When the preload strategy is set to `intent`, this controls the proximity of the link to the cursor before it is preloaded.\n   * If the user exits this proximity before this delay, the preload will be cancelled.\n   */\n  preloadIntentProximity?: number\n}\n\nexport type LinkOptions<\n  TRouter extends AnyRouter = RegisteredRouter,\n  TFrom extends string = string,\n  TTo extends string | undefined = '.',\n  TMaskFrom extends string = TFrom,\n  TMaskTo extends string = '.',\n> = NavigateOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo> & LinkOptionsProps\n\nexport type LinkCurrentTargetElement = {\n  preloadTimeout?: null | ReturnType<typeof setTimeout>\n}\n\nexport const preloadWarning = 'Error preloading route! ☝️'\n", "import invariant from 'tiny-invariant'\nimport { joinPaths, trimPathLeft } from './path'\nimport { notFound } from './not-found'\nimport { rootRouteId } from './root'\nimport type { LazyRoute } from './fileRoute'\nimport type { NotFoundError } from './not-found'\nimport type { NavigateOptions, ParsePathParams } from './link'\nimport type { ParsedLocation } from './location'\nimport type {\n  AnyRouteMatch,\n  MakePreValidationErrorHandlingRouteMatchUnion,\n  MakeRouteMatchFromRoute,\n  MakeRouteMatchUnion,\n  RouteMatch,\n} from './Matches'\nimport type { RootRouteId } from './root'\nimport type { ParseRoute, RouteById, RoutePaths } from './routeInfo'\nimport type { AnyRouter, Register, RegisteredRouter, SSROption } from './router'\nimport type { BuildLocationFn, NavigateFn } from './RouterProvider'\nimport type {\n  Assign,\n  Awaitable,\n  Constrain,\n  Expand,\n  IntersectAssign,\n  LooseAsyncReturnType,\n  LooseReturnType,\n  NoInfer,\n} from './utils'\nimport type {\n  AnySchema,\n  AnyStandardSchemaValidator,\n  AnyValidator,\n  AnyValidatorAdapter,\n  AnyValidatorObj,\n  DefaultValidator,\n  ResolveSearchValidatorInput,\n  ResolveValidatorOutput,\n  StandardSchemaValidator,\n  ValidatorAdapter,\n  ValidatorFn,\n  ValidatorObj,\n} from './validators'\nimport type { ValidateSerializableLifecycleResult } from './ssr/serializer/transformer'\n\nexport type AnyPathParams = {}\n\nexport type SearchSchemaInput = {\n  __TSearchSchemaInput__: 'TSearchSchemaInput'\n}\n\nexport type AnyContext = {}\n\nexport interface RouteContext {}\n\nexport type PreloadableObj = { preload?: () => Promise<void> }\n\nexport type RoutePathOptions<TCustomId, TPath> =\n  | {\n      path: TPath\n    }\n  | {\n      id: TCustomId\n    }\n\nexport interface StaticDataRouteOption {}\n\nexport type RoutePathOptionsIntersection<TCustomId, TPath> = {\n  path: TPath\n  id: TCustomId\n}\n\nexport type SearchFilter<TInput, TResult = TInput> = (prev: TInput) => TResult\n\nexport type SearchMiddlewareContext<TSearchSchema> = {\n  search: TSearchSchema\n  next: (newSearch: TSearchSchema) => TSearchSchema\n}\n\nexport type SearchMiddleware<TSearchSchema> = (\n  ctx: SearchMiddlewareContext<TSearchSchema>,\n) => TSearchSchema\n\nexport type ResolveId<\n  TParentRoute,\n  TCustomId extends string,\n  TPath extends string,\n> = TParentRoute extends { id: infer TParentId extends string }\n  ? RoutePrefix<TParentId, string extends TCustomId ? TPath : TCustomId>\n  : RootRouteId\n\nexport type InferFullSearchSchema<TRoute> = TRoute extends {\n  types: {\n    fullSearchSchema: infer TFullSearchSchema\n  }\n}\n  ? TFullSearchSchema\n  : {}\n\nexport type InferFullSearchSchemaInput<TRoute> = TRoute extends {\n  types: {\n    fullSearchSchemaInput: infer TFullSearchSchemaInput\n  }\n}\n  ? TFullSearchSchemaInput\n  : {}\n\nexport type InferAllParams<TRoute> = TRoute extends {\n  types: {\n    allParams: infer TAllParams\n  }\n}\n  ? TAllParams\n  : {}\n\nexport type InferAllContext<TRoute> = unknown extends TRoute\n  ? TRoute\n  : TRoute extends {\n        types: {\n          allContext: infer TAllContext\n        }\n      }\n    ? TAllContext\n    : {}\n\nexport type ResolveSearchSchemaFnInput<TSearchValidator> =\n  TSearchValidator extends (input: infer TSearchSchemaInput) => any\n    ? TSearchSchemaInput extends SearchSchemaInput\n      ? Omit<TSearchSchemaInput, keyof SearchSchemaInput>\n      : ResolveSearchSchemaFn<TSearchValidator>\n    : AnySchema\n\nexport type ResolveSearchSchemaInput<TSearchValidator> =\n  TSearchValidator extends AnyStandardSchemaValidator\n    ? NonNullable<TSearchValidator['~standard']['types']>['input']\n    : TSearchValidator extends AnyValidatorAdapter\n      ? TSearchValidator['types']['input']\n      : TSearchValidator extends AnyValidatorObj\n        ? ResolveSearchSchemaFnInput<TSearchValidator['parse']>\n        : ResolveSearchSchemaFnInput<TSearchValidator>\n\nexport type ResolveSearchSchemaFn<TSearchValidator> = TSearchValidator extends (\n  ...args: any\n) => infer TSearchSchema\n  ? TSearchSchema\n  : AnySchema\n\nexport type ResolveSearchSchema<TSearchValidator> =\n  unknown extends TSearchValidator\n    ? TSearchValidator\n    : TSearchValidator extends AnyStandardSchemaValidator\n      ? NonNullable<TSearchValidator['~standard']['types']>['output']\n      : TSearchValidator extends AnyValidatorAdapter\n        ? TSearchValidator['types']['output']\n        : TSearchValidator extends AnyValidatorObj\n          ? ResolveSearchSchemaFn<TSearchValidator['parse']>\n          : ResolveSearchSchemaFn<TSearchValidator>\n\nexport type ResolveRequiredParams<TPath extends string, T> = {\n  [K in ParsePathParams<TPath>['required']]: T\n}\n\nexport type ResolveOptionalParams<TPath extends string, T> = {\n  [K in ParsePathParams<TPath>['optional']]?: T | undefined\n}\n\nexport type ResolveParams<\n  TPath extends string,\n  T = string,\n> = ResolveRequiredParams<TPath, T> & ResolveOptionalParams<TPath, T>\n\nexport type ParseParamsFn<in out TPath extends string, in out TParams> = (\n  rawParams: Expand<ResolveParams<TPath>>,\n) => TParams extends ResolveParams<TPath, any>\n  ? TParams\n  : ResolveParams<TPath, any>\n\nexport type StringifyParamsFn<in out TPath extends string, in out TParams> = (\n  params: TParams,\n) => ResolveParams<TPath>\n\nexport type ParamsOptions<in out TPath extends string, in out TParams> = {\n  params?: {\n    parse?: ParseParamsFn<TPath, TParams>\n    stringify?: StringifyParamsFn<TPath, TParams>\n  }\n\n  /** \n  @deprecated Use params.parse instead\n  */\n  parseParams?: ParseParamsFn<TPath, TParams>\n\n  /** \n  @deprecated Use params.stringify instead\n  */\n  stringifyParams?: StringifyParamsFn<TPath, TParams>\n}\n\ninterface RequiredStaticDataRouteOption {\n  staticData: StaticDataRouteOption\n}\n\ninterface OptionalStaticDataRouteOption {\n  staticData?: StaticDataRouteOption\n}\n\nexport type UpdatableStaticRouteOption = {} extends StaticDataRouteOption\n  ? OptionalStaticDataRouteOption\n  : RequiredStaticDataRouteOption\n\nexport type MetaDescriptor =\n  | { charSet: 'utf-8' }\n  | { title: string }\n  | { name: string; content: string }\n  | { property: string; content: string }\n  | { httpEquiv: string; content: string }\n  | { 'script:ld+json': LdJsonObject }\n  | { tagName: 'meta' | 'link'; [name: string]: string }\n  | Record<string, unknown>\n\ntype LdJsonObject = { [Key in string]: LdJsonValue } & {\n  [Key in string]?: LdJsonValue | undefined\n}\ntype LdJsonArray = Array<LdJsonValue> | ReadonlyArray<LdJsonValue>\ntype LdJsonPrimitive = string | number | boolean | null\ntype LdJsonValue = LdJsonPrimitive | LdJsonObject | LdJsonArray\n\nexport type RouteLinkEntry = {}\n\nexport type SearchValidator<TInput, TOutput> =\n  | ValidatorObj<TInput, TOutput>\n  | ValidatorFn<TInput, TOutput>\n  | ValidatorAdapter<TInput, TOutput>\n  | StandardSchemaValidator<TInput, TOutput>\n  | undefined\n\nexport type AnySearchValidator = SearchValidator<any, any>\n\nexport type DefaultSearchValidator = SearchValidator<\n  Record<string, unknown>,\n  AnySchema\n>\n\nexport type RoutePrefix<\n  TPrefix extends string,\n  TPath extends string,\n> = string extends TPath\n  ? RootRouteId\n  : TPath extends string\n    ? TPrefix extends RootRouteId\n      ? TPath extends '/'\n        ? '/'\n        : `/${TrimPath<TPath>}`\n      : `${TPrefix}/${TPath}` extends '/'\n        ? '/'\n        : `/${TrimPathLeft<`${TrimPathRight<TPrefix>}/${TrimPath<TPath>}`>}`\n    : never\n\nexport type TrimPath<T extends string> = '' extends T\n  ? ''\n  : TrimPathRight<TrimPathLeft<T>>\n\nexport type TrimPathLeft<T extends string> =\n  T extends `${RootRouteId}/${infer U}`\n    ? TrimPathLeft<U>\n    : T extends `/${infer U}`\n      ? TrimPathLeft<U>\n      : T\n\nexport type TrimPathRight<T extends string> = T extends '/'\n  ? '/'\n  : T extends `${infer U}/`\n    ? TrimPathRight<U>\n    : T\n\nexport type ContextReturnType<TContextFn> = unknown extends TContextFn\n  ? TContextFn\n  : LooseReturnType<TContextFn> extends never\n    ? AnyContext\n    : LooseReturnType<TContextFn>\n\nexport type ContextAsyncReturnType<TContextFn> = unknown extends TContextFn\n  ? TContextFn\n  : LooseAsyncReturnType<TContextFn> extends never\n    ? AnyContext\n    : LooseAsyncReturnType<TContextFn>\n\nexport type ResolveRouteContext<TRouteContextFn, TBeforeLoadFn> = Assign<\n  ContextReturnType<TRouteContextFn>,\n  ContextAsyncReturnType<TBeforeLoadFn>\n>\n\nexport type ResolveLoaderData<TLoaderFn> = unknown extends TLoaderFn\n  ? TLoaderFn\n  : LooseAsyncReturnType<TLoaderFn> extends never\n    ? undefined\n    : LooseAsyncReturnType<TLoaderFn>\n\nexport type ResolveFullSearchSchema<\n  TParentRoute extends AnyRoute,\n  TSearchValidator,\n> = unknown extends TParentRoute\n  ? ResolveValidatorOutput<TSearchValidator>\n  : IntersectAssign<\n      InferFullSearchSchema<TParentRoute>,\n      ResolveValidatorOutput<TSearchValidator>\n    >\n\nexport type ResolveFullSearchSchemaInput<\n  TParentRoute extends AnyRoute,\n  TSearchValidator,\n> = IntersectAssign<\n  InferFullSearchSchemaInput<TParentRoute>,\n  ResolveSearchValidatorInput<TSearchValidator>\n>\n\nexport type ResolveAllParamsFromParent<\n  TParentRoute extends AnyRoute,\n  TParams,\n> = Assign<InferAllParams<TParentRoute>, TParams>\n\nexport type RouteContextParameter<\n  TParentRoute extends AnyRoute,\n  TRouterContext,\n> = unknown extends TParentRoute\n  ? TRouterContext\n  : Assign<TRouterContext, InferAllContext<TParentRoute>>\n\nexport type BeforeLoadContextParameter<\n  TParentRoute extends AnyRoute,\n  TRouterContext,\n  TRouteContextFn,\n> = Assign<\n  RouteContextParameter<TParentRoute, TRouterContext>,\n  ContextReturnType<TRouteContextFn>\n>\n\nexport type ResolveAllContext<\n  TParentRoute extends AnyRoute,\n  TRouterContext,\n  TRouteContextFn,\n  TBeforeLoadFn,\n> = Assign<\n  BeforeLoadContextParameter<TParentRoute, TRouterContext, TRouteContextFn>,\n  ContextAsyncReturnType<TBeforeLoadFn>\n>\nexport interface FullSearchSchemaOption<\n  in out TParentRoute extends AnyRoute,\n  in out TSearchValidator,\n> {\n  search: Expand<ResolveFullSearchSchema<TParentRoute, TSearchValidator>>\n}\n\nexport interface RemountDepsOptions<\n  in out TRouteId,\n  in out TFullSearchSchema,\n  in out TAllParams,\n  in out TLoaderDeps,\n> {\n  routeId: TRouteId\n  search: TFullSearchSchema\n  params: TAllParams\n  loaderDeps: TLoaderDeps\n}\n\nexport type MakeRemountDepsOptionsUnion<\n  TRouteTree extends AnyRoute = RegisteredRouter['routeTree'],\n> =\n  ParseRoute<TRouteTree> extends infer TRoute extends AnyRoute\n    ? TRoute extends any\n      ? RemountDepsOptions<\n          TRoute['id'],\n          TRoute['types']['fullSearchSchema'],\n          TRoute['types']['allParams'],\n          TRoute['types']['loaderDeps']\n        >\n      : never\n    : never\n\nexport interface RouteTypes<\n  in out TRegister,\n  in out TParentRoute extends AnyRoute,\n  in out TPath extends string,\n  in out TFullPath extends string,\n  in out TCustomId extends string,\n  in out TId extends string,\n  in out TSearchValidator,\n  in out TParams,\n  in out TRouterContext,\n  in out TRouteContextFn,\n  in out TBeforeLoadFn,\n  in out TLoaderDeps,\n  in out TLoaderFn,\n  in out TChildren,\n  in out TFileRouteTypes,\n  in out TSSR,\n  in out TServerMiddlewares,\n  in out THandlers,\n> {\n  parentRoute: TParentRoute\n  path: TPath\n  to: TrimPathRight<TFullPath>\n  fullPath: TFullPath\n  customId: TCustomId\n  id: TId\n  searchSchema: ResolveValidatorOutput<TSearchValidator>\n  searchSchemaInput: ResolveSearchValidatorInput<TSearchValidator>\n  searchValidator: TSearchValidator\n  fullSearchSchema: ResolveFullSearchSchema<TParentRoute, TSearchValidator>\n  fullSearchSchemaInput: ResolveFullSearchSchemaInput<\n    TParentRoute,\n    TSearchValidator\n  >\n  params: TParams\n  allParams: ResolveAllParamsFromParent<TParentRoute, TParams>\n  routerContext: TRouterContext\n  routeContext: ResolveRouteContext<TRouteContextFn, TBeforeLoadFn>\n  routeContextFn: TRouteContextFn\n  beforeLoadFn: TBeforeLoadFn\n  allContext: ResolveAllContext<\n    TParentRoute,\n    TRouterContext,\n    TRouteContextFn,\n    TBeforeLoadFn\n  >\n  children: TChildren\n  loaderData: ResolveLoaderData<TLoaderFn>\n  loaderDeps: TLoaderDeps\n  fileRouteTypes: TFileRouteTypes\n  ssr: ResolveSSR<TSSR>\n  allSsr: ResolveAllSSR<TParentRoute, TSSR>\n}\n\nexport type ResolveSSR<TSSR> = TSSR extends (...args: ReadonlyArray<any>) => any\n  ? LooseReturnType<TSSR>\n  : TSSR\n\nexport type ResolveAllSSR<\n  TParentRoute extends AnyRoute,\n  TSSR,\n> = unknown extends TParentRoute\n  ? ResolveSSR<TSSR>\n  : unknown extends TSSR\n    ? TParentRoute['types']['allSsr']\n    : ResolveSSR<TSSR>\n\nexport type ResolveFullPath<\n  TParentRoute extends AnyRoute,\n  TPath extends string,\n  TPrefixed = RoutePrefix<TParentRoute['fullPath'], TPath>,\n> = TPrefixed extends RootRouteId ? '/' : TPrefixed\n\nexport interface RouteExtensions<in out TId, in out TFullPath> {\n  id: TId\n  fullPath: TFullPath\n}\n\nexport type RouteLazyFn<TRoute extends AnyRoute> = (\n  lazyFn: () => Promise<LazyRoute<TRoute>>,\n) => TRoute\n\nexport type RouteAddChildrenFn<\n  in out TRegister,\n  in out TParentRoute extends AnyRoute,\n  in out TPath extends string,\n  in out TFullPath extends string,\n  in out TCustomId extends string,\n  in out TId extends string,\n  in out TSearchValidator,\n  in out TParams,\n  in out TRouterContext,\n  in out TRouteContextFn,\n  in out TBeforeLoadFn,\n  in out TLoaderDeps extends Record<string, any>,\n  in out TLoaderFn,\n  in out TFileRouteTypes,\n  in out TSSR,\n  in out TServerMiddlewares,\n  in out THandlers,\n> = <const TNewChildren>(\n  children: Constrain<\n    TNewChildren,\n    ReadonlyArray<AnyRoute> | Record<string, AnyRoute>\n  >,\n) => Route<\n  TRegister,\n  TParentRoute,\n  TPath,\n  TFullPath,\n  TCustomId,\n  TId,\n  TSearchValidator,\n  TParams,\n  TRouterContext,\n  TRouteContextFn,\n  TBeforeLoadFn,\n  TLoaderDeps,\n  TLoaderFn,\n  TNewChildren,\n  TFileRouteTypes,\n  TSSR,\n  TServerMiddlewares,\n  THandlers\n>\n\nexport type RouteAddFileChildrenFn<\n  in out TRegister,\n  in out TParentRoute extends AnyRoute,\n  in out TPath extends string,\n  in out TFullPath extends string,\n  in out TCustomId extends string,\n  in out TId extends string,\n  in out TSearchValidator,\n  in out TParams,\n  in out TRouterContext,\n  in out TRouteContextFn,\n  in out TBeforeLoadFn,\n  in out TLoaderDeps extends Record<string, any>,\n  in out TLoaderFn,\n  in out TFileRouteTypes,\n  in out TSSR,\n  in out TServerMiddlewares,\n  in out THandlers,\n> = <const TNewChildren>(\n  children: TNewChildren,\n) => Route<\n  TRegister,\n  TParentRoute,\n  TPath,\n  TFullPath,\n  TCustomId,\n  TId,\n  TSearchValidator,\n  TParams,\n  TRouterContext,\n  TRouteContextFn,\n  TBeforeLoadFn,\n  TLoaderDeps,\n  TLoaderFn,\n  TNewChildren,\n  TFileRouteTypes,\n  TSSR,\n  TServerMiddlewares,\n  THandlers\n>\n\nexport type RouteAddFileTypesFn<\n  TRegister,\n  TParentRoute extends AnyRoute,\n  TPath extends string,\n  TFullPath extends string,\n  TCustomId extends string,\n  TId extends string,\n  TSearchValidator,\n  TParams,\n  TRouterContext,\n  TRouteContextFn,\n  TBeforeLoadFn,\n  TLoaderDeps extends Record<string, any>,\n  TLoaderFn,\n  TChildren,\n  TSSR,\n  TServerMiddlewares,\n  THandlers,\n> = <TNewFileRouteTypes>() => Route<\n  TRegister,\n  TParentRoute,\n  TPath,\n  TFullPath,\n  TCustomId,\n  TId,\n  TSearchValidator,\n  TParams,\n  TRouterContext,\n  TRouteContextFn,\n  TBeforeLoadFn,\n  TLoaderDeps,\n  TLoaderFn,\n  TChildren,\n  TNewFileRouteTypes,\n  TSSR,\n  TServerMiddlewares,\n  THandlers\n>\n\nexport interface Route<\n  in out TRegister,\n  in out TParentRoute extends AnyRoute,\n  in out TPath extends string,\n  in out TFullPath extends string,\n  in out TCustomId extends string,\n  in out TId extends string,\n  in out TSearchValidator,\n  in out TParams,\n  in out TRouterContext,\n  in out TRouteContextFn,\n  in out TBeforeLoadFn,\n  in out TLoaderDeps extends Record<string, any>,\n  in out TLoaderFn,\n  in out TChildren,\n  in out TFileRouteTypes,\n  in out TSSR,\n  in out TServerMiddlewares,\n  in out THandlers,\n> extends RouteExtensions<TId, TFullPath> {\n  path: TPath\n  parentRoute: TParentRoute\n  children?: TChildren\n  types: RouteTypes<\n    TRegister,\n    TParentRoute,\n    TPath,\n    TFullPath,\n    TCustomId,\n    TId,\n    TSearchValidator,\n    TParams,\n    TRouterContext,\n    TRouteContextFn,\n    TBeforeLoadFn,\n    TLoaderDeps,\n    TLoaderFn,\n    TChildren,\n    TFileRouteTypes,\n    TSSR,\n    TServerMiddlewares,\n    THandlers\n  >\n  options: RouteOptions<\n    TRegister,\n    TParentRoute,\n    TId,\n    TCustomId,\n    TFullPath,\n    TPath,\n    TSearchValidator,\n    TParams,\n    TLoaderDeps,\n    TLoaderFn,\n    TRouterContext,\n    TRouteContextFn,\n    TBeforeLoadFn,\n    TSSR,\n    TServerMiddlewares,\n    THandlers\n  >\n  isRoot: TParentRoute extends AnyRoute ? true : false\n  /** @internal */\n  _componentsPromise?: Promise<void>\n  /** @internal */\n  _componentsLoaded?: boolean\n  lazyFn?: () => Promise<\n    LazyRoute<\n      Route<\n        TRegister,\n        TParentRoute,\n        TPath,\n        TFullPath,\n        TCustomId,\n        TId,\n        TSearchValidator,\n        TParams,\n        TRouterContext,\n        TRouteContextFn,\n        TBeforeLoadFn,\n        TLoaderDeps,\n        TLoaderFn,\n        TChildren,\n        TFileRouteTypes,\n        TSSR,\n        TServerMiddlewares,\n        THandlers\n      >\n    >\n  >\n  /** @internal */\n  _lazyPromise?: Promise<void>\n  /** @internal */\n  _lazyLoaded?: boolean\n  rank: number\n  to: TrimPathRight<TFullPath>\n  init: (opts: { originalIndex: number }) => void\n  update: (\n    options: UpdatableRouteOptions<\n      TParentRoute,\n      TCustomId,\n      TFullPath,\n      TParams,\n      TSearchValidator,\n      TLoaderFn,\n      TLoaderDeps,\n      TRouterContext,\n      TRouteContextFn,\n      TBeforeLoadFn\n    >,\n  ) => this\n  lazy: RouteLazyFn<\n    Route<\n      TRegister,\n      TParentRoute,\n      TPath,\n      TFullPath,\n      TCustomId,\n      TId,\n      TSearchValidator,\n      TParams,\n      TRouterContext,\n      TRouteContextFn,\n      TBeforeLoadFn,\n      TLoaderDeps,\n      TLoaderFn,\n      TChildren,\n      TFileRouteTypes,\n      TSSR,\n      TServerMiddlewares,\n      THandlers\n    >\n  >\n  addChildren: RouteAddChildrenFn<\n    TRegister,\n    TParentRoute,\n    TPath,\n    TFullPath,\n    TCustomId,\n    TId,\n    TSearchValidator,\n    TParams,\n    TRouterContext,\n    TRouteContextFn,\n    TBeforeLoadFn,\n    TLoaderDeps,\n    TLoaderFn,\n    TFileRouteTypes,\n    TSSR,\n    TServerMiddlewares,\n    THandlers\n  >\n  _addFileChildren: RouteAddFileChildrenFn<\n    TRegister,\n    TParentRoute,\n    TPath,\n    TFullPath,\n    TCustomId,\n    TId,\n    TSearchValidator,\n    TParams,\n    TRouterContext,\n    TRouteContextFn,\n    TBeforeLoadFn,\n    TLoaderDeps,\n    TLoaderFn,\n    TFileRouteTypes,\n    TSSR,\n    TServerMiddlewares,\n    THandlers\n  >\n  _addFileTypes: RouteAddFileTypesFn<\n    TRegister,\n    TParentRoute,\n    TPath,\n    TFullPath,\n    TCustomId,\n    TId,\n    TSearchValidator,\n    TParams,\n    TRouterContext,\n    TRouteContextFn,\n    TBeforeLoadFn,\n    TLoaderDeps,\n    TLoaderFn,\n    TChildren,\n    TSSR,\n    TServerMiddlewares,\n    THandlers\n  >\n}\n\nexport type AnyRoute = Route<\n  any,\n  any,\n  any,\n  any,\n  any,\n  any,\n  any,\n  any,\n  any,\n  any,\n  any,\n  any,\n  any,\n  any,\n  any,\n  any,\n  any,\n  any\n>\n\nexport type AnyRouteWithContext<TContext> = AnyRoute & {\n  types: { allContext: TContext }\n}\n\nexport type RouteOptions<\n  TRegister,\n  TParentRoute extends AnyRoute = AnyRoute,\n  TId extends string = string,\n  TCustomId extends string = string,\n  TFullPath extends string = string,\n  TPath extends string = string,\n  TSearchValidator = undefined,\n  TParams = AnyPathParams,\n  TLoaderDeps extends Record<string, any> = {},\n  TLoaderFn = undefined,\n  TRouterContext = {},\n  TRouteContextFn = AnyContext,\n  TBeforeLoadFn = AnyContext,\n  TSSR = unknown,\n  TServerMiddlewares = unknown,\n  THandlers = undefined,\n> = BaseRouteOptions<\n  TRegister,\n  TParentRoute,\n  TId,\n  TCustomId,\n  TPath,\n  TSearchValidator,\n  TParams,\n  TLoaderDeps,\n  TLoaderFn,\n  TRouterContext,\n  TRouteContextFn,\n  TBeforeLoadFn,\n  TSSR,\n  TServerMiddlewares,\n  THandlers\n> &\n  UpdatableRouteOptions<\n    NoInfer<TParentRoute>,\n    NoInfer<TCustomId>,\n    NoInfer<TFullPath>,\n    NoInfer<TParams>,\n    NoInfer<TSearchValidator>,\n    NoInfer<TLoaderFn>,\n    NoInfer<TLoaderDeps>,\n    NoInfer<TRouterContext>,\n    NoInfer<TRouteContextFn>,\n    NoInfer<TBeforeLoadFn>\n  >\n\nexport type RouteContextFn<\n  in out TParentRoute extends AnyRoute,\n  in out TSearchValidator,\n  in out TParams,\n  in out TRouterContext,\n> = (\n  ctx: RouteContextOptions<\n    TParentRoute,\n    TSearchValidator,\n    TParams,\n    TRouterContext\n  >,\n) => any\n\nexport type FileBaseRouteOptions<\n  TRegister,\n  TParentRoute extends AnyRoute = AnyRoute,\n  TId extends string = string,\n  TPath extends string = string,\n  TSearchValidator = undefined,\n  TParams = {},\n  TLoaderDeps extends Record<string, any> = {},\n  TLoaderFn = undefined,\n  TRouterContext = {},\n  TRouteContextFn = AnyContext,\n  TBeforeLoadFn = AnyContext,\n  TRemountDepsFn = AnyContext,\n  TSSR = unknown,\n  TServerMiddlewares = unknown,\n  THandlers = undefined,\n> = ParamsOptions<TPath, TParams> &\n  FilebaseRouteOptionsInterface<\n    TRegister,\n    TParentRoute,\n    TId,\n    TPath,\n    TSearchValidator,\n    TParams,\n    TLoaderDeps,\n    TLoaderFn,\n    TRouterContext,\n    TRouteContextFn,\n    TBeforeLoadFn,\n    TRemountDepsFn,\n    TSSR,\n    TServerMiddlewares,\n    THandlers\n  >\n\nexport interface FilebaseRouteOptionsInterface<\n  TRegister,\n  TParentRoute extends AnyRoute = AnyRoute,\n  TId extends string = string,\n  TPath extends string = string,\n  TSearchValidator = undefined,\n  TParams = {},\n  TLoaderDeps extends Record<string, any> = {},\n  TLoaderFn = undefined,\n  TRouterContext = {},\n  TRouteContextFn = AnyContext,\n  TBeforeLoadFn = AnyContext,\n  TRemountDepsFn = AnyContext,\n  TSSR = unknown,\n  TServerMiddlewares = unknown,\n  THandlers = undefined,\n> {\n  validateSearch?: Constrain<TSearchValidator, AnyValidator, DefaultValidator>\n\n  shouldReload?:\n    | boolean\n    | ((\n        match: LoaderFnContext<\n          TRegister,\n          TParentRoute,\n          TId,\n          TParams,\n          TLoaderDeps,\n          TRouterContext,\n          TRouteContextFn,\n          TBeforeLoadFn,\n          TServerMiddlewares,\n          THandlers\n        >,\n      ) => any)\n\n  context?: Constrain<\n    TRouteContextFn,\n    (\n      ctx: RouteContextOptions<\n        TParentRoute,\n        TParams,\n        TRouterContext,\n        TLoaderDeps\n      >,\n    ) => any\n  >\n\n  ssr?: Constrain<\n    TSSR,\n    | undefined\n    | SSROption\n    | ((\n        ctx: SsrContextOptions<TParentRoute, TSearchValidator, TParams>,\n      ) => Awaitable<undefined | SSROption>)\n  >\n\n  // This async function is called before a route is loaded.\n  // If an error is thrown here, the route's loader will not be called.\n  // If thrown during a navigation, the navigation will be cancelled and the error will be passed to the `onError` function.\n  // If thrown during a preload event, the error will be logged to the console.\n  beforeLoad?: Constrain<\n    TBeforeLoadFn,\n    (\n      ctx: BeforeLoadContextOptions<\n        TRegister,\n        TParentRoute,\n        TSearchValidator,\n        TParams,\n        TRouterContext,\n        TRouteContextFn,\n        TServerMiddlewares,\n        THandlers\n      >,\n    ) => ValidateSerializableLifecycleResult<\n      TRegister,\n      TParentRoute,\n      TSSR,\n      TBeforeLoadFn\n    >\n  >\n\n  loaderDeps?: (\n    opts: FullSearchSchemaOption<TParentRoute, TSearchValidator>,\n  ) => TLoaderDeps\n\n  remountDeps?: Constrain<\n    TRemountDepsFn,\n    (\n      opt: RemountDepsOptions<\n        TId,\n        ResolveFullSearchSchema<TParentRoute, TSearchValidator>,\n        Expand<ResolveAllParamsFromParent<TParentRoute, TParams>>,\n        TLoaderDeps\n      >,\n    ) => any\n  >\n\n  loader?: Constrain<\n    TLoaderFn,\n    (\n      ctx: LoaderFnContext<\n        TRegister,\n        TParentRoute,\n        TId,\n        TParams,\n        TLoaderDeps,\n        TRouterContext,\n        TRouteContextFn,\n        TBeforeLoadFn,\n        TServerMiddlewares,\n        THandlers\n      >,\n    ) => ValidateSerializableLifecycleResult<\n      TRegister,\n      TParentRoute,\n      TSSR,\n      TLoaderFn\n    >\n  >\n}\n\nexport type BaseRouteOptions<\n  TRegister,\n  TParentRoute extends AnyRoute = AnyRoute,\n  TId extends string = string,\n  TCustomId extends string = string,\n  TPath extends string = string,\n  TSearchValidator = undefined,\n  TParams = {},\n  TLoaderDeps extends Record<string, any> = {},\n  TLoaderFn = undefined,\n  TRouterContext = {},\n  TRouteContextFn = AnyContext,\n  TBeforeLoadFn = AnyContext,\n  TSSR = unknown,\n  TServerMiddlewares = unknown,\n  THandlers = undefined,\n> = RoutePathOptions<TCustomId, TPath> &\n  FileBaseRouteOptions<\n    TRegister,\n    TParentRoute,\n    TId,\n    TPath,\n    TSearchValidator,\n    TParams,\n    TLoaderDeps,\n    TLoaderFn,\n    TRouterContext,\n    TRouteContextFn,\n    TBeforeLoadFn,\n    AnyContext,\n    TSSR,\n    TServerMiddlewares,\n    THandlers\n  > & {\n    getParentRoute: () => TParentRoute\n  }\n\nexport interface ContextOptions<\n  in out TParentRoute extends AnyRoute,\n  in out TParams,\n> {\n  abortController: AbortController\n  preload: boolean\n  params: Expand<ResolveAllParamsFromParent<TParentRoute, TParams>>\n  location: ParsedLocation\n  /**\n   * @deprecated Use `throw redirect({ to: '/somewhere' })` instead\n   **/\n  navigate: NavigateFn\n  buildLocation: BuildLocationFn\n  cause: 'preload' | 'enter' | 'stay'\n  matches: Array<MakeRouteMatchUnion>\n}\n\nexport interface RouteContextOptions<\n  in out TParentRoute extends AnyRoute,\n  in out TParams,\n  in out TRouterContext,\n  in out TLoaderDeps,\n> extends ContextOptions<TParentRoute, TParams> {\n  deps: TLoaderDeps\n  context: Expand<RouteContextParameter<TParentRoute, TRouterContext>>\n}\n\nexport interface SsrContextOptions<\n  in out TParentRoute extends AnyRoute,\n  in out TSearchValidator,\n  in out TParams,\n> {\n  params:\n    | {\n        status: 'success'\n        value: Expand<ResolveAllParamsFromParent<TParentRoute, TParams>>\n      }\n    | { status: 'error'; error: unknown }\n  search:\n    | {\n        status: 'success'\n        value: Expand<ResolveFullSearchSchema<TParentRoute, TSearchValidator>>\n      }\n    | { status: 'error'; error: unknown }\n  location: ParsedLocation\n  matches: Array<MakePreValidationErrorHandlingRouteMatchUnion>\n}\n\nexport interface BeforeLoadContextOptions<\n  in out TRegister,\n  in out TParentRoute extends AnyRoute,\n  in out TSearchValidator,\n  in out TParams,\n  in out TRouterContext,\n  in out TRouteContextFn,\n  in out TServerMiddlewares,\n  in out THandlers,\n> extends ContextOptions<TParentRoute, TParams>,\n    FullSearchSchemaOption<TParentRoute, TSearchValidator> {\n  context: Expand<\n    BeforeLoadContextParameter<TParentRoute, TRouterContext, TRouteContextFn>\n  >\n}\n\ntype AssetFnContextOptions<\n  in out TRouteId,\n  in out TFullPath,\n  in out TParentRoute extends AnyRoute,\n  in out TParams,\n  in out TSearchValidator,\n  in out TLoaderFn,\n  in out TRouterContext,\n  in out TRouteContextFn,\n  in out TBeforeLoadFn,\n  in out TLoaderDeps,\n> = {\n  matches: Array<\n    RouteMatch<\n      TRouteId,\n      TFullPath,\n      ResolveAllParamsFromParent<TParentRoute, TParams>,\n      ResolveFullSearchSchema<TParentRoute, TSearchValidator>,\n      ResolveLoaderData<TLoaderFn>,\n      ResolveAllContext<\n        TParentRoute,\n        TRouterContext,\n        TRouteContextFn,\n        TBeforeLoadFn\n      >,\n      TLoaderDeps\n    >\n  >\n  match: RouteMatch<\n    TRouteId,\n    TFullPath,\n    ResolveAllParamsFromParent<TParentRoute, TParams>,\n    ResolveFullSearchSchema<TParentRoute, TSearchValidator>,\n    ResolveLoaderData<TLoaderFn>,\n    ResolveAllContext<\n      TParentRoute,\n      TRouterContext,\n      TRouteContextFn,\n      TBeforeLoadFn\n    >,\n    TLoaderDeps\n  >\n  params: ResolveAllParamsFromParent<TParentRoute, TParams>\n  loaderData?: ResolveLoaderData<TLoaderFn>\n}\n\nexport interface DefaultUpdatableRouteOptionsExtensions {\n  component?: unknown\n  errorComponent?: unknown\n  notFoundComponent?: unknown\n  pendingComponent?: unknown\n}\n\nexport interface UpdatableRouteOptionsExtensions\n  extends DefaultUpdatableRouteOptionsExtensions {}\n\nexport interface UpdatableRouteOptions<\n  in out TParentRoute extends AnyRoute,\n  in out TRouteId,\n  in out TFullPath,\n  in out TParams,\n  in out TSearchValidator,\n  in out TLoaderFn,\n  in out TLoaderDeps,\n  in out TRouterContext,\n  in out TRouteContextFn,\n  in out TBeforeLoadFn,\n> extends UpdatableStaticRouteOption,\n    UpdatableRouteOptionsExtensions {\n  // If true, this route will be matched as case-sensitive\n  caseSensitive?: boolean\n  // If true, this route will be forcefully wrapped in a suspense boundary\n  wrapInSuspense?: boolean\n  // The content to be rendered when the route is matched. If no component is provided, defaults to `<Outlet />`\n\n  pendingMs?: number\n  pendingMinMs?: number\n  staleTime?: number\n  gcTime?: number\n  preload?: boolean\n  preloadStaleTime?: number\n  preloadGcTime?: number\n  search?: {\n    middlewares?: Array<\n      SearchMiddleware<\n        ResolveFullSearchSchemaInput<TParentRoute, TSearchValidator>\n      >\n    >\n  }\n  /** \n  @deprecated Use search.middlewares instead\n  */\n  preSearchFilters?: Array<\n    SearchFilter<ResolveFullSearchSchema<TParentRoute, TSearchValidator>>\n  >\n  /** \n  @deprecated Use search.middlewares instead\n  */\n  postSearchFilters?: Array<\n    SearchFilter<ResolveFullSearchSchema<TParentRoute, TSearchValidator>>\n  >\n  onCatch?: (error: Error) => void\n  onError?: (err: any) => void\n  // These functions are called as route matches are loaded, stick around and leave the active\n  // matches\n  onEnter?: (\n    match: RouteMatch<\n      TRouteId,\n      TFullPath,\n      ResolveAllParamsFromParent<TParentRoute, TParams>,\n      ResolveFullSearchSchema<TParentRoute, TSearchValidator>,\n      ResolveLoaderData<TLoaderFn>,\n      ResolveAllContext<\n        TParentRoute,\n        TRouterContext,\n        TRouteContextFn,\n        TBeforeLoadFn\n      >,\n      TLoaderDeps\n    >,\n  ) => void\n  onStay?: (\n    match: RouteMatch<\n      TRouteId,\n      TFullPath,\n      ResolveAllParamsFromParent<TParentRoute, TParams>,\n      ResolveFullSearchSchema<TParentRoute, TSearchValidator>,\n      ResolveLoaderData<TLoaderFn>,\n      ResolveAllContext<\n        TParentRoute,\n        TRouterContext,\n        TRouteContextFn,\n        TBeforeLoadFn\n      >,\n      TLoaderDeps\n    >,\n  ) => void\n  onLeave?: (\n    match: RouteMatch<\n      TRouteId,\n      TFullPath,\n      ResolveAllParamsFromParent<TParentRoute, TParams>,\n      ResolveFullSearchSchema<TParentRoute, TSearchValidator>,\n      ResolveLoaderData<TLoaderFn>,\n      ResolveAllContext<\n        TParentRoute,\n        TRouterContext,\n        TRouteContextFn,\n        TBeforeLoadFn\n      >,\n      TLoaderDeps\n    >,\n  ) => void\n  headers?: (\n    ctx: AssetFnContextOptions<\n      TRouteId,\n      TFullPath,\n      TParentRoute,\n      TParams,\n      TSearchValidator,\n      TLoaderFn,\n      TRouterContext,\n      TRouteContextFn,\n      TBeforeLoadFn,\n      TLoaderDeps\n    >,\n  ) => Awaitable<Record<string, string>>\n  head?: (\n    ctx: AssetFnContextOptions<\n      TRouteId,\n      TFullPath,\n      TParentRoute,\n      TParams,\n      TSearchValidator,\n      TLoaderFn,\n      TRouterContext,\n      TRouteContextFn,\n      TBeforeLoadFn,\n      TLoaderDeps\n    >,\n  ) => Awaitable<{\n    links?: AnyRouteMatch['links']\n    scripts?: AnyRouteMatch['headScripts']\n    meta?: AnyRouteMatch['meta']\n    styles?: AnyRouteMatch['styles']\n  }>\n  scripts?: (\n    ctx: AssetFnContextOptions<\n      TRouteId,\n      TFullPath,\n      TParentRoute,\n      TParams,\n      TSearchValidator,\n      TLoaderFn,\n      TRouterContext,\n      TRouteContextFn,\n      TBeforeLoadFn,\n      TLoaderDeps\n    >,\n  ) => Awaitable<AnyRouteMatch['scripts']>\n  codeSplitGroupings?: Array<\n    Array<\n      | 'loader'\n      | 'component'\n      | 'pendingComponent'\n      | 'notFoundComponent'\n      | 'errorComponent'\n    >\n  >\n}\n\nexport type RouteLoaderFn<\n  in out TRegister,\n  in out TParentRoute extends AnyRoute = AnyRoute,\n  in out TId extends string = string,\n  in out TParams = {},\n  in out TLoaderDeps = {},\n  in out TRouterContext = {},\n  in out TRouteContextFn = AnyContext,\n  in out TBeforeLoadFn = AnyContext,\n  in out TServerMiddlewares = unknown,\n  in out THandlers = undefined,\n> = (\n  match: LoaderFnContext<\n    TRegister,\n    TParentRoute,\n    TId,\n    TParams,\n    TLoaderDeps,\n    TRouterContext,\n    TRouteContextFn,\n    TBeforeLoadFn,\n    TServerMiddlewares,\n    THandlers\n  >,\n) => any\n\nexport interface LoaderFnContext<\n  in out TRegister = unknown,\n  in out TParentRoute extends AnyRoute = AnyRoute,\n  in out TId extends string = string,\n  in out TParams = {},\n  in out TLoaderDeps = {},\n  in out TRouterContext = {},\n  in out TRouteContextFn = AnyContext,\n  in out TBeforeLoadFn = AnyContext,\n  in out TServerMiddlewares = unknown,\n  in out THandlers = undefined,\n> {\n  abortController: AbortController\n  preload: boolean\n  params: Expand<ResolveAllParamsFromParent<TParentRoute, TParams>>\n  deps: TLoaderDeps\n  context: Expand<\n    ResolveAllContext<\n      TParentRoute,\n      TRouterContext,\n      TRouteContextFn,\n      TBeforeLoadFn\n    >\n  >\n  location: ParsedLocation // Do not supply search schema here so as to demotivate people from trying to shortcut loaderDeps\n  /**\n   * @deprecated Use `throw redirect({ to: '/somewhere' })` instead\n   **/\n  navigate: (opts: NavigateOptions<AnyRouter>) => Promise<void> | void\n  // root route does not have a parent match\n  parentMatchPromise: TId extends RootRouteId\n    ? never\n    : Promise<MakeRouteMatchFromRoute<TParentRoute>>\n  cause: 'preload' | 'enter' | 'stay'\n  route: AnyRoute\n}\n\nexport interface DefaultRootRouteOptionsExtensions {\n  shellComponent?: unknown\n}\n\nexport interface RootRouteOptionsExtensions\n  extends DefaultRootRouteOptionsExtensions {}\n\nexport interface RootRouteOptions<\n  TRegister = unknown,\n  TSearchValidator = undefined,\n  TRouterContext = {},\n  TRouteContextFn = AnyContext,\n  TBeforeLoadFn = AnyContext,\n  TLoaderDeps extends Record<string, any> = {},\n  TLoaderFn = undefined,\n  TSSR = unknown,\n  TServerMiddlewares = unknown,\n  THandlers = undefined,\n> extends Omit<\n      RouteOptions<\n        TRegister,\n        any, // TParentRoute\n        RootRouteId, // TId\n        RootRouteId, // TCustomId\n        '', // TFullPath\n        '', // TPath\n        TSearchValidator,\n        {}, // TParams\n        TLoaderDeps,\n        TLoaderFn,\n        TRouterContext,\n        TRouteContextFn,\n        TBeforeLoadFn,\n        TSSR,\n        TServerMiddlewares,\n        THandlers\n      >,\n      | 'path'\n      | 'id'\n      | 'getParentRoute'\n      | 'caseSensitive'\n      | 'parseParams'\n      | 'stringifyParams'\n      | 'params'\n    >,\n    RootRouteOptionsExtensions {}\n\nexport type RouteConstraints = {\n  TParentRoute: AnyRoute\n  TPath: string\n  TFullPath: string\n  TCustomId: string\n  TId: string\n  TSearchSchema: AnySchema\n  TFullSearchSchema: AnySchema\n  TParams: Record<string, any>\n  TAllParams: Record<string, any>\n  TParentContext: AnyContext\n  TRouteContext: RouteContext\n  TAllContext: AnyContext\n  TRouterContext: AnyContext\n  TChildren: unknown\n  TRouteTree: AnyRoute\n}\n\nexport type RouteTypesById<TRouter extends AnyRouter, TId> = RouteById<\n  TRouter['routeTree'],\n  TId\n>['types']\n\nexport type RouteMask<TRouteTree extends AnyRoute> = {\n  routeTree: TRouteTree\n  from: RoutePaths<TRouteTree>\n  to?: any\n  params?: any\n  search?: any\n  hash?: any\n  state?: any\n  unmaskOnReload?: boolean\n}\n\n/**\n * @deprecated Use `ErrorComponentProps` instead.\n */\nexport type ErrorRouteProps = {\n  error: unknown\n  info?: { componentStack: string }\n  reset: () => void\n}\n\nexport type ErrorComponentProps<TError = Error> = {\n  error: TError\n  info?: { componentStack: string }\n  reset: () => void\n}\nexport type NotFoundRouteProps = {\n  // TODO: Make sure this is `| null | undefined` (this is for global not-founds)\n  data: unknown\n}\n\nexport class BaseRoute<\n  in out TRegister = Register,\n  in out TParentRoute extends AnyRoute = AnyRoute,\n  in out TPath extends string = '/',\n  in out TFullPath extends string = ResolveFullPath<TParentRoute, TPath>,\n  in out TCustomId extends string = string,\n  in out TId extends string = ResolveId<TParentRoute, TCustomId, TPath>,\n  in out TSearchValidator = undefined,\n  in out TParams = ResolveParams<TPath>,\n  in out TRouterContext = AnyContext,\n  in out TRouteContextFn = AnyContext,\n  in out TBeforeLoadFn = AnyContext,\n  in out TLoaderDeps extends Record<string, any> = {},\n  in out TLoaderFn = undefined,\n  in out TChildren = unknown,\n  in out TFileRouteTypes = unknown,\n  in out TSSR = unknown,\n  in out TServerMiddlewares = unknown,\n  in out THandlers = undefined,\n> {\n  isRoot: TParentRoute extends AnyRoute ? true : false\n  options: RouteOptions<\n    TRegister,\n    TParentRoute,\n    TId,\n    TCustomId,\n    TFullPath,\n    TPath,\n    TSearchValidator,\n    TParams,\n    TLoaderDeps,\n    TLoaderFn,\n    TRouterContext,\n    TRouteContextFn,\n    TBeforeLoadFn,\n    TSSR,\n    TServerMiddlewares,\n    THandlers\n  >\n\n  // The following properties are set up in this.init()\n  parentRoute!: TParentRoute\n  private _id!: TId\n  private _path!: TPath\n  private _fullPath!: TFullPath\n  private _to!: TrimPathRight<TFullPath>\n\n  public get to() {\n    return this._to\n  }\n\n  public get id() {\n    return this._id\n  }\n\n  public get path() {\n    return this._path\n  }\n\n  public get fullPath() {\n    return this._fullPath\n  }\n\n  // Optional\n  children?: TChildren\n  originalIndex?: number\n  rank!: number\n  lazyFn?: () => Promise<\n    LazyRoute<\n      Route<\n        TRegister,\n        TParentRoute,\n        TPath,\n        TFullPath,\n        TCustomId,\n        TId,\n        TSearchValidator,\n        TParams,\n        TRouterContext,\n        TRouteContextFn,\n        TBeforeLoadFn,\n        TLoaderDeps,\n        TLoaderFn,\n        TChildren,\n        TFileRouteTypes,\n        TSSR,\n        TServerMiddlewares,\n        THandlers\n      >\n    >\n  >\n  /** @internal */\n  _lazyPromise?: Promise<void>\n  /** @internal */\n  _componentsPromise?: Promise<void>\n\n  constructor(\n    options?: RouteOptions<\n      TRegister,\n      TParentRoute,\n      TId,\n      TCustomId,\n      TFullPath,\n      TPath,\n      TSearchValidator,\n      TParams,\n      TLoaderDeps,\n      TLoaderFn,\n      TRouterContext,\n      TRouteContextFn,\n      TBeforeLoadFn,\n      TSSR,\n      TServerMiddlewares,\n      THandlers\n    >,\n  ) {\n    this.options = (options as any) || {}\n    this.isRoot = !options?.getParentRoute as any\n\n    if ((options as any)?.id && (options as any)?.path) {\n      throw new Error(`Route cannot have both an 'id' and a 'path' option.`)\n    }\n  }\n\n  types!: RouteTypes<\n    TRegister,\n    TParentRoute,\n    TPath,\n    TFullPath,\n    TCustomId,\n    TId,\n    TSearchValidator,\n    TParams,\n    TRouterContext,\n    TRouteContextFn,\n    TBeforeLoadFn,\n    TLoaderDeps,\n    TLoaderFn,\n    TChildren,\n    TFileRouteTypes,\n    TSSR,\n    TServerMiddlewares,\n    THandlers\n  >\n\n  init = (opts: { originalIndex: number }): void => {\n    this.originalIndex = opts.originalIndex\n\n    const options = this.options as\n      | (RouteOptions<\n          TRegister,\n          TParentRoute,\n          TId,\n          TCustomId,\n          TFullPath,\n          TPath,\n          TSearchValidator,\n          TParams,\n          TLoaderDeps,\n          TLoaderFn,\n          TRouterContext,\n          TRouteContextFn,\n          TBeforeLoadFn,\n          TSSR,\n          TServerMiddlewares\n        > &\n          RoutePathOptionsIntersection<TCustomId, TPath>)\n      | undefined\n\n    const isRoot = !options?.path && !options?.id\n\n    this.parentRoute = this.options.getParentRoute?.()\n\n    if (isRoot) {\n      this._path = rootRouteId as TPath\n    } else if (!this.parentRoute) {\n      invariant(\n        false,\n        `Child Route instances must pass a 'getParentRoute: () => ParentRoute' option that returns a Route instance.`,\n      )\n    }\n\n    let path: undefined | string = isRoot ? rootRouteId : options?.path\n\n    // If the path is anything other than an index path, trim it up\n    if (path && path !== '/') {\n      path = trimPathLeft(path)\n    }\n\n    const customId = options?.id || path\n\n    // Strip the parentId prefix from the first level of children\n    let id = isRoot\n      ? rootRouteId\n      : joinPaths([\n          this.parentRoute.id === rootRouteId ? '' : this.parentRoute.id,\n          customId,\n        ])\n\n    if (path === rootRouteId) {\n      path = '/'\n    }\n\n    if (id !== rootRouteId) {\n      id = joinPaths(['/', id])\n    }\n\n    const fullPath =\n      id === rootRouteId ? '/' : joinPaths([this.parentRoute.fullPath, path])\n\n    this._path = path as TPath\n    this._id = id as TId\n    this._fullPath = fullPath as TFullPath\n    this._to = fullPath as TrimPathRight<TFullPath>\n  }\n\n  clone = (other: typeof this) => {\n    this._path = other._path\n    this._id = other._id\n    this._fullPath = other._fullPath\n    this._to = other._to\n    this.options.getParentRoute = other.options.getParentRoute\n    this.children = other.children\n  }\n\n  addChildren: RouteAddChildrenFn<\n    TRegister,\n    TParentRoute,\n    TPath,\n    TFullPath,\n    TCustomId,\n    TId,\n    TSearchValidator,\n    TParams,\n    TRouterContext,\n    TRouteContextFn,\n    TBeforeLoadFn,\n    TLoaderDeps,\n    TLoaderFn,\n    TFileRouteTypes,\n    TSSR,\n    TServerMiddlewares,\n    THandlers\n  > = (children) => {\n    return this._addFileChildren(children) as any\n  }\n\n  _addFileChildren: RouteAddFileChildrenFn<\n    TRegister,\n    TParentRoute,\n    TPath,\n    TFullPath,\n    TCustomId,\n    TId,\n    TSearchValidator,\n    TParams,\n    TRouterContext,\n    TRouteContextFn,\n    TBeforeLoadFn,\n    TLoaderDeps,\n    TLoaderFn,\n    TFileRouteTypes,\n    TSSR,\n    TServerMiddlewares,\n    THandlers\n  > = (children) => {\n    if (Array.isArray(children)) {\n      this.children = children as TChildren\n    }\n\n    if (typeof children === 'object' && children !== null) {\n      this.children = Object.values(children) as TChildren\n    }\n\n    return this as any\n  }\n\n  _addFileTypes: RouteAddFileTypesFn<\n    TRegister,\n    TParentRoute,\n    TPath,\n    TFullPath,\n    TCustomId,\n    TId,\n    TSearchValidator,\n    TParams,\n    TRouterContext,\n    TRouteContextFn,\n    TBeforeLoadFn,\n    TLoaderDeps,\n    TLoaderFn,\n    TChildren,\n    TSSR,\n    TServerMiddlewares,\n    THandlers\n  > = () => {\n    return this as any\n  }\n\n  updateLoader = <TNewLoaderFn>(options: {\n    loader: Constrain<\n      TNewLoaderFn,\n      RouteLoaderFn<\n        TRegister,\n        TParentRoute,\n        TCustomId,\n        TParams,\n        TLoaderDeps,\n        TRouterContext,\n        TRouteContextFn,\n        TBeforeLoadFn\n      >\n    >\n  }) => {\n    Object.assign(this.options, options)\n    return this as unknown as BaseRoute<\n      TRegister,\n      TParentRoute,\n      TPath,\n      TFullPath,\n      TCustomId,\n      TId,\n      TSearchValidator,\n      TParams,\n      TRouterContext,\n      TRouteContextFn,\n      TBeforeLoadFn,\n      TLoaderDeps,\n      TNewLoaderFn,\n      TChildren,\n      TFileRouteTypes,\n      TSSR,\n      TServerMiddlewares,\n      THandlers\n    >\n  }\n\n  update = (\n    options: UpdatableRouteOptions<\n      TParentRoute,\n      TCustomId,\n      TFullPath,\n      TParams,\n      TSearchValidator,\n      TLoaderFn,\n      TLoaderDeps,\n      TRouterContext,\n      TRouteContextFn,\n      TBeforeLoadFn\n    >,\n  ): this => {\n    Object.assign(this.options, options)\n    return this\n  }\n\n  lazy: RouteLazyFn<\n    Route<\n      TRegister,\n      TParentRoute,\n      TPath,\n      TFullPath,\n      TCustomId,\n      TId,\n      TSearchValidator,\n      TParams,\n      TRouterContext,\n      TRouteContextFn,\n      TBeforeLoadFn,\n      TLoaderDeps,\n      TLoaderFn,\n      TChildren,\n      TFileRouteTypes,\n      TSSR,\n      TServerMiddlewares,\n      THandlers\n    >\n  > = (lazyFn) => {\n    this.lazyFn = lazyFn\n    return this\n  }\n}\n\nexport class BaseRouteApi<TId, TRouter extends AnyRouter = RegisteredRouter> {\n  id: TId\n\n  constructor({ id }: { id: TId }) {\n    this.id = id as any\n  }\n\n  notFound = (opts?: NotFoundError) => {\n    return notFound({ routeId: this.id as string, ...opts })\n  }\n}\n\nexport interface RootRoute<\n  in out TRegister,\n  in out TSearchValidator = undefined,\n  in out TRouterContext = {},\n  in out TRouteContextFn = AnyContext,\n  in out TBeforeLoadFn = AnyContext,\n  in out TLoaderDeps extends Record<string, any> = {},\n  in out TLoaderFn = undefined,\n  in out TChildren = unknown,\n  in out TFileRouteTypes = unknown,\n  in out TSSR = unknown,\n  in out TServerMiddlewares = unknown,\n  in out THandlers = undefined,\n> extends Route<\n    TRegister,\n    any, // TParentRoute\n    '/', // TPath\n    '/', // TFullPath\n    string, // TCustomId\n    RootRouteId, // TId\n    TSearchValidator, // TSearchValidator\n    {}, // TParams\n    TRouterContext,\n    TRouteContextFn,\n    TBeforeLoadFn,\n    TLoaderDeps,\n    TLoaderFn,\n    TChildren, // TChildren\n    TFileRouteTypes,\n    TSSR,\n    TServerMiddlewares,\n    THandlers\n  > {}\n\nexport class BaseRootRoute<\n  in out TRegister = Register,\n  in out TSearchValidator = undefined,\n  in out TRouterContext = {},\n  in out TRouteContextFn = AnyContext,\n  in out TBeforeLoadFn = AnyContext,\n  in out TLoaderDeps extends Record<string, any> = {},\n  in out TLoaderFn = undefined,\n  in out TChildren = unknown,\n  in out TFileRouteTypes = unknown,\n  in out TSSR = unknown,\n  in out TServerMiddlewares = unknown,\n  in out THandlers = undefined,\n> extends BaseRoute<\n  TRegister,\n  any, // TParentRoute\n  '/', // TPath\n  '/', // TFullPath\n  string, // TCustomId\n  RootRouteId, // TId\n  TSearchValidator, // TSearchValidator\n  {}, // TParams\n  TRouterContext,\n  TRouteContextFn,\n  TBeforeLoadFn,\n  TLoaderDeps,\n  TLoaderFn,\n  TChildren, // TChildren\n  TFileRouteTypes,\n  TSSR,\n  TServerMiddlewares,\n  THandlers\n> {\n  constructor(\n    options?: RootRouteOptions<\n      TRegister,\n      TSearchValidator,\n      TRouterContext,\n      TRouteContextFn,\n      TBeforeLoadFn,\n      TLoaderDeps,\n      TLoaderFn,\n      TSSR,\n      TServerMiddlewares,\n      THandlers\n    >,\n  ) {\n    super(options as any)\n  }\n}\n\n//\n\nexport interface RouteLike {\n  id: string\n  isRoot?: boolean\n  path?: string\n  fullPath: string\n  rank?: number\n  parentRoute?: RouteLike\n  children?: Array<RouteLike>\n  options?: {\n    caseSensitive?: boolean\n  }\n}\n", "import * as React from 'react'\nimport type { ErrorRouteComponent } from './route'\nimport type { ErrorInfo } from 'react'\n\nexport function CatchBoundary(props: {\n  getResetKey: () => number | string\n  children: React.ReactNode\n  errorComponent?: ErrorRouteComponent\n  onCatch?: (error: Error, errorInfo: ErrorInfo) => void\n}) {\n  const errorComponent = props.errorComponent ?? ErrorComponent\n\n  return (\n    <CatchBoundaryImpl\n      getResetKey={props.getResetKey}\n      onCatch={props.onCatch}\n      children={({ error, reset }) => {\n        if (error) {\n          return React.createElement(errorComponent, {\n            error,\n            reset,\n          })\n        }\n\n        return props.children\n      }}\n    />\n  )\n}\n\nclass CatchBoundaryImpl extends React.Component<{\n  getResetKey: () => number | string\n  children: (props: {\n    error: Error | null\n    reset: () => void\n  }) => React.ReactNode\n  onCatch?: (error: Error, errorInfo: ErrorInfo) => void\n}> {\n  state = { error: null } as { error: Error | null; resetKey: string }\n  static getDerivedStateFromProps(props: any) {\n    return { resetKey: props.getResetKey() }\n  }\n  static getDerivedStateFromError(error: Error) {\n    return { error }\n  }\n  reset() {\n    this.setState({ error: null })\n  }\n  componentDidUpdate(\n    prevProps: Readonly<{\n      getResetKey: () => string\n      children: (props: { error: any; reset: () => void }) => any\n      onCatch?: ((error: any, info: any) => void) | undefined\n    }>,\n    prevState: any,\n  ): void {\n    if (prevState.error && prevState.resetKey !== this.state.resetKey) {\n      this.reset()\n    }\n  }\n  componentDidCatch(error: Error, errorInfo: ErrorInfo) {\n    if (this.props.onCatch) {\n      this.props.onCatch(error, errorInfo)\n    }\n  }\n  render() {\n    // If the resetKey has changed, don't render the error\n    return this.props.children({\n      error:\n        this.state.resetKey !== this.props.getResetKey()\n          ? null\n          : this.state.error,\n      reset: () => {\n        this.reset()\n      },\n    })\n  }\n}\n\nexport function ErrorComponent({ error }: { error: any }) {\n  const [show, setShow] = React.useState(process.env.NODE_ENV !== 'production')\n\n  return (\n    <div style={{ padding: '.5rem', maxWidth: '100%' }}>\n      <div style={{ display: 'flex', alignItems: 'center', gap: '.5rem' }}>\n        <strong style={{ fontSize: '1rem' }}>Something went wrong!</strong>\n        <button\n          style={{\n            appearance: 'none',\n            fontSize: '.6em',\n            border: '1px solid currentColor',\n            padding: '.1rem .2rem',\n            fontWeight: 'bold',\n            borderRadius: '.25rem',\n          }}\n          onClick={() => setShow((d) => !d)}\n        >\n          {show ? 'Hide Error' : 'Show Error'}\n        </button>\n      </div>\n      <div style={{ height: '.25rem' }} />\n      {show ? (\n        <div>\n          <pre\n            style={{\n              fontSize: '.7em',\n              border: '1px solid red',\n              borderRadius: '.25rem',\n              padding: '.3rem',\n              color: 'red',\n              overflow: 'auto',\n            }}\n          >\n            {error.message ? <code>{error.message}</code> : null}\n          </pre>\n        </div>\n      ) : null}\n    </div>\n  )\n}\n", "import React from 'react'\n\nexport interface ClientOnlyProps {\n  /**\n   * The children to render when the JS is loaded.\n   */\n  children: React.ReactNode\n  /**\n   * The fallback component to render if the JS is not yet loaded.\n   */\n  fallback?: React.ReactNode\n}\n\n/**\n * Render the children only after the JS has loaded client-side. Use an optional\n * fallback component if the JS is not yet loaded.\n *\n * @example\n * Render a Chart component if JS loads, renders a simple FakeChart\n * component server-side or if there is no JS. The FakeChart can have only the\n * UI without the behavior or be a loading spinner or skeleton.\n *\n * ```tsx\n * return (\n *   <ClientOnly fallback={<FakeChart />}>\n *     <Chart />\n *   </ClientOnly>\n * )\n * ```\n */\n/**\n * Render children only after client hydration; otherwise render `fallback`.\n * Useful for components that require browser-only APIs.\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/clientOnlyComponent\n */\nexport function ClientOnly({ children, fallback = null }: ClientOnlyProps) {\n  return useHydrated() ? (\n    <React.Fragment>{children}</React.Fragment>\n  ) : (\n    <React.Fragment>{fallback}</React.Fragment>\n  )\n}\n\n/**\n * Return a boolean indicating if the JS has been hydrated already.\n * When doing Server-Side Rendering, the result will always be false.\n * When doing Client-Side Rendering, the result will always be false on the\n * first render and true from then on. Even if a new component renders it will\n * always start with true.\n *\n * @example\n * ```tsx\n * // Disable a button that needs JS to work.\n * let hydrated = useHydrated()\n * return (\n *   <button type=\"button\" disabled={!hydrated} onClick={doSomethingCustom}>\n *     Click me\n *   </button>\n * )\n * ```\n * @returns True if the JS has been hydrated already, false otherwise.\n */\n/**\n * Return a boolean indicating whether client hydration has occurred.\n */\nfunction useHydrated(): boolean {\n  return React.useSyncExternalStore(\n    subscribe,\n    () => true,\n    () => false,\n  )\n}\n\nfunction subscribe() {\n  return () => {}\n}\n", "var isProduction = process.env.NODE_ENV === 'production';\nfunction warning(condition, message) {\n  if (!isProduction) {\n    if (condition) {\n      return;\n    }\n\n    var text = \"Warning: \" + message;\n\n    if (typeof console !== 'undefined') {\n      console.warn(text);\n    }\n\n    try {\n      throw Error(text);\n    } catch (x) {}\n  }\n}\n\nexport default warning;\n", "import { useSyncExternalStoreWithSelector } from 'use-sync-external-store/shim/with-selector.js'\nimport type { Derived, Store } from '@tanstack/store'\n\nexport * from '@tanstack/store'\n\n/**\n * @private\n */\nexport type NoInfer<T> = [T][T extends any ? 0 : never]\ntype EqualityFn<T> = (objA: T, objB: T) => boolean\ninterface UseStoreOptions<T> {\n  equal?: EqualityFn<T>\n}\n\nexport function useStore<TState, TSelected = NoInfer<TState>>(\n  store: Store<TState, any>,\n  selector?: (state: NoInfer<TState>) => TSelected,\n  options?: UseStoreOptions<TSelected>,\n): TSelected\nexport function useStore<TState, TSelected = NoInfer<TState>>(\n  store: Derived<TState, any>,\n  selector?: (state: NoInfer<TState>) => TSelected,\n  options?: UseStoreOptions<TSelected>,\n): TSelected\nexport function useStore<TState, TSelected = NoInfer<TState>>(\n  store: Store<TState, any> | Derived<TState, any>,\n  selector: (state: NoInfer<TState>) => TSelected = (d) => d as any,\n  options: UseStoreOptions<TSelected> = {},\n): TSelected {\n  const equal = options.equal ?? shallow\n  const slice = useSyncExternalStoreWithSelector(\n    store.subscribe,\n    () => store.state,\n    () => store.state,\n    selector,\n    equal,\n  )\n\n  return slice\n}\n\nexport function shallow<T>(objA: T, objB: T) {\n  if (Object.is(objA, objB)) {\n    return true\n  }\n\n  if (\n    typeof objA !== 'object' ||\n    objA === null ||\n    typeof objB !== 'object' ||\n    objB === null\n  ) {\n    return false\n  }\n\n  if (objA instanceof Map && objB instanceof Map) {\n    if (objA.size !== objB.size) return false\n    for (const [k, v] of objA) {\n      if (!objB.has(k) || !Object.is(v, objB.get(k))) return false\n    }\n    return true\n  }\n\n  if (objA instanceof Set && objB instanceof Set) {\n    if (objA.size !== objB.size) return false\n    for (const v of objA) {\n      if (!objB.has(v)) return false\n    }\n    return true\n  }\n\n  if (objA instanceof Date && objB instanceof Date) {\n    if (objA.getTime() !== objB.getTime()) return false\n    return true\n  }\n\n  const keysA = getOwnKeys(objA)\n  if (keysA.length !== getOwnKeys(objB).length) {\n    return false\n  }\n\n  for (let i = 0; i < keysA.length; i++) {\n    if (\n      !Object.prototype.hasOwnProperty.call(objB, keysA[i] as string) ||\n      !Object.is(objA[keysA[i] as keyof T], objB[keysA[i] as keyof T])\n    ) {\n      return false\n    }\n  }\n  return true\n}\n\nfunction getOwnKeys(obj: object): Array<string | symbol> {\n  return (Object.keys(obj) as Array<string | symbol>).concat(\n    Object.getOwnPropertySymbols(obj),\n  )\n}\n", "import * as React from 'react'\nimport type { AnyRouter } from '@tanstack/router-core'\n\ndeclare global {\n  interface Window {\n    __TSR_ROUTER_CONTEXT__?: React.Context<AnyRouter>\n  }\n}\n\nconst routerContext = React.createContext<AnyRouter>(null!)\n\nexport function getRouterContext() {\n  if (typeof document === 'undefined') {\n    return routerContext\n  }\n\n  if (window.__TSR_ROUTER_CONTEXT__) {\n    return window.__TSR_ROUTER_CONTEXT__\n  }\n\n  window.__TSR_ROUTER_CONTEXT__ = routerContext as any\n\n  return routerContext\n}\n", "import * as React from 'react'\nimport warning from 'tiny-warning'\nimport { getRouterContext } from './routerContext'\nimport type { AnyRouter, RegisteredRouter } from '@tanstack/router-core'\n\n/**\n * Access the current TanStack Router instance from React context.\n * Must be used within a `RouterProvider`.\n *\n * Options:\n * - `warn`: Log a warning if no router context is found (default: true).\n *\n * @returns The registered router instance.\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useRouterHook\n */\n/**\n * Access the current TanStack Router instance from React context.\n * Must be used within a `RouterProvider`.\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useRouterHook\n */\nexport function useRouter<TRouter extends AnyRouter = RegisteredRouter>(opts?: {\n  warn?: boolean\n}): TRouter {\n  const value = React.useContext(getRouterContext())\n  warning(\n    !((opts?.warn ?? true) && !value),\n    'useRouter must be used inside a <RouterProvider> component!',\n  )\n  return value as any\n}\n", "import { useStore } from '@tanstack/react-store'\nimport { useRef } from 'react'\nimport { replaceEqualDeep } from '@tanstack/router-core'\nimport { useRouter } from './useRouter'\nimport type {\n  AnyRouter,\n  RegisteredRouter,\n  RouterState,\n} from '@tanstack/router-core'\nimport type {\n  StructuralSharingOption,\n  ValidateSelected,\n} from './structuralSharing'\n\nexport type UseRouterStateOptions<\n  TRouter extends AnyRouter,\n  TSelected,\n  TStructuralSharing,\n> = {\n  router?: TRouter\n  select?: (\n    state: RouterState<TRouter['routeTree']>,\n  ) => ValidateSelected<TRouter, TSelected, TStructuralSharing>\n} & StructuralSharingOption<TRouter, TSelected, TStructuralSharing>\n\nexport type UseRouterStateResult<\n  TRouter extends AnyRouter,\n  TSelected,\n> = unknown extends TSelected ? RouterState<TRouter['routeTree']> : TSelected\n\n/**\n * Subscribe to the router's state store with optional selection and\n * structural sharing for render optimization.\n *\n * Options:\n * - `select`: Project the full router state to a derived slice\n * - `structuralSharing`: Replace-equal semantics for stable references\n * - `router`: Read state from a specific router instance instead of context\n *\n * @returns The selected router state (or the full state by default).\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useRouterStateHook\n */\n/**\n * Subscribe to the router's state store with optional selection and\n * structural sharing for render optimization.\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useRouterStateHook\n */\nexport function useRouterState<\n  TRouter extends AnyRouter = RegisteredRouter,\n  TSelected = unknown,\n  TStructuralSharing extends boolean = boolean,\n>(\n  opts?: UseRouterStateOptions<TRouter, TSelected, TStructuralSharing>,\n): UseRouterStateResult<TRouter, TSelected> {\n  const contextRouter = useRouter<TRouter>({\n    warn: opts?.router === undefined,\n  })\n  const router = opts?.router || contextRouter\n  const previousResult =\n    useRef<ValidateSelected<TRouter, TSelected, TStructuralSharing>>(undefined)\n\n  return useStore(router.__store, (state) => {\n    if (opts?.select) {\n      if (opts.structuralSharing ?? router.options.defaultStructuralSharing) {\n        const newSlice = replaceEqualDeep(\n          previousResult.current,\n          opts.select(state),\n        )\n        previousResult.current = newSlice\n        return newSlice\n      }\n      return opts.select(state)\n    }\n    return state\n  }) as UseRouterStateResult<TRouter, TSelected>\n}\n", "import * as React from 'react'\n\nexport const matchContext = React.createContext<string | undefined>(undefined)\n\n// N.B. this only exists so we can conditionally call useContext on it when we are not interested in the nearest match\nexport const dummyMatchContext = React.createContext<string | undefined>(\n  undefined,\n)\n", "import * as React from 'react'\nimport invariant from 'tiny-invariant'\nimport { useRouterState } from './useRouterState'\nimport { dummyMatchContext, matchContext } from './matchContext'\nimport type {\n  StructuralSharingOption,\n  ValidateSelected,\n} from './structuralSharing'\nimport type {\n  AnyRouter,\n  MakeRouteMatch,\n  MakeRouteMatchUnion,\n  RegisteredRouter,\n  StrictOrFrom,\n  ThrowConstraint,\n  ThrowOrOptional,\n} from '@tanstack/router-core'\n\nexport interface UseMatchBaseOptions<\n  TRouter extends AnyRouter,\n  TFrom,\n  TStrict extends boolean,\n  TThrow extends boolean,\n  TSelected,\n  TStructuralSharing extends boolean,\n> {\n  select?: (\n    match: MakeRouteMatch<TRouter['routeTree'], TFrom, TStrict>,\n  ) => ValidateSelected<TRouter, TSelected, TStructuralSharing>\n  shouldThrow?: TThrow\n}\n\nexport type UseMatchRoute<out TFrom> = <\n  TRouter extends AnyRouter = RegisteredRouter,\n  TSelected = unknown,\n  TStructuralSharing extends boolean = boolean,\n>(\n  opts?: UseMatchBaseOptions<\n    TRouter,\n    TFrom,\n    true,\n    true,\n    TSelected,\n    TStructuralSharing\n  > &\n    StructuralSharingOption<TRouter, TSelected, TStructuralSharing>,\n) => UseMatchResult<TRouter, TFrom, true, TSelected>\n\nexport type UseMatchOptions<\n  TRouter extends AnyRouter,\n  TFrom extends string | undefined,\n  TStrict extends boolean,\n  TThrow extends boolean,\n  TSelected,\n  TStructuralSharing extends boolean,\n> = StrictOrFrom<TRouter, TFrom, TStrict> &\n  UseMatchBaseOptions<\n    TRouter,\n    TFrom,\n    TStrict,\n    TThrow,\n    TSelected,\n    TStructuralSharing\n  > &\n  StructuralSharingOption<TRouter, TSelected, TStructuralSharing>\n\nexport type UseMatchResult<\n  TRouter extends AnyRouter,\n  TFrom,\n  TStrict extends boolean,\n  TSelected,\n> = unknown extends TSelected\n  ? TStrict extends true\n    ? MakeRouteMatch<TRouter['routeTree'], TFrom, TStrict>\n    : MakeRouteMatchUnion<TRouter>\n  : TSelected\n\n/**\n * Read and select the nearest or targeted route match.\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useMatchHook\n */\nexport function useMatch<\n  TRouter extends AnyRouter = RegisteredRouter,\n  const TFrom extends string | undefined = undefined,\n  TStrict extends boolean = true,\n  TThrow extends boolean = true,\n  TSelected = unknown,\n  TStructuralSharing extends boolean = boolean,\n>(\n  opts: UseMatchOptions<\n    TRouter,\n    TFrom,\n    TStrict,\n    ThrowConstraint<TStrict, TThrow>,\n    TSelected,\n    TStructuralSharing\n  >,\n): ThrowOrOptional<UseMatchResult<TRouter, TFrom, TStrict, TSelected>, TThrow> {\n  const nearestMatchId = React.useContext(\n    opts.from ? dummyMatchContext : matchContext,\n  )\n\n  const matchSelection = useRouterState({\n    select: (state: any) => {\n      const match = state.matches.find((d: any) =>\n        opts.from ? opts.from === d.routeId : d.id === nearestMatchId,\n      )\n      invariant(\n        !((opts.shouldThrow ?? true) && !match),\n        `Could not find ${opts.from ? `an active match from \"${opts.from}\"` : 'a nearest match!'}`,\n      )\n\n      if (match === undefined) {\n        return undefined\n      }\n\n      return opts.select ? opts.select(match) : match\n    },\n    structuralSharing: opts.structuralSharing,\n  } as any)\n\n  return matchSelection as any\n}\n", "import { useMatch } from './useMatch'\nimport type {\n  StructuralSharingOption,\n  ValidateSelected,\n} from './structuralSharing'\nimport type {\n  AnyRouter,\n  RegisteredRouter,\n  ResolveUseLoaderData,\n  StrictOrFrom,\n  UseLoaderDataResult,\n} from '@tanstack/router-core'\n\nexport interface UseLoaderDataBaseOptions<\n  TRouter extends AnyRouter,\n  TFrom,\n  TStrict extends boolean,\n  TSelected,\n  TStructuralSharing,\n> {\n  select?: (\n    match: ResolveUseLoaderData<TRouter, TFrom, TStrict>,\n  ) => ValidateSelected<TRouter, TSelected, TStructuralSharing>\n}\n\nexport type UseLoaderDataOptions<\n  TRouter extends AnyRouter,\n  TFrom extends string | undefined,\n  TStrict extends boolean,\n  TSelected,\n  TStructuralSharing,\n> = StrictOrFrom<TRouter, TFrom, TStrict> &\n  UseLoaderDataBaseOptions<\n    TRouter,\n    TFrom,\n    TStrict,\n    TSelected,\n    TStructuralSharing\n  > &\n  StructuralSharingOption<TRouter, TSelected, TStructuralSharing>\n\nexport type UseLoaderDataRoute<out TId> = <\n  TRouter extends AnyRouter = RegisteredRouter,\n  TSelected = unknown,\n  TStructuralSharing extends boolean = boolean,\n>(\n  opts?: UseLoaderDataBaseOptions<\n    TRouter,\n    TId,\n    true,\n    TSelected,\n    TStructuralSharing\n  > &\n    StructuralSharingOption<TRouter, TSelected, TStructuralSharing>,\n) => UseLoaderDataResult<TRouter, TId, true, TSelected>\n\n/**\n * Read and select the current route's loader data with type‑safety.\n *\n * Options:\n * - `from`/`strict`: Choose which route's data to read and strictness\n * - `select`: Map the loader data to a derived value\n * - `structuralSharing`: Enable structural sharing for stable references\n *\n * @returns The loader data (or selected value) for the matched route.\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useLoaderDataHook\n */\n/**\n * Read and select the current route's loader data with type‑safety.\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useLoaderDataHook\n */\nexport function useLoaderData<\n  TRouter extends AnyRouter = RegisteredRouter,\n  const TFrom extends string | undefined = undefined,\n  TStrict extends boolean = true,\n  TSelected = unknown,\n  TStructuralSharing extends boolean = boolean,\n>(\n  opts: UseLoaderDataOptions<\n    TRouter,\n    TFrom,\n    TStrict,\n    TSelected,\n    TStructuralSharing\n  >,\n): UseLoaderDataResult<TRouter, TFrom, TStrict, TSelected> {\n  return useMatch({\n    from: opts.from!,\n    strict: opts.strict,\n    structuralSharing: opts.structuralSharing,\n    select: (s: any) => {\n      return opts.select ? opts.select(s.loaderData) : s.loaderData\n    },\n  } as any) as UseLoaderDataResult<TRouter, TFrom, TStrict, TSelected>\n}\n", "import { useMatch } from './useMatch'\nimport type {\n  StructuralSharingOption,\n  ValidateSelected,\n} from './structuralSharing'\nimport type {\n  AnyRouter,\n  RegisteredRouter,\n  ResolveUseLoaderDeps,\n  StrictOrFrom,\n  UseLoaderDepsResult,\n} from '@tanstack/router-core'\n\nexport interface UseLoaderDepsBaseOptions<\n  TRouter extends AnyRouter,\n  TFrom,\n  TSelected,\n  TStructuralSharing,\n> {\n  select?: (\n    deps: ResolveUseLoaderDeps<TRouter, TFrom>,\n  ) => ValidateSelected<TRouter, TSelected, TStructuralSharing>\n}\n\nexport type UseLoaderDepsOptions<\n  TRouter extends AnyRouter,\n  TFrom extends string | undefined,\n  TSelected,\n  TStructuralSharing,\n> = StrictOrFrom<TRouter, TFrom> &\n  UseLoaderDepsBaseOptions<TRouter, TFrom, TSelected, TStructuralSharing> &\n  StructuralSharingOption<TRouter, TSelected, TStructuralSharing>\n\nexport type UseLoaderDepsRoute<out TId> = <\n  TRouter extends AnyRouter = RegisteredRouter,\n  TSelected = unknown,\n  TStructuralSharing extends boolean = boolean,\n>(\n  opts?: UseLoaderDepsBaseOptions<TRouter, TId, TSelected, TStructuralSharing> &\n    StructuralSharingOption<TRouter, TSelected, false>,\n) => UseLoaderDepsResult<TRouter, TId, TSelected>\n\n/**\n * Read and select the current route's loader dependencies object.\n *\n * Options:\n * - `from`: Choose which route's loader deps to read\n * - `select`: Map the deps to a derived value\n * - `structuralSharing`: Enable structural sharing for stable references\n *\n * @returns The loader deps (or selected value) for the matched route.\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useLoaderDepsHook\n */\n/**\n * Read and select the current route's loader dependencies object.\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useLoaderDepsHook\n */\nexport function useLoaderDeps<\n  TRouter extends AnyRouter = RegisteredRouter,\n  const TFrom extends string | undefined = undefined,\n  TSelected = unknown,\n  TStructuralSharing extends boolean = boolean,\n>(\n  opts: UseLoaderDepsOptions<TRouter, TFrom, TSelected, TStructuralSharing>,\n): UseLoaderDepsResult<TRouter, TFrom, TSelected> {\n  const { select, ...rest } = opts\n  return useMatch({\n    ...rest,\n    select: (s) => {\n      return select ? select(s.loaderDeps) : s.loaderDeps\n    },\n  }) as UseLoaderDepsResult<TRouter, TFrom, TSelected>\n}\n", "import { useMatch } from './useMatch'\nimport type {\n  StructuralSharingOption,\n  ValidateSelected,\n} from './structuralSharing'\nimport type {\n  AnyRouter,\n  RegisteredRouter,\n  ResolveUseParams,\n  StrictOrFrom,\n  ThrowConstraint,\n  ThrowOrOptional,\n  UseParamsResult,\n} from '@tanstack/router-core'\n\nexport interface UseParamsBaseOptions<\n  TRouter extends AnyRouter,\n  TFrom,\n  TStrict extends boolean,\n  TThrow extends boolean,\n  TSelected,\n  TStructuralSharing,\n> {\n  select?: (\n    params: ResolveUseParams<TRouter, TFrom, TStrict>,\n  ) => ValidateSelected<TRouter, TSelected, TStructuralSharing>\n  shouldThrow?: TThrow\n}\n\nexport type UseParamsOptions<\n  TRouter extends AnyRouter,\n  TFrom extends string | undefined,\n  TStrict extends boolean,\n  TThrow extends boolean,\n  TSelected,\n  TStructuralSharing,\n> = StrictOrFrom<TRouter, TFrom, TStrict> &\n  UseParamsBaseOptions<\n    TRouter,\n    TFrom,\n    TStrict,\n    TThrow,\n    TSelected,\n    TStructuralSharing\n  > &\n  StructuralSharingOption<TRouter, TSelected, TStructuralSharing>\n\nexport type UseParamsRoute<out TFrom> = <\n  TRouter extends AnyRouter = RegisteredRouter,\n  TSelected = unknown,\n  TStructuralSharing extends boolean = boolean,\n>(\n  opts?: UseParamsBaseOptions<\n    TRouter,\n    TFrom,\n    /* TStrict */ true,\n    /* TThrow */ true,\n    TSelected,\n    TStructuralSharing\n  > &\n    StructuralSharingOption<TRouter, TSelected, TStructuralSharing>,\n) => UseParamsResult<TRouter, TFrom, true, TSelected>\n\n/**\n * Access the current route's path parameters with type-safety.\n *\n * Options:\n * - `from`/`strict`: Specify the matched route and whether to enforce strict typing\n * - `select`: Project the params object to a derived value for memoized renders\n * - `structuralSharing`: Enable structural sharing for stable references\n * - `shouldThrow`: Throw if the route is not found in strict contexts\n *\n * @returns The params object (or selected value) for the matched route.\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useParamsHook\n */\n/**\n * Access the current route's path parameters with type-safety.\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useParamsHook\n */\nexport function useParams<\n  TRouter extends AnyRouter = RegisteredRouter,\n  const TFrom extends string | undefined = undefined,\n  TStrict extends boolean = true,\n  TThrow extends boolean = true,\n  TSelected = unknown,\n  TStructuralSharing extends boolean = boolean,\n>(\n  opts: UseParamsOptions<\n    TRouter,\n    TFrom,\n    TStrict,\n    ThrowConstraint<TStrict, TThrow>,\n    TSelected,\n    TStructuralSharing\n  >,\n): ThrowOrOptional<\n  UseParamsResult<TRouter, TFrom, TStrict, TSelected>,\n  TThrow\n> {\n  return useMatch({\n    from: opts.from!,\n    shouldThrow: opts.shouldThrow,\n    structuralSharing: opts.structuralSharing,\n    strict: opts.strict,\n    select: (match) => {\n      const params = opts.strict === false ? match.params : match._strictParams\n\n      return opts.select ? opts.select(params) : params\n    },\n  }) as any\n}\n", "import { useMatch } from './useMatch'\nimport type {\n  StructuralSharingOption,\n  ValidateSelected,\n} from './structuralSharing'\nimport type {\n  AnyRouter,\n  RegisteredRouter,\n  ResolveUseSearch,\n  StrictOrFrom,\n  ThrowConstraint,\n  ThrowOrOptional,\n  UseSearchResult,\n} from '@tanstack/router-core'\n\nexport interface UseSearchBaseOptions<\n  TRouter extends AnyRouter,\n  TFrom,\n  TStrict extends boolean,\n  TThrow extends boolean,\n  TSelected,\n  TStructuralSharing,\n> {\n  select?: (\n    state: ResolveUseSearch<TRouter, TFrom, TStrict>,\n  ) => ValidateSelected<TRouter, TSelected, TStructuralSharing>\n  shouldThrow?: TThrow\n}\n\nexport type UseSearchOptions<\n  TRouter extends AnyRouter,\n  TFrom,\n  TStrict extends boolean,\n  TThrow extends boolean,\n  TSelected,\n  TStructuralSharing,\n> = StrictOrFrom<TRouter, TFrom, TStrict> &\n  UseSearchBaseOptions<\n    TRouter,\n    TFrom,\n    TStrict,\n    TThrow,\n    TSelected,\n    TStructuralSharing\n  > &\n  StructuralSharingOption<TRouter, TSelected, TStructuralSharing>\n\nexport type UseSearchRoute<out TFrom> = <\n  TRouter extends AnyRouter = RegisteredRouter,\n  TSelected = unknown,\n  TStructuralSharing extends boolean = boolean,\n>(\n  opts?: UseSearchBaseOptions<\n    TRouter,\n    TFrom,\n    /* TStrict */ true,\n    /* TThrow */ true,\n    TSelected,\n    TStructuralSharing\n  > &\n    StructuralSharingOption<TRouter, TSelected, TStructuralSharing>,\n) => UseSearchResult<TRouter, TFrom, true, TSelected>\n\n/**\n * Read and select the current route's search parameters with type-safety.\n *\n * Options:\n * - `from`/`strict`: Control which route's search is read and how strictly it's typed\n * - `select`: Map the search object to a derived value for render optimization\n * - `structuralSharing`: Enable structural sharing for stable references\n * - `shouldThrow`: Throw when the route is not found (strict contexts)\n *\n * @returns The search object (or selected value) for the matched route.\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useSearchHook\n */\n/**\n * Read and select the current route's search parameters with type-safety.\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useSearchHook\n */\nexport function useSearch<\n  TRouter extends AnyRouter = RegisteredRouter,\n  const TFrom extends string | undefined = undefined,\n  TStrict extends boolean = true,\n  TThrow extends boolean = true,\n  TSelected = unknown,\n  TStructuralSharing extends boolean = boolean,\n>(\n  opts: UseSearchOptions<\n    TRouter,\n    TFrom,\n    TStrict,\n    ThrowConstraint<TStrict, TThrow>,\n    TSelected,\n    TStructuralSharing\n  >,\n): ThrowOrOptional<\n  UseSearchResult<TRouter, TFrom, TStrict, TSelected>,\n  TThrow\n> {\n  return useMatch({\n    from: opts.from!,\n    strict: opts.strict,\n    shouldThrow: opts.shouldThrow,\n    structuralSharing: opts.structuralSharing,\n    select: (match: any) => {\n      return opts.select ? opts.select(match.search) : match.search\n    },\n  }) as any\n}\n", "import * as React from 'react'\nimport { useRouter } from './useRouter'\nimport type {\n  AnyRouter,\n  FromPathOption,\n  NavigateOptions,\n  RegisteredRouter,\n  UseNavigateResult,\n} from '@tanstack/router-core'\n\n/**\n * Imperative navigation hook.\n *\n * Returns a stable `navigate(options)` function to change the current location\n * programmatically. Prefer the `Link` component for user-initiated navigation,\n * and use this hook from effects, callbacks, or handlers where imperative\n * navigation is required.\n *\n * Options:\n * - `from`: Optional route base used to resolve relative `to` paths.\n *\n * @returns A function that accepts `NavigateOptions`.\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useNavigateHook\n */\nexport function useNavigate<\n  TRouter extends AnyRouter = RegisteredRouter,\n  TDefaultFrom extends string = string,\n>(_defaultOpts?: {\n  from?: FromPathOption<TRouter, TDefaultFrom>\n}): UseNavigateResult<TDefaultFrom> {\n  const router = useRouter()\n\n  return React.useCallback(\n    (options: NavigateOptions) => {\n      return router.navigate({\n        ...options,\n        from: options.from ?? _defaultOpts?.from,\n      })\n    },\n    [_defaultOpts?.from, router],\n  ) as UseNavigateResult<TDefaultFrom>\n}\n\n/**\n * Component that triggers a navigation when rendered. Navigation executes\n * in an effect after mount/update.\n *\n * Props are the same as `NavigateOptions` used by `navigate()`.\n *\n * @returns null\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/navigateComponent\n */\nexport function Navigate<\n  TRouter extends AnyRouter = RegisteredRouter,\n  const TFrom extends string = string,\n  const TTo extends string | undefined = undefined,\n  const TMaskFrom extends string = TFrom,\n  const TMaskTo extends string = '',\n>(props: NavigateOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>): null {\n  const router = useRouter()\n  const navigate = useNavigate()\n\n  const previousPropsRef = React.useRef<NavigateOptions<\n    TRouter,\n    TFrom,\n    TTo,\n    TMaskFrom,\n    TMaskTo\n  > | null>(null)\n  React.useEffect(() => {\n    if (previousPropsRef.current !== props) {\n      navigate(props)\n      previousPropsRef.current = props\n    }\n  }, [router, props, navigate])\n  return null\n}\n", "import * as React from 'react'\n\nexport function useStableCallback<T extends (...args: Array<any>) => any>(\n  fn: T,\n): T {\n  const fnRef = React.useRef(fn)\n  fnRef.current = fn\n\n  const ref = React.useRef((...args: Array<any>) => fnRef.current(...args))\n  return ref.current as T\n}\n\nexport const useLayoutEffect =\n  typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect\n\n/**\n * Taken from https://www.developerway.com/posts/implementing-advanced-use-previous-hook#part3\n */\nexport function usePrevious<T>(value: T): T | null {\n  // initialise the ref with previous and current values\n  const ref = React.useRef<{ value: T; prev: T | null }>({\n    value: value,\n    prev: null,\n  })\n\n  const current = ref.current.value\n\n  // if the value passed into hook doesn't match what we store as \"current\"\n  // move the \"current\" to the \"previous\"\n  // and store the passed value as \"current\"\n  if (value !== current) {\n    ref.current = {\n      value: value,\n      prev: current,\n    }\n  }\n\n  // return the previous value only\n  return ref.current.prev\n}\n\n/**\n * React hook to wrap `IntersectionObserver`.\n *\n * This hook will create an `IntersectionObserver` and observe the ref passed to it.\n *\n * When the intersection changes, the callback will be called with the `IntersectionObserverEntry`.\n *\n * @param ref - The ref to observe\n * @param intersectionObserverOptions - The options to pass to the IntersectionObserver\n * @param options - The options to pass to the hook\n * @param callback - The callback to call when the intersection changes\n * @returns The IntersectionObserver instance\n * @example\n * ```tsx\n * const MyComponent = () => {\n * const ref = React.useRef<HTMLDivElement>(null)\n * useIntersectionObserver(\n *  ref,\n *  (entry) => { doSomething(entry) },\n *  { rootMargin: '10px' },\n *  { disabled: false }\n * )\n * return <div ref={ref} />\n * ```\n */\nexport function useIntersectionObserver<T extends Element>(\n  ref: React.RefObject<T | null>,\n  callback: (entry: IntersectionObserverEntry | undefined) => void,\n  intersectionObserverOptions: IntersectionObserverInit = {},\n  options: { disabled?: boolean } = {},\n) {\n  React.useEffect(() => {\n    if (\n      !ref.current ||\n      options.disabled ||\n      typeof IntersectionObserver !== 'function'\n    ) {\n      return\n    }\n\n    const observer = new IntersectionObserver(([entry]) => {\n      callback(entry)\n    }, intersectionObserverOptions)\n\n    observer.observe(ref.current)\n\n    return () => {\n      observer.disconnect()\n    }\n  }, [callback, intersectionObserverOptions, options.disabled, ref])\n}\n\n/**\n * React hook to take a `React.ForwardedRef` and returns a `ref` that can be used on a DOM element.\n *\n * @param ref - The forwarded ref\n * @returns The inner ref returned by `useRef`\n * @example\n * ```tsx\n * const MyComponent = React.forwardRef((props, ref) => {\n *  const innerRef = useForwardedRef(ref)\n *  return <div ref={innerRef} />\n * })\n * ```\n */\nexport function useForwardedRef<T>(ref?: React.ForwardedRef<T>) {\n  const innerRef = React.useRef<T>(null)\n  React.useImperativeHandle(ref, () => innerRef.current!, [])\n  return innerRef\n}\n", "import * as React from 'react'\nimport { flushSync } from 'react-dom'\nimport {\n  deepEqual,\n  exactPathTest,\n  functionalUpdate,\n  preloadWarning,\n  removeTrailingSlash,\n} from '@tanstack/router-core'\nimport { useRouterState } from './useRouterState'\nimport { useRouter } from './useRouter'\n\nimport { useForwardedRef, useIntersectionObserver } from './utils'\n\nimport type {\n  AnyRouter,\n  Constrain,\n  LinkOptions,\n  RegisteredRouter,\n  RoutePaths,\n} from '@tanstack/router-core'\nimport type { ReactNode } from 'react'\nimport type {\n  ValidateLinkOptions,\n  ValidateLinkOptionsArray,\n} from './typePrimitives'\n\n/**\n * Build anchor-like props for declarative navigation and preloading.\n *\n * Returns stable `href`, event handlers and accessibility props derived from\n * router options and active state. Used internally by `Link` and custom links.\n *\n * Options cover `to`, `params`, `search`, `hash`, `state`, `preload`,\n * `activeProps`, `inactiveProps`, and more.\n *\n * @returns React anchor props suitable for `<a>` or custom components.\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useLinkPropsHook\n */\nexport function useLinkProps<\n  TRouter extends AnyRouter = RegisteredRouter,\n  const TFrom extends string = string,\n  const TTo extends string | undefined = undefined,\n  const TMaskFrom extends string = TFrom,\n  const TMaskTo extends string = '',\n>(\n  options: UseLinkPropsOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>,\n  forwardedRef?: React.ForwardedRef<Element>,\n): React.ComponentPropsWithRef<'a'> {\n  const router = useRouter()\n  const [isTransitioning, setIsTransitioning] = React.useState(false)\n  const hasRenderFetched = React.useRef(false)\n  const innerRef = useForwardedRef(forwardedRef)\n\n  const {\n    // custom props\n    activeProps,\n    inactiveProps,\n    activeOptions,\n    to,\n    preload: userPreload,\n    preloadDelay: userPreloadDelay,\n    hashScrollIntoView,\n    replace,\n    startTransition,\n    resetScroll,\n    viewTransition,\n    // element props\n    children,\n    target,\n    disabled,\n    style,\n    className,\n    onClick,\n    onFocus,\n    onMouseEnter,\n    onMouseLeave,\n    onTouchStart,\n    ignoreBlocker,\n    // prevent these from being returned\n    params: _params,\n    search: _search,\n    hash: _hash,\n    state: _state,\n    mask: _mask,\n    reloadDocument: _reloadDocument,\n    unsafeRelative: _unsafeRelative,\n    from: _from,\n    _fromLocation,\n    ...propsSafeToSpread\n  } = options\n\n  // subscribe to search params to re-build location if it changes\n  const currentSearch = useRouterState({\n    select: (s) => s.location.search,\n    structuralSharing: true as any,\n  })\n\n  const from = options.from\n\n  const _options = React.useMemo(\n    () => {\n      return { ...options, from }\n    },\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n    [\n      router,\n      currentSearch,\n      from,\n      options._fromLocation,\n      options.hash,\n      options.to,\n      options.search,\n      options.params,\n      options.state,\n      options.mask,\n      options.unsafeRelative,\n    ],\n  )\n\n  const next = React.useMemo(\n    () => router.buildLocation({ ..._options } as any),\n    [router, _options],\n  )\n\n  const hrefOption = React.useMemo(() => {\n    if (disabled) {\n      return undefined\n    }\n    let href = next.maskedLocation ? next.maskedLocation.url : next.url\n\n    let external = false\n    if (router.origin) {\n      if (href.startsWith(router.origin)) {\n        href = router.history.createHref(href.replace(router.origin, '')) || '/'\n      } else {\n        external = true\n      }\n    }\n    return { href, external }\n  }, [disabled, next.maskedLocation, next.url, router.origin, router.history])\n\n  const externalLink = React.useMemo(() => {\n    if (hrefOption?.external) {\n      return hrefOption.href\n    }\n    try {\n      new URL(to as any)\n      return to\n    } catch {}\n    return undefined\n  }, [to, hrefOption])\n\n  const preload =\n    options.reloadDocument || externalLink\n      ? false\n      : (userPreload ?? router.options.defaultPreload)\n  const preloadDelay =\n    userPreloadDelay ?? router.options.defaultPreloadDelay ?? 0\n\n  const isActive = useRouterState({\n    select: (s) => {\n      if (externalLink) return false\n      if (activeOptions?.exact) {\n        const testExact = exactPathTest(\n          s.location.pathname,\n          next.pathname,\n          router.basepath,\n        )\n        if (!testExact) {\n          return false\n        }\n      } else {\n        const currentPathSplit = removeTrailingSlash(\n          s.location.pathname,\n          router.basepath,\n        )\n        const nextPathSplit = removeTrailingSlash(\n          next.pathname,\n          router.basepath,\n        )\n\n        const pathIsFuzzyEqual =\n          currentPathSplit.startsWith(nextPathSplit) &&\n          (currentPathSplit.length === nextPathSplit.length ||\n            currentPathSplit[nextPathSplit.length] === '/')\n\n        if (!pathIsFuzzyEqual) {\n          return false\n        }\n      }\n\n      if (activeOptions?.includeSearch ?? true) {\n        const searchTest = deepEqual(s.location.search, next.search, {\n          partial: !activeOptions?.exact,\n          ignoreUndefined: !activeOptions?.explicitUndefined,\n        })\n        if (!searchTest) {\n          return false\n        }\n      }\n\n      if (activeOptions?.includeHash) {\n        return s.location.hash === next.hash\n      }\n      return true\n    },\n  })\n\n  const doPreload = React.useCallback(() => {\n    router.preloadRoute({ ..._options } as any).catch((err) => {\n      console.warn(err)\n      console.warn(preloadWarning)\n    })\n  }, [router, _options])\n\n  const preloadViewportIoCallback = React.useCallback(\n    (entry: IntersectionObserverEntry | undefined) => {\n      if (entry?.isIntersecting) {\n        doPreload()\n      }\n    },\n    [doPreload],\n  )\n\n  useIntersectionObserver(\n    innerRef,\n    preloadViewportIoCallback,\n    intersectionObserverOptions,\n    { disabled: !!disabled || !(preload === 'viewport') },\n  )\n\n  React.useEffect(() => {\n    if (hasRenderFetched.current) {\n      return\n    }\n    if (!disabled && preload === 'render') {\n      doPreload()\n      hasRenderFetched.current = true\n    }\n  }, [disabled, doPreload, preload])\n\n  // The click handler\n  const handleClick = (e: React.MouseEvent) => {\n    // Check actual element's target attribute as fallback\n    const elementTarget = (\n      e.currentTarget as HTMLAnchorElement | SVGAElement\n    ).getAttribute('target')\n    const effectiveTarget = target !== undefined ? target : elementTarget\n\n    if (\n      !disabled &&\n      !isCtrlEvent(e) &&\n      !e.defaultPrevented &&\n      (!effectiveTarget || effectiveTarget === '_self') &&\n      e.button === 0\n    ) {\n      e.preventDefault()\n\n      flushSync(() => {\n        setIsTransitioning(true)\n      })\n\n      const unsub = router.subscribe('onResolved', () => {\n        unsub()\n        setIsTransitioning(false)\n      })\n\n      // All is well? Navigate!\n      // N.B. we don't call `router.commitLocation(next) here because we want to run `validateSearch` before committing\n      router.navigate({\n        ..._options,\n        replace,\n        resetScroll,\n        hashScrollIntoView,\n        startTransition,\n        viewTransition,\n        ignoreBlocker,\n      })\n    }\n  }\n\n  if (externalLink) {\n    return {\n      ...propsSafeToSpread,\n      ref: innerRef as React.ComponentPropsWithRef<'a'>['ref'],\n      href: externalLink,\n      ...(children && { children }),\n      ...(target && { target }),\n      ...(disabled && { disabled }),\n      ...(style && { style }),\n      ...(className && { className }),\n      ...(onClick && { onClick }),\n      ...(onFocus && { onFocus }),\n      ...(onMouseEnter && { onMouseEnter }),\n      ...(onMouseLeave && { onMouseLeave }),\n      ...(onTouchStart && { onTouchStart }),\n    }\n  }\n\n  // The click handler\n  const handleFocus = (_: React.MouseEvent) => {\n    if (disabled) return\n    if (preload) {\n      doPreload()\n    }\n  }\n\n  const handleTouchStart = handleFocus\n\n  const handleEnter = (e: React.MouseEvent) => {\n    if (disabled || !preload) return\n\n    if (!preloadDelay) {\n      doPreload()\n    } else {\n      const eventTarget = e.target\n      if (timeoutMap.has(eventTarget)) {\n        return\n      }\n      const id = setTimeout(() => {\n        timeoutMap.delete(eventTarget)\n        doPreload()\n      }, preloadDelay)\n      timeoutMap.set(eventTarget, id)\n    }\n  }\n\n  const handleLeave = (e: React.MouseEvent) => {\n    if (disabled || !preload || !preloadDelay) return\n    const eventTarget = e.target\n    const id = timeoutMap.get(eventTarget)\n    if (id) {\n      clearTimeout(id)\n      timeoutMap.delete(eventTarget)\n    }\n  }\n\n  // Get the active props\n  const resolvedActiveProps: React.HTMLAttributes<HTMLAnchorElement> = isActive\n    ? (functionalUpdate(activeProps as any, {}) ?? STATIC_ACTIVE_OBJECT)\n    : STATIC_EMPTY_OBJECT\n\n  // Get the inactive props\n  const resolvedInactiveProps: React.HTMLAttributes<HTMLAnchorElement> =\n    isActive\n      ? STATIC_EMPTY_OBJECT\n      : (functionalUpdate(inactiveProps, {}) ?? STATIC_EMPTY_OBJECT)\n\n  const resolvedClassName = [\n    className,\n    resolvedActiveProps.className,\n    resolvedInactiveProps.className,\n  ]\n    .filter(Boolean)\n    .join(' ')\n\n  const resolvedStyle = (style ||\n    resolvedActiveProps.style ||\n    resolvedInactiveProps.style) && {\n    ...style,\n    ...resolvedActiveProps.style,\n    ...resolvedInactiveProps.style,\n  }\n\n  return {\n    ...propsSafeToSpread,\n    ...resolvedActiveProps,\n    ...resolvedInactiveProps,\n    href: hrefOption?.href,\n    ref: innerRef as React.ComponentPropsWithRef<'a'>['ref'],\n    onClick: composeHandlers([onClick, handleClick]),\n    onFocus: composeHandlers([onFocus, handleFocus]),\n    onMouseEnter: composeHandlers([onMouseEnter, handleEnter]),\n    onMouseLeave: composeHandlers([onMouseLeave, handleLeave]),\n    onTouchStart: composeHandlers([onTouchStart, handleTouchStart]),\n    disabled: !!disabled,\n    target,\n    ...(resolvedStyle && { style: resolvedStyle }),\n    ...(resolvedClassName && { className: resolvedClassName }),\n    ...(disabled && STATIC_DISABLED_PROPS),\n    ...(isActive && STATIC_ACTIVE_PROPS),\n    ...(isTransitioning && STATIC_TRANSITIONING_PROPS),\n  }\n}\n\nconst STATIC_EMPTY_OBJECT = {}\nconst STATIC_ACTIVE_OBJECT = { className: 'active' }\nconst STATIC_DISABLED_PROPS = { role: 'link', 'aria-disabled': true }\nconst STATIC_ACTIVE_PROPS = { 'data-status': 'active', 'aria-current': 'page' }\nconst STATIC_TRANSITIONING_PROPS = { 'data-transitioning': 'transitioning' }\n\nconst timeoutMap = new WeakMap<EventTarget, ReturnType<typeof setTimeout>>()\n\nconst intersectionObserverOptions: IntersectionObserverInit = {\n  rootMargin: '100px',\n}\n\nconst composeHandlers =\n  (handlers: Array<undefined | React.EventHandler<any>>) =>\n  (e: React.SyntheticEvent) => {\n    for (const handler of handlers) {\n      if (!handler) continue\n      if (e.defaultPrevented) return\n      handler(e)\n    }\n  }\n\ntype UseLinkReactProps<TComp> = TComp extends keyof React.JSX.IntrinsicElements\n  ? React.JSX.IntrinsicElements[TComp]\n  : TComp extends React.ComponentType<any>\n    ? React.ComponentPropsWithoutRef<TComp> &\n        React.RefAttributes<React.ComponentRef<TComp>>\n    : never\n\nexport type UseLinkPropsOptions<\n  TRouter extends AnyRouter = RegisteredRouter,\n  TFrom extends RoutePaths<TRouter['routeTree']> | string = string,\n  TTo extends string | undefined = '.',\n  TMaskFrom extends RoutePaths<TRouter['routeTree']> | string = TFrom,\n  TMaskTo extends string = '.',\n> = ActiveLinkOptions<'a', TRouter, TFrom, TTo, TMaskFrom, TMaskTo> &\n  UseLinkReactProps<'a'>\n\nexport type ActiveLinkOptions<\n  TComp = 'a',\n  TRouter extends AnyRouter = RegisteredRouter,\n  TFrom extends string = string,\n  TTo extends string | undefined = '.',\n  TMaskFrom extends string = TFrom,\n  TMaskTo extends string = '.',\n> = LinkOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo> &\n  ActiveLinkOptionProps<TComp>\n\ntype ActiveLinkProps<TComp> = Partial<\n  LinkComponentReactProps<TComp> & {\n    [key: `data-${string}`]: unknown\n  }\n>\n\nexport interface ActiveLinkOptionProps<TComp = 'a'> {\n  /**\n   * A function that returns additional props for the `active` state of this link.\n   * These props override other props passed to the link (`style`'s are merged, `className`'s are concatenated)\n   */\n  activeProps?: ActiveLinkProps<TComp> | (() => ActiveLinkProps<TComp>)\n  /**\n   * A function that returns additional props for the `inactive` state of this link.\n   * These props override other props passed to the link (`style`'s are merged, `className`'s are concatenated)\n   */\n  inactiveProps?: ActiveLinkProps<TComp> | (() => ActiveLinkProps<TComp>)\n}\n\nexport type LinkProps<\n  TComp = 'a',\n  TRouter extends AnyRouter = RegisteredRouter,\n  TFrom extends string = string,\n  TTo extends string | undefined = '.',\n  TMaskFrom extends string = TFrom,\n  TMaskTo extends string = '.',\n> = ActiveLinkOptions<TComp, TRouter, TFrom, TTo, TMaskFrom, TMaskTo> &\n  LinkPropsChildren\n\nexport interface LinkPropsChildren {\n  // If a function is passed as a child, it will be given the `isActive` boolean to aid in further styling on the element it returns\n  children?:\n    | React.ReactNode\n    | ((state: {\n        isActive: boolean\n        isTransitioning: boolean\n      }) => React.ReactNode)\n}\n\ntype LinkComponentReactProps<TComp> = Omit<\n  UseLinkReactProps<TComp>,\n  keyof CreateLinkProps\n>\n\nexport type LinkComponentProps<\n  TComp = 'a',\n  TRouter extends AnyRouter = RegisteredRouter,\n  TFrom extends string = string,\n  TTo extends string | undefined = '.',\n  TMaskFrom extends string = TFrom,\n  TMaskTo extends string = '.',\n> = LinkComponentReactProps<TComp> &\n  LinkProps<TComp, TRouter, TFrom, TTo, TMaskFrom, TMaskTo>\n\nexport type CreateLinkProps = LinkProps<\n  any,\n  any,\n  string,\n  string,\n  string,\n  string\n>\n\nexport type LinkComponent<\n  in out TComp,\n  in out TDefaultFrom extends string = string,\n> = <\n  TRouter extends AnyRouter = RegisteredRouter,\n  const TFrom extends string = TDefaultFrom,\n  const TTo extends string | undefined = undefined,\n  const TMaskFrom extends string = TFrom,\n  const TMaskTo extends string = '',\n>(\n  props: LinkComponentProps<TComp, TRouter, TFrom, TTo, TMaskFrom, TMaskTo>,\n) => React.ReactElement\n\nexport interface LinkComponentRoute<\n  in out TDefaultFrom extends string = string,\n> {\n  defaultFrom: TDefaultFrom\n  <\n    TRouter extends AnyRouter = RegisteredRouter,\n    const TTo extends string | undefined = undefined,\n    const TMaskTo extends string = '',\n  >(\n    props: LinkComponentProps<\n      'a',\n      TRouter,\n      this['defaultFrom'],\n      TTo,\n      this['defaultFrom'],\n      TMaskTo\n    >,\n  ): React.ReactElement\n}\n\n/**\n * Creates a typed Link-like component that preserves TanStack Router's\n * navigation semantics and type-safety while delegating rendering to the\n * provided host component.\n *\n * Useful for integrating design system anchors/buttons while keeping\n * router-aware props (eg. `to`, `params`, `search`, `preload`).\n *\n * @param Comp The host component to render (eg. a design-system Link/Button)\n * @returns A router-aware component with the same API as `Link`.\n * @link https://tanstack.com/router/latest/docs/framework/react/guide/custom-link\n */\nexport function createLink<const TComp>(\n  Comp: Constrain<TComp, any, (props: CreateLinkProps) => ReactNode>,\n): LinkComponent<TComp> {\n  return React.forwardRef(function CreatedLink(props, ref) {\n    return <Link {...(props as any)} _asChild={Comp} ref={ref} />\n  }) as any\n}\n\n/**\n * A strongly-typed anchor component for declarative navigation.\n * Handles path, search, hash and state updates with optional route preloading\n * and active-state styling.\n *\n * Props:\n * - `preload`: Controls route preloading (eg. 'intent', 'render', 'viewport', true/false)\n * - `preloadDelay`: Delay in ms before preloading on hover\n * - `activeProps`/`inactiveProps`: Additional props merged when link is active/inactive\n * - `resetScroll`/`hashScrollIntoView`: Control scroll behavior on navigation\n * - `viewTransition`/`startTransition`: Use View Transitions/React transitions for navigation\n * - `ignoreBlocker`: Bypass registered blockers\n *\n * @returns An anchor-like element that navigates without full page reloads.\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/linkComponent\n */\nexport const Link: LinkComponent<'a'> = React.forwardRef<Element, any>(\n  (props, ref) => {\n    const { _asChild, ...rest } = props\n    const {\n      type: _type,\n      ref: innerRef,\n      ...linkProps\n    } = useLinkProps(rest as any, ref)\n\n    const children =\n      typeof rest.children === 'function'\n        ? rest.children({\n            isActive: (linkProps as any)['data-status'] === 'active',\n          })\n        : rest.children\n\n    if (_asChild === undefined) {\n      // the ReturnType of useLinkProps returns the correct type for a <a> element, not a general component that has a disabled prop\n      // @ts-expect-error\n      delete linkProps.disabled\n    }\n\n    return React.createElement(\n      _asChild ? _asChild : 'a',\n      {\n        ...linkProps,\n        ref: innerRef,\n      },\n      children,\n    )\n  },\n) as any\n\nfunction isCtrlEvent(e: React.MouseEvent) {\n  return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey)\n}\n\nexport type LinkOptionsFnOptions<\n  TOptions,\n  TComp,\n  TRouter extends AnyRouter = RegisteredRouter,\n> =\n  TOptions extends ReadonlyArray<any>\n    ? ValidateLinkOptionsArray<TRouter, TOptions, string, TComp>\n    : ValidateLinkOptions<TRouter, TOptions, string, TComp>\n\nexport type LinkOptionsFn<TComp> = <\n  const TOptions,\n  TRouter extends AnyRouter = RegisteredRouter,\n>(\n  options: LinkOptionsFnOptions<TOptions, TComp, TRouter>,\n) => TOptions\n\n/**\n * Validate and reuse navigation options for `Link`, `navigate` or `redirect`.\n * Accepts a literal options object and returns it typed for later spreading.\n * @example\n * const opts = linkOptions({ to: '/dashboard', search: { tab: 'home' } })\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/linkOptions\n */\nexport const linkOptions: LinkOptionsFn<'a'> = (options) => {\n  return options as any\n}\n\n/**\n * Type-check a literal object for use with `Link`, `navigate` or `redirect`.\n * Use to validate and reuse navigation options across your app.\n * @example\n * const opts = linkOptions({ to: '/dashboard', search: { tab: 'home' } })\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/linkOptions\n */\n", "import {\n  BaseRootRoute,\n  BaseRoute,\n  BaseRouteApi,\n  notFound,\n} from '@tanstack/router-core'\nimport React from 'react'\nimport { useLoaderData } from './useLoaderData'\nimport { useLoaderDeps } from './useLoaderDeps'\nimport { useParams } from './useParams'\nimport { useSearch } from './useSearch'\nimport { useNavigate } from './useNavigate'\nimport { useMatch } from './useMatch'\nimport { useRouter } from './useRouter'\nimport { Link } from './link'\nimport type {\n  AnyContext,\n  AnyRoute,\n  AnyRouter,\n  ConstrainLiteral,\n  ErrorComponentProps,\n  NotFoundError,\n  NotFoundRouteProps,\n  Register,\n  RegisteredRouter,\n  ResolveFullPath,\n  ResolveId,\n  ResolveParams,\n  RootRoute as RootRouteCore,\n  RootRouteId,\n  RootRouteOptions,\n  RouteConstraints,\n  Route as RouteCore,\n  RouteIds,\n  RouteMask,\n  RouteOptions,\n  RouteTypesById,\n  RouterCore,\n  ToMaskOptions,\n  UseNavigateResult,\n} from '@tanstack/router-core'\nimport type { UseLoaderDataRoute } from './useLoaderData'\nimport type { UseMatchRoute } from './useMatch'\nimport type { UseLoaderDepsRoute } from './useLoaderDeps'\nimport type { UseParamsRoute } from './useParams'\nimport type { UseSearchRoute } from './useSearch'\nimport type { UseRouteContextRoute } from './useRouteContext'\nimport type { LinkComponentRoute } from './link'\n\ndeclare module '@tanstack/router-core' {\n  export interface UpdatableRouteOptionsExtensions {\n    component?: RouteComponent\n    errorComponent?: false | null | undefined | ErrorRouteComponent\n    notFoundComponent?: NotFoundRouteComponent\n    pendingComponent?: RouteComponent\n  }\n\n  export interface RootRouteOptionsExtensions {\n    shellComponent?: ({\n      children,\n    }: {\n      children: React.ReactNode\n    }) => React.ReactNode\n  }\n\n  export interface RouteExtensions<\n    in out TId extends string,\n    in out TFullPath extends string,\n  > {\n    useMatch: UseMatchRoute<TId>\n    useRouteContext: UseRouteContextRoute<TId>\n    useSearch: UseSearchRoute<TId>\n    useParams: UseParamsRoute<TId>\n    useLoaderDeps: UseLoaderDepsRoute<TId>\n    useLoaderData: UseLoaderDataRoute<TId>\n    useNavigate: () => UseNavigateResult<TFullPath>\n    Link: LinkComponentRoute<TFullPath>\n  }\n}\n\n/**\n * Returns a route-specific API that exposes type-safe hooks pre-bound\n * to a single route ID. Useful for consuming a route's APIs from files\n * where the route object isn't directly imported (e.g. code-split files).\n *\n * @param id Route ID string literal for the target route.\n * @returns A `RouteApi` instance bound to the given route ID.\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/getRouteApiFunction\n */\nexport function getRouteApi<\n  const TId,\n  TRouter extends AnyRouter = RegisteredRouter,\n>(id: ConstrainLiteral<TId, RouteIds<TRouter['routeTree']>>) {\n  return new RouteApi<TId, TRouter>({ id })\n}\n\nexport class RouteApi<\n  TId,\n  TRouter extends AnyRouter = RegisteredRouter,\n> extends BaseRouteApi<TId, TRouter> {\n  /**\n   * @deprecated Use the `getRouteApi` function instead.\n   */\n  constructor({ id }: { id: TId }) {\n    super({ id })\n  }\n\n  useMatch: UseMatchRoute<TId> = (opts) => {\n    return useMatch({\n      select: opts?.select,\n      from: this.id,\n      structuralSharing: opts?.structuralSharing,\n    } as any) as any\n  }\n\n  useRouteContext: UseRouteContextRoute<TId> = (opts) => {\n    return useMatch({\n      from: this.id as any,\n      select: (d) => (opts?.select ? opts.select(d.context) : d.context),\n    }) as any\n  }\n\n  useSearch: UseSearchRoute<TId> = (opts) => {\n    // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n    return useSearch({\n      select: opts?.select,\n      structuralSharing: opts?.structuralSharing,\n      from: this.id,\n    } as any) as any\n  }\n\n  useParams: UseParamsRoute<TId> = (opts) => {\n    // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n    return useParams({\n      select: opts?.select,\n      structuralSharing: opts?.structuralSharing,\n      from: this.id,\n    } as any) as any\n  }\n\n  useLoaderDeps: UseLoaderDepsRoute<TId> = (opts) => {\n    return useLoaderDeps({ ...opts, from: this.id, strict: false } as any)\n  }\n\n  useLoaderData: UseLoaderDataRoute<TId> = (opts) => {\n    return useLoaderData({ ...opts, from: this.id, strict: false } as any)\n  }\n\n  useNavigate = (): UseNavigateResult<\n    RouteTypesById<TRouter, TId>['fullPath']\n  > => {\n    const router = useRouter()\n    return useNavigate({ from: router.routesById[this.id as string].fullPath })\n  }\n\n  notFound = (opts?: NotFoundError) => {\n    return notFound({ routeId: this.id as string, ...opts })\n  }\n\n  Link: LinkComponentRoute<RouteTypesById<TRouter, TId>['fullPath']> =\n    React.forwardRef((props, ref: React.ForwardedRef<HTMLAnchorElement>) => {\n      const router = useRouter()\n      const fullPath = router.routesById[this.id as string].fullPath\n      return <Link ref={ref} from={fullPath as never} {...props} />\n    }) as unknown as LinkComponentRoute<\n      RouteTypesById<TRouter, TId>['fullPath']\n    >\n}\n\nexport class Route<\n    in out TRegister = unknown,\n    in out TParentRoute extends RouteConstraints['TParentRoute'] = AnyRoute,\n    in out TPath extends RouteConstraints['TPath'] = '/',\n    in out TFullPath extends RouteConstraints['TFullPath'] = ResolveFullPath<\n      TParentRoute,\n      TPath\n    >,\n    in out TCustomId extends RouteConstraints['TCustomId'] = string,\n    in out TId extends RouteConstraints['TId'] = ResolveId<\n      TParentRoute,\n      TCustomId,\n      TPath\n    >,\n    in out TSearchValidator = undefined,\n    in out TParams = ResolveParams<TPath>,\n    in out TRouterContext = AnyContext,\n    in out TRouteContextFn = AnyContext,\n    in out TBeforeLoadFn = AnyContext,\n    in out TLoaderDeps extends Record<string, any> = {},\n    in out TLoaderFn = undefined,\n    in out TChildren = unknown,\n    in out TFileRouteTypes = unknown,\n    in out TSSR = unknown,\n    in out TServerMiddlewares = unknown,\n    in out THandlers = undefined,\n  >\n  extends BaseRoute<\n    TRegister,\n    TParentRoute,\n    TPath,\n    TFullPath,\n    TCustomId,\n    TId,\n    TSearchValidator,\n    TParams,\n    TRouterContext,\n    TRouteContextFn,\n    TBeforeLoadFn,\n    TLoaderDeps,\n    TLoaderFn,\n    TChildren,\n    TFileRouteTypes,\n    TSSR,\n    TServerMiddlewares,\n    THandlers\n  >\n  implements\n    RouteCore<\n      TRegister,\n      TParentRoute,\n      TPath,\n      TFullPath,\n      TCustomId,\n      TId,\n      TSearchValidator,\n      TParams,\n      TRouterContext,\n      TRouteContextFn,\n      TBeforeLoadFn,\n      TLoaderDeps,\n      TLoaderFn,\n      TChildren,\n      TFileRouteTypes,\n      TSSR,\n      TServerMiddlewares,\n      THandlers\n    >\n{\n  /**\n   * @deprecated Use the `createRoute` function instead.\n   */\n  constructor(\n    options?: RouteOptions<\n      TRegister,\n      TParentRoute,\n      TId,\n      TCustomId,\n      TFullPath,\n      TPath,\n      TSearchValidator,\n      TParams,\n      TLoaderDeps,\n      TLoaderFn,\n      TRouterContext,\n      TRouteContextFn,\n      TBeforeLoadFn,\n      TSSR,\n      TServerMiddlewares,\n      THandlers\n    >,\n  ) {\n    super(options)\n    ;(this as any).$$typeof = Symbol.for('react.memo')\n  }\n\n  useMatch: UseMatchRoute<TId> = (opts) => {\n    return useMatch({\n      select: opts?.select,\n      from: this.id,\n      structuralSharing: opts?.structuralSharing,\n    } as any) as any\n  }\n\n  useRouteContext: UseRouteContextRoute<TId> = (opts?) => {\n    return useMatch({\n      ...opts,\n      from: this.id,\n      select: (d) => (opts?.select ? opts.select(d.context) : d.context),\n    }) as any\n  }\n\n  useSearch: UseSearchRoute<TId> = (opts) => {\n    // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n    return useSearch({\n      select: opts?.select,\n      structuralSharing: opts?.structuralSharing,\n      from: this.id,\n    } as any) as any\n  }\n\n  useParams: UseParamsRoute<TId> = (opts) => {\n    // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n    return useParams({\n      select: opts?.select,\n      structuralSharing: opts?.structuralSharing,\n      from: this.id,\n    } as any) as any\n  }\n\n  useLoaderDeps: UseLoaderDepsRoute<TId> = (opts) => {\n    return useLoaderDeps({ ...opts, from: this.id } as any)\n  }\n\n  useLoaderData: UseLoaderDataRoute<TId> = (opts) => {\n    return useLoaderData({ ...opts, from: this.id } as any)\n  }\n\n  useNavigate = (): UseNavigateResult<TFullPath> => {\n    return useNavigate({ from: this.fullPath })\n  }\n\n  Link: LinkComponentRoute<TFullPath> = React.forwardRef(\n    (props, ref: React.ForwardedRef<HTMLAnchorElement>) => {\n      return <Link ref={ref} from={this.fullPath as never} {...props} />\n    },\n  ) as unknown as LinkComponentRoute<TFullPath>\n}\n\n/**\n * Creates a non-root Route instance for code-based routing.\n *\n * Use this to define a route that will be composed into a route tree\n * (typically via a parent route's `addChildren`). If you're using file-based\n * routing, prefer `createFileRoute`.\n *\n * @param options Route options (path, component, loader, context, etc.).\n * @returns A Route instance to be attached to the route tree.\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/createRouteFunction\n */\nexport function createRoute<\n  TRegister = unknown,\n  TParentRoute extends RouteConstraints['TParentRoute'] = AnyRoute,\n  TPath extends RouteConstraints['TPath'] = '/',\n  TFullPath extends RouteConstraints['TFullPath'] = ResolveFullPath<\n    TParentRoute,\n    TPath\n  >,\n  TCustomId extends RouteConstraints['TCustomId'] = string,\n  TId extends RouteConstraints['TId'] = ResolveId<\n    TParentRoute,\n    TCustomId,\n    TPath\n  >,\n  TSearchValidator = undefined,\n  TParams = ResolveParams<TPath>,\n  TRouteContextFn = AnyContext,\n  TBeforeLoadFn = AnyContext,\n  TLoaderDeps extends Record<string, any> = {},\n  TLoaderFn = undefined,\n  TChildren = unknown,\n  TSSR = unknown,\n  const TServerMiddlewares = unknown,\n>(\n  options: RouteOptions<\n    TRegister,\n    TParentRoute,\n    TId,\n    TCustomId,\n    TFullPath,\n    TPath,\n    TSearchValidator,\n    TParams,\n    TLoaderDeps,\n    TLoaderFn,\n    AnyContext,\n    TRouteContextFn,\n    TBeforeLoadFn,\n    TSSR,\n    TServerMiddlewares\n  >,\n): Route<\n  TRegister,\n  TParentRoute,\n  TPath,\n  TFullPath,\n  TCustomId,\n  TId,\n  TSearchValidator,\n  TParams,\n  AnyContext,\n  TRouteContextFn,\n  TBeforeLoadFn,\n  TLoaderDeps,\n  TLoaderFn,\n  TChildren,\n  TSSR,\n  TServerMiddlewares\n> {\n  return new Route<\n    TRegister,\n    TParentRoute,\n    TPath,\n    TFullPath,\n    TCustomId,\n    TId,\n    TSearchValidator,\n    TParams,\n    AnyContext,\n    TRouteContextFn,\n    TBeforeLoadFn,\n    TLoaderDeps,\n    TLoaderFn,\n    TChildren,\n    TSSR,\n    TServerMiddlewares\n  >(\n    // TODO: Help us TypeChris, you're our only hope!\n    options as any,\n  )\n}\n\nexport type AnyRootRoute = RootRoute<\n  any,\n  any,\n  any,\n  any,\n  any,\n  any,\n  any,\n  any,\n  any,\n  any,\n  any\n>\n\n/**\n * Creates a root route factory that requires a router context type.\n *\n * Use when your root route expects `context` to be provided to `createRouter`.\n * The returned function behaves like `createRootRoute` but enforces a context type.\n *\n * @returns A factory function to configure and return a root route.\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/createRootRouteWithContextFunction\n */\nexport function createRootRouteWithContext<TRouterContext extends {}>() {\n  return <\n    TRegister = Register,\n    TRouteContextFn = AnyContext,\n    TBeforeLoadFn = AnyContext,\n    TSearchValidator = undefined,\n    TLoaderDeps extends Record<string, any> = {},\n    TLoaderFn = undefined,\n    TSSR = unknown,\n    TServerMiddlewares = unknown,\n  >(\n    options?: RootRouteOptions<\n      TRegister,\n      TSearchValidator,\n      TRouterContext,\n      TRouteContextFn,\n      TBeforeLoadFn,\n      TLoaderDeps,\n      TLoaderFn,\n      TSSR,\n      TServerMiddlewares\n    >,\n  ) => {\n    return createRootRoute<\n      TRegister,\n      TSearchValidator,\n      TRouterContext,\n      TRouteContextFn,\n      TBeforeLoadFn,\n      TLoaderDeps,\n      TLoaderFn,\n      TSSR,\n      TServerMiddlewares\n    >(options as any)\n  }\n}\n\n/**\n * @deprecated Use the `createRootRouteWithContext` function instead.\n */\nexport const rootRouteWithContext = createRootRouteWithContext\n\nexport class RootRoute<\n    in out TRegister = unknown,\n    in out TSearchValidator = undefined,\n    in out TRouterContext = {},\n    in out TRouteContextFn = AnyContext,\n    in out TBeforeLoadFn = AnyContext,\n    in out TLoaderDeps extends Record<string, any> = {},\n    in out TLoaderFn = undefined,\n    in out TChildren = unknown,\n    in out TFileRouteTypes = unknown,\n    in out TSSR = unknown,\n    in out TServerMiddlewares = unknown,\n    in out THandlers = undefined,\n  >\n  extends BaseRootRoute<\n    TRegister,\n    TSearchValidator,\n    TRouterContext,\n    TRouteContextFn,\n    TBeforeLoadFn,\n    TLoaderDeps,\n    TLoaderFn,\n    TChildren,\n    TFileRouteTypes,\n    TSSR,\n    TServerMiddlewares,\n    THandlers\n  >\n  implements\n    RootRouteCore<\n      TRegister,\n      TSearchValidator,\n      TRouterContext,\n      TRouteContextFn,\n      TBeforeLoadFn,\n      TLoaderDeps,\n      TLoaderFn,\n      TChildren,\n      TFileRouteTypes,\n      TSSR,\n      TServerMiddlewares,\n      THandlers\n    >\n{\n  /**\n   * @deprecated `RootRoute` is now an internal implementation detail. Use `createRootRoute()` instead.\n   */\n  constructor(\n    options?: RootRouteOptions<\n      TRegister,\n      TSearchValidator,\n      TRouterContext,\n      TRouteContextFn,\n      TBeforeLoadFn,\n      TLoaderDeps,\n      TLoaderFn,\n      TSSR,\n      TServerMiddlewares,\n      THandlers\n    >,\n  ) {\n    super(options)\n    ;(this as any).$$typeof = Symbol.for('react.memo')\n  }\n\n  useMatch: UseMatchRoute<RootRouteId> = (opts) => {\n    return useMatch({\n      select: opts?.select,\n      from: this.id,\n      structuralSharing: opts?.structuralSharing,\n    } as any) as any\n  }\n\n  useRouteContext: UseRouteContextRoute<RootRouteId> = (opts) => {\n    return useMatch({\n      ...opts,\n      from: this.id,\n      select: (d) => (opts?.select ? opts.select(d.context) : d.context),\n    }) as any\n  }\n\n  useSearch: UseSearchRoute<RootRouteId> = (opts) => {\n    // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n    return useSearch({\n      select: opts?.select,\n      structuralSharing: opts?.structuralSharing,\n      from: this.id,\n    } as any) as any\n  }\n\n  useParams: UseParamsRoute<RootRouteId> = (opts) => {\n    // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n    return useParams({\n      select: opts?.select,\n      structuralSharing: opts?.structuralSharing,\n      from: this.id,\n    } as any) as any\n  }\n\n  useLoaderDeps: UseLoaderDepsRoute<RootRouteId> = (opts) => {\n    return useLoaderDeps({ ...opts, from: this.id } as any)\n  }\n\n  useLoaderData: UseLoaderDataRoute<RootRouteId> = (opts) => {\n    return useLoaderData({ ...opts, from: this.id } as any)\n  }\n\n  useNavigate = (): UseNavigateResult<'/'> => {\n    return useNavigate({ from: this.fullPath })\n  }\n\n  Link: LinkComponentRoute<'/'> = React.forwardRef(\n    (props, ref: React.ForwardedRef<HTMLAnchorElement>) => {\n      return <Link ref={ref} from={this.fullPath} {...props} />\n    },\n  ) as unknown as LinkComponentRoute<'/'>\n}\n\n/**\n * Creates a root Route instance used to build your route tree.\n *\n * Typically paired with `createRouter({ routeTree })`. If you need to require\n * a typed router context, use `createRootRouteWithContext` instead.\n *\n * @param options Root route options (component, error, pending, etc.).\n * @returns A root route instance.\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/createRootRouteFunction\n */\nexport function createRootRoute<\n  TRegister = Register,\n  TSearchValidator = undefined,\n  TRouterContext = {},\n  TRouteContextFn = AnyContext,\n  TBeforeLoadFn = AnyContext,\n  TLoaderDeps extends Record<string, any> = {},\n  TLoaderFn = undefined,\n  TSSR = unknown,\n  const TServerMiddlewares = unknown,\n  THandlers = undefined,\n>(\n  options?: RootRouteOptions<\n    TRegister,\n    TSearchValidator,\n    TRouterContext,\n    TRouteContextFn,\n    TBeforeLoadFn,\n    TLoaderDeps,\n    TLoaderFn,\n    TSSR,\n    TServerMiddlewares,\n    THandlers\n  >,\n): RootRoute<\n  TRegister,\n  TSearchValidator,\n  TRouterContext,\n  TRouteContextFn,\n  TBeforeLoadFn,\n  TLoaderDeps,\n  TLoaderFn,\n  unknown,\n  unknown,\n  TSSR,\n  TServerMiddlewares,\n  THandlers\n> {\n  return new RootRoute<\n    TRegister,\n    TSearchValidator,\n    TRouterContext,\n    TRouteContextFn,\n    TBeforeLoadFn,\n    TLoaderDeps,\n    TLoaderFn,\n    unknown,\n    unknown,\n    TSSR,\n    TServerMiddlewares,\n    THandlers\n  >(options)\n}\n\nexport function createRouteMask<\n  TRouteTree extends AnyRoute,\n  TFrom extends string,\n  TTo extends string,\n>(\n  opts: {\n    routeTree: TRouteTree\n  } & ToMaskOptions<RouterCore<TRouteTree, 'never', boolean>, TFrom, TTo>,\n): RouteMask<TRouteTree> {\n  return opts as any\n}\n\nexport interface DefaultRouteTypes<TProps> {\n  component:\n    | ((props: TProps) => any)\n    | React.LazyExoticComponent<(props: TProps) => any>\n}\nexport interface RouteTypes<TProps> extends DefaultRouteTypes<TProps> {}\n\nexport type AsyncRouteComponent<TProps> = RouteTypes<TProps>['component'] & {\n  preload?: () => Promise<void>\n}\n\nexport type RouteComponent = AsyncRouteComponent<{}>\n\nexport type ErrorRouteComponent = AsyncRouteComponent<ErrorComponentProps>\n\nexport type NotFoundRouteComponent = RouteTypes<NotFoundRouteProps>['component']\n\nexport class NotFoundRoute<\n  TRegister,\n  TParentRoute extends AnyRootRoute,\n  TRouterContext = AnyContext,\n  TRouteContextFn = AnyContext,\n  TBeforeLoadFn = AnyContext,\n  TSearchValidator = undefined,\n  TLoaderDeps extends Record<string, any> = {},\n  TLoaderFn = undefined,\n  TChildren = unknown,\n  TSSR = unknown,\n  TServerMiddlewares = unknown,\n> extends Route<\n  TRegister,\n  TParentRoute,\n  '/404',\n  '/404',\n  '404',\n  '404',\n  TSearchValidator,\n  {},\n  TRouterContext,\n  TRouteContextFn,\n  TBeforeLoadFn,\n  TLoaderDeps,\n  TLoaderFn,\n  TChildren,\n  TSSR,\n  TServerMiddlewares\n> {\n  constructor(\n    options: Omit<\n      RouteOptions<\n        TRegister,\n        TParentRoute,\n        string,\n        string,\n        string,\n        string,\n        TSearchValidator,\n        {},\n        TLoaderDeps,\n        TLoaderFn,\n        TRouterContext,\n        TRouteContextFn,\n        TBeforeLoadFn,\n        TSSR,\n        TServerMiddlewares\n      >,\n      | 'caseSensitive'\n      | 'parseParams'\n      | 'stringifyParams'\n      | 'path'\n      | 'id'\n      | 'params'\n    >,\n  ) {\n    super({\n      ...(options as any),\n      id: '404',\n    })\n  }\n}\n", "import warning from 'tiny-warning'\nimport { createRoute } from './route'\n\nimport { useMatch } from './useMatch'\nimport { useLoaderDeps } from './useLoaderDeps'\nimport { useLoaderData } from './useLoaderData'\nimport { useSearch } from './useSearch'\nimport { useParams } from './useParams'\nimport { useNavigate } from './useNavigate'\nimport { useRouter } from './useRouter'\nimport type { UseParamsRoute } from './useParams'\nimport type { UseMatchRoute } from './useMatch'\nimport type { UseSearchRoute } from './useSearch'\nimport type {\n  AnyContext,\n  AnyRoute,\n  AnyRouter,\n  Constrain,\n  ConstrainLiteral,\n  FileBaseRouteOptions,\n  FileRoutesByPath,\n  LazyRouteOptions,\n  Register,\n  RegisteredRouter,\n  ResolveParams,\n  Route,\n  RouteById,\n  RouteConstraints,\n  RouteIds,\n  RouteLoaderFn,\n  UpdatableRouteOptions,\n  UseNavigateResult,\n} from '@tanstack/router-core'\nimport type { UseLoaderDepsRoute } from './useLoaderDeps'\nimport type { UseLoaderDataRoute } from './useLoaderData'\nimport type { UseRouteContextRoute } from './useRouteContext'\n\n/**\n * Creates a file-based Route factory for a given path.\n *\n * Used by TanStack Router's file-based routing to associate a file with a\n * route. The returned function accepts standard route options. In normal usage\n * the `path` string is inserted and maintained by the `tsr` generator.\n *\n * @param path File path literal for the route (usually auto-generated).\n * @returns A function that accepts Route options and returns a Route instance.\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/createFileRouteFunction\n */\n/**\n * Creates a file-based Route factory for a given path.\n *\n * Used by TanStack Router's file-based routing to associate a file with a\n * route. The returned function accepts standard route options. In normal usage\n * the `path` string is inserted and maintained by the `tsr` generator.\n *\n * @param path File path literal for the route (usually auto-generated).\n * @returns A function that accepts Route options and returns a Route instance.\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/createFileRouteFunction\n */\n/**\n * Creates a file-based Route factory for a given path.\n * Used by file-based routing to associate a file with a route. The returned\n * function accepts standard route options; the path is typically auto-managed\n * by the generator.\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/createFileRouteFunction\n */\nexport function createFileRoute<\n  TFilePath extends keyof FileRoutesByPath,\n  TParentRoute extends AnyRoute = FileRoutesByPath[TFilePath]['parentRoute'],\n  TId extends RouteConstraints['TId'] = FileRoutesByPath[TFilePath]['id'],\n  TPath extends RouteConstraints['TPath'] = FileRoutesByPath[TFilePath]['path'],\n  TFullPath extends\n    RouteConstraints['TFullPath'] = FileRoutesByPath[TFilePath]['fullPath'],\n>(\n  path?: TFilePath,\n): FileRoute<TFilePath, TParentRoute, TId, TPath, TFullPath>['createRoute'] {\n  if (typeof path === 'object') {\n    return new FileRoute<TFilePath, TParentRoute, TId, TPath, TFullPath>(path, {\n      silent: true,\n    }).createRoute(path) as any\n  }\n  return new FileRoute<TFilePath, TParentRoute, TId, TPath, TFullPath>(path, {\n    silent: true,\n  }).createRoute\n}\n\n/** \n  @deprecated It's no longer recommended to use the `FileRoute` class directly.\n  Instead, use `createFileRoute('/path/to/file')(options)` to create a file route.\n*/\n/** \n  @deprecated It's no longer recommended to use the `FileRoute` class directly.\n  Instead, use `createFileRoute('/path/to/file')(options)` to create a file route.\n*/\n/**\n  @deprecated It's no longer recommended to use the `FileRoute` class directly.\n  Instead, use `createFileRoute('/path')(options)` to create a file route.\n*/\nexport class FileRoute<\n  TFilePath extends keyof FileRoutesByPath,\n  TParentRoute extends AnyRoute = FileRoutesByPath[TFilePath]['parentRoute'],\n  TId extends RouteConstraints['TId'] = FileRoutesByPath[TFilePath]['id'],\n  TPath extends RouteConstraints['TPath'] = FileRoutesByPath[TFilePath]['path'],\n  TFullPath extends\n    RouteConstraints['TFullPath'] = FileRoutesByPath[TFilePath]['fullPath'],\n> {\n  silent?: boolean\n\n  constructor(\n    public path?: TFilePath,\n    _opts?: { silent: boolean },\n  ) {\n    this.silent = _opts?.silent\n  }\n\n  createRoute = <\n    TRegister = Register,\n    TSearchValidator = undefined,\n    TParams = ResolveParams<TPath>,\n    TRouteContextFn = AnyContext,\n    TBeforeLoadFn = AnyContext,\n    TLoaderDeps extends Record<string, any> = {},\n    TLoaderFn = undefined,\n    TChildren = unknown,\n    TSSR = unknown,\n    const TMiddlewares = unknown,\n    THandlers = undefined,\n  >(\n    options?: FileBaseRouteOptions<\n      TRegister,\n      TParentRoute,\n      TId,\n      TPath,\n      TSearchValidator,\n      TParams,\n      TLoaderDeps,\n      TLoaderFn,\n      AnyContext,\n      TRouteContextFn,\n      TBeforeLoadFn,\n      AnyContext,\n      TSSR,\n      TMiddlewares,\n      THandlers\n    > &\n      UpdatableRouteOptions<\n        TParentRoute,\n        TId,\n        TFullPath,\n        TParams,\n        TSearchValidator,\n        TLoaderFn,\n        TLoaderDeps,\n        AnyContext,\n        TRouteContextFn,\n        TBeforeLoadFn\n      >,\n  ): Route<\n    TRegister,\n    TParentRoute,\n    TPath,\n    TFullPath,\n    TFilePath,\n    TId,\n    TSearchValidator,\n    TParams,\n    AnyContext,\n    TRouteContextFn,\n    TBeforeLoadFn,\n    TLoaderDeps,\n    TLoaderFn,\n    TChildren,\n    unknown,\n    TSSR,\n    TMiddlewares,\n    THandlers\n  > => {\n    warning(\n      this.silent,\n      'FileRoute is deprecated and will be removed in the next major version. Use the createFileRoute(path)(options) function instead.',\n    )\n    const route = createRoute(options as any)\n    ;(route as any).isRoot = false\n    return route as any\n  }\n}\n\n/** \n  @deprecated It's recommended not to split loaders into separate files.\n  Instead, place the loader function in the the main route file, inside the\n  `createFileRoute('/path/to/file)(options)` options.\n*/\n/** \n  @deprecated It's recommended not to split loaders into separate files.\n  Instead, place the loader function in the the main route file, inside the\n  `createFileRoute('/path/to/file)(options)` options.\n*/\n/**\n  @deprecated It's recommended not to split loaders into separate files.\n  Instead, place the loader function in the main route file via `createFileRoute`.\n*/\nexport function FileRouteLoader<\n  TFilePath extends keyof FileRoutesByPath,\n  TRoute extends FileRoutesByPath[TFilePath]['preLoaderRoute'],\n>(\n  _path: TFilePath,\n): <TLoaderFn>(\n  loaderFn: Constrain<\n    TLoaderFn,\n    RouteLoaderFn<\n      Register,\n      TRoute['parentRoute'],\n      TRoute['types']['id'],\n      TRoute['types']['params'],\n      TRoute['types']['loaderDeps'],\n      TRoute['types']['routerContext'],\n      TRoute['types']['routeContextFn'],\n      TRoute['types']['beforeLoadFn']\n    >\n  >,\n) => TLoaderFn {\n  warning(\n    false,\n    `FileRouteLoader is deprecated and will be removed in the next major version. Please place the loader function in the the main route file, inside the \\`createFileRoute('/path/to/file')(options)\\` options`,\n  )\n  return (loaderFn) => loaderFn as any\n}\n\ndeclare module '@tanstack/router-core' {\n  export interface LazyRoute<in out TRoute extends AnyRoute> {\n    useMatch: UseMatchRoute<TRoute['id']>\n    useRouteContext: UseRouteContextRoute<TRoute['id']>\n    useSearch: UseSearchRoute<TRoute['id']>\n    useParams: UseParamsRoute<TRoute['id']>\n    useLoaderDeps: UseLoaderDepsRoute<TRoute['id']>\n    useLoaderData: UseLoaderDataRoute<TRoute['id']>\n    useNavigate: () => UseNavigateResult<TRoute['fullPath']>\n  }\n}\n\nexport class LazyRoute<TRoute extends AnyRoute> {\n  options: {\n    id: string\n  } & LazyRouteOptions\n\n  constructor(\n    opts: {\n      id: string\n    } & LazyRouteOptions,\n  ) {\n    this.options = opts\n    ;(this as any).$$typeof = Symbol.for('react.memo')\n  }\n\n  useMatch: UseMatchRoute<TRoute['id']> = (opts) => {\n    return useMatch({\n      select: opts?.select,\n      from: this.options.id,\n      structuralSharing: opts?.structuralSharing,\n    } as any) as any\n  }\n\n  useRouteContext: UseRouteContextRoute<TRoute['id']> = (opts) => {\n    return useMatch({\n      from: this.options.id,\n      select: (d: any) => (opts?.select ? opts.select(d.context) : d.context),\n    }) as any\n  }\n\n  useSearch: UseSearchRoute<TRoute['id']> = (opts) => {\n    // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n    return useSearch({\n      select: opts?.select,\n      structuralSharing: opts?.structuralSharing,\n      from: this.options.id,\n    } as any) as any\n  }\n\n  useParams: UseParamsRoute<TRoute['id']> = (opts) => {\n    // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n    return useParams({\n      select: opts?.select,\n      structuralSharing: opts?.structuralSharing,\n      from: this.options.id,\n    } as any) as any\n  }\n\n  useLoaderDeps: UseLoaderDepsRoute<TRoute['id']> = (opts) => {\n    return useLoaderDeps({ ...opts, from: this.options.id } as any)\n  }\n\n  useLoaderData: UseLoaderDataRoute<TRoute['id']> = (opts) => {\n    return useLoaderData({ ...opts, from: this.options.id } as any)\n  }\n\n  useNavigate = (): UseNavigateResult<TRoute['fullPath']> => {\n    const router = useRouter()\n    return useNavigate({ from: router.routesById[this.options.id].fullPath })\n  }\n}\n\n/**\n * Creates a lazily-configurable code-based route stub by ID.\n *\n * Use this for code-splitting with code-based routes. The returned function\n * accepts only non-critical route options like `component`, `pendingComponent`,\n * `errorComponent`, and `notFoundComponent` which are applied when the route\n * is matched.\n *\n * @param id Route ID string literal to associate with the lazy route.\n * @returns A function that accepts lazy route options and returns a `LazyRoute`.\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/createLazyRouteFunction\n */\n/**\n * Creates a lazily-configurable code-based route stub by ID.\n *\n * Use this for code-splitting with code-based routes. The returned function\n * accepts only non-critical route options like `component`, `pendingComponent`,\n * `errorComponent`, and `notFoundComponent` which are applied when the route\n * is matched.\n *\n * @param id Route ID string literal to associate with the lazy route.\n * @returns A function that accepts lazy route options and returns a `LazyRoute`.\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/createLazyRouteFunction\n */\n/**\n * Create a lazily-configurable code-based route stub by ID.\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/createLazyRouteFunction\n */\nexport function createLazyRoute<\n  TRouter extends AnyRouter = RegisteredRouter,\n  TId extends string = string,\n  TRoute extends AnyRoute = RouteById<TRouter['routeTree'], TId>,\n>(id: ConstrainLiteral<TId, RouteIds<TRouter['routeTree']>>) {\n  return (opts: LazyRouteOptions) => {\n    return new LazyRoute<TRoute>({\n      id: id,\n      ...opts,\n    })\n  }\n}\n\n/**\n * Creates a lazily-configurable file-based route stub by file path.\n *\n * Use this for code-splitting with file-based routes (eg. `.lazy.tsx` files).\n * The returned function accepts only non-critical route options like\n * `component`, `pendingComponent`, `errorComponent`, and `notFoundComponent`.\n *\n * @param id File path literal for the route file.\n * @returns A function that accepts lazy route options and returns a `LazyRoute`.\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/createLazyFileRouteFunction\n */\n/**\n * Creates a lazily-configurable file-based route stub by file path.\n *\n * Use this for code-splitting with file-based routes (eg. `.lazy.tsx` files).\n * The returned function accepts only non-critical route options like\n * `component`, `pendingComponent`, `errorComponent`, and `notFoundComponent`.\n *\n * @param id File path literal for the route file.\n * @returns A function that accepts lazy route options and returns a `LazyRoute`.\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/createLazyFileRouteFunction\n */\n/**\n * Create a lazily-configurable file-based route stub by file path.\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/createLazyFileRouteFunction\n */\nexport function createLazyFileRoute<\n  TFilePath extends keyof FileRoutesByPath,\n  TRoute extends FileRoutesByPath[TFilePath]['preLoaderRoute'],\n>(id: TFilePath): (opts: LazyRouteOptions) => LazyRoute<TRoute> {\n  if (typeof id === 'object') {\n    return new LazyRoute<TRoute>(id) as any\n  }\n\n  return (opts: LazyRouteOptions) => new LazyRoute<TRoute>({ id, ...opts })\n}\n", "import * as React from 'react'\nimport {\n  getLocationChangeInfo,\n  handleHashScroll,\n  trimPathRight,\n} from '@tanstack/router-core'\nimport { useLayoutEffect, usePrevious } from './utils'\nimport { useRouter } from './useRouter'\nimport { useRouterState } from './useRouterState'\n\nexport function Transitioner() {\n  const router = useRouter()\n  const mountLoadForRouter = React.useRef({ router, mounted: false })\n\n  const [isTransitioning, setIsTransitioning] = React.useState(false)\n  // Track pending state changes\n  const { hasPendingMatches, isLoading } = useRouterState({\n    select: (s) => ({\n      isLoading: s.isLoading,\n      hasPendingMatches: s.matches.some((d) => d.status === 'pending'),\n    }),\n    structuralSharing: true,\n  })\n\n  const previousIsLoading = usePrevious(isLoading)\n\n  const isAnyPending = isLoading || isTransitioning || hasPendingMatches\n  const previousIsAnyPending = usePrevious(isAnyPending)\n\n  const isPagePending = isLoading || hasPendingMatches\n  const previousIsPagePending = usePrevious(isPagePending)\n\n  router.startTransition = (fn: () => void) => {\n    setIsTransitioning(true)\n    React.startTransition(() => {\n      fn()\n      setIsTransitioning(false)\n    })\n  }\n\n  // Subscribe to location changes\n  // and try to load the new location\n  React.useEffect(() => {\n    const unsub = router.history.subscribe(router.load)\n\n    const nextLocation = router.buildLocation({\n      to: router.latestLocation.pathname,\n      search: true,\n      params: true,\n      hash: true,\n      state: true,\n      _includeValidateSearch: true,\n    })\n\n    if (\n      trimPathRight(router.latestLocation.href) !==\n      trimPathRight(nextLocation.href)\n    ) {\n      router.commitLocation({ ...nextLocation, replace: true })\n    }\n\n    return () => {\n      unsub()\n    }\n  }, [router, router.history])\n\n  // Try to load the initial location\n  useLayoutEffect(() => {\n    if (\n      // if we are hydrating from SSR, loading is triggered in ssr-client\n      (typeof window !== 'undefined' && router.ssr) ||\n      (mountLoadForRouter.current.router === router &&\n        mountLoadForRouter.current.mounted)\n    ) {\n      return\n    }\n    mountLoadForRouter.current = { router, mounted: true }\n\n    const tryLoad = async () => {\n      try {\n        await router.load()\n      } catch (err) {\n        console.error(err)\n      }\n    }\n\n    tryLoad()\n  }, [router])\n\n  useLayoutEffect(() => {\n    // The router was loading and now it's not\n    if (previousIsLoading && !isLoading) {\n      router.emit({\n        type: 'onLoad', // When the new URL has committed, when the new matches have been loaded into state.matches\n        ...getLocationChangeInfo(router.state),\n      })\n    }\n  }, [previousIsLoading, router, isLoading])\n\n  useLayoutEffect(() => {\n    // emit onBeforeRouteMount\n    if (previousIsPagePending && !isPagePending) {\n      router.emit({\n        type: 'onBeforeRouteMount',\n        ...getLocationChangeInfo(router.state),\n      })\n    }\n  }, [isPagePending, previousIsPagePending, router])\n\n  useLayoutEffect(() => {\n    // The router was pending and now it's not\n    if (previousIsAnyPending && !isAnyPending) {\n      router.emit({\n        type: 'onResolved',\n        ...getLocationChangeInfo(router.state),\n      })\n\n      router.__store.setState((s) => ({\n        ...s,\n        status: 'idle',\n        resolvedLocation: s.location,\n      }))\n\n      handleHashScroll(router)\n    }\n  }, [isAnyPending, previousIsAnyPending, router])\n\n  return null\n}\n", "import * as React from 'react'\nimport { isNotFound } from '@tanstack/router-core'\nimport { CatchBoundary } from './CatchBoundary'\nimport { useRouterState } from './useRouterState'\nimport type { ErrorInfo } from 'react'\nimport type { NotFoundError } from '@tanstack/router-core'\n\nexport function CatchNotFound(props: {\n  fallback?: (error: NotFoundError) => React.ReactElement\n  onCatch?: (error: Error, errorInfo: ErrorInfo) => void\n  children: React.ReactNode\n}) {\n  // TODO: Some way for the user to programmatically reset the not-found boundary?\n  const resetKey = useRouterState({\n    select: (s) => `not-found-${s.location.pathname}-${s.status}`,\n  })\n\n  return (\n    <CatchBoundary\n      getResetKey={() => resetKey}\n      onCatch={(error, errorInfo) => {\n        if (isNotFound(error)) {\n          props.onCatch?.(error, errorInfo)\n        } else {\n          throw error\n        }\n      }}\n      errorComponent={({ error }) => {\n        if (isNotFound(error)) {\n          return props.fallback?.(error)\n        } else {\n          throw error\n        }\n      }}\n    >\n      {props.children}\n    </CatchBoundary>\n  )\n}\n\nexport function DefaultGlobalNotFound() {\n  return <p>Not Found</p>\n}\n", "import * as React from 'react'\n\nexport function SafeFragment(props: any) {\n  return <>{props.children}</>\n}\n", "import * as React from 'react'\nimport warning from 'tiny-warning'\nimport { DefaultGlobalNotFound } from './not-found'\nimport type { AnyRoute, AnyRouter } from '@tanstack/router-core'\n\nexport function renderRouteNotFound(\n  router: AnyRouter,\n  route: AnyRoute,\n  data: any,\n) {\n  if (!route.options.notFoundComponent) {\n    if (router.options.defaultNotFoundComponent) {\n      return <router.options.defaultNotFoundComponent data={data} />\n    }\n\n    if (process.env.NODE_ENV === 'development') {\n      warning(\n        route.options.notFoundComponent,\n        `A notFoundError was encountered on the route with ID \"${route.id}\", but a notFoundComponent option was not configured, nor was a router level defaultNotFoundComponent configured. Consider configuring at least one of these to avoid TanStack Router's overly generic defaultNotFoundComponent (<div>Not Found<div>)`,\n      )\n    }\n\n    return <DefaultGlobalNotFound />\n  }\n\n  return <route.options.notFoundComponent data={data} />\n}\n", "import { useRouter } from './useRouter'\n\n/**\n * Server-only helper to emit a script tag exactly once during SSR.\n * Appends an internal marker to signal hydration completion.\n */\nexport function ScriptOnce({ children }: { children: string }) {\n  const router = useRouter()\n  if (!router.isServer) {\n    return null\n  }\n\n  return (\n    <script\n      nonce={router.options.ssr?.nonce}\n      className=\"$tsr\"\n      dangerouslySetInnerHTML={{\n        __html: [children].filter(Boolean).join('\\n') + ';$_TSR.c()',\n      }}\n    />\n  )\n}\n", "import {\n  defaultGetScrollRestorationKey,\n  restoreScroll,\n  storageKey,\n} from '@tanstack/router-core'\nimport { useRouter } from './useRouter'\nimport { ScriptOnce } from './ScriptOnce'\n\nexport function ScrollRestoration() {\n  const router = useRouter()\n  if (!router.isScrollRestoring || !router.isServer) {\n    return null\n  }\n  if (typeof router.options.scrollRestoration === 'function') {\n    const shouldRestore = router.options.scrollRestoration({\n      location: router.latestLocation,\n    })\n    if (!shouldRestore) {\n      return null\n    }\n  }\n  const getKey =\n    router.options.getScrollRestorationKey || defaultGetScrollRestorationKey\n  const userKey = getKey(router.latestLocation)\n  const resolvedKey =\n    userKey !== defaultGetScrollRestorationKey(router.latestLocation)\n      ? userKey\n      : undefined\n\n  const restoreScrollOptions: Parameters<typeof restoreScroll>[0] = {\n    storageKey,\n    shouldScrollRestoration: true,\n  }\n  if (resolvedKey) {\n    restoreScrollOptions.key = resolvedKey\n  }\n\n  return (\n    <ScriptOnce\n      children={`(${restoreScroll.toString()})(${JSON.stringify(restoreScrollOptions)})`}\n    />\n  )\n}\n", "import * as React from 'react'\nimport invariant from 'tiny-invariant'\nimport warning from 'tiny-warning'\nimport {\n  createControlledPromise,\n  getLocationChangeInfo,\n  isNotFound,\n  isRedirect,\n  rootRouteId,\n} from '@tanstack/router-core'\nimport { CatchBoundary, ErrorComponent } from './CatchBoundary'\nimport { useRouterState } from './useRouterState'\nimport { useRouter } from './useRouter'\nimport { CatchNotFound } from './not-found'\nimport { matchContext } from './matchContext'\nimport { SafeFragment } from './SafeFragment'\nimport { renderRouteNotFound } from './renderRouteNotFound'\nimport { ScrollRestoration } from './scroll-restoration'\nimport { ClientOnly } from './ClientOnly'\nimport type {\n  AnyRoute,\n  ParsedLocation,\n  RootRouteOptions,\n} from '@tanstack/router-core'\n\nexport const Match = React.memo(function MatchImpl({\n  matchId,\n}: {\n  matchId: string\n}) {\n  const router = useRouter()\n  const matchState = useRouterState({\n    select: (s) => {\n      const match = s.matches.find((d) => d.id === matchId)\n      invariant(\n        match,\n        `Could not find match for matchId \"${matchId}\". Please file an issue!`,\n      )\n      return {\n        routeId: match.routeId,\n        ssr: match.ssr,\n        _displayPending: match._displayPending,\n      }\n    },\n    structuralSharing: true as any,\n  })\n\n  const route: AnyRoute = router.routesById[matchState.routeId]\n\n  const PendingComponent =\n    route.options.pendingComponent ?? router.options.defaultPendingComponent\n\n  const pendingElement = PendingComponent ? <PendingComponent /> : null\n\n  const routeErrorComponent =\n    route.options.errorComponent ?? router.options.defaultErrorComponent\n\n  const routeOnCatch = route.options.onCatch ?? router.options.defaultOnCatch\n\n  const routeNotFoundComponent = route.isRoot\n    ? // If it's the root route, use the globalNotFound option, with fallback to the notFoundRoute's component\n      (route.options.notFoundComponent ??\n      router.options.notFoundRoute?.options.component)\n    : route.options.notFoundComponent\n\n  const resolvedNoSsr =\n    matchState.ssr === false || matchState.ssr === 'data-only'\n  const ResolvedSuspenseBoundary =\n    // If we're on the root route, allow forcefully wrapping in suspense\n    (!route.isRoot || route.options.wrapInSuspense || resolvedNoSsr) &&\n    (route.options.wrapInSuspense ??\n      PendingComponent ??\n      ((route.options.errorComponent as any)?.preload || resolvedNoSsr))\n      ? React.Suspense\n      : SafeFragment\n\n  const ResolvedCatchBoundary = routeErrorComponent\n    ? CatchBoundary\n    : SafeFragment\n\n  const ResolvedNotFoundBoundary = routeNotFoundComponent\n    ? CatchNotFound\n    : SafeFragment\n\n  const resetKey = useRouterState({\n    select: (s) => s.loadedAt,\n  })\n\n  const parentRouteId = useRouterState({\n    select: (s) => {\n      const index = s.matches.findIndex((d) => d.id === matchId)\n      return s.matches[index - 1]?.routeId as string\n    },\n  })\n\n  const ShellComponent = route.isRoot\n    ? ((route.options as RootRouteOptions).shellComponent ?? SafeFragment)\n    : SafeFragment\n  return (\n    <ShellComponent>\n      <matchContext.Provider value={matchId}>\n        <ResolvedSuspenseBoundary fallback={pendingElement}>\n          <ResolvedCatchBoundary\n            getResetKey={() => resetKey}\n            errorComponent={routeErrorComponent || ErrorComponent}\n            onCatch={(error, errorInfo) => {\n              // Forward not found errors (we don't want to show the error component for these)\n              if (isNotFound(error)) throw error\n              warning(false, `Error in route match: ${matchId}`)\n              routeOnCatch?.(error, errorInfo)\n            }}\n          >\n            <ResolvedNotFoundBoundary\n              fallback={(error) => {\n                // If the current not found handler doesn't exist or it has a\n                // route ID which doesn't match the current route, rethrow the error\n                if (\n                  !routeNotFoundComponent ||\n                  (error.routeId && error.routeId !== matchState.routeId) ||\n                  (!error.routeId && !route.isRoot)\n                )\n                  throw error\n\n                return React.createElement(routeNotFoundComponent, error as any)\n              }}\n            >\n              {resolvedNoSsr || matchState._displayPending ? (\n                <ClientOnly fallback={pendingElement}>\n                  <MatchInner matchId={matchId} />\n                </ClientOnly>\n              ) : (\n                <MatchInner matchId={matchId} />\n              )}\n            </ResolvedNotFoundBoundary>\n          </ResolvedCatchBoundary>\n        </ResolvedSuspenseBoundary>\n      </matchContext.Provider>\n      {parentRouteId === rootRouteId && router.options.scrollRestoration ? (\n        <>\n          <OnRendered />\n          <ScrollRestoration />\n        </>\n      ) : null}\n    </ShellComponent>\n  )\n})\n\n// On Rendered can't happen above the root layout because it actually\n// renders a dummy dom element to track the rendered state of the app.\n// We render a script tag with a key that changes based on the current\n// location state.__TSR_key. Also, because it's below the root layout, it\n// allows us to fire onRendered events even after a hydration mismatch\n// error that occurred above the root layout (like bad head/link tags,\n// which is common).\nfunction OnRendered() {\n  const router = useRouter()\n\n  const prevLocationRef = React.useRef<undefined | ParsedLocation<{}>>(\n    undefined,\n  )\n\n  return (\n    <script\n      key={router.latestLocation.state.__TSR_key}\n      suppressHydrationWarning\n      ref={(el) => {\n        if (\n          el &&\n          (prevLocationRef.current === undefined ||\n            prevLocationRef.current.href !== router.latestLocation.href)\n        ) {\n          router.emit({\n            type: 'onRendered',\n            ...getLocationChangeInfo(router.state),\n          })\n          prevLocationRef.current = router.latestLocation\n        }\n      }}\n    />\n  )\n}\n\nexport const MatchInner = React.memo(function MatchInnerImpl({\n  matchId,\n}: {\n  matchId: string\n}): any {\n  const router = useRouter()\n\n  const { match, key, routeId } = useRouterState({\n    select: (s) => {\n      const match = s.matches.find((d) => d.id === matchId)!\n      const routeId = match.routeId as string\n\n      const remountFn =\n        (router.routesById[routeId] as AnyRoute).options.remountDeps ??\n        router.options.defaultRemountDeps\n      const remountDeps = remountFn?.({\n        routeId,\n        loaderDeps: match.loaderDeps,\n        params: match._strictParams,\n        search: match._strictSearch,\n      })\n      const key = remountDeps ? JSON.stringify(remountDeps) : undefined\n\n      return {\n        key,\n        routeId,\n        match: {\n          id: match.id,\n          status: match.status,\n          error: match.error,\n          _forcePending: match._forcePending,\n          _displayPending: match._displayPending,\n        },\n      }\n    },\n    structuralSharing: true as any,\n  })\n\n  const route = router.routesById[routeId] as AnyRoute\n\n  const out = React.useMemo(() => {\n    const Comp = route.options.component ?? router.options.defaultComponent\n    if (Comp) {\n      return <Comp key={key} />\n    }\n    return <Outlet />\n  }, [key, route.options.component, router.options.defaultComponent])\n\n  if (match._displayPending) {\n    throw router.getMatch(match.id)?._nonReactive.displayPendingPromise\n  }\n\n  if (match._forcePending) {\n    throw router.getMatch(match.id)?._nonReactive.minPendingPromise\n  }\n\n  // see also hydrate() in packages/router-core/src/ssr/ssr-client.ts\n  if (match.status === 'pending') {\n    // We're pending, and if we have a minPendingMs, we need to wait for it\n    const pendingMinMs =\n      route.options.pendingMinMs ?? router.options.defaultPendingMinMs\n    if (pendingMinMs) {\n      const routerMatch = router.getMatch(match.id)\n      if (routerMatch && !routerMatch._nonReactive.minPendingPromise) {\n        // Create a promise that will resolve after the minPendingMs\n        if (!router.isServer) {\n          const minPendingPromise = createControlledPromise<void>()\n\n          routerMatch._nonReactive.minPendingPromise = minPendingPromise\n\n          setTimeout(() => {\n            minPendingPromise.resolve()\n            // We've handled the minPendingPromise, so we can delete it\n            routerMatch._nonReactive.minPendingPromise = undefined\n          }, pendingMinMs)\n        }\n      }\n    }\n    throw router.getMatch(match.id)?._nonReactive.loadPromise\n  }\n\n  if (match.status === 'notFound') {\n    invariant(isNotFound(match.error), 'Expected a notFound error')\n    return renderRouteNotFound(router, route, match.error)\n  }\n\n  if (match.status === 'redirected') {\n    // Redirects should be handled by the router transition. If we happen to\n    // encounter a redirect here, it's a bug. Let's warn, but render nothing.\n    invariant(isRedirect(match.error), 'Expected a redirect error')\n\n    // warning(\n    //   false,\n    //   'Tried to render a redirected route match! This is a weird circumstance, please file an issue!',\n    // )\n    throw router.getMatch(match.id)?._nonReactive.loadPromise\n  }\n\n  if (match.status === 'error') {\n    // If we're on the server, we need to use React's new and super\n    // wonky api for throwing errors from a server side render inside\n    // of a suspense boundary. This is the only way to get\n    // renderToPipeableStream to not hang indefinitely.\n    // We'll serialize the error and rethrow it on the client.\n    if (router.isServer) {\n      const RouteErrorComponent =\n        (route.options.errorComponent ??\n          router.options.defaultErrorComponent) ||\n        ErrorComponent\n      return (\n        <RouteErrorComponent\n          error={match.error as any}\n          reset={undefined as any}\n          info={{\n            componentStack: '',\n          }}\n        />\n      )\n    }\n\n    throw match.error\n  }\n\n  return out\n})\n\n/**\n * Render the next child match in the route tree. Typically used inside\n * a route component to render nested routes.\n *\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/outletComponent\n */\nexport const Outlet = React.memo(function OutletImpl() {\n  const router = useRouter()\n  const matchId = React.useContext(matchContext)\n  const routeId = useRouterState({\n    select: (s) => s.matches.find((d) => d.id === matchId)?.routeId as string,\n  })\n\n  const route = router.routesById[routeId]!\n\n  const parentGlobalNotFound = useRouterState({\n    select: (s) => {\n      const matches = s.matches\n      const parentMatch = matches.find((d) => d.id === matchId)\n      invariant(\n        parentMatch,\n        `Could not find parent match for matchId \"${matchId}\"`,\n      )\n      return parentMatch.globalNotFound\n    },\n  })\n\n  const childMatchId = useRouterState({\n    select: (s) => {\n      const matches = s.matches\n      const index = matches.findIndex((d) => d.id === matchId)\n      return matches[index + 1]?.id\n    },\n  })\n\n  const pendingElement = router.options.defaultPendingComponent ? (\n    <router.options.defaultPendingComponent />\n  ) : null\n\n  if (parentGlobalNotFound) {\n    return renderRouteNotFound(router, route, undefined)\n  }\n\n  if (!childMatchId) {\n    return null\n  }\n\n  const nextMatch = <Match matchId={childMatchId} />\n\n  if (matchId === rootRouteId) {\n    return (\n      <React.Suspense fallback={pendingElement}>{nextMatch}</React.Suspense>\n    )\n  }\n\n  return nextMatch\n})\n", "import * as React from 'react'\nimport warning from 'tiny-warning'\nimport { rootRouteId } from '@tanstack/router-core'\nimport { CatchBoundary, ErrorComponent } from './CatchBoundary'\nimport { useRouterState } from './useRouterState'\nimport { useRouter } from './useRouter'\nimport { Transitioner } from './Transitioner'\nimport { matchContext } from './matchContext'\nimport { Match } from './Match'\nimport { SafeFragment } from './SafeFragment'\nimport type {\n  StructuralSharingOption,\n  ValidateSelected,\n} from './structuralSharing'\nimport type {\n  AnyRoute,\n  AnyRouter,\n  DeepPartial,\n  Expand,\n  MakeOptionalPathParams,\n  MakeOptionalSearchParams,\n  MakeRouteMatchUnion,\n  MaskOptions,\n  MatchRouteOptions,\n  NoInfer,\n  RegisteredRouter,\n  ResolveRelativePath,\n  ResolveRoute,\n  RouteByPath,\n  RouterState,\n  ToSubOptionsProps,\n} from '@tanstack/router-core'\n\ndeclare module '@tanstack/router-core' {\n  export interface RouteMatchExtensions {\n    meta?: Array<React.JSX.IntrinsicElements['meta'] | undefined>\n    links?: Array<React.JSX.IntrinsicElements['link'] | undefined>\n    scripts?: Array<React.JSX.IntrinsicElements['script'] | undefined>\n    styles?: Array<React.JSX.IntrinsicElements['style'] | undefined>\n    headScripts?: Array<React.JSX.IntrinsicElements['script'] | undefined>\n  }\n}\n\n/**\n * Internal component that renders the router's active match tree with\n * suspense, error, and not-found boundaries. Rendered by `RouterProvider`.\n */\n/**\n * Internal component that renders the router's active match tree with\n * suspense, error, and not-found boundaries. Rendered by `RouterProvider`.\n */\nexport function Matches() {\n  const router = useRouter()\n  const rootRoute: AnyRoute = router.routesById[rootRouteId]\n\n  const PendingComponent =\n    rootRoute.options.pendingComponent ?? router.options.defaultPendingComponent\n\n  const pendingElement = PendingComponent ? <PendingComponent /> : null\n\n  // Do not render a root Suspense during SSR or hydrating from SSR\n  const ResolvedSuspense =\n    router.isServer || (typeof document !== 'undefined' && router.ssr)\n      ? SafeFragment\n      : React.Suspense\n\n  const inner = (\n    <ResolvedSuspense fallback={pendingElement}>\n      {!router.isServer && <Transitioner />}\n      <MatchesInner />\n    </ResolvedSuspense>\n  )\n\n  return router.options.InnerWrap ? (\n    <router.options.InnerWrap>{inner}</router.options.InnerWrap>\n  ) : (\n    inner\n  )\n}\n\nfunction MatchesInner() {\n  const router = useRouter()\n  const matchId = useRouterState({\n    select: (s) => {\n      return s.matches[0]?.id\n    },\n  })\n\n  const resetKey = useRouterState({\n    select: (s) => s.loadedAt,\n  })\n\n  const matchComponent = matchId ? <Match matchId={matchId} /> : null\n\n  return (\n    <matchContext.Provider value={matchId}>\n      {router.options.disableGlobalCatchBoundary ? (\n        matchComponent\n      ) : (\n        <CatchBoundary\n          getResetKey={() => resetKey}\n          errorComponent={ErrorComponent}\n          onCatch={(error) => {\n            warning(\n              false,\n              `The following error wasn't caught by any route! At the very least, consider setting an 'errorComponent' in your RootRoute!`,\n            )\n            warning(false, error.message || error.toString())\n          }}\n        >\n          {matchComponent}\n        </CatchBoundary>\n      )}\n    </matchContext.Provider>\n  )\n}\n\nexport type UseMatchRouteOptions<\n  TRouter extends AnyRouter = RegisteredRouter,\n  TFrom extends string = string,\n  TTo extends string | undefined = undefined,\n  TMaskFrom extends string = TFrom,\n  TMaskTo extends string = '',\n> = ToSubOptionsProps<TRouter, TFrom, TTo> &\n  DeepPartial<MakeOptionalSearchParams<TRouter, TFrom, TTo>> &\n  DeepPartial<MakeOptionalPathParams<TRouter, TFrom, TTo>> &\n  MaskOptions<TRouter, TMaskFrom, TMaskTo> &\n  MatchRouteOptions\n\n/**\n * Create a matcher function for testing locations against route definitions.\n *\n * The returned function accepts standard navigation options (`to`, `params`,\n * `search`, etc.) and returns either `false` (no match) or the matched params\n * object when the route matches the current or pending location.\n *\n * Useful for conditional rendering and active UI states.\n *\n * @returns A `matchRoute(options)` function that returns `false` or params.\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useMatchRouteHook\n */\nexport function useMatchRoute<TRouter extends AnyRouter = RegisteredRouter>() {\n  const router = useRouter()\n\n  useRouterState({\n    select: (s) => [s.location.href, s.resolvedLocation?.href, s.status],\n    structuralSharing: true as any,\n  })\n\n  return React.useCallback(\n    <\n      const TFrom extends string = string,\n      const TTo extends string | undefined = undefined,\n      const TMaskFrom extends string = TFrom,\n      const TMaskTo extends string = '',\n    >(\n      opts: UseMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>,\n    ):\n      | false\n      | Expand<ResolveRoute<TRouter, TFrom, TTo>['types']['allParams']> => {\n      const { pending, caseSensitive, fuzzy, includeSearch, ...rest } = opts\n\n      return router.matchRoute(rest as any, {\n        pending,\n        caseSensitive,\n        fuzzy,\n        includeSearch,\n      })\n    },\n    [router],\n  )\n}\n\nexport type MakeMatchRouteOptions<\n  TRouter extends AnyRouter = RegisteredRouter,\n  TFrom extends string = string,\n  TTo extends string | undefined = undefined,\n  TMaskFrom extends string = TFrom,\n  TMaskTo extends string = '',\n> = UseMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo> & {\n  // If a function is passed as a child, it will be given the `isActive` boolean to aid in further styling on the element it returns\n  children?:\n    | ((\n        params?: RouteByPath<\n          TRouter['routeTree'],\n          ResolveRelativePath<TFrom, NoInfer<TTo>>\n        >['types']['allParams'],\n      ) => React.ReactNode)\n    | React.ReactNode\n}\n\n/**\n * Component that conditionally renders its children based on whether a route\n * matches the provided `from`/`to` options. If `children` is a function, it\n * receives the matched params object.\n *\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/matchRouteComponent\n */\nexport function MatchRoute<\n  TRouter extends AnyRouter = RegisteredRouter,\n  const TFrom extends string = string,\n  const TTo extends string | undefined = undefined,\n  const TMaskFrom extends string = TFrom,\n  const TMaskTo extends string = '',\n>(props: MakeMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>): any {\n  const matchRoute = useMatchRoute()\n  const params = matchRoute(props as any) as boolean\n\n  if (typeof props.children === 'function') {\n    return (props.children as any)(params)\n  }\n\n  return params ? props.children : null\n}\n\nexport interface UseMatchesBaseOptions<\n  TRouter extends AnyRouter,\n  TSelected,\n  TStructuralSharing,\n> {\n  select?: (\n    matches: Array<MakeRouteMatchUnion<TRouter>>,\n  ) => ValidateSelected<TRouter, TSelected, TStructuralSharing>\n}\n\nexport type UseMatchesResult<\n  TRouter extends AnyRouter,\n  TSelected,\n> = unknown extends TSelected ? Array<MakeRouteMatchUnion<TRouter>> : TSelected\n\nexport function useMatches<\n  TRouter extends AnyRouter = RegisteredRouter,\n  TSelected = unknown,\n  TStructuralSharing extends boolean = boolean,\n>(\n  opts?: UseMatchesBaseOptions<TRouter, TSelected, TStructuralSharing> &\n    StructuralSharingOption<TRouter, TSelected, TStructuralSharing>,\n): UseMatchesResult<TRouter, TSelected> {\n  return useRouterState({\n    select: (state: RouterState<TRouter['routeTree']>) => {\n      const matches = state.matches\n      return opts?.select\n        ? opts.select(matches as Array<MakeRouteMatchUnion<TRouter>>)\n        : matches\n    },\n    structuralSharing: opts?.structuralSharing,\n  } as any) as UseMatchesResult<TRouter, TSelected>\n}\n\n/**\n * Read the full array of active route matches or select a derived subset.\n *\n * Useful for debugging, breadcrumbs, or aggregating metadata across matches.\n *\n * @returns The array of matches (or the selected value).\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useMatchesHook\n */\n\n/**\n * Read the full array of active route matches or select a derived subset.\n *\n * Useful for debugging, breadcrumbs, or aggregating metadata across matches.\n *\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useMatchesHook\n */\n/**\n * Read the full array of active route matches or select a derived subset\n * from the parent boundary up to (but not including) the current match.\n */\nexport function useParentMatches<\n  TRouter extends AnyRouter = RegisteredRouter,\n  TSelected = unknown,\n  TStructuralSharing extends boolean = boolean,\n>(\n  opts?: UseMatchesBaseOptions<TRouter, TSelected, TStructuralSharing> &\n    StructuralSharingOption<TRouter, TSelected, TStructuralSharing>,\n): UseMatchesResult<TRouter, TSelected> {\n  const contextMatchId = React.useContext(matchContext)\n\n  return useMatches({\n    select: (matches: Array<MakeRouteMatchUnion<TRouter>>) => {\n      matches = matches.slice(\n        0,\n        matches.findIndex((d) => d.id === contextMatchId),\n      )\n      return opts?.select ? opts.select(matches) : matches\n    },\n    structuralSharing: opts?.structuralSharing,\n  } as any)\n}\n\n/**\n * Read the array of active route matches that are children of the current\n * match (or selected parent) in the match tree.\n */\n/**\n * Read the array of active route matches that are children of the current\n * match (or selected parent) in the match tree.\n */\nexport function useChildMatches<\n  TRouter extends AnyRouter = RegisteredRouter,\n  TSelected = unknown,\n  TStructuralSharing extends boolean = boolean,\n>(\n  opts?: UseMatchesBaseOptions<TRouter, TSelected, TStructuralSharing> &\n    StructuralSharingOption<TRouter, TSelected, TStructuralSharing>,\n): UseMatchesResult<TRouter, TSelected> {\n  const contextMatchId = React.useContext(matchContext)\n\n  return useMatches({\n    select: (matches: Array<MakeRouteMatchUnion<TRouter>>) => {\n      matches = matches.slice(\n        matches.findIndex((d) => d.id === contextMatchId) + 1,\n      )\n      return opts?.select ? opts.select(matches) : matches\n    },\n    structuralSharing: opts?.structuralSharing,\n  } as any)\n}\n", "import { RouterCore } from '@tanstack/router-core'\nimport { createFileRoute, createLazyFileRoute } from './fileRoute'\nimport type { RouterHistory } from '@tanstack/history'\nimport type {\n  AnyRoute,\n  CreateRouterFn,\n  RouterConstructorOptions,\n  TrailingSlashOption,\n} from '@tanstack/router-core'\n\nimport type {\n  ErrorRouteComponent,\n  NotFoundRouteComponent,\n  RouteComponent,\n} from './route'\n\ndeclare module '@tanstack/router-core' {\n  export interface RouterOptionsExtensions {\n    /**\n     * The default `component` a route should use if no component is provided.\n     *\n     * @default Outlet\n     * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultcomponent-property)\n     */\n    defaultComponent?: RouteComponent\n    /**\n     * The default `errorComponent` a route should use if no error component is provided.\n     *\n     * @default ErrorComponent\n     * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaulterrorcomponent-property)\n     * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/data-loading#handling-errors-with-routeoptionserrorcomponent)\n     */\n    defaultErrorComponent?: ErrorRouteComponent\n    /**\n     * The default `pendingComponent` a route should use if no pending component is provided.\n     *\n     * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultpendingcomponent-property)\n     * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/data-loading#showing-a-pending-component)\n     */\n    defaultPendingComponent?: RouteComponent\n    /**\n     * The default `notFoundComponent` a route should use if no notFound component is provided.\n     *\n     * @default NotFound\n     * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultnotfoundcomponent-property)\n     * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/not-found-errors#default-router-wide-not-found-handling)\n     */\n    defaultNotFoundComponent?: NotFoundRouteComponent\n    /**\n     * A component that will be used to wrap the entire router.\n     *\n     * This is useful for providing a context to the entire router.\n     *\n     * Only non-DOM-rendering components like providers should be used, anything else will cause a hydration error.\n     *\n     * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#wrap-property)\n     */\n    Wrap?: (props: { children: any }) => React.JSX.Element\n    /**\n     * A component that will be used to wrap the inner contents of the router.\n     *\n     * This is useful for providing a context to the inner contents of the router where you also need access to the router context and hooks.\n     *\n     * Only non-DOM-rendering components like providers should be used, anything else will cause a hydration error.\n     *\n     * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#innerwrap-property)\n     */\n    InnerWrap?: (props: { children: any }) => React.JSX.Element\n\n    /**\n     * The default `onCatch` handler for errors caught by the Router ErrorBoundary\n     *\n     * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultoncatch-property)\n     * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/data-loading#handling-errors-with-routeoptionsoncatch)\n     */\n    defaultOnCatch?: (error: Error, errorInfo: React.ErrorInfo) => void\n  }\n}\n\n/**\n * Creates a new Router instance for React.\n *\n * Pass the returned router to `RouterProvider` to enable routing.\n * Notable options: `routeTree` (your route definitions) and `context`\n * (required if the root route was created with `createRootRouteWithContext`).\n *\n * @param options Router options used to configure the router.\n * @returns A Router instance to be provided to `RouterProvider`.\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/createRouterFunction\n */\n/**\n * Create a new React router instance from `RouterOptions`.\n * Pass the resulting router to `RouterProvider`.\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/createRouterFunction\n */\nexport const createRouter: CreateRouterFn = (options) => {\n  return new Router(options)\n}\n\nexport class Router<\n  in out TRouteTree extends AnyRoute,\n  in out TTrailingSlashOption extends TrailingSlashOption = 'never',\n  in out TDefaultStructuralSharingOption extends boolean = false,\n  in out TRouterHistory extends RouterHistory = RouterHistory,\n  in out TDehydrated extends Record<string, any> = Record<string, any>,\n> extends RouterCore<\n  TRouteTree,\n  TTrailingSlashOption,\n  TDefaultStructuralSharingOption,\n  TRouterHistory,\n  TDehydrated\n> {\n  constructor(\n    options: RouterConstructorOptions<\n      TRouteTree,\n      TTrailingSlashOption,\n      TDefaultStructuralSharingOption,\n      TRouterHistory,\n      TDehydrated\n    >,\n  ) {\n    super(options)\n  }\n}\n\nif (typeof globalThis !== 'undefined') {\n  ;(globalThis as any).createFileRoute = createFileRoute\n  ;(globalThis as any).createLazyFileRoute = createLazyFileRoute\n} else if (typeof window !== 'undefined') {\n  ;(window as any).createFileRoute = createFileRoute\n  ;(window as any).createLazyFileRoute = createLazyFileRoute\n}\n", "import * as React from 'react'\nimport { Matches } from './Matches'\nimport { getRouterContext } from './routerContext'\nimport type {\n  AnyRouter,\n  RegisteredRouter,\n  RouterOptions,\n} from '@tanstack/router-core'\n\n/**\n * Low-level provider that places the router into React context and optionally\n * updates router options from props. Most apps should use `RouterProvider`.\n */\n/**\n * Low-level provider that places the router into React context and optionally\n * updates router options from props. Most apps should use `RouterProvider`.\n */\nexport function RouterContextProvider<\n  TRouter extends AnyRouter = RegisteredRouter,\n  TDehydrated extends Record<string, any> = Record<string, any>,\n>({\n  router,\n  children,\n  ...rest\n}: RouterProps<TRouter, TDehydrated> & {\n  children: React.ReactNode\n}) {\n  if (Object.keys(rest).length > 0) {\n    // Allow the router to update options on the router instance\n    router.update({\n      ...router.options,\n      ...rest,\n      context: {\n        ...router.options.context,\n        ...rest.context,\n      },\n    } as any)\n  }\n\n  const routerContext = getRouterContext()\n\n  const provider = (\n    <routerContext.Provider value={router as AnyRouter}>\n      {children}\n    </routerContext.Provider>\n  )\n\n  if (router.options.Wrap) {\n    return <router.options.Wrap>{provider}</router.options.Wrap>\n  }\n\n  return provider\n}\n\n/**\n * Top-level component that renders the active route matches and provides the\n * router to the React tree via context.\n *\n * Accepts the same options as `createRouter` via props to update the router\n * instance after creation.\n *\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/createRouterFunction\n */\n/**\n * Top-level component that renders the active route matches and provides the\n * router to the React tree via context. Accepts the same options as\n * `createRouter` via props to update the router instance.\n */\nexport function RouterProvider<\n  TRouter extends AnyRouter = RegisteredRouter,\n  TDehydrated extends Record<string, any> = Record<string, any>,\n>({ router, ...rest }: RouterProps<TRouter, TDehydrated>) {\n  return (\n    <RouterContextProvider router={router} {...rest}>\n      <Matches />\n    </RouterContextProvider>\n  )\n}\n\nexport type RouterProps<\n  TRouter extends AnyRouter = RegisteredRouter,\n  TDehydrated extends Record<string, any> = Record<string, any>,\n> = Omit<\n  RouterOptions<\n    TRouter['routeTree'],\n    NonNullable<TRouter['options']['trailingSlash']>,\n    NonNullable<TRouter['options']['defaultStructuralSharing']>,\n    TRouter['history'],\n    TDehydrated\n  >,\n  'context'\n> & {\n  router: TRouter\n  context?: Partial<\n    RouterOptions<\n      TRouter['routeTree'],\n      NonNullable<TRouter['options']['trailingSlash']>,\n      NonNullable<TRouter['options']['defaultStructuralSharing']>,\n      TRouter['history'],\n      TDehydrated\n    >['context']\n  >\n}\n", "import { useRouterState } from './useRouterState'\nimport type {\n  StructuralSharingOption,\n  ValidateSelected,\n} from './structuralSharing'\nimport type {\n  AnyRouter,\n  RegisteredRouter,\n  RouterState,\n} from '@tanstack/router-core'\n\nexport interface UseLocationBaseOptions<\n  TRouter extends AnyRouter,\n  TSelected,\n  TStructuralSharing extends boolean = boolean,\n> {\n  select?: (\n    state: RouterState<TRouter['routeTree']>['location'],\n  ) => ValidateSelected<TRouter, TSelected, TStructuralSharing>\n}\n\nexport type UseLocationResult<\n  TRouter extends AnyRouter,\n  TSelected,\n> = unknown extends TSelected\n  ? RouterState<TRouter['routeTree']>['location']\n  : TSelected\n\n/**\n * Read the current location from the router state with optional selection.\n * Useful for subscribing to just the pieces of location you care about.\n *\n * Options:\n * - `select`: Project the `location` object to a derived value\n * - `structuralSharing`: Enable structural sharing for stable references\n *\n * @returns The current location (or selected value).\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useLocationHook\n */\n/**\n * Read the current location from the router state with optional selection.\n * Useful for subscribing to just the pieces of location you care about.\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useLocationHook\n */\nexport function useLocation<\n  TRouter extends AnyRouter = RegisteredRouter,\n  TSelected = unknown,\n  TStructuralSharing extends boolean = boolean,\n>(\n  opts?: UseLocationBaseOptions<TRouter, TSelected, TStructuralSharing> &\n    StructuralSharingOption<TRouter, TSelected, TStructuralSharing>,\n): UseLocationResult<TRouter, TSelected> {\n  return useRouterState({\n    select: (state: any) =>\n      opts?.select ? opts.select(state.location) : state.location,\n  } as any) as UseLocationResult<TRouter, TSelected>\n}\n", "import { useRouterState } from './useRouterState'\n\nexport function useCanGoBack() {\n  return useRouterState({ select: (s) => s.location.state.__TSR_index !== 0 })\n}\n", "/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.',\n\t\t'@wordpress/route'\n\t);\n", "/**\n * External dependencies\n */\nimport { parseHref } from '@tanstack/history';\nimport {\n\tcreateBrowserHistory,\n\tcreateLazyRoute,\n\tcreateLink,\n\tcreateRootRoute,\n\tcreateRoute,\n\tcreateRouter,\n\tOutlet,\n\tredirect,\n\tRouterProvider,\n\tuseCanGoBack,\n\tuseLoaderData,\n\tuseLocation,\n\tuseMatches,\n\tuseRouter,\n} from '@tanstack/react-router';\n\n/**\n * Internal dependencies\n */\nimport { lock } from './lock-unlock';\n\n/**\n * Private APIs for the boot package only.\n * These are router setup and internal utilities that should not be used\n * by individual routes.\n */\nexport const privateApis = {};\n\n// Lock the private APIs so only authorized modules can access them\nlock( privateApis, {\n\t// Router creation and setup\n\tcreateBrowserHistory,\n\tcreateLazyRoute,\n\tcreateRouter,\n\tcreateRootRoute,\n\tcreateRoute,\n\tOutlet,\n\tRouterProvider,\n\n\t// Internal routing utilities\n\tredirect,\n\tcreateLink,\n\tuseCanGoBack,\n\tuseLoaderData,\n\tuseLocation,\n\tuseMatches,\n\tuseRouter,\n\n\t// History utilities\n\tparseHref,\n} );\n", "/**\n * External dependencies\n */\nimport { useRouter } from '@tanstack/react-router';\nexport {\n\tLink,\n\tredirect,\n\tuseNavigate,\n\tuseParams,\n\tuseSearch,\n} from '@tanstack/react-router';\nexport type {\n\tAnyRoute,\n\tLinkProps,\n\tNavigateOptions,\n\tRouteOptions,\n\tRouterOptions,\n\tToOptions,\n\tUseNavigateResult,\n} from '@tanstack/react-router';\n\n/**\n * Internal dependencies\n */\nexport { privateApis } from './private-apis';\n\n/**\n * Hook to invalidate the router cache and trigger a re-render.\n * This is useful when you want to refetch data without changing the URL.\n *\n * @example\n * ```tsx\n * function MyComponent() {\n *   const invalidate = useInvalidate();\n *\n *   const handleRefresh = () => {\n *     invalidate();\n *   };\n *\n *   return <button onClick={handleRefresh}>Refresh</button>;\n * }\n * ```\n *\n * @return A function to invalidate the router.\n */\nexport function useInvalidate() {\n\tconst router = useRouter();\n\treturn () => router.invalidate();\n}\n"],
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,WAAO,UAAU,OAAO;AAAA;AAAA;;;ACAxB;AAAA;AAAA,WAAO,UAAU,OAAO;AAAA;AAAA;;;ACAxB;AAAA;AAAA;AAWA,KACG,WAAY;AACX,eAAS,GAAG,GAAG,GAAG;AAChB,eAAQ,MAAM,MAAM,MAAM,KAAK,IAAI,MAAM,IAAI,MAAQ,MAAM,KAAK,MAAM;AAAA,MACxE;AACA,eAAS,uBAAuBA,YAAW,aAAa;AACtD,6BACE,WAAWC,QAAM,oBACf,oBAAoB,MACtB,QAAQ;AAAA,UACN;AAAA,QACF;AACF,YAAI,QAA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MAAI,OAAO,QAAQ,MAAM;AACvB,WAAO,8CAAC,OAAO,QAAQ,MAAf,EAAqB,UAAA,SAAA,CAAS;EACxC;AAEA,SAAO;AACT;AAgBO,SAAS,eAGd,EAAE,QAAQ,GAAG,KAAA,GAA2C;AACxD,SAAA,8CACG,uBAAA,EAAsB,QAAiB,GAAG,MACzC,UAAA,8CAAC,SAAA,CAAA,CAAQ,EAAA,CACX;AAEJ;;;ACjCO,SAAS,YAKd,MAEuC;AACvC,SAAO,eAAe;IACpB,QAAQ,CAAC,UACP,MAAM,SAAS,KAAK,OAAO,MAAM,QAAQ,IAAI,MAAM;EAAA,CAC/C;AACV;;;ACtDO,SAAS,eAAe;AAC7B,SAAO,eAAe,EAAE,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,gBAAgB,EAAA,CAAG;AAC7E;;;ACDA,0BAAiE;AAE1D,IAAM,EAAE,MAAM,OAAO,QAC3B;EACC;EACA;AACD;;;ACsBM,IAAM,cAAc,CAAC;AAG5B,KAAM,aAAa;;EAElB;EACA;EACA;EACA;EACA;EACA;EACA;;EAGA;EACA;EACA;EACA;EACA;EACA;EACA;;EAGA;AACD,CAAE;;;ACVK,SAAS,gBAAgB;AAC/B,QAAM,SAAS,UAAU;AACzB,SAAO,MAAM,OAAO,WAAW;AAChC;",
  "names": ["subscribe", "React", "useState", "useLayoutEffect", "useEffect", "React", "useRef", "useEffect", "useMemo", "subscribe", "store", "blockers", "decode", "part", "prefix", "i", "storageKey", "tempSsr", "beforeLoadContext", "match", "redirect", "notFound", "opts", "validateSearch", "search", "next", "options", "lazyFn", "React", "isProduction", "useLayoutEffect", "intersectionObserverOptions", "startTransition", "React", "React", "opts", "useLayoutEffect", "match", "routeId", "key", "routerContext"]
}