@sudobility/sudojo_lib 0.0.201 → 0.0.203
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin/adminApi.d.ts +34 -0
- package/dist/admin/adminApi.d.ts.map +1 -0
- package/dist/admin/adminApi.js +59 -0
- package/dist/admin/adminApi.js.map +1 -0
- package/dist/admin/boardRules.d.ts +75 -0
- package/dist/admin/boardRules.d.ts.map +1 -0
- package/dist/admin/boardRules.js +127 -0
- package/dist/admin/boardRules.js.map +1 -0
- package/dist/admin/boardStrings.d.ts +55 -0
- package/dist/admin/boardStrings.d.ts.map +1 -0
- package/dist/admin/boardStrings.js +99 -0
- package/dist/admin/boardStrings.js.map +1 -0
- package/dist/admin/examples.d.ts +58 -0
- package/dist/admin/examples.d.ts.map +1 -0
- package/dist/admin/examples.js +104 -0
- package/dist/admin/examples.js.map +1 -0
- package/dist/admin/extraction.d.ts +87 -0
- package/dist/admin/extraction.d.ts.map +1 -0
- package/dist/admin/extraction.js +141 -0
- package/dist/admin/extraction.js.map +1 -0
- package/dist/admin/index.d.ts +32 -0
- package/dist/admin/index.d.ts.map +1 -0
- package/dist/admin/index.js +22 -0
- package/dist/admin/index.js.map +1 -0
- package/dist/admin/jobs.d.ts +108 -0
- package/dist/admin/jobs.d.ts.map +1 -0
- package/dist/admin/jobs.js +435 -0
- package/dist/admin/jobs.js.map +1 -0
- package/dist/admin/regenerateHints.d.ts +16 -0
- package/dist/admin/regenerateHints.d.ts.map +1 -0
- package/dist/admin/regenerateHints.js +43 -0
- package/dist/admin/regenerateHints.js.map +1 -0
- package/dist/admin/types.d.ts +42 -0
- package/dist/admin/types.d.ts.map +1 -0
- package/dist/admin/types.js +21 -0
- package/dist/admin/types.js.map +1 -0
- package/dist/admin/useAdminJob.d.ts +28 -0
- package/dist/admin/useAdminJob.d.ts.map +1 -0
- package/dist/admin/useAdminJob.js +99 -0
- package/dist/admin/useAdminJob.js.map +1 -0
- package/dist/admin/useAdminStats.d.ts +46 -0
- package/dist/admin/useAdminStats.d.ts.map +1 -0
- package/dist/admin/useAdminStats.js +91 -0
- package/dist/admin/useAdminStats.js.map +1 -0
- package/dist/admin/useBoardGenerator.d.ts +29 -0
- package/dist/admin/useBoardGenerator.d.ts.map +1 -0
- package/dist/admin/useBoardGenerator.js +38 -0
- package/dist/admin/useBoardGenerator.js.map +1 -0
- package/dist/admin/useBoardTechniquesUpdater.d.ts +14 -0
- package/dist/admin/useBoardTechniquesUpdater.d.ts.map +1 -0
- package/dist/admin/useBoardTechniquesUpdater.js +28 -0
- package/dist/admin/useBoardTechniquesUpdater.js.map +1 -0
- package/dist/admin/useExampleCreator.d.ts +29 -0
- package/dist/admin/useExampleCreator.d.ts.map +1 -0
- package/dist/admin/useExampleCreator.js +58 -0
- package/dist/admin/useExampleCreator.js.map +1 -0
- package/dist/admin/useSingleBoardExtractor.d.ts +18 -0
- package/dist/admin/useSingleBoardExtractor.d.ts.map +1 -0
- package/dist/admin/useSingleBoardExtractor.js +19 -0
- package/dist/admin/useSingleBoardExtractor.js.map +1 -0
- package/dist/admin/useTechniqueExtractor.d.ts +26 -0
- package/dist/admin/useTechniqueExtractor.d.ts.map +1 -0
- package/dist/admin/useTechniqueExtractor.js +37 -0
- package/dist/admin/useTechniqueExtractor.js.map +1 -0
- package/dist/context/SudojoApiContext.d.ts +58 -0
- package/dist/context/SudojoApiContext.d.ts.map +1 -0
- package/dist/context/SudojoApiContext.js +52 -0
- package/dist/context/SudojoApiContext.js.map +1 -0
- package/dist/context/SudojoApiProvider.d.ts +21 -0
- package/dist/context/SudojoApiProvider.d.ts.map +1 -0
- package/dist/context/SudojoApiProvider.js +15 -0
- package/dist/context/SudojoApiProvider.js.map +1 -0
- package/dist/context/index.d.ts +3 -0
- package/dist/context/index.d.ts.map +1 -1
- package/dist/context/index.js +2 -0
- package/dist/context/index.js.map +1 -1
- package/dist/hooks/index.d.ts +24 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +22 -0
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/useBoardEntry.d.ts +65 -5
- package/dist/hooks/useBoardEntry.d.ts.map +1 -1
- package/dist/hooks/useBoardEntry.js +124 -27
- package/dist/hooks/useBoardEntry.js.map +1 -1
- package/dist/hooks/useBoardScan.d.ts +27 -0
- package/dist/hooks/useBoardScan.d.ts.map +1 -0
- package/dist/hooks/useBoardScan.js +27 -0
- package/dist/hooks/useBoardScan.js.map +1 -0
- package/dist/hooks/useCommunities.d.ts +6 -4
- package/dist/hooks/useCommunities.d.ts.map +1 -1
- package/dist/hooks/useCommunities.js +6 -1
- package/dist/hooks/useCommunities.js.map +1 -1
- package/dist/hooks/useCompletionTrigger.d.ts +23 -0
- package/dist/hooks/useCompletionTrigger.d.ts.map +1 -0
- package/dist/hooks/useCompletionTrigger.js +39 -0
- package/dist/hooks/useCompletionTrigger.js.map +1 -0
- package/dist/hooks/useDailyGame.d.ts +11 -6
- package/dist/hooks/useDailyGame.d.ts.map +1 -1
- package/dist/hooks/useDailyGame.js +20 -61
- package/dist/hooks/useDailyGame.js.map +1 -1
- package/dist/hooks/useDeleteAccount.d.ts +72 -0
- package/dist/hooks/useDeleteAccount.d.ts.map +1 -0
- package/dist/hooks/useDeleteAccount.js +71 -0
- package/dist/hooks/useDeleteAccount.js.map +1 -0
- package/dist/hooks/useEnteredGameSession.d.ts +73 -0
- package/dist/hooks/useEnteredGameSession.d.ts.map +1 -0
- package/dist/hooks/useEnteredGameSession.js +155 -0
- package/dist/hooks/useEnteredGameSession.js.map +1 -0
- package/dist/hooks/useGameSession.d.ts +8 -4
- package/dist/hooks/useGameSession.d.ts.map +1 -1
- package/dist/hooks/useGameSession.js +4 -1
- package/dist/hooks/useGameSession.js.map +1 -1
- package/dist/hooks/useGameTeaching.d.ts.map +1 -1
- package/dist/hooks/useGameTeaching.js +11 -13
- package/dist/hooks/useGameTeaching.js.map +1 -1
- package/dist/hooks/useHint.d.ts +7 -7
- package/dist/hooks/useHint.d.ts.map +1 -1
- package/dist/hooks/useHint.js +18 -9
- package/dist/hooks/useHint.js.map +1 -1
- package/dist/hooks/useIsSiteAdmin.d.ts +39 -0
- package/dist/hooks/useIsSiteAdmin.d.ts.map +1 -0
- package/dist/hooks/useIsSiteAdmin.js +31 -0
- package/dist/hooks/useIsSiteAdmin.js.map +1 -0
- package/dist/hooks/useLearning.d.ts +8 -8
- package/dist/hooks/useLearning.d.ts.map +1 -1
- package/dist/hooks/useLearning.js +5 -2
- package/dist/hooks/useLearning.js.map +1 -1
- package/dist/hooks/useLevelGame.d.ts +7 -7
- package/dist/hooks/useLevelGame.d.ts.map +1 -1
- package/dist/hooks/useLevelGame.js +13 -49
- package/dist/hooks/useLevelGame.js.map +1 -1
- package/dist/hooks/useLevels.d.ts +8 -8
- package/dist/hooks/useLevels.d.ts.map +1 -1
- package/dist/hooks/useLevels.js +7 -3
- package/dist/hooks/useLevels.js.map +1 -1
- package/dist/hooks/usePracticeGame.d.ts +53 -0
- package/dist/hooks/usePracticeGame.d.ts.map +1 -0
- package/dist/hooks/usePracticeGame.js +72 -0
- package/dist/hooks/usePracticeGame.js.map +1 -0
- package/dist/hooks/usePuzzleDistribution.d.ts +2 -0
- package/dist/hooks/usePuzzleDistribution.d.ts.map +1 -1
- package/dist/hooks/usePuzzleDistribution.js +4 -14
- package/dist/hooks/usePuzzleDistribution.js.map +1 -1
- package/dist/hooks/usePuzzleProgress.d.ts +37 -0
- package/dist/hooks/usePuzzleProgress.d.ts.map +1 -0
- package/dist/hooks/usePuzzleProgress.js +48 -0
- package/dist/hooks/usePuzzleProgress.js.map +1 -0
- package/dist/hooks/usePuzzleSession.d.ts +215 -0
- package/dist/hooks/usePuzzleSession.d.ts.map +1 -0
- package/dist/hooks/usePuzzleSession.js +358 -0
- package/dist/hooks/usePuzzleSession.js.map +1 -0
- package/dist/hooks/useResumeGame.d.ts +70 -0
- package/dist/hooks/useResumeGame.d.ts.map +1 -0
- package/dist/hooks/useResumeGame.js +123 -0
- package/dist/hooks/useResumeGame.js.map +1 -0
- package/dist/hooks/useStrategies.d.ts +39 -0
- package/dist/hooks/useStrategies.d.ts.map +1 -0
- package/dist/hooks/useStrategies.js +34 -0
- package/dist/hooks/useStrategies.js.map +1 -0
- package/dist/hooks/useSudoku.d.ts +5 -0
- package/dist/hooks/useSudoku.d.ts.map +1 -1
- package/dist/hooks/useSudoku.js +7 -1
- package/dist/hooks/useSudoku.js.map +1 -1
- package/dist/hooks/useTechniqueByPath.d.ts +46 -0
- package/dist/hooks/useTechniqueByPath.d.ts.map +1 -0
- package/dist/hooks/useTechniqueByPath.js +47 -0
- package/dist/hooks/useTechniqueByPath.js.map +1 -0
- package/dist/hooks/useTechniqueExample.d.ts +60 -0
- package/dist/hooks/useTechniqueExample.d.ts.map +1 -0
- package/dist/hooks/useTechniqueExample.js +63 -0
- package/dist/hooks/useTechniqueExample.js.map +1 -0
- package/dist/hooks/useTechniques.d.ts +8 -8
- package/dist/hooks/useTechniques.d.ts.map +1 -1
- package/dist/hooks/useTechniques.js +9 -21
- package/dist/hooks/useTechniques.js.map +1 -1
- package/dist/index.d.ts +418 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +276 -10
- package/dist/index.js.map +1 -1
- package/dist/types/currentGame.d.ts +9 -1
- package/dist/types/currentGame.d.ts.map +1 -1
- package/dist/types/currentGame.js.map +1 -1
- package/dist/utils/auth.d.ts +6 -0
- package/dist/utils/auth.d.ts.map +1 -1
- package/dist/utils/auth.js +8 -0
- package/dist/utils/auth.js.map +1 -1
- package/dist/utils/community.d.ts +64 -0
- package/dist/utils/community.d.ts.map +1 -0
- package/dist/utils/community.js +66 -0
- package/dist/utils/community.js.map +1 -0
- package/dist/utils/date.d.ts +37 -0
- package/dist/utils/date.d.ts.map +1 -0
- package/dist/utils/date.js +68 -0
- package/dist/utils/date.js.map +1 -0
- package/dist/utils/entityTranslate.d.ts +120 -0
- package/dist/utils/entityTranslate.d.ts.map +1 -0
- package/dist/utils/entityTranslate.js +146 -0
- package/dist/utils/entityTranslate.js.map +1 -0
- package/dist/utils/gameFetchStatus.d.ts +74 -0
- package/dist/utils/gameFetchStatus.d.ts.map +1 -0
- package/dist/utils/gameFetchStatus.js +118 -0
- package/dist/utils/gameFetchStatus.js.map +1 -0
- package/dist/utils/gamification.d.ts +36 -0
- package/dist/utils/gamification.d.ts.map +1 -0
- package/dist/utils/gamification.js +33 -0
- package/dist/utils/gamification.js.map +1 -0
- package/dist/utils/hintAccess.d.ts +64 -0
- package/dist/utils/hintAccess.d.ts.map +1 -0
- package/dist/utils/hintAccess.js +57 -0
- package/dist/utils/hintAccess.js.map +1 -0
- package/dist/utils/index.d.ts +31 -10
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +20 -9
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/language.d.ts +123 -0
- package/dist/utils/language.d.ts.map +1 -0
- package/dist/utils/language.js +95 -0
- package/dist/utils/language.js.map +1 -0
- package/dist/utils/localizedHint.d.ts +60 -0
- package/dist/utils/localizedHint.d.ts.map +1 -1
- package/dist/utils/localizedHint.js +90 -0
- package/dist/utils/localizedHint.js.map +1 -1
- package/dist/utils/progress.d.ts +10 -1
- package/dist/utils/progress.d.ts.map +1 -1
- package/dist/utils/progress.js +24 -0
- package/dist/utils/progress.js.map +1 -1
- package/dist/utils/scannedBoard.d.ts +79 -0
- package/dist/utils/scannedBoard.d.ts.map +1 -0
- package/dist/utils/scannedBoard.js +96 -0
- package/dist/utils/scannedBoard.js.map +1 -0
- package/dist/utils/shareUrl.d.ts +38 -15
- package/dist/utils/shareUrl.d.ts.map +1 -1
- package/dist/utils/shareUrl.js +75 -26
- package/dist/utils/shareUrl.js.map +1 -1
- package/dist/utils/subscription.d.ts +118 -0
- package/dist/utils/subscription.d.ts.map +1 -1
- package/dist/utils/subscription.js +212 -0
- package/dist/utils/subscription.js.map +1 -1
- package/dist/utils/sudokuPresenter.d.ts +42 -0
- package/dist/utils/sudokuPresenter.d.ts.map +1 -1
- package/dist/utils/sudokuPresenter.js +114 -1
- package/dist/utils/sudokuPresenter.js.map +1 -1
- package/dist/utils/sudokuScrambler.d.ts +8 -0
- package/dist/utils/sudokuScrambler.d.ts.map +1 -1
- package/dist/utils/sudokuScrambler.js +12 -0
- package/dist/utils/sudokuScrambler.js.map +1 -1
- package/dist/utils/technique.d.ts +112 -1
- package/dist/utils/technique.d.ts.map +1 -1
- package/dist/utils/technique.js +293 -1
- package/dist/utils/technique.js.map +1 -1
- package/dist/utils/techniqueBitmask.d.ts +31 -0
- package/dist/utils/techniqueBitmask.d.ts.map +1 -0
- package/dist/utils/techniqueBitmask.js +53 -0
- package/dist/utils/techniqueBitmask.js.map +1 -0
- package/dist/utils/techniqueExample.d.ts +42 -0
- package/dist/utils/techniqueExample.d.ts.map +1 -0
- package/dist/utils/techniqueExample.js +57 -0
- package/dist/utils/techniqueExample.js.map +1 -0
- package/dist/utils/theme.d.ts +2 -0
- package/dist/utils/theme.d.ts.map +1 -1
- package/dist/utils/theme.js +2 -0
- package/dist/utils/theme.js.map +1 -1
- package/package.json +7 -7
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAqBH,gFAAgF;AAChF,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AA0BhD,kFAAkF;AAClF,OAAO;AACL,+EAA+E;AAC/E,qBAAqB;AACrB,4EAA4E;AAC5E,oBAAoB;AACpB,qDAAqD;AACrD,eAAe;AACf,2CAA2C;AAC3C,gBAAgB;AAChB,oEAAoE;AACpE,YAAY;AACZ,kDAAkD;AAClD,KAAK;AACL,qDAAqD;AACrD,QAAQ;AACR,oDAAoD;AACpD,OAAO;AACP,iDAAiD;AACjD,SAAS;AACT,+DAA+D;AAC/D,aAAa;AACb,kE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AEnB,gEAAgE;AAChE,0BAA0B;AAE1B,yDAAyD;AACzD,cAAc;AACd,0DAA0D;AAC1D,gBAAgB;AAChB,wCAAwC;AACxC,YAAY;AACZ,qEAAqE;AACrE,qBAAqB,GACtB,MAAM,SAAS,CAAC;AAgJjB,+EAA+E;AAC/E,SAAS;AACT,+EAA+E;AAE/E,+FAA+F;AAC/F,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAgB1D,iFAAiF;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAElD,+EAA+E;AAC/E,sBAAsB;AACtB,+EAA+E;AAE/E,oFAAoF;AACpF,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAChD,yDAAyD;AACzD,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAEtE,+EAA+E;AAC/E,wDAAwD;AACxD,+EAA+E;AAE/E,gEAAgE;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,gEAAgE;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC","sourcesContent":["/**\n * @sudobility/sudojo_lib - Business logic library for Sudojo app\n *\n * This library provides:\n * - Game state management with useSudoku hook (ported from renderable)\n * - Board scrambling utilities\n * - Game validation (mistakes, completion)\n * - Level, technique, and learning data hooks\n * - Teaching/hint integration with solver\n * - Legacy useGame hook for backward compatibility\n *\n * ## Hook Architecture\n *\n * The hooks form a layered composition pattern:\n *\n * **Data hooks** (fetch and cache server data):\n * - `useLevels` / `useLevel` - Difficulty level data\n * - `useTechniques` / `useTechnique` - Solving technique data\n * - `useLearning` / `useLearningItem` - Learning material data\n *\n * **Game fetching hooks** (handle auth, subscription, and puzzle loading):\n * - `useLevelGame` - Fetch a random board for a specific level\n * - `useDailyGame` - Fetch today's daily puzzle\n *\n * **Game state hooks** (manage board state and user interaction):\n * - `useSudoku` - Primary game state (flat 81-cell array, modern API)\n * - `useGame` - Legacy game state (2D array, deprecated)\n * - `useBoardEntry` - Manual puzzle entry mode\n *\n * **Feature hooks** (provide specific game features):\n * - `useHint` - Solver integration for hints (matches Kotlin HintInteractor)\n * - `useGameTeaching` - Step-by-step teaching with solver\n * - `useGameTimer` - Elapsed time tracking via ref (no re-renders)\n * - `useGamePersistence` / `useAutoSave` - localStorage game save/restore\n * - `useLocalStorage` - Generic typed localStorage hook\n *\n * **Orchestration hooks** (combine multiple hooks for app-level features):\n * - `useGamePlay` - Current game management with Zustand store (daily/play slots)\n * - `useGameSession` - Server-side gamification (start/finish, points, badges)\n *\n * ## Migration Guide\n *\n * Legacy exports (prefixed with \"Legacy\" comments) use the 2D `GameBoard` type\n * from `useGame`. New code should use `useSudoku` with its flat 81-cell\n * `SudokuBoard` type. See `@deprecated` tags on legacy exports.\n */\n\n// ============================================================================\n// Legacy Types (useGame hook)\n// ============================================================================\n\n/**\n * @deprecated Use `SudokuCell` instead. Part of the legacy `useGame` 2D board API.\n */\nexport type {\n CellPosition,\n CellState,\n GameBoard,\n GameHint,\n GameMove,\n GameSettings,\n GameState,\n GameStatus,\n TeachingState,\n} from './types';\n\n/** @deprecated Use `DEFAULT_APP_SETTINGS` / `DEFAULT_PLAY_SETTINGS` instead. */\nexport { DEFAULT_GAME_SETTINGS } from './types';\n\n// ============================================================================\n// Sudoku Types (useSudoku hook - ported from renderable)\n// ============================================================================\n\n/** Core Sudoku cell and board types using flat 81-cell array representation. */\nexport type {\n /** A single cell in the Sudoku board (indexed 0-80). */\n SudokuCell,\n /** The Sudoku board containing all 81 cells. */\n SudokuBoard,\n /** Current play state including board, settings, and selection. */\n SudokuPlay,\n /** Session settings that can change during play (pencilmarking, auto-pencilmarks). */\n SudokuPlaySettings,\n /** App-level settings persisted across sessions (showErrors, display format). */\n SudokuAppSettings,\n /** Full game state including source, history, and digit mapping. */\n SudokuGameState,\n /** Display modes for Sudoku digits ('NUMERIC' | 'KANJI' | 'COLORS' | 'EMOJIS'). */\n SudokuDisplay,\n /** Source of the puzzle ('DAILY' | 'CHALLENGE' | 'LEVEL' | 'ENTERED'). */\n PlayingSource,\n} from './types';\n\n/** Default settings and cell/board helper functions for the modern Sudoku API. */\nexport {\n /** Default session play settings (pencilmarking off, auto-pencilmarks off). */\n DEFAULT_PLAY_SETTINGS,\n /** Default app settings (showErrors on, animations on, numeric display). */\n DEFAULT_APP_SETTINGS,\n /** Create an empty SudokuCell at the given index. */\n createEmptyCell,\n /** Create an empty 81-cell SudokuBoard. */\n createEmptyBoard,\n /** Check if a cell has an error (input does not match solution). */\n cellHasError,\n /** Get row index (0-8) from cell index (0-80). */\n rowOf,\n /** Get column index (0-8) from cell index (0-80). */\n columnOf,\n /** Get block index (0-8) from cell index (0-80). */\n blockOf,\n /** Get cell index (0-80) from row and column. */\n cellIndex,\n /** Get all cell indices in the same row as the given index. */\n getRowIndices,\n /** Get all cell indices in the same column as the given index. */\n getColumnIndices,\n /** Get all cell indices in the same block as the given index. */\n getBlockIndices,\n /** Get all related cell indices (same row, column, or block) excluding the cell itself. */\n getRelatedIndices,\n} from './types';\n\n// ============================================================================\n// Display types (for rendering - matches Kotlin renderable)\n// ============================================================================\n\n/** Display and hint visualization types matching the Kotlin renderable layer. */\nexport type {\n /** Highlighted area in a hint (row, column, or block). */\n HintArea,\n /** Cell display information in a hint step. */\n HintCell,\n /** Actions to perform on a cell during hint visualization. */\n HintCellActions,\n /** A single hint step with title, text, areas, cells, links, and groups. */\n DisplayHintStep,\n /** Complete display state for a single cell (colors, digit, pencilmarks). */\n CellDisplayState,\n /** Display state for a single pencilmark (digit and color). */\n PencilmarkDisplayState,\n /** UI color palette with system colors for light or dark mode. */\n UIColorPalette,\n /** Link type for chain visualization ('strong' | 'weak'). */\n LinkType,\n /** A link between two cells in a chain (display format). */\n DisplayLink,\n /** A group of cells for pattern visualization (display format). */\n DisplayCellGroup,\n} from './types';\n\n/** Theme and color enums plus predefined light/dark palettes. */\nexport { ThemeColor, SudokuColor, UIColorLight, UIColorDark } from './types';\n\n// ============================================================================\n// Progress Types (for user progress tracking)\n// ============================================================================\n\n/** Types for tracking user puzzle completion and statistics. */\nexport type {\n /** Record of a completed puzzle (id, type, time). */\n CompletedPuzzle,\n /** Computed game statistics (best times, averages). */\n GameStats,\n /** Full user progress data (completed puzzles, streak, stats). */\n UserProgress,\n} from './types';\n\nexport {\n /** Default empty user progress state. */\n DEFAULT_PROGRESS,\n /** localStorage key for progress data ('sudojo-progress'). */\n PROGRESS_STORAGE_KEY,\n} from './types';\n\n// ============================================================================\n// Settings Types (for app settings)\n// ============================================================================\n\n/** Types for application settings. */\nexport type {\n /** Digit display format ('numeric' | 'kanji' | 'emojis'). */\n DigitDisplay,\n /** Application settings (showErrors, symmetrical, display). */\n AppSettings,\n} from './types';\n\nexport {\n /** Default application settings. */\n DEFAULT_SETTINGS,\n /** localStorage key for settings ('sudojo-settings'). */\n SETTINGS_STORAGE_KEY,\n} from './types';\n\n// ============================================================================\n// Subscription Types (for subscription management)\n// ============================================================================\n\n/** Types for RevenueCat subscription management. */\nexport type {\n /** Subscription product information (price, period, trial). */\n Product,\n /** User subscription status (active, expiration, renewal). */\n Subscription,\n} from './types';\n\n/** Default inactive subscription state. */\nexport { DEFAULT_SUBSCRIPTION } from './types';\n\n// ============================================================================\n// Game Persistence Types (for saving/loading game state)\n// ============================================================================\n\n/** Types for saving and restoring game progress to localStorage. */\nexport type {\n /** Saved game state (input, pencilmarks, mode, timestamp). */\n SavedGameState,\n /** Key identifying a game to persist (type + id). */\n GamePersistenceKey,\n} from './types';\n\nexport {\n /** localStorage key prefix for game saves ('sudojo_game_'). */\n GAME_STORAGE_PREFIX,\n /** Generate a localStorage key from a GamePersistenceKey. */\n getGameStorageKey,\n} from './types';\n\n// ============================================================================\n// Current Game Types (for current game feature)\n// ============================================================================\n\n/** Types for the Zustand-backed current game store. */\nexport type {\n /** Source of the current game ('daily' | 'level' | 'entered'). */\n GameSource,\n /** Navigation metadata for resuming a game (date, level, board info). */\n CurrentGameMeta,\n /** Full current game state stored in Zustand (puzzle, progress, timing). */\n CurrentGame,\n /** Which store slot a game lives in ('daily' | 'play'). */\n GameSlot,\n} from './types';\n\n// ============================================================================\n// Legacy Utilities (useGame hook)\n// ============================================================================\n\n/**\n * @deprecated These utilities work with the legacy 2D `GameBoard` type.\n * For new code, use `useSudoku` with its flat 81-cell board and the\n * scrambler/presenter utilities below.\n */\nexport {\n /** @deprecated Clone a 2D GameBoard. Use useSudoku's immutable state instead. */\n cloneBoard,\n /** @deprecated Count filled cells in a 2D GameBoard. */\n countFilledCells,\n /** @deprecated Create a 2D GameBoard from puzzle/solution strings. */\n createGameBoard,\n /** @deprecated Get cells in a block by block index (2D API). */\n getBlockCells,\n /** @deprecated Get block index from row/col (2D API). Use blockOf() instead. */\n getBlockIndex,\n /** @deprecated Get 2D board state as string. Use cellsToStateString() instead. */\n getBoardStateString,\n /** @deprecated Get cells in a column (2D API). Use getColumnIndices() instead. */\n getColumnCells,\n /** @deprecated Get empty cells from a 2D GameBoard. */\n getEmptyCells,\n /** @deprecated Get pencilmarks string from 2D GameBoard. Use cellsToPencilmarksString() instead. */\n getPencilmarksString,\n /** @deprecated Get related cells (2D API). Use getRelatedIndices() instead. */\n getRelatedCells,\n /** @deprecated Get cells in a row (2D API). Use getRowIndices() instead. */\n getRowCells,\n /** @deprecated Check if placement is valid (2D API). */\n isValidPlacement,\n /** @deprecated Auto-remove pencilmarks (2D API). useSudoku handles this internally. */\n autoRemovePencilmarks,\n /** @deprecated Clear highlights (2D API). useSudoku handles this via presentBoard(). */\n clearHighlights,\n /** @deprecated Count mistakes (2D API). Use useSudoku's errorCount instead. */\n countMistakes,\n /** @deprecated Get incorrect cells (2D API). Use useSudoku's errorCells instead. */\n getIncorrectCells,\n /** @deprecated Get progress percentage (2D API). Use useSudoku's progress instead. */\n getProgressPercentage,\n /** @deprecated Check if board is filled (2D API). */\n isBoardFilled,\n /** @deprecated Check if cell is correct (2D API). Use cellHasError() instead. */\n isCellCorrect,\n /** @deprecated Check if game is complete (2D API). Use useSudoku's isCompleted instead. */\n isGameComplete,\n /** @deprecated Check if value is correct (2D API). */\n isValueCorrect,\n /** @deprecated Update cell errors (2D API). useSudoku handles this automatically. */\n updateCellErrors,\n /** @deprecated Update cell highlights (2D API). Use presentBoard() instead. */\n updateCellHighlights,\n /** @deprecated Validate entire game state (2D API). */\n validateGameState,\n} from './utils';\n\n// ============================================================================\n// Sudoku Utilities (useSudoku hook - ported from renderable)\n// ============================================================================\n\n/** Types for board scrambling. */\nexport type {\n /** Protocol for board scramblers (Scrambler and NonScrambler implement this). */\n ScramblerProtocol,\n /** Result of scrambling a board (cells + digit mappings). */\n SudokuScrambleResult,\n} from './utils';\n\n/** Board scrambling and puzzle string conversion utilities. */\nexport {\n /** Scrambler that permutes rows, columns, and digits to create unique puzzles. */\n Scrambler,\n /** Identity scrambler that returns the board unchanged. */\n NonScrambler,\n /** Scramble a board using a ScramblerProtocol implementation. */\n scrambleSudokuBoard,\n /** Parse an 81-character puzzle string into SudokuCell array. */\n parsePuzzleString,\n /** Convert SudokuCell array to puzzle string (given values only). */\n cellsToPuzzleString,\n /** Convert SudokuCell array to state string (given + input values). */\n cellsToStateString,\n /** Convert SudokuCell array to input-only string. */\n cellsToInputString,\n /** Convert SudokuCell array to comma-separated pencilmarks string. */\n cellsToPencilmarksString,\n} from './utils';\n\n// ============================================================================\n// Presenter utilities (for rendering - matches Kotlin renderable)\n// ============================================================================\n\n/** Options type for the presentBoard function. */\nexport type {\n /** Options for generating cell display states (cells, selection, errors, hints). */\n PresentBoardOptions,\n} from './utils';\n\n/** Board presentation and color utilities matching the Kotlin renderable layer. */\nexport {\n /** Generate display states for all 81 cells (colors, digits, pencilmarks, hints). */\n presentBoard,\n /** Process hint step areas and cells into a map of cell hints by index. */\n calculateCellHints,\n /** Convert a ThemeColor to an actual CSS color string using a palette. */\n themeColorToCSS,\n /** Get the UIColorPalette for light or dark mode. */\n getColorPalette,\n /** Get indices of cells containing a specific digit (given or input). */\n getCellsWithDigit,\n /** Get the digit to highlight based on the selected cell (given or correct input). */\n getSelectedDigit,\n /** Compute the set of cell indices with the same digit as the selected cell. */\n computeSelectedDigitCells,\n /** Convert a solver link (row/col pairs) to display format (flat indices). */\n convertSolverLink,\n /** Convert a solver cell group to display format with ThemeColor. */\n convertSolverCellGroup,\n /** Convert SudokuColor enum to ThemeColor enum. */\n sudokuColorToTheme,\n} from './utils';\n\n// ============================================================================\n// Time Utilities\n// ============================================================================\n\n/** Time formatting and parsing utilities. */\nexport {\n /** Format seconds into MM:SS or HH:MM:SS string. */\n formatTime,\n /** Parse a MM:SS or HH:MM:SS string back to total seconds. */\n parseTime,\n} from './utils';\n\n// ============================================================================\n// Progress Utilities\n// ============================================================================\n\n/** User progress calculation utilities. */\nexport {\n /** Calculate game statistics (best times, averages) from completed puzzles. */\n calculateStats,\n /** Calculate current daily streak from completion history. */\n calculateStreak,\n /** Check if a specific puzzle (by type and id) has been completed. */\n isPuzzleCompleted,\n /** Get all completed level IDs from completion history. */\n getCompletedLevelIds,\n /** Get all completed daily dates (YYYY-MM-DD) from completion history. */\n getCompletedDailyDates,\n} from './utils';\n\n// ============================================================================\n// Theme Utilities\n// ============================================================================\n\n/** Types for theme preference management. */\nexport type {\n /** Theme preference: 'light' | 'dark' | 'system'. */\n ThemePreference,\n /** Resolved theme without system option: 'light' | 'dark'. */\n ResolvedTheme,\n} from './utils';\n\n/** Theme detection and resolution utilities. */\nexport {\n /** localStorage key for theme preference ('sudojo-theme'). */\n THEME_STORAGE_KEY,\n /** Detect the system color scheme preference (light/dark). */\n getSystemTheme,\n /** Resolve a ThemePreference to an actual theme using the system theme. */\n resolveTheme,\n /** Type guard: check if a value is a valid ThemePreference. */\n isValidThemePreference,\n} from './utils';\n\n// ============================================================================\n// Subscription Utilities\n// ============================================================================\n\n/** RevenueCat subscription conversion and display utilities. */\nexport {\n /** Convert a RevenueCat package to a Product domain model. */\n convertPackageToProduct,\n /** Parse RevenueCat CustomerInfo into a Subscription domain model. */\n parseCustomerInfo,\n /** Get human-readable name for an ISO 8601 subscription period (e.g., 'P1M' -> 'Monthly'). */\n getPeriodDisplayName,\n /** Check if a subscription period is the \"best value\" option (annual plans). */\n isBestValuePlan,\n /** Get a user-friendly error message for a RevenueCat error code. */\n getRevenueCatErrorMessage,\n} from './utils';\n\n// ============================================================================\n// Technique Utilities\n// ============================================================================\n\n/** Technique display utilities. */\nexport {\n /** Get the icon URL for a solving technique by its path slug. */\n getTechniqueIconUrl,\n} from './utils';\n\n// ============================================================================\n// Technique Walkthrough Utilities\n// ============================================================================\n\n/** A single step in a technique walkthrough (board + hint overlay + text). */\nexport type { WalkthroughStep } from './utils';\n\n/** Shared logic for building step-by-step technique examples from practice data. */\nexport {\n /** Parse a comma-delimited pencilmarks string into per-cell arrays. */\n parsePencilmarksString,\n /** Convert per-cell pencilmarks arrays back to a comma-delimited string. */\n pencilmarksToString,\n /** Parse board/pencilmarks/solution strings into a SudokuCell array. */\n parsePracticeBoard,\n /** Deep clone a SudokuCell array. */\n cloneSudokuBoard,\n /** Apply a hint step's actions to a board, returning new state. */\n applyHintStep,\n /** Parse a hint_data JSON string into SolverHints. */\n parseHintData,\n /** Resolve localised title and text for a single hint step. */\n localizeHintStep,\n /** Build the full walkthrough step array from board and hint data. */\n buildWalkthroughSteps,\n} from './utils';\n\n// ============================================================================\n// Hint Explanation Utilities\n// ============================================================================\n\n/** Hint explanation generation utilities for teaching users solving techniques. */\nexport {\n /** Generate a detailed explanation for a hint step based on the technique. */\n generateDetailedExplanation,\n /** Get a short action summary for a hint step (e.g., 'Place 5 in R1C3'). */\n getHintActionSummary,\n} from './utils';\n\n// ============================================================================\n// Localized Hint Utilities\n// ============================================================================\n\n/** Types for hint text localization. */\nexport type {\n /** Translation function compatible with i18next's `t` function. */\n TranslateFunction,\n} from './utils';\n\n/** Hint localization utilities. */\nexport {\n /** Get localized text for a hint step using a translation function. */\n getLocalizedHintText,\n /** Get localized title for a hint step using a translation function. */\n getLocalizedHintTitle,\n /** Resolve a localized API field, falling back to the raw value. */\n localizedField,\n} from './utils';\n\n// ============================================================================\n// i18n Key Utilities\n// ============================================================================\n\n/** Internationalization key generation and localization utilities. */\nexport {\n /** Get i18n key for a belt name (e.g., 'belts.1.name'). */\n getBeltKey,\n /** Get localized belt name using a translation function. */\n getLocalizedBeltName,\n /** Get i18n key for a belt label (e.g., 'belts.1.label'). */\n getBeltLabelKey,\n /** Get localized belt label (e.g., 'White Belt'). */\n getLocalizedBeltLabel,\n /** Get i18n key for a level title (e.g., 'levels.3'). */\n getLevelKey,\n /** Get localized level title using a translation function. */\n getLocalizedLevelTitle,\n /** Get i18n key for a technique name (e.g., 'techniques.full-house.title'). */\n getTechniqueKey,\n /** Get localized technique name using a translation function. */\n getLocalizedTechniqueName,\n} from './utils';\n\n// ============================================================================\n// Digit Display Utilities\n// ============================================================================\n\n/** Digit display format conversion. */\nexport {\n /** Convert a digit (1-9) to its display string based on the format (numeric, kanji, emojis). */\n displayDigit,\n} from './utils';\n\n// ============================================================================\n// Share URL Utilities\n// ============================================================================\n\n/** Types for share URL building and parsing. */\nexport type { ShareUrlParams, ParsedShareParams } from './utils';\n\n/** Build a share URL from game state. */\nexport { buildShareUrl } from './utils';\n\n/** Parse share URL query parameters into game state. */\nexport { parseShareParams } from './utils';\n\n/** Derive web app URL from API base URL. */\nexport { getWebUrl } from './utils';\n\n// ============================================================================\n// Auth Utilities\n// ============================================================================\n\n/** Minimal user shape for auth checks. */\nexport type { AuthUser } from './utils';\n\n/** Check if user-specific API calls should be enabled (non-anonymous, has token). */\nexport { isAuthenticatedUser } from './utils';\n\n// ============================================================================\n// Hooks\n// ============================================================================\n\nexport {\n // Data hooks\n /** Fetch a single difficulty level by number. */\n useLevel,\n /** Fetch all difficulty levels with sorting and filtering utilities. */\n useLevels,\n /** Fetch a single solving technique by number. */\n useTechnique,\n /** Fetch all solving techniques with grouping utilities. */\n useTechniques,\n /** Fetch communities for a specific language with platform grouping. */\n useCommunities,\n /** Fetch learning materials with filtering by technique and language. */\n useLearning,\n /** Fetch a single learning item by UUID. */\n useLearningItem,\n\n /**\n * @deprecated Use `useSudoku` instead. `useGame` uses a legacy 2D array board\n * representation, while `useSudoku` uses a flat 81-cell array consistent with\n * the Kotlin renderable layer and the rest of the codebase.\n */\n useGame,\n\n /** Primary game state hook with flat 81-cell board, pencil mode, and scrambling. */\n useSudoku,\n\n /** Teaching/hint integration with the solver API (legacy GameHint format). */\n useGameTeaching,\n\n /** Fetch a random board for a specific level with auth/subscription handling. */\n useLevelGame,\n /** Fetch today's daily puzzle with auth/subscription handling. */\n useDailyGame,\n\n /** Game timer using refs to avoid re-renders every second. */\n useGameTimer,\n\n /** Persist individual game progress to localStorage. */\n useGamePersistence,\n /** Auto-save game state with debouncing. */\n useAutoSave,\n\n /** Generic typed localStorage hook with SSR safety. */\n useLocalStorage,\n\n /** Solver hint integration matching Kotlin HintInteractor behavior. */\n useHint,\n\n /** Current game management with Zustand store (daily/play slots). */\n useGamePlay,\n\n /** Shared \"Continue Last Sudoku\" logic for web and RN. */\n useContinueGame,\n\n /** Manual puzzle entry mode with solver validation. */\n useBoardEntry,\n\n /** Server-side game session management for gamification (points, badges). */\n useGameSession,\n\n /** Check whether a level is enabled for the current user's entitlements. */\n useLevelEnabled,\n /** Check whether a technique is enabled for the current user's entitlements. */\n useTechniqueEnabled,\n\n /** Convert internal user level (0-indexed) to display values (1-indexed + belt). */\n useDisplayLevel,\n\n /** Compute cumulative puzzle distribution across entitlement tiers. */\n usePuzzleDistribution,\n\n /** Shared hint step tracker for game screens (ref + state). */\n useHintStepTracker,\n\n /** Auto-hint orchestration for shared links/deep links. */\n useAutoHint,\n\n /** Progress reporting for game state persistence. */\n useProgressReporter,\n\n /** Regenerate hint_data for all stored practices via solver. */\n useRegeneratePracticeHints,\n\n /** Emit a hint action event to the active SudokuGame. */\n emitHintAction,\n /** Report hint status back after processing an action. */\n reportHintStatus,\n /** Subscribe to hint status updates. */\n onHintStatus,\n /** Hook for SudokuGame to listen for external hint action events. */\n useHintActionListener,\n} from './hooks';\n\nexport type {\n // Data hook types\n /** Options for useLevel hook. */\n UseLevelOptions,\n /** Result type for useLevel hook. */\n UseLevelResult,\n /** Options for useLevels hook. */\n UseLevelsOptions,\n /** Result type for useLevels hook. */\n UseLevelsResult,\n /** Options for useTechnique hook. */\n UseTechniqueOptions,\n /** Result type for useTechnique hook. */\n UseTechniqueResult,\n /** Options for useTechniques hook. */\n UseTechniquesOptions,\n /** Result type for useTechniques hook. */\n UseTechniquesResult,\n /** Options for useCommunities hook. */\n UseCommunitiesOptions,\n /** Result type for useCommunities hook. */\n UseCommunitiesResult,\n /** Options for useLearningItem hook. */\n UseLearningItemOptions,\n /** Result type for useLearningItem hook. */\n UseLearningItemResult,\n /** Options for useLearning hook. */\n UseLearningOptions,\n /** Result type for useLearning hook. */\n UseLearningResult,\n\n // Game hook types (legacy)\n /** @deprecated Options for legacy useGame hook. Use UseSudokuOptions instead. */\n UseGameOptions,\n /** @deprecated Result type for legacy useGame hook. Use UseSudokuResult instead. */\n UseGameResult,\n\n // Sudoku hook types\n /** Options for useSudoku hook (initial app settings). */\n UseSudokuOptions,\n /** Result type for useSudoku hook (state, computed values, actions, utilities). */\n UseSudokuResult,\n\n // Teaching hook types\n /** Options for useGameTeaching hook (network client, URL, token). */\n UseGameTeachingOptions,\n /** Result type for useGameTeaching hook (teaching state, hint actions). */\n UseGameTeachingResult,\n\n // Game fetching hook types\n /** Options for useLevelGame hook (network, auth, level number). */\n UseLevelGameOptions,\n /** Result type for useLevelGame hook (board data, fetch status). */\n UseLevelGameResult,\n /** Options for useDailyGame hook (network, auth). */\n UseDailyGameOptions,\n /** Result type for useDailyGame hook (daily data, fetch status). */\n UseDailyGameResult,\n /** Status of a game fetch: 'loading' | 'success' | 'auth_required' | 'subscription_required' | 'entitlement_required' | 'error'. */\n GameFetchStatus,\n\n // Timer hook types\n /** Options for useGameTimer hook (autoStart, initialTime). */\n UseGameTimerOptions,\n /** Result type for useGameTimer hook (elapsedRef, controls). */\n UseGameTimerResult,\n\n // Persistence hook types\n /** Options for useGamePersistence hook (puzzleKey, autoSave). */\n UseGamePersistenceOptions,\n /** Result type for useGamePersistence hook (load, save, clear, hasSaved). */\n UseGamePersistenceResult,\n\n // Hint hook types\n /** Options for useHint hook (network, puzzle state, technique filter). */\n UseHintOptions,\n /** Result type for useHint hook (hint steps, navigation, apply). */\n UseHintResult,\n /** Board data returned when applying a hint (user input, pencilmarks). */\n HintBoardData,\n /** Data passed to onHintReceived callback (hint, board data, technique info). */\n HintReceivedData,\n /** Access denied error info when hint level exceeds subscription tier. */\n HintAccessError,\n\n // Game play hook types\n /** Options for useGamePlay hook (slot selection, auto-save delay). */\n UseGamePlayOptions,\n /** Result type for useGamePlay hook (current game, start, update, clear). */\n UseGamePlayResult,\n\n // Continue game hook types\n /** Options for useContinueGame hook. */\n UseContinueGameOptions,\n /** Result type for useContinueGame hook. */\n UseContinueGameResult,\n /** Navigation target returned by useContinueGame. */\n ContinueTarget,\n\n // Board entry hook types\n /** Options for useBoardEntry hook (network client, URL, token). */\n UseBoardEntryOptions,\n /** Result type for useBoardEntry hook (cells, validation, actions). */\n UseBoardEntryReturn,\n /** Validated puzzle data from solver (puzzle + solution strings). */\n ValidatedPuzzle,\n\n // Game session hook types\n /** Options for useGameSession hook (network, auth, userId). */\n UseGameSessionOptions,\n /** Result of starting a game session (sessionStarted, sessionId). */\n GameSessionResult,\n /** Result of finishing a game session (leveledUp, badges, points). */\n GameFinishResult,\n\n // Display level hook types\n /** Result type for useDisplayLevel hook. */\n UseDisplayLevelResult,\n\n // Hint step tracker types\n /** Result type for useHintStepTracker hook. */\n UseHintStepTrackerResult,\n\n // Auto-hint types\n /** Options for useAutoHint hook. */\n UseAutoHintOptions,\n\n // Practice admin types\n UseRegeneratePracticeHintsOptions,\n UseRegeneratePracticeHintsResult,\n\n // Progress reporter types\n /** Options for useProgressReporter hook. */\n UseProgressReporterOptions,\n /** Callback type for progress updates. */\n ProgressUpdateCallback,\n\n // Hint action types\n /** Status reported after a hint action is processed. */\n HintActionStatus,\n} from './hooks';\n\n// ============================================================================\n// Stores\n// ============================================================================\n\n/** Zustand store for current game state with daily/play slots and localStorage persistence. */\nexport { useGamePlayStore } from './stores/gamePlayStore';\n/** State shape for the game play Zustand store. */\nexport type { GamePlayState } from './stores/gamePlayStore';\n\n// ============================================================================\n// Config\n// ============================================================================\n\n/** Authentication provider configuration types. */\nexport type {\n /** Available auth provider types: 'google' | 'apple' | 'email'. */\n AuthProviderType,\n /** Configuration for which auth providers are enabled. */\n AuthProvidersConfig,\n} from './config';\n\n/** Default auth providers configuration (Google + Email, anonymous fallback). */\nexport { DEFAULT_AUTH_PROVIDERS } from './config';\n\n// ============================================================================\n// Entitlement Context\n// ============================================================================\n\n/** Provider that supplies entitlements to useLevelEnabled / useTechniqueEnabled. */\nexport { EntitlementProvider } from './context';\n/** React context for entitlements (for advanced use). */\nexport { EntitlementContext, useEntitlementContext } from './context';\n\n// ============================================================================\n// Entitlement Utilities (re-exported from sudojo_types)\n// ============================================================================\n\n/** Parse a comma-delimited entitlement string into an array. */\nexport { parseEntitlements } from '@sudobility/sudojo_types';\n\n/** Check if a user has the required entitlement for a level. */\nexport { hasRequiredEntitlement } from '@sudobility/sudojo_types';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAqBH,gFAAgF;AAChF,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AA0BhD,kFAAkF;AAClF,OAAO;AACL,+EAA+E;AAC/E,qBAAqB;AACrB,4EAA4E;AAC5E,oBAAoB;AACpB,qDAAqD;AACrD,eAAe;AACf,2CAA2C;AAC3C,gBAAgB;AAChB,oEAAoE;AACpE,YAAY;AACZ,kDAAkD;AAClD,KAAK;AACL,qDAAqD;AACrD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,uEAAuE;AACvE,uBAAuB;AACvB,oFAAoF;AACpF,iBAAiB;AACjB,+DAA+D;AAC/D,gBAAgB;AAChB,+EAA+E;AAC/E,aAAa;AACb,kEAAkE;AAClE,aAAa;AACb,iFAAiF;AACjF,gBAAgB;AAChB,uEAAuE;AACvE,qBAAqB,GACtB,MAAM,SAAS,CAAC;AAgOjB,+EAA+E;AAC/E,SAAS;AACT,+EAA+E;AAE/E,+FAA+F;AAC/F,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAgB1D,iFAAiF;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAElD,+EAA+E;AAC/E,sBAAsB;AACtB,+EAA+E;AAE/E,oFAAoF;AACpF,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAChD,yDAAyD;AACzD,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAEtE,+EAA+E;AAC/E,qBAAqB;AACrB,+EAA+E;AAE/E,6EAA6E;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,oEAAoE;AACpE,OAAO;AACL,mEAAmE;AACnE,gBAAgB;AAChB,iEAAiE;AACjE,YAAY;AACZ,8CAA8C;AAC9C,oBAAoB;AACpB,gFAAgF;AAChF,gBAAgB;AAChB,uEAAuE;AACvE,oBAAoB,GACrB,MAAM,WAAW,CAAC;AAWnB,+EAA+E;AAC/E,wDAAwD;AACxD,+EAA+E;AAE/E,gEAAgE;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,gEAAgE;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,+EAA+E;AAC/E,uEAAuE;AACvE,+EAA+E;AAE/E;;;;;;;;;GASG;AACH,cAAc,SAAS,CAAC","sourcesContent":["/**\n * @sudobility/sudojo_lib - Business logic library for Sudojo app\n *\n * This library provides:\n * - Game state management with useSudoku hook (ported from renderable)\n * - Board scrambling utilities\n * - Game validation (mistakes, completion)\n * - Level, technique, and learning data hooks\n * - Teaching/hint integration with solver\n * - Legacy useGame hook for backward compatibility\n *\n * ## Hook Architecture\n *\n * The hooks form a layered composition pattern:\n *\n * **Data hooks** (fetch and cache server data):\n * - `useLevels` / `useLevel` - Difficulty level data\n * - `useTechniques` / `useTechnique` - Solving technique data\n * - `useLearning` / `useLearningItem` - Learning material data\n *\n * **Game fetching hooks** (handle auth, subscription, and puzzle loading):\n * - `useLevelGame` - Fetch a random board for a specific level\n * - `useDailyGame` - Fetch today's daily puzzle\n *\n * **Game state hooks** (manage board state and user interaction):\n * - `useSudoku` - Primary game state (flat 81-cell array, modern API)\n * - `useGame` - Legacy game state (2D array, deprecated)\n * - `useBoardEntry` - Manual puzzle entry mode\n * - `useBoardScan` - Read givens, player digits and pencilmarks from a photo\n *\n * **Feature hooks** (provide specific game features):\n * - `useHint` - Solver integration for hints (matches Kotlin HintInteractor)\n * - `useGameTeaching` - Step-by-step teaching with solver\n * - `useGameTimer` - Elapsed time tracking via ref (no re-renders)\n * - `useGamePersistence` / `useAutoSave` - localStorage game save/restore\n * - `useLocalStorage` - Generic typed localStorage hook\n *\n * **Orchestration hooks** (combine multiple hooks for app-level features):\n * - `useGamePlay` - Current game management with Zustand store (daily/play slots)\n * - `useGameSession` - Server-side gamification (start/finish, points, badges)\n *\n * ## Migration Guide\n *\n * Legacy exports (prefixed with \"Legacy\" comments) use the 2D `GameBoard` type\n * from `useGame`. New code should use `useSudoku` with its flat 81-cell\n * `SudokuBoard` type. See `@deprecated` tags on legacy exports.\n */\n\n// ============================================================================\n// Legacy Types (useGame hook)\n// ============================================================================\n\n/**\n * @deprecated Use `SudokuCell` instead. Part of the legacy `useGame` 2D board API.\n */\nexport type {\n CellPosition,\n CellState,\n GameBoard,\n GameHint,\n GameMove,\n GameSettings,\n GameState,\n GameStatus,\n TeachingState,\n} from './types';\n\n/** @deprecated Use `DEFAULT_APP_SETTINGS` / `DEFAULT_PLAY_SETTINGS` instead. */\nexport { DEFAULT_GAME_SETTINGS } from './types';\n\n// ============================================================================\n// Sudoku Types (useSudoku hook - ported from renderable)\n// ============================================================================\n\n/** Core Sudoku cell and board types using flat 81-cell array representation. */\nexport type {\n /** A single cell in the Sudoku board (indexed 0-80). */\n SudokuCell,\n /** The Sudoku board containing all 81 cells. */\n SudokuBoard,\n /** Current play state including board, settings, and selection. */\n SudokuPlay,\n /** Session settings that can change during play (pencilmarking, auto-pencilmarks). */\n SudokuPlaySettings,\n /** App-level settings persisted across sessions (showErrors, display format). */\n SudokuAppSettings,\n /** Full game state including source, history, and digit mapping. */\n SudokuGameState,\n /** Display modes for Sudoku digits ('NUMERIC' | 'KANJI' | 'COLORS' | 'EMOJIS'). */\n SudokuDisplay,\n /** Source of the puzzle ('DAILY' | 'CHALLENGE' | 'LEVEL' | 'ENTERED'). */\n PlayingSource,\n} from './types';\n\n/** Default settings and cell/board helper functions for the modern Sudoku API. */\nexport {\n /** Default session play settings (pencilmarking off, auto-pencilmarks off). */\n DEFAULT_PLAY_SETTINGS,\n /** Default app settings (showErrors on, animations on, numeric display). */\n DEFAULT_APP_SETTINGS,\n /** Create an empty SudokuCell at the given index. */\n createEmptyCell,\n /** Create an empty 81-cell SudokuBoard. */\n createEmptyBoard,\n /** Check if a cell has an error (input does not match solution). */\n cellHasError,\n /** Get row index (0-8) from cell index (0-80). */\n rowOf,\n /** Get column index (0-8) from cell index (0-80). */\n columnOf,\n /** Get block index (0-8) from cell index (0-80). */\n blockOf,\n /** Get cell index (0-80) from row and column. */\n cellIndex,\n /** Get all cell indices in the same row as the given index. */\n getRowIndices,\n /** Get all cell indices in the same column as the given index. */\n getColumnIndices,\n /** Get all cell indices in the same block as the given index. */\n getBlockIndices,\n /** Get all related cell indices (same row, column, or block) excluding the cell itself. */\n getRelatedIndices,\n} from './types';\n\n// ============================================================================\n// Display types (for rendering - matches Kotlin renderable)\n// ============================================================================\n\n/** Display and hint visualization types matching the Kotlin renderable layer. */\nexport type {\n /** Highlighted area in a hint (row, column, or block). */\n HintArea,\n /** Cell display information in a hint step. */\n HintCell,\n /** Actions to perform on a cell during hint visualization. */\n HintCellActions,\n /** A single hint step with title, text, areas, cells, links, and groups. */\n DisplayHintStep,\n /** Complete display state for a single cell (colors, digit, pencilmarks). */\n CellDisplayState,\n /** Display state for a single pencilmark (digit and color). */\n PencilmarkDisplayState,\n /** UI color palette with system colors for light or dark mode. */\n UIColorPalette,\n /** Link type for chain visualization ('strong' | 'weak'). */\n LinkType,\n /** A link between two cells in a chain (display format). */\n DisplayLink,\n /** A group of cells for pattern visualization (display format). */\n DisplayCellGroup,\n} from './types';\n\n/** Theme and color enums plus predefined light/dark palettes. */\nexport { ThemeColor, SudokuColor, UIColorLight, UIColorDark } from './types';\n\n// ============================================================================\n// Progress Types (for user progress tracking)\n// ============================================================================\n\n/** Types for tracking user puzzle completion and statistics. */\nexport type {\n /** Record of a completed puzzle (id, type, time). */\n CompletedPuzzle,\n /** Computed game statistics (best times, averages). */\n GameStats,\n /** Full user progress data (completed puzzles, streak, stats). */\n UserProgress,\n} from './types';\n\nexport {\n /** Default empty user progress state. */\n DEFAULT_PROGRESS,\n /** localStorage key for progress data ('sudojo-progress'). */\n PROGRESS_STORAGE_KEY,\n} from './types';\n\n// ============================================================================\n// Settings Types (for app settings)\n// ============================================================================\n\n/** Types for application settings. */\nexport type {\n /** Digit display format ('numeric' | 'kanji' | 'emojis'). */\n DigitDisplay,\n /** Application settings (showErrors, symmetrical, display). */\n AppSettings,\n} from './types';\n\nexport {\n /** Default application settings. */\n DEFAULT_SETTINGS,\n /** localStorage key for settings ('sudojo-settings'). */\n SETTINGS_STORAGE_KEY,\n} from './types';\n\n// ============================================================================\n// Subscription Types (for subscription management)\n// ============================================================================\n\n/** Types for RevenueCat subscription management. */\nexport type {\n /** Subscription product information (price, period, trial). */\n Product,\n /** User subscription status (active, expiration, renewal). */\n Subscription,\n} from './types';\n\n/** Default inactive subscription state. */\nexport { DEFAULT_SUBSCRIPTION } from './types';\n\n// ============================================================================\n// Game Persistence Types (for saving/loading game state)\n// ============================================================================\n\n/** Types for saving and restoring game progress to localStorage. */\nexport type {\n /** Saved game state (input, pencilmarks, mode, timestamp). */\n SavedGameState,\n /** Key identifying a game to persist (type + id). */\n GamePersistenceKey,\n} from './types';\n\nexport {\n /** localStorage key prefix for game saves ('sudojo_game_'). */\n GAME_STORAGE_PREFIX,\n /** Generate a localStorage key from a GamePersistenceKey. */\n getGameStorageKey,\n} from './types';\n\n// ============================================================================\n// Current Game Types (for current game feature)\n// ============================================================================\n\n/** Types for the Zustand-backed current game store. */\nexport type {\n /** Source of the current game ('daily' | 'level' | 'entered'). */\n GameSource,\n /** Navigation metadata for resuming a game (date, level, board info). */\n CurrentGameMeta,\n /** Full current game state stored in Zustand (puzzle, progress, timing). */\n CurrentGame,\n /** Which store slot a game lives in ('daily' | 'play'). */\n GameSlot,\n} from './types';\n\n// ============================================================================\n// Legacy Utilities (useGame hook)\n// ============================================================================\n\n/**\n * @deprecated These utilities work with the legacy 2D `GameBoard` type.\n * For new code, use `useSudoku` with its flat 81-cell board and the\n * scrambler/presenter utilities below.\n */\nexport {\n /** @deprecated Clone a 2D GameBoard. Use useSudoku's immutable state instead. */\n cloneBoard,\n /** @deprecated Count filled cells in a 2D GameBoard. */\n countFilledCells,\n /** @deprecated Create a 2D GameBoard from puzzle/solution strings. */\n createGameBoard,\n /** @deprecated Get cells in a block by block index (2D API). */\n getBlockCells,\n /** @deprecated Get block index from row/col (2D API). Use blockOf() instead. */\n getBlockIndex,\n /** @deprecated Get 2D board state as string. Use cellsToStateString() instead. */\n getBoardStateString,\n /** @deprecated Get cells in a column (2D API). Use getColumnIndices() instead. */\n getColumnCells,\n /** @deprecated Get empty cells from a 2D GameBoard. */\n getEmptyCells,\n /** @deprecated Get pencilmarks string from 2D GameBoard. Use cellsToPencilmarksString() instead. */\n getPencilmarksString,\n /** @deprecated Get related cells (2D API). Use getRelatedIndices() instead. */\n getRelatedCells,\n /** @deprecated Get cells in a row (2D API). Use getRowIndices() instead. */\n getRowCells,\n /** @deprecated Check if placement is valid (2D API). */\n isValidPlacement,\n /** @deprecated Auto-remove pencilmarks (2D API). useSudoku handles this internally. */\n autoRemovePencilmarks,\n /** @deprecated Clear highlights (2D API). useSudoku handles this via presentBoard(). */\n clearHighlights,\n /** @deprecated Count mistakes (2D API). Use useSudoku's errorCount instead. */\n countMistakes,\n /** @deprecated Get incorrect cells (2D API). Use useSudoku's errorCells instead. */\n getIncorrectCells,\n /** @deprecated Get progress percentage (2D API). Use useSudoku's progress instead. */\n getProgressPercentage,\n /** @deprecated Check if board is filled (2D API). */\n isBoardFilled,\n /** @deprecated Check if cell is correct (2D API). Use cellHasError() instead. */\n isCellCorrect,\n /** @deprecated Check if game is complete (2D API). Use useSudoku's isCompleted instead. */\n isGameComplete,\n /** @deprecated Check if value is correct (2D API). */\n isValueCorrect,\n /** @deprecated Update cell errors (2D API). useSudoku handles this automatically. */\n updateCellErrors,\n /** @deprecated Update cell highlights (2D API). Use presentBoard() instead. */\n updateCellHighlights,\n /** @deprecated Validate entire game state (2D API). */\n validateGameState,\n} from './utils';\n\n// ============================================================================\n// Sudoku Utilities (useSudoku hook - ported from renderable)\n// ============================================================================\n\n/** Types for board scrambling. */\nexport type {\n /** Protocol for board scramblers (Scrambler and NonScrambler implement this). */\n ScramblerProtocol,\n /** Result of scrambling a board (cells + digit mappings). */\n SudokuScrambleResult,\n} from './utils';\n\n/** Board scrambling and puzzle string conversion utilities. */\nexport {\n /** Scrambler that permutes rows, columns, and digits to create unique puzzles. */\n Scrambler,\n /** Identity scrambler that returns the board unchanged. */\n NonScrambler,\n /** Scramble a board using a ScramblerProtocol implementation. */\n scrambleSudokuBoard,\n /** Parse an 81-character puzzle string into SudokuCell array. */\n parsePuzzleString,\n /** Convert SudokuCell array to puzzle string (given values only). */\n cellsToPuzzleString,\n /** Convert SudokuCell array to state string (given + input values). */\n cellsToStateString,\n /** Convert SudokuCell array to input-only string. */\n cellsToInputString,\n /** Convert SudokuCell array to comma-separated pencilmarks string. */\n cellsToPencilmarksString,\n /** Convert SudokuCell array to solution string ('0' where unknown). */\n cellsToSolutionString,\n /** Count the givens (clues) in a SudokuCell array. */\n countClues,\n} from './utils';\n\n/** Board and level constants from sudojo_types, re-exported for convenience. */\nexport {\n /** Fewest givens a valid Sudoku can have (17). */\n MIN_CLUES,\n /** Lowest difficulty level (1). */\n MIN_LEVEL,\n /** Highest difficulty level (12). */\n MAX_LEVEL,\n /** Whether a value is an integer level in MIN_LEVEL..MAX_LEVEL. */\n isValidLevel,\n /** All levels, MIN_LEVEL..MAX_LEVEL. */\n ALL_LEVELS,\n} from '@sudobility/sudojo_types';\n\n// ============================================================================\n// Presenter utilities (for rendering - matches Kotlin renderable)\n// ============================================================================\n\n/** Options type for the presentBoard function. */\nexport type {\n /** Options for generating cell display states (cells, selection, errors, hints). */\n PresentBoardOptions,\n} from './utils';\n\n/** Board presentation and color utilities matching the Kotlin renderable layer. */\nexport {\n /** Generate display states for all 81 cells (colors, digits, pencilmarks, hints). */\n presentBoard,\n /** Process hint step areas and cells into a map of cell hints by index. */\n calculateCellHints,\n /** Convert a ThemeColor to an actual CSS color string using a palette. */\n themeColorToCSS,\n /** Get the UIColorPalette for light or dark mode. */\n getColorPalette,\n /** Get indices of cells containing a specific digit (given or input). */\n getCellsWithDigit,\n /** Get the digit to highlight based on the selected cell (given or correct input). */\n getSelectedDigit,\n /** Compute the set of cell indices with the same digit as the selected cell. */\n computeSelectedDigitCells,\n /** Convert a solver link (row/col pairs) to display format (flat indices). */\n convertSolverLink,\n /** Convert a solver cell group to display format with ThemeColor. */\n convertSolverCellGroup,\n /** Convert SudokuColor enum to ThemeColor enum. */\n sudokuColorToTheme,\n /** Map a solver color string to SudokuColor (case-insensitive; unknown → null). */\n solverColorToSudokuColor,\n /** Parse a solver digit string (\"125\") into digits 1-9. */\n parseHintDigits,\n /** Convert a SolverHintStep into the DisplayHintStep presentBoard takes. */\n convertSolverHintStep,\n /** Whether a hint step is a conflict hint (has a 'conflict' link). */\n isConflictHintStep,\n} from './utils';\n\n// ============================================================================\n// Time Utilities\n// ============================================================================\n\n/** Time formatting and parsing utilities. */\nexport {\n /** Format seconds into MM:SS or HH:MM:SS string. */\n formatTime,\n /** Parse a MM:SS or HH:MM:SS string back to total seconds. */\n parseTime,\n} from './utils';\n\n// ============================================================================\n// Progress Utilities\n// ============================================================================\n\n/** User progress calculation utilities. */\nexport {\n /** Calculate game statistics (best times, averages) from completed puzzles. */\n calculateStats,\n /** Calculate current daily streak from completion history. */\n calculateStreak,\n /** Check if a specific puzzle (by type and id) has been completed. */\n isPuzzleCompleted,\n /** Get all completed level IDs from completion history. */\n getCompletedLevelIds,\n /** Get all completed daily dates (YYYY-MM-DD) from completion history. */\n getCompletedDailyDates,\n /** Record a puzzle completion in UserProgress (pure markCompleted reducer). */\n applyPuzzleCompletion,\n} from './utils';\n\n/** A puzzle completion to record (CompletedPuzzle without completedAt). */\nexport type { PuzzleCompletion } from './utils';\n\n// ============================================================================\n// Theme Utilities\n// ============================================================================\n\n/** Types for theme preference management. */\nexport type {\n /** Theme preference: 'light' | 'dark' | 'system'. */\n ThemePreference,\n /** Resolved theme without system option: 'light' | 'dark'. */\n ResolvedTheme,\n} from './utils';\n\n/** Theme detection and resolution utilities. */\nexport {\n /** localStorage key for theme preference ('sudojo-theme'). */\n THEME_STORAGE_KEY,\n /** localStorage key for font size preference ('sudojo-font-size'). */\n FONT_SIZE_STORAGE_KEY,\n /** Detect the system color scheme preference (light/dark). */\n getSystemTheme,\n /** Resolve a ThemePreference to an actual theme using the system theme. */\n resolveTheme,\n /** Type guard: check if a value is a valid ThemePreference. */\n isValidThemePreference,\n} from './utils';\n\n// ============================================================================\n// Subscription Utilities\n// ============================================================================\n\n/** RevenueCat subscription conversion and display utilities. */\nexport {\n /** Convert a RevenueCat package to a Product domain model. */\n convertPackageToProduct,\n /** Parse RevenueCat CustomerInfo into a Subscription domain model. */\n parseCustomerInfo,\n /** Get human-readable name for an ISO 8601 subscription period (e.g., 'P1M' -> 'Monthly'). */\n getPeriodDisplayName,\n /** Check if a subscription period is the \"best value\" option (annual plans). */\n isBestValuePlan,\n /** Get a user-friendly error message for a RevenueCat error code. */\n getRevenueCatErrorMessage,\n /** i18n key for a period's unit (e.g. 'P1M' -> 'periods.month'), or null. */\n getPeriodLabelKey,\n /** Localized price suffix for a period (e.g. '/month'), or ''. */\n getPeriodLabel,\n /** Whether a product is the best-value plan (annual period or annual/yearly id). */\n isBestValueProduct,\n /** Months in a subscription period (named or ISO 8601), or null. */\n subscriptionPeriodToMonths,\n /** Percent saved per month by one plan versus another, or null. */\n calculateSavingsPercent,\n /** Whether a subscription was bought on another platform than this client. */\n isCrossPlatformSubscription,\n /** Whether the account can be deleted now (signed in, not anonymous, no active subscription). */\n canDeleteAccount,\n /** Fraction (0-1) of puzzles an offer unlocks, from the levels' percentages. */\n getPuzzleDistribution,\n /** The plan the savings badge compares with (shortest known period), or null. */\n selectSavingsBasePlan,\n /** Percent a plan saves per month against the products' savings base plan, or null. */\n getPlanSavingsPercent,\n} from './utils';\n\n/** Types for subscription display and account deletion helpers. */\nexport type {\n /** Price and period of a plan (for calculateSavingsPercent). */\n PricedPeriod,\n /** A paywall plan (price as number or string, period). */\n PaywallPlan,\n /** Why an account cannot be deleted ('not_signed_in' | 'anonymous' | 'active_subscription'). */\n DeleteAccountBlocker,\n /** Result of canDeleteAccount. */\n DeleteAccountCheck,\n} from './utils';\n\n// ============================================================================\n// Technique Utilities\n// ============================================================================\n\n/** Types for technique and strategy utilities. */\nexport type {\n /** A public technique slug (member of TECHNIQUE_SLUGS). */\n TechniqueSlug,\n /** A strategy stub (member of STRATEGY_SLUGS). */\n StrategySlug,\n /** Strategy difficulty tier ('beginner' ... 'master'). */\n StrategyDifficultyTier,\n /** One localized section of a strategy description. */\n StrategySection,\n /** A technique's localized overview, steps and tips. */\n TechniqueContent,\n} from './utils';\n\n/** Technique and strategy utilities. */\nexport {\n /** Get the icon URL for a solving technique by its path slug. */\n getTechniqueIconUrl,\n /** Public slug for a technique path ('3d-medusa' -> 'medusa-coloring'). */\n toCanonicalTechniquePath,\n /** API path for a technique slug ('medusa-coloring' -> '3d-medusa'). */\n toApiTechniquePath,\n /** Whether two technique paths name the same technique, aliases included. */\n isSameTechniquePath,\n /** Find a technique by API path or canonical slug. */\n findTechniqueByPath,\n /** Parse a comma-separated dependencies field into technique ids. */\n parseTechniqueDependencies,\n /** Techniques a technique depends on (\"Requires\"). */\n getTechniqueDependencies,\n /** Techniques that depend on a technique (\"Learn after\"). */\n getDependentTechniques,\n /** Sort techniques by level, then technique number. */\n sortTechniquesByLevel,\n /** Group techniques by level (Map, each group sorted by technique number). */\n groupTechniquesByLevel,\n /** Techniques of a strategy, sorted by technique number. */\n getTechniquesForStrategy,\n /** Find a strategy by its URL stub. */\n findStrategyByStub,\n /** Public slugs of all 60 techniques (footer / sitemap order). */\n TECHNIQUE_SLUGS,\n /** Stubs of the 17 strategies (difficulty order). */\n STRATEGY_SLUGS,\n /** Difficulty tier for a strategy's difficulty value. */\n getStrategyDifficultyTier,\n /** i18n key for a strategy's difficulty tier (e.g. 'strategy.expert'). */\n getStrategyDifficultyKey,\n /** Localized sections of a strategy from the strategies namespace. */\n getStrategySections,\n /** Localized overview, how-it-works steps and tips of a technique. */\n parseTechniqueContent,\n} from './utils';\n\n// ============================================================================\n// Technique Bitmask Utilities\n// ============================================================================\n\n/** Exact (bigint) technique bitmasks for boards, dailies and game meta. */\nexport {\n /** Exact bitmask of a board/daily/meta; never throws (falls back to 0n). */\n exactTechniqueBitmask,\n /** Exact bitmask as the base-10 string API requests take. */\n techniqueBitmaskString,\n /** The techniques / techniques_bitmask pair to store on game meta. */\n techniqueFieldsOf,\n} from './utils';\n\n// ============================================================================\n// Technique Walkthrough Utilities\n// ============================================================================\n\n/** A single step in a technique walkthrough (board + hint overlay + text). */\nexport type { WalkthroughStep } from './utils';\n\n/** Shared logic for building step-by-step technique examples from practice data. */\nexport {\n /** Parse a comma-delimited pencilmarks string into per-cell arrays. */\n parsePencilmarksString,\n /** Convert per-cell pencilmarks arrays back to a comma-delimited string. */\n pencilmarksToString,\n /** Parse board/pencilmarks/solution strings into a SudokuCell array. */\n parsePracticeBoard,\n /** Deep clone a SudokuCell array. */\n cloneSudokuBoard,\n /** Apply a hint step's actions to a board, returning new state. */\n applyHintStep,\n /** Parse a hint_data JSON string into SolverHints. */\n parseHintData,\n /** Resolve localised title and text for a single hint step. */\n localizeHintStep,\n /** Build the full walkthrough step array from board and hint data. */\n buildWalkthroughSteps,\n} from './utils';\n\n// ============================================================================\n// Hint Explanation Utilities\n// ============================================================================\n\n/** Hint explanation generation utilities for teaching users solving techniques. */\nexport {\n /** Generate a detailed explanation for a hint step based on the technique. */\n generateDetailedExplanation,\n /** Get a short action summary for a hint step (e.g., 'Place 5 in R1C3'). */\n getHintActionSummary,\n} from './utils';\n\n// ============================================================================\n// Localized Hint Utilities\n// ============================================================================\n\n/** Types for hint text localization. */\nexport type {\n /** Translation function compatible with i18next's `t` function. */\n TranslateFunction,\n /** Nested heading tree (the `headings` object of hints.json). */\n HintHeadingTree,\n /** Text/title/heading resolvers returned by createLocalizedHintHelpers. */\n LocalizedHintHelpers,\n} from './utils';\n\n/** Hint localization utilities. */\nexport {\n /** Get localized text for a hint step using a translation function. */\n getLocalizedHintText,\n /** Get localized title for a hint step using a translation function. */\n getLocalizedHintTitle,\n /** Resolve a localized API field, falling back to the raw value. */\n localizedField,\n /** Key prefix of the per-step heading tree ('headings.'). */\n HINT_HEADING_KEY_PREFIX,\n /** Heading localization (headings.<path>) for a hint step, or undefined. */\n getStepHeadingLocalization,\n /** Translated heading for a hint step, or ''. */\n getLocalizedHintHeading,\n /** Fill {{valueN}} placeholders from a values array. */\n interpolateHintValues,\n /** Heading for a hint step looked up in a heading tree (no i18n library). */\n getStepHeadingFromTree,\n /** Build the text/title/heading resolvers behind the apps' useLocalizedHint. */\n createLocalizedHintHelpers,\n} from './utils';\n\n// ============================================================================\n// Entity Translation Utilities\n// ============================================================================\n\n/** Shapes the entity display helpers read. */\nexport type {\n /** Level fields used by getLevelDisplayTitle / getLevelDisplayText. */\n LevelDisplaySource,\n /** Technique fields used by getTechniqueDisplayTitle. */\n TechniqueDisplaySource,\n /** Strategy fields used by getStrategyDisplayTitle. */\n StrategyDisplaySource,\n} from './utils';\n\n/** Translation of API entities (levels, techniques, belts). */\nexport {\n /** Route prefixed entity keys (levels.*, techniques.*) to their namespaces. */\n createNamespacedTranslate,\n /** Display title of a level (localization, levels namespace, raw title). */\n getLevelDisplayTitle,\n /** Display description of a level (localization, levels namespace, raw text). */\n getLevelDisplayText,\n /** Display title of a technique (localization, techniques namespace, raw title). */\n getTechniqueDisplayTitle,\n /** Localized belt name for a level ('belts' namespace `${level}.name`). */\n getBeltDisplayName,\n /** Localized belt label for a level ('belts' namespace `${level}.label`). */\n getBeltDisplayLabel,\n /** Display title of a strategy (localization, strategies namespace, raw title, stub). */\n getStrategyDisplayTitle,\n} from './utils';\n\n// ============================================================================\n// i18n Key Utilities\n// ============================================================================\n\n/** Internationalization key generation and localization utilities. */\nexport {\n /** Get i18n key for a belt name (e.g., 'belts.1.name'). */\n getBeltKey,\n /** Get localized belt name using a translation function. */\n getLocalizedBeltName,\n /** Get i18n key for a belt label (e.g., 'belts.1.label'). */\n getBeltLabelKey,\n /** Get localized belt label (e.g., 'White Belt'). */\n getLocalizedBeltLabel,\n /** Get i18n key for a level title (e.g., 'levels.3'). */\n getLevelKey,\n /** Get localized level title using a translation function. */\n getLocalizedLevelTitle,\n /** Get i18n key for a technique name (e.g., 'techniques.full-house.title'). */\n getTechniqueKey,\n /** Get localized technique name using a translation function. */\n getLocalizedTechniqueName,\n} from './utils';\n\n// ============================================================================\n// Digit Display Utilities\n// ============================================================================\n\n/** Digit display format conversion. */\nexport {\n /** Convert a digit (1-9) to its display string based on the format (numeric, kanji, emojis). */\n displayDigit,\n} from './utils';\n\n// ============================================================================\n// Scanned Board (OCR) Utilities\n// ============================================================================\n\n/** A board read from an image, and the error a scan can fail with. */\nexport type { ScannedBoard, ScanBoardErrorCode } from './utils';\n\nexport {\n /** Fewest givens a scanned board needs (17). */\n MIN_SCAN_CLUES,\n /** Error thrown by scannedBoardFromResponse / useBoardScan, with a `code`. */\n ScanBoardError,\n /** Normalize an OCR API result into givens, player digits and pencilmarks. */\n toScannedBoard,\n /** Whether a scanned board carries any player digits. */\n hasScannedInput,\n /** Turn the OCR endpoint's response into a ScannedBoard (or throw why not). */\n scannedBoardFromResponse,\n} from './utils';\n\n// ============================================================================\n// Share URL Utilities\n// ============================================================================\n\n/** Types for share URL building and parsing. */\nexport type {\n /** Options for buildShareUrl. */\n ShareUrlParams,\n /** Game state parsed from a puzzle share URL. */\n ParsedShareParams,\n /** What a share URL points at ('daily' | 'puzzle' | 'technique' | ...). */\n ShareUrlType,\n /** URLSearchParams or a plain object of route params. */\n ShareParamsSource,\n} from './utils';\n\n/** Build a share URL from game state. */\nexport { buildShareUrl } from './utils';\n\n/** Parse share URL query parameters into game state. */\nexport { parseShareParams } from './utils';\n\n/** Derive web app URL from API base URL. */\nexport { getWebUrl } from './utils';\n\n// ============================================================================\n// Auth Utilities\n// ============================================================================\n\n/** Minimal user shape for auth checks. */\nexport type { AuthUser } from './utils';\n\n/** Check if user-specific API calls should be enabled (non-anonymous, has token). */\nexport { isAuthenticatedUser } from './utils';\n\n/** Whether a user is a real (signed-in, non-anonymous) account. */\nexport { isRealUser } from './utils';\n\n// ============================================================================\n// Language Utilities\n// ============================================================================\n\n/** Types for supported languages. */\nexport type {\n /** A supported language (code, native name, flag). */\n SupportedLanguageInfo,\n /** A supported language code (lowercase, e.g. 'zh-hant'). */\n SupportedLanguageCode,\n} from './utils';\n\n/** Supported languages, locale resolution and language storage keys. */\nexport {\n /** The 15 supported UI languages. */\n SUPPORTED_LANGUAGES,\n /** Codes of the supported languages. */\n SUPPORTED_LANGUAGE_CODES,\n /** Fallback language ('en'). */\n DEFAULT_LANGUAGE,\n /** Web localStorage key for the language preference ('language'). */\n LANGUAGE_STORAGE_KEY,\n /** RN AsyncStorage key for the language preference ('@sudojo/language'). */\n NATIVE_LANGUAGE_STORAGE_KEY,\n /** Whether a code is a supported language code. */\n isSupportedLanguage,\n /** Map a code or locale tag to a supported code (zh-TW/HK -> zh-hant), or null. */\n normalizeLanguageCode,\n /** Supported language for a locale tag, defaulting to 'en'. */\n resolveLanguage,\n /** BCP 47 casing of a code ('zh-hant' -> 'zh-Hant'). */\n toLanguageTag,\n /** Native name of a language, or undefined. */\n getLanguageNativeName,\n} from './utils';\n\n// ============================================================================\n// Community Utilities\n// ============================================================================\n\n/** A known community platform (id, label key, English label). */\nexport type { CommunityPlatformInfo } from './utils';\n\n/** Community platform order and labels. */\nexport {\n /** Known community platforms in display order. */\n COMMUNITY_PLATFORMS,\n /** Info for a platform id (case-insensitive), or undefined. */\n getCommunityPlatform,\n /** Sort platform ids into display order (unknown last). */\n sortCommunityPlatforms,\n} from './utils';\n\n// ============================================================================\n// Gamification Utilities\n// ============================================================================\n\n/** Types for badge progress. */\nexport type {\n /** Badge definitions split into level/game lists with an earned lookup. */\n BadgeProgress,\n /** Badge definition fields groupBadgeProgress reads. */\n BadgeDefinitionLike,\n} from './utils';\n\n/** Badge grouping for profile and statistics screens. */\nexport {\n /** badgeType of level mastery badges ('level_mastery'). */\n LEVEL_MASTERY_BADGE_TYPE,\n /** badgeType of games-played badges ('games_played'). */\n GAMES_PLAYED_BADGE_TYPE,\n /** Split badge definitions into sorted level/game lists with isEarned. */\n groupBadgeProgress,\n} from './utils';\n\n// ============================================================================\n// Hint Access Utilities\n// ============================================================================\n\n/** Types for the hint access panel. */\nexport type {\n /** What the hint access panel's button does. */\n HintAccessAction,\n /** Which message the hint access panel shows. */\n HintAccessVariant,\n /** Action and message variant for a hint access state. */\n HintAccessPresentation,\n} from './utils';\n\n/** Client-side hint gating helpers. */\nexport {\n /** Hint steps visible without the level's entitlement (2). */\n FREE_HINT_STEP_LIMIT,\n /** Map a hint access state to the panel's action and message variant. */\n getHintAccessAction,\n /** i18n key suffixes for the hint access messages. */\n HINT_ACCESS_KEY_SUFFIXES,\n} from './utils';\n\n// ============================================================================\n// Daily Date Utilities\n// ============================================================================\n\n/** Calendar-date helpers for daily puzzles (UTC \"today\", like the API). */\nexport {\n /** UTC date of a Date (default now) as YYYY-MM-DD. */\n getUtcDateString,\n /** Normalize a daily date to YYYY-MM-DD without a timezone shift, or null. */\n normalizeDailyDate,\n /** Format a YYYY-MM-DD daily date as a local calendar date. */\n formatDailyDate,\n /** Whether a saved daily is not today's (UTC) daily. */\n isStaleDaily,\n} from './utils';\n\n// ============================================================================\n// Game Fetch Status Utilities\n// ============================================================================\n\n/** Response shape (with the legacy action field) read by getGameFetchStatus. */\nexport type { GameFetchResponse } from './utils';\n\n/** Status derivation shared by useLevelGame and useDailyGame. */\nexport {\n /** Whether a response/error says sign-in is required (legacy API signal). */\n isAuthRequiredResponse,\n /** Whether a response/error says a subscription is required (legacy API signal). */\n isSubscriptionRequiredResponse,\n /** Derive a GameFetchStatus from query state. */\n getGameFetchStatus,\n /** HTTP status carried by an error (NetworkError.status), or undefined. */\n getErrorHttpStatus,\n /** Derive a PracticeFetchStatus (401/402 aware) from query state. */\n getPracticeFetchStatus,\n} from './utils';\n\n/** Status of a practice fetch ('loading' | 'ready' | 'auth_required' | 'subscription_required' | 'no_practices' | 'error'). */\nexport type { PracticeFetchStatus } from './utils';\n\n// ============================================================================\n// Technique Example Utilities\n// ============================================================================\n\n/** Types for technique example walkthroughs. */\nexport type {\n /** Stored example/practice fields a walkthrough is built from. */\n TechniqueExampleSource,\n /** Translation functions (hints, techniques, default namespaces). */\n TechniqueWalkthroughTranslations,\n /** Walkthrough cards and their headings. */\n TechniqueWalkthrough,\n} from './utils';\n\n/** Build walkthrough cards and headings for a stored technique example. */\nexport { buildTechniqueWalkthrough } from './utils';\n\n// ============================================================================\n// Hooks\n// ============================================================================\n\nexport {\n // Data hooks\n /** Fetch a single difficulty level by number. */\n useLevel,\n /** Fetch all difficulty levels with sorting and filtering utilities. */\n useLevels,\n /** Fetch a single solving technique by number. */\n useTechnique,\n /** Fetch all solving techniques with grouping utilities. */\n useTechniques,\n /** Fetch communities for a specific language with platform grouping. */\n useCommunities,\n /** Fetch learning materials with filtering by technique and language. */\n useLearning,\n /** Fetch a single learning item by UUID. */\n useLearningItem,\n\n /**\n * @deprecated Use `useSudoku` instead. `useGame` uses a legacy 2D array board\n * representation, while `useSudoku` uses a flat 81-cell array consistent with\n * the Kotlin renderable layer and the rest of the codebase.\n */\n useGame,\n\n /** Primary game state hook with flat 81-cell board, pencil mode, and scrambling. */\n useSudoku,\n\n /** Teaching/hint integration with the solver API (legacy GameHint format). */\n useGameTeaching,\n\n /** Fetch a random board for a specific level with auth/subscription handling. */\n useLevelGame,\n /** Fetch today's daily puzzle with auth/subscription handling. */\n useDailyGame,\n\n /** Game timer using refs to avoid re-renders every second. */\n useGameTimer,\n\n /** Persist individual game progress to localStorage. */\n useGamePersistence,\n /** Auto-save game state with debouncing. */\n useAutoSave,\n\n /** Generic typed localStorage hook with SSR safety. */\n useLocalStorage,\n\n /** Solver hint integration matching Kotlin HintInteractor behavior. */\n useHint,\n\n /** Current game management with Zustand store (daily/play slots). */\n useGamePlay,\n\n /** Shared \"Continue Last Sudoku\" logic for web and RN. */\n useContinueGame,\n\n /** Manual puzzle entry mode with solver validation. */\n useBoardEntry,\n\n /** Scan a board from an image: givens, player digits and pencilmarks. */\n useBoardScan,\n\n /** Server-side game session management for gamification (points, badges). */\n useGameSession,\n\n /** Check whether a level is enabled for the current user's entitlements. */\n useLevelEnabled,\n /** Check whether a technique is enabled for the current user's entitlements. */\n useTechniqueEnabled,\n\n /** Convert internal user level (0-indexed) to display values (1-indexed + belt). */\n useDisplayLevel,\n\n /** Compute cumulative puzzle distribution across entitlement tiers. */\n usePuzzleDistribution,\n\n /** Shared hint step tracker for game screens (ref + state). */\n useHintStepTracker,\n\n /** Auto-hint orchestration for shared links/deep links. */\n useAutoHint,\n\n /** Progress reporting for game state persistence. */\n useProgressReporter,\n\n /** Regenerate hint_data for all stored practices via solver. */\n useRegeneratePracticeHints,\n\n /** Emit a hint action event to the active SudokuGame. */\n emitHintAction,\n /** Report hint status back after processing an action. */\n reportHintStatus,\n /** Subscribe to hint status updates. */\n onHintStatus,\n /** Hook for SudokuGame to listen for external hint action events. */\n useHintActionListener,\n\n /** Fire a callback once each time a puzzle becomes completed (re-arms on false). */\n useCompletionTrigger,\n /** Fetch strategies (unwrapped) with findStrategyByStub. */\n useStrategies,\n /** Fetch a random practice for a technique with auth/subscription/empty status. */\n usePracticeGame,\n /** Whether the user is a real (non-anonymous) account. */\n useIsRealUser,\n /** Whether the signed-in user is a site admin (GET /users/:uid siteAdmin). */\n useIsSiteAdmin,\n /** Look up a technique by path or alias (list first, then GET by path). */\n useTechniqueByPath,\n /** Fetch a technique's worked example and build its walkthrough. */\n useTechniqueExample,\n /** Build (memoized) the walkthrough for a stored technique example. */\n useTechniqueWalkthrough,\n /** Player's puzzle progress in localStorage (markCompleted, isCompleted, stats). */\n usePuzzleProgress,\n /** Account deletion rule and delete-then-sign-out sequence. */\n useDeleteAccount,\n /** Saved game to resume for a play screen (snapshot; clears stale dailies). */\n useResumeGame,\n /** The saved game a play screen should resume, or null (pure). */\n getResumeGame,\n /** Daily/Level play screen orchestration (resume, save, session, completion). */\n usePuzzleSession,\n /** Entered-puzzle save/resume after validation (no server session). */\n useEnteredGameSession,\n} from './hooks';\n\nexport type {\n // Data hook types\n /** Options for useLevel hook. */\n UseLevelOptions,\n /** Result type for useLevel hook. */\n UseLevelResult,\n /** Options for useLevels hook. */\n UseLevelsOptions,\n /** Result type for useLevels hook. */\n UseLevelsResult,\n /** Options for useTechnique hook. */\n UseTechniqueOptions,\n /** Result type for useTechnique hook. */\n UseTechniqueResult,\n /** Options for useTechniques hook. */\n UseTechniquesOptions,\n /** Result type for useTechniques hook. */\n UseTechniquesResult,\n /** Options for useCommunities hook. */\n UseCommunitiesOptions,\n /** Result type for useCommunities hook. */\n UseCommunitiesResult,\n /** Options for useLearningItem hook. */\n UseLearningItemOptions,\n /** Result type for useLearningItem hook. */\n UseLearningItemResult,\n /** Options for useLearning hook. */\n UseLearningOptions,\n /** Result type for useLearning hook. */\n UseLearningResult,\n\n // Game hook types (legacy)\n /** @deprecated Options for legacy useGame hook. Use UseSudokuOptions instead. */\n UseGameOptions,\n /** @deprecated Result type for legacy useGame hook. Use UseSudokuResult instead. */\n UseGameResult,\n\n // Sudoku hook types\n /** Options for useSudoku hook (initial app settings). */\n UseSudokuOptions,\n /** Result type for useSudoku hook (state, computed values, actions, utilities). */\n UseSudokuResult,\n\n // Teaching hook types\n /** Options for useGameTeaching hook (network client, URL, token). */\n UseGameTeachingOptions,\n /** Result type for useGameTeaching hook (teaching state, hint actions). */\n UseGameTeachingResult,\n\n // Game fetching hook types\n /** Options for useLevelGame hook (network, auth, level number). */\n UseLevelGameOptions,\n /** Result type for useLevelGame hook (board data, fetch status). */\n UseLevelGameResult,\n /** Options for useDailyGame hook (network, auth). */\n UseDailyGameOptions,\n /** Result type for useDailyGame hook (daily data, fetch status). */\n UseDailyGameResult,\n /** Status of a game fetch: 'loading' | 'success' | 'auth_required' | 'subscription_required' | 'entitlement_required' | 'error'. */\n GameFetchStatus,\n\n // Timer hook types\n /** Options for useGameTimer hook (autoStart, initialTime). */\n UseGameTimerOptions,\n /** Result type for useGameTimer hook (elapsedRef, controls). */\n UseGameTimerResult,\n\n // Persistence hook types\n /** Options for useGamePersistence hook (puzzleKey, autoSave). */\n UseGamePersistenceOptions,\n /** Result type for useGamePersistence hook (load, save, clear, hasSaved). */\n UseGamePersistenceResult,\n\n // Hint hook types\n /** Options for useHint hook (network, puzzle state, technique filter). */\n UseHintOptions,\n /** Result type for useHint hook (hint steps, navigation, apply). */\n UseHintResult,\n /** Board data returned when applying a hint (user input, pencilmarks). */\n HintBoardData,\n /** Data passed to onHintReceived callback (hint, board data, technique info). */\n HintReceivedData,\n /** Access denied error info when hint level exceeds subscription tier. */\n HintAccessError,\n\n // Game play hook types\n /** Options for useGamePlay hook (slot selection, auto-save delay). */\n UseGamePlayOptions,\n /** Result type for useGamePlay hook (current game, start, update, clear). */\n UseGamePlayResult,\n\n // Continue game hook types\n /** Options for useContinueGame hook. */\n UseContinueGameOptions,\n /** Result type for useContinueGame hook. */\n UseContinueGameResult,\n /** Navigation target returned by useContinueGame. */\n ContinueTarget,\n\n // Board entry hook types\n /** Options for useBoardEntry hook (network client, URL, token). */\n UseBoardEntryOptions,\n /** Result type for useBoardEntry hook (cells, validation, actions). */\n UseBoardEntryReturn,\n /** Validated puzzle data from solver (puzzle + solution strings). */\n ValidatedPuzzle,\n\n // Board scan hook types\n /** Options for useBoardScan hook (network client, URL). */\n UseBoardScanOptions,\n /** Result type for useBoardScan hook (scan, isScanning). */\n UseBoardScanReturn,\n\n // Game session hook types\n /** Options for useGameSession hook (network, auth, userId). */\n UseGameSessionOptions,\n /** Result of starting a game session (sessionStarted, sessionId). */\n GameSessionResult,\n /** Result of finishing a game session (leveledUp, badges, points). */\n GameFinishResult,\n\n // Display level hook types\n /** Result type for useDisplayLevel hook. */\n UseDisplayLevelResult,\n\n // Hint step tracker types\n /** Result type for useHintStepTracker hook. */\n UseHintStepTrackerResult,\n\n // Auto-hint types\n /** Options for useAutoHint hook. */\n UseAutoHintOptions,\n\n // Practice admin types\n UseRegeneratePracticeHintsOptions,\n UseRegeneratePracticeHintsResult,\n\n // Progress reporter types\n /** Options for useProgressReporter hook. */\n UseProgressReporterOptions,\n /** Callback type for progress updates. */\n ProgressUpdateCallback,\n\n // Hint action types\n /** Status reported after a hint action is processed. */\n HintActionStatus,\n\n // Board entry play state\n /** What a validated entered puzzle should apply (scanned input, pencilmarks). */\n BoardEntryPlayState,\n\n // Strategies hook types\n /** Options for useStrategies hook. */\n UseStrategiesOptions,\n /** Result type for useStrategies hook. */\n UseStrategiesResult,\n\n // Practice game hook types\n /** Options for usePracticeGame hook. */\n UsePracticeGameOptions,\n /** Result type for usePracticeGame hook. */\n UsePracticeGameResult,\n\n // User status hook types\n /** Options for useIsSiteAdmin hook. */\n UseIsSiteAdminOptions,\n /** Result type for useIsSiteAdmin hook. */\n UseIsSiteAdminResult,\n\n // Technique lookup / example hook types\n /** Options for useTechniqueByPath hook. */\n UseTechniqueByPathOptions,\n /** Result type for useTechniqueByPath hook. */\n UseTechniqueByPathResult,\n /** Where a technique example comes from ('example' | 'practice'). */\n TechniqueExampleSourceKind,\n /** Options for useTechniqueExample hook. */\n UseTechniqueExampleOptions,\n /** Result type for useTechniqueExample hook. */\n UseTechniqueExampleResult,\n\n // Puzzle progress hook types\n /** Options for usePuzzleProgress hook. */\n UsePuzzleProgressOptions,\n /** Result type for usePuzzleProgress hook. */\n UsePuzzleProgressResult,\n\n // Account deletion hook types\n /** What deleteAccount did ('deleted' | 'blocked' | 'failed'). */\n DeleteAccountOutcome,\n /** Provider tokens for account deletion (Google/Apple revocation). */\n DeleteAccountProviderTokens,\n /** Options for useDeleteAccount hook. */\n UseDeleteAccountOptions,\n /** Result type for useDeleteAccount hook. */\n UseDeleteAccountResult,\n\n // Play session hook types\n /** Play screen kind ('daily' | 'level'). */\n PuzzleSessionSource,\n /** Saved game kind useResumeGame can resume ('daily' | 'level' | 'entered'). */\n ResumeGameSource,\n /** Options for useEnteredGameSession hook. */\n UseEnteredGameSessionOptions,\n /** Result type for useEnteredGameSession hook. */\n UseEnteredGameSessionResult,\n /** Options for useResumeGame hook. */\n UseResumeGameOptions,\n /** Result type for useResumeGame hook. */\n UseResumeGameResult,\n /** The puzzle a play screen shows (fetched or resumed). */\n ActivePuzzle,\n /** Props for the game component from usePuzzleSession. */\n PuzzleGameProps,\n /** Fetched Daily/Board shape usePuzzleSession accepts. */\n SessionPuzzleInput,\n /** Options for usePuzzleSession hook. */\n UsePuzzleSessionOptions,\n /** Result type for usePuzzleSession hook. */\n UsePuzzleSessionResult,\n} from './hooks';\n\n// ============================================================================\n// Stores\n// ============================================================================\n\n/** Zustand store for current game state with daily/play slots and localStorage persistence. */\nexport { useGamePlayStore } from './stores/gamePlayStore';\n/** State shape for the game play Zustand store. */\nexport type { GamePlayState } from './stores/gamePlayStore';\n\n// ============================================================================\n// Config\n// ============================================================================\n\n/** Authentication provider configuration types. */\nexport type {\n /** Available auth provider types: 'google' | 'apple' | 'email'. */\n AuthProviderType,\n /** Configuration for which auth providers are enabled. */\n AuthProvidersConfig,\n} from './config';\n\n/** Default auth providers configuration (Google + Email, anonymous fallback). */\nexport { DEFAULT_AUTH_PROVIDERS } from './config';\n\n// ============================================================================\n// Entitlement Context\n// ============================================================================\n\n/** Provider that supplies entitlements to useLevelEnabled / useTechniqueEnabled. */\nexport { EntitlementProvider } from './context';\n/** React context for entitlements (for advanced use). */\nexport { EntitlementContext, useEntitlementContext } from './context';\n\n// ============================================================================\n// Sudojo API Context\n// ============================================================================\n\n/** Optional provider of networkClient/baseUrl/token for sudojo_lib hooks. */\nexport { SudojoApiProvider } from './context';\n/** API context, its hooks, and the option-over-context resolver. */\nexport {\n /** React context holding the API connection (for advanced use). */\n SudojoApiContext,\n /** The provider's API connection (throws without a provider). */\n useSudojoApi,\n /** The provider's API connection, or null. */\n useOptionalSudojoApi,\n /** Merge explicit options over a context value (pure; throws if incomplete). */\n resolveSudojoApi,\n /** Resolve a hook's API connection from options, then the provider. */\n useResolvedSudojoApi,\n} from './context';\n/** Types for the Sudojo API context. */\nexport type {\n /** The API connection the provider supplies. */\n SudojoApiValue,\n /** Optional networkClient/baseUrl/token fields of hook options. */\n SudojoApiOptions,\n /** An API connection with every field resolved (token '' when none). */\n ResolvedSudojoApi,\n} from './context';\n\n// ============================================================================\n// Entitlement Utilities (re-exported from sudojo_types)\n// ============================================================================\n\n/** Parse a comma-delimited entitlement string into an array. */\nexport { parseEntitlements } from '@sudobility/sudojo_types';\n\n/** Check if a user has the required entitlement for a level. */\nexport { hasRequiredEntitlement } from '@sudobility/sudojo_types';\n\n// ============================================================================\n// Admin (batch jobs + stats; see src/admin/index.ts for the full list)\n// ============================================================================\n\n/**\n * Admin module: board generation, technique extraction, example creation and\n * admin stats as hooks (`useBoardGenerator`, `useTechniqueExtractor`,\n * `useExampleCreator`, `useSingleBoardExtractor`, `useBoardTechniquesUpdater`,\n * `useAdminStats`), the framework-agnostic jobs behind them\n * (`runBoardGeneration`, `runTechniqueExtraction`, `runExampleCreation`) and\n * their pure rules (`mergeBoardWithUserInput`, `adjustPracticeSolution`,\n * `extractBoardTechniques`, `levelsToSearchForTechnique`, …). Network calls go\n * only through sudojo_client hooks (`useAdminApi`).\n */\nexport * from './admin';\n"]}
|
|
@@ -15,8 +15,16 @@ export interface CurrentGameMeta {
|
|
|
15
15
|
levelTitle?: string;
|
|
16
16
|
/** Board UUID for the puzzle */
|
|
17
17
|
boardUuid?: string;
|
|
18
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* Techniques bitset for the puzzle. Lossy as a number once any technique
|
|
20
|
+
* id >= 54 is set; prefer `techniques_bitmask`.
|
|
21
|
+
*/
|
|
19
22
|
techniques?: number | null;
|
|
23
|
+
/**
|
|
24
|
+
* Exact base-10 string of the techniques bitmask (see techniqueFieldsOf /
|
|
25
|
+
* exactTechniqueBitmask). Persisted as-is with the rest of the meta.
|
|
26
|
+
*/
|
|
27
|
+
techniques_bitmask?: string | null;
|
|
20
28
|
/**
|
|
21
29
|
* For entered puzzles - the level (1-12) the solver rated it at when it
|
|
22
30
|
* was validated, so a resumed game can still show it without re-validating.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"currentGame.d.ts","sourceRoot":"","sources":["../../src/types/currentGame.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,iCAAiC;AACjC,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,OAAO,GAAG,SAAS,CAAC;AAEvD,uCAAuC;AACvC,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,MAAM,C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AAM,CAAC;IACpB,kDAAkD;IAClD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,qCAAqC;IACrC,YAAY,EAAE,OAAO,CAAC;IACtB,4CAA4C;IAC5C,eAAe,EAAE,OAAO,CAAC;IACzB,8BAA8B;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,6CAA6C;IAC7C,SAAS,EAAE,MAAM,CAAC;IAClB,qCAAqC;IACrC,SAAS,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"currentGame.js","sourceRoot":"","sources":["../../src/types/currentGame.ts"],"names":[],"mappings":"AAAA;;GAEG","sourcesContent":["/**\n * Types for the current game feature\n */\n\n/** Source of the current game */\nexport type GameSource = 'daily' | 'level' | 'entered';\n\n/** Which store slot a game lives in */\nexport type GameSlot = 'daily' | 'play';\n\n/** Metadata for navigation back to the game */\nexport interface CurrentGameMeta {\n /** For daily games - the date string (YYYY-MM-DD) */\n dailyDate?: string;\n /** For level games - the level UUID */\n levelId?: string;\n /** Level title for display */\n levelTitle?: string;\n /** Board UUID for the puzzle */\n boardUuid?: string;\n
|
|
1
|
+
{"version":3,"file":"currentGame.js","sourceRoot":"","sources":["../../src/types/currentGame.ts"],"names":[],"mappings":"AAAA;;GAEG","sourcesContent":["/**\n * Types for the current game feature\n */\n\n/** Source of the current game */\nexport type GameSource = 'daily' | 'level' | 'entered';\n\n/** Which store slot a game lives in */\nexport type GameSlot = 'daily' | 'play';\n\n/** Metadata for navigation back to the game */\nexport interface CurrentGameMeta {\n /** For daily games - the date string (YYYY-MM-DD) */\n dailyDate?: string;\n /** For level games - the level UUID */\n levelId?: string;\n /** Level title for display */\n levelTitle?: string;\n /** Board UUID for the puzzle */\n boardUuid?: string;\n /**\n * Techniques bitset for the puzzle. Lossy as a number once any technique\n * id >= 54 is set; prefer `techniques_bitmask`.\n */\n techniques?: number | null;\n /**\n * Exact base-10 string of the techniques bitmask (see techniqueFieldsOf /\n * exactTechniqueBitmask). Persisted as-is with the rest of the meta.\n */\n techniques_bitmask?: string | null;\n /**\n * For entered puzzles - the level (1-12) the solver rated it at when it\n * was validated, so a resumed game can still show it without re-validating.\n */\n level?: number;\n /** For entered puzzles - the solver's difficulty_score, kept for the same reason */\n difficultyScore?: number;\n}\n\n/** Current game state stored in Zustand */\nexport interface CurrentGame {\n /** Game source type */\n source: GameSource;\n /** Original puzzle string (81 chars) */\n puzzle: string;\n /** Solution string (81 chars) */\n solution: string;\n /** Navigation metadata */\n meta: CurrentGameMeta;\n /** User's current input (81 chars, '0' = empty) */\n inputString: string;\n /** User's pencilmarks (comma-separated format) */\n pencilmarksString: string;\n /** Whether pencil mode was active */\n isPencilMode: boolean;\n /** Whether auto pencilmarks were enabled */\n autoPencilmarks: boolean;\n /** Elapsed time in seconds */\n elapsedTime: number;\n /** When the game was started (ISO string) */\n startedAt: string;\n /** When last updated (ISO string) */\n updatedAt: string;\n}\n"]}
|
package/dist/utils/auth.d.ts
CHANGED
|
@@ -32,4 +32,10 @@ export interface AuthUser {
|
|
|
32
32
|
* ```
|
|
33
33
|
*/
|
|
34
34
|
export declare function isAuthenticatedUser(user: AuthUser | null | undefined, token: string | null | undefined): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Whether a user is a real (signed-in, non-anonymous) account:
|
|
37
|
+
* `!!user && !user.isAnonymous`. Unlike isAuthenticatedUser it does not need
|
|
38
|
+
* a token (e.g. for showing account-only UI while the token loads).
|
|
39
|
+
*/
|
|
40
|
+
export declare function isRealUser(user: Pick<AuthUser, 'isAnonymous'> | null | undefined): boolean;
|
|
35
41
|
//# sourceMappingURL=auth.d.ts.map
|
package/dist/utils/auth.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/utils/auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,4FAA4F;AAC5F,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,OAAO,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,QAAQ,GAAG,IAAI,GAAG,SAAS,EACjC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAC/B,OAAO,CAET"}
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/utils/auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,4FAA4F;AAC5F,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,OAAO,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,QAAQ,GAAG,IAAI,GAAG,SAAS,EACjC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAC/B,OAAO,CAET;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,aAAa,CAAC,GAAG,IAAI,GAAG,SAAS,GACrD,OAAO,CAET"}
|
package/dist/utils/auth.js
CHANGED
|
@@ -29,4 +29,12 @@
|
|
|
29
29
|
export function isAuthenticatedUser(user, token) {
|
|
30
30
|
return !!user?.uid && !!token && !user.isAnonymous;
|
|
31
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* Whether a user is a real (signed-in, non-anonymous) account:
|
|
34
|
+
* `!!user && !user.isAnonymous`. Unlike isAuthenticatedUser it does not need
|
|
35
|
+
* a token (e.g. for showing account-only UI while the token loads).
|
|
36
|
+
*/
|
|
37
|
+
export function isRealUser(user) {
|
|
38
|
+
return !!user && !user.isAnonymous;
|
|
39
|
+
}
|
|
32
40
|
//# sourceMappingURL=auth.js.map
|
package/dist/utils/auth.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/utils/auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAQH;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,mBAAmB,CACjC,IAAiC,EACjC,KAAgC;IAEhC,OAAO,CAAC,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC;AACrD,CAAC","sourcesContent":["/**\n * Auth-related utility functions for determining when to make\n * authenticated API calls.\n *\n * Business rule: user info endpoints (profile, siteAdmin) should not\n * be called for anonymous users, as they will return 403. Other\n * user-specific endpoints (subscriptions, gamification) may still\n * work for anonymous users.\n */\n\n/** Minimal user shape needed for auth checks (compatible with both Firebase web and RN). */\nexport interface AuthUser {\n uid: string;\n isAnonymous: boolean;\n}\n\n/**\n * Check whether the current user is a signed-in (non-anonymous) user\n * with a valid token.\n *\n * Use this as the `enabled` option for React Query hooks that hit\n * user info endpoints (e.g. user profile, siteAdmin status) which\n * require a real account and return 403 for anonymous users.\n *\n * Note: do NOT use this for subscription or gamification endpoints —\n * anonymous users on mobile can still have subscriptions via\n * App Store / Play Store.\n *\n * @example\n * ```ts\n * const { data } = useSudojoUser(networkClient, baseUrl, token ?? '', user?.uid ?? '', {\n * enabled: isAuthenticatedUser(user, token),\n * });\n * ```\n */\nexport function isAuthenticatedUser(\n user: AuthUser | null | undefined,\n token: string | null | undefined\n): boolean {\n return !!user?.uid && !!token && !user.isAnonymous;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/utils/auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAQH;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,mBAAmB,CACjC,IAAiC,EACjC,KAAgC;IAEhC,OAAO,CAAC,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC;AACrD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,UAAU,CACxB,IAAsD;IAEtD,OAAO,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC;AACrC,CAAC","sourcesContent":["/**\n * Auth-related utility functions for determining when to make\n * authenticated API calls.\n *\n * Business rule: user info endpoints (profile, siteAdmin) should not\n * be called for anonymous users, as they will return 403. Other\n * user-specific endpoints (subscriptions, gamification) may still\n * work for anonymous users.\n */\n\n/** Minimal user shape needed for auth checks (compatible with both Firebase web and RN). */\nexport interface AuthUser {\n uid: string;\n isAnonymous: boolean;\n}\n\n/**\n * Check whether the current user is a signed-in (non-anonymous) user\n * with a valid token.\n *\n * Use this as the `enabled` option for React Query hooks that hit\n * user info endpoints (e.g. user profile, siteAdmin status) which\n * require a real account and return 403 for anonymous users.\n *\n * Note: do NOT use this for subscription or gamification endpoints —\n * anonymous users on mobile can still have subscriptions via\n * App Store / Play Store.\n *\n * @example\n * ```ts\n * const { data } = useSudojoUser(networkClient, baseUrl, token ?? '', user?.uid ?? '', {\n * enabled: isAuthenticatedUser(user, token),\n * });\n * ```\n */\nexport function isAuthenticatedUser(\n user: AuthUser | null | undefined,\n token: string | null | undefined\n): boolean {\n return !!user?.uid && !!token && !user.isAnonymous;\n}\n\n/**\n * Whether a user is a real (signed-in, non-anonymous) account:\n * `!!user && !user.isAnonymous`. Unlike isAuthenticatedUser it does not need\n * a token (e.g. for showing account-only UI while the token loads).\n */\nexport function isRealUser(\n user: Pick<AuthUser, 'isAnonymous'> | null | undefined\n): boolean {\n return !!user && !user.isAnonymous;\n}\n"]}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Community platform ordering and labels.
|
|
3
|
+
*
|
|
4
|
+
* Brand colors and icons stay in the apps (they are presentation); this holds
|
|
5
|
+
* the order platforms are listed in and their labels.
|
|
6
|
+
*/
|
|
7
|
+
/** A known community platform. */
|
|
8
|
+
export interface CommunityPlatformInfo {
|
|
9
|
+
/** Platform id as the API sends it in `Community.platform` */
|
|
10
|
+
id: string;
|
|
11
|
+
/** i18n key for the section label (default namespace) */
|
|
12
|
+
labelKey: string;
|
|
13
|
+
/** English label, the fallback for `labelKey` (as the web page shows it) */
|
|
14
|
+
label: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Known platforms in display order (the web CommunitiesPage's PLATFORM_ORDER).
|
|
18
|
+
* Unknown platforms sort after these.
|
|
19
|
+
*
|
|
20
|
+
* The `communities.platforms.*` keys are not in the locale files yet; pass
|
|
21
|
+
* `label` as the default value: `t(p.labelKey, p.label)`.
|
|
22
|
+
*/
|
|
23
|
+
export declare const COMMUNITY_PLATFORMS: readonly [{
|
|
24
|
+
readonly id: "reddit";
|
|
25
|
+
readonly labelKey: "communities.platforms.reddit";
|
|
26
|
+
readonly label: "Reddit";
|
|
27
|
+
}, {
|
|
28
|
+
readonly id: "discord";
|
|
29
|
+
readonly labelKey: "communities.platforms.discord";
|
|
30
|
+
readonly label: "Discord";
|
|
31
|
+
}, {
|
|
32
|
+
readonly id: "forum";
|
|
33
|
+
readonly labelKey: "communities.platforms.forum";
|
|
34
|
+
readonly label: "Forums";
|
|
35
|
+
}, {
|
|
36
|
+
readonly id: "facebook";
|
|
37
|
+
readonly labelKey: "communities.platforms.facebook";
|
|
38
|
+
readonly label: "Facebook";
|
|
39
|
+
}, {
|
|
40
|
+
readonly id: "telegram";
|
|
41
|
+
readonly labelKey: "communities.platforms.telegram";
|
|
42
|
+
readonly label: "Telegram";
|
|
43
|
+
}, {
|
|
44
|
+
readonly id: "youtube";
|
|
45
|
+
readonly labelKey: "communities.platforms.youtube";
|
|
46
|
+
readonly label: "YouTube";
|
|
47
|
+
}, {
|
|
48
|
+
readonly id: "whatsapp";
|
|
49
|
+
readonly labelKey: "communities.platforms.whatsapp";
|
|
50
|
+
readonly label: "WhatsApp";
|
|
51
|
+
}, {
|
|
52
|
+
readonly id: "website";
|
|
53
|
+
readonly labelKey: "communities.platforms.website";
|
|
54
|
+
readonly label: "Websites";
|
|
55
|
+
}];
|
|
56
|
+
/** Info for a platform id (case-insensitive), or undefined if unknown. */
|
|
57
|
+
export declare function getCommunityPlatform(platform: string): CommunityPlatformInfo | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* Sort platform ids into display order: known platforms in
|
|
60
|
+
* COMMUNITY_PLATFORMS order (case-insensitive), unknown ones after them in
|
|
61
|
+
* their original order. Returns a new array.
|
|
62
|
+
*/
|
|
63
|
+
export declare function sortCommunityPlatforms(platforms: Iterable<string>): string[];
|
|
64
|
+
//# sourceMappingURL=community.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"community.d.ts","sourceRoot":"","sources":["../../src/utils/community.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,kCAAkC;AAClC,MAAM,WAAW,qBAAqB;IACpC,8DAA8D;IAC9D,EAAE,EAAE,MAAM,CAAC;IACX,yDAAyD;IACzD,QAAQ,EAAE,MAAM,CAAC;IACjB,4EAA4E;IAC5E,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiCqB,CAAC;AAItD,0EAA0E;AAC1E,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,MAAM,GACf,qBAAqB,GAAG,SAAS,CAGnC;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,MAAM,EAAE,CAM5E"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Community platform ordering and labels.
|
|
3
|
+
*
|
|
4
|
+
* Brand colors and icons stay in the apps (they are presentation); this holds
|
|
5
|
+
* the order platforms are listed in and their labels.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Known platforms in display order (the web CommunitiesPage's PLATFORM_ORDER).
|
|
9
|
+
* Unknown platforms sort after these.
|
|
10
|
+
*
|
|
11
|
+
* The `communities.platforms.*` keys are not in the locale files yet; pass
|
|
12
|
+
* `label` as the default value: `t(p.labelKey, p.label)`.
|
|
13
|
+
*/
|
|
14
|
+
export const COMMUNITY_PLATFORMS = [
|
|
15
|
+
{ id: 'reddit', labelKey: 'communities.platforms.reddit', label: 'Reddit' },
|
|
16
|
+
{
|
|
17
|
+
id: 'discord',
|
|
18
|
+
labelKey: 'communities.platforms.discord',
|
|
19
|
+
label: 'Discord',
|
|
20
|
+
},
|
|
21
|
+
{ id: 'forum', labelKey: 'communities.platforms.forum', label: 'Forums' },
|
|
22
|
+
{
|
|
23
|
+
id: 'facebook',
|
|
24
|
+
labelKey: 'communities.platforms.facebook',
|
|
25
|
+
label: 'Facebook',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
id: 'telegram',
|
|
29
|
+
labelKey: 'communities.platforms.telegram',
|
|
30
|
+
label: 'Telegram',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
id: 'youtube',
|
|
34
|
+
labelKey: 'communities.platforms.youtube',
|
|
35
|
+
label: 'YouTube',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
id: 'whatsapp',
|
|
39
|
+
labelKey: 'communities.platforms.whatsapp',
|
|
40
|
+
label: 'WhatsApp',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
id: 'website',
|
|
44
|
+
labelKey: 'communities.platforms.website',
|
|
45
|
+
label: 'Websites',
|
|
46
|
+
},
|
|
47
|
+
];
|
|
48
|
+
const PLATFORM_ORDER = COMMUNITY_PLATFORMS.map(p => p.id);
|
|
49
|
+
/** Info for a platform id (case-insensitive), or undefined if unknown. */
|
|
50
|
+
export function getCommunityPlatform(platform) {
|
|
51
|
+
const id = platform.toLowerCase();
|
|
52
|
+
return COMMUNITY_PLATFORMS.find(p => p.id === id);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Sort platform ids into display order: known platforms in
|
|
56
|
+
* COMMUNITY_PLATFORMS order (case-insensitive), unknown ones after them in
|
|
57
|
+
* their original order. Returns a new array.
|
|
58
|
+
*/
|
|
59
|
+
export function sortCommunityPlatforms(platforms) {
|
|
60
|
+
const rank = (platform) => {
|
|
61
|
+
const index = PLATFORM_ORDER.indexOf(platform.toLowerCase());
|
|
62
|
+
return index === -1 ? PLATFORM_ORDER.length : index;
|
|
63
|
+
};
|
|
64
|
+
return [...platforms].sort((a, b) => rank(a) - rank(b));
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=community.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"community.js","sourceRoot":"","sources":["../../src/utils/community.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAYH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,8BAA8B,EAAE,KAAK,EAAE,QAAQ,EAAE;IAC3E;QACE,EAAE,EAAE,SAAS;QACb,QAAQ,EAAE,+BAA+B;QACzC,KAAK,EAAE,SAAS;KACjB;IACD,EAAE,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,6BAA6B,EAAE,KAAK,EAAE,QAAQ,EAAE;IACzE;QACE,EAAE,EAAE,UAAU;QACd,QAAQ,EAAE,gCAAgC;QAC1C,KAAK,EAAE,UAAU;KAClB;IACD;QACE,EAAE,EAAE,UAAU;QACd,QAAQ,EAAE,gCAAgC;QAC1C,KAAK,EAAE,UAAU;KAClB;IACD;QACE,EAAE,EAAE,SAAS;QACb,QAAQ,EAAE,+BAA+B;QACzC,KAAK,EAAE,SAAS;KACjB;IACD;QACE,EAAE,EAAE,UAAU;QACd,QAAQ,EAAE,gCAAgC;QAC1C,KAAK,EAAE,UAAU;KAClB;IACD;QACE,EAAE,EAAE,SAAS;QACb,QAAQ,EAAE,+BAA+B;QACzC,KAAK,EAAE,UAAU;KAClB;CACkD,CAAC;AAEtD,MAAM,cAAc,GAAsB,mBAAmB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AAE7E,0EAA0E;AAC1E,MAAM,UAAU,oBAAoB,CAClC,QAAgB;IAEhB,MAAM,EAAE,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC;IAClC,OAAO,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;AACpD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC,SAA2B;IAChE,MAAM,IAAI,GAAG,CAAC,QAAgB,EAAU,EAAE;QACxC,MAAM,KAAK,GAAG,cAAc,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC;QAC7D,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC;IACtD,CAAC,CAAC;IACF,OAAO,CAAC,GAAG,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1D,CAAC","sourcesContent":["/**\n * Community platform ordering and labels.\n *\n * Brand colors and icons stay in the apps (they are presentation); this holds\n * the order platforms are listed in and their labels.\n */\n\n/** A known community platform. */\nexport interface CommunityPlatformInfo {\n /** Platform id as the API sends it in `Community.platform` */\n id: string;\n /** i18n key for the section label (default namespace) */\n labelKey: string;\n /** English label, the fallback for `labelKey` (as the web page shows it) */\n label: string;\n}\n\n/**\n * Known platforms in display order (the web CommunitiesPage's PLATFORM_ORDER).\n * Unknown platforms sort after these.\n *\n * The `communities.platforms.*` keys are not in the locale files yet; pass\n * `label` as the default value: `t(p.labelKey, p.label)`.\n */\nexport const COMMUNITY_PLATFORMS = [\n { id: 'reddit', labelKey: 'communities.platforms.reddit', label: 'Reddit' },\n {\n id: 'discord',\n labelKey: 'communities.platforms.discord',\n label: 'Discord',\n },\n { id: 'forum', labelKey: 'communities.platforms.forum', label: 'Forums' },\n {\n id: 'facebook',\n labelKey: 'communities.platforms.facebook',\n label: 'Facebook',\n },\n {\n id: 'telegram',\n labelKey: 'communities.platforms.telegram',\n label: 'Telegram',\n },\n {\n id: 'youtube',\n labelKey: 'communities.platforms.youtube',\n label: 'YouTube',\n },\n {\n id: 'whatsapp',\n labelKey: 'communities.platforms.whatsapp',\n label: 'WhatsApp',\n },\n {\n id: 'website',\n labelKey: 'communities.platforms.website',\n label: 'Websites',\n },\n] as const satisfies readonly CommunityPlatformInfo[];\n\nconst PLATFORM_ORDER: readonly string[] = COMMUNITY_PLATFORMS.map(p => p.id);\n\n/** Info for a platform id (case-insensitive), or undefined if unknown. */\nexport function getCommunityPlatform(\n platform: string\n): CommunityPlatformInfo | undefined {\n const id = platform.toLowerCase();\n return COMMUNITY_PLATFORMS.find(p => p.id === id);\n}\n\n/**\n * Sort platform ids into display order: known platforms in\n * COMMUNITY_PLATFORMS order (case-insensitive), unknown ones after them in\n * their original order. Returns a new array.\n */\nexport function sortCommunityPlatforms(platforms: Iterable<string>): string[] {\n const rank = (platform: string): number => {\n const index = PLATFORM_ORDER.indexOf(platform.toLowerCase());\n return index === -1 ? PLATFORM_ORDER.length : index;\n };\n return [...platforms].sort((a, b) => rank(a) - rank(b));\n}\n"]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calendar-date helpers for daily puzzles.
|
|
3
|
+
*
|
|
4
|
+
* A daily's `date` is a calendar date (`YYYY-MM-DD`), not an instant. The API's
|
|
5
|
+
* `/dailies/today` picks the daily by the **UTC** date, so "today" for the
|
|
6
|
+
* daily is the UTC date everywhere in the clients.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* The UTC calendar date of `date` (default: now) as `YYYY-MM-DD`, the date
|
|
10
|
+
* the API's `/dailies/today` uses.
|
|
11
|
+
*/
|
|
12
|
+
export declare function getUtcDateString(date?: Date): string;
|
|
13
|
+
/**
|
|
14
|
+
* Normalize a daily date (`YYYY-MM-DD`, or an ISO timestamp starting with
|
|
15
|
+
* one) to `YYYY-MM-DD`, without any timezone shift. Returns null when it does
|
|
16
|
+
* not start with a valid date.
|
|
17
|
+
*/
|
|
18
|
+
export declare function normalizeDailyDate(value: string | null | undefined): string | null;
|
|
19
|
+
/**
|
|
20
|
+
* Format a daily's `YYYY-MM-DD` date for display as that LOCAL calendar date
|
|
21
|
+
* (never shifted by the viewer's UTC offset, which `new Date('2026-10-05')`
|
|
22
|
+
* would do west of UTC).
|
|
23
|
+
*
|
|
24
|
+
* @param yyyyMmDd - The daily's date
|
|
25
|
+
* @param locale - BCP 47 locale (default: the runtime's)
|
|
26
|
+
* @param options - Intl options (default: short weekday, short month, day,
|
|
27
|
+
* e.g. "Mon, Oct 5")
|
|
28
|
+
* @returns The formatted date, or null for an invalid date
|
|
29
|
+
*/
|
|
30
|
+
export declare function formatDailyDate(yyyyMmDd: string | null | undefined, locale?: string | string[], options?: Intl.DateTimeFormatOptions): string | null;
|
|
31
|
+
/**
|
|
32
|
+
* Whether a saved daily game is from another day than today's daily
|
|
33
|
+
* (UTC, like the API), so it should be cleared rather than resumed.
|
|
34
|
+
* A missing date counts as stale.
|
|
35
|
+
*/
|
|
36
|
+
export declare function isStaleDaily(dailyDate: string | null | undefined, now?: Date): boolean;
|
|
37
|
+
//# sourceMappingURL=date.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date.d.ts","sourceRoot":"","sources":["../../src/utils/date.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAQH;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,GAAE,IAAiB,GAAG,MAAM,CAIhE;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAC/B,MAAM,GAAG,IAAI,CAaf;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACnC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,EAC1B,OAAO,GAAE,IAAI,CAAC,qBAIb,GACA,MAAM,GAAG,IAAI,CASf;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACpC,GAAG,GAAE,IAAiB,GACrB,OAAO,CAGT"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calendar-date helpers for daily puzzles.
|
|
3
|
+
*
|
|
4
|
+
* A daily's `date` is a calendar date (`YYYY-MM-DD`), not an instant. The API's
|
|
5
|
+
* `/dailies/today` picks the daily by the **UTC** date, so "today" for the
|
|
6
|
+
* daily is the UTC date everywhere in the clients.
|
|
7
|
+
*/
|
|
8
|
+
const DATE_PATTERN = /^(\d{4})-(\d{2})-(\d{2})/;
|
|
9
|
+
function pad2(n) {
|
|
10
|
+
return String(n).padStart(2, '0');
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The UTC calendar date of `date` (default: now) as `YYYY-MM-DD`, the date
|
|
14
|
+
* the API's `/dailies/today` uses.
|
|
15
|
+
*/
|
|
16
|
+
export function getUtcDateString(date = new Date()) {
|
|
17
|
+
return `${date.getUTCFullYear()}-${pad2(date.getUTCMonth() + 1)}-${pad2(date.getUTCDate())}`;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Normalize a daily date (`YYYY-MM-DD`, or an ISO timestamp starting with
|
|
21
|
+
* one) to `YYYY-MM-DD`, without any timezone shift. Returns null when it does
|
|
22
|
+
* not start with a valid date.
|
|
23
|
+
*/
|
|
24
|
+
export function normalizeDailyDate(value) {
|
|
25
|
+
const match = value ? DATE_PATTERN.exec(value) : null;
|
|
26
|
+
if (!match)
|
|
27
|
+
return null;
|
|
28
|
+
const [, y, m, d] = match;
|
|
29
|
+
const date = new Date(Number(y), Number(m) - 1, Number(d));
|
|
30
|
+
if (date.getFullYear() !== Number(y) ||
|
|
31
|
+
date.getMonth() !== Number(m) - 1 ||
|
|
32
|
+
date.getDate() !== Number(d)) {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
return `${y}-${m}-${d}`;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Format a daily's `YYYY-MM-DD` date for display as that LOCAL calendar date
|
|
39
|
+
* (never shifted by the viewer's UTC offset, which `new Date('2026-10-05')`
|
|
40
|
+
* would do west of UTC).
|
|
41
|
+
*
|
|
42
|
+
* @param yyyyMmDd - The daily's date
|
|
43
|
+
* @param locale - BCP 47 locale (default: the runtime's)
|
|
44
|
+
* @param options - Intl options (default: short weekday, short month, day,
|
|
45
|
+
* e.g. "Mon, Oct 5")
|
|
46
|
+
* @returns The formatted date, or null for an invalid date
|
|
47
|
+
*/
|
|
48
|
+
export function formatDailyDate(yyyyMmDd, locale, options = {
|
|
49
|
+
weekday: 'short',
|
|
50
|
+
month: 'short',
|
|
51
|
+
day: 'numeric',
|
|
52
|
+
}) {
|
|
53
|
+
const normalized = normalizeDailyDate(yyyyMmDd);
|
|
54
|
+
if (!normalized)
|
|
55
|
+
return null;
|
|
56
|
+
const [y, m, d] = normalized.split('-').map(Number);
|
|
57
|
+
return new Date(y, m - 1, d).toLocaleDateString(locale, options);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Whether a saved daily game is from another day than today's daily
|
|
61
|
+
* (UTC, like the API), so it should be cleared rather than resumed.
|
|
62
|
+
* A missing date counts as stale.
|
|
63
|
+
*/
|
|
64
|
+
export function isStaleDaily(dailyDate, now = new Date()) {
|
|
65
|
+
const normalized = normalizeDailyDate(dailyDate);
|
|
66
|
+
return normalized === null || normalized !== getUtcDateString(now);
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=date.js.map
|