cc-viewer 1.6.169 → 1.6.171
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/App-BEYoCvS0.js +31 -0
- package/dist/assets/{AppHeader-qxiNe89i.css → AppHeader-D7m82gfn.css} +2 -2
- package/dist/assets/AppHeader.module-BNyq4zHW.js +573 -0
- package/dist/assets/Mobile-CB7JANox.js +10 -0
- package/dist/assets/{_baseUniq-43cnlw-r.js → _baseUniq-C213LPlJ.js} +1 -1
- package/dist/assets/{arc-BUFs6PQm.js → arc-DM0D4vGT.js} +1 -1
- package/dist/assets/architectureDiagram-Q4EWVU46-D8J5viCz.js +36 -0
- package/dist/assets/{blockDiagram-DXYQGD6D-DSbymKNU.js → blockDiagram-DXYQGD6D-D_ss0ify.js} +2 -2
- package/dist/assets/{c4Diagram-AHTNJAMY-DMeT4sOi.js → c4Diagram-AHTNJAMY-CmWlESsH.js} +2 -2
- package/dist/assets/channel-CWWDgQRU.js +1 -0
- package/dist/assets/{chunk-4BX2VUAB-BFxgafgd.js → chunk-4BX2VUAB-BE8zBWui.js} +1 -1
- package/dist/assets/{chunk-4TB4RGXK-iBjZne-i.js → chunk-4TB4RGXK-CWnASVVW.js} +1 -1
- package/dist/assets/{chunk-55IACEB6-BHoL99Rv.js → chunk-55IACEB6-BgrAK2uA.js} +1 -1
- package/dist/assets/{chunk-EDXVE4YY-BleRGeR6.js → chunk-EDXVE4YY-CmNo7ibL.js} +1 -1
- package/dist/assets/{chunk-FMBD7UC4-xfDsv2e3.js → chunk-FMBD7UC4-OkdISzNi.js} +1 -1
- package/dist/assets/{chunk-OYMX7WX6-Bd0Q_7rX.js → chunk-OYMX7WX6-CRI_hPtX.js} +1 -1
- package/dist/assets/{chunk-QZHKN3VN-CAsA3yuO.js → chunk-QZHKN3VN-DF_tSrR8.js} +1 -1
- package/dist/assets/{chunk-YZCP3GAM-koDLBRDb.js → chunk-YZCP3GAM-05zrGbdc.js} +1 -1
- package/dist/assets/classDiagram-6PBFFD2Q-6YceXGez.js +1 -0
- package/dist/assets/classDiagram-v2-HSJHXN6E-6YceXGez.js +1 -0
- package/dist/assets/clone-C70QC9Qa.js +1 -0
- package/dist/assets/cose-bilkent-S5V4N54A-DA2Ymd0J.js +1 -0
- package/dist/assets/dagre-KV5264BT-B0-PMbli.js +4 -0
- package/dist/assets/diagram-5BDNPKRD-DnKRUKgI.js +10 -0
- package/dist/assets/diagram-G4DWMVQ6-aAK_FciM.js +24 -0
- package/dist/assets/diagram-MMDJMWI5-BEbNYqtc.js +43 -0
- package/dist/assets/diagram-TYMM5635-8wHLGefP.js +24 -0
- package/dist/assets/{erDiagram-SMLLAGMA-Dbl3_DA5.js → erDiagram-SMLLAGMA-BGSM6I8R.js} +2 -2
- package/dist/assets/{flowDiagram-DWJPFMVM-uZ6AjhW3.js → flowDiagram-DWJPFMVM-DO80OCTv.js} +2 -2
- package/dist/assets/ganttDiagram-T4ZO3ILL-SfUOQIOW.js +292 -0
- package/dist/assets/gitGraphDiagram-UUTBAWPF-CRGPN7R5.js +106 -0
- package/dist/assets/{graph-DMOJ-VX2.js → graph-BNBKHWbp.js} +1 -1
- package/dist/assets/index-BRCnNA0x.js +2 -0
- package/dist/assets/index-D7bDh8fW.css +1 -0
- package/dist/assets/infoDiagram-42DDH7IO-BUFS7TPQ.js +2 -0
- package/dist/assets/{ishikawaDiagram-UXIWVN3A-CA3nFN3p.js → ishikawaDiagram-UXIWVN3A-Ca5q0aB6.js} +6 -6
- package/dist/assets/{journeyDiagram-VCZTEJTY-d9xsZ8Yd.js → journeyDiagram-VCZTEJTY-BupuDikn.js} +2 -2
- package/dist/assets/{kanban-definition-6JOO6SKY-D3bsT_7v.js → kanban-definition-6JOO6SKY-CJb8DWc_.js} +2 -2
- package/dist/assets/{layout-DuO7IWHx.js → layout-D59JNWn3.js} +1 -1
- package/dist/assets/{linear-B928iyZ_.js → linear-9VMGGXoX.js} +1 -1
- package/dist/assets/mermaid.core-2zDJvS_T.js +308 -0
- package/dist/assets/{min-CgMHjcOo.js → min-O_KCOMu4.js} +1 -1
- package/dist/assets/{mindmap-definition-QFDTVHPH-BkMM9jUI.js → mindmap-definition-QFDTVHPH-D2oW4iJa.js} +2 -2
- package/dist/assets/{pieDiagram-DEJITSTG-HgCMufe4.js → pieDiagram-DEJITSTG-CTUEN1SO.js} +2 -2
- package/dist/assets/{quadrantDiagram-34T5L4WZ-Ced0pZFH.js → quadrantDiagram-34T5L4WZ-CwYGM3Fe.js} +4 -4
- package/dist/assets/{requirementDiagram-MS252O5E-BnPPJ2sr.js → requirementDiagram-MS252O5E-BsK3qBEL.js} +4 -4
- package/dist/assets/sankeyDiagram-XADWPNL6-odSMnxNt.js +10 -0
- package/dist/assets/{sequenceDiagram-FGHM5R23-yrmTmDlx.js → sequenceDiagram-FGHM5R23-B53RIBSv.js} +2 -2
- package/dist/assets/stateDiagram-FHFEXIEX-6EGcYCKt.js +1 -0
- package/dist/assets/stateDiagram-v2-QKLJ7IA2-DiVUQYLU.js +1 -0
- package/dist/assets/{timeline-definition-GMOUNBTQ-CA-9LnCz.js → timeline-definition-GMOUNBTQ-DT-8z-R8.js} +2 -2
- package/dist/assets/vendor-antd--lnyToqQ.js +406 -0
- package/dist/assets/vendor-codemirror-C7imH6Hd.js +46 -0
- package/dist/assets/vendor-highlight-D4ATuRwX.js +3 -0
- package/dist/assets/vendor-markdown-CO-jRjTB.js +60 -0
- package/dist/assets/vendor-qrcode-myYunK0Z.js +9 -0
- package/dist/assets/vendor-react-l0sNRNKZ.js +1 -0
- package/dist/assets/vendor-virtuoso-DDKvHLUv.js +1 -0
- package/dist/assets/vendor-xterm-DWMOrwSy.js +140 -0
- package/dist/assets/{vennDiagram-DHZGUBPP-kjEHn01W.js → vennDiagram-DHZGUBPP-BA1yMPV8.js} +2 -2
- package/dist/assets/{wardley-RL74JXVD-DBS4ToLP.js → wardley-RL74JXVD-Bs4oXbq-.js} +3 -3
- package/dist/assets/{wardleyDiagram-NUSXRM2D-BpgxZLmX.js → wardleyDiagram-NUSXRM2D-BqWLeeVe.js} +2 -2
- package/dist/assets/{xychartDiagram-5P7HB3ND-D2SogsgK.js → xychartDiagram-5P7HB3ND-CEK8P1Rp.js} +2 -2
- package/dist/index.html +4 -2
- package/package.json +1 -1
- package/dist/assets/App-CeymbgbA.js +0 -41
- package/dist/assets/AppHeader.module-DPnQHzzR.js +0 -1178
- package/dist/assets/Mobile-DjnTG4qC.js +0 -10
- package/dist/assets/architectureDiagram-Q4EWVU46-CEqjU2Yr.js +0 -36
- package/dist/assets/channel-Ccy-P4LS.js +0 -1
- package/dist/assets/classDiagram-6PBFFD2Q-DIxbiWjL.js +0 -1
- package/dist/assets/classDiagram-v2-HSJHXN6E-DIxbiWjL.js +0 -1
- package/dist/assets/clone-DdX7TiWD.js +0 -1
- package/dist/assets/cose-bilkent-S5V4N54A-DZf1mwhN.js +0 -1
- package/dist/assets/dagre-KV5264BT-CoyMLIR8.js +0 -4
- package/dist/assets/diagram-5BDNPKRD-Djsx8Om-.js +0 -10
- package/dist/assets/diagram-G4DWMVQ6-IR3Z9SIW.js +0 -24
- package/dist/assets/diagram-MMDJMWI5-TUdlJKCs.js +0 -43
- package/dist/assets/diagram-TYMM5635-dE6LLI4N.js +0 -24
- package/dist/assets/ganttDiagram-T4ZO3ILL-VWPHYnwK.js +0 -292
- package/dist/assets/gitGraphDiagram-UUTBAWPF-DKRLN0f1.js +0 -106
- package/dist/assets/index-CIrnsaQS.js +0 -41
- package/dist/assets/index-D4OUrcvS.css +0 -1
- package/dist/assets/infoDiagram-42DDH7IO-nvzkBgvn.js +0 -2
- package/dist/assets/mermaid.core-CcE8BsIy.js +0 -308
- package/dist/assets/sankeyDiagram-XADWPNL6-d_U14FxJ.js +0 -10
- package/dist/assets/stateDiagram-FHFEXIEX-z6ITJtUk.js +0 -1
- package/dist/assets/stateDiagram-v2-QKLJ7IA2-vbgNYNft.js +0 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
var wt=Object.defineProperty;var Mt=(c,a,t)=>a in c?wt(c,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):c[a]=t;var M=(c,a,t)=>Mt(c,typeof a!="symbol"?a+"":a,t);import{j as e}from"./vendor-codemirror-C7imH6Hd.js";import{a as N,I as ee,b as te,R as ge,o as me,s as H,i as le,P as ue,p as Lt,M as X,S as pt,q as Ze,t as pe,D as Rt,T as Y,d as E,h as ae,u as ie,v as Ce,j as It,w as gt,x as Ee,y as _e,e as He,z as et,f as Pe,F as Et,A as Bt,E as Dt,G as At,H as re,L as tt,J as xt,K as ft,N as ce,O as de,C as Ft,Q as Be,U as Ht,V as Pt}from"./vendor-antd--lnyToqQ.js";import{a as K,t as l,l as fe,m as qt,n as Z,d as zt,e as $t,g as Vt,s,k as F,C as V,w as jt,h as Ot,x as Ut,j as je,p as st,y as Wt,z as Kt,O as yt,B as Jt,D as at,E as vt,G as nt,H as De,J as it,K as lt,L as Gt,M as Qt,A as Xt,N as be,P as ot,u as Yt,o as k,R as rt,r as Zt}from"./AppHeader.module-BNyq4zHW.js";import{s as es,b as ts}from"./index-BRCnNA0x.js";import{Q as ss}from"./vendor-qrcode-myYunK0Z.js";import"./vendor-markdown-CO-jRjTB.js";import"./vendor-xterm-DWMOrwSy.js";import"./vendor-highlight-D4ATuRwX.js";import"./vendor-virtuoso-DDKvHLUv.js";var as={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M917.7 148.8l-42.4-42.4c-1.6-1.6-3.6-2.3-5.7-2.3s-4.1.8-5.7 2.3l-76.1 76.1a199.27 199.27 0 00-112.1-34.3c-51.2 0-102.4 19.5-141.5 58.6L432.3 308.7a8.03 8.03 0 000 11.3L704 591.7c1.6 1.6 3.6 2.3 5.7 2.3 2 0 4.1-.8 5.7-2.3l101.9-101.9c68.9-69 77-175.7 24.3-253.5l76.1-76.1c3.1-3.2 3.1-8.3 0-11.4zM769.1 441.7l-59.4 59.4-186.8-186.8 59.4-59.4c24.9-24.9 58.1-38.7 93.4-38.7 35.3 0 68.4 13.7 93.4 38.7 24.9 24.9 38.7 58.1 38.7 93.4 0 35.3-13.8 68.4-38.7 93.4zm-190.2 105a8.03 8.03 0 00-11.3 0L501 613.3 410.7 523l66.7-66.7c3.1-3.1 3.1-8.2 0-11.3L441 408.6a8.03 8.03 0 00-11.3 0L363 475.3l-43-43a7.85 7.85 0 00-5.7-2.3c-2 0-4.1.8-5.7 2.3L206.8 534.2c-68.9 69-77 175.7-24.3 253.5l-76.1 76.1a8.03 8.03 0 000 11.3l42.4 42.4c1.6 1.6 3.6 2.3 5.7 2.3s4.1-.8 5.7-2.3l76.1-76.1c33.7 22.9 72.9 34.3 112.1 34.3 51.2 0 102.4-19.5 141.5-58.6l101.9-101.9c3.1-3.1 3.1-8.2 0-11.3l-43-43 66.7-66.7c3.1-3.1 3.1-8.2 0-11.3l-36.6-36.2zM441.7 769.1a131.32 131.32 0 01-93.4 38.7c-35.3 0-68.4-13.7-93.4-38.7a131.32 131.32 0 01-38.7-93.4c0-35.3 13.7-68.4 38.7-93.4l59.4-59.4 186.8 186.8-59.4 59.4z"}}]},name:"api",theme:"outlined"},ns=function(a,t){return N.createElement(ee,te({},a,{ref:t,icon:as}))},ct=N.forwardRef(ns),is={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M888 792H200V168c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v688c0 4.4 3.6 8 8 8h752c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm-600-80h56c4.4 0 8-3.6 8-8V560c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v144c0 4.4 3.6 8 8 8zm152 0h56c4.4 0 8-3.6 8-8V384c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v320c0 4.4 3.6 8 8 8zm152 0h56c4.4 0 8-3.6 8-8V462c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v242c0 4.4 3.6 8 8 8zm152 0h56c4.4 0 8-3.6 8-8V304c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v400c0 4.4 3.6 8 8 8z"}}]},name:"bar-chart",theme:"outlined"},ls=function(a,t){return N.createElement(ee,te({},a,{ref:t,icon:is}))},dt=N.forwardRef(ls),os={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M624 706.3h-74.1V464c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v242.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.7a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9z"}},{tag:"path",attrs:{d:"M811.4 366.7C765.6 245.9 648.9 160 512.2 160S258.8 245.8 213 366.6C127.3 389.1 64 467.2 64 560c0 110.5 89.5 200 199.9 200H304c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8h-40.1c-33.7 0-65.4-13.4-89-37.7-23.5-24.2-36-56.8-34.9-90.6.9-26.4 9.9-51.2 26.2-72.1 16.7-21.3 40.1-36.8 66.1-43.7l37.9-9.9 13.9-36.6c8.6-22.8 20.6-44.1 35.7-63.4a245.6 245.6 0 0152.4-49.9c41.1-28.9 89.5-44.2 140-44.2s98.9 15.3 140 44.2c19.9 14 37.5 30.8 52.4 49.9 15.1 19.3 27.1 40.7 35.7 63.4l13.8 36.5 37.8 10C846.1 454.5 884 503.8 884 560c0 33.1-12.9 64.3-36.3 87.7a123.07 123.07 0 01-87.6 36.3H720c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h40.1C870.5 760 960 670.5 960 560c0-92.7-63.1-170.7-148.6-193.3z"}}]},name:"cloud-download",theme:"outlined"},rs=function(a,t){return N.createElement(ee,te({},a,{ref:t,icon:os}))},ht=N.forwardRef(rs),cs={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M516 673c0 4.4 3.4 8 7.5 8h185c4.1 0 7.5-3.6 7.5-8v-48c0-4.4-3.4-8-7.5-8h-185c-4.1 0-7.5 3.6-7.5 8v48zm-194.9 6.1l192-161c3.8-3.2 3.8-9.1 0-12.3l-192-160.9A7.95 7.95 0 00308 351v62.7c0 2.4 1 4.6 2.9 6.1L420.7 512l-109.8 92.2a8.1 8.1 0 00-2.9 6.1V673c0 6.8 7.9 10.5 13.1 6.1zM880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"code",theme:"outlined"},ds=function(a,t){return N.createElement(ee,te({},a,{ref:t,icon:cs}))},Ne=N.forwardRef(ds),hs={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M924.8 385.6a446.7 446.7 0 00-96-142.4 446.7 446.7 0 00-142.4-96C631.1 123.8 572.5 112 512 112s-119.1 11.8-174.4 35.2a446.7 446.7 0 00-142.4 96 446.7 446.7 0 00-96 142.4C75.8 440.9 64 499.5 64 560c0 132.7 58.3 257.7 159.9 343.1l1.7 1.4c5.8 4.8 13.1 7.5 20.6 7.5h531.7c7.5 0 14.8-2.7 20.6-7.5l1.7-1.4C901.7 817.7 960 692.7 960 560c0-60.5-11.9-119.1-35.2-174.4zM761.4 836H262.6A371.12 371.12 0 01140 560c0-99.4 38.7-192.8 109-263 70.3-70.3 163.7-109 263-109 99.4 0 192.8 38.7 263 109 70.3 70.3 109 163.7 109 263 0 105.6-44.5 205.5-122.6 276zM623.5 421.5a8.03 8.03 0 00-11.3 0L527.7 506c-18.7-5-39.4-.2-54.1 14.5a55.95 55.95 0 000 79.2 55.95 55.95 0 0079.2 0 55.87 55.87 0 0014.5-54.1l84.5-84.5c3.1-3.1 3.1-8.2 0-11.3l-28.3-28.3zM490 320h44c4.4 0 8-3.6 8-8v-80c0-4.4-3.6-8-8-8h-44c-4.4 0-8 3.6-8 8v80c0 4.4 3.6 8 8 8zm260 218v44c0 4.4 3.6 8 8 8h80c4.4 0 8-3.6 8-8v-44c0-4.4-3.6-8-8-8h-80c-4.4 0-8 3.6-8 8zm12.7-197.2l-31.1-31.1a8.03 8.03 0 00-11.3 0l-56.6 56.6a8.03 8.03 0 000 11.3l31.1 31.1c3.1 3.1 8.2 3.1 11.3 0l56.6-56.6c3.1-3.1 3.1-8.2 0-11.3zm-458.6-31.1a8.03 8.03 0 00-11.3 0l-31.1 31.1a8.03 8.03 0 000 11.3l56.6 56.6c3.1 3.1 8.2 3.1 11.3 0l31.1-31.1c3.1-3.1 3.1-8.2 0-11.3l-56.6-56.6zM262 530h-80c-4.4 0-8 3.6-8 8v44c0 4.4 3.6 8 8 8h80c4.4 0 8-3.6 8-8v-44c0-4.4-3.6-8-8-8z"}}]},name:"dashboard",theme:"outlined"},us=function(a,t){return N.createElement(ee,te({},a,{ref:t,icon:hs}))},Ae=N.forwardRef(us),ms={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM770.87 199.13l-52.2-52.2a8.01 8.01 0 014.7-13.6l179.4-21c5.1-.6 9.5 3.7 8.9 8.9l-21 179.4c-.8 6.6-8.9 9.4-13.6 4.7l-52.4-52.4-256.2 256.2a8.03 8.03 0 01-11.3 0l-42.4-42.4a8.03 8.03 0 010-11.3l256.1-256.3z"}}]},name:"export",theme:"outlined"},ps=function(a,t){return N.createElement(ee,te({},a,{ref:t,icon:ms}))},gs=N.forwardRef(ps),xs={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM653.3 424.6l52.2 52.2a8.01 8.01 0 01-4.7 13.6l-179.4 21c-5.1.6-9.5-3.7-8.9-8.9l21-179.4c.8-6.6 8.9-9.4 13.6-4.7l52.4 52.4 256.2-256.2c3.1-3.1 8.2-3.1 11.3 0l42.4 42.4c3.1 3.1 3.1 8.2 0 11.3L653.3 424.6z"}}]},name:"import",theme:"outlined"},fs=function(a,t){return N.createElement(ee,te({},a,{ref:t,icon:xs}))},ut=N.forwardRef(fs),js={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M464 512a48 48 0 1096 0 48 48 0 10-96 0zm200 0a48 48 0 1096 0 48 48 0 10-96 0zm-400 0a48 48 0 1096 0 48 48 0 10-96 0zm661.2-173.6c-22.6-53.7-55-101.9-96.3-143.3a444.35 444.35 0 00-143.3-96.3C630.6 75.7 572.2 64 512 64h-2c-60.6.3-119.3 12.3-174.5 35.9a445.35 445.35 0 00-142 96.5c-40.9 41.3-73 89.3-95.2 142.8-23 55.4-34.6 114.3-34.3 174.9A449.4 449.4 0 00112 714v152a46 46 0 0046 46h152.1A449.4 449.4 0 00510 960h2.1c59.9 0 118-11.6 172.7-34.3a444.48 444.48 0 00142.8-95.2c41.3-40.9 73.8-88.7 96.5-142 23.6-55.2 35.6-113.9 35.9-174.5.3-60.9-11.5-120-34.8-175.6zm-151.1 438C704 845.8 611 884 512 884h-1.7c-60.3-.3-120.2-15.3-173.1-43.5l-8.4-4.5H188V695.2l-4.5-8.4C155.3 633.9 140.3 574 140 513.7c-.4-99.7 37.7-193.3 107.6-263.8 69.8-70.5 163.1-109.5 262.8-109.9h1.7c50 0 98.5 9.7 144.2 28.9 44.6 18.7 84.6 45.6 119 80 34.3 34.3 61.3 74.4 80 119 19.4 46.2 29.1 95.2 28.9 145.8-.6 99.6-39.7 192.9-110.1 262.7z"}}]},name:"message",theme:"outlined"},ys=function(a,t){return N.createElement(ee,te({},a,{ref:t,icon:js}))},vs=N.forwardRef(ys),_s={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56a32.03 32.03 0 009.3-35.2l-.9-2.6a443.74 443.74 0 00-79.7-137.9l-1.8-2.1a32.12 32.12 0 00-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85a32.05 32.05 0 00-25.8-25.7l-2.7-.5c-52.1-9.4-106.9-9.4-159 0l-2.7.5a32.05 32.05 0 00-25.8 25.7l-15.8 85.4a351.86 351.86 0 00-99 57.4l-81.9-29.1a32 32 0 00-35.1 9.5l-1.8 2.1a446.02 446.02 0 00-79.7 137.9l-.9 2.6c-4.5 12.5-.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1 0 19.2 1.5 38.4 4.6 57.1L99 625.5a32.03 32.03 0 00-9.3 35.2l.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1a32.12 32.12 0 0035.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4a32.05 32.05 0 0025.8 25.7l2.7.5a449.4 449.4 0 00159 0l2.7-.5a32.05 32.05 0 0025.8-25.7l15.7-85a350 350 0 0099.7-57.6l81.3 28.9a32 32 0 0035.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l.9-2.6c4.5-12.3.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1 74.7 63.9a370.03 370.03 0 01-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3-17.9 97a377.5 377.5 0 01-85 0l-17.9-97.2-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5 0-15.3 1.2-30.6 3.7-45.5l6.5-40-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2 31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3 17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97 38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8 92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9zM512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 01512 614c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 01400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8A111.6 111.6 0 01624 502c0 29.9-11.7 58-32.8 79.2z"}}]},name:"setting",theme:"outlined"},bs=function(a,t){return N.createElement(ee,te({},a,{ref:t,icon:_s}))},mt=N.forwardRef(bs);const Cs=[{label:"Auto",value:"auto"},{label:"Opus 4.6 (1M)",value:"opus-4.6-1m",tokens:1e6},{label:"Sonnet 4.6",value:"sonnet-4.6",tokens:2e5},{label:"GLM5",value:"glm5",tokens:2e5},{label:"Kimi K2.5",value:"kimi-k2.5",tokens:2e5},{label:"MiniMax 2.1",value:"minimax-2.1",tokens:2e5},{label:"Qwen 3.5",value:"Qwen 3.5",tokens:2e5}],Ns={calibrationModels:Cs},Fe=Ns.calibrationModels,Ss=[{value:"zh",short:"zh",label:"简体中文"},{value:"en",short:"en",label:"English"},{value:"zh-TW",short:"zh-TW",label:"繁體中文"},{value:"ko",short:"ko",label:"한국어"},{value:"ja",short:"ja",label:"日本語"},{value:"de",short:"de",label:"Deutsch"},{value:"es",short:"es",label:"Español"},{value:"fr",short:"fr",label:"Français"},{value:"it",short:"it",label:"Italiano"},{value:"da",short:"da",label:"Dansk"},{value:"pl",short:"pl",label:"Polski"},{value:"ru",short:"ru",label:"Русский"},{value:"ar",short:"ar",label:"العربية"},{value:"no",short:"no",label:"Norsk"},{value:"pt-BR",short:"pt-BR",label:"Português (Brasil)"},{value:"th",short:"th",label:"ไทย"},{value:"tr",short:"tr",label:"Türkçe"},{value:"uk",short:"uk",label:"Українська"}],ks=c=>{const a=t=>t.toUpperCase().split("").map(i=>String.fromCodePoint(127462+i.charCodeAt(0)-65)).join("");return!c||c.length!==2?a("CN"):a(c)},oe=class oe extends ge.Component{constructor(t){super(t);M(this,"handleShowPrompts",()=>{this.setState({promptModalVisible:!0,promptData:this.extractUserPrompts()})});M(this,"handleExportPromptsTxt",()=>{const t=this.state.promptData;if(!t||t.length===0)return;const i=[];for(const m of t){const u=[],g=m.timestamp?new Date(m.timestamp).toLocaleString():"";g&&u.push(`${g}:
|
|
2
|
+
`);const h=(m.segments||[]).filter(d=>d.type==="text").map(d=>d.content);h.length>0&&u.push(h.join(`
|
|
3
|
+
`)),i.push(u.join(`
|
|
4
|
+
`))}if(i.length===0)return;const o=new Blob([i.join(`
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
`)],{type:"text/plain;charset=utf-8"}),n=URL.createObjectURL(o),r=document.createElement("a");r.href=n,r.download=`user-prompts-${new Date().toISOString().slice(0,10)}.txt`,r.click(),URL.revokeObjectURL(n)});M(this,"handleCalibrationModelChange",t=>{this.setState({calibrationModel:t}),localStorage.setItem("ccv_calibrationModel",t)});M(this,"handleShowProjectStats",()=>{this.setState({projectStatsVisible:!0,projectStatsLoading:!0}),fetch(K("/api/project-stats")).then(t=>{if(!t.ok)throw new Error("not found");return t.json()}).then(t=>this.setState({projectStats:t,projectStatsLoading:!1})).catch(()=>this.setState({projectStats:null,projectStatsLoading:!1}))});M(this,"fetchPlugins",()=>fetch(K("/api/plugins")).then(t=>{if(!t.ok)throw new Error(t.status);return t.json()}).then(t=>{this.setState({pluginsList:t.plugins||[],pluginsDir:t.pluginsDir||""})}).catch(()=>{}));M(this,"handleShowPlugins",()=>{this.setState({pluginModalVisible:!0}),this.fetchPlugins()});M(this,"handleTogglePlugin",(t,i)=>{fetch(K("/api/preferences")).then(o=>o.json()).then(o=>{let n=Array.isArray(o.disabledPlugins)?[...o.disabledPlugins]:[];return i?n=n.filter(r=>r!==t):n.includes(t)||n.push(t),fetch(K("/api/preferences"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({disabledPlugins:n})})}).then(()=>fetch(K("/api/plugins/reload"),{method:"POST"})).then(o=>{if(!o.ok)throw new Error(o.status);return o.json()}).then(o=>{this.setState({pluginsList:o.plugins||[],pluginsDir:o.pluginsDir||""})}).catch(()=>{})});M(this,"handleDeletePlugin",(t,i)=>{this.setState({deleteConfirmVisible:!0,deleteTarget:{file:t,name:i}})});M(this,"handleDeletePluginConfirm",()=>{const{file:t}=this.state.deleteTarget||{};t&&(this.setState({deleteConfirmVisible:!1,deleteTarget:null}),fetch(K(`/api/plugins?file=${encodeURIComponent(t)}`),{method:"DELETE"}).then(i=>{if(!i.ok)throw new Error(i.status);return i.json()}).then(i=>{i.plugins&&this.setState({pluginsList:i.plugins,pluginsDir:i.pluginsDir||""})}).catch(()=>{}))});M(this,"handleReloadPlugins",()=>{fetch(K("/api/plugins/reload"),{method:"POST"}).then(t=>{if(!t.ok)throw new Error(t.status);return t.json()}).then(t=>{this.setState({pluginsList:t.plugins||[],pluginsDir:t.pluginsDir||""})}).catch(()=>{})});M(this,"handleAddPlugin",()=>{const t=document.createElement("input");t.type="file",t.accept=".js,.mjs",t.multiple=!0,t.onchange=()=>{const i=t.files;if(!i||i.length===0)return;for(const n of i)if(!n.name.endsWith(".js")&&!n.name.endsWith(".mjs")){H.error(l("ui.plugins.invalidFile"));return}const o=Array.from(i).map(n=>new Promise((r,m)=>{const u=new FileReader;u.onload=()=>r({name:n.name,content:u.result}),u.onerror=()=>m(new Error(`Failed to read ${n.name}`)),u.readAsText(n)}));Promise.all(o).then(n=>fetch(K("/api/plugins/upload"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:n})})).then(n=>n.ok?n.json():n.text().then(r=>{try{return JSON.parse(r)}catch{throw new Error(l("ui.plugins.serverError",{status:n.status}))}})).then(n=>{n.error?H.error(l("ui.plugins.addFailed",{reason:n.error})):n.plugins&&(this.setState({pluginsList:n.plugins,pluginsDir:n.pluginsDir||""}),H.success(l("ui.plugins.addSuccess")))}).catch(n=>{H.error(n.message)})},t.click()});M(this,"handleShowCdnModal",()=>{this.setState({cdnModalVisible:!0,cdnUrl:"",cdnLoading:!1})});M(this,"handleCdnUrlChange",t=>{this.setState({cdnUrl:t.target.value})});M(this,"handleCdnInstall",()=>{const{cdnUrl:t}=this.state;if(!t.trim()){H.error(l("ui.plugins.cdnUrlRequired"));return}try{new URL(t)}catch{H.error(l("ui.plugins.cdnInvalidUrl"));return}this.setState({cdnLoading:!0}),fetch(K("/api/plugins/install-from-url"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:t.trim()})}).then(i=>i.json()).then(i=>{i.error?H.error(l("ui.plugins.cdnInstallFailed",{reason:i.error})):(H.success(l("ui.plugins.cdnInstallSuccess")),i.plugins&&this.setState({pluginsList:i.plugins,pluginsDir:i.pluginsDir||""}),this.setState({cdnModalVisible:!1,cdnUrl:""}))}).catch(i=>{H.error(l("ui.plugins.cdnInstallFailed",{reason:i.message||"Network error"}))}).finally(()=>{this.setState({cdnLoading:!1})})});M(this,"handleCdnCancel",()=>{this.setState({cdnModalVisible:!1,cdnUrl:"",cdnLoading:!1})});M(this,"fetchProcesses",()=>{this.setState({processLoading:!0}),fetch(K("/api/ccv-processes")).then(t=>t.json()).then(t=>{this.setState({processList:t.processes||[],processLoading:!1})}).catch(()=>{this.setState({processList:[],processLoading:!1})})});M(this,"handleShowProcesses",()=>{this.setState({processModalVisible:!0}),this.fetchProcesses()});M(this,"handleKillProcess",t=>{X.confirm({title:l("ui.processManagement.killConfirm"),onOk:()=>{fetch(K("/api/ccv-processes/kill"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({pid:t})}).then(i=>i.json()).then(i=>{i.ok?(H.success(l("ui.processManagement.killed")),this.fetchProcesses()):H.error(i.error||l("ui.processManagement.killFailed"))}).catch(()=>{H.error(l("ui.processManagement.killFailed"))})}})});this.state={countdownText:"",countryFlag:null,countryInfo:null,promptModalVisible:!1,promptData:[],promptViewMode:"original",settingsDrawerVisible:!1,globalSettingsVisible:!1,projectStatsVisible:!1,projectStats:null,projectStatsLoading:!1,localUrl:"",pluginModalVisible:!1,pluginsList:[],pluginsDir:"",deleteConfirmVisible:!1,deleteTarget:null,processModalVisible:!1,processList:[],processLoading:!1,logoDropdownOpen:!1,cacheHighlightIdx:null,cacheHighlightFading:!1,cdnModalVisible:!1,cdnUrl:"",cdnLoading:!1,calibrationModel:(i=>Fe.some(o=>o.value===i)?i:"auto")(localStorage.getItem("ccv_calibrationModel")||"auto"),proxyModalVisible:!1,editingProxy:null,editForm:{name:"",baseURL:"",apiKey:"",models:"",activeModel:""},logDirDraft:null},this._countdownTimer=null,this._expiredTimer=null,this.updateCountdown=this.updateCountdown.bind(this)}componentDidMount(){this.startCountdown(),fetch(K("/api/local-url")).then(t=>t.json()).then(t=>{t.url&&this.setState({localUrl:t.url})}).catch(()=>{}),fetch(K("/api/claude-settings")).then(t=>t.json()).then(t=>{t.model&&this.setState({settingsModel:t.model})}).catch(()=>{}),fetch("https://ipinfo.io/json",{signal:AbortSignal.timeout(5e3)}).then(t=>t.json()).then(t=>{t.country&&this.setState({countryFlag:ks(t.country),countryInfo:t})}).catch(()=>{})}componentDidUpdate(t){t.cacheExpireAt!==this.props.cacheExpireAt&&this.startCountdown()}shouldComponentUpdate(t,i){return t.requests!==this.props.requests||t.requestCount!==this.props.requestCount||t.viewMode!==this.props.viewMode||t.cacheExpireAt!==this.props.cacheExpireAt||t.cacheType!==this.props.cacheType||t.isLocalLog!==this.props.isLocalLog||t.projectName!==this.props.projectName||t.collapseToolResults!==this.props.collapseToolResults||t.expandThinking!==this.props.expandThinking||t.showFullToolContent!==this.props.showFullToolContent||t.expandDiff!==this.props.expandDiff||t.filterIrrelevant!==this.props.filterIrrelevant||t.logDir!==this.props.logDir||t.cliMode!==this.props.cliMode||t.contextWindow!==this.props.contextWindow||t.serverCachedContent!==this.props.serverCachedContent||t.resumeAutoChoice!==this.props.resumeAutoChoice||t.proxyProfiles!==this.props.proxyProfiles||t.activeProxyId!==this.props.activeProxyId||t.defaultConfig!==this.props.defaultConfig||i!==this.state}componentWillUnmount(){this._countdownTimer&&clearTimeout(this._countdownTimer),this._expiredTimer&&clearTimeout(this._expiredTimer),this._cacheFadeClearTimer&&clearTimeout(this._cacheFadeClearTimer),this._cacheScrollSettleTimer&&clearTimeout(this._cacheScrollSettleTimer),this._cacheAutoFadeTimer&&clearTimeout(this._cacheAutoFadeTimer),this._cacheHighlightDelayTimer&&clearTimeout(this._cacheHighlightDelayTimer),this._cacheUnbindScrollFade()}startCountdown(){if(this._countdownTimer&&clearTimeout(this._countdownTimer),this._expiredTimer&&clearTimeout(this._expiredTimer),!this.props.cacheExpireAt){this.state.countdownText!==""&&this.setState({countdownText:""});return}this.updateCountdown()}updateCountdown(){const{cacheExpireAt:t}=this.props;if(!t){this.state.countdownText!==""&&this.setState({countdownText:""});return}const i=Date.now(),o=Math.max(0,t-i);if(o<=0){const u=l("ui.cacheExpired");this.state.countdownText!==u&&this.setState({countdownText:u}),this._expiredTimer=setTimeout(()=>{this.state.countdownText!==""&&this.setState({countdownText:""})},5e3);return}const n=Math.ceil(o/1e3);let r;if(n>=60){const u=Math.floor(n/60),g=n%60;r=l("ui.minuteSecond",{m:u,s:String(g).padStart(2,"0")})}else r=l("ui.second",{s:n});r!==this.state.countdownText&&this.setState({countdownText:r});const m=1e3-i%1e3;this._countdownTimer=setTimeout(this.updateCountdown,m)}static parseSegments(t){const i=[],o=/<([a-zA-Z_][\w-]*)(?:\s[^>]*)?>[\s\S]*?<\/\1>/g;let n=0,r;for(;(r=o.exec(t))!==null;){const u=t.slice(n,r.index).trim();u&&i.push({type:"text",content:u});const g=r[1];if(n=r.index+r[0].length,oe.COMMAND_TAGS.has(g))continue;const h=new RegExp(`^<${g}(?:\\s[^>]*)?>([\\s\\S]*)<\\/${g}>$`),d=r[0].match(h),x=d?d[1].trim():r[0].trim();i.push({type:"system",content:x,label:g})}const m=t.slice(n).trim();return m&&i.push({type:"text",content:m}),i}static extractUserTexts(t){const i=[],o=[];let n=null;for(const r of t)if(r.role==="user"){if(typeof r.content=="string"){const m=r.content.trim();if(!m)continue;if(!fe(m)){if(/Implement the following plan:/i.test(m))continue;i.push(m),o.push(m)}}else if(Array.isArray(r.content)){const{commands:m,textBlocks:u}=qt(r.content);m.length>0&&(n=m[m.length-1]);const g=[];for(const d of u)/Implement the following plan:/i.test((d.text||"").trim())||g.push(d.text.trim());const h=r.content.filter(d=>{var x;return d.type==="text"&&((x=d.text)==null?void 0:x.trim())}).map(d=>d.text.trim());g.length>0&&(i.push(g.join(`
|
|
9
|
+
`)),o.push(h.join(`
|
|
10
|
+
`)))}}return{userMsgs:i,fullTexts:o,slashCmd:n}}extractUserPrompts(){var m;const{requests:t=[]}=this.props,i=[],o=new Set;let n=null;const r=t.filter(u=>Z(u));for(let u=0;u<r.length;u++){const g=r[u],h=((m=g.body)==null?void 0:m.messages)||[],d=g.timestamp||"",{userMsgs:x,fullTexts:C,slashCmd:j}=oe.extractUserTexts(h);j&&j!=="/compact"&&j!==n&&i.push({type:"prompt",segments:[{type:"text",content:j}],timestamp:d}),n=j;for(let p=0;p<x.length;p++){const _=x[p];if(o.has(_))continue;o.add(_);const b=C[p]||_;i.push({type:"prompt",segments:oe.parseSegments(b),timestamp:d})}}return i}renderTokenStats(){const{requests:t=[]}=this.props,{cacheHighlightIdx:i,cacheHighlightFading:o}=this.state;if(this._tokenStatsCache&&this._tokenStatsCacheReq===t&&this._tokenStatsCacheHl===i&&this._tokenStatsCacheFade===o)return this._tokenStatsCache;const n=zt(t),r=Object.keys(n),m=$t(t),u=Vt(t);if(r.length===0&&m.length===0)return e.jsx("div",{className:s.tokenStatsEmpty,children:"暂无 token 数据"});const g=e.jsx("div",{className:s.tokenStatsColumn,children:r.map(j=>{const p=n[j],_=p.input+p.cacheCreation+p.cacheRead,b=_>0?(p.cacheRead/_*100).toFixed(1):"0.0";return e.jsxs("div",{className:r.length>1?s.modelCardSpaced:s.modelCard,children:[e.jsx("div",{className:s.modelName,children:j}),e.jsx("table",{className:s.statsTable,children:e.jsxs("tbody",{children:[e.jsxs("tr",{children:[e.jsx("td",{className:s.label,children:"Token"}),e.jsx("td",{className:s.th,children:"input"}),e.jsx("td",{className:s.th,children:"output"})]}),e.jsxs("tr",{className:s.rowBorder,children:[e.jsx("td",{className:s.label}),e.jsx("td",{className:s.td,children:F(_)}),e.jsx("td",{className:s.td,children:F(p.output)})]}),e.jsxs("tr",{children:[e.jsx("td",{className:s.label,children:"Cache"}),e.jsx("td",{className:s.th,children:"create"}),e.jsx("td",{className:s.th,children:"read"})]}),e.jsxs("tr",{className:s.rowBorder,children:[e.jsx("td",{className:s.label}),e.jsx("td",{className:s.td,children:F(p.cacheCreation)}),e.jsx("td",{className:s.td,children:F(p.cacheRead)})]}),e.jsxs("tr",{children:[e.jsx("td",{className:s.label,children:l("ui.hitRate")}),e.jsxs("td",{colSpan:2,className:s.td,children:[b,"%"]})]})]})})]},j)})}),h=this.renderCacheRebuildStats(),d=m.length>0?e.jsx("div",{className:s.toolStatsColumn,children:e.jsxs("div",{className:s.modelCard,children:[e.jsx("div",{className:s.modelName,children:l("ui.toolUsageStats")}),e.jsxs("table",{className:s.statsTable,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{className:`${s.th} ${s.thLeft}`,children:"Tool"}),e.jsx("td",{className:s.th,children:l("ui.cacheRebuild.count")})]})}),e.jsxs("tbody",{children:[m.map(([j,p])=>e.jsxs("tr",{className:s.rowBorder,children:[e.jsxs("td",{className:s.label,children:[j," ",e.jsx(V,{doc:`Tool-${j}`})]}),e.jsx("td",{className:s.td,children:p})]},j)),m.length>1&&e.jsxs("tr",{className:s.rebuildTotalRow,children:[e.jsx("td",{className:s.label,children:"Total"}),e.jsx("td",{className:s.td,children:m.reduce((j,p)=>j+p[1],0)})]})]})]})]})}):null,x=u.length>0?e.jsx("div",{className:s.toolStatsColumn,children:e.jsxs("div",{className:s.modelCard,children:[e.jsx("div",{className:s.modelName,children:l("ui.skillUsageStats")}),e.jsxs("table",{className:s.statsTable,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{className:`${s.th} ${s.thLeft}`,children:"Skill"}),e.jsx("td",{className:s.th,children:l("ui.cacheRebuild.count")})]})}),e.jsxs("tbody",{children:[u.map(([j,p])=>e.jsxs("tr",{className:s.rowBorder,children:[e.jsx("td",{className:s.label,children:j}),e.jsx("td",{className:s.td,children:p})]},j)),u.length>1&&e.jsxs("tr",{className:s.rebuildTotalRow,children:[e.jsx("td",{className:s.label,children:"Total"}),e.jsx("td",{className:s.td,children:u.reduce((j,p)=>j+p[1],0)})]})]})]})]})}):null,C=e.jsxs("div",{className:s.tokenStatsContainer,children:[g,h,d,x]});return this._tokenStatsCache=C,this._tokenStatsCacheReq=t,this._tokenStatsCacheHl=i,this._tokenStatsCacheFade=o,C}_cacheUnbindScrollFade(){this._cacheOnScrollFade&&this._cacheScrollEl&&(this._cacheScrollEl.removeEventListener("scroll",this._cacheOnScrollFade),this._cacheOnScrollFade=null)}_cacheBindScrollFade(){this._cacheUnbindScrollFade();const t=this._cacheScrollEl;t&&(this._cacheOnScrollFade=()=>{clearTimeout(this._cacheAutoFadeTimer),this.setState({cacheHighlightFading:!0}),this._cacheFadeClearTimer=setTimeout(()=>{this.setState({cacheHighlightIdx:null,cacheHighlightFading:!1})},3e3),this._cacheUnbindScrollFade()},t.addEventListener("scroll",this._cacheOnScrollFade,{passive:!0}))}scrollToCacheMsg(t){if(this.props.viewMode==="raw"&&this.props.onNavigateCacheMsg&&this.props.onNavigateCacheMsg(t),(this.state._cacheSectionCollapsed||{}).messages){this.setState(u=>({_cacheSectionCollapsed:{...u._cacheSectionCollapsed||{},messages:!1}}),()=>this.scrollToCacheMsg(t));return}const i=this._cacheScrollEl;if(!i)return;const o=i.querySelector(`[data-msg-idx="${t}"]`);if(!o)return;clearTimeout(this._cacheScrollSettleTimer),clearTimeout(this._cacheFadeClearTimer),clearTimeout(this._cacheAutoFadeTimer),clearTimeout(this._cacheHighlightDelayTimer),this._cacheUnbindScrollFade(),this._cacheScrollEndHandler&&i.removeEventListener("scrollend",this._cacheScrollEndHandler),this.setState({cacheHighlightIdx:null,cacheHighlightFading:!1});let n=!1,r=!1;const m=()=>{!n||!r||(this.setState({cacheHighlightIdx:t,cacheHighlightFading:!1}),this._cacheScrollSettleTimer=setTimeout(()=>this._cacheBindScrollFade(),200),this._cacheAutoFadeTimer=setTimeout(()=>{this.state.cacheHighlightIdx===t&&!this.state.cacheHighlightFading&&(this.setState({cacheHighlightFading:!0}),this._cacheFadeClearTimer=setTimeout(()=>{this.setState({cacheHighlightIdx:null,cacheHighlightFading:!1})},3e3),this._cacheUnbindScrollFade())},3e3))};this._cacheScrollEndHandler=()=>{i.removeEventListener("scrollend",this._cacheScrollEndHandler),n=!0,m()},i.addEventListener("scrollend",this._cacheScrollEndHandler,{once:!0}),this._cacheScrollSettleTimer=setTimeout(()=>{i.removeEventListener("scrollend",this._cacheScrollEndHandler),n=!0,m()},800),this._cacheHighlightDelayTimer=setTimeout(()=>{r=!0,m()},500),o.scrollIntoView({behavior:"smooth",block:"center"})}renderCacheContentPopover(t){const{requests:i=[],serverCachedContent:o}=this.props,n=o||jt(i);if(n&&(n.cacheCreateTokens>0||n.cacheReadTokens>0)&&(this._lastCachedTokens={cacheCreateTokens:n.cacheCreateTokens,cacheReadTokens:n.cacheReadTokens}),t>0&&(this._lastContextPercent=t),!n||n.system.length===0&&n.messages.length===0&&n.tools.length===0)return e.jsx("div",{className:s.cachePopoverEmpty,children:l("ui.noCachedContent")});const r=(h,d,x,C)=>{if(d.length===0)return null;const j=h===l("ui.messages"),p=(this.state._cacheSectionCollapsed||{})[C],_=p!==void 0?!!p:!0,b=()=>this.setState(w=>({_cacheSectionCollapsed:{...w._cacheSectionCollapsed||{},[C]:!_}}));return e.jsxs("div",{className:s.cacheSection,children:[e.jsxs("button",{type:"button",className:s.cacheSectionTitle,onClick:b,"aria-expanded":!_,children:[e.jsx("span",{className:s.cacheSectionArrow,children:_?"▶":"▼"}),h," (",d.length,")"]}),!_&&d.map((w,L)=>{const S=j?{"data-msg-idx":L}:{};let T=x||s.cacheCodeBlock;const I=j&&L===this.state.cacheHighlightIdx;return I&&(T+=" "+(this.state.cacheHighlightFading?s.cacheBlockHighlightFading:s.cacheBlockHighlight)),e.jsxs("pre",{className:T,...S,style:I?{position:"relative"}:void 0,children:[I&&e.jsx("svg",{className:`${s.cacheBorderSvg}${this.state.cacheHighlightFading?" "+s.cacheBorderSvgFading:""}`,preserveAspectRatio:"none",children:e.jsx("rect",{x:"0.5",y:"0.5",width:"calc(100% - 1px)",height:"calc(100% - 1px)",rx:"4",ry:"4",fill:"none",stroke:"#1668dc",strokeWidth:"1",strokeDasharray:"6 4",className:s.cacheBorderRect})}),w]},L)})]})},m=()=>{const h=[];return n.tools.length>0&&(h.push(`=== ${l("ui.tools")} (${n.tools.length}) ===`),n.tools.forEach(d=>h.push(d))),n.system.length>0&&(h.push(`
|
|
11
|
+
=== ${l("ui.systemPrompt")} (${n.system.length}) ===`),n.system.forEach(d=>h.push(d))),n.messages.length>0&&(h.push(`
|
|
12
|
+
=== ${l("ui.messages")} (${n.messages.length}) ===`),n.messages.forEach(d=>h.push(d))),h.join(`
|
|
13
|
+
|
|
14
|
+
`)},u=n.messages.map((h,d)=>({text:h,msgIdx:d})).filter(({text:h})=>h.startsWith("[user]")).map(({text:h,msgIdx:d})=>{const x=h.replace(/^\[user\]\s*/,"").trim();return!x||fe(x)?{cleaned:"",msgIdx:d}:{cleaned:oe.parseSegments(x).filter(p=>p.type==="text").map(p=>p.content.trim()).filter(p=>p&&!fe(p)).join(" ").trim(),msgIdx:d}}).filter(({cleaned:h})=>!(!h||/Implement the following plan:/i.test(h))),g=u.length>0?e.jsx("div",{className:s.cacheNavList,children:u.map(({cleaned:h,msgIdx:d})=>e.jsx("div",{className:s.cacheNavItem,onClick:()=>this.scrollToCacheMsg(d),children:h},d))}):null;return e.jsxs("div",{className:s.cachePopover,children:[e.jsx("div",{className:s.cachePopoverHeader,children:e.jsxs("div",{className:s.cachePopoverTitle,children:[l("ui.cachedContentTitle"),e.jsx(V,{doc:"KVCacheContent"}),e.jsx(me,{className:s.cacheCopyBtn,onClick:()=>{navigator.clipboard.writeText(m()).then(()=>{H.success(l("ui.copied"))}).catch(()=>{})}}),e.jsx("span",{className:s.cacheCalibrationLabel,children:l("ui.calibrationModelLabel")}),e.jsx(le,{size:"small",value:this.state.calibrationModel,onChange:this.handleCalibrationModelChange,options:Fe,className:s.calibrationSelect,popupMatchSelectWidth:!1})]})}),(()=>{const d=n.cacheCreateTokens>0||n.cacheReadTokens>0?n:this._lastCachedTokens,x=t>0?t:this._lastContextPercent||0;return d||g?e.jsxs("div",{className:s.cacheTokenInfo,children:[d&&e.jsxs(e.Fragment,{children:[l("ui.tokens"),": ",e.jsxs("span",{className:s.cacheWriteToken,children:["write ",F(d.cacheCreateTokens)]})," / ",e.jsxs("span",{className:s.cacheReadToken,children:["read ",F(d.cacheReadTokens)]}),x>0&&e.jsxs("span",{className:s.cacheCtxPercent,children:["(ctx:",x,"%)"]})]}),g&&e.jsx(ue,{content:g,trigger:"hover",placement:"left",children:e.jsx("span",{className:s.cacheNavBtn,children:l("ui.userPromptNav")})})]}):null})(),e.jsxs("div",{className:s.cacheScrollArea,ref:h=>{this._cacheScrollEl=h,h&&!this._cacheScrollInited&&(this._cacheScrollInited=!0,requestAnimationFrame(()=>{h.scrollTop=h.scrollHeight}))},children:[r(l("ui.tools"),n.tools,void 0,"tools"),r(l("ui.systemPrompt"),n.system,s.cacheCodeBlockSystem,"system"),r(l("ui.messages"),n.messages,void 0,"messages")]})]})}renderCacheRebuildStats(){const{requests:t=[]}=this.props,i=Ot(t),o=["ttl","system_change","tools_change","model_change","msg_truncated","msg_modified","key_change"],n={ttl:"cacheLoss.ttl",system_change:"cacheLoss.systemChange",tools_change:"cacheLoss.toolsChange",model_change:"cacheLoss.modelChange",msg_truncated:"cacheLoss.msgTruncated",msg_modified:"cacheLoss.msgModified",key_change:"cacheLoss.keyChange"},r=o.filter(_=>i[_].count>0),m=r.reduce((_,b)=>_+i[b].count,0),u=r.reduce((_,b)=>_+i[b].cacheCreate,0);Ut(t);const g={},h={};for(let _=0;_<t.length;_++){const b=je(t[_],t[_+1]);if(b.type==="SubAgent"){const w=b.subType||"Other";g[w]=(g[w]||0)+1}else if(b.type==="Teammate"){const w=b.subType||"Teammate";h[w]=(h[w]||0)+1}}const d=Object.entries(g).sort((_,b)=>b[1]-_[1]),x=Object.entries(h).sort((_,b)=>b[1]-_[1]),C=r.length>0,j=d.length>0,p=x.length>0;return!C&&!j&&!p?null:e.jsxs("div",{className:s.toolStatsColumn,children:[C&&e.jsxs("div",{className:j||p?s.modelCardSpaced:s.modelCard,children:[e.jsxs("div",{className:s.modelName,children:["MainAgent",e.jsx(V,{doc:"MainAgent"})," ",l("ui.cacheRebuildStats"),e.jsx(V,{doc:"CacheRebuild"})]}),e.jsxs("table",{className:s.statsTable,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{className:`${s.th} ${s.thLeft}`,children:l("ui.cacheRebuild.reason")}),e.jsx("td",{className:s.th,children:l("ui.cacheRebuild.count")}),e.jsx("td",{className:s.th,children:l("ui.cacheRebuild.cacheCreate")})]})}),e.jsxs("tbody",{children:[r.map(_=>e.jsxs("tr",{className:s.rowBorder,children:[e.jsx("td",{className:s.label,children:l(`ui.${n[_]}`)}),e.jsx("td",{className:s.td,children:i[_].count}),e.jsx("td",{className:s.td,children:F(i[_].cacheCreate)})]},_)),r.length>1&&e.jsxs("tr",{className:s.rebuildTotalRow,children:[e.jsx("td",{className:s.label,children:"Total"}),e.jsx("td",{className:s.td,children:m}),e.jsx("td",{className:s.td,children:F(u)})]})]})]})]}),j&&e.jsxs("div",{className:p?s.modelCardSpaced:s.modelCard,children:[e.jsx("div",{className:s.modelName,children:l("ui.subAgentStats")}),e.jsxs("table",{className:s.statsTable,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{className:`${s.th} ${s.thLeft}`,children:"SubAgent"}),e.jsx("td",{className:s.th,children:l("ui.cacheRebuild.count")})]})}),e.jsxs("tbody",{children:[d.map(([_,b])=>e.jsxs("tr",{className:s.rowBorder,children:[e.jsxs("td",{className:s.label,children:[_," ",e.jsx(V,{doc:`SubAgent-${_}`})]}),e.jsx("td",{className:s.td,children:b})]},_)),d.length>1&&e.jsxs("tr",{className:s.rebuildTotalRow,children:[e.jsx("td",{className:s.label,children:"Total"}),e.jsx("td",{className:s.td,children:d.reduce((_,b)=>_+b[1],0)})]})]})]})]}),p&&e.jsxs("div",{className:s.modelCard,children:[e.jsxs("div",{className:s.modelName,children:["Teammate",e.jsx(V,{doc:"Teammate"})]}),e.jsxs("table",{className:s.statsTable,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{className:`${s.th} ${s.thLeft}`,children:"Name"}),e.jsx("td",{className:s.th,children:l("ui.cacheRebuild.count")})]})}),e.jsxs("tbody",{children:[x.map(([_,b])=>e.jsxs("tr",{className:s.rowBorder,children:[e.jsx("td",{className:s.label,children:_}),e.jsx("td",{className:s.td,children:b})]},_)),x.length>1&&e.jsxs("tr",{className:s.rebuildTotalRow,children:[e.jsx("td",{className:s.label,children:"Total"}),e.jsx("td",{className:s.td,children:x.reduce((_,b)=>_+b[1],0)})]})]})]})]})]})}renderTextPrompt(t){return e.jsx("div",{className:s.textPromptCard,children:t.segments.map((i,o)=>i.type==="text"?e.jsx("pre",{className:s.preText,children:i.content},o):e.jsx(Lt,{size:"small",className:s.systemCollapse,items:[{key:`sys-${o}`,label:e.jsx("span",{className:s.systemLabel,children:i.label}),children:e.jsx("pre",{className:s.preSys,children:i.content})}]},o))})}renderOriginalPrompt(t){const i=t.segments.filter(o=>o.type==="text");return i.length===0?null:e.jsx("div",{className:s.textPromptCard,children:i.map((o,n)=>e.jsx("pre",{className:s.preText,children:o.content},n))})}buildTextModeContent(){const{promptData:t}=this.state,i=[];for(const o of t){const n=(o.segments||[]).filter(r=>r.type==="text").map(r=>r.content);n.length>0&&i.push(n.join(`
|
|
15
|
+
`))}return i.join(`
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
`)}renderProjectStatsContent(){const{projectStats:t,projectStatsLoading:i}=this.state;if(i)return e.jsx("div",{className:s.projectStatsCenter,children:e.jsx(pt,{})});if(!t)return e.jsx("div",{className:s.projectStatsEmpty,children:l("ui.projectStats.noData")});const{summary:o,models:n,updatedAt:r}=t;n&&Object.entries(n).sort((g,h)=>h[1]-g[1]);const m={};if(t.files){for(const g of Object.values(t.files))if(g.models)for(const[h,d]of Object.entries(g.models))m[h]||(m[h]={input:0,output:0,cacheRead:0,cacheCreation:0,count:0}),m[h].input+=d.input_tokens||0,m[h].output+=d.output_tokens||0,m[h].cacheRead+=d.cache_read_input_tokens||0,m[h].cacheCreation+=d.cache_creation_input_tokens||0,m[h].count+=d.count||0}const u=Object.entries(m).sort((g,h)=>h[1].count-g[1].count);return e.jsxs("div",{className:s.projectStatsContent,children:[r&&e.jsx("div",{className:s.projectStatsUpdated,children:l("ui.projectStats.updatedAt",{time:new Date(r).toLocaleString()})}),e.jsxs("div",{className:s.projectStatsSummary,children:[e.jsxs("div",{className:s.projectStatCard,children:[e.jsx("div",{className:s.projectStatValue,children:(o==null?void 0:o.requestCount)??0}),e.jsx("div",{className:s.projectStatLabel,children:l("ui.projectStats.totalRequests")})]}),e.jsxs("div",{className:s.projectStatCard,children:[e.jsx("div",{className:s.projectStatValue,children:(o==null?void 0:o.turnCount)??(o==null?void 0:o.sessionCount)??0}),e.jsx("div",{className:s.projectStatLabel,children:l("ui.projectStats.turnCount")})]}),e.jsxs("div",{className:s.projectStatCard,children:[e.jsx("div",{className:s.projectStatValue,children:(o==null?void 0:o.fileCount)??0}),e.jsx("div",{className:s.projectStatLabel,children:l("ui.projectStats.totalFiles")})]}),e.jsxs("div",{className:s.projectStatCard,children:[e.jsx("div",{className:s.projectStatValue,children:F(o==null?void 0:o.input_tokens)}),e.jsx("div",{className:s.projectStatLabel,children:"Input Tokens"})]}),e.jsxs("div",{className:s.projectStatCard,children:[e.jsx("div",{className:s.projectStatValue,children:F(o==null?void 0:o.output_tokens)}),e.jsx("div",{className:s.projectStatLabel,children:"Output Tokens"})]})]}),u.length>0&&e.jsxs("div",{className:s.projectStatsSection,children:[e.jsx("div",{className:s.projectStatsSectionTitle,children:l("ui.projectStats.modelUsage")}),u.map(([g,h])=>{const d=h.input+h.cacheRead+h.cacheCreation,x=d>0?(h.cacheRead/d*100).toFixed(1):"0.0";return e.jsxs("div",{className:s.projectStatsModelCard,children:[e.jsxs("div",{className:s.projectStatsModelHeader,children:[e.jsx("span",{className:s.projectStatsModelName,children:g}),e.jsxs("span",{className:s.projectStatsModelCount,children:[h.count," reqs"]})]}),e.jsx("table",{className:s.statsTable,children:e.jsxs("tbody",{children:[e.jsxs("tr",{children:[e.jsx("td",{className:s.label,children:"Token"}),e.jsx("td",{className:s.th,children:"input"}),e.jsx("td",{className:s.th,children:"output"})]}),e.jsxs("tr",{className:s.rowBorder,children:[e.jsx("td",{className:s.label}),e.jsx("td",{className:s.td,children:F(d)}),e.jsx("td",{className:s.td,children:F(h.output)})]}),e.jsxs("tr",{children:[e.jsx("td",{className:s.label,children:"Cache"}),e.jsx("td",{className:s.th,children:"create"}),e.jsx("td",{className:s.th,children:"read"})]}),e.jsxs("tr",{className:s.rowBorder,children:[e.jsx("td",{className:s.label}),e.jsx("td",{className:s.td,children:F(h.cacheCreation)}),e.jsx("td",{className:s.td,children:F(h.cacheRead)})]}),e.jsxs("tr",{children:[e.jsx("td",{className:s.label,children:l("ui.hitRate")}),e.jsxs("td",{colSpan:2,className:s.td,children:[x,"%"]})]})]})})]},g)})]})]})}render(){var We;const{requestCount:t,requests:i=[],viewMode:o,cacheType:n,onToggleViewMode:r,onImportLocalLogs:m,onLangChange:u,isLocalLog:g,localLogFile:h,projectName:d,collapseToolResults:x,onCollapseToolResultsChange:C,expandThinking:j,onExpandThinkingChange:p,showFullToolContent:_,onShowFullToolContentChange:b,expandDiff:w,onExpandDiffChange:L,filterIrrelevant:S,onFilterIrrelevantChange:T,logDir:I,onLogDirChange:q,updateInfo:z,onDismissUpdate:R,cliMode:O,terminalVisible:$,onToggleTerminal:ne,onReturnToWorkspaces:xe,contextWindow:P,serverCachedContent:Si,resumeAutoChoice:Le,onResumeAutoChoiceToggle:Ve,onResumeAutoChoiceChange:Oe,themeColor:ye,onThemeColorChange:ve,autoApproveSeconds:kt,onAutoApproveChange:Ue}=this.props,{countdownText:Re}=this.state,Tt=[{key:"import-local",icon:e.jsx(ut,{}),label:l("ui.importLocalLogs"),onClick:m},{key:"export-prompts",icon:e.jsx(gs,{}),label:l("ui.exportPrompts"),onClick:this.handleShowPrompts},{key:"plugin-management",icon:e.jsx(ct,{}),label:l("ui.pluginManagement"),onClick:this.handleShowPlugins},{key:"switch-workspace",icon:e.jsx(ut,{className:s.iconMirror}),label:e.jsx("span",{className:s.disabledMenuItem,children:l("ui.switchWorkspace")}),disabled:!0},{key:"process-management",icon:e.jsx(Ae,{}),label:l("ui.processManagement"),onClick:this.handleShowProcesses},{key:"proxy-switch",icon:e.jsx(Ze,{}),label:l("ui.proxySwitch"),onClick:()=>this.setState({proxyModalVisible:!0})},{type:"divider"},{key:"project-stats",icon:e.jsx(dt,{}),label:l("ui.projectStats"),onClick:this.handleShowProjectStats},...o==="raw"?[{key:"global-settings",icon:e.jsx(mt,{}),label:l("ui.globalSettings"),onClick:()=>this.setState({globalSettingsVisible:!0})}]:[],...o==="chat"?[{key:"display-settings",icon:e.jsx(mt,{}),label:l("ui.settings"),onClick:()=>this.setState({settingsDrawerVisible:!0})}]:[]];return e.jsxs("div",{className:s.headerBar,children:[e.jsxs(pe,{size:"middle",children:[e.jsx(Rt,{menu:{items:Tt,className:"logo-dropdown-menu"},trigger:["hover"],onOpenChange:y=>this.setState({logoDropdownOpen:y}),align:{offset:[-4,0]},children:e.jsx("span",{className:`${s.logoWrap}${this.state.logoDropdownOpen?` ${s.logoWrapActive}`:""}`,children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:`${s.logoImage}${this.state.logoDropdownOpen?` ${s.logoImageActive}`:""}`,children:[e.jsx("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),e.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),e.jsx("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]})})}),e.jsx(ue,{content:()=>this.renderTokenStats(),trigger:"hover",placement:"bottomLeft",overlayInnerStyle:{background:"var(--bg-elevated)",border:"1px solid var(--border-hover)",borderRadius:8,padding:"8px 8px",maxHeight:"80vh",overflowY:"auto"},children:e.jsxs(Y,{className:s.tokenStatsTag,children:[e.jsx(Ae,{className:s.tokenStatsIcon}),l("ui.tokenStats")]})}),this.props.activeProxyId&&this.props.activeProxyId!=="max"&&(()=>{const y=(this.props.proxyProfiles||[]).find(U=>U.id===this.props.activeProxyId);return y?e.jsxs(Y,{className:s.proxyProfileTag,onClick:()=>this.setState({proxyModalVisible:!0}),children:[e.jsx(Ze,{className:s.proxySwapIcon}),y.name,y.activeModel?` · ${y.activeModel}`:""]}):null})(),(()=>{var Ke,Je,Ge,Qe,Xe;let y=0;const U=Fe.find(Q=>Q.value===this.state.calibrationModel),he=U==null?void 0:U.tokens;if(!g){if(he&&(P==null?void 0:P.used_percentage)!=null){const Q=A=>{var se,Ye;const G=(Ye=(se=A.response)==null?void 0:se.body)==null?void 0:Ye.usage;return((G==null?void 0:G.input_tokens)||0)+((G==null?void 0:G.cache_creation_input_tokens)||0)+((G==null?void 0:G.cache_read_input_tokens)||0)};let W=0;for(let A=i.length-1;A>=0;A--)if(Z(i[A])&&((Je=(Ke=i[A].response)==null?void 0:Ke.body)!=null&&Je.usage)){W=Q(i[A]);break}if(W>0){const A=he*.835;y=Math.min(100,Math.max(0,Math.round(W/A*100)))}else{const A=P.context_window_size||2e5;y=Math.min(100,Math.max(0,Math.round(P.used_percentage*A/he/83.5*100)))}}else if((P==null?void 0:P.used_percentage)!=null){const Q=this.state.settingsModel?st(this.state.settingsModel):0,W=P.context_window_size||2e5;Q&&Q!==W?y=Math.min(100,Math.max(0,Math.round(P.used_percentage*W/Q/83.5*100))):y=Math.min(100,Math.max(0,Math.round(P.used_percentage/83.5*100)))}else if(i.length>0){const Q=W=>{var G,se;const A=(se=(G=W.response)==null?void 0:G.body)==null?void 0:se.usage;return((A==null?void 0:A.input_tokens)||0)+((A==null?void 0:A.cache_creation_input_tokens)||0)+((A==null?void 0:A.cache_read_input_tokens)||0)};for(let W=i.length-1;W>=0;W--)if(Z(i[W])&&((Qe=(Ge=i[W].response)==null?void 0:Ge.body)!=null&&Qe.usage)){const A=Q(i[W]),se=(he||(P==null?void 0:P.context_window_size)||st(((Xe=i[W].body)==null?void 0:Xe.model)||this.state.settingsModel))*.835;se>0&&A>0&&(y=Math.min(100,Math.max(0,Math.round(A/se*100))));break}}}y===0&&this._lastContextPercent>0&&(y=this._lastContextPercent);const Ie=y>=80?"var(--color-error-light)":y>=60?"var(--color-warning-light)":"var(--color-success)";return g?e.jsx(Y,{className:`${s.liveTag} ${s.liveTagHistory}`,children:e.jsx("span",{className:s.liveTagText,children:l("ui.historyLog",{file:h})})}):e.jsx(ue,{content:this.state._cachePopoverOpen?this.renderCacheContentPopover(y):e.jsx("div",{className:s.cachePopoverPlaceholder}),trigger:"hover",placement:"bottomLeft",overlayInnerStyle:{background:"var(--bg-elevated)",border:"1px solid var(--border-hover)",borderRadius:8,padding:"8px 8px"},onOpenChange:Q=>{this.setState({_cachePopoverOpen:Q}),Q||(this._cacheScrollInited=!1)},children:e.jsxs("span",{className:s.liveTag,style:{borderColor:Ie,color:Ie},children:[e.jsx("span",{className:s.liveTagFill,style:{width:`${y}%`,backgroundColor:Ie}}),e.jsx("span",{className:s.liveTagContent,children:e.jsxs("span",{className:s.liveTagText,children:[l("ui.liveMonitoring"),d?`:${d}`:""]})})]})})})(),z&&e.jsx(Y,{color:z.type==="completed"?"green":"orange",closable:!0,onClose:()=>R&&R(),children:z.type==="completed"?l("ui.update.completed",{version:z.version}):l("ui.update.majorAvailable",{version:z.version})})]}),e.jsxs(pe,{size:"middle",children:[Re&&o==="raw"&&e.jsxs(Y,{style:{background:"var(--bg-surface)",border:"1px solid var(--border-hover)",color:Re===l("ui.cacheExpired")?"var(--color-error-light)":"var(--text-secondary)"},children:[l("ui.cacheCountdown",{type:n?`(${n})`:""}),e.jsx("strong",{className:s.countdownStrong,children:Re})]}),o==="chat"&&O&&!g&&this.state.localUrl&&e.jsxs(e.Fragment,{children:[this.state.countryFlag&&((We=this.state.countryInfo)==null?void 0:We.country)!=="CN"&&e.jsx(ue,{content:this.state.countryInfo?e.jsxs("div",{className:s.countryInfoPopover,children:[e.jsxs("div",{children:[this.state.countryFlag," ",this.state.countryInfo.country]}),this.state.countryInfo.region&&e.jsx("div",{children:this.state.countryInfo.region}),this.state.countryInfo.city&&e.jsx("div",{children:this.state.countryInfo.city}),this.state.countryInfo.org&&e.jsx("div",{className:s.countryInfoMeta,children:this.state.countryInfo.org}),this.state.countryInfo.ip&&e.jsx("div",{className:s.countryInfoMeta,children:this.state.countryInfo.ip})]}):null,trigger:"hover",placement:"bottomRight",overlayInnerStyle:{background:"var(--bg-elevated)",border:"1px solid var(--border-hover)",borderRadius:8,padding:"8px 12px"},children:e.jsx(E,{className:s.compactBtnNoBorder,icon:e.jsx("span",{className:s.countryFlagIcon,children:this.state.countryFlag})})}),e.jsx(ae,{checked:ye==="light",onChange:y=>ve&&ve(y?"light":"dark"),checkedChildren:"雪山白",unCheckedChildren:"曜石黑"}),e.jsx(ue,{content:e.jsxs("div",{className:s.qrcodePopover,children:[e.jsxs("div",{className:s.qrcodeTitle,children:[l("ui.scanToCoding")," ",e.jsx(V,{doc:"QRCode"})]}),e.jsx(ss,{value:this.state.localUrl,size:200,bgColor:ye==="light"?"#ffffff":"#141414",fgColor:ye==="light"?"#1a1a1a":"#d9d9d9",level:"M"}),e.jsx(ie,{readOnly:!0,value:this.state.localUrl,className:s.qrcodeUrlInput,suffix:e.jsx(me,{className:s.qrcodeUrlCopy,onClick:()=>{navigator.clipboard.writeText(this.state.localUrl).then(()=>{H.success(l("ui.copied"))}).catch(()=>{})}})})]}),trigger:"hover",placement:"bottomRight",overlayInnerStyle:{background:"var(--bg-elevated)",border:"1px solid var(--border-hover)",borderRadius:8,padding:"8px 8px"},children:e.jsx(E,{className:s.compactBtnNoBorder,icon:e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor",style:{verticalAlign:"middle"},children:e.jsx("path",{fillRule:"evenodd",d:"M0 0h10v10H0zM2 2v6h6V2zM3 3h4v4H3zM14 0h10v10H14zM16 2v6h6V2zM17 3h4v4H17zM0 14h10v10H0zM2 16v6h6v-6zM3 17h4v4H3zM14 14h3v3h-3zM20 14h3v3h-3zM17 17h3v3h-3zM14 20h3v3h-3zM20 20h3v3h-3z"})})})})]}),O&&o==="chat"&&!g&&e.jsx(E,{className:s.compactBtn,type:$?"primary":"default",ghost:$,icon:e.jsx(Ne,{}),onClick:ne,children:l("ui.terminal")}),e.jsx(E,{className:s.compactBtn,type:o==="raw"?"primary":"default",icon:o==="raw"?e.jsx(vs,{}):e.jsx(Ce,{}),onClick:r,children:o==="raw"?l("ui.chatMode"):l("ui.rawMode")})]}),e.jsxs(X,{title:`${l("ui.userPrompt")} (${this.state.promptData.length}${l("ui.promptCountUnit")})`,open:this.state.promptModalVisible,onCancel:()=>this.setState({promptModalVisible:!1}),footer:null,width:700,children:[e.jsx("div",{className:s.promptExportBar,children:e.jsx(E,{icon:e.jsx(It,{}),onClick:this.handleExportPromptsTxt,children:l("ui.exportPromptsTxt")})}),e.jsx(gt,{activeKey:this.state.promptViewMode,onChange:y=>this.setState({promptViewMode:y}),size:"small",items:[{key:"original",label:l("ui.promptModeOriginal")},{key:"context",label:l("ui.promptModeContext")},{key:"text",label:l("ui.promptModeText")}]}),this.state.promptViewMode==="text"?e.jsx("textarea",{readOnly:!0,className:s.promptTextarea,value:this.buildTextModeContent()}):e.jsxs("div",{className:s.promptScrollArea,children:[this.state.promptData.length===0&&e.jsx("div",{className:s.promptEmpty,children:l("ui.noPrompt")}),this.state.promptData.map((y,U)=>{const he=y.timestamp?new Date(y.timestamp).toLocaleString():l("ui.unknownTime");return e.jsxs("div",{children:[e.jsxs("div",{className:s.promptTimestamp,children:[he,":"]}),this.state.promptViewMode==="original"?this.renderOriginalPrompt(y):this.renderTextPrompt(y)]},U)})]})]}),e.jsxs(Ee,{title:l("ui.settings"),placement:"left",width:360,open:this.state.settingsDrawerVisible,onClose:()=>this.setState({settingsDrawerVisible:!1}),children:[e.jsxs("div",{className:s.settingsGroupBox,children:[e.jsx("div",{className:s.settingsGroupTitle,children:l("ui.chatDisplaySwitches")}),e.jsxs("div",{className:s.settingsItem,children:[e.jsx("span",{className:s.settingsLabel,children:l("ui.collapseToolResults")}),e.jsx(ae,{checked:!!x,onChange:y=>C&&C(y)})]}),e.jsxs("div",{className:s.settingsItem,children:[e.jsx("span",{className:s.settingsLabel,children:l("ui.expandThinking")}),e.jsx(ae,{checked:!!j,onChange:y=>p&&p(y)})]}),e.jsxs("div",{className:s.settingsItem,children:[e.jsx("span",{className:s.settingsLabel,children:l("ui.showFullToolContent")}),e.jsx(ae,{checked:!!_,onChange:y=>b&&b(y)})]})]}),e.jsxs("div",{className:s.settingsGroupBox,children:[e.jsx("div",{className:s.settingsGroupTitle,children:l("ui.userPreferences")}),e.jsxs("div",{className:s.settingsItem,children:[e.jsx("span",{className:s.settingsLabel,children:l("ui.resumeAutoChoice")}),e.jsx(ae,{checked:!!Le,onChange:y=>Ve&&Ve(y)})]}),Le&&e.jsx("div",{className:s.settingsItem,children:e.jsxs(_e.Group,{value:Le,onChange:y=>Oe&&Oe(y.target.value),size:"small",children:[e.jsx(_e,{value:"continue",children:l("ui.resumeAutoChoice.continue")}),e.jsx(_e,{value:"new",children:l("ui.resumeAutoChoice.new")})]})}),e.jsxs("div",{className:s.settingsItem,children:[e.jsx("span",{className:s.settingsLabel,children:l("ui.permission.autoApprove.setting")}),e.jsx(le,{size:"small",value:kt||0,onChange:y=>Ue&&Ue(y),options:[{label:l("ui.permission.autoApprove.off"),value:0},{label:"3s",value:3},{label:"5s",value:5},{label:"10s",value:10},{label:"15s",value:15},{label:"20s",value:20},{label:"30s",value:30},{label:"60s",value:60}],style:{width:100}})]})]}),e.jsx("div",{className:s.settingsGroupBox,children:e.jsxs("div",{className:s.settingsItem,children:[e.jsx("span",{className:s.settingsLabel,children:l("ui.themeColor")}),e.jsx(le,{size:"small",value:ye||"dark",onChange:y=>ve&&ve(y),options:[{label:l("ui.themeColor.dark"),value:"dark"},{label:l("ui.themeColor.light"),value:"light"}],style:{width:140}})]})}),e.jsx("div",{className:s.settingsGroupBox,children:e.jsxs("div",{className:s.settingsItem,children:[e.jsx("span",{className:s.settingsLabel,children:l("ui.languageSettings")}),e.jsx(le,{size:"small",value:Kt(),onChange:y=>{Wt(y),u&&u()},options:Ss.map(y=>({label:y.label,value:y.value})),style:{width:140}})]})})]}),e.jsxs(Ee,{title:e.jsxs("span",{children:[l("ui.globalSettings")," ",e.jsx(V,{doc:"GlobalSettings"})]}),placement:"left",width:400,open:this.state.globalSettingsVisible,onClose:()=>this.setState({globalSettingsVisible:!1}),children:[e.jsxs("div",{className:s.settingsItem,children:[e.jsx("span",{className:s.settingsLabel,children:l("ui.filterIrrelevant")}),e.jsx(ae,{checked:!!S,onChange:y=>T&&T(y)})]}),e.jsxs("div",{className:s.settingsItem,children:[e.jsx("span",{className:s.settingsLabel,children:l("ui.expandDiff")}),e.jsx(ae,{checked:!!w,onChange:y=>L&&L(y)})]}),e.jsx("div",{className:s.settingsDivider}),e.jsx("div",{className:s.settingsLabel,children:l("ui.logDirTitle")}),e.jsx(ie,{className:s.logDirInput,value:this.state.logDirDraft??I,onChange:y=>this.setState({logDirDraft:y.target.value}),onBlur:()=>{const y=this.state.logDirDraft;y!=null&&y!==I&&(q==null||q(y)),this.setState({logDirDraft:null})},onPressEnter:()=>{const y=this.state.logDirDraft;y!=null&&y!==I&&(q==null||q(y)),this.setState({logDirDraft:null})},placeholder:"~/.claude/cc-viewer"})]}),e.jsx(Ee,{title:e.jsxs("span",{children:[e.jsx(dt,{className:s.titleIcon}),l("ui.projectStats")]}),placement:"left",width:400,open:this.state.projectStatsVisible,onClose:()=>this.setState({projectStatsVisible:!1}),children:this.renderProjectStatsContent()}),e.jsxs(X,{title:e.jsxs("span",{children:[e.jsx(ct,{className:s.titleIcon}),l("ui.pluginManagement")]}),open:this.state.pluginModalVisible,onCancel:()=>this.setState({pluginModalVisible:!1}),footer:e.jsxs("div",{className:s.pluginModalFooter,children:[e.jsxs("div",{className:s.pluginModalFooterLeft,children:[e.jsx(E,{icon:e.jsx(et,{}),onClick:this.handleAddPlugin,children:l("ui.plugins.add")}),e.jsx(E,{icon:e.jsx(ht,{}),onClick:this.handleShowCdnModal,children:l("ui.plugins.cdnInstall")})]}),e.jsx(E,{icon:e.jsx(Pe,{}),onClick:this.handleReloadPlugins,children:l("ui.plugins.reload")})]}),width:560,children:[this.state.pluginsDir&&e.jsxs("div",{className:s.pluginDirHint,children:[e.jsxs("span",{className:s.pluginDirLabel,children:[l("ui.plugins.pluginsDir"),":"]})," ",e.jsx("code",{className:s.pluginDirPath,onClick:()=>{navigator.clipboard.writeText(this.state.pluginsDir).then(()=>{H.success(l("ui.copied"))}).catch(()=>{})},children:this.state.pluginsDir})]}),this.state.pluginsList.length===0?e.jsxs("div",{className:s.pluginEmpty,children:[e.jsx("div",{className:s.pluginEmptyTitle,children:l("ui.plugins.empty")}),e.jsx("div",{className:s.pluginEmptyHint,children:l("ui.plugins.emptyHint")})]}):e.jsx("div",{className:s.pluginList,children:this.state.pluginsList.map(y=>e.jsxs("div",{className:s.pluginItem,children:[e.jsxs("div",{className:s.pluginInfo,children:[e.jsx("span",{className:s.pluginName,children:y.name}),e.jsx("span",{className:s.pluginFile,children:y.file}),y.hooks.length>0&&e.jsx("span",{className:s.pluginHooks,children:y.hooks.map(U=>e.jsx("span",{className:s.pluginHookTag,children:U},U))})]}),e.jsxs("div",{className:s.pluginActions,children:[e.jsx(ae,{size:"small",checked:y.enabled,onChange:U=>this.handleTogglePlugin(y.name,U)}),e.jsx(E,{type:"text",size:"small",danger:!0,icon:e.jsx(He,{}),onClick:()=>this.handleDeletePlugin(y.file,y.name)})]})]},y.file))})]}),e.jsx(X,{title:l("ui.plugins.delete"),open:this.state.deleteConfirmVisible,onCancel:()=>this.setState({deleteConfirmVisible:!1,deleteTarget:null}),onOk:this.handleDeletePluginConfirm,okType:"danger",okText:"OK",cancelText:"Cancel",children:e.jsx("p",{children:this.state.deleteTarget?l("ui.plugins.deleteConfirm",{name:this.state.deleteTarget.name}):""})}),e.jsx(X,{title:e.jsxs("span",{children:[e.jsx(ht,{className:s.titleIcon}),l("ui.plugins.cdnInstall")]}),open:this.state.cdnModalVisible,onCancel:this.handleCdnCancel,onOk:this.handleCdnInstall,confirmLoading:this.state.cdnLoading,okText:l("ui.plugins.cdnInstallBtn"),cancelText:l("ui.cancel"),width:480,children:e.jsxs("div",{children:[e.jsx("div",{className:s.cdnUrlLabel,children:l("ui.plugins.cdnUrl")}),e.jsx(ie,{placeholder:l("ui.plugins.cdnUrlPlaceholder"),value:this.state.cdnUrl,onChange:this.handleCdnUrlChange,onPressEnter:this.handleCdnInstall,className:s.cdnInput})]})}),e.jsx(X,{title:e.jsxs("span",{children:[e.jsx(Ae,{className:s.titleIcon}),l("ui.processManagement")]}),open:this.state.processModalVisible,onCancel:()=>this.setState({processModalVisible:!1}),footer:e.jsx(E,{icon:e.jsx(Pe,{}),onClick:this.fetchProcesses,loading:this.state.processLoading,children:l("ui.processManagement.refresh")}),width:780,children:e.jsx(Et,{dataSource:this.state.processList,rowKey:"pid",loading:this.state.processLoading,size:"middle",pagination:!1,columns:[{title:l("ui.processManagement.port"),dataIndex:"port",width:80,render:y=>y?e.jsx("a",{href:`${window.location.protocol}//127.0.0.1:${y}`,target:"_blank",rel:"noopener noreferrer",children:y}):""},{title:"PID",dataIndex:"pid",width:80},{title:l("ui.processManagement.command"),dataIndex:"command",ellipsis:!0},{title:l("ui.processManagement.startTime"),dataIndex:"startTime",width:200},{title:l("ui.processManagement.action"),width:100,render:(y,U)=>U.isCurrent?e.jsx(E,{size:"small",className:s.currentProcessBtn,children:l("ui.processManagement.current")}):e.jsx(E,{size:"small",danger:!0,onClick:()=>this.handleKillProcess(U.pid),children:l("ui.processManagement.kill")})}]})}),e.jsx(X,{title:e.jsxs("span",{children:[e.jsx(yt,{apiEndpoint:K("/api/open-profile-dir"),title:l("ui.proxy.openConfigDir"),size:16})," ",l("ui.proxySwitch")," ",e.jsx(V,{doc:"ProxySwitch",zIndex:1100})]}),open:this.state.proxyModalVisible,onCancel:()=>this.setState({proxyModalVisible:!1,editingProxy:null}),footer:null,width:520,children:this.renderProxyProfileList()})]})}renderProxyProfileList(){const t=this.props.proxyProfiles||[],i=this.props.activeProxyId||"max",{editingProxy:o,editForm:n}=this.state;return e.jsxs("div",{children:[e.jsxs("div",{className:s.proxyWarning,children:["⚠️ ",l("ui.proxy.maxWarning")]}),e.jsx("div",{className:s.proxyList,children:t.map(r=>{var m;return e.jsxs("div",{className:`${s.proxyItem} ${r.id===i?s.proxyItemActive:""}`,children:[e.jsxs("div",{className:s.proxyItemMain,onClick:()=>{if(r.id!==i){const u={active:r.id,profiles:t};this.props.onProxyProfileChange(u)}},children:[e.jsx(_e,{checked:r.id===i,style:{marginRight:8}}),e.jsxs("div",{className:s.proxyItemInfo,children:[e.jsxs("div",{className:s.proxyItemNameRow,children:[e.jsx("span",{className:s.proxyItemName,children:r.name}),r.id==="max"&&e.jsx(Y,{className:s.proxyBuiltinTag,children:l("ui.proxy.builtin")})]}),r.id==="max"&&this.props.defaultConfig&&e.jsxs("div",{className:s.proxyItemDetail,children:[(()=>{try{return new URL(this.props.defaultConfig.origin).host}catch{return this.props.defaultConfig.origin}})(),this.props.defaultConfig.authType?` · ${this.props.defaultConfig.authType}`:"",this.props.defaultConfig.apiKey?` · ${this.props.defaultConfig.apiKey}`:"",this.props.defaultConfig.model?` · ${this.props.defaultConfig.model}`:""]}),r.id!=="max"&&r.baseURL&&e.jsxs("div",{className:s.proxyItemDetail,children:[(()=>{try{return new URL(r.baseURL).host}catch{return r.baseURL}})(),r.activeModel?` · ${r.activeModel}`:(m=r.models)!=null&&m.length?` · ${r.models[0]}`:""]})]})]}),r.id!=="max"&&e.jsxs("div",{className:s.proxyItemActions,children:[e.jsx(E,{type:"text",size:"small",icon:e.jsx(Bt,{}),onClick:()=>this.setState({editingProxy:r.id,editForm:{name:r.name||"",baseURL:r.baseURL||"",apiKey:r.apiKey||"",models:(r.models||[]).join(", "),activeModel:r.activeModel||""}})}),e.jsx(E,{type:"text",size:"small",danger:!0,icon:e.jsx(He,{}),onClick:()=>{X.confirm({title:l("ui.proxy.deleteProxy"),content:l("ui.proxy.deleteConfirm",{name:r.name}),okType:"danger",onOk:()=>{const u=t.filter(h=>h.id!==r.id),g=i===r.id?"max":i;this.props.onProxyProfileChange({active:g,profiles:u})}})}})]})]},r.id)})}),o&&e.jsxs("div",{className:s.proxyEditForm,children:[e.jsxs("div",{className:s.proxyEditRow,children:[e.jsxs("label",{children:[l("ui.proxy.name")," ",e.jsx("span",{className:s.proxyRequired,children:"*"})]}),e.jsx(ie,{size:"small",value:n.name,onChange:r=>{const m=r.target.value;this.setState(u=>({editForm:{...u.editForm,name:m}}))}})]}),e.jsxs("div",{className:s.proxyEditRow,children:[e.jsxs("label",{children:[l("ui.proxy.baseURL")," ",e.jsx("span",{className:s.proxyRequired,children:"*"})]}),e.jsx(ie,{size:"small",value:n.baseURL,onChange:r=>{const m=r.target.value;this.setState(u=>({editForm:{...u.editForm,baseURL:m}}))},placeholder:"https://api.example.com"})]}),e.jsxs("div",{className:s.proxyEditRow,children:[e.jsxs("label",{children:[l("ui.proxy.apiKey")," ",e.jsx("span",{className:s.proxyRequired,children:"*"})]}),e.jsx(ie.Password,{size:"small",value:n.apiKey,onChange:r=>{const m=r.target.value;this.setState(u=>({editForm:{...u.editForm,apiKey:m}}))},placeholder:"sk-..."})]}),e.jsx("div",{className:s.proxyEditDivider}),e.jsxs("div",{className:s.proxyEditRow,children:[e.jsx("label",{children:l("ui.proxy.models")}),e.jsx(ie,{size:"small",value:n.models,onChange:r=>{const m=r.target.value;this.setState(u=>({editForm:{...u.editForm,models:m}}))},placeholder:"model-1, model-2"})]}),e.jsxs("div",{className:s.proxyEditRow,children:[e.jsx("label",{children:l("ui.proxy.activeModel")}),e.jsx(le,{size:"small",className:s.fullWidthSelect,value:n.activeModel||void 0,onChange:r=>this.setState(m=>({editForm:{...m.editForm,activeModel:r}})),placeholder:l("ui.proxy.activeModel"),children:(n.models||"").split(",").map(r=>r.trim()).filter(Boolean).map(r=>e.jsx(le.Option,{value:r,children:r},r))})]}),e.jsxs("div",{className:s.proxyEditBtns,children:[e.jsx(E,{size:"small",icon:e.jsx(Dt,{}),type:"primary",onClick:()=>{var g,h,d;if(!((g=n.name)!=null&&g.trim())||!((h=n.baseURL)!=null&&h.trim())||!((d=n.apiKey)!=null&&d.trim())){H.warning(l("ui.proxy.requiredFields"));return}const r=(n.models||"").split(",").map(x=>x.trim()).filter(Boolean),m={id:o==="__new__"?`proxy_${Date.now()}`:o,name:n.name.trim(),baseURL:n.baseURL.trim(),apiKey:n.apiKey.trim(),models:r,activeModel:n.activeModel||r[0]||""};let u;o==="__new__"?u=[...t,m]:u=t.map(x=>x.id===o?{...x,...m,id:x.id}:x),this.props.onProxyProfileChange({active:i,profiles:u}),this.setState({editingProxy:null})},children:l("ui.proxy.save")}),e.jsx(E,{size:"small",icon:e.jsx(At,{}),onClick:()=>this.setState({editingProxy:null}),children:l("ui.proxy.cancel")})]})]}),!o&&e.jsx(E,{block:!0,type:"dashed",icon:e.jsx(et,{}),style:{marginTop:12},onClick:()=>this.setState({editingProxy:"__new__",editForm:{name:"",baseURL:"",apiKey:"",models:"",activeModel:""}}),children:l("ui.proxy.addProxy")})]})}};M(oe,"COMMAND_TAGS",new Set(["command-name","command-message","command-args","local-command-caveat","local-command-stdout"]));let ke=oe;const Ts="_centerEmpty_midza_1",ws="_scrollContainer_midza_8",Ms="_listItem_midza_15",Ls="_listItemActive_midza_29",Rs="_itemContent_midza_46",Is="_itemHeader_midza_51",Es="_tagNoMargin_midza_59",Bs="_modelName_midza_64",Ds="_modelNameMain_midza_69",As="_time_midza_73",Fs="_detailRow_midza_79",Hs="_urlText_midza_86",Ps="_duration_midza_95",qs="_statusOk_midza_100",zs="_statusErr_midza_106",$s="_statusDefault_midza_111",Vs="_usageBox_midza_116",Os="_cacheDot_midza_126",Us="_cacheDotLoss_midza_135",Ws="_cacheDotNormal_midza_140",Ks="_tagMainAgent_midza_144",Js="_tagPlan_midza_150",Gs="_tagMuted_midza_156",Qs="_tooltipPreLine_midza_162",D={centerEmpty:Ts,scrollContainer:ws,listItem:Ms,listItemActive:Ls,itemContent:Rs,itemHeader:Is,tagNoMargin:Es,modelName:Bs,modelNameMain:Ds,time:As,detailRow:Fs,urlText:Hs,duration:Ps,statusOk:qs,statusErr:zs,statusDefault:$s,usageBox:Vs,cacheDot:Os,cacheDotLoss:Us,cacheDotNormal:Ws,tagMainAgent:Ks,tagPlan:Js,tagMuted:Gs,tooltipPreLine:Qs};class Xs extends ge.Component{constructor(t){super(t);M(this,"handleKeyDown",t=>{if(t.key!=="ArrowUp"&&t.key!=="ArrowDown")return;const{requests:i,selectedIndex:o,onSelect:n}=this.props;if(!i.length)return;t.preventDefault();const r=o??0,m=t.key==="ArrowUp"?Math.max(0,r-1):Math.min(i.length-1,r+1);m!==r&&n(m)});this.activeItemRef=ge.createRef()}componentDidMount(){this.scrollToSelected(!0)}shouldComponentUpdate(t){return t.requests!==this.props.requests||t.selectedIndex!==this.props.selectedIndex||t.scrollCenter!==this.props.scrollCenter||t.cacheLossMap!==this.props.cacheLossMap}componentDidUpdate(t){this.props.scrollCenter&&t.selectedIndex!==this.props.selectedIndex?this.scrollToSelected(!0):t.selectedIndex!==this.props.selectedIndex&&(this.scrollToSelected(!1),this.activeItemRef.current&&this.activeItemRef.current.focus({preventScroll:!0}))}scrollToSelected(t){this.activeItemRef.current&&(this.activeItemRef.current.scrollIntoView({block:t?"center":"nearest",behavior:"instant"}),t&&this.props.onScrollDone&&this.props.onScrollDone())}render(){const{requests:t,selectedIndex:i,onSelect:o}=this.props;return t.length===0?e.jsx("div",{className:D.centerEmpty,children:e.jsx(re,{description:l("ui.waitingRequests")})}):e.jsx("div",{className:D.scrollContainer,onKeyDown:this.handleKeyDown,children:e.jsx(tt,{dataSource:t,size:"small",split:!1,renderItem:(n,r)=>{var T,I,q;const m=new Date(n.timestamp).toLocaleTimeString("zh-CN"),u=r===i,g=n.response&&n.response.status<400,h=n.response&&n.response.status>=400,d=Jt((T=n.body)==null?void 0:T.model),x=r+1<t.length?t[r+1]:null,{type:C,subType:j}=je(n,x),p=(q=(I=n.response)==null?void 0:I.body)==null?void 0:q.usage,_=p?(p.input_tokens||0)+(p.cache_read_input_tokens||0)+(p.cache_creation_input_tokens||0):null,b=(p==null?void 0:p.output_tokens)||null,w=(p==null?void 0:p.cache_read_input_tokens)||0,L=(p==null?void 0:p.cache_creation_input_tokens)||0;let S=n.url;try{const z=new URL(n.url);S=z.host+z.pathname}catch{}return e.jsx(tt.Item,{ref:u?this.activeItemRef:void 0,tabIndex:0,onClick:()=>o(r),className:`${D.listItem} ${u?D.listItemActive:""}`,children:e.jsxs("div",{className:D.itemContent,children:[e.jsxs("div",{className:D.itemHeader,children:[C==="MainAgent"?e.jsx(Y,{className:`${D.tagNoMargin} ${D.tagMainAgent}`,children:"MainAgent"}):C==="Plan"?e.jsx(Y,{className:`${D.tagNoMargin} ${D.tagPlan}`,children:at(C,j)}):C==="Count"||C==="Preflight"?e.jsx(Y,{className:`${D.tagNoMargin} ${D.tagMuted}`,children:C}):e.jsx(Y,{className:D.tagNoMargin,children:at(C,j)}),d&&e.jsx("span",{className:`${D.modelName} ${C==="MainAgent"?D.modelNameMain:""}`,children:d}),e.jsx("span",{className:D.time,children:m})]}),e.jsxs("div",{className:D.detailRow,children:[e.jsx("span",{className:D.urlText,title:n.url,children:S}),n.duration&&e.jsxs("span",{className:D.duration,children:[n.duration,"ms"]}),n.response&&e.jsx("span",{className:g?D.statusOk:h?D.statusErr:D.statusDefault,children:n.response.status})]}),p&&e.jsxs("div",{className:D.usageBox,children:[e.jsxs("div",{children:["token: output:",F(b)||0,", input: ",F(_)||0]}),(w>0||L>0)&&e.jsx("div",{children:(()=>{var $;const z=($=this.props.cacheLossMap)==null?void 0:$.get(r),R={ttl:"ui.cacheLoss.ttl",system_change:"ui.cacheLoss.systemChange",tools_change:"ui.cacheLoss.toolsChange",model_change:"ui.cacheLoss.modelChange",msg_truncated:"ui.cacheLoss.msgTruncated",msg_modified:"ui.cacheLoss.msgModified",key_change:"ui.cacheLoss.keyChange"};let O;if(z){const xe=(z.reasons||[z.reason]).map(P=>l(R[P]||R.key_change)).join(`
|
|
19
|
+
`);O=e.jsx(xt,{title:e.jsx("span",{className:D.tooltipPreLine,children:xe}),children:e.jsx("span",{className:`${D.cacheDot} ${D.cacheDotLoss}`})})}else O=e.jsx("span",{className:`${D.cacheDot} ${D.cacheDotNormal}`});return e.jsxs(e.Fragment,{children:["cache",O,": ",w>0?`read:${F(w)}`:"",w>0&&L>0?", ":"",L>0?`create:${F(L)}`:""]})})()})]})]})})}})})}}const Ys=c=>typeof c=="boolean"||c instanceof Boolean,Zs=c=>typeof c=="number"||c instanceof Number,ea=c=>typeof c=="bigint"||c instanceof BigInt,_t=c=>!!c&&c instanceof Date,ta=c=>typeof c=="string"||c instanceof String,sa=c=>Array.isArray(c),bt=c=>typeof c=="object"&&c!==null,Ct=c=>!!c&&c instanceof Object&&typeof c=="function";function Te(c,a){return a===void 0&&(a=!1),!c||a?`"${c}"`:c}function aa(c,a,t){return t?JSON.stringify(c):a?`"${c}"`:c}function Nt(c){let{field:a,value:t,data:i,lastElement:o,openBracket:n,closeBracket:r,level:m,style:u,shouldExpandNode:g,clickToExpandNode:h,outerRef:d,beforeExpandChange:x}=c;const C=N.useRef(!1),[j,p]=N.useState(()=>g(m,t,a)),_=N.useRef(null);N.useEffect(()=>{C.current?p(g(m,t,a)):C.current=!0},[g]);const b=N.useId();if(i.length===0)return na({field:a,openBracket:n,closeBracket:r,lastElement:o,style:u});const w=j?u.collapseIcon:u.expandIcon,L=j?u.ariaLables.collapseJson:u.ariaLables.expandJson,S=m+1,T=i.length-1,I=R=>{j!==R&&(!x||x({level:m,value:t,field:a,newExpandValue:R}))&&p(R)},q=R=>{if(R.key==="ArrowRight"||R.key==="ArrowLeft")R.preventDefault(),I(R.key==="ArrowRight");else if(R.key==="ArrowUp"||R.key==="ArrowDown"){R.preventDefault();const O=R.key==="ArrowUp"?-1:1;if(!d.current)return;const $=d.current.querySelectorAll("[role=button]");let ne=-1;for(let P=0;P<$.length;P++)if($[P].tabIndex===0){ne=P;break}if(ne<0)return;const xe=(ne+O+$.length)%$.length;$[ne].tabIndex=-1,$[xe].tabIndex=0,$[xe].focus()}},z=()=>{var R;I(!j);const O=_.current;if(!O)return;const $=(R=d.current)===null||R===void 0?void 0:R.querySelector('[role=button][tabindex="0"]');$&&($.tabIndex=-1),O.tabIndex=0,O.focus()};return N.createElement("div",{className:u.basicChildStyle,role:"treeitem","aria-expanded":j,"aria-selected":void 0},N.createElement("span",{className:w,onClick:z,onKeyDown:q,role:"button","aria-label":L,"aria-expanded":j,"aria-controls":j?b:void 0,ref:_,tabIndex:m===0?0:-1}),(a||a==="")&&(h?N.createElement("span",{className:u.clickableLabel,onClick:z,onKeyDown:q},Te(a,u.quotesForFieldNames),":"):N.createElement("span",{className:u.label},Te(a,u.quotesForFieldNames),":")),N.createElement("span",{className:u.punctuation},n),j?N.createElement("ul",{id:b,role:"group",className:u.childFieldsContainer},i.map((R,O)=>N.createElement(qe,{key:R[0]||O,field:R[0],value:R[1],style:u,lastElement:O===T,level:S,shouldExpandNode:g,clickToExpandNode:h,beforeExpandChange:x,outerRef:d}))):N.createElement("span",{className:u.collapsedContent,onClick:z,onKeyDown:q}),N.createElement("span",{className:u.punctuation},r),!o&&N.createElement("span",{className:u.punctuation},","))}function na(c){let{field:a,openBracket:t,closeBracket:i,lastElement:o,style:n}=c;return N.createElement("div",{className:n.basicChildStyle,role:"treeitem","aria-selected":void 0},(a||a==="")&&N.createElement("span",{className:n.label},Te(a,n.quotesForFieldNames),":"),N.createElement("span",{className:n.punctuation},t),N.createElement("span",{className:n.punctuation},i),!o&&N.createElement("span",{className:n.punctuation},","))}function ia(c){let{field:a,value:t,style:i,lastElement:o,shouldExpandNode:n,clickToExpandNode:r,level:m,outerRef:u,beforeExpandChange:g}=c;return Nt({field:a,value:t,lastElement:o||!1,level:m,openBracket:"{",closeBracket:"}",style:i,shouldExpandNode:n,clickToExpandNode:r,data:Object.keys(t).map(h=>[h,t[h]]),outerRef:u,beforeExpandChange:g})}function la(c){let{field:a,value:t,style:i,lastElement:o,level:n,shouldExpandNode:r,clickToExpandNode:m,outerRef:u,beforeExpandChange:g}=c;return Nt({field:a,value:t,lastElement:o||!1,level:n,openBracket:"[",closeBracket:"]",style:i,shouldExpandNode:r,clickToExpandNode:m,data:t.map(h=>[void 0,h]),outerRef:u,beforeExpandChange:g})}function oa(c){let{field:a,value:t,style:i,lastElement:o}=c,n,r=i.otherValue;return t===null?(n="null",r=i.nullValue):t===void 0?(n="undefined",r=i.undefinedValue):ta(t)?(n=aa(t,!i.noQuotesForStringValues,i.stringifyStringValues),r=i.stringValue):Ys(t)?(n=t?"true":"false",r=i.booleanValue):Zs(t)?(n=t.toString(),r=i.numberValue):ea(t)?(n=`${t.toString()}n`,r=i.numberValue):_t(t)?n=t.toISOString():Ct(t)?n="function() { }":n=t.toString(),N.createElement("div",{className:i.basicChildStyle,role:"treeitem","aria-selected":void 0},(a||a==="")&&N.createElement("span",{className:i.label},Te(a,i.quotesForFieldNames),":"),N.createElement("span",{className:r},n),!o&&N.createElement("span",{className:i.punctuation},","))}function qe(c){const a=c.value;return sa(a)?N.createElement(la,Object.assign({},c)):bt(a)&&!_t(a)&&!Ct(a)?N.createElement(ia,Object.assign({},c)):N.createElement(oa,Object.assign({},c))}var B={"container-light":"_2IvMF _GzYRV","basic-element-style":"_2bkNM","child-fields-container":"_1BXBN","label-light":"_1MGIk","clickable-label-light":"_2YKJg _1MGIk _1MFti","punctuation-light":"_3uHL6 _3eOF8","value-null-light":"_2T6PJ","value-undefined-light":"_1Gho6","value-string-light":"_vGjyY","value-number-light":"_1bQdo","value-boolean-light":"_3zQKs","value-other-light":"_1xvuR","collapse-icon-light":"_oLqym _f10Tu _1MFti _1LId0","expand-icon-light":"_2AXVT _f10Tu _1MFti _1UmXx","collapsed-content-light":"_2KJWg _1pNG9 _1MFti","container-dark":"_11RoI _GzYRV","expand-icon-dark":"_17H2C _f10Tu _1MFti _1UmXx","collapse-icon-dark":"_3QHg2 _f10Tu _1MFti _1LId0","collapsed-content-dark":"_3fDAz _1pNG9 _1MFti","label-dark":"_2bSDX","clickable-label-dark":"_1RQEj _2bSDX _1MFti","punctuation-dark":"_gsbQL _3eOF8","value-null-dark":"_LaAZe","value-undefined-dark":"_GTKgm","value-string-dark":"_Chy1W","value-number-dark":"_2bveF","value-boolean-dark":"_2vRm-","value-other-dark":"_1prJR"};const St={collapseJson:"collapse JSON",expandJson:"expand JSON"},Se={container:B["container-light"],basicChildStyle:B["basic-element-style"],childFieldsContainer:B["child-fields-container"],label:B["label-light"],clickableLabel:B["clickable-label-light"],nullValue:B["value-null-light"],undefinedValue:B["value-undefined-light"],stringValue:B["value-string-light"],booleanValue:B["value-boolean-light"],numberValue:B["value-number-light"],otherValue:B["value-other-light"],punctuation:B["punctuation-light"],collapseIcon:B["collapse-icon-light"],expandIcon:B["expand-icon-light"],collapsedContent:B["collapsed-content-light"],noQuotesForStringValues:!1,quotesForFieldNames:!1,ariaLables:St,stringifyStringValues:!1},ra={container:B["container-dark"],basicChildStyle:B["basic-element-style"],childFieldsContainer:B["child-fields-container"],label:B["label-dark"],clickableLabel:B["clickable-label-dark"],nullValue:B["value-null-dark"],undefinedValue:B["value-undefined-dark"],stringValue:B["value-string-dark"],booleanValue:B["value-boolean-dark"],numberValue:B["value-number-dark"],otherValue:B["value-other-dark"],punctuation:B["punctuation-dark"],collapseIcon:B["collapse-icon-dark"],expandIcon:B["expand-icon-dark"],collapsedContent:B["collapsed-content-dark"],noQuotesForStringValues:!1,quotesForFieldNames:!1,ariaLables:St,stringifyStringValues:!1},ca=()=>!0,da=c=>{let{data:a,style:t=Se,shouldExpandNode:i=ca,clickToExpandNode:o=!1,beforeExpandChange:n,compactTopLevel:r,...m}=c;const u=N.useRef(null);return N.createElement("div",Object.assign({"aria-label":"JSON view"},m,{className:t.container,ref:u,role:"tree"}),r&&bt(a)?Object.entries(a).map(g=>{let[h,d]=g;return N.createElement(qe,{key:h,field:h,value:d,style:{...Se,...t},lastElement:!0,level:1,shouldExpandNode:i,clickToExpandNode:o,beforeExpandChange:n,outerRef:u})}):N.createElement(qe,{value:a,style:{...Se,...t},lastElement:!0,level:0,shouldExpandNode:i,clickToExpandNode:o,outerRef:u,beforeExpandChange:n}))},ha="_container_qeuid_1",ua={container:ha};class we extends ge.Component{shouldComponentUpdate(a){return a.data!==this.props.data||a.defaultExpand!==this.props.defaultExpand||a.expandNode!==this.props.expandNode}render(){const{data:a,defaultExpand:t,expandNode:i}=this.props,n={...typeof document<"u"&&document.documentElement.getAttribute("data-theme")!=="light"?ra:Se,container:"rjv-container"};if(a==null)return null;const r=typeof i=="function"?i:t==="all"?()=>!0:t==="root"?m=>m<2:m=>m<1;return e.jsx("div",{className:ua.container,children:e.jsx(da,{data:a,shouldExpandNode:r,style:n})})}}function ma({currentId:c,visibleIds:a=[],key:t}){if(t!=="ArrowUp"&&t!=="ArrowDown")return null;const i=a.findIndex(n=>n===c),o=t==="ArrowUp"?-1:1;return i>=0?a[i+o]??null:null}const pa="_root_17dqd_1",ga="_sidebar_17dqd_9",xa="_section_17dqd_18",fa="_sectionHeader_17dqd_22",ja="_arrow_17dqd_48",ya="_sectionTitle_17dqd_54",va="_sectionCount_17dqd_62",_a="_sectionBody_17dqd_71",ba="_historyToggle_17dqd_76",Ca="_historyToggleLabel_17dqd_102",Na="_item_17dqd_107",Sa="_itemActive_17dqd_135",ka="_itemContent_17dqd_142",Ta="_itemLabel_17dqd_148",wa="_itemSublabel_17dqd_156",Ma="_itemTime_17dqd_165",La="_content_17dqd_174",Ra="_contentEmpty_17dqd_182",Ia="_contentInner_17dqd_189",Ea="_emptyWrap_17dqd_193",Ba="_roleHeader_17dqd_201",Da="_roleBadge_17dqd_209",Aa="_role_user_17dqd_218",Fa="_role_assistant_17dqd_224",Ha="_roleLabel_17dqd_230",Pa="_contentTime_17dqd_237",qa="_turnDivider_17dqd_245",za="_textBlock_17dqd_252",$a="_textBlockBar_17dqd_259",Va="_textBlockBody_17dqd_268",Oa="_textBlockCompact_17dqd_276",Ua="_textBlockCompactFloat_17dqd_283",Wa="_thinkingBlock_17dqd_290",Ka="_thinkingHeader_17dqd_298",Ja="_thinkingPreview_17dqd_313",Ga="_thinkingBody_17dqd_323",Qa="_toolBlock_17dqd_329",Xa="_toolBlockResult_17dqd_336",Ya="_toolBlockError_17dqd_340",Za="_toolBlockHeader_17dqd_344",en="_toolBlockBody_17dqd_355",tn="_toolName_17dqd_360",sn="_toolId_17dqd_366",an="_errorLabel_17dqd_373",nn="_blockTag_17dqd_383",ln="_blockTagText_17dqd_396",on="_blockTagThinking_17dqd_402",rn="_blockTagResult_17dqd_408",cn="_blockTagError_17dqd_414",dn="_jsonBlock_17dqd_421",hn="_jsonBlockLabel_17dqd_428",un="_blockSeparator_17dqd_438",mn="_markdownBody_17dqd_445",v={root:pa,sidebar:ga,section:xa,sectionHeader:fa,arrow:ja,sectionTitle:ya,sectionCount:va,sectionBody:_a,historyToggle:ba,historyToggleLabel:Ca,item:Na,itemActive:Sa,itemContent:ka,itemLabel:Ta,itemSublabel:wa,itemTime:Ma,content:La,contentEmpty:Ra,contentInner:Ia,emptyWrap:Ea,roleHeader:Ba,roleBadge:Da,role_user:Aa,role_assistant:Fa,roleLabel:Ha,contentTime:Pa,turnDivider:qa,textBlock:za,textBlockBar:$a,textBlockBody:Va,textBlockCompact:Oa,textBlockCompactFloat:Ua,thinkingBlock:Wa,thinkingHeader:Ka,thinkingPreview:Ja,thinkingBody:Ga,toolBlock:Qa,toolBlockResult:Xa,toolBlockError:Ya,toolBlockHeader:Za,toolBlockBody:en,toolName:tn,toolId:sn,errorLabel:an,blockTag:nn,blockTagText:ln,blockTagThinking:on,blockTagResult:rn,blockTagError:cn,jsonBlock:dn,jsonBlockLabel:hn,blockSeparator:un,markdownBody:mn},{Text:pn}=ft;function ze(c){if(c==null)return[];if(typeof c=="string"){const a=c.trim();return a?[{type:"markdown",text:a}]:[]}if(Array.isArray(c)){const a=[];for(const t of c)if(t)if(t.type==="text"){const i=(t.text||"").trim();i&&a.push({type:"markdown",text:i})}else if(t.type==="tool_use")a.push({type:"tool_use",name:t.name||"unknown",id:t.id||"",input:t.input??{}});else if(t.type==="tool_result"){const i=gn(t.content);a.push({type:"tool_result",tool_use_id:t.tool_use_id||"",is_error:t.is_error,content:i})}else if(t.type==="thinking"){const i=t.thinking||"";i.trim()&&a.push({type:"thinking",text:i})}else t.type==="image"?a.push({type:"json",label:"image",data:t}):a.push({type:"json",label:t.type||"block",data:t});return a}return[{type:"json",label:"content",data:c}]}function gn(c){if(c==null)return[];if(typeof c=="string"){const a=c.trim();return a?[{type:"markdown",text:a}]:[]}return Array.isArray(c)?c.flatMap(a=>{if(!a)return[];if(a.type==="text"){const t=(a.text||"").trim();return t?[{type:"markdown",text:t}]:[]}return[{type:"json",label:a.type||"block",data:a}]}):[{type:"json",label:"content",data:c}]}function xn(c){if(!c)return null;if(typeof c=="string")return[{type:"markdown",text:c}];if(Array.isArray(c)){const a=[];return c.forEach((t,i)=>{i>0&&a.push({type:"separator"}),t&&(typeof t=="string"?a.push({type:"markdown",text:t}):t.type==="text"?a.push({type:"markdown",text:t.text||""}):a.push({type:"json",label:t.type||"item",data:t}))}),a}return[{type:"json",label:"system",data:c}]}function fn(c){const a=[],t=(c==null?void 0:c.name)||"unknown",i=(c==null?void 0:c.description)||"";let o=`### ${t}
|
|
20
|
+
|
|
21
|
+
`;i&&(o+=`${i}
|
|
22
|
+
|
|
23
|
+
`),a.push({type:"markdown",text:o});const n=(c==null?void 0:c.input_schema)||(c==null?void 0:c.parameters)||null;return n&&a.push({type:"json",label:"Parameters",data:n}),a}function jn(c){var a;if(typeof c=="string")return c.slice(0,60).replace(/\n/g," ");if(Array.isArray(c)){for(const t of c)if((t==null?void 0:t.type)==="text"&&((a=t.text)!=null&&a.trim()))return t.text.trim().slice(0,60).replace(/\n/g," ")}return""}function yn(c){var i;const a=[];let t=0;for(;t<c.length;){const o=c[t];if((o==null?void 0:o.role)!=="user"){t++;continue}const n=((i=c[t+1])==null?void 0:i.role)==="assistant"?c[t+1]:null;a.push({id:`turn__${t}`,isTurn:!0,turnIndex:a.length,timestamp:o._timestamp||null,assistantTimestamp:(n==null?void 0:n._timestamp)||null,userBlocks:ze(o==null?void 0:o.content),assistantBlocks:n?ze(n.content):null,preview:jn(o==null?void 0:o.content)}),t+=n?2:1}return a}function $e(c){try{return new Date(c).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}catch{return null}}function vn({text:c,compact:a}){const t=vt(c);return a?e.jsx("div",{className:v.textBlockCompact,children:e.jsx("div",{className:`chat-md ${v.markdownBody}`,dangerouslySetInnerHTML:{__html:t}})}):e.jsxs("div",{className:v.textBlock,children:[e.jsx("div",{className:v.textBlockBar,children:e.jsx("span",{className:`${v.blockTag} ${v.blockTagText}`,children:"text"})}),e.jsx("div",{className:`chat-md ${v.textBlockBody}`,dangerouslySetInnerHTML:{__html:t}})]})}function _n({block:c}){const[a,t]=N.useState(!0),i=c.text.length>60?c.text.slice(0,60).replace(/\n/g," ")+"…":c.text.replace(/\n/g," ");return e.jsxs("div",{className:v.thinkingBlock,children:[e.jsxs("div",{className:v.thinkingHeader,onClick:()=>t(o=>!o),children:[a?e.jsx(ce,{className:v.arrow}):e.jsx(de,{className:v.arrow}),e.jsx("span",{className:`${v.blockTag} ${v.blockTagThinking}`,children:"thinking"}),!a&&e.jsx("span",{className:v.thinkingPreview,children:i})]}),a&&e.jsx("div",{className:v.thinkingBody,children:e.jsx("div",{className:`chat-md ${v.markdownBody}`,dangerouslySetInnerHTML:{__html:vt(c.text)}})})]})}function Me({blocks:c,compact:a}){return!c||c.length===0?null:e.jsx(e.Fragment,{children:c.map((t,i)=>e.jsx(bn,{block:t,compact:a},i))})}function bn({block:c,compact:a}){var t;return c.type==="separator"?e.jsx("hr",{className:v.blockSeparator}):c.type==="markdown"?(t=c.text)!=null&&t.trim()?e.jsx(vn,{text:c.text,compact:a}):null:c.type==="thinking"?e.jsx(_n,{block:c}):c.type==="tool_use"?e.jsxs("div",{className:v.toolBlock,children:[e.jsxs("div",{className:v.toolBlockHeader,children:[e.jsx("span",{className:v.blockTag,children:"tool_use"}),e.jsx("span",{className:v.toolName,children:c.name}),c.id&&e.jsx("span",{className:v.toolId,children:c.id})]}),e.jsx("div",{className:v.toolBlockBody,children:e.jsx(we,{data:c.input,defaultExpand:"root"})})]}):c.type==="tool_result"?e.jsxs("div",{className:`${v.toolBlock} ${c.is_error?v.toolBlockError:v.toolBlockResult}`,children:[e.jsxs("div",{className:v.toolBlockHeader,children:[e.jsx("span",{className:`${v.blockTag} ${c.is_error?v.blockTagError:v.blockTagResult}`,children:"tool_result"}),c.tool_use_id&&e.jsx("span",{className:v.toolId,children:c.tool_use_id}),c.is_error&&e.jsx("span",{className:v.errorLabel,children:"error"})]}),e.jsx("div",{className:v.toolBlockBody,children:e.jsx(Me,{blocks:c.content,compact:!0})})]}):c.type==="json"?e.jsxs("div",{className:v.jsonBlock,children:[c.label&&e.jsx("div",{className:v.jsonBlockLabel,children:c.label}),e.jsx(we,{data:c.data,defaultExpand:"root"})]}):null}function Cn({turn:c}){const a=c.timestamp?$e(c.timestamp):null,t=c.assistantTimestamp?$e(c.assistantTimestamp):null;return e.jsxs("div",{children:[e.jsxs("div",{className:v.roleHeader,children:[e.jsx("span",{className:`${v.roleBadge} ${v.role_user}`,children:"user"}),e.jsx("span",{className:v.roleLabel,children:`Turn ${c.turnIndex+1}`}),a&&e.jsx("span",{className:v.contentTime,children:a})]}),e.jsx(Me,{blocks:c.userBlocks}),c.assistantBlocks&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:v.turnDivider}),e.jsxs("div",{className:v.roleHeader,children:[e.jsx("span",{className:`${v.roleBadge} ${v.role_assistant}`,children:"assistant"}),t&&e.jsx("span",{className:v.contentTime,children:t})]}),e.jsx(Me,{blocks:c.assistantBlocks})]})]})}function Nn({sectionKey:c,title:a,items:t,historyItems:i=[],onSelect:o,onSelectById:n,selectedId:r,sidebarRef:m}){const[u,g]=N.useState(c!=="tools"),[h,d]=N.useState(!1),x=t.length+i.length,C=`${c}__history_toggle`;function j(b){var L;const w=(L=m.current)==null?void 0:L.querySelector(`[data-context-sidebar-control="${b}"]`);w&&(w.focus(),w.scrollIntoView({block:"nearest"}))}function p(b,w){var T;const L=Array.from(((T=m.current)==null?void 0:T.querySelectorAll("[data-context-sidebar-control]"))||[]).map(I=>I.dataset.contextSidebarControl).filter(Boolean),S=ma({currentId:w,visibleIds:L,key:b.key});S&&(b.preventDefault(),typeof window<"u"&&window.requestAnimationFrame(()=>{var q;j(S);const I=(q=m.current)==null?void 0:q.querySelector(`[data-context-sidebar-control="${S}"]`);(I==null?void 0:I.dataset.controlType)==="item"&&n(S)}))}function _(b){const w=r===b.id;return e.jsxs("button",{type:"button",className:`${v.item} ${w?v.itemActive:""}`,onClick:()=>o(b),onKeyDown:L=>p(L,b.id),"aria-current":w?"true":void 0,"data-context-sidebar-control":b.id,"data-control-type":"item",children:[e.jsxs("div",{className:v.itemContent,children:[e.jsx("span",{className:v.itemLabel,children:b.label}),b.sublabel&&!w&&e.jsx("div",{className:v.itemSublabel,children:b.sublabel})]}),b.time&&e.jsx("span",{className:v.itemTime,children:b.time})]},b.id)}return e.jsxs("div",{className:v.section,children:[e.jsxs("button",{type:"button",className:v.sectionHeader,onClick:()=>g(b=>!b),"aria-expanded":u,children:[u?e.jsx(ce,{className:v.arrow}):e.jsx(de,{className:v.arrow}),e.jsx("span",{className:v.sectionTitle,children:a}),e.jsx("span",{className:v.sectionCount,children:x})]}),u&&e.jsxs("div",{className:v.sectionBody,children:[i.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:v.historyToggle,onClick:()=>d(b=>!b),onKeyDown:b=>p(b,C),"aria-expanded":h,"data-context-sidebar-control":C,"data-control-type":"toggle",children:[h?e.jsx(ce,{className:v.arrow}):e.jsx(de,{className:v.arrow}),e.jsxs("span",{className:v.historyToggleLabel,children:[l("ui.context.history")," (",i.length,")"]})]}),h&&i.map(_)]}),t.map(_)]})]})}function Sn({body:c,response:a}){const[t,i]=N.useState(null),o=N.useRef(null),n=N.useMemo(()=>{if(!Array.isArray(c==null?void 0:c.messages))return[];const h=yn(c.messages);if(h.length===0)return h;const d=h[h.length-1],x=a!=null&&a.content?ze(a.content):null;return[...h.slice(0,-1),{...d,assistantBlocks:x??d.assistantBlocks}]},[c,a]);if(N.useEffect(()=>{n.length>0?i(n[n.length-1]):i(null)},[c,a]),!c||typeof c!="object")return e.jsx("div",{className:v.emptyWrap,children:e.jsx(re,{description:l("ui.context.noData")})});const r=[];Array.isArray(c.tools)&&c.tools.length>0&&r.push({key:"tools",title:e.jsxs(e.Fragment,{children:[l("ui.context.tools")," ",e.jsx(V,{doc:"ToolsFirst"})]}),items:c.tools.map((h,d)=>({id:`tool__${d}`,label:(h==null?void 0:h.name)||`Tool ${d}`,blocks:fn(h)}))});const m=xn(c.system);if(m!=null&&r.push({key:"system",title:l("ui.context.systemPrompt"),items:[{id:"system__0",label:l("ui.context.systemPrompt"),blocks:m}]}),n.length>0){const h=j=>({...j,label:l("ui.context.historyTurnNoTime",{n:j.turnIndex+1}),time:j.timestamp?$e(j.timestamp):null,sublabel:j.preview||void 0}),d=j=>({...j,label:l("ui.context.currentTurn"),sublabel:j.preview||void 0}),x=n.slice(0,-1).map(h),C=d(n[n.length-1]);r.push({key:"messages",title:l("ui.context.messages"),historyItems:x.length>0?x:void 0,items:[C]})}if(r.length===0)return e.jsx("div",{className:v.emptyWrap,children:e.jsx(re,{description:l("ui.context.noFields")})});const u=t!=null&&t.isTurn?n.find(h=>h.id===t.id)??null:t,g=new Map;return r.forEach(h=>{(h.historyItems||[]).forEach(d=>g.set(d.id,d)),h.items.forEach(d=>g.set(d.id,d))}),e.jsxs("div",{className:v.root,children:[e.jsx("div",{ref:o,className:v.sidebar,children:r.map(h=>e.jsx(Nn,{sectionKey:h.key,title:h.title,items:h.items,historyItems:h.historyItems,selectedId:u==null?void 0:u.id,onSelect:d=>i(d),onSelectById:d=>{const x=g.get(d);x&&i(x)},sidebarRef:o},h.key))}),e.jsx("div",{className:v.content,children:u==null?e.jsx("div",{className:v.contentEmpty,children:e.jsx(pn,{type:"secondary",children:l("ui.context.selectPrompt")})}):e.jsx("div",{className:v.contentInner,children:u.isTurn?e.jsx(Cn,{turn:u}):e.jsxs(e.Fragment,{children:[u.role&&e.jsxs("div",{className:v.roleHeader,children:[e.jsx("span",{className:`${v.roleBadge} ${v[`role_${u.role}`]||""}`,children:u.role}),e.jsx("span",{className:v.roleLabel,children:u.label})]}),e.jsx(Me,{blocks:u.blocks})]})},u.id)})]})}const kn="_container_rg6mx_1",Tn="_emptyState_rg6mx_10",wn="_urlSection_rg6mx_17",Mn="_urlLeft_rg6mx_25",Ln="_tokenStatsBox_rg6mx_30",Rn="_tokenGrid_rg6mx_37",In="_tokenRows_rg6mx_47",En="_tokenRow_rg6mx_47",Bn="_tokenRowBorder_rg6mx_55",Dn="_tokenLabel_rg6mx_59",An="_tokenTd_rg6mx_66",Fn="_tokenHitRate_rg6mx_75",Hn="_tokenHitRateLabel_rg6mx_88",Pn="_urlText_rg6mx_98",qn="_metaText_rg6mx_105",zn="_headersContainer_rg6mx_109",$n="_headerRow_rg6mx_113",Vn="_headerKey_rg6mx_119",On="_headerValue_rg6mx_124",Un="_streamingBox_rg6mx_129",Wn="_rawTextPre_rg6mx_142",Kn="_tabContent_rg6mx_155",Jn="_bodyLabel_rg6mx_167",Gn="_bodyHeader_rg6mx_171",Qn="_diffSection_rg6mx_178",Xn="_diffToggle_rg6mx_182",Yn="_diffIcon_rg6mx_188",Zn="_reminderSelect_rg6mx_214",ei="_diffHeaderRow_rg6mx_233",ti="_diffSpaceRight_rg6mx_239",si="_reminderFilterWrapper_rg6mx_243",ai="_reminderLabel_rg6mx_249",ni="_cacheTabContent_rg6mx_255",ii="_userPromptList_rg6mx_260",li="_userPromptItem_rg6mx_266",oi="_userPromptNavBtn_rg6mx_277",ri="_cacheContent_rg6mx_288",ci="_cacheTokenBar_rg6mx_295",di="_cacheTokenWrite_rg6mx_305",hi="_cacheTokenRead_rg6mx_309",ui="_cacheCopyIcon_rg6mx_313",mi="_cacheScrollArea_rg6mx_320",pi="_cacheSectionBlock_rg6mx_326",gi="_cacheSectionHeader_rg6mx_330",xi="_cacheCollapseArrow_rg6mx_342",fi="_cachePre_rg6mx_348",ji="_cacheHighlightSvg_rg6mx_362",yi="_cachePreSystem_rg6mx_371",f={container:kn,emptyState:Tn,urlSection:wn,urlLeft:Mn,tokenStatsBox:Ln,tokenGrid:Rn,tokenRows:In,tokenRow:En,tokenRowBorder:Bn,tokenLabel:Dn,tokenTd:An,tokenHitRate:Fn,tokenHitRateLabel:Hn,urlText:Pn,metaText:qn,headersContainer:zn,headerRow:$n,headerKey:Vn,headerValue:On,streamingBox:Un,rawTextPre:Wn,tabContent:Kn,bodyLabel:Jn,bodyHeader:Gn,diffSection:Qn,diffToggle:Xn,diffIcon:Yn,reminderSelect:Zn,diffHeaderRow:ei,diffSpaceRight:ti,reminderFilterWrapper:si,reminderLabel:ai,cacheTabContent:ni,userPromptList:ii,userPromptItem:li,userPromptNavBtn:oi,cacheContent:ri,cacheTokenBar:ci,cacheTokenWrite:di,cacheTokenRead:hi,cacheCopyIcon:ui,cacheScrollArea:mi,cacheSectionBlock:pi,cacheSectionHeader:gi,cacheCollapseArrow:xi,cachePre:fi,cacheHighlightSvg:ji,cachePreSystem:yi},{Text:J,Paragraph:vi}=ft;class _i extends ge.Component{constructor(a){super(a),this.state={bodyViewMode:{request:"json",response:"json",diff:"json"},diffExpanded:!1,requestHeadersExpanded:!1,responseHeadersExpanded:!1,reminderFilters:null,cacheHighlightIdx:null,cacheHighlightFading:!1,cacheCollapsed:{tools:!1,system:!1,messages:!1}}}_cacheUnbindScrollFade(){this._cacheOnScrollFade&&this._cacheScrollEl&&(this._cacheScrollEl.removeEventListener("scroll",this._cacheOnScrollFade),this._cacheOnScrollFade=null)}_cacheClearAllTimers(){clearTimeout(this._cacheScrollSettleTimer),clearTimeout(this._cacheFadeClearTimer),clearTimeout(this._cacheAutoFadeTimer),clearTimeout(this._cacheHighlightDelayTimer),this._cacheUnbindScrollFade(),this._cacheScrollEndHandler&&this._cacheScrollEl&&(this._cacheScrollEl.removeEventListener("scrollend",this._cacheScrollEndHandler),this._cacheScrollEndHandler=null)}componentWillUnmount(){this._cacheClearAllTimers()}_cacheBindScrollFade(){this._cacheUnbindScrollFade();const a=this._cacheScrollEl;a&&(this._cacheOnScrollFade=()=>{clearTimeout(this._cacheAutoFadeTimer),this.setState({cacheHighlightFading:!0}),this._cacheFadeClearTimer=setTimeout(()=>{this.setState({cacheHighlightIdx:null,cacheHighlightFading:!1})},3e3),this._cacheUnbindScrollFade()},a.addEventListener("scroll",this._cacheOnScrollFade,{passive:!0}))}scrollToCacheMsg(a){if(this.state.cacheCollapsed.messages){this.setState(m=>({cacheCollapsed:{...m.cacheCollapsed,messages:!1}}),()=>this.scrollToCacheMsg(a));return}const t=this._cacheScrollEl;if(!t)return;const i=t.querySelector(`[data-msg-idx="${a}"]`);if(!i)return;clearTimeout(this._cacheScrollSettleTimer),clearTimeout(this._cacheFadeClearTimer),clearTimeout(this._cacheAutoFadeTimer),clearTimeout(this._cacheHighlightDelayTimer),this._cacheUnbindScrollFade(),this._cacheScrollEndHandler&&t.removeEventListener("scrollend",this._cacheScrollEndHandler),this.setState({cacheHighlightIdx:null,cacheHighlightFading:!1});let o=!1,n=!1;const r=()=>{!o||!n||(this.setState({cacheHighlightIdx:a,cacheHighlightFading:!1}),this._cacheScrollSettleTimer=setTimeout(()=>this._cacheBindScrollFade(),200),this._cacheAutoFadeTimer=setTimeout(()=>{this.state.cacheHighlightIdx===a&&!this.state.cacheHighlightFading&&(this.setState({cacheHighlightFading:!0}),this._cacheFadeClearTimer=setTimeout(()=>{this.setState({cacheHighlightIdx:null,cacheHighlightFading:!1})},3e3),this._cacheUnbindScrollFade())},3e3))};this._cacheScrollEndHandler=()=>{t.removeEventListener("scrollend",this._cacheScrollEndHandler),o=!0,r()},t.addEventListener("scrollend",this._cacheScrollEndHandler,{once:!0}),this._cacheScrollSettleTimer=setTimeout(()=>{t.removeEventListener("scrollend",this._cacheScrollEndHandler),o=!0,r()},800),this._cacheHighlightDelayTimer=setTimeout(()=>{n=!0,r()},500),i.scrollIntoView({behavior:"smooth",block:"center"})}shouldComponentUpdate(a,t){if(a.request!==this.props.request){const o=Z(a.request);this.setState({diffExpanded:o&&!!a.expandDiff,requestHeadersExpanded:!1,responseHeadersExpanded:!1,reminderFilters:null}),this._cacheClearAllTimers()}const i=a.currentTab==="kv-cache-text";return a.request!==this.props.request||a.currentTab!==this.props.currentTab||a.onTabChange!==this.props.onTabChange||a.selectedIndex!==this.props.selectedIndex||a.expandDiff!==this.props.expandDiff||a.pendingCacheHighlight!==this.props.pendingCacheHighlight||t.bodyViewMode!==this.state.bodyViewMode||i&&t.cacheHighlightIdx!==this.state.cacheHighlightIdx||i&&t.cacheHighlightFading!==this.state.cacheHighlightFading||t.diffExpanded!==this.state.diffExpanded||t.requestHeadersExpanded!==this.state.requestHeadersExpanded||t.responseHeadersExpanded!==this.state.responseHeadersExpanded||t.reminderFilters!==this.state.reminderFilters||i&&t.cacheCollapsed!==this.state.cacheCollapsed}componentDidUpdate(a){const t=this.props.pendingCacheHighlight;t&&t!==a.pendingCacheHighlight&&setTimeout(()=>{var i,o;this.scrollToCacheMsg(t.msgIdx),(o=(i=this.props).onCacheHighlightDone)==null||o.call(i)},150)}getCurrentRequest(){const{request:a,allRequests:t,requests:i}=this.props;return a?a._slimmed?nt(a,t||i||[]):a:null}toggleBodyViewMode(a){this.setState(t=>({bodyViewMode:{...t.bodyViewMode,[a]:t.bodyViewMode[a]==="json"?"text":"json"}}))}copyBody(a){var r;const t=this.getCurrentRequest();if(!t)return;let i;if(a==="diff"?i=this._lastDiffResult:i=a==="request"?t.body:(r=t.response)==null?void 0:r.body,i==null)return;const o=typeof i=="object"?De(i):i,n=typeof o=="string"?o:JSON.stringify(o,null,2);navigator.clipboard.writeText(n).then(()=>H.success(l("ui.copySuccess")))}renderHeaders(a){return!a||Object.keys(a).length===0?e.jsx(J,{type:"secondary",children:l("ui.noHeaders")}):e.jsx("div",{className:f.headersContainer,children:Object.entries(a).map(([t,i])=>e.jsxs("div",{className:f.headerRow,children:[e.jsx(J,{code:!0,className:f.headerKey,children:t}),t==="authorization"&&e.jsx(V,{doc:"TranslateContextPollution"}),e.jsx(J,{type:"secondary",className:f.headerValue,children:String(i)})]},t))})}getRequestExpandNode(a,t){if(t!=="request"||!a||typeof a!="object")return;const{request:i,requests:o,selectedIndex:n}=this.props;if(!i)return;const r=o&&n!=null?o[n+1]:null,{type:m}=je(i,r);let u=null;if(this.state.reminderFilters==="claudeMd"&&Array.isArray(a.messages)){u=new Set,u.add(a.messages);for(const d of a.messages){if(!d||typeof d!="object")continue;const x=d.content;if(typeof x=="string")it(x)&&u.add(d);else if(Array.isArray(x)){let C=!1;for(const j of x)j&&j.type==="text"&&it(j.text)&&(u.add(j),C=!0);C&&(u.add(d),u.add(x))}}}let g=null;if(this.state.reminderFilters==="skills"&&Array.isArray(a.messages)){g=new Set,g.add(a.messages);for(const d of a.messages){if(!d||typeof d!="object")continue;const x=d.content;if(typeof x=="string")lt(x)&&g.add(d);else if(Array.isArray(x)){let C=!1;for(const j of x)j&&j.type==="text"&<(j.text)&&(g.add(j),C=!0);C&&(g.add(d),g.add(x))}}}const h=u||g;if(m==="Preflight"){const d=new Set,x=C=>{C&&typeof C=="object"&&(d.add(C),Array.isArray(C)?C.forEach(x):Object.values(C).forEach(x))};return Array.isArray(a.messages)&&x(a.messages),Array.isArray(a.system)&&a.system.length>=3&&x(a.system[2]),(C,j,p)=>!!(C<2||d.has(j)||h&&h.has(j)||C===1&&p==="system")}if(m==="MainAgent"&&Array.isArray(a.messages)&&a.messages.length===1){const d=a.messages[0],x=d&&Array.isArray(d.content)?d.content:null,C=x&&x.length>0?x[x.length-1]:null,j=new Set,p=_=>{_&&typeof _=="object"&&(j.add(_),Array.isArray(_)?_.forEach(p):Object.values(_).forEach(p))};return C&&p(C),j.add(a.messages),d&&typeof d=="object"&&j.add(d),x&&j.add(x),(_,b,w)=>!!(_<2||j.has(b)||h&&h.has(b))}if(h)return(d,x,C)=>!!(d<2||h.has(x))}renderBody(a,t){const{bodyViewMode:i}=this.state;if(a==null)return e.jsx(J,{type:"secondary",children:l("ui.noBody")});if(typeof a=="string"&&a.includes("Streaming Response"))return e.jsx("div",{className:f.streamingBox,children:e.jsx(J,{type:"secondary",children:l("ui.streamingResponse")})});const o=typeof a=="object"?De(a):a,n=i[t]==="json",r=this.getRequestExpandNode(o,t);return e.jsx("div",{children:n?e.jsx(we,{data:o,defaultExpand:t==="response"?"all":"root",expandNode:r}):e.jsx("pre",{className:f.rawTextPre,children:typeof o=="string"?o:JSON.stringify(o,null,2)})})}getPrevMainAgentRequest(){const{requests:a,selectedIndex:t}=this.props;if(!a||t==null)return null;for(let i=t-1;i>=0;i--)if(Z(a[i])){const o=a[i];return o._slimmed?nt(o,this.props.allRequests||a):o}return null}computeDiff(a,t){if(a==null||t==null||typeof a!="object"||typeof t!="object")return null;const i={},o=new Set([...Object.keys(a),...Object.keys(t)]);for(const n of o)if(!n.startsWith("_"))if(!(n in a))i[n]=t[n];else if(n in t){const r=JSON.stringify(a[n]),m=JSON.stringify(t[n]);r!==m&&(n==="messages"&&Array.isArray(a[n])&&Array.isArray(t[n])&&t[n].length>a[n].length?i[n]=t[n].slice(a[n].length):i[n]=t[n])}else continue;return Object.keys(i).length?i:null}render(){var x,C,j;let a=this.getCurrentRequest();const{currentTab:t,onTabChange:i}=this.props;if(!a)return e.jsx("div",{className:f.emptyState,children:e.jsx(re,{description:"选择一个请求查看详情"})});const o=new Date(a.timestamp).toLocaleString("zh-CN"),n=a.response&&a.response.status<400;let r=null;if(Z(a)){const p=this.getPrevMainAgentRequest();if(p){const _=JSON.stringify(a.body).length,b=JSON.stringify(p.body).length;if(_<b)r=e.jsxs("div",{className:f.diffSection,children:[e.jsxs(J,{strong:!0,className:f.diffToggle,onClick:()=>this.setState(L=>({diffExpanded:!L.diffExpanded})),children:["Body Diff JSON ",e.jsx(V,{doc:"BodyDiffJSON"})," ",this.state.diffExpanded?e.jsx(ce,{className:f.diffIcon}):e.jsx(de,{className:f.diffIcon})]}),this.state.diffExpanded&&e.jsx(J,{type:"secondary",children:l("ui.diffSessionChanged")})]});else{const L=De(this.computeDiff(p.body,a.body));L&&(this._lastDiffResult=L,r=e.jsxs("div",{className:f.diffSection,children:[e.jsxs("div",{className:f.diffHeaderRow,children:[e.jsxs(J,{strong:!0,className:f.diffToggle,onClick:()=>this.setState(S=>({diffExpanded:!S.diffExpanded})),children:["Body Diff JSON ",e.jsx(V,{doc:"BodyDiffJSON"})," ",this.state.diffExpanded?e.jsx(ce,{className:f.diffIcon}):e.jsx(de,{className:f.diffIcon})]}),this.state.diffExpanded&&e.jsxs(pe,{size:"small",className:f.diffSpaceRight,children:[e.jsx(E,{size:"small",icon:this.state.bodyViewMode.diff==="json"?e.jsx(Ce,{}):e.jsx(Ne,{}),onClick:()=>this.toggleBodyViewMode("diff"),children:this.state.bodyViewMode.diff==="json"?"Text":"JSON"}),e.jsx(E,{size:"small",icon:e.jsx(me,{}),onClick:()=>this.copyBody("diff"),children:l("ui.copy")})]})]}),this.state.diffExpanded&&e.jsx(e.Fragment,{children:this.state.bodyViewMode.diff==="json"?e.jsx(we,{data:L,defaultExpand:"all"}):e.jsx("pre",{className:f.rawTextPre,children:JSON.stringify(L,null,2)})})]}))}}}const m=Gt(a.body),u=Qt(a.body),g=[{key:"request",label:"Request",children:e.jsxs("div",{className:f.tabContent,children:[e.jsxs("div",{className:f.diffSection,children:[e.jsxs(J,{strong:!0,className:f.diffToggle,onClick:()=>this.setState(p=>({requestHeadersExpanded:!p.requestHeadersExpanded})),children:["Headers ",this.state.requestHeadersExpanded?e.jsx(ce,{className:f.diffIcon}):e.jsx(de,{className:f.diffIcon})]}),this.state.requestHeadersExpanded&&this.renderHeaders(a.headers)]}),r,e.jsxs("div",{children:[e.jsxs("div",{className:f.bodyHeader,children:[e.jsxs(J,{strong:!0,className:f.bodyLabel,children:["Body",e.jsx(V,{doc:"BodyFields"})]}),e.jsxs(pe,{size:"small",children:[(m||u)&&e.jsxs("span",{className:f.reminderFilterWrapper,children:[e.jsx("span",{className:f.reminderLabel,children:"system-reminder:"}),e.jsx(le,{size:"small",className:f.reminderSelect,placeholder:"filter",value:this.state.reminderFilters||void 0,onChange:p=>this.setState({reminderFilters:p||null}),options:[{label:"CLAUDE.md",value:"claudeMd",disabled:!m},{label:"Skills",value:"skills",disabled:!u}],popupMatchSelectWidth:!1,allowClear:!0})]}),e.jsx(E,{size:"small",icon:this.state.bodyViewMode.request==="json"?e.jsx(Ce,{}):e.jsx(Ne,{}),onClick:()=>this.toggleBodyViewMode("request"),children:this.state.bodyViewMode.request==="json"?"Text":"JSON"}),e.jsx(E,{size:"small",icon:e.jsx(me,{}),onClick:()=>this.copyBody("request"),children:l("ui.copy")})]})]}),this.renderBody(a.body,"request")]})]})},{key:"response",label:"Response",children:e.jsx("div",{className:f.tabContent,children:a.response?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:f.diffSection,children:[e.jsxs(J,{strong:!0,className:f.diffToggle,onClick:()=>this.setState(p=>({responseHeadersExpanded:!p.responseHeadersExpanded})),children:["Headers ",this.state.responseHeadersExpanded?e.jsx(ce,{className:f.diffIcon}):e.jsx(de,{className:f.diffIcon})]}),this.state.responseHeadersExpanded&&this.renderHeaders(a.response.headers)]}),e.jsxs("div",{children:[e.jsxs("div",{className:f.bodyHeader,children:[e.jsxs(J,{strong:!0,className:f.bodyLabel,children:["Body",e.jsx(V,{doc:"ResponseFields"})]}),e.jsxs(pe,{size:"small",children:[e.jsx(E,{size:"small",icon:this.state.bodyViewMode.response==="json"?e.jsx(Ce,{}):e.jsx(Ne,{}),onClick:()=>this.toggleBodyViewMode("response"),children:this.state.bodyViewMode.response==="json"?"Text":"JSON"}),e.jsx(E,{size:"small",icon:e.jsx(me,{}),onClick:()=>this.copyBody("response"),children:l("ui.copy")})]})]}),this.renderBody(a.response.body,"response")]})]}):e.jsx(re,{description:l("ui.responseNotCaptured")})})},{key:"kv-cache-text",label:e.jsxs("span",{children:["KV-Cache-Text ",e.jsx(V,{doc:"KVCacheContent"})]}),children:e.jsx("div",{className:`${f.tabContent} ${f.cacheTabContent}`,children:(()=>{const p=jt([a]),_=a.timestamp+"|"+a.url;if(p&&(p.cacheCreateTokens>0||p.cacheReadTokens>0)&&(this._lastCachedTokensKey=_,this._lastCachedTokens={cacheCreateTokens:p.cacheCreateTokens,cacheReadTokens:p.cacheReadTokens}),!p||p.system.length===0&&p.messages.length===0&&p.tools.length===0)return e.jsx(re,{description:l("ui.noCachedContent"),image:re.PRESENTED_IMAGE_SIMPLE});const b=()=>{const S=[];return p.tools.length>0&&(S.push(`=== ${l("ui.tools")} ===`),p.tools.forEach(T=>S.push(T))),p.system.length>0&&(S.push(`
|
|
24
|
+
=== ${l("ui.systemPrompt")} ===`),p.system.forEach(T=>S.push(T))),p.messages.length>0&&(S.push(`
|
|
25
|
+
=== ${l("ui.messages")} ===`),p.messages.forEach(T=>S.push(T))),S.join(`
|
|
26
|
+
|
|
27
|
+
`)},w=p.messages.map((S,T)=>({text:S,msgIdx:T})).filter(({text:S})=>S.startsWith("[user]")).map(({text:S,msgIdx:T})=>{const I=S.replace(/^\[user\]\s*/,"").trim();return!I||fe(I)?{cleaned:"",msgIdx:T}:{cleaned:ke.parseSegments(I).filter(R=>R.type==="text").map(R=>R.content.trim()).filter(R=>R&&!fe(R)).join(" ").trim(),msgIdx:T}}).filter(({cleaned:S})=>!(!S||/Implement the following plan:/i.test(S))),L=w.length>0?e.jsx("div",{className:f.userPromptList,children:w.map(({cleaned:S,msgIdx:T})=>e.jsx("div",{className:f.userPromptItem,onMouseEnter:I=>{I.currentTarget.style.background="var(--color-primary-bg-lighter)",I.currentTarget.style.color="var(--text-white)"},onMouseLeave:I=>{I.currentTarget.style.background="",I.currentTarget.style.color="var(--text-secondary)"},onClick:()=>this.scrollToCacheMsg(T),children:S},T))}):null;return e.jsxs("div",{className:f.cacheContent,children:[(()=>{const T=p.cacheCreateTokens>0||p.cacheReadTokens>0?p:this._lastCachedTokensKey===_?this._lastCachedTokens:null;return T||L?e.jsxs("div",{className:f.cacheTokenBar,children:[T&&e.jsxs(e.Fragment,{children:[l("ui.tokens"),": ",e.jsxs("span",{className:f.cacheTokenWrite,children:["write ",F(T.cacheCreateTokens)]})," / ",e.jsxs("span",{className:f.cacheTokenRead,children:["read ",F(T.cacheReadTokens)]}),e.jsx(xt,{title:l("ui.copyAllCacheText"),children:e.jsx(me,{className:f.cacheCopyIcon,onClick:()=>{navigator.clipboard.writeText(b()).then(()=>{H.success(l("ui.copied"))}).catch(()=>{})}})})]}),L&&e.jsx(ue,{content:L,trigger:"hover",placement:"left",children:e.jsx("span",{className:f.userPromptNavBtn,children:l("ui.userPromptNav")})})]}):null})(),e.jsxs("div",{className:f.cacheScrollArea,ref:S=>{this._cacheScrollEl=S},children:[p.tools.length>0&&e.jsxs("div",{className:f.cacheSectionBlock,children:[e.jsxs("div",{className:f.cacheSectionHeader,onClick:()=>this.setState(S=>({cacheCollapsed:{...S.cacheCollapsed,tools:!S.cacheCollapsed.tools}})),children:[e.jsx("span",{className:f.cacheCollapseArrow,style:{transform:this.state.cacheCollapsed.tools?"rotate(-90deg)":"rotate(0deg)"},children:"▼"}),l("ui.tools")," (",p.tools.length,")"]}),!this.state.cacheCollapsed.tools&&p.tools.map((S,T)=>e.jsx("pre",{className:f.cachePre,children:S},T))]}),p.system.length>0&&e.jsxs("div",{className:f.cacheSectionBlock,children:[e.jsxs("div",{className:f.cacheSectionHeader,onClick:()=>this.setState(S=>({cacheCollapsed:{...S.cacheCollapsed,system:!S.cacheCollapsed.system}})),children:[e.jsx("span",{className:f.cacheCollapseArrow,style:{transform:this.state.cacheCollapsed.system?"rotate(-90deg)":"rotate(0deg)"},children:"▼"}),l("ui.systemPrompt")," (",p.system.length,")"]}),!this.state.cacheCollapsed.system&&p.system.map((S,T)=>e.jsx("pre",{className:f.cachePreSystem,children:S},T))]}),p.messages.length>0&&e.jsxs("div",{className:f.cacheSectionBlock,children:[e.jsxs("div",{className:f.cacheSectionHeader,onClick:()=>this.setState(S=>({cacheCollapsed:{...S.cacheCollapsed,messages:!S.cacheCollapsed.messages}})),children:[e.jsx("span",{className:f.cacheCollapseArrow,style:{transform:this.state.cacheCollapsed.messages?"rotate(-90deg)":"rotate(0deg)"},children:"▼"}),l("ui.messages")," (",p.messages.length,")"]}),!this.state.cacheCollapsed.messages&&p.messages.map((S,T)=>{const I=T===this.state.cacheHighlightIdx,q=I?this.state.cacheHighlightFading?{boxShadow:"0 0 10px rgba(22,104,220,0)",transition:"box-shadow 3s ease-out",position:"relative"}:{boxShadow:"0 0 10px rgba(22,104,220,0.6)",transition:"box-shadow 0.2s ease-in",position:"relative"}:{};return e.jsxs("pre",{"data-msg-idx":T,className:f.cachePre,style:q,children:[I&&e.jsx("svg",{className:f.cacheHighlightSvg,style:{opacity:this.state.cacheHighlightFading?0:1,transition:this.state.cacheHighlightFading?"opacity 3s ease-out":void 0},preserveAspectRatio:"none",children:e.jsx("rect",{x:"0.5",y:"0.5",width:"calc(100% - 1px)",height:"calc(100% - 1px)",rx:"4",ry:"4",fill:"none",stroke:"#1668dc",strokeWidth:"1",strokeDasharray:"6 4",children:e.jsx("animate",{attributeName:"stroke-dashoffset",from:"0",to:"-100",dur:"4s",repeatCount:"indefinite"})})}),S]},T)})]})]})]})})()})},{key:"context",label:"Context",children:e.jsx("div",{className:`${f.tabContent} ${f.cacheTabContent}`,children:e.jsx(Sn,{body:a.body,response:(x=a.response)==null?void 0:x.body})})}],h=(j=(C=a.response)==null?void 0:C.body)==null?void 0:j.usage,d=h?(()=>{const p=h.input_tokens||0,_=h.output_tokens||0,b=h.cache_creation_input_tokens||0,w=h.cache_read_input_tokens||0,L=p+b+w,S=L>0?(w/L*100).toFixed(1):"0.0";return{input:p,output:_,cacheCreate:b,cacheRead:w,hitRate:S}})():null;return e.jsxs("div",{className:f.container,children:[e.jsxs("div",{className:f.urlSection,children:[e.jsxs("div",{className:f.urlLeft,children:[e.jsx(vi,{className:f.urlText,ellipsis:{rows:2,expandable:!0},children:a.url}),e.jsxs(pe,{size:"small",wrap:!0,children:[e.jsx(Y,{color:a.method==="POST"?"blue":"green",children:a.method}),e.jsxs(J,{type:"secondary",className:f.metaText,children:["🕐 ",o]}),a.duration&&e.jsxs(J,{type:"secondary",className:f.metaText,children:["⏱️ ",a.duration,"ms"]}),a.response&&e.jsxs(Y,{color:n?"success":"error",children:["HTTP ",a.response.status]})]})]}),d&&e.jsx("div",{className:f.tokenStatsBox,children:e.jsxs("div",{className:f.tokenGrid,children:[e.jsxs("div",{className:f.tokenRows,children:[e.jsxs("div",{className:f.tokenRow,children:[e.jsx("span",{className:f.tokenLabel,children:"Token"}),e.jsxs("span",{className:f.tokenTd,children:["input: ",F(d.input)]}),e.jsxs("span",{className:f.tokenTd,children:["output: ",F(d.output)]})]}),e.jsxs("div",{className:`${f.tokenRow} ${f.tokenRowBorder}`,children:[e.jsx("span",{className:f.tokenLabel,children:"Cache"}),e.jsxs("span",{className:f.tokenTd,children:["create: ",F(d.cacheCreate)]}),e.jsxs("span",{className:f.tokenTd,children:["read: ",F(d.cacheRead)]})]})]}),e.jsxs("div",{className:f.tokenHitRate,children:[e.jsxs("div",{children:[d.hitRate,"%"]}),e.jsx("div",{className:f.tokenHitRateLabel,children:l("ui.hitRate")})]})]})})]}),e.jsx(gt,{activeKey:t,onChange:i,items:g,size:"small"})]})}}const bi="_resizer_pzn4b_1",Ci={resizer:bi};class Ni extends ge.Component{constructor(a){super(a),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this)}handleMouseDown(a){a.preventDefault(),document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("mouseup",this.handleMouseUp)}handleMouseMove(a){this.props.onResize&&this.props.onResize(a.clientX)}handleMouseUp(){document.body.style.cursor="",document.body.style.userSelect="",document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp)}componentWillUnmount(){document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp)}render(){return e.jsx("div",{onMouseDown:this.handleMouseDown,className:Ci.resizer})}}class Ai extends Xt{constructor(t){super(t);M(this,"handleViewRequest",t=>{this.setState({viewMode:"raw",selectedIndex:t,scrollCenter:!0})});M(this,"handleViewInChat",()=>{this.setState(t=>{const o=(t.showAll?t.requests:be(t.requests))[t.selectedIndex];if(!o)return null;let n=null;if(Z(o)&&o.timestamp)n=o.timestamp;else{const r=je(o);if((r.type==="SubAgent"||r.type==="Teammate")&&o.timestamp)n=o.timestamp;else{const m=t.requests.indexOf(o);m>=0&&(n=ot(t.requests,m))}n||H.info(l("ui.cannotMap"))}return{viewMode:"chat",chatScrollToTs:n}})});M(this,"handleToggleViewMode",()=>{this.setState(t=>{const i=t.viewMode==="raw"?"chat":"raw";if(i==="raw"){if(t.selectedIndex===null){const r=t.showAll?t.requests:be(t.requests);return{viewMode:i,selectedIndex:r.length>0?r.length-1:null,scrollCenter:!0}}return{viewMode:i,scrollCenter:!0}}const o=t.showAll?t.requests:be(t.requests),n=t.selectedIndex!=null?o[t.selectedIndex]:null;if(n){let r=null;if(Z(n)&&n.timestamp)r=n.timestamp;else{const m=je(n);if((m.type==="SubAgent"||m.type==="Teammate")&&n.timestamp)r=n.timestamp;else{const u=t.requests.indexOf(n);u>=0&&(r=ot(t.requests,u)),r||H.info(l("ui.cannotMap"))}}return{viewMode:i,chatScrollToTs:r}}return{viewMode:i,chatScrollToTs:null}},()=>{this.state.viewMode==="chat"&&this.state.terminalVisible&&this.state.cliMode&&!ts&&requestAnimationFrame(()=>{const t=document.querySelector(".xterm-helper-textarea");t&&t.focus()})})});M(this,"handleTabChange",t=>{this.setState({currentTab:t})});M(this,"handleCacheHighlightDone",()=>{this.setState({pendingCacheHighlight:null})});M(this,"handleNavigateCacheMsg",t=>{const i=this.state.showAll?this.state.requests:be(this.state.requests);let o=-1;for(let n=i.length-1;n>=0;n--)if(Z(i[n])){o=n;break}o<0||this.setState({selectedIndex:o,scrollCenter:!0,currentTab:"kv-cache-text",pendingCacheHighlight:{msgIdx:t,key:Date.now()}})});M(this,"handleResize",t=>{const i=this.mainContainerRef.current;if(!i)return;const o=i.getBoundingClientRect(),n=t-o.left;n>=250&&n<=800&&this.setState({leftPanelWidth:n})});M(this,"handleLoadLocalJsonlFile",()=>{const t=document.createElement("input");t.type="file",t.accept=".jsonl",t.multiple=!0,t.onchange=i=>{const o=Array.from(i.target.files);if(o.length===0)return;if(o.reduce((g,h)=>g+h.size,0)>500*1024*1024){H.error(l("ui.fileTooLarge"));return}this.setState({fileLoading:!0,fileLoadingCount:0});let r=0;const m=[],u=[];o.forEach(g=>{const h=new FileReader;h.onload=d=>{try{const C=d.target.result.split(`
|
|
28
|
+
---
|
|
29
|
+
`).filter(j=>j.trim()).map(j=>{try{return JSON.parse(j)}catch{return null}}).filter(Boolean);m.push(...C),u.push(g.name)}catch{}r++,r===o.length&&this._finishLocalLoad(m,u)},h.readAsText(g)})},t.click()});M(this,"_processJsonlFiles",t=>{if(!t||t.length===0)return;if(t.reduce((m,u)=>m+u.size,0)>500*1024*1024){H.error(l("ui.fileTooLarge"));return}this.setState({fileLoading:!0,fileLoadingCount:0});let o=0;const n=[],r=[];t.forEach(m=>{const u=new FileReader;u.onload=g=>{try{const d=g.target.result.split(`
|
|
30
|
+
---
|
|
31
|
+
`).filter(x=>x.trim()).map(x=>{try{return JSON.parse(x)}catch{return null}}).filter(Boolean);n.push(...d),r.push(m.name)}catch{}o++,o===t.length&&this._finishLocalLoad(n,r)},u.readAsText(m)})});M(this,"_isInternalDrag",t=>t.dataTransfer.types.includes("text/x-preset-reorder"));M(this,"_onDragOver",t=>{if(t.preventDefault(),this._isInternalDrag(t))return;if(t.target.closest&&t.target.closest("[data-file-explorer]")){this.state.isDragging&&this.setState({isDragging:!1});return}this.state.isDragging||this.setState({isDragging:!0})});M(this,"_onDragLeave",t=>{const i=this._layoutRef.current;i&&!i.contains(t.relatedTarget)&&this.setState({isDragging:!1})});M(this,"_onDrop",t=>{if(t.preventDefault(),this._isInternalDrag(t))return;this.setState({isDragging:!1});const i=Array.from(t.dataTransfer.files);i.length&&Promise.all(i.map(o=>Yt(o).then(n=>({name:o.name,path:n})).catch(n=>(H.error(`${o.name}: ${n.message}`),null)))).then(o=>{const n=o.filter(Boolean).map(r=>`"${r.path}"`);n.length>0&&this.setState(r=>({pendingUploadPaths:[...r.pendingUploadPaths||[],...n]}))})});M(this,"handleUploadPathsConsumed",()=>{this.setState({pendingUploadPaths:[]})});Object.assign(this.state,{leftPanelWidth:380,terminalVisible:!0,currentTab:"context",pendingCacheHighlight:null})}componentDidMount(){super.componentDidMount(),this._mqlNarrow=window.matchMedia("(max-width: 600px)"),this._modeSwitchDialog=null,this._onNarrowChange=t=>{t.matches?this._modeSwitchDialog=X.confirm({title:l("ui.modeSwitchTitle"),content:l("ui.modeSwitchToSidebar"),okText:l("ui.ok"),onOk:()=>{this._modeSwitchDialog=null,es("pad")},onCancel:()=>{this._modeSwitchDialog=null}}):this._modeSwitchDialog&&(this._modeSwitchDialog.destroy(),this._modeSwitchDialog=null)},this._mqlNarrow.addEventListener("change",this._onNarrowChange)}componentWillUnmount(){this._mqlNarrow&&this._mqlNarrow.removeEventListener("change",this._onNarrowChange),this._modeSwitchDialog&&(this._modeSwitchDialog.destroy(),this._modeSwitchDialog=null),super.componentWillUnmount()}render(){const{filteredRequests:t,selectedRequest:i,fileLoading:o,fileLoadingCount:n,mainAgentSessions:r,viewMode:m}=this.renderPrepare(),{selectedIndex:u,leftPanelWidth:g,currentTab:h}=this.state;return this.state.workspaceMode?this.renderWorkspaceMode():e.jsxs(Ft,{theme:this.themeConfig,children:[o&&e.jsx("div",{className:k.loadingOverlay,children:e.jsxs("div",{className:k.loadingText,children:["Loading...(",n,")"]})}),this.state.isDragging&&e.jsx("div",{className:k.dragOverlay,children:e.jsxs("div",{className:k.dragOverlayContent,children:[e.jsx(rt,{className:k.dragIcon}),e.jsx("p",{children:l("ui.dragDropHint")})]})}),e.jsxs(Be,{className:k.layout,ref:this._layoutRef,onDragOver:this._onDragOver,onDragLeave:this._onDragLeave,onDrop:this._onDrop,children:[e.jsx(Be.Header,{className:k.header,children:e.jsx(ke,{requestCount:t.length,requests:t,viewMode:m,cacheExpireAt:this.state.cacheExpireAt,cacheType:this.state.cacheType,onToggleViewMode:this.handleToggleViewMode,onLangChange:this.handleLangChange,onImportLocalLogs:this.handleImportLocalLogs,isLocalLog:!!this._isLocalLog,localLogFile:this._localLogFile,projectName:this.state.projectName,collapseToolResults:this.state.collapseToolResults,onCollapseToolResultsChange:this.handleCollapseToolResultsChange,expandThinking:this.state.expandThinking,onExpandThinkingChange:this.handleExpandThinkingChange,showFullToolContent:this.state.showFullToolContent,onShowFullToolContentChange:this.handleShowFullToolContentChange,expandDiff:this.state.expandDiff,onExpandDiffChange:this.handleExpandDiffChange,filterIrrelevant:!this.state.showAll,onFilterIrrelevantChange:this.handleFilterIrrelevantChange,logDir:this.state.logDir,onLogDirChange:this.handleLogDirChange,updateInfo:this.state.updateInfo,onDismissUpdate:()=>this.setState({updateInfo:null}),cliMode:this.state.cliMode,sdkMode:this.state.sdkMode,terminalVisible:this.state.sdkMode?!1:this.state.terminalVisible,onToggleTerminal:()=>this.setState(d=>({terminalVisible:!d.terminalVisible})),onReturnToWorkspaces:this.state.cliMode?this.handleReturnToWorkspaces:null,contextWindow:this.state.contextWindow,onNavigateCacheMsg:this.handleNavigateCacheMsg,serverCachedContent:this.state.serverCachedContent||this._lastKvCacheContent,resumeAutoChoice:this.state.resumeAutoChoice,onResumeAutoChoiceToggle:this.handleResumeAutoChoiceToggle,onResumeAutoChoiceChange:this.handleResumeAutoChoiceChange,themeColor:this.state.themeColor,onThemeColorChange:this.handleThemeColorChange,autoApproveSeconds:this.state.autoApproveSeconds,onAutoApproveChange:this.handleAutoApproveChange,proxyProfiles:this.state.proxyProfiles,activeProxyId:this.state.activeProxyId,defaultConfig:this.state.defaultConfig,onProxyProfileChange:this.handleProxyProfileChange})}),this.state.claudeMissing&&e.jsx(Ht,{type:"warning",showIcon:!0,banner:!0,message:l("ui.claudeMissing.title"),description:e.jsxs("span",{children:[l("ui.claudeMissing.desc"),e.jsx("br",{}),e.jsx("code",{style:{background:"var(--bg-code)",padding:"2px 6px",borderRadius:3},children:"npm install -g @anthropic-ai/claude-code"})," ",e.jsx("span",{style:{color:"var(--text-muted)",margin:"0 4px"},children:l("ui.claudeMissing.or")})," ",e.jsx("a",{href:"https://claude.ai/download",target:"_blank",rel:"noopener noreferrer",style:{color:"var(--color-primary-light)"},children:l("ui.claudeMissing.native")})]})}),e.jsxs(Be.Content,{className:k.content,children:[m==="raw"&&(t.length===0?e.jsx("div",{className:k.guideContainer,children:e.jsxs("div",{className:k.guideContent,children:[e.jsx("h2",{className:k.guideTitle,children:l("ui.guide.title")}),e.jsxs("div",{className:k.guideStep,children:[e.jsx("div",{className:k.guideStepNum,children:"1"}),e.jsxs("div",{className:k.guideStepBody,children:[e.jsx("p",{className:k.guideText,children:l("ui.guide.step1")}),e.jsx("code",{className:k.guideCode,children:l("ui.guide.exampleQuestion")})]})]}),e.jsxs("div",{className:k.guideStep,children:[e.jsx("div",{className:k.guideStepNum,children:"2"}),e.jsxs("div",{className:k.guideStepBody,children:[e.jsx("p",{className:k.guideText,children:l("ui.guide.step2")}),e.jsx("code",{className:k.guideCode,children:l("ui.guide.troubleshootCmd")})]})]}),e.jsxs("div",{className:k.guideStep,children:[e.jsx("div",{className:k.guideStepNum,children:"3"}),e.jsxs("div",{className:k.guideStepBody,children:[e.jsx("p",{className:k.guideText,children:l("ui.guide.step3")}),e.jsx("code",{className:k.guideCode,children:"npm install -g @anthropic-ai/claude-code"})]})]})]})}):e.jsxs("div",{ref:this.mainContainerRef,className:k.mainContainer,children:[e.jsxs("div",{className:k.leftPanel,style:{width:g},children:[e.jsxs("div",{className:k.leftPanelHeader,children:[e.jsx("span",{children:l("ui.requestList")}),e.jsx("span",{className:k.leftPanelCount,children:l("ui.totalRequests",{count:t.length})})]}),e.jsx("div",{className:k.leftPanelBody,children:e.jsx(Xs,{requests:t,selectedIndex:u,scrollCenter:this.state.scrollCenter,onSelect:this.handleSelectRequest,onScrollDone:this.handleScrollDone,cacheLossMap:this._cacheLossMap})})]}),e.jsx(Ni,{onResize:this.handleResize}),e.jsx("div",{className:k.rightPanel,children:e.jsx(_i,{request:i,requests:t,allRequests:this.state.requests,selectedIndex:u,currentTab:h,onTabChange:this.handleTabChange,onViewInChat:this.handleViewInChat,expandDiff:this.state.expandDiff,pendingCacheHighlight:this.state.pendingCacheHighlight,onCacheHighlightDone:this.handleCacheHighlightDone})})]})),e.jsx("div",{className:k.chatViewWrapper,style:{display:m==="chat"?"flex":"none"},children:e.jsx(Zt,{requests:t,mainAgentSessions:r,streamingLatest:this.state.streamingLatest,userProfile:this.state.userProfile,collapseToolResults:this.state.collapseToolResults,expandThinking:this.state.expandThinking,showFullToolContent:this.state.showFullToolContent,showThinkingSummaries:this.state.showThinkingSummaries,onViewRequest:this.handleViewRequest,scrollToTimestamp:this.state.chatScrollToTs,onScrollTsDone:this.handleScrollTsDone,cliMode:this._isLocalLog?!1:this.state.cliMode,sdkMode:this._isLocalLog?!1:this.state.sdkMode,terminalVisible:this._isLocalLog||this.state.sdkMode?!1:this.state.terminalVisible,onToggleTerminal:()=>this.setState(d=>({terminalVisible:!d.terminalVisible})),pendingUploadPaths:this.state.pendingUploadPaths,onUploadPathsConsumed:this.handleUploadPathsConsumed,fileLoading:this.state.fileLoading,isStreaming:this.state.isStreaming,hasMoreHistory:this.state.hasMoreHistory,loadingMore:this.state.loadingMore,onLoadMoreHistory:()=>this.loadMoreHistory(),loadingSessionId:this.state.loadingSessionId,onLoadSession:d=>this.loadSession(d),lang:this.state.lang,autoApproveSeconds:this.state.autoApproveSeconds,onAutoApproveChange:this.handleAutoApproveChange})})]}),e.jsx("div",{className:k.footer,children:e.jsxs("div",{className:k.footerRight,children:[e.jsxs("a",{href:"https://github.com/weiesky/cc-viewer",target:"_blank",rel:"noopener noreferrer",className:k.footerLink,children:[e.jsx("svg",{className:k.footerIcon,viewBox:"0 0 16 16",fill:"currentColor",children:e.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"})}),"GitHub",this.state.githubStars!=null?` ★ ${this.state.githubStars}`:""]}),e.jsx("span",{className:k.footerSep,children:"|"}),e.jsxs("span",{className:`${k.footerVersion}${this.state.updateInfo?` ${k.footerVersionNew}`:""}`,onClick:()=>this.setState({updateModalVisible:!0}),style:{cursor:"pointer"},children:["v","1.6.171",this.state.updateInfo&&e.jsxs("svg",{className:k.newBadge,width:"28",height:"12",viewBox:"0 0 28 12",children:[e.jsx("rect",{width:"28",height:"12",rx:"3",fill:"currentColor",opacity:"0.25"}),e.jsx("text",{x:"14",y:"9",textAnchor:"middle",fill:"currentColor",fontSize:"8",fontWeight:"600",fontFamily:"system-ui",children:"NEW"})]})]})]})})]}),e.jsx(X,{title:l("ui.update.title"),open:this.state.updateModalVisible,onCancel:()=>this.setState({updateModalVisible:!1}),footer:null,width:480,children:e.jsxs("div",{style:{lineHeight:1.8},children:[e.jsxs("p",{children:[e.jsxs("strong",{children:[l("ui.update.current"),":"]})," v","1.6.171"]}),this.state.updateInfo&&e.jsxs("p",{children:[e.jsxs("strong",{children:[l("ui.update.latest"),":"]})," v",this.state.updateInfo.version]}),e.jsx("p",{style:{marginTop:12},children:e.jsx("strong",{children:l("ui.update.npm")})}),e.jsx("code",{style:{display:"block",background:"var(--bg-code)",padding:"8px 12px",borderRadius:6,fontSize:13},children:"npm update -g cc-viewer"}),typeof window<"u"&&window.electronAPI&&e.jsxs(e.Fragment,{children:[e.jsx("p",{style:{marginTop:16},children:e.jsx("strong",{children:l("ui.update.electron")})}),e.jsx("p",{style:{color:"var(--text-tertiary)",fontSize:13},children:l("ui.update.electronDesc")}),e.jsxs("ol",{style:{color:"var(--text-tertiary)",fontSize:13,paddingLeft:20,margin:"6px 0"},children:[e.jsx("li",{children:l("ui.update.step1")}),e.jsx("li",{children:l("ui.update.step2")}),e.jsx("li",{children:l("ui.update.step3")})]})]}),e.jsx("div",{style:{marginTop:16,textAlign:"right"},children:e.jsx(E,{type:"primary",href:"https://github.com/weiesky/cc-viewer/releases",target:"_blank",rel:"noopener noreferrer",children:l("ui.update.goReleases")})})]})}),e.jsx(X,{title:l("ui.resume.title"),open:this.state.resumeModalVisible,closable:!1,maskClosable:!1,keyboard:!1,footer:e.jsxs("div",{children:[e.jsxs("div",{className:k.resumeFooterRight,children:[e.jsx(E,{type:"primary",onClick:()=>this.handleResumeChoice("continue"),className:k.btnMarginRight,children:l("ui.resume.continue")},"continue"),e.jsx(E,{onClick:()=>this.handleResumeChoice("new"),children:l("ui.resume.new")},"new")]}),e.jsx("div",{className:k.resumeFooterLeft,children:e.jsx(Pt,{checked:this.state.resumeRememberChoice,onChange:d=>this.setState({resumeRememberChoice:d.target.checked}),className:k.resumeCheckboxOpacity,children:e.jsx("span",{className:k.resumeCheckboxOpacity,children:l("ui.resume.remember")})})})]}),children:e.jsx("p",{children:l("ui.resume.message",{file:this.state.resumeFileName})})}),e.jsxs(X,{title:e.jsxs("span",{className:k.modalTitleInline,children:[e.jsx(yt,{apiEndpoint:K("/api/open-log-dir"),title:l("ui.openLogDir"),size:16}),l("ui.importLocalLogs")]}),open:this.state.importModalVisible,onCancel:this.handleCloseImportModal,footer:null,width:1e3,styles:{body:{overflow:"hidden"}},children:[e.jsxs("div",{className:k.modalActions,children:[e.jsx(E,{icon:e.jsx(rt,{}),onClick:this.handleLoadLocalJsonlFile,children:l("ui.loadLocalJsonl")}),e.jsx(E,{size:"small",type:this.state.selectedLogs.size>1?"primary":"default",disabled:this.state.selectedLogs.size<2,onClick:this.handleMergeLogs,className:k.btnMarginLeft,children:l("ui.mergeLogs")}),e.jsx(E,{size:"small",danger:!0,icon:e.jsx(He,{}),disabled:this.state.selectedLogs.size===0,onClick:this.handleDeleteLogs,className:k.btnMarginLeft,children:l("ui.deleteLogs")}),e.jsx(E,{size:"small",icon:e.jsx(Pe,{spin:this.state.refreshingStats}),loading:this.state.refreshingStats,onClick:this.handleRefreshStats,className:k.btnMarginLeft,children:l("ui.refreshStats")})]}),this.state.localLogsLoading?e.jsx("div",{className:k.spinCenter,children:e.jsx(pt,{})}):(()=>{const d=this.state.localLogs[this.state.currentProject];return!d||d.length===0?e.jsx("div",{className:k.emptyCenter,children:l("ui.noLogs")}):e.jsx("div",{className:k.logListContainer,children:this.renderLogTable(d,!1)})})()]})]})}}export{Ai as default};
|