# Home

- File ID: file:h6mj95:home-razor
- Path: NexusReader.UI.Shared/Pages/Home.razor
- Role: ui-page
- Layer: frontend

## Purpose

Razor UI page for the Nexus E-Reader reader experience: mounts the ReaderCanvas, handles navigation/book selection from route/query or user profile, wires UI events (quiz, focus mode), initializes JS focus interop, and cleans up resources on disposal.

## Key Details

Wires UI-level services and events to coordinate which book/chapter is active (route or profile fallback), initializes focus-mode and optional JS keyboard listener on first render, and ensures proper event unsubscription and JS interop disposal in DisposeAsync to avoid leaks.

## Symbols

- Home: Razor UI page for the Nexus E-Reader reader experience: mounts the ReaderCanvas, handles navigation/book selection from route/query or user profile, wires UI events (quiz, focus mode), initializes JS focus interop, and cleans up resources on disposal.
- OnInitialized(): Subscribe to UI-level events for quiz requests and focus-mode changes when the component is initialized.
- OnParametersSetAsync(): React to route/query changes: parse chapter query, determine BookId from route or fallback to last-read book from profile, and instruct navigation service to load the correct book/chapter.
- OnAfterRenderAsync(): On first render initialize focus-mode service and attempt to attach a JS keyboard listener, updating state afterwards.
- OnFocusKeypressed(): JS-invokable handler called when the focus-mode key is pressed: toggles focus mode and refreshes UI.
- HandleNodeSelected(): Scroll the embedded ReaderCanvas to a particular node when a node selection event occurs.
- HandleQuizRequestedAsync(): Receive quiz request events, set active quiz block id and request UI update.
- HandleUpdate(): Request a UI update from other subscribers (used as an event handler).
- DisposeAsync(): Unsubscribe event handlers, detach JS keyboard listener if present, dispose JS interop objects and DotNetObjectReference when the component is disposed.
- BookId: Component Parameter holding optional route BookId (Guid?).

## Dependencies

- imports NexusReader.UI.Shared/Services/IQuizStateService.cs
- imports NexusReader.UI.Shared/Services/IFocusModeService.cs
- imports NexusReader.UI.Shared/Services/IReaderNavigationService.cs

## Calls

- calls NexusReader.UI.Shared/Services/IReaderNavigationService.cs
- calls NexusReader.UI.Shared/Services/IReaderNavigationService.cs
- calls NexusReader.UI.Shared/Services/IFocusModeService.cs
- calls NexusReader.UI.Shared/Services/IFocusModeService.cs

## Unresolved References

- dependency-target: NexusReader.UI.Shared/Services/IIdentityService.cs
- dependency-target: NexusReader.UI.Shared/Components/ReaderCanvas.razor
- call-target: NexusReader.UI.Shared/Services/IIdentityService.cs
- call-target: NexusReader.UI.Shared/Components/ReaderCanvas.razor
- call-target: NexusReader.UI.Shared/Services/IQuizStateService.cs
- call-target: NexusReader.UI.Shared/Services/IFocusModeService.cs
- call-target: NexusReader.UI.Shared/Components/ReaderCanvas.razor

## Coverage

- Symbols: 10
- Executable symbols: 8
- Executable symbols with control flow: 8
- Grounded edges: 17
- Unresolved references: 7
- Control-flow fragments: 8
- Unresolved jumps: 5
- Unsupported constructs: 0
- Control-flow coverage: 100%
- Required diagrams: 2
- Generated diagrams: 8

## Control Flow Fragments

- OnInitialized: 4 nodes, 3 edges, 0 jumps, 0 unsupported constructs
- OnParametersSetAsync: 39 nodes, 46 edges, 3 jumps, 0 unsupported constructs
- OnAfterRenderAsync: 18 nodes, 19 edges, 1 jumps, 0 unsupported constructs
- OnFocusKeypressed: 6 nodes, 5 edges, 1 jumps, 0 unsupported constructs
- HandleNodeSelected: 12 nodes, 13 edges, 1 jumps, 0 unsupported constructs
- HandleQuizRequestedAsync: 5 nodes, 4 edges, 0 jumps, 0 unsupported constructs
- HandleUpdate: 3 nodes, 2 edges, 0 jumps, 0 unsupported constructs
- DisposeAsync: 21 nodes, 22 edges, 3 jumps, 0 unsupported constructs

## Diagrams

### Home Neighborhood

_Warnings: diagram file_h6mj95_home_razor_neighborhood_view exceeds preferred complexity thresholds (17 nodes, 7 edges)._

```mermaid
---
config:
  flowchart:
    defaultRenderer: "elk"
---
flowchart LR
    class_jfh85m_home("Home")
    file_h6mj95_home_razor("Home")
    method_1ib6h4r_handlequizrequestedasync[["HandleQuizRequestedAsync()"]]
    method_1l4808t_handleupdate[["HandleUpdate()"]]
    method_1r63qu7_onafterrenderasync[["OnAfterRenderAsync()"]]
    method_1yypduz_oninitialized[["OnInitialized()"]]
    method_6vyv4w_handlenodeselected[["HandleNodeSelected()"]]
    method_99k8q7_disposeasync[["DisposeAsync()"]]
    method_p5ejmn_onparameterssetasync[["OnParametersSetAsync()"]]
    method_whfss9_onfocuskeypressed[["OnFocusKeypressed()"]]
    file_savadk_iquizstateservice_cs[/"IQuizStateService"/]
    file_wgkae9_ireadernavigationservice_cs[/"IReaderNavigationService"/]
    file_xs3ks1_ifocusmodeservice_cs[/"IFocusModeService"/]
    method_17j6y8x_toggleasync[/"IFocusModeService"/]
    method_4o7htd_setbook[/"IReaderNavigationService"/]
    method_fpl7t6_initializeasync[/"IFocusModeService"/]
    type_1t001js_bookid[/"BookId"/]
    file_h6mj95_home_razor -->|IQuizStateService| file_savadk_iquizstateservice_cs
    file_h6mj95_home_razor -->|IReaderNavigationService| file_wgkae9_ireadernavigationservice_cs
    file_h6mj95_home_razor -->|IFocusModeService| file_xs3ks1_ifocusmodeservice_cs
    method_1r63qu7_onafterrenderasync -->|IFocusModeService| method_fpl7t6_initializeasync
    method_p5ejmn_onparameterssetasync -->|IReaderNavigationService| method_4o7htd_setbook
    method_p5ejmn_onparameterssetasync -->|IReaderNavigationService| method_4o7htd_setbook
    method_whfss9_onfocuskeypressed -->|IFocusModeService| method_17j6y8x_toggleasync
```

### Home Execution Overview

```mermaid
flowchart TD
    class_jfh85m_home("Home")
    method_1ib6h4r_handlequizrequestedasync[["HandleQuizRequestedAsync()"]]
    method_1l4808t_handleupdate[["HandleUpdate()"]]
    method_1r63qu7_onafterrenderasync[["OnAfterRenderAsync()"]]
    method_1yypduz_oninitialized[["OnInitialized()"]]
    method_6vyv4w_handlenodeselected[["HandleNodeSelected()"]]
    method_99k8q7_disposeasync[["DisposeAsync()"]]
    method_p5ejmn_onparameterssetasync[["OnParametersSetAsync()"]]
    method_whfss9_onfocuskeypressed[["OnFocusKeypressed()"]]
    method_17j6y8x_toggleasync[/"IFocusModeService"/]
    method_4o7htd_setbook[/"IReaderNavigationService"/]
    method_fpl7t6_initializeasync[/"IFocusModeService"/]
    unresolved_unresolved_116y6m9_call_target{"Unresolved: ScrollToNodeAsync"}
    unresolved_unresolved_40zgiz_call_target{"Unresolved: Dispose/interop cleanup (via JS module)"}
    unresolved_unresolved_dhtaal_call_target{"Unresolved: OnFocusModeChanged - event unsubscription"}
    unresolved_unresolved_ftsewk_call_target{"Unresolved: GetProfileAsync"}
    unresolved_unresolved_ld2maq_call_target{"Unresolved: OnQuizRequested - event unsubscription"}
    class_jfh85m_home -->|contains| method_1ib6h4r_handlequizrequestedasync
    class_jfh85m_home -->|contains| method_1l4808t_handleupdate
    class_jfh85m_home -->|contains| method_1r63qu7_onafterrenderasync
    class_jfh85m_home -->|contains| method_1yypduz_oninitialized
    class_jfh85m_home -->|contains| method_6vyv4w_handlenodeselected
    class_jfh85m_home -->|contains| method_99k8q7_disposeasync
    class_jfh85m_home -->|contains| method_p5ejmn_onparameterssetasync
    class_jfh85m_home -->|contains| method_whfss9_onfocuskeypressed
    method_1r63qu7_onafterrenderasync -->|IFocusModeService| method_fpl7t6_initializeasync
    method_6vyv4w_handlenodeselected -->|unresolved call| unresolved_unresolved_116y6m9_call_target
    method_99k8q7_disposeasync -->|unresolved call| unresolved_unresolved_40zgiz_call_target
    method_99k8q7_disposeasync -->|unresolved call| unresolved_unresolved_dhtaal_call_target
    method_99k8q7_disposeasync -->|unresolved call| unresolved_unresolved_ld2maq_call_target
    method_p5ejmn_onparameterssetasync -->|IReaderNavigationService| method_4o7htd_setbook
    method_p5ejmn_onparameterssetasync -->|IReaderNavigationService| method_4o7htd_setbook
    method_p5ejmn_onparameterssetasync -->|unresolved call| unresolved_unresolved_ftsewk_call_target
    method_whfss9_onfocuskeypressed -->|IFocusModeService| method_17j6y8x_toggleasync
```

### Home Method Interactions

```mermaid
flowchart LR
    method_1ib6h4r_handlequizrequestedasync[["HandleQuizRequestedAsync()"]]
    method_1l4808t_handleupdate[["HandleUpdate()"]]
    method_1r63qu7_onafterrenderasync[["OnAfterRenderAsync()"]]
    method_1yypduz_oninitialized[["OnInitialized()"]]
    method_6vyv4w_handlenodeselected[["HandleNodeSelected()"]]
    method_99k8q7_disposeasync[["DisposeAsync()"]]
    method_p5ejmn_onparameterssetasync[["OnParametersSetAsync()"]]
    method_whfss9_onfocuskeypressed[["OnFocusKeypressed()"]]
    method_17j6y8x_toggleasync("IFocusModeService")
    method_4o7htd_setbook("IReaderNavigationService")
    method_fpl7t6_initializeasync("IFocusModeService")
    method_1r63qu7_onafterrenderasync -->|IFocusModeService| method_fpl7t6_initializeasync
    method_p5ejmn_onparameterssetasync -->|IReaderNavigationService| method_4o7htd_setbook
    method_p5ejmn_onparameterssetasync -->|IReaderNavigationService| method_4o7htd_setbook
    method_whfss9_onfocuskeypressed -->|IFocusModeService| method_17j6y8x_toggleasync
```

### Home Application Flow

```mermaid
flowchart TD
    method_1r63qu7_onafterrenderasync(["OnAfterRenderAsync()"])
    method_p5ejmn_onparameterssetasync(["OnParametersSetAsync()"])
    method_4o7htd_setbook("setbook")
    method_fpl7t6_initializeasync("initializeasync")
    method_1r63qu7_onafterrenderasync -->|IFocusModeService| method_fpl7t6_initializeasync
    method_p5ejmn_onparameterssetasync -->|IReaderNavigationService| method_4o7htd_setbook
    method_p5ejmn_onparameterssetasync -->|IReaderNavigationService| method_4o7htd_setbook
```

### OnParametersSetAsync() Control Flow

_Warnings: diagram method_p5ejmn_onparameterssetasync__fragment_diagram exceeds preferred complexity thresholds (39 nodes, 46 edges)._

```mermaid
---
config:
  flowchart:
    defaultRenderer: "elk"
---
flowchart TD
    method_p5ejmn_onparameterssetasync__call_49_SetBook[["SetBook"]]
    method_p5ejmn_onparameterssetasync__call_55_GetProfileAsync[["GetProfileAsync"]]
    method_p5ejmn_onparameterssetasync__call_58_SetBook[["SetBook"]]
    method_p5ejmn_onparameterssetasync__action_40_onparameterssetasync_branch_40_0__condition{"Microsoft.AspNetCore.WebUtilities.QueryHelpers.ParseQuery(uri.Query).TryGetValue(\\"chapter\\", out var chapterValue)"}
    method_p5ejmn_onparameterssetasync__action_40_onparameterssetasync_branch_40_0__false("false")
    method_p5ejmn_onparameterssetasync__action_40_onparameterssetasync_branch_40_0__merge("merge")
    method_p5ejmn_onparameterssetasync__action_40_onparameterssetasync_branch_40_0__true("true")
    method_p5ejmn_onparameterssetasync__action_40_parse_40__linear("Query parsing")
    method_p5ejmn_onparameterssetasync__action_45_guard_clause_45__condition{"BookId.HasValue && BookId != Guid.Empty"}
    method_p5ejmn_onparameterssetasync__action_45_guard_clause_45__false("skip")
    method_p5ejmn_onparameterssetasync__action_45_guard_clause_45__merge("merge")
    method_p5ejmn_onparameterssetasync__action_45_guard_clause_45__true("maybe SetBook")
    method_p5ejmn_onparameterssetasync__action_45_onparameterssetasync_branch_45_1__condition{"BookId.HasValue && BookId.Value != Guid.Empty"}
    method_p5ejmn_onparameterssetasync__action_45_onparameterssetasync_branch_45_1__false("false")
    method_p5ejmn_onparameterssetasync__action_45_onparameterssetasync_branch_45_1__merge("merge")
    method_p5ejmn_onparameterssetasync__action_45_onparameterssetasync_branch_45_1__true("true")
    method_p5ejmn_onparameterssetasync__action_47_onparameterssetasync_branch_47_2__condition{"NavService.CurrentEbookId != BookId.Value || NavService.CurrentChapterIndex != chapterIndex"}
    method_p5ejmn_onparameterssetasync__action_47_onparameterssetasync_branch_47_2__false("false")
    method_p5ejmn_onparameterssetasync__action_47_onparameterssetasync_branch_47_2__merge("merge")
    method_p5ejmn_onparameterssetasync__action_47_onparameterssetasync_branch_47_2__true("true")
    method_p5ejmn_onparameterssetasync__action_52_branch_52__condition{"NavService.CurrentEbookId == Guid.Empty and no BookId in URL"}
    method_p5ejmn_onparameterssetasync__action_52_branch_52__false("do nothing")
    method_p5ejmn_onparameterssetasync__action_52_branch_52__merge("merge")
    method_p5ejmn_onparameterssetasync__action_52_branch_52__true("load last read")
    method_p5ejmn_onparameterssetasync__action_52_onparameterssetasync_branch_52_3__condition{"NavService.CurrentEbookId == Guid.Empty"}
    method_p5ejmn_onparameterssetasync__action_52_onparameterssetasync_branch_52_3__false("false")
    method_p5ejmn_onparameterssetasync__action_52_onparameterssetasync_branch_52_3__merge("merge")
    method_p5ejmn_onparameterssetasync__action_52_onparameterssetasync_branch_52_3__true("true")
    method_p5ejmn_onparameterssetasync__action_52_onparameterssetasync_fallback_52_4__condition{"Falls back to alternate path"}
    method_p5ejmn_onparameterssetasync__action_52_onparameterssetasync_fallback_52_4__false("otherwise")
    method_p5ejmn_onparameterssetasync__action_52_onparameterssetasync_fallback_52_4__merge("merge")
    method_p5ejmn_onparameterssetasync__action_52_onparameterssetasync_fallback_52_4__true("fallback")
    method_p5ejmn_onparameterssetasync__action_55_onparameterssetasync_await_55_5__await[["Waits for async work"]]
    method_p5ejmn_onparameterssetasync__action_56_onparameterssetasync_branch_56_6__condition{"profileResult.IsSuccess && profileResult.Value.LastReadBook != null"}
    method_p5ejmn_onparameterssetasync__action_56_onparameterssetasync_branch_56_6__false("false")
    method_p5ejmn_onparameterssetasync__action_56_onparameterssetasync_branch_56_6__merge("merge")
    method_p5ejmn_onparameterssetasync__action_56_onparameterssetasync_branch_56_6__true("true")
    method_p5ejmn_onparameterssetasync__entry(["OnParametersSetAsync entry"])
    method_p5ejmn_onparameterssetasync__implicit_return(["return"])
    method_p5ejmn_onparameterssetasync__action_40_onparameterssetasync_branch_40_0__condition -->|false| method_p5ejmn_onparameterssetasync__action_40_onparameterssetasync_branch_40_0__false
    method_p5ejmn_onparameterssetasync__action_40_onparameterssetasync_branch_40_0__condition -->|true| method_p5ejmn_onparameterssetasync__action_40_onparameterssetasync_branch_40_0__true
    method_p5ejmn_onparameterssetasync__action_40_onparameterssetasync_branch_40_0__false -->|next| method_p5ejmn_onparameterssetasync__action_40_onparameterssetasync_branch_40_0__merge
    method_p5ejmn_onparameterssetasync__action_40_onparameterssetasync_branch_40_0__merge -->|next| method_p5ejmn_onparameterssetasync__action_45_guard_clause_45__condition
    method_p5ejmn_onparameterssetasync__action_40_onparameterssetasync_branch_40_0__true -->|next| method_p5ejmn_onparameterssetasync__action_40_onparameterssetasync_branch_40_0__merge
    method_p5ejmn_onparameterssetasync__action_40_parse_40__linear -->|next| method_p5ejmn_onparameterssetasync__action_40_onparameterssetasync_branch_40_0__condition
    method_p5ejmn_onparameterssetasync__action_45_guard_clause_45__condition -->|skip| method_p5ejmn_onparameterssetasync__action_45_guard_clause_45__false
    method_p5ejmn_onparameterssetasync__action_45_guard_clause_45__condition -->|maybe SetBook| method_p5ejmn_onparameterssetasync__action_45_guard_clause_45__true
    method_p5ejmn_onparameterssetasync__action_45_guard_clause_45__false -->|next| method_p5ejmn_onparameterssetasync__action_45_guard_clause_45__merge
    method_p5ejmn_onparameterssetasync__action_45_guard_clause_45__merge -->|next| method_p5ejmn_onparameterssetasync__action_45_onparameterssetasync_branch_45_1__condition
    method_p5ejmn_onparameterssetasync__action_45_guard_clause_45__true -->|next| method_p5ejmn_onparameterssetasync__action_45_guard_clause_45__merge
    method_p5ejmn_onparameterssetasync__action_45_onparameterssetasync_branch_45_1__condition -->|false| method_p5ejmn_onparameterssetasync__action_45_onparameterssetasync_branch_45_1__false
    method_p5ejmn_onparameterssetasync__action_45_onparameterssetasync_branch_45_1__condition -->|true| method_p5ejmn_onparameterssetasync__action_45_onparameterssetasync_branch_45_1__true
    method_p5ejmn_onparameterssetasync__action_45_onparameterssetasync_branch_45_1__false -->|next| method_p5ejmn_onparameterssetasync__action_45_onparameterssetasync_branch_45_1__merge
    method_p5ejmn_onparameterssetasync__action_45_onparameterssetasync_branch_45_1__merge -->|next| method_p5ejmn_onparameterssetasync__action_47_onparameterssetasync_branch_47_2__condition
    method_p5ejmn_onparameterssetasync__action_45_onparameterssetasync_branch_45_1__true -->|next| method_p5ejmn_onparameterssetasync__action_45_onparameterssetasync_branch_45_1__merge
    method_p5ejmn_onparameterssetasync__action_47_onparameterssetasync_branch_47_2__condition -->|false| method_p5ejmn_onparameterssetasync__action_47_onparameterssetasync_branch_47_2__false
    method_p5ejmn_onparameterssetasync__action_47_onparameterssetasync_branch_47_2__condition -->|true| method_p5ejmn_onparameterssetasync__action_47_onparameterssetasync_branch_47_2__true
    method_p5ejmn_onparameterssetasync__action_47_onparameterssetasync_branch_47_2__false -->|next| method_p5ejmn_onparameterssetasync__action_47_onparameterssetasync_branch_47_2__merge
    method_p5ejmn_onparameterssetasync__action_47_onparameterssetasync_branch_47_2__merge -->|BookId.Value, chapterIndex from query| method_p5ejmn_onparameterssetasync__call_49_SetBook
    method_p5ejmn_onparameterssetasync__action_47_onparameterssetasync_branch_47_2__true -->|next| method_p5ejmn_onparameterssetasync__action_47_onparameterssetasync_branch_47_2__merge
    method_p5ejmn_onparameterssetasync__action_52_branch_52__condition -->|do nothing| method_p5ejmn_onparameterssetasync__action_52_branch_52__false
    method_p5ejmn_onparameterssetasync__action_52_branch_52__condition -->|load last read| method_p5ejmn_onparameterssetasync__action_52_branch_52__true
    method_p5ejmn_onparameterssetasync__action_52_branch_52__false -->|next| method_p5ejmn_onparameterssetasync__action_52_branch_52__merge
    method_p5ejmn_onparameterssetasync__action_52_branch_52__merge -->|next| method_p5ejmn_onparameterssetasync__action_52_onparameterssetasync_branch_52_3__condition
    method_p5ejmn_onparameterssetasync__action_52_branch_52__true -->|next| method_p5ejmn_onparameterssetasync__action_52_branch_52__merge
    method_p5ejmn_onparameterssetasync__action_52_onparameterssetasync_branch_52_3__condition -->|false| method_p5ejmn_onparameterssetasync__action_52_onparameterssetasync_branch_52_3__false
    method_p5ejmn_onparameterssetasync__action_52_onparameterssetasync_branch_52_3__condition -->|true| method_p5ejmn_onparameterssetasync__action_52_onparameterssetasync_branch_52_3__true
    method_p5ejmn_onparameterssetasync__action_52_onparameterssetasync_branch_52_3__false -->|next| method_p5ejmn_onparameterssetasync__action_52_onparameterssetasync_branch_52_3__merge
    method_p5ejmn_onparameterssetasync__action_52_onparameterssetasync_branch_52_3__merge -->|next| method_p5ejmn_onparameterssetasync__action_55_onparameterssetasync_await_55_5__await
    method_p5ejmn_onparameterssetasync__action_52_onparameterssetasync_branch_52_3__true -->|next| method_p5ejmn_onparameterssetasync__action_52_onparameterssetasync_branch_52_3__merge
    method_p5ejmn_onparameterssetasync__action_52_onparameterssetasync_fallback_52_4__condition -->|otherwise| method_p5ejmn_onparameterssetasync__action_52_onparameterssetasync_fallback_52_4__false
    method_p5ejmn_onparameterssetasync__action_52_onparameterssetasync_fallback_52_4__condition -->|fallback| method_p5ejmn_onparameterssetasync__action_52_onparameterssetasync_fallback_52_4__true
    method_p5ejmn_onparameterssetasync__action_52_onparameterssetasync_fallback_52_4__false -->|next| method_p5ejmn_onparameterssetasync__action_52_onparameterssetasync_fallback_52_4__merge
    method_p5ejmn_onparameterssetasync__action_52_onparameterssetasync_fallback_52_4__merge -->|next| method_p5ejmn_onparameterssetasync__action_52_branch_52__condition
    method_p5ejmn_onparameterssetasync__action_52_onparameterssetasync_fallback_52_4__true -->|next| method_p5ejmn_onparameterssetasync__action_52_onparameterssetasync_fallback_52_4__merge
    method_p5ejmn_onparameterssetasync__action_55_onparameterssetasync_await_55_5__await -->|none| method_p5ejmn_onparameterssetasync__call_55_GetProfileAsync
    method_p5ejmn_onparameterssetasync__action_56_onparameterssetasync_branch_56_6__condition -->|false| method_p5ejmn_onparameterssetasync__action_56_onparameterssetasync_branch_56_6__false
    method_p5ejmn_onparameterssetasync__action_56_onparameterssetasync_branch_56_6__condition -->|true| method_p5ejmn_onparameterssetasync__action_56_onparameterssetasync_branch_56_6__true
    method_p5ejmn_onparameterssetasync__action_56_onparameterssetasync_branch_56_6__false -->|next| method_p5ejmn_onparameterssetasync__action_56_onparameterssetasync_branch_56_6__merge
    method_p5ejmn_onparameterssetasync__action_56_onparameterssetasync_branch_56_6__merge -->|profileResult.Value.LastReadBook.Id and computed chapter index| method_p5ejmn_onparameterssetasync__call_58_SetBook
    method_p5ejmn_onparameterssetasync__action_56_onparameterssetasync_branch_56_6__true -->|next| method_p5ejmn_onparameterssetasync__action_56_onparameterssetasync_branch_56_6__merge
    method_p5ejmn_onparameterssetasync__call_49_SetBook -->|fallback| method_p5ejmn_onparameterssetasync__action_52_onparameterssetasync_fallback_52_4__condition
    method_p5ejmn_onparameterssetasync__call_55_GetProfileAsync -->|next| method_p5ejmn_onparameterssetasync__action_56_onparameterssetasync_branch_56_6__condition
    method_p5ejmn_onparameterssetasync__call_58_SetBook -->|return| method_p5ejmn_onparameterssetasync__implicit_return
    method_p5ejmn_onparameterssetasync__entry -->|next| method_p5ejmn_onparameterssetasync__action_40_parse_40__linear
```

### OnAfterRenderAsync() Control Flow

```mermaid
flowchart TD
    method_1r63qu7_onafterrenderasync__call_67_InitializeAsync[["InitializeAsync"]]
    method_1r63qu7_onafterrenderasync__action_65_guard_clause_65__condition{"firstRender == true"}
    method_1r63qu7_onafterrenderasync__action_65_guard_clause_65__false("skip")
    method_1r63qu7_onafterrenderasync__action_65_guard_clause_65__merge("merge")
    method_1r63qu7_onafterrenderasync__action_65_guard_clause_65__true("initialize")
    method_1r63qu7_onafterrenderasync__action_65_onafterrenderasync_branch_65_0__condition{"firstRender"}
    method_1r63qu7_onafterrenderasync__action_65_onafterrenderasync_branch_65_0__false("false")
    method_1r63qu7_onafterrenderasync__action_65_onafterrenderasync_branch_65_0__merge("merge")
    method_1r63qu7_onafterrenderasync__action_65_onafterrenderasync_branch_65_0__true("true")
    method_1r63qu7_onafterrenderasync__action_67_onafterrenderasync_await_67_1__await[["Waits for async work"]]
    method_1r63qu7_onafterrenderasync__action_68_onafterrenderasync_try_68_2__try("Begins protected execution")
    method_1r63qu7_onafterrenderasync__action_68_try_catch_68__linear("Dynamic JS interop load")
    method_1r63qu7_onafterrenderasync__action_69_onafterrenderasync_await_69_3__await[["Waits for async work"]]
    method_1r63qu7_onafterrenderasync__action_71_onafterrenderasync_await_71_4__await[["Waits for async work"]]
    method_1r63qu7_onafterrenderasync__action_72_onafterrenderasync_catch_72_5__catch("Handles exception path")
    method_1r63qu7_onafterrenderasync__action_73_state_change_73__linear("Force UI refresh")
    method_1r63qu7_onafterrenderasync__entry(["OnAfterRenderAsync entry"])
    method_1r63qu7_onafterrenderasync__implicit_return(["return"])
    method_1r63qu7_onafterrenderasync__action_65_guard_clause_65__condition -->|skip| method_1r63qu7_onafterrenderasync__action_65_guard_clause_65__false
    method_1r63qu7_onafterrenderasync__action_65_guard_clause_65__condition -->|initialize| method_1r63qu7_onafterrenderasync__action_65_guard_clause_65__true
    method_1r63qu7_onafterrenderasync__action_65_guard_clause_65__false -->|next| method_1r63qu7_onafterrenderasync__action_65_guard_clause_65__merge
    method_1r63qu7_onafterrenderasync__action_65_guard_clause_65__merge -->|next| method_1r63qu7_onafterrenderasync__action_65_onafterrenderasync_branch_65_0__condition
    method_1r63qu7_onafterrenderasync__action_65_guard_clause_65__true -->|next| method_1r63qu7_onafterrenderasync__action_65_guard_clause_65__merge
    method_1r63qu7_onafterrenderasync__action_65_onafterrenderasync_branch_65_0__condition -->|false| method_1r63qu7_onafterrenderasync__action_65_onafterrenderasync_branch_65_0__false
    method_1r63qu7_onafterrenderasync__action_65_onafterrenderasync_branch_65_0__condition -->|true| method_1r63qu7_onafterrenderasync__action_65_onafterrenderasync_branch_65_0__true
    method_1r63qu7_onafterrenderasync__action_65_onafterrenderasync_branch_65_0__false -->|next| method_1r63qu7_onafterrenderasync__action_65_onafterrenderasync_branch_65_0__merge
    method_1r63qu7_onafterrenderasync__action_65_onafterrenderasync_branch_65_0__merge -->|next| method_1r63qu7_onafterrenderasync__action_67_onafterrenderasync_await_67_1__await
    method_1r63qu7_onafterrenderasync__action_65_onafterrenderasync_branch_65_0__true -->|next| method_1r63qu7_onafterrenderasync__action_65_onafterrenderasync_branch_65_0__merge
    method_1r63qu7_onafterrenderasync__action_67_onafterrenderasync_await_67_1__await -->|none| method_1r63qu7_onafterrenderasync__call_67_InitializeAsync
    method_1r63qu7_onafterrenderasync__action_68_onafterrenderasync_try_68_2__try -->|next| method_1r63qu7_onafterrenderasync__action_69_onafterrenderasync_await_69_3__await
    method_1r63qu7_onafterrenderasync__action_68_try_catch_68__linear -->|next| method_1r63qu7_onafterrenderasync__action_68_onafterrenderasync_try_68_2__try
    method_1r63qu7_onafterrenderasync__action_69_onafterrenderasync_await_69_3__await -->|next| method_1r63qu7_onafterrenderasync__action_71_onafterrenderasync_await_71_4__await
    method_1r63qu7_onafterrenderasync__action_71_onafterrenderasync_await_71_4__await -->|exception| method_1r63qu7_onafterrenderasync__action_72_onafterrenderasync_catch_72_5__catch
    method_1r63qu7_onafterrenderasync__action_72_onafterrenderasync_catch_72_5__catch -->|next| method_1r63qu7_onafterrenderasync__action_73_state_change_73__linear
    method_1r63qu7_onafterrenderasync__action_73_state_change_73__linear -->|return| method_1r63qu7_onafterrenderasync__implicit_return
    method_1r63qu7_onafterrenderasync__call_67_InitializeAsync -->|next| method_1r63qu7_onafterrenderasync__action_68_try_catch_68__linear
    method_1r63qu7_onafterrenderasync__entry -->|next| method_1r63qu7_onafterrenderasync__action_65_guard_clause_65__condition
```

### HandleNodeSelected() Control Flow

```mermaid
flowchart TD
    method_6vyv4w_handlenodeselected__call_88_ScrollToNodeAsync[["ScrollToNodeAsync"]]
    method_6vyv4w_handlenodeselected__action_86_guard_clause_86__condition{"readerCanvas != null"}
    method_6vyv4w_handlenodeselected__action_86_guard_clause_86__false("no-op")
    method_6vyv4w_handlenodeselected__action_86_guard_clause_86__merge("merge")
    method_6vyv4w_handlenodeselected__action_86_guard_clause_86__true("scroll")
    method_6vyv4w_handlenodeselected__action_86_handlenodeselected_branch_86_0__condition{"readerCanvas != null"}
    method_6vyv4w_handlenodeselected__action_86_handlenodeselected_branch_86_0__false("false")
    method_6vyv4w_handlenodeselected__action_86_handlenodeselected_branch_86_0__merge("merge")
    method_6vyv4w_handlenodeselected__action_86_handlenodeselected_branch_86_0__true("true")
    method_6vyv4w_handlenodeselected__action_88_handlenodeselected_await_88_1__await[["Waits for async work"]]
    method_6vyv4w_handlenodeselected__entry(["HandleNodeSelected entry"])
    method_6vyv4w_handlenodeselected__implicit_return(["return"])
    method_6vyv4w_handlenodeselected__action_86_guard_clause_86__condition -->|no-op| method_6vyv4w_handlenodeselected__action_86_guard_clause_86__false
    method_6vyv4w_handlenodeselected__action_86_guard_clause_86__condition -->|scroll| method_6vyv4w_handlenodeselected__action_86_guard_clause_86__true
    method_6vyv4w_handlenodeselected__action_86_guard_clause_86__false -->|next| method_6vyv4w_handlenodeselected__action_86_guard_clause_86__merge
    method_6vyv4w_handlenodeselected__action_86_guard_clause_86__merge -->|next| method_6vyv4w_handlenodeselected__action_86_handlenodeselected_branch_86_0__condition
    method_6vyv4w_handlenodeselected__action_86_guard_clause_86__true -->|next| method_6vyv4w_handlenodeselected__action_86_guard_clause_86__merge
    method_6vyv4w_handlenodeselected__action_86_handlenodeselected_branch_86_0__condition -->|false| method_6vyv4w_handlenodeselected__action_86_handlenodeselected_branch_86_0__false
    method_6vyv4w_handlenodeselected__action_86_handlenodeselected_branch_86_0__condition -->|true| method_6vyv4w_handlenodeselected__action_86_handlenodeselected_branch_86_0__true
    method_6vyv4w_handlenodeselected__action_86_handlenodeselected_branch_86_0__false -->|next| method_6vyv4w_handlenodeselected__action_86_handlenodeselected_branch_86_0__merge
    method_6vyv4w_handlenodeselected__action_86_handlenodeselected_branch_86_0__merge -->|next| method_6vyv4w_handlenodeselected__action_88_handlenodeselected_await_88_1__await
    method_6vyv4w_handlenodeselected__action_86_handlenodeselected_branch_86_0__true -->|next| method_6vyv4w_handlenodeselected__action_86_handlenodeselected_branch_86_0__merge
    method_6vyv4w_handlenodeselected__action_88_handlenodeselected_await_88_1__await -->|nodeId| method_6vyv4w_handlenodeselected__call_88_ScrollToNodeAsync
    method_6vyv4w_handlenodeselected__call_88_ScrollToNodeAsync -->|return| method_6vyv4w_handlenodeselected__implicit_return
    method_6vyv4w_handlenodeselected__entry -->|next| method_6vyv4w_handlenodeselected__action_86_guard_clause_86__condition
```

### DisposeAsync() Control Flow

_Warnings: diagram method_99k8q7_disposeasync__fragment_diagram exceeds preferred complexity thresholds (21 nodes, 22 edges)._

```mermaid
---
config:
  flowchart:
    defaultRenderer: "elk"
---
flowchart TD
    method_99k8q7_disposeasync__call_102_OnQuizRequested_event_unsubscription[["OnQuizRequested - event unsubscription"]]
    method_99k8q7_disposeasync__call_103_OnFocusModeChanged_event_unsubscription[["OnFocusModeChanged - event unsubscription"]]
    method_99k8q7_disposeasync__call_108_Dispose_interop_cleanup_via_JS_module_[["Dispose/interop cleanup (via JS module)"]]
    method_99k8q7_disposeasync__action_102_event_unsubscribe_102__linear("Unsubscribe QuizState.OnQuizRequested")
    method_99k8q7_disposeasync__action_103_event_unsubscribe_103__linear("Unsubscribe FocusMode.OnFocusModeChanged")
    method_99k8q7_disposeasync__action_105_disposeasync_branch_105_0__condition{"_interopModule != null && _keydownHandler != null"}
    method_99k8q7_disposeasync__action_105_disposeasync_branch_105_0__false("false")
    method_99k8q7_disposeasync__action_105_disposeasync_branch_105_0__merge("merge")
    method_99k8q7_disposeasync__action_105_disposeasync_branch_105_0__true("true")
    method_99k8q7_disposeasync__action_105_guard_clause_105__condition{"_interopModule != null && _keydownHandler != null"}
    method_99k8q7_disposeasync__action_105_guard_clause_105__false("skip")
    method_99k8q7_disposeasync__action_105_guard_clause_105__merge("merge")
    method_99k8q7_disposeasync__action_105_guard_clause_105__true("try detach and dispose")
    method_99k8q7_disposeasync__action_107_disposeasync_try_107_1__try("Begins protected execution")
    method_99k8q7_disposeasync__action_108_disposeasync_await_108_2__await[["Waits for async work"]]
    method_99k8q7_disposeasync__action_109_disposeasync_await_109_3__await[["Waits for async work"]]
    method_99k8q7_disposeasync__action_110_disposeasync_await_110_4__await[["Waits for async work"]]
    method_99k8q7_disposeasync__action_111_disposeasync_catch_111_5__catch("Handles exception path")
    method_99k8q7_disposeasync__action_114_dispose_114__linear("Dispose DotNetObjectReference")
    method_99k8q7_disposeasync__entry(["DisposeAsync entry"])
    method_99k8q7_disposeasync__implicit_return(["return"])
    method_99k8q7_disposeasync__action_102_event_unsubscribe_102__linear -->|HandleQuizRequestedAsync| method_99k8q7_disposeasync__call_102_OnQuizRequested_event_unsubscription
    method_99k8q7_disposeasync__action_103_event_unsubscribe_103__linear -->|HandleUpdate| method_99k8q7_disposeasync__call_103_OnFocusModeChanged_event_unsubscription
    method_99k8q7_disposeasync__action_105_disposeasync_branch_105_0__condition -->|false| method_99k8q7_disposeasync__action_105_disposeasync_branch_105_0__false
    method_99k8q7_disposeasync__action_105_disposeasync_branch_105_0__condition -->|true| method_99k8q7_disposeasync__action_105_disposeasync_branch_105_0__true
    method_99k8q7_disposeasync__action_105_disposeasync_branch_105_0__false -->|next| method_99k8q7_disposeasync__action_105_disposeasync_branch_105_0__merge
    method_99k8q7_disposeasync__action_105_disposeasync_branch_105_0__merge -->|next| method_99k8q7_disposeasync__action_105_guard_clause_105__condition
    method_99k8q7_disposeasync__action_105_disposeasync_branch_105_0__true -->|next| method_99k8q7_disposeasync__action_105_disposeasync_branch_105_0__merge
    method_99k8q7_disposeasync__action_105_guard_clause_105__condition -->|skip| method_99k8q7_disposeasync__action_105_guard_clause_105__false
    method_99k8q7_disposeasync__action_105_guard_clause_105__condition -->|try detach and dispose| method_99k8q7_disposeasync__action_105_guard_clause_105__true
    method_99k8q7_disposeasync__action_105_guard_clause_105__false -->|next| method_99k8q7_disposeasync__action_105_guard_clause_105__merge
    method_99k8q7_disposeasync__action_105_guard_clause_105__merge -->|next| method_99k8q7_disposeasync__action_107_disposeasync_try_107_1__try
    method_99k8q7_disposeasync__action_105_guard_clause_105__true -->|next| method_99k8q7_disposeasync__action_105_guard_clause_105__merge
    method_99k8q7_disposeasync__action_107_disposeasync_try_107_1__try -->|next| method_99k8q7_disposeasync__action_108_disposeasync_await_108_2__await
    method_99k8q7_disposeasync__action_108_disposeasync_await_108_2__await -->|detachKeyboardListener then dispose interop references| method_99k8q7_disposeasync__call_108_Dispose_interop_cleanup_via_JS_module_
    method_99k8q7_disposeasync__action_109_disposeasync_await_109_3__await -->|next| method_99k8q7_disposeasync__action_110_disposeasync_await_110_4__await
    method_99k8q7_disposeasync__action_110_disposeasync_await_110_4__await -->|exception| method_99k8q7_disposeasync__action_111_disposeasync_catch_111_5__catch
    method_99k8q7_disposeasync__action_111_disposeasync_catch_111_5__catch -->|next| method_99k8q7_disposeasync__action_114_dispose_114__linear
    method_99k8q7_disposeasync__action_114_dispose_114__linear -->|return| method_99k8q7_disposeasync__implicit_return
    method_99k8q7_disposeasync__call_102_OnQuizRequested_event_unsubscription -->|next| method_99k8q7_disposeasync__action_103_event_unsubscribe_103__linear
    method_99k8q7_disposeasync__call_103_OnFocusModeChanged_event_unsubscription -->|next| method_99k8q7_disposeasync__action_105_disposeasync_branch_105_0__condition
    method_99k8q7_disposeasync__call_108_Dispose_interop_cleanup_via_JS_module_ -->|next| method_99k8q7_disposeasync__action_109_disposeasync_await_109_3__await
    method_99k8q7_disposeasync__entry -->|next| method_99k8q7_disposeasync__action_102_event_unsubscribe_102__linear
```

## Diagram Validation

- Status: warn
- Warning: Control-flow extraction left 5 unresolved jumps.
- Warning: neighborhood-view: diagram file_h6mj95_home_razor_neighborhood_view exceeds preferred complexity thresholds (17 nodes, 7 edges).
- Warning: control-flow: diagram method_p5ejmn_onparameterssetasync__fragment_diagram exceeds preferred complexity thresholds (39 nodes, 46 edges).
- Warning: control-flow: diagram method_99k8q7_disposeasync__fragment_diagram exceeds preferred complexity thresholds (21 nodes, 22 edges).
