@ionic/react-router 8.8.6-dev.11777572994.1147595d → 8.8.6-dev.11777668103.132817bd

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/ReactRouter/IonRouteInner.tsx","../src/ReactRouter/utils/pathMatching.ts","../src/ReactRouter/utils/computeParentPath.ts","../src/ReactRouter/utils/pathNormalization.ts","../src/ReactRouter/utils/routeElements.ts","../src/ReactRouter/utils/viewItemUtils.ts","../src/ReactRouter/ReactRouterViewStack.tsx","../src/ReactRouter/clonePageElement.ts","../src/ReactRouter/StackManager.tsx","../src/ReactRouter/IonRouter.tsx","../src/ReactRouter/IonReactRouter.tsx","../src/ReactRouter/IonReactMemoryRouter.tsx","../src/ReactRouter/IonReactHashRouter.tsx"],"sourcesContent":["import type { IonRouteProps } from '@ionic/react';\nimport React from 'react';\nimport { Route } from 'react-router-dom';\n\nexport const IonRouteInner = ({ path, index, caseSensitive, element }: IonRouteProps) => {\n return <Route path={path} index={index} caseSensitive={caseSensitive} element={element} />;\n};\n","import type { PathMatch } from 'react-router';\nimport { matchPath as reactRouterMatchPath } from 'react-router-dom';\n\n/**\n * Options for the matchPath function.\n */\ninterface MatchPathOptions {\n /**\n * The pathname to match against.\n */\n pathname: string;\n /**\n * The props to match against, they are identical to the matching props `Route` accepts.\n */\n componentProps: {\n path?: string;\n caseSensitive?: boolean;\n end?: boolean;\n index?: boolean;\n };\n}\n\n/**\n * The matchPath function is used only for matching paths, not rendering components or elements.\n * @see https://reactrouter.com/v6/utils/match-path\n */\nexport const matchPath = ({ pathname, componentProps }: MatchPathOptions): PathMatch<string> | null => {\n const { path, index, ...restProps } = componentProps;\n\n // Handle index routes - they match when pathname is empty or just \"/\"\n if (index && !path) {\n if (pathname === '' || pathname === '/') {\n return {\n params: {},\n pathname: pathname,\n pathnameBase: pathname || '/',\n pattern: {\n path: '',\n caseSensitive: false,\n end: true,\n },\n };\n }\n return null;\n }\n\n // Handle empty path routes - they match when pathname is also empty or just \"/\"\n if (path === '' || path === undefined) {\n if (pathname === '' || pathname === '/') {\n return {\n params: {},\n pathname: pathname,\n pathnameBase: pathname || '/',\n pattern: {\n path: '',\n caseSensitive: restProps.caseSensitive ?? false,\n end: restProps.end ?? true,\n },\n };\n }\n return null;\n }\n\n // For relative paths (don't start with '/'), normalize both path and pathname for matching\n if (!path.startsWith('/')) {\n const matchOptions: Parameters<typeof reactRouterMatchPath>[0] = {\n path: `/${path}`,\n ...restProps,\n };\n\n if (matchOptions?.end === undefined) {\n matchOptions.end = !path.endsWith('*');\n }\n\n const normalizedPathname = pathname.startsWith('/') ? pathname : `/${pathname}`;\n const match = reactRouterMatchPath(matchOptions, normalizedPathname);\n\n if (match) {\n // Adjust the match to remove the leading '/' we added\n return {\n ...match,\n pathname: pathname,\n pathnameBase: match.pathnameBase === '/' ? '/' : match.pathnameBase.slice(1),\n pattern: {\n ...match.pattern,\n path: path,\n },\n };\n }\n\n return null;\n }\n\n // For absolute paths, use React Router's matcher directly.\n // React Router v6 routes default to `end: true` unless the pattern\n // explicitly opts into wildcards with `*`. Mirror that behaviour so\n // matching parity stays aligned with <Route>.\n const matchOptions: Parameters<typeof reactRouterMatchPath>[0] = {\n path,\n ...restProps,\n };\n\n if (matchOptions?.end === undefined) {\n matchOptions.end = !path.endsWith('*');\n }\n\n return reactRouterMatchPath(matchOptions, pathname);\n};\n\n/**\n * Determines the portion of a pathname that a given route pattern should match against.\n * For absolute route patterns we return the full pathname. For relative patterns we\n * strip off the already-matched parent segments so React Router receives the remainder.\n */\nexport const derivePathnameToMatch = (fullPathname: string, routePath?: string): string => {\n // For absolute or empty routes, use the full pathname as-is\n if (!routePath || routePath === '' || routePath.startsWith('/')) {\n return fullPathname;\n }\n\n const trimmedPath = fullPathname.startsWith('/') ? fullPathname.slice(1) : fullPathname;\n if (!trimmedPath) {\n // For root-level relative routes (pathname is \"/\" and routePath is relative),\n // return the full pathname so matchPath can normalize both.\n // This allows routes like <Route path=\"foo/*\" .../> at root level to work correctly.\n return fullPathname;\n }\n\n const fullSegments = trimmedPath.split('/').filter(Boolean);\n if (fullSegments.length === 0) {\n return '';\n }\n\n const routeSegments = routePath.split('/').filter(Boolean);\n if (routeSegments.length === 0) {\n return trimmedPath;\n }\n\n const wildcardIndex = routeSegments.findIndex((segment) => segment === '*' || segment === '**');\n\n if (wildcardIndex >= 0) {\n const baseSegments = routeSegments.slice(0, wildcardIndex);\n if (baseSegments.length === 0) {\n return trimmedPath;\n }\n\n const startIndex = fullSegments.findIndex((_, idx) =>\n baseSegments.every((seg, segIdx) => {\n const target = fullSegments[idx + segIdx];\n if (!target) {\n return false;\n }\n if (seg.startsWith(':')) {\n return true;\n }\n return target === seg;\n })\n );\n\n if (startIndex >= 0) {\n return fullSegments.slice(startIndex).join('/');\n }\n }\n\n if (routeSegments.length <= fullSegments.length) {\n return fullSegments.slice(fullSegments.length - routeSegments.length).join('/');\n }\n\n return fullSegments[fullSegments.length - 1] ?? trimmedPath;\n};\n","import type React from 'react';\n\nimport { matchPath } from './pathMatching';\n\n/**\n * Finds the longest common prefix among an array of paths.\n * Used to determine the scope of an outlet with absolute routes.\n *\n * @param paths An array of absolute path strings.\n * @returns The common prefix shared by all paths.\n */\nexport const computeCommonPrefix = (paths: string[]): string => {\n if (paths.length === 0) return '';\n if (paths.length === 1) {\n // For a single path, extract the directory-like prefix\n // e.g., /dynamic-routes/home -> /dynamic-routes\n const segments = paths[0].split('/').filter(Boolean);\n if (segments.length > 1) {\n return '/' + segments.slice(0, -1).join('/');\n }\n return '/' + segments[0];\n }\n\n // Split all paths into segments\n const segmentArrays = paths.map((p) => p.split('/').filter(Boolean));\n const minLength = Math.min(...segmentArrays.map((s) => s.length));\n\n const commonSegments: string[] = [];\n for (let i = 0; i < minLength; i++) {\n const segment = segmentArrays[0][i];\n // Skip segments with route parameters or wildcards\n if (segment.includes(':') || segment.includes('*')) {\n break;\n }\n const allMatch = segmentArrays.every((s) => s[i] === segment);\n if (allMatch) {\n commonSegments.push(segment);\n } else {\n break;\n }\n }\n\n return commonSegments.length > 0 ? '/' + commonSegments.join('/') : '';\n};\n\n/**\n * Checks if a pathname falls within the scope of a mount path using\n * segment-aware comparison. Prevents false positives like \"/tabs-secondary\"\n * matching mount path \"/tabs\".\n */\nexport const isPathnameInScope = (pathname: string, mountPath: string): boolean => {\n if (mountPath === '/') return true;\n return pathname === mountPath || pathname.startsWith(mountPath + '/');\n};\n\n/**\n * Checks if a route path is a \"splat-only\" route (just `*` or `/*`).\n */\nconst isSplatOnlyRoute = (routePath: string | undefined): boolean => {\n return routePath === '*' || routePath === '/*';\n};\n\n/**\n * Checks if a route has an embedded wildcard (e.g., \"tab1/*\" but not \"*\" or \"/*\").\n */\nconst hasEmbeddedWildcard = (routePath: string | undefined): boolean => {\n return !!routePath && routePath.includes('*') && !isSplatOnlyRoute(routePath);\n};\n\n/**\n * Checks if a route with an embedded wildcard matches a pathname.\n */\nconst matchesEmbeddedWildcardRoute = (route: React.ReactElement, pathname: string): boolean => {\n const routePath = route.props.path as string | undefined;\n if (!hasEmbeddedWildcard(routePath)) {\n return false;\n }\n return !!matchPath({ pathname, componentProps: route.props });\n};\n\n/**\n * Checks if a route is a specific match (not wildcard-only or index).\n */\nexport const isSpecificRouteMatch = (route: React.ReactElement, remainingPath: string): boolean => {\n const routePath = route.props.path;\n if (route.props.index || isSplatOnlyRoute(routePath)) {\n return false;\n }\n return !!matchPath({ pathname: remainingPath, componentProps: route.props });\n};\n\n/**\n * Result of parent path computation.\n */\nexport interface ParentPathResult {\n parentPath: string | undefined;\n outletMountPath: string | undefined;\n}\n\ninterface RouteAnalysis {\n hasRelativeRoutes: boolean;\n hasIndexRoute: boolean;\n hasWildcardRoute: boolean;\n routeChildren: React.ReactElement[];\n}\n\n/**\n * Analyzes route children to determine their characteristics.\n *\n * @param routeChildren The route children to analyze.\n * @returns Analysis of the route characteristics.\n */\nexport const analyzeRouteChildren = (routeChildren: React.ReactElement[]): RouteAnalysis => {\n const hasRelativeRoutes = routeChildren.some((route) => {\n const path = route.props.path;\n return path && !path.startsWith('/') && path !== '*';\n });\n\n const hasIndexRoute = routeChildren.some((route) => route.props.index);\n\n const hasWildcardRoute = routeChildren.some((route) => {\n const routePath = route.props.path;\n return routePath === '*' || routePath === '/*';\n });\n\n return { hasRelativeRoutes, hasIndexRoute, hasWildcardRoute, routeChildren };\n};\n\ninterface ComputeParentPathOptions {\n currentPathname: string;\n outletMountPath: string | undefined;\n routeChildren: React.ReactElement[];\n hasRelativeRoutes: boolean;\n hasIndexRoute: boolean;\n hasWildcardRoute: boolean;\n}\n\n/**\n * Checks if any route matches as a specific (non-wildcard, non-index) route.\n */\nconst findSpecificMatch = (routeChildren: React.ReactElement[], remainingPath: string): boolean => {\n return routeChildren.some(\n (route) => isSpecificRouteMatch(route, remainingPath) || matchesEmbeddedWildcardRoute(route, remainingPath)\n );\n};\n\n/**\n * Returns the first route that matches as a specific (non-wildcard, non-index) route.\n */\nconst findFirstSpecificMatchingRoute = (\n routeChildren: React.ReactElement[],\n remainingPath: string\n): React.ReactElement | undefined => {\n return routeChildren.find(\n (route) => isSpecificRouteMatch(route, remainingPath) || matchesEmbeddedWildcardRoute(route, remainingPath)\n );\n};\n\n/**\n * Checks if any specific route could plausibly match the remaining path.\n * Used to determine if we should fall back to a wildcard match.\n *\n * Uses exact first-segment matching: the remaining path's first segment\n * must exactly equal a route's first segment to block the wildcard.\n * The outlet's mount path is always known from React Router's RouteContext,\n * so no heuristic-based discovery is needed.\n */\nconst couldSpecificRouteMatch = (\n routeChildren: React.ReactElement[],\n remainingPath: string\n): boolean => {\n const remainingFirstSegment = remainingPath.split('/')[0];\n\n return routeChildren.some((route) => {\n const routePath = route.props.path as string | undefined;\n if (!routePath || routePath === '*' || routePath === '/*') return false;\n if (route.props.index) return false;\n\n const routeFirstSegment = routePath.split('/')[0].replace(/[*:]/g, '');\n if (!routeFirstSegment) return false;\n\n return routeFirstSegment === remainingFirstSegment;\n });\n};\n\n/**\n * Determines the best parent path from the available matches.\n * Priority: specific > wildcard > index\n */\nconst selectBestMatch = (\n specificMatch: string | undefined,\n wildcardMatch: string | undefined,\n indexMatch: string | undefined\n): string | undefined => {\n return specificMatch ?? wildcardMatch ?? indexMatch;\n};\n\n/**\n * Handles outlets with only absolute routes by computing their common prefix.\n */\nconst computeAbsoluteRoutesParentPath = (\n routeChildren: React.ReactElement[],\n currentPathname: string,\n outletMountPath: string | undefined\n): ParentPathResult | undefined => {\n const absolutePathRoutes = routeChildren.filter((route) => {\n const path = route.props.path;\n return path && path.startsWith('/');\n });\n\n if (absolutePathRoutes.length === 0) {\n return undefined;\n }\n\n const absolutePaths = absolutePathRoutes.map((r) => r.props.path as string);\n const commonPrefix = computeCommonPrefix(absolutePaths);\n\n if (!commonPrefix || commonPrefix === '/') {\n return undefined;\n }\n\n const newOutletMountPath = outletMountPath || commonPrefix;\n\n if (!currentPathname.startsWith(commonPrefix)) {\n return { parentPath: undefined, outletMountPath: newOutletMountPath };\n }\n\n return { parentPath: commonPrefix, outletMountPath: newOutletMountPath };\n};\n\n/**\n * Computes the parent path for a nested outlet based on the current pathname\n * and the outlet's route configuration.\n *\n * When the mount path is known (seeded from React Router's RouteContext), the\n * parent path is simply the mount path — no iterative discovery needed. The\n * iterative fallback only runs for outlets where RouteContext doesn't provide\n * a parent match (typically root-level outlets on first render).\n *\n * @param options The options for computing the parent path.\n * @returns The computed parent path result.\n */\nexport const computeParentPath = (options: ComputeParentPathOptions): ParentPathResult => {\n const { currentPathname, outletMountPath, routeChildren, hasRelativeRoutes, hasIndexRoute, hasWildcardRoute } =\n options;\n\n // If pathname is outside the established mount path scope, skip computation.\n // Use segment-aware comparison: /tabs-secondary must NOT match /tabs scope.\n if (outletMountPath && !isPathnameInScope(currentPathname, outletMountPath)) {\n return { parentPath: undefined, outletMountPath };\n }\n\n // Fast path: when the mount path is known (from React Router's RouteContext),\n // the parent path IS the mount path. The iterative segment-by-segment discovery\n // below was needed when the mount depth had to be guessed from URL structure,\n // but with RouteContext we already know exactly where this outlet is mounted.\n if (outletMountPath && (hasRelativeRoutes || hasIndexRoute)) {\n return { parentPath: outletMountPath, outletMountPath };\n }\n\n // Fallback: mount path not yet known. Iterate through path segments to discover\n // the correct parent depth. This only runs on first render of outlets where\n // RouteContext doesn't provide a parent match (typically root-level outlets,\n // which usually have absolute routes and take the absolute routes path below).\n if (!outletMountPath && (hasRelativeRoutes || hasIndexRoute) && currentPathname.includes('/')) {\n const segments = currentPathname.split('/').filter(Boolean);\n\n if (segments.length >= 1) {\n let firstSpecificMatch: string | undefined;\n let firstWildcardMatch: string | undefined;\n let indexMatchAtMount: string | undefined;\n\n for (let i = 1; i <= segments.length; i++) {\n const parentPath = '/' + segments.slice(0, i).join('/');\n const remainingPath = segments.slice(i).join('/');\n\n // Check for specific route match (highest priority)\n if (!firstSpecificMatch && findSpecificMatch(routeChildren, remainingPath)) {\n // Don't let empty/default path routes (path=\"\" or undefined) drive\n // the parent deeper than a wildcard match. An empty path route matching\n // when remainingPath is \"\" just means all segments were consumed.\n if (firstWildcardMatch) {\n const matchingRoute = findFirstSpecificMatchingRoute(routeChildren, remainingPath);\n if (matchingRoute) {\n const matchingPath = matchingRoute.props.path as string | undefined;\n if (!matchingPath || matchingPath === '') {\n continue;\n }\n }\n }\n\n firstSpecificMatch = parentPath;\n break;\n }\n\n // Check for wildcard match (only if remaining path is non-empty)\n const hasNonEmptyRemaining = remainingPath !== '' && remainingPath !== '/';\n if (!firstWildcardMatch && hasNonEmptyRemaining && hasWildcardRoute) {\n if (!couldSpecificRouteMatch(routeChildren, remainingPath)) {\n firstWildcardMatch = parentPath;\n }\n }\n\n // Check for index route match\n if ((remainingPath === '' || remainingPath === '/') && hasIndexRoute) {\n indexMatchAtMount = parentPath;\n }\n }\n\n // Fallback: check root level for embedded wildcard routes (e.g., \"tab1/*\")\n if (!firstSpecificMatch) {\n const fullRemainingPath = segments.join('/');\n if (routeChildren.some((route) => matchesEmbeddedWildcardRoute(route, fullRemainingPath))) {\n firstSpecificMatch = '/';\n }\n }\n\n const bestPath = selectBestMatch(firstSpecificMatch, firstWildcardMatch, indexMatchAtMount);\n\n return { parentPath: bestPath, outletMountPath: bestPath };\n }\n }\n\n // Handle outlets with only absolute routes\n if (!hasRelativeRoutes && !hasIndexRoute) {\n const result = computeAbsoluteRoutesParentPath(routeChildren, currentPathname, outletMountPath);\n if (result) {\n return result;\n }\n }\n\n return { parentPath: outletMountPath, outletMountPath };\n};\n","/**\n * Ensures the given path has a leading slash.\n *\n * @param value The path string to normalize.\n * @returns The path with a leading slash.\n */\nexport const ensureLeadingSlash = (value: string): string => {\n if (value === '') {\n return '/';\n }\n return value.startsWith('/') ? value : `/${value}`;\n};\n\n/**\n * Strips the trailing slash from a path, unless it's the root path.\n *\n * @param value The path string to normalize.\n * @returns The path without a trailing slash.\n */\nexport const stripTrailingSlash = (value: string): string => {\n return value.length > 1 && value.endsWith('/') ? value.slice(0, -1) : value;\n};\n\n/**\n * Normalizes a pathname for comparison by ensuring a leading slash\n * and removing trailing slashes.\n *\n * @param value The pathname to normalize, can be undefined.\n * @returns A normalized pathname string.\n */\nexport const normalizePathnameForComparison = (value: string | undefined): string => {\n if (!value || value === '') {\n return '/';\n }\n const withLeadingSlash = ensureLeadingSlash(value);\n return stripTrailingSlash(withLeadingSlash);\n};\n","import { IonRoute } from '@ionic/react';\nimport React from 'react';\nimport { Navigate, Route, Routes } from 'react-router-dom';\n\n/**\n * Extracts the children from a Routes wrapper component.\n * The use of `<Routes />` is encouraged with React Router v6.\n *\n * @param node The React node to extract Routes children from.\n * @returns The children of the Routes component, or undefined if not found.\n */\nexport const getRoutesChildren = (node: React.ReactNode): React.ReactNode | undefined => {\n let routesNode: React.ReactNode;\n React.Children.forEach(node as React.ReactElement, (child: React.ReactElement) => {\n if (child.type === Routes) {\n routesNode = child;\n }\n });\n\n if (routesNode) {\n // The children of the `<Routes />` component are most likely\n // (and should be) the `<Route />` components.\n return (routesNode as React.ReactElement).props.children;\n }\n return undefined;\n};\n\n/**\n * Extracts Route children from a node (either directly or from a Routes wrapper).\n *\n * @param children The children to extract routes from.\n * @returns An array of Route elements.\n */\nexport const extractRouteChildren = (children: React.ReactNode): React.ReactElement[] => {\n const routesChildren = getRoutesChildren(children) ?? children;\n return React.Children.toArray(routesChildren).filter(\n (child): child is React.ReactElement =>\n React.isValidElement(child) && (child.type === Route || child.type === IonRoute)\n );\n};\n\n/**\n * Checks if a React element is a Navigate component (redirect).\n *\n * @param element The element to check.\n * @returns True if the element is a Navigate component.\n */\nexport const isNavigateElement = (element: unknown): boolean => {\n return (\n React.isValidElement(element) &&\n (element.type === Navigate || (typeof element.type === 'function' && element.type.name === 'Navigate'))\n );\n};\n","import type { ViewItem } from '@ionic/react';\n\n/**\n * Compares two routes by specificity for sorting (most specific first).\n *\n * Sort order:\n * 1. Index routes come first\n * 2. Wildcard-only routes (* or /*) come last\n * 3. Exact matches (no wildcards/params) before wildcard/param routes\n * 4. Among routes with same status, longer paths are more specific\n */\nexport const compareRouteSpecificity = (\n a: { path: string; index: boolean },\n b: { path: string; index: boolean }\n): number => {\n // Index routes come first\n if (a.index && !b.index) return -1;\n if (!a.index && b.index) return 1;\n\n // Wildcard-only routes (* or /*) should come last\n const aIsWildcardOnly = a.path === '*' || a.path === '/*';\n const bIsWildcardOnly = b.path === '*' || b.path === '/*';\n if (!aIsWildcardOnly && bIsWildcardOnly) return -1;\n if (aIsWildcardOnly && !bIsWildcardOnly) return 1;\n\n // Exact matches (no wildcards/params) come before wildcard/param routes\n const aHasWildcard = a.path.includes('*') || a.path.includes(':');\n const bHasWildcard = b.path.includes('*') || b.path.includes(':');\n if (!aHasWildcard && bHasWildcard) return -1;\n if (aHasWildcard && !bHasWildcard) return 1;\n\n // Among routes with same wildcard status, longer paths are more specific\n if (a.path.length !== b.path.length) {\n return b.path.length - a.path.length;\n }\n\n return 0;\n};\n\n/**\n * Sorts view items by route specificity (most specific first).\n *\n * Sort order aligns with findViewItemByPath in ReactRouterViewStack.tsx:\n * 1. Index routes come first\n * 2. Wildcard-only routes (* or /*) come last\n * 3. Exact matches (no wildcards/params) come before wildcard/param routes\n * 4. Among routes with same wildcard status, longer paths are more specific\n *\n * @param views The view items to sort.\n * @returns A new sorted array of view items.\n */\nexport const sortViewsBySpecificity = (views: ViewItem[]): ViewItem[] => {\n return [...views].sort((a, b) =>\n compareRouteSpecificity(\n { path: a.routeData?.childProps?.path || '', index: !!a.routeData?.childProps?.index },\n { path: b.routeData?.childProps?.path || '', index: !!b.routeData?.childProps?.index }\n )\n );\n};\n","/**\n * `ReactRouterViewStack` is a custom navigation manager used in Ionic React\n * apps to map React Router route elements (such as `<IonRoute>`) to \"view\n * items\" that Ionic can manage in a view stack. This is critical to maintain\n * Ionic’s animation, lifecycle, and history behavior across views.\n */\n\nimport type { RouteInfo, ViewItem } from '@ionic/react';\nimport { generateId, IonRoute, ViewLifeCycleManager, ViewStacks } from '@ionic/react';\nimport React from 'react';\nimport type { PathMatch } from 'react-router';\nimport { Navigate, UNSAFE_RouteContext as RouteContext } from 'react-router-dom';\n\nimport { analyzeRouteChildren, computeParentPath } from './utils/computeParentPath';\nimport { derivePathnameToMatch, matchPath } from './utils/pathMatching';\nimport { normalizePathnameForComparison } from './utils/pathNormalization';\nimport { extractRouteChildren, isNavigateElement } from './utils/routeElements';\nimport { sortViewsBySpecificity } from './utils/viewItemUtils';\n\n/**\n * Delay in milliseconds before removing a Navigate view item after a redirect.\n * This ensures the redirect navigation completes before the view is removed.\n */\nconst NAVIGATE_REDIRECT_DELAY_MS = 100;\n\n/**\n * Delay in milliseconds before cleaning up a view without an IonPage element.\n * This double-checks that the view is truly not needed before removal.\n */\nconst VIEW_CLEANUP_DELAY_MS = 200;\n\ntype RouteParams = Record<string, string | undefined>;\n\ntype RouteContextMatch = {\n params: RouteParams;\n pathname: string;\n pathnameBase: string;\n route: {\n id: string;\n path?: string;\n element: React.ReactNode;\n index: boolean;\n caseSensitive?: boolean;\n hasErrorBoundary: boolean;\n };\n};\n\n/**\n * Computes the absolute pathnameBase for a route element based on its type.\n * Handles relative paths, index routes, and splat routes differently.\n */\nconst computeAbsolutePathnameBase = (\n routeElement: React.ReactElement,\n routeMatch: PathMatch<string> | undefined,\n parentPathnameBase: string,\n routeInfoPathname: string\n): string => {\n const routePath = routeElement.props.path;\n const isRelativePath = routePath && !routePath.startsWith('/');\n const isIndexRoute = !!routeElement.props.index;\n const isSplatOnlyRoute = routePath === '*' || routePath === '/*';\n\n if (isSplatOnlyRoute) {\n // Splat routes should NOT contribute their matched portion to pathnameBase\n // This aligns with React Router v7's v7_relativeSplatPath behavior\n return parentPathnameBase;\n }\n\n if (isRelativePath && routeMatch?.pathnameBase) {\n const relativeBase = routeMatch.pathnameBase.startsWith('/')\n ? routeMatch.pathnameBase.slice(1)\n : routeMatch.pathnameBase;\n return parentPathnameBase === '/' ? `/${relativeBase}` : `${parentPathnameBase}/${relativeBase}`;\n }\n\n if (isIndexRoute) {\n return parentPathnameBase;\n }\n\n return routeMatch?.pathnameBase || routeInfoPathname;\n};\n\n/**\n * Gets fallback params from view items in other outlets when parent context is empty.\n * This handles cases where React context propagation doesn't work as expected.\n */\nconst getFallbackParamsFromViewItems = (\n allViewItems: ViewItem[],\n currentOutletId: string,\n currentPathname: string\n): RouteParams => {\n const matchingViews: { params: RouteParams; pathLength: number }[] = [];\n\n for (const otherViewItem of allViewItems) {\n if (otherViewItem.outletId === currentOutletId) continue;\n\n const otherMatch = otherViewItem.routeData?.match;\n if (otherMatch?.params && Object.keys(otherMatch.params).length > 0) {\n const matchedPathname = otherMatch.pathnameBase || otherMatch.pathname;\n if (matchedPathname && currentPathname.startsWith(matchedPathname)) {\n matchingViews.push({\n params: otherMatch.params,\n pathLength: matchedPathname.length,\n });\n }\n }\n }\n\n // Sort ascending by path length so more-specific (longer) paths are applied\n // last and their params take priority over less-specific ones.\n matchingViews.sort((a, b) => a.pathLength - b.pathLength);\n\n const params: RouteParams = {};\n for (const view of matchingViews) {\n Object.assign(params, view.params);\n }\n\n return params;\n};\n\n/**\n * Builds the matches array for RouteContext.\n */\nconst buildContextMatches = (\n parentMatches: RouteContextMatch[],\n combinedParams: RouteParams,\n routeMatch: PathMatch<string> | undefined,\n routeInfoPathname: string,\n absolutePathnameBase: string,\n viewItem: ViewItem,\n routeElement: React.ReactElement,\n componentElement: React.ReactNode\n): RouteContextMatch[] => {\n return [\n ...parentMatches,\n {\n params: combinedParams,\n pathname: routeMatch?.pathname || routeInfoPathname,\n pathnameBase: absolutePathnameBase,\n route: {\n id: viewItem.id,\n path: routeElement.props.path,\n element: componentElement,\n index: !!routeElement.props.index,\n caseSensitive: routeElement.props.caseSensitive,\n hasErrorBoundary: false,\n },\n },\n ];\n};\n\nconst createDefaultMatch = (\n fullPathname: string,\n routeProps: { path?: string; caseSensitive?: boolean; end?: boolean; index?: boolean }\n): PathMatch<string> => {\n const isIndexRoute = !!routeProps.index;\n const patternPath = routeProps.path ?? '';\n const pathnameBase = fullPathname === '' ? '/' : fullPathname;\n const computedEnd =\n routeProps.end !== undefined ? routeProps.end : patternPath !== '' ? !patternPath.endsWith('*') : true;\n\n return {\n params: {},\n pathname: isIndexRoute ? '' : fullPathname,\n pathnameBase,\n pattern: {\n path: patternPath,\n caseSensitive: routeProps.caseSensitive ?? false,\n end: isIndexRoute ? true : computedEnd,\n },\n };\n};\n\nconst computeRelativeToParent = (pathname: string, parentPath?: string): string | null => {\n if (!parentPath) return null;\n const normalizedParent = normalizePathnameForComparison(parentPath);\n const normalizedPathname = normalizePathnameForComparison(pathname);\n\n if (normalizedPathname === normalizedParent) {\n return '';\n }\n\n const withSlash = normalizedParent === '/' ? '/' : normalizedParent + '/';\n if (normalizedPathname.startsWith(withSlash)) {\n return normalizedPathname.slice(withSlash.length);\n }\n return null;\n};\n\nconst resolveIndexRouteMatch = (\n viewItem: ViewItem,\n pathname: string,\n parentPath?: string\n): PathMatch<string> | null => {\n if (!viewItem.routeData?.childProps?.index) {\n return null;\n }\n\n // Prefer computing against the parent path when available to align with RRv6 semantics\n const relative = computeRelativeToParent(pathname, parentPath);\n if (relative !== null) {\n // Index routes match only when there is no remaining path\n if (relative === '' || relative === '/') {\n return createDefaultMatch(parentPath || pathname, viewItem.routeData.childProps);\n }\n return null;\n }\n\n // Fallback: use previously computed match base for equality check\n const previousMatch = viewItem.routeData?.match;\n if (!previousMatch) {\n return null;\n }\n\n const normalizedPathname = normalizePathnameForComparison(pathname);\n const normalizedBase = normalizePathnameForComparison(previousMatch.pathnameBase || previousMatch.pathname || '');\n\n return normalizedPathname === normalizedBase ? previousMatch : null;\n};\n\nexport class ReactRouterViewStack extends ViewStacks {\n /**\n * Stores the computed parent path for each outlet.\n * Used by findViewItemByPath to correctly evaluate index route matches\n * without requiring the outlet's React element or route children.\n */\n private outletParentPaths = new Map<string, string>();\n\n /**\n * Stores the computed mount path for each outlet.\n * Fed back into computeParentPath on subsequent calls to stabilize\n * the parent path computation across navigations (mirrors StackManager.outletMountPath).\n */\n private outletMountPaths = new Map<string, string>();\n\n constructor() {\n super();\n }\n\n /**\n * Creates a new view item for the given outlet and react route element.\n * Associates route props with the matched route path for further lookups.\n */\n createViewItem = (outletId: string, reactElement: React.ReactElement, routeInfo: RouteInfo, page?: HTMLElement) => {\n const routePath = reactElement.props.path || '';\n\n // Check if we already have a view item for this exact route that we can reuse\n // Include wildcard routes like tabs/* since they should be reused\n // Also check unmounted items that might have been preserved for browser navigation\n const existingViewItem = this.getViewItemsForOutlet(outletId).find((v) => {\n const existingRouteProps = v.reactElement?.props ?? {};\n const existingPath = existingRouteProps.path || '';\n const existingElement = existingRouteProps.element;\n const newElement = reactElement.props.element;\n const existingIsIndexRoute = !!existingRouteProps.index;\n const newIsIndexRoute = !!reactElement.props.index;\n\n // For Navigate components, match by destination\n const existingIsNavigate = React.isValidElement(existingElement) && existingElement.type === Navigate;\n const newIsNavigate = React.isValidElement(newElement) && newElement.type === Navigate;\n if (existingIsNavigate && newIsNavigate) {\n const existingTo = (existingElement.props as { to?: string })?.to;\n const newTo = (newElement.props as { to?: string })?.to;\n if (existingTo === newTo) {\n return true;\n }\n }\n\n if (existingIsIndexRoute && newIsIndexRoute) {\n return true;\n }\n\n // Reuse view items with the same path\n // Special case: reuse tabs/* and other specific wildcard routes\n // Don't reuse index routes (empty path) or generic catch-all wildcards (*)\n if (existingPath === routePath && existingPath !== '' && existingPath !== '*') {\n // Parameterized routes need pathname matching to ensure /details/1 and /details/2\n // get separate view items. For wildcard routes (e.g., user/:userId/*), compare\n // pathnameBase to allow child path changes while preserving the parent view.\n const hasParams = routePath.includes(':');\n const isWildcard = routePath.includes('*');\n if (hasParams) {\n if (isWildcard) {\n const existingPathnameBase = v.routeData?.match?.pathnameBase;\n const newMatch = matchComponent(reactElement, routeInfo.pathname, false, this.outletParentPaths.get(outletId));\n const newPathnameBase = newMatch?.pathnameBase;\n if (existingPathnameBase !== newPathnameBase) {\n return false;\n }\n } else {\n const existingPathname = v.routeData?.match?.pathname;\n if (existingPathname !== routeInfo.pathname) {\n return false;\n }\n }\n }\n return true;\n }\n // Also reuse specific wildcard routes like tabs/*\n if (existingPath === routePath && existingPath.endsWith('/*') && existingPath !== '/*') {\n return true;\n }\n return false;\n });\n\n if (existingViewItem) {\n // Update and ensure the existing view item is properly configured\n existingViewItem.reactElement = reactElement;\n existingViewItem.mount = true;\n existingViewItem.ionPageElement = page || existingViewItem.ionPageElement;\n const updatedMatch =\n matchComponent(reactElement, routeInfo.pathname, false, this.outletParentPaths.get(outletId)) ||\n existingViewItem.routeData?.match ||\n createDefaultMatch(routeInfo.pathname, reactElement.props);\n\n existingViewItem.routeData = {\n match: updatedMatch,\n childProps: reactElement.props,\n lastPathname: existingViewItem.routeData?.lastPathname, // Preserve navigation history\n };\n return existingViewItem;\n }\n\n const id = `${outletId}-${generateId(outletId)}`;\n\n const viewItem: ViewItem = {\n id,\n outletId,\n ionPageElement: page,\n reactElement,\n mount: true,\n ionRoute: true,\n };\n\n if (reactElement.type === IonRoute) {\n viewItem.disableIonPageManagement = reactElement.props.disableIonPageManagement;\n }\n\n const initialMatch =\n matchComponent(reactElement, routeInfo.pathname, true, this.outletParentPaths.get(outletId)) ||\n createDefaultMatch(routeInfo.pathname, reactElement.props);\n\n viewItem.routeData = {\n match: initialMatch,\n childProps: reactElement.props,\n };\n\n this.add(viewItem);\n\n return viewItem;\n };\n\n /**\n * Renders a ViewLifeCycleManager for the given view item.\n * Handles cleanup if the view no longer matches.\n *\n * - Deactivates view if it no longer matches the current route\n * - Wraps the route element in <Routes> to support nested routing and ensure remounting\n * - Adds a unique key to <Routes> so React Router remounts routes when switching\n */\n private renderViewItem = (viewItem: ViewItem, routeInfo: RouteInfo, parentPath?: string, reRender?: () => void) => {\n const routePath = viewItem.reactElement.props.path || '';\n let match = matchComponent(viewItem.reactElement, routeInfo.pathname, false, parentPath);\n\n if (!match) {\n const indexMatch = resolveIndexRouteMatch(viewItem, routeInfo.pathname, parentPath);\n if (indexMatch) {\n match = indexMatch;\n }\n }\n\n // For parameterized routes, check if this is a navigation to a different path instance\n // In that case, we should NOT reuse this view - a new view should be created\n const isParameterRoute = routePath.includes(':');\n const previousMatch = viewItem.routeData?.match;\n const isSamePath = match?.pathname === previousMatch?.pathname;\n\n // Flag to indicate this view should not be reused for this different parameterized path\n const shouldSkipForDifferentParam = isParameterRoute && match && previousMatch && !isSamePath;\n\n // Don't deactivate views automatically - let the StackManager handle view lifecycle\n // This preserves views in the stack for navigation history like native apps\n // Views will be hidden/shown by the StackManager's transition logic instead of being unmounted\n\n // Special handling for Navigate components - they should unmount after redirecting\n const elementComponent = viewItem.reactElement?.props?.element;\n const isNavigateComponent = isNavigateElement(elementComponent);\n\n if (isNavigateComponent) {\n // Navigate components should only be mounted when they match\n // Once they redirect (no longer match), they should be removed completely\n // IMPORTANT: For index routes, we need to check indexMatch too since matchComponent\n // may not properly match index routes without explicit parent path context\n const indexMatch = viewItem.routeData?.childProps?.index\n ? resolveIndexRouteMatch(viewItem, routeInfo.pathname, parentPath)\n : null;\n const hasValidMatch = match || indexMatch;\n\n if (!hasValidMatch && viewItem.mount) {\n viewItem.mount = false;\n // Schedule removal of the Navigate view item after a short delay\n // This ensures the redirect completes before removal\n setTimeout(() => {\n this.remove(viewItem);\n reRender?.();\n }, NAVIGATE_REDIRECT_DELAY_MS);\n }\n }\n\n // Components that don't have IonPage elements and no longer match should be cleaned up\n // BUT we need to be careful not to remove them if they're part of browser navigation history\n // This handles components that perform immediate actions like programmatic navigation\n // EXCEPTION: Navigate components should ALWAYS remain mounted until they redirect\n // since they need to be rendered to trigger the navigation\n if (!match && viewItem.mount && !viewItem.ionPageElement && !isNavigateComponent) {\n // Check if this view item should be preserved for browser navigation\n // We'll keep it if it was recently active (within the last navigation)\n const shouldPreserve =\n viewItem.routeData.lastPathname === routeInfo.pathname ||\n viewItem.routeData.match?.pathname === routeInfo.lastPathname;\n\n if (!shouldPreserve) {\n // This view item doesn't match and doesn't have an IonPage\n // It's likely a utility component that performs an action and navigates away\n viewItem.mount = false;\n // Schedule removal to allow it to be recreated on next navigation\n setTimeout(() => {\n // Double-check before removing - the view might be needed again\n const stillNotNeeded = !viewItem.mount && !viewItem.ionPageElement;\n if (stillNotNeeded) {\n this.remove(viewItem);\n reRender?.();\n }\n }, VIEW_CLEANUP_DELAY_MS);\n } else {\n // Preserve it but unmount it for now\n viewItem.mount = false;\n }\n }\n\n // Reactivate view if it matches but was previously deactivated\n // Don't reactivate if this is a parameterized route navigating to a different path instance\n // Don't reactivate catch-all wildcard routes — they are created fresh by createViewItem\n const isCatchAllWildcard = routePath === '*' || routePath === '/*';\n if (match && !viewItem.mount && !shouldSkipForDifferentParam && !isCatchAllWildcard) {\n viewItem.mount = true;\n viewItem.routeData.match = match;\n }\n\n // Deactivate wildcard (catch-all) and empty-path (default) routes when a more-specific route matches.\n // This prevents \"Not found\" or fallback pages from showing alongside valid routes.\n if (routePath === '*' || routePath === '') {\n // Check if any other view in this outlet has a match for the current route\n const outletViews = this.getViewItemsForOutlet(viewItem.outletId);\n\n // When parent path context is available, compute the relative pathname once\n // outside the loop since both routeInfo.pathname and parentPath are invariant.\n const relativePathname = parentPath\n ? computeRelativeToParent(routeInfo.pathname, parentPath)\n : null;\n\n let hasSpecificMatch = outletViews.some((v) => {\n if (v.id === viewItem.id) return false; // Skip self\n const vRoutePath = v.reactElement?.props?.path || '';\n if (vRoutePath === '*' || vRoutePath === '') return false; // Skip other wildcard/empty routes\n\n // When parent path context is available and the route is relative, use\n // parent-path-aware matching. This avoids false positives from\n // derivePathnameToMatch's tail-slice heuristic, which can incorrectly\n // match route literals that appear at the wrong position in the pathname.\n // Example: pathname /parent/extra/details/99 with route details/:id —\n // the tail-slice extracts [\"details\",\"99\"] producing a false match.\n if (parentPath && vRoutePath && !vRoutePath.startsWith('/')) {\n if (relativePathname === null) {\n return false; // Pathname is outside this outlet's parent scope\n }\n return !!matchPath({\n pathname: relativePathname,\n componentProps: v.reactElement.props,\n });\n }\n\n // Fallback to matchComponent when no parent path context is available\n const vMatch = v.reactElement ? matchComponent(v.reactElement, routeInfo.pathname) : null;\n return !!vMatch;\n });\n\n // For catch-all * routes, also deactivate when the pathname matches the outlet's\n // parent path exactly. This means there are no remaining segments for the wildcard\n // to catch, so the empty-path or index route should handle it instead.\n if (!hasSpecificMatch && routePath === '*') {\n const outletParentPath = this.outletParentPaths.get(viewItem.outletId);\n if (outletParentPath) {\n const normalizedParent = normalizePathnameForComparison(outletParentPath);\n const normalizedPathname = normalizePathnameForComparison(routeInfo.pathname);\n if (normalizedPathname === normalizedParent) {\n // Check if there's an empty-path or index view item that should handle this\n const hasDefaultRoute = outletViews.some((v) => {\n if (v.id === viewItem.id) return false;\n const vRoutePath = v.reactElement?.props?.path;\n return vRoutePath === '' || vRoutePath === undefined || !!v.routeData?.childProps?.index;\n });\n if (hasDefaultRoute) {\n hasSpecificMatch = true;\n }\n }\n }\n }\n\n if (hasSpecificMatch) {\n viewItem.mount = false;\n if (viewItem.ionPageElement) {\n viewItem.ionPageElement.classList.add('ion-page-hidden');\n viewItem.ionPageElement.setAttribute('aria-hidden', 'true');\n }\n }\n }\n\n const routeElement = React.cloneElement(viewItem.reactElement);\n const componentElement = routeElement.props.element;\n // Don't update match for parameterized routes navigating to different path instances\n // This preserves the original match so that findViewItemByPath can correctly skip this view\n if (match && viewItem.routeData.match !== match && !shouldSkipForDifferentParam) {\n viewItem.routeData.match = match;\n }\n const routeMatch = shouldSkipForDifferentParam ? viewItem.routeData?.match : match || viewItem.routeData?.match;\n\n return (\n <RouteContext.Consumer key={`view-context-${viewItem.id}`}>\n {(parentContext) => {\n const parentMatches = (parentContext?.matches ?? []) as RouteContextMatch[];\n\n // Accumulate params from parent matches, with fallback to other outlets\n let accumulatedParentParams = parentMatches.reduce<RouteParams>((acc, m) => ({ ...acc, ...m.params }), {});\n if (parentMatches.length === 0 && Object.keys(accumulatedParentParams).length === 0) {\n accumulatedParentParams = getFallbackParamsFromViewItems(\n this.getAllViewItems(),\n viewItem.outletId,\n routeInfo.pathname\n );\n }\n\n const combinedParams = { ...accumulatedParentParams, ...(routeMatch?.params ?? {}) };\n const parentPathnameBase =\n parentMatches.length > 0 ? parentMatches[parentMatches.length - 1].pathnameBase : '/';\n const absolutePathnameBase = computeAbsolutePathnameBase(\n routeElement,\n routeMatch,\n parentPathnameBase,\n routeInfo.pathname\n );\n\n const contextMatches = buildContextMatches(\n parentMatches,\n combinedParams,\n routeMatch,\n routeInfo.pathname,\n absolutePathnameBase,\n viewItem,\n routeElement,\n componentElement\n );\n\n const routeContextValue = parentContext\n ? { ...parentContext, matches: contextMatches }\n : { outlet: null, matches: contextMatches, isDataRoute: false };\n\n return (\n <ViewLifeCycleManager\n key={`view-${viewItem.id}`}\n mount={viewItem.mount}\n removeView={() => this.remove(viewItem)}\n >\n <RouteContext.Provider value={routeContextValue}>{componentElement}</RouteContext.Provider>\n </ViewLifeCycleManager>\n );\n }}\n </RouteContext.Consumer>\n );\n };\n\n /**\n * Re-renders all active view items for the specified outlet.\n * Ensures React elements are updated with the latest match.\n *\n * 1. Iterates through children of IonRouterOutlet\n * 2. Updates each matching viewItem with the current child React element\n * (important for updating props or changes to elements)\n * 3. Returns a list of React components that will be rendered inside the outlet\n * Each view is wrapped in <ViewLifeCycleManager> to manage lifecycle and rendering\n */\n getChildrenToRender = (\n outletId: string,\n ionRouterOutlet: React.ReactElement,\n routeInfo: RouteInfo,\n reRender: () => void,\n parentPathnameBase?: string\n ) => {\n const viewItems = this.getViewItemsForOutlet(outletId);\n\n // Seed the mount path from the parent route context if available.\n // This provides the outlet's mount path immediately on first render,\n // eliminating the need for heuristic-based discovery in computeParentPath.\n if (parentPathnameBase && !this.outletMountPaths.has(outletId)) {\n this.outletMountPaths.set(outletId, parentPathnameBase);\n }\n\n // Determine parentPath for outlets with relative or index routes.\n // This populates outletParentPaths for findViewItemByPath's matchView\n // and the catch-all deactivation logic in renderViewItem.\n let parentPath: string | undefined = undefined;\n try {\n const routeChildren = extractRouteChildren(ionRouterOutlet.props.children);\n const { hasRelativeRoutes, hasIndexRoute, hasWildcardRoute } = analyzeRouteChildren(routeChildren);\n\n if (hasRelativeRoutes || hasIndexRoute) {\n const result = computeParentPath({\n currentPathname: routeInfo.pathname,\n outletMountPath: this.outletMountPaths.get(outletId),\n routeChildren,\n hasRelativeRoutes,\n hasIndexRoute,\n hasWildcardRoute,\n });\n parentPath = result.parentPath;\n\n // Persist the mount path for subsequent calls, mirroring StackManager.outletMountPath.\n // Unlike outletParentPaths (cleared when parentPath is undefined), the mount path is\n // intentionally sticky — it anchors the outlet's scope and is only removed in clear().\n if (result.outletMountPath && !this.outletMountPaths.has(outletId)) {\n this.outletMountPaths.set(outletId, result.outletMountPath);\n }\n }\n } catch (e) {\n // Non-fatal: if we fail to compute parentPath, fall back to previous behavior\n }\n\n // Store the computed parentPath for use in findViewItemByPath.\n // Clear stale entries when parentPath is undefined (e.g., navigated out of scope).\n if (parentPath !== undefined) {\n this.outletParentPaths.set(outletId, parentPath);\n } else if (this.outletParentPaths.has(outletId)) {\n this.outletParentPaths.delete(outletId);\n }\n\n // Sync child elements with stored viewItems (e.g. to reflect new props)\n React.Children.forEach(ionRouterOutlet.props.children, (child: React.ReactElement) => {\n // Ensure the child is a valid React element since we\n // might have whitespace strings or other non-element children\n if (React.isValidElement(child)) {\n // Find view item by exact path match to avoid wildcard routes overwriting specific routes\n const childPath = (child.props as any).path;\n const viewItem = viewItems.find((v) => {\n const viewItemPath = v.reactElement?.props?.path;\n // Only update if paths match exactly (prevents wildcard routes from overwriting specific routes)\n return viewItemPath === childPath;\n });\n if (viewItem) {\n viewItem.reactElement = child;\n }\n }\n });\n\n // Filter out duplicate view items by ID (but keep all mounted items)\n const uniqueViewItems = viewItems.filter((viewItem, index, array) => {\n // Remove duplicates by ID (keep first occurrence)\n const isFirstOccurrence = array.findIndex((v) => v.id === viewItem.id) === index;\n return isFirstOccurrence;\n });\n\n // Filter out unmounted Navigate components to prevent them from being rendered\n // and triggering unwanted redirects\n const renderableViewItems = uniqueViewItems.filter((viewItem) => {\n const elementComponent = viewItem.reactElement?.props?.element;\n const isNavigateComponent = isNavigateElement(elementComponent);\n\n // Exclude unmounted Navigate components from rendering\n if (isNavigateComponent && !viewItem.mount) {\n return false;\n }\n\n // Filter out views that are unmounted, have no ionPageElement, and don't match the current route.\n // These are \"stale\" views from previous routes that should not be rendered.\n // Views WITH ionPageElement are handled by the normal lifecycle events.\n // Views that MATCH the current route should be kept (they might be transitioning).\n if (!viewItem.mount && !viewItem.ionPageElement) {\n // Check if this view's route path matches the current pathname\n const viewRoutePath = viewItem.reactElement?.props?.path as string | undefined;\n if (viewRoutePath) {\n // First try exact match using matchComponent\n const routeMatch = matchComponent(viewItem.reactElement, routeInfo.pathname, false, parentPath);\n if (routeMatch) {\n // View matches current route, keep it\n return true;\n }\n\n // For parent routes (like /multiple-tabs or /routing), check if current pathname\n // starts with this route's path. This handles views with IonSplitPane/IonTabs\n // that don't have IonPage but should remain mounted while navigating within their children.\n const normalizedViewPath = normalizePathnameForComparison(viewRoutePath.replace(/\\/?\\*$/, '')); // Remove trailing wildcard\n const normalizedCurrentPath = normalizePathnameForComparison(routeInfo.pathname);\n\n // Check if current pathname is within this view's route hierarchy\n const isWithinRouteHierarchy =\n normalizedCurrentPath === normalizedViewPath || normalizedCurrentPath.startsWith(normalizedViewPath + '/');\n\n if (!isWithinRouteHierarchy) {\n // View is outside current route hierarchy, remove it\n setTimeout(() => {\n this.remove(viewItem);\n reRender();\n }, 0);\n return false;\n }\n }\n }\n\n return true;\n });\n\n const renderedItems = renderableViewItems.map((viewItem) =>\n this.renderViewItem(viewItem, routeInfo, parentPath, reRender)\n );\n return renderedItems;\n };\n\n /**\n * Finds a view item matching the current route, optionally updating its match state.\n */\n findViewItemByRouteInfo = (routeInfo: RouteInfo, outletId?: string, updateMatch?: boolean) => {\n const { viewItem, match } = this.findViewItemByPath(routeInfo.pathname, outletId);\n const shouldUpdateMatch = updateMatch === undefined || updateMatch === true;\n if (shouldUpdateMatch && viewItem && match) {\n viewItem.routeData.match = match;\n }\n return viewItem;\n };\n\n /**\n * Finds the view item that was previously active before a route change.\n */\n findLeavingViewItemByRouteInfo = (routeInfo: RouteInfo, outletId?: string, mustBeIonRoute = true) => {\n // If the lastPathname is not set, we cannot find a leaving view item\n if (!routeInfo.lastPathname) {\n return undefined;\n }\n\n const { viewItem } = this.findViewItemByPath(routeInfo.lastPathname, outletId, mustBeIonRoute);\n return viewItem;\n };\n\n /**\n * Finds a view item by pathname only, used in simpler queries.\n */\n findViewItemByPathname = (pathname: string, outletId?: string) => {\n const { viewItem } = this.findViewItemByPath(pathname, outletId);\n return viewItem;\n };\n\n /**\n * Core function that matches a given pathname against all view items.\n * Returns both the matched view item and match metadata.\n */\n private findViewItemByPath(pathname: string, outletId?: string, mustBeIonRoute?: boolean, allowDefaultMatch = true) {\n let viewItem: ViewItem | undefined;\n let match: PathMatch<string> | null = null;\n let viewStack: ViewItem[];\n // Capture stored parent paths for use in nested matchView/matchDefaultRoute functions\n const storedParentPaths = this.outletParentPaths;\n\n if (outletId) {\n viewStack = sortViewsBySpecificity(this.getViewItemsForOutlet(outletId));\n viewStack.some(matchView);\n if (!viewItem && allowDefaultMatch) viewStack.some(matchDefaultRoute);\n } else {\n const viewItems = sortViewsBySpecificity(this.getAllViewItems());\n viewItems.some(matchView);\n if (!viewItem && allowDefaultMatch) viewItems.some(matchDefaultRoute);\n }\n\n // If we still have not found a view item for this outlet, try to find a matching\n // view item across all outlets and adopt it into the current outlet. This helps\n // recover when an outlet remounts and receives a new id, leaving views associated\n // with the previous outlet id.\n // Do not adopt across outlets; if we didn't find a view for this outlet,\n // defer to route matching to create a new one.\n\n return { viewItem, match };\n\n /**\n * Matches a route path with dynamic parameters (e.g. /tabs/:id)\n */\n function matchView(v: ViewItem) {\n if (mustBeIonRoute && !v.ionRoute) return false;\n\n const viewItemPath = v.routeData.childProps.path || '';\n\n // Skip unmounted catch-all wildcard views. After back navigation unmounts\n // a wildcard view, it should not be reused for subsequent navigations.\n // A fresh wildcard view will be created by createViewItem when needed.\n if ((viewItemPath === '*' || viewItemPath === '/*') && !v.mount) return false;\n\n const isIndexRoute = !!v.routeData.childProps.index;\n const previousMatch = v.routeData?.match;\n const outletParentPath = storedParentPaths.get(v.outletId);\n const result = v.reactElement ? matchComponent(v.reactElement, pathname, false, outletParentPath) : null;\n\n if (!result) {\n const indexMatch = resolveIndexRouteMatch(v, pathname, outletParentPath);\n if (indexMatch) {\n match = indexMatch;\n viewItem = v;\n return true;\n }\n\n // Empty path routes (path=\"\") should match when the pathname matches the\n // outlet's parent path exactly (no remaining segments). matchComponent doesn't\n // handle this because it lacks parent path context. Without this check, a\n // catch-all * view item (which matches any pathname) would be incorrectly\n // returned instead of the empty path route on back navigation.\n if (viewItemPath === '' && !isIndexRoute && outletParentPath) {\n const normalizedParent = normalizePathnameForComparison(outletParentPath);\n const normalizedPathname = normalizePathnameForComparison(pathname);\n if (normalizedPathname === normalizedParent) {\n match = createDefaultMatch(pathname, v.routeData.childProps);\n viewItem = v;\n return true;\n }\n }\n }\n\n if (result) {\n const hasParams = result.params && Object.keys(result.params).length > 0;\n const isSamePath = result.pathname === previousMatch?.pathname;\n const isWildcardRoute = viewItemPath.includes('*');\n const isParameterRoute = viewItemPath.includes(':');\n\n // Don't allow view items with undefined paths to match specific routes\n // This prevents broken index route view items from interfering with navigation\n if (!viewItemPath && !isIndexRoute && pathname !== '/' && pathname !== '') {\n return false;\n }\n\n // For parameterized routes, check if we should reuse the view item.\n // Wildcard routes (e.g., user/:userId/*) compare pathnameBase to allow\n // child path changes while preserving the parent view.\n if (isParameterRoute && !isSamePath) {\n if (isWildcardRoute) {\n const isSameBase = result.pathnameBase === previousMatch?.pathnameBase;\n if (isSameBase) {\n match = result;\n viewItem = v;\n return true;\n }\n }\n return false;\n }\n\n // For routes without params, or when navigating to the exact same path,\n // or when there's no previous match, reuse the view item\n if (!hasParams || isSamePath || !previousMatch) {\n match = result;\n viewItem = v;\n return true;\n }\n\n // For pure wildcard routes (without : params), compare pathnameBase to allow\n // child path changes while preserving the parent view. This handles container\n // routes like /tabs/* where switching between /tabs/tab1 and /tabs/tab2\n // should reuse the same ViewItem.\n if (isWildcardRoute && !isParameterRoute) {\n const isSameBase = result.pathnameBase === previousMatch?.pathnameBase;\n if (isSameBase) {\n match = result;\n viewItem = v;\n return true;\n }\n }\n }\n\n return false;\n }\n\n /**\n * Matches a view with no path prop (default fallback route) or index route.\n */\n function matchDefaultRoute(v: ViewItem): boolean {\n const childProps = v.routeData.childProps;\n\n const isDefaultRoute = childProps.path === undefined || childProps.path === '';\n const isIndexRoute = !!childProps.index;\n\n if (isIndexRoute) {\n const outletParentPath = storedParentPaths.get(v.outletId);\n const indexMatch = resolveIndexRouteMatch(v, pathname, outletParentPath);\n if (indexMatch) {\n match = indexMatch;\n viewItem = v;\n return true;\n }\n return false;\n }\n\n // For empty path routes, only match if we're at the same level as when the view was created.\n // This prevents an empty path view item from being reused for different routes.\n if (isDefaultRoute) {\n const previousPathnameBase = v.routeData?.match?.pathnameBase || '';\n const normalizedBase = normalizePathnameForComparison(previousPathnameBase);\n const normalizedPathname = normalizePathnameForComparison(pathname);\n\n if (normalizedPathname !== normalizedBase) {\n return false;\n }\n\n match = {\n params: {},\n pathname,\n pathnameBase: pathname === '' ? '/' : pathname,\n pattern: {\n path: '',\n caseSensitive: childProps.caseSensitive ?? false,\n end: true,\n },\n };\n viewItem = v;\n return true;\n }\n\n return false;\n }\n }\n\n /**\n * Clean up old, unmounted view items to prevent memory leaks\n */\n private cleanupStaleViewItems = (outletId: string) => {\n const viewItems = this.getViewItemsForOutlet(outletId);\n\n // Keep only the most recent mounted views and a few unmounted ones for history\n const maxUnmountedItems = 3;\n const unmountedItems = viewItems.filter((v) => !v.mount);\n\n if (unmountedItems.length > maxUnmountedItems) {\n // Remove oldest unmounted items\n const itemsToRemove = unmountedItems.slice(0, unmountedItems.length - maxUnmountedItems);\n itemsToRemove.forEach((item) => {\n this.remove(item);\n });\n }\n };\n\n /**\n * Override add to prevent duplicate view items with the same ID in the same outlet\n * But allow multiple view items for the same route path (for navigation history)\n */\n add = (viewItem: ViewItem) => {\n const existingViewItem = this.getViewItemsForOutlet(viewItem.outletId).find((v) => v.id === viewItem.id);\n\n if (existingViewItem) {\n return;\n }\n\n super.add(viewItem);\n\n this.cleanupStaleViewItems(viewItem.outletId);\n };\n\n /**\n * Override clear to also clean up the stored parent path for the outlet.\n */\n clear = (outletId: string) => {\n this.outletParentPaths.delete(outletId);\n this.outletMountPaths.delete(outletId);\n return super.clear(outletId);\n };\n\n /**\n * Override remove\n */\n remove = (viewItem: ViewItem) => {\n super.remove(viewItem);\n };\n}\n\n/**\n * Utility to apply matchPath to a React element and return its match state.\n */\nfunction matchComponent(node: React.ReactElement, pathname: string, allowFallback = false, parentPath?: string) {\n const routeProps = node?.props ?? {};\n const routePath: string | undefined = routeProps.path;\n\n let pathnameToMatch: string;\n if (parentPath && routePath && !routePath.startsWith('/')) {\n // When parent path is known, compute exact relative pathname\n // instead of using the tail-slice heuristic\n const relative = pathname.startsWith(parentPath)\n ? pathname.slice(parentPath.length).replace(/^\\//, '')\n : pathname;\n pathnameToMatch = relative;\n } else {\n pathnameToMatch = derivePathnameToMatch(pathname, routePath);\n }\n\n const match = matchPath({\n pathname: pathnameToMatch,\n componentProps: routeProps,\n });\n\n if (match || !allowFallback) {\n return match;\n }\n\n const isIndexRoute = !!routeProps.index;\n\n if (isIndexRoute) {\n return createDefaultMatch(pathname, routeProps);\n }\n\n if (!routePath || routePath === '') {\n return createDefaultMatch(pathname, routeProps);\n }\n\n return null;\n}\n","export function clonePageElement(leavingViewHtml: string | HTMLElement) {\n let html: string;\n if (typeof leavingViewHtml === 'string') {\n html = leavingViewHtml;\n } else {\n html = leavingViewHtml.outerHTML;\n }\n if (document) {\n const newEl = document.createElement('div');\n newEl.innerHTML = html;\n newEl.style.zIndex = '';\n // Remove an existing back button so the new element doesn't get two of them\n const ionBackButton = newEl.getElementsByTagName('ion-back-button');\n if (ionBackButton[0]) {\n ionBackButton[0].remove();\n }\n return newEl.firstChild as HTMLElement;\n }\n return undefined;\n}\n","/**\n * `StackManager` is responsible for managing page transitions, keeping track\n * of views (pages), and ensuring that navigation behaves like native apps —\n * particularly with animations and swipe gestures.\n */\n\nimport type { RouteInfo, StackContextState, ViewItem } from '@ionic/react';\nimport { IonRoute, RouteManagerContext, StackContext, generateId, getConfig } from '@ionic/react';\nimport React from 'react';\nimport type { RouteObject } from 'react-router-dom';\nimport { Route, UNSAFE_RouteContext as RouteContext, matchRoutes } from 'react-router-dom';\n\nimport { clonePageElement } from './clonePageElement';\nimport {\n analyzeRouteChildren,\n computeCommonPrefix,\n computeParentPath,\n isPathnameInScope,\n} from './utils/computeParentPath';\nimport { derivePathnameToMatch, matchPath } from './utils/pathMatching';\nimport { stripTrailingSlash } from './utils/pathNormalization';\nimport { extractRouteChildren, getRoutesChildren, isNavigateElement } from './utils/routeElements';\n\n/**\n * Delay in milliseconds before unmounting a view after a transition completes.\n * This ensures the page transition animation finishes before the view is removed.\n */\nconst VIEW_UNMOUNT_DELAY_MS = 250;\n\n/**\n * Delay (ms) to wait for an IonPage to mount before proceeding with a\n * page transition. Only container routes (nested outlets with no direct\n * IonPage) actually hit this timeout; normal routes clear it early via\n * registerIonPage, so a larger value here doesn't affect the happy path.\n */\nconst ION_PAGE_WAIT_TIMEOUT_MS = 300;\n\ninterface StackManagerProps {\n routeInfo: RouteInfo;\n id?: string;\n}\n\nconst isViewVisible = (el: HTMLElement) =>\n !el.classList.contains('ion-page-invisible') && !el.classList.contains('ion-page-hidden') && el.style.visibility !== 'hidden';\n\nconst hideIonPageElement = (element: HTMLElement | undefined): void => {\n if (element) {\n if (element.id === 'section-a' || element.id === 'section-b') {\n // eslint-disable-next-line no-console\n console.log('[HideIonPageElement]', JSON.stringify({\n id: element.id,\n stack: new Error().stack?.split('\\n').slice(1, 6).map((s) => s.trim()),\n }));\n }\n element.classList.add('ion-page-hidden');\n element.setAttribute('aria-hidden', 'true');\n }\n};\n\nconst showIonPageElement = (element: HTMLElement | undefined): void => {\n if (element) {\n element.style.removeProperty('visibility');\n // core transitions (md.transition.ts, ios.transition.ts) leave inline styles\n // on the leaving page after animation: `display: none` plus the final\n // keyframe values for `transform` and `opacity` (MD only). Preserved views\n // must clear all of these on re-entry so they render in the correct\n // position when the back direction entering animation is a no-op.\n element.style.removeProperty('display');\n element.style.removeProperty('transform');\n element.style.removeProperty('opacity');\n element.classList.remove('ion-page-hidden');\n element.removeAttribute('aria-hidden');\n }\n};\n\n/**\n * Variant of `showIonPageElement` for the swipe-back gesture start. Clears\n * `display: none` and the hidden class/attribute so the entering view is\n * visible, but intentionally keeps any inline `transform` and `opacity` set\n * by core's prior forward transition. The gesture's progress animation starts\n * from that pose, so clearing them here would cause a visible jump before\n * core's progress animation takes over.\n */\nconst revealIonPageForSwipeBack = (element: HTMLElement | undefined): void => {\n if (element) {\n const before = {\n id: element.id,\n inlineDisplay: element.style.display,\n hasHiddenClass: element.classList.contains('ion-page-hidden'),\n ariaHidden: element.getAttribute('aria-hidden'),\n computedDisplay: getComputedStyle(element).display,\n };\n element.style.removeProperty('display');\n element.classList.remove('ion-page-hidden');\n element.removeAttribute('aria-hidden');\n // eslint-disable-next-line no-console\n console.log('[SwipeBackReveal]', JSON.stringify({\n before,\n after: {\n inlineDisplay: element.style.display,\n hasHiddenClass: element.classList.contains('ion-page-hidden'),\n ariaHidden: element.getAttribute('aria-hidden'),\n computedDisplay: getComputedStyle(element).display,\n },\n }));\n } else {\n // eslint-disable-next-line no-console\n console.log('[SwipeBackReveal] element is undefined');\n }\n};\n\n/**\n * A leaf view is \"preservable\" on browser-back (pop) when its React state\n * should survive a forward-pop round-trip. Non-parameterized leaf paths\n * resolve to the same view item on re-entry, so keeping them mounted retains\n * user-visible state (scroll, inputs, cleared lists, etc.).\n *\n * Excluded:\n * - Parameterized routes (`/users/:id`): each param value gets a distinct\n * view item, so preserving them accumulates hidden views in the DOM.\n * - Wildcard container routes (`/tabs/*`, `*`): wrap nested outlets and must\n * be destroyed so nested outlet state rebuilds cleanly on re-entry.\n */\nconst isViewItemPreservableOnPop = (viewItem: ViewItem | undefined): boolean => {\n const path = viewItem?.reactElement?.props?.path as string | undefined;\n if (!path) {\n return false;\n }\n if (path === '*' || path.endsWith('/*')) {\n return false;\n }\n return !path.includes(':');\n};\n\nexport class StackManager extends React.PureComponent<StackManagerProps> {\n id: string; // Unique id for the router outlet aka outletId\n context!: React.ContextType<typeof RouteManagerContext>;\n ionRouterOutlet?: React.ReactElement;\n routerOutletElement: HTMLIonRouterOutletElement | undefined;\n prevProps?: StackManagerProps;\n skipTransition: boolean;\n\n stackContextValue: StackContextState = {\n registerIonPage: this.registerIonPage.bind(this),\n isInOutlet: () => true,\n };\n\n private pendingPageTransition = false;\n private waitingForIonPage = false;\n private ionPageWaitTimeout?: ReturnType<typeof setTimeout>;\n private outOfScopeUnmountTimeout?: ReturnType<typeof setTimeout>;\n /** Whether this outlet was previously in scope. */\n private wasInScope = true;\n /**\n * Track the last transition's entering and leaving view IDs to prevent\n * duplicate transitions during rapid navigation (e.g., Navigate redirects)\n */\n private lastTransition?: { enteringId: string; leavingId?: string };\n /**\n * Views that have been explicitly kept alive by the pop-preserve logic\n * (shouldPreserveLeavingView) so a future forward-pop can restore their React\n * state. These are candidates for cleanup when a fresh push invalidates the\n * forward-history path that made them reachable. Views mounted through\n * normal forward-push (which keeps the leaving view alive by default) are\n * NOT tracked here.\n */\n private preservedViewItems = new Set<ViewItem>();\n /** Tracks whether the component is mounted to guard async transition paths. */\n private _isMounted = false;\n /** In-flight requestAnimationFrame IDs from transitionPage, cancelled on unmount. */\n private transitionRafIds: number[] = [];\n /** In-flight MutationObserver from waitForComponentsReady, disconnected on unmount. */\n private transitionObserver?: MutationObserver;\n /**\n * Monotonically increasing counter incremented at the start of each transitionPage call.\n * Used to detect when an async commit() resolves after a newer transition has already run,\n * preventing the stale commit from hiding an element that the newer transition made visible.\n */\n private transitionGeneration = 0;\n /**\n * The entering element of the most recent transitionPage call.\n * Used alongside transitionGeneration to undo incorrect ion-page-hidden applied\n * by a stale animated commit that raced with a newer non-animated transition.\n */\n private transitionEnteringElement?: HTMLElement;\n\n constructor(props: StackManagerProps) {\n super(props);\n this.registerIonPage = this.registerIonPage.bind(this);\n this.transitionPage = this.transitionPage.bind(this);\n this.handlePageTransition = this.handlePageTransition.bind(this);\n this.id = props.id || `routerOutlet-${generateId('routerOutlet')}`;\n this.prevProps = undefined;\n this.skipTransition = false;\n }\n\n private outletMountPath: string | undefined = undefined;\n /**\n * Whether this outlet is at the root level (no parent route matches).\n * Derived from UNSAFE_RouteContext in render() — empty matches means root.\n */\n private isRootOutlet = true;\n\n /**\n * Determines the parent path for nested routing in React Router 6.\n *\n * When the mount path is known (seeded from UNSAFE_RouteContext), returns\n * it directly — no iterative discovery needed. The computeParentPath\n * fallback only runs for root outlets where RouteContext doesn't provide\n * a parent match.\n */\n private getParentPath(): string | undefined {\n const currentPathname = this.props.routeInfo.pathname;\n\n // Prevent out-of-scope outlets from adopting unrelated routes.\n // Uses segment-aware comparison: /tabs-secondary must NOT match /tabs scope.\n if (this.outletMountPath && !isPathnameInScope(currentPathname, this.outletMountPath)) {\n return undefined;\n }\n\n // Fast path: mount path is known from RouteContext. The parent path IS the\n // mount path — no need to run the iterative computeParentPath algorithm.\n if (this.outletMountPath && !this.isRootOutlet) {\n return this.outletMountPath;\n }\n\n // Fallback: root outlet or mount path not yet seeded. Run the full\n // computeParentPath algorithm to discover the parent depth.\n if (this.ionRouterOutlet) {\n const routeChildren = extractRouteChildren(this.ionRouterOutlet.props.children);\n const { hasRelativeRoutes, hasIndexRoute, hasWildcardRoute } = analyzeRouteChildren(routeChildren);\n\n if (!this.isRootOutlet || hasRelativeRoutes || hasIndexRoute) {\n const result = computeParentPath({\n currentPathname,\n outletMountPath: this.outletMountPath,\n routeChildren,\n hasRelativeRoutes,\n hasIndexRoute,\n hasWildcardRoute,\n });\n\n if (result.outletMountPath && !this.outletMountPath) {\n this.outletMountPath = result.outletMountPath;\n }\n\n return result.parentPath;\n }\n }\n\n return this.outletMountPath;\n }\n\n /**\n * Finds the entering and leaving view items, handling redirect cases.\n */\n private findViewItems(routeInfo: RouteInfo): {\n enteringViewItem: ViewItem | undefined;\n leavingViewItem: ViewItem | undefined;\n } {\n const enteringViewItem = this.context.findViewItemByRouteInfo(routeInfo, this.id);\n let leavingViewItem = this.context.findLeavingViewItemByRouteInfo(routeInfo, this.id);\n\n // Try to find leaving view by previous pathname\n if (!leavingViewItem && routeInfo.prevRouteLastPathname) {\n leavingViewItem = this.context.findViewItemByPathname(routeInfo.prevRouteLastPathname, this.id);\n }\n\n // For redirects where entering === leaving, find the actual previous view\n if (\n enteringViewItem &&\n leavingViewItem &&\n enteringViewItem === leavingViewItem &&\n routeInfo.routeAction === 'replace' &&\n routeInfo.prevRouteLastPathname\n ) {\n const actualLeavingView = this.context.findViewItemByPathname(routeInfo.prevRouteLastPathname, this.id);\n if (actualLeavingView && actualLeavingView !== enteringViewItem) {\n leavingViewItem = actualLeavingView;\n }\n }\n\n // Handle redirect scenario with no leaving view\n if (\n enteringViewItem &&\n !leavingViewItem &&\n routeInfo.routeAction === 'replace' &&\n routeInfo.prevRouteLastPathname\n ) {\n const actualLeavingView = this.context.findViewItemByPathname(routeInfo.prevRouteLastPathname, this.id);\n if (actualLeavingView && actualLeavingView !== enteringViewItem) {\n leavingViewItem = actualLeavingView;\n }\n }\n\n return { enteringViewItem, leavingViewItem };\n }\n\n private shouldUnmountLeavingView(\n routeInfo: RouteInfo,\n enteringViewItem: ViewItem | undefined,\n leavingViewItem: ViewItem | undefined\n ): boolean {\n if (!leavingViewItem) {\n return false;\n }\n\n if (routeInfo.routeAction === 'replace') {\n const leavingRoutePath = leavingViewItem?.reactElement?.props?.path as string | undefined;\n\n // Never unmount root path or views without a path - needed for back navigation\n if (!leavingRoutePath || leavingRoutePath === '/' || leavingRoutePath === '') {\n return false;\n }\n\n // Replace actions unmount the leaving view since it's being replaced in history.\n return true;\n }\n\n // For non-replace actions, only unmount for back navigation\n const isForwardPush = routeInfo.routeAction === 'push' && (routeInfo as any).routeDirection === 'forward';\n if (!isForwardPush && routeInfo.routeDirection !== 'none' && enteringViewItem !== leavingViewItem) {\n return true;\n }\n\n return false;\n }\n\n /**\n * Handles out-of-scope outlet. Returns true if transition should be aborted.\n */\n private handleOutOfScopeOutlet(routeInfo: RouteInfo): boolean {\n if (!this.outletMountPath || isPathnameInScope(routeInfo.pathname, this.outletMountPath)) {\n this.wasInScope = true;\n // Cancel any pending deferred unmount from a previous out-of-scope transition.\n if (this.outOfScopeUnmountTimeout) {\n clearTimeout(this.outOfScopeUnmountTimeout);\n this.outOfScopeUnmountTimeout = undefined;\n }\n return false;\n }\n\n // Only run the out-of-scope cleanup on the first transition out of scope.\n // When parameterized routes create multiple StackManager instances with the\n // same outlet ID, a stale (hidden) instance must not destroy views that an\n // active instance just created. After the initial cleanup, the stale instance\n // stays dormant until its mount path becomes in-scope again.\n if (!this.wasInScope) {\n return true;\n }\n this.wasInScope = false;\n\n // For ionPage outlets whose parent outlet has swipe-to-go-back enabled,\n // preserve child views so they remain visible during the swipe gesture.\n // Without this, the deferred unmount removes child pages before the gesture\n // starts, showing an empty shell when swiping back. Views are cleaned up\n // when the parent outlet pops this view (componentWillUnmount -> clearOutlet).\n //\n // Lifecycle events are skipped in this branch because the view stays mounted\n // and visible. Firing ionViewWillLeave/DidLeave here would be asymmetric with\n // no matching ionViewWillEnter/DidEnter when the view comes back in scope.\n const isIonPageOutlet = this.routerOutletElement?.classList.contains('ion-page');\n if (isIonPageOutlet) {\n const parentOutlet = this.routerOutletElement?.parentElement?.closest<HTMLIonRouterOutletElement>('ion-router-outlet');\n if (parentOutlet?.swipeGesture === true) {\n this.dismissPresentedOverlays();\n return true;\n }\n }\n\n // Fire lifecycle events on any visible view before unmounting.\n // When navigating away from a tabbed section, the parent outlet fires\n // ionViewDidLeave on the tabs container, but the active tab child page\n // never receives its own lifecycle events because the core transition\n // dispatches events with bubbles:false. This ensures tab child pages\n // get ionViewWillLeave/ionViewDidLeave so useIonViewDidLeave fires.\n const allViewsInOutlet = this.context.getViewItemsForOutlet(this.id);\n allViewsInOutlet.forEach((viewItem) => {\n if (viewItem.ionPageElement && isViewVisible(viewItem.ionPageElement)) {\n viewItem.ionPageElement.dispatchEvent(\n new CustomEvent('ionViewWillLeave', { bubbles: false, cancelable: false })\n );\n viewItem.ionPageElement.dispatchEvent(\n new CustomEvent('ionViewDidLeave', { bubbles: false, cancelable: false })\n );\n }\n });\n\n // Defer removal of view items to allow the parent outlet's leaving-page\n // animation to complete with content still visible. When the nested outlet\n // unmounts views immediately, React removes the child DOM elements before\n // the parent's transition animation can render them. On MD mode the back\n // animation only animates the leaving page (slide down + fade), so an\n // empty shell is invisible and the transition appears instant.\n //\n // VIEW_UNMOUNT_DELAY_MS exceeds the MD back transition (200ms).\n this.outOfScopeUnmountTimeout = setTimeout(() => {\n if (!this._isMounted) return;\n allViewsInOutlet.forEach((viewItem) => {\n this.context.unMountViewItem(viewItem);\n });\n this.forceUpdate();\n }, VIEW_UNMOUNT_DELAY_MS);\n\n return true;\n }\n\n /**\n * Handles root navigation by unmounting all non-entering views in this outlet.\n * Fires ionViewWillLeave / ionViewDidLeave only on views that are currently visible.\n * Views that are mounted but not visible (e.g., pages earlier in the back stack)\n * are silently unmounted without lifecycle events, consistent with the behavior\n * of out-of-scope outlet cleanup.\n */\n private handleRootNavigation(enteringViewItem: ViewItem | undefined): void {\n const allViewsInOutlet = this.context.getViewItemsForOutlet(this.id);\n allViewsInOutlet.forEach((viewItem) => {\n if (viewItem === enteringViewItem) {\n return;\n }\n if (viewItem.ionPageElement && isViewVisible(viewItem.ionPageElement)) {\n viewItem.ionPageElement.dispatchEvent(\n new CustomEvent('ionViewWillLeave', { bubbles: false, cancelable: false })\n );\n viewItem.ionPageElement.dispatchEvent(\n new CustomEvent('ionViewDidLeave', { bubbles: false, cancelable: false })\n );\n }\n this.context.unMountViewItem(viewItem);\n });\n }\n\n /**\n * Handles nested outlet with relative routes but no parent path. Returns true to abort.\n */\n private handleOutOfContextNestedOutlet(\n parentPath: string | undefined,\n leavingViewItem: ViewItem | undefined\n ): boolean {\n if (this.isRootOutlet || parentPath !== undefined || !this.ionRouterOutlet) {\n return false;\n }\n\n const routesChildren =\n getRoutesChildren(this.ionRouterOutlet.props.children) ?? this.ionRouterOutlet.props.children;\n const routeChildren = React.Children.toArray(routesChildren).filter(\n (child): child is React.ReactElement =>\n React.isValidElement(child) && (child.type === Route || child.type === IonRoute)\n );\n\n const hasRelativeRoutes = routeChildren.some((route) => {\n const path = route.props.path;\n return path && !path.startsWith('/') && path !== '*';\n });\n\n if (hasRelativeRoutes) {\n hideIonPageElement(leavingViewItem?.ionPageElement);\n if (leavingViewItem) {\n leavingViewItem.mount = false;\n }\n this.forceUpdate();\n return true;\n }\n\n return false;\n }\n\n /**\n * Handles nested outlet with no matching route. Returns true to abort.\n */\n private handleNoMatchingRoute(\n enteringRoute: React.ReactElement | undefined,\n enteringViewItem: ViewItem | undefined,\n leavingViewItem: ViewItem | undefined\n ): boolean {\n if (this.isRootOutlet || enteringRoute || enteringViewItem) {\n return false;\n }\n\n hideIonPageElement(leavingViewItem?.ionPageElement);\n if (leavingViewItem) {\n leavingViewItem.mount = false;\n }\n this.forceUpdate();\n return true;\n }\n\n /**\n * Handles transition when entering view has ion-page element ready.\n */\n private handleReadyEnteringView(\n routeInfo: RouteInfo,\n enteringViewItem: ViewItem,\n leavingViewItem: ViewItem | undefined,\n shouldUnmountLeavingViewItem: boolean\n ): void {\n const routePath = enteringViewItem.reactElement?.props?.path as string | undefined;\n const isParameterizedRoute = routePath ? routePath.includes(':') : false;\n const isWildcardContainerRoute = routePath ? routePath.endsWith('/*') : false;\n\n // Handle same-view transitions (parameterized routes like /user/:id or container routes like /tabs/*)\n // When entering === leaving, the view is already visible - skip transition to prevent flash\n if (enteringViewItem === leavingViewItem) {\n if (isParameterizedRoute || isWildcardContainerRoute) {\n const updatedMatch = matchComponent(enteringViewItem.reactElement, routeInfo.pathname, true, this.outletMountPath);\n if (updatedMatch) {\n enteringViewItem.routeData.match = updatedMatch;\n }\n\n const enteringEl = enteringViewItem.ionPageElement;\n if (enteringEl) {\n showIonPageElement(enteringEl);\n enteringEl.classList.remove('ion-page-invisible');\n\n // Maintain can-go-back state since we skip transitionPage/commit.\n // Without this, the back button disappears on re-navigation to a\n // parameterized route within a nested outlet (e.g. welcome -> item -> back -> item).\n if (routeInfo.pushedByRoute) {\n enteringEl.classList.add('can-go-back');\n } else {\n enteringEl.classList.remove('can-go-back');\n }\n }\n\n this.forceUpdate();\n return;\n }\n }\n\n // For wildcard container routes, check if we're navigating within the same container.\n // If both the current pathname and the previous pathname match the same container route,\n // skip the transition - the nested outlet will handle the actual page change.\n // This handles cases where leavingViewItem lookup fails (e.g., no IonPage wrapper).\n if (isWildcardContainerRoute && routeInfo.lastPathname) {\n // routePath is guaranteed to exist since isWildcardContainerRoute checks routePath?.endsWith('/*')\n const containerBase = routePath!.replace(/\\/\\*$/, '');\n const currentInContainer =\n routeInfo.pathname.startsWith(containerBase + '/') || routeInfo.pathname === containerBase;\n const previousInContainer =\n routeInfo.lastPathname.startsWith(containerBase + '/') || routeInfo.lastPathname === containerBase;\n\n if (currentInContainer && previousInContainer) {\n const updatedMatch = matchComponent(enteringViewItem.reactElement, routeInfo.pathname, true, this.outletMountPath);\n if (updatedMatch) {\n enteringViewItem.routeData.match = updatedMatch;\n }\n this.forceUpdate();\n return;\n }\n }\n\n if (!leavingViewItem && this.props.routeInfo.prevRouteLastPathname) {\n leavingViewItem = this.context.findViewItemByPathname(this.props.routeInfo.prevRouteLastPathname, this.id);\n }\n\n // Re-mount views that were previously unmounted (e.g., navigating back to home)\n if (!enteringViewItem.mount) {\n enteringViewItem.mount = true;\n }\n // A view that becomes the entering view is no longer a stale preserved view.\n // It's back in the active navigation path, so drop it from the cleanup set.\n this.preservedViewItems.delete(enteringViewItem);\n\n // Check visibility state BEFORE showing entering view\n const enteringWasVisible = enteringViewItem.ionPageElement && isViewVisible(enteringViewItem.ionPageElement);\n const leavingIsHidden =\n leavingViewItem !== undefined && leavingViewItem.ionPageElement && !isViewVisible(leavingViewItem.ionPageElement);\n\n const currentTransition = {\n enteringId: enteringViewItem.id,\n leavingId: leavingViewItem?.id,\n };\n\n const isDuplicateTransition =\n leavingViewItem &&\n this.lastTransition &&\n this.lastTransition.leavingId &&\n this.lastTransition.enteringId === currentTransition.enteringId &&\n this.lastTransition.leavingId === currentTransition.leavingId;\n\n // Skip if transition already performed (e.g., via swipe gesture)\n if (enteringWasVisible && leavingIsHidden && isDuplicateTransition) {\n if (\n this.skipTransition &&\n shouldUnmountLeavingViewItem &&\n leavingViewItem &&\n enteringViewItem !== leavingViewItem\n ) {\n leavingViewItem.mount = false;\n // Trigger ionViewDidLeave lifecycle for ViewLifeCycleManager cleanup\n this.transitionPage(routeInfo, enteringViewItem, leavingViewItem, 'back');\n }\n this.skipTransition = false;\n this.forceUpdate();\n return;\n }\n\n showIonPageElement(enteringViewItem.ionPageElement);\n\n // Handle duplicate transition or swipe gesture completion\n if (isDuplicateTransition || this.skipTransition) {\n if (\n this.skipTransition &&\n shouldUnmountLeavingViewItem &&\n leavingViewItem &&\n enteringViewItem !== leavingViewItem\n ) {\n leavingViewItem.mount = false;\n // Re-fire ionViewDidLeave since gesture completed before mount=false was set\n this.transitionPage(routeInfo, enteringViewItem, leavingViewItem, 'back');\n }\n this.skipTransition = false;\n this.forceUpdate();\n return;\n }\n\n this.lastTransition = currentTransition;\n\n const shouldSkipAnimation = this.applySkipAnimationIfNeeded(enteringViewItem, leavingViewItem);\n\n this.transitionPage(routeInfo, enteringViewItem, leavingViewItem, undefined, false, shouldSkipAnimation);\n\n if (shouldUnmountLeavingViewItem && leavingViewItem && enteringViewItem !== leavingViewItem) {\n // For replace actions, skip setting mount=false here. handleLeavingViewUnmount\n // sets it only after its container-to-container guard passes, avoiding zombie state.\n //\n // For pop (browser back) on preservable routes (see isViewItemPreservableOnPop),\n // keep the view alive (hidden by the transition) so its React state survives a\n // forward-pop round-trip. ionViewDidLeave already fired via the transitionPage()\n // call above. Swipe-to-go-back still destroys views through the skipTransition\n // path earlier in this method, matching native gesture behavior.\n //\n // handleLeavingViewUnmount below is a no-op for non-replace actions (early return),\n // so pop-preserved views pass through it untouched.\n const shouldPreserveLeavingView =\n routeInfo.routeAction === 'pop' && isViewItemPreservableOnPop(leavingViewItem);\n if (routeInfo.routeAction !== 'replace' && !shouldPreserveLeavingView) {\n leavingViewItem.mount = false;\n } else if (shouldPreserveLeavingView) {\n this.preservedViewItems.add(leavingViewItem);\n }\n this.handleLeavingViewUnmount(routeInfo, enteringViewItem, leavingViewItem);\n }\n\n // Clean up orphaned sibling views after replace actions (redirects)\n this.cleanupOrphanedSiblingViews(routeInfo, enteringViewItem, leavingViewItem);\n\n // On a fresh push, browser forward history is invalidated. Any views we\n // previously preserved on pop (to support forward navigation) are now\n // unreachable and should be unmounted so they don't accumulate in the DOM.\n this.cleanupPreservedViewsOnPush(routeInfo, enteringViewItem, leavingViewItem);\n }\n\n /**\n * Unmounts views previously kept alive by the pop-preserve logic when a fresh\n * push invalidates the forward-history path that made them reachable. Only\n * iterates views explicitly tracked in `preservedViewItems` so that views\n * naturally mounted through forward-push (the default leaving-view behavior)\n * are left untouched.\n */\n private cleanupPreservedViewsOnPush(\n routeInfo: RouteInfo,\n enteringViewItem: ViewItem,\n leavingViewItem: ViewItem | undefined\n ): void {\n if (routeInfo.routeAction !== 'push') {\n return;\n }\n if (this.preservedViewItems.size === 0) {\n return;\n }\n\n for (const viewItem of Array.from(this.preservedViewItems)) {\n if (viewItem === enteringViewItem || viewItem === leavingViewItem) {\n this.preservedViewItems.delete(viewItem);\n continue;\n }\n if (!viewItem.mount) {\n this.preservedViewItems.delete(viewItem);\n continue;\n }\n viewItem.mount = false;\n this.preservedViewItems.delete(viewItem);\n const viewToUnmount = viewItem;\n setTimeout(() => {\n // Skip if a follow-up transition re-entered the view (mount flipped back to true).\n if (viewToUnmount.mount) {\n return;\n }\n this.context.unMountViewItem(viewToUnmount);\n this.forceUpdate();\n }, VIEW_UNMOUNT_DELAY_MS);\n }\n }\n\n /**\n * Handles leaving view unmount for replace actions.\n */\n private handleLeavingViewUnmount(routeInfo: RouteInfo, enteringViewItem: ViewItem, leavingViewItem: ViewItem): void {\n // Only replace actions unmount views; push/pop cache for navigation history\n if (routeInfo.routeAction !== 'replace') {\n return;\n }\n\n if (!leavingViewItem.ionPageElement) {\n leavingViewItem.mount = false;\n const viewToUnmount = leavingViewItem;\n setTimeout(() => {\n // Skip if a follow-up transition re-entered the view (mount flipped back to true).\n if (viewToUnmount.mount) {\n return;\n }\n this.context.unMountViewItem(viewToUnmount);\n this.forceUpdate();\n }, VIEW_UNMOUNT_DELAY_MS);\n return;\n }\n\n const enteringRoutePath = enteringViewItem.reactElement?.props?.path as string | undefined;\n const leavingRoutePath = leavingViewItem.reactElement?.props?.path as string | undefined;\n const isEnteringContainerRoute = enteringRoutePath && enteringRoutePath.endsWith('/*');\n const isLeavingSpecificRoute =\n leavingRoutePath &&\n leavingRoutePath !== '' &&\n leavingRoutePath !== '*' &&\n !leavingRoutePath.endsWith('/*') &&\n !leavingViewItem.reactElement?.props?.index;\n\n // Skip removal for container-to-container transitions (e.g., /tabs/* → /settings/*).\n // These routes manage their own nested outlets; unmounting would disrupt child views.\n if (isEnteringContainerRoute && !isLeavingSpecificRoute) {\n return;\n }\n\n leavingViewItem.mount = false;\n\n const viewToUnmount = leavingViewItem;\n setTimeout(() => {\n // Skip if a follow-up transition re-entered the view (mount flipped back to true).\n if (viewToUnmount.mount) {\n return;\n }\n this.context.unMountViewItem(viewToUnmount);\n this.forceUpdate();\n }, VIEW_UNMOUNT_DELAY_MS);\n }\n\n /**\n * Cleans up orphaned sibling views after replace actions or push-to-container navigations.\n */\n private cleanupOrphanedSiblingViews(\n routeInfo: RouteInfo,\n enteringViewItem: ViewItem,\n leavingViewItem: ViewItem | undefined\n ): void {\n const enteringRoutePath = enteringViewItem.reactElement?.props?.path as string | undefined;\n if (!enteringRoutePath) {\n return;\n }\n\n const leavingRoutePath = leavingViewItem?.reactElement?.props?.path as string | undefined;\n const isContainerRoute = (path: string | undefined) => path?.endsWith('/*');\n\n const isReplaceAction = routeInfo.routeAction === 'replace';\n const isPushToContainer =\n routeInfo.routeAction === 'push' && routeInfo.routeDirection === 'none' && isContainerRoute(enteringRoutePath);\n\n if (!isReplaceAction && !isPushToContainer) {\n return;\n }\n\n // Skip cleanup for tab switches\n const isSameView = enteringViewItem === leavingViewItem;\n const isSameContainerRoute = isContainerRoute(enteringRoutePath) && leavingRoutePath === enteringRoutePath;\n const isNavigatingWithinContainer =\n isPushToContainer &&\n !leavingViewItem &&\n routeInfo.prevRouteLastPathname?.startsWith(enteringRoutePath.replace(/\\/\\*$/, ''));\n\n if (isSameView || isSameContainerRoute || isNavigatingWithinContainer) {\n return;\n }\n\n const allViewsInOutlet = this.context.getViewItemsForOutlet(this.id);\n const areSiblingRoutes = (path1: string, path2: string): boolean => {\n const path1IsRelative = !path1.startsWith('/');\n const path2IsRelative = !path2.startsWith('/');\n\n if (path1IsRelative && path2IsRelative) {\n const path1Depth = path1.replace(/\\/\\*$/, '').split('/').filter(Boolean).length;\n const path2Depth = path2.replace(/\\/\\*$/, '').split('/').filter(Boolean).length;\n return path1Depth === path2Depth && path1Depth <= 1;\n }\n\n const getParent = (path: string) => {\n const normalized = path.replace(/\\/\\*$/, '');\n const segments = normalized.split('/').filter(Boolean);\n // Strip trailing parameter segments (e.g., :id) so that\n // sibling routes like /items/list/:id and /items/detail/:id\n // resolve to the same parent (/items).\n while (segments.length > 0 && segments[segments.length - 1].startsWith(':')) {\n segments.pop();\n }\n segments.pop();\n return segments.length > 0 ? '/' + segments.join('/') : '/';\n };\n\n const parent = getParent(path1);\n // Exclude root-level routes from sibling detection to avoid unintended\n // cleanup of unrelated top-level routes. Also covers single-depth param\n // routes (e.g., /items/:id) which resolve to root after param stripping.\n if (parent === '/') {\n return false;\n }\n return parent === getParent(path2);\n };\n\n for (const viewItem of allViewsInOutlet) {\n const viewRoutePath = viewItem.reactElement?.props?.path as string | undefined;\n\n const shouldSkip =\n viewItem.id === enteringViewItem.id ||\n (leavingViewItem && viewItem.id === leavingViewItem.id) ||\n !viewItem.mount ||\n !viewRoutePath ||\n // Don't clean up container routes when entering a container route\n // (e.g., /tabs/* and /settings/* coexist for tab switching)\n (viewRoutePath.endsWith('/*') && enteringRoutePath.endsWith('/*'));\n\n if (shouldSkip) {\n continue;\n }\n\n const isOrphanedSpecificRoute = !viewRoutePath.endsWith('/*');\n\n // Clean up sibling non-container routes that are no longer reachable.\n let shouldCleanup = false;\n if ((isReplaceAction || isPushToContainer) && isOrphanedSpecificRoute) {\n shouldCleanup = areSiblingRoutes(enteringRoutePath, viewRoutePath);\n }\n\n if (shouldCleanup) {\n hideIonPageElement(viewItem.ionPageElement);\n viewItem.mount = false;\n\n const viewToRemove = viewItem;\n setTimeout(() => {\n // Skip if a follow-up transition re-entered the view (mount flipped back to true).\n if (viewToRemove.mount) {\n return;\n }\n this.context.unMountViewItem(viewToRemove);\n this.forceUpdate();\n }, VIEW_UNMOUNT_DELAY_MS);\n }\n }\n }\n\n /**\n * Determines whether to skip the transition animation and, if so, immediately\n * hides the leaving view with inline `visibility:hidden`.\n *\n * Skips transitions only for outlets nested inside a parent IonPage's content\n * area (i.e., an ion-content sits between the outlet and the .ion-page). These\n * outlets render child pages inside a parent page's scrollable area, and the MD\n * animation shows both entering and leaving pages simultaneously — causing text\n * overlap and nested scrollbars. Standard page-level outlets (tabs, routing,\n * swipe-to-go-back) animate normally even though they sit inside a framework-\n * managed .ion-page wrapper from the parent outlet's view stack.\n *\n * Uses inline visibility:hidden rather than ion-page-hidden class because\n * core's beforeTransition() removes ion-page-hidden via setPageHidden().\n * Inline visibility:hidden survives that removal, keeping the page hidden\n * until React unmounts it after ionViewDidLeave fires. Unlike display:none,\n * visibility:hidden preserves element geometry so commit() animations\n * can resolve normally.\n */\n private applySkipAnimationIfNeeded(\n enteringViewItem: ViewItem,\n leavingViewItem: ViewItem | undefined\n ): boolean {\n // Only skip for outlets genuinely nested inside a page's content area.\n // Walk from the outlet up to the nearest .ion-page; if an ion-content\n // sits in between, the outlet is inside scrollable page content and\n // animating would cause overlapping pages with duplicate scrollbars.\n let isInsidePageContent = false;\n let el: HTMLElement | null = this.routerOutletElement?.parentElement ?? null;\n while (el) {\n if (el.classList.contains('ion-page')) break;\n if (el.tagName === 'ION-CONTENT') {\n isInsidePageContent = true;\n break;\n }\n el = el.parentElement;\n }\n\n const shouldSkip = isInsidePageContent && !!leavingViewItem && enteringViewItem !== leavingViewItem;\n\n if (shouldSkip && leavingViewItem?.ionPageElement) {\n leavingViewItem.ionPageElement.style.setProperty('visibility', 'hidden');\n leavingViewItem.ionPageElement.setAttribute('aria-hidden', 'true');\n }\n\n return shouldSkip;\n }\n\n /**\n * Handles entering view with no ion-page element yet (waiting for render).\n */\n private handleWaitingForIonPage(\n routeInfo: RouteInfo,\n enteringViewItem: ViewItem,\n leavingViewItem: ViewItem | undefined,\n shouldUnmountLeavingViewItem: boolean\n ): void {\n const enteringRouteElement = enteringViewItem.reactElement?.props?.element;\n\n // Handle Navigate components (they never render an IonPage)\n if (isNavigateElement(enteringRouteElement)) {\n this.waitingForIonPage = false;\n if (this.ionPageWaitTimeout) {\n clearTimeout(this.ionPageWaitTimeout);\n this.ionPageWaitTimeout = undefined;\n }\n this.pendingPageTransition = false;\n\n // Hide ALL other visible views in this outlet for Navigate redirects.\n // Same rationale as the timeout path: intermediate redirects can shift\n // the leaving view reference, leaving the original page visible.\n const allViewsInOutlet = this.context.getViewItemsForOutlet(this.id);\n allViewsInOutlet.forEach((viewItem) => {\n if (viewItem.id !== enteringViewItem.id && viewItem.ionPageElement) {\n hideIonPageElement(viewItem.ionPageElement);\n }\n });\n\n // Don't unmount if entering and leaving are the same view item\n if (shouldUnmountLeavingViewItem && leavingViewItem && enteringViewItem !== leavingViewItem) {\n const shouldPreserveLeavingView =\n routeInfo.routeAction === 'pop' && isViewItemPreservableOnPop(leavingViewItem);\n if (routeInfo.routeAction !== 'replace' && !shouldPreserveLeavingView) {\n leavingViewItem.mount = false;\n } else if (shouldPreserveLeavingView) {\n this.preservedViewItems.add(leavingViewItem);\n }\n this.handleLeavingViewUnmount(routeInfo, enteringViewItem, leavingViewItem);\n }\n\n this.cleanupPreservedViewsOnPush(routeInfo, enteringViewItem, leavingViewItem);\n\n this.forceUpdate();\n return;\n }\n\n // Do not hide the leaving view here - wait until the entering view is ready.\n // Hiding the leaving view while the entering view is still mounting causes a flash\n // where both views are hidden/invisible simultaneously.\n // The leaving view will be hidden in transitionPage() after the entering view is visible.\n\n this.waitingForIonPage = true;\n\n if (this.ionPageWaitTimeout) {\n clearTimeout(this.ionPageWaitTimeout);\n }\n\n this.ionPageWaitTimeout = setTimeout(() => {\n this.ionPageWaitTimeout = undefined;\n\n if (!this.waitingForIonPage) {\n return;\n }\n this.waitingForIonPage = false;\n\n const latestEnteringView = this.context.findViewItemByRouteInfo(routeInfo, this.id) ?? enteringViewItem;\n const latestLeavingView = this.context.findLeavingViewItemByRouteInfo(routeInfo, this.id) ?? leavingViewItem;\n\n if (latestEnteringView?.ionPageElement) {\n const shouldSkipAnimation = this.applySkipAnimationIfNeeded(latestEnteringView, latestLeavingView ?? undefined);\n this.transitionPage(routeInfo, latestEnteringView, latestLeavingView ?? undefined, undefined, false, shouldSkipAnimation);\n\n if (shouldUnmountLeavingViewItem && latestLeavingView && latestEnteringView !== latestLeavingView) {\n const shouldPreserveLeavingView =\n routeInfo.routeAction === 'pop' && isViewItemPreservableOnPop(latestLeavingView);\n if (routeInfo.routeAction !== 'replace' && !shouldPreserveLeavingView) {\n latestLeavingView.mount = false;\n } else if (shouldPreserveLeavingView) {\n this.preservedViewItems.add(latestLeavingView);\n }\n this.handleLeavingViewUnmount(routeInfo, latestEnteringView, latestLeavingView);\n }\n\n this.cleanupPreservedViewsOnPush(routeInfo, latestEnteringView, latestLeavingView ?? undefined);\n\n this.forceUpdate();\n } else {\n /**\n * Timeout fired and entering view still has no ionPageElement.\n * This happens for container routes that render nested outlets without a direct IonPage.\n * Hide ALL other visible views in this outlet, not just the computed leaving view.\n * This handles cases where intermediate redirects (e.g., Navigate in nested routes)\n * change the leaving view reference, leaving the original page still visible.\n */\n const allViewsInOutlet = this.context.getViewItemsForOutlet(this.id);\n allViewsInOutlet.forEach((viewItem) => {\n if (viewItem.id !== latestEnteringView.id && viewItem.ionPageElement) {\n hideIonPageElement(viewItem.ionPageElement);\n }\n });\n this.forceUpdate();\n\n // Safety net: after forceUpdate triggers a React render cycle, check if\n // any pages in this outlet are stuck with ion-page-invisible. This can\n // happen when view lookup fails (e.g., wildcard-to-index transitions\n // where the view item gets corrupted). The forceUpdate above causes\n // React to render the correct component, but ion-page-invisible may\n // persist if no transition runs for that page.\n setTimeout(() => {\n if (!this._isMounted || !this.routerOutletElement) return;\n const stuckPages = this.routerOutletElement.querySelectorAll(':scope > .ion-page-invisible');\n stuckPages.forEach((page) => {\n page.classList.remove('ion-page-invisible');\n });\n }, ION_PAGE_WAIT_TIMEOUT_MS);\n }\n }, ION_PAGE_WAIT_TIMEOUT_MS);\n\n this.forceUpdate();\n }\n\n /**\n * Gets the route info to use for finding views during swipe-to-go-back gestures.\n * This pattern is used in multiple places in setupRouterOutlet.\n */\n private getSwipeBackRouteInfo(): RouteInfo {\n const { routeInfo } = this.props;\n return this.prevProps && this.prevProps.routeInfo.pathname === routeInfo.pushedByRoute\n ? this.prevProps.routeInfo\n : ({ pathname: routeInfo.pushedByRoute || '' } as RouteInfo);\n }\n\n componentDidMount() {\n this._isMounted = true;\n if (this.routerOutletElement) {\n this.setupRouterOutlet(this.routerOutletElement);\n // Defer to a microtask to avoid calling forceUpdate() synchronously during\n // React 19's reappearLayoutEffects phase, which re-runs componentDidMount\n // without a preceding componentWillUnmount and causes \"Maximum update depth exceeded\".\n const routeInfo = this.props.routeInfo;\n queueMicrotask(() => {\n if (this._isMounted && this.props.routeInfo.pathname === routeInfo.pathname) {\n this.handlePageTransition(routeInfo);\n }\n });\n }\n }\n\n componentDidUpdate(prevProps: StackManagerProps) {\n const { pathname } = this.props.routeInfo;\n const { pathname: prevPathname } = prevProps.routeInfo;\n\n if (pathname !== prevPathname) {\n this.prevProps = prevProps;\n this.handlePageTransition(this.props.routeInfo);\n } else if (this.pendingPageTransition) {\n this.handlePageTransition(this.props.routeInfo);\n this.pendingPageTransition = false;\n }\n }\n\n componentWillUnmount() {\n this._isMounted = false;\n\n // Cancel any in-flight transition rAFs\n for (const id of this.transitionRafIds) {\n cancelAnimationFrame(id);\n }\n this.transitionRafIds = [];\n\n // Disconnect any in-flight MutationObserver from waitForComponentsReady\n if (this.transitionObserver) {\n this.transitionObserver.disconnect();\n this.transitionObserver = undefined;\n }\n\n if (this.ionPageWaitTimeout) {\n clearTimeout(this.ionPageWaitTimeout);\n this.ionPageWaitTimeout = undefined;\n }\n if (this.outOfScopeUnmountTimeout) {\n clearTimeout(this.outOfScopeUnmountTimeout);\n this.outOfScopeUnmountTimeout = undefined;\n }\n this.waitingForIonPage = false;\n this.preservedViewItems.clear();\n\n // Hide all views in this outlet before clearing.\n // This is critical for nested outlets - when the parent component unmounts,\n // the nested outlet's componentDidUpdate won't be called, so we must hide\n // the ion-page elements here to prevent them from remaining visible on top\n // of other content after navigation to a different route.\n const allViewsInOutlet = this.context.getViewItemsForOutlet(this.id);\n allViewsInOutlet.forEach((viewItem) => {\n hideIonPageElement(viewItem.ionPageElement);\n });\n\n this.context.clearOutlet(this.id);\n }\n\n /**\n * Sets the transition between pages within this router outlet.\n * This function determines the entering and leaving views based on the\n * provided route information and triggers the appropriate animation.\n * It also handles scenarios like initial loads, back navigation, and\n * navigation to the same view with different parameters.\n *\n * @param routeInfo It contains info about the current route,\n * the previous route, and the action taken (e.g., push, replace).\n *\n * @returns A promise that resolves when the transition is complete.\n * If no transition is needed or if the router outlet isn't ready,\n * the Promise may resolve immediately.\n */\n async handlePageTransition(routeInfo: RouteInfo) {\n // Wait for router outlet to mount\n if (!this.routerOutletElement || !this.routerOutletElement.commit) {\n this.pendingPageTransition = true;\n return;\n }\n\n // Find entering and leaving view items\n const viewItems = this.findViewItems(routeInfo);\n let enteringViewItem = viewItems.enteringViewItem;\n let leavingViewItem = viewItems.leavingViewItem;\n let shouldUnmountLeavingViewItem = this.shouldUnmountLeavingView(routeInfo, enteringViewItem, leavingViewItem);\n\n // Get parent path for nested outlets\n const parentPath = this.getParentPath();\n\n // Handle out-of-scope outlet (route outside mount path)\n if (this.handleOutOfScopeOutlet(routeInfo)) {\n return;\n }\n\n // Handle root navigation: unmount all non-entering views\n if (routeInfo.routeDirection === 'root') {\n this.handleRootNavigation(enteringViewItem);\n leavingViewItem = undefined;\n shouldUnmountLeavingViewItem = false;\n }\n\n // Clear any pending out-of-scope unmount timeout\n if (this.outOfScopeUnmountTimeout) {\n clearTimeout(this.outOfScopeUnmountTimeout);\n this.outOfScopeUnmountTimeout = undefined;\n }\n\n // Handle nested outlet with relative routes but no valid parent path\n if (this.handleOutOfContextNestedOutlet(parentPath, leavingViewItem)) {\n return;\n }\n\n // Find the matching route element\n const enteringRoute = findRouteByRouteInfo(\n this.ionRouterOutlet?.props.children,\n routeInfo,\n parentPath\n ) as React.ReactElement;\n\n // Handle nested outlet with no matching route\n if (this.handleNoMatchingRoute(enteringRoute, enteringViewItem, leavingViewItem)) {\n return;\n }\n\n // Create or update the entering view item\n if (enteringViewItem && enteringRoute) {\n enteringViewItem.reactElement = enteringRoute;\n } else if (enteringRoute) {\n enteringViewItem = this.context.createViewItem(this.id, enteringRoute, routeInfo);\n this.context.addViewItem(enteringViewItem);\n }\n\n // Handle transition based on ion-page element availability\n // Check if the ionPageElement is still in the document.\n // If the view was previously unmounted (mount=false), the ViewLifeCycleManager\n // removes the React component from the tree, which removes the IonPage from the DOM.\n // The ionPageElement reference becomes stale and we need to wait for a new one.\n const ionPageIsInDocument =\n enteringViewItem?.ionPageElement && document.body.contains(enteringViewItem.ionPageElement);\n\n if (enteringViewItem && ionPageIsInDocument) {\n // Clear waiting state\n if (this.waitingForIonPage) {\n this.waitingForIonPage = false;\n }\n if (this.ionPageWaitTimeout) {\n clearTimeout(this.ionPageWaitTimeout);\n this.ionPageWaitTimeout = undefined;\n }\n\n this.handleReadyEnteringView(routeInfo, enteringViewItem, leavingViewItem, shouldUnmountLeavingViewItem);\n } else if (enteringViewItem && !ionPageIsInDocument) {\n // Wait for ion-page to mount\n // This handles both: no ionPageElement, or stale ionPageElement (not in document)\n // Clear stale reference if the element is no longer in the document\n if (enteringViewItem.ionPageElement && !document.body.contains(enteringViewItem.ionPageElement)) {\n enteringViewItem.ionPageElement = undefined;\n }\n // Ensure the view is marked as mounted so ViewLifeCycleManager renders the IonPage\n if (!enteringViewItem.mount) {\n enteringViewItem.mount = true;\n }\n this.handleWaitingForIonPage(routeInfo, enteringViewItem, leavingViewItem, shouldUnmountLeavingViewItem);\n return;\n } else if (!enteringViewItem && !enteringRoute) {\n // No view or route found - likely leaving to another outlet\n if (leavingViewItem) {\n hideIonPageElement(leavingViewItem.ionPageElement);\n const shouldPreserveLeavingView =\n routeInfo.routeAction === 'pop' && isViewItemPreservableOnPop(leavingViewItem);\n if (shouldUnmountLeavingViewItem && !shouldPreserveLeavingView) {\n leavingViewItem.mount = false;\n } else if (shouldUnmountLeavingViewItem && shouldPreserveLeavingView) {\n this.preservedViewItems.add(leavingViewItem);\n }\n }\n }\n\n this.forceUpdate();\n }\n\n /**\n * Registers an `<IonPage>` DOM element with the `StackManager`.\n * This is called when `<IonPage>` has been mounted.\n *\n * @param page The element of the rendered `<IonPage>`.\n * @param routeInfo The route information that associates with `<IonPage>`.\n */\n registerIonPage(page: HTMLElement, routeInfo: RouteInfo) {\n /**\n * DO NOT remove ion-page-invisible here.\n *\n * PageManager's ref callback adds ion-page-invisible synchronously to prevent flash.\n * At this point, the <IonPage> div exists but its CHILDREN (header, toolbar, menu-button)\n * have NOT rendered yet. If we remove ion-page-invisible now, the page becomes visible\n * with empty/incomplete content, causing a flicker (especially for ion-menu-button which\n * starts with menu-button-hidden class).\n *\n * Instead, let transitionPage handle visibility AFTER waiting for components to be ready.\n * This ensures the page only becomes visible when its content is fully rendered.\n */\n this.waitingForIonPage = false;\n if (this.ionPageWaitTimeout) {\n clearTimeout(this.ionPageWaitTimeout);\n this.ionPageWaitTimeout = undefined;\n }\n this.pendingPageTransition = false;\n\n const foundView = this.context.findViewItemByRouteInfo(routeInfo, this.id);\n\n if (foundView) {\n const oldPageElement = foundView.ionPageElement;\n\n /**\n * FIX for issue #28878: Reject orphaned IonPage registrations.\n *\n * When a component conditionally renders different IonPages (e.g., list vs empty state)\n * using React keys, and state changes simultaneously with navigation, the new IonPage\n * tries to register for a route we're navigating away from. This creates a stale view.\n *\n * Only reject if both pageIds exist and differ, to allow nested outlet registrations.\n */\n if (this.shouldRejectOrphanedPage(page, oldPageElement, routeInfo)) {\n this.hideAndRemoveOrphanedPage(page);\n return;\n }\n\n /**\n * Don't let a nested element (e.g., ion-router-outlet with ionPage prop)\n * override an existing IonPage registration when the existing element is\n * an ancestor of the new one. This ensures ionPageElement always points\n * to the outermost IonPage, which is needed to properly hide the entire\n * page during back navigation (not just the inner outlet).\n */\n if (oldPageElement && oldPageElement !== page && oldPageElement.isConnected && oldPageElement.contains(page)) {\n return;\n }\n\n foundView.ionPageElement = page;\n foundView.ionRoute = true;\n\n /**\n * React 18 will unmount and remount IonPage\n * elements in development mode when using createRoot.\n * This can cause duplicate page transitions to occur.\n */\n if (oldPageElement === page) {\n return;\n }\n }\n this.handlePageTransition(routeInfo);\n }\n\n /**\n * Checks if a new IonPage should be rejected (component re-rendered while navigating away).\n */\n private shouldRejectOrphanedPage(\n newPage: HTMLElement,\n oldPageElement: HTMLElement | undefined,\n routeInfo: RouteInfo\n ): boolean {\n if (!oldPageElement || oldPageElement === newPage) {\n return false;\n }\n\n const newPageId = newPage.getAttribute('data-pageid');\n const oldPageId = oldPageElement.getAttribute('data-pageid');\n\n if (!newPageId || !oldPageId || newPageId === oldPageId) {\n return false;\n }\n\n return this.props.routeInfo.pathname !== routeInfo.pathname;\n }\n\n private hideAndRemoveOrphanedPage(page: HTMLElement): void {\n page.classList.add('ion-page-hidden');\n page.setAttribute('aria-hidden', 'true');\n\n setTimeout(() => {\n if (page.parentElement) {\n page.remove();\n }\n }, VIEW_UNMOUNT_DELAY_MS);\n }\n\n /**\n * Dismisses every presented Ionic overlay in the document. Core moves overlays\n * to ion-app when presented, so they are no longer descendants of this outlet\n * and stay visible even after the outlet is hidden, blocking the entering view.\n *\n * Scope is document-wide because the original outlet-to-overlay DOM linkage is\n * lost after presentation. Overlays without a trackable presenting element\n * cannot be safely attributed to a specific outlet.\n */\n private dismissPresentedOverlays(): void {\n type PresentedOverlay =\n | HTMLIonModalElement\n | HTMLIonPopoverElement\n | HTMLIonActionSheetElement\n | HTMLIonAlertElement\n | HTMLIonLoadingElement;\n // Matches the overlay set tracked by core's getPresentedOverlays (see\n // core/src/utils/overlays.ts). An overlay is \"presented\" when it lacks the\n // `overlay-hidden` class.\n const overlaySelector = 'ion-modal, ion-popover, ion-action-sheet, ion-alert, ion-loading';\n document.querySelectorAll<PresentedOverlay>(overlaySelector).forEach((overlay) => {\n if (overlay.classList.contains('overlay-hidden') || typeof overlay.dismiss !== 'function') {\n return;\n }\n overlay.dismiss().catch(() => {\n /* Overlay may already be dismissing or its canDismiss guard may block it. */\n });\n });\n }\n\n /**\n * Resolves the entering view for a swipe-back gesture.\n *\n * Prefers a view owned by this outlet. Falls back to searching all outlets only\n * when the candidate's ion-page element is a descendant of this outlet. Without\n * the containment guard, a nested child outlet can claim ownership of a sibling\n * outlet's view, running the swipe gesture on the wrong router outlet.\n */\n private findEnteringViewForSwipe(swipeBackRouteInfo: RouteInfo): ViewItem | undefined {\n const enteringViewItem = this.context.findViewItemByRouteInfo(swipeBackRouteInfo, this.id, false);\n if (enteringViewItem) {\n return enteringViewItem;\n }\n const candidate = this.context.findViewItemByRouteInfo(swipeBackRouteInfo, undefined, false);\n if (candidate?.ionPageElement && this.routerOutletElement?.contains(candidate.ionPageElement)) {\n return candidate;\n }\n return undefined;\n }\n\n /**\n * Configures swipe-to-go-back gesture for the router outlet.\n */\n async setupRouterOutlet(routerOutlet: HTMLIonRouterOutletElement) {\n const canStart = () => {\n const { routeInfo } = this.props;\n const swipeBackRouteInfo = this.getSwipeBackRouteInfo();\n const enteringViewItem = this.findEnteringViewForSwipe(swipeBackRouteInfo);\n\n // View might have mount=false but ionPageElement still in DOM\n const ionPageInDocument = Boolean(\n enteringViewItem?.ionPageElement && document.body.contains(enteringViewItem.ionPageElement)\n );\n\n // For wildcard/parameterized routes, the pattern path (e.g. \"/foo/*\") will\n // never equal the resolved pathname (e.g. \"/foo/bar\"), so the pattern check\n // alone isn't sufficient. Also, verify the entering view's resolved pathname\n // differs from the current pathname — if they match, the entering and leaving\n // views are the same and the swipe gesture shouldn't start.\n const canStartSwipe =\n !!enteringViewItem &&\n (enteringViewItem.mount || ionPageInDocument) &&\n enteringViewItem.routeData.match.pattern.path !== routeInfo.pathname &&\n enteringViewItem.routeData.match.pathname !== routeInfo.pathname;\n\n // eslint-disable-next-line no-console\n console.log('[SwipeBackCanStart]', JSON.stringify({\n outletId: this.id,\n routePathname: routeInfo.pathname,\n swipeBackPathname: swipeBackRouteInfo?.pathname,\n enteringViewId: enteringViewItem?.id,\n enteringViewPath: enteringViewItem?.reactElement?.props?.path,\n enteringMount: enteringViewItem?.mount,\n ionPageInDocument,\n canStartSwipe,\n }));\n\n return canStartSwipe;\n };\n\n const onStart = async () => {\n const { routeInfo } = this.props;\n const swipeBackRouteInfo = this.getSwipeBackRouteInfo();\n const enteringViewItem = this.findEnteringViewForSwipe(swipeBackRouteInfo);\n const leavingViewItem = this.context.findViewItemByRouteInfo(routeInfo, this.id, false);\n\n // eslint-disable-next-line no-console\n console.log('[SwipeBackOnStart:entry]', JSON.stringify({\n outletId: this.id,\n routePathname: routeInfo.pathname,\n swipeBackPathname: swipeBackRouteInfo?.pathname,\n enteringViewId: enteringViewItem?.id,\n enteringViewPath: enteringViewItem?.reactElement?.props?.path,\n enteringMount: enteringViewItem?.mount,\n hasEnteringIonPageElement: !!enteringViewItem?.ionPageElement,\n leavingViewId: leavingViewItem?.id,\n }));\n\n // Ensure the entering view is mounted so React keeps rendering it during the gesture.\n // This is important when the view was previously marked for unmount but its\n // ionPageElement is still in the DOM.\n if (enteringViewItem && !enteringViewItem.mount) {\n enteringViewItem.mount = true;\n }\n\n // Reveal synchronously. `transitionPage` defers this behind async commit,\n // but the gesture's first progress frame fires in the same tick as onStart,\n // so an async reveal leaves the entering page hidden until the next frame.\n revealIonPageForSwipeBack(enteringViewItem?.ionPageElement);\n\n // When the gesture starts, kick off a transition controlled via swipe gesture\n if (enteringViewItem && leavingViewItem) {\n await this.transitionPage(routeInfo, enteringViewItem, leavingViewItem, 'back', true);\n }\n\n // eslint-disable-next-line no-console\n console.log('[SwipeBackOnStart:exit]', JSON.stringify({\n outletId: this.id,\n enteringFinalComputedDisplay: enteringViewItem?.ionPageElement\n ? getComputedStyle(enteringViewItem.ionPageElement).display\n : null,\n enteringFinalInlineDisplay: enteringViewItem?.ionPageElement?.style.display ?? null,\n enteringFinalHiddenClass: enteringViewItem?.ionPageElement?.classList.contains('ion-page-hidden') ?? null,\n }));\n\n return Promise.resolve();\n };\n\n const onEnd = (shouldContinue: boolean) => {\n if (shouldContinue) {\n // User finished the swipe gesture, so complete the back navigation\n this.skipTransition = true;\n this.context.goBack();\n } else {\n // Swipe gesture was aborted - re-hide the page that was going to enter\n const { routeInfo } = this.props;\n const swipeBackRouteInfo = this.getSwipeBackRouteInfo();\n const enteringViewItem = this.findEnteringViewForSwipe(swipeBackRouteInfo);\n const leavingViewItem = this.context.findViewItemByRouteInfo(routeInfo, this.id, false);\n\n // Don't hide if entering and leaving are the same (parameterized route edge case)\n if (enteringViewItem !== leavingViewItem && enteringViewItem?.ionPageElement !== undefined) {\n hideIonPageElement(enteringViewItem.ionPageElement);\n }\n }\n };\n\n routerOutlet.swipeHandler = {\n canStart,\n onStart,\n onEnd,\n };\n }\n\n /**\n * Animates the transition between the entering and leaving pages within the\n * router outlet.\n *\n * @param routeInfo Info about the current route.\n * @param enteringViewItem The view item that is entering.\n * @param leavingViewItem The view item that is leaving.\n * @param direction The direction of the transition.\n * @param progressAnimation Indicates if the transition is part of a\n * gesture controlled animation (e.g., swipe to go back).\n * Defaults to `false`.\n * @param skipAnimation When true, forces `duration: 0` so the page\n * swap is instant (no visible animation). Used for ionPage outlets\n * and back navigations that unmount the leaving view to prevent\n * overlapping content during the transition. Defaults to `false`.\n */\n async transitionPage(\n routeInfo: RouteInfo,\n enteringViewItem: ViewItem,\n leavingViewItem?: ViewItem,\n direction?: 'forward' | 'back',\n progressAnimation = false,\n skipAnimation = false\n ) {\n const myGeneration = ++this.transitionGeneration;\n\n const runCommit = async (enteringEl: HTMLElement, leavingEl?: HTMLElement) => {\n const skipTransition = this.skipTransition;\n\n /**\n * If the transition was handled\n * via the swipe to go back gesture,\n * then we do not want to perform\n * another transition.\n *\n * We skip adding ion-page or ion-page-invisible\n * because the entering view already exists in the DOM.\n * If we added the classes, there would be a flicker where\n * the view would be briefly hidden.\n */\n if (skipTransition) {\n /**\n * We need to reset skipTransition before\n * we call routerOutlet.commit otherwise\n * the transition triggered by the swipe\n * to go back gesture would reset it. In\n * that case you would see a duplicate\n * transition triggered by handlePageTransition\n * in componentDidUpdate.\n */\n this.skipTransition = false;\n } else {\n enteringEl.classList.add('ion-page');\n /**\n * Only add ion-page-invisible if the element is not already visible.\n * During tab switches, the container page (e.g., TabContext wrapper) is\n * already visible and should remain so. Adding ion-page-invisible would\n * cause a flash where the visible page briefly becomes invisible.\n */\n if (!isViewVisible(enteringEl)) {\n enteringEl.classList.add('ion-page-invisible');\n }\n }\n\n const commitDuration = skipTransition || skipAnimation || directionToUse === undefined ? 0 : undefined;\n\n // Race commit against a timeout to recover from hangs\n const commitPromise = routerOutlet.commit(enteringEl, leavingEl, {\n duration: commitDuration,\n direction: directionToUse,\n showGoBack: !!routeInfo.pushedByRoute,\n progressAnimation,\n animationBuilder: routeInfo.routeAnimation,\n });\n\n const timeoutMs = 5000;\n const timeoutPromise = new Promise<'timeout'>((resolve) => setTimeout(() => resolve('timeout'), timeoutMs));\n const result = await Promise.race([commitPromise.then(() => 'done' as const), timeoutPromise]);\n\n // Bail out if the component unmounted during the commit animation\n if (!this._isMounted) return;\n\n if (result === 'timeout') {\n // Force entering page visible even though commit hung\n enteringEl.classList.remove('ion-page-invisible');\n }\n\n /**\n * If a newer transitionPage call ran while this commit was in-flight (e.g., a tab\n * switch fired during a forward animation), the core commit may have applied\n * ion-page-hidden to leavingEl even though the newer transition already made it\n * visible. Undo that stale hide so the newer transition's DOM state wins.\n */\n if (myGeneration !== this.transitionGeneration && leavingEl && leavingEl === this.transitionEnteringElement) {\n showIonPageElement(leavingEl);\n }\n\n if (!progressAnimation) {\n enteringEl.classList.remove('ion-page-invisible');\n }\n };\n\n const routerOutlet = this.routerOutletElement!;\n\n const routeInfoFallbackDirection =\n routeInfo.routeDirection === 'none' || routeInfo.routeDirection === 'root' ? undefined : routeInfo.routeDirection;\n const directionToUse = direction ?? routeInfoFallbackDirection;\n\n if (enteringViewItem && enteringViewItem.ionPageElement && this.routerOutletElement) {\n this.transitionEnteringElement = enteringViewItem.ionPageElement;\n\n if (leavingViewItem && leavingViewItem.ionPageElement && enteringViewItem === leavingViewItem) {\n // Clone page for same-view transitions (e.g., /user/1 → /user/2)\n const match = matchComponent(leavingViewItem.reactElement, routeInfo.pathname, undefined, this.outletMountPath);\n if (match) {\n const newLeavingElement = clonePageElement(leavingViewItem.ionPageElement.outerHTML);\n if (newLeavingElement) {\n this.routerOutletElement.appendChild(newLeavingElement);\n await runCommit(enteringViewItem.ionPageElement, newLeavingElement);\n this.routerOutletElement.removeChild(newLeavingElement);\n }\n } else {\n // Route no longer matches (e.g., /user/1 → /settings)\n await runCommit(enteringViewItem.ionPageElement, undefined);\n }\n } else {\n const leavingEl = leavingViewItem?.ionPageElement;\n // For non-animated transitions, don't pass leaving element to commit() to avoid\n // flicker caused by commit() briefly unhiding the leaving page\n const isNonAnimatedTransition = directionToUse === undefined && !progressAnimation;\n\n if (isNonAnimatedTransition && leavingEl) {\n /**\n * Skip commit() for non-animated transitions (like tab switches).\n * commit() runs animation logic that can cause intermediate paints\n * even with duration: 0. Instead, swap visibility synchronously.\n *\n * Synchronous DOM class changes are batched into a single browser\n * paint, so there's no gap frame where neither page is visible and\n * no overlap frame where both pages are visible.\n */\n const enteringEl = enteringViewItem.ionPageElement;\n\n // Ensure entering element has proper base classes\n enteringEl.classList.add('ion-page');\n\n // Clear ALL hidden state from entering element. showIonPageElement\n // removes visibility:hidden (from applySkipAnimationIfNeeded),\n // ion-page-hidden, and aria-hidden in one call.\n showIonPageElement(enteringEl);\n\n // Handle can-go-back class since we're skipping commit() which normally sets this\n if (routeInfo.pushedByRoute) {\n enteringEl.classList.add('can-go-back');\n } else {\n enteringEl.classList.remove('can-go-back');\n }\n\n /**\n * Wait for components to be ready. Menu buttons start hidden (menu-button-hidden)\n * and become visible after componentDidLoad. Wait for hydration and visibility.\n */\n const waitForComponentsReady = () => {\n return new Promise<void>((resolve) => {\n const checkReady = () => {\n const ionicComponents = enteringEl.querySelectorAll(\n 'ion-header, ion-toolbar, ion-buttons, ion-menu-button, ion-title, ion-content'\n );\n const allHydrated = Array.from(ionicComponents).every((el) => el.classList.contains('hydrated'));\n\n const menuButtons = enteringEl.querySelectorAll('ion-menu-button');\n const menuButtonsReady = Array.from(menuButtons).every(\n (el) => !el.classList.contains('menu-button-hidden')\n );\n\n return allHydrated && menuButtonsReady;\n };\n\n if (checkReady()) {\n resolve();\n return;\n }\n\n let resolved = false;\n const observer = new MutationObserver(() => {\n if (!resolved && checkReady()) {\n resolved = true;\n observer.disconnect();\n if (this.transitionObserver === observer) {\n this.transitionObserver = undefined;\n }\n resolve();\n }\n });\n\n // Disconnect any previous observer before tracking the new one\n if (this.transitionObserver) {\n this.transitionObserver.disconnect();\n }\n this.transitionObserver = observer;\n\n observer.observe(enteringEl, {\n subtree: true,\n attributes: true,\n attributeFilter: ['class'],\n });\n\n setTimeout(() => {\n if (!resolved) {\n resolved = true;\n observer.disconnect();\n if (this.transitionObserver === observer) {\n this.transitionObserver = undefined;\n }\n resolve();\n }\n }, 100);\n });\n };\n\n await waitForComponentsReady();\n\n // Bail out if the component unmounted during waitForComponentsReady\n if (!this._isMounted) return;\n\n // Swap visibility synchronously - show entering, hide leaving\n // Skip hiding if a newer transition already made leavingEl the entering view\n enteringEl.classList.remove('ion-page-invisible');\n if (myGeneration === this.transitionGeneration || leavingEl !== this.transitionEnteringElement) {\n leavingEl.classList.add('ion-page-hidden');\n leavingEl.setAttribute('aria-hidden', 'true');\n }\n } else {\n await runCommit(enteringViewItem.ionPageElement, leavingEl);\n if (leavingEl && !progressAnimation) {\n // Skip hiding if a newer transition already made leavingEl the entering view\n // runCommit's generation check has already restored its visibility in that case\n if (myGeneration === this.transitionGeneration || leavingEl !== this.transitionEnteringElement) {\n leavingEl.classList.add('ion-page-hidden');\n leavingEl.setAttribute('aria-hidden', 'true');\n }\n }\n }\n }\n }\n }\n\n render() {\n const { children } = this.props;\n const ionRouterOutlet = React.Children.only(children) as React.ReactElement;\n // Store reference for use in getParentPath() and handlePageTransition()\n this.ionRouterOutlet = ionRouterOutlet;\n\n return (\n <RouteContext.Consumer>\n {(parentContext) => {\n // Derive the outlet's mount path from React Router's matched route context.\n // This eliminates the need for heuristic-based mount path discovery in\n // computeParentPath, since React Router already knows the matched base path.\n const parentMatches = parentContext?.matches as { pathnameBase: string }[] | undefined;\n const parentPathnameBase =\n parentMatches && parentMatches.length > 0\n ? parentMatches[parentMatches.length - 1].pathnameBase\n : undefined;\n\n // Derive isRootOutlet from RouteContext: empty matches means root.\n this.isRootOutlet = !parentMatches || parentMatches.length === 0;\n\n // Seed StackManager's mount path from the parent route context\n if (parentPathnameBase && !this.outletMountPath) {\n this.outletMountPath = parentPathnameBase;\n }\n\n const components = this.context.getChildrenToRender(\n this.id,\n this.ionRouterOutlet,\n this.props.routeInfo,\n () => {\n // Callback triggers re-render when view items are modified during getChildrenToRender\n this.forceUpdate();\n },\n parentPathnameBase\n );\n\n return (\n <StackContext.Provider value={this.stackContextValue}>\n {React.cloneElement(\n ionRouterOutlet as any,\n {\n ref: (node: HTMLIonRouterOutletElement) => {\n if (ionRouterOutlet.props.setRef) {\n // Needed to handle external refs from devs.\n ionRouterOutlet.props.setRef(node);\n }\n if (ionRouterOutlet.props.forwardedRef) {\n // Needed to handle external refs from devs.\n ionRouterOutlet.props.forwardedRef.current = node;\n }\n this.routerOutletElement = node;\n const { ref } = ionRouterOutlet as any;\n // Check for legacy refs.\n if (typeof ref === 'function') {\n ref(node);\n }\n },\n },\n components\n )}\n </StackContext.Provider>\n );\n }}\n </RouteContext.Consumer>\n );\n }\n\n static get contextType() {\n return RouteManagerContext;\n }\n}\n\nexport default StackManager;\n\n/**\n * Converts React Route elements to RouteObject format for use with matchRoutes().\n * Filters out pathless routes (which are handled by fallback logic separately).\n *\n * When a basename is provided, absolute route paths are relativized by stripping\n * the basename prefix. This is necessary because matchRoutes() strips the basename\n * from the LOCATION pathname but not from route paths — absolute paths must be\n * made relative to the basename for matching to work correctly.\n *\n * @param routeChildren The flat array of Route/IonRoute elements from the outlet.\n * @param basename The resolved parent path (without trailing slash or `/*`) used to relativize absolute paths.\n */\nfunction routeElementsToRouteObjects(routeChildren: React.ReactElement[], basename?: string): RouteObject[] {\n return routeChildren\n .filter((child) => child.props.path != null || child.props.index)\n .map((child): RouteObject => {\n const handle = { _element: child };\n let path = child.props.path as string | undefined;\n\n // Relativize absolute paths by stripping the basename prefix\n if (path && path.startsWith('/') && basename) {\n if (path === basename) {\n path = '';\n } else if (path.startsWith(basename + '/')) {\n path = path.slice(basename.length + 1);\n }\n }\n\n if (child.props.index) {\n return {\n index: true,\n handle,\n caseSensitive: child.props.caseSensitive || undefined,\n };\n }\n return {\n path,\n handle,\n caseSensitive: child.props.caseSensitive || undefined,\n };\n });\n}\n\n/**\n * Finds the `<Route />` node matching the current route info.\n * If no `<Route />` can be matched, a fallback node is returned.\n * Routes are prioritized by specificity (most specific first).\n *\n * @param node The root node to search for `<Route />` nodes.\n * @param routeInfo The route information to match against.\n * @param parentPath The parent path that was matched by the parent outlet (for nested routing)\n */\nfunction findRouteByRouteInfo(node: React.ReactNode, routeInfo: RouteInfo, parentPath?: string) {\n let matchedNode: React.ReactNode;\n let fallbackNode: React.ReactNode;\n\n // `<Route />` nodes are rendered inside of a <Routes /> node\n const routesChildren = getRoutesChildren(node) ?? node;\n\n // Collect all route children\n const routeChildren = React.Children.toArray(routesChildren).filter(\n (child): child is React.ReactElement =>\n React.isValidElement(child) && (child.type === Route || child.type === IonRoute)\n );\n\n // Delegate route matching to RR6's matchRoutes(), which handles specificity ranking internally.\n const basename = parentPath ? stripTrailingSlash(parentPath.replace('/*', '')) : undefined;\n const routeObjects = routeElementsToRouteObjects(routeChildren, basename);\n const matches = matchRoutes(routeObjects, { pathname: routeInfo.pathname }, basename);\n\n if (matches && matches.length > 0) {\n const bestMatch = matches[matches.length - 1];\n matchedNode = (bestMatch.route as any).handle?._element ?? undefined;\n }\n\n // Fallback: try pathless routes, but only if pathname is within scope.\n if (!matchedNode) {\n let pathnameInScope = true;\n\n if (parentPath) {\n pathnameInScope = isPathnameInScope(routeInfo.pathname, parentPath);\n } else {\n const absolutePathRoutes = routeChildren.filter((r) => r.props.path && r.props.path.startsWith('/'));\n if (absolutePathRoutes.length > 0) {\n const absolutePaths = absolutePathRoutes.map((r) => r.props.path as string);\n const commonPrefix = computeCommonPrefix(absolutePaths);\n if (commonPrefix && commonPrefix !== '/') {\n pathnameInScope = routeInfo.pathname.startsWith(commonPrefix);\n }\n }\n }\n\n if (pathnameInScope) {\n for (const child of routeChildren) {\n if (!child.props.path) {\n fallbackNode = child;\n break;\n }\n }\n }\n }\n\n return matchedNode ?? fallbackNode;\n}\n\nfunction matchComponent(node: React.ReactElement, pathname: string, forceExact?: boolean, parentPath?: string) {\n const routePath: string | undefined = node?.props?.path;\n\n let pathnameToMatch: string;\n if (parentPath && routePath && !routePath.startsWith('/')) {\n // When parent path is known, compute exact relative pathname\n const relative = pathname.startsWith(parentPath)\n ? pathname.slice(parentPath.length).replace(/^\\//, '')\n : pathname;\n pathnameToMatch = relative;\n } else {\n pathnameToMatch = derivePathnameToMatch(pathname, routePath);\n }\n\n return matchPath({\n pathname: pathnameToMatch,\n componentProps: {\n ...node.props,\n end: forceExact,\n },\n });\n}\n","/**\n * `IonRouter` is responsible for managing the application's navigation\n * state, tracking the history of visited routes, and coordinating\n * transitions between different views. It intercepts route changes from\n * React Router and translates them into actions that Ionic can understand\n * and animate.\n */\n\nimport type {\n AnimationBuilder,\n RouteAction,\n RouteInfo,\n RouteManagerContextState,\n RouterDirection,\n RouterOptions,\n} from '@ionic/react';\nimport { LocationHistory, NavManager, RouteManagerContext, generateId, getConfig } from '@ionic/react';\nimport type { Action as HistoryAction, Location } from 'history';\nimport type { PropsWithChildren } from 'react';\nimport React, { useEffect, useRef, useState } from 'react';\nimport { useLocation, useNavigate } from 'react-router-dom';\n\nimport { IonRouteInner } from './IonRouteInner';\nimport { ReactRouterViewStack } from './ReactRouterViewStack';\nimport StackManager from './StackManager';\n\n// Use Location directly - state is typed as `unknown` in history v5\ntype HistoryLocation = Location;\n\nexport interface LocationState {\n direction?: RouterDirection;\n routerOptions?: RouterOptions;\n}\n\ninterface IonRouterProps {\n registerHistoryListener: (cb: (location: HistoryLocation, action: HistoryAction) => void) => void;\n}\n\ntype RouteParams = Record<string, string | string[] | undefined>;\ntype SafeRouteParams = Record<string, string | string[]>;\n\nconst filterUndefinedParams = (params: RouteParams): SafeRouteParams => {\n const result: SafeRouteParams = {};\n for (const key of Object.keys(params)) {\n const value = params[key];\n if (value !== undefined) {\n result[key] = value;\n }\n }\n return result;\n};\n\n/**\n * Checks if a POP event is a multi-step back navigation (navigate(-n) where n > 1).\n * Walks the pushedByRoute chain from prevInfo to verify the destination is an ancestor\n * in the same navigation chain. This distinguishes multi-step back from tab-crossing\n * back navigation where prevInfo.pathname also differs from the browser destination.\n */\nconst checkIsMultiStepBack = (\n prevInfo: RouteInfo | undefined,\n destinationPathname: string,\n history: LocationHistory\n): boolean => {\n if (!prevInfo || prevInfo.pathname === destinationPathname) return false;\n const visited = new Set<string>();\n let walker: RouteInfo | undefined = prevInfo;\n while (walker?.pushedByRoute) {\n if (visited.has(walker.id)) break; // cycle guard\n visited.add(walker.id);\n if (walker.pushedByRoute === destinationPathname) return true;\n walker = history.findLastLocation(walker);\n }\n return false;\n};\n\nconst areParamsEqual = (a?: RouteParams, b?: RouteParams) => {\n const paramsA = a || {};\n const paramsB = b || {};\n const keysA = Object.keys(paramsA);\n const keysB = Object.keys(paramsB);\n\n if (keysA.length !== keysB.length) {\n return false;\n }\n\n return keysA.every((key) => {\n const valueA = paramsA[key];\n const valueB = paramsB[key];\n if (Array.isArray(valueA) && Array.isArray(valueB)) {\n if (valueA.length !== valueB.length) {\n return false;\n }\n return valueA.every((entry, idx) => entry === valueB[idx]);\n }\n return valueA === valueB;\n });\n};\n\nexport const IonRouter = ({ children, registerHistoryListener }: PropsWithChildren<IonRouterProps>) => {\n const location = useLocation();\n const navigate = useNavigate();\n\n const didMountRef = useRef(false);\n const locationHistory = useRef(new LocationHistory());\n const currentTab = useRef<string | undefined>(undefined);\n const viewStack = useRef(new ReactRouterViewStack());\n const incomingRouteParams = useRef<Partial<RouteInfo> | null>(null);\n /**\n * Tracks location keys that the user navigated away from via browser back.\n * When a POP event's destination key matches the top of this stack, it's a\n * browser forward navigation. Uses React Router's unique location.key\n * instead of URLs to correctly handle duplicate URLs in history (e.g.,\n * navigating to /details, then /settings, then /details via routerLink,\n * then pressing back).\n * Cleared on PUSH (new navigation invalidates forward history).\n */\n const forwardStack = useRef<string[]>([]);\n /**\n * Tracks the current location key so we can push it onto the forward stack\n * when navigating back. Updated after each history change.\n */\n const currentLocationKeyRef = useRef<string>(location.key);\n\n const [routeInfo, setRouteInfo] = useState<RouteInfo>({\n id: generateId('routeInfo'),\n pathname: location.pathname,\n search: location.search,\n params: {},\n });\n\n useEffect(() => {\n if (didMountRef.current) {\n return;\n }\n\n // Seed the history stack with the initial location and begin listening\n // for future navigations once React has committed the mount. This avoids\n // duplicate entries when React StrictMode runs an extra render pre-commit.\n locationHistory.current.add(routeInfo);\n\n // If IonTabBar already called handleSetCurrentTab during render (before this\n // effect), the tab was stored in currentTab.current but the history entry was\n // not yet seeded. Apply the pending tab to the seed entry now.\n if (currentTab.current) {\n const ri = { ...locationHistory.current.current() };\n if (ri.tab !== currentTab.current) {\n ri.tab = currentTab.current;\n locationHistory.current.update(ri);\n }\n }\n\n registerHistoryListener(handleHistoryChange);\n\n didMountRef.current = true;\n }, []);\n\n // Sync route params extracted by React Router's path matching back into routeInfo.\n // The view stack's match may contain params (e.g., :id) not present in the initial routeInfo.\n useEffect(() => {\n const activeView = viewStack.current.findViewItemByRouteInfo(routeInfo, undefined, true);\n const matchedParams = activeView?.routeData.match?.params as RouteParams | undefined;\n\n if (matchedParams) {\n const paramsCopy = filterUndefinedParams({ ...matchedParams });\n if (areParamsEqual(routeInfo.params as RouteParams | undefined, paramsCopy)) {\n return;\n }\n\n const updatedRouteInfo: RouteInfo = {\n ...routeInfo,\n params: paramsCopy,\n };\n locationHistory.current.update(updatedRouteInfo);\n setRouteInfo(updatedRouteInfo);\n }\n }, [routeInfo]);\n\n /**\n * Triggered whenever the history changes, either through user navigation\n * or programmatic changes. It transforms the raw browser history changes\n * into `RouteInfo` objects, which are needed Ionic's animations and\n * navigation patterns.\n *\n * @param location The current location object from the history.\n * @param action The action that triggered the history change.\n */\n const handleHistoryChange = (location: HistoryLocation, action: HistoryAction) => {\n /**\n * The leaving location is always the current route, for both programmatic\n * and external navigations. Using `previous()` for replace actions was\n * incorrect: it caused the equality check below to skip navigation when\n * the replace destination matched the entry two slots back in history.\n */\n const leavingLocationInfo = locationHistory.current.current();\n\n const leavingUrl = leavingLocationInfo.pathname + leavingLocationInfo.search;\n if (leavingUrl !== location.pathname + location.search) {\n if (!incomingRouteParams.current) {\n // Use history-based tab detection instead of URL-pattern heuristics,\n // so tab routes work with any URL structure (not just paths containing \"/tabs\").\n // Fall back to currentTab.current only when the destination is within the\n // current tab's path hierarchy (prevents non-tab routes from inheriting a tab).\n let tabToUse = locationHistory.current.findTabForPathname(location.pathname);\n if (!tabToUse && currentTab.current) {\n const tabFirstRoute = locationHistory.current.getFirstRouteInfoForTab(currentTab.current);\n const tabRootPath = tabFirstRoute?.pathname;\n if (tabRootPath && (location.pathname === tabRootPath || location.pathname.startsWith(tabRootPath + '/'))) {\n tabToUse = currentTab.current;\n }\n }\n\n /**\n * A `REPLACE` action can be triggered by React Router's\n * `<Navigate />` component.\n */\n if (action === 'REPLACE') {\n incomingRouteParams.current = {\n routeAction: 'replace',\n routeDirection: 'none',\n tab: tabToUse,\n };\n }\n /**\n * A `POP` action can be triggered by the browser's back/forward\n * button. Both fire as POP events, so we use a forward stack to\n * distinguish them: when going back, we push the leaving pathname\n * onto the stack. When the next POP's destination matches the top\n * of the stack, it's a forward navigation.\n */\n if (action === 'POP') {\n const currentRoute = locationHistory.current.current();\n const isForwardNavigation =\n forwardStack.current.length > 0 &&\n forwardStack.current[forwardStack.current.length - 1] === location.key;\n\n if (isForwardNavigation) {\n forwardStack.current.pop();\n incomingRouteParams.current = {\n routeAction: 'push',\n routeDirection: 'forward',\n tab: tabToUse,\n };\n } else if (currentRoute && currentRoute.pushedByRoute) {\n // Back navigation. Record current location key for potential forward\n forwardStack.current.push(currentLocationKeyRef.current);\n const prevInfo = locationHistory.current.findLastLocation(currentRoute);\n\n const isMultiStepBack = checkIsMultiStepBack(prevInfo, location.pathname, locationHistory.current);\n\n if (isMultiStepBack) {\n const destinationInfo = locationHistory.current.findLastLocationByPathname(location.pathname);\n incomingRouteParams.current = {\n ...(destinationInfo || {}),\n routeAction: 'pop',\n routeDirection: 'back',\n };\n } else if (prevInfo && prevInfo.pathname !== location.pathname && currentRoute.tab) {\n // Browser POP destination differs from within-tab back target.\n // Sync URL via replace, like handleNavigateBack's non-linear path (#25141).\n incomingRouteParams.current = { ...prevInfo, routeAction: 'pop', routeDirection: 'back' };\n forwardStack.current = [];\n handleNavigate(prevInfo.pathname + (prevInfo.search || ''), 'pop', 'back', undefined, undefined, prevInfo.tab);\n return;\n } else {\n incomingRouteParams.current = { ...prevInfo, routeAction: 'pop', routeDirection: 'back' };\n }\n } else {\n // It's a non-linear history path like a direct link.\n // Still push the current location key so browser forward is detectable.\n forwardStack.current.push(currentLocationKeyRef.current);\n incomingRouteParams.current = {\n routeAction: 'pop',\n routeDirection: 'none',\n tab: tabToUse,\n };\n }\n }\n if (!incomingRouteParams.current) {\n const state = location.state as LocationState | null;\n incomingRouteParams.current = {\n routeAction: 'push',\n routeDirection: state?.direction || 'forward',\n routeOptions: state?.routerOptions,\n tab: tabToUse,\n };\n }\n }\n\n // New navigation (PUSH) invalidates browser forward history,\n // so clear our forward stack to stay in sync.\n if (action === 'PUSH') {\n forwardStack.current = [];\n }\n\n let routeInfo: RouteInfo;\n\n // If we're navigating away from tabs to a non-tab route, clear the current tab\n if (!locationHistory.current.findTabForPathname(location.pathname) && currentTab.current) {\n currentTab.current = undefined;\n }\n\n /**\n * An existing id indicates that it's re-activating an existing route.\n * e.g., tab switching or navigating back to a previous route\n */\n if (incomingRouteParams.current?.id) {\n routeInfo = {\n ...(incomingRouteParams.current as RouteInfo),\n lastPathname: leavingLocationInfo.pathname,\n };\n locationHistory.current.add(routeInfo);\n /**\n * A new route is being created since it's not re-activating\n * an existing route.\n */\n } else {\n const isPushed =\n incomingRouteParams.current?.routeAction === 'push' &&\n incomingRouteParams.current.routeDirection === 'forward';\n routeInfo = {\n id: generateId('routeInfo'),\n ...incomingRouteParams.current,\n lastPathname: leavingLocationInfo.pathname, // The URL we just came from\n pathname: location.pathname, // The current (destination) URL\n search: location.search,\n params: incomingRouteParams.current?.params\n ? filterUndefinedParams(incomingRouteParams.current.params as RouteParams)\n : {},\n prevRouteLastPathname: leavingLocationInfo.lastPathname,\n };\n if (isPushed) {\n // Only inherit tab from leaving route if we don't already have one.\n // This preserves tab context for same-tab navigation while allowing cross-tab navigation.\n routeInfo.tab = routeInfo.tab || leavingLocationInfo.tab;\n routeInfo.pushedByRoute = leavingLocationInfo.pathname;\n } else if (\n routeInfo.routeAction === 'push' &&\n routeInfo.routeDirection === 'none' &&\n routeInfo.tab === leavingLocationInfo.tab\n ) {\n // Push with routerDirection=\"none\" within the same tab (or non-tab) context.\n // Still needs pushedByRoute so the back button can navigate back correctly.\n // Cross-tab navigations with direction \"none\" are handled by the tab-switching\n // block below which has different pushedByRoute semantics.\n routeInfo.tab = routeInfo.tab || leavingLocationInfo.tab;\n routeInfo.pushedByRoute = leavingLocationInfo.pathname;\n } else if (routeInfo.routeAction === 'pop') {\n // Triggered by a browser back button or handleNavigateBack.\n // Find the route that pushed this one.\n const r = locationHistory.current.findLastLocation(routeInfo);\n routeInfo.pushedByRoute = r?.pushedByRoute;\n // Navigating to a new tab.\n } else if (routeInfo.routeAction === 'push' && routeInfo.tab !== leavingLocationInfo.tab) {\n /**\n * If we are switching tabs grab the last route info for the\n * tab and use its `pushedByRoute`.\n */\n const lastRoute = locationHistory.current.getCurrentRouteInfoForTab(routeInfo.tab);\n /**\n * Tab bar switches (direction 'none') should not create cross-tab back\n * navigation. Only inherit pushedByRoute from the tab's own history.\n */\n if (routeInfo.routeDirection === 'none') {\n routeInfo.pushedByRoute = lastRoute?.pushedByRoute;\n } else {\n routeInfo.pushedByRoute = lastRoute?.pushedByRoute ?? leavingLocationInfo.pathname;\n }\n // Triggered by `navigate()` with replace or a `<Navigate />` component, etc.\n } else if (routeInfo.routeAction === 'replace') {\n /**\n * Make sure to set the `lastPathname`, etc.. to the current route\n * so the page transitions out.\n */\n const currentRouteInfo = locationHistory.current.current();\n\n /**\n * Special handling for `replace` to ensure correct `pushedByRoute`\n * and `lastPathname`.\n *\n * If going from `/home` to `/child`, then replacing from\n * `/child` to `/home`, we don't want the route info to\n * say that `/home` was pushed by `/home` which is not correct.\n */\n const currentPushedBy = currentRouteInfo?.pushedByRoute;\n const pushedByRoute =\n currentPushedBy !== undefined && currentPushedBy !== routeInfo.pathname\n ? currentPushedBy\n : routeInfo.pushedByRoute;\n\n routeInfo.lastPathname = currentRouteInfo?.pathname || routeInfo.lastPathname;\n routeInfo.prevRouteLastPathname = currentRouteInfo?.lastPathname;\n routeInfo.pushedByRoute = pushedByRoute;\n\n /**\n * When replacing routes we should still prefer\n * any custom direction/animation that the developer\n * has specified when navigating first instead of relying\n * on previously used directions/animations.\n */\n routeInfo.routeDirection = routeInfo.routeDirection || currentRouteInfo?.routeDirection;\n routeInfo.routeAnimation = routeInfo.routeAnimation || currentRouteInfo?.routeAnimation;\n }\n\n locationHistory.current.add(routeInfo);\n }\n setRouteInfo(routeInfo);\n }\n\n // Update the current location key after processing the history change.\n // This ensures the forward stack records the correct key when navigating back.\n currentLocationKeyRef.current = location.key;\n incomingRouteParams.current = null;\n };\n\n /**\n * Resets the specified tab to its initial, root route.\n *\n * @param tab The tab to reset.\n * @param originalHref The original href for the tab.\n * @param originalRouteOptions The original route options for the tab.\n */\n const handleResetTab = (tab: string, originalHref: string, originalRouteOptions: any) => {\n const routeInfo = locationHistory.current.getFirstRouteInfoForTab(tab);\n if (routeInfo) {\n const [pathname, search] = originalHref.split('?');\n const newRouteInfo = { ...routeInfo };\n newRouteInfo.pathname = pathname;\n newRouteInfo.search = search ? '?' + search : '';\n newRouteInfo.routeOptions = originalRouteOptions;\n incomingRouteParams.current = { ...newRouteInfo, routeAction: 'pop', routeDirection: 'back' };\n navigate(newRouteInfo.pathname + (newRouteInfo.search || ''));\n }\n };\n\n /**\n * Handles tab changes.\n *\n * @param tab The tab to switch to.\n * @param path The new path for the tab.\n * @param routeOptions Additional route options.\n */\n const handleChangeTab = (tab: string, path?: string, routeOptions?: any) => {\n if (!path) {\n return;\n }\n\n const routeInfo = locationHistory.current.getCurrentRouteInfoForTab(tab);\n const [pathname, search] = path.split('?');\n // User has navigated to the current tab before.\n if (routeInfo) {\n const routeParams = {\n ...routeInfo,\n routeAction: 'push' as RouteAction,\n routeDirection: 'none' as RouterDirection,\n };\n /**\n * User is navigating to the same tab.\n * e.g., `/tabs/home` → `/tabs/home`\n */\n if (routeInfo.pathname === pathname) {\n const newSearch = search ? '?' + search : routeInfo.search;\n incomingRouteParams.current = {\n ...routeParams,\n search: newSearch || '',\n routeOptions,\n };\n\n navigate(routeInfo.pathname + (newSearch || ''));\n /**\n * User is navigating to a different tab.\n * e.g., `/tabs/home` → `/tabs/settings`\n */\n } else {\n incomingRouteParams.current = {\n ...routeParams,\n pathname,\n search: search ? '?' + search : '',\n routeOptions,\n };\n\n navigate(pathname + (search ? '?' + search : ''));\n }\n // User has not navigated to this tab before.\n } else {\n const fullPath = pathname + (search ? '?' + search : '');\n handleNavigate(fullPath, 'push', 'none', undefined, routeOptions, tab);\n }\n };\n\n /**\n * Set the current active tab in `locationHistory`.\n * This is crucial for maintaining tab history since each tab has\n * its own navigation stack.\n *\n * @param tab The tab to set as active.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const handleSetCurrentTab = (tab: string, _routeInfo?: RouteInfo) => {\n currentTab.current = tab;\n const current = locationHistory.current.current();\n if (!current) {\n // locationHistory not yet seeded (e.g., called during initial render\n // before mount effect). The mount effect will seed the correct entry.\n return;\n }\n const ri = { ...current };\n if (ri.tab !== tab) {\n ri.tab = tab;\n locationHistory.current.update(ri);\n }\n };\n\n /**\n * Handles the native back button press.\n * It's usually called when a user presses the platform-native back action.\n */\n const handleNativeBack = () => {\n navigate(-1);\n };\n\n /**\n * Used to manage the back navigation within the Ionic React's routing\n * system. It's deeply integrated with Ionic's view lifecycle, animations,\n * and its custom history tracking (`locationHistory`) to provide a\n * native-like transition and maintain correct application state.\n *\n * @param defaultHref The fallback URL to navigate to if there's no\n * previous entry in the `locationHistory` stack.\n * @param routeAnimation A custom animation builder to override the\n * default \"back\" animation.\n */\n const handleNavigateBack = (defaultHref?: string | RouteInfo, routeAnimation?: AnimationBuilder) => {\n const config = getConfig();\n defaultHref = defaultHref ?? (config && config.get('backButtonDefaultHref' as any));\n const routeInfo = locationHistory.current.current();\n // It's a linear navigation.\n if (routeInfo && routeInfo.pushedByRoute) {\n const prevInfo = locationHistory.current.findLastLocation(routeInfo);\n if (prevInfo) {\n /**\n * This needs to be passed to handleNavigate\n * otherwise incomingRouteParams.routeAnimation\n * will be overridden.\n */\n const incomingAnimation = routeAnimation || routeInfo.routeAnimation;\n incomingRouteParams.current = {\n ...prevInfo,\n routeAction: 'pop',\n routeDirection: 'back',\n routeAnimation: incomingAnimation,\n };\n /**\n * Check if it's a simple linear back navigation (not tabbed).\n * e.g., `/home` → `/settings` → back to `/home`\n */\n const condition1 = routeInfo.lastPathname === routeInfo.pushedByRoute;\n const condition2 = prevInfo.pathname === routeInfo.pushedByRoute && !routeInfo.tab && !prevInfo.tab;\n if (condition1 || condition2) {\n // Record the current location key so browser forward is detectable\n forwardStack.current.push(currentLocationKeyRef.current);\n navigate(-1);\n } else {\n /**\n * It's a non-linear back navigation.\n * e.g., direct link or tab switch or nested navigation with redirects\n * Clear forward stack since the REPLACE-based navigate resets history\n * position, making any prior forward entries unreachable.\n */\n forwardStack.current = [];\n handleNavigate(prevInfo.pathname + (prevInfo.search || ''), 'pop', 'back', incomingAnimation);\n }\n /**\n * `pushedByRoute` exists, but no corresponding previous entry in\n * the history stack.\n */\n } else if (defaultHref) {\n handleNavigate(defaultHref as string, 'pop', 'back', routeAnimation);\n }\n /**\n * No `pushedByRoute` (e.g., initial page load or tab root).\n * Navigate to defaultHref so the back button works on direct\n * deep-link loads (e.g., loading /tab1/child directly).\n * Only navigate when defaultHref is explicitly set. The core\n * back-button component hides itself when no defaultHref is\n * provided, so a click here means the user set one intentionally.\n */\n } else if (defaultHref) {\n handleNavigate(defaultHref as string, 'pop', 'back', routeAnimation);\n }\n };\n\n /**\n * Used to programmatically navigate through the app.\n *\n * @param path The path to navigate to.\n * @param routeAction The action to take (push, replace, etc.).\n * @param routeDirection The direction of the navigation (forward,\n * back, etc.).\n * @param routeAnimation The animation to use for the transition.\n * @param routeOptions Additional options for the route.\n * @param tab The tab to navigate to, if applicable.\n */\n const handleNavigate = (\n path: string,\n routeAction: RouteAction,\n routeDirection?: RouterDirection,\n routeAnimation?: AnimationBuilder,\n routeOptions?: any,\n tab?: string\n ) => {\n const normalizedRouteDirection =\n routeAction === 'push' && routeDirection === undefined ? 'forward' : routeDirection;\n\n // When navigating from tabs context, we need to determine if the destination\n // is also within tabs. If not, we should clear the tab context.\n let navigationTab = tab;\n\n // If no explicit tab is provided and we're in a tab context,\n // check if the destination path is outside of the current tab context.\n // Uses history-based tab detection instead of URL pattern matching,\n // so it works with any tab URL structure.\n if (!tab && currentTab.current && path) {\n // Check if destination was previously visited in a tab context\n const destinationTab = locationHistory.current.findTabForPathname(path);\n if (destinationTab) {\n // Previously visited as a tab route - use the known tab\n navigationTab = destinationTab;\n } else {\n // New destination - check if it's a child of the current tab's root path\n const tabFirstRoute = locationHistory.current.getFirstRouteInfoForTab(currentTab.current);\n if (tabFirstRoute) {\n const tabRootPath = tabFirstRoute.pathname;\n if (path === tabRootPath || path.startsWith(tabRootPath + '/')) {\n // Still within the current tab's path hierarchy\n navigationTab = currentTab.current;\n } else {\n // Destination is outside the current tab context\n currentTab.current = undefined;\n navigationTab = undefined;\n }\n }\n }\n }\n\n // When a replace action targets the same URL as the immediately previous\n // history entry, using replaceState would create a duplicate browser history\n // entry (the previous and current entries would both have the same URL).\n // Navigate back to the previous entry instead to avoid the duplicate.\n // Keep routeAction as 'replace' so StackManager correctly unmounts the\n // leaving view through handleLeavingViewUnmount rather than treating it\n // as a browser-back pop (which preserves views for back/forward history).\n if (routeAction === 'replace') {\n const prevEntry = locationHistory.current.previous();\n const currentEntry = locationHistory.current.current();\n const prevPath = prevEntry ? prevEntry.pathname + (prevEntry.search || '') : undefined;\n if (prevEntry && currentEntry && prevEntry !== currentEntry && prevPath === path) {\n incomingRouteParams.current = {\n ...prevEntry,\n routeAction: 'replace',\n routeDirection: 'back',\n routeAnimation,\n };\n forwardStack.current.push(currentLocationKeyRef.current);\n navigate(-1);\n return;\n }\n }\n\n const baseParams = incomingRouteParams.current ?? {};\n incomingRouteParams.current = {\n ...baseParams,\n routeAction,\n routeDirection: normalizedRouteDirection,\n routeOptions,\n routeAnimation,\n tab: navigationTab,\n };\n\n navigate(path, { replace: routeAction !== 'push' });\n };\n\n /**\n * Navigates to a new root path, clearing Ionic's navigation history so that\n * canGoBack() returns false after the transition. All previously mounted views\n * are unmounted. Useful for post-login / post-logout root navigation.\n *\n * @param pathname The path to navigate to.\n * @param routeAnimation An optional custom animation builder.\n */\n const handleNavigateRoot = (pathname: string, routeAnimation?: AnimationBuilder) => {\n currentTab.current = undefined;\n forwardStack.current = [];\n\n incomingRouteParams.current = {\n routeAction: 'replace',\n routeDirection: 'root',\n routeAnimation,\n };\n\n navigate(pathname, { replace: true });\n };\n\n const routeMangerContextValue: RouteManagerContextState = {\n canGoBack: () => locationHistory.current.canGoBack(),\n clearOutlet: viewStack.current.clear,\n findViewItemByPathname: viewStack.current.findViewItemByPathname,\n getChildrenToRender: viewStack.current.getChildrenToRender,\n getViewItemsForOutlet: viewStack.current.getViewItemsForOutlet.bind(viewStack.current),\n goBack: () => handleNavigateBack(),\n createViewItem: viewStack.current.createViewItem,\n findViewItemByRouteInfo: viewStack.current.findViewItemByRouteInfo,\n findLeavingViewItemByRouteInfo: viewStack.current.findLeavingViewItemByRouteInfo,\n addViewItem: viewStack.current.add,\n unMountViewItem: viewStack.current.remove,\n };\n\n return (\n <RouteManagerContext.Provider value={routeMangerContextValue}>\n <NavManager\n ionRoute={IonRouteInner}\n stackManager={StackManager}\n routeInfo={routeInfo}\n onNativeBack={handleNativeBack}\n onNavigateBack={handleNavigateBack}\n onNavigate={handleNavigate}\n onNavigateRoot={handleNavigateRoot}\n onSetCurrentTab={handleSetCurrentTab}\n onChangeTab={handleChangeTab}\n onResetTab={handleResetTab}\n locationHistory={locationHistory.current}\n >\n {children}\n </NavManager>\n </RouteManagerContext.Provider>\n );\n};\n\nIonRouter.displayName = 'IonRouter';\n","/**\n * `IonReactRouter` facilitates the integration of Ionic's specific\n * navigation and UI management with the standard React Router mechanisms,\n * allowing an inner Ionic-specific router (`IonRouter`) to react to\n * navigation events.\n */\n\nimport type { Action as HistoryAction, Location as HistoryLocation } from 'history';\nimport type { PropsWithChildren } from 'react';\nimport React, { useEffect, useRef, useCallback } from 'react';\nimport type { BrowserRouterProps } from 'react-router-dom';\nimport { BrowserRouter, useLocation, useNavigationType } from 'react-router-dom';\n\nimport { IonRouter } from './IonRouter';\n\n/**\n * This component acts as a bridge to ensure React Router hooks like\n * `useLocation` and `useNavigationType` are called within the valid\n * context of a `<BrowserRouter>`.\n *\n * It was split from `IonReactRouter` because these hooks must be\n * descendants of a `<Router>` component, which `BrowserRouter` provides.\n */\nconst RouterContent = ({ children }: PropsWithChildren<{}>) => {\n const location = useLocation();\n const navigationType = useNavigationType();\n\n const historyListenHandler = useRef<(location: HistoryLocation, action: HistoryAction) => void>();\n\n const registerHistoryListener = useCallback((cb: (location: HistoryLocation, action: HistoryAction) => void) => {\n historyListenHandler.current = cb;\n }, []);\n\n /**\n * Processes navigation changes within the application.\n *\n * Its purpose is to relay the current `location` and the associated\n * `action` ('PUSH', 'POP', or 'REPLACE') to any registered listeners,\n * primarily for `IonRouter` to manage Ionic-specific UI updates and\n * navigation stack behavior.\n *\n * @param loc The current browser history location object.\n * @param act The type of navigation action ('PUSH', 'POP', or\n * 'REPLACE').\n */\n const handleHistoryChange = useCallback((loc: HistoryLocation, act: HistoryAction) => {\n if (historyListenHandler.current) {\n historyListenHandler.current(loc, act);\n }\n }, []);\n\n useEffect(() => {\n handleHistoryChange(location, navigationType);\n }, [location, navigationType, handleHistoryChange]);\n\n return <IonRouter registerHistoryListener={registerHistoryListener}>{children}</IonRouter>;\n};\n\nexport const IonReactRouter = ({ children, ...browserRouterProps }: PropsWithChildren<BrowserRouterProps>) => {\n return (\n <BrowserRouter {...browserRouterProps}>\n <RouterContent>{children}</RouterContent>\n </BrowserRouter>\n );\n};\n","/**\n * `IonReactMemoryRouter` provides a way to use `react-router` in\n * environments where a traditional browser history (like `BrowserRouter`)\n * isn't available or desirable.\n */\n\nimport type { Action as HistoryAction, Location as HistoryLocation } from 'history';\nimport type { PropsWithChildren } from 'react';\nimport React, { useEffect, useRef, useCallback } from 'react';\nimport type { MemoryRouterProps } from 'react-router';\nimport { MemoryRouter, useLocation, useNavigationType } from 'react-router';\n\nimport { IonRouter } from './IonRouter';\n\nconst RouterContent = ({ children }: PropsWithChildren<{}>) => {\n const location = useLocation();\n const navigationType = useNavigationType();\n\n const historyListenHandler = useRef<(location: HistoryLocation, action: HistoryAction) => void>();\n\n const registerHistoryListener = useCallback((cb: (location: HistoryLocation, action: HistoryAction) => void) => {\n historyListenHandler.current = cb;\n }, []);\n\n /**\n * Processes navigation changes within the application.\n *\n * Its purpose is to relay the current `location` and the associated\n * `action` ('PUSH', 'POP', or 'REPLACE') to any registered listeners,\n * primarily for `IonRouter` to manage Ionic-specific UI updates and\n * navigation stack behavior.\n *\n * @param location The current browser history location object.\n * @param action The type of navigation action ('PUSH', 'POP', or\n * 'REPLACE').\n */\n const handleHistoryChange = useCallback((loc: HistoryLocation, act: HistoryAction) => {\n if (historyListenHandler.current) {\n historyListenHandler.current(loc, act);\n }\n }, []);\n\n useEffect(() => {\n handleHistoryChange(location, navigationType);\n }, [location, navigationType, handleHistoryChange]);\n\n return <IonRouter registerHistoryListener={registerHistoryListener}>{children}</IonRouter>;\n};\n\nexport const IonReactMemoryRouter = ({ children, ...routerProps }: PropsWithChildren<MemoryRouterProps>) => {\n return (\n <MemoryRouter {...routerProps}>\n <RouterContent>{children}</RouterContent>\n </MemoryRouter>\n );\n};\n","/**\n * `IonReactHashRouter` provides a way to use hash-based routing in Ionic\n * React applications.\n */\n\nimport type { Action as HistoryAction, Location as HistoryLocation } from 'history';\nimport type { PropsWithChildren } from 'react';\nimport React, { useEffect, useRef, useCallback } from 'react';\nimport type { HashRouterProps } from 'react-router-dom';\nimport { HashRouter, useLocation, useNavigationType } from 'react-router-dom';\n\nimport { IonRouter } from './IonRouter';\n\nconst RouterContent = ({ children }: PropsWithChildren<{}>) => {\n const location = useLocation();\n const navigationType = useNavigationType();\n\n const historyListenHandler = useRef<(location: HistoryLocation, action: HistoryAction) => void>();\n\n const registerHistoryListener = useCallback((cb: (location: HistoryLocation, action: HistoryAction) => void) => {\n historyListenHandler.current = cb;\n }, []);\n\n /**\n * Processes navigation changes within the application.\n *\n * Its purpose is to relay the current `location` and the associated\n * `action` ('PUSH', 'POP', or 'REPLACE') to any registered listeners,\n * primarily for `IonRouter` to manage Ionic-specific UI updates and\n * navigation stack behavior.\n *\n * @param location The current browser history location object.\n * @param action The type of navigation action ('PUSH', 'POP', or\n * 'REPLACE').\n */\n const handleHistoryChange = useCallback((loc: HistoryLocation, act: HistoryAction) => {\n if (historyListenHandler.current) {\n historyListenHandler.current(loc, act);\n }\n }, []);\n\n useEffect(() => {\n handleHistoryChange(location, navigationType);\n }, [location, navigationType, handleHistoryChange]);\n\n return <IonRouter registerHistoryListener={registerHistoryListener}>{children}</IonRouter>;\n};\n\nexport const IonReactHashRouter = ({ children, ...routerProps }: PropsWithChildren<HashRouterProps>) => {\n return (\n <HashRouter {...routerProps}>\n <RouterContent>{children}</RouterContent>\n </HashRouter>\n );\n};\n"],"names":["reactRouterMatchPath","matchComponent","RouteContext","RouterContent","useLocation","useNavigationType"],"mappings":";;;;;;AAIO,MAAM,aAAa,GAAG,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,aAAa,EAAE,OAAO,EAAiB,KAAI;AACtF,IAAA,OAAO,oBAAC,KAAK,EAAA,EAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,GAAI;AAC5F,CAAC;;ACgBD;;;AAGG;AACI,MAAM,SAAS,GAAG,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAoB,KAA8B;;AACpG,IAAA,MAAM,EAAE,IAAI,EAAE,KAAK,EAAA,GAAmB,cAAc,EAA5B,SAAS,GAAA,MAAA,CAAK,cAAc,EAA9C,CAAA,MAAA,EAAA,OAAA,CAA6B,CAAiB;;AAGpD,IAAA,IAAI,KAAK,IAAI,CAAC,IAAI,EAAE;AAClB,QAAA,IAAI,QAAQ,KAAK,EAAE,IAAI,QAAQ,KAAK,GAAG,EAAE;YACvC,OAAO;AACL,gBAAA,MAAM,EAAE,EAAE;AACV,gBAAA,QAAQ,EAAE,QAAQ;gBAClB,YAAY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W,GAAA,MAAA,CAAA,EAAA,EAA1B,YAA4B,CAAF;AAC3D,IAAA,QACE,KAAA,CAAA,aAAA,CAAC,UAAU,EAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAK,WAAW,CAAA;AACzB,QAAA,KAAA,CAAA,aAAA,CAAC,aAAa,EAAA,IAAA,EAAE,QAAQ,CAAiB,CAC9B;AAEjB;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../src/ReactRouter/IonRouteInner.tsx","../src/ReactRouter/utils/matchPath.ts","../src/ReactRouter/ReactRouterViewStack.tsx","../src/ReactRouter/clonePageElement.ts","../src/ReactRouter/StackManager.tsx","../src/ReactRouter/IonRouter.tsx","../src/ReactRouter/IonReactRouter.tsx","../src/ReactRouter/IonReactMemoryRouter.tsx","../src/ReactRouter/IonReactHashRouter.tsx"],"sourcesContent":["import type { IonRouteProps } from '@ionic/react';\nimport React from 'react';\nimport { Route } from 'react-router';\n\nexport class IonRouteInner extends React.PureComponent<IonRouteProps> {\n render() {\n return (\n <Route\n path={this.props.path}\n exact={this.props.exact}\n render={this.props.render}\n {\n /**\n * `computedMatch` is a private API in react-router v5 that\n * has been removed in v6.\n *\n * This needs to be removed when we support v6.\n *\n * TODO: FW-647\n */\n ...((this.props as any).computedMatch !== undefined\n ? {\n computedMatch: (this.props as any).computedMatch,\n }\n : {})\n }\n />\n );\n }\n}\n","import { matchPath as reactRouterMatchPath } from 'react-router';\n\ninterface MatchPathOptions {\n /**\n * The pathname to match against.\n */\n pathname: string;\n /**\n * The props to match against, they are identical to the matching props `Route` accepts.\n */\n componentProps: {\n path?: string;\n from?: string;\n component?: any;\n exact?: boolean;\n };\n}\n\n/**\n * @see https://v5.reactrouter.com/web/api/matchPath\n */\nexport const matchPath = ({\n pathname,\n componentProps,\n}: MatchPathOptions): false | ReturnType<typeof reactRouterMatchPath> => {\n const { exact, component } = componentProps;\n\n const path = componentProps.path || componentProps.from;\n /***\n * The props to match against, they are identical\n * to the matching props `Route` accepts. It could also be a string\n * or an array of strings as shortcut for `{ path }`.\n */\n const matchProps = {\n exact,\n path,\n component,\n };\n\n const match = reactRouterMatchPath(pathname, matchProps);\n\n if (!match) {\n return false;\n }\n\n return match;\n};\n","import type { RouteInfo, ViewItem } from '@ionic/react';\nimport { IonRoute, ViewLifeCycleManager, ViewStacks, generateId } from '@ionic/react';\nimport React from 'react';\n\nimport { matchPath } from './utils/matchPath';\n\nexport class ReactRouterViewStack extends ViewStacks {\n constructor() {\n super();\n this.createViewItem = this.createViewItem.bind(this);\n this.findViewItemByRouteInfo = this.findViewItemByRouteInfo.bind(this);\n this.findLeavingViewItemByRouteInfo = this.findLeavingViewItemByRouteInfo.bind(this);\n this.getChildrenToRender = this.getChildrenToRender.bind(this);\n this.findViewItemByPathname = this.findViewItemByPathname.bind(this);\n }\n\n createViewItem(outletId: string, reactElement: React.ReactElement, routeInfo: RouteInfo, page?: HTMLElement) {\n const viewItem: ViewItem = {\n id: generateId('viewItem'),\n outletId,\n ionPageElement: page,\n reactElement,\n mount: true,\n ionRoute: false,\n };\n\n if (reactElement.type === IonRoute) {\n viewItem.ionRoute = true;\n viewItem.disableIonPageManagement = reactElement.props.disableIonPageManagement;\n }\n\n viewItem.routeData = {\n match: matchPath({\n pathname: routeInfo.pathname,\n componentProps: reactElement.props,\n }),\n childProps: reactElement.props,\n };\n\n return viewItem;\n }\n\n getChildrenToRender(outletId: string, ionRouterOutlet: React.ReactElement, routeInfo: RouteInfo) {\n const viewItems = this.getViewItemsForOutlet(outletId);\n\n // Sync latest routes with viewItems\n React.Children.forEach(ionRouterOutlet.props.children, (child: React.ReactElement) => {\n const viewItem = viewItems.find((v) => {\n return matchComponent(child, v.routeData.childProps.path || v.routeData.childProps.from);\n });\n if (viewItem) {\n viewItem.reactElement = child;\n }\n });\n\n const children = viewItems.map((viewItem) => {\n let clonedChild;\n if (viewItem.ionRoute && !viewItem.disableIonPageManagement) {\n clonedChild = (\n <ViewLifeCycleManager\n key={`view-${viewItem.id}`}\n mount={viewItem.mount}\n removeView={() => this.remove(viewItem)}\n >\n {React.cloneElement(viewItem.reactElement, {\n computedMatch: viewItem.routeData.match,\n })}\n </ViewLifeCycleManager>\n );\n } else {\n const match = matchComponent(viewItem.reactElement, routeInfo.pathname);\n clonedChild = (\n <ViewLifeCycleManager\n key={`view-${viewItem.id}`}\n mount={viewItem.mount}\n removeView={() => this.remove(viewItem)}\n >\n {React.cloneElement(viewItem.reactElement, {\n computedMatch: viewItem.routeData.match,\n })}\n </ViewLifeCycleManager>\n );\n\n if (!match && viewItem.routeData.match) {\n viewItem.routeData.match = undefined;\n viewItem.mount = false;\n }\n }\n\n return clonedChild;\n });\n return children;\n }\n\n findViewItemByRouteInfo(routeInfo: RouteInfo, outletId?: string, updateMatch?: boolean) {\n const { viewItem, match } = this.findViewItemByPath(routeInfo.pathname, outletId);\n const shouldUpdateMatch = updateMatch === undefined || updateMatch === true;\n if (shouldUpdateMatch && viewItem && match) {\n viewItem.routeData.match = match;\n }\n return viewItem;\n }\n\n findLeavingViewItemByRouteInfo(routeInfo: RouteInfo, outletId?: string, mustBeIonRoute = true) {\n const { viewItem } = this.findViewItemByPath(routeInfo.lastPathname!, outletId, mustBeIonRoute);\n return viewItem;\n }\n\n findViewItemByPathname(pathname: string, outletId?: string) {\n const { viewItem } = this.findViewItemByPath(pathname, outletId);\n return viewItem;\n }\n\n /**\n * Returns the matching view item and the match result for a given pathname.\n */\n private findViewItemByPath(pathname: string, outletId?: string, mustBeIonRoute?: boolean) {\n let viewItem: ViewItem | undefined;\n let match: ReturnType<typeof matchPath> | undefined;\n let viewStack: ViewItem[];\n\n if (outletId) {\n viewStack = this.getViewItemsForOutlet(outletId);\n viewStack.some(matchView);\n if (!viewItem) {\n viewStack.some(matchDefaultRoute);\n }\n } else {\n const viewItems = this.getAllViewItems();\n viewItems.some(matchView);\n if (!viewItem) {\n viewItems.some(matchDefaultRoute);\n }\n }\n\n return { viewItem, match };\n\n function matchView(v: ViewItem) {\n if (mustBeIonRoute && !v.ionRoute) {\n return false;\n }\n\n match = matchPath({\n pathname,\n componentProps: v.routeData.childProps,\n });\n\n if (match) {\n /**\n * Even though we have a match from react-router, we do not know if the match\n * is for this specific view item.\n *\n * To validate this, we need to check if the path and url match the view item's route data.\n */\n const hasParameter = match.path.includes(':');\n if (!hasParameter || (hasParameter && match.url === v.routeData?.match?.url)) {\n viewItem = v;\n return true;\n }\n }\n return false;\n }\n\n function matchDefaultRoute(v: ViewItem) {\n // try to find a route that doesn't have a path or from prop, that will be our default route\n if (!v.routeData.childProps.path && !v.routeData.childProps.from) {\n match = {\n path: pathname,\n url: pathname,\n isExact: true,\n params: {},\n };\n viewItem = v;\n return true;\n }\n return false;\n }\n }\n}\n\nfunction matchComponent(node: React.ReactElement, pathname: string) {\n return matchPath({\n pathname,\n componentProps: node.props,\n });\n}\n","export function clonePageElement(leavingViewHtml: string | HTMLElement) {\n let html: string;\n if (typeof leavingViewHtml === 'string') {\n html = leavingViewHtml;\n } else {\n html = leavingViewHtml.outerHTML;\n }\n if (document) {\n const newEl = document.createElement('div');\n newEl.innerHTML = html;\n newEl.style.zIndex = '';\n // Remove an existing back button so the new element doesn't get two of them\n const ionBackButton = newEl.getElementsByTagName('ion-back-button');\n if (ionBackButton[0]) {\n ionBackButton[0].remove();\n }\n return newEl.firstChild as HTMLElement;\n }\n return undefined;\n}\n","import type { RouteInfo, StackContextState, ViewItem } from '@ionic/react';\nimport { RouteManagerContext, StackContext, generateId, getConfig } from '@ionic/react';\nimport React from 'react';\n\nimport { clonePageElement } from './clonePageElement';\nimport { matchPath } from './utils/matchPath';\n\n// TODO(FW-2959): types\n\ninterface StackManagerProps {\n routeInfo: RouteInfo;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\ninterface StackManagerState {}\n\nconst isViewVisible = (el: HTMLElement) =>\n !el.classList.contains('ion-page-invisible') && !el.classList.contains('ion-page-hidden');\n\nexport class StackManager extends React.PureComponent<StackManagerProps, StackManagerState> {\n id: string;\n context!: React.ContextType<typeof RouteManagerContext>;\n ionRouterOutlet?: React.ReactElement;\n routerOutletElement: HTMLIonRouterOutletElement | undefined;\n prevProps?: StackManagerProps;\n skipTransition: boolean;\n\n stackContextValue: StackContextState = {\n registerIonPage: this.registerIonPage.bind(this),\n isInOutlet: () => true,\n };\n\n private clearOutletTimeout: any;\n private pendingPageTransition = false;\n\n constructor(props: StackManagerProps) {\n super(props);\n this.registerIonPage = this.registerIonPage.bind(this);\n this.transitionPage = this.transitionPage.bind(this);\n this.handlePageTransition = this.handlePageTransition.bind(this);\n this.id = generateId('routerOutlet');\n this.prevProps = undefined;\n this.skipTransition = false;\n }\n\n componentDidMount() {\n if (this.clearOutletTimeout) {\n /**\n * The clearOutlet integration with React Router is a bit hacky.\n * It uses a timeout to clear the outlet after a transition.\n * In React v18, components are mounted and unmounted in development mode\n * to check for side effects.\n *\n * This clearTimeout prevents the outlet from being cleared when the component is re-mounted,\n * which should only happen in development mode and as a result of a hot reload.\n */\n clearTimeout(this.clearOutletTimeout);\n }\n if (this.routerOutletElement) {\n this.setupRouterOutlet(this.routerOutletElement);\n this.handlePageTransition(this.props.routeInfo);\n }\n }\n\n componentDidUpdate(prevProps: StackManagerProps) {\n const { pathname } = this.props.routeInfo;\n const { pathname: prevPathname } = prevProps.routeInfo;\n\n if (pathname !== prevPathname) {\n this.prevProps = prevProps;\n this.handlePageTransition(this.props.routeInfo);\n } else if (this.pendingPageTransition) {\n this.handlePageTransition(this.props.routeInfo);\n this.pendingPageTransition = false;\n }\n }\n\n componentWillUnmount() {\n this.clearOutletTimeout = this.context.clearOutlet(this.id);\n }\n\n async handlePageTransition(routeInfo: RouteInfo) {\n if (!this.routerOutletElement || !this.routerOutletElement.commit) {\n /**\n * The route outlet has not mounted yet. We need to wait for it to render\n * before we can transition the page.\n *\n * Set a flag to indicate that we should transition the page after\n * the component has updated.\n */\n this.pendingPageTransition = true;\n } else {\n let enteringViewItem = this.context.findViewItemByRouteInfo(routeInfo, this.id);\n let leavingViewItem = this.context.findLeavingViewItemByRouteInfo(routeInfo, this.id);\n\n if (!leavingViewItem && routeInfo.prevRouteLastPathname) {\n leavingViewItem = this.context.findViewItemByPathname(routeInfo.prevRouteLastPathname, this.id);\n }\n\n // Check if leavingViewItem should be unmounted\n if (leavingViewItem) {\n if (routeInfo.routeAction === 'replace') {\n leavingViewItem.mount = false;\n } else if (!(routeInfo.routeAction === 'push' && routeInfo.routeDirection === 'forward')) {\n if (routeInfo.routeDirection !== 'none' && enteringViewItem !== leavingViewItem) {\n leavingViewItem.mount = false;\n }\n } else if (routeInfo.routeOptions?.unmount) {\n leavingViewItem.mount = false;\n }\n }\n\n const enteringRoute = matchRoute(this.ionRouterOutlet?.props.children, routeInfo) as React.ReactElement;\n\n if (enteringViewItem) {\n enteringViewItem.reactElement = enteringRoute;\n } else if (enteringRoute) {\n enteringViewItem = this.context.createViewItem(this.id, enteringRoute, routeInfo);\n this.context.addViewItem(enteringViewItem);\n }\n\n if (enteringViewItem && enteringViewItem.ionPageElement) {\n /**\n * If the entering view item is the same as the leaving view item,\n * then we don't need to transition.\n */\n if (enteringViewItem === leavingViewItem) {\n /**\n * If the entering view item is the same as the leaving view item,\n * we are either transitioning using parameterized routes to the same view\n * or a parent router outlet is re-rendering as a result of React props changing.\n *\n * If the route data does not match the current path, the parent router outlet\n * is attempting to transition and we cancel the operation.\n */\n if (enteringViewItem.routeData.match.url !== routeInfo.pathname) {\n return;\n }\n }\n\n /**\n * If there isn't a leaving view item, but the route info indicates\n * that the user has routed from a previous path, then we need\n * to find the leaving view item to transition between.\n */\n if (!leavingViewItem && this.props.routeInfo.prevRouteLastPathname) {\n leavingViewItem = this.context.findViewItemByPathname(this.props.routeInfo.prevRouteLastPathname, this.id);\n }\n\n /**\n * If the entering view is already visible and the leaving view is not, the transition does not need to occur.\n */\n if (\n isViewVisible(enteringViewItem.ionPageElement) &&\n leavingViewItem !== undefined &&\n !isViewVisible(leavingViewItem.ionPageElement!)\n ) {\n return;\n }\n\n /**\n * The view should only be transitioned in the following cases:\n * 1. Performing a replace or pop action, such as a swipe to go back gesture\n * to animation the leaving view off the screen.\n *\n * 2. Navigating between top-level router outlets, such as /page-1 to /page-2;\n * or navigating within a nested outlet, such as /tabs/tab-1 to /tabs/tab-2.\n *\n * 3. The entering view is an ion-router-outlet containing a page\n * matching the current route and that hasn't already transitioned in.\n *\n * This should only happen when navigating directly to a nested router outlet\n * route or on an initial page load (i.e. refreshing). In cases when loading\n * /tabs/tab-1, we need to transition the /tabs page element into the view.\n */\n this.transitionPage(routeInfo, enteringViewItem, leavingViewItem);\n } else if (leavingViewItem && !enteringRoute && !enteringViewItem) {\n // If we have a leavingView but no entering view/route, we are probably leaving to\n // another outlet, so hide this leavingView. We do it in a timeout to give time for a\n // transition to finish.\n // setTimeout(() => {\n if (leavingViewItem.ionPageElement) {\n leavingViewItem.ionPageElement.classList.add('ion-page-hidden');\n leavingViewItem.ionPageElement.setAttribute('aria-hidden', 'true');\n }\n // }, 250);\n }\n\n this.forceUpdate();\n }\n }\n\n registerIonPage(page: HTMLElement, routeInfo: RouteInfo) {\n const foundView = this.context.findViewItemByRouteInfo(routeInfo, this.id);\n if (foundView) {\n const oldPageElement = foundView.ionPageElement;\n foundView.ionPageElement = page;\n foundView.ionRoute = true;\n\n /**\n * React 18 will unmount and remount IonPage\n * elements in development mode when using createRoot.\n * This can cause duplicate page transitions to occur.\n */\n if (oldPageElement === page) {\n return;\n }\n }\n this.handlePageTransition(routeInfo);\n }\n\n async setupRouterOutlet(routerOutlet: HTMLIonRouterOutletElement) {\n const canStart = () => {\n const config = getConfig();\n const swipeEnabled = config && config.get('swipeBackEnabled', routerOutlet.mode === 'ios');\n if (!swipeEnabled) {\n return false;\n }\n\n const { routeInfo } = this.props;\n\n const propsToUse =\n this.prevProps && this.prevProps.routeInfo.pathname === routeInfo.pushedByRoute\n ? this.prevProps.routeInfo\n : ({ pathname: routeInfo.pushedByRoute || '' } as any);\n const enteringViewItem = this.context.findViewItemByRouteInfo(propsToUse, this.id, false);\n\n return (\n !!enteringViewItem &&\n /**\n * The root url '/' is treated as\n * the first view item (but is never mounted),\n * so we do not want to swipe back to the\n * root url.\n */\n enteringViewItem.mount &&\n /**\n * When on the first page (whatever view\n * you land on after the root url) it\n * is possible for findViewItemByRouteInfo to\n * return the exact same view you are currently on.\n * Make sure that we are not swiping back to the same\n * instances of a view.\n */\n enteringViewItem.routeData.match.path !== routeInfo.pathname\n );\n };\n\n const onStart = async () => {\n const { routeInfo } = this.props;\n\n const propsToUse =\n this.prevProps && this.prevProps.routeInfo.pathname === routeInfo.pushedByRoute\n ? this.prevProps.routeInfo\n : ({ pathname: routeInfo.pushedByRoute || '' } as any);\n const enteringViewItem = this.context.findViewItemByRouteInfo(propsToUse, this.id, false);\n const leavingViewItem = this.context.findViewItemByRouteInfo(routeInfo, this.id, false);\n\n /**\n * When the gesture starts, kick off\n * a transition that is controlled\n * via a swipe gesture.\n */\n if (enteringViewItem && leavingViewItem) {\n await this.transitionPage(routeInfo, enteringViewItem, leavingViewItem, 'back', true);\n }\n\n return Promise.resolve();\n };\n const onEnd = (shouldContinue: boolean) => {\n if (shouldContinue) {\n this.skipTransition = true;\n\n this.context.goBack();\n } else {\n /**\n * In the event that the swipe\n * gesture was aborted, we should\n * re-hide the page that was going to enter.\n */\n const { routeInfo } = this.props;\n\n const propsToUse =\n this.prevProps && this.prevProps.routeInfo.pathname === routeInfo.pushedByRoute\n ? this.prevProps.routeInfo\n : ({ pathname: routeInfo.pushedByRoute || '' } as any);\n const enteringViewItem = this.context.findViewItemByRouteInfo(propsToUse, this.id, false);\n const leavingViewItem = this.context.findViewItemByRouteInfo(routeInfo, this.id, false);\n\n /**\n * Ionic React has a design defect where it\n * a) Unmounts the leaving view item when using parameterized routes\n * b) Considers the current view to be the entering view when using\n * parameterized routes\n *\n * As a result, we should not hide the view item here\n * as it will cause the current view to be hidden.\n */\n if (enteringViewItem !== leavingViewItem && enteringViewItem?.ionPageElement !== undefined) {\n const { ionPageElement } = enteringViewItem;\n ionPageElement.setAttribute('aria-hidden', 'true');\n ionPageElement.classList.add('ion-page-hidden');\n }\n }\n };\n\n routerOutlet.swipeHandler = {\n canStart,\n onStart,\n onEnd,\n };\n }\n\n async transitionPage(\n routeInfo: RouteInfo,\n enteringViewItem: ViewItem,\n leavingViewItem?: ViewItem,\n direction?: 'forward' | 'back',\n progressAnimation = false\n ) {\n const runCommit = async (enteringEl: HTMLElement, leavingEl?: HTMLElement) => {\n const skipTransition = this.skipTransition;\n\n /**\n * If the transition was handled\n * via the swipe to go back gesture,\n * then we do not want to perform\n * another transition.\n *\n * We skip adding ion-page or ion-page-invisible\n * because the entering view already exists in the DOM.\n * If we added the classes, there would be a flicker where\n * the view would be briefly hidden.\n */\n if (skipTransition) {\n /**\n * We need to reset skipTransition before\n * we call routerOutlet.commit otherwise\n * the transition triggered by the swipe\n * to go back gesture would reset it. In\n * that case you would see a duplicate\n * transition triggered by handlePageTransition\n * in componentDidUpdate.\n */\n this.skipTransition = false;\n } else {\n enteringEl.classList.add('ion-page');\n enteringEl.classList.add('ion-page-invisible');\n }\n\n await routerOutlet.commit(enteringEl, leavingEl, {\n duration: skipTransition || directionToUse === undefined ? 0 : undefined,\n direction: directionToUse,\n showGoBack: !!routeInfo.pushedByRoute,\n progressAnimation,\n animationBuilder: routeInfo.routeAnimation,\n });\n };\n\n const routerOutlet = this.routerOutletElement!;\n\n const routeInfoFallbackDirection =\n routeInfo.routeDirection === 'none' || routeInfo.routeDirection === 'root' ? undefined : routeInfo.routeDirection;\n const directionToUse = direction ?? routeInfoFallbackDirection;\n\n if (enteringViewItem && enteringViewItem.ionPageElement && this.routerOutletElement) {\n if (leavingViewItem && leavingViewItem.ionPageElement && enteringViewItem === leavingViewItem) {\n // If a page is transitioning to another version of itself\n // we clone it so we can have an animation to show\n\n const match = matchComponent(leavingViewItem.reactElement, routeInfo.pathname, true);\n if (match) {\n const newLeavingElement = clonePageElement(leavingViewItem.ionPageElement.outerHTML);\n if (newLeavingElement) {\n this.routerOutletElement.appendChild(newLeavingElement);\n await runCommit(enteringViewItem.ionPageElement, newLeavingElement);\n this.routerOutletElement.removeChild(newLeavingElement);\n }\n } else {\n await runCommit(enteringViewItem.ionPageElement, undefined);\n }\n } else {\n await runCommit(enteringViewItem.ionPageElement, leavingViewItem?.ionPageElement);\n if (leavingViewItem && leavingViewItem.ionPageElement && !progressAnimation) {\n leavingViewItem.ionPageElement.classList.add('ion-page-hidden');\n leavingViewItem.ionPageElement.setAttribute('aria-hidden', 'true');\n }\n }\n }\n }\n\n render() {\n const { children } = this.props;\n const ionRouterOutlet = React.Children.only(children) as React.ReactElement;\n this.ionRouterOutlet = ionRouterOutlet;\n\n const components = this.context.getChildrenToRender(this.id, this.ionRouterOutlet, this.props.routeInfo, () => {\n this.forceUpdate();\n });\n\n return (\n <StackContext.Provider value={this.stackContextValue}>\n {React.cloneElement(\n ionRouterOutlet as any,\n {\n ref: (node: HTMLIonRouterOutletElement) => {\n if (ionRouterOutlet.props.setRef) {\n ionRouterOutlet.props.setRef(node);\n }\n if (ionRouterOutlet.props.forwardedRef) {\n ionRouterOutlet.props.forwardedRef.current = node;\n }\n this.routerOutletElement = node;\n const { ref } = ionRouterOutlet as any;\n if (typeof ref === 'function') {\n ref(node);\n }\n },\n },\n components\n )}\n </StackContext.Provider>\n );\n }\n\n static get contextType() {\n return RouteManagerContext;\n }\n}\n\nexport default StackManager;\n\nfunction matchRoute(node: React.ReactNode, routeInfo: RouteInfo) {\n let matchedNode: React.ReactNode;\n React.Children.forEach(node as React.ReactElement, (child: React.ReactElement) => {\n const match = matchPath({\n pathname: routeInfo.pathname,\n componentProps: child.props,\n });\n if (match) {\n matchedNode = child;\n }\n });\n\n if (matchedNode) {\n return matchedNode;\n }\n // If we haven't found a node\n // try to find one that doesn't have a path or from prop, that will be our not found route\n React.Children.forEach(node as React.ReactElement, (child: React.ReactElement) => {\n if (!(child.props.path || child.props.from)) {\n matchedNode = child;\n }\n });\n\n return matchedNode;\n}\n\nfunction matchComponent(node: React.ReactElement, pathname: string, forceExact?: boolean) {\n return matchPath({\n pathname,\n componentProps: {\n ...node.props,\n exact: forceExact,\n },\n });\n}\n","import type {\n AnimationBuilder,\n RouteAction,\n RouteInfo,\n RouteManagerContextState,\n RouterDirection,\n ViewItem,\n} from '@ionic/react';\nimport { LocationHistory, NavManager, RouteManagerContext, generateId, getConfig } from '@ionic/react';\nimport type { Action as HistoryAction, Location as HistoryLocation } from 'history';\nimport React from 'react';\nimport type { RouteComponentProps } from 'react-router-dom';\nimport { withRouter } from 'react-router-dom';\n\nimport { IonRouteInner } from './IonRouteInner';\nimport { ReactRouterViewStack } from './ReactRouterViewStack';\nimport StackManager from './StackManager';\n\nexport interface LocationState {\n direction?: RouterDirection;\n routerOptions?: { as?: string; unmount?: boolean };\n}\n\ninterface IonRouteProps extends RouteComponentProps<{}, {}, LocationState> {\n registerHistoryListener: (cb: (location: HistoryLocation<any>, action: HistoryAction) => void) => void;\n}\n\ninterface IonRouteState {\n routeInfo: RouteInfo;\n}\n\nclass IonRouterInner extends React.PureComponent<IonRouteProps, IonRouteState> {\n currentTab?: string;\n exitViewFromOtherOutletHandlers: ((pathname: string) => ViewItem | undefined)[] = [];\n incomingRouteParams?: Partial<RouteInfo>;\n locationHistory = new LocationHistory();\n viewStack = new ReactRouterViewStack();\n routeMangerContextState: RouteManagerContextState = {\n canGoBack: () => this.locationHistory.canGoBack(),\n clearOutlet: this.viewStack.clear,\n findViewItemByPathname: this.viewStack.findViewItemByPathname,\n getChildrenToRender: this.viewStack.getChildrenToRender,\n goBack: () => this.handleNavigateBack(),\n createViewItem: this.viewStack.createViewItem,\n findViewItemByRouteInfo: this.viewStack.findViewItemByRouteInfo,\n findLeavingViewItemByRouteInfo: this.viewStack.findLeavingViewItemByRouteInfo,\n addViewItem: this.viewStack.add,\n unMountViewItem: this.viewStack.remove,\n };\n\n constructor(props: IonRouteProps) {\n super(props);\n\n const routeInfo = {\n id: generateId('routeInfo'),\n pathname: this.props.location.pathname,\n search: this.props.location.search,\n };\n\n this.locationHistory.add(routeInfo);\n this.handleChangeTab = this.handleChangeTab.bind(this);\n this.handleResetTab = this.handleResetTab.bind(this);\n this.handleNativeBack = this.handleNativeBack.bind(this);\n this.handleNavigate = this.handleNavigate.bind(this);\n this.handleNavigateBack = this.handleNavigateBack.bind(this);\n this.props.registerHistoryListener(this.handleHistoryChange.bind(this));\n this.handleSetCurrentTab = this.handleSetCurrentTab.bind(this);\n\n this.state = {\n routeInfo,\n };\n }\n\n handleChangeTab(tab: string, path?: string, routeOptions?: any) {\n if (!path) {\n return;\n }\n\n const routeInfo = this.locationHistory.getCurrentRouteInfoForTab(tab);\n const [pathname, search] = path.split('?');\n if (routeInfo) {\n this.incomingRouteParams = { ...routeInfo, routeAction: 'push', routeDirection: 'none' };\n if (routeInfo.pathname === pathname) {\n this.incomingRouteParams.routeOptions = routeOptions;\n this.props.history.push(routeInfo.pathname + (routeInfo.search || ''));\n } else {\n this.incomingRouteParams.pathname = pathname;\n this.incomingRouteParams.search = search ? '?' + search : undefined;\n this.incomingRouteParams.routeOptions = routeOptions;\n this.props.history.push(pathname + (search ? '?' + search : ''));\n }\n } else {\n this.handleNavigate(pathname, 'push', 'none', undefined, routeOptions, tab);\n }\n }\n\n handleHistoryChange(location: HistoryLocation<LocationState>, action: HistoryAction) {\n let leavingLocationInfo: RouteInfo;\n if (this.incomingRouteParams) {\n if (this.incomingRouteParams.routeAction === 'replace') {\n leavingLocationInfo = this.locationHistory.previous();\n } else {\n leavingLocationInfo = this.locationHistory.current();\n }\n } else {\n leavingLocationInfo = this.locationHistory.current();\n }\n\n const leavingUrl = leavingLocationInfo.pathname + leavingLocationInfo.search;\n if (leavingUrl !== location.pathname) {\n if (!this.incomingRouteParams) {\n if (action === 'REPLACE') {\n this.incomingRouteParams = {\n routeAction: 'replace',\n routeDirection: 'none',\n tab: this.currentTab,\n };\n }\n if (action === 'POP') {\n const currentRoute = this.locationHistory.current();\n if (currentRoute && currentRoute.pushedByRoute) {\n const prevInfo = this.locationHistory.findLastLocation(currentRoute);\n this.incomingRouteParams = { ...prevInfo, routeAction: 'pop', routeDirection: 'back' };\n } else {\n this.incomingRouteParams = {\n routeAction: 'pop',\n routeDirection: 'none',\n tab: this.currentTab,\n };\n }\n }\n if (!this.incomingRouteParams) {\n this.incomingRouteParams = {\n routeAction: 'push',\n routeDirection: location.state?.direction || 'forward',\n routeOptions: location.state?.routerOptions,\n tab: this.currentTab,\n };\n }\n }\n\n let routeInfo: RouteInfo;\n\n if (this.incomingRouteParams?.id) {\n routeInfo = {\n ...(this.incomingRouteParams as RouteInfo),\n lastPathname: leavingLocationInfo.pathname,\n };\n this.locationHistory.add(routeInfo);\n } else {\n const isPushed =\n this.incomingRouteParams.routeAction === 'push' && this.incomingRouteParams.routeDirection === 'forward';\n routeInfo = {\n id: generateId('routeInfo'),\n ...this.incomingRouteParams,\n lastPathname: leavingLocationInfo.pathname,\n pathname: location.pathname,\n search: location.search,\n params: this.props.match.params,\n prevRouteLastPathname: leavingLocationInfo.lastPathname,\n };\n if (isPushed) {\n routeInfo.tab = leavingLocationInfo.tab;\n routeInfo.pushedByRoute = leavingLocationInfo.pathname;\n } else if (routeInfo.routeAction === 'pop') {\n const r = this.locationHistory.findLastLocation(routeInfo);\n routeInfo.pushedByRoute = r?.pushedByRoute;\n } else if (routeInfo.routeAction === 'push' && routeInfo.tab !== leavingLocationInfo.tab) {\n // If we are switching tabs grab the last route info for the tab and use its pushedByRoute\n const lastRoute = this.locationHistory.getCurrentRouteInfoForTab(routeInfo.tab);\n routeInfo.pushedByRoute = lastRoute?.pushedByRoute;\n } else if (routeInfo.routeAction === 'replace') {\n // Make sure to set the lastPathname, etc.. to the current route so the page transitions out\n const currentRouteInfo = this.locationHistory.current();\n\n /**\n * If going from /home to /child, then replacing from\n * /child to /home, we don't want the route info to\n * say that /home was pushed by /home which is not correct.\n */\n const currentPushedBy = currentRouteInfo?.pushedByRoute;\n const pushedByRoute =\n currentPushedBy !== undefined && currentPushedBy !== routeInfo.pathname\n ? currentPushedBy\n : routeInfo.pushedByRoute;\n\n routeInfo.lastPathname = currentRouteInfo?.pathname || routeInfo.lastPathname;\n routeInfo.prevRouteLastPathname = currentRouteInfo?.lastPathname;\n routeInfo.pushedByRoute = pushedByRoute;\n\n /**\n * When replacing routes we should still prefer\n * any custom direction/animation that the developer\n * has specified when navigating first instead of relying\n * on previously used directions/animations.\n */\n routeInfo.routeDirection = routeInfo.routeDirection || currentRouteInfo?.routeDirection;\n routeInfo.routeAnimation = routeInfo.routeAnimation || currentRouteInfo?.routeAnimation;\n }\n\n this.locationHistory.add(routeInfo);\n }\n\n this.setState({\n routeInfo,\n });\n }\n\n this.incomingRouteParams = undefined;\n }\n\n /**\n * history@4.x uses goBack(), history@5.x uses back()\n * TODO: If support for React Router <=5 is dropped\n * this logic is no longer needed. We can just\n * assume back() is available.\n */\n handleNativeBack() {\n const history = this.props.history as any;\n const goBack = history.goBack || history.back;\n goBack();\n }\n\n handleNavigate(\n path: string,\n routeAction: RouteAction,\n routeDirection?: RouterDirection,\n routeAnimation?: AnimationBuilder,\n routeOptions?: any,\n tab?: string\n ) {\n this.incomingRouteParams = Object.assign(this.incomingRouteParams || {}, {\n routeAction,\n routeDirection,\n routeOptions,\n routeAnimation,\n tab,\n });\n\n if (routeAction === 'push') {\n this.props.history.push(path);\n } else {\n this.props.history.replace(path);\n }\n }\n\n handleNavigateBack(defaultHref: string | RouteInfo = '/', routeAnimation?: AnimationBuilder) {\n const config = getConfig();\n defaultHref = defaultHref ? defaultHref : config && config.get('backButtonDefaultHref' as any);\n const routeInfo = this.locationHistory.current();\n if (routeInfo && routeInfo.pushedByRoute) {\n const prevInfo = this.locationHistory.findLastLocation(routeInfo);\n if (prevInfo) {\n /**\n * This needs to be passed to handleNavigate\n * otherwise incomingRouteParams.routeAnimation\n * will be overridden.\n */\n const incomingAnimation = routeAnimation || routeInfo.routeAnimation;\n this.incomingRouteParams = {\n ...prevInfo,\n routeAction: 'pop',\n routeDirection: 'back',\n routeAnimation: incomingAnimation,\n };\n if (\n routeInfo.lastPathname === routeInfo.pushedByRoute ||\n /**\n * We need to exclude tab switches/tab\n * context changes here because tabbed\n * navigation is not linear, but router.back()\n * will go back in a linear fashion.\n */\n (prevInfo.pathname === routeInfo.pushedByRoute && routeInfo.tab === '' && prevInfo.tab === '')\n ) {\n /**\n * history@4.x uses goBack(), history@5.x uses back()\n * TODO: If support for React Router <=5 is dropped\n * this logic is no longer needed. We can just\n * assume back() is available.\n */\n const history = this.props.history as any;\n const goBack = history.goBack || history.back;\n goBack();\n } else {\n this.handleNavigate(prevInfo.pathname + (prevInfo.search || ''), 'pop', 'back', incomingAnimation);\n }\n } else {\n this.handleNavigate(defaultHref as string, 'pop', 'back', routeAnimation);\n }\n } else {\n this.handleNavigate(defaultHref as string, 'pop', 'back', routeAnimation);\n }\n }\n\n handleResetTab(tab: string, originalHref: string, originalRouteOptions: any) {\n const routeInfo = this.locationHistory.getFirstRouteInfoForTab(tab);\n if (routeInfo) {\n const newRouteInfo = { ...routeInfo };\n newRouteInfo.pathname = originalHref;\n newRouteInfo.routeOptions = originalRouteOptions;\n this.incomingRouteParams = { ...newRouteInfo, routeAction: 'pop', routeDirection: 'back' };\n this.props.history.push(newRouteInfo.pathname + (newRouteInfo.search || ''));\n }\n }\n\n handleSetCurrentTab(tab: string) {\n this.currentTab = tab;\n const ri = { ...this.locationHistory.current() };\n if (ri.tab !== tab) {\n ri.tab = tab;\n this.locationHistory.update(ri);\n }\n }\n\n render() {\n return (\n <RouteManagerContext.Provider value={this.routeMangerContextState}>\n <NavManager\n ionRoute={IonRouteInner}\n ionRedirect={{}}\n stackManager={StackManager}\n routeInfo={this.state.routeInfo!}\n onNativeBack={this.handleNativeBack}\n onNavigateBack={this.handleNavigateBack}\n onNavigate={this.handleNavigate}\n onSetCurrentTab={this.handleSetCurrentTab}\n onChangeTab={this.handleChangeTab}\n onResetTab={this.handleResetTab}\n locationHistory={this.locationHistory}\n >\n {this.props.children}\n </NavManager>\n </RouteManagerContext.Provider>\n );\n }\n}\n\nexport const IonRouter = withRouter(IonRouterInner);\nIonRouter.displayName = 'IonRouter';\n","import type { Action as HistoryAction, History, Location as HistoryLocation } from 'history';\nimport { createBrowserHistory as createHistory } from 'history';\nimport React from 'react';\nimport type { BrowserRouterProps } from 'react-router-dom';\nimport { Router } from 'react-router-dom';\n\nimport { IonRouter } from './IonRouter';\n\ninterface IonReactRouterProps extends BrowserRouterProps {\n history?: History;\n}\n\nexport class IonReactRouter extends React.Component<IonReactRouterProps> {\n historyListenHandler?: (location: HistoryLocation, action: HistoryAction) => void;\n history: History;\n\n constructor(props: IonReactRouterProps) {\n super(props);\n const { history, ...rest } = props;\n this.history = history || createHistory(rest);\n this.history.listen(this.handleHistoryChange.bind(this));\n this.registerHistoryListener = this.registerHistoryListener.bind(this);\n }\n\n /**\n * history@4.x passes separate location and action\n * params. history@5.x passes location and action\n * together as a single object.\n * TODO: If support for React Router <=5 is dropped\n * this logic is no longer needed. We can just assume\n * a single object with both location and action.\n */\n handleHistoryChange(location: HistoryLocation, action: HistoryAction) {\n const locationValue = (location as any).location || location;\n const actionValue = (location as any).action || action;\n if (this.historyListenHandler) {\n this.historyListenHandler(locationValue, actionValue);\n }\n }\n\n registerHistoryListener(cb: (location: HistoryLocation, action: HistoryAction) => void) {\n this.historyListenHandler = cb;\n }\n\n render() {\n const { children, ...props } = this.props;\n return (\n <Router history={this.history} {...props}>\n <IonRouter registerHistoryListener={this.registerHistoryListener}>{children}</IonRouter>\n </Router>\n );\n }\n}\n","import type { Action as HistoryAction, Location as HistoryLocation, MemoryHistory } from 'history';\nimport React from 'react';\nimport type { MemoryRouterProps } from 'react-router';\nimport { Router } from 'react-router';\n\nimport { IonRouter } from './IonRouter';\n\ninterface IonReactMemoryRouterProps extends MemoryRouterProps {\n history: MemoryHistory;\n}\n\nexport class IonReactMemoryRouter extends React.Component<IonReactMemoryRouterProps> {\n history: MemoryHistory;\n historyListenHandler?: (location: HistoryLocation, action: HistoryAction) => void;\n\n constructor(props: IonReactMemoryRouterProps) {\n super(props);\n this.history = props.history;\n this.history.listen(this.handleHistoryChange.bind(this));\n this.registerHistoryListener = this.registerHistoryListener.bind(this);\n }\n\n /**\n * history@4.x passes separate location and action\n * params. history@5.x passes location and action\n * together as a single object.\n * TODO: If support for React Router <=5 is dropped\n * this logic is no longer needed. We can just assume\n * a single object with both location and action.\n */\n handleHistoryChange(location: HistoryLocation, action: HistoryAction) {\n const locationValue = (location as any).location || location;\n const actionValue = (location as any).action || action;\n if (this.historyListenHandler) {\n this.historyListenHandler(locationValue, actionValue);\n }\n }\n\n registerHistoryListener(cb: (location: HistoryLocation, action: HistoryAction) => void) {\n this.historyListenHandler = cb;\n }\n\n render() {\n const { children, ...props } = this.props;\n return (\n <Router {...props}>\n <IonRouter registerHistoryListener={this.registerHistoryListener}>{children}</IonRouter>\n </Router>\n );\n }\n}\n","import type { Action as HistoryAction, History, Location as HistoryLocation } from 'history';\nimport { createHashHistory as createHistory } from 'history';\nimport React from 'react';\nimport type { BrowserRouterProps } from 'react-router-dom';\nimport { Router } from 'react-router-dom';\n\nimport { IonRouter } from './IonRouter';\n\ninterface IonReactHashRouterProps extends BrowserRouterProps {\n history?: History;\n}\n\nexport class IonReactHashRouter extends React.Component<IonReactHashRouterProps> {\n history: History;\n historyListenHandler?: (location: HistoryLocation, action: HistoryAction) => void;\n\n constructor(props: IonReactHashRouterProps) {\n super(props);\n const { history, ...rest } = props;\n this.history = history || createHistory(rest);\n this.history.listen(this.handleHistoryChange.bind(this));\n this.registerHistoryListener = this.registerHistoryListener.bind(this);\n }\n\n /**\n * history@4.x passes separate location and action\n * params. history@5.x passes location and action\n * together as a single object.\n * TODO: If support for React Router <=5 is dropped\n * this logic is no longer needed. We can just assume\n * a single object with both location and action.\n */\n handleHistoryChange(location: HistoryLocation, action: HistoryAction) {\n const locationValue = (location as any).location || location;\n const actionValue = (location as any).action || action;\n if (this.historyListenHandler) {\n this.historyListenHandler(locationValue, actionValue);\n }\n }\n\n registerHistoryListener(cb: (location: HistoryLocation, action: HistoryAction) => void) {\n this.historyListenHandler = cb;\n }\n\n render() {\n const { children, ...props } = this.props;\n return (\n <Router history={this.history} {...props}>\n <IonRouter registerHistoryListener={this.registerHistoryListener}>{children}</IonRouter>\n </Router>\n );\n }\n}\n"],"names":["reactRouterMatchPath","matchComponent","createHistory","Router"],"mappings":";;;;;;;AAIa,MAAA,aAAc,SAAQ,KAAK,CAAC,aAA4B,CAAA;IACnE,MAAM,GAAA;AACJ,QAAA,QACE,KAAA,CAAA,aAAA,CAAC,KAAK,EAAA,MAAA,CAAA,MAAA,CAAA,EACJ,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,EACrB,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvB,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EAUpB,GAAE,IAAI,CAAC,KAAa,CAAC,aAAa,KAAK,SAAS;AACjD,cAAE;AACE,gBAAA,aAAa,EAAG,IAAI,CAAC,KAAa,CAAC,aAAa;AACjD,aAAA;AACH,cAAE,EAAE,EAAC,CAET,EACF;KACH;AACF;;ACXD;;AAEG;AACI,MAAM,SAAS,GAAG,CAAC,EACxB,QAAQ,EACR,cAAc,GACG,KAAqD;AACtE,IAAA,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,cAAc,CAAC;IAE5C,MAAM,IAAI,GAAG,cAAc,CAAC,IAAI,IAAI,cAAc,CAAC,IAAI,CAAC;AACxD;;;;AAIG;AACH,IAAA,MAAM,UAAU,GAAG;QACjB,KAAK;QACL,IAAI;QACJ,SAAS;KACV,CAAC;IAEF,MAAM,KAAK,GAAGA,WAAoB,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;IAEzD,IAAI,CAAC,KAAK,EAAE;AACV,QAAA,OAAO,KAAK,CAAC;AACd,KAAA;AAED,IAAA,OAAO,KAAK,CAAC;AACf,CAAC;;ACxC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