{"version":3,"file":"ngx-chessground.mjs","sources":["../../../projects/ngx-chessground/src/lib/ngx-chessground.service.ts","../../../projects/ngx-chessground/src/lib/ngx-chessground/ngx-chessground.component.ts","../../../projects/ngx-chessground/src/lib/ngx-chessground/ngx-chessground.component.html","../../../projects/ngx-chessground/src/units/util.ts","../../../projects/ngx-chessground/src/units/play.ts","../../../projects/ngx-chessground/src/lib/promotion-dialog/promotion-dialog.component.ts","../../../projects/ngx-chessground/src/lib/promotion-dialog/promotion.service.ts","../../../projects/ngx-chessground/src/lib/ngx-chessground-table/ngx-chessground-table.component.ts","../../../projects/ngx-chessground/src/lib/ngx-chessground-table/ngx-chessground-table.component.html","../../../projects/ngx-chessground/src/lib/pgn-viewer/board/evaluation-bar.component.ts","../../../projects/ngx-chessground/src/lib/pgn-viewer/board/evaluation-bar.component.html","../../../projects/ngx-chessground/src/lib/pgn-viewer/board/board-display.component.ts","../../../projects/ngx-chessground/src/lib/pgn-viewer/board/board-display.component.html","../../../projects/ngx-chessground/src/lib/pgn-viewer/desktop-runtime.ts","../../../projects/ngx-chessground/src/lib/pgn-viewer/text-highlight.ts","../../../projects/ngx-chessground/src/lib/pgn-viewer/filter/player-typeahead.component.ts","../../../projects/ngx-chessground/src/lib/pgn-viewer/filter/player-typeahead.component.html","../../../projects/ngx-chessground/src/lib/pgn-viewer/filter/game-filter-panel.component.ts","../../../projects/ngx-chessground/src/lib/pgn-viewer/filter/game-filter-panel.component.html","../../../projects/ngx-chessground/src/lib/pgn-viewer/lichess-broadcast-url.ts","../../../projects/ngx-chessground/src/lib/pgn-viewer/load-cache/load-cache-panel.component.ts","../../../projects/ngx-chessground/src/lib/pgn-viewer/load-cache/load-cache-panel.component.html","../../../projects/ngx-chessground/src/lib/pgn-viewer/moves/move-list.component.ts","../../../projects/ngx-chessground/src/lib/pgn-viewer/moves/move-list.component.html","../../../projects/ngx-chessground/src/lib/pgn-viewer/pgn-viewer-store.service.ts","../../../projects/ngx-chessground/src/lib/pgn-viewer/pgn-cache.service.ts","../../../projects/ngx-chessground/src/lib/pgn-viewer/eco-moves.ts","../../../projects/ngx-chessground/src/lib/pgn-viewer/pgn-viewer-engine.service.ts","../../../projects/ngx-chessground/src/lib/pgn-viewer/pgn-viewer-notifier.ts","../../../projects/ngx-chessground/src/lib/pgn-viewer/pgn-viewer-settings.service.ts","../../../projects/ngx-chessground/src/lib/pgn-viewer/practice/practice-panel.component.ts","../../../projects/ngx-chessground/src/lib/pgn-viewer/practice/practice-panel.component.html","../../../projects/ngx-chessground/src/lib/pgn-viewer/replay/replay-panel.component.ts","../../../projects/ngx-chessground/src/lib/pgn-viewer/replay/replay-panel.component.html","../../../projects/ngx-chessground/src/lib/pgn-viewer/pgn-viewer.component.ts","../../../projects/ngx-chessground/src/lib/pgn-viewer/pgn-viewer.component.html","../../../projects/ngx-chessground/src/lib/pgn-viewer/pgn-viewer.types.ts","../../../projects/ngx-chessground/src/units/anim.ts","../../../projects/ngx-chessground/src/units/basics.ts","../../../projects/ngx-chessground/src/units/fen.ts","../../../projects/ngx-chessground/src/units/in3d.ts","../../../projects/ngx-chessground/src/units/perf.ts","../../../projects/ngx-chessground/src/units/pgn.ts","../../../projects/ngx-chessground/src/units/svg.ts","../../../projects/ngx-chessground/src/units/viewOnly.ts","../../../projects/ngx-chessground/src/units/zh.ts","../../../projects/ngx-chessground/src/public-api.ts","../../../projects/ngx-chessground/src/ngx-chessground.ts"],"sourcesContent":["import { Injectable, type OnDestroy } from '@angular/core';\nimport type { Api } from 'chessground/api';\nimport type { Config } from 'chessground/config';\nimport type { VNode } from 'snabbdom';\nimport {\n\tattributesModule,\n\tclassModule,\n\teventListenersModule,\n\th,\n\tinit,\n} from 'snabbdom';\n\n/**\n * Service to manage the Chessground instance and its rendering.\n *\n * Wraps snabbdom patching and chessground lifecycle. Each {@link NgxChessgroundComponent}\n * instance creates its own service instance (provided at component level).\n *\n * On the first {@link redraw} call, the service creates the virtual DOM tree\n * and patches it into the real DOM via snabbdom. The `insert` hook initializes\n * the Chessground instance by invoking the provided run function. On subsequent\n * calls with a *different* run function, the previous Chessground instance is\n * destroyed first (unbinding its document listeners) before the new one is\n * created — a stale instance is never left behind, which keeps drag & drop\n * responsive. Position updates should flow through {@link setConfig}, which\n * reconfigures the live instance in place via {@link Api.set} instead of\n * recreating it.\n */\n@Injectable({ providedIn: 'root' })\nexport class NgxChessgroundService implements OnDestroy {\n\t/**\n\t * Initializes the patch function with the necessary modules.\n\t * @private\n\t */\n\tprivate readonly patch = init([\n\t\tclassModule,\n\t\tattributesModule,\n\t\teventListenersModule,\n\t]);\n\n\t/**\n\t * Virtual node representing the current state of the DOM.\n\t * Set after the first {@link redraw}. Read by the patch lifecycle.\n\t * @private\n\t */\n\t// biome-ignore lint/correctness/noUnusedPrivateClassMembers: stored by patch, used via snabbdom internals\n\tprivate vnode!: VNode;\n\n\t/**\n\t * Chessground API instance.\n\t * Set by the snabbdom `insert` hook during first render.\n\t * @private\n\t */\n\tprivate cg!: Api;\n\n\t/**\n\t * Reference to the `.cg-wrap` DOM element that hosts the chessboard.\n\t * Captured by the snabbdom hook and reused for in-place updates.\n\t * @private\n\t */\n\tprivate boardEl: HTMLElement | null = null;\n\n\t/**\n\t * Function to run on the HTMLElement to configure chessground.\n\t * @private\n\t */\n\tprivate runFn!: (el: HTMLElement) => Api;\n\n\t/**\n\t * Config applied via {@link setConfig} before the Chessground instance\n\t * existed; flushed once the instance is created.\n\t * @private\n\t */\n\tprivate pendingConfig: Partial<Config> | null = null;\n\n\t/**\n\t * Redraws the Chessground board on the given element.\n\t *\n\t * On the first call, creates the vnode tree, patches into the DOM, and\n\t * initializes the Chessground instance via snabbdom hooks. On subsequent\n\t * calls with a different run function, the previous instance is destroyed\n\t * and recreated in place so no orphaned instance keeps its document\n\t * listeners bound. Calls with the same run function are no-ops.\n\t *\n\t * @param element - The HTML element to render the Chessground board on.\n\t * @param runFn - The function to run on the HTMLElement.\n\t */\n\tpublic redraw(element: HTMLElement, runFn: (el: HTMLElement) => Api) {\n\t\tif (this.runFn === runFn) return;\n\t\tthis.runFn = runFn;\n\t\tif (!this.cg) {\n\t\t\t// First render: create vnode tree, patch DOM, insert hook inits Chessground\n\t\t\tthis.vnode = this.patch(element, this.render());\n\t\t} else if (this.boardEl) {\n\t\t\t// New run function: dispose the old instance (unbinds its document\n\t\t\t// listeners) and create a fresh one in place.\n\t\t\tthis.cg.destroy();\n\t\t\tthis.cg = runFn(this.boardEl);\n\t\t}\n\t\tif (this.pendingConfig) {\n\t\t\tthis.cg.set(this.pendingConfig as Config);\n\t\t\tthis.pendingConfig = null;\n\t\t}\n\t}\n\n\t/**\n\t * Reconfigures the live Chessground instance in place via {@link Api.set}.\n\t *\n\t * This is the preferred way to update the position, orientation, movable\n\t * destinations etc. — it keeps animations and drag & drop state intact and\n\t * avoids the cost of recreating the whole instance. If the instance has not\n\t * been created yet, the config is stored and applied right after creation.\n\t *\n\t * @param config - Partial Chessground config to merge into the instance.\n\t */\n\tpublic setConfig(config: Partial<Config>): void {\n\t\tif (this.cg) {\n\t\t\t// The board may have moved since chessground last measured it —\n\t\t\t// e.g. a layout shift that fires no scroll/resize event (a panel\n\t\t\t// growing below the board). Invalidate the cached bounds so the\n\t\t\t// next mouse event maps to the correct square instead of failing\n\t\t\t// silently and making drag & drop appear broken.\n\t\t\tthis.cg.state.dom.bounds.clear();\n\t\t\tthis.cg.set(config as Config);\n\t\t} else {\n\t\t\tthis.pendingConfig = config;\n\t\t}\n\t}\n\n\t/**\n\t * Toggles the orientation of the Chessground board.\n\t */\n\tpublic toggleOrientation() {\n\t\tif (!this.cg) return;\n\t\tthis.cg.toggleOrientation();\n\t}\n\n\t/**\n\t * Destroys the Chessground instance and releases resources.\n\t *\n\t * Called by Angular when the owning component is destroyed. Unbinds the\n\t * instance's document listeners so no orphaned drag handlers remain.\n\t */\n\tpublic ngOnDestroy(): void {\n\t\tif (this.cg) {\n\t\t\tthis.cg.destroy();\n\t\t\tthis.cg = null as unknown as Api;\n\t\t}\n\t\tthis.boardEl = null;\n\t\tthis.pendingConfig = null;\n\t}\n\n\t/**\n\t * Renders the virtual node for the Chessground board.\n\t * @returns The virtual node representing the Chessground board.\n\t * @private\n\t */\n\tprivate render(): VNode {\n\t\treturn h('div#chessground-examples', [\n\t\t\th('section.blue.merida', [\n\t\t\t\th('div.cg-wrap', {\n\t\t\t\t\thook: {\n\t\t\t\t\t\tinsert: this.runUnit,\n\t\t\t\t\t\tpostpatch: this.runUnit,\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 * Snabbdom hook called on both `insert` and `postpatch`.\n\t *\n\t * On insert (first render): initializes the Chessground instance by running\n\t * the configured run function and stores a reference to it (and the board\n\t * element) for later in-place updates. On postpatch: the instance already\n\t * exists, so nothing is re-created.\n\t *\n\t * @param vnode - The virtual node.\n\t * @param oldVnode - The previous virtual node (only present on postpatch).\n\t * @returns The chessground Api.\n\t * @private\n\t */\n\tprivate readonly runUnit = (vnode: VNode, oldVnode?: VNode) => {\n\t\tconst el = vnode.elm as HTMLElement;\n\t\tel.className = 'cg-wrap';\n\t\tthis.boardEl = el;\n\t\tif (!oldVnode) {\n\t\t\t// Insert hook: first time this element hits the DOM\n\t\t\tthis.cg = this.runFn(el);\n\t\t}\n\t\treturn this.cg;\n\t};\n}\n","import {\n\tafterRenderEffect,\n\tComponent,\n\ttype ElementRef,\n\tinject,\n\tinput,\n\tviewChild,\n} from '@angular/core';\nimport type { Api } from 'chessground/api';\nimport type { Config } from 'chessground/config';\nimport { NgxChessgroundService } from '../ngx-chessground.service';\n\n/**\n * Core chessboard component wrapping the chessground library via snabbdom.\n *\n * Accepts a `runFunction` signal-model input that receives the mounted DOM element\n * and must return a chessground `Api` instance. The component manages lifecycle:\n * - Uses an Angular `afterRenderEffect()` to watch both `runFunction` changes\n *   and `viewChild` population, redrawing the board after Angular finishes DOM\n *   rendering. This is the recommended approach for third-party library integration.\n * - When the `runFunction` identity changes, the previous Chessground instance\n *   is destroyed before the new one is created.\n * - Provides an optional `config` input: when its identity changes, the config\n *   is applied to the **existing** instance in place via `Api.set()`. This keeps\n *   animations and drag & drop state intact and is far cheaper than recreating\n *   the instance — the preferred way to update positions/moves.\n * - Provides a `toggleOrientation()` method to flip the board.\n *\n * Uses {@link NgxChessgroundService} (provided at component level) for snabbdom patching\n * and chessground instance management.\n *\n * @example\n * ```html\n * <ngx-chessground [runFunction]=\"myRunFn()\" />\n * ```\n *\n * @example\n * ```typescript\n * myRunFn = signal<(el: HTMLElement) => Api>((el) => {\n *   return Chessground(el, { fen: 'start' });\n * });\n * ```\n */\n@Component({\n\tselector: 'ngx-chessground',\n\ttemplateUrl: './ngx-chessground.component.html',\n\tstyleUrl: './ngx-chessground.component.scss',\n\n\tproviders: [NgxChessgroundService],\n})\nexport class NgxChessgroundComponent {\n\t/**\n\t * Signal-based view query for the board container element.\n\t *\n\t * References the DOM element with template variable `#chessboard`.\n\t * Tracked by `afterRenderEffect` to pass the native element to chessground.\n\t */\n\treadonly elementView = viewChild.required<ElementRef>('chessboard');\n\n\t/**\n\t * Function that constructs the chessground instance on a given element.\n\t *\n\t * This is the primary input mechanism of the component, and it is\n\t * **required** — omitting it is a compile-time error rather than a silently\n\t * blank board. Changes to the function's identity trigger a board redraw\n\t * via `afterRenderEffect()`; the previous instance is destroyed first.\n\t *\n\t * A plain `input()` (not a `model()`) because a callback is never written\n\t * back to by the component — there is no two-way binding to expose.\n\t *\n\t * @param el — The board container `HTMLElement` mounted in the DOM.\n\t * @returns A chessground `Api` instance configured as desired.\n\t */\n\treadonly runFunction = input.required<(el: HTMLElement) => Api>();\n\n\t/**\n\t * Optional partial Chessground config applied to the live instance via\n\t * `Api.set()` whenever its identity changes.\n\t *\n\t * Prefer updating the board through this input instead of changing\n\t * `runFunction`: the instance is reconfigured in place, preserving\n\t * animations, drag & drop state and avoiding recreation costs.\n\t */\n\treadonly config = input<Partial<Config> | null>(null);\n\n\t/** Service managing the chessground instance and snabbdom patching lifecycle. */\n\tprivate readonly ngxChessgroundService = inject(NgxChessgroundService);\n\n\t/** Last run function applied, used to skip redundant instance recreation. */\n\tprivate lastFn: ((el: HTMLElement) => Api) | undefined;\n\t/** Last config applied, used to skip redundant set() calls. */\n\tprivate lastConfig: Partial<Config> | null | undefined;\n\n\t/**\n\t * Sets up an `afterRenderEffect` that redraws the chessboard after Angular\n\t * finishes rendering the DOM.\n\t *\n\t * Uses the recommended phase separation:\n\t * - **earlyRead** — reads signals to establish reactive tracking\n\t * - **write** — performs DOM manipulation (snabbdom patching) with the\n\t *   guarantee that Angular's rendering is complete\n\t *\n\t * `afterRenderEffect` is the correct API for third-party library\n\t * integration per Angular's guidance. Standard `effect` runs before\n\t * Angular updates the DOM, which can cause timing issues with\n\t * `viewChild` signals and DOM-dependent libraries.\n\t */\n\tconstructor() {\n\t\tafterRenderEffect({\n\t\t\tearlyRead: () => {\n\t\t\t\t// Read signals to establish reactive tracking\n\t\t\t\treturn {\n\t\t\t\t\tel: this.elementView(),\n\t\t\t\t\tfn: this.runFunction(),\n\t\t\t\t\tconfig: this.config(),\n\t\t\t\t};\n\t\t\t},\n\t\t\twrite: (data) => {\n\t\t\t\t// DOM manipulation only — never read the DOM here\n\t\t\t\tconst { el, fn, config } = data();\n\t\t\t\tif (!el.nativeElement || !fn) return;\n\t\t\t\tif (fn !== this.lastFn) {\n\t\t\t\t\tthis.lastFn = fn;\n\t\t\t\t\tthis.ngxChessgroundService.redraw(el.nativeElement, fn);\n\t\t\t\t\t// A freshly created instance only carries the run function's\n\t\t\t\t\t// baked-in config — apply the current config input on top.\n\t\t\t\t\tif (config) this.ngxChessgroundService.setConfig(config);\n\t\t\t\t} else if (config && config !== this.lastConfig) {\n\t\t\t\t\tthis.ngxChessgroundService.setConfig(config);\n\t\t\t\t}\n\t\t\t\tthis.lastConfig = config;\n\t\t\t},\n\t\t});\n\t}\n\n\t/**\n\t * Flips the board orientation (white ↔ black).\n\t *\n\t * Delegates to {@link NgxChessgroundService.toggleOrientation}.\n\t */\n\tpublic toggleOrientation() {\n\t\tthis.ngxChessgroundService.toggleOrientation();\n\t}\n}\n","<div #chessboard id=\"chessground-examples\"></div>\n","import type { Chess as ChessInstance, Move, Square } from 'chess.js';\nimport * as ChessJS from 'chess.js';\nimport type { Api } from 'chessground/api';\nimport type { Color, Key } from 'chessground/types';\nimport type { PromotionService } from '../lib/promotion-dialog/promotion.service';\n\n/**\n * Generates a map of possible destination squares for each piece on the board.\n *\n * @param chess - An instance of the Chess game.\n * @returns A map where the keys are the squares with pieces that have legal moves,\n * and the values are arrays of destination squares for those pieces.\n */\nexport function toDests(chess: ChessInstance): Map<Key, Key[]> {\n\tconst dests = new Map();\n\n\tfor (const s of ChessJS.SQUARES) {\n\t\tconst ms = chess.moves({ square: s, verbose: true });\n\t\tif (ms.length) {\n\t\t\tdests.set(\n\t\t\t\ts,\n\t\t\t\tms.map((m: Move) => m.to),\n\t\t\t);\n\t\t}\n\t}\n\treturn dests;\n}\n\n/**\n * Converts the current turn of a chess game to a color string.\n *\n * @param chess - An instance of a chess game.\n * @returns The color string \"white\" if it's white's turn, otherwise \"black\".\n */\nexport function toColor(chess: ChessInstance): Color {\n\treturn chess.turn() === 'w' ? 'white' : 'black';\n}\n\n/**\n * Converts chess.js promotion character to chessground piece role.\n *\n * @param promotion - The chess.js promotion character ('q', 'r', 'b', 'n')\n * @returns The corresponding chessground piece role ('queen', 'rook', 'bishop', 'knight')\n */\nexport function promotionToRole(\n\tpromotion: string,\n): 'queen' | 'rook' | 'bishop' | 'knight' {\n\tswitch (promotion) {\n\t\tcase 'q':\n\t\t\treturn 'queen';\n\t\tcase 'r':\n\t\t\treturn 'rook';\n\t\tcase 'b':\n\t\t\treturn 'bishop';\n\t\tcase 'n':\n\t\t\treturn 'knight';\n\t\tdefault:\n\t\t\treturn 'queen'; // Default to queen\n\t}\n}\n\n/**\n * Creates a function that makes a move on the chessboard and updates the state of the chess game.\n * Uses window.prompt for pawn promotion (legacy method).\n *\n * @param cg - The chessground API instance.\n * @param chess - The chess.js instance representing the current state of the chess game.\n * @returns A function that takes the origin and destination squares of a move, makes the move on the chessboard,\n *          and updates the turn color and movable destinations in the chessground instance.\n */\nexport function playOtherSide(cg: Api, chess: ChessInstance) {\n\treturn (orig: Key, dest: Key) => {\n\t\t// Check if this is a pawn promotion move (pawn reaching the first or eighth row)\n\t\tconst piece = chess.get(orig as Square);\n\t\tconst isPawn = piece && piece.type === 'p';\n\t\tconst isPromotionMove =\n\t\t\tisPawn && (dest.charAt(1) === '8' || dest.charAt(1) === '1');\n\n\t\tif (isPromotionMove) {\n\t\t\t// Ask user what piece to promote to\n\t\t\tconst promotionPiece = window.prompt(\n\t\t\t\t'Promote pawn to: q (Queen), r (Rook), b (Bishop), n (Knight)',\n\t\t\t\t'q',\n\t\t\t);\n\t\t\tconst validPromotions = ['q', 'r', 'b', 'n'];\n\t\t\tconst promotion = validPromotions.includes(\n\t\t\t\tpromotionPiece?.toLowerCase() ?? '',\n\t\t\t)\n\t\t\t\t? promotionPiece?.toLowerCase()\n\t\t\t\t: 'q'; // Default to queen if invalid input\n\n\t\t\t// Make the move with promotion\n\t\t\tconst moveResult = chess.move({\n\t\t\t\tfrom: orig,\n\t\t\t\tto: dest,\n\t\t\t\tpromotion: promotion as 'q' | 'r' | 'n' | 'b',\n\t\t\t});\n\n\t\t\t// For promotion moves, we need to manually update the board to show the promoted piece\n\t\t\tif (moveResult) {\n\t\t\t\t// First move the pawn on the board\n\t\t\t\tcg.move(orig, dest);\n\n\t\t\t\t// Then update the piece on the destination square with the promoted piece\n\t\t\t\tconst color = piece.color === 'w' ? 'white' : 'black';\n\n\t\t\t\t// Map promotion letters to chessground piece roles using our helper function\n\t\t\t\tconst pieceRole = promotionToRole(promotion as string);\n\n\t\t\t\t// Update the piece on the board with the proper promoted piece\n\t\t\t\tcg.setPieces(new Map([[dest, { role: pieceRole, color: color }]]));\n\t\t\t}\n\t\t} else {\n\t\t\t// Regular move\n\t\t\tchess.move({ from: orig as Square, to: dest as Square });\n\t\t\t// For regular moves, just perform the move on the board\n\t\t\tcg.move(orig, dest);\n\t\t}\n\n\t\t// Update the board state (turn, movable pieces)\n\t\tcg.set({\n\t\t\tturnColor: toColor(chess),\n\t\t\tmovable: {\n\t\t\t\tcolor: toColor(chess),\n\t\t\t\tdests: toDests(chess),\n\t\t\t},\n\t\t});\n\t};\n}\n\n/**\n * Creates an async function that makes a move on the chessboard and updates the state of the chess game.\n * Uses a promotion service for pawn promotion (modern method with dialog).\n *\n * @param cg - The chessground API instance.\n * @param chess - The chess.js instance representing the current state of the chess game.\n * @param promotionService - The promotion service to handle pawn promotion dialog.\n * @returns A function that takes the origin and destination squares of a move, makes the move on the chessboard,\n *          and updates the turn color and movable destinations in the chessground instance.\n */\nexport function playOtherSideWithDialog(\n\tcg: Api,\n\tchess: ChessInstance,\n\tpromotionService: PromotionService,\n) {\n\treturn async (orig: Key, dest: Key) => {\n\t\t// Check if this is a pawn promotion move (pawn reaching the first or eighth row)\n\t\tconst piece = chess.get(orig as Square);\n\t\tconst isPawn = piece && piece.type === 'p';\n\t\tconst isPromotionMove =\n\t\t\tisPawn && (dest.charAt(1) === '8' || dest.charAt(1) === '1');\n\n\t\tif (isPromotionMove) {\n\t\t\ttry {\n\t\t\t\t// Show promotion dialog and get user's choice\n\t\t\t\tconst promotion = await promotionService.showPromotionDialog(\n\t\t\t\t\tpiece.color === 'w' ? 'white' : 'black',\n\t\t\t\t);\n\n\t\t\t\t// Make the move with promotion\n\t\t\t\tconst moveResult = chess.move({\n\t\t\t\t\tfrom: orig,\n\t\t\t\t\tto: dest,\n\t\t\t\t\tpromotion: promotion as 'q' | 'r' | 'n' | 'b',\n\t\t\t\t});\n\n\t\t\t\t// For promotion moves, we need to manually update the board to show the promoted piece\n\t\t\t\tif (moveResult) {\n\t\t\t\t\t// First move the pawn on the board\n\t\t\t\t\tcg.move(orig, dest);\n\n\t\t\t\t\t// Then update the piece on the destination square with the promoted piece\n\t\t\t\t\tconst color = piece.color === 'w' ? 'white' : 'black';\n\n\t\t\t\t\t// Map promotion letters to chessground piece roles using our helper function\n\t\t\t\t\tconst pieceRole = promotionToRole(promotion);\n\n\t\t\t\t\t// Update the piece on the board with the proper promoted piece\n\t\t\t\t\tcg.setPieces(new Map([[dest, { role: pieceRole, color: color }]]));\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error('Promotion dialog cancelled or error occurred:', error);\n\t\t\t\t// If dialog is cancelled or error occurs, default to queen\n\t\t\t\tconst promotion = 'q';\n\n\t\t\t\t// Make the move with default promotion\n\t\t\t\tconst moveResult = chess.move({\n\t\t\t\t\tfrom: orig,\n\t\t\t\t\tto: dest,\n\t\t\t\t\tpromotion: promotion as 'q' | 'r' | 'n' | 'b',\n\t\t\t\t});\n\n\t\t\t\tif (moveResult) {\n\t\t\t\t\tcg.move(orig, dest);\n\t\t\t\t\tconst color = piece.color === 'w' ? 'white' : 'black';\n\t\t\t\t\tconst pieceRole = promotionToRole(promotion);\n\t\t\t\t\tcg.setPieces(new Map([[dest, { role: pieceRole, color: color }]]));\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// Regular move\n\t\t\tchess.move({ from: orig as Square, to: dest as Square });\n\t\t\t// For regular moves, just perform the move on the board\n\t\t\tcg.move(orig, dest);\n\t\t}\n\n\t\t// Update the board state (turn, movable pieces)\n\t\tcg.set({\n\t\t\tturnColor: toColor(chess),\n\t\t\tmovable: {\n\t\t\t\tcolor: toColor(chess),\n\t\t\t\tdests: toDests(chess),\n\t\t\t},\n\t\t});\n\t};\n}\n\n/**\n * Executes an AI move in a chess game after a specified delay.\n *\n * @param cg - The chessground API instance.\n * @param chess - The chess.js instance.\n * @param delay - The delay in milliseconds before the AI makes a move.\n * @param firstMove - A boolean indicating if this is the first move of the game.\n * @returns A function that takes the origin and destination squares of the player's move.\n */\nexport function aiPlay(\n\tcg: Api,\n\tchess: ChessInstance,\n\tdelay: number,\n\tfirstMove: boolean,\n) {\n\treturn (orig: Key, dest: Key) => {\n\t\t// Check if this is a pawn promotion move\n\t\tconst piece = chess.get(orig as Square);\n\t\tconst isPawn = piece && piece.type === 'p';\n\t\tconst isPromotionMove =\n\t\t\tisPawn && (dest.charAt(1) === '8' || dest.charAt(1) === '1');\n\n\t\tif (isPromotionMove) {\n\t\t\t// For player's move, automatically promote to queen\n\t\t\tconst promotion = 'q';\n\t\t\tchess.move({\n\t\t\t\tfrom: orig as Square,\n\t\t\t\tto: dest as Square,\n\t\t\t\tpromotion: promotion,\n\t\t\t});\n\n\t\t\t// Get the color of the piece\n\t\t\tconst color = piece.color === 'w' ? 'white' : 'black';\n\n\t\t\t// Map promotion letters to chessground piece roles using our helper function\n\t\t\tconst pieceRole = promotionToRole(promotion);\n\n\t\t\t// Update the piece on the board with the promoted piece\n\t\t\tcg.setPieces(new Map([[dest, { role: pieceRole, color: color }]]));\n\t\t} else {\n\t\t\t// Regular move\n\t\t\tchess.move({ from: orig as Square, to: dest as Square });\n\t\t}\n\n\t\tsetTimeout(() => {\n\t\t\tconst moves = chess.moves({ verbose: true });\n\t\t\tconst move = firstMove\n\t\t\t\t? moves[0]\n\t\t\t\t: moves[Math.floor(Math.random() * moves.length)];\n\n\t\t\t// Check if this is a promotion move by looking at the destination square and piece type\n\t\t\tconst aiMovePiece = chess.get(move.from);\n\t\t\tconst isAIPawn = aiMovePiece?.type === 'p';\n\t\t\tconst isAIPromotionMove =\n\t\t\t\tisAIPawn && (move.to.charAt(1) === '8' || move.to.charAt(1) === '1');\n\n\t\t\t// AI always promotes to queen\n\t\t\tif (isAIPromotionMove) {\n\t\t\t\tconst promotion = 'q'; // AI always promotes to queen\n\t\t\t\tchess.move({\n\t\t\t\t\tfrom: move.from,\n\t\t\t\t\tto: move.to,\n\t\t\t\t\tpromotion: promotion,\n\t\t\t\t});\n\n\t\t\t\t// Move piece on board\n\t\t\t\tcg.move(move.from, move.to);\n\n\t\t\t\t// Get piece color\n\t\t\t\tconst pieceColor = chess.turn() === 'w' ? 'black' : 'white'; // The color is opposite of current turn\n\n\t\t\t\t// Map promotion letters to chessground piece roles using our helper function\n\t\t\t\tconst pieceRole = promotionToRole(promotion);\n\n\t\t\t\t// Update the piece on the board with the promoted piece\n\t\t\t\tcg.setPieces(\n\t\t\t\t\tnew Map([[move.to, { role: pieceRole, color: pieceColor }]]),\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tchess.move(move.san);\n\t\t\t\tcg.move(move.from, move.to);\n\t\t\t}\n\t\t\tcg.set({\n\t\t\t\tturnColor: toColor(chess),\n\t\t\t\tmovable: {\n\t\t\t\t\tcolor: toColor(chess),\n\t\t\t\t\tdests: toDests(chess),\n\t\t\t\t},\n\t\t\t});\n\t\t\tcg.playPremove();\n\t\t}, delay);\n\t};\n}\n","import { Chess } from 'chess.js';\nimport { Chessground } from 'chessground';\nimport type { Key, Piece } from 'chessground/types';\nimport type { PromotionService } from '../lib/promotion-dialog/promotion.service';\nimport type { Unit } from './unit';\nimport {\n\taiPlay,\n\tplayOtherSide,\n\tplayOtherSideWithDialog,\n\ttoColor,\n\ttoDests,\n} from './util';\n\n/**\n * Factory function to create units that use dialog-based promotion.\n * This allows the components to pass in the PromotionService dependency.\n */\nexport function createPlayUnitsWithDialog(promotionService?: PromotionService) {\n\t// If no promotion service is provided, fall back to the legacy prompt-based units\n\tif (!promotionService) {\n\t\treturn {\n\t\t\tinitial,\n\t\t\tcastling,\n\t\t\tplayVsRandom,\n\t\t\tplayFullRandom,\n\t\t\tslowAnim,\n\t\t\tconflictingHold,\n\t\t};\n\t}\n\n\t// Return enhanced units that use the promotion dialog\n\treturn {\n\t\tinitial: {\n\t\t\t...initial,\n\t\t\tname: 'Play legal moves from initial position (with promotion dialog)',\n\t\t\trun(el: HTMLElement) {\n\t\t\t\tconst chess = new Chess();\n\t\t\t\tconst cg = Chessground(el, {\n\t\t\t\t\tmovable: {\n\t\t\t\t\t\tcolor: 'white',\n\t\t\t\t\t\tfree: false,\n\t\t\t\t\t\tdests: toDests(chess),\n\t\t\t\t\t},\n\t\t\t\t\tdraggable: {\n\t\t\t\t\t\tshowGhost: true,\n\t\t\t\t\t},\n\t\t\t\t\tevents: {\n\t\t\t\t\t\tmove: (_orig: Key, _dest: Key, _capturedPiece?: Piece) => {\n\t\t\t\t\t\t\t// console.log(_orig);\n\t\t\t\t\t\t\t// console.log(_dest);\n\t\t\t\t\t\t\t// console.log(_capturedPiece);\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t\tcg.set({\n\t\t\t\t\tmovable: {\n\t\t\t\t\t\tevents: {\n\t\t\t\t\t\t\tafter: playOtherSideWithDialog(cg, chess, promotionService),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t\treturn cg;\n\t\t\t},\n\t\t},\n\t\tcastling: {\n\t\t\t...castling,\n\t\t\tname: 'Castling (with promotion dialog)',\n\t\t\trun(el: HTMLElement) {\n\t\t\t\tconst fen =\n\t\t\t\t\t'rnbqk2r/pppp1ppp/5n2/2b1p3/2B1P3/5N2/PPPP1PPP/RNBQK2R w KQkq - 4 4';\n\n\t\t\t\tconst chess = new Chess(fen);\n\t\t\t\tconst cg = Chessground(el, {\n\t\t\t\t\tfen,\n\t\t\t\t\tturnColor: toColor(chess),\n\t\t\t\t\tmovable: {\n\t\t\t\t\t\tcolor: 'white',\n\t\t\t\t\t\tfree: false,\n\t\t\t\t\t\tdests: toDests(chess),\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t\tcg.set({\n\t\t\t\t\tmovable: {\n\t\t\t\t\t\tevents: {\n\t\t\t\t\t\t\tafter: playOtherSideWithDialog(cg, chess, promotionService),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t\treturn cg;\n\t\t\t},\n\t\t},\n\t\tplayVsRandom, // AI vs player doesn't need dialog as AI handles promotion automatically\n\t\tplayFullRandom, // AI vs AI doesn't need dialog\n\t\tslowAnim, // AI vs player doesn't need dialog as AI handles promotion automatically\n\t\tconflictingHold,\n\t};\n}\n\n// Export the existing units for backward compatibility\n\n/**\n * The `initial` constant represents a unit that sets up a chessboard with the initial position\n * and allows playing legal moves from that position.\n *\n * @constant\n * @type {Unit}\n *\n * @property {string} name - The name of the unit.\n * @property {Function} run - The function that initializes the chessboard and sets up the game.\n * @param {HTMLElement} el - The HTML element where the chessboard will be rendered.\n * @returns {Chessground} - The initialized Chessground instance.\n *\n * The `run` function performs the following tasks:\n * - Creates a new instance of the Chess game.\n * - Initializes the Chessground with the given HTML element and configuration options.\n * - Sets up the chessboard to allow only legal moves for the white player.\n * - Enables draggable pieces with ghost images.\n * - Defines an event handler for the move event.\n * - Updates the Chessground configuration to handle moves for the other side after a move is made.\n */\nexport const initial: Unit = {\n\tname: 'Play legal moves from initial position',\n\trun(el) {\n\t\tconst chess = new Chess();\n\t\tconst cg = Chessground(el, {\n\t\t\tmovable: {\n\t\t\t\tcolor: 'white',\n\t\t\t\tfree: false,\n\t\t\t\tdests: toDests(chess),\n\t\t\t},\n\t\t\tdraggable: {\n\t\t\t\tshowGhost: true,\n\t\t\t},\n\t\t\tevents: {\n\t\t\t\tmove: (_orig: Key, _dest: Key, _capturedPiece?: Piece) => {\n\t\t\t\t\t// console.log(_orig);\n\t\t\t\t\t// console.log(_dest);\n\t\t\t\t\t// console.log(_capturedPiece);\n\t\t\t\t},\n\t\t\t},\n\t\t});\n\t\tcg.set({\n\t\t\tmovable: { events: { after: playOtherSide(cg, chess) } },\n\t\t});\n\t\treturn cg;\n\t},\n};\n\n/**\n * Represents the castling unit in a chess game.\n *\n * @constant\n * @type {Unit}\n * @name castling\n *\n * @property {string} name - The name of the unit.\n * @property {Function} run - The function to execute the castling logic.\n *\n * @param {HTMLElement} el - The HTML element where the chessboard will be rendered.\n * @returns {Chessground} - The Chessground instance with the castling configuration.\n *\n * The `run` function initializes a chessboard with a given FEN string representing the board state.\n * It sets up the Chessground instance with the appropriate configuration for castling moves.\n * The function also sets up an event to handle moves after the current move.\n */\nexport const castling: Unit = {\n\tname: 'Castling',\n\trun(el) {\n\t\tconst fen =\n\t\t\t'rnbqk2r/pppp1ppp/5n2/2b1p3/2B1P3/5N2/PPPP1PPP/RNBQK2R w KQkq - 4 4';\n\n\t\tconst chess = new Chess(fen);\n\t\tconst cg = Chessground(el, {\n\t\t\tfen,\n\t\t\tturnColor: toColor(chess),\n\t\t\tmovable: {\n\t\t\t\tcolor: 'white',\n\t\t\t\tfree: false,\n\t\t\t\tdests: toDests(chess),\n\t\t\t},\n\t\t});\n\t\tcg.set({\n\t\t\tmovable: { events: { after: playOtherSide(cg, chess) } },\n\t\t});\n\t\treturn cg;\n\t},\n};\n\n/**\n * Represents a unit that allows playing against a random AI.\n *\n * @constant\n * @type {Unit}\n * @name playVsRandom\n *\n * @property {string} name - The name of the unit.\n * @property {Function} run - The function to initialize the chess game against the random AI.\n * @param {HTMLElement} el - The HTML element where the chessboard will be rendered.\n * @returns {Chessground} - The initialized Chessground instance.\n */\nexport const playVsRandom: Unit = {\n\tname: 'Play vs random AI',\n\trun(el) {\n\t\tconst chess = new Chess();\n\t\tconst cg = Chessground(el, {\n\t\t\tmovable: {\n\t\t\t\tcolor: 'white',\n\t\t\t\tfree: false,\n\t\t\t\tdests: toDests(chess),\n\t\t\t},\n\t\t});\n\t\tcg.set({\n\t\t\tmovable: {\n\t\t\t\tevents: {\n\t\t\t\t\tafter: aiPlay(cg, chess, 1000, false),\n\t\t\t\t},\n\t\t\t},\n\t\t});\n\t\treturn cg;\n\t},\n};\n\n/**\n * Represents a unit that simulates a chess game between two random AIs.\n * The game is displayed on a Chessground board with animations.\n *\n * @constant\n * @type {Unit}\n * @name playFullRandom\n *\n * @property {string} name - The name of the unit.\n * @property {Function} run - The function that initializes and runs the unit.\n * @param {HTMLElement} el - The HTML element where the Chessground board will be rendered.\n * @returns {Chessground} - The Chessground instance displaying the game.\n */\nexport const playFullRandom: Unit = {\n\tname: 'Watch 2 random AIs',\n\trun(el) {\n\t\tconst chess = new Chess();\n\t\tconst cg = Chessground(el, {\n\t\t\tanimation: {\n\t\t\t\tduration: 1000,\n\t\t\t},\n\t\t\tmovable: {\n\t\t\t\tfree: false,\n\t\t\t},\n\t\t});\n\t\tfunction makeMove() {\n\t\t\tif (!cg.state.dom.elements.board.offsetParent) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst moves = chess.moves({ verbose: true });\n\t\t\tconst move = moves[Math.floor(Math.random() * moves.length)];\n\t\t\tchess.move(move.san);\n\t\t\tcg.move(move.from, move.to);\n\t\t\tsetTimeout(makeMove, 700);\n\t\t}\n\t\tsetTimeout(makeMove, 700);\n\t\treturn cg;\n\t},\n};\n\n/**\n * Represents a unit configuration for playing against a random AI with slow animations.\n *\n * @constant\n * @type {Unit}\n * @name slowAnim\n *\n * @property {string} name - The name of the unit configuration.\n * @property {Function} run - The function to execute the unit configuration.\n *\n * @param {HTMLElement} el - The HTML element to initialize the chessground on.\n *\n * @returns {Chessground} - The initialized chessground instance.\n */\nexport const slowAnim: Unit = {\n\tname: 'Play vs random AI; slow animations',\n\trun(el) {\n\t\tconst chess = new Chess();\n\t\tconst cg = Chessground(el, {\n\t\t\tanimation: {\n\t\t\t\tduration: 5000,\n\t\t\t},\n\t\t\tmovable: {\n\t\t\t\tcolor: 'white',\n\t\t\t\tfree: false,\n\t\t\t\tdests: toDests(chess),\n\t\t\t},\n\t\t});\n\t\tcg.set({\n\t\t\tmovable: {\n\t\t\t\tevents: {\n\t\t\t\t\tafter: aiPlay(cg, chess, 1000, false),\n\t\t\t\t},\n\t\t\t},\n\t\t});\n\t\treturn cg;\n\t},\n};\n\n/**\n * Represents a unit that demonstrates a conflicting hold/premove scenario in a chess game.\n *\n * This unit sets up a chessboard with a specific FEN position and simulates a move conflict\n * where a black pawn moves to a square that a white pawn is attempting to move to.\n *\n * @constant\n * @type {Unit}\n * @property {string} name - The name of the unit.\n * @property {Function} run - The function that initializes the chessboard and runs the scenario.\n * @param {HTMLElement} el - The HTML element where the chessboard will be rendered.\n * @returns {Chessground} The Chessground instance representing the chessboard.\n */\nexport const conflictingHold: Unit = {\n\tname: 'Conflicting hold/premove',\n\trun(el) {\n\t\tconst cg = Chessground(el, {\n\t\t\tfen: '8/8/5p2/4P3/8/8/8/8',\n\t\t\tturnColor: 'black',\n\t\t\tmovable: {\n\t\t\t\tcolor: 'white',\n\t\t\t\tfree: false,\n\t\t\t\tdests: new Map([['e5', ['f6']]]),\n\t\t\t},\n\t\t});\n\t\tsetTimeout(() => {\n\t\t\tcg.move('f6', 'e5');\n\t\t\tcg.playPremove();\n\t\t\tcg.set({\n\t\t\t\tturnColor: 'white',\n\t\t\t\tmovable: {\n\t\t\t\t\tdests: undefined,\n\t\t\t\t},\n\t\t\t});\n\t\t}, 1000);\n\t\treturn cg;\n\t},\n};\n","import { Component, inject, signal } from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport {\n\tMAT_DIALOG_DATA,\n\tMatDialogModule,\n\tMatDialogRef,\n} from '@angular/material/dialog';\nimport { MatIconModule } from '@angular/material/icon';\n\n/**\n * Data passed to the promotion dialog.\n */\nexport interface PromotionDialogData {\n\t/** The color of the promoting pawn — determines piece set rendering. */\n\tcolor: 'white' | 'black';\n}\n\n/**\n * Legal promotion piece choices.\n * - `'q'` — Queen\n * - `'r'` — Rook\n * - `'b'` — Bishop\n * - `'n'` — Knight\n */\nexport type PromotionPiece = 'q' | 'r' | 'b' | 'n';\n\n/**\n * A Material dialog that lets the user choose a piece for pawn promotion.\n *\n * Displays four buttons (Queen, Rook, Bishop, Knight) styled with Unicode\n * chess piece characters. On selection, the dialog closes with the chosen\n * {@link PromotionPiece} string. If dismissed without selection, defaults to `'q'`.\n *\n * The application is running in zoneless mode via {@link provideZonelessChangeDetection}.\n * The component is fully signal-driven — all template bindings are signal reads,\n * making `ChangeDetectionStrategy` a no-op in this configuration.\n */\n@Component({\n\tselector: 'ngx-promotion-dialog',\n\timports: [MatDialogModule, MatButtonModule, MatIconModule],\n\n\ttemplate: `\n    <div class=\"promotion-dialog\">\n      <h2 mat-dialog-title>Choose Promotion Piece</h2>\n      <mat-dialog-content>\n        <div class=\"promotion-pieces\">\n          <button \n            mat-button \n            class=\"piece-button queen-btn\"\n            (click)=\"selectPiece('q')\"\n            [attr.aria-label]=\"'Promote to Queen'\"\n          >\n            <div class=\"piece-icon queen {{ data().color }}\"></div>\n            <span class=\"piece-label\">Queen</span>\n          </button>\n          \n          <button \n            mat-button \n            class=\"piece-button rook-btn\"\n            (click)=\"selectPiece('r')\"\n            [attr.aria-label]=\"'Promote to Rook'\"\n          >\n            <div class=\"piece-icon rook {{ data().color }}\"></div>\n            <span class=\"piece-label\">Rook</span>\n          </button>\n          \n          <button \n            mat-button \n            class=\"piece-button bishop-btn\"\n            (click)=\"selectPiece('b')\"\n            [attr.aria-label]=\"'Promote to Bishop'\"\n          >\n            <div class=\"piece-icon bishop {{ data().color }}\"></div>\n            <span class=\"piece-label\">Bishop</span>\n          </button>\n          \n          <button \n            mat-button \n            class=\"piece-button knight-btn\"\n            (click)=\"selectPiece('n')\"\n            [attr.aria-label]=\"'Promote to Knight'\"\n          >\n            <div class=\"piece-icon knight {{ data().color }}\"></div>\n            <span class=\"piece-label\">Knight</span>\n          </button>\n        </div>\n      </mat-dialog-content>\n    </div>\n  `,\n\tstyles: [\n\t\t`\n    :host {\n      --promo-primary: #0369A1;\n      --promo-text: #0C4A6E;\n      --promo-border: #d0dde6;\n    }\n\n    .promotion-dialog {\n      padding: 0;\n      min-width: 300px;\n    }\n\n    .promotion-pieces {\n      display: grid;\n      grid-template-columns: repeat(2, 1fr);\n      gap: 16px;\n      padding: 20px;\n    }\n\n    .piece-button {\n      display: flex;\n      flex-direction: column;\n      align-items: center;\n      padding: 20px 16px;\n      border: 2px solid var(--promo-border);\n      border-radius: 12px;\n      background: white;\n      cursor: pointer;\n      transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;\n      min-height: 100px;\n    }\n\n    .piece-button:hover {\n      border-color: var(--promo-primary);\n      background: #e0f4ff;\n      box-shadow: 0 4px 12px rgba(3, 105, 161, 0.15);\n    }\n\n    .piece-button:focus-visible {\n      outline: 3px solid var(--promo-primary);\n      outline-offset: 2px;\n    }\n\n    .piece-button:active {\n      transform: scale(0.97);\n    }\n\n    .piece-icon {\n      width: 40px;\n      height: 40px;\n      margin-bottom: 8px;\n      display: flex;\n      align-items: center;\n      justify-content: center;\n    }\n\n    .piece-label {\n      font-size: 14px;\n      font-weight: 600;\n      color: var(--promo-text);\n    }\n\n    .piece-icon.queen.white::before {\n      content: '♕';\n      font-size: 40px;\n      color: #0C4A6E;\n    }\n\n    .piece-icon.queen.black::before {\n      content: '♛';\n      font-size: 40px;\n      color: #0C4A6E;\n    }\n\n    .piece-icon.rook.white::before {\n      content: '♖';\n      font-size: 40px;\n      color: #0C4A6E;\n    }\n\n    .piece-icon.rook.black::before {\n      content: '♜';\n      font-size: 40px;\n      color: #0C4A6E;\n    }\n\n    .piece-icon.bishop.white::before {\n      content: '♗';\n      font-size: 40px;\n      color: #0C4A6E;\n    }\n\n    .piece-icon.bishop.black::before {\n      content: '♝';\n      font-size: 40px;\n      color: #0C4A6E;\n    }\n\n    .piece-icon.knight.white::before {\n      content: '♘';\n      font-size: 40px;\n      color: #0C4A6E;\n    }\n\n    .piece-icon.knight.black::before {\n      content: '♞';\n      font-size: 40px;\n      color: #0C4A6E;\n    }\n\n    h2[mat-dialog-title] {\n      text-align: center;\n      margin: 0;\n      padding: 20px 20px 0 20px;\n      color: var(--promo-text);\n      font-size: 18px;\n      font-weight: 600;\n      font-family: \"Poppins\", \"Segoe UI\", system-ui, sans-serif;\n    }\n  `,\n\t],\n})\nexport class PromotionDialogComponent {\n\t/** Reference to this dialog instance, used to close it with the selection result. */\n\treadonly dialogRef = inject(MatDialogRef<PromotionDialogComponent>);\n\t/** Dialog input data (reactive signal) containing the promoting pawn's color. */\n\treadonly data = signal(inject<PromotionDialogData>(MAT_DIALOG_DATA));\n\n\t/**\n\t * Closes the dialog with the user's chosen promotion piece.\n\t *\n\t * @param piece — The selected piece: `'q'`, `'r'`, `'b'`, or `'n'`.\n\t */\n\tselectPiece(piece: PromotionPiece): void {\n\t\tthis.dialogRef.close(piece);\n\t}\n}\n","import { Injectable, inject } from '@angular/core';\nimport { MatDialog } from '@angular/material/dialog';\nimport {\n\tPromotionDialogComponent,\n\ttype PromotionDialogData,\n\ttype PromotionPiece,\n} from './promotion-dialog.component';\n\n/**\n * Service that opens a Material dialog for pawn promotion selection.\n *\n * Used by chess units and components when a pawn reaches the eighth rank.\n * The dialog presents Queen, Rook, Bishop, and Knight options.\n *\n * Provided at root level so any component can inject it.\n *\n * @example\n * ```typescript\n * const promotionService = inject(PromotionService);\n * const piece = await promotionService.showPromotionDialog('white');\n * // piece is 'q', 'r', 'b', or 'n'\n * ```\n */\n@Injectable({\n\tprovidedIn: 'root',\n})\nexport class PromotionService {\n\t/** Material dialog service used to open the promotion dialog. */\n\tprivate readonly dialog = inject(MatDialog);\n\n\t/**\n\t * Opens the promotion dialog and returns the user's selection.\n\t *\n\t * The dialog is modal (disableClose) with a backdrop.\n\t * Defaults to Queen ('q') if the dialog is dismissed without selection.\n\t *\n\t * @param color — The color of the promoting pawn ('white' or 'black').\n\t * @returns A Promise resolving to the chosen piece: `'q'` (Queen), `'r'` (Rook),\n\t *          `'b'` (Bishop), or `'n'` (Knight).\n\t */\n\tasync showPromotionDialog(color: 'white' | 'black'): Promise<PromotionPiece> {\n\t\tconst dialogRef = this.dialog.open(PromotionDialogComponent, {\n\t\t\twidth: '350px',\n\t\t\tdisableClose: true,\n\t\t\thasBackdrop: true,\n\t\t\tdata: { color } as PromotionDialogData,\n\t\t});\n\n\t\t// `afterClosed()` emits exactly once and completes, so the first value\n\t\t// can be unwrapped straight into a Promise — no `rxjs` import needed.\n\t\tconst result = await new Promise<PromotionPiece | undefined>((resolve) => {\n\t\t\tdialogRef.afterClosed().subscribe({\n\t\t\t\tnext: (value: PromotionPiece | undefined) => resolve(value),\n\t\t\t\terror: () => resolve(undefined),\n\t\t\t});\n\t\t});\n\t\treturn result ?? 'q'; // Default to queen if dialog is closed without selection\n\t}\n}\n","import { Component, computed, inject } from '@angular/core';\nimport type { Api } from 'chessground/api';\nimport * as play from '../../units/play';\nimport { NgxChessgroundComponent } from '../ngx-chessground/ngx-chessground.component';\nimport { PromotionService } from '../promotion-dialog/promotion.service';\n\n/**\n * A table-style chessboard demo component.\n *\n * Displays a single chessboard initialized with the \"Play legal moves from initial position\"\n * unit preset, enhanced with dialog-based pawn promotion via {@link PromotionService}.\n *\n * The run function is exposed as a `computed`, so the child board receives it\n * directly through its required `runFunction` input — no view-child query, no\n * imperative `effect()`, and no `initialized` guard flag.\n *\n * @example\n * ```html\n * <ngx-chessground-table />\n * ```\n */\n@Component({\n\tselector: 'ngx-chessground-table',\n\ttemplateUrl: './ngx-chessground-table.component.html',\n\tstyleUrl: './ngx-chessground-table.component.scss',\n\n\timports: [NgxChessgroundComponent],\n})\nexport class NgxChessgroundTableComponent {\n\t/** Injected promotion dialog service for pawn promotion UX. */\n\tprivate readonly promotionService = inject(PromotionService);\n\n\t/**\n\t * Board factory for the \"play from the initial position\" preset, wired to\n\t * the promotion dialog.\n\t *\n\t * The identity is stable: `createPlayUnitsWithDialog` returns fresh unit\n\t * objects only when re-evaluated, and a `computed` caches its result until a\n\t * dependency changes. The board therefore is not torn down and recreated.\n\t */\n\tprotected readonly runFunction = computed<(el: HTMLElement) => Api>(\n\t\t() => play.createPlayUnitsWithDialog(this.promotionService).initial.run,\n\t);\n}\n","<ngx-chessground #chess [runFunction]=\"runFunction()\" />\n","import { booleanAttribute, Component, computed, input } from '@angular/core';\n\n/**\n * Vertical evaluation bar showing the current position evaluation.\n *\n * Displays a white/black gradient bar with a centered divider and\n * a floating text badge showing the current centipawn/mate score.\n * Supports flipping via CSS scaleY when the board orientation is flipped.\n *\n * @example\n * ```html\n * <evaluation-bar\n *   [evaluation]=\"currentEvaluation()\"\n *   [flipped]=\"flipped()\"\n * />\n * ```\n */\n@Component({\n\tselector: 'evaluation-bar',\n\ttemplateUrl: './evaluation-bar.component.html',\n\tstyleUrl: './evaluation-bar.component.css',\n})\nexport class EvaluationBarComponent {\n\t/** Raw evaluation string (e.g. `\"+1.23\"`, `\"#3\"`, `\"-M2\"`) or null. */\n\treadonly evaluation = input<string | null>(null);\n\n\t/** Whether the board is flipped (black at bottom). Flips the bar. */\n\treadonly flipped = input(false, { transform: booleanAttribute });\n\n\t/** Height percentage for the fill (0 = all black, 100 = all white, 50 = equal). */\n\treadonly barHeight = computed(() => {\n\t\tconst evalStr = this.evaluation();\n\t\tif (!evalStr) return 50;\n\n\t\tif (evalStr.startsWith('#')) {\n\t\t\tconst mateIn = parseInt(evalStr.substring(1), 10);\n\t\t\tif (mateIn > 0) return 100;\n\t\t\tif (mateIn < 0) return 0;\n\t\t\treturn 50;\n\t\t}\n\n\t\tconst evalNum = parseFloat(evalStr);\n\t\tif (Number.isNaN(evalNum)) return 50;\n\n\t\tconst maxEval = 5.0;\n\t\tconst clampedEval = Math.max(-maxEval, Math.min(maxEval, evalNum));\n\t\treturn 50 + (clampedEval / maxEval) * 50;\n\t});\n\n\t/** Formatted evaluation string for the text badge (e.g. `\"+1.23\"`, `\"M3\"`, `\"-M2\"`). */\n\treadonly formattedEval = computed(() => {\n\t\tconst raw = this.evaluation();\n\t\tif (!raw) return '—';\n\n\t\tif (raw.startsWith('#')) {\n\t\t\tconst val = parseInt(raw.substring(1), 10);\n\t\t\tif (val > 0) return `M${val}`;\n\t\t\tif (val < 0) return `-M${Math.abs(val)}`;\n\t\t\treturn '—';\n\t\t}\n\n\t\tconst num = parseFloat(raw);\n\t\tif (Number.isNaN(num)) return '—';\n\t\tconst rounded = Math.round(num * 100) / 100;\n\t\tif (rounded > 0) return `+${rounded.toFixed(2)}`;\n\t\treturn rounded.toFixed(2);\n\t});\n\n\t/** CSS class for the evaluation fill based on advantage. */\n\treadonly evalClass = computed(() => {\n\t\tconst evalStr = this.evaluation();\n\t\tif (!evalStr) return 'eval-equal';\n\n\t\tif (evalStr.startsWith('#')) {\n\t\t\tconst val = parseInt(evalStr.substring(1), 10);\n\t\t\tif (val > 0) return 'eval-white';\n\t\t\tif (val < 0) return 'eval-black';\n\t\t\treturn 'eval-equal';\n\t\t}\n\n\t\tconst num = parseFloat(evalStr);\n\t\tif (Number.isNaN(num)) return 'eval-equal';\n\n\t\tif (num > 0.1) return 'eval-white';\n\t\tif (num < -0.1) return 'eval-black';\n\t\treturn 'eval-equal';\n\t});\n\n\t/** Dynamic fill color using CSS variables for theme support. */\n\treadonly evalFillColor = computed(() => {\n\t\t// Use CSS custom properties so the fill adapts to light/dark theme\n\t\tconst cls = this.evalClass();\n\t\tif (cls === 'eval-white') return 'var(--eval-fill-white, #ffffff)';\n\t\tif (cls === 'eval-black') return 'var(--eval-fill-black, #ffffff)';\n\t\treturn 'var(--eval-fill-equal, #ffffff)';\n\t});\n}\n","<div\n  class=\"evaluation-bar-container\"\n  [class.flipped]=\"flipped()\"\n>\n  <div\n    [class]=\"'evaluation-fill ' + evalClass()\"\n    [style.transform]=\"'scaleY(' + (barHeight() / 100) + ')'\"\n    [style.background]=\"evalFillColor()\"\n  ></div>\n  <div\n    [class]=\"'evaluation-text ' + evalClass()\"\n    [style.top.%]=\"100 - barHeight()\"\n  >\n    {{ formattedEval() }}\n  </div>\n</div>\n","import {\n\tbooleanAttribute,\n\tComponent,\n\tcomputed,\n\tinput,\n\tmodel,\n\toutput,\n} from '@angular/core';\nimport type { Api } from 'chessground/api';\nimport type { Config } from 'chessground/config';\nimport { NgxChessgroundComponent } from '../../ngx-chessground/ngx-chessground.component';\nimport type { BestMoveInfo } from '../pgn-viewer.types';\nimport { EvaluationBarComponent } from './evaluation-bar.component';\n\n/**\n * Board display panel for the PGN viewer — center panel.\n *\n * Shows the chessboard with player names, clocks, turn indicators,\n * evaluation bar, board control buttons (flip, 3D toggle),\n * Stockfish analysis controls, and move navigation buttons.\n *\n * All state is owned by the parent container and passed via inputs.\n * The component emits events for user interactions.\n */\n@Component({\n\tselector: 'board-display',\n\timports: [NgxChessgroundComponent, EvaluationBarComponent],\n\ttemplateUrl: './board-display.component.html',\n\tstyleUrl: './board-display.component.css',\n})\nexport class BoardDisplayComponent {\n\t// ---- Board State ----\n\t/**\n\t * Chessground run function for rendering the board.\n\t *\n\t * Required and never `undefined`: the wrapper's `runFunction` input is\n\t * required, so a missing factory is a compile-time error rather than a\n\t * silently empty board.\n\t */\n\treadonly runFunction = input.required<(el: HTMLElement) => Api>();\n\t/**\n\t * Partial Chessground config applied to the live board instance via\n\t * `Api.set()` on every change (position, orientation, movable pieces).\n\t */\n\treadonly config = input<Partial<Config> | null>(null);\n\t/** Whether the board is flipped (black at bottom). */\n\treadonly flipped = model<boolean>(false);\n\t/** Whether to render 3D Staunton pieces. */\n\treadonly in3d = model<boolean>(false);\n\n\t// ---- Player Info ----\n\t/** Player shown above the board (Black when unflipped). */\n\treadonly topPlayerName = input<string>('Unknown');\n\t/** Player shown below the board (White when unflipped). */\n\treadonly bottomPlayerName = input<string>('Unknown');\n\t/** Extra CSS class for the top player row, e.g. a turn indicator. */\n\treadonly topPlayerTurnClass = input<string>('');\n\t/** Extra CSS class for the bottom player row, e.g. a turn indicator. */\n\treadonly bottomPlayerTurnClass = input<string>('');\n\t/** Side to move, as used by chessground's piece theming. */\n\treadonly activeColor = input<string>('w');\n\t/** Colour of the top player's piece icon. */\n\treadonly topPlayerActiveColor = input<string>('b');\n\t/** Colour of the bottom player's piece icon. */\n\treadonly bottomPlayerActiveColor = input<string>('w');\n\t/** Title (GM/IM/…) prefix for the top player, or `''`. */\n\treadonly topPlayerTitle = input<string>('');\n\t/** Title (GM/IM/…) prefix for the bottom player, or `''`. */\n\treadonly bottomPlayerTitle = input<string>('');\n\n\t// ---- Clocks ----\n\t/** Formatted remaining time for the top player, or `''` when unknown. */\n\treadonly topTimeRemaining = input<string>('');\n\t/** Formatted remaining time for the bottom player, or `''` when unknown. */\n\treadonly bottomTimeRemaining = input<string>('');\n\n\t// ---- Game Result ----\n\t/** Result of the loaded game: `'1-0'`, `'0-1'`, `'1/2-1/2'` or `'*'`. */\n\treadonly gameResult = input<string>('*');\n\t/** Whether the board shows the final position of the game. */\n\treadonly isEndOfReplay = input(false, { transform: booleanAttribute });\n\n\t// ---- Evaluation ----\n\t/** Evaluation to display, in the viewer's display format, or `null`. */\n\treadonly evaluation = input<string | null>(null);\n\n\t// ---- Move Navigation ----\n\t/** Zero-based index of the displayed move; `-1` is the start position. */\n\treadonly currentMoveIndex = input<number>(-1);\n\t/** Total number of moves in the loaded game. */\n\treadonly movesCount = input<number>(0);\n\n\t/** Whether the \"jump to start\" control is enabled. */\n\treadonly canGoFirst = computed(\n\t\t() => !this.practiceActive() && this.currentMoveIndex() >= 0,\n\t);\n\t/** Whether the \"previous move\" control is enabled. */\n\treadonly canGoPrev = computed(\n\t\t() => !this.practiceActive() && this.currentMoveIndex() >= 0,\n\t);\n\t/** Whether the \"next move\" control is enabled. */\n\treadonly canGoNext = computed(\n\t\t() =>\n\t\t\t!this.practiceActive() && this.currentMoveIndex() < this.movesCount() - 1,\n\t);\n\t/** Whether the \"jump to end\" control is enabled. */\n\treadonly canGoLast = computed(\n\t\t() =>\n\t\t\t!this.practiceActive() && this.currentMoveIndex() < this.movesCount() - 1,\n\t);\n\n\t// ---- Stockfish Analysis ----\n\t/** Whether Stockfish is analyzing the displayed position. */\n\treadonly isAnalyzing = input(false, { transform: booleanAttribute });\n\t/** Engine best move and principal variation, or `null`. */\n\treadonly bestMoveInfo = input<BestMoveInfo | null>(null);\n\t/** Whether the analysis panel is expanded. */\n\treadonly analysisVisible = input(false, { transform: booleanAttribute });\n\t/** Whether the \"show better move\" button should be offered. */\n\treadonly showBetterMoveBtn = input(false, { transform: booleanAttribute });\n\t/** Stockfish search depth (two-way). */\n\treadonly stockfishDepth = model<number>(18);\n\t/** Whether there is a next alternative move to cycle to. */\n\treadonly hasNextAlternative = input(false, { transform: booleanAttribute });\n\t/** Whether there is a previous alternative to cycle back to. */\n\treadonly hasPrevAlternative = input(false, { transform: booleanAttribute });\n\t/** Label showing current alternative position (e.g. \"2/3\"). */\n\treadonly alternativeLabel = input<string>('');\n\t/** Whether autoplay of the best line has completed (enables re-evaluate). */\n\treadonly autoplayCompleted = input(false, { transform: booleanAttribute });\n\n\t// ---- Practice Mode ----\n\t/** Whether the \"Analyze practice\" button should be offered (game not replaying). */\n\treadonly practiceAvailable = input(false, { transform: booleanAttribute });\n\t/** Whether practice mode is currently active. */\n\treadonly practiceActive = input(false, { transform: booleanAttribute });\n\n\t// ---- Events ----\n\t/** The user asked to flip the board orientation. */\n\treadonly flipBoard = output<void>();\n\t/** The user asked to toggle 3D pieces. */\n\treadonly toggle3d = output<void>();\n\t/** The user asked to jump to the start of the game. */\n\treadonly goToStart = output<void>();\n\t/** The user asked to step back one move. */\n\treadonly prev = output<void>();\n\t/** The user asked to step forward one move. */\n\treadonly next = output<void>();\n\t/** The user asked to jump to the end of the game. */\n\treadonly end = output<void>();\n\t/** The user asked to analyze a position; emits its FEN. */\n\treadonly analyzePosition = output<string>();\n\t/** The user asked to autoplay the engine's best line. */\n\treadonly autoplayBestLine = output<void>();\n\t/** The user asked to preview a principal-variation move; emits its FEN. */\n\treadonly previewPvMove = output<string>();\n\t/** The user asked to show or hide the analysis panel. */\n\treadonly toggleAnalysis = output<void>();\n\t/** Cycle to the next-best engine move. */\n\treadonly nextBestMove = output<void>();\n\t/** Cycle to the previous engine move. */\n\treadonly prevBestMove = output<void>();\n\t/** Re-evaluate the position currently displayed on the board. */\n\treadonly reevaluate = output<void>();\n\t/** Start practice mode from the current board position. */\n\treadonly startPractice = output<void>();\n\n\t// ---- Depth change handler ----\n\t/** Applies the Stockfish depth chosen in the number input. */\n\tonStockfishDepthChange(event: Event): void {\n\t\tconst value = Number((event.target as HTMLInputElement).value);\n\t\tthis.stockfishDepth.set(Number.isFinite(value) ? value : 1);\n\t}\n\n\t/** Forwards an analyze request for the given position. */\n\tonAnalyzePosition(fen: string): void {\n\t\tthis.analyzePosition.emit(fen);\n\t}\n}\n","<div class=\"board-wrapper\" [class.in3d]=\"in3d()\" [class.staunton]=\"in3d()\" [class.end-of-replay]=\"isEndOfReplay()\">\n  <!-- Top Player Info -->\n  <div class=\"player-info top\">\n    <div class=\"player-name-group\">\n      <span class=\"name\">{{ topPlayerName() }}</span>\n      <span\n        class=\"turn-indicator\"\n        [class]=\"topPlayerTurnClass()\"\n        [class.active]=\"activeColor() === topPlayerActiveColor()\"\n        [title]=\"topPlayerTitle()\"\n      ></span>\n      <span class=\"clock inset\">{{ topTimeRemaining() || '--:--' }}</span>\n    </div>\n  </div>\n\n  <!-- Board + Evaluation Bar -->\n  <div class=\"board-container\">\n    <ngx-chessground\n      [runFunction]=\"runFunction()\"\n      [config]=\"config()\"\n    ></ngx-chessground>\n    <evaluation-bar [evaluation]=\"evaluation()\" [flipped]=\"flipped()\" />\n  </div>\n\n  <!-- Bottom Player Info -->\n  <div class=\"player-info bottom\">\n    <div class=\"player-name-group\">\n      <span class=\"name\">{{ bottomPlayerName() }}</span>\n      <span\n        class=\"turn-indicator\"\n        [class]=\"bottomPlayerTurnClass()\"\n        [class.active]=\"activeColor() === bottomPlayerActiveColor()\"\n        [title]=\"bottomPlayerTitle()\"\n      ></span>\n      <span class=\"clock inset\">{{ bottomTimeRemaining() || '--:--' }}</span>\n    </div>\n  </div>\n</div>\n\n<!-- Game Result -->\n<div class=\"game-result-display\" [class.end-of-replay]=\"isEndOfReplay()\">{{ gameResult() }}</div>\n\n<!-- Board Controls -->\n<div class=\"board-controls\">\n  <button type=\"button\" \n    (click)=\"flipBoard.emit()\"\n    class=\"board-ctrl-btn\"\n    title=\"Flip board orientation\"\n    aria-label=\"Flip board\">\n    <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\n      <polyline points=\"17 1 21 5 17 9\"/><path d=\"M3 11V9a4 4 0 0 1 4-4h14\"/>\n      <polyline points=\"7 23 3 19 7 15\"/><path d=\"M21 13v2a4 4 0 0 1-4 4H3\"/>\n    </svg>\n    Flip\n  </button>\n  <button type=\"button\" \n    (click)=\"toggle3d.emit()\"\n    class=\"board-ctrl-btn\"\n    [class.active]=\"in3d()\"\n    title=\"Toggle 3D board appearance\"\n    aria-label=\"Toggle 3D\">\n    @if (in3d()) {\n      <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\n        <rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"2\"/>\n        <path d=\"M3 9h18\"/><path d=\"M9 3v18\"/>\n      </svg>\n      2D\n    } @else {\n      <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\n        <path d=\"M12 2L3 7.5v9L12 22l9-4.5v-9L12 2z\"/>\n        <path d=\"M12 2v20\"/><path d=\"M3 7.5l9 4.5 9-4.5\"/>\n      </svg>\n      3D\n    }\n  </button>\n  @if (practiceAvailable()) {\n    <button type=\"button\" \n      (click)=\"startPractice.emit()\"\n      class=\"board-ctrl-btn practice-btn\"\n      [class.active]=\"practiceActive()\"\n      [disabled]=\"practiceActive()\"\n      title=\"Turn-based practice with continuous Stockfish analysis\"\n      aria-label=\"Analyze practice\">\n      <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\n        <circle cx=\"11\" cy=\"11\" r=\"7\"/>\n        <path d=\"m21 21-4.3-4.3\"/>\n        <path d=\"M8 11h6\"/>\n      </svg>\n      Analyze Practice\n    </button>\n  }\n</div>\n\n<!-- Stockfish Analysis -->\n@if (showBetterMoveBtn()) {\n  <div class=\"analysis-container\">\n    <div class=\"analysis-controls\">\n      @if (!analysisVisible()) {\n        <label class=\"depth-label\">\n          Depth:\n          <input\n            type=\"number\"\n            [value]=\"stockfishDepth()\"\n            (input)=\"onStockfishDepthChange($event)\"\n            min=\"1\"\n            max=\"50\"\n            class=\"small-input depth-input\"\n          />\n        </label>\n        <button type=\"button\" \n          (click)=\"toggleAnalysis.emit()\"\n          class=\"primary-button small\"\n        >\n          Show Better Move\n        </button>\n      }\n    </div>\n\n    @if (analysisVisible()) {\n      <div class=\"analysis-result\">\n        @if (isAnalyzing()) {\n          <span class=\"analyzing-text\">Thinking...</span>\n        } @else if (bestMoveInfo(); as info) {\n          <div class=\"best-move\">\n            <div class=\"best-move-header\">\n              <strong>\n                Best: {{ info.move }}\n                @if (info.score) {\n                  <span class=\"eval-score\">({{ info.score }})</span>\n                }\n                @if (alternativeLabel()) {\n                  <span class=\"alt-label\">{{ alternativeLabel() }}</span>\n                }\n              </strong>\n              <button type=\"button\" \n                (click)=\"autoplayBestLine.emit()\"\n                class=\"primary-button xsmall\"\n                title=\"Play Best Line\"\n              >\n                ▶ Play\n              </button>\n            </div>\n            <div class=\"pv-line\">\n              @for (pvMove of info.pv; track $index) {\n                <button type=\"button\" \n                  class=\"pv-move-btn\"\n                  (click)=\"previewPvMove.emit(pvMove.fen)\"\n                >\n                  {{ pvMove.san }}\n                </button>\n              }\n            </div>\n            @if (hasPrevAlternative() || hasNextAlternative()) {\n              <div class=\"alt-nav\">\n                <button type=\"button\"\n                  (click)=\"prevBestMove.emit()\"\n                  [disabled]=\"!hasPrevAlternative()\"\n                  class=\"alt-nav-btn\"\n                  title=\"Previous best move\"\n                  aria-label=\"Previous best move\"\n                >← Prev</button>\n                <button type=\"button\"\n                  (click)=\"nextBestMove.emit()\"\n                  [disabled]=\"!hasNextAlternative()\"\n                  class=\"alt-nav-btn\"\n                  title=\"Next best move\"\n                  aria-label=\"Next best move\"\n                >Next →</button>\n              </div>\n            }\n          </div>\n        }\n        @if (autoplayCompleted() && !isAnalyzing()) {\n          <div class=\"reevaluate-section\">\n            <button type=\"button\"\n              (click)=\"reevaluate.emit()\"\n              class=\"primary-button small\"\n              title=\"Analyze the current board position\"\n            >\n              <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\n                <circle cx=\"11\" cy=\"11\" r=\"8\"/>\n                <path d=\"m21 21-4.3-4.3\"/>\n              </svg>\n              Re-evaluate\n            </button>\n          </div>\n        }\n      </div>\n    }\n  </div>\n}\n\n<!-- Move Navigation -->\n<div class=\"move-navigation\">\n  <button type=\"button\" \n    (click)=\"goToStart.emit()\"\n    [disabled]=\"!canGoFirst()\"\n    class=\"nav-btn\"\n    aria-label=\"First Move\"\n  >\n    |&lt;\n  </button>\n  <button type=\"button\" \n    (click)=\"prev.emit()\"\n    [disabled]=\"!canGoPrev()\"\n    class=\"nav-btn\"\n    aria-label=\"Previous Move\"\n  >\n    &lt;\n  </button>\n  <span class=\"move-status\" aria-live=\"polite\">\n    {{ currentMoveIndex() + 1 }} / {{ movesCount() }}\n  </span>\n  <button type=\"button\" \n    (click)=\"next.emit()\"\n    [disabled]=\"!canGoNext()\"\n    class=\"nav-btn\"\n    aria-label=\"Next Move\"\n  >\n    &gt;\n  </button>\n  <button type=\"button\" \n    (click)=\"end.emit()\"\n    [disabled]=\"!canGoLast()\"\n    class=\"nav-btn\"\n    aria-label=\"Last Move\"\n  >\n    &gt;|\n  </button>\n</div>\n","/**\n * Desktop (Deno) runtime detection.\n *\n * The packaged desktop app serves the same Angular bundle as the web app, but\n * `desktop/server.ts` injects `desktop/desktop-adapter.js` into the page, which\n * exposes a `window.__desktop__` marker before the bundle runs.\n *\n * This matters for persistence: Deno Desktop points the webview at a random\n * localhost port on every launch, so the webview origin — and with it\n * `localStorage` and `IndexedDB` — is new each time. Only in the desktop\n * runtime do the viewer's settings and its parsed-game cache therefore go\n * through the local server's on-disk `/api/state` and `/api/cache` endpoints.\n * In a regular browser everything keeps using web storage.\n */\n\n/** Shape of the marker object injected by the desktop adapter. */\nexport interface DesktopMarker {\n\t/**\n\t * Opens the host's native file picker.\n\t *\n\t * @param extensions — Allowed file extensions, e.g. `['.pgn', '.zip']`.\n\t * @returns The chosen path, or `null` when the user cancelled.\n\t */\n\topenFileDialog?(extensions: string[]): Promise<string | null>;\n}\n\n/** Returns `true` when running inside the Deno Desktop webview. */\nexport function isDesktopRuntime(): boolean {\n\tif (typeof window === 'undefined') return false;\n\treturn (\n\t\t(window as Window & { __desktop__?: DesktopMarker }).__desktop__ !==\n\t\tundefined\n\t);\n}\n","/**\n * A single segment of highlighted text — either a matching portion or\n * non-matching surrounding text.\n */\nexport interface TextSegment {\n\t/** The substring of the original text. */\n\ttext: string;\n\t/** Whether this segment matched the search query. */\n\tmatch: boolean;\n}\n\n/**\n * Splits `text` into match / non-match segments for typeahead highlighting.\n *\n * Performs a case-insensitive substring match of `query` within `text`.\n * Returns an array of {@link TextSegment} objects that can be rendered\n * with conditional styling (e.g. bold for matching segments).\n *\n * @param text  — Full text to segment (e.g. a player name).\n * @param query — Search query string to match against.\n * @returns Array of `{ text, match }` objects for template rendering.\n *\n * @example\n * ```typescript\n * const segments = highlightMatch('GM Magnus Carlsen (2850)', 'carl');\n * // [\n * //   { text: 'GM Magnus ', match: false },\n * //   { text: 'Carl', match: true },\n * //   { text: 'sen (2850)', match: false },\n * // ]\n * ```\n */\nexport function highlightMatch(text: string, query: string): TextSegment[] {\n\tconst q = query.toLowerCase().trim();\n\tif (!q) {\n\t\treturn [{ text, match: false }];\n\t}\n\tconst idx = text.toLowerCase().indexOf(q);\n\tif (idx === -1) {\n\t\treturn [{ text, match: false }];\n\t}\n\tconst segments: TextSegment[] = [];\n\tif (idx > 0) {\n\t\tsegments.push({ text: text.substring(0, idx), match: false });\n\t}\n\tsegments.push({\n\t\ttext: text.substring(idx, idx + q.length),\n\t\tmatch: true,\n\t});\n\tif (idx + q.length < text.length) {\n\t\tsegments.push({ text: text.substring(idx + q.length), match: false });\n\t}\n\treturn segments;\n}\n","import {\n\tAfterViewInit,\n\tComponent,\n\tcomputed,\n\tElementRef,\n\teffect,\n\tinput,\n\tmodel,\n\tOnDestroy,\n\toutput,\n\tsignal,\n\tviewChild,\n} from '@angular/core';\nimport { highlightMatch, type TextSegment } from '../text-highlight';\n\n/** Inline styles applied to the dropdown when anchored to the viewer container. */\ninterface DropdownPosition {\n\t/** Always `fixed`: the dropdown is anchored to the viewer, not the panel. */\n\tposition: 'fixed';\n\t/** Viewport x-offset, as a CSS length. */\n\tleft: string;\n\t/** Viewport y-offset, as a CSS length. */\n\ttop: string;\n\t/** Dropdown width, matched to the input element. */\n\twidth: string;\n\t/** Max height before the list scrolls internally. */\n\tmaxHeight: string;\n\t/** Set to `hidden` while measuring, so the pre-position paint is skipped. */\n\tvisibility?: 'hidden';\n}\n\n/** Vertical gap between the input and the open dropdown. */\nconst DROPDOWN_GAP = 4;\n/** Maximum height of the dropdown before it scrolls internally. */\nconst DROPDOWN_MAX_HEIGHT = 440;\n/** Minimum height the dropdown is allowed to shrink to. */\nconst DROPDOWN_MIN_HEIGHT = 160;\n/** Below this much free space the dropdown flips to open upward. */\nconst OPEN_UP_THRESHOLD = 360;\n\n/**\n * Reusable typeahead input for filtering by player name.\n *\n * Provides an autocomplete dropdown with keyboard navigation,\n * text highlighting of matched portions, and support for\n * closing via blur (with configurable delay) or Escape.\n *\n * @example\n * ```html\n * <player-typeahead\n *   [label]=\"'White'\"\n *   [suggestions]=\"uniqueWhitePlayers()\"\n *   [(value)]=\"filterWhite\"\n *   (optionSelected)=\"onWhiteSelected($event)\"\n * />\n * ```\n */\n@Component({\n\tselector: 'player-typeahead',\n\ttemplateUrl: './player-typeahead.component.html',\n\tstyleUrl: './player-typeahead.component.css',\n})\nexport class PlayerTypeaheadComponent implements AfterViewInit, OnDestroy {\n\t/** Placeholder text for the input field. */\n\treadonly label = input.required<string>();\n\n\t/** Full list of player name suggestions. */\n\treadonly suggestions = input.required<string[]>();\n\n\t/** Two-way bound current filter value. */\n\treadonly value = model<string>('');\n\n\t/** Emitted when a suggestion is selected from the dropdown. */\n\treadonly optionSelected = output<string>();\n\n\t/** Whether the dropdown is open. */\n\treadonly isOpen = signal(false);\n\n\t/** Currently highlighted index in the dropdown. */\n\treadonly activeIndex = signal(0);\n\n\t/** Close timeout handle for delayed blur. */\n\tprivate closeTimeout: ReturnType<typeof setTimeout> | null = null;\n\n\t/** The text input element. */\n\treadonly inputEl = viewChild<ElementRef<HTMLInputElement>>('input');\n\t/** The suggestion list element. */\n\treadonly dropdownEl = viewChild<ElementRef<HTMLDivElement>>('dropdown');\n\n\t/** Inline styles anchoring the dropdown; null keeps the CSS fallback. */\n\treadonly dropdownPosition = signal<DropdownPosition | null>(null);\n\t/** Whether the dropdown opens above the input. */\n\treadonly openUp = signal(false);\n\n\t/**\n\t * The viewer container that anchors the fixed-position dropdown.\n\t * It establishes the containing block via layout containment\n\t * (`container-type: inline-size`), letting the dropdown escape the\n\t * left panel's scroll/clip context entirely.\n\t */\n\tprivate containerEl: HTMLElement | null = null;\n\t/** Watches the viewer container so the dropdown follows panel resizes. */\n\tprivate resizeObserver: ResizeObserver | null = null;\n\t/** Detaches the capture-phase scroll listener added in `ngAfterViewInit`. */\n\tprivate scrollCleanup: (() => void) | null = null;\n\t/** Coalesces reposition work into one animation frame. */\n\tprivate rafId: number | null = null;\n\n\t/** Filtered suggestions based on current input value. */\n\treadonly filteredSuggestions = computed(() => {\n\t\tconst query = this.value().toLowerCase().trim();\n\t\tif (!query) return this.suggestions();\n\t\treturn this.suggestions().filter((p) => p.toLowerCase().includes(query));\n\t});\n\n\t/**\n\t * Resets the highlighted suggestion whenever the dropdown (re)opens, so a\n\t * stale index from a previous query can never point past the new list.\n\t */\n\tconstructor() {\n\t\teffect(() => {\n\t\t\t// Reset active index when suggestions change\n\t\t\tif (this.isOpen()) {\n\t\t\t\tthis.activeIndex.set(0);\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Handles input events, updating the value and keeping the dropdown open.\n\t */\n\tonInput(event: Event): void {\n\t\tconst value = (event.target as HTMLInputElement).value;\n\t\tthis.value.set(value);\n\t\tthis.cancelClose();\n\t\tthis.isOpen.set(true);\n\t\tthis.activeIndex.set(0);\n\t\tthis.schedulePosition();\n\t}\n\n\t/** Opens the dropdown and resets selection index. */\n\topen(): void {\n\t\tthis.isOpen.set(true);\n\t\tthis.activeIndex.set(0);\n\t\tthis.schedulePosition();\n\t}\n\n\t/**\n\t * Closes the dropdown after a delay to allow mousedown on items to fire first.\n\t */\n\tclose(): void {\n\t\tthis.cancelClose();\n\t\tthis.closeTimeout = setTimeout(() => {\n\t\t\tthis.isOpen.set(false);\n\t\t\tthis.resetPosition();\n\t\t\tthis.closeTimeout = null;\n\t\t}, 200);\n\t}\n\n\t/** Selects a player suggestion, updates the value, and closes the dropdown. */\n\tselect(player: string): void {\n\t\tthis.cancelClose();\n\t\tthis.value.set(player);\n\t\tthis.isOpen.set(false);\n\t\tthis.activeIndex.set(0);\n\t\tthis.resetPosition();\n\t\tthis.optionSelected.emit(player);\n\t}\n\n\t/**\n\t * Handles keyboard navigation in the dropdown.\n\t * Arrow keys navigate, Enter selects, Escape closes.\n\t */\n\tonKeydown(event: KeyboardEvent): void {\n\t\tconst items = this.filteredSuggestions();\n\t\tif (!this.isOpen() || items.length === 0) {\n\t\t\tif (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n\t\t\t\tthis.isOpen.set(true);\n\t\t\t\tevent.preventDefault();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tswitch (event.key) {\n\t\t\tcase 'ArrowDown':\n\t\t\t\tevent.preventDefault();\n\t\t\t\tthis.activeIndex.update((i) => (i < items.length - 1 ? i + 1 : 0));\n\t\t\t\tbreak;\n\t\t\tcase 'ArrowUp':\n\t\t\t\tevent.preventDefault();\n\t\t\t\tthis.activeIndex.update((i) => (i > 0 ? i - 1 : items.length - 1));\n\t\t\t\tbreak;\n\t\t\tcase 'Enter': {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst selected = items[this.activeIndex()];\n\t\t\t\tif (selected) {\n\t\t\t\t\tthis.select(selected);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'Escape':\n\t\t\t\tthis.isOpen.set(false);\n\t\t\t\tthis.resetPosition();\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t/**\n\t * Splits text into match/non-match segments for highlighting.\n\t * Delegates to the standalone {@link highlightMatch} utility.\n\t */\n\thighlightText(text: string, query: string): TextSegment[] {\n\t\treturn highlightMatch(text, query);\n\t}\n\n\t/** Cancels any pending close timeout. */\n\tprivate cancelClose(): void {\n\t\tif (this.closeTimeout) {\n\t\t\tclearTimeout(this.closeTimeout);\n\t\t\tthis.closeTimeout = null;\n\t\t}\n\t}\n\n\t/**\n\t * Finds the viewer container to anchor the dropdown against and starts\n\t * observing the layout, so the fixed-position dropdown tracks the input\n\t * while ancestor scroll or panel-resize changes the input's position.\n\t */\n\tngAfterViewInit(): void {\n\t\tconst input = this.inputEl()?.nativeElement;\n\t\tif (!input) return;\n\n\t\t// Only anchor when the component is inside the PGN viewer.\n\t\tthis.containerEl = input.closest(\n\t\t\t'.pgn-viewer-container',\n\t\t) as HTMLElement | null;\n\t\tif (!this.containerEl) return;\n\n\t\t// Reposition while any ancestor (left panel, main content, window) scrolls.\n\t\tconst onScroll = () => this.schedulePosition();\n\t\twindow.addEventListener('scroll', onScroll, true);\n\t\tthis.scrollCleanup = () =>\n\t\t\twindow.removeEventListener('scroll', onScroll, true);\n\n\t\t// Reposition when the viewer is resized (window, panel drag handles, media queries).\n\t\tthis.resizeObserver = new ResizeObserver(() => this.schedulePosition());\n\t\tthis.resizeObserver.observe(this.containerEl);\n\t}\n\n\t/** Detaches the scroll and resize listeners set up in `ngAfterViewInit`. */\n\tngOnDestroy(): void {\n\t\tthis.scrollCleanup?.();\n\t\tthis.resizeObserver?.disconnect();\n\t\tif (this.rafId !== null) {\n\t\t\tcancelAnimationFrame(this.rafId);\n\t\t}\n\t}\n\n\t/**\n\t * Clears the anchored dropdown styles, restoring the CSS fallback\n\t * (only relevant when the dropdown is closed).\n\t */\n\tprivate resetPosition(): void {\n\t\tthis.dropdownPosition.set(null);\n\t\tthis.openUp.set(false);\n\t}\n\n\t/** Coalesces repositioning work into a single animation frame. */\n\tprivate schedulePosition(): void {\n\t\tif (this.rafId !== null) {\n\t\t\tcancelAnimationFrame(this.rafId);\n\t\t}\n\t\tthis.rafId = requestAnimationFrame(() => {\n\t\t\tthis.rafId = null;\n\t\t\tthis.positionDropdown();\n\t\t});\n\t}\n\n\t/**\n\t * Anchors the dropdown to the input using fixed positioning relative to the\n\t * viewer container, so it escapes the left panel's scroll/clip context.\n\t * Opens upward when there is not enough room below the input.\n\t */\n\tprivate positionDropdown(): void {\n\t\tif (!this.isOpen()) return;\n\t\tconst input = this.inputEl()?.nativeElement;\n\t\tconst container = this.containerEl;\n\t\tif (!input || !container) return;\n\n\t\tconst inputRect = input.getBoundingClientRect();\n\t\tconst containerRect = container.getBoundingClientRect();\n\t\tconst gap = DROPDOWN_GAP;\n\n\t\tconst spaceBelow = containerRect.bottom - inputRect.bottom - gap;\n\t\tconst spaceAbove = inputRect.top - containerRect.top - gap;\n\t\tconst openUp = spaceBelow < OPEN_UP_THRESHOLD && spaceAbove > spaceBelow;\n\n\t\tconst maxHeight = Math.max(\n\t\t\tMath.min(DROPDOWN_MAX_HEIGHT, openUp ? spaceAbove : spaceBelow),\n\t\t\tDROPDOWN_MIN_HEIGHT,\n\t\t);\n\n\t\tconst width = inputRect.width;\n\t\tconst maxLeft = Math.max(containerRect.width - width, 0);\n\t\tconst left = Math.min(\n\t\t\tMath.max(inputRect.left - containerRect.left, 0),\n\t\t\tmaxLeft,\n\t\t);\n\n\t\tif (!openUp) {\n\t\t\t// Opening down: the top offset is exact regardless of dropdown height.\n\t\t\tthis.openUp.set(false);\n\t\t\tthis.dropdownPosition.set({\n\t\t\t\tposition: 'fixed',\n\t\t\t\tleft: `${left}px`,\n\t\t\t\ttop: `${inputRect.bottom - containerRect.top + gap}px`,\n\t\t\t\twidth: `${width}px`,\n\t\t\t\tmaxHeight: `${maxHeight}px`,\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\n\t\t// Opening up: measure the rendered height first, then anchor the bottom\n\t\t// edge to the input. The first paint is hidden to avoid a visible jump.\n\t\tthis.openUp.set(true);\n\t\tthis.dropdownPosition.set({\n\t\t\tposition: 'fixed',\n\t\t\tleft: `${left}px`,\n\t\t\ttop: '0',\n\t\t\twidth: `${width}px`,\n\t\t\tmaxHeight: `${maxHeight}px`,\n\t\t\tvisibility: 'hidden',\n\t\t});\n\t\trequestAnimationFrame(() => {\n\t\t\tconst dropdown = this.dropdownEl()?.nativeElement;\n\t\t\tconst height = dropdown?.offsetHeight ?? maxHeight;\n\t\t\tthis.dropdownPosition.set({\n\t\t\t\tposition: 'fixed',\n\t\t\t\tleft: `${left}px`,\n\t\t\t\ttop: `${Math.max(inputRect.top - containerRect.top - height - gap, 0)}px`,\n\t\t\t\twidth: `${width}px`,\n\t\t\t\tmaxHeight: `${maxHeight}px`,\n\t\t\t});\n\t\t});\n\t}\n}\n","<div class=\"typeahead-wrapper\">\n  <input\n    #input\n    type=\"text\"\n    [placeholder]=\"label()\"\n    [attr.aria-label]=\"'Filter by ' + label() + ' player'\"\n    [value]=\"value()\"\n    (input)=\"onInput($event)\"\n    (focus)=\"open()\"\n    (blur)=\"close()\"\n    (keydown)=\"onKeydown($event)\"\n    autocomplete=\"off\"\n    role=\"combobox\"\n    [attr.aria-expanded]=\"isOpen()\"\n    [attr.aria-autocomplete]=\"'list'\"\n    [attr.aria-controls]=\"'typeahead-listbox-' + label()\"\n    [attr.aria-activedescendant]=\"isOpen() && filteredSuggestions().length > 0 && activeIndex() >= 0 ? 'typeahead-option-' + label() + '-' + activeIndex() : null\"\n  />\n  @if (isOpen() && filteredSuggestions().length > 0) {\n    <div\n      #dropdown\n      class=\"typeahead-dropdown\"\n      [class.open-up]=\"openUp()\"\n      [style.position]=\"dropdownPosition()?.position\"\n      [style.left]=\"dropdownPosition()?.left\"\n      [style.top]=\"dropdownPosition()?.top\"\n      [style.width]=\"dropdownPosition()?.width\"\n      [style.max-height]=\"dropdownPosition()?.maxHeight\"\n      [style.visibility]=\"dropdownPosition()?.visibility\"\n      role=\"listbox\"\n      [id]=\"'typeahead-listbox-' + label()\"\n    >\n      @for (player of filteredSuggestions(); track player; let i = $index) {\n        <div\n          class=\"typeahead-item\"\n          [class.active]=\"i === activeIndex()\"\n          role=\"option\"\n          [attr.aria-selected]=\"i === activeIndex()\"\n          [id]=\"'typeahead-option-' + label() + '-' + i\"\n          (mousedown)=\"select(player)\"\n        >\n          @for (segment of highlightText(player, value()); track $index) {\n            @if (segment.match) {\n              <span class=\"match-highlight\">{{ segment.text }}</span>\n            } @else {\n              <span>{{ segment.text }}</span>\n            }\n          }\n        </div>\n      }\n    </div>\n  }\n  @if (isOpen() && value() && filteredSuggestions().length === 0) {\n    <div class=\"typeahead-dropdown\">\n      <div class=\"typeahead-no-results\">No matching players</div>\n    </div>\n  }\n</div>\n","import {\n\tbooleanAttribute,\n\tComponent,\n\tinput,\n\tmodel,\n\toutput,\n} from '@angular/core';\nimport type { FilterGameInfo } from '../pgn-viewer.types';\nimport { PlayerTypeaheadComponent } from './player-typeahead.component';\n\n/**\n * Filter panel for the PGN viewer — left sidebar.\n *\n * Contains collapsible sections for:\n * - Player name typeahead filters (white/black)\n * - Game details (result, ECO, time control, event)\n * - Rating range filters with presets\n * - Position/FEN and opening-move filters\n *\n * All state is managed by the parent container and passed via inputs/outputs.\n * This component is purely presentational.\n */\n@Component({\n\tselector: 'game-filter-panel',\n\timports: [PlayerTypeaheadComponent],\n\ttemplateUrl: './game-filter-panel.component.html',\n\tstyleUrl: './game-filter-panel.component.css',\n})\nexport class GameFilterPanelComponent {\n\t// ---- Player Filters ----\n\t/** White-player name filter (two-way). */\n\treadonly filterWhite = model<string>('');\n\t/** Black-player name filter (two-way). */\n\treadonly filterBlack = model<string>('');\n\t/** When `true`, a name matches either colour instead of its own field only (two-way). */\n\treadonly ignoreColor = model<boolean>(false);\n\t/** All distinct White player names, for the typeahead. */\n\treadonly uniqueWhitePlayers = input<string[]>([]);\n\t/** All distinct Black player names, for the typeahead. */\n\treadonly uniqueBlackPlayers = input<string[]>([]);\n\n\t// ---- Game Detail Filters ----\n\t/** Selected results; an empty array means \"no result filter\" (two-way). */\n\treadonly filterResult = model<string[]>([]);\n\t/** Selected ECO code, or `''` for none (two-way). */\n\treadonly filterEco = model<string>('');\n\t/** Selected time-control keys, e.g. `['180+2']` (two-way). */\n\treadonly filterTimeControl = model<string[]>([]);\n\t/** Selected event name, or `''` for none (two-way). */\n\treadonly filterEvent = model<string>('');\n\t/** Selected broadcast name, or `''` for none (two-way). */\n\treadonly filterBroadcastName = model<string>('');\n\t/** Distinct ECO codes with game counts, for the dropdown. */\n\treadonly sortedEcoCodes = input<{ code: string; count: number }[]>([]);\n\t/** Distinct time controls with counts and a human-readable label/originals summary. */\n\treadonly sortedTimeControls = input<\n\t\t{ key: string; count: number; label: string; originalsSummary: string }[]\n\t>([]);\n\t/** Distinct event names with game counts, for the dropdown. */\n\treadonly sortedEvents = input<{ event: string; count: number }[]>([]);\n\t/** Distinct broadcast names with game counts, for the dropdown. */\n\treadonly sortedBroadcastNames = input<\n\t\t{ broadcastName: string; count: number }[]\n\t>([]);\n\n\t// ---- Upset Filters ----\n\t/** Whether upset filtering is enabled (two-way). */\n\treadonly filterUpsetEnabled = model<boolean>(false);\n\t/** Include upsets won by the lower-rated player (two-way). */\n\treadonly filterUpsetWin = model<boolean>(false);\n\t/** Include upsets drawn by the lower-rated player (two-way). */\n\treadonly filterUpsetDraw = model<boolean>(false);\n\t/** Minimum Elo gap between players for a game to count as an upset. */\n\treadonly filterUpsetMinDiff = model<string>('300');\n\n\t// ---- Rating Filters ----\n\t/** Whether rating-range filtering is enabled (two-way). */\n\treadonly filterRatingEnabled = model<boolean>(false);\n\t/** Lower bound of the White rating range, as entered (two-way). */\n\treadonly filterWhiteRating = model<string>('2000');\n\t/** Lower bound of the Black rating range, as entered (two-way). */\n\treadonly filterBlackRating = model<string>('2000');\n\t/** Upper bound of the White rating range, as entered (two-way). */\n\treadonly filterWhiteRatingMax = model<string>('2900');\n\t/** Upper bound of the Black rating range, as entered (two-way). */\n\treadonly filterBlackRatingMax = model<string>('2900');\n\n\t// ---- Position Filters ----\n\t/** Whether the opening-move prefix filter is active (two-way). */\n\treadonly filterMoves = model<boolean>(false);\n\t/** Whether position (FEN) filtering is active (two-way). */\n\treadonly filterByFenEnabled = model<boolean>(false);\n\t/** Target position for FEN filtering, as entered (two-way). */\n\treadonly filterFen = model<string>('');\n\n\t// ---- Sort ----\n\t/** Whether the game list is sorted oldest-first (two-way). */\n\treadonly sortAscending = model<boolean>(false);\n\n\t// ---- Collapsible Sections ----\n\t/** Which left-panel sections are expanded, keyed by section id. */\n\treadonly leftPanelSections = model<Record<string, boolean>>({\n\t\tplayers: true,\n\t\tgameDetails: true,\n\t\tupsets: false,\n\t\trating: false,\n\t\tposition: false,\n\t});\n\n\t// ---- Game List ----\n\t/** Parsed metadata for every game; drives the game-list navigator. */\n\treadonly gamesMetadata = input<unknown[]>([]);\n\t/** Metadata of the games matching the active filters. */\n\treadonly filteredGameInfos = input<FilterGameInfo[]>([]);\n\t/** Number of games matching the active filters. */\n\treadonly totalFilteredCount = input<number>(0);\n\t/** Whether a filter request is in flight. */\n\treadonly isFiltering = input(false, { transform: booleanAttribute });\n\t/** Index of the game currently loaded in the board. */\n\treadonly currentGameIndex = input<number>(0);\n\t/** How many games are selected for batch operations. */\n\treadonly selectedGamesCount = input<number>(0);\n\t/** Whether a previous game exists in the current navigation order. */\n\treadonly canGoPrev = input(false, { transform: booleanAttribute });\n\t/** Whether a next game exists in the current navigation order. */\n\treadonly canGoNext = input(false, { transform: booleanAttribute });\n\t/** White player of the loaded game, for the game-list header. */\n\treadonly currentWhitePlayer = input<string>('Unknown');\n\t/** Black player of the loaded game, for the game-list header. */\n\treadonly currentBlackPlayer = input<string>('Unknown');\n\t/** Result of the loaded game, for the game-list header. */\n\treadonly currentGameResult = input<string>('*');\n\n\t// ---- Events ----\n\t/** The user asked to apply the current filter selection. */\n\treadonly applyFilter = output<void>();\n\t/** The user asked to reset all filters. */\n\treadonly clearFilters = output<void>();\n\t/** A game was picked from the list; emits its index. */\n\treadonly loadGame = output<number>();\n\t/** A game's selection checkbox was toggled; emits its index. */\n\treadonly toggleGameSelection = output<number>();\n\t/** Navigate to the previous game in the filtered order. */\n\treadonly prevGame = output<void>();\n\t/** Navigate to the next game in the filtered order. */\n\treadonly nextGame = output<void>();\n\t/** Reverse the game-list sort direction. */\n\treadonly toggleSortDirection = output<void>();\n\t/** A collapsible section was toggled; emits the section id. */\n\treadonly toggleLeftSection = output<string>();\n\t/** Show every filtered game instead of the limited page. */\n\treadonly showAllFilteredGames = output<void>();\n\t/** Return to the limited game page. */\n\treadonly showLimitedGames = output<void>();\n\t/** Capture the board's current position as the FEN filter value. */\n\treadonly snapshotCurrentPosition = output<void>();\n\n\t// ---- Opening helper ----\n\t/** Resolves an ECO code to its opening move sequence, supplied by the container. */\n\treadonly getOpeningMoves = input<(code: string) => string>();\n\n\t/** Safe wrapper for invoking getOpeningMoves in templates. */\n\tgetOpeningMovesSafe(code: string): string {\n\t\tconst fn = this.getOpeningMoves();\n\t\treturn fn ? fn(code) : '';\n\t}\n\n\t// ---- Lichess date picker ----\n\t/** Selected Lichess archive year (two-way). */\n\treadonly lichessYear = model<number>(new Date().getFullYear());\n\t/** Selected Lichess archive month, 1-12 (two-way). */\n\treadonly lichessMonth = model<number>(1);\n\t/** Supplies the selectable years; provided by the container. */\n\treadonly getLichessYears = input<() => number[]>();\n\t/** Supplies the selectable months; provided by the container. */\n\treadonly getLichessMonths = input<() => number[]>();\n\n\t// ---- Methods ----\n\n\t/** Expands or collapses one left-panel section. */\n\ttoggleSection(section: string): void {\n\t\tthis.leftPanelSections.update((s) => ({\n\t\t\t...s,\n\t\t\t[section]: !s[section],\n\t\t}));\n\t}\n\n\t/** Applies the ECO code chosen in the dropdown. */\n\tupdateFilterEco(event: Event): void {\n\t\tconst value = (event.target as HTMLSelectElement).value;\n\t\tthis.filterEco.set(value);\n\t}\n\n\t/** Adds or removes one time-control key from the selection. */\n\ttoggleTimeControl(value: string, event: Event): void {\n\t\tconst checked = (event.target as HTMLInputElement).checked;\n\t\tthis.filterTimeControl.update((current) => {\n\t\t\tif (checked) {\n\t\t\t\treturn current.includes(value) ? current : [...current, value];\n\t\t\t}\n\t\t\treturn current.filter((v) => v !== value);\n\t\t});\n\t}\n\n\t/** Selects every time control present in the loaded collection. */\n\tselectAllTimeControls(): void {\n\t\tthis.filterTimeControl.set(this.sortedTimeControls().map((tc) => tc.key));\n\t}\n\n\t/** Clears the time-control selection. */\n\tclearTimeControls(): void {\n\t\tthis.filterTimeControl.set([]);\n\t}\n\n\t/** Applies the event chosen in the dropdown. */\n\tupdateFilterEvent(event: Event): void {\n\t\tconst value = (event.target as HTMLSelectElement).value;\n\t\tthis.filterEvent.set(value);\n\t}\n\n\t/** Applies the broadcast chosen in the dropdown. */\n\tupdateFilterBroadcastName(event: Event): void {\n\t\tconst value = (event.target as HTMLSelectElement).value;\n\t\tthis.filterBroadcastName.set(value);\n\t}\n\n\t/**\n\t * Applies a rating-range preset.\n\t *\n\t * Accepts either an explicit `min-max` value or a single lower bound\n\t * (`'3000'` opens the range to `4000`, anything else up to `3000`).\n\t */\n\tapplyRatingPreset(event: Event): void {\n\t\tconst value = (event.target as HTMLSelectElement).value;\n\t\tif (!value) return;\n\n\t\tthis.filterRatingEnabled.set(true);\n\n\t\tconst rangeMatch = value.match(/^(\\d+)-(\\d+)$/);\n\t\tif (rangeMatch) {\n\t\t\tconst min = rangeMatch[1];\n\t\t\tconst max = rangeMatch[2];\n\t\t\tthis.filterWhiteRating.set(min);\n\t\t\tthis.filterBlackRating.set(min);\n\t\t\tthis.filterWhiteRatingMax.set(max);\n\t\t\tthis.filterBlackRatingMax.set(max);\n\t\t} else {\n\t\t\tconst min = value;\n\t\t\tconst max = value === '3000' ? '4000' : '3000';\n\t\t\tthis.filterWhiteRating.set(min);\n\t\t\tthis.filterBlackRating.set(min);\n\t\t\tthis.filterWhiteRatingMax.set(max);\n\t\t\tthis.filterBlackRatingMax.set(max);\n\t\t}\n\t}\n\n\t/** Toggles inclusion of upsets won by the lower-rated player. */\n\ttoggleUpsetWin(event: Event): void {\n\t\tthis.filterUpsetWin.set((event.target as HTMLInputElement).checked);\n\t}\n\n\t/** Toggles inclusion of upsets drawn by the lower-rated player. */\n\ttoggleUpsetDraw(event: Event): void {\n\t\tthis.filterUpsetDraw.set((event.target as HTMLInputElement).checked);\n\t}\n\n\t/** Applies the minimum Elo gap for the upset filter. */\n\tupdateUpsetMinDiff(value: string): void {\n\t\tthis.filterUpsetMinDiff.set(value);\n\t}\n\n\t/** Adds or removes one result from the result filter. */\n\ttoggleResult(value: string, event: Event): void {\n\t\tconst checked = (event.target as HTMLInputElement).checked;\n\t\tthis.filterResult.update((current) => {\n\t\t\tif (checked) {\n\t\t\t\treturn current.includes(value) ? current : [...current, value];\n\t\t\t}\n\t\t\treturn current.filter((v) => v !== value);\n\t\t});\n\t}\n\n\t/** Applies the FEN typed into the position filter. */\n\tupdateFilterFen(value: string): void {\n\t\tthis.filterFen.set(value);\n\t}\n\n\t/** Applies the lower bound of the White rating range. */\n\tupdateWhiteRating(value: string): void {\n\t\tthis.filterWhiteRating.set(value);\n\t}\n\n\t/** Applies the upper bound of the White rating range. */\n\tupdateWhiteRatingMax(value: string): void {\n\t\tthis.filterWhiteRatingMax.set(value);\n\t}\n\n\t/** Applies the lower bound of the Black rating range. */\n\tupdateBlackRating(value: string): void {\n\t\tthis.filterBlackRating.set(value);\n\t}\n\n\t/** Applies the upper bound of the Black rating range. */\n\tupdateBlackRatingMax(value: string): void {\n\t\tthis.filterBlackRatingMax.set(value);\n\t}\n\n\t/** Requests loading of the game at `index`. */\n\tonGameClick(index: number): void {\n\t\tthis.loadGame.emit(index);\n\t}\n\n\t/** Requests navigation to the previous game. */\n\tonPrevGame(): void {\n\t\tthis.prevGame.emit();\n\t}\n\n\t/** Requests navigation to the next game. */\n\tonNextGame(): void {\n\t\tthis.nextGame.emit();\n\t}\n}\n","<div class=\"left-panel-inner\">\n  <h2>Game Browser</h2>\n\n  <!-- Collapsible: Players -->\n  <div class=\"collapsible-section\">\n    <h3\n      class=\"section-header\"\n      tabindex=\"0\"\n      role=\"button\"\n      [attr.aria-expanded]=\"leftPanelSections()['players']\"\n      [attr.aria-controls]=\"'section-players-content'\"\n      (click)=\"toggleSection('players')\"\n      (keydown.enter)=\"toggleSection('players'); $event.preventDefault()\"\n      (keydown.space)=\"toggleSection('players'); $event.preventDefault()\"\n    >\n      <span class=\"chevron\" [class.expanded]=\"leftPanelSections()['players']\" aria-hidden=\"true\"></span>\n      Players\n    </h3>\n    <div class=\"section-content players-content\" [class.expanded]=\"leftPanelSections()['players']\" id=\"section-players-content\">\n      <div class=\"filter-section\">\n        <div class=\"filter-row\">\n          <player-typeahead\n            label=\"White\"\n            [suggestions]=\"uniqueWhitePlayers()\"\n            [(value)]=\"filterWhite\"\n          />\n        </div>\n        <div class=\"filter-row\">\n          <player-typeahead\n            label=\"Black\"\n            [suggestions]=\"uniqueBlackPlayers()\"\n            [(value)]=\"filterBlack\"\n          />\n        </div>\n        <div class=\"filter-row\">\n          <label class=\"checkbox-label\">\n            <input\n              type=\"checkbox\"\n              [checked]=\"ignoreColor()\"\n              (change)=\"ignoreColor.set(!ignoreColor())\"\n            />\n            Ignore Color\n          </label>\n        </div>\n      </div>\n    </div>\n  </div>\n\n  <!-- Collapsible: Game Details -->\n  <div class=\"collapsible-section\">\n    <h3\n      class=\"section-header\"\n      tabindex=\"0\"\n      role=\"button\"\n      [attr.aria-expanded]=\"leftPanelSections()['gameDetails']\"\n      [attr.aria-controls]=\"'section-details-content'\"\n      (click)=\"toggleSection('gameDetails')\"\n      (keydown.enter)=\"toggleSection('gameDetails'); $event.preventDefault()\"\n      (keydown.space)=\"toggleSection('gameDetails'); $event.preventDefault()\"\n    >\n      <span class=\"chevron\" [class.expanded]=\"leftPanelSections()['gameDetails']\" aria-hidden=\"true\"></span>\n      Game Details\n    </h3>\n    <div class=\"section-content\" [class.expanded]=\"leftPanelSections()['gameDetails']\" id=\"section-details-content\">\n      <div class=\"filter-section\">\n        <div class=\"filter-row filter-result-row\">\n          <span class=\"filter-label\">Result</span>\n          <label class=\"checkbox-label result-option\">\n            <input\n              type=\"checkbox\"\n              [checked]=\"filterResult().includes('1-0')\"\n              (change)=\"toggleResult('1-0', $event)\"\n            />\n            White wins (1-0)\n          </label>\n          <label class=\"checkbox-label result-option\">\n            <input\n              type=\"checkbox\"\n              [checked]=\"filterResult().includes('1/2-1/2')\"\n              (change)=\"toggleResult('1/2-1/2', $event)\"\n            />\n            Draw (½-½)\n          </label>\n          <label class=\"checkbox-label result-option\">\n            <input\n              type=\"checkbox\"\n              [checked]=\"filterResult().includes('0-1')\"\n              (change)=\"toggleResult('0-1', $event)\"\n            />\n            Black wins (0-1)\n          </label>\n          <label class=\"checkbox-label result-option\">\n            <input\n              type=\"checkbox\"\n              [checked]=\"filterResult().includes('*')\"\n              (change)=\"toggleResult('*', $event)\"\n            />\n            Unfinished (*)\n          </label>\n        </div>\n        <div class=\"filter-row\">\n          <select\n            [value]=\"filterEco()\"\n            (change)=\"updateFilterEco($event)\"\n            aria-label=\"Filter by ECO Opening\"\n          >\n            <option value=\"\">All Openings</option>\n            @for (ecoData of sortedEcoCodes(); track ecoData.code) {\n              <option\n                [value]=\"ecoData.code\"\n                [selected]=\"ecoData.code === filterEco()\"\n              >\n                {{ ecoData.code }}\n                @if (getOpeningMovesSafe(ecoData.code)) {\n                  - {{ getOpeningMovesSafe(ecoData.code) }}\n                }\n                ({{ ecoData.count }})\n              </option>\n            }\n          </select>\n        </div>\n        <div class=\"filter-row\">\n          <div class=\"tc-filter-block\">\n            <div class=\"tc-toolbar\">\n              <span class=\"filter-label\" id=\"tc-filter-label\">Time Control</span>\n              @if (filterTimeControl().length > 0) {\n                <span class=\"tc-selected-badge\"\n                  >{{ filterTimeControl().length }} selected</span\n                >\n              } @else {\n                <span class=\"tc-empty-hint\">Any</span>\n              }\n              @if (sortedTimeControls().length > 0) {\n                <span class=\"tc-quick-actions\">\n                  <button\n                    type=\"button\"\n                    class=\"tc-action\"\n                    (click)=\"selectAllTimeControls()\"\n                    title=\"Select every time control\"\n                  >\n                    All\n                  </button>\n                  <button\n                    type=\"button\"\n                    class=\"tc-action\"\n                    (click)=\"clearTimeControls()\"\n                    title=\"Clear time control filter — include every time control\"\n                  >\n                    None\n                  </button>\n                </span>\n              }\n            </div>\n            @if (sortedTimeControls().length > 0) {\n              <div\n                class=\"tc-option-list\"\n                role=\"group\"\n                aria-labelledby=\"tc-filter-label\"\n              >\n                @for (tcData of sortedTimeControls(); track tcData.key) {\n                  <label class=\"tc-option\" [attr.title]=\"tcData.originalsSummary\">\n                    <input\n                      type=\"checkbox\"\n                      [checked]=\"filterTimeControl().includes(tcData.key)\"\n                      (change)=\"toggleTimeControl(tcData.key, $event)\"\n                    />\n                    <span class=\"tc-option-name\">{{ tcData.label }}</span>\n                    <span class=\"tc-option-count\">{{ tcData.count }}</span>\n                  </label>\n                }\n              </div>\n            }\n          </div>\n        </div>\n        <div class=\"filter-row\">\n          <select\n            [value]=\"filterEvent()\"\n            (change)=\"updateFilterEvent($event)\"\n            aria-label=\"Filter by Event\"\n          >\n            <option value=\"\">All Events</option>\n            @for (evtData of sortedEvents(); track evtData.event) {\n              <option\n                [value]=\"evtData.event\"\n                [selected]=\"evtData.event === filterEvent()\"\n              >\n                {{ evtData.event }} ({{ evtData.count }})\n              </option>\n            }\n          </select>\n        </div>\n        @if (sortedBroadcastNames().length > 0) {\n          <div class=\"filter-row\">\n            <select\n              [value]=\"filterBroadcastName()\"\n              (change)=\"updateFilterBroadcastName($event)\"\n              aria-label=\"Filter by Broadcast\"\n            >\n              <option value=\"\">All Broadcasts</option>\n              @for (bcastData of sortedBroadcastNames(); track bcastData.broadcastName) {\n                <option\n                  [value]=\"bcastData.broadcastName\"\n                  [selected]=\"bcastData.broadcastName === filterBroadcastName()\"\n                >\n                  {{ bcastData.broadcastName }} ({{ bcastData.count }})\n                </option>\n              }\n            </select>\n          </div>\n        }\n      </div>\n    </div>\n  </div>\n\n  <!-- Collapsible: Upsets -->\n  <div class=\"collapsible-section\">\n    <h3\n      class=\"section-header\"\n      tabindex=\"0\"\n      role=\"button\"\n      [attr.aria-expanded]=\"leftPanelSections()['upsets']\"\n      [attr.aria-controls]=\"'section-upsets-content'\"\n      (click)=\"toggleSection('upsets')\"\n      (keydown.enter)=\"toggleSection('upsets'); $event.preventDefault()\"\n      (keydown.space)=\"toggleSection('upsets'); $event.preventDefault()\"\n    >\n      <span class=\"chevron\" [class.expanded]=\"leftPanelSections()['upsets']\" aria-hidden=\"true\"></span>\n      Upsets\n    </h3>\n    <div class=\"section-content\" [class.expanded]=\"leftPanelSections()['upsets']\" id=\"section-upsets-content\">\n      <div class=\"filter-section\">\n        <div class=\"filter-row\">\n          <label class=\"checkbox-label two-line\">\n            <input\n              type=\"checkbox\"\n              [checked]=\"filterUpsetEnabled()\"\n              (change)=\"filterUpsetEnabled.set(!filterUpsetEnabled())\"\n            />\n            <span class=\"label-text\">\n              <span class=\"label-main\">Only upsets</span>\n              <span class=\"label-sub\">Keep games where the weaker-rated player scores</span>\n            </span>\n          </label>\n        </div>\n        @if (filterUpsetEnabled()) {\n          <div class=\"filter-row filter-result-row\">\n            <span class=\"filter-label\">Outcome</span>\n            <label class=\"checkbox-label result-option\">\n              <input\n                type=\"checkbox\"\n                [checked]=\"filterUpsetWin()\"\n                (change)=\"toggleUpsetWin($event)\"\n              />\n              Weaker wins\n            </label>\n            <label class=\"checkbox-label result-option\">\n              <input\n                type=\"checkbox\"\n                [checked]=\"filterUpsetDraw()\"\n                (change)=\"toggleUpsetDraw($event)\"\n              />\n              Weaker draws\n            </label>\n          </div>\n          <div class=\"filter-row gap-row\">\n            <label\n              class=\"filter-label\"\n              for=\"upset-min-diff\"\n              title=\"Minimum Elo gap between the two players for a result to count as an upset\"\n            >\n              Min Elo gap\n            </label>\n            <input\n              id=\"upset-min-diff\"\n              type=\"number\"\n              class=\"rating-input upset-gap-input\"\n              [value]=\"filterUpsetMinDiff()\"\n              (input)=\"updateUpsetMinDiff($any($event.target).value)\"\n              min=\"0\"\n              step=\"50\"\n            />\n            <span class=\"upset-hint\">{{ sortAscending() ? 'smallest upsets first' : 'biggest upsets first' }}</span>\n          </div>\n        }\n      </div>\n    </div>\n  </div>\n\n  <!-- Collapsible: Rating -->\n  <div class=\"collapsible-section\">\n    <h3\n      class=\"section-header\"\n      tabindex=\"0\"\n      role=\"button\"\n      [attr.aria-expanded]=\"leftPanelSections()['rating']\"\n      [attr.aria-controls]=\"'section-rating-content'\"\n      (click)=\"toggleSection('rating')\"\n      (keydown.enter)=\"toggleSection('rating'); $event.preventDefault()\"\n      (keydown.space)=\"toggleSection('rating'); $event.preventDefault()\"\n    >\n      <span class=\"chevron\" [class.expanded]=\"leftPanelSections()['rating']\" aria-hidden=\"true\"></span>\n      Rating\n    </h3>\n    <div class=\"section-content\" [class.expanded]=\"leftPanelSections()['rating']\" id=\"section-rating-content\">\n      <div class=\"filter-section\">\n        <div class=\"filter-row\">\n          <label class=\"checkbox-label\">\n            <input\n              type=\"checkbox\"\n              [checked]=\"filterRatingEnabled()\"\n              (change)=\"filterRatingEnabled.set(!filterRatingEnabled())\"\n            />\n            Rating\n          </label>\n          <select\n            (change)=\"applyRatingPreset($event)\"\n            class=\"preset-select\"\n            aria-label=\"Rating Presets\"\n          >\n            <option value=\"\">Select Level...</option>\n            <option value=\"0-1999\">Below 2000</option>\n            <option value=\"2000\">Candidate Master (2000+)</option>\n            <option value=\"2000-2199\">2000 – 2200</option>\n            <option value=\"2200\">National Master (2200+)</option>\n            <option value=\"2200-2299\">2200 – 2300</option>\n            <option value=\"2300\">FIDE Master (2300+)</option>\n            <option value=\"2300-2399\">2300 – 2400</option>\n            <option value=\"2400\">Intl. Master (2400+)</option>\n            <option value=\"2400-2499\">2400 – 2500</option>\n            <option value=\"2500\">Grandmaster (2500+)</option>\n            <option value=\"2500-2699\">2500 – 2700</option>\n            <option value=\"2700\">Super GM (2700+)</option>\n            <option value=\"2700-3000\">2700+</option>\n            <option value=\"3000\">Chess engines (3000 - 4000)</option>\n          </select>\n        </div>\n        <div class=\"filter-row\">\n          <input\n            type=\"number\"\n            placeholder=\"White Rating >\"\n            aria-label=\"Filter by White Rating Min\"\n            [value]=\"filterWhiteRating()\"\n            (input)=\"updateWhiteRating($any($event.target).value)\"\n            class=\"rating-input\"\n            step=\"50\"\n            [disabled]=\"!filterRatingEnabled()\"\n          />\n          <input\n            type=\"number\"\n            placeholder=\"White Rating <\"\n            aria-label=\"Filter by White Rating Max\"\n            [value]=\"filterWhiteRatingMax()\"\n            (input)=\"updateWhiteRatingMax($any($event.target).value)\"\n            class=\"rating-input\"\n            step=\"50\"\n            [disabled]=\"!filterRatingEnabled()\"\n          />\n        </div>\n        <div class=\"filter-row\">\n          <input\n            type=\"number\"\n            placeholder=\"Black Rating >\"\n            aria-label=\"Filter by Black Rating Min\"\n            [value]=\"filterBlackRating()\"\n            (input)=\"updateBlackRating($any($event.target).value)\"\n            class=\"rating-input\"\n            step=\"50\"\n            [disabled]=\"!filterRatingEnabled()\"\n          />\n          <input\n            type=\"number\"\n            placeholder=\"Black Rating <\"\n            aria-label=\"Filter by Black Rating Max\"\n            [value]=\"filterBlackRatingMax()\"\n            (input)=\"updateBlackRatingMax($any($event.target).value)\"\n            class=\"rating-input\"\n            step=\"50\"\n            [disabled]=\"!filterRatingEnabled()\"\n          />\n        </div>\n      </div>\n    </div>\n  </div>\n\n  <!-- Collapsible: Position -->\n  <div class=\"collapsible-section\">\n    <h3\n      class=\"section-header\"\n      tabindex=\"0\"\n      role=\"button\"\n      [attr.aria-expanded]=\"leftPanelSections()['position']\"\n      [attr.aria-controls]=\"'section-position-content'\"\n      (click)=\"toggleSection('position')\"\n      (keydown.enter)=\"toggleSection('position'); $event.preventDefault()\"\n      (keydown.space)=\"toggleSection('position'); $event.preventDefault()\"\n    >\n      <span class=\"chevron\" [class.expanded]=\"leftPanelSections()['position']\" aria-hidden=\"true\"></span>\n      Position\n    </h3>\n    <div class=\"section-content\" [class.expanded]=\"leftPanelSections()['position']\" id=\"section-position-content\">\n      <div class=\"filter-section\">\n        <div class=\"filter-row\">\n          <label class=\"checkbox-label\">\n            <input\n              type=\"checkbox\"\n              [checked]=\"filterMoves()\"\n              (change)=\"filterMoves.set(!filterMoves())\"\n            />\n            Enter Starting Moves\n          </label>\n        </div>\n        <div class=\"filter-row\">\n          <label class=\"checkbox-label\">\n            <input\n              type=\"checkbox\"\n              [checked]=\"filterByFenEnabled()\"\n              (change)=\"filterByFenEnabled.set(!filterByFenEnabled())\"\n            />\n            Search by Position\n          </label>\n        </div>\n        @if (filterByFenEnabled()) {\n          <div class=\"filter-row fen-row\">\n            <input\n              type=\"text\"\n              class=\"fen-input\"\n              placeholder=\"Paste FEN or use board position\"\n              aria-label=\"Search by FEN position\"\n              [value]=\"filterFen()\"\n              (input)=\"updateFilterFen($any($event.target).value)\"\n              spellcheck=\"false\"\n            />\n            <button\n              type=\"button\"\n              (click)=\"snapshotCurrentPosition.emit()\"\n              class=\"secondary-button small\"\n              title=\"Use current board position as filter\"\n            >\n              <svg\n                class=\"btn-icon\"\n                viewBox=\"0 0 24 24\"\n                width=\"14\"\n                height=\"14\"\n                aria-hidden=\"true\"\n                focusable=\"false\"\n              >\n                <path\n                  d=\"M4 8h2.5l1.6-2h7.8l1.6 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2z\"\n                  fill=\"none\"\n                  stroke=\"currentColor\"\n                  stroke-width=\"1.6\"\n                  stroke-linejoin=\"round\"\n                />\n                <circle cx=\"12\" cy=\"13.5\" r=\"3.4\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.6\" />\n              </svg>\n              Board\n            </button>\n          </div>\n        }\n      </div>\n    </div>\n  </div>\n\n  <!-- Filter Action Buttons -->\n  <div class=\"filter-actions\">\n    <button type=\"button\" (click)=\"clearFilters.emit()\" class=\"secondary-button small\">Clear</button>\n    <button type=\"button\" (click)=\"applyFilter.emit()\" class=\"primary-button small\">Filter</button>\n    <button\n      type=\"button\"\n      (click)=\"toggleSortDirection.emit()\"\n      class=\"sort-button small\"\n      [attr.aria-pressed]=\"sortAscending()\"\n      [title]=\"sortAscending() ? 'Sorted: Lowest Elo first' : 'Sorted: Highest Elo first'\"\n    >\n      @if (sortAscending()) {\n        <span class=\"sort-arrow\" aria-hidden=\"true\">↑</span> Low\n      } @else {\n        <span class=\"sort-arrow\" aria-hidden=\"true\">↓</span> High\n      }\n    </button>\n  </div>\n\n  <!-- Game List -->\n  <div class=\"game-list-wrapper\">\n    @if (gamesMetadata().length > 0) {\n      <div class=\"game-list-header\">\n        <span class=\"game-list-count\">Games: {{ totalFilteredCount() }}</span>\n      </div>\n\n      <!-- Game Navigator -->\n      <div class=\"game-nav-bar\">\n        <button\n          type=\"button\"\n          (click)=\"onPrevGame()\"\n          [disabled]=\"!canGoPrev()\"\n          class=\"nav-arrow-btn\"\n          aria-label=\"Previous Game\"\n          title=\"Previous game\"\n        >\n          <span class=\"nav-chevron prev\" aria-hidden=\"true\"></span>\n        </button>\n        <div class=\"nav-game-info\">\n          <span class=\"nav-game-number\">\n            @if (selectedGamesCount() > 0) {\n              <span class=\"nav-selected-badge\">{{ selectedGamesCount() }} selected</span>\n            }\n          </span>\n          <span class=\"nav-game-players\">{{ currentWhitePlayer() }} vs {{ currentBlackPlayer() }}</span>\n          <span class=\"nav-game-result\">{{ currentGameResult() }}</span>\n        </div>\n        <button\n          type=\"button\"\n          (click)=\"onNextGame()\"\n          [disabled]=\"!canGoNext()\"\n          class=\"nav-arrow-btn\"\n          aria-label=\"Next Game\"\n          title=\"Next game\"\n        >\n          <span class=\"nav-chevron next\" aria-hidden=\"true\"></span>\n        </button>\n      </div>\n\n      @if (isFiltering()) {\n        <div class=\"filtering-indicator\" role=\"status\" aria-live=\"polite\">\n          <span class=\"dots\" aria-hidden=\"true\"><i></i><i></i><i></i></span>\n          Filtering\n        </div>\n      }\n      <div class=\"selection-controls\">\n        <span class=\"selection-count\">{{ selectedGamesCount() }} selected</span>\n      </div>\n    } @else {\n      <div class=\"empty-state\" role=\"status\">\n        <span class=\"empty-glyph\" aria-hidden=\"true\">♞</span>\n        <p class=\"empty-title\">No games loaded</p>\n        <p class=\"empty-sub\">Load a PGN file or URL to populate the game browser.</p>\n      </div>\n    }\n  </div>\n</div>\n","/**\n * Lichess broadcast archive URL helpers.\n *\n * Extracted from the viewer component so the derivation rule is unit-testable\n * on its own — it is the one piece of non-obvious behaviour behind the URL\n * field (generated URLs follow the picker, hand-entered ones do not).\n */\n\n/** Matches a URL produced by {@link lichessBroadcastUrl}. */\nconst BROADCAST_URL_PATTERN =\n\t/^lichess\\/broadcast\\/lichess_db_broadcast_\\d{4}-\\d{2}\\.pgn\\.zst$/;\n\n/**\n * Path of the Lichess monthly broadcast archive for a year/month pair.\n *\n * @param year — Four-digit year.\n * @param month — Month number (1-12); zero-padded to two digits.\n */\nexport function lichessBroadcastUrl(year: number, month: number): string {\n\tconst m = month.toString().padStart(2, '0');\n\treturn `lichess/broadcast/lichess_db_broadcast_${year}-${m}.pgn.zst`;\n}\n\n/**\n * Whether `url` is a URL this library generated from the year/month picker,\n * as opposed to one the user typed or restored from a previous session.\n */\nexport function isLichessBroadcastUrl(url: string): boolean {\n\treturn BROADCAST_URL_PATTERN.test(url);\n}\n\n/**\n * Resolves the PGN source URL shown in the load panel.\n *\n * The URL follows the Lichess year/month picker, but a value the user chose —\n * a hand-entered URL, or one restored from storage that is unrelated to the\n * picker — is preserved across later picker changes.\n *\n * @param next — The year/month the picker currently shows.\n * @param previousUrl — The URL currently in the field, if any.\n * @returns The URL the field should show.\n */\nexport function resolveBroadcastUrl(\n\tnext: { year: number; month: number },\n\tpreviousUrl: string | undefined,\n): string {\n\t// A value we did not generate is the user's; never overwrite it.\n\tif (previousUrl !== undefined && !isLichessBroadcastUrl(previousUrl)) {\n\t\treturn previousUrl;\n\t}\n\t// An unset picker must not produce a nonsense URL such as `_0-00`.\n\tif (!next.year || !next.month) return previousUrl ?? '';\n\treturn lichessBroadcastUrl(next.year, next.month);\n}\n","import { DecimalPipe } from '@angular/common';\nimport {\n\tbooleanAttribute,\n\tComponent,\n\tinput,\n\tmodel,\n\toutput,\n} from '@angular/core';\nimport { loadAsync as loadZipAsync } from 'jszip';\n\n/**\n * Load & Cache panel for the PGN viewer — right sidebar bottom section.\n *\n * Provides:\n * - PGN text input textarea with clipboard buttons\n * - FEN indexing options (start positions, max plies)\n * - Cache management (clear, info)\n * - File-based loading (ZIP, PGN file picker)\n * - Lichess database date picker (year/month)\n * - URL-based loading with support for .zst compressed files\n * - Loading progress bar with status message\n *\n * @example\n * ```html\n * <load-cache-panel\n *   [isLoading]=\"isLoading()\"\n *   [loadingProgress]=\"loadingProgress()\"\n *   [loadingStatus]=\"loadingStatus()\"\n *   [cacheInfo]=\"cacheInfo()\"\n *   (loadPgnString)=\"loadPgnString($event)\"\n *   (clearPgnCache)=\"clearPgnCache()\"\n * />\n * ```\n */\n@Component({\n\tselector: 'load-cache-panel',\n\timports: [DecimalPipe],\n\ttemplateUrl: './load-cache-panel.component.html',\n\tstyleUrl: './load-cache-panel.component.css',\n})\nexport class LoadCachePanelComponent {\n\t// ---- Input State ----\n\t/** Whether a load is in progress. */\n\treadonly isLoading = input(false, { transform: booleanAttribute });\n\t/** Load progress, 0-100. */\n\treadonly loadingProgress = input<number>(0);\n\t/** Human-readable description of the current load step. */\n\treadonly loadingStatus = input<string>('');\n\t/** Cached-entry count and estimated size, or `null` while unknown. */\n\treadonly cacheInfo = input<{ count: number; estimatedBytes: number } | null>(\n\t\tnull,\n\t);\n\n\t/** PGN text typed or pasted into the panel (two-way). */\n\treadonly pgnInput = model<string>('');\n\t/** PGN source URL typed into the panel (two-way). */\n\treadonly urlInput = model<string>('');\n\t/** Whether to build a starting-position FEN index (two-way). */\n\treadonly indexStartPositions = model<boolean>(false);\n\t/** Max half-moves replayed per game when indexing (two-way). */\n\treadonly maxFenPlies = model<number>(30);\n\n\t// ---- Lichess Date Picker ----\n\t/** Selected Lichess archive year (two-way). */\n\treadonly lichessYear = model<number>(new Date().getFullYear());\n\t/** Selected Lichess archive month, 1-12 (two-way). */\n\treadonly lichessMonth = model<number>(1);\n\n\t// ---- Events ----\n\t/** PGN text is ready to be parsed; emits the text. */\n\treadonly loadPgnString = output<string>();\n\t/** The user asked to clear the PGN cache. */\n\treadonly clearPgnCache = output<void>();\n\t/** The user asked to refresh the cache statistics. */\n\treadonly refreshCacheInfo = output<void>();\n\t/** The user asked to load the selected Lichess month. */\n\treadonly loadFromLichess = output<void>();\n\t/** The user asked to load the URL in the input. */\n\treadonly loadFromUrl = output<void>();\n\t/** The user asked to load PGN text from the clipboard. */\n\treadonly loadFromClipboardEvent = output<void>();\n\t/** The user asked to copy the PGN text to the clipboard. */\n\treadonly copyToClipboardEvent = output<void>();\n\t/**\n\t * A local file could not be read or contained no PGN entry.\n\t *\n\t * The panel is presentational and has no access to user-facing\n\t * notification, so the container turns this into a message.\n\t */\n\treadonly fileLoadFailed = output<string>();\n\n\t// ---- Lichess helpers ----\n\t/**\n\t * Selectable archive years, oldest first.\n\t *\n\t * The lower bound matches the earliest Lichess monthly broadcast archive;\n\t * the upper bound is the current year.\n\t */\n\tget years(): number[] {\n\t\tconst currentYear = new Date().getFullYear();\n\t\tconst years: number[] = [];\n\t\tfor (let y = 2020; y <= currentYear; y++) {\n\t\t\tyears.push(y);\n\t\t}\n\t\treturn years;\n\t}\n\n\t/**\n\t * Selectable months for the selected year.\n\t *\n\t * A past year offers all twelve; the current year offers only the months\n\t * that have already ended, because a broadcast archive is published after\n\t * the month closes.\n\t */\n\tget months(): number[] {\n\t\tconst selectedYear = this.lichessYear();\n\t\tconst now = new Date();\n\t\tconst currentYear = now.getFullYear();\n\t\tconst currentMonth = now.getMonth(); // 0-indexed\n\n\t\tif (selectedYear < currentYear) {\n\t\t\treturn [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];\n\t\t} else if (selectedYear === currentYear) {\n\t\t\tconst months: number[] = [];\n\t\t\tfor (let m = 1; m <= currentMonth; m++) {\n\t\t\t\tmonths.push(m);\n\t\t\t}\n\t\t\treturn months;\n\t\t}\n\t\treturn [];\n\t}\n\n\t/** Applies the selected year and clamps the month to an available one. */\n\tonLichessYearChange(event: Event): void {\n\t\tconst value = parseInt((event.target as HTMLSelectElement).value, 10);\n\t\tthis.lichessYear.set(value);\n\t\tconst availableMonths = this.months;\n\t\tif (!availableMonths.includes(this.lichessMonth())) {\n\t\t\tthis.lichessMonth.set(availableMonths[availableMonths.length - 1] || 1);\n\t\t}\n\t}\n\n\t/** Applies the selected month. */\n\tonLichessMonthChange(event: Event): void {\n\t\tconst value = parseInt((event.target as HTMLSelectElement).value, 10);\n\t\tthis.lichessMonth.set(value);\n\t}\n\n\t/** Applies the edited PGN text. */\n\tonPgnInputChange(event: Event): void {\n\t\tconst value = (event.target as HTMLTextAreaElement).value;\n\t\tthis.pgnInput.set(value);\n\t}\n\n\t/** Applies the edited source URL. */\n\tonUrlInputChange(event: Event): void {\n\t\tconst value = (event.target as HTMLInputElement).value;\n\t\tthis.urlInput.set(value);\n\t}\n\n\t/** Applies the starting-position indexing checkbox. */\n\tonIndexStartPositionsChange(event: Event): void {\n\t\tthis.indexStartPositions.set((event.target as HTMLInputElement).checked);\n\t}\n\n\t/** Applies the indexing replay window, ignoring values below 1. */\n\tonMaxFenPliesChange(event: Event): void {\n\t\tconst value = parseInt((event.target as HTMLInputElement).value, 10);\n\t\tif (!Number.isNaN(value) && value >= 1) {\n\t\t\tthis.maxFenPlies.set(value);\n\t\t}\n\t}\n\n\t/** Extracts the first `.pgn` entry from a chosen zip archive and emits it. */\n\tasync onPgnZipSelected(event: Event): Promise<void> {\n\t\tconst input = event.target as HTMLInputElement;\n\t\tconst file = input.files?.[0];\n\t\tif (!file) return;\n\t\ttry {\n\t\t\tconst zip = await loadZipAsync(file);\n\t\t\tconst pgnFile = Object.values(zip.files).find((f) =>\n\t\t\t\tf.name.toLowerCase().endsWith('.pgn'),\n\t\t\t);\n\t\t\tif (!pgnFile) {\n\t\t\t\tthis.fileLoadFailed.emit(`No PGN file found in \"${file.name}\".`);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.loadPgnString.emit(await pgnFile.async('string'));\n\t\t} catch {\n\t\t\tthis.fileLoadFailed.emit(`Could not read \"${file.name}\".`);\n\t\t}\n\t}\n\n\t/** Emits the text of a chosen `.pgn` file. */\n\tonPgnFileSelected(event: Event): void {\n\t\tconst input = event.target as HTMLInputElement;\n\t\tif (!input.files || input.files.length === 0) return;\n\t\tthis.handleFileRead(input.files[0]);\n\t}\n\n\t/** Reads a file as UTF-8 text and emits it, or reports the failure. */\n\tprivate handleFileRead(file: File): void {\n\t\tfile\n\t\t\t.text()\n\t\t\t.then((content) => {\n\t\t\t\tif (content) this.loadPgnString.emit(content);\n\t\t\t\telse this.fileLoadFailed.emit(`\"${file.name}\" is empty.`);\n\t\t\t})\n\t\t\t.catch(() => this.fileLoadFailed.emit(`Could not read \"${file.name}\".`));\n\t}\n\n\t/** Whether the load & cache panel is expanded (two-way). */\n\treadonly expanded = model<boolean>(true);\n\n\t/** Expands or collapses the load & cache panel. */\n\ttoggleExpanded(): void {\n\t\tthis.expanded.update((v) => !v);\n\t}\n}\n","<div class=\"load-cache-section\">\n  <h3\n    class=\"section-header\"\n    tabindex=\"0\"\n    role=\"button\"\n    [attr.aria-expanded]=\"expanded()\"\n    [attr.aria-controls]=\"'load-cache-section-content'\"\n    (click)=\"toggleExpanded()\"\n    (keydown.enter)=\"toggleExpanded(); $event.preventDefault()\"\n    (keydown.space)=\"toggleExpanded(); $event.preventDefault()\"\n  >\n    <span class=\"chevron\" [class.expanded]=\"expanded()\" aria-hidden=\"true\"></span>\n    Load &amp; Cache\n  </h3>\n\n  <div class=\"section-content\" [class.expanded]=\"expanded()\" id=\"load-cache-section-content\">\n    <!-- PGN Input -->\n    <div class=\"pgn-input-section\">\n      <textarea\n        [value]=\"pgnInput()\"\n        (input)=\"onPgnInputChange($event)\"\n        rows=\"3\"\n        placeholder=\"Paste PGN...\"\n        aria-label=\"PGN Input\"\n      ></textarea>\n      <div class=\"clipboard-buttons\">\n        <button type=\"button\" (click)=\"loadFromClipboardEvent.emit()\" class=\"small-btn\">Load from Clipboard</button>\n        <button type=\"button\" (click)=\"copyToClipboardEvent.emit()\" class=\"small-btn\">Copy to Clipboard</button>\n      </div>\n    </div>\n\n    <!-- FEN Indexing Options -->\n    <div class=\"index-options\">\n      <label class=\"checkbox-label\">\n        <input\n          type=\"checkbox\"\n          [checked]=\"indexStartPositions()\"\n          (change)=\"onIndexStartPositionsChange($event)\"\n        />\n        Index starting positions\n      </label>\n      <div class=\"option-input\">\n        <label>\n          Max plies:\n          <input\n            type=\"number\"\n            [value]=\"maxFenPlies()\"\n            (input)=\"onMaxFenPliesChange($event)\"\n            min=\"1\"\n            max=\"500\"\n            class=\"small-input\"\n            aria-label=\"Max plies to index\"\n          />\n        </label>\n      </div>\n    </div>\n\n    <!-- Cache Management -->\n    <div class=\"cache-section\">\n      <div class=\"cache-actions\">\n        <button type=\"button\" (click)=\"clearPgnCache.emit()\" class=\"small-btn\" title=\"Clear all cached PGN data from IndexedDB\">\n          Clear Cache\n        </button>\n        <button type=\"button\" (click)=\"refreshCacheInfo.emit()\" class=\"small-btn\" title=\"Show cache statistics\">\n          Cache Info\n        </button>\n      </div>\n      @if (cacheInfo(); as info) {\n        <div class=\"cache-info\">\n          <small>\n            Entries: {{ info.count }}\n            @if (info.estimatedBytes > 0) {\n              | Size: {{ (info.estimatedBytes / 1024) | number:'1.0-0' }} KB\n            }\n          </small>\n        </div>\n      }\n    </div>\n\n    <!-- Load Section -->\n    <div class=\"load-section\">\n      <div class=\"file-inputs\">\n        <label class=\"file-input-label\">\n          Zip\n          <input\n            type=\"file\"\n            accept=\".zip\"\n            (change)=\"onPgnZipSelected($event)\"\n            [disabled]=\"isLoading()\"\n          />\n        </label>\n        <label class=\"file-input-label\">\n          PGN\n          <input\n            type=\"file\"\n            accept=\".pgn\"\n            (change)=\"onPgnFileSelected($event)\"\n            [disabled]=\"isLoading()\"\n          />\n        </label>\n      </div>\n\n      <div class=\"lichess-date-picker\">\n        <label>Lichess Database:</label>\n        <div class=\"date-selectors\">\n          <select\n            (change)=\"onLichessYearChange($event)\"\n            aria-label=\"Select Year\"\n          >\n            @for (year of years; track year) {\n              <option [value]=\"year\" [selected]=\"year === lichessYear()\">{{ year }}</option>\n            }\n          </select>\n          <select\n            (change)=\"onLichessMonthChange($event)\"\n            aria-label=\"Select Month\"\n          >\n            @for (month of months; track month) {\n              <option [value]=\"month\" [selected]=\"month === lichessMonth()\">\n                {{ month.toString().padStart(2, '0') }}\n              </option>\n            }\n          </select>\n          <button type=\"button\" \n            (click)=\"loadFromLichess.emit()\"\n            [disabled]=\"isLoading()\"\n            class=\"action-btn\">\n            Load\n          </button>\n        </div>\n        <div class=\"license-info\">\n          <small>\n            Licensed under\n            <a href=\"https://tldrlegal.com/license/creative-commons-cc0-1.0-universal\" target=\"_blank\" rel=\"noopener noreferrer\">CC0</a>\n            by\n            <a href=\"https://database.lichess.org\" target=\"_blank\" rel=\"noopener noreferrer\">Lichess</a>\n          </small>\n        </div>\n      </div>\n\n      <div class=\"url-input-section\">\n        <input\n          type=\"text\"\n          [value]=\"urlInput()\"\n          (input)=\"onUrlInputChange($event)\"\n          placeholder=\"Enter PGN URL (supports .zst)\"\n          class=\"url-input\"\n          aria-label=\"PGN URL\"\n        />\n        <button type=\"button\" \n          (click)=\"loadFromUrl.emit()\"\n          [disabled]=\"isLoading() || !urlInput()\"\n          class=\"action-btn\"\n        >\n          Load URL\n        </button>\n      </div>\n\n      @if (isLoading()) {\n        <div class=\"loading-indicator\" role=\"status\" aria-live=\"polite\">\n          <div class=\"progress-bar-container\">\n            <div class=\"progress-bar\" [style.width.%]=\"loadingProgress()\"></div>\n            <span class=\"progress-text\">{{ loadingProgress() }}%</span>\n          </div>\n          <div class=\"loading-status\">{{ loadingStatus() || 'Loading...' }}</div>\n        </div>\n      }\n    </div>\n  </div>\n</div>\n","import {\n\tbooleanAttribute,\n\tComponent,\n\ttype ElementRef,\n\teffect,\n\tinput,\n\tmodel,\n\toutput,\n\tviewChild,\n} from '@angular/core';\n\n/**\n * Displays the move list for the current game as clickable buttons.\n *\n * Each move is rendered in chess notation with move numbers (1., 2., etc.).\n * Active and last-move buttons are highlighted. Move clocks are shown\n * alongside moves when available. The list auto-scrolls to keep the\n * active move visible when the current move index changes.\n *\n * @example\n * ```html\n * <move-list\n *   [moves]=\"moves()\"\n *   [moveClocks]=\"moveClocks()\"\n *   [currentMoveIndex]=\"currentMoveIndex()\"\n *   [highlightLastMove]=\"highlightLastMove()\"\n *   (jumpToMove)=\"jumpToMove($event)\"\n * />\n * ```\n */\n@Component({\n\tselector: 'move-list',\n\ttemplateUrl: './move-list.component.html',\n\tstyleUrl: './move-list.component.css',\n})\nexport class MoveListComponent {\n\t/** SAN move strings for the current game. */\n\treadonly moves = input.required<string[]>();\n\n\t/** Per-move clock strings (empty string if no clock data). */\n\treadonly moveClocks = input<string[]>([]);\n\n\t/** Current zero-based move index (-1 = start position). */\n\treadonly currentMoveIndex = input<number>(-1);\n\n\t/** Whether to highlight the last move in the game. */\n\treadonly highlightLastMove = input(true, { transform: booleanAttribute });\n\n\t/** Whether the moves section is expanded/collapsed. */\n\treadonly expanded = model<boolean>(true);\n\n\t/** Emitted when the user clicks a move to jump to it. */\n\treadonly jumpToMove = output<number>();\n\n\t/** View query for the move list container (for auto-scroll). */\n\treadonly moveListRef = viewChild<ElementRef<HTMLElement>>('moveList');\n\n\t/**\n\t * Keeps the active move visible: scrolls it into the nearest edge of the\n\t * list whenever the current move index changes.\n\t */\n\tconstructor() {\n\t\t// Auto-scroll to active move when index changes\n\t\teffect(() => {\n\t\t\tthis.currentMoveIndex(); // Track dependency\n\t\t\tconst moveList = this.moveListRef();\n\t\t\tif (!moveList) return;\n\t\t\tconst container = moveList.nativeElement;\n\t\t\tconst activeElement = container.querySelector(\n\t\t\t\t'.move-btn.active',\n\t\t\t) as HTMLElement;\n\t\t\tif (activeElement) {\n\t\t\t\tactiveElement.scrollIntoView({\n\t\t\t\t\tbehavior: 'smooth',\n\t\t\t\t\tblock: 'nearest',\n\t\t\t\t\tinline: 'nearest',\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}\n\n\t/** Expands or collapses the move-list panel (two-way bound). */\n\ttoggleExpanded(): void {\n\t\tthis.expanded.update((v) => !v);\n\t}\n\n\t/** Returns the move number for a given half-move index (0-indexed). */\n\tmoveNumber(index: number): number {\n\t\treturn Math.floor(index / 2) + 1;\n\t}\n\n\t/** Whether a given index starts a new move pair (white's move). */\n\tisWhiteMove(index: number): boolean {\n\t\treturn index % 2 === 0;\n\t}\n}\n","<h3\n  class=\"section-header\"\n  tabindex=\"0\"\n  role=\"button\"\n  [attr.aria-expanded]=\"expanded()\"\n  [attr.aria-controls]=\"'moves-section-content'\"\n  (click)=\"toggleExpanded()\"\n  (keydown.enter)=\"toggleExpanded(); $event.preventDefault()\"\n  (keydown.space)=\"toggleExpanded(); $event.preventDefault()\"\n>\n  <span class=\"chevron\" [class.expanded]=\"expanded()\" aria-hidden=\"true\"></span>\n  Moves\n</h3>\n\n<div class=\"section-content\" [class.expanded]=\"expanded()\" id=\"moves-section-content\">\n  <div class=\"move-list\" #moveList>\n    @for (move of moves(); track $index) {\n      @if (isWhiteMove($index)) {\n        <span class=\"move-number\">{{ moveNumber($index) }}.</span>\n      }\n      <button type=\"button\" \n        class=\"move-btn\"\n        [class.active]=\"$index === currentMoveIndex()\"\n        [class.last-move]=\"highlightLastMove() && $index === moves().length - 1\"\n        (click)=\"jumpToMove.emit($index)\"\n        [attr.aria-label]=\"\n          'Jump to move ' +\n          moveNumber($index) +\n          (isWhiteMove($index) ? ' White ' : ' Black ') +\n          move\n        \"\n      >\n        {{ move }}\n      </button>\n      @if ($index < moveClocks().length && moveClocks()[$index]) {\n        <span class=\"move-clock\">{{ moveClocks()[$index] }}</span>\n      }\n    }\n  </div>\n</div>\n","import { Injectable } from '@angular/core';\nimport { isDesktopRuntime } from './desktop-runtime';\n\n/**\n * Durable JSON key/value store for the PGN viewer.\n *\n * - **Browser** — `localStorage`, synchronous and unchanged.\n * - **Desktop** — the local app server's `/api/state/<key>` endpoints, because\n *   the Deno Desktop webview is served from a random localhost port on every\n *   launch and therefore gets a fresh `localStorage`/`IndexedDB` each time.\n *\n * Reads are synchronous through an in-memory snapshot. In the browser the\n * snapshot is filled on demand from `localStorage`; on desktop it is filled by\n * {@link hydrate}, which the viewer awaits before loading games.\n */\n@Injectable({ providedIn: 'root' })\nexport class PgnViewerStoreService {\n\t/** Whether the durable backend is the desktop app's on-disk API. */\n\tprivate readonly desktop = isDesktopRuntime();\n\t/** Synchronous snapshot of every key read or written this session. */\n\tprivate readonly memory = new Map<string, unknown>();\n\t/** Serializes writes per key so an earlier value can never land last. */\n\tprivate readonly writeQueue = new Map<string, Promise<void>>();\n\t/** In-flight (or completed) {@link hydrate} call; `null` until first use. */\n\tprivate hydration: Promise<void> | null = null;\n\n\t/** `true` when this store is backed by the desktop app's on-disk API. */\n\tget isDesktop(): boolean {\n\t\treturn this.desktop;\n\t}\n\n\t/**\n\t * Reads a previously stored value.\n\t *\n\t * @returns The parsed value, or `null` when the key is unknown.\n\t */\n\tget<T>(key: string): T | null {\n\t\tif (this.memory.has(key)) return this.memory.get(key) as T;\n\t\tif (!this.desktop) {\n\t\t\tconst value = this.readLocal(key);\n\t\t\tif (value !== null) {\n\t\t\t\tthis.memory.set(key, value);\n\t\t\t\treturn value as T;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\t/** Stores a value, writing through to the active backend. */\n\tset(key: string, value: unknown): void {\n\t\tthis.memory.set(key, value);\n\t\tif (this.desktop) {\n\t\t\tthis.queueServerWrite(key, value);\n\t\t} else {\n\t\t\tthis.writeLocal(key, value);\n\t\t}\n\t}\n\n\t/** Removes a value from both the snapshot and the active backend. */\n\tremove(key: string): void {\n\t\tthis.memory.delete(key);\n\t\tif (this.desktop) {\n\t\t\tthis.queueServerRequest(key, 'DELETE');\n\t\t\treturn;\n\t\t}\n\t\ttry {\n\t\t\tlocalStorage.removeItem(key);\n\t\t} catch {\n\t\t\t// Storage unavailable — nothing to remove.\n\t\t}\n\t}\n\n\t/**\n\t * Fills the in-memory snapshot from the active backend.\n\t *\n\t * A no-op in the browser (localStorage is synchronous) and idempotent on\n\t * desktop. Resolve {@link whenReady} before reading values that must be\n\t * available at startup.\n\t */\n\thydrate(keys: readonly string[]): Promise<void> {\n\t\tif (!this.desktop) {\n\t\t\tfor (const key of keys) this.get(key);\n\t\t\treturn Promise.resolve();\n\t\t}\n\t\tif (!this.hydration) {\n\t\t\tthis.hydration = Promise.all(\n\t\t\t\tkeys.map((key) => this.fetchServer(key)),\n\t\t\t).then(() => undefined);\n\t\t}\n\t\treturn this.hydration;\n\t}\n\n\t/** Resolves once {@link hydrate} has completed (immediately if not called). */\n\twhenReady(): Promise<void> {\n\t\treturn this.hydration ?? Promise.resolve();\n\t}\n\n\t/** Loads one key from the desktop server into the snapshot. */\n\tprivate async fetchServer(key: string): Promise<void> {\n\t\ttry {\n\t\t\tconst response = await fetch(this.serverUrl(key), {\n\t\t\t\tcache: 'no-store',\n\t\t\t});\n\t\t\tif (!response.ok) return;\n\t\t\tthis.memory.set(key, await response.json());\n\t\t} catch {\n\t\t\t// Server unavailable — start from defaults instead of failing startup.\n\t\t}\n\t}\n\n\t/** Enqueues a JSON write so writes for one key stay ordered. */\n\tprivate queueServerWrite(key: string, value: unknown): void {\n\t\tthis.queueServerRequest(key, 'PUT', JSON.stringify(value));\n\t}\n\n\t/**\n\t * Enqueues a request for a key after any request already in flight for it.\n\t */\n\tprivate queueServerRequest(\n\t\tkey: string,\n\t\tmethod: 'PUT' | 'DELETE',\n\t\tbody?: string,\n\t): void {\n\t\tconst previous = this.writeQueue.get(key) ?? Promise.resolve();\n\t\tconst next = previous.then(async () => {\n\t\t\ttry {\n\t\t\t\tawait fetch(this.serverUrl(key), {\n\t\t\t\t\tmethod,\n\t\t\t\t\theaders: body ? { 'content-type': 'application/json' } : undefined,\n\t\t\t\t\tbody,\n\t\t\t\t\tkeepalive: true,\n\t\t\t\t});\n\t\t\t} catch {\n\t\t\t\t// Best effort: a lost write only costs one restart's settings.\n\t\t\t}\n\t\t});\n\t\tthis.writeQueue.set(key, next);\n\t}\n\n\t/** Builds the desktop endpoint URL for one state key. */\n\tprivate serverUrl(key: string): string {\n\t\treturn `/api/state/${encodeURIComponent(key)}`;\n\t}\n\n\t/** Reads and parses one key from `localStorage`, tolerating corruption. */\n\tprivate readLocal(key: string): unknown | null {\n\t\ttry {\n\t\t\tconst raw = localStorage.getItem(key);\n\t\t\treturn raw === null ? null : JSON.parse(raw);\n\t\t} catch {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\t/** Serializes and writes one key to `localStorage`; failures are ignored. */\n\tprivate writeLocal(key: string, value: unknown): void {\n\t\ttry {\n\t\t\tlocalStorage.setItem(key, JSON.stringify(value));\n\t\t} catch {\n\t\t\t// Storage unavailable or full — persistence is best-effort.\n\t\t}\n\t}\n}\n","import { Injectable, inject } from '@angular/core';\nimport { PgnViewerStoreService } from './pgn-viewer-store.service';\n\n/**\n * Serialized form of the worker's cached state for IndexedDB persistence.\n *\n * The FEN cache is stored as `[gameIndex, normalizedFen[]][]` (serialized\n * from `Map<number, Set<string>>`) so it survives structured clone.\n */\nexport interface CachedPgnData {\n\t/** Raw PGN text for each game, split by `[Event ...]` header. */\n\tgames: string[];\n\t/** Parsed metadata for each game (headers only, no move data). */\n\tgameMetadata: import('./pgn-processor.worker').GameMetadata[];\n\t/**\n\t * Serialized FEN position cache.\n\t * Each entry: `[gameIndex, normalizedFenString[]]`.\n\t * The FEN strings are normalized (4-field: piece placement, active color,\n\t * castling, en passant) and deduplicated per game.\n\t */\n\tfenCache: [number, string[]][];\n\t/** When this cache entry was created (epoch ms). */\n\tcreatedAt: number;\n\t/**\n\t * Whether the FEN index was actually built for this entry. `false`/absent\n\t * means {@link fenCache} holds empty sets (indexing was disabled), so\n\t * position filters cannot be served from this entry.\n\t */\n\tindexed?: boolean;\n\t/** Max half-moves replayed per game when the FEN index was built. */\n\tmaxFenPlies?: number;\n}\n\n/**\n * Maps a PGN source (URL) to the content hash under which its parsed games and\n * FEN index are stored in IndexedDB.\n *\n * The content hash alone cannot be computed without first downloading and\n * decompressing the archive, so this bookmark lets the application detect a\n * usable cache entry at startup and skip the download entirely.\n */\nexport interface PgnSourceCacheEntry {\n\t/** SHA-256 hash of the decompressed PGN content. */\n\tpgnHash: string;\n\t/** Whether the cached entry contains a built FEN index. */\n\tindexed: boolean;\n\t/** Max half-moves replayed per game for the cached FEN index. */\n\tmaxFenPlies: number;\n\t/** When this mapping was recorded (epoch ms). */\n\tcreatedAt: number;\n}\n\n/**\n * Cache entry stored in IndexedDB, keyed by PGN content hash.\n */\ninterface CacheEntry {\n\t/** SHA-256 hash of the PGN content; also the object-store key. */\n\tpgnHash: string;\n\t/** The parsed games, metadata and FEN index. */\n\tdata: CachedPgnData;\n}\n\n/** IndexedDB database holding parsed PGN collections. */\nconst DB_NAME = 'NgxChessgroundPgnCache';\n/** Schema version; bump together with an `onupgradeneeded` migration. */\nconst DB_VERSION = 1;\n/** Object store (and `createdAt` index) holding {@link CacheEntry} records. */\nconst STORE_NAME = 'pgn_cache';\n/** Maximum age for cache entries: 7 days. */\nconst DEFAULT_TTL_MS = 7 * 24 * 60 * 60 * 1000;\n/** Maximum number of cache entries. Oldest are evicted first. */\nconst MAX_ENTRIES = 10;\n/** `localStorage` key holding the URL → content-hash bookmark map. */\nconst SOURCE_MAP_STORAGE_KEY = 'ngx-chessground-pgn-sources';\n/** Maximum number of remembered sources (oldest pruned first). */\nconst MAX_SOURCE_ENTRIES = 20;\n\n/**\n * Service for caching parsed PGN data (games, metadata, FEN positions) in\n * IndexedDB. Allows re-opening a previously loaded PGN without re-parsing\n * the entire file.\n *\n * Uses raw IndexedDB (no external dependency). Provided at root level so a\n * single database connection is shared across the application.\n */\n@Injectable({ providedIn: 'root' })\nexport class PgnCacheService {\n\t/** Durable store used for the URL → content-hash bookmark map. */\n\tprivate readonly store = inject(PgnViewerStoreService);\n\t/** Cached open handle, so the database is opened at most once. */\n\tprivate dbPromise: Promise<IDBDatabase> | null = null;\n\n\t/**\n\t * Opens (or creates) the IndexedDB database and returns a handle.\n\t */\n\tprivate async getDb(): Promise<IDBDatabase> {\n\t\tif (this.dbPromise) return this.dbPromise;\n\n\t\tthis.dbPromise = new Promise<IDBDatabase>((resolve, reject) => {\n\t\t\tconst request = indexedDB.open(DB_NAME, DB_VERSION);\n\n\t\t\trequest.onupgradeneeded = () => {\n\t\t\t\tconst db = request.result;\n\t\t\t\tif (!db.objectStoreNames.contains(STORE_NAME)) {\n\t\t\t\t\tconst store = db.createObjectStore(STORE_NAME, {\n\t\t\t\t\t\tkeyPath: 'pgnHash',\n\t\t\t\t\t});\n\t\t\t\t\tstore.createIndex('createdAt', 'data.createdAt', {\n\t\t\t\t\t\tunique: false,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t};\n\n\t\t\trequest.onsuccess = () => resolve(request.result);\n\t\t\trequest.onerror = () =>\n\t\t\t\treject(new Error(`IndexedDB open error: ${request.error}`));\n\t\t});\n\n\t\treturn this.dbPromise;\n\t}\n\n\t/**\n\t * Computes a SHA-256 hex digest of the given string using the\n\t * SubtleCrypto API.\n\t */\n\tasync hashPgn(pgn: string): Promise<string> {\n\t\tconst encoder = new TextEncoder();\n\t\tconst data = encoder.encode(pgn);\n\t\tconst hashBuffer = await crypto.subtle.digest('SHA-256', data);\n\t\tconst hashArray = Array.from(new Uint8Array(hashBuffer));\n\t\treturn hashArray.map((b) => b.toString(16).padStart(2, '0')).join('');\n\t}\n\n\t/**\n\t * Retrieves cached PGN data by hash, or `null` if not found or expired.\n\t *\n\t * @param pgnHash — SHA-256 hash of the original PGN string.\n\t * @param ttlMs — Time-to-live in milliseconds (default 7 days).\n\t */\n\tasync getCached(\n\t\tpgnHash: string,\n\t\tttlMs = DEFAULT_TTL_MS,\n\t): Promise<CachedPgnData | null> {\n\t\ttry {\n\t\t\tconst db = await this.getDb();\n\t\t\tconst tx = db.transaction(STORE_NAME, 'readonly');\n\t\t\tconst store = tx.objectStore(STORE_NAME);\n\t\t\tconst request = store.get(pgnHash);\n\n\t\t\tconst result = await new Promise<CacheEntry | undefined>(\n\t\t\t\t(resolve, reject) => {\n\t\t\t\t\trequest.onsuccess = () => resolve(request.result ?? undefined);\n\t\t\t\t\trequest.onerror = () => reject(request.error);\n\t\t\t\t},\n\t\t\t);\n\n\t\t\tif (!result) return null;\n\n\t\t\t// Check TTL\n\t\t\tconst age = Date.now() - result.data.createdAt;\n\t\t\tif (age > ttlMs) {\n\t\t\t\t// Expired — remove it\n\t\t\t\tthis.deleteEntry(pgnHash);\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn result.data;\n\t\t} catch {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\t/**\n\t * Stores parsed PGN data in the cache, keyed by the PGN content hash.\n\t *\n\t * Automatically evicts the oldest entries when the cache exceeds\n\t * {@link MAX_ENTRIES}.\n\t */\n\tasync setCache(pgnHash: string, data: CachedPgnData): Promise<void> {\n\t\ttry {\n\t\t\tconst db = await this.getDb();\n\n\t\t\t// Evict old entries if over limit\n\t\t\tawait this.evictIfNeeded(db);\n\n\t\t\tconst tx = db.transaction(STORE_NAME, 'readwrite');\n\t\t\tconst store = tx.objectStore(STORE_NAME);\n\t\t\tstore.put({ pgnHash, data } as CacheEntry);\n\n\t\t\tawait new Promise<void>((resolve, reject) => {\n\t\t\t\ttx.oncomplete = () => resolve();\n\t\t\t\ttx.onerror = () => reject(tx.error);\n\t\t\t});\n\t\t} catch {\n\t\t\t// Silently ignore storage errors (e.g. quota exceeded)\n\t\t}\n\t}\n\n\t/**\n\t * Deletes a single cache entry by hash.\n\t */\n\tprivate async deleteEntry(pgnHash: string): Promise<void> {\n\t\ttry {\n\t\t\tconst db = await this.getDb();\n\t\t\tconst tx = db.transaction(STORE_NAME, 'readwrite');\n\t\t\tconst store = tx.objectStore(STORE_NAME);\n\t\t\tstore.delete(pgnHash);\n\t\t} catch {\n\t\t\t// Silently ignore\n\t\t}\n\t}\n\n\t/**\n\t * Evicts the oldest entries when the store exceeds {@link MAX_ENTRIES}.\n\t */\n\tprivate async evictIfNeeded(db: IDBDatabase): Promise<void> {\n\t\tconst tx = db.transaction(STORE_NAME, 'readonly');\n\t\tconst store = tx.objectStore(STORE_NAME);\n\t\tconst countRequest = store.count();\n\n\t\tconst count = await new Promise<number>((resolve, reject) => {\n\t\t\tcountRequest.onsuccess = () => resolve(countRequest.result);\n\t\t\tcountRequest.onerror = () => reject(countRequest.error);\n\t\t});\n\n\t\tif (count < MAX_ENTRIES) return;\n\n\t\t// Need to evict oldest entries\n\t\tconst index = store.index('createdAt');\n\t\tconst range = IDBKeyRange.lowerBound(0);\n\t\tconst cursorRequest = index.openCursor(range, 'next');\n\n\t\tconst toDelete: string[] = [];\n\t\tawait new Promise<void>((resolve, reject) => {\n\t\t\tcursorRequest.onsuccess = () => {\n\t\t\t\tconst cursor = cursorRequest.result;\n\t\t\t\tif (cursor) {\n\t\t\t\t\ttoDelete.push((cursor.value as CacheEntry).pgnHash);\n\t\t\t\t\tif (toDelete.length < count - MAX_ENTRIES + 1) {\n\t\t\t\t\t\tcursor.continue();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresolve();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tresolve();\n\t\t\t\t}\n\t\t\t};\n\t\t\tcursorRequest.onerror = () => reject(cursorRequest.error);\n\t\t});\n\n\t\tif (toDelete.length === 0) return;\n\n\t\t// Delete in a separate write transaction\n\t\tconst deleteTx = db.transaction(STORE_NAME, 'readwrite');\n\t\tconst deleteStore = deleteTx.objectStore(STORE_NAME);\n\t\tfor (const hash of toDelete) {\n\t\t\tdeleteStore.delete(hash);\n\t\t}\n\t}\n\n\t/**\n\t * Removes all cached PGN data from IndexedDB.\n\t */\n\tasync clearCache(): Promise<void> {\n\t\ttry {\n\t\t\tconst db = await this.getDb();\n\t\t\tconst tx = db.transaction(STORE_NAME, 'readwrite');\n\t\t\tconst store = tx.objectStore(STORE_NAME);\n\t\t\tstore.clear();\n\t\t\tawait new Promise<void>((resolve, reject) => {\n\t\t\t\ttx.oncomplete = () => resolve();\n\t\t\t\ttx.onerror = () => reject(tx.error);\n\t\t\t});\n\t\t} catch {\n\t\t\t// Silently ignore\n\t\t}\n\t}\n\n\t/**\n\t * Returns the number of cached entries and their total estimated size.\n\t *\n\t * On desktop the parsed archives live on disk behind the local server, so\n\t * the figures come from `/api/cache-info` instead of IndexedDB.\n\t */\n\tasync getCacheInfo(): Promise<{ count: number; estimatedBytes: number }> {\n\t\tif (this.store.isDesktop) {\n\t\t\ttry {\n\t\t\t\tconst response = await fetch('/api/cache-info', { cache: 'no-store' });\n\t\t\t\tif (response.ok) {\n\t\t\t\t\tconst info: unknown = await response.json();\n\t\t\t\t\tconst record = info as { count?: unknown; estimatedBytes?: unknown };\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcount: typeof record.count === 'number' ? record.count : 0,\n\t\t\t\t\t\testimatedBytes:\n\t\t\t\t\t\t\ttypeof record.estimatedBytes === 'number'\n\t\t\t\t\t\t\t\t? record.estimatedBytes\n\t\t\t\t\t\t\t\t: 0,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t} catch {\n\t\t\t\t// Server unavailable — report an empty cache.\n\t\t\t}\n\t\t\treturn { count: 0, estimatedBytes: 0 };\n\t\t}\n\n\t\ttry {\n\t\t\tconst db = await this.getDb();\n\t\t\tconst tx = db.transaction(STORE_NAME, 'readonly');\n\t\t\tconst store = tx.objectStore(STORE_NAME);\n\t\t\tconst countRequest = store.count();\n\n\t\t\tconst count = await new Promise<number>((resolve, reject) => {\n\t\t\t\tcountRequest.onsuccess = () => resolve(countRequest.result);\n\t\t\t\tcountRequest.onerror = () => reject(countRequest.error);\n\t\t\t});\n\n\t\t\t// Estimate size by serializing all entries\n\t\t\tlet estimatedBytes = 0;\n\t\t\tconst cursorRequest = store.openCursor();\n\t\t\tawait new Promise<void>((resolve, reject) => {\n\t\t\t\tcursorRequest.onsuccess = () => {\n\t\t\t\t\tconst cursor = cursorRequest.result;\n\t\t\t\t\tif (cursor) {\n\t\t\t\t\t\tconst json = JSON.stringify(cursor.value);\n\t\t\t\t\t\testimatedBytes += new TextEncoder().encode(json).length;\n\t\t\t\t\t\tcursor.continue();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresolve();\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tcursorRequest.onerror = () => reject(cursorRequest.error);\n\t\t\t});\n\n\t\t\treturn { count, estimatedBytes };\n\t\t} catch {\n\t\t\treturn { count: 0, estimatedBytes: 0 };\n\t\t}\n\t}\n\n\t/**\n\t * Looks up the cached content hash for a PGN source without touching the\n\t * content. Used to detect a cache hit before downloading the archive.\n\t *\n\t * @param source — Source identifier (typically the PGN URL).\n\t * @returns The bookmark entry, or `null` when the source is not remembered.\n\t */\n\tgetSourceEntry(source: string): PgnSourceCacheEntry | null {\n\t\tconst record = this.readSourceMap()[source];\n\t\tif (record === null || typeof record !== 'object') return null;\n\t\tconst entry = record as Partial<PgnSourceCacheEntry>;\n\t\tif (typeof entry.pgnHash !== 'string' || entry.pgnHash.length === 0) {\n\t\t\treturn null;\n\t\t}\n\t\treturn {\n\t\t\tpgnHash: entry.pgnHash,\n\t\t\tindexed: entry.indexed === true,\n\t\t\tmaxFenPlies:\n\t\t\t\ttypeof entry.maxFenPlies === 'number' &&\n\t\t\t\tNumber.isFinite(entry.maxFenPlies)\n\t\t\t\t\t? entry.maxFenPlies\n\t\t\t\t\t: 0,\n\t\t\tcreatedAt:\n\t\t\t\ttypeof entry.createdAt === 'number' && Number.isFinite(entry.createdAt)\n\t\t\t\t\t? entry.createdAt\n\t\t\t\t\t: 0,\n\t\t};\n\t}\n\n\t/**\n\t * Remembers which content hash backs a PGN source, so a later session can\n\t * restore it from the cache without downloading and decompressing it again.\n\t */\n\tsetSourceEntry(source: string, entry: PgnSourceCacheEntry): void {\n\t\tconst map = this.readSourceMap();\n\t\tmap[source] = entry;\n\t\tthis.store.set(SOURCE_MAP_STORAGE_KEY, this.pruneSourceMap(map));\n\t}\n\n\t/** Removes all source bookmarks (used when the PGN cache is cleared). */\n\tclearSourceEntries(): void {\n\t\tthis.store.remove(SOURCE_MAP_STORAGE_KEY);\n\t}\n\n\t/**\n\t * Fills the desktop snapshot with the source bookmarks from disk.\n\t *\n\t * A no-op in the browser. Hosts should await this before reading\n\t * {@link getSourceEntry} at startup on desktop.\n\t */\n\thydrateSourceEntries(): Promise<void> {\n\t\treturn this.store.hydrate([SOURCE_MAP_STORAGE_KEY]);\n\t}\n\n\t/** Reads the URL → hash map, tolerating absent or corrupt payloads. */\n\tprivate readSourceMap(): Record<string, unknown> {\n\t\tconst stored = this.store.get<unknown>(SOURCE_MAP_STORAGE_KEY);\n\t\treturn stored !== null && typeof stored === 'object'\n\t\t\t? (stored as Record<string, unknown>)\n\t\t\t: {};\n\t}\n\n\t/** Keeps only the {@link MAX_SOURCE_ENTRIES} most recently recorded sources. */\n\tprivate pruneSourceMap(\n\t\tmap: Record<string, unknown>,\n\t): Record<string, unknown> {\n\t\tconst entries = Object.entries(map);\n\t\tif (entries.length <= MAX_SOURCE_ENTRIES) return map;\n\n\t\tconst sorted = entries.sort(([, a], [, b]) => {\n\t\t\tconst aDate = (a as Partial<PgnSourceCacheEntry>)?.createdAt ?? 0;\n\t\t\tconst bDate = (b as Partial<PgnSourceCacheEntry>)?.createdAt ?? 0;\n\t\t\treturn bDate - aDate;\n\t\t});\n\t\treturn Object.fromEntries(sorted.slice(0, MAX_SOURCE_ENTRIES));\n\t}\n}\n","/**\n * Mapping from ECO (Encyclopedia of Chess Openings) codes to their defining move sequences.\n *\n * Each entry maps an ECO code (e.g. `'A00'`, `'B33'`) to the pipe-separated sequence of\n * standard algebraic notation (SAN) moves that identify the opening.\n *\n * Generated from a curated ECO database. Used by the PGN viewer for opening classification\n * and filtering by specific opening lines.\n *\n * | Category | ECO Range |\n * |----------|-----------|\n * | A        | Flank openings (A00–A99) |\n * | B        | Semi-open games (B00–B99) |\n * | C        | Open games / French (C00–C99) |\n * | D        | Closed / Semi-closed games (D00–D99) |\n * | E        | Indian defenses (E00–E99) |\n *\n * @example\n * ```typescript\n * import { ECO_MOVES } from 'ngx-chessground';\n *\n * const opening = ECO_MOVES['B33']; // \"1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 e5\"\n * ```\n */\nexport const ECO_MOVES: Record<string, string> = {\n\tA00: '1. a3 | 1. g3 | 1. b4 | 1. c3 | 1. Nc3',\n\tA01: '1. b3',\n\tA02: '1. f4',\n\tA03: '1. f4 d5',\n\tA04: '1. Nf3',\n\tA05: '1. Nf3 Nf6',\n\tA06: '1. Nf3 d5',\n\tA07: '1. Nf3 d5 2. g3',\n\tA08: '1. Nf3 d5 2. g3 c5 3. Bg2',\n\tA09: '1. Nf3 d5 2. c4',\n\tA10: '1. c4',\n\tA11: '1. c4 c6',\n\tA12: '1. Nf3 d5 2. c4 c6 3. b3',\n\tA13: '1. c4 e6',\n\tA14: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6 4. e4',\n\tA43: '1. d4 c5',\n\tA44: '1. d4 c5 2. d5 e5',\n\tA45: '1. d4 Nf6',\n\tA46: '1. d4 Nf6 2. Nf3',\n\tA47: '1. d4 Nf6 2. Nf3 b6',\n\tA48: '1. d4 Nf6 2. Nf3 g6',\n\tA49: '1. d4 Nf6 2. Nf3 g6 3. g3',\n\tA50: '1. d4 Nf6 2. c4',\n\tA51: '1. d4 Nf6 2. c4 e5',\n\tA52: '1. d4 Nf6 2. c4 e5 3. dxe5 Ng4',\n\tA53: '1. d4 Nf6 2. c4 d6',\n\tA54: '1. d4 Nf6 2. c4 d6 3. Nc3 e5',\n\tA55: '1. d4 Nf6 2. c4 d6 3. Nc3 Nbd7 4. e4 e5 5. Nf3',\n\tA56: '1. d4 Nf6 2. c4 c5',\n\tA57: '1. d4 Nf6 2. c4 c5 3. d5 b5',\n\tA58: '1. d4 Nf6 2. c4 c5 3. d5 b5 4. cxb5 a6 5. bxa6',\n\tA59: '1. d4 Nf6 2. c4 c5 3. d5 b5 4. cxb5 a6 5. bxa6 Bxa6 6. Nc3 d6 7. e4',\n\tA60: '1. d4 Nf6 2. c4 c5 3. d5 e6',\n\tA61: '1. d4 Nf6 2. c4 e6 3. Nf3 c5 4. d5 exd5 5. cxd5 d6 6. Nc3 g6',\n\tA62: '1. d4 Nf6 2. c4 e6 3. g3 c5 4. d5 exd5 5. cxd5 d6 6. Nc3 g6 7. Bg2 Bg7 8. Nf3 O-O',\n\tA63: '1. d4 Nf6 2. c4 e6 3. g3 c5 4. d5 exd5 5. cxd5 d6 6. Nc3 g6 7. Bg2 Bg7 8. Nf3 O-O 9. O-O Nbd7',\n\tA64: '1. d4 Nf6 2. c4 e6 3. g3 c5 4. d5 exd5 5. cxd5 d6 6. Nc3 g6 7. Bg2 Bg7 8. Nf3 O-O 9. O-O a6 10. a4 Nbd7 11. Nd2 Re8',\n\tA65: '1. d4 Nf6 2. c4 c5 3. d5 e6 4. Nc3 exd5 5. cxd5 d6 6. e4',\n\tA66: '1. d4 Nf6 2. c4 c5 3. d5 e6 4. Nc3 exd5 5. cxd5 d6 6. e4 g6 7. f4',\n\tA67: '1. d4 Nf6 2. c4 c5 3. d5 e6 4. Nc3 exd5 5. cxd5 d6 6. e4 g6 7. f4 Bg7 8. Bb5+',\n\tA68: '1. d4 Nf6 2. c4 c5 3. d5 e6 4. Nc3 exd5 5. cxd5 d6 6. e4 g6 7. f4 Bg7 8. Nf3',\n\tA69: '1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. f4 O-O 6. Nf3 c5 7. d5 e6 8. Be2 exd5 9. cxd5 Re8',\n\tA70: '1. d4 Nf6 2. c4 e6 3. Nf3 c5 4. d5 exd5 5. cxd5 d6 6. Nc3 g6 7. e4',\n\tA71: '1. d4 Nf6 2. c4 e6 3. Nf3 c5 4. d5 exd5 5. cxd5 d6 6. Nc3 g6 7. e4 Bg7 8. Bg5',\n\tA72: '1. d4 Nf6 2. c4 c5 3. d5 e6 4. Nc3 exd5 5. cxd5 d6 6. e4 g6 7. Nf3 Bg7 8. Be2 O-O',\n\tA73: '1. d4 Nf6 2. c4 c5 3. d5 e6 4. Nc3 exd5 5. cxd5 d6 6. e4 g6 7. Nf3 Bg7 8. Be2 O-O 9. O-O',\n\tA74: '1. d4 Nf6 2. c4 c5 3. d5 e6 4. Nc3 exd5 5. cxd5 d6 6. e4 g6 7. Nf3 Bg7 8. Be2 O-O 9. O-O a6 10. a4',\n\tA75: '1. d4 Nf6 2. c4 e6 3. Nf3 c5 4. d5 exd5 5. cxd5 d6 6. Nc3 g6 7. e4 Bg7 8. Be2 O-O 9. O-O a6 10. a4 Bg4',\n\tA76: '1. d4 Nf6 2. c4 c5 3. d5 e6 4. Nc3 exd5 5. cxd5 d6 6. e4 g6 7. Nf3 Bg7 8. Be2 O-O 9. O-O Re8',\n\tA77: '1. d4 Nf6 2. c4 c5 3. d5 e6 4. Nc3 exd5 5. cxd5 d6 6. e4 g6 7. Nf3 Bg7 8. Be2 O-O 9. O-O Re8 10. Nd2',\n\tA78: '1. d4 Nf6 2. c4 e6 3. Nf3 c5 4. d5 exd5 5. cxd5 d6 6. Nc3 g6 7. e4 Bg7 8. Be2 O-O 9. O-O Re8 10. Nd2 Na6',\n\tA79: '1. d4 Nf6 2. c4 c5 3. d5 e6 4. Nc3 exd5 5. cxd5 d6 6. e4 g6 7. Nf3 Bg7 8. Be2 O-O 9. O-O Re8 10. Nd2 Na6 11. f3',\n\tA80: '1. d4 f5',\n\tA81: '1. d4 f5 2. g3',\n\tA82: '1. d4 f5 2. e4',\n\tA83: '1. d4 f5 2. e4 fxe4 3. Nc3 Nf6 4. Bg5',\n\tA84: '1. d4 f5 2. c4',\n\tA85: '1. d4 f5 2. c4 Nf6 3. Nc3',\n\tA86: '1. d4 f5 2. c4 Nf6 3. g3',\n\tA87: '1. d4 f5 2. c4 Nf6 3. g3 g6 4. Bg2 Bg7 5. Nf3',\n\tA88: '1. d4 f5 2. g3 Nf6 3. Bg2 g6 4. Nf3 Bg7 5. O-O O-O 6. c4 d6 7. Nc3 c6',\n\tA89: '1. d4 f5 2. g3 Nf6 3. Bg2 g6 4. Nf3 Bg7 5. O-O O-O 6. c4 d6 7. Nc3 Nc6',\n\tA90: '1. d4 f5 2. c4 Nf6 3. g3 e6',\n\tA91: '1. d4 f5 2. c4 Nf6 3. g3 e6 4. Bg2 Be7',\n\tA92: '1. d4 f5 2. c4 Nf6 3. g3 e6 4. Bg2 Be7 5. Nf3 O-O',\n\tA93: '1. d4 f5 2. c4 Nf6 3. g3 e6 4. Bg2 Be7 5. Nf3 O-O 6. O-O d5 7. b3',\n\tA94: '1. d4 f5 2. c4 Nf6 3. g3 e6 4. Bg2 Be7 5. Nf3 O-O 6. O-O d5 7. b3 c6 8. Ba3',\n\tA95: '1. d4 f5 2. c4 Nf6 3. g3 e6 4. Bg2 Be7 5. Nf3 O-O 6. O-O d5 7. Nc3 c6',\n\tA96: '1. d4 f5 2. c4 Nf6 3. g3 e6 4. Bg2 Be7 5. Nf3 O-O 6. O-O d6',\n\tA97: '1. d4 f5 2. c4 Nf6 3. g3 e6 4. Bg2 Be7 5. Nf3 O-O 6. O-O d6 7. Nc3 Qe8',\n\tA98: '1. d4 f5 2. c4 Nf6 3. g3 e6 4. Bg2 Be7 5. Nf3 O-O 6. O-O d6 7. Nc3 Qe8 8. Qc2',\n\tA99: '1. d4 f5 2. c4 Nf6 3. g3 e6 4. Bg2 Be7 5. Nf3 O-O 6. O-O d6 7. Nc3 Qe8 8. b3',\n\tB00: '1. e4',\n\tB07: '1. e4 d6',\n\tB01: '1. e4 d5',\n\tB02: '1. e4 Nf6',\n\tB03: '1. e4 Nf6 2. e5 Nd5 3. d4',\n\tB04: '1. e4 Nf6 2. e5 Nd5 3. d4 d6 4. Nf3',\n\tB05: '1. e4 Nf6 2. e5 Nd5 3. d4 d6 4. Nf3 Bg4',\n\tB06: '1. e4 g6',\n\tB08: '1. e4 d6 2. d4 Nf6 3. Nc3 g6 4. Nf3',\n\tB09: '1. e4 d6 2. d4 Nf6 3. Nc3 g6 4. f4',\n\tB10: '1. e4 c6',\n\tB11: '1. e4 c6 2. Nc3 d5 3. Nf3 Bg4',\n\tB12: '1. e4 c6 2. d4',\n\tB13: '1. e4 c6 2. d4 d5 3. exd5',\n\tB14: '1. e4 c6 2. d4 d5 3. exd5 cxd5 4. c4 Nf6 5. Nc3 e6',\n\tB15: '1. e4 c6 2. d4 d5 3. Nc3',\n\tB16: '1. e4 c6 2. d4 d5 3. Nd2 dxe4 4. Nxe4 h6',\n\tB17: '1. e4 c6 2. d4 d5 3. Nd2 dxe4 4. Nxe4 Nd7',\n\tB18: '1. e4 c6 2. d4 d5 3. Nd2 dxe4 4. Nxe4 Bf5',\n\tB19: '1. e4 c6 2. d4 d5 3. Nc3 dxe4 4. Nxe4 Bf5 5. Ng3 Bg6 6. h4 h6 7. Nf3',\n\tB20: '1. e4 c5',\n\tB21: '1. e4 c5 2. f4',\n\tB22: '1. e4 c5 2. c3',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. d4 d5 3. Nd2',\n\tC04: '1. e4 e6 2. d4 d5 3. Nd2 Nc6 4. Ngf3 Nf6',\n\tC05: '1. e4 e6 2. d4 d5 3. Nd2 Nf6',\n\tC06: '1. e4 e6 2. d4 d5 3. Nd2 Nf6 4. e5 Nfd7 5. Bd3 c5 6. c3 Nc6 7. Ne2 cxd4 8. cxd4',\n\tC07: '1. e4 e6 2. d4 d5 3. Nd2 c5',\n\tC08: '1. e4 e6 2. d4 d5 3. Nd2 c5 4. exd5 exd5',\n\tC09: '1. e4 e6 2. d4 d5 3. Nd2 c5 4. exd5 exd5 5. Ngf3 Nc6',\n\tC10: '1. e4 e6 2. d4 d5 3. Nc3',\n\tC11: '1. e4 e6 2. d4 d5 3. Nc3 Nf6',\n\tC12: '1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. Bg5 Bb4',\n\tC13: '1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. Bg5 Be7',\n\tC14: '1. e4 e6 2. d4 d5 3. Nc3 a6 4. Nf3 Nf6 5. e5 Nfd7 6. Bg5',\n\tC15: '1. e4 e6 2. d4 d5 3. Nc3 Bb4',\n\tC16: '1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5',\n\tC17: '1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5 c5',\n\tC18: '1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5 c5 5. a3 Bxc3+',\n\tC19: '1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5 c5 5. a3 Bxc3+ 6. bxc3 Ne7',\n\tC20: '1. e4 e5',\n\tC21: '1. e4 e5 2. d4 exd4',\n\tC22: '1. e4 e5 2. d4 exd4 3. Qxd4 Nc6',\n\tC23: '1. e4 e5 2. Bc4',\n\tC24: '1. e4 e5 2. Bc4 Nf6',\n\tC25: '1. e4 e5 2. Nc3',\n\tC26: '1. e4 e5 2. Nc3 Nf6',\n\tC27: '1. e4 e5 2. Nc3 Nf6 3. Bc4 Nxe4',\n\tC28: '1. e4 e5 2. Nc3 Nc6 3. Bc4 Nf6',\n\tC29: '1. e4 e5 2. Nc3 Nf6 3. f4',\n\tC30: '1. e4 e5 2. f4',\n\tC31: '1. e4 e5 2. f4 d5',\n\tC32: '1. e4 e5 2. f4 d5 3. exd5 e4 4. d3 Nf6',\n\tC33: '1. e4 e5 2. f4 exf4',\n\tC34: '1. e4 e5 2. f4 exf4 3. Nf3',\n\tC35: '1. e4 e5 2. f4 exf4 3. Nf3 Be7',\n\tC36: '1. e4 e5 2. f4 exf4 3. Nf3 d5',\n\tC37: '1. e4 e5 2. f4 exf4 3. Nf3 g5 4. d4',\n\tC38: '1. e4 e5 2. f4 exf4 3. Nf3 g5 4. Bc4 Bg7',\n\tC39: '1. e4 e5 2. f4 exf4 3. Nf3 g5 4. h4',\n\tC40: '1. e4 e5 2. Nf3',\n\tC41: '1. e4 e5 2. Nf3 d6',\n\tC42: '1. e4 e5 2. Nf3 Nf6',\n\tC43: '1. e4 e5 2. Nf3 Nf6 3. d4',\n\tC44: '1. e4 e5 2. Nf3 Nc6',\n\tC45: '1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Nxd4',\n\tC46: '1. e4 e5 2. Nf3 Nc6 3. Nc3',\n\tC47: '1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6',\n\tC48: '1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. Bb5',\n\tC49: '1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. Bb5 Bb4',\n\tC50: '1. e4 e5 2. Nf3 Nc6 3. Bc4',\n\tC51: '1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4',\n\tC52: '1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 Bxb4 5. c3 Ba5',\n\tC53: '1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. c3',\n\tC54: '1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. c3 Nf6 5. O-O',\n\tC55: '1. e4 e5 2.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f6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Nf3 O-O 6. Be2 e5',\n\tE93: '1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Nf3 O-O 6. Be2 e5 7. d5 Nbd7',\n\tE94: '1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Nf3 O-O 6. Be2 e5 7. O-O',\n\tE95: '1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Nf3 O-O 6. Be2 e5 7. O-O Nbd7 8. Re1',\n\tE96: '1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Nf3 O-O 6. Be2 e5 7. O-O Nbd7 8. Re1 c6 9. Bf1 a5',\n\tE97: '1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Nf3 O-O 6. Be2 e5 7. O-O Nc6',\n\tE98: '1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Nf3 O-O 6. Be2 e5 7. O-O Nc6 8. d5 Ne7 9. Ne1',\n\tE99: '1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. Nf3 O-O 6. Be2 e5 7. O-O Nc6 8. d5 Ne7 9. Ne1 Nd7 10. f3 f5',\n\t'E12 ':\n\t\t'1.d4 Nf6 2.c4 e6 3.Nf3 b6 4.a3 Bb7 5.Nc3 d5 6.cxd5 Nxd5 7.Qc2 c5 8.e4 Nxc3 9.bxc3 Nc6 10.Bb2 cxd4 11.cxd4 Rc8 12.Rd1 Bd6 ',\n\t'E80 ':\n\t\t'1.d4 Nf6 2.c4 g6 3.Nc3 Bg7 4.e4 d6 5.f3 e5 6.d5 Nh5 7.Be3 Na6 8.Qd2 Qh4+ 9.g3 Nxg3 10.Qf2 Nxf1 11.Qxh4 Nxe3 12.Kf2 Nxc4 ',\n};\n","import { Injectable } from '@angular/core';\nimport { isDesktopRuntime } from './desktop-runtime';\nimport type {\n\tFilterCriteria,\n\tLoadFromCachePayload,\n\tLoadPayload,\n\tWorkerMessage,\n\tWorkerResponse,\n} from './pgn-processor.worker';\n\n/**\n * Callback interface for PGN viewer engine events.\n * Consumer components implement these handlers to react to worker messages.\n */\ninterface PgnViewerEngineCallbacks {\n\t/** Called when the PGN processor worker sends a response (parse, filter, load results). */\n\tonPgnMessage: (data: WorkerResponse) => void;\n\t/** Called when the Stockfish worker sends analysis output (UCI protocol messages). */\n\tonStockfishMessage: (event: MessageEvent) => void;\n\t/** Optional error handler for worker initialization failures. */\n\tonError?: (message: string, error?: unknown) => void;\n}\n\n/**\n * Service that manages Web Workers for background PGN processing and Stockfish analysis.\n *\n * Maintains two workers:\n * - **PGN processor** — parses/filters PGN data off the main thread using `pgn-processor.worker`.\n * - **Stockfish** — runs the Stockfish chess engine for position analysis via UCI protocol.\n *\n * Provided at root level so a single instance is shared across the application.\n * Callers must call {@link initialize} before using the service and {@link dispose} when done.\n */\n@Injectable({\n\tprovidedIn: 'root',\n})\nexport class PgnViewerEngineService {\n\t/** Web Worker for PGN parsing and filtering. */\n\tprivate pgnWorker: Worker | null = null;\n\t/** Web Worker running the Stockfish chess engine. */\n\tprivate stockfishWorker: Worker | null = null;\n\t/** True once Stockfish completes its UCI handshake (uciok → isready → readyok). */\n\tprivate stockfishReady = false;\n\t/** True while a `go` command is running and its `bestmove` has not arrived yet. */\n\tprivate searching = false;\n\t/**\n\t * When true, drop engine output until the next `bestmove`. This swallows the\n\t * trailing info + bestmove of a search that was aborted by `stop`, so it\n\t * cannot be mistaken for the result of the search that replaced it.\n\t */\n\tprivate ignoreUntilBestmove = false;\n\t/** Analysis request made while the engine was still booting; flushed once ready. */\n\tprivate pendingAnalysis: { fen: string; depth: number } | null = null;\n\n\t/**\n\t * Creates and initializes both Web Workers.\n\t *\n\t * Disposes any existing workers first, then spawns new ones.\n\t * The Stockfish worker is started in UCI mode immediately.\n\t *\n\t * @param callbacks — Event handlers for worker messages and errors.\n\t * @returns `true` if workers were created successfully, `false` if Web Workers are unsupported.\n\t */\n\tinitialize(callbacks: PgnViewerEngineCallbacks): boolean {\n\t\tif (typeof Worker === 'undefined') {\n\t\t\tcallbacks.onError?.('Web Workers are not supported in this environment.');\n\t\t\treturn false;\n\t\t}\n\n\t\tthis.dispose();\n\t\tthis.stockfishReady = false;\n\t\tthis.searching = false;\n\t\tthis.ignoreUntilBestmove = false;\n\t\tthis.pendingAnalysis = null;\n\n\t\tthis.pgnWorker = new Worker(\n\t\t\tnew URL('./pgn-processor.worker', import.meta.url),\n\t\t);\n\t\tthis.pgnWorker.onmessage = ({ data }: MessageEvent<WorkerResponse>) => {\n\t\t\tcallbacks.onPgnMessage(data);\n\t\t};\n\n\t\ttry {\n\t\t\tthis.stockfishWorker = new Worker('assets/stockfish/stockfish.js');\n\t\t\tthis.stockfishWorker.onmessage = (event: MessageEvent) => {\n\t\t\t\tconst data = event.data;\n\t\t\t\tif (typeof data !== 'string') {\n\t\t\t\t\tcallbacks.onStockfishMessage(event);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t// Swallow the trailing output (info + bestmove) of a search that\n\t\t\t\t// was aborted by `stop`, until its `bestmove` closes it out.\n\t\t\t\tif (this.ignoreUntilBestmove) {\n\t\t\t\t\tif (data.startsWith('bestmove')) this.ignoreUntilBestmove = false;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t// Drive the UCI handshake and queue analysis until ready.\n\t\t\t\tif (data.startsWith('uciok')) {\n\t\t\t\t\tthis.stockfishWorker?.postMessage('setoption name MultiPV value 3');\n\t\t\t\t\tthis.stockfishWorker?.postMessage('isready');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (data.startsWith('readyok')) {\n\t\t\t\t\tthis.stockfishReady = true;\n\t\t\t\t\tthis.flushPendingAnalysis();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (data.startsWith('bestmove')) {\n\t\t\t\t\tthis.searching = false;\n\t\t\t\t}\n\t\t\t\tcallbacks.onStockfishMessage(event);\n\t\t\t};\n\t\t\tthis.stockfishWorker.postMessage('uci');\n\t\t} catch (error) {\n\t\t\tcallbacks.onError?.('Failed to load the Stockfish worker.', error);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Sends raw PGN text and indexing options to the parser worker for processing.\n\t *\n\t * Supports caching via `pgnHash`. When provided, the worker checks its cache\n\t * first and skips re-parsing if a valid entry exists. In the browser the\n\t * cache is IndexedDB; in the packaged desktop app it is a file on disk behind\n\t * the local server, because the webview origin (and therefore IndexedDB) is\n\t * new on every launch there.\n\t *\n\t * @param pgn — Raw PGN string (supports multi-game, compressed formats).\n\t * @param id — Correlation ID echoed back in the worker response for matching requests.\n\t * @param pgnHash — Optional SHA-256 hash for cache restore.\n\t * @param indexStartPositions — Whether to include the starting position FEN in the index.\n\t * @param maxFenPlies — Max half-moves to replay when building the FEN cache.\n\t */\n\tloadPgn(\n\t\tpgn: string,\n\t\tid: number,\n\t\tpgnHash?: string,\n\t\tindexStartPositions: boolean = false,\n\t\tmaxFenPlies: number = 30,\n\t): void {\n\t\tconst payload: LoadPayload = {\n\t\t\tpgn,\n\t\t\tindexStartPositions,\n\t\t\tmaxFenPlies,\n\t\t\tuseDiskCache: isDesktopRuntime(),\n\t\t};\n\t\tconst msg: WorkerMessage & { pgnHash?: string } = {\n\t\t\ttype: 'load',\n\t\t\tpayload,\n\t\t\tid,\n\t\t};\n\t\tif (pgnHash) {\n\t\t\tmsg.pgnHash = pgnHash;\n\t\t}\n\t\tthis.pgnWorker?.postMessage(msg);\n\t}\n\n\t/**\n\t * Restores a previously parsed game collection from the cache without\n\t * sending the PGN text again.\n\t *\n\t * The worker answers with a `'load'` response on a cache hit, or a\n\t * `'cacheMiss'` response when no usable entry exists (in which case the\n\t * caller must fall back to {@link loadPgn} with the downloaded text).\n\t *\n\t * @param pgnHash — SHA-256 hash of the decompressed PGN content.\n\t * @param id — Correlation ID echoed back in the worker response.\n\t * @param indexStartPositions — Whether a built FEN index is required.\n\t * @param maxFenPlies — Max half-moves the caller expects to be indexed.\n\t */\n\tloadFromCache(\n\t\tpgnHash: string,\n\t\tid: number,\n\t\tindexStartPositions: boolean = false,\n\t\tmaxFenPlies: number = 30,\n\t): void {\n\t\tconst payload: LoadFromCachePayload = {\n\t\t\tpgnHash,\n\t\t\tindexStartPositions,\n\t\t\tmaxFenPlies,\n\t\t\tuseDiskCache: isDesktopRuntime(),\n\t\t};\n\t\tthis.pgnWorker?.postMessage({ type: 'loadFromCache', payload, id });\n\t}\n\n\t/**\n\t * Filters the parsed game list by the given criteria.\n\t *\n\t * @param payload — Filter criteria (player names, ECO, draw inclusion, opening moves, ratings).\n\t * @param id — Correlation ID echoed back in the worker response.\n\t */\n\tfilterGames(payload: FilterCriteria, id: number): void {\n\t\tthis.pgnWorker?.postMessage({ type: 'filter', payload, id });\n\t}\n\n\t/**\n\t * Loads the full move data for a specific game by its index in the parsed list.\n\t *\n\t * @param index — Zero-based index of the game to load.\n\t * @param id — Correlation ID echoed back in the worker response.\n\t */\n\tloadGame(index: number, id: number): void {\n\t\tthis.pgnWorker?.postMessage({ type: 'loadGame', payload: index, id });\n\t}\n\n\t/**\n\t * Sends a FEN position to Stockfish for analysis at the given search depth.\n\t *\n\t * Stops any in-progress analysis before starting the new one. If the engine\n\t * has not finished booting yet, the request is queued and issued once the\n\t * UCI handshake completes.\n\t *\n\t * @param fen — FEN string of the position to analyze.\n\t * @param depth — Search depth in plies.\n\t * @returns `false` if the Stockfish worker is not available, `true` otherwise.\n\t */\n\tanalyzePosition(fen: string, depth: number): boolean {\n\t\tif (!this.stockfishWorker) {\n\t\t\treturn false;\n\t\t}\n\t\tif (!this.stockfishReady) {\n\t\t\t// Engine still booting: remember the latest request and run it once\n\t\t\t// `readyok` arrives instead of silently dropping it.\n\t\t\tthis.pendingAnalysis = { fen, depth };\n\t\t\treturn true;\n\t\t}\n\t\tthis.sendAnalysis(fen, depth);\n\t\treturn true;\n\t}\n\n\t/**\n\t * Aborts any in-flight search and starts a new one for `fen`.\n\t */\n\tprivate sendAnalysis(fen: string, depth: number): void {\n\t\tif (!this.stockfishWorker) return;\n\t\t// If a search is still running, `stop` will make Stockfish emit a final\n\t\t// `bestmove` for it. Mark that output as stale so it is swallowed and\n\t\t// cannot be confused with the new search's result.\n\t\tif (this.searching) this.ignoreUntilBestmove = true;\n\t\tthis.stockfishWorker.postMessage('stop');\n\t\tthis.stockfishWorker.postMessage('setoption name MultiPV value 3');\n\t\tthis.stockfishWorker.postMessage(`position fen ${fen}`);\n\t\tthis.stockfishWorker.postMessage(`go depth ${depth}`);\n\t\tthis.searching = true;\n\t}\n\n\t/** Runs the queued analysis request once the engine reports ready. */\n\tprivate flushPendingAnalysis(): void {\n\t\tif (!this.pendingAnalysis) return;\n\t\tconst { fen, depth } = this.pendingAnalysis;\n\t\tthis.pendingAnalysis = null;\n\t\tthis.sendAnalysis(fen, depth);\n\t}\n\n\t/**\n\t * Sends a message to the PGN worker to clear all cached data — IndexedDB in\n\t * the browser, the on-disk cache files in the desktop app.\n\t */\n\tclearCache(id: number): void {\n\t\tthis.pgnWorker?.postMessage({\n\t\t\ttype: 'clearCache',\n\t\t\tid,\n\t\t\tuseDiskCache: isDesktopRuntime(),\n\t\t});\n\t}\n\n\t/**\n\t * Terminates both workers and releases resources.\n\t *\n\t * Sends a 'quit' command to Stockfish before terminating to allow\n\t * the engine to shut down gracefully.\n\t */\n\tdispose(): void {\n\t\tthis.pgnWorker?.terminate();\n\t\tthis.pgnWorker = null;\n\n\t\tif (this.stockfishWorker) {\n\t\t\tthis.stockfishWorker.postMessage('quit');\n\t\t\tthis.stockfishWorker.terminate();\n\t\t\tthis.stockfishWorker = null;\n\t\t}\n\n\t\tthis.stockfishReady = false;\n\t\tthis.searching = false;\n\t\tthis.ignoreUntilBestmove = false;\n\t\tthis.pendingAnalysis = null;\n\t}\n}\n","import { InjectionToken } from '@angular/core';\n\n/**\n * Severity of a viewer notification.\n *\n * `'error'` is used for failures the user must know about (a download that\n * failed, a clipboard that could not be read); `'info'` covers confirmations\n * such as \"PGN cache cleared.\"\n */\nexport type PgnViewerNoticeLevel = 'info' | 'error';\n\n/** A message the viewer wants to surface to the user. */\nexport interface PgnViewerNotice {\n\t/** Human-readable text, already localized by the viewer. */\n\treadonly message: string;\n\t/** How prominently the host should present it. */\n\treadonly level: PgnViewerNoticeLevel;\n\t/**\n\t * Suggested display duration in milliseconds. `0` means \"until dismissed\".\n\t * Hosts are free to ignore this.\n\t */\n\treadonly durationMs: number;\n}\n\n/**\n * Host-provided sink for user-facing viewer notifications.\n *\n * The viewer deliberately does not depend on a UI toolkit: without a provider\n * it falls back to {@link consolePgnViewerNotifier}, and applications that want\n * snackbars, toasts or a live region provide {@link PGN_VIEWER_NOTIFIER}\n * themselves.\n *\n * @example\n * ```typescript\n * // Bridge to Angular Material, if the host already uses it.\n * export const appConfig: ApplicationConfig = {\n *   providers: [\n *     {\n *       provide: PGN_VIEWER_NOTIFIER,\n *       useFactory: () => {\n *         const snackBar = inject(MatSnackBar);\n *         return {\n *           notify: ({ message, durationMs }) =>\n *             void snackBar.open(message, 'Dismiss', { duration: durationMs }),\n *         };\n *       },\n *     },\n *   ],\n * };\n * ```\n */\nexport interface PgnViewerNotifier {\n\t/** Presents a message to the user. Must not throw. */\n\tnotify(notice: PgnViewerNotice): void;\n}\n\n/**\n * Default notifier used when the host provides none.\n *\n * Writes errors to `console.error` and informational messages to\n * `console.info`, so nothing is silently swallowed even in a host that never\n * wired up {@link PGN_VIEWER_NOTIFIER}.\n */\nexport const consolePgnViewerNotifier: PgnViewerNotifier = {\n\tnotify({ message, level }): void {\n\t\tif (level === 'error') {\n\t\t\tconsole.error(`[ngx-chessground] ${message}`);\n\t\t} else {\n\t\t\tconsole.info(`[ngx-chessground] ${message}`);\n\t\t}\n\t},\n};\n\n/**\n * Injection token for the viewer's notification sink.\n *\n * Defaults to {@link consolePgnViewerNotifier}. Provide your own to route\n * viewer messages into the host's notification system.\n */\nexport const PGN_VIEWER_NOTIFIER = new InjectionToken<PgnViewerNotifier>(\n\t'PGN_VIEWER_NOTIFIER',\n\t{ providedIn: 'root', factory: () => consolePgnViewerNotifier },\n);\n","import { Injectable, inject } from '@angular/core';\nimport { PgnViewerStoreService } from './pgn-viewer-store.service';\n\n/**\n * Filter selections persisted across application sessions.\n *\n * Mirrors the filter state owned by `NgxPgnViewerComponent`. Every field is\n * serialized as plain JSON so the stored blob stays human-readable and can be\n * migrated in future versions.\n */\nexport interface PersistedFilterState {\n\t/** White-player name filter; `''` means unset. */\n\twhite: string;\n\t/** Black-player name filter; `''` means unset. */\n\tblack: string;\n\t/** Selected results, any of `'1-0'`, `'0-1'`, `'draw'`, `'*'`; empty means no result filter. */\n\tresult: string[];\n\t/** Whether the opening-move prefix filter was active. */\n\tmoves: boolean;\n\t/** Whether player names were matched against either colour. */\n\tignoreColor: boolean;\n\t/** Whether upset filtering was enabled. */\n\tupsetEnabled: boolean;\n\t/** Whether upsets won by the lower-rated player were included. */\n\tupsetWin: boolean;\n\t/** Whether upsets drawn by the lower-rated player were included. */\n\tupsetDraw: boolean;\n\t/** Minimum Elo gap for a game to count as an upset, as entered (string form field). */\n\tupsetMinDiff: string;\n\t/** Whether rating-range filtering was enabled. */\n\tratingEnabled: boolean;\n\t/** Lower bound of the White rating range, as entered. */\n\twhiteRating: string;\n\t/** Lower bound of the Black rating range, as entered. */\n\tblackRating: string;\n\t/** Upper bound of the White rating range, as entered. */\n\twhiteRatingMax: string;\n\t/** Upper bound of the Black rating range, as entered. */\n\tblackRatingMax: string;\n\t/** Selected ECO code, or `''` for none. */\n\teco: string;\n\t/** Selected time-control keys, e.g. `['180+2', '300+0']`; empty means no filter. */\n\ttimeControl: string[];\n\t/** Selected event name, or `''` for none. */\n\tevent: string;\n\t/** Selected broadcast name, or `''` for none. */\n\tbroadcastName: string;\n\t/** Position (FEN) filter value, or `''` for none. */\n\tfen: string;\n\t/** Whether position filtering was enabled. */\n\tbyFenEnabled: boolean;\n\t/** Whether the game list was sorted ascending. */\n\tsortAscending: boolean;\n}\n\n/**\n * Complete PGN viewer state persisted to `localStorage`.\n *\n * Besides the filters this keeps the data source the user last worked with —\n * the URL and the Lichess year/month picker — so a fresh session can reload\n * the same database and re-apply the same filter selection.\n */\nexport interface PersistedViewerState {\n\t/** Schema version, used to discard incompatible payloads. */\n\tversion: number;\n\t/** Last PGN URL (Lichess broadcast archive or custom URL). */\n\turl: string;\n\t/** Last selected Lichess archive year. */\n\tlichessYear: number;\n\t/** Last selected Lichess archive month (1-12). */\n\tlichessMonth: number;\n\t/** Filter selection carried over from the previous session. */\n\tfilters: PersistedFilterState;\n}\n\n/** Current persisted schema version. */\nexport const PGN_VIEWER_STATE_VERSION = 1;\n\n/** `localStorage` key holding the serialized {@link PersistedViewerState}. */\nexport const PGN_VIEWER_STATE_STORAGE_KEY = 'ngx-chessground-pgn-viewer-state';\n\n/** Filter defaults, used both for a fresh session and to fill gaps. */\nexport const DEFAULT_PERSISTED_FILTER_STATE: PersistedFilterState = {\n\twhite: '',\n\tblack: '',\n\tresult: [],\n\tmoves: false,\n\tignoreColor: false,\n\tupsetEnabled: false,\n\tupsetWin: false,\n\tupsetDraw: false,\n\tupsetMinDiff: '300',\n\tratingEnabled: false,\n\twhiteRating: '2000',\n\tblackRating: '2000',\n\twhiteRatingMax: '2900',\n\tblackRatingMax: '2900',\n\teco: '',\n\ttimeControl: [],\n\tevent: '',\n\tbroadcastName: '',\n\tfen: '',\n\tbyFenEnabled: false,\n\tsortAscending: false,\n};\n\n/**\n * Coerces a persisted value to a string.\n *\n * @param value — Value read from storage; may be anything.\n * @param fallback — Returned when `value` is not a string.\n */\nfunction asString(value: unknown, fallback: string): string {\n\treturn typeof value === 'string' ? value : fallback;\n}\n\n/**\n * Coerces a persisted value to a boolean.\n *\n * @param value — Value read from storage; may be anything.\n * @param fallback — Returned when `value` is not a boolean.\n */\nfunction asBoolean(value: unknown, fallback: boolean): boolean {\n\treturn typeof value === 'boolean' ? value : fallback;\n}\n\n/**\n * Coerces a persisted value to a finite number.\n *\n * `NaN` and `Infinity` count as invalid, so a corrupt payload cannot turn a\n * picker bound to this value into a permanently broken state.\n *\n * @param value — Value read from storage; may be anything.\n * @param fallback — Returned when `value` is not a finite number.\n */\nfunction asNumber(value: unknown, fallback: number): number {\n\treturn typeof value === 'number' && Number.isFinite(value) ? value : fallback;\n}\n\n/**\n * Coerces a persisted value to an array of strings.\n *\n * Non-string entries are dropped rather than stringified, so a hand-edited\n * payload cannot inject objects into a filter list.\n *\n * @param value — Value read from storage; may be anything.\n * @param fallback — Copied and returned when `value` is not an array.\n */\nfunction asStringArray(value: unknown, fallback: string[]): string[] {\n\treturn Array.isArray(value)\n\t\t? value.filter((entry): entry is string => typeof entry === 'string')\n\t\t: [...fallback];\n}\n\n/**\n * Coerces a persisted value to a plain record.\n *\n * @param value — Value read from storage; may be anything.\n * @returns The value when it is a non-null object, otherwise `{}`.\n */\nfunction asRecord(value: unknown): Record<string, unknown> {\n\treturn value !== null && typeof value === 'object'\n\t\t? (value as Record<string, unknown>)\n\t\t: {};\n}\n\n/**\n * Persists the PGN viewer's filter selection and data-source picker so they\n * survive an application restart.\n *\n * Storage is delegated to {@link PgnViewerStoreService}: `localStorage` in the\n * browser, the desktop server's on-disk store inside the packaged app (where\n * the webview origin changes on every launch and web storage is not durable).\n *\n * Stored values are validated and merged with {@link DEFAULT_PERSISTED_FILTER_STATE}\n * on load, so a corrupt, partial or older payload degrades gracefully instead\n * of throwing.\n *\n * Provided at root level so the viewer component and its host share one\n * instance and one storage key.\n */\n@Injectable({ providedIn: 'root' })\nexport class PgnViewerSettingsService {\n\t/** Durable key/value store backing {@link load} and {@link save}. */\n\tprivate readonly store = inject(PgnViewerStoreService);\n\n\t/**\n\t * Reads the persisted viewer state.\n\t *\n\t * @returns The normalized state, or `null` when nothing valid is stored.\n\t */\n\tload(): PersistedViewerState | null {\n\t\tconst stored = this.store.get<unknown>(PGN_VIEWER_STATE_STORAGE_KEY);\n\t\treturn stored === null ? null : this.normalize(stored);\n\t}\n\n\t/**\n\t * Writes the viewer state, overwriting any previously stored payload.\n\t *\n\t * @param state — Complete state snapshot to persist.\n\t */\n\tsave(state: PersistedViewerState): void {\n\t\tthis.store.set(PGN_VIEWER_STATE_STORAGE_KEY, state);\n\t}\n\n\t/** Removes the persisted viewer state. */\n\tclear(): void {\n\t\tthis.store.remove(PGN_VIEWER_STATE_STORAGE_KEY);\n\t}\n\n\t/**\n\t * Fills the desktop snapshot from disk.\n\t *\n\t * A no-op in the browser (localStorage is synchronous). Hosts should await\n\t * this before reading {@link load} at startup on desktop.\n\t */\n\thydrate(): Promise<void> {\n\t\treturn this.store.hydrate([PGN_VIEWER_STATE_STORAGE_KEY]);\n\t}\n\n\t/**\n\t * Validates an arbitrary parsed payload and fills missing fields with\n\t * defaults. Returns `null` for payloads that are not objects or carry an\n\t * incompatible schema version.\n\t */\n\tprivate normalize(value: unknown): PersistedViewerState | null {\n\t\tif (value === null || typeof value !== 'object') return null;\n\t\tconst record = asRecord(value);\n\t\tif (asNumber(record.version, -1) !== PGN_VIEWER_STATE_VERSION) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst rawFilters = asRecord(record.filters);\n\t\tconst defaults = DEFAULT_PERSISTED_FILTER_STATE;\n\t\tconst filters: PersistedFilterState = {\n\t\t\twhite: asString(rawFilters.white, defaults.white),\n\t\t\tblack: asString(rawFilters.black, defaults.black),\n\t\t\tresult: asStringArray(rawFilters.result, defaults.result),\n\t\t\tmoves: asBoolean(rawFilters.moves, defaults.moves),\n\t\t\tignoreColor: asBoolean(rawFilters.ignoreColor, defaults.ignoreColor),\n\t\t\tupsetEnabled: asBoolean(rawFilters.upsetEnabled, defaults.upsetEnabled),\n\t\t\tupsetWin: asBoolean(rawFilters.upsetWin, defaults.upsetWin),\n\t\t\tupsetDraw: asBoolean(rawFilters.upsetDraw, defaults.upsetDraw),\n\t\t\tupsetMinDiff: asString(rawFilters.upsetMinDiff, defaults.upsetMinDiff),\n\t\t\tratingEnabled: asBoolean(\n\t\t\t\trawFilters.ratingEnabled,\n\t\t\t\tdefaults.ratingEnabled,\n\t\t\t),\n\t\t\twhiteRating: asString(rawFilters.whiteRating, defaults.whiteRating),\n\t\t\tblackRating: asString(rawFilters.blackRating, defaults.blackRating),\n\t\t\twhiteRatingMax: asString(\n\t\t\t\trawFilters.whiteRatingMax,\n\t\t\t\tdefaults.whiteRatingMax,\n\t\t\t),\n\t\t\tblackRatingMax: asString(\n\t\t\t\trawFilters.blackRatingMax,\n\t\t\t\tdefaults.blackRatingMax,\n\t\t\t),\n\t\t\teco: asString(rawFilters.eco, defaults.eco),\n\t\t\ttimeControl: asStringArray(rawFilters.timeControl, defaults.timeControl),\n\t\t\tevent: asString(rawFilters.event, defaults.event),\n\t\t\tbroadcastName: asString(rawFilters.broadcastName, defaults.broadcastName),\n\t\t\tfen: asString(rawFilters.fen, defaults.fen),\n\t\t\tbyFenEnabled: asBoolean(rawFilters.byFenEnabled, defaults.byFenEnabled),\n\t\t\tsortAscending: asBoolean(\n\t\t\t\trawFilters.sortAscending,\n\t\t\t\tdefaults.sortAscending,\n\t\t\t),\n\t\t};\n\n\t\treturn {\n\t\t\tversion: PGN_VIEWER_STATE_VERSION,\n\t\t\turl: asString(record.url, ''),\n\t\t\tlichessYear: asNumber(record.lichessYear, 0),\n\t\t\tlichessMonth: asNumber(record.lichessMonth, 0),\n\t\t\tfilters,\n\t\t};\n\t}\n}\n","import {\n\tbooleanAttribute,\n\tComponent,\n\tcomputed,\n\tinput,\n\tmodel,\n\toutput,\n} from '@angular/core';\nimport type { BestMoveInfo, PracticeMove } from '../pgn-viewer.types';\n\n/**\n * Practice mode panel for the PGN viewer — shown under the board.\n *\n * Displays live Stockfish analysis of the current practice position\n * (evaluation, best move and principal variation), the session move list\n * with per-move evaluations, and export controls (FEN, moves, PGN).\n *\n * All state is owned by the parent container and passed via inputs.\n * The component emits events for user interactions.\n */\n@Component({\n\tselector: 'practice-panel',\n\ttemplateUrl: './practice-panel.component.html',\n\tstyleUrl: './practice-panel.component.css',\n})\nexport class PracticePanelComponent {\n\t// ---- Engine state ----\n\t/** Whether Stockfish is currently analyzing the position. */\n\treadonly isAnalyzing = input(false, { transform: booleanAttribute });\n\t/** Stockfish evaluation of the current position (White's perspective). */\n\treadonly evaluation = input<string | null>(null);\n\t/** Engine best move and principal variation. */\n\treadonly bestMoveInfo = input<BestMoveInfo | null>(null);\n\t/** Stockfish search depth. */\n\treadonly depth = model<number>(18);\n\n\t// ---- Session state ----\n\t/** Moves played during the practice session. */\n\treadonly moves = input<PracticeMove[]>([]);\n\t/** FEN of the current practice position. */\n\treadonly fen = input<string>('');\n\t/** Game result ('1-0', '0-1', '1/2-1/2') or null while ongoing. */\n\treadonly result = input<string | null>(null);\n\n\t// ---- Events ----\n\t/** The user asked to leave practice mode. */\n\treadonly exit = output<void>();\n\t/** The user asked to take back the last practice move. */\n\treadonly undoMove = output<void>();\n\t/** The user asked to restart the session from its start position. */\n\treadonly restart = output<void>();\n\t/** The user asked to re-run Stockfish on the current position. */\n\treadonly reanalyze = output<void>();\n\t/** The user asked to copy the current FEN. */\n\treadonly copyFen = output<void>();\n\t/** The user asked to copy the move list. */\n\treadonly copyMoves = output<void>();\n\t/** The user asked to copy the session PGN. */\n\treadonly copyPgn = output<void>();\n\t/** The user asked to download the session as a PGN file. */\n\treadonly downloadPgn = output<void>();\n\n\t// ---- Computed ----\n\t/** Whether the session has at least one move, i.e. undo/export are meaningful. */\n\treadonly hasMoves = computed(() => this.moves().length > 0);\n\n\t/** Moves grouped into full-move pairs for display: `1. e4 e5`. */\n\treadonly movePairs = computed(() => {\n\t\tconst pairs: {\n\t\t\tnumber: number;\n\t\t\twhite: PracticeMove;\n\t\t\tblack: PracticeMove | null;\n\t\t}[] = [];\n\t\tconst moves = this.moves();\n\t\tfor (let i = 0; i < moves.length; i += 2) {\n\t\t\tpairs.push({\n\t\t\t\tnumber: i / 2 + 1,\n\t\t\t\twhite: moves[i],\n\t\t\t\tblack: i + 1 < moves.length ? moves[i + 1] : null,\n\t\t\t});\n\t\t}\n\t\treturn pairs;\n\t});\n\n\t// ---- Handlers ----\n\t/** Applies the Stockfish depth chosen in the number input. */\n\tonDepthChange(event: Event): void {\n\t\tconst value = Number((event.target as HTMLInputElement).value);\n\t\tthis.depth.set(Number.isFinite(value) ? value : 1);\n\t}\n\n\t/** Select the whole FEN when the readonly input is focused for easy copying. */\n\tselectFen(event: FocusEvent): void {\n\t\t(event.target as HTMLInputElement).select();\n\t}\n}\n","<div class=\"practice-panel\" role=\"region\" aria-label=\"Practice mode\">\n  <!-- Header -->\n  <div class=\"practice-header\">\n    <div class=\"practice-title\">\n      <span class=\"practice-badge\">\n        <svg width=\"13\" height=\"13\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\n          <circle cx=\"11\" cy=\"11\" r=\"7\"/><path d=\"m21 21-4.3-4.3\"/><path d=\"M8 11h6\"/>\n        </svg>\n        Practice\n      </span>\n      <span class=\"status-text\" [class.analyzing]=\"isAnalyzing()\" aria-live=\"polite\">\n        @if (isAnalyzing()) {\n          <span class=\"analyzing-dot\" aria-hidden=\"true\"></span>\n          Analyzing…\n        } @else if (evaluation()) {\n          Eval <strong>{{ evaluation() }}</strong>\n        } @else {\n          Stockfish idle\n        }\n      </span>\n    </div>\n    <button\n      type=\"button\"\n      class=\"exit-btn\"\n      (click)=\"exit.emit()\"\n      title=\"Leave practice mode and return to the loaded game\"\n      aria-label=\"Exit practice mode\"\n    >\n      ✕ Exit\n    </button>\n  </div>\n\n  <!-- Game over -->\n  @if (result(); as gameResult) {\n    <div class=\"practice-result\">Game over: {{ gameResult }}</div>\n  }\n\n  <!-- Engine line -->\n  <div class=\"engine-line\">\n    @if (bestMoveInfo(); as info) {\n      <span class=\"engine-best\">\n        <span class=\"engine-best-label\">Best</span>\n        <strong>{{ info.move }}</strong>\n        @if (info.score) {\n          <span class=\"eval-score\">({{ info.score }})</span>\n        }\n      </span>\n      <span class=\"pv-line\">\n        @for (pvMove of info.pv; track $index) {\n          <span class=\"pv-san\">{{ pvMove.san }}</span>\n        }\n      </span>\n    } @else if (!isAnalyzing()) {\n      <span class=\"engine-idle\">No analysis yet</span>\n    }\n    <label class=\"depth-label\">\n      Depth\n      <input\n        type=\"number\"\n        [value]=\"depth()\"\n        (input)=\"onDepthChange($event)\"\n        min=\"1\"\n        max=\"50\"\n        class=\"depth-input\"\n        aria-label=\"Stockfish search depth\"\n      />\n    </label>\n    <button\n      type=\"button\"\n      class=\"action-btn\"\n      (click)=\"reanalyze.emit()\"\n      title=\"Re-analyze the current position\"\n    >\n      Analyze\n    </button>\n  </div>\n\n  <!-- Session controls -->\n  <div class=\"session-controls\">\n    <button\n      type=\"button\"\n      class=\"action-btn\"\n      (click)=\"undoMove.emit()\"\n      [disabled]=\"!hasMoves()\"\n      title=\"Take back the last practice move\"\n    >\n      ↶ Undo\n    </button>\n    <button\n      type=\"button\"\n      class=\"action-btn\"\n      (click)=\"restart.emit()\"\n      [disabled]=\"!hasMoves()\"\n      title=\"Restart the practice session from its starting position\"\n    >\n      ↺ Restart\n    </button>\n  </div>\n\n  <!-- Move list -->\n  <div class=\"practice-moves\">\n    @if (moves().length > 0) {\n      <div class=\"moves-list\">\n        @for (pair of movePairs(); track pair.number) {\n          <div class=\"move-pair\">\n            <span class=\"move-number\">{{ pair.number }}.</span>\n            <span class=\"move-san\">\n              {{ pair.white.san }}\n              @if (pair.white.evaluation) {\n                <span class=\"move-eval\">{{ pair.white.evaluation }}</span>\n              }\n            </span>\n            @if (pair.black; as blackMove) {\n              <span class=\"move-san\">\n                {{ blackMove.san }}\n                @if (blackMove.evaluation) {\n                  <span class=\"move-eval\">{{ blackMove.evaluation }}</span>\n                }\n              </span>\n            }\n          </div>\n        }\n      </div>\n    } @else {\n      <div class=\"empty-hint\">\n        Take turns — move the side to move on the board (legal moves only).\n      </div>\n    }\n  </div>\n\n  <!-- Export -->\n  <div class=\"export-section\">\n    <div class=\"fen-row\">\n      <input\n        class=\"fen-input\"\n        type=\"text\"\n        readonly\n        [value]=\"fen()\"\n        (focus)=\"selectFen($event)\"\n        aria-label=\"Current position FEN\"\n        spellcheck=\"false\"\n      />\n      <button\n        type=\"button\"\n        class=\"action-btn\"\n        (click)=\"copyFen.emit()\"\n        title=\"Copy the current FEN to the clipboard\"\n      >\n        Copy FEN\n      </button>\n    </div>\n    <div class=\"export-buttons\">\n      <button\n        type=\"button\"\n        class=\"action-btn\"\n        (click)=\"copyMoves.emit()\"\n        [disabled]=\"!hasMoves()\"\n        title=\"Copy the move list to the clipboard\"\n      >\n        Copy moves\n      </button>\n      <button\n        type=\"button\"\n        class=\"action-btn\"\n        (click)=\"copyPgn.emit()\"\n        [disabled]=\"!hasMoves()\"\n        title=\"Copy the full PGN (with evaluations) to the clipboard\"\n      >\n        Copy PGN\n      </button>\n      <button\n        type=\"button\"\n        class=\"action-btn\"\n        (click)=\"downloadPgn.emit()\"\n        [disabled]=\"!hasMoves()\"\n        title=\"Download the analysis as a PGN file\"\n      >\n        Download PGN\n      </button>\n    </div>\n  </div>\n</div>\n","import {\n\tbooleanAttribute,\n\tComponent,\n\tinput,\n\tmodel,\n\toutput,\n} from '@angular/core';\nimport type { ReplayMode, StopOnErrorSide } from '../pgn-viewer.types';\n\n/**\n * Replay control panel for the PGN viewer.\n *\n * Provides timing mode selection (realtime, proportional, fixed),\n * replay options (stop on error with threshold), and action buttons\n * (replay, continue, stop, replay selected games).\n *\n * @example\n * ```html\n * <replay-panel\n *   [replayMode]=\"replayMode()\"\n *   [isReplaying]=\"isReplaying()\"\n *   [canContinueReplay]=\"canContinueReplay()\"\n *   [canShowReplayAll]=\"canShowReplayAll()\"\n *   [selectedGamesCount]=\"selectedGamesCount()\"\n *   (replayGame)=\"replayGame()\"\n *   (continueReplay)=\"continueReplay()\"\n *   (stopSequence)=\"stopSequence()\"\n * />\n * ```\n */\n@Component({\n\tselector: 'replay-panel',\n\ttemplateUrl: './replay-panel.component.html',\n\tstyleUrl: './replay-panel.component.css',\n})\nexport class ReplayPanelComponent {\n\t// ---- Replay State ----\n\t/** Active replay timing mode (two-way). */\n\treadonly replayMode = model<ReplayMode>('fixed');\n\t/** Target duration in seconds for `proportional` mode (two-way). */\n\treadonly proportionalDuration = model<number>(1);\n\t/** Minimum seconds between moves in `realtime` mode (two-way). */\n\treadonly minSecondsBetweenMoves = model<number>(1);\n\t/** Seconds per move in `fixed` mode (two-way). */\n\treadonly fixedTime = model<number>(1);\n\t/** Seconds per move in `fast` mode (two-way). */\n\treadonly fastTime = model<number>(0.3);\n\t/** Whether replay halts on a significant evaluation drop (two-way). */\n\treadonly stopOnError = model<boolean>(false);\n\t/** Evaluation drop, in pawns, that counts as an error (two-way). */\n\treadonly stopOnErrorThreshold = model<number>(1.0);\n\t/** Which side's errors should trigger the stop: 'both' | 'white' | 'black'. */\n\treadonly stopOnErrorSide = model<StopOnErrorSide>('both');\n\n\t/** Whether an auto-replay is currently running. */\n\treadonly isReplaying = input(false, { transform: booleanAttribute });\n\t/** Whether a paused replay can be resumed. */\n\treadonly canContinueReplay = input(false, { transform: booleanAttribute });\n\t/** Whether the \"replay all selected games\" action should be offered. */\n\treadonly canShowReplayAll = input(false, { transform: booleanAttribute });\n\t/** How many games are selected for batch replay. */\n\treadonly selectedGamesCount = input<number>(0);\n\n\t// ---- Events ----\n\t/** Start replaying the loaded game from the beginning. */\n\treadonly replayGame = output<void>();\n\t/** Resume the paused replay. */\n\treadonly continueReplay = output<void>();\n\t/** Stop a batch replay across multiple games. */\n\treadonly stopSequence = output<void>();\n\t/** Replay every selected game in turn. */\n\treadonly replayAllSelectedGames = output<void>();\n\t/** A collapsible section was toggled; emits the section id. */\n\treadonly toggleSection = output<string>();\n\n\t// ---- Collapsible ----\n\t/** Whether the replay panel is expanded (two-way). */\n\treadonly expanded = model<boolean>(true);\n\n\t// ---- Handlers ----\n\t/** Applies the proportional-replay target duration. */\n\tonProportionalDurationChange(event: Event): void {\n\t\tconst value = (event.target as HTMLInputElement).value;\n\t\tthis.proportionalDuration.set(parseFloat(value) || 1);\n\t}\n\n\t/** Applies the minimum seconds between moves. */\n\tonMinSecondsChange(event: Event): void {\n\t\tconst value = (event.target as HTMLInputElement).value;\n\t\tthis.minSecondsBetweenMoves.set(parseFloat(value) || 0.1);\n\t}\n\n\t/** Applies the fixed per-move duration. */\n\tonFixedTimeChange(event: Event): void {\n\t\tconst value = (event.target as HTMLInputElement).value;\n\t\tthis.fixedTime.set(parseFloat(value) || 1);\n\t}\n\n\t/** Applies the fast-mode per-move duration. */\n\tonFastTimeChange(event: Event): void {\n\t\tconst value = (event.target as HTMLInputElement).value;\n\t\tthis.fastTime.set(parseFloat(value) || 0.3);\n\t}\n\n\t/** Toggles stop-on-error. */\n\tonStopOnErrorChange(event: Event): void {\n\t\tconst checked = (event.target as HTMLInputElement).checked;\n\t\tthis.stopOnError.set(checked);\n\t}\n\n\t/** Applies the evaluation-drop threshold for stop-on-error. */\n\tonStopOnErrorThresholdChange(event: Event): void {\n\t\tconst value = (event.target as HTMLInputElement).value;\n\t\tthis.stopOnErrorThreshold.set(parseFloat(value) || 1.0);\n\t}\n\n\t/** Applies the side whose errors trigger stop-on-error. */\n\tonStopOnErrorSideChange(event: Event): void {\n\t\tconst value = (event.target as HTMLSelectElement).value as StopOnErrorSide;\n\t\tthis.stopOnErrorSide.set(value);\n\t}\n\n\t/** Expands or collapses the replay panel. */\n\ttoggleExpanded(): void {\n\t\tthis.expanded.update((v) => !v);\n\t}\n}\n","<div class=\"replay-section\">\n  <h3\n    class=\"section-header\"\n    tabindex=\"0\"\n    role=\"button\"\n    [attr.aria-expanded]=\"expanded()\"\n    [attr.aria-controls]=\"'replay-section-content'\"\n    (click)=\"toggleExpanded()\"\n    (keydown.enter)=\"toggleExpanded(); $event.preventDefault()\"\n    (keydown.space)=\"toggleExpanded(); $event.preventDefault()\"\n  >\n    <span class=\"chevron\" [class.expanded]=\"expanded()\" aria-hidden=\"true\"></span>\n    Replay\n  </h3>\n\n  <div class=\"section-content\" [class.expanded]=\"expanded()\" id=\"replay-section-content\">\n    <div class=\"replay-options\">\n      <label>\n        <input\n          type=\"radio\"\n          name=\"mode\"\n          [value]=\"'realtime'\"\n          [checked]=\"replayMode() === 'realtime'\"\n          (change)=\"replayMode.set('realtime')\"\n        />\n        Real Time\n      </label>\n      <label>\n        <input\n          type=\"radio\"\n          name=\"mode\"\n          [value]=\"'proportional'\"\n          [checked]=\"replayMode() === 'proportional'\"\n          (change)=\"replayMode.set('proportional')\"\n        />\n        Proportional\n      </label>\n      <label>\n        <input\n          type=\"radio\"\n          name=\"mode\"\n          [value]=\"'fixed'\"\n          [checked]=\"replayMode() === 'fixed'\"\n          (change)=\"replayMode.set('fixed')\"\n        />\n        Fixed\n      </label>\n      <label>\n        <input\n          type=\"radio\"\n          name=\"mode\"\n          [value]=\"'fast'\"\n          [checked]=\"replayMode() === 'fast'\"\n          (change)=\"replayMode.set('fast')\"\n        />\n        Fast\n      </label>\n    </div>\n\n    @if (replayMode() === 'proportional') {\n      <div class=\"option-input\">\n        <input\n          type=\"number\"\n          [value]=\"proportionalDuration()\"\n          (input)=\"onProportionalDurationChange($event)\"\n          step=\"0.1\"\n          class=\"small-input\"\n          aria-label=\"Proportional Duration in Minutes\"\n        />\n        min/game\n      </div>\n      <div class=\"option-input\">\n        <input\n          type=\"number\"\n          [value]=\"minSecondsBetweenMoves()\"\n          (input)=\"onMinSecondsChange($event)\"\n          step=\"0.1\"\n          class=\"small-input\"\n          aria-label=\"Min Seconds Between Moves\"\n        />\n        min sec/move\n      </div>\n    }\n\n    @if (replayMode() === 'fixed') {\n      <div class=\"option-input\">\n        <input\n          type=\"number\"\n          [value]=\"fixedTime()\"\n          (input)=\"onFixedTimeChange($event)\"\n          step=\"0.1\"\n          class=\"small-input\"\n          aria-label=\"Fixed Time per Move in Seconds\"\n        />\n        sec/move\n      </div>\n    }\n\n    @if (replayMode() === 'fast') {\n      <div class=\"option-input\">\n        <input\n          type=\"number\"\n          [value]=\"fastTime()\"\n          (input)=\"onFastTimeChange($event)\"\n          step=\"0.1\"\n          class=\"small-input\"\n          aria-label=\"Fast Time per Move in Seconds\"\n        />\n        sec/move\n      </div>\n    }\n\n    <div class=\"option-row stop-error-row\">\n      <label class=\"checkbox-label\">\n        <input\n          type=\"checkbox\"\n          [checked]=\"stopOnError()\"\n          (change)=\"onStopOnErrorChange($event)\"\n        />\n        Stop on Error\n      </label>\n      <span class=\"inline-number\" [class.disabled]=\"!stopOnError()\">\n        &gt;\n        <input\n          type=\"number\"\n          [value]=\"stopOnErrorThreshold()\"\n          (input)=\"onStopOnErrorThresholdChange($event)\"\n          step=\"0.1\"\n          class=\"small-input\"\n          [disabled]=\"!stopOnError()\"\n          aria-label=\"Stop on error threshold in centipawns\"\n        />\n        cp\n      </span>\n    </div>\n\n    <div class=\"option-row\">\n      <span class=\"option-label\" id=\"stop-on-error-side-label\">Errors</span>\n      <select\n        [value]=\"stopOnErrorSide()\"\n        (change)=\"onStopOnErrorSideChange($event)\"\n        [disabled]=\"!stopOnError()\"\n        class=\"small-input side-select\"\n        aria-labelledby=\"stop-on-error-side-label\"\n      >\n        <option value=\"both\">Both (Black &amp; White)</option>\n        <option value=\"white\">White only</option>\n        <option value=\"black\">Black only</option>\n      </select>\n    </div>\n\n    <div class=\"replay-actions\">\n      <button type=\"button\" (click)=\"replayGame.emit()\" class=\"action-btn\">Replay</button>\n      @if (canContinueReplay()) {\n        <button type=\"button\" (click)=\"continueReplay.emit()\" class=\"action-btn\">Continue</button>\n      }\n      <button type=\"button\" (click)=\"stopSequence.emit()\" class=\"action-btn stop\">Stop</button>\n    </div>\n\n    @if (canShowReplayAll()) {\n      <button type=\"button\" \n        (click)=\"replayAllSelectedGames.emit()\"\n        class=\"action-btn full-width\"\n      >\n        Replay Selected ({{ selectedGamesCount() }})\n      </button>\n    }\n  </div>\n</div>\n","import {\n\tbooleanAttribute,\n\tComponent,\n\tcomputed,\n\ttype ElementRef,\n\teffect,\n\tinject,\n\tinput,\n\tlinkedSignal,\n\tmodel,\n\ttype OnDestroy,\n\toutput,\n\tsignal,\n\tviewChild,\n} from '@angular/core';\nimport { Chess, type Move, type Piece, type Square } from 'chess.js';\nimport { Chessground } from 'chessground';\nimport { Api } from 'chessground/api';\nimport type { Config } from 'chessground/config';\nimport { Key } from 'chessground/types';\nimport { parsePgn } from 'chessops/pgn';\nimport { decompress as decompressZst } from 'fzstd';\nimport { loadAsync as loadZipAsync } from 'jszip';\n\nimport { PromotionService } from '../promotion-dialog/promotion.service';\nimport { BoardDisplayComponent } from './board/board-display.component';\nimport { isDesktopRuntime } from './desktop-runtime';\nimport { ECO_MOVES } from './eco-moves';\nimport { GameFilterPanelComponent } from './filter/game-filter-panel.component';\nimport {\n\tlichessBroadcastUrl,\n\tresolveBroadcastUrl,\n} from './lichess-broadcast-url'; // Sub-components\nimport { LoadCachePanelComponent } from './load-cache/load-cache-panel.component';\nimport { MoveListComponent } from './moves/move-list.component';\nimport { PgnCacheService, type PgnSourceCacheEntry } from './pgn-cache.service';\nimport type {\n\tFilterCriteria,\n\tGameMetadata,\n\tWorkerResponse,\n} from './pgn-processor.worker';\nimport type {\n\tBestMoveInfo,\n\tLoadOptions,\n\tPgnSource,\n\tPgnViewerError,\n\tPgnViewerErrorCode,\n\tPracticeMove,\n\tStopOnErrorSide,\n} from './pgn-viewer.types';\nimport { PgnViewerEngineService } from './pgn-viewer-engine.service';\nimport {\n\tPGN_VIEWER_NOTIFIER,\n\ttype PgnViewerNoticeLevel,\n} from './pgn-viewer-notifier';\nimport {\n\ttype PersistedFilterState,\n\ttype PersistedViewerState,\n\tPGN_VIEWER_STATE_VERSION,\n\tPgnViewerSettingsService,\n} from './pgn-viewer-settings.service';\nimport { PracticePanelComponent } from './practice/practice-panel.component';\nimport { ReplayPanelComponent } from './replay/replay-panel.component';\nimport { highlightMatch, type TextSegment } from './text-highlight';\n\n/**\n * Container for the full-featured PGN viewer application.\n *\n * Owns all state signals and business logic, delegating rendering to\n * focused presentational sub-components:\n * - {@link GameFilterPanelComponent} — left sidebar filters\n * - {@link BoardDisplayComponent} — center board area\n * - {@link MoveListComponent} — right panel move list\n * - {@link ReplayPanelComponent} — right panel replay controls\n * - {@link LoadCachePanelComponent} — right panel load & cache\n *\n * @example\n * ```html\n * <ngx-pgn-viewer [pgn]=\"pgnString\" [highlightLastMove]=\"true\" />\n * ```\n */\n@Component({\n\tselector: 'ngx-pgn-viewer',\n\timports: [\n\t\tGameFilterPanelComponent,\n\t\tBoardDisplayComponent,\n\t\tMoveListComponent,\n\t\tReplayPanelComponent,\n\t\tLoadCachePanelComponent,\n\t\tPracticePanelComponent,\n\t],\n\ttemplateUrl: './pgn-viewer.component.html',\n\tstyleUrl: './pgn-viewer.component.css',\n})\nexport class NgxPgnViewerComponent implements OnDestroy {\n\t/** Owns the PGN worker and the Stockfish worker. */\n\tprivate readonly pgnViewerEngine = inject(PgnViewerEngineService);\n\t/** Sink for user-facing messages; defaults to the console. */\n\tprivate readonly notifier = inject(PGN_VIEWER_NOTIFIER);\n\t/** Parsed-game cache and URL → hash bookmarks. */\n\tprivate readonly pgnCacheService = inject(PgnCacheService);\n\t/** Opens the pawn-promotion dialog during interactive play. */\n\tprivate readonly promotionService = inject(PromotionService);\n\t/** Persists and restores the filter selection and data source. */\n\tprivate readonly pgnViewerSettings = inject(PgnViewerSettingsService);\n\n\t// ======================================================================\n\t// Inputs\n\t// ======================================================================\n\n\t/** PGN text to load. Changing it (non-empty) starts a load. */\n\tpgn = input<string>('');\n\t/** Whether to highlight the origin and destination of the last move. */\n\thighlightLastMove = input(true, { transform: booleanAttribute });\n\t/** Board orientation; `true` puts Black at the bottom (two-way). */\n\tflipped = model<boolean>(false);\n\t/** Whether to render 3D Staunton pieces (two-way). */\n\tin3d = model<boolean>(false);\n\t/** Width of the left filter panel in pixels (two-way). */\n\tleftPanelWidth = model<number>(340);\n\t/** Width of the right panel in pixels (two-way). */\n\trightPanelWidth = model<number>(340);\n\t/** Whether the move-list panel is expanded (two-way). */\n\tmovesExpanded = model<boolean>(true);\n\n\t// ======================================================================\n\t// Outputs\n\t// ======================================================================\n\n\t/**\n\t * Emitted once when durable state has been restored.\n\t *\n\t * Hosts that need to read `urlInput`/`restoredStateFromStorage` at startup\n\t * can `await whenStateReady()` instead; this output exists for hosts that\n\t * prefer the reactive form.\n\t */\n\treadonly stateRestored = output<void>();\n\n\t/**\n\t * Emitted when a load starts, carrying the initial status text.\n\t *\n\t * Load progress afterwards is reported through `loadProgress`.\n\t */\n\treadonly loadStarted = output<{ status: string }>();\n\n\t/** Emitted whenever load progress advances. */\n\treadonly loadProgress = output<{\n\t\tpercent: number;\n\t\tstatus: string;\n\t}>();\n\n\t/**\n\t * Emitted for every load failure, in addition to the user-facing notice.\n\t *\n\t * This is the single place a host needs to handle to surface load errors\n\t * programmatically (telemetry, retry UI, a custom banner).\n\t */\n\treadonly loadFailed = output<PgnViewerError>();\n\n\t// ======================================================================\n\t// State Signals\n\t// ======================================================================\n\n\t/** Parsed metadata for every game in the loaded collection. */\n\tgamesMetadata = signal<GameMetadata[]>([]);\n\t/** Index of the game currently loaded into the board. */\n\tcurrentGameIndex = signal<number>(0);\n\t/** SAN moves of the loaded game. */\n\tmoves = signal<string[]>([]);\n\t/** Zero-based index of the displayed move; `-1` is the start position. */\n\tcurrentMoveIndex = signal<number>(-1);\n\t/** FEN of the position currently displayed on the board. */\n\tcurrentFen = signal<string>(\n\t\t'rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1',\n\t);\n\t/** Whether a load or parse is in progress. */\n\tisLoading = signal<boolean>(false);\n\t/** Load progress, 0-100. */\n\tloadingProgress = signal<number>(0);\n\t/** Human-readable description of the current load step. */\n\tloadingStatus = signal<string>('');\n\t/** Content hash of the PGN being loaded, used for cache bookkeeping. */\n\tlastPgnHash: string | null = null;\n\t/** Indices of the games selected for batch operations. */\n\tselectedGames = signal<Set<number>>(new Set());\n\n\t// ---- Filter Signals ----\n\t/** White-player name filter. */\n\tfilterWhite = signal<string>('');\n\t/** Black-player name filter. */\n\tfilterBlack = signal<string>('');\n\t/** Selected results; empty means no result filter. */\n\tfilterResult = signal<string[]>([]);\n\t/** Whether the opening-move prefix filter is active. */\n\tfilterMoves = signal<boolean>(false);\n\t/** Whether player names match either colour. */\n\tignoreColor = signal<boolean>(false);\n\t/** Whether upset filtering is enabled. */\n\tfilterUpsetEnabled = signal<boolean>(false);\n\t/** Include upsets won by the lower-rated player. */\n\tfilterUpsetWin = signal<boolean>(false);\n\t/** Include upsets drawn by the lower-rated player. */\n\tfilterUpsetDraw = signal<boolean>(false);\n\t/** Minimum Elo gap between players for a game to count as an upset. */\n\tfilterUpsetMinDiff = signal<string>('300');\n\t/** Whether rating-range filtering is enabled. */\n\tfilterRatingEnabled = signal<boolean>(false);\n\t/** Lower bound of the White rating range, as entered. */\n\tfilterWhiteRating = signal<string>('2000');\n\t/** Lower bound of the Black rating range, as entered. */\n\tfilterBlackRating = signal<string>('2000');\n\t/** Upper bound of the White rating range, as entered. */\n\tfilterWhiteRatingMax = signal<string>('2900');\n\t/** Upper bound of the Black rating range, as entered. */\n\tfilterBlackRatingMax = signal<string>('2900');\n\t/** Selected ECO code, or `''`. */\n\tfilterEco = signal<string>('');\n\t/** Selected time-control keys; empty means no filter. */\n\tfilterTimeControl = signal<string[]>([]);\n\t/** Selected event name, or `''`. */\n\tfilterEvent = signal<string>('');\n\t/** Selected broadcast name, or `''`. */\n\tfilterBroadcastName = signal<string>('');\n\t/** Target position for FEN filtering. */\n\tfilterFen = signal<string>('');\n\t/** Whether position (FEN) filtering is active. */\n\tfilterByFenEnabled = signal<boolean>(false);\n\t/**\n\t * Whether to build a starting-position FEN index.\n\t *\n\t * Defaults to `true` in the packaged desktop app, which has the resources\n\t * to index every game, and `false` on the web unless the user opts in.\n\t */\n\tindexStartPositions = signal<boolean>(isDesktopRuntime());\n\t/** Max half-moves replayed per game when building the FEN index. */\n\tmaxFenPlies = signal<number>(30);\n\t/** Whether the game list is sorted oldest-first. */\n\tsortAscending = signal<boolean>(false);\n\n\t/** Distinct White player names in the loaded collection. */\n\tuniqueWhitePlayers = signal<string[]>([]);\n\t/** Distinct Black player names in the loaded collection. */\n\tuniqueBlackPlayers = signal<string[]>([]);\n\t/** ECO code → game count, for the ECO dropdown. */\n\tuniqueEcoCodes = signal<Map<string, number>>(new Map());\n\t/** Time-control key → game count and original time-control strings. */\n\tuniqueTimeControls = signal<\n\t\tMap<string, { count: number; originals: Map<string, number> }>\n\t>(new Map());\n\t/** Event name → game count. */\n\tuniqueEvents = signal<Map<string, number>>(new Map());\n\t/** Broadcast name → game count. */\n\tuniqueBroadcastNames = signal<Map<string, number>>(new Map());\n\n\t/** Indices of the games matching the active filters. */\n\tfilteredGamesIndices = signal<number[]>([]);\n\t/** Whether a filter request is in flight. */\n\tisFiltering = signal<boolean>(false);\n\t/** Whether the full filtered list is shown instead of the limited page. */\n\tshowAllGames = signal<boolean>(false);\n\n\t/** ECO codes with counts, most frequent first. */\n\tsortedEcoCodes = computed(() =>\n\t\tArray.from(this.uniqueEcoCodes().entries())\n\t\t\t.sort((a, b) => b[1] - a[1])\n\t\t\t.map(([code, count]) => ({ code, count })),\n\t);\n\n\t/** Time controls with counts and display labels, most frequent first. */\n\tsortedTimeControls = computed(() =>\n\t\tArray.from(this.uniqueTimeControls().entries())\n\t\t\t.sort((a, b) => b[1].count - a[1].count)\n\t\t\t.map(([key, data]) => ({\n\t\t\t\tkey,\n\t\t\t\tcount: data.count,\n\t\t\t\tlabel: this.formatTimeControlKey(key),\n\t\t\t\toriginalsSummary: this.formatOriginalsSummary(data.originals),\n\t\t\t})),\n\t);\n\n\t/** Event names with counts, most frequent first. */\n\tsortedEvents = computed(() =>\n\t\tArray.from(this.uniqueEvents().entries())\n\t\t\t.sort((a, b) => b[1] - a[1])\n\t\t\t.map(([event, count]) => ({ event, count })),\n\t);\n\n\t/** Broadcast names with counts, most frequent first. */\n\tsortedBroadcastNames = computed(() =>\n\t\tArray.from(this.uniqueBroadcastNames().entries())\n\t\t\t.sort((a, b) => b[1] - a[1])\n\t\t\t.map(([broadcastName, count]) => ({ broadcastName, count })),\n\t);\n\n\t/**\n\t * Metadata rows the filter panel's game list should show.\n\t *\n\t * While games are explicitly selected the list collapses to the current\n\t * game only, so the selection stays stable; otherwise it shows the first\n\t * match, or every match once `showAllGames` is set.\n\t */\n\tfilteredGameInfos = computed(() => {\n\t\tconst metadata = this.gamesMetadata();\n\t\tconst allIndices = this.filteredGamesIndices();\n\t\tif (this.selectedGamesCount() > 0) {\n\t\t\tconst currentIdx = this.currentGameIndex();\n\t\t\tif (currentIdx >= 0 && currentIdx < metadata.length) {\n\t\t\t\treturn [metadata[currentIdx]];\n\t\t\t}\n\t\t\treturn [];\n\t\t}\n\t\tconst limit = this.showAllGames() ? allIndices.length : 1;\n\t\treturn allIndices.slice(0, limit).map((i) => metadata[i]);\n\t});\n\n\t/** Number of games matching the active filters. */\n\ttotalFilteredCount = computed(() => this.filteredGamesIndices().length);\n\t/** Number of games explicitly selected. */\n\tselectedGamesCount = computed(() => this.selectedGames().size);\n\t/** Whether batch replay should be offered: several games, some selected. */\n\tcanShowReplayAll = computed(\n\t\t() => this.gamesMetadata().length > 1 && this.selectedGamesCount() > 0,\n\t);\n\n\t/** Position of the loaded game within the collection, e.g. `\"Game 2 of 40\"`. */\n\tcurrentGameInfo = computed(\n\t\t() =>\n\t\t\t`Game ${this.currentGameIndex() + 1} of ${this.gamesMetadata().length} `,\n\t);\n\n\t/** White player of the loaded game, or `'Unknown'` when unavailable. */\n\tcurrentWhitePlayer = computed(() => {\n\t\tconst metadata = this.gamesMetadata();\n\t\tconst i = this.currentGameIndex();\n\t\treturn metadata.length > 0 && i >= 0 && i < metadata.length\n\t\t\t? metadata[i].white\n\t\t\t: 'Unknown';\n\t});\n\n\t/** Black player of the loaded game, or `'Unknown'` when unavailable. */\n\tcurrentBlackPlayer = computed(() => {\n\t\tconst metadata = this.gamesMetadata();\n\t\tconst i = this.currentGameIndex();\n\t\treturn metadata.length > 0 && i >= 0 && i < metadata.length\n\t\t\t? metadata[i].black\n\t\t\t: 'Unknown';\n\t});\n\n\t/** Result of the loaded game, or `'*'` when unavailable. */\n\tcurrentGameResult = computed(() => {\n\t\tconst metadata = this.gamesMetadata();\n\t\tconst i = this.currentGameIndex();\n\t\treturn metadata.length > 0 && i >= 0 && i < metadata.length\n\t\t\t? metadata[i].result\n\t\t\t: '*';\n\t});\n\n\t// ---- Flipped board helpers ----\n\t/** Player name for the row above the board, honouring orientation. */\n\ttopPlayerName = computed(() =>\n\t\tthis.flipped() ? this.currentWhitePlayer() : this.currentBlackPlayer(),\n\t);\n\t/** Player name for the row below the board, honouring orientation. */\n\tbottomPlayerName = computed(() =>\n\t\tthis.flipped() ? this.currentBlackPlayer() : this.currentWhitePlayer(),\n\t);\n\t/** Turn-indicator CSS class for the top row. */\n\ttopPlayerTurnClass = computed(() =>\n\t\tthis.flipped() ? 'white-turn' : 'black-turn',\n\t);\n\t/** Turn-indicator CSS class for the bottom row. */\n\tbottomPlayerTurnClass = computed(() =>\n\t\tthis.flipped() ? 'black-turn' : 'white-turn',\n\t);\n\t/** Piece colour for the top row, honouring orientation. */\n\ttopPlayerActiveColor = computed(() => (this.flipped() ? 'w' : 'b'));\n\t/** Piece colour for the bottom row, honouring orientation. */\n\tbottomPlayerActiveColor = computed(() => (this.flipped() ? 'b' : 'w'));\n\t/** Tooltip for the top row, naming the side that moves next. */\n\ttopPlayerTitle = computed(() =>\n\t\tthis.flipped() ? 'White to move' : 'Black to move',\n\t);\n\t/** Tooltip for the bottom row, naming the side that moves next. */\n\tbottomPlayerTitle = computed(() =>\n\t\tthis.flipped() ? 'Black to move' : 'White to move',\n\t);\n\t/** Remaining time shown beside the top player. */\n\ttopTimeRemaining = computed(() =>\n\t\tthis.flipped() ? this.whiteTimeRemaining() : this.blackTimeRemaining(),\n\t);\n\t/** Remaining time shown beside the bottom player. */\n\tbottomTimeRemaining = computed(() =>\n\t\tthis.flipped() ? this.blackTimeRemaining() : this.whiteTimeRemaining(),\n\t);\n\n\t/**\n\t * Origin and destination of the move to highlight, or `undefined`.\n\t *\n\t * Reads `currentMoveIndex`/`currentFen` so the highlight is recomputed on\n\t * every position change even though it is derived from chess.js history.\n\t */\n\tlastMoveSquares = computed<[Key, Key] | undefined>(() => {\n\t\tif (!this.highlightLastMove()) return undefined;\n\t\tthis.currentMoveIndex();\n\t\tthis.currentFen();\n\t\tconst history = this.chess.history({ verbose: true });\n\t\tif (history.length === 0) return undefined;\n\t\tconst lastMove = history[history.length - 1];\n\t\treturn [lastMove.from as Key, lastMove.to as Key];\n\t});\n\n\t/** Side to move, parsed from the displayed FEN. */\n\tactiveColor = computed(() => {\n\t\tconst parts = this.currentFen().split(' ');\n\t\treturn parts.length > 1 ? parts[1] : 'w';\n\t});\n\n\t// ---- Replay signals ----\n\t/** Active replay timing mode. */\n\treplayMode = signal<'realtime' | 'proportional' | 'fixed' | 'fast'>('fixed');\n\t/** Target duration in seconds for `proportional` replay. */\n\tproportionalDuration = signal<number>(1);\n\t/** Minimum seconds between moves in `realtime` replay. */\n\tminSecondsBetweenMoves = signal<number>(1);\n\t/** Seconds per move in `fixed` replay. */\n\tfixedTime = signal<number>(1);\n\t/** Seconds per move in `fast` replay. */\n\tfastTime = signal<number>(0.3);\n\t/** Whether replay halts on a significant evaluation drop. */\n\tstopOnError = signal<boolean>(false);\n\t/** Evaluation drop, in pawns, that counts as an error. */\n\tstopOnErrorThreshold = signal<number>(1.0);\n\t/** Which side's errors trigger \"stop on error\": 'both' | 'white' | 'black'. */\n\tstopOnErrorSide = signal<StopOnErrorSide>('both');\n\t/** Whether an auto-replay is currently running. */\n\tisReplaying = signal<boolean>(false);\n\t/** Whether a paused replay can be resumed from the current position. */\n\tcanContinueReplay = computed(\n\t\t() =>\n\t\t\t!this.isReplaying() && this.currentMoveIndex() < this.moves().length - 1,\n\t);\n\t/** Whether the replay has reached the final move of the game. */\n\tisEndOfReplay = computed(\n\t\t() =>\n\t\t\tthis.isReplaying() &&\n\t\t\tthis.currentMoveIndex() >= 0 &&\n\t\t\tthis.moves().length > 0 &&\n\t\t\tthis.currentMoveIndex() >= this.moves().length - 1,\n\t);\n\n\t// ---- Clock signals ----\n\t/** Formatted remaining time for White, or `''` when the PGN has no clocks. */\n\twhiteTimeRemaining = signal<string>('');\n\t/** Formatted remaining time for Black, or `''` when the PGN has no clocks. */\n\tblackTimeRemaining = signal<string>('');\n\t/** Clock string per half-move, aligned with `moves`. */\n\tmoveClocks = signal<string[]>([]);\n\t/** Whether the PGN carried clock data, so clock UI should be shown. */\n\tshowClocks = computed(\n\t\t() => this.whiteTimeRemaining() !== '' || this.blackTimeRemaining() !== '',\n\t);\n\n\t// ---- Stockfish signals ----\n\t/** Whether Stockfish is analyzing the displayed position. */\n\tisAnalyzing = signal<boolean>(false);\n\t/** All PV lines collected from the current analysis (sorted by MultiPV rank). */\n\tallAlternatives = signal<BestMoveInfo[]>([]);\n\t/** Index into allAlternatives indicating which line is currently displayed. */\n\tcurrentAlternativeIndex = signal<number>(0);\n\t/** Computed: currently displayed best move info (cycles through alternatives). */\n\treadonly bestMoveInfo = computed<BestMoveInfo | null>(() => {\n\t\tconst alts = this.allAlternatives();\n\t\tconst idx = this.currentAlternativeIndex();\n\t\treturn idx >= 0 && idx < alts.length ? alts[idx] : null;\n\t});\n\t/** Whether the \"show better move\" button should be offered. */\n\tshowBetterMoveBtn = signal<boolean>(false);\n\t/** Whether the analysis panel is expanded. */\n\tanalysisVisible = signal<boolean>(false);\n\t/** Stockfish search depth requested for the next analysis. */\n\tstockfishDepth = signal<number>(18);\n\t/** True after autoplayBestLine completes — enables the re-evaluate button. */\n\tautoplayCompleted = signal<boolean>(false);\n\n\t// ---- Practice mode signals ----\n\t/** Whether practice mode (turn-based play + continuous analysis) is active. */\n\tpracticeMode = signal<boolean>(false);\n\t/** FEN of the position where the current practice session started. */\n\tpracticeStartFen = signal<string>('');\n\t/** Moves played during the practice session, with engine evaluations. */\n\tpracticeMoves = signal<PracticeMove[]>([]);\n\t/** Stockfish evaluation of the current practice position (White's perspective). */\n\tpracticeEvaluation = signal<string | null>(null);\n\t/** FEN currently being analyzed by Stockfish in practice mode (guards stale results). */\n\tprivate practiceAnalysisFen: string | null = null;\n\t/**\n\t * Live chessground API of the mounted board, captured by {@link runFunction}.\n\t * Used to push the committed position (FEN + legal move destinations) to the\n\t * board synchronously after a user move, so drag & drop stays responsive\n\t * even while Angular change detection has not flushed yet.\n\t */\n\tprivate boardApi: Api | null = null;\n\t/**\n\t * Incremented whenever the board must be force-synchronized to the internal\n\t * chess.js position, even when the FEN string itself did not change (e.g.\n\t * after a rejected move that chessground already rendered). Tracked by\n\t * {@link boardConfig} to guarantee a fresh config is always pushed.\n\t */\n\tprivate boardSyncTick = signal(0);\n\n\t/** Whether the \"Analyze practice\" button should be offered (game not replaying). */\n\tpracticeAvailable = computed(() => !this.isReplaying());\n\t/** Evaluation shown on the evaluation bar: practice eval while practicing. */\n\tboardEvaluation = computed(() =>\n\t\tthis.practiceMode() ? this.practiceEvaluation() : this.currentEvaluation(),\n\t);\n\t/** Game result of the current practice position, or null while ongoing. */\n\tpracticeResult = computed<string | null>(() => {\n\t\tif (!this.practiceMode()) return null;\n\t\ttry {\n\t\t\tconst c = new Chess(this.currentFen());\n\t\t\tif (c.isCheckmate()) return c.turn() === 'w' ? '0-1' : '1-0';\n\t\t\tif (c.isStalemate() || c.isDraw()) return '1/2-1/2';\n\t\t} catch {\n\t\t\t/* ignore invalid positions */\n\t\t}\n\t\treturn null;\n\t});\n\t/** Game result displayed under the board (practice result while practicing). */\n\tdisplayGameResult = computed(() =>\n\t\tthis.practiceMode()\n\t\t\t? (this.practiceResult() ?? '*')\n\t\t\t: this.currentGameResult(),\n\t);\n\n\t/** Evaluation string per half-move, aligned with `moves`; `null` when unknown. */\n\tevaluations = signal<(string | null)[]>([]);\n\t/** Evaluation of the displayed move, or `null` before the first move. */\n\tcurrentEvaluation = computed(() => {\n\t\tconst evals = this.evaluations();\n\t\tconst index = this.currentMoveIndex();\n\t\treturn index >= 0 && index < evals.length ? evals[index] : null;\n\t});\n\n\t/** Cached-entry count and estimated size, or `null` while unknown. */\n\tcacheInfo = signal<{ count: number; estimatedBytes: number } | null>(null);\n\t/** PGN text shown in the load panel's textarea. */\n\tpgnInput = signal<string>('');\n\t/** Lichess archive year selected in the load panel (two-way). */\n\tlichessYear = model<number>(new Date().getFullYear());\n\t/** Lichess archive month selected in the load panel (two-way). */\n\tlichessMonth = model<number>(1);\n\t/**\n\t * PGN source URL shown in the load panel.\n\t *\n\t * Derived from the Lichess year/month picker, but writable so a user can\n\t * type or restore a custom URL — which is then preserved across later\n\t * picker changes. A `linkedSignal` (rather than an `effect` + flag) keeps\n\t * the derivation declarative and drops the mutable \"already synced\"\n\t * bookkeeping.\n\t */\n\turlInput = linkedSignal<{ year: number; month: number }, string>({\n\t\tsource: () => ({ year: this.lichessYear(), month: this.lichessMonth() }),\n\t\tcomputation: (next, previous) => resolveBroadcastUrl(next, previous?.value),\n\t});\n\n\t// Panel resize state\n\t/** Panel currently being dragged, or `null` when no drag is in progress. */\n\tprivate resizing: 'left' | 'right' | null = null;\n\t/** Pending animation frame for a panel drag, so moves are coalesced. */\n\tprivate resizeRafId: number | null = null;\n\t/** The element that establishes the panel widths; used to clamp resizing. */\n\tprivate readonly mainContentRef =\n\t\tviewChild<ElementRef<HTMLElement>>('mainContent');\n\n\t// ---- Internal state ----\n\t/** Authoritative game state; the board is rendered from this instance. */\n\tprivate chess = new Chess();\n\t/** Timers scheduled for the current replay sequence, cleared on stop. */\n\tprivate replayTimeouts: ReturnType<typeof setTimeout>[] = [];\n\t/** Resolver of the promise a batch replay is awaiting, or `null`. */\n\tprivate replayResolve: (() => void) | null = null;\n\t/** Whether a multi-game (batch) replay is in progress. */\n\tprivate isReplayingSequence = false;\n\t/** Correlation id of the newest filter request; stale replies are dropped. */\n\tprivate currentFilterId = 0;\n\t/** Correlation id of the newest `loadGame` request; stale replies are dropped. */\n\tprivate currentLoadGameId = 0;\n\t/** Whether the next filter result should replace the game selection. */\n\tprivate autoSelectOnFinish = false;\n\t/** Move prefix the active filter was applied with, replayed after a load. */\n\tprivate activeFilterMoves: string[] = [];\n\t/** Move index to restore when a position filter is cleared, or `null`. */\n\tprivate savedGameMoveIndex: number | null = null;\n\t/** Moves the user played on the board while composing a position filter. */\n\tprivate interactiveMoves = signal<string[]>([]);\n\t/** Pending request to turn off the opening-move filter after a load. */\n\tprivate shouldUncheckFilterMoves = false;\n\t/** Clock readings parsed from the PGN, one entry per half-move. */\n\tprivate clockHistory: { white: number; black: number }[] = [];\n\t/** Every timer this component owns, drained on destroy. */\n\tprivate readonly pendingTimeouts = new Set<ReturnType<typeof setTimeout>>();\n\t/**\n\t * Handle of an in-flight `requestIdleCallback` (filter-list aggregation),\n\t * cancelled on destroy so it cannot write to signals of a dead component.\n\t */\n\tprivate pendingIdleCallback: number | null = null;\n\n\t// ---- Persisted state ----\n\t/** State restored from a previous session, or `null` for a fresh session. */\n\tprivate persistedState: PersistedViewerState | null = null;\n\t/**\n\t * `false` until the durable state has been read. While it is `false` the\n\t * persist effect stays quiet, so the defaults cannot overwrite the saved\n\t * state before the desktop store has been hydrated.\n\t */\n\tprivate readonly stateHydrated = signal(false);\n\t/** Resolves once the durable state has been loaded. */\n\tprivate stateReady: Promise<void> = Promise.resolve();\n\n\t/**\n\t * Resolves once the persisted filter selection, Lichess source and cache\n\t * bookmarks are available.\n\t *\n\t * In the browser this is already the case when the component is created.\n\t * In the packaged desktop app the state is fetched from the local server,\n\t * so hosts should await this before loading data — otherwise the restored\n\t * archive URL is not known yet.\n\t */\n\twhenStateReady(): Promise<void> {\n\t\treturn this.stateReady;\n\t}\n\n\t// ---- Cached-source fast path ----\n\t/**\n\t * Source URL whose `loadFromCache` request is in flight. When the worker\n\t * answers `'cacheMiss'`, the download is started for this URL.\n\t */\n\tprivate pendingCacheSourceUrl: string | null = null;\n\t/** Correlation id of the in-flight `loadFromCache` request. */\n\tprivate currentCacheLoadId = 0;\n\n\t/**\n\t * `true` when a previous session's viewer state was restored on startup.\n\t * Hosts can use this to reload the same data source before the persisted\n\t * filters are applied.\n\t */\n\tget restoredStateFromStorage(): boolean {\n\t\treturn this.persistedState !== null;\n\t}\n\n\t// ======================================================================\n\t// Computed — Run function for chessground\n\t// ======================================================================\n\n\t/**\n\t * Stable board factory: created once and never re-created afterwards, so the\n\t * Chessground instance is never torn down on position changes. All state\n\t * updates (fen, orientation, movable pieces, highlights) flow through the\n\t * {@link boardConfig} input instead, which reconfigures the live instance\n\t * in place — keeping drag & drop responsive and animations intact.\n\t */\n\trunFunction = computed<(el: HTMLElement) => Api>(() => {\n\t\t// Signal reads inside the returned closure are untracked by this\n\t\t// computed (they execute when the function is invoked), so the closure\n\t\t// identity stays stable across every position change.\n\t\treturn (el: HTMLElement) => {\n\t\t\tconst api = Chessground(el, {\n\t\t\t\tfen: this.currentFen(),\n\t\t\t\torientation: this.flipped() ? 'black' : 'white',\n\t\t\t});\n\t\t\t// Stash the live API so practice moves can push the committed\n\t\t\t// position synchronously (see pushBoardNow) without waiting for\n\t\t\t// Angular's change-detection round trip.\n\t\t\tthis.boardApi = api;\n\t\t\treturn api;\n\t\t};\n\t});\n\n\t/**\n\t * Complete board state passed to the board component and applied to the\n\t * live Chessground instance via `Api.set()` on every change.\n\t */\n\tboardConfig = computed<Partial<Config>>(() => {\n\t\t// Force-sync requests: tracking this signal guarantees a fresh config\n\t\t// object is pushed to the board even when the FEN is unchanged, so the\n\t\t// board can always be snapped back to the chess.js position.\n\t\tthis.boardSyncTick();\n\t\tconst fen = this.currentFen();\n\t\tconst practice = this.practiceMode();\n\t\tconst isEditable = this.filterMoves() || practice;\n\t\t// Keep chessground's turnColor in sync with the FEN so check\n\t\t// highlighting and turn-dependent behavior (only the side to move is\n\t\t// draggable while filtering or practicing) follow the actual position.\n\t\tconst fenParts = fen.split(' ');\n\t\tconst turnColor = (fenParts[1] === 'w' ? 'white' : 'black') as\n\t\t\t| 'white'\n\t\t\t| 'black';\n\t\t// In practice mode the game ends at checkmate/stalemate: dragging and\n\t\t// click-moves are disabled so pieces cannot be picked up and dropped\n\t\t// back uselessly.\n\t\tconst practiceOver = this.practiceMode() && this.practiceResult() !== null;\n\t\t// Derive check from the displayed FEN (the internal chess instance can\n\t\t// lag behind during PV previews / auto-played lines).\n\t\tlet check = false;\n\t\ttry {\n\t\t\tcheck = new Chess(fen).inCheck();\n\t\t} catch {\n\t\t\t/* ignore invalid positions */\n\t\t}\n\t\treturn {\n\t\t\tfen,\n\t\t\tturnColor,\n\t\t\torientation: this.flipped() ? 'black' : 'white',\n\t\t\t// NOTE: never set `viewOnly`. Chessground (re)binds its drag\n\t\t\t// listeners only inside `redrawAll()` — which an orientation flip\n\t\t\t// triggers — honoring the viewOnly value at that moment. Flipping\n\t\t\t// the board while in replay mode (viewOnly) would therefore drop\n\t\t\t// the listeners, and entering practice mode afterwards reconfigures\n\t\t\t// in place without re-binding them, leaving drag & drop dead until\n\t\t\t// the next flip. Gate interactivity through movable/draggable/\n\t\t\t// selectable instead, which are re-applied on every config push.\n\t\t\tlastMove: this.lastMoveSquares(),\n\t\t\tcheck,\n\t\t\taddPieceZIndex: this.in3d(),\n\t\t\tpremovable: { enabled: false },\n\t\t\tdraggable: { showGhost: true, enabled: isEditable && !practiceOver },\n\t\t\tselectable: { enabled: isEditable && !practiceOver },\n\t\t\tmovable: {\n\t\t\t\tfree: false,\n\t\t\t\tcolor: practice ? turnColor : isEditable ? 'both' : undefined,\n\t\t\t\tdests: isEditable ? this.getMovableDests() : undefined,\n\t\t\t\tshowDests: isEditable,\n\t\t\t\tevents: {\n\t\t\t\t\tafter: (orig, dest) => {\n\t\t\t\t\t\tif (isEditable) this.handleBoardMove(orig, dest);\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// Construction\n\t// ======================================================================\n\n\t/**\n\t * Wires the engine callbacks, restores the persisted session, and keeps the\n\t * URL field and durable state in sync with the filters.\n\t */\n\tconstructor() {\n\t\tthis.pgnViewerEngine.initialize({\n\t\t\tonPgnMessage: (data) => this.handleWorkerMessage(data),\n\t\t\tonStockfishMessage: (event) => this.handleStockfishMessage(event),\n\t\t\tonError: (message, error) =>\n\t\t\t\tthis.reportLoadFailure('ENGINE_FAILED', message, error),\n\t\t});\n\n\t\t// Restore the previous session (filter selection + Lichess data source)\n\t\t// before defaults are applied, so a restart resumes where the user left off.\n\t\t// In the browser this is synchronous (localStorage); in the desktop app the\n\t\t// durable state lives on disk behind the local server, so `stateReady`\n\t\t// resolves once the snapshot has been fetched.\n\t\tconst defaults = this.previousMonthDefaults();\n\t\tconst persisted = this.pgnViewerSettings.load();\n\t\tif (persisted) {\n\t\t\tthis.persistedState = persisted;\n\t\t\tthis.applyPersistedState(persisted, defaults);\n\t\t} else {\n\t\t\tthis.lichessYear.set(defaults.year);\n\t\t\tthis.lichessMonth.set(defaults.month);\n\t\t}\n\t\tthis.stateReady = this.hydratePersistedState(defaults);\n\n\t\teffect(() => {\n\t\t\t// Persist the selection on every change so exiting the application\n\t\t\t// never loses the applied filters or the loaded database. On desktop\n\t\t\t// the durable store is fetched asynchronously, so wait for hydration\n\t\t\t// first — otherwise the defaults would overwrite the saved state.\n\t\t\tconst state = this.buildPersistedState();\n\t\t\tif (!this.stateHydrated()) return;\n\t\t\tthis.pgnViewerSettings.save(state);\n\t\t});\n\n\t\teffect(() => {\n\t\t\tconst pgn = this.pgn();\n\t\t\tif (pgn) this.loadPgnString(pgn);\n\t\t});\n\t}\n\n\t/** Releases timers, workers and DOM state owned by the viewer. */\n\tngOnDestroy(): void {\n\t\tthis.stopReplay();\n\t\tthis.stopResize();\n\t\tthis.pgnViewerEngine.dispose();\n\t\tfor (const t of this.pendingTimeouts) clearTimeout(t);\n\t\tthis.pendingTimeouts.clear();\n\t\tif (this.pendingIdleCallback !== null) {\n\t\t\tcancelIdleCallback(this.pendingIdleCallback);\n\t\t\tthis.pendingIdleCallback = null;\n\t\t}\n\t}\n\n\t// ======================================================================\n\t// Public methods used by template\n\t// ======================================================================\n\n\t/** Flips the board orientation. */\n\tprotected flipBoard(): void {\n\t\tthis.flipped.update((v) => !v);\n\t}\n\t/** Toggles between flat SVG pieces and 3D Staunton pieces. */\n\tprotected toggle3d(): void {\n\t\tthis.in3d.update((v) => !v);\n\t}\n\t/** Begins a panel drag, locking the cursor for its duration. */\n\tprotected startResize(side: 'left' | 'right', event: MouseEvent): void {\n\t\tevent.preventDefault();\n\t\tthis.resizing = side;\n\t\tdocument.body.style.cursor = 'col-resize';\n\t\tdocument.body.style.userSelect = 'none';\n\t}\n\t/** Applies a panel drag, clamped to 200px minimum and 45% of the container. */\n\tprotected onResizeMove(event: MouseEvent): void {\n\t\tif (!this.resizing || this.resizeRafId !== null) return;\n\t\tconst container = this.mainContentRef()?.nativeElement;\n\t\tif (!container) return;\n\t\tthis.resizeRafId = requestAnimationFrame(() => {\n\t\t\tthis.resizeRafId = null;\n\t\t\tconst rect = container.getBoundingClientRect();\n\t\t\tconst minW = 200;\n\t\t\tconst maxW = Math.floor(rect.width * 0.45);\n\t\t\tif (this.resizing === 'left') {\n\t\t\t\tconst w = Math.min(\n\t\t\t\t\tmaxW,\n\t\t\t\t\tMath.max(minW, Math.round(event.clientX - rect.left)),\n\t\t\t\t);\n\t\t\t\tthis.leftPanelWidth.set(w);\n\t\t\t} else {\n\t\t\t\tconst w = Math.min(\n\t\t\t\t\tmaxW,\n\t\t\t\t\tMath.max(minW, Math.round(rect.right - event.clientX)),\n\t\t\t\t);\n\t\t\t\tthis.rightPanelWidth.set(w);\n\t\t\t}\n\t\t});\n\t}\n\t/** Ends a panel drag and restores the cursor and text selection. */\n\tprotected stopResize(): void {\n\t\tthis.resizing = null;\n\t\tif (this.resizeRafId !== null) {\n\t\t\tcancelAnimationFrame(this.resizeRafId);\n\t\t\tthis.resizeRafId = null;\n\t\t}\n\t\tdocument.body.style.cursor = '';\n\t\tdocument.body.style.userSelect = '';\n\t}\n\n\t// ---- Game navigation ----\n\t/** Requests the full move data for the game at `index` from the worker. */\n\tprotected loadGame(index: number): void {\n\t\tconst count = this.gamesMetadata().length;\n\t\tif (index >= 0 && index < count) {\n\t\t\tthis.clearPracticeState();\n\t\t\tthis.currentGameIndex.set(index);\n\t\t\tthis.moves.set([]);\n\t\t\tthis.evaluations.set([]);\n\t\t\tthis.moveClocks.set([]);\n\t\t\tthis.pgnInput.set('Loading...');\n\t\t\tthis.isLoading.set(true);\n\t\t\tthis.currentLoadGameId++;\n\t\t\tthis.pgnViewerEngine.loadGame(index, this.currentLoadGameId);\n\t\t}\n\t}\n\t/** Moves to the next game in the current navigation order. */\n\tprotected nextGame(): void {\n\t\tconst nav = this.navigationIndices();\n\t\tconst pos = nav.indexOf(this.currentGameIndex());\n\t\tif (pos >= 0 && pos < nav.length - 1) this.loadGame(nav[pos + 1]);\n\t}\n\t/** Moves to the previous game in the current navigation order. */\n\tprotected prevGame(): void {\n\t\tconst nav = this.navigationIndices();\n\t\tconst pos = nav.indexOf(this.currentGameIndex());\n\t\tif (pos > 0) this.loadGame(nav[pos - 1]);\n\t}\n\t/** Game indices the prev/next controls step through (selection-aware). */\n\tprivate navigationIndices = computed(() => {\n\t\tconst indices = this.filteredGamesIndices();\n\t\tconst selected = this.selectedGames();\n\t\treturn selected.size > 0 ? indices.filter((i) => selected.has(i)) : indices;\n\t});\n\t/** Whether a previous game exists in the current navigation order. */\n\tcanGoPrev = computed(() => {\n\t\tconst nav = this.navigationIndices();\n\t\tconst pos = nav.indexOf(this.currentGameIndex());\n\t\treturn pos > 0;\n\t});\n\t/** Whether a next game exists in the current navigation order. */\n\tcanGoNext = computed(() => {\n\t\tconst nav = this.navigationIndices();\n\t\tconst pos = nav.indexOf(this.currentGameIndex());\n\t\treturn pos >= 0 && pos < nav.length - 1;\n\t});\n\n\t// ---- Move navigation ----\n\t/** Replays the game from the start up to `index`; `-1` is the start position. */\n\tprotected jumpToMove(index: number): void {\n\t\tthis.exitPractice();\n\t\tconst moves = this.moves();\n\t\tif (index >= -1 && index < moves.length) {\n\t\t\tthis.chess.reset();\n\t\t\tfor (let i = 0; i <= index; i++) this.chess.move(moves[i]);\n\t\t\tthis.currentMoveIndex.set(index);\n\t\t\tthis.currentFen.set(this.chess.fen());\n\t\t\tconst clockIndex = index + 1;\n\t\t\tif (clockIndex >= 0 && clockIndex < this.clockHistory.length) {\n\t\t\t\tconst c = this.clockHistory[clockIndex];\n\t\t\t\tthis.whiteTimeRemaining.set(this.formatTime(c.white));\n\t\t\t\tthis.blackTimeRemaining.set(this.formatTime(c.black));\n\t\t\t}\n\t\t}\n\t}\n\t/** Advances one move, no-op in practice mode. */\n\tprotected next(): void {\n\t\tif (this.practiceMode()) return;\n\t\tconst moves = this.moves();\n\t\tconst idx = this.currentMoveIndex();\n\t\tif (idx < moves.length - 1) {\n\t\t\tconst next = moves[idx + 1];\n\t\t\tthis.chess.move(next);\n\t\t\tthis.currentMoveIndex.set(idx + 1);\n\t\t\tthis.currentFen.set(this.chess.fen());\n\t\t\tconst ci = idx + 2;\n\t\t\tif (ci < this.clockHistory.length) {\n\t\t\t\tconst c = this.clockHistory[ci];\n\t\t\t\tthis.whiteTimeRemaining.set(this.formatTime(c.white));\n\t\t\t\tthis.blackTimeRemaining.set(this.formatTime(c.black));\n\t\t\t}\n\t\t}\n\t}\n\t/** Steps back one move, no-op in practice mode. */\n\tprotected prev(): void {\n\t\tif (this.practiceMode()) return;\n\t\tif (this.currentMoveIndex() >= 0) {\n\t\t\tthis.chess.undo();\n\t\t\tthis.currentMoveIndex.update((i) => i - 1);\n\t\t\tthis.currentFen.set(this.chess.fen());\n\t\t\tconst ci = this.currentMoveIndex() + 1;\n\t\t\tif (ci >= 0 && ci < this.clockHistory.length) {\n\t\t\t\tconst c = this.clockHistory[ci];\n\t\t\t\tthis.whiteTimeRemaining.set(this.formatTime(c.white));\n\t\t\t\tthis.blackTimeRemaining.set(this.formatTime(c.black));\n\t\t\t}\n\t\t}\n\t}\n\t/** Jumps to the start position of the loaded game. */\n\tprotected start(): void {\n\t\tif (this.practiceMode()) return;\n\t\tthis.chess.reset();\n\t\tthis.currentMoveIndex.set(-1);\n\t\tthis.currentFen.set(this.chess.fen());\n\t\tif (this.clockHistory.length > 0) {\n\t\t\tconst c = this.clockHistory[0];\n\t\t\tthis.whiteTimeRemaining.set(this.formatTime(c.white));\n\t\t\tthis.blackTimeRemaining.set(this.formatTime(c.black));\n\t\t}\n\t}\n\t/** Jumps to the final position of the loaded game. */\n\tprotected end(): void {\n\t\tif (this.practiceMode()) return;\n\t\tthis.chess.reset();\n\t\tfor (const m of this.moves()) this.chess.move(m);\n\t\tthis.currentMoveIndex.set(this.moves().length - 1);\n\t\tthis.currentFen.set(this.chess.fen());\n\t\tif (this.clockHistory.length > 0) {\n\t\t\tconst c = this.clockHistory[this.clockHistory.length - 1];\n\t\t\tthis.whiteTimeRemaining.set(this.formatTime(c.white));\n\t\t\tthis.blackTimeRemaining.set(this.formatTime(c.black));\n\t\t}\n\t}\n\n\t// ---- Filter actions ----\n\t/** Sends the current filter selection to the worker. */\n\tprotected applyFilter(): void {\n\t\tthis.stopReplay();\n\t\tthis.exitPractice();\n\t\tthis.isReplayingSequence = false;\n\t\tthis.showAllGames.set(false);\n\t\tthis.showBetterMoveBtn.set(false);\n\t\tthis.analysisVisible.set(false);\n\n\t\tconst fMoves = this.filterMoves();\n\t\tconst currentMoves = fMoves\n\t\t\t? this.interactiveMoves()\n\t\t\t: this.moves().slice(0, this.currentMoveIndex() + 1);\n\t\tthis.activeFilterMoves = currentMoves;\n\t\tthis.autoSelectOnFinish = true;\n\n\t\tthis.currentFilterId++;\n\t\tconst id = this.currentFilterId;\n\t\tthis.isFiltering.set(true);\n\n\t\tconst fc: FilterCriteria = {\n\t\t\twhite: this.filterWhite(),\n\t\t\tblack: this.filterBlack(),\n\t\t\tresult: this.filterResult().join(','),\n\t\t\tmoves: fMoves,\n\t\t\tignoreColor: this.ignoreColor(),\n\t\t\tminWhiteRating: this.filterRatingEnabled()\n\t\t\t\t? parseInt(this.filterWhiteRating(), 10) || 0\n\t\t\t\t: 0,\n\t\t\tminBlackRating: this.filterRatingEnabled()\n\t\t\t\t? parseInt(this.filterBlackRating(), 10) || 0\n\t\t\t\t: 0,\n\t\t\tmaxWhiteRating: this.filterRatingEnabled()\n\t\t\t\t? parseInt(this.filterWhiteRatingMax(), 10) || 0\n\t\t\t\t: 0,\n\t\t\tmaxBlackRating: this.filterRatingEnabled()\n\t\t\t\t? parseInt(this.filterBlackRatingMax(), 10) || 0\n\t\t\t\t: 0,\n\t\t\teco: this.filterEco(),\n\t\t\ttimeControl: this.filterTimeControl(),\n\t\t\tevent: this.filterEvent(),\n\t\t\tbroadcastName: this.filterBroadcastName(),\n\t\t\ttargetMoves: currentMoves,\n\t\t\tfilterByFen: this.filterByFenEnabled(),\n\t\t\ttargetFen: this.filterFen(),\n\t\t\tsortAscending: this.sortAscending(),\n\t\t\tupsetEnabled: this.filterUpsetEnabled(),\n\t\t\tupsetWin: this.filterUpsetWin(),\n\t\t\tupsetDraw: this.filterUpsetDraw(),\n\t\t\tminUpsetEloDiff: this.filterUpsetEnabled()\n\t\t\t\t? parseInt(this.filterUpsetMinDiff(), 10) || 0\n\t\t\t\t: 0,\n\t\t};\n\t\tthis.pgnViewerEngine.filterGames(fc, id);\n\n\t\tif (fMoves) this.shouldUncheckFilterMoves = true;\n\t}\n\n\t/** Resets every filter to its default and re-applies them. */\n\tprotected clearFilters(): void {\n\t\tthis.stopReplay();\n\t\tthis.isReplayingSequence = false;\n\t\tthis.showBetterMoveBtn.set(false);\n\t\tthis.analysisVisible.set(false);\n\t\tthis.showAllGames.set(false);\n\n\t\tconst hadFilterMoves = this.filterMoves();\n\t\tthis.filterWhite.set('');\n\t\tthis.filterBlack.set('');\n\t\tthis.filterResult.set([]);\n\t\tthis.filterMoves.set(false);\n\t\tthis.ignoreColor.set(false);\n\t\tthis.filterUpsetEnabled.set(false);\n\t\tthis.filterUpsetWin.set(false);\n\t\tthis.filterUpsetDraw.set(false);\n\t\tthis.filterUpsetMinDiff.set('300');\n\t\tthis.filterRatingEnabled.set(false);\n\t\tthis.filterWhiteRating.set('2000');\n\t\tthis.filterBlackRating.set('2000');\n\t\tthis.filterWhiteRatingMax.set('4000');\n\t\tthis.filterBlackRatingMax.set('4000');\n\t\tthis.filterEco.set('');\n\t\tthis.filterTimeControl.set([]);\n\t\tthis.filterEvent.set('');\n\t\tthis.filterBroadcastName.set('');\n\t\tthis.filterFen.set('');\n\t\tthis.filterByFenEnabled.set(false);\n\t\tthis.interactiveMoves.set([]);\n\t\tthis.activeFilterMoves = [];\n\t\tif (hadFilterMoves && this.savedGameMoveIndex !== null) {\n\t\t\tthis.jumpToMove(this.savedGameMoveIndex);\n\t\t\tthis.savedGameMoveIndex = null;\n\t\t}\n\t\tthis.applyFilter();\n\t}\n\n\t/** Reverses the game-list sort direction. */\n\tprotected toggleSortDirection(): void {\n\t\tthis.sortAscending.update((v) => !v);\n\t}\n\t/** Adds or removes one game from the batch-operation selection. */\n\tprotected toggleGameSelection(index: number): void {\n\t\tconst s = new Set(this.selectedGames());\n\t\tif (s.has(index)) {\n\t\t\ts.delete(index);\n\t\t} else {\n\t\t\ts.add(index);\n\t\t}\n\t\tthis.selectedGames.set(s);\n\t}\n\n\t// ---- Replay ----\n\t/** Starts auto-replay of the loaded game from its first move. */\n\tprotected replayGame(): void {\n\t\tthis.exitPractice();\n\t\tthis.stopReplay();\n\t\tthis.start();\n\t\tthis.runReplayLogic();\n\t}\n\t/** Resumes a paused replay from the displayed position. */\n\tprotected continueReplay(): void {\n\t\tthis.exitPractice();\n\t\tthis.stopReplay(false);\n\t\tthis.runReplayLogic();\n\t}\n\t/** Cancels a batch replay across multiple games. */\n\tprotected stopSequence(): void {\n\t\tthis.isReplayingSequence = false;\n\t\tthis.stopReplay();\n\t}\n\t/**\n\t * Stops the active replay and cancels its pending move timers.\n\t *\n\t * @param resolvePromise — When `true`, resolves the promise a caller may be\n\t *   awaiting from `replayAllSelectedGames`.\n\t */\n\tstopReplay(resolvePromise = true): void {\n\t\tthis.isReplaying.set(false);\n\t\tthis.replayTimeouts.forEach((t) => {\n\t\t\tclearTimeout(t);\n\t\t\tthis.pendingTimeouts.delete(t);\n\t\t});\n\t\tthis.replayTimeouts = [];\n\t\tif (resolvePromise && this.replayResolve) {\n\t\t\tthis.replayResolve();\n\t\t\tthis.replayResolve = null;\n\t\t}\n\t}\n\t/** Replays each selected game in turn, stopping early if the user cancels. */\n\tasync replayAllSelectedGames(): Promise<void> {\n\t\tthis.stopReplay();\n\t\tthis.isReplayingSequence = true;\n\t\tconst selectedSet = this.selectedGames();\n\t\tconst selected = this.filteredGamesIndices().filter((i) =>\n\t\t\tselectedSet.has(i),\n\t\t);\n\t\tif (selected.length === 0) {\n\t\t\tthis.showMessage('No games selected. Please select games to replay.');\n\t\t\treturn;\n\t\t}\n\t\tfor (let i = 0; i < selected.length; i++) {\n\t\t\tif (!this.isReplayingSequence) break;\n\t\t\tthis.loadGame(selected[i]);\n\t\t\tawait new Promise((r) => setTimeout(r, 100));\n\t\t\tawait this.replayGameAsync();\n\t\t\tif (i < selected.length - 1)\n\t\t\t\tawait new Promise((r) => setTimeout(r, 2000));\n\t\t}\n\t}\n\n\t// ---- Stockfish analysis ----\n\t/** Sends `fen` to Stockfish at the configured depth. */\n\tprotected analyzePosition(fen: string): void {\n\t\tif (!this.pgnViewerEngine.analyzePosition(fen, this.stockfishDepth()))\n\t\t\treturn;\n\t\tthis.isAnalyzing.set(true);\n\t\tthis.allAlternatives.set([]);\n\t\tthis.currentAlternativeIndex.set(0);\n\t\t// Discard any PV lines still buffered from a previous (possibly\n\t\t// aborted) search so they cannot be published with the new result.\n\t\tthis.pendingAlternatives.clear();\n\t\tthis.autoplayCompleted.set(false);\n\t\tthis.analysisVisible.set(true);\n\t}\n\t/** Plays out the engine's principal variation on the board. */\n\tprotected autoplayBestLine(): void {\n\t\tconst info = this.bestMoveInfo();\n\t\tif (!info?.pv?.length) return;\n\t\tthis.autoplayCompleted.set(false);\n\t\t(async () => {\n\t\t\tfor (const move of info.pv) {\n\t\t\t\tthis.currentFen.set(move.fen);\n\t\t\t\tawait new Promise((r) => setTimeout(r, 1000));\n\t\t\t}\n\t\t\tthis.autoplayCompleted.set(true);\n\t\t})();\n\t}\n\t/** Cycle to the next-best engine move in the current analysis. */\n\tprotected nextBestMove(): void {\n\t\tconst alts = this.allAlternatives();\n\t\tconst idx = this.currentAlternativeIndex();\n\t\tif (idx < alts.length - 1) {\n\t\t\tthis.currentAlternativeIndex.set(idx + 1);\n\t\t}\n\t}\n\t/** Cycle to the previous engine move in the current analysis. */\n\tprotected prevBestMove(): void {\n\t\tconst idx = this.currentAlternativeIndex();\n\t\tif (idx > 0) this.currentAlternativeIndex.set(idx - 1);\n\t}\n\t/** Re-analyze the board position currently displayed. */\n\tprotected reevaluatePosition(): void {\n\t\tthis.analyzedFen = this.currentFen();\n\t\tthis.analyzePosition(this.currentFen());\n\t}\n\t/** Shows a principal-variation position without committing a move. */\n\tprotected previewPvMove(fen: string): void {\n\t\tthis.currentFen.set(fen);\n\t}\n\t/** Shows or hides the analysis panel, starting analysis on first open. */\n\tprotected toggleAnalysis(): void {\n\t\t// \"Show Better Move\" is exclusive with practice mode: opening it shows\n\t\t// the better-move panel and closes the practice panel.\n\t\tthis.exitPractice();\n\t\tconst wasVisible = this.analysisVisible();\n\t\tthis.analysisVisible.update((v) => !v);\n\t\t// Start Stockfish analysis when the analysis panel is being opened\n\t\tif (!wasVisible && this.analyzedFen) {\n\t\t\tthis.analyzePosition(this.analyzedFen);\n\t\t}\n\t}\n\n\t// ---- Practice mode ----\n\t/**\n\t * Enters practice mode: turn-based play starting from the currently\n\t * displayed position, with continuous Stockfish analysis.\n\t */\n\tprotected startPractice(): void {\n\t\tif (this.practiceMode() || this.isReplaying()) return;\n\t\t// Practice mode is exclusive with the \"Show Better Move\" analysis panel.\n\t\tthis.showBetterMoveBtn.set(false);\n\t\tthis.analysisVisible.set(false);\n\t\t// Rebuild the internal chess instance from the displayed position so\n\t\t// PV previews / auto-played lines are reflected in the game state.\n\t\ttry {\n\t\t\tthis.chess = new Chess(this.currentFen());\n\t\t} catch {\n\t\t\tthis.chess = new Chess();\n\t\t}\n\t\tthis.practiceMode.set(true);\n\t\tthis.practiceStartFen.set(this.chess.fen());\n\t\tthis.practiceMoves.set([]);\n\t\tthis.practiceEvaluation.set(null);\n\t\tthis.currentFen.set(this.chess.fen());\n\t\tthis.analyzePracticePosition();\n\t}\n\n\t/** Leaves practice mode and restores the loaded game position. */\n\tprotected exitPractice(): void {\n\t\tif (!this.practiceMode()) return;\n\t\tthis.clearPracticeState();\n\t\tthis.restoreGamePosition();\n\t}\n\n\t/** Takes back the last practice move and re-analyzes the resulting position. */\n\tprotected undoPracticeMove(): void {\n\t\tif (!this.practiceMode()) return;\n\t\tif (!this.chess.undo()) return;\n\t\tthis.practiceMoves.update((moves) => moves.slice(0, -1));\n\t\tthis.practiceEvaluation.set(null);\n\t\tthis.currentFen.set(this.chess.fen());\n\t\tthis.analyzePracticePosition();\n\t}\n\n\t/** Restarts the practice session from the position where it started. */\n\tprotected restartPractice(): void {\n\t\tif (!this.practiceMode()) return;\n\t\ttry {\n\t\t\tthis.chess = new Chess(this.practiceStartFen());\n\t\t} catch {\n\t\t\tthis.chess = new Chess();\n\t\t}\n\t\tthis.practiceMoves.set([]);\n\t\tthis.practiceEvaluation.set(null);\n\t\tthis.currentFen.set(this.chess.fen());\n\t\tthis.analyzePracticePosition();\n\t}\n\n\t/** Re-analyzes the current practice position (e.g. after a depth change). */\n\tprotected reanalyzePracticePosition(): void {\n\t\tif (this.practiceMode()) this.analyzePracticePosition();\n\t}\n\n\t// ---- Practice export ----\n\t/** Copies the current practice position as a FEN string. */\n\tasync copyPracticeFen(): Promise<void> {\n\t\tawait this.copyTextToClipboard(\n\t\t\tthis.currentFen(),\n\t\t\t'FEN copied to clipboard.',\n\t\t);\n\t}\n\t/** Copies the practice move list as SAN text. */\n\tasync copyPracticeMoves(): Promise<void> {\n\t\tawait this.copyTextToClipboard(\n\t\t\tthis.buildPracticeMoveText(),\n\t\t\t'Moves copied to clipboard.',\n\t\t);\n\t}\n\t/** Copies the practice session as PGN, including evaluation comments. */\n\tasync copyPracticePgn(): Promise<void> {\n\t\tawait this.copyTextToClipboard(\n\t\t\tthis.buildPracticePgn(),\n\t\t\t'PGN copied to clipboard.',\n\t\t);\n\t}\n\t/** Downloads the practice session as a PGN file. */\n\tprotected downloadPracticePgn(): void {\n\t\tconst pgn = this.buildPracticePgn();\n\t\tconst blob = new Blob([pgn], { type: 'application/x-chess-pgn' });\n\t\tconst url = URL.createObjectURL(blob);\n\t\tconst link = document.createElement('a');\n\t\tlink.href = url;\n\t\tlink.download = `practice-analysis-${this.formatPgnDate()}.pgn`;\n\t\tdocument.body.appendChild(link);\n\t\tlink.click();\n\t\tdocument.body.removeChild(link);\n\t\tURL.revokeObjectURL(url);\n\t}\n\n\t// ---- Load & Cache ----\n\t/**\n\t * Parses raw PGN text in the worker.\n\t *\n\t * @param pgn — Raw PGN text.\n\t * @param sourceUrl — When the text came from a URL, the URL is remembered\n\t * alongside the content hash so the next session can restore it from\n\t * IndexedDB without downloading and decompressing it again.\n\t */\n\tasync loadPgnString(pgn: string, sourceUrl?: string): Promise<void> {\n\t\tthis.beginLoad('Starting PGN parser...');\n\t\ttry {\n\t\t\tthis.lastPgnHash = await this.pgnCacheService.hashPgn(pgn);\n\t\t} catch {\n\t\t\t/* ignore */\n\t\t}\n\t\tif (sourceUrl && this.lastPgnHash) {\n\t\t\tthis.pgnCacheService.setSourceEntry(sourceUrl, {\n\t\t\t\tpgnHash: this.lastPgnHash,\n\t\t\t\tindexed: this.indexStartPositions(),\n\t\t\t\tmaxFenPlies: this.maxFenPlies(),\n\t\t\t\tcreatedAt: Date.now(),\n\t\t\t});\n\t\t}\n\t\tthis.pgnViewerEngine.loadPgn(\n\t\t\tpgn,\n\t\t\tDate.now(),\n\t\t\tthis.lastPgnHash ?? undefined,\n\t\t\tthis.indexStartPositions(),\n\t\t\tthis.maxFenPlies(),\n\t\t);\n\t}\n\n\t/** Resets per-collection state and marks a new load as in progress. */\n\tprivate beginLoad(status: string): void {\n\t\tthis.moves.set([]);\n\t\tthis.interactiveMoves.set([]);\n\t\tthis.currentMoveIndex.set(-1);\n\t\tthis.currentGameIndex.set(-1);\n\t\tthis.showAllGames.set(false);\n\t\tthis.currentFen.set(\n\t\t\t'rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1',\n\t\t);\n\t\tthis.isLoading.set(true);\n\t\tthis.loadingProgress.set(0);\n\t\tthis.loadingStatus.set(status);\n\t\tthis.lastPgnHash = null;\n\t\tthis.loadStarted.emit({ status });\n\t}\n\t/** Loads PGN text from the system clipboard. */\n\tasync loadFromClipboard(): Promise<void> {\n\t\ttry {\n\t\t\tconst text = await navigator.clipboard.readText();\n\t\t\tif (text) {\n\t\t\t\tthis.pgnInput.set(text);\n\t\t\t\tthis.loadPgnString(text);\n\t\t\t}\n\t\t} catch {\n\t\t\tthis.showMessage('Failed to read clipboard.', 5000, 'error');\n\t\t}\n\t}\n\t/** Copies the PGN text currently in the load panel. */\n\tasync copyToClipboard(): Promise<void> {\n\t\ttry {\n\t\t\tawait navigator.clipboard.writeText(this.pgnInput());\n\t\t} catch {\n\t\t\tthis.showMessage('Failed to copy to clipboard.', 5000, 'error');\n\t\t}\n\t}\n\t/** Loads the Lichess broadcast archive for the selected year and month. */\n\tasync loadFromLichess(): Promise<void> {\n\t\tconst year = this.lichessYear();\n\t\tconst month = this.lichessMonth();\n\t\tif (!year || !month) {\n\t\t\tthis.showMessage('Please select a valid year and month.');\n\t\t\treturn;\n\t\t}\n\t\tthis.urlInput.set(lichessBroadcastUrl(year, month));\n\t\tawait this.loadFromUrl();\n\t}\n\n\t/**\n\t * Loads a PGN source into the viewer.\n\t *\n\t * The single entry point for getting data in — it replaces the pattern of\n\t * writing to `urlInput`/`pgnInput` and then calling a no-argument loader.\n\t * The source is explicit at the call site, so a misconfigured load is a\n\t * type error rather than a silently ignored click.\n\t *\n\t * Awaits durable-state hydration internally, so hosts do not need to\n\t * sequence `whenStateReady()` before their first load. Failures are\n\t * reported through {@link loadFailed} and a user-facing notice; this method\n\t * does not reject.\n\t *\n\t * @example\n\t * ```typescript\n\t * await viewer.load({ kind: 'url', url: 'lichess/broadcast/…pgn.zst' });\n\t * await viewer.load({ kind: 'pgn', text: pgnString });\n\t * await viewer.load({ kind: 'file', file: input.files[0] });\n\t * ```\n\t */\n\tasync load(source: PgnSource, options?: LoadOptions): Promise<void> {\n\t\t// A load issued before hydration finishes would apply the persisted\n\t\t// filters to the wrong collection; wait for the state first.\n\t\tawait this.stateReady;\n\n\t\t// Apply the per-call overrides to the indexing signals up front. They\n\t\t// are read by every downstream path (cache usability, the worker\n\t\t// payload and the cache bookmark), so resolving them in one place both\n\t\t// honours the override and keeps the UI in sync with what was loaded.\n\t\tif (options?.indexStartPositions !== undefined) {\n\t\t\tthis.indexStartPositions.set(options.indexStartPositions);\n\t\t}\n\t\tif (options?.maxFenPlies !== undefined) {\n\t\t\tthis.maxFenPlies.set(options.maxFenPlies);\n\t\t}\n\n\t\tswitch (source.kind) {\n\t\t\tcase 'url': {\n\t\t\t\tif (!source.url) {\n\t\t\t\t\tthis.reportLoadFailure('INVALID_SOURCE', 'No URL provided.');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis.urlInput.set(source.url);\n\t\t\t\tawait this.loadFromUrl();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase 'pgn': {\n\t\t\t\tif (!source.text) {\n\t\t\t\t\tthis.reportLoadFailure('INVALID_SOURCE', 'No PGN text provided.');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis.pgnInput.set(source.text);\n\t\t\t\tawait this.loadPgnString(source.text, source.sourceUrl);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase 'file': {\n\t\t\t\tawait this.loadFile(source.file);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Whether a PGN source can be restored from the IndexedDB cache with the\n\t * current indexing options, without downloading it.\n\t *\n\t * Hosts can use this to skip network probes at startup before calling\n\t * {@link load}.\n\t */\n\tcanLoadFromCache(url: string): boolean {\n\t\tconst entry = this.pgnCacheService.getSourceEntry(url);\n\t\treturn entry !== null && this.isSourceCacheUsable(entry);\n\t}\n\n\t/**\n\t * Loads the URL currently in the URL field, preferring the parsed-game\n\t * cache over a fresh download. Prefer {@link load} at call sites.\n\t */\n\tasync loadFromUrl(): Promise<void> {\n\t\tconst url = this.urlInput();\n\t\tif (!url) return;\n\n\t\t// Fast path: a previous session already parsed this source. Ask the\n\t\t// worker to restore it straight from IndexedDB, so no download,\n\t\t// decompression or hashing is needed. A miss falls back to the normal\n\t\t// download path via the 'cacheMiss' worker response.\n\t\tconst cached = this.pgnCacheService.getSourceEntry(url);\n\t\tif (cached && this.isSourceCacheUsable(cached)) {\n\t\t\tthis.beginLoad('Loading from cache...');\n\t\t\tthis.pendingCacheSourceUrl = url;\n\t\t\tthis.currentCacheLoadId++;\n\t\t\tthis.pgnViewerEngine.loadFromCache(\n\t\t\t\tcached.pgnHash,\n\t\t\t\tthis.currentCacheLoadId,\n\t\t\t\tthis.indexStartPositions(),\n\t\t\t\tthis.maxFenPlies(),\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\tawait this.downloadFromUrl(url);\n\t}\n\n\t/**\n\t * Whether a remembered source entry can satisfy the current indexing\n\t * options. A caller that needs a FEN index cannot use an entry cached\n\t * without one (or with a shorter replay window).\n\t */\n\tprivate isSourceCacheUsable(entry: PgnSourceCacheEntry): boolean {\n\t\tif (!this.indexStartPositions()) return true;\n\t\treturn entry.indexed && entry.maxFenPlies >= this.maxFenPlies();\n\t}\n\n\t/** Downloads, decompresses and parses a PGN archive from a URL. */\n\tprivate async downloadFromUrl(url: string): Promise<void> {\n\t\tthis.isLoading.set(true);\n\t\tthis.loadingProgress.set(0);\n\t\tthis.loadingStatus.set('Starting download...');\n\t\ttry {\n\t\t\tconst response = await fetch(url);\n\t\t\tif (!response.ok)\n\t\t\t\tthrow new Error(`HTTP error! status: ${response.status} `);\n\t\t\tconst total = parseInt(response.headers.get('content-length') || '0', 10);\n\t\t\tif (!response.body) throw new Error('Response body is null');\n\t\t\tconst reader = response.body.getReader();\n\t\t\tconst chunks: Uint8Array[] = [];\n\t\t\tlet received = 0;\n\t\t\twhile (true) {\n\t\t\t\tconst { done, value } = await reader.read();\n\t\t\t\tif (done) break;\n\t\t\t\tchunks.push(value);\n\t\t\t\treceived += value.length;\n\t\t\t\tif (total > 0) {\n\t\t\t\t\tthis.loadingProgress.set(Math.round((received / total) * 100));\n\t\t\t\t\tthis.loadingStatus.set(\n\t\t\t\t\t\t`Downloading: ${(received / 1024 / 1024).toFixed(2)} MB / ${(total / 1024 / 1024).toFixed(2)} MB`,\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tthis.loadingStatus.set(\n\t\t\t\t\t\t`Downloading: ${(received / 1024 / 1024).toFixed(2)} MB`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst buffer = new Uint8Array(received);\n\t\t\tlet pos = 0;\n\t\t\tfor (const chunk of chunks) {\n\t\t\t\tbuffer.set(chunk, pos);\n\t\t\t\tpos += chunk.length;\n\t\t\t}\n\t\t\tthis.loadingStatus.set('Decompressing...');\n\t\t\tconst content = url.toLowerCase().endsWith('.zst')\n\t\t\t\t? new TextDecoder().decode(decompressZst(buffer))\n\t\t\t\t: new TextDecoder().decode(buffer);\n\t\t\tthis.loadingStatus.set('Processing games...');\n\t\t\tthis.setDeferredTimeout(() => {\n\t\t\t\tthis.loadPgnString(content, url);\n\t\t\t});\n\t\t} catch (e) {\n\t\t\tthis.reportLoadFailure(\n\t\t\t\t'DOWNLOAD_FAILED',\n\t\t\t\t`Error loading from URL: ${String(e)}`,\n\t\t\t\te,\n\t\t\t);\n\t\t}\n\t}\n\t/** Clears the worker's parsed-game cache and the URL bookmarks. */\n\tprotected clearPgnCache(): void {\n\t\tthis.pgnViewerEngine.clearCache(Date.now());\n\t\tthis.pgnCacheService.clearSourceEntries();\n\t\tthis.lastPgnHash = null;\n\t\tthis.cacheInfo.set(null);\n\t\tthis.showMessage('PGN cache cleared.');\n\t}\n\t/** Refreshes the cached-entry count and size shown in the load panel. */\n\tasync refreshCacheInfo(): Promise<void> {\n\t\tthis.cacheInfo.set(await this.pgnCacheService.getCacheInfo());\n\t}\n\t/** Surfaces a file-read failure reported by the load panel. */\n\tprotected onFileLoadFailed(message: string): void {\n\t\tthis.reportLoadFailure('PARSE_FAILED', message);\n\t}\n\t/** Handles a `.zip` chosen in the file picker. */\n\tprotected onPgnZipSelected(event: Event): void {\n\t\tconst input = event.target as HTMLInputElement;\n\t\tconst file = input.files?.[0];\n\t\tif (!file) return;\n\t\tvoid this.loadFile(file);\n\t}\n\n\t/**\n\t * Parses a user-selected `.pgn` or `.zip` file into the viewer.\n\t *\n\t * Shared by the file inputs and by {@link load}, so both paths report\n\t * failures identically instead of one of them silently resetting the\n\t * spinner.\n\t */\n\tasync loadFile(file: File): Promise<void> {\n\t\tthis.isLoading.set(true);\n\t\ttry {\n\t\t\tconst content = file.name.toLowerCase().endsWith('.zip')\n\t\t\t\t? await this.readPgnFromZip(file)\n\t\t\t\t: await file.text();\n\t\t\tif (!content) {\n\t\t\t\tthis.reportLoadFailure(\n\t\t\t\t\t'PARSE_FAILED',\n\t\t\t\t\t`No PGN content found in \"${file.name}\".`,\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tawait this.loadPgnString(content);\n\t\t} catch (error) {\n\t\t\tthis.reportLoadFailure(\n\t\t\t\t'PARSE_FAILED',\n\t\t\t\t`Could not read \"${file.name}\".`,\n\t\t\t\terror,\n\t\t\t);\n\t\t}\n\t}\n\n\t/** Extracts the first `.pgn` entry from a zip archive, if any. */\n\tprivate async readPgnFromZip(file: File): Promise<string | null> {\n\t\tconst zip = await loadZipAsync(file);\n\t\tconst pgnFile = Object.values(zip.files).find((f) =>\n\t\t\tf.name.toLowerCase().endsWith('.pgn'),\n\t\t);\n\t\treturn pgnFile ? pgnFile.async('string') : null;\n\t}\n\n\t/** Handles a `.pgn` chosen in the file picker. */\n\tprotected onPgnFileSelected(event: Event): void {\n\t\tconst input = event.target as HTMLInputElement;\n\t\tconst file = input.files?.[0];\n\t\tif (!file) return;\n\t\tvoid this.loadFile(file);\n\t}\n\n\t// ---- Snapshot position ----\n\t/** Copies the displayed position into the FEN filter and enables it. */\n\tprotected snapshotCurrentPosition(): void {\n\t\tthis.filterFen.set(this.currentFen());\n\t\tthis.filterByFenEnabled.set(true);\n\t}\n\n\t/** Safe text highlighting for typeahead. */\n\tprotected highlightText(text: string, query: string): TextSegment[] {\n\t\treturn highlightMatch(text, query);\n\t}\n\n\t/** Lookup ECO opening moves from the ECO_MOVES map. */\n\tprotected getOpeningMoves(code: string): string {\n\t\treturn ECO_MOVES[code] || '';\n\t}\n\n\t// ======================================================================\n\t// Private methods\n\t// ======================================================================\n\n\t/** Year/month of the most recent Lichess archive that may already exist. */\n\tprivate previousMonthDefaults(): { year: number; month: number } {\n\t\tconst now = new Date();\n\t\tconst prevMonth = new Date(now.getFullYear(), now.getMonth() - 1, 1);\n\t\treturn { year: prevMonth.getFullYear(), month: prevMonth.getMonth() + 1 };\n\t}\n\n\t/**\n\t * Loads the durable state and applies it.\n\t *\n\t * In the browser this only marks the state as hydrated (localStorage was\n\t * already read synchronously in the constructor). On desktop it waits for\n\t * the local server snapshot, then restores the saved source and filters.\n\t */\n\tprivate async hydratePersistedState(defaults: {\n\t\tyear: number;\n\t\tmonth: number;\n\t}): Promise<void> {\n\t\ttry {\n\t\t\tawait this.pgnViewerSettings.hydrate();\n\t\t\tawait this.pgnCacheService.hydrateSourceEntries();\n\t\t\tconst state = this.pgnViewerSettings.load();\n\t\t\tif (state) {\n\t\t\t\tthis.persistedState = state;\n\t\t\t\tthis.applyPersistedState(state, defaults);\n\t\t\t}\n\t\t} catch {\n\t\t\t// Storage unavailable — continue with the defaults.\n\t\t} finally {\n\t\t\tthis.stateHydrated.set(true);\n\t\t\tthis.stateRestored.emit();\n\t\t}\n\t}\n\n\t/** Applies a state restored from storage to the filter and source signals. */\n\tprivate applyPersistedState(\n\t\tstate: PersistedViewerState,\n\t\tdefaults: { year: number; month: number },\n\t): void {\n\t\tconst f = state.filters;\n\t\tthis.filterWhite.set(f.white);\n\t\tthis.filterBlack.set(f.black);\n\t\tthis.filterResult.set(f.result);\n\t\tthis.filterMoves.set(f.moves);\n\t\tthis.ignoreColor.set(f.ignoreColor);\n\t\tthis.filterUpsetEnabled.set(f.upsetEnabled);\n\t\tthis.filterUpsetWin.set(f.upsetWin);\n\t\tthis.filterUpsetDraw.set(f.upsetDraw);\n\t\tthis.filterUpsetMinDiff.set(f.upsetMinDiff);\n\t\tthis.filterRatingEnabled.set(f.ratingEnabled);\n\t\tthis.filterWhiteRating.set(f.whiteRating);\n\t\tthis.filterBlackRating.set(f.blackRating);\n\t\tthis.filterWhiteRatingMax.set(f.whiteRatingMax);\n\t\tthis.filterBlackRatingMax.set(f.blackRatingMax);\n\t\tthis.filterEco.set(f.eco);\n\t\tthis.filterTimeControl.set(f.timeControl);\n\t\tthis.filterEvent.set(f.event);\n\t\tthis.filterBroadcastName.set(f.broadcastName);\n\t\tthis.filterFen.set(f.fen);\n\t\tthis.filterByFenEnabled.set(f.byFenEnabled);\n\t\tthis.sortAscending.set(f.sortAscending);\n\n\t\tthis.lichessYear.set(\n\t\t\tstate.lichessYear > 0 ? state.lichessYear : defaults.year,\n\t\t);\n\t\tthis.lichessMonth.set(\n\t\t\tstate.lichessMonth >= 1 && state.lichessMonth <= 12\n\t\t\t\t? state.lichessMonth\n\t\t\t\t: defaults.month,\n\t\t);\n\t\tif (state.url) this.urlInput.set(state.url);\n\t}\n\n\t/** Snapshots the current filter selection and data source for persistence. */\n\tprivate buildPersistedState(): PersistedViewerState {\n\t\tconst filters: PersistedFilterState = {\n\t\t\twhite: this.filterWhite(),\n\t\t\tblack: this.filterBlack(),\n\t\t\tresult: this.filterResult(),\n\t\t\tmoves: this.filterMoves(),\n\t\t\tignoreColor: this.ignoreColor(),\n\t\t\tupsetEnabled: this.filterUpsetEnabled(),\n\t\t\tupsetWin: this.filterUpsetWin(),\n\t\t\tupsetDraw: this.filterUpsetDraw(),\n\t\t\tupsetMinDiff: this.filterUpsetMinDiff(),\n\t\t\tratingEnabled: this.filterRatingEnabled(),\n\t\t\twhiteRating: this.filterWhiteRating(),\n\t\t\tblackRating: this.filterBlackRating(),\n\t\t\twhiteRatingMax: this.filterWhiteRatingMax(),\n\t\t\tblackRatingMax: this.filterBlackRatingMax(),\n\t\t\teco: this.filterEco(),\n\t\t\ttimeControl: this.filterTimeControl(),\n\t\t\tevent: this.filterEvent(),\n\t\t\tbroadcastName: this.filterBroadcastName(),\n\t\t\tfen: this.filterFen(),\n\t\t\tbyFenEnabled: this.filterByFenEnabled(),\n\t\t\tsortAscending: this.sortAscending(),\n\t\t};\n\t\treturn {\n\t\t\tversion: PGN_VIEWER_STATE_VERSION,\n\t\t\turl: this.urlInput(),\n\t\t\tlichessYear: this.lichessYear(),\n\t\t\tlichessMonth: this.lichessMonth(),\n\t\t\tfilters,\n\t\t};\n\t}\n\n\t/**\n\t * Builds the distinct-value lists behind the filter dropdowns (players,\n\t * ECO, events, time controls, broadcasts) from freshly loaded metadata.\n\t */\n\tprivate buildFilterLists(metadata: GameMetadata[]): void {\n\t\tconst whitePlayerElos = new Map<string, number>();\n\t\tconst blackPlayerElos = new Map<string, number>();\n\t\tconst ecoCodes = new Map<string, number>();\n\t\tconst timeControls = new Map<\n\t\t\tstring,\n\t\t\t{ count: number; originals: Map<string, number> }\n\t\t>();\n\t\tconst events = new Map<string, number>();\n\t\tconst broadcastNames = new Map<string, number>();\n\n\t\tfor (const meta of metadata) {\n\t\t\tif (\n\t\t\t\tmeta.white &&\n\t\t\t\tmeta.white !== 'Unknown' &&\n\t\t\t\t!meta.white.startsWith('BOT ')\n\t\t\t) {\n\t\t\t\twhitePlayerElos.set(\n\t\t\t\t\tmeta.white,\n\t\t\t\t\tMath.max(whitePlayerElos.get(meta.white) || 0, meta.whiteElo || 0),\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (\n\t\t\t\tmeta.black &&\n\t\t\t\tmeta.black !== 'Unknown' &&\n\t\t\t\t!meta.black.startsWith('BOT ')\n\t\t\t) {\n\t\t\t\tblackPlayerElos.set(\n\t\t\t\t\tmeta.black,\n\t\t\t\t\tMath.max(blackPlayerElos.get(meta.black) || 0, meta.blackElo || 0),\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (meta.eco && !meta.eco.includes('?')) {\n\t\t\t\tecoCodes.set(meta.eco, (ecoCodes.get(meta.eco) || 0) + 1);\n\t\t\t}\n\t\t\tconst normalized = meta.timeControlNormalized;\n\t\t\tconst original = meta.timeControl?.trim();\n\t\t\tif (normalized) {\n\t\t\t\tconst existing = timeControls.get(normalized) || {\n\t\t\t\t\tcount: 0,\n\t\t\t\t\toriginals: new Map<string, number>(),\n\t\t\t\t};\n\t\t\t\texisting.count += 1;\n\t\t\t\tif (original)\n\t\t\t\t\texisting.originals.set(\n\t\t\t\t\t\toriginal,\n\t\t\t\t\t\t(existing.originals.get(original) || 0) + 1,\n\t\t\t\t\t);\n\t\t\t\ttimeControls.set(normalized, existing);\n\t\t\t}\n\t\t\tif (meta.event && !meta.event.includes('?')) {\n\t\t\t\tevents.set(meta.event, (events.get(meta.event) || 0) + 1);\n\t\t\t}\n\t\t\tif (meta.broadcastName && !meta.broadcastName.includes('?')) {\n\t\t\t\tbroadcastNames.set(\n\t\t\t\t\tmeta.broadcastName,\n\t\t\t\t\t(broadcastNames.get(meta.broadcastName) || 0) + 1,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tthis.uniqueWhitePlayers.set(\n\t\t\tArray.from(whitePlayerElos.entries())\n\t\t\t\t.sort((a, b) => b[1] - a[1])\n\t\t\t\t.map(([n]) => n),\n\t\t);\n\t\tthis.uniqueBlackPlayers.set(\n\t\t\tArray.from(blackPlayerElos.entries())\n\t\t\t\t.sort((a, b) => b[1] - a[1])\n\t\t\t\t.map(([n]) => n),\n\t\t);\n\t\tthis.uniqueEcoCodes.set(ecoCodes);\n\t\tthis.uniqueTimeControls.set(timeControls);\n\t\tthis.uniqueEvents.set(events);\n\t\tthis.uniqueBroadcastNames.set(broadcastNames);\n\t}\n\n\t/**\n\t * Legal destination map for the board's editable pieces.\n\t *\n\t * The map contains legal moves for the **side to move** only, so the user\n\t * can move whichever color the position dictates and never the other side.\n\t */\n\tprivate getMovableDests(): Map<Key, Key[]> {\n\t\tconst dests = new Map<Key, Key[]>();\n\t\tfor (const move of this.chess.moves({ verbose: true })) {\n\t\t\tconst from = move.from as Key;\n\t\t\tif (!dests.has(from)) dests.set(from, []);\n\t\t\tdests.get(from)?.push(move.to as Key);\n\t\t}\n\t\treturn dests;\n\t}\n\n\t/**\n\t * Applies a move made on the board while composing a position filter.\n\t *\n\t * Every path ends either committed or with the board re-synchronized to\n\t * chess.js, because chessground renders the drop before the app validates it.\n\t */\n\tprivate handleBoardMove(orig: string, dest: string): void {\n\t\tif (this.practiceMode()) {\n\t\t\tthis.handlePracticeMove(orig, dest);\n\t\t\treturn;\n\t\t}\n\t\ttry {\n\t\t\tconst move = this.chess.move({ from: orig, to: dest });\n\t\t\tif (move) {\n\t\t\t\tthis.currentFen.set(this.chess.fen());\n\t\t\t\tthis.interactiveMoves.update((m) => [...m, move.san]);\n\t\t\t\tif (this.filterByFenEnabled()) this.filterFen.set(this.chess.fen());\n\t\t\t\t// Push the committed position + destinations to the board right\n\t\t\t\t// away so consecutive drag & drop moves never see stale dests.\n\t\t\t\tthis.pushBoardNow();\n\t\t\t} else {\n\t\t\t\t// The move was rejected: snap the rendered board back to the\n\t\t\t\t// chess.js position (chessground already drew the drop).\n\t\t\t\tthis.forceBoardSync();\n\t\t\t}\n\t\t} catch {\n\t\t\tthis.forceBoardSync();\n\t\t}\n\t}\n\n\t/**\n\t * Applies a move played on the board during practice mode.\n\t *\n\t * Practice is turn-based: only the side to move may move, and only legal\n\t * moves are accepted. The move is applied directly to the internal chess.js\n\t * instance, which enforces both legality and turn alternation.\n\t *\n\t * Every path ends in exactly one of two states: the move is committed\n\t * (FEN update + re-analysis + immediate board push), or it is rejected and\n\t * the board is force-synchronized back to the chess.js position. The board\n\t * can therefore never stay desynchronized from chess.js — a desync makes\n\t * subsequent drag & drop moves silently fail.\n\t */\n\tprivate handlePracticeMove(orig: string, dest: string): void {\n\t\tif (!this.practiceMode()) return;\n\t\tlet piece: Piece | undefined;\n\t\ttry {\n\t\t\tpiece = this.chess.get(orig as Square);\n\t\t} catch {\n\t\t\tthis.forceBoardSync();\n\t\t\treturn;\n\t\t}\n\t\tif (!piece) {\n\t\t\t// The dropped square holds no piece in chess.js — the rendered\n\t\t\t// board is out of sync; snap it back to the truth.\n\t\t\tthis.forceBoardSync();\n\t\t\treturn;\n\t\t}\n\t\tconst isPromotion =\n\t\t\tpiece.type === 'p' && (dest.endsWith('8') || dest.endsWith('1'));\n\t\tif (isPromotion) {\n\t\t\t// The promotion dialog is modal; commit (or re-sync) once it closes.\n\t\t\tvoid this.promotionService\n\t\t\t\t.showPromotionDialog(piece.color === 'w' ? 'white' : 'black')\n\t\t\t\t.then((promotion) => {\n\t\t\t\t\t// The user may have exited practice mode while the dialog was open.\n\t\t\t\t\tif (!this.practiceMode()) {\n\t\t\t\t\t\tthis.forceBoardSync();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tconst move = this.applyPracticeMove(orig, dest, promotion);\n\t\t\t\t\tif (move) this.commitPracticeMove(move);\n\t\t\t\t\telse this.forceBoardSync();\n\t\t\t\t})\n\t\t\t\t.catch(() => {\n\t\t\t\t\t// The dialog failed to open/close: revert the rendered drop.\n\t\t\t\t\tthis.forceBoardSync();\n\t\t\t\t});\n\t\t} else {\n\t\t\tconst move = this.applyPracticeMove(orig, dest, undefined);\n\t\t\tif (move) this.commitPracticeMove(move);\n\t\t\telse this.forceBoardSync();\n\t\t}\n\t}\n\n\t/**\n\t * Commits an applied practice move: updates the FEN, appends the move to\n\t * the session list and triggers re-analysis of the new position.\n\t */\n\tprivate commitPracticeMove(move: Move): void {\n\t\tthis.currentFen.set(this.chess.fen());\n\t\tthis.practiceMoves.update((moves) => [\n\t\t\t...moves,\n\t\t\t{ san: move.san, evaluation: null },\n\t\t]);\n\t\tthis.practiceEvaluation.set(null);\n\t\tthis.analyzePracticePosition();\n\t\t// Push the committed position + destinations to the board right away\n\t\t// so consecutive drag & drop moves never see stale dests.\n\t\tthis.pushBoardNow();\n\t}\n\n\t/**\n\t * Force-pushes the chess.js position to the board, even when the FEN string\n\t * did not change, healing any desync between chessground's rendered state\n\t * and chess.js (chessground applies a drop to its own state before the app\n\t * validates it — a rejected drop must be explicitly reverted).\n\t */\n\tprivate forceBoardSync(): void {\n\t\tthis.currentFen.set(this.chess.fen());\n\t\tthis.boardSyncTick.update((v) => v + 1);\n\t\t// Also synchronize the live instance immediately instead of waiting for\n\t\t// Angular's change-detection round trip.\n\t\tthis.pushBoardNow();\n\t}\n\n\t/**\n\t * Synchronously pushes the current chess.js position and legal move\n\t * destinations to the live chessground instance.\n\t *\n\t * chessground clears `movable.dests` after every user drop and only\n\t * re-receives them once the `after` callback plus Angular change detection\n\t * have run. This immediate push closes that window, so rapid consecutive\n\t * drag & drop moves are never rejected.\n\t */\n\tprivate pushBoardNow(): void {\n\t\tif (!this.boardApi) return;\n\t\t// Invalidate chessground's cached board bounds: the board may have\n\t\t// moved due to a layout shift that fires no scroll/resize event, and\n\t\t// stale bounds make every subsequent drag map to the wrong square.\n\t\tthis.boardApi.state.dom.bounds.clear();\n\t\tconst fen = this.chess.fen();\n\t\tconst practice = this.practiceMode();\n\t\tconst turnColor = fen.split(' ')[1] === 'w' ? 'white' : 'black';\n\t\tthis.boardApi.set({\n\t\t\tfen,\n\t\t\tturnColor,\n\t\t\tmovable: {\n\t\t\t\tfree: false,\n\t\t\t\tcolor: practice ? turnColor : 'both',\n\t\t\t\tdests: this.getMovableDests(),\n\t\t\t\tshowDests: true,\n\t\t\t},\n\t\t});\n\t}\n\n\t/**\n\t * Applies a practice move for the side to move: rejects moves by the other\n\t * side, then lets chess.js validate legality and turn alternation in place.\n\t * Returns the made move, or null when the move is not allowed.\n\t */\n\tprivate applyPracticeMove(\n\t\torig: string,\n\t\tdest: string,\n\t\tpromotion: 'q' | 'r' | 'b' | 'n' | undefined,\n\t): Move | null {\n\t\ttry {\n\t\t\tconst piece = this.chess.get(orig as Square);\n\t\t\t// Only the side to move may move: reject the other color outright.\n\t\t\tif (!piece || piece.color !== this.chess.turn()) return null;\n\t\t\treturn this.chess.move({ from: orig, to: dest, promotion });\n\t\t} catch {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\t/** Starts Stockfish analysis of the current practice position. */\n\tprivate analyzePracticePosition(): void {\n\t\tif (!this.practiceMode()) return;\n\t\tconst fen = this.chess.fen();\n\t\t// Keep the practice analysis FEN separate from analyzedFen so the\n\t\t// \"Show Better Move\" flow keeps its own position.\n\t\tthis.practiceAnalysisFen = fen;\n\t\t// Drop any pending PV lines so a bestmove flushed by the 'stop' of the\n\t\t// previous search cannot be mistaken for the new position's result.\n\t\tthis.pendingAlternatives.clear();\n\t\tthis.analyzePosition(fen);\n\t}\n\n\t/** Clears practice state without touching the chess instance. */\n\tprivate clearPracticeState(): void {\n\t\tthis.practiceMode.set(false);\n\t\tthis.practiceStartFen.set('');\n\t\tthis.practiceMoves.set([]);\n\t\tthis.practiceEvaluation.set(null);\n\t\tthis.practiceAnalysisFen = null;\n\t}\n\n\t/** Rebuilds the chess instance and FEN from the loaded game's current move index. */\n\tprivate restoreGamePosition(): void {\n\t\tconst index = this.currentMoveIndex();\n\t\tconst moves = this.moves();\n\t\tthis.chess.reset();\n\t\tfor (let i = 0; i <= index && i < moves.length; i++) {\n\t\t\tthis.chess.move(moves[i]);\n\t\t}\n\t\tthis.currentFen.set(this.chess.fen());\n\t}\n\n\t/**\n\t * Publishes a completed Stockfish analysis result to the practice state,\n\t * ignoring results that do not belong to the currently displayed position.\n\t */\n\tprivate applyPracticeAnalysisResult(score: string | null | undefined): void {\n\t\tif (!this.practiceMode()) return;\n\t\tif (this.practiceAnalysisFen !== this.currentFen()) return;\n\t\tthis.practiceEvaluation.set(score ?? null);\n\t\tthis.practiceMoves.update((moves) => {\n\t\t\tif (moves.length === 0) return moves;\n\t\t\tconst copy = [...moves];\n\t\t\tconst last = copy[copy.length - 1];\n\t\t\tcopy[copy.length - 1] = { ...last, evaluation: score ?? null };\n\t\t\treturn copy;\n\t\t});\n\t}\n\n\t/** Formats practice moves as a single text line, e.g. `\"1. e4 e5 2. Nf3\"`. */\n\tprivate buildPracticeMoveText(): string {\n\t\tconst moves = this.practiceMoves();\n\t\tconst parts: string[] = [];\n\t\tfor (let i = 0; i < moves.length; i += 2) {\n\t\t\tconst white = moves[i];\n\t\t\tconst black = moves[i + 1];\n\t\t\tparts.push(`${i / 2 + 1}. ${white.san}`);\n\t\t\tif (black) parts.push(black.san);\n\t\t}\n\t\treturn parts.join(' ');\n\t}\n\n\t/**\n\t * Builds a full PGN for the practice session, including evaluation\n\t * comments for analyzed moves.\n\t */\n\tprivate buildPracticePgn(): string {\n\t\tconst result = this.practiceResult() ?? '*';\n\t\tconst headers = [\n\t\t\t'[Event \"Practice analysis\"]',\n\t\t\t'[Site \"ngx-chessground\"]',\n\t\t\t`[Date \"${this.formatPgnDate()}\"]`,\n\t\t\t'[White \"Practice\"]',\n\t\t\t'[Black \"Practice\"]',\n\t\t];\n\t\tconst startFen = this.practiceStartFen();\n\t\tconst standardFen =\n\t\t\t'rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1';\n\t\tif (startFen && startFen !== standardFen) {\n\t\t\theaders.push('[SetUp \"1\"]');\n\t\t\theaders.push(`[FEN \"${startFen}\"]`);\n\t\t}\n\t\theaders.push(`[Result \"${result}\"]`);\n\t\tconst moveText = this.practiceMoves()\n\t\t\t.map((move, i) => {\n\t\t\t\tconst number = i % 2 === 0 ? `${i / 2 + 1}. ` : '';\n\t\t\t\tconst comment = move.evaluation\n\t\t\t\t\t? ` { [%eval ${move.evaluation.replace(/^\\+/, '')}] }`\n\t\t\t\t\t: '';\n\t\t\t\treturn `${number}${move.san}${comment}`;\n\t\t\t})\n\t\t\t.join(' ');\n\t\treturn `${headers.join('\\n')}\\n\\n${moveText} ${result}\\n`;\n\t}\n\n\t/** Formats today's date as a PGN header value, e.g. `2026.08.24`. */\n\tprivate formatPgnDate(): string {\n\t\treturn new Date().toISOString().slice(0, 10).replace(/-/g, '.');\n\t}\n\n\t/** Copies text to the clipboard with user feedback. */\n\tprivate async copyTextToClipboard(\n\t\ttext: string,\n\t\tmessage: string,\n\t): Promise<void> {\n\t\ttry {\n\t\t\tawait navigator.clipboard.writeText(text);\n\t\t\tthis.showMessage(message, 2500);\n\t\t} catch {\n\t\t\tthis.showMessage('Failed to copy to clipboard.', 5000, 'error');\n\t\t}\n\t}\n\n\t/** Routes one PGN-worker response to the matching request handler. */\n\tprivate handleWorkerMessage(data: WorkerResponse): void {\n\t\tconst { type, payload, id } = data;\n\t\tif (type === 'load') {\n\t\t\tthis.gamesMetadata.set(payload.metadata);\n\t\t\tthis.isLoading.set(false);\n\n\t\t\t// Defer expensive aggregation to idle time so the board renders\n\t\t\t// immediately. The handle is tracked so a pending callback cannot\n\t\t\t// fire after the component is destroyed.\n\t\t\tconst meta = payload.metadata;\n\t\t\tif (typeof requestIdleCallback === 'function') {\n\t\t\t\tthis.pendingIdleCallback = requestIdleCallback(\n\t\t\t\t\t() => {\n\t\t\t\t\t\tthis.pendingIdleCallback = null;\n\t\t\t\t\t\tthis.buildFilterLists(meta);\n\t\t\t\t\t},\n\t\t\t\t\t{ timeout: 2000 },\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tthis.setDeferredTimeout(() => this.buildFilterLists(meta));\n\t\t\t}\n\t\t\tif (payload.count > 0) this.loadGame(0);\n\t\t\t// Apply the filter selection that is currently active — restored\n\t\t\t// from the previous session or chosen by the user during this one —\n\t\t\t// to the freshly loaded game collection. This is what makes the\n\t\t\t// filters that were active when the application was closed show up\n\t\t\t// again once the games finish loading.\n\t\t\tthis.applyFilter();\n\t\t} else if (type === 'progress') {\n\t\t\tthis.loadingProgress.set(payload.percent);\n\t\t\tthis.loadingStatus.set(payload.status);\n\t\t\tthis.loadProgress.emit({\n\t\t\t\tpercent: payload.percent,\n\t\t\t\tstatus: payload.status,\n\t\t\t});\n\t\t} else if (type === 'filter') {\n\t\t\tif (id === this.currentFilterId) {\n\t\t\t\tthis.filteredGamesIndices.set(payload);\n\t\t\t\tthis.isFiltering.set(false);\n\t\t\t\tif (this.autoSelectOnFinish) {\n\t\t\t\t\tconst selected = new Set<number>();\n\t\t\t\t\tfor (const i of payload) selected.add(i);\n\t\t\t\t\tthis.selectedGames.set(selected);\n\t\t\t\t\tthis.autoSelectOnFinish = false;\n\t\t\t\t}\n\t\t\t\tif (payload.length > 0) this.loadGame(payload[0]);\n\t\t\t\tif (this.shouldUncheckFilterMoves) {\n\t\t\t\t\tthis.filterMoves.set(false);\n\t\t\t\t\tthis.shouldUncheckFilterMoves = false;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (type === 'loadGame') {\n\t\t\tif (id !== this.currentLoadGameId) return;\n\t\t\tconst { moves, pgn, evaluations, error } = payload;\n\t\t\tif (error) {\n\t\t\t\tthis.pgnInput.set(\n\t\t\t\t\t`Error parsing game: ${error} \\n\\nRaw PGN: \\n${pgn} `,\n\t\t\t\t);\n\t\t\t\tthis.moves.set([]);\n\t\t\t\tthis.evaluations.set([]);\n\t\t\t\tthis.moveClocks.set([]);\n\t\t\t\tthis.reportLoadFailure(\n\t\t\t\t\t'PARSE_FAILED',\n\t\t\t\t\t`Error parsing game: ${error}`,\n\t\t\t\t\terror,\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tthis.moves.set(moves);\n\t\t\t\tlet evals = evaluations || [];\n\t\t\t\tconst hasEval = evals.some((e) => e !== null);\n\t\t\t\tif (!hasEval && moves.length > 0 && pgn)\n\t\t\t\t\tevals = this.extractEvalsFromPgn(pgn, moves);\n\t\t\t\tthis.evaluations.set(evals);\n\t\t\t\tthis.chess.reset();\n\t\t\t\tthis.currentMoveIndex.set(-1);\n\t\t\t\tthis.currentFen.set(this.chess.fen());\n\t\t\t\tthis.stopReplay();\n\t\t\t\tthis.pgnInput.set(pgn);\n\t\t\t\tthis.extractClockHistory(pgn);\n\t\t\t\tif (this.clockHistory.length > 0) {\n\t\t\t\t\tconst start = this.clockHistory[0];\n\t\t\t\t\tthis.whiteTimeRemaining.set(this.formatTime(start.white));\n\t\t\t\t\tthis.blackTimeRemaining.set(this.formatTime(start.black));\n\t\t\t\t} else {\n\t\t\t\t\tthis.whiteTimeRemaining.set('');\n\t\t\t\t\tthis.blackTimeRemaining.set('');\n\t\t\t\t}\n\t\t\t\tif (\n\t\t\t\t\tthis.filterMoves() &&\n\t\t\t\t\tthis.activeFilterMoves.length > 0 &&\n\t\t\t\t\tmoves.length >= this.activeFilterMoves.length\n\t\t\t\t) {\n\t\t\t\t\tthis.jumpToMove(this.activeFilterMoves.length - 1);\n\t\t\t\t}\n\t\t\t\tif (this.filterByFenEnabled() && this.filterFen() && moves.length > 0) {\n\t\t\t\t\tconst fi = this.findMoveIndexForFen(moves, this.filterFen());\n\t\t\t\t\tif (fi >= 0) this.jumpToMove(fi);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.isLoading.set(false);\n\t\t} else if (type === 'cacheMiss') {\n\t\t\t// The remembered source is no longer in IndexedDB (evicted, expired\n\t\t\t// or cleared): fall back to downloading and parsing it.\n\t\t\tif (id === this.currentCacheLoadId) {\n\t\t\t\tconst url = this.pendingCacheSourceUrl;\n\t\t\t\tthis.pendingCacheSourceUrl = null;\n\t\t\t\tif (url) void this.downloadFromUrl(url);\n\t\t\t}\n\t\t} else if (type === 'error') {\n\t\t\tthis.reportLoadFailure('PARSE_FAILED', `Worker error: ${payload}`);\n\t\t}\n\t}\n\n\t// Temp storage for multi-PV lines during analysis; flushed to allAlternatives on bestmove.\n\t/** Multi-PV lines buffered until `bestmove` closes the search. */\n\tprivate readonly pendingAlternatives = new Map<number, BestMoveInfo>();\n\n\t/** Parses UCI output from Stockfish into evaluations and PV lines. */\n\tprivate handleStockfishMessage(event: MessageEvent): void {\n\t\tconst line = event.data;\n\t\tif (typeof line !== 'string') return;\n\t\tif (line.startsWith('bestmove')) {\n\t\t\tthis.isAnalyzing.set(false);\n\t\t\t// Sort multi-PV lines by rank and publish them\n\t\t\tconst sorted = Array.from(this.pendingAlternatives.entries())\n\t\t\t\t.sort(([a], [b]) => a - b)\n\t\t\t\t.map(([, info]) => info);\n\t\t\tthis.allAlternatives.set(sorted);\n\t\t\tthis.currentAlternativeIndex.set(0);\n\t\t\tthis.pendingAlternatives.clear();\n\t\t\tthis.autoplayCompleted.set(false);\n\t\t\t// In practice mode, publish the completed evaluation (empty results\n\t\t\t// come from searches aborted by 'stop' and must not overwrite state).\n\t\t\tif (sorted.length > 0) {\n\t\t\t\tthis.applyPracticeAnalysisResult(sorted[0]?.score);\n\t\t\t}\n\t\t} else if (line.startsWith('info') && line.includes(' pv ')) {\n\t\t\t// Extract multi-PV rank (defaults to 1 for single-PV engines)\n\t\t\tconst multiPvMatch = line.match(/multipv (\\d+)/);\n\t\t\tconst rank = multiPvMatch ? parseInt(multiPvMatch[1], 10) : 1;\n\n\t\t\tconst pvIndex = line.indexOf(' pv ');\n\t\t\tconst pvString = line.substring(pvIndex + 4);\n\t\t\tconst uciMoves = pvString.split(' ');\n\t\t\tif (uciMoves.length > 0) {\n\t\t\t\tconst bestMove = uciMoves[0];\n\t\t\t\t// The FEN this analysis belongs to: the practice position when in\n\t\t\t\t// practice mode, otherwise the stop-on-error analysis position.\n\t\t\t\tconst analysisFen = this.practiceMode()\n\t\t\t\t\t? this.practiceAnalysisFen\n\t\t\t\t\t: this.analyzedFen;\n\t\t\t\tlet scoreText = '';\n\t\t\t\tconst cpMatch = line.match(/score cp (-?\\d+)/);\n\t\t\t\tconst mateMatch = line.match(/score mate (-?\\d+)/);\n\t\t\t\tlet isBlackToMove = false;\n\t\t\t\tif (analysisFen) {\n\t\t\t\t\tconst parts = analysisFen.split(' ');\n\t\t\t\t\tif (parts.length > 1 && parts[1] === 'b') isBlackToMove = true;\n\t\t\t\t}\n\t\t\t\tif (mateMatch) {\n\t\t\t\t\tlet mate = parseInt(mateMatch[1], 10);\n\t\t\t\t\tif (isBlackToMove) mate = -mate;\n\t\t\t\t\tscoreText = `#${mate}`;\n\t\t\t\t} else if (cpMatch) {\n\t\t\t\t\tlet cp = parseInt(cpMatch[1], 10);\n\t\t\t\t\tif (isBlackToMove) cp = -cp;\n\t\t\t\t\tscoreText = (cp / 100).toFixed(2);\n\t\t\t\t\tif (cp > 0) scoreText = `+${scoreText}`;\n\t\t\t\t}\n\t\t\t\tconst sanPv = analysisFen ? this.uciToSan(analysisFen, uciMoves) : [];\n\t\t\t\tlet bestMoveSan = bestMove;\n\t\t\t\tif (analysisFen) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst temp = new Chess(analysisFen);\n\t\t\t\t\t\tconst u = bestMove;\n\t\t\t\t\t\tconst m = temp.move({\n\t\t\t\t\t\t\tfrom: u.substring(0, 2),\n\t\t\t\t\t\t\tto: u.substring(2, 4),\n\t\t\t\t\t\t\tpromotion: u.length > 4 ? u.substring(4, 5) : undefined,\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif (m) bestMoveSan = m.san;\n\t\t\t\t\t} catch {\n\t\t\t\t\t\t/* ignore */\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.pendingAlternatives.set(rank, {\n\t\t\t\t\tmove: bestMoveSan,\n\t\t\t\t\tpv: sanPv,\n\t\t\t\t\tscore: scoreText,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\t/** Position the in-flight analysis was started for, used to drop stale results. */\n\tprivate analyzedFen: string | null = null;\n\n\t/**\n\t * Converts a UCI principal variation into SAN plus the FEN after each move.\n\t *\n\t * @returns One entry per convertible move; returns `[]` for an invalid FEN.\n\t */\n\tprivate uciToSan(\n\t\tfen: string,\n\t\tuciMoves: string[],\n\t): { san: string; fen: string }[] {\n\t\ttry {\n\t\t\tconst temp = new Chess(fen);\n\t\t\tconst out: { san: string; fen: string }[] = [];\n\t\t\tfor (const uci of uciMoves) {\n\t\t\t\tconst m = temp.move({\n\t\t\t\t\tfrom: uci.substring(0, 2),\n\t\t\t\t\tto: uci.substring(2, 4),\n\t\t\t\t\tpromotion: uci.length > 4 ? uci.substring(4, 5) : undefined,\n\t\t\t\t});\n\t\t\t\tif (!m) break;\n\t\t\t\tout.push({ san: m.san, fen: temp.fen() });\n\t\t\t}\n\t\t\treturn out;\n\t\t} catch {\n\t\t\treturn [];\n\t\t}\n\t}\n\n\t// ======================================================================\n\t// Replay internals\n\t// ======================================================================\n\n\t/** Chooses and runs the replay strategy for the current timing mode. */\n\tprivate runReplayLogic(): void {\n\t\tconst gamePgn = this.pgnInput();\n\t\tconst onComplete = this.replayResolve\n\t\t\t? () => {\n\t\t\t\t\tif (this.replayResolve) {\n\t\t\t\t\t\tthis.replayResolve();\n\t\t\t\t\t\tthis.replayResolve = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t: undefined;\n\t\ttry {\n\t\t\tconst temp = new Chess();\n\t\t\ttemp.loadPgn(gamePgn);\n\t\t\tconst history = temp.history({ verbose: true });\n\t\t\tconst timeOuts = this.calculateReplayTimeouts(history);\n\t\t\tthis.scheduleReplay(timeOuts, history.length, onComplete);\n\t\t} catch {\n\t\t\ttry {\n\t\t\t\tconst timeOuts = this.calculateReplayTimeoutsChessops(gamePgn);\n\t\t\t\tthis.scheduleReplay(timeOuts, timeOuts.length, onComplete);\n\t\t\t} catch {\n\t\t\t\tconst len = this.moves().length;\n\t\t\t\tconst timeOuts = Array(len)\n\t\t\t\t\t.fill(0)\n\t\t\t\t\t.map((_, i) => (i + 1) * this.fixedTime());\n\t\t\t\tthis.scheduleReplay(timeOuts, len, onComplete);\n\t\t\t}\n\t\t}\n\t}\n\n\t/** Replays the loaded game move by move, awaiting each scheduled delay. */\n\tprivate replayGameAsync(): Promise<void> {\n\t\treturn new Promise((resolve) => {\n\t\t\tthis.stopReplay();\n\t\t\tthis.replayResolve = resolve;\n\t\t\tthis.start();\n\t\t\tconst gamePgn = this.pgnInput();\n\t\t\ttry {\n\t\t\t\tconst temp = new Chess();\n\t\t\t\ttemp.loadPgn(gamePgn);\n\t\t\t\tconst history = temp.history({ verbose: true });\n\t\t\t\tconst timeOuts = this.calculateReplayTimeouts(history);\n\t\t\t\tthis.scheduleReplay(timeOuts, history.length, () => {\n\t\t\t\t\tresolve();\n\t\t\t\t\tthis.replayResolve = null;\n\t\t\t\t});\n\t\t\t} catch {\n\t\t\t\ttry {\n\t\t\t\t\tconst timeOuts = this.calculateReplayTimeoutsChessops(gamePgn);\n\t\t\t\t\tthis.scheduleReplay(timeOuts, timeOuts.length, () => {\n\t\t\t\t\t\tresolve();\n\t\t\t\t\t\tthis.replayResolve = null;\n\t\t\t\t\t});\n\t\t\t\t} catch {\n\t\t\t\t\tconst len = this.moves().length;\n\t\t\t\t\tconst timeOuts = Array(len)\n\t\t\t\t\t\t.fill(0)\n\t\t\t\t\t\t.map((_, i) => (i + 1) * this.fixedTime());\n\t\t\t\t\tthis.scheduleReplay(timeOuts, len, () => {\n\t\t\t\t\t\tresolve();\n\t\t\t\t\t\tthis.replayResolve = null;\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 * Derives per-move delays from the clock data already parsed by chess.js.\n\t *\n\t * Used for `realtime` replay; falls back to the fixed interval when the PGN\n\t * carries no clock annotations.\n\t */\n\tprivate calculateReplayTimeouts(history: Move[]): number[] {\n\t\tconst _timeOuts: number[] = [];\n\t\tthis.clockHistory = [];\n\t\tconst tempChess = new Chess();\n\t\ttempChess.loadPgn(this.pgnInput());\n\t\tconst header = tempChess.header();\n\t\tconst moves = tempChess.history({ verbose: true });\n\t\tconst moveComments = tempChess.getComments();\n\t\tlet timeControlSeconds = 0;\n\t\tif (header.TimeControl) {\n\t\t\tconst tc = header.TimeControl.split('+');\n\t\t\ttimeControlSeconds = parseInt(tc[0], 10);\n\t\t}\n\t\tlet whiteTime = timeControlSeconds;\n\t\tlet blackTime = timeControlSeconds;\n\t\tconst fenToComment = new Map<string, string>();\n\t\tfor (const c of moveComments) {\n\t\t\tfenToComment.set(c.fen, c.comment);\n\t\t}\n\t\tthis.clockHistory.push({ white: whiteTime, black: blackTime });\n\t\tconst thinkTimes: number[] = [];\n\t\tlet hasClockComments = false;\n\t\tfor (let i = 0; i < moves.length; i++) {\n\t\t\tconst move = moves[i];\n\t\t\tconst isWhite = move.color === 'w';\n\t\t\tconst comment = fenToComment.get(move.after);\n\t\t\tlet moveTime = 0;\n\t\t\tif (comment) {\n\t\t\t\tconst clkMatch = comment.match(/%clk\\s+(?:(\\d+):)?(\\d+):(\\d+)/);\n\t\t\t\tif (clkMatch) {\n\t\t\t\t\thasClockComments = true;\n\t\t\t\t\tconst h = clkMatch[1] ? parseInt(clkMatch[1], 10) : 0;\n\t\t\t\t\tconst m = parseInt(clkMatch[2], 10);\n\t\t\t\t\tconst s = parseInt(clkMatch[3], 10);\n\t\t\t\t\tconst timeInSeconds = h * 3600 + m * 60 + s;\n\t\t\t\t\tif (isWhite) {\n\t\t\t\t\t\tmoveTime = Math.max(0.1, whiteTime - timeInSeconds);\n\t\t\t\t\t\twhiteTime = timeInSeconds;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmoveTime = Math.max(0.1, blackTime - timeInSeconds);\n\t\t\t\t\t\tblackTime = timeInSeconds;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tmoveTime =\n\t\t\t\tmoveTime === 0 && !hasClockComments\n\t\t\t\t\t? this.fixedTime()\n\t\t\t\t\t: moveTime === 0\n\t\t\t\t\t\t? 1\n\t\t\t\t\t\t: moveTime;\n\t\t\tthinkTimes.push(moveTime);\n\t\t\tthis.clockHistory.push({ white: whiteTime, black: blackTime });\n\t\t}\n\t\tif (!hasClockComments) {\n\t\t\tthis.clockHistory = [];\n\t\t\tthis.whiteTimeRemaining.set('');\n\t\t\tthis.blackTimeRemaining.set('');\n\t\t} else if (this.clockHistory.length > 0) {\n\t\t\tthis.whiteTimeRemaining.set(this.formatTime(this.clockHistory[0].white));\n\t\t\tthis.blackTimeRemaining.set(this.formatTime(this.clockHistory[0].black));\n\t\t}\n\t\tif (this.replayMode() === 'fixed')\n\t\t\treturn history.map((_, i) => (i + 1) * this.fixedTime());\n\t\tif (this.replayMode() === 'fast')\n\t\t\treturn history.map((_, i) => (i + 1) * this.fastTime());\n\t\tif (this.replayMode() === 'realtime') {\n\t\t\tlet t = 0;\n\t\t\treturn thinkTimes.map((v) => (t += v));\n\t\t}\n\t\tif (this.replayMode() === 'proportional') {\n\t\t\tconst total = thinkTimes.reduce((a, b) => a + b, 0);\n\t\t\tconst target = this.proportionalDuration() * 60;\n\t\t\tconst scale = total > 0 ? target / total : 1;\n\t\t\tconst min = this.minSecondsBetweenMoves();\n\t\t\tlet cur = 0;\n\t\t\treturn thinkTimes.map((v) => {\n\t\t\t\tcur += Math.max(v * scale, min);\n\t\t\t\treturn cur;\n\t\t\t});\n\t\t}\n\t\treturn thinkTimes.map((_, i) => (i + 1) * 1);\n\t}\n\n\t/**\n\t * Derives per-move delays by parsing clock comments with chessops.\n\t *\n\t * Fallback for PGNs whose clock data chess.js cannot expose.\n\t */\n\tprivate calculateReplayTimeoutsChessops(pgn: string): number[] {\n\t\tconst games = parsePgn(pgn);\n\t\tif (games.length === 0) throw new Error('No games found by chessops');\n\t\tconst game = games[0];\n\t\tconst _timeOuts: number[] = [];\n\t\tthis.clockHistory = [];\n\t\tlet timeControlSeconds = 0;\n\t\tif (game.headers.has('TimeControl')) {\n\t\t\tconst tc = game.headers.get('TimeControl')?.split('+');\n\t\t\tif (tc) timeControlSeconds = parseInt(tc[0], 10);\n\t\t}\n\t\tlet whiteTime = timeControlSeconds;\n\t\tlet blackTime = timeControlSeconds;\n\t\tthis.clockHistory.push({ white: whiteTime, black: blackTime });\n\t\tconst thinkTimes: number[] = [];\n\t\tlet node = game.moves;\n\t\tlet isWhite = true;\n\t\twhile (node.children.length > 0) {\n\t\t\tconst child = node.children[0];\n\t\t\tlet moveTime = 0;\n\t\t\tlet has = false;\n\t\t\tif (child.data?.comments) {\n\t\t\t\tfor (const comment of child.data.comments) {\n\t\t\t\t\tconst clkMatch = comment.match(/%clk\\s+(?:(\\d+):)?(\\d+):(\\d+)/);\n\t\t\t\t\tif (clkMatch) {\n\t\t\t\t\t\thas = true;\n\t\t\t\t\t\tconst h = clkMatch[1] ? parseInt(clkMatch[1], 10) : 0;\n\t\t\t\t\t\tconst m = parseInt(clkMatch[2], 10);\n\t\t\t\t\t\tconst s = parseInt(clkMatch[3], 10);\n\t\t\t\t\t\tconst timeInSeconds = h * 3600 + m * 60 + s;\n\t\t\t\t\t\tif (isWhite) {\n\t\t\t\t\t\t\tmoveTime = Math.max(0.1, whiteTime - timeInSeconds);\n\t\t\t\t\t\t\twhiteTime = timeInSeconds;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tmoveTime = Math.max(0.1, blackTime - timeInSeconds);\n\t\t\t\t\t\t\tblackTime = timeInSeconds;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!has) moveTime = this.fixedTime();\n\t\t\tthinkTimes.push(moveTime);\n\t\t\tthis.clockHistory.push({ white: whiteTime, black: blackTime });\n\t\t\tnode = child;\n\t\t\tisWhite = !isWhite;\n\t\t}\n\t\tif (this.replayMode() === 'fixed')\n\t\t\treturn thinkTimes.map((_, i) => (i + 1) * this.fixedTime());\n\t\tif (this.replayMode() === 'fast')\n\t\t\treturn thinkTimes.map((_, i) => (i + 1) * this.fastTime());\n\t\tif (this.replayMode() === 'realtime') {\n\t\t\tlet t = 0;\n\t\t\treturn thinkTimes.map((v) => (t += v));\n\t\t}\n\t\tif (this.replayMode() === 'proportional') {\n\t\t\tconst total = thinkTimes.reduce((a, b) => a + b, 0);\n\t\t\tconst target = this.proportionalDuration() * 60;\n\t\t\tconst scale = total > 0 ? target / total : 1;\n\t\t\tconst min = this.minSecondsBetweenMoves();\n\t\t\tlet cur = 0;\n\t\t\treturn thinkTimes.map((v) => {\n\t\t\t\tcur += Math.max(v * scale, min);\n\t\t\t\treturn cur;\n\t\t\t});\n\t\t}\n\t\treturn thinkTimes.map((_, i) => (i + 1) * 1);\n\t}\n\n\t/** Queues one replay step, tracking its timer so it can be cancelled. */\n\tprivate scheduleReplay(\n\t\ttimeOuts: number[],\n\t\ttotalMoves: number,\n\t\tonComplete?: () => void,\n\t): void {\n\t\tthis.isReplaying.set(true);\n\t\tthis.showBetterMoveBtn.set(false);\n\t\tthis.analysisVisible.set(false);\n\t\tthis.allAlternatives.set([]);\n\t\tthis.autoplayCompleted.set(false);\n\t\tconst startIdx = this.currentMoveIndex() + 1;\n\t\tif (startIdx >= totalMoves) {\n\t\t\tthis.isReplaying.set(false);\n\t\t\tif (onComplete) onComplete();\n\t\t\treturn;\n\t\t}\n\t\tconst startTime = startIdx > 0 ? timeOuts[startIdx - 1] : 0;\n\t\tfor (let i = startIdx; i < totalMoves; i++) {\n\t\t\tconst delay = Math.max(0, (timeOuts[i] - startTime) * 1000);\n\t\t\tconst isLast = i === totalMoves - 1;\n\t\t\tconst tid = this.setDeferredTimeout(() => {\n\t\t\t\tthis.next();\n\t\t\t\tif (this.stopOnError()) {\n\t\t\t\t\tconst idx = this.currentMoveIndex();\n\t\t\t\t\tconst evals = this.evaluations();\n\t\t\t\t\tif (idx > 0 && idx < evals.length) {\n\t\t\t\t\t\tconst cur = this.parseEval(evals[idx]);\n\t\t\t\t\t\tconst prev = this.parseEval(evals[idx - 1]);\n\t\t\t\t\t\tif (cur !== null && prev !== null) {\n\t\t\t\t\t\t\tconst diff = cur - prev; // from White's perspective\n\t\t\t\t\t\t\tconst threshold = this.stopOnErrorThreshold();\n\t\t\t\t\t\t\t// An \"error\" is a drop in the mover's own evaluation:\n\t\t\t\t\t\t\t// White erred when White's eval drops; Black erred when\n\t\t\t\t\t\t\t// White's eval rises (i.e. Black's eval drops).\n\t\t\t\t\t\t\tconst isWhiteMove = this.isWhiteMove();\n\t\t\t\t\t\t\tconst whiteError = isWhiteMove && diff < -threshold;\n\t\t\t\t\t\t\tconst blackError = !isWhiteMove && diff > threshold;\n\t\t\t\t\t\t\tconst side = this.stopOnErrorSide();\n\t\t\t\t\t\t\tconst triggered =\n\t\t\t\t\t\t\t\tside === 'white'\n\t\t\t\t\t\t\t\t\t? whiteError\n\t\t\t\t\t\t\t\t\t: side === 'black'\n\t\t\t\t\t\t\t\t\t\t? blackError\n\t\t\t\t\t\t\t\t\t\t: whiteError || blackError;\n\t\t\t\t\t\t\tif (triggered) {\n\t\t\t\t\t\t\t\tthis.stopReplay(false);\n\t\t\t\t\t\t\t\tthis.showBetterMoveBtn.set(true);\n\t\t\t\t\t\t\t\tconst prevFen = this.getFenBeforeMove(idx);\n\t\t\t\t\t\t\t\tif (prevFen) this.analyzedFen = prevFen;\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\tif (isLast) {\n\t\t\t\t\tthis.setDeferredTimeout(() => {\n\t\t\t\t\t\tthis.isReplaying.set(false);\n\t\t\t\t\t\tonComplete?.();\n\t\t\t\t\t}, 500);\n\t\t\t\t}\n\t\t\t}, delay);\n\t\t\tthis.replayTimeouts.push(tid);\n\t\t}\n\t}\n\n\t// ======================================================================\n\t// Helpers\n\t// ======================================================================\n\n\t/** Renders a time-control key such as `'180+2'` as a readable label. */\n\tprivate formatTimeControlKey(key: string): string {\n\t\tconst m = key.match(/^(\\d+)\\+(\\d+)$/);\n\t\tif (!m) return key;\n\t\tconst base = parseInt(m[1], 10);\n\t\tconst inc = parseInt(m[2], 10);\n\t\tif (Number.isNaN(base) || Number.isNaN(inc)) return key;\n\t\treturn base % 60 === 0 && base / 60 <= 180 ? `${base / 60}+${inc}` : key;\n\t}\n\n\t/** Summarizes the distinct original time-control strings behind a key. */\n\tprivate formatOriginalsSummary(\n\t\toriginals: Map<string, number>,\n\t\tmaxItems = 6,\n\t): string {\n\t\tconst entries = Array.from(originals.entries()).sort((a, b) => b[1] - a[1]);\n\t\tconst head = entries\n\t\t\t.slice(0, maxItems)\n\t\t\t.map(([v, c]) => `${v} (${c})`)\n\t\t\t.join(', ');\n\t\tconst rest =\n\t\t\tentries.length > maxItems ? ` +${entries.length - maxItems} more` : '';\n\t\treturn head ? `Originals: ${head}${rest}` : '';\n\t}\n\n\t/** Formats a duration in seconds as `H:MM:SS` or `M:SS`. */\n\tprivate formatTime(seconds: number): string {\n\t\tconst h = Math.floor(seconds / 3600);\n\t\tconst m = Math.floor((seconds % 3600) / 60);\n\t\tconst s = Math.floor(seconds % 60);\n\t\treturn h > 0\n\t\t\t? `${h}:${m.toString().padStart(2, '0')}:${s.toString().padStart(2, '0')} `\n\t\t\t: `${m}:${s.toString().padStart(2, '0')} `;\n\t}\n\n\t/** Parses an evaluation string into pawns, from White's perspective. */\n\tprivate parseEval(evalStr: string | null): number | null {\n\t\tif (!evalStr) return null;\n\t\tif (evalStr.startsWith('#')) {\n\t\t\tconst val = parseInt(evalStr.substring(1), 10);\n\t\t\treturn val > 0 ? 20 + 10 / Math.abs(val) : -(20 + 10 / Math.abs(val));\n\t\t}\n\t\treturn parseFloat(evalStr);\n\t}\n\n\t/**\n\t * Whether the move that just played was made by White.\n\t *\n\t * Uses the FEN of the position AFTER the move: its active color is the\n\t * side to move next, so the mover is the opposite color. This stays\n\t * correct for games that start from a custom FEN position.\n\t */\n\tprivate isWhiteMove(): boolean {\n\t\tconst parts = this.currentFen().split(' ');\n\t\t// 'w' to move next means Black just moved; anything else means White did.\n\t\treturn parts.length < 2 || parts[1] !== 'w';\n\t}\n\n\t/**\n\t * Recovers `[%eval …]` annotations from raw PGN when the worker reported none.\n\t *\n\t * @returns One evaluation per move, `null` where the PGN has no annotation.\n\t */\n\tprivate extractEvalsFromPgn(\n\t\tpgnText: string,\n\t\tparsedMoves: string[],\n\t): (string | null)[] {\n\t\tconst evals: (string | null)[] = new Array(parsedMoves.length).fill(null);\n\t\tconst values: string[] = [];\n\t\tconst re = /\\[%eval\\s+([^\\]]+)\\]/g;\n\t\tlet m: RegExpExecArray | null;\n\t\tm = re.exec(pgnText);\n\t\twhile (m !== null) {\n\t\t\tvalues.push(m[1]);\n\t\t\tm = re.exec(pgnText);\n\t\t}\n\t\tif (values.length === 0) return evals;\n\t\tconst firstEvalIdx = pgnText.search(/\\[%eval\\s+([^\\]]+)\\]/);\n\t\tconst firstMoveIdx = pgnText.search(/\\b\\d+\\.\\s+/);\n\t\tconst offset = firstMoveIdx >= 0 && firstEvalIdx < firstMoveIdx ? 1 : 0;\n\t\tfor (let i = 0; i < parsedMoves.length; i++) {\n\t\t\tconst vi = i + offset;\n\t\t\tif (vi < values.length) evals[i] = values[vi];\n\t\t}\n\t\treturn evals;\n\t}\n\n\t/** Parses `[%clk …]` annotations into {@link clockHistory}. */\n\tprivate extractClockHistory(pgn: string): void {\n\t\tthis.clockHistory = [];\n\t\ttry {\n\t\t\tconst temp = new Chess();\n\t\t\ttemp.loadPgn(pgn);\n\t\t\tconst moves = temp.history({ verbose: true });\n\t\t\tconst comments = temp.getComments();\n\t\t\tconst fenToComment = new Map<string, string>();\n\t\t\tfor (const c of comments) fenToComment.set(c.fen, c.comment);\n\t\t\tconst header = temp.header();\n\t\t\tlet tc = 0;\n\t\t\tif (header.TimeControl) {\n\t\t\t\tconst t = header.TimeControl.split('+');\n\t\t\t\ttc = parseInt(t[0], 10);\n\t\t\t}\n\t\t\tlet wt = tc,\n\t\t\t\tbt = tc;\n\t\t\tthis.clockHistory.push({ white: wt, black: bt });\n\t\t\tlet has = false;\n\t\t\tfor (const move of moves) {\n\t\t\t\tconst isW = move.color === 'w';\n\t\t\t\tconst comment = fenToComment.get(move.after);\n\t\t\t\tif (comment) {\n\t\t\t\t\tconst clk = comment.match(/%clk\\s+(?:(\\d+):)?(\\d+):(\\d+)/);\n\t\t\t\t\tif (clk) {\n\t\t\t\t\t\thas = true;\n\t\t\t\t\t\tconst h = clk[1] ? parseInt(clk[1], 10) : 0;\n\t\t\t\t\t\tconst m = parseInt(clk[2], 10);\n\t\t\t\t\t\tconst s = parseInt(clk[3], 10);\n\t\t\t\t\t\tconst tis = h * 3600 + m * 60 + s;\n\t\t\t\t\t\tif (isW) wt = tis;\n\t\t\t\t\t\telse bt = tis;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.clockHistory.push({ white: wt, black: bt });\n\t\t\t}\n\t\t\tif (!has) {\n\t\t\t\tthis.clockHistory = [];\n\t\t\t\tthis.moveClocks.set([]);\n\t\t\t} else this.buildMoveClocks(moves);\n\t\t} catch {\n\t\t\tthis.clockHistory = [];\n\t\t\tthis.moveClocks.set([]);\n\t\t}\n\t}\n\n\t/** Builds the formatted per-move clock strings from `clockHistory`. */\n\tprivate buildMoveClocks(moves: Move[]): void {\n\t\tconst clocks: string[] = [];\n\t\tfor (let i = 0; i < moves.length; i++) {\n\t\t\tconst hi = i + 1;\n\t\t\tif (hi < this.clockHistory.length) {\n\t\t\t\tconst isW = moves[i].color === 'w';\n\t\t\t\tconst time = isW\n\t\t\t\t\t? this.clockHistory[hi].white\n\t\t\t\t\t: this.clockHistory[hi].black;\n\t\t\t\tclocks.push(this.formatTime(time));\n\t\t\t} else clocks.push('');\n\t\t}\n\t\tthis.moveClocks.set(clocks);\n\t}\n\n\t/**\n\t * Finds the first move index whose position matches `targetFen`.\n\t *\n\t * @returns The zero-based index, or `-1` when the position never occurs.\n\t */\n\tprivate findMoveIndexForFen(moves: string[], targetFen: string): number {\n\t\ttry {\n\t\t\tconst norm = this.normalizeFen(targetFen);\n\t\t\tconst temp = new Chess();\n\t\t\tif (this.normalizeFen(temp.fen()) === norm) return -1;\n\t\t\tfor (let i = 0; i < moves.length; i++) {\n\t\t\t\ttemp.move(moves[i]);\n\t\t\t\tif (this.normalizeFen(temp.fen()) === norm) return i;\n\t\t\t}\n\t\t\treturn -1;\n\t\t} catch {\n\t\t\treturn -1;\n\t\t}\n\t}\n\n\t/** Trims a FEN to its first four fields for comparison. */\n\tprivate normalizeFen(fen: string): string {\n\t\treturn fen.split(' ').slice(0, 4).join(' ');\n\t}\n\n\t/** FEN of the position immediately before `moveIndex`, or `null`. */\n\tprivate getFenBeforeMove(moveIndex: number): string | null {\n\t\ttry {\n\t\t\tconst temp = new Chess();\n\t\t\ttemp.loadPgn(this.pgnInput());\n\t\t\tconst moves = temp.history();\n\t\t\ttemp.reset();\n\t\t\tfor (let i = 0; i < moveIndex; i++) temp.move(moves[i]);\n\t\t\treturn temp.fen();\n\t\t} catch {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\t/**\n\t * Schedules a callback and tracks its timer so `ngOnDestroy` can cancel it.\n\t *\n\t * @returns The timer handle, for callers that need to cancel it early.\n\t */\n\tprivate setDeferredTimeout(\n\t\tcb: () => void,\n\t\tdelay = 0,\n\t): ReturnType<typeof setTimeout> {\n\t\tconst id = setTimeout(() => {\n\t\t\tthis.pendingTimeouts.delete(id);\n\t\t\tcb();\n\t\t}, delay);\n\t\tthis.pendingTimeouts.add(id);\n\t\treturn id;\n\t}\n\n\t/** Sends a user-facing message to the configured notifier. */\n\tprivate showMessage(\n\t\tmsg: string,\n\t\tduration = 4000,\n\t\tlevel: PgnViewerNoticeLevel = 'info',\n\t): void {\n\t\tthis.notifier.notify({ message: msg, level, durationMs: duration });\n\t}\n\n\t/**\n\t * Reports a load failure on every channel at once.\n\t *\n\t * The three consumers of a failure — the host (`loadFailed`), the user\n\t * (notice) and a developer (console) — are served from one place, so a new\n\t * error path cannot accidentally reach only some of them.\n\t */\n\tprivate reportLoadFailure(\n\t\tcode: PgnViewerErrorCode,\n\t\tmessage: string,\n\t\tcause?: unknown,\n\t): void {\n\t\tconst error: PgnViewerError = { code, message, cause };\n\t\tthis.isLoading.set(false);\n\t\tthis.loadingProgress.set(0);\n\t\tthis.loadingStatus.set('');\n\t\tthis.loadFailed.emit(error);\n\t\tthis.showMessage(message, 6000, 'error');\n\t\tif (cause !== undefined)\n\t\t\tconsole.error(`[ngx-chessground] ${message}`, cause);\n\t}\n}\n","<div class=\"pgn-viewer-container\">\n  <div\n    class=\"main-content\"\n    #mainContent\n    [style.--left-panel-w.px]=\"leftPanelWidth()\"\n    [style.--right-panel-w.px]=\"rightPanelWidth()\"\n    (document:mousemove)=\"onResizeMove($event)\"\n    (document:mouseup)=\"stopResize()\"\n  >\n    <!-- Left Panel: Game Filter & Browser -->\n    <div class=\"panel left-panel\">\n      <game-filter-panel\n        [(filterWhite)]=\"filterWhite\"\n        [(filterBlack)]=\"filterBlack\"\n        [(ignoreColor)]=\"ignoreColor\"\n        [uniqueWhitePlayers]=\"uniqueWhitePlayers()\"\n        [uniqueBlackPlayers]=\"uniqueBlackPlayers()\"\n        [(filterResult)]=\"filterResult\"\n        [(filterEco)]=\"filterEco\"\n        [(filterTimeControl)]=\"filterTimeControl\"\n        [(filterEvent)]=\"filterEvent\"\n        [(filterBroadcastName)]=\"filterBroadcastName\"\n        [sortedEcoCodes]=\"sortedEcoCodes()\"\n        [sortedTimeControls]=\"sortedTimeControls()\"\n        [sortedEvents]=\"sortedEvents()\"\n        [sortedBroadcastNames]=\"sortedBroadcastNames()\"\n        [(filterUpsetEnabled)]=\"filterUpsetEnabled\"\n        [(filterUpsetWin)]=\"filterUpsetWin\"\n        [(filterUpsetDraw)]=\"filterUpsetDraw\"\n        [(filterUpsetMinDiff)]=\"filterUpsetMinDiff\"\n        [(filterRatingEnabled)]=\"filterRatingEnabled\"\n        [(filterWhiteRating)]=\"filterWhiteRating\"\n        [(filterBlackRating)]=\"filterBlackRating\"\n        [(filterWhiteRatingMax)]=\"filterWhiteRatingMax\"\n        [(filterBlackRatingMax)]=\"filterBlackRatingMax\"\n        [(filterMoves)]=\"filterMoves\"\n        [(filterByFenEnabled)]=\"filterByFenEnabled\"\n        [(filterFen)]=\"filterFen\"\n        [(sortAscending)]=\"sortAscending\"\n        [gamesMetadata]=\"gamesMetadata()\"\n        [filteredGameInfos]=\"filteredGameInfos()\"\n        [totalFilteredCount]=\"totalFilteredCount()\"\n        [isFiltering]=\"isFiltering()\"\n        [currentGameIndex]=\"currentGameIndex()\"\n        [selectedGamesCount]=\"selectedGamesCount()\"\n        [canGoPrev]=\"canGoPrev()\"\n        [canGoNext]=\"canGoNext()\"\n        [currentWhitePlayer]=\"currentWhitePlayer()\"\n        [currentBlackPlayer]=\"currentBlackPlayer()\"\n        [currentGameResult]=\"currentGameResult()\"\n        [getOpeningMoves]=\"getOpeningMoves\"\n        (applyFilter)=\"applyFilter()\"\n        (clearFilters)=\"clearFilters()\"\n        (loadGame)=\"loadGame($event)\"\n        (toggleGameSelection)=\"toggleGameSelection($event)\"\n        (prevGame)=\"prevGame()\"\n        (nextGame)=\"nextGame()\"\n        (toggleSortDirection)=\"toggleSortDirection()\"\n        (snapshotCurrentPosition)=\"snapshotCurrentPosition()\"\n      />\n    </div>\n\n    <!-- Resize Handle -->\n    <div\n      class=\"resize-handle\"\n      (mousedown)=\"startResize('left', $event)\"\n      aria-hidden=\"true\"\n    ></div>\n\n    <!-- Center Panel: Board -->\n    <div class=\"panel center-panel\" [class.practicing]=\"practiceMode()\">\n      <board-display\n        [runFunction]=\"runFunction()\"\n        [config]=\"boardConfig()\"\n        [(flipped)]=\"flipped\"\n        [(in3d)]=\"in3d\"\n        [topPlayerName]=\"topPlayerName()\"\n        [bottomPlayerName]=\"bottomPlayerName()\"\n        [topPlayerTurnClass]=\"topPlayerTurnClass()\"\n        [bottomPlayerTurnClass]=\"bottomPlayerTurnClass()\"\n        [activeColor]=\"activeColor()\"\n        [topPlayerActiveColor]=\"topPlayerActiveColor()\"\n        [bottomPlayerActiveColor]=\"bottomPlayerActiveColor()\"\n        [topPlayerTitle]=\"topPlayerTitle()\"\n        [bottomPlayerTitle]=\"bottomPlayerTitle()\"\n        [topTimeRemaining]=\"topTimeRemaining()\"\n        [bottomTimeRemaining]=\"bottomTimeRemaining()\"\n        [gameResult]=\"displayGameResult()\"\n        [evaluation]=\"boardEvaluation()\"\n        [currentMoveIndex]=\"currentMoveIndex()\"\n        [movesCount]=\"moves().length\"\n        [isAnalyzing]=\"isAnalyzing()\"\n        [bestMoveInfo]=\"bestMoveInfo()\"\n        [analysisVisible]=\"analysisVisible()\"\n        [showBetterMoveBtn]=\"showBetterMoveBtn()\"\n        [isEndOfReplay]=\"isEndOfReplay()\"\n        [hasNextAlternative]=\"currentAlternativeIndex() < allAlternatives().length - 1\"\n        [hasPrevAlternative]=\"currentAlternativeIndex() > 0\"\n        [alternativeLabel]=\"allAlternatives().length > 1 ? (currentAlternativeIndex() + 1) + '/' + allAlternatives().length : ''\"\n        [autoplayCompleted]=\"autoplayCompleted()\"\n        [practiceAvailable]=\"practiceAvailable()\"\n        [practiceActive]=\"practiceMode()\"\n        [(stockfishDepth)]=\"stockfishDepth\"\n        (flipBoard)=\"flipBoard()\"\n        (toggle3d)=\"toggle3d()\"\n        (goToStart)=\"start()\"\n        (prev)=\"prev()\"\n        (next)=\"next()\"\n        (end)=\"end()\"\n        (analyzePosition)=\"analyzePosition($event)\"\n        (autoplayBestLine)=\"autoplayBestLine()\"\n        (previewPvMove)=\"previewPvMove($event)\"\n        (toggleAnalysis)=\"toggleAnalysis()\"\n        (nextBestMove)=\"nextBestMove()\"\n        (prevBestMove)=\"prevBestMove()\"\n        (reevaluate)=\"reevaluatePosition()\"\n        (startPractice)=\"startPractice()\"\n      />\n\n      @if (practiceMode()) {\n        <practice-panel\n          [isAnalyzing]=\"isAnalyzing()\"\n          [evaluation]=\"practiceEvaluation()\"\n          [bestMoveInfo]=\"bestMoveInfo()\"\n          [moves]=\"practiceMoves()\"\n          [fen]=\"currentFen()\"\n          [result]=\"practiceResult()\"\n          [(depth)]=\"stockfishDepth\"\n          (exit)=\"exitPractice()\"\n          (undoMove)=\"undoPracticeMove()\"\n          (restart)=\"restartPractice()\"\n          (reanalyze)=\"reanalyzePracticePosition()\"\n          (copyFen)=\"copyPracticeFen()\"\n          (copyMoves)=\"copyPracticeMoves()\"\n          (copyPgn)=\"copyPracticePgn()\"\n          (downloadPgn)=\"downloadPracticePgn()\"\n        />\n      }\n    </div>\n\n    <!-- Resize Handle -->\n    <div\n      class=\"resize-handle\"\n      (mousedown)=\"startResize('right', $event)\"\n      aria-hidden=\"true\"\n    ></div>\n\n    <!-- Right Panel: Moves, Replay, Load & Cache -->\n    <div class=\"panel right-panel\">\n      <!-- Move List -->\n      <div class=\"collapsible-section moves-section\" [class.collapsed]=\"!movesExpanded()\">\n        <move-list\n          [moves]=\"moves()\"\n          [moveClocks]=\"moveClocks()\"\n          [currentMoveIndex]=\"currentMoveIndex()\"\n          [highlightLastMove]=\"highlightLastMove()\"\n          [(expanded)]=\"movesExpanded\"\n          (jumpToMove)=\"jumpToMove($event)\"\n        />\n      </div>\n\n      <!-- Replay Panel -->\n      <replay-panel\n        [(replayMode)]=\"replayMode\"\n        [(proportionalDuration)]=\"proportionalDuration\"\n        [(minSecondsBetweenMoves)]=\"minSecondsBetweenMoves\"\n        [(fixedTime)]=\"fixedTime\"\n        [(fastTime)]=\"fastTime\"\n        [(stopOnError)]=\"stopOnError\"\n        [(stopOnErrorThreshold)]=\"stopOnErrorThreshold\"\n        [(stopOnErrorSide)]=\"stopOnErrorSide\"\n        [isReplaying]=\"isReplaying()\"\n        [canContinueReplay]=\"canContinueReplay()\"\n        [canShowReplayAll]=\"canShowReplayAll()\"\n        [selectedGamesCount]=\"selectedGamesCount()\"\n        (replayGame)=\"replayGame()\"\n        (continueReplay)=\"continueReplay()\"\n        (stopSequence)=\"stopSequence()\"\n        (replayAllSelectedGames)=\"replayAllSelectedGames()\"\n      />\n\n      <!-- Load & Cache Panel -->\n      <load-cache-panel\n        [isLoading]=\"isLoading()\"\n        [loadingProgress]=\"loadingProgress()\"\n        [loadingStatus]=\"loadingStatus()\"\n        [cacheInfo]=\"cacheInfo()\"\n        [(pgnInput)]=\"pgnInput\"\n        [(urlInput)]=\"urlInput\"\n        [(indexStartPositions)]=\"indexStartPositions\"\n        [(maxFenPlies)]=\"maxFenPlies\"\n        [(lichessYear)]=\"lichessYear\"\n        [(lichessMonth)]=\"lichessMonth\"\n        (loadPgnString)=\"loadPgnString($event)\"\n        (fileLoadFailed)=\"onFileLoadFailed($event)\"\n        (clearPgnCache)=\"clearPgnCache()\"\n        (refreshCacheInfo)=\"refreshCacheInfo()\"\n        (loadFromLichess)=\"loadFromLichess()\"\n        (loadFromUrl)=\"loadFromUrl()\"\n        (loadFromClipboardEvent)=\"loadFromClipboard()\"\n        (copyToClipboardEvent)=\"copyToClipboard()\"\n      />\n    </div>\n  </div>\n</div>\n","/**\n * Types for the PGN viewer component and its sub-components.\n */\n\nimport type { Key } from 'chessground/types';\nimport type { TextSegment } from './text-highlight';\n\n/** Collapsible section identifier for the left panel. */\nexport type LeftPanelSection =\n\t| 'players'\n\t| 'gameDetails'\n\t| 'upsets'\n\t| 'rating'\n\t| 'position';\n\n/** Collapsible section identifier for the right panel. */\nexport type RightPanelSection = 'moves' | 'replay' | 'loadCache';\n\n/** Replay timing mode. */\nexport type ReplayMode = 'realtime' | 'proportional' | 'fixed' | 'fast';\n\n/** Which side's errors should trigger \"stop on error\" during replay. */\nexport type StopOnErrorSide = 'both' | 'white' | 'black';\n\n/** Player name with optional selection state for typeahead. */\nexport interface PlayerSuggestion {\n\t/** Display name of the player. */\n\tname: string;\n\t/** Whether this suggestion is the highlighted one in the dropdown. */\n\tactive: boolean;\n}\n\n/** A single evaluation change representing a \"stop on error\" event. */\nexport interface EvaluationChange {\n\t/** Zero-based index of the move that caused the change. */\n\tmoveIndex: number;\n\t/** Size of the evaluation swing, in pawns. */\n\tdiff: number;\n\t/** The configured `stopOnErrorThreshold` this `diff` exceeded. */\n\tthreshold: number;\n\t/** Side whose move caused the evaluation change. */\n\tside: 'white' | 'black';\n}\n\n/** Clock state at a given half-move. */\nexport interface ClockState {\n\t/** Remaining time for White, in seconds. */\n\twhite: number;\n\t/** Remaining time for Black, in seconds. */\n\tblack: number;\n}\n\n/** Stockfish analysis result. */\nexport interface BestMoveInfo {\n\t/** Best move found, in SAN. */\n\tmove: string;\n\t/** Principal variation, as SAN plus the FEN reached after each move. */\n\tpv: { san: string; fen: string }[];\n\t/**\n\t * Engine evaluation of the position, from White's perspective\n\t * (e.g. `'+0.32'`, `'#-2'`).\n\t */\n\tscore?: string;\n}\n\n/** A single move played during practice mode. */\nexport interface PracticeMove {\n\t/** Move in standard algebraic notation (SAN). */\n\tsan: string;\n\t/**\n\t * Stockfish evaluation of the position after this move, from White's\n\t * perspective (e.g. `'+0.32'`, `'#-2'`), or null while pending/unknown.\n\t */\n\tevaluation: string | null;\n}\n\n/** Complete export payload for a practice session. */\nexport interface PracticeExport {\n\t/** FEN of the position where the practice session started. */\n\tstartFen: string;\n\t/** FEN of the current practice position. */\n\tfen: string;\n\t/** SAN moves played during the practice session. */\n\tmoves: string[];\n\t/** Formatted move text (e.g. `\"1. e4 e5 2. Nf3\"`). */\n\tmoveText: string;\n\t/** Full PGN of the practice session, including evaluation comments. */\n\tpgn: string;\n}\n\n/** Game metadata for the filter panel's game list. */\nexport interface FilterGameInfo {\n\t/** One-based game number as shown in the list. */\n\tnumber: number;\n\t/** Player with the white pieces. */\n\twhite: string;\n\t/** Player with the black pieces. */\n\tblack: string;\n\t/** Result string: `'1-0'`, `'0-1'`, `'1/2-1/2'` or `'*'`. */\n\tresult: string;\n}\n\n/** Typeahead keyboard navigation handler. */\nexport interface TypeaheadKeyboardEvent {\n\t/** The `KeyboardEvent.key` value that was pressed. */\n\tkey: string;\n\t/** Suppresses the browser's default handling of the key. */\n\tpreventDefault(): void;\n}\n\n/** Input/output contract for the player typeahead component. */\nexport interface PlayerTypeaheadState {\n\t/** Current text in the typeahead field. */\n\tvalue: string;\n\t/** Player names matching the current query. */\n\tsuggestions: string[];\n\t/** Whether the suggestion dropdown is showing. */\n\tisOpen: boolean;\n\t/** Index of the highlighted suggestion, or `-1` when none is highlighted. */\n\tactiveIndex: number;\n}\n\n/**\n * A PGN data source the viewer can load.\n *\n * A discriminated union rather than a set of boolean flags, so an invalid\n * combination (\"load a URL and also this file\") is unrepresentable.\n */\nexport type PgnSource =\n\t/** A remote archive or PGN file. `.zst` is decompressed automatically. */\n\t| {\n\t\t\treadonly kind: 'url';\n\t\t\t/** Absolute or app-relative URL. */\n\t\t\treadonly url: string;\n\t\t\t/**\n\t\t\t * Remember this URL alongside the content hash so a later session\n\t\t\t * can restore it from cache without downloading. Defaults to the\n\t\t\t * URL itself, or `false` to opt out of bookmarking.\n\t\t\t */\n\t\t\treadonly cacheAs?: string | false;\n\t  }\n\t/** Raw PGN text already held by the host. */\n\t| {\n\t\t\treadonly kind: 'pgn';\n\t\t\treadonly text: string;\n\t\t\t/** Optional origin, used for cache bookmarking. */\n\t\t\treadonly sourceUrl?: string;\n\t  }\n\t/** A `File` from an `<input type=\"file\">` or drag & drop. */\n\t| {\n\t\t\treadonly kind: 'file';\n\t\t\treadonly file: File;\n\t  };\n\n/** Optional per-call overrides for {@link PgnSource} loading. */\nexport interface LoadOptions {\n\t/**\n\t * Build a position index for the loaded games. Defaults to the viewer's\n\t * current `indexStartPositions` setting.\n\t */\n\treadonly indexStartPositions?: boolean;\n\t/** Max half-moves replayed per game when indexing. Defaults to `maxFenPlies`. */\n\treadonly maxFenPlies?: number;\n}\n\n/** Machine-readable failure categories reported through `loadFailed`. */\nexport type PgnViewerErrorCode =\n\t/** The source could not be fetched (network, HTTP status, CORS). */\n\t| 'DOWNLOAD_FAILED'\n\t/** The archive or PGN text could not be parsed into games. */\n\t| 'PARSE_FAILED'\n\t/** The local cache could not be read or written. */\n\t| 'CACHE_FAILED'\n\t/** The Stockfish worker could not be started. */\n\t| 'ENGINE_FAILED'\n\t/** The source was rejected before any work started (missing/empty input). */\n\t| 'INVALID_SOURCE';\n\n/**\n * A failure the host can observe and react to.\n *\n * Every load path reports exactly one of these on failure, so a host needs a\n * single handler rather than sniffing console output.\n */\nexport interface PgnViewerError {\n\t/** Stable category for programmatic branching. */\n\treadonly code: PgnViewerErrorCode;\n\t/** Human-readable description, safe to display. */\n\treadonly message: string;\n\t/** The originating error, when there was one. */\n\treadonly cause?: unknown;\n}\n\nexport type { Key, TextSegment };\n","import { Chessground } from 'chessground';\nimport type { Unit } from './unit';\n\n/**\n * Represents a unit of animation for a chess conflict scenario.\n *\n * @constant\n * @type {Unit}\n * @name conflictingAnim\n *\n * @property {string} name - The name of the animation unit.\n * @property {Function} run - The function to execute the animation.\n * @param {HTMLElement} el - The HTML element to attach the Chessground instance to.\n * @returns {Chessground} The Chessground instance with the specified configuration.\n *\n * The animation runs with the following configuration:\n * - Duration: 500ms\n * - Initial FEN: \"8/8/5p2/4P3/4K3/8/8/8\"\n * - Turn color: Black\n * - Movable color: White\n * - Movable pieces are not free to move initially\n *\n * After 2 seconds, the black pawn on f6 moves to e5, and the turn color changes to white.\n * The white king on e4 can then move to e5, d5, or f5.\n */\nexport const conflictingAnim: Unit = {\n\tname: 'Animation: conflict',\n\trun(el) {\n\t\tconst cg = Chessground(el, {\n\t\t\tanimation: {\n\t\t\t\tduration: 500,\n\t\t\t},\n\t\t\tfen: '8/8/5p2/4P3/4K3/8/8/8',\n\t\t\tturnColor: 'black',\n\t\t\tmovable: {\n\t\t\t\tcolor: 'white',\n\t\t\t\tfree: false,\n\t\t\t},\n\t\t});\n\t\tsetTimeout(() => {\n\t\t\tcg.move('f6', 'e5');\n\t\t\tcg.set({\n\t\t\t\tturnColor: 'white',\n\t\t\t\tmovable: {\n\t\t\t\t\tdests: new Map([['e4', ['e5', 'd5', 'f5']]]),\n\t\t\t\t},\n\t\t\t});\n\t\t\tcg.playPremove();\n\t\t}, 2000);\n\t\treturn cg;\n\t},\n};\n\n/**\n * Represents a unit test for animating chess moves with the same role.\n *\n * This unit test initializes a Chessground instance with a specific FEN position\n * and animates two moves sequentially with a delay between them.\n *\n * @constant\n * @type {Unit}\n * @name withSameRole\n * @property {string} name - The name of the unit test.\n * @property {function} run - The function that runs the unit test.\n * @param {HTMLElement} el - The HTML element to initialize the Chessground instance on.\n * @returns {Chessground} The initialized Chessground instance.\n */\nexport const withSameRole: Unit = {\n\tname: 'Animation: same role',\n\trun(el) {\n\t\tconst cg = Chessground(el, {\n\t\t\tanimation: {\n\t\t\t\tduration: 2000,\n\t\t\t},\n\t\t\thighlight: {\n\t\t\t\tlastMove: false,\n\t\t\t},\n\t\t\tfen: '8/8/4p3/5p2/4B3/8/8/8',\n\t\t\tturnColor: 'white',\n\t\t});\n\t\tsetTimeout(() => {\n\t\t\tcg.move('e4', 'f5');\n\t\t\tsetTimeout(() => {\n\t\t\t\tcg.move('e6', 'f5');\n\t\t\t}, 500);\n\t\t}, 200);\n\t\treturn cg;\n\t},\n};\n\n/**\n * Represents a unit test for an animation where pieces of different roles are moved.\n *\n * @constant\n * @type {Unit}\n * @name notSameRole\n * @property {string} name - The name of the unit test.\n * @property {function} run - The function that runs the unit test.\n * @param {HTMLElement} el - The HTML element where the Chessground instance will be initialized.\n * @returns {Chessground} - The Chessground instance after performing the moves.\n *\n * The test initializes a Chessground instance with a specific FEN position and turn color.\n * It then performs a sequence of moves with a delay to test the animation of pieces with different roles.\n */\nexport const notSameRole: Unit = {\n\tname: 'Animation: different role',\n\trun(el) {\n\t\tconst cg = Chessground(el, {\n\t\t\tanimation: {\n\t\t\t\tduration: 2000,\n\t\t\t},\n\t\t\thighlight: {\n\t\t\t\tlastMove: false,\n\t\t\t},\n\t\t\tfen: '8/8/4n3/5p2/4P3/8/8/8',\n\t\t\tturnColor: 'white',\n\t\t});\n\t\tsetTimeout(() => {\n\t\t\tcg.move('e4', 'f5');\n\t\t\tsetTimeout(() => {\n\t\t\t\tcg.move('e6', 'f5');\n\t\t\t}, 500);\n\t\t}, 200);\n\t\treturn cg;\n\t},\n};\n\n/**\n * Represents a unit that performs an animation while holding a piece on a chessboard.\n *\n * @constant\n * @type {Unit}\n * @name whileHolding\n *\n * @property {string} name - The name of the unit.\n * @property {Function} run - The function that executes the animation.\n *\n * @param {HTMLElement} el - The HTML element where the chessboard will be rendered.\n *\n * @returns {Chessground} - The Chessground instance with the specified configuration.\n *\n * The `run` function initializes a Chessground instance with a specific FEN position and configuration.\n * It sets the turn color to black and specifies an animation duration of 5000 milliseconds.\n * After a timeout of 3000 milliseconds, it moves a piece from f6 to e5, changes the turn color to white,\n * and sets the movable destinations for the white piece on e4. Finally, it plays any premoves.\n */\nexport const whileHolding: Unit = {\n\tname: 'Animation: while holding',\n\n\trun(el) {\n\t\tconst cg = Chessground(el, {\n\t\t\tfen: '8/8/5p2/4P3/4K3/8/8/8',\n\t\t\tturnColor: 'black',\n\t\t\tanimation: {\n\t\t\t\tduration: 5000,\n\t\t\t},\n\t\t\tmovable: {\n\t\t\t\tcolor: 'white',\n\t\t\t\tfree: false,\n\t\t\t\tshowDests: false,\n\t\t\t},\n\t\t});\n\t\tsetTimeout(() => {\n\t\t\tcg.move('f6', 'e5');\n\t\t\tcg.set({\n\t\t\t\tturnColor: 'white',\n\t\t\t\tmovable: {\n\t\t\t\t\tdests: new Map([['e4', ['e5', 'd5', 'f5']]]),\n\t\t\t\t},\n\t\t\t});\n\t\t\tcg.playPremove();\n\t\t}, 3000);\n\t\treturn cg;\n\t},\n};\n","import { Chessground } from 'chessground';\nimport type { Unit } from './unit';\n\n/**\n * Default configuration for a unit.\n *\n * @constant\n * @type {Unit}\n * @property {string} name - The name of the configuration.\n * @property {function} run - Function to initialize Chessground with the given element.\n * @param {HTMLElement} el - The HTML element to initialize Chessground on.\n * @returns {Chessground} - The initialized Chessground instance.\n */\nexport const defaults: Unit = {\n\tname: 'Default configuration',\n\trun(el) {\n\t\treturn Chessground(el);\n\t},\n};\n\n/**\n * Represents a unit that initializes a chessboard from a FEN string with the black player's perspective.\n *\n * @constant\n * @type {Unit}\n * @name fromFen\n *\n * @property {string} name - The name of the unit.\n * @property {function} run - The function that initializes the chessboard.\n * @param {HTMLElement} el - The HTML element where the chessboard will be rendered.\n * @returns {Chessground} - The initialized Chessground instance.\n */\nexport const fromFen: Unit = {\n\tname: 'From FEN, from black POV',\n\trun(el) {\n\t\treturn Chessground(el, {\n\t\t\tfen: '2r3k1/pp2Qpbp/4b1p1/3p4/3n1PP1/2N4P/Pq6/R2K1B1R w -',\n\t\t\torientation: 'black',\n\t\t});\n\t},\n};\n\n/**\n * Represents a unit that simulates the last move in a Crazyhouse chess game.\n *\n * @constant\n * @type {Unit}\n * @name lastMoveCrazyhouse\n *\n * @property {string} name - The name of the unit.\n * @property {Function} run - The function that initializes the Chessground instance and sets the last moves.\n * @param {HTMLElement} el - The HTML element to initialize the Chessground on.\n * @returns {Chessground} The initialized Chessground instance with the last moves set.\n */\nexport const lastMoveCrazyhouse: Unit = {\n\tname: 'Last move: crazyhouse',\n\trun(el) {\n\t\tconst cg = Chessground(el);\n\t\tsetTimeout(() => {\n\t\t\tcg.set({ lastMove: ['e2', 'e4'] });\n\t\t\tsetTimeout(() => cg.set({ lastMove: ['g6'] }), 1000);\n\t\t\tsetTimeout(() => cg.set({ lastMove: ['e1'] }), 2000);\n\t\t});\n\t\treturn cg;\n\t},\n};\n\n/**\n * Represents a unit that highlights the king in check on a chessboard.\n *\n * @constant\n * @type {Unit}\n * @name checkHighlight\n *\n * @property {string} name - The name of the unit.\n * @property {Function} run - The function that initializes the chessboard with the specified FEN and highlights the king in check.\n * @param {HTMLElement} el - The HTML element where the chessboard will be rendered.\n * @returns {Chessground} - The initialized Chessground instance with the king in check highlighted.\n */\nexport const checkHighlight: Unit = {\n\tname: 'Highlight king in check',\n\trun(el) {\n\t\tconst fen = 'r1bqkbnr/1ppppBpp/p1n5/8/4P3/8/PPPP1PPP/RNBQK1NR b KQkq - 0 1';\n\t\tconst cg = Chessground(el, {\n\t\t\tfen,\n\t\t\tturnColor: 'black',\n\t\t\thighlight: {\n\t\t\t\tcheck: true,\n\t\t\t},\n\t\t});\n\t\tcg.set({\n\t\t\tcheck: true,\n\t\t});\n\t\treturn cg;\n\t},\n};\n","import { Chessground } from 'chessground';\nimport type { Key } from 'chessground/types.d';\nimport type { Unit } from './unit';\n\n/**\n * Represents a unit that automatically switches between different FEN configurations\n * to demonstrate a puzzle bug in a chess game.\n *\n * @constant\n * @type {Unit}\n * @name autoSwitch\n *\n * @property {string} name - The name of the unit.\n * @property {function} run - The function that runs the unit.\n *\n * @param {HTMLElement} cont - The container element where the chessboard will be rendered.\n * @returns {Chessground} - The Chessground instance.\n *\n * The `run` function initializes a Chessground instance with the first configuration\n * and then switches between the configurations every 2000 milliseconds.\n *\n * The configurations are defined as an array of functions, each returning an object\n * with the following properties:\n * - `orientation`: The orientation of the board (\"black\" or \"white\").\n * - `fen`: The FEN string representing the board position.\n * - `lastMove`: An array of keys representing the last move made.\n */\nexport const autoSwitch: Unit = {\n\tname: 'FEN: switch (puzzle bug)',\n\trun(cont) {\n\t\tconst configs: Array<() => { fen: string; lastMove: Key[] }> = [\n\t\t\t() => ({\n\t\t\t\torientation: 'black',\n\t\t\t\tfen: 'rnbqkb1r/pp1ppppp/5n2/8/3N1B2/8/PPP1PPPP/RN1QKB1R b KQkq - 0 4',\n\t\t\t\tlastMove: ['f3', 'd4'],\n\t\t\t}),\n\t\t\t() => ({\n\t\t\t\torientation: 'white',\n\t\t\t\tfen: '2r2rk1/4bp1p/pp2p1p1/4P3/4bP2/PqN1B2Q/1P3RPP/2R3K1 w - - 1 23',\n\t\t\t\tlastMove: ['b4', 'b3'],\n\t\t\t}),\n\t\t];\n\t\tconst cg = Chessground(cont, configs[0]());\n\t\tconst delay = 2000;\n\t\tlet it = 0;\n\t\tfunction run() {\n\t\t\tif (!cg.state.dom.elements.board.offsetParent) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcg.set(configs[++it % configs.length]());\n\t\t\tsetTimeout(run, delay);\n\t\t}\n\t\tsetTimeout(run, delay);\n\t\treturn cg;\n\t},\n};\n","import { Chess } from 'chess.js';\nimport { Chessground } from 'chessground';\nimport type { Unit } from './unit';\nimport { aiPlay, toDests } from './util';\n\n/**\n * Default configuration for the 3D theme unit.\n *\n * @constant\n * @type {Unit}\n * @name in3dDefaults\n *\n * @property {string} name - The name of the unit.\n * @property {function} run - The function to initialize and run the 3D theme.\n *\n * @param {HTMLElement} cont - The container element where the chessboard will be rendered.\n * @returns {Chessground} - The initialized Chessground instance with 3D theme settings.\n */\nexport const in3dDefaults: Unit = {\n\tname: '3D theme',\n\trun(cont) {\n\t\tconst el = wrapped(cont);\n\t\tconst cg = Chessground(el, {\n\t\t\taddPieceZIndex: true,\n\t\t});\n\t\tcg.redrawAll();\n\t\treturn cg;\n\t},\n};\n\n/**\n * Represents a unit for a 3D chess theme where the player plays against a random AI.\n *\n * @constant\n * @type {Unit}\n * @name vsRandom\n *\n * @property {string} name - The name of the unit.\n * @property {Function} run - The function to initialize and run the unit.\n * @param {HTMLElement} cont - The container element where the chessboard will be rendered.\n * @returns {Chessground} - The initialized Chessground instance.\n */\nexport const vsRandom: Unit = {\n\tname: '3D theme: play vs random AI',\n\trun(cont) {\n\t\tconst el = wrapped(cont);\n\n\t\tconst chess = new Chess();\n\t\tconst cg = Chessground(el, {\n\t\t\torientation: 'black',\n\t\t\taddPieceZIndex: true,\n\t\t\tmovable: {\n\t\t\t\tcolor: 'white',\n\t\t\t\tfree: false,\n\t\t\t\tdests: toDests(chess),\n\t\t\t},\n\t\t});\n\t\tcg.redrawAll();\n\t\tcg.set({\n\t\t\tmovable: {\n\t\t\t\tevents: {\n\t\t\t\t\tafter: aiPlay(cg, chess, 1000, false),\n\t\t\t\t},\n\t\t\t},\n\t\t});\n\t\treturn cg;\n\t},\n};\n\n/**\n * Represents a 3D theme where two random AIs play against each other.\n *\n * @constant\n * @type {Unit}\n * @name fullRandom\n *\n * @property {string} name - The name of the unit.\n * @property {function} run - The function to execute the unit.\n *\n * @param {HTMLElement} cont - The container element where the chessboard will be rendered.\n * @returns {Chessground} - The Chessground instance.\n *\n * The `run` function initializes a Chessground instance with a 3D theme and sets up a game\n * where two random AIs play against each other. Moves are made at a fixed delay interval.\n */\nexport const fullRandom: Unit = {\n\tname: '3D theme: watch 2 random AIs',\n\trun(cont) {\n\t\tconst el = wrapped(cont);\n\n\t\tconst chess = new Chess();\n\t\tconst delay = 300;\n\t\tconst cg = Chessground(el, {\n\t\t\torientation: 'black',\n\t\t\taddPieceZIndex: true,\n\t\t\tmovable: {\n\t\t\t\tfree: false,\n\t\t\t},\n\t\t});\n\t\tcg.redrawAll();\n\t\tfunction makeMove() {\n\t\t\tif (!cg.state.dom.elements.board.offsetParent) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst moves = chess.moves({ verbose: true });\n\t\t\tconst move = moves[Math.floor(Math.random() * moves.length)];\n\t\t\tchess.move(move.san);\n\t\t\tcg.move(move.from, move.to);\n\t\t\tsetTimeout(makeMove, delay);\n\t\t}\n\t\tsetTimeout(makeMove, delay);\n\t\treturn cg;\n\t},\n};\n\n/**\n * Creates a new `div` element, sets the class name of the provided container element to \"in3d staunton\",\n * clears its inner HTML, and appends the new `div` element to it.\n *\n * @param cont - The container `HTMLElement` to be wrapped.\n * @returns The newly created `div` element.\n */\nfunction wrapped(cont: HTMLElement) {\n\tconst el = document.createElement('div');\n\tcont.className = 'in3d staunton';\n\tcont.innerHTML = '';\n\tcont.appendChild(el);\n\treturn el;\n}\n","import { Chessground } from 'chessground';\nimport type { Unit } from './unit';\n\n/**\n * Represents a unit test for the performance of a piece move in a chess game.\n *\n * @constant\n * @type {Unit}\n * @name move\n *\n * @property {string} name - The name of the performance test.\n * @property {function} run - The function that runs the performance test.\n *\n * @param {HTMLElement} cont - The container element where the chessboard will be rendered.\n *\n * @returns {Chessground} - The Chessground instance used for the performance test.\n *\n * The `run` function initializes a Chessground instance with a specified animation duration.\n * It then defines a recursive function `run` that moves a piece from \"e2\" to \"a8\" and back\n * to \"e2\" with a delay between moves. The recursive function continues to run as long as\n * the chessboard is visible.\n */\nexport const move: Unit = {\n\tname: 'Perf: piece move',\n\trun(cont) {\n\t\tconst cg = Chessground(cont, {\n\t\t\tanimation: { duration: 500 },\n\t\t});\n\t\tconst delay = 400;\n\t\tfunction run() {\n\t\t\tif (!cg.state.dom.elements.board.offsetParent) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcg.move('e2', 'a8');\n\t\t\tsetTimeout(() => {\n\t\t\t\tcg.move('a8', 'e2');\n\t\t\t\tsetTimeout(run, delay);\n\t\t\t}, delay);\n\t\t}\n\t\tsetTimeout(run, delay);\n\t\treturn cg;\n\t},\n};\n/**\n * Represents a unit test for the performance of square selection in a chessboard.\n *\n * @constant\n * @type {Unit}\n * @name select\n * @property {string} name - The name of the performance test.\n * @property {function} run - The function that runs the performance test.\n * @param {HTMLElement} cont - The container element for the chessboard.\n * @returns {Chessground} - The Chessground instance.\n *\n * The `run` function initializes a Chessground instance with specific movable\n * destinations for the square \"e2\". It then repeatedly selects the square \"e2\"\n * and \"d4\" with a delay of 500 milliseconds between each selection.\n */\nexport const select: Unit = {\n\tname: 'Perf: square select',\n\trun(cont) {\n\t\tconst cg = Chessground(cont, {\n\t\t\tmovable: {\n\t\t\t\tfree: false,\n\t\t\t\tdests: new Map([['e2', ['e3', 'e4', 'd3', 'f3']]]),\n\t\t\t},\n\t\t});\n\t\tconst delay = 500;\n\t\tfunction run() {\n\t\t\tif (!cg.state.dom.elements.board.offsetParent) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcg.selectSquare('e2');\n\t\t\tsetTimeout(() => {\n\t\t\t\tcg.selectSquare('d4');\n\t\t\t\tsetTimeout(run, delay);\n\t\t\t}, delay);\n\t\t}\n\t\tsetTimeout(run, delay);\n\t\treturn cg;\n\t},\n};\n","import type { Chess as ChessInstance, Move } from 'chess.js';\nimport { Chess } from 'chess.js';\nimport { Chessground } from 'chessground';\nimport type { Unit } from './unit';\n\n/**\n * A PGN (Portable Game Notation) string representing a chess game.\n *\n * The PGN includes metadata about the game such as event, site, date, players,\n * their ratings, and the result. It also contains the moves of the game along\n * with timestamps for each move.\n *\n * Example metadata:\n * - Event: Rated Blitz game\n * - Site: https://lichess.org/hvB20kxq\n * - Date: 2018.05.19\n * - White: topce\n * - Black: donateIIo\n * - Result: 1-0\n * - WhiteElo: 2342\n * - BlackElo: 2406\n * - WhiteRatingDiff: +12\n * - BlackRatingDiff: -12\n * - BlackTitle: GM\n * - Variant: Standard\n * - TimeControl: 180+0\n * - ECO: A00\n * - Opening: Anderssen Opening\n * - Termination: Normal\n *\n * Example moves:\n * 1. a3 { [%clk 0:03:00] } a6 { [%clk 0:03:00] }\n * 2. b3 { [%clk 0:02:59] } h6 { [%clk 0:03:00] }\n * 3. c3 { [%clk 0:02:59] } Nf6 { [%clk 0:02:57] }\n * ...\n * 39. Rd7# { [%clk 0:00:55] } 1-0\n */\nconst pgn = `[Event \"Rated Blitz game\"]\n[Site \"https://lichess.org/hvB20kxq\"]\n[Date \"2018.05.19\"]\n[White \"topce\"]\n[Black \"donateIIo\"]\n[Result \"1-0\"]\n[UTCDate \"2018.05.19\"]\n[UTCTime \"09:36:44\"]\n[WhiteElo \"2342\"]\n[BlackElo \"2406\"]\n[WhiteRatingDiff \"+12\"]\n[BlackRatingDiff \"-12\"]\n[BlackTitle \"GM\"]\n[Variant \"Standard\"]\n[TimeControl \"180+0\"]\n[ECO \"A00\"]\n[Opening \"Anderssen Opening\"]\n[Termination \"Normal\"]\n\n1. a3 { [%clk 0:03:00] } a6 { [%clk 0:03:00] } 2. b3 { [%clk 0:02:59] } h6 { [%clk 0:03:00] } 3. c3 { [%clk 0:02:59] } Nf6 { [%clk 0:02:57] } 4. d3 { [%clk 0:02:59] } d5 { [%clk 0:02:57] } 5. e3 { [%clk 0:02:59] } e5 { [%clk 0:02:56] } 6. f3 { [%clk 0:02:58] } c5 { [%clk 0:02:55] } 7. g3 { [%clk 0:02:58] } Nc6 { [%clk 0:02:55] } 8. h3 { [%clk 0:02:58] } Be7 { [%clk 0:02:54] } 9. Ra2 { [%clk 0:02:57] } O-O { [%clk 0:02:53] } 10. Rg2 { [%clk 0:02:55] } b5 { [%clk 0:02:52] } 11. g4 { [%clk 0:02:54] } e4 { [%clk 0:02:46] } 12. f4 { [%clk 0:02:49] } d4 { [%clk 0:02:42] } 13. g5 { [%clk 0:02:43] } hxg5 { [%clk 0:02:40] } 14. fxg5 { [%clk 0:02:42] } Nd5 { [%clk 0:02:39] } 15. dxe4 { [%clk 0:02:35] } Nxe3 { [%clk 0:02:36] } 16. Bxe3 { [%clk 0:02:34] } dxe3 { [%clk 0:02:36] } 17. Qxd8 { [%clk 0:02:33] } Rxd8 { [%clk 0:02:34] } 18. h4 { [%clk 0:02:25] } Be6 { [%clk 0:02:31] } 19. h5 { [%clk 0:02:19] } Bxb3 { [%clk 0:02:28] } 20. Be2 { [%clk 0:02:18] } Ne5 { [%clk 0:02:25] } 21. g6 { [%clk 0:02:16] } Nd3+ { [%clk 0:02:18] } 22. Bxd3 { [%clk 0:02:14] } Rxd3 { [%clk 0:02:18] } 23. h6 { [%clk 0:02:06] } Rd1+ { [%clk 0:02:07] } 24. Ke2 { [%clk 0:02:04] } Rxb1 { [%clk 0:02:07] } 25. gxf7+ { [%clk 0:01:59] } Kxf7 { [%clk 0:02:07] } 26. Rxg7+ { [%clk 0:01:53] } Ke6 { [%clk 0:02:06] } 27. h7 { [%clk 0:01:48] } Bc4+ { [%clk 0:01:36] } 28. Kxe3 { [%clk 0:01:46] } Rh8 { [%clk 0:01:07] } 29. Rh6+ { [%clk 0:01:34] } Bf6 { [%clk 0:00:59] } 30. Nf3 { [%clk 0:01:31] } Rf1 { [%clk 0:00:31] } 31. Rgg6 { [%clk 0:01:17] } Ke7 { [%clk 0:00:23] } 32. Rxf6 { [%clk 0:01:13] } Rxh7 { [%clk 0:00:22] } 33. Rxa6 { [%clk 0:01:05] } Rxh6 { [%clk 0:00:21] } 34. Rxh6 { [%clk 0:01:03] } Ra1 { [%clk 0:00:20] } 35. Ne5 { [%clk 0:01:01] } Rxa3 { [%clk 0:00:19] } 36. Kf4 { [%clk 0:01:00] } Rxc3 { [%clk 0:00:18] } 37. Kf5 { [%clk 0:00:58] } b4 { [%clk 0:00:17] } 38. Rh7+ { [%clk 0:00:58] } Kd6 { [%clk 0:00:16] } 39. Rd7# { [%clk 0:00:55] } 1-0\n\n\n`;\n/**\n * Unit to replay a PGN (Portable Game Notation) game in real time.\n *\n * @constant\n * @type {Unit}\n * @name loadPgnRealTime\n * @property {string} name - The name of the unit.\n * @property {Function} run - Function to execute the replay of the PGN game.\n * @param {HTMLElement} el - The HTML element where the chessboard will be rendered.\n * @returns {Chessground} - The Chessground instance used to render the chessboard and replay the game.\n *\n * The function performs the following steps:\n * 1. Initializes a new Chess instance and loads the PGN data.\n * 2. Creates a new Chessground instance with specific animation and movement settings.\n * 3. Retrieves the move history and comments from the PGN.\n * 4. Calculates the time control and think times for each move.\n * 5. Sets timeouts to replay each move on the chessboard in real time.\n */\nexport const loadPgnRealTime: Unit = {\n\tname: 'replay pgn game in real time',\n\trun(el) {\n\t\tconst chess: ChessInstance = new Chess();\n\t\tchess.loadPgn(pgn);\n\t\tconst cg = Chessground(el, {\n\t\t\tanimation: {\n\t\t\t\tduration: 500,\n\t\t\t},\n\t\t\tmovable: {\n\t\t\t\tfree: false,\n\t\t\t},\n\t\t});\n\t\tconst history: Move[] = chess.history({ verbose: true });\n\n\t\tconst comments: { fen: string; comment: string }[] = chess.getComments();\n\t\tconst header = chess.header();\n\t\tconst timeControl = header.TimeControl?.split('+');\n\t\tlet timeControlInSeconds = 180;\n\t\tif (timeControl) {\n\t\t\tconst total = Number.parseInt(timeControl[0], 10);\n\t\t\tconst increment = Number.parseInt(timeControl[1], 10);\n\t\t\ttimeControlInSeconds = total + increment * (comments.length / 2);\n\t\t}\n\n\t\tconst timeOuts: number[] = [];\n\n\t\tlet whiteThinkTime = 0;\n\t\tlet blackThinkTime = 0;\n\n\t\tfor (let j = 0; j < comments.length; j++) {\n\t\t\tconst minutes = Number.parseInt(comments[j].comment.substring(9, 11), 10);\n\t\t\tconst seconds = Number.parseInt(\n\t\t\t\tcomments[j].comment.substring(12, 14),\n\t\t\t\t10,\n\t\t\t);\n\t\t\tconst timeLeft = minutes * 60 + seconds;\n\t\t\tconst thinkTime = timeControlInSeconds - timeLeft;\n\n\t\t\tif (j % 2 === 0) {\n\t\t\t\tblackThinkTime = thinkTime;\n\t\t\t} else {\n\t\t\t\twhiteThinkTime = thinkTime;\n\t\t\t}\n\t\t\ttimeOuts.push(whiteThinkTime + blackThinkTime + j / 1000);\n\t\t}\n\n\t\tfor (let i = 0; i < history.length; i++) {\n\t\t\tsetTimeout(() => {\n\t\t\t\tif (!cg.state.dom.elements.board.offsetParent) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcg.move(history[i].from, history[i].to);\n\t\t\t}, timeOuts[i] * 1000);\n\t\t}\n\n\t\treturn cg;\n\t},\n};\n/**\n * Represents a unit that replays a PGN (Portable Game Notation) game with one second per move.\n *\n * @constant\n * @type {Unit}\n * @name loadPgnOneSecondPerMove\n *\n * @property {string} name - The name of the unit.\n * @property {Function} run - The function that executes the unit.\n *\n * @param {HTMLElement} el - The HTML element where the chessboard will be rendered.\n * @returns {Chessground} - The Chessground instance with the replayed game.\n *\n * The `run` function performs the following steps:\n * 1. Initializes a new Chess instance and loads the PGN.\n * 2. Creates a new Chessground instance with specific animation and movement settings.\n * 3. Retrieves the move history and comments from the Chess instance.\n * 4. Iterates through the move history and replays each move on the Chessground board with a one-second interval.\n */\nexport const loadPgnOneSecondPerMove: Unit = {\n\tname: 'replay pgn game one second per move',\n\trun(el) {\n\t\tconst chess: ChessInstance = new Chess();\n\t\tchess.loadPgn(pgn);\n\t\tconst cg = Chessground(el, {\n\t\t\tanimation: {\n\t\t\t\tduration: 500,\n\t\t\t},\n\t\t\tmovable: {\n\t\t\t\tfree: false,\n\t\t\t},\n\t\t});\n\t\tconst history: Move[] = chess.history({ verbose: true });\n\n\t\tconst _comments: { fen: string; comment: string }[] = chess.getComments();\n\t\tconst _header = chess.header();\n\n\t\tfor (let i = 0; i < history.length; i++) {\n\t\t\tsetTimeout(() => {\n\t\t\t\tif (!cg.state.dom.elements.board.offsetParent) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcg.move(history[i].from, history[i].to);\n\t\t\t}, i * 1000);\n\t\t}\n\n\t\treturn cg;\n\t},\n};\n/**\n * Unit to replay a PGN game in proportional time of 1 minute.\n *\n * @constant\n * @type {Unit}\n * @name loadPgnProportionalTime\n *\n * @property {string} name - The name of the unit.\n * @property {Function} run - The function to execute the unit.\n *\n * @param {HTMLElement} el - The HTML element to attach the chessboard to.\n *\n * @returns {Chessground} - The Chessground instance with the replayed game.\n *\n * The `run` function performs the following steps:\n * 1. Initializes a new Chess instance and loads the PGN.\n * 2. Creates a new Chessground instance with specific animation and movement settings.\n * 3. Retrieves the move history and comments from the chess instance.\n * 4. Calculates the think time for each move based on the comments.\n * 5. Sets timeouts to replay each move on the Chessground instance in proportional time.\n */\nexport const loadPgnProportionalTime: Unit = {\n\tname: 'replay pgn game in proprtional time 1 minute',\n\trun(el) {\n\t\tconst chess: ChessInstance = new Chess();\n\t\tchess.loadPgn(pgn);\n\t\tconst cg = Chessground(el, {\n\t\t\tanimation: {\n\t\t\t\tduration: 500,\n\t\t\t},\n\t\t\tmovable: {\n\t\t\t\tfree: false,\n\t\t\t},\n\t\t});\n\t\tconst history: Move[] = chess.history({ verbose: true });\n\n\t\tconst comments: { fen: string; comment: string }[] = chess.getComments();\n\t\tconst _header = chess.header();\n\n\t\tconst timeOuts: number[] = [];\n\n\t\tlet whiteThinkTime = 0;\n\t\tlet blackThinkTime = 0;\n\n\t\tfor (let j = 0; j < comments.length; j++) {\n\t\t\tconst minutes = Number.parseInt(comments[j].comment.substring(9, 11), 10);\n\t\t\tconst seconds = Number.parseInt(\n\t\t\t\tcomments[j].comment.substring(12, 14),\n\t\t\t\t10,\n\t\t\t);\n\t\t\tconst timeLeft = minutes * 60 + seconds;\n\t\t\tconst thinkTime = 180 - timeLeft;\n\n\t\t\tif (j % 2 === 0) {\n\t\t\t\tblackThinkTime = thinkTime;\n\t\t\t} else {\n\t\t\t\twhiteThinkTime = thinkTime;\n\t\t\t}\n\t\t\ttimeOuts.push(whiteThinkTime + blackThinkTime + j / 1000);\n\t\t}\n\n\t\tfor (let i = 0; i < history.length; i++) {\n\t\t\tsetTimeout(\n\t\t\t\t() => {\n\t\t\t\t\tif (!cg.state.dom.elements.board.offsetParent) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tcg.move(history[i].from, history[i].to);\n\t\t\t\t},\n\t\t\t\ttimeOuts[i] * (30 / 180) * 1000,\n\t\t\t);\n\t\t}\n\n\t\treturn cg;\n\t},\n};\n","import { Chessground } from 'chessground';\nimport type { DrawShape } from 'chessground/draw';\nimport type { Unit } from './unit';\n\n/**\n * Represents a unit test case for preset user shapes in Chessground.\n * This unit initializes a Chessground instance with predefined drawable shapes.\n *\n * @type {Unit}\n * @property {string} name - The name of the unit test case\n * @property {(el: HTMLElement) => Api} run - Function that initializes Chessground with preset shapes\n */\nexport const presetUserShapes: Unit = {\n\tname: 'Preset user shapes',\n\trun: (el) => Chessground(el, { drawable: { shapes: shapeSet1 } }),\n};\n\n/**\n * Unit test for automatically changing shapes with high difference between states\n * Creates a Chessground instance that cycles through different shape sets at regular intervals\n *\n * @property {string} name - The name of the unit test\n * @property {function} run - Function that executes the shape changing logic\n * @param {HTMLElement} el - The DOM element where Chessground will be mounted\n * @returns {Api} The Chessground API instance\n *\n * @remarks\n * The function cycles through three predefined shape sets (shapeSet1, shapeSet2, shapeSet3)\n * with a delay of 1000ms between changes. The cycling continues until the board\n * is no longer in the DOM (checked via offsetParent).\n */\nexport const changingShapesHigh: Unit = {\n\tname: 'Automatically changing shapes (high diff)',\n\trun(el) {\n\t\tconst cg = Chessground(el, { drawable: { shapes: shapeSet1 } });\n\t\tconst delay = 1000;\n\t\tconst sets = [shapeSet1, shapeSet2, shapeSet3];\n\t\tlet i = 0;\n\t\tfunction run() {\n\t\t\tif (!cg.state.dom.elements.board.offsetParent) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcg.setShapes(sets[++i % sets.length]);\n\t\t\tsetTimeout(run, delay);\n\t\t}\n\t\tsetTimeout(run, delay);\n\t\treturn cg;\n\t},\n};\n\n/**\n * Represents a unit that automatically changes shapes with a low difficulty level.\n *\n * @constant\n * @type {Unit}\n * @name changingShapesLow\n *\n * @property {string} name - The name of the unit.\n * @property {function} run - The function that initializes the Chessground instance and starts the automatic shape changing.\n *\n * @param {HTMLElement} el - The HTML element where the Chessground instance will be initialized.\n *\n * @returns {Chessground} The initialized Chessground instance.\n */\nexport const changingShapesLow: Unit = {\n\tname: 'Automatically changing shapes (low diff)',\n\trun(el) {\n\t\tconst cg = Chessground(el, { drawable: { shapes: shapeSet1 } });\n\t\tconst delay = 1000;\n\t\tconst sets = [shapeSet1, shapeSet2, shapeSet3];\n\t\tlet i = 0;\n\t\tfunction run() {\n\t\t\tif (!cg.state.dom.elements.board.offsetParent) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcg.setShapes(sets[++i % sets.length]);\n\t\t\tsetTimeout(run, delay);\n\t\t}\n\t\tsetTimeout(run, delay);\n\t\treturn cg;\n\t},\n};\n\n/**\n * Represents a unit that applies brush modifiers to drawable shapes on a chessboard.\n *\n * @constant\n * @type {Unit}\n * @name brushModifiers\n *\n * @property {string} name - The name of the unit.\n * @property {Function} run - The function that initializes the brush modifiers on the given element.\n *\n * @param {HTMLElement} el - The HTML element to which the brush modifiers will be applied.\n *\n * @returns {Chessground} - The Chessground instance with the applied brush modifiers.\n *\n * The `run` function:\n * - Generates sets of drawable shapes with random brush modifiers.\n * - Initializes a Chessground instance with the first set of shapes.\n * - Continuously updates the shapes on the chessboard at a specified interval.\n */\nexport const brushModifiers: Unit = {\n\tname: 'Brush modifiers',\n\trun(el) {\n\t\tfunction sets() {\n\t\t\treturn [shapeSet1, shapeSet2, shapeSet3].map((set: DrawShape[]) =>\n\t\t\t\tset.map((shape: DrawShape) => {\n\t\t\t\t\tshape.modifiers = Math.round(Math.random())\n\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\tlineWidth: 2 + Math.round(Math.random() * 3) * 4,\n\t\t\t\t\t\t\t};\n\t\t\t\t\treturn shape;\n\t\t\t\t}),\n\t\t\t);\n\t\t}\n\t\tconst cg = Chessground(el, { drawable: { shapes: sets()[0] } });\n\t\tconst delay = 1000;\n\t\tlet i = 0;\n\t\tfunction run() {\n\t\t\tif (!cg.state.dom.elements.board.offsetParent) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcg.setShapes(sets()[++i % sets().length]);\n\t\t\tsetTimeout(run, delay);\n\t\t}\n\t\tsetTimeout(run, delay);\n\t\treturn cg;\n\t},\n};\n\n/**\n * Represents a unit that automatically generates and sets shapes on a chessboard.\n *\n * @constant\n * @type {Unit}\n * @name autoShapes\n *\n * @property {string} name - The name of the unit.\n * @property {function} run - The function that initializes and runs the auto shape generation.\n *\n * @param {HTMLElement} el - The HTML element where the chessboard will be rendered.\n *\n * @returns {Chessground} - The Chessground instance with auto shapes functionality.\n */\nexport const autoShapes: Unit = {\n\tname: 'Autoshapes',\n\trun(el) {\n\t\tfunction sets() {\n\t\t\treturn [shapeSet1, shapeSet2, shapeSet3].map((set: DrawShape[]) =>\n\t\t\t\tset.map((shape: DrawShape) => {\n\t\t\t\t\tshape.modifiers = Math.round(Math.random())\n\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\tlineWidth: 2 + Math.round(Math.random() * 3) * 4,\n\t\t\t\t\t\t\t};\n\t\t\t\t\treturn shape;\n\t\t\t\t}),\n\t\t\t);\n\t\t}\n\t\tconst cg = Chessground(el);\n\t\tconst delay = 1000;\n\t\tlet i = 0;\n\t\tfunction run() {\n\t\t\tif (!cg.state.dom.elements.board.offsetParent) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcg.setAutoShapes(sets()[++i % sets().length]);\n\t\t\tsetTimeout(run, delay);\n\t\t}\n\t\tsetTimeout(run, delay);\n\t\treturn cg;\n\t},\n};\n\n/**\n * A unit configuration for creating a Chessground instance with shapes not visible.\n *\n * @constant\n * @type {Unit}\n * @name visibleFalse\n *\n * @property {string} name - The name of the unit.\n * @property {Function} run - A function that initializes a Chessground instance with the specified element.\n * @param {HTMLElement} el - The HTML element to initialize the Chessground instance on.\n *\n * @example\n * // Usage example:\n * visibleFalse.run(document.getElementById('chessboard'));\n */\nexport const visibleFalse: Unit = {\n\tname: 'Shapes not visible',\n\trun: (el) =>\n\t\tChessground(el, {\n\t\t\tdrawable: {\n\t\t\t\tvisible: false,\n\t\t\t\tshapes: shapeSet1,\n\t\t\t},\n\t\t}),\n};\n\n/**\n * A unit configuration object for a chessboard with shapes that are not enabled but still visible.\n *\n * @constant\n * @type {Unit}\n * @property {string} name - The name of the unit.\n * @property {function} run - A function that initializes a Chessground instance with the given element.\n * @param {HTMLElement} el - The HTML element to initialize the Chessground instance on.\n * @returns {void}\n */\nexport const enabledFalse: Unit = {\n\tname: 'Shapes not enabled, but visible',\n\trun: (el) =>\n\t\tChessground(el, {\n\t\t\tdrawable: {\n\t\t\t\tenabled: false,\n\t\t\t\tshapes: shapeSet1,\n\t\t\t},\n\t\t}),\n};\n\n/**\n * A predefined set of drawing shapes for a chessboard.\n * Each shape can represent a square highlight, an arrow, or a piece on the board.\n *\n * @type {DrawShape[]}\n *\n * @property {string} orig - The origin square of the shape.\n * @property {string} [dest] - The destination square of the shape (for arrows).\n * @property {string} brush - The color of the shape.\n * @property {Object} [piece] - The piece to be drawn on the board.\n * @property {string} piece.color - The color of the piece (e.g., \"white\" or \"black\").\n * @property {string} piece.role - The role of the piece (e.g., \"knight\", \"queen\").\n * @property {number} [piece.scale] - The scale of the piece (optional).\n */\nconst shapeSet1: DrawShape[] = [\n\t{ orig: 'a3', brush: 'green' },\n\t{ orig: 'a4', brush: 'blue' },\n\t{ orig: 'a5', brush: 'yellow' },\n\t{ orig: 'a6', brush: 'red' },\n\t{ orig: 'e2', dest: 'e4', brush: 'green' },\n\t{ orig: 'a6', dest: 'c8', brush: 'blue' },\n\t{ orig: 'f8', dest: 'f4', brush: 'yellow' },\n\t{\n\t\torig: 'h5',\n\t\tbrush: 'green',\n\t\tpiece: {\n\t\t\tcolor: 'white',\n\t\t\trole: 'knight',\n\t\t},\n\t},\n\t{\n\t\torig: 'h6',\n\t\tbrush: 'red',\n\t\tpiece: {\n\t\t\tcolor: 'black',\n\t\t\trole: 'queen',\n\t\t\tscale: 0.6,\n\t\t},\n\t},\n];\n\n/**\n * A set of drawing shapes used for rendering on a chessboard.\n * Each shape can represent a square highlight or an arrow between two squares.\n *\n * @type {DrawShape[]}\n *\n * @property {string} orig - The origin square of the shape.\n * @property {string} [dest] - The destination square of the shape (for arrows).\n * @property {string} brush - The color of the shape.\n * @property {Object} [piece] - The piece to be drawn on the origin square.\n * @property {string} piece.color - The color of the piece (e.g., \"black\" or \"white\").\n * @property {string} piece.role - The role of the piece (e.g., \"bishop\", \"knight\").\n */\nconst shapeSet2: DrawShape[] = [\n\t{ orig: 'c1', brush: 'green' },\n\t{ orig: 'd1', brush: 'blue' },\n\t{ orig: 'e1', brush: 'yellow' },\n\t{ orig: 'e2', dest: 'e4', brush: 'green' },\n\t{ orig: 'h6', dest: 'h8', brush: 'blue' },\n\t{ orig: 'b3', dest: 'd6', brush: 'red' },\n\t{ orig: 'a1', dest: 'e1', brush: 'red' },\n\t{\n\t\torig: 'f5',\n\t\tbrush: 'green',\n\t\tpiece: {\n\t\t\tcolor: 'black',\n\t\t\trole: 'bishop',\n\t\t},\n\t},\n];\n\n/**\n * A constant array of DrawShape objects representing shapes to be drawn on a chessboard.\n *\n * @constant\n * @type {DrawShape[]}\n * @default\n * @property {string} orig - The origin square of the shape on the chessboard.\n * @property {string} brush - The color of the shape.\n *\n * Example usage:\n * ```\n * const shapeSet3: DrawShape[] = [{ orig: \"e5\", brush: \"blue\" }];\n * ```\n */\nconst shapeSet3: DrawShape[] = [{ orig: 'e5', brush: 'blue' }];\n\n/**\n * A set of drawing shapes for a chessboard.\n * Each shape can represent a square highlight or an arrow between two squares.\n * Shapes can also include a piece with specific attributes.\n *\n * @type {DrawShape[]}\n * @property {string} orig - The origin square of the shape.\n * @property {string} [dest] - The destination square of the shape (for arrows).\n * @property {string} brush - The color of the shape.\n * @property {Object} [piece] - The piece to be drawn on the square.\n * @property {string} piece.color - The color of the piece (e.g., \"white\" or \"black\").\n * @property {string} piece.role - The role of the piece (e.g., \"knight\", \"queen\").\n * @property {number} [piece.scale] - The scale of the piece (optional).\n */\n","import { Chess } from 'chess.js';\nimport { Chessground } from 'chessground';\nimport type { Unit } from './unit';\n\n/**\n * Represents a unit configuration for a chessboard that is view-only and\n * features two random AIs making moves.\n *\n * @constant\n * @type {Unit}\n * @name viewOnlyFullRandom\n *\n * @property {string} name - The name of the unit.\n * @property {Function} run - The function that initializes the chessboard\n * and starts the random AI moves.\n *\n * @param {HTMLElement} el - The HTML element where the chessboard will be rendered.\n *\n * @returns {Chessground} - The initialized Chessground instance.\n */\nexport const viewOnlyFullRandom: Unit = {\n\tname: 'View only: 2 random AIs',\n\trun(el) {\n\t\tconst chess = new Chess();\n\t\tconst cg = Chessground(el, {\n\t\t\tviewOnly: true,\n\t\t\tanimation: {\n\t\t\t\tduration: 1000,\n\t\t\t},\n\t\t\tmovable: {\n\t\t\t\tfree: false,\n\t\t\t},\n\t\t\tdrawable: {\n\t\t\t\tvisible: false,\n\t\t\t},\n\t\t});\n\t\tfunction makeMove() {\n\t\t\tif (!cg.state.dom.elements.board.offsetParent) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst moves = chess.moves({ verbose: true });\n\t\t\tconst move = moves[Math.floor(Math.random() * moves.length)];\n\t\t\tchess.move(move.san);\n\t\t\tcg.move(move.from, move.to);\n\t\t\tsetTimeout(makeMove, 700);\n\t\t}\n\t\tsetTimeout(makeMove, 700);\n\t\treturn cg;\n\t},\n};\n","import { Chessground } from 'chessground';\nimport type { Key } from 'chessground/types.d';\nimport type { Unit } from './unit';\n\n/**\n * Represents a unit for the Crazyhouse variant where the last move is a drop.\n * This unit runs a sequence of configurations on a chessboard, each with a specific FEN and last move.\n * The configurations are cycled through with a delay between each change.\n *\n * @constant\n * @type {Unit}\n * @name lastMoveDrop\n *\n * @property {string} name - The name of the unit.\n * @property {function} run - The function that runs the unit.\n * @param {HTMLElement} cont - The container element where the chessboard will be rendered.\n * @returns {Chessground} - The Chessground instance.\n */\nexport const lastMoveDrop: Unit = {\n\tname: 'Crazyhouse: lastMove = drop',\n\trun(cont) {\n\t\tconst configs: Array<() => { fen: string; lastMove: Key[] }> = [\n\t\t\t() => ({\n\t\t\t\tfen: 'Bn2kb1r/p1p2ppp/4q3/2Pp4/3p1NP1/2B2n2/PPP2P1P/R2KqB1R/RNpp w k - 42 22',\n\t\t\t\tlastMove: ['e5', 'd4'],\n\t\t\t}),\n\t\t\t() => ({\n\t\t\t\tfen: 'Bn2kb1r/p1p2ppp/4q3/2Pp4/3p1NP1/2B2n2/PPP2P1P/R2KqB1R/RNpp w k - 42 22',\n\t\t\t\tlastMove: ['f4'],\n\t\t\t}),\n\t\t\t() => ({\n\t\t\t\tfen: 'Bn2kb1r/p1p2ppp/4q3/2Pp4/3p1NP1/2B2n2/PPP2P1P/R2KqB1R/RNpp w k - 42 22',\n\t\t\t\tlastMove: ['e1'],\n\t\t\t}),\n\t\t];\n\t\tconst cg = Chessground(cont, configs[0]());\n\t\tconst delay = 2000;\n\t\tlet it = 0;\n\t\tfunction run() {\n\t\t\tif (!cg.state.dom.elements.board.offsetParent) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst config = configs[++it % configs.length];\n\t\t\t//console.log(config);\n\t\t\tcg.set(config());\n\t\t\tsetTimeout(run, delay);\n\t\t}\n\t\tsetTimeout(run, delay);\n\t\treturn cg;\n\t},\n};\n","/*\n * Public API Surface of ngx-chessground\n */\n\nexport * from './lib/ngx-chessground/ngx-chessground.component';\nexport * from './lib/ngx-chessground-table/ngx-chessground-table.component';\nexport * from './lib/pgn-viewer/board/board-display.component';\nexport * from './lib/pgn-viewer/board/evaluation-bar.component';\nexport * from './lib/pgn-viewer/desktop-runtime';\nexport * from './lib/pgn-viewer/filter/game-filter-panel.component';\nexport * from './lib/pgn-viewer/filter/player-typeahead.component';\nexport * from './lib/pgn-viewer/lichess-broadcast-url';\nexport * from './lib/pgn-viewer/load-cache/load-cache-panel.component';\nexport * from './lib/pgn-viewer/moves/move-list.component';\nexport * from './lib/pgn-viewer/pgn-cache.service';\nexport * from './lib/pgn-viewer/pgn-viewer.component';\nexport * from './lib/pgn-viewer/pgn-viewer.types';\nexport * from './lib/pgn-viewer/pgn-viewer-engine.service';\nexport * from './lib/pgn-viewer/pgn-viewer-notifier';\nexport * from './lib/pgn-viewer/pgn-viewer-settings.service';\nexport * from './lib/pgn-viewer/pgn-viewer-store.service';\nexport * from './lib/pgn-viewer/replay/replay-panel.component';\nexport * from './lib/pgn-viewer/text-highlight';\nexport * from './lib/promotion-dialog/promotion.service';\nexport * from './lib/promotion-dialog/promotion-dialog.component';\n\nexport * from './units/anim';\nexport * from './units/basics';\nexport * from './units/fen';\nexport * from './units/in3d';\nexport * from './units/perf';\nexport * from './units/pgn';\nexport * from './units/play';\nexport * from './units/svg';\nexport * from './units/unit';\nexport * from './units/util';\nexport * from './units/viewOnly';\nexport * from './units/zh';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["play.createPlayUnitsWithDialog","loadZipAsync","decompressZst"],"mappings":";;;;;;;;;;;;;;;;AAYA;;;;;;;;;;;;;;;AAeG;MAEU,qBAAqB,CAAA;AADlC,IAAA,WAAA,GAAA;AAEC;;;AAGG;QACc,IAAA,CAAA,KAAK,GAAG,IAAI,CAAC;YAC7B,WAAW;YACX,gBAAgB;YAChB,oBAAoB;AACpB,SAAA,CAAC;AAiBF;;;;AAIG;QACK,IAAA,CAAA,OAAO,GAAuB,IAAI;AAQ1C;;;;AAIG;QACK,IAAA,CAAA,aAAa,GAA2B,IAAI;AAiGpD;;;;;;;;;;;;AAYG;AACc,QAAA,IAAA,CAAA,OAAO,GAAG,CAAC,KAAY,EAAE,QAAgB,KAAI;AAC7D,YAAA,MAAM,EAAE,GAAG,KAAK,CAAC,GAAkB;AACnC,YAAA,EAAE,CAAC,SAAS,GAAG,SAAS;AACxB,YAAA,IAAI,CAAC,OAAO,GAAG,EAAE;YACjB,IAAI,CAAC,QAAQ,EAAE;;gBAEd,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YACzB;YACA,OAAO,IAAI,CAAC,EAAE;AACf,QAAA,CAAC;AACD,IAAA;AAtHA;;;;;;;;;;;AAWG;IACI,MAAM,CAAC,OAAoB,EAAE,KAA+B,EAAA;AAClE,QAAA,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK;YAAE;AAC1B,QAAA,IAAI,CAAC,KAAK,GAAG,KAAK;AAClB,QAAA,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE;;AAEb,YAAA,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC;QAChD;AAAO,aAAA,IAAI,IAA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