ui5-lib-guard-router 1.6.2 → 1.7.0
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/.ui5 → .ui5}/build-manifest.json +56 -8
- package/CHANGELOG.md +190 -0
- package/README.md +695 -327
- package/dist/index.d.ts +9 -5
- package/dist/resources/ui5/guard/router/.library +1 -1
- package/dist/resources/ui5/guard/router/GuardConfig-dbg.js +222 -0
- package/dist/resources/ui5/guard/router/GuardConfig-dbg.js.map +1 -0
- package/dist/resources/ui5/guard/router/GuardConfig.d.ts +89 -0
- package/dist/resources/ui5/guard/router/GuardConfig.d.ts.map +1 -0
- package/dist/resources/ui5/guard/router/GuardConfig.js +2 -0
- package/dist/resources/ui5/guard/router/GuardConfig.js.map +1 -0
- package/dist/resources/ui5/guard/router/GuardModules-dbg.js +253 -0
- package/dist/resources/ui5/guard/router/GuardModules-dbg.js.map +1 -0
- package/dist/resources/ui5/guard/router/GuardModules.d.ts +72 -0
- package/dist/resources/ui5/guard/router/GuardModules.d.ts.map +1 -0
- package/dist/resources/ui5/guard/router/GuardModules.js +2 -0
- package/dist/resources/ui5/guard/router/GuardModules.js.map +1 -0
- package/dist/resources/ui5/guard/router/GuardPipeline-dbg.js +122 -121
- package/dist/resources/ui5/guard/router/GuardPipeline-dbg.js.map +1 -1
- package/dist/resources/ui5/guard/router/GuardPipeline.d.ts +45 -26
- package/dist/resources/ui5/guard/router/GuardPipeline.d.ts.map +1 -1
- package/dist/resources/ui5/guard/router/GuardPipeline.js +1 -1
- package/dist/resources/ui5/guard/router/GuardPipeline.js.map +1 -1
- package/dist/resources/ui5/guard/router/NavigationOutcome-dbg.js +3 -3
- package/dist/resources/ui5/guard/router/NavigationOutcome-dbg.js.map +1 -1
- package/dist/resources/ui5/guard/router/NavigationOutcome.d.ts +3 -3
- package/dist/resources/ui5/guard/router/NavigationOutcome.d.ts.map +1 -1
- package/dist/resources/ui5/guard/router/NavigationOutcome.js.map +1 -1
- package/dist/resources/ui5/guard/router/PatternTree-dbg.js +156 -0
- package/dist/resources/ui5/guard/router/PatternTree-dbg.js.map +1 -0
- package/dist/resources/ui5/guard/router/PatternTree.d.ts +71 -0
- package/dist/resources/ui5/guard/router/PatternTree.d.ts.map +1 -0
- package/dist/resources/ui5/guard/router/PatternTree.js +2 -0
- package/dist/resources/ui5/guard/router/PatternTree.js.map +1 -0
- package/dist/resources/ui5/guard/router/RouteMeta-dbg.js +84 -0
- package/dist/resources/ui5/guard/router/RouteMeta-dbg.js.map +1 -0
- package/dist/resources/ui5/guard/router/RouteMeta.d.ts +33 -0
- package/dist/resources/ui5/guard/router/RouteMeta.d.ts.map +1 -0
- package/dist/resources/ui5/guard/router/RouteMeta.js +2 -0
- package/dist/resources/ui5/guard/router/RouteMeta.js.map +1 -0
- package/dist/resources/ui5/guard/router/Router-dbg.js +882 -1020
- package/dist/resources/ui5/guard/router/Router-dbg.js.map +1 -1
- package/dist/resources/ui5/guard/router/Router.d.ts +360 -211
- package/dist/resources/ui5/guard/router/Router.d.ts.map +1 -1
- package/dist/resources/ui5/guard/router/Router.js +1 -1
- package/dist/resources/ui5/guard/router/Router.js.map +1 -1
- package/dist/resources/ui5/guard/router/library-dbg.js +1 -1
- package/dist/resources/ui5/guard/router/library-dbg.js.map +1 -1
- package/dist/resources/ui5/guard/router/library-preload.js +8 -4
- package/dist/resources/ui5/guard/router/library-preload.js.map +1 -1
- package/dist/resources/ui5/guard/router/library.js +1 -1
- package/dist/resources/ui5/guard/router/library.js.map +1 -1
- package/dist/resources/ui5/guard/router/manifest.json +5 -2
- package/dist/resources/ui5/guard/router/types-dbg.js.map +1 -1
- package/dist/resources/ui5/guard/router/types.d.ts +94 -39
- package/dist/resources/ui5/guard/router/types.d.ts.map +1 -1
- package/package.json +10 -6
- package/src/GuardConfig.ts +272 -0
- package/src/GuardModules.ts +249 -0
- package/src/GuardPipeline.ts +155 -128
- package/src/NavigationOutcome.ts +3 -3
- package/src/PatternTree.ts +145 -0
- package/src/RouteMeta.ts +82 -0
- package/src/Router.ts +1089 -1130
- package/src/manifest.json +5 -2
- package/src/types.ts +79 -22
- package/tsconfig.json +0 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"library-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"names":["LOG_COMPONENT","isGuardRedirect","value","route","length","isPromiseLike","then","GuardPipeline","_globalGuards","_enterGuards","Map","_leaveGuards","addGlobalGuard","guard","this","push","removeGlobalGuard","index","indexOf","splice","addEnterGuard","_addToGuardMap","removeEnterGuard","_removeFromGuardMap","addLeaveGuard","removeLeaveGuard","clear","evaluate","context","options","hasLeaveGuards","skipLeaveGuards","fromRoute","has","hasEnterGuards","toRoute","action","processEnterResult","enterResult","r","target","catch","error","runEnterPhase","_runEnterGuards","leaveResult","_runLeaveGuards","allowed","signal","aborted","map","key","guards","get","set","delete","registered","slice","i","result","_continueGuardsAsync","candidate","_validateLeaveGuardResult","Log","Error","String","globalResult","_runGuards","_runRouteGuards","_validateGuardResult","pendingResult","currentIndex","onBlock","label","isLeaveGuard","guardIndex","nextResult","warning"],"sources":["GuardPipeline.ts"],"sourcesContent":["import Log from \"sap/base/Log\";\nimport type { GuardFn, GuardContext, GuardResult, GuardRedirect } from \"./types\";\n\nconst LOG_COMPONENT = \"ui5.guard.router.Router\";\n\nfunction isGuardRedirect(value: unknown): value is GuardRedirect {\n\tif (typeof value !== \"object\" || value === null) {\n\t\treturn false;\n\t}\n\n\tconst { route } = value as GuardRedirect;\n\treturn typeof route === \"string\" && route.length > 0;\n}\n\n/**\n * Promises/A+ thenable detection via duck typing.\n *\n * We intentionally do not use `instanceof Promise` because that misses\n * cross-realm Promises and PromiseLike/thenable objects.\n */\nexport function isPromiseLike<T>(value: unknown): value is PromiseLike<T> {\n\tif ((typeof value !== \"object\" && typeof value !== \"function\") || value === null) {\n\t\treturn false;\n\t}\n\n\treturn typeof (value as PromiseLike<T>).then === \"function\";\n}\n\n/**\n * Normalized result of the guard decision pipeline.\n */\nexport type GuardDecision =\n\t| { action: \"allow\" }\n\t| { action: \"block\" }\n\t| { action: \"redirect\"; target: string | GuardRedirect }\n\t| { action: \"error\"; error: unknown };\n\n/**\n * Standalone guard evaluation pipeline.\n *\n * Owns guard storage (global, enter, leave) and runs the full\n * leave -> global-enter -> route-enter pipeline. Pure logic with\n * no dependency on Router state beyond the current route name\n * passed into evaluate().\n *\n * @namespace ui5.guard.router\n */\nexport default class GuardPipeline {\n\tprivate _globalGuards: GuardFn[] = [];\n\tprivate _enterGuards = new Map<string, GuardFn[]>();\n\tprivate _leaveGuards = new Map<string, GuardFn[]>();\n\n\t/** Register a guard that runs for every navigation. */\n\taddGlobalGuard(guard: GuardFn): void {\n\t\tthis._globalGuards.push(guard);\n\t}\n\n\t/** Remove a previously registered global guard by reference. */\n\tremoveGlobalGuard(guard: GuardFn): void {\n\t\tconst index = this._globalGuards.indexOf(guard);\n\t\tif (index !== -1) {\n\t\t\tthis._globalGuards.splice(index, 1);\n\t\t}\n\t}\n\n\t/**\n\t * Register an enter guard for a specific route.\n\t *\n\t * @param route - Route name as defined in `manifest.json`.\n\t * @param guard - Guard function to register.\n\t */\n\taddEnterGuard(route: string, guard: GuardFn): void {\n\t\tthis._addToGuardMap(this._enterGuards, route, guard);\n\t}\n\n\t/**\n\t * Remove a previously registered enter guard by reference.\n\t *\n\t * @param route - Route name.\n\t * @param guard - Guard function to remove.\n\t */\n\tremoveEnterGuard(route: string, guard: GuardFn): void {\n\t\tthis._removeFromGuardMap(this._enterGuards, route, guard);\n\t}\n\n\t/**\n\t * Register a leave guard for a specific route.\n\t *\n\t * Accepts `GuardFn` to support manifest-declared guards loaded from\n\t * untyped modules. Non-boolean return values are caught at runtime\n\t * by {@link _validateLeaveGuardResult}.\n\t *\n\t * @param route - Route name as defined in `manifest.json`.\n\t * @param guard - Guard function to register as a leave guard.\n\t */\n\taddLeaveGuard(route: string, guard: GuardFn): void {\n\t\tthis._addToGuardMap(this._leaveGuards, route, guard);\n\t}\n\n\t/**\n\t * Remove a previously registered leave guard by reference.\n\t *\n\t * @param route - Route name.\n\t * @param guard - Guard function to remove.\n\t */\n\tremoveLeaveGuard(route: string, guard: GuardFn): void {\n\t\tthis._removeFromGuardMap(this._leaveGuards, route, guard);\n\t}\n\n\t/**\n\t * Remove all registered guards.\n\t */\n\tclear(): void {\n\t\tthis._globalGuards = [];\n\t\tthis._enterGuards.clear();\n\t\tthis._leaveGuards.clear();\n\t}\n\n\t/**\n\t * Run the full guard pipeline (leave -> global enter -> route enter) and\n\t * return a normalized decision. Stays synchronous when all guards return\n\t * plain values; returns a Promise only when an async guard is encountered.\n\t *\n\t * @param context - Complete guard context including AbortSignal.\n\t * `context.fromRoute` controls leave-guard lookup: empty string skips leave guards.\n\t * @param options - Optional evaluation options.\n\t * @param options.skipLeaveGuards - When true, leave guards are skipped even if\n\t * `context.fromRoute` is set. Used by redirect chain hops to avoid re-running\n\t * leave guards while still preserving `fromRoute` in the context.\n\t * @returns A synchronous {@link GuardDecision} when all guards return plain values,\n\t * or a `Promise<GuardDecision>` when at least one guard returns a thenable.\n\t */\n\tevaluate(context: GuardContext, options?: { skipLeaveGuards?: boolean }): GuardDecision | Promise<GuardDecision> {\n\t\tconst hasLeaveGuards =\n\t\t\t!options?.skipLeaveGuards && context.fromRoute !== \"\" && this._leaveGuards.has(context.fromRoute);\n\t\tconst hasEnterGuards =\n\t\t\tthis._globalGuards.length > 0 || (context.toRoute !== \"\" && this._enterGuards.has(context.toRoute));\n\n\t\tif (!hasLeaveGuards && !hasEnterGuards) {\n\t\t\treturn { action: \"allow\" };\n\t\t}\n\n\t\tconst processEnterResult = (\n\t\t\tenterResult: GuardResult | Promise<GuardResult>,\n\t\t): GuardDecision | Promise<GuardDecision> => {\n\t\t\tif (isPromiseLike(enterResult)) {\n\t\t\t\treturn enterResult\n\t\t\t\t\t.then((r: GuardResult): GuardDecision => {\n\t\t\t\t\t\tif (r === true) return { action: \"allow\" };\n\t\t\t\t\t\tif (r === false) return { action: \"block\" };\n\t\t\t\t\t\treturn { action: \"redirect\", target: r };\n\t\t\t\t\t})\n\t\t\t\t\t.catch((error: unknown): GuardDecision => {\n\t\t\t\t\t\treturn { action: \"error\", error };\n\t\t\t\t\t});\n\t\t\t}\n\t\t\tif (enterResult === true) return { action: \"allow\" };\n\t\t\tif (enterResult === false) return { action: \"block\" };\n\t\t\treturn { action: \"redirect\", target: enterResult };\n\t\t};\n\n\t\tconst runEnterPhase = (): GuardDecision | Promise<GuardDecision> => {\n\t\t\tconst enterResult = this._runEnterGuards(context.toRoute, context);\n\t\t\treturn processEnterResult(enterResult);\n\t\t};\n\n\t\ttry {\n\t\t\tif (hasLeaveGuards) {\n\t\t\t\tconst leaveResult = this._runLeaveGuards(context);\n\n\t\t\t\tif (isPromiseLike(leaveResult)) {\n\t\t\t\t\treturn leaveResult\n\t\t\t\t\t\t.then((allowed: boolean): GuardDecision | Promise<GuardDecision> => {\n\t\t\t\t\t\t\tif (allowed !== true) return { action: \"block\" };\n\t\t\t\t\t\t\tif (context.signal.aborted) return { action: \"block\" };\n\t\t\t\t\t\t\treturn runEnterPhase();\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.catch((error: unknown): GuardDecision => {\n\t\t\t\t\t\t\treturn { action: \"error\", error };\n\t\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tif (leaveResult !== true) return { action: \"block\" };\n\t\t\t}\n\n\t\t\treturn runEnterPhase();\n\t\t} catch (error) {\n\t\t\treturn { action: \"error\", error };\n\t\t}\n\t}\n\n\tprivate _addToGuardMap<T>(map: Map<string, T[]>, key: string, guard: T): void {\n\t\tlet guards = map.get(key);\n\t\tif (!guards) {\n\t\t\tguards = [];\n\t\t\tmap.set(key, guards);\n\t\t}\n\t\tguards.push(guard);\n\t}\n\n\tprivate _removeFromGuardMap<T>(map: Map<string, T[]>, key: string, guard: T): void {\n\t\tconst guards = map.get(key);\n\t\tif (!guards) return;\n\t\tconst index = guards.indexOf(guard);\n\t\tif (index !== -1) guards.splice(index, 1);\n\t\tif (guards.length === 0) map.delete(key);\n\t}\n\n\t/**\n\t * Run leave guards for the current route. Returns boolean (no redirects).\n\t *\n\t * The guard array is snapshot-copied before iteration so that guards\n\t * may safely add/remove themselves (e.g. one-shot guards) without\n\t * affecting the current pipeline run.\n\t */\n\tprivate _runLeaveGuards(context: GuardContext): boolean | Promise<boolean> {\n\t\tconst registered = this._leaveGuards.get(context.fromRoute);\n\t\tif (!registered || registered.length === 0) return true;\n\n\t\tconst guards = registered.slice();\n\t\tfor (let i = 0; i < guards.length; i++) {\n\t\t\ttry {\n\t\t\t\tconst result = guards[i](context);\n\t\t\t\tif (isPromiseLike(result)) {\n\t\t\t\t\treturn this._continueGuardsAsync(\n\t\t\t\t\t\tresult,\n\t\t\t\t\t\tguards,\n\t\t\t\t\t\ti,\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t\t(candidate) => this._validateLeaveGuardResult(candidate),\n\t\t\t\t\t\t\"Leave guard\",\n\t\t\t\t\t\ttrue,\n\t\t\t\t\t) as Promise<boolean>;\n\t\t\t\t}\n\t\t\t\tif (result !== true) return this._validateLeaveGuardResult(result);\n\t\t\t} catch (error) {\n\t\t\t\tLog.error(\n\t\t\t\t\t`Leave guard [${i}] on route \"${context.fromRoute}\" threw, navigation failed`,\n\t\t\t\t\terror instanceof Error ? error : String(error),\n\t\t\t\t\tLOG_COMPONENT,\n\t\t\t\t);\n\t\t\t\tif (context.signal.aborted) return false;\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\t/** Run global guards, then route-specific guards. Stays sync when possible. */\n\tprivate _runEnterGuards(toRoute: string, context: GuardContext): GuardResult | Promise<GuardResult> {\n\t\tconst globalResult = this._runGuards(this._globalGuards, context);\n\n\t\tif (isPromiseLike(globalResult)) {\n\t\t\treturn globalResult.then((result: GuardResult) => {\n\t\t\t\tif (result !== true) return result;\n\t\t\t\tif (context.signal.aborted) return false;\n\t\t\t\treturn this._runRouteGuards(toRoute, context);\n\t\t\t});\n\t\t}\n\t\tif (globalResult !== true) return globalResult;\n\t\treturn this._runRouteGuards(toRoute, context);\n\t}\n\n\t/** Run route-specific guards if any are registered. */\n\tprivate _runRouteGuards(toRoute: string, context: GuardContext): GuardResult | Promise<GuardResult> {\n\t\tif (!toRoute || !this._enterGuards.has(toRoute)) return true;\n\t\treturn this._runGuards(this._enterGuards.get(toRoute)!, context);\n\t}\n\n\t/**\n\t * Run guards sync; switch to async path if a Promise is returned.\n\t *\n\t * The guard array is snapshot-copied before iteration so that guards\n\t * may safely add/remove themselves (e.g. one-shot guards) without\n\t * affecting the current pipeline run.\n\t */\n\tprivate _runGuards(guards: GuardFn[], context: GuardContext): GuardResult | Promise<GuardResult> {\n\t\tguards = guards.slice();\n\t\tfor (let i = 0; i < guards.length; i++) {\n\t\t\ttry {\n\t\t\t\tconst result = guards[i](context);\n\t\t\t\tif (isPromiseLike(result)) {\n\t\t\t\t\treturn this._continueGuardsAsync(\n\t\t\t\t\t\tresult,\n\t\t\t\t\t\tguards,\n\t\t\t\t\t\ti,\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t\t(candidate) => this._validateGuardResult(candidate),\n\t\t\t\t\t\t\"Enter guard\",\n\t\t\t\t\t\tfalse,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (result !== true) return this._validateGuardResult(result);\n\t\t\t} catch (error) {\n\t\t\t\tLog.error(\n\t\t\t\t\t`Enter guard [${i}] on route \"${context.toRoute}\" threw, navigation failed`,\n\t\t\t\t\terror instanceof Error ? error : String(error),\n\t\t\t\t\tLOG_COMPONENT,\n\t\t\t\t);\n\t\t\t\tif (context.signal.aborted) return false;\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * Continue guard array async from the first Promise onward.\n\t *\n\t * Shared by both enter and leave guard pipelines. The `onBlock` callback\n\t * determines what to return for non-true results: leave guards always\n\t * return `false`, enter guards validate and may return redirects.\n\t *\n\t * @param isLeaveGuard - When true, error logs reference `fromRoute`; otherwise `toRoute`.\n\t */\n\tprivate async _continueGuardsAsync(\n\t\tpendingResult: PromiseLike<GuardResult>,\n\t\tguards: GuardFn[],\n\t\tcurrentIndex: number,\n\t\tcontext: GuardContext,\n\t\tonBlock: (result: unknown) => GuardResult,\n\t\tlabel: string,\n\t\tisLeaveGuard: boolean,\n\t): Promise<GuardResult> {\n\t\tlet guardIndex = currentIndex;\n\t\ttry {\n\t\t\tconst result = await pendingResult;\n\t\t\tif (result !== true) return onBlock(result);\n\n\t\t\tfor (let i = currentIndex + 1; i < guards.length; i++) {\n\t\t\t\tif (context.signal.aborted) return false;\n\t\t\t\tguardIndex = i;\n\t\t\t\tconst nextResult = await guards[i](context);\n\t\t\t\tif (nextResult !== true) return onBlock(nextResult);\n\t\t\t}\n\t\t\treturn true;\n\t\t} catch (error) {\n\t\t\tif (!context.signal.aborted) {\n\t\t\t\tconst route = isLeaveGuard ? context.fromRoute : context.toRoute;\n\t\t\t\tLog.error(\n\t\t\t\t\t`${label} [${guardIndex}] on route \"${route}\" threw, navigation failed`,\n\t\t\t\t\terror instanceof Error ? error : String(error),\n\t\t\t\t\tLOG_COMPONENT,\n\t\t\t\t);\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t/** Validate a non-true guard result; invalid values become false. */\n\tprivate _validateGuardResult(result: unknown): GuardResult {\n\t\tif (typeof result === \"boolean\") return result;\n\t\tif (typeof result === \"string\" && result.length > 0) return result;\n\t\tif (isGuardRedirect(result)) return result;\n\t\tLog.warning(\"Guard returned invalid value, treating as block\", String(result), LOG_COMPONENT);\n\t\treturn false;\n\t}\n\n\t/** Validate a leave guard result; non-boolean values log a warning and block. */\n\tprivate _validateLeaveGuardResult(result: unknown): boolean {\n\t\tif (typeof result === \"boolean\") return result;\n\t\tLog.warning(\"Leave guard returned non-boolean value, treating as block\", String(result), LOG_COMPONENT);\n\t\treturn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AAI1D,EAAgB0D,GAAS,OAAOA,EACpCI,EAAIc,QAAQ,kDAAmDZ,OAAON,GAAS3D,GAC/E,OAAO,KACR,CAGQ8D,0BAA0BH,GACjC,UAAWA,IAAW,UAAW,OAAOA,EACxCI,EAAIc,QAAQ,4DAA6DZ,OAAON,GAAS3D,GACzF,OAAO,KACR,EACAO,EAAAF,gBAAA,OAAAE,CAAA","ignoreList":[],"sourceRoot":""}},{"offset":{"line":2,"column":0},"map":{"version":3,"names":["NavigationOutcome","Object","freeze","Committed","Bypassed","Blocked","Redirected","Cancelled","Error"],"sources":["NavigationOutcome.ts"],"sourcesContent":["/**\n * Outcome of a navigation after the guard pipeline settles.\n *\n * Registered as a UI5 enum via `library.ts` so that it is discoverable\n * through `sap.ui.base.DataType.getType()`. Application code can import\n * the value object directly.\n *\n * @enum {string}\n * @namespace ui5.guard.router\n * @since 1.2.0\n */\nconst NavigationOutcome = Object.freeze({\n\t/** Navigation was allowed and the target route activated. @since 1.2.0 */\n\tCommitted: \"committed\",\n\t/** Navigation was allowed, but no route matched; UI5 continued with bypassed handling. @since 1.3.0 */\n\tBypassed: \"bypassed\",\n\t/** A guard blocked navigation; the previous route remains active. @since 1.2.0 */\n\tBlocked: \"blocked\",\n\t/** A guard redirected navigation to a different route. @since 1.2.0 */\n\tRedirected: \"redirected\",\n\t/** Navigation was cancelled before settling (superseded, stopped, or destroyed). @since 1.2.0 */\n\tCancelled: \"cancelled\",\n\t/** A guard threw or rejected; the previous route remains active. @since 1.4.0 */\n\tError: \"error\",\n});\n\ntype NavigationOutcome = (typeof NavigationOutcome)[keyof typeof NavigationOutcome];\n\nexport default NavigationOutcome;\n"],"mappings":"AAAA,kFAWA,MAAMA,EAAoBC,OAAOC,OAAO,CAEvCC,UAAW,YAEXC,SAAU,WAEVC,QAAS,UAETC,WAAY,aAEZC,UAAW,YAEXC,MAAO,UACL,OAIYR,CAAiB","ignoreList":[],"sourceRoot":""}},{"offset":{"line":3,"column":0},"map":{"version":3,"names":["NavigationOutcome","_interopRequireDefault","__NavigationOutcome","GuardPipeline","__GuardPipeline","isPromiseLike","HistoryDirection","coreLibrary","routing","LOG_COMPONENT","isRouteGuardConfig","guard","IDLE","kind","isRecord","value","Array","isArray","proto","Object","getPrototypeOf","prototype","isOneOf","values","set","Set","v","has","isUnknownRouteRegistrationPolicy","isNavToPreflightMode","isGuardLoading","isInheritance","OPTIONAL_OR_REST_SEGMENT","stripInlineQuery","seg","mqIdx","indexOf","slice","oqIdx","patternSegments","pattern","split","map","filter","test","isPatternAncestor","ancestorPattern","candidatePattern","ancestorSegments","length","candidateSegments","every","i","candidateSeg","startsWith","resolveGuardModulePath","dotPath","componentNamespace","replace","fullDotPath","parseGuardEntry","entry","hashIndex","rawPath","exportKey","undefined","modulePath","lastSegment","pop","name","guardWarning","detail","Log","warning","resolveModuleExports","moduleExport","descriptorName","moduleName","debug","fn","index","parseInt","Number","isNaN","results","push","entries","resolvedName","key","val","parseGuardDescriptors","guards","JSON","stringify","descriptors","pushEntries","route","type","label","parsed","config","leave","enter","info","DEFAULT_OPTIONS","unknownRouteRegistration","navToPreflight","guardLoading","inheritance","applyOption","raw","target","normalizeGuardRouterOptions","result","MAX_REDIRECT_DEPTH","Router","MobileRouter","extend","constructor","_constructor","args","routes","owner","rest","rawConfig","isRecordConfig","guardRouter","cleanConfig","MobileRouter.prototype.constructor.apply","this","_options","_pipeline","_currentRoute","_currentHash","_phase","_parseGeneration","_suppressedHash","_settlementResolvers","_lastSettlement","_pendingGuardDescriptors","_sourceDescriptors","_destroyed","_manifestMeta","Map","_runtimeMeta","_resolvedMetaCache","_routeNames","r","keys","routeMeta","routeName","meta","freeze","appConfig","getManifestEntry","id","uniquePaths","d","sap","ui","require","initialize","_initialize","MobileRouter.prototype.initialize.call","expandedDescriptors","_expandGuardDescriptors","_registerLazyGuards","_loadAndRegisterGuards","then","catch","err","error","String","addRoute","_addRoute","oConfig","MobileRouter.prototype.addRoute.apply","includes","clear","getRoute","newPattern","getPattern","newDescriptors","_expandGuardDescriptorsForNewRoute","newName","descriptor","ancestorRoute","_collectRoutePatterns","toSorted","a","b","pa","pb","addGuard","_addGuard","_isFn","addGlobalGuard","removeGuard","_removeGuard","removeGlobalGuard","addRouteGuard","_addRouteGuard","_handleUnknownRouteRegistration","hasHandler","beforeEnter","addEnterGuard","beforeLeave","addLeaveGuard","removeRouteGuard","_removeRouteGuard","removeLeaveGuard","removeEnterGuard","_addLeaveGuard","_resolveNavToArgs","componentTargetInfoOrReplace","replaceOrOptions","options","guardOptions","componentTargetInfo","method","methodName","Error","_removeLeaveGuard","getRouteMeta","_getRouteMeta","_EMPTY_META","cached","get","_resolveInheritedMeta","_resolveFlatMeta","setRouteMeta","_setRouteMeta","navigationSettled","_navigationSettled","Promise","resolve","status","Committed","hash","attachNavigationSettled","_attachNavigationSettled","oData","fnFunction","oListener","attachEvent","detachNavigationSettled","_detachNavigationSettled","detachEvent","_flushSettlement","resolvers","fireEvent","navTo","_navTo","parameters","origin","MobileRouter.prototype.navTo.call","_cancelPendingNavigation","targetHash","getURL","routeInfo","getRouteInfoByHash","toRoute","attempt","skipGuards","_commitNavigation","controller","AbortController","generation","context","_createGuardContext","signal","decision","evaluate","_applyPreflightDecision","bag","_errorNavigation","bReplace","action","_blockNavigation","_startRedirectChain","parse","_parse","newHash","_applyDecision","stop","_stop","MobileRouter.prototype.stop.call","abort","Cancelled","wasRedirect","Redirected","Bypassed","MobileRouter.prototype.parse.call","_redirect","chain","targetName","targetParameters","targetRoute","visited","join","attemptedHash","restoreHash","size","add","settlementBefore","resolvedHash","toHash","toArguments","arguments","fromRoute","fromHash","toMeta","fromMeta","skipLeaveGuards","_applyRedirectDecision","redirectsToCurrentHash","Blocked","_restoreHashIfNeeded","_restoreHash","suppressParse","hashChanger","getHashChanger","replaceHash","Unknown","allRoutes","patternByName","expanded","manifest","runtime","routeEntry","find","ancestors","sort","merged","ancestor","ancestorManifest","assign","ancestorRuntime","ownManifest","ownRuntime","promises","all","exports","_registerGuardFromDescriptor","guardFn","lazyGuard","reject","mod","exp","lazyExpander","destroy","_destroy","MobileRouter.prototype.destroy.call"],"sources":["Router.ts"],"sourcesContent":["import MobileRouter from \"sap/m/routing/Router\";\nimport Log from \"sap/base/Log\";\nimport coreLibrary from \"sap/ui/core/library\";\nimport type { ComponentTargetParameters } from \"sap/ui/core/routing/Router\";\nimport type { $RouteSettings } from \"sap/ui/core/routing/Route\";\nimport type {\n\tGuardFn,\n\tGuardContext,\n\tGuardNavToOptions,\n\tGuardResult,\n\tGuardRedirect,\n\tGuardRouter,\n\tGuardLoading,\n\tInheritance,\n\tLeaveGuardFn,\n\tManifestRouteGuardConfig,\n\tNavToPreflightMode,\n\tNavigationResult,\n\tRouter$NavigationSettledEvent,\n\tRouteGuardConfig,\n\tUnknownRouteRegistrationPolicy,\n} from \"./types\";\nimport NavigationOutcome from \"./NavigationOutcome\";\nimport GuardPipeline, { type GuardDecision, isPromiseLike } from \"./GuardPipeline\";\n\nconst HistoryDirection = coreLibrary.routing.HistoryDirection;\n\nconst LOG_COMPONENT = \"ui5.guard.router.Router\";\n\nfunction isRouteGuardConfig(guard: GuardFn | RouteGuardConfig): guard is RouteGuardConfig {\n\treturn typeof guard === \"object\" && guard !== null;\n}\n\n/** Snapshot of an in-flight navigation being evaluated by the guard pipeline. */\ninterface NavigationAttempt {\n\treadonly hash: string;\n\treadonly route: string;\n\treadonly controller: AbortController;\n\treadonly generation: number;\n}\n\ninterface PhaseIdle {\n\treadonly kind: \"idle\";\n}\n\ninterface PhaseEvaluating {\n\treadonly kind: \"evaluating\";\n\treadonly attempt: NavigationAttempt;\n}\n\ninterface PhaseCommitting {\n\treadonly kind: \"committing\";\n\treadonly hash: string;\n\treadonly route: string;\n\treadonly origin: \"preflight\" | \"redirect\" | \"parse\";\n}\n\ntype RouterPhase = PhaseIdle | PhaseEvaluating | PhaseCommitting;\n\nconst IDLE: PhaseIdle = { kind: \"idle\" };\n\n/** Type guard for plain objects. */\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n\tif (typeof value !== \"object\" || value === null || Array.isArray(value)) return false;\n\tconst proto = Object.getPrototypeOf(value);\n\treturn proto === Object.prototype || proto === null;\n}\n\n/** Create a type-narrowing validator for a finite set of string literal values. */\nfunction isOneOf<T extends string>(...values: T[]): (v: unknown) => v is T {\n\tconst set: ReadonlySet<string> = new Set(values);\n\treturn (v: unknown): v is T => typeof v === \"string\" && set.has(v);\n}\n\nconst isUnknownRouteRegistrationPolicy = isOneOf<UnknownRouteRegistrationPolicy>(\"ignore\", \"warn\", \"throw\");\nconst isNavToPreflightMode = isOneOf<NavToPreflightMode>(\"guard\", \"bypass\", \"off\");\nconst isGuardLoading = isOneOf<GuardLoading>(\"block\", \"lazy\");\nconst isInheritance = isOneOf<Inheritance>(\"none\", \"pattern-tree\");\n\n/** Matches a standalone optional (`:param:`) or rest (`:param*:`) segment. */\nconst OPTIONAL_OR_REST_SEGMENT = /^:[^:]*\\*?:$/;\n\n/**\n * Strips inline query and optional-query suffixes from a segment.\n *\n * UI5 (crossroads.js) allows query parameters to attach directly to a\n * path segment without a `/` separator:\n * - `product{?query}` → mandatory query on `product`\n * - `product:?query:` → optional query on `product`\n * - `{id}{?query}` → mandatory param + mandatory query\n *\n * For pattern-tree ancestry we only care about the path portion,\n * so these suffixes are stripped.\n */\nfunction stripInlineQuery(seg: string): string {\n\t// Strip mandatory query `{?...}` suffix\n\tconst mqIdx = seg.indexOf(\"{?\");\n\tif (mqIdx !== -1) return seg.slice(0, mqIdx);\n\t// Strip optional query `:?...:` suffix\n\tconst oqIdx = seg.indexOf(\":?\");\n\tif (oqIdx !== -1) return seg.slice(0, oqIdx);\n\treturn seg;\n}\n\n/**\n * Extract mandatory path segments from a UI5 route pattern.\n *\n * Splits on `/`, strips inline query suffixes, then drops empty segments,\n * standalone optional (`:param:`), and rest (`:param*:`) segments.\n */\nfunction patternSegments(pattern: string): string[] {\n\treturn pattern\n\t\t.split(\"/\")\n\t\t.map(stripInlineQuery)\n\t\t.filter((seg) => seg !== \"\" && !OPTIONAL_OR_REST_SEGMENT.test(seg));\n}\n\n/**\n * Check if `ancestorPattern` is a URL-tree ancestor of `candidatePattern`.\n *\n * Both patterns are reduced to their mandatory path segments and compared\n * positionally. Mandatory parameter segments (`{paramA}`, `{paramB}`) are\n * treated as equivalent regardless of name, so `employees/{empId}` is\n * recognized as an ancestor of `employees/{id}/resume`.\n */\nfunction isPatternAncestor(ancestorPattern: string, candidatePattern: string): boolean {\n\tif (ancestorPattern === \"\") return true;\n\tconst ancestorSegments = patternSegments(ancestorPattern);\n\tif (ancestorSegments.length === 0) return false;\n\tconst candidateSegments = patternSegments(candidatePattern);\n\tif (candidateSegments.length <= ancestorSegments.length) return false;\n\treturn ancestorSegments.every((seg, i) => {\n\t\tconst candidateSeg = candidateSegments[i];\n\t\tif (seg === candidateSeg) return true;\n\t\t// Treat any two mandatory parameter segments as equivalent\n\t\treturn seg.startsWith(\"{\") && candidateSeg.startsWith(\"{\");\n\t});\n}\n\n/** Parsed guard declaration from the manifest `guards` block. */\ninterface GuardDescriptor {\n\treadonly route: string; // \"*\" for global, route name for per-route\n\treadonly type: \"enter\" | \"leave\";\n\treadonly modulePath: string;\n\treadonly name: string;\n\treadonly exportKey?: string;\n}\n\n/**\n * Resolve a guard module path to a slash-separated AMD module path.\n *\n * Inspired by `sap.ui.core.routing.Target._getEffectiveObjectName()`,\n * which skips namespace prepending for `\"module:\"`-prefixed paths. This\n * function goes further: it also converts dots to slashes in a single\n * step, so both dot notation (`module:some.lib.guard`) and slash\n * notation (`module:some/lib/guard`) are accepted.\n *\n * - Paths prefixed with `\"module:\"` are treated as absolute (the prefix\n * is stripped, dots become slashes).\n * - All other paths are prefixed with the component namespace, then dots\n * become slashes.\n */\nfunction resolveGuardModulePath(dotPath: string, componentNamespace: string): string {\n\tif (dotPath.startsWith(\"module:\")) {\n\t\treturn dotPath.slice(\"module:\".length).replace(/\\./g, \"/\");\n\t}\n\tconst fullDotPath = componentNamespace ? componentNamespace + \".\" + dotPath : dotPath;\n\treturn fullDotPath.replace(/\\./g, \"/\");\n}\n\n/**\n * Split a manifest guard entry on the first `#` to separate the module path\n * from an optional export key, then derive a human-readable guard name.\n */\nfunction parseGuardEntry(\n\tentry: string,\n\tcomponentNamespace: string,\n): { modulePath: string; name: string; exportKey?: string } {\n\tconst hashIndex = entry.indexOf(\"#\");\n\tconst rawPath = hashIndex === -1 ? entry : entry.slice(0, hashIndex);\n\tconst exportKey = hashIndex === -1 ? undefined : entry.slice(hashIndex + 1);\n\n\tconst modulePath = resolveGuardModulePath(rawPath, componentNamespace);\n\n\t// Name: export key if present, otherwise last segment of the dot path\n\tconst lastSegment = rawPath.split(\".\").pop() ?? rawPath;\n\tconst name = exportKey ?? lastSegment;\n\n\treturn { modulePath, name, exportKey };\n}\n\ninterface ResolvedGuardExport {\n\treadonly name: string;\n\treadonly fn: GuardFn;\n}\n\n/** Log a warning about a guard module entry in the manifest. */\nfunction guardWarning(modulePath: string, detail: string): void {\n\tLog.warning(`guardRouter.guards: \"${modulePath}\" ${detail}`, undefined, LOG_COMPONENT);\n}\n\n/**\n * Detect the export shape of a loaded guard module and extract guard functions.\n *\n * Shapes:\n * - function → single guard\n * - Array → ordered guards (non-functions warned and skipped)\n * - plain object → named guards in key order (non-functions warned and skipped)\n *\n * When `exportKey` is set, only the matching export is returned.\n * When `exportKey` is set on a function export, the key is ignored with a debug warning.\n */\nfunction resolveModuleExports(\n\tmoduleExport: unknown,\n\tmodulePath: string,\n\tdescriptorName: string,\n\texportKey?: string,\n): ResolvedGuardExport[] {\n\tconst moduleName = modulePath.split(\"/\").pop() ?? modulePath;\n\n\t// Shape 1: function\n\tif (typeof moduleExport === \"function\") {\n\t\tif (exportKey !== undefined) {\n\t\t\tLog.debug(\n\t\t\t\t`guardRouter.guards: \"${modulePath}#${exportKey}\" is a single function, ignoring export key`,\n\t\t\t\tundefined,\n\t\t\t\tLOG_COMPONENT,\n\t\t\t);\n\t\t}\n\t\treturn [{ name: descriptorName, fn: moduleExport as GuardFn }];\n\t}\n\n\t// Shape 2: array\n\tif (Array.isArray(moduleExport)) {\n\t\tif (moduleExport.length === 0) {\n\t\t\tguardWarning(modulePath, \"exported an empty array, skipping\");\n\t\t\treturn [];\n\t\t}\n\n\t\tif (exportKey !== undefined) {\n\t\t\tconst index = parseInt(exportKey, 10);\n\t\t\tif (Number.isNaN(index) || index < 0 || index >= moduleExport.length) {\n\t\t\t\tguardWarning(modulePath, `#${exportKey} - index out of range, skipping`);\n\t\t\t\treturn [];\n\t\t\t}\n\t\t\tconst entry = moduleExport[index] as unknown;\n\t\t\tif (typeof entry !== \"function\") {\n\t\t\t\tguardWarning(modulePath, `#${exportKey} is not a function, skipping`);\n\t\t\t\treturn [];\n\t\t\t}\n\t\t\treturn [{ name: `${moduleName}#${exportKey}`, fn: entry as GuardFn }];\n\t\t}\n\n\t\tconst results: ResolvedGuardExport[] = [];\n\t\tfor (let i = 0; i < moduleExport.length; i++) {\n\t\t\tconst entry = moduleExport[i] as unknown;\n\t\t\tif (typeof entry !== \"function\") {\n\t\t\t\tguardWarning(modulePath, `[${i}] is not a function, skipping`);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tresults.push({ name: `${moduleName}#${i}`, fn: entry as GuardFn });\n\t\t}\n\t\treturn results;\n\t}\n\n\t// Shape 3: plain object\n\tif (isRecord(moduleExport)) {\n\t\tconst entries = Object.entries(moduleExport);\n\t\tif (entries.length === 0) {\n\t\t\tguardWarning(modulePath, \"exported an empty object, skipping\");\n\t\t\treturn [];\n\t\t}\n\n\t\tif (exportKey !== undefined) {\n\t\t\tlet value: unknown = moduleExport[exportKey];\n\t\t\tlet resolvedName = exportKey;\n\t\t\tif (value === undefined) {\n\t\t\t\tconst index = parseInt(exportKey, 10);\n\t\t\t\tif (!Number.isNaN(index) && index >= 0 && index < entries.length) {\n\t\t\t\t\tconst [key, val] = entries[index];\n\t\t\t\t\tvalue = val;\n\t\t\t\t\tresolvedName = key;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (value === undefined) {\n\t\t\t\tguardWarning(modulePath, `#${exportKey} - key not found, skipping`);\n\t\t\t\treturn [];\n\t\t\t}\n\t\t\tif (typeof value !== \"function\") {\n\t\t\t\tguardWarning(modulePath, `#${exportKey} is not a function, skipping`);\n\t\t\t\treturn [];\n\t\t\t}\n\t\t\treturn [{ name: resolvedName, fn: value as GuardFn }];\n\t\t}\n\n\t\tconst results: ResolvedGuardExport[] = [];\n\t\tfor (const [key, value] of entries) {\n\t\t\tif (typeof value !== \"function\") {\n\t\t\t\tguardWarning(modulePath, `.${key} is not a function, skipping`);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tresults.push({ name: key, fn: value as GuardFn });\n\t\t}\n\t\treturn results;\n\t}\n\n\tguardWarning(modulePath, \"did not export a function, array, or plain object, skipping\");\n\treturn [];\n}\n\n/**\n * Parse the `guards` block from the guardRouter config into an array of\n * {@link GuardDescriptor} objects.\n *\n * Handles:\n * - `\"*\"` key with `string[]` -> global enter guards\n * - Route name with `string[]` (shorthand) -> enter guards\n * - Route name with `{ enter: [...], leave: [...] }` -> enter + leave guards\n * - `\"*\"` with object form -> warn, treat enter as global\n * - `\"*\"` leave -> warn, skip (global leave guards not supported)\n * - Invalid entries -> warn, skip\n */\nfunction parseGuardDescriptors(guards: unknown, componentNamespace: string): GuardDescriptor[] {\n\tif (!isRecord(guards)) {\n\t\tLog.warning(\"guardRouter.guards is not a plain object, skipping\", JSON.stringify(guards), LOG_COMPONENT);\n\t\treturn [];\n\t}\n\n\tconst descriptors: GuardDescriptor[] = [];\n\n\tfunction pushEntries(entries: unknown[], route: string, type: \"enter\" | \"leave\", label: string): void {\n\t\tfor (const entry of entries) {\n\t\t\tif (typeof entry !== \"string\" || entry.length === 0) {\n\t\t\t\tLog.warning(\n\t\t\t\t\t`guardRouter.guards${label}: invalid entry, skipping`,\n\t\t\t\t\tJSON.stringify(entry),\n\t\t\t\t\tLOG_COMPONENT,\n\t\t\t\t);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst parsed = parseGuardEntry(entry, componentNamespace);\n\t\t\tdescriptors.push({ route, type, ...parsed });\n\t\t}\n\t}\n\n\tfor (const [key, value] of Object.entries(guards)) {\n\t\tif (Array.isArray(value)) {\n\t\t\tpushEntries(value, key, \"enter\", `[\"${key}\"]`);\n\t\t} else if (isRecord(value)) {\n\t\t\tconst config = value as ManifestRouteGuardConfig;\n\n\t\t\tif (key === \"*\" && config.leave !== undefined) {\n\t\t\t\tLog.warning(\n\t\t\t\t\t'guardRouter.guards[\"*\"].leave: global leave guards are not supported, skipping',\n\t\t\t\t\tundefined,\n\t\t\t\t\tLOG_COMPONENT,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (key === \"*\" && config.enter === undefined && config.leave !== undefined) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (key === \"*\" && config.enter !== undefined) {\n\t\t\t\tLog.info('guardRouter.guards[\"*\"]: object form; treating enter as global', undefined, LOG_COMPONENT);\n\t\t\t}\n\n\t\t\tif (Array.isArray(config.enter)) {\n\t\t\t\tpushEntries(config.enter, key, \"enter\", `[\"${key}\"].enter`);\n\t\t\t}\n\n\t\t\tif (key !== \"*\" && Array.isArray(config.leave)) {\n\t\t\t\tpushEntries(config.leave, key, \"leave\", `[\"${key}\"].leave`);\n\t\t\t}\n\t\t} else {\n\t\t\tLog.warning(\n\t\t\t\t`guardRouter.guards[\"${key}\"]: expected string[] or { enter?, leave? }, skipping`,\n\t\t\t\tJSON.stringify(value),\n\t\t\t\tLOG_COMPONENT,\n\t\t\t);\n\t\t}\n\t}\n\n\treturn descriptors;\n}\n\ninterface ResolvedGuardRouterOptions {\n\treadonly unknownRouteRegistration: UnknownRouteRegistrationPolicy;\n\treadonly navToPreflight: NavToPreflightMode;\n\treadonly guardLoading: GuardLoading;\n\treadonly inheritance: Inheritance;\n}\n\nconst DEFAULT_OPTIONS: ResolvedGuardRouterOptions = {\n\tunknownRouteRegistration: \"warn\",\n\tnavToPreflight: \"guard\",\n\tguardLoading: \"lazy\",\n\tinheritance: \"none\",\n};\n\nfunction applyOption<K extends keyof ResolvedGuardRouterOptions>(\n\traw: Record<string, unknown>,\n\tkey: K,\n\tguard: (v: unknown) => v is ResolvedGuardRouterOptions[K],\n\ttarget: { -readonly [P in keyof ResolvedGuardRouterOptions]: ResolvedGuardRouterOptions[P] },\n): void {\n\tif (raw[key] !== undefined) {\n\t\tif (guard(raw[key])) {\n\t\t\ttarget[key] = raw[key] as ResolvedGuardRouterOptions[K];\n\t\t} else {\n\t\t\tLog.warning(`guardRouter.${key} has invalid value, using default`, JSON.stringify(raw[key]), LOG_COMPONENT);\n\t\t}\n\t}\n}\n\nfunction normalizeGuardRouterOptions(raw: unknown): ResolvedGuardRouterOptions {\n\tif (!isRecord(raw)) {\n\t\tif (raw !== undefined) {\n\t\t\tLog.warning(\"guardRouter config is not a plain object, using defaults\", JSON.stringify(raw), LOG_COMPONENT);\n\t\t}\n\t\treturn DEFAULT_OPTIONS;\n\t}\n\n\tconst result = { ...DEFAULT_OPTIONS };\n\tapplyOption(raw, \"unknownRouteRegistration\", isUnknownRouteRegistrationPolicy, result);\n\tapplyOption(raw, \"navToPreflight\", isNavToPreflightMode, result);\n\tapplyOption(raw, \"guardLoading\", isGuardLoading, result);\n\tapplyOption(raw, \"inheritance\", isInheritance, result);\n\treturn result;\n}\n\n/** Maximum number of hops in a redirect chain before it is treated as a loop. */\nconst MAX_REDIRECT_DEPTH = 10;\n\n/** State threaded through a redirect chain. */\ninterface RedirectChainContext {\n\t/** Hashes whose guards have been evaluated in this chain (mutated via .add()). */\n\tvisited: Set<string>;\n\t/** Hash of the originally attempted navigation (for settlement / hash restore). */\n\treadonly attemptedHash: string | undefined;\n\t/** Whether to restore the hash on block (true for parse path, false for preflight). */\n\treadonly restoreHash: boolean;\n\t/** Original source route (the route the user occupies). */\n\treadonly fromRoute: string;\n\t/** Original source hash (the hash the user occupies). */\n\treadonly fromHash: string;\n\t/** Shared AbortSignal from the original navigation. */\n\treadonly signal: AbortSignal;\n\t/** Shared generation counter from the original navigation. */\n\treadonly generation: number;\n\t/** Shared bag from the original navigation's guard context. */\n\treadonly bag: Map<string, unknown>;\n}\n\n/**\n * Router with navigation guard support.\n *\n * Extends `sap.m.routing.Router` with a shared guard pipeline that\n * evaluates registered guard functions before route matching, target\n * loading, or event firing occurs.\n *\n * Two entry points feed the same pipeline:\n * - `navTo()` runs guards as a preflight check. Blocked or redirected\n * navigations never change the hash or push history entries.\n * - `parse()` runs guards as a fallback for browser back/forward, URL\n * bar entry, and direct hash changes where the hash has already changed\n * before guards can intercept.\n *\n * Key assumptions (see docs/reference/architecture.md for full rationale):\n * - `parse()` is intentionally NOT async. Sync guards execute in the\n * same tick; async guards fall back to a deferred path.\n * - `replaceHash` fires `hashChanged` synchronously (validated by test).\n * - `setHash` (via `super.navTo`) fires `hashChanged` synchronously (validated by test).\n * - Redirect targets are evaluated by the guard pipeline with loop detection.\n *\n * @namespace ui5.guard.router\n * @extends sap.m.routing.Router\n */\nexport default class Router extends MobileRouter implements GuardRouter {\n\tprivate _options: ResolvedGuardRouterOptions = DEFAULT_OPTIONS;\n\tprivate _pipeline = new GuardPipeline();\n\tprivate _currentRoute = \"\";\n\tprivate _currentHash: string | null = null;\n\tprivate _phase: RouterPhase = IDLE;\n\tprivate _parseGeneration = 0;\n\tprivate _suppressedHash: string | null = null;\n\tprivate _settlementResolvers: ((result: NavigationResult) => void)[] = [];\n\tprivate _lastSettlement: NavigationResult | null = null;\n\tprivate _pendingGuardDescriptors: GuardDescriptor[] = [];\n\tprivate _sourceDescriptors: GuardDescriptor[] = [];\n\tprivate _destroyed = false;\n\tprivate _manifestMeta = new Map<string, Readonly<Record<string, unknown>>>();\n\tprivate _runtimeMeta = new Map<string, Readonly<Record<string, unknown>>>();\n\tprivate _resolvedMetaCache = new Map<string, Readonly<Record<string, unknown>>>();\n\tprivate _routeNames: string[] = [];\n\n\tconstructor(...args: ConstructorParameters<typeof MobileRouter>) {\n\t\tconst [routes, config, owner, ...rest] = args;\n\t\tconst rawConfig = config as Record<string, unknown> | undefined;\n\t\tconst isRecordConfig = isRecord(rawConfig);\n\t\tconst { guardRouter, ...cleanConfig } = isRecordConfig ? rawConfig : ({} as Record<string, unknown>);\n\t\tsuper(routes, isRecordConfig ? (cleanConfig as typeof config) : config, owner, ...rest);\n\t\tthis._options = normalizeGuardRouterOptions(guardRouter);\n\n\t\t// Collect route names from the constructor's routes parameter for pattern-tree traversal.\n\t\tif (Array.isArray(routes)) {\n\t\t\tthis._routeNames = routes\n\t\t\t\t.filter((r): r is { name: string } => isRecord(r) && typeof r.name === \"string\")\n\t\t\t\t.map((r) => r.name);\n\t\t} else if (isRecord(routes)) {\n\t\t\tthis._routeNames = Object.keys(routes);\n\t\t}\n\n\t\tif (isRecord(guardRouter) && guardRouter.routeMeta !== undefined) {\n\t\t\tif (isRecord(guardRouter.routeMeta)) {\n\t\t\t\tfor (const [routeName, meta] of Object.entries(guardRouter.routeMeta)) {\n\t\t\t\t\tif (isRecord(meta)) {\n\t\t\t\t\t\tthis._manifestMeta.set(routeName, Object.freeze({ ...meta }));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tLog.warning(\n\t\t\t\t\t\t\t`guardRouter.routeMeta[\"${routeName}\"]: expected object, skipping`,\n\t\t\t\t\t\t\tJSON.stringify(meta),\n\t\t\t\t\t\t\tLOG_COMPONENT,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tLog.warning(\n\t\t\t\t\t\"guardRouter.routeMeta: expected object, skipping\",\n\t\t\t\t\tJSON.stringify(guardRouter.routeMeta),\n\t\t\t\t\tLOG_COMPONENT,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif (isRecord(guardRouter) && guardRouter.guards !== undefined) {\n\t\t\tlet componentNamespace = \"\";\n\t\t\tif (owner) {\n\t\t\t\tconst appConfig = owner.getManifestEntry(\"sap.app\") as Record<string, unknown> | undefined;\n\t\t\t\tif (isRecord(appConfig) && typeof appConfig.id === \"string\") {\n\t\t\t\t\tcomponentNamespace = appConfig.id;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._pendingGuardDescriptors = parseGuardDescriptors(guardRouter.guards, componentNamespace);\n\n\t\t\t// Fire-and-forget preload hint: warm the module cache so lazy\n\t\t\t// wrappers resolve synchronously on first navigation.\n\t\t\t// Block mode loads modules itself in initialize().\n\t\t\tif (this._pendingGuardDescriptors.length > 0 && this._options.guardLoading === \"lazy\") {\n\t\t\t\tconst uniquePaths = [...new Set(this._pendingGuardDescriptors.map((d) => d.modulePath))];\n\t\t\t\tsap.ui.require(uniquePaths);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Initialize the router. When manifest guards are declared and\n\t * `guardLoading` is `\"block\"`, module loading starts and\n\t * `super.initialize()` is deferred until all modules are loaded.\n\t * In `\"lazy\"` mode, lazy wrappers are registered synchronously\n\t * and `super.initialize()` is called immediately.\n\t *\n\t * @override sap.ui.core.routing.Router#initialize\n\t * @since 1.0.1\n\t */\n\toverride initialize(): this {\n\t\tif (this._pendingGuardDescriptors.length === 0) {\n\t\t\treturn super.initialize();\n\t\t}\n\n\t\tconst descriptors = this._pendingGuardDescriptors;\n\t\tthis._pendingGuardDescriptors = [];\n\t\tthis._sourceDescriptors = descriptors;\n\n\t\tconst expandedDescriptors =\n\t\t\tthis._options.inheritance === \"pattern-tree\" ? this._expandGuardDescriptors(descriptors) : descriptors;\n\n\t\tif (this._options.guardLoading === \"lazy\") {\n\t\t\tthis._registerLazyGuards(expandedDescriptors);\n\t\t\treturn super.initialize();\n\t\t}\n\n\t\t// \"block\" mode: load all modules, then initialize.\n\t\t// Guard against destroy() being called while modules are still loading.\n\t\tthis._loadAndRegisterGuards(expandedDescriptors)\n\t\t\t.then(() => {\n\t\t\t\tif (!this._destroyed) super.initialize();\n\t\t\t})\n\t\t\t.catch((err: unknown) => {\n\t\t\t\tif (this._destroyed) return;\n\t\t\t\tLog.error(\n\t\t\t\t\t\"guardRouter.guards: module loading failed, initializing without manifest guards\",\n\t\t\t\t\tString(err),\n\t\t\t\t\tLOG_COMPONENT,\n\t\t\t\t);\n\t\t\t\tsuper.initialize();\n\t\t\t});\n\t\treturn this;\n\t}\n\n\t/**\n\t * Add a route dynamically and integrate it into pattern-tree inheritance.\n\t *\n\t * Appends the route name to the internal route list so that\n\t * `_collectRoutePatterns()` includes it in subsequent inheritance\n\t * lookups, clears the metadata cache, and registers any inherited\n\t * manifest guards when `inheritance` is `\"pattern-tree\"`.\n\t *\n\t * @param oConfig - Route configuration object as defined by `sap.ui.core.routing.Route`.\n\t * @param rest - Additional arguments forwarded to the parent `addRoute`.\n\t * @override sap.ui.core.routing.Router#addRoute\n\t * @since 1.6.0\n\t */\n\toverride addRoute(oConfig: $RouteSettings, ...rest: unknown[]): void {\n\t\t// @ts-expect-error -- oParent is required in the type declaration but optional at runtime\n\t\tsuper.addRoute(oConfig, ...rest);\n\n\t\t// Skip when called by the parent constructor before field initializers have run.\n\t\t// Routes from the constructor args are captured in _routeNames by the constructor body.\n\t\tif (!this._routeNames) return;\n\n\t\tconst name = oConfig.name;\n\t\tif (typeof name !== \"string\") return;\n\t\tif (this._routeNames.includes(name)) return;\n\n\t\tthis._routeNames.push(name);\n\t\tthis._resolvedMetaCache.clear();\n\n\t\tif (this._options.inheritance !== \"pattern-tree\") return;\n\t\tif (this._sourceDescriptors.length === 0) return;\n\n\t\tconst route = this.getRoute(name);\n\t\tif (!route) return;\n\t\tconst newPattern = route.getPattern();\n\t\tif (newPattern === undefined) return;\n\n\t\tconst newDescriptors = this._expandGuardDescriptorsForNewRoute(name, newPattern);\n\t\tif (newDescriptors.length === 0) return;\n\n\t\t// Always use lazy registration: if the module was loaded during\n\t\t// initialize() (block mode), the sync cache probe succeeds immediately.\n\t\t// This avoids an async gap between addRoute() and the first navigation.\n\t\tthis._registerLazyGuards(newDescriptors);\n\t}\n\n\t/**\n\t * Expand manifest guard descriptors for a single newly added route.\n\t *\n\t * For each source descriptor whose route is an ancestor of the new\n\t * route's pattern, emits a copy targeting the new route. Also emits\n\t * copies for existing routes that are descendants of the new route\n\t * (in case the new route has declared guards). Sorted by depth.\n\t */\n\tprivate _expandGuardDescriptorsForNewRoute(newName: string, newPattern: string): GuardDescriptor[] {\n\t\tconst result: GuardDescriptor[] = [];\n\n\t\tfor (const descriptor of this._sourceDescriptors) {\n\t\t\tif (descriptor.route === \"*\") continue;\n\n\t\t\tif (descriptor.route !== newName) {\n\t\t\t\t// Check if the source descriptor's route is an ancestor of the new route.\n\t\t\t\tconst ancestorRoute = this.getRoute(descriptor.route);\n\t\t\t\tconst ancestorPattern = ancestorRoute?.getPattern();\n\t\t\t\tif (ancestorPattern !== undefined && isPatternAncestor(ancestorPattern, newPattern)) {\n\t\t\t\t\tresult.push({ ...descriptor, route: newName });\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// The new route itself has a source descriptor: expand to existing descendants.\n\t\t\t\tfor (const { name, pattern } of this._collectRoutePatterns()) {\n\t\t\t\t\tif (name === newName) continue;\n\t\t\t\t\tif (isPatternAncestor(newPattern, pattern)) {\n\t\t\t\t\t\tresult.push({ ...descriptor, route: name });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Sort by pattern depth (ancestor guards run before descendant guards).\n\t\treturn result.toSorted((a, b) => {\n\t\t\tconst pa = this.getRoute(a.route)?.getPattern() ?? \"\";\n\t\t\tconst pb = this.getRoute(b.route)?.getPattern() ?? \"\";\n\t\t\treturn patternSegments(pa).length - patternSegments(pb).length;\n\t\t});\n\t}\n\n\t/**\n\t * Register a global guard that runs for every navigation.\n\t *\n\t * @param guard - Guard function to register. Non-functions are ignored with a warning.\n\t * @returns `this` for chaining.\n\t * @since 1.0.1\n\t */\n\taddGuard(guard: GuardFn): this {\n\t\tif (!this._isFn(guard, \"addGuard\")) return this;\n\t\tthis._pipeline.addGlobalGuard(guard);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Remove a previously registered global guard.\n\t *\n\t * @param guard - Guard function to remove by reference. Non-functions are ignored with a warning.\n\t * @returns `this` for chaining.\n\t * @since 1.0.1\n\t */\n\tremoveGuard(guard: GuardFn): this {\n\t\tif (!this._isFn(guard, \"removeGuard\")) return this;\n\t\tthis._pipeline.removeGlobalGuard(guard);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Register a guard for a specific route.\n\t *\n\t * Accepts either a guard function (registered as an enter guard) or a\n\t * configuration object with `beforeEnter` and/or `beforeLeave` guards.\n\t *\n\t * @param routeName - Route name as defined in `manifest.json`. If the route is unknown, the {@link GuardRouterOptions.unknownRouteRegistration} policy applies (default: warn).\n\t * @param guard - Guard function or {@link RouteGuardConfig} object.\n\t * @returns `this` for chaining.\n\t * @since 1.0.1\n\t */\n\taddRouteGuard(routeName: string, guard: GuardFn | RouteGuardConfig): this {\n\t\tif (isRouteGuardConfig(guard)) {\n\t\t\tif (!this._handleUnknownRouteRegistration(routeName, \"addRouteGuard\")) {\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\tlet hasHandler = false;\n\n\t\t\tif (guard.beforeEnter !== undefined) {\n\t\t\t\thasHandler = true;\n\t\t\t\tif (this._isFn(guard.beforeEnter, \"addRouteGuard\", routeName)) {\n\t\t\t\t\tthis._pipeline.addEnterGuard(routeName, guard.beforeEnter);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (guard.beforeLeave !== undefined) {\n\t\t\t\thasHandler = true;\n\t\t\t\tif (this._isFn(guard.beforeLeave, \"addRouteGuard\", routeName)) {\n\t\t\t\t\tthis._pipeline.addLeaveGuard(routeName, guard.beforeLeave);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!hasHandler) {\n\t\t\t\tLog.info(\"addRouteGuard: config has no beforeEnter or beforeLeave\", routeName, LOG_COMPONENT);\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\t\tif (!this._isFn(guard, \"addRouteGuard\", routeName)) return this;\n\t\tif (!this._handleUnknownRouteRegistration(routeName, \"addRouteGuard\")) {\n\t\t\treturn this;\n\t\t}\n\t\tthis._pipeline.addEnterGuard(routeName, guard);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Remove a guard from a specific route.\n\t *\n\t * Accepts the same forms as `addRouteGuard`: a guard function removes\n\t * an enter guard; a configuration object removes `beforeEnter` and/or\n\t * `beforeLeave` by reference.\n\t *\n\t * @param routeName - Route name as defined in `manifest.json`.\n\t * @param guard - Guard function or {@link RouteGuardConfig} object to remove by reference.\n\t * @returns `this` for chaining.\n\t * @since 1.0.1\n\t */\n\tremoveRouteGuard(routeName: string, guard: GuardFn | RouteGuardConfig): this {\n\t\tif (isRouteGuardConfig(guard)) {\n\t\t\tif (typeof guard.beforeEnter === \"function\") {\n\t\t\t\tthis.removeRouteGuard(routeName, guard.beforeEnter);\n\t\t\t}\n\t\t\tif (typeof guard.beforeLeave === \"function\") {\n\t\t\t\tthis.removeLeaveGuard(routeName, guard.beforeLeave);\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\t\tif (!this._isFn(guard, \"removeRouteGuard\", routeName)) return this;\n\t\tthis._pipeline.removeEnterGuard(routeName, guard);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Register a leave guard for a specific route.\n\t *\n\t * Leave guards run when navigating **away from** the route, before any\n\t * enter guards for the target route. They answer the binary question\n\t * \"can I leave?\" and return only a boolean (no redirects).\n\t *\n\t * @param routeName - Route name as defined in `manifest.json`. If the route is unknown, the {@link GuardRouterOptions.unknownRouteRegistration} policy applies (default: warn).\n\t * @param guard - Leave guard function to register. Non-functions are ignored with a warning.\n\t * @returns `this` for chaining.\n\t * @since 1.0.1\n\t */\n\taddLeaveGuard(routeName: string, guard: LeaveGuardFn): this {\n\t\tif (!this._isFn(guard, \"addLeaveGuard\", routeName)) return this;\n\t\tif (!this._handleUnknownRouteRegistration(routeName, \"addLeaveGuard\")) {\n\t\t\treturn this;\n\t\t}\n\t\tthis._pipeline.addLeaveGuard(routeName, guard);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Disambiguate the `navTo()` overload shapes into resolved arguments.\n\t *\n\t * UI5's native `navTo` has two signatures where the third parameter is either\n\t * `componentTargetInfo` (object) or `bReplace` (boolean). This method normalizes\n\t * both forms so the rest of `navTo` can work with a single set of variables.\n\t */\n\tprivate _resolveNavToArgs(\n\t\tcomponentTargetInfoOrReplace?: Record<string, ComponentTargetParameters> | boolean,\n\t\treplaceOrOptions?: boolean | GuardNavToOptions,\n\t\toptions?: GuardNavToOptions,\n\t): {\n\t\tcomponentTargetInfo?: Record<string, ComponentTargetParameters>;\n\t\treplace?: boolean;\n\t\tguardOptions?: GuardNavToOptions;\n\t} {\n\t\tif (typeof componentTargetInfoOrReplace === \"boolean\") {\n\t\t\t// Short form: navTo(name, params, replace, options?)\n\t\t\treturn {\n\t\t\t\treplace: componentTargetInfoOrReplace,\n\t\t\t\tguardOptions:\n\t\t\t\t\ttypeof replaceOrOptions === \"object\" && replaceOrOptions !== null ? replaceOrOptions : undefined,\n\t\t\t};\n\t\t}\n\t\t// Long form: navTo(name, params, componentTargetInfo, replace, options?)\n\t\treturn {\n\t\t\tcomponentTargetInfo: componentTargetInfoOrReplace,\n\t\t\treplace: typeof replaceOrOptions === \"boolean\" ? replaceOrOptions : undefined,\n\t\t\tguardOptions: options,\n\t\t};\n\t}\n\n\t/** Return `true` when the value is a function; otherwise log a warning. */\n\tprivate _isFn(value: unknown, method: string, detail?: string): boolean {\n\t\tif (typeof value === \"function\") return true;\n\t\tLog.warning(`${method}: not a function, ignoring`, detail, LOG_COMPONENT);\n\t\treturn false;\n\t}\n\n\t/**\n\t * Handle guard registration for a potentially unknown route.\n\t * Returns `true` if registration should proceed, `false` if not.\n\t */\n\tprivate _handleUnknownRouteRegistration(routeName: string, methodName: string): boolean {\n\t\tif (this.getRoute(routeName)) return true;\n\n\t\tswitch (this._options.unknownRouteRegistration) {\n\t\t\tcase \"ignore\":\n\t\t\t\treturn true;\n\t\t\tcase \"throw\":\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`${methodName} called for unknown route \"${routeName}\". ` +\n\t\t\t\t\t\t`Set guardRouter.unknownRouteRegistration to \"warn\" or \"ignore\" to allow this.`,\n\t\t\t\t);\n\t\t\tcase \"warn\":\n\t\t\tdefault:\n\t\t\t\tLog.warning(`${methodName}: unknown route, guard registered anyway`, routeName, LOG_COMPONENT);\n\t\t\t\treturn true;\n\t\t}\n\t}\n\n\t/**\n\t * Remove a leave guard from a specific route.\n\t *\n\t * @param routeName - Route name as defined in `manifest.json`.\n\t * @param guard - Leave guard function to remove by reference. Non-functions are ignored with a warning.\n\t * @returns `this` for chaining.\n\t * @since 1.0.1\n\t */\n\tremoveLeaveGuard(routeName: string, guard: LeaveGuardFn): this {\n\t\tif (!this._isFn(guard, \"removeLeaveGuard\", routeName)) return this;\n\t\tthis._pipeline.removeLeaveGuard(routeName, guard);\n\t\treturn this;\n\t}\n\n\tprivate static readonly _EMPTY_META: Readonly<Record<string, unknown>> = Object.freeze({});\n\n\t/**\n\t * Return the resolved metadata for a route.\n\t *\n\t * When `inheritance` is `\"pattern-tree\"`, walks the ancestor chain and\n\t * shallow-merges metadata shallowest-first (child values win on conflict).\n\t * Both manifest and runtime metadata participate in inheritance.\n\t * The router caches results; {@link setRouteMeta} and `addRoute()` clear the cache.\n\t *\n\t * Logs a warning for unknown non-empty route names and returns an empty\n\t * frozen object. The empty string `\"\"` is treated as a valid root route.\n\t *\n\t * @param routeName - Route name as defined in `manifest.json`.\n\t * @returns Frozen record of metadata key-value pairs, or an empty frozen object if the route has no metadata.\n\t * @since 1.6.0\n\t */\n\tgetRouteMeta(routeName: string): Readonly<Record<string, unknown>> {\n\t\t// Empty string is a valid root route name (initial state before first navigation)\n\t\tif (routeName !== \"\" && !this.getRoute(routeName)) {\n\t\t\tLog.warning(\"getRouteMeta: unknown route, returning empty metadata\", routeName, LOG_COMPONENT);\n\t\t\treturn Router._EMPTY_META;\n\t\t}\n\n\t\t// Cache hit\n\t\tconst cached = this._resolvedMetaCache.get(routeName);\n\t\tif (cached) return cached;\n\n\t\tlet result: Readonly<Record<string, unknown>>;\n\n\t\tif (this._options.inheritance === \"pattern-tree\") {\n\t\t\tresult = this._resolveInheritedMeta(routeName);\n\t\t} else {\n\t\t\tresult = this._resolveFlatMeta(routeName);\n\t\t}\n\n\t\tif (Object.keys(result).length === 0) {\n\t\t\tthis._resolvedMetaCache.set(routeName, Router._EMPTY_META);\n\t\t\treturn Router._EMPTY_META;\n\t\t}\n\n\t\tthis._resolvedMetaCache.set(routeName, result);\n\t\treturn result;\n\t}\n\n\t/**\n\t * Set runtime metadata for a route.\n\t *\n\t * Runtime metadata is merged on top of any manifest-declared metadata\n\t * when retrieved via {@link getRouteMeta}. When `inheritance` is\n\t * `\"pattern-tree\"`, descendant routes also see the updated values.\n\t * Invalidates the resolved-metadata cache. Non-object values are\n\t * ignored with a warning. Subject to the `unknownRouteRegistration` policy.\n\t *\n\t * @param routeName - Route name as defined in `manifest.json`.\n\t * @param meta - Plain object of metadata key-value pairs.\n\t * @returns `this` for chaining.\n\t * @since 1.6.0\n\t */\n\tsetRouteMeta(routeName: string, meta: Record<string, unknown>): this {\n\t\tif (!isRecord(meta)) {\n\t\t\tLog.warning(\"setRouteMeta: expected object, ignoring\", routeName, LOG_COMPONENT);\n\t\t\treturn this;\n\t\t}\n\t\tif (routeName !== \"\" && !this._handleUnknownRouteRegistration(routeName, \"setRouteMeta\")) {\n\t\t\treturn this;\n\t\t}\n\t\tthis._runtimeMeta.set(routeName, Object.freeze({ ...meta }));\n\t\tthis._resolvedMetaCache.clear();\n\t\treturn this;\n\t}\n\n\t/**\n\t * Return a Promise that settles when the current guard pipeline finishes.\n\t *\n\t * If a navigation is pending, the Promise resolves when that pipeline settles.\n\t * If no navigation is pending, it resolves immediately with the most recent\n\t * settlement result. Before any navigation has settled, it falls back to a\n\t * synthetic `Committed` result derived from the router's current route/hash\n\t * state. After `stop()`, that idle fallback reports empty route/hash values\n\t * until a new navigation settles.\n\t *\n\t * @returns Promise that resolves with a {@link NavigationResult} once the pipeline settles.\n\t * @since 1.2.0\n\t */\n\tnavigationSettled(): Promise<NavigationResult> {\n\t\tif (this._phase.kind !== \"evaluating\") {\n\t\t\treturn Promise.resolve(\n\t\t\t\tthis._lastSettlement ?? {\n\t\t\t\t\tstatus: NavigationOutcome.Committed,\n\t\t\t\t\troute: this._currentRoute,\n\t\t\t\t\thash: this._currentHash ?? \"\",\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\t\treturn new Promise((resolve) => {\n\t\t\tthis._settlementResolvers.push(resolve);\n\t\t});\n\t}\n\n\t/**\n\t * Attach an event handler for the `navigationSettled` event.\n\t *\n\t * Fires synchronously after every guard pipeline settlement with\n\t * a {@link NavigationResult} payload. Unlike the one-shot\n\t * `navigationSettled()` Promise, this event fires for every\n\t * navigation outcome without re-registration.\n\t *\n\t * @param oData - Application-specific payload passed to the handler as second argument.\n\t * @param fnFunction - The function to be called when the event occurs.\n\t * @param oListener - Context object to call the event handler with. Defaults to this Router.\n\t * @since 1.3.0\n\t */\n\tattachNavigationSettled(\n\t\toData: object,\n\t\tfnFunction: (evt: Router$NavigationSettledEvent) => void,\n\t\toListener?: object,\n\t): this;\n\tattachNavigationSettled(fnFunction: (evt: Router$NavigationSettledEvent) => void, oListener?: object): this;\n\tattachNavigationSettled(oData: unknown, fnFunction?: unknown, oListener?: unknown): this {\n\t\tthis.attachEvent(\n\t\t\t\"navigationSettled\",\n\t\t\toData as object,\n\t\t\tfnFunction as (...args: unknown[]) => void,\n\t\t\toListener as object,\n\t\t);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Detach a previously attached `navigationSettled` event handler.\n\t *\n\t * The passed parameters must match those used for registration with\n\t * {@link #attachNavigationSettled} beforehand.\n\t *\n\t * @param fnFunction - The handler function to detach.\n\t * @param oListener - Context object on which the given function had to be called.\n\t * @since 1.3.0\n\t */\n\tdetachNavigationSettled(fnFunction: (evt: Router$NavigationSettledEvent) => void, oListener?: object): this {\n\t\tthis.detachEvent(\"navigationSettled\", fnFunction as (...args: unknown[]) => void, oListener);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Drain all settlement resolvers with the given result and fire\n\t * the `navigationSettled` event.\n\t */\n\tprivate _flushSettlement(result: NavigationResult): void {\n\t\tthis._lastSettlement = result;\n\t\tconst resolvers = this._settlementResolvers;\n\t\tthis._settlementResolvers = [];\n\t\tfor (const resolve of resolvers) {\n\t\t\tresolve(result);\n\t\t}\n\t\tthis.fireEvent(\"navigationSettled\", result);\n\t}\n\n\t/**\n\t * Navigate to a route with preflight guard evaluation.\n\t *\n\t * For programmatic navigation, guards run BEFORE the hash changes.\n\t * This prevents history pollution: blocked navigations never push a\n\t * history entry, and redirected navigations go directly to the final\n\t * target.\n\t *\n\t * Same-hash navigations are deduped: if the target hash matches\n\t * `_currentHash`, any pending navigation is cancelled and the call\n\t * returns without navigating. If it matches the in-flight attempt's\n\t * hash, the in-flight preflight continues undisturbed.\n\t *\n\t * When all guards are synchronous, the decision and the resulting\n\t * hash change happen in the same tick. When any guard returns a\n\t * Promise, `navTo()` returns `this` immediately and defers the\n\t * hash change to when the guard resolves.\n\t *\n\t * Assumes `super.navTo()` calls `HashChanger.setHash()` which fires\n\t * `hashChanged` synchronously, causing `parse()` to re-enter in the\n\t * same call stack (validated by test).\n\t *\n\t * @override sap.ui.core.routing.Router#navTo\n\t * @since 1.0.1\n\t */\n\toverride navTo(\n\t\trouteName: string,\n\t\tparameters?: object,\n\t\tcomponentTargetInfo?: Record<string, ComponentTargetParameters>,\n\t\tbReplace?: boolean,\n\t): this;\n\toverride navTo(routeName: string, parameters?: object, bReplace?: boolean): this;\n\toverride navTo(routeName: string, parameters?: object, bReplace?: boolean, options?: GuardNavToOptions): this;\n\toverride navTo(\n\t\trouteName: string,\n\t\tparameters?: object,\n\t\tcomponentTargetInfo?: Record<string, ComponentTargetParameters>,\n\t\tbReplace?: boolean,\n\t\toptions?: GuardNavToOptions,\n\t): this;\n\toverride navTo(\n\t\trouteName: string,\n\t\tparameters?: object,\n\t\tcomponentTargetInfoOrReplace?: Record<string, ComponentTargetParameters> | boolean,\n\t\treplaceOrOptions?: boolean | GuardNavToOptions,\n\t\toptions?: GuardNavToOptions,\n\t): this {\n\t\tconst { componentTargetInfo, replace, guardOptions } = this._resolveNavToArgs(\n\t\t\tcomponentTargetInfoOrReplace,\n\t\t\treplaceOrOptions,\n\t\t\toptions,\n\t\t);\n\n\t\t// Redirect path: _redirect() calls this.navTo() while in committing/redirect phase.\n\t\t// Bypass preflight -- parse() will commit directly via the committing phase.\n\t\tif (this._phase.kind === \"committing\" && this._phase.origin === \"redirect\") {\n\t\t\tsuper.navTo(routeName, parameters, componentTargetInfo, replace);\n\t\t\treturn this;\n\t\t}\n\n\t\t// Resolve the target hash so we can build a guard context.\n\t\t// getURL() returns the hash pattern with parameters substituted.\n\t\tconst route = this.getRoute(routeName);\n\t\tif (!route) {\n\t\t\t// Unknown route -- let parent handle it (may fire bypassed event).\n\t\t\t// Cancel any pending async navigation so settlement resolvers drain\n\t\t\t// and the stale pipeline does not commit a superseded navigation.\n\t\t\tthis._cancelPendingNavigation();\n\t\t\tsuper.navTo(routeName, parameters, componentTargetInfo, replace);\n\t\t\treturn this;\n\t\t}\n\n\t\tconst targetHash = route.getURL(parameters ?? {});\n\t\tconst routeInfo = this.getRouteInfoByHash(targetHash);\n\t\tconst toRoute = routeInfo?.name ?? \"\";\n\n\t\t// Same-hash dedup: cancel any pending navigation and return without navigating.\n\t\tif (this._currentHash !== null && targetHash === this._currentHash) {\n\t\t\tthis._cancelPendingNavigation();\n\t\t\treturn this;\n\t\t}\n\n\t\t// Pending-hash dedup: if an async preflight for this exact hash is\n\t\t// already running, don't cancel and restart it.\n\t\tif (this._phase.kind === \"evaluating\" && targetHash === this._phase.attempt.hash) {\n\t\t\treturn this;\n\t\t}\n\n\t\t// Cancel any pending navigation (including previous async preflight).\n\t\tthis._cancelPendingNavigation();\n\n\t\tconst skipGuards = guardOptions?.skipGuards === true;\n\n\t\t// Bypass mode: skip guards for programmatic navTo() -- commit directly.\n\t\tif (skipGuards || this._options.navToPreflight === \"bypass\") {\n\t\t\tthis._phase = { kind: \"committing\", hash: targetHash, route: toRoute, origin: \"preflight\" };\n\t\t\tsuper.navTo(routeName, parameters, componentTargetInfo, replace);\n\t\t\t// Safety: if super.navTo didn't trigger parse (e.g. hash didn't change),\n\t\t\t// clear the marker to avoid stale state.\n\t\t\tif (this._phase.kind === \"committing\" && this._phase.hash === targetHash) {\n\t\t\t\tthis._commitNavigation(targetHash, toRoute);\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\n\t\t// Off mode: defer guard evaluation to parse() fallback.\n\t\tif (this._options.navToPreflight === \"off\") {\n\t\t\tsuper.navTo(routeName, parameters, componentTargetInfo, replace);\n\t\t\treturn this;\n\t\t}\n\n\t\t// Default \"guard\" mode: evaluate guards before hash change.\n\t\tconst controller = new AbortController();\n\t\tconst generation = this._parseGeneration;\n\n\t\tthis._phase = {\n\t\t\tkind: \"evaluating\",\n\t\t\tattempt: { hash: targetHash, route: toRoute, controller, generation },\n\t\t};\n\n\t\tconst context = this._createGuardContext(toRoute, targetHash, routeInfo, controller.signal);\n\n\t\tconst decision = this._pipeline.evaluate(context);\n\n\t\tif (isPromiseLike(decision)) {\n\t\t\tdecision\n\t\t\t\t.then((d: GuardDecision) => {\n\t\t\t\t\tif (generation !== this._parseGeneration || this._phase.kind !== \"evaluating\") {\n\t\t\t\t\t\tLog.debug(\n\t\t\t\t\t\t\t\"Async preflight result discarded (superseded by newer navigation)\",\n\t\t\t\t\t\t\ttargetHash,\n\t\t\t\t\t\t\tLOG_COMPONENT,\n\t\t\t\t\t\t);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tthis._applyPreflightDecision(\n\t\t\t\t\t\td,\n\t\t\t\t\t\trouteName,\n\t\t\t\t\t\tparameters,\n\t\t\t\t\t\tcomponentTargetInfo,\n\t\t\t\t\t\treplace,\n\t\t\t\t\t\ttargetHash,\n\t\t\t\t\t\ttoRoute,\n\t\t\t\t\t\tcontext.bag,\n\t\t\t\t\t);\n\t\t\t\t})\n\t\t\t\t.catch((error: unknown) => {\n\t\t\t\t\t// Only check generation here, not phase. If _redirect threw and its\n\t\t\t\t\t// finally already reset phase to idle, we still need to drain\n\t\t\t\t\t// settlement resolvers via _errorNavigation.\n\t\t\t\t\tif (generation !== this._parseGeneration) return;\n\t\t\t\t\tLog.error(\n\t\t\t\t\t\t`Async preflight guard failed for route \"${routeName}\", navigation failed`,\n\t\t\t\t\t\tString(error),\n\t\t\t\t\t\tLOG_COMPONENT,\n\t\t\t\t\t);\n\t\t\t\t\tthis._errorNavigation(error, targetHash, false);\n\t\t\t\t});\n\t\t\treturn this;\n\t\t}\n\n\t\t// Sync path: apply the decision immediately.\n\t\tthis._applyPreflightDecision(\n\t\t\tdecision,\n\t\t\trouteName,\n\t\t\tparameters,\n\t\t\tcomponentTargetInfo,\n\t\t\treplace,\n\t\t\ttargetHash,\n\t\t\ttoRoute,\n\t\t\tcontext.bag,\n\t\t);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Apply a preflight guard decision. For \"allow\", enter the committing\n\t * phase and call super.navTo(). For \"block\", flush settlement without\n\t * touching the hash. For \"redirect\", start a redirect chain.\n\t * For \"error\", flush Error settlement with the guard's error.\n\t *\n\t * @param decision - Normalized guard pipeline result.\n\t * @param routeName - Original route name passed to navTo().\n\t * @param parameters - Original route parameters.\n\t * @param componentTargetInfo - Optional component target info from the navTo() overload.\n\t * @param bReplace - Whether to replace the current history entry.\n\t * @param targetHash - Resolved hash for the target route.\n\t * @param toRoute - Resolved route name (may differ from routeName for nested routes).\n\t */\n\tprivate _applyPreflightDecision(\n\t\tdecision: GuardDecision,\n\t\trouteName: string,\n\t\tparameters: object | undefined,\n\t\tcomponentTargetInfo: Record<string, ComponentTargetParameters> | undefined,\n\t\tbReplace: boolean | undefined,\n\t\ttargetHash: string,\n\t\ttoRoute: string,\n\t\tbag: Map<string, unknown>,\n\t): void {\n\t\tswitch (decision.action) {\n\t\t\tcase \"allow\":\n\t\t\t\tthis._phase = { kind: \"committing\", hash: targetHash, route: toRoute, origin: \"preflight\" };\n\t\t\t\tsuper.navTo(routeName, parameters, componentTargetInfo, bReplace);\n\t\t\t\t// Safety: if super.navTo didn't trigger parse (e.g. hash didn't change),\n\t\t\t\t// clear the marker to avoid stale state.\n\t\t\t\tif (this._phase.kind === \"committing\" && this._phase.hash === targetHash) {\n\t\t\t\t\t// Hash didn't change, so parse() wasn't called. Commit manually.\n\t\t\t\t\tthis._commitNavigation(targetHash, toRoute);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"block\":\n\t\t\t\tthis._blockNavigation(targetHash, false);\n\t\t\t\tbreak;\n\t\t\tcase \"redirect\":\n\t\t\t\tthis._startRedirectChain(decision.target, targetHash, false, bag);\n\t\t\t\tbreak;\n\t\t\tcase \"error\":\n\t\t\t\tthis._errorNavigation(decision.error, targetHash, false);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t/**\n\t * Intercept hash changes and run the guard pipeline before route matching.\n\t *\n\t * Called by the HashChanger on every `hashChanged` event. Runs leave guards\n\t * (current route), then global + route-specific enter guards (target route).\n\t * Stays synchronous when all guards return plain values; falls back to async\n\t * when a guard returns a Promise. A generation counter discards stale results\n\t * when navigations overlap.\n\t *\n\t * @param newHash - The new hash fragment from the URL.\n\t * @override sap.ui.core.routing.Router#parse\n\t * @since 1.0.1\n\t */\n\toverride parse(newHash: string): void {\n\t\tif (this._suppressedHash !== null) {\n\t\t\tif (newHash === this._suppressedHash) {\n\t\t\t\tthis._suppressedHash = null;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._suppressedHash = null;\n\t\t}\n\n\t\tif (this._phase.kind === \"committing\") {\n\t\t\tthis._commitNavigation(\n\t\t\t\tnewHash,\n\t\t\t\tthis._phase.route !== \"\" ? this._phase.route : (this.getRouteInfoByHash(newHash)?.name ?? \"\"),\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._currentHash !== null && newHash === this._currentHash) {\n\t\t\tthis._cancelPendingNavigation();\n\t\t\treturn;\n\t\t}\n\n\t\tconst routeInfo = this.getRouteInfoByHash(newHash);\n\t\tconst toRoute = routeInfo?.name ?? \"\";\n\n\t\tthis._cancelPendingNavigation();\n\n\t\tconst controller = new AbortController();\n\t\tconst generation = this._parseGeneration;\n\n\t\tthis._phase = {\n\t\t\tkind: \"evaluating\",\n\t\t\tattempt: { hash: newHash, route: toRoute, controller, generation },\n\t\t};\n\n\t\tconst context = this._createGuardContext(toRoute, newHash, routeInfo, controller.signal);\n\n\t\tconst decision = this._pipeline.evaluate(context);\n\n\t\tif (isPromiseLike(decision)) {\n\t\t\tdecision\n\t\t\t\t.then((d: GuardDecision) => {\n\t\t\t\t\tif (generation !== this._parseGeneration || this._phase.kind !== \"evaluating\") {\n\t\t\t\t\t\tLog.debug(\n\t\t\t\t\t\t\t\"Async guard result discarded (superseded by newer navigation)\",\n\t\t\t\t\t\t\tnewHash,\n\t\t\t\t\t\t\tLOG_COMPONENT,\n\t\t\t\t\t\t);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tthis._applyDecision(d, newHash, toRoute, context.bag);\n\t\t\t\t})\n\t\t\t\t.catch((error: unknown) => {\n\t\t\t\t\t// Only check generation here, not phase. If _redirect threw and its\n\t\t\t\t\t// finally already reset phase to idle, we still need to drain\n\t\t\t\t\t// settlement resolvers via _errorNavigation.\n\t\t\t\t\tif (generation !== this._parseGeneration) return;\n\t\t\t\t\tLog.error(\n\t\t\t\t\t\t`Guard pipeline failed for \"${newHash}\", navigation failed`,\n\t\t\t\t\t\tString(error),\n\t\t\t\t\t\tLOG_COMPONENT,\n\t\t\t\t\t);\n\t\t\t\t\tthis._errorNavigation(error, newHash);\n\t\t\t\t});\n\t\t\treturn;\n\t\t}\n\n\t\tthis._applyDecision(decision, newHash, toRoute, context.bag);\n\t}\n\n\t/**\n\t * Stop listening to hash changes and reset guard state.\n\t *\n\t * Resets `_currentRoute` and `_currentHash` so that a subsequent\n\t * `initialize()` re-parses the current hash and fires `routeMatched`,\n\t * matching the native `sap.m.routing.Router` behavior.\n\t *\n\t * @override sap.ui.core.routing.Router#stop\n\t * @since 1.0.1\n\t */\n\toverride stop(): this {\n\t\t// Cancel first so in-flight navigationSettled() resolvers receive the\n\t\t// Cancelled result before _lastSettlement is cleared below.\n\t\tthis._cancelPendingNavigation();\n\t\tthis._suppressedHash = null;\n\t\tthis._currentRoute = \"\";\n\t\tthis._currentHash = null;\n\t\tthis._lastSettlement = null;\n\t\tsuper.stop();\n\t\treturn this;\n\t}\n\n\t/**\n\t * Invalidate any in-flight async guard work. Bumps the generation counter\n\t * so pending `.then()` callbacks see they are stale, aborts the signal,\n\t * and transitions to idle.\n\t */\n\tprivate _cancelPendingNavigation(): void {\n\t\t++this._parseGeneration;\n\t\tif (this._phase.kind === \"evaluating\") {\n\t\t\tthis._phase.attempt.controller.abort();\n\t\t\tthis._flushSettlement({\n\t\t\t\tstatus: NavigationOutcome.Cancelled,\n\t\t\t\troute: this._currentRoute,\n\t\t\t\thash: this._currentHash ?? \"\",\n\t\t\t});\n\t\t}\n\t\tthis._phase = IDLE;\n\t}\n\n\t/**\n\t * Apply a guard decision for the parse() fallback path.\n\t */\n\tprivate _applyDecision(decision: GuardDecision, hash: string, route: string, bag: Map<string, unknown>): void {\n\t\tswitch (decision.action) {\n\t\t\tcase \"allow\":\n\t\t\t\tthis._phase = { kind: \"committing\", hash, route, origin: \"parse\" };\n\t\t\t\tthis._commitNavigation(hash, route);\n\t\t\t\tbreak;\n\t\t\tcase \"block\":\n\t\t\t\tthis._blockNavigation(hash);\n\t\t\t\tbreak;\n\t\t\tcase \"redirect\":\n\t\t\t\tthis._startRedirectChain(decision.target, hash, true, bag);\n\t\t\t\tbreak;\n\t\t\tcase \"error\":\n\t\t\t\tthis._errorNavigation(decision.error, hash);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t/**\n\t * Delegate to the parent router and update internal state.\n\t *\n\t * State is updated BEFORE calling parse to ensure that if event handlers\n\t * (e.g., routeMatched) trigger nested navigation, the leave guards will\n\t * run for the correct (new) route rather than the old one.\n\t */\n\tprivate _commitNavigation(hash: string, route?: string): void {\n\t\tconst wasRedirect = this._phase.kind === \"committing\" && this._phase.origin === \"redirect\";\n\t\tthis._currentHash = hash;\n\t\tthis._currentRoute = route ?? this.getRouteInfoByHash(hash)?.name ?? \"\";\n\t\t// Transition to idle before super.parse so that routeMatched/patternMatched\n\t\t// handlers that call navTo() go through the full guard pipeline.\n\t\tthis._phase = IDLE;\n\t\tthis._flushSettlement({\n\t\t\tstatus: wasRedirect\n\t\t\t\t? NavigationOutcome.Redirected\n\t\t\t\t: this._currentRoute === \"\"\n\t\t\t\t\t? NavigationOutcome.Bypassed\n\t\t\t\t\t: NavigationOutcome.Committed,\n\t\t\troute: this._currentRoute,\n\t\t\thash,\n\t\t});\n\t\tsuper.parse(hash);\n\t}\n\n\t/**\n\t * Evaluate guards on a redirect target and apply the resulting decision.\n\t *\n\t * Handles loop detection (visited-hash set + depth cap), unknown-route\n\t * fallback, sync/async guard evaluation, and recursive chaining when\n\t * the target's guard itself returns a redirect. All hops in a chain\n\t * share the same AbortSignal and generation counter from the original\n\t * navigation so that a superseding navigation correctly discards\n\t * in-flight redirect work.\n\t *\n\t * @param target - Redirect target: a route name string or {@link GuardRedirect} with parameters.\n\t * @param chain - Mutable context threaded through the redirect chain (visited set, signals, etc.).\n\t */\n\tprivate _redirect(target: string | GuardRedirect, chain: RedirectChainContext): void {\n\t\tconst targetName = typeof target === \"string\" ? target : target.route;\n\t\tlet targetHash: string | null = null;\n\t\tconst targetParameters = typeof target === \"string\" ? {} : (target.parameters ?? {});\n\t\tconst targetRoute = this.getRoute(targetName);\n\t\tif (targetRoute) {\n\t\t\ttry {\n\t\t\t\ttargetHash = targetRoute.getURL(targetParameters);\n\t\t\t} catch {\n\t\t\t\ttargetHash = null;\n\t\t\t}\n\t\t}\n\n\t\t// Loop detection: visited set (exact hash match) + depth cap.\n\t\tif (targetHash !== null && chain.visited.has(targetHash)) {\n\t\t\tLog.error(\n\t\t\t\t`Guard redirect loop detected: ${[...chain.visited, targetHash].join(\" -> \")}`,\n\t\t\t\tundefined,\n\t\t\t\tLOG_COMPONENT,\n\t\t\t);\n\t\t\tthis._blockNavigation(chain.attemptedHash, chain.restoreHash);\n\t\t\treturn;\n\t\t}\n\t\tif (chain.visited.size > MAX_REDIRECT_DEPTH) {\n\t\t\tLog.error(\n\t\t\t\t`Guard redirect chain exceeded maximum depth (${MAX_REDIRECT_DEPTH}): ${[...chain.visited].join(\" -> \")}`,\n\t\t\t\tundefined,\n\t\t\t\tLOG_COMPONENT,\n\t\t\t);\n\t\t\tthis._blockNavigation(chain.attemptedHash, chain.restoreHash);\n\t\t\treturn;\n\t\t}\n\t\tif (targetHash !== null) {\n\t\t\tchain.visited.add(targetHash);\n\t\t}\n\n\t\t// If the target route doesn't exist or the hash couldn't be resolved,\n\t\t// attempt navTo (parent may fire bypassed) and fall back to blocked.\n\t\tif (targetHash === null) {\n\t\t\tconst settlementBefore = this._lastSettlement;\n\t\t\tthis._phase = { kind: \"committing\", hash: \"\", route: targetName, origin: \"redirect\" };\n\t\t\ttry {\n\t\t\t\tif (typeof target === \"string\") {\n\t\t\t\t\tthis.navTo(target, {}, {}, true);\n\t\t\t\t} else {\n\t\t\t\t\tthis.navTo(target.route, target.parameters ?? {}, target.componentTargetInfo, true);\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tif (this._phase.kind === \"committing\") {\n\t\t\t\t\tthis._phase = IDLE;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (this._lastSettlement === settlementBefore) {\n\t\t\t\tLog.warning(\n\t\t\t\t\t`Guard redirect target \"${targetName}\" did not produce a navigation, treating as blocked`,\n\t\t\t\t\tundefined,\n\t\t\t\t\tLOG_COMPONENT,\n\t\t\t\t);\n\t\t\t\tthis._blockNavigation(chain.attemptedHash, chain.restoreHash);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// Narrowed after the null-branch early return; const carries it into the async closure.\n\t\tconst resolvedHash: string = targetHash;\n\n\t\t// Build guard context for the redirect target.\n\t\tconst routeInfo = this.getRouteInfoByHash(resolvedHash);\n\t\tconst context: GuardContext = {\n\t\t\ttoRoute: routeInfo?.name ?? \"\",\n\t\t\ttoHash: resolvedHash,\n\t\t\ttoArguments: routeInfo?.arguments ?? {},\n\t\t\tfromRoute: chain.fromRoute,\n\t\t\tfromHash: chain.fromHash,\n\t\t\tsignal: chain.signal,\n\t\t\tbag: chain.bag,\n\t\t\ttoMeta: this.getRouteMeta(routeInfo?.name ?? \"\"),\n\t\t\tfromMeta: this.getRouteMeta(chain.fromRoute),\n\t\t};\n\n\t\tconst decision = this._pipeline.evaluate(context, { skipLeaveGuards: true });\n\n\t\tif (isPromiseLike(decision)) {\n\t\t\tdecision\n\t\t\t\t.then((d: GuardDecision) => {\n\t\t\t\t\tif (chain.generation !== this._parseGeneration) return;\n\t\t\t\t\tthis._applyRedirectDecision(d, target, resolvedHash, chain);\n\t\t\t\t})\n\t\t\t\t.catch((error: unknown) => {\n\t\t\t\t\tif (chain.generation !== this._parseGeneration) return;\n\t\t\t\t\tLog.error(\n\t\t\t\t\t\t`Guard pipeline failed during redirect chain for \"${targetName}\", navigation failed`,\n\t\t\t\t\t\tString(error),\n\t\t\t\t\t\tLOG_COMPONENT,\n\t\t\t\t\t);\n\t\t\t\t\tthis._errorNavigation(error, chain.attemptedHash, chain.restoreHash);\n\t\t\t\t});\n\t\t\treturn;\n\t\t}\n\n\t\tthis._applyRedirectDecision(decision, target, resolvedHash, chain);\n\t}\n\n\t/**\n\t * Apply a guard decision within a redirect chain. For \"allow\", enter\n\t * committing phase and delegate to navTo (which hits the existing bypass).\n\t * For \"block\", block the entire chain. For \"redirect\", recurse.\n\t *\n\t * @param decision - Normalized guard pipeline result for this hop.\n\t * @param target - The redirect target (route name or {@link GuardRedirect}).\n\t * @param targetHash - Resolved hash for the redirect target (guaranteed non-null).\n\t * @param chain - Shared redirect chain context with visited set, signals, etc.\n\t */\n\tprivate _applyRedirectDecision(\n\t\tdecision: GuardDecision,\n\t\ttarget: string | GuardRedirect,\n\t\ttargetHash: string,\n\t\tchain: RedirectChainContext,\n\t): void {\n\t\tswitch (decision.action) {\n\t\t\tcase \"allow\": {\n\t\t\t\tconst targetName = typeof target === \"string\" ? target : target.route;\n\t\t\t\tconst settlementBefore = this._lastSettlement;\n\t\t\t\tthis._phase = { kind: \"committing\", hash: targetHash, route: targetName, origin: \"redirect\" };\n\t\t\t\ttry {\n\t\t\t\t\tif (typeof target === \"string\") {\n\t\t\t\t\t\tthis.navTo(target, {}, {}, true);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.navTo(target.route, target.parameters ?? {}, target.componentTargetInfo, true);\n\t\t\t\t\t}\n\t\t\t\t} finally {\n\t\t\t\t\tif (this._phase.kind === \"committing\") {\n\t\t\t\t\t\tthis._phase = IDLE;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Safety net: if navTo didn't produce a settlement (e.g. unknown route\n\t\t\t\t// or redirect to current hash where HashChanger doesn't fire), handle it.\n\t\t\t\tif (this._lastSettlement === settlementBefore) {\n\t\t\t\t\tconst redirectsToCurrentHash = targetHash === (this._currentHash ?? \"\");\n\t\t\t\t\tif (redirectsToCurrentHash) {\n\t\t\t\t\t\tthis._phase = {\n\t\t\t\t\t\t\tkind: \"committing\",\n\t\t\t\t\t\t\thash: this._currentHash ?? \"\",\n\t\t\t\t\t\t\troute: this._currentRoute,\n\t\t\t\t\t\t\torigin: \"redirect\",\n\t\t\t\t\t\t};\n\t\t\t\t\t\tthis._commitNavigation(this._currentHash ?? \"\", this._currentRoute);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tLog.warning(\n\t\t\t\t\t\t`Guard redirect target \"${targetName}\" did not produce a navigation, treating as blocked`,\n\t\t\t\t\t\tundefined,\n\t\t\t\t\t\tLOG_COMPONENT,\n\t\t\t\t\t);\n\t\t\t\t\tthis._blockNavigation(chain.attemptedHash, chain.restoreHash);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"block\":\n\t\t\t\tthis._blockNavigation(chain.attemptedHash, chain.restoreHash);\n\t\t\t\tbreak;\n\t\t\tcase \"redirect\":\n\t\t\t\tthis._redirect(decision.target, chain);\n\t\t\t\tbreak;\n\t\t\tcase \"error\":\n\t\t\t\tthis._errorNavigation(decision.error, chain.attemptedHash, chain.restoreHash);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t/**\n\t * Build a guard context for a new navigation.\n\t * Called by {@link navTo} (preflight path) and {@link parse} (browser-initiated path).\n\t */\n\tprivate _createGuardContext(\n\t\ttoRoute: string,\n\t\ttoHash: string,\n\t\trouteInfo: { arguments: Record<string, string | Record<string, string>> } | undefined,\n\t\tsignal: AbortSignal,\n\t): GuardContext {\n\t\treturn {\n\t\t\ttoRoute,\n\t\t\ttoHash,\n\t\t\ttoArguments: routeInfo?.arguments ?? {},\n\t\t\tfromRoute: this._currentRoute,\n\t\t\tfromHash: this._currentHash ?? \"\",\n\t\t\tsignal,\n\t\t\tbag: new Map(),\n\t\t\ttoMeta: this.getRouteMeta(toRoute),\n\t\t\tfromMeta: this.getRouteMeta(this._currentRoute),\n\t\t};\n\t}\n\n\t/**\n\t * Start a new redirect chain from the current evaluating phase.\n\t * Called by {@link _applyPreflightDecision} and {@link _applyDecision}\n\t * when a guard returns a redirect. Delegates to {@link _redirect} with\n\t * a fresh {@link RedirectChainContext}.\n\t */\n\tprivate _startRedirectChain(\n\t\ttarget: string | GuardRedirect,\n\t\thash: string,\n\t\trestoreHash: boolean,\n\t\tbag: Map<string, unknown>,\n\t): void {\n\t\tconst { attempt } = this._phase as PhaseEvaluating;\n\t\tconst visited = new Set<string>();\n\t\tvisited.add(hash);\n\t\tthis._redirect(target, {\n\t\t\tvisited,\n\t\t\tattemptedHash: hash,\n\t\t\trestoreHash,\n\t\t\tfromRoute: this._currentRoute,\n\t\t\tfromHash: this._currentHash ?? \"\",\n\t\t\tsignal: attempt.controller.signal,\n\t\t\tgeneration: attempt.generation,\n\t\t\tbag,\n\t\t});\n\t}\n\n\t/**\n\t * Clear pending state and flush a Blocked settlement.\n\t * When `restoreHash` is true (default), also restores the browser hash\n\t * to `_currentHash`. Preflight callers pass false because the hash was\n\t * never changed.\n\t */\n\tprivate _blockNavigation(attemptedHash?: string, restoreHash = true): void {\n\t\tthis._phase = IDLE;\n\t\tthis._flushSettlement({\n\t\t\tstatus: NavigationOutcome.Blocked,\n\t\t\troute: this._currentRoute,\n\t\t\thash: this._currentHash ?? \"\",\n\t\t});\n\t\tthis._restoreHashIfNeeded(attemptedHash, restoreHash);\n\t}\n\n\t/**\n\t * Clear pending state and flush an Error settlement.\n\t * Same structure as {@link _blockNavigation} but with `NavigationOutcome.Error`\n\t * and the error that caused the failure.\n\t */\n\tprivate _errorNavigation(error: unknown, attemptedHash?: string, restoreHash = true): void {\n\t\tthis._phase = IDLE;\n\t\tthis._flushSettlement({\n\t\t\tstatus: NavigationOutcome.Error,\n\t\t\troute: this._currentRoute,\n\t\t\thash: this._currentHash ?? \"\",\n\t\t\terror,\n\t\t});\n\t\tthis._restoreHashIfNeeded(attemptedHash, restoreHash);\n\t}\n\n\t/** Conditionally restore the browser hash after a blocked or errored navigation. */\n\tprivate _restoreHashIfNeeded(attemptedHash: string | undefined, restoreHash: boolean): void {\n\t\tif (!restoreHash) return;\n\t\tif (this._currentHash === null && attemptedHash && attemptedHash !== \"\") {\n\t\t\tthis._restoreHash(\"\", false);\n\t\t\treturn;\n\t\t}\n\t\tthis._restoreHash(this._currentHash ?? \"\");\n\t}\n\n\t/**\n\t * Restore the previous hash without creating a history entry.\n\t * Assumes replaceHash fires hashChanged synchronously (validated by test).\n\t * `_currentRoute` stays unchanged because the navigation never\n\t * committed. The user remains on the same logical route.\n\t */\n\tprivate _restoreHash(hash: string, suppressParse = true): void {\n\t\tconst hashChanger = this.getHashChanger();\n\t\tif (hashChanger) {\n\t\t\tthis._suppressedHash = suppressParse ? hash : null;\n\t\t\thashChanger.replaceHash(hash, HistoryDirection.Unknown);\n\t\t\tif (this._suppressedHash === hash) {\n\t\t\t\tthis._suppressedHash = null;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Collect all route names and their patterns from the router.\n\t * Skips routes whose pattern is undefined (no pattern configured).\n\t */\n\tprivate _collectRoutePatterns(): { name: string; pattern: string }[] {\n\t\tconst result: { name: string; pattern: string }[] = [];\n\t\tfor (const name of this._routeNames) {\n\t\t\tconst route = this.getRoute(name);\n\t\t\tif (route) {\n\t\t\t\tconst pattern = route.getPattern();\n\t\t\t\tif (pattern !== undefined) {\n\t\t\t\t\tresult.push({ name, pattern });\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\t/**\n\t * Expand guard descriptors to descendant routes when guard inheritance\n\t * is set to `\"pattern-tree\"`. Global (`\"*\"`) descriptors are kept as-is.\n\t * Descriptors are sorted by pattern depth (ancestor guards run before\n\t * descendant guards).\n\t */\n\tprivate _expandGuardDescriptors(descriptors: GuardDescriptor[]): GuardDescriptor[] {\n\t\tconst allRoutes = this._collectRoutePatterns();\n\t\tif (allRoutes.length === 0) return descriptors;\n\n\t\t// Build a name -> pattern map for quick lookup\n\t\tconst patternByName = new Map(allRoutes.map((r) => [r.name, r.pattern]));\n\n\t\tconst expanded: GuardDescriptor[] = [];\n\n\t\tfor (const descriptor of descriptors) {\n\t\t\texpanded.push(descriptor);\n\n\t\t\t// Global guards and routes without a known pattern are not expanded\n\t\t\tif (descriptor.route === \"*\") continue;\n\t\t\tconst ancestorPattern = patternByName.get(descriptor.route);\n\t\t\tif (ancestorPattern === undefined) continue;\n\n\t\t\t// Find descendant routes whose pattern extends the ancestor's pattern\n\t\t\tfor (const { name, pattern } of allRoutes) {\n\t\t\t\tif (name === descriptor.route) continue;\n\t\t\t\tif (isPatternAncestor(ancestorPattern, pattern)) {\n\t\t\t\t\texpanded.push({ ...descriptor, route: name });\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Sort by pattern depth (segment count) so ancestor guards run first.\n\t\t// Global (\"*\") descriptors return 0 here -- their relative position is irrelevant\n\t\t// because GuardPipeline evaluates globals separately from route-specific guards.\n\t\treturn expanded.toSorted((a, b) => {\n\t\t\tif (a.route === \"*\" || b.route === \"*\") return 0;\n\t\t\tconst pa = patternByName.get(a.route) ?? \"\";\n\t\t\tconst pb = patternByName.get(b.route) ?? \"\";\n\t\t\treturn patternSegments(pa).length - patternSegments(pb).length;\n\t\t});\n\t}\n\n\t/**\n\t * Resolve metadata for a route without inheritance (flat merge of\n\t * manifest and runtime metadata).\n\t */\n\tprivate _resolveFlatMeta(routeName: string): Readonly<Record<string, unknown>> {\n\t\tconst manifest = this._manifestMeta.get(routeName);\n\t\tconst runtime = this._runtimeMeta.get(routeName);\n\t\tif (!manifest && !runtime) return Router._EMPTY_META;\n\t\tif (!runtime) return manifest!;\n\t\tif (!manifest) return runtime;\n\t\treturn Object.freeze({ ...manifest, ...runtime });\n\t}\n\n\t/**\n\t * Resolve metadata for a route with pattern-tree inheritance.\n\t * Walks ancestor patterns shallowest-first, merging manifest and\n\t * runtime metadata at each level, then overlays the route's own.\n\t */\n\tprivate _resolveInheritedMeta(routeName: string): Readonly<Record<string, unknown>> {\n\t\tconst allRoutes = this._collectRoutePatterns();\n\t\tconst routeEntry = allRoutes.find((r) => r.name === routeName);\n\t\tif (!routeEntry) return this._resolveFlatMeta(routeName);\n\n\t\t// Find ancestors that have declared metadata (manifest or runtime)\n\t\tconst ancestors = allRoutes.filter(\n\t\t\t(r) =>\n\t\t\t\tr.name !== routeName &&\n\t\t\t\t(this._manifestMeta.has(r.name) || this._runtimeMeta.has(r.name)) &&\n\t\t\t\tisPatternAncestor(r.pattern, routeEntry.pattern),\n\t\t);\n\t\t// oxlint-disable-next-line unicorn/no-array-sort -- ancestors is a fresh array from filter()\n\t\tancestors.sort((a, b) => patternSegments(a.pattern).length - patternSegments(b.pattern).length);\n\n\t\t// Merge shallowest-first: root ancestor -> deeper ancestors -> own manifest -> own runtime\n\t\tconst merged: Record<string, unknown> = {};\n\n\t\tfor (const ancestor of ancestors) {\n\t\t\tconst ancestorManifest = this._manifestMeta.get(ancestor.name);\n\t\t\tif (ancestorManifest) Object.assign(merged, ancestorManifest);\n\t\t\tconst ancestorRuntime = this._runtimeMeta.get(ancestor.name);\n\t\t\tif (ancestorRuntime) Object.assign(merged, ancestorRuntime);\n\t\t}\n\n\t\tconst ownManifest = this._manifestMeta.get(routeName);\n\t\tif (ownManifest) Object.assign(merged, ownManifest);\n\t\tconst ownRuntime = this._runtimeMeta.get(routeName);\n\t\tif (ownRuntime) Object.assign(merged, ownRuntime);\n\n\t\tif (Object.keys(merged).length === 0) return Router._EMPTY_META;\n\t\treturn Object.freeze(merged);\n\t}\n\n\t/**\n\t * Load guard modules individually via `sap.ui.require` and register\n\t * each resolved function with the appropriate guard API.\n\t *\n\t * Each module is loaded in its own `sap.ui.require` call so that a\n\t * single invalid path only skips that guard (with a warning) rather\n\t * than failing the entire batch. Once all loads settle, guards\n\t * register in declaration order. Registration errors (e.g. from\n\t * `unknownRouteRegistration: \"throw\"`) are caught per-module.\n\t */\n\tprivate _loadAndRegisterGuards(descriptors: GuardDescriptor[]): Promise<void> {\n\t\tconst promises = descriptors.map((descriptor) => {\n\t\t\treturn new Promise<{ descriptor: GuardDescriptor; moduleExport: unknown }>((resolve) => {\n\t\t\t\tsap.ui.require(\n\t\t\t\t\t[descriptor.modulePath],\n\t\t\t\t\t(moduleExport: unknown) => {\n\t\t\t\t\t\tresolve({ descriptor, moduleExport });\n\t\t\t\t\t},\n\t\t\t\t\t(err: Error) => {\n\t\t\t\t\t\tLog.warning(\n\t\t\t\t\t\t\t`guardRouter.guards: failed to load module \"${descriptor.modulePath}\", skipping`,\n\t\t\t\t\t\t\tString(err),\n\t\t\t\t\t\t\tLOG_COMPONENT,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tresolve({ descriptor, moduleExport: null });\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t});\n\t\t});\n\t\treturn Promise.all(promises).then((results) => {\n\t\t\tfor (const { descriptor, moduleExport } of results) {\n\t\t\t\tif (moduleExport === null) continue;\n\t\t\t\tconst exports = resolveModuleExports(\n\t\t\t\t\tmoduleExport,\n\t\t\t\t\tdescriptor.modulePath,\n\t\t\t\t\tdescriptor.name,\n\t\t\t\t\tdescriptor.exportKey,\n\t\t\t\t);\n\t\t\t\tfor (const { fn } of exports) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tthis._registerGuardFromDescriptor(descriptor, fn);\n\t\t\t\t\t} catch (err: unknown) {\n\t\t\t\t\t\tLog.error(\n\t\t\t\t\t\t\t`guardRouter.guards: failed to register \"${descriptor.modulePath}\"`,\n\t\t\t\t\t\t\tString(err),\n\t\t\t\t\t\t\tLOG_COMPONENT,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Route a parsed guard descriptor to the correct registration method.\n\t */\n\tprivate _registerGuardFromDescriptor(descriptor: GuardDescriptor, guardFn: GuardFn): void {\n\t\tif (descriptor.route === \"*\") {\n\t\t\tthis.addGuard(guardFn);\n\t\t} else if (descriptor.type === \"leave\") {\n\t\t\tif (!this._handleUnknownRouteRegistration(descriptor.route, \"addLeaveGuard\")) return;\n\t\t\tthis._pipeline.addLeaveGuard(descriptor.route, guardFn);\n\t\t} else {\n\t\t\tthis.addRouteGuard(descriptor.route, guardFn);\n\t\t}\n\t}\n\n\t/**\n\t * Register lazy wrapper functions that load guard modules on first use.\n\t *\n\t * Cherry-picked descriptors (with exportKey) get one lazy wrapper each.\n\t * Bare-path descriptors try a sync cache probe first; if the module is\n\t * cached (preload likely finished), all guards are expanded immediately.\n\t * On cache miss, a single \"expander\" wrapper loads the module on first\n\t * navigation, registers remaining guards, and executes the first.\n\t */\n\tprivate _registerLazyGuards(descriptors: GuardDescriptor[]): void {\n\t\tfor (const descriptor of descriptors) {\n\t\t\tconst { modulePath, exportKey, name } = descriptor;\n\n\t\t\tif (exportKey !== undefined) {\n\t\t\t\t// Cherry-picked: one lazy wrapper, resolves to exactly one guard\n\t\t\t\tconst lazyGuard = (context: GuardContext): GuardResult | PromiseLike<GuardResult> => {\n\t\t\t\t\tconst cached = sap.ui.require(modulePath) as unknown;\n\t\t\t\t\tif (cached !== undefined) {\n\t\t\t\t\t\tconst exports = resolveModuleExports(cached, modulePath, name, exportKey);\n\t\t\t\t\t\tif (exports.length === 0) return true;\n\t\t\t\t\t\treturn exports[0].fn(context);\n\t\t\t\t\t}\n\t\t\t\t\treturn new Promise<GuardResult>((resolve, reject) => {\n\t\t\t\t\t\tsap.ui.require(\n\t\t\t\t\t\t\t[modulePath],\n\t\t\t\t\t\t\t(mod: unknown) => {\n\t\t\t\t\t\t\t\tconst exports = resolveModuleExports(mod, modulePath, name, exportKey);\n\t\t\t\t\t\t\t\tif (exports.length === 0) {\n\t\t\t\t\t\t\t\t\tresolve(true);\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tresolve(exports[0].fn(context));\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t(err: Error) => {\n\t\t\t\t\t\t\t\tLog.warning(\n\t\t\t\t\t\t\t\t\t`guardRouter.guards: lazy load of \"${modulePath}\" failed`,\n\t\t\t\t\t\t\t\t\tString(err),\n\t\t\t\t\t\t\t\t\tLOG_COMPONENT,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\treject(err);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t);\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t\tthis._registerGuardFromDescriptor(descriptor, lazyGuard);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Bare-path: try sync expansion from cache (preload likely finished)\n\t\t\tconst cached = sap.ui.require(modulePath) as unknown;\n\t\t\tif (cached !== undefined) {\n\t\t\t\tconst exports = resolveModuleExports(cached, modulePath, name);\n\t\t\t\tfor (const exp of exports) {\n\t\t\t\t\tthis._registerGuardFromDescriptor(descriptor, exp.fn);\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Cache miss: register an expander that loads, expands once, and runs guard[0].\n\t\t\t// NOTE: Guards 1..N are appended to the guard array on first invocation,\n\t\t\t// which means they execute AFTER any imperative guards registered between\n\t\t\t// initialize() and first navigation. This differs from block mode where\n\t\t\t// all guards occupy contiguous positions. In practice this is rare because\n\t\t\t// the preload hint fires in the constructor and modules are typically cached\n\t\t\t// by the time initialize() runs.\n\t\t\tlet expanded = false;\n\t\t\tconst lazyExpander = (context: GuardContext): PromiseLike<GuardResult> => {\n\t\t\t\treturn new Promise<GuardResult>((resolve, reject) => {\n\t\t\t\t\tsap.ui.require(\n\t\t\t\t\t\t[modulePath],\n\t\t\t\t\t\t(mod: unknown) => {\n\t\t\t\t\t\t\tconst exports = resolveModuleExports(mod, modulePath, name);\n\t\t\t\t\t\t\tif (exports.length === 0) {\n\t\t\t\t\t\t\t\tresolve(true);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!expanded) {\n\t\t\t\t\t\t\t\texpanded = true;\n\t\t\t\t\t\t\t\tfor (let i = 1; i < exports.length; i++) {\n\t\t\t\t\t\t\t\t\tthis._registerGuardFromDescriptor(descriptor, exports[i].fn);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tresolve(exports[0].fn(context));\n\t\t\t\t\t\t},\n\t\t\t\t\t\t(err: Error) => {\n\t\t\t\t\t\t\tLog.warning(\n\t\t\t\t\t\t\t\t`guardRouter.guards: lazy load of \"${modulePath}\" failed`,\n\t\t\t\t\t\t\t\tString(err),\n\t\t\t\t\t\t\t\tLOG_COMPONENT,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\treject(err);\n\t\t\t\t\t\t},\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t\t};\n\t\t\tthis._registerGuardFromDescriptor(descriptor, lazyExpander);\n\t\t}\n\t}\n\n\t/**\n\t * Clean up guards on destroy. Bumps generation to discard pending async results.\n\t *\n\t * @since 1.0.1\n\t */\n\toverride destroy(): this {\n\t\tthis._destroyed = true;\n\t\tthis._pipeline.clear();\n\t\tthis._pendingGuardDescriptors = [];\n\t\tthis._sourceDescriptors = [];\n\t\tthis._cancelPendingNavigation();\n\t\tthis._suppressedHash = null;\n\t\tthis._lastSettlement = null;\n\t\tthis._manifestMeta.clear();\n\t\tthis._runtimeMeta.clear();\n\t\tthis._resolvedMetaCache.clear();\n\t\tsuper.destroy();\n\t\treturn this;\n\t}\n}\n"],"mappings":"AAAA,0QAsBOA,EAAiBC,EAAAC,GAAA,MACjBC,EAAaF,EAAAG,GAAA,MAAwBC,EAAaD,EAAA,iBAEzD,MAAME,EAAmBC,EAAYC,QAAQF,iBAE7C,MAAMG,EAAgB,0BAEtB,SAASC,EAAmBC,GAC3B,cAAcA,IAAU,UAAYA,IAAU,IAC/C,CA4BA,MAAMC,EAAkB,CAAEC,KAAM,QAGhC,SAASC,EAASC,GACjB,UAAWA,IAAU,UAAYA,IAAU,MAAQC,MAAMC,QAAQF,GAAQ,OAAO,MAChF,MAAMG,EAAQC,OAAOC,eAAeL,GACpC,OAAOG,IAAUC,OAAOE,WAAaH,IAAU,IAChD,CAGA,SAASI,KAA6BC,GACrC,MAAMC,EAA2B,IAAIC,IAAIF,GACzC,OAAQG,UAA8BA,IAAM,UAAYF,EAAIG,IAAID,EACjE,CAEA,MAAME,EAAmCN,EAAwC,SAAU,OAAQ,SACnG,MAAMO,EAAuBP,EAA4B,QAAS,SAAU,OAC5E,MAAMQ,EAAiBR,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,KAAKgB,mBAAmBiC,QACxB8K,yBAAA/N,MACA,OAAOA,IACR,IApgDoBd,EAiZI8G,YAAiD9M,OAAOqI,OAAO,CAAC,GAAE,OAjZtErC,CAAM","ignoreList":[],"sourceRoot":""}},{"offset":{"line":4,"column":0},"map":{"version":3,"names":["NavigationOutcome","_interopRequireDefault","__NavigationOutcome","library","Lib","init","apiVersion","name","version","dependencies","types","interfaces","controls","elements","noLibraryCSS","DataType","registerEnum"],"sources":["library.ts"],"sourcesContent":["import Lib from \"sap/ui/core/Lib\";\nimport DataType from \"sap/ui/base/DataType\";\nimport \"sap/ui/core/library\";\nimport \"sap/m/library\";\nimport NavigationOutcome from \"./NavigationOutcome\";\n\nconst library = Lib.init({\n\tapiVersion: 2,\n\tname: \"ui5.guard.router\",\n\tversion: \"1.6.2\",\n\tdependencies: [\"sap.ui.core\", \"sap.m\"],\n\ttypes: [\"ui5.guard.router.NavigationOutcome\"],\n\tinterfaces: [],\n\tcontrols: [],\n\telements: [],\n\tnoLibraryCSS: true,\n});\n\nDataType.registerEnum(\"ui5.guard.router.NavigationOutcome\", NavigationOutcome);\n\nexport default library;\n"],"mappings":"AAAA,4QAIOA,EAAiBC,EAAAC,GAExB,MAAMC,EAAUC,EAAIC,KAAK,CACxBC,WAAY,EACZC,KAAM,mBACNC,QAAS,QACTC,aAAc,CAAC,cAAe,SAC9BC,MAAO,CAAC,sCACRC,WAAY,GACZC,SAAU,GACVC,SAAU,GACVC,aAAc,OAGfC,EAASC,aAAa,qCAAsChB,GAAmB,OAEhEG,CAAO","ignoreList":[],"sourceRoot":""}},{"offset":{"line":5,"column":0},"map":{"version":3,"names":[],"sources":["library-preload.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.require.preload({\n"],"sourceRoot":""}},{"offset":{"line":8,"column":0},"map":{"version":3,"file":"types.js","names":[],"sources":[],"mappings":"","ignoreList":[],"sourceRoot":""}}]}
|
|
1
|
+
{"version":3,"file":"library-preload.js","sections":[{"offset":{"line":1,"column":0},"map":{"version":3,"names":["LOG_COMPONENT","___GuardPipeline","isRecord","value","Array","isArray","proto","Object","getPrototypeOf","prototype","isOneOf","values","set","Set","v","has","isUnknownRouteRegistrationPolicy","isNavToPreflightMode","isGuardLoading","isInheritance","LOG_LEVELS","error","Log","Level","ERROR","warning","WARNING","info","INFO","debug","DEBUG","isLogLevel","hasOwn","resolveGuardModulePath","dotPath","componentNamespace","startsWith","slice","length","replace","fullDotPath","parseGuardEntry","entry","hashIndex","indexOf","rawPath","exportKey","undefined","modulePath","parseGuardDescriptors","guards","JSON","stringify","descriptors","pushEntries","entries","route","type","label","parsed","push","key","leave","name","keys","DEFAULT_OPTIONS","unknownRouteRegistration","navToPreflight","guardLoading","inheritance","applyOption","raw","guard","target","applyLogLevel","level","getLevel","setLevel","normalizeGuardRouterOptions","logLevel","result","parseRouteMeta","routeMeta","Map","routeName","meta","freeze","parseGuardRouterConfig","options","__exports","__esModule"],"sources":["./GuardConfig.ts"],"sourcesContent":["/**\n * Parsing and validation of the `guardRouter` config block.\n */\nimport Log from \"sap/base/Log\";\nimport type {\n\tGuardLoading,\n\tGuardRouterLogLevel,\n\tInheritance,\n\tNavToPreflightMode,\n\tUnknownRouteRegistrationPolicy,\n} from \"./types\";\nimport { LOG_COMPONENT } from \"./GuardPipeline\";\n\n/** Type guard for plain objects. */\nexport function isRecord(value: unknown): value is Record<string, unknown> {\n\tif (typeof value !== \"object\" || value === null || Array.isArray(value)) return false;\n\tconst proto: unknown = Object.getPrototypeOf(value);\n\treturn proto === Object.prototype || proto === null;\n}\n\n/** Create a type-narrowing validator for a finite set of string literal values. */\nfunction isOneOf<T extends string>(...values: T[]): (v: unknown) => v is T {\n\tconst set: ReadonlySet<string> = new Set(values);\n\treturn (v: unknown): v is T => typeof v === \"string\" && set.has(v);\n}\n\nconst isUnknownRouteRegistrationPolicy = isOneOf<UnknownRouteRegistrationPolicy>(\"ignore\", \"warn\", \"throw\");\nconst isNavToPreflightMode = isOneOf<NavToPreflightMode>(\"guard\", \"bypass\", \"off\");\nconst isGuardLoading = isOneOf<GuardLoading>(\"block\", \"lazy\");\nconst isInheritance = isOneOf<Inheritance>(\"none\", \"pattern-tree\");\n\nconst LOG_LEVELS = {\n\terror: Log.Level.ERROR,\n\twarning: Log.Level.WARNING,\n\tinfo: Log.Level.INFO,\n\tdebug: Log.Level.DEBUG,\n} satisfies Record<GuardRouterLogLevel, unknown>;\n\nconst isLogLevel = (v: unknown): v is GuardRouterLogLevel => typeof v === \"string\" && Object.hasOwn(LOG_LEVELS, v);\n\n/** Parsed guard declaration from the manifest `guards` block. */\nexport interface GuardDescriptor {\n\treadonly route: string; // \"*\" for global, route name for per-route\n\treadonly type: \"enter\" | \"leave\";\n\treadonly modulePath: string;\n\treadonly exportKey?: string;\n}\n\n/**\n * Resolve a guard module path to a slash-separated AMD module path.\n *\n * Inspired by `sap.ui.core.routing.Target._getEffectiveObjectName()`,\n * which skips namespace prepending for `\"module:\"`-prefixed paths. This\n * function goes further: it also converts dots to slashes in a single\n * step, so both dot notation (`module:some.lib.guard`) and slash\n * notation (`module:some/lib/guard`) are accepted.\n *\n * - Paths prefixed with `\"module:\"` are treated as absolute (the prefix\n * is stripped, dots become slashes).\n * - All other paths are prefixed with the component namespace, then dots\n * become slashes.\n */\nfunction resolveGuardModulePath(dotPath: string, componentNamespace: string): string {\n\tif (dotPath.startsWith(\"module:\")) {\n\t\treturn dotPath.slice(\"module:\".length).replace(/\\./g, \"/\");\n\t}\n\tconst fullDotPath = componentNamespace ? componentNamespace + \".\" + dotPath : dotPath;\n\treturn fullDotPath.replace(/\\./g, \"/\");\n}\n\n/**\n * Split a manifest guard entry on the first `#` to separate the module path\n * from an optional export key.\n */\nfunction parseGuardEntry(entry: string, componentNamespace: string): { modulePath: string; exportKey?: string } {\n\tconst hashIndex = entry.indexOf(\"#\");\n\tconst rawPath = hashIndex === -1 ? entry : entry.slice(0, hashIndex);\n\tconst exportKey = hashIndex === -1 ? undefined : entry.slice(hashIndex + 1);\n\n\treturn { modulePath: resolveGuardModulePath(rawPath, componentNamespace), exportKey };\n}\n\n/**\n * Parse the `guards` block from the guardRouter config into an array of\n * {@link GuardDescriptor} objects.\n *\n * Handles:\n * - `\"*\"` key with `string[]` -> global enter guards\n * - Route name with `string[]` (shorthand) -> enter guards\n * - Route name with `{ enter: [...], leave: [...] }` -> enter + leave guards\n * - `\"*\"` with object form -> log info, treat enter as global\n * - `\"*\"` leave -> warn, skip (global leave guards not supported)\n * - Invalid entries, object values that are not arrays, unknown object keys -> warn, skip\n */\nfunction parseGuardDescriptors(guards: unknown, componentNamespace: string): GuardDescriptor[] {\n\tif (!isRecord(guards)) {\n\t\tLog.warning(\"guardRouter.guards is not a plain object, skipping\", JSON.stringify(guards), LOG_COMPONENT);\n\t\treturn [];\n\t}\n\n\tconst descriptors: GuardDescriptor[] = [];\n\n\tfunction pushEntries(entries: unknown[], route: string, type: \"enter\" | \"leave\", label: string): void {\n\t\tfor (const entry of entries) {\n\t\t\tif (typeof entry !== \"string\" || entry.length === 0) {\n\t\t\t\tLog.warning(\n\t\t\t\t\t`guardRouter.guards${label}: invalid entry, skipping`,\n\t\t\t\t\tJSON.stringify(entry),\n\t\t\t\t\tLOG_COMPONENT,\n\t\t\t\t);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst parsed = parseGuardEntry(entry, componentNamespace);\n\t\t\tdescriptors.push({ route, type, ...parsed });\n\t\t}\n\t}\n\n\tfor (const [key, value] of Object.entries(guards)) {\n\t\tif (Array.isArray(value)) {\n\t\t\tpushEntries(value, key, \"enter\", `[\"${key}\"]`);\n\t\t} else if (isRecord(value)) {\n\t\t\tif (key === \"*\" && value.leave !== undefined) {\n\t\t\t\tLog.warning(\n\t\t\t\t\t'guardRouter.guards[\"*\"].leave: global leave guards are not supported, skipping',\n\t\t\t\t\tundefined,\n\t\t\t\t\tLOG_COMPONENT,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tfor (const name of Object.keys(value)) {\n\t\t\t\tif (name === \"enter\" || name === \"leave\") continue;\n\t\t\t\tLog.warning(\n\t\t\t\t\t`guardRouter.guards[\"${key}\"].${name}: unknown key, expected enter or leave, skipping`,\n\t\t\t\t\tundefined,\n\t\t\t\t\tLOG_COMPONENT,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tfor (const type of [\"enter\", \"leave\"] as const) {\n\t\t\t\tconst entries = value[type];\n\t\t\t\tif (entries === undefined || (key === \"*\" && type === \"leave\")) continue;\n\t\t\t\tif (!Array.isArray(entries)) {\n\t\t\t\t\tLog.warning(\n\t\t\t\t\t\t`guardRouter.guards[\"${key}\"].${type}: expected string[], skipping`,\n\t\t\t\t\t\tJSON.stringify(entries),\n\t\t\t\t\t\tLOG_COMPONENT,\n\t\t\t\t\t);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (key === \"*\") {\n\t\t\t\t\tLog.info(\n\t\t\t\t\t\t'guardRouter.guards[\"*\"]: object form; treating enter as global',\n\t\t\t\t\t\tundefined,\n\t\t\t\t\t\tLOG_COMPONENT,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tpushEntries(entries, key, type, `[\"${key}\"].${type}`);\n\t\t\t}\n\t\t} else {\n\t\t\tLog.warning(\n\t\t\t\t`guardRouter.guards[\"${key}\"]: expected string[] or { enter?, leave? }, skipping`,\n\t\t\t\tJSON.stringify(value),\n\t\t\t\tLOG_COMPONENT,\n\t\t\t);\n\t\t}\n\t}\n\n\treturn descriptors;\n}\n\nexport interface ResolvedGuardRouterOptions {\n\treadonly unknownRouteRegistration: UnknownRouteRegistrationPolicy;\n\treadonly navToPreflight: NavToPreflightMode;\n\treadonly guardLoading: GuardLoading;\n\treadonly inheritance: Inheritance;\n}\n\nconst DEFAULT_OPTIONS: ResolvedGuardRouterOptions = {\n\tunknownRouteRegistration: \"warn\",\n\tnavToPreflight: \"guard\",\n\tguardLoading: \"lazy\",\n\tinheritance: \"none\",\n};\n\nfunction applyOption<K extends keyof ResolvedGuardRouterOptions>(\n\traw: Record<string, unknown>,\n\tkey: K,\n\tguard: (v: unknown) => v is ResolvedGuardRouterOptions[K],\n\ttarget: { -readonly [P in keyof ResolvedGuardRouterOptions]: ResolvedGuardRouterOptions[P] },\n): void {\n\tconst value = raw[key];\n\tif (value === undefined) return;\n\tif (guard(value)) {\n\t\ttarget[key] = value;\n\t} else {\n\t\tLog.warning(`guardRouter.${key} has invalid value, using default`, JSON.stringify(value), LOG_COMPONENT);\n\t}\n}\n\n/** Raise the page-wide level of the router's log component; a more verbose level is kept. */\nfunction applyLogLevel(value: unknown): void {\n\tif (value === undefined) return;\n\tif (!isLogLevel(value)) {\n\t\t// An error, not a warning: the level is not raised, so a warning would be filtered out at the default ERROR level.\n\t\tLog.error(\"guardRouter.logLevel has invalid value, ignoring it\", JSON.stringify(value), LOG_COMPONENT);\n\t\treturn;\n\t}\n\tconst level = LOG_LEVELS[value];\n\tif (level > Log.getLevel(LOG_COMPONENT)) Log.setLevel(level, LOG_COMPONENT);\n}\n\nfunction normalizeGuardRouterOptions(raw: unknown): ResolvedGuardRouterOptions {\n\tif (!isRecord(raw)) {\n\t\tif (raw !== undefined) {\n\t\t\tLog.warning(\"guardRouter config is not a plain object, using defaults\", JSON.stringify(raw), LOG_COMPONENT);\n\t\t}\n\t\treturn DEFAULT_OPTIONS;\n\t}\n\n\t// First, so that the warnings about the other options are logged at the new level.\n\tapplyLogLevel(raw.logLevel);\n\tconst result = { ...DEFAULT_OPTIONS };\n\tapplyOption(raw, \"unknownRouteRegistration\", isUnknownRouteRegistrationPolicy, result);\n\tapplyOption(raw, \"navToPreflight\", isNavToPreflightMode, result);\n\tapplyOption(raw, \"guardLoading\", isGuardLoading, result);\n\tapplyOption(raw, \"inheritance\", isInheritance, result);\n\treturn result;\n}\n\n/** Parse the `routeMeta` block: one frozen plain object per route name. */\nfunction parseRouteMeta(raw: unknown): Map<string, Readonly<Record<string, unknown>>> {\n\tconst routeMeta = new Map<string, Readonly<Record<string, unknown>>>();\n\tif (raw === undefined) return routeMeta;\n\tif (!isRecord(raw)) {\n\t\tLog.warning(\"guardRouter.routeMeta: expected object, skipping\", JSON.stringify(raw), LOG_COMPONENT);\n\t\treturn routeMeta;\n\t}\n\tfor (const [routeName, meta] of Object.entries(raw)) {\n\t\tif (isRecord(meta)) {\n\t\t\trouteMeta.set(routeName, Object.freeze({ ...meta }));\n\t\t} else {\n\t\t\tLog.warning(\n\t\t\t\t`guardRouter.routeMeta[\"${routeName}\"]: expected object, skipping`,\n\t\t\t\tJSON.stringify(meta),\n\t\t\t\tLOG_COMPONENT,\n\t\t\t);\n\t\t}\n\t}\n\treturn routeMeta;\n}\n\n/** The `guardRouter` config block, validated. Invalid parts are warned about and dropped. */\ninterface ParsedGuardRouterConfig {\n\treadonly options: ResolvedGuardRouterOptions;\n\treadonly routeMeta: Map<string, Readonly<Record<string, unknown>>>;\n\treadonly guards: GuardDescriptor[];\n}\n\n/**\n * Parse the `guardRouter` config block: options, `routeMeta` and the manifest `guards`.\n * Guard module paths are resolved against `componentNamespace` (the owner's `sap.app/id`).\n * Side effect: a valid `logLevel` raises the page-wide level of the router's log component.\n */\nexport function parseGuardRouterConfig(raw: unknown, componentNamespace: string): ParsedGuardRouterConfig {\n\tconst options = normalizeGuardRouterOptions(raw);\n\tif (!isRecord(raw)) return { options, routeMeta: new Map(), guards: [] };\n\treturn {\n\t\toptions,\n\t\trouteMeta: parseRouteMeta(raw.routeMeta),\n\t\tguards: raw.guards === undefined ? [] : parseGuardDescriptors(raw.guards, componentNamespace),\n\t};\n}\n"],"mappings":"AAAA,qHAWSA,EAAaC,EAAA,iBAGf,SAASC,EAASC,GACxB,UAAWA,IAAU,UAAYA,IAAU,MAAQC,MAAMC,QAAQF,GAAQ,OAAO,MAChF,MAAMG,EAAiBC,OAAOC,eAAeL,GAC7C,OAAOG,IAAUC,OAAOE,WAAaH,IAAU,IAChD,CAGA,SAASI,KAA6BC,GACrC,MAAMC,EAA2B,IAAIC,IAAIF,G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N,UAAW,IAAIC,IAAOjC,OAAQ,IACpE,MAAO,CACNsC,UACAN,UAAWD,EAAeV,EAAIW,WAC9BhC,OAAQqB,EAAIrB,SAAWH,UAAY,GAAKE,EAAsBsB,EAAIrB,OAAQf,GAE5E,CAAC,IAAAsD,EAAA,CAAAC,WAAA,MAAAD,EAAAvF,WAAAuF,EAAAF,yBAAA,OAAAE,CAAA","ignoreList":[],"sourceRoot":""}},{"offset":{"line":2,"column":0},"map":{"version":3,"names":["isPromiseLike","___GuardPipeline","LOG_COMPONENT","nameGuard","isRecord","___GuardConfig","isGuardFn","value","guardWarning","modulePath","detail","Log","warning","undefined","moduleNameOf","slice","lastIndexOf","positionOf","exportKey","test","Number","NaN","resolveModuleExports","moduleExport","moduleName","Object","hasOwn","named","Reflect","get","name","fn","debug","Array","isArray","length","index","isNaN","entry","results","i","push","entries","filter","key","resolveNamedGuards","map","runGuardsInOrder","guards","context","result","finishGuardsAsync","async","pending","remaining","signal","aborted","loadGuardModule","failure","Promise","resolve","reject","sap","ui","require","err","String","loadGuardModules","descriptors","all","descriptor","then","createLazyGuards","cached","run","mod","resolved","wrapper","guard","loadedModule","__exports","__esModule"],"sources":["./GuardModules.ts"],"sourcesContent":["/**\n * Guard modules: detect a loaded module's export shape, load modules for\n * manifest guards (blocking or lazy), and run a module's guards in order.\n */\nimport Log from \"sap/base/Log\";\nimport type { GuardContext, GuardFn, GuardResult } from \"./types\";\nimport { isPromiseLike, LOG_COMPONENT, nameGuard } from \"./GuardPipeline\";\nimport { type GuardDescriptor, isRecord } from \"./GuardConfig\";\n\n/** A guard function from a module, with the name its log messages show. */\ninterface NamedGuard {\n\treadonly name: string;\n\treadonly fn: GuardFn;\n}\n\n/** A guard as a module exports it: any function. Its result is checked when it runs. */\nfunction isGuardFn(value: unknown): value is GuardFn {\n\treturn typeof value === \"function\";\n}\n\n/** Log a warning about a guard module entry in the manifest. */\nfunction guardWarning(modulePath: string, detail: string): void {\n\tLog.warning(`guardRouter.guards: \"${modulePath}\" ${detail}`, undefined, LOG_COMPONENT);\n}\n\n/** The last segment of a module path, by which the guards of the module are named. */\nfunction moduleNameOf(modulePath: string): string {\n\treturn modulePath.slice(modulePath.lastIndexOf(\"/\") + 1);\n}\n\n/** The position an export key selects: a plain non-negative integer, otherwise `NaN`. */\nfunction positionOf(exportKey: string): number {\n\treturn /^\\d+$/.test(exportKey) ? Number(exportKey) : NaN;\n}\n\n/**\n * Detect the export shape of a loaded guard module and extract guard functions.\n *\n * Shapes and the names they get (`moduleName` is the last path segment):\n * - function → single guard, named `moduleName` (or the export key when one is given);\n * an export key that names a function among its own properties picks that one\n * - Array → ordered guards, named `moduleName#index` (non-functions warned and skipped)\n * - plain object → guards in key order, named by key (non-functions warned and skipped)\n *\n * The module is read as the value it returns to the UI5 loader, which has no ES module\n * interop. The UI5 transpiler (babel-plugin-transform-modules-ui5) returns a default export\n * as that value, with named exports beside it collapsed onto it as properties, and returns\n * the exports of a module with only named exports as the object `{ __esModule: true, ... }`.\n *\n * When `exportKey` is set, only the matching export is returned.\n * When `exportKey` is set on a function export that has no such function, the key is ignored with a debug log.\n */\nexport function resolveModuleExports(moduleExport: unknown, modulePath: string, exportKey?: string): NamedGuard[] {\n\tconst moduleName = moduleNameOf(modulePath);\n\n\tif (isGuardFn(moduleExport)) {\n\t\tif (exportKey !== undefined) {\n\t\t\t// A named export beside the default export, which the transpiler has collapsed onto it.\n\t\t\tif (Object.hasOwn(moduleExport, exportKey)) {\n\t\t\t\tconst named: unknown = Reflect.get(moduleExport, exportKey);\n\t\t\t\tif (isGuardFn(named)) return [{ name: exportKey, fn: named }];\n\t\t\t}\n\t\t\tLog.debug(\n\t\t\t\t`guardRouter.guards: \"${modulePath}#${exportKey}\" is a single function, ignoring export key`,\n\t\t\t\tundefined,\n\t\t\t\tLOG_COMPONENT,\n\t\t\t);\n\t\t}\n\t\treturn [{ name: exportKey ?? moduleName, fn: moduleExport }];\n\t}\n\n\tif (Array.isArray(moduleExport)) {\n\t\tif (moduleExport.length === 0) {\n\t\t\tguardWarning(modulePath, \"exported an empty array, skipping\");\n\t\t\treturn [];\n\t\t}\n\n\t\tif (exportKey !== undefined) {\n\t\t\tconst index = positionOf(exportKey);\n\t\t\tif (Number.isNaN(index) || index >= moduleExport.length) {\n\t\t\t\tguardWarning(modulePath, `#${exportKey} - index out of range, skipping`);\n\t\t\t\treturn [];\n\t\t\t}\n\t\t\tconst entry: unknown = moduleExport[index];\n\t\t\tif (!isGuardFn(entry)) {\n\t\t\t\tguardWarning(modulePath, `#${exportKey} is not a function, skipping`);\n\t\t\t\treturn [];\n\t\t\t}\n\t\t\treturn [{ name: `${moduleName}#${exportKey}`, fn: entry }];\n\t\t}\n\n\t\tconst results: NamedGuard[] = [];\n\t\tfor (let i = 0; i < moduleExport.length; i++) {\n\t\t\tconst entry: unknown = moduleExport[i];\n\t\t\tif (!isGuardFn(entry)) {\n\t\t\t\tguardWarning(modulePath, `[${i}] is not a function, skipping`);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tresults.push({ name: `${moduleName}#${i}`, fn: entry });\n\t\t}\n\t\treturn results;\n\t}\n\n\tif (isRecord(moduleExport)) {\n\t\t// The transpiler's object of a module with only named exports has `__esModule` as an enumerable first key.\n\t\tconst entries = Object.entries(moduleExport).filter(([key]) => key !== \"__esModule\");\n\t\tif (entries.length === 0) {\n\t\t\tguardWarning(modulePath, \"exported an empty object, skipping\");\n\t\t\treturn [];\n\t\t}\n\n\t\tif (exportKey !== undefined) {\n\t\t\t// A key wins over a position. A position that is not a number or out of range finds no entry.\n\t\t\tconst entry: [string, unknown] | undefined = Object.hasOwn(moduleExport, exportKey)\n\t\t\t\t? [exportKey, moduleExport[exportKey]]\n\t\t\t\t: entries[positionOf(exportKey)];\n\t\t\tif (entry === undefined) {\n\t\t\t\tguardWarning(modulePath, `#${exportKey} - key not found, skipping`);\n\t\t\t\treturn [];\n\t\t\t}\n\t\t\tconst [name, value] = entry;\n\t\t\tif (!isGuardFn(value)) {\n\t\t\t\tguardWarning(modulePath, `#${exportKey} is not a function, skipping`);\n\t\t\t\treturn [];\n\t\t\t}\n\t\t\treturn [{ name, fn: value }];\n\t\t}\n\n\t\tconst results: NamedGuard[] = [];\n\t\tfor (const [key, value] of entries) {\n\t\t\tif (!isGuardFn(value)) {\n\t\t\t\tguardWarning(modulePath, `.${key} is not a function, skipping`);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tresults.push({ name: key, fn: value });\n\t\t}\n\t\treturn results;\n\t}\n\n\tguardWarning(modulePath, \"did not export a function, array, or plain object, skipping\");\n\treturn [];\n}\n\n/** Resolve a module's guards and name each one for log output. */\nfunction resolveNamedGuards(moduleExport: unknown, modulePath: string, exportKey?: string): GuardFn[] {\n\treturn resolveModuleExports(moduleExport, modulePath, exportKey).map(({ name, fn }) => {\n\t\tnameGuard(fn, name);\n\t\treturn fn;\n\t});\n}\n\n/**\n * Run guards in order, stopping at the first result that is not `true`.\n * Stays synchronous until a guard returns a Promise, like the pipeline.\n */\nexport function runGuardsInOrder(guards: GuardFn[], context: GuardContext): GuardResult | Promise<GuardResult> {\n\tfor (let i = 0; i < guards.length; i++) {\n\t\tconst result = guards[i](context);\n\t\tif (isPromiseLike(result)) return finishGuardsAsync(result, guards.slice(i + 1), context);\n\t\tif (result !== true) return result;\n\t}\n\treturn true;\n}\n\n/** Await a pending guard result, then run the remaining guards unless the navigation was superseded. */\nasync function finishGuardsAsync(\n\tpending: PromiseLike<GuardResult>,\n\tremaining: GuardFn[],\n\tcontext: GuardContext,\n): Promise<GuardResult> {\n\tconst result = await pending;\n\tif (result !== true) return result;\n\tif (context.signal.aborted) return false;\n\treturn runGuardsInOrder(remaining, context);\n}\n\n/** Load a guard module asynchronously. Warns with `failure` and rejects when the load fails. */\nfunction loadGuardModule(modulePath: string, failure: string): Promise<unknown> {\n\treturn new Promise((resolve, reject) => {\n\t\tsap.ui.require([modulePath], resolve, (err: Error) => {\n\t\t\tLog.warning(`guardRouter.guards: ${failure}`, String(err), LOG_COMPONENT);\n\t\t\treject(err);\n\t\t});\n\t});\n}\n\n/**\n * Load the modules of all descriptors (`guardLoading: \"block\"`) and resolve their guards.\n *\n * Each module is loaded in its own `sap.ui.require` call, so an invalid path\n * only skips that descriptor (with a warning) instead of failing the batch.\n * Results keep declaration order.\n */\nexport function loadGuardModules<T extends GuardDescriptor>(\n\tdescriptors: T[],\n): Promise<{ descriptor: T; guards: GuardFn[] }[]> {\n\treturn Promise.all(\n\t\tdescriptors.map(async (descriptor) => {\n\t\t\tconst { modulePath, exportKey } = descriptor;\n\t\t\tconst guards = await loadGuardModule(modulePath, `failed to load module \"${modulePath}\", skipping`).then(\n\t\t\t\t(moduleExport) => resolveNamedGuards(moduleExport, modulePath, exportKey),\n\t\t\t\t() => [],\n\t\t\t);\n\t\t\treturn { descriptor, guards };\n\t\t}),\n\t);\n}\n\n/**\n * Create the guards to register for one descriptor (`guardLoading: \"lazy\"`).\n *\n * - Cherry-pick (`module#export`): one wrapper that loads the module on first use\n * and resolves the export once, so a missing export warns once.\n * - Bare path, module already cached (preload finished): the module's guards themselves.\n * - Bare path, cache miss: one wrapper that loads the module on first use and runs all\n * of its guards in order. Registering them on first use would miss the current\n * navigation, whose guard list the pipeline is already iterating. Later navigations\n * run them synchronously.\n *\n * A wrapper is named after the module until it resolves to a single guard, then after that guard.\n */\nexport function createLazyGuards(descriptor: GuardDescriptor): GuardFn[] {\n\tconst { modulePath, exportKey } = descriptor;\n\tconst moduleName = moduleNameOf(modulePath);\n\n\tif (exportKey === undefined) {\n\t\tconst cached: unknown = sap.ui.require(modulePath);\n\t\tif (cached !== undefined) return resolveNamedGuards(cached, modulePath);\n\t}\n\n\tlet guards: GuardFn[] | undefined;\n\tconst run = (mod: unknown, context: GuardContext): GuardResult | Promise<GuardResult> => {\n\t\tif (guards === undefined) {\n\t\t\tconst resolved = resolveModuleExports(mod, modulePath, exportKey);\n\t\t\tif (resolved.length === 1) nameGuard(wrapper, resolved[0].name);\n\t\t\tguards = resolved.map((guard) => guard.fn);\n\t\t}\n\t\treturn runGuardsInOrder(guards, context);\n\t};\n\tconst wrapper = (context: GuardContext): GuardResult | PromiseLike<GuardResult> => {\n\t\tconst mod: unknown = sap.ui.require(modulePath);\n\t\tif (mod !== undefined) return run(mod, context);\n\t\treturn loadGuardModule(modulePath, `lazy load of \"${modulePath}\" failed`).then((loadedModule) =>\n\t\t\tcontext.signal.aborted ? false : run(loadedModule, context),\n\t\t);\n\t};\n\tnameGuard(wrapper, exportKey === undefined ? moduleName : `${moduleName}#${exportKey}`);\n\treturn [wrapper];\n}\n"],"mappings":"AAAA,wIAMSA,EAAaC,EAAA,uBAAEC,EAAaD,EAAA,uBAAEE,EAASF,EAAA,mBACjBG,EAAQC,EAAA,YASvC,SAASC,EAAUC,GAClB,cAAcA,IAAU,UACzB,CAGA,SAASC,EAAaC,EAAoBC,GACzCC,EAAIC,QAAQ,wBAAwBH,MAAeC,IAAUG,UAAWX,EACzE,CAGA,SAASY,EAAaL,GACrB,OAAOA,EAAWM,MAAMN,EAAWO,YAAY,KAAO,EACvD,CAGA,SAASC,EAAWC,GACnB,MAAO,QAAQC,KAAKD,GAAaE,OAAOF,GAAaG,GACtD,CAmBO,SAASC,EAAqBC,EAAuBd,EAAoBS,GAC/E,MAAMM,EAAaV,EAAaL,GAEhC,GAAIH,EAAUiB,GAAe,CAC5B,GAAIL,IAAcL,UAAW,CAE5B,GAAIY,OAAOC,OAAOH,EAAcL,GAAY,CAC3C,MAAMS,EAAiBC,QAAQC,IAAIN,EAAcL,GACjD,GAAIZ,EAAUqB,GAAQ,MAAO,CAAC,CAAEG,KAAMZ,EAAWa,GAAIJ,GACtD,CACAhB,EAAIqB,MACH,wBAAwBvB,KAAcS,+CACtCL,UACAX,EAEF,CACA,MAAO,CAAC,CAAE4B,KAAMZ,GAAaM,EAAYO,GAAIR,GAC9C,CAEA,GAAIU,MAAMC,QAAQX,GAAe,CAChC,GAAIA,EAAaY,SAAW,EAAG,CAC9B3B,EAAaC,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WAAEA,EAAUS,UAAEA,GAAcoD,EAClC,MAAM9C,EAAaV,EAAaL,GAEhC,GAAIS,IAAcL,UAAW,CAC5B,MAAM4D,EAAkBX,IAAIC,GAAGC,QAAQvD,GACvC,GAAIgE,IAAW5D,UAAW,OAAOgC,EAAmB4B,EAAQhE,EAC7D,CAEA,IAAIuC,EACJ,MAAM0B,EAAMA,CAACC,EAAc1B,KAC1B,GAAID,IAAWnC,UAAW,CACzB,MAAM+D,EAAWtD,EAAqBqD,EAAKlE,EAAYS,GACvD,GAAI0D,EAASzC,SAAW,EAAGhC,EAAU0E,EAASD,EAAS,GAAG9C,MAC1DkB,EAAS4B,EAAS9B,IAAKgC,GAAUA,EAAM/C,GACxC,CACA,OAAOgB,EAAiBC,EAAQC,IAEjC,MAAM4B,EAAW5B,IAChB,MAAM0B,EAAeb,IAAIC,GAAGC,QAAQvD,GACpC,GAAIkE,IAAQ9D,UAAW,OAAO6D,EAAIC,EAAK1B,GACvC,OAAOQ,EAAgBhD,EAAY,iBAAiBA,aAAsB8D,KAAMQ,GAC/E9B,EAAQM,OAAOC,QAAU,MAAQkB,EAAIK,EAAc9B,KAGrD9C,EAAU0E,EAAS3D,IAAcL,UAAYW,EAAa,GAAGA,KAAcN,KAC3E,MAAO,CAAC2D,EACT,CAAC,IAAAG,EAAA,CAAAC,WAAA,MAAAD,EAAA1D,uBAAA0D,EAAAjC,mBAAAiC,EAAAb,mBAAAa,EAAAR,mBAAA,OAAAQ,CAAA","ignoreList":[],"sourceRoot":""}},{"offset":{"line":3,"column":0},"map":{"version":3,"names":["LOG_COMPONENT","isGuardRedirect","value","route","length","isPromiseLike","then","resolverSource","Promise","resolve","Function","prototype","toString","call","isPromiseResolver","name","guardNames","WeakMap","nameGuard","guard","set","describeGuard","label","index","get","undefined","toDecision","result","action","target","toErrorDecision","error","GuardPipeline","_globalGuards","_enterGuards","Map","_leaveGuards","addGlobalGuard","this","push","removeGlobalGuard","indexOf","splice","addEnterGuard","before","_addToGuardMap","removeEnterGuard","_removeFromGuardMap","addLeaveGuard","removeLeaveGuard","clear","evaluate","context","options","leaving","skipLeaveGuards","fromRoute","alsoLeaving","entering","toRoute","alsoEntering","runEnterPhase","enterResult","_runEnterGuards","catch","leaveResult","_runForEach","_runGuards","_validateLeaveGuardResult","allowed","signal","aborted","map","key","guards","delete","routes","run","start","i","settled","runRouteGuards","_runRouteGuards","globalResult","_validateGuardResult","onBlock","slice","_continueGuardsAsync","Log","Error","String","pendingResult","currentIndex","guardIndex","nextResult","warning"],"sources":["./GuardPipeline.ts"],"sourcesContent":["import Log from \"sap/base/Log\";\nimport type { GuardFn, GuardContext, GuardResult, GuardRedirect } from \"./types\";\n\n/** The component under which the library logs. */\nexport const LOG_COMPONENT = \"ui5.guard.router.Router\";\n\nfunction isGuardRedirect(value: unknown): value is GuardRedirect {\n\tif (typeof value !== \"object\" || value === null) {\n\t\treturn false;\n\t}\n\n\treturn \"route\" in value && typeof value.route === \"string\" && value.route.length > 0;\n}\n\n/**\n * Promises/A+ thenable detection via duck typing.\n *\n * We intentionally do not use `instanceof Promise` because that misses\n * cross-realm Promises and PromiseLike/thenable objects.\n */\nexport function isPromiseLike<T>(value: unknown): value is PromiseLike<T> {\n\tif ((typeof value !== \"object\" && typeof value !== \"function\") || value === null) {\n\t\treturn false;\n\t}\n\n\treturn \"then\" in value && typeof value.then === \"function\";\n}\n\n/** How this engine prints the resolve function of a Promise: `function () { [native code] }` in V8. */\nlet resolverSource!: string;\nvoid new Promise((resolve) => {\n\tresolverSource = Function.prototype.toString.call(resolve);\n});\n\n/**\n * Whether `value` looks exactly like the resolve function of a native Promise: a function with\n * the name `\"\"`, the length `1` and the source text that this engine prints for such a function.\n * `Router#attachRouteMatched` needs this to recognize a UI5 component target that waits for the\n * router. A function written in JavaScript never matches; other anonymous built-ins with one\n * parameter do, above all the reject function of a Promise.\n */\nexport function isPromiseResolver(value: unknown): value is () => void {\n\treturn (\n\t\ttypeof value === \"function\" &&\n\t\tvalue.name === \"\" &&\n\t\tvalue.length === 1 &&\n\t\tFunction.prototype.toString.call(value) === resolverSource\n\t);\n}\n\n/** Names of manifest guards, derived from their module, for log output. */\nconst guardNames = new WeakMap<GuardFn, string>();\n\n/** Give a guard a name that its log messages show. */\nexport function nameGuard(guard: GuardFn, name: string): void {\n\tguardNames.set(guard, name);\n}\n\n/** Describe a guard for log output: `Enter guard [0]`, or `Enter guard [0] \"checks#0\"` when it has a name. */\nfunction describeGuard(label: string, index: number, guard: GuardFn): string {\n\tconst name = guardNames.get(guard);\n\treturn name === undefined ? `${label} [${index}]` : `${label} [${index}] \"${name}\"`;\n}\n\n/**\n * Normalized result of the guard decision pipeline.\n */\nexport type GuardDecision =\n\t| { action: \"allow\" }\n\t| { action: \"block\" }\n\t| { action: \"redirect\"; target: string | GuardRedirect }\n\t| { action: \"error\"; error: unknown };\n\nfunction toDecision(result: GuardResult): GuardDecision {\n\tif (result === true) return { action: \"allow\" };\n\tif (result === false) return { action: \"block\" };\n\treturn { action: \"redirect\", target: result };\n}\n\nfunction toErrorDecision(error: unknown): GuardDecision {\n\treturn { action: \"error\", error };\n}\n\n/**\n * Standalone guard evaluation pipeline.\n *\n * Owns guard storage (global, enter, leave) and runs the full\n * leave -> global-enter -> route-enter pipeline. It reads no Router\n * state: evaluate() receives the context and the greedy routes left\n * and entered with it.\n */\nexport default class GuardPipeline {\n\tprivate _globalGuards: GuardFn[] = [];\n\tprivate _enterGuards = new Map<string, GuardFn[]>();\n\tprivate _leaveGuards = new Map<string, GuardFn[]>();\n\n\t/** Register a guard that runs for every navigation. */\n\taddGlobalGuard(guard: GuardFn): void {\n\t\tthis._globalGuards.push(guard);\n\t}\n\n\t/** Remove a previously registered global guard by reference. */\n\tremoveGlobalGuard(guard: GuardFn): void {\n\t\tconst index = this._globalGuards.indexOf(guard);\n\t\tif (index !== -1) {\n\t\t\tthis._globalGuards.splice(index, 1);\n\t\t}\n\t}\n\n\t/**\n\t * Register an enter guard for a specific route.\n\t *\n\t * @param route - Route name as defined in `manifest.json`.\n\t * @param guard - Guard function to register.\n\t * @param before - A guard of the route to register `guard` in front of; at the end without it.\n\t */\n\taddEnterGuard(route: string, guard: GuardFn, before?: GuardFn): void {\n\t\tthis._addToGuardMap(this._enterGuards, route, guard, before);\n\t}\n\n\t/**\n\t * Remove a previously registered enter guard by reference.\n\t */\n\tremoveEnterGuard(route: string, guard: GuardFn): void {\n\t\tthis._removeFromGuardMap(this._enterGuards, route, guard);\n\t}\n\n\t/**\n\t * Register a leave guard for a specific route.\n\t *\n\t * Accepts `GuardFn` to support manifest-declared guards loaded from\n\t * untyped modules. Non-boolean return values are caught at runtime\n\t * by {@link _validateLeaveGuardResult}.\n\t *\n\t * @param route - Route name as defined in `manifest.json`.\n\t * @param guard - Guard function to register as a leave guard.\n\t * @param before - A leave guard of the route to register `guard` in front of; at the end without it.\n\t */\n\taddLeaveGuard(route: string, guard: GuardFn, before?: GuardFn): void {\n\t\tthis._addToGuardMap(this._leaveGuards, route, guard, before);\n\t}\n\n\t/**\n\t * Remove a previously registered leave guard by reference.\n\t */\n\tremoveLeaveGuard(route: string, guard: GuardFn): void {\n\t\tthis._removeFromGuardMap(this._leaveGuards, route, guard);\n\t}\n\n\t/**\n\t * Remove all registered guards.\n\t */\n\tclear(): void {\n\t\tthis._globalGuards = [];\n\t\tthis._enterGuards.clear();\n\t\tthis._leaveGuards.clear();\n\t}\n\n\t/**\n\t * Run the full guard pipeline (leave -> global enter -> route enter) and\n\t * return a normalized decision. Stays synchronous when all guards return\n\t * plain values; returns a Promise only when an async guard is encountered.\n\t *\n\t * @param context - Complete guard context including AbortSignal.\n\t * `context.fromRoute` controls leave-guard lookup: empty string skips leave guards.\n\t * @param options - Optional evaluation options.\n\t * @param options.skipLeaveGuards - When true, leave guards are skipped even if\n\t * `context.fromRoute` is set. Used by redirect chain hops to avoid re-running\n\t * leave guards while still preserving `fromRoute` in the context.\n\t * @param options.alsoLeaving - Greedy routes that are left as well: their leave guards run\n\t * after those of `context.fromRoute`, with the same context.\n\t * @param options.alsoEntering - Greedy routes that match as well: their enter guards run\n\t * after those of `context.toRoute`, with the same context.\n\t * @returns A synchronous {@link GuardDecision} when all guards return plain values,\n\t * or a `Promise<GuardDecision>` when at least one guard returns a thenable.\n\t */\n\tevaluate(\n\t\tcontext: GuardContext,\n\t\toptions?: { skipLeaveGuards?: boolean; alsoLeaving?: string[]; alsoEntering?: string[] },\n\t): GuardDecision | Promise<GuardDecision> {\n\t\t// No route is left on the first navigation, or after a hash that matched none.\n\t\tconst leaving =\n\t\t\toptions?.skipLeaveGuards || context.fromRoute === \"\"\n\t\t\t\t? []\n\t\t\t\t: [context.fromRoute, ...(options?.alsoLeaving ?? [])];\n\t\tconst entering = [context.toRoute, ...(options?.alsoEntering ?? [])];\n\n\t\tconst runEnterPhase = (): GuardDecision | Promise<GuardDecision> => {\n\t\t\tconst enterResult = this._runEnterGuards(entering, context);\n\t\t\treturn isPromiseLike(enterResult)\n\t\t\t\t? enterResult.then(toDecision).catch(toErrorDecision)\n\t\t\t\t: toDecision(enterResult);\n\t\t};\n\n\t\ttry {\n\t\t\tconst leaveResult = this._runForEach(leaving, context, (route) =>\n\t\t\t\tthis._runGuards(\n\t\t\t\t\tthis._leaveGuards.get(route) ?? [],\n\t\t\t\t\tcontext,\n\t\t\t\t\troute,\n\t\t\t\t\t(result) => this._validateLeaveGuardResult(result),\n\t\t\t\t\t\"Leave guard\",\n\t\t\t\t),\n\t\t\t);\n\n\t\t\tif (isPromiseLike(leaveResult)) {\n\t\t\t\treturn leaveResult\n\t\t\t\t\t.then((allowed: GuardResult): GuardDecision | Promise<GuardDecision> => {\n\t\t\t\t\t\tif (allowed !== true) return { action: \"block\" };\n\t\t\t\t\t\tif (context.signal.aborted) return { action: \"block\" };\n\t\t\t\t\t\treturn runEnterPhase();\n\t\t\t\t\t})\n\t\t\t\t\t.catch(toErrorDecision);\n\t\t\t}\n\t\t\tif (leaveResult !== true) return { action: \"block\" };\n\n\t\t\treturn runEnterPhase();\n\t\t} catch (error) {\n\t\t\treturn toErrorDecision(error);\n\t\t}\n\t}\n\n\tprivate _addToGuardMap<T>(map: Map<string, T[]>, key: string, guard: T, before?: T): void {\n\t\tlet guards = map.get(key);\n\t\tif (!guards) {\n\t\t\tguards = [];\n\t\t\tmap.set(key, guards);\n\t\t}\n\t\tconst index = before === undefined ? -1 : guards.indexOf(before);\n\t\tif (index === -1) guards.push(guard);\n\t\telse guards.splice(index, 0, guard);\n\t}\n\n\tprivate _removeFromGuardMap<T>(map: Map<string, T[]>, key: string, guard: T): void {\n\t\tconst guards = map.get(key);\n\t\tif (!guards) return;\n\t\tconst index = guards.indexOf(guard);\n\t\tif (index !== -1) guards.splice(index, 1);\n\t\tif (guards.length === 0) map.delete(key);\n\t}\n\n\t/**\n\t * Run `run` for each route in order until one does not return `true`. Stays sync as long\n\t * as the runs do; after an async run the next one starts unless the navigation was aborted.\n\t */\n\tprivate _runForEach(\n\t\troutes: string[],\n\t\tcontext: GuardContext,\n\t\trun: (route: string) => GuardResult | Promise<GuardResult>,\n\t\tstart = 0,\n\t): GuardResult | Promise<GuardResult> {\n\t\tfor (let i = start; i < routes.length; i++) {\n\t\t\tconst result = run(routes[i]);\n\t\t\tif (isPromiseLike(result)) {\n\t\t\t\treturn result.then((settled: GuardResult) => {\n\t\t\t\t\tif (settled !== true) return settled;\n\t\t\t\t\tif (context.signal.aborted) return false;\n\t\t\t\t\treturn this._runForEach(routes, context, run, i + 1);\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (result !== true) return result;\n\t\t}\n\t\treturn true;\n\t}\n\n\t/** Run global guards, then the route-specific guards of each route in `entering`. Stays sync when possible. */\n\tprivate _runEnterGuards(entering: string[], context: GuardContext): GuardResult | Promise<GuardResult> {\n\t\tconst runRouteGuards = (): GuardResult | Promise<GuardResult> =>\n\t\t\tthis._runForEach(entering, context, (route) => this._runRouteGuards(route, context));\n\t\tconst globalResult = this._runGuards(\n\t\t\tthis._globalGuards,\n\t\t\tcontext,\n\t\t\tcontext.toRoute,\n\t\t\t(result) => this._validateGuardResult(result),\n\t\t\t\"Enter guard\",\n\t\t);\n\n\t\tif (isPromiseLike(globalResult)) {\n\t\t\treturn globalResult.then((result: GuardResult) => {\n\t\t\t\tif (result !== true) return result;\n\t\t\t\tif (context.signal.aborted) return false;\n\t\t\t\treturn runRouteGuards();\n\t\t\t});\n\t\t}\n\t\tif (globalResult !== true) return globalResult;\n\t\treturn runRouteGuards();\n\t}\n\n\t/** Run route-specific guards if any are registered. */\n\tprivate _runRouteGuards(toRoute: string, context: GuardContext): GuardResult | Promise<GuardResult> {\n\t\tconst guards = toRoute ? this._enterGuards.get(toRoute) : undefined;\n\t\tif (!guards) return true;\n\t\treturn this._runGuards(guards, context, toRoute, (result) => this._validateGuardResult(result), \"Enter guard\");\n\t}\n\n\t/**\n\t * Run guards sync; switch to async path if a Promise is returned. A result that is not\n\t * `true` ends the run with what `onBlock` makes of it.\n\t *\n\t * The guard array is snapshot-copied before iteration so that guards\n\t * may safely add/remove themselves (e.g. one-shot guards) without\n\t * affecting the current pipeline run.\n\t *\n\t * @param route - The route the guards are registered for, named in error logs.\n\t */\n\tprivate _runGuards<R extends GuardResult>(\n\t\tguards: GuardFn[],\n\t\tcontext: GuardContext,\n\t\troute: string,\n\t\tonBlock: (result: unknown) => R,\n\t\tlabel: string,\n\t): R | boolean | Promise<R | boolean> {\n\t\tguards = guards.slice();\n\t\tfor (let i = 0; i < guards.length; i++) {\n\t\t\ttry {\n\t\t\t\tconst result = guards[i](context);\n\t\t\t\tif (isPromiseLike(result)) {\n\t\t\t\t\treturn this._continueGuardsAsync(result, guards, i, context, onBlock, label, route);\n\t\t\t\t}\n\t\t\t\tif (result !== true) return onBlock(result);\n\t\t\t} catch (error) {\n\t\t\t\tif (context.signal.aborted) return false;\n\t\t\t\tLog.error(\n\t\t\t\t\t`${describeGuard(label, i, guards[i])} on route \"${route}\" threw, navigation failed`,\n\t\t\t\t\terror instanceof Error ? error : String(error),\n\t\t\t\t\tLOG_COMPONENT,\n\t\t\t\t);\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * Continue guard array async from the first Promise onward.\n\t *\n\t * Shared by both enter and leave guard pipelines. The `onBlock` callback\n\t * determines what to return for non-true results: leave guards always\n\t * return `false`, enter guards validate and may return redirects.\n\t *\n\t * @param route - The route the guards are registered for, named in error logs.\n\t */\n\tprivate async _continueGuardsAsync<R extends GuardResult>(\n\t\tpendingResult: PromiseLike<GuardResult>,\n\t\tguards: GuardFn[],\n\t\tcurrentIndex: number,\n\t\tcontext: GuardContext,\n\t\tonBlock: (result: unknown) => R,\n\t\tlabel: string,\n\t\troute: string,\n\t): Promise<R | boolean> {\n\t\tlet guardIndex = currentIndex;\n\t\ttry {\n\t\t\tconst result = await pendingResult;\n\t\t\tif (result !== true) return onBlock(result);\n\n\t\t\tfor (let i = currentIndex + 1; i < guards.length; i++) {\n\t\t\t\tif (context.signal.aborted) return false;\n\t\t\t\tguardIndex = i;\n\t\t\t\tconst nextResult = await guards[i](context);\n\t\t\t\tif (nextResult !== true) return onBlock(nextResult);\n\t\t\t}\n\t\t\treturn true;\n\t\t} catch (error) {\n\t\t\tif (!context.signal.aborted) {\n\t\t\t\tLog.error(\n\t\t\t\t\t`${describeGuard(label, guardIndex, guards[guardIndex])} on route \"${route}\" threw, navigation failed`,\n\t\t\t\t\terror instanceof Error ? error : String(error),\n\t\t\t\t\tLOG_COMPONENT,\n\t\t\t\t);\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t/** Validate a non-true guard result; invalid values become false. */\n\tprivate _validateGuardResult(result: unknown): GuardResult {\n\t\tif (typeof result === \"boolean\") return result;\n\t\tif (typeof result === \"string\" && result.length > 0) return result;\n\t\tif (isGuardRedirect(result)) return result;\n\t\tLog.warning(\"Guard returned invalid value, treating as block\", String(result), LOG_COMPONENT);\n\t\treturn false;\n\t}\n\n\t/** Validate a leave guard result; non-boolean values log a warning and block. */\n\tprivate _validateLeaveGuardResult(result: unknown): boolean {\n\t\tif (typeof result === \"boolean\") return result;\n\t\tLog.warning(\"Leave guard returned non-boolean value, treating as block\", String(result), LOG_COMPONENT);\n\t\treturn false;\n\t}\n}\n"],"mappings":"AAAA,6FAIO,MAAMA,EAAgB,0BAE7B,SAASC,EAAgBC,GACxB,UAAWA,IAAU,UAAYA,IAAU,KAAM,CAChD,OAAO,KACR,CAEA,MAAO,UAAWA,UAAgBA,EAAMC,QAAU,UAAYD,EAAMC,MAAMC,OAAS,CACpF,CAQO,SAASC,EAAiBH,GAChC,UAAYA,IAAU,iBAAmBA,IAAU,YAAeA,IAAU,KAAM,CACjF,OAAO,KACR,CAEA,MAAO,SAAUA,UAAgBA,EAAMI,OAAS,UACjD,CAGA,IAAIC,OACC,IAAIC,QAASC,IACjBF,EAAiBG,SAASC,UAAUC,SAASC,KAAKJ,KAU5C,SAASK,EAAkBZ,GACjC,cACQA,IAAU,YACjBA,EAAMa,OAAS,IACfb,EAAME,SAAW,GACjBM,SAASC,UAAUC,SAASC,KAAKX,KAAWK,CAE9C,CAGA,MAAMS,EAAa,IAAIC,QAGhB,SAASC,EAAUC,EAAgBJ,GACzCC,EAAWI,IAAID,EAAOJ,EACvB,CAGA,SAASM,EAAcC,EAAeC,EAAeJ,GACpD,MAAMJ,EAAOC,EAAWQ,IAAIL,GAC5B,OAAOJ,IAASU,UAAY,GAAGH,MAAUC,KAAW,GAAGD,MAAUC,OAAWR,IAC7E,CAWA,SAASW,EAAWC,GACnB,GAAIA,IAAW,KAAM,MAAO,CAAEC,OAAQ,SACtC,GAAID,IAAW,MAAO,MAAO,CAAEC,OAAQ,SACvC,MAAO,CAAEA,OAAQ,WAAYC,OAAQF,EACtC,CAEA,SAASG,EAAgBC,GACxB,MAAO,CAAEH,OAAQ,QAASG,QAC3B,CAUe,MAAMC,EACZC,cAA2B,GAC3BC,aAAe,IAAIC,IACnBC,aAAe,IAAID,IAG3BE,eAA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1D,GAEpC,IAAK,IAAIoD,EAAIa,EAAe,EAAGb,EAAIL,EAAOtE,OAAQ2E,IAAK,CACtD,GAAI3B,EAAQkB,OAAOC,QAAS,OAAO,MACnCsB,EAAad,EACb,MAAMe,QAAmBpB,EAAOK,GAAG3B,GACnC,GAAI0C,IAAe,KAAM,OAAOT,EAAQS,EACzC,CACA,OAAO,IACR,CAAE,MAAO/D,GACR,IAAKqB,EAAQkB,OAAOC,QAAS,CAC5BiB,EAAIzD,MACH,GAAGV,EAAcC,EAAOuE,EAAYnB,EAAOmB,iBAA0B1F,8BACrE4B,aAAiB0D,MAAQ1D,EAAQ2D,OAAO3D,GACxC/B,GAED,MAAM+B,CACP,CACA,OAAO,KACR,CACD,CAGQqD,qBAAqBzD,GAC5B,UAAWA,IAAW,UAAW,OAAOA,EACxC,UAAWA,IAAW,UAAYA,EAAOvB,OAAS,EAAG,OAAOuB,EAC5D,GAAI1B,EAAgB0B,GAAS,OAAOA,EACpC6D,EAAIO,QAAQ,kDAAmDL,OAAO/D,GAAS3B,GAC/E,OAAO,KACR,CAGQoE,0BAA0BzC,GACjC,UAAWA,IAAW,UAAW,OAAOA,EACxC6D,EAAIO,QAAQ,4DAA6DL,OAAO/D,GAAS3B,GACzF,OAAO,KACR,EACAgC,EAAAhC,gBAAAgC,EAAA3B,gBAAA2B,EAAAlB,oBAAAkB,EAAAd,YAAA,OAAAc,CAAA","ignoreList":[],"sourceRoot":""}},{"offset":{"line":4,"column":0},"map":{"version":3,"names":["NavigationOutcome","Object","freeze","Committed","Bypassed","Blocked","Redirected","Cancelled","Error"],"sources":["./NavigationOutcome.ts"],"sourcesContent":["/**\n * Outcome of a navigation after the guard pipeline settles.\n *\n * Registered as a UI5 enum via `library.ts` so that it is discoverable\n * through `sap.ui.base.DataType.getType()`. Application code can import\n * the value object directly.\n *\n * @enum {string}\n * @namespace ui5.guard.router\n * @since 1.2.0\n */\nconst NavigationOutcome = Object.freeze({\n\t/** Navigation was allowed and the target route activated. @since 1.2.0 */\n\tCommitted: \"committed\",\n\t/** Navigation was allowed, but no route matched; UI5 continued with bypassed handling. @since 1.3.0 */\n\tBypassed: \"bypassed\",\n\t/** A guard blocked navigation, or the hash changer refused the hash change; the previous route remains active. @since 1.2.0 */\n\tBlocked: \"blocked\",\n\t/** A guard redirected navigation to a different route, or to the route that is displayed, which then does not match again. @since 1.2.0 */\n\tRedirected: \"redirected\",\n\t/** Navigation was cancelled before settling (superseded, stopped, or destroyed). @since 1.2.0 */\n\tCancelled: \"cancelled\",\n\t/** A guard threw or rejected, a redirect target had no valid hash, or applying the decision failed; the previous route remains active. @since 1.4.0 */\n\tError: \"error\",\n});\n\ntype NavigationOutcome = (typeof NavigationOutcome)[keyof typeof NavigationOutcome];\n\nexport default NavigationOutcome;\n"],"mappings":"AAAA,kFAWA,MAAMA,EAAoBC,OAAOC,OAAO,CAEvCC,UAAW,YAEXC,SAAU,WAEVC,QAAS,UAETC,WAAY,aAEZC,UAAW,YAEXC,MAAO,UACL,OAIYR,CAAiB","ignoreList":[],"sourceRoot":""}},{"offset":{"line":5,"column":0},"map":{"version":3,"names":["OPTIONAL_OR_REST_SEGMENT","stripInlineQuery","seg","mqIdx","indexOf","slice","oqIdx","patternSegments","pattern","split","map","filter","test","isPatternAncestor","ancestorPattern","candidatePattern","ancestorSegments","length","candidateSegments","every","i","candidateSeg","startsWith","depthOf","route","patternByName","get","byRouteDepth","entries","toSorted","a","b","expandToDescendants","routes","Map","r","name","expanded","entry","push","undefined","expandForNewRoute","newName","newPattern","result","__exports","__esModule"],"sources":["./PatternTree.ts"],"sourcesContent":["/**\n * Pattern-tree helpers: compare UI5 route patterns by their mandatory path segments.\n */\n\n/** Matches a standalone optional (`:param:`) or rest (`:param*:`) segment. */\nconst OPTIONAL_OR_REST_SEGMENT = /^:[^:]*:$/;\n\n/**\n * Strips inline query and optional-query suffixes from a segment.\n *\n * UI5 (crossroads.js) allows query parameters to attach directly to a\n * path segment without a `/` separator:\n * - `product{?query}` → mandatory query on `product`\n * - `product:?query:` → optional query on `product`\n * - `{id}{?query}` → mandatory param + mandatory query\n *\n * For pattern-tree ancestry we only care about the path portion,\n * so these suffixes are stripped.\n */\nfunction stripInlineQuery(seg: string): string {\n\tconst mqIdx = seg.indexOf(\"{?\");\n\tif (mqIdx !== -1) return seg.slice(0, mqIdx);\n\tconst oqIdx = seg.indexOf(\":?\");\n\tif (oqIdx !== -1) return seg.slice(0, oqIdx);\n\treturn seg;\n}\n\n/**\n * Extract mandatory path segments from a UI5 route pattern.\n *\n * Splits on `/`, strips inline query suffixes, then drops empty segments,\n * standalone optional (`:param:`), and rest (`:param*:`) segments.\n */\nexport function patternSegments(pattern: string): string[] {\n\treturn pattern\n\t\t.split(\"/\")\n\t\t.map(stripInlineQuery)\n\t\t.filter((seg) => seg !== \"\" && !OPTIONAL_OR_REST_SEGMENT.test(seg));\n}\n\n/**\n * Check if `ancestorPattern` is a URL-tree ancestor of `candidatePattern`.\n *\n * Both patterns are reduced to their mandatory path segments and compared\n * positionally. Mandatory parameter segments (`{paramA}`, `{paramB}`) are\n * treated as equivalent regardless of name, so `employees/{empId}` is\n * recognized as an ancestor of `employees/{id}/resume`.\n */\nexport function isPatternAncestor(ancestorPattern: string, candidatePattern: string): boolean {\n\tif (ancestorPattern === \"\") return true;\n\tconst ancestorSegments = patternSegments(ancestorPattern);\n\tif (ancestorSegments.length === 0) return false;\n\tconst candidateSegments = patternSegments(candidatePattern);\n\tif (candidateSegments.length <= ancestorSegments.length) return false;\n\treturn ancestorSegments.every((seg, i) => {\n\t\tconst candidateSeg = candidateSegments[i];\n\t\tif (seg === candidateSeg) return true;\n\t\treturn seg.startsWith(\"{\") && candidateSeg.startsWith(\"{\");\n\t});\n}\n\n/** A route name with its pattern. */\nexport interface RoutePattern {\n\treadonly name: string;\n\treadonly pattern: string;\n}\n\n/** Number of mandatory segments in the pattern of `route` (0 when unknown). */\nfunction depthOf(route: string, patternByName: ReadonlyMap<string, string>): number {\n\treturn patternSegments(patternByName.get(route) ?? \"\").length;\n}\n\n/**\n * Entries ordered by the pattern depth of their own route, declaration order within one depth.\n * Expanding them in this order puts an ancestor's entries before a descendant's on every route.\n */\nexport function byRouteDepth<T extends { readonly route: string }>(\n\tentries: T[],\n\tpatternByName: ReadonlyMap<string, string>,\n): T[] {\n\treturn entries.toSorted((a, b) => depthOf(a.route, patternByName) - depthOf(b.route, patternByName));\n}\n\n/**\n * Copy each route-specific entry to every descendant route (`inheritance: \"pattern-tree\"`).\n * Global (`\"*\"`) entries and entries for routes without a known pattern are kept as-is.\n * Ordered by the pattern depth of the route an entry was declared for, so on every route\n * ancestor guards run before descendant guards, whatever the declaration order. Where global\n * entries end up does not matter: the pipeline runs global guards separately.\n * A route named `\"*\"` does not pass its entries on, because a `\"*\"` entry is a global one.\n */\nexport function expandToDescendants<T extends { readonly route: string }>(entries: T[], routes: RoutePattern[]): T[] {\n\tif (routes.length === 0) return entries;\n\tconst patternByName = new Map(routes.map((r) => [r.name, r.pattern]));\n\n\tconst expanded: T[] = [];\n\tfor (const entry of byRouteDepth(entries, patternByName)) {\n\t\texpanded.push(entry);\n\t\tif (entry.route === \"*\") continue;\n\t\tconst ancestorPattern = patternByName.get(entry.route);\n\t\tif (ancestorPattern === undefined) continue;\n\t\tfor (const { name, pattern } of routes) {\n\t\t\tif (name !== entry.route && isPatternAncestor(ancestorPattern, pattern)) {\n\t\t\t\texpanded.push({ ...entry, route: name });\n\t\t\t}\n\t\t}\n\t}\n\n\treturn expanded;\n}\n\n/**\n * Entries a newly added route inherits (`inheritance: \"pattern-tree\"`): copies of its\n * ancestors' entries for the new route, and copies of its own entries for its existing\n * descendants. `routes` must include the new route. Ordered like {@link expandToDescendants};\n * where the entries go among those a route has already is up to the caller.\n */\nexport function expandForNewRoute<T extends { readonly route: string }>(\n\tentries: T[],\n\tnewName: string,\n\troutes: RoutePattern[],\n): T[] {\n\tconst patternByName = new Map(routes.map((r) => [r.name, r.pattern]));\n\tconst newPattern = patternByName.get(newName);\n\tif (newPattern === undefined) return [];\n\n\tconst result: T[] = [];\n\tfor (const entry of byRouteDepth(entries, patternByName)) {\n\t\tif (entry.route === \"*\") continue;\n\t\tif (entry.route === newName) {\n\t\t\tfor (const { name, pattern } of routes) {\n\t\t\t\tif (name !== newName && isPatternAncestor(newPattern, pattern)) {\n\t\t\t\t\tresult.push({ ...entry, route: name });\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tconst ancestorPattern = patternByName.get(entry.route);\n\t\t\tif (ancestorPattern !== undefined && isPatternAncestor(ancestorPattern, newPattern)) {\n\t\t\t\tresult.push({ ...entry, route: newName });\n\t\t\t}\n\t\t}\n\t}\n\n\treturn result;\n}\n"],"mappings":"AAAA,4EAKA,MAAMA,EAA2B,YAcjC,SAASC,EAAiBC,GACzB,MAAMC,EAAQD,EAAIE,QAAQ,MAC1B,GAAID,KAAW,EAAG,OAAOD,EAAIG,MAAM,EAAGF,GACtC,MAAMG,EAAQJ,EAAIE,QAAQ,MAC1B,GAAIE,KAAW,EAAG,OAAOJ,EAAIG,MAAM,EAAGC,GACtC,OAAOJ,CACR,CAQO,SAASK,EAAgBC,GAC/B,OAAOA,EACLC,MAAM,KACNC,IAAIT,GACJU,OAAQT,GAAQA,IAAQ,KAAOF,EAAyBY,KAAKV,GAChE,CAUO,SAASW,EAAkBC,EAAyBC,GAC1D,GAAID,IAAoB,GAAI,OAAO,KACnC,MAAME,EAAmBT,EAAgBO,GACzC,GAAIE,EAAiBC,SAAW,EAAG,OAAO,MAC1C,MAAMC,EAAoBX,EAAgBQ,GAC1C,GAAIG,EAAkBD,QAAUD,EAAiBC,OAAQ,OAAO,MAChE,OAAOD,EAAiBG,MAAM,CAACjB,EAAKkB,KACnC,MAAMC,EAAeH,EAAkBE,GACvC,GAAIlB,IAAQmB,EAAc,OAAO,KACjC,OAAOnB,EAAIoB,WAAW,MAAQD,EAAaC,WAAW,MAExD,CASA,SAASC,EAAQC,EAAeC,GAC/B,OAAOlB,EAAgBkB,EAAc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,OAChD,GAAIV,IAAoB0B,WAAa3B,EAAkBC,EAAiB6B,GAAa,CACpFC,EAAOL,KAAK,IAAKD,EAAOd,MAAOkB,GAChC,CACD,CACD,CAEA,OAAOE,CACR,CAAC,IAAAC,EAAA,CAAAC,WAAA,MAAAD,EAAAtC,kBAAAsC,EAAAhC,oBAAAgC,EAAAlB,eAAAkB,EAAAb,sBAAAa,EAAAJ,oBAAA,OAAAI,CAAA","ignoreList":[],"sourceRoot":""}},{"offset":{"line":6,"column":0},"map":{"version":3,"names":["isPatternAncestor","___PatternTree","patternSegments","EMPTY_META","Object","freeze","RouteMetaStore","_runtime","Map","_resolved","constructor","manifest","routes","this","_manifest","_routes","get","routeName","result","undefined","_resolveInherited","_resolveOwn","keys","length","set","meta","clear","invalidate","runtime","own","find","r","name","levels","filter","pattern","toSorted","a","b","map","push","merged","assign"],"sources":["./RouteMeta.ts"],"sourcesContent":["/**\n * Route metadata: manifest and runtime values per route, resolved with\n * optional pattern-tree inheritance and cached until something changes.\n */\nimport { isPatternAncestor, patternSegments, type RoutePattern } from \"./PatternTree\";\n\ntype Meta = Readonly<Record<string, unknown>>;\n\nexport const EMPTY_META: Meta = Object.freeze({});\n\nexport default class RouteMetaStore {\n\tprivate readonly _manifest: Map<string, Meta>;\n\tprivate readonly _runtime = new Map<string, Meta>();\n\tprivate readonly _resolved = new Map<string, Meta>();\n\tprivate readonly _routes: (() => RoutePattern[]) | null;\n\n\t/**\n\t * @param manifest - Frozen metadata per route from the manifest `routeMeta` block.\n\t * @param routes - Route patterns for pattern-tree inheritance, or `null` for none.\n\t */\n\tconstructor(manifest: Map<string, Meta>, routes: (() => RoutePattern[]) | null) {\n\t\tthis._manifest = manifest;\n\t\tthis._routes = routes;\n\t}\n\n\t/** Resolved metadata for a route: frozen, and the same object until something changes. */\n\tget(routeName: string): Meta {\n\t\tlet result = this._resolved.get(routeName);\n\t\tif (result === undefined) {\n\t\t\tresult = this._routes ? this._resolveInherited(routeName, this._routes()) : this._resolveOwn(routeName);\n\t\t\tif (Object.keys(result).length === 0) result = EMPTY_META;\n\t\t\tthis._resolved.set(routeName, result);\n\t\t}\n\t\treturn result;\n\t}\n\n\t/** Set runtime metadata for a route, merged over its manifest metadata. */\n\tset(routeName: string, meta: Record<string, unknown>): void {\n\t\tthis._runtime.set(routeName, Object.freeze({ ...meta }));\n\t\tthis._resolved.clear();\n\t}\n\n\t/** Drop resolved values, e.g. after a route was added that changes inheritance. */\n\tinvalidate(): void {\n\t\tthis._resolved.clear();\n\t}\n\n\t/** Drop all metadata, manifest and runtime. */\n\tclear(): void {\n\t\tthis._manifest.clear();\n\t\tthis._runtime.clear();\n\t\tthis._resolved.clear();\n\t}\n\n\t/** Manifest metadata with runtime metadata on top, without inheritance. */\n\tprivate _resolveOwn(routeName: string): Meta {\n\t\tconst manifest = this._manifest.get(routeName);\n\t\tconst runtime = this._runtime.get(routeName);\n\t\tif (!runtime) return manifest ?? EMPTY_META;\n\t\tif (!manifest) return runtime;\n\t\treturn Object.freeze({ ...manifest, ...runtime });\n\t}\n\n\t/** Ancestors' metadata shallowest-first, then the route's own; each level manifest then runtime. */\n\tprivate _resolveInherited(routeName: string, routes: RoutePattern[]): Meta {\n\t\tconst own = routes.find((r) => r.name === routeName);\n\t\tif (!own) return this._resolveOwn(routeName);\n\n\t\tconst levels = routes\n\t\t\t// Only the empty pattern counts as its own ancestor; merging a level twice changes nothing.\n\t\t\t.filter((r) => isPatternAncestor(r.pattern, own.pattern))\n\t\t\t.toSorted((a, b) => patternSegments(a.pattern).length - patternSegments(b.pattern).length)\n\t\t\t.map((r) => r.name);\n\t\tlevels.push(routeName);\n\n\t\tconst merged: Record<string, unknown> = {};\n\t\tfor (const name of levels) {\n\t\t\tObject.assign(merged, this._manifest.get(name), this._runtime.get(name));\n\t\t}\n\t\treturn Object.freeze(merged);\n\t}\n}\n"],"mappings":"AAAA,0FAAA,MAISA,EAAiBC,EAAA,2BAAEC,EAAeD,EAAA,mBAIpC,MAAME,EAAmBC,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MwB,EAAkC,CAAC,EACzC,IAAK,MAAMT,KAAQC,EAAQ,CAC1B7B,OAAOsC,OAAOD,EAAQ5B,KAAKC,UAAUE,IAAIgB,GAAOnB,KAAKN,SAASS,IAAIgB,GACnE,CACA,OAAO5B,OAAOC,OAAOoC,EACtB,EACAnC,EAAAH,aAAA,OAAAG,CAAA","ignoreList":[],"sourceRoot":""}},{"offset":{"line":7,"column":0},"map":{"version":3,"names":["NavigationOutcome","_interopRequireDefault","__NavigationOutcome","GuardPipeline","__GuardPipeline","isPromiseLike","isPromiseResolver","LOG_COMPONENT","isRecord","___GuardConfig","parseGuardRouterConfig","createLazyGuards","___GuardModules","loadGuardModules","byRouteDepth","___PatternTree","expandForNewRoute","expandToDescendants","RouteMetaStore","__RouteMetaStore","EMPTY_META","HistoryDirection","coreLibrary","routing","withoutGuardRouter","config","hidden","key","Proxy","get","target","receiver","undefined","Reflect","has","ownKeys","filter","getOwnPropertyDescriptor","isRouteGuardConfig","guard","lastStep","undoneHref","window","navigation","addEventListener","event","href","location","entry","currentEntry","navigationType","offset","index","from","IDLE","kind","MAX_REDIRECT_DEPTH","Router","MobileRouter","extend","constructor","_constructor","routes","owner","rest","isRecordConfig","guardRouter","MobileRouter.prototype.constructor.apply","this","_pipeline","_currentRoute","_currentHash","_phase","_parseGeneration","_suppressedHash","_undo","_reportedHash","_lastReport","_reportOutdated","_rootHashChanger","_stoppedRoute","_settlementResolvers","_lastSettlement","_sourceDescriptors","_manifestGuards","_destroyed","_nativeMatching","_matchWaiters","_blockLoad","_ownerComponent","_routeNames","_greedyRouteNames","_mirrorMatchingProcess","componentNamespace","appConfig","getManifestEntry","id","parsed","_options","options","_meta","routeMeta","inheritance","_collectRoutePatterns","_pendingGuardDescriptors","guards","guardLoading","uniquePaths","Set","map","d","modulePath","sap","ui","require","Object","defineProperty","_isMatching","set","matching","postponed","attachRouteMatched","_attachRouteMatched","oData","fnFunction","oListener","isInitialized","push","MobileRouter.prototype.attachRouteMatched.call","_settleMatchWaiters","waiters","resolve","initialize","_initialize","bIgnoreInitialHash","start","ignoreInitialHash","length","_start","descriptors","source","expandedDescriptors","_registerLazyGuards","blockLoad","then","results","descriptor","fn","_registerManifestGuard","starting","getHashChanger","attachEvent","_onHashReported","HashChanger","getInstance","_onRootHashChanged","MobileRouter.prototype.initialize.call","shownHash","getHash","newHash","getParameter","shown","oldHash","hashChanger","_completeUndo","detachEvent","queueMicrotask","undo","first","fullHash","awaitsReport","_replaceFullHash","addRoute","_addRoute","oConfig","oParent","MobileRouter.prototype.addRoute.call","name","includes","greedy","invalidate","patterns","declared","Map","r","pattern","rankOf","findIndex","rank","next","route","type","toSorted","a","b","addGuard","_addGuard","_isFn","addGlobalGuard","removeGuard","_removeGuard","removeGlobalGuard","addRouteGuard","_addRouteGuard","routeName","_handleUnknownRouteRegistration","hasHandler","beforeEnter","addEnterGuard","beforeLeave","addLeaveGuard","Log","info","removeRouteGuard","_removeRouteGuard","removeLeaveGuard","removeEnterGuard","_addLeaveGuard","_resolveNavToArgs","componentTargetInfoOrReplace","replaceOrOptions","replace","guardOptions","componentTargetInfo","value","method","detail","warning","methodName","kept","getRoute","unknownRouteRegistration","Error","_removeLeaveGuard","getRouteMeta","_getRouteMeta","setRouteMeta","_setRouteMeta","meta","navigationSettled","_navigationSettled","Promise","status","Committed","hash","attachNavigationSettled","_attachNavigationSettled","detachNavigationSettled","_detachNavigationSettled","_flushSettlement","result","debug","resolvers","fireEvent","error","String","navTo","_navTo","parameters","origin","MobileRouter.prototype.navTo.call","_cancelPendingNavigation","targetHash","getURL","routeInfo","_matchRoute","toRoute","skipGuards","navToPreflight","attempt","restoreHash","_pendingRestoresHash","_navigateAllowed","_startAttempt","generation","context","_createGuardContext","controller","signal","decision","_evaluateGuards","_applyWhenDecided","_applyPreflightDecision","bag","bReplace","writtenOver","_commitAfterNavTo","_blockNavigation","action","_startRedirectChain","_errorNavigation","parse","_parse","MobileRouter.prototype.parse.call","reported","started","_finishRestore","phase","commit","_commitNavigation","currentHash","pendingUndo","undoing","_describeUndo","direction","History","getDirection","_applyDecision","stop","_stop","_detachHashListeners","MobileRouter.prototype.stop.call","pendingRestoresHash","abort","_settleUncommitted","Cancelled","AbortController","apply","attemptedHash","lastSettlement","_alignTitleHistory","NewEntry","Forwards","Backwards","titles","getTitleHistory","left","at","replaced","isHome","title","splice","wasRedirect","Redirected","Bypassed","keys","_redirect","chain","targetName","targetRoute","visited","join","size","add","_applyRedirectDecision","hashShown","getRouteInfoByHash","arguments","_greedyMatches","firstMatch","match","redirectHop","evaluate","skipLeaveGuards","alsoLeaving","fromHash","fromRoute","alsoEntering","toHash","toArguments","toMeta","fromMeta","ownerComponent","Blocked","whenBack","loadDefaultRoute","_undoHashChange","_restoreHash","pending","step","rootHash","history","go","replaceHash","Unknown","suppressParse","getPattern","guardFn","before","err","destroy","_destroy","clear","MobileRouter.prototype.destroy.call"],"sources":["./Router.ts"],"sourcesContent":["import MobileRouter from \"sap/m/routing/Router\";\nimport Log from \"sap/base/Log\";\nimport coreLibrary from \"sap/ui/core/library\";\nimport HashChanger from \"sap/ui/core/routing/HashChanger\";\nimport History from \"sap/ui/core/routing/History\";\nimport type { HashChangerBase$HashChangedEvent } from \"sap/ui/core/routing/HashChangerBase\";\nimport type { ComponentTargetParameters, RouteInfo, Router$RouteMatchedEvent } from \"sap/ui/core/routing/Router\";\nimport type Route from \"sap/ui/core/routing/Route\";\nimport type { $RouteSettings } from \"sap/ui/core/routing/Route\";\nimport type UIComponent from \"sap/ui/core/UIComponent\";\nimport type {\n\tGuardFn,\n\tGuardContext,\n\tGuardNavToOptions,\n\tGuardRedirect,\n\tGuardRouter,\n\tGuardRouterConfig,\n\tLeaveGuardFn,\n\tNavigationResult,\n\tRouter$NavigationSettledEvent,\n\tRouteGuardConfig,\n} from \"./types\";\nimport NavigationOutcome from \"./NavigationOutcome\";\nimport GuardPipeline, { type GuardDecision, isPromiseLike, isPromiseResolver, LOG_COMPONENT } from \"./GuardPipeline\";\nimport { type GuardDescriptor, isRecord, parseGuardRouterConfig, type ResolvedGuardRouterOptions } from \"./GuardConfig\";\nimport { createLazyGuards, loadGuardModules } from \"./GuardModules\";\nimport { byRouteDepth, expandForNewRoute, expandToDescendants, type RoutePattern } from \"./PatternTree\";\nimport RouteMetaStore, { EMPTY_META } from \"./RouteMeta\";\n\nconst HistoryDirection = coreLibrary.routing.HistoryDirection;\ntype Direction = ReturnType<History[\"getDirection\"]>;\n\n/**\n * The router config as UI5 gets it: the caller's object without `guardRouter`. It is a view and\n * not a copy, because UIComponent adds `targetParent` (the ID of the root view) to its config\n * object after it has constructed the router, and the native router reads it from that object.\n */\nfunction withoutGuardRouter(config: object): object {\n\tconst hidden = (key: PropertyKey): boolean => key === \"guardRouter\";\n\treturn new Proxy(config, {\n\t\tget: (target, key, receiver): unknown => (hidden(key) ? undefined : Reflect.get(target, key, receiver)),\n\t\thas: (target, key) => !hidden(key) && Reflect.has(target, key),\n\t\townKeys: (target) => Reflect.ownKeys(target).filter((key) => !hidden(key)),\n\t\tgetOwnPropertyDescriptor: (target, key) =>\n\t\t\thidden(key) ? undefined : Reflect.getOwnPropertyDescriptor(target, key),\n\t});\n}\n\nfunction isRouteGuardConfig(guard: GuardFn | RouteGuardConfig): guard is RouteGuardConfig {\n\treturn typeof guard === \"object\" && guard !== null;\n}\n\n/** A step through the browser history (back, forward): how far it went, and the URL it arrived at. */\ninterface HistoryStep {\n\treadonly offset: number;\n\treadonly href: string;\n}\n\n/** The step through the browser history that brought the browser to the URL it shows, if a step did. */\nlet lastStep: HistoryStep | null = null;\n/** The URL of a step that a router is taking back, until the browser reports the next URL change. */\nlet undoneHref: string | null = null;\n\n// The Navigation API tells how far a step through the history went, before UI5 learns of the\n// hash change. UI5's History only infers it, and wrongly once an entry lacks its state. Without\n// the API (Firefox before 147, Safari before 26.2) no step is known and the entry is replaced.\nwindow.navigation?.addEventListener(\"currententrychange\", (event) => {\n\tconst href = window.location.href;\n\tif (undoneHref !== href) undoneHref = null;\n\tconst entry = window.navigation.currentEntry;\n\tif (entry && event.navigationType === \"traverse\") {\n\t\tlastStep = { offset: entry.index - event.from.index, href };\n\t} else if (lastStep?.href !== href) {\n\t\t// Not an entry whose state alone is replaced, as UI5's History does after a step.\n\t\tlastStep = null;\n\t}\n});\n\n/** What it takes to undo the hash change that an uncommitted navigation arrived with. */\ninterface HashChangeUndo {\n\t/** The hash of the root hash changer after the first change that this takes back. */\n\treadonly first: string;\n\t/**\n\t * The hash of the root hash changer before that change, with the hashes of nested routers.\n\t * The root hash changer reports it with the change, after the routers have parsed their part.\n\t */\n\tfullHash: string | undefined;\n\t/** The hash of the root hash changer after the change. */\n\treadonly shown: string;\n\t/** Whether the router has started to put the URL back, and the hash change that does it is still to come. */\n\tstarted: boolean;\n\t/** The step through the browser history that the change was, if it was one. */\n\treadonly step: HistoryStep | null;\n}\n\n/** A manifest guard entry of a route, with the declared entry it stems from: itself, or the entry of an ancestor route. */\ninterface ManifestGuardDescriptor extends GuardDescriptor {\n\treadonly source: GuardDescriptor;\n}\n\n/** Snapshot of an in-flight navigation being evaluated by the guard pipeline. */\ninterface NavigationAttempt {\n\treadonly hash: string;\n\treadonly controller: AbortController;\n\treadonly generation: number;\n\t/** Whether the URL shows a hash that never committed, so that it must be restored unless this attempt moves it. */\n\treadonly restoreHash: boolean;\n\t/** How the browser got to the hash that started the navigation; `undefined` after `navTo()` or `parse()`. */\n\treadonly direction: Direction | undefined;\n}\n\ninterface PhaseIdle {\n\treadonly kind: \"idle\";\n}\n\ninterface PhaseEvaluating {\n\treadonly kind: \"evaluating\";\n\treadonly attempt: NavigationAttempt;\n\t/** Whether the navigation waits for async guards: the native router would be matching its route by now. */\n\treadonly postponed?: true;\n}\n\ninterface PhaseCommitting {\n\treadonly kind: \"committing\";\n\treadonly route: string;\n\t/** The hash of the route: `parse()` commits the navigation when it receives this hash. */\n\treadonly hash: string;\n\treadonly origin: \"preflight\" | \"redirect\" | \"parse\";\n\t/** How the browser got to the history entry that the route replaces (see {@link RedirectChainContext.direction}). */\n\treadonly direction?: Direction;\n\t/** Whether the URL showed a hash that never committed when `navTo()` wrote the hash (see {@link NavigationAttempt.restoreHash}). */\n\treadonly restoreHash: boolean;\n\t/** What the root hash changer showed before `navTo()` wrote the hash: the write is undone with it. */\n\treadonly writtenOver?: string;\n}\n\n/**\n * An allowed navigation waits for UI5 to write its hash. With component targets UI5 does that\n * once the nested components are loaded, and never if one of them fails to load.\n */\ninterface PhaseAwaitingHash {\n\treadonly kind: \"awaitingHash\";\n\t/** The phase that commits the navigation when `parse()` receives its hash. */\n\treadonly commit: PhaseCommitting;\n}\n\n/** A navigation that did not commit waits for the URL to be back before it settles. */\ninterface PhaseRestoring {\n\treadonly kind: \"restoring\";\n\treadonly result: NavigationResult;\n\t/** Whether the previous hash is written once UI5 has reported the hash change to every router. */\n\treadonly awaitsReport?: true;\n\t/** What a redirect to the route that is shown still has to do once the navigation has settled. */\n\treadonly whenBack?: () => void;\n}\n\ntype RouterPhase = PhaseIdle | PhaseEvaluating | PhaseCommitting | PhaseAwaitingHash | PhaseRestoring;\n\nconst IDLE: PhaseIdle = { kind: \"idle\" };\n\n/** Maximum number of hops in a redirect chain before it is treated as a loop. */\nconst MAX_REDIRECT_DEPTH = 10;\n\n/** State threaded through a redirect chain. */\ninterface RedirectChainContext {\n\t/** Hashes whose guards have been evaluated in this chain (mutated via .add()). */\n\tvisited: Set<string>;\n\t/** Hash of the originally attempted navigation (for settlement / hash restore). */\n\treadonly attemptedHash: string | undefined;\n\t/** Whether to restore the hash on block (see {@link NavigationAttempt.restoreHash}). */\n\treadonly restoreHash: boolean;\n\t/** Original source route (the route the user occupies). */\n\treadonly fromRoute: string;\n\t/** Original source hash (the hash the user occupies). */\n\treadonly fromHash: string;\n\t/** Whether the target replaces the current history entry: as the `navTo()` call asked, always after a hash change. */\n\treadonly replace: boolean | undefined;\n\t/**\n\t * How the browser got to the history entry that the target replaces, for the title history\n\t * of UI5 (see {@link Router._alignTitleHistory}); `undefined` after `navTo()` or `parse()`.\n\t */\n\treadonly direction: Direction | undefined;\n\t/** Shared AbortSignal from the original navigation. */\n\treadonly signal: AbortSignal;\n\t/** Shared generation counter from the original navigation. */\n\treadonly generation: number;\n\t/** Shared bag from the original navigation's guard context. */\n\treadonly bag: Map<string, unknown>;\n}\n\n/**\n * Router with navigation guard support.\n *\n * Extends `sap.m.routing.Router` with a shared guard pipeline that\n * evaluates registered guard functions before route matching, target\n * loading, or event firing occurs.\n *\n * Two entry points feed the same pipeline:\n * - `navTo()` runs guards as a preflight check. A blocked navigation\n * never changes the hash; a redirected one only writes its final target.\n * - `parse()` runs guards as a fallback for browser back/forward, URL\n * bar entry, and direct hash changes where the hash has already changed\n * before guards can intercept.\n *\n * Key assumptions (see docs/reference/architecture.md for full rationale):\n * - `parse()` is intentionally NOT async. Sync guards execute in the\n * same tick; async guards fall back to a deferred path.\n * - `replaceHash` fires `hashChanged` synchronously (validated by test).\n * - `setHash` (via `super.navTo`) fires `hashChanged` synchronously (validated by test).\n * - Redirect targets are evaluated by the guard pipeline with loop detection.\n *\n * @namespace ui5.guard.router\n * @extends sap.m.routing.Router\n */\nexport default class Router extends MobileRouter implements GuardRouter {\n\tprivate _options: ResolvedGuardRouterOptions;\n\tprivate _pipeline = new GuardPipeline();\n\tprivate _currentRoute = \"\";\n\tprivate _currentHash: string | null = null;\n\tprivate _phase: RouterPhase = IDLE;\n\tprivate _parseGeneration = 0;\n\tprivate _suppressedHash: string | null = null;\n\t/** How to undo the hash change of the pending navigation (see {@link _undoHashChange}). */\n\tprivate _undo: HashChangeUndo | null = null;\n\t/** The hash that the hash changer of this router is reporting, until `parse()` receives it. */\n\tprivate _reportedHash: unknown = null;\n\t/** The hash that the hash changer of this router reported last, reports that are out of date aside. */\n\tprivate _lastReport: unknown = null;\n\t/** Whether the hash changer shows a later hash than the one it is reporting (see {@link _onHashReported}). */\n\tprivate _reportOutdated = false;\n\t/** The global hash changer that {@link _onRootHashChanged} is attached to, behind the listener of UI5 that informs the routers. */\n\tprivate _rootHashChanger: HashChanger | null = null;\n\t/** The route that was current when the router stopped: `initialize(true)` resumes it, as UI5 does. */\n\tprivate _stoppedRoute = \"\";\n\tprivate _settlementResolvers: ((result: NavigationResult) => void)[] = [];\n\tprivate _lastSettlement: NavigationResult | null = null;\n\tprivate _pendingGuardDescriptors: GuardDescriptor[];\n\tprivate _sourceDescriptors: ManifestGuardDescriptor[] = [];\n\t/** The manifest guards registered for a route, by which `addRoute()` places the guards a route inherits then. */\n\tprivate _manifestGuards: { descriptor: ManifestGuardDescriptor; fn: GuardFn }[] = [];\n\tprivate _destroyed = false;\n\t/** What UI5 itself wrote to `_bMatchingProcessStarted` (see {@link _mirrorMatchingProcess}). */\n\tprivate _nativeMatching = false;\n\t/** Promises that wait for the `routeMatched` of a match that has not started (see {@link attachRouteMatched}). */\n\tprivate _matchWaiters: (() => void)[] = [];\n\t/**\n\t * Set while block-mode guard modules load; `start` says whether to initialize once they have,\n\t * `ignoreInitialHash` is the argument of the `initialize()` call that asked for it.\n\t */\n\tprivate _blockLoad: { start: boolean; ignoreInitialHash?: boolean } | null = null;\n\tprivate _meta: RouteMetaStore;\n\t/** Recorded by `addRoute()`, which the UI5 constructor calls before field setup; `declare` keeps field setup from resetting it. */\n\tdeclare private _routeNames: string[];\n\t/** Routes that also match when an earlier route has matched the hash (`greedy: true`). */\n\tdeclare private _greedyRouteNames: string[];\n\tprivate readonly _ownerComponent: UIComponent | undefined;\n\n\tconstructor(routes?: object | object[], config?: GuardRouterConfig, owner?: UIComponent, targetsConfig?: object);\n\tconstructor(\n\t\troutes?: object | object[],\n\t\tconfig?: GuardRouterConfig,\n\t\towner?: UIComponent,\n\t\t...rest: [targetsConfig?: object]\n\t) {\n\t\tconst isRecordConfig = isRecord(config);\n\t\tconst guardRouter = isRecordConfig ? config.guardRouter : undefined;\n\t\t// UI5 passes more than its types declare: after the targets config comes the\n\t\t// hash changer of a component that is loaded as a routing target.\n\t\tsuper(routes, isRecordConfig ? withoutGuardRouter(config) : config, owner, ...rest);\n\t\tthis._ownerComponent = owner;\n\t\t// A config without routes has made no addRoute() call.\n\t\tthis._routeNames ??= [];\n\t\tthis._greedyRouteNames ??= [];\n\t\tthis._mirrorMatchingProcess();\n\t\tlet componentNamespace = \"\";\n\t\tconst appConfig: unknown = owner?.getManifestEntry(\"sap.app\");\n\t\tif (isRecord(appConfig) && typeof appConfig.id === \"string\") {\n\t\t\tcomponentNamespace = appConfig.id;\n\t\t}\n\t\tconst parsed = parseGuardRouterConfig(guardRouter, componentNamespace);\n\t\tthis._options = parsed.options;\n\t\tthis._meta = new RouteMetaStore(\n\t\t\tparsed.routeMeta,\n\t\t\tthis._options.inheritance === \"pattern-tree\" ? () => this._collectRoutePatterns() : null,\n\t\t);\n\t\tthis._pendingGuardDescriptors = parsed.guards;\n\n\t\t// Fire-and-forget preload hint: a module cached by initialize()\n\t\t// needs no async load on navigation (see _registerLazyGuards).\n\t\t// Block mode loads modules itself in initialize().\n\t\tif (this._options.guardLoading === \"lazy\") {\n\t\t\tconst uniquePaths = [...new Set(this._pendingGuardDescriptors.map((d) => d.modulePath))];\n\t\t\t// A failed preload is reported when the guard runs: its lazy load warns\n\t\t\t// and the navigation settles as Error.\n\t\t\tsap.ui.require(uniquePaths, undefined, () => {});\n\t\t}\n\t}\n\n\t/**\n\t * Report a navigation that waits for async guards as a route match in progress, through the\n\t * UI5-private member `_bMatchingProcessStarted` of `sap.ui.core.routing.Router`. UI5 reads it\n\t * to tell whether the router of a nested component is still matching; without this, a parent\n\t * route would count the component as displayed before its first route matched. The router does\n\t * not write the member: it replaces it with an accessor that keeps what UI5 writes in\n\t * {@link _nativeMatching} and also reads `true` while a navigation is postponed.\n\t *\n\t * See docs/reference/architecture.md (\"UI5 Internals the Router Relies On\") for the UI5 code this\n\t * relies on, and docs/reference/upstream-parity.md for the tests that pin it.\n\t */\n\tprivate _mirrorMatchingProcess(): void {\n\t\tObject.defineProperty(this, \"_bMatchingProcessStarted\", {\n\t\t\tget: () => this._isMatching(),\n\t\t\tset: (matching: boolean) => {\n\t\t\t\tthis._nativeMatching = matching;\n\t\t\t},\n\t\t});\n\t}\n\n\t/** Whether a route match is in progress: in UI5, or postponed until async guards have decided. */\n\tprivate _isMatching(): boolean {\n\t\treturn this._nativeMatching || (this._phase.kind === \"evaluating\" && this._phase.postponed === true);\n\t}\n\n\t/**\n\t * Attach an event handler for the `routeMatched` event, as the native router does. In addition,\n\t * remember a Promise resolve function ({@link isPromiseResolver}) that is subscribed while the\n\t * router is not initialized or a match is in progress: that is how a UI5 component target\n\t * waits for this router. UI5 relies on a match always ending in `routeMatched`, which a\n\t * navigation that guards block, fail or cancel never fires, so {@link _settleMatchWaiters}\n\t * resolves the Promise then. Application code that subscribes a Promise resolve function under\n\t * the same condition is treated alike.\n\t *\n\t * See docs/reference/architecture.md (\"UI5 Internals the Router Relies On\") for the UI5 code this\n\t * relies on, and docs/reference/upstream-parity.md for the tests that pin it.\n\t *\n\t * @override sap.ui.core.routing.Router#attachRouteMatched\n\t * @since 1.7.0\n\t */\n\toverride attachRouteMatched(\n\t\toData: object,\n\t\tfnFunction: (evt: Router$RouteMatchedEvent) => void,\n\t\toListener?: object,\n\t): this;\n\toverride attachRouteMatched(fnFunction: (evt: Router$RouteMatchedEvent) => void, oListener?: object): this;\n\toverride attachRouteMatched(\n\t\toData: object,\n\t\tfnFunction: (evt: Router$RouteMatchedEvent) => void,\n\t\toListener?: object,\n\t): this {\n\t\tif (isPromiseResolver(oData) && (!this.isInitialized() || this._isMatching())) {\n\t\t\tthis._matchWaiters.push(oData);\n\t\t}\n\t\t// The arguments go on as received: EventProvider#attachEvent tells the two call forms apart.\n\t\treturn super.attachRouteMatched(oData, fnFunction, oListener);\n\t}\n\n\t/**\n\t * Decide what becomes of the Promises that wait for a `routeMatched`\n\t * (see {@link attachRouteMatched}). Runs in a microtask after a settlement, so that a commit\n\t * has reached `super.parse()` and a navigation that supersedes the settled one has started:\n\t * - A navigation waits for async guards: the Promises keep waiting, for its settlement.\n\t * - UI5 is matching a route: the Promises are forgotten, the `routeMatched` of that match\n\t * resolves them. If UI5 never fires it, because the display of a target fails, they wait\n\t * forever, as with the native router.\n\t * - Otherwise no match is coming, and the Promises are resolved.\n\t *\n\t * A navigation that starts after this microtask is not waited for. A Promise that is resolved\n\t * here stays subscribed, and UI5 calls it again with the next `routeMatched`, which has no\n\t * effect on a Promise.\n\t */\n\tprivate _settleMatchWaiters(): void {\n\t\tif (this._phase.kind === \"evaluating\" && this._phase.postponed) return;\n\t\tconst waiters = this._matchWaiters;\n\t\tthis._matchWaiters = [];\n\t\tif (this._nativeMatching) return;\n\t\tfor (const resolve of waiters) resolve();\n\t}\n\n\t/**\n\t * Initialize the router. When manifest guards are declared and\n\t * `guardLoading` is `\"block\"`, module loading starts and\n\t * `super.initialize()` is deferred until all modules are loaded.\n\t * In `\"lazy\"` mode, lazy wrappers are registered synchronously\n\t * and `super.initialize()` is called immediately.\n\t *\n\t * While block-mode modules load, the router is not initialized yet:\n\t * calling `initialize()` again changes nothing, and `stop()` cancels\n\t * the pending start until `initialize()` is called again.\n\t *\n\t * @param bIgnoreInitialHash - Whether the current hash is left unparsed, as in the native router (since 1.7.0).\n\t * @override sap.ui.core.routing.Router#initialize\n\t * @since 1.0.1\n\t */\n\toverride initialize(bIgnoreInitialHash?: boolean): this {\n\t\tif (this._blockLoad) {\n\t\t\tif (!this._blockLoad.start) {\n\t\t\t\tthis._blockLoad.start = true;\n\t\t\t\tthis._blockLoad.ignoreInitialHash = bIgnoreInitialHash;\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\t\tif (this._pendingGuardDescriptors.length === 0) {\n\t\t\treturn this._start(bIgnoreInitialHash);\n\t\t}\n\n\t\tconst descriptors = this._pendingGuardDescriptors.map((source) => ({ ...source, source }));\n\t\tthis._pendingGuardDescriptors = [];\n\t\tthis._sourceDescriptors = descriptors;\n\n\t\tconst expandedDescriptors =\n\t\t\tthis._options.inheritance === \"pattern-tree\"\n\t\t\t\t? expandToDescendants(descriptors, this._collectRoutePatterns())\n\t\t\t\t: descriptors;\n\n\t\tif (this._options.guardLoading === \"lazy\") {\n\t\t\tthis._registerLazyGuards(expandedDescriptors);\n\t\t\treturn this._start(bIgnoreInitialHash);\n\t\t}\n\n\t\t// \"block\" mode: load all modules, then register their guards in declaration order\n\t\t// and initialize. Load and registration failures are logged per module and never\n\t\t// reject. A router destroyed while modules load stays destroyed.\n\t\tconst blockLoad = { start: true, ignoreInitialHash: bIgnoreInitialHash };\n\t\tthis._blockLoad = blockLoad;\n\t\tvoid loadGuardModules(expandedDescriptors).then((results) => {\n\t\t\tthis._blockLoad = null;\n\t\t\tif (this._destroyed) return;\n\t\t\tfor (const { descriptor, guards } of results) {\n\t\t\t\tfor (const fn of guards) this._registerManifestGuard(descriptor, fn);\n\t\t\t}\n\t\t\tif (blockLoad.start) this._start(blockLoad.ignoreInitialHash);\n\t\t});\n\t\treturn this;\n\t}\n\n\t/**\n\t * Start the native router. With `ignoreInitialHash` it parses nothing and resumes the route\n\t * that was displayed when the router stopped. That route is the current one again, on the hash\n\t * that the URL shows now, so that its leave guards run and a blocked hash change returns to it.\n\t */\n\tprivate _start(ignoreInitialHash?: boolean): this {\n\t\t// UI5 only warns about a router that is initialized already.\n\t\tconst starting = !this.isInitialized();\n\t\tif (starting) {\n\t\t\t// Before the listener of UI5 that calls parse(), which initialize() attaches.\n\t\t\tthis.getHashChanger().attachEvent(\"hashChanged\", this._onHashReported, this);\n\t\t\t// After the listener of UI5 that informs the routers, which is attached with the hash\n\t\t\t// changer of the first router: UI5 has reported a hash change to every router when\n\t\t\t// this one runs.\n\t\t\tthis._rootHashChanger = HashChanger.getInstance();\n\t\t\tthis._rootHashChanger.attachEvent(\"hashChanged\", this._onRootHashChanged, this);\n\t\t}\n\t\tsuper.initialize(ignoreInitialHash);\n\t\tif (starting && ignoreInitialHash) {\n\t\t\t// UI5 has reset the hash of the hash changer if a target was displayed without a route.\n\t\t\tconst shownHash: string | undefined = this.getHashChanger().getHash();\n\t\t\tthis._currentRoute = this._stoppedRoute;\n\t\t\tthis._currentHash = shownHash ?? null;\n\t\t}\n\t\treturn this;\n\t}\n\n\t/**\n\t * The hash changer of this router reports a hash change: `parse()` is called with it next.\n\t *\n\t * The report is out of date if the hash changer shows a later hash by now, one that it has\n\t * reported to this router already. That happens to a router that shares its hash changer, as\n\t * the routers of all components that are not routing targets do: a router that is informed\n\t * first redirects the hash, UI5 reports the target to every router, and only then the hash\n\t * that was redirected to the routers that are informed later. A hash changer that reports\n\t * while a parent router collects the hashes of a navigation shows no hash at all.\n\t */\n\tprivate _onHashReported(event: HashChangerBase$HashChangedEvent): void {\n\t\t// A string, which the UI5 types declare as an object.\n\t\tconst newHash: unknown = event.getParameter(\"newHash\");\n\t\tconst shown: unknown = this.getHashChanger().getHash();\n\t\tthis._reportedHash = newHash;\n\t\tthis._reportOutdated = shown !== newHash && shown === this._lastReport;\n\t\tif (!this._reportOutdated) this._lastReport = newHash;\n\t}\n\n\t/**\n\t * UI5 has reported a hash change to every router. The event tells what the URL showed before\n\t * the change, which is what undoes it. A snapshot of the URL taken at any other time would not\n\t * do: the URL also changes without an event, as when the Fiori launchpad puts it back after\n\t * a cross-app navigation that the user cancelled. A navigation that waited for this to put\n\t * the URL back does so now (see {@link _undoHashChange}).\n\t */\n\tprivate _onRootHashChanged(event: HashChangerBase$HashChangedEvent): void {\n\t\t// A string, which the UI5 types declare as an object.\n\t\tconst newHash: unknown = event.getParameter(\"newHash\");\n\t\t// Only the first hash change that the page reports has no previous hash.\n\t\tconst oldHash = event.getParameter(\"oldHash\") ?? \"\";\n\t\tconst hashChanger = HashChanger.getInstance();\n\t\tif (hashChanger === this._rootHashChanger) {\n\t\t\tthis._completeUndo(newHash, oldHash);\n\t\t\treturn;\n\t\t}\n\t\t// The global hash changer was replaced (HashChanger.replaceHashChanger(), as the shell of\n\t\t// the Fiori launchpad does). UI5 has moved this listener to the new one, in front of its\n\t\t// listener that informs the routers. From the next hash change on it runs behind again;\n\t\t// for this one, the routers are informed once this listener has returned.\n\t\thashChanger.detachEvent(\"hashChanged\", this._onRootHashChanged, this);\n\t\thashChanger.attachEvent(\"hashChanged\", this._onRootHashChanged, this);\n\t\tthis._rootHashChanger = hashChanger;\n\t\tqueueMicrotask(() => this._completeUndo(newHash, oldHash));\n\t}\n\n\t/**\n\t * Tell the undo of the pending navigation what the URL showed before the hash change\n\t * `newHash`, and put the URL back if the navigation waited for that.\n\t */\n\tprivate _completeUndo(newHash: unknown, oldHash: string): void {\n\t\tconst undo = this._undo;\n\t\tif (!undo || undo.first !== newHash) return;\n\t\tundo.fullHash ??= oldHash;\n\t\tif (this._phase.kind === \"restoring\" && this._phase.awaitsReport) this._replaceFullHash(undo.fullHash);\n\t}\n\n\t/**\n\t * Add a route dynamically and integrate it into pattern-tree inheritance.\n\t *\n\t * Appends the route name to the internal route list so that\n\t * `_collectRoutePatterns()` includes it in subsequent inheritance\n\t * lookups, clears the metadata cache, and registers any inherited\n\t * manifest guards when `inheritance` is `\"pattern-tree\"`: on every\n\t * route, ancestor guards still run before descendant guards.\n\t *\n\t * @param oConfig - Route configuration object as defined by `sap.ui.core.routing.Route`.\n\t * @param oParent - Optional parent route, forwarded to the parent `addRoute`.\n\t * @override sap.ui.core.routing.Router#addRoute\n\t * @since 1.6.0\n\t */\n\toverride addRoute(oConfig: $RouteSettings, oParent?: Route): void {\n\t\tsuper.addRoute(oConfig, oParent);\n\n\t\tconst name = oConfig.name;\n\t\tthis._routeNames ??= [];\n\t\tthis._greedyRouteNames ??= [];\n\t\tif (this._routeNames.includes(name)) return;\n\n\t\tthis._routeNames.push(name);\n\t\tif (oConfig.greedy) this._greedyRouteNames.push(name);\n\t\t// The UI5 constructor adds the routes of the config before this constructor sets up the rest.\n\t\tif (!this._meta) return;\n\t\tthis._meta.invalidate();\n\n\t\tif (this._options.inheritance !== \"pattern-tree\") return;\n\n\t\tconst patterns = this._collectRoutePatterns();\n\t\tconst declared = byRouteDepth(this._sourceDescriptors, new Map(patterns.map((r) => [r.name, r.pattern])));\n\t\tconst rankOf = (descriptor: ManifestGuardDescriptor): number =>\n\t\t\tdeclared.findIndex((entry) => entry.source === descriptor.source);\n\n\t\t// Always use lazy registration: if the module was loaded during\n\t\t// initialize() (block mode), the sync cache probe succeeds immediately.\n\t\t// This avoids an async gap between addRoute() and the first navigation.\n\t\tfor (const descriptor of expandForNewRoute(this._sourceDescriptors, name, patterns)) {\n\t\t\t// Ancestor guards run first: the new guards go before the manifest guards of the route\n\t\t\t// that stem from an entry of a deeper route, or from a later entry of the same depth.\n\t\t\tconst rank = rankOf(descriptor);\n\t\t\tconst next = this._manifestGuards\n\t\t\t\t.filter(\n\t\t\t\t\t(guard) =>\n\t\t\t\t\t\tguard.descriptor.route === descriptor.route &&\n\t\t\t\t\t\tguard.descriptor.type === descriptor.type &&\n\t\t\t\t\t\trankOf(guard.descriptor) > rank,\n\t\t\t\t)\n\t\t\t\t.toSorted((a, b) => rankOf(a.descriptor) - rankOf(b.descriptor))[0];\n\t\t\tfor (const fn of createLazyGuards(descriptor)) this._registerManifestGuard(descriptor, fn, next?.fn);\n\t\t}\n\t}\n\n\t/**\n\t * Register a global guard that runs for every navigation.\n\t *\n\t * @param guard - Guard function to register. Non-functions are ignored with a warning.\n\t * @returns `this` for chaining.\n\t * @since 1.0.1\n\t */\n\taddGuard(guard: GuardFn): this {\n\t\tif (!this._isFn(guard, \"addGuard\")) return this;\n\t\tthis._pipeline.addGlobalGuard(guard);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Remove a previously registered global guard.\n\t *\n\t * @param guard - Guard function to remove by reference. Non-functions are ignored with a warning.\n\t * @returns `this` for chaining.\n\t * @since 1.0.1\n\t */\n\tremoveGuard(guard: GuardFn): this {\n\t\tif (!this._isFn(guard, \"removeGuard\")) return this;\n\t\tthis._pipeline.removeGlobalGuard(guard);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Register a guard for a specific route.\n\t *\n\t * Accepts either a guard function (registered as an enter guard) or a\n\t * configuration object with `beforeEnter` and/or `beforeLeave` guards.\n\t *\n\t * @param routeName - Route name as defined in `manifest.json`. If the route is unknown, the {@link GuardRouterOptions.unknownRouteRegistration} policy applies (default: warn).\n\t * @param guard - Guard function or {@link RouteGuardConfig} object.\n\t * @returns `this` for chaining.\n\t * @since 1.0.1\n\t */\n\taddRouteGuard(routeName: string, guard: GuardFn | RouteGuardConfig): this {\n\t\tif (isRouteGuardConfig(guard)) {\n\t\t\tthis._handleUnknownRouteRegistration(routeName, \"addRouteGuard\");\n\t\t\tlet hasHandler = false;\n\n\t\t\tif (guard.beforeEnter !== undefined) {\n\t\t\t\thasHandler = true;\n\t\t\t\tif (this._isFn(guard.beforeEnter, \"addRouteGuard\", routeName)) {\n\t\t\t\t\tthis._pipeline.addEnterGuard(routeName, guard.beforeEnter);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (guard.beforeLeave !== undefined) {\n\t\t\t\thasHandler = true;\n\t\t\t\tif (this._isFn(guard.beforeLeave, \"addRouteGuard\", routeName)) {\n\t\t\t\t\tthis._pipeline.addLeaveGuard(routeName, guard.beforeLeave);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!hasHandler) {\n\t\t\t\tLog.info(\"addRouteGuard: config has no beforeEnter or beforeLeave\", routeName, LOG_COMPONENT);\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\t\tif (!this._isFn(guard, \"addRouteGuard\", routeName)) return this;\n\t\tthis._handleUnknownRouteRegistration(routeName, \"addRouteGuard\");\n\t\tthis._pipeline.addEnterGuard(routeName, guard);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Remove a guard from a specific route.\n\t *\n\t * Accepts the same forms as `addRouteGuard`: a guard function removes\n\t * an enter guard; a configuration object removes `beforeEnter` and/or\n\t * `beforeLeave` by reference.\n\t *\n\t * @param routeName - Route name as defined in `manifest.json`.\n\t * @param guard - Guard function or {@link RouteGuardConfig} object to remove by reference.\n\t * @returns `this` for chaining.\n\t * @since 1.0.1\n\t */\n\tremoveRouteGuard(routeName: string, guard: GuardFn | RouteGuardConfig): this {\n\t\tif (isRouteGuardConfig(guard)) {\n\t\t\tif (typeof guard.beforeEnter === \"function\") {\n\t\t\t\tthis.removeRouteGuard(routeName, guard.beforeEnter);\n\t\t\t}\n\t\t\tif (typeof guard.beforeLeave === \"function\") {\n\t\t\t\tthis.removeLeaveGuard(routeName, guard.beforeLeave);\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\t\tif (!this._isFn(guard, \"removeRouteGuard\", routeName)) return this;\n\t\tthis._pipeline.removeEnterGuard(routeName, guard);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Register a leave guard for a specific route.\n\t *\n\t * Leave guards run when navigating **away from** the route, before any\n\t * enter guards for the target route. They answer the binary question\n\t * \"can I leave?\" and return only a boolean (no redirects).\n\t *\n\t * @param routeName - Route name as defined in `manifest.json`. If the route is unknown, the {@link GuardRouterOptions.unknownRouteRegistration} policy applies (default: warn).\n\t * @param guard - Leave guard function to register. Non-functions are ignored with a warning.\n\t * @returns `this` for chaining.\n\t * @since 1.0.1\n\t */\n\taddLeaveGuard(routeName: string, guard: LeaveGuardFn): this {\n\t\tif (!this._isFn(guard, \"addLeaveGuard\", routeName)) return this;\n\t\tthis._handleUnknownRouteRegistration(routeName, \"addLeaveGuard\");\n\t\tthis._pipeline.addLeaveGuard(routeName, guard);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Disambiguate the `navTo()` overload shapes into resolved arguments.\n\t *\n\t * UI5's native `navTo` has two signatures where the third parameter is either\n\t * `componentTargetInfo` (object) or `bReplace` (boolean). This method normalizes\n\t * both forms so the rest of `navTo` can work with a single set of variables.\n\t * The options follow `bReplace`, or take its place when it is left out.\n\t */\n\tprivate _resolveNavToArgs(\n\t\tcomponentTargetInfoOrReplace?: Record<string, ComponentTargetParameters> | boolean,\n\t\treplaceOrOptions?: boolean | GuardNavToOptions,\n\t\toptions?: GuardNavToOptions,\n\t): {\n\t\tcomponentTargetInfo?: Record<string, ComponentTargetParameters>;\n\t\treplace?: boolean;\n\t\tguardOptions?: GuardNavToOptions;\n\t} {\n\t\tif (typeof componentTargetInfoOrReplace === \"boolean\") {\n\t\t\t// Short form: navTo(name, params, replace, options?)\n\t\t\treturn {\n\t\t\t\treplace: componentTargetInfoOrReplace,\n\t\t\t\tguardOptions: typeof replaceOrOptions === \"object\" ? replaceOrOptions : undefined,\n\t\t\t};\n\t\t}\n\t\t// Long form: navTo(name, params, componentTargetInfo, replace, options?)\n\t\treturn {\n\t\t\tcomponentTargetInfo: componentTargetInfoOrReplace,\n\t\t\treplace: typeof replaceOrOptions === \"boolean\" ? replaceOrOptions : undefined,\n\t\t\tguardOptions: typeof replaceOrOptions === \"object\" ? replaceOrOptions : options,\n\t\t};\n\t}\n\n\t/** Return `true` when the value is a function; otherwise log a warning. */\n\tprivate _isFn(value: unknown, method: string, detail?: string): boolean {\n\t\tif (typeof value === \"function\") return true;\n\t\tLog.warning(`${method}: not a function, ignoring`, detail, LOG_COMPONENT);\n\t\treturn false;\n\t}\n\n\t/** Apply the `unknownRouteRegistration` policy: warn or throw when the route is unknown. */\n\tprivate _handleUnknownRouteRegistration(routeName: string, methodName: string, kept = \"guard registered\"): void {\n\t\tif (this.getRoute(routeName)) return;\n\n\t\tswitch (this._options.unknownRouteRegistration) {\n\t\t\tcase \"ignore\":\n\t\t\t\treturn;\n\t\t\tcase \"throw\":\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`${methodName} called for unknown route \"${routeName}\". ` +\n\t\t\t\t\t\t`Set guardRouter.unknownRouteRegistration to \"warn\" or \"ignore\" to allow this.`,\n\t\t\t\t);\n\t\t\tcase \"warn\":\n\t\t\t\tLog.warning(`${methodName}: unknown route, ${kept} anyway`, routeName, LOG_COMPONENT);\n\t\t}\n\t}\n\n\t/**\n\t * Remove a leave guard from a specific route.\n\t *\n\t * @param routeName - Route name as defined in `manifest.json`.\n\t * @param guard - Leave guard function to remove by reference. Non-functions are ignored with a warning.\n\t * @returns `this` for chaining.\n\t * @since 1.0.1\n\t */\n\tremoveLeaveGuard(routeName: string, guard: LeaveGuardFn): this {\n\t\tif (!this._isFn(guard, \"removeLeaveGuard\", routeName)) return this;\n\t\tthis._pipeline.removeLeaveGuard(routeName, guard);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Return the resolved metadata for a route.\n\t *\n\t * When `inheritance` is `\"pattern-tree\"`, walks the ancestor chain and\n\t * shallow-merges metadata shallowest-first (child values win on conflict).\n\t * Both manifest and runtime metadata participate in inheritance.\n\t * The router caches results; {@link setRouteMeta} and `addRoute()` clear the cache.\n\t *\n\t * Logs a warning for unknown non-empty route names and returns an empty\n\t * frozen object. The empty string `\"\"` is treated as a valid root route.\n\t *\n\t * @param routeName - Route name as defined in `manifest.json`.\n\t * @returns Frozen record of metadata key-value pairs, or an empty frozen object if the route has no metadata.\n\t * @since 1.6.0\n\t */\n\tgetRouteMeta(routeName: string): Readonly<Record<string, unknown>> {\n\t\t// Empty string is a valid root route name (initial state before first navigation)\n\t\tif (routeName !== \"\" && !this.getRoute(routeName)) {\n\t\t\tLog.warning(\"getRouteMeta: unknown route, returning empty metadata\", routeName, LOG_COMPONENT);\n\t\t\treturn EMPTY_META;\n\t\t}\n\t\treturn this._meta.get(routeName);\n\t}\n\n\t/**\n\t * Set runtime metadata for a route.\n\t *\n\t * Runtime metadata is merged on top of any manifest-declared metadata\n\t * when retrieved via {@link getRouteMeta}. When `inheritance` is\n\t * `\"pattern-tree\"`, descendant routes also see the updated values.\n\t * Invalidates the resolved-metadata cache. Non-object values are\n\t * ignored with a warning. Subject to the `unknownRouteRegistration` policy.\n\t *\n\t * @param routeName - Route name as defined in `manifest.json`.\n\t * @param meta - Plain object of metadata key-value pairs.\n\t * @returns `this` for chaining.\n\t * @since 1.6.0\n\t */\n\tsetRouteMeta(routeName: string, meta: Record<string, unknown>): this {\n\t\tif (!isRecord(meta)) {\n\t\t\tLog.warning(\"setRouteMeta: expected object, ignoring\", routeName, LOG_COMPONENT);\n\t\t\treturn this;\n\t\t}\n\t\tif (routeName !== \"\") this._handleUnknownRouteRegistration(routeName, \"setRouteMeta\", \"metadata stored\");\n\t\tthis._meta.set(routeName, meta);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Return a Promise that settles when the current guard pipeline finishes.\n\t *\n\t * If a navigation is pending, the Promise resolves when that pipeline settles.\n\t * If no navigation is pending, it resolves immediately with the most recent\n\t * settlement result. Before any navigation has settled, it falls back to a\n\t * synthetic `Committed` result derived from the router's current route/hash\n\t * state. After `stop()`, that idle fallback reports empty route/hash values\n\t * until a new navigation settles, or `initialize(true)` resumes the route.\n\t *\n\t * @returns Promise that resolves with a {@link NavigationResult} once the pipeline settles.\n\t * @since 1.2.0\n\t */\n\tnavigationSettled(): Promise<NavigationResult> {\n\t\tif (this._phase.kind === \"idle\" || this._phase.kind === \"committing\") {\n\t\t\treturn Promise.resolve(\n\t\t\t\tthis._lastSettlement ?? {\n\t\t\t\t\tstatus: NavigationOutcome.Committed,\n\t\t\t\t\troute: this._currentRoute,\n\t\t\t\t\thash: this._currentHash ?? \"\",\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\t\treturn new Promise((resolve) => {\n\t\t\tthis._settlementResolvers.push(resolve);\n\t\t});\n\t}\n\n\t/**\n\t * Attach an event handler for the `navigationSettled` event.\n\t *\n\t * Fires synchronously after every guard pipeline settlement with\n\t * a {@link NavigationResult} payload. Unlike the one-shot\n\t * `navigationSettled()` Promise, this event fires for every\n\t * navigation outcome without re-registration.\n\t *\n\t * @param oData - Application-specific payload passed to the handler as second argument.\n\t * @param fnFunction - The function to be called when the event occurs.\n\t * @param oListener - Context object to call the event handler with. Defaults to this Router.\n\t * @since 1.3.0\n\t */\n\tattachNavigationSettled(\n\t\toData: object,\n\t\tfnFunction: (evt: Router$NavigationSettledEvent) => void,\n\t\toListener?: object,\n\t): this;\n\tattachNavigationSettled(fnFunction: (evt: Router$NavigationSettledEvent) => void, oListener?: object): this;\n\tattachNavigationSettled(\n\t\toData: object,\n\t\tfnFunction: (evt: Router$NavigationSettledEvent) => void,\n\t\toListener?: object,\n\t): this {\n\t\t// The arguments go on as received: EventProvider#attachEvent tells the two call forms apart.\n\t\treturn this.attachEvent(\"navigationSettled\", oData, fnFunction, oListener);\n\t}\n\n\t/**\n\t * Detach a previously attached `navigationSettled` event handler.\n\t *\n\t * The passed parameters must match those used for registration with\n\t * {@link #attachNavigationSettled} beforehand.\n\t *\n\t * @param fnFunction - The handler function to detach.\n\t * @param oListener - Context object on which the given function had to be called.\n\t * @since 1.3.0\n\t */\n\tdetachNavigationSettled(fnFunction: (evt: Router$NavigationSettledEvent) => void, oListener?: object): this {\n\t\tthis.detachEvent(\"navigationSettled\", fnFunction, oListener);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Drain all settlement resolvers with the given result and fire\n\t * the `navigationSettled` event.\n\t */\n\tprivate _flushSettlement(result: NavigationResult): void {\n\t\tthis._lastSettlement = result;\n\t\tLog.debug(`Navigation settled: ${result.status}`, result.hash, LOG_COMPONENT);\n\t\t// After the call that settled: by then a commit has reached super.parse(), and a navigation\n\t\t// that supersedes this one has started.\n\t\tqueueMicrotask(() => this._settleMatchWaiters());\n\t\tconst resolvers = this._settlementResolvers;\n\t\tthis._settlementResolvers = [];\n\t\tfor (const resolve of resolvers) {\n\t\t\tresolve(result);\n\t\t}\n\t\ttry {\n\t\t\tthis.fireEvent(\"navigationSettled\", result);\n\t\t} catch (error) {\n\t\t\t// A handler must not keep the router from finishing the navigation it reports.\n\t\t\tLog.error(\"A navigationSettled handler threw\", String(error), LOG_COMPONENT);\n\t\t}\n\t}\n\n\t/**\n\t * Navigate to a route with preflight guard evaluation.\n\t *\n\t * For programmatic navigation, guards run BEFORE the hash changes.\n\t * This prevents history pollution: blocked navigations never push a\n\t * history entry, and redirected navigations go directly to the final\n\t * target, which is written the way this call asked for (`bReplace`).\n\t *\n\t * A `navTo()` to the committed hash changes no route of this router, so\n\t * no guard runs: any pending navigation is cancelled and the call goes\n\t * to the native `navTo()`, which sets or resets the hashes of nested\n\t * components (`componentTargetInfo`). If the target matches the\n\t * in-flight attempt's hash, the in-flight preflight continues undisturbed.\n\t *\n\t * When all guards are synchronous, the decision and the resulting\n\t * hash change happen in the same tick. When any guard returns a\n\t * Promise, `navTo()` returns `this` immediately and defers the\n\t * hash change to when the guard resolves.\n\t *\n\t * Assumes `super.navTo()` calls `HashChanger.setHash()` which fires\n\t * `hashChanged` synchronously, causing `parse()` to re-enter in the\n\t * same call stack (validated by test). If the hash changer refuses the\n\t * hash change, as the Fiori launchpad's navigation filter does when its\n\t * dirty-state check stops it, nothing is committed and the navigation\n\t * settles as `Blocked`.\n\t *\n\t * With component targets (`componentTargetInfo`) UI5 writes the hash\n\t * later, once the nested components are loaded. The navigation commits\n\t * and settles when `parse()` receives that hash. Until then it is\n\t * pending: a navigation that supersedes it, `stop()` or `destroy()`\n\t * settles it as `Cancelled`. That also ends a navigation whose hash UI5\n\t * never writes, because a nested component failed to load or the router\n\t * is not async.\n\t *\n\t * On a router that is not initialized (before `initialize()`, while\n\t * block-mode guard modules load, after `stop()`) the call goes straight\n\t * to the native `navTo()`, which only sets the hash or does nothing when\n\t * stopped. The guards run when the router starts and parses the hash.\n\t *\n\t * @override sap.ui.core.routing.Router#navTo\n\t * @since 1.0.1\n\t */\n\toverride navTo(\n\t\trouteName: string,\n\t\tparameters?: object,\n\t\tcomponentTargetInfo?: Record<string, ComponentTargetParameters>,\n\t\tbReplace?: boolean,\n\t): this;\n\toverride navTo(routeName: string, parameters?: object, bReplace?: boolean): this;\n\toverride navTo(routeName: string, parameters?: object, bReplace?: boolean, options?: GuardNavToOptions): this;\n\toverride navTo(\n\t\trouteName: string,\n\t\tparameters?: object,\n\t\tcomponentTargetInfo?: Record<string, ComponentTargetParameters>,\n\t\tbReplace?: boolean,\n\t\toptions?: GuardNavToOptions,\n\t): this;\n\toverride navTo(\n\t\trouteName: string,\n\t\tparameters?: object,\n\t\tcomponentTargetInfoOrReplace?: Record<string, ComponentTargetParameters> | boolean,\n\t\treplaceOrOptions?: boolean | GuardNavToOptions,\n\t\toptions?: GuardNavToOptions,\n\t): this {\n\t\tconst { componentTargetInfo, replace, guardOptions } = this._resolveNavToArgs(\n\t\t\tcomponentTargetInfoOrReplace,\n\t\t\treplaceOrOptions,\n\t\t\toptions,\n\t\t);\n\n\t\t// Redirect path: _redirect() calls this.navTo() while in committing/redirect phase.\n\t\t// Bypass preflight -- parse() will commit directly via the committing phase.\n\t\tif (this._phase.kind === \"committing\" && this._phase.origin === \"redirect\") {\n\t\t\tsuper.navTo(routeName, parameters, componentTargetInfo, replace);\n\t\t\treturn this;\n\t\t}\n\n\t\t// A router that does not listen to hash changes (not initialized, loading block-mode\n\t\t// guards, or stopped) navigates like the native one: the guards run once it parses the hash.\n\t\tif (!this.isInitialized()) {\n\t\t\tsuper.navTo(routeName, parameters, componentTargetInfo, replace);\n\t\t\treturn this;\n\t\t}\n\n\t\tconst route = this.getRoute(routeName);\n\t\tif (!route) {\n\t\t\t// Unknown route -- let the parent handle it (it logs a warning).\n\t\t\t// Cancel any pending async navigation so settlement resolvers drain\n\t\t\t// and the stale pipeline does not commit a superseded navigation.\n\t\t\tthis._cancelPendingNavigation(true);\n\t\t\tsuper.navTo(routeName, parameters, componentTargetInfo, replace);\n\t\t\treturn this;\n\t\t}\n\n\t\tconst targetHash = route.getURL(parameters ?? {});\n\t\tconst routeInfo = this._matchRoute(targetHash);\n\t\tconst toRoute = routeInfo.name;\n\n\t\t// Same hash: no route of this router changes, so there is nothing to guard. Cancel any\n\t\t// pending navigation and navigate natively: UI5 still sets the hashes of nested\n\t\t// components (componentTargetInfo), or resets them when none are given.\n\t\tif (targetHash === this._currentHash) {\n\t\t\tthis._cancelPendingNavigation(true);\n\t\t\t// A navigationSettled handler of the cancelled navigation may have navigated on.\n\t\t\tconst shownHash: string | undefined = this.getHashChanger().getHash();\n\t\t\tif (shownHash === undefined || shownHash === targetHash) {\n\t\t\t\t// If UI5 has reset the hash of the hash changer, after a target was displayed without\n\t\t\t\t// a route, it reports the hash again, and parse() lets the route match again.\n\t\t\t\tsuper.navTo(routeName, parameters, componentTargetInfo, replace);\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\n\t\tconst skipGuards = guardOptions?.skipGuards === true || this._options.navToPreflight === \"bypass\";\n\n\t\t// Pending-hash dedup: if an async preflight for this exact hash is\n\t\t// already running, don't cancel and restart it. A navigation that skips\n\t\t// the guards does not wait for them.\n\t\tif (!skipGuards && this._phase.kind === \"evaluating\" && targetHash === this._phase.attempt.hash) {\n\t\t\treturn this;\n\t\t}\n\n\t\t// parse() evaluates the guards once the hash has changed. It supersedes a pending\n\t\t// navigation then, and undoes the hash change of that navigation with its own.\n\t\tif (!skipGuards && this._options.navToPreflight === \"off\") {\n\t\t\tsuper.navTo(routeName, parameters, componentTargetInfo, replace);\n\t\t\treturn this;\n\t\t}\n\n\t\t// Cancel any pending navigation (including previous async preflight).\n\t\t// A superseded hash-change navigation leaves its hash in the URL: restore it\n\t\t// unless this navigation moves the URL.\n\t\tconst restoreHash = this._pendingRestoresHash();\n\t\tthis._cancelPendingNavigation();\n\n\t\tif (skipGuards) {\n\t\t\tthis._navigateAllowed(\n\t\t\t\trouteName,\n\t\t\t\tparameters,\n\t\t\t\tcomponentTargetInfo,\n\t\t\t\treplace,\n\t\t\t\ttargetHash,\n\t\t\t\ttoRoute,\n\t\t\t\trestoreHash,\n\t\t\t);\n\t\t\treturn this;\n\t\t}\n\n\t\tconst attempt = this._startAttempt(targetHash, restoreHash);\n\t\tconst { generation } = attempt;\n\n\t\tconst context = this._createGuardContext(routeInfo, targetHash, attempt.controller.signal);\n\n\t\tconst decision = this._evaluateGuards(context);\n\n\t\tif (isPromiseLike(decision)) {\n\t\t\tthis._applyWhenDecided(\n\t\t\t\tdecision,\n\t\t\t\t(d) => {\n\t\t\t\t\tif (generation !== this._parseGeneration) {\n\t\t\t\t\t\tLog.debug(\n\t\t\t\t\t\t\t\"Async preflight result discarded (superseded by newer navigation)\",\n\t\t\t\t\t\t\ttargetHash,\n\t\t\t\t\t\t\tLOG_COMPONENT,\n\t\t\t\t\t\t);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tthis._applyPreflightDecision(\n\t\t\t\t\t\td,\n\t\t\t\t\t\trouteName,\n\t\t\t\t\t\tparameters,\n\t\t\t\t\t\tcomponentTargetInfo,\n\t\t\t\t\t\treplace,\n\t\t\t\t\t\ttargetHash,\n\t\t\t\t\t\ttoRoute,\n\t\t\t\t\t\tcontext.bag,\n\t\t\t\t\t\tattempt,\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\ttargetHash,\n\t\t\t\trestoreHash,\n\t\t\t);\n\t\t\treturn this;\n\t\t}\n\n\t\tthis._applyPreflightDecision(\n\t\t\tdecision,\n\t\t\trouteName,\n\t\t\tparameters,\n\t\t\tcomponentTargetInfo,\n\t\t\treplace,\n\t\t\ttargetHash,\n\t\t\ttoRoute,\n\t\t\tcontext.bag,\n\t\t\tattempt,\n\t\t);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Navigate to a `navTo()` target that needs no guards (allowed or bypassed) and commit it,\n\t * or block it if the hash change was refused (see {@link _commitAfterNavTo}).\n\t */\n\tprivate _navigateAllowed(\n\t\trouteName: string,\n\t\tparameters: object | undefined,\n\t\tcomponentTargetInfo: Record<string, ComponentTargetParameters> | undefined,\n\t\tbReplace: boolean | undefined,\n\t\ttargetHash: string,\n\t\ttoRoute: string,\n\t\trestoreHash: boolean,\n\t): void {\n\t\tthis._phase = {\n\t\t\tkind: \"committing\",\n\t\t\troute: toRoute,\n\t\t\thash: targetHash,\n\t\t\torigin: \"preflight\",\n\t\t\trestoreHash,\n\t\t\twrittenOver: HashChanger.getInstance().getHash(),\n\t\t};\n\t\ttry {\n\t\t\tsuper.navTo(routeName, parameters, componentTargetInfo, bReplace);\n\t\t\tif (!this._commitAfterNavTo(componentTargetInfo)) {\n\t\t\t\tthis._blockNavigation(targetHash, restoreHash);\n\t\t\t}\n\t\t} finally {\n\t\t\t// A failed hash change must not leave the next one to be committed without guards.\n\t\t\tif (this._phase.kind === \"committing\") {\n\t\t\t\tthis._phase = IDLE;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Apply a preflight guard decision. For \"allow\", enter the committing\n\t * phase and call super.navTo(). For \"block\", flush settlement; the hash is\n\t * only touched to restore it after a superseded hash-change navigation.\n\t * For \"redirect\", start a redirect chain.\n\t * For \"error\", flush Error settlement with the guard's error.\n\t */\n\tprivate _applyPreflightDecision(\n\t\tdecision: GuardDecision,\n\t\trouteName: string,\n\t\tparameters: object | undefined,\n\t\tcomponentTargetInfo: Record<string, ComponentTargetParameters> | undefined,\n\t\tbReplace: boolean | undefined,\n\t\ttargetHash: string,\n\t\ttoRoute: string,\n\t\tbag: Map<string, unknown>,\n\t\tattempt: NavigationAttempt,\n\t): void {\n\t\t// A guard that navigated itself has superseded the navigation it was guarding.\n\t\tif (attempt.generation !== this._parseGeneration) return;\n\t\tswitch (decision.action) {\n\t\t\tcase \"allow\":\n\t\t\t\tthis._navigateAllowed(\n\t\t\t\t\trouteName,\n\t\t\t\t\tparameters,\n\t\t\t\t\tcomponentTargetInfo,\n\t\t\t\t\tbReplace,\n\t\t\t\t\ttargetHash,\n\t\t\t\t\ttoRoute,\n\t\t\t\t\tattempt.restoreHash,\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\tcase \"block\":\n\t\t\t\tthis._blockNavigation(targetHash, attempt.restoreHash);\n\t\t\t\tbreak;\n\t\t\tcase \"redirect\":\n\t\t\t\tthis._startRedirectChain(decision.target, targetHash, bag, attempt, bReplace);\n\t\t\t\tbreak;\n\t\t\tcase \"error\":\n\t\t\t\tthis._errorNavigation(decision.error, targetHash, attempt.restoreHash);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t/**\n\t * Intercept hash changes and run the guard pipeline before route matching.\n\t *\n\t * Called by the HashChanger on every `hashChanged` event. Runs leave guards\n\t * (current route), then global + route-specific enter guards (target route).\n\t * Stays synchronous when all guards return plain values; falls back to async\n\t * when a guard returns a Promise. A generation counter discards stale results\n\t * when navigations overlap.\n\t *\n\t * @param newHash - The new hash fragment from the URL.\n\t * @override sap.ui.core.routing.Router#parse\n\t * @since 1.0.1\n\t */\n\toverride parse(newHash: string): void {\n\t\tif (this._destroyed) {\n\t\t\t// The base router only warns about a hash change that reaches a destroyed router.\n\t\t\tsuper.parse(newHash);\n\t\t\treturn;\n\t\t}\n\t\tconst reported = this._reportedHash === newHash;\n\t\tthis._reportedHash = null;\n\t\t// The URL shows a later hash, which this router has parsed.\n\t\tif (reported && this._reportOutdated) return;\n\t\t// The hash that _restoreHash() is writing.\n\t\tif (newHash === this._suppressedHash) return;\n\n\t\tconst undo = this._undo;\n\t\tif (undo?.started && undo.fullHash === HashChanger.getInstance().getHash()) {\n\t\t\t// The URL is back where the router has put it (see _undoHashChange), so nothing is\n\t\t\t// evaluated. What the hash changer reports now is the hash of the route that is shown.\n\t\t\tthis._undo = null;\n\t\t\tthis._currentHash = newHash;\n\t\t\tthis._finishRestore(newHash);\n\t\t\treturn;\n\t\t}\n\n\t\tconst phase = this._phase;\n\t\tconst commit = phase.kind === \"awaitingHash\" ? phase.commit : phase.kind === \"committing\" ? phase : null;\n\t\tif (commit?.hash === newHash) {\n\t\t\tthis._phase = commit;\n\t\t\tthis._commitNavigation(newHash, commit.route);\n\t\t\treturn;\n\t\t}\n\n\t\tconst currentHash = this._currentHash;\n\t\tif (newHash === currentHash) {\n\t\t\tif (this._pendingRestoresHash()) {\n\t\t\t\t// The URL is back on the committed hash, whose route was never left. That ends the\n\t\t\t\t// navigation that had moved it away; one that waits for UI5 to write its hash goes on.\n\t\t\t\tif (this._phase.kind === \"evaluating\") this._cancelPendingNavigation();\n\t\t\t\telse this._undo = null;\n\t\t\t} else {\n\t\t\t\t// The committed hash is reported again, and its route matches again as it does\n\t\t\t\t// natively: UI5 has written the hash of a navigation with component targets, or has\n\t\t\t\t// reset the hash of the hash changer after a target was displayed without a route,\n\t\t\t\t// or parse() was called directly.\n\t\t\t\tsuper.parse(newHash);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst routeInfo = this._matchRoute(newHash);\n\t\tconst toRoute = routeInfo.name;\n\n\t\t// A pending navigation that has moved the URL as well leaves this one to undo both changes.\n\t\tconst pendingUndo = this._pendingRestoresHash() ? undo : null;\n\t\t// The router is putting the URL back and gets another hash: that one is not undone as a\n\t\t// whole, so that an undo cannot cause the next one.\n\t\tconst undoing = this._phase.kind === \"restoring\";\n\t\tthis._cancelPendingNavigation();\n\t\t// A navigationSettled handler that navigated on the cancellation has moved the URL on.\n\t\tif (this._currentHash !== currentHash) return;\n\t\tthis._undo = undoing ? null : this._describeUndo(pendingUndo, reported);\n\t\t// Another listener of the hash change that navTo() caused has replaced the hash, before\n\t\t// this router received it: undoing this hash change undoes the one of navTo() as well.\n\t\tif (this._undo && commit === phase && !commit.restoreHash) this._undo.fullHash = commit.writtenOver;\n\n\t\tconst direction = reported ? History.getInstance().getDirection() : undefined;\n\t\tconst attempt = this._startAttempt(newHash, true, direction);\n\t\tconst { generation } = attempt;\n\n\t\tconst context = this._createGuardContext(routeInfo, newHash, attempt.controller.signal);\n\n\t\tconst decision = this._evaluateGuards(context);\n\n\t\tif (isPromiseLike(decision)) {\n\t\t\tthis._applyWhenDecided(\n\t\t\t\tdecision,\n\t\t\t\t(d) => {\n\t\t\t\t\tif (generation !== this._parseGeneration) {\n\t\t\t\t\t\tLog.debug(\n\t\t\t\t\t\t\t\"Async guard result discarded (superseded by newer navigation)\",\n\t\t\t\t\t\t\tnewHash,\n\t\t\t\t\t\t\tLOG_COMPONENT,\n\t\t\t\t\t\t);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tthis._applyDecision(d, newHash, toRoute, context.bag, attempt);\n\t\t\t\t},\n\t\t\t\tnewHash,\n\t\t\t\ttrue,\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\tthis._applyDecision(decision, newHash, toRoute, context.bag, attempt);\n\t}\n\n\t/**\n\t * Stop listening to hash changes and reset guard state.\n\t *\n\t * Resets `_currentRoute` and `_currentHash` so that a subsequent\n\t * `initialize()` re-parses the current hash and fires `routeMatched`,\n\t * matching the native `sap.m.routing.Router` behavior. The route is\n\t * kept for `initialize(true)`, which resumes it instead.\n\t *\n\t * @override sap.ui.core.routing.Router#stop\n\t * @since 1.0.1\n\t */\n\toverride stop(): this {\n\t\tif (this._blockLoad) this._blockLoad.start = false;\n\t\t// Cancel first so in-flight navigationSettled() resolvers receive the\n\t\t// Cancelled result before _lastSettlement is cleared below.\n\t\tthis._cancelPendingNavigation();\n\t\t// A hash change that was to put the URL back does not reach a stopped router.\n\t\tthis._undo = null;\n\t\t// Nothing is committed on a router that is stopped already, or stops before its first navigation settles.\n\t\tif (this._currentHash !== null) this._stoppedRoute = this._currentRoute;\n\t\tthis._currentRoute = \"\";\n\t\tthis._currentHash = null;\n\t\tthis._lastSettlement = null;\n\t\tthis._detachHashListeners();\n\t\tsuper.stop();\n\t\treturn this;\n\t}\n\n\t/** Detach what {@link _start} has attached. */\n\tprivate _detachHashListeners(): void {\n\t\tthis.getHashChanger().detachEvent(\"hashChanged\", this._onHashReported, this);\n\t\t// UI5 moves the listener along when the global hash changer is replaced.\n\t\tHashChanger.getInstance().detachEvent(\"hashChanged\", this._onRootHashChanged, this);\n\t\tthis._rootHashChanger = null;\n\t}\n\n\t/**\n\t * Invalidate any in-flight async guard work. Bumps the generation counter\n\t * so pending `.then()` callbacks see they are stale, aborts the signal,\n\t * and transitions to idle. A navigation that waits for its guards or for\n\t * its hash settles as `Cancelled`. With `restoreHash`, a cancelled hash-change\n\t * navigation also gets its hash restored: `navTo()` passes it when the\n\t * call itself will not move the URL.\n\t */\n\tprivate _cancelPendingNavigation(restoreHash = false): void {\n\t\t++this._parseGeneration;\n\t\tconst phase = this._phase;\n\t\tconst pendingRestoresHash = this._pendingRestoresHash();\n\t\t// Idle before the settlement fires, so that a handler can navigate.\n\t\tthis._phase = IDLE;\n\t\t// A navigation that is committing ends with the navigation that supersedes it.\n\t\tif (phase.kind === \"idle\" || phase.kind === \"committing\") return;\n\t\tif (phase.kind === \"restoring\") {\n\t\t\t// A navigation that waits for the URL to be back has ended already: it settles as it ended.\n\t\t\tthis._flushSettlement(phase.result);\n\t\t\treturn;\n\t\t}\n\t\tif (phase.kind === \"evaluating\") phase.attempt.controller.abort();\n\t\tthis._settleUncommitted(\n\t\t\t{ status: NavigationOutcome.Cancelled, route: this._currentRoute, hash: this._currentHash ?? \"\" },\n\t\t\tphase.kind === \"evaluating\" ? phase.attempt.hash : phase.commit.hash,\n\t\t\trestoreHash && pendingRestoresHash,\n\t\t);\n\t}\n\n\t/**\n\t * Whether the pending navigation leaves a hash in the URL that never committed, the one of a\n\t * hash-change navigation: it must be restored unless a navigation moves the URL.\n\t */\n\tprivate _pendingRestoresHash(): boolean {\n\t\tconst phase = this._phase;\n\t\tif (phase.kind === \"evaluating\") return phase.attempt.restoreHash;\n\t\tif (phase.kind === \"committing\") return phase.restoreHash;\n\t\treturn phase.kind === \"awaitingHash\" && phase.commit.restoreHash;\n\t}\n\n\t/**\n\t * Start evaluating a navigation. Its generation is its own, so the result of any earlier\n\t * attempt is stale: also one that a navigationSettled handler started while this\n\t * navigation cancelled its predecessor, which is aborted here without a settlement.\n\t */\n\tprivate _startAttempt(hash: string, restoreHash: boolean, direction?: Direction): NavigationAttempt {\n\t\tif (this._phase.kind === \"evaluating\") this._phase.attempt.controller.abort();\n\t\tconst attempt: NavigationAttempt = {\n\t\t\thash,\n\t\t\tcontroller: new AbortController(),\n\t\t\tgeneration: ++this._parseGeneration,\n\t\t\trestoreHash,\n\t\t\tdirection,\n\t\t};\n\t\tthis._phase = { kind: \"evaluating\", attempt };\n\t\treturn attempt;\n\t}\n\n\t/**\n\t * Apply the decision of async guards once it is there. Until then the navigation is postponed,\n\t * which UI5 sees as a route match in progress (see {@link _mirrorMatchingProcess}). The pipeline\n\t * turns a failing guard into an error decision, so an error thrown here comes from applying the\n\t * decision, which has no caller to throw to: it is logged, and fails the navigation unless that\n\t * has settled.\n\t */\n\tprivate _applyWhenDecided(\n\t\tdecision: PromiseLike<GuardDecision>,\n\t\tapply: (decision: GuardDecision) => void,\n\t\tattemptedHash: string | undefined,\n\t\trestoreHash: boolean,\n\t): void {\n\t\tif (this._phase.kind === \"evaluating\") this._phase = { ...this._phase, postponed: true };\n\t\tdecision.then((d) => {\n\t\t\tconst lastSettlement = this._lastSettlement;\n\t\t\ttry {\n\t\t\t\tapply(d);\n\t\t\t} catch (error) {\n\t\t\t\tLog.error(\n\t\t\t\t\t\"Navigation failed after its guards had settled\",\n\t\t\t\t\terror instanceof Error ? error : String(error),\n\t\t\t\t\tLOG_COMPONENT,\n\t\t\t\t);\n\t\t\t\tif (this._lastSettlement === lastSettlement) {\n\t\t\t\t\tthis._errorNavigation(error, attemptedHash, restoreHash);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Apply a guard decision for the parse() fallback path.\n\t */\n\tprivate _applyDecision(\n\t\tdecision: GuardDecision,\n\t\thash: string,\n\t\troute: string,\n\t\tbag: Map<string, unknown>,\n\t\tattempt: NavigationAttempt,\n\t): void {\n\t\t// A guard that navigated itself has superseded the navigation it was guarding.\n\t\tif (attempt.generation !== this._parseGeneration) return;\n\t\tswitch (decision.action) {\n\t\t\tcase \"allow\":\n\t\t\t\tthis._phase = { kind: \"committing\", route, hash, origin: \"parse\", restoreHash: false };\n\t\t\t\tthis._commitNavigation(hash, route);\n\t\t\t\tbreak;\n\t\t\tcase \"block\":\n\t\t\t\tthis._blockNavigation(hash);\n\t\t\t\tbreak;\n\t\t\tcase \"redirect\":\n\t\t\t\t// The hash that redirects has reached the browser: the target takes its history entry.\n\t\t\t\tthis._startRedirectChain(decision.target, hash, bag, attempt, true);\n\t\t\t\tbreak;\n\t\t\tcase \"error\":\n\t\t\t\tthis._errorNavigation(decision.error, hash);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t/**\n\t * Leave the title history of UI5 (`getTitleHistory()`) as after the native equivalent of a\n\t * redirected hash change: the hash change, then `navTo(target, ..., true)`. The route of the\n\t * hash change never matched, so UI5 has not handled its title:\n\t * - A new entry or a step forward would have added a title, which the title of the target\n\t * replaces: UI5 must not remove the title of the route before it.\n\t * - A step back would have removed the title of the route that was left, so that the target\n\t * replaces the title of the entry the step arrived at: UI5 removes the first for the\n\t * replaced hash, the router removes the second, under the condition of UI5 for a step back.\n\t */\n\tprivate _alignTitleHistory(direction: Direction | undefined): void {\n\t\tif (direction === HistoryDirection.NewEntry || direction === HistoryDirection.Forwards) {\n\t\t\tReflect.set(this, \"_bLastHashReplaced\", false);\n\t\t} else if (direction === HistoryDirection.Backwards) {\n\t\t\tconst titles: unknown[] = this.getTitleHistory();\n\t\t\tconst left = titles.at(-1);\n\t\t\tconst replaced = titles.at(-2);\n\t\t\tif (isRecord(left) && isRecord(replaced) && !left.isHome && left.title !== replaced.title) {\n\t\t\t\ttitles.splice(-2, 1);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Delegate to the parent router and update internal state.\n\t *\n\t * State is updated BEFORE calling parse to ensure that if event handlers\n\t * (e.g., routeMatched) trigger nested navigation, the leave guards will\n\t * run for the correct (new) route rather than the old one. The settlement\n\t * fires before parse as well, so the settlements of such nested navigations\n\t * follow it.\n\t */\n\tprivate _commitNavigation(hash: string, route: string): void {\n\t\tconst wasRedirect = this._phase.kind === \"committing\" && this._phase.origin === \"redirect\";\n\t\tif (this._phase.kind === \"committing\") this._alignTitleHistory(this._phase.direction);\n\t\t// The URL has moved on: a hash change that was to put it back is not awaited any more.\n\t\tthis._undo = null;\n\t\tthis._currentHash = hash;\n\t\tthis._currentRoute = route;\n\t\t// Transition to idle before super.parse so that routeMatched/patternMatched\n\t\t// handlers that call navTo() go through the full guard pipeline.\n\t\tthis._phase = IDLE;\n\t\tthis._flushSettlement({\n\t\t\tstatus: wasRedirect\n\t\t\t\t? NavigationOutcome.Redirected\n\t\t\t\t: this._currentRoute === \"\"\n\t\t\t\t\t? NavigationOutcome.Bypassed\n\t\t\t\t\t: NavigationOutcome.Committed,\n\t\t\troute: this._currentRoute,\n\t\t\thash,\n\t\t});\n\t\t// A navigationSettled handler that navigated on has committed its own hash.\n\t\tif (this._currentHash !== hash) return;\n\t\tsuper.parse(hash);\n\t}\n\n\t/**\n\t * Commit the navigation of the committing phase after `super.navTo()` unless `parse()` has\n\t * committed it. Returns whether the navigation takes place:\n\t * - The hash changer shows the target hash: the route matches here.\n\t * - UI5 writes the hash later, which it does with component targets, once the nested\n\t * components are loaded. The navigation waits for it: it commits, and the route matches,\n\t * when `parse()` gets that hash, as the route does natively. Committed here, the router\n\t * would be on a route that UI5 does not display if the hash is never written.\n\t * - Otherwise the hash changer has refused the hash change, as the Fiori launchpad does while\n\t * it asks the user about unsaved data. Nothing changed, so nothing is committed.\n\t */\n\tprivate _commitAfterNavTo(componentTargetInfo: Record<string, ComponentTargetParameters> | undefined): boolean {\n\t\tconst phase = this._phase;\n\t\tif (phase.kind !== \"committing\") return true;\n\t\tif (this.getHashChanger().getHash() === phase.hash) {\n\t\t\tthis._commitNavigation(phase.hash, phase.route);\n\t\t\treturn true;\n\t\t}\n\t\tif (!componentTargetInfo || Object.keys(componentTargetInfo).length === 0) return false;\n\t\tthis._phase = { kind: \"awaitingHash\", commit: phase };\n\t\treturn true;\n\t}\n\n\t/**\n\t * Evaluate guards on a redirect target and apply the resulting decision.\n\t *\n\t * Handles the unknown-route block, loop detection (visited-hash set +\n\t * depth cap), sync/async guard evaluation, and recursive chaining when\n\t * the target's guard itself returns a redirect. All hops in a chain\n\t * share the same AbortSignal and generation counter from the original\n\t * navigation so that a superseding navigation correctly discards\n\t * in-flight redirect work.\n\t *\n\t * @param target - Redirect target: a route name string or {@link GuardRedirect} with parameters.\n\t * @param chain - Mutable context threaded through the redirect chain (visited set, signals, etc.).\n\t */\n\tprivate _redirect(target: string | GuardRedirect, chain: RedirectChainContext): void {\n\t\tconst targetName = typeof target === \"string\" ? target : target.route;\n\t\tconst targetRoute = this.getRoute(targetName);\n\t\tif (!targetRoute) {\n\t\t\tLog.warning(\n\t\t\t\t`Guard redirect target \"${targetName}\" is not a known route, treating as blocked`,\n\t\t\t\tundefined,\n\t\t\t\tLOG_COMPONENT,\n\t\t\t);\n\t\t\tthis._blockNavigation(chain.attemptedHash, chain.restoreHash);\n\t\t\treturn;\n\t\t}\n\t\tlet targetHash: string;\n\t\ttry {\n\t\t\ttargetHash = targetRoute.getURL(typeof target === \"string\" ? {} : (target.parameters ?? {}));\n\t\t} catch (error) {\n\t\t\tLog.error(\n\t\t\t\t`Guard redirect target \"${targetName}\" has no valid hash, navigation failed`,\n\t\t\t\tString(error),\n\t\t\t\tLOG_COMPONENT,\n\t\t\t);\n\t\t\tthis._errorNavigation(error, chain.attemptedHash, chain.restoreHash);\n\t\t\treturn;\n\t\t}\n\n\t\tif (chain.visited.has(targetHash)) {\n\t\t\tLog.error(\n\t\t\t\t`Guard redirect loop detected: ${[...chain.visited, targetHash].join(\" -> \")}`,\n\t\t\t\tundefined,\n\t\t\t\tLOG_COMPONENT,\n\t\t\t);\n\t\t\tthis._blockNavigation(chain.attemptedHash, chain.restoreHash);\n\t\t\treturn;\n\t\t}\n\t\tif (chain.visited.size > MAX_REDIRECT_DEPTH) {\n\t\t\tLog.error(\n\t\t\t\t`Guard redirect chain exceeded maximum depth (${MAX_REDIRECT_DEPTH}): ${[...chain.visited].join(\" -> \")}`,\n\t\t\t\tundefined,\n\t\t\t\tLOG_COMPONENT,\n\t\t\t);\n\t\t\tthis._blockNavigation(chain.attemptedHash, chain.restoreHash);\n\t\t\treturn;\n\t\t}\n\t\tchain.visited.add(targetHash);\n\n\t\tconst routeInfo = this._matchRoute(targetHash);\n\t\tconst toRoute = routeInfo.name;\n\t\tconst context = this._createGuardContext(routeInfo, targetHash, chain.signal, chain);\n\n\t\tconst decision = this._evaluateGuards(context, true);\n\n\t\tif (isPromiseLike(decision)) {\n\t\t\tthis._applyWhenDecided(\n\t\t\t\tdecision,\n\t\t\t\t(d) => this._applyRedirectDecision(d, target, targetHash, toRoute, chain),\n\t\t\t\tchain.attemptedHash,\n\t\t\t\tchain.restoreHash,\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\tthis._applyRedirectDecision(decision, target, targetHash, toRoute, chain);\n\t}\n\n\t/**\n\t * Apply a guard decision within a redirect chain. For \"allow\", enter\n\t * committing phase and delegate to navTo (which hits the existing bypass);\n\t * if that does not reach parse(), commit the target directly. A target that\n\t * is displayed already settles the navigation without a commit.\n\t * For \"block\", block the entire chain. For \"redirect\", recurse.\n\t *\n\t * @param decision - Normalized guard pipeline result for this hop.\n\t * @param target - The redirect target (route name or {@link GuardRedirect}).\n\t * @param targetHash - Resolved hash for the redirect target.\n\t * @param toRoute - Route that matches the hash, as in the hop's guard context: the route UI5 displays.\n\t * @param chain - Shared redirect chain context with visited set, signals, etc.\n\t */\n\tprivate _applyRedirectDecision(\n\t\tdecision: GuardDecision,\n\t\ttarget: string | GuardRedirect,\n\t\ttargetHash: string,\n\t\ttoRoute: string,\n\t\tchain: RedirectChainContext,\n\t): void {\n\t\t// Superseded while the hop's guards ran: by a newer navigation, or by a guard that navigated.\n\t\tif (chain.generation !== this._parseGeneration) return;\n\t\tswitch (decision.action) {\n\t\t\tcase \"allow\": {\n\t\t\t\tconst componentTargetInfo = typeof target === \"string\" ? undefined : target.componentTargetInfo;\n\t\t\t\tif (targetHash === this._currentHash) {\n\t\t\t\t\t// The target is displayed already, so no route matches again, as for a navTo() to\n\t\t\t\t\t// the committed hash: the URL is put back and UI5 sets the hashes of nested components.\n\t\t\t\t\tthis._phase = IDLE;\n\t\t\t\t\tthis._settleUncommitted(\n\t\t\t\t\t\t{ status: NavigationOutcome.Redirected, route: this._currentRoute, hash: targetHash },\n\t\t\t\t\t\tchain.attemptedHash,\n\t\t\t\t\t\tchain.restoreHash,\n\t\t\t\t\t\ttypeof target !== \"string\" && componentTargetInfo\n\t\t\t\t\t\t\t? () => {\n\t\t\t\t\t\t\t\t\t// Unless a settlement handler has moved the URL on.\n\t\t\t\t\t\t\t\t\tif (this.getHashChanger().getHash() !== targetHash) return;\n\t\t\t\t\t\t\t\t\tsuper.navTo(\n\t\t\t\t\t\t\t\t\t\ttarget.route,\n\t\t\t\t\t\t\t\t\t\ttarget.parameters ?? {},\n\t\t\t\t\t\t\t\t\t\tcomponentTargetInfo,\n\t\t\t\t\t\t\t\t\t\tchain.replace,\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tthis._phase = {\n\t\t\t\t\tkind: \"committing\",\n\t\t\t\t\troute: toRoute,\n\t\t\t\t\thash: targetHash,\n\t\t\t\t\torigin: \"redirect\",\n\t\t\t\t\tdirection: chain.direction,\n\t\t\t\t\trestoreHash: chain.restoreHash,\n\t\t\t\t\twrittenOver: HashChanger.getInstance().getHash(),\n\t\t\t\t};\n\t\t\t\ttry {\n\t\t\t\t\t// Writing the hash the URL already shows changes nothing, except that a nested\n\t\t\t\t\t// router would add its prefix for an empty hash (see _restoreHash).\n\t\t\t\t\tconst hashShown = this.getHashChanger().getHash() === targetHash;\n\t\t\t\t\tif (typeof target === \"string\") {\n\t\t\t\t\t\tif (!hashShown) this.navTo(target, {}, {}, chain.replace);\n\t\t\t\t\t} else if (!hashShown || componentTargetInfo) {\n\t\t\t\t\t\tthis.navTo(target.route, target.parameters ?? {}, componentTargetInfo, chain.replace);\n\t\t\t\t\t}\n\t\t\t\t\tif (!this._commitAfterNavTo(componentTargetInfo)) {\n\t\t\t\t\t\tthis._blockNavigation(chain.attemptedHash, chain.restoreHash);\n\t\t\t\t\t}\n\t\t\t\t} finally {\n\t\t\t\t\tif (this._phase.kind === \"committing\") {\n\t\t\t\t\t\tthis._phase = IDLE;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"block\":\n\t\t\t\tthis._blockNavigation(chain.attemptedHash, chain.restoreHash);\n\t\t\t\tbreak;\n\t\t\tcase \"redirect\":\n\t\t\t\tthis._redirect(decision.target, chain);\n\t\t\t\tbreak;\n\t\t\tcase \"error\":\n\t\t\t\tthis._errorNavigation(decision.error, chain.attemptedHash, chain.restoreHash);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t/** The route that matches a hash, and its arguments. For a hash that no route matches: no route (`\"\"`), no arguments. */\n\tprivate _matchRoute(hash: string): RouteInfo {\n\t\tconst info = this.getRouteInfoByHash(hash);\n\t\treturn { name: info?.name ?? \"\", arguments: info?.arguments ?? {} };\n\t}\n\n\t/**\n\t * The greedy routes that match `hash` in addition to `firstMatch`, the first route that\n\t * matches it. UI5 matches them as well and fires their events.\n\t */\n\tprivate _greedyMatches(hash: string, firstMatch: string): string[] {\n\t\treturn this._greedyRouteNames.filter((name) => name !== firstMatch && this.getRoute(name)?.match(hash));\n\t}\n\n\t/**\n\t * Evaluate the guards of a navigation: of the routes in its context, and of the greedy routes\n\t * that are left and entered with them. A hop of a redirect chain leaves no route.\n\t */\n\tprivate _evaluateGuards(context: GuardContext, redirectHop = false): GuardDecision | Promise<GuardDecision> {\n\t\treturn this._pipeline.evaluate(context, {\n\t\t\tskipLeaveGuards: redirectHop,\n\t\t\talsoLeaving: this._greedyMatches(context.fromHash, context.fromRoute),\n\t\t\talsoEntering: this._greedyMatches(context.toHash, context.toRoute),\n\t\t});\n\t}\n\n\t/**\n\t * Build the guard context of a navigation to `routeInfo`. A hop of a redirect chain passes the\n\t * chain, whose source route, source hash and bag are those of the original navigation.\n\t */\n\tprivate _createGuardContext(\n\t\trouteInfo: RouteInfo,\n\t\ttoHash: string,\n\t\tsignal: AbortSignal,\n\t\tchain?: RedirectChainContext,\n\t): GuardContext {\n\t\tconst fromRoute = chain ? chain.fromRoute : this._currentRoute;\n\t\treturn {\n\t\t\ttoRoute: routeInfo.name,\n\t\t\ttoHash,\n\t\t\ttoArguments: routeInfo.arguments,\n\t\t\tfromRoute,\n\t\t\tfromHash: chain ? chain.fromHash : (this._currentHash ?? \"\"),\n\t\t\tsignal,\n\t\t\tbag: chain ? chain.bag : new Map<string, unknown>(),\n\t\t\ttoMeta: this.getRouteMeta(routeInfo.name),\n\t\t\tfromMeta: this.getRouteMeta(fromRoute),\n\t\t\townerComponent: this._ownerComponent,\n\t\t};\n\t}\n\n\t/**\n\t * Start a new redirect chain for the given evaluating attempt.\n\t * Called by {@link _applyPreflightDecision} and {@link _applyDecision}\n\t * when a guard returns a redirect. Delegates to {@link _redirect} with\n\t * a fresh {@link RedirectChainContext}.\n\t */\n\tprivate _startRedirectChain(\n\t\ttarget: string | GuardRedirect,\n\t\thash: string,\n\t\tbag: Map<string, unknown>,\n\t\tattempt: NavigationAttempt,\n\t\treplace: boolean | undefined,\n\t): void {\n\t\tconst visited = new Set<string>();\n\t\tvisited.add(hash);\n\t\tthis._redirect(target, {\n\t\t\tvisited,\n\t\t\tattemptedHash: hash,\n\t\t\trestoreHash: attempt.restoreHash,\n\t\t\treplace,\n\t\t\tdirection: attempt.direction,\n\t\t\tfromRoute: this._currentRoute,\n\t\t\tfromHash: this._currentHash ?? \"\",\n\t\t\tsignal: attempt.controller.signal,\n\t\t\tgeneration: attempt.generation,\n\t\t\tbag,\n\t\t});\n\t}\n\n\t/**\n\t * Settle as Blocked. With `restoreHash` (default), the hash change of the navigation is\n\t * undone first (see {@link _settleUncommitted}). Preflight callers pass false unless they\n\t * superseded a hash-change navigation: otherwise the hash was never changed.\n\t */\n\tprivate _blockNavigation(attemptedHash?: string, restoreHash = true): void {\n\t\tthis._phase = IDLE;\n\t\tthis._settleUncommitted(\n\t\t\t{ status: NavigationOutcome.Blocked, route: this._currentRoute, hash: this._currentHash ?? \"\" },\n\t\t\tattemptedHash,\n\t\t\trestoreHash,\n\t\t);\n\t}\n\n\t/**\n\t * Clear pending state and flush an Error settlement.\n\t * Same structure as {@link _blockNavigation} but with `NavigationOutcome.Error`\n\t * and the error that caused the failure.\n\t */\n\tprivate _errorNavigation(error: unknown, attemptedHash?: string, restoreHash = true): void {\n\t\tthis._phase = IDLE;\n\t\tthis._settleUncommitted(\n\t\t\t{ status: NavigationOutcome.Error, route: this._currentRoute, hash: this._currentHash ?? \"\", error },\n\t\t\tattemptedHash,\n\t\t\trestoreHash,\n\t\t);\n\t}\n\n\t/**\n\t * Settle a navigation that did not commit. With `restoreHash`, the hash it left in the URL\n\t * is restored first, so that settlement handlers run on the final URL and a hash they set\n\t * is not overwritten. The exception is a first navigation: nothing is committed yet, so the\n\t * empty hash is restored after the settlement and parsed as a navigation of its own.\n\t * `whenBack` runs after the settlement.\n\t */\n\tprivate _settleUncommitted(\n\t\tresult: NavigationResult,\n\t\tattemptedHash: string | undefined,\n\t\trestoreHash: boolean,\n\t\twhenBack?: () => void,\n\t): void {\n\t\tconst loadDefaultRoute = restoreHash && this._currentHash === null && !!attemptedHash;\n\t\t// It settles once the URL is back.\n\t\tif (restoreHash && !loadDefaultRoute && !this._undoHashChange(result, whenBack)) return;\n\t\tthis._flushSettlement(result);\n\t\twhenBack?.();\n\t\t// Unless a handler navigated and committed in the meantime.\n\t\tif (loadDefaultRoute && this._currentHash === null) this._restoreHash(\"\", false);\n\t}\n\n\t/**\n\t * Describe how to undo the hash change that the navigation starts with. After `pending`, the\n\t * undo of a navigation that this one supersedes, it takes back both changes. A `parse()` that\n\t * is not `reported` by the hash changer comes with no hash change.\n\t */\n\tprivate _describeUndo(pending: HashChangeUndo | null, reported: boolean): HashChangeUndo | null {\n\t\tif (!reported) return pending;\n\t\tconst shown = HashChanger.getInstance().getHash();\n\t\tconst step = lastStep;\n\t\tif (!pending) return { first: shown, fullHash: undefined, shown, step, started: false };\n\t\tconst offset = pending.step && step ? pending.step.offset + step.offset : 0;\n\t\treturn {\n\t\t\tfirst: pending.first,\n\t\t\tfullHash: pending.fullHash,\n\t\t\tshown,\n\t\t\tstep: step && offset ? { offset, href: step.href } : null,\n\t\t\tstarted: false,\n\t\t};\n\t}\n\n\t/**\n\t * Put the URL back after a navigation that did not commit. Returns whether it is back;\n\t * otherwise `result` settles when it is.\n\t *\n\t * While the URL still shows the hash change that started the navigation, that change is undone\n\t * as a whole, so that the hashes of nested routers are back as well:\n\t * - A step through the browser history is taken back, which leaves the history as it was.\n\t * The browser does that asynchronously.\n\t * - Any other change (a new entry, or a step the browser does not report) has its entry replaced with\n\t * the full previous hash, once UI5 has reported the change to every router. Nested routers\n\t * have received their part of the refused hash by then; they receive the previous one next.\n\t *\n\t * `parse()` ends the wait when the hash change arrives that shows the full previous hash.\n\t *\n\t * If the URL has moved on since, only the hash of this router is restored. So it is while\n\t * no navigation has committed: the URL before the change showed no route of this router either.\n\t */\n\tprivate _undoHashChange(result: NavigationResult, whenBack?: () => void): boolean {\n\t\tconst undo = this._undo;\n\t\tconst hash = this._currentHash;\n\t\tconst rootHash = HashChanger.getInstance().getHash();\n\t\tif (undo === null || hash === null || undo.shown !== rootHash || undo.fullHash === rootHash) {\n\t\t\tthis._restoreHash(hash ?? \"\");\n\t\t\treturn true;\n\t\t}\n\t\tconst href = window.location.href;\n\t\tundo.started = true;\n\t\tthis._phase = { kind: \"restoring\", result, whenBack };\n\t\tif (undoneHref === href) {\n\t\t\t// Another router is taking the step back.\n\t\t} else if (undo.step) {\n\t\t\tundoneHref = href;\n\t\t\twindow.history.go(-undo.step.offset);\n\t\t} else if (undo.fullHash === undefined) {\n\t\t\t// UI5 is still reporting the change to the nested routers.\n\t\t\tthis._phase = { ...this._phase, awaitsReport: true };\n\t\t} else {\n\t\t\tthis._replaceFullHash(undo.fullHash);\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * Replace the hash of the root hash changer with the full previous hash, and settle the\n\t * navigation that waits for it unless `parse()` has done so.\n\t */\n\tprivate _replaceFullHash(fullHash: string): void {\n\t\tHashChanger.getInstance().replaceHash(fullHash, HistoryDirection.Unknown);\n\t\tthis._finishRestore();\n\t}\n\n\t/**\n\t * Settle the navigation that waited for the URL to be back: on `hash`, if the hash changer\n\t * has reported one with the URL.\n\t */\n\tprivate _finishRestore(hash?: string): void {\n\t\tconst phase = this._phase;\n\t\tif (phase.kind !== \"restoring\") return;\n\t\tthis._phase = IDLE;\n\t\tthis._flushSettlement(hash === undefined ? phase.result : { ...phase.result, hash });\n\t\tphase.whenBack?.();\n\t}\n\n\t/**\n\t * Restore the previous hash of this router without creating a history entry\n\t * (see {@link _undoHashChange} for the hash change of a navigation).\n\t * Assumes replaceHash fires hashChanged synchronously (validated by test).\n\t * `_currentRoute` stays unchanged because the navigation never\n\t * committed. The user remains on the same logical route.\n\t *\n\t * A hash that the hash changer already shows is not written again: the navigation never\n\t * moved it. For a nested router, writing its empty hash would add its prefix to the browser\n\t * hash (`shell` becomes `shell&/child/`).\n\t */\n\tprivate _restoreHash(hash: string, suppressParse = true): void {\n\t\tconst hashChanger = this.getHashChanger();\n\t\tif (hashChanger.getHash() === hash) return;\n\t\tthis._suppressedHash = suppressParse ? hash : null;\n\t\tvoid hashChanger.replaceHash(hash, HistoryDirection.Unknown);\n\t\tthis._suppressedHash = null;\n\t}\n\n\t/**\n\t * Collect all route names and their patterns from the router.\n\t * Skips routes whose pattern is undefined (no pattern configured).\n\t */\n\tprivate _collectRoutePatterns(): RoutePattern[] {\n\t\tconst result: RoutePattern[] = [];\n\t\tfor (const name of this._routeNames) {\n\t\t\tconst pattern = this.getRoute(name)?.getPattern();\n\t\t\tif (pattern !== undefined) result.push({ name, pattern });\n\t\t}\n\t\treturn result;\n\t}\n\n\t/**\n\t * Register one manifest guard: as the last guard of its route, or in front of the guard\n\t * `before`. A registration error (`unknownRouteRegistration: \"throw\"` for an unknown route)\n\t * is logged and skips the guard: no caller of the manifest config could catch it, and it\n\t * must not keep the router from starting.\n\t */\n\tprivate _registerManifestGuard(descriptor: ManifestGuardDescriptor, guardFn: GuardFn, before?: GuardFn): void {\n\t\ttry {\n\t\t\tif (descriptor.route === \"*\") {\n\t\t\t\tthis.addGuard(guardFn);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (descriptor.type === \"leave\") {\n\t\t\t\tthis._handleUnknownRouteRegistration(descriptor.route, \"addLeaveGuard\");\n\t\t\t\tthis._pipeline.addLeaveGuard(descriptor.route, guardFn, before);\n\t\t\t} else {\n\t\t\t\tthis._handleUnknownRouteRegistration(descriptor.route, \"addRouteGuard\");\n\t\t\t\tthis._pipeline.addEnterGuard(descriptor.route, guardFn, before);\n\t\t\t}\n\t\t\tthis._manifestGuards.push({ descriptor, fn: guardFn });\n\t\t} catch (err: unknown) {\n\t\t\tLog.error(`guardRouter.guards: failed to register \"${descriptor.modulePath}\"`, String(err), LOG_COMPONENT);\n\t\t}\n\t}\n\n\t/** Register the guards of each descriptor, loading their modules on first use (see `createLazyGuards`). */\n\tprivate _registerLazyGuards(descriptors: ManifestGuardDescriptor[]): void {\n\t\tfor (const descriptor of descriptors) {\n\t\t\tfor (const fn of createLazyGuards(descriptor)) this._registerManifestGuard(descriptor, fn);\n\t\t}\n\t}\n\n\t/**\n\t * Clean up guards on destroy. Bumps generation to discard pending async results.\n\t * A second call does nothing, like `sap.ui.core.routing.Router#destroy`.\n\t *\n\t * @since 1.0.1\n\t */\n\toverride destroy(): this {\n\t\tif (this._destroyed) return this;\n\t\tthis._destroyed = true;\n\t\tthis._pipeline.clear();\n\t\tthis._pendingGuardDescriptors = [];\n\t\tthis._sourceDescriptors = [];\n\t\tthis._manifestGuards = [];\n\t\tthis._cancelPendingNavigation();\n\t\tthis._lastSettlement = null;\n\t\tthis._detachHashListeners();\n\t\tthis._meta.clear();\n\t\tsuper.destroy();\n\t\treturn this;\n\t}\n}\n"],"mappings":"AAAA,qZAsBOA,EAAiBC,EAAAC,GAAA,MACjBC,EAAaF,EAAAG,GAAA,MAAwBC,EAAaD,EAAA,uBAAEE,EAAiBF,EAAA,2BAAEG,EAAaH,EAAA,uBAC5D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AKgB,gBAAkB,GACvBhB,KAAKiM,2BACLjM,KAAKc,gBAAkB,KACvBd,KAAKkP,uBACLlP,KAAKgC,MAAM0R,QACXC,yBAAA3T,MACA,OAAOA,IACR,IAAC,OAnuDmBX,CAAM","ignoreList":[],"sourceRoot":""}},{"offset":{"line":8,"column":0},"map":{"version":3,"names":["NavigationOutcome","_interopRequireDefault","__NavigationOutcome","library","Lib","init","apiVersion","name","version","dependencies","types","interfaces","controls","elements","noLibraryCSS","DataType","registerEnum"],"sources":["./library.ts"],"sourcesContent":["import Lib from \"sap/ui/core/Lib\";\nimport DataType from \"sap/ui/base/DataType\";\nimport \"sap/ui/core/library\";\nimport \"sap/m/library\";\nimport NavigationOutcome from \"./NavigationOutcome\";\n\nconst library = Lib.init({\n\tapiVersion: 2,\n\tname: \"ui5.guard.router\",\n\tversion: \"1.7.0\",\n\tdependencies: [\"sap.ui.core\", \"sap.m\"],\n\ttypes: [\"ui5.guard.router.NavigationOutcome\"],\n\tinterfaces: [],\n\tcontrols: [],\n\telements: [],\n\tnoLibraryCSS: true,\n});\n\nDataType.registerEnum(\"ui5.guard.router.NavigationOutcome\", NavigationOutcome);\n\nexport default library;\n"],"mappings":"AAAA,4QAIOA,EAAiBC,EAAAC,GAExB,MAAMC,EAAUC,EAAIC,KAAK,CACxBC,WAAY,EACZC,KAAM,mBACNC,QAAS,QACTC,aAAc,CAAC,cAAe,SAC9BC,MAAO,CAAC,sCACRC,WAAY,GACZC,SAAU,GACVC,SAAU,GACVC,aAAc,OAGfC,EAASC,aAAa,qCAAsChB,GAAmB,OAEhEG,CAAO","ignoreList":[],"sourceRoot":""}},{"offset":{"line":9,"column":0},"map":{"version":3,"names":[],"sources":["library-preload.js?bundle-code-0"],"mappings":"AAAA;AACA","sourcesContent":["sap.ui.require.preload({\n"],"sourceRoot":""}},{"offset":{"line":12,"column":0},"map":{"version":3,"file":"types.js","names":[],"sources":[],"mappings":"","ignoreList":[],"sourceRoot":""}}]}
|