claude-code-workflow 7.2.5 → 7.2.7
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/.claude/commands/workflow/analyze-with-file.md +11 -10
- package/.claude/skills/ccw-help/command.json +3 -3
- package/.claude/skills/ccw-help/index/all-commands.json +3 -3
- package/.claude/skills/ccw-help/index/by-category.json +3 -3
- package/.claude/skills/ccw-help/index/by-use-case.json +3 -3
- package/.claude/skills/skill-iter-tune/SKILL.md +382 -0
- package/.claude/skills/skill-iter-tune/phases/01-setup.md +144 -0
- package/.claude/skills/skill-iter-tune/phases/02-execute.md +292 -0
- package/.claude/skills/skill-iter-tune/phases/03-evaluate.md +312 -0
- package/.claude/skills/skill-iter-tune/phases/04-improve.md +186 -0
- package/.claude/skills/skill-iter-tune/phases/05-report.md +166 -0
- package/.claude/skills/skill-iter-tune/specs/evaluation-criteria.md +63 -0
- package/.claude/skills/skill-iter-tune/templates/eval-prompt.md +134 -0
- package/.claude/skills/skill-iter-tune/templates/execute-prompt.md +97 -0
- package/.claude/skills/team-roadmap-dev/SKILL.md +1 -1
- package/.claude/skills/team-roadmap-dev/roles/coordinator/role.md +1 -1
- package/.claude/skills/team-roadmap-dev/specs/team-config.json +1 -1
- package/ccw/dist/commands/install.d.ts.map +1 -1
- package/ccw/dist/commands/install.js +11 -9
- package/ccw/dist/commands/install.js.map +1 -1
- package/ccw/dist/core/routes/codexlens/config-handlers.d.ts.map +1 -1
- package/ccw/dist/core/routes/codexlens/config-handlers.js +4 -0
- package/ccw/dist/core/routes/codexlens/config-handlers.js.map +1 -1
- package/ccw/dist/mcp-server/index.js +85 -8
- package/ccw/dist/mcp-server/index.js.map +1 -1
- package/ccw/dist/tools/cli-executor-core.d.ts.map +1 -1
- package/ccw/dist/tools/cli-executor-core.js +0 -25
- package/ccw/dist/tools/cli-executor-core.js.map +1 -1
- package/ccw/dist/tools/cli-executor-state.d.ts.map +1 -1
- package/ccw/dist/tools/cli-executor-state.js +0 -31
- package/ccw/dist/tools/cli-executor-state.js.map +1 -1
- package/ccw/dist/tools/cli-history-store.d.ts.map +1 -1
- package/ccw/dist/tools/cli-history-store.js +1 -30
- package/ccw/dist/tools/cli-history-store.js.map +1 -1
- package/ccw/dist/tools/smart-search.d.ts +72 -1
- package/ccw/dist/tools/smart-search.d.ts.map +1 -1
- package/ccw/dist/tools/smart-search.js +726 -117
- package/ccw/dist/tools/smart-search.js.map +1 -1
- package/ccw/frontend/dist/assets/{AlertDialog-CFGtc76Y.js → AlertDialog-CSZq4WHZ.js} +2 -2
- package/ccw/frontend/dist/assets/{AlertDialog-CFGtc76Y.js.map → AlertDialog-CSZq4WHZ.js.map} +1 -1
- package/ccw/frontend/dist/assets/{AnalysisPage-Duxia_dG.js → AnalysisPage-DVDvLHqI.js} +2 -2
- package/ccw/frontend/dist/assets/{AnalysisPage-Duxia_dG.js.map → AnalysisPage-DVDvLHqI.js.map} +1 -1
- package/ccw/frontend/dist/assets/{ApiSettingsPage-CU9hesAE.js → ApiSettingsPage-D69j8mI6.js} +2 -2
- package/ccw/frontend/dist/assets/{ApiSettingsPage-CU9hesAE.js.map → ApiSettingsPage-D69j8mI6.js.map} +1 -1
- package/ccw/frontend/dist/assets/{CliModeToggle-DcdOFSvM.js → CliModeToggle-fF9xHeGR.js} +2 -2
- package/ccw/frontend/dist/assets/{CliModeToggle-DcdOFSvM.js.map → CliModeToggle-fF9xHeGR.js.map} +1 -1
- package/ccw/frontend/dist/assets/{CliSessionSharePage-oKN-GRIT.js → CliSessionSharePage-Ce8tOQNx.js} +2 -2
- package/ccw/frontend/dist/assets/{CliSessionSharePage-oKN-GRIT.js.map → CliSessionSharePage-Ce8tOQNx.js.map} +1 -1
- package/ccw/frontend/dist/assets/{CliViewerPage-_wUoHaY-.js → CliViewerPage-Bsp1zmfD.js} +2 -2
- package/ccw/frontend/dist/assets/{CliViewerPage-_wUoHaY-.js.map → CliViewerPage-Bsp1zmfD.js.map} +1 -1
- package/ccw/frontend/dist/assets/{CodexLensManagerPage-ClPNashJ.js → CodexLensManagerPage-DUMzbrr9.js} +9 -9
- package/ccw/frontend/dist/assets/CodexLensManagerPage-DUMzbrr9.js.map +1 -0
- package/ccw/frontend/dist/assets/{Collapsible-Dladh9Eu.js → Collapsible-I5pixbHb.js} +2 -2
- package/ccw/frontend/dist/assets/{Collapsible-Dladh9Eu.js.map → Collapsible-I5pixbHb.js.map} +1 -1
- package/ccw/frontend/dist/assets/{CommandsManagerPage-B6DBb_Ew.js → CommandsManagerPage-BH2xukdx.js} +2 -2
- package/ccw/frontend/dist/assets/{CommandsManagerPage-B6DBb_Ew.js.map → CommandsManagerPage-BH2xukdx.js.map} +1 -1
- package/ccw/frontend/dist/assets/{DeepWikiPage-CDA3xm3R.js → DeepWikiPage-D41ccWzY.js} +2 -2
- package/ccw/frontend/dist/assets/{DeepWikiPage-CDA3xm3R.js.map → DeepWikiPage-D41ccWzY.js.map} +1 -1
- package/ccw/frontend/dist/assets/{EndpointsPage-Bu7iU0Wy.js → EndpointsPage-5a8jfEWN.js} +2 -2
- package/ccw/frontend/dist/assets/{EndpointsPage-Bu7iU0Wy.js.map → EndpointsPage-5a8jfEWN.js.map} +1 -1
- package/ccw/frontend/dist/assets/{ExplorerPage-xim2cboZ.js → ExplorerPage-YCqIOu1v.js} +2 -2
- package/ccw/frontend/dist/assets/{ExplorerPage-xim2cboZ.js.map → ExplorerPage-YCqIOu1v.js.map} +1 -1
- package/ccw/frontend/dist/assets/{FixSessionPage-BTFYoFQF.js → FixSessionPage-wK1s4kbo.js} +2 -2
- package/ccw/frontend/dist/assets/{FixSessionPage-BTFYoFQF.js.map → FixSessionPage-wK1s4kbo.js.map} +1 -1
- package/ccw/frontend/dist/assets/{FloatingFileBrowser-B30ANzTJ.js → FloatingFileBrowser-B1U6uk_5.js} +2 -2
- package/ccw/frontend/dist/assets/{FloatingFileBrowser-B30ANzTJ.js.map → FloatingFileBrowser-B1U6uk_5.js.map} +1 -1
- package/ccw/frontend/dist/assets/{FloatingPanel-Ds84B7Ob.js → FloatingPanel-D51p5jNy.js} +2 -2
- package/ccw/frontend/dist/assets/{FloatingPanel-Ds84B7Ob.js.map → FloatingPanel-D51p5jNy.js.map} +1 -1
- package/ccw/frontend/dist/assets/{GraphExplorerPage-DJ4YnFOQ.js → GraphExplorerPage-DpIWrpWH.js} +2 -2
- package/ccw/frontend/dist/assets/{GraphExplorerPage-DJ4YnFOQ.js.map → GraphExplorerPage-DpIWrpWH.js.map} +1 -1
- package/ccw/frontend/dist/assets/{HistoryPage-rzLVsw11.js → HistoryPage-C09lyJGN.js} +2 -2
- package/ccw/frontend/dist/assets/{HistoryPage-rzLVsw11.js.map → HistoryPage-C09lyJGN.js.map} +1 -1
- package/ccw/frontend/dist/assets/{HookManagerPage-DizO_dCP.js → HookManagerPage-CFBe8F_G.js} +2 -2
- package/ccw/frontend/dist/assets/{HookManagerPage-DizO_dCP.js.map → HookManagerPage-CFBe8F_G.js.map} +1 -1
- package/ccw/frontend/dist/assets/{InstallationsPage-BFamuE4y.js → InstallationsPage-qt7NxnsB.js} +2 -2
- package/ccw/frontend/dist/assets/{InstallationsPage-BFamuE4y.js.map → InstallationsPage-qt7NxnsB.js.map} +1 -1
- package/ccw/frontend/dist/assets/{IssueHubPage-DHwQWuUc.js → IssueHubPage-CHol1-Ap.js} +2 -2
- package/ccw/frontend/dist/assets/{IssueHubPage-DHwQWuUc.js.map → IssueHubPage-CHol1-Ap.js.map} +1 -1
- package/ccw/frontend/dist/assets/{LiteTasksPage-DMDkG7pi.js → LiteTasksPage-jH00SLnZ.js} +2 -2
- package/ccw/frontend/dist/assets/{LiteTasksPage-DMDkG7pi.js.map → LiteTasksPage-jH00SLnZ.js.map} +1 -1
- package/ccw/frontend/dist/assets/{McpManagerPage-CS2v_1OG.js → McpManagerPage-BS-HgeQJ.js} +11 -11
- package/ccw/frontend/dist/assets/McpManagerPage-BS-HgeQJ.js.map +1 -0
- package/ccw/frontend/dist/assets/{MemoryPage-DhYPE-VC.js → MemoryPage-1UahrmRX.js} +2 -2
- package/ccw/frontend/dist/assets/{MemoryPage-DhYPE-VC.js.map → MemoryPage-1UahrmRX.js.map} +1 -1
- package/ccw/frontend/dist/assets/{NotFoundPage-BLmC7-ot.js → NotFoundPage-5FVm_IkS.js} +2 -2
- package/ccw/frontend/dist/assets/{NotFoundPage-BLmC7-ot.js.map → NotFoundPage-5FVm_IkS.js.map} +1 -1
- package/ccw/frontend/dist/assets/{OrchestratorPage-1jzSUFZW.js → OrchestratorPage-ThBG24Gg.js} +2 -2
- package/ccw/frontend/dist/assets/{OrchestratorPage-1jzSUFZW.js.map → OrchestratorPage-ThBG24Gg.js.map} +1 -1
- package/ccw/frontend/dist/assets/{ProjectOverviewPage-gWuAj-Cn.js → ProjectOverviewPage-CrmW0IxI.js} +2 -2
- package/ccw/frontend/dist/assets/{ProjectOverviewPage-gWuAj-Cn.js.map → ProjectOverviewPage-CrmW0IxI.js.map} +1 -1
- package/ccw/frontend/dist/assets/{PromptHistoryPage-q7ySVNHM.js → PromptHistoryPage-1cCGwS3s.js} +2 -2
- package/ccw/frontend/dist/assets/{PromptHistoryPage-q7ySVNHM.js.map → PromptHistoryPage-1cCGwS3s.js.map} +1 -1
- package/ccw/frontend/dist/assets/{ReviewSessionPage-DX1uT_nH.js → ReviewSessionPage-DxiEc9HK.js} +2 -2
- package/ccw/frontend/dist/assets/{ReviewSessionPage-DX1uT_nH.js.map → ReviewSessionPage-DxiEc9HK.js.map} +1 -1
- package/ccw/frontend/dist/assets/{RulesManagerPage-Bg6T5W-W.js → RulesManagerPage-BpplliZF.js} +2 -2
- package/ccw/frontend/dist/assets/{RulesManagerPage-Bg6T5W-W.js.map → RulesManagerPage-BpplliZF.js.map} +1 -1
- package/ccw/frontend/dist/assets/{SessionDetailPage-C_ig6JSh.js → SessionDetailPage-crDIiysh.js} +2 -2
- package/ccw/frontend/dist/assets/{SessionDetailPage-C_ig6JSh.js.map → SessionDetailPage-crDIiysh.js.map} +1 -1
- package/ccw/frontend/dist/assets/{SessionsPage-BENFqFDn.js → SessionsPage-DThweYY8.js} +2 -2
- package/ccw/frontend/dist/assets/{SessionsPage-BENFqFDn.js.map → SessionsPage-DThweYY8.js.map} +1 -1
- package/ccw/frontend/dist/assets/{SettingsPage-2c-oTxfz.js → SettingsPage-OCdOz5-z.js} +4 -4
- package/ccw/frontend/dist/assets/{SettingsPage-2c-oTxfz.js.map → SettingsPage-OCdOz5-z.js.map} +1 -1
- package/ccw/frontend/dist/assets/{SkillsManagerPage-GLo6DXnt.js → SkillsManagerPage-BJd3bK1G.js} +2 -2
- package/ccw/frontend/dist/assets/{SkillsManagerPage-GLo6DXnt.js.map → SkillsManagerPage-BJd3bK1G.js.map} +1 -1
- package/ccw/frontend/dist/assets/{SpecsSettingsPage-CRqMV90p.js → SpecsSettingsPage-BAWL2cpO.js} +2 -2
- package/ccw/frontend/dist/assets/{SpecsSettingsPage-CRqMV90p.js.map → SpecsSettingsPage-BAWL2cpO.js.map} +1 -1
- package/ccw/frontend/dist/assets/{Switch-vlMavMRD.js → Switch-w0I3JCcC.js} +2 -2
- package/ccw/frontend/dist/assets/{Switch-vlMavMRD.js.map → Switch-w0I3JCcC.js.map} +1 -1
- package/ccw/frontend/dist/assets/{TabsNavigation-CLKz7pWP.js → TabsNavigation-jhUge9YV.js} +2 -2
- package/ccw/frontend/dist/assets/{TabsNavigation-CLKz7pWP.js.map → TabsNavigation-jhUge9YV.js.map} +1 -1
- package/ccw/frontend/dist/assets/{TaskDrawer-BAFvNqF8.js → TaskDrawer-APWpZulm.js} +2 -2
- package/ccw/frontend/dist/assets/{TaskDrawer-BAFvNqF8.js.map → TaskDrawer-APWpZulm.js.map} +1 -1
- package/ccw/frontend/dist/assets/{TeamPage-C2IsDkAv.js → TeamPage-8OnLsAfJ.js} +2 -2
- package/ccw/frontend/dist/assets/{TeamPage-C2IsDkAv.js.map → TeamPage-8OnLsAfJ.js.map} +1 -1
- package/ccw/frontend/dist/assets/{TerminalDashboardPage-mgS-iKDm.js → TerminalDashboardPage-Be1hcN4p.js} +2 -2
- package/ccw/frontend/dist/assets/{TerminalDashboardPage-mgS-iKDm.js.map → TerminalDashboardPage-Be1hcN4p.js.map} +1 -1
- package/ccw/frontend/dist/assets/{archive-CxxK_YIp.js → archive-Bo1tC9yo.js} +2 -2
- package/ccw/frontend/dist/assets/{archive-CxxK_YIp.js.map → archive-Bo1tC9yo.js.map} +1 -1
- package/ccw/frontend/dist/assets/{archive-restore-DZsrBaeG.js → archive-restore-DYx41yLJ.js} +2 -2
- package/ccw/frontend/dist/assets/{archive-restore-DZsrBaeG.js.map → archive-restore-DYx41yLJ.js.map} +1 -1
- package/ccw/frontend/dist/assets/{arrow-right-BotRHOhr.js → arrow-right-C6pOqWF1.js} +2 -2
- package/ccw/frontend/dist/assets/{arrow-right-BotRHOhr.js.map → arrow-right-C6pOqWF1.js.map} +1 -1
- package/ccw/frontend/dist/assets/{bookmark-plus-C0MWZ3S9.js → bookmark-plus-4Qpa6hMJ.js} +2 -2
- package/ccw/frontend/dist/assets/{bookmark-plus-C0MWZ3S9.js.map → bookmark-plus-4Qpa6hMJ.js.map} +1 -1
- package/ccw/frontend/dist/assets/{bot-BcHFJXqD.js → bot-HXJTmx8r.js} +2 -2
- package/ccw/frontend/dist/assets/{bot-BcHFJXqD.js.map → bot-HXJTmx8r.js.map} +1 -1
- package/ccw/frontend/dist/assets/{braces-D_p0IZhP.js → braces-Dj2IdY7I.js} +2 -2
- package/ccw/frontend/dist/assets/{braces-D_p0IZhP.js.map → braces-Dj2IdY7I.js.map} +1 -1
- package/ccw/frontend/dist/assets/{circle-stop-Bt634NUt.js → circle-stop-M29TJKHc.js} +2 -2
- package/ccw/frontend/dist/assets/{circle-stop-Bt634NUt.js.map → circle-stop-M29TJKHc.js.map} +1 -1
- package/ccw/frontend/dist/assets/{cpu-DjeGKtvT.js → cpu-DX15mzMT.js} +2 -2
- package/ccw/frontend/dist/assets/{cpu-DjeGKtvT.js.map → cpu-DX15mzMT.js.map} +1 -1
- package/ccw/frontend/dist/assets/{ellipsis-vertical-BmNPuatq.js → ellipsis-vertical-Fs6bysWx.js} +2 -2
- package/ccw/frontend/dist/assets/{ellipsis-vertical-BmNPuatq.js.map → ellipsis-vertical-Fs6bysWx.js.map} +1 -1
- package/ccw/frontend/dist/assets/{eye-B0-xkP67.js → eye-D6BRlJ1r.js} +2 -2
- package/ccw/frontend/dist/assets/{eye-B0-xkP67.js.map → eye-D6BRlJ1r.js.map} +1 -1
- package/ccw/frontend/dist/assets/{eye-off-Bz0Fkli3.js → eye-off-DjbIj5iN.js} +2 -2
- package/ccw/frontend/dist/assets/{eye-off-Bz0Fkli3.js.map → eye-off-DjbIj5iN.js.map} +1 -1
- package/ccw/frontend/dist/assets/{file-json-PUAS4vBm.js → file-json-kg4Lid-H.js} +2 -2
- package/ccw/frontend/dist/assets/{file-json-PUAS4vBm.js.map → file-json-kg4Lid-H.js.map} +1 -1
- package/ccw/frontend/dist/assets/{file-text-BMeW5-Sb.js → file-text-BMy5pXNV.js} +2 -2
- package/ccw/frontend/dist/assets/{file-text-BMeW5-Sb.js.map → file-text-BMy5pXNV.js.map} +1 -1
- package/ccw/frontend/dist/assets/{filter-B4wgMvwi.js → filter-BTN-lUUb.js} +2 -2
- package/ccw/frontend/dist/assets/{filter-B4wgMvwi.js.map → filter-BTN-lUUb.js.map} +1 -1
- package/ccw/frontend/dist/assets/{folder-BSHjjjND.js → folder-ChYtty7V.js} +2 -2
- package/ccw/frontend/dist/assets/{folder-BSHjjjND.js.map → folder-ChYtty7V.js.map} +1 -1
- package/ccw/frontend/dist/assets/{gauge-7VRNEl22.js → gauge-C0VJbjRb.js} +2 -2
- package/ccw/frontend/dist/assets/{gauge-7VRNEl22.js.map → gauge-C0VJbjRb.js.map} +1 -1
- package/ccw/frontend/dist/assets/{globe-PvVHBjbW.js → globe-DbNfDXnv.js} +2 -2
- package/ccw/frontend/dist/assets/{globe-PvVHBjbW.js.map → globe-DbNfDXnv.js.map} +1 -1
- package/ccw/frontend/dist/assets/{grid-3x3-CsmmDlhN.js → grid-3x3-xWcpBNxo.js} +2 -2
- package/ccw/frontend/dist/assets/{grid-3x3-CsmmDlhN.js.map → grid-3x3-xWcpBNxo.js.map} +1 -1
- package/ccw/frontend/dist/assets/{hard-drive-D88EZgTY.js → hard-drive-BTACzgUO.js} +2 -2
- package/ccw/frontend/dist/assets/{hard-drive-D88EZgTY.js.map → hard-drive-BTACzgUO.js.map} +1 -1
- package/ccw/frontend/dist/assets/{hash-CZpNRWqt.js → hash-B0dYlmyB.js} +2 -2
- package/ccw/frontend/dist/assets/{hash-CZpNRWqt.js.map → hash-B0dYlmyB.js.map} +1 -1
- package/ccw/frontend/dist/assets/{history-DxN1mopa.js → history-CRRLu6ck.js} +2 -2
- package/ccw/frontend/dist/assets/{history-DxN1mopa.js.map → history-CRRLu6ck.js.map} +1 -1
- package/ccw/frontend/dist/assets/{index-BzGEkwIf.js → index-BJIIo0B3.js} +2 -2
- package/ccw/frontend/dist/assets/{index-BzGEkwIf.js.map → index-BJIIo0B3.js.map} +1 -1
- package/ccw/frontend/dist/assets/{index-DlcRFzFq.js → index-BP-D3Wv6.js} +2 -2
- package/ccw/frontend/dist/assets/{index-DlcRFzFq.js.map → index-BP-D3Wv6.js.map} +1 -1
- package/ccw/frontend/dist/assets/{index-BUiq2PUK.js → index-B_QzEioU.js} +2 -2
- package/ccw/frontend/dist/assets/{index-BUiq2PUK.js.map → index-B_QzEioU.js.map} +1 -1
- package/ccw/frontend/dist/assets/{index-C04xeBGC.js → index-BpoRYgiq.js} +3 -3
- package/ccw/frontend/dist/assets/{index-C04xeBGC.js.map → index-BpoRYgiq.js.map} +1 -1
- package/ccw/frontend/dist/assets/{index-CIoWWkDn.js → index-CeESlrZb.js} +8 -8
- package/ccw/frontend/dist/assets/{index-CIoWWkDn.js.map → index-CeESlrZb.js.map} +1 -1
- package/ccw/frontend/dist/assets/{index-bSgtHHOF.js → index-DzTbMyaS.js} +4 -4
- package/ccw/frontend/dist/assets/{index-bSgtHHOF.js.map → index-DzTbMyaS.js.map} +1 -1
- package/ccw/frontend/dist/assets/{layout-grid-BZqfuNG0.js → layout-grid-ZN26YcTM.js} +2 -2
- package/ccw/frontend/dist/assets/{layout-grid-BZqfuNG0.js.map → layout-grid-ZN26YcTM.js.map} +1 -1
- package/ccw/frontend/dist/assets/{lightbulb-DqJ4OHRL.js → lightbulb-BHrwx9j6.js} +2 -2
- package/ccw/frontend/dist/assets/{lightbulb-DqJ4OHRL.js.map → lightbulb-BHrwx9j6.js.map} +1 -1
- package/ccw/frontend/dist/assets/{link-2-Bq7fLkC9.js → link-2-zZRu2j4G.js} +2 -2
- package/ccw/frontend/dist/assets/{link-2-Bq7fLkC9.js.map → link-2-zZRu2j4G.js.map} +1 -1
- package/ccw/frontend/dist/assets/{link-dSLYjCIG.js → link-8lz-HgnZ.js} +2 -2
- package/ccw/frontend/dist/assets/{link-dSLYjCIG.js.map → link-8lz-HgnZ.js.map} +1 -1
- package/ccw/frontend/dist/assets/{list-Bm_CnR56.js → list-DlablIjt.js} +2 -2
- package/ccw/frontend/dist/assets/{list-Bm_CnR56.js.map → list-DlablIjt.js.map} +1 -1
- package/ccw/frontend/dist/assets/{map-pin-B5TELa0z.js → map-pin-JAsCUplr.js} +2 -2
- package/ccw/frontend/dist/assets/{map-pin-B5TELa0z.js.map → map-pin-JAsCUplr.js.map} +1 -1
- package/ccw/frontend/dist/assets/{messages-square-B9sWItdK.js → messages-square-D0iSFb2Y.js} +2 -2
- package/ccw/frontend/dist/assets/{messages-square-B9sWItdK.js.map → messages-square-D0iSFb2Y.js.map} +1 -1
- package/ccw/frontend/dist/assets/{minimize-2-Z1MYs_Tp.js → minimize-2-BJmkU9CE.js} +2 -2
- package/ccw/frontend/dist/assets/{minimize-2-Z1MYs_Tp.js.map → minimize-2-BJmkU9CE.js.map} +1 -1
- package/ccw/frontend/dist/assets/{package-EEv4N_Qk.js → package-DYrbBCxk.js} +2 -2
- package/ccw/frontend/dist/assets/{package-EEv4N_Qk.js.map → package-DYrbBCxk.js.map} +1 -1
- package/ccw/frontend/dist/assets/{plug-CEkvvYXh.js → plug-VG7-23M-.js} +2 -2
- package/ccw/frontend/dist/assets/{plug-CEkvvYXh.js.map → plug-VG7-23M-.js.map} +1 -1
- package/ccw/frontend/dist/assets/{power-B6Rod0u_.js → power-zPFYNx7u.js} +2 -2
- package/ccw/frontend/dist/assets/{power-B6Rod0u_.js.map → power-zPFYNx7u.js.map} +1 -1
- package/ccw/frontend/dist/assets/{save-DULWrB2g.js → save-D4XQY9i9.js} +2 -2
- package/ccw/frontend/dist/assets/{save-DULWrB2g.js.map → save-D4XQY9i9.js.map} +1 -1
- package/ccw/frontend/dist/assets/{send-C4z974WG.js → send-ClSnDjj-.js} +2 -2
- package/ccw/frontend/dist/assets/{send-C4z974WG.js.map → send-ClSnDjj-.js.map} +1 -1
- package/ccw/frontend/dist/assets/{square-check-big-CqEEw-V0.js → square-check-big-Bffh_MFc.js} +2 -2
- package/ccw/frontend/dist/assets/{square-check-big-CqEEw-V0.js.map → square-check-big-Bffh_MFc.js.map} +1 -1
- package/ccw/frontend/dist/assets/{square-pen-D-4BrMtQ.js → square-pen-DsOvAvME.js} +2 -2
- package/ccw/frontend/dist/assets/{square-pen-D-4BrMtQ.js.map → square-pen-DsOvAvME.js.map} +1 -1
- package/ccw/frontend/dist/assets/{star-CDVVM69o.js → star-TLJjvoy2.js} +2 -2
- package/ccw/frontend/dist/assets/{star-CDVVM69o.js.map → star-TLJjvoy2.js.map} +1 -1
- package/ccw/frontend/dist/assets/{style-CumJ7XC8.js → style-BXKXgpOY.js} +2 -2
- package/ccw/frontend/dist/assets/{style-CumJ7XC8.js.map → style-BXKXgpOY.js.map} +1 -1
- package/ccw/frontend/dist/assets/{target-Dr9SuV1Y.js → target-FDuAB6SF.js} +2 -2
- package/ccw/frontend/dist/assets/{target-Dr9SuV1Y.js.map → target-FDuAB6SF.js.map} +1 -1
- package/ccw/frontend/dist/assets/{test-tube-DzDRKk8F.js → test-tube-B9vj-Im8.js} +2 -2
- package/ccw/frontend/dist/assets/{test-tube-DzDRKk8F.js.map → test-tube-B9vj-Im8.js.map} +1 -1
- package/ccw/frontend/dist/assets/{upload-CihSmIM7.js → upload-CHgTrVN5.js} +2 -2
- package/ccw/frontend/dist/assets/{upload-CihSmIM7.js.map → upload-CHgTrVN5.js.map} +1 -1
- package/ccw/frontend/dist/assets/{useApiSettings-CevxWX2z.js → useApiSettings-XsHrqf-L.js} +2 -2
- package/ccw/frontend/dist/assets/{useApiSettings-CevxWX2z.js.map → useApiSettings-XsHrqf-L.js.map} +1 -1
- package/ccw/frontend/dist/assets/{useCli-jVaF89uU.js → useCli-DOlWtux5.js} +2 -2
- package/ccw/frontend/dist/assets/{useCli-jVaF89uU.js.map → useCli-DOlWtux5.js.map} +1 -1
- package/ccw/frontend/dist/assets/{useCommands-D4uGmNpF.js → useCommands-DazCajiX.js} +2 -2
- package/ccw/frontend/dist/assets/{useCommands-D4uGmNpF.js.map → useCommands-DazCajiX.js.map} +1 -1
- package/ccw/frontend/dist/assets/{useDebounce-BEYmuZYP.js → useDebounce-Cah-bua6.js} +2 -2
- package/ccw/frontend/dist/assets/{useDebounce-BEYmuZYP.js.map → useDebounce-Cah-bua6.js.map} +1 -1
- package/ccw/frontend/dist/assets/{useFileExplorer-DEv0DVy7.js → useFileExplorer-B9SCPhhl.js} +2 -2
- package/ccw/frontend/dist/assets/{useFileExplorer-DEv0DVy7.js.map → useFileExplorer-B9SCPhhl.js.map} +1 -1
- package/ccw/frontend/dist/assets/{useLocale-BRJreqvl.js → useLocale-CmG6pxZe.js} +2 -2
- package/ccw/frontend/dist/assets/{useLocale-BRJreqvl.js.map → useLocale-CmG6pxZe.js.map} +1 -1
- package/ccw/frontend/dist/assets/{useSkills-lnfeXe9l.js → useSkills-DvEJ0JOv.js} +3 -3
- package/ccw/frontend/dist/assets/{useSkills-lnfeXe9l.js.map → useSkills-DvEJ0JOv.js.map} +1 -1
- package/ccw/frontend/dist/assets/{useSystemSettings-PlxVdbXI.js → useSystemSettings-BDpwSa04.js} +2 -2
- package/ccw/frontend/dist/assets/{useSystemSettings-PlxVdbXI.js.map → useSystemSettings-BDpwSa04.js.map} +1 -1
- package/ccw/frontend/dist/assets/{wand-sparkles-BbqUxeEg.js → wand-sparkles-T2KGCRiy.js} +2 -2
- package/ccw/frontend/dist/assets/{wand-sparkles-BbqUxeEg.js.map → wand-sparkles-T2KGCRiy.js.map} +1 -1
- package/ccw/frontend/dist/index.html +1 -1
- package/codex-lens/src/codexlens/cli/commands.py +12 -1
- package/codex-lens/src/codexlens/config.py +12 -0
- package/codex-lens/src/codexlens/env_config.py +1 -0
- package/package.json +1 -1
- package/ccw/frontend/dist/assets/CodexLensManagerPage-ClPNashJ.js.map +0 -1
- package/ccw/frontend/dist/assets/McpManagerPage-CS2v_1OG.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SessionsPage-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SessionsPage-DThweYY8.js","assets/file-text-BMy5pXNV.js","assets/test-tube-B9vj-Im8.js","assets/ellipsis-vertical-Fs6bysWx.js","assets/eye-D6BRlJ1r.js","assets/archive-Bo1tC9yo.js","assets/TabsNavigation-jhUge9YV.js","assets/minimize-2-BJmkU9CE.js","assets/filter-BTN-lUUb.js","assets/ProjectOverviewPage-CrmW0IxI.js","assets/layout-grid-ZN26YcTM.js","assets/square-pen-DsOvAvME.js","assets/save-D4XQY9i9.js","assets/square-check-big-Bffh_MFc.js","assets/lightbulb-BHrwx9j6.js","assets/SessionDetailPage-crDIiysh.js","assets/Collapsible-I5pixbHb.js","assets/TaskDrawer-APWpZulm.js","assets/link-8lz-HgnZ.js","assets/index-BP-D3Wv6.js","assets/folder-ChYtty7V.js","assets/style-BZV40eAE.css","assets/package-DYrbBCxk.js","assets/HistoryPage-C09lyJGN.js","assets/messages-square-D0iSFb2Y.js","assets/file-json-kg4Lid-H.js","assets/hash-B0dYlmyB.js","assets/cpu-DX15mzMT.js","assets/bot-HXJTmx8r.js","assets/OrchestratorPage-ThBG24Gg.js","assets/link-2-zZRu2j4G.js","assets/useCommands-DazCajiX.js","assets/errorSanitizer-IY9pf5g4.js","assets/useSkills-DvEJ0JOv.js","assets/bookmark-plus-4Qpa6hMJ.js","assets/grid-3x3-xWcpBNxo.js","assets/list-DlablIjt.js","assets/upload-CHgTrVN5.js","assets/IssueHubPage-CHol1-Ap.js","assets/history-CRRLu6ck.js","assets/arrow-right-C6pOqWF1.js","assets/AlertDialog-CSZq4WHZ.js","assets/map-pin-JAsCUplr.js","assets/target-FDuAB6SF.js","assets/SkillsManagerPage-BJd3bK1G.js","assets/power-zPFYNx7u.js","assets/CliModeToggle-fF9xHeGR.js","assets/FloatingFileBrowser-B1U6uk_5.js","assets/FloatingPanel-D51p5jNy.js","assets/useFileExplorer-B9SCPhhl.js","assets/eye-off-DjbIj5iN.js","assets/globe-DbNfDXnv.js","assets/Switch-w0I3JCcC.js","assets/CommandsManagerPage-BH2xukdx.js","assets/MemoryPage-1UahrmRX.js","assets/formatDistanceToNow-DXTjigy3.js","assets/index-B_QzEioU.js","assets/star-TLJjvoy2.js","assets/archive-restore-DYx41yLJ.js","assets/MemoryPage-BEHUn5zE.css","assets/SettingsPage-OCdOz5-z.js","assets/useSystemSettings-BDpwSa04.js","assets/useLocale-CmG6pxZe.js","assets/send-ClSnDjj-.js","assets/useDebounce-Cah-bua6.js","assets/LiteTasksPage-jH00SLnZ.js","assets/ReviewSessionPage-DxiEc9HK.js","assets/McpManagerPage-BS-HgeQJ.js","assets/hard-drive-BTACzgUO.js","assets/EndpointsPage-5a8jfEWN.js","assets/useCli-DOlWtux5.js","assets/plug-VG7-23M-.js","assets/InstallationsPage-qt7NxnsB.js","assets/HookManagerPage-CFBe8F_G.js","assets/circle-stop-M29TJKHc.js","assets/wand-sparkles-T2KGCRiy.js","assets/RulesManagerPage-BpplliZF.js","assets/PromptHistoryPage-1cCGwS3s.js","assets/ExplorerPage-YCqIOu1v.js","assets/GraphExplorerPage-DpIWrpWH.js","assets/braces-Dj2IdY7I.js","assets/CodexLensManagerPage-DUMzbrr9.js","assets/ApiSettingsPage-D69j8mI6.js","assets/useApiSettings-XsHrqf-L.js","assets/CliViewerPage-Bsp1zmfD.js","assets/style-BXKXgpOY.js","assets/style-CroWzXsC.css","assets/index-BJIIo0B3.js","assets/TeamPage-8OnLsAfJ.js","assets/TerminalDashboardPage-Be1hcN4p.js","assets/gauge-C0VJbjRb.js","assets/AnalysisPage-DVDvLHqI.js","assets/SpecsSettingsPage-BAWL2cpO.js","assets/DeepWikiPage-D41ccWzY.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
var TQ=Object.defineProperty;var aN=e=>{throw TypeError(e)};var PQ=(e,t,r)=>t in e?TQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var _o=(e,t,r)=>PQ(e,typeof t!="symbol"?t+"":t,r),Px=(e,t,r)=>t.has(e)||aN("Cannot "+r);var re=(e,t,r)=>(Px(e,t,"read from private field"),r?r.call(e):t.get(e)),tt=(e,t,r)=>t.has(e)?aN("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),De=(e,t,r,n)=>(Px(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),_t=(e,t,r)=>(Px(e,t,"access private method"),r);var Ng=(e,t,r,n)=>({set _(i){De(e,t,i,r)},get _(){return re(e,t,n)}});function S6(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in e)){const o=Object.getOwnPropertyDescriptor(n,i);o&&Object.defineProperty(e,i,o.get?o:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function r(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(i){if(i.ep)return;i.ep=!0;const o=r(i);fetch(i.href,o)}})();var Mg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Kt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ax={exports:{}},Zf={},Ox={exports:{}},Ct={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react.production.min.js
|
|
@@ -519,7 +519,7 @@ For more details see https://formatjs.io/docs/getting-started/message-distributi
|
|
|
519
519
|
[zustand devtools middleware] Unsupported __setState action format.
|
|
520
520
|
When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),
|
|
521
521
|
and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }
|
|
522
|
-
`);const b=v.state[a];if(b==null)return;JSON.stringify(i.getState())!==JSON.stringify(b)&&g(b);return}AM(i)&&i.dispatch(v)});case"DISPATCH":switch(y.payload.type){case"RESET":return g(_),a===void 0?d==null?void 0:d.init(i.getState()):d==null?void 0:d.init(Ug(l.name));case"COMMIT":if(a===void 0){d==null||d.init(i.getState());return}return d==null?void 0:d.init(Ug(l.name));case"ROLLBACK":return Kx(y.state,v=>{if(a===void 0){g(v),d==null||d.init(i.getState());return}g(v[a]),d==null||d.init(Ug(l.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return Kx(y.state,v=>{if(a===void 0){g(v);return}JSON.stringify(i.getState())!==JSON.stringify(v[a])&&g(v[a])});case"IMPORT_STATE":{const{nextLiftedState:v}=y.payload,b=(m=v.computedStates.slice(-1)[0])==null?void 0:m.state;if(!b)return;g(a===void 0?b:b[a]),d==null||d.send(null,v);return}case"PAUSE_RECORDING":return p=!p}return}}),_},En=Wne,Kx=(e,t)=>{let r;try{r=JSON.parse(e)}catch(n){console.error("[zustand devtools middleware] Could not parse the received json",n)}r!==void 0&&t(r)};function Vne(e,t){let r;try{r=e()}catch{return}return{getItem:i=>{var o;const s=l=>l===null?null:JSON.parse(l,void 0),a=(o=r.getItem(i))!=null?o:null;return a instanceof Promise?a.then(s):s(a)},setItem:(i,o)=>r.setItem(i,JSON.stringify(o,void 0)),removeItem:i=>r.removeItem(i)}}const _k=e=>t=>{try{const r=e(t);return r instanceof Promise?r:{then(n){return _k(n)(r)},catch(n){return this}}}catch(r){return{then(n){return this},catch(n){return _k(n)(r)}}}},Gne=(e,t)=>(r,n,i)=>{let o={storage:Vne(()=>window.localStorage),partialize:m=>m,version:0,merge:(m,v)=>({...v,...m}),...t},s=!1,a=0;const l=new Set,c=new Set;let d=o.storage;if(!d)return e((...m)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),r(...m)},n,i);const u=()=>{const m=o.partialize({...n()});return d.setItem(o.name,{state:m,version:o.version})},p=i.setState;i.setState=(m,v)=>(p(m,v),u());const g=e((...m)=>(r(...m),u()),n,i);i.getInitialState=()=>g;let _;const y=()=>{var m,v;if(!d)return;const b=++a;s=!1,l.forEach(E=>{var C;return E((C=n())!=null?C:g)});const x=((v=o.onRehydrateStorage)==null?void 0:v.call(o,(m=n())!=null?m:g))||void 0;return _k(d.getItem.bind(d))(o.name).then(E=>{if(E)if(typeof E.version=="number"&&E.version!==o.version){if(o.migrate){const C=o.migrate(E.state,E.version);return C instanceof Promise?C.then(k=>[!0,k]):[!0,C]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,E.state];return[!1,void 0]}).then(E=>{var C;if(b!==a)return;const[k,P]=E;if(_=o.merge(P,(C=n())!=null?C:g),r(_,!0),k)return u()}).then(()=>{b===a&&(x==null||x(_,void 0),_=n(),s=!0,c.forEach(E=>E(_)))}).catch(E=>{b===a&&(x==null||x(void 0,E))})};return i.persist={setOptions:m=>{o={...o,...m},m.storage&&(d=m.storage)},clearStorage:()=>{d==null||d.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>y(),hasHydrated:()=>s,onHydrate:m=>(l.add(m),()=>{l.delete(m)}),onFinishHydration:m=>(c.add(m),()=>{c.delete(m)})},o.skipHydration||y(),_||g},im=Gne,Na={WORKFLOW_TASK:"workflow-task",RECENT_SESSIONS:"recent-sessions"},Kne=[{i:Na.WORKFLOW_TASK,name:"Workflow & Tasks",visible:!0,minW:6,minH:4},{i:Na.RECENT_SESSIONS,name:"Recent Sessions",visible:!0,minW:6,minH:3}],Xne={lg:[{i:Na.WORKFLOW_TASK,x:0,y:0,w:12,h:5,minW:6,minH:4},{i:Na.RECENT_SESSIONS,x:0,y:5,w:12,h:4,minW:6,minH:3}],md:[{i:Na.WORKFLOW_TASK,x:0,y:0,w:6,h:5,minW:4,minH:4},{i:Na.RECENT_SESSIONS,x:0,y:5,w:6,h:4,minW:4,minH:3}],sm:[{i:Na.WORKFLOW_TASK,x:0,y:0,w:2,h:8,minW:2,minH:6},{i:Na.RECENT_SESSIONS,x:0,y:8,w:2,h:5,minW:2,minH:4}]},Xx={widgets:Kne,layouts:Xne},Zne=(e,t,r)=>{const n=e[t];return n?typeof n=="function"?n():Promise.resolve(n):new Promise((i,o)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(o.bind(null,new Error("Unknown variable dynamic import: "+t+(t.split("/").length!==r?". Note that variables only represent file names one level deep.":""))))})},qze={en:"English",zh:"中文"};function Qne(){if(typeof window>"u")return"zh";const e=navigator.language.toLowerCase();return e.startsWith("zh")?"zh":e.startsWith("en")?"en":"zh"}function Hv(){var e;if(typeof window>"u")return"zh";try{const t=localStorage.getItem("ccw-app-store");if(t){const r=JSON.parse(t);if((e=r.state)!=null&&e.locale&&(r.state.locale==="en"||r.state.locale==="zh"))return r.state.locale}}catch{}return Qne()}async function Yne(e){try{return(await Zne(Object.assign({"../locales/en/index.ts":()=>Lt(()=>import("./index-CIoWWkDn.js"),[]),"../locales/zh/index.ts":()=>Lt(()=>import("./index-C04xeBGC.js"),[])}),`../locales/${e}/index.ts`,4)).default||{}}catch(t){return console.error(`Failed to load messages for locale "${e}":`,t),{}}}const nA={en:{},zh:{}};async function Jne(e){const t=await Yne(e);return nA[e]=t,xk(e),t}const Kz=KP();let Xz=ZP({locale:Hv(),messages:nA[Hv()]},Kz);function xk(e){Xz=ZP({locale:e,messages:nA[e]},Kz),typeof document<"u"&&(document.documentElement.lang=e)}function Wze(e,t){return Xz.formatMessage({id:e},t)}const Zz=[{id:"blue",name:"经典蓝",accentColor:"#5b8fc4",description:"Classic professional blue tone"},{id:"green",name:"深邃绿",accentColor:"#10b981",description:"Deep natural green tone"},{id:"orange",name:"活力橙",accentColor:"#f97316",description:"Vibrant energetic orange tone"},{id:"purple",name:"优雅紫",accentColor:"#a855f7",description:"Elegant creative purple tone"}],Qz=[{id:"light",name:"浅色"},{id:"dark",name:"深色"}];function Yz(e,t){return`${t}-${e}`}function eie(e,t){const r=Zz.find(i=>i.id===e),n=Qz.find(i=>i.id===t);return!r||!n?"Unknown Theme":`${r.name} · ${n.name}`}Zz.flatMap(e=>Qz.map(t=>({id:Yz(e.id,t.id),scheme:e.id,mode:t.id,name:eie(e.id,t.id)})));const Jz={blur:0,darkenOpacity:0,saturation:100,enableFrostedGlass:!1,enableGrain:!1,enableVignette:!1},Go={mode:"gradient-only",imageUrl:null,attribution:null,effects:Jz},wk=3,tie={id:"default",name:"Default",colorScheme:"blue",customHue:null,isCustomTheme:!1,gradientLevel:"standard",enableHoverGlow:!0,enableBackgroundAnimation:!1,styleTier:"standard",isDefault:!0},rie={soft:{saturationScale:.6,lightnessOffset:{light:5,dark:-3},contrastBoost:.9},standard:{saturationScale:1,lightnessOffset:{light:0,dark:0},contrastBoost:1},"high-contrast":{saturationScale:1.3,lightnessOffset:{light:-5,dark:3},contrastBoost:1.2}};function nie(e){const r=e.trim().match(/^([\d.]+)\s+([\d.]+)%?\s+([\d.]+)%?$/);if(!r)return null;const n=parseFloat(r[1]),i=parseFloat(r[2]),o=parseFloat(r[3]);return isNaN(n)||isNaN(i)||isNaN(o)?null:{h:n,s:i,l:o}}function iie(e,t,r){const n=Math.max(0,Math.min(100,Math.round(t*10)/10)),i=Math.max(0,Math.min(100,Math.round(r*10)/10));return`${Math.round(e)} ${n}% ${i}%`}function OM(e,t,r){if(t==="standard")return e;const n=rie[t],i=r==="light"?n.lightnessOffset.light:n.lightnessOffset.dark,o={};for(const[s,a]of Object.entries(e)){const l=nie(a);if(!l){o[s]=a;continue}let c=l.s*n.saturationScale;c=Math.max(0,Math.min(100,c));let d=50+(l.l-50)*n.contrastBoost;d=d+i,d=Math.max(0,Math.min(100,d)),o[s]=iie(l.h,c,d)}return o}function oie(e,t){const r=(e%360+360)%360,n={};if(t==="light"){n["--bg"]=`${r} 5% 98%`,n["--bg-secondary"]=`${r} 8% 96%`,n["--surface"]=`${r} 10% 99%`,n["--surface-hover"]=`${r} 12% 97%`,n["--border"]=`${r} 15% 88%`,n["--border-hover"]=`${r} 18% 82%`,n["--text"]=`${r} 20% 15%`,n["--text-secondary"]=`${r} 10% 45%`,n["--text-tertiary"]=`${r} 8% 60%`,n["--text-disabled"]=`${r} 5% 70%`,n["--accent"]=`${r} 70% 60%`,n["--accent-hover"]=`${r} 75% 55%`,n["--accent-active"]=`${r} 80% 50%`,n["--accent-light"]=`${r} 65% 90%`,n["--accent-lighter"]=`${r} 60% 95%`,n["--primary"]=`${r} 70% 60%`,n["--primary-hover"]=`${r} 75% 55%`,n["--primary-light"]=`${r} 65% 90%`,n["--primary-lighter"]=`${r} 60% 95%`;const i=(r+180)%360;n["--secondary"]=`${i} 60% 65%`,n["--secondary-hover"]=`${i} 65% 60%`,n["--secondary-light"]=`${i} 55% 90%`,n["--muted"]=`${r} 12% 92%`,n["--muted-hover"]=`${r} 15% 88%`,n["--muted-text"]=`${r} 10% 45%`,n["--success"]="120 60% 50%",n["--success-light"]="120 55% 92%",n["--success-text"]="120 70% 35%",n["--warning"]="38 90% 55%",n["--warning-light"]="38 85% 92%",n["--warning-text"]="38 95% 40%",n["--error"]="0 70% 55%",n["--error-light"]="0 65% 92%",n["--error-text"]="0 75% 40%",n["--info"]="200 70% 55%",n["--info-light"]="200 65% 92%",n["--info-text"]="200 75% 40%",n["--destructive"]="0 70% 55%",n["--destructive-hover"]="0 75% 50%",n["--destructive-light"]="0 65% 92%",n["--hover"]=`${r} 12% 94%`,n["--active"]=`${r} 15% 90%`,n["--focus"]=`${r} 70% 60%`,n["--background"]=n["--bg"],n["--foreground"]=n["--text"],n["--card"]=n["--surface"],n["--card-foreground"]=n["--text"],n["--primary-foreground"]="0 0% 100%",n["--secondary-foreground"]="0 0% 100%",n["--accent-foreground"]="0 0% 100%",n["--destructive-foreground"]="0 0% 100%",n["--muted-foreground"]=n["--text-secondary"],n["--sidebar-background"]=`${r} 30% 97%`,n["--sidebar-foreground"]=n["--text"],n["--input"]=n["--border"],n["--ring"]=n["--accent"],n["--indigo"]="239 65% 60%",n["--indigo-light"]="239 65% 92%",n["--orange"]="25 90% 55%",n["--orange-light"]="25 90% 92%"}else{n["--bg"]=`${r} 20% 10%`,n["--bg-secondary"]=`${r} 18% 12%`,n["--surface"]=`${r} 15% 14%`,n["--surface-hover"]=`${r} 18% 16%`,n["--border"]=`${r} 10% 22%`,n["--border-hover"]=`${r} 12% 28%`,n["--text"]=`${r} 10% 90%`,n["--text-secondary"]=`${r} 8% 65%`,n["--text-tertiary"]=`${r} 6% 50%`,n["--text-disabled"]=`${r} 5% 40%`,n["--accent"]=`${r} 70% 60%`,n["--accent-hover"]=`${r} 75% 65%`,n["--accent-active"]=`${r} 80% 70%`,n["--accent-light"]=`${r} 60% 25%`,n["--accent-lighter"]=`${r} 55% 20%`,n["--primary"]=`${r} 70% 60%`,n["--primary-hover"]=`${r} 75% 65%`,n["--primary-light"]=`${r} 60% 25%`,n["--primary-lighter"]=`${r} 55% 20%`;const i=(r+180)%360;n["--secondary"]=`${i} 60% 65%`,n["--secondary-hover"]=`${i} 65% 70%`,n["--secondary-light"]=`${i} 55% 25%`,n["--muted"]=`${r} 15% 18%`,n["--muted-hover"]=`${r} 18% 22%`,n["--muted-text"]=`${r} 8% 65%`,n["--success"]="120 60% 55%",n["--success-light"]="120 50% 20%",n["--success-text"]="120 65% 65%",n["--warning"]="38 90% 60%",n["--warning-light"]="38 80% 22%",n["--warning-text"]="38 95% 70%",n["--error"]="0 70% 60%",n["--error-light"]="0 60% 20%",n["--error-text"]="0 75% 70%",n["--info"]="200 70% 60%",n["--info-light"]="200 60% 20%",n["--info-text"]="200 75% 70%",n["--destructive"]="0 70% 60%",n["--destructive-hover"]="0 75% 65%",n["--destructive-light"]="0 60% 20%",n["--hover"]=`${r} 18% 16%`,n["--active"]=`${r} 20% 20%`,n["--focus"]=`${r} 70% 60%`,n["--background"]=n["--bg"],n["--foreground"]=n["--text"],n["--card"]=n["--surface"],n["--card-foreground"]=n["--text"],n["--primary-foreground"]=`${r} 30% 10%`,n["--secondary-foreground"]="0 0% 100%",n["--accent-foreground"]=`${r} 30% 10%`,n["--destructive-foreground"]="0 0% 100%",n["--muted-foreground"]=n["--text-secondary"],n["--sidebar-background"]=`${r} 25% 12%`,n["--sidebar-foreground"]=n["--text"],n["--input"]=n["--border"],n["--ring"]=n["--accent"],n["--indigo"]="239 60% 55%",n["--indigo-light"]="239 40% 20%",n["--orange"]="25 85% 50%",n["--orange-light"]="25 50% 20%"}return n}const sie=[["--text","--bg",4.5],["--text","--surface",4.5],["--text-secondary","--bg",4.5],["--text-secondary","--surface",4.5],["--muted-text","--muted",4.5],["--muted-text","--bg",4.5],["--text-tertiary","--bg",3],["--text-disabled","--bg",3],["--accent","--bg",3],["--accent","--surface",3],["--success-text","--success-light",4.5],["--warning-text","--warning-light",4.5],["--error-text","--error-light",4.5],["--info-text","--info-light",4.5],["--primary-foreground","--primary",4.5],["--destructive-foreground","--destructive",4.5],["--text","--muted",4.5]];function Sk(e){const r=e.trim().match(/^([\d.]+)\s+([\d.]+)%?\s+([\d.]+)%?$/);if(!r)return null;const n=parseFloat(r[1]),i=parseFloat(r[2])/100,o=parseFloat(r[3])/100;return isNaN(n)||isNaN(i)||isNaN(o)?null:[n,i,o]}function aie(e,t,r){const n=(1-Math.abs(2*r-1))*t,i=e/60,o=n*(1-Math.abs(i%2-1)),s=r-n/2;let a,l,c;i<1?(a=n,l=o,c=0):i<2?(a=o,l=n,c=0):i<3?(a=0,l=n,c=o):i<4?(a=0,l=o,c=n):i<5?(a=o,l=0,c=n):(a=n,l=0,c=o);const d=a+s,u=l+s,p=c+s,g=_=>_<=.04045?_/12.92:Math.pow((_+.055)/1.055,2.4);return[g(d),g(u),g(p)]}function Wa(e){const t=Sk(e);if(!t)return-1;const[r,n,i]=t,[o,s,a]=aie(r,n,i);return Math.round((.2126*o+.7152*s+.0722*a)*1e4)/1e4}function Xh(e,t){const r=Math.max(e,t),n=Math.min(e,t);return Math.round((r+.05)/(n+.05)*100)/100}function IM(e){const t=[];for(const[r,n,i]of sie){const o=e[r],s=e[n];if(!o||!s)continue;const a=Wa(o),l=Wa(s);if(a<0||l<0)continue;const c=Xh(a,l),d=c>=i-.01;t.push({fgVar:r,bgVar:n,ratio:c,required:i,passed:d})}return t}function qv(e,t,r){const n=Math.max(0,Math.min(100,Math.round(r*10)/10)),i=Math.max(0,Math.min(100,Math.round(t*10)/10));return`${Math.round(e)} ${i}% ${n}%`}function Vze(e,t,r,n){const i=r[e],o=r[t];if(!i||!o)return[];const s=Sk(i),a=Sk(o);if(!s||!a)return[];const l=[],c=Wa(o),d=RM(s[0],s[1],s[2],c,n);for(const g of d){const _=qv(s[0],s[1]*100,g*100),y=Wa(_);if(y<0)continue;const m=Xh(y,c);m>=n-.01&&l.push({target:"fg",original:i,suggested:_,resultRatio:m,distance:Math.abs(g-s[2])})}const u=Wa(i),p=RM(a[0],a[1],a[2],u,n);for(const g of p){const _=qv(a[0],a[1]*100,g*100),y=Wa(_);if(y<0)continue;const m=Xh(u,y);m>=n-.01&&l.push({target:"bg",original:o,suggested:_,resultRatio:m,distance:Math.abs(g-a[2])})}return l.sort((g,_)=>g.distance-_.distance),l.slice(0,3)}function RM(e,t,r,n,i){const o=[];for(let a=r-.01;a>=0;a-=.01){const l=qv(e,t*100,a*100),c=Wa(l);if(c<0)continue;if(Xh(c,n)>=i){o.push(a);break}}for(let a=r+.01;a<=1;a+=.01){const l=qv(e,t*100,a*100),c=Wa(l);if(c<0)continue;if(Xh(c,n)>=i){o.push(a);break}}return o}function Ck(e){return e==="reduce"?!0:e==="enable"||typeof window>"u"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}const eU=()=>typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",rh=e=>e==="system"?eU():e,wo=(e,t)=>{const r=e.find(n=>n.id===t);return(r==null?void 0:r.styleTier)??"standard"},Ln=(e,t,r,n="standard",i=!0,o=!1,s="system",a="standard")=>{if(typeof document>"u")return;const l=()=>{document.documentElement.classList.remove("light","dark"),document.documentElement.classList.add(e);const d=["--bg","--bg-secondary","--surface","--surface-hover","--border","--border-hover","--text","--text-secondary","--text-tertiary","--text-disabled","--accent","--accent-hover","--accent-active","--accent-light","--accent-lighter","--primary","--primary-hover","--primary-light","--primary-lighter","--secondary","--secondary-hover","--secondary-light","--muted","--muted-hover","--muted-text","--success","--success-light","--success-text","--warning","--warning-light","--warning-text","--error","--error-light","--error-text","--info","--info-light","--info-text","--destructive","--destructive-hover","--destructive-light","--hover","--active","--focus","--background","--foreground","--card","--card-foreground","--primary-foreground","--secondary-foreground","--accent-foreground","--destructive-foreground","--muted-foreground","--sidebar-background","--sidebar-foreground","--input","--ring","--indigo","--indigo-light","--orange","--orange-light"];if(r!==null){let p=oie(r,e);if(a!=="standard"&&(p=OM(p,a,e)),Object.entries(p).forEach(([g,_])=>{document.documentElement.style.setProperty(g,_)}),document.documentElement.setAttribute("data-theme",`custom-${e}`),a!=="standard"){const _=IM(p).filter(y=>!y.passed);_.length>0&&console.warn('[Theme] Style tier "%s" caused %d WCAG AA contrast failures:',a,_.length,_.map(y=>`${y.fgVar}/${y.bgVar}: ${y.ratio}:1 (min ${y.required}:1)`))}}else{d.forEach(g=>{document.documentElement.style.removeProperty(g)});const p=Yz(t,e);if(document.documentElement.setAttribute("data-theme",p),a!=="standard"){const g=getComputedStyle(document.documentElement),_={};for(const b of d){const x=g.getPropertyValue(b).trim();x&&(_[b]=x)}const y=OM(_,a,e);Object.entries(y).forEach(([b,x])=>{document.documentElement.style.setProperty(b,x)});const v=IM(y).filter(b=>!b.passed);v.length>0&&console.warn('[Theme] Style tier "%s" on preset "%s" caused %d WCAG AA contrast failures:',a,t,v.length,v.map(b=>`${b.fgVar}/${b.bgVar}: ${b.ratio}:1 (min ${b.required}:1)`))}}document.documentElement.setAttribute("data-color-scheme",t),document.documentElement.setAttribute("data-gradient",n),document.documentElement.setAttribute("data-hover-glow",String(i)),document.documentElement.setAttribute("data-bg-animation",String(o));const u=Ck(s);document.documentElement.setAttribute("data-reduced-motion",String(u)),document.documentElement.setAttribute("data-style-tier",a)};!Ck(s)&&typeof document<"u"&&"startViewTransition"in document?document.startViewTransition(l):l()},wu=e=>{if(typeof document>"u")return;const t=document.documentElement;t.setAttribute("data-bg-mode",e.mode),t.setAttribute("data-bg-blur",String(e.effects.blur)),t.setAttribute("data-bg-darken",String(e.effects.darkenOpacity)),t.setAttribute("data-bg-saturation",String(e.effects.saturation)),t.setAttribute("data-bg-frosted",String(e.effects.enableFrostedGlass)),t.setAttribute("data-bg-grain",String(e.effects.enableGrain)),t.setAttribute("data-bg-vignette",String(e.effects.enableVignette))},lie={theme:"system",resolvedTheme:"light",colorScheme:"blue",customHue:null,isCustomTheme:!1,gradientLevel:"standard",enableHoverGlow:!0,enableBackgroundAnimation:!1,motionPreference:"system",locale:Hv(),sidebarOpen:!0,sidebarCollapsed:!1,expandedNavGroups:["overview","workflow","knowledge","issues","tools","configuration"],currentView:"sessions",currentFilter:"all",currentLiteType:null,currentSessionDetailKey:null,isLoading:!1,loadingMessage:null,error:null,dashboardLayout:null,themeSlots:[tie],activeSlotId:"default",deletedSlotBuffer:null,isImmersiveMode:!1},xt=gn()(En(im((e,t)=>({...lie,setTheme:r=>{const n=rh(r);e({theme:r,resolvedTheme:n},!1,"setTheme");const i=t(),o=wo(i.themeSlots,i.activeSlotId);Ln(n,i.colorScheme,i.customHue,i.gradientLevel,i.enableHoverGlow,i.enableBackgroundAnimation,i.motionPreference,o)},setColorScheme:r=>{e(o=>({colorScheme:r,customHue:null,isCustomTheme:!1,themeSlots:o.themeSlots.map(s=>s.id===o.activeSlotId?{...s,colorScheme:r,customHue:null,isCustomTheme:!1}:s)}),!1,"setColorScheme");const n=t(),i=wo(n.themeSlots,n.activeSlotId);Ln(n.resolvedTheme,r,null,n.gradientLevel,n.enableHoverGlow,n.enableBackgroundAnimation,n.motionPreference,i)},setCustomHue:r=>{if(r===null){const o=t(),s=wo(o.themeSlots,o.activeSlotId);e(a=>({customHue:null,isCustomTheme:!1,themeSlots:a.themeSlots.map(l=>l.id===a.activeSlotId?{...l,customHue:null,isCustomTheme:!1}:l)}),!1,"setCustomHue"),Ln(o.resolvedTheme,o.colorScheme,null,o.gradientLevel,o.enableHoverGlow,o.enableBackgroundAnimation,o.motionPreference,s);return}e(o=>({customHue:r,isCustomTheme:!0,themeSlots:o.themeSlots.map(s=>s.id===o.activeSlotId?{...s,customHue:r,isCustomTheme:!0}:s)}),!1,"setCustomHue");const n=t(),i=wo(n.themeSlots,n.activeSlotId);Ln(n.resolvedTheme,n.colorScheme,r,n.gradientLevel,n.enableHoverGlow,n.enableBackgroundAnimation,n.motionPreference,i)},toggleTheme:()=>{const{theme:r}=t(),n=r==="dark"?"light":"dark";t().setTheme(n)},setGradientLevel:r=>{e(o=>({gradientLevel:r,themeSlots:o.themeSlots.map(s=>s.id===o.activeSlotId?{...s,gradientLevel:r}:s)}),!1,"setGradientLevel");const n=t(),i=wo(n.themeSlots,n.activeSlotId);Ln(n.resolvedTheme,n.colorScheme,n.customHue,r,n.enableHoverGlow,n.enableBackgroundAnimation,n.motionPreference,i)},setEnableHoverGlow:r=>{e(o=>({enableHoverGlow:r,themeSlots:o.themeSlots.map(s=>s.id===o.activeSlotId?{...s,enableHoverGlow:r}:s)}),!1,"setEnableHoverGlow");const n=t(),i=wo(n.themeSlots,n.activeSlotId);Ln(n.resolvedTheme,n.colorScheme,n.customHue,n.gradientLevel,r,n.enableBackgroundAnimation,n.motionPreference,i)},setEnableBackgroundAnimation:r=>{e(o=>({enableBackgroundAnimation:r,themeSlots:o.themeSlots.map(s=>s.id===o.activeSlotId?{...s,enableBackgroundAnimation:r}:s)}),!1,"setEnableBackgroundAnimation");const n=t(),i=wo(n.themeSlots,n.activeSlotId);Ln(n.resolvedTheme,n.colorScheme,n.customHue,n.gradientLevel,n.enableHoverGlow,r,n.motionPreference,i)},setMotionPreference:r=>{e({motionPreference:r},!1,"setMotionPreference");const n=t(),i=wo(n.themeSlots,n.activeSlotId);Ln(n.resolvedTheme,n.colorScheme,n.customHue,n.gradientLevel,n.enableHoverGlow,n.enableBackgroundAnimation,r,i)},setStyleTier:r=>{e(i=>({themeSlots:i.themeSlots.map(o=>o.id===i.activeSlotId?{...o,styleTier:r}:o)}),!1,"setStyleTier");const n=t();Ln(n.resolvedTheme,n.colorScheme,n.customHue,n.gradientLevel,n.enableHoverGlow,n.enableBackgroundAnimation,n.motionPreference,r)},setLocale:r=>{e({locale:r},!1,"setLocale"),xk(r)},setSidebarOpen:r=>{e({sidebarOpen:r},!1,"setSidebarOpen")},toggleSidebar:()=>{e(r=>({sidebarOpen:!r.sidebarOpen}),!1,"toggleSidebar")},setSidebarCollapsed:r=>{e({sidebarCollapsed:r},!1,"setSidebarCollapsed")},setExpandedNavGroups:r=>{e({expandedNavGroups:r},!1,"setExpandedNavGroups")},setCurrentView:r=>{e({currentView:r},!1,"setCurrentView")},setCurrentFilter:r=>{e({currentFilter:r},!1,"setCurrentFilter")},setCurrentLiteType:r=>{e({currentLiteType:r},!1,"setCurrentLiteType")},setCurrentSessionDetailKey:r=>{e({currentSessionDetailKey:r},!1,"setCurrentSessionDetailKey")},setLoading:(r,n=null)=>{e({isLoading:r,loadingMessage:n},!1,"setLoading")},setError:r=>{e({error:r},!1,"setError")},clearError:()=>{e({error:null},!1,"clearError")},setDashboardLayouts:r=>{e(n=>{var i;return{dashboardLayout:{widgets:((i=n.dashboardLayout)==null?void 0:i.widgets)||Xx.widgets,layouts:r}}},!1,"setDashboardLayouts")},setDashboardWidgets:r=>{e(n=>{var i;return{dashboardLayout:{widgets:r,layouts:((i=n.dashboardLayout)==null?void 0:i.layouts)||Xx.layouts}}},!1,"setDashboardWidgets")},resetDashboardLayout:()=>{e({dashboardLayout:Xx},!1,"resetDashboardLayout")},setActiveSlot:r=>{const{themeSlots:n,motionPreference:i}=t(),o=n.find(a=>a.id===r);if(!o)return;const s=rh(t().theme);e({activeSlotId:r,colorScheme:o.colorScheme,customHue:o.customHue,isCustomTheme:o.isCustomTheme,gradientLevel:o.gradientLevel,enableHoverGlow:o.enableHoverGlow,enableBackgroundAnimation:o.enableBackgroundAnimation},!1,"setActiveSlot"),Ln(s,o.colorScheme,o.customHue,o.gradientLevel,o.enableHoverGlow,o.enableBackgroundAnimation,i,o.styleTier),wu(o.backgroundConfig??Go)},copySlot:()=>{const r=t();if(r.themeSlots.length>=wk)return;const n=new Set(r.themeSlots.map(l=>l.id)),o=["custom-1","custom-2"].find(l=>!n.has(l));if(!o)return;const s=r.themeSlots.find(l=>l.id===r.activeSlotId);if(!s)return;const a={id:o,name:`Copy of ${s.name}`,colorScheme:r.colorScheme,customHue:r.customHue,isCustomTheme:r.isCustomTheme,gradientLevel:r.gradientLevel,enableHoverGlow:r.enableHoverGlow,enableBackgroundAnimation:r.enableBackgroundAnimation,styleTier:s.styleTier,isDefault:!1,backgroundConfig:s.backgroundConfig};e({themeSlots:[...r.themeSlots,a],activeSlotId:o},!1,"copySlot")},renameSlot:(r,n)=>{e(i=>({themeSlots:i.themeSlots.map(o=>o.id===r?{...o,name:n}:o)}),!1,"renameSlot")},deleteSlot:r=>{const n=t(),i=n.themeSlots.find(s=>s.id===r);if(!i||i.isDefault)return;e({themeSlots:n.themeSlots.filter(s=>s.id!==r),deletedSlotBuffer:i,activeSlotId:"default"},!1,"deleteSlot");const o=n.themeSlots.find(s=>s.id==="default");if(o){const s=rh(n.theme);e({colorScheme:o.colorScheme,customHue:o.customHue,isCustomTheme:o.isCustomTheme,gradientLevel:o.gradientLevel,enableHoverGlow:o.enableHoverGlow,enableBackgroundAnimation:o.enableBackgroundAnimation},!1,"deleteSlot/applyDefault"),Ln(s,o.colorScheme,o.customHue,o.gradientLevel,o.enableHoverGlow,o.enableBackgroundAnimation,n.motionPreference,o.styleTier),wu(o.backgroundConfig??Go)}setTimeout(()=>{var a;((a=xt.getState().deletedSlotBuffer)==null?void 0:a.id)===r&&xt.setState({deletedSlotBuffer:null},!1)},1e4)},undoDeleteSlot:()=>{const r=t(),n=r.deletedSlotBuffer;if(!n||r.themeSlots.length>=wk)return;e({themeSlots:[...r.themeSlots,n],deletedSlotBuffer:null,activeSlotId:n.id},!1,"undoDeleteSlot");const i=rh(r.theme);e({colorScheme:n.colorScheme,customHue:n.customHue,isCustomTheme:n.isCustomTheme,gradientLevel:n.gradientLevel,enableHoverGlow:n.enableHoverGlow,enableBackgroundAnimation:n.enableBackgroundAnimation},!1,"undoDeleteSlot/apply"),Ln(i,n.colorScheme,n.customHue,n.gradientLevel,n.enableHoverGlow,n.enableBackgroundAnimation,r.motionPreference,n.styleTier),wu(n.backgroundConfig??Go)},setBackgroundConfig:r=>{e(n=>({themeSlots:n.themeSlots.map(i=>i.id===n.activeSlotId?{...i,backgroundConfig:r}:i)}),!1,"setBackgroundConfig"),wu(r)},updateBackgroundEffect:(r,n)=>{const i=t(),o=i.themeSlots.find(l=>l.id===i.activeSlotId),s=(o==null?void 0:o.backgroundConfig)??Go,a={...s,effects:{...s.effects,[r]:n}};t().setBackgroundConfig(a)},setBackgroundMode:r=>{const n=t(),i=n.themeSlots.find(a=>a.id===n.activeSlotId),s={...(i==null?void 0:i.backgroundConfig)??Go,mode:r};t().setBackgroundConfig(s)},setBackgroundImage:(r,n)=>{const i=t(),o=i.themeSlots.find(l=>l.id===i.activeSlotId),s=(o==null?void 0:o.backgroundConfig)??Go,a={...s,imageUrl:r,attribution:n};r&&s.mode==="gradient-only"&&(a.mode="image-gradient"),!r&&s.mode!=="gradient-only"&&(a.mode="gradient-only"),t().setBackgroundConfig(a)},setImmersiveMode:r=>{e({isImmersiveMode:r},!1,"setImmersiveMode")},toggleImmersiveMode:()=>{e(r=>({isImmersiveMode:!r.isImmersiveMode}),!1,"toggleImmersiveMode")}}),{name:"ccw-app-store",partialize:e=>({theme:e.theme,colorScheme:e.colorScheme,customHue:e.customHue,gradientLevel:e.gradientLevel,enableHoverGlow:e.enableHoverGlow,enableBackgroundAnimation:e.enableBackgroundAnimation,motionPreference:e.motionPreference,locale:e.locale,sidebarCollapsed:e.sidebarCollapsed,expandedNavGroups:e.expandedNavGroups,dashboardLayout:e.dashboardLayout,themeSlots:e.themeSlots,activeSlotId:e.activeSlotId}),onRehydrateStorage:()=>e=>{if(e){if(!e.themeSlots||!Array.isArray(e.themeSlots)||e.themeSlots.length===0){const i={id:"default",name:"Default",colorScheme:e.colorScheme??"blue",customHue:e.customHue??null,isCustomTheme:(e.customHue??null)!==null,gradientLevel:e.gradientLevel??"standard",enableHoverGlow:e.enableHoverGlow??!0,enableBackgroundAnimation:e.enableBackgroundAnimation??!1,styleTier:"standard",isDefault:!0};e.themeSlots=[i],e.activeSlotId="default"}(!e.activeSlotId||!e.themeSlots.find(i=>i.id===e.activeSlotId))&&(e.activeSlotId="default");const t=rh(e.theme);e.resolvedTheme=t,e.isCustomTheme=e.customHue!==null;const r=wo(e.themeSlots,e.activeSlotId);Ln(t,e.colorScheme,e.customHue,e.gradientLevel??"standard",e.enableHoverGlow??!0,e.enableBackgroundAnimation??!1,e.motionPreference??"system",r);const n=e.themeSlots.find(i=>i.id===e.activeSlotId);wu((n==null?void 0:n.backgroundConfig)??Go)}e&&xk(e.locale)}}),{name:"AppStore"}));if(typeof window<"u"){window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{const i=xt.getState();if(i.theme==="system"){const o=eU();xt.setState({resolvedTheme:o});const s=wo(i.themeSlots,i.activeSlotId);Ln(o,i.colorScheme,i.customHue,i.gradientLevel,i.enableHoverGlow,i.enableBackgroundAnimation,i.motionPreference,s)}});const t=xt.getState(),r=wo(t.themeSlots,t.activeSlotId);Ln(t.resolvedTheme,t.colorScheme,t.customHue,t.gradientLevel,t.enableHoverGlow,t.enableBackgroundAnimation,t.motionPreference,r);const n=t.themeSlots.find(i=>i.id===t.activeSlotId);wu((n==null?void 0:n.backgroundConfig)??Go)}const cie=e=>e.theme,uie=e=>e.resolvedTheme,die=e=>e.customHue,fie=e=>e.isCustomTheme,hie=e=>e.gradientLevel,pie=e=>e.enableHoverGlow,mie=e=>e.enableBackgroundAnimation,gie=e=>e.motionPreference,Gze=e=>e.locale,vie=e=>e.themeSlots,yie=e=>e.activeSlotId,bie=e=>e.deletedSlotBuffer,_ie=e=>e.isImmersiveMode,Ek=2,xie=800,wie=/^ccw(\d+):(.+)$/,Sie=["blue","green","orange","purple"],Cie=["soft","standard","high-contrast"],Eie=["off","standard","enhanced"],kie=["gradient-only","image-only","image-gradient"];function NM(e){const t={v:Ek,c:e.colorScheme,h:e.customHue,t:e.styleTier,g:e.gradientLevel,w:e.enableHoverGlow,a:e.enableBackgroundAnimation},r=e.backgroundConfig;r&&r.mode!=="gradient-only"&&(t.bm=r.mode,r.imageUrl&&(t.bi=r.imageUrl),r.attribution&&(t.bp=r.attribution.photographerName,t.bu=r.attribution.photographerUrl,t.bpu=r.attribution.photoUrl),t.be={b:r.effects.blur,d:r.effects.darkenOpacity,s:r.effects.saturation,f:r.effects.enableFrostedGlass,g:r.effects.enableGrain,v:r.effects.enableVignette});const n=JSON.stringify(t),o=new TextEncoder().encode(n);let s="";for(let c=0;c<o.length;c++)s+=String.fromCharCode(o[c]);const l=btoa(s).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");return`ccw${Ek}:${l}`}function Tie(e){if(!e||typeof e!="string")return{ok:!1,error:"empty_input"};const t=e.trim();if(t.length>xie)return{ok:!1,error:"too_long"};const r=t.match(wie);if(!r)return{ok:!1,error:"invalid_format"};const n=parseInt(r[1],10);let o=r[2].replace(/-/g,"+").replace(/_/g,"/");const s=o.length%4;s===2?o+="==":s===3&&(o+="=");let a;try{const g=atob(o),_=new Uint8Array(g.length);for(let m=0;m<g.length;m++)_[m]=g.charCodeAt(m);a=new TextDecoder().decode(_)}catch{return{ok:!1,error:"decode_failed"}}let l;try{l=JSON.parse(a)}catch{return{ok:!1,error:"parse_failed"}}if(!l||typeof l!="object"||Array.isArray(l))return{ok:!1,error:"invalid_payload"};const c=l,d=typeof c.v=="number"?c.v:n,u=Pie(d);if(!u.compatible)return{ok:!1,error:"incompatible_version"};if(typeof c.c!="string"||!Sie.includes(c.c))return{ok:!1,error:"invalid_field"};if(c.h!==null&&(typeof c.h!="number"||!isFinite(c.h)))return{ok:!1,error:"invalid_field"};if(typeof c.t!="string"||!Cie.includes(c.t))return{ok:!1,error:"invalid_field"};if(typeof c.g!="string"||!Eie.includes(c.g))return{ok:!1,error:"invalid_field"};if(typeof c.w!="boolean"||typeof c.a!="boolean")return{ok:!1,error:"invalid_field"};const p={version:d,colorScheme:c.c,customHue:c.h,styleTier:c.t,gradientLevel:c.g,enableHoverGlow:c.w,enableBackgroundAnimation:c.a};if(typeof c.bm=="string"&&kie.includes(c.bm)){const g={...Jz};if(c.be&&typeof c.be=="object"&&!Array.isArray(c.be)){const _=c.be;typeof _.b=="number"&&(g.blur=_.b),typeof _.d=="number"&&(g.darkenOpacity=_.d),typeof _.s=="number"&&(g.saturation=_.s),typeof _.f=="boolean"&&(g.enableFrostedGlass=_.f),typeof _.g=="boolean"&&(g.enableGrain=_.g),typeof _.v=="boolean"&&(g.enableVignette=_.v)}p.backgroundConfig={mode:c.bm,imageUrl:typeof c.bi=="string"?c.bi:null,attribution:typeof c.bp=="string"&&typeof c.bu=="string"&&typeof c.bpu=="string"?{photographerName:c.bp,photographerUrl:c.bu,photoUrl:c.bpu}:null,effects:g}}return{ok:!0,payload:p,warning:u.warning}}function Pie(e){const t=Math.abs(e-Ek);return t>2?{compatible:!1}:t>0?{compatible:!0,warning:"version_mismatch"}:{compatible:!0}}function Aie(){const e=xt(cie),t=xt(uie),r=xt(_e=>_e.colorScheme),n=xt(die),i=xt(fie),o=xt(hie),s=xt(pie),a=xt(mie),l=xt(gie),c=xt(_e=>_e.setTheme),d=xt(_e=>_e.setColorScheme),u=xt(_e=>_e.setCustomHue),p=xt(_e=>_e.toggleTheme),g=xt(_e=>_e.setGradientLevel),_=xt(_e=>_e.setEnableHoverGlow),y=xt(_e=>_e.setEnableBackgroundAnimation),m=xt(_e=>_e.setMotionPreference),v=xt(_e=>_e.setStyleTier),b=xt(vie),x=xt(yie),E=xt(bie),C=xt(_e=>_e.setBackgroundConfig),k=xt(_e=>_e.updateBackgroundEffect),P=xt(_e=>_e.setBackgroundMode),T=xt(_e=>_e.setBackgroundImage),I=xt(_e=>_e.setActiveSlot),N=xt(_e=>_e.copySlot),B=xt(_e=>_e.renameSlot),M=xt(_e=>_e.deleteSlot),F=xt(_e=>_e.undoDeleteSlot),U=O.useCallback(_e=>{c(_e)},[c]),q=O.useCallback(_e=>{d(_e)},[d]),V=O.useCallback(_e=>{u(_e)},[u]),K=O.useCallback(()=>{p()},[p]),D=O.useCallback(_e=>{g(_e)},[g]),$=O.useCallback(_e=>{_(_e)},[_]),j=O.useCallback(_e=>{y(_e)},[y]),z=O.useCallback(_e=>{m(_e)},[m]),X=O.useCallback(_e=>{v(_e)},[v]),W=Ck(l),le=O.useMemo(()=>b.find(_e=>_e.id===x),[b,x]),ce=b.length<wk,ve=(le==null?void 0:le.styleTier)??"standard",H=(le==null?void 0:le.backgroundConfig)??Go,Q=O.useCallback(_e=>{I(_e)},[I]),Y=O.useCallback(()=>{N()},[N]),ne=O.useCallback((_e,rt)=>{B(_e,rt)},[B]),ge=O.useCallback(_e=>{M(_e)},[M]),te=O.useCallback(()=>{F()},[F]),Oe=O.useCallback(()=>NM(le||{colorScheme:r,customHue:n,gradientLevel:o,enableHoverGlow:s,enableBackgroundAnimation:a,styleTier:ve}),[le,x,r,n,i,o,s,a,ve]),Ie=O.useCallback(_e=>Tie(_e),[]);return{theme:e,resolvedTheme:t,isDark:t==="dark",colorScheme:r,customHue:n,isCustomTheme:i,gradientLevel:o,enableHoverGlow:s,enableBackgroundAnimation:a,motionPreference:l,resolvedMotion:W,setTheme:U,setColorScheme:q,setCustomHue:V,toggleTheme:K,setGradientLevel:D,setEnableHoverGlow:$,setEnableBackgroundAnimation:j,setMotionPreference:z,styleTier:ve,setStyleTier:X,themeSlots:b,activeSlotId:x,activeSlot:le,deletedSlotBuffer:E,canAddSlot:ce,setActiveSlot:Q,copySlot:Y,renameSlot:ne,deleteSlot:ge,undoDeleteSlot:te,exportThemeCode:Oe,importThemeCode:Ie,backgroundConfig:H,setBackgroundConfig:C,updateBackgroundEffect:k,setBackgroundMode:P,setBackgroundImage:T}}const tU=5;let Ih=[];function Oie(){return Ih.shift()}function Tv(e){e&&(Ih.includes(e)||Ih.length>=tU||Ih.push(e))}let nh=null;async function rU(){return nh||(nh=(async()=>{try{const e=await fetch("/api/csrf-token",{credentials:"same-origin"});if(!e.ok)throw new Error("Failed to fetch CSRF token");const r=(await e.json()).csrfToken;if(!r)throw new Error("No CSRF token in response");return r}finally{nh=null}})(),nh)}function Iie(e){const t=e.headers.get("X-CSRF-Token");t&&Tv(t)}async function nU(){try{const e=await fetch(`/api/csrf-token?count=${tU}`,{credentials:"same-origin"});if(!e.ok)throw new Error("Failed to initialize CSRF token pool");const t=await e.json();if(t.tokens&&Array.isArray(t.tokens))for(const r of t.tokens)Tv(r);else t.csrfToken&&Tv(t.csrfToken);console.log(`[CSRF] Token pool initialized with ${Ih.length} tokens`)}catch(e){console.error("[CSRF] Failed to initialize CSRF token pool:",e);try{const t=await rU();Tv(t)}catch(t){console.error("[CSRF] Fallback token fetch failed:",t)}}}async function ee(e,t={}){const r=new Headers(t.headers);if(t.method&&["POST","PUT","PATCH","DELETE"].includes(t.method)){let i=Oie();if(!i){console.warn("[CSRF] Token pool depleted, fetching synchronously");try{i=await rU()}catch{throw new Error("Failed to acquire CSRF token for request")}}i&&r.set("X-CSRF-Token",i)}t.body&&typeof t.body=="string"&&r.set("Content-Type","application/json");const n=await fetch(e,{...t,headers:r,credentials:"same-origin"});if(Iie(n),!n.ok){const i={message:n.statusText||"Request failed",status:n.status},o=n.headers.get("content-type");if(o&&o.includes("application/json"))try{const s=await n.json();s.message?i.message=s.message:s.error&&(i.message=s.error),s.code&&(i.code=s.code)}catch{}throw i}if(n.status!==204)try{return await n.json()}catch(i){const o=i instanceof Error?i.message:"Unknown error";throw new Error(`Failed to parse JSON response: ${o}`)}}function Rie(e){const t=e.toLowerCase();return t.includes("-review-")||t.includes("-code-review-")?"review":t.includes("-tdd-")||t.includes("-test-driven-")?"tdd":t.includes("-test-")||t.includes("-testing-")?"test":t.includes("-docs-")||t.includes("-doc-")||t.includes("-documentation-")?"docs":t.includes("-lite-plan-")?"lite-plan":t.includes("-lite-fix-")||t.includes("-fix-")?"lite-fix":"workflow"}function MM(e,t){const n={active:"in_progress",completed:"completed",archived:"archived",planning:"planning",paused:"paused"}[e.status]||e.status;let i=e.project||e.session_id,o;if(e.project&&e.project.includes(":")){const c=e.project.split(":");i=c[0].trim(),o=c.slice(1).join(":").trim()}let s=e.type||Rie(e.session_id);const a=e;let l;if(a.hasReview){s!=="review"&&(s="review");const c=a.reviewDimensions||[],d=c.reduce((u,p)=>{var g;return u+(((g=p.findings)==null?void 0:g.length)||0)},0);l={dimensions:c.map(u=>({name:u.name,findings:u.findings||[]})),dimensions_count:c.length,findings:d,iterations:void 0,fixes:void 0}}return{session_id:e.session_id,type:s,title:i,description:o,status:n,created_at:e.created_at,updated_at:e.updated_at,location:t,path:e.path,has_plan:e.has_plan,plan_updated_at:e.plan_updated_at,has_review:a.hasReview,review:l,summaries:e.summaries,tasks:(e.tasks||[]).map(c=>IU(c))}}async function iU(e){var t,r,n,i,o,s,a,l;try{const c=e?`/api/data?path=${encodeURIComponent(e)}`:"/api/data",d=await ee(c);return d?{totalSessions:((t=d.statistics)==null?void 0:t.totalSessions)??0,activeSessions:((r=d.statistics)==null?void 0:r.activeSessions)??0,archivedSessions:((n=d.statistics)==null?void 0:n.archivedSessions)??0,totalTasks:((i=d.statistics)==null?void 0:i.totalTasks)??0,completedTasks:((o=d.statistics)==null?void 0:o.completedTasks)??0,pendingTasks:((s=d.statistics)==null?void 0:s.pendingTasks)??0,failedTasks:((a=d.statistics)==null?void 0:a.failedTasks)??0,todayActivity:((l=d.statistics)==null?void 0:l.todayActivity)??0}:(console.warn("[API] No data received from /api/data for dashboard stats"),jM())}catch(c){return console.error("[API] Failed to fetch dashboard stats:",c),jM()}}function jM(){return{totalSessions:0,activeSessions:0,archivedSessions:0,totalTasks:0,completedTasks:0,pendingTasks:0,failedTasks:0,todayActivity:0}}async function iA(e){try{const t=e?`/api/data?path=${encodeURIComponent(e)}`:"/api/data",r=await ee(t);if(!r)return console.warn("[API] No data received from /api/data for sessions"),{activeSessions:[],archivedSessions:[]};const n=(r.activeSessions??[]).map(o=>{try{return MM(o,"active")}catch(s){return console.error("[API] Failed to transform active session:",o,s),{session_id:o.session_id,title:o.project||o.session_id,status:"in_progress",created_at:o.created_at,location:"active"}}}),i=(r.archivedSessions??[]).map(o=>{try{return MM(o,"archived")}catch(s){return console.error("[API] Failed to transform archived session:",o,s),{session_id:o.session_id,title:o.project||o.session_id,status:o.status==="active"?"in_progress":o.status,created_at:o.created_at,location:"archived"}}});return{activeSessions:n,archivedSessions:i}}catch(t){return console.error("[API] Failed to fetch sessions:",t),{activeSessions:[],archivedSessions:[]}}}async function oU(e){return ee(`/api/sessions/${encodeURIComponent(e)}/archive`,{method:"POST"})}async function sU(e){return ee(`/api/sessions/${encodeURIComponent(e)}`,{method:"DELETE"})}async function aU(){return(await ee("/api/recent-paths")).paths??[]}async function lU(e){return(await ee("/api/remove-recent-path",{method:"POST",body:JSON.stringify({path:e})})).paths}async function cU(e){return ee(`/api/switch-path?path=${encodeURIComponent(e)}`)}async function uU(e){const t=e?`/api/issues?path=${encodeURIComponent(e)}`:"/api/issues";return{issues:(await ee(t)).issues??[]}}async function dU(e){const t=e?`/api/issues/history?path=${encodeURIComponent(e)}`:"/api/issues/history";return{issues:(await ee(t)).issues??[]}}async function fU(e){const t=e?`/api/queue?path=${encodeURIComponent(e)}`:"/api/queue";return ee(t)}async function hU(e){return ee("/api/issues",{method:"POST",body:JSON.stringify(e)})}async function pU(e,t){return ee(`/api/issues/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(t)})}async function mU(e){return ee(`/api/issues/${encodeURIComponent(e)}`,{method:"DELETE"})}async function Nie(e,t){const r=new FormData;t.forEach(i=>{r.append("files",i)});const n=await fetch(`/api/issues/${encodeURIComponent(e)}/attachments`,{method:"POST",body:r,credentials:"same-origin"});if(!n.ok){const i=await n.json().catch(()=>({error:"Upload failed"}));throw new Error(i.error||"Failed to upload attachments")}return n.json()}async function Mie(e={}){const t=new URLSearchParams;e.state&&t.set("state",e.state),e.limit&&t.set("limit",String(e.limit)),e.labels&&t.set("labels",e.labels),e.downloadImages&&t.set("downloadImages","true");const r=`/api/issues/pull${t.toString()?"?"+t.toString():""}`;return ee(r,{method:"POST"})}async function gU(e){return ee(`/api/queue/history?path=${encodeURIComponent(e)}`)}async function vU(e,t){return ee(`/api/queue/${encodeURIComponent(e)}?path=${encodeURIComponent(t)}`)}async function yU(e,t){return ee(`/api/queue/activate?path=${encodeURIComponent(t)}`,{method:"POST",body:JSON.stringify({queueId:e})})}async function bU(e){return ee(`/api/queue/deactivate?path=${encodeURIComponent(e)}`,{method:"POST"})}async function _U(e,t){return ee(`/api/queue/reorder?path=${encodeURIComponent(e)}`,{method:"POST",body:JSON.stringify(t)})}async function xU(e,t){return ee(`/api/queue/move?path=${encodeURIComponent(e)}`,{method:"POST",body:JSON.stringify(t)})}async function wU(e,t){return ee(`/api/queue/${encodeURIComponent(e)}?path=${encodeURIComponent(t)}`,{method:"DELETE"})}async function SU(e,t,r){return ee(`/api/queue/merge?path=${encodeURIComponent(r)}`,{method:"POST",body:JSON.stringify({sourceQueueId:e,targetQueueId:t})})}async function CU(e,t,r){return ee(`/api/queue/split?path=${encodeURIComponent(r)}`,{method:"POST",body:JSON.stringify({sourceQueueId:e,itemIds:t})})}async function EU(e){const t=e?`/api/discoveries?path=${encodeURIComponent(e)}`:"/api/discoveries",r=await ee(t);return(r.discoveries??r.sessions??[]).map(i=>{var a,l;let o="running";i.phase==="complete"||i.phase==="completed"?o="completed":i.phase==="failed"&&(o="failed");const s=((l=(a=i.progress)==null?void 0:a.perspective_analysis)==null?void 0:l.percent_complete)??0;return{id:i.discovery_id||i.id,name:i.target_pattern||i.discovery_id||i.name||"Discovery",status:o,progress:s,findings_count:i.total_findings??i.findings_count??0,created_at:i.created_at,completed_at:i.completed_at}})}async function kU(e,t){const r=t?`/api/discoveries/${encodeURIComponent(e)}/findings?path=${encodeURIComponent(t)}`:`/api/discoveries/${encodeURIComponent(e)}/findings`;return((await ee(r)).findings??[]).map(i=>({...i,severity:i.severity||i.priority||"medium"}))}async function TU(e,{findingIds:t,exportAll:r},n){const i=n?`/api/discoveries/${encodeURIComponent(e)}/export?path=${encodeURIComponent(n)}`:`/api/discoveries/${encodeURIComponent(e)}/export`;return ee(i,{method:"POST",body:JSON.stringify({finding_ids:t,export_all:r})})}async function jie(e,t="claude"){const r=(a,l)=>a.map(c=>({...c,location:l,enabled:!0})),n=(a,l)=>a.map(c=>({...c,location:l,enabled:!1})),i=a=>{const l=r(a.projectSkills??[],"project"),c=r(a.userSkills??[],"user"),d=n(a.disabledProjectSkills??[],"project"),u=n(a.disabledUserSkills??[],"user");return[...l,...c,...d,...u]},o=t==="codex"?"&cliType=codex":"";if(e)try{const a=`/api/skills?path=${encodeURIComponent(e)}&includeDisabled=true${o}`,l=await ee(a);return{skills:i(l)}}catch(a){const l=a;if(l.status===403||l.status===404)console.warn("[fetchSkills] 403/404 for project path, falling back to global skills");else throw a}const s=await ee(`/api/skills?includeDisabled=true${o}`);return{skills:i(s)}}async function Die(e,t,r,n="claude"){return ee(`/api/skills/${encodeURIComponent(e)}/enable`,{method:"POST",body:JSON.stringify({location:t,projectPath:r,cliType:n})})}async function Lie(e,t,r,n="claude"){return ee(`/api/skills/${encodeURIComponent(e)}/disable`,{method:"POST",body:JSON.stringify({location:t,projectPath:r,cliType:n})})}async function $ie(e,t,r,n="claude"){const i=n==="codex"?"&cliType=codex":"",o=r?`/api/skills/${encodeURIComponent(e)}?location=${t}&path=${encodeURIComponent(r)}${i}`:`/api/skills/${encodeURIComponent(e)}?location=${t}${i}`;return ee(o)}async function Bie(e,t,r,n="claude"){return ee(`/api/skills/${encodeURIComponent(e)}`,{method:"DELETE",body:JSON.stringify({location:t,projectPath:r,cliType:n})})}async function Fie(e){return ee("/api/skills/validate-import",{method:"POST",body:JSON.stringify({sourcePath:e})})}async function zie(e){return ee("/api/skills/create",{method:"POST",body:JSON.stringify(e)})}async function Uie(e){const{skillName:t,fileName:r,location:n,projectPath:i,cliType:o="claude"}=e,a=`/api/skills/${encodeURIComponent(t)}/file?filename=${encodeURIComponent(r)}&location=${n}&cliType=${o}${i?`&path=${encodeURIComponent(i)}`:""}`;return ee(a)}async function Hie(e){if(e)try{const t=`/api/commands?path=${encodeURIComponent(e)}`,r=await ee(t),n=[...r.projectCommands??[],...r.userCommands??[]];return{commands:r.commands??n,groups:r.groups,projectGroupsConfig:r.projectGroupsConfig,userGroupsConfig:r.userGroupsConfig}}catch(t){const r=t;if(r.status===403||r.status===404||r.status===400)console.warn("[fetchCommands] Path validation failed, falling back to global commands");else throw t}try{const t=await ee("/api/commands"),r=[...t.projectCommands??[],...t.userCommands??[]];return{commands:t.commands??r,groups:t.groups,projectGroupsConfig:t.projectGroupsConfig,userGroupsConfig:t.userGroupsConfig}}catch(t){throw console.error("[fetchCommands] Failed to fetch commands:",t),t}}async function qie(e,t,r,n){return ee(`/api/commands/${encodeURIComponent(e)}/toggle`,{method:"POST",body:JSON.stringify({enabled:t,location:r,projectPath:n})})}async function Wie(e,t,r,n){return ee(`/api/commands/group/${encodeURIComponent(e)}/toggle`,{method:"POST",body:JSON.stringify({enable:t,location:r,projectPath:n})})}async function Vie(e){return ee("/api/commands/validate-import",{method:"POST",body:JSON.stringify({sourcePath:e})})}async function Gie(e){return ee("/api/commands/create",{method:"POST",body:JSON.stringify(e)})}async function Kie(e){if(e)try{const r=`/api/core-memory/memories?path=${encodeURIComponent(e)}`,n=await ee(r);return{memories:n.memories??[],totalSize:n.totalSize??0,claudeMdCount:n.claudeMdCount??0}}catch(r){const n=r;if(n.status===403||n.status===404)console.warn("[fetchMemories] 403/404 for project path, falling back to global memories");else throw r}const t=await ee("/api/core-memory/memories");return{memories:t.memories??[],totalSize:t.totalSize??0,claudeMdCount:t.claudeMdCount??0}}async function Xie(e,t){return ee("/api/core-memory/memories",{method:"POST",body:JSON.stringify({...e,path:t})}).then(n=>n.memory)}async function Zie(e,t,r){return ee("/api/core-memory/memories",{method:"POST",body:JSON.stringify({id:e,...t,path:r})}).then(i=>i.memory)}async function Qie(e,t){const r=t?`/api/core-memory/memories/${encodeURIComponent(e)}?path=${encodeURIComponent(t)}`:`/api/core-memory/memories/${encodeURIComponent(e)}`;return ee(r,{method:"DELETE"})}async function Yie(e,t){const r=t?`/api/core-memory/memories/${encodeURIComponent(e)}/archive?path=${encodeURIComponent(t)}`:`/api/core-memory/memories/${encodeURIComponent(e)}/archive`;return ee(r,{method:"POST"})}async function Jie(e,t){const r=t?`/api/core-memory/memories/${encodeURIComponent(e)}/unarchive?path=${encodeURIComponent(t)}`:`/api/core-memory/memories/${encodeURIComponent(e)}/unarchive`;return ee(r,{method:"POST"})}async function eoe(e,t){const r=new URLSearchParams;return t&&r.set("path",t),ee(`/api/core-memory/extract?${r}`,{method:"POST",body:JSON.stringify({max_sessions:e})})}async function toe(e){const t=new URLSearchParams;return e&&t.set("path",e),ee(`/api/core-memory/extract/status?${t}`)}async function roe(e){const t=new URLSearchParams;return e&&t.set("path",e),ee(`/api/core-memory/consolidate?${t}`,{method:"POST"})}async function noe(e){const t=new URLSearchParams;return e&&t.set("path",e),ee(`/api/core-memory/consolidate/status?${t}`)}async function ioe(e,t){const r=new URLSearchParams;return t&&r.set("path",t),e!=null&&e.kind&&r.set("kind",e.kind),e!=null&&e.status_filter&&r.set("status_filter",e.status_filter),ee(`/api/core-memory/jobs?${r}`)}async function ooe(e=!1,t,r){const n=new URLSearchParams;return r&&n.set("path",r),e&&n.set("include_native","true"),ee(`/api/core-memory/extract/preview?${n}`)}async function soe(e){const t=new URLSearchParams;return e.path&&t.set("path",e.path),ee(`/api/core-memory/extract/selective?${t}`,{method:"POST",body:JSON.stringify({session_ids:e.sessionIds,include_native:e.includeNative})})}async function PU(e){const t=e?`/api/ccw?path=${encodeURIComponent(e)}`:"/api/ccw";return(await ee(t)).projectOverview??null}async function AU(e,t){const r=t?`/api/ccw/guidelines?path=${encodeURIComponent(t)}`:"/api/ccw/guidelines";return ee(r,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function aoe(e,t){const r=await iA(t),i=[...r.activeSessions,...r.archivedSessions].find(d=>d.session_id===e);if(!i)throw new Error(`Session not found: ${e}`);const o=i.path||i.session_id,s=await ee(`/api/session-detail?path=${encodeURIComponent(o)}&type=all`);let a=s.summary;!a&&s.summaries&&s.summaries.length>0&&(a=s.summaries[0].content||s.summaries[0].name||"");const l=s.context?{context:s.context}:void 0;return{session:{...i,tasks:s.tasks||i.tasks||[]},context:l,summary:a,summaries:s.summaries,implPlan:s.implPlan,conflicts:s.conflictResolution,review:s.review}}async function loe(e){const t=e?`/api/cli/history-native?path=${encodeURIComponent(e)}`:"/api/cli/history-native";return{executions:(await ee(t)).executions??[]}}async function coe(e){await ee(`/api/cli/history/${encodeURIComponent(e)}`,{method:"DELETE"})}async function uoe(e){await ee(`/api/cli/history/tool/${encodeURIComponent(e)}`,{method:"DELETE"})}async function doe(){await ee("/api/cli/history",{method:"DELETE"})}async function foe(e,t,r){return ee("/api/bulk-update-task-status",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionPath:e,taskIds:t,newStatus:r})})}async function hoe(e,t,r){return ee("/api/update-task-status",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionPath:e,taskId:t,newStatus:r})})}async function OU(e,t){const r=new URLSearchParams({id:e});return t&&r.set("path",t),await ee(`/api/cli/execution?${r.toString()}`)}async function poe(e,t){const r=new URLSearchParams({id:e});return t&&r.set("path",t),ee(`/api/cli/native-session?${r.toString()}`)}async function moe(e){const t=new URLSearchParams;if(e.filePath)t.set("filePath",e.filePath),e.tool&&t.set("tool",e.tool);else if(e.executionId)t.set("id",e.executionId);else throw new Error("Either executionId or filePath is required");e.projectPath&&t.set("path",e.projectPath),e.format&&t.set("format",e.format),e.thoughts&&t.set("thoughts","true"),e.tools&&t.set("tools","true"),e.tokens&&t.set("tokens","true");const r=`/api/cli/native-session?${t.toString()}`;if(e.format==="text"){const n=await fetch(r,{credentials:"same-origin"});if(!n.ok){const i=await n.json().catch(()=>({error:"Request failed"}));throw new Error(i.error||n.statusText)}return n.text()}return ee(r)}async function goe(e={}){const{tool:t,project:r,limit:n=50,cursor:i}=e,o=new URLSearchParams;t&&o.set("tool",t),r&&o.set("path",r),n&&o.set("limit",String(n)),i&&o.set("cursor",i);const s=o.toString();return ee(`/api/cli/native-sessions${s?`?${s}`:""}`)}function voe(e){if(!(!Array.isArray(e)||e.length===0))return e.map(t=>typeof t=="string"?{path:t}:t)}function IU(e){var g;if(!e||typeof e!="object")return{task_id:"N/A",status:"pending",_raw:e};const t=e.context,r=e.flow_control,n=e.meta,i=e.convergence,o=e.modification_points,s=t==null?void 0:t.requirements,a=e.details,l=e.description||(Array.isArray(s)&&s.length>0?s.join("; "):void 0)||(Array.isArray(a)&&a.length>0?a.join("; "):void 0)||e.scope,c=voe(e.files)||(r==null?void 0:r.target_files)||(o!=null&&o.length?o.filter(_=>_.file).map(_=>({path:_.file,name:_.target,change:_.change})):void 0),d=e.focus_paths||(t==null?void 0:t.focus_paths)||(c!=null&&c.length?c.map(_=>_.path).filter(Boolean):void 0)||[],u=e.acceptance,p=i||((g=t==null?void 0:t.acceptance)!=null&&g.length?{criteria:t.acceptance}:void 0)||(u!=null&&u.length?{criteria:u}:void 0);return{task_id:e.task_id||e.id||"N/A",title:e.title,description:l,status:e.status||"pending",priority:e.priority,created_at:e.created_at,updated_at:e.updated_at,has_summary:e.has_summary,estimated_complexity:e.estimated_complexity,depends_on:e.depends_on||(t==null?void 0:t.depends_on)||[],focus_paths:d,convergence:p,pre_analysis:e.pre_analysis||(r==null?void 0:r.pre_analysis),implementation:e.implementation||(r==null?void 0:r.implementation_approach),files:c,type:e.type||(n==null?void 0:n.type),scope:e.scope||(n==null?void 0:n.scope),action:e.action||(n==null?void 0:n.action),flow_control:r,context:t,meta:n,_raw:e}}function yoe(e){var i,o,s;const t=e.pre_analysis,r=e.implementation,n=e.files;return!(t!=null&&t.length)&&!(r!=null&&r.length)&&!(n!=null&&n.length)?e.flow_control:{pre_analysis:t||((i=e.flow_control)==null?void 0:i.pre_analysis),implementation_approach:r||((o=e.flow_control)==null?void 0:o.implementation_approach),target_files:n||((s=e.flow_control)==null?void 0:s.target_files)}}async function oA(e){const t=e?`/api/data?path=${encodeURIComponent(e)}`:"/api/data";return(await ee(t)).liteTasks||{}}async function RU(e,t,r){const n=await oA(r);return(t==="lite-plan"?n.litePlan||[]:t==="lite-fix"?n.liteFix||[]:n.multiCliPlan||[]).find(o=>o.id===e||o.session_id===e)||null}async function boe(e){return await ee(`/api/session-detail?path=${encodeURIComponent(e)}&type=context`)}async function NU(){var t;const e=await ee("/api/data");if(e.activeSessions){const r=e.activeSessions.filter(n=>n.type==="review"||n.hasReview);if(r.length>0)return r.map(n=>{var i;return{session_id:n.session_id,title:n.project||n.session_id,description:"",type:"review",phase:(i=n.reviewSummary)==null?void 0:i.phase,reviewDimensions:n.reviewDimensions||[],reviewSummary:n.reviewSummary,_isActive:!0,created_at:n.created_at,updated_at:void 0,status:n.status}})}return e.reviewSessions&&e.reviewSessions.length>0?e.reviewSessions:(t=e.reviewData)!=null&&t.sessions?e.reviewData.sessions.map(r=>({session_id:r.session_id,title:r.session_id,description:"",type:"review",phase:"in-progress",reviewDimensions:r.dimensions.map(n=>({name:n.name,findings:n.findings||[]})),_isActive:!0,created_at:void 0,updated_at:void 0,status:"active"})):[]}async function _oe(e){return(await NU()).find(r=>r.session_id===e)||null}function MU(e){return e.transport==="stdio"}function xoe(e){return e.transport==="http"}async function Tc(){return ee("/api/mcp-config")}function Xr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Wv(e){const t=e.trim();if(!t)return"";let r=t.replace(/\\/g,"/");return/^\/[a-zA-Z]\//.test(r)&&(r=r.charAt(1).toUpperCase()+":"+r.slice(2)),/^[a-zA-Z]:\//.test(r)&&(r=r.charAt(0).toUpperCase()+r.slice(1)),r.replace(/\/+$/,"")}function jU(e,t){if(!t)return null;const r=Wv(t);if(!r)return null;for(const n of Object.keys(e))if(Wv(n)===r)return n;return t in e?t:null}function Vv(e){if(!Xr(e))return{transport:"stdio",command:""};const t=typeof e.url=="string"&&e.url.trim()!=="",r=e.type==="http"||e.transport==="http";if(t||r){const l=typeof e.url=="string"?e.url:"",c=Xr(e.headers)?Object.fromEntries(Object.entries(e.headers).flatMap(([_,y])=>typeof y=="string"?[[_,y]]:[])):void 0,d=typeof e.bearer_token_env_var=="string"?e.bearer_token_env_var:void 0,u=Xr(e.http_headers)?Object.fromEntries(Object.entries(e.http_headers).flatMap(([_,y])=>typeof y=="string"?[[_,y]]:[])):void 0,p=Array.isArray(e.env_http_headers)?e.env_http_headers.filter(_=>typeof _=="string"):void 0,g={transport:"http",url:l};return c&&Object.keys(c).length>0&&(g.headers=c),d&&(g.bearerTokenEnvVar=d),u&&Object.keys(u).length>0&&(g.httpHeaders=u),p&&p.length>0&&(g.envHttpHeaders=p),g}const n=typeof e.command=="string"?e.command:"",i=Array.isArray(e.args)?e.args.filter(l=>typeof l=="string"):void 0,o=Xr(e.env)?Object.fromEntries(Object.entries(e.env).flatMap(([l,c])=>typeof c=="string"?[[l,c]]:[])):void 0,s=typeof e.cwd=="string"?e.cwd:void 0,a={transport:"stdio",command:n};return i&&i.length>0&&(a.args=i),o&&Object.keys(o).length>0&&(a.env=o),s&&(a.cwd=s),a}async function w0(e){const t=await Tc(),r=Xr(t.projects)?t.projects:{},n=jU(r,e),i=n&&Xr(r[n])?r[n]:null,o=i&&Array.isArray(i.disabledMcpServers)?i.disabledMcpServers.filter(p=>typeof p=="string"):[],s=new Set(o),a=Xr(t.userServers)?t.userServers:{},l=i&&Xr(i.mcpServers)?i.mcpServers:{},c=Object.entries(a).map(([p,g])=>{const _=Vv(g);return{name:p,..._,enabled:!s.has(p),scope:"global"}}),d=Object.entries(l).map(([p,g])=>{const _=Vv(g);return{name:p,..._,enabled:!s.has(p),scope:"project"}}),u=[];for(const p of d){const g=c.find(_=>_.name===p.name);g&&u.push({name:p.name,projectServer:p,globalServer:g,effectiveScope:"global"})}return{project:d,global:c,conflicts:u}}function Ya(e,t){const r=e==null?void 0:e.trim();if(!r)throw new Error(`${t}: projectPath is required`);return r}function DU(e){if(e.transport==="http"){const n={url:"url"in e&&typeof e.url=="string"?e.url:""};return n.type="http",e.headers&&Object.keys(e.headers).length>0&&(n.headers=e.headers),e.bearerTokenEnvVar&&(n.bearer_token_env_var=e.bearerTokenEnvVar),e.httpHeaders&&Object.keys(e.httpHeaders).length>0&&(n.http_headers=e.httpHeaders),e.envHttpHeaders&&e.envHttpHeaders.length>0&&(n.env_http_headers=e.envHttpHeaders),n}const t={};return"command"in e&&typeof e.command=="string"&&(t.command=e.command),"args"in e&&Array.isArray(e.args)&&e.args.length>0&&(t.args=e.args),"env"in e&&e.env&&Object.keys(e.env).length>0&&(t.env=e.env),"cwd"in e&&typeof e.cwd=="string"&&e.cwd.trim()&&(t.cwd=e.cwd),t}function DM(e,t){const r=t.transport??"stdio",n=t.enabled??!0,i=t.scope??"project";if(r==="http"){const c="url"in t&&typeof t.url=="string"?t.url:"";return{name:e,transport:"http",url:c,enabled:n,scope:i}}const o="command"in t&&typeof t.command=="string"?t.command:"",s="args"in t&&Array.isArray(t.args)?t.args:void 0,a="env"in t&&t.env&&typeof t.env=="object"?t.env:void 0,l="cwd"in t&&typeof t.cwd=="string"?t.cwd:void 0;return{name:e,transport:"stdio",command:o,args:s,env:a,cwd:l,enabled:n,scope:i}}async function woe(e,t,r={}){var i;if(!t.scope)throw new Error("updateMcpServer: scope is required");if(t.transport==="http"){const o="url"in t?t.url:void 0;if(typeof o!="string"||!o.trim())throw new Error("updateMcpServer: url is required for HTTP servers")}else{const o="command"in t?t.command:void 0;if(typeof o!="string"||!o.trim())throw new Error("updateMcpServer: command is required for STDIO servers")}const n=DU(t);if(t.scope==="global"){const o=await ee("/api/mcp-add-global-server",{method:"POST",body:JSON.stringify({serverName:e,serverConfig:n})});if(o!=null&&o.error)throw new Error(o.error)}else{const o=Ya(r.projectPath,"updateMcpServer"),s=r.configType??"mcp",a=await ee("/api/mcp-copy-server",{method:"POST",body:JSON.stringify({projectPath:o,serverName:e,serverConfig:n,configType:s})});if(a!=null&&a.error)throw new Error(a.error)}if(typeof t.enabled=="boolean"){const o=(i=r.projectPath)==null?void 0:i.trim();if(o){const s=await ee("/api/mcp-toggle",{method:"POST",body:JSON.stringify({projectPath:o,serverName:e,enable:t.enabled})});if(s!=null&&s.error)throw new Error(s.error)}}if(r.projectPath){const o=await w0(r.projectPath);return[...o.project,...o.global].find(s=>s.name===e)??DM(e,t)}return DM(e,t)}async function Soe(e,t={}){var i,o,s;if(!((i=e.name)!=null&&i.trim()))throw new Error("createMcpServer: name is required");if(e.transport==="http"){if(!((o=e.url)!=null&&o.trim()))throw new Error("createMcpServer: url is required for HTTP servers")}else if(!((s=e.command)!=null&&s.trim()))throw new Error("createMcpServer: command is required for STDIO servers");const r=e.name.trim(),n=DU(e);if(e.scope==="global"){const a=await ee("/api/mcp-add-global-server",{method:"POST",body:JSON.stringify({serverName:r,serverConfig:n})});if(a!=null&&a.error)throw new Error(a.error)}else{const a=Ya(t.projectPath,"createMcpServer"),l=t.configType??"mcp",c=await ee("/api/mcp-copy-server",{method:"POST",body:JSON.stringify({projectPath:a,serverName:r,serverConfig:n,configType:l})});if(c!=null&&c.error)throw new Error(c.error)}if(e.enabled===!1){const a=Ya(t.projectPath,"createMcpServer"),l=await ee("/api/mcp-toggle",{method:"POST",body:JSON.stringify({projectPath:a,serverName:r,enable:!1})});if(l!=null&&l.error)throw new Error(l.error)}if(t.projectPath){const a=await w0(t.projectPath);return[...a.project,...a.global].find(l=>l.name===r)??e}return e}async function Coe(e,t,r={}){if(t==="global"){const o=await ee("/api/mcp-remove-global-server",{method:"POST",body:JSON.stringify({serverName:e})});if(o!=null&&o.error)throw new Error(o.error);return}const n=Ya(r.projectPath,"deleteMcpServer"),i=await ee("/api/mcp-remove-server",{method:"POST",body:JSON.stringify({projectPath:n,serverName:e})});if(i!=null&&i.error)throw new Error(i.error)}async function Eoe(e,t,r={}){const n=Ya(r.projectPath,"toggleMcpServer"),i=await ee("/api/mcp-toggle",{method:"POST",body:JSON.stringify({projectPath:n,serverName:e,enable:t})});if(i!=null&&i.error)throw new Error(i.error);const o=await w0(n);return[...o.project,...o.global].find(s=>s.name===e)??{name:e,transport:"stdio",command:"",enabled:t,scope:"project"}}async function LU(){const e=await ee("/api/codex-mcp-config"),t=Xr(e.servers)?e.servers:{};return{servers:Object.entries(t).map(([n,i])=>{const o=Vv(i),s=Xr(i)?i.enabled!==!1:!0;return{name:n,...o,enabled:s,scope:"global",configPath:e.configPath}}),configPath:e.configPath}}async function S0(e,t){return ee("/api/codex-mcp-add",{method:"POST",body:JSON.stringify({serverName:e,serverConfig:t})})}async function $U(e){return ee("/api/codex-mcp-remove",{method:"POST",body:JSON.stringify({serverName:e})})}async function koe(e,t){return ee("/api/codex-mcp-toggle",{method:"POST",body:JSON.stringify({serverName:e,enabled:t})})}async function Toe(){return(await ee("/api/mcp-templates")).templates??[]}async function Poe(e){return ee("/api/mcp-templates",{method:"POST",body:JSON.stringify(e)})}async function Aoe(e){return ee(`/api/mcp-templates/${encodeURIComponent(e)}`,{method:"DELETE"})}async function Ooe(e){return ee("/api/mcp-templates/install",{method:"POST",body:JSON.stringify(e)})}async function Ioe(e){return(await ee(`/api/mcp-templates/search?q=${encodeURIComponent(e)}`)).templates??[]}async function Roe(){return(await ee("/api/mcp-templates/categories")).categories??[]}async function Noe(e){return(await ee(`/api/mcp-templates/category/${encodeURIComponent(e)}`)).templates??[]}async function Moe(){const e=await Tc();return{projects:Object.keys(e.projects??{}).sort((r,n)=>r.localeCompare(n))}}async function joe(e){const t=await Tc(),r=Xr(t.userServers)?t.userServers:{},n=Xr(t.enterpriseServers)?t.enterpriseServers:{},i=e&&e.length>0?new Set(e.map(s=>Wv(s))):null,o={};for(const[s,a]of Object.entries(t.projects??{})){const l=Wv(s);if(i&&!i.has(l))continue;const c=Xr(a)?a:{},d=Xr(c.mcpServers)?c.mcpServers:{},u=Array.isArray(c.disabledMcpServers)?c.disabledMcpServers.filter(g=>typeof g=="string"):[],p=new Set(u);o[s]=Object.entries(d).filter(([g])=>!(g in r)&&!(g in n)).flatMap(([g,_])=>{const y=Vv(_);return y.transport!=="stdio"?[]:[{name:g,command:y.command,args:y.args,env:y.env,enabled:!p.has(g)}]})}return{servers:o}}async function Doe(e){const t=e.serverNames??[];if(t.length===0||e.source===e.target)return{success:!0,copied:[],failed:[]};const r=[],n=[];if(e.source==="claude"&&e.target==="codex"){const i=await Tc(),o=Xr(i.projects)?i.projects:{},s=jU(o,e.projectPath??void 0),a=s&&Xr(o[s])?o[s]:null,l=a&&Xr(a.mcpServers)?a.mcpServers:{};for(const c of t)try{const d=l[c]??(i.userServers?i.userServers[c]:void 0)??(i.enterpriseServers?i.enterpriseServers[c]:void 0);if(!Xr(d)){n.push({name:c,error:"Source server config not found"});continue}const u=await S0(c,d);if(u!=null&&u.error){n.push({name:c,error:u.error});continue}r.push(c)}catch(d){n.push({name:c,error:d instanceof Error?d.message:String(d)})}return{success:r.length>0,copied:r,failed:n}}if(e.source==="codex"&&e.target==="claude"){const i=Ya(e.projectPath,"crossCliCopy"),o=await ee("/api/codex-mcp-config"),s=Xr(o.servers)?o.servers:{};for(const a of t)try{const l=s[a];if(!Xr(l)){n.push({name:a,error:"Source server config not found"});continue}const c=await ee("/api/mcp-copy-server",{method:"POST",body:JSON.stringify({projectPath:i,serverName:a,serverConfig:l,configType:"mcp"})});if(c!=null&&c.error){n.push({name:a,error:c.error});continue}r.push(a)}catch(l){n.push({name:a,error:l instanceof Error?l.message:String(l)})}return{success:r.length>0,copied:r,failed:n}}return{success:!1,copied:[],failed:t.map(i=>({name:i,error:"Unsupported copy direction"}))}}async function Loe(){return{endpoints:(await ee("/api/cli/endpoints")).endpoints??[]}}async function $oe(e,t){return ee(`/api/cli/endpoints/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(t)})}async function Boe(e){return ee("/api/cli/endpoints",{method:"POST",body:JSON.stringify(e)})}async function Foe(e){await ee(`/api/cli/endpoints/${encodeURIComponent(e)}`,{method:"DELETE"})}async function zoe(e,t){return ee(`/api/cli/endpoints/${encodeURIComponent(e)}/toggle`,{method:"POST",body:JSON.stringify({enabled:t})})}async function Uoe(){return{tools:(await ee("/api/cli/installations")).tools??[]}}async function Hoe(e){return ee(`/api/cli/installations/${encodeURIComponent(e)}/install`,{method:"POST"})}async function qoe(e){await ee(`/api/cli/installations/${encodeURIComponent(e)}/uninstall`,{method:"POST"})}async function Woe(e){return ee(`/api/cli/installations/${encodeURIComponent(e)}/upgrade`,{method:"POST"})}function Voe(e){const t=[];for(const r of["project","global"]){const n=e[r];if(!(!(n!=null&&n.hooks)||typeof n.hooks!="object"))for(const[i,o]of Object.entries(n.hooks))Array.isArray(o)&&o.forEach((s,a)=>{let l="";s.hooks&&Array.isArray(s.hooks)&&s.hooks.length>0&&(l=s.hooks.map(d=>d.command||d.prompt||"").filter(Boolean).join(" && ")),!l&&s.command&&(l=s.args?`${s.command} ${s.args.join(" ")}`:s.command),!l&&s.script&&(l=s.script);const c=`${r}-${i}-${a}`;t.push({name:c,description:s.description,enabled:s.enabled!==!1,command:l,trigger:i,matcher:s.matcher,scope:r,index:a,templateId:s._templateId})})}return t}async function Goe(e){const t=e?`/api/hooks?path=${encodeURIComponent(e)}`:"/api/hooks",r=await ee(t);return{hooks:Voe(r)}}async function Koe(e,t){return ee(`/api/hooks/${encodeURIComponent(e)}/toggle`,{method:"POST",body:JSON.stringify({enabled:t})})}async function Xoe(e,t,r){return ee("/api/hooks",{method:"POST",body:JSON.stringify({projectPath:"",scope:e,event:t,hookData:r})})}async function Zoe(e){return ee("/api/hooks",{method:"DELETE",body:JSON.stringify(e)})}async function Qoe(e){if(e)try{const n=`/api/rules?path=${encodeURIComponent(e)}`,i=await ee(n),o=[...i.projectRules??[],...i.userRules??[]];return{rules:i.rules??o}}catch(n){const i=n;if(i.status===403||i.status===404)console.warn("[fetchRules] 403/404 for project path, falling back to global rules");else throw n}const t=await ee("/api/rules"),r=[...t.projectRules??[],...t.userRules??[]];return{rules:t.rules??r}}async function Yoe(e,t){return ee(`/api/rules/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(t)})}async function Joe(e,t){return ee(`/api/rules/${encodeURIComponent(e)}/toggle`,{method:"POST",body:JSON.stringify({enabled:t})})}async function ese(e){return ee("/api/rules/create",{method:"POST",body:JSON.stringify(e)})}async function tse(e,t){return ee(`/api/rules/${encodeURIComponent(e)}`,{method:"DELETE",body:JSON.stringify({location:t})})}async function rse(e,t){return ee("/api/mcp-add-global-server",{method:"POST",body:JSON.stringify({serverName:e,serverConfig:t})})}async function nse(e,t,r,n="mcp"){const i=Ya(r,"copyMcpServerToProject");return ee("/api/mcp-copy-server",{method:"POST",body:JSON.stringify({projectPath:i,serverName:e,serverConfig:t,configType:n})})}async function sA(e){var t,r,n,i;try{const o=await Tc(),s=[];let a=null;if((t=o.globalServers)!=null&&t["ccw-tools"]?(s.push("global"),a=o.globalServers["ccw-tools"]):(r=o.userServers)!=null&&r["ccw-tools"]&&(s.push("global"),a=o.userServers["ccw-tools"]),o.projects){if(e){const u=e.replace(/\\/g,"/");for(const[p,g]of Object.entries(o.projects))if(p.replace(/\\/g,"/")===u&&((n=g.mcpServers)!=null&&n["ccw-tools"])){s.push("project"),a||(a=g.mcpServers["ccw-tools"]);break}}else for(const u of Object.values(o.projects))if((i=u.mcpServers)!=null&&i["ccw-tools"]){s.push("project"),a||(a=u.mcpServers["ccw-tools"]);break}}if(!a)return{isInstalled:!1,enabledTools:[],installedScopes:[]};const l=a.env||{},c=l.CCW_ENABLED_TOOLS;let d;return c==null?d=["write_file","edit_file","read_file","core_memory","ask_question","smart_search"]:c===""||c==="all"?d=c===""?[]:["write_file","edit_file","read_file","core_memory","ask_question","smart_search"]:d=c.split(",").map(u=>u.trim()).filter(Boolean),{isInstalled:!0,enabledTools:d,projectRoot:l.CCW_PROJECT_ROOT,allowedDirs:l.CCW_ALLOWED_DIRS,enableSandbox:l.CCW_ENABLE_SANDBOX==="1",installedScopes:s}}catch{return{isInstalled:!1,enabledTools:[],installedScopes:[]}}}async function ise(e){const t=await ee("/api/mcp-install-ccw",{method:"POST",body:JSON.stringify({scope:"global",env:e})});if(t!=null&&t.error)throw new Error(t.error||"Failed to update CCW config");return sA()}async function ose(e="global",t){const r=e==="project"?Ya(t,"installCcwMcp"):void 0,n=await ee("/api/mcp-install-ccw",{method:"POST",body:JSON.stringify({scope:e,projectPath:r,env:{enabledTools:["write_file","edit_file","read_file","core_memory","ask_question","smart_search"]}})});if(n!=null&&n.error)throw new Error(n.error||`Failed to install CCW MCP (${e})`);return sA(r)}async function sse(){try{await ee("/api/mcp-remove-global-server",{method:"POST",body:JSON.stringify({serverName:"ccw-tools"})})}catch{}try{const e=await Tc();if(e.projects){const t=Object.entries(e.projects).filter(([r,n])=>{var i;return(i=n.mcpServers)==null?void 0:i["ccw-tools"]}).map(([r])=>ee("/api/mcp-remove-server",{method:"POST",body:JSON.stringify({projectPath:r,serverName:"ccw-tools"})}).catch(()=>{}));await Promise.all(t)}}catch{}}async function ase(e,t){if(e==="global")await ee("/api/mcp-remove-global-server",{method:"POST",body:JSON.stringify({serverName:"ccw-tools"})});else{if(!t)throw new Error("projectPath required for project scope uninstall");await ee("/api/mcp-remove-server",{method:"POST",body:JSON.stringify({projectPath:t,serverName:"ccw-tools"})})}}async function aA(){try{const{servers:e}=await LU(),t=e.find(o=>o.name==="ccw-tools");if(!t)return{isInstalled:!1,enabledTools:[],installedScopes:[]};const r=MU(t)?t.env||{}:{},n=r.CCW_ENABLED_TOOLS;let i;return n==null?i=["write_file","edit_file","read_file","core_memory","ask_question","smart_search"]:n===""||n==="all"?i=n===""?[]:["write_file","edit_file","read_file","core_memory","ask_question","smart_search"]:i=n.split(",").map(o=>o.trim()).filter(Boolean),{isInstalled:!0,enabledTools:i,projectRoot:r.CCW_PROJECT_ROOT,allowedDirs:r.CCW_ALLOWED_DIRS,enableSandbox:r.CCW_ENABLE_SANDBOX==="1",installedScopes:["global"]}}catch{return{isInstalled:!1,enabledTools:[],installedScopes:[]}}}function BU(e){const t={};return e.enabledTools!==void 0?t.CCW_ENABLED_TOOLS=e.enabledTools.join(","):t.CCW_ENABLED_TOOLS="write_file,edit_file,read_file,core_memory,ask_question,smart_search",e.projectRoot&&(t.CCW_PROJECT_ROOT=e.projectRoot),e.allowedDirs&&(t.CCW_ALLOWED_DIRS=e.allowedDirs),e.enableSandbox&&(t.CCW_ENABLE_SANDBOX="1"),{command:"ccw-mcp",args:[],env:t}}async function lse(){const e=BU({enabledTools:["write_file","edit_file","read_file","core_memory","ask_question","smart_search"]}),t=await S0("ccw-tools",e);if(t.error)throw new Error(t.error||"Failed to install CCW MCP to Codex");return aA()}async function cse(){const e=await $U("ccw-tools");if(!e.success)throw new Error(e.error||"Failed to uninstall CCW MCP from Codex")}async function use(e){const t=BU(e),r=await S0("ccw-tools",t);if(r.error)throw new Error(r.error||"Failed to update CCW config in Codex");return aA()}async function FU(e){var n;const t=e?`/api/codexlens/workspace-status?path=${encodeURIComponent(e)}`:"/api/codexlens/workspace-status",r=await ee(t);return{totalFiles:((n=r.fts)==null?void 0:n.totalFiles)??0,lastUpdated:new Date().toISOString(),buildTime:0,status:r.hasIndex?"completed":"idle"}}async function dse(e){const t=e?`/api/memory/prompts?path=${encodeURIComponent(e)}`:"/api/memory/prompts";return ee(t)}async function fse(e){const t=e?`/api/memory/insights?path=${encodeURIComponent(e)}`:"/api/memory/insights";return ee(t)}async function hse(e,t=20){const r=e?`/api/memory/insights?limit=${t}&path=${encodeURIComponent(e)}`:`/api/memory/insights?limit=${t}`;return ee(r)}async function pse(e,t){const r=`/api/memory/insights/${encodeURIComponent(e)}`;return ee(r)}async function mse(e={}){return ee("/api/memory/analyze",{method:"POST",body:JSON.stringify(e)})}async function gse(e){await ee("/api/memory/prompts/"+encodeURIComponent(e),{method:"DELETE"})}async function vse(e,t){const r=t?`/api/memory/insights/${encodeURIComponent(e)}?path=${encodeURIComponent(t)}`:`/api/memory/insights/${encodeURIComponent(e)}`;return ee(r,{method:"DELETE"})}async function yse(e){return ee("/api/memory/prompts/batch-delete",{method:"POST",body:JSON.stringify({promptIds:e})})}async function bse(e="/",t={}){const r=new URLSearchParams;return r.append("rootPath",e),t.maxDepth!==void 0&&r.append("maxDepth",String(t.maxDepth)),t.includeHidden!==void 0&&r.append("includeHidden",String(t.includeHidden)),t.excludePatterns&&r.append("excludePatterns",t.excludePatterns.join(",")),ee(`/api/explorer/tree?${r.toString()}`)}async function _se(e,t={}){const r=new URLSearchParams;return r.append("path",e),t.encoding&&r.append("encoding",t.encoding),t.maxSize!==void 0&&r.append("maxSize",String(t.maxSize)),ee(`/api/explorer/file?${r.toString()}`)}async function xse(e){return ee("/api/explorer/search",{method:"POST",body:JSON.stringify(e)})}async function wse(){return ee("/api/explorer/roots")}async function Sse(e={}){const t=new URLSearchParams;return e.rootPath&&t.append("rootPath",e.rootPath),e.maxDepth!==void 0&&t.append("maxDepth",String(e.maxDepth)),e.includeTypes&&t.append("includeTypes",e.includeTypes.join(",")),e.excludePatterns&&t.append("excludePatterns",e.excludePatterns.join(",")),ee(`/api/graph/dependencies?${t.toString()}`)}async function Cse(){return ee("/api/codexlens/dashboard-init")}async function Ese(){return ee("/api/codexlens/config")}async function kse(e){return ee("/api/codexlens/config",{method:"POST",body:JSON.stringify(e)})}async function Tse(){return ee("/api/codexlens/bootstrap",{method:"POST",body:JSON.stringify({})})}async function Pse(e="cpu"){return ee("/api/codexlens/semantic/install",{method:"POST",body:JSON.stringify({gpuMode:e})})}async function Ase(){return ee("/api/codexlens/uninstall",{method:"POST",body:JSON.stringify({})})}async function Ose(){var n;const e=await ee("/api/codexlens/models"),r=(((n=e==null?void 0:e.result)==null?void 0:n.models)??(e==null?void 0:e.models)??[]).map(i=>({profile:i.profile||"",name:i.model_name||i.name||i.profile||"",type:i.type||"embedding",backend:i.source||"fastembed",size:i.installed&&i.actual_size_mb?`${i.actual_size_mb.toFixed(0)} MB`:i.estimated_size_mb?`~${i.estimated_size_mb} MB`:void 0,installed:i.installed??!1,cache_path:i.cache_path,model_name:i.model_name,description:i.description,use_case:i.use_case,dimensions:i.dimensions,recommended:i.recommended,source:i.source,estimated_size_mb:i.estimated_size_mb,actual_size_mb:i.actual_size_mb}));return{success:(e==null?void 0:e.success)??!0,models:r}}async function Ise(e){return ee("/api/codexlens/models/download",{method:"POST",body:JSON.stringify({profile:e})})}async function Rse(e,t="embedding"){return ee("/api/codexlens/models/download-custom",{method:"POST",body:JSON.stringify({model_name:e,model_type:t})})}async function Nse(e){return ee("/api/codexlens/models/delete",{method:"POST",body:JSON.stringify({profile:e})})}async function Mse(e){return ee("/api/codexlens/models/delete-path",{method:"POST",body:JSON.stringify({cache_path:e})})}async function jse(){return ee("/api/codexlens/env")}async function Dse(e){return ee("/api/codexlens/env",{method:"POST",body:JSON.stringify(e)})}async function Lse(e){return ee("/api/codexlens/gpu/select",{method:"POST",body:JSON.stringify({device_id:e})})}async function $se(){return ee("/api/codexlens/gpu/reset",{method:"POST",body:JSON.stringify({})})}async function Bse(){return ee("/api/codexlens/ignore-patterns")}async function Fse(e){return ee("/api/codexlens/ignore-patterns",{method:"POST",body:JSON.stringify(e)})}async function zse(e){const t=new URLSearchParams;return t.append("query",e.query),e.limit&&t.append("limit",String(e.limit)),e.mode&&t.append("mode",e.mode),e.max_content_length&&t.append("max_content_length",String(e.max_content_length)),e.extra_files_count&&t.append("extra_files_count",String(e.extra_files_count)),ee(`/api/codexlens/search?${t.toString()}`)}async function Use(e){const t=new URLSearchParams;return t.append("query",e.query),e.limit&&t.append("limit",String(e.limit)),e.mode&&t.append("mode",e.mode),e.max_content_length&&t.append("max_content_length",String(e.max_content_length)),e.extra_files_count&&t.append("extra_files_count",String(e.extra_files_count)),ee(`/api/codexlens/search_files?${t.toString()}`)}async function Hse(e){const t=new URLSearchParams;return t.append("query",e.query),e.limit&&t.append("limit",String(e.limit)),ee(`/api/codexlens/symbol?${t.toString()}`)}async function qse(){return ee("/api/codexlens/lsp/status")}async function Wse(e){return ee("/api/codexlens/lsp/start",{method:"POST",body:JSON.stringify({path:e})})}async function Vse(e){return ee("/api/codexlens/lsp/stop",{method:"POST",body:JSON.stringify({path:e})})}async function Gse(e){return ee("/api/codexlens/lsp/restart",{method:"POST",body:JSON.stringify({path:e})})}async function Kse(e){return ee("/api/codexlens/lsp/search",{method:"POST",body:JSON.stringify(e)})}async function Xse(e,t={}){return ee("/api/codexlens/init",{method:"POST",body:JSON.stringify({path:e,indexType:t.indexType||"vector",embeddingModel:t.embeddingModel||"code",embeddingBackend:t.embeddingBackend||"fastembed",maxWorkers:t.maxWorkers||1})})}async function Zse(e,t={}){return ee("/api/codexlens/update",{method:"POST",body:JSON.stringify({path:e,indexType:t.indexType||"vector",embeddingModel:t.embeddingModel||"code",embeddingBackend:t.embeddingBackend||"fastembed",maxWorkers:t.maxWorkers||1})})}async function Qse(){return ee("/api/codexlens/cancel",{method:"POST",body:JSON.stringify({})})}async function Yse(){return ee("/api/codexlens/indexing-status")}async function Jse(){return ee("/api/codexlens/watch/status")}async function eae(e,t){return ee("/api/codexlens/watch/start",{method:"POST",body:JSON.stringify({path:e,debounce_ms:t})})}async function tae(){return ee("/api/codexlens/watch/stop",{method:"POST",body:JSON.stringify({})})}async function rae(){return ee("/api/litellm-api/providers")}async function nae(e){return ee("/api/litellm-api/providers",{method:"POST",body:JSON.stringify(e)})}async function iae(e,t){return ee(`/api/litellm-api/providers/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}async function oae(e){return ee(`/api/litellm-api/providers/${encodeURIComponent(e)}`,{method:"DELETE"})}async function sae(e){return ee(`/api/litellm-api/providers/${encodeURIComponent(e)}/test`,{method:"POST"})}async function aae(e){return ee(`/api/litellm-api/providers/${encodeURIComponent(e)}/health-check-now`,{method:"POST"})}async function lae(){return ee("/api/litellm-api/endpoints")}async function cae(e){return ee("/api/litellm-api/endpoints",{method:"POST",body:JSON.stringify(e)})}async function uae(e,t){return ee(`/api/litellm-api/endpoints/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}async function dae(e){return ee(`/api/litellm-api/endpoints/${encodeURIComponent(e)}`,{method:"DELETE"})}async function fae(){return ee("/api/litellm-api/cache/stats")}async function hae(){return ee("/api/litellm-api/cache/clear",{method:"POST"})}async function pae(e){return ee("/api/litellm-api/config/cache",{method:"PUT",body:JSON.stringify(e)})}async function mae(){return ee("/api/litellm-api/model-pools")}async function gae(e){return ee("/api/litellm-api/model-pools",{method:"POST",body:JSON.stringify(e)})}async function vae(e,t){return ee(`/api/litellm-api/model-pools/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}async function yae(e){return ee(`/api/litellm-api/model-pools/${encodeURIComponent(e)}`,{method:"DELETE"})}async function bae(e){return ee(`/api/litellm-api/model-pools/available-models/${encodeURIComponent(e)}`)}async function _ae(e,t){return ee(`/api/litellm-api/model-pools/discover/${encodeURIComponent(e)}/${encodeURIComponent(t)}`)}async function xae(){return ee("/api/litellm-api/config/sync",{method:"POST"})}async function wae(e=!1){return ee(`/api/litellm-api/ccw-litellm/status${e?"?refresh=true":""}`)}async function Sae(){return ee("/api/litellm-api/ccw-litellm/install",{method:"POST"})}async function Cae(){return ee("/api/litellm-api/ccw-litellm/uninstall",{method:"POST"})}async function Eae(){return ee("/api/cli/settings")}async function kae(e){return ee("/api/cli/settings",{method:"POST",body:JSON.stringify(e)})}async function Tae(e,t){return ee(`/api/cli/settings/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}async function Pae(e){return ee(`/api/cli/settings/${encodeURIComponent(e)}`,{method:"DELETE"})}async function Aae(e,t){return ee(`/api/cli/settings/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify({enabled:t})})}async function Oae(){return ee("/api/cli/settings/codex/preview")}async function Iae(){return ee("/api/cli/settings/gemini/preview")}async function Rae(e,t){return ee(mn("/api/orchestrator/flows",t),{method:"POST",body:JSON.stringify(e)})}async function Nae(e,t,r){return ee(mn(`/api/orchestrator/flows/${encodeURIComponent(e)}/execute`,r),{method:"POST",body:JSON.stringify(t??{})})}async function Mae(){return ee("/api/language/chinese-response")}async function jae(e,t="claude"){return ee("/api/language/chinese-response",{method:"POST",body:JSON.stringify({enabled:e,target:t})})}async function Dae(){return ee("/api/language/windows-platform")}async function Lae(e){return ee("/api/language/windows-platform",{method:"POST",body:JSON.stringify({enabled:e})})}async function $ae(){return ee("/api/language/codex-cli-enhancement")}async function Bae(e){return ee("/api/language/codex-cli-enhancement",{method:"POST",body:JSON.stringify({enabled:e})})}async function Fae(){return ee("/api/language/codex-cli-enhancement",{method:"POST",body:JSON.stringify({action:"refresh"})})}async function zae(){return ee("/api/status/all")}async function Uae(){return ee("/api/cli/status")}async function Hae(){return ee("/api/ccw/installations")}async function qae(e){return ee("/api/ccw/upgrade",{method:"POST",body:JSON.stringify({path:e})})}async function Wae(){return ee("/api/cli/settings/export")}async function Vae(e,t){return ee("/api/cli/settings/import",{method:"POST",body:JSON.stringify({data:e,options:t})})}async function Gae(){return(await ee("/api/ccw/tools")).tools}async function Kae(e){const t=new URLSearchParams;e&&t.set("location",e);const r=t.toString();return ee(`/api/teams${r?`?${r}`:""}`)}async function Xae(e){return ee(`/api/teams/${encodeURIComponent(e)}/archive`,{method:"POST"})}async function Zae(e){return ee(`/api/teams/${encodeURIComponent(e)}/unarchive`,{method:"POST"})}async function Qae(e){return ee(`/api/teams/${encodeURIComponent(e)}`,{method:"DELETE"})}async function Yae(e,t){const r=new URLSearchParams;t!=null&&t.from&&r.set("from",t.from),t!=null&&t.to&&r.set("to",t.to),t!=null&&t.type&&r.set("type",t.type),r.set("last",String(t.last));const n=r.toString();return ee(`/api/teams/${encodeURIComponent(e)}/messages${n?`?${n}`:""}`)}async function Jae(e){return ee(`/api/teams/${encodeURIComponent(e)}/status`)}async function ele(e){return ee(`/api/teams/${encodeURIComponent(e)}/artifacts`)}async function tle(e,t){return ee(`/api/teams/${encodeURIComponent(e)}/artifacts/${encodeURIComponent(t)}`)}function mn(e,t){if(!t)return e;const r=e.includes("?")?"&":"?";return`${e}${r}path=${encodeURIComponent(t)}`}async function zU(e){return ee(mn("/api/cli-sessions",e))}async function C0(e,t){return ee(mn("/api/cli-sessions",t),{method:"POST",body:JSON.stringify(e)})}async function UU(e,t){return ee(mn(`/api/cli-sessions/${encodeURIComponent(e)}/buffer`,t))}async function lA(e,t,r){return ee(mn(`/api/cli-sessions/${encodeURIComponent(e)}/send`,r),{method:"POST",body:JSON.stringify(t)})}async function rle(e,t,r){return ee(mn(`/api/cli-sessions/${encodeURIComponent(e)}/execute`,r),{method:"POST",body:JSON.stringify(t)})}async function HU(e,t,r){return ee(mn(`/api/cli-sessions/${encodeURIComponent(e)}/resize`,r),{method:"POST",body:JSON.stringify(t)})}async function Gv(e,t){return ee(mn(`/api/cli-sessions/${encodeURIComponent(e)}/close`,t),{method:"POST",body:JSON.stringify({})})}async function qU(e,t){return ee(mn(`/api/cli-sessions/${encodeURIComponent(e)}/pause`,t),{method:"POST",body:JSON.stringify({})})}async function WU(e,t){return ee(mn(`/api/cli-sessions/${encodeURIComponent(e)}/resume`,t),{method:"POST",body:JSON.stringify({})})}async function nle(e){const t=new URLSearchParams;if(e!=null&&e.sessionKey&&t.set("sessionKey",e.sessionKey),e!=null&&e.q&&t.set("q",e.q),typeof(e==null?void 0:e.limit)=="number"&&t.set("limit",String(e.limit)),typeof(e==null?void 0:e.offset)=="number"&&t.set("offset",String(e.offset)),e!=null&&e.type){const n=Array.isArray(e.type)?e.type:[e.type];t.set("type",n.join(","))}const r=t.toString();return ee(mn(`/api/audit/cli-sessions${r?`?${r}`:""}`,e==null?void 0:e.projectPath))}async function ile(e,t,r){const n=new URLSearchParams;n.set("q",e),n.set("topK",String(t.topK)),t!=null&&t.minScore&&n.set("minScore",String(t.minScore)),t!=null&&t.category&&n.set("category",t.category);const i=await ee(mn(`/api/unified-memory/search?${n.toString()}`,r));if(i.success===!1)throw new Error(i.error||"Search failed");return i}async function ole(e){const t=await ee(mn("/api/unified-memory/stats",e));if(t.success===!1)throw new Error(t.error||"Failed to load unified stats");return t}async function sle(e,t,r){const n=new URLSearchParams;t&&n.set("limit",String(t));const i=n.toString(),o=await ee(mn(`/api/unified-memory/recommendations/${encodeURIComponent(e)}${i?`?${i}`:""}`,r));if(o.success===!1)throw new Error(o.error||"Failed to load recommendations");return o}async function ale(e){return ee("/api/unified-memory/reindex",{method:"POST",body:JSON.stringify({path:e})})}async function lle(){return ee("/api/system/settings")}async function cle(e,t){return ee("/api/system/hooks/install-recommended",{method:"POST",body:JSON.stringify({hookIds:e,scope:t})})}async function ule(e){const t=e?`/api/specs/stats?path=${encodeURIComponent(e)}`:"/api/specs/stats";return ee(t)}async function dle(e){const t=e?`/api/specs/list?path=${encodeURIComponent(e)}`:"/api/specs/list";return ee(t)}async function fle(e){const t=e?`/api/specs/rebuild?path=${encodeURIComponent(e)}`:"/api/specs/rebuild";return ee(t,{method:"POST"})}async function hle(e="required",t=!1,r,n){const i=new URLSearchParams;return i.set("mode",e),i.set("preview",String(t)),n&&i.set("category",n),ee(`/api/specs/injection-preview?${i.toString()}`)}const ple=[{command:"ccw spec load",labelKey:"default",descriptionKey:"default",mode:"required"},{command:"ccw spec load --category exploration",labelKey:"exploration",descriptionKey:"exploration",category:"exploration",mode:"required"},{command:"ccw spec load --category planning",labelKey:"planning",descriptionKey:"planning",category:"planning",mode:"required"},{command:"ccw spec load --category execution",labelKey:"execution",descriptionKey:"execution",category:"execution",mode:"required"},{command:"ccw spec load --category general",labelKey:"general",descriptionKey:"general",category:"general",mode:"required"}];async function mle(e,t){const n=new URLSearchParams().toString(),i=n?`${mn("/api/analysis",e)}&${n}`:mn("/api/analysis",e),o=await ee(i);if(!o.success)throw new Error(o.error||"Failed to fetch analysis sessions");return o.data}async function gle(e,t){const r=await ee(mn(`/api/analysis/${encodeURIComponent(e)}`,t));if(!r.success)throw new Error(r.error||"Failed to fetch analysis detail");return r.data}const Kze=Object.freeze(Object.defineProperty({__proto__:null,COMMAND_PREVIEWS:ple,activateQueue:yU,addCodexMcpServer:S0,addGlobalMcpServer:rse,analyzePrompts:mse,archiveMemory:Yie,archiveSession:oU,archiveTeam:Xae,batchDeletePrompts:yse,bootstrapCodexLens:Tse,buildFlowControl:yoe,bulkUpdateTaskStatus:foe,cancelCodexLensIndexing:Qse,checkCcwLitellmStatus:wae,checkCodexLensIndexingStatus:Yse,clearCache:hae,closeCliSession:Gv,codexRemoveServer:$U,codexToggleServer:koe,copyMcpServerToProject:nse,createCliEndpoint:Boe,createCliSession:C0,createCliSettings:kae,createCommand:Gie,createEndpoint:cae,createIssue:hU,createMcpServer:Soe,createMemory:Xie,createModelPool:gae,createOrchestratorFlow:Rae,createProvider:nae,createRule:ese,createSkill:zie,crossCliCopy:Doe,deactivateQueue:bU,deleteAllHistory:doe,deleteCliEndpoint:Foe,deleteCliSettings:Pae,deleteCodexLensModel:Nse,deleteCodexLensModelByPath:Mse,deleteEndpoint:dae,deleteExecution:coe,deleteExecutionsByTool:uoe,deleteHook:Zoe,deleteInsight:vse,deleteIssue:mU,deleteMcpServer:Coe,deleteMcpTemplate:Aoe,deleteMemory:Qie,deleteModelPool:yae,deletePrompt:gse,deleteProvider:oae,deleteQueue:wU,deleteRule:tse,deleteSession:sU,deleteSkill:Bie,deleteTeam:Qae,disableSkill:Lie,discoverModelsForPool:_ae,downloadCodexLensCustomModel:Rse,downloadCodexLensModel:Ise,enableSkill:Die,executeInCliSession:rle,executeOrchestratorFlow:Nae,exportDiscoveryFindingsAsIssues:TU,exportSettings:Wae,fetchAggregatedStatus:zae,fetchAllProjects:Moe,fetchAnalysisDetail:gle,fetchAnalysisSessions:mle,fetchArtifactContent:tle,fetchCacheStats:fae,fetchCcwInstallations:Hae,fetchCcwMcpConfig:sA,fetchCcwMcpConfigForCodex:aA,fetchCcwTools:Gae,fetchChineseResponseStatus:Mae,fetchCliEndpoints:Loe,fetchCliInstallations:Uoe,fetchCliSessionAudit:nle,fetchCliSessionBuffer:UU,fetchCliSessions:zU,fetchCliSettings:Eae,fetchCliToolStatus:Uae,fetchCodexCliEnhancementStatus:$ae,fetchCodexConfigPreview:Oae,fetchCodexLensConfig:Ese,fetchCodexLensDashboardInit:Cse,fetchCodexLensEnv:jse,fetchCodexLensIgnorePatterns:Bse,fetchCodexLensLspStatus:qse,fetchCodexLensModels:Ose,fetchCodexLensWatcherStatus:Jse,fetchCodexMcpServers:LU,fetchCommands:Hie,fetchDashboardStats:iU,fetchDiscoveries:EU,fetchDiscoveryFindings:kU,fetchEndpoints:lae,fetchExecutionDetail:OU,fetchFileContent:_se,fetchFileTree:bse,fetchGeminiConfigPreview:Iae,fetchGraphDependencies:Sse,fetchHistory:loe,fetchHooks:Goe,fetchIndexStatus:FU,fetchInsightDetail:pse,fetchInsightsHistory:hse,fetchIssueHistory:dU,fetchIssueQueue:fU,fetchIssues:uU,fetchLiteSessionContext:boe,fetchLiteTaskSession:RU,fetchLiteTasks:oA,fetchMcpConfig:Tc,fetchMcpServers:w0,fetchMcpTemplateCategories:Roe,fetchMcpTemplates:Toe,fetchMcpTemplatesByCategory:Noe,fetchMemories:Kie,fetchModelPools:mae,fetchNativeSession:poe,fetchNativeSessionWithOptions:moe,fetchNativeSessions:goe,fetchOtherProjectsServers:joe,fetchProjectOverview:PU,fetchPromptInsights:fse,fetchPrompts:dse,fetchProviders:rae,fetchQueueById:vU,fetchQueueHistory:gU,fetchRecentPaths:aU,fetchRecommendations:sle,fetchReviewSession:_oe,fetchReviewSessions:NU,fetchRootDirectories:wse,fetchRules:Qoe,fetchSessionDetail:aoe,fetchSessions:iA,fetchSkillDetail:$ie,fetchSkills:jie,fetchTeamArtifacts:ele,fetchTeamMessages:Yae,fetchTeamStatus:Jae,fetchTeams:Kae,fetchUnifiedSearch:ile,fetchUnifiedStats:ole,fetchWindowsPlatformStatus:Dae,getAvailableModelsForPool:bae,getConsolidationStatus:noe,getExtractionStatus:toe,getInjectionPreview:hle,getSpecStats:ule,getSpecsList:dle,getSystemSettings:lle,getV2Jobs:ioe,importSettings:Vae,initializeCsrfToken:nU,installCcwLitellm:Sae,installCcwMcp:ose,installCcwMcpToCodex:lse,installCliTool:Hoe,installCodexLensSemantic:Pse,installMcpTemplate:Ooe,installRecommendedHooks:cle,isHttpMcpServer:xoe,isStdioMcpServer:MU,mergeQueues:SU,moveQueueItem:xU,normalizeTask:IU,pauseCliSession:qU,previewExtractionQueue:ooe,pullIssuesFromGitHub:Mie,readSkillFile:Uie,rebuildCodexLensIndex:Xse,rebuildSpecIndex:fle,refreshCodexCliEnhancement:Fae,removeRecentPath:lU,reorderQueueGroup:_U,resetCodexLensGpu:$se,resizeCliSession:HU,restartCodexLensLsp:Gse,resumeCliSession:WU,saveHook:Xoe,saveMcpTemplate:Poe,searchCodexLens:zse,searchFiles:xse,searchFilesCodexLens:Use,searchMcpTemplates:Ioe,searchSymbolCodexLens:Hse,selectCodexLensGpu:Lse,semanticSearchCodexLens:Kse,sendCliSessionText:lA,splitQueue:CU,startCodexLensLsp:Wse,startCodexLensWatcher:eae,stopCodexLensLsp:Vse,stopCodexLensWatcher:tae,switchWorkspace:cU,syncApiConfig:xae,testProvider:sae,toggleChineseResponse:jae,toggleCliEndpoint:zoe,toggleCliSettingsEnabled:Aae,toggleCodexCliEnhancement:Bae,toggleCommand:qie,toggleCommandGroup:Wie,toggleHook:Koe,toggleMcpServer:Eoe,toggleRule:Joe,toggleWindowsPlatform:Lae,triggerConsolidation:roe,triggerExtraction:eoe,triggerProviderHealthCheck:aae,triggerReindex:ale,triggerSelectiveExtraction:soe,unarchiveMemory:Jie,unarchiveTeam:Zae,uninstallCcwLitellm:Cae,uninstallCcwMcp:sse,uninstallCcwMcpFromCodex:cse,uninstallCcwMcpFromScope:ase,uninstallCliTool:qoe,uninstallCodexLens:Ase,updateCacheSettings:pae,updateCcwConfig:ise,updateCcwConfigForCodex:use,updateCliEndpoint:$oe,updateCliSettings:Tae,updateCodexLensConfig:kse,updateCodexLensEnv:Dse,updateCodexLensIgnorePatterns:Fse,updateCodexLensIndex:Zse,updateEndpoint:uae,updateIssue:pU,updateMcpServer:woe,updateMemory:Zie,updateModelPool:vae,updateProjectGuidelines:AU,updateProvider:iae,updateRule:Yoe,updateTaskStatus:hoe,upgradeCcwInstallation:qae,upgradeCliTool:Woe,uploadAttachments:Nie,validateCommandImport:Vie,validateSkillImport:Fie},Symbol.toStringTag,{value:"Module"})),VU="ccw-workflow-store",vle=()=>{var e;try{const t=localStorage.getItem(VU);if(t){const r=JSON.parse(t);return((e=r==null?void 0:r.state)==null?void 0:e.projectPath)||""}}catch{}return""},yle=e=>{try{localStorage.setItem(VU,JSON.stringify({state:{projectPath:e},version:1}))}catch{}},Wo=e=>`session-${e}`.replace(/[^a-zA-Z0-9-]/g,"-"),GU={status:null,search:"",dateRange:{start:null,end:null}},KU={field:"created_at",direction:"desc"},ble={workflowData:{activeSessions:[],archivedSessions:[]},projectPath:vle(),recentPaths:[],serverPlatform:"win32",sessionDataStore:{},liteTaskDataStore:{},taskJsonStore:{},activeSessionId:null,filters:GU,sorting:KU},At=gn()(im((e,t)=>({...ble,setSessions:(r,n)=>{const i={};[...r,...n].forEach(o=>{const s=Wo(o.session_id);i[s]=o}),e({workflowData:{activeSessions:r,archivedSessions:n},sessionDataStore:i},!1)},addSession:r=>{const n=Wo(r.session_id);e(i=>({workflowData:{...i.workflowData,activeSessions:[...i.workflowData.activeSessions,r]},sessionDataStore:{...i.sessionDataStore,[n]:r}}),!1)},updateSession:(r,n)=>{const i=Wo(r);e(o=>{const s=o.sessionDataStore[i];if(!s)return o;const a={...s,...n,updated_at:new Date().toISOString()},c=s.location==="active"?"activeSessions":"archivedSessions";return{sessionDataStore:{...o.sessionDataStore,[i]:a},workflowData:{...o.workflowData,[c]:o.workflowData[c].map(d=>d.session_id===r?a:d)}}},!1)},removeSession:r=>{const n=Wo(r);e(i=>{const{[n]:o,...s}=i.sessionDataStore;return{sessionDataStore:s,workflowData:{activeSessions:i.workflowData.activeSessions.filter(a=>a.session_id!==r),archivedSessions:i.workflowData.archivedSessions.filter(a=>a.session_id!==r)}}},!1)},archiveSession:r=>{const n=Wo(r);e(i=>{const o=i.sessionDataStore[n];if(!o||o.location==="archived")return i;const s={...o,location:"archived",status:"archived",updated_at:new Date().toISOString()};return{sessionDataStore:{...i.sessionDataStore,[n]:s},workflowData:{activeSessions:i.workflowData.activeSessions.filter(a=>a.session_id!==r),archivedSessions:[...i.workflowData.archivedSessions,s]}}},!1)},addTask:(r,n)=>{const i=Wo(r);e(o=>{var c;const s=o.sessionDataStore[i];if(!s||((c=s.tasks)==null?void 0:c.find(d=>d.task_id===n.task_id)))return o;const l={...s,tasks:[...s.tasks||[],n],updated_at:new Date().toISOString()};return{sessionDataStore:{...o.sessionDataStore,[i]:l}}},!1)},updateTask:(r,n,i)=>{const o=Wo(r);e(s=>{const a=s.sessionDataStore[o];if(!(a!=null&&a.tasks))return s;const l=a.tasks.map(d=>d.task_id===n?{...d,...i,updated_at:new Date().toISOString()}:d),c={...a,tasks:l,updated_at:new Date().toISOString()};return{sessionDataStore:{...s.sessionDataStore,[o]:c}}},!1)},removeTask:(r,n)=>{const i=Wo(r);e(o=>{const s=o.sessionDataStore[i];if(!(s!=null&&s.tasks))return o;const a={...s,tasks:s.tasks.filter(l=>l.task_id!==n),updated_at:new Date().toISOString()};return{sessionDataStore:{...o.sessionDataStore,[i]:a}}},!1)},setLiteTaskSession:(r,n)=>{e(i=>({liteTaskDataStore:{...i.liteTaskDataStore,[r]:n}}),!1)},removeLiteTaskSession:r=>{e(n=>{const{[r]:i,...o}=n.liteTaskDataStore;return{liteTaskDataStore:o}},!1)},setTaskJson:(r,n)=>{e(i=>({taskJsonStore:{...i.taskJsonStore,[r]:n}}),!1)},removeTaskJson:r=>{e(n=>{const{[r]:i,...o}=n.taskJsonStore;return{taskJsonStore:o}},!1)},setActiveSessionId:r=>{e({activeSessionId:r},!1)},setProjectPath:r=>{e({projectPath:r},!1)},addRecentPath:r=>{e(n=>{const i=n.recentPaths.filter(s=>s!==r);return{recentPaths:[r,...i].slice(0,10)}},!1)},setServerPlatform:r=>{e({serverPlatform:r},!1)},switchWorkspace:async r=>{const n=await cU(r),i={};[...n.activeSessions,...n.archivedSessions].forEach(s=>{const a=Wo(s.session_id);i[a]=s}),e({projectPath:n.projectPath,recentPaths:n.recentPaths,workflowData:{activeSessions:n.activeSessions,archivedSessions:n.archivedSessions},sessionDataStore:i},!1),yle(n.projectPath);const o=t()._invalidateQueriesCallback;o&&o()},removeRecentPath:async r=>{const n=await lU(r);e({recentPaths:n},!1)},refreshRecentPaths:async()=>{const r=await aU();e({recentPaths:r},!1)},registerQueryInvalidator:r=>{e({_invalidateQueriesCallback:r},!1)},setFilters:r=>{e(n=>({filters:{...n.filters,...r}}),!1)},setSorting:r=>{e(n=>({sorting:{...n.sorting,...r}}),!1)},resetFilters:()=>{e({filters:GU,sorting:KU},!1)},getActiveSession:()=>{const{activeSessionId:r,sessionDataStore:n}=t();if(!r)return null;const i=Wo(r);return n[i]||null},getFilteredSessions:()=>{const{workflowData:r,filters:n,sorting:i}=t();let o=[...r.activeSessions,...r.archivedSessions];if(n.status&&n.status.length>0&&(o=o.filter(s=>n.status.includes(s.status))),n.search){const s=n.search.toLowerCase();o=o.filter(a=>{var l,c;return a.session_id.toLowerCase().includes(s)||((l=a.title)==null?void 0:l.toLowerCase().includes(s))||((c=a.description)==null?void 0:c.toLowerCase().includes(s))})}return(n.dateRange.start||n.dateRange.end)&&(o=o.filter(s=>{const a=new Date(s.created_at);return!(n.dateRange.start&&a<n.dateRange.start||n.dateRange.end&&a>n.dateRange.end)})),o.sort((s,a)=>{let l=0;switch(i.field){case"created_at":l=new Date(s.created_at).getTime()-new Date(a.created_at).getTime();break;case"updated_at":l=new Date(s.updated_at||s.created_at).getTime()-new Date(a.updated_at||a.created_at).getTime();break;case"title":l=(s.title||s.session_id).localeCompare(a.title||a.session_id);break;case"status":l=s.status.localeCompare(a.status);break}return i.direction==="desc"?-l:l}),o},getSessionByKey:r=>t().sessionDataStore[r]}),{name:"ccw-workflow-store",partialize:e=>({projectPath:e.projectPath}),skipHydration:!0})),sr=e=>e.projectPath,_le={gemini:{enabled:!0,tags:["analysis","debug"],type:"builtin"},qwen:{enabled:!0,tags:[],type:"builtin"},codex:{enabled:!0,tags:[],type:"builtin"},claude:{enabled:!0,tags:[],type:"builtin"},opencode:{enabled:!0,tags:[],type:"builtin"}},XU={base:"/api",sessions:"/api/sessions",tasks:"/api/tasks",loops:"/api/loops",issues:"/api/issues",orchestrator:"/api/orchestrator"},ZU={autoRefresh:!0,refreshInterval:3e4,notificationsEnabled:!0,soundEnabled:!1,compactView:!1,showCompletedTasks:!0,defaultSessionFilter:"all",defaultSortField:"created_at",defaultSortDirection:"desc"},QU={dialogStyle:"modal",smartModeEnabled:!0,autoSelectionDuration:30,autoSelectionSoundEnabled:!1,pauseOnInteraction:!0,showA2UIButtonInToolbar:!0,drawerSide:"right",drawerSize:"md"},xle={cliTools:_le,defaultCliTool:"gemini",apiEndpoints:XU,userPreferences:ZU,a2uiPreferences:QU,featureFlags:{orchestratorEnabled:!0,darkModeEnabled:!0,notificationsEnabled:!0,experimentalFeatures:!1,dashboardQueuePanelEnabled:!1,dashboardInspectorEnabled:!1,dashboardExecutionMonitorEnabled:!1}};function wle(){var e;if(typeof window>"u"||!((e=window.location)!=null&&e.origin))return null;try{return new URL("/api/cli/config",window.location.origin).toString()}catch{return null}}function Sle(e){var o;const t=(o=e==null?void 0:e.config)==null?void 0:o.tools;if(!t||typeof t!="object")return null;const r=["builtin","cli-wrapper","api-endpoint"],n=s=>typeof s=="string"&&r.includes(s),i={};for(const[s,a]of Object.entries(t)){const l=a;i[s]={enabled:typeof l.enabled=="boolean"?l.enabled:!1,primaryModel:typeof l.primaryModel=="string"?l.primaryModel:"",secondaryModel:typeof l.secondaryModel=="string"?l.secondaryModel:"",tags:Array.isArray(l.tags)?l.tags.filter(c=>typeof c=="string"):[],type:n(l.type)?l.type:"builtin",envFile:typeof l.envFile=="string"?l.envFile:void 0,settingsFile:typeof l.settingsFile=="string"?l.settingsFile:void 0,availableModels:Array.isArray(l.availableModels)?l.availableModels.filter(c=>typeof c=="string"):void 0}}return Object.keys(i).length>0?i:null}let ih=null;async function Cle(e=!1){return!e&&ih||(ih=(async()=>{const t=wle();if(!t)return;const n=await(await fetch(t)).json(),i=Sle(n);i&&kk.getState().loadConfig({cliTools:i})})().catch(t=>{console.warn("[ConfigStore] Backend config sync failed, using local state:",t)}).finally(()=>{ih=null})),ih}const kk=gn()(En(im((e,t)=>({...xle,setCliTools:r=>{e({cliTools:r},!1,"setCliTools")},updateCliTool:(r,n)=>{e(i=>({cliTools:{...i.cliTools,[r]:{...i.cliTools[r],...n}}}),!1,"updateCliTool")},setDefaultCliTool:r=>{var i;const{cliTools:n}=t();(i=n[r])!=null&&i.enabled&&e({defaultCliTool:r},!1,"setDefaultCliTool")},setApiEndpoints:r=>{e(n=>({apiEndpoints:{...n.apiEndpoints,...r}}),!1,"setApiEndpoints")},setUserPreferences:r=>{e(n=>({userPreferences:{...n.userPreferences,...r}}),!1,"setUserPreferences")},resetUserPreferences:()=>{e({userPreferences:ZU},!1,"resetUserPreferences")},setA2uiPreferences:r=>{e({a2uiPreferences:r},!1,"setA2uiPreferences")},resetA2uiPreferences:()=>{e({a2uiPreferences:QU},!1,"resetA2uiPreferences")},setFeatureFlag:(r,n)=>{e(i=>({featureFlags:{...i.featureFlags,[r]:n}}),!1,"setFeatureFlag")},loadConfig:r=>{e(n=>({...n,...r,cliTools:r.cliTools||n.cliTools,apiEndpoints:{...n.apiEndpoints,...r.apiEndpoints||{}},userPreferences:{...n.userPreferences,...r.userPreferences||{}},featureFlags:{...n.featureFlags,...r.featureFlags||{}}}),!1,"loadConfig")}}),{name:"ccw-config-store",version:1,migrate:(e,t)=>t===0?{...e,apiEndpoints:e.apiEndpoints||XU}:e,partialize:e=>({cliTools:e.cliTools,defaultCliTool:e.defaultCliTool,apiEndpoints:e.apiEndpoints,userPreferences:e.userPreferences,featureFlags:e.featureFlags})}),{name:"ConfigStore"})),Xze=e=>e.cliTools,Zze=e=>e.defaultCliTool,Qze=e=>e.userPreferences,cA="ccw_notifications",Ele=100,kle=10080*60*1e3,Tle=[/\b[A-Za-z0-9_-]{20,}\b/g,/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi,/\b[A-Za-z0-9+/=]{32,}={0,2}\b/g],Ple=e=>{const t=r=>{if(!r)return null;let n=r;for(const o of Tle)n=n.replace(o,"[REDACTED]");const i=500;return n.length>i&&(n=n.substring(0,i)+"..."),n};return{...e,title:t(e.title)||e.title,message:t(e.message)||e.message,a2uiSurface:void 0,a2uiState:void 0}},Zx=()=>`toast-${Date.now()}-${Math.random().toString(36).substring(2,11)}`,YU=()=>{if(typeof window>"u")return[];try{const e=localStorage.getItem(cA);if(e){const t=JSON.parse(e),r=Date.now()-kle;return t.filter(n=>new Date(n.timestamp).getTime()>r)}}catch(e){console.error("[NotificationStore] Failed to load from storage:",e)}return[]},cu=e=>{if(!(typeof window>"u"))try{const r=e.slice(0,Ele).map(Ple);localStorage.setItem(cA,JSON.stringify(r))}catch(t){console.error("[NotificationStore] Failed to save to storage:",t)}},Ale={toasts:[],maxToasts:5,wsStatus:"disconnected",wsLastMessage:null,wsReconnectAttempts:0,isPanelVisible:!1,persistentNotifications:[],a2uiSurfaces:new Map,currentQuestion:null,currentPopupCard:null,actionStates:new Map},ct=gn()(En((e,t)=>({...Ale,addToast:r=>{const n=Zx(),i={...r,id:n,timestamp:new Date().toISOString(),dismissible:r.dismissible??!0,duration:r.duration??5e3};return e(o=>{const{maxToasts:s}=o;let a=[...o.toasts,i];return a.length>s&&(a=a.slice(-s)),{toasts:a}},!1,"addToast"),i.duration&&i.duration>0&&setTimeout(()=>{t().removeToast(n)},i.duration),n},removeToast:r=>{e(n=>({toasts:n.toasts.filter(i=>i.id!==r)}),!1,"removeToast")},clearAllToasts:()=>{e({toasts:[]},!1,"clearAllToasts")},setWsStatus:r=>{e({wsStatus:r},!1,"setWsStatus")},setWsLastMessage:r=>{e({wsLastMessage:r},!1,"setWsLastMessage")},incrementReconnectAttempts:()=>{e(r=>({wsReconnectAttempts:r.wsReconnectAttempts+1}),!1,"incrementReconnectAttempts")},resetReconnectAttempts:()=>{e({wsReconnectAttempts:0},!1,"resetReconnectAttempts")},togglePanel:()=>{e(r=>({isPanelVisible:!r.isPanelVisible}),!1,"togglePanel")},setPanelVisible:r=>{e({isPanelVisible:r},!1,"setPanelVisible")},addPersistentNotification:r=>{const n=Zx(),i={...r,id:n,timestamp:new Date().toISOString(),dismissible:r.dismissible??!0};e(s=>({persistentNotifications:[i,...s.persistentNotifications]}),!1,"addPersistentNotification");const o=t();cu(o.persistentNotifications)},removePersistentNotification:r=>{e(i=>({persistentNotifications:i.persistentNotifications.filter(o=>o.id!==r)}),!1,"removePersistentNotification");const n=t();cu(n.persistentNotifications)},clearPersistentNotifications:()=>{e({persistentNotifications:[]},!1,"clearPersistentNotifications"),typeof window<"u"&&localStorage.removeItem(cA)},loadPersistentNotifications:()=>{const r=YU();e({persistentNotifications:r},!1,"loadPersistentNotifications")},savePersistentNotifications:()=>{const r=t();cu(r.persistentNotifications)},markAllAsRead:()=>{e(n=>({persistentNotifications:n.persistentNotifications.map(i=>({...i,read:!0}))}),!1,"markAllAsRead");const r=t();cu(r.persistentNotifications)},toggleNotificationRead:r=>{e(n=>{const i=n.toasts.findIndex(a=>a.id===r),o=n.persistentNotifications.findIndex(a=>a.id===r);if(i===-1&&o===-1)return n;const s={...n};if(i!==-1){const a=[...n.toasts];a[i]={...a[i],read:!a[i].read},s.toasts=a}if(o!==-1){const a=[...n.persistentNotifications];a[o]={...a[o],read:!a[o].read},s.persistentNotifications=a,cu(a)}return s},!1,"toggleNotificationRead")},setActionState:(r,n)=>{e(i=>{const o=new Map(i.actionStates);return o.set(r,n),{actionStates:o}},!1,"setActionState")},executeAction:async(r,n,i)=>{const o=i||`${n}-${r.label}`,s=t(),a=s.actionStates.get(o);if((a==null?void 0:a.status)==="loading"||r.disabled)return;const l=new Map(s.actionStates);l.set(o,{status:"loading",lastAttempt:new Date().toISOString()}),e({actionStates:l});try{await r.onClick();const c=new Map(t().actionStates);c.set(o,{status:"success",lastAttempt:new Date().toISOString()}),e({actionStates:c})}catch(c){const d=new Map(t().actionStates);d.set(o,{status:"error",error:c instanceof Error?c.message:String(c),lastAttempt:new Date().toISOString()}),e({actionStates:d})}},retryAction:async r=>{if(!t().actionStates.get(r)){console.warn(`[NotificationStore] No action state found for key: ${r}`);return}t().setActionState(r,{status:"idle",lastAttempt:new Date().toISOString()})},addA2UINotification:(r,n="A2UI Surface")=>{if(r.displayMode==="popup")return e(a=>{const l=new Map(a.a2uiSurfaces);return l.set(r.surfaceId,r),{currentPopupCard:r,a2uiSurfaces:l}},!1,"addA2UINotification (popup)"),r.surfaceId;const i=Zx(),o={id:i,type:"a2ui",title:n,timestamp:new Date().toISOString(),dismissible:!0,duration:0,a2uiSurface:r,a2uiState:r.initialState||{},read:!1};e(a=>{const l=new Map(a.a2uiSurfaces);return l.set(r.surfaceId,r),{persistentNotifications:[o,...a.persistentNotifications],a2uiSurfaces:l,isPanelVisible:!0}},!1,"addA2UINotification (panel)");const s=t();return cu(s.persistentNotifications),i},updateA2UIState:(r,n)=>{e(i=>{const o=new Map(i.a2uiSurfaces),s=o.get(r);s&&o.set(r,{...s,initialState:{...s.initialState,...n}});const a=i.toasts.map(c=>c.a2uiSurface&&c.a2uiSurface.surfaceId===r?{...c,a2uiState:{...c.a2uiState,...n},a2uiSurface:s?{...c.a2uiSurface,initialState:{...c.a2uiSurface.initialState,...n}}:c.a2uiSurface}:c),l=i.persistentNotifications.map(c=>c.a2uiSurface&&c.a2uiSurface.surfaceId===r?{...c,a2uiState:{...c.a2uiState,...n},a2uiSurface:s?{...c.a2uiSurface,initialState:{...c.a2uiSurface.initialState,...n}}:c.a2uiSurface}:c);return{toasts:a,persistentNotifications:l,a2uiSurfaces:o}},!1,"updateA2UIState")},sendA2UIAction:(r,n,i={})=>{const o=new CustomEvent("a2ui-action",{detail:{type:"a2ui-action",actionId:r,surfaceId:n,parameters:i}});window.dispatchEvent(o)},setCurrentQuestion:r=>{e({currentQuestion:r},!1,"setCurrentQuestion")},setCurrentPopupCard:r=>{e({currentPopupCard:r},!1,"setCurrentPopupCard")}}),{name:"NotificationStore"}));if(typeof window<"u"){const e=YU();e.length>0&&ct.setState({persistentNotifications:e})}const Ole=e=>e.toasts,Ile=e=>e.wsStatus,JU=e=>e.wsLastMessage,Rle=e=>e.isPanelVisible,eH=e=>e.persistentNotifications,Nle=e=>e.currentQuestion,Mle=e=>e.currentPopupCard,Yze={info:(e,t)=>ct.getState().addToast({type:"info",title:e,message:t}),success:(e,t)=>ct.getState().addToast({type:"success",title:e,message:t}),warning:(e,t)=>ct.getState().addToast({type:"warning",title:e,message:t}),error:(e,t)=>ct.getState().addToast({type:"error",title:e,message:t,duration:0})};function jle(){const e=ct(Ole),t=ct(Ile),r=ct(JU),n=ct(Rle),i=ct(eH),o=ct(U=>U.addToast),s=ct(U=>U.removeToast),a=ct(U=>U.clearAllToasts),l=ct(U=>U.setWsStatus),c=ct(U=>U.setWsLastMessage),d=ct(U=>U.togglePanel),u=ct(U=>U.setPanelVisible),p=ct(U=>U.addPersistentNotification),g=ct(U=>U.removePersistentNotification),_=ct(U=>U.clearPersistentNotifications),y=t==="connected",m=O.useCallback((U,q,V,K)=>o({type:U,title:q,message:V,duration:K==null?void 0:K.duration,dismissible:K==null?void 0:K.dismissible,action:K==null?void 0:K.action}),[o]),v=O.useCallback((U,q)=>m("info",U,q),[m]),b=O.useCallback((U,q)=>m("success",U,q),[m]),x=O.useCallback((U,q)=>m("warning",U,q),[m]),E=O.useCallback((U,q)=>m("error",U,q,{duration:0}),[m]),C=O.useCallback(U=>{s(U)},[s]),k=O.useCallback(()=>{a()},[a]),P=O.useCallback(U=>{l(U)},[l]),T=O.useCallback(U=>{c(U)},[c]),I=O.useCallback(()=>{d()},[d]),N=O.useCallback(U=>{u(U)},[u]),B=O.useCallback((U,q,V)=>{p({type:U,title:q,message:V})},[p]),M=O.useCallback(U=>{g(U)},[g]),F=O.useCallback(()=>{_()},[_]);return{toasts:e,wsStatus:t,wsLastMessage:r,isWsConnected:y,isPanelVisible:n,persistentNotifications:i,addToast:m,info:v,success:b,warning:x,error:E,removeToast:C,clearAllToasts:k,setWsStatus:P,setWsLastMessage:T,togglePanel:I,setPanelVisible:N,addPersistentNotification:B,removePersistentNotification:M,clearPersistentNotifications:F}}const LM={"prompt-template":{defaultData:{label:"New Step",instruction:"",outputName:void 0,tool:void 0,mode:void 0,contextRefs:[]}}},Dle=[{id:"slash-command-main",label:"Slash Command",description:"Execute /workflow commands (main thread)",icon:"Terminal",color:"bg-rose-500",category:"command",data:{label:"Slash Command",instruction:"",slashCommand:"",slashArgs:"",mode:"mainprocess",nodeCategory:"command"}},{id:"slash-command-async",label:"Slash Command (Async)",description:"Execute /workflow commands (background)",icon:"Terminal",color:"bg-rose-400",category:"command",data:{label:"Slash Command (Async)",instruction:"",slashCommand:"",slashArgs:"",mode:"async",nodeCategory:"command"}}],tH="ccw-orchestrator-custom-templates";function rH(){try{const e=localStorage.getItem(tH);return e?JSON.parse(e):[]}catch{return[]}}function $M(e){try{localStorage.setItem(tH,JSON.stringify(e))}catch(t){console.error("Failed to save custom templates:",t)}}const Hg=e=>`${e}-${Date.now()}-${Math.random().toString(36).slice(2,10)}`,uu="/api/orchestrator",BM=50,Lle=100,$le=80,Ble=20;function FM(e,t,r){let n=e,i=t;for(let o=0;o<Ble;o++){if(!r.some(a=>{const l=Math.abs(a.position.x-n),c=Math.abs(a.position.y-i);return l<BM&&c<BM}))return{x:n,y:i};n+=Lle,i+=$le}return{x:n,y:i}}const Fle={currentFlow:null,isModified:!1,nodes:[],edges:[],selectedNodeId:null,selectedEdgeId:null,flows:[],isLoadingFlows:!1,isPaletteOpen:!0,isPropertyPanelOpen:!1,leftPanelTab:"nodes",customTemplates:rH(),interactionMode:"pan"},zle=gn()(En((e,t)=>({...Fle,setCurrentFlow:r=>{e({currentFlow:r,nodes:(r==null?void 0:r.nodes)??[],edges:(r==null?void 0:r.edges)??[],isModified:!1,selectedNodeId:null,selectedEdgeId:null},!1,"setCurrentFlow")},createFlow:(r,n)=>{const i={id:Hg("flow"),name:r,description:n,version:1,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),nodes:[],edges:[],variables:{},metadata:{source:"custom"}};return e({currentFlow:i,nodes:[],edges:[],isModified:!0,selectedNodeId:null,selectedEdgeId:null},!1,"createFlow"),i},saveFlow:async()=>{const{currentFlow:r,nodes:n,edges:i}=t();if(!r)return!1;try{const o={...r,nodes:n,edges:i,updated_at:new Date().toISOString()},s=!t().flows.some(p=>p.id===r.id),a=s?"POST":"PUT",l=s?`${uu}/flows`:`${uu}/flows/${r.id}`,c=await fetch(l,{method:a,headers:{"Content-Type":"application/json"},body:JSON.stringify(o),credentials:"same-origin"});if(!c.ok)throw new Error(`Failed to save flow: ${c.statusText}`);const d=await c.json(),u=d&&typeof d=="object"&&"data"in d?d.data:d;return e(p=>({currentFlow:u,isModified:!1,flows:s?[...p.flows,u]:p.flows.map(g=>g.id===u.id?u:g)}),!1,"saveFlow"),!0}catch(o){return console.error("Error saving flow:",o),!1}},loadFlow:async r=>{try{const n=await fetch(`${uu}/flows/${r}`,{credentials:"same-origin"});if(!n.ok)throw new Error(`Failed to load flow: ${n.statusText}`);const i=await n.json(),o=i&&typeof i=="object"&&"data"in i?i.data:i;return e({currentFlow:o,nodes:o.nodes,edges:o.edges,isModified:!1,selectedNodeId:null,selectedEdgeId:null},!1,"loadFlow"),!0}catch(n){return console.error("Error loading flow:",n),!1}},deleteFlow:async r=>{try{const n=await fetch(`${uu}/flows/${r}`,{method:"DELETE",credentials:"same-origin"});if(!n.ok)throw new Error(`Failed to delete flow: ${n.statusText}`);return e(i=>{var o,s,a;return{flows:i.flows.filter(l=>l.id!==r),currentFlow:((o=i.currentFlow)==null?void 0:o.id)===r?null:i.currentFlow,nodes:((s=i.currentFlow)==null?void 0:s.id)===r?[]:i.nodes,edges:((a=i.currentFlow)==null?void 0:a.id)===r?[]:i.edges}},!1,"deleteFlow"),!0}catch(n){return console.error("Error deleting flow:",n),!1}},duplicateFlow:async r=>{try{const n=await fetch(`${uu}/flows/${r}/duplicate`,{method:"POST",credentials:"same-origin"});if(!n.ok)throw new Error(`Failed to duplicate flow: ${n.statusText}`);const i=await n.json(),o=i&&typeof i=="object"&&"data"in i?i.data:i;return e(s=>({flows:[...s.flows,o]}),!1,"duplicateFlow"),o}catch(n){return console.error("Error duplicating flow:",n),null}},addNode:r=>{const n=LM["prompt-template"],i=Hg("node"),o=FM(r.x,r.y,t().nodes),s={id:i,type:"prompt-template",position:o,data:{...n.defaultData}};return e(a=>({nodes:[...a.nodes,s],isModified:!0,selectedNodeId:i}),!1,"addNode"),i},addNodeFromTemplate:(r,n)=>{const i=Dle.find(d=>d.id===r)||t().customTemplates.find(d=>d.id===r);if(!i)return console.error(`Template not found: ${r}`),t().addNode(n);const o=Hg("node"),s=LM["prompt-template"],a=FM(n.x,n.y,t().nodes),l={...s.defaultData,...i.data,label:i.data.label||i.label,contextRefs:i.data.contextRefs||[]},c={id:o,type:"prompt-template",position:a,data:l};return e(d=>({nodes:[...d.nodes,c],isModified:!0,selectedNodeId:o}),!1,"addNodeFromTemplate"),o},updateNode:(r,n)=>{e(i=>({nodes:i.nodes.map(o=>o.id===r?{...o,data:{...o.data,...n}}:o),isModified:!0}),!1,"updateNode")},removeNode:r=>{e(n=>({nodes:n.nodes.filter(i=>i.id!==r),edges:n.edges.filter(i=>i.source!==r&&i.target!==r),isModified:!0,selectedNodeId:n.selectedNodeId===r?null:n.selectedNodeId}),!1,"removeNode")},setNodes:r=>{e({nodes:r,isModified:!0},!1,"setNodes")},addEdge:(r,n,i,o)=>{const s=Hg("edge"),a={id:s,source:r,target:n,sourceHandle:i,targetHandle:o};return e(l=>({edges:[...l.edges,a],isModified:!0}),!1,"addEdge"),s},updateEdge:(r,n)=>{e(i=>({edges:i.edges.map(o=>o.id===r?{...o,data:{...o.data,...n}}:o),isModified:!0}),!1,"updateEdge")},removeEdge:r=>{e(n=>({edges:n.edges.filter(i=>i.id!==r),isModified:!0,selectedEdgeId:n.selectedEdgeId===r?null:n.selectedEdgeId}),!1,"removeEdge")},setEdges:r=>{e({edges:r,isModified:!0},!1,"setEdges")},setSelectedNodeId:r=>{e({selectedNodeId:r,selectedEdgeId:null,isPropertyPanelOpen:r!==null},!1,"setSelectedNodeId")},setSelectedEdgeId:r=>{e({selectedEdgeId:r,selectedNodeId:null},!1,"setSelectedEdgeId")},fetchFlows:async()=>{e({isLoadingFlows:!0},!1,"fetchFlows/start");try{const r=await fetch(`${uu}/flows`,{credentials:"same-origin"});if(!r.ok)throw new Error(`Failed to fetch flows: ${r.statusText}`);const n=await r.json(),i=Array.isArray(n==null?void 0:n.data)?n.data:(n==null?void 0:n.flows)||[];e({flows:i,isLoadingFlows:!1},!1,"fetchFlows/success")}catch(r){console.error("Error fetching flows:",r),e({isLoadingFlows:!1},!1,"fetchFlows/error")}},setIsPaletteOpen:r=>{e({isPaletteOpen:r},!1,"setIsPaletteOpen")},setIsPropertyPanelOpen:r=>{e({isPropertyPanelOpen:r},!1,"setIsPropertyPanelOpen")},setLeftPanelTab:r=>{e({leftPanelTab:r},!1,"setLeftPanelTab")},toggleInteractionMode:()=>{e(r=>({interactionMode:r.interactionMode==="pan"?"selection":"pan"}),!1,"toggleInteractionMode")},setInteractionMode:r=>{e({interactionMode:r},!1,"setInteractionMode")},addCustomTemplate:r=>{e(n=>{const i=[...n.customTemplates,r];return $M(i),{customTemplates:i}},!1,"addCustomTemplate")},removeCustomTemplate:r=>{e(n=>{const i=n.customTemplates.filter(o=>o.id!==r);return $M(i),{customTemplates:i}},!1,"removeCustomTemplate")},saveNodeAsTemplate:(r,n,i)=>{const o=t().nodes.find(u=>u.id===r);if(!o)return null;const{executionStatus:s,executionError:a,executionResult:l,...c}=o.data,d={id:`custom-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,label:n,description:i,icon:"MessageSquare",color:"bg-blue-500",category:"command",data:{...c,label:n}};return t().addCustomTemplate(d),d},loadCustomTemplates:()=>{e({customTemplates:rH()},!1,"loadCustomTemplates")},resetFlow:()=>{e({currentFlow:null,nodes:[],edges:[],isModified:!1,selectedNodeId:null,selectedEdgeId:null},!1,"resetFlow")},getSelectedNode:()=>{const{nodes:r,selectedNodeId:n}=t();return r.find(i=>i.id===n)},markModified:()=>{e({isModified:!0},!1,"markModified")}}),{name:"FlowStore"})),Ule=500,Hle={currentExecution:null,nodeStates:{},logs:[],maxLogs:Ule,nodeOutputs:{},nodeToolCalls:{},selectedNodeId:null,isMonitorPanelOpen:!1,autoScrollLogs:!0},qle=gn()(En((e,t)=>({...Hle,startExecution:(r,n)=>{const i=new Date().toISOString();e({currentExecution:{execId:r,flowId:n,status:"running",startedAt:i,elapsedMs:0},nodeStates:{},logs:[]},!1,"startExecution")},setExecutionStatus:(r,n)=>{e(i=>i.currentExecution?{currentExecution:{...i.currentExecution,status:r,currentNodeId:n??i.currentExecution.currentNodeId}}:i,!1,"setExecutionStatus")},completeExecution:r=>{const n=new Date().toISOString();e(i=>{if(!i.currentExecution)return i;const o=new Date(i.currentExecution.startedAt).getTime(),s=Date.now()-o;return{currentExecution:{...i.currentExecution,status:r,completedAt:n,elapsedMs:s,currentNodeId:void 0}}},!1,"completeExecution")},clearExecution:()=>{e({currentExecution:null,nodeStates:{},logs:[]},!1,"clearExecution")},setNodeStarted:r=>{const n=new Date().toISOString();e(i=>({nodeStates:{...i.nodeStates,[r]:{nodeId:r,status:"running",startedAt:n}}}),!1,"setNodeStarted")},setNodeCompleted:(r,n)=>{const i=new Date().toISOString();e(o=>({nodeStates:{...o.nodeStates,[r]:{...o.nodeStates[r],nodeId:r,status:"completed",completedAt:i,result:n}}}),!1,"setNodeCompleted")},setNodeFailed:(r,n)=>{const i=new Date().toISOString();e(o=>({nodeStates:{...o.nodeStates,[r]:{...o.nodeStates[r],nodeId:r,status:"failed",completedAt:i,error:n}}}),!1,"setNodeFailed")},clearNodeStates:()=>{e({nodeStates:{}},!1,"clearNodeStates")},addLog:r=>{e(n=>{const i=[...n.logs,r];return i.length>n.maxLogs?{logs:i.slice(-n.maxLogs)}:{logs:i}},!1,"addLog")},clearLogs:()=>{e({logs:[]},!1,"clearLogs")},setMonitorPanelOpen:r=>{e({isMonitorPanelOpen:r},!1,"setMonitorPanelOpen")},setAutoScrollLogs:r=>{e({autoScrollLogs:r},!1,"setAutoScrollLogs")},addNodeOutput:(r,n)=>{e(i=>{const o=i.nodeOutputs[r];return o?{nodeOutputs:{...i.nodeOutputs,[r]:{...o,outputs:[...o.outputs,n]}}}:{nodeOutputs:{...i.nodeOutputs,[r]:{nodeId:r,outputs:[n],toolCalls:[],logs:[],variables:{},startTime:Date.now()}}}},!1,"addNodeOutput")},clearNodeOutputs:r=>{e(n=>{const i={...n.nodeOutputs};return delete i[r],{nodeOutputs:i}},!1,"clearNodeOutputs")},startToolCall:(r,n,i)=>{const o={callId:n,nodeId:r,status:"executing",kind:i.kind,subtype:i.subtype,description:i.description,startTime:Date.now(),outputLines:[],outputBuffer:{stdout:"",stderr:"",combined:""}};e(s=>{const a=s.nodeToolCalls[r]||[];return{nodeToolCalls:{...s.nodeToolCalls,[r]:[...a,o]}}},!1,"startToolCall")},updateToolCall:(r,n,i)=>{e(o=>{const s=o.nodeToolCalls[r];if(!s)return o;const a=s.findIndex(d=>d.callId===n);if(a===-1)return o;const l=[...s],c=l[a];if(i.status&&(c.status=i.status,i.status!=="executing"&&!c.endTime&&(c.endTime=Date.now(),c.duration=c.endTime-c.startTime)),i.outputChunk!==void 0){const d={type:i.stream==="stderr"?"stderr":"stdout",content:i.outputChunk,timestamp:Date.now()};c.outputLines.push(d),i.stream==="stderr"?(c.outputBuffer.stderr+=i.outputChunk,c.outputBuffer.combined+=i.outputChunk):(c.outputBuffer.stdout+=i.outputChunk,c.outputBuffer.combined+=i.outputChunk)}return l[a]=c,{nodeToolCalls:{...o.nodeToolCalls,[r]:l}}},!1,"updateToolCall")},completeToolCall:(r,n,i)=>{e(o=>{const s=o.nodeToolCalls[r];if(!s)return o;const a=s.findIndex(d=>d.callId===n);if(a===-1)return o;const l=[...s],c={...l[a]};return c.status=i.status,c.endTime=Date.now(),c.duration=c.endTime-c.startTime,i.exitCode!==void 0&&(c.exitCode=i.exitCode),i.error!==void 0&&(c.error=i.error),i.result!==void 0&&(c.result=i.result),l[a]=c,{nodeToolCalls:{...o.nodeToolCalls,[r]:l}}},!1,"completeToolCall")},toggleToolCallExpanded:(r,n)=>{e(i=>{const o=i.nodeToolCalls[r];if(!o)return i;const s=o.findIndex(l=>l.callId===n);if(s===-1)return i;const a=[...o];return a[s]={...a[s],isExpanded:!a[s].isExpanded},{nodeToolCalls:{...i.nodeToolCalls,[r]:a}}},!1,"toggleToolCallExpanded")},selectNode:r=>{e({selectedNodeId:r},!1,"selectNode")},getNodeOutputs:r=>t().nodeOutputs[r],getToolCallsForNode:r=>t().nodeToolCalls[r]||[]}),{name:"ExecutionStore"})),Jze=e=>{var t;return((t=e.currentExecution)==null?void 0:t.status)==="running"},Wle="cli-viewer-storage",Vle=1,zM=e=>`pane-${e}`,Gle=e=>`tab-${e}`,Zh=e=>typeof e=="string",Kle=(e,t)=>{const r=(n,i)=>{for(let o=0;o<n.children.length;o++){const s=n.children[o];if(Zh(s)){if(s===t)return{found:!0,parent:n,index:o}}else{const a=r(s);if(a.found)return a}}return{found:!1,parent:null,index:-1}};return r(e)},Xle=(e,t)=>{const r=i=>{const o=[];for(const l of i.children)if(Zh(l))l!==t&&o.push(l);else{const c=r(l);c&&c.children.length>0&&(c.children.length===1?o.push(c.children[0]):o.push(c))}if(o.length===0)return null;const s=i.sizes?i.sizes.filter((l,c)=>{const d=i.children[c];return!Zh(d)||d!==t}):void 0,a=s?(()=>{const l=s.reduce((c,d)=>c+d,0);return l>0?s.map(c=>c/l*100):void 0})():void 0;return{direction:i.direction,sizes:a,children:o}};return r(e)||{direction:"horizontal",children:[]}},Zle=(e,t,r,n="horizontal")=>{if(!r){if(e.children.length===0)return{...e,children:[t],sizes:[100]};if(e.direction===n){const o=e.sizes||e.children.map(()=>100/e.children.length),s=o.reduce((c,d)=>c+d,0),a=s/(e.children.length+1),l=(s-a)/s;return{...e,children:[...e.children,t],sizes:[...o.map(c=>c*l),a]}}return{direction:n,sizes:[50,50],children:[e,t]}}const i=o=>{const s=[];let a=o.sizes?[]:void 0;for(let l=0;l<o.children.length;l++){const c=o.children[l],d=o.sizes?o.sizes[l]:void 0;if(Zh(c))if(c===r)if(o.direction===n){const u=(d||50)/2;s.push(c,t),a&&a.push(u,u)}else{const u={direction:n,sizes:[50,50],children:[c,t]};s.push(u),a&&d!==void 0&&a.push(d)}else s.push(c),a&&d!==void 0&&a.push(d);else Kle(c,r).found?s.push(i(c)):s.push(c),a&&d!==void 0&&a.push(d)}return{...o,children:s,sizes:a}};return i(e)},qg=e=>{const t=[],r=n=>{for(const i of n.children)Zh(i)?t.push(i):r(i)};return r(e),t},nH=()=>({direction:"horizontal",children:[]}),Qle={layout:nH(),panes:{},tabs:{},focusedPaneId:null,nextPaneIdCounter:1,nextTabIdCounter:1},uA=gn()(im(En((e,t)=>({...Qle,setLayout:r=>{if(typeof r=="function"){const n=t().layout,i=r(n);e({layout:i},!1,"viewer/setLayout")}else e({layout:r},!1,"viewer/setLayout")},addPane:(r,n="horizontal")=>{const i=t(),o=zM(i.nextPaneIdCounter),s={id:o,tabs:[],activeTabId:null},a=Zle(i.layout,o,r,n);return e({layout:a,panes:{...i.panes,[o]:s},focusedPaneId:o,nextPaneIdCounter:i.nextPaneIdCounter+1},!1,"viewer/addPane"),o},removePane:r=>{const n=t(),i=n.panes[r];if(!i){console.warn(`[ViewerStore] Pane not found: ${r}`);return}if(qg(n.layout).length<=1){console.warn("[ViewerStore] Cannot remove the last pane");return}const s=Xle(n.layout,r),a={...n.panes};delete a[r];const l={...n.tabs};for(const d of i.tabs)delete l[d.id];let c=n.focusedPaneId;if(c===r){const d=qg(s);c=d.length>0?d[0]:null}e({layout:s,panes:a,tabs:l,focusedPaneId:c},!1,"viewer/removePane")},addTab:(r,n,i)=>{const o=t(),s=o.panes[r];if(!s)return console.warn(`[ViewerStore] Pane not found: ${r}`),"";const a=s.tabs.find(p=>p.executionId===n);if(a)return e({panes:{...o.panes,[r]:{...s,activeTabId:a.id}},focusedPaneId:r},!1,"viewer/addTab-existing"),a.id;for(const[p,g]of Object.entries(o.panes)){if(p===r)continue;const _=g.tabs.find(y=>y.executionId===n);if(_)return e({panes:{...o.panes,[p]:{...g,activeTabId:_.id}},focusedPaneId:p},!1,"viewer/addTab-existing-global"),_.id}const l=Gle(o.nextTabIdCounter),c=s.tabs.reduce((p,g)=>Math.max(p,g.order),0),d={id:l,executionId:n,title:i,isPinned:!1,order:c+1},u={...s,tabs:[...s.tabs,d],activeTabId:l};return e({panes:{...o.panes,[r]:u},tabs:{...o.tabs,[l]:d},focusedPaneId:r,nextTabIdCounter:o.nextTabIdCounter+1},!1,"viewer/addTab"),l},removeTab:(r,n)=>{const i=t(),o=i.panes[r];if(!o){console.warn(`[ViewerStore] Pane not found: ${r}`);return}const s=o.tabs.findIndex(u=>u.id===n);if(s===-1){console.warn(`[ViewerStore] Tab not found: ${n}`);return}const a=o.tabs.filter(u=>u.id!==n);let l=null;if(o.activeTabId===n&&a.length>0){const u=Math.min(s,a.length-1);l=a[u].id}else o.activeTabId!==n&&(l=o.activeTabId);const c={...o,tabs:a,activeTabId:l},d={...i.tabs};delete d[n],e({panes:{...i.panes,[r]:c},tabs:d},!1,"viewer/removeTab"),a.length===0&&qg(t().layout).length>1&&queueMicrotask(()=>{var g;const p=t();((g=p.panes[r])==null?void 0:g.tabs.length)===0&&p.removePane(r)})},setActiveTab:(r,n)=>{const i=t(),o=i.panes[r];if(!o){console.warn(`[ViewerStore] Pane not found: ${r}`);return}if(!o.tabs.find(a=>a.id===n)){console.warn(`[ViewerStore] Tab not found in pane: ${n}`);return}e({panes:{...i.panes,[r]:{...o,activeTabId:n}},focusedPaneId:r},!1,"viewer/setActiveTab")},moveTab:(r,n,i,o)=>{const s=t(),a=s.panes[r],l=s.panes[i];if(!a||!l){console.warn("[ViewerStore] Source or target pane not found");return}const c=a.tabs.findIndex(x=>x.id===n);if(c===-1){console.warn(`[ViewerStore] Tab not found: ${n}`);return}const d=a.tabs[c],u=a.tabs.filter(x=>x.id!==n);let p=a.activeTabId;if(a.activeTabId===n&&u.length>0){const x=Math.min(c,u.length-1);p=u[x].id}else a.activeTabId===n&&(p=null);let g;if(r===i){const x=[...u].sort((E,C)=>E.order-C.order);if(o===0)g=x.length>0?x[0].order-1:1;else if(o>=x.length)g=x.length>0?x[x.length-1].order+1:1;else{const E=x[o-1].order,C=x[o].order;g=(E+C)/2}}else{const x=[...l.tabs].sort((E,C)=>E.order-C.order);if(o===0)g=x.length>0?x[0].order-1:1;else if(o>=x.length)g=x.length>0?x[x.length-1].order+1:1;else{const E=x[o-1].order,C=x[o].order;g=(E+C)/2}}const _={...d,order:g};let y;r===i?y=[...u,_]:y=[...l.tabs,_];const m={...a,tabs:r===i?y:u,activeTabId:r===i?n:p},v=r===i?m:{...l,tabs:y,activeTabId:n},b={...s.panes,[r]:m};r!==i&&(b[i]=v),e({panes:b,tabs:{...s.tabs,[n]:_},focusedPaneId:i},!1,"viewer/moveTab"),r!==i&&u.length===0&&qg(t().layout).length>1&&queueMicrotask(()=>{var C;const E=t();((C=E.panes[r])==null?void 0:C.tabs.length)===0&&E.removePane(r)})},togglePinTab:r=>{const n=t(),i=n.tabs[r];if(!i){console.warn(`[ViewerStore] Tab not found: ${r}`);return}const o={...i,isPinned:!i.isPinned},s={...n.panes};for(const a of Object.keys(s)){const l=s[a];if(l.tabs.findIndex(d=>d.id===r)!==-1){s[a]={...l,tabs:l.tabs.map(d=>d.id===r?o:d)};break}}e({tabs:{...n.tabs,[r]:o},panes:s},!1,"viewer/togglePinTab")},setFocusedPane:r=>{if(!t().panes[r]){console.warn(`[ViewerStore] Pane not found: ${r}`);return}e({focusedPaneId:r},!1,"viewer/setFocusedPane")},initializeDefaultLayout:r=>{let i=t().nextPaneIdCounter;const o=()=>({id:zM(i++),tabs:[],activeTabId:null});let s;const a={};switch(r){case"single":{const c=o();a[c.id]=c,s={direction:"horizontal",sizes:[100],children:[c.id]};break}case"split-h":{const c=o(),d=o();a[c.id]=c,a[d.id]=d,s={direction:"horizontal",sizes:[50,50],children:[c.id,d.id]};break}case"split-v":{const c=o(),d=o();a[c.id]=c,a[d.id]=d,s={direction:"vertical",sizes:[50,50],children:[c.id,d.id]};break}case"grid-2x2":{const c=o(),d=o(),u=o(),p=o();a[c.id]=c,a[d.id]=d,a[u.id]=u,a[p.id]=p,s={direction:"vertical",sizes:[50,50],children:[{direction:"horizontal",sizes:[50,50],children:[c.id,d.id]},{direction:"horizontal",sizes:[50,50],children:[u.id,p.id]}]};break}default:return}const l=Object.keys(a)[0]||null;e({layout:s,panes:a,tabs:{},focusedPaneId:l,nextPaneIdCounter:i,nextTabIdCounter:1},!1,"viewer/initializeDefaultLayout")},reset:()=>{e({layout:nH(),panes:{},tabs:{},focusedPaneId:null,nextPaneIdCounter:1,nextTabIdCounter:1},!1,"viewer/reset")}}),{name:"ViewerStore"}),{name:Wle,version:Vle,partialize:e=>({layout:e.layout,panes:e.panes,tabs:e.tabs,focusedPaneId:e.focusedPaneId,nextPaneIdCounter:e.nextPaneIdCounter,nextTabIdCounter:e.nextTabIdCounter})})),eUe=()=>uA(e=>e.layout),tUe=()=>uA(e=>e.panes),rUe=()=>uA(e=>e.focusedPaneId),nUe=(e,t)=>{const r=e.panes[t];return!r||!r.activeTabId?null:r.tabs.find(n=>n.id===r.activeTabId)||null},UM={isPanelOpen:!1,activeTerminalId:null,panelView:"terminal",terminalOrder:[]},zn=gn()(En((e,t)=>({...UM,openTerminal:r=>{const{terminalOrder:n}=t(),i=n.includes(r)?n:[...n,r];e({isPanelOpen:!0,activeTerminalId:r,panelView:"terminal",terminalOrder:i},!1,"openTerminal")},closePanel:()=>{e({isPanelOpen:!1},!1,"closePanel")},togglePanel:()=>{const{isPanelOpen:r,activeTerminalId:n,terminalOrder:i}=t();if(r)e({isPanelOpen:!1},!1,"togglePanel/close");else{const o=n??i[0]??null;e({isPanelOpen:!0,activeTerminalId:o,panelView:o?"terminal":"queue"},!1,"togglePanel/open")}},setActiveTerminal:r=>{e({activeTerminalId:r},!1,"setActiveTerminal")},setPanelView:r=>{e({panelView:r},!1,"setPanelView")},addTerminal:r=>{const{terminalOrder:n}=t();n.includes(r)||e({terminalOrder:[...n,r]},!1,"addTerminal")},removeTerminal:r=>{const{terminalOrder:n,activeTerminalId:i}=t(),o=n.filter(a=>a!==r);let s=i;if(i===r){const a=n.indexOf(r);o.length===0?s=null:a>=o.length?s=o[o.length-1]:s=o[a]}e({terminalOrder:o,activeTerminalId:s,isPanelOpen:o.length>0?t().isPanelOpen:!1},!1,"removeTerminal")},resetState:()=>{e({...UM},!1,"resetState")}}),{name:"TerminalPanelStore"})),Yle=e=>e.terminalOrder.length;function iUe(){return zn(t=>t.openTerminal)}const HM={executions:{}},Ud=gn()(En(e=>({...HM,addExecution:t=>{e(r=>({executions:{...r.executions,[t.id]:t}}),!1,"addExecution")},updateStatus:(t,r,n)=>{e(i=>{const o=i.executions[t];if(!o)return i;const s=r==="completed"||r==="failed";return{executions:{...i.executions,[t]:{...o,status:r,completedAt:s?new Date().toISOString():o.completedAt,error:n??o.error}}}},!1,"updateStatus")},removeExecution:t=>{e(r=>{const{[t]:n,...i}=r.executions;return{executions:i}},!1,"removeExecution")},clearCompleted:()=>{e(t=>{const r={};for(const[n,i]of Object.entries(t.executions))i.status!=="completed"&&i.status!=="failed"&&(r[n]=i);return{executions:r}},!1,"clearCompleted")},resetState:()=>{e({...HM},!1,"resetState")}}),{name:"QueueExecutionStore"})),Jle=[],ece=e=>t=>{const r=Object.values(t.executions).filter(n=>n.queueItemId===e);return r.length===0?Jle:r};function tce(e,t){return e.dependsOn.every(r=>{const n=t[r];return n&&(n.status==="completed"||n.status==="skipped")})}function qM(e,t){for(const r of e.steps){const n=t[r.id];if(n&&n.status==="pending"&&tce(r,t))return r.id}return null}function rce(e){return Object.values(e).every(t=>t.status==="completed"||t.status==="skipped"||t.status==="failed")}const WM={activePlans:{}},Bl=gn()(En((e,t)=>({...WM,startOrchestration:(r,n)=>{const i={};for(const s of r.steps)i[s.id]={status:"pending",retryCount:0};const o={plan:r,status:"running",currentStepIndex:0,stepStatuses:i,executionIdMap:{},sessionKey:n};e(s=>({activePlans:{...s.activePlans,[r.id]:o}}),!1,"startOrchestration")},pauseOrchestration:r=>{e(n=>{const i=n.activePlans[r];return!i||i.status!=="running"?n:{activePlans:{...n.activePlans,[r]:{...i,status:"paused"}}}},!1,"pauseOrchestration")},resumeOrchestration:r=>{e(n=>{const i=n.activePlans[r];return!i||i.status!=="paused"?n:{activePlans:{...n.activePlans,[r]:{...i,status:"running"}}}},!1,"resumeOrchestration")},stopOrchestration:(r,n)=>{e(i=>{const o=i.activePlans[r];return o?{activePlans:{...i.activePlans,[r]:{...o,status:"failed",error:n??"Orchestration stopped by user"}}}:i},!1,"stopOrchestration")},updateStepStatus:(r,n,i,o)=>{e(s=>{const a=s.activePlans[r];if(!a)return s;const l=a.stepStatuses[n];if(!l)return s;const c=new Date().toISOString(),d=i==="running",u=i==="completed"||i==="failed"||i==="skipped";return{activePlans:{...s.activePlans,[r]:{...a,stepStatuses:{...a.stepStatuses,[n]:{...l,status:i,startedAt:d?c:l.startedAt,completedAt:u?c:l.completedAt,result:(o==null?void 0:o.data)??l.result,error:(o==null?void 0:o.error)??l.error}}}}}},!1,"updateStepStatus")},registerExecution:(r,n,i)=>{e(o=>{const s=o.activePlans[r];return s?{activePlans:{...o.activePlans,[r]:{...s,executionIdMap:{...s.executionIdMap,[i]:n}}}}:o},!1,"registerExecution")},retryStep:(r,n)=>{e(i=>{const o=i.activePlans[r];if(!o)return i;const s=o.stepStatuses[n];return s?{activePlans:{...i.activePlans,[r]:{...o,status:"running",stepStatuses:{...o.stepStatuses,[n]:{...s,status:"pending",error:void 0,result:void 0,startedAt:void 0,completedAt:void 0,retryCount:s.retryCount+1}}}}}:i},!1,"retryStep")},skipStep:(r,n)=>{e(i=>{const o=i.activePlans[r];if(!o)return i;const s=o.stepStatuses[n];return s?{activePlans:{...i.activePlans,[r]:{...o,stepStatuses:{...o.stepStatuses,[n]:{...s,status:"skipped",completedAt:new Date().toISOString()}}}}}:i},!1,"skipStep")},_advanceToNextStep:r=>{const i=t().activePlans[r];if(!i||i.status!=="running")return null;const o=qM(i.plan,i.stepStatuses);if(o){const s=i.plan.steps.findIndex(a=>a.id===o);return e(a=>{const l=a.activePlans[r];return l?{activePlans:{...a.activePlans,[r]:{...l,currentStepIndex:s>=0?s:l.currentStepIndex}}}:a},!1,"_advanceToNextStep"),o}if(rce(i.stepStatuses)){const s=Object.values(i.stepStatuses).some(a=>a.status==="failed");e(a=>{const l=a.activePlans[r];return l?{activePlans:{...a.activePlans,[r]:{...l,status:s?"failed":"completed"}}}:a},!1,"_advanceToNextStep/complete")}return null},getNextReadyStep:r=>{const i=t().activePlans[r];return!i||i.status!=="running"?null:qM(i.plan,i.stepStatuses)},removePlan:r=>{e(n=>{const{[r]:i,...o}=n.activePlans;return{activePlans:o}},!1,"removePlan")},clearAll:()=>{e(WM,!1,"clearAll")}}),{name:"OrchestratorStore"})),nce=e=>e.activePlans,ice=e=>Object.values(e.activePlans).filter(t=>t.status==="running"||t.status==="paused").length,oce=2*1024*1024,sce=new TextEncoder;function Qx(e){return sce.encode(e).length}const VM={sessions:{},outputChunks:{},outputBytes:{}},li=gn()(En((e,t)=>({...VM,setSessions:r=>e(n=>{const i={};for(const l of r)i[l.sessionKey]=l;const o=new Set(Object.keys(i)),s={...n.outputChunks},a={...n.outputBytes};for(const l of Object.keys(s))o.has(l)||delete s[l];for(const l of Object.keys(a))o.has(l)||delete a[l];return{sessions:i,outputChunks:s,outputBytes:a}}),upsertSession:r=>e(n=>({sessions:{...n.sessions,[r.sessionKey]:r}})),removeSession:r=>e(n=>{const i={...n.sessions},o={...n.outputChunks},s={...n.outputBytes};return delete i[r],delete o[r],delete s[r],{sessions:i,outputChunks:o,outputBytes:s}}),updateSessionPausedState:(r,n)=>e(i=>{const o=i.sessions[r];return o?{sessions:{...i.sessions,[r]:{...o,isPaused:n,updatedAt:new Date().toISOString()}}}:i}),resetState:()=>e({...VM}),setBuffer:(r,n)=>e(i=>({outputChunks:{...i.outputChunks,[r]:n?[{data:n,timestamp:Date.now()}]:[]},outputBytes:{...i.outputBytes,[r]:n?Qx(n):0}})),appendOutput:(r,n,i=Date.now())=>{if(!n)return;const o=Qx(n),{outputChunks:s,outputBytes:a}=t(),l=s[r]??[],c=a[r]??0,d=[...l,{data:n,timestamp:i}];let u=c+o;for(;u>oce&&d.length>0;){const p=d.shift();p&&(u-=Qx(p.data))}e(p=>({outputChunks:{...p.outputChunks,[r]:d},outputBytes:{...p.outputBytes,[r]:Math.max(0,u)}}))},clearOutput:r=>e(n=>({outputChunks:{...n.outputChunks,[r]:[]},outputBytes:{...n.outputBytes,[r]:0}}))}),{name:"cliSessionStore"})),GM={groups:[],layout:{grid:"1x1",splits:[1]},activeTerminalId:null,terminalMetas:{}};let ri=null;function ace(e){Hd.getState().updateTerminalMeta(e.sessionKey,{status:"locked",isLocked:!0,lockReason:e.reason,lockedByExecutionId:e.executionId,lockedAt:e.timestamp})}function lce(e){const t=Hd.getState(),r=t.terminalMetas[e.sessionKey];r!=null&&r.isLocked&&t.updateTerminalMeta(e.sessionKey,{status:"active",isLocked:!1,lockReason:void 0,lockedByExecutionId:void 0,lockedAt:void 0})}function cce(e){const t=e.data;if(t.type!=="alert")return;const{sessionId:r,severity:n,message:i}=t,o={critical:"error",warning:"idle"},s=Hd.getState(),a=s.terminalMetas[r],l=(a==null?void 0:a.alertCount)??0;s.updateTerminalMeta(r,{status:o[n]??"idle",alertCount:l+1})}const Hd=gn()(En(e=>({...GM,createGroup:t=>{const n={id:`group-${Date.now()}-${Math.random().toString(36).slice(2,7)}`,name:t,sessionIds:[]};e(i=>({groups:[...i.groups,n]}),!1,"createGroup")},removeGroup:t=>{e(r=>({groups:r.groups.filter(n=>n.id!==t)}),!1,"removeGroup")},moveSessionToGroup:(t,r)=>{e(n=>({groups:n.groups.map(o=>{const s=o.sessionIds.filter(a=>a!==t);return o.id===r?{...o,sessionIds:[...s,t]}:{...o,sessionIds:s}})}),!1,"moveSessionToGroup")},setActiveTerminal:t=>{e({activeTerminalId:t},!1,"setActiveTerminal")},updateTerminalMeta:(t,r)=>{e(n=>{const i=n.terminalMetas[t]??{title:t,status:"idle",alertCount:0};return{terminalMetas:{...n.terminalMetas,[t]:{...i,...r}}}},!1,"updateTerminalMeta")},resetState:()=>{ri&&(ri.terminate(),ri=null),e({...GM},!1,"resetState")},setGroupLayout:t=>{e({layout:t},!1,"setGroupLayout")},spawnMonitor:()=>{if(!ri)try{ri=new Worker(new URL("/assets/monitor.worker-CVRNUIeJ.js",import.meta.url),{type:"module"}),ri.onmessage=cce,ri.onerror=t=>{}}catch{ri=null}},terminateMonitor:()=>{ri&&(ri.terminate(),ri=null)},feedMonitor:(t,r)=>{ri||Hd.getState().spawnMonitor(),ri&&ri.postMessage({type:"output",sessionId:t,text:r})},pauseSession:async t=>{const r=sr(At.getState());try{await qU(t,r??void 0),e(n=>{const i=n.terminalMetas[t];return i?{terminalMetas:{...n.terminalMetas,[t]:{...i,status:"paused"}}}:n},!1,"pauseSession")}catch(n){throw n}},resumeSession:async t=>{const r=sr(At.getState());e(n=>{const i=n.terminalMetas[t];return i?{terminalMetas:{...n.terminalMetas,[t]:{...i,status:"resuming"}}}:n},!1,"resumeSession/pending");try{await WU(t,r??void 0),e(n=>{const i=n.terminalMetas[t];return i?{terminalMetas:{...n.terminalMetas,[t]:{...i,status:"active"}}}:n},!1,"resumeSession/fulfilled")}catch(n){throw e(i=>{const o=i.terminalMetas[t];return o?{terminalMetas:{...i.terminalMetas,[t]:{...o,status:"paused"}}}:i},!1,"resumeSession/rejected"),n}},restartSession:async t=>{const r=sr(At.getState()),i=li.getState().sessions[t];if(!i)throw new Error(`Session not found: ${t}`);const o={workingDir:i.workingDir,tool:i.tool,model:i.model,resumeKey:i.resumeKey,shellKind:i.shellKind},s=a=>a==="pwsh"||a==="powershell"?"pwsh":a==="cmd"?"cmd":"bash";try{await Gv(t,r??void 0);const a=await C0({workingDir:o.workingDir,preferredShell:s(o.shellKind),tool:o.tool,model:o.model,resumeKey:o.resumeKey},r??void 0);return e(l=>{const c=l.terminalMetas[t];return c?{terminalMetas:{...l.terminalMetas,[t]:{...c,status:"active",alertCount:0}}}:l},!1,"restartSession"),a}catch(a){throw a}},closeSession:async t=>{const r=sr(At.getState()),n=li.getState();try{await Gv(t,r??void 0),n.removeSession(t),e(i=>{const o={...i.terminalMetas};return delete o[t],{terminalMetas:o}},!1,"closeSession")}catch(i){throw i}},lockSession:(t,r,n)=>{e(i=>{const o=i.terminalMetas[t];return o?{terminalMetas:{...i.terminalMetas,[t]:{...o,status:"locked",isLocked:!0,lockReason:r,lockedByExecutionId:n,lockedAt:new Date().toISOString()}}}:i},!1,"lockSession")},unlockSession:t=>{e(r=>{const n=r.terminalMetas[t];return n?{terminalMetas:{...r.terminalMetas,[t]:{...n,status:"active",isLocked:!1,lockReason:void 0,lockedByExecutionId:void 0,lockedAt:void 0}}}:r},!1,"unlockSession")}}),{name:"SessionManagerStore"})),oUe=e=>e.activeTerminalId,sUe=e=>e.terminalMetas,KM={selectedIssueId:null,associationChain:null},Tk=gn()(En(e=>({...KM,setSelectedIssue:t=>{if(t===null){e({selectedIssueId:null,associationChain:null},!1,"setSelectedIssue/clear");return}const r=XM(t);e({selectedIssueId:t,associationChain:r},!1,"setSelectedIssue")},buildAssociationChain:(t,r)=>{let n;switch(r){case"issue":n=XM(t);break;case"queue":n=uce(t);break;case"session":n=dce(t);break;default:n={issueId:null,queueItemId:null,sessionId:null}}e({associationChain:n,selectedIssueId:n.issueId},!1,"buildAssociationChain")},resetState:()=>{e({...KM},!1,"resetState")},_updateQueueItemStatus:(t,r,n)=>{const i=Ud.getState(),s=Object.values(i.executions).find(a=>a.queueItemId===t);s&&["pending","running","completed","failed"].includes(r)&&i.updateStatus(s.id,r),n&&e(a=>a.associationChain&&a.associationChain.queueItemId===t?{associationChain:{...a.associationChain,sessionId:n}}:a,!1,"_updateQueueItemStatus")}}),{name:"IssueQueueIntegrationStore"}));function XM(e){const r=Object.values(Ud.getState().executions).find(n=>n.issueId===e);return r?{issueId:e,queueItemId:r.queueItemId,sessionId:r.sessionKey??null}:{issueId:e,queueItemId:null,sessionId:null}}function uce(e){const r=Object.values(Ud.getState().executions).find(n=>n.queueItemId===e);return r?{issueId:r.issueId,queueItemId:e,sessionId:r.sessionKey??null}:{issueId:null,queueItemId:e,sessionId:null}}function dce(e){const r=Object.values(Ud.getState().executions).find(n=>n.sessionKey===e);return r?{issueId:r.issueId,queueItemId:r.queueItemId,sessionId:e}:{issueId:null,queueItemId:null,sessionId:e}}const aUe=e=>e.selectedIssueId,fce=e=>e.associationChain;function Qh(e){return typeof e=="string"}function hce(e,t){const r=(n,i)=>{for(let o=0;o<n.children.length;o++){const s=n.children[o];if(Qh(s)){if(s===t)return{found:!0,parent:n,index:o}}else{const a=r(s);if(a.found)return a}}return{found:!1,parent:null,index:-1}};return r(e)}function pce(e,t){const r=i=>{const o=[];for(const l of i.children)if(Qh(l))l!==t&&o.push(l);else{const c=r(l);c&&c.children.length>0&&(c.children.length===1?o.push(c.children[0]):o.push(c))}if(o.length===0)return null;const s=i.sizes?i.sizes.filter((l,c)=>{const d=i.children[c];return!Qh(d)||d!==t}):void 0,a=s?(()=>{const l=s.reduce((c,d)=>c+d,0);return l>0?s.map(c=>c/l*100):void 0})():void 0;return{direction:i.direction,sizes:a,children:o}};return r(e)||{direction:"horizontal",children:[]}}function ZM(e,t,r,n="horizontal"){if(!r){if(e.children.length===0)return{...e,children:[t],sizes:[100]};if(e.direction===n){const o=e.sizes||e.children.map(()=>100/e.children.length),s=o.reduce((c,d)=>c+d,0),a=s/(e.children.length+1),l=(s-a)/s;return{...e,children:[...e.children,t],sizes:[...o.map(c=>c*l),a]}}return{direction:n,sizes:[50,50],children:[e,t]}}const i=o=>{const s=[];let a=o.sizes?[]:void 0;for(let l=0;l<o.children.length;l++){const c=o.children[l],d=o.sizes?o.sizes[l]:void 0;if(Qh(c))if(c===r)if(o.direction===n){const u=(d||50)/2;s.push(c,t),a&&a.push(u,u)}else{const u={direction:n,sizes:[50,50],children:[c,t]};s.push(u),a&&d!==void 0&&a.push(d)}else s.push(c),a&&d!==void 0&&a.push(d);else hce(c,r).found?s.push(i(c)):s.push(c),a&&d!==void 0&&a.push(d)}return{...o,children:s,sizes:a}};return i(e)}function QM(e){const t=[],r=n=>{for(const i of n.children)Qh(i)?t.push(i):r(i)};return r(e),t}const mce="terminal-grid-storage",gce=2;function vce(e){return{id:e.id,sessionId:e.sessionId,cliTool:e.cliTool??null,displayMode:e.displayMode??"terminal",filePath:e.filePath??null}}function yce(e,t){if(t<2){const r=e,n={};for(const[i,o]of Object.entries(r.panes))n[i]=vce(o);return{layout:r.layout,panes:n,focusedPaneId:r.focusedPaneId,nextPaneIdCounter:r.nextPaneIdCounter}}return e}const Pv=e=>`tpane-${e}`;function bce(){const e=Pv(1);return{layout:{direction:"horizontal",sizes:[100],children:[e]},panes:{[e]:{id:e,sessionId:null,cliTool:null,displayMode:"terminal",filePath:null}},focusedPaneId:e,nextPaneIdCounter:2}}const Wg=bce(),YM={layout:Wg.layout,panes:Wg.panes,focusedPaneId:Wg.focusedPaneId,nextPaneIdCounter:Wg.nextPaneIdCounter},_ce=gn()(im(En((e,t)=>({...YM,setLayout:r=>{e({layout:r},!1,"terminalGrid/setLayout")},updateLayoutSizes:r=>{const n=t().layout;JSON.stringify(n.sizes)!==JSON.stringify(r)&&e({layout:{...n,sizes:r}},!1,"terminalGrid/updateLayoutSizes")},splitPane:(r,n)=>{const i=t(),o=Pv(i.nextPaneIdCounter),s=ZM(i.layout,o,r,n);return e({layout:s,panes:{...i.panes,[o]:{id:o,sessionId:null,cliTool:null,displayMode:"terminal",filePath:null}},focusedPaneId:o,nextPaneIdCounter:i.nextPaneIdCounter+1},!1,"terminalGrid/splitPane"),o},closePane:r=>{const n=t();if(QM(n.layout).length<=1)return;const o=pce(n.layout,r),s={...n.panes};delete s[r];let a=n.focusedPaneId;if(a===r){const l=QM(o);a=l.length>0?l[0]:null}e({layout:o,panes:s,focusedPaneId:a},!1,"terminalGrid/closePane")},assignSession:(r,n,i)=>{const o=t(),s=o.panes[r];s&&e({panes:{...o.panes,[r]:{...s,sessionId:n,cliTool:i!==void 0?i??null:n?s.cliTool:null}}},!1,"terminalGrid/assignSession")},setFocused:r=>{t().panes[r]&&e({focusedPaneId:r},!1,"terminalGrid/setFocused")},resetLayout:r=>{let n=t().nextPaneIdCounter;const i=()=>({id:Pv(n++),sessionId:null,cliTool:null,displayMode:"terminal",filePath:null});let o;const s={};switch(r){case"single":{const l=i();s[l.id]=l,o={direction:"horizontal",sizes:[100],children:[l.id]};break}case"split-h":{const l=i(),c=i();s[l.id]=l,s[c.id]=c,o={direction:"horizontal",sizes:[50,50],children:[l.id,c.id]};break}case"split-v":{const l=i(),c=i();s[l.id]=l,s[c.id]=c,o={direction:"vertical",sizes:[50,50],children:[l.id,c.id]};break}case"grid-2x2":{const l=i(),c=i(),d=i(),u=i();s[l.id]=l,s[c.id]=c,s[d.id]=d,s[u.id]=u,o={direction:"vertical",sizes:[50,50],children:[{direction:"horizontal",sizes:[50,50],children:[l.id,c.id]},{direction:"horizontal",sizes:[50,50],children:[d.id,u.id]}]};break}default:return}const a=Object.keys(s)[0]||null;e({layout:o,panes:s,focusedPaneId:a,nextPaneIdCounter:n},!1,"terminalGrid/resetLayout")},resetWorkspaceState:()=>{const r=t(),n=Object.keys(r.panes);if(n.length===0){e({...YM},!1,"terminalGrid/resetWorkspaceState");return}const i=n.reduce((s,a)=>{const l=r.panes[a];return s[a]={...l,sessionId:null,cliTool:null,displayMode:"terminal",filePath:null},s},{}),o=r.focusedPaneId&&i[r.focusedPaneId]?r.focusedPaneId:n[0]??null;e({layout:r.layout,panes:i,focusedPaneId:o,nextPaneIdCounter:r.nextPaneIdCounter},!1,"terminalGrid/resetWorkspaceState")},createSessionAndAssign:async(r,n,i)=>{try{const s=(await C0(n,i??void 0)).session,a=t(),l=a.panes[r];if(!(l!=null&&l.sessionId))return e({panes:{...a.panes,[r]:{...l,sessionId:s.sessionKey,cliTool:s.tool??n.tool??null}},focusedPaneId:r},!1,"terminalGrid/createSessionAndAssign"),{paneId:r,session:s};const d=Pv(a.nextPaneIdCounter),u=ZM(a.layout,d,r,"horizontal");return e({layout:u,panes:{...a.panes,[d]:{id:d,sessionId:s.sessionKey,cliTool:s.tool??n.tool??null,displayMode:"terminal",filePath:null}},focusedPaneId:d,nextPaneIdCounter:a.nextPaneIdCounter+1},!1,"terminalGrid/createSessionAndAssign"),{paneId:d,session:s}}catch(o){const s=o instanceof Error||o!=null&&o.message?o.message:String(o);throw console.error("Failed to create CLI session:",s,{config:n,projectPath:i,rawError:o}),new Error(s)}},setPaneDisplayMode:(r,n)=>{const i=t(),o=i.panes[r];o&&e({panes:{...i.panes,[r]:{...o,displayMode:n,filePath:n==="terminal"?null:o.filePath}}},!1,"terminalGrid/setPaneDisplayMode")},setPaneFilePath:(r,n)=>{const i=t(),o=i.panes[r];o&&e({panes:{...i.panes,[r]:{...o,filePath:n}}},!1,"terminalGrid/setPaneFilePath")},showFileInPane:(r,n)=>{const i=t(),o=i.panes[r];o&&e({panes:{...i.panes,[r]:{...o,displayMode:"file",filePath:n}},focusedPaneId:r},!1,"terminalGrid/showFileInPane")}}),{name:"TerminalGridStore"}),{name:mce,version:gce,migrate:yce,partialize:e=>({layout:e.layout,panes:e.panes,focusedPaneId:e.focusedPaneId,nextPaneIdCounter:e.nextPaneIdCounter})})),lUe=e=>e.layout,cUe=e=>e.panes,uUe=e=>e.focusedPaneId,Yx={title:"",description:"",type:"other",priority:"medium",tags:[],project_id:void 0},xce=[{id:"title",field:"title",title:"Issue 标题",description:"请输入一个简洁明确的标题"},{id:"description",field:"description",title:"Issue 描述",description:"请详细描述问题或需求"},{id:"type",field:"type",title:"Issue 类型",description:"选择 Issue 的类型"},{id:"priority",field:"priority",title:"优先级",description:"设置 Issue 的处理优先级",isOptional:!0},{id:"summary",field:"summary",title:"确认提交",description:"请确认以下信息后提交"}];gn()(En((e,t)=>({isOpen:!1,mode:"wizard",currentStep:0,steps:xce,formData:{...Yx},validationErrors:{},isSubmitting:!1,submitError:null,submittedIssueId:null,openDialog:(r="wizard")=>{e({isOpen:!0,mode:r,currentStep:0,formData:{...Yx},validationErrors:{},submitError:null,submittedIssueId:null})},closeDialog:()=>{e({isOpen:!1,isSubmitting:!1})},goToStep:r=>{const{steps:n,validateCurrentStep:i}=t();if(r>=0&&r<n.length){if(r>t().currentStep&&!i())return;e({currentStep:r})}},nextStep:()=>{const{currentStep:r,steps:n,validateCurrentStep:i}=t();r<n.length-1&&i()&&e({currentStep:r+1})},prevStep:()=>{const{currentStep:r}=t();r>0&&e({currentStep:r-1})},updateField:(r,n)=>{e(i=>({formData:{...i.formData,[r]:n},validationErrors:{...i.validationErrors,[r]:void 0}}))},setFormData:r=>{e(n=>({formData:{...n.formData,...r}}))},resetForm:()=>{e({formData:{...Yx},validationErrors:{},currentStep:0,submitError:null,submittedIssueId:null})},validateCurrentStep:()=>{var a;const{currentStep:r,steps:n,formData:i}=t(),o=(a=n[r])==null?void 0:a.field;if(o==="summary")return!0;const s={};return o==="title"&&(i.title.trim()?i.title.length>200&&(s.title="标题不能超过200个字符"):s.title="标题不能为空"),o==="description"&&(i.description.trim()?i.description.length>1e4&&(s.description="描述不能超过10000个字符"):s.description="描述不能为空"),e({validationErrors:s}),Object.keys(s).length===0},submitIssue:async()=>{var n,i;const{formData:r}=t();e({isSubmitting:!0,submitError:null});try{const o=await fetch("/api/issues",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:`ISSUE-${Date.now()}`,title:r.title,context:r.description,priority:r.priority==="urgent"?1:r.priority==="high"?2:r.priority==="medium"?3:4,tags:r.tags,status:"registered"})}),s=await o.json();return!o.ok||s.error?(e({isSubmitting:!1,submitError:s.error||"提交失败,请稍后重试"}),{success:!1,error:s.error}):(e({isSubmitting:!1,submittedIssueId:(n=s.issue)==null?void 0:n.id}),{success:!0,issueId:(i=s.issue)==null?void 0:i.id})}catch(o){const s=o instanceof Error?o.message:"网络错误,请稍后重试";return e({isSubmitting:!1,submitError:s}),{success:!1,error:s}}}}),{name:"issue-dialog-store"}));const JM={activeExecutions:{},currentExecutionId:null,isPanelOpen:!1},dA=gn()(En(e=>({...JM,handleExecutionMessage:t=>{const{type:r,payload:n}=t,{executionId:i,flowId:o,sessionKey:s,stepId:a,stepName:l,totalSteps:c,output:d,error:u,timestamp:p}=n;e(g=>{const _=g.activeExecutions[i];switch(r){case"EXECUTION_STARTED":return{activeExecutions:{...g.activeExecutions,[i]:{executionId:i,flowId:o,flowName:l||"Workflow",sessionKey:s??"",status:"running",totalSteps:c||0,completedSteps:0,steps:[],startedAt:p}},currentExecutionId:i,isPanelOpen:!0};case"EXECUTION_STEP_START":return _?{activeExecutions:{...g.activeExecutions,[i]:{..._,status:"running",currentStepId:a,steps:[..._.steps.filter(y=>y.id!==a),{id:a||"",name:l||"",status:"running",startedAt:p}]}}}:g;case"EXECUTION_STEP_PROGRESS":return!_||!a?g:{activeExecutions:{...g.activeExecutions,[i]:{..._,steps:_.steps.map(y=>y.id===a?{...y,output:(y.output||"")+(d||"")}:y)}}};case"EXECUTION_STEP_COMPLETE":return _?{activeExecutions:{...g.activeExecutions,[i]:{..._,completedSteps:_.completedSteps+1,steps:_.steps.map(y=>y.id===a?{...y,status:"completed",completedAt:p}:y)}}}:g;case"EXECUTION_STEP_FAILED":return _?{activeExecutions:{...g.activeExecutions,[i]:{..._,status:"paused",steps:_.steps.map(y=>y.id===a?{...y,status:"failed",error:u,completedAt:p}:y)}}}:g;case"EXECUTION_PAUSED":return _?{activeExecutions:{...g.activeExecutions,[i]:{..._,status:"paused"}}}:g;case"EXECUTION_RESUMED":return _?{activeExecutions:{...g.activeExecutions,[i]:{..._,status:"running"}}}:g;case"EXECUTION_STOPPED":return _?{activeExecutions:{...g.activeExecutions,[i]:{..._,status:"cancelled",completedAt:p}}}:g;case"EXECUTION_COMPLETED":return _?{activeExecutions:{...g.activeExecutions,[i]:{..._,status:"completed",completedAt:p}}}:g;case"EXECUTION_FAILED":return _?{activeExecutions:{...g.activeExecutions,[i]:{..._,status:"failed",completedAt:p}}}:g;default:return g}},!1,`handleExecutionMessage/${r}`)},selectExecution:t=>{e({currentExecutionId:t},!1,"selectExecution")},pauseExecution:async t=>{try{const n=await(await fetch(`/api/orchestrator/executions/${t}/pause`,{method:"POST",headers:{"Content-Type":"application/json"}})).json();n.success||console.error("[ExecutionMonitor] Pause failed:",n.error)}catch(r){console.error("[ExecutionMonitor] Pause error:",r)}},resumeExecution:async t=>{try{const n=await(await fetch(`/api/orchestrator/executions/${t}/resume`,{method:"POST",headers:{"Content-Type":"application/json"}})).json();n.success||console.error("[ExecutionMonitor] Resume failed:",n.error)}catch(r){console.error("[ExecutionMonitor] Resume error:",r)}},stopExecution:async t=>{try{const n=await(await fetch(`/api/orchestrator/executions/${t}/stop`,{method:"POST",headers:{"Content-Type":"application/json"}})).json();n.success||console.error("[ExecutionMonitor] Stop failed:",n.error)}catch(r){console.error("[ExecutionMonitor] Stop error:",r)}},setPanelOpen:t=>{e({isPanelOpen:t},!1,"setPanelOpen")},clearExecution:t=>{e(r=>{const n={...r.activeExecutions};return delete n[t],{activeExecutions:n,currentExecutionId:r.currentExecutionId===t?null:r.currentExecutionId}},!1,"clearExecution")},clearAllExecutions:()=>{e({activeExecutions:{},currentExecutionId:null},!1,"clearAllExecutions")},resetState:()=>{e({...JM},!1,"resetState")}}),{name:"ExecutionMonitorStore"})),dUe=e=>e.activeExecutions,fUe=e=>e.currentExecutionId?e.activeExecutions[e.currentExecutionId]:null,hUe=e=>Object.values(e.activeExecutions).filter(t=>t.status==="running"||t.status==="paused").length;function be(e,t,r){function n(a,l){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:l,constr:s,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,l);const c=s.prototype,d=Object.keys(c);for(let u=0;u<d.length;u++){const p=d[u];p in a||(a[p]=c[p].bind(a))}}const i=(r==null?void 0:r.Parent)??Object;class o extends i{}Object.defineProperty(o,"name",{value:e});function s(a){var l;const c=r!=null&&r.Parent?new o:this;n(c,a),(l=c._zod).deferred??(l.deferred=[]);for(const d of c._zod.deferred)d();return c}return Object.defineProperty(s,"init",{value:n}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>{var l,c;return r!=null&&r.Parent&&a instanceof r.Parent?!0:(c=(l=a==null?void 0:a._zod)==null?void 0:l.traits)==null?void 0:c.has(e)}}),Object.defineProperty(s,"name",{value:e}),s}class Du extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class iH extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const oH={};function Ja(e){return oH}function sH(e){const t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,i])=>t.indexOf(+n)===-1).map(([n,i])=>i)}function Pk(e,t){return typeof t=="bigint"?t.toString():t}function E0(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function fA(e){return e==null}function hA(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function wce(e,t){const r=(e.toString().split(".")[1]||"").length,n=t.toString();let i=(n.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(n)){const l=n.match(/\d?e-(\d?)/);l!=null&&l[1]&&(i=Number.parseInt(l[1]))}const o=r>i?r:i,s=Number.parseInt(e.toFixed(o).replace(".","")),a=Number.parseInt(t.toFixed(o).replace(".",""));return s%a/10**o}const ej=Symbol("evaluating");function Ht(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==ej)return n===void 0&&(n=ej,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function Pc(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Ac(...e){const t={};for(const r of e){const n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function tj(e){return JSON.stringify(e)}function Sce(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const aH="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Yh(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Cce=E0(()=>{var e;if(typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function id(e){if(Yh(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const r=t.prototype;return!(Yh(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function lH(e){return id(e)?{...e}:Array.isArray(e)?[...e]:e}const Ece=new Set(["string","number","symbol"]);function od(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ol(e,t,r){const n=new e._zod.constr(t??e._zod.def);return(!t||r!=null&&r.parent)&&(n._zod.parent=e),n}function Je(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function kce(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const Tce={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Pce(e,t){const r=e._zod.def,n=Ac(e._zod.def,{get shape(){const i={};for(const o in t){if(!(o in r.shape))throw new Error(`Unrecognized key: "${o}"`);t[o]&&(i[o]=r.shape[o])}return Pc(this,"shape",i),i},checks:[]});return ol(e,n)}function Ace(e,t){const r=e._zod.def,n=Ac(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const o in t){if(!(o in r.shape))throw new Error(`Unrecognized key: "${o}"`);t[o]&&delete i[o]}return Pc(this,"shape",i),i},checks:[]});return ol(e,n)}function Oce(e,t){if(!id(t))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const i=Ac(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return Pc(this,"shape",o),o},checks:[]});return ol(e,i)}function Ice(e,t){if(!id(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r={...e._zod.def,get shape(){const n={...e._zod.def.shape,...t};return Pc(this,"shape",n),n},checks:e._zod.def.checks};return ol(e,r)}function Rce(e,t){const r=Ac(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return Pc(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return ol(e,r)}function Nce(e,t,r){const n=Ac(t._zod.def,{get shape(){const i=t._zod.def.shape,o={...i};if(r)for(const s in r){if(!(s in i))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=e?new e({type:"optional",innerType:i[s]}):i[s])}else for(const s in i)o[s]=e?new e({type:"optional",innerType:i[s]}):i[s];return Pc(this,"shape",o),o},checks:[]});return ol(t,n)}function Mce(e,t,r){const n=Ac(t._zod.def,{get shape(){const i=t._zod.def.shape,o={...i};if(r)for(const s in r){if(!(s in o))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=new e({type:"nonoptional",innerType:i[s]}))}else for(const s in i)o[s]=new e({type:"nonoptional",innerType:i[s]});return Pc(this,"shape",o),o},checks:[]});return ol(t,n)}function ku(e,t=0){var r;if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(((r=e.issues[n])==null?void 0:r.continue)!==!0)return!0;return!1}function Tu(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function Vg(e){return typeof e=="string"?e:e==null?void 0:e.message}function el(e,t,r){var i,o,s,a,l,c;const n={...e,path:e.path??[]};if(!e.message){const d=Vg((s=(o=(i=e.inst)==null?void 0:i._zod.def)==null?void 0:o.error)==null?void 0:s.call(o,e))??Vg((a=t==null?void 0:t.error)==null?void 0:a.call(t,e))??Vg((l=r.customError)==null?void 0:l.call(r,e))??Vg((c=r.localeError)==null?void 0:c.call(r,e))??"Invalid input";n.message=d}return delete n.inst,delete n.continue,t!=null&&t.reportInput||delete n.input,n}function pA(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Jh(...e){const[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}const cH=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Pk,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},uH=be("$ZodError",cH),dH=be("$ZodError",cH,{Parent:Error});function jce(e,t=r=>r.message){const r={},n=[];for(const i of e.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(t(i))):n.push(t(i));return{formErrors:n,fieldErrors:r}}function Dce(e,t=r=>r.message){const r={_errors:[]},n=i=>{for(const o of i.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(s=>n({issues:s}));else if(o.code==="invalid_key")n({issues:o.issues});else if(o.code==="invalid_element")n({issues:o.issues});else if(o.path.length===0)r._errors.push(t(o));else{let s=r,a=0;for(;a<o.path.length;){const l=o.path[a];a===o.path.length-1?(s[l]=s[l]||{_errors:[]},s[l]._errors.push(t(o))):s[l]=s[l]||{_errors:[]},s=s[l],a++}}};return n(e),r}const mA=e=>(t,r,n,i)=>{const o=n?Object.assign(n,{async:!1}):{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new Du;if(s.issues.length){const a=new((i==null?void 0:i.Err)??e)(s.issues.map(l=>el(l,o,Ja())));throw aH(a,i==null?void 0:i.callee),a}return s.value},gA=e=>async(t,r,n,i)=>{const o=n?Object.assign(n,{async:!0}):{async:!0};let s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){const a=new((i==null?void 0:i.Err)??e)(s.issues.map(l=>el(l,o,Ja())));throw aH(a,i==null?void 0:i.callee),a}return s.value},k0=e=>(t,r,n)=>{const i=n?{...n,async:!1}:{async:!1},o=t._zod.run({value:r,issues:[]},i);if(o instanceof Promise)throw new Du;return o.issues.length?{success:!1,error:new(e??uH)(o.issues.map(s=>el(s,i,Ja())))}:{success:!0,data:o.value}},Lce=k0(dH),T0=e=>async(t,r,n)=>{const i=n?Object.assign(n,{async:!0}):{async:!0};let o=t._zod.run({value:r,issues:[]},i);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(s=>el(s,i,Ja())))}:{success:!0,data:o.value}},$ce=T0(dH),Bce=e=>(t,r,n)=>{const i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return mA(e)(t,r,i)},Fce=e=>(t,r,n)=>mA(e)(t,r,n),zce=e=>async(t,r,n)=>{const i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return gA(e)(t,r,i)},Uce=e=>async(t,r,n)=>gA(e)(t,r,n),Hce=e=>(t,r,n)=>{const i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return k0(e)(t,r,i)},qce=e=>(t,r,n)=>k0(e)(t,r,n),Wce=e=>async(t,r,n)=>{const i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return T0(e)(t,r,i)},Vce=e=>async(t,r,n)=>T0(e)(t,r,n),Gce=/^[cC][^\s-]{8,}$/,Kce=/^[0-9a-z]+$/,Xce=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Zce=/^[0-9a-vA-V]{20}$/,Qce=/^[A-Za-z0-9]{27}$/,Yce=/^[a-zA-Z0-9_-]{21}$/,Jce=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,eue=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,rj=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,tue=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,rue="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function nue(){return new RegExp(rue,"u")}const iue=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,oue=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,sue=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,aue=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,lue=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,fH=/^[A-Za-z0-9_-]*$/,cue=/^\+(?:[0-9]){6,14}[0-9]$/,hH="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",uue=new RegExp(`^${hH}$`);function pH(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function due(e){return new RegExp(`^${pH(e)}$`)}function fue(e){const t=pH({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${t}(?:${r.join("|")})`;return new RegExp(`^${hH}T(?:${n})$`)}const hue=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},pue=/^-?\d+$/,mue=/^-?\d+(?:\.\d+)?/,gue=/^(?:true|false)$/i,vue=/^[^A-Z]*$/,yue=/^[^a-z]*$/,di=be("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),mH={number:"number",bigint:"bigint",object:"date"},gH=be("$ZodCheckLessThan",(e,t)=>{di.init(e,t);const r=mH[typeof t.value];e._zod.onattach.push(n=>{const i=n._zod.bag,o=(t.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<o&&(t.inclusive?i.maximum=t.value:i.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:r,code:"too_big",maximum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),vH=be("$ZodCheckGreaterThan",(e,t)=>{di.init(e,t);const r=mH[typeof t.value];e._zod.onattach.push(n=>{const i=n._zod.bag,o=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>o&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),bue=be("$ZodCheckMultipleOf",(e,t)=>{di.init(e,t),e._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):wce(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),_ue=be("$ZodCheckNumberFormat",(e,t)=>{var s;di.init(e,t),t.format=t.format||"float64";const r=(s=t.format)==null?void 0:s.includes("int"),n=r?"int":"number",[i,o]=Tce[t.format];e._zod.onattach.push(a=>{const l=a._zod.bag;l.format=t.format,l.minimum=i,l.maximum=o,r&&(l.pattern=pue)}),e._zod.check=a=>{const l=a.value;if(r){if(!Number.isInteger(l)){a.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?a.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort}):a.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort});return}}l<i&&a.issues.push({origin:"number",input:l,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),l>o&&a.issues.push({origin:"number",input:l,code:"too_big",maximum:o,inst:e})}}),xue=be("$ZodCheckMaxLength",(e,t)=>{var r;di.init(e,t),(r=e._zod.def).when??(r.when=n=>{const i=n.value;return!fA(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{const i=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const i=n.value;if(i.length<=t.maximum)return;const s=pA(i);n.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),wue=be("$ZodCheckMinLength",(e,t)=>{var r;di.init(e,t),(r=e._zod.def).when??(r.when=n=>{const i=n.value;return!fA(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{const i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const i=n.value;if(i.length>=t.minimum)return;const s=pA(i);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Sue=be("$ZodCheckLengthEquals",(e,t)=>{var r;di.init(e,t),(r=e._zod.def).when??(r.when=n=>{const i=n.value;return!fA(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{const i=n._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=n=>{const i=n.value,o=i.length;if(o===t.length)return;const s=pA(i),a=o>t.length;n.issues.push({origin:s,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),P0=be("$ZodCheckStringFormat",(e,t)=>{var r,n;di.init(e,t),e._zod.onattach.push(i=>{const o=i._zod.bag;o.format=t.format,t.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),Cue=be("$ZodCheckRegex",(e,t)=>{P0.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Eue=be("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=vue),P0.init(e,t)}),kue=be("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=yue),P0.init(e,t)}),Tue=be("$ZodCheckIncludes",(e,t)=>{di.init(e,t);const r=od(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(i=>{const o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),Pue=be("$ZodCheckStartsWith",(e,t)=>{di.init(e,t);const r=new RegExp(`^${od(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Aue=be("$ZodCheckEndsWith",(e,t)=>{di.init(e,t);const r=new RegExp(`.*${od(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Oue=be("$ZodCheckOverwrite",(e,t)=>{di.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class Iue{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const n=t.split(`
|
|
522
|
+
`);const b=v.state[a];if(b==null)return;JSON.stringify(i.getState())!==JSON.stringify(b)&&g(b);return}AM(i)&&i.dispatch(v)});case"DISPATCH":switch(y.payload.type){case"RESET":return g(_),a===void 0?d==null?void 0:d.init(i.getState()):d==null?void 0:d.init(Ug(l.name));case"COMMIT":if(a===void 0){d==null||d.init(i.getState());return}return d==null?void 0:d.init(Ug(l.name));case"ROLLBACK":return Kx(y.state,v=>{if(a===void 0){g(v),d==null||d.init(i.getState());return}g(v[a]),d==null||d.init(Ug(l.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return Kx(y.state,v=>{if(a===void 0){g(v);return}JSON.stringify(i.getState())!==JSON.stringify(v[a])&&g(v[a])});case"IMPORT_STATE":{const{nextLiftedState:v}=y.payload,b=(m=v.computedStates.slice(-1)[0])==null?void 0:m.state;if(!b)return;g(a===void 0?b:b[a]),d==null||d.send(null,v);return}case"PAUSE_RECORDING":return p=!p}return}}),_},En=Wne,Kx=(e,t)=>{let r;try{r=JSON.parse(e)}catch(n){console.error("[zustand devtools middleware] Could not parse the received json",n)}r!==void 0&&t(r)};function Vne(e,t){let r;try{r=e()}catch{return}return{getItem:i=>{var o;const s=l=>l===null?null:JSON.parse(l,void 0),a=(o=r.getItem(i))!=null?o:null;return a instanceof Promise?a.then(s):s(a)},setItem:(i,o)=>r.setItem(i,JSON.stringify(o,void 0)),removeItem:i=>r.removeItem(i)}}const _k=e=>t=>{try{const r=e(t);return r instanceof Promise?r:{then(n){return _k(n)(r)},catch(n){return this}}}catch(r){return{then(n){return this},catch(n){return _k(n)(r)}}}},Gne=(e,t)=>(r,n,i)=>{let o={storage:Vne(()=>window.localStorage),partialize:m=>m,version:0,merge:(m,v)=>({...v,...m}),...t},s=!1,a=0;const l=new Set,c=new Set;let d=o.storage;if(!d)return e((...m)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),r(...m)},n,i);const u=()=>{const m=o.partialize({...n()});return d.setItem(o.name,{state:m,version:o.version})},p=i.setState;i.setState=(m,v)=>(p(m,v),u());const g=e((...m)=>(r(...m),u()),n,i);i.getInitialState=()=>g;let _;const y=()=>{var m,v;if(!d)return;const b=++a;s=!1,l.forEach(E=>{var C;return E((C=n())!=null?C:g)});const x=((v=o.onRehydrateStorage)==null?void 0:v.call(o,(m=n())!=null?m:g))||void 0;return _k(d.getItem.bind(d))(o.name).then(E=>{if(E)if(typeof E.version=="number"&&E.version!==o.version){if(o.migrate){const C=o.migrate(E.state,E.version);return C instanceof Promise?C.then(k=>[!0,k]):[!0,C]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,E.state];return[!1,void 0]}).then(E=>{var C;if(b!==a)return;const[k,P]=E;if(_=o.merge(P,(C=n())!=null?C:g),r(_,!0),k)return u()}).then(()=>{b===a&&(x==null||x(_,void 0),_=n(),s=!0,c.forEach(E=>E(_)))}).catch(E=>{b===a&&(x==null||x(void 0,E))})};return i.persist={setOptions:m=>{o={...o,...m},m.storage&&(d=m.storage)},clearStorage:()=>{d==null||d.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>y(),hasHydrated:()=>s,onHydrate:m=>(l.add(m),()=>{l.delete(m)}),onFinishHydration:m=>(c.add(m),()=>{c.delete(m)})},o.skipHydration||y(),_||g},im=Gne,Na={WORKFLOW_TASK:"workflow-task",RECENT_SESSIONS:"recent-sessions"},Kne=[{i:Na.WORKFLOW_TASK,name:"Workflow & Tasks",visible:!0,minW:6,minH:4},{i:Na.RECENT_SESSIONS,name:"Recent Sessions",visible:!0,minW:6,minH:3}],Xne={lg:[{i:Na.WORKFLOW_TASK,x:0,y:0,w:12,h:5,minW:6,minH:4},{i:Na.RECENT_SESSIONS,x:0,y:5,w:12,h:4,minW:6,minH:3}],md:[{i:Na.WORKFLOW_TASK,x:0,y:0,w:6,h:5,minW:4,minH:4},{i:Na.RECENT_SESSIONS,x:0,y:5,w:6,h:4,minW:4,minH:3}],sm:[{i:Na.WORKFLOW_TASK,x:0,y:0,w:2,h:8,minW:2,minH:6},{i:Na.RECENT_SESSIONS,x:0,y:8,w:2,h:5,minW:2,minH:4}]},Xx={widgets:Kne,layouts:Xne},Zne=(e,t,r)=>{const n=e[t];return n?typeof n=="function"?n():Promise.resolve(n):new Promise((i,o)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(o.bind(null,new Error("Unknown variable dynamic import: "+t+(t.split("/").length!==r?". Note that variables only represent file names one level deep.":""))))})},qze={en:"English",zh:"中文"};function Qne(){if(typeof window>"u")return"zh";const e=navigator.language.toLowerCase();return e.startsWith("zh")?"zh":e.startsWith("en")?"en":"zh"}function Hv(){var e;if(typeof window>"u")return"zh";try{const t=localStorage.getItem("ccw-app-store");if(t){const r=JSON.parse(t);if((e=r.state)!=null&&e.locale&&(r.state.locale==="en"||r.state.locale==="zh"))return r.state.locale}}catch{}return Qne()}async function Yne(e){try{return(await Zne(Object.assign({"../locales/en/index.ts":()=>Lt(()=>import("./index-CeESlrZb.js"),[]),"../locales/zh/index.ts":()=>Lt(()=>import("./index-BpoRYgiq.js"),[])}),`../locales/${e}/index.ts`,4)).default||{}}catch(t){return console.error(`Failed to load messages for locale "${e}":`,t),{}}}const nA={en:{},zh:{}};async function Jne(e){const t=await Yne(e);return nA[e]=t,xk(e),t}const Kz=KP();let Xz=ZP({locale:Hv(),messages:nA[Hv()]},Kz);function xk(e){Xz=ZP({locale:e,messages:nA[e]},Kz),typeof document<"u"&&(document.documentElement.lang=e)}function Wze(e,t){return Xz.formatMessage({id:e},t)}const Zz=[{id:"blue",name:"经典蓝",accentColor:"#5b8fc4",description:"Classic professional blue tone"},{id:"green",name:"深邃绿",accentColor:"#10b981",description:"Deep natural green tone"},{id:"orange",name:"活力橙",accentColor:"#f97316",description:"Vibrant energetic orange tone"},{id:"purple",name:"优雅紫",accentColor:"#a855f7",description:"Elegant creative purple tone"}],Qz=[{id:"light",name:"浅色"},{id:"dark",name:"深色"}];function Yz(e,t){return`${t}-${e}`}function eie(e,t){const r=Zz.find(i=>i.id===e),n=Qz.find(i=>i.id===t);return!r||!n?"Unknown Theme":`${r.name} · ${n.name}`}Zz.flatMap(e=>Qz.map(t=>({id:Yz(e.id,t.id),scheme:e.id,mode:t.id,name:eie(e.id,t.id)})));const Jz={blur:0,darkenOpacity:0,saturation:100,enableFrostedGlass:!1,enableGrain:!1,enableVignette:!1},Go={mode:"gradient-only",imageUrl:null,attribution:null,effects:Jz},wk=3,tie={id:"default",name:"Default",colorScheme:"blue",customHue:null,isCustomTheme:!1,gradientLevel:"standard",enableHoverGlow:!0,enableBackgroundAnimation:!1,styleTier:"standard",isDefault:!0},rie={soft:{saturationScale:.6,lightnessOffset:{light:5,dark:-3},contrastBoost:.9},standard:{saturationScale:1,lightnessOffset:{light:0,dark:0},contrastBoost:1},"high-contrast":{saturationScale:1.3,lightnessOffset:{light:-5,dark:3},contrastBoost:1.2}};function nie(e){const r=e.trim().match(/^([\d.]+)\s+([\d.]+)%?\s+([\d.]+)%?$/);if(!r)return null;const n=parseFloat(r[1]),i=parseFloat(r[2]),o=parseFloat(r[3]);return isNaN(n)||isNaN(i)||isNaN(o)?null:{h:n,s:i,l:o}}function iie(e,t,r){const n=Math.max(0,Math.min(100,Math.round(t*10)/10)),i=Math.max(0,Math.min(100,Math.round(r*10)/10));return`${Math.round(e)} ${n}% ${i}%`}function OM(e,t,r){if(t==="standard")return e;const n=rie[t],i=r==="light"?n.lightnessOffset.light:n.lightnessOffset.dark,o={};for(const[s,a]of Object.entries(e)){const l=nie(a);if(!l){o[s]=a;continue}let c=l.s*n.saturationScale;c=Math.max(0,Math.min(100,c));let d=50+(l.l-50)*n.contrastBoost;d=d+i,d=Math.max(0,Math.min(100,d)),o[s]=iie(l.h,c,d)}return o}function oie(e,t){const r=(e%360+360)%360,n={};if(t==="light"){n["--bg"]=`${r} 5% 98%`,n["--bg-secondary"]=`${r} 8% 96%`,n["--surface"]=`${r} 10% 99%`,n["--surface-hover"]=`${r} 12% 97%`,n["--border"]=`${r} 15% 88%`,n["--border-hover"]=`${r} 18% 82%`,n["--text"]=`${r} 20% 15%`,n["--text-secondary"]=`${r} 10% 45%`,n["--text-tertiary"]=`${r} 8% 60%`,n["--text-disabled"]=`${r} 5% 70%`,n["--accent"]=`${r} 70% 60%`,n["--accent-hover"]=`${r} 75% 55%`,n["--accent-active"]=`${r} 80% 50%`,n["--accent-light"]=`${r} 65% 90%`,n["--accent-lighter"]=`${r} 60% 95%`,n["--primary"]=`${r} 70% 60%`,n["--primary-hover"]=`${r} 75% 55%`,n["--primary-light"]=`${r} 65% 90%`,n["--primary-lighter"]=`${r} 60% 95%`;const i=(r+180)%360;n["--secondary"]=`${i} 60% 65%`,n["--secondary-hover"]=`${i} 65% 60%`,n["--secondary-light"]=`${i} 55% 90%`,n["--muted"]=`${r} 12% 92%`,n["--muted-hover"]=`${r} 15% 88%`,n["--muted-text"]=`${r} 10% 45%`,n["--success"]="120 60% 50%",n["--success-light"]="120 55% 92%",n["--success-text"]="120 70% 35%",n["--warning"]="38 90% 55%",n["--warning-light"]="38 85% 92%",n["--warning-text"]="38 95% 40%",n["--error"]="0 70% 55%",n["--error-light"]="0 65% 92%",n["--error-text"]="0 75% 40%",n["--info"]="200 70% 55%",n["--info-light"]="200 65% 92%",n["--info-text"]="200 75% 40%",n["--destructive"]="0 70% 55%",n["--destructive-hover"]="0 75% 50%",n["--destructive-light"]="0 65% 92%",n["--hover"]=`${r} 12% 94%`,n["--active"]=`${r} 15% 90%`,n["--focus"]=`${r} 70% 60%`,n["--background"]=n["--bg"],n["--foreground"]=n["--text"],n["--card"]=n["--surface"],n["--card-foreground"]=n["--text"],n["--primary-foreground"]="0 0% 100%",n["--secondary-foreground"]="0 0% 100%",n["--accent-foreground"]="0 0% 100%",n["--destructive-foreground"]="0 0% 100%",n["--muted-foreground"]=n["--text-secondary"],n["--sidebar-background"]=`${r} 30% 97%`,n["--sidebar-foreground"]=n["--text"],n["--input"]=n["--border"],n["--ring"]=n["--accent"],n["--indigo"]="239 65% 60%",n["--indigo-light"]="239 65% 92%",n["--orange"]="25 90% 55%",n["--orange-light"]="25 90% 92%"}else{n["--bg"]=`${r} 20% 10%`,n["--bg-secondary"]=`${r} 18% 12%`,n["--surface"]=`${r} 15% 14%`,n["--surface-hover"]=`${r} 18% 16%`,n["--border"]=`${r} 10% 22%`,n["--border-hover"]=`${r} 12% 28%`,n["--text"]=`${r} 10% 90%`,n["--text-secondary"]=`${r} 8% 65%`,n["--text-tertiary"]=`${r} 6% 50%`,n["--text-disabled"]=`${r} 5% 40%`,n["--accent"]=`${r} 70% 60%`,n["--accent-hover"]=`${r} 75% 65%`,n["--accent-active"]=`${r} 80% 70%`,n["--accent-light"]=`${r} 60% 25%`,n["--accent-lighter"]=`${r} 55% 20%`,n["--primary"]=`${r} 70% 60%`,n["--primary-hover"]=`${r} 75% 65%`,n["--primary-light"]=`${r} 60% 25%`,n["--primary-lighter"]=`${r} 55% 20%`;const i=(r+180)%360;n["--secondary"]=`${i} 60% 65%`,n["--secondary-hover"]=`${i} 65% 70%`,n["--secondary-light"]=`${i} 55% 25%`,n["--muted"]=`${r} 15% 18%`,n["--muted-hover"]=`${r} 18% 22%`,n["--muted-text"]=`${r} 8% 65%`,n["--success"]="120 60% 55%",n["--success-light"]="120 50% 20%",n["--success-text"]="120 65% 65%",n["--warning"]="38 90% 60%",n["--warning-light"]="38 80% 22%",n["--warning-text"]="38 95% 70%",n["--error"]="0 70% 60%",n["--error-light"]="0 60% 20%",n["--error-text"]="0 75% 70%",n["--info"]="200 70% 60%",n["--info-light"]="200 60% 20%",n["--info-text"]="200 75% 70%",n["--destructive"]="0 70% 60%",n["--destructive-hover"]="0 75% 65%",n["--destructive-light"]="0 60% 20%",n["--hover"]=`${r} 18% 16%`,n["--active"]=`${r} 20% 20%`,n["--focus"]=`${r} 70% 60%`,n["--background"]=n["--bg"],n["--foreground"]=n["--text"],n["--card"]=n["--surface"],n["--card-foreground"]=n["--text"],n["--primary-foreground"]=`${r} 30% 10%`,n["--secondary-foreground"]="0 0% 100%",n["--accent-foreground"]=`${r} 30% 10%`,n["--destructive-foreground"]="0 0% 100%",n["--muted-foreground"]=n["--text-secondary"],n["--sidebar-background"]=`${r} 25% 12%`,n["--sidebar-foreground"]=n["--text"],n["--input"]=n["--border"],n["--ring"]=n["--accent"],n["--indigo"]="239 60% 55%",n["--indigo-light"]="239 40% 20%",n["--orange"]="25 85% 50%",n["--orange-light"]="25 50% 20%"}return n}const sie=[["--text","--bg",4.5],["--text","--surface",4.5],["--text-secondary","--bg",4.5],["--text-secondary","--surface",4.5],["--muted-text","--muted",4.5],["--muted-text","--bg",4.5],["--text-tertiary","--bg",3],["--text-disabled","--bg",3],["--accent","--bg",3],["--accent","--surface",3],["--success-text","--success-light",4.5],["--warning-text","--warning-light",4.5],["--error-text","--error-light",4.5],["--info-text","--info-light",4.5],["--primary-foreground","--primary",4.5],["--destructive-foreground","--destructive",4.5],["--text","--muted",4.5]];function Sk(e){const r=e.trim().match(/^([\d.]+)\s+([\d.]+)%?\s+([\d.]+)%?$/);if(!r)return null;const n=parseFloat(r[1]),i=parseFloat(r[2])/100,o=parseFloat(r[3])/100;return isNaN(n)||isNaN(i)||isNaN(o)?null:[n,i,o]}function aie(e,t,r){const n=(1-Math.abs(2*r-1))*t,i=e/60,o=n*(1-Math.abs(i%2-1)),s=r-n/2;let a,l,c;i<1?(a=n,l=o,c=0):i<2?(a=o,l=n,c=0):i<3?(a=0,l=n,c=o):i<4?(a=0,l=o,c=n):i<5?(a=o,l=0,c=n):(a=n,l=0,c=o);const d=a+s,u=l+s,p=c+s,g=_=>_<=.04045?_/12.92:Math.pow((_+.055)/1.055,2.4);return[g(d),g(u),g(p)]}function Wa(e){const t=Sk(e);if(!t)return-1;const[r,n,i]=t,[o,s,a]=aie(r,n,i);return Math.round((.2126*o+.7152*s+.0722*a)*1e4)/1e4}function Xh(e,t){const r=Math.max(e,t),n=Math.min(e,t);return Math.round((r+.05)/(n+.05)*100)/100}function IM(e){const t=[];for(const[r,n,i]of sie){const o=e[r],s=e[n];if(!o||!s)continue;const a=Wa(o),l=Wa(s);if(a<0||l<0)continue;const c=Xh(a,l),d=c>=i-.01;t.push({fgVar:r,bgVar:n,ratio:c,required:i,passed:d})}return t}function qv(e,t,r){const n=Math.max(0,Math.min(100,Math.round(r*10)/10)),i=Math.max(0,Math.min(100,Math.round(t*10)/10));return`${Math.round(e)} ${i}% ${n}%`}function Vze(e,t,r,n){const i=r[e],o=r[t];if(!i||!o)return[];const s=Sk(i),a=Sk(o);if(!s||!a)return[];const l=[],c=Wa(o),d=RM(s[0],s[1],s[2],c,n);for(const g of d){const _=qv(s[0],s[1]*100,g*100),y=Wa(_);if(y<0)continue;const m=Xh(y,c);m>=n-.01&&l.push({target:"fg",original:i,suggested:_,resultRatio:m,distance:Math.abs(g-s[2])})}const u=Wa(i),p=RM(a[0],a[1],a[2],u,n);for(const g of p){const _=qv(a[0],a[1]*100,g*100),y=Wa(_);if(y<0)continue;const m=Xh(u,y);m>=n-.01&&l.push({target:"bg",original:o,suggested:_,resultRatio:m,distance:Math.abs(g-a[2])})}return l.sort((g,_)=>g.distance-_.distance),l.slice(0,3)}function RM(e,t,r,n,i){const o=[];for(let a=r-.01;a>=0;a-=.01){const l=qv(e,t*100,a*100),c=Wa(l);if(c<0)continue;if(Xh(c,n)>=i){o.push(a);break}}for(let a=r+.01;a<=1;a+=.01){const l=qv(e,t*100,a*100),c=Wa(l);if(c<0)continue;if(Xh(c,n)>=i){o.push(a);break}}return o}function Ck(e){return e==="reduce"?!0:e==="enable"||typeof window>"u"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}const eU=()=>typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",rh=e=>e==="system"?eU():e,wo=(e,t)=>{const r=e.find(n=>n.id===t);return(r==null?void 0:r.styleTier)??"standard"},Ln=(e,t,r,n="standard",i=!0,o=!1,s="system",a="standard")=>{if(typeof document>"u")return;const l=()=>{document.documentElement.classList.remove("light","dark"),document.documentElement.classList.add(e);const d=["--bg","--bg-secondary","--surface","--surface-hover","--border","--border-hover","--text","--text-secondary","--text-tertiary","--text-disabled","--accent","--accent-hover","--accent-active","--accent-light","--accent-lighter","--primary","--primary-hover","--primary-light","--primary-lighter","--secondary","--secondary-hover","--secondary-light","--muted","--muted-hover","--muted-text","--success","--success-light","--success-text","--warning","--warning-light","--warning-text","--error","--error-light","--error-text","--info","--info-light","--info-text","--destructive","--destructive-hover","--destructive-light","--hover","--active","--focus","--background","--foreground","--card","--card-foreground","--primary-foreground","--secondary-foreground","--accent-foreground","--destructive-foreground","--muted-foreground","--sidebar-background","--sidebar-foreground","--input","--ring","--indigo","--indigo-light","--orange","--orange-light"];if(r!==null){let p=oie(r,e);if(a!=="standard"&&(p=OM(p,a,e)),Object.entries(p).forEach(([g,_])=>{document.documentElement.style.setProperty(g,_)}),document.documentElement.setAttribute("data-theme",`custom-${e}`),a!=="standard"){const _=IM(p).filter(y=>!y.passed);_.length>0&&console.warn('[Theme] Style tier "%s" caused %d WCAG AA contrast failures:',a,_.length,_.map(y=>`${y.fgVar}/${y.bgVar}: ${y.ratio}:1 (min ${y.required}:1)`))}}else{d.forEach(g=>{document.documentElement.style.removeProperty(g)});const p=Yz(t,e);if(document.documentElement.setAttribute("data-theme",p),a!=="standard"){const g=getComputedStyle(document.documentElement),_={};for(const b of d){const x=g.getPropertyValue(b).trim();x&&(_[b]=x)}const y=OM(_,a,e);Object.entries(y).forEach(([b,x])=>{document.documentElement.style.setProperty(b,x)});const v=IM(y).filter(b=>!b.passed);v.length>0&&console.warn('[Theme] Style tier "%s" on preset "%s" caused %d WCAG AA contrast failures:',a,t,v.length,v.map(b=>`${b.fgVar}/${b.bgVar}: ${b.ratio}:1 (min ${b.required}:1)`))}}document.documentElement.setAttribute("data-color-scheme",t),document.documentElement.setAttribute("data-gradient",n),document.documentElement.setAttribute("data-hover-glow",String(i)),document.documentElement.setAttribute("data-bg-animation",String(o));const u=Ck(s);document.documentElement.setAttribute("data-reduced-motion",String(u)),document.documentElement.setAttribute("data-style-tier",a)};!Ck(s)&&typeof document<"u"&&"startViewTransition"in document?document.startViewTransition(l):l()},wu=e=>{if(typeof document>"u")return;const t=document.documentElement;t.setAttribute("data-bg-mode",e.mode),t.setAttribute("data-bg-blur",String(e.effects.blur)),t.setAttribute("data-bg-darken",String(e.effects.darkenOpacity)),t.setAttribute("data-bg-saturation",String(e.effects.saturation)),t.setAttribute("data-bg-frosted",String(e.effects.enableFrostedGlass)),t.setAttribute("data-bg-grain",String(e.effects.enableGrain)),t.setAttribute("data-bg-vignette",String(e.effects.enableVignette))},lie={theme:"system",resolvedTheme:"light",colorScheme:"blue",customHue:null,isCustomTheme:!1,gradientLevel:"standard",enableHoverGlow:!0,enableBackgroundAnimation:!1,motionPreference:"system",locale:Hv(),sidebarOpen:!0,sidebarCollapsed:!1,expandedNavGroups:["overview","workflow","knowledge","issues","tools","configuration"],currentView:"sessions",currentFilter:"all",currentLiteType:null,currentSessionDetailKey:null,isLoading:!1,loadingMessage:null,error:null,dashboardLayout:null,themeSlots:[tie],activeSlotId:"default",deletedSlotBuffer:null,isImmersiveMode:!1},xt=gn()(En(im((e,t)=>({...lie,setTheme:r=>{const n=rh(r);e({theme:r,resolvedTheme:n},!1,"setTheme");const i=t(),o=wo(i.themeSlots,i.activeSlotId);Ln(n,i.colorScheme,i.customHue,i.gradientLevel,i.enableHoverGlow,i.enableBackgroundAnimation,i.motionPreference,o)},setColorScheme:r=>{e(o=>({colorScheme:r,customHue:null,isCustomTheme:!1,themeSlots:o.themeSlots.map(s=>s.id===o.activeSlotId?{...s,colorScheme:r,customHue:null,isCustomTheme:!1}:s)}),!1,"setColorScheme");const n=t(),i=wo(n.themeSlots,n.activeSlotId);Ln(n.resolvedTheme,r,null,n.gradientLevel,n.enableHoverGlow,n.enableBackgroundAnimation,n.motionPreference,i)},setCustomHue:r=>{if(r===null){const o=t(),s=wo(o.themeSlots,o.activeSlotId);e(a=>({customHue:null,isCustomTheme:!1,themeSlots:a.themeSlots.map(l=>l.id===a.activeSlotId?{...l,customHue:null,isCustomTheme:!1}:l)}),!1,"setCustomHue"),Ln(o.resolvedTheme,o.colorScheme,null,o.gradientLevel,o.enableHoverGlow,o.enableBackgroundAnimation,o.motionPreference,s);return}e(o=>({customHue:r,isCustomTheme:!0,themeSlots:o.themeSlots.map(s=>s.id===o.activeSlotId?{...s,customHue:r,isCustomTheme:!0}:s)}),!1,"setCustomHue");const n=t(),i=wo(n.themeSlots,n.activeSlotId);Ln(n.resolvedTheme,n.colorScheme,r,n.gradientLevel,n.enableHoverGlow,n.enableBackgroundAnimation,n.motionPreference,i)},toggleTheme:()=>{const{theme:r}=t(),n=r==="dark"?"light":"dark";t().setTheme(n)},setGradientLevel:r=>{e(o=>({gradientLevel:r,themeSlots:o.themeSlots.map(s=>s.id===o.activeSlotId?{...s,gradientLevel:r}:s)}),!1,"setGradientLevel");const n=t(),i=wo(n.themeSlots,n.activeSlotId);Ln(n.resolvedTheme,n.colorScheme,n.customHue,r,n.enableHoverGlow,n.enableBackgroundAnimation,n.motionPreference,i)},setEnableHoverGlow:r=>{e(o=>({enableHoverGlow:r,themeSlots:o.themeSlots.map(s=>s.id===o.activeSlotId?{...s,enableHoverGlow:r}:s)}),!1,"setEnableHoverGlow");const n=t(),i=wo(n.themeSlots,n.activeSlotId);Ln(n.resolvedTheme,n.colorScheme,n.customHue,n.gradientLevel,r,n.enableBackgroundAnimation,n.motionPreference,i)},setEnableBackgroundAnimation:r=>{e(o=>({enableBackgroundAnimation:r,themeSlots:o.themeSlots.map(s=>s.id===o.activeSlotId?{...s,enableBackgroundAnimation:r}:s)}),!1,"setEnableBackgroundAnimation");const n=t(),i=wo(n.themeSlots,n.activeSlotId);Ln(n.resolvedTheme,n.colorScheme,n.customHue,n.gradientLevel,n.enableHoverGlow,r,n.motionPreference,i)},setMotionPreference:r=>{e({motionPreference:r},!1,"setMotionPreference");const n=t(),i=wo(n.themeSlots,n.activeSlotId);Ln(n.resolvedTheme,n.colorScheme,n.customHue,n.gradientLevel,n.enableHoverGlow,n.enableBackgroundAnimation,r,i)},setStyleTier:r=>{e(i=>({themeSlots:i.themeSlots.map(o=>o.id===i.activeSlotId?{...o,styleTier:r}:o)}),!1,"setStyleTier");const n=t();Ln(n.resolvedTheme,n.colorScheme,n.customHue,n.gradientLevel,n.enableHoverGlow,n.enableBackgroundAnimation,n.motionPreference,r)},setLocale:r=>{e({locale:r},!1,"setLocale"),xk(r)},setSidebarOpen:r=>{e({sidebarOpen:r},!1,"setSidebarOpen")},toggleSidebar:()=>{e(r=>({sidebarOpen:!r.sidebarOpen}),!1,"toggleSidebar")},setSidebarCollapsed:r=>{e({sidebarCollapsed:r},!1,"setSidebarCollapsed")},setExpandedNavGroups:r=>{e({expandedNavGroups:r},!1,"setExpandedNavGroups")},setCurrentView:r=>{e({currentView:r},!1,"setCurrentView")},setCurrentFilter:r=>{e({currentFilter:r},!1,"setCurrentFilter")},setCurrentLiteType:r=>{e({currentLiteType:r},!1,"setCurrentLiteType")},setCurrentSessionDetailKey:r=>{e({currentSessionDetailKey:r},!1,"setCurrentSessionDetailKey")},setLoading:(r,n=null)=>{e({isLoading:r,loadingMessage:n},!1,"setLoading")},setError:r=>{e({error:r},!1,"setError")},clearError:()=>{e({error:null},!1,"clearError")},setDashboardLayouts:r=>{e(n=>{var i;return{dashboardLayout:{widgets:((i=n.dashboardLayout)==null?void 0:i.widgets)||Xx.widgets,layouts:r}}},!1,"setDashboardLayouts")},setDashboardWidgets:r=>{e(n=>{var i;return{dashboardLayout:{widgets:r,layouts:((i=n.dashboardLayout)==null?void 0:i.layouts)||Xx.layouts}}},!1,"setDashboardWidgets")},resetDashboardLayout:()=>{e({dashboardLayout:Xx},!1,"resetDashboardLayout")},setActiveSlot:r=>{const{themeSlots:n,motionPreference:i}=t(),o=n.find(a=>a.id===r);if(!o)return;const s=rh(t().theme);e({activeSlotId:r,colorScheme:o.colorScheme,customHue:o.customHue,isCustomTheme:o.isCustomTheme,gradientLevel:o.gradientLevel,enableHoverGlow:o.enableHoverGlow,enableBackgroundAnimation:o.enableBackgroundAnimation},!1,"setActiveSlot"),Ln(s,o.colorScheme,o.customHue,o.gradientLevel,o.enableHoverGlow,o.enableBackgroundAnimation,i,o.styleTier),wu(o.backgroundConfig??Go)},copySlot:()=>{const r=t();if(r.themeSlots.length>=wk)return;const n=new Set(r.themeSlots.map(l=>l.id)),o=["custom-1","custom-2"].find(l=>!n.has(l));if(!o)return;const s=r.themeSlots.find(l=>l.id===r.activeSlotId);if(!s)return;const a={id:o,name:`Copy of ${s.name}`,colorScheme:r.colorScheme,customHue:r.customHue,isCustomTheme:r.isCustomTheme,gradientLevel:r.gradientLevel,enableHoverGlow:r.enableHoverGlow,enableBackgroundAnimation:r.enableBackgroundAnimation,styleTier:s.styleTier,isDefault:!1,backgroundConfig:s.backgroundConfig};e({themeSlots:[...r.themeSlots,a],activeSlotId:o},!1,"copySlot")},renameSlot:(r,n)=>{e(i=>({themeSlots:i.themeSlots.map(o=>o.id===r?{...o,name:n}:o)}),!1,"renameSlot")},deleteSlot:r=>{const n=t(),i=n.themeSlots.find(s=>s.id===r);if(!i||i.isDefault)return;e({themeSlots:n.themeSlots.filter(s=>s.id!==r),deletedSlotBuffer:i,activeSlotId:"default"},!1,"deleteSlot");const o=n.themeSlots.find(s=>s.id==="default");if(o){const s=rh(n.theme);e({colorScheme:o.colorScheme,customHue:o.customHue,isCustomTheme:o.isCustomTheme,gradientLevel:o.gradientLevel,enableHoverGlow:o.enableHoverGlow,enableBackgroundAnimation:o.enableBackgroundAnimation},!1,"deleteSlot/applyDefault"),Ln(s,o.colorScheme,o.customHue,o.gradientLevel,o.enableHoverGlow,o.enableBackgroundAnimation,n.motionPreference,o.styleTier),wu(o.backgroundConfig??Go)}setTimeout(()=>{var a;((a=xt.getState().deletedSlotBuffer)==null?void 0:a.id)===r&&xt.setState({deletedSlotBuffer:null},!1)},1e4)},undoDeleteSlot:()=>{const r=t(),n=r.deletedSlotBuffer;if(!n||r.themeSlots.length>=wk)return;e({themeSlots:[...r.themeSlots,n],deletedSlotBuffer:null,activeSlotId:n.id},!1,"undoDeleteSlot");const i=rh(r.theme);e({colorScheme:n.colorScheme,customHue:n.customHue,isCustomTheme:n.isCustomTheme,gradientLevel:n.gradientLevel,enableHoverGlow:n.enableHoverGlow,enableBackgroundAnimation:n.enableBackgroundAnimation},!1,"undoDeleteSlot/apply"),Ln(i,n.colorScheme,n.customHue,n.gradientLevel,n.enableHoverGlow,n.enableBackgroundAnimation,r.motionPreference,n.styleTier),wu(n.backgroundConfig??Go)},setBackgroundConfig:r=>{e(n=>({themeSlots:n.themeSlots.map(i=>i.id===n.activeSlotId?{...i,backgroundConfig:r}:i)}),!1,"setBackgroundConfig"),wu(r)},updateBackgroundEffect:(r,n)=>{const i=t(),o=i.themeSlots.find(l=>l.id===i.activeSlotId),s=(o==null?void 0:o.backgroundConfig)??Go,a={...s,effects:{...s.effects,[r]:n}};t().setBackgroundConfig(a)},setBackgroundMode:r=>{const n=t(),i=n.themeSlots.find(a=>a.id===n.activeSlotId),s={...(i==null?void 0:i.backgroundConfig)??Go,mode:r};t().setBackgroundConfig(s)},setBackgroundImage:(r,n)=>{const i=t(),o=i.themeSlots.find(l=>l.id===i.activeSlotId),s=(o==null?void 0:o.backgroundConfig)??Go,a={...s,imageUrl:r,attribution:n};r&&s.mode==="gradient-only"&&(a.mode="image-gradient"),!r&&s.mode!=="gradient-only"&&(a.mode="gradient-only"),t().setBackgroundConfig(a)},setImmersiveMode:r=>{e({isImmersiveMode:r},!1,"setImmersiveMode")},toggleImmersiveMode:()=>{e(r=>({isImmersiveMode:!r.isImmersiveMode}),!1,"toggleImmersiveMode")}}),{name:"ccw-app-store",partialize:e=>({theme:e.theme,colorScheme:e.colorScheme,customHue:e.customHue,gradientLevel:e.gradientLevel,enableHoverGlow:e.enableHoverGlow,enableBackgroundAnimation:e.enableBackgroundAnimation,motionPreference:e.motionPreference,locale:e.locale,sidebarCollapsed:e.sidebarCollapsed,expandedNavGroups:e.expandedNavGroups,dashboardLayout:e.dashboardLayout,themeSlots:e.themeSlots,activeSlotId:e.activeSlotId}),onRehydrateStorage:()=>e=>{if(e){if(!e.themeSlots||!Array.isArray(e.themeSlots)||e.themeSlots.length===0){const i={id:"default",name:"Default",colorScheme:e.colorScheme??"blue",customHue:e.customHue??null,isCustomTheme:(e.customHue??null)!==null,gradientLevel:e.gradientLevel??"standard",enableHoverGlow:e.enableHoverGlow??!0,enableBackgroundAnimation:e.enableBackgroundAnimation??!1,styleTier:"standard",isDefault:!0};e.themeSlots=[i],e.activeSlotId="default"}(!e.activeSlotId||!e.themeSlots.find(i=>i.id===e.activeSlotId))&&(e.activeSlotId="default");const t=rh(e.theme);e.resolvedTheme=t,e.isCustomTheme=e.customHue!==null;const r=wo(e.themeSlots,e.activeSlotId);Ln(t,e.colorScheme,e.customHue,e.gradientLevel??"standard",e.enableHoverGlow??!0,e.enableBackgroundAnimation??!1,e.motionPreference??"system",r);const n=e.themeSlots.find(i=>i.id===e.activeSlotId);wu((n==null?void 0:n.backgroundConfig)??Go)}e&&xk(e.locale)}}),{name:"AppStore"}));if(typeof window<"u"){window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{const i=xt.getState();if(i.theme==="system"){const o=eU();xt.setState({resolvedTheme:o});const s=wo(i.themeSlots,i.activeSlotId);Ln(o,i.colorScheme,i.customHue,i.gradientLevel,i.enableHoverGlow,i.enableBackgroundAnimation,i.motionPreference,s)}});const t=xt.getState(),r=wo(t.themeSlots,t.activeSlotId);Ln(t.resolvedTheme,t.colorScheme,t.customHue,t.gradientLevel,t.enableHoverGlow,t.enableBackgroundAnimation,t.motionPreference,r);const n=t.themeSlots.find(i=>i.id===t.activeSlotId);wu((n==null?void 0:n.backgroundConfig)??Go)}const cie=e=>e.theme,uie=e=>e.resolvedTheme,die=e=>e.customHue,fie=e=>e.isCustomTheme,hie=e=>e.gradientLevel,pie=e=>e.enableHoverGlow,mie=e=>e.enableBackgroundAnimation,gie=e=>e.motionPreference,Gze=e=>e.locale,vie=e=>e.themeSlots,yie=e=>e.activeSlotId,bie=e=>e.deletedSlotBuffer,_ie=e=>e.isImmersiveMode,Ek=2,xie=800,wie=/^ccw(\d+):(.+)$/,Sie=["blue","green","orange","purple"],Cie=["soft","standard","high-contrast"],Eie=["off","standard","enhanced"],kie=["gradient-only","image-only","image-gradient"];function NM(e){const t={v:Ek,c:e.colorScheme,h:e.customHue,t:e.styleTier,g:e.gradientLevel,w:e.enableHoverGlow,a:e.enableBackgroundAnimation},r=e.backgroundConfig;r&&r.mode!=="gradient-only"&&(t.bm=r.mode,r.imageUrl&&(t.bi=r.imageUrl),r.attribution&&(t.bp=r.attribution.photographerName,t.bu=r.attribution.photographerUrl,t.bpu=r.attribution.photoUrl),t.be={b:r.effects.blur,d:r.effects.darkenOpacity,s:r.effects.saturation,f:r.effects.enableFrostedGlass,g:r.effects.enableGrain,v:r.effects.enableVignette});const n=JSON.stringify(t),o=new TextEncoder().encode(n);let s="";for(let c=0;c<o.length;c++)s+=String.fromCharCode(o[c]);const l=btoa(s).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");return`ccw${Ek}:${l}`}function Tie(e){if(!e||typeof e!="string")return{ok:!1,error:"empty_input"};const t=e.trim();if(t.length>xie)return{ok:!1,error:"too_long"};const r=t.match(wie);if(!r)return{ok:!1,error:"invalid_format"};const n=parseInt(r[1],10);let o=r[2].replace(/-/g,"+").replace(/_/g,"/");const s=o.length%4;s===2?o+="==":s===3&&(o+="=");let a;try{const g=atob(o),_=new Uint8Array(g.length);for(let m=0;m<g.length;m++)_[m]=g.charCodeAt(m);a=new TextDecoder().decode(_)}catch{return{ok:!1,error:"decode_failed"}}let l;try{l=JSON.parse(a)}catch{return{ok:!1,error:"parse_failed"}}if(!l||typeof l!="object"||Array.isArray(l))return{ok:!1,error:"invalid_payload"};const c=l,d=typeof c.v=="number"?c.v:n,u=Pie(d);if(!u.compatible)return{ok:!1,error:"incompatible_version"};if(typeof c.c!="string"||!Sie.includes(c.c))return{ok:!1,error:"invalid_field"};if(c.h!==null&&(typeof c.h!="number"||!isFinite(c.h)))return{ok:!1,error:"invalid_field"};if(typeof c.t!="string"||!Cie.includes(c.t))return{ok:!1,error:"invalid_field"};if(typeof c.g!="string"||!Eie.includes(c.g))return{ok:!1,error:"invalid_field"};if(typeof c.w!="boolean"||typeof c.a!="boolean")return{ok:!1,error:"invalid_field"};const p={version:d,colorScheme:c.c,customHue:c.h,styleTier:c.t,gradientLevel:c.g,enableHoverGlow:c.w,enableBackgroundAnimation:c.a};if(typeof c.bm=="string"&&kie.includes(c.bm)){const g={...Jz};if(c.be&&typeof c.be=="object"&&!Array.isArray(c.be)){const _=c.be;typeof _.b=="number"&&(g.blur=_.b),typeof _.d=="number"&&(g.darkenOpacity=_.d),typeof _.s=="number"&&(g.saturation=_.s),typeof _.f=="boolean"&&(g.enableFrostedGlass=_.f),typeof _.g=="boolean"&&(g.enableGrain=_.g),typeof _.v=="boolean"&&(g.enableVignette=_.v)}p.backgroundConfig={mode:c.bm,imageUrl:typeof c.bi=="string"?c.bi:null,attribution:typeof c.bp=="string"&&typeof c.bu=="string"&&typeof c.bpu=="string"?{photographerName:c.bp,photographerUrl:c.bu,photoUrl:c.bpu}:null,effects:g}}return{ok:!0,payload:p,warning:u.warning}}function Pie(e){const t=Math.abs(e-Ek);return t>2?{compatible:!1}:t>0?{compatible:!0,warning:"version_mismatch"}:{compatible:!0}}function Aie(){const e=xt(cie),t=xt(uie),r=xt(_e=>_e.colorScheme),n=xt(die),i=xt(fie),o=xt(hie),s=xt(pie),a=xt(mie),l=xt(gie),c=xt(_e=>_e.setTheme),d=xt(_e=>_e.setColorScheme),u=xt(_e=>_e.setCustomHue),p=xt(_e=>_e.toggleTheme),g=xt(_e=>_e.setGradientLevel),_=xt(_e=>_e.setEnableHoverGlow),y=xt(_e=>_e.setEnableBackgroundAnimation),m=xt(_e=>_e.setMotionPreference),v=xt(_e=>_e.setStyleTier),b=xt(vie),x=xt(yie),E=xt(bie),C=xt(_e=>_e.setBackgroundConfig),k=xt(_e=>_e.updateBackgroundEffect),P=xt(_e=>_e.setBackgroundMode),T=xt(_e=>_e.setBackgroundImage),I=xt(_e=>_e.setActiveSlot),N=xt(_e=>_e.copySlot),B=xt(_e=>_e.renameSlot),M=xt(_e=>_e.deleteSlot),F=xt(_e=>_e.undoDeleteSlot),U=O.useCallback(_e=>{c(_e)},[c]),q=O.useCallback(_e=>{d(_e)},[d]),V=O.useCallback(_e=>{u(_e)},[u]),K=O.useCallback(()=>{p()},[p]),D=O.useCallback(_e=>{g(_e)},[g]),$=O.useCallback(_e=>{_(_e)},[_]),j=O.useCallback(_e=>{y(_e)},[y]),z=O.useCallback(_e=>{m(_e)},[m]),X=O.useCallback(_e=>{v(_e)},[v]),W=Ck(l),le=O.useMemo(()=>b.find(_e=>_e.id===x),[b,x]),ce=b.length<wk,ve=(le==null?void 0:le.styleTier)??"standard",H=(le==null?void 0:le.backgroundConfig)??Go,Q=O.useCallback(_e=>{I(_e)},[I]),Y=O.useCallback(()=>{N()},[N]),ne=O.useCallback((_e,rt)=>{B(_e,rt)},[B]),ge=O.useCallback(_e=>{M(_e)},[M]),te=O.useCallback(()=>{F()},[F]),Oe=O.useCallback(()=>NM(le||{colorScheme:r,customHue:n,gradientLevel:o,enableHoverGlow:s,enableBackgroundAnimation:a,styleTier:ve}),[le,x,r,n,i,o,s,a,ve]),Ie=O.useCallback(_e=>Tie(_e),[]);return{theme:e,resolvedTheme:t,isDark:t==="dark",colorScheme:r,customHue:n,isCustomTheme:i,gradientLevel:o,enableHoverGlow:s,enableBackgroundAnimation:a,motionPreference:l,resolvedMotion:W,setTheme:U,setColorScheme:q,setCustomHue:V,toggleTheme:K,setGradientLevel:D,setEnableHoverGlow:$,setEnableBackgroundAnimation:j,setMotionPreference:z,styleTier:ve,setStyleTier:X,themeSlots:b,activeSlotId:x,activeSlot:le,deletedSlotBuffer:E,canAddSlot:ce,setActiveSlot:Q,copySlot:Y,renameSlot:ne,deleteSlot:ge,undoDeleteSlot:te,exportThemeCode:Oe,importThemeCode:Ie,backgroundConfig:H,setBackgroundConfig:C,updateBackgroundEffect:k,setBackgroundMode:P,setBackgroundImage:T}}const tU=5;let Ih=[];function Oie(){return Ih.shift()}function Tv(e){e&&(Ih.includes(e)||Ih.length>=tU||Ih.push(e))}let nh=null;async function rU(){return nh||(nh=(async()=>{try{const e=await fetch("/api/csrf-token",{credentials:"same-origin"});if(!e.ok)throw new Error("Failed to fetch CSRF token");const r=(await e.json()).csrfToken;if(!r)throw new Error("No CSRF token in response");return r}finally{nh=null}})(),nh)}function Iie(e){const t=e.headers.get("X-CSRF-Token");t&&Tv(t)}async function nU(){try{const e=await fetch(`/api/csrf-token?count=${tU}`,{credentials:"same-origin"});if(!e.ok)throw new Error("Failed to initialize CSRF token pool");const t=await e.json();if(t.tokens&&Array.isArray(t.tokens))for(const r of t.tokens)Tv(r);else t.csrfToken&&Tv(t.csrfToken);console.log(`[CSRF] Token pool initialized with ${Ih.length} tokens`)}catch(e){console.error("[CSRF] Failed to initialize CSRF token pool:",e);try{const t=await rU();Tv(t)}catch(t){console.error("[CSRF] Fallback token fetch failed:",t)}}}async function ee(e,t={}){const r=new Headers(t.headers);if(t.method&&["POST","PUT","PATCH","DELETE"].includes(t.method)){let i=Oie();if(!i){console.warn("[CSRF] Token pool depleted, fetching synchronously");try{i=await rU()}catch{throw new Error("Failed to acquire CSRF token for request")}}i&&r.set("X-CSRF-Token",i)}t.body&&typeof t.body=="string"&&r.set("Content-Type","application/json");const n=await fetch(e,{...t,headers:r,credentials:"same-origin"});if(Iie(n),!n.ok){const i={message:n.statusText||"Request failed",status:n.status},o=n.headers.get("content-type");if(o&&o.includes("application/json"))try{const s=await n.json();s.message?i.message=s.message:s.error&&(i.message=s.error),s.code&&(i.code=s.code)}catch{}throw i}if(n.status!==204)try{return await n.json()}catch(i){const o=i instanceof Error?i.message:"Unknown error";throw new Error(`Failed to parse JSON response: ${o}`)}}function Rie(e){const t=e.toLowerCase();return t.includes("-review-")||t.includes("-code-review-")?"review":t.includes("-tdd-")||t.includes("-test-driven-")?"tdd":t.includes("-test-")||t.includes("-testing-")?"test":t.includes("-docs-")||t.includes("-doc-")||t.includes("-documentation-")?"docs":t.includes("-lite-plan-")?"lite-plan":t.includes("-lite-fix-")||t.includes("-fix-")?"lite-fix":"workflow"}function MM(e,t){const n={active:"in_progress",completed:"completed",archived:"archived",planning:"planning",paused:"paused"}[e.status]||e.status;let i=e.project||e.session_id,o;if(e.project&&e.project.includes(":")){const c=e.project.split(":");i=c[0].trim(),o=c.slice(1).join(":").trim()}let s=e.type||Rie(e.session_id);const a=e;let l;if(a.hasReview){s!=="review"&&(s="review");const c=a.reviewDimensions||[],d=c.reduce((u,p)=>{var g;return u+(((g=p.findings)==null?void 0:g.length)||0)},0);l={dimensions:c.map(u=>({name:u.name,findings:u.findings||[]})),dimensions_count:c.length,findings:d,iterations:void 0,fixes:void 0}}return{session_id:e.session_id,type:s,title:i,description:o,status:n,created_at:e.created_at,updated_at:e.updated_at,location:t,path:e.path,has_plan:e.has_plan,plan_updated_at:e.plan_updated_at,has_review:a.hasReview,review:l,summaries:e.summaries,tasks:(e.tasks||[]).map(c=>IU(c))}}async function iU(e){var t,r,n,i,o,s,a,l;try{const c=e?`/api/data?path=${encodeURIComponent(e)}`:"/api/data",d=await ee(c);return d?{totalSessions:((t=d.statistics)==null?void 0:t.totalSessions)??0,activeSessions:((r=d.statistics)==null?void 0:r.activeSessions)??0,archivedSessions:((n=d.statistics)==null?void 0:n.archivedSessions)??0,totalTasks:((i=d.statistics)==null?void 0:i.totalTasks)??0,completedTasks:((o=d.statistics)==null?void 0:o.completedTasks)??0,pendingTasks:((s=d.statistics)==null?void 0:s.pendingTasks)??0,failedTasks:((a=d.statistics)==null?void 0:a.failedTasks)??0,todayActivity:((l=d.statistics)==null?void 0:l.todayActivity)??0}:(console.warn("[API] No data received from /api/data for dashboard stats"),jM())}catch(c){return console.error("[API] Failed to fetch dashboard stats:",c),jM()}}function jM(){return{totalSessions:0,activeSessions:0,archivedSessions:0,totalTasks:0,completedTasks:0,pendingTasks:0,failedTasks:0,todayActivity:0}}async function iA(e){try{const t=e?`/api/data?path=${encodeURIComponent(e)}`:"/api/data",r=await ee(t);if(!r)return console.warn("[API] No data received from /api/data for sessions"),{activeSessions:[],archivedSessions:[]};const n=(r.activeSessions??[]).map(o=>{try{return MM(o,"active")}catch(s){return console.error("[API] Failed to transform active session:",o,s),{session_id:o.session_id,title:o.project||o.session_id,status:"in_progress",created_at:o.created_at,location:"active"}}}),i=(r.archivedSessions??[]).map(o=>{try{return MM(o,"archived")}catch(s){return console.error("[API] Failed to transform archived session:",o,s),{session_id:o.session_id,title:o.project||o.session_id,status:o.status==="active"?"in_progress":o.status,created_at:o.created_at,location:"archived"}}});return{activeSessions:n,archivedSessions:i}}catch(t){return console.error("[API] Failed to fetch sessions:",t),{activeSessions:[],archivedSessions:[]}}}async function oU(e){return ee(`/api/sessions/${encodeURIComponent(e)}/archive`,{method:"POST"})}async function sU(e){return ee(`/api/sessions/${encodeURIComponent(e)}`,{method:"DELETE"})}async function aU(){return(await ee("/api/recent-paths")).paths??[]}async function lU(e){return(await ee("/api/remove-recent-path",{method:"POST",body:JSON.stringify({path:e})})).paths}async function cU(e){return ee(`/api/switch-path?path=${encodeURIComponent(e)}`)}async function uU(e){const t=e?`/api/issues?path=${encodeURIComponent(e)}`:"/api/issues";return{issues:(await ee(t)).issues??[]}}async function dU(e){const t=e?`/api/issues/history?path=${encodeURIComponent(e)}`:"/api/issues/history";return{issues:(await ee(t)).issues??[]}}async function fU(e){const t=e?`/api/queue?path=${encodeURIComponent(e)}`:"/api/queue";return ee(t)}async function hU(e){return ee("/api/issues",{method:"POST",body:JSON.stringify(e)})}async function pU(e,t){return ee(`/api/issues/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(t)})}async function mU(e){return ee(`/api/issues/${encodeURIComponent(e)}`,{method:"DELETE"})}async function Nie(e,t){const r=new FormData;t.forEach(i=>{r.append("files",i)});const n=await fetch(`/api/issues/${encodeURIComponent(e)}/attachments`,{method:"POST",body:r,credentials:"same-origin"});if(!n.ok){const i=await n.json().catch(()=>({error:"Upload failed"}));throw new Error(i.error||"Failed to upload attachments")}return n.json()}async function Mie(e={}){const t=new URLSearchParams;e.state&&t.set("state",e.state),e.limit&&t.set("limit",String(e.limit)),e.labels&&t.set("labels",e.labels),e.downloadImages&&t.set("downloadImages","true");const r=`/api/issues/pull${t.toString()?"?"+t.toString():""}`;return ee(r,{method:"POST"})}async function gU(e){return ee(`/api/queue/history?path=${encodeURIComponent(e)}`)}async function vU(e,t){return ee(`/api/queue/${encodeURIComponent(e)}?path=${encodeURIComponent(t)}`)}async function yU(e,t){return ee(`/api/queue/activate?path=${encodeURIComponent(t)}`,{method:"POST",body:JSON.stringify({queueId:e})})}async function bU(e){return ee(`/api/queue/deactivate?path=${encodeURIComponent(e)}`,{method:"POST"})}async function _U(e,t){return ee(`/api/queue/reorder?path=${encodeURIComponent(e)}`,{method:"POST",body:JSON.stringify(t)})}async function xU(e,t){return ee(`/api/queue/move?path=${encodeURIComponent(e)}`,{method:"POST",body:JSON.stringify(t)})}async function wU(e,t){return ee(`/api/queue/${encodeURIComponent(e)}?path=${encodeURIComponent(t)}`,{method:"DELETE"})}async function SU(e,t,r){return ee(`/api/queue/merge?path=${encodeURIComponent(r)}`,{method:"POST",body:JSON.stringify({sourceQueueId:e,targetQueueId:t})})}async function CU(e,t,r){return ee(`/api/queue/split?path=${encodeURIComponent(r)}`,{method:"POST",body:JSON.stringify({sourceQueueId:e,itemIds:t})})}async function EU(e){const t=e?`/api/discoveries?path=${encodeURIComponent(e)}`:"/api/discoveries",r=await ee(t);return(r.discoveries??r.sessions??[]).map(i=>{var a,l;let o="running";i.phase==="complete"||i.phase==="completed"?o="completed":i.phase==="failed"&&(o="failed");const s=((l=(a=i.progress)==null?void 0:a.perspective_analysis)==null?void 0:l.percent_complete)??0;return{id:i.discovery_id||i.id,name:i.target_pattern||i.discovery_id||i.name||"Discovery",status:o,progress:s,findings_count:i.total_findings??i.findings_count??0,created_at:i.created_at,completed_at:i.completed_at}})}async function kU(e,t){const r=t?`/api/discoveries/${encodeURIComponent(e)}/findings?path=${encodeURIComponent(t)}`:`/api/discoveries/${encodeURIComponent(e)}/findings`;return((await ee(r)).findings??[]).map(i=>({...i,severity:i.severity||i.priority||"medium"}))}async function TU(e,{findingIds:t,exportAll:r},n){const i=n?`/api/discoveries/${encodeURIComponent(e)}/export?path=${encodeURIComponent(n)}`:`/api/discoveries/${encodeURIComponent(e)}/export`;return ee(i,{method:"POST",body:JSON.stringify({finding_ids:t,export_all:r})})}async function jie(e,t="claude"){const r=(a,l)=>a.map(c=>({...c,location:l,enabled:!0})),n=(a,l)=>a.map(c=>({...c,location:l,enabled:!1})),i=a=>{const l=r(a.projectSkills??[],"project"),c=r(a.userSkills??[],"user"),d=n(a.disabledProjectSkills??[],"project"),u=n(a.disabledUserSkills??[],"user");return[...l,...c,...d,...u]},o=t==="codex"?"&cliType=codex":"";if(e)try{const a=`/api/skills?path=${encodeURIComponent(e)}&includeDisabled=true${o}`,l=await ee(a);return{skills:i(l)}}catch(a){const l=a;if(l.status===403||l.status===404)console.warn("[fetchSkills] 403/404 for project path, falling back to global skills");else throw a}const s=await ee(`/api/skills?includeDisabled=true${o}`);return{skills:i(s)}}async function Die(e,t,r,n="claude"){return ee(`/api/skills/${encodeURIComponent(e)}/enable`,{method:"POST",body:JSON.stringify({location:t,projectPath:r,cliType:n})})}async function Lie(e,t,r,n="claude"){return ee(`/api/skills/${encodeURIComponent(e)}/disable`,{method:"POST",body:JSON.stringify({location:t,projectPath:r,cliType:n})})}async function $ie(e,t,r,n="claude"){const i=n==="codex"?"&cliType=codex":"",o=r?`/api/skills/${encodeURIComponent(e)}?location=${t}&path=${encodeURIComponent(r)}${i}`:`/api/skills/${encodeURIComponent(e)}?location=${t}${i}`;return ee(o)}async function Bie(e,t,r,n="claude"){return ee(`/api/skills/${encodeURIComponent(e)}`,{method:"DELETE",body:JSON.stringify({location:t,projectPath:r,cliType:n})})}async function Fie(e){return ee("/api/skills/validate-import",{method:"POST",body:JSON.stringify({sourcePath:e})})}async function zie(e){return ee("/api/skills/create",{method:"POST",body:JSON.stringify(e)})}async function Uie(e){const{skillName:t,fileName:r,location:n,projectPath:i,cliType:o="claude"}=e,a=`/api/skills/${encodeURIComponent(t)}/file?filename=${encodeURIComponent(r)}&location=${n}&cliType=${o}${i?`&path=${encodeURIComponent(i)}`:""}`;return ee(a)}async function Hie(e){if(e)try{const t=`/api/commands?path=${encodeURIComponent(e)}`,r=await ee(t),n=[...r.projectCommands??[],...r.userCommands??[]];return{commands:r.commands??n,groups:r.groups,projectGroupsConfig:r.projectGroupsConfig,userGroupsConfig:r.userGroupsConfig}}catch(t){const r=t;if(r.status===403||r.status===404||r.status===400)console.warn("[fetchCommands] Path validation failed, falling back to global commands");else throw t}try{const t=await ee("/api/commands"),r=[...t.projectCommands??[],...t.userCommands??[]];return{commands:t.commands??r,groups:t.groups,projectGroupsConfig:t.projectGroupsConfig,userGroupsConfig:t.userGroupsConfig}}catch(t){throw console.error("[fetchCommands] Failed to fetch commands:",t),t}}async function qie(e,t,r,n){return ee(`/api/commands/${encodeURIComponent(e)}/toggle`,{method:"POST",body:JSON.stringify({enabled:t,location:r,projectPath:n})})}async function Wie(e,t,r,n){return ee(`/api/commands/group/${encodeURIComponent(e)}/toggle`,{method:"POST",body:JSON.stringify({enable:t,location:r,projectPath:n})})}async function Vie(e){return ee("/api/commands/validate-import",{method:"POST",body:JSON.stringify({sourcePath:e})})}async function Gie(e){return ee("/api/commands/create",{method:"POST",body:JSON.stringify(e)})}async function Kie(e){if(e)try{const r=`/api/core-memory/memories?path=${encodeURIComponent(e)}`,n=await ee(r);return{memories:n.memories??[],totalSize:n.totalSize??0,claudeMdCount:n.claudeMdCount??0}}catch(r){const n=r;if(n.status===403||n.status===404)console.warn("[fetchMemories] 403/404 for project path, falling back to global memories");else throw r}const t=await ee("/api/core-memory/memories");return{memories:t.memories??[],totalSize:t.totalSize??0,claudeMdCount:t.claudeMdCount??0}}async function Xie(e,t){return ee("/api/core-memory/memories",{method:"POST",body:JSON.stringify({...e,path:t})}).then(n=>n.memory)}async function Zie(e,t,r){return ee("/api/core-memory/memories",{method:"POST",body:JSON.stringify({id:e,...t,path:r})}).then(i=>i.memory)}async function Qie(e,t){const r=t?`/api/core-memory/memories/${encodeURIComponent(e)}?path=${encodeURIComponent(t)}`:`/api/core-memory/memories/${encodeURIComponent(e)}`;return ee(r,{method:"DELETE"})}async function Yie(e,t){const r=t?`/api/core-memory/memories/${encodeURIComponent(e)}/archive?path=${encodeURIComponent(t)}`:`/api/core-memory/memories/${encodeURIComponent(e)}/archive`;return ee(r,{method:"POST"})}async function Jie(e,t){const r=t?`/api/core-memory/memories/${encodeURIComponent(e)}/unarchive?path=${encodeURIComponent(t)}`:`/api/core-memory/memories/${encodeURIComponent(e)}/unarchive`;return ee(r,{method:"POST"})}async function eoe(e,t){const r=new URLSearchParams;return t&&r.set("path",t),ee(`/api/core-memory/extract?${r}`,{method:"POST",body:JSON.stringify({max_sessions:e})})}async function toe(e){const t=new URLSearchParams;return e&&t.set("path",e),ee(`/api/core-memory/extract/status?${t}`)}async function roe(e){const t=new URLSearchParams;return e&&t.set("path",e),ee(`/api/core-memory/consolidate?${t}`,{method:"POST"})}async function noe(e){const t=new URLSearchParams;return e&&t.set("path",e),ee(`/api/core-memory/consolidate/status?${t}`)}async function ioe(e,t){const r=new URLSearchParams;return t&&r.set("path",t),e!=null&&e.kind&&r.set("kind",e.kind),e!=null&&e.status_filter&&r.set("status_filter",e.status_filter),ee(`/api/core-memory/jobs?${r}`)}async function ooe(e=!1,t,r){const n=new URLSearchParams;return r&&n.set("path",r),e&&n.set("include_native","true"),ee(`/api/core-memory/extract/preview?${n}`)}async function soe(e){const t=new URLSearchParams;return e.path&&t.set("path",e.path),ee(`/api/core-memory/extract/selective?${t}`,{method:"POST",body:JSON.stringify({session_ids:e.sessionIds,include_native:e.includeNative})})}async function PU(e){const t=e?`/api/ccw?path=${encodeURIComponent(e)}`:"/api/ccw";return(await ee(t)).projectOverview??null}async function AU(e,t){const r=t?`/api/ccw/guidelines?path=${encodeURIComponent(t)}`:"/api/ccw/guidelines";return ee(r,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function aoe(e,t){const r=await iA(t),i=[...r.activeSessions,...r.archivedSessions].find(d=>d.session_id===e);if(!i)throw new Error(`Session not found: ${e}`);const o=i.path||i.session_id,s=await ee(`/api/session-detail?path=${encodeURIComponent(o)}&type=all`);let a=s.summary;!a&&s.summaries&&s.summaries.length>0&&(a=s.summaries[0].content||s.summaries[0].name||"");const l=s.context?{context:s.context}:void 0;return{session:{...i,tasks:s.tasks||i.tasks||[]},context:l,summary:a,summaries:s.summaries,implPlan:s.implPlan,conflicts:s.conflictResolution,review:s.review}}async function loe(e){const t=e?`/api/cli/history-native?path=${encodeURIComponent(e)}`:"/api/cli/history-native";return{executions:(await ee(t)).executions??[]}}async function coe(e){await ee(`/api/cli/history/${encodeURIComponent(e)}`,{method:"DELETE"})}async function uoe(e){await ee(`/api/cli/history/tool/${encodeURIComponent(e)}`,{method:"DELETE"})}async function doe(){await ee("/api/cli/history",{method:"DELETE"})}async function foe(e,t,r){return ee("/api/bulk-update-task-status",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionPath:e,taskIds:t,newStatus:r})})}async function hoe(e,t,r){return ee("/api/update-task-status",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionPath:e,taskId:t,newStatus:r})})}async function OU(e,t){const r=new URLSearchParams({id:e});return t&&r.set("path",t),await ee(`/api/cli/execution?${r.toString()}`)}async function poe(e,t){const r=new URLSearchParams({id:e});return t&&r.set("path",t),ee(`/api/cli/native-session?${r.toString()}`)}async function moe(e){const t=new URLSearchParams;if(e.filePath)t.set("filePath",e.filePath),e.tool&&t.set("tool",e.tool);else if(e.executionId)t.set("id",e.executionId);else throw new Error("Either executionId or filePath is required");e.projectPath&&t.set("path",e.projectPath),e.format&&t.set("format",e.format),e.thoughts&&t.set("thoughts","true"),e.tools&&t.set("tools","true"),e.tokens&&t.set("tokens","true");const r=`/api/cli/native-session?${t.toString()}`;if(e.format==="text"){const n=await fetch(r,{credentials:"same-origin"});if(!n.ok){const i=await n.json().catch(()=>({error:"Request failed"}));throw new Error(i.error||n.statusText)}return n.text()}return ee(r)}async function goe(e={}){const{tool:t,project:r,limit:n=50,cursor:i}=e,o=new URLSearchParams;t&&o.set("tool",t),r&&o.set("path",r),n&&o.set("limit",String(n)),i&&o.set("cursor",i);const s=o.toString();return ee(`/api/cli/native-sessions${s?`?${s}`:""}`)}function voe(e){if(!(!Array.isArray(e)||e.length===0))return e.map(t=>typeof t=="string"?{path:t}:t)}function IU(e){var g;if(!e||typeof e!="object")return{task_id:"N/A",status:"pending",_raw:e};const t=e.context,r=e.flow_control,n=e.meta,i=e.convergence,o=e.modification_points,s=t==null?void 0:t.requirements,a=e.details,l=e.description||(Array.isArray(s)&&s.length>0?s.join("; "):void 0)||(Array.isArray(a)&&a.length>0?a.join("; "):void 0)||e.scope,c=voe(e.files)||(r==null?void 0:r.target_files)||(o!=null&&o.length?o.filter(_=>_.file).map(_=>({path:_.file,name:_.target,change:_.change})):void 0),d=e.focus_paths||(t==null?void 0:t.focus_paths)||(c!=null&&c.length?c.map(_=>_.path).filter(Boolean):void 0)||[],u=e.acceptance,p=i||((g=t==null?void 0:t.acceptance)!=null&&g.length?{criteria:t.acceptance}:void 0)||(u!=null&&u.length?{criteria:u}:void 0);return{task_id:e.task_id||e.id||"N/A",title:e.title,description:l,status:e.status||"pending",priority:e.priority,created_at:e.created_at,updated_at:e.updated_at,has_summary:e.has_summary,estimated_complexity:e.estimated_complexity,depends_on:e.depends_on||(t==null?void 0:t.depends_on)||[],focus_paths:d,convergence:p,pre_analysis:e.pre_analysis||(r==null?void 0:r.pre_analysis),implementation:e.implementation||(r==null?void 0:r.implementation_approach),files:c,type:e.type||(n==null?void 0:n.type),scope:e.scope||(n==null?void 0:n.scope),action:e.action||(n==null?void 0:n.action),flow_control:r,context:t,meta:n,_raw:e}}function yoe(e){var i,o,s;const t=e.pre_analysis,r=e.implementation,n=e.files;return!(t!=null&&t.length)&&!(r!=null&&r.length)&&!(n!=null&&n.length)?e.flow_control:{pre_analysis:t||((i=e.flow_control)==null?void 0:i.pre_analysis),implementation_approach:r||((o=e.flow_control)==null?void 0:o.implementation_approach),target_files:n||((s=e.flow_control)==null?void 0:s.target_files)}}async function oA(e){const t=e?`/api/data?path=${encodeURIComponent(e)}`:"/api/data";return(await ee(t)).liteTasks||{}}async function RU(e,t,r){const n=await oA(r);return(t==="lite-plan"?n.litePlan||[]:t==="lite-fix"?n.liteFix||[]:n.multiCliPlan||[]).find(o=>o.id===e||o.session_id===e)||null}async function boe(e){return await ee(`/api/session-detail?path=${encodeURIComponent(e)}&type=context`)}async function NU(){var t;const e=await ee("/api/data");if(e.activeSessions){const r=e.activeSessions.filter(n=>n.type==="review"||n.hasReview);if(r.length>0)return r.map(n=>{var i;return{session_id:n.session_id,title:n.project||n.session_id,description:"",type:"review",phase:(i=n.reviewSummary)==null?void 0:i.phase,reviewDimensions:n.reviewDimensions||[],reviewSummary:n.reviewSummary,_isActive:!0,created_at:n.created_at,updated_at:void 0,status:n.status}})}return e.reviewSessions&&e.reviewSessions.length>0?e.reviewSessions:(t=e.reviewData)!=null&&t.sessions?e.reviewData.sessions.map(r=>({session_id:r.session_id,title:r.session_id,description:"",type:"review",phase:"in-progress",reviewDimensions:r.dimensions.map(n=>({name:n.name,findings:n.findings||[]})),_isActive:!0,created_at:void 0,updated_at:void 0,status:"active"})):[]}async function _oe(e){return(await NU()).find(r=>r.session_id===e)||null}function MU(e){return e.transport==="stdio"}function xoe(e){return e.transport==="http"}async function Tc(){return ee("/api/mcp-config")}function Xr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Wv(e){const t=e.trim();if(!t)return"";let r=t.replace(/\\/g,"/");return/^\/[a-zA-Z]\//.test(r)&&(r=r.charAt(1).toUpperCase()+":"+r.slice(2)),/^[a-zA-Z]:\//.test(r)&&(r=r.charAt(0).toUpperCase()+r.slice(1)),r.replace(/\/+$/,"")}function jU(e,t){if(!t)return null;const r=Wv(t);if(!r)return null;for(const n of Object.keys(e))if(Wv(n)===r)return n;return t in e?t:null}function Vv(e){if(!Xr(e))return{transport:"stdio",command:""};const t=typeof e.url=="string"&&e.url.trim()!=="",r=e.type==="http"||e.transport==="http";if(t||r){const l=typeof e.url=="string"?e.url:"",c=Xr(e.headers)?Object.fromEntries(Object.entries(e.headers).flatMap(([_,y])=>typeof y=="string"?[[_,y]]:[])):void 0,d=typeof e.bearer_token_env_var=="string"?e.bearer_token_env_var:void 0,u=Xr(e.http_headers)?Object.fromEntries(Object.entries(e.http_headers).flatMap(([_,y])=>typeof y=="string"?[[_,y]]:[])):void 0,p=Array.isArray(e.env_http_headers)?e.env_http_headers.filter(_=>typeof _=="string"):void 0,g={transport:"http",url:l};return c&&Object.keys(c).length>0&&(g.headers=c),d&&(g.bearerTokenEnvVar=d),u&&Object.keys(u).length>0&&(g.httpHeaders=u),p&&p.length>0&&(g.envHttpHeaders=p),g}const n=typeof e.command=="string"?e.command:"",i=Array.isArray(e.args)?e.args.filter(l=>typeof l=="string"):void 0,o=Xr(e.env)?Object.fromEntries(Object.entries(e.env).flatMap(([l,c])=>typeof c=="string"?[[l,c]]:[])):void 0,s=typeof e.cwd=="string"?e.cwd:void 0,a={transport:"stdio",command:n};return i&&i.length>0&&(a.args=i),o&&Object.keys(o).length>0&&(a.env=o),s&&(a.cwd=s),a}async function w0(e){const t=await Tc(),r=Xr(t.projects)?t.projects:{},n=jU(r,e),i=n&&Xr(r[n])?r[n]:null,o=i&&Array.isArray(i.disabledMcpServers)?i.disabledMcpServers.filter(p=>typeof p=="string"):[],s=new Set(o),a=Xr(t.userServers)?t.userServers:{},l=i&&Xr(i.mcpServers)?i.mcpServers:{},c=Object.entries(a).map(([p,g])=>{const _=Vv(g);return{name:p,..._,enabled:!s.has(p),scope:"global"}}),d=Object.entries(l).map(([p,g])=>{const _=Vv(g);return{name:p,..._,enabled:!s.has(p),scope:"project"}}),u=[];for(const p of d){const g=c.find(_=>_.name===p.name);g&&u.push({name:p.name,projectServer:p,globalServer:g,effectiveScope:"global"})}return{project:d,global:c,conflicts:u}}function Ya(e,t){const r=e==null?void 0:e.trim();if(!r)throw new Error(`${t}: projectPath is required`);return r}function DU(e){if(e.transport==="http"){const n={url:"url"in e&&typeof e.url=="string"?e.url:""};return n.type="http",e.headers&&Object.keys(e.headers).length>0&&(n.headers=e.headers),e.bearerTokenEnvVar&&(n.bearer_token_env_var=e.bearerTokenEnvVar),e.httpHeaders&&Object.keys(e.httpHeaders).length>0&&(n.http_headers=e.httpHeaders),e.envHttpHeaders&&e.envHttpHeaders.length>0&&(n.env_http_headers=e.envHttpHeaders),n}const t={};return"command"in e&&typeof e.command=="string"&&(t.command=e.command),"args"in e&&Array.isArray(e.args)&&e.args.length>0&&(t.args=e.args),"env"in e&&e.env&&Object.keys(e.env).length>0&&(t.env=e.env),"cwd"in e&&typeof e.cwd=="string"&&e.cwd.trim()&&(t.cwd=e.cwd),t}function DM(e,t){const r=t.transport??"stdio",n=t.enabled??!0,i=t.scope??"project";if(r==="http"){const c="url"in t&&typeof t.url=="string"?t.url:"";return{name:e,transport:"http",url:c,enabled:n,scope:i}}const o="command"in t&&typeof t.command=="string"?t.command:"",s="args"in t&&Array.isArray(t.args)?t.args:void 0,a="env"in t&&t.env&&typeof t.env=="object"?t.env:void 0,l="cwd"in t&&typeof t.cwd=="string"?t.cwd:void 0;return{name:e,transport:"stdio",command:o,args:s,env:a,cwd:l,enabled:n,scope:i}}async function woe(e,t,r={}){var i;if(!t.scope)throw new Error("updateMcpServer: scope is required");if(t.transport==="http"){const o="url"in t?t.url:void 0;if(typeof o!="string"||!o.trim())throw new Error("updateMcpServer: url is required for HTTP servers")}else{const o="command"in t?t.command:void 0;if(typeof o!="string"||!o.trim())throw new Error("updateMcpServer: command is required for STDIO servers")}const n=DU(t);if(t.scope==="global"){const o=await ee("/api/mcp-add-global-server",{method:"POST",body:JSON.stringify({serverName:e,serverConfig:n})});if(o!=null&&o.error)throw new Error(o.error)}else{const o=Ya(r.projectPath,"updateMcpServer"),s=r.configType??"mcp",a=await ee("/api/mcp-copy-server",{method:"POST",body:JSON.stringify({projectPath:o,serverName:e,serverConfig:n,configType:s})});if(a!=null&&a.error)throw new Error(a.error)}if(typeof t.enabled=="boolean"){const o=(i=r.projectPath)==null?void 0:i.trim();if(o){const s=await ee("/api/mcp-toggle",{method:"POST",body:JSON.stringify({projectPath:o,serverName:e,enable:t.enabled})});if(s!=null&&s.error)throw new Error(s.error)}}if(r.projectPath){const o=await w0(r.projectPath);return[...o.project,...o.global].find(s=>s.name===e)??DM(e,t)}return DM(e,t)}async function Soe(e,t={}){var i,o,s;if(!((i=e.name)!=null&&i.trim()))throw new Error("createMcpServer: name is required");if(e.transport==="http"){if(!((o=e.url)!=null&&o.trim()))throw new Error("createMcpServer: url is required for HTTP servers")}else if(!((s=e.command)!=null&&s.trim()))throw new Error("createMcpServer: command is required for STDIO servers");const r=e.name.trim(),n=DU(e);if(e.scope==="global"){const a=await ee("/api/mcp-add-global-server",{method:"POST",body:JSON.stringify({serverName:r,serverConfig:n})});if(a!=null&&a.error)throw new Error(a.error)}else{const a=Ya(t.projectPath,"createMcpServer"),l=t.configType??"mcp",c=await ee("/api/mcp-copy-server",{method:"POST",body:JSON.stringify({projectPath:a,serverName:r,serverConfig:n,configType:l})});if(c!=null&&c.error)throw new Error(c.error)}if(e.enabled===!1){const a=Ya(t.projectPath,"createMcpServer"),l=await ee("/api/mcp-toggle",{method:"POST",body:JSON.stringify({projectPath:a,serverName:r,enable:!1})});if(l!=null&&l.error)throw new Error(l.error)}if(t.projectPath){const a=await w0(t.projectPath);return[...a.project,...a.global].find(l=>l.name===r)??e}return e}async function Coe(e,t,r={}){if(t==="global"){const o=await ee("/api/mcp-remove-global-server",{method:"POST",body:JSON.stringify({serverName:e})});if(o!=null&&o.error)throw new Error(o.error);return}const n=Ya(r.projectPath,"deleteMcpServer"),i=await ee("/api/mcp-remove-server",{method:"POST",body:JSON.stringify({projectPath:n,serverName:e})});if(i!=null&&i.error)throw new Error(i.error)}async function Eoe(e,t,r={}){const n=Ya(r.projectPath,"toggleMcpServer"),i=await ee("/api/mcp-toggle",{method:"POST",body:JSON.stringify({projectPath:n,serverName:e,enable:t})});if(i!=null&&i.error)throw new Error(i.error);const o=await w0(n);return[...o.project,...o.global].find(s=>s.name===e)??{name:e,transport:"stdio",command:"",enabled:t,scope:"project"}}async function LU(){const e=await ee("/api/codex-mcp-config"),t=Xr(e.servers)?e.servers:{};return{servers:Object.entries(t).map(([n,i])=>{const o=Vv(i),s=Xr(i)?i.enabled!==!1:!0;return{name:n,...o,enabled:s,scope:"global",configPath:e.configPath}}),configPath:e.configPath}}async function S0(e,t){return ee("/api/codex-mcp-add",{method:"POST",body:JSON.stringify({serverName:e,serverConfig:t})})}async function $U(e){return ee("/api/codex-mcp-remove",{method:"POST",body:JSON.stringify({serverName:e})})}async function koe(e,t){return ee("/api/codex-mcp-toggle",{method:"POST",body:JSON.stringify({serverName:e,enabled:t})})}async function Toe(){return(await ee("/api/mcp-templates")).templates??[]}async function Poe(e){return ee("/api/mcp-templates",{method:"POST",body:JSON.stringify(e)})}async function Aoe(e){return ee(`/api/mcp-templates/${encodeURIComponent(e)}`,{method:"DELETE"})}async function Ooe(e){return ee("/api/mcp-templates/install",{method:"POST",body:JSON.stringify(e)})}async function Ioe(e){return(await ee(`/api/mcp-templates/search?q=${encodeURIComponent(e)}`)).templates??[]}async function Roe(){return(await ee("/api/mcp-templates/categories")).categories??[]}async function Noe(e){return(await ee(`/api/mcp-templates/category/${encodeURIComponent(e)}`)).templates??[]}async function Moe(){const e=await Tc();return{projects:Object.keys(e.projects??{}).sort((r,n)=>r.localeCompare(n))}}async function joe(e){const t=await Tc(),r=Xr(t.userServers)?t.userServers:{},n=Xr(t.enterpriseServers)?t.enterpriseServers:{},i=e&&e.length>0?new Set(e.map(s=>Wv(s))):null,o={};for(const[s,a]of Object.entries(t.projects??{})){const l=Wv(s);if(i&&!i.has(l))continue;const c=Xr(a)?a:{},d=Xr(c.mcpServers)?c.mcpServers:{},u=Array.isArray(c.disabledMcpServers)?c.disabledMcpServers.filter(g=>typeof g=="string"):[],p=new Set(u);o[s]=Object.entries(d).filter(([g])=>!(g in r)&&!(g in n)).flatMap(([g,_])=>{const y=Vv(_);return y.transport!=="stdio"?[]:[{name:g,command:y.command,args:y.args,env:y.env,enabled:!p.has(g)}]})}return{servers:o}}async function Doe(e){const t=e.serverNames??[];if(t.length===0||e.source===e.target)return{success:!0,copied:[],failed:[]};const r=[],n=[];if(e.source==="claude"&&e.target==="codex"){const i=await Tc(),o=Xr(i.projects)?i.projects:{},s=jU(o,e.projectPath??void 0),a=s&&Xr(o[s])?o[s]:null,l=a&&Xr(a.mcpServers)?a.mcpServers:{};for(const c of t)try{const d=l[c]??(i.userServers?i.userServers[c]:void 0)??(i.enterpriseServers?i.enterpriseServers[c]:void 0);if(!Xr(d)){n.push({name:c,error:"Source server config not found"});continue}const u=await S0(c,d);if(u!=null&&u.error){n.push({name:c,error:u.error});continue}r.push(c)}catch(d){n.push({name:c,error:d instanceof Error?d.message:String(d)})}return{success:r.length>0,copied:r,failed:n}}if(e.source==="codex"&&e.target==="claude"){const i=Ya(e.projectPath,"crossCliCopy"),o=await ee("/api/codex-mcp-config"),s=Xr(o.servers)?o.servers:{};for(const a of t)try{const l=s[a];if(!Xr(l)){n.push({name:a,error:"Source server config not found"});continue}const c=await ee("/api/mcp-copy-server",{method:"POST",body:JSON.stringify({projectPath:i,serverName:a,serverConfig:l,configType:"mcp"})});if(c!=null&&c.error){n.push({name:a,error:c.error});continue}r.push(a)}catch(l){n.push({name:a,error:l instanceof Error?l.message:String(l)})}return{success:r.length>0,copied:r,failed:n}}return{success:!1,copied:[],failed:t.map(i=>({name:i,error:"Unsupported copy direction"}))}}async function Loe(){return{endpoints:(await ee("/api/cli/endpoints")).endpoints??[]}}async function $oe(e,t){return ee(`/api/cli/endpoints/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(t)})}async function Boe(e){return ee("/api/cli/endpoints",{method:"POST",body:JSON.stringify(e)})}async function Foe(e){await ee(`/api/cli/endpoints/${encodeURIComponent(e)}`,{method:"DELETE"})}async function zoe(e,t){return ee(`/api/cli/endpoints/${encodeURIComponent(e)}/toggle`,{method:"POST",body:JSON.stringify({enabled:t})})}async function Uoe(){return{tools:(await ee("/api/cli/installations")).tools??[]}}async function Hoe(e){return ee(`/api/cli/installations/${encodeURIComponent(e)}/install`,{method:"POST"})}async function qoe(e){await ee(`/api/cli/installations/${encodeURIComponent(e)}/uninstall`,{method:"POST"})}async function Woe(e){return ee(`/api/cli/installations/${encodeURIComponent(e)}/upgrade`,{method:"POST"})}function Voe(e){const t=[];for(const r of["project","global"]){const n=e[r];if(!(!(n!=null&&n.hooks)||typeof n.hooks!="object"))for(const[i,o]of Object.entries(n.hooks))Array.isArray(o)&&o.forEach((s,a)=>{let l="";s.hooks&&Array.isArray(s.hooks)&&s.hooks.length>0&&(l=s.hooks.map(d=>d.command||d.prompt||"").filter(Boolean).join(" && ")),!l&&s.command&&(l=s.args?`${s.command} ${s.args.join(" ")}`:s.command),!l&&s.script&&(l=s.script);const c=`${r}-${i}-${a}`;t.push({name:c,description:s.description,enabled:s.enabled!==!1,command:l,trigger:i,matcher:s.matcher,scope:r,index:a,templateId:s._templateId})})}return t}async function Goe(e){const t=e?`/api/hooks?path=${encodeURIComponent(e)}`:"/api/hooks",r=await ee(t);return{hooks:Voe(r)}}async function Koe(e,t){return ee(`/api/hooks/${encodeURIComponent(e)}/toggle`,{method:"POST",body:JSON.stringify({enabled:t})})}async function Xoe(e,t,r){return ee("/api/hooks",{method:"POST",body:JSON.stringify({projectPath:"",scope:e,event:t,hookData:r})})}async function Zoe(e){return ee("/api/hooks",{method:"DELETE",body:JSON.stringify(e)})}async function Qoe(e){if(e)try{const n=`/api/rules?path=${encodeURIComponent(e)}`,i=await ee(n),o=[...i.projectRules??[],...i.userRules??[]];return{rules:i.rules??o}}catch(n){const i=n;if(i.status===403||i.status===404)console.warn("[fetchRules] 403/404 for project path, falling back to global rules");else throw n}const t=await ee("/api/rules"),r=[...t.projectRules??[],...t.userRules??[]];return{rules:t.rules??r}}async function Yoe(e,t){return ee(`/api/rules/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(t)})}async function Joe(e,t){return ee(`/api/rules/${encodeURIComponent(e)}/toggle`,{method:"POST",body:JSON.stringify({enabled:t})})}async function ese(e){return ee("/api/rules/create",{method:"POST",body:JSON.stringify(e)})}async function tse(e,t){return ee(`/api/rules/${encodeURIComponent(e)}`,{method:"DELETE",body:JSON.stringify({location:t})})}async function rse(e,t){return ee("/api/mcp-add-global-server",{method:"POST",body:JSON.stringify({serverName:e,serverConfig:t})})}async function nse(e,t,r,n="mcp"){const i=Ya(r,"copyMcpServerToProject");return ee("/api/mcp-copy-server",{method:"POST",body:JSON.stringify({projectPath:i,serverName:e,serverConfig:t,configType:n})})}async function sA(e){var t,r,n,i;try{const o=await Tc(),s=[];let a=null;if((t=o.globalServers)!=null&&t["ccw-tools"]?(s.push("global"),a=o.globalServers["ccw-tools"]):(r=o.userServers)!=null&&r["ccw-tools"]&&(s.push("global"),a=o.userServers["ccw-tools"]),o.projects){if(e){const u=e.replace(/\\/g,"/");for(const[p,g]of Object.entries(o.projects))if(p.replace(/\\/g,"/")===u&&((n=g.mcpServers)!=null&&n["ccw-tools"])){s.push("project"),a||(a=g.mcpServers["ccw-tools"]);break}}else for(const u of Object.values(o.projects))if((i=u.mcpServers)!=null&&i["ccw-tools"]){s.push("project"),a||(a=u.mcpServers["ccw-tools"]);break}}if(!a)return{isInstalled:!1,enabledTools:[],installedScopes:[]};const l=a.env||{},c=l.CCW_ENABLED_TOOLS;let d;return c==null?d=["write_file","edit_file","read_file","core_memory","ask_question","smart_search"]:c===""||c==="all"?d=c===""?[]:["write_file","edit_file","read_file","core_memory","ask_question","smart_search"]:d=c.split(",").map(u=>u.trim()).filter(Boolean),{isInstalled:!0,enabledTools:d,projectRoot:l.CCW_PROJECT_ROOT,allowedDirs:l.CCW_ALLOWED_DIRS,enableSandbox:l.CCW_ENABLE_SANDBOX==="1",installedScopes:s}}catch{return{isInstalled:!1,enabledTools:[],installedScopes:[]}}}async function ise(e){const t=await ee("/api/mcp-install-ccw",{method:"POST",body:JSON.stringify({scope:"global",env:e})});if(t!=null&&t.error)throw new Error(t.error||"Failed to update CCW config");return sA()}async function ose(e="global",t){const r=e==="project"?Ya(t,"installCcwMcp"):void 0,n=await ee("/api/mcp-install-ccw",{method:"POST",body:JSON.stringify({scope:e,projectPath:r,env:{enabledTools:["write_file","edit_file","read_file","core_memory","ask_question","smart_search"]}})});if(n!=null&&n.error)throw new Error(n.error||`Failed to install CCW MCP (${e})`);return sA(r)}async function sse(){try{await ee("/api/mcp-remove-global-server",{method:"POST",body:JSON.stringify({serverName:"ccw-tools"})})}catch{}try{const e=await Tc();if(e.projects){const t=Object.entries(e.projects).filter(([r,n])=>{var i;return(i=n.mcpServers)==null?void 0:i["ccw-tools"]}).map(([r])=>ee("/api/mcp-remove-server",{method:"POST",body:JSON.stringify({projectPath:r,serverName:"ccw-tools"})}).catch(()=>{}));await Promise.all(t)}}catch{}}async function ase(e,t){if(e==="global")await ee("/api/mcp-remove-global-server",{method:"POST",body:JSON.stringify({serverName:"ccw-tools"})});else{if(!t)throw new Error("projectPath required for project scope uninstall");await ee("/api/mcp-remove-server",{method:"POST",body:JSON.stringify({projectPath:t,serverName:"ccw-tools"})})}}async function aA(){try{const{servers:e}=await LU(),t=e.find(o=>o.name==="ccw-tools");if(!t)return{isInstalled:!1,enabledTools:[],installedScopes:[]};const r=MU(t)?t.env||{}:{},n=r.CCW_ENABLED_TOOLS;let i;return n==null?i=["write_file","edit_file","read_file","core_memory","ask_question","smart_search"]:n===""||n==="all"?i=n===""?[]:["write_file","edit_file","read_file","core_memory","ask_question","smart_search"]:i=n.split(",").map(o=>o.trim()).filter(Boolean),{isInstalled:!0,enabledTools:i,projectRoot:r.CCW_PROJECT_ROOT,allowedDirs:r.CCW_ALLOWED_DIRS,enableSandbox:r.CCW_ENABLE_SANDBOX==="1",installedScopes:["global"]}}catch{return{isInstalled:!1,enabledTools:[],installedScopes:[]}}}function BU(e){const t={};return e.enabledTools!==void 0?t.CCW_ENABLED_TOOLS=e.enabledTools.join(","):t.CCW_ENABLED_TOOLS="write_file,edit_file,read_file,core_memory,ask_question,smart_search",e.projectRoot&&(t.CCW_PROJECT_ROOT=e.projectRoot),e.allowedDirs&&(t.CCW_ALLOWED_DIRS=e.allowedDirs),e.enableSandbox&&(t.CCW_ENABLE_SANDBOX="1"),{command:"ccw-mcp",args:[],env:t}}async function lse(){const e=BU({enabledTools:["write_file","edit_file","read_file","core_memory","ask_question","smart_search"]}),t=await S0("ccw-tools",e);if(t.error)throw new Error(t.error||"Failed to install CCW MCP to Codex");return aA()}async function cse(){const e=await $U("ccw-tools");if(!e.success)throw new Error(e.error||"Failed to uninstall CCW MCP from Codex")}async function use(e){const t=BU(e),r=await S0("ccw-tools",t);if(r.error)throw new Error(r.error||"Failed to update CCW config in Codex");return aA()}async function FU(e){var n;const t=e?`/api/codexlens/workspace-status?path=${encodeURIComponent(e)}`:"/api/codexlens/workspace-status",r=await ee(t);return{totalFiles:((n=r.fts)==null?void 0:n.totalFiles)??0,lastUpdated:new Date().toISOString(),buildTime:0,status:r.hasIndex?"completed":"idle"}}async function dse(e){const t=e?`/api/memory/prompts?path=${encodeURIComponent(e)}`:"/api/memory/prompts";return ee(t)}async function fse(e){const t=e?`/api/memory/insights?path=${encodeURIComponent(e)}`:"/api/memory/insights";return ee(t)}async function hse(e,t=20){const r=e?`/api/memory/insights?limit=${t}&path=${encodeURIComponent(e)}`:`/api/memory/insights?limit=${t}`;return ee(r)}async function pse(e,t){const r=`/api/memory/insights/${encodeURIComponent(e)}`;return ee(r)}async function mse(e={}){return ee("/api/memory/analyze",{method:"POST",body:JSON.stringify(e)})}async function gse(e){await ee("/api/memory/prompts/"+encodeURIComponent(e),{method:"DELETE"})}async function vse(e,t){const r=t?`/api/memory/insights/${encodeURIComponent(e)}?path=${encodeURIComponent(t)}`:`/api/memory/insights/${encodeURIComponent(e)}`;return ee(r,{method:"DELETE"})}async function yse(e){return ee("/api/memory/prompts/batch-delete",{method:"POST",body:JSON.stringify({promptIds:e})})}async function bse(e="/",t={}){const r=new URLSearchParams;return r.append("rootPath",e),t.maxDepth!==void 0&&r.append("maxDepth",String(t.maxDepth)),t.includeHidden!==void 0&&r.append("includeHidden",String(t.includeHidden)),t.excludePatterns&&r.append("excludePatterns",t.excludePatterns.join(",")),ee(`/api/explorer/tree?${r.toString()}`)}async function _se(e,t={}){const r=new URLSearchParams;return r.append("path",e),t.encoding&&r.append("encoding",t.encoding),t.maxSize!==void 0&&r.append("maxSize",String(t.maxSize)),ee(`/api/explorer/file?${r.toString()}`)}async function xse(e){return ee("/api/explorer/search",{method:"POST",body:JSON.stringify(e)})}async function wse(){return ee("/api/explorer/roots")}async function Sse(e={}){const t=new URLSearchParams;return e.rootPath&&t.append("rootPath",e.rootPath),e.maxDepth!==void 0&&t.append("maxDepth",String(e.maxDepth)),e.includeTypes&&t.append("includeTypes",e.includeTypes.join(",")),e.excludePatterns&&t.append("excludePatterns",e.excludePatterns.join(",")),ee(`/api/graph/dependencies?${t.toString()}`)}async function Cse(){return ee("/api/codexlens/dashboard-init")}async function Ese(){return ee("/api/codexlens/config")}async function kse(e){return ee("/api/codexlens/config",{method:"POST",body:JSON.stringify(e)})}async function Tse(){return ee("/api/codexlens/bootstrap",{method:"POST",body:JSON.stringify({})})}async function Pse(e="cpu"){return ee("/api/codexlens/semantic/install",{method:"POST",body:JSON.stringify({gpuMode:e})})}async function Ase(){return ee("/api/codexlens/uninstall",{method:"POST",body:JSON.stringify({})})}async function Ose(){var n;const e=await ee("/api/codexlens/models"),r=(((n=e==null?void 0:e.result)==null?void 0:n.models)??(e==null?void 0:e.models)??[]).map(i=>({profile:i.profile||"",name:i.model_name||i.name||i.profile||"",type:i.type||"embedding",backend:i.source||"fastembed",size:i.installed&&i.actual_size_mb?`${i.actual_size_mb.toFixed(0)} MB`:i.estimated_size_mb?`~${i.estimated_size_mb} MB`:void 0,installed:i.installed??!1,cache_path:i.cache_path,model_name:i.model_name,description:i.description,use_case:i.use_case,dimensions:i.dimensions,recommended:i.recommended,source:i.source,estimated_size_mb:i.estimated_size_mb,actual_size_mb:i.actual_size_mb}));return{success:(e==null?void 0:e.success)??!0,models:r}}async function Ise(e){return ee("/api/codexlens/models/download",{method:"POST",body:JSON.stringify({profile:e})})}async function Rse(e,t="embedding"){return ee("/api/codexlens/models/download-custom",{method:"POST",body:JSON.stringify({model_name:e,model_type:t})})}async function Nse(e){return ee("/api/codexlens/models/delete",{method:"POST",body:JSON.stringify({profile:e})})}async function Mse(e){return ee("/api/codexlens/models/delete-path",{method:"POST",body:JSON.stringify({cache_path:e})})}async function jse(){return ee("/api/codexlens/env")}async function Dse(e){return ee("/api/codexlens/env",{method:"POST",body:JSON.stringify(e)})}async function Lse(e){return ee("/api/codexlens/gpu/select",{method:"POST",body:JSON.stringify({device_id:e})})}async function $se(){return ee("/api/codexlens/gpu/reset",{method:"POST",body:JSON.stringify({})})}async function Bse(){return ee("/api/codexlens/ignore-patterns")}async function Fse(e){return ee("/api/codexlens/ignore-patterns",{method:"POST",body:JSON.stringify(e)})}async function zse(e){const t=new URLSearchParams;return t.append("query",e.query),e.limit&&t.append("limit",String(e.limit)),e.mode&&t.append("mode",e.mode),e.max_content_length&&t.append("max_content_length",String(e.max_content_length)),e.extra_files_count&&t.append("extra_files_count",String(e.extra_files_count)),ee(`/api/codexlens/search?${t.toString()}`)}async function Use(e){const t=new URLSearchParams;return t.append("query",e.query),e.limit&&t.append("limit",String(e.limit)),e.mode&&t.append("mode",e.mode),e.max_content_length&&t.append("max_content_length",String(e.max_content_length)),e.extra_files_count&&t.append("extra_files_count",String(e.extra_files_count)),ee(`/api/codexlens/search_files?${t.toString()}`)}async function Hse(e){const t=new URLSearchParams;return t.append("query",e.query),e.limit&&t.append("limit",String(e.limit)),ee(`/api/codexlens/symbol?${t.toString()}`)}async function qse(){return ee("/api/codexlens/lsp/status")}async function Wse(e){return ee("/api/codexlens/lsp/start",{method:"POST",body:JSON.stringify({path:e})})}async function Vse(e){return ee("/api/codexlens/lsp/stop",{method:"POST",body:JSON.stringify({path:e})})}async function Gse(e){return ee("/api/codexlens/lsp/restart",{method:"POST",body:JSON.stringify({path:e})})}async function Kse(e){return ee("/api/codexlens/lsp/search",{method:"POST",body:JSON.stringify(e)})}async function Xse(e,t={}){return ee("/api/codexlens/init",{method:"POST",body:JSON.stringify({path:e,indexType:t.indexType||"vector",embeddingModel:t.embeddingModel||"code",embeddingBackend:t.embeddingBackend||"fastembed",maxWorkers:t.maxWorkers||1})})}async function Zse(e,t={}){return ee("/api/codexlens/update",{method:"POST",body:JSON.stringify({path:e,indexType:t.indexType||"vector",embeddingModel:t.embeddingModel||"code",embeddingBackend:t.embeddingBackend||"fastembed",maxWorkers:t.maxWorkers||1})})}async function Qse(){return ee("/api/codexlens/cancel",{method:"POST",body:JSON.stringify({})})}async function Yse(){return ee("/api/codexlens/indexing-status")}async function Jse(){return ee("/api/codexlens/watch/status")}async function eae(e,t){return ee("/api/codexlens/watch/start",{method:"POST",body:JSON.stringify({path:e,debounce_ms:t})})}async function tae(){return ee("/api/codexlens/watch/stop",{method:"POST",body:JSON.stringify({})})}async function rae(){return ee("/api/litellm-api/providers")}async function nae(e){return ee("/api/litellm-api/providers",{method:"POST",body:JSON.stringify(e)})}async function iae(e,t){return ee(`/api/litellm-api/providers/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}async function oae(e){return ee(`/api/litellm-api/providers/${encodeURIComponent(e)}`,{method:"DELETE"})}async function sae(e){return ee(`/api/litellm-api/providers/${encodeURIComponent(e)}/test`,{method:"POST"})}async function aae(e){return ee(`/api/litellm-api/providers/${encodeURIComponent(e)}/health-check-now`,{method:"POST"})}async function lae(){return ee("/api/litellm-api/endpoints")}async function cae(e){return ee("/api/litellm-api/endpoints",{method:"POST",body:JSON.stringify(e)})}async function uae(e,t){return ee(`/api/litellm-api/endpoints/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}async function dae(e){return ee(`/api/litellm-api/endpoints/${encodeURIComponent(e)}`,{method:"DELETE"})}async function fae(){return ee("/api/litellm-api/cache/stats")}async function hae(){return ee("/api/litellm-api/cache/clear",{method:"POST"})}async function pae(e){return ee("/api/litellm-api/config/cache",{method:"PUT",body:JSON.stringify(e)})}async function mae(){return ee("/api/litellm-api/model-pools")}async function gae(e){return ee("/api/litellm-api/model-pools",{method:"POST",body:JSON.stringify(e)})}async function vae(e,t){return ee(`/api/litellm-api/model-pools/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}async function yae(e){return ee(`/api/litellm-api/model-pools/${encodeURIComponent(e)}`,{method:"DELETE"})}async function bae(e){return ee(`/api/litellm-api/model-pools/available-models/${encodeURIComponent(e)}`)}async function _ae(e,t){return ee(`/api/litellm-api/model-pools/discover/${encodeURIComponent(e)}/${encodeURIComponent(t)}`)}async function xae(){return ee("/api/litellm-api/config/sync",{method:"POST"})}async function wae(e=!1){return ee(`/api/litellm-api/ccw-litellm/status${e?"?refresh=true":""}`)}async function Sae(){return ee("/api/litellm-api/ccw-litellm/install",{method:"POST"})}async function Cae(){return ee("/api/litellm-api/ccw-litellm/uninstall",{method:"POST"})}async function Eae(){return ee("/api/cli/settings")}async function kae(e){return ee("/api/cli/settings",{method:"POST",body:JSON.stringify(e)})}async function Tae(e,t){return ee(`/api/cli/settings/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}async function Pae(e){return ee(`/api/cli/settings/${encodeURIComponent(e)}`,{method:"DELETE"})}async function Aae(e,t){return ee(`/api/cli/settings/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify({enabled:t})})}async function Oae(){return ee("/api/cli/settings/codex/preview")}async function Iae(){return ee("/api/cli/settings/gemini/preview")}async function Rae(e,t){return ee(mn("/api/orchestrator/flows",t),{method:"POST",body:JSON.stringify(e)})}async function Nae(e,t,r){return ee(mn(`/api/orchestrator/flows/${encodeURIComponent(e)}/execute`,r),{method:"POST",body:JSON.stringify(t??{})})}async function Mae(){return ee("/api/language/chinese-response")}async function jae(e,t="claude"){return ee("/api/language/chinese-response",{method:"POST",body:JSON.stringify({enabled:e,target:t})})}async function Dae(){return ee("/api/language/windows-platform")}async function Lae(e){return ee("/api/language/windows-platform",{method:"POST",body:JSON.stringify({enabled:e})})}async function $ae(){return ee("/api/language/codex-cli-enhancement")}async function Bae(e){return ee("/api/language/codex-cli-enhancement",{method:"POST",body:JSON.stringify({enabled:e})})}async function Fae(){return ee("/api/language/codex-cli-enhancement",{method:"POST",body:JSON.stringify({action:"refresh"})})}async function zae(){return ee("/api/status/all")}async function Uae(){return ee("/api/cli/status")}async function Hae(){return ee("/api/ccw/installations")}async function qae(e){return ee("/api/ccw/upgrade",{method:"POST",body:JSON.stringify({path:e})})}async function Wae(){return ee("/api/cli/settings/export")}async function Vae(e,t){return ee("/api/cli/settings/import",{method:"POST",body:JSON.stringify({data:e,options:t})})}async function Gae(){return(await ee("/api/ccw/tools")).tools}async function Kae(e){const t=new URLSearchParams;e&&t.set("location",e);const r=t.toString();return ee(`/api/teams${r?`?${r}`:""}`)}async function Xae(e){return ee(`/api/teams/${encodeURIComponent(e)}/archive`,{method:"POST"})}async function Zae(e){return ee(`/api/teams/${encodeURIComponent(e)}/unarchive`,{method:"POST"})}async function Qae(e){return ee(`/api/teams/${encodeURIComponent(e)}`,{method:"DELETE"})}async function Yae(e,t){const r=new URLSearchParams;t!=null&&t.from&&r.set("from",t.from),t!=null&&t.to&&r.set("to",t.to),t!=null&&t.type&&r.set("type",t.type),r.set("last",String(t.last));const n=r.toString();return ee(`/api/teams/${encodeURIComponent(e)}/messages${n?`?${n}`:""}`)}async function Jae(e){return ee(`/api/teams/${encodeURIComponent(e)}/status`)}async function ele(e){return ee(`/api/teams/${encodeURIComponent(e)}/artifacts`)}async function tle(e,t){return ee(`/api/teams/${encodeURIComponent(e)}/artifacts/${encodeURIComponent(t)}`)}function mn(e,t){if(!t)return e;const r=e.includes("?")?"&":"?";return`${e}${r}path=${encodeURIComponent(t)}`}async function zU(e){return ee(mn("/api/cli-sessions",e))}async function C0(e,t){return ee(mn("/api/cli-sessions",t),{method:"POST",body:JSON.stringify(e)})}async function UU(e,t){return ee(mn(`/api/cli-sessions/${encodeURIComponent(e)}/buffer`,t))}async function lA(e,t,r){return ee(mn(`/api/cli-sessions/${encodeURIComponent(e)}/send`,r),{method:"POST",body:JSON.stringify(t)})}async function rle(e,t,r){return ee(mn(`/api/cli-sessions/${encodeURIComponent(e)}/execute`,r),{method:"POST",body:JSON.stringify(t)})}async function HU(e,t,r){return ee(mn(`/api/cli-sessions/${encodeURIComponent(e)}/resize`,r),{method:"POST",body:JSON.stringify(t)})}async function Gv(e,t){return ee(mn(`/api/cli-sessions/${encodeURIComponent(e)}/close`,t),{method:"POST",body:JSON.stringify({})})}async function qU(e,t){return ee(mn(`/api/cli-sessions/${encodeURIComponent(e)}/pause`,t),{method:"POST",body:JSON.stringify({})})}async function WU(e,t){return ee(mn(`/api/cli-sessions/${encodeURIComponent(e)}/resume`,t),{method:"POST",body:JSON.stringify({})})}async function nle(e){const t=new URLSearchParams;if(e!=null&&e.sessionKey&&t.set("sessionKey",e.sessionKey),e!=null&&e.q&&t.set("q",e.q),typeof(e==null?void 0:e.limit)=="number"&&t.set("limit",String(e.limit)),typeof(e==null?void 0:e.offset)=="number"&&t.set("offset",String(e.offset)),e!=null&&e.type){const n=Array.isArray(e.type)?e.type:[e.type];t.set("type",n.join(","))}const r=t.toString();return ee(mn(`/api/audit/cli-sessions${r?`?${r}`:""}`,e==null?void 0:e.projectPath))}async function ile(e,t,r){const n=new URLSearchParams;n.set("q",e),n.set("topK",String(t.topK)),t!=null&&t.minScore&&n.set("minScore",String(t.minScore)),t!=null&&t.category&&n.set("category",t.category);const i=await ee(mn(`/api/unified-memory/search?${n.toString()}`,r));if(i.success===!1)throw new Error(i.error||"Search failed");return i}async function ole(e){const t=await ee(mn("/api/unified-memory/stats",e));if(t.success===!1)throw new Error(t.error||"Failed to load unified stats");return t}async function sle(e,t,r){const n=new URLSearchParams;t&&n.set("limit",String(t));const i=n.toString(),o=await ee(mn(`/api/unified-memory/recommendations/${encodeURIComponent(e)}${i?`?${i}`:""}`,r));if(o.success===!1)throw new Error(o.error||"Failed to load recommendations");return o}async function ale(e){return ee("/api/unified-memory/reindex",{method:"POST",body:JSON.stringify({path:e})})}async function lle(){return ee("/api/system/settings")}async function cle(e,t){return ee("/api/system/hooks/install-recommended",{method:"POST",body:JSON.stringify({hookIds:e,scope:t})})}async function ule(e){const t=e?`/api/specs/stats?path=${encodeURIComponent(e)}`:"/api/specs/stats";return ee(t)}async function dle(e){const t=e?`/api/specs/list?path=${encodeURIComponent(e)}`:"/api/specs/list";return ee(t)}async function fle(e){const t=e?`/api/specs/rebuild?path=${encodeURIComponent(e)}`:"/api/specs/rebuild";return ee(t,{method:"POST"})}async function hle(e="required",t=!1,r,n){const i=new URLSearchParams;return i.set("mode",e),i.set("preview",String(t)),n&&i.set("category",n),ee(`/api/specs/injection-preview?${i.toString()}`)}const ple=[{command:"ccw spec load",labelKey:"default",descriptionKey:"default",mode:"required"},{command:"ccw spec load --category exploration",labelKey:"exploration",descriptionKey:"exploration",category:"exploration",mode:"required"},{command:"ccw spec load --category planning",labelKey:"planning",descriptionKey:"planning",category:"planning",mode:"required"},{command:"ccw spec load --category execution",labelKey:"execution",descriptionKey:"execution",category:"execution",mode:"required"},{command:"ccw spec load --category general",labelKey:"general",descriptionKey:"general",category:"general",mode:"required"}];async function mle(e,t){const n=new URLSearchParams().toString(),i=n?`${mn("/api/analysis",e)}&${n}`:mn("/api/analysis",e),o=await ee(i);if(!o.success)throw new Error(o.error||"Failed to fetch analysis sessions");return o.data}async function gle(e,t){const r=await ee(mn(`/api/analysis/${encodeURIComponent(e)}`,t));if(!r.success)throw new Error(r.error||"Failed to fetch analysis detail");return r.data}const Kze=Object.freeze(Object.defineProperty({__proto__:null,COMMAND_PREVIEWS:ple,activateQueue:yU,addCodexMcpServer:S0,addGlobalMcpServer:rse,analyzePrompts:mse,archiveMemory:Yie,archiveSession:oU,archiveTeam:Xae,batchDeletePrompts:yse,bootstrapCodexLens:Tse,buildFlowControl:yoe,bulkUpdateTaskStatus:foe,cancelCodexLensIndexing:Qse,checkCcwLitellmStatus:wae,checkCodexLensIndexingStatus:Yse,clearCache:hae,closeCliSession:Gv,codexRemoveServer:$U,codexToggleServer:koe,copyMcpServerToProject:nse,createCliEndpoint:Boe,createCliSession:C0,createCliSettings:kae,createCommand:Gie,createEndpoint:cae,createIssue:hU,createMcpServer:Soe,createMemory:Xie,createModelPool:gae,createOrchestratorFlow:Rae,createProvider:nae,createRule:ese,createSkill:zie,crossCliCopy:Doe,deactivateQueue:bU,deleteAllHistory:doe,deleteCliEndpoint:Foe,deleteCliSettings:Pae,deleteCodexLensModel:Nse,deleteCodexLensModelByPath:Mse,deleteEndpoint:dae,deleteExecution:coe,deleteExecutionsByTool:uoe,deleteHook:Zoe,deleteInsight:vse,deleteIssue:mU,deleteMcpServer:Coe,deleteMcpTemplate:Aoe,deleteMemory:Qie,deleteModelPool:yae,deletePrompt:gse,deleteProvider:oae,deleteQueue:wU,deleteRule:tse,deleteSession:sU,deleteSkill:Bie,deleteTeam:Qae,disableSkill:Lie,discoverModelsForPool:_ae,downloadCodexLensCustomModel:Rse,downloadCodexLensModel:Ise,enableSkill:Die,executeInCliSession:rle,executeOrchestratorFlow:Nae,exportDiscoveryFindingsAsIssues:TU,exportSettings:Wae,fetchAggregatedStatus:zae,fetchAllProjects:Moe,fetchAnalysisDetail:gle,fetchAnalysisSessions:mle,fetchArtifactContent:tle,fetchCacheStats:fae,fetchCcwInstallations:Hae,fetchCcwMcpConfig:sA,fetchCcwMcpConfigForCodex:aA,fetchCcwTools:Gae,fetchChineseResponseStatus:Mae,fetchCliEndpoints:Loe,fetchCliInstallations:Uoe,fetchCliSessionAudit:nle,fetchCliSessionBuffer:UU,fetchCliSessions:zU,fetchCliSettings:Eae,fetchCliToolStatus:Uae,fetchCodexCliEnhancementStatus:$ae,fetchCodexConfigPreview:Oae,fetchCodexLensConfig:Ese,fetchCodexLensDashboardInit:Cse,fetchCodexLensEnv:jse,fetchCodexLensIgnorePatterns:Bse,fetchCodexLensLspStatus:qse,fetchCodexLensModels:Ose,fetchCodexLensWatcherStatus:Jse,fetchCodexMcpServers:LU,fetchCommands:Hie,fetchDashboardStats:iU,fetchDiscoveries:EU,fetchDiscoveryFindings:kU,fetchEndpoints:lae,fetchExecutionDetail:OU,fetchFileContent:_se,fetchFileTree:bse,fetchGeminiConfigPreview:Iae,fetchGraphDependencies:Sse,fetchHistory:loe,fetchHooks:Goe,fetchIndexStatus:FU,fetchInsightDetail:pse,fetchInsightsHistory:hse,fetchIssueHistory:dU,fetchIssueQueue:fU,fetchIssues:uU,fetchLiteSessionContext:boe,fetchLiteTaskSession:RU,fetchLiteTasks:oA,fetchMcpConfig:Tc,fetchMcpServers:w0,fetchMcpTemplateCategories:Roe,fetchMcpTemplates:Toe,fetchMcpTemplatesByCategory:Noe,fetchMemories:Kie,fetchModelPools:mae,fetchNativeSession:poe,fetchNativeSessionWithOptions:moe,fetchNativeSessions:goe,fetchOtherProjectsServers:joe,fetchProjectOverview:PU,fetchPromptInsights:fse,fetchPrompts:dse,fetchProviders:rae,fetchQueueById:vU,fetchQueueHistory:gU,fetchRecentPaths:aU,fetchRecommendations:sle,fetchReviewSession:_oe,fetchReviewSessions:NU,fetchRootDirectories:wse,fetchRules:Qoe,fetchSessionDetail:aoe,fetchSessions:iA,fetchSkillDetail:$ie,fetchSkills:jie,fetchTeamArtifacts:ele,fetchTeamMessages:Yae,fetchTeamStatus:Jae,fetchTeams:Kae,fetchUnifiedSearch:ile,fetchUnifiedStats:ole,fetchWindowsPlatformStatus:Dae,getAvailableModelsForPool:bae,getConsolidationStatus:noe,getExtractionStatus:toe,getInjectionPreview:hle,getSpecStats:ule,getSpecsList:dle,getSystemSettings:lle,getV2Jobs:ioe,importSettings:Vae,initializeCsrfToken:nU,installCcwLitellm:Sae,installCcwMcp:ose,installCcwMcpToCodex:lse,installCliTool:Hoe,installCodexLensSemantic:Pse,installMcpTemplate:Ooe,installRecommendedHooks:cle,isHttpMcpServer:xoe,isStdioMcpServer:MU,mergeQueues:SU,moveQueueItem:xU,normalizeTask:IU,pauseCliSession:qU,previewExtractionQueue:ooe,pullIssuesFromGitHub:Mie,readSkillFile:Uie,rebuildCodexLensIndex:Xse,rebuildSpecIndex:fle,refreshCodexCliEnhancement:Fae,removeRecentPath:lU,reorderQueueGroup:_U,resetCodexLensGpu:$se,resizeCliSession:HU,restartCodexLensLsp:Gse,resumeCliSession:WU,saveHook:Xoe,saveMcpTemplate:Poe,searchCodexLens:zse,searchFiles:xse,searchFilesCodexLens:Use,searchMcpTemplates:Ioe,searchSymbolCodexLens:Hse,selectCodexLensGpu:Lse,semanticSearchCodexLens:Kse,sendCliSessionText:lA,splitQueue:CU,startCodexLensLsp:Wse,startCodexLensWatcher:eae,stopCodexLensLsp:Vse,stopCodexLensWatcher:tae,switchWorkspace:cU,syncApiConfig:xae,testProvider:sae,toggleChineseResponse:jae,toggleCliEndpoint:zoe,toggleCliSettingsEnabled:Aae,toggleCodexCliEnhancement:Bae,toggleCommand:qie,toggleCommandGroup:Wie,toggleHook:Koe,toggleMcpServer:Eoe,toggleRule:Joe,toggleWindowsPlatform:Lae,triggerConsolidation:roe,triggerExtraction:eoe,triggerProviderHealthCheck:aae,triggerReindex:ale,triggerSelectiveExtraction:soe,unarchiveMemory:Jie,unarchiveTeam:Zae,uninstallCcwLitellm:Cae,uninstallCcwMcp:sse,uninstallCcwMcpFromCodex:cse,uninstallCcwMcpFromScope:ase,uninstallCliTool:qoe,uninstallCodexLens:Ase,updateCacheSettings:pae,updateCcwConfig:ise,updateCcwConfigForCodex:use,updateCliEndpoint:$oe,updateCliSettings:Tae,updateCodexLensConfig:kse,updateCodexLensEnv:Dse,updateCodexLensIgnorePatterns:Fse,updateCodexLensIndex:Zse,updateEndpoint:uae,updateIssue:pU,updateMcpServer:woe,updateMemory:Zie,updateModelPool:vae,updateProjectGuidelines:AU,updateProvider:iae,updateRule:Yoe,updateTaskStatus:hoe,upgradeCcwInstallation:qae,upgradeCliTool:Woe,uploadAttachments:Nie,validateCommandImport:Vie,validateSkillImport:Fie},Symbol.toStringTag,{value:"Module"})),VU="ccw-workflow-store",vle=()=>{var e;try{const t=localStorage.getItem(VU);if(t){const r=JSON.parse(t);return((e=r==null?void 0:r.state)==null?void 0:e.projectPath)||""}}catch{}return""},yle=e=>{try{localStorage.setItem(VU,JSON.stringify({state:{projectPath:e},version:1}))}catch{}},Wo=e=>`session-${e}`.replace(/[^a-zA-Z0-9-]/g,"-"),GU={status:null,search:"",dateRange:{start:null,end:null}},KU={field:"created_at",direction:"desc"},ble={workflowData:{activeSessions:[],archivedSessions:[]},projectPath:vle(),recentPaths:[],serverPlatform:"win32",sessionDataStore:{},liteTaskDataStore:{},taskJsonStore:{},activeSessionId:null,filters:GU,sorting:KU},At=gn()(im((e,t)=>({...ble,setSessions:(r,n)=>{const i={};[...r,...n].forEach(o=>{const s=Wo(o.session_id);i[s]=o}),e({workflowData:{activeSessions:r,archivedSessions:n},sessionDataStore:i},!1)},addSession:r=>{const n=Wo(r.session_id);e(i=>({workflowData:{...i.workflowData,activeSessions:[...i.workflowData.activeSessions,r]},sessionDataStore:{...i.sessionDataStore,[n]:r}}),!1)},updateSession:(r,n)=>{const i=Wo(r);e(o=>{const s=o.sessionDataStore[i];if(!s)return o;const a={...s,...n,updated_at:new Date().toISOString()},c=s.location==="active"?"activeSessions":"archivedSessions";return{sessionDataStore:{...o.sessionDataStore,[i]:a},workflowData:{...o.workflowData,[c]:o.workflowData[c].map(d=>d.session_id===r?a:d)}}},!1)},removeSession:r=>{const n=Wo(r);e(i=>{const{[n]:o,...s}=i.sessionDataStore;return{sessionDataStore:s,workflowData:{activeSessions:i.workflowData.activeSessions.filter(a=>a.session_id!==r),archivedSessions:i.workflowData.archivedSessions.filter(a=>a.session_id!==r)}}},!1)},archiveSession:r=>{const n=Wo(r);e(i=>{const o=i.sessionDataStore[n];if(!o||o.location==="archived")return i;const s={...o,location:"archived",status:"archived",updated_at:new Date().toISOString()};return{sessionDataStore:{...i.sessionDataStore,[n]:s},workflowData:{activeSessions:i.workflowData.activeSessions.filter(a=>a.session_id!==r),archivedSessions:[...i.workflowData.archivedSessions,s]}}},!1)},addTask:(r,n)=>{const i=Wo(r);e(o=>{var c;const s=o.sessionDataStore[i];if(!s||((c=s.tasks)==null?void 0:c.find(d=>d.task_id===n.task_id)))return o;const l={...s,tasks:[...s.tasks||[],n],updated_at:new Date().toISOString()};return{sessionDataStore:{...o.sessionDataStore,[i]:l}}},!1)},updateTask:(r,n,i)=>{const o=Wo(r);e(s=>{const a=s.sessionDataStore[o];if(!(a!=null&&a.tasks))return s;const l=a.tasks.map(d=>d.task_id===n?{...d,...i,updated_at:new Date().toISOString()}:d),c={...a,tasks:l,updated_at:new Date().toISOString()};return{sessionDataStore:{...s.sessionDataStore,[o]:c}}},!1)},removeTask:(r,n)=>{const i=Wo(r);e(o=>{const s=o.sessionDataStore[i];if(!(s!=null&&s.tasks))return o;const a={...s,tasks:s.tasks.filter(l=>l.task_id!==n),updated_at:new Date().toISOString()};return{sessionDataStore:{...o.sessionDataStore,[i]:a}}},!1)},setLiteTaskSession:(r,n)=>{e(i=>({liteTaskDataStore:{...i.liteTaskDataStore,[r]:n}}),!1)},removeLiteTaskSession:r=>{e(n=>{const{[r]:i,...o}=n.liteTaskDataStore;return{liteTaskDataStore:o}},!1)},setTaskJson:(r,n)=>{e(i=>({taskJsonStore:{...i.taskJsonStore,[r]:n}}),!1)},removeTaskJson:r=>{e(n=>{const{[r]:i,...o}=n.taskJsonStore;return{taskJsonStore:o}},!1)},setActiveSessionId:r=>{e({activeSessionId:r},!1)},setProjectPath:r=>{e({projectPath:r},!1)},addRecentPath:r=>{e(n=>{const i=n.recentPaths.filter(s=>s!==r);return{recentPaths:[r,...i].slice(0,10)}},!1)},setServerPlatform:r=>{e({serverPlatform:r},!1)},switchWorkspace:async r=>{const n=await cU(r),i={};[...n.activeSessions,...n.archivedSessions].forEach(s=>{const a=Wo(s.session_id);i[a]=s}),e({projectPath:n.projectPath,recentPaths:n.recentPaths,workflowData:{activeSessions:n.activeSessions,archivedSessions:n.archivedSessions},sessionDataStore:i},!1),yle(n.projectPath);const o=t()._invalidateQueriesCallback;o&&o()},removeRecentPath:async r=>{const n=await lU(r);e({recentPaths:n},!1)},refreshRecentPaths:async()=>{const r=await aU();e({recentPaths:r},!1)},registerQueryInvalidator:r=>{e({_invalidateQueriesCallback:r},!1)},setFilters:r=>{e(n=>({filters:{...n.filters,...r}}),!1)},setSorting:r=>{e(n=>({sorting:{...n.sorting,...r}}),!1)},resetFilters:()=>{e({filters:GU,sorting:KU},!1)},getActiveSession:()=>{const{activeSessionId:r,sessionDataStore:n}=t();if(!r)return null;const i=Wo(r);return n[i]||null},getFilteredSessions:()=>{const{workflowData:r,filters:n,sorting:i}=t();let o=[...r.activeSessions,...r.archivedSessions];if(n.status&&n.status.length>0&&(o=o.filter(s=>n.status.includes(s.status))),n.search){const s=n.search.toLowerCase();o=o.filter(a=>{var l,c;return a.session_id.toLowerCase().includes(s)||((l=a.title)==null?void 0:l.toLowerCase().includes(s))||((c=a.description)==null?void 0:c.toLowerCase().includes(s))})}return(n.dateRange.start||n.dateRange.end)&&(o=o.filter(s=>{const a=new Date(s.created_at);return!(n.dateRange.start&&a<n.dateRange.start||n.dateRange.end&&a>n.dateRange.end)})),o.sort((s,a)=>{let l=0;switch(i.field){case"created_at":l=new Date(s.created_at).getTime()-new Date(a.created_at).getTime();break;case"updated_at":l=new Date(s.updated_at||s.created_at).getTime()-new Date(a.updated_at||a.created_at).getTime();break;case"title":l=(s.title||s.session_id).localeCompare(a.title||a.session_id);break;case"status":l=s.status.localeCompare(a.status);break}return i.direction==="desc"?-l:l}),o},getSessionByKey:r=>t().sessionDataStore[r]}),{name:"ccw-workflow-store",partialize:e=>({projectPath:e.projectPath}),skipHydration:!0})),sr=e=>e.projectPath,_le={gemini:{enabled:!0,tags:["analysis","debug"],type:"builtin"},qwen:{enabled:!0,tags:[],type:"builtin"},codex:{enabled:!0,tags:[],type:"builtin"},claude:{enabled:!0,tags:[],type:"builtin"},opencode:{enabled:!0,tags:[],type:"builtin"}},XU={base:"/api",sessions:"/api/sessions",tasks:"/api/tasks",loops:"/api/loops",issues:"/api/issues",orchestrator:"/api/orchestrator"},ZU={autoRefresh:!0,refreshInterval:3e4,notificationsEnabled:!0,soundEnabled:!1,compactView:!1,showCompletedTasks:!0,defaultSessionFilter:"all",defaultSortField:"created_at",defaultSortDirection:"desc"},QU={dialogStyle:"modal",smartModeEnabled:!0,autoSelectionDuration:30,autoSelectionSoundEnabled:!1,pauseOnInteraction:!0,showA2UIButtonInToolbar:!0,drawerSide:"right",drawerSize:"md"},xle={cliTools:_le,defaultCliTool:"gemini",apiEndpoints:XU,userPreferences:ZU,a2uiPreferences:QU,featureFlags:{orchestratorEnabled:!0,darkModeEnabled:!0,notificationsEnabled:!0,experimentalFeatures:!1,dashboardQueuePanelEnabled:!1,dashboardInspectorEnabled:!1,dashboardExecutionMonitorEnabled:!1}};function wle(){var e;if(typeof window>"u"||!((e=window.location)!=null&&e.origin))return null;try{return new URL("/api/cli/config",window.location.origin).toString()}catch{return null}}function Sle(e){var o;const t=(o=e==null?void 0:e.config)==null?void 0:o.tools;if(!t||typeof t!="object")return null;const r=["builtin","cli-wrapper","api-endpoint"],n=s=>typeof s=="string"&&r.includes(s),i={};for(const[s,a]of Object.entries(t)){const l=a;i[s]={enabled:typeof l.enabled=="boolean"?l.enabled:!1,primaryModel:typeof l.primaryModel=="string"?l.primaryModel:"",secondaryModel:typeof l.secondaryModel=="string"?l.secondaryModel:"",tags:Array.isArray(l.tags)?l.tags.filter(c=>typeof c=="string"):[],type:n(l.type)?l.type:"builtin",envFile:typeof l.envFile=="string"?l.envFile:void 0,settingsFile:typeof l.settingsFile=="string"?l.settingsFile:void 0,availableModels:Array.isArray(l.availableModels)?l.availableModels.filter(c=>typeof c=="string"):void 0}}return Object.keys(i).length>0?i:null}let ih=null;async function Cle(e=!1){return!e&&ih||(ih=(async()=>{const t=wle();if(!t)return;const n=await(await fetch(t)).json(),i=Sle(n);i&&kk.getState().loadConfig({cliTools:i})})().catch(t=>{console.warn("[ConfigStore] Backend config sync failed, using local state:",t)}).finally(()=>{ih=null})),ih}const kk=gn()(En(im((e,t)=>({...xle,setCliTools:r=>{e({cliTools:r},!1,"setCliTools")},updateCliTool:(r,n)=>{e(i=>({cliTools:{...i.cliTools,[r]:{...i.cliTools[r],...n}}}),!1,"updateCliTool")},setDefaultCliTool:r=>{var i;const{cliTools:n}=t();(i=n[r])!=null&&i.enabled&&e({defaultCliTool:r},!1,"setDefaultCliTool")},setApiEndpoints:r=>{e(n=>({apiEndpoints:{...n.apiEndpoints,...r}}),!1,"setApiEndpoints")},setUserPreferences:r=>{e(n=>({userPreferences:{...n.userPreferences,...r}}),!1,"setUserPreferences")},resetUserPreferences:()=>{e({userPreferences:ZU},!1,"resetUserPreferences")},setA2uiPreferences:r=>{e({a2uiPreferences:r},!1,"setA2uiPreferences")},resetA2uiPreferences:()=>{e({a2uiPreferences:QU},!1,"resetA2uiPreferences")},setFeatureFlag:(r,n)=>{e(i=>({featureFlags:{...i.featureFlags,[r]:n}}),!1,"setFeatureFlag")},loadConfig:r=>{e(n=>({...n,...r,cliTools:r.cliTools||n.cliTools,apiEndpoints:{...n.apiEndpoints,...r.apiEndpoints||{}},userPreferences:{...n.userPreferences,...r.userPreferences||{}},featureFlags:{...n.featureFlags,...r.featureFlags||{}}}),!1,"loadConfig")}}),{name:"ccw-config-store",version:1,migrate:(e,t)=>t===0?{...e,apiEndpoints:e.apiEndpoints||XU}:e,partialize:e=>({cliTools:e.cliTools,defaultCliTool:e.defaultCliTool,apiEndpoints:e.apiEndpoints,userPreferences:e.userPreferences,featureFlags:e.featureFlags})}),{name:"ConfigStore"})),Xze=e=>e.cliTools,Zze=e=>e.defaultCliTool,Qze=e=>e.userPreferences,cA="ccw_notifications",Ele=100,kle=10080*60*1e3,Tle=[/\b[A-Za-z0-9_-]{20,}\b/g,/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi,/\b[A-Za-z0-9+/=]{32,}={0,2}\b/g],Ple=e=>{const t=r=>{if(!r)return null;let n=r;for(const o of Tle)n=n.replace(o,"[REDACTED]");const i=500;return n.length>i&&(n=n.substring(0,i)+"..."),n};return{...e,title:t(e.title)||e.title,message:t(e.message)||e.message,a2uiSurface:void 0,a2uiState:void 0}},Zx=()=>`toast-${Date.now()}-${Math.random().toString(36).substring(2,11)}`,YU=()=>{if(typeof window>"u")return[];try{const e=localStorage.getItem(cA);if(e){const t=JSON.parse(e),r=Date.now()-kle;return t.filter(n=>new Date(n.timestamp).getTime()>r)}}catch(e){console.error("[NotificationStore] Failed to load from storage:",e)}return[]},cu=e=>{if(!(typeof window>"u"))try{const r=e.slice(0,Ele).map(Ple);localStorage.setItem(cA,JSON.stringify(r))}catch(t){console.error("[NotificationStore] Failed to save to storage:",t)}},Ale={toasts:[],maxToasts:5,wsStatus:"disconnected",wsLastMessage:null,wsReconnectAttempts:0,isPanelVisible:!1,persistentNotifications:[],a2uiSurfaces:new Map,currentQuestion:null,currentPopupCard:null,actionStates:new Map},ct=gn()(En((e,t)=>({...Ale,addToast:r=>{const n=Zx(),i={...r,id:n,timestamp:new Date().toISOString(),dismissible:r.dismissible??!0,duration:r.duration??5e3};return e(o=>{const{maxToasts:s}=o;let a=[...o.toasts,i];return a.length>s&&(a=a.slice(-s)),{toasts:a}},!1,"addToast"),i.duration&&i.duration>0&&setTimeout(()=>{t().removeToast(n)},i.duration),n},removeToast:r=>{e(n=>({toasts:n.toasts.filter(i=>i.id!==r)}),!1,"removeToast")},clearAllToasts:()=>{e({toasts:[]},!1,"clearAllToasts")},setWsStatus:r=>{e({wsStatus:r},!1,"setWsStatus")},setWsLastMessage:r=>{e({wsLastMessage:r},!1,"setWsLastMessage")},incrementReconnectAttempts:()=>{e(r=>({wsReconnectAttempts:r.wsReconnectAttempts+1}),!1,"incrementReconnectAttempts")},resetReconnectAttempts:()=>{e({wsReconnectAttempts:0},!1,"resetReconnectAttempts")},togglePanel:()=>{e(r=>({isPanelVisible:!r.isPanelVisible}),!1,"togglePanel")},setPanelVisible:r=>{e({isPanelVisible:r},!1,"setPanelVisible")},addPersistentNotification:r=>{const n=Zx(),i={...r,id:n,timestamp:new Date().toISOString(),dismissible:r.dismissible??!0};e(s=>({persistentNotifications:[i,...s.persistentNotifications]}),!1,"addPersistentNotification");const o=t();cu(o.persistentNotifications)},removePersistentNotification:r=>{e(i=>({persistentNotifications:i.persistentNotifications.filter(o=>o.id!==r)}),!1,"removePersistentNotification");const n=t();cu(n.persistentNotifications)},clearPersistentNotifications:()=>{e({persistentNotifications:[]},!1,"clearPersistentNotifications"),typeof window<"u"&&localStorage.removeItem(cA)},loadPersistentNotifications:()=>{const r=YU();e({persistentNotifications:r},!1,"loadPersistentNotifications")},savePersistentNotifications:()=>{const r=t();cu(r.persistentNotifications)},markAllAsRead:()=>{e(n=>({persistentNotifications:n.persistentNotifications.map(i=>({...i,read:!0}))}),!1,"markAllAsRead");const r=t();cu(r.persistentNotifications)},toggleNotificationRead:r=>{e(n=>{const i=n.toasts.findIndex(a=>a.id===r),o=n.persistentNotifications.findIndex(a=>a.id===r);if(i===-1&&o===-1)return n;const s={...n};if(i!==-1){const a=[...n.toasts];a[i]={...a[i],read:!a[i].read},s.toasts=a}if(o!==-1){const a=[...n.persistentNotifications];a[o]={...a[o],read:!a[o].read},s.persistentNotifications=a,cu(a)}return s},!1,"toggleNotificationRead")},setActionState:(r,n)=>{e(i=>{const o=new Map(i.actionStates);return o.set(r,n),{actionStates:o}},!1,"setActionState")},executeAction:async(r,n,i)=>{const o=i||`${n}-${r.label}`,s=t(),a=s.actionStates.get(o);if((a==null?void 0:a.status)==="loading"||r.disabled)return;const l=new Map(s.actionStates);l.set(o,{status:"loading",lastAttempt:new Date().toISOString()}),e({actionStates:l});try{await r.onClick();const c=new Map(t().actionStates);c.set(o,{status:"success",lastAttempt:new Date().toISOString()}),e({actionStates:c})}catch(c){const d=new Map(t().actionStates);d.set(o,{status:"error",error:c instanceof Error?c.message:String(c),lastAttempt:new Date().toISOString()}),e({actionStates:d})}},retryAction:async r=>{if(!t().actionStates.get(r)){console.warn(`[NotificationStore] No action state found for key: ${r}`);return}t().setActionState(r,{status:"idle",lastAttempt:new Date().toISOString()})},addA2UINotification:(r,n="A2UI Surface")=>{if(r.displayMode==="popup")return e(a=>{const l=new Map(a.a2uiSurfaces);return l.set(r.surfaceId,r),{currentPopupCard:r,a2uiSurfaces:l}},!1,"addA2UINotification (popup)"),r.surfaceId;const i=Zx(),o={id:i,type:"a2ui",title:n,timestamp:new Date().toISOString(),dismissible:!0,duration:0,a2uiSurface:r,a2uiState:r.initialState||{},read:!1};e(a=>{const l=new Map(a.a2uiSurfaces);return l.set(r.surfaceId,r),{persistentNotifications:[o,...a.persistentNotifications],a2uiSurfaces:l,isPanelVisible:!0}},!1,"addA2UINotification (panel)");const s=t();return cu(s.persistentNotifications),i},updateA2UIState:(r,n)=>{e(i=>{const o=new Map(i.a2uiSurfaces),s=o.get(r);s&&o.set(r,{...s,initialState:{...s.initialState,...n}});const a=i.toasts.map(c=>c.a2uiSurface&&c.a2uiSurface.surfaceId===r?{...c,a2uiState:{...c.a2uiState,...n},a2uiSurface:s?{...c.a2uiSurface,initialState:{...c.a2uiSurface.initialState,...n}}:c.a2uiSurface}:c),l=i.persistentNotifications.map(c=>c.a2uiSurface&&c.a2uiSurface.surfaceId===r?{...c,a2uiState:{...c.a2uiState,...n},a2uiSurface:s?{...c.a2uiSurface,initialState:{...c.a2uiSurface.initialState,...n}}:c.a2uiSurface}:c);return{toasts:a,persistentNotifications:l,a2uiSurfaces:o}},!1,"updateA2UIState")},sendA2UIAction:(r,n,i={})=>{const o=new CustomEvent("a2ui-action",{detail:{type:"a2ui-action",actionId:r,surfaceId:n,parameters:i}});window.dispatchEvent(o)},setCurrentQuestion:r=>{e({currentQuestion:r},!1,"setCurrentQuestion")},setCurrentPopupCard:r=>{e({currentPopupCard:r},!1,"setCurrentPopupCard")}}),{name:"NotificationStore"}));if(typeof window<"u"){const e=YU();e.length>0&&ct.setState({persistentNotifications:e})}const Ole=e=>e.toasts,Ile=e=>e.wsStatus,JU=e=>e.wsLastMessage,Rle=e=>e.isPanelVisible,eH=e=>e.persistentNotifications,Nle=e=>e.currentQuestion,Mle=e=>e.currentPopupCard,Yze={info:(e,t)=>ct.getState().addToast({type:"info",title:e,message:t}),success:(e,t)=>ct.getState().addToast({type:"success",title:e,message:t}),warning:(e,t)=>ct.getState().addToast({type:"warning",title:e,message:t}),error:(e,t)=>ct.getState().addToast({type:"error",title:e,message:t,duration:0})};function jle(){const e=ct(Ole),t=ct(Ile),r=ct(JU),n=ct(Rle),i=ct(eH),o=ct(U=>U.addToast),s=ct(U=>U.removeToast),a=ct(U=>U.clearAllToasts),l=ct(U=>U.setWsStatus),c=ct(U=>U.setWsLastMessage),d=ct(U=>U.togglePanel),u=ct(U=>U.setPanelVisible),p=ct(U=>U.addPersistentNotification),g=ct(U=>U.removePersistentNotification),_=ct(U=>U.clearPersistentNotifications),y=t==="connected",m=O.useCallback((U,q,V,K)=>o({type:U,title:q,message:V,duration:K==null?void 0:K.duration,dismissible:K==null?void 0:K.dismissible,action:K==null?void 0:K.action}),[o]),v=O.useCallback((U,q)=>m("info",U,q),[m]),b=O.useCallback((U,q)=>m("success",U,q),[m]),x=O.useCallback((U,q)=>m("warning",U,q),[m]),E=O.useCallback((U,q)=>m("error",U,q,{duration:0}),[m]),C=O.useCallback(U=>{s(U)},[s]),k=O.useCallback(()=>{a()},[a]),P=O.useCallback(U=>{l(U)},[l]),T=O.useCallback(U=>{c(U)},[c]),I=O.useCallback(()=>{d()},[d]),N=O.useCallback(U=>{u(U)},[u]),B=O.useCallback((U,q,V)=>{p({type:U,title:q,message:V})},[p]),M=O.useCallback(U=>{g(U)},[g]),F=O.useCallback(()=>{_()},[_]);return{toasts:e,wsStatus:t,wsLastMessage:r,isWsConnected:y,isPanelVisible:n,persistentNotifications:i,addToast:m,info:v,success:b,warning:x,error:E,removeToast:C,clearAllToasts:k,setWsStatus:P,setWsLastMessage:T,togglePanel:I,setPanelVisible:N,addPersistentNotification:B,removePersistentNotification:M,clearPersistentNotifications:F}}const LM={"prompt-template":{defaultData:{label:"New Step",instruction:"",outputName:void 0,tool:void 0,mode:void 0,contextRefs:[]}}},Dle=[{id:"slash-command-main",label:"Slash Command",description:"Execute /workflow commands (main thread)",icon:"Terminal",color:"bg-rose-500",category:"command",data:{label:"Slash Command",instruction:"",slashCommand:"",slashArgs:"",mode:"mainprocess",nodeCategory:"command"}},{id:"slash-command-async",label:"Slash Command (Async)",description:"Execute /workflow commands (background)",icon:"Terminal",color:"bg-rose-400",category:"command",data:{label:"Slash Command (Async)",instruction:"",slashCommand:"",slashArgs:"",mode:"async",nodeCategory:"command"}}],tH="ccw-orchestrator-custom-templates";function rH(){try{const e=localStorage.getItem(tH);return e?JSON.parse(e):[]}catch{return[]}}function $M(e){try{localStorage.setItem(tH,JSON.stringify(e))}catch(t){console.error("Failed to save custom templates:",t)}}const Hg=e=>`${e}-${Date.now()}-${Math.random().toString(36).slice(2,10)}`,uu="/api/orchestrator",BM=50,Lle=100,$le=80,Ble=20;function FM(e,t,r){let n=e,i=t;for(let o=0;o<Ble;o++){if(!r.some(a=>{const l=Math.abs(a.position.x-n),c=Math.abs(a.position.y-i);return l<BM&&c<BM}))return{x:n,y:i};n+=Lle,i+=$le}return{x:n,y:i}}const Fle={currentFlow:null,isModified:!1,nodes:[],edges:[],selectedNodeId:null,selectedEdgeId:null,flows:[],isLoadingFlows:!1,isPaletteOpen:!0,isPropertyPanelOpen:!1,leftPanelTab:"nodes",customTemplates:rH(),interactionMode:"pan"},zle=gn()(En((e,t)=>({...Fle,setCurrentFlow:r=>{e({currentFlow:r,nodes:(r==null?void 0:r.nodes)??[],edges:(r==null?void 0:r.edges)??[],isModified:!1,selectedNodeId:null,selectedEdgeId:null},!1,"setCurrentFlow")},createFlow:(r,n)=>{const i={id:Hg("flow"),name:r,description:n,version:1,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),nodes:[],edges:[],variables:{},metadata:{source:"custom"}};return e({currentFlow:i,nodes:[],edges:[],isModified:!0,selectedNodeId:null,selectedEdgeId:null},!1,"createFlow"),i},saveFlow:async()=>{const{currentFlow:r,nodes:n,edges:i}=t();if(!r)return!1;try{const o={...r,nodes:n,edges:i,updated_at:new Date().toISOString()},s=!t().flows.some(p=>p.id===r.id),a=s?"POST":"PUT",l=s?`${uu}/flows`:`${uu}/flows/${r.id}`,c=await fetch(l,{method:a,headers:{"Content-Type":"application/json"},body:JSON.stringify(o),credentials:"same-origin"});if(!c.ok)throw new Error(`Failed to save flow: ${c.statusText}`);const d=await c.json(),u=d&&typeof d=="object"&&"data"in d?d.data:d;return e(p=>({currentFlow:u,isModified:!1,flows:s?[...p.flows,u]:p.flows.map(g=>g.id===u.id?u:g)}),!1,"saveFlow"),!0}catch(o){return console.error("Error saving flow:",o),!1}},loadFlow:async r=>{try{const n=await fetch(`${uu}/flows/${r}`,{credentials:"same-origin"});if(!n.ok)throw new Error(`Failed to load flow: ${n.statusText}`);const i=await n.json(),o=i&&typeof i=="object"&&"data"in i?i.data:i;return e({currentFlow:o,nodes:o.nodes,edges:o.edges,isModified:!1,selectedNodeId:null,selectedEdgeId:null},!1,"loadFlow"),!0}catch(n){return console.error("Error loading flow:",n),!1}},deleteFlow:async r=>{try{const n=await fetch(`${uu}/flows/${r}`,{method:"DELETE",credentials:"same-origin"});if(!n.ok)throw new Error(`Failed to delete flow: ${n.statusText}`);return e(i=>{var o,s,a;return{flows:i.flows.filter(l=>l.id!==r),currentFlow:((o=i.currentFlow)==null?void 0:o.id)===r?null:i.currentFlow,nodes:((s=i.currentFlow)==null?void 0:s.id)===r?[]:i.nodes,edges:((a=i.currentFlow)==null?void 0:a.id)===r?[]:i.edges}},!1,"deleteFlow"),!0}catch(n){return console.error("Error deleting flow:",n),!1}},duplicateFlow:async r=>{try{const n=await fetch(`${uu}/flows/${r}/duplicate`,{method:"POST",credentials:"same-origin"});if(!n.ok)throw new Error(`Failed to duplicate flow: ${n.statusText}`);const i=await n.json(),o=i&&typeof i=="object"&&"data"in i?i.data:i;return e(s=>({flows:[...s.flows,o]}),!1,"duplicateFlow"),o}catch(n){return console.error("Error duplicating flow:",n),null}},addNode:r=>{const n=LM["prompt-template"],i=Hg("node"),o=FM(r.x,r.y,t().nodes),s={id:i,type:"prompt-template",position:o,data:{...n.defaultData}};return e(a=>({nodes:[...a.nodes,s],isModified:!0,selectedNodeId:i}),!1,"addNode"),i},addNodeFromTemplate:(r,n)=>{const i=Dle.find(d=>d.id===r)||t().customTemplates.find(d=>d.id===r);if(!i)return console.error(`Template not found: ${r}`),t().addNode(n);const o=Hg("node"),s=LM["prompt-template"],a=FM(n.x,n.y,t().nodes),l={...s.defaultData,...i.data,label:i.data.label||i.label,contextRefs:i.data.contextRefs||[]},c={id:o,type:"prompt-template",position:a,data:l};return e(d=>({nodes:[...d.nodes,c],isModified:!0,selectedNodeId:o}),!1,"addNodeFromTemplate"),o},updateNode:(r,n)=>{e(i=>({nodes:i.nodes.map(o=>o.id===r?{...o,data:{...o.data,...n}}:o),isModified:!0}),!1,"updateNode")},removeNode:r=>{e(n=>({nodes:n.nodes.filter(i=>i.id!==r),edges:n.edges.filter(i=>i.source!==r&&i.target!==r),isModified:!0,selectedNodeId:n.selectedNodeId===r?null:n.selectedNodeId}),!1,"removeNode")},setNodes:r=>{e({nodes:r,isModified:!0},!1,"setNodes")},addEdge:(r,n,i,o)=>{const s=Hg("edge"),a={id:s,source:r,target:n,sourceHandle:i,targetHandle:o};return e(l=>({edges:[...l.edges,a],isModified:!0}),!1,"addEdge"),s},updateEdge:(r,n)=>{e(i=>({edges:i.edges.map(o=>o.id===r?{...o,data:{...o.data,...n}}:o),isModified:!0}),!1,"updateEdge")},removeEdge:r=>{e(n=>({edges:n.edges.filter(i=>i.id!==r),isModified:!0,selectedEdgeId:n.selectedEdgeId===r?null:n.selectedEdgeId}),!1,"removeEdge")},setEdges:r=>{e({edges:r,isModified:!0},!1,"setEdges")},setSelectedNodeId:r=>{e({selectedNodeId:r,selectedEdgeId:null,isPropertyPanelOpen:r!==null},!1,"setSelectedNodeId")},setSelectedEdgeId:r=>{e({selectedEdgeId:r,selectedNodeId:null},!1,"setSelectedEdgeId")},fetchFlows:async()=>{e({isLoadingFlows:!0},!1,"fetchFlows/start");try{const r=await fetch(`${uu}/flows`,{credentials:"same-origin"});if(!r.ok)throw new Error(`Failed to fetch flows: ${r.statusText}`);const n=await r.json(),i=Array.isArray(n==null?void 0:n.data)?n.data:(n==null?void 0:n.flows)||[];e({flows:i,isLoadingFlows:!1},!1,"fetchFlows/success")}catch(r){console.error("Error fetching flows:",r),e({isLoadingFlows:!1},!1,"fetchFlows/error")}},setIsPaletteOpen:r=>{e({isPaletteOpen:r},!1,"setIsPaletteOpen")},setIsPropertyPanelOpen:r=>{e({isPropertyPanelOpen:r},!1,"setIsPropertyPanelOpen")},setLeftPanelTab:r=>{e({leftPanelTab:r},!1,"setLeftPanelTab")},toggleInteractionMode:()=>{e(r=>({interactionMode:r.interactionMode==="pan"?"selection":"pan"}),!1,"toggleInteractionMode")},setInteractionMode:r=>{e({interactionMode:r},!1,"setInteractionMode")},addCustomTemplate:r=>{e(n=>{const i=[...n.customTemplates,r];return $M(i),{customTemplates:i}},!1,"addCustomTemplate")},removeCustomTemplate:r=>{e(n=>{const i=n.customTemplates.filter(o=>o.id!==r);return $M(i),{customTemplates:i}},!1,"removeCustomTemplate")},saveNodeAsTemplate:(r,n,i)=>{const o=t().nodes.find(u=>u.id===r);if(!o)return null;const{executionStatus:s,executionError:a,executionResult:l,...c}=o.data,d={id:`custom-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,label:n,description:i,icon:"MessageSquare",color:"bg-blue-500",category:"command",data:{...c,label:n}};return t().addCustomTemplate(d),d},loadCustomTemplates:()=>{e({customTemplates:rH()},!1,"loadCustomTemplates")},resetFlow:()=>{e({currentFlow:null,nodes:[],edges:[],isModified:!1,selectedNodeId:null,selectedEdgeId:null},!1,"resetFlow")},getSelectedNode:()=>{const{nodes:r,selectedNodeId:n}=t();return r.find(i=>i.id===n)},markModified:()=>{e({isModified:!0},!1,"markModified")}}),{name:"FlowStore"})),Ule=500,Hle={currentExecution:null,nodeStates:{},logs:[],maxLogs:Ule,nodeOutputs:{},nodeToolCalls:{},selectedNodeId:null,isMonitorPanelOpen:!1,autoScrollLogs:!0},qle=gn()(En((e,t)=>({...Hle,startExecution:(r,n)=>{const i=new Date().toISOString();e({currentExecution:{execId:r,flowId:n,status:"running",startedAt:i,elapsedMs:0},nodeStates:{},logs:[]},!1,"startExecution")},setExecutionStatus:(r,n)=>{e(i=>i.currentExecution?{currentExecution:{...i.currentExecution,status:r,currentNodeId:n??i.currentExecution.currentNodeId}}:i,!1,"setExecutionStatus")},completeExecution:r=>{const n=new Date().toISOString();e(i=>{if(!i.currentExecution)return i;const o=new Date(i.currentExecution.startedAt).getTime(),s=Date.now()-o;return{currentExecution:{...i.currentExecution,status:r,completedAt:n,elapsedMs:s,currentNodeId:void 0}}},!1,"completeExecution")},clearExecution:()=>{e({currentExecution:null,nodeStates:{},logs:[]},!1,"clearExecution")},setNodeStarted:r=>{const n=new Date().toISOString();e(i=>({nodeStates:{...i.nodeStates,[r]:{nodeId:r,status:"running",startedAt:n}}}),!1,"setNodeStarted")},setNodeCompleted:(r,n)=>{const i=new Date().toISOString();e(o=>({nodeStates:{...o.nodeStates,[r]:{...o.nodeStates[r],nodeId:r,status:"completed",completedAt:i,result:n}}}),!1,"setNodeCompleted")},setNodeFailed:(r,n)=>{const i=new Date().toISOString();e(o=>({nodeStates:{...o.nodeStates,[r]:{...o.nodeStates[r],nodeId:r,status:"failed",completedAt:i,error:n}}}),!1,"setNodeFailed")},clearNodeStates:()=>{e({nodeStates:{}},!1,"clearNodeStates")},addLog:r=>{e(n=>{const i=[...n.logs,r];return i.length>n.maxLogs?{logs:i.slice(-n.maxLogs)}:{logs:i}},!1,"addLog")},clearLogs:()=>{e({logs:[]},!1,"clearLogs")},setMonitorPanelOpen:r=>{e({isMonitorPanelOpen:r},!1,"setMonitorPanelOpen")},setAutoScrollLogs:r=>{e({autoScrollLogs:r},!1,"setAutoScrollLogs")},addNodeOutput:(r,n)=>{e(i=>{const o=i.nodeOutputs[r];return o?{nodeOutputs:{...i.nodeOutputs,[r]:{...o,outputs:[...o.outputs,n]}}}:{nodeOutputs:{...i.nodeOutputs,[r]:{nodeId:r,outputs:[n],toolCalls:[],logs:[],variables:{},startTime:Date.now()}}}},!1,"addNodeOutput")},clearNodeOutputs:r=>{e(n=>{const i={...n.nodeOutputs};return delete i[r],{nodeOutputs:i}},!1,"clearNodeOutputs")},startToolCall:(r,n,i)=>{const o={callId:n,nodeId:r,status:"executing",kind:i.kind,subtype:i.subtype,description:i.description,startTime:Date.now(),outputLines:[],outputBuffer:{stdout:"",stderr:"",combined:""}};e(s=>{const a=s.nodeToolCalls[r]||[];return{nodeToolCalls:{...s.nodeToolCalls,[r]:[...a,o]}}},!1,"startToolCall")},updateToolCall:(r,n,i)=>{e(o=>{const s=o.nodeToolCalls[r];if(!s)return o;const a=s.findIndex(d=>d.callId===n);if(a===-1)return o;const l=[...s],c=l[a];if(i.status&&(c.status=i.status,i.status!=="executing"&&!c.endTime&&(c.endTime=Date.now(),c.duration=c.endTime-c.startTime)),i.outputChunk!==void 0){const d={type:i.stream==="stderr"?"stderr":"stdout",content:i.outputChunk,timestamp:Date.now()};c.outputLines.push(d),i.stream==="stderr"?(c.outputBuffer.stderr+=i.outputChunk,c.outputBuffer.combined+=i.outputChunk):(c.outputBuffer.stdout+=i.outputChunk,c.outputBuffer.combined+=i.outputChunk)}return l[a]=c,{nodeToolCalls:{...o.nodeToolCalls,[r]:l}}},!1,"updateToolCall")},completeToolCall:(r,n,i)=>{e(o=>{const s=o.nodeToolCalls[r];if(!s)return o;const a=s.findIndex(d=>d.callId===n);if(a===-1)return o;const l=[...s],c={...l[a]};return c.status=i.status,c.endTime=Date.now(),c.duration=c.endTime-c.startTime,i.exitCode!==void 0&&(c.exitCode=i.exitCode),i.error!==void 0&&(c.error=i.error),i.result!==void 0&&(c.result=i.result),l[a]=c,{nodeToolCalls:{...o.nodeToolCalls,[r]:l}}},!1,"completeToolCall")},toggleToolCallExpanded:(r,n)=>{e(i=>{const o=i.nodeToolCalls[r];if(!o)return i;const s=o.findIndex(l=>l.callId===n);if(s===-1)return i;const a=[...o];return a[s]={...a[s],isExpanded:!a[s].isExpanded},{nodeToolCalls:{...i.nodeToolCalls,[r]:a}}},!1,"toggleToolCallExpanded")},selectNode:r=>{e({selectedNodeId:r},!1,"selectNode")},getNodeOutputs:r=>t().nodeOutputs[r],getToolCallsForNode:r=>t().nodeToolCalls[r]||[]}),{name:"ExecutionStore"})),Jze=e=>{var t;return((t=e.currentExecution)==null?void 0:t.status)==="running"},Wle="cli-viewer-storage",Vle=1,zM=e=>`pane-${e}`,Gle=e=>`tab-${e}`,Zh=e=>typeof e=="string",Kle=(e,t)=>{const r=(n,i)=>{for(let o=0;o<n.children.length;o++){const s=n.children[o];if(Zh(s)){if(s===t)return{found:!0,parent:n,index:o}}else{const a=r(s);if(a.found)return a}}return{found:!1,parent:null,index:-1}};return r(e)},Xle=(e,t)=>{const r=i=>{const o=[];for(const l of i.children)if(Zh(l))l!==t&&o.push(l);else{const c=r(l);c&&c.children.length>0&&(c.children.length===1?o.push(c.children[0]):o.push(c))}if(o.length===0)return null;const s=i.sizes?i.sizes.filter((l,c)=>{const d=i.children[c];return!Zh(d)||d!==t}):void 0,a=s?(()=>{const l=s.reduce((c,d)=>c+d,0);return l>0?s.map(c=>c/l*100):void 0})():void 0;return{direction:i.direction,sizes:a,children:o}};return r(e)||{direction:"horizontal",children:[]}},Zle=(e,t,r,n="horizontal")=>{if(!r){if(e.children.length===0)return{...e,children:[t],sizes:[100]};if(e.direction===n){const o=e.sizes||e.children.map(()=>100/e.children.length),s=o.reduce((c,d)=>c+d,0),a=s/(e.children.length+1),l=(s-a)/s;return{...e,children:[...e.children,t],sizes:[...o.map(c=>c*l),a]}}return{direction:n,sizes:[50,50],children:[e,t]}}const i=o=>{const s=[];let a=o.sizes?[]:void 0;for(let l=0;l<o.children.length;l++){const c=o.children[l],d=o.sizes?o.sizes[l]:void 0;if(Zh(c))if(c===r)if(o.direction===n){const u=(d||50)/2;s.push(c,t),a&&a.push(u,u)}else{const u={direction:n,sizes:[50,50],children:[c,t]};s.push(u),a&&d!==void 0&&a.push(d)}else s.push(c),a&&d!==void 0&&a.push(d);else Kle(c,r).found?s.push(i(c)):s.push(c),a&&d!==void 0&&a.push(d)}return{...o,children:s,sizes:a}};return i(e)},qg=e=>{const t=[],r=n=>{for(const i of n.children)Zh(i)?t.push(i):r(i)};return r(e),t},nH=()=>({direction:"horizontal",children:[]}),Qle={layout:nH(),panes:{},tabs:{},focusedPaneId:null,nextPaneIdCounter:1,nextTabIdCounter:1},uA=gn()(im(En((e,t)=>({...Qle,setLayout:r=>{if(typeof r=="function"){const n=t().layout,i=r(n);e({layout:i},!1,"viewer/setLayout")}else e({layout:r},!1,"viewer/setLayout")},addPane:(r,n="horizontal")=>{const i=t(),o=zM(i.nextPaneIdCounter),s={id:o,tabs:[],activeTabId:null},a=Zle(i.layout,o,r,n);return e({layout:a,panes:{...i.panes,[o]:s},focusedPaneId:o,nextPaneIdCounter:i.nextPaneIdCounter+1},!1,"viewer/addPane"),o},removePane:r=>{const n=t(),i=n.panes[r];if(!i){console.warn(`[ViewerStore] Pane not found: ${r}`);return}if(qg(n.layout).length<=1){console.warn("[ViewerStore] Cannot remove the last pane");return}const s=Xle(n.layout,r),a={...n.panes};delete a[r];const l={...n.tabs};for(const d of i.tabs)delete l[d.id];let c=n.focusedPaneId;if(c===r){const d=qg(s);c=d.length>0?d[0]:null}e({layout:s,panes:a,tabs:l,focusedPaneId:c},!1,"viewer/removePane")},addTab:(r,n,i)=>{const o=t(),s=o.panes[r];if(!s)return console.warn(`[ViewerStore] Pane not found: ${r}`),"";const a=s.tabs.find(p=>p.executionId===n);if(a)return e({panes:{...o.panes,[r]:{...s,activeTabId:a.id}},focusedPaneId:r},!1,"viewer/addTab-existing"),a.id;for(const[p,g]of Object.entries(o.panes)){if(p===r)continue;const _=g.tabs.find(y=>y.executionId===n);if(_)return e({panes:{...o.panes,[p]:{...g,activeTabId:_.id}},focusedPaneId:p},!1,"viewer/addTab-existing-global"),_.id}const l=Gle(o.nextTabIdCounter),c=s.tabs.reduce((p,g)=>Math.max(p,g.order),0),d={id:l,executionId:n,title:i,isPinned:!1,order:c+1},u={...s,tabs:[...s.tabs,d],activeTabId:l};return e({panes:{...o.panes,[r]:u},tabs:{...o.tabs,[l]:d},focusedPaneId:r,nextTabIdCounter:o.nextTabIdCounter+1},!1,"viewer/addTab"),l},removeTab:(r,n)=>{const i=t(),o=i.panes[r];if(!o){console.warn(`[ViewerStore] Pane not found: ${r}`);return}const s=o.tabs.findIndex(u=>u.id===n);if(s===-1){console.warn(`[ViewerStore] Tab not found: ${n}`);return}const a=o.tabs.filter(u=>u.id!==n);let l=null;if(o.activeTabId===n&&a.length>0){const u=Math.min(s,a.length-1);l=a[u].id}else o.activeTabId!==n&&(l=o.activeTabId);const c={...o,tabs:a,activeTabId:l},d={...i.tabs};delete d[n],e({panes:{...i.panes,[r]:c},tabs:d},!1,"viewer/removeTab"),a.length===0&&qg(t().layout).length>1&&queueMicrotask(()=>{var g;const p=t();((g=p.panes[r])==null?void 0:g.tabs.length)===0&&p.removePane(r)})},setActiveTab:(r,n)=>{const i=t(),o=i.panes[r];if(!o){console.warn(`[ViewerStore] Pane not found: ${r}`);return}if(!o.tabs.find(a=>a.id===n)){console.warn(`[ViewerStore] Tab not found in pane: ${n}`);return}e({panes:{...i.panes,[r]:{...o,activeTabId:n}},focusedPaneId:r},!1,"viewer/setActiveTab")},moveTab:(r,n,i,o)=>{const s=t(),a=s.panes[r],l=s.panes[i];if(!a||!l){console.warn("[ViewerStore] Source or target pane not found");return}const c=a.tabs.findIndex(x=>x.id===n);if(c===-1){console.warn(`[ViewerStore] Tab not found: ${n}`);return}const d=a.tabs[c],u=a.tabs.filter(x=>x.id!==n);let p=a.activeTabId;if(a.activeTabId===n&&u.length>0){const x=Math.min(c,u.length-1);p=u[x].id}else a.activeTabId===n&&(p=null);let g;if(r===i){const x=[...u].sort((E,C)=>E.order-C.order);if(o===0)g=x.length>0?x[0].order-1:1;else if(o>=x.length)g=x.length>0?x[x.length-1].order+1:1;else{const E=x[o-1].order,C=x[o].order;g=(E+C)/2}}else{const x=[...l.tabs].sort((E,C)=>E.order-C.order);if(o===0)g=x.length>0?x[0].order-1:1;else if(o>=x.length)g=x.length>0?x[x.length-1].order+1:1;else{const E=x[o-1].order,C=x[o].order;g=(E+C)/2}}const _={...d,order:g};let y;r===i?y=[...u,_]:y=[...l.tabs,_];const m={...a,tabs:r===i?y:u,activeTabId:r===i?n:p},v=r===i?m:{...l,tabs:y,activeTabId:n},b={...s.panes,[r]:m};r!==i&&(b[i]=v),e({panes:b,tabs:{...s.tabs,[n]:_},focusedPaneId:i},!1,"viewer/moveTab"),r!==i&&u.length===0&&qg(t().layout).length>1&&queueMicrotask(()=>{var C;const E=t();((C=E.panes[r])==null?void 0:C.tabs.length)===0&&E.removePane(r)})},togglePinTab:r=>{const n=t(),i=n.tabs[r];if(!i){console.warn(`[ViewerStore] Tab not found: ${r}`);return}const o={...i,isPinned:!i.isPinned},s={...n.panes};for(const a of Object.keys(s)){const l=s[a];if(l.tabs.findIndex(d=>d.id===r)!==-1){s[a]={...l,tabs:l.tabs.map(d=>d.id===r?o:d)};break}}e({tabs:{...n.tabs,[r]:o},panes:s},!1,"viewer/togglePinTab")},setFocusedPane:r=>{if(!t().panes[r]){console.warn(`[ViewerStore] Pane not found: ${r}`);return}e({focusedPaneId:r},!1,"viewer/setFocusedPane")},initializeDefaultLayout:r=>{let i=t().nextPaneIdCounter;const o=()=>({id:zM(i++),tabs:[],activeTabId:null});let s;const a={};switch(r){case"single":{const c=o();a[c.id]=c,s={direction:"horizontal",sizes:[100],children:[c.id]};break}case"split-h":{const c=o(),d=o();a[c.id]=c,a[d.id]=d,s={direction:"horizontal",sizes:[50,50],children:[c.id,d.id]};break}case"split-v":{const c=o(),d=o();a[c.id]=c,a[d.id]=d,s={direction:"vertical",sizes:[50,50],children:[c.id,d.id]};break}case"grid-2x2":{const c=o(),d=o(),u=o(),p=o();a[c.id]=c,a[d.id]=d,a[u.id]=u,a[p.id]=p,s={direction:"vertical",sizes:[50,50],children:[{direction:"horizontal",sizes:[50,50],children:[c.id,d.id]},{direction:"horizontal",sizes:[50,50],children:[u.id,p.id]}]};break}default:return}const l=Object.keys(a)[0]||null;e({layout:s,panes:a,tabs:{},focusedPaneId:l,nextPaneIdCounter:i,nextTabIdCounter:1},!1,"viewer/initializeDefaultLayout")},reset:()=>{e({layout:nH(),panes:{},tabs:{},focusedPaneId:null,nextPaneIdCounter:1,nextTabIdCounter:1},!1,"viewer/reset")}}),{name:"ViewerStore"}),{name:Wle,version:Vle,partialize:e=>({layout:e.layout,panes:e.panes,tabs:e.tabs,focusedPaneId:e.focusedPaneId,nextPaneIdCounter:e.nextPaneIdCounter,nextTabIdCounter:e.nextTabIdCounter})})),eUe=()=>uA(e=>e.layout),tUe=()=>uA(e=>e.panes),rUe=()=>uA(e=>e.focusedPaneId),nUe=(e,t)=>{const r=e.panes[t];return!r||!r.activeTabId?null:r.tabs.find(n=>n.id===r.activeTabId)||null},UM={isPanelOpen:!1,activeTerminalId:null,panelView:"terminal",terminalOrder:[]},zn=gn()(En((e,t)=>({...UM,openTerminal:r=>{const{terminalOrder:n}=t(),i=n.includes(r)?n:[...n,r];e({isPanelOpen:!0,activeTerminalId:r,panelView:"terminal",terminalOrder:i},!1,"openTerminal")},closePanel:()=>{e({isPanelOpen:!1},!1,"closePanel")},togglePanel:()=>{const{isPanelOpen:r,activeTerminalId:n,terminalOrder:i}=t();if(r)e({isPanelOpen:!1},!1,"togglePanel/close");else{const o=n??i[0]??null;e({isPanelOpen:!0,activeTerminalId:o,panelView:o?"terminal":"queue"},!1,"togglePanel/open")}},setActiveTerminal:r=>{e({activeTerminalId:r},!1,"setActiveTerminal")},setPanelView:r=>{e({panelView:r},!1,"setPanelView")},addTerminal:r=>{const{terminalOrder:n}=t();n.includes(r)||e({terminalOrder:[...n,r]},!1,"addTerminal")},removeTerminal:r=>{const{terminalOrder:n,activeTerminalId:i}=t(),o=n.filter(a=>a!==r);let s=i;if(i===r){const a=n.indexOf(r);o.length===0?s=null:a>=o.length?s=o[o.length-1]:s=o[a]}e({terminalOrder:o,activeTerminalId:s,isPanelOpen:o.length>0?t().isPanelOpen:!1},!1,"removeTerminal")},resetState:()=>{e({...UM},!1,"resetState")}}),{name:"TerminalPanelStore"})),Yle=e=>e.terminalOrder.length;function iUe(){return zn(t=>t.openTerminal)}const HM={executions:{}},Ud=gn()(En(e=>({...HM,addExecution:t=>{e(r=>({executions:{...r.executions,[t.id]:t}}),!1,"addExecution")},updateStatus:(t,r,n)=>{e(i=>{const o=i.executions[t];if(!o)return i;const s=r==="completed"||r==="failed";return{executions:{...i.executions,[t]:{...o,status:r,completedAt:s?new Date().toISOString():o.completedAt,error:n??o.error}}}},!1,"updateStatus")},removeExecution:t=>{e(r=>{const{[t]:n,...i}=r.executions;return{executions:i}},!1,"removeExecution")},clearCompleted:()=>{e(t=>{const r={};for(const[n,i]of Object.entries(t.executions))i.status!=="completed"&&i.status!=="failed"&&(r[n]=i);return{executions:r}},!1,"clearCompleted")},resetState:()=>{e({...HM},!1,"resetState")}}),{name:"QueueExecutionStore"})),Jle=[],ece=e=>t=>{const r=Object.values(t.executions).filter(n=>n.queueItemId===e);return r.length===0?Jle:r};function tce(e,t){return e.dependsOn.every(r=>{const n=t[r];return n&&(n.status==="completed"||n.status==="skipped")})}function qM(e,t){for(const r of e.steps){const n=t[r.id];if(n&&n.status==="pending"&&tce(r,t))return r.id}return null}function rce(e){return Object.values(e).every(t=>t.status==="completed"||t.status==="skipped"||t.status==="failed")}const WM={activePlans:{}},Bl=gn()(En((e,t)=>({...WM,startOrchestration:(r,n)=>{const i={};for(const s of r.steps)i[s.id]={status:"pending",retryCount:0};const o={plan:r,status:"running",currentStepIndex:0,stepStatuses:i,executionIdMap:{},sessionKey:n};e(s=>({activePlans:{...s.activePlans,[r.id]:o}}),!1,"startOrchestration")},pauseOrchestration:r=>{e(n=>{const i=n.activePlans[r];return!i||i.status!=="running"?n:{activePlans:{...n.activePlans,[r]:{...i,status:"paused"}}}},!1,"pauseOrchestration")},resumeOrchestration:r=>{e(n=>{const i=n.activePlans[r];return!i||i.status!=="paused"?n:{activePlans:{...n.activePlans,[r]:{...i,status:"running"}}}},!1,"resumeOrchestration")},stopOrchestration:(r,n)=>{e(i=>{const o=i.activePlans[r];return o?{activePlans:{...i.activePlans,[r]:{...o,status:"failed",error:n??"Orchestration stopped by user"}}}:i},!1,"stopOrchestration")},updateStepStatus:(r,n,i,o)=>{e(s=>{const a=s.activePlans[r];if(!a)return s;const l=a.stepStatuses[n];if(!l)return s;const c=new Date().toISOString(),d=i==="running",u=i==="completed"||i==="failed"||i==="skipped";return{activePlans:{...s.activePlans,[r]:{...a,stepStatuses:{...a.stepStatuses,[n]:{...l,status:i,startedAt:d?c:l.startedAt,completedAt:u?c:l.completedAt,result:(o==null?void 0:o.data)??l.result,error:(o==null?void 0:o.error)??l.error}}}}}},!1,"updateStepStatus")},registerExecution:(r,n,i)=>{e(o=>{const s=o.activePlans[r];return s?{activePlans:{...o.activePlans,[r]:{...s,executionIdMap:{...s.executionIdMap,[i]:n}}}}:o},!1,"registerExecution")},retryStep:(r,n)=>{e(i=>{const o=i.activePlans[r];if(!o)return i;const s=o.stepStatuses[n];return s?{activePlans:{...i.activePlans,[r]:{...o,status:"running",stepStatuses:{...o.stepStatuses,[n]:{...s,status:"pending",error:void 0,result:void 0,startedAt:void 0,completedAt:void 0,retryCount:s.retryCount+1}}}}}:i},!1,"retryStep")},skipStep:(r,n)=>{e(i=>{const o=i.activePlans[r];if(!o)return i;const s=o.stepStatuses[n];return s?{activePlans:{...i.activePlans,[r]:{...o,stepStatuses:{...o.stepStatuses,[n]:{...s,status:"skipped",completedAt:new Date().toISOString()}}}}}:i},!1,"skipStep")},_advanceToNextStep:r=>{const i=t().activePlans[r];if(!i||i.status!=="running")return null;const o=qM(i.plan,i.stepStatuses);if(o){const s=i.plan.steps.findIndex(a=>a.id===o);return e(a=>{const l=a.activePlans[r];return l?{activePlans:{...a.activePlans,[r]:{...l,currentStepIndex:s>=0?s:l.currentStepIndex}}}:a},!1,"_advanceToNextStep"),o}if(rce(i.stepStatuses)){const s=Object.values(i.stepStatuses).some(a=>a.status==="failed");e(a=>{const l=a.activePlans[r];return l?{activePlans:{...a.activePlans,[r]:{...l,status:s?"failed":"completed"}}}:a},!1,"_advanceToNextStep/complete")}return null},getNextReadyStep:r=>{const i=t().activePlans[r];return!i||i.status!=="running"?null:qM(i.plan,i.stepStatuses)},removePlan:r=>{e(n=>{const{[r]:i,...o}=n.activePlans;return{activePlans:o}},!1,"removePlan")},clearAll:()=>{e(WM,!1,"clearAll")}}),{name:"OrchestratorStore"})),nce=e=>e.activePlans,ice=e=>Object.values(e.activePlans).filter(t=>t.status==="running"||t.status==="paused").length,oce=2*1024*1024,sce=new TextEncoder;function Qx(e){return sce.encode(e).length}const VM={sessions:{},outputChunks:{},outputBytes:{}},li=gn()(En((e,t)=>({...VM,setSessions:r=>e(n=>{const i={};for(const l of r)i[l.sessionKey]=l;const o=new Set(Object.keys(i)),s={...n.outputChunks},a={...n.outputBytes};for(const l of Object.keys(s))o.has(l)||delete s[l];for(const l of Object.keys(a))o.has(l)||delete a[l];return{sessions:i,outputChunks:s,outputBytes:a}}),upsertSession:r=>e(n=>({sessions:{...n.sessions,[r.sessionKey]:r}})),removeSession:r=>e(n=>{const i={...n.sessions},o={...n.outputChunks},s={...n.outputBytes};return delete i[r],delete o[r],delete s[r],{sessions:i,outputChunks:o,outputBytes:s}}),updateSessionPausedState:(r,n)=>e(i=>{const o=i.sessions[r];return o?{sessions:{...i.sessions,[r]:{...o,isPaused:n,updatedAt:new Date().toISOString()}}}:i}),resetState:()=>e({...VM}),setBuffer:(r,n)=>e(i=>({outputChunks:{...i.outputChunks,[r]:n?[{data:n,timestamp:Date.now()}]:[]},outputBytes:{...i.outputBytes,[r]:n?Qx(n):0}})),appendOutput:(r,n,i=Date.now())=>{if(!n)return;const o=Qx(n),{outputChunks:s,outputBytes:a}=t(),l=s[r]??[],c=a[r]??0,d=[...l,{data:n,timestamp:i}];let u=c+o;for(;u>oce&&d.length>0;){const p=d.shift();p&&(u-=Qx(p.data))}e(p=>({outputChunks:{...p.outputChunks,[r]:d},outputBytes:{...p.outputBytes,[r]:Math.max(0,u)}}))},clearOutput:r=>e(n=>({outputChunks:{...n.outputChunks,[r]:[]},outputBytes:{...n.outputBytes,[r]:0}}))}),{name:"cliSessionStore"})),GM={groups:[],layout:{grid:"1x1",splits:[1]},activeTerminalId:null,terminalMetas:{}};let ri=null;function ace(e){Hd.getState().updateTerminalMeta(e.sessionKey,{status:"locked",isLocked:!0,lockReason:e.reason,lockedByExecutionId:e.executionId,lockedAt:e.timestamp})}function lce(e){const t=Hd.getState(),r=t.terminalMetas[e.sessionKey];r!=null&&r.isLocked&&t.updateTerminalMeta(e.sessionKey,{status:"active",isLocked:!1,lockReason:void 0,lockedByExecutionId:void 0,lockedAt:void 0})}function cce(e){const t=e.data;if(t.type!=="alert")return;const{sessionId:r,severity:n,message:i}=t,o={critical:"error",warning:"idle"},s=Hd.getState(),a=s.terminalMetas[r],l=(a==null?void 0:a.alertCount)??0;s.updateTerminalMeta(r,{status:o[n]??"idle",alertCount:l+1})}const Hd=gn()(En(e=>({...GM,createGroup:t=>{const n={id:`group-${Date.now()}-${Math.random().toString(36).slice(2,7)}`,name:t,sessionIds:[]};e(i=>({groups:[...i.groups,n]}),!1,"createGroup")},removeGroup:t=>{e(r=>({groups:r.groups.filter(n=>n.id!==t)}),!1,"removeGroup")},moveSessionToGroup:(t,r)=>{e(n=>({groups:n.groups.map(o=>{const s=o.sessionIds.filter(a=>a!==t);return o.id===r?{...o,sessionIds:[...s,t]}:{...o,sessionIds:s}})}),!1,"moveSessionToGroup")},setActiveTerminal:t=>{e({activeTerminalId:t},!1,"setActiveTerminal")},updateTerminalMeta:(t,r)=>{e(n=>{const i=n.terminalMetas[t]??{title:t,status:"idle",alertCount:0};return{terminalMetas:{...n.terminalMetas,[t]:{...i,...r}}}},!1,"updateTerminalMeta")},resetState:()=>{ri&&(ri.terminate(),ri=null),e({...GM},!1,"resetState")},setGroupLayout:t=>{e({layout:t},!1,"setGroupLayout")},spawnMonitor:()=>{if(!ri)try{ri=new Worker(new URL("/assets/monitor.worker-CVRNUIeJ.js",import.meta.url),{type:"module"}),ri.onmessage=cce,ri.onerror=t=>{}}catch{ri=null}},terminateMonitor:()=>{ri&&(ri.terminate(),ri=null)},feedMonitor:(t,r)=>{ri||Hd.getState().spawnMonitor(),ri&&ri.postMessage({type:"output",sessionId:t,text:r})},pauseSession:async t=>{const r=sr(At.getState());try{await qU(t,r??void 0),e(n=>{const i=n.terminalMetas[t];return i?{terminalMetas:{...n.terminalMetas,[t]:{...i,status:"paused"}}}:n},!1,"pauseSession")}catch(n){throw n}},resumeSession:async t=>{const r=sr(At.getState());e(n=>{const i=n.terminalMetas[t];return i?{terminalMetas:{...n.terminalMetas,[t]:{...i,status:"resuming"}}}:n},!1,"resumeSession/pending");try{await WU(t,r??void 0),e(n=>{const i=n.terminalMetas[t];return i?{terminalMetas:{...n.terminalMetas,[t]:{...i,status:"active"}}}:n},!1,"resumeSession/fulfilled")}catch(n){throw e(i=>{const o=i.terminalMetas[t];return o?{terminalMetas:{...i.terminalMetas,[t]:{...o,status:"paused"}}}:i},!1,"resumeSession/rejected"),n}},restartSession:async t=>{const r=sr(At.getState()),i=li.getState().sessions[t];if(!i)throw new Error(`Session not found: ${t}`);const o={workingDir:i.workingDir,tool:i.tool,model:i.model,resumeKey:i.resumeKey,shellKind:i.shellKind},s=a=>a==="pwsh"||a==="powershell"?"pwsh":a==="cmd"?"cmd":"bash";try{await Gv(t,r??void 0);const a=await C0({workingDir:o.workingDir,preferredShell:s(o.shellKind),tool:o.tool,model:o.model,resumeKey:o.resumeKey},r??void 0);return e(l=>{const c=l.terminalMetas[t];return c?{terminalMetas:{...l.terminalMetas,[t]:{...c,status:"active",alertCount:0}}}:l},!1,"restartSession"),a}catch(a){throw a}},closeSession:async t=>{const r=sr(At.getState()),n=li.getState();try{await Gv(t,r??void 0),n.removeSession(t),e(i=>{const o={...i.terminalMetas};return delete o[t],{terminalMetas:o}},!1,"closeSession")}catch(i){throw i}},lockSession:(t,r,n)=>{e(i=>{const o=i.terminalMetas[t];return o?{terminalMetas:{...i.terminalMetas,[t]:{...o,status:"locked",isLocked:!0,lockReason:r,lockedByExecutionId:n,lockedAt:new Date().toISOString()}}}:i},!1,"lockSession")},unlockSession:t=>{e(r=>{const n=r.terminalMetas[t];return n?{terminalMetas:{...r.terminalMetas,[t]:{...n,status:"active",isLocked:!1,lockReason:void 0,lockedByExecutionId:void 0,lockedAt:void 0}}}:r},!1,"unlockSession")}}),{name:"SessionManagerStore"})),oUe=e=>e.activeTerminalId,sUe=e=>e.terminalMetas,KM={selectedIssueId:null,associationChain:null},Tk=gn()(En(e=>({...KM,setSelectedIssue:t=>{if(t===null){e({selectedIssueId:null,associationChain:null},!1,"setSelectedIssue/clear");return}const r=XM(t);e({selectedIssueId:t,associationChain:r},!1,"setSelectedIssue")},buildAssociationChain:(t,r)=>{let n;switch(r){case"issue":n=XM(t);break;case"queue":n=uce(t);break;case"session":n=dce(t);break;default:n={issueId:null,queueItemId:null,sessionId:null}}e({associationChain:n,selectedIssueId:n.issueId},!1,"buildAssociationChain")},resetState:()=>{e({...KM},!1,"resetState")},_updateQueueItemStatus:(t,r,n)=>{const i=Ud.getState(),s=Object.values(i.executions).find(a=>a.queueItemId===t);s&&["pending","running","completed","failed"].includes(r)&&i.updateStatus(s.id,r),n&&e(a=>a.associationChain&&a.associationChain.queueItemId===t?{associationChain:{...a.associationChain,sessionId:n}}:a,!1,"_updateQueueItemStatus")}}),{name:"IssueQueueIntegrationStore"}));function XM(e){const r=Object.values(Ud.getState().executions).find(n=>n.issueId===e);return r?{issueId:e,queueItemId:r.queueItemId,sessionId:r.sessionKey??null}:{issueId:e,queueItemId:null,sessionId:null}}function uce(e){const r=Object.values(Ud.getState().executions).find(n=>n.queueItemId===e);return r?{issueId:r.issueId,queueItemId:e,sessionId:r.sessionKey??null}:{issueId:null,queueItemId:e,sessionId:null}}function dce(e){const r=Object.values(Ud.getState().executions).find(n=>n.sessionKey===e);return r?{issueId:r.issueId,queueItemId:r.queueItemId,sessionId:e}:{issueId:null,queueItemId:null,sessionId:e}}const aUe=e=>e.selectedIssueId,fce=e=>e.associationChain;function Qh(e){return typeof e=="string"}function hce(e,t){const r=(n,i)=>{for(let o=0;o<n.children.length;o++){const s=n.children[o];if(Qh(s)){if(s===t)return{found:!0,parent:n,index:o}}else{const a=r(s);if(a.found)return a}}return{found:!1,parent:null,index:-1}};return r(e)}function pce(e,t){const r=i=>{const o=[];for(const l of i.children)if(Qh(l))l!==t&&o.push(l);else{const c=r(l);c&&c.children.length>0&&(c.children.length===1?o.push(c.children[0]):o.push(c))}if(o.length===0)return null;const s=i.sizes?i.sizes.filter((l,c)=>{const d=i.children[c];return!Qh(d)||d!==t}):void 0,a=s?(()=>{const l=s.reduce((c,d)=>c+d,0);return l>0?s.map(c=>c/l*100):void 0})():void 0;return{direction:i.direction,sizes:a,children:o}};return r(e)||{direction:"horizontal",children:[]}}function ZM(e,t,r,n="horizontal"){if(!r){if(e.children.length===0)return{...e,children:[t],sizes:[100]};if(e.direction===n){const o=e.sizes||e.children.map(()=>100/e.children.length),s=o.reduce((c,d)=>c+d,0),a=s/(e.children.length+1),l=(s-a)/s;return{...e,children:[...e.children,t],sizes:[...o.map(c=>c*l),a]}}return{direction:n,sizes:[50,50],children:[e,t]}}const i=o=>{const s=[];let a=o.sizes?[]:void 0;for(let l=0;l<o.children.length;l++){const c=o.children[l],d=o.sizes?o.sizes[l]:void 0;if(Qh(c))if(c===r)if(o.direction===n){const u=(d||50)/2;s.push(c,t),a&&a.push(u,u)}else{const u={direction:n,sizes:[50,50],children:[c,t]};s.push(u),a&&d!==void 0&&a.push(d)}else s.push(c),a&&d!==void 0&&a.push(d);else hce(c,r).found?s.push(i(c)):s.push(c),a&&d!==void 0&&a.push(d)}return{...o,children:s,sizes:a}};return i(e)}function QM(e){const t=[],r=n=>{for(const i of n.children)Qh(i)?t.push(i):r(i)};return r(e),t}const mce="terminal-grid-storage",gce=2;function vce(e){return{id:e.id,sessionId:e.sessionId,cliTool:e.cliTool??null,displayMode:e.displayMode??"terminal",filePath:e.filePath??null}}function yce(e,t){if(t<2){const r=e,n={};for(const[i,o]of Object.entries(r.panes))n[i]=vce(o);return{layout:r.layout,panes:n,focusedPaneId:r.focusedPaneId,nextPaneIdCounter:r.nextPaneIdCounter}}return e}const Pv=e=>`tpane-${e}`;function bce(){const e=Pv(1);return{layout:{direction:"horizontal",sizes:[100],children:[e]},panes:{[e]:{id:e,sessionId:null,cliTool:null,displayMode:"terminal",filePath:null}},focusedPaneId:e,nextPaneIdCounter:2}}const Wg=bce(),YM={layout:Wg.layout,panes:Wg.panes,focusedPaneId:Wg.focusedPaneId,nextPaneIdCounter:Wg.nextPaneIdCounter},_ce=gn()(im(En((e,t)=>({...YM,setLayout:r=>{e({layout:r},!1,"terminalGrid/setLayout")},updateLayoutSizes:r=>{const n=t().layout;JSON.stringify(n.sizes)!==JSON.stringify(r)&&e({layout:{...n,sizes:r}},!1,"terminalGrid/updateLayoutSizes")},splitPane:(r,n)=>{const i=t(),o=Pv(i.nextPaneIdCounter),s=ZM(i.layout,o,r,n);return e({layout:s,panes:{...i.panes,[o]:{id:o,sessionId:null,cliTool:null,displayMode:"terminal",filePath:null}},focusedPaneId:o,nextPaneIdCounter:i.nextPaneIdCounter+1},!1,"terminalGrid/splitPane"),o},closePane:r=>{const n=t();if(QM(n.layout).length<=1)return;const o=pce(n.layout,r),s={...n.panes};delete s[r];let a=n.focusedPaneId;if(a===r){const l=QM(o);a=l.length>0?l[0]:null}e({layout:o,panes:s,focusedPaneId:a},!1,"terminalGrid/closePane")},assignSession:(r,n,i)=>{const o=t(),s=o.panes[r];s&&e({panes:{...o.panes,[r]:{...s,sessionId:n,cliTool:i!==void 0?i??null:n?s.cliTool:null}}},!1,"terminalGrid/assignSession")},setFocused:r=>{t().panes[r]&&e({focusedPaneId:r},!1,"terminalGrid/setFocused")},resetLayout:r=>{let n=t().nextPaneIdCounter;const i=()=>({id:Pv(n++),sessionId:null,cliTool:null,displayMode:"terminal",filePath:null});let o;const s={};switch(r){case"single":{const l=i();s[l.id]=l,o={direction:"horizontal",sizes:[100],children:[l.id]};break}case"split-h":{const l=i(),c=i();s[l.id]=l,s[c.id]=c,o={direction:"horizontal",sizes:[50,50],children:[l.id,c.id]};break}case"split-v":{const l=i(),c=i();s[l.id]=l,s[c.id]=c,o={direction:"vertical",sizes:[50,50],children:[l.id,c.id]};break}case"grid-2x2":{const l=i(),c=i(),d=i(),u=i();s[l.id]=l,s[c.id]=c,s[d.id]=d,s[u.id]=u,o={direction:"vertical",sizes:[50,50],children:[{direction:"horizontal",sizes:[50,50],children:[l.id,c.id]},{direction:"horizontal",sizes:[50,50],children:[d.id,u.id]}]};break}default:return}const a=Object.keys(s)[0]||null;e({layout:o,panes:s,focusedPaneId:a,nextPaneIdCounter:n},!1,"terminalGrid/resetLayout")},resetWorkspaceState:()=>{const r=t(),n=Object.keys(r.panes);if(n.length===0){e({...YM},!1,"terminalGrid/resetWorkspaceState");return}const i=n.reduce((s,a)=>{const l=r.panes[a];return s[a]={...l,sessionId:null,cliTool:null,displayMode:"terminal",filePath:null},s},{}),o=r.focusedPaneId&&i[r.focusedPaneId]?r.focusedPaneId:n[0]??null;e({layout:r.layout,panes:i,focusedPaneId:o,nextPaneIdCounter:r.nextPaneIdCounter},!1,"terminalGrid/resetWorkspaceState")},createSessionAndAssign:async(r,n,i)=>{try{const s=(await C0(n,i??void 0)).session,a=t(),l=a.panes[r];if(!(l!=null&&l.sessionId))return e({panes:{...a.panes,[r]:{...l,sessionId:s.sessionKey,cliTool:s.tool??n.tool??null}},focusedPaneId:r},!1,"terminalGrid/createSessionAndAssign"),{paneId:r,session:s};const d=Pv(a.nextPaneIdCounter),u=ZM(a.layout,d,r,"horizontal");return e({layout:u,panes:{...a.panes,[d]:{id:d,sessionId:s.sessionKey,cliTool:s.tool??n.tool??null,displayMode:"terminal",filePath:null}},focusedPaneId:d,nextPaneIdCounter:a.nextPaneIdCounter+1},!1,"terminalGrid/createSessionAndAssign"),{paneId:d,session:s}}catch(o){const s=o instanceof Error||o!=null&&o.message?o.message:String(o);throw console.error("Failed to create CLI session:",s,{config:n,projectPath:i,rawError:o}),new Error(s)}},setPaneDisplayMode:(r,n)=>{const i=t(),o=i.panes[r];o&&e({panes:{...i.panes,[r]:{...o,displayMode:n,filePath:n==="terminal"?null:o.filePath}}},!1,"terminalGrid/setPaneDisplayMode")},setPaneFilePath:(r,n)=>{const i=t(),o=i.panes[r];o&&e({panes:{...i.panes,[r]:{...o,filePath:n}}},!1,"terminalGrid/setPaneFilePath")},showFileInPane:(r,n)=>{const i=t(),o=i.panes[r];o&&e({panes:{...i.panes,[r]:{...o,displayMode:"file",filePath:n}},focusedPaneId:r},!1,"terminalGrid/showFileInPane")}}),{name:"TerminalGridStore"}),{name:mce,version:gce,migrate:yce,partialize:e=>({layout:e.layout,panes:e.panes,focusedPaneId:e.focusedPaneId,nextPaneIdCounter:e.nextPaneIdCounter})})),lUe=e=>e.layout,cUe=e=>e.panes,uUe=e=>e.focusedPaneId,Yx={title:"",description:"",type:"other",priority:"medium",tags:[],project_id:void 0},xce=[{id:"title",field:"title",title:"Issue 标题",description:"请输入一个简洁明确的标题"},{id:"description",field:"description",title:"Issue 描述",description:"请详细描述问题或需求"},{id:"type",field:"type",title:"Issue 类型",description:"选择 Issue 的类型"},{id:"priority",field:"priority",title:"优先级",description:"设置 Issue 的处理优先级",isOptional:!0},{id:"summary",field:"summary",title:"确认提交",description:"请确认以下信息后提交"}];gn()(En((e,t)=>({isOpen:!1,mode:"wizard",currentStep:0,steps:xce,formData:{...Yx},validationErrors:{},isSubmitting:!1,submitError:null,submittedIssueId:null,openDialog:(r="wizard")=>{e({isOpen:!0,mode:r,currentStep:0,formData:{...Yx},validationErrors:{},submitError:null,submittedIssueId:null})},closeDialog:()=>{e({isOpen:!1,isSubmitting:!1})},goToStep:r=>{const{steps:n,validateCurrentStep:i}=t();if(r>=0&&r<n.length){if(r>t().currentStep&&!i())return;e({currentStep:r})}},nextStep:()=>{const{currentStep:r,steps:n,validateCurrentStep:i}=t();r<n.length-1&&i()&&e({currentStep:r+1})},prevStep:()=>{const{currentStep:r}=t();r>0&&e({currentStep:r-1})},updateField:(r,n)=>{e(i=>({formData:{...i.formData,[r]:n},validationErrors:{...i.validationErrors,[r]:void 0}}))},setFormData:r=>{e(n=>({formData:{...n.formData,...r}}))},resetForm:()=>{e({formData:{...Yx},validationErrors:{},currentStep:0,submitError:null,submittedIssueId:null})},validateCurrentStep:()=>{var a;const{currentStep:r,steps:n,formData:i}=t(),o=(a=n[r])==null?void 0:a.field;if(o==="summary")return!0;const s={};return o==="title"&&(i.title.trim()?i.title.length>200&&(s.title="标题不能超过200个字符"):s.title="标题不能为空"),o==="description"&&(i.description.trim()?i.description.length>1e4&&(s.description="描述不能超过10000个字符"):s.description="描述不能为空"),e({validationErrors:s}),Object.keys(s).length===0},submitIssue:async()=>{var n,i;const{formData:r}=t();e({isSubmitting:!0,submitError:null});try{const o=await fetch("/api/issues",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:`ISSUE-${Date.now()}`,title:r.title,context:r.description,priority:r.priority==="urgent"?1:r.priority==="high"?2:r.priority==="medium"?3:4,tags:r.tags,status:"registered"})}),s=await o.json();return!o.ok||s.error?(e({isSubmitting:!1,submitError:s.error||"提交失败,请稍后重试"}),{success:!1,error:s.error}):(e({isSubmitting:!1,submittedIssueId:(n=s.issue)==null?void 0:n.id}),{success:!0,issueId:(i=s.issue)==null?void 0:i.id})}catch(o){const s=o instanceof Error?o.message:"网络错误,请稍后重试";return e({isSubmitting:!1,submitError:s}),{success:!1,error:s}}}}),{name:"issue-dialog-store"}));const JM={activeExecutions:{},currentExecutionId:null,isPanelOpen:!1},dA=gn()(En(e=>({...JM,handleExecutionMessage:t=>{const{type:r,payload:n}=t,{executionId:i,flowId:o,sessionKey:s,stepId:a,stepName:l,totalSteps:c,output:d,error:u,timestamp:p}=n;e(g=>{const _=g.activeExecutions[i];switch(r){case"EXECUTION_STARTED":return{activeExecutions:{...g.activeExecutions,[i]:{executionId:i,flowId:o,flowName:l||"Workflow",sessionKey:s??"",status:"running",totalSteps:c||0,completedSteps:0,steps:[],startedAt:p}},currentExecutionId:i,isPanelOpen:!0};case"EXECUTION_STEP_START":return _?{activeExecutions:{...g.activeExecutions,[i]:{..._,status:"running",currentStepId:a,steps:[..._.steps.filter(y=>y.id!==a),{id:a||"",name:l||"",status:"running",startedAt:p}]}}}:g;case"EXECUTION_STEP_PROGRESS":return!_||!a?g:{activeExecutions:{...g.activeExecutions,[i]:{..._,steps:_.steps.map(y=>y.id===a?{...y,output:(y.output||"")+(d||"")}:y)}}};case"EXECUTION_STEP_COMPLETE":return _?{activeExecutions:{...g.activeExecutions,[i]:{..._,completedSteps:_.completedSteps+1,steps:_.steps.map(y=>y.id===a?{...y,status:"completed",completedAt:p}:y)}}}:g;case"EXECUTION_STEP_FAILED":return _?{activeExecutions:{...g.activeExecutions,[i]:{..._,status:"paused",steps:_.steps.map(y=>y.id===a?{...y,status:"failed",error:u,completedAt:p}:y)}}}:g;case"EXECUTION_PAUSED":return _?{activeExecutions:{...g.activeExecutions,[i]:{..._,status:"paused"}}}:g;case"EXECUTION_RESUMED":return _?{activeExecutions:{...g.activeExecutions,[i]:{..._,status:"running"}}}:g;case"EXECUTION_STOPPED":return _?{activeExecutions:{...g.activeExecutions,[i]:{..._,status:"cancelled",completedAt:p}}}:g;case"EXECUTION_COMPLETED":return _?{activeExecutions:{...g.activeExecutions,[i]:{..._,status:"completed",completedAt:p}}}:g;case"EXECUTION_FAILED":return _?{activeExecutions:{...g.activeExecutions,[i]:{..._,status:"failed",completedAt:p}}}:g;default:return g}},!1,`handleExecutionMessage/${r}`)},selectExecution:t=>{e({currentExecutionId:t},!1,"selectExecution")},pauseExecution:async t=>{try{const n=await(await fetch(`/api/orchestrator/executions/${t}/pause`,{method:"POST",headers:{"Content-Type":"application/json"}})).json();n.success||console.error("[ExecutionMonitor] Pause failed:",n.error)}catch(r){console.error("[ExecutionMonitor] Pause error:",r)}},resumeExecution:async t=>{try{const n=await(await fetch(`/api/orchestrator/executions/${t}/resume`,{method:"POST",headers:{"Content-Type":"application/json"}})).json();n.success||console.error("[ExecutionMonitor] Resume failed:",n.error)}catch(r){console.error("[ExecutionMonitor] Resume error:",r)}},stopExecution:async t=>{try{const n=await(await fetch(`/api/orchestrator/executions/${t}/stop`,{method:"POST",headers:{"Content-Type":"application/json"}})).json();n.success||console.error("[ExecutionMonitor] Stop failed:",n.error)}catch(r){console.error("[ExecutionMonitor] Stop error:",r)}},setPanelOpen:t=>{e({isPanelOpen:t},!1,"setPanelOpen")},clearExecution:t=>{e(r=>{const n={...r.activeExecutions};return delete n[t],{activeExecutions:n,currentExecutionId:r.currentExecutionId===t?null:r.currentExecutionId}},!1,"clearExecution")},clearAllExecutions:()=>{e({activeExecutions:{},currentExecutionId:null},!1,"clearAllExecutions")},resetState:()=>{e({...JM},!1,"resetState")}}),{name:"ExecutionMonitorStore"})),dUe=e=>e.activeExecutions,fUe=e=>e.currentExecutionId?e.activeExecutions[e.currentExecutionId]:null,hUe=e=>Object.values(e.activeExecutions).filter(t=>t.status==="running"||t.status==="paused").length;function be(e,t,r){function n(a,l){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:l,constr:s,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,l);const c=s.prototype,d=Object.keys(c);for(let u=0;u<d.length;u++){const p=d[u];p in a||(a[p]=c[p].bind(a))}}const i=(r==null?void 0:r.Parent)??Object;class o extends i{}Object.defineProperty(o,"name",{value:e});function s(a){var l;const c=r!=null&&r.Parent?new o:this;n(c,a),(l=c._zod).deferred??(l.deferred=[]);for(const d of c._zod.deferred)d();return c}return Object.defineProperty(s,"init",{value:n}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>{var l,c;return r!=null&&r.Parent&&a instanceof r.Parent?!0:(c=(l=a==null?void 0:a._zod)==null?void 0:l.traits)==null?void 0:c.has(e)}}),Object.defineProperty(s,"name",{value:e}),s}class Du extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class iH extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const oH={};function Ja(e){return oH}function sH(e){const t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,i])=>t.indexOf(+n)===-1).map(([n,i])=>i)}function Pk(e,t){return typeof t=="bigint"?t.toString():t}function E0(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function fA(e){return e==null}function hA(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function wce(e,t){const r=(e.toString().split(".")[1]||"").length,n=t.toString();let i=(n.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(n)){const l=n.match(/\d?e-(\d?)/);l!=null&&l[1]&&(i=Number.parseInt(l[1]))}const o=r>i?r:i,s=Number.parseInt(e.toFixed(o).replace(".","")),a=Number.parseInt(t.toFixed(o).replace(".",""));return s%a/10**o}const ej=Symbol("evaluating");function Ht(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==ej)return n===void 0&&(n=ej,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function Pc(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Ac(...e){const t={};for(const r of e){const n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function tj(e){return JSON.stringify(e)}function Sce(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const aH="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Yh(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Cce=E0(()=>{var e;if(typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function id(e){if(Yh(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const r=t.prototype;return!(Yh(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function lH(e){return id(e)?{...e}:Array.isArray(e)?[...e]:e}const Ece=new Set(["string","number","symbol"]);function od(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ol(e,t,r){const n=new e._zod.constr(t??e._zod.def);return(!t||r!=null&&r.parent)&&(n._zod.parent=e),n}function Je(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function kce(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const Tce={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Pce(e,t){const r=e._zod.def,n=Ac(e._zod.def,{get shape(){const i={};for(const o in t){if(!(o in r.shape))throw new Error(`Unrecognized key: "${o}"`);t[o]&&(i[o]=r.shape[o])}return Pc(this,"shape",i),i},checks:[]});return ol(e,n)}function Ace(e,t){const r=e._zod.def,n=Ac(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const o in t){if(!(o in r.shape))throw new Error(`Unrecognized key: "${o}"`);t[o]&&delete i[o]}return Pc(this,"shape",i),i},checks:[]});return ol(e,n)}function Oce(e,t){if(!id(t))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const i=Ac(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return Pc(this,"shape",o),o},checks:[]});return ol(e,i)}function Ice(e,t){if(!id(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r={...e._zod.def,get shape(){const n={...e._zod.def.shape,...t};return Pc(this,"shape",n),n},checks:e._zod.def.checks};return ol(e,r)}function Rce(e,t){const r=Ac(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return Pc(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return ol(e,r)}function Nce(e,t,r){const n=Ac(t._zod.def,{get shape(){const i=t._zod.def.shape,o={...i};if(r)for(const s in r){if(!(s in i))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=e?new e({type:"optional",innerType:i[s]}):i[s])}else for(const s in i)o[s]=e?new e({type:"optional",innerType:i[s]}):i[s];return Pc(this,"shape",o),o},checks:[]});return ol(t,n)}function Mce(e,t,r){const n=Ac(t._zod.def,{get shape(){const i=t._zod.def.shape,o={...i};if(r)for(const s in r){if(!(s in o))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=new e({type:"nonoptional",innerType:i[s]}))}else for(const s in i)o[s]=new e({type:"nonoptional",innerType:i[s]});return Pc(this,"shape",o),o},checks:[]});return ol(t,n)}function ku(e,t=0){var r;if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(((r=e.issues[n])==null?void 0:r.continue)!==!0)return!0;return!1}function Tu(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function Vg(e){return typeof e=="string"?e:e==null?void 0:e.message}function el(e,t,r){var i,o,s,a,l,c;const n={...e,path:e.path??[]};if(!e.message){const d=Vg((s=(o=(i=e.inst)==null?void 0:i._zod.def)==null?void 0:o.error)==null?void 0:s.call(o,e))??Vg((a=t==null?void 0:t.error)==null?void 0:a.call(t,e))??Vg((l=r.customError)==null?void 0:l.call(r,e))??Vg((c=r.localeError)==null?void 0:c.call(r,e))??"Invalid input";n.message=d}return delete n.inst,delete n.continue,t!=null&&t.reportInput||delete n.input,n}function pA(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Jh(...e){const[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}const cH=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Pk,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},uH=be("$ZodError",cH),dH=be("$ZodError",cH,{Parent:Error});function jce(e,t=r=>r.message){const r={},n=[];for(const i of e.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(t(i))):n.push(t(i));return{formErrors:n,fieldErrors:r}}function Dce(e,t=r=>r.message){const r={_errors:[]},n=i=>{for(const o of i.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(s=>n({issues:s}));else if(o.code==="invalid_key")n({issues:o.issues});else if(o.code==="invalid_element")n({issues:o.issues});else if(o.path.length===0)r._errors.push(t(o));else{let s=r,a=0;for(;a<o.path.length;){const l=o.path[a];a===o.path.length-1?(s[l]=s[l]||{_errors:[]},s[l]._errors.push(t(o))):s[l]=s[l]||{_errors:[]},s=s[l],a++}}};return n(e),r}const mA=e=>(t,r,n,i)=>{const o=n?Object.assign(n,{async:!1}):{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new Du;if(s.issues.length){const a=new((i==null?void 0:i.Err)??e)(s.issues.map(l=>el(l,o,Ja())));throw aH(a,i==null?void 0:i.callee),a}return s.value},gA=e=>async(t,r,n,i)=>{const o=n?Object.assign(n,{async:!0}):{async:!0};let s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){const a=new((i==null?void 0:i.Err)??e)(s.issues.map(l=>el(l,o,Ja())));throw aH(a,i==null?void 0:i.callee),a}return s.value},k0=e=>(t,r,n)=>{const i=n?{...n,async:!1}:{async:!1},o=t._zod.run({value:r,issues:[]},i);if(o instanceof Promise)throw new Du;return o.issues.length?{success:!1,error:new(e??uH)(o.issues.map(s=>el(s,i,Ja())))}:{success:!0,data:o.value}},Lce=k0(dH),T0=e=>async(t,r,n)=>{const i=n?Object.assign(n,{async:!0}):{async:!0};let o=t._zod.run({value:r,issues:[]},i);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(s=>el(s,i,Ja())))}:{success:!0,data:o.value}},$ce=T0(dH),Bce=e=>(t,r,n)=>{const i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return mA(e)(t,r,i)},Fce=e=>(t,r,n)=>mA(e)(t,r,n),zce=e=>async(t,r,n)=>{const i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return gA(e)(t,r,i)},Uce=e=>async(t,r,n)=>gA(e)(t,r,n),Hce=e=>(t,r,n)=>{const i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return k0(e)(t,r,i)},qce=e=>(t,r,n)=>k0(e)(t,r,n),Wce=e=>async(t,r,n)=>{const i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return T0(e)(t,r,i)},Vce=e=>async(t,r,n)=>T0(e)(t,r,n),Gce=/^[cC][^\s-]{8,}$/,Kce=/^[0-9a-z]+$/,Xce=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Zce=/^[0-9a-vA-V]{20}$/,Qce=/^[A-Za-z0-9]{27}$/,Yce=/^[a-zA-Z0-9_-]{21}$/,Jce=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,eue=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,rj=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,tue=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,rue="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function nue(){return new RegExp(rue,"u")}const iue=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,oue=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,sue=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,aue=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,lue=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,fH=/^[A-Za-z0-9_-]*$/,cue=/^\+(?:[0-9]){6,14}[0-9]$/,hH="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",uue=new RegExp(`^${hH}$`);function pH(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function due(e){return new RegExp(`^${pH(e)}$`)}function fue(e){const t=pH({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${t}(?:${r.join("|")})`;return new RegExp(`^${hH}T(?:${n})$`)}const hue=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},pue=/^-?\d+$/,mue=/^-?\d+(?:\.\d+)?/,gue=/^(?:true|false)$/i,vue=/^[^A-Z]*$/,yue=/^[^a-z]*$/,di=be("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),mH={number:"number",bigint:"bigint",object:"date"},gH=be("$ZodCheckLessThan",(e,t)=>{di.init(e,t);const r=mH[typeof t.value];e._zod.onattach.push(n=>{const i=n._zod.bag,o=(t.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<o&&(t.inclusive?i.maximum=t.value:i.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:r,code:"too_big",maximum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),vH=be("$ZodCheckGreaterThan",(e,t)=>{di.init(e,t);const r=mH[typeof t.value];e._zod.onattach.push(n=>{const i=n._zod.bag,o=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>o&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),bue=be("$ZodCheckMultipleOf",(e,t)=>{di.init(e,t),e._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):wce(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),_ue=be("$ZodCheckNumberFormat",(e,t)=>{var s;di.init(e,t),t.format=t.format||"float64";const r=(s=t.format)==null?void 0:s.includes("int"),n=r?"int":"number",[i,o]=Tce[t.format];e._zod.onattach.push(a=>{const l=a._zod.bag;l.format=t.format,l.minimum=i,l.maximum=o,r&&(l.pattern=pue)}),e._zod.check=a=>{const l=a.value;if(r){if(!Number.isInteger(l)){a.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?a.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort}):a.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort});return}}l<i&&a.issues.push({origin:"number",input:l,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),l>o&&a.issues.push({origin:"number",input:l,code:"too_big",maximum:o,inst:e})}}),xue=be("$ZodCheckMaxLength",(e,t)=>{var r;di.init(e,t),(r=e._zod.def).when??(r.when=n=>{const i=n.value;return!fA(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{const i=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const i=n.value;if(i.length<=t.maximum)return;const s=pA(i);n.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),wue=be("$ZodCheckMinLength",(e,t)=>{var r;di.init(e,t),(r=e._zod.def).when??(r.when=n=>{const i=n.value;return!fA(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{const i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const i=n.value;if(i.length>=t.minimum)return;const s=pA(i);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Sue=be("$ZodCheckLengthEquals",(e,t)=>{var r;di.init(e,t),(r=e._zod.def).when??(r.when=n=>{const i=n.value;return!fA(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{const i=n._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=n=>{const i=n.value,o=i.length;if(o===t.length)return;const s=pA(i),a=o>t.length;n.issues.push({origin:s,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),P0=be("$ZodCheckStringFormat",(e,t)=>{var r,n;di.init(e,t),e._zod.onattach.push(i=>{const o=i._zod.bag;o.format=t.format,t.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),Cue=be("$ZodCheckRegex",(e,t)=>{P0.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Eue=be("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=vue),P0.init(e,t)}),kue=be("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=yue),P0.init(e,t)}),Tue=be("$ZodCheckIncludes",(e,t)=>{di.init(e,t);const r=od(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(i=>{const o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),Pue=be("$ZodCheckStartsWith",(e,t)=>{di.init(e,t);const r=new RegExp(`^${od(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Aue=be("$ZodCheckEndsWith",(e,t)=>{di.init(e,t);const r=new RegExp(`.*${od(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Oue=be("$ZodCheckOverwrite",(e,t)=>{di.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class Iue{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const n=t.split(`
|
|
523
523
|
`).filter(s=>s),i=Math.min(...n.map(s=>s.length-s.trimStart().length)),o=n.map(s=>s.slice(i)).map(s=>" ".repeat(this.indent*2)+s);for(const s of o)this.content.push(s)}compile(){const t=Function,r=this==null?void 0:this.args,i=[...((this==null?void 0:this.content)??[""]).map(o=>` ${o}`)];return new t(...r,i.join(`
|
|
524
524
|
`))}}const Rue={major:4,minor:2,patch:1},Er=be("$ZodType",(e,t)=>{var i;var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Rue;const n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(const o of n)for(const s of o._zod.onattach)s(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),(i=e._zod.deferred)==null||i.push(()=>{e._zod.run=e._zod.parse});else{const o=(a,l,c)=>{let d=ku(a),u;for(const p of l){if(p._zod.def.when){if(!p._zod.def.when(a))continue}else if(d)continue;const g=a.issues.length,_=p._zod.check(a);if(_ instanceof Promise&&(c==null?void 0:c.async)===!1)throw new Du;if(u||_ instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await _,a.issues.length!==g&&(d||(d=ku(a,g)))});else{if(a.issues.length===g)continue;d||(d=ku(a,g))}}return u?u.then(()=>a):a},s=(a,l,c)=>{if(ku(a))return a.aborted=!0,a;const d=o(l,n,c);if(d instanceof Promise){if(c.async===!1)throw new Du;return d.then(u=>e._zod.parse(u,c))}return e._zod.parse(d,c)};e._zod.run=(a,l)=>{if(l.skipChecks)return e._zod.parse(a,l);if(l.direction==="backward"){const d=e._zod.parse({value:a.value,issues:[]},{...l,skipChecks:!0});return d instanceof Promise?d.then(u=>s(u,a,l)):s(d,a,l)}const c=e._zod.parse(a,l);if(c instanceof Promise){if(l.async===!1)throw new Du;return c.then(d=>o(d,n,l))}return o(c,n,l)}}e["~standard"]={validate:o=>{var s;try{const a=Lce(e,o);return a.success?{value:a.data}:{issues:(s=a.error)==null?void 0:s.issues}}catch{return $ce(e,o).then(l=>{var c;return l.success?{value:l.data}:{issues:(c=l.error)==null?void 0:c.issues}})}},vendor:"zod",version:1}}),vA=be("$ZodString",(e,t)=>{var r;Er.init(e,t),e._zod.pattern=[...((r=e==null?void 0:e._zod.bag)==null?void 0:r.patterns)??[]].pop()??hue(e._zod.bag),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),kr=be("$ZodStringFormat",(e,t)=>{P0.init(e,t),vA.init(e,t)}),Nue=be("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=eue),kr.init(e,t)}),Mue=be("$ZodUUID",(e,t)=>{if(t.version){const n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=rj(n))}else t.pattern??(t.pattern=rj());kr.init(e,t)}),jue=be("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=tue),kr.init(e,t)}),Due=be("$ZodURL",(e,t)=>{kr.init(e,t),e._zod.check=r=>{try{const n=r.value.trim(),i=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=i.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Lue=be("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=nue()),kr.init(e,t)}),$ue=be("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Yce),kr.init(e,t)}),Bue=be("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Gce),kr.init(e,t)}),Fue=be("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Kce),kr.init(e,t)}),zue=be("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Xce),kr.init(e,t)}),Uue=be("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Zce),kr.init(e,t)}),Hue=be("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Qce),kr.init(e,t)}),que=be("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=fue(t)),kr.init(e,t)}),Wue=be("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=uue),kr.init(e,t)}),Vue=be("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=due(t)),kr.init(e,t)}),Gue=be("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Jce),kr.init(e,t)}),Kue=be("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=iue),kr.init(e,t),e._zod.bag.format="ipv4"}),Xue=be("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=oue),kr.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),Zue=be("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=sue),kr.init(e,t)}),Que=be("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=aue),kr.init(e,t),e._zod.check=r=>{const n=r.value.split("/");try{if(n.length!==2)throw new Error;const[i,o]=n;if(!o)throw new Error;const s=Number(o);if(`${s}`!==o)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${i}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function yH(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Yue=be("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=lue),kr.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{yH(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function Jue(e){if(!fH.test(e))return!1;const t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return yH(r)}const ede=be("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=fH),kr.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{Jue(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),tde=be("$ZodE164",(e,t)=>{t.pattern??(t.pattern=cue),kr.init(e,t)});function rde(e,t=null){try{const r=e.split(".");if(r.length!==3)return!1;const[n]=r;if(!n)return!1;const i=JSON.parse(atob(n));return!("typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}}const nde=be("$ZodJWT",(e,t)=>{kr.init(e,t),e._zod.check=r=>{rde(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),bH=be("$ZodNumber",(e,t)=>{Er.init(e,t),e._zod.pattern=e._zod.bag.pattern??mue,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}const i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;const o=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...o?{received:o}:{}}),r}}),ide=be("$ZodNumberFormat",(e,t)=>{_ue.init(e,t),bH.init(e,t)}),ode=be("$ZodBoolean",(e,t)=>{Er.init(e,t),e._zod.pattern=gue,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}const i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),r}}),sde=be("$ZodUnknown",(e,t)=>{Er.init(e,t),e._zod.parse=r=>r}),ade=be("$ZodNever",(e,t)=>{Er.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function nj(e,t,r){e.issues.length&&t.issues.push(...Tu(r,e.issues)),t.value[r]=e.value}const lde=be("$ZodArray",(e,t)=>{Er.init(e,t),e._zod.parse=(r,n)=>{const i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);const o=[];for(let s=0;s<i.length;s++){const a=i[s],l=t.element._zod.run({value:a,issues:[]},n);l instanceof Promise?o.push(l.then(c=>nj(c,r,s))):nj(l,r,s)}return o.length?Promise.all(o).then(()=>r):r}});function Kv(e,t,r,n){e.issues.length&&t.issues.push(...Tu(r,e.issues)),e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}function _H(e){var n,i,o,s;const t=Object.keys(e.shape);for(const a of t)if(!((s=(o=(i=(n=e.shape)==null?void 0:n[a])==null?void 0:i._zod)==null?void 0:o.traits)!=null&&s.has("$ZodType")))throw new Error(`Invalid element at key "${a}": expected a Zod schema`);const r=kce(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function xH(e,t,r,n,i,o){const s=[],a=i.keySet,l=i.catchall._zod,c=l.def.type;for(const d in t){if(a.has(d))continue;if(c==="never"){s.push(d);continue}const u=l.run({value:t[d],issues:[]},n);u instanceof Promise?e.push(u.then(p=>Kv(p,r,d,t))):Kv(u,r,d,t)}return s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:o}),e.length?Promise.all(e).then(()=>r):r}const cde=be("$ZodObject",(e,t)=>{Er.init(e,t);const r=Object.getOwnPropertyDescriptor(t,"shape");if(!(r!=null&&r.get)){const a=t.shape;Object.defineProperty(t,"shape",{get:()=>{const l={...a};return Object.defineProperty(t,"shape",{value:l}),l}})}const n=E0(()=>_H(t));Ht(e._zod,"propValues",()=>{const a=t.shape,l={};for(const c in a){const d=a[c]._zod;if(d.values){l[c]??(l[c]=new Set);for(const u of d.values)l[c].add(u)}}return l});const i=Yh,o=t.catchall;let s;e._zod.parse=(a,l)=>{s??(s=n.value);const c=a.value;if(!i(c))return a.issues.push({expected:"object",code:"invalid_type",input:c,inst:e}),a;a.value={};const d=[],u=s.shape;for(const p of s.keys){const _=u[p]._zod.run({value:c[p],issues:[]},l);_ instanceof Promise?d.push(_.then(y=>Kv(y,a,p,c))):Kv(_,a,p,c)}return o?xH(d,c,a,l,n.value,e):d.length?Promise.all(d).then(()=>a):a}}),ude=be("$ZodObjectJIT",(e,t)=>{cde.init(e,t);const r=e._zod.parse,n=E0(()=>_H(t)),i=p=>{const g=new Iue(["shape","payload","ctx"]),_=n.value,y=x=>{const E=tj(x);return`shape[${E}]._zod.run({ value: input[${E}], issues: [] }, ctx)`};g.write("const input = payload.value;");const m=Object.create(null);let v=0;for(const x of _.keys)m[x]=`key_${v++}`;g.write("const newResult = {};");for(const x of _.keys){const E=m[x],C=tj(x);g.write(`const ${E} = ${y(x)};`),g.write(`
|
|
525
525
|
if (${E}.issues.length) {
|
|
@@ -704,5 +704,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
704
704
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function KBe(e,t){if(e){if(typeof e=="string")return vP(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return vP(e,t)}}function XBe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ZBe(e){if(Array.isArray(e))return vP(e)}function vP(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function QBe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function HF(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,EX(n.key),n)}}function YBe(e,t,r){return t&&HF(e.prototype,t),r&&HF(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function JBe(e,t,r){return t=d0(t),eFe(e,CX()?Reflect.construct(t,r||[],d0(e).constructor):t.apply(e,r))}function eFe(e,t){if(t&&(Rd(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return tFe(e)}function tFe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function CX(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(CX=function(){return!!e})()}function d0(e){return d0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},d0(e)}function rFe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&yP(e,t)}function yP(e,t){return yP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},yP(e,t)}function Ao(e,t,r){return t=EX(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function EX(e){var t=nFe(e,"string");return Rd(t)=="symbol"?t:t+""}function nFe(e,t){if(Rd(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Rd(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var km=(function(e){function t(){var r;QBe(this,t);for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return r=JBe(this,t,[].concat(i)),Ao(r,"state",{isAnimationFinished:!0,totalLength:0}),Ao(r,"generateSimpleStrokeDasharray",function(s,a){return"".concat(a,"px ").concat(s-a,"px")}),Ao(r,"getStrokeDasharray",function(s,a,l){var c=l.reduce(function(v,b){return v+b});if(!c)return r.generateSimpleStrokeDasharray(a,s);for(var d=Math.floor(s/c),u=s%c,p=a-s,g=[],_=0,y=0;_<l.length;y+=l[_],++_)if(y+l[_]>u){g=[].concat(bu(l.slice(0,_)),[u-y]);break}var m=g.length%2===0?[0,p]:[p];return[].concat(bu(t.repeat(l,d)),bu(g),m).map(function(v){return"".concat(v,"px")}).join(", ")}),Ao(r,"id",uf("recharts-line-")),Ao(r,"pathRef",function(s){r.mainCurve=s}),Ao(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),Ao(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return rFe(t,e),YBe(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();this.setState({totalLength:n})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();n!==this.state.totalLength&&this.setState({totalLength:n})}}},{key:"getTotalLength",value:function(){var n=this.mainCurve;try{return n&&n.getTotalLength&&n.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(n,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var o=this.props,s=o.points,a=o.xAxis,l=o.yAxis,c=o.layout,d=o.children,u=ji(d,Cm);if(!u)return null;var p=function(y,m){return{x:y.x,y:y.y,value:y.value,errorVal:sn(y.payload,m)}},g={clipPath:n?"url(#clipPath-".concat(i,")"):null};return Z.createElement(qt,g,u.map(function(_){return Z.cloneElement(_,{key:"bar-".concat(_.props.dataKey),data:s,xAxis:a,yAxis:l,layout:c,dataPointFormatter:p})}))}},{key:"renderDots",value:function(n,i,o){var s=this.props.isAnimationActive;if(s&&!this.state.isAnimationFinished)return null;var a=this.props,l=a.dot,c=a.points,d=a.dataKey,u=st(this.props,!1),p=st(l,!0),g=c.map(function(y,m){var v=Si(Si(Si({key:"dot-".concat(m),r:3},u),p),{},{index:m,cx:y.x,cy:y.y,value:y.value,dataKey:d,payload:y.payload,points:c});return t.renderDotItem(l,v)}),_={clipPath:n?"url(#clipPath-".concat(i?"":"dots-").concat(o,")"):null};return Z.createElement(qt,zh({className:"recharts-line-dots",key:"dots"},_),g)}},{key:"renderCurveStatically",value:function(n,i,o,s){var a=this.props,l=a.type,c=a.layout,d=a.connectNulls;a.ref;var u=zF(a,qBe),p=Si(Si(Si({},st(u,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(o,")"):null,points:n},s),{},{type:l,layout:c,connectNulls:d});return Z.createElement(qy,zh({},p,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(n,i){var o=this,s=this.props,a=s.points,l=s.strokeDasharray,c=s.isAnimationActive,d=s.animationBegin,u=s.animationDuration,p=s.animationEasing,g=s.animationId,_=s.animateNewValues,y=s.width,m=s.height,v=this.state,b=v.prevPoints,x=v.totalLength;return Z.createElement(ls,{begin:d,duration:u,isActive:c,easing:p,from:{t:0},to:{t:1},key:"line-".concat(g),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(E){var C=E.t;if(b){var k=b.length/a.length,P=a.map(function(M,F){var U=Math.floor(F*k);if(b[U]){var q=b[U],V=Ai(q.x,M.x),K=Ai(q.y,M.y);return Si(Si({},M),{},{x:V(C),y:K(C)})}if(_){var D=Ai(y*2,M.x),$=Ai(m/2,M.y);return Si(Si({},M),{},{x:D(C),y:$(C)})}return Si(Si({},M),{},{x:M.x,y:M.y})});return o.renderCurveStatically(P,n,i)}var T=Ai(0,x),I=T(C),N;if(l){var B="".concat(l).split(/[,\s]+/gim).map(function(M){return parseFloat(M)});N=o.getStrokeDasharray(I,x,B)}else N=o.generateSimpleStrokeDasharray(x,I);return o.renderCurveStatically(a,n,i,{strokeDasharray:N})})}},{key:"renderCurve",value:function(n,i){var o=this.props,s=o.points,a=o.isAnimationActive,l=this.state,c=l.prevPoints,d=l.totalLength;return a&&s&&s.length&&(!c&&d>0||!Sm(c,s))?this.renderCurveWithAnimation(n,i):this.renderCurveStatically(s,n,i)}},{key:"render",value:function(){var n,i=this.props,o=i.hide,s=i.dot,a=i.points,l=i.className,c=i.xAxis,d=i.yAxis,u=i.top,p=i.left,g=i.width,_=i.height,y=i.isAnimationActive,m=i.id;if(o||!a||!a.length)return null;var v=this.state.isAnimationFinished,b=a.length===1,x=gt("recharts-line",l),E=c&&c.allowDataOverflow,C=d&&d.allowDataOverflow,k=E||C,P=mt(m)?this.id:m,T=(n=st(s,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},I=T.r,N=I===void 0?3:I,B=T.strokeWidth,M=B===void 0?2:B,F=VPe(s)?s:{},U=F.clipDot,q=U===void 0?!0:U,V=N*2+M;return Z.createElement(qt,{className:x},E||C?Z.createElement("defs",null,Z.createElement("clipPath",{id:"clipPath-".concat(P)},Z.createElement("rect",{x:E?p:p-g/2,y:C?u:u-_/2,width:E?g:g*2,height:C?_:_*2})),!q&&Z.createElement("clipPath",{id:"clipPath-dots-".concat(P)},Z.createElement("rect",{x:p-V/2,y:u-V/2,width:g+V,height:_+V}))):null,!b&&this.renderCurve(k,P),this.renderErrorBar(k,P),(b||s)&&this.renderDots(k,q,P),(!y||v)&&qs.renderCallByParent(this.props,a))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,prevPoints:i.curPoints}:n.points!==i.curPoints?{curPoints:n.points}:null}},{key:"repeat",value:function(n,i){for(var o=n.length%2!==0?[].concat(bu(n),[0]):n,s=[],a=0;a<i;++a)s=[].concat(bu(s),bu(o));return s}},{key:"renderDotItem",value:function(n,i){var o;if(Z.isValidElement(n))o=Z.cloneElement(n,i);else if(pt(n))o=n(i);else{var s=i.key,a=zF(i,WBe),l=gt("recharts-line-dot",typeof n!="boolean"?n.className:"");o=Z.createElement(Rb,zh({key:s},a,{className:l}))}return o}}])})(O.PureComponent);Ao(km,"displayName","Line");Ao(km,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!jc.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});Ao(km,"getComposedData",function(e){var t=e.props,r=e.xAxis,n=e.yAxis,i=e.xAxisTicks,o=e.yAxisTicks,s=e.dataKey,a=e.bandSize,l=e.displayedData,c=e.offset,d=t.layout,u=l.map(function(p,g){var _=sn(p,s);return d==="horizontal"?{x:Z4({axis:r,ticks:i,bandSize:a,entry:p,index:g}),y:mt(_)?null:n.scale(_),value:_,payload:p}:{x:mt(_)?null:r.scale(_),y:Z4({axis:n,ticks:o,bandSize:a,entry:p,index:g}),value:_,payload:p}});return Si({points:u,layout:d},c)});function Nd(e){"@babel/helpers - typeof";return Nd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nd(e)}function iFe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function oFe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,PX(n.key),n)}}function sFe(e,t,r){return t&&oFe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function aFe(e,t,r){return t=f0(t),lFe(e,kX()?Reflect.construct(t,r||[],f0(e).constructor):t.apply(e,r))}function lFe(e,t){if(t&&(Nd(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return cFe(e)}function cFe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function kX(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(kX=function(){return!!e})()}function f0(e){return f0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},f0(e)}function uFe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&bP(e,t)}function bP(e,t){return bP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},bP(e,t)}function TX(e,t,r){return t=PX(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function PX(e){var t=dFe(e,"string");return Nd(t)=="symbol"?t:t+""}function dFe(e,t){if(Nd(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Nd(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function _P(){return _P=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_P.apply(this,arguments)}function fFe(e){var t=e.xAxisId,r=hX(),n=pX(),i=dX(t);return i==null?null:O.createElement(qb,_P({},i,{className:gt("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:r,height:n},ticksGenerator:function(s){return Gl(s,!0)}}))}var I2=(function(e){function t(){return iFe(this,t),aFe(this,t,arguments)}return uFe(t,e),sFe(t,[{key:"render",value:function(){return O.createElement(fFe,this.props)}}])})(O.Component);TX(I2,"displayName","XAxis");TX(I2,"defaultProps",{allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0});function Md(e){"@babel/helpers - typeof";return Md=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Md(e)}function hFe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pFe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,IX(n.key),n)}}function mFe(e,t,r){return t&&pFe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function gFe(e,t,r){return t=h0(t),vFe(e,AX()?Reflect.construct(t,r||[],h0(e).constructor):t.apply(e,r))}function vFe(e,t){if(t&&(Md(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return yFe(e)}function yFe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function AX(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(AX=function(){return!!e})()}function h0(e){return h0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},h0(e)}function bFe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&xP(e,t)}function xP(e,t){return xP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},xP(e,t)}function OX(e,t,r){return t=IX(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function IX(e){var t=_Fe(e,"string");return Md(t)=="symbol"?t:t+""}function _Fe(e,t){if(Md(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Md(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function wP(){return wP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},wP.apply(this,arguments)}var xFe=function(t){var r=t.yAxisId,n=hX(),i=pX(),o=fX(r);return o==null?null:O.createElement(qb,wP({},o,{className:gt("recharts-".concat(o.axisType," ").concat(o.axisType),o.className),viewBox:{x:0,y:0,width:n,height:i},ticksGenerator:function(a){return Gl(a,!0)}}))},R2=(function(e){function t(){return hFe(this,t),gFe(this,t,arguments)}return bFe(t,e),mFe(t,[{key:"render",value:function(){return O.createElement(xFe,this.props)}}])})(O.Component);OX(R2,"displayName","YAxis");OX(R2,"defaultProps",{allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1});function qF(e){return EFe(e)||CFe(e)||SFe(e)||wFe()}function wFe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
705
705
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function SFe(e,t){if(e){if(typeof e=="string")return SP(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return SP(e,t)}}function CFe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function EFe(e){if(Array.isArray(e))return SP(e)}function SP(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var CP=function(t,r,n,i,o){var s=ji(t,A2),a=ji(t,zb),l=[].concat(qF(s),qF(a)),c=ji(t,Hb),d="".concat(i,"Id"),u=i[0],p=r;if(l.length&&(p=l.reduce(function(y,m){if(m.props[d]===n&&ns(m.props,"extendDomain")&&Ne(m.props[u])){var v=m.props[u];return[Math.min(y[0],v),Math.max(y[1],v)]}return y},p)),c.length){var g="".concat(u,"1"),_="".concat(u,"2");p=c.reduce(function(y,m){if(m.props[d]===n&&ns(m.props,"extendDomain")&&Ne(m.props[g])&&Ne(m.props[_])){var v=m.props[g],b=m.props[_];return[Math.min(y[0],v,b),Math.max(y[1],v,b)]}return y},p)}return o&&o.length&&(p=o.reduce(function(y,m){return Ne(m)?[Math.min(y[0],m),Math.max(y[1],m)]:y},p)),p},RE={exports:{}},WF;function kFe(){return WF||(WF=1,(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(l,c,d){this.fn=l,this.context=c,this.once=d||!1}function o(l,c,d,u,p){if(typeof d!="function")throw new TypeError("The listener must be a function");var g=new i(d,u||l,p),_=r?r+c:c;return l._events[_]?l._events[_].fn?l._events[_]=[l._events[_],g]:l._events[_].push(g):(l._events[_]=g,l._eventsCount++),l}function s(l,c){--l._eventsCount===0?l._events=new n:delete l._events[c]}function a(){this._events=new n,this._eventsCount=0}a.prototype.eventNames=function(){var c=[],d,u;if(this._eventsCount===0)return c;for(u in d=this._events)t.call(d,u)&&c.push(r?u.slice(1):u);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(d)):c},a.prototype.listeners=function(c){var d=r?r+c:c,u=this._events[d];if(!u)return[];if(u.fn)return[u.fn];for(var p=0,g=u.length,_=new Array(g);p<g;p++)_[p]=u[p].fn;return _},a.prototype.listenerCount=function(c){var d=r?r+c:c,u=this._events[d];return u?u.fn?1:u.length:0},a.prototype.emit=function(c,d,u,p,g,_){var y=r?r+c:c;if(!this._events[y])return!1;var m=this._events[y],v=arguments.length,b,x;if(m.fn){switch(m.once&&this.removeListener(c,m.fn,void 0,!0),v){case 1:return m.fn.call(m.context),!0;case 2:return m.fn.call(m.context,d),!0;case 3:return m.fn.call(m.context,d,u),!0;case 4:return m.fn.call(m.context,d,u,p),!0;case 5:return m.fn.call(m.context,d,u,p,g),!0;case 6:return m.fn.call(m.context,d,u,p,g,_),!0}for(x=1,b=new Array(v-1);x<v;x++)b[x-1]=arguments[x];m.fn.apply(m.context,b)}else{var E=m.length,C;for(x=0;x<E;x++)switch(m[x].once&&this.removeListener(c,m[x].fn,void 0,!0),v){case 1:m[x].fn.call(m[x].context);break;case 2:m[x].fn.call(m[x].context,d);break;case 3:m[x].fn.call(m[x].context,d,u);break;case 4:m[x].fn.call(m[x].context,d,u,p);break;default:if(!b)for(C=1,b=new Array(v-1);C<v;C++)b[C-1]=arguments[C];m[x].fn.apply(m[x].context,b)}}return!0},a.prototype.on=function(c,d,u){return o(this,c,d,u,!1)},a.prototype.once=function(c,d,u){return o(this,c,d,u,!0)},a.prototype.removeListener=function(c,d,u,p){var g=r?r+c:c;if(!this._events[g])return this;if(!d)return s(this,g),this;var _=this._events[g];if(_.fn)_.fn===d&&(!p||_.once)&&(!u||_.context===u)&&s(this,g);else{for(var y=0,m=[],v=_.length;y<v;y++)(_[y].fn!==d||p&&!_[y].once||u&&_[y].context!==u)&&m.push(_[y]);m.length?this._events[g]=m.length===1?m[0]:m:s(this,g)}return this},a.prototype.removeAllListeners=function(c){var d;return c?(d=r?r+c:c,this._events[d]&&s(this,d)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=r,a.EventEmitter=a,e.exports=a})(RE)),RE.exports}var TFe=kFe();const PFe=Kt(TFe);var NE=new PFe,ME="recharts.syncMouseEvents";function Up(e){"@babel/helpers - typeof";return Up=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Up(e)}function AFe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function OFe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,RX(n.key),n)}}function IFe(e,t,r){return t&&OFe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function jE(e,t,r){return t=RX(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function RX(e){var t=RFe(e,"string");return Up(t)=="symbol"?t:t+""}function RFe(e,t){if(Up(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Up(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var NFe=(function(){function e(){AFe(this,e),jE(this,"activeIndex",0),jE(this,"coordinateList",[]),jE(this,"layout","horizontal")}return IFe(e,[{key:"setDetails",value:function(r){var n,i=r.coordinateList,o=i===void 0?null:i,s=r.container,a=s===void 0?null:s,l=r.layout,c=l===void 0?null:l,d=r.offset,u=d===void 0?null:d,p=r.mouseHandlerCallback,g=p===void 0?null:p;this.coordinateList=(n=o??this.coordinateList)!==null&&n!==void 0?n:[],this.container=a??this.container,this.layout=c??this.layout,this.offset=u??this.offset,this.mouseHandlerCallback=g??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(r){if(this.coordinateList.length!==0)switch(r.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(r){this.activeIndex=r}},{key:"spoofMouse",value:function(){var r,n;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var i=this.container.getBoundingClientRect(),o=i.x,s=i.y,a=i.height,l=this.coordinateList[this.activeIndex].coordinate,c=((r=window)===null||r===void 0?void 0:r.scrollX)||0,d=((n=window)===null||n===void 0?void 0:n.scrollY)||0,u=o+l+c,p=s+this.offset.top+a/2+d;this.mouseHandlerCallback({pageX:u,pageY:p})}}}])})();function MFe(e,t,r){if(r==="number"&&t===!0&&Array.isArray(e)){var n=e==null?void 0:e[0],i=e==null?void 0:e[1];if(n&&i&&Ne(n)&&Ne(i))return!0}return!1}function jFe(e,t,r,n){var i=n/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-i:r.left+.5,y:e==="horizontal"?r.top+.5:t.y-i,width:e==="horizontal"?n:r.width-1,height:e==="horizontal"?r.height-1:n}}function NX(e){var t=e.cx,r=e.cy,n=e.radius,i=e.startAngle,o=e.endAngle,s=hr(t,r,n,i),a=hr(t,r,n,o);return{points:[s,a],cx:t,cy:r,radius:n,startAngle:i,endAngle:o}}function DFe(e,t,r){var n,i,o,s;if(e==="horizontal")n=t.x,o=n,i=r.top,s=r.top+r.height;else if(e==="vertical")i=t.y,s=i,n=r.left,o=r.left+r.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var a=t.cx,l=t.cy,c=t.innerRadius,d=t.outerRadius,u=t.angle,p=hr(a,l,c,u),g=hr(a,l,d,u);n=p.x,i=p.y,o=g.x,s=g.y}else return NX(t);return[{x:n,y:i},{x:o,y:s}]}function Hp(e){"@babel/helpers - typeof";return Hp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hp(e)}function VF(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function bv(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?VF(Object(r),!0).forEach(function(n){LFe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):VF(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function LFe(e,t,r){return t=$Fe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $Fe(e){var t=BFe(e,"string");return Hp(t)=="symbol"?t:t+""}function BFe(e,t){if(Hp(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Hp(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function FFe(e){var t,r,n=e.element,i=e.tooltipEventType,o=e.isActive,s=e.activeCoordinate,a=e.activePayload,l=e.offset,c=e.activeTooltipIndex,d=e.tooltipAxisBandSize,u=e.layout,p=e.chartName,g=(t=n.props.cursor)!==null&&t!==void 0?t:(r=n.type.defaultProps)===null||r===void 0?void 0:r.cursor;if(!n||!g||!o||!s||p!=="ScatterChart"&&i!=="axis")return null;var _,y=qy;if(p==="ScatterChart")_=s,y=w5e;else if(p==="BarChart")_=jFe(u,s,l,d),y=k2;else if(u==="radial"){var m=NX(s),v=m.cx,b=m.cy,x=m.radius,E=m.startAngle,C=m.endAngle;_={cx:v,cy:b,startAngle:E,endAngle:C,innerRadius:x,outerRadius:x},y=MK}else _={points:DFe(u,s,l)},y=qy;var k=bv(bv(bv(bv({stroke:"#ccc",pointerEvents:"none"},l),_),st(g,!1)),{},{payload:a,payloadIndex:c,className:gt("recharts-tooltip-cursor",g.className)});return O.isValidElement(g)?O.cloneElement(g,k):O.createElement(y,k)}var zFe=["item"],UFe=["children","className","width","height","style","compact","title","desc"];function jd(e){"@babel/helpers - typeof";return jd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jd(e)}function Ru(){return Ru=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ru.apply(this,arguments)}function GF(e,t){return WFe(e)||qFe(e,t)||jX(e,t)||HFe()}function HFe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
706
706
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qFe(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,s,a=[],l=!0,c=!1;try{if(o=(r=r.call(e)).next,t!==0)for(;!(l=(n=o.call(r)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(d){c=!0,i=d}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}function WFe(e){if(Array.isArray(e))return e}function KF(e,t){if(e==null)return{};var r=VFe(e,t),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function VFe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function GFe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function KFe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,DX(n.key),n)}}function XFe(e,t,r){return t&&KFe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function ZFe(e,t,r){return t=p0(t),QFe(e,MX()?Reflect.construct(t,r||[],p0(e).constructor):t.apply(e,r))}function QFe(e,t){if(t&&(jd(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return YFe(e)}function YFe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function MX(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(MX=function(){return!!e})()}function p0(e){return p0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},p0(e)}function JFe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&EP(e,t)}function EP(e,t){return EP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},EP(e,t)}function Dd(e){return r6e(e)||t6e(e)||jX(e)||e6e()}function e6e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
707
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jX(e,t){if(e){if(typeof e=="string")return kP(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return kP(e,t)}}function t6e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function r6e(e){if(Array.isArray(e))return kP(e)}function kP(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function XF(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ye(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?XF(Object(r),!0).forEach(function(n){lt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):XF(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function lt(e,t,r){return t=DX(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function DX(e){var t=n6e(e,"string");return jd(t)=="symbol"?t:t+""}function n6e(e,t){if(jd(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(jd(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var i6e={xAxis:["bottom","top"],yAxis:["left","right"]},o6e={width:"100%",height:"100%"},LX={x:0,y:0};function _v(e){return e}var s6e=function(t,r){return r==="horizontal"?t.x:r==="vertical"?t.y:r==="centric"?t.angle:t.radius},a6e=function(t,r,n,i){var o=r.find(function(d){return d&&d.index===n});if(o){if(t==="horizontal")return{x:o.coordinate,y:i.y};if(t==="vertical")return{x:i.x,y:o.coordinate};if(t==="centric"){var s=o.coordinate,a=i.radius;return ye(ye(ye({},i),hr(i.cx,i.cy,a,s)),{},{angle:s,radius:a})}var l=o.coordinate,c=i.angle;return ye(ye(ye({},i),hr(i.cx,i.cy,l,c)),{},{angle:c,radius:l})}return LX},Wb=function(t,r){var n=r.graphicalItems,i=r.dataStartIndex,o=r.dataEndIndex,s=(n??[]).reduce(function(a,l){var c=l.props.data;return c&&c.length?[].concat(Dd(a),Dd(c)):a},[]);return s.length>0?s:t&&t.length&&Ne(i)&&Ne(o)?t.slice(i,o+1):[]};function $X(e){return e==="number"?[0,"auto"]:void 0}var TP=function(t,r,n,i){var o=t.graphicalItems,s=t.tooltipAxis,a=Wb(r,t);return n<0||!o||!o.length||n>=a.length?null:o.reduce(function(l,c){var d,u=(d=c.props.data)!==null&&d!==void 0?d:r;u&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(u=u.slice(t.dataStartIndex,t.dataEndIndex+1));var p;if(s.dataKey&&!s.allowDuplicatedCategory){var g=u===void 0?a:u;p=my(g,s.dataKey,i)}else p=u&&u[n]||a[n];return p?[].concat(Dd(l),[PK(c,p)]):l},[])},ZF=function(t,r,n,i){var o=i||{x:t.chartX,y:t.chartY},s=s6e(o,n),a=t.orderedTooltipTicks,l=t.tooltipAxis,c=t.tooltipTicks,d=Hje(s,a,c,l);if(d>=0&&c){var u=c[d]&&c[d].value,p=TP(t,r,d,u),g=a6e(n,a,d,o);return{activeTooltipIndex:d,activeLabel:u,activePayload:p,activeCoordinate:g}}return null},l6e=function(t,r){var n=r.axes,i=r.graphicalItems,o=r.axisType,s=r.axisIdKey,a=r.stackGroups,l=r.dataStartIndex,c=r.dataEndIndex,d=t.layout,u=t.children,p=t.stackOffset,g=SK(d,o);return n.reduce(function(_,y){var m,v=y.type.defaultProps!==void 0?ye(ye({},y.type.defaultProps),y.props):y.props,b=v.type,x=v.dataKey,E=v.allowDataOverflow,C=v.allowDuplicatedCategory,k=v.scale,P=v.ticks,T=v.includeHidden,I=v[s];if(_[I])return _;var N=Wb(t.data,{graphicalItems:i.filter(function(X){var W,le=s in X.props?X.props[s]:(W=X.type.defaultProps)===null||W===void 0?void 0:W[s];return le===I}),dataStartIndex:l,dataEndIndex:c}),B=N.length,M,F,U;MFe(v.domain,E,b)&&(M=zT(v.domain,null,E),g&&(b==="number"||k!=="auto")&&(U=Lh(N,x,"category")));var q=$X(b);if(!M||M.length===0){var V,K=(V=v.domain)!==null&&V!==void 0?V:q;if(x){if(M=Lh(N,x,b),b==="category"&&g){var D=DPe(M);C&&D?(F=M,M=t0(0,B)):C||(M=eB(K,M,y).reduce(function(X,W){return X.indexOf(W)>=0?X:[].concat(Dd(X),[W])},[]))}else if(b==="category")C?M=M.filter(function(X){return X!==""&&!mt(X)}):M=eB(K,M,y).reduce(function(X,W){return X.indexOf(W)>=0||W===""||mt(W)?X:[].concat(Dd(X),[W])},[]);else if(b==="number"){var $=Kje(N,i.filter(function(X){var W,le,ce=s in X.props?X.props[s]:(W=X.type.defaultProps)===null||W===void 0?void 0:W[s],ve="hide"in X.props?X.props.hide:(le=X.type.defaultProps)===null||le===void 0?void 0:le.hide;return ce===I&&(T||!ve)}),x,o,d);$&&(M=$)}g&&(b==="number"||k!=="auto")&&(U=Lh(N,x,"category"))}else g?M=t0(0,B):a&&a[I]&&a[I].hasStack&&b==="number"?M=p==="expand"?[0,1]:TK(a[I].stackGroups,l,c):M=wK(N,i.filter(function(X){var W=s in X.props?X.props[s]:X.type.defaultProps[s],le="hide"in X.props?X.props.hide:X.type.defaultProps.hide;return W===I&&(T||!le)}),b,d,!0);if(b==="number")M=CP(u,M,I,o,P),K&&(M=zT(K,M,E));else if(b==="category"&&K){var j=K,z=M.every(function(X){return j.indexOf(X)>=0});z&&(M=j)}}return ye(ye({},_),{},lt({},I,ye(ye({},v),{},{axisType:o,domain:M,categoricalDomain:U,duplicateDomain:F,originalDomain:(m=v.domain)!==null&&m!==void 0?m:q,isCategorical:g,layout:d})))},{})},c6e=function(t,r){var n=r.graphicalItems,i=r.Axis,o=r.axisType,s=r.axisIdKey,a=r.stackGroups,l=r.dataStartIndex,c=r.dataEndIndex,d=t.layout,u=t.children,p=Wb(t.data,{graphicalItems:n,dataStartIndex:l,dataEndIndex:c}),g=p.length,_=SK(d,o),y=-1;return n.reduce(function(m,v){var b=v.type.defaultProps!==void 0?ye(ye({},v.type.defaultProps),v.props):v.props,x=b[s],E=$X("number");if(!m[x]){y++;var C;return _?C=t0(0,g):a&&a[x]&&a[x].hasStack?(C=TK(a[x].stackGroups,l,c),C=CP(u,C,x,o)):(C=zT(E,wK(p,n.filter(function(k){var P,T,I=s in k.props?k.props[s]:(P=k.type.defaultProps)===null||P===void 0?void 0:P[s],N="hide"in k.props?k.props.hide:(T=k.type.defaultProps)===null||T===void 0?void 0:T.hide;return I===x&&!N}),"number",d),i.defaultProps.allowDataOverflow),C=CP(u,C,x,o)),ye(ye({},m),{},lt({},x,ye(ye({axisType:o},i.defaultProps),{},{hide:!0,orientation:Mi(i6e,"".concat(o,".").concat(y%2),null),domain:C,originalDomain:E,isCategorical:_,layout:d})))}return m},{})},u6e=function(t,r){var n=r.axisType,i=n===void 0?"xAxis":n,o=r.AxisComp,s=r.graphicalItems,a=r.stackGroups,l=r.dataStartIndex,c=r.dataEndIndex,d=t.children,u="".concat(i,"Id"),p=ji(d,o),g={};return p&&p.length?g=l6e(t,{axes:p,graphicalItems:s,axisType:i,axisIdKey:u,stackGroups:a,dataStartIndex:l,dataEndIndex:c}):s&&s.length&&(g=c6e(t,{Axis:o,graphicalItems:s,axisType:i,axisIdKey:u,stackGroups:a,dataStartIndex:l,dataEndIndex:c})),g},d6e=function(t){var r=Cu(t),n=Gl(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:JO(n,function(i){return i.coordinate}),tooltipAxis:r,tooltipAxisBandSize:zy(r,n)}},QF=function(t){var r=t.children,n=t.defaultShowTooltip,i=Ei(r,kd),o=0,s=0;return t.data&&t.data.length!==0&&(s=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(o=i.props.startIndex),i.props.endIndex>=0&&(s=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:s,activeTooltipIndex:-1,isTooltipActive:!!n}},f6e=function(t){return!t||!t.length?!1:t.some(function(r){var n=zs(r&&r.type);return n&&n.indexOf("Bar")>=0})},YF=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},h6e=function(t,r){var n=t.props,i=t.graphicalItems,o=t.xAxisMap,s=o===void 0?{}:o,a=t.yAxisMap,l=a===void 0?{}:a,c=n.width,d=n.height,u=n.children,p=n.margin||{},g=Ei(u,kd),_=Ei(u,zu),y=Object.keys(l).reduce(function(C,k){var P=l[k],T=P.orientation;return!P.mirror&&!P.hide?ye(ye({},C),{},lt({},T,C[T]+P.width)):C},{left:p.left||0,right:p.right||0}),m=Object.keys(s).reduce(function(C,k){var P=s[k],T=P.orientation;return!P.mirror&&!P.hide?ye(ye({},C),{},lt({},T,Mi(C,"".concat(T))+P.height)):C},{top:p.top||0,bottom:p.bottom||0}),v=ye(ye({},m),y),b=v.bottom;g&&(v.bottom+=g.props.height||kd.defaultProps.height),_&&r&&(v=Vje(v,i,n,r));var x=c-v.left-v.right,E=d-v.top-v.bottom;return ye(ye({brushBottom:b},v),{},{width:Math.max(x,0),height:Math.max(E,0)})},p6e=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},BX=function(t){var r=t.chartName,n=t.GraphicalChild,i=t.defaultTooltipEventType,o=i===void 0?"axis":i,s=t.validateTooltipEventTypes,a=s===void 0?["axis"]:s,l=t.axisComponents,c=t.legendContent,d=t.formatAxisMap,u=t.defaultProps,p=function(v,b){var x=b.graphicalItems,E=b.stackGroups,C=b.offset,k=b.updateId,P=b.dataStartIndex,T=b.dataEndIndex,I=v.barSize,N=v.layout,B=v.barGap,M=v.barCategoryGap,F=v.maxBarSize,U=YF(N),q=U.numericAxisName,V=U.cateAxisName,K=f6e(x),D=[];return x.forEach(function($,j){var z=Wb(v.data,{graphicalItems:[$],dataStartIndex:P,dataEndIndex:T}),X=$.type.defaultProps!==void 0?ye(ye({},$.type.defaultProps),$.props):$.props,W=X.dataKey,le=X.maxBarSize,ce=X["".concat(q,"Id")],ve=X["".concat(V,"Id")],H={},Q=l.reduce(function(nr,Pt){var Bt=b["".concat(Pt.axisType,"Map")],Tr=X["".concat(Pt.axisType,"Id")];Bt&&Bt[Tr]||Pt.axisType==="zAxis"||wc();var lr=Bt[Tr];return ye(ye({},nr),{},lt(lt({},Pt.axisType,lr),"".concat(Pt.axisType,"Ticks"),Gl(lr)))},H),Y=Q[V],ne=Q["".concat(V,"Ticks")],ge=E&&E[ce]&&E[ce].hasStack&&nDe($,E[ce].stackGroups),te=zs($.type).indexOf("Bar")>=0,Oe=zy(Y,ne),Ie=[],_e=K&&qje({barSize:I,stackGroups:E,totalSize:p6e(Q,V)});if(te){var rt,Me,je=mt(le)?F:le,Qe=(rt=(Me=zy(Y,ne,!0))!==null&&Me!==void 0?Me:je)!==null&&rt!==void 0?rt:0;Ie=Wje({barGap:B,barCategoryGap:M,bandSize:Qe!==Oe?Qe:Oe,sizeList:_e[ve],maxBarSize:je}),Qe!==Oe&&(Ie=Ie.map(function(nr){return ye(ye({},nr),{},{position:ye(ye({},nr.position),{},{offset:nr.position.offset-Qe/2})})}))}var pr=$&&$.type&&$.type.getComposedData;pr&&D.push({props:ye(ye({},pr(ye(ye({},Q),{},{displayedData:z,props:v,dataKey:W,item:$,bandSize:Oe,barPosition:Ie,offset:C,stackedData:ge,layout:N,dataStartIndex:P,dataEndIndex:T}))),{},lt(lt(lt({key:$.key||"item-".concat(j)},q,Q[q]),V,Q[V]),"animationId",k)),childIndex:XPe($,v.children),item:$})}),D},g=function(v,b){var x=v.props,E=v.dataStartIndex,C=v.dataEndIndex,k=v.updateId;if(!p3({props:x}))return null;var P=x.children,T=x.layout,I=x.stackOffset,N=x.data,B=x.reverseStackOrder,M=YF(T),F=M.numericAxisName,U=M.cateAxisName,q=ji(P,n),V=tDe(N,q,"".concat(F,"Id"),"".concat(U,"Id"),I,B),K=l.reduce(function(X,W){var le="".concat(W.axisType,"Map");return ye(ye({},X),{},lt({},le,u6e(x,ye(ye({},W),{},{graphicalItems:q,stackGroups:W.axisType===F&&V,dataStartIndex:E,dataEndIndex:C}))))},{}),D=h6e(ye(ye({},K),{},{props:x,graphicalItems:q}),b==null?void 0:b.legendBBox);Object.keys(K).forEach(function(X){K[X]=d(x,K[X],D,X.replace("Map",""),r)});var $=K["".concat(U,"Map")],j=d6e($),z=p(x,ye(ye({},K),{},{dataStartIndex:E,dataEndIndex:C,updateId:k,graphicalItems:q,stackGroups:V,offset:D}));return ye(ye({formattedGraphicalItems:z,graphicalItems:q,offset:D,stackGroups:V},j),K)},_=(function(m){function v(b){var x,E,C;return GFe(this,v),C=ZFe(this,v,[b]),lt(C,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),lt(C,"accessibilityManager",new NFe),lt(C,"handleLegendBBoxUpdate",function(k){if(k){var P=C.state,T=P.dataStartIndex,I=P.dataEndIndex,N=P.updateId;C.setState(ye({legendBBox:k},g({props:C.props,dataStartIndex:T,dataEndIndex:I,updateId:N},ye(ye({},C.state),{},{legendBBox:k}))))}}),lt(C,"handleReceiveSyncEvent",function(k,P,T){if(C.props.syncId===k){if(T===C.eventEmitterSymbol&&typeof C.props.syncMethod!="function")return;C.applySyncEvent(P)}}),lt(C,"handleBrushChange",function(k){var P=k.startIndex,T=k.endIndex;if(P!==C.state.dataStartIndex||T!==C.state.dataEndIndex){var I=C.state.updateId;C.setState(function(){return ye({dataStartIndex:P,dataEndIndex:T},g({props:C.props,dataStartIndex:P,dataEndIndex:T,updateId:I},C.state))}),C.triggerSyncEvent({dataStartIndex:P,dataEndIndex:T})}}),lt(C,"handleMouseEnter",function(k){var P=C.getMouseInfo(k);if(P){var T=ye(ye({},P),{},{isTooltipActive:!0});C.setState(T),C.triggerSyncEvent(T);var I=C.props.onMouseEnter;pt(I)&&I(T,k)}}),lt(C,"triggeredAfterMouseMove",function(k){var P=C.getMouseInfo(k),T=P?ye(ye({},P),{},{isTooltipActive:!0}):{isTooltipActive:!1};C.setState(T),C.triggerSyncEvent(T);var I=C.props.onMouseMove;pt(I)&&I(T,k)}),lt(C,"handleItemMouseEnter",function(k){C.setState(function(){return{isTooltipActive:!0,activeItem:k,activePayload:k.tooltipPayload,activeCoordinate:k.tooltipPosition||{x:k.cx,y:k.cy}}})}),lt(C,"handleItemMouseLeave",function(){C.setState(function(){return{isTooltipActive:!1}})}),lt(C,"handleMouseMove",function(k){k.persist(),C.throttleTriggeredAfterMouseMove(k)}),lt(C,"handleMouseLeave",function(k){C.throttleTriggeredAfterMouseMove.cancel();var P={isTooltipActive:!1};C.setState(P),C.triggerSyncEvent(P);var T=C.props.onMouseLeave;pt(T)&&T(P,k)}),lt(C,"handleOuterEvent",function(k){var P=KPe(k),T=Mi(C.props,"".concat(P));if(P&&pt(T)){var I,N;/.*touch.*/i.test(P)?N=C.getMouseInfo(k.changedTouches[0]):N=C.getMouseInfo(k),T((I=N)!==null&&I!==void 0?I:{},k)}}),lt(C,"handleClick",function(k){var P=C.getMouseInfo(k);if(P){var T=ye(ye({},P),{},{isTooltipActive:!0});C.setState(T),C.triggerSyncEvent(T);var I=C.props.onClick;pt(I)&&I(T,k)}}),lt(C,"handleMouseDown",function(k){var P=C.props.onMouseDown;if(pt(P)){var T=C.getMouseInfo(k);P(T,k)}}),lt(C,"handleMouseUp",function(k){var P=C.props.onMouseUp;if(pt(P)){var T=C.getMouseInfo(k);P(T,k)}}),lt(C,"handleTouchMove",function(k){k.changedTouches!=null&&k.changedTouches.length>0&&C.throttleTriggeredAfterMouseMove(k.changedTouches[0])}),lt(C,"handleTouchStart",function(k){k.changedTouches!=null&&k.changedTouches.length>0&&C.handleMouseDown(k.changedTouches[0])}),lt(C,"handleTouchEnd",function(k){k.changedTouches!=null&&k.changedTouches.length>0&&C.handleMouseUp(k.changedTouches[0])}),lt(C,"handleDoubleClick",function(k){var P=C.props.onDoubleClick;if(pt(P)){var T=C.getMouseInfo(k);P(T,k)}}),lt(C,"handleContextMenu",function(k){var P=C.props.onContextMenu;if(pt(P)){var T=C.getMouseInfo(k);P(T,k)}}),lt(C,"triggerSyncEvent",function(k){C.props.syncId!==void 0&&NE.emit(ME,C.props.syncId,k,C.eventEmitterSymbol)}),lt(C,"applySyncEvent",function(k){var P=C.props,T=P.layout,I=P.syncMethod,N=C.state.updateId,B=k.dataStartIndex,M=k.dataEndIndex;if(k.dataStartIndex!==void 0||k.dataEndIndex!==void 0)C.setState(ye({dataStartIndex:B,dataEndIndex:M},g({props:C.props,dataStartIndex:B,dataEndIndex:M,updateId:N},C.state)));else if(k.activeTooltipIndex!==void 0){var F=k.chartX,U=k.chartY,q=k.activeTooltipIndex,V=C.state,K=V.offset,D=V.tooltipTicks;if(!K)return;if(typeof I=="function")q=I(D,k);else if(I==="value"){q=-1;for(var $=0;$<D.length;$++)if(D[$].value===k.activeLabel){q=$;break}}var j=ye(ye({},K),{},{x:K.left,y:K.top}),z=Math.min(F,j.x+j.width),X=Math.min(U,j.y+j.height),W=D[q]&&D[q].value,le=TP(C.state,C.props.data,q),ce=D[q]?{x:T==="horizontal"?D[q].coordinate:z,y:T==="horizontal"?X:D[q].coordinate}:LX;C.setState(ye(ye({},k),{},{activeLabel:W,activeCoordinate:ce,activePayload:le,activeTooltipIndex:q}))}else C.setState(k)}),lt(C,"renderCursor",function(k){var P,T=C.state,I=T.isTooltipActive,N=T.activeCoordinate,B=T.activePayload,M=T.offset,F=T.activeTooltipIndex,U=T.tooltipAxisBandSize,q=C.getTooltipEventType(),V=(P=k.props.active)!==null&&P!==void 0?P:I,K=C.props.layout,D=k.key||"_recharts-cursor";return Z.createElement(FFe,{key:D,activeCoordinate:N,activePayload:B,activeTooltipIndex:F,chartName:r,element:k,isActive:V,layout:K,offset:M,tooltipAxisBandSize:U,tooltipEventType:q})}),lt(C,"renderPolarAxis",function(k,P,T){var I=Mi(k,"type.axisType"),N=Mi(C.state,"".concat(I,"Map")),B=k.type.defaultProps,M=B!==void 0?ye(ye({},B),k.props):k.props,F=N&&N[M["".concat(I,"Id")]];return O.cloneElement(k,ye(ye({},F),{},{className:gt(I,F.className),key:k.key||"".concat(P,"-").concat(T),ticks:Gl(F,!0)}))}),lt(C,"renderPolarGrid",function(k){var P=k.props,T=P.radialLines,I=P.polarAngles,N=P.polarRadius,B=C.state,M=B.radiusAxisMap,F=B.angleAxisMap,U=Cu(M),q=Cu(F),V=q.cx,K=q.cy,D=q.innerRadius,$=q.outerRadius;return O.cloneElement(k,{polarAngles:Array.isArray(I)?I:Gl(q,!0).map(function(j){return j.coordinate}),polarRadius:Array.isArray(N)?N:Gl(U,!0).map(function(j){return j.coordinate}),cx:V,cy:K,innerRadius:D,outerRadius:$,key:k.key||"polar-grid",radialLines:T})}),lt(C,"renderLegend",function(){var k=C.state.formattedGraphicalItems,P=C.props,T=P.children,I=P.width,N=P.height,B=C.props.margin||{},M=I-(B.left||0)-(B.right||0),F=_K({children:T,formattedGraphicalItems:k,legendWidth:M,legendContent:c});if(!F)return null;var U=F.item,q=KF(F,zFe);return O.cloneElement(U,ye(ye({},q),{},{chartWidth:I,chartHeight:N,margin:B,onBBoxUpdate:C.handleLegendBBoxUpdate}))}),lt(C,"renderTooltip",function(){var k,P=C.props,T=P.children,I=P.accessibilityLayer,N=Ei(T,Os);if(!N)return null;var B=C.state,M=B.isTooltipActive,F=B.activeCoordinate,U=B.activePayload,q=B.activeLabel,V=B.offset,K=(k=N.props.active)!==null&&k!==void 0?k:M;return O.cloneElement(N,{viewBox:ye(ye({},V),{},{x:V.left,y:V.top}),active:K,label:q,payload:K?U:[],coordinate:F,accessibilityLayer:I})}),lt(C,"renderBrush",function(k){var P=C.props,T=P.margin,I=P.data,N=C.state,B=N.offset,M=N.dataStartIndex,F=N.dataEndIndex,U=N.updateId;return O.cloneElement(k,{key:k.key||"_recharts-brush",onChange:mv(C.handleBrushChange,k.props.onChange),data:I,x:Ne(k.props.x)?k.props.x:B.left,y:Ne(k.props.y)?k.props.y:B.top+B.height+B.brushBottom-(T.bottom||0),width:Ne(k.props.width)?k.props.width:B.width,startIndex:M,endIndex:F,updateId:"brush-".concat(U)})}),lt(C,"renderReferenceElement",function(k,P,T){if(!k)return null;var I=C,N=I.clipPathId,B=C.state,M=B.xAxisMap,F=B.yAxisMap,U=B.offset,q=k.type.defaultProps||{},V=k.props,K=V.xAxisId,D=K===void 0?q.xAxisId:K,$=V.yAxisId,j=$===void 0?q.yAxisId:$;return O.cloneElement(k,{key:k.key||"".concat(P,"-").concat(T),xAxis:M[D],yAxis:F[j],viewBox:{x:U.left,y:U.top,width:U.width,height:U.height},clipPathId:N})}),lt(C,"renderActivePoints",function(k){var P=k.item,T=k.activePoint,I=k.basePoint,N=k.childIndex,B=k.isRange,M=[],F=P.props.key,U=P.item.type.defaultProps!==void 0?ye(ye({},P.item.type.defaultProps),P.item.props):P.item.props,q=U.activeDot,V=U.dataKey,K=ye(ye({index:N,dataKey:V,cx:T.x,cy:T.y,r:4,fill:E2(P.item),strokeWidth:2,stroke:"#fff",payload:T.payload,value:T.value},st(q,!1)),gy(q));return M.push(v.renderActiveDot(q,K,"".concat(F,"-activePoint-").concat(N))),I?M.push(v.renderActiveDot(q,ye(ye({},K),{},{cx:I.x,cy:I.y}),"".concat(F,"-basePoint-").concat(N))):B&&M.push(null),M}),lt(C,"renderGraphicChild",function(k,P,T){var I=C.filterFormatItem(k,P,T);if(!I)return null;var N=C.getTooltipEventType(),B=C.state,M=B.isTooltipActive,F=B.tooltipAxis,U=B.activeTooltipIndex,q=B.activeLabel,V=C.props.children,K=Ei(V,Os),D=I.props,$=D.points,j=D.isRange,z=D.baseLine,X=I.item.type.defaultProps!==void 0?ye(ye({},I.item.type.defaultProps),I.item.props):I.item.props,W=X.activeDot,le=X.hide,ce=X.activeBar,ve=X.activeShape,H=!!(!le&&M&&K&&(W||ce||ve)),Q={};N!=="axis"&&K&&K.props.trigger==="click"?Q={onClick:mv(C.handleItemMouseEnter,k.props.onClick)}:N!=="axis"&&(Q={onMouseLeave:mv(C.handleItemMouseLeave,k.props.onMouseLeave),onMouseEnter:mv(C.handleItemMouseEnter,k.props.onMouseEnter)});var Y=O.cloneElement(k,ye(ye({},I.props),Q));function ne(Pt){return typeof F.dataKey=="function"?F.dataKey(Pt.payload):null}if(H)if(U>=0){var ge,te;if(F.dataKey&&!F.allowDuplicatedCategory){var Oe=typeof F.dataKey=="function"?ne:"payload.".concat(F.dataKey.toString());ge=my($,Oe,q),te=j&&z&&my(z,Oe,q)}else ge=$==null?void 0:$[U],te=j&&z&&z[U];if(ve||ce){var Ie=k.props.activeIndex!==void 0?k.props.activeIndex:U;return[O.cloneElement(k,ye(ye(ye({},I.props),Q),{},{activeIndex:Ie})),null,null]}if(!mt(ge))return[Y].concat(Dd(C.renderActivePoints({item:I,activePoint:ge,basePoint:te,childIndex:U,isRange:j})))}else{var _e,rt=(_e=C.getItemByXY(C.state.activeCoordinate))!==null&&_e!==void 0?_e:{graphicalItem:Y},Me=rt.graphicalItem,je=Me.item,Qe=je===void 0?k:je,pr=Me.childIndex,nr=ye(ye(ye({},I.props),Q),{},{activeIndex:pr});return[O.cloneElement(Qe,nr),null,null]}return j?[Y,null,null]:[Y,null]}),lt(C,"renderCustomized",function(k,P,T){return O.cloneElement(k,ye(ye({key:"recharts-customized-".concat(T)},C.props),C.state))}),lt(C,"renderMap",{CartesianGrid:{handler:_v,once:!0},ReferenceArea:{handler:C.renderReferenceElement},ReferenceLine:{handler:_v},ReferenceDot:{handler:C.renderReferenceElement},XAxis:{handler:_v},YAxis:{handler:_v},Brush:{handler:C.renderBrush,once:!0},Bar:{handler:C.renderGraphicChild},Line:{handler:C.renderGraphicChild},Area:{handler:C.renderGraphicChild},Radar:{handler:C.renderGraphicChild},RadialBar:{handler:C.renderGraphicChild},Scatter:{handler:C.renderGraphicChild},Pie:{handler:C.renderGraphicChild},Funnel:{handler:C.renderGraphicChild},Tooltip:{handler:C.renderCursor,once:!0},PolarGrid:{handler:C.renderPolarGrid,once:!0},PolarAngleAxis:{handler:C.renderPolarAxis},PolarRadiusAxis:{handler:C.renderPolarAxis},Customized:{handler:C.renderCustomized}}),C.clipPathId="".concat((x=b.id)!==null&&x!==void 0?x:uf("recharts"),"-clip"),C.throttleTriggeredAfterMouseMove=bG(C.triggeredAfterMouseMove,(E=b.throttleDelay)!==null&&E!==void 0?E:1e3/60),C.state={},C}return JFe(v,m),XFe(v,[{key:"componentDidMount",value:function(){var x,E;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(x=this.props.margin.left)!==null&&x!==void 0?x:0,top:(E=this.props.margin.top)!==null&&E!==void 0?E:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var x=this.props,E=x.children,C=x.data,k=x.height,P=x.layout,T=Ei(E,Os);if(T){var I=T.props.defaultIndex;if(!(typeof I!="number"||I<0||I>this.state.tooltipTicks.length-1)){var N=this.state.tooltipTicks[I]&&this.state.tooltipTicks[I].value,B=TP(this.state,C,I,N),M=this.state.tooltipTicks[I].coordinate,F=(this.state.offset.top+k)/2,U=P==="horizontal",q=U?{x:M,y:F}:{y:M,x:F},V=this.state.formattedGraphicalItems.find(function(D){var $=D.item;return $.type.name==="Scatter"});V&&(q=ye(ye({},q),V.props.points[I].tooltipPosition),B=V.props.points[I].tooltipPayload);var K={activeTooltipIndex:I,isTooltipActive:!0,activeLabel:N,activePayload:B,activeCoordinate:q};this.setState(K),this.renderCursor(T),this.accessibilityManager.setIndex(I)}}}},{key:"getSnapshotBeforeUpdate",value:function(x,E){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==E.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==x.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==x.margin){var C,k;this.accessibilityManager.setDetails({offset:{left:(C=this.props.margin.left)!==null&&C!==void 0?C:0,top:(k=this.props.margin.top)!==null&&k!==void 0?k:0}})}return null}},{key:"componentDidUpdate",value:function(x){cT([Ei(x.children,Os)],[Ei(this.props.children,Os)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var x=Ei(this.props.children,Os);if(x&&typeof x.props.shared=="boolean"){var E=x.props.shared?"axis":"item";return a.indexOf(E)>=0?E:o}return o}},{key:"getMouseInfo",value:function(x){if(!this.container)return null;var E=this.container,C=E.getBoundingClientRect(),k=jIe(C),P={chartX:Math.round(x.pageX-k.left),chartY:Math.round(x.pageY-k.top)},T=C.width/E.offsetWidth||1,I=this.inRange(P.chartX,P.chartY,T);if(!I)return null;var N=this.state,B=N.xAxisMap,M=N.yAxisMap,F=this.getTooltipEventType(),U=ZF(this.state,this.props.data,this.props.layout,I);if(F!=="axis"&&B&&M){var q=Cu(B).scale,V=Cu(M).scale,K=q&&q.invert?q.invert(P.chartX):null,D=V&&V.invert?V.invert(P.chartY):null;return ye(ye({},P),{},{xValue:K,yValue:D},U)}return U?ye(ye({},P),U):null}},{key:"inRange",value:function(x,E){var C=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,k=this.props.layout,P=x/C,T=E/C;if(k==="horizontal"||k==="vertical"){var I=this.state.offset,N=P>=I.left&&P<=I.left+I.width&&T>=I.top&&T<=I.top+I.height;return N?{x:P,y:T}:null}var B=this.state,M=B.angleAxisMap,F=B.radiusAxisMap;if(M&&F){var U=Cu(M);return nB({x:P,y:T},U)}return null}},{key:"parseEventsOfWrapper",value:function(){var x=this.props.children,E=this.getTooltipEventType(),C=Ei(x,Os),k={};C&&E==="axis"&&(C.props.trigger==="click"?k={onClick:this.handleClick}:k={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var P=gy(this.props,this.handleOuterEvent);return ye(ye({},P),k)}},{key:"addListener",value:function(){NE.on(ME,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){NE.removeListener(ME,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(x,E,C){for(var k=this.state.formattedGraphicalItems,P=0,T=k.length;P<T;P++){var I=k[P];if(I.item===x||I.props.key===x.key||E===zs(I.item.type)&&C===I.childIndex)return I}return null}},{key:"renderClipPath",value:function(){var x=this.clipPathId,E=this.state.offset,C=E.left,k=E.top,P=E.height,T=E.width;return Z.createElement("defs",null,Z.createElement("clipPath",{id:x},Z.createElement("rect",{x:C,y:k,height:P,width:T})))}},{key:"getXScales",value:function(){var x=this.state.xAxisMap;return x?Object.entries(x).reduce(function(E,C){var k=GF(C,2),P=k[0],T=k[1];return ye(ye({},E),{},lt({},P,T.scale))},{}):null}},{key:"getYScales",value:function(){var x=this.state.yAxisMap;return x?Object.entries(x).reduce(function(E,C){var k=GF(C,2),P=k[0],T=k[1];return ye(ye({},E),{},lt({},P,T.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(x){var E;return(E=this.state.xAxisMap)===null||E===void 0||(E=E[x])===null||E===void 0?void 0:E.scale}},{key:"getYScaleByAxisId",value:function(x){var E;return(E=this.state.yAxisMap)===null||E===void 0||(E=E[x])===null||E===void 0?void 0:E.scale}},{key:"getItemByXY",value:function(x){var E=this.state,C=E.formattedGraphicalItems,k=E.activeItem;if(C&&C.length)for(var P=0,T=C.length;P<T;P++){var I=C[P],N=I.props,B=I.item,M=B.type.defaultProps!==void 0?ye(ye({},B.type.defaultProps),B.props):B.props,F=zs(B.type);if(F==="Bar"){var U=(N.data||[]).find(function(D){return r5e(x,D)});if(U)return{graphicalItem:I,payload:U}}else if(F==="RadialBar"){var q=(N.data||[]).find(function(D){return nB(x,D)});if(q)return{graphicalItem:I,payload:q}}else if(Lb(I,k)||$b(I,k)||Lp(I,k)){var V=E$e({graphicalItem:I,activeTooltipItem:k,itemData:M.data}),K=M.activeIndex===void 0?V:M.activeIndex;return{graphicalItem:ye(ye({},I),{},{childIndex:K}),payload:Lp(I,k)?M.data[V]:I.props.data[V]}}}return null}},{key:"render",value:function(){var x=this;if(!p3(this))return null;var E=this.props,C=E.children,k=E.className,P=E.width,T=E.height,I=E.style,N=E.compact,B=E.title,M=E.desc,F=KF(E,UFe),U=st(F,!1);if(N)return Z.createElement(OF,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},Z.createElement(dT,Ru({},U,{width:P,height:T,title:B,desc:M}),this.renderClipPath(),g3(C,this.renderMap)));if(this.props.accessibilityLayer){var q,V;U.tabIndex=(q=this.props.tabIndex)!==null&&q!==void 0?q:0,U.role=(V=this.props.role)!==null&&V!==void 0?V:"application",U.onKeyDown=function(D){x.accessibilityManager.keyboardEvent(D)},U.onFocus=function(){x.accessibilityManager.focus()}}var K=this.parseEventsOfWrapper();return Z.createElement(OF,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},Z.createElement("div",Ru({className:gt("recharts-wrapper",k),style:ye({position:"relative",cursor:"default",width:P,height:T},I)},K,{ref:function($){x.container=$}}),Z.createElement(dT,Ru({},U,{width:P,height:T,title:B,desc:M,style:o6e}),this.renderClipPath(),g3(C,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])})(O.Component);lt(_,"displayName",r),lt(_,"defaultProps",ye({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},u)),lt(_,"getDerivedStateFromProps",function(m,v){var b=m.dataKey,x=m.data,E=m.children,C=m.width,k=m.height,P=m.layout,T=m.stackOffset,I=m.margin,N=v.dataStartIndex,B=v.dataEndIndex;if(v.updateId===void 0){var M=QF(m);return ye(ye(ye({},M),{},{updateId:0},g(ye(ye({props:m},M),{},{updateId:0}),v)),{},{prevDataKey:b,prevData:x,prevWidth:C,prevHeight:k,prevLayout:P,prevStackOffset:T,prevMargin:I,prevChildren:E})}if(b!==v.prevDataKey||x!==v.prevData||C!==v.prevWidth||k!==v.prevHeight||P!==v.prevLayout||T!==v.prevStackOffset||!Fu(I,v.prevMargin)){var F=QF(m),U={chartX:v.chartX,chartY:v.chartY,isTooltipActive:v.isTooltipActive},q=ye(ye({},ZF(v,x,P)),{},{updateId:v.updateId+1}),V=ye(ye(ye({},F),U),q);return ye(ye(ye({},V),g(ye({props:m},V),v)),{},{prevDataKey:b,prevData:x,prevWidth:C,prevHeight:k,prevLayout:P,prevStackOffset:T,prevMargin:I,prevChildren:E})}if(!cT(E,v.prevChildren)){var K,D,$,j,z=Ei(E,kd),X=z&&(K=(D=z.props)===null||D===void 0?void 0:D.startIndex)!==null&&K!==void 0?K:N,W=z&&($=(j=z.props)===null||j===void 0?void 0:j.endIndex)!==null&&$!==void 0?$:B,le=X!==N||W!==B,ce=!mt(x),ve=ce&&!le?v.updateId:v.updateId+1;return ye(ye({updateId:ve},g(ye(ye({props:m},v),{},{updateId:ve,dataStartIndex:X,dataEndIndex:W}),v)),{},{prevChildren:E,dataStartIndex:X,dataEndIndex:W})}return null}),lt(_,"renderActiveDot",function(m,v,b){var x;return O.isValidElement(m)?x=O.cloneElement(m,v):pt(m)?x=m(v):x=Z.createElement(Rb,v),Z.createElement(qt,{className:"recharts-active-dot",key:b},x)});var y=O.forwardRef(function(v,b){return Z.createElement(_,Ru({},v,{ref:b}))});return y.displayName=_.displayName,y},m6e=BX({chartName:"LineChart",GraphicalChild:km,axisComponents:[{axisType:"xAxis",AxisComp:I2},{axisType:"yAxis",AxisComp:R2}],formatAxisMap:A4e}),g6e=BX({chartName:"PieChart",GraphicalChild:oa,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:Db},{axisType:"radiusAxis",AxisComp:Mb}],formatAxisMap:hDe,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});function JF(e){const[t,r,n]=e.split(" ").map(g=>parseFloat(g)),i=t/360,o=r/100,s=n/100,a=(g,_,y)=>(y<0&&(y+=1),y>1&&(y-=1),y<1/6?g+(_-g)*6*y:y<1/2?_:y<2/3?g+(_-g)*(2/3-y)*6:g),l=s<.5?s*(1+o):s+o-s*o,c=2*s-l,d=Math.round(a(c,l,i+1/3)*255),u=Math.round(a(c,l,i)*255),p=Math.round(a(c,l,i-1/3)*255);return`#${((1<<24)+(d<<16)+(u<<8)+p).toString(16).slice(1)}`}function v6e(){const e=document.documentElement,t=getComputedStyle(e),r=n=>{const i=t.getPropertyValue(n).trim();return JF(i||{"--primary":"220 60% 65%","--success":"142 71% 45%","--warning":"38 92% 50%","--info":"220 60% 60%","--destructive":"8 75% 55%","--indigo":"239 65% 60%","--orange":"25 90% 55%","--muted":"220 20% 96%"}[n]||"220 60% 65%")};return{primary:r("--primary"),success:r("--success"),warning:r("--warning"),info:r("--info"),destructive:r("--destructive"),indigo:r("--indigo"),orange:r("--orange"),muted:r("--muted")}}function y6e({data:e,className:t="",height:r=50,color:n,strokeWidth:i=2}){const o=O.useMemo(()=>v6e(),[]),s=n||o.primary,a=O.useMemo(()=>e.map((l,c)=>({index:c,value:l})),[e]);return!e||e.length===0?null:w.jsx("div",{className:`w-full ${t}`,children:w.jsx(_G,{width:"100%",height:r,children:w.jsx(m6e,{data:a,margin:{top:2,right:2,bottom:2,left:2},children:w.jsx(km,{type:"monotone",dataKey:"value",stroke:s,strokeWidth:i,dot:!1,isAnimationActive:!1})})})})}const FX={all:["workflowStatusCounts"],detail:e=>[...FX.all,"detail",e]},b6e=30*1e3;function _6e(e={}){const{staleTime:t=b6e,enabled:r=!0,refetchInterval:n=0}=e,i=At(sr),o=r&&!!i,s=ui({queryKey:FX.detail(i||""),queryFn:async()=>{if(!i)throw new Error("Project path is required");const l=await fetch(`/api/workflow-status-counts?projectPath=${encodeURIComponent(i)}`);if(!l.ok)throw new Error("Failed to fetch workflow status counts");return l.json()},staleTime:t,enabled:o,refetchInterval:n>0?n:!1,retry:2,retryDelay:l=>Math.min(1e3*2**l,1e4)}),a=async()=>{await s.refetch()};return{data:s.data,isLoading:s.isLoading,isFetching:s.isFetching,error:s.error,isStale:s.isStale,refetch:a}}const N2={all:["projectOverview"],detail:e=>[...N2.all,"detail",e]},x6e=300*1e3;function w6e(e={}){const{staleTime:t=x6e,enabled:r=!0}=e,n=At(sr),i=r&&!!n,o=ui({queryKey:N2.detail(n),queryFn:()=>PU(n),staleTime:t,enabled:i,retry:2,retryDelay:s=>Math.min(1e3*2**s,1e4)});return{projectOverview:o.data,isLoading:o.isLoading,error:o.error,refetch:o.refetch}}function DUe(){const e=Rn(),t=At(sr),r=ki({mutationFn:n=>AU(n,t),onSuccess:()=>{e.invalidateQueries({queryKey:N2.detail()})}});return{updateGuidelines:r.mutateAsync,isUpdating:r.isPending,error:r.error}}const S6e=30*1e3;function C6e(e={}){const{staleTime:t=S6e,enabled:r=!0,refetchInterval:n=0}=e,i=Rn(),o=At(sr),s=r&&!!o,a=ui({queryKey:Ce.indexStatus(o),queryFn:()=>FU(o),staleTime:t,enabled:s,refetchInterval:n>0?n:!1,retry:2}),l=async()=>{await a.refetch()},c=async()=>{await i.invalidateQueries({queryKey:Ce.index(o)})};return{status:a.data??null,isLoading:a.isLoading,isFetching:a.isFetching,error:a.error,refetch:l,invalidate:c}}const xv={completed:{bg:"bg-success",text:"text-success",dot:"bg-emerald-500",fill:"#10b981"},in_progress:{bg:"bg-warning",text:"text-warning",dot:"bg-amber-500",fill:"#f59e0b"},planning:{bg:"bg-violet-500",text:"text-violet-600",dot:"bg-violet-500",fill:"#8b5cf6"},paused:{bg:"bg-slate-400",text:"text-slate-500",dot:"bg-slate-400",fill:"#94a3b8"},archived:{bg:"bg-slate-300",text:"text-slate-400",dot:"bg-slate-300",fill:"#cbd5e1"}},E6e={completed:"sessions.status.completed",in_progress:"sessions.status.inProgress",planning:"sessions.status.planning",paused:"sessions.status.paused",archived:"sessions.status.archived"},e6={pending:{bg:"bg-muted",text:"text-muted-foreground",icon:to},completed:{bg:"bg-success/20",text:"text-success",icon:Wh},in_progress:{bg:"bg-warning/20",text:"text-warning",icon:to},blocked:{bg:"bg-destructive/20",text:"text-destructive",icon:Qa},skipped:{bg:"bg-slate-400/20",text:"text-slate-500",icon:to}};function k6e({className:e}){const{formatMessage:t}=$t();return w.jsx("div",{className:he("flex items-center justify-center h-full",e),children:w.jsx(dd,{className:"max-w-sm w-full border-dashed",children:w.jsxs(IO,{className:"flex flex-col items-center gap-4 py-8",children:[w.jsx("div",{className:"w-14 h-14 rounded-full bg-muted flex items-center justify-center",children:w.jsx(Vh,{className:"w-7 h-7 text-muted-foreground"})}),w.jsxs("div",{className:"text-center space-y-2",children:[w.jsx("h3",{className:"text-base font-semibold",children:t({id:"home.emptyState.noSessions.title"})}),w.jsx("p",{className:"text-sm text-muted-foreground",children:t({id:"home.emptyState.noSessions.message"})})]}),w.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[w.jsx("code",{className:"px-3 py-2 bg-muted rounded text-xs font-mono text-center",children:"/workflow-plan"}),w.jsx("p",{className:"text-xs text-muted-foreground text-center",children:t({id:"home.emptyState.noSessions.hint"})})]})]})})})}const t6={planning:{bg:"bg-violet-500/20",text:"text-violet-600"},in_progress:{bg:"bg-warning/20",text:"text-warning"},completed:{bg:"bg-success/20",text:"text-success"},paused:{bg:"bg-slate-400/20",text:"text-slate-500"},ready:{bg:"bg-success/20",text:"text-success"},initialized:{bg:"bg-info/20",text:"text-info"},archived:{bg:"bg-slate-300/20",text:"text-slate-400"},failed:{bg:"bg-destructive/20",text:"text-destructive"}},r6={primary:{card:"border-primary/30 bg-primary/5",icon:"bg-primary/10 text-primary"},info:{card:"border-info/30 bg-info/5",icon:"bg-info/10 text-info"},success:{card:"border-success/30 bg-success/5",icon:"bg-success/10 text-success"},warning:{card:"border-warning/30 bg-warning/5",icon:"bg-warning/10 text-warning"},danger:{card:"border-destructive/30 bg-destructive/5",icon:"bg-destructive/10 text-destructive"},default:{card:"border-border",icon:"bg-muted text-muted-foreground"}};function _u({icon:e,title:t,value:r,variant:n,sparklineData:i}){const o=r6[n]||r6.default;return w.jsxs("div",{className:he("rounded-lg border p-3 transition-all hover:shadow-sm h-full flex flex-col",o.card),children:[w.jsxs("div",{className:"flex items-start justify-between gap-2",children:[w.jsxs("div",{className:"flex-1 min-w-0",children:[w.jsx("p",{className:"text-xs font-medium text-muted-foreground truncate",children:t}),w.jsx("p",{className:"text-xl font-bold text-card-foreground mt-1",children:r.toLocaleString()})]}),w.jsx("div",{className:he("flex h-7 w-7 items-center justify-center rounded-md shrink-0",o.icon),children:w.jsx(e,{className:"h-4 w-4"})})]}),i&&i.length>0&&w.jsx("div",{className:"mt-auto pt-2 -mx-1",children:w.jsx(y6e,{data:i,height:28,strokeWidth:1.5})})]})}function xu(e,t=.3){const n=[];let i=Math.max(0,e*(1-t));for(let o=0;o<6;o++){n.push(Math.round(i));const s=(Math.random()-.5)*2*t*e;i=Math.max(0,i+s)}return n.push(e),n}function T6e({className:e}){var B,M,F,U,q,V,K,D,$,j,z,X,W,le,ce,ve,H,Q,Y,ne,ge,te,Oe,Ie,_e,rt,Me;const{formatMessage:t}=$t(),r=Sc(),{data:n,isLoading:i}=_6e(),{stats:o,isLoading:s}=Fpe({refetchInterval:6e4}),{projectOverview:a,isLoading:l}=w6e(),{status:c}=C6e({refetchInterval:3e4}),{activeSessions:d,isLoading:u}=$H({filter:{location:"active"}}),p=n||[],g=p.reduce((je,Qe)=>je+Qe.count,0),_=p.length>0,y=O.useMemo(()=>({activeSessions:xu((o==null?void 0:o.activeSessions)??0,.4),totalTasks:xu((o==null?void 0:o.totalTasks)??0,.3),completedTasks:xu((o==null?void 0:o.completedTasks)??0,.25),pendingTasks:xu((o==null?void 0:o.pendingTasks)??0,.35),failedTasks:xu((o==null?void 0:o.failedTasks)??0,.5),todayActivity:xu((o==null?void 0:o.todayActivity)??0,.6)}),[o]),[m,v]=O.useState(!1),[b,x]=O.useState(0),E=d.length,C=d[b],k=O.useCallback(je=>{if(!je)return"";const Qe=new Date(je);return isNaN(Qe.getTime())?"":Qe.toLocaleDateString()},[]);O.useEffect(()=>{if(E<=1)return;const je=setInterval(()=>{x(Qe=>(Qe+1)%E)},5e3);return()=>clearInterval(je)},[E]);const P=()=>{x(je=>je===0?E-1:je-1)},T=()=>{x(je=>(je+1)%E)},I=je=>{r(`/sessions/${je}`)},N=je=>je==="in_progress"?"in_progress":je==="blocked"?"blocked":je==="skipped"?"skipped":je;return w.jsxs("div",{className:he("flex flex-col gap-2",e),children:[w.jsx(dd,{className:"shrink-0 border-gradient-brand",children:l?w.jsxs("div",{className:"px-4 py-3 flex items-center gap-4",children:[w.jsx("div",{className:"h-5 w-32 bg-muted rounded animate-pulse"}),w.jsx("div",{className:"h-4 w-48 bg-muted rounded animate-pulse"})]}):w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:"px-5 py-4 flex items-center gap-6 flex-wrap",children:[w.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[w.jsx("div",{className:"p-2 rounded-md bg-primary/10",children:w.jsx(SM,{className:"h-5 w-5 text-primary"})}),w.jsxs("div",{className:"min-w-0",children:[w.jsx("h2",{className:"text-base font-semibold text-foreground truncate",children:(a==null?void 0:a.projectName)||"Claude Code Workflow"}),w.jsx("p",{className:"text-xs text-muted-foreground truncate max-w-[300px]",children:(a==null?void 0:a.description)||"AI-powered workflow management system"})]})]}),w.jsx("div",{className:"h-10 w-px bg-border hidden md:block"}),w.jsxs("div",{className:"flex items-center gap-2.5 text-xs",children:[w.jsxs("span",{className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-md bg-blue-500/10 text-blue-600 font-medium",children:[w.jsx(SM,{className:"h-3.5 w-3.5"}),((F=(M=(B=a==null?void 0:a.technologyStack)==null?void 0:B.languages)==null?void 0:M[0])==null?void 0:F.name)||"TypeScript"]}),w.jsxs("span",{className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-md bg-green-500/10 text-green-600 font-medium",children:[w.jsx(bk,{className:"h-3.5 w-3.5"}),((q=(U=a==null?void 0:a.technologyStack)==null?void 0:U.frameworks)==null?void 0:q[0])||"Node.js"]}),w.jsxs("span",{className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-md bg-violet-500/10 text-violet-600 font-medium",children:[w.jsx(yk,{className:"h-3.5 w-3.5"}),((V=a==null?void 0:a.architecture)==null?void 0:V.style)||"Modular Monolith"]}),((D=(K=a==null?void 0:a.technologyStack)==null?void 0:K.build_tools)==null?void 0:D[0])&&w.jsxs("span",{className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-md bg-orange-500/10 text-orange-600 font-medium",children:[w.jsx(ju,{className:"h-3.5 w-3.5"}),a.technologyStack.build_tools[0]]})]}),w.jsx("div",{className:"h-10 w-px bg-border hidden lg:block"}),w.jsxs("div",{className:"flex items-center gap-5 text-xs",children:[w.jsxs("div",{className:"flex items-center gap-2 text-emerald-600",children:[w.jsx(Uv,{className:"h-3.5 w-3.5"}),w.jsx("span",{className:"font-semibold",children:((j=($=a==null?void 0:a.developmentIndex)==null?void 0:$.feature)==null?void 0:j.length)||0}),w.jsx("span",{className:"text-muted-foreground",children:t({id:"projectOverview.devIndex.category.features"})})]}),w.jsxs("div",{className:"flex items-center gap-2 text-amber-600",children:[w.jsx(_M,{className:"h-3.5 w-3.5"}),w.jsx("span",{className:"font-semibold",children:((X=(z=a==null?void 0:a.developmentIndex)==null?void 0:z.bugfix)==null?void 0:X.length)||0}),w.jsx("span",{className:"text-muted-foreground",children:t({id:"projectOverview.devIndex.category.bugfixes"})})]}),w.jsxs("div",{className:"flex items-center gap-2 text-blue-600",children:[w.jsx(Gx,{className:"h-3.5 w-3.5"}),w.jsx("span",{className:"font-semibold",children:((le=(W=a==null?void 0:a.developmentIndex)==null?void 0:W.enhancement)==null?void 0:le.length)||0}),w.jsx("span",{className:"text-muted-foreground",children:t({id:"projectOverview.devIndex.category.enhancements"})})]}),w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsxs("div",{className:"relative",children:[w.jsx(Bz,{className:he("h-3.5 w-3.5",(c==null?void 0:c.status)==="building"&&"text-blue-600 animate-pulse",(c==null?void 0:c.status)==="completed"&&"text-emerald-600",(c==null?void 0:c.status)==="idle"&&"text-slate-500",(c==null?void 0:c.status)==="failed"&&"text-red-600")}),(c==null?void 0:c.status)==="building"&&w.jsxs("span",{className:"absolute -top-0.5 -right-0.5 flex h-2 w-2",children:[w.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-blue-400 opacity-75"}),w.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-blue-500"})]})]}),w.jsx("span",{className:he("font-semibold",(c==null?void 0:c.status)==="building"&&"text-blue-600",(c==null?void 0:c.status)==="completed"&&"text-emerald-600",(c==null?void 0:c.status)==="idle"&&"text-slate-500",(c==null?void 0:c.status)==="failed"&&"text-red-600"),children:(c==null?void 0:c.totalFiles)||0}),w.jsx("span",{className:"text-muted-foreground",children:t({id:"home.indexStatus.label"})})]})]}),w.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground ml-auto",children:[w.jsxs("span",{className:"flex items-center gap-2 px-2.5 py-1.5 rounded-md bg-muted/50",children:[w.jsx(xM,{className:"h-3.5 w-3.5"}),a!=null&&a.initializedAt?new Date(a.initializedAt).toLocaleDateString():new Date().toLocaleDateString()]}),w.jsx(Ye,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 hover:bg-muted",onClick:()=>v(!m),children:m?w.jsx(b0,{className:"h-4 w-4"}):w.jsx(ea,{className:"h-4 w-4"})})]})]}),m&&w.jsxs("div",{className:"px-5 pb-4 grid grid-cols-4 gap-6 border-t border-border/50 pt-4",children:[w.jsxs("div",{className:"space-y-2",children:[w.jsxs("h4",{className:"text-xs font-semibold text-foreground flex items-center gap-1.5",children:[w.jsx(yk,{className:"h-4 w-4 text-primary"}),t({id:"projectOverview.architecture.title"})]}),w.jsxs("div",{className:"space-y-2",children:[w.jsx("div",{className:"flex items-center gap-2",children:w.jsx("span",{className:"text-sm font-medium text-foreground",children:((ce=a==null?void 0:a.architecture)==null?void 0:ce.style)||"Modular Monolith"})}),w.jsxs("p",{className:"text-xs text-muted-foreground",children:[t({id:"projectOverview.architecture.layers"}),":"]}),w.jsx("div",{className:"flex flex-wrap gap-1.5",children:(((ve=a==null?void 0:a.architecture)==null?void 0:ve.layers)||["CLI Tools","Core Services","Dashboard UI","Data Layer"]).slice(0,5).map((je,Qe)=>w.jsx("span",{className:"text-xs px-2 py-1 rounded-md bg-muted text-muted-foreground font-medium",children:je},Qe))})]})]}),w.jsxs("div",{className:"space-y-2",children:[w.jsxs("h4",{className:"text-xs font-semibold text-foreground flex items-center gap-1.5",children:[w.jsx(ju,{className:"h-4 w-4 text-orange-500"}),t({id:"projectOverview.components.title"})]}),w.jsx("div",{className:"space-y-1.5",children:((a==null?void 0:a.keyComponents)||[{name:"Session Manager",description:"Workflow session lifecycle"},{name:"Dashboard Generator",description:"Dynamic widget rendering"},{name:"Data Aggregator",description:"Stats and metrics collection"},{name:"Task Scheduler",description:"Async task orchestration"}]).slice(0,4).map((je,Qe)=>w.jsxs("div",{className:"flex items-start gap-2",children:[w.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-orange-500 mt-1.5 shrink-0"}),w.jsxs("div",{className:"min-w-0",children:[w.jsx("p",{className:"text-xs font-medium text-foreground truncate",children:je.name}),je.description&&w.jsx("p",{className:"text-[11px] text-muted-foreground truncate",children:je.description})]})]},Qe))})]}),w.jsxs("div",{className:"space-y-2",children:[w.jsxs("h4",{className:"text-xs font-semibold text-foreground flex items-center gap-1.5",children:[w.jsx(Gx,{className:"h-4 w-4 text-blue-500"}),t({id:"projectOverview.devIndex.title"})]}),w.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[w.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded-md bg-emerald-500/10",children:[w.jsx(Uv,{className:"h-3.5 w-3.5 text-emerald-600"}),w.jsxs("div",{children:[w.jsx("p",{className:"text-sm font-semibold text-emerald-600",children:((Q=(H=a==null?void 0:a.developmentIndex)==null?void 0:H.feature)==null?void 0:Q.length)||10}),w.jsx("p",{className:"text-[10px] text-emerald-600/80",children:t({id:"projectOverview.devIndex.category.features"})})]})]}),w.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded-md bg-blue-500/10",children:[w.jsx(Gx,{className:"h-3.5 w-3.5 text-blue-600"}),w.jsxs("div",{children:[w.jsx("p",{className:"text-sm font-semibold text-blue-600",children:((ne=(Y=a==null?void 0:a.developmentIndex)==null?void 0:Y.enhancement)==null?void 0:ne.length)||5}),w.jsx("p",{className:"text-[10px] text-blue-600/80",children:t({id:"projectOverview.devIndex.category.enhancements"})})]})]}),w.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded-md bg-amber-500/10",children:[w.jsx(_M,{className:"h-3.5 w-3.5 text-amber-600"}),w.jsxs("div",{children:[w.jsx("p",{className:"text-sm font-semibold text-amber-600",children:((te=(ge=a==null?void 0:a.developmentIndex)==null?void 0:ge.bugfix)==null?void 0:te.length)||3}),w.jsx("p",{className:"text-[10px] text-amber-600/80",children:t({id:"projectOverview.devIndex.category.bugfixes"})})]})]}),w.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded-md bg-violet-500/10",children:[w.jsx(ju,{className:"h-3.5 w-3.5 text-violet-600"}),w.jsxs("div",{children:[w.jsx("p",{className:"text-sm font-semibold text-violet-600",children:((Ie=(Oe=a==null?void 0:a.developmentIndex)==null?void 0:Oe.refactor)==null?void 0:Ie.length)||2}),w.jsx("p",{className:"text-[10px] text-violet-600/80",children:t({id:"projectOverview.devIndex.category.refactorings"})})]})]})]})]}),w.jsxs("div",{className:"space-y-2",children:[w.jsxs("h4",{className:"text-xs font-semibold text-foreground flex items-center gap-1.5",children:[w.jsx(Uz,{className:"h-4 w-4 text-violet-500"}),t({id:"projectOverview.architecture.patterns"})]}),w.jsx("div",{className:"flex flex-wrap gap-1.5",children:(((_e=a==null?void 0:a.architecture)==null?void 0:_e.patterns)||["Factory","Strategy","Observer","Singleton","Decorator"]).slice(0,6).map((je,Qe)=>w.jsx("span",{className:"text-xs px-2.5 py-1 rounded-md bg-primary/10 text-primary font-medium",children:je},Qe))})]})]})]})}),w.jsxs(dd,{className:"h-[400px] flex shrink-0 overflow-hidden",children:[w.jsxs("div",{className:"w-[28%] p-3 flex flex-col border-r border-border",children:[w.jsxs("h3",{className:"text-sm font-semibold text-foreground mb-3 flex items-center gap-1.5",children:[w.jsx(rne,{className:"h-4 w-4"}),t({id:"home.sections.statistics"})]}),s?w.jsx("div",{className:"grid grid-cols-2 grid-rows-3 gap-2.5 flex-1",children:[1,2,3,4,5,6].map(je=>w.jsx("div",{className:"bg-muted rounded animate-pulse"},je))}):w.jsxs("div",{className:"grid grid-cols-2 grid-rows-3 gap-2.5 flex-1",children:[w.jsx(_u,{icon:x0,title:t({id:"home.stats.activeSessions"}),value:(o==null?void 0:o.activeSessions)??0,variant:"primary",sparklineData:y.activeSessions}),w.jsx(_u,{icon:Vh,title:t({id:"home.stats.totalTasks"}),value:(o==null?void 0:o.totalTasks)??0,variant:"info",sparklineData:y.totalTasks}),w.jsx(_u,{icon:Wh,title:t({id:"home.stats.completedTasks"}),value:(o==null?void 0:o.completedTasks)??0,variant:"success",sparklineData:y.completedTasks}),w.jsx(_u,{icon:to,title:t({id:"home.stats.pendingTasks"}),value:(o==null?void 0:o.pendingTasks)??0,variant:"warning",sparklineData:y.pendingTasks}),w.jsx(_u,{icon:Qa,title:t({id:"common.status.failed"}),value:(o==null?void 0:o.failedTasks)??0,variant:"danger",sparklineData:y.failedTasks}),w.jsx(_u,{icon:Dz,title:t({id:"common.stats.todayActivity"}),value:(o==null?void 0:o.todayActivity)??0,variant:"default",sparklineData:y.todayActivity})]})]}),w.jsxs("div",{className:"w-[22%] p-3 flex flex-col border-r border-border",children:[w.jsxs("h3",{className:"text-sm font-semibold text-foreground mb-3 flex items-center gap-1.5",children:[w.jsx(wM,{className:"h-4 w-4"}),t({id:"home.widgets.workflowStatus"})]}),i?w.jsx("div",{className:"flex-1 flex items-center justify-center",children:w.jsx("div",{className:"w-24 h-24 rounded-full bg-muted animate-pulse"})}):_?w.jsxs("div",{className:"flex-1 flex flex-col",children:[w.jsx("div",{className:"flex-1 min-h-0",children:w.jsx(_G,{width:"100%",height:"100%",children:w.jsx(g6e,{children:w.jsx(oa,{data:p,cx:"50%",cy:"50%",innerRadius:"55%",outerRadius:"85%",paddingAngle:2,dataKey:"count",children:p.map(je=>{const Qe=xv[je.status]||xv.completed;return w.jsx(_b,{fill:Qe.fill},je.status)})})})})}),w.jsx("div",{className:"grid grid-cols-2 gap-x-3 gap-y-1.5 mt-3",children:p.map(je=>{const Qe=xv[je.status]||xv.completed,pr=g>0?Math.round(je.count/g*100):0;return w.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[w.jsx("div",{className:he("w-2.5 h-2.5 rounded-full shrink-0",Qe.dot)}),w.jsx("span",{className:"text-xs text-muted-foreground truncate",children:t({id:E6e[je.status]??"sessions.status.inProgress"})}),w.jsxs("span",{className:"text-xs font-medium text-foreground ml-auto",children:[pr,"%"]})]},je.status)})})]}):w.jsx("div",{className:"flex-1 flex items-center justify-center",children:w.jsxs("div",{className:"text-center",children:[w.jsx(wM,{className:"w-12 h-12 mx-auto text-muted-foreground/30 mb-2"}),w.jsx("p",{className:"text-xs text-muted-foreground",children:t({id:"home.emptyState.noSessions.message"})})]})})]}),w.jsxs("div",{className:"flex-1 min-w-0 p-4 flex flex-col",children:[w.jsxs("div",{className:"flex items-center justify-between mb-3",children:[w.jsxs("h3",{className:"text-sm font-semibold text-foreground flex items-center gap-1.5",children:[w.jsx(Vh,{className:"h-4 w-4"}),t({id:"home.sections.taskDetails"})]}),E>0&&w.jsxs("div",{className:"flex items-center gap-1.5",children:[w.jsx(Ye,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:P,disabled:E<=1,children:w.jsx(nne,{className:"h-4 w-4"})}),w.jsxs("span",{className:"text-xs text-muted-foreground min-w-[45px] text-center",children:[b+1," / ",E]}),w.jsx(Ye,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:T,disabled:E<=1,children:w.jsx($z,{className:"h-4 w-4"})})]})]}),u?w.jsx("div",{className:"flex-1 flex items-center justify-center",children:w.jsxs("div",{className:"w-full max-w-sm space-y-3",children:[w.jsx("div",{className:"h-8 bg-muted rounded animate-pulse"}),w.jsx("div",{className:"h-4 bg-muted rounded animate-pulse w-3/4"}),w.jsx("div",{className:"h-20 bg-muted rounded animate-pulse"})]})}):E===0?w.jsx(k6e,{}):C?w.jsxs("div",{className:"flex-1 flex flex-col min-h-0 rounded-lg border border-border bg-accent/20 p-3 overflow-hidden cursor-pointer hover:border-primary/30 transition-colors",onClick:()=>I(C.session_id),children:[w.jsxs("div",{className:"mb-2 pb-2 border-b border-border shrink-0 min-w-0",children:[w.jsxs("div",{className:"flex items-start gap-2 min-w-0",children:[w.jsx("div",{className:he("px-2 py-1 rounded text-xs font-medium shrink-0",((rt=t6[C.status])==null?void 0:rt.bg)||"bg-muted",((Me=t6[C.status])==null?void 0:Me.text)||"text-muted-foreground"),children:t({id:`common.status.${C.status==="in_progress"?"inProgress":C.status}`})}),w.jsxs("div",{className:"flex-1 min-w-0 overflow-hidden",children:[w.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:C.title||C.session_id}),w.jsx("p",{className:"text-xs text-muted-foreground truncate",children:C.session_id})]})]}),C.description&&w.jsx("p",{className:"text-xs text-muted-foreground mt-2 line-clamp-2",children:C.description}),C.tasks&&C.tasks.length>0&&w.jsxs("div",{className:"mt-2.5 space-y-1",children:[w.jsxs("div",{className:"flex items-center justify-between text-xs",children:[w.jsx("span",{className:"text-muted-foreground",children:t({id:"common.labels.progress"})}),w.jsxs("span",{className:"font-medium text-foreground",children:[C.tasks.filter(je=>je.status==="completed").length,"/",C.tasks.length]})]}),w.jsx(ab,{value:C.tasks.length>0?C.tasks.filter(je=>je.status==="completed").length/C.tasks.length*100:0,className:"h-1.5 bg-muted",indicatorClassName:"bg-success"})]}),w.jsx("div",{className:"flex items-center gap-2 mt-2 flex-wrap",children:w.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] text-muted-foreground ml-auto",children:[w.jsx(xM,{className:"h-3 w-3"}),k(C.updated_at||C.created_at)]})})]}),C.tasks&&C.tasks.length>0?w.jsx("div",{className:"flex-1 overflow-auto min-h-0",children:w.jsx("div",{className:"grid grid-cols-2 gap-2 w-full",children:C.tasks.map((je,Qe)=>{const pr=N(je.status),nr=e6[pr]||e6.pending,Pt=nr.icon,Bt=C.tasks.length%2===1&&Qe===C.tasks.length-1;return w.jsxs("div",{className:he("flex items-center gap-2 p-2 rounded hover:bg-background/50 transition-colors min-w-0",Bt&&"col-span-2"),children:[w.jsx("div",{className:he("p-1 rounded shrink-0",nr.bg),children:w.jsx(Pt,{className:he("h-3 w-3",nr.text)})}),w.jsx("p",{className:he("flex-1 text-xs font-medium truncate",je.status==="completed"?"text-muted-foreground line-through":"text-foreground"),children:je.title||je.task_id})]},`${C.session_id}-${je.task_id}-${Qe}`)})})}):w.jsx("div",{className:"flex-1 flex items-center justify-center",children:w.jsx("p",{className:"text-xs text-muted-foreground",children:t({id:"home.emptyState.noTasks.message"})})})]}):null,E>1&&w.jsx("div",{className:"flex items-center justify-center gap-1 mt-2",children:d.map((je,Qe)=>w.jsx("button",{onClick:()=>x(Qe),className:he("w-1.5 h-1.5 rounded-full transition-colors",Qe===b?"bg-primary":"bg-muted hover:bg-muted-foreground/50")},Qe))})]})]})]})}const P6e=O.memo(T6e);function A6e(e={}){const t=Rn(),r=At(sr),n=(e.enabled??!0)&&!!r,{data:i={litePlan:[],liteFix:[],multiCliPlan:[]},isLoading:o,error:s,refetch:a}=ui({queryKey:Ce.liteTasks(r),queryFn:()=>oA(r),staleTime:3e4,refetchInterval:e.refetchInterval,enabled:n}),l=[...(i.litePlan||[]).map(u=>({...u,_type:"lite-plan"})),...(i.liteFix||[]).map(u=>({...u,_type:"lite-fix"})),...(i.multiCliPlan||[]).map(u=>({...u,_type:"multi-cli-plan"}))],c=u=>{switch(u){case"lite-plan":return i.litePlan||[];case"lite-fix":return i.liteFix||[];case"multi-cli-plan":return i.multiCliPlan||[]}},d=(u,p)=>{t.prefetchQuery({queryKey:["liteTask",u,p],queryFn:()=>RU(u,p,r),staleTime:6e4})};return{litePlan:i.litePlan||[],liteFix:i.liteFix||[],multiCliPlan:i.multiCliPlan||[],allSessions:l,getSessionsByType:c,prefetchSession:d,isLoading:o,error:s,refetch:a}}const O6e=[{key:"all",label:"home.tabs.allTasks",icon:x0},{key:"workflow",label:"home.tabs.workflow",icon:nm},{key:"lite",label:"home.tabs.liteTasks",icon:Gh}],I6e={in_progress:Vn,running:Vn,planning:zz,completed:Wh,failed:Qa,paused:ine,pending:to,cancelled:Qa,idle:to,initializing:Vn,ready:Wh},R6e={in_progress:"bg-warning/20 text-warning border-warning/30",running:"bg-warning/20 text-warning border-warning/30",planning:"bg-violet-500/20 text-violet-600 border-violet-500/30",completed:"bg-success/20 text-success border-success/30",failed:"bg-destructive/20 text-destructive border-destructive/30",paused:"bg-slate-400/20 text-slate-500 border-slate-400/30",pending:"bg-muted text-muted-foreground border-border",cancelled:"bg-destructive/20 text-destructive border-destructive/30",idle:"bg-muted text-muted-foreground border-border",initializing:"bg-info/20 text-info border-info/30",ready:"bg-success/20 text-success border-success/30"},n6={in_progress:"inProgress",running:"running",planning:"planning",completed:"completed",failed:"failed",paused:"paused",pending:"pending",cancelled:"cancelled",idle:"idle",initializing:"initializing",ready:"ready"},N6e={"lite-plan":zz,"lite-fix":ju,"multi-cli-plan":Uz},M6e={all:"bg-muted text-muted-foreground",workflow:"bg-primary/20 text-primary",lite:"bg-amber-500/20 text-amber-600"};function j6e({item:e,onClick:t}){const{formatMessage:r}=$t(),n=I6e[e.status]||to,i=e.subType?N6e[e.subType]||Gh:e.type==="workflow"?nm:Gh,o=e.status==="in_progress"||e.status==="running"||e.status==="initializing";return w.jsx("button",{onClick:t,className:"w-full text-left p-3 rounded-lg border border-border bg-card hover:bg-accent/50 hover:border-primary/30 transition-all group",children:w.jsxs("div",{className:"flex items-start gap-2.5 min-w-0",children:[w.jsx("div",{className:he("p-1.5 rounded-md shrink-0",M6e[e.type]),children:w.jsx(i,{className:"h-4 w-4"})}),w.jsxs("div",{className:"flex-1 min-w-0 overflow-hidden",children:[w.jsxs("div",{className:"flex items-start gap-2 mb-1 min-w-0",children:[w.jsx("h4",{className:"text-sm font-medium text-foreground truncate flex-1 min-w-0 group-hover:text-primary transition-colors",children:e.name}),w.jsxs(Gn,{className:he("text-[10px] px-1.5 py-0 shrink-0 border",R6e[e.status]),children:[w.jsx(n,{className:he("h-2.5 w-2.5 mr-0.5",o&&"animate-spin")}),r({id:`common.status.${e.statusKey}`})]})]}),e.description&&w.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2 mb-1.5",children:e.description}),typeof e.progress=="number"&&e.progress>0&&w.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[w.jsx(ab,{value:e.progress,className:"h-1 flex-1 bg-muted"}),w.jsxs("span",{className:"text-[10px] text-muted-foreground w-8 text-right",children:[e.progress,"%"]})]}),w.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[w.jsxs("span",{className:"flex items-center gap-0.5 text-[10px] text-muted-foreground",children:[w.jsx(to,{className:"h-2.5 w-2.5"}),e.createdAt]}),e.subType&&w.jsx(Gn,{variant:"outline",className:"text-[9px] px-1 py-0 bg-background",children:e.subType}),e.tags&&e.tags.slice(0,2).map(s=>w.jsxs(Gn,{variant:"outline",className:"text-[9px] px-1 py-0 gap-0.5 bg-background",children:[w.jsx(One,{className:"h-2 w-2"}),s]},s)),e.tags&&e.tags.length>2&&w.jsxs("span",{className:"text-[9px] text-muted-foreground",children:["+",e.tags.length-2]})]})]})]})})}function D6e(){return w.jsx("div",{className:"p-3 rounded-lg border border-border bg-card animate-pulse",children:w.jsxs("div",{className:"flex items-start gap-2.5",children:[w.jsx("div",{className:"w-8 h-8 rounded-md bg-muted"}),w.jsxs("div",{className:"flex-1",children:[w.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[w.jsx("div",{className:"h-4 bg-muted rounded flex-1"}),w.jsx("div",{className:"h-4 w-16 bg-muted rounded"})]}),w.jsx("div",{className:"h-3 bg-muted rounded w-3/4 mb-2"}),w.jsxs("div",{className:"flex gap-2",children:[w.jsx("div",{className:"h-3 w-16 bg-muted rounded"}),w.jsx("div",{className:"h-3 w-12 bg-muted rounded"})]})]})]})})}function L6e({className:e,maxItems:t=6}){const{formatMessage:r}=$t(),n=Sc(),[i,o]=O.useState("all"),{activeSessions:s,isLoading:a}=$H({filter:{location:"active"}}),{allSessions:l,isLoading:c}=A6e(),d=O.useCallback(m=>{if(!m)return r({id:"common.time.justNow"});const v=new Date(m);if(isNaN(v.getTime()))return r({id:"common.time.justNow"});const x=new Date().getTime()-v.getTime(),E=Math.floor(x/6e4),C=Math.floor(E/60),k=Math.floor(C/24);return E<1?r({id:"common.time.justNow"}):E<60?r({id:"common.time.minutesAgo"},{count:E}):C<24?r({id:"common.time.hoursAgo"},{count:C}):r({id:"common.time.daysAgo"},{count:k})},[r]),u=O.useMemo(()=>{const m=[];return s.forEach(v=>{const b=v.status||"pending";m.push({id:v.session_id,name:v.title||v.description||v.session_id,type:"workflow",status:b,statusKey:n6[b]||b,createdAt:d(v.created_at),description:v.description||`Session: ${v.session_id}`,tags:[],progress:void 0})}),l.forEach(v=>{const b=v.status||"pending",x=v.session_id||v.id;m.push({id:x,name:v.title||x,type:"lite",subType:v._type,status:b,statusKey:n6[b]||b,createdAt:d(v.createdAt),description:v.description||`${v._type} task`,tags:[],progress:void 0})}),m},[s,l,d]),p=O.useMemo(()=>i==="all"?u.slice(0,t):u.filter(m=>m.type===i).slice(0,t),[u,i,t]),g=m=>{switch(m.type){case"workflow":n(`/sessions/${m.id}`);break;case"lite":n(`/lite-tasks/${m.subType}/${m.id}`);break}},_=()=>{n("/sessions")},y=a||c;return w.jsx("div",{className:e,children:w.jsxs(dd,{className:"h-full p-4 flex flex-col",children:[w.jsxs("div",{className:"flex items-center justify-between mb-3",children:[w.jsx("h3",{className:"text-sm font-semibold text-foreground",children:r({id:"home.sections.recentTasks"})}),w.jsx(Ye,{variant:"link",size:"sm",className:"text-xs h-auto p-0",onClick:_,children:r({id:"common.actions.viewAll"})})]}),w.jsx("div",{className:"flex gap-1 mb-3 overflow-x-auto pb-1",children:O6e.map(m=>{const v=m.icon,b=m.key==="all"?u.length:u.filter(x=>x.type===m.key).length;return w.jsxs(Ye,{variant:i===m.key?"default":"ghost",size:"sm",onClick:()=>o(m.key),className:he("whitespace-nowrap text-xs gap-1 h-7 px-2",i===m.key&&"bg-primary text-primary-foreground"),children:[w.jsx(v,{className:"h-3 w-3"}),r({id:m.label}),w.jsxs("span",{className:"text-[10px] opacity-70",children:["(",b,")"]})]},m.key)})}),w.jsx("div",{className:"flex-1 overflow-auto",children:y?w.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-2",children:Array.from({length:6}).map((m,v)=>w.jsx(D6e,{},v))}):p.length===0?w.jsxs("div",{className:"flex flex-col items-center justify-center py-8",children:[w.jsx(x0,{className:"h-10 w-10 text-muted-foreground mb-2"}),w.jsx("p",{className:"text-sm text-muted-foreground",children:r({id:"home.emptyState.noTasks.message"})})]}):w.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-2",children:p.map(m=>w.jsx(j6e,{item:m,onClick:()=>g(m)},`${m.type}-${m.id}`))})})]})})}const $6e=O.memo(L6e);function B6e(){const{formatMessage:e}=$t(),[t,r]=O.useState(!1),n=()=>{window.location.reload()};return w.jsxs("div",{className:"space-y-6",children:[w.jsx(GTe,{titleKey:"home.dashboard.title",descriptionKey:"home.dashboard.description",onRefresh:n}),t&&w.jsxs("div",{className:"flex items-center gap-2 p-4 rounded-lg bg-destructive/10 border border-destructive/30 text-destructive",children:[w.jsx(Ds,{className:"h-5 w-5 flex-shrink-0"}),w.jsxs("div",{className:"flex-1",children:[w.jsx("p",{className:"text-sm font-medium",children:e({id:"home.errors.loadFailed"})}),w.jsx("p",{className:"text-xs mt-0.5",children:e({id:"common.errors.unknownError"})})]}),w.jsx(Ye,{variant:"outline",size:"sm",onClick:n,children:e({id:"home.errors.retry"})})]}),w.jsxs("div",{className:"flex flex-col gap-4",children:[w.jsx(P6e,{}),w.jsx($6e,{})]})]})}const F6e=O.lazy(()=>Lt(()=>import("./SessionsPage-BENFqFDn.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8])).then(e=>({default:e.SessionsPage}))),z6e=O.lazy(()=>Lt(()=>import("./FixSessionPage-BTFYoFQF.js"),[]).then(e=>({default:e.FixSessionPage}))),U6e=O.lazy(()=>Lt(()=>import("./ProjectOverviewPage-gWuAj-Cn.js"),__vite__mapDeps([9,10,11,12,13,14])).then(e=>({default:e.ProjectOverviewPage}))),H6e=O.lazy(()=>Lt(()=>import("./SessionDetailPage-C_ig6JSh.js"),__vite__mapDeps([15,16,17,1,18,2,19,20,21,22,13,4,6])).then(e=>({default:e.SessionDetailPage}))),q6e=O.lazy(()=>Lt(()=>import("./HistoryPage-rzLVsw11.js"),__vite__mapDeps([23,24,20,25,26,3,4,27,28,5,7])).then(e=>({default:e.HistoryPage}))),W6e=O.lazy(()=>Lt(()=>import("./OrchestratorPage-1jzSUFZW.js"),__vite__mapDeps([29,19,30,1,31,32,33,34,12,7,35,36,37,21])).then(e=>({default:e.OrchestratorPage}))),V6e=O.lazy(()=>Lt(()=>import("./IssueHubPage-DHwQWuUc.js"),__vite__mapDeps([38,10,3,11,1,39,26,36,40,41,42,14,43,37,7])).then(e=>({default:e.IssueHubPage}))),G6e=O.lazy(()=>Lt(()=>import("./SkillsManagerPage-GLo6DXnt.js"),__vite__mapDeps([44,6,16,41,45,3,1,42,46,27,20,4,11,7,47,48,49,50,51,52,33,32,36,35,21])).then(e=>({default:e.SkillsManagerPage}))),K6e=O.lazy(()=>Lt(()=>import("./CommandsManagerPage-B6DBb_Ew.js"),__vite__mapDeps([53,6,31,32,52,16,47,48,49,20,50,4,7])).then(e=>({default:e.CommandsManagerPage}))),X6e=O.lazy(()=>Lt(()=>import("./MemoryPage-DhYPE-VC.js"),__vite__mapDeps([54,6,4,55,1,56,7,57,5,26,11,58,59])).then(e=>({default:e.MemoryPage}))),Z6e=O.lazy(()=>Lt(()=>import("./SettingsPage-2c-oTxfz.js"),__vite__mapDeps([60,41,61,62,2,18,63,50,4,12,64,27,37,22,20])).then(e=>({default:e.SettingsPage}))),Q6e=O.lazy(()=>Lt(()=>import("./NotFoundPage-BLmC7-ot.js"),[]).then(e=>({default:e.NotFoundPage}))),Y6e=O.lazy(()=>Lt(()=>import("./LiteTasksPage-DMDkG7pi.js"),__vite__mapDeps([65,6,17,16,1,18,2,19,20,21,22,7,24,26,27,43,30])).then(e=>({default:e.LiteTasksPage}))),J6e=O.lazy(()=>Lt(()=>import("./ReviewSessionPage-DX1uT_nH.js"),__vite__mapDeps([66,1])).then(e=>({default:e.ReviewSessionPage}))),eze=O.lazy(()=>Lt(()=>import("./McpManagerPage-CS2v_1OG.js"),__vite__mapDeps([67,41,51,50,4,46,27,18,45,47,48,49,20,68,12,24,1,8,40,55,6,34,11])).then(e=>({default:e.McpManagerPage}))),tze=O.lazy(()=>Lt(()=>import("./EndpointsPage-Bu7iU0Wy.js"),__vite__mapDeps([69,70,62,32,52,71,45,11])).then(e=>({default:e.EndpointsPage}))),rze=O.lazy(()=>Lt(()=>import("./InstallationsPage-BFamuE4y.js"),__vite__mapDeps([72,70,62,32,22,37])).then(e=>({default:e.InstallationsPage}))),nze=O.lazy(()=>Lt(()=>import("./HookManagerPage-DizO_dCP.js"),__vite__mapDeps([73,41,45,11,63,70,62,32,74,75])).then(e=>({default:e.HookManagerPage}))),ize=O.lazy(()=>Lt(()=>import("./RulesManagerPage-Bg6T5W-W.js"),__vite__mapDeps([76,70,62,32,52,20,3,11,6,7,51,8])).then(e=>({default:e.RulesManagerPage}))),oze=O.lazy(()=>Lt(()=>import("./PromptHistoryPage-q7ySVNHM.js"),__vite__mapDeps([77,26,57,14,75,27,28,1,39,8])).then(e=>({default:e.PromptHistoryPage}))),sze=O.lazy(()=>Lt(()=>import("./ExplorerPage-xim2cboZ.js"),__vite__mapDeps([78,49,20,36,35])).then(e=>({default:e.ExplorerPage}))),aze=O.lazy(()=>Lt(()=>import("./GraphExplorerPage-DJ4YnFOQ.js"),__vite__mapDeps([79,19,8,1,22,80,21])).then(e=>({default:e.GraphExplorerPage}))),lze=O.lazy(()=>Lt(()=>import("./CodexLensManagerPage-ClPNashJ.js"),__vite__mapDeps([81,6,41,62,32,50,4,27,45,1,16,12,8,22,68])).then(e=>({default:e.CodexLensManagerPage}))),cze=O.lazy(()=>Lt(()=>import("./ApiSettingsPage-CU9hesAE.js"),__vite__mapDeps([82,6,52,83,62,32,3,11,16,50,4,41,1,68,12,18,22])).then(e=>({default:e.ApiSettingsPage}))),uze=O.lazy(()=>Lt(()=>import("./CliViewerPage-_wUoHaY-.js"),__vite__mapDeps([84,85,86,87,80,56,10,7])).then(e=>({default:e.CliViewerPage}))),dze=O.lazy(()=>Lt(()=>import("./CliSessionSharePage-oKN-GRIT.js"),[]).then(e=>({default:e.CliSessionSharePage}))),fze=O.lazy(()=>Lt(()=>import("./TeamPage-C2IsDkAv.js"),__vite__mapDeps([88,6,52,8,1,22,20,25,3,4,58,5,7])).then(e=>({default:e.TeamPage}))),hze=O.lazy(()=>Lt(()=>import("./TerminalDashboardPage-mgS-iKDm.js"),__vite__mapDeps([89,85,86,83,62,32,20,90,10,7,49,41,1,48,63,74,40,28,50,4])).then(e=>({default:e.TerminalDashboardPage}))),pze=O.lazy(()=>Lt(()=>import("./AnalysisPage-Duxia_dG.js"),__vite__mapDeps([91,6,87,80,56,7,1])).then(e=>({default:e.AnalysisPage}))),mze=O.lazy(()=>Lt(()=>import("./SpecsSettingsPage-CRqMV90p.js"),__vite__mapDeps([92,52,1,3,4,11,51,20,12,61,71,8,39,90])).then(e=>({default:e.SpecsSettingsPage}))),gze=O.lazy(()=>Lt(()=>import("./DeepWikiPage-CDA3xm3R.js"),__vite__mapDeps([93,6,64,1,26,30])).then(e=>({default:e.DeepWikiPage})));function Gt(e){return w.jsx(WTe,{children:w.jsx(O.Suspense,{fallback:w.jsx(VTe,{}),children:e})})}const vze=[{path:"cli-sessions/share",element:Gt(w.jsx(dze,{}))},{path:"/",element:w.jsx(HTe,{}),children:[{index:!0,element:w.jsx(B6e,{})},{path:"sessions",element:Gt(w.jsx(F6e,{}))},{path:"sessions/:sessionId",element:Gt(w.jsx(H6e,{}))},{path:"sessions/:sessionId/fix",element:Gt(w.jsx(z6e,{}))},{path:"sessions/:sessionId/review",element:Gt(w.jsx(J6e,{}))},{path:"lite-tasks",element:Gt(w.jsx(Y6e,{}))},{path:"project",element:Gt(w.jsx(U6e,{}))},{path:"history",element:Gt(w.jsx(q6e,{}))},{path:"orchestrator",element:Gt(w.jsx(W6e,{}))},{path:"loops",element:w.jsx($g,{to:"/terminal-dashboard",replace:!0})},{path:"cli-viewer",element:Gt(w.jsx(uze,{}))},{path:"issues",element:Gt(w.jsx(V6e,{}))},{path:"issues/queue",element:w.jsx($g,{to:"/issues?tab=queue",replace:!0})},{path:"issues/discovery",element:w.jsx($g,{to:"/issues?tab=discovery",replace:!0})},{path:"skills",element:Gt(w.jsx(G6e,{}))},{path:"commands",element:Gt(w.jsx(K6e,{}))},{path:"memory",element:Gt(w.jsx(X6e,{}))},{path:"prompts",element:Gt(w.jsx(oze,{}))},{path:"settings",element:Gt(w.jsx(Z6e,{}))},{path:"settings/mcp",element:Gt(w.jsx(eze,{}))},{path:"settings/endpoints",element:Gt(w.jsx(tze,{}))},{path:"settings/installations",element:Gt(w.jsx(rze,{}))},{path:"settings/rules",element:Gt(w.jsx(ize,{}))},{path:"settings/specs",element:Gt(w.jsx(mze,{}))},{path:"settings/codexlens",element:Gt(w.jsx(lze,{}))},{path:"api-settings",element:Gt(w.jsx(cze,{}))},{path:"hooks",element:Gt(w.jsx(nze,{}))},{path:"explorer",element:Gt(w.jsx(sze,{}))},{path:"graph",element:Gt(w.jsx(aze,{}))},{path:"teams",element:Gt(w.jsx(fze,{}))},{path:"analysis",element:Gt(w.jsx(pze,{}))},{path:"deepwiki",element:Gt(w.jsx(gze,{}))},{path:"terminal-dashboard",element:Gt(w.jsx(hze,{}))},{path:"skill-hub",element:w.jsx($g,{to:"/skills?tab=hub",replace:!0})},{path:"*",element:Gt(w.jsx(Q6e,{}))}]}],yze="/".replace(/\/$/,"")||"",bze=UJ(vze,{basename:yze}),PP=new oY({defaultOptions:{queries:{staleTime:1e3*60*5,gcTime:1e3*60*10,retry:1,refetchOnWindowFocus:!1},mutations:{retry:1}}});function _ze({locale:e,messages:t}){return O.useEffect(()=>{nU().catch(console.error),Cle().catch(()=>{})},[]),w.jsx(Ute,{locale:e,messages:t,children:w.jsx(sY,{client:PP,children:w.jsxs(c0e,{children:[w.jsx(xze,{}),w.jsx(wze,{}),w.jsx(Sze,{}),w.jsx(ZJ,{router:bze}),w.jsx(mre,{richColors:!0,position:"top-right"})]})})})}function xze(){const e=At(t=>t.registerQueryInvalidator);return O.useEffect(()=>{e(()=>{Un.getState().resetState(),li.getState().resetState(),dA.getState().resetState(),Hd.getState().resetState(),Tk.getState().resetState(),Ud.getState().resetState();const r=nc.getState();r.resetState(),At.getState().projectPath&&r.loadInitialState().catch(i=>{console.error("[QueueSchedulerSync] Failed to sync scheduler state:",i)}),zn.getState().resetState(),_ce.getState().resetWorkspaceState(),PP.invalidateQueries({queryKey:eO}),PP.invalidateQueries({predicate:i=>{const o=i.queryKey;if(!Array.isArray(o))return!1;const s=o[0];return s==="workspace"||s==="projectOverview"||s==="workflowStatusCounts"||s==="dashboardStats"}})})},[e]),null}function wze(){const e=At(sr),t=li(r=>r.setSessions);return O.useEffect(()=>{let r=!1;return e?(zU(e).then(({sessions:n})=>{r||t(n)}).catch(n=>{console.error("[CliSessionSync] Failed to sync CLI sessions:",n),r||t([])}),()=>{r=!0}):(t([]),()=>{r=!0})},[e,t]),null}function Sze(){return k7(!0,15e3),null}let zX=-1;const mf=e=>{addEventListener("pageshow",(t=>{t.persisted&&(zX=t.timeStamp,e(t))}),!0)},cs=(e,t,r,n)=>{let i,o;return s=>{t.value>=0&&(s||n)&&(o=t.value-(i??0),(o||i===void 0)&&(i=t.value,t.delta=o,t.rating=((a,l)=>a>l[1]?"poor":a>l[0]?"needs-improvement":"good")(t.value,r),e(t)))}},M2=e=>{requestAnimationFrame((()=>requestAnimationFrame((()=>e()))))},j2=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Tm=()=>{const e=j2();return(e==null?void 0:e.activationStart)??0},us=(e,t=-1)=>{const r=j2();let n="navigate";return zX>=0?n="back-forward-cache":r&&(document.prerendering||Tm()>0?n="prerender":document.wasDiscarded?n="restore":r.type&&(n=r.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:n}},DE=new WeakMap;function D2(e,t){return DE.get(e)||DE.set(e,new t),DE.get(e)}class Cze{constructor(){_o(this,"t");_o(this,"i",0);_o(this,"o",[])}h(t){var i;if(t.hadRecentInput)return;const r=this.o[0],n=this.o.at(-1);this.i&&r&&n&&t.startTime-n.startTime<1e3&&t.startTime-r.startTime<5e3?(this.i+=t.value,this.o.push(t)):(this.i=t.value,this.o=[t]),(i=this.t)==null||i.call(this,t)}}const Pm=(e,t,r={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const n=new PerformanceObserver((i=>{Promise.resolve().then((()=>{t(i.getEntries())}))}));return n.observe({type:e,buffered:!0,...r}),n}}catch{}},L2=e=>{let t=!1;return()=>{t||(e(),t=!0)}};let Nu=-1;const UX=new Set,i6=()=>document.visibilityState!=="hidden"||document.prerendering?1/0:0,AP=e=>{if(document.visibilityState==="hidden"){if(e.type==="visibilitychange")for(const t of UX)t();isFinite(Nu)||(Nu=e.type==="visibilitychange"?e.timeStamp:0,removeEventListener("prerenderingchange",AP,!0))}},Vb=()=>{var e;if(Nu<0){const t=Tm();Nu=(document.prerendering||(e=globalThis.performance.getEntriesByType("visibility-state").filter((n=>n.name==="hidden"&&n.startTime>t))[0])==null?void 0:e.startTime)??i6(),addEventListener("visibilitychange",AP,!0),addEventListener("prerenderingchange",AP,!0),mf((()=>{setTimeout((()=>{Nu=i6()}))}))}return{get firstHiddenTime(){return Nu},onHidden(t){UX.add(t)}}},Gb=e=>{document.prerendering?addEventListener("prerenderingchange",(()=>e()),!0):e()},o6=[1800,3e3],HX=(e,t={})=>{Gb((()=>{const r=Vb();let n,i=us("FCP");const o=Pm("paint",(s=>{for(const a of s)a.name==="first-contentful-paint"&&(o.disconnect(),a.startTime<r.firstHiddenTime&&(i.value=Math.max(a.startTime-Tm(),0),i.entries.push(a),n(!0)))}));o&&(n=cs(e,i,o6,t.reportAllChanges),mf((s=>{i=us("FCP"),n=cs(e,i,o6,t.reportAllChanges),M2((()=>{i.value=performance.now()-s.timeStamp,n(!0)}))})))}))},s6=[.1,.25],Eze=(e,t={})=>{const r=Vb();HX(L2((()=>{let n,i=us("CLS",0);const o=D2(t,Cze),s=l=>{for(const c of l)o.h(c);o.i>i.value&&(i.value=o.i,i.entries=o.o,n())},a=Pm("layout-shift",s);a&&(n=cs(e,i,s6,t.reportAllChanges),r.onHidden((()=>{s(a.takeRecords()),n(!0)})),mf((()=>{o.i=0,i=us("CLS",0),n=cs(e,i,s6,t.reportAllChanges),M2((()=>n()))})),setTimeout(n))})))};let qX=0,LE=1/0,wv=0;const kze=e=>{for(const t of e)t.interactionId&&(LE=Math.min(LE,t.interactionId),wv=Math.max(wv,t.interactionId),qX=wv?(wv-LE)/7+1:0)};let OP;const a6=()=>OP?qX:performance.interactionCount??0,Tze=()=>{"interactionCount"in performance||OP||(OP=Pm("event",kze,{type:"event",buffered:!0,durationThreshold:0}))};let l6=0;class Pze{constructor(){_o(this,"u",[]);_o(this,"l",new Map);_o(this,"m");_o(this,"p")}v(){l6=a6(),this.u.length=0,this.l.clear()}L(){const t=Math.min(this.u.length-1,Math.floor((a6()-l6)/50));return this.u[t]}h(t){var i,o;if((i=this.m)==null||i.call(this,t),!t.interactionId&&t.entryType!=="first-input")return;const r=this.u.at(-1);let n=this.l.get(t.interactionId);if(n||this.u.length<10||t.duration>r.P){if(n?t.duration>n.P?(n.entries=[t],n.P=t.duration):t.duration===n.P&&t.startTime===n.entries[0].startTime&&n.entries.push(t):(n={id:t.interactionId,entries:[t],P:t.duration},this.l.set(n.id,n),this.u.push(n)),this.u.sort(((s,a)=>a.P-s.P)),this.u.length>10){const s=this.u.splice(10);for(const a of s)this.l.delete(a.id)}(o=this.p)==null||o.call(this,n)}}}const WX=e=>{const t=globalThis.requestIdleCallback||setTimeout;document.visibilityState==="hidden"?e():(e=L2(e),addEventListener("visibilitychange",e,{once:!0,capture:!0}),t((()=>{e(),removeEventListener("visibilitychange",e,{capture:!0})})))},c6=[200,500],Aze=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const r=Vb();Gb((()=>{Tze();let n,i=us("INP");const o=D2(t,Pze),s=l=>{WX((()=>{for(const d of l)o.h(d);const c=o.L();c&&c.P!==i.value&&(i.value=c.P,i.entries=c.entries,n())}))},a=Pm("event",s,{durationThreshold:t.durationThreshold??40});n=cs(e,i,c6,t.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),r.onHidden((()=>{s(a.takeRecords()),n(!0)})),mf((()=>{o.v(),i=us("INP"),n=cs(e,i,c6,t.reportAllChanges)})))}))};class Oze{constructor(){_o(this,"m")}h(t){var r;(r=this.m)==null||r.call(this,t)}}const u6=[2500,4e3],Ize=(e,t={})=>{Gb((()=>{const r=Vb();let n,i=us("LCP");const o=D2(t,Oze),s=l=>{t.reportAllChanges||(l=l.slice(-1));for(const c of l)o.h(c),c.startTime<r.firstHiddenTime&&(i.value=Math.max(c.startTime-Tm(),0),i.entries=[c],n())},a=Pm("largest-contentful-paint",s);if(a){n=cs(e,i,u6,t.reportAllChanges);const l=L2((()=>{s(a.takeRecords()),a.disconnect(),n(!0)})),c=d=>{d.isTrusted&&(WX(l),removeEventListener(d.type,c,{capture:!0}))};for(const d of["keydown","click","visibilitychange"])addEventListener(d,c,{capture:!0});mf((d=>{i=us("LCP"),n=cs(e,i,u6,t.reportAllChanges),M2((()=>{i.value=performance.now()-d.timeStamp,n(!0)}))}))}}))},d6=[800,1800],IP=e=>{document.prerendering?Gb((()=>IP(e))):document.readyState!=="complete"?addEventListener("load",(()=>IP(e)),!0):setTimeout(e)},Rze=(e,t={})=>{let r=us("TTFB"),n=cs(e,r,d6,t.reportAllChanges);IP((()=>{const i=j2();i&&(r.value=Math.max(i.responseStart-Tm(),0),r.entries=[i],n(!0),mf((()=>{r=us("TTFB",0),n=cs(e,r,d6,t.reportAllChanges),n(!0)})))}))},Eu={LCP:2500,INP:200,CLS:.1,FCP:1800,TTFB:600};function _h(e,t){switch(e){case"LCP":return t<=Eu.LCP;case"INP":return t<=Eu.INP;case"CLS":return t<=Eu.CLS;case"FCP":return t<=Eu.FCP;case"TTFB":return t<=Eu.TTFB;default:return!0}}function xh(e,t){const r=Eu[e];if(!r||t<=r)return"good";const n=r*1.25;return t<=n?"needs-improvement":"poor"}function Nze(e,t=!1){Ize(r=>{const n={...r,vitalsName:"LCP",isBad:!_h("LCP",r.value),rating:xh("LCP",r.value)};e(n)}),Aze(r=>{const n={...r,vitalsName:"INP",isBad:!_h("INP",r.value),rating:xh("INP",r.value)};e(n)}),Eze(r=>{const n={...r,vitalsName:"CLS",isBad:!_h("CLS",r.value),rating:xh("CLS",r.value)};e(n)}),t&&(HX(r=>{const n={...r,vitalsName:"FCP",isBad:!_h("FCP",r.value),rating:xh("FCP",r.value)};e(n)}),Rze(r=>{const n={...r,vitalsName:"TTFB",isBad:!_h("TTFB",r.value),rating:xh("TTFB",r.value)};e(n)}))}function Mze(){Nze(e=>{const t=e.isBad?"background: #ff6b6b; color: white; padding: 2px 6px; border-radius: 3px;":"background: #51cf66; color: white; padding: 2px 6px; border-radius: 3px;";console.log(`%c${e.vitalsName}%c ${e.value.toFixed(2)}ms (${e.rating})`,t,"background: none;")})}async function jze(){const e=document.getElementById("root");if(!e)throw new Error("Failed to find the root element");const t=await Hv(),r=await Jne(t);DQ.createRoot(e).render(w.jsx(O.StrictMode,{children:w.jsx(_ze,{locale:t,messages:r})})),Mze()}jze().catch(e=>{console.error("Failed to bootstrap application:",e)});export{one as $,Yd as A,Gn as B,dd as C,t0e as D,v8 as E,une as F,Qd as G,Fze as H,O0 as I,Jre as J,Qa as K,Vh as L,_0 as M,Vn as N,Re as O,w6e as P,DUe as Q,eA as R,tA as S,rA as T,Uv as U,_M as V,ju as W,Di as X,tne as Y,Gh as Z,Uze as _,IO as a,nm as a$,SM as a0,Uz as a1,Qj as a2,Fk as a3,oy as a4,z0e as a5,kne as a6,Ene as a7,rne as a8,At as a9,Lze as aA,vY as aB,Ce as aC,nle as aD,OU as aE,Rn as aF,Z as aG,ki as aH,coe as aI,uoe as aJ,doe as aK,loe as aL,goe as aM,Ine as aN,poe as aO,es as aP,vk as aQ,sne as aR,Rne as aS,moe as aT,dne as aU,bne as aV,zle as aW,qle as aX,Jze as aY,Dle as aZ,Yze as a_,sr as aa,ui as ab,aoe as ac,tm as ad,yk as ae,Gx as af,foe as ag,hoe as ah,rV as ai,nV as aj,One as ak,jle as al,CM as am,lne as an,$z as ao,ea as ap,jEe as aq,bW as ar,DEe as as,wW as at,SW as au,Hz as av,Gz as aw,YQ as ax,EN as ay,$ze as az,Wz as b,qie as b$,b0e as b0,x0e as b1,li as b2,zU as b3,C0 as b4,Fz as b5,iUe as b6,Cne as b7,NP as b8,wc as b9,co as bA,Ue as bB,os as bC,D0 as bD,sEe as bE,CUe as bF,Li as bG,R0 as bH,UH as bI,Cn as bJ,kc as bK,Uie as bL,Fie as bM,zie as bN,CO as bO,St as bP,dc as bQ,Tt as bR,sl as bS,$ie as bT,Wze as bU,Die as bV,Lie as bW,Lt as bX,jie as bY,Vie as bZ,Gie as b_,BP as ba,$d as bb,gUe as bc,yUe as bd,qz as be,TO as bf,_Ue as bg,Ud as bh,rle as bi,zn as bj,Rae as bk,Nae as bl,BH as bm,bUe as bn,vUe as bo,ab as bp,Ec as bq,xUe as br,zze as bs,Mie as bt,Co as bu,Nie as bv,jt as bw,EUe as bx,ut as by,No as bz,he as c,joe as c$,Wie as c0,Hie as c1,Hze as c2,Xie as c3,Zie as c4,Qie as c5,Yie as c6,Jie as c7,Kie as c8,ale as c9,Nne as cA,JP as cB,yne as cC,q9 as cD,kk as cE,Xze as cF,Zze as cG,Qze as cH,xne as cI,rm as cJ,_ne as cK,hne as cL,Ev as cM,A6e as cN,zz as cO,boe as cP,Tne as cQ,IU as cR,yoe as cS,_oe as cT,woe as cU,Soe as cV,Coe as cW,Eoe as cX,Aoe as cY,Ooe as cZ,Doe as c_,ile as ca,ole as cb,sle as cc,eoe as cd,roe as ce,soe as cf,toe as cg,noe as ch,ioe as ci,ooe as cj,Bz as ck,cq as cl,Dq as cm,Dz as cn,Aie as co,Go as cp,oie as cq,OM as cr,wk as cs,Zz as ct,Qz as cu,eie as cv,IM as cw,Vze as cx,b0 as cy,vne as cz,r0e as d,Kt as d$,w0 as d0,Toe as d1,Moe as d2,xoe as d3,MU as d4,Poe as d5,bk as d6,lse as d7,ose as d8,cse as d9,Hoe as dA,qoe as dB,Woe as dC,Koe as dD,Zoe as dE,tse as dF,Joe as dG,Loe as dH,Uoe as dI,Goe as dJ,Qoe as dK,y6e as dL,mse as dM,gse as dN,yse as dO,vse as dP,dse as dQ,fse as dR,hse as dS,pse as dT,o0e as dU,Sse as dV,Oy as dW,bp as dX,l4 as dY,URe as dZ,ff as d_,sse as da,use as db,ise as dc,Roe as dd,Ioe as de,Noe as df,rse as dg,nse as dh,Tc as di,LU as dj,ase as dk,koe as dl,$U as dm,sA as dn,aA as dp,fne as dq,cne as dr,nne as ds,Xoe as dt,ese as du,Yoe as dv,zoe as dw,Boe as dx,$oe as dy,Foe as dz,Ye as e,ele as e$,kse as e0,Tse as e1,Pse as e2,Ase as e3,Ise as e4,Rse as e5,Nse as e6,Mse as e7,Dse as e8,Lse as e9,Oae as eA,Iae as eB,_0e as eC,Un as eD,uA as eE,PUe as eF,tUe as eG,nUe as eH,k7 as eI,eEe as eJ,rUe as eK,eUe as eL,Oh as eM,ibe as eN,dTe as eO,hTe as eP,gn as eQ,En as eR,im as eS,Xae as eT,Zae as eU,Qae as eV,Kae as eW,Yae as eX,Jae as eY,Vz as eZ,ene as e_,$se as ea,Fse as eb,Xse as ec,Zse as ed,Qse as ee,eae as ef,tae as eg,Wse as eh,Vse as ei,Gse as ej,Cse as ek,Ese as el,Ose as em,jse as en,Bse as eo,Yse as ep,zse as eq,Use as er,Hse as es,qse as et,Kse as eu,Jse as ev,Gae as ew,Lpe as ex,GW as ey,KW as ez,z9 as f,bae as f$,tle as f0,Tk as f1,fce as f2,dA as f3,hUe as f4,nc as f5,aV as f6,_ce as f7,uUe as f8,Hd as f9,bse as fA,wse as fB,Sae as fC,Cae as fD,oae as fE,iae as fF,sae as fG,aae as fH,dae as fI,uae as fJ,pae as fK,hae as fL,yae as fM,vae as fN,Pae as fO,Aae as fP,nae as fQ,cae as fR,gae as fS,_ae as fT,kae as fU,Tae as fV,xae as fW,rae as fX,lae as fY,fae as fZ,mae as f_,Lne as fa,lA as fb,UU as fc,HU as fd,cUe as fe,QM as ff,sUe as fg,mne as fh,lUe as fi,Qh as fj,oUe as fk,aUe as fl,lV as fm,ece as fn,OUe as fo,NUe as fp,IUe as fq,RUe as fr,MUe as fs,fUe as ft,dUe as fu,Bl as fv,nce as fw,CTe as fx,_se as fy,xse as fz,Rv as g,wae as g0,Eae as g1,TA as g2,mge as g3,kUe as g4,PA as g5,TUe as g6,hc as g7,Gd as g8,Kd as g9,zae as gA,Uae as gB,Hae as gC,lle as gD,ule as gE,dle as gF,ple as gG,hle as gH,iV as gI,Abe as gJ,ay as gK,Kze as gL,wUe as gM,tp as ga,Vd as gb,SUe as gc,Gze as gd,qze as ge,ATe as gf,uV as gg,dV as gh,hV as gi,jUe as gj,gle as gk,mle as gl,Q0 as gm,gO as gn,jae as go,Lae as gp,Bae as gq,Fae as gr,Wae as gs,Vae as gt,qae as gu,fle as gv,cle as gw,Mae as gx,Dae as gy,$ae as gz,$k as h,xM as i,w as j,Wh as k,to as l,Ds as m,Sc as n,xt as o,$H as p,pUe as q,O as r,_ie as s,mUe as t,$t as u,U9 as v,x0 as w,lm as x,Xd as y,Zd as z};
|
|
708
|
-
//# sourceMappingURL=index-
|
|
707
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jX(e,t){if(e){if(typeof e=="string")return kP(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return kP(e,t)}}function t6e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function r6e(e){if(Array.isArray(e))return kP(e)}function kP(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function XF(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ye(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?XF(Object(r),!0).forEach(function(n){lt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):XF(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function lt(e,t,r){return t=DX(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function DX(e){var t=n6e(e,"string");return jd(t)=="symbol"?t:t+""}function n6e(e,t){if(jd(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(jd(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var i6e={xAxis:["bottom","top"],yAxis:["left","right"]},o6e={width:"100%",height:"100%"},LX={x:0,y:0};function _v(e){return e}var s6e=function(t,r){return r==="horizontal"?t.x:r==="vertical"?t.y:r==="centric"?t.angle:t.radius},a6e=function(t,r,n,i){var o=r.find(function(d){return d&&d.index===n});if(o){if(t==="horizontal")return{x:o.coordinate,y:i.y};if(t==="vertical")return{x:i.x,y:o.coordinate};if(t==="centric"){var s=o.coordinate,a=i.radius;return ye(ye(ye({},i),hr(i.cx,i.cy,a,s)),{},{angle:s,radius:a})}var l=o.coordinate,c=i.angle;return ye(ye(ye({},i),hr(i.cx,i.cy,l,c)),{},{angle:c,radius:l})}return LX},Wb=function(t,r){var n=r.graphicalItems,i=r.dataStartIndex,o=r.dataEndIndex,s=(n??[]).reduce(function(a,l){var c=l.props.data;return c&&c.length?[].concat(Dd(a),Dd(c)):a},[]);return s.length>0?s:t&&t.length&&Ne(i)&&Ne(o)?t.slice(i,o+1):[]};function $X(e){return e==="number"?[0,"auto"]:void 0}var TP=function(t,r,n,i){var o=t.graphicalItems,s=t.tooltipAxis,a=Wb(r,t);return n<0||!o||!o.length||n>=a.length?null:o.reduce(function(l,c){var d,u=(d=c.props.data)!==null&&d!==void 0?d:r;u&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(u=u.slice(t.dataStartIndex,t.dataEndIndex+1));var p;if(s.dataKey&&!s.allowDuplicatedCategory){var g=u===void 0?a:u;p=my(g,s.dataKey,i)}else p=u&&u[n]||a[n];return p?[].concat(Dd(l),[PK(c,p)]):l},[])},ZF=function(t,r,n,i){var o=i||{x:t.chartX,y:t.chartY},s=s6e(o,n),a=t.orderedTooltipTicks,l=t.tooltipAxis,c=t.tooltipTicks,d=Hje(s,a,c,l);if(d>=0&&c){var u=c[d]&&c[d].value,p=TP(t,r,d,u),g=a6e(n,a,d,o);return{activeTooltipIndex:d,activeLabel:u,activePayload:p,activeCoordinate:g}}return null},l6e=function(t,r){var n=r.axes,i=r.graphicalItems,o=r.axisType,s=r.axisIdKey,a=r.stackGroups,l=r.dataStartIndex,c=r.dataEndIndex,d=t.layout,u=t.children,p=t.stackOffset,g=SK(d,o);return n.reduce(function(_,y){var m,v=y.type.defaultProps!==void 0?ye(ye({},y.type.defaultProps),y.props):y.props,b=v.type,x=v.dataKey,E=v.allowDataOverflow,C=v.allowDuplicatedCategory,k=v.scale,P=v.ticks,T=v.includeHidden,I=v[s];if(_[I])return _;var N=Wb(t.data,{graphicalItems:i.filter(function(X){var W,le=s in X.props?X.props[s]:(W=X.type.defaultProps)===null||W===void 0?void 0:W[s];return le===I}),dataStartIndex:l,dataEndIndex:c}),B=N.length,M,F,U;MFe(v.domain,E,b)&&(M=zT(v.domain,null,E),g&&(b==="number"||k!=="auto")&&(U=Lh(N,x,"category")));var q=$X(b);if(!M||M.length===0){var V,K=(V=v.domain)!==null&&V!==void 0?V:q;if(x){if(M=Lh(N,x,b),b==="category"&&g){var D=DPe(M);C&&D?(F=M,M=t0(0,B)):C||(M=eB(K,M,y).reduce(function(X,W){return X.indexOf(W)>=0?X:[].concat(Dd(X),[W])},[]))}else if(b==="category")C?M=M.filter(function(X){return X!==""&&!mt(X)}):M=eB(K,M,y).reduce(function(X,W){return X.indexOf(W)>=0||W===""||mt(W)?X:[].concat(Dd(X),[W])},[]);else if(b==="number"){var $=Kje(N,i.filter(function(X){var W,le,ce=s in X.props?X.props[s]:(W=X.type.defaultProps)===null||W===void 0?void 0:W[s],ve="hide"in X.props?X.props.hide:(le=X.type.defaultProps)===null||le===void 0?void 0:le.hide;return ce===I&&(T||!ve)}),x,o,d);$&&(M=$)}g&&(b==="number"||k!=="auto")&&(U=Lh(N,x,"category"))}else g?M=t0(0,B):a&&a[I]&&a[I].hasStack&&b==="number"?M=p==="expand"?[0,1]:TK(a[I].stackGroups,l,c):M=wK(N,i.filter(function(X){var W=s in X.props?X.props[s]:X.type.defaultProps[s],le="hide"in X.props?X.props.hide:X.type.defaultProps.hide;return W===I&&(T||!le)}),b,d,!0);if(b==="number")M=CP(u,M,I,o,P),K&&(M=zT(K,M,E));else if(b==="category"&&K){var j=K,z=M.every(function(X){return j.indexOf(X)>=0});z&&(M=j)}}return ye(ye({},_),{},lt({},I,ye(ye({},v),{},{axisType:o,domain:M,categoricalDomain:U,duplicateDomain:F,originalDomain:(m=v.domain)!==null&&m!==void 0?m:q,isCategorical:g,layout:d})))},{})},c6e=function(t,r){var n=r.graphicalItems,i=r.Axis,o=r.axisType,s=r.axisIdKey,a=r.stackGroups,l=r.dataStartIndex,c=r.dataEndIndex,d=t.layout,u=t.children,p=Wb(t.data,{graphicalItems:n,dataStartIndex:l,dataEndIndex:c}),g=p.length,_=SK(d,o),y=-1;return n.reduce(function(m,v){var b=v.type.defaultProps!==void 0?ye(ye({},v.type.defaultProps),v.props):v.props,x=b[s],E=$X("number");if(!m[x]){y++;var C;return _?C=t0(0,g):a&&a[x]&&a[x].hasStack?(C=TK(a[x].stackGroups,l,c),C=CP(u,C,x,o)):(C=zT(E,wK(p,n.filter(function(k){var P,T,I=s in k.props?k.props[s]:(P=k.type.defaultProps)===null||P===void 0?void 0:P[s],N="hide"in k.props?k.props.hide:(T=k.type.defaultProps)===null||T===void 0?void 0:T.hide;return I===x&&!N}),"number",d),i.defaultProps.allowDataOverflow),C=CP(u,C,x,o)),ye(ye({},m),{},lt({},x,ye(ye({axisType:o},i.defaultProps),{},{hide:!0,orientation:Mi(i6e,"".concat(o,".").concat(y%2),null),domain:C,originalDomain:E,isCategorical:_,layout:d})))}return m},{})},u6e=function(t,r){var n=r.axisType,i=n===void 0?"xAxis":n,o=r.AxisComp,s=r.graphicalItems,a=r.stackGroups,l=r.dataStartIndex,c=r.dataEndIndex,d=t.children,u="".concat(i,"Id"),p=ji(d,o),g={};return p&&p.length?g=l6e(t,{axes:p,graphicalItems:s,axisType:i,axisIdKey:u,stackGroups:a,dataStartIndex:l,dataEndIndex:c}):s&&s.length&&(g=c6e(t,{Axis:o,graphicalItems:s,axisType:i,axisIdKey:u,stackGroups:a,dataStartIndex:l,dataEndIndex:c})),g},d6e=function(t){var r=Cu(t),n=Gl(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:JO(n,function(i){return i.coordinate}),tooltipAxis:r,tooltipAxisBandSize:zy(r,n)}},QF=function(t){var r=t.children,n=t.defaultShowTooltip,i=Ei(r,kd),o=0,s=0;return t.data&&t.data.length!==0&&(s=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(o=i.props.startIndex),i.props.endIndex>=0&&(s=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:s,activeTooltipIndex:-1,isTooltipActive:!!n}},f6e=function(t){return!t||!t.length?!1:t.some(function(r){var n=zs(r&&r.type);return n&&n.indexOf("Bar")>=0})},YF=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},h6e=function(t,r){var n=t.props,i=t.graphicalItems,o=t.xAxisMap,s=o===void 0?{}:o,a=t.yAxisMap,l=a===void 0?{}:a,c=n.width,d=n.height,u=n.children,p=n.margin||{},g=Ei(u,kd),_=Ei(u,zu),y=Object.keys(l).reduce(function(C,k){var P=l[k],T=P.orientation;return!P.mirror&&!P.hide?ye(ye({},C),{},lt({},T,C[T]+P.width)):C},{left:p.left||0,right:p.right||0}),m=Object.keys(s).reduce(function(C,k){var P=s[k],T=P.orientation;return!P.mirror&&!P.hide?ye(ye({},C),{},lt({},T,Mi(C,"".concat(T))+P.height)):C},{top:p.top||0,bottom:p.bottom||0}),v=ye(ye({},m),y),b=v.bottom;g&&(v.bottom+=g.props.height||kd.defaultProps.height),_&&r&&(v=Vje(v,i,n,r));var x=c-v.left-v.right,E=d-v.top-v.bottom;return ye(ye({brushBottom:b},v),{},{width:Math.max(x,0),height:Math.max(E,0)})},p6e=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},BX=function(t){var r=t.chartName,n=t.GraphicalChild,i=t.defaultTooltipEventType,o=i===void 0?"axis":i,s=t.validateTooltipEventTypes,a=s===void 0?["axis"]:s,l=t.axisComponents,c=t.legendContent,d=t.formatAxisMap,u=t.defaultProps,p=function(v,b){var x=b.graphicalItems,E=b.stackGroups,C=b.offset,k=b.updateId,P=b.dataStartIndex,T=b.dataEndIndex,I=v.barSize,N=v.layout,B=v.barGap,M=v.barCategoryGap,F=v.maxBarSize,U=YF(N),q=U.numericAxisName,V=U.cateAxisName,K=f6e(x),D=[];return x.forEach(function($,j){var z=Wb(v.data,{graphicalItems:[$],dataStartIndex:P,dataEndIndex:T}),X=$.type.defaultProps!==void 0?ye(ye({},$.type.defaultProps),$.props):$.props,W=X.dataKey,le=X.maxBarSize,ce=X["".concat(q,"Id")],ve=X["".concat(V,"Id")],H={},Q=l.reduce(function(nr,Pt){var Bt=b["".concat(Pt.axisType,"Map")],Tr=X["".concat(Pt.axisType,"Id")];Bt&&Bt[Tr]||Pt.axisType==="zAxis"||wc();var lr=Bt[Tr];return ye(ye({},nr),{},lt(lt({},Pt.axisType,lr),"".concat(Pt.axisType,"Ticks"),Gl(lr)))},H),Y=Q[V],ne=Q["".concat(V,"Ticks")],ge=E&&E[ce]&&E[ce].hasStack&&nDe($,E[ce].stackGroups),te=zs($.type).indexOf("Bar")>=0,Oe=zy(Y,ne),Ie=[],_e=K&&qje({barSize:I,stackGroups:E,totalSize:p6e(Q,V)});if(te){var rt,Me,je=mt(le)?F:le,Qe=(rt=(Me=zy(Y,ne,!0))!==null&&Me!==void 0?Me:je)!==null&&rt!==void 0?rt:0;Ie=Wje({barGap:B,barCategoryGap:M,bandSize:Qe!==Oe?Qe:Oe,sizeList:_e[ve],maxBarSize:je}),Qe!==Oe&&(Ie=Ie.map(function(nr){return ye(ye({},nr),{},{position:ye(ye({},nr.position),{},{offset:nr.position.offset-Qe/2})})}))}var pr=$&&$.type&&$.type.getComposedData;pr&&D.push({props:ye(ye({},pr(ye(ye({},Q),{},{displayedData:z,props:v,dataKey:W,item:$,bandSize:Oe,barPosition:Ie,offset:C,stackedData:ge,layout:N,dataStartIndex:P,dataEndIndex:T}))),{},lt(lt(lt({key:$.key||"item-".concat(j)},q,Q[q]),V,Q[V]),"animationId",k)),childIndex:XPe($,v.children),item:$})}),D},g=function(v,b){var x=v.props,E=v.dataStartIndex,C=v.dataEndIndex,k=v.updateId;if(!p3({props:x}))return null;var P=x.children,T=x.layout,I=x.stackOffset,N=x.data,B=x.reverseStackOrder,M=YF(T),F=M.numericAxisName,U=M.cateAxisName,q=ji(P,n),V=tDe(N,q,"".concat(F,"Id"),"".concat(U,"Id"),I,B),K=l.reduce(function(X,W){var le="".concat(W.axisType,"Map");return ye(ye({},X),{},lt({},le,u6e(x,ye(ye({},W),{},{graphicalItems:q,stackGroups:W.axisType===F&&V,dataStartIndex:E,dataEndIndex:C}))))},{}),D=h6e(ye(ye({},K),{},{props:x,graphicalItems:q}),b==null?void 0:b.legendBBox);Object.keys(K).forEach(function(X){K[X]=d(x,K[X],D,X.replace("Map",""),r)});var $=K["".concat(U,"Map")],j=d6e($),z=p(x,ye(ye({},K),{},{dataStartIndex:E,dataEndIndex:C,updateId:k,graphicalItems:q,stackGroups:V,offset:D}));return ye(ye({formattedGraphicalItems:z,graphicalItems:q,offset:D,stackGroups:V},j),K)},_=(function(m){function v(b){var x,E,C;return GFe(this,v),C=ZFe(this,v,[b]),lt(C,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),lt(C,"accessibilityManager",new NFe),lt(C,"handleLegendBBoxUpdate",function(k){if(k){var P=C.state,T=P.dataStartIndex,I=P.dataEndIndex,N=P.updateId;C.setState(ye({legendBBox:k},g({props:C.props,dataStartIndex:T,dataEndIndex:I,updateId:N},ye(ye({},C.state),{},{legendBBox:k}))))}}),lt(C,"handleReceiveSyncEvent",function(k,P,T){if(C.props.syncId===k){if(T===C.eventEmitterSymbol&&typeof C.props.syncMethod!="function")return;C.applySyncEvent(P)}}),lt(C,"handleBrushChange",function(k){var P=k.startIndex,T=k.endIndex;if(P!==C.state.dataStartIndex||T!==C.state.dataEndIndex){var I=C.state.updateId;C.setState(function(){return ye({dataStartIndex:P,dataEndIndex:T},g({props:C.props,dataStartIndex:P,dataEndIndex:T,updateId:I},C.state))}),C.triggerSyncEvent({dataStartIndex:P,dataEndIndex:T})}}),lt(C,"handleMouseEnter",function(k){var P=C.getMouseInfo(k);if(P){var T=ye(ye({},P),{},{isTooltipActive:!0});C.setState(T),C.triggerSyncEvent(T);var I=C.props.onMouseEnter;pt(I)&&I(T,k)}}),lt(C,"triggeredAfterMouseMove",function(k){var P=C.getMouseInfo(k),T=P?ye(ye({},P),{},{isTooltipActive:!0}):{isTooltipActive:!1};C.setState(T),C.triggerSyncEvent(T);var I=C.props.onMouseMove;pt(I)&&I(T,k)}),lt(C,"handleItemMouseEnter",function(k){C.setState(function(){return{isTooltipActive:!0,activeItem:k,activePayload:k.tooltipPayload,activeCoordinate:k.tooltipPosition||{x:k.cx,y:k.cy}}})}),lt(C,"handleItemMouseLeave",function(){C.setState(function(){return{isTooltipActive:!1}})}),lt(C,"handleMouseMove",function(k){k.persist(),C.throttleTriggeredAfterMouseMove(k)}),lt(C,"handleMouseLeave",function(k){C.throttleTriggeredAfterMouseMove.cancel();var P={isTooltipActive:!1};C.setState(P),C.triggerSyncEvent(P);var T=C.props.onMouseLeave;pt(T)&&T(P,k)}),lt(C,"handleOuterEvent",function(k){var P=KPe(k),T=Mi(C.props,"".concat(P));if(P&&pt(T)){var I,N;/.*touch.*/i.test(P)?N=C.getMouseInfo(k.changedTouches[0]):N=C.getMouseInfo(k),T((I=N)!==null&&I!==void 0?I:{},k)}}),lt(C,"handleClick",function(k){var P=C.getMouseInfo(k);if(P){var T=ye(ye({},P),{},{isTooltipActive:!0});C.setState(T),C.triggerSyncEvent(T);var I=C.props.onClick;pt(I)&&I(T,k)}}),lt(C,"handleMouseDown",function(k){var P=C.props.onMouseDown;if(pt(P)){var T=C.getMouseInfo(k);P(T,k)}}),lt(C,"handleMouseUp",function(k){var P=C.props.onMouseUp;if(pt(P)){var T=C.getMouseInfo(k);P(T,k)}}),lt(C,"handleTouchMove",function(k){k.changedTouches!=null&&k.changedTouches.length>0&&C.throttleTriggeredAfterMouseMove(k.changedTouches[0])}),lt(C,"handleTouchStart",function(k){k.changedTouches!=null&&k.changedTouches.length>0&&C.handleMouseDown(k.changedTouches[0])}),lt(C,"handleTouchEnd",function(k){k.changedTouches!=null&&k.changedTouches.length>0&&C.handleMouseUp(k.changedTouches[0])}),lt(C,"handleDoubleClick",function(k){var P=C.props.onDoubleClick;if(pt(P)){var T=C.getMouseInfo(k);P(T,k)}}),lt(C,"handleContextMenu",function(k){var P=C.props.onContextMenu;if(pt(P)){var T=C.getMouseInfo(k);P(T,k)}}),lt(C,"triggerSyncEvent",function(k){C.props.syncId!==void 0&&NE.emit(ME,C.props.syncId,k,C.eventEmitterSymbol)}),lt(C,"applySyncEvent",function(k){var P=C.props,T=P.layout,I=P.syncMethod,N=C.state.updateId,B=k.dataStartIndex,M=k.dataEndIndex;if(k.dataStartIndex!==void 0||k.dataEndIndex!==void 0)C.setState(ye({dataStartIndex:B,dataEndIndex:M},g({props:C.props,dataStartIndex:B,dataEndIndex:M,updateId:N},C.state)));else if(k.activeTooltipIndex!==void 0){var F=k.chartX,U=k.chartY,q=k.activeTooltipIndex,V=C.state,K=V.offset,D=V.tooltipTicks;if(!K)return;if(typeof I=="function")q=I(D,k);else if(I==="value"){q=-1;for(var $=0;$<D.length;$++)if(D[$].value===k.activeLabel){q=$;break}}var j=ye(ye({},K),{},{x:K.left,y:K.top}),z=Math.min(F,j.x+j.width),X=Math.min(U,j.y+j.height),W=D[q]&&D[q].value,le=TP(C.state,C.props.data,q),ce=D[q]?{x:T==="horizontal"?D[q].coordinate:z,y:T==="horizontal"?X:D[q].coordinate}:LX;C.setState(ye(ye({},k),{},{activeLabel:W,activeCoordinate:ce,activePayload:le,activeTooltipIndex:q}))}else C.setState(k)}),lt(C,"renderCursor",function(k){var P,T=C.state,I=T.isTooltipActive,N=T.activeCoordinate,B=T.activePayload,M=T.offset,F=T.activeTooltipIndex,U=T.tooltipAxisBandSize,q=C.getTooltipEventType(),V=(P=k.props.active)!==null&&P!==void 0?P:I,K=C.props.layout,D=k.key||"_recharts-cursor";return Z.createElement(FFe,{key:D,activeCoordinate:N,activePayload:B,activeTooltipIndex:F,chartName:r,element:k,isActive:V,layout:K,offset:M,tooltipAxisBandSize:U,tooltipEventType:q})}),lt(C,"renderPolarAxis",function(k,P,T){var I=Mi(k,"type.axisType"),N=Mi(C.state,"".concat(I,"Map")),B=k.type.defaultProps,M=B!==void 0?ye(ye({},B),k.props):k.props,F=N&&N[M["".concat(I,"Id")]];return O.cloneElement(k,ye(ye({},F),{},{className:gt(I,F.className),key:k.key||"".concat(P,"-").concat(T),ticks:Gl(F,!0)}))}),lt(C,"renderPolarGrid",function(k){var P=k.props,T=P.radialLines,I=P.polarAngles,N=P.polarRadius,B=C.state,M=B.radiusAxisMap,F=B.angleAxisMap,U=Cu(M),q=Cu(F),V=q.cx,K=q.cy,D=q.innerRadius,$=q.outerRadius;return O.cloneElement(k,{polarAngles:Array.isArray(I)?I:Gl(q,!0).map(function(j){return j.coordinate}),polarRadius:Array.isArray(N)?N:Gl(U,!0).map(function(j){return j.coordinate}),cx:V,cy:K,innerRadius:D,outerRadius:$,key:k.key||"polar-grid",radialLines:T})}),lt(C,"renderLegend",function(){var k=C.state.formattedGraphicalItems,P=C.props,T=P.children,I=P.width,N=P.height,B=C.props.margin||{},M=I-(B.left||0)-(B.right||0),F=_K({children:T,formattedGraphicalItems:k,legendWidth:M,legendContent:c});if(!F)return null;var U=F.item,q=KF(F,zFe);return O.cloneElement(U,ye(ye({},q),{},{chartWidth:I,chartHeight:N,margin:B,onBBoxUpdate:C.handleLegendBBoxUpdate}))}),lt(C,"renderTooltip",function(){var k,P=C.props,T=P.children,I=P.accessibilityLayer,N=Ei(T,Os);if(!N)return null;var B=C.state,M=B.isTooltipActive,F=B.activeCoordinate,U=B.activePayload,q=B.activeLabel,V=B.offset,K=(k=N.props.active)!==null&&k!==void 0?k:M;return O.cloneElement(N,{viewBox:ye(ye({},V),{},{x:V.left,y:V.top}),active:K,label:q,payload:K?U:[],coordinate:F,accessibilityLayer:I})}),lt(C,"renderBrush",function(k){var P=C.props,T=P.margin,I=P.data,N=C.state,B=N.offset,M=N.dataStartIndex,F=N.dataEndIndex,U=N.updateId;return O.cloneElement(k,{key:k.key||"_recharts-brush",onChange:mv(C.handleBrushChange,k.props.onChange),data:I,x:Ne(k.props.x)?k.props.x:B.left,y:Ne(k.props.y)?k.props.y:B.top+B.height+B.brushBottom-(T.bottom||0),width:Ne(k.props.width)?k.props.width:B.width,startIndex:M,endIndex:F,updateId:"brush-".concat(U)})}),lt(C,"renderReferenceElement",function(k,P,T){if(!k)return null;var I=C,N=I.clipPathId,B=C.state,M=B.xAxisMap,F=B.yAxisMap,U=B.offset,q=k.type.defaultProps||{},V=k.props,K=V.xAxisId,D=K===void 0?q.xAxisId:K,$=V.yAxisId,j=$===void 0?q.yAxisId:$;return O.cloneElement(k,{key:k.key||"".concat(P,"-").concat(T),xAxis:M[D],yAxis:F[j],viewBox:{x:U.left,y:U.top,width:U.width,height:U.height},clipPathId:N})}),lt(C,"renderActivePoints",function(k){var P=k.item,T=k.activePoint,I=k.basePoint,N=k.childIndex,B=k.isRange,M=[],F=P.props.key,U=P.item.type.defaultProps!==void 0?ye(ye({},P.item.type.defaultProps),P.item.props):P.item.props,q=U.activeDot,V=U.dataKey,K=ye(ye({index:N,dataKey:V,cx:T.x,cy:T.y,r:4,fill:E2(P.item),strokeWidth:2,stroke:"#fff",payload:T.payload,value:T.value},st(q,!1)),gy(q));return M.push(v.renderActiveDot(q,K,"".concat(F,"-activePoint-").concat(N))),I?M.push(v.renderActiveDot(q,ye(ye({},K),{},{cx:I.x,cy:I.y}),"".concat(F,"-basePoint-").concat(N))):B&&M.push(null),M}),lt(C,"renderGraphicChild",function(k,P,T){var I=C.filterFormatItem(k,P,T);if(!I)return null;var N=C.getTooltipEventType(),B=C.state,M=B.isTooltipActive,F=B.tooltipAxis,U=B.activeTooltipIndex,q=B.activeLabel,V=C.props.children,K=Ei(V,Os),D=I.props,$=D.points,j=D.isRange,z=D.baseLine,X=I.item.type.defaultProps!==void 0?ye(ye({},I.item.type.defaultProps),I.item.props):I.item.props,W=X.activeDot,le=X.hide,ce=X.activeBar,ve=X.activeShape,H=!!(!le&&M&&K&&(W||ce||ve)),Q={};N!=="axis"&&K&&K.props.trigger==="click"?Q={onClick:mv(C.handleItemMouseEnter,k.props.onClick)}:N!=="axis"&&(Q={onMouseLeave:mv(C.handleItemMouseLeave,k.props.onMouseLeave),onMouseEnter:mv(C.handleItemMouseEnter,k.props.onMouseEnter)});var Y=O.cloneElement(k,ye(ye({},I.props),Q));function ne(Pt){return typeof F.dataKey=="function"?F.dataKey(Pt.payload):null}if(H)if(U>=0){var ge,te;if(F.dataKey&&!F.allowDuplicatedCategory){var Oe=typeof F.dataKey=="function"?ne:"payload.".concat(F.dataKey.toString());ge=my($,Oe,q),te=j&&z&&my(z,Oe,q)}else ge=$==null?void 0:$[U],te=j&&z&&z[U];if(ve||ce){var Ie=k.props.activeIndex!==void 0?k.props.activeIndex:U;return[O.cloneElement(k,ye(ye(ye({},I.props),Q),{},{activeIndex:Ie})),null,null]}if(!mt(ge))return[Y].concat(Dd(C.renderActivePoints({item:I,activePoint:ge,basePoint:te,childIndex:U,isRange:j})))}else{var _e,rt=(_e=C.getItemByXY(C.state.activeCoordinate))!==null&&_e!==void 0?_e:{graphicalItem:Y},Me=rt.graphicalItem,je=Me.item,Qe=je===void 0?k:je,pr=Me.childIndex,nr=ye(ye(ye({},I.props),Q),{},{activeIndex:pr});return[O.cloneElement(Qe,nr),null,null]}return j?[Y,null,null]:[Y,null]}),lt(C,"renderCustomized",function(k,P,T){return O.cloneElement(k,ye(ye({key:"recharts-customized-".concat(T)},C.props),C.state))}),lt(C,"renderMap",{CartesianGrid:{handler:_v,once:!0},ReferenceArea:{handler:C.renderReferenceElement},ReferenceLine:{handler:_v},ReferenceDot:{handler:C.renderReferenceElement},XAxis:{handler:_v},YAxis:{handler:_v},Brush:{handler:C.renderBrush,once:!0},Bar:{handler:C.renderGraphicChild},Line:{handler:C.renderGraphicChild},Area:{handler:C.renderGraphicChild},Radar:{handler:C.renderGraphicChild},RadialBar:{handler:C.renderGraphicChild},Scatter:{handler:C.renderGraphicChild},Pie:{handler:C.renderGraphicChild},Funnel:{handler:C.renderGraphicChild},Tooltip:{handler:C.renderCursor,once:!0},PolarGrid:{handler:C.renderPolarGrid,once:!0},PolarAngleAxis:{handler:C.renderPolarAxis},PolarRadiusAxis:{handler:C.renderPolarAxis},Customized:{handler:C.renderCustomized}}),C.clipPathId="".concat((x=b.id)!==null&&x!==void 0?x:uf("recharts"),"-clip"),C.throttleTriggeredAfterMouseMove=bG(C.triggeredAfterMouseMove,(E=b.throttleDelay)!==null&&E!==void 0?E:1e3/60),C.state={},C}return JFe(v,m),XFe(v,[{key:"componentDidMount",value:function(){var x,E;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(x=this.props.margin.left)!==null&&x!==void 0?x:0,top:(E=this.props.margin.top)!==null&&E!==void 0?E:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var x=this.props,E=x.children,C=x.data,k=x.height,P=x.layout,T=Ei(E,Os);if(T){var I=T.props.defaultIndex;if(!(typeof I!="number"||I<0||I>this.state.tooltipTicks.length-1)){var N=this.state.tooltipTicks[I]&&this.state.tooltipTicks[I].value,B=TP(this.state,C,I,N),M=this.state.tooltipTicks[I].coordinate,F=(this.state.offset.top+k)/2,U=P==="horizontal",q=U?{x:M,y:F}:{y:M,x:F},V=this.state.formattedGraphicalItems.find(function(D){var $=D.item;return $.type.name==="Scatter"});V&&(q=ye(ye({},q),V.props.points[I].tooltipPosition),B=V.props.points[I].tooltipPayload);var K={activeTooltipIndex:I,isTooltipActive:!0,activeLabel:N,activePayload:B,activeCoordinate:q};this.setState(K),this.renderCursor(T),this.accessibilityManager.setIndex(I)}}}},{key:"getSnapshotBeforeUpdate",value:function(x,E){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==E.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==x.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==x.margin){var C,k;this.accessibilityManager.setDetails({offset:{left:(C=this.props.margin.left)!==null&&C!==void 0?C:0,top:(k=this.props.margin.top)!==null&&k!==void 0?k:0}})}return null}},{key:"componentDidUpdate",value:function(x){cT([Ei(x.children,Os)],[Ei(this.props.children,Os)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var x=Ei(this.props.children,Os);if(x&&typeof x.props.shared=="boolean"){var E=x.props.shared?"axis":"item";return a.indexOf(E)>=0?E:o}return o}},{key:"getMouseInfo",value:function(x){if(!this.container)return null;var E=this.container,C=E.getBoundingClientRect(),k=jIe(C),P={chartX:Math.round(x.pageX-k.left),chartY:Math.round(x.pageY-k.top)},T=C.width/E.offsetWidth||1,I=this.inRange(P.chartX,P.chartY,T);if(!I)return null;var N=this.state,B=N.xAxisMap,M=N.yAxisMap,F=this.getTooltipEventType(),U=ZF(this.state,this.props.data,this.props.layout,I);if(F!=="axis"&&B&&M){var q=Cu(B).scale,V=Cu(M).scale,K=q&&q.invert?q.invert(P.chartX):null,D=V&&V.invert?V.invert(P.chartY):null;return ye(ye({},P),{},{xValue:K,yValue:D},U)}return U?ye(ye({},P),U):null}},{key:"inRange",value:function(x,E){var C=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,k=this.props.layout,P=x/C,T=E/C;if(k==="horizontal"||k==="vertical"){var I=this.state.offset,N=P>=I.left&&P<=I.left+I.width&&T>=I.top&&T<=I.top+I.height;return N?{x:P,y:T}:null}var B=this.state,M=B.angleAxisMap,F=B.radiusAxisMap;if(M&&F){var U=Cu(M);return nB({x:P,y:T},U)}return null}},{key:"parseEventsOfWrapper",value:function(){var x=this.props.children,E=this.getTooltipEventType(),C=Ei(x,Os),k={};C&&E==="axis"&&(C.props.trigger==="click"?k={onClick:this.handleClick}:k={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var P=gy(this.props,this.handleOuterEvent);return ye(ye({},P),k)}},{key:"addListener",value:function(){NE.on(ME,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){NE.removeListener(ME,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(x,E,C){for(var k=this.state.formattedGraphicalItems,P=0,T=k.length;P<T;P++){var I=k[P];if(I.item===x||I.props.key===x.key||E===zs(I.item.type)&&C===I.childIndex)return I}return null}},{key:"renderClipPath",value:function(){var x=this.clipPathId,E=this.state.offset,C=E.left,k=E.top,P=E.height,T=E.width;return Z.createElement("defs",null,Z.createElement("clipPath",{id:x},Z.createElement("rect",{x:C,y:k,height:P,width:T})))}},{key:"getXScales",value:function(){var x=this.state.xAxisMap;return x?Object.entries(x).reduce(function(E,C){var k=GF(C,2),P=k[0],T=k[1];return ye(ye({},E),{},lt({},P,T.scale))},{}):null}},{key:"getYScales",value:function(){var x=this.state.yAxisMap;return x?Object.entries(x).reduce(function(E,C){var k=GF(C,2),P=k[0],T=k[1];return ye(ye({},E),{},lt({},P,T.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(x){var E;return(E=this.state.xAxisMap)===null||E===void 0||(E=E[x])===null||E===void 0?void 0:E.scale}},{key:"getYScaleByAxisId",value:function(x){var E;return(E=this.state.yAxisMap)===null||E===void 0||(E=E[x])===null||E===void 0?void 0:E.scale}},{key:"getItemByXY",value:function(x){var E=this.state,C=E.formattedGraphicalItems,k=E.activeItem;if(C&&C.length)for(var P=0,T=C.length;P<T;P++){var I=C[P],N=I.props,B=I.item,M=B.type.defaultProps!==void 0?ye(ye({},B.type.defaultProps),B.props):B.props,F=zs(B.type);if(F==="Bar"){var U=(N.data||[]).find(function(D){return r5e(x,D)});if(U)return{graphicalItem:I,payload:U}}else if(F==="RadialBar"){var q=(N.data||[]).find(function(D){return nB(x,D)});if(q)return{graphicalItem:I,payload:q}}else if(Lb(I,k)||$b(I,k)||Lp(I,k)){var V=E$e({graphicalItem:I,activeTooltipItem:k,itemData:M.data}),K=M.activeIndex===void 0?V:M.activeIndex;return{graphicalItem:ye(ye({},I),{},{childIndex:K}),payload:Lp(I,k)?M.data[V]:I.props.data[V]}}}return null}},{key:"render",value:function(){var x=this;if(!p3(this))return null;var E=this.props,C=E.children,k=E.className,P=E.width,T=E.height,I=E.style,N=E.compact,B=E.title,M=E.desc,F=KF(E,UFe),U=st(F,!1);if(N)return Z.createElement(OF,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},Z.createElement(dT,Ru({},U,{width:P,height:T,title:B,desc:M}),this.renderClipPath(),g3(C,this.renderMap)));if(this.props.accessibilityLayer){var q,V;U.tabIndex=(q=this.props.tabIndex)!==null&&q!==void 0?q:0,U.role=(V=this.props.role)!==null&&V!==void 0?V:"application",U.onKeyDown=function(D){x.accessibilityManager.keyboardEvent(D)},U.onFocus=function(){x.accessibilityManager.focus()}}var K=this.parseEventsOfWrapper();return Z.createElement(OF,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},Z.createElement("div",Ru({className:gt("recharts-wrapper",k),style:ye({position:"relative",cursor:"default",width:P,height:T},I)},K,{ref:function($){x.container=$}}),Z.createElement(dT,Ru({},U,{width:P,height:T,title:B,desc:M,style:o6e}),this.renderClipPath(),g3(C,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])})(O.Component);lt(_,"displayName",r),lt(_,"defaultProps",ye({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},u)),lt(_,"getDerivedStateFromProps",function(m,v){var b=m.dataKey,x=m.data,E=m.children,C=m.width,k=m.height,P=m.layout,T=m.stackOffset,I=m.margin,N=v.dataStartIndex,B=v.dataEndIndex;if(v.updateId===void 0){var M=QF(m);return ye(ye(ye({},M),{},{updateId:0},g(ye(ye({props:m},M),{},{updateId:0}),v)),{},{prevDataKey:b,prevData:x,prevWidth:C,prevHeight:k,prevLayout:P,prevStackOffset:T,prevMargin:I,prevChildren:E})}if(b!==v.prevDataKey||x!==v.prevData||C!==v.prevWidth||k!==v.prevHeight||P!==v.prevLayout||T!==v.prevStackOffset||!Fu(I,v.prevMargin)){var F=QF(m),U={chartX:v.chartX,chartY:v.chartY,isTooltipActive:v.isTooltipActive},q=ye(ye({},ZF(v,x,P)),{},{updateId:v.updateId+1}),V=ye(ye(ye({},F),U),q);return ye(ye(ye({},V),g(ye({props:m},V),v)),{},{prevDataKey:b,prevData:x,prevWidth:C,prevHeight:k,prevLayout:P,prevStackOffset:T,prevMargin:I,prevChildren:E})}if(!cT(E,v.prevChildren)){var K,D,$,j,z=Ei(E,kd),X=z&&(K=(D=z.props)===null||D===void 0?void 0:D.startIndex)!==null&&K!==void 0?K:N,W=z&&($=(j=z.props)===null||j===void 0?void 0:j.endIndex)!==null&&$!==void 0?$:B,le=X!==N||W!==B,ce=!mt(x),ve=ce&&!le?v.updateId:v.updateId+1;return ye(ye({updateId:ve},g(ye(ye({props:m},v),{},{updateId:ve,dataStartIndex:X,dataEndIndex:W}),v)),{},{prevChildren:E,dataStartIndex:X,dataEndIndex:W})}return null}),lt(_,"renderActiveDot",function(m,v,b){var x;return O.isValidElement(m)?x=O.cloneElement(m,v):pt(m)?x=m(v):x=Z.createElement(Rb,v),Z.createElement(qt,{className:"recharts-active-dot",key:b},x)});var y=O.forwardRef(function(v,b){return Z.createElement(_,Ru({},v,{ref:b}))});return y.displayName=_.displayName,y},m6e=BX({chartName:"LineChart",GraphicalChild:km,axisComponents:[{axisType:"xAxis",AxisComp:I2},{axisType:"yAxis",AxisComp:R2}],formatAxisMap:A4e}),g6e=BX({chartName:"PieChart",GraphicalChild:oa,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:Db},{axisType:"radiusAxis",AxisComp:Mb}],formatAxisMap:hDe,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});function JF(e){const[t,r,n]=e.split(" ").map(g=>parseFloat(g)),i=t/360,o=r/100,s=n/100,a=(g,_,y)=>(y<0&&(y+=1),y>1&&(y-=1),y<1/6?g+(_-g)*6*y:y<1/2?_:y<2/3?g+(_-g)*(2/3-y)*6:g),l=s<.5?s*(1+o):s+o-s*o,c=2*s-l,d=Math.round(a(c,l,i+1/3)*255),u=Math.round(a(c,l,i)*255),p=Math.round(a(c,l,i-1/3)*255);return`#${((1<<24)+(d<<16)+(u<<8)+p).toString(16).slice(1)}`}function v6e(){const e=document.documentElement,t=getComputedStyle(e),r=n=>{const i=t.getPropertyValue(n).trim();return JF(i||{"--primary":"220 60% 65%","--success":"142 71% 45%","--warning":"38 92% 50%","--info":"220 60% 60%","--destructive":"8 75% 55%","--indigo":"239 65% 60%","--orange":"25 90% 55%","--muted":"220 20% 96%"}[n]||"220 60% 65%")};return{primary:r("--primary"),success:r("--success"),warning:r("--warning"),info:r("--info"),destructive:r("--destructive"),indigo:r("--indigo"),orange:r("--orange"),muted:r("--muted")}}function y6e({data:e,className:t="",height:r=50,color:n,strokeWidth:i=2}){const o=O.useMemo(()=>v6e(),[]),s=n||o.primary,a=O.useMemo(()=>e.map((l,c)=>({index:c,value:l})),[e]);return!e||e.length===0?null:w.jsx("div",{className:`w-full ${t}`,children:w.jsx(_G,{width:"100%",height:r,children:w.jsx(m6e,{data:a,margin:{top:2,right:2,bottom:2,left:2},children:w.jsx(km,{type:"monotone",dataKey:"value",stroke:s,strokeWidth:i,dot:!1,isAnimationActive:!1})})})})}const FX={all:["workflowStatusCounts"],detail:e=>[...FX.all,"detail",e]},b6e=30*1e3;function _6e(e={}){const{staleTime:t=b6e,enabled:r=!0,refetchInterval:n=0}=e,i=At(sr),o=r&&!!i,s=ui({queryKey:FX.detail(i||""),queryFn:async()=>{if(!i)throw new Error("Project path is required");const l=await fetch(`/api/workflow-status-counts?projectPath=${encodeURIComponent(i)}`);if(!l.ok)throw new Error("Failed to fetch workflow status counts");return l.json()},staleTime:t,enabled:o,refetchInterval:n>0?n:!1,retry:2,retryDelay:l=>Math.min(1e3*2**l,1e4)}),a=async()=>{await s.refetch()};return{data:s.data,isLoading:s.isLoading,isFetching:s.isFetching,error:s.error,isStale:s.isStale,refetch:a}}const N2={all:["projectOverview"],detail:e=>[...N2.all,"detail",e]},x6e=300*1e3;function w6e(e={}){const{staleTime:t=x6e,enabled:r=!0}=e,n=At(sr),i=r&&!!n,o=ui({queryKey:N2.detail(n),queryFn:()=>PU(n),staleTime:t,enabled:i,retry:2,retryDelay:s=>Math.min(1e3*2**s,1e4)});return{projectOverview:o.data,isLoading:o.isLoading,error:o.error,refetch:o.refetch}}function DUe(){const e=Rn(),t=At(sr),r=ki({mutationFn:n=>AU(n,t),onSuccess:()=>{e.invalidateQueries({queryKey:N2.detail()})}});return{updateGuidelines:r.mutateAsync,isUpdating:r.isPending,error:r.error}}const S6e=30*1e3;function C6e(e={}){const{staleTime:t=S6e,enabled:r=!0,refetchInterval:n=0}=e,i=Rn(),o=At(sr),s=r&&!!o,a=ui({queryKey:Ce.indexStatus(o),queryFn:()=>FU(o),staleTime:t,enabled:s,refetchInterval:n>0?n:!1,retry:2}),l=async()=>{await a.refetch()},c=async()=>{await i.invalidateQueries({queryKey:Ce.index(o)})};return{status:a.data??null,isLoading:a.isLoading,isFetching:a.isFetching,error:a.error,refetch:l,invalidate:c}}const xv={completed:{bg:"bg-success",text:"text-success",dot:"bg-emerald-500",fill:"#10b981"},in_progress:{bg:"bg-warning",text:"text-warning",dot:"bg-amber-500",fill:"#f59e0b"},planning:{bg:"bg-violet-500",text:"text-violet-600",dot:"bg-violet-500",fill:"#8b5cf6"},paused:{bg:"bg-slate-400",text:"text-slate-500",dot:"bg-slate-400",fill:"#94a3b8"},archived:{bg:"bg-slate-300",text:"text-slate-400",dot:"bg-slate-300",fill:"#cbd5e1"}},E6e={completed:"sessions.status.completed",in_progress:"sessions.status.inProgress",planning:"sessions.status.planning",paused:"sessions.status.paused",archived:"sessions.status.archived"},e6={pending:{bg:"bg-muted",text:"text-muted-foreground",icon:to},completed:{bg:"bg-success/20",text:"text-success",icon:Wh},in_progress:{bg:"bg-warning/20",text:"text-warning",icon:to},blocked:{bg:"bg-destructive/20",text:"text-destructive",icon:Qa},skipped:{bg:"bg-slate-400/20",text:"text-slate-500",icon:to}};function k6e({className:e}){const{formatMessage:t}=$t();return w.jsx("div",{className:he("flex items-center justify-center h-full",e),children:w.jsx(dd,{className:"max-w-sm w-full border-dashed",children:w.jsxs(IO,{className:"flex flex-col items-center gap-4 py-8",children:[w.jsx("div",{className:"w-14 h-14 rounded-full bg-muted flex items-center justify-center",children:w.jsx(Vh,{className:"w-7 h-7 text-muted-foreground"})}),w.jsxs("div",{className:"text-center space-y-2",children:[w.jsx("h3",{className:"text-base font-semibold",children:t({id:"home.emptyState.noSessions.title"})}),w.jsx("p",{className:"text-sm text-muted-foreground",children:t({id:"home.emptyState.noSessions.message"})})]}),w.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[w.jsx("code",{className:"px-3 py-2 bg-muted rounded text-xs font-mono text-center",children:"/workflow-plan"}),w.jsx("p",{className:"text-xs text-muted-foreground text-center",children:t({id:"home.emptyState.noSessions.hint"})})]})]})})})}const t6={planning:{bg:"bg-violet-500/20",text:"text-violet-600"},in_progress:{bg:"bg-warning/20",text:"text-warning"},completed:{bg:"bg-success/20",text:"text-success"},paused:{bg:"bg-slate-400/20",text:"text-slate-500"},ready:{bg:"bg-success/20",text:"text-success"},initialized:{bg:"bg-info/20",text:"text-info"},archived:{bg:"bg-slate-300/20",text:"text-slate-400"},failed:{bg:"bg-destructive/20",text:"text-destructive"}},r6={primary:{card:"border-primary/30 bg-primary/5",icon:"bg-primary/10 text-primary"},info:{card:"border-info/30 bg-info/5",icon:"bg-info/10 text-info"},success:{card:"border-success/30 bg-success/5",icon:"bg-success/10 text-success"},warning:{card:"border-warning/30 bg-warning/5",icon:"bg-warning/10 text-warning"},danger:{card:"border-destructive/30 bg-destructive/5",icon:"bg-destructive/10 text-destructive"},default:{card:"border-border",icon:"bg-muted text-muted-foreground"}};function _u({icon:e,title:t,value:r,variant:n,sparklineData:i}){const o=r6[n]||r6.default;return w.jsxs("div",{className:he("rounded-lg border p-3 transition-all hover:shadow-sm h-full flex flex-col",o.card),children:[w.jsxs("div",{className:"flex items-start justify-between gap-2",children:[w.jsxs("div",{className:"flex-1 min-w-0",children:[w.jsx("p",{className:"text-xs font-medium text-muted-foreground truncate",children:t}),w.jsx("p",{className:"text-xl font-bold text-card-foreground mt-1",children:r.toLocaleString()})]}),w.jsx("div",{className:he("flex h-7 w-7 items-center justify-center rounded-md shrink-0",o.icon),children:w.jsx(e,{className:"h-4 w-4"})})]}),i&&i.length>0&&w.jsx("div",{className:"mt-auto pt-2 -mx-1",children:w.jsx(y6e,{data:i,height:28,strokeWidth:1.5})})]})}function xu(e,t=.3){const n=[];let i=Math.max(0,e*(1-t));for(let o=0;o<6;o++){n.push(Math.round(i));const s=(Math.random()-.5)*2*t*e;i=Math.max(0,i+s)}return n.push(e),n}function T6e({className:e}){var B,M,F,U,q,V,K,D,$,j,z,X,W,le,ce,ve,H,Q,Y,ne,ge,te,Oe,Ie,_e,rt,Me;const{formatMessage:t}=$t(),r=Sc(),{data:n,isLoading:i}=_6e(),{stats:o,isLoading:s}=Fpe({refetchInterval:6e4}),{projectOverview:a,isLoading:l}=w6e(),{status:c}=C6e({refetchInterval:3e4}),{activeSessions:d,isLoading:u}=$H({filter:{location:"active"}}),p=n||[],g=p.reduce((je,Qe)=>je+Qe.count,0),_=p.length>0,y=O.useMemo(()=>({activeSessions:xu((o==null?void 0:o.activeSessions)??0,.4),totalTasks:xu((o==null?void 0:o.totalTasks)??0,.3),completedTasks:xu((o==null?void 0:o.completedTasks)??0,.25),pendingTasks:xu((o==null?void 0:o.pendingTasks)??0,.35),failedTasks:xu((o==null?void 0:o.failedTasks)??0,.5),todayActivity:xu((o==null?void 0:o.todayActivity)??0,.6)}),[o]),[m,v]=O.useState(!1),[b,x]=O.useState(0),E=d.length,C=d[b],k=O.useCallback(je=>{if(!je)return"";const Qe=new Date(je);return isNaN(Qe.getTime())?"":Qe.toLocaleDateString()},[]);O.useEffect(()=>{if(E<=1)return;const je=setInterval(()=>{x(Qe=>(Qe+1)%E)},5e3);return()=>clearInterval(je)},[E]);const P=()=>{x(je=>je===0?E-1:je-1)},T=()=>{x(je=>(je+1)%E)},I=je=>{r(`/sessions/${je}`)},N=je=>je==="in_progress"?"in_progress":je==="blocked"?"blocked":je==="skipped"?"skipped":je;return w.jsxs("div",{className:he("flex flex-col gap-2",e),children:[w.jsx(dd,{className:"shrink-0 border-gradient-brand",children:l?w.jsxs("div",{className:"px-4 py-3 flex items-center gap-4",children:[w.jsx("div",{className:"h-5 w-32 bg-muted rounded animate-pulse"}),w.jsx("div",{className:"h-4 w-48 bg-muted rounded animate-pulse"})]}):w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:"px-5 py-4 flex items-center gap-6 flex-wrap",children:[w.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[w.jsx("div",{className:"p-2 rounded-md bg-primary/10",children:w.jsx(SM,{className:"h-5 w-5 text-primary"})}),w.jsxs("div",{className:"min-w-0",children:[w.jsx("h2",{className:"text-base font-semibold text-foreground truncate",children:(a==null?void 0:a.projectName)||"Claude Code Workflow"}),w.jsx("p",{className:"text-xs text-muted-foreground truncate max-w-[300px]",children:(a==null?void 0:a.description)||"AI-powered workflow management system"})]})]}),w.jsx("div",{className:"h-10 w-px bg-border hidden md:block"}),w.jsxs("div",{className:"flex items-center gap-2.5 text-xs",children:[w.jsxs("span",{className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-md bg-blue-500/10 text-blue-600 font-medium",children:[w.jsx(SM,{className:"h-3.5 w-3.5"}),((F=(M=(B=a==null?void 0:a.technologyStack)==null?void 0:B.languages)==null?void 0:M[0])==null?void 0:F.name)||"TypeScript"]}),w.jsxs("span",{className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-md bg-green-500/10 text-green-600 font-medium",children:[w.jsx(bk,{className:"h-3.5 w-3.5"}),((q=(U=a==null?void 0:a.technologyStack)==null?void 0:U.frameworks)==null?void 0:q[0])||"Node.js"]}),w.jsxs("span",{className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-md bg-violet-500/10 text-violet-600 font-medium",children:[w.jsx(yk,{className:"h-3.5 w-3.5"}),((V=a==null?void 0:a.architecture)==null?void 0:V.style)||"Modular Monolith"]}),((D=(K=a==null?void 0:a.technologyStack)==null?void 0:K.build_tools)==null?void 0:D[0])&&w.jsxs("span",{className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-md bg-orange-500/10 text-orange-600 font-medium",children:[w.jsx(ju,{className:"h-3.5 w-3.5"}),a.technologyStack.build_tools[0]]})]}),w.jsx("div",{className:"h-10 w-px bg-border hidden lg:block"}),w.jsxs("div",{className:"flex items-center gap-5 text-xs",children:[w.jsxs("div",{className:"flex items-center gap-2 text-emerald-600",children:[w.jsx(Uv,{className:"h-3.5 w-3.5"}),w.jsx("span",{className:"font-semibold",children:((j=($=a==null?void 0:a.developmentIndex)==null?void 0:$.feature)==null?void 0:j.length)||0}),w.jsx("span",{className:"text-muted-foreground",children:t({id:"projectOverview.devIndex.category.features"})})]}),w.jsxs("div",{className:"flex items-center gap-2 text-amber-600",children:[w.jsx(_M,{className:"h-3.5 w-3.5"}),w.jsx("span",{className:"font-semibold",children:((X=(z=a==null?void 0:a.developmentIndex)==null?void 0:z.bugfix)==null?void 0:X.length)||0}),w.jsx("span",{className:"text-muted-foreground",children:t({id:"projectOverview.devIndex.category.bugfixes"})})]}),w.jsxs("div",{className:"flex items-center gap-2 text-blue-600",children:[w.jsx(Gx,{className:"h-3.5 w-3.5"}),w.jsx("span",{className:"font-semibold",children:((le=(W=a==null?void 0:a.developmentIndex)==null?void 0:W.enhancement)==null?void 0:le.length)||0}),w.jsx("span",{className:"text-muted-foreground",children:t({id:"projectOverview.devIndex.category.enhancements"})})]}),w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsxs("div",{className:"relative",children:[w.jsx(Bz,{className:he("h-3.5 w-3.5",(c==null?void 0:c.status)==="building"&&"text-blue-600 animate-pulse",(c==null?void 0:c.status)==="completed"&&"text-emerald-600",(c==null?void 0:c.status)==="idle"&&"text-slate-500",(c==null?void 0:c.status)==="failed"&&"text-red-600")}),(c==null?void 0:c.status)==="building"&&w.jsxs("span",{className:"absolute -top-0.5 -right-0.5 flex h-2 w-2",children:[w.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-blue-400 opacity-75"}),w.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-blue-500"})]})]}),w.jsx("span",{className:he("font-semibold",(c==null?void 0:c.status)==="building"&&"text-blue-600",(c==null?void 0:c.status)==="completed"&&"text-emerald-600",(c==null?void 0:c.status)==="idle"&&"text-slate-500",(c==null?void 0:c.status)==="failed"&&"text-red-600"),children:(c==null?void 0:c.totalFiles)||0}),w.jsx("span",{className:"text-muted-foreground",children:t({id:"home.indexStatus.label"})})]})]}),w.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground ml-auto",children:[w.jsxs("span",{className:"flex items-center gap-2 px-2.5 py-1.5 rounded-md bg-muted/50",children:[w.jsx(xM,{className:"h-3.5 w-3.5"}),a!=null&&a.initializedAt?new Date(a.initializedAt).toLocaleDateString():new Date().toLocaleDateString()]}),w.jsx(Ye,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 hover:bg-muted",onClick:()=>v(!m),children:m?w.jsx(b0,{className:"h-4 w-4"}):w.jsx(ea,{className:"h-4 w-4"})})]})]}),m&&w.jsxs("div",{className:"px-5 pb-4 grid grid-cols-4 gap-6 border-t border-border/50 pt-4",children:[w.jsxs("div",{className:"space-y-2",children:[w.jsxs("h4",{className:"text-xs font-semibold text-foreground flex items-center gap-1.5",children:[w.jsx(yk,{className:"h-4 w-4 text-primary"}),t({id:"projectOverview.architecture.title"})]}),w.jsxs("div",{className:"space-y-2",children:[w.jsx("div",{className:"flex items-center gap-2",children:w.jsx("span",{className:"text-sm font-medium text-foreground",children:((ce=a==null?void 0:a.architecture)==null?void 0:ce.style)||"Modular Monolith"})}),w.jsxs("p",{className:"text-xs text-muted-foreground",children:[t({id:"projectOverview.architecture.layers"}),":"]}),w.jsx("div",{className:"flex flex-wrap gap-1.5",children:(((ve=a==null?void 0:a.architecture)==null?void 0:ve.layers)||["CLI Tools","Core Services","Dashboard UI","Data Layer"]).slice(0,5).map((je,Qe)=>w.jsx("span",{className:"text-xs px-2 py-1 rounded-md bg-muted text-muted-foreground font-medium",children:je},Qe))})]})]}),w.jsxs("div",{className:"space-y-2",children:[w.jsxs("h4",{className:"text-xs font-semibold text-foreground flex items-center gap-1.5",children:[w.jsx(ju,{className:"h-4 w-4 text-orange-500"}),t({id:"projectOverview.components.title"})]}),w.jsx("div",{className:"space-y-1.5",children:((a==null?void 0:a.keyComponents)||[{name:"Session Manager",description:"Workflow session lifecycle"},{name:"Dashboard Generator",description:"Dynamic widget rendering"},{name:"Data Aggregator",description:"Stats and metrics collection"},{name:"Task Scheduler",description:"Async task orchestration"}]).slice(0,4).map((je,Qe)=>w.jsxs("div",{className:"flex items-start gap-2",children:[w.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-orange-500 mt-1.5 shrink-0"}),w.jsxs("div",{className:"min-w-0",children:[w.jsx("p",{className:"text-xs font-medium text-foreground truncate",children:je.name}),je.description&&w.jsx("p",{className:"text-[11px] text-muted-foreground truncate",children:je.description})]})]},Qe))})]}),w.jsxs("div",{className:"space-y-2",children:[w.jsxs("h4",{className:"text-xs font-semibold text-foreground flex items-center gap-1.5",children:[w.jsx(Gx,{className:"h-4 w-4 text-blue-500"}),t({id:"projectOverview.devIndex.title"})]}),w.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[w.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded-md bg-emerald-500/10",children:[w.jsx(Uv,{className:"h-3.5 w-3.5 text-emerald-600"}),w.jsxs("div",{children:[w.jsx("p",{className:"text-sm font-semibold text-emerald-600",children:((Q=(H=a==null?void 0:a.developmentIndex)==null?void 0:H.feature)==null?void 0:Q.length)||10}),w.jsx("p",{className:"text-[10px] text-emerald-600/80",children:t({id:"projectOverview.devIndex.category.features"})})]})]}),w.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded-md bg-blue-500/10",children:[w.jsx(Gx,{className:"h-3.5 w-3.5 text-blue-600"}),w.jsxs("div",{children:[w.jsx("p",{className:"text-sm font-semibold text-blue-600",children:((ne=(Y=a==null?void 0:a.developmentIndex)==null?void 0:Y.enhancement)==null?void 0:ne.length)||5}),w.jsx("p",{className:"text-[10px] text-blue-600/80",children:t({id:"projectOverview.devIndex.category.enhancements"})})]})]}),w.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded-md bg-amber-500/10",children:[w.jsx(_M,{className:"h-3.5 w-3.5 text-amber-600"}),w.jsxs("div",{children:[w.jsx("p",{className:"text-sm font-semibold text-amber-600",children:((te=(ge=a==null?void 0:a.developmentIndex)==null?void 0:ge.bugfix)==null?void 0:te.length)||3}),w.jsx("p",{className:"text-[10px] text-amber-600/80",children:t({id:"projectOverview.devIndex.category.bugfixes"})})]})]}),w.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded-md bg-violet-500/10",children:[w.jsx(ju,{className:"h-3.5 w-3.5 text-violet-600"}),w.jsxs("div",{children:[w.jsx("p",{className:"text-sm font-semibold text-violet-600",children:((Ie=(Oe=a==null?void 0:a.developmentIndex)==null?void 0:Oe.refactor)==null?void 0:Ie.length)||2}),w.jsx("p",{className:"text-[10px] text-violet-600/80",children:t({id:"projectOverview.devIndex.category.refactorings"})})]})]})]})]}),w.jsxs("div",{className:"space-y-2",children:[w.jsxs("h4",{className:"text-xs font-semibold text-foreground flex items-center gap-1.5",children:[w.jsx(Uz,{className:"h-4 w-4 text-violet-500"}),t({id:"projectOverview.architecture.patterns"})]}),w.jsx("div",{className:"flex flex-wrap gap-1.5",children:(((_e=a==null?void 0:a.architecture)==null?void 0:_e.patterns)||["Factory","Strategy","Observer","Singleton","Decorator"]).slice(0,6).map((je,Qe)=>w.jsx("span",{className:"text-xs px-2.5 py-1 rounded-md bg-primary/10 text-primary font-medium",children:je},Qe))})]})]})]})}),w.jsxs(dd,{className:"h-[400px] flex shrink-0 overflow-hidden",children:[w.jsxs("div",{className:"w-[28%] p-3 flex flex-col border-r border-border",children:[w.jsxs("h3",{className:"text-sm font-semibold text-foreground mb-3 flex items-center gap-1.5",children:[w.jsx(rne,{className:"h-4 w-4"}),t({id:"home.sections.statistics"})]}),s?w.jsx("div",{className:"grid grid-cols-2 grid-rows-3 gap-2.5 flex-1",children:[1,2,3,4,5,6].map(je=>w.jsx("div",{className:"bg-muted rounded animate-pulse"},je))}):w.jsxs("div",{className:"grid grid-cols-2 grid-rows-3 gap-2.5 flex-1",children:[w.jsx(_u,{icon:x0,title:t({id:"home.stats.activeSessions"}),value:(o==null?void 0:o.activeSessions)??0,variant:"primary",sparklineData:y.activeSessions}),w.jsx(_u,{icon:Vh,title:t({id:"home.stats.totalTasks"}),value:(o==null?void 0:o.totalTasks)??0,variant:"info",sparklineData:y.totalTasks}),w.jsx(_u,{icon:Wh,title:t({id:"home.stats.completedTasks"}),value:(o==null?void 0:o.completedTasks)??0,variant:"success",sparklineData:y.completedTasks}),w.jsx(_u,{icon:to,title:t({id:"home.stats.pendingTasks"}),value:(o==null?void 0:o.pendingTasks)??0,variant:"warning",sparklineData:y.pendingTasks}),w.jsx(_u,{icon:Qa,title:t({id:"common.status.failed"}),value:(o==null?void 0:o.failedTasks)??0,variant:"danger",sparklineData:y.failedTasks}),w.jsx(_u,{icon:Dz,title:t({id:"common.stats.todayActivity"}),value:(o==null?void 0:o.todayActivity)??0,variant:"default",sparklineData:y.todayActivity})]})]}),w.jsxs("div",{className:"w-[22%] p-3 flex flex-col border-r border-border",children:[w.jsxs("h3",{className:"text-sm font-semibold text-foreground mb-3 flex items-center gap-1.5",children:[w.jsx(wM,{className:"h-4 w-4"}),t({id:"home.widgets.workflowStatus"})]}),i?w.jsx("div",{className:"flex-1 flex items-center justify-center",children:w.jsx("div",{className:"w-24 h-24 rounded-full bg-muted animate-pulse"})}):_?w.jsxs("div",{className:"flex-1 flex flex-col",children:[w.jsx("div",{className:"flex-1 min-h-0",children:w.jsx(_G,{width:"100%",height:"100%",children:w.jsx(g6e,{children:w.jsx(oa,{data:p,cx:"50%",cy:"50%",innerRadius:"55%",outerRadius:"85%",paddingAngle:2,dataKey:"count",children:p.map(je=>{const Qe=xv[je.status]||xv.completed;return w.jsx(_b,{fill:Qe.fill},je.status)})})})})}),w.jsx("div",{className:"grid grid-cols-2 gap-x-3 gap-y-1.5 mt-3",children:p.map(je=>{const Qe=xv[je.status]||xv.completed,pr=g>0?Math.round(je.count/g*100):0;return w.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[w.jsx("div",{className:he("w-2.5 h-2.5 rounded-full shrink-0",Qe.dot)}),w.jsx("span",{className:"text-xs text-muted-foreground truncate",children:t({id:E6e[je.status]??"sessions.status.inProgress"})}),w.jsxs("span",{className:"text-xs font-medium text-foreground ml-auto",children:[pr,"%"]})]},je.status)})})]}):w.jsx("div",{className:"flex-1 flex items-center justify-center",children:w.jsxs("div",{className:"text-center",children:[w.jsx(wM,{className:"w-12 h-12 mx-auto text-muted-foreground/30 mb-2"}),w.jsx("p",{className:"text-xs text-muted-foreground",children:t({id:"home.emptyState.noSessions.message"})})]})})]}),w.jsxs("div",{className:"flex-1 min-w-0 p-4 flex flex-col",children:[w.jsxs("div",{className:"flex items-center justify-between mb-3",children:[w.jsxs("h3",{className:"text-sm font-semibold text-foreground flex items-center gap-1.5",children:[w.jsx(Vh,{className:"h-4 w-4"}),t({id:"home.sections.taskDetails"})]}),E>0&&w.jsxs("div",{className:"flex items-center gap-1.5",children:[w.jsx(Ye,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:P,disabled:E<=1,children:w.jsx(nne,{className:"h-4 w-4"})}),w.jsxs("span",{className:"text-xs text-muted-foreground min-w-[45px] text-center",children:[b+1," / ",E]}),w.jsx(Ye,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:T,disabled:E<=1,children:w.jsx($z,{className:"h-4 w-4"})})]})]}),u?w.jsx("div",{className:"flex-1 flex items-center justify-center",children:w.jsxs("div",{className:"w-full max-w-sm space-y-3",children:[w.jsx("div",{className:"h-8 bg-muted rounded animate-pulse"}),w.jsx("div",{className:"h-4 bg-muted rounded animate-pulse w-3/4"}),w.jsx("div",{className:"h-20 bg-muted rounded animate-pulse"})]})}):E===0?w.jsx(k6e,{}):C?w.jsxs("div",{className:"flex-1 flex flex-col min-h-0 rounded-lg border border-border bg-accent/20 p-3 overflow-hidden cursor-pointer hover:border-primary/30 transition-colors",onClick:()=>I(C.session_id),children:[w.jsxs("div",{className:"mb-2 pb-2 border-b border-border shrink-0 min-w-0",children:[w.jsxs("div",{className:"flex items-start gap-2 min-w-0",children:[w.jsx("div",{className:he("px-2 py-1 rounded text-xs font-medium shrink-0",((rt=t6[C.status])==null?void 0:rt.bg)||"bg-muted",((Me=t6[C.status])==null?void 0:Me.text)||"text-muted-foreground"),children:t({id:`common.status.${C.status==="in_progress"?"inProgress":C.status}`})}),w.jsxs("div",{className:"flex-1 min-w-0 overflow-hidden",children:[w.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:C.title||C.session_id}),w.jsx("p",{className:"text-xs text-muted-foreground truncate",children:C.session_id})]})]}),C.description&&w.jsx("p",{className:"text-xs text-muted-foreground mt-2 line-clamp-2",children:C.description}),C.tasks&&C.tasks.length>0&&w.jsxs("div",{className:"mt-2.5 space-y-1",children:[w.jsxs("div",{className:"flex items-center justify-between text-xs",children:[w.jsx("span",{className:"text-muted-foreground",children:t({id:"common.labels.progress"})}),w.jsxs("span",{className:"font-medium text-foreground",children:[C.tasks.filter(je=>je.status==="completed").length,"/",C.tasks.length]})]}),w.jsx(ab,{value:C.tasks.length>0?C.tasks.filter(je=>je.status==="completed").length/C.tasks.length*100:0,className:"h-1.5 bg-muted",indicatorClassName:"bg-success"})]}),w.jsx("div",{className:"flex items-center gap-2 mt-2 flex-wrap",children:w.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] text-muted-foreground ml-auto",children:[w.jsx(xM,{className:"h-3 w-3"}),k(C.updated_at||C.created_at)]})})]}),C.tasks&&C.tasks.length>0?w.jsx("div",{className:"flex-1 overflow-auto min-h-0",children:w.jsx("div",{className:"grid grid-cols-2 gap-2 w-full",children:C.tasks.map((je,Qe)=>{const pr=N(je.status),nr=e6[pr]||e6.pending,Pt=nr.icon,Bt=C.tasks.length%2===1&&Qe===C.tasks.length-1;return w.jsxs("div",{className:he("flex items-center gap-2 p-2 rounded hover:bg-background/50 transition-colors min-w-0",Bt&&"col-span-2"),children:[w.jsx("div",{className:he("p-1 rounded shrink-0",nr.bg),children:w.jsx(Pt,{className:he("h-3 w-3",nr.text)})}),w.jsx("p",{className:he("flex-1 text-xs font-medium truncate",je.status==="completed"?"text-muted-foreground line-through":"text-foreground"),children:je.title||je.task_id})]},`${C.session_id}-${je.task_id}-${Qe}`)})})}):w.jsx("div",{className:"flex-1 flex items-center justify-center",children:w.jsx("p",{className:"text-xs text-muted-foreground",children:t({id:"home.emptyState.noTasks.message"})})})]}):null,E>1&&w.jsx("div",{className:"flex items-center justify-center gap-1 mt-2",children:d.map((je,Qe)=>w.jsx("button",{onClick:()=>x(Qe),className:he("w-1.5 h-1.5 rounded-full transition-colors",Qe===b?"bg-primary":"bg-muted hover:bg-muted-foreground/50")},Qe))})]})]})]})}const P6e=O.memo(T6e);function A6e(e={}){const t=Rn(),r=At(sr),n=(e.enabled??!0)&&!!r,{data:i={litePlan:[],liteFix:[],multiCliPlan:[]},isLoading:o,error:s,refetch:a}=ui({queryKey:Ce.liteTasks(r),queryFn:()=>oA(r),staleTime:3e4,refetchInterval:e.refetchInterval,enabled:n}),l=[...(i.litePlan||[]).map(u=>({...u,_type:"lite-plan"})),...(i.liteFix||[]).map(u=>({...u,_type:"lite-fix"})),...(i.multiCliPlan||[]).map(u=>({...u,_type:"multi-cli-plan"}))],c=u=>{switch(u){case"lite-plan":return i.litePlan||[];case"lite-fix":return i.liteFix||[];case"multi-cli-plan":return i.multiCliPlan||[]}},d=(u,p)=>{t.prefetchQuery({queryKey:["liteTask",u,p],queryFn:()=>RU(u,p,r),staleTime:6e4})};return{litePlan:i.litePlan||[],liteFix:i.liteFix||[],multiCliPlan:i.multiCliPlan||[],allSessions:l,getSessionsByType:c,prefetchSession:d,isLoading:o,error:s,refetch:a}}const O6e=[{key:"all",label:"home.tabs.allTasks",icon:x0},{key:"workflow",label:"home.tabs.workflow",icon:nm},{key:"lite",label:"home.tabs.liteTasks",icon:Gh}],I6e={in_progress:Vn,running:Vn,planning:zz,completed:Wh,failed:Qa,paused:ine,pending:to,cancelled:Qa,idle:to,initializing:Vn,ready:Wh},R6e={in_progress:"bg-warning/20 text-warning border-warning/30",running:"bg-warning/20 text-warning border-warning/30",planning:"bg-violet-500/20 text-violet-600 border-violet-500/30",completed:"bg-success/20 text-success border-success/30",failed:"bg-destructive/20 text-destructive border-destructive/30",paused:"bg-slate-400/20 text-slate-500 border-slate-400/30",pending:"bg-muted text-muted-foreground border-border",cancelled:"bg-destructive/20 text-destructive border-destructive/30",idle:"bg-muted text-muted-foreground border-border",initializing:"bg-info/20 text-info border-info/30",ready:"bg-success/20 text-success border-success/30"},n6={in_progress:"inProgress",running:"running",planning:"planning",completed:"completed",failed:"failed",paused:"paused",pending:"pending",cancelled:"cancelled",idle:"idle",initializing:"initializing",ready:"ready"},N6e={"lite-plan":zz,"lite-fix":ju,"multi-cli-plan":Uz},M6e={all:"bg-muted text-muted-foreground",workflow:"bg-primary/20 text-primary",lite:"bg-amber-500/20 text-amber-600"};function j6e({item:e,onClick:t}){const{formatMessage:r}=$t(),n=I6e[e.status]||to,i=e.subType?N6e[e.subType]||Gh:e.type==="workflow"?nm:Gh,o=e.status==="in_progress"||e.status==="running"||e.status==="initializing";return w.jsx("button",{onClick:t,className:"w-full text-left p-3 rounded-lg border border-border bg-card hover:bg-accent/50 hover:border-primary/30 transition-all group",children:w.jsxs("div",{className:"flex items-start gap-2.5 min-w-0",children:[w.jsx("div",{className:he("p-1.5 rounded-md shrink-0",M6e[e.type]),children:w.jsx(i,{className:"h-4 w-4"})}),w.jsxs("div",{className:"flex-1 min-w-0 overflow-hidden",children:[w.jsxs("div",{className:"flex items-start gap-2 mb-1 min-w-0",children:[w.jsx("h4",{className:"text-sm font-medium text-foreground truncate flex-1 min-w-0 group-hover:text-primary transition-colors",children:e.name}),w.jsxs(Gn,{className:he("text-[10px] px-1.5 py-0 shrink-0 border",R6e[e.status]),children:[w.jsx(n,{className:he("h-2.5 w-2.5 mr-0.5",o&&"animate-spin")}),r({id:`common.status.${e.statusKey}`})]})]}),e.description&&w.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2 mb-1.5",children:e.description}),typeof e.progress=="number"&&e.progress>0&&w.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[w.jsx(ab,{value:e.progress,className:"h-1 flex-1 bg-muted"}),w.jsxs("span",{className:"text-[10px] text-muted-foreground w-8 text-right",children:[e.progress,"%"]})]}),w.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[w.jsxs("span",{className:"flex items-center gap-0.5 text-[10px] text-muted-foreground",children:[w.jsx(to,{className:"h-2.5 w-2.5"}),e.createdAt]}),e.subType&&w.jsx(Gn,{variant:"outline",className:"text-[9px] px-1 py-0 bg-background",children:e.subType}),e.tags&&e.tags.slice(0,2).map(s=>w.jsxs(Gn,{variant:"outline",className:"text-[9px] px-1 py-0 gap-0.5 bg-background",children:[w.jsx(One,{className:"h-2 w-2"}),s]},s)),e.tags&&e.tags.length>2&&w.jsxs("span",{className:"text-[9px] text-muted-foreground",children:["+",e.tags.length-2]})]})]})]})})}function D6e(){return w.jsx("div",{className:"p-3 rounded-lg border border-border bg-card animate-pulse",children:w.jsxs("div",{className:"flex items-start gap-2.5",children:[w.jsx("div",{className:"w-8 h-8 rounded-md bg-muted"}),w.jsxs("div",{className:"flex-1",children:[w.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[w.jsx("div",{className:"h-4 bg-muted rounded flex-1"}),w.jsx("div",{className:"h-4 w-16 bg-muted rounded"})]}),w.jsx("div",{className:"h-3 bg-muted rounded w-3/4 mb-2"}),w.jsxs("div",{className:"flex gap-2",children:[w.jsx("div",{className:"h-3 w-16 bg-muted rounded"}),w.jsx("div",{className:"h-3 w-12 bg-muted rounded"})]})]})]})})}function L6e({className:e,maxItems:t=6}){const{formatMessage:r}=$t(),n=Sc(),[i,o]=O.useState("all"),{activeSessions:s,isLoading:a}=$H({filter:{location:"active"}}),{allSessions:l,isLoading:c}=A6e(),d=O.useCallback(m=>{if(!m)return r({id:"common.time.justNow"});const v=new Date(m);if(isNaN(v.getTime()))return r({id:"common.time.justNow"});const x=new Date().getTime()-v.getTime(),E=Math.floor(x/6e4),C=Math.floor(E/60),k=Math.floor(C/24);return E<1?r({id:"common.time.justNow"}):E<60?r({id:"common.time.minutesAgo"},{count:E}):C<24?r({id:"common.time.hoursAgo"},{count:C}):r({id:"common.time.daysAgo"},{count:k})},[r]),u=O.useMemo(()=>{const m=[];return s.forEach(v=>{const b=v.status||"pending";m.push({id:v.session_id,name:v.title||v.description||v.session_id,type:"workflow",status:b,statusKey:n6[b]||b,createdAt:d(v.created_at),description:v.description||`Session: ${v.session_id}`,tags:[],progress:void 0})}),l.forEach(v=>{const b=v.status||"pending",x=v.session_id||v.id;m.push({id:x,name:v.title||x,type:"lite",subType:v._type,status:b,statusKey:n6[b]||b,createdAt:d(v.createdAt),description:v.description||`${v._type} task`,tags:[],progress:void 0})}),m},[s,l,d]),p=O.useMemo(()=>i==="all"?u.slice(0,t):u.filter(m=>m.type===i).slice(0,t),[u,i,t]),g=m=>{switch(m.type){case"workflow":n(`/sessions/${m.id}`);break;case"lite":n(`/lite-tasks/${m.subType}/${m.id}`);break}},_=()=>{n("/sessions")},y=a||c;return w.jsx("div",{className:e,children:w.jsxs(dd,{className:"h-full p-4 flex flex-col",children:[w.jsxs("div",{className:"flex items-center justify-between mb-3",children:[w.jsx("h3",{className:"text-sm font-semibold text-foreground",children:r({id:"home.sections.recentTasks"})}),w.jsx(Ye,{variant:"link",size:"sm",className:"text-xs h-auto p-0",onClick:_,children:r({id:"common.actions.viewAll"})})]}),w.jsx("div",{className:"flex gap-1 mb-3 overflow-x-auto pb-1",children:O6e.map(m=>{const v=m.icon,b=m.key==="all"?u.length:u.filter(x=>x.type===m.key).length;return w.jsxs(Ye,{variant:i===m.key?"default":"ghost",size:"sm",onClick:()=>o(m.key),className:he("whitespace-nowrap text-xs gap-1 h-7 px-2",i===m.key&&"bg-primary text-primary-foreground"),children:[w.jsx(v,{className:"h-3 w-3"}),r({id:m.label}),w.jsxs("span",{className:"text-[10px] opacity-70",children:["(",b,")"]})]},m.key)})}),w.jsx("div",{className:"flex-1 overflow-auto",children:y?w.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-2",children:Array.from({length:6}).map((m,v)=>w.jsx(D6e,{},v))}):p.length===0?w.jsxs("div",{className:"flex flex-col items-center justify-center py-8",children:[w.jsx(x0,{className:"h-10 w-10 text-muted-foreground mb-2"}),w.jsx("p",{className:"text-sm text-muted-foreground",children:r({id:"home.emptyState.noTasks.message"})})]}):w.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-2",children:p.map(m=>w.jsx(j6e,{item:m,onClick:()=>g(m)},`${m.type}-${m.id}`))})})]})})}const $6e=O.memo(L6e);function B6e(){const{formatMessage:e}=$t(),[t,r]=O.useState(!1),n=()=>{window.location.reload()};return w.jsxs("div",{className:"space-y-6",children:[w.jsx(GTe,{titleKey:"home.dashboard.title",descriptionKey:"home.dashboard.description",onRefresh:n}),t&&w.jsxs("div",{className:"flex items-center gap-2 p-4 rounded-lg bg-destructive/10 border border-destructive/30 text-destructive",children:[w.jsx(Ds,{className:"h-5 w-5 flex-shrink-0"}),w.jsxs("div",{className:"flex-1",children:[w.jsx("p",{className:"text-sm font-medium",children:e({id:"home.errors.loadFailed"})}),w.jsx("p",{className:"text-xs mt-0.5",children:e({id:"common.errors.unknownError"})})]}),w.jsx(Ye,{variant:"outline",size:"sm",onClick:n,children:e({id:"home.errors.retry"})})]}),w.jsxs("div",{className:"flex flex-col gap-4",children:[w.jsx(P6e,{}),w.jsx($6e,{})]})]})}const F6e=O.lazy(()=>Lt(()=>import("./SessionsPage-DThweYY8.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8])).then(e=>({default:e.SessionsPage}))),z6e=O.lazy(()=>Lt(()=>import("./FixSessionPage-wK1s4kbo.js"),[]).then(e=>({default:e.FixSessionPage}))),U6e=O.lazy(()=>Lt(()=>import("./ProjectOverviewPage-CrmW0IxI.js"),__vite__mapDeps([9,10,11,12,13,14])).then(e=>({default:e.ProjectOverviewPage}))),H6e=O.lazy(()=>Lt(()=>import("./SessionDetailPage-crDIiysh.js"),__vite__mapDeps([15,16,17,1,18,2,19,20,21,22,13,4,6])).then(e=>({default:e.SessionDetailPage}))),q6e=O.lazy(()=>Lt(()=>import("./HistoryPage-C09lyJGN.js"),__vite__mapDeps([23,24,20,25,26,3,4,27,28,5,7])).then(e=>({default:e.HistoryPage}))),W6e=O.lazy(()=>Lt(()=>import("./OrchestratorPage-ThBG24Gg.js"),__vite__mapDeps([29,19,30,1,31,32,33,34,12,7,35,36,37,21])).then(e=>({default:e.OrchestratorPage}))),V6e=O.lazy(()=>Lt(()=>import("./IssueHubPage-CHol1-Ap.js"),__vite__mapDeps([38,10,3,11,1,39,26,36,40,41,42,14,43,37,7])).then(e=>({default:e.IssueHubPage}))),G6e=O.lazy(()=>Lt(()=>import("./SkillsManagerPage-BJd3bK1G.js"),__vite__mapDeps([44,6,16,41,45,3,1,42,46,27,20,4,11,7,47,48,49,50,51,52,33,32,36,35,21])).then(e=>({default:e.SkillsManagerPage}))),K6e=O.lazy(()=>Lt(()=>import("./CommandsManagerPage-BH2xukdx.js"),__vite__mapDeps([53,6,31,32,52,16,47,48,49,20,50,4,7])).then(e=>({default:e.CommandsManagerPage}))),X6e=O.lazy(()=>Lt(()=>import("./MemoryPage-1UahrmRX.js"),__vite__mapDeps([54,6,4,55,1,56,7,57,5,26,11,58,59])).then(e=>({default:e.MemoryPage}))),Z6e=O.lazy(()=>Lt(()=>import("./SettingsPage-OCdOz5-z.js"),__vite__mapDeps([60,41,61,62,2,18,63,50,4,12,64,27,37,22,20])).then(e=>({default:e.SettingsPage}))),Q6e=O.lazy(()=>Lt(()=>import("./NotFoundPage-5FVm_IkS.js"),[]).then(e=>({default:e.NotFoundPage}))),Y6e=O.lazy(()=>Lt(()=>import("./LiteTasksPage-jH00SLnZ.js"),__vite__mapDeps([65,6,17,16,1,18,2,19,20,21,22,7,24,26,27,43,30])).then(e=>({default:e.LiteTasksPage}))),J6e=O.lazy(()=>Lt(()=>import("./ReviewSessionPage-DxiEc9HK.js"),__vite__mapDeps([66,1])).then(e=>({default:e.ReviewSessionPage}))),eze=O.lazy(()=>Lt(()=>import("./McpManagerPage-BS-HgeQJ.js"),__vite__mapDeps([67,41,51,50,4,46,27,18,45,47,48,49,20,68,12,24,1,8,40,55,6,34,11])).then(e=>({default:e.McpManagerPage}))),tze=O.lazy(()=>Lt(()=>import("./EndpointsPage-5a8jfEWN.js"),__vite__mapDeps([69,70,62,32,52,71,45,11])).then(e=>({default:e.EndpointsPage}))),rze=O.lazy(()=>Lt(()=>import("./InstallationsPage-qt7NxnsB.js"),__vite__mapDeps([72,70,62,32,22,37])).then(e=>({default:e.InstallationsPage}))),nze=O.lazy(()=>Lt(()=>import("./HookManagerPage-CFBe8F_G.js"),__vite__mapDeps([73,41,45,11,63,70,62,32,74,75])).then(e=>({default:e.HookManagerPage}))),ize=O.lazy(()=>Lt(()=>import("./RulesManagerPage-BpplliZF.js"),__vite__mapDeps([76,70,62,32,52,20,3,11,6,7,51,8])).then(e=>({default:e.RulesManagerPage}))),oze=O.lazy(()=>Lt(()=>import("./PromptHistoryPage-1cCGwS3s.js"),__vite__mapDeps([77,26,57,14,75,27,28,1,39,8])).then(e=>({default:e.PromptHistoryPage}))),sze=O.lazy(()=>Lt(()=>import("./ExplorerPage-YCqIOu1v.js"),__vite__mapDeps([78,49,20,36,35])).then(e=>({default:e.ExplorerPage}))),aze=O.lazy(()=>Lt(()=>import("./GraphExplorerPage-DpIWrpWH.js"),__vite__mapDeps([79,19,8,1,22,80,21])).then(e=>({default:e.GraphExplorerPage}))),lze=O.lazy(()=>Lt(()=>import("./CodexLensManagerPage-DUMzbrr9.js"),__vite__mapDeps([81,6,41,62,32,50,4,27,45,1,16,12,8,22,68])).then(e=>({default:e.CodexLensManagerPage}))),cze=O.lazy(()=>Lt(()=>import("./ApiSettingsPage-D69j8mI6.js"),__vite__mapDeps([82,6,52,83,62,32,3,11,16,50,4,41,1,68,12,18,22])).then(e=>({default:e.ApiSettingsPage}))),uze=O.lazy(()=>Lt(()=>import("./CliViewerPage-Bsp1zmfD.js"),__vite__mapDeps([84,85,86,87,80,56,10,7])).then(e=>({default:e.CliViewerPage}))),dze=O.lazy(()=>Lt(()=>import("./CliSessionSharePage-Ce8tOQNx.js"),[]).then(e=>({default:e.CliSessionSharePage}))),fze=O.lazy(()=>Lt(()=>import("./TeamPage-8OnLsAfJ.js"),__vite__mapDeps([88,6,52,8,1,22,20,25,3,4,58,5,7])).then(e=>({default:e.TeamPage}))),hze=O.lazy(()=>Lt(()=>import("./TerminalDashboardPage-Be1hcN4p.js"),__vite__mapDeps([89,85,86,83,62,32,20,90,10,7,49,41,1,48,63,74,40,28,50,4])).then(e=>({default:e.TerminalDashboardPage}))),pze=O.lazy(()=>Lt(()=>import("./AnalysisPage-DVDvLHqI.js"),__vite__mapDeps([91,6,87,80,56,7,1])).then(e=>({default:e.AnalysisPage}))),mze=O.lazy(()=>Lt(()=>import("./SpecsSettingsPage-BAWL2cpO.js"),__vite__mapDeps([92,52,1,3,4,11,51,20,12,61,71,8,39,90])).then(e=>({default:e.SpecsSettingsPage}))),gze=O.lazy(()=>Lt(()=>import("./DeepWikiPage-D41ccWzY.js"),__vite__mapDeps([93,6,64,1,26,30])).then(e=>({default:e.DeepWikiPage})));function Gt(e){return w.jsx(WTe,{children:w.jsx(O.Suspense,{fallback:w.jsx(VTe,{}),children:e})})}const vze=[{path:"cli-sessions/share",element:Gt(w.jsx(dze,{}))},{path:"/",element:w.jsx(HTe,{}),children:[{index:!0,element:w.jsx(B6e,{})},{path:"sessions",element:Gt(w.jsx(F6e,{}))},{path:"sessions/:sessionId",element:Gt(w.jsx(H6e,{}))},{path:"sessions/:sessionId/fix",element:Gt(w.jsx(z6e,{}))},{path:"sessions/:sessionId/review",element:Gt(w.jsx(J6e,{}))},{path:"lite-tasks",element:Gt(w.jsx(Y6e,{}))},{path:"project",element:Gt(w.jsx(U6e,{}))},{path:"history",element:Gt(w.jsx(q6e,{}))},{path:"orchestrator",element:Gt(w.jsx(W6e,{}))},{path:"loops",element:w.jsx($g,{to:"/terminal-dashboard",replace:!0})},{path:"cli-viewer",element:Gt(w.jsx(uze,{}))},{path:"issues",element:Gt(w.jsx(V6e,{}))},{path:"issues/queue",element:w.jsx($g,{to:"/issues?tab=queue",replace:!0})},{path:"issues/discovery",element:w.jsx($g,{to:"/issues?tab=discovery",replace:!0})},{path:"skills",element:Gt(w.jsx(G6e,{}))},{path:"commands",element:Gt(w.jsx(K6e,{}))},{path:"memory",element:Gt(w.jsx(X6e,{}))},{path:"prompts",element:Gt(w.jsx(oze,{}))},{path:"settings",element:Gt(w.jsx(Z6e,{}))},{path:"settings/mcp",element:Gt(w.jsx(eze,{}))},{path:"settings/endpoints",element:Gt(w.jsx(tze,{}))},{path:"settings/installations",element:Gt(w.jsx(rze,{}))},{path:"settings/rules",element:Gt(w.jsx(ize,{}))},{path:"settings/specs",element:Gt(w.jsx(mze,{}))},{path:"settings/codexlens",element:Gt(w.jsx(lze,{}))},{path:"api-settings",element:Gt(w.jsx(cze,{}))},{path:"hooks",element:Gt(w.jsx(nze,{}))},{path:"explorer",element:Gt(w.jsx(sze,{}))},{path:"graph",element:Gt(w.jsx(aze,{}))},{path:"teams",element:Gt(w.jsx(fze,{}))},{path:"analysis",element:Gt(w.jsx(pze,{}))},{path:"deepwiki",element:Gt(w.jsx(gze,{}))},{path:"terminal-dashboard",element:Gt(w.jsx(hze,{}))},{path:"skill-hub",element:w.jsx($g,{to:"/skills?tab=hub",replace:!0})},{path:"*",element:Gt(w.jsx(Q6e,{}))}]}],yze="/".replace(/\/$/,"")||"",bze=UJ(vze,{basename:yze}),PP=new oY({defaultOptions:{queries:{staleTime:1e3*60*5,gcTime:1e3*60*10,retry:1,refetchOnWindowFocus:!1},mutations:{retry:1}}});function _ze({locale:e,messages:t}){return O.useEffect(()=>{nU().catch(console.error),Cle().catch(()=>{})},[]),w.jsx(Ute,{locale:e,messages:t,children:w.jsx(sY,{client:PP,children:w.jsxs(c0e,{children:[w.jsx(xze,{}),w.jsx(wze,{}),w.jsx(Sze,{}),w.jsx(ZJ,{router:bze}),w.jsx(mre,{richColors:!0,position:"top-right"})]})})})}function xze(){const e=At(t=>t.registerQueryInvalidator);return O.useEffect(()=>{e(()=>{Un.getState().resetState(),li.getState().resetState(),dA.getState().resetState(),Hd.getState().resetState(),Tk.getState().resetState(),Ud.getState().resetState();const r=nc.getState();r.resetState(),At.getState().projectPath&&r.loadInitialState().catch(i=>{console.error("[QueueSchedulerSync] Failed to sync scheduler state:",i)}),zn.getState().resetState(),_ce.getState().resetWorkspaceState(),PP.invalidateQueries({queryKey:eO}),PP.invalidateQueries({predicate:i=>{const o=i.queryKey;if(!Array.isArray(o))return!1;const s=o[0];return s==="workspace"||s==="projectOverview"||s==="workflowStatusCounts"||s==="dashboardStats"}})})},[e]),null}function wze(){const e=At(sr),t=li(r=>r.setSessions);return O.useEffect(()=>{let r=!1;return e?(zU(e).then(({sessions:n})=>{r||t(n)}).catch(n=>{console.error("[CliSessionSync] Failed to sync CLI sessions:",n),r||t([])}),()=>{r=!0}):(t([]),()=>{r=!0})},[e,t]),null}function Sze(){return k7(!0,15e3),null}let zX=-1;const mf=e=>{addEventListener("pageshow",(t=>{t.persisted&&(zX=t.timeStamp,e(t))}),!0)},cs=(e,t,r,n)=>{let i,o;return s=>{t.value>=0&&(s||n)&&(o=t.value-(i??0),(o||i===void 0)&&(i=t.value,t.delta=o,t.rating=((a,l)=>a>l[1]?"poor":a>l[0]?"needs-improvement":"good")(t.value,r),e(t)))}},M2=e=>{requestAnimationFrame((()=>requestAnimationFrame((()=>e()))))},j2=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Tm=()=>{const e=j2();return(e==null?void 0:e.activationStart)??0},us=(e,t=-1)=>{const r=j2();let n="navigate";return zX>=0?n="back-forward-cache":r&&(document.prerendering||Tm()>0?n="prerender":document.wasDiscarded?n="restore":r.type&&(n=r.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:n}},DE=new WeakMap;function D2(e,t){return DE.get(e)||DE.set(e,new t),DE.get(e)}class Cze{constructor(){_o(this,"t");_o(this,"i",0);_o(this,"o",[])}h(t){var i;if(t.hadRecentInput)return;const r=this.o[0],n=this.o.at(-1);this.i&&r&&n&&t.startTime-n.startTime<1e3&&t.startTime-r.startTime<5e3?(this.i+=t.value,this.o.push(t)):(this.i=t.value,this.o=[t]),(i=this.t)==null||i.call(this,t)}}const Pm=(e,t,r={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const n=new PerformanceObserver((i=>{Promise.resolve().then((()=>{t(i.getEntries())}))}));return n.observe({type:e,buffered:!0,...r}),n}}catch{}},L2=e=>{let t=!1;return()=>{t||(e(),t=!0)}};let Nu=-1;const UX=new Set,i6=()=>document.visibilityState!=="hidden"||document.prerendering?1/0:0,AP=e=>{if(document.visibilityState==="hidden"){if(e.type==="visibilitychange")for(const t of UX)t();isFinite(Nu)||(Nu=e.type==="visibilitychange"?e.timeStamp:0,removeEventListener("prerenderingchange",AP,!0))}},Vb=()=>{var e;if(Nu<0){const t=Tm();Nu=(document.prerendering||(e=globalThis.performance.getEntriesByType("visibility-state").filter((n=>n.name==="hidden"&&n.startTime>t))[0])==null?void 0:e.startTime)??i6(),addEventListener("visibilitychange",AP,!0),addEventListener("prerenderingchange",AP,!0),mf((()=>{setTimeout((()=>{Nu=i6()}))}))}return{get firstHiddenTime(){return Nu},onHidden(t){UX.add(t)}}},Gb=e=>{document.prerendering?addEventListener("prerenderingchange",(()=>e()),!0):e()},o6=[1800,3e3],HX=(e,t={})=>{Gb((()=>{const r=Vb();let n,i=us("FCP");const o=Pm("paint",(s=>{for(const a of s)a.name==="first-contentful-paint"&&(o.disconnect(),a.startTime<r.firstHiddenTime&&(i.value=Math.max(a.startTime-Tm(),0),i.entries.push(a),n(!0)))}));o&&(n=cs(e,i,o6,t.reportAllChanges),mf((s=>{i=us("FCP"),n=cs(e,i,o6,t.reportAllChanges),M2((()=>{i.value=performance.now()-s.timeStamp,n(!0)}))})))}))},s6=[.1,.25],Eze=(e,t={})=>{const r=Vb();HX(L2((()=>{let n,i=us("CLS",0);const o=D2(t,Cze),s=l=>{for(const c of l)o.h(c);o.i>i.value&&(i.value=o.i,i.entries=o.o,n())},a=Pm("layout-shift",s);a&&(n=cs(e,i,s6,t.reportAllChanges),r.onHidden((()=>{s(a.takeRecords()),n(!0)})),mf((()=>{o.i=0,i=us("CLS",0),n=cs(e,i,s6,t.reportAllChanges),M2((()=>n()))})),setTimeout(n))})))};let qX=0,LE=1/0,wv=0;const kze=e=>{for(const t of e)t.interactionId&&(LE=Math.min(LE,t.interactionId),wv=Math.max(wv,t.interactionId),qX=wv?(wv-LE)/7+1:0)};let OP;const a6=()=>OP?qX:performance.interactionCount??0,Tze=()=>{"interactionCount"in performance||OP||(OP=Pm("event",kze,{type:"event",buffered:!0,durationThreshold:0}))};let l6=0;class Pze{constructor(){_o(this,"u",[]);_o(this,"l",new Map);_o(this,"m");_o(this,"p")}v(){l6=a6(),this.u.length=0,this.l.clear()}L(){const t=Math.min(this.u.length-1,Math.floor((a6()-l6)/50));return this.u[t]}h(t){var i,o;if((i=this.m)==null||i.call(this,t),!t.interactionId&&t.entryType!=="first-input")return;const r=this.u.at(-1);let n=this.l.get(t.interactionId);if(n||this.u.length<10||t.duration>r.P){if(n?t.duration>n.P?(n.entries=[t],n.P=t.duration):t.duration===n.P&&t.startTime===n.entries[0].startTime&&n.entries.push(t):(n={id:t.interactionId,entries:[t],P:t.duration},this.l.set(n.id,n),this.u.push(n)),this.u.sort(((s,a)=>a.P-s.P)),this.u.length>10){const s=this.u.splice(10);for(const a of s)this.l.delete(a.id)}(o=this.p)==null||o.call(this,n)}}}const WX=e=>{const t=globalThis.requestIdleCallback||setTimeout;document.visibilityState==="hidden"?e():(e=L2(e),addEventListener("visibilitychange",e,{once:!0,capture:!0}),t((()=>{e(),removeEventListener("visibilitychange",e,{capture:!0})})))},c6=[200,500],Aze=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const r=Vb();Gb((()=>{Tze();let n,i=us("INP");const o=D2(t,Pze),s=l=>{WX((()=>{for(const d of l)o.h(d);const c=o.L();c&&c.P!==i.value&&(i.value=c.P,i.entries=c.entries,n())}))},a=Pm("event",s,{durationThreshold:t.durationThreshold??40});n=cs(e,i,c6,t.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),r.onHidden((()=>{s(a.takeRecords()),n(!0)})),mf((()=>{o.v(),i=us("INP"),n=cs(e,i,c6,t.reportAllChanges)})))}))};class Oze{constructor(){_o(this,"m")}h(t){var r;(r=this.m)==null||r.call(this,t)}}const u6=[2500,4e3],Ize=(e,t={})=>{Gb((()=>{const r=Vb();let n,i=us("LCP");const o=D2(t,Oze),s=l=>{t.reportAllChanges||(l=l.slice(-1));for(const c of l)o.h(c),c.startTime<r.firstHiddenTime&&(i.value=Math.max(c.startTime-Tm(),0),i.entries=[c],n())},a=Pm("largest-contentful-paint",s);if(a){n=cs(e,i,u6,t.reportAllChanges);const l=L2((()=>{s(a.takeRecords()),a.disconnect(),n(!0)})),c=d=>{d.isTrusted&&(WX(l),removeEventListener(d.type,c,{capture:!0}))};for(const d of["keydown","click","visibilitychange"])addEventListener(d,c,{capture:!0});mf((d=>{i=us("LCP"),n=cs(e,i,u6,t.reportAllChanges),M2((()=>{i.value=performance.now()-d.timeStamp,n(!0)}))}))}}))},d6=[800,1800],IP=e=>{document.prerendering?Gb((()=>IP(e))):document.readyState!=="complete"?addEventListener("load",(()=>IP(e)),!0):setTimeout(e)},Rze=(e,t={})=>{let r=us("TTFB"),n=cs(e,r,d6,t.reportAllChanges);IP((()=>{const i=j2();i&&(r.value=Math.max(i.responseStart-Tm(),0),r.entries=[i],n(!0),mf((()=>{r=us("TTFB",0),n=cs(e,r,d6,t.reportAllChanges),n(!0)})))}))},Eu={LCP:2500,INP:200,CLS:.1,FCP:1800,TTFB:600};function _h(e,t){switch(e){case"LCP":return t<=Eu.LCP;case"INP":return t<=Eu.INP;case"CLS":return t<=Eu.CLS;case"FCP":return t<=Eu.FCP;case"TTFB":return t<=Eu.TTFB;default:return!0}}function xh(e,t){const r=Eu[e];if(!r||t<=r)return"good";const n=r*1.25;return t<=n?"needs-improvement":"poor"}function Nze(e,t=!1){Ize(r=>{const n={...r,vitalsName:"LCP",isBad:!_h("LCP",r.value),rating:xh("LCP",r.value)};e(n)}),Aze(r=>{const n={...r,vitalsName:"INP",isBad:!_h("INP",r.value),rating:xh("INP",r.value)};e(n)}),Eze(r=>{const n={...r,vitalsName:"CLS",isBad:!_h("CLS",r.value),rating:xh("CLS",r.value)};e(n)}),t&&(HX(r=>{const n={...r,vitalsName:"FCP",isBad:!_h("FCP",r.value),rating:xh("FCP",r.value)};e(n)}),Rze(r=>{const n={...r,vitalsName:"TTFB",isBad:!_h("TTFB",r.value),rating:xh("TTFB",r.value)};e(n)}))}function Mze(){Nze(e=>{const t=e.isBad?"background: #ff6b6b; color: white; padding: 2px 6px; border-radius: 3px;":"background: #51cf66; color: white; padding: 2px 6px; border-radius: 3px;";console.log(`%c${e.vitalsName}%c ${e.value.toFixed(2)}ms (${e.rating})`,t,"background: none;")})}async function jze(){const e=document.getElementById("root");if(!e)throw new Error("Failed to find the root element");const t=await Hv(),r=await Jne(t);DQ.createRoot(e).render(w.jsx(O.StrictMode,{children:w.jsx(_ze,{locale:t,messages:r})})),Mze()}jze().catch(e=>{console.error("Failed to bootstrap application:",e)});export{one as $,Yd as A,Gn as B,dd as C,t0e as D,v8 as E,une as F,Qd as G,Fze as H,O0 as I,Jre as J,Qa as K,Vh as L,_0 as M,Vn as N,Re as O,w6e as P,DUe as Q,eA as R,tA as S,rA as T,Uv as U,_M as V,ju as W,Di as X,tne as Y,Gh as Z,Uze as _,IO as a,nm as a$,SM as a0,Uz as a1,Qj as a2,Fk as a3,oy as a4,z0e as a5,kne as a6,Ene as a7,rne as a8,At as a9,Lze as aA,vY as aB,Ce as aC,nle as aD,OU as aE,Rn as aF,Z as aG,ki as aH,coe as aI,uoe as aJ,doe as aK,loe as aL,goe as aM,Ine as aN,poe as aO,es as aP,vk as aQ,sne as aR,Rne as aS,moe as aT,dne as aU,bne as aV,zle as aW,qle as aX,Jze as aY,Dle as aZ,Yze as a_,sr as aa,ui as ab,aoe as ac,tm as ad,yk as ae,Gx as af,foe as ag,hoe as ah,rV as ai,nV as aj,One as ak,jle as al,CM as am,lne as an,$z as ao,ea as ap,jEe as aq,bW as ar,DEe as as,wW as at,SW as au,Hz as av,Gz as aw,YQ as ax,EN as ay,$ze as az,Wz as b,qie as b$,b0e as b0,x0e as b1,li as b2,zU as b3,C0 as b4,Fz as b5,iUe as b6,Cne as b7,NP as b8,wc as b9,co as bA,Ue as bB,os as bC,D0 as bD,sEe as bE,CUe as bF,Li as bG,R0 as bH,UH as bI,Cn as bJ,kc as bK,Uie as bL,Fie as bM,zie as bN,CO as bO,St as bP,dc as bQ,Tt as bR,sl as bS,$ie as bT,Wze as bU,Die as bV,Lie as bW,Lt as bX,jie as bY,Vie as bZ,Gie as b_,BP as ba,$d as bb,gUe as bc,yUe as bd,qz as be,TO as bf,_Ue as bg,Ud as bh,rle as bi,zn as bj,Rae as bk,Nae as bl,BH as bm,bUe as bn,vUe as bo,ab as bp,Ec as bq,xUe as br,zze as bs,Mie as bt,Co as bu,Nie as bv,jt as bw,EUe as bx,ut as by,No as bz,he as c,joe as c$,Wie as c0,Hie as c1,Hze as c2,Xie as c3,Zie as c4,Qie as c5,Yie as c6,Jie as c7,Kie as c8,ale as c9,Nne as cA,JP as cB,yne as cC,q9 as cD,kk as cE,Xze as cF,Zze as cG,Qze as cH,xne as cI,rm as cJ,_ne as cK,hne as cL,Ev as cM,A6e as cN,zz as cO,boe as cP,Tne as cQ,IU as cR,yoe as cS,_oe as cT,woe as cU,Soe as cV,Coe as cW,Eoe as cX,Aoe as cY,Ooe as cZ,Doe as c_,ile as ca,ole as cb,sle as cc,eoe as cd,roe as ce,soe as cf,toe as cg,noe as ch,ioe as ci,ooe as cj,Bz as ck,cq as cl,Dq as cm,Dz as cn,Aie as co,Go as cp,oie as cq,OM as cr,wk as cs,Zz as ct,Qz as cu,eie as cv,IM as cw,Vze as cx,b0 as cy,vne as cz,r0e as d,Kt as d$,w0 as d0,Toe as d1,Moe as d2,xoe as d3,MU as d4,Poe as d5,bk as d6,lse as d7,ose as d8,cse as d9,Hoe as dA,qoe as dB,Woe as dC,Koe as dD,Zoe as dE,tse as dF,Joe as dG,Loe as dH,Uoe as dI,Goe as dJ,Qoe as dK,y6e as dL,mse as dM,gse as dN,yse as dO,vse as dP,dse as dQ,fse as dR,hse as dS,pse as dT,o0e as dU,Sse as dV,Oy as dW,bp as dX,l4 as dY,URe as dZ,ff as d_,sse as da,use as db,ise as dc,Roe as dd,Ioe as de,Noe as df,rse as dg,nse as dh,Tc as di,LU as dj,ase as dk,koe as dl,$U as dm,sA as dn,aA as dp,fne as dq,cne as dr,nne as ds,Xoe as dt,ese as du,Yoe as dv,zoe as dw,Boe as dx,$oe as dy,Foe as dz,Ye as e,ele as e$,kse as e0,Tse as e1,Pse as e2,Ase as e3,Ise as e4,Rse as e5,Nse as e6,Mse as e7,Dse as e8,Lse as e9,Oae as eA,Iae as eB,_0e as eC,Un as eD,uA as eE,PUe as eF,tUe as eG,nUe as eH,k7 as eI,eEe as eJ,rUe as eK,eUe as eL,Oh as eM,ibe as eN,dTe as eO,hTe as eP,gn as eQ,En as eR,im as eS,Xae as eT,Zae as eU,Qae as eV,Kae as eW,Yae as eX,Jae as eY,Vz as eZ,ene as e_,$se as ea,Fse as eb,Xse as ec,Zse as ed,Qse as ee,eae as ef,tae as eg,Wse as eh,Vse as ei,Gse as ej,Cse as ek,Ese as el,Ose as em,jse as en,Bse as eo,Yse as ep,zse as eq,Use as er,Hse as es,qse as et,Kse as eu,Jse as ev,Gae as ew,Lpe as ex,GW as ey,KW as ez,z9 as f,bae as f$,tle as f0,Tk as f1,fce as f2,dA as f3,hUe as f4,nc as f5,aV as f6,_ce as f7,uUe as f8,Hd as f9,bse as fA,wse as fB,Sae as fC,Cae as fD,oae as fE,iae as fF,sae as fG,aae as fH,dae as fI,uae as fJ,pae as fK,hae as fL,yae as fM,vae as fN,Pae as fO,Aae as fP,nae as fQ,cae as fR,gae as fS,_ae as fT,kae as fU,Tae as fV,xae as fW,rae as fX,lae as fY,fae as fZ,mae as f_,Lne as fa,lA as fb,UU as fc,HU as fd,cUe as fe,QM as ff,sUe as fg,mne as fh,lUe as fi,Qh as fj,oUe as fk,aUe as fl,lV as fm,ece as fn,OUe as fo,NUe as fp,IUe as fq,RUe as fr,MUe as fs,fUe as ft,dUe as fu,Bl as fv,nce as fw,CTe as fx,_se as fy,xse as fz,Rv as g,wae as g0,Eae as g1,TA as g2,mge as g3,kUe as g4,PA as g5,TUe as g6,hc as g7,Gd as g8,Kd as g9,zae as gA,Uae as gB,Hae as gC,lle as gD,ule as gE,dle as gF,ple as gG,hle as gH,iV as gI,Abe as gJ,ay as gK,Kze as gL,wUe as gM,tp as ga,Vd as gb,SUe as gc,Gze as gd,qze as ge,ATe as gf,uV as gg,dV as gh,hV as gi,jUe as gj,gle as gk,mle as gl,Q0 as gm,gO as gn,jae as go,Lae as gp,Bae as gq,Fae as gr,Wae as gs,Vae as gt,qae as gu,fle as gv,cle as gw,Mae as gx,Dae as gy,$ae as gz,$k as h,xM as i,w as j,Wh as k,to as l,Ds as m,Sc as n,xt as o,$H as p,pUe as q,O as r,_ie as s,mUe as t,$t as u,U9 as v,x0 as w,lm as x,Xd as y,Zd as z};
|
|
708
|
+
//# sourceMappingURL=index-DzTbMyaS.js.map
|