@runfusion/fusion 0.73.0-beta.2 → 0.73.0-beta.3
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/agent-browser.mjs +8 -0
- package/dist/bin.js +6700 -11124
- package/dist/child-process-worker.js +3661 -8222
- package/dist/client/.vite/manifest.json +260 -250
- package/dist/client/assets/{AgentDetailView-CUoHZPZr.js → AgentDetailView-lJqxsPOR.js} +3 -3
- package/dist/client/assets/{AgentPermissionPolicyEditor-DKoHJIlF.js → AgentPermissionPolicyEditor-De4wK_UT.js} +1 -1
- package/dist/client/assets/{AgentsView-CaBo-FHV.js → AgentsView-CwizRdcA.js} +4 -4
- package/dist/client/assets/ChatView-BeQXaz7_.js +8 -0
- package/dist/client/assets/{CommandCenter-wgiEIVuC.js → CommandCenter-BJZCaPLj.js} +9 -9
- package/dist/client/assets/DevServerView-DQgwQXKx.js +1 -0
- package/dist/client/assets/{DirectoryPicker-B7YwgF53.js → DirectoryPicker-B2UVwp6F.js} +1 -1
- package/dist/client/assets/DocumentsView-DOeYrhvg.js +1 -0
- package/dist/client/assets/{EvalsView-BjyqxMS_.js → EvalsView-LwepJ9Ud.js} +1 -1
- package/dist/client/assets/{ExperimentalAgentOnboardingModal-_PMSa_gN.js → ExperimentalAgentOnboardingModal-DVNSzflw.js} +1 -1
- package/dist/client/assets/{GoalsView-BzLA8GX9.js → GoalsView-__LpXw4S.js} +1 -1
- package/dist/client/assets/{InsightsView-Cb_tUr1V.js → InsightsView-Dv388uaO.js} +2 -2
- package/dist/client/assets/{MemoryView-CRxOPCQq.js → MemoryView-ChCbEfZT.js} +2 -2
- package/dist/client/assets/{PiExtensionsManager-XQ5rWJT3.js → PiExtensionsManager-DehAjrqN.js} +2 -2
- package/dist/client/assets/{PluginManager-CXPSlWxs.js → PluginManager-DBhJ1i27.js} +1 -1
- package/dist/client/assets/{PullRequestView-CX6fScVe.js → PullRequestView-BvmajsBq.js} +2 -2
- package/dist/client/assets/{ReportModal-BSCk5ER1.css → ReportModal-BuhhqtXJ.css} +1 -1
- package/dist/client/assets/ReportModal-DM9B_h_w.js +21 -0
- package/dist/client/assets/{ResearchView-DgKzxRUL.js → ResearchView-BzXSgUhp.js} +2 -2
- package/dist/client/assets/{SecretsView-C83SIrjR.js → SecretsView-COBqEdJj.js} +1 -1
- package/dist/client/assets/SessionTerminal-BUw_FTlh.js +2 -0
- package/dist/client/assets/SettingsModal-BDgH9XID.js +21 -0
- package/dist/client/assets/SettingsModal-BXDnzDkJ.css +1 -0
- package/dist/client/assets/SettingsModal-CsLaIrqt.js +1 -0
- package/dist/client/assets/{SettingsTextareaRow-BKGsmZ7C.js → SettingsTextareaRow-Bv3aZ9aU.js} +1 -1
- package/dist/client/assets/{SetupWizardModal-DIb4q-VT.js → SetupWizardModal-C-yMHTlW.js} +2 -2
- package/dist/client/assets/{SkillsView-D1Zxh1iX.js → SkillsView-kSHgkBar.js} +1 -1
- package/dist/client/assets/{TodoView-CGIcE6Yr.js → TodoView-DYoicJNY.js} +2 -2
- package/dist/client/assets/{WorkflowNodeEditor-BXUC0lim.js → WorkflowNodeEditor-DLno6bSJ.js} +1 -1
- package/dist/client/assets/agent-import-generation-D6P8OUuV.js +1 -0
- package/dist/client/assets/app-DegRNirF.js +13 -0
- package/dist/client/assets/{architectureDiagram-3BPJPVTR-Dv83GkUE.js → architectureDiagram-3BPJPVTR-DLqKCckA.js} +1 -1
- package/dist/client/assets/{blockDiagram-GPEHLZMM-B_j-RJOz.js → blockDiagram-GPEHLZMM-DRz6F8wZ.js} +1 -1
- package/dist/client/assets/{c4Diagram-AAUBKEIU-Cy3f-SD1.js → c4Diagram-AAUBKEIU-CJ9glQAp.js} +1 -1
- package/dist/client/assets/channel-Dj4nOgJO.js +1 -0
- package/dist/client/assets/{chunk-2J33WTMH-CPolddUJ.js → chunk-2J33WTMH-CjIBb3ln.js} +1 -1
- package/dist/client/assets/{chunk-4BX2VUAB-BAGPgwkc.js → chunk-4BX2VUAB-DrcoEr1E.js} +1 -1
- package/dist/client/assets/{chunk-55IACEB6-dzYFOH0q.js → chunk-55IACEB6-DU-WcuA9.js} +1 -1
- package/dist/client/assets/{chunk-727SXJPM-ul9hGhiR.js → chunk-727SXJPM-C5Lklr3l.js} +1 -1
- package/dist/client/assets/{chunk-AQP2D5EJ-C75yqe4-.js → chunk-AQP2D5EJ-DlyTTghY.js} +1 -1
- package/dist/client/assets/{chunk-FMBD7UC4-BwiLAyup.js → chunk-FMBD7UC4-D3C65m5Y.js} +1 -1
- package/dist/client/assets/{chunk-ND2GUHAM-CVv1sLhy.js → chunk-ND2GUHAM-BZY-4WZF.js} +1 -1
- package/dist/client/assets/{chunk-QZHKN3VN-D1c-k3xL.js → chunk-QZHKN3VN-CKUtTYy5.js} +1 -1
- package/dist/client/assets/classDiagram-4FO5ZUOK-DnkFo5Qy.js +1 -0
- package/dist/client/assets/classDiagram-v2-Q7XG4LA2-DnkFo5Qy.js +1 -0
- package/dist/client/assets/{cose-bilkent-S5V4N54A-DosMsFd6.js → cose-bilkent-S5V4N54A-DbpsF4N5.js} +1 -1
- package/dist/client/assets/{dagre-BM42HDAG-9os-QBXe.js → dagre-BM42HDAG-BwIo4me1.js} +1 -1
- package/dist/client/assets/{dashboard-view-iwAS1HTp.js → dashboard-view-BMQm7Lt_.js} +1 -1
- package/dist/client/assets/{dashboard-view-Bn7iL770.js → dashboard-view-BvAsW6UZ.js} +1 -1
- package/dist/client/assets/{dashboard-view-CNVTxyWE.js → dashboard-view-C94UCci5.js} +1 -1
- package/dist/client/assets/{diagram-2AECGRRQ-ChjuJgA6.js → diagram-2AECGRRQ-C-d8XY1c.js} +1 -1
- package/dist/client/assets/{diagram-5GNKFQAL-Cq10aB4z.js → diagram-5GNKFQAL-ByRrlL9w.js} +1 -1
- package/dist/client/assets/{diagram-KO2AKTUF-CKjyrzjg.js → diagram-KO2AKTUF-BK7jb_J-.js} +1 -1
- package/dist/client/assets/{diagram-LMA3HP47-DxCc1BsH.js → diagram-LMA3HP47-u2o4bYk6.js} +1 -1
- package/dist/client/assets/{diagram-OG6HWLK6-DJWEkDsR.js → diagram-OG6HWLK6-Dakk1V3D.js} +1 -1
- package/dist/client/assets/{erDiagram-TEJ5UH35-gVkDYC92.js → erDiagram-TEJ5UH35-Yp33v-Cf.js} +1 -1
- package/dist/client/assets/{flowDiagram-I6XJVG4X-1lw1mQRQ.js → flowDiagram-I6XJVG4X-C4-dR2TA.js} +1 -1
- package/dist/client/assets/{folder-open-Nmr7nRmN.js → folder-open-C9qq38qV.js} +1 -1
- package/dist/client/assets/{ganttDiagram-6RSMTGT7-Yzq4WZRo.js → ganttDiagram-6RSMTGT7-C0CTCkFN.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-PVQCEYII-cFR9Gv8n.js → gitGraphDiagram-PVQCEYII-DK0Dd5mm.js} +1 -1
- package/dist/client/assets/index-6FBJPKkr.css +1 -0
- package/dist/client/assets/index-BqLVwYoA.js +2661 -0
- package/dist/client/assets/{infoDiagram-5YYISTIA-BbRiTnD3.js → infoDiagram-5YYISTIA-u5MwFb7j.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-YF4QCWOH-DD4i2Znk.js → ishikawaDiagram-YF4QCWOH-C7R6TziI.js} +1 -1
- package/dist/client/assets/{journeyDiagram-JHISSGLW-qHPO2M-C.js → journeyDiagram-JHISSGLW-Dom8W5Ab.js} +1 -1
- package/dist/client/assets/{kanban-definition-UN3LZRKU-EuFfgxUv.js → kanban-definition-UN3LZRKU-_47C02t3.js} +1 -1
- package/dist/client/assets/{mermaid.core-Cru9Vzsy.js → mermaid.core-Cd3LKosp.js} +4 -4
- package/dist/client/assets/{mindmap-definition-RKZ34NQL-mCvtfapj.js → mindmap-definition-RKZ34NQL-D-qVOEin.js} +1 -1
- package/dist/client/assets/{pieDiagram-4H26LBE5-BSc_a5Dz.js → pieDiagram-4H26LBE5-B0TXvVbM.js} +1 -1
- package/dist/client/assets/{puzzle-Cz66CEWW.js → puzzle-BBYTjDQK.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-W4KKPZXB-Um2SLb_d.js → quadrantDiagram-W4KKPZXB-KcFvcZPm.js} +1 -1
- package/dist/client/assets/{requirementDiagram-4Y6WPE33-B94evN7g.js → requirementDiagram-4Y6WPE33-DEObokVc.js} +1 -1
- package/dist/client/assets/{sankeyDiagram-5OEKKPKP-BH7NLX-K.js → sankeyDiagram-5OEKKPKP-BGYnEp22.js} +1 -1
- package/dist/client/assets/{sequenceDiagram-3UESZ5HK-DusrBGQp.js → sequenceDiagram-3UESZ5HK-BcYgyJRU.js} +1 -1
- package/dist/client/assets/{shield-alert-CcQuaRHN.js → shield-alert-CZg8yaFA.js} +1 -1
- package/dist/client/assets/{standing-instructions-template-CVnY93Xy.js → standing-instructions-template-BsTtbEqp.js} +1 -1
- package/dist/client/assets/{stateDiagram-AJRCARHV-GRjL9YlX.js → stateDiagram-AJRCARHV-CfZQIqmX.js} +1 -1
- package/dist/client/assets/{stateDiagram-v2-BHNVJYJU-BBsv6ppQ.js → stateDiagram-v2-BHNVJYJU-nBEPRSH7.js} +1 -1
- package/dist/client/assets/{timeline-definition-PNZ67QCA-DC6UeqjY.js → timeline-definition-PNZ67QCA-DySyabS_.js} +1 -1
- package/dist/client/assets/{upload-CjJp7lEX.js → upload-DMd3zMLx.js} +1 -1
- package/dist/client/assets/{users-DgimRYHz.js → users-9Pyvnn8K.js} +1 -1
- package/dist/client/assets/{vennDiagram-CIIHVFJN-C272zK9h.js → vennDiagram-CIIHVFJN-DPomfxp_.js} +1 -1
- package/dist/client/assets/{wardley-L42UT6IY-KkRF-2j9.js → wardley-L42UT6IY-BPfzngS8.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-YWT4CUSO-B4brtKRt.js → wardleyDiagram-YWT4CUSO-Yp4nidAP.js} +1 -1
- package/dist/client/assets/{xychartDiagram-2RQKCTM6--PFSKt1s.js → xychartDiagram-2RQKCTM6-REgng603.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/client/version.json +1 -1
- package/dist/extension.js +3765 -8333
- package/dist/migrations/0026_bigint_counters.sql +85 -14
- package/package.json +6 -3
- package/skill/fusion/references/engine-tools.md +6 -2
- package/dist/client/assets/ChatView-Bv0J5p5U.js +0 -8
- package/dist/client/assets/DevServerView-Ue9XG_4H.js +0 -1
- package/dist/client/assets/DocumentsView-C1Ptwcv5.js +0 -1
- package/dist/client/assets/ReportModal-JhZZXZlj.js +0 -21
- package/dist/client/assets/SessionTerminal-BrK3psiC.js +0 -2
- package/dist/client/assets/SettingsModal-Bby9vLGx.js +0 -21
- package/dist/client/assets/SettingsModal-DVLqY1-7.js +0 -1
- package/dist/client/assets/SettingsModal-DXArgTTx.css +0 -1
- package/dist/client/assets/app-DUszvars.js +0 -13
- package/dist/client/assets/channel-BuhC8kaT.js +0 -1
- package/dist/client/assets/classDiagram-4FO5ZUOK-vpRR5WOg.js +0 -1
- package/dist/client/assets/classDiagram-v2-Q7XG4LA2-vpRR5WOg.js +0 -1
- package/dist/client/assets/index-Cg9ahVtV.js +0 -2661
- package/dist/client/assets/index-uhXHk1ek.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
.theme-selector{padding:0 20px 20px}.theme-mode-toggle{display:flex;align-items:center;gap:var(--space-sm);background:var(--card);border:1px solid var(--border);border-radius:var(--radius);padding:var(--space-xs);margin-bottom:20px}.theme-mode-btn{display:flex;align-items:center;justify-content:center;gap:6px;padding:var(--space-sm) var(--space-lg);background:none;border:none;border-radius:var(--radius-sm);color:var(--text-muted);font-size:13px;font-weight:500;cursor:pointer;transition:all var(--transition-fast);flex:1}.theme-mode-btn:hover{color:var(--text);background:var(--card-hover)}.theme-mode-btn.active,.theme-mode-btn.active:hover{background:var(--todo);color:var(--bg)}.theme-mode-btn:focus-visible{outline:none;border-color:var(--todo);box-shadow:var(--focus-ring-strong)}.theme-section-title{font-size:12px;font-weight:600;color:var(--text-muted);text-transform:uppercase;letter-spacing:.5px;margin-bottom:var(--space-md)}.theme-font-size-toggle{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--space-sm);margin-bottom:var(--space-lg)}.theme-font-size-btn{align-items:center;background:var(--card);border:1px solid var(--border);border-radius:var(--radius-sm);color:var(--text-muted);cursor:pointer;display:inline-flex;font-size:13px;font-weight:500;justify-content:center;min-height:calc(var(--space-2xl) + var(--space-sm));padding:var(--space-sm) var(--space-md);transition:all var(--transition-fast)}.theme-font-size-btn:hover{border-color:var(--todo);color:var(--text)}.theme-font-size-btn.active{background:color-mix(in srgb,var(--todo) 14%,transparent);border-color:var(--todo);color:var(--text)}.theme-font-size-btn:focus-visible{outline:none;border-color:var(--todo);box-shadow:var(--focus-ring-strong)}.theme-option-swatch{width:calc(var(--space-2xl) + var(--space-lg));height:calc(var(--space-2xl) + var(--space-lg));border-radius:var(--radius);border:2px solid var(--border);display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));overflow:hidden}.theme-option-swatch-sample{display:block;min-height:0}.theme-option-swatch-sample-1{background:var(--swatch-sample-1)}.theme-option-swatch-sample-2{background:var(--swatch-sample-2)}.theme-option-swatch-sample-3{background:var(--swatch-sample-3)}.theme-option-swatch-sample-4{background:var(--swatch-sample-4)}.theme-swatch-default{--swatch-sample-1: #0d1117;--swatch-sample-2: #161b22;--swatch-sample-3: #58a6ff;--swatch-sample-4: #79c0ff}.theme-swatch-ocean{--swatch-sample-1: #0a1929;--swatch-sample-2: #132f4c;--swatch-sample-3: #4fc3f7;--swatch-sample-4: #00bcd4}.theme-swatch-forest{--swatch-sample-1: #0d2818;--swatch-sample-2: #1a472a;--swatch-sample-3: #4caf50;--swatch-sample-4: #2e7d32}.theme-swatch-sunset{--swatch-sample-1: #2d1f1f;--swatch-sample-2: #4a2c2c;--swatch-sample-3: #ff8a65;--swatch-sample-4: #ff7043}.theme-swatch-zen{--swatch-sample-1: #0c0c0c;--swatch-sample-2: #111111;--swatch-sample-3: #6b7b8c;--swatch-sample-4: #7a8590}.theme-swatch-berry{--swatch-sample-1: #1a0b2e;--swatch-sample-2: #2d1b4e;--swatch-sample-3: #c084fc;--swatch-sample-4: #ec4899}.theme-swatch-monochrome{--swatch-sample-1: #0d0d0d;--swatch-sample-2: #1a1a1a;--swatch-sample-3: #a3a3a3;--swatch-sample-4: #d4d4d4}.theme-swatch-slate{--swatch-sample-1: #1e293b;--swatch-sample-2: #334155;--swatch-sample-3: #60a5fa;--swatch-sample-4: #22d3ee}.theme-swatch-ash{--swatch-sample-1: #292524;--swatch-sample-2: #44403c;--swatch-sample-3: #a8a29e;--swatch-sample-4: #d6d3d1}.theme-swatch-air{--swatch-sample-1: #0f1115;--swatch-sample-2: #151820;--swatch-sample-3: #a8bfd8;--swatch-sample-4: #eef1f4}.theme-swatch-graphite{--swatch-sample-1: #18181b;--swatch-sample-2: #27272a;--swatch-sample-3: #94a3b8;--swatch-sample-4: #cbd5e1}.theme-swatch-ember{--swatch-sample-1: #18181b;--swatch-sample-2: #27272a;--swatch-sample-3: #f97316;--swatch-sample-4: #ef4444}.theme-swatch-rust{--swatch-sample-1: #0f0b09;--swatch-sample-2: #1a1410;--swatch-sample-3: #e06830;--swatch-sample-4: #e88040}.theme-swatch-copper{--swatch-sample-1: #0e0c0a;--swatch-sample-2: #181410;--swatch-sample-3: #e89545;--swatch-sample-4: #f0a858}.theme-swatch-foundry{--swatch-sample-1: #0c0806;--swatch-sample-2: #15100c;--swatch-sample-3: #ffab20;--swatch-sample-4: #ffc040}.theme-swatch-carbon{--swatch-sample-1: #0a0b0d;--swatch-sample-2: #111318;--swatch-sample-3: #6a9acf;--swatch-sample-4: #7ab0e0}.theme-swatch-sandstone{--swatch-sample-1: #1a1712;--swatch-sample-2: #241f18;--swatch-sample-3: #d4a06a;--swatch-sample-4: #e0b080}.theme-swatch-lagoon{--swatch-sample-1: #0a1214;--swatch-sample-2: #101c1f;--swatch-sample-3: #50d8c0;--swatch-sample-4: #60e8d0}.theme-swatch-frost{--swatch-sample-1: #0c0e14;--swatch-sample-2: #121520;--swatch-sample-3: #8ac8f8;--swatch-sample-4: #9ad8ff}.theme-swatch-lavender{--swatch-sample-1: #14101a;--swatch-sample-2: #1c1624;--swatch-sample-3: #c8a0e8;--swatch-sample-4: #d8b0f0}.theme-swatch-neon-bloom{--swatch-sample-1: #120a18;--swatch-sample-2: #1a1024;--swatch-sample-3: #f080d0;--swatch-sample-4: #ff90e0}.theme-swatch-sepia{--swatch-sample-1: #161210;--swatch-sample-2: #201a16;--swatch-sample-3: #d8b878;--swatch-sample-4: #e8c888}.theme-swatch-cobalt{--swatch-sample-1: #071426;--swatch-sample-2: #102848;--swatch-sample-3: #45a8ff;--swatch-sample-4: #5eead4}.theme-swatch-clay{--swatch-sample-1: #201411;--swatch-sample-2: #3b2620;--swatch-sample-3: #ec7b4c;--swatch-sample-4: #f2a65a}.theme-swatch-moss{--swatch-sample-1: #111b16;--swatch-sample-2: #243326;--swatch-sample-3: #a8c96b;--swatch-sample-4: #72c7a1}.theme-swatch-aurora{--swatch-sample-1: var(--aurora-swatch-sample-1);--swatch-sample-2: var(--aurora-swatch-sample-2);--swatch-sample-3: var(--aurora-swatch-sample-3);--swatch-sample-4: var(--aurora-swatch-sample-4)}.theme-swatch-calm{--swatch-sample-1: var(--calm-swatch-sample-1);--swatch-sample-2: var(--calm-swatch-sample-2);--swatch-sample-3: var(--calm-swatch-sample-3);--swatch-sample-4: var(--calm-swatch-sample-4)}.theme-swatch-dawn{--swatch-sample-1: var(--dawn-swatch-sample-1);--swatch-sample-2: var(--dawn-swatch-sample-2);--swatch-sample-3: var(--dawn-swatch-sample-3);--swatch-sample-4: var(--dawn-swatch-sample-4)}.theme-swatch-silver{--swatch-sample-1: #27272a;--swatch-sample-2: #3f3f46;--swatch-sample-3: #94a3b8;--swatch-sample-4: #e2e8f0}.theme-swatch-high-contrast{--swatch-sample-1: #000000;--swatch-sample-2: #0a0a0a;--swatch-sample-3: #00ffff;--swatch-sample-4: #ffff00}.theme-swatch-industrial{--swatch-sample-1: #0c0c0c;--swatch-sample-2: #141414;--swatch-sample-3: #ff6b00;--swatch-sample-4: #ff8c00}.theme-swatch-solarized{--swatch-sample-1: #002b36;--swatch-sample-2: #073642;--swatch-sample-3: #268bd2;--swatch-sample-4: #2aa198}.theme-swatch-factory{--swatch-sample-1: #0a0a0a;--swatch-sample-2: #111111;--swatch-sample-3: #f59e0b;--swatch-sample-4: #06b6d4}.theme-swatch-factory-mono{--swatch-sample-1: #0a0a0a;--swatch-sample-2: #1a1a1a;--swatch-sample-3: #ef4444;--swatch-sample-4: #ffffff}.theme-swatch-shadcn{--swatch-sample-1: #09090b;--swatch-sample-2: #18181b;--swatch-sample-3: #f97316;--swatch-sample-4: #27272a}.theme-swatch-shadcn-ember{--swatch-sample-1: #09090b;--swatch-sample-2: #18181b;--swatch-sample-3: #e8773a;--swatch-sample-4: #27272a}.theme-swatch-shadcn-custom{--swatch-sample-1: #09090b;--swatch-sample-2: #18181b;--swatch-sample-3: #f97316;--swatch-sample-4: #27272a}.theme-swatch-shadcn-blue{--swatch-sample-1: #09090b;--swatch-sample-2: #18181b;--swatch-sample-3: #3b82f6;--swatch-sample-4: #27272a}.theme-swatch-shadcn-green{--swatch-sample-1: #09090b;--swatch-sample-2: #18181b;--swatch-sample-3: #22c55e;--swatch-sample-4: #27272a}.theme-swatch-shadcn-red{--swatch-sample-1: #09090b;--swatch-sample-2: #18181b;--swatch-sample-3: #ef4444;--swatch-sample-4: #27272a}.theme-swatch-shadcn-purple{--swatch-sample-1: #09090b;--swatch-sample-2: #18181b;--swatch-sample-3: #8b5cf6;--swatch-sample-4: #27272a}.theme-swatch-shadcn-pink{--swatch-sample-1: #09090b;--swatch-sample-2: #18181b;--swatch-sample-3: #ec4899;--swatch-sample-4: #27272a}.theme-swatch-shadcn-orange{--swatch-sample-1: #09090b;--swatch-sample-2: #18181b;--swatch-sample-3: #f97316;--swatch-sample-4: #27272a}.theme-swatch-shadcn-yellow{--swatch-sample-1: #09090b;--swatch-sample-2: #18181b;--swatch-sample-3: #eab308;--swatch-sample-4: #27272a}.theme-swatch-shadcn-mono,.theme-swatch-shadcn-mono-red{--swatch-sample-1: #09090b;--swatch-sample-2: #18181b;--swatch-sample-3: #ef4444;--swatch-sample-4: #27272a}.theme-swatch-shadcn-mono-blue{--swatch-sample-1: #09090b;--swatch-sample-2: #18181b;--swatch-sample-3: #3b82f6;--swatch-sample-4: #27272a}.theme-swatch-shadcn-mono-green{--swatch-sample-1: #09090b;--swatch-sample-2: #18181b;--swatch-sample-3: #22c55e;--swatch-sample-4: #27272a}.theme-swatch-shadcn-mono-purple{--swatch-sample-1: #09090b;--swatch-sample-2: #18181b;--swatch-sample-3: #8b5cf6;--swatch-sample-4: #27272a}.theme-swatch-shadcn-mono-pink{--swatch-sample-1: #09090b;--swatch-sample-2: #18181b;--swatch-sample-3: #ec4899;--swatch-sample-4: #27272a}.theme-swatch-shadcn-mono-orange{--swatch-sample-1: #09090b;--swatch-sample-2: #18181b;--swatch-sample-3: #f97316;--swatch-sample-4: #27272a}.theme-swatch-shadcn-mono-yellow{--swatch-sample-1: #09090b;--swatch-sample-2: #18181b;--swatch-sample-3: #eab308;--swatch-sample-4: #27272a}.theme-swatch-shadcn-black{--swatch-sample-1: #09090b;--swatch-sample-2: #18181b;--swatch-sample-3: #fafafa;--swatch-sample-4: #27272a}.theme-swatch-shadcn-gray{--swatch-sample-1: #09090b;--swatch-sample-2: #18181b;--swatch-sample-3: #a1a1aa;--swatch-sample-4: #27272a}.theme-swatch-shadcn-gray-blue{--swatch-sample-1: #020617;--swatch-sample-2: #0f172a;--swatch-sample-3: #64748b;--swatch-sample-4: #1e293b}.theme-swatch-ayu{--swatch-sample-1: #0f1419;--swatch-sample-2: #131d27;--swatch-sample-3: #39bae6;--swatch-sample-4: #ffb454}.theme-swatch-one-dark{--swatch-sample-1: #282c34;--swatch-sample-2: #21252b;--swatch-sample-3: #61afef;--swatch-sample-4: #00e5ff}.theme-swatch-nord{--swatch-sample-1: #2e3440;--swatch-sample-2: #3b4252;--swatch-sample-3: #88c0d0;--swatch-sample-4: #81a1c1}.theme-swatch-dracula{--swatch-sample-1: #282a36;--swatch-sample-2: #21222c;--swatch-sample-3: #8be9fd;--swatch-sample-4: #00e5ff}.theme-swatch-gruvbox{--swatch-sample-1: #282828;--swatch-sample-2: #1d2021;--swatch-sample-3: #83a598;--swatch-sample-4: #d3869b}.theme-swatch-tokyo-night{--swatch-sample-1: #1a1b26;--swatch-sample-2: #16161e;--swatch-sample-3: #7aa2f7;--swatch-sample-4: #00e5ff}.theme-swatch-catppuccin-mocha{--swatch-sample-1: #1e1e2e;--swatch-sample-2: #181825;--swatch-sample-3: #89b4fa;--swatch-sample-4: #89dceb}.theme-swatch-github-dark{--swatch-sample-1: #0d1117;--swatch-sample-2: #010409;--swatch-sample-3: #58a6ff;--swatch-sample-4: #79c0ff}.theme-swatch-everforest{--swatch-sample-1: #2d353b;--swatch-sample-2: #272e33;--swatch-sample-3: #7fbbb3;--swatch-sample-4: #e0c8a8}.theme-swatch-rose-pine{--swatch-sample-1: #191724;--swatch-sample-2: #1f1d2e;--swatch-sample-3: #c4a7e7;--swatch-sample-4: #ebbcba}.theme-swatch-kanagawa{--swatch-sample-1: #1f1f28;--swatch-sample-2: #16161d;--swatch-sample-3: #7e9cd8;--swatch-sample-4: #7e9cd8}.theme-swatch-night-owl{--swatch-sample-1: #011627;--swatch-sample-2: #01111d;--swatch-sample-3: #82aaff;--swatch-sample-4: #addb67}.theme-swatch-palenight{--swatch-sample-1: #292d3e;--swatch-sample-2: #1e2235;--swatch-sample-3: #82aaff;--swatch-sample-4: #ffcb6b}.theme-swatch-monokai-pro{--swatch-sample-1: #2d2a2e;--swatch-sample-2: #252229;--swatch-sample-3: #78dce8;--swatch-sample-4: #ff6188}.theme-swatch-slime{--swatch-sample-1: #0a0e09;--swatch-sample-2: #0f150d;--swatch-sample-3: #8aff40;--swatch-sample-4: #40e8a0}.theme-swatch-brutalist{--swatch-sample-1: #101010;--swatch-sample-2: #171717;--swatch-sample-3: #ff6a00;--swatch-sample-4: #ffd100}.theme-swatch-neon-city{--swatch-sample-1: #0d0d15;--swatch-sample-2: #121326;--swatch-sample-3: #ff2d95;--swatch-sample-4: #00f0ff}.theme-swatch-parchment{--swatch-sample-1: #1b1712;--swatch-sample-2: #252019;--swatch-sample-3: #d08a4b;--swatch-sample-4: #be6e3c}.theme-swatch-terminal{--swatch-sample-1: #0a0a0a;--swatch-sample-2: #0f120d;--swatch-sample-3: #33ff00;--swatch-sample-4: #8fff38}.theme-swatch-glass{--swatch-sample-1: #13111f;--swatch-sample-2: color-mix(in srgb, #221b34 78%, transparent);--swatch-sample-3: #c86bff;--swatch-sample-4: #ff7aa8}.theme-swatch-glass-silver{--swatch-sample-1: #101216;--swatch-sample-2: color-mix(in srgb, #252a32 78%, transparent);--swatch-sample-3: #d7dde6;--swatch-sample-4: #9ca6b4}.theme-swatch-horizon{--swatch-sample-1: #1c1e26;--swatch-sample-2: #16161c;--swatch-sample-3: #e59371;--swatch-sample-4: #f08c42}.theme-swatch-vitesse{--swatch-sample-1: #121817;--swatch-sample-2: #0d1210;--swatch-sample-3: #4c9a91;--swatch-sample-4: #dca561}.theme-swatch-outrun{--swatch-sample-1: #0a0a14;--swatch-sample-2: #0d0d1a;--swatch-sample-3: #ff2d95;--swatch-sample-4: #b537f2}.theme-swatch-snazzy{--swatch-sample-1: #282a36;--swatch-sample-2: #1e1f29;--swatch-sample-3: #ff5c57;--swatch-sample-4: #5af78e}.theme-swatch-porple{--swatch-sample-1: #292d3e;--swatch-sample-2: #1e2030;--swatch-sample-3: #c792ea;--swatch-sample-4: #82aaff}.theme-swatch-espresso{--swatch-sample-1: #2c1f1a;--swatch-sample-2: #231813;--swatch-sample-3: #d4a574;--swatch-sample-4: #c17d56}.theme-swatch-mars{--swatch-sample-1: #1a1210;--swatch-sample-2: #140e0c;--swatch-sample-3: #c1440e;--swatch-sample-4: #e77d3d}.theme-swatch-poimandres{--swatch-sample-1: #1a1b26;--swatch-sample-2: #14151f;--swatch-sample-3: #89ddff;--swatch-sample-4: #5de4c7}[data-theme=light] .theme-swatch-factory{--swatch-sample-1: #f5f5f5;--swatch-sample-2: #ffffff;--swatch-sample-3: #d97706;--swatch-sample-4: #0891b2}[data-theme=light] .theme-swatch-factory-mono{--swatch-sample-1: #f5f5f5;--swatch-sample-2: #ffffff;--swatch-sample-3: #dc2626;--swatch-sample-4: #1a1a1a}[data-theme=light] .theme-swatch-shadcn{--swatch-sample-1: #ffffff;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #ea580c;--swatch-sample-4: #e4e4e7}[data-theme=light] .theme-swatch-shadcn-ember{--swatch-sample-1: #ffffff;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #d4622a;--swatch-sample-4: #e4e4e7}[data-theme=light] .theme-swatch-shadcn-custom{--swatch-sample-1: #ffffff;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #ea580c;--swatch-sample-4: #e4e4e7}[data-theme=light] .theme-swatch-shadcn-blue{--swatch-sample-1: #ffffff;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #2563eb;--swatch-sample-4: #e4e4e7}[data-theme=light] .theme-swatch-shadcn-green{--swatch-sample-1: #ffffff;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #16a34a;--swatch-sample-4: #e4e4e7}[data-theme=light] .theme-swatch-shadcn-red{--swatch-sample-1: #ffffff;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #dc2626;--swatch-sample-4: #e4e4e7}[data-theme=light] .theme-swatch-shadcn-purple{--swatch-sample-1: #ffffff;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #7c3aed;--swatch-sample-4: #e4e4e7}[data-theme=light] .theme-swatch-shadcn-pink{--swatch-sample-1: #ffffff;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #db2777;--swatch-sample-4: #e4e4e7}[data-theme=light] .theme-swatch-shadcn-orange{--swatch-sample-1: #ffffff;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #ea580c;--swatch-sample-4: #e4e4e7}[data-theme=light] .theme-swatch-shadcn-yellow{--swatch-sample-1: #ffffff;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #ca8a04;--swatch-sample-4: #e4e4e7}[data-theme=light] .theme-swatch-shadcn-mono,[data-theme=light] .theme-swatch-shadcn-mono-red{--swatch-sample-1: #ffffff;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #dc2626;--swatch-sample-4: #e4e4e7}[data-theme=light] .theme-swatch-shadcn-mono-blue{--swatch-sample-1: #ffffff;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #2563eb;--swatch-sample-4: #e4e4e7}[data-theme=light] .theme-swatch-shadcn-mono-green{--swatch-sample-1: #ffffff;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #16a34a;--swatch-sample-4: #e4e4e7}[data-theme=light] .theme-swatch-shadcn-mono-purple{--swatch-sample-1: #ffffff;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #7c3aed;--swatch-sample-4: #e4e4e7}[data-theme=light] .theme-swatch-shadcn-mono-pink{--swatch-sample-1: #ffffff;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #db2777;--swatch-sample-4: #e4e4e7}[data-theme=light] .theme-swatch-shadcn-mono-orange{--swatch-sample-1: #ffffff;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #ea580c;--swatch-sample-4: #e4e4e7}[data-theme=light] .theme-swatch-shadcn-mono-yellow{--swatch-sample-1: #ffffff;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #ca8a04;--swatch-sample-4: #e4e4e7}[data-theme=light] .theme-swatch-shadcn-black{--swatch-sample-1: #ffffff;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #09090b;--swatch-sample-4: #e4e4e7}[data-theme=light] .theme-swatch-shadcn-gray{--swatch-sample-1: #ffffff;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #52525b;--swatch-sample-4: #e4e4e7}[data-theme=light] .theme-swatch-shadcn-gray-blue{--swatch-sample-1: #ffffff;--swatch-sample-2: #f1f5f9;--swatch-sample-3: #475569;--swatch-sample-4: #e2e8f0}[data-theme=light] .theme-swatch-ayu{--swatch-sample-1: #fafafa;--swatch-sample-2: #f3f3f3;--swatch-sample-3: #007acc;--swatch-sample-4: #ff8f40}[data-theme=light] .theme-swatch-zen{--swatch-sample-1: #f5f5f5;--swatch-sample-2: #fafafa;--swatch-sample-3: #5a6a7a;--swatch-sample-4: #6a757f}[data-theme=light] .theme-swatch-nord{--swatch-sample-1: #eceff4;--swatch-sample-2: #e5e9f0;--swatch-sample-3: #5e81ac;--swatch-sample-4: #5e81ac}[data-theme=light] .theme-swatch-dracula{--swatch-sample-1: #f8f8f2;--swatch-sample-2: #efeefa;--swatch-sample-3: #0097a7;--swatch-sample-4: #00bcd4}[data-theme=light] .theme-swatch-gruvbox{--swatch-sample-1: #fbf1c7;--swatch-sample-2: #f2e5bc;--swatch-sample-3: #076678;--swatch-sample-4: #8f3f71}[data-theme=light] .theme-swatch-tokyo-night{--swatch-sample-1: #e1e2e7;--swatch-sample-2: #d5d6db;--swatch-sample-3: #3b5ea5;--swatch-sample-4: #00bcd4}[data-theme=light] .theme-swatch-catppuccin-mocha{--swatch-sample-1: #eff1f5;--swatch-sample-2: #e6e9ef;--swatch-sample-3: #1e66f5;--swatch-sample-4: #04a5e5}[data-theme=light] .theme-swatch-github-dark{--swatch-sample-1: #ffffff;--swatch-sample-2: #f6f8fa;--swatch-sample-3: #0969da;--swatch-sample-4: #0969da}[data-theme=light] .theme-swatch-everforest{--swatch-sample-1: #fdf6e3;--swatch-sample-2: #f4f0d9;--swatch-sample-3: #3a94a5;--swatch-sample-4: #83a08a}[data-theme=light] .theme-swatch-rose-pine{--swatch-sample-1: #faf4ed;--swatch-sample-2: #fffaf3;--swatch-sample-3: #907aa9;--swatch-sample-4: #b4637a}[data-theme=light] .theme-swatch-kanagawa{--swatch-sample-1: #edeadd;--swatch-sample-2: #e1ddd4;--swatch-sample-3: #4e76b5;--swatch-sample-4: #4e76b5}[data-theme=light] .theme-swatch-one-dark{--swatch-sample-1: #fafafa;--swatch-sample-2: #f0f0f0;--swatch-sample-3: #4078f2;--swatch-sample-4: #0184bc}[data-theme=light] .theme-swatch-night-owl{--swatch-sample-1: #f6f7f9;--swatch-sample-2: #eef0f4;--swatch-sample-3: #2563eb;--swatch-sample-4: #5a9e2f}[data-theme=light] .theme-swatch-palenight{--swatch-sample-1: #f5f7fa;--swatch-sample-2: #ebeef5;--swatch-sample-3: #3b6fcf;--swatch-sample-4: #c49020}[data-theme=light] .theme-swatch-monokai-pro{--swatch-sample-1: #faf8f5;--swatch-sample-2: #f0ece5;--swatch-sample-3: #2d8fa0;--swatch-sample-4: #c4405e}[data-theme=light] .theme-swatch-slime{--swatch-sample-1: #f2f7ea;--swatch-sample-2: #e6efda;--swatch-sample-3: #3d8f10;--swatch-sample-4: #1a8a6a}[data-theme=light] .theme-swatch-brutalist{--swatch-sample-1: #ece9e4;--swatch-sample-2: #f7f4ef;--swatch-sample-3: #d9480f;--swatch-sample-4: #b8860b}[data-theme=light] .theme-swatch-neon-city{--swatch-sample-1: #f7f5ff;--swatch-sample-2: #f1edff;--swatch-sample-3: #cc166e;--swatch-sample-4: #008e9b}[data-theme=light] .theme-swatch-parchment{--swatch-sample-1: #f5f0e8;--swatch-sample-2: #efe7dc;--swatch-sample-3: #a8562f;--swatch-sample-4: #8f4e2a}[data-theme=light] .theme-swatch-terminal{--swatch-sample-1: #e7f5dd;--swatch-sample-2: #deefd2;--swatch-sample-3: #2d6b14;--swatch-sample-4: #4c8f25}[data-theme=light] .theme-swatch-glass{--swatch-sample-1: #eceaf5;--swatch-sample-2: color-mix(in srgb, #ffffff 75%, transparent);--swatch-sample-3: #9d40cf;--swatch-sample-4: #c74b7a}[data-theme=light] .theme-swatch-glass-silver{--swatch-sample-1: #eef0f3;--swatch-sample-2: color-mix(in srgb, #ffffff 75%, transparent);--swatch-sample-3: #5f6875;--swatch-sample-4: #747f8c}[data-theme=light] .theme-swatch-slate{--swatch-sample-1: #f1f5f9;--swatch-sample-2: #e2e8f0;--swatch-sample-3: #3b5ea5;--swatch-sample-4: #4f7090}[data-theme=light] .theme-swatch-ash{--swatch-sample-1: #fafaf9;--swatch-sample-2: #f5f5f4;--swatch-sample-3: #5a6a7a;--swatch-sample-4: #768694}[data-theme=light] .theme-swatch-air{--swatch-sample-1: #fbfbfa;--swatch-sample-2: #ffffff;--swatch-sample-3: #536b86;--swatch-sample-4: #26313d}[data-theme=light] .theme-swatch-graphite{--swatch-sample-1: #fafafa;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #6f7f90;--swatch-sample-4: #8a99aa}[data-theme=light] .theme-swatch-ember{--swatch-sample-1: #fafafa;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #d9480f;--swatch-sample-4: #e8646a}[data-theme=light] .theme-swatch-rust{--swatch-sample-1: #f5efe8;--swatch-sample-2: #ebe3d8;--swatch-sample-3: #a04020;--swatch-sample-4: #b85828}[data-theme=light] .theme-swatch-copper{--swatch-sample-1: #f3ede6;--swatch-sample-2: #e8e0d6;--swatch-sample-3: #905820;--swatch-sample-4: #a87030}[data-theme=light] .theme-swatch-foundry{--swatch-sample-1: #f5f0e6;--swatch-sample-2: #ebe4d6;--swatch-sample-3: #c07808;--swatch-sample-4: #d08a10}[data-theme=light] .theme-swatch-carbon{--swatch-sample-1: #eef0f4;--swatch-sample-2: #e2e6ec;--swatch-sample-3: #3a6090;--swatch-sample-4: #4878a0}[data-theme=light] .theme-swatch-sandstone{--swatch-sample-1: #f5f0e8;--swatch-sample-2: #ebe4d8;--swatch-sample-3: #a07040;--swatch-sample-4: #b08050}[data-theme=light] .theme-swatch-lagoon{--swatch-sample-1: #eef5f3;--swatch-sample-2: #e0ebe8;--swatch-sample-3: #208070;--swatch-sample-4: #289080}[data-theme=light] .theme-swatch-frost{--swatch-sample-1: #f0f4f8;--swatch-sample-2: #e4eaf0;--swatch-sample-3: #3078a8;--swatch-sample-4: #4088b8}[data-theme=light] .theme-swatch-lavender{--swatch-sample-1: #f4f0f8;--swatch-sample-2: #e8e2f0;--swatch-sample-3: #8060a0;--swatch-sample-4: #9070b0}[data-theme=light] .theme-swatch-neon-bloom{--swatch-sample-1: #f8f0f8;--swatch-sample-2: #f0e4f0;--swatch-sample-3: #a03090;--swatch-sample-4: #b040a0}[data-theme=light] .theme-swatch-sepia{--swatch-sample-1: #f5f0e4;--swatch-sample-2: #ece4d4;--swatch-sample-3: #907040;--swatch-sample-4: #a08050}[data-theme=light] .theme-swatch-cobalt{--swatch-sample-1: #f3f8ff;--swatch-sample-2: #e8f2ff;--swatch-sample-3: #146fc0;--swatch-sample-4: #12806f}[data-theme=light] .theme-swatch-clay{--swatch-sample-1: #fbf3ea;--swatch-sample-2: #f4e4d4;--swatch-sample-3: #ad4d25;--swatch-sample-4: #b55b26}[data-theme=light] .theme-swatch-moss{--swatch-sample-1: #f2f6ee;--swatch-sample-2: #e5eddf;--swatch-sample-3: #557a35;--swatch-sample-4: #397c49}[data-theme=light] .theme-swatch-aurora{--swatch-sample-1: var(--aurora-swatch-sample-1);--swatch-sample-2: var(--aurora-swatch-sample-2);--swatch-sample-3: var(--aurora-swatch-sample-3);--swatch-sample-4: var(--aurora-swatch-sample-4)}[data-theme=light] .theme-swatch-calm{--swatch-sample-1: var(--calm-swatch-sample-1);--swatch-sample-2: var(--calm-swatch-sample-2);--swatch-sample-3: var(--calm-swatch-sample-3);--swatch-sample-4: var(--calm-swatch-sample-4)}[data-theme=light] .theme-swatch-dawn{--swatch-sample-1: var(--dawn-swatch-sample-1);--swatch-sample-2: var(--dawn-swatch-sample-2);--swatch-sample-3: var(--dawn-swatch-sample-3);--swatch-sample-4: var(--dawn-swatch-sample-4)}[data-theme=light] .theme-swatch-silver{--swatch-sample-1: #fafafa;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #6b7280;--swatch-sample-4: #9ca3af}[data-theme=light] .theme-swatch-horizon{--swatch-sample-1: #fdf0ed;--swatch-sample-2: #f9cec0;--swatch-sample-3: #e8646a;--swatch-sample-4: #f08c42}[data-theme=light] .theme-swatch-vitesse{--swatch-sample-1: #f8f5f0;--swatch-sample-2: #efe9e0;--swatch-sample-3: #3a8578;--swatch-sample-4: #c08040}[data-theme=light] .theme-swatch-outrun{--swatch-sample-1: #f0f0f5;--swatch-sample-2: #e8e8ef;--swatch-sample-3: #d02080;--swatch-sample-4: #9030c8}[data-theme=light] .theme-swatch-snazzy{--swatch-sample-1: #fafafa;--swatch-sample-2: #f0f0f2;--swatch-sample-3: #d04040;--swatch-sample-4: #30a050}[data-theme=light] .theme-swatch-porple{--swatch-sample-1: #f5f3f7;--swatch-sample-2: #eae7ef;--swatch-sample-3: #9060d8;--swatch-sample-4: #4080c8}[data-theme=light] .theme-swatch-espresso{--swatch-sample-1: #f5ece4;--swatch-sample-2: #ebe1d6;--swatch-sample-3: #a07050;--swatch-sample-4: #906040}[data-theme=light] .theme-swatch-mars{--swatch-sample-1: #f5ece6;--swatch-sample-2: #ebe0d4;--swatch-sample-3: #a03010;--swatch-sample-4: #c06030}[data-theme=light] .theme-swatch-poimandres{--swatch-sample-1: #f0f0f5;--swatch-sample-2: #e6e6ee;--swatch-sample-3: #4090c0;--swatch-sample-4: #30a090}.theme-reset-btn{display:flex;align-items:center;justify-content:center;gap:var(--space-sm);margin-top:20px;padding:10px 16px;background:var(--card);border:1px solid var(--border);border-radius:var(--radius);color:var(--text-muted);font-size:13px;font-weight:500;cursor:pointer;transition:all var(--transition-fast);width:100%}.theme-reset-btn:hover{background:var(--card-hover);color:var(--text);border-color:var(--text-muted)}.theme-reset-btn:focus-visible{outline:none;border-color:var(--todo);box-shadow:var(--focus-ring-strong)}@media(max-width:768px){.model-combobox-dropdown{max-height:50vh;width:min(360px,calc(100vw - 32px))}.model-combobox-search{font-size:16px}.model-combobox-option{min-height:36px}.theme-selector{padding:0 14px 14px}.theme-font-size-toggle{grid-template-columns:1fr}}.shadcn-color-picker{display:flex;flex-direction:column;gap:var(--space-md);padding:var(--card-padding);border:var(--btn-border-width) solid var(--border);background:var(--card)}.shadcn-color-picker-header{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--space-md)}.shadcn-color-picker-heading{min-width:0}.shadcn-color-picker-title{margin:0;color:var(--text);font-size:var(--font-size-base);font-weight:600}.shadcn-color-picker-description{margin:var(--space-xs) 0 0;color:var(--text-muted);font-size:var(--font-size-xs)}.shadcn-color-picker-toggle{flex:0 0 auto}.shadcn-color-picker-controls-panel{display:flex;flex-direction:column;gap:var(--space-sm)}.shadcn-color-picker-actions{display:flex;justify-content:flex-end}.shadcn-color-picker-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(calc(var(--space-2xl) * 7),1fr));gap:var(--space-sm)}.shadcn-color-picker-row{display:flex;align-items:center;justify-content:space-between;gap:var(--space-sm);padding:var(--space-sm);border:var(--btn-border-width) solid var(--border);border-radius:var(--radius-md);background:var(--surface)}.shadcn-color-picker-label{display:flex;min-width:0;flex-direction:column;gap:var(--space-xs);color:var(--text);font-size:var(--font-size-xs);font-weight:500}.shadcn-color-picker-label code{color:var(--text-muted);font-family:var(--font-mono);font-size:var(--font-size-xs);font-weight:400}.shadcn-color-picker-controls{display:flex;align-items:center;gap:var(--space-xs)}.shadcn-color-picker-native{width:calc(var(--space-xl) * 2);height:calc(var(--space-xl) * 2);padding:0;border:var(--btn-border-width) solid var(--border);border-radius:var(--radius-sm);background:var(--surface);cursor:pointer}.shadcn-color-picker-hex{width:calc(var(--space-2xl) * 3);font-family:var(--font-mono)}@media(max-width:768px){.shadcn-color-picker-header,.shadcn-color-picker-row,.shadcn-color-picker-controls,.shadcn-color-picker-actions{align-items:stretch;flex-direction:column}.shadcn-color-picker-toggle{align-self:flex-start}.shadcn-color-picker-grid{grid-template-columns:1fr}.shadcn-color-picker-native,.shadcn-color-picker-hex{width:100%}}.theme-dropdown{position:relative;display:flex;flex-direction:column;gap:var(--space-sm);min-inline-size:0}.theme-dropdown.open{z-index:10002}.theme-dropdown-trigger{justify-content:space-between;gap:var(--space-sm);inline-size:100%;min-inline-size:0}.theme-dropdown--current-row{margin-bottom:var(--space-lg)}.theme-dropdown-trigger .theme-option-swatch,.theme-dropdown-option .theme-option-swatch{flex:0 0 auto}.theme-dropdown-trigger-label,.theme-dropdown-option-label{min-inline-size:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.theme-dropdown-trigger--current-row{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;align-items:center;gap:var(--space-md);padding:var(--space-md) var(--space-lg);border-color:var(--border);background:var(--card);color:var(--text);text-align:start}.theme-dropdown-current-row-icon{display:flex;align-items:center;justify-content:center;inline-size:calc(var(--space-2xl) + var(--space-md));block-size:calc(var(--space-2xl) + var(--space-md));border-radius:var(--radius);background:var(--surface);color:var(--todo)}.theme-dropdown-current-row-info{display:grid;gap:var(--space-xs);min-inline-size:0}.theme-dropdown-current-row-label{color:var(--text-muted);font-size:var(--font-size-sm)}.theme-dropdown-current-row-value{overflow:hidden;color:var(--text);font-weight:600;text-overflow:ellipsis;white-space:nowrap}.theme-dropdown-trigger--current-row:hover,.theme-dropdown-trigger--current-row:focus-visible{border-color:var(--accent);background:color-mix(in srgb,var(--card) 90%,var(--accent))}.theme-dropdown-modes{display:flex;flex-wrap:wrap;gap:var(--space-xs)}.theme-dropdown-mode-btn{gap:var(--space-xs)}.theme-dropdown-mode-btn.active{border-color:var(--accent);color:var(--accent)}.theme-dropdown-popover{position:absolute;z-index:10002;inset-block-start:calc(100% + var(--space-xs));inset-inline:0;padding:var(--space-sm);border:1px solid var(--border-subtle);border-radius:var(--radius-md);background:var(--surface-1);box-shadow:var(--shadow-lg)}.theme-dropdown-list{display:grid;gap:var(--space-xs);max-block-size:min(60vh,calc(var(--space-2xl) * 12));overflow-y:auto;overscroll-behavior:contain}.theme-dropdown-option{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:var(--space-sm);inline-size:100%;padding:var(--space-sm);border:1px solid transparent;border-radius:var(--radius-sm);background:transparent;color:var(--text);cursor:pointer;text-align:start}.theme-dropdown-option:hover,.theme-dropdown-option:focus-visible,.theme-dropdown-option.active{border-color:var(--accent);background:color-mix(in srgb,var(--accent) 10%,transparent);outline:none}@media(max-width:768px){.theme-dropdown.open{z-index:auto}.theme-dropdown-popover{position:static;z-index:auto;margin-block-start:var(--space-xs)}.theme-dropdown-list{max-block-size:min(50vh,calc(var(--space-2xl) * 10))}.theme-dropdown-trigger--current-row{padding:var(--space-md)}}.report-action-menu{position:relative}.report-action-menu__list{z-index:var(--z-dropdown);display:grid;gap:var(--space-xs);min-inline-size:calc(var(--space-2xl) * 6);padding:var(--space-sm);border:1px solid var(--border);border-radius:var(--radius-md);background:var(--card);box-shadow:var(--shadow-lg)}.report-action-menu__list--portal{position:fixed}.report-action-menu__item{display:flex;align-items:center;gap:var(--space-sm);padding:var(--space-sm) var(--space-md);border:0;border-radius:var(--radius-sm);color:var(--text);background:transparent;text-align:left}.report-action-menu__item:hover,.report-action-menu__item:focus-visible{background:var(--surface-hover)}.report-action-menu__item svg{inline-size:1em;block-size:1em}@media(max-width:768px){.report-action-menu__list--portal{right:auto!important}}.report-modal-backdrop{position:fixed;inset:0;z-index:var(--z-modal);display:grid;place-items:center;padding:var(--space-4);background:color-mix(in srgb,var(--bg-base) 70%,transparent)}.report-modal{position:relative;display:grid;gap:var(--space-3);inline-size:min(var(--space-96),100%);padding:var(--space-5)}.report-modal textarea{min-block-size:var(--space-32);resize:vertical}.report-modal__close{position:absolute;inset-block-start:var(--space-2);inset-inline-end:var(--space-2)}.report-modal__error{color:var(--color-error)}.report-modal__warning{color:var(--color-warning)}.report-modal__screenshot-option{display:flex;gap:var(--space-2);align-items:center}.report-modal__screenshot-preview{display:grid;gap:var(--space-2);padding:var(--space-3);border-radius:var(--radius-md);background:color-mix(in srgb,var(--bg-raised) 85%,transparent)}.report-modal__activity-trace{padding:var(--space-3);border-radius:var(--radius-md);background:color-mix(in srgb,var(--bg-raised) 85%,transparent)}.report-modal__activity-trace ul{margin:var(--space-2) 0 0;padding-inline-start:var(--space-5)}@media(max-width:768px){.report-modal{inline-size:100%;padding:var(--space-4)}}
|
|
1
|
+
.theme-selector{padding:0 20px 20px}.theme-mode-toggle{display:flex;align-items:center;gap:var(--space-sm);background:var(--card);border:1px solid var(--border);border-radius:var(--radius);padding:var(--space-xs);margin-bottom:20px}.theme-mode-btn{display:flex;align-items:center;justify-content:center;gap:6px;padding:var(--space-sm) var(--space-lg);background:none;border:none;border-radius:var(--radius-sm);color:var(--text-muted);font-size:13px;font-weight:500;cursor:pointer;transition:all var(--transition-fast);flex:1}.theme-mode-btn:hover{color:var(--text);background:var(--card-hover)}.theme-mode-btn.active,.theme-mode-btn.active:hover{background:var(--todo);color:var(--bg)}.theme-mode-btn:focus-visible{outline:none;border-color:var(--todo);box-shadow:var(--focus-ring-strong)}.theme-section-title{font-size:12px;font-weight:600;color:var(--text-muted);text-transform:uppercase;letter-spacing:.5px;margin-bottom:var(--space-md)}.theme-font-size-toggle{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--space-sm);margin-bottom:var(--space-lg)}.theme-font-size-btn{align-items:center;background:var(--card);border:1px solid var(--border);border-radius:var(--radius-sm);color:var(--text-muted);cursor:pointer;display:inline-flex;font-size:13px;font-weight:500;justify-content:center;min-height:calc(var(--space-2xl) + var(--space-sm));padding:var(--space-sm) var(--space-md);transition:all var(--transition-fast)}.theme-font-size-btn:hover{border-color:var(--todo);color:var(--text)}.theme-font-size-btn.active{background:color-mix(in srgb,var(--todo) 14%,transparent);border-color:var(--todo);color:var(--text)}.theme-font-size-btn:focus-visible{outline:none;border-color:var(--todo);box-shadow:var(--focus-ring-strong)}.theme-option-swatch{width:calc(var(--space-2xl) + var(--space-lg));height:calc(var(--space-2xl) + var(--space-lg));border-radius:var(--radius);border:2px solid var(--border);display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));overflow:hidden}.theme-option-swatch-sample{display:block;min-height:0}.theme-option-swatch-sample-1{background:var(--swatch-sample-1)}.theme-option-swatch-sample-2{background:var(--swatch-sample-2)}.theme-option-swatch-sample-3{background:var(--swatch-sample-3)}.theme-option-swatch-sample-4{background:var(--swatch-sample-4)}.theme-swatch-default{--swatch-sample-1: #0d1117;--swatch-sample-2: #161b22;--swatch-sample-3: #58a6ff;--swatch-sample-4: #79c0ff}.theme-swatch-ocean{--swatch-sample-1: #0a1929;--swatch-sample-2: #132f4c;--swatch-sample-3: #4fc3f7;--swatch-sample-4: #00bcd4}.theme-swatch-forest{--swatch-sample-1: #0d2818;--swatch-sample-2: #1a472a;--swatch-sample-3: #4caf50;--swatch-sample-4: #2e7d32}.theme-swatch-sunset{--swatch-sample-1: #2d1f1f;--swatch-sample-2: #4a2c2c;--swatch-sample-3: #ff8a65;--swatch-sample-4: #ff7043}.theme-swatch-zen{--swatch-sample-1: #0c0c0c;--swatch-sample-2: #111111;--swatch-sample-3: #6b7b8c;--swatch-sample-4: #7a8590}.theme-swatch-berry{--swatch-sample-1: #1a0b2e;--swatch-sample-2: #2d1b4e;--swatch-sample-3: #c084fc;--swatch-sample-4: #ec4899}.theme-swatch-monochrome{--swatch-sample-1: #0d0d0d;--swatch-sample-2: #1a1a1a;--swatch-sample-3: #a3a3a3;--swatch-sample-4: #d4d4d4}.theme-swatch-slate{--swatch-sample-1: #1e293b;--swatch-sample-2: #334155;--swatch-sample-3: #60a5fa;--swatch-sample-4: #22d3ee}.theme-swatch-ash{--swatch-sample-1: #292524;--swatch-sample-2: #44403c;--swatch-sample-3: #a8a29e;--swatch-sample-4: #d6d3d1}.theme-swatch-air{--swatch-sample-1: #0f1115;--swatch-sample-2: #151820;--swatch-sample-3: #a8bfd8;--swatch-sample-4: #eef1f4}.theme-swatch-graphite{--swatch-sample-1: #18181b;--swatch-sample-2: #27272a;--swatch-sample-3: #94a3b8;--swatch-sample-4: #cbd5e1}.theme-swatch-ember{--swatch-sample-1: #18181b;--swatch-sample-2: #27272a;--swatch-sample-3: #f97316;--swatch-sample-4: #ef4444}.theme-swatch-rust{--swatch-sample-1: #0f0b09;--swatch-sample-2: #1a1410;--swatch-sample-3: #e06830;--swatch-sample-4: #e88040}.theme-swatch-copper{--swatch-sample-1: #0e0c0a;--swatch-sample-2: #181410;--swatch-sample-3: #e89545;--swatch-sample-4: #f0a858}.theme-swatch-foundry{--swatch-sample-1: #0c0806;--swatch-sample-2: #15100c;--swatch-sample-3: #ffab20;--swatch-sample-4: #ffc040}.theme-swatch-carbon{--swatch-sample-1: #0a0b0d;--swatch-sample-2: #111318;--swatch-sample-3: #6a9acf;--swatch-sample-4: #7ab0e0}.theme-swatch-sandstone{--swatch-sample-1: #1a1712;--swatch-sample-2: #241f18;--swatch-sample-3: #d4a06a;--swatch-sample-4: #e0b080}.theme-swatch-lagoon{--swatch-sample-1: #0a1214;--swatch-sample-2: #101c1f;--swatch-sample-3: #50d8c0;--swatch-sample-4: #60e8d0}.theme-swatch-frost{--swatch-sample-1: #0c0e14;--swatch-sample-2: #121520;--swatch-sample-3: #8ac8f8;--swatch-sample-4: #9ad8ff}.theme-swatch-lavender{--swatch-sample-1: #14101a;--swatch-sample-2: #1c1624;--swatch-sample-3: #c8a0e8;--swatch-sample-4: #d8b0f0}.theme-swatch-neon-bloom{--swatch-sample-1: #120a18;--swatch-sample-2: #1a1024;--swatch-sample-3: #f080d0;--swatch-sample-4: #ff90e0}.theme-swatch-sepia{--swatch-sample-1: #161210;--swatch-sample-2: #201a16;--swatch-sample-3: #d8b878;--swatch-sample-4: #e8c888}.theme-swatch-cobalt{--swatch-sample-1: #071426;--swatch-sample-2: #102848;--swatch-sample-3: #45a8ff;--swatch-sample-4: #5eead4}.theme-swatch-clay{--swatch-sample-1: #201411;--swatch-sample-2: #3b2620;--swatch-sample-3: #ec7b4c;--swatch-sample-4: #f2a65a}.theme-swatch-moss{--swatch-sample-1: #111b16;--swatch-sample-2: #243326;--swatch-sample-3: #a8c96b;--swatch-sample-4: #72c7a1}.theme-swatch-aurora{--swatch-sample-1: var(--aurora-swatch-sample-1);--swatch-sample-2: var(--aurora-swatch-sample-2);--swatch-sample-3: var(--aurora-swatch-sample-3);--swatch-sample-4: var(--aurora-swatch-sample-4)}.theme-swatch-calm{--swatch-sample-1: var(--calm-swatch-sample-1);--swatch-sample-2: var(--calm-swatch-sample-2);--swatch-sample-3: var(--calm-swatch-sample-3);--swatch-sample-4: var(--calm-swatch-sample-4)}.theme-swatch-dawn{--swatch-sample-1: var(--dawn-swatch-sample-1);--swatch-sample-2: var(--dawn-swatch-sample-2);--swatch-sample-3: var(--dawn-swatch-sample-3);--swatch-sample-4: var(--dawn-swatch-sample-4)}.theme-swatch-silver{--swatch-sample-1: #27272a;--swatch-sample-2: #3f3f46;--swatch-sample-3: #94a3b8;--swatch-sample-4: #e2e8f0}.theme-swatch-high-contrast{--swatch-sample-1: #000000;--swatch-sample-2: #0a0a0a;--swatch-sample-3: #00ffff;--swatch-sample-4: #ffff00}.theme-swatch-industrial{--swatch-sample-1: #0c0c0c;--swatch-sample-2: #141414;--swatch-sample-3: #ff6b00;--swatch-sample-4: #ff8c00}.theme-swatch-solarized{--swatch-sample-1: #002b36;--swatch-sample-2: #073642;--swatch-sample-3: #268bd2;--swatch-sample-4: #2aa198}.theme-swatch-factory{--swatch-sample-1: #0a0a0a;--swatch-sample-2: #111111;--swatch-sample-3: #f59e0b;--swatch-sample-4: #06b6d4}.theme-swatch-factory-mono{--swatch-sample-1: #0a0a0a;--swatch-sample-2: #1a1a1a;--swatch-sample-3: #ef4444;--swatch-sample-4: #ffffff}.theme-swatch-shadcn{--swatch-sample-1: #09090b;--swatch-sample-2: #18181b;--swatch-sample-3: #f97316;--swatch-sample-4: #27272a}.theme-swatch-shadcn-ember{--swatch-sample-1: #09090b;--swatch-sample-2: #18181b;--swatch-sample-3: #e8773a;--swatch-sample-4: #27272a}.theme-swatch-shadcn-custom{--swatch-sample-1: #09090b;--swatch-sample-2: #18181b;--swatch-sample-3: #f97316;--swatch-sample-4: #27272a}.theme-swatch-shadcn-blue{--swatch-sample-1: #09090b;--swatch-sample-2: #18181b;--swatch-sample-3: #3b82f6;--swatch-sample-4: #27272a}.theme-swatch-shadcn-green{--swatch-sample-1: #09090b;--swatch-sample-2: #18181b;--swatch-sample-3: #22c55e;--swatch-sample-4: #27272a}.theme-swatch-shadcn-red{--swatch-sample-1: #09090b;--swatch-sample-2: #18181b;--swatch-sample-3: #ef4444;--swatch-sample-4: #27272a}.theme-swatch-shadcn-purple{--swatch-sample-1: #09090b;--swatch-sample-2: #18181b;--swatch-sample-3: #8b5cf6;--swatch-sample-4: #27272a}.theme-swatch-shadcn-pink{--swatch-sample-1: #09090b;--swatch-sample-2: #18181b;--swatch-sample-3: #ec4899;--swatch-sample-4: #27272a}.theme-swatch-shadcn-orange{--swatch-sample-1: #09090b;--swatch-sample-2: #18181b;--swatch-sample-3: #f97316;--swatch-sample-4: #27272a}.theme-swatch-shadcn-yellow{--swatch-sample-1: #09090b;--swatch-sample-2: #18181b;--swatch-sample-3: #eab308;--swatch-sample-4: #27272a}.theme-swatch-shadcn-mono,.theme-swatch-shadcn-mono-red{--swatch-sample-1: #09090b;--swatch-sample-2: #18181b;--swatch-sample-3: #ef4444;--swatch-sample-4: #27272a}.theme-swatch-shadcn-mono-blue{--swatch-sample-1: #09090b;--swatch-sample-2: #18181b;--swatch-sample-3: #3b82f6;--swatch-sample-4: #27272a}.theme-swatch-shadcn-mono-green{--swatch-sample-1: #09090b;--swatch-sample-2: #18181b;--swatch-sample-3: #22c55e;--swatch-sample-4: #27272a}.theme-swatch-shadcn-mono-purple{--swatch-sample-1: #09090b;--swatch-sample-2: #18181b;--swatch-sample-3: #8b5cf6;--swatch-sample-4: #27272a}.theme-swatch-shadcn-mono-pink{--swatch-sample-1: #09090b;--swatch-sample-2: #18181b;--swatch-sample-3: #ec4899;--swatch-sample-4: #27272a}.theme-swatch-shadcn-mono-orange{--swatch-sample-1: #09090b;--swatch-sample-2: #18181b;--swatch-sample-3: #f97316;--swatch-sample-4: #27272a}.theme-swatch-shadcn-mono-yellow{--swatch-sample-1: #09090b;--swatch-sample-2: #18181b;--swatch-sample-3: #eab308;--swatch-sample-4: #27272a}.theme-swatch-shadcn-black{--swatch-sample-1: #09090b;--swatch-sample-2: #18181b;--swatch-sample-3: #fafafa;--swatch-sample-4: #27272a}.theme-swatch-shadcn-gray{--swatch-sample-1: #09090b;--swatch-sample-2: #18181b;--swatch-sample-3: #a1a1aa;--swatch-sample-4: #27272a}.theme-swatch-shadcn-gray-blue{--swatch-sample-1: #020617;--swatch-sample-2: #0f172a;--swatch-sample-3: #64748b;--swatch-sample-4: #1e293b}.theme-swatch-ayu{--swatch-sample-1: #0f1419;--swatch-sample-2: #131d27;--swatch-sample-3: #39bae6;--swatch-sample-4: #ffb454}.theme-swatch-one-dark{--swatch-sample-1: #282c34;--swatch-sample-2: #21252b;--swatch-sample-3: #61afef;--swatch-sample-4: #00e5ff}.theme-swatch-nord{--swatch-sample-1: #2e3440;--swatch-sample-2: #3b4252;--swatch-sample-3: #88c0d0;--swatch-sample-4: #81a1c1}.theme-swatch-dracula{--swatch-sample-1: #282a36;--swatch-sample-2: #21222c;--swatch-sample-3: #8be9fd;--swatch-sample-4: #00e5ff}.theme-swatch-gruvbox{--swatch-sample-1: #282828;--swatch-sample-2: #1d2021;--swatch-sample-3: #83a598;--swatch-sample-4: #d3869b}.theme-swatch-tokyo-night{--swatch-sample-1: #1a1b26;--swatch-sample-2: #16161e;--swatch-sample-3: #7aa2f7;--swatch-sample-4: #00e5ff}.theme-swatch-catppuccin-mocha{--swatch-sample-1: #1e1e2e;--swatch-sample-2: #181825;--swatch-sample-3: #89b4fa;--swatch-sample-4: #89dceb}.theme-swatch-github-dark{--swatch-sample-1: #0d1117;--swatch-sample-2: #010409;--swatch-sample-3: #58a6ff;--swatch-sample-4: #79c0ff}.theme-swatch-everforest{--swatch-sample-1: #2d353b;--swatch-sample-2: #272e33;--swatch-sample-3: #7fbbb3;--swatch-sample-4: #e0c8a8}.theme-swatch-rose-pine{--swatch-sample-1: #191724;--swatch-sample-2: #1f1d2e;--swatch-sample-3: #c4a7e7;--swatch-sample-4: #ebbcba}.theme-swatch-kanagawa{--swatch-sample-1: #1f1f28;--swatch-sample-2: #16161d;--swatch-sample-3: #7e9cd8;--swatch-sample-4: #7e9cd8}.theme-swatch-night-owl{--swatch-sample-1: #011627;--swatch-sample-2: #01111d;--swatch-sample-3: #82aaff;--swatch-sample-4: #addb67}.theme-swatch-palenight{--swatch-sample-1: #292d3e;--swatch-sample-2: #1e2235;--swatch-sample-3: #82aaff;--swatch-sample-4: #ffcb6b}.theme-swatch-monokai-pro{--swatch-sample-1: #2d2a2e;--swatch-sample-2: #252229;--swatch-sample-3: #78dce8;--swatch-sample-4: #ff6188}.theme-swatch-slime{--swatch-sample-1: #0a0e09;--swatch-sample-2: #0f150d;--swatch-sample-3: #8aff40;--swatch-sample-4: #40e8a0}.theme-swatch-brutalist{--swatch-sample-1: #101010;--swatch-sample-2: #171717;--swatch-sample-3: #ff6a00;--swatch-sample-4: #ffd100}.theme-swatch-neon-city{--swatch-sample-1: #0d0d15;--swatch-sample-2: #121326;--swatch-sample-3: #ff2d95;--swatch-sample-4: #00f0ff}.theme-swatch-parchment{--swatch-sample-1: #1b1712;--swatch-sample-2: #252019;--swatch-sample-3: #d08a4b;--swatch-sample-4: #be6e3c}.theme-swatch-terminal{--swatch-sample-1: #0a0a0a;--swatch-sample-2: #0f120d;--swatch-sample-3: #33ff00;--swatch-sample-4: #8fff38}.theme-swatch-glass{--swatch-sample-1: #13111f;--swatch-sample-2: color-mix(in srgb, #221b34 78%, transparent);--swatch-sample-3: #c86bff;--swatch-sample-4: #ff7aa8}.theme-swatch-glass-silver{--swatch-sample-1: #101216;--swatch-sample-2: color-mix(in srgb, #252a32 78%, transparent);--swatch-sample-3: #d7dde6;--swatch-sample-4: #9ca6b4}.theme-swatch-horizon{--swatch-sample-1: #1c1e26;--swatch-sample-2: #16161c;--swatch-sample-3: #e59371;--swatch-sample-4: #f08c42}.theme-swatch-vitesse{--swatch-sample-1: #121817;--swatch-sample-2: #0d1210;--swatch-sample-3: #4c9a91;--swatch-sample-4: #dca561}.theme-swatch-outrun{--swatch-sample-1: #0a0a14;--swatch-sample-2: #0d0d1a;--swatch-sample-3: #ff2d95;--swatch-sample-4: #b537f2}.theme-swatch-snazzy{--swatch-sample-1: #282a36;--swatch-sample-2: #1e1f29;--swatch-sample-3: #ff5c57;--swatch-sample-4: #5af78e}.theme-swatch-porple{--swatch-sample-1: #292d3e;--swatch-sample-2: #1e2030;--swatch-sample-3: #c792ea;--swatch-sample-4: #82aaff}.theme-swatch-espresso{--swatch-sample-1: #2c1f1a;--swatch-sample-2: #231813;--swatch-sample-3: #d4a574;--swatch-sample-4: #c17d56}.theme-swatch-mars{--swatch-sample-1: #1a1210;--swatch-sample-2: #140e0c;--swatch-sample-3: #c1440e;--swatch-sample-4: #e77d3d}.theme-swatch-poimandres{--swatch-sample-1: #1a1b26;--swatch-sample-2: #14151f;--swatch-sample-3: #89ddff;--swatch-sample-4: #5de4c7}[data-theme=light] .theme-swatch-factory{--swatch-sample-1: #f5f5f5;--swatch-sample-2: #ffffff;--swatch-sample-3: #d97706;--swatch-sample-4: #0891b2}[data-theme=light] .theme-swatch-factory-mono{--swatch-sample-1: #f5f5f5;--swatch-sample-2: #ffffff;--swatch-sample-3: #dc2626;--swatch-sample-4: #1a1a1a}[data-theme=light] .theme-swatch-shadcn{--swatch-sample-1: #ffffff;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #ea580c;--swatch-sample-4: #e4e4e7}[data-theme=light] .theme-swatch-shadcn-ember{--swatch-sample-1: #ffffff;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #d4622a;--swatch-sample-4: #e4e4e7}[data-theme=light] .theme-swatch-shadcn-custom{--swatch-sample-1: #ffffff;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #ea580c;--swatch-sample-4: #e4e4e7}[data-theme=light] .theme-swatch-shadcn-blue{--swatch-sample-1: #ffffff;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #2563eb;--swatch-sample-4: #e4e4e7}[data-theme=light] .theme-swatch-shadcn-green{--swatch-sample-1: #ffffff;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #16a34a;--swatch-sample-4: #e4e4e7}[data-theme=light] .theme-swatch-shadcn-red{--swatch-sample-1: #ffffff;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #dc2626;--swatch-sample-4: #e4e4e7}[data-theme=light] .theme-swatch-shadcn-purple{--swatch-sample-1: #ffffff;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #7c3aed;--swatch-sample-4: #e4e4e7}[data-theme=light] .theme-swatch-shadcn-pink{--swatch-sample-1: #ffffff;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #db2777;--swatch-sample-4: #e4e4e7}[data-theme=light] .theme-swatch-shadcn-orange{--swatch-sample-1: #ffffff;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #ea580c;--swatch-sample-4: #e4e4e7}[data-theme=light] .theme-swatch-shadcn-yellow{--swatch-sample-1: #ffffff;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #ca8a04;--swatch-sample-4: #e4e4e7}[data-theme=light] .theme-swatch-shadcn-mono,[data-theme=light] .theme-swatch-shadcn-mono-red{--swatch-sample-1: #ffffff;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #dc2626;--swatch-sample-4: #e4e4e7}[data-theme=light] .theme-swatch-shadcn-mono-blue{--swatch-sample-1: #ffffff;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #2563eb;--swatch-sample-4: #e4e4e7}[data-theme=light] .theme-swatch-shadcn-mono-green{--swatch-sample-1: #ffffff;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #16a34a;--swatch-sample-4: #e4e4e7}[data-theme=light] .theme-swatch-shadcn-mono-purple{--swatch-sample-1: #ffffff;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #7c3aed;--swatch-sample-4: #e4e4e7}[data-theme=light] .theme-swatch-shadcn-mono-pink{--swatch-sample-1: #ffffff;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #db2777;--swatch-sample-4: #e4e4e7}[data-theme=light] .theme-swatch-shadcn-mono-orange{--swatch-sample-1: #ffffff;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #ea580c;--swatch-sample-4: #e4e4e7}[data-theme=light] .theme-swatch-shadcn-mono-yellow{--swatch-sample-1: #ffffff;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #ca8a04;--swatch-sample-4: #e4e4e7}[data-theme=light] .theme-swatch-shadcn-black{--swatch-sample-1: #ffffff;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #09090b;--swatch-sample-4: #e4e4e7}[data-theme=light] .theme-swatch-shadcn-gray{--swatch-sample-1: #ffffff;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #52525b;--swatch-sample-4: #e4e4e7}[data-theme=light] .theme-swatch-shadcn-gray-blue{--swatch-sample-1: #ffffff;--swatch-sample-2: #f1f5f9;--swatch-sample-3: #475569;--swatch-sample-4: #e2e8f0}[data-theme=light] .theme-swatch-ayu{--swatch-sample-1: #fafafa;--swatch-sample-2: #f3f3f3;--swatch-sample-3: #007acc;--swatch-sample-4: #ff8f40}[data-theme=light] .theme-swatch-zen{--swatch-sample-1: #f5f5f5;--swatch-sample-2: #fafafa;--swatch-sample-3: #5a6a7a;--swatch-sample-4: #6a757f}[data-theme=light] .theme-swatch-nord{--swatch-sample-1: #eceff4;--swatch-sample-2: #e5e9f0;--swatch-sample-3: #5e81ac;--swatch-sample-4: #5e81ac}[data-theme=light] .theme-swatch-dracula{--swatch-sample-1: #f8f8f2;--swatch-sample-2: #efeefa;--swatch-sample-3: #0097a7;--swatch-sample-4: #00bcd4}[data-theme=light] .theme-swatch-gruvbox{--swatch-sample-1: #fbf1c7;--swatch-sample-2: #f2e5bc;--swatch-sample-3: #076678;--swatch-sample-4: #8f3f71}[data-theme=light] .theme-swatch-tokyo-night{--swatch-sample-1: #e1e2e7;--swatch-sample-2: #d5d6db;--swatch-sample-3: #3b5ea5;--swatch-sample-4: #00bcd4}[data-theme=light] .theme-swatch-catppuccin-mocha{--swatch-sample-1: #eff1f5;--swatch-sample-2: #e6e9ef;--swatch-sample-3: #1e66f5;--swatch-sample-4: #04a5e5}[data-theme=light] .theme-swatch-github-dark{--swatch-sample-1: #ffffff;--swatch-sample-2: #f6f8fa;--swatch-sample-3: #0969da;--swatch-sample-4: #0969da}[data-theme=light] .theme-swatch-everforest{--swatch-sample-1: #fdf6e3;--swatch-sample-2: #f4f0d9;--swatch-sample-3: #3a94a5;--swatch-sample-4: #83a08a}[data-theme=light] .theme-swatch-rose-pine{--swatch-sample-1: #faf4ed;--swatch-sample-2: #fffaf3;--swatch-sample-3: #907aa9;--swatch-sample-4: #b4637a}[data-theme=light] .theme-swatch-kanagawa{--swatch-sample-1: #edeadd;--swatch-sample-2: #e1ddd4;--swatch-sample-3: #4e76b5;--swatch-sample-4: #4e76b5}[data-theme=light] .theme-swatch-one-dark{--swatch-sample-1: #fafafa;--swatch-sample-2: #f0f0f0;--swatch-sample-3: #4078f2;--swatch-sample-4: #0184bc}[data-theme=light] .theme-swatch-night-owl{--swatch-sample-1: #f6f7f9;--swatch-sample-2: #eef0f4;--swatch-sample-3: #2563eb;--swatch-sample-4: #5a9e2f}[data-theme=light] .theme-swatch-palenight{--swatch-sample-1: #f5f7fa;--swatch-sample-2: #ebeef5;--swatch-sample-3: #3b6fcf;--swatch-sample-4: #c49020}[data-theme=light] .theme-swatch-monokai-pro{--swatch-sample-1: #faf8f5;--swatch-sample-2: #f0ece5;--swatch-sample-3: #2d8fa0;--swatch-sample-4: #c4405e}[data-theme=light] .theme-swatch-slime{--swatch-sample-1: #f2f7ea;--swatch-sample-2: #e6efda;--swatch-sample-3: #3d8f10;--swatch-sample-4: #1a8a6a}[data-theme=light] .theme-swatch-brutalist{--swatch-sample-1: #ece9e4;--swatch-sample-2: #f7f4ef;--swatch-sample-3: #d9480f;--swatch-sample-4: #b8860b}[data-theme=light] .theme-swatch-neon-city{--swatch-sample-1: #f7f5ff;--swatch-sample-2: #f1edff;--swatch-sample-3: #cc166e;--swatch-sample-4: #008e9b}[data-theme=light] .theme-swatch-parchment{--swatch-sample-1: #f5f0e8;--swatch-sample-2: #efe7dc;--swatch-sample-3: #a8562f;--swatch-sample-4: #8f4e2a}[data-theme=light] .theme-swatch-terminal{--swatch-sample-1: #e7f5dd;--swatch-sample-2: #deefd2;--swatch-sample-3: #2d6b14;--swatch-sample-4: #4c8f25}[data-theme=light] .theme-swatch-glass{--swatch-sample-1: #eceaf5;--swatch-sample-2: color-mix(in srgb, #ffffff 75%, transparent);--swatch-sample-3: #9d40cf;--swatch-sample-4: #c74b7a}[data-theme=light] .theme-swatch-glass-silver{--swatch-sample-1: #eef0f3;--swatch-sample-2: color-mix(in srgb, #ffffff 75%, transparent);--swatch-sample-3: #5f6875;--swatch-sample-4: #747f8c}[data-theme=light] .theme-swatch-slate{--swatch-sample-1: #f1f5f9;--swatch-sample-2: #e2e8f0;--swatch-sample-3: #3b5ea5;--swatch-sample-4: #4f7090}[data-theme=light] .theme-swatch-ash{--swatch-sample-1: #fafaf9;--swatch-sample-2: #f5f5f4;--swatch-sample-3: #5a6a7a;--swatch-sample-4: #768694}[data-theme=light] .theme-swatch-air{--swatch-sample-1: #fbfbfa;--swatch-sample-2: #ffffff;--swatch-sample-3: #536b86;--swatch-sample-4: #26313d}[data-theme=light] .theme-swatch-graphite{--swatch-sample-1: #fafafa;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #6f7f90;--swatch-sample-4: #8a99aa}[data-theme=light] .theme-swatch-ember{--swatch-sample-1: #fafafa;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #d9480f;--swatch-sample-4: #e8646a}[data-theme=light] .theme-swatch-rust{--swatch-sample-1: #f5efe8;--swatch-sample-2: #ebe3d8;--swatch-sample-3: #a04020;--swatch-sample-4: #b85828}[data-theme=light] .theme-swatch-copper{--swatch-sample-1: #f3ede6;--swatch-sample-2: #e8e0d6;--swatch-sample-3: #905820;--swatch-sample-4: #a87030}[data-theme=light] .theme-swatch-foundry{--swatch-sample-1: #f5f0e6;--swatch-sample-2: #ebe4d6;--swatch-sample-3: #c07808;--swatch-sample-4: #d08a10}[data-theme=light] .theme-swatch-carbon{--swatch-sample-1: #eef0f4;--swatch-sample-2: #e2e6ec;--swatch-sample-3: #3a6090;--swatch-sample-4: #4878a0}[data-theme=light] .theme-swatch-sandstone{--swatch-sample-1: #f5f0e8;--swatch-sample-2: #ebe4d8;--swatch-sample-3: #a07040;--swatch-sample-4: #b08050}[data-theme=light] .theme-swatch-lagoon{--swatch-sample-1: #eef5f3;--swatch-sample-2: #e0ebe8;--swatch-sample-3: #208070;--swatch-sample-4: #289080}[data-theme=light] .theme-swatch-frost{--swatch-sample-1: #f0f4f8;--swatch-sample-2: #e4eaf0;--swatch-sample-3: #3078a8;--swatch-sample-4: #4088b8}[data-theme=light] .theme-swatch-lavender{--swatch-sample-1: #f4f0f8;--swatch-sample-2: #e8e2f0;--swatch-sample-3: #8060a0;--swatch-sample-4: #9070b0}[data-theme=light] .theme-swatch-neon-bloom{--swatch-sample-1: #f8f0f8;--swatch-sample-2: #f0e4f0;--swatch-sample-3: #a03090;--swatch-sample-4: #b040a0}[data-theme=light] .theme-swatch-sepia{--swatch-sample-1: #f5f0e4;--swatch-sample-2: #ece4d4;--swatch-sample-3: #907040;--swatch-sample-4: #a08050}[data-theme=light] .theme-swatch-cobalt{--swatch-sample-1: #f3f8ff;--swatch-sample-2: #e8f2ff;--swatch-sample-3: #146fc0;--swatch-sample-4: #12806f}[data-theme=light] .theme-swatch-clay{--swatch-sample-1: #fbf3ea;--swatch-sample-2: #f4e4d4;--swatch-sample-3: #ad4d25;--swatch-sample-4: #b55b26}[data-theme=light] .theme-swatch-moss{--swatch-sample-1: #f2f6ee;--swatch-sample-2: #e5eddf;--swatch-sample-3: #557a35;--swatch-sample-4: #397c49}[data-theme=light] .theme-swatch-aurora{--swatch-sample-1: var(--aurora-swatch-sample-1);--swatch-sample-2: var(--aurora-swatch-sample-2);--swatch-sample-3: var(--aurora-swatch-sample-3);--swatch-sample-4: var(--aurora-swatch-sample-4)}[data-theme=light] .theme-swatch-calm{--swatch-sample-1: var(--calm-swatch-sample-1);--swatch-sample-2: var(--calm-swatch-sample-2);--swatch-sample-3: var(--calm-swatch-sample-3);--swatch-sample-4: var(--calm-swatch-sample-4)}[data-theme=light] .theme-swatch-dawn{--swatch-sample-1: var(--dawn-swatch-sample-1);--swatch-sample-2: var(--dawn-swatch-sample-2);--swatch-sample-3: var(--dawn-swatch-sample-3);--swatch-sample-4: var(--dawn-swatch-sample-4)}[data-theme=light] .theme-swatch-silver{--swatch-sample-1: #fafafa;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #6b7280;--swatch-sample-4: #9ca3af}[data-theme=light] .theme-swatch-horizon{--swatch-sample-1: #fdf0ed;--swatch-sample-2: #f9cec0;--swatch-sample-3: #e8646a;--swatch-sample-4: #f08c42}[data-theme=light] .theme-swatch-vitesse{--swatch-sample-1: #f8f5f0;--swatch-sample-2: #efe9e0;--swatch-sample-3: #3a8578;--swatch-sample-4: #c08040}[data-theme=light] .theme-swatch-outrun{--swatch-sample-1: #f0f0f5;--swatch-sample-2: #e8e8ef;--swatch-sample-3: #d02080;--swatch-sample-4: #9030c8}[data-theme=light] .theme-swatch-snazzy{--swatch-sample-1: #fafafa;--swatch-sample-2: #f0f0f2;--swatch-sample-3: #d04040;--swatch-sample-4: #30a050}[data-theme=light] .theme-swatch-porple{--swatch-sample-1: #f5f3f7;--swatch-sample-2: #eae7ef;--swatch-sample-3: #9060d8;--swatch-sample-4: #4080c8}[data-theme=light] .theme-swatch-espresso{--swatch-sample-1: #f5ece4;--swatch-sample-2: #ebe1d6;--swatch-sample-3: #a07050;--swatch-sample-4: #906040}[data-theme=light] .theme-swatch-mars{--swatch-sample-1: #f5ece6;--swatch-sample-2: #ebe0d4;--swatch-sample-3: #a03010;--swatch-sample-4: #c06030}[data-theme=light] .theme-swatch-poimandres{--swatch-sample-1: #f0f0f5;--swatch-sample-2: #e6e6ee;--swatch-sample-3: #4090c0;--swatch-sample-4: #30a090}.theme-reset-btn{display:flex;align-items:center;justify-content:center;gap:var(--space-sm);margin-top:20px;padding:10px 16px;background:var(--card);border:1px solid var(--border);border-radius:var(--radius);color:var(--text-muted);font-size:13px;font-weight:500;cursor:pointer;transition:all var(--transition-fast);width:100%}.theme-reset-btn:hover{background:var(--card-hover);color:var(--text);border-color:var(--text-muted)}.theme-reset-btn:focus-visible{outline:none;border-color:var(--todo);box-shadow:var(--focus-ring-strong)}@media(max-width:768px){.model-combobox-dropdown{max-height:50vh;width:min(360px,calc(100vw - 32px))}.model-combobox-search{font-size:16px}.model-combobox-option{min-height:36px}.theme-selector{padding:0 14px 14px}.theme-font-size-toggle{grid-template-columns:1fr}}.shadcn-color-picker{display:flex;flex-direction:column;gap:var(--space-md);padding:var(--card-padding);border:var(--btn-border-width) solid var(--border);background:var(--card)}.shadcn-color-picker-header{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--space-md)}.shadcn-color-picker-heading{min-width:0}.shadcn-color-picker-title{margin:0;color:var(--text);font-size:var(--font-size-base);font-weight:600}.shadcn-color-picker-description{margin:var(--space-xs) 0 0;color:var(--text-muted);font-size:var(--font-size-xs)}.shadcn-color-picker-toggle{flex:0 0 auto}.shadcn-color-picker-controls-panel{display:flex;flex-direction:column;gap:var(--space-sm)}.shadcn-color-picker-actions{display:flex;justify-content:flex-end}.shadcn-color-picker-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(calc(var(--space-2xl) * 7),1fr));gap:var(--space-sm)}.shadcn-color-picker-row{display:flex;align-items:center;justify-content:space-between;gap:var(--space-sm);padding:var(--space-sm);border:var(--btn-border-width) solid var(--border);border-radius:var(--radius-md);background:var(--surface)}.shadcn-color-picker-label{display:flex;min-width:0;flex-direction:column;gap:var(--space-xs);color:var(--text);font-size:var(--font-size-xs);font-weight:500}.shadcn-color-picker-label code{color:var(--text-muted);font-family:var(--font-mono);font-size:var(--font-size-xs);font-weight:400}.shadcn-color-picker-controls{display:flex;align-items:center;gap:var(--space-xs)}.shadcn-color-picker-native{width:calc(var(--space-xl) * 2);height:calc(var(--space-xl) * 2);padding:0;border:var(--btn-border-width) solid var(--border);border-radius:var(--radius-sm);background:var(--surface);cursor:pointer}.shadcn-color-picker-hex{width:calc(var(--space-2xl) * 3);font-family:var(--font-mono)}@media(max-width:768px){.shadcn-color-picker-header,.shadcn-color-picker-row,.shadcn-color-picker-controls,.shadcn-color-picker-actions{align-items:stretch;flex-direction:column}.shadcn-color-picker-toggle{align-self:flex-start}.shadcn-color-picker-grid{grid-template-columns:1fr}.shadcn-color-picker-native,.shadcn-color-picker-hex{width:100%}}.theme-dropdown{position:relative;display:flex;flex-direction:column;gap:var(--space-sm);min-inline-size:0}.theme-dropdown.open{z-index:10002}.theme-dropdown-trigger{justify-content:space-between;gap:var(--space-sm);inline-size:100%;min-inline-size:0}.theme-dropdown--current-row{margin-bottom:var(--space-lg)}.theme-dropdown-trigger .theme-option-swatch,.theme-dropdown-option .theme-option-swatch{flex:0 0 auto}.theme-dropdown-trigger-label,.theme-dropdown-option-label{min-inline-size:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.theme-dropdown-trigger--current-row{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;align-items:center;gap:var(--space-md);padding:var(--space-md) var(--space-lg);border-color:var(--border);background:var(--card);color:var(--text);text-align:start}.theme-dropdown-current-row-icon{display:flex;align-items:center;justify-content:center;inline-size:calc(var(--space-2xl) + var(--space-md));block-size:calc(var(--space-2xl) + var(--space-md));border-radius:var(--radius);background:var(--surface);color:var(--todo)}.theme-dropdown-current-row-info{display:grid;gap:var(--space-xs);min-inline-size:0}.theme-dropdown-current-row-label{color:var(--text-muted);font-size:var(--font-size-sm)}.theme-dropdown-current-row-value{overflow:hidden;color:var(--text);font-weight:600;text-overflow:ellipsis;white-space:nowrap}.theme-dropdown-trigger--current-row:hover,.theme-dropdown-trigger--current-row:focus-visible{border-color:var(--accent);background:color-mix(in srgb,var(--card) 90%,var(--accent))}.theme-dropdown-modes{display:flex;flex-wrap:wrap;gap:var(--space-xs)}.theme-dropdown-mode-btn{gap:var(--space-xs)}.theme-dropdown-mode-btn.active{border-color:var(--accent);color:var(--accent)}.theme-dropdown-popover{position:absolute;z-index:10002;inset-block-start:calc(100% + var(--space-xs));inset-inline:0;padding:var(--space-sm);border:1px solid var(--border-subtle);border-radius:var(--radius-md);background:var(--surface-1);box-shadow:var(--shadow-lg);display:grid;gap:var(--space-sm);min-inline-size:0}.theme-dropdown-filter{display:block;min-inline-size:0}.theme-dropdown-filter .input{inline-size:100%;min-inline-size:0}.theme-dropdown-filter .input:focus-visible{border-color:var(--accent);box-shadow:var(--focus-ring)}.theme-dropdown-no-results{margin:0;padding:var(--space-sm);border-radius:var(--radius-sm);background:var(--surface);color:var(--text-muted);font-size:var(--font-size-sm)}.theme-dropdown-list{display:grid;gap:var(--space-xs);max-block-size:min(60vh,calc(var(--space-2xl) * 12));overflow-y:auto;overscroll-behavior:contain;min-inline-size:0}.theme-dropdown-option{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:var(--space-sm);inline-size:100%;padding:var(--space-sm);border:1px solid transparent;border-radius:var(--radius-sm);background:transparent;color:var(--text);cursor:pointer;text-align:start}.theme-dropdown-option:hover,.theme-dropdown-option:focus-visible,.theme-dropdown-option.active{border-color:var(--accent);background:color-mix(in srgb,var(--accent) 10%,transparent);outline:none}@media(max-width:768px){.theme-dropdown.open{z-index:auto}.theme-dropdown-popover{position:static;z-index:auto;margin-block-start:var(--space-xs)}.theme-dropdown-list{max-block-size:min(50vh,calc(var(--space-2xl) * 10))}.theme-dropdown-trigger--current-row{padding:var(--space-md)}}.report-action-menu{position:relative}.report-action-menu__list{z-index:var(--z-dropdown);display:grid;gap:var(--space-xs);min-inline-size:calc(var(--space-2xl) * 6);padding:var(--space-sm);border:1px solid var(--border);border-radius:var(--radius-md);background:var(--card);box-shadow:var(--shadow-lg)}.report-action-menu__list--portal{position:fixed}.report-action-menu__item{display:flex;align-items:center;gap:var(--space-sm);padding:var(--space-sm) var(--space-md);border:0;border-radius:var(--radius-sm);color:var(--text);background:transparent;text-align:left}.report-action-menu__item:hover,.report-action-menu__item:focus-visible{background:var(--surface-hover)}.report-action-menu__item svg{inline-size:1em;block-size:1em}@media(max-width:768px){.report-action-menu__list--portal{right:auto!important}}.report-modal-backdrop{position:fixed;inset:0;z-index:var(--z-modal);display:grid;place-items:center;padding:var(--space-4);background:color-mix(in srgb,var(--bg-base) 70%,transparent)}.report-modal{position:relative;display:grid;gap:var(--space-3);inline-size:min(var(--space-96),100%);padding:var(--space-5)}.report-modal textarea{min-block-size:var(--space-32);resize:vertical}.report-modal__close{position:absolute;inset-block-start:var(--space-2);inset-inline-end:var(--space-2)}.report-modal__error{color:var(--color-error)}.report-modal__warning{color:var(--color-warning)}.report-modal__screenshot-option{display:flex;gap:var(--space-2);align-items:center}.report-modal__screenshot-preview{display:grid;gap:var(--space-2);padding:var(--space-3);border-radius:var(--radius-md);background:color-mix(in srgb,var(--bg-raised) 85%,transparent)}.report-modal__activity-trace{padding:var(--space-3);border-radius:var(--radius-md);background:color-mix(in srgb,var(--bg-raised) 85%,transparent)}.report-modal__activity-trace ul{margin:var(--space-2) 0 0;padding-inline-start:var(--space-5)}@media(max-width:768px){.report-modal{inline-size:100%;padding:var(--space-4)}}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import{r as o,j as e,b as se}from"./vendor-react-SZ_qB27O.js";import{c as L,c_ as re,d1 as Q,a9 as le,C as X,d2 as ne,d3 as oe,q as ce,b1 as ie,bu as he,d4 as A,d5 as de,d6 as Y}from"./index-BqLVwYoA.js";import{u as V}from"./vendor-i18n-GF3RlKbq.js";/**
|
|
2
|
+
* @license lucide-react v1.7.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const ue=[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]],me=L("bug",ue);/**
|
|
7
|
+
* @license lucide-react v1.7.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const pe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.93 4.93 4.24 4.24",key:"1ymg45"}],["path",{d:"m14.83 9.17 4.24-4.24",key:"1cb5xl"}],["path",{d:"m14.83 14.83 4.24 4.24",key:"q42g0n"}],["path",{d:"m9.17 14.83-4.24 4.24",key:"bqpfvv"}],["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}]],be=L("life-buoy",pe);/**
|
|
12
|
+
* @license lucide-react v1.7.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/const we=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],fe=L("moon",we);/**
|
|
17
|
+
* @license lucide-react v1.7.0 - ISC
|
|
18
|
+
*
|
|
19
|
+
* This source code is licensed under the ISC license.
|
|
20
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
+
*/const ve=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],ye=L("sun",ve);async function G(t,i){const l=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!l.ok)throw new Error((await l.json().catch(()=>({error:l.statusText}))).error??l.statusText);return l.json()}function ge(t){return G("/api/report/draft",t)}function Ne(t){return G("/api/report/file",t)}function xe(t){return G("/api/report/help",{question:t})}async function ke(t){const i=new FormData;i.append("screenshot",t,"report-screenshot.png");const l=await fetch("/api/report/attachment",{method:"POST",body:i});if(!l.ok)throw new Error((await l.json().catch(()=>({error:l.statusText}))).error??l.statusText);return l.json()}async function Me(){const t=await fetch("/api/report/discussion-categories");if(!t.ok)throw new Error((await t.json().catch(()=>({error:t.statusText}))).error??t.statusText);return t.json()}function $e(t){const i=new URLSearchParams(t.search),l=t.hash.match(/^#\/tasks\/([^/?#]+)/),h=l?.[1]?decodeURIComponent(l[1]):i.get("taskId")??void 0,u=i.get("agentId")??void 0;return h||u?{taskId:h,agentId:u}:void 0}const J=[{value:"light",label:"Light",icon:ye},{value:"dark",label:"Dark",icon:fe},{value:"system",label:"System",icon:re}],P=[{value:"default",label:"Fusion Legacy",className:"theme-swatch-default"},{value:"ocean",label:"Ocean",className:"theme-swatch-ocean"},{value:"forest",label:"Forest",className:"theme-swatch-forest"},{value:"sunset",label:"Sunset",className:"theme-swatch-sunset"},{value:"zen",label:"Zen",className:"theme-swatch-zen"},{value:"berry",label:"Berry",className:"theme-swatch-berry"},{value:"high-contrast",label:"High Contrast",className:"theme-swatch-high-contrast"},{value:"industrial",label:"Industrial",className:"theme-swatch-industrial"},{value:"monochrome",label:"Mono",className:"theme-swatch-monochrome"},{value:"slate",label:"Slate",className:"theme-swatch-slate"},{value:"ash",label:"Ash",className:"theme-swatch-ash"},{value:"air",label:"Air",className:"theme-swatch-air"},{value:"graphite",label:"Graphite",className:"theme-swatch-graphite"},{value:"silver",label:"Silver",className:"theme-swatch-silver"},{value:"solarized",label:"Solarized",className:"theme-swatch-solarized"},{value:"factory",label:"Factory",className:"theme-swatch-factory"},{value:"factory-mono",label:"Factory Mono",className:"theme-swatch-factory-mono"},{value:"ayu",label:"Ayu",className:"theme-swatch-ayu"},{value:"one-dark",label:"One Dark",className:"theme-swatch-one-dark"},{value:"nord",label:"Nord",className:"theme-swatch-nord"},{value:"dracula",label:"Dracula",className:"theme-swatch-dracula"},{value:"gruvbox",label:"Gruvbox",className:"theme-swatch-gruvbox"},{value:"tokyo-night",label:"Tokyo Night",className:"theme-swatch-tokyo-night"},{value:"catppuccin-mocha",label:"Catppuccin Mocha",className:"theme-swatch-catppuccin-mocha"},{value:"github-dark",label:"GitHub Dark",className:"theme-swatch-github-dark"},{value:"everforest",label:"Everforest",className:"theme-swatch-everforest"},{value:"rose-pine",label:"Rosé Pine",className:"theme-swatch-rose-pine"},{value:"kanagawa",label:"Kanagawa",className:"theme-swatch-kanagawa"},{value:"night-owl",label:"Night Owl",className:"theme-swatch-night-owl"},{value:"palenight",label:"Palenight",className:"theme-swatch-palenight"},{value:"monokai-pro",label:"Monokai Pro",className:"theme-swatch-monokai-pro"},{value:"slime",label:"Slime",className:"theme-swatch-slime"},{value:"brutalist",label:"Brutalist",className:"theme-swatch-brutalist"},{value:"neon-city",label:"Neon City",className:"theme-swatch-neon-city"},{value:"parchment",label:"Parchment",className:"theme-swatch-parchment"},{value:"terminal",label:"Terminal",className:"theme-swatch-terminal"},{value:"glass",label:"Glass",className:"theme-swatch-glass"},{value:"glass-silver",label:"Glass Silver",className:"theme-swatch-glass-silver"},{value:"horizon",label:"Horizon",className:"theme-swatch-horizon"},{value:"vitesse",label:"Vitesse",className:"theme-swatch-vitesse"},{value:"outrun",label:"Outrun",className:"theme-swatch-outrun"},{value:"snazzy",label:"Snazzy",className:"theme-swatch-snazzy"},{value:"porple",label:"Porple",className:"theme-swatch-porple"},{value:"espresso",label:"Espresso",className:"theme-swatch-espresso"},{value:"mars",label:"Mars",className:"theme-swatch-mars"},{value:"poimandres",label:"Poimandres",className:"theme-swatch-poimandres"},{value:"ember",label:"Ember",className:"theme-swatch-ember"},{value:"rust",label:"Rust",className:"theme-swatch-rust"},{value:"copper",label:"Copper",className:"theme-swatch-copper"},{value:"foundry",label:"Foundry",className:"theme-swatch-foundry"},{value:"carbon",label:"Carbon",className:"theme-swatch-carbon"},{value:"sandstone",label:"Sandstone",className:"theme-swatch-sandstone"},{value:"lagoon",label:"Lagoon",className:"theme-swatch-lagoon"},{value:"frost",label:"Frost",className:"theme-swatch-frost"},{value:"lavender",label:"Lavender",className:"theme-swatch-lavender"},{value:"neon-bloom",label:"Neon Bloom",className:"theme-swatch-neon-bloom"},{value:"sepia",label:"Sepia",className:"theme-swatch-sepia"},{value:"cobalt",label:"Cobalt",className:"theme-swatch-cobalt"},{value:"clay",label:"Clay",className:"theme-swatch-clay"},{value:"moss",label:"Moss",className:"theme-swatch-moss"},{value:"aurora",label:"Aurora",className:"theme-swatch-aurora"},{value:"calm",label:"Calm",className:"theme-swatch-calm"},{value:"dawn",label:"Dawn",className:"theme-swatch-dawn"},{value:"shadcn",label:"Shadcn",className:"theme-swatch-shadcn"},{value:"shadcn-ember",label:"Shadcn Ember (Default)",className:"theme-swatch-shadcn-ember"},{value:"shadcn-custom",label:"Shadcn Custom",className:"theme-swatch-shadcn-custom"},{value:"shadcn-blue",label:"Shadcn Blue",className:"theme-swatch-shadcn-blue"},{value:"shadcn-green",label:"Shadcn Green",className:"theme-swatch-shadcn-green"},{value:"shadcn-red",label:"Shadcn Red",className:"theme-swatch-shadcn-red"},{value:"shadcn-purple",label:"Shadcn Purple",className:"theme-swatch-shadcn-purple"},{value:"shadcn-pink",label:"Shadcn Pink",className:"theme-swatch-shadcn-pink"},{value:"shadcn-orange",label:"Shadcn Orange",className:"theme-swatch-shadcn-orange"},{value:"shadcn-yellow",label:"Shadcn Yellow",className:"theme-swatch-shadcn-yellow"},{value:"shadcn-mono",label:"Shadcn Mono",className:"theme-swatch-shadcn-mono"},{value:"shadcn-mono-red",label:"Shadcn Mono Red",className:"theme-swatch-shadcn-mono-red"},{value:"shadcn-mono-blue",label:"Shadcn Mono Blue",className:"theme-swatch-shadcn-mono-blue"},{value:"shadcn-mono-green",label:"Shadcn Mono Green",className:"theme-swatch-shadcn-mono-green"},{value:"shadcn-mono-purple",label:"Shadcn Mono Purple",className:"theme-swatch-shadcn-mono-purple"},{value:"shadcn-mono-pink",label:"Shadcn Mono Pink",className:"theme-swatch-shadcn-mono-pink"},{value:"shadcn-mono-orange",label:"Shadcn Mono Orange",className:"theme-swatch-shadcn-mono-orange"},{value:"shadcn-mono-yellow",label:"Shadcn Mono Yellow",className:"theme-swatch-shadcn-mono-yellow"},{value:"shadcn-black",label:"Shadcn Black",className:"theme-swatch-shadcn-black"},{value:"shadcn-gray",label:"Shadcn Gray",className:"theme-swatch-shadcn-gray"},{value:"shadcn-gray-blue",label:"Shadcn Gray Blue",className:"theme-swatch-shadcn-gray-blue"}];function je(t){const i=t.trim();if(/^#[\da-f]{6}$/i.test(i))return i;if(/^#[\da-f]{3}$/i.test(i)){const[,l,h,u]=i;return`#${l}${l}${h}${h}${u}${u}`}return"#000000"}function Ce({value:t={},onChange:i,resolvedThemeMode:l="dark"}){const{t:h}=V("app"),[u,N]=o.useState(!1),s=o.useId(),p=o.useMemo(()=>Q(t),[t]),d=(n,f)=>{i(Q({...p,[n]:f}))},r=u?h("theme.shadcnCustom.collapse","Collapse custom colors"):h("theme.shadcnCustom.show","Show custom colors"),y=u?le:X;return e.jsxs("section",{className:"shadcn-color-picker card","data-testid":"shadcn-color-picker","aria-labelledby":"shadcn-color-picker-title",children:[e.jsxs("div",{className:"shadcn-color-picker-header",children:[e.jsxs("div",{className:"shadcn-color-picker-heading",children:[e.jsx("h3",{id:"shadcn-color-picker-title",className:"shadcn-color-picker-title",children:h("theme.shadcnCustom.title","Custom shadcn colors")}),e.jsx("p",{className:"shadcn-color-picker-description",children:h("theme.shadcnCustom.description","Override shadcn design tokens with hex colors. Blank tokens use the theme defaults.")})]}),e.jsx("button",{type:"button",className:"btn btn-icon btn-sm shadcn-color-picker-toggle","aria-expanded":u,"aria-controls":s,"aria-label":r,title:r,onClick:()=>N(n=>!n),children:e.jsx(y,{size:16,"aria-hidden":"true"})})]}),u?e.jsxs("div",{id:s,className:"shadcn-color-picker-controls-panel","data-testid":"shadcn-color-picker-controls",children:[e.jsx("div",{className:"shadcn-color-picker-actions",children:e.jsx("button",{type:"button",className:"btn btn-sm",onClick:()=>i({}),children:h("theme.shadcnCustom.reset","Reset custom colors")})}),e.jsx("div",{className:"shadcn-color-picker-grid",children:ne.map(n=>{const f=oe(n,l),x=p[n.cssVar]??f,v=`shadcn-color-${n.cssVar.replace(/^--/,"").replace(/[^a-z0-9]+/gi,"-")}`;return e.jsxs("div",{className:"shadcn-color-picker-row","data-testid":`shadcn-color-${n.cssVar}`,children:[e.jsxs("label",{className:"shadcn-color-picker-label",htmlFor:v,children:[e.jsx("span",{children:h(`theme.shadcnCustom.token.${n.cssVar}`,n.label)}),e.jsx("code",{children:n.cssVar})]}),e.jsxs("div",{className:"shadcn-color-picker-controls",children:[e.jsx("input",{"aria-label":h("theme.shadcnCustom.colorInput","Pick {{label}} color",{label:n.label}),className:"shadcn-color-picker-native",type:"color",value:je(x),onChange:j=>d(n.cssVar,j.currentTarget.value)}),e.jsx("input",{id:v,"aria-label":h("theme.shadcnCustom.hexInput","{{label}} hex color",{label:n.label}),className:"input shadcn-color-picker-hex",type:"text",inputMode:"text",spellCheck:!1,value:x,onChange:j=>d(n.cssVar,j.currentTarget.value)})]})]},n.cssVar)})})]}):null]})}function Se(t){return P.find(i=>i.value===t)??P[0]}function Z(t){return t.trim().normalize("NFD").replace(/\p{Diacritic}/gu,"").toLocaleLowerCase()}function O({className:t}){return e.jsxs("span",{className:`theme-option-swatch ${t}`,"aria-hidden":"true",children:[e.jsx("span",{className:"theme-option-swatch-sample theme-option-swatch-sample-1"}),e.jsx("span",{className:"theme-option-swatch-sample theme-option-swatch-sample-2"}),e.jsx("span",{className:"theme-option-swatch-sample theme-option-swatch-sample-3"}),e.jsx("span",{className:"theme-option-swatch-sample theme-option-swatch-sample-4"})]})}function _e({colorTheme:t,onColorThemeChange:i,themeMode:l,shadcnCustomColors:h={},resolvedThemeMode:u=l==="light"?"light":"dark",onThemeModeChange:N,onShadcnCustomColorsChange:s=()=>{},triggerVariant:p="compact"}){const{t:d}=V("app"),[r,y]=o.useState(!1),[n,f]=o.useState(""),[x,v]=o.useState(t),[j,S]=o.useState(null),F=o.useRef(null),E=o.useRef(null),R=o.useRef(!1),g=o.useRef([]),M=o.useMemo(()=>Se(t),[t]),z=l==="system"?u:l,$=J.find(a=>a.value===z)?.icon,c=l==="system"?d("theme.system","System"):d(`theme.${l}`,l?`${l.charAt(0).toUpperCase()}${l.slice(1)}`:"Dark"),b=d(`theme.colorTheme.${M.value}`,M.label),D=`${d("theme.currentTheme","Current theme")} ${c} / ${b}`,B="theme-dropdown-listbox",H=o.useMemo(()=>P.map(a=>({...a,displayLabel:d(`theme.colorTheme.${a.value}`,a.label)})),[d]),U=Z(n),m=o.useMemo(()=>H.filter(a=>Z(a.displayLabel).includes(U)),[U,H]),W=m.findIndex(a=>a.value===x),_=()=>{y(!1),f(""),v(t),S(null),R.current=!1,g.current=[]};o.useEffect(()=>{if(!r)return;const a=w=>{F.current&&!F.current.contains(w.target)&&_()};return document.addEventListener("pointerdown",a),()=>document.removeEventListener("pointerdown",a)},[r,t]),o.useEffect(()=>{r&&(m.some(a=>a.value===x)||v(m[0]?.value??null))},[x,m,r]),o.useEffect(()=>{if(r){if(j==="pointer"&&R.current)E.current?.focus(),R.current=!1;else if(j==="keyboard"){const a=m.findIndex(w=>w.value===x);g.current[a]?.focus()}}},[x,m,r,j]);const q=a=>{i(a),_()},K=(a,w)=>{if(a==="pointer")R.current=!0,v(t);else{const I=m.some(C=>C.value===t),k=w==="ArrowUp"?m.at(-1)?.value??null:w==="ArrowDown"?m[0]?.value??null:I?t:m[0]?.value??null;v(k)}S(a),y(!0)},ee=a=>{(a.key==="ArrowDown"||a.key==="ArrowUp"||a.key==="Enter"||a.key===" ")&&(a.preventDefault(),K("keyboard",a.key))},ae=a=>{if(a.key==="Escape"){a.preventDefault(),_();return}if(a.key!=="ArrowDown"&&a.key!=="ArrowUp")return;const w=a.key==="ArrowUp"?m.length-1:Math.max(0,W);w<0||!m[w]||(a.preventDefault(),v(m[w].value),g.current[w]?.focus())},te=(a,w,I)=>{if(a.key==="Escape"){a.preventDefault(),_();return}if(a.key==="ArrowDown"||a.key==="ArrowUp"){a.preventDefault();const k=a.key==="ArrowDown"?1:-1,C=(w+k+m.length)%m.length;v(m[C]?.value??null),g.current[C]?.focus();return}if(a.key==="Home"){a.preventDefault(),v(m[0]?.value??null),g.current[0]?.focus();return}if(a.key==="End"){a.preventDefault();const k=m.length-1;v(m[k]?.value??null),g.current[k]?.focus();return}(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),q(I))};return e.jsxs("div",{className:`theme-dropdown${p==="current-row"?" theme-dropdown--current-row":""}${r?" open":""}`,ref:F,children:[e.jsxs("button",{type:"button",className:`theme-dropdown-trigger btn${p==="current-row"?" theme-dropdown-trigger--current-row":""}`,"aria-label":p==="current-row"?D:void 0,"aria-haspopup":"listbox","aria-expanded":r,"aria-controls":r?B:void 0,onClick:()=>r?_():K("pointer"),onKeyDown:ee,children:[p==="current-row"?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"theme-dropdown-current-row-icon","aria-hidden":"true",children:$?e.jsx($,{size:20}):null}),e.jsxs("span",{className:"theme-dropdown-current-row-info",children:[e.jsx("span",{className:"theme-dropdown-current-row-label",children:d("theme.currentTheme","Current theme")}),e.jsxs("span",{className:"theme-dropdown-current-row-value",children:[c," / ",b]})]}),e.jsx(O,{className:M.className})]}):e.jsxs(e.Fragment,{children:[e.jsx(O,{className:M.className}),e.jsx("span",{className:"theme-dropdown-trigger-label",children:b})]}),e.jsx(X,{size:16,"aria-hidden":"true"})]}),l&&N?e.jsx("div",{className:"theme-dropdown-modes",role:"radiogroup","aria-label":d("theme.modeLabel","Theme mode"),children:J.map(({value:a,label:w,icon:I})=>e.jsxs("button",{type:"button",className:`theme-dropdown-mode-btn btn btn-sm${l===a?" active":""}`,"aria-pressed":l===a,onClick:()=>N(a),title:d(`theme.${a}Mode`,`${w} mode`),children:[e.jsx(I,{size:16,"aria-hidden":"true"}),e.jsx("span",{children:d(`theme.${a}`,w)})]},a))}):null,t==="shadcn-custom"?e.jsx(Ce,{value:h,onChange:s,resolvedThemeMode:u}):null,r?e.jsxs("div",{className:"theme-dropdown-popover",role:"presentation",children:[e.jsxs("label",{className:"theme-dropdown-filter",children:[e.jsx("span",{className:"sr-only",children:d("theme.filterColorThemes","Filter color themes")}),e.jsx("input",{ref:E,type:"search",className:"input",value:n,placeholder:d("theme.filterColorThemesPlaceholder","Filter color themes"),"aria-label":d("theme.filterColorThemes","Filter color themes"),onChange:a=>f(a.target.value),onKeyDown:ae})]}),m.length?e.jsx("div",{id:B,className:"theme-dropdown-list",role:"listbox","aria-label":d("theme.colorThemeLabel","Color theme"),children:m.map(({value:a,displayLabel:w,className:I},k)=>{const C=t===a;return e.jsxs("button",{ref:T=>{g.current[k]=T},type:"button",className:`theme-dropdown-option${C?" active":""}`,role:"option","aria-selected":C,tabIndex:k===W?0:-1,onClick:()=>q(a),onKeyDown:T=>te(T,k,a),children:[e.jsx(O,{className:I}),e.jsx("span",{className:"theme-dropdown-option-label",children:w}),C?e.jsx(ce,{size:16,"aria-hidden":"true"}):null]},a)})}):e.jsx("p",{className:"theme-dropdown-no-results",children:d("theme.noColorThemes","No color themes found")})]}):null]})}const Ee=[{type:"bug",label:"Report bug",Icon:me},{type:"feedback",label:"Send feedback",Icon:ie},{type:"idea",label:"Share idea",Icon:he},{type:"help",label:"Get help",Icon:be}];function Le({onSelect:t}){const[i,l]=o.useState(!1),[h,u]=o.useState(),N=o.useRef(null),s=o.useRef(null),p=o.useCallback(()=>{const r=N.current?.getBoundingClientRect();r&&u({top:r.bottom,left:r.left,right:window.innerWidth-r.right})},[]);o.useEffect(()=>{if(!i)return;p();const r=()=>p();return window.addEventListener("resize",r),window.addEventListener("scroll",r,!0),()=>{window.removeEventListener("resize",r),window.removeEventListener("scroll",r,!0)}},[i,p]),o.useEffect(()=>{if(!i)return;const r=n=>{const f=n.target;N.current?.contains(f)||s.current?.contains(f)||l(!1)},y=n=>{n.key==="Escape"&&(l(!1),N.current?.focus())};return document.addEventListener("mousedown",r),document.addEventListener("keydown",y),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("keydown",y)}},[i]);const d=i&&h&&typeof document<"u"?se.createPortal(e.jsx("div",{ref:s,className:"report-action-menu__list report-action-menu__list--portal",role:"menu",style:{top:h.top,left:h.left,right:h.right},children:Ee.map(({type:r,label:y,Icon:n})=>e.jsxs("button",{className:"report-action-menu__item",type:"button",role:"menuitem",onClick:()=>{l(!1),t(r)},children:[e.jsx(n,{"aria-hidden":"true"}),y]},r))}),document.body):null;return e.jsxs("div",{className:"report-action-menu",children:[e.jsx("button",{ref:N,className:"btn btn-secondary",type:"button","aria-haspopup":"menu","aria-expanded":i,onClick:()=>l(r=>!r),children:"Report"}),d]})}const Re={bug:"What went wrong?",feedback:"What would you like to share?",idea:"What would you like Fusion to do?",help:"What would you like help with?"};function ze({actionType:t,onClose:i,contextRefs:l}){const{t:h}=V("app"),[u,N]=o.useState(""),[s,p]=o.useState(),[d,r]=o.useState(!1),[y,n]=o.useState(),[f,x]=o.useState(!1),[v,j]=o.useState(),[S,F]=o.useState(),[E,R]=o.useState(!1),g=o.useRef(0),M=async c=>{r(!0),n(void 0);try{const b=await de();if(!b)throw new Error("Screen capture was unavailable or denied.");const{artifactId:D}=await ke(b);if(g.current!==c)return;F(D)}catch(b){if(g.current!==c)return;x(!1),n(b instanceof Error?b.message:"We could not capture the current screen.")}finally{g.current===c&&r(!1)}},z=async()=>{if(u.trim()){if(f&&(!S||!E)){n("Capture and confirm local screenshot retention before continuing, or turn attachment off.");return}r(!0),n(void 0);try{if(Y("report"),t==="help"){const c=await xe(u);if(c.answered){p({kind:"help",answer:c.answer});return}}p(await ge({actionType:t,targetType:v,userPrompt:u,contextRefs:l,activityTrace:A(),screenshotArtifactId:f&&E?S:void 0}))}catch{n("We could not prepare your report. Check your connection and try again.")}finally{r(!1)}}},$=async(c,b,D)=>{if(s?.report){r(!0),n(void 0);try{Y("report"),p(await Ne({actionType:t,targetType:v,report:s.report,endorseIssueNumber:c,endorseDiscussionId:b,endorseRoadmapIssueNumber:D,activityTrace:A(),screenshotArtifactId:f&&E?S:void 0}))}catch{n("We could not send your report. Your draft is still here; try again.")}finally{r(!1)}}};return e.jsx("div",{className:"report-modal-backdrop",role:"presentation",children:e.jsxs("section",{className:"card report-modal",role:"dialog","aria-modal":"true","aria-label":`${t} report`,children:[e.jsx("button",{className:"btn-icon report-modal__close",type:"button","aria-label":"Close report",onClick:i,children:"×"}),y&&e.jsx("p",{className:"report-modal__error",role:"alert",children:y}),!s&&e.jsxs(e.Fragment,{children:[e.jsx("h2",{children:t[0].toUpperCase()+t.slice(1)}),e.jsx("label",{htmlFor:"report-prompt",children:Re[t]}),e.jsx("textarea",{id:"report-prompt",className:"input",value:u,onChange:c=>N(c.target.value),maxLength:4e3}),e.jsxs("label",{className:"report-modal__screenshot-option",children:[e.jsx("input",{type:"checkbox",checked:f,onChange:c=>{const b=c.target.checked,D=++g.current;x(b),F(void 0),R(!1),b?M(D):r(!1)}})," Store a screenshot locally"]}),f&&e.jsx("div",{className:"report-modal__screenshot-preview",children:S?e.jsxs("label",{className:"report-modal__screenshot-option",children:[e.jsx("input",{type:"checkbox",checked:E,onChange:c=>R(c.target.checked)})," I confirm Fusion may retain this screenshot locally for this report."]}):e.jsx("p",{children:"Capturing and storing locally…"})}),e.jsx("label",{htmlFor:"report-target",children:h("report.targetLabel","Filing target")}),e.jsxs("select",{id:"report-target",className:"input",value:v??"",onChange:c=>j(c.target.value||void 0),children:[e.jsx("option",{value:"",children:h("report.targetInherit","Use configured action target")}),e.jsx("option",{value:"issue",children:h("report.targetIssue","GitHub Issue")}),e.jsx("option",{value:"discussion",children:h("report.targetDiscussion","GitHub Discussion")})]}),e.jsxs("details",{className:"report-modal__activity-trace",children:[e.jsx("summary",{children:"Activity trace to send"}),e.jsx("ul",{children:A().map((c,b)=>e.jsx("li",{children:c},`${c}-${b}`))})]}),e.jsx("button",{className:"btn btn-primary",type:"button",disabled:!u.trim()||d,onClick:()=>void z(),children:y?"Retry":"Continue"})]}),s?.kind==="draft-ready"&&s.report&&e.jsxs(e.Fragment,{children:[e.jsx("h2",{children:"Review your report"}),e.jsx("label",{htmlFor:"report-review-prompt",children:"Report summary"}),e.jsx("textarea",{id:"report-review-prompt",className:"input",value:s.report.userPrompt,onChange:c=>{const b=c.target.value;p({...s,report:{...s.report,userPrompt:b}})}}),e.jsx("label",{htmlFor:"report-review-body",children:"Structured report"}),e.jsx("textarea",{id:"report-review-body",className:"input",value:s.report.body??"",onChange:c=>p({...s,report:{...s.report,body:c.target.value}})}),e.jsx("button",{className:"btn btn-primary",type:"button",disabled:d,onClick:()=>void $(),children:"File report"})]}),s?.kind==="duplicate-found"&&s.issue&&s.report&&e.jsxs(e.Fragment,{children:[e.jsx("h2",{children:s.issue.roadmap?h("report.roadmapDuplicate.title","Already on the roadmap — add your data point?"):"Review data point for a similar open issue"}),e.jsx("a",{href:s.issue.url,target:"_blank",rel:"noreferrer",children:s.issue.title}),e.jsx("label",{htmlFor:"report-duplicate-prompt",children:"Report summary"}),e.jsx("textarea",{id:"report-duplicate-prompt",className:"input",value:s.report.userPrompt,onChange:c=>{const b=c.target.value;p({...s,report:{...s.report,userPrompt:b}})}}),e.jsx("label",{htmlFor:"report-duplicate-body",children:"Structured data point"}),e.jsx("textarea",{id:"report-duplicate-body",className:"input",value:s.report.body??"",onChange:c=>p({...s,report:{...s.report,body:c.target.value}})}),e.jsx("button",{className:"btn btn-primary",type:"button",disabled:d,onClick:()=>void $(s.issue.discussionId||s.issue.roadmap?void 0:s.issue.number,s.issue.discussionId,s.issue.roadmap?s.issue.number:void 0),children:"Confirm and add data point"})]}),(s?.kind==="filed"||s?.kind==="endorsed")&&e.jsxs(e.Fragment,{children:[e.jsx("h2",{children:s.kind==="filed"&&s.destination==="issue"?"Report filed as an Issue":"Report sent"}),e.jsx("a",{href:s.url,target:"_blank",rel:"noreferrer",children:"View on GitHub"}),s.report?.body&&e.jsxs(e.Fragment,{children:[e.jsx("label",{htmlFor:"filed-report",children:"Final report"}),e.jsx("textarea",{id:"filed-report",className:"input",value:s.report.body,readOnly:!0})]})]}),s?.kind==="help"&&e.jsxs(e.Fragment,{children:[e.jsx("h2",{children:"Suggested help"}),e.jsx("p",{children:s.answer?.summary??s.answer?.content})]}),s?.kind==="unavailable"&&e.jsxs(e.Fragment,{children:[e.jsx("p",{role:"alert",children:s.message}),e.jsx("button",{className:"btn btn-secondary",type:"button",onClick:()=>{p(void 0),n(void 0)},children:"Return to prompt"})]})]})})}export{me as B,Le as R,J as T,_e as a,ze as b,Me as l,$e as r};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as c,j as e}from"./vendor-react-SZ_qB27O.js";import{
|
|
2
|
-
`);let s=2166136261;for(let b=0;b<m.length;b+=1)s^=m.charCodeAt(b),s=Math.imul(s,16777619);return`finding-${(s>>>0).toString(16).padStart(8,"0")}`}const Ue=300,Ge=4e3,Ve=["queued","running","cancelling","retry_waiting"];function le(a,n){if(a instanceof Pe){const i=a;return{message:a.message,status:a.status,code:i.researchCode??"INTERNAL_ERROR",setupHint:i.setupHint,retryable:i.retryable}}return a instanceof Error?{message:a.message,code:"INTERNAL_ERROR"}:{message:n,code:"INTERNAL_ERROR"}}function $e(a){if(!a)return{cancelable:!1,retryable:!1,isTransitioning:!1,blockingReason:"No run selected"};const n=Ve.includes(a.status),i=a.status==="queued"||a.status==="running",m=a.lifecycle?.retryable,s=a.status==="failed"||a.status==="timed_out",b=!!(s&&m);let R;return!i&&n?R="Run is already transitioning":!i&&a.status==="completed"?R="Completed runs cannot be cancelled":!i&&a.status==="cancelled"?R="Run is already cancelled":!i&&a.status==="retry_exhausted"?R="Retry attempts exhausted":!i&&a.status==="failed"?R="Failed runs cannot be cancelled":!i&&a.status==="timed_out"&&(R="Timed out runs cannot be cancelled"),!b&&s&&m===!1&&(R=a.lifecycle?.errorCode==="RETRY_EXHAUSTED"?"Retry attempts exhausted":"Run is not retryable"),{cancelable:i,retryable:b,isTransitioning:n,blockingReason:R}}function Be(a){const n=a?.projectId,i=n??"",m=`${he.RESEARCH_RUNS_PREFIX}${i}`,s=`${he.RESEARCH_SELECTED_ID_PREFIX}${i}`,b=W(m,{maxAgeMs:ue}),R=W(s,{maxAgeMs:me}),r=c.useRef(Array.isArray(b)&&b.length>0),[M,I]=c.useState(()=>Array.isArray(b)?b:[]),[h,N]=c.useState(R??null),[C,_]=c.useState(null),[O,D]=c.useState({available:!0}),[H,A]=c.useState(!(Array.isArray(b)&&b.length>0)),[V,U]=c.useState(null),[$,j]=c.useState(null),[w,T]=c.useState(""),S=c.useRef(0),d=c.useRef(0),P=c.useRef(n);c.useEffect(()=>{P.current!==n&&(P.current=n,d.current++);const l=W(m,{maxAgeMs:ue}),o=W(s,{maxAgeMs:me}),v=Array.isArray(l)&&l.length>0;I(Array.isArray(l)?l:[]),N(o??null),_(null),A(!v),r.current=v},[n,m,s]);const k=c.useCallback(async(l=w)=>{const o=++S.current,v=n;r.current||A(!0),U(null),j(null);try{const y=await Se({q:l||void 0,limit:100},v);if(o!==S.current||v!==n)return;I(y.runs),ce(m,y.runs,{maxBytes:5e5}),r.current=!0,D(y.availability),h&&!y.runs.some(g=>g.id===h)&&(N(null),ce(s,null,{maxBytes:5e5}),_(null))}catch(y){if(o!==S.current||v!==n)return;const g=le(y,"Failed to load research runs");U(g.message),j(g)}finally{o===S.current&&A(!1)}},[n,m,w,s,h]),f=c.useCallback(async l=>{const o=await _e(l,n);return _(o.run),D(o.availability),o.run},[n]);c.useEffect(()=>{r.current||A(!0);const l=window.setTimeout(()=>{k(w)},Ue);return()=>window.clearTimeout(l)},[k,w]),c.useEffect(()=>{if(!h){_(null);return}f(h)},[f,h]),c.useEffect(()=>{const l=d.current,o=()=>d.current!==l,v=n?`?projectId=${encodeURIComponent(n)}`:"";let y=!0;const g=()=>{!y||o()||(k(),h&&f(h))},F=`/api/events${v}`,E=je(F,{events:{"research:run:created":g,"research:run:updated":g,"research:run:completed":g,"research:run:failed":g,"research:run:cancelled":g},onReconnect:()=>{Y({view:"useResearch",trigger:"sse-reconnect",projectId:n,replayAttempted:!1,sseChannel:F}),g()}});Y({view:"useResearch",trigger:"sse-open",projectId:n,replayAttempted:!1,sseChannel:F});const G=window.setInterval(g,Ge);return()=>{y=!1,E(),window.clearInterval(G)}},[n,k,h,f]);const z=c.useCallback(l=>{N(l),ce(s,l,{maxBytes:5e5})},[s]);return{runs:M,selectedRun:C,selectedRunId:h,setSelectedRunId:z,availability:O,loading:H,error:V,searchQuery:w,setSearchQuery:T,refresh:k,createRun:l=>Te(l,n),cancelRun:async l=>{try{j(null);const o=await Ae(l,n);return h===l&&_(o.run),await k(),o}catch(o){const v=le(o,"Failed to cancel run");throw j(v),v}},retryRun:async l=>{try{j(null);const o=await Ce(l,n);return h===l&&_(o.run),await k(),o}catch(o){const v=le(o,"Failed to retry run");throw j(v),v}},exportRun:(l,o)=>Ee(l,o,n),createTaskFromRun:(l,o,v,y,g,F)=>ke(l,{title:o,findingId:v,description:y,priority:g,attachExport:F},n),attachRunToTask:(l,o,v,y)=>Ne(l,{taskId:o,findingId:v,attachExport:y},n),promoteFinding:(l,o)=>we(l,o,n),uiError:$,runActionState:$e(C),statusCounts:M.reduce((l,o)=>(l[o.status]+=1,l),{queued:0,running:0,cancelling:0,retry_waiting:0,completed:0,failed:0,cancelled:0,timed_out:0,retry_exhausted:0})}}function Ke({open:a,mode:n,run:i,finding:m,projectId:s,onClose:b,onConfirm:R}){const{t:r}=ve("app");Le(a);const[M,I]=c.useState(!1),[h,N]=c.useState(""),[C,_]=c.useState(""),[O,D]=c.useState("normal"),[H,A]=c.useState(""),[V,U]=c.useState([]),[$,j]=c.useState(!1),[w,T]=c.useState(!1),S=c.useMemo(()=>{const d=(m.content??"").split(/(?<=[.!?])\s+/)[0]??"";return`${m.heading||r("research.defaultFindingHeading","Research finding")} — ${d}`.trim()},[m.content,m.heading,r]);return c.useEffect(()=>{a&&(I(!1),N(`Research: ${m.heading||i.title}`),_(S),D("normal"),A(""),n==="enrich"&&(j(!0),Ie(50,0,s).then(d=>U(d.filter(P=>P.column!=="archived"))).finally(()=>j(!1))))},[a,n,s,m.heading,S,i.title]),a?e.jsx("div",{className:"modal-overlay open",role:"presentation",onClick:b,children:e.jsxs("div",{className:"modal modal-lg research-task-action-modal",role:"dialog","aria-modal":"true",onClick:d=>d.stopPropagation(),children:[e.jsxs("div",{className:"modal-header",children:[e.jsx("h3",{children:n==="create"?r("research.createTaskTitle","Create task from finding"):r("research.enrichTaskTitle","Enrich existing task")}),e.jsx("button",{className:"modal-close",type:"button","aria-label":r("actions.close","Close"),onClick:b,children:"×"})]}),e.jsxs("div",{className:"research-task-action-modal__body",children:[e.jsxs("div",{className:"card research-task-action-modal__preview",children:[e.jsxs("p",{children:[e.jsxs("strong",{children:[r("research.runLabel","Run:")," "]})," ",i.id]}),e.jsxs("p",{children:[e.jsxs("strong",{children:[r("research.findingLabel","Finding:")," "]})," ",m.id,m.heading?` — ${m.heading}`:""]}),e.jsx("p",{children:S||r("research.noPreview","No preview available.")})]}),n==="create"?e.jsxs(e.Fragment,{children:[e.jsxs("label",{className:"research-task-action-modal__field",children:[r("research.titleLabel","Title"),e.jsx("input",{className:"input",value:h,onChange:d=>N(d.target.value)})]}),e.jsxs("label",{className:"research-task-action-modal__field",children:[r("research.descriptionLabel","Description"),e.jsx("textarea",{className:"input research-task-action-modal__textarea",value:C,onChange:d=>_(d.target.value)})]}),e.jsxs("label",{className:"research-task-action-modal__field",children:[r("research.priorityLabel","Priority"),e.jsxs("select",{className:"select",value:O,onChange:d=>D(d.target.value),children:[e.jsx("option",{value:"low",children:r("research.priorityLow","Low")}),e.jsx("option",{value:"normal",children:r("research.priorityNormal","Normal")}),e.jsx("option",{value:"high",children:r("research.priorityHigh","High")}),e.jsx("option",{value:"urgent",children:r("research.priorityUrgent","Urgent")})]})]})]}):e.jsxs("label",{className:"research-task-action-modal__field",children:[r("research.targetTaskLabel","Target task"),e.jsx("input",{className:"input",list:"research-task-action-task-list",value:H,placeholder:$?r("research.loadingTasks","Loading tasks…"):r("research.enterTaskId","Enter task ID"),onChange:d=>A(d.target.value)}),e.jsx("datalist",{id:"research-task-action-task-list",children:V.map(d=>e.jsx("option",{value:d.id,children:d.title},d.id))})]}),e.jsxs("label",{className:"checkbox-label",children:[e.jsx("input",{type:"checkbox",checked:M,onChange:d=>I(d.target.checked)}),e.jsx("span",{children:r("research.attachExport","Attach markdown export artifact")})]})]}),e.jsxs("div",{className:"modal-actions",children:[e.jsx("button",{className:"btn",type:"button",onClick:b,children:r("actions.cancel","Cancel")}),e.jsx("button",{className:"btn btn-primary",type:"button",disabled:w||n==="enrich"&&!H,onClick:()=>{T(!0),R({taskId:n==="enrich"?H:void 0,title:n==="create"?h.trim():void 0,description:n==="create"?C.trim():void 0,priority:n==="create"?O:void 0,attachExport:M}).finally(()=>T(!1))},children:n==="create"?r("research.createTaskButton","Create Task"):r("research.enrichTaskButton","Enrich Task")})]})]})}):null}const ze=["web-search","page-fetch","github","local-docs","llm-synthesis"],Qe={"web-search":"webSearch","page-fetch":"pageFetch",github:"github","local-docs":"localDocs","llm-synthesis":"llmSynthesis"};function We(a){return{"web-search":a("research.providerWebSearch","Web Search"),"page-fetch":a("research.providerPageFetch","Page Fetch"),github:a("research.providerGitHub","GitHub"),"local-docs":a("research.providerLocalDocs","Local Docs"),"llm-synthesis":a("research.providerLlmSynthesis","LLM Synthesis")}}let oe=!1;function ts({projectId:a,addToast:n,onOpenSettings:i,readinessVersion:m=0}){const{t:s}=ve("app"),b=We(s);c.useEffect(()=>(Y({view:"ResearchView",trigger:oe?"route-active":"remount",projectId:a,replayAttempted:!1}),oe=!1,()=>{oe=!0,Y({view:"ResearchView",trigger:"route-inactive",projectId:a,replayAttempted:!1})}),[a]);const{runs:R,selectedRun:r,selectedRunId:M,setSelectedRunId:I,availability:h,loading:N,error:C,searchQuery:_,setSearchQuery:O,createRun:D,cancelRun:H,retryRun:A,exportRun:V,createTaskFromRun:U,attachRunToTask:$,promoteFinding:j,statusCounts:w,refresh:T,uiError:S,runActionState:d}=Be({projectId:a}),[P,k]=c.useState(""),[f,z]=c.useState(()=>ie(void 0)),[l,o]=c.useState([]),[v,y]=c.useState(!1),[g,F]=c.useState([]),[E,G]=c.useState(null),[q,Q]=c.useState(null),[J,fe]=c.useState(""),Z=h.supportedProviders??ze,ee=f.searchProvider,se=t=>t==="web-search"?!0:f.enabledSources[Qe[t]];c.useEffect(()=>{const t=Z.filter(u=>se(u));F(u=>{const p=u.filter(x=>t.includes(x));return p.length>0?p:t})},[f.enabledSources,Z]),c.useEffect(()=>{let t=!1;return Promise.all([Fe(a),Me().catch(()=>({providers:[]}))]).then(([u,p])=>{t||(z(ie(u)),o(p.providers.filter(x=>x.type==="api_key").map(x=>({id:x.id,authenticated:x.authenticated}))))}).catch(()=>{t||z(ie(void 0))}),()=>{t=!0}},[a,m]);const xe=c.useMemo(()=>r?r.status:s("research.noRunSelected","No run selected"),[r,s]),ye=c.useMemo(()=>r?r.status==="queued"||r.status==="retry_waiting"?"status-dot status-dot--pending":r.status==="running"?"status-dot status-dot--connecting":r.status==="completed"?"status-dot status-dot--online":r.status==="failed"||r.status==="cancelled"?"status-dot status-dot--error":"status-dot":"status-dot",[r]),re=h.supportedExportFormats??["markdown","json","html"],te=c.useMemo(()=>new Map(l.map(t=>[t.id,t.authenticated])),[l]),ae=c.useMemo(()=>{const t=new Set;return f.enabledSources.webSearch&&ee&&t.add(ee),f.enabledSources.llmSynthesis&&f.synthesisProvider&&t.add(f.synthesisProvider),[...t].filter(u=>te.has(u))},[f.enabledSources.llmSynthesis,f.enabledSources.webSearch,f.synthesisProvider,ee,te]).find(t=>te.get(t)!==!0),B=c.useMemo(()=>h.available?f.enabled?ae?{reason:s("research.missingApiKey","Missing API key for {{provider}}.",{provider:ae}),details:s("research.addCredentialsHint","Add provider credentials in Authentication settings."),settingsSection:"authentication"}:null:{reason:s("research.disabled","Research is disabled for this project."),details:s("research.enableResearchHint","Enable project research settings to create runs."),settingsSection:"research-project"}:{reason:h.reason??s("research.unavailable","Research is unavailable for this project."),details:h.setupInstructions,settingsSection:"research-project"},[h.available,h.reason,h.setupInstructions,f.enabled,ae,s]),K=async(t,u,p)=>{G(t);try{await u(),n?.(p,"success"),await T()}catch(x){n?.(x instanceof Error?x.message:s("research.actionFailed","Action failed"),"error")}finally{G(null)}},ne=async t=>{if(r){G(`export-${t}`);try{const u=await V(r.id,t),p=new Blob([u.content],{type:"text/plain;charset=utf-8"}),x=URL.createObjectURL(p),L=document.createElement("a");L.href=x,L.download=u.filename,document.body.appendChild(L),L.click(),L.remove(),URL.revokeObjectURL(x),n?.(s("research.exportedFile","Exported {{filename}}",{filename:u.filename}),"success")}catch(u){n?.(u instanceof Error?u.message:s("research.exportFailed","Export failed"),"error")}finally{G(null)}}},ge=async()=>{if(P.trim()){y(!0);try{const t=g.filter(p=>se(p));if(t.length===0){y(!1),n?.(s("research.noSourcesAvailable","No enabled research sources are available for this project."),"error");return}const u=await D({query:P.trim(),providers:t});I(u.run.id),k(""),n?.(s("research.runCreated","Research run created"),"success"),await T()}catch(t){n?.(t instanceof Error?t.message:s("research.createRunFailed","Failed to create run"),"error")}finally{y(!1)}}};return e.jsxs("section",{className:"research-view","aria-label":s("research.viewLabel","Research view"),children:[e.jsx(De,{icon:pe,title:s("research.title","Research"),actions:e.jsx("button",{className:"btn",type:"button",onClick:()=>void T(),children:s("actions.refresh","Refresh")})}),e.jsx("p",{className:"research-view__subtitle",children:s("research.subtitle","Cited search and synthesis runs: gather sources, fetch content, and synthesize findings.")}),B?e.jsxs("div",{className:"research-view__state research-view__state--error card","data-testid":"research-state-unavailable",children:[e.jsx("p",{children:B.reason}),B.details&&e.jsx("p",{children:B.details}),e.jsx("p",{children:s("research.currentDefaults","Current defaults: provider {{provider}}, max sources {{maxSources}}",{provider:f.searchProvider??s("research.notSet","(not set)"),maxSources:f.limits.maxSourcesPerRun})}),e.jsxs("div",{className:"research-view__actions",children:[e.jsx("button",{className:"btn",type:"button",onClick:()=>void T(),children:s("actions.refresh","Refresh")}),e.jsx("button",{className:"btn btn-primary",type:"button",onClick:()=>i?.(B.settingsSection),children:s("actions.openSettings","Open Settings")})]})]}):e.jsx(e.Fragment,{children:e.jsxs("div",{className:"research-view__layout",children:[e.jsx("aside",{className:"research-view__sidebar card",children:e.jsxs("div",{className:"research-view__sidebar-content",children:[e.jsxs("div",{className:"research-view__form",children:[e.jsxs("div",{className:"form-group",children:[e.jsx("label",{htmlFor:"research-query",children:s("research.queryLabel","Query")}),e.jsx("textarea",{id:"research-query",className:"input research-view__textarea",value:P,onChange:t=>k(t.target.value)})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{children:s("research.providersLabel","Providers")}),e.jsx("div",{className:"research-view__providers",children:Z.map(t=>{const u=se(t),p=t==="web-search";return e.jsxs("label",{className:"checkbox-label",children:[e.jsx("input",{type:"checkbox",checked:p||g.includes(t),disabled:p||!u,onChange:()=>{p||!u||F(x=>x.includes(t)?x.filter(L=>L!==t):[...x,t])}}),e.jsxs("span",{children:[b[t]??t,p?e.jsx("span",{className:"research-view__provider-lock",children:s("research.alwaysOn","Always on")}):null]})]},t)})})]}),e.jsxs("button",{className:"btn btn-primary",type:"button",disabled:!P.trim()||v,onClick:()=>void ge(),children:[v?e.jsx(He,{className:"animate-spin",size:14}):null,s("research.createRun","Create Run")]})]}),e.jsxs("div",{className:"research-view__history-header form-group",children:[e.jsx("label",{htmlFor:"research-run-search",children:s("actions.search","Search")}),e.jsxs("div",{className:"research-view__history-search-row",children:[e.jsx(pe,{size:14}),e.jsx("input",{id:"research-run-search",className:"input",placeholder:s("research.searchRunsPlaceholder","Search runs"),value:_,onChange:t=>O(t.target.value)})]})]}),e.jsx("div",{className:"research-view__history","data-testid":"research-state-running",children:R.map(t=>e.jsxs("button",{type:"button",className:`research-view__history-item card${M===t.id?" research-view__history-item--active":""}`,onClick:()=>I(t.id),children:[e.jsx("span",{className:"card-id",children:t.id}),e.jsx("span",{children:t.title})]},t.id))})]})}),e.jsxs("div",{className:"research-view__reader card",children:[N&&e.jsx("p",{"data-testid":"research-state-loading",children:e.jsx(qe,{label:s("research.loadingRuns","Loading research runs…")})}),!N&&C&&e.jsx("p",{"data-testid":"research-state-error",children:C}),!N&&!C&&R.length===0&&e.jsx("p",{"data-testid":"research-state-empty",children:s("research.noRunsYet","No research runs yet")}),e.jsxs("div",{className:"research-view__reader-content",children:[r&&e.jsxs("div",{className:"research-view__run-detail",children:[e.jsxs("div",{className:"research-view__status-row",children:[e.jsx("span",{className:ye}),e.jsx("strong",{children:xe})]}),e.jsx("h3",{className:"research-view__run-title",children:r.title}),e.jsx("p",{className:"research-view__run-query",children:r.query}),e.jsx("p",{className:"research-view__run-summary","data-testid":"research-state-results",children:r.results?.summary??s("research.noSummaryYet","No summary yet.")}),e.jsxs("div",{className:"research-view__actions",children:[e.jsx("button",{className:"btn",type:"button",title:d.cancelable?void 0:d.blockingReason,disabled:E==="cancel"||E==="retry"||!d.cancelable,onClick:()=>void K("cancel",()=>H(r.id),s("research.runCancelled","Run cancelled")),children:s("actions.cancel","Cancel")}),e.jsx("button",{className:"btn",type:"button",title:d.retryable?void 0:d.blockingReason,disabled:E==="cancel"||E==="retry"||!d.retryable,onClick:()=>void K("retry",()=>A(r.id),s("research.runRetried","Run retried")),children:s("actions.retry","Retry")}),re.includes("markdown")&&e.jsx("button",{className:"btn",type:"button",disabled:E==="export-markdown",onClick:()=>void ne("markdown"),children:s("research.exportMd","Export MD")}),re.includes("json")&&e.jsx("button",{className:"btn",type:"button",disabled:E==="export-json",onClick:()=>void ne("json"),children:s("research.exportJson","Export JSON")}),re.includes("html")&&e.jsx("button",{className:"btn",type:"button",disabled:E==="export-html",onClick:()=>void ne("html"),children:s("research.exportHtml","Export HTML")})]}),r.error&&e.jsx("p",{className:"research-view__error",children:r.error}),S&&e.jsxs("div",{className:"form-error",role:"alert",children:[e.jsx("p",{children:S.message}),S.setupHint&&e.jsx("p",{children:S.setupHint}),S.code==="MISSING_CREDENTIALS"&&e.jsx("button",{className:"btn btn-sm",type:"button",onClick:()=>i?.("authentication"),children:s("research.openAuthSettings","Open Authentication Settings")}),S.code==="FEATURE_DISABLED"&&e.jsx("button",{className:"btn btn-sm",type:"button",onClick:()=>i?.("research-project"),children:s("research.openResearchSettings","Open Research Settings")})]}),d.blockingReason&&e.jsx("p",{className:"research-view__run-query",children:d.blockingReason}),Array.isArray(r.results?.findings)&&r.results.findings.length>0&&e.jsx("div",{className:"research-view__findings",children:r.results.findings.map(t=>{const u=be(t);return e.jsxs("article",{className:"research-view__finding card",children:[e.jsx("h4",{children:t.heading}),e.jsx("p",{children:t.content}),e.jsxs("div",{className:"research-view__actions research-view__finding-actions",children:[e.jsx("button",{className:"btn btn-primary btn-sm",type:"button",onClick:()=>Q({mode:"create",findingId:u}),children:s("research.createTask","Create Task")}),e.jsx("button",{className:"btn btn-sm",type:"button",onClick:()=>Q({mode:"enrich",findingId:u}),children:s("research.enrichTask","Enrich Task")}),e.jsx("input",{className:"input","aria-label":s("research.destinationSlice","Destination slice ID"),value:J,onChange:p=>fe(p.target.value),placeholder:s("research.destinationSlice","Destination slice ID")}),e.jsx("button",{className:"btn btn-sm",type:"button",disabled:r.status!=="completed"||!J.trim()||E===`promote-${u}`,onClick:()=>void K(`promote-${u}`,()=>j(r.id,{findingId:u,sliceId:J.trim()}),s("research.findingPromoted","Finding promoted to roadmap")),children:s("research.promoteFinding","Promote to roadmap")})]})]},u)})}),Array.isArray(r.results?.citations)&&r.results.citations.length>0&&e.jsx("ul",{className:"research-view__citations",children:r.results.citations.map(t=>e.jsx("li",{children:e.jsx("a",{href:t,target:"_blank",rel:"noreferrer",children:t})},t))}),r.events.length>0&&e.jsxs("details",{children:[e.jsx("summary",{children:s("research.runHistory","Run history")}),e.jsx("ul",{className:"research-view__events",children:r.events.map(t=>e.jsx("li",{children:t.message},t.id))})]})]}),!r&&R.length>0&&e.jsx("p",{children:s("research.selectRunToViewDetails","Select a run to view details.")}),e.jsxs("div",{className:"research-view__stats",children:[e.jsxs("div",{className:"research-view__stat-card",children:[e.jsx("div",{className:"research-view__stat-label",children:s("research.statRunning","Running")}),e.jsx("div",{className:"research-view__stat-value",children:w.running})]}),e.jsxs("div",{className:"research-view__stat-card",children:[e.jsx("div",{className:"research-view__stat-label",children:s("research.statCompleted","Completed")}),e.jsx("div",{className:"research-view__stat-value",children:w.completed})]}),e.jsxs("div",{className:"research-view__stat-card",children:[e.jsx("div",{className:"research-view__stat-label",children:s("research.statFailed","Failed")}),e.jsx("div",{className:"research-view__stat-value",children:w.failed})]})]})]})]})]})}),r&&q&&(()=>{const t=r.results?.findings?.findIndex(p=>be(p)===q.findingId)??-1,u=t>=0?r.results.findings[t]:null;return u?e.jsx(Ke,{open:!0,mode:q.mode,run:r,finding:{id:q.findingId,heading:u.heading,content:u.content},projectId:a,onClose:()=>Q(null),onConfirm:async({taskId:p,title:x,description:L,priority:Re,attachExport:de})=>{q.mode==="create"?await K("create-task",()=>U(r.id,x,q.findingId,L,Re,de),s("research.taskCreatedFromResearch","Task created from research")):p&&await K("attach-task",()=>$(r.id,p,q.findingId,de),s("research.taskEnrichedFromResearch","Task enriched from research")),Q(null)}}):null})()]})}export{ts as ResearchView};
|
|
1
|
+
import{r as c,j as e}from"./vendor-react-SZ_qB27O.js";import{ao as W,ap as ue,aq as he,bx as me,cJ as Se,au as ce,cK as _e,bc as je,cL as Y,cM as we,cN as Ne,cO as ke,cP as Ee,cQ as Ce,cR as Ae,cS as Te,bB as Pe,cT as Le,cU as Ie,aV as Fe,af as Me,V as De,aH as pe,L as He,aI as qe}from"./index-BqLVwYoA.js";import{u as ve}from"./vendor-i18n-GF3RlKbq.js";import"./vendor-codemirror-jBKmHyH0.js";import"./vendor-reactflow-9C3XTE7_.js";import"./vendor-xterm-BNq00GSj.js";const Ue="builtin",X={pageFetch:!0,github:!1,localDocs:!0,llmSynthesis:!0};function ie(a){const n=a?.researchGlobalDefaults,i=a?.researchSettings;return{enabled:i?.enabled??a?.researchEnabled??a?.researchGlobalEnabled??!0,searchProvider:i?.searchProvider??n?.searchProvider??a?.researchGlobalWebSearchProvider??Ue,synthesisProvider:i?.synthesisProvider??n?.synthesisProvider,synthesisModelId:i?.synthesisModelId??n?.synthesisModelId,enabledSources:{webSearch:!0,pageFetch:i?.enabledSources?.pageFetch??n?.enabledSources?.pageFetch??X.pageFetch,github:i?.enabledSources?.github??n?.enabledSources?.github??X.github,localDocs:i?.enabledSources?.localDocs??n?.enabledSources?.localDocs??X.localDocs,llmSynthesis:i?.enabledSources?.llmSynthesis??n?.enabledSources?.llmSynthesis??X.llmSynthesis},limits:{maxConcurrentRuns:i?.limits?.maxConcurrentRuns??a?.researchMaxConcurrentRuns??a?.researchGlobalMaxConcurrentRuns??3,maxSourcesPerRun:i?.limits?.maxSourcesPerRun??n?.maxSourcesPerRun??a?.researchMaxSourcesPerRun??a?.researchGlobalMaxSourcesPerRun??20,maxDurationMs:i?.limits?.maxDurationMs??a?.researchDefaultTimeout??a?.researchGlobalDefaultTimeout??3e5,requestTimeoutMs:i?.limits?.requestTimeoutMs??a?.researchGlobalFetchTimeoutMs??3e4},defaultExportFormat:n?.defaultExportFormat??"markdown"}}function be(a){const n=typeof a.id=="string"?a.id.trim():"";if(n)return n;const i=b=>b.trim().replace(/\s+/g," ").toLowerCase(),m=[i(a.heading??""),i(a.content??""),...[...a.sources??[]].map(i).filter(Boolean).sort()].join(`
|
|
2
|
+
`);let s=2166136261;for(let b=0;b<m.length;b+=1)s^=m.charCodeAt(b),s=Math.imul(s,16777619);return`finding-${(s>>>0).toString(16).padStart(8,"0")}`}const Oe=300,Ve=4e3,$e=["queued","running","cancelling","retry_waiting"];function le(a,n){if(a instanceof Pe){const i=a;return{message:a.message,status:a.status,code:i.researchCode??"INTERNAL_ERROR",setupHint:i.setupHint,retryable:i.retryable}}return a instanceof Error?{message:a.message,code:"INTERNAL_ERROR"}:{message:n,code:"INTERNAL_ERROR"}}function Ge(a){if(!a)return{cancelable:!1,retryable:!1,isTransitioning:!1,blockingReason:"No run selected"};const n=$e.includes(a.status),i=a.status==="queued"||a.status==="running",m=a.lifecycle?.retryable,s=a.status==="failed"||a.status==="timed_out",b=!!(s&&m);let R;return!i&&n?R="Run is already transitioning":!i&&a.status==="completed"?R="Completed runs cannot be cancelled":!i&&a.status==="cancelled"?R="Run is already cancelled":!i&&a.status==="retry_exhausted"?R="Retry attempts exhausted":!i&&a.status==="failed"?R="Failed runs cannot be cancelled":!i&&a.status==="timed_out"&&(R="Timed out runs cannot be cancelled"),!b&&s&&m===!1&&(R=a.lifecycle?.errorCode==="RETRY_EXHAUSTED"?"Retry attempts exhausted":"Run is not retryable"),{cancelable:i,retryable:b,isTransitioning:n,blockingReason:R}}function Be(a){const n=a?.projectId,i=n??"",m=`${he.RESEARCH_RUNS_PREFIX}${i}`,s=`${he.RESEARCH_SELECTED_ID_PREFIX}${i}`,b=W(m,{maxAgeMs:ue}),R=W(s,{maxAgeMs:me}),r=c.useRef(Array.isArray(b)&&b.length>0),[M,I]=c.useState(()=>Array.isArray(b)?b:[]),[h,N]=c.useState(R??null),[C,_]=c.useState(null),[U,D]=c.useState({available:!0}),[H,A]=c.useState(!(Array.isArray(b)&&b.length>0)),[$,O]=c.useState(null),[G,j]=c.useState(null),[w,T]=c.useState(""),S=c.useRef(0),d=c.useRef(0),P=c.useRef(n);c.useEffect(()=>{P.current!==n&&(P.current=n,d.current++);const l=W(m,{maxAgeMs:ue}),o=W(s,{maxAgeMs:me}),v=Array.isArray(l)&&l.length>0;I(Array.isArray(l)?l:[]),N(o??null),_(null),A(!v),r.current=v},[n,m,s]);const k=c.useCallback(async(l=w)=>{const o=++S.current,v=n;r.current||A(!0),O(null),j(null);try{const y=await Se({q:l||void 0,limit:100},v);if(o!==S.current||v!==n)return;I(y.runs),ce(m,y.runs,{maxBytes:5e5}),r.current=!0,D(y.availability),h&&!y.runs.some(g=>g.id===h)&&(N(null),ce(s,null,{maxBytes:5e5}),_(null))}catch(y){if(o!==S.current||v!==n)return;const g=le(y,"Failed to load research runs");O(g.message),j(g)}finally{o===S.current&&A(!1)}},[n,m,w,s,h]),f=c.useCallback(async l=>{const o=await _e(l,n);return _(o.run),D(o.availability),o.run},[n]);c.useEffect(()=>{r.current||A(!0);const l=window.setTimeout(()=>{k(w)},Oe);return()=>window.clearTimeout(l)},[k,w]),c.useEffect(()=>{if(!h){_(null);return}f(h)},[f,h]),c.useEffect(()=>{const l=d.current,o=()=>d.current!==l,v=n?`?projectId=${encodeURIComponent(n)}`:"";let y=!0;const g=()=>{!y||o()||(k(),h&&f(h))},F=`/api/events${v}`,E=je(F,{events:{"research:run:created":g,"research:run:updated":g,"research:run:completed":g,"research:run:failed":g,"research:run:cancelled":g},onReconnect:()=>{Y({view:"useResearch",trigger:"sse-reconnect",projectId:n,replayAttempted:!1,sseChannel:F}),g()}});Y({view:"useResearch",trigger:"sse-open",projectId:n,replayAttempted:!1,sseChannel:F});const V=window.setInterval(g,Ve);return()=>{y=!1,E(),window.clearInterval(V)}},[n,k,h,f]);const z=c.useCallback(l=>{N(l),ce(s,l,{maxBytes:5e5})},[s]);return{runs:M,selectedRun:C,selectedRunId:h,setSelectedRunId:z,availability:U,loading:H,error:$,searchQuery:w,setSearchQuery:T,refresh:k,createRun:l=>Te(l,n),cancelRun:async l=>{try{j(null);const o=await Ae(l,n);return h===l&&_(o.run),await k(),o}catch(o){const v=le(o,"Failed to cancel run");throw j(v),v}},retryRun:async l=>{try{j(null);const o=await Ce(l,n);return h===l&&_(o.run),await k(),o}catch(o){const v=le(o,"Failed to retry run");throw j(v),v}},exportRun:(l,o)=>Ee(l,o,n),createTaskFromRun:(l,o,v,y,g,F)=>ke(l,{title:o,findingId:v,description:y,priority:g,attachExport:F},n),attachRunToTask:(l,o,v,y)=>Ne(l,{taskId:o,findingId:v,attachExport:y},n),promoteFinding:(l,o)=>we(l,o,n),uiError:G,runActionState:Ge(C),statusCounts:M.reduce((l,o)=>(l[o.status]+=1,l),{queued:0,running:0,cancelling:0,retry_waiting:0,completed:0,failed:0,cancelled:0,timed_out:0,retry_exhausted:0})}}function Ke({open:a,mode:n,run:i,finding:m,projectId:s,onClose:b,onConfirm:R}){const{t:r}=ve("app");Le(a);const[M,I]=c.useState(!1),[h,N]=c.useState(""),[C,_]=c.useState(""),[U,D]=c.useState("normal"),[H,A]=c.useState(""),[$,O]=c.useState([]),[G,j]=c.useState(!1),[w,T]=c.useState(!1),S=c.useMemo(()=>{const d=(m.content??"").split(/(?<=[.!?])\s+/)[0]??"";return`${m.heading||r("research.defaultFindingHeading","Research finding")} — ${d}`.trim()},[m.content,m.heading,r]);return c.useEffect(()=>{a&&(I(!1),N(`Research: ${m.heading||i.title}`),_(S),D("normal"),A(""),n==="enrich"&&(j(!0),Ie(50,0,s).then(d=>O(d.filter(P=>P.column!=="archived"))).finally(()=>j(!1))))},[a,n,s,m.heading,S,i.title]),a?e.jsx("div",{className:"modal-overlay open",role:"presentation",onClick:b,children:e.jsxs("div",{className:"modal modal-lg research-task-action-modal",role:"dialog","aria-modal":"true",onClick:d=>d.stopPropagation(),children:[e.jsxs("div",{className:"modal-header",children:[e.jsx("h3",{children:n==="create"?r("research.createTaskTitle","Create task from finding"):r("research.enrichTaskTitle","Enrich existing task")}),e.jsx("button",{className:"modal-close",type:"button","aria-label":r("actions.close","Close"),onClick:b,children:"×"})]}),e.jsxs("div",{className:"research-task-action-modal__body",children:[e.jsxs("div",{className:"card research-task-action-modal__preview",children:[e.jsxs("p",{children:[e.jsxs("strong",{children:[r("research.runLabel","Run:")," "]})," ",i.id]}),e.jsxs("p",{children:[e.jsxs("strong",{children:[r("research.findingLabel","Finding:")," "]})," ",m.id,m.heading?` — ${m.heading}`:""]}),e.jsx("p",{children:S||r("research.noPreview","No preview available.")})]}),n==="create"?e.jsxs(e.Fragment,{children:[e.jsxs("label",{className:"research-task-action-modal__field",children:[r("research.titleLabel","Title"),e.jsx("input",{className:"input",value:h,onChange:d=>N(d.target.value)})]}),e.jsxs("label",{className:"research-task-action-modal__field",children:[r("research.descriptionLabel","Description"),e.jsx("textarea",{className:"input research-task-action-modal__textarea",value:C,onChange:d=>_(d.target.value)})]}),e.jsxs("label",{className:"research-task-action-modal__field",children:[r("research.priorityLabel","Priority"),e.jsxs("select",{className:"select",value:U,onChange:d=>D(d.target.value),children:[e.jsx("option",{value:"low",children:r("research.priorityLow","Low")}),e.jsx("option",{value:"normal",children:r("research.priorityNormal","Normal")}),e.jsx("option",{value:"high",children:r("research.priorityHigh","High")}),e.jsx("option",{value:"urgent",children:r("research.priorityUrgent","Urgent")})]})]})]}):e.jsxs("label",{className:"research-task-action-modal__field",children:[r("research.targetTaskLabel","Target task"),e.jsx("input",{className:"input",list:"research-task-action-task-list",value:H,placeholder:G?r("research.loadingTasks","Loading tasks…"):r("research.enterTaskId","Enter task ID"),onChange:d=>A(d.target.value)}),e.jsx("datalist",{id:"research-task-action-task-list",children:$.map(d=>e.jsx("option",{value:d.id,children:d.title},d.id))})]}),e.jsxs("label",{className:"checkbox-label",children:[e.jsx("input",{type:"checkbox",checked:M,onChange:d=>I(d.target.checked)}),e.jsx("span",{children:r("research.attachExport","Attach markdown export artifact")})]})]}),e.jsxs("div",{className:"modal-actions",children:[e.jsx("button",{className:"btn",type:"button",onClick:b,children:r("actions.cancel","Cancel")}),e.jsx("button",{className:"btn btn-primary",type:"button",disabled:w||n==="enrich"&&!H,onClick:()=>{T(!0),R({taskId:n==="enrich"?H:void 0,title:n==="create"?h.trim():void 0,description:n==="create"?C.trim():void 0,priority:n==="create"?U:void 0,attachExport:M}).finally(()=>T(!1))},children:n==="create"?r("research.createTaskButton","Create Task"):r("research.enrichTaskButton","Enrich Task")})]})]})}):null}const ze=["web-search","page-fetch","github","local-docs","llm-synthesis"],Qe={"web-search":"webSearch","page-fetch":"pageFetch",github:"github","local-docs":"localDocs","llm-synthesis":"llmSynthesis"};function We(a){return{"web-search":a("research.providerWebSearch","Web Search"),"page-fetch":a("research.providerPageFetch","Page Fetch"),github:a("research.providerGitHub","GitHub"),"local-docs":a("research.providerLocalDocs","Local Docs"),"llm-synthesis":a("research.providerLlmSynthesis","LLM Synthesis")}}let oe=!1;function ts({projectId:a,addToast:n,onOpenSettings:i,readinessVersion:m=0}){const{t:s}=ve("app"),b=We(s);c.useEffect(()=>(Y({view:"ResearchView",trigger:oe?"route-active":"remount",projectId:a,replayAttempted:!1}),oe=!1,()=>{oe=!0,Y({view:"ResearchView",trigger:"route-inactive",projectId:a,replayAttempted:!1})}),[a]);const{runs:R,selectedRun:r,selectedRunId:M,setSelectedRunId:I,availability:h,loading:N,error:C,searchQuery:_,setSearchQuery:U,createRun:D,cancelRun:H,retryRun:A,exportRun:$,createTaskFromRun:O,attachRunToTask:G,promoteFinding:j,statusCounts:w,refresh:T,uiError:S,runActionState:d}=Be({projectId:a}),[P,k]=c.useState(""),[f,z]=c.useState(()=>ie(void 0)),[l,o]=c.useState([]),[v,y]=c.useState(!1),[g,F]=c.useState([]),[E,V]=c.useState(null),[q,Q]=c.useState(null),[J,fe]=c.useState(""),Z=h.supportedProviders??ze,ee=f.searchProvider,se=t=>t==="web-search"?!0:f.enabledSources[Qe[t]];c.useEffect(()=>{const t=Z.filter(u=>se(u));F(u=>{const p=u.filter(x=>t.includes(x));return p.length>0?p:t})},[f.enabledSources,Z]),c.useEffect(()=>{let t=!1;return Promise.all([Fe(a),Me().catch(()=>({providers:[]}))]).then(([u,p])=>{t||(z(ie(u)),o(p.providers.filter(x=>x.type==="api_key").map(x=>({id:x.id,authenticated:x.authenticated}))))}).catch(()=>{t||z(ie(void 0))}),()=>{t=!0}},[a,m]);const xe=c.useMemo(()=>r?r.status:s("research.noRunSelected","No run selected"),[r,s]),ye=c.useMemo(()=>r?r.status==="queued"||r.status==="retry_waiting"?"status-dot status-dot--pending":r.status==="running"?"status-dot status-dot--connecting":r.status==="completed"?"status-dot status-dot--online":r.status==="failed"||r.status==="cancelled"?"status-dot status-dot--error":"status-dot":"status-dot",[r]),re=h.supportedExportFormats??["markdown","json","html"],te=c.useMemo(()=>new Map(l.map(t=>[t.id,t.authenticated])),[l]),ae=c.useMemo(()=>{const t=new Set;return f.enabledSources.webSearch&&ee&&t.add(ee),f.enabledSources.llmSynthesis&&f.synthesisProvider&&t.add(f.synthesisProvider),[...t].filter(u=>te.has(u))},[f.enabledSources.llmSynthesis,f.enabledSources.webSearch,f.synthesisProvider,ee,te]).find(t=>te.get(t)!==!0),B=c.useMemo(()=>h.available?f.enabled?ae?{reason:s("research.missingApiKey","Missing API key for {{provider}}.",{provider:ae}),details:s("research.addCredentialsHint","Add provider credentials in Authentication settings."),settingsSection:"authentication"}:null:{reason:s("research.disabled","Research is disabled for this project."),details:s("research.enableResearchHint","Enable project research settings to create runs."),settingsSection:"research-project"}:{reason:h.reason??s("research.unavailable","Research is unavailable for this project."),details:h.setupInstructions,settingsSection:"research-project"},[h.available,h.reason,h.setupInstructions,f.enabled,ae,s]),K=async(t,u,p)=>{V(t);try{await u(),n?.(p,"success"),await T()}catch(x){n?.(x instanceof Error?x.message:s("research.actionFailed","Action failed"),"error")}finally{V(null)}},ne=async t=>{if(r){V(`export-${t}`);try{const u=await $(r.id,t),p=new Blob([u.content],{type:"text/plain;charset=utf-8"}),x=URL.createObjectURL(p),L=document.createElement("a");L.href=x,L.download=u.filename,document.body.appendChild(L),L.click(),L.remove(),URL.revokeObjectURL(x),n?.(s("research.exportedFile","Exported {{filename}}",{filename:u.filename}),"success")}catch(u){n?.(u instanceof Error?u.message:s("research.exportFailed","Export failed"),"error")}finally{V(null)}}},ge=async()=>{if(P.trim()){y(!0);try{const t=g.filter(p=>se(p));if(t.length===0){y(!1),n?.(s("research.noSourcesAvailable","No enabled research sources are available for this project."),"error");return}const u=await D({query:P.trim(),providers:t});I(u.run.id),k(""),n?.(s("research.runCreated","Research run created"),"success"),await T()}catch(t){n?.(t instanceof Error?t.message:s("research.createRunFailed","Failed to create run"),"error")}finally{y(!1)}}};return e.jsxs("section",{className:"research-view","aria-label":s("research.viewLabel","Research view"),children:[e.jsx(De,{icon:pe,title:s("research.title","Research"),actions:e.jsx("button",{className:"btn",type:"button",onClick:()=>void T(),children:s("actions.refresh","Refresh")})}),e.jsx("p",{className:"research-view__subtitle",children:s("research.subtitle","Cited search and synthesis runs: gather sources, fetch content, and synthesize findings.")}),B?e.jsxs("div",{className:"research-view__state research-view__state--error card","data-testid":"research-state-unavailable",children:[e.jsx("p",{children:B.reason}),B.details&&e.jsx("p",{children:B.details}),e.jsx("p",{children:s("research.currentDefaults","Current defaults: provider {{provider}}, max sources {{maxSources}}",{provider:f.searchProvider??s("research.notSet","(not set)"),maxSources:f.limits.maxSourcesPerRun})}),e.jsxs("div",{className:"research-view__actions",children:[e.jsx("button",{className:"btn",type:"button",onClick:()=>void T(),children:s("actions.refresh","Refresh")}),e.jsx("button",{className:"btn btn-primary",type:"button",onClick:()=>i?.(B.settingsSection),children:s("actions.openSettings","Open Settings")})]})]}):e.jsx(e.Fragment,{children:e.jsxs("div",{className:"research-view__layout",children:[e.jsx("aside",{className:"research-view__sidebar card",children:e.jsxs("div",{className:"research-view__sidebar-content",children:[e.jsxs("div",{className:"research-view__form",children:[e.jsxs("div",{className:"form-group",children:[e.jsx("label",{htmlFor:"research-query",children:s("research.queryLabel","Query")}),e.jsx("textarea",{id:"research-query",className:"input research-view__textarea",value:P,onChange:t=>k(t.target.value)})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{children:s("research.providersLabel","Providers")}),e.jsx("div",{className:"research-view__providers",children:Z.map(t=>{const u=se(t),p=t==="web-search";return e.jsxs("label",{className:"checkbox-label",children:[e.jsx("input",{type:"checkbox",checked:p||g.includes(t),disabled:p||!u,onChange:()=>{p||!u||F(x=>x.includes(t)?x.filter(L=>L!==t):[...x,t])}}),e.jsxs("span",{children:[b[t]??t,p?e.jsx("span",{className:"research-view__provider-lock",children:s("research.alwaysOn","Always on")}):null]})]},t)})})]}),e.jsxs("button",{className:"btn btn-primary",type:"button",disabled:!P.trim()||v,onClick:()=>void ge(),children:[v?e.jsx(He,{className:"animate-spin",size:14}):null,s("research.createRun","Create Run")]})]}),e.jsxs("div",{className:"research-view__history-header form-group",children:[e.jsx("label",{htmlFor:"research-run-search",children:s("actions.search","Search")}),e.jsxs("div",{className:"research-view__history-search-row",children:[e.jsx(pe,{size:14}),e.jsx("input",{id:"research-run-search",className:"input",placeholder:s("research.searchRunsPlaceholder","Search runs"),value:_,onChange:t=>U(t.target.value)})]})]}),e.jsx("div",{className:"research-view__history","data-testid":"research-state-running",children:R.map(t=>e.jsxs("button",{type:"button",className:`research-view__history-item card${M===t.id?" research-view__history-item--active":""}`,onClick:()=>I(t.id),children:[e.jsx("span",{className:"card-id",children:t.id}),e.jsx("span",{children:t.title})]},t.id))})]})}),e.jsxs("div",{className:"research-view__reader card",children:[N&&e.jsx("p",{"data-testid":"research-state-loading",children:e.jsx(qe,{label:s("research.loadingRuns","Loading research runs…")})}),!N&&C&&e.jsx("p",{"data-testid":"research-state-error",children:C}),!N&&!C&&R.length===0&&e.jsx("p",{"data-testid":"research-state-empty",children:s("research.noRunsYet","No research runs yet")}),e.jsxs("div",{className:"research-view__reader-content",children:[r&&e.jsxs("div",{className:"research-view__run-detail",children:[e.jsxs("div",{className:"research-view__status-row",children:[e.jsx("span",{className:ye}),e.jsx("strong",{children:xe})]}),e.jsx("h3",{className:"research-view__run-title",children:r.title}),e.jsx("p",{className:"research-view__run-query",children:r.query}),e.jsx("p",{className:"research-view__run-summary","data-testid":"research-state-results",children:r.results?.summary??s("research.noSummaryYet","No summary yet.")}),e.jsxs("div",{className:"research-view__actions",children:[e.jsx("button",{className:"btn",type:"button",title:d.cancelable?void 0:d.blockingReason,disabled:E==="cancel"||E==="retry"||!d.cancelable,onClick:()=>void K("cancel",()=>H(r.id),s("research.runCancelled","Run cancelled")),children:s("actions.cancel","Cancel")}),e.jsx("button",{className:"btn",type:"button",title:d.retryable?void 0:d.blockingReason,disabled:E==="cancel"||E==="retry"||!d.retryable,onClick:()=>void K("retry",()=>A(r.id),s("research.runRetried","Run retried")),children:s("actions.retry","Retry")}),re.includes("markdown")&&e.jsx("button",{className:"btn",type:"button",disabled:E==="export-markdown",onClick:()=>void ne("markdown"),children:s("research.exportMd","Export MD")}),re.includes("json")&&e.jsx("button",{className:"btn",type:"button",disabled:E==="export-json",onClick:()=>void ne("json"),children:s("research.exportJson","Export JSON")}),re.includes("html")&&e.jsx("button",{className:"btn",type:"button",disabled:E==="export-html",onClick:()=>void ne("html"),children:s("research.exportHtml","Export HTML")})]}),r.error&&e.jsx("p",{className:"research-view__error",children:r.error}),S&&e.jsxs("div",{className:"form-error",role:"alert",children:[e.jsx("p",{children:S.message}),S.setupHint&&e.jsx("p",{children:S.setupHint}),S.code==="MISSING_CREDENTIALS"&&e.jsx("button",{className:"btn btn-sm",type:"button",onClick:()=>i?.("authentication"),children:s("research.openAuthSettings","Open Authentication Settings")}),S.code==="FEATURE_DISABLED"&&e.jsx("button",{className:"btn btn-sm",type:"button",onClick:()=>i?.("research-project"),children:s("research.openResearchSettings","Open Research Settings")})]}),d.blockingReason&&e.jsx("p",{className:"research-view__run-query",children:d.blockingReason}),Array.isArray(r.results?.findings)&&r.results.findings.length>0&&e.jsx("div",{className:"research-view__findings",children:r.results.findings.map(t=>{const u=be(t);return e.jsxs("article",{className:"research-view__finding card",children:[e.jsx("h4",{children:t.heading}),e.jsx("p",{children:t.content}),e.jsxs("div",{className:"research-view__actions research-view__finding-actions",children:[e.jsx("button",{className:"btn btn-primary btn-sm",type:"button",onClick:()=>Q({mode:"create",findingId:u}),children:s("research.createTask","Create Task")}),e.jsx("button",{className:"btn btn-sm",type:"button",onClick:()=>Q({mode:"enrich",findingId:u}),children:s("research.enrichTask","Enrich Task")}),e.jsx("input",{className:"input","aria-label":s("research.destinationSlice","Destination slice ID"),value:J,onChange:p=>fe(p.target.value),placeholder:s("research.destinationSlice","Destination slice ID")}),e.jsx("button",{className:"btn btn-sm",type:"button",disabled:r.status!=="completed"||!J.trim()||E===`promote-${u}`,onClick:()=>void K(`promote-${u}`,()=>j(r.id,{findingId:u,sliceId:J.trim()}),s("research.findingPromoted","Finding promoted to roadmap")),children:s("research.promoteFinding","Promote to roadmap")})]})]},u)})}),Array.isArray(r.results?.citations)&&r.results.citations.length>0&&e.jsx("ul",{className:"research-view__citations",children:r.results.citations.map(t=>e.jsx("li",{children:e.jsx("a",{href:t,target:"_blank",rel:"noreferrer",children:t})},t))}),r.events.length>0&&e.jsxs("details",{children:[e.jsx("summary",{children:s("research.runHistory","Run history")}),e.jsx("ul",{className:"research-view__events",children:r.events.map(t=>e.jsx("li",{children:t.message},t.id))})]})]}),!r&&R.length>0&&e.jsx("p",{children:s("research.selectRunToViewDetails","Select a run to view details.")}),e.jsxs("div",{className:"research-view__stats",children:[e.jsxs("div",{className:"research-view__stat-card",children:[e.jsx("div",{className:"research-view__stat-label",children:s("research.statRunning","Running")}),e.jsx("div",{className:"research-view__stat-value",children:w.running})]}),e.jsxs("div",{className:"research-view__stat-card",children:[e.jsx("div",{className:"research-view__stat-label",children:s("research.statCompleted","Completed")}),e.jsx("div",{className:"research-view__stat-value",children:w.completed})]}),e.jsxs("div",{className:"research-view__stat-card",children:[e.jsx("div",{className:"research-view__stat-label",children:s("research.statFailed","Failed")}),e.jsx("div",{className:"research-view__stat-value",children:w.failed})]})]})]})]})]})}),r&&q&&(()=>{const t=r.results?.findings?.findIndex(p=>be(p)===q.findingId)??-1,u=t>=0?r.results.findings[t]:null;return u?e.jsx(Ke,{open:!0,mode:q.mode,run:r,finding:{id:q.findingId,heading:u.heading,content:u.content},projectId:a,onClose:()=>Q(null),onConfirm:async({taskId:p,title:x,description:L,priority:Re,attachExport:de})=>{q.mode==="create"?await K("create-task",()=>O(r.id,x,q.findingId,L,Re,de),s("research.taskCreatedFromResearch","Task created from research")):p&&await K("attach-task",()=>G(r.id,p,q.findingId,de),s("research.taskEnrichedFromResearch","Task enriched from research")),Q(null)}}):null})()]})}export{ts as ResearchView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as c,j as e}from"./vendor-react-SZ_qB27O.js";import{V as he,n as me,R as J,P as ye,E as Y,o as z,p as xe,q as ve,u as be,v as je,C as fe,e as Se,w as ge}from"./index-Cg9ahVtV.js";import{u as Ne}from"./vendor-i18n-GF3RlKbq.js";import"./vendor-codemirror-jBKmHyH0.js";import"./vendor-reactflow-9C3XTE7_.js";import"./vendor-xterm-BNq00GSj.js";const Ce="__sync_passphrase__",L={key:"",value:"",description:"",scope:"project",accessPolicy:"prompt",envExportable:!1,envExportKey:""},n={className:"secrets-action-icon","aria-hidden":!0,style:{width:"1em",height:"1em"}},Pe={...n,className:"secrets-action-icon spin"},Me=({addToast:i})=>{const{t:a}=Ne("app"),[R,G]=c.useState([]),[T,M]=c.useState(!0),[A,D]=c.useState(null),[K,b]=c.useState(null),[p,O]=c.useState(null),[U,x]=c.useState(!1),[Q,g]=c.useState(null),[t,l]=c.useState(L),[N,C]=c.useState(!1),[V,j]=c.useState({}),[W,F]=c.useState(null),[u,X]=c.useState(!1),[Z,_]=c.useState(!1),[f,B]=c.useState(""),[P,$]=c.useState(""),[ee,H]=c.useState(!1),[E,se]=c.useState(!1),h=c.useRef(new Map),w=c.useRef(new Map),o=c.useCallback(async(s,r)=>{const d=await fetch(s,{...r,headers:{"Content-Type":"application/json",...r?.headers??{}}});if(!d.ok){const m=await d.json().catch(()=>({error:"Request failed"}));throw new Error(String(m?.error??"Request failed"))}if(d.status!==204)return d.json()},[]),v=c.useCallback(async()=>{M(!0),D(null);try{const s=await o("/api/secrets");G(s.secrets)}catch(s){D(s instanceof Error?s.message:String(s))}finally{M(!1)}},[o]),S=c.useCallback(async()=>{try{const s=await o("/api/secrets/sync-passphrase");X(!!s.configured)}catch(s){i?.(a("secrets.errorLoadSyncStatus","Failed to load sync passphrase status: {{error}}",{error:s instanceof Error?s.message:String(s)}),"error")}},[i,o]);c.useEffect(()=>(v(),S(),()=>{h.current.forEach(s=>clearTimeout(s)),w.current.forEach(s=>clearTimeout(s))}),[v,S]);const k=()=>{_(!1),B(""),$("")},ae=async s=>{await o("/api/secrets/sync-passphrase",{method:"PUT",body:JSON.stringify({passphrase:s})})},re=async()=>{H(!0);try{await ae(f),i?.(u?a("secrets.syncPassphraseRotated","Sync passphrase rotated"):a("secrets.syncPassphraseSet","Sync passphrase set"),"success"),k(),await S()}catch(s){i?.(a("secrets.errorSaveSyncPassphrase","Failed to save sync passphrase: {{error}}",{error:s instanceof Error?s.message:String(s)}),"error")}finally{H(!1)}},te=async()=>{if(window.confirm(a("secrets.confirmClearSyncPassphrase","Clear the cross-node sync passphrase? Existing sync pairs will stop working until you set a new passphrase.")))try{await o("/api/secrets/sync-passphrase",{method:"DELETE"}),i?.(a("secrets.syncPassphraseCleared","Sync passphrase cleared"),"success"),await S()}catch(r){i?.(a("secrets.errorClearSyncPassphrase","Failed to clear sync passphrase: {{error}}",{error:r instanceof Error?r.message:String(r)}),"error")}},ce=()=>{O(null),l(L),x(!0),C(!1),b(null)},le=s=>{O(s),l({key:s.key,value:"",description:s.description??"",scope:s.scope,accessPolicy:s.accessPolicy,envExportable:s.envExportable,envExportKey:s.envExportKey??""}),x(!0),C(!1),b(null)},ne=async()=>{b(null);try{if(p){const s={key:t.key,description:t.description||null,accessPolicy:t.accessPolicy,envExportable:t.envExportable,envExportKey:t.envExportable&&t.envExportKey||null};t.value&&(s.value=t.value),await o(`/api/secrets/${p.scope}/${p.id}`,{method:"PATCH",body:JSON.stringify(s)})}else await o("/api/secrets",{method:"POST",body:JSON.stringify({scope:t.scope,key:t.key,value:t.value,description:t.description||null,accessPolicy:t.accessPolicy,envExportable:t.envExportable,envExportKey:t.envExportable&&t.envExportKey||null})});x(!1),l(L),await v()}catch(s){b(s instanceof Error?s.message:String(s))}},oe=s=>{const r=h.current.get(s.id);r&&(clearTimeout(r),h.current.delete(s.id)),j(d=>({...d,[s.id]:null}))},ie=async s=>{const r=await o(`/api/secrets/${s.scope}/${s.id}/reveal`,{method:"POST"});j(y=>({...y,[s.id]:r.value})),i?.(a("secrets.revealed","Revealed"),"success");const d=setTimeout(()=>{j(y=>({...y,[s.id]:null})),h.current.delete(s.id)},3e4),m=h.current.get(s.id);m&&clearTimeout(m),h.current.set(s.id,d)},de=async s=>{const r=V[s.id];if(!r)return;if(!await ge(r)){i?.(a("secrets.copyFailed","Failed to copy secret"),"error");return}F(s.id),i?.(a("secrets.copied","Copied"),"success");const m=setTimeout(()=>{F(null),j(ue=>({...ue,[s.id]:null}))},1500),y=w.current.get(s.id);y&&clearTimeout(y),w.current.set(s.id,m)},pe=async s=>{await o(`/api/secrets/${s.scope}/${s.id}`,{method:"DELETE"}),g(null),await v()},I=c.useMemo(()=>[...R].filter(s=>!(s.scope==="global"&&s.key===Ce)).sort((s,r)=>s.key.localeCompare(r.key)),[R]),q=f.length>0&&f===P;return e.jsxs("section",{className:"secrets-view",children:[e.jsx(he,{icon:me,title:a("secrets.title","Secrets"),actions:e.jsxs(e.Fragment,{children:[e.jsxs("button",{className:"btn btn-sm",onClick:()=>void v(),children:[e.jsx(J,{...n})," ",a("secrets.refresh","Refresh")]}),e.jsxs("button",{className:"btn btn-primary btn-sm",onClick:ce,children:[e.jsx(ye,{...n})," ",a("secrets.addSecret","Add Secret")]})]})}),A?e.jsx("div",{className:"form-error",children:A}):null,T?e.jsxs("div",{className:"secrets-loading",children:[e.jsx(J,{...Pe})," ",a("secrets.loading","Loading…")]}):null,!T&&I.length===0?e.jsx("div",{className:"secrets-empty",children:a("secrets.empty","No secrets found.")}):null,e.jsx("div",{className:"secrets-list",children:I.map(s=>{const r=V[s.id];return e.jsxs("article",{className:"card secrets-row",children:[e.jsxs("div",{className:"secrets-row-main",children:[e.jsx("div",{className:"secrets-row-key",children:s.key}),e.jsxs("div",{className:"secrets-row-meta",children:[e.jsx("span",{className:"secrets-chip",children:s.scope}),e.jsx("span",{className:"secrets-chip",children:s.accessPolicy}),s.envExportable?e.jsx("span",{className:"secrets-chip",children:a("secrets.envExportableChip","env exportable")}):null]}),r?e.jsx("pre",{className:"secrets-revealed",children:r}):null]}),e.jsxs("div",{className:"secrets-row-side",children:[e.jsx("span",{className:"secrets-row-read",children:s.lastReadAt?new Date(s.lastReadAt).toLocaleString():a("secrets.neverRead","Never read")}),e.jsxs("div",{className:"secrets-row-actions",children:[e.jsx("button",{type:"button",className:"btn btn-icon secrets-visibility-toggle",onClick:()=>{if(r){oe(s);return}ie(s)},"aria-label":r?a("secrets.hideAriaLabel","Hide"):a("secrets.revealAriaLabel","Reveal"),children:r?e.jsx(Y,{...n}):e.jsx(z,{...n})}),e.jsx("button",{className:"btn btn-icon",onClick:()=>void de(s),"aria-label":a("secrets.copyAriaLabel","Copy"),disabled:!r,children:W===s.id?e.jsx(xe,{...n}):e.jsx(ve,{...n})}),e.jsx("button",{className:"btn btn-icon",onClick:()=>le(s),"aria-label":a("secrets.editAriaLabel","Edit"),children:e.jsx(be,{...n})}),e.jsx("button",{className:"btn btn-icon btn-danger",onClick:()=>g(s.id),"aria-label":a("secrets.deleteAriaLabel","Delete"),children:e.jsx(je,{...n})})]}),Q===s.id?e.jsxs("div",{className:"secrets-confirm",children:[e.jsx("button",{className:"btn btn-sm btn-danger",onClick:()=>void pe(s),children:a("secrets.confirmDelete","Confirm")}),e.jsx("button",{className:"btn btn-sm",onClick:()=>g(null),children:a("secrets.cancelDelete","Cancel")})]}):null]})]},s.id)})}),e.jsxs("article",{className:"card secrets-sync-card secrets-sync-disclosure",children:[e.jsxs("button",{type:"button",className:"secrets-sync-disclosure-toggle","data-testid":"secrets-passphrase-disclosure","aria-expanded":E,"aria-controls":"secrets-sync-disclosure-panel",onClick:()=>se(s=>!s),children:[E?e.jsx(fe,{size:16,"aria-hidden":"true"}):e.jsx(Se,{size:16,"aria-hidden":"true"}),e.jsx("span",{children:a("secrets.syncPassphraseTitle","Cross-Node Sync Passphrase")})]}),E?e.jsxs("div",{id:"secrets-sync-disclosure-panel",className:"secrets-sync-disclosure-panel",children:[e.jsxs("div",{className:"secrets-sync-header",children:[e.jsxs("p",{className:"secrets-sync-status",children:[e.jsx("span",{className:`status-dot ${u?"status-dot--online":"status-dot--pending"}`,"aria-hidden":"true"})," ",u?a("secrets.syncConfigured","Configured"):a("secrets.syncNotConfigured","Not configured")]}),e.jsxs("div",{className:"secrets-sync-actions",children:[e.jsx("button",{className:"btn",onClick:()=>_(!0),children:u?a("secrets.rotateSyncPassphrase","Rotate"):a("secrets.setPassphrase","Set passphrase")}),u?e.jsx("button",{className:"btn btn-danger",onClick:()=>void te(),children:a("secrets.clearSyncPassphrase","Clear")}):null]})]}),e.jsx("p",{className:"secrets-sync-copy",children:a("secrets.syncPassphraseDescription","Shared passphrase used to wrap cross-node secret bundles. Both nodes in a sync pair must share the same value. Stored locally only; never transmitted.")})]}):null]}),Z?e.jsx("div",{className:"modal-overlay open",role:"presentation",children:e.jsxs("div",{className:"modal",role:"dialog","aria-modal":"true","aria-label":u?a("secrets.rotateSyncPassphraseModalTitle","Rotate sync passphrase"):a("secrets.setSyncPassphraseModalTitle","Set sync passphrase"),children:[e.jsxs("div",{className:"modal-header",children:[e.jsx("h3",{children:u?a("secrets.rotateSyncPassphraseModalTitle","Rotate sync passphrase"):a("secrets.setSyncPassphraseModalTitle","Set sync passphrase")}),e.jsx("button",{className:"modal-close",onClick:k,"aria-label":a("secrets.closeAriaLabel","Close"),children:"×"})]}),e.jsxs("div",{className:"secrets-modal-body",children:[e.jsxs("div",{className:"form-group",children:[e.jsx("label",{children:a("secrets.passphraseLabel","Passphrase")}),e.jsx("input",{"aria-label":a("secrets.passphraseLabel","Passphrase"),className:"input",type:"password",autoComplete:"new-password",value:f,onChange:s=>B(s.target.value)})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{children:a("secrets.confirmPassphraseLabel","Confirm passphrase")}),e.jsx("input",{"aria-label":a("secrets.confirmPassphraseLabel","Confirm passphrase"),className:"input",type:"password",autoComplete:"new-password",value:P,onChange:s=>$(s.target.value)})]}),!q&&P.length>0?e.jsx("div",{className:"form-error",children:a("secrets.passphraseMustMatch","Passphrases must match.")}):null]}),e.jsx("div",{className:"modal-actions",children:e.jsxs("div",{className:"modal-actions-right",children:[e.jsx("button",{className:"btn",onClick:k,children:a("secrets.cancelBtn","Cancel")}),e.jsx("button",{className:"btn btn-primary",onClick:()=>void re(),disabled:!q||ee,children:u?a("secrets.rotateSyncPassphrase","Rotate"):a("secrets.setPassphrase","Set passphrase")})]})})]})}):null,U?e.jsx("div",{className:"modal-overlay open",role:"presentation",children:e.jsxs("div",{className:"modal",role:"dialog","aria-modal":"true","aria-label":p?a("secrets.editSecretModalTitle","Edit secret"):a("secrets.addSecretModalTitle","Add secret"),children:[e.jsxs("div",{className:"modal-header",children:[e.jsx("h3",{children:p?a("secrets.editSecretModalTitle","Edit secret"):a("secrets.addSecretModalTitle","Add secret")}),e.jsx("button",{className:"modal-close",onClick:()=>x(!1),"aria-label":a("secrets.closeAriaLabel","Close"),children:"×"})]}),e.jsxs("div",{className:"secrets-modal-body",children:[e.jsxs("div",{className:"form-group",children:[e.jsx("label",{children:a("secrets.keyLabel","Key")}),e.jsx("input",{className:"input",value:t.key,onChange:s=>l(r=>({...r,key:s.target.value}))})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{children:a("secrets.valueLabel","Value")}),e.jsxs("div",{className:"secrets-value-row",children:[e.jsx("input",{className:"input",type:N?"text":"password",autoComplete:"off",spellCheck:!1,value:t.value,onChange:s=>l(r=>({...r,value:s.target.value}))}),e.jsx("button",{type:"button",className:"btn btn-icon secrets-visibility-toggle",onClick:()=>C(s=>!s),"aria-label":N?a("secrets.hideValueAriaLabel","Hide value"):a("secrets.showValueAriaLabel","Show value"),children:N?e.jsx(Y,{...n}):e.jsx(z,{...n})})]})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{children:a("secrets.descriptionLabel","Description")}),e.jsx("textarea",{className:"input",value:t.description,onChange:s=>l(r=>({...r,description:s.target.value}))})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{children:a("secrets.scopeLabel","Scope")}),e.jsxs("div",{className:"secrets-radio-row",children:[e.jsxs("label",{children:[e.jsx("input",{type:"radio",checked:t.scope==="project",onChange:()=>l(s=>({...s,scope:"project"})),disabled:!!p})," ",a("secrets.scopeProject","Project")]}),e.jsxs("label",{children:[e.jsx("input",{type:"radio",checked:t.scope==="global",onChange:()=>l(s=>({...s,scope:"global"})),disabled:!!p})," ",a("secrets.scopeGlobal","Global")]})]})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{children:a("secrets.accessPolicyLabel","Access policy")}),e.jsxs("select",{className:"select",value:t.accessPolicy,onChange:s=>l(r=>({...r,accessPolicy:s.target.value})),children:[e.jsx("option",{value:"auto",children:a("secrets.accessPolicyAuto","auto")}),e.jsx("option",{value:"prompt",children:a("secrets.accessPolicyPrompt","prompt")}),e.jsx("option",{value:"deny",children:a("secrets.accessPolicyDeny","deny")})]})]}),e.jsx("div",{className:"form-group",children:e.jsxs("label",{className:"checkbox-label",children:[e.jsx("input",{type:"checkbox",checked:t.envExportable,onChange:s=>l(r=>({...r,envExportable:s.target.checked}))})," ",a("secrets.exportToEnvLabel","Export to env")]})}),t.envExportable?e.jsxs("div",{className:"form-group",children:[e.jsx("label",{children:a("secrets.envKeyLabel","Env key")}),e.jsx("input",{className:"input",value:t.envExportKey,onChange:s=>l(r=>({...r,envExportKey:s.target.value}))})]}):null,K?e.jsx("div",{className:"form-error",children:K}):null]}),e.jsx("div",{className:"modal-actions",children:e.jsxs("div",{className:"modal-actions-right",children:[e.jsx("button",{className:"btn",onClick:()=>x(!1),children:a("secrets.cancelBtn","Cancel")}),e.jsx("button",{className:"btn btn-primary",onClick:()=>void ne(),children:p?a("secrets.saveBtn","Save"):a("secrets.createBtn","Create")})]})})]})}):null]})};export{Me as SecretsView};
|
|
1
|
+
import{r as c,j as e}from"./vendor-react-SZ_qB27O.js";import{V as he,o as me,R as J,P as ye,E as Y,p as z,q as xe,u as ve,v as be,x as je,C as fe,g as Se,y as ge}from"./index-BqLVwYoA.js";import{u as Ne}from"./vendor-i18n-GF3RlKbq.js";import"./vendor-codemirror-jBKmHyH0.js";import"./vendor-reactflow-9C3XTE7_.js";import"./vendor-xterm-BNq00GSj.js";const Ce="__sync_passphrase__",L={key:"",value:"",description:"",scope:"project",accessPolicy:"prompt",envExportable:!1,envExportKey:""},n={className:"secrets-action-icon","aria-hidden":!0,style:{width:"1em",height:"1em"}},Pe={...n,className:"secrets-action-icon spin"},Me=({addToast:i})=>{const{t:a}=Ne("app"),[R,G]=c.useState([]),[T,M]=c.useState(!0),[A,D]=c.useState(null),[K,b]=c.useState(null),[p,O]=c.useState(null),[U,x]=c.useState(!1),[Q,g]=c.useState(null),[t,l]=c.useState(L),[N,C]=c.useState(!1),[V,j]=c.useState({}),[W,F]=c.useState(null),[u,X]=c.useState(!1),[Z,_]=c.useState(!1),[f,B]=c.useState(""),[P,$]=c.useState(""),[ee,H]=c.useState(!1),[E,se]=c.useState(!1),h=c.useRef(new Map),w=c.useRef(new Map),o=c.useCallback(async(s,r)=>{const d=await fetch(s,{...r,headers:{"Content-Type":"application/json",...r?.headers??{}}});if(!d.ok){const m=await d.json().catch(()=>({error:"Request failed"}));throw new Error(String(m?.error??"Request failed"))}if(d.status!==204)return d.json()},[]),v=c.useCallback(async()=>{M(!0),D(null);try{const s=await o("/api/secrets");G(s.secrets)}catch(s){D(s instanceof Error?s.message:String(s))}finally{M(!1)}},[o]),S=c.useCallback(async()=>{try{const s=await o("/api/secrets/sync-passphrase");X(!!s.configured)}catch(s){i?.(a("secrets.errorLoadSyncStatus","Failed to load sync passphrase status: {{error}}",{error:s instanceof Error?s.message:String(s)}),"error")}},[i,o]);c.useEffect(()=>(v(),S(),()=>{h.current.forEach(s=>clearTimeout(s)),w.current.forEach(s=>clearTimeout(s))}),[v,S]);const k=()=>{_(!1),B(""),$("")},ae=async s=>{await o("/api/secrets/sync-passphrase",{method:"PUT",body:JSON.stringify({passphrase:s})})},re=async()=>{H(!0);try{await ae(f),i?.(u?a("secrets.syncPassphraseRotated","Sync passphrase rotated"):a("secrets.syncPassphraseSet","Sync passphrase set"),"success"),k(),await S()}catch(s){i?.(a("secrets.errorSaveSyncPassphrase","Failed to save sync passphrase: {{error}}",{error:s instanceof Error?s.message:String(s)}),"error")}finally{H(!1)}},te=async()=>{if(window.confirm(a("secrets.confirmClearSyncPassphrase","Clear the cross-node sync passphrase? Existing sync pairs will stop working until you set a new passphrase.")))try{await o("/api/secrets/sync-passphrase",{method:"DELETE"}),i?.(a("secrets.syncPassphraseCleared","Sync passphrase cleared"),"success"),await S()}catch(r){i?.(a("secrets.errorClearSyncPassphrase","Failed to clear sync passphrase: {{error}}",{error:r instanceof Error?r.message:String(r)}),"error")}},ce=()=>{O(null),l(L),x(!0),C(!1),b(null)},le=s=>{O(s),l({key:s.key,value:"",description:s.description??"",scope:s.scope,accessPolicy:s.accessPolicy,envExportable:s.envExportable,envExportKey:s.envExportKey??""}),x(!0),C(!1),b(null)},ne=async()=>{b(null);try{if(p){const s={key:t.key,description:t.description||null,accessPolicy:t.accessPolicy,envExportable:t.envExportable,envExportKey:t.envExportable&&t.envExportKey||null};t.value&&(s.value=t.value),await o(`/api/secrets/${p.scope}/${p.id}`,{method:"PATCH",body:JSON.stringify(s)})}else await o("/api/secrets",{method:"POST",body:JSON.stringify({scope:t.scope,key:t.key,value:t.value,description:t.description||null,accessPolicy:t.accessPolicy,envExportable:t.envExportable,envExportKey:t.envExportable&&t.envExportKey||null})});x(!1),l(L),await v()}catch(s){b(s instanceof Error?s.message:String(s))}},oe=s=>{const r=h.current.get(s.id);r&&(clearTimeout(r),h.current.delete(s.id)),j(d=>({...d,[s.id]:null}))},ie=async s=>{const r=await o(`/api/secrets/${s.scope}/${s.id}/reveal`,{method:"POST"});j(y=>({...y,[s.id]:r.value})),i?.(a("secrets.revealed","Revealed"),"success");const d=setTimeout(()=>{j(y=>({...y,[s.id]:null})),h.current.delete(s.id)},3e4),m=h.current.get(s.id);m&&clearTimeout(m),h.current.set(s.id,d)},de=async s=>{const r=V[s.id];if(!r)return;if(!await ge(r)){i?.(a("secrets.copyFailed","Failed to copy secret"),"error");return}F(s.id),i?.(a("secrets.copied","Copied"),"success");const m=setTimeout(()=>{F(null),j(ue=>({...ue,[s.id]:null}))},1500),y=w.current.get(s.id);y&&clearTimeout(y),w.current.set(s.id,m)},pe=async s=>{await o(`/api/secrets/${s.scope}/${s.id}`,{method:"DELETE"}),g(null),await v()},I=c.useMemo(()=>[...R].filter(s=>!(s.scope==="global"&&s.key===Ce)).sort((s,r)=>s.key.localeCompare(r.key)),[R]),q=f.length>0&&f===P;return e.jsxs("section",{className:"secrets-view",children:[e.jsx(he,{icon:me,title:a("secrets.title","Secrets"),actions:e.jsxs(e.Fragment,{children:[e.jsxs("button",{className:"btn btn-sm",onClick:()=>void v(),children:[e.jsx(J,{...n})," ",a("secrets.refresh","Refresh")]}),e.jsxs("button",{className:"btn btn-primary btn-sm",onClick:ce,children:[e.jsx(ye,{...n})," ",a("secrets.addSecret","Add Secret")]})]})}),A?e.jsx("div",{className:"form-error",children:A}):null,T?e.jsxs("div",{className:"secrets-loading",children:[e.jsx(J,{...Pe})," ",a("secrets.loading","Loading…")]}):null,!T&&I.length===0?e.jsx("div",{className:"secrets-empty",children:a("secrets.empty","No secrets found.")}):null,e.jsx("div",{className:"secrets-list",children:I.map(s=>{const r=V[s.id];return e.jsxs("article",{className:"card secrets-row",children:[e.jsxs("div",{className:"secrets-row-main",children:[e.jsx("div",{className:"secrets-row-key",children:s.key}),e.jsxs("div",{className:"secrets-row-meta",children:[e.jsx("span",{className:"secrets-chip",children:s.scope}),e.jsx("span",{className:"secrets-chip",children:s.accessPolicy}),s.envExportable?e.jsx("span",{className:"secrets-chip",children:a("secrets.envExportableChip","env exportable")}):null]}),r?e.jsx("pre",{className:"secrets-revealed",children:r}):null]}),e.jsxs("div",{className:"secrets-row-side",children:[e.jsx("span",{className:"secrets-row-read",children:s.lastReadAt?new Date(s.lastReadAt).toLocaleString():a("secrets.neverRead","Never read")}),e.jsxs("div",{className:"secrets-row-actions",children:[e.jsx("button",{type:"button",className:"btn btn-icon secrets-visibility-toggle",onClick:()=>{if(r){oe(s);return}ie(s)},"aria-label":r?a("secrets.hideAriaLabel","Hide"):a("secrets.revealAriaLabel","Reveal"),children:r?e.jsx(Y,{...n}):e.jsx(z,{...n})}),e.jsx("button",{className:"btn btn-icon",onClick:()=>void de(s),"aria-label":a("secrets.copyAriaLabel","Copy"),disabled:!r,children:W===s.id?e.jsx(xe,{...n}):e.jsx(ve,{...n})}),e.jsx("button",{className:"btn btn-icon",onClick:()=>le(s),"aria-label":a("secrets.editAriaLabel","Edit"),children:e.jsx(be,{...n})}),e.jsx("button",{className:"btn btn-icon btn-danger",onClick:()=>g(s.id),"aria-label":a("secrets.deleteAriaLabel","Delete"),children:e.jsx(je,{...n})})]}),Q===s.id?e.jsxs("div",{className:"secrets-confirm",children:[e.jsx("button",{className:"btn btn-sm btn-danger",onClick:()=>void pe(s),children:a("secrets.confirmDelete","Confirm")}),e.jsx("button",{className:"btn btn-sm",onClick:()=>g(null),children:a("secrets.cancelDelete","Cancel")})]}):null]})]},s.id)})}),e.jsxs("article",{className:"card secrets-sync-card secrets-sync-disclosure",children:[e.jsxs("button",{type:"button",className:"secrets-sync-disclosure-toggle","data-testid":"secrets-passphrase-disclosure","aria-expanded":E,"aria-controls":"secrets-sync-disclosure-panel",onClick:()=>se(s=>!s),children:[E?e.jsx(fe,{size:16,"aria-hidden":"true"}):e.jsx(Se,{size:16,"aria-hidden":"true"}),e.jsx("span",{children:a("secrets.syncPassphraseTitle","Cross-Node Sync Passphrase")})]}),E?e.jsxs("div",{id:"secrets-sync-disclosure-panel",className:"secrets-sync-disclosure-panel",children:[e.jsxs("div",{className:"secrets-sync-header",children:[e.jsxs("p",{className:"secrets-sync-status",children:[e.jsx("span",{className:`status-dot ${u?"status-dot--online":"status-dot--pending"}`,"aria-hidden":"true"})," ",u?a("secrets.syncConfigured","Configured"):a("secrets.syncNotConfigured","Not configured")]}),e.jsxs("div",{className:"secrets-sync-actions",children:[e.jsx("button",{className:"btn",onClick:()=>_(!0),children:u?a("secrets.rotateSyncPassphrase","Rotate"):a("secrets.setPassphrase","Set passphrase")}),u?e.jsx("button",{className:"btn btn-danger",onClick:()=>void te(),children:a("secrets.clearSyncPassphrase","Clear")}):null]})]}),e.jsx("p",{className:"secrets-sync-copy",children:a("secrets.syncPassphraseDescription","Shared passphrase used to wrap cross-node secret bundles. Both nodes in a sync pair must share the same value. Stored locally only; never transmitted.")})]}):null]}),Z?e.jsx("div",{className:"modal-overlay open",role:"presentation",children:e.jsxs("div",{className:"modal",role:"dialog","aria-modal":"true","aria-label":u?a("secrets.rotateSyncPassphraseModalTitle","Rotate sync passphrase"):a("secrets.setSyncPassphraseModalTitle","Set sync passphrase"),children:[e.jsxs("div",{className:"modal-header",children:[e.jsx("h3",{children:u?a("secrets.rotateSyncPassphraseModalTitle","Rotate sync passphrase"):a("secrets.setSyncPassphraseModalTitle","Set sync passphrase")}),e.jsx("button",{className:"modal-close",onClick:k,"aria-label":a("secrets.closeAriaLabel","Close"),children:"×"})]}),e.jsxs("div",{className:"secrets-modal-body",children:[e.jsxs("div",{className:"form-group",children:[e.jsx("label",{children:a("secrets.passphraseLabel","Passphrase")}),e.jsx("input",{"aria-label":a("secrets.passphraseLabel","Passphrase"),className:"input",type:"password",autoComplete:"new-password",value:f,onChange:s=>B(s.target.value)})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{children:a("secrets.confirmPassphraseLabel","Confirm passphrase")}),e.jsx("input",{"aria-label":a("secrets.confirmPassphraseLabel","Confirm passphrase"),className:"input",type:"password",autoComplete:"new-password",value:P,onChange:s=>$(s.target.value)})]}),!q&&P.length>0?e.jsx("div",{className:"form-error",children:a("secrets.passphraseMustMatch","Passphrases must match.")}):null]}),e.jsx("div",{className:"modal-actions",children:e.jsxs("div",{className:"modal-actions-right",children:[e.jsx("button",{className:"btn",onClick:k,children:a("secrets.cancelBtn","Cancel")}),e.jsx("button",{className:"btn btn-primary",onClick:()=>void re(),disabled:!q||ee,children:u?a("secrets.rotateSyncPassphrase","Rotate"):a("secrets.setPassphrase","Set passphrase")})]})})]})}):null,U?e.jsx("div",{className:"modal-overlay open",role:"presentation",children:e.jsxs("div",{className:"modal",role:"dialog","aria-modal":"true","aria-label":p?a("secrets.editSecretModalTitle","Edit secret"):a("secrets.addSecretModalTitle","Add secret"),children:[e.jsxs("div",{className:"modal-header",children:[e.jsx("h3",{children:p?a("secrets.editSecretModalTitle","Edit secret"):a("secrets.addSecretModalTitle","Add secret")}),e.jsx("button",{className:"modal-close",onClick:()=>x(!1),"aria-label":a("secrets.closeAriaLabel","Close"),children:"×"})]}),e.jsxs("div",{className:"secrets-modal-body",children:[e.jsxs("div",{className:"form-group",children:[e.jsx("label",{children:a("secrets.keyLabel","Key")}),e.jsx("input",{className:"input",value:t.key,onChange:s=>l(r=>({...r,key:s.target.value}))})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{children:a("secrets.valueLabel","Value")}),e.jsxs("div",{className:"secrets-value-row",children:[e.jsx("input",{className:"input",type:N?"text":"password",autoComplete:"off",spellCheck:!1,value:t.value,onChange:s=>l(r=>({...r,value:s.target.value}))}),e.jsx("button",{type:"button",className:"btn btn-icon secrets-visibility-toggle",onClick:()=>C(s=>!s),"aria-label":N?a("secrets.hideValueAriaLabel","Hide value"):a("secrets.showValueAriaLabel","Show value"),children:N?e.jsx(Y,{...n}):e.jsx(z,{...n})})]})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{children:a("secrets.descriptionLabel","Description")}),e.jsx("textarea",{className:"input",value:t.description,onChange:s=>l(r=>({...r,description:s.target.value}))})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{children:a("secrets.scopeLabel","Scope")}),e.jsxs("div",{className:"secrets-radio-row",children:[e.jsxs("label",{children:[e.jsx("input",{type:"radio",checked:t.scope==="project",onChange:()=>l(s=>({...s,scope:"project"})),disabled:!!p})," ",a("secrets.scopeProject","Project")]}),e.jsxs("label",{children:[e.jsx("input",{type:"radio",checked:t.scope==="global",onChange:()=>l(s=>({...s,scope:"global"})),disabled:!!p})," ",a("secrets.scopeGlobal","Global")]})]})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{children:a("secrets.accessPolicyLabel","Access policy")}),e.jsxs("select",{className:"select",value:t.accessPolicy,onChange:s=>l(r=>({...r,accessPolicy:s.target.value})),children:[e.jsx("option",{value:"auto",children:a("secrets.accessPolicyAuto","auto")}),e.jsx("option",{value:"prompt",children:a("secrets.accessPolicyPrompt","prompt")}),e.jsx("option",{value:"deny",children:a("secrets.accessPolicyDeny","deny")})]})]}),e.jsx("div",{className:"form-group",children:e.jsxs("label",{className:"checkbox-label",children:[e.jsx("input",{type:"checkbox",checked:t.envExportable,onChange:s=>l(r=>({...r,envExportable:s.target.checked}))})," ",a("secrets.exportToEnvLabel","Export to env")]})}),t.envExportable?e.jsxs("div",{className:"form-group",children:[e.jsx("label",{children:a("secrets.envKeyLabel","Env key")}),e.jsx("input",{className:"input",value:t.envExportKey,onChange:s=>l(r=>({...r,envExportKey:s.target.value}))})]}):null,K?e.jsx("div",{className:"form-error",children:K}):null]}),e.jsx("div",{className:"modal-actions",children:e.jsxs("div",{className:"modal-actions-right",children:[e.jsx("button",{className:"btn",onClick:()=>x(!1),children:a("secrets.cancelBtn","Cancel")}),e.jsx("button",{className:"btn btn-primary",onClick:()=>void ne(),children:p?a("secrets.saveBtn","Save"):a("secrets.createBtn","Create")})]})})]})}):null]})};export{Me as SecretsView};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-xterm-BNq00GSj.js","assets/vendor-react-SZ_qB27O.js","assets/vendor-xterm-LZoznX6r.css","assets/addon-fit-C1WQXRvu.js","assets/addon-unicode11-BVmNDUBM.js","assets/addon-webgl-uLc0RKcC.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{J as ge,K as A,N as le,O as V,Q as ce,U as B,W as xe,Y as Ne,p as Re,_ as Pe,$ as J,a0 as je,a1 as Me,a as De,a2 as I,a3 as Le,a4 as Oe}from"./index-BqLVwYoA.js";import{r as i,j as t}from"./vendor-react-SZ_qB27O.js";import"./vendor-xterm-BNq00GSj.js";import{u as Ae}from"./vendor-i18n-GF3RlKbq.js";import{S as ze}from"./shield-alert-CZg8yaFA.js";import"./vendor-codemirror-jBKmHyH0.js";import"./vendor-reactflow-9C3XTE7_.js";const Fe=32*1024,Be=100,Ie="\x1B",Ke=" ",We="",$e="\x1B[A",Ue="\x1B[B",Qe="\x1B[C",Ve="\x1B[D",K={ctrl:"Ctrl",escape:"Esc",tab:"Tab",ctrlC:"^C"};function de(u){if(u.length!==1)return null;const o=u.toUpperCase().charCodeAt(0);return o>=64&&o<=95?String.fromCharCode(o&31):null}function Je(){const[u,f]=i.useState(()=>J());return i.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const o=window.matchMedia(je),a=window.visualViewport,y=()=>f(J());return y(),typeof a?.addEventListener=="function"&&a.addEventListener("resize",y),typeof o.addEventListener=="function"?(o.addEventListener("change",y),()=>{o.removeEventListener("change",y),typeof a?.removeEventListener=="function"&&a.removeEventListener("resize",y)}):(o.addListener(y),()=>{o.removeListener(y),typeof a?.removeEventListener=="function"&&a.removeEventListener("resize",y)})},[]),u}function Ye(u,f){if(typeof window>"u")return"";const a=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/cli-sessions/ws?sessionId=${encodeURIComponent(u)}&ticket=${encodeURIComponent(f)}`;return Oe(a)}function He(){return/Mac|iPhone|iPad|iPod/i.test(navigator.platform)}function Ge(u){if(typeof window<"u"&&typeof window.atob=="function"){const f=window.atob(u),o=new Uint8Array(f.length);for(let a=0;a<f.length;a++)o[a]=f.charCodeAt(a);return new TextDecoder("utf-8").decode(o)}return Buffer.from(u,"base64").toString("utf8")}function at({sessionId:u,readOnly:f=!1,posture:o,mode:a="live",projectId:y,onConfirmAdvance:E,showConfirmAdvance:W=!1,onOpenAdapterSettings:Y}){const{t:r}=Ae("app"),C=i.useRef(null),T=i.useRef(null),j=i.useRef(null),S=i.useRef(null),[H,G]=i.useState(!1),[ue,$]=i.useState(!1),[q,Z]=i.useState(!1),g=Je(),{keyboardOpen:z,keyboardOverlap:me}=ge({enabled:g}),fe=i.useRef(null),[_,X]=i.useState(""),[x,M]=i.useState(!1),[pe,ye]=i.useState(()=>A().customShortcuts),[ee,te]=i.useState(null),ne=f||ee===!0,D=!f&&ee===!1&&a==="live",b=i.useCallback(e=>{if(!e||!D)return;const n=S.current;n?.readyState===WebSocket.OPEN&&n.send(JSON.stringify({type:"input",data:e}))},[D]),N=i.useCallback(e=>{if(x){const n=de(e);if(M(!1),n){b(n);return}}b(e)},[x,b]),l=i.useCallback(e=>{e.preventDefault()},[]),be=i.useCallback(e=>{e?.preventDefault?.(),_&&b(_),b("\r"),X("")},[_,b]),he=i.useCallback(e=>{if(x&&e.length>_.length){const n=e.slice(_.length,_.length+1),d=de(n);if(M(!1),d){b(d);return}}X(e)},[x,_,b]);i.useEffect(()=>{W&&$(!1)},[W,u]);const L=i.useCallback((e,n)=>{const d=S.current;d?.readyState===WebSocket.OPEN&&d.send(JSON.stringify({type:"resize",cols:e,rows:n}))},[]),ie=i.useCallback(()=>{const e=T.current;if(!e)return;const n=A(),d=le(n.fontFamily);e.options.fontFamily=d,C.current?.style.setProperty("--terminal-glyph-font-family",V(n.fontFamily)),e.options.fontSize=n.fontSize,e.options.cursorStyle=n.cursorStyle,e.options.cursorBlink=n.cursorBlink&&D;try{j.current?.fit?.(),L(e.cols,e.rows)}catch{}ce(n.fontSize,d).then(R=>{if(!(!R||T.current!==e||e.options.fontSize!==n.fontSize||e.options.fontFamily!==d)){B(e,d),e.options.fontSize=n.fontSize;try{j.current?.fit?.(),L(e.cols,e.rows),B(e,d),e.refresh(0,Math.max(0,e.rows-1))}catch{}}},()=>{})},[D,L]);i.useEffect(()=>{if(typeof window>"u")return;const e=n=>{n.key===Me&&(ie(),ye(A().customShortcuts))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[ie]),i.useEffect(()=>{if(!u||typeof window>"u")return;let e=!1,n=null,d=null,R=0;te(null);const U=L,ke=p=>{if(R+=p,R<Fe)return;const h=S.current;h?.readyState===WebSocket.OPEN&&h.send(JSON.stringify({type:"ack",bytes:R})),R=0};return(async()=>{let p;try{p=await De(`/cli-sessions/${encodeURIComponent(u)}/attach-ticket`,{method:"POST",body:JSON.stringify(y?{projectId:y}:{})})}catch{return}if(e)return;te(p.readOnly);const h=!f&&!p.readOnly&&a==="live",[{Terminal:ve},{FitAddon:Ee},{Unicode11Addon:Ce}]=await Promise.all([I(()=>import("./vendor-xterm-BNq00GSj.js").then(c=>c.x),__vite__mapDeps([0,1,2])),I(()=>import("./addon-fit-C1WQXRvu.js").then(c=>c.a),__vite__mapDeps([3,1])),I(()=>import("./addon-unicode11-BVmNDUBM.js").then(c=>c.a),__vite__mapDeps([4,1]))]);if(e||!C.current)return;const w=A(),O=le(w.fontFamily);C.current.style.setProperty("--terminal-glyph-font-family",V(w.fontFamily));const s=new ve({convertEol:!1,cursorBlink:w.cursorBlink&&h,cursorStyle:w.cursorStyle,disableStdin:!h,scrollback:1e4,fontFamily:O,fontSize:w.fontSize}),P=new Ee;s.loadAddon(P);const Te=new Ce;if(s.loadAddon(Te),s.unicode.activeVersion="11",Le(()=>{s.open(C.current)}),T.current=s,j.current=P,w.renderer==="auto"&&!J())try{const{WebglAddon:c}=await I(async()=>{const{WebglAddon:m}=await import("./addon-webgl-uLc0RKcC.js").then(k=>k.a);return{WebglAddon:m}},__vite__mapDeps([5,1]));if(!e){const m=new c;m.onContextLoss(()=>{try{m.dispose()}catch{}}),s.loadAddon(m)}}catch{}try{P.fit()}catch{}(async()=>{if(!(!await ce(w.fontSize,O)||e||T.current!==s||j.current!==P||s.options.fontSize!==w.fontSize||s.options.fontFamily!==O))try{B(s,O),s.options.fontSize=w.fontSize,P.fit(),U(s.cols,s.rows),B(s,O),s.refresh(0,Math.max(0,s.rows-1))}catch{}})(),h&&(s.onData(c=>{const m=S.current;m?.readyState===WebSocket.OPEN&&m.send(JSON.stringify({type:"input",data:c}))}),s.attachCustomKeyEventHandler(c=>{if(c.type!=="keydown"||!(He()?c.metaKey:c.ctrlKey)||c.altKey||c.shiftKey)return!0;const k=c.key.toLowerCase();if(k==="c"){const v=s.hasSelection()?s.getSelection():"";return v?(navigator.clipboard?.writeText(v).catch(()=>{}),!1):!0}if(k==="v"){const v=navigator.clipboard?.readText;return v&&v.call(navigator.clipboard).then(ae=>{if(!ae)return;const re=S.current;re?.readyState===WebSocket.OPEN&&re.send(JSON.stringify({type:"input",data:ae}))}).catch(()=>{}),!1}return!0})),n=new ResizeObserver(()=>{d&&clearTimeout(d),d=setTimeout(()=>{try{P.fit(),U(s.cols,s.rows)}catch{}},Be)}),n.observe(C.current);const Q=new WebSocket(Ye(u,p.ticket));S.current=Q,Q.onopen=()=>{U(s.cols,s.rows)},Q.onmessage=c=>{let m;try{m=JSON.parse(typeof c.data=="string"?c.data:"")}catch{return}switch(m.type){case"scrollback":case"data":{if(typeof m.data!="string")return;const k=Ge(m.data),v=k.length;s.write(k,()=>ke(v));break}}}})(),()=>{e=!0,d&&clearTimeout(d),n&&n.disconnect();const p=S.current;if(p){p.onopen=null,p.onmessage=null,p.onclose=null,p.onerror=null;try{p.close()}catch{}S.current=null}const h=T.current;if(h){try{h.dispose()}catch{}T.current=null}j.current=null}},[u,f,a,y,L]);const se=i.useMemo(()=>a==="idle"?r("cliTerminal.replayIdle","Session idle"):a==="ended"?r("cliTerminal.replayEnded","Session ended"):null,[a,r]),we=i.useCallback(async()=>{if(E){Z(!0);try{await E("advance"),$(!0)}finally{Z(!1)}}},[E]),Se=i.useCallback(async()=>{E&&await E("not-yet"),$(!0)},[E]),F=!!o?.elevated,oe=o?.elevatedFlags?.join(", "),_e={"--terminal-glyph-font-family":V(A().fontFamily)};return t.jsxs("div",{className:`cli-session-terminal${g?" cli-session-terminal--mobile":""}${g&&z?" cli-session-terminal--keyboard-open":""}`,"data-mode":a,"data-read-only":ne,"data-mobile":g,"data-keyboard-open":g&&z,children:[t.jsxs("header",{className:"cli-session-terminal__header",children:[o&&t.jsxs("div",{className:"cli-session-terminal__posture-wrap",children:[t.jsxs("button",{type:"button",className:`cli-posture-chip${F?" cli-posture-chip--elevated":""}`,"data-elevated":F,"aria-expanded":H,onClick:()=>G(e=>!e),children:[F?t.jsx(ze,{size:13,"aria-hidden":"true"}):t.jsx(xe,{size:13,"aria-hidden":"true"}),t.jsx("span",{className:"cli-posture-chip__name",children:o.adapterName}),o.mode&&t.jsx("span",{className:"cli-posture-chip__mode",children:o.mode}),F&&oe&&t.jsx("span",{className:"cli-posture-chip__flag",children:oe})]}),H&&t.jsxs("div",{className:"cli-posture-tooltip",role:"tooltip",children:[t.jsx("p",{className:"cli-posture-tooltip__title",children:r("cliTerminal.postureResolved","Resolved posture")}),t.jsxs("ul",{className:"cli-posture-tooltip__list",children:[(o.resolved??[]).map((e,n)=>t.jsx("li",{children:e},n)),(o.resolved??[]).length===0&&t.jsx("li",{children:o.mode??r("cliTerminal.postureBaseline","Baseline")})]}),Y&&t.jsxs("button",{type:"button",className:"cli-posture-tooltip__settings",onClick:()=>{G(!1),Y()},children:[t.jsx(Ne,{size:12,"aria-hidden":"true"}),r("cliTerminal.adapterSettings","Adapter settings")]})]})]}),ne&&t.jsxs("span",{className:"cli-session-terminal__readonly-badge",children:[t.jsx(Re,{size:12,"aria-hidden":"true"}),r("cliTerminal.readOnly","Read-only")]}),se&&t.jsx("span",{className:"cli-session-terminal__replay-badge","data-replay-mode":a,children:se})]}),t.jsx("div",{className:"cli-session-terminal__viewport",ref:C,"data-testid":"cli-terminal-viewport",style:_e}),W&&!ue&&t.jsxs("div",{className:"cli-session-terminal__advance-strip",role:"region",children:[t.jsx("span",{className:"cli-session-terminal__advance-copy",children:r("cliTerminal.advancePrompt","This session looks idle — advance to review?")}),t.jsxs("div",{className:"cli-session-terminal__advance-actions",children:[t.jsx("button",{type:"button",className:"cli-session-terminal__advance-btn",disabled:q,onClick:we,children:r("cliTerminal.advance","Advance")}),t.jsx("button",{type:"button",className:"cli-session-terminal__advance-btn cli-session-terminal__advance-btn--secondary",disabled:q,onClick:Se,children:r("cliTerminal.notYet","Not yet")})]})]}),g&&D&&t.jsxs("div",{className:`cli-session-terminal__mobile-bar${z?" cli-session-terminal__mobile-bar--keyboard-open":""}`,"data-testid":"cli-terminal-mobile-bar",style:z?{bottom:`${me}px`}:void 0,children:[t.jsxs("div",{className:"cli-session-terminal__key-row","data-testid":"cli-terminal-key-bar",children:[t.jsx("button",{type:"button",className:`cli-terminal-key cli-terminal-key--ctrl${x?" cli-terminal-key--active":""}`,"data-testid":"cli-key-ctrl","aria-label":r("cliTerminal.mobileKeyCtrl","Sticky Ctrl modifier"),"aria-pressed":x,onPointerDown:l,onMouseDown:l,onClick:()=>M(e=>!e),children:K.ctrl}),t.jsx("button",{type:"button",className:"cli-terminal-key","data-testid":"cli-key-esc","aria-label":r("cliTerminal.mobileKeyEsc","Send Escape"),onPointerDown:l,onMouseDown:l,onClick:()=>N(Ie),children:K.escape}),t.jsx("button",{type:"button",className:"cli-terminal-key","data-testid":"cli-key-tab","aria-label":r("cliTerminal.mobileKeyTab","Send Tab"),onPointerDown:l,onMouseDown:l,onClick:()=>N(Ke),children:K.tab}),t.jsx("button",{type:"button",className:"cli-terminal-key cli-terminal-key--ctrlc","data-testid":"cli-key-ctrl-c","aria-label":r("cliTerminal.mobileKeyCtrlC","Send Ctrl-C"),onPointerDown:l,onMouseDown:l,onClick:()=>{M(!1),b(We)},children:K.ctrlC}),t.jsx("button",{type:"button",className:"cli-terminal-key","data-testid":"cli-key-arrow-up","aria-label":r("cliTerminal.mobileKeyArrowUp","Cursor up"),onPointerDown:l,onMouseDown:l,onClick:()=>N($e),children:"↑"}),t.jsx("button",{type:"button",className:"cli-terminal-key","data-testid":"cli-key-arrow-down","aria-label":r("cliTerminal.mobileKeyArrowDown","Cursor down"),onPointerDown:l,onMouseDown:l,onClick:()=>N(Ue),children:"↓"}),t.jsx("button",{type:"button",className:"cli-terminal-key","data-testid":"cli-key-arrow-left","aria-label":r("cliTerminal.mobileKeyArrowLeft","Cursor left"),onPointerDown:l,onMouseDown:l,onClick:()=>N(Ve),children:"←"}),t.jsx("button",{type:"button",className:"cli-terminal-key","data-testid":"cli-key-arrow-right","aria-label":r("cliTerminal.mobileKeyArrowRight","Cursor right"),onPointerDown:l,onMouseDown:l,onClick:()=>N(Qe),children:"→"}),pe.map(e=>t.jsx("button",{type:"button",className:"cli-terminal-key cli-terminal-key--custom","data-testid":`cli-terminal-custom-shortcut-${e.id}`,title:e.label,"aria-label":e.label,onPointerDown:l,onMouseDown:l,onClick:()=>{M(!1),b(Pe(e.value))},children:e.label},e.id))]}),t.jsxs("form",{className:"cli-session-terminal__input-row",onSubmit:be,children:[t.jsx("input",{ref:fe,type:"text",className:"cli-session-terminal__mobile-input","data-testid":"cli-terminal-mobile-input",value:_,placeholder:r("cliTerminal.mobileInputPlaceholder","Type to send to the session…"),autoCapitalize:"off",autoCorrect:"off",autoComplete:"off",spellCheck:!1,onChange:e=>he(e.target.value)}),t.jsx("button",{type:"submit",className:"cli-session-terminal__mobile-send","data-testid":"cli-terminal-mobile-send","aria-label":r("cliTerminal.mobileSend","Send"),onPointerDown:l,onMouseDown:l,children:r("cliTerminal.mobileSend","Send")})]})]})]})}export{at as SessionTerminal};
|