cc-viewer 1.6.125 → 1.6.127

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.
Files changed (69) hide show
  1. package/dist/assets/App-B896p8WB.js +39 -0
  2. package/dist/assets/{AppHeader-DpJCYHYn.css → AppHeader-DpMt-_LU.css} +2 -2
  3. package/dist/assets/{AppHeader.module-DTZ9gtBb.js → AppHeader.module-DY5fQhkP.js} +184 -184
  4. package/dist/assets/Mobile-rgZVvi4l.js +10 -0
  5. package/dist/assets/{_basePickBy-DyXcwtLD.js → _basePickBy-C0VuLFDh.js} +1 -1
  6. package/dist/assets/{_baseUniq-BPlSvwi7.js → _baseUniq-CC98ed23.js} +1 -1
  7. package/dist/assets/{arc-BmCystmb.js → arc-DwZUwnwN.js} +1 -1
  8. package/dist/assets/{architectureDiagram-2XIMDMQ5--Xh7SzI2.js → architectureDiagram-2XIMDMQ5-DqwfhCTx.js} +1 -1
  9. package/dist/assets/{blockDiagram-WCTKOSBZ-CfFp3Bc4.js → blockDiagram-WCTKOSBZ-C-Chs1_m.js} +1 -1
  10. package/dist/assets/{c4Diagram-IC4MRINW-Bkq0Ul1w.js → c4Diagram-IC4MRINW-BxxcCUGg.js} +1 -1
  11. package/dist/assets/channel-DUtWc_eG.js +1 -0
  12. package/dist/assets/{chunk-4BX2VUAB-DuSc3r-m.js → chunk-4BX2VUAB-C6bssLWc.js} +1 -1
  13. package/dist/assets/{chunk-55IACEB6-25NvysxB.js → chunk-55IACEB6-CoBNaxp5.js} +1 -1
  14. package/dist/assets/{chunk-FMBD7UC4-CjBCZQuE.js → chunk-FMBD7UC4-CG24TdZG.js} +1 -1
  15. package/dist/assets/{chunk-JSJVCQXG-DrEOqcKO.js → chunk-JSJVCQXG-CClasci2.js} +1 -1
  16. package/dist/assets/{chunk-KX2RTZJC-9zLm5PiJ.js → chunk-KX2RTZJC-C9JOa9YT.js} +1 -1
  17. package/dist/assets/{chunk-NQ4KR5QH-C5sPCO3r.js → chunk-NQ4KR5QH-CNI0Rcy6.js} +1 -1
  18. package/dist/assets/{chunk-QZHKN3VN-B9KwZlJS.js → chunk-QZHKN3VN-IAYRwcOw.js} +1 -1
  19. package/dist/assets/{chunk-WL4C6EOR-BJxlPNyy.js → chunk-WL4C6EOR-BWfnvjC-.js} +1 -1
  20. package/dist/assets/classDiagram-VBA2DB6C-nD9iatBW.js +1 -0
  21. package/dist/assets/classDiagram-v2-RAHNMMFH-nD9iatBW.js +1 -0
  22. package/dist/assets/clone-CX0h2eim.js +1 -0
  23. package/dist/assets/{cose-bilkent-S5V4N54A-D6TanMlQ.js → cose-bilkent-S5V4N54A-BuMY_r_A.js} +1 -1
  24. package/dist/assets/{dagre-KLK3FWXG-nypo_RVQ.js → dagre-KLK3FWXG-C03URqxI.js} +1 -1
  25. package/dist/assets/{diagram-E7M64L7V-DgVjL8QE.js → diagram-E7M64L7V-C7BDSfOM.js} +1 -1
  26. package/dist/assets/{diagram-IFDJBPK2-7cdOqnom.js → diagram-IFDJBPK2-DCdel9ZD.js} +1 -1
  27. package/dist/assets/{diagram-P4PSJMXO-BBpmdzq1.js → diagram-P4PSJMXO-D35407Dc.js} +1 -1
  28. package/dist/assets/{erDiagram-INFDFZHY-D_ADtYic.js → erDiagram-INFDFZHY-DEsOIKyv.js} +1 -1
  29. package/dist/assets/{flowDiagram-PKNHOUZH-DuuqlEg2.js → flowDiagram-PKNHOUZH-DXzpeuY2.js} +1 -1
  30. package/dist/assets/{ganttDiagram-A5KZAMGK-ChU7vh9W.js → ganttDiagram-A5KZAMGK-Cg47zJZ-.js} +1 -1
  31. package/dist/assets/{gitGraphDiagram-K3NZZRJ6-ByzicHJ2.js → gitGraphDiagram-K3NZZRJ6-_T2ZW5bu.js} +1 -1
  32. package/dist/assets/{graph-CANuybFr.js → graph-DMdWwoWb.js} +1 -1
  33. package/dist/assets/index-3E2GNREX.css +1 -0
  34. package/dist/assets/{index-Xy-QLoU4.js → index-grwcW9hM.js} +2 -2
  35. package/dist/assets/{infoDiagram-LFFYTUFH-BaYI_c1N.js → infoDiagram-LFFYTUFH-BavWYZvd.js} +1 -1
  36. package/dist/assets/{ishikawaDiagram-PHBUUO56-B9g0XNSk.js → ishikawaDiagram-PHBUUO56-BeGUD2CQ.js} +1 -1
  37. package/dist/assets/{journeyDiagram-4ABVD52K-DB4A2RWb.js → journeyDiagram-4ABVD52K-CTG0FVFq.js} +1 -1
  38. package/dist/assets/{kanban-definition-K7BYSVSG-Cnuy4pIh.js → kanban-definition-K7BYSVSG-u6zeQwiT.js} +1 -1
  39. package/dist/assets/{layout-DD8Px7T9.js → layout-DyRVQhZH.js} +1 -1
  40. package/dist/assets/{linear-Bxm9TYD8.js → linear-B9HdlCh6.js} +1 -1
  41. package/dist/assets/{mermaid.core-CSANynR-.js → mermaid.core-DQiCXLn4.js} +4 -4
  42. package/dist/assets/{mindmap-definition-YRQLILUH-DT4U5rsV.js → mindmap-definition-YRQLILUH-CCRp5jOl.js} +1 -1
  43. package/dist/assets/{pieDiagram-SKSYHLDU-6dKXVWLR.js → pieDiagram-SKSYHLDU-6cXpeT-n.js} +1 -1
  44. package/dist/assets/{quadrantDiagram-337W2JSQ-C9r7vqr-.js → quadrantDiagram-337W2JSQ-Dy7LQd0M.js} +1 -1
  45. package/dist/assets/{requirementDiagram-Z7DCOOCP-CwY8-0VB.js → requirementDiagram-Z7DCOOCP-CFv9rIK2.js} +1 -1
  46. package/dist/assets/{sankeyDiagram-WA2Y5GQK-nSOe_4Oo.js → sankeyDiagram-WA2Y5GQK-Dry-fXPx.js} +1 -1
  47. package/dist/assets/{sequenceDiagram-2WXFIKYE-Bb7kE6pX.js → sequenceDiagram-2WXFIKYE-yJRaKnTq.js} +1 -1
  48. package/dist/assets/{stateDiagram-RAJIS63D-CKdAjGq4.js → stateDiagram-RAJIS63D-BsaiWE3q.js} +1 -1
  49. package/dist/assets/stateDiagram-v2-FVOUBMTO-D-UzxrEl.js +1 -0
  50. package/dist/assets/{timeline-definition-YZTLITO2-B95A_8uX.js → timeline-definition-YZTLITO2-BoIOrB8R.js} +1 -1
  51. package/dist/assets/{treemap-KZPCXAKY-CwF1VaA-.js → treemap-KZPCXAKY-C3ncDwA3.js} +1 -1
  52. package/dist/assets/{vennDiagram-LZ73GAT5-CsFdSSf6.js → vennDiagram-LZ73GAT5-Bmf01mPA.js} +1 -1
  53. package/dist/assets/{xychartDiagram-JWTSCODW-B-GNiJfq.js → xychartDiagram-JWTSCODW-DXD9diaX.js} +1 -1
  54. package/dist/ccv-logo.png +0 -0
  55. package/dist/index.html +2 -2
  56. package/i18n.js +100 -0
  57. package/lib/ask-bridge.js +4 -2
  58. package/lib/delta-reconstructor.js +12 -3
  59. package/lib/perm-bridge.js +4 -1
  60. package/package.json +3 -2
  61. package/server.js +180 -2
  62. package/dist/assets/App-BCqf5d72.js +0 -39
  63. package/dist/assets/Mobile-CKlByKtP.js +0 -10
  64. package/dist/assets/channel-CWEvZjaR.js +0 -1
  65. package/dist/assets/classDiagram-VBA2DB6C-DI-2D3Up.js +0 -1
  66. package/dist/assets/classDiagram-v2-RAHNMMFH-DI-2D3Up.js +0 -1
  67. package/dist/assets/clone-BBJs0jn4.js +0 -1
  68. package/dist/assets/index-DZF1ClLH.css +0 -1
  69. package/dist/assets/stateDiagram-v2-FVOUBMTO-B30ALvj2.js +0 -1
@@ -0,0 +1,39 @@
1
+ var Ts=Object.defineProperty;var Ms=(n,s,t)=>s in n?Ts(n,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[s]=t;var B=(n,s,t)=>Ms(n,typeof s!="symbol"?s+"":s,t);import{r as j,R as U,j as e,a as Es}from"./index-grwcW9hM.js";import{P as Rs,Q as Is,_ as ee,c as se,U as ut,V as Ls,W as mt,d as St,X as Ce,Y as kt,Z as rt,$ as wt,a0 as As,a1 as Ct,a2 as Ps,a3 as Tt,a4 as Ds,g as Bs,m as Os,u as He,a5 as Fs,a6 as Hs,a7 as $s,a8 as zs,a9 as Vs,aa as Us,ab as qs,ac as Mt,C as bt,I as ue,ad as Ws,ae as Jt,af as Ks,ag as Qt,ah as Gs,ai as Js,aj as Qs,e as oe,t as p,w as We,x as Ys,y as Te,j as Xs,k as Zs,l as ea,s as r,v as q,q as ie,ak as Yt,al as Ve,am as K,L as $e,an as ze,n as ta,ao as sa,o as Ke,ap as aa,aq as ke,S as Xt,B as F,ar as na,as as la,at as Ue,au as oa,av as xe,aw as Et,ax as Ee,M as ia,ay as Zt,J as Re,az as Je,G as pt,aA as Rt,H as ft,aB as ra,O as es,aC as ca,aD as da,aE as ha,aF as Le,aG as It,aH as ua,aI as Lt,aJ as ts,aK as ss,aL as Ae,aM as Pe,aN as as,aO as ct,aP as At,aQ as Pt,aR as Dt,aS as ma,aT as pa,A as fa,aU as Qe,aV as Bt,aW as ga,D as xa,z as R,E as va,aX as ya}from"./AppHeader.module-DY5fQhkP.js";var Ot=j.createContext(null),ns=j.createContext({}),ja=["prefixCls","className","containerRef"],Ca=function(s){var t=s.prefixCls,a=s.className,d=s.containerRef,l=Rs(s,ja),u=j.useContext(ns),f=u.panel,o=Is(f,d);return j.createElement("div",ee({className:se("".concat(t,"-content"),a),role:"dialog",ref:o},ut(s,{aria:!0}),{"aria-modal":"true"},l))};function Ft(n){return typeof n=="string"&&String(Number(n))===n?(Ls(!1,"Invalid value type of `width` or `height` which should be number type instead."),Number(n)):n}var Ht={width:0,height:0,overflow:"hidden",outline:"none",position:"absolute"};function ba(n,s){var t,a,d,l=n.prefixCls,u=n.open,f=n.placement,o=n.inline,h=n.push,i=n.forceRender,c=n.autoFocus,m=n.keyboard,y=n.classNames,x=n.rootClassName,g=n.rootStyle,v=n.zIndex,C=n.className,k=n.id,N=n.style,b=n.motion,T=n.width,E=n.height,L=n.children,I=n.mask,M=n.maskClosable,D=n.maskMotion,O=n.maskClassName,ae=n.maskStyle,ne=n.afterOpenChange,A=n.onClose,X=n.onMouseEnter,re=n.onMouseOver,Z=n.onMouseLeave,me=n.onClick,be=n.onKeyDown,ve=n.onKeyUp,G=n.styles,pe=n.drawerRender,le=j.useRef(),ye=j.useRef(),_=j.useRef();j.useImperativeHandle(s,function(){return le.current});var W=function(de){var Be=de.keyCode,Oe=de.shiftKey;switch(Be){case rt.TAB:{if(Be===rt.TAB){if(!Oe&&document.activeElement===_.current){var Fe;(Fe=ye.current)===null||Fe===void 0||Fe.focus({preventScroll:!0})}else if(Oe&&document.activeElement===ye.current){var it;(it=_.current)===null||it===void 0||it.focus({preventScroll:!0})}}break}case rt.ESC:{A&&m&&(de.stopPropagation(),A(de));break}}};j.useEffect(function(){if(u&&c){var Y;(Y=le.current)===null||Y===void 0||Y.focus({preventScroll:!0})}},[u]);var fe=j.useState(!1),we=mt(fe,2),Ne=we[0],je=we[1],z=j.useContext(Ot),_e;typeof h=="boolean"?_e=h?{}:{distance:0}:_e=h||{};var ge=(t=(a=(d=_e)===null||d===void 0?void 0:d.distance)!==null&&a!==void 0?a:z==null?void 0:z.pushDistance)!==null&&t!==void 0?t:180,ce=j.useMemo(function(){return{pushDistance:ge,push:function(){je(!0)},pull:function(){je(!1)}}},[ge]);j.useEffect(function(){if(u){var Y;z==null||(Y=z.push)===null||Y===void 0||Y.call(z)}else{var de;z==null||(de=z.pull)===null||de===void 0||de.call(z)}},[u]),j.useEffect(function(){return function(){var Y;z==null||(Y=z.pull)===null||Y===void 0||Y.call(z)}},[]);var te=j.createElement(St,ee({key:"mask"},D,{visible:I&&u}),function(Y,de){var Be=Y.className,Oe=Y.style;return j.createElement("div",{className:se("".concat(l,"-mask"),Be,y==null?void 0:y.mask,O),style:Ce(Ce(Ce({},Oe),ae),G==null?void 0:G.mask),onClick:M&&u?A:void 0,ref:de})}),V=typeof b=="function"?b(f):b,Q={};if(Ne&&ge)switch(f){case"top":Q.transform="translateY(".concat(ge,"px)");break;case"bottom":Q.transform="translateY(".concat(-ge,"px)");break;case"left":Q.transform="translateX(".concat(ge,"px)");break;default:Q.transform="translateX(".concat(-ge,"px)");break}f==="left"||f==="right"?Q.width=Ft(T):Q.height=Ft(E);var Se={onMouseEnter:X,onMouseOver:re,onMouseLeave:Z,onClick:me,onKeyDown:be,onKeyUp:ve},Ge=j.createElement(St,ee({key:"panel"},V,{visible:u,forceRender:i,onVisibleChanged:function(de){ne==null||ne(de)},removeOnLeave:!1,leavedClassName:"".concat(l,"-content-wrapper-hidden")}),function(Y,de){var Be=Y.className,Oe=Y.style,Fe=j.createElement(Ca,ee({id:k,containerRef:de,prefixCls:l,className:se(C,y==null?void 0:y.content),style:Ce(Ce({},N),G==null?void 0:G.content)},ut(n,{aria:!0}),Se),L);return j.createElement("div",ee({className:se("".concat(l,"-content-wrapper"),y==null?void 0:y.wrapper,Be),style:Ce(Ce(Ce({},Q),Oe),G==null?void 0:G.wrapper)},ut(n,{data:!0})),pe?pe(Fe):Fe)}),_t=Ce({},g);return v&&(_t.zIndex=v),j.createElement(Ot.Provider,{value:ce},j.createElement("div",{className:se(l,"".concat(l,"-").concat(f),x,kt(kt({},"".concat(l,"-open"),u),"".concat(l,"-inline"),o)),style:_t,tabIndex:-1,ref:le,onKeyDown:W},te,j.createElement("div",{tabIndex:0,ref:ye,style:Ht,"aria-hidden":"true","data-sentinel":"start"}),Ge,j.createElement("div",{tabIndex:0,ref:_,style:Ht,"aria-hidden":"true","data-sentinel":"end"})))}var Na=j.forwardRef(ba),_a=function(s){var t=s.open,a=t===void 0?!1:t,d=s.prefixCls,l=d===void 0?"rc-drawer":d,u=s.placement,f=u===void 0?"right":u,o=s.autoFocus,h=o===void 0?!0:o,i=s.keyboard,c=i===void 0?!0:i,m=s.width,y=m===void 0?378:m,x=s.mask,g=x===void 0?!0:x,v=s.maskClosable,C=v===void 0?!0:v,k=s.getContainer,N=s.forceRender,b=s.afterOpenChange,T=s.destroyOnClose,E=s.onMouseEnter,L=s.onMouseOver,I=s.onMouseLeave,M=s.onClick,D=s.onKeyDown,O=s.onKeyUp,ae=s.panelRef,ne=j.useState(!1),A=mt(ne,2),X=A[0],re=A[1],Z=j.useState(!1),me=mt(Z,2),be=me[0],ve=me[1];wt(function(){ve(!0)},[]);var G=be?a:!1,pe=j.useRef(),le=j.useRef();wt(function(){G&&(le.current=document.activeElement)},[G]);var ye=function(Ne){var je;if(re(Ne),b==null||b(Ne),!Ne&&le.current&&!((je=pe.current)!==null&&je!==void 0&&je.contains(le.current))){var z;(z=le.current)===null||z===void 0||z.focus({preventScroll:!0})}},_=j.useMemo(function(){return{panel:ae}},[ae]);if(!N&&!X&&!G&&T)return null;var W={onMouseEnter:E,onMouseOver:L,onMouseLeave:I,onClick:M,onKeyDown:D,onKeyUp:O},fe=Ce(Ce({},s),{},{open:G,prefixCls:l,placement:f,autoFocus:h,keyboard:c,width:y,mask:g,maskClosable:C,inline:k===!1,afterOpenChange:ye,ref:pe},W);return j.createElement(ns.Provider,{value:_},j.createElement(As,{open:G||N||X,autoDestroy:!1,getContainer:k,autoLock:g&&(G||X)},j.createElement(Na,fe)))};const ls=n=>{var s,t;const{prefixCls:a,ariaId:d,title:l,footer:u,extra:f,closable:o,loading:h,onClose:i,headerStyle:c,bodyStyle:m,footerStyle:y,children:x,classNames:g,styles:v}=n,C=Ct("drawer");let k;o===!1?k=void 0:o===void 0||o===!0?k="start":k=(o==null?void 0:o.placement)==="end"?"end":"start";const N=j.useCallback(I=>j.createElement("button",{type:"button",onClick:i,className:se(`${a}-close`,{[`${a}-close-${k}`]:k==="end"})},I),[i,a,k]),[b,T]=Ps(Tt(n),Tt(C),{closable:!0,closeIconRender:N}),E=()=>{var I,M;return!l&&!b?null:j.createElement("div",{style:Object.assign(Object.assign(Object.assign({},(I=C.styles)===null||I===void 0?void 0:I.header),c),v==null?void 0:v.header),className:se(`${a}-header`,{[`${a}-header-close-only`]:b&&!l&&!f},(M=C.classNames)===null||M===void 0?void 0:M.header,g==null?void 0:g.header)},j.createElement("div",{className:`${a}-header-title`},k==="start"&&T,l&&j.createElement("div",{className:`${a}-title`,id:d},l)),f&&j.createElement("div",{className:`${a}-extra`},f),k==="end"&&T)},L=()=>{var I,M;if(!u)return null;const D=`${a}-footer`;return j.createElement("div",{className:se(D,(I=C.classNames)===null||I===void 0?void 0:I.footer,g==null?void 0:g.footer),style:Object.assign(Object.assign(Object.assign({},(M=C.styles)===null||M===void 0?void 0:M.footer),y),v==null?void 0:v.footer)},u)};return j.createElement(j.Fragment,null,E(),j.createElement("div",{className:se(`${a}-body`,g==null?void 0:g.body,(s=C.classNames)===null||s===void 0?void 0:s.body),style:Object.assign(Object.assign(Object.assign({},(t=C.styles)===null||t===void 0?void 0:t.body),m),v==null?void 0:v.body)},h?j.createElement(Ds,{active:!0,title:!1,paragraph:{rows:5},className:`${a}-body-skeleton`}):x),L())},Sa=n=>{const s="100%";return{left:`translateX(-${s})`,right:`translateX(${s})`,top:`translateY(-${s})`,bottom:`translateY(${s})`}[n]},os=(n,s)=>({"&-enter, &-appear":Object.assign(Object.assign({},n),{"&-active":s}),"&-leave":Object.assign(Object.assign({},s),{"&-active":n})}),is=(n,s)=>Object.assign({"&-enter, &-appear, &-leave":{"&-start":{transition:"none"},"&-active":{transition:`all ${s}`}}},os({opacity:n},{opacity:1})),ka=(n,s)=>[is(.7,s),os({transform:Sa(n)},{transform:"none"})],wa=n=>{const{componentCls:s,motionDurationSlow:t}=n;return{[s]:{[`${s}-mask-motion`]:is(0,t),[`${s}-panel-motion`]:["left","right","top","bottom"].reduce((a,d)=>Object.assign(Object.assign({},a),{[`&-${d}`]:ka(d,t)}),{})}}},Ta=n=>{const{borderRadiusSM:s,componentCls:t,zIndexPopup:a,colorBgMask:d,colorBgElevated:l,motionDurationSlow:u,motionDurationMid:f,paddingXS:o,padding:h,paddingLG:i,fontSizeLG:c,lineHeightLG:m,lineWidth:y,lineType:x,colorSplit:g,marginXS:v,colorIcon:C,colorIconHover:k,colorBgTextHover:N,colorBgTextActive:b,colorText:T,fontWeightStrong:E,footerPaddingBlock:L,footerPaddingInline:I,calc:M}=n,D=`${t}-content-wrapper`;return{[t]:{position:"fixed",inset:0,zIndex:a,pointerEvents:"none",color:T,"&-pure":{position:"relative",background:l,display:"flex",flexDirection:"column",[`&${t}-left`]:{boxShadow:n.boxShadowDrawerLeft},[`&${t}-right`]:{boxShadow:n.boxShadowDrawerRight},[`&${t}-top`]:{boxShadow:n.boxShadowDrawerUp},[`&${t}-bottom`]:{boxShadow:n.boxShadowDrawerDown}},"&-inline":{position:"absolute"},[`${t}-mask`]:{position:"absolute",inset:0,zIndex:a,background:d,pointerEvents:"auto"},[D]:{position:"absolute",zIndex:a,maxWidth:"100vw",transition:`all ${u}`,"&-hidden":{display:"none"}},[`&-left > ${D}`]:{top:0,bottom:0,left:{_skip_check_:!0,value:0},boxShadow:n.boxShadowDrawerLeft},[`&-right > ${D}`]:{top:0,right:{_skip_check_:!0,value:0},bottom:0,boxShadow:n.boxShadowDrawerRight},[`&-top > ${D}`]:{top:0,insetInline:0,boxShadow:n.boxShadowDrawerUp},[`&-bottom > ${D}`]:{bottom:0,insetInline:0,boxShadow:n.boxShadowDrawerDown},[`${t}-content`]:{display:"flex",flexDirection:"column",width:"100%",height:"100%",overflow:"auto",background:l,pointerEvents:"auto"},[`${t}-header`]:{display:"flex",flex:0,alignItems:"center",padding:`${He(h)} ${He(i)}`,fontSize:c,lineHeight:m,borderBottom:`${He(y)} ${x} ${g}`,"&-title":{display:"flex",flex:1,alignItems:"center",minWidth:0,minHeight:0}},[`${t}-extra`]:{flex:"none"},[`${t}-close`]:Object.assign({display:"inline-flex",width:M(c).add(o).equal(),height:M(c).add(o).equal(),borderRadius:s,justifyContent:"center",alignItems:"center",color:C,fontWeight:E,fontSize:c,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",textDecoration:"none",background:"transparent",border:0,cursor:"pointer",transition:`all ${f}`,textRendering:"auto",[`&${t}-close-end`]:{marginInlineStart:v},[`&:not(${t}-close-end)`]:{marginInlineEnd:v},"&:hover":{color:k,backgroundColor:N,textDecoration:"none"},"&:active":{backgroundColor:b}},Fs(n)),[`${t}-title`]:{flex:1,margin:0,fontWeight:n.fontWeightStrong,fontSize:c,lineHeight:m},[`${t}-body`]:{flex:1,minWidth:0,minHeight:0,padding:i,overflow:"auto",[`${t}-body-skeleton`]:{width:"100%",height:"100%",display:"flex",justifyContent:"center"}},[`${t}-footer`]:{flexShrink:0,padding:`${He(L)} ${He(I)}`,borderTop:`${He(y)} ${x} ${g}`},"&-rtl":{direction:"rtl"}}}},Ma=n=>({zIndexPopup:n.zIndexPopupBase,footerPaddingBlock:n.paddingXS,footerPaddingInline:n.padding}),rs=Bs("Drawer",n=>{const s=Os(n,{});return[Ta(s),wa(s)]},Ma);var cs=function(n,s){var t={};for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&s.indexOf(a)<0&&(t[a]=n[a]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var d=0,a=Object.getOwnPropertySymbols(n);d<a.length;d++)s.indexOf(a[d])<0&&Object.prototype.propertyIsEnumerable.call(n,a[d])&&(t[a[d]]=n[a[d]]);return t};const Ea={distance:180},Ye=n=>{const{rootClassName:s,width:t,height:a,size:d="default",mask:l=!0,push:u=Ea,open:f,afterOpenChange:o,onClose:h,prefixCls:i,getContainer:c,panelRef:m=null,style:y,className:x,"aria-labelledby":g,visible:v,afterVisibleChange:C,maskStyle:k,drawerStyle:N,contentWrapperStyle:b,destroyOnClose:T,destroyOnHidden:E}=n,L=cs(n,["rootClassName","width","height","size","mask","push","open","afterOpenChange","onClose","prefixCls","getContainer","panelRef","style","className","aria-labelledby","visible","afterVisibleChange","maskStyle","drawerStyle","contentWrapperStyle","destroyOnClose","destroyOnHidden"]),I=Hs(),M=L.title?I:void 0,{getPopupContainer:D,getPrefixCls:O,direction:ae,className:ne,style:A,classNames:X,styles:re}=Ct("drawer"),Z=O("drawer",i),[me,be,ve]=rs(Z),G=c===void 0&&D?()=>D(document.body):c,pe=se({"no-mask":!l,[`${Z}-rtl`]:ae==="rtl"},s,be,ve),le=j.useMemo(()=>t??(d==="large"?736:378),[t,d]),ye=j.useMemo(()=>a??(d==="large"?736:378),[a,d]),_={motionName:Mt(Z,"mask-motion"),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500},W=ge=>({motionName:Mt(Z,`panel-motion-${ge}`),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500}),fe=$s(),we=zs(m,fe),[Ne,je]=Vs("Drawer",L.zIndex),{classNames:z={},styles:_e={}}=L;return me(j.createElement(Us,{form:!0,space:!0},j.createElement(qs.Provider,{value:je},j.createElement(_a,Object.assign({prefixCls:Z,onClose:h,maskMotion:_,motion:W},L,{classNames:{mask:se(z.mask,X.mask),content:se(z.content,X.content),wrapper:se(z.wrapper,X.wrapper)},styles:{mask:Object.assign(Object.assign(Object.assign({},_e.mask),k),re.mask),content:Object.assign(Object.assign(Object.assign({},_e.content),N),re.content),wrapper:Object.assign(Object.assign(Object.assign({},_e.wrapper),b),re.wrapper)},open:f??v,mask:l,push:u,width:le,height:ye,style:Object.assign(Object.assign({},A),y),className:se(ne,x),rootClassName:pe,getContainer:G,afterOpenChange:o??C,panelRef:we,zIndex:Ne,"aria-labelledby":g??M,destroyOnClose:E??T}),j.createElement(ls,Object.assign({prefixCls:Z},L,{ariaId:M,onClose:h}))))))},Ra=n=>{const{prefixCls:s,style:t,className:a,placement:d="right"}=n,l=cs(n,["prefixCls","style","className","placement"]),{getPrefixCls:u}=j.useContext(bt),f=u("drawer",s),[o,h,i]=rs(f),c=se(f,`${f}-pure`,`${f}-${d}`,h,i,a);return o(j.createElement("div",{className:c,style:t},j.createElement(ls,Object.assign({prefixCls:f},l))))};Ye._InternalPanelDoNotUseOrYouWillBeFired=Ra;var Ia={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494zM504 618H320c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM312 490v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H320c-4.4 0-8 3.6-8 8z"}}]},name:"file-text",theme:"outlined"},La=function(s,t){return j.createElement(ue,ee({},s,{ref:t,icon:Ia}))},Xe=j.forwardRef(La),Aa={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M847.9 592H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h605.2L612.9 851c-4.1 5.2-.4 13 6.3 13h72.5c4.9 0 9.5-2.2 12.6-6.1l168.8-214.1c16.5-21 1.6-51.8-25.2-51.8zM872 356H266.8l144.3-183c4.1-5.2.4-13-6.3-13h-72.5c-4.9 0-9.5 2.2-12.6 6.1L150.9 380.2c-16.5 21-1.6 51.8 25.1 51.8h696c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"swap",theme:"outlined"},Pa=function(s,t){return j.createElement(ue,ee({},s,{ref:t,icon:Aa}))},$t=j.forwardRef(Pa);function Da(n,s,t){return typeof t=="boolean"?t:n.length?!0:Ws(s).some(d=>d.type===Jt)}var ds=function(n,s){var t={};for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&s.indexOf(a)<0&&(t[a]=n[a]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var d=0,a=Object.getOwnPropertySymbols(n);d<a.length;d++)s.indexOf(a[d])<0&&Object.prototype.propertyIsEnumerable.call(n,a[d])&&(t[a[d]]=n[a[d]]);return t};function ot({suffixCls:n,tagName:s,displayName:t}){return a=>j.forwardRef((l,u)=>j.createElement(a,Object.assign({ref:u,suffixCls:n,tagName:s},l)))}const Nt=j.forwardRef((n,s)=>{const{prefixCls:t,suffixCls:a,className:d,tagName:l}=n,u=ds(n,["prefixCls","suffixCls","className","tagName"]),{getPrefixCls:f}=j.useContext(bt),o=f("layout",t),[h,i,c]=Qt(o),m=a?`${o}-${a}`:o;return h(j.createElement(l,Object.assign({className:se(t||m,d,i,c),ref:s},u)))}),Ba=j.forwardRef((n,s)=>{const{direction:t}=j.useContext(bt),[a,d]=j.useState([]),{prefixCls:l,className:u,rootClassName:f,children:o,hasSider:h,tagName:i,style:c}=n,m=ds(n,["prefixCls","className","rootClassName","children","hasSider","tagName","style"]),y=Ks(m,["suffixCls"]),{getPrefixCls:x,className:g,style:v}=Ct("layout"),C=x("layout",l),k=Da(a,o,h),[N,b,T]=Qt(C),E=se(C,{[`${C}-has-sider`]:k,[`${C}-rtl`]:t==="rtl"},g,u,f,b,T),L=j.useMemo(()=>({siderHook:{addSider:I=>{d(M=>[].concat(Gs(M),[I]))},removeSider:I=>{d(M=>M.filter(D=>D!==I))}}}),[]);return N(j.createElement(Js.Provider,{value:L},j.createElement(i,Object.assign({ref:s,className:E,style:Object.assign(Object.assign({},v),c)},y),o)))}),Oa=ot({tagName:"div",displayName:"Layout"})(Ba),Fa=ot({suffixCls:"header",tagName:"header",displayName:"Header"})(Nt),Ha=ot({suffixCls:"footer",tagName:"footer",displayName:"Footer"})(Nt),$a=ot({suffixCls:"content",tagName:"main",displayName:"Content"})(Nt),Me=Oa;Me.Header=Fa;Me.Footer=Ha;Me.Content=$a;Me.Sider=Jt;Me._InternalSiderContext=Qs;var za={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"},Va=function(s,t){return j.createElement(ue,ee({},s,{ref:t,icon:za}))},zt=j.forwardRef(Va),Ua={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"},qa=function(s,t){return j.createElement(ue,ee({},s,{ref:t,icon:Ua}))},Vt=j.forwardRef(qa),Wa={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"},Ka=function(s,t){return j.createElement(ue,ee({},s,{ref:t,icon:Wa}))},Ut=j.forwardRef(Ka),Ga={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"},Ja=function(s,t){return j.createElement(ue,ee({},s,{ref:t,icon:Ga}))},Ze=j.forwardRef(Ja),Qa={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"},Ya=function(s,t){return j.createElement(ue,ee({},s,{ref:t,icon:Qa}))},dt=j.forwardRef(Ya),Xa={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"},Za=function(s,t){return j.createElement(ue,ee({},s,{ref:t,icon:Xa}))},en=j.forwardRef(Za),tn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.4 800.9c.2-.3.5-.6.7-.9C920.6 722.1 960 621.7 960 512s-39.4-210.1-104.8-288c-.2-.3-.5-.5-.7-.8-1.1-1.3-2.1-2.5-3.2-3.7-.4-.5-.8-.9-1.2-1.4l-4.1-4.7-.1-.1c-1.5-1.7-3.1-3.4-4.6-5.1l-.1-.1c-3.2-3.4-6.4-6.8-9.7-10.1l-.1-.1-4.8-4.8-.3-.3c-1.5-1.5-3-2.9-4.5-4.3-.5-.5-1-1-1.6-1.5-1-1-2-1.9-3-2.8-.3-.3-.7-.6-1-1C736.4 109.2 629.5 64 512 64s-224.4 45.2-304.3 119.2c-.3.3-.7.6-1 1-1 .9-2 1.9-3 2.9-.5.5-1 1-1.6 1.5-1.5 1.4-3 2.9-4.5 4.3l-.3.3-4.8 4.8-.1.1c-3.3 3.3-6.5 6.7-9.7 10.1l-.1.1c-1.6 1.7-3.1 3.4-4.6 5.1l-.1.1c-1.4 1.5-2.8 3.1-4.1 4.7-.4.5-.8.9-1.2 1.4-1.1 1.2-2.1 2.5-3.2 3.7-.2.3-.5.5-.7.8C103.4 301.9 64 402.3 64 512s39.4 210.1 104.8 288c.2.3.5.6.7.9l3.1 3.7c.4.5.8.9 1.2 1.4l4.1 4.7c0 .1.1.1.1.2 1.5 1.7 3 3.4 4.6 5l.1.1c3.2 3.4 6.4 6.8 9.6 10.1l.1.1c1.6 1.6 3.1 3.2 4.7 4.7l.3.3c3.3 3.3 6.7 6.5 10.1 9.6 80.1 74 187 119.2 304.5 119.2s224.4-45.2 304.3-119.2a300 300 0 0010-9.6l.3-.3c1.6-1.6 3.2-3.1 4.7-4.7l.1-.1c3.3-3.3 6.5-6.7 9.6-10.1l.1-.1c1.5-1.7 3.1-3.3 4.6-5 0-.1.1-.1.1-.2 1.4-1.5 2.8-3.1 4.1-4.7.4-.5.8-.9 1.2-1.4a99 99 0 003.3-3.7zm4.1-142.6c-13.8 32.6-32 62.8-54.2 90.2a444.07 444.07 0 00-81.5-55.9c11.6-46.9 18.8-98.4 20.7-152.6H887c-3 40.9-12.6 80.6-28.5 118.3zM887 484H743.5c-1.9-54.2-9.1-105.7-20.7-152.6 29.3-15.6 56.6-34.4 81.5-55.9A373.86 373.86 0 01887 484zM658.3 165.5c39.7 16.8 75.8 40 107.6 69.2a394.72 394.72 0 01-59.4 41.8c-15.7-45-35.8-84.1-59.2-115.4 3.7 1.4 7.4 2.9 11 4.4zm-90.6 700.6c-9.2 7.2-18.4 12.7-27.7 16.4V697a389.1 389.1 0 01115.7 26.2c-8.3 24.6-17.9 47.3-29 67.8-17.4 32.4-37.8 58.3-59 75.1zm59-633.1c11 20.6 20.7 43.3 29 67.8A389.1 389.1 0 01540 327V141.6c9.2 3.7 18.5 9.1 27.7 16.4 21.2 16.7 41.6 42.6 59 75zM540 640.9V540h147.5c-1.6 44.2-7.1 87.1-16.3 127.8l-.3 1.2A445.02 445.02 0 00540 640.9zm0-156.9V383.1c45.8-2.8 89.8-12.5 130.9-28.1l.3 1.2c9.2 40.7 14.7 83.5 16.3 127.8H540zm-56 56v100.9c-45.8 2.8-89.8 12.5-130.9 28.1l-.3-1.2c-9.2-40.7-14.7-83.5-16.3-127.8H484zm-147.5-56c1.6-44.2 7.1-87.1 16.3-127.8l.3-1.2c41.1 15.6 85 25.3 130.9 28.1V484H336.5zM484 697v185.4c-9.2-3.7-18.5-9.1-27.7-16.4-21.2-16.7-41.7-42.7-59.1-75.1-11-20.6-20.7-43.3-29-67.8 37.2-14.6 75.9-23.3 115.8-26.1zm0-370a389.1 389.1 0 01-115.7-26.2c8.3-24.6 17.9-47.3 29-67.8 17.4-32.4 37.8-58.4 59.1-75.1 9.2-7.2 18.4-12.7 27.7-16.4V327zM365.7 165.5c3.7-1.5 7.3-3 11-4.4-23.4 31.3-43.5 70.4-59.2 115.4-21-12-40.9-26-59.4-41.8 31.8-29.2 67.9-52.4 107.6-69.2zM165.5 365.7c13.8-32.6 32-62.8 54.2-90.2 24.9 21.5 52.2 40.3 81.5 55.9-11.6 46.9-18.8 98.4-20.7 152.6H137c3-40.9 12.6-80.6 28.5-118.3zM137 540h143.5c1.9 54.2 9.1 105.7 20.7 152.6a444.07 444.07 0 00-81.5 55.9A373.86 373.86 0 01137 540zm228.7 318.5c-39.7-16.8-75.8-40-107.6-69.2 18.5-15.8 38.4-29.7 59.4-41.8 15.7 45 35.8 84.1 59.2 115.4-3.7-1.4-7.4-2.9-11-4.4zm292.6 0c-3.7 1.5-7.3 3-11 4.4 23.4-31.3 43.5-70.4 59.2-115.4 21 12 40.9 26 59.4 41.8a373.81 373.81 0 01-107.6 69.2z"}}]},name:"global",theme:"outlined"},sn=function(s,t){return j.createElement(ue,ee({},s,{ref:t,icon:tn}))},an=j.forwardRef(sn),nn={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"},ln=function(s,t){return j.createElement(ue,ee({},s,{ref:t,icon:nn}))},qt=j.forwardRef(ln),on={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"},rn=function(s,t){return j.createElement(ue,ee({},s,{ref:t,icon:on}))},cn=j.forwardRef(rn),dn={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"},hn=function(s,t){return j.createElement(ue,ee({},s,{ref:t,icon:dn}))},Wt=j.forwardRef(hn),un={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"upload",theme:"outlined"},mn=function(s,t){return j.createElement(ue,ee({},s,{ref:t,icon:un}))},Kt=j.forwardRef(mn),pn=Object.defineProperty,tt=Object.getOwnPropertySymbols,hs=Object.prototype.hasOwnProperty,us=Object.prototype.propertyIsEnumerable,Gt=(n,s,t)=>s in n?pn(n,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[s]=t,gt=(n,s)=>{for(var t in s||(s={}))hs.call(s,t)&&Gt(n,t,s[t]);if(tt)for(var t of tt(s))us.call(s,t)&&Gt(n,t,s[t]);return n},xt=(n,s)=>{var t={};for(var a in n)hs.call(n,a)&&s.indexOf(a)<0&&(t[a]=n[a]);if(n!=null&&tt)for(var a of tt(n))s.indexOf(a)<0&&us.call(n,a)&&(t[a]=n[a]);return t};/**
2
+ * @license QR Code generator library (TypeScript)
3
+ * Copyright (c) Project Nayuki.
4
+ * SPDX-License-Identifier: MIT
5
+ */var De;(n=>{const s=class P{constructor(o,h,i,c){if(this.version=o,this.errorCorrectionLevel=h,this.modules=[],this.isFunction=[],o<P.MIN_VERSION||o>P.MAX_VERSION)throw new RangeError("Version value out of range");if(c<-1||c>7)throw new RangeError("Mask value out of range");this.size=o*4+17;let m=[];for(let x=0;x<this.size;x++)m.push(!1);for(let x=0;x<this.size;x++)this.modules.push(m.slice()),this.isFunction.push(m.slice());this.drawFunctionPatterns();const y=this.addEccAndInterleave(i);if(this.drawCodewords(y),c==-1){let x=1e9;for(let g=0;g<8;g++){this.applyMask(g),this.drawFormatBits(g);const v=this.getPenaltyScore();v<x&&(c=g,x=v),this.applyMask(g)}}d(0<=c&&c<=7),this.mask=c,this.applyMask(c),this.drawFormatBits(c),this.isFunction=[]}static encodeText(o,h){const i=n.QrSegment.makeSegments(o);return P.encodeSegments(i,h)}static encodeBinary(o,h){const i=n.QrSegment.makeBytes(o);return P.encodeSegments([i],h)}static encodeSegments(o,h,i=1,c=40,m=-1,y=!0){if(!(P.MIN_VERSION<=i&&i<=c&&c<=P.MAX_VERSION)||m<-1||m>7)throw new RangeError("Invalid value");let x,g;for(x=i;;x++){const N=P.getNumDataCodewords(x,h)*8,b=u.getTotalBits(o,x);if(b<=N){g=b;break}if(x>=c)throw new RangeError("Data too long")}for(const N of[P.Ecc.MEDIUM,P.Ecc.QUARTILE,P.Ecc.HIGH])y&&g<=P.getNumDataCodewords(x,N)*8&&(h=N);let v=[];for(const N of o){t(N.mode.modeBits,4,v),t(N.numChars,N.mode.numCharCountBits(x),v);for(const b of N.getData())v.push(b)}d(v.length==g);const C=P.getNumDataCodewords(x,h)*8;d(v.length<=C),t(0,Math.min(4,C-v.length),v),t(0,(8-v.length%8)%8,v),d(v.length%8==0);for(let N=236;v.length<C;N^=253)t(N,8,v);let k=[];for(;k.length*8<v.length;)k.push(0);return v.forEach((N,b)=>k[b>>>3]|=N<<7-(b&7)),new P(x,h,k,m)}getModule(o,h){return 0<=o&&o<this.size&&0<=h&&h<this.size&&this.modules[h][o]}getModules(){return this.modules}drawFunctionPatterns(){for(let i=0;i<this.size;i++)this.setFunctionModule(6,i,i%2==0),this.setFunctionModule(i,6,i%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const o=this.getAlignmentPatternPositions(),h=o.length;for(let i=0;i<h;i++)for(let c=0;c<h;c++)i==0&&c==0||i==0&&c==h-1||i==h-1&&c==0||this.drawAlignmentPattern(o[i],o[c]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(o){const h=this.errorCorrectionLevel.formatBits<<3|o;let i=h;for(let m=0;m<10;m++)i=i<<1^(i>>>9)*1335;const c=(h<<10|i)^21522;d(c>>>15==0);for(let m=0;m<=5;m++)this.setFunctionModule(8,m,a(c,m));this.setFunctionModule(8,7,a(c,6)),this.setFunctionModule(8,8,a(c,7)),this.setFunctionModule(7,8,a(c,8));for(let m=9;m<15;m++)this.setFunctionModule(14-m,8,a(c,m));for(let m=0;m<8;m++)this.setFunctionModule(this.size-1-m,8,a(c,m));for(let m=8;m<15;m++)this.setFunctionModule(8,this.size-15+m,a(c,m));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let o=this.version;for(let i=0;i<12;i++)o=o<<1^(o>>>11)*7973;const h=this.version<<12|o;d(h>>>18==0);for(let i=0;i<18;i++){const c=a(h,i),m=this.size-11+i%3,y=Math.floor(i/3);this.setFunctionModule(m,y,c),this.setFunctionModule(y,m,c)}}drawFinderPattern(o,h){for(let i=-4;i<=4;i++)for(let c=-4;c<=4;c++){const m=Math.max(Math.abs(c),Math.abs(i)),y=o+c,x=h+i;0<=y&&y<this.size&&0<=x&&x<this.size&&this.setFunctionModule(y,x,m!=2&&m!=4)}}drawAlignmentPattern(o,h){for(let i=-2;i<=2;i++)for(let c=-2;c<=2;c++)this.setFunctionModule(o+c,h+i,Math.max(Math.abs(c),Math.abs(i))!=1)}setFunctionModule(o,h,i){this.modules[h][o]=i,this.isFunction[h][o]=!0}addEccAndInterleave(o){const h=this.version,i=this.errorCorrectionLevel;if(o.length!=P.getNumDataCodewords(h,i))throw new RangeError("Invalid argument");const c=P.NUM_ERROR_CORRECTION_BLOCKS[i.ordinal][h],m=P.ECC_CODEWORDS_PER_BLOCK[i.ordinal][h],y=Math.floor(P.getNumRawDataModules(h)/8),x=c-y%c,g=Math.floor(y/c);let v=[];const C=P.reedSolomonComputeDivisor(m);for(let N=0,b=0;N<c;N++){let T=o.slice(b,b+g-m+(N<x?0:1));b+=T.length;const E=P.reedSolomonComputeRemainder(T,C);N<x&&T.push(0),v.push(T.concat(E))}let k=[];for(let N=0;N<v[0].length;N++)v.forEach((b,T)=>{(N!=g-m||T>=x)&&k.push(b[N])});return d(k.length==y),k}drawCodewords(o){if(o.length!=Math.floor(P.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let h=0;for(let i=this.size-1;i>=1;i-=2){i==6&&(i=5);for(let c=0;c<this.size;c++)for(let m=0;m<2;m++){const y=i-m,g=(i+1&2)==0?this.size-1-c:c;!this.isFunction[g][y]&&h<o.length*8&&(this.modules[g][y]=a(o[h>>>3],7-(h&7)),h++)}}d(h==o.length*8)}applyMask(o){if(o<0||o>7)throw new RangeError("Mask value out of range");for(let h=0;h<this.size;h++)for(let i=0;i<this.size;i++){let c;switch(o){case 0:c=(i+h)%2==0;break;case 1:c=h%2==0;break;case 2:c=i%3==0;break;case 3:c=(i+h)%3==0;break;case 4:c=(Math.floor(i/3)+Math.floor(h/2))%2==0;break;case 5:c=i*h%2+i*h%3==0;break;case 6:c=(i*h%2+i*h%3)%2==0;break;case 7:c=((i+h)%2+i*h%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[h][i]&&c&&(this.modules[h][i]=!this.modules[h][i])}}getPenaltyScore(){let o=0;for(let m=0;m<this.size;m++){let y=!1,x=0,g=[0,0,0,0,0,0,0];for(let v=0;v<this.size;v++)this.modules[m][v]==y?(x++,x==5?o+=P.PENALTY_N1:x>5&&o++):(this.finderPenaltyAddHistory(x,g),y||(o+=this.finderPenaltyCountPatterns(g)*P.PENALTY_N3),y=this.modules[m][v],x=1);o+=this.finderPenaltyTerminateAndCount(y,x,g)*P.PENALTY_N3}for(let m=0;m<this.size;m++){let y=!1,x=0,g=[0,0,0,0,0,0,0];for(let v=0;v<this.size;v++)this.modules[v][m]==y?(x++,x==5?o+=P.PENALTY_N1:x>5&&o++):(this.finderPenaltyAddHistory(x,g),y||(o+=this.finderPenaltyCountPatterns(g)*P.PENALTY_N3),y=this.modules[v][m],x=1);o+=this.finderPenaltyTerminateAndCount(y,x,g)*P.PENALTY_N3}for(let m=0;m<this.size-1;m++)for(let y=0;y<this.size-1;y++){const x=this.modules[m][y];x==this.modules[m][y+1]&&x==this.modules[m+1][y]&&x==this.modules[m+1][y+1]&&(o+=P.PENALTY_N2)}let h=0;for(const m of this.modules)h=m.reduce((y,x)=>y+(x?1:0),h);const i=this.size*this.size,c=Math.ceil(Math.abs(h*20-i*10)/i)-1;return d(0<=c&&c<=9),o+=c*P.PENALTY_N4,d(0<=o&&o<=2568888),o}getAlignmentPatternPositions(){if(this.version==1)return[];{const o=Math.floor(this.version/7)+2,h=this.version==32?26:Math.ceil((this.version*4+4)/(o*2-2))*2;let i=[6];for(let c=this.size-7;i.length<o;c-=h)i.splice(1,0,c);return i}}static getNumRawDataModules(o){if(o<P.MIN_VERSION||o>P.MAX_VERSION)throw new RangeError("Version number out of range");let h=(16*o+128)*o+64;if(o>=2){const i=Math.floor(o/7)+2;h-=(25*i-10)*i-55,o>=7&&(h-=36)}return d(208<=h&&h<=29648),h}static getNumDataCodewords(o,h){return Math.floor(P.getNumRawDataModules(o)/8)-P.ECC_CODEWORDS_PER_BLOCK[h.ordinal][o]*P.NUM_ERROR_CORRECTION_BLOCKS[h.ordinal][o]}static reedSolomonComputeDivisor(o){if(o<1||o>255)throw new RangeError("Degree out of range");let h=[];for(let c=0;c<o-1;c++)h.push(0);h.push(1);let i=1;for(let c=0;c<o;c++){for(let m=0;m<h.length;m++)h[m]=P.reedSolomonMultiply(h[m],i),m+1<h.length&&(h[m]^=h[m+1]);i=P.reedSolomonMultiply(i,2)}return h}static reedSolomonComputeRemainder(o,h){let i=h.map(c=>0);for(const c of o){const m=c^i.shift();i.push(0),h.forEach((y,x)=>i[x]^=P.reedSolomonMultiply(y,m))}return i}static reedSolomonMultiply(o,h){if(o>>>8||h>>>8)throw new RangeError("Byte out of range");let i=0;for(let c=7;c>=0;c--)i=i<<1^(i>>>7)*285,i^=(h>>>c&1)*o;return d(i>>>8==0),i}finderPenaltyCountPatterns(o){const h=o[1];d(h<=this.size*3);const i=h>0&&o[2]==h&&o[3]==h*3&&o[4]==h&&o[5]==h;return(i&&o[0]>=h*4&&o[6]>=h?1:0)+(i&&o[6]>=h*4&&o[0]>=h?1:0)}finderPenaltyTerminateAndCount(o,h,i){return o&&(this.finderPenaltyAddHistory(h,i),h=0),h+=this.size,this.finderPenaltyAddHistory(h,i),this.finderPenaltyCountPatterns(i)}finderPenaltyAddHistory(o,h){h[0]==0&&(o+=this.size),h.pop(),h.unshift(o)}};s.MIN_VERSION=1,s.MAX_VERSION=40,s.PENALTY_N1=3,s.PENALTY_N2=3,s.PENALTY_N3=40,s.PENALTY_N4=10,s.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],s.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],n.QrCode=s;function t(f,o,h){if(o<0||o>31||f>>>o)throw new RangeError("Value out of range");for(let i=o-1;i>=0;i--)h.push(f>>>i&1)}function a(f,o){return(f>>>o&1)!=0}function d(f){if(!f)throw new Error("Assertion error")}const l=class J{constructor(o,h,i){if(this.mode=o,this.numChars=h,this.bitData=i,h<0)throw new RangeError("Invalid argument");this.bitData=i.slice()}static makeBytes(o){let h=[];for(const i of o)t(i,8,h);return new J(J.Mode.BYTE,o.length,h)}static makeNumeric(o){if(!J.isNumeric(o))throw new RangeError("String contains non-numeric characters");let h=[];for(let i=0;i<o.length;){const c=Math.min(o.length-i,3);t(parseInt(o.substring(i,i+c),10),c*3+1,h),i+=c}return new J(J.Mode.NUMERIC,o.length,h)}static makeAlphanumeric(o){if(!J.isAlphanumeric(o))throw new RangeError("String contains unencodable characters in alphanumeric mode");let h=[],i;for(i=0;i+2<=o.length;i+=2){let c=J.ALPHANUMERIC_CHARSET.indexOf(o.charAt(i))*45;c+=J.ALPHANUMERIC_CHARSET.indexOf(o.charAt(i+1)),t(c,11,h)}return i<o.length&&t(J.ALPHANUMERIC_CHARSET.indexOf(o.charAt(i)),6,h),new J(J.Mode.ALPHANUMERIC,o.length,h)}static makeSegments(o){return o==""?[]:J.isNumeric(o)?[J.makeNumeric(o)]:J.isAlphanumeric(o)?[J.makeAlphanumeric(o)]:[J.makeBytes(J.toUtf8ByteArray(o))]}static makeEci(o){let h=[];if(o<0)throw new RangeError("ECI assignment value out of range");if(o<128)t(o,8,h);else if(o<16384)t(2,2,h),t(o,14,h);else if(o<1e6)t(6,3,h),t(o,21,h);else throw new RangeError("ECI assignment value out of range");return new J(J.Mode.ECI,0,h)}static isNumeric(o){return J.NUMERIC_REGEX.test(o)}static isAlphanumeric(o){return J.ALPHANUMERIC_REGEX.test(o)}getData(){return this.bitData.slice()}static getTotalBits(o,h){let i=0;for(const c of o){const m=c.mode.numCharCountBits(h);if(c.numChars>=1<<m)return 1/0;i+=4+m+c.bitData.length}return i}static toUtf8ByteArray(o){o=encodeURI(o);let h=[];for(let i=0;i<o.length;i++)o.charAt(i)!="%"?h.push(o.charCodeAt(i)):(h.push(parseInt(o.substring(i+1,i+3),16)),i+=2);return h}};l.NUMERIC_REGEX=/^[0-9]*$/,l.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,l.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let u=l;n.QrSegment=l})(De||(De={}));(n=>{(s=>{const t=class{constructor(d,l){this.ordinal=d,this.formatBits=l}};t.LOW=new t(0,1),t.MEDIUM=new t(1,0),t.QUARTILE=new t(2,3),t.HIGH=new t(3,2),s.Ecc=t})(n.QrCode||(n.QrCode={}))})(De||(De={}));(n=>{(s=>{const t=class{constructor(d,l){this.modeBits=d,this.numBitsCharCount=l}numCharCountBits(d){return this.numBitsCharCount[Math.floor((d+7)/17)]}};t.NUMERIC=new t(1,[10,12,14]),t.ALPHANUMERIC=new t(2,[9,11,13]),t.BYTE=new t(4,[8,16,16]),t.KANJI=new t(8,[8,10,12]),t.ECI=new t(7,[0,0,0]),s.Mode=t})(n.QrSegment||(n.QrSegment={}))})(De||(De={}));var qe=De;/**
6
+ * @license qrcode.react
7
+ * Copyright (c) Paul O'Shannessy
8
+ * SPDX-License-Identifier: ISC
9
+ */var fn={L:qe.QrCode.Ecc.LOW,M:qe.QrCode.Ecc.MEDIUM,Q:qe.QrCode.Ecc.QUARTILE,H:qe.QrCode.Ecc.HIGH},ms=128,ps="L",fs="#FFFFFF",gs="#000000",xs=!1,vs=1,gn=4,xn=0,vn=.1;function ys(n,s=0){const t=[];return n.forEach(function(a,d){let l=null;a.forEach(function(u,f){if(!u&&l!==null){t.push(`M${l+s} ${d+s}h${f-l}v1H${l+s}z`),l=null;return}if(f===a.length-1){if(!u)return;l===null?t.push(`M${f+s},${d+s} h1v1H${f+s}z`):t.push(`M${l+s},${d+s} h${f+1-l}v1H${l+s}z`);return}u&&l===null&&(l=f)})}),t.join("")}function js(n,s){return n.slice().map((t,a)=>a<s.y||a>=s.y+s.h?t:t.map((d,l)=>l<s.x||l>=s.x+s.w?d:!1))}function yn(n,s,t,a){if(a==null)return null;const d=n.length+t*2,l=Math.floor(s*vn),u=d/s,f=(a.width||l)*u,o=(a.height||l)*u,h=a.x==null?n.length/2-f/2:a.x*u,i=a.y==null?n.length/2-o/2:a.y*u,c=a.opacity==null?1:a.opacity;let m=null;if(a.excavate){let x=Math.floor(h),g=Math.floor(i),v=Math.ceil(f+h-x),C=Math.ceil(o+i-g);m={x,y:g,w:v,h:C}}const y=a.crossOrigin;return{x:h,y:i,h:o,w:f,excavation:m,opacity:c,crossOrigin:y}}function jn(n,s){return s!=null?Math.max(Math.floor(s),0):n?gn:xn}function Cs({value:n,level:s,minVersion:t,includeMargin:a,marginSize:d,imageSettings:l,size:u,boostLevel:f}){let o=U.useMemo(()=>{const x=(Array.isArray(n)?n:[n]).reduce((g,v)=>(g.push(...qe.QrSegment.makeSegments(v)),g),[]);return qe.QrCode.encodeSegments(x,fn[s],t,void 0,void 0,f)},[n,s,t,f]);const{cells:h,margin:i,numCells:c,calculatedImageSettings:m}=U.useMemo(()=>{let y=o.getModules();const x=jn(a,d),g=y.length+x*2,v=yn(y,u,x,l);return{cells:y,margin:x,numCells:g,calculatedImageSettings:v}},[o,u,l,a,d]);return{qrcode:o,margin:i,cells:h,numCells:c,calculatedImageSettings:m}}var Cn=(function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0})(),bs=U.forwardRef(function(s,t){const a=s,{value:d,size:l=ms,level:u=ps,bgColor:f=fs,fgColor:o=gs,includeMargin:h=xs,minVersion:i=vs,boostLevel:c,marginSize:m,imageSettings:y}=a,g=xt(a,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:v}=g,C=xt(g,["style"]),k=y==null?void 0:y.src,N=U.useRef(null),b=U.useRef(null),T=U.useCallback(A=>{N.current=A,typeof t=="function"?t(A):t&&(t.current=A)},[t]),[E,L]=U.useState(!1),{margin:I,cells:M,numCells:D,calculatedImageSettings:O}=Cs({value:d,level:u,minVersion:i,boostLevel:c,includeMargin:h,marginSize:m,imageSettings:y,size:l});U.useEffect(()=>{if(N.current!=null){const A=N.current,X=A.getContext("2d");if(!X)return;let re=M;const Z=b.current,me=O!=null&&Z!==null&&Z.complete&&Z.naturalHeight!==0&&Z.naturalWidth!==0;me&&O.excavation!=null&&(re=js(M,O.excavation));const be=window.devicePixelRatio||1;A.height=A.width=l*be;const ve=l/D*be;X.scale(ve,ve),X.fillStyle=f,X.fillRect(0,0,D,D),X.fillStyle=o,Cn?X.fill(new Path2D(ys(re,I))):M.forEach(function(G,pe){G.forEach(function(le,ye){le&&X.fillRect(ye+I,pe+I,1,1)})}),O&&(X.globalAlpha=O.opacity),me&&X.drawImage(Z,O.x+I,O.y+I,O.w,O.h)}}),U.useEffect(()=>{L(!1)},[k]);const ae=gt({height:l,width:l},v);let ne=null;return k!=null&&(ne=U.createElement("img",{src:k,key:k,style:{display:"none"},onLoad:()=>{L(!0)},ref:b,crossOrigin:O==null?void 0:O.crossOrigin})),U.createElement(U.Fragment,null,U.createElement("canvas",gt({style:ae,height:l,width:l,ref:T,role:"img"},C)),ne)});bs.displayName="QRCodeCanvas";var bn=U.forwardRef(function(s,t){const a=s,{value:d,size:l=ms,level:u=ps,bgColor:f=fs,fgColor:o=gs,includeMargin:h=xs,minVersion:i=vs,boostLevel:c,title:m,marginSize:y,imageSettings:x}=a,g=xt(a,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:v,cells:C,numCells:k,calculatedImageSettings:N}=Cs({value:d,level:u,minVersion:i,boostLevel:c,includeMargin:h,marginSize:y,imageSettings:x,size:l});let b=C,T=null;x!=null&&N!=null&&(N.excavation!=null&&(b=js(C,N.excavation)),T=U.createElement("image",{href:x.src,height:N.h,width:N.w,x:N.x+v,y:N.y+v,preserveAspectRatio:"none",opacity:N.opacity,crossOrigin:N.crossOrigin}));const E=ys(b,v);return U.createElement("svg",gt({height:l,width:l,viewBox:`0 0 ${k} ${k}`,ref:t,role:"img"},g),!!m&&U.createElement("title",null,m),U.createElement("path",{fill:f,d:`M0,0 h${k}v${k}H0z`,shapeRendering:"crispEdges"}),U.createElement("path",{fill:o,d:E,shapeRendering:"crispEdges"}),T)});bn.displayName="QRCodeSVG";const Nn=[{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}],_n={calibrationModels:Nn},ht=_n.calibrationModels,Sn=[{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:"Українська"}],kn=n=>{const s=t=>t.toUpperCase().split("").map(a=>String.fromCodePoint(127462+a.charCodeAt(0)-65)).join("");return!n||n.length!==2?s("CN"):s(n)},Ie=class Ie extends U.Component{constructor(t){super(t);B(this,"handleShowPrompts",()=>{this.setState({promptModalVisible:!0,promptData:this.extractUserPrompts()})});B(this,"handleExportPromptsTxt",()=>{const t=this.state.promptData;if(!t||t.length===0)return;const a=[];for(const f of t){const o=[],h=f.timestamp?new Date(f.timestamp).toLocaleString():"";h&&o.push(`${h}:
10
+ `);const i=(f.segments||[]).filter(c=>c.type==="text").map(c=>c.content);i.length>0&&o.push(i.join(`
11
+ `)),a.push(o.join(`
12
+ `))}if(a.length===0)return;const d=new Blob([a.join(`
13
+
14
+
15
+
16
+ `)],{type:"text/plain;charset=utf-8"}),l=URL.createObjectURL(d),u=document.createElement("a");u.href=l,u.download=`user-prompts-${new Date().toISOString().slice(0,10)}.txt`,u.click(),URL.revokeObjectURL(l)});B(this,"handleCalibrationModelChange",t=>{this.setState({calibrationModel:t}),localStorage.setItem("ccv_calibrationModel",t)});B(this,"handleShowProjectStats",()=>{this.setState({projectStatsVisible:!0,projectStatsLoading:!0}),fetch(oe("/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}))});B(this,"fetchPlugins",()=>fetch(oe("/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(()=>{}));B(this,"handleShowPlugins",()=>{this.setState({pluginModalVisible:!0}),this.fetchPlugins()});B(this,"handleTogglePlugin",(t,a)=>{fetch(oe("/api/preferences")).then(d=>d.json()).then(d=>{let l=Array.isArray(d.disabledPlugins)?[...d.disabledPlugins]:[];return a?l=l.filter(u=>u!==t):l.includes(t)||l.push(t),fetch(oe("/api/preferences"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({disabledPlugins:l})})}).then(()=>fetch(oe("/api/plugins/reload"),{method:"POST"})).then(d=>{if(!d.ok)throw new Error(d.status);return d.json()}).then(d=>{this.setState({pluginsList:d.plugins||[],pluginsDir:d.pluginsDir||""})}).catch(()=>{})});B(this,"handleDeletePlugin",(t,a)=>{this.setState({deleteConfirmVisible:!0,deleteTarget:{file:t,name:a}})});B(this,"handleDeletePluginConfirm",()=>{const{file:t}=this.state.deleteTarget||{};t&&(this.setState({deleteConfirmVisible:!1,deleteTarget:null}),fetch(oe(`/api/plugins?file=${encodeURIComponent(t)}`),{method:"DELETE"}).then(a=>{if(!a.ok)throw new Error(a.status);return a.json()}).then(a=>{a.plugins&&this.setState({pluginsList:a.plugins,pluginsDir:a.pluginsDir||""})}).catch(()=>{}))});B(this,"handleReloadPlugins",()=>{fetch(oe("/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(()=>{})});B(this,"handleAddPlugin",()=>{const t=document.createElement("input");t.type="file",t.accept=".js,.mjs",t.multiple=!0,t.onchange=()=>{const a=t.files;if(!a||a.length===0)return;for(const l of a)if(!l.name.endsWith(".js")&&!l.name.endsWith(".mjs")){K.error(p("ui.plugins.invalidFile"));return}const d=Array.from(a).map(l=>new Promise((u,f)=>{const o=new FileReader;o.onload=()=>u({name:l.name,content:o.result}),o.onerror=()=>f(new Error(`Failed to read ${l.name}`)),o.readAsText(l)}));Promise.all(d).then(l=>fetch(oe("/api/plugins/upload"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:l})})).then(l=>l.ok?l.json():l.text().then(u=>{try{return JSON.parse(u)}catch{throw new Error(p("ui.plugins.serverError",{status:l.status}))}})).then(l=>{l.error?K.error(p("ui.plugins.addFailed",{reason:l.error})):l.plugins&&(this.setState({pluginsList:l.plugins,pluginsDir:l.pluginsDir||""}),K.success(p("ui.plugins.addSuccess")))}).catch(l=>{K.error(l.message)})},t.click()});B(this,"handleShowCdnModal",()=>{this.setState({cdnModalVisible:!0,cdnUrl:"",cdnLoading:!1})});B(this,"handleCdnUrlChange",t=>{this.setState({cdnUrl:t.target.value})});B(this,"handleCdnInstall",()=>{const{cdnUrl:t}=this.state;if(!t.trim()){K.error(p("ui.plugins.cdnUrlRequired"));return}try{new URL(t)}catch{K.error(p("ui.plugins.cdnInvalidUrl"));return}this.setState({cdnLoading:!0}),fetch(oe("/api/plugins/install-from-url"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:t.trim()})}).then(a=>a.json()).then(a=>{a.error?K.error(p("ui.plugins.cdnInstallFailed",{reason:a.error})):(K.success(p("ui.plugins.cdnInstallSuccess")),a.plugins&&this.setState({pluginsList:a.plugins,pluginsDir:a.pluginsDir||""}),this.setState({cdnModalVisible:!1,cdnUrl:""}))}).catch(a=>{K.error(p("ui.plugins.cdnInstallFailed",{reason:a.message||"Network error"}))}).finally(()=>{this.setState({cdnLoading:!1})})});B(this,"handleCdnCancel",()=>{this.setState({cdnModalVisible:!1,cdnUrl:"",cdnLoading:!1})});B(this,"fetchProcesses",()=>{this.setState({processLoading:!0}),fetch(oe("/api/ccv-processes")).then(t=>t.json()).then(t=>{this.setState({processList:t.processes||[],processLoading:!1})}).catch(()=>{this.setState({processList:[],processLoading:!1})})});B(this,"handleShowProcesses",()=>{this.setState({processModalVisible:!0}),this.fetchProcesses()});B(this,"handleKillProcess",t=>{ke.confirm({title:p("ui.processManagement.killConfirm"),onOk:()=>{fetch(oe("/api/ccv-processes/kill"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({pid:t})}).then(a=>a.json()).then(a=>{a.ok?(K.success(p("ui.processManagement.killed")),this.fetchProcesses()):K.error(a.error||p("ui.processManagement.killFailed"))}).catch(()=>{K.error(p("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:(a=>ht.some(d=>d.value===a)?a:"auto")(localStorage.getItem("ccv_calibrationModel")||"auto"),proxyModalVisible:!1,editingProxy:null,editForm:{name:"",baseURL:"",apiKey:"",models:"",activeModel:""},logDirDraft:null},this._rafId=null,this._expiredTimer=null,this.updateCountdown=this.updateCountdown.bind(this)}componentDidMount(){this.startCountdown(),fetch(oe("/api/local-url")).then(t=>t.json()).then(t=>{t.url&&this.setState({localUrl:t.url})}).catch(()=>{}),fetch(oe("/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:kn(t.country),countryInfo:t})}).catch(()=>{})}componentDidUpdate(t){t.cacheExpireAt!==this.props.cacheExpireAt&&this.startCountdown()}shouldComponentUpdate(t,a){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||a!==this.state}componentWillUnmount(){this._rafId&&cancelAnimationFrame(this._rafId),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._rafId&&cancelAnimationFrame(this._rafId),this._expiredTimer&&clearTimeout(this._expiredTimer),!this.props.cacheExpireAt){this.state.countdownText!==""&&this.setState({countdownText:""});return}this._rafId=requestAnimationFrame(this.updateCountdown)}updateCountdown(){const{cacheExpireAt:t}=this.props;if(!t){this.state.countdownText!==""&&this.setState({countdownText:""});return}const a=Math.max(0,t-Date.now());if(a<=0){const u=p("ui.cacheExpired");this.state.countdownText!==u&&this.setState({countdownText:u}),this._expiredTimer=setTimeout(()=>{this.state.countdownText!==""&&this.setState({countdownText:""})},5e3);return}const d=Math.ceil(a/1e3);let l;if(d>=60){const u=Math.floor(d/60),f=d%60;l=p("ui.minuteSecond",{m:u,s:String(f).padStart(2,"0")})}else l=p("ui.second",{s:d});l!==this.state.countdownText&&this.setState({countdownText:l}),this._rafId=requestAnimationFrame(this.updateCountdown)}static parseSegments(t){const a=[],d=/<([a-zA-Z_][\w-]*)(?:\s[^>]*)?>[\s\S]*?<\/\1>/g;let l=0,u;for(;(u=d.exec(t))!==null;){const o=t.slice(l,u.index).trim();o&&a.push({type:"text",content:o});const h=u[1];if(l=u.index+u[0].length,Ie.COMMAND_TAGS.has(h))continue;const i=new RegExp(`^<${h}(?:\\s[^>]*)?>([\\s\\S]*)<\\/${h}>$`),c=u[0].match(i),m=c?c[1].trim():u[0].trim();a.push({type:"system",content:m,label:h})}const f=t.slice(l).trim();return f&&a.push({type:"text",content:f}),a}static extractUserTexts(t){const a=[],d=[];let l=null;for(const u of t)if(u.role==="user"){if(typeof u.content=="string"){const f=u.content.trim();if(!f)continue;if(!We(f)){if(/Implement the following plan:/i.test(f))continue;a.push(f),d.push(f)}}else if(Array.isArray(u.content)){const{commands:f,textBlocks:o}=Ys(u.content);f.length>0&&(l=f[f.length-1]);const h=[];for(const c of o)/Implement the following plan:/i.test((c.text||"").trim())||h.push(c.text.trim());const i=u.content.filter(c=>{var m;return c.type==="text"&&((m=c.text)==null?void 0:m.trim())}).map(c=>c.text.trim());h.length>0&&(a.push(h.join(`
17
+ `)),d.push(i.join(`
18
+ `)))}}return{userMsgs:a,fullTexts:d,slashCmd:l}}extractUserPrompts(){var f;const{requests:t=[]}=this.props,a=[],d=new Set;let l=null;const u=t.filter(o=>Te(o));for(let o=0;o<u.length;o++){const h=u[o],i=((f=h.body)==null?void 0:f.messages)||[],c=h.timestamp||"",{userMsgs:m,fullTexts:y,slashCmd:x}=Ie.extractUserTexts(i);x&&x!=="/compact"&&x!==l&&a.push({type:"prompt",segments:[{type:"text",content:x}],timestamp:c}),l=x;for(let g=0;g<m.length;g++){const v=m[g];if(d.has(v))continue;d.add(v);const C=y[g]||v;a.push({type:"prompt",segments:Ie.parseSegments(C),timestamp:c})}}return a}renderTokenStats(){const{requests:t=[]}=this.props,a=Xs(t),d=Object.keys(a),l=Zs(t),u=ea(t);if(d.length===0&&l.length===0)return e.jsx("div",{className:r.tokenStatsEmpty,children:"暂无 token 数据"});const f=e.jsx("div",{className:r.tokenStatsColumn,children:d.map(c=>{const m=a[c],y=m.input+m.cacheCreation+m.cacheRead,x=y>0?(m.cacheRead/y*100).toFixed(1):"0.0";return e.jsxs("div",{className:d.length>1?r.modelCardSpaced:r.modelCard,children:[e.jsx("div",{className:r.modelName,children:c}),e.jsx("table",{className:r.statsTable,children:e.jsxs("tbody",{children:[e.jsxs("tr",{children:[e.jsx("td",{className:r.label,children:"Token"}),e.jsx("td",{className:r.th,children:"input"}),e.jsx("td",{className:r.th,children:"output"})]}),e.jsxs("tr",{className:r.rowBorder,children:[e.jsx("td",{className:r.label}),e.jsx("td",{className:r.td,children:q(y)}),e.jsx("td",{className:r.td,children:q(m.output)})]}),e.jsxs("tr",{children:[e.jsx("td",{className:r.label,children:"Cache"}),e.jsx("td",{className:r.th,children:"create"}),e.jsx("td",{className:r.th,children:"read"})]}),e.jsxs("tr",{className:r.rowBorder,children:[e.jsx("td",{className:r.label}),e.jsx("td",{className:r.td,children:q(m.cacheCreation)}),e.jsx("td",{className:r.td,children:q(m.cacheRead)})]}),e.jsxs("tr",{children:[e.jsx("td",{className:r.label,children:p("ui.hitRate")}),e.jsxs("td",{colSpan:2,className:r.td,children:[x,"%"]})]})]})})]},c)})}),o=this.renderCacheRebuildStats(),h=l.length>0?e.jsx("div",{className:r.toolStatsColumn,children:e.jsxs("div",{className:r.modelCard,children:[e.jsx("div",{className:r.modelName,children:p("ui.toolUsageStats")}),e.jsxs("table",{className:r.statsTable,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{className:`${r.th} ${r.thLeft}`,children:"Tool"}),e.jsx("td",{className:r.th,children:p("ui.cacheRebuild.count")})]})}),e.jsxs("tbody",{children:[l.map(([c,m])=>e.jsxs("tr",{className:r.rowBorder,children:[e.jsxs("td",{className:r.label,children:[c," ",e.jsx(ie,{doc:`Tool-${c}`})]}),e.jsx("td",{className:r.td,children:m})]},c)),l.length>1&&e.jsxs("tr",{className:r.rebuildTotalRow,children:[e.jsx("td",{className:r.label,children:"Total"}),e.jsx("td",{className:r.td,children:l.reduce((c,m)=>c+m[1],0)})]})]})]})]})}):null,i=u.length>0?e.jsx("div",{className:r.toolStatsColumn,children:e.jsxs("div",{className:r.modelCard,children:[e.jsx("div",{className:r.modelName,children:p("ui.skillUsageStats")}),e.jsxs("table",{className:r.statsTable,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{className:`${r.th} ${r.thLeft}`,children:"Skill"}),e.jsx("td",{className:r.th,children:p("ui.cacheRebuild.count")})]})}),e.jsxs("tbody",{children:[u.map(([c,m])=>e.jsxs("tr",{className:r.rowBorder,children:[e.jsx("td",{className:r.label,children:c}),e.jsx("td",{className:r.td,children:m})]},c)),u.length>1&&e.jsxs("tr",{className:r.rebuildTotalRow,children:[e.jsx("td",{className:r.label,children:"Total"}),e.jsx("td",{className:r.td,children:u.reduce((c,m)=>c+m[1],0)})]})]})]})]})}):null;return e.jsxs("div",{className:r.tokenStatsContainer,children:[f,o,h,i]})}_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(o=>({_cacheSectionCollapsed:{...o._cacheSectionCollapsed||{},messages:!1}}),()=>this.scrollToCacheMsg(t));return}const a=this._cacheScrollEl;if(!a)return;const d=a.querySelector(`[data-msg-idx="${t}"]`);if(!d)return;clearTimeout(this._cacheScrollSettleTimer),clearTimeout(this._cacheFadeClearTimer),clearTimeout(this._cacheAutoFadeTimer),clearTimeout(this._cacheHighlightDelayTimer),this._cacheUnbindScrollFade(),this._cacheScrollEndHandler&&a.removeEventListener("scrollend",this._cacheScrollEndHandler),this.setState({cacheHighlightIdx:null,cacheHighlightFading:!1});let l=!1,u=!1;const f=()=>{!l||!u||(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=()=>{a.removeEventListener("scrollend",this._cacheScrollEndHandler),l=!0,f()},a.addEventListener("scrollend",this._cacheScrollEndHandler,{once:!0}),this._cacheScrollSettleTimer=setTimeout(()=>{a.removeEventListener("scrollend",this._cacheScrollEndHandler),l=!0,f()},800),this._cacheHighlightDelayTimer=setTimeout(()=>{u=!0,f()},500),d.scrollIntoView({behavior:"smooth",block:"center"})}renderCacheContentPopover(t){const{requests:a=[],serverCachedContent:d}=this.props,l=d||Yt(a);if(l&&(l.cacheCreateTokens>0||l.cacheReadTokens>0)&&(this._lastCachedTokens={cacheCreateTokens:l.cacheCreateTokens,cacheReadTokens:l.cacheReadTokens}),t>0&&(this._lastContextPercent=t),!l||l.system.length===0&&l.messages.length===0&&l.tools.length===0)return e.jsx("div",{className:r.cachePopoverEmpty,children:p("ui.noCachedContent")});const u=(i,c,m,y)=>{if(c.length===0)return null;const x=i===p("ui.messages"),g=(this.state._cacheSectionCollapsed||{})[y],v=g!==void 0?!!g:y==="tools",C=()=>this.setState(k=>({_cacheSectionCollapsed:{...k._cacheSectionCollapsed||{},[y]:!v}}));return e.jsxs("div",{className:r.cacheSection,children:[e.jsxs("button",{type:"button",className:r.cacheSectionTitle,onClick:C,"aria-expanded":!v,children:[e.jsx("span",{className:r.cacheSectionArrow,children:v?"▶":"▼"}),i," (",c.length,")"]}),!v&&c.map((k,N)=>{const b=x?{"data-msg-idx":N}:{};let T=m||r.cacheCodeBlock;const E=x&&N===this.state.cacheHighlightIdx;return E&&(T+=" "+(this.state.cacheHighlightFading?r.cacheBlockHighlightFading:r.cacheBlockHighlight)),e.jsxs("pre",{className:T,...b,style:E?{position:"relative"}:void 0,children:[E&&e.jsx("svg",{className:`${r.cacheBorderSvg}${this.state.cacheHighlightFading?" "+r.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:r.cacheBorderRect})}),k]},N)})]})},f=()=>{const i=[];return l.tools.length>0&&(i.push(`=== ${p("ui.tools")} (${l.tools.length}) ===`),l.tools.forEach(c=>i.push(c))),l.system.length>0&&(i.push(`
19
+ === ${p("ui.systemPrompt")} (${l.system.length}) ===`),l.system.forEach(c=>i.push(c))),l.messages.length>0&&(i.push(`
20
+ === ${p("ui.messages")} (${l.messages.length}) ===`),l.messages.forEach(c=>i.push(c))),i.join(`
21
+
22
+ `)},o=l.messages.map((i,c)=>({text:i,msgIdx:c})).filter(({text:i})=>i.startsWith("[user]")).map(({text:i,msgIdx:c})=>{const m=i.replace(/^\[user\]\s*/,"").trim();return!m||We(m)?{cleaned:"",msgIdx:c}:{cleaned:Ie.parseSegments(m).filter(g=>g.type==="text").map(g=>g.content.trim()).filter(g=>g&&!We(g)).join(" ").trim(),msgIdx:c}}).filter(({cleaned:i})=>!(!i||/Implement the following plan:/i.test(i))),h=o.length>0?e.jsx("div",{className:r.cacheNavList,children:o.map(({cleaned:i,msgIdx:c})=>e.jsx("div",{className:r.cacheNavItem,onClick:()=>this.scrollToCacheMsg(c),children:i},c))}):null;return e.jsxs("div",{className:r.cachePopover,children:[e.jsx("div",{className:r.cachePopoverHeader,children:e.jsxs("div",{className:r.cachePopoverTitle,children:[p("ui.cachedContentTitle"),e.jsx(ie,{doc:"KVCacheContent"}),e.jsx(Ve,{className:r.cacheCopyBtn,onClick:()=>{navigator.clipboard.writeText(f()).then(()=>{K.success(p("ui.copied"))}).catch(()=>{})}}),e.jsx("span",{className:r.cacheCalibrationLabel,children:p("ui.calibrationModelLabel")}),e.jsx($e,{size:"small",value:this.state.calibrationModel,onChange:this.handleCalibrationModelChange,options:ht,className:r.calibrationSelect,popupMatchSelectWidth:!1})]})}),(()=>{const c=l.cacheCreateTokens>0||l.cacheReadTokens>0?l:this._lastCachedTokens,m=t>0?t:this._lastContextPercent||0;return c||h?e.jsxs("div",{className:r.cacheTokenInfo,children:[c&&e.jsxs(e.Fragment,{children:[p("ui.tokens"),": ",e.jsxs("span",{className:r.cacheWriteToken,children:["write ",q(c.cacheCreateTokens)]})," / ",e.jsxs("span",{className:r.cacheReadToken,children:["read ",q(c.cacheReadTokens)]}),m>0&&e.jsxs("span",{className:r.cacheCtxPercent,children:["(ctx:",m,"%)"]})]}),h&&e.jsx(ze,{content:h,trigger:"hover",placement:"left",children:e.jsx("span",{className:r.cacheNavBtn,children:p("ui.userPromptNav")})})]}):null})(),e.jsxs("div",{className:r.cacheScrollArea,ref:i=>{this._cacheScrollEl=i,i&&!this._cacheScrollInited&&(this._cacheScrollInited=!0,requestAnimationFrame(()=>{i.scrollTop=i.scrollHeight}))},children:[u(p("ui.tools"),l.tools,void 0,"tools"),u(p("ui.systemPrompt"),l.system,r.cacheCodeBlockSystem,"system"),u(p("ui.messages"),l.messages,void 0,"messages")]})]})}renderCacheRebuildStats(){const{requests:t=[]}=this.props,a=ta(t),d=["ttl","system_change","tools_change","model_change","msg_truncated","msg_modified","key_change"],l={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"},u=d.filter(v=>a[v].count>0),f=u.reduce((v,C)=>v+a[C].count,0),o=u.reduce((v,C)=>v+a[C].cacheCreate,0);sa(t);const h={},i={};for(let v=0;v<t.length;v++){const C=Ke(t[v],t[v+1]);if(C.type==="SubAgent"){const k=C.subType||"Other";h[k]=(h[k]||0)+1}else if(C.type==="Teammate"){const k=C.subType||"Teammate";i[k]=(i[k]||0)+1}}const c=Object.entries(h).sort((v,C)=>C[1]-v[1]),m=Object.entries(i).sort((v,C)=>C[1]-v[1]),y=u.length>0,x=c.length>0,g=m.length>0;return!y&&!x&&!g?null:e.jsxs("div",{className:r.toolStatsColumn,children:[y&&e.jsxs("div",{className:x||g?r.modelCardSpaced:r.modelCard,children:[e.jsxs("div",{className:r.modelName,children:["MainAgent",e.jsx(ie,{doc:"MainAgent"})," ",p("ui.cacheRebuildStats"),e.jsx(ie,{doc:"CacheRebuild"})]}),e.jsxs("table",{className:r.statsTable,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{className:`${r.th} ${r.thLeft}`,children:p("ui.cacheRebuild.reason")}),e.jsx("td",{className:r.th,children:p("ui.cacheRebuild.count")}),e.jsx("td",{className:r.th,children:p("ui.cacheRebuild.cacheCreate")})]})}),e.jsxs("tbody",{children:[u.map(v=>e.jsxs("tr",{className:r.rowBorder,children:[e.jsx("td",{className:r.label,children:p(`ui.${l[v]}`)}),e.jsx("td",{className:r.td,children:a[v].count}),e.jsx("td",{className:r.td,children:q(a[v].cacheCreate)})]},v)),u.length>1&&e.jsxs("tr",{className:r.rebuildTotalRow,children:[e.jsx("td",{className:r.label,children:"Total"}),e.jsx("td",{className:r.td,children:f}),e.jsx("td",{className:r.td,children:q(o)})]})]})]})]}),x&&e.jsxs("div",{className:g?r.modelCardSpaced:r.modelCard,children:[e.jsx("div",{className:r.modelName,children:p("ui.subAgentStats")}),e.jsxs("table",{className:r.statsTable,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{className:`${r.th} ${r.thLeft}`,children:"SubAgent"}),e.jsx("td",{className:r.th,children:p("ui.cacheRebuild.count")})]})}),e.jsxs("tbody",{children:[c.map(([v,C])=>e.jsxs("tr",{className:r.rowBorder,children:[e.jsxs("td",{className:r.label,children:[v," ",e.jsx(ie,{doc:`SubAgent-${v}`})]}),e.jsx("td",{className:r.td,children:C})]},v)),c.length>1&&e.jsxs("tr",{className:r.rebuildTotalRow,children:[e.jsx("td",{className:r.label,children:"Total"}),e.jsx("td",{className:r.td,children:c.reduce((v,C)=>v+C[1],0)})]})]})]})]}),g&&e.jsxs("div",{className:r.modelCard,children:[e.jsxs("div",{className:r.modelName,children:["Teammate",e.jsx(ie,{doc:"Teammate"})]}),e.jsxs("table",{className:r.statsTable,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{className:`${r.th} ${r.thLeft}`,children:"Name"}),e.jsx("td",{className:r.th,children:p("ui.cacheRebuild.count")})]})}),e.jsxs("tbody",{children:[m.map(([v,C])=>e.jsxs("tr",{className:r.rowBorder,children:[e.jsx("td",{className:r.label,children:v}),e.jsx("td",{className:r.td,children:C})]},v)),m.length>1&&e.jsxs("tr",{className:r.rebuildTotalRow,children:[e.jsx("td",{className:r.label,children:"Total"}),e.jsx("td",{className:r.td,children:m.reduce((v,C)=>v+C[1],0)})]})]})]})]})]})}renderTextPrompt(t){return e.jsx("div",{className:r.textPromptCard,children:t.segments.map((a,d)=>a.type==="text"?e.jsx("pre",{className:r.preText,children:a.content},d):e.jsx(aa,{size:"small",className:r.systemCollapse,items:[{key:`sys-${d}`,label:e.jsx("span",{className:r.systemLabel,children:a.label}),children:e.jsx("pre",{className:r.preSys,children:a.content})}]},d))})}renderOriginalPrompt(t){const a=t.segments.filter(d=>d.type==="text");return a.length===0?null:e.jsx("div",{className:r.textPromptCard,children:a.map((d,l)=>e.jsx("pre",{className:r.preText,children:d.content},l))})}buildTextModeContent(){const{promptData:t}=this.state,a=[];for(const d of t){const l=(d.segments||[]).filter(u=>u.type==="text").map(u=>u.content);l.length>0&&a.push(l.join(`
23
+ `))}return a.join(`
24
+
25
+
26
+ `)}renderProjectStatsContent(){const{projectStats:t,projectStatsLoading:a}=this.state;if(a)return e.jsx("div",{className:r.projectStatsCenter,children:e.jsx(Xt,{})});if(!t)return e.jsx("div",{className:r.projectStatsEmpty,children:p("ui.projectStats.noData")});const{summary:d,models:l,updatedAt:u}=t;l&&Object.entries(l).sort((h,i)=>i[1]-h[1]);const f={};if(t.files){for(const h of Object.values(t.files))if(h.models)for(const[i,c]of Object.entries(h.models))f[i]||(f[i]={input:0,output:0,cacheRead:0,cacheCreation:0,count:0}),f[i].input+=c.input_tokens||0,f[i].output+=c.output_tokens||0,f[i].cacheRead+=c.cache_read_input_tokens||0,f[i].cacheCreation+=c.cache_creation_input_tokens||0,f[i].count+=c.count||0}const o=Object.entries(f).sort((h,i)=>i[1].count-h[1].count);return e.jsxs("div",{className:r.projectStatsContent,children:[u&&e.jsx("div",{className:r.projectStatsUpdated,children:p("ui.projectStats.updatedAt",{time:new Date(u).toLocaleString()})}),e.jsxs("div",{className:r.projectStatsSummary,children:[e.jsxs("div",{className:r.projectStatCard,children:[e.jsx("div",{className:r.projectStatValue,children:(d==null?void 0:d.requestCount)??0}),e.jsx("div",{className:r.projectStatLabel,children:p("ui.projectStats.totalRequests")})]}),e.jsxs("div",{className:r.projectStatCard,children:[e.jsx("div",{className:r.projectStatValue,children:(d==null?void 0:d.turnCount)??(d==null?void 0:d.sessionCount)??0}),e.jsx("div",{className:r.projectStatLabel,children:p("ui.projectStats.turnCount")})]}),e.jsxs("div",{className:r.projectStatCard,children:[e.jsx("div",{className:r.projectStatValue,children:(d==null?void 0:d.fileCount)??0}),e.jsx("div",{className:r.projectStatLabel,children:p("ui.projectStats.totalFiles")})]}),e.jsxs("div",{className:r.projectStatCard,children:[e.jsx("div",{className:r.projectStatValue,children:q(d==null?void 0:d.input_tokens)}),e.jsx("div",{className:r.projectStatLabel,children:"Input Tokens"})]}),e.jsxs("div",{className:r.projectStatCard,children:[e.jsx("div",{className:r.projectStatValue,children:q(d==null?void 0:d.output_tokens)}),e.jsx("div",{className:r.projectStatLabel,children:"Output Tokens"})]})]}),o.length>0&&e.jsxs("div",{className:r.projectStatsSection,children:[e.jsx("div",{className:r.projectStatsSectionTitle,children:p("ui.projectStats.modelUsage")}),o.map(([h,i])=>{const c=i.input+i.cacheRead+i.cacheCreation,m=c>0?(i.cacheRead/c*100).toFixed(1):"0.0";return e.jsxs("div",{className:r.projectStatsModelCard,children:[e.jsxs("div",{className:r.projectStatsModelHeader,children:[e.jsx("span",{className:r.projectStatsModelName,children:h}),e.jsxs("span",{className:r.projectStatsModelCount,children:[i.count," reqs"]})]}),e.jsx("table",{className:r.statsTable,children:e.jsxs("tbody",{children:[e.jsxs("tr",{children:[e.jsx("td",{className:r.label,children:"Token"}),e.jsx("td",{className:r.th,children:"input"}),e.jsx("td",{className:r.th,children:"output"})]}),e.jsxs("tr",{className:r.rowBorder,children:[e.jsx("td",{className:r.label}),e.jsx("td",{className:r.td,children:q(c)}),e.jsx("td",{className:r.td,children:q(i.output)})]}),e.jsxs("tr",{children:[e.jsx("td",{className:r.label,children:"Cache"}),e.jsx("td",{className:r.th,children:"create"}),e.jsx("td",{className:r.th,children:"read"})]}),e.jsxs("tr",{className:r.rowBorder,children:[e.jsx("td",{className:r.label}),e.jsx("td",{className:r.td,children:q(i.cacheCreation)}),e.jsx("td",{className:r.td,children:q(i.cacheRead)})]}),e.jsxs("tr",{children:[e.jsx("td",{className:r.label,children:p("ui.hitRate")}),e.jsxs("td",{colSpan:2,className:r.td,children:[m,"%"]})]})]})})]},h)})]})]})}render(){const{requestCount:t,requests:a=[],viewMode:d,cacheType:l,onToggleViewMode:u,onImportLocalLogs:f,onLangChange:o,isLocalLog:h,localLogFile:i,projectName:c,collapseToolResults:m,onCollapseToolResultsChange:y,expandThinking:x,onExpandThinkingChange:g,showFullToolContent:v,onShowFullToolContentChange:C,expandDiff:k,onExpandDiffChange:N,filterIrrelevant:b,onFilterIrrelevantChange:T,logDir:E,onLogDirChange:L,updateInfo:I,onDismissUpdate:M,cliMode:D,terminalVisible:O,onToggleTerminal:ae,onReturnToWorkspaces:ne,contextWindow:A,serverCachedContent:X,resumeAutoChoice:re,onResumeAutoChoiceToggle:Z,onResumeAutoChoiceChange:me,themeColor:be,onThemeColorChange:ve,autoApproveSeconds:G,onAutoApproveChange:pe}=this.props,{countdownText:le}=this.state,ye=[{key:"import-local",icon:e.jsx(qt,{}),label:p("ui.importLocalLogs"),onClick:f},{key:"export-prompts",icon:e.jsx(en,{}),label:p("ui.exportPrompts"),onClick:this.handleShowPrompts},{key:"plugin-management",icon:e.jsx(zt,{}),label:p("ui.pluginManagement"),onClick:this.handleShowPlugins},{key:"switch-workspace",icon:e.jsx(qt,{className:r.iconMirror}),label:e.jsx("span",{className:r.disabledMenuItem,children:p("ui.switchWorkspace")}),disabled:!0},{key:"process-management",icon:e.jsx(dt,{}),label:p("ui.processManagement"),onClick:this.handleShowProcesses},{key:"proxy-switch",icon:e.jsx($t,{}),label:p("ui.proxySwitch"),onClick:()=>this.setState({proxyModalVisible:!0})},{type:"divider"},{key:"project-stats",icon:e.jsx(Vt,{}),label:p("ui.projectStats"),onClick:this.handleShowProjectStats},...d==="raw"?[{key:"global-settings",icon:e.jsx(Wt,{}),label:p("ui.globalSettings"),onClick:()=>this.setState({globalSettingsVisible:!0})}]:[],...d==="chat"?[{key:"display-settings",icon:e.jsx(Wt,{}),label:p("ui.settings"),onClick:()=>this.setState({settingsDrawerVisible:!0})}]:[],{key:"language",icon:e.jsx(an,{}),label:p("ui.languageSettings"),children:[{key:"lang-grid-container",type:"group",label:e.jsx("div",{className:r.langGrid,children:Sn.map(_=>e.jsx(F,{size:"small",type:_.value===la()?"primary":"default",onClick:W=>{W.stopPropagation(),na(_.value),o&&o()},className:r.langBtn,children:_.label},_.value))})}]}];return e.jsxs("div",{className:r.headerBar,children:[e.jsxs(Ue,{size:"middle",children:[e.jsx(oa,{menu:{items:ye,className:"logo-dropdown-menu"},trigger:["hover"],onOpenChange:_=>this.setState({logoDropdownOpen:_}),align:{offset:[-4,0]},children:e.jsx("span",{className:`${r.logoWrap}${this.state.logoDropdownOpen?` ${r.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:`${r.logoImage}${this.state.logoDropdownOpen?` ${r.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(ze,{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(xe,{className:r.tokenStatsTag,children:[e.jsx(dt,{className:r.tokenStatsIcon}),p("ui.tokenStats")]})}),this.props.activeProxyId&&this.props.activeProxyId!=="max"&&(()=>{const _=(this.props.proxyProfiles||[]).find(W=>W.id===this.props.activeProxyId);return _?e.jsxs(xe,{className:r.proxyProfileTag,onClick:()=>this.setState({proxyModalVisible:!0}),children:[e.jsx($t,{className:r.proxySwapIcon}),_.name,_.activeModel?` · ${_.activeModel}`:""]}):null})(),(()=>{var Ne,je,z,_e,ge;let _=0;const W=ht.find(ce=>ce.value===this.state.calibrationModel),fe=W==null?void 0:W.tokens;if(!h){if(fe&&(A==null?void 0:A.used_percentage)!=null){const ce=V=>{var Se,Ge;const Q=(Ge=(Se=V.response)==null?void 0:Se.body)==null?void 0:Ge.usage;return((Q==null?void 0:Q.input_tokens)||0)+((Q==null?void 0:Q.cache_creation_input_tokens)||0)+((Q==null?void 0:Q.cache_read_input_tokens)||0)};let te=0;for(let V=a.length-1;V>=0;V--)if(Te(a[V])&&((je=(Ne=a[V].response)==null?void 0:Ne.body)!=null&&je.usage)){te=ce(a[V]);break}if(te>0){const V=fe*.835;_=Math.min(100,Math.max(0,Math.round(te/V*100)))}else{const V=A.context_window_size||2e5;_=Math.min(100,Math.max(0,Math.round(A.used_percentage*V/fe/83.5*100)))}}else if((A==null?void 0:A.used_percentage)!=null){const ce=this.state.settingsModel?Et(this.state.settingsModel):0,te=A.context_window_size||2e5;ce&&ce!==te?_=Math.min(100,Math.max(0,Math.round(A.used_percentage*te/ce/83.5*100))):_=Math.min(100,Math.max(0,Math.round(A.used_percentage/83.5*100)))}else if(a.length>0){const ce=te=>{var Q,Se;const V=(Se=(Q=te.response)==null?void 0:Q.body)==null?void 0:Se.usage;return((V==null?void 0:V.input_tokens)||0)+((V==null?void 0:V.cache_creation_input_tokens)||0)+((V==null?void 0:V.cache_read_input_tokens)||0)};for(let te=a.length-1;te>=0;te--)if(Te(a[te])&&((_e=(z=a[te].response)==null?void 0:z.body)!=null&&_e.usage)){const V=ce(a[te]),Se=(fe||(A==null?void 0:A.context_window_size)||Et(((ge=a[te].body)==null?void 0:ge.model)||this.state.settingsModel))*.835;Se>0&&V>0&&(_=Math.min(100,Math.max(0,Math.round(V/Se*100))));break}}}_===0&&this._lastContextPercent>0&&(_=this._lastContextPercent);const we=_>=80?"var(--color-error-light)":_>=60?"var(--color-warning-light)":"var(--color-success)";return h?e.jsx(xe,{className:`${r.liveTag} ${r.liveTagHistory}`,children:e.jsx("span",{className:r.liveTagText,children:p("ui.historyLog",{file:i})})}):e.jsx(ze,{content:this.state._cachePopoverOpen?this.renderCacheContentPopover(_):e.jsx("div",{className:r.cachePopoverPlaceholder}),trigger:"hover",placement:"bottomLeft",overlayInnerStyle:{background:"var(--bg-elevated)",border:"1px solid var(--border-hover)",borderRadius:8,padding:"8px 8px"},onOpenChange:ce=>{this.setState({_cachePopoverOpen:ce}),ce||(this._cacheScrollInited=!1)},children:e.jsxs("span",{className:r.liveTag,style:{borderColor:we,color:we},children:[e.jsx("span",{className:r.liveTagFill,style:{width:`${_}%`,backgroundColor:we}}),e.jsx("span",{className:r.liveTagContent,children:e.jsxs("span",{className:r.liveTagText,children:[p("ui.liveMonitoring"),c?`:${c}`:""]})})]})})})(),I&&e.jsx(xe,{color:I.type==="completed"?"green":"orange",closable:!0,onClose:()=>M&&M(),children:I.type==="completed"?p("ui.update.completed",{version:I.version}):p("ui.update.majorAvailable",{version:I.version})})]}),e.jsxs(Ue,{size:"middle",children:[le&&d==="raw"&&e.jsxs(xe,{style:{background:"var(--bg-surface)",border:"1px solid var(--border-hover)",color:le===p("ui.cacheExpired")?"var(--color-error-light)":"var(--text-secondary)"},children:[p("ui.cacheCountdown",{type:l?`(${l})`:""}),e.jsx("strong",{className:r.countdownStrong,children:le})]}),d==="chat"&&D&&!h&&this.state.localUrl&&e.jsxs(e.Fragment,{children:[this.state.countryFlag&&e.jsx(ze,{content:this.state.countryInfo?e.jsxs("div",{className:r.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:r.countryInfoMeta,children:this.state.countryInfo.org}),this.state.countryInfo.ip&&e.jsx("div",{className:r.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(F,{className:r.compactBtnNoBorder,icon:e.jsx("span",{className:r.countryFlagIcon,children:this.state.countryFlag})})}),e.jsx(ze,{content:e.jsxs("div",{className:r.qrcodePopover,children:[e.jsx("div",{className:r.qrcodeTitle,children:p("ui.scanToCoding")}),e.jsx(bs,{value:this.state.localUrl,size:200,bgColor:"#141414",fgColor:"#d9d9d9",level:"M"}),e.jsx(Ee,{readOnly:!0,value:this.state.localUrl,className:r.qrcodeUrlInput,suffix:e.jsx(Ve,{className:r.qrcodeUrlCopy,onClick:()=>{navigator.clipboard.writeText(this.state.localUrl).then(()=>{K.success(p("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(F,{className:r.compactBtnNoBorder,icon:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r.svgIcon,children:[e.jsx("rect",{x:"5",y:"2",width:"14",height:"20",rx:"2",ry:"2"}),e.jsx("line",{x1:"12",y1:"18",x2:"12.01",y2:"18"})]})})})]}),D&&d==="chat"&&!h&&e.jsx(F,{className:r.compactBtn,type:O?"primary":"default",ghost:O,icon:e.jsx(Ze,{}),onClick:ae,children:p("ui.terminal")}),e.jsx(F,{className:r.compactBtn,type:d==="raw"?"primary":"default",icon:d==="raw"?e.jsx(cn,{}):e.jsx(Xe,{}),onClick:u,children:d==="raw"?p("ui.chatMode"):p("ui.rawMode")})]}),e.jsxs(ke,{title:`${p("ui.userPrompt")} (${this.state.promptData.length}${p("ui.promptCountUnit")})`,open:this.state.promptModalVisible,onCancel:()=>this.setState({promptModalVisible:!1}),footer:null,width:700,children:[e.jsx("div",{className:r.promptExportBar,children:e.jsx(F,{icon:e.jsx(ia,{}),onClick:this.handleExportPromptsTxt,children:p("ui.exportPromptsTxt")})}),e.jsx(Zt,{activeKey:this.state.promptViewMode,onChange:_=>this.setState({promptViewMode:_}),size:"small",items:[{key:"original",label:p("ui.promptModeOriginal")},{key:"context",label:p("ui.promptModeContext")},{key:"text",label:p("ui.promptModeText")}]}),this.state.promptViewMode==="text"?e.jsx("textarea",{readOnly:!0,className:r.promptTextarea,value:this.buildTextModeContent()}):e.jsxs("div",{className:r.promptScrollArea,children:[this.state.promptData.length===0&&e.jsx("div",{className:r.promptEmpty,children:p("ui.noPrompt")}),this.state.promptData.map((_,W)=>{const fe=_.timestamp?new Date(_.timestamp).toLocaleString():p("ui.unknownTime");return e.jsxs("div",{children:[e.jsxs("div",{className:r.promptTimestamp,children:[fe,":"]}),this.state.promptViewMode==="original"?this.renderOriginalPrompt(_):this.renderTextPrompt(_)]},W)})]})]}),e.jsxs(Ye,{title:p("ui.settings"),placement:"left",width:360,open:this.state.settingsDrawerVisible,onClose:()=>this.setState({settingsDrawerVisible:!1}),children:[e.jsxs("div",{className:r.settingsGroupBox,children:[e.jsx("div",{className:r.settingsGroupTitle,children:p("ui.chatDisplaySwitches")}),e.jsxs("div",{className:r.settingsItem,children:[e.jsx("span",{className:r.settingsLabel,children:p("ui.collapseToolResults")}),e.jsx(Re,{checked:!!m,onChange:_=>y&&y(_)})]}),e.jsxs("div",{className:r.settingsItem,children:[e.jsx("span",{className:r.settingsLabel,children:p("ui.expandThinking")}),e.jsx(Re,{checked:!!x,onChange:_=>g&&g(_)})]}),e.jsxs("div",{className:r.settingsItem,children:[e.jsx("span",{className:r.settingsLabel,children:p("ui.showFullToolContent")}),e.jsx(Re,{checked:!!v,onChange:_=>C&&C(_)})]})]}),e.jsxs("div",{className:r.settingsGroupBox,children:[e.jsx("div",{className:r.settingsGroupTitle,children:p("ui.userPreferences")}),e.jsxs("div",{className:r.settingsItem,children:[e.jsx("span",{className:r.settingsLabel,children:p("ui.resumeAutoChoice")}),e.jsx(Re,{checked:!!re,onChange:_=>Z&&Z(_)})]}),re&&e.jsx("div",{className:r.settingsItem,children:e.jsxs(Je.Group,{value:re,onChange:_=>me&&me(_.target.value),size:"small",children:[e.jsx(Je,{value:"continue",children:p("ui.resumeAutoChoice.continue")}),e.jsx(Je,{value:"new",children:p("ui.resumeAutoChoice.new")})]})}),e.jsxs("div",{className:r.settingsItem,children:[e.jsx("span",{className:r.settingsLabel,children:p("ui.permission.autoApprove.setting")}),e.jsx($e,{size:"small",value:G||0,onChange:_=>pe&&pe(_),options:[{label:p("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:r.settingsGroupBox,children:e.jsxs("div",{className:r.settingsItem,children:[e.jsx("span",{className:r.settingsLabel,children:p("ui.themeColor")}),e.jsx($e,{size:"small",value:be||"dark",onChange:_=>ve&&ve(_),options:[{label:p("ui.themeColor.dark"),value:"dark"},{label:p("ui.themeColor.light"),value:"light"}],style:{width:140}})]})})]}),e.jsxs(Ye,{title:e.jsxs("span",{children:[p("ui.globalSettings")," ",e.jsx(ie,{doc:"GlobalSettings"})]}),placement:"left",width:400,open:this.state.globalSettingsVisible,onClose:()=>this.setState({globalSettingsVisible:!1}),children:[e.jsxs("div",{className:r.settingsItem,children:[e.jsx("span",{className:r.settingsLabel,children:p("ui.filterIrrelevant")}),e.jsx(Re,{checked:!!b,onChange:_=>T&&T(_)})]}),e.jsxs("div",{className:r.settingsItem,children:[e.jsx("span",{className:r.settingsLabel,children:p("ui.expandDiff")}),e.jsx(Re,{checked:!!k,onChange:_=>N&&N(_)})]}),e.jsx("div",{className:r.settingsDivider}),e.jsx("div",{className:r.settingsLabel,children:p("ui.logDirTitle")}),e.jsx(Ee,{className:r.logDirInput,value:this.state.logDirDraft??E,onChange:_=>this.setState({logDirDraft:_.target.value}),onBlur:()=>{const _=this.state.logDirDraft;_!=null&&_!==E&&(L==null||L(_)),this.setState({logDirDraft:null})},onPressEnter:()=>{const _=this.state.logDirDraft;_!=null&&_!==E&&(L==null||L(_)),this.setState({logDirDraft:null})},placeholder:"~/.claude/cc-viewer"})]}),e.jsx(Ye,{title:e.jsxs("span",{children:[e.jsx(Vt,{className:r.titleIcon}),p("ui.projectStats")]}),placement:"left",width:400,open:this.state.projectStatsVisible,onClose:()=>this.setState({projectStatsVisible:!1}),children:this.renderProjectStatsContent()}),e.jsxs(ke,{title:e.jsxs("span",{children:[e.jsx(zt,{className:r.titleIcon}),p("ui.pluginManagement")]}),open:this.state.pluginModalVisible,onCancel:()=>this.setState({pluginModalVisible:!1}),footer:e.jsxs("div",{className:r.pluginModalFooter,children:[e.jsxs("div",{className:r.pluginModalFooterLeft,children:[e.jsx(F,{icon:e.jsx(Rt,{}),onClick:this.handleAddPlugin,children:p("ui.plugins.add")}),e.jsx(F,{icon:e.jsx(Ut,{}),onClick:this.handleShowCdnModal,children:p("ui.plugins.cdnInstall")})]}),e.jsx(F,{icon:e.jsx(ft,{}),onClick:this.handleReloadPlugins,children:p("ui.plugins.reload")})]}),width:560,children:[this.state.pluginsDir&&e.jsxs("div",{className:r.pluginDirHint,children:[e.jsxs("span",{className:r.pluginDirLabel,children:[p("ui.plugins.pluginsDir"),":"]})," ",e.jsx("code",{className:r.pluginDirPath,onClick:()=>{navigator.clipboard.writeText(this.state.pluginsDir).then(()=>{K.success(p("ui.copied"))}).catch(()=>{})},children:this.state.pluginsDir})]}),this.state.pluginsList.length===0?e.jsxs("div",{className:r.pluginEmpty,children:[e.jsx("div",{className:r.pluginEmptyTitle,children:p("ui.plugins.empty")}),e.jsx("div",{className:r.pluginEmptyHint,children:p("ui.plugins.emptyHint")})]}):e.jsx("div",{className:r.pluginList,children:this.state.pluginsList.map(_=>e.jsxs("div",{className:r.pluginItem,children:[e.jsxs("div",{className:r.pluginInfo,children:[e.jsx("span",{className:r.pluginName,children:_.name}),e.jsx("span",{className:r.pluginFile,children:_.file}),_.hooks.length>0&&e.jsx("span",{className:r.pluginHooks,children:_.hooks.map(W=>e.jsx("span",{className:r.pluginHookTag,children:W},W))})]}),e.jsxs("div",{className:r.pluginActions,children:[e.jsx(Re,{size:"small",checked:_.enabled,onChange:W=>this.handleTogglePlugin(_.name,W)}),e.jsx(F,{type:"text",size:"small",danger:!0,icon:e.jsx(pt,{}),onClick:()=>this.handleDeletePlugin(_.file,_.name)})]})]},_.file))})]}),e.jsx(ke,{title:p("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?p("ui.plugins.deleteConfirm",{name:this.state.deleteTarget.name}):""})}),e.jsx(ke,{title:e.jsxs("span",{children:[e.jsx(Ut,{className:r.titleIcon}),p("ui.plugins.cdnInstall")]}),open:this.state.cdnModalVisible,onCancel:this.handleCdnCancel,onOk:this.handleCdnInstall,confirmLoading:this.state.cdnLoading,okText:p("ui.plugins.cdnInstallBtn"),cancelText:p("ui.cancel"),width:480,children:e.jsxs("div",{children:[e.jsx("div",{className:r.cdnUrlLabel,children:p("ui.plugins.cdnUrl")}),e.jsx(Ee,{placeholder:p("ui.plugins.cdnUrlPlaceholder"),value:this.state.cdnUrl,onChange:this.handleCdnUrlChange,onPressEnter:this.handleCdnInstall,className:r.cdnInput})]})}),e.jsx(ke,{title:e.jsxs("span",{children:[e.jsx(dt,{className:r.titleIcon}),p("ui.processManagement")]}),open:this.state.processModalVisible,onCancel:()=>this.setState({processModalVisible:!1}),footer:e.jsx(F,{icon:e.jsx(ft,{}),onClick:this.fetchProcesses,loading:this.state.processLoading,children:p("ui.processManagement.refresh")}),width:780,children:e.jsx(ra,{dataSource:this.state.processList,rowKey:"pid",loading:this.state.processLoading,size:"middle",pagination:!1,columns:[{title:p("ui.processManagement.port"),dataIndex:"port",width:80,render:_=>_?e.jsx("a",{href:`${window.location.protocol}//127.0.0.1:${_}`,target:"_blank",rel:"noopener noreferrer",children:_}):""},{title:"PID",dataIndex:"pid",width:80},{title:p("ui.processManagement.command"),dataIndex:"command",ellipsis:!0},{title:p("ui.processManagement.startTime"),dataIndex:"startTime",width:200},{title:p("ui.processManagement.action"),width:100,render:(_,W)=>W.isCurrent?e.jsx(F,{size:"small",className:r.currentProcessBtn,children:p("ui.processManagement.current")}):e.jsx(F,{size:"small",danger:!0,onClick:()=>this.handleKillProcess(W.pid),children:p("ui.processManagement.kill")})}]})}),e.jsx(ke,{title:e.jsxs("span",{children:[e.jsx(es,{apiEndpoint:oe("/api/open-profile-dir"),title:p("ui.proxy.openConfigDir"),size:16})," ",p("ui.proxySwitch")," ",e.jsx(ie,{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||[],a=this.props.activeProxyId||"max",{editingProxy:d,editForm:l}=this.state;return e.jsxs("div",{children:[e.jsxs("div",{className:r.proxyWarning,children:["⚠️ ",p("ui.proxy.maxWarning")]}),e.jsx("div",{className:r.proxyList,children:t.map(u=>{var f;return e.jsxs("div",{className:`${r.proxyItem} ${u.id===a?r.proxyItemActive:""}`,children:[e.jsxs("div",{className:r.proxyItemMain,onClick:()=>{if(u.id!==a){const o={active:u.id,profiles:t};this.props.onProxyProfileChange(o)}},children:[e.jsx(Je,{checked:u.id===a,style:{marginRight:8}}),e.jsxs("div",{className:r.proxyItemInfo,children:[e.jsxs("div",{className:r.proxyItemNameRow,children:[e.jsx("span",{className:r.proxyItemName,children:u.name}),u.id==="max"&&e.jsx(xe,{className:r.proxyBuiltinTag,children:p("ui.proxy.builtin")})]}),u.id==="max"&&this.props.defaultConfig&&e.jsxs("div",{className:r.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}`:""]}),u.id!=="max"&&u.baseURL&&e.jsxs("div",{className:r.proxyItemDetail,children:[(()=>{try{return new URL(u.baseURL).host}catch{return u.baseURL}})(),u.activeModel?` · ${u.activeModel}`:(f=u.models)!=null&&f.length?` · ${u.models[0]}`:""]})]})]}),u.id!=="max"&&e.jsxs("div",{className:r.proxyItemActions,children:[e.jsx(F,{type:"text",size:"small",icon:e.jsx(ca,{}),onClick:()=>this.setState({editingProxy:u.id,editForm:{name:u.name||"",baseURL:u.baseURL||"",apiKey:u.apiKey||"",models:(u.models||[]).join(", "),activeModel:u.activeModel||""}})}),e.jsx(F,{type:"text",size:"small",danger:!0,icon:e.jsx(pt,{}),onClick:()=>{ke.confirm({title:p("ui.proxy.deleteProxy"),content:p("ui.proxy.deleteConfirm",{name:u.name}),okType:"danger",onOk:()=>{const o=t.filter(i=>i.id!==u.id),h=a===u.id?"max":a;this.props.onProxyProfileChange({active:h,profiles:o})}})}})]})]},u.id)})}),d&&e.jsxs("div",{className:r.proxyEditForm,children:[e.jsxs("div",{className:r.proxyEditRow,children:[e.jsxs("label",{children:[p("ui.proxy.name")," ",e.jsx("span",{className:r.proxyRequired,children:"*"})]}),e.jsx(Ee,{size:"small",value:l.name,onChange:u=>{const f=u.target.value;this.setState(o=>({editForm:{...o.editForm,name:f}}))}})]}),e.jsxs("div",{className:r.proxyEditRow,children:[e.jsxs("label",{children:[p("ui.proxy.baseURL")," ",e.jsx("span",{className:r.proxyRequired,children:"*"})]}),e.jsx(Ee,{size:"small",value:l.baseURL,onChange:u=>{const f=u.target.value;this.setState(o=>({editForm:{...o.editForm,baseURL:f}}))},placeholder:"https://api.example.com"})]}),e.jsxs("div",{className:r.proxyEditRow,children:[e.jsxs("label",{children:[p("ui.proxy.apiKey")," ",e.jsx("span",{className:r.proxyRequired,children:"*"})]}),e.jsx(Ee.Password,{size:"small",value:l.apiKey,onChange:u=>{const f=u.target.value;this.setState(o=>({editForm:{...o.editForm,apiKey:f}}))},placeholder:"sk-..."})]}),e.jsx("div",{className:r.proxyEditDivider}),e.jsxs("div",{className:r.proxyEditRow,children:[e.jsx("label",{children:p("ui.proxy.models")}),e.jsx(Ee,{size:"small",value:l.models,onChange:u=>{const f=u.target.value;this.setState(o=>({editForm:{...o.editForm,models:f}}))},placeholder:"model-1, model-2"})]}),e.jsxs("div",{className:r.proxyEditRow,children:[e.jsx("label",{children:p("ui.proxy.activeModel")}),e.jsx($e,{size:"small",className:r.fullWidthSelect,value:l.activeModel||void 0,onChange:u=>this.setState(f=>({editForm:{...f.editForm,activeModel:u}})),placeholder:p("ui.proxy.activeModel"),children:(l.models||"").split(",").map(u=>u.trim()).filter(Boolean).map(u=>e.jsx($e.Option,{value:u,children:u},u))})]}),e.jsxs("div",{className:r.proxyEditBtns,children:[e.jsx(F,{size:"small",icon:e.jsx(da,{}),type:"primary",onClick:()=>{var h,i,c;if(!((h=l.name)!=null&&h.trim())||!((i=l.baseURL)!=null&&i.trim())||!((c=l.apiKey)!=null&&c.trim())){K.warning(p("ui.proxy.requiredFields"));return}const u=(l.models||"").split(",").map(m=>m.trim()).filter(Boolean),f={id:d==="__new__"?`proxy_${Date.now()}`:d,name:l.name.trim(),baseURL:l.baseURL.trim(),apiKey:l.apiKey.trim(),models:u,activeModel:l.activeModel||u[0]||""};let o;d==="__new__"?o=[...t,f]:o=t.map(m=>m.id===d?{...m,...f,id:m.id}:m),this.props.onProxyProfileChange({active:a,profiles:o}),this.setState({editingProxy:null})},children:p("ui.proxy.save")}),e.jsx(F,{size:"small",icon:e.jsx(ha,{}),onClick:()=>this.setState({editingProxy:null}),children:p("ui.proxy.cancel")})]})]}),!d&&e.jsx(F,{block:!0,type:"dashed",icon:e.jsx(Rt,{}),style:{marginTop:12},onClick:()=>this.setState({editingProxy:"__new__",editForm:{name:"",baseURL:"",apiKey:"",models:"",activeModel:""}}),children:p("ui.proxy.addProxy")})]})}};B(Ie,"COMMAND_TAGS",new Set(["command-name","command-message","command-args","local-command-caveat","local-command-stdout"]));let st=Ie;const wn="_centerEmpty_hl9ry_1",Tn="_scrollContainer_hl9ry_8",Mn="_listItem_hl9ry_15",En="_listItemActive_hl9ry_27",Rn="_itemContent_hl9ry_36",In="_itemHeader_hl9ry_41",Ln="_tagNoMargin_hl9ry_49",An="_modelName_hl9ry_54",Pn="_modelNameMain_hl9ry_59",Dn="_time_hl9ry_63",Bn="_detailRow_hl9ry_69",On="_urlText_hl9ry_76",Fn="_duration_hl9ry_85",Hn="_statusOk_hl9ry_90",$n="_statusErr_hl9ry_96",zn="_statusDefault_hl9ry_101",Vn="_usageBox_hl9ry_106",Un="_cacheDot_hl9ry_116",qn="_cacheDotLoss_hl9ry_125",Wn="_cacheDotNormal_hl9ry_130",Kn="_tagMainAgent_hl9ry_134",Gn="_tagPlan_hl9ry_140",Jn="_tagMuted_hl9ry_146",Qn="_tooltipPreLine_hl9ry_152",$={centerEmpty:wn,scrollContainer:Tn,listItem:Mn,listItemActive:En,itemContent:Rn,itemHeader:In,tagNoMargin:Ln,modelName:An,modelNameMain:Pn,time:Dn,detailRow:Bn,urlText:On,duration:Fn,statusOk:Hn,statusErr:$n,statusDefault:zn,usageBox:Vn,cacheDot:Un,cacheDotLoss:qn,cacheDotNormal:Wn,tagMainAgent:Kn,tagPlan:Gn,tagMuted:Jn,tooltipPreLine:Qn};class Yn extends U.Component{constructor(t){super(t);B(this,"handleKeyDown",t=>{if(t.key!=="ArrowUp"&&t.key!=="ArrowDown")return;const{requests:a,selectedIndex:d,onSelect:l}=this.props;if(!a.length)return;t.preventDefault();const u=d??0,f=t.key==="ArrowUp"?Math.max(0,u-1):Math.min(a.length-1,u+1);f!==u&&l(f)});this.activeItemRef=U.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:a,onSelect:d}=this.props;return t.length===0?e.jsx("div",{className:$.centerEmpty,children:e.jsx(Le,{description:p("ui.waitingRequests")})}):e.jsx("div",{className:$.scrollContainer,onKeyDown:this.handleKeyDown,children:e.jsx(It,{dataSource:t,size:"small",split:!1,renderItem:(l,u)=>{var T,E,L;const f=new Date(l.timestamp).toLocaleTimeString("zh-CN"),o=u===a,h=l.response&&l.response.status<400,i=l.response&&l.response.status>=400,c=ua((T=l.body)==null?void 0:T.model),m=u+1<t.length?t[u+1]:null,{type:y,subType:x}=Ke(l,m),g=(L=(E=l.response)==null?void 0:E.body)==null?void 0:L.usage,v=g?(g.input_tokens||0)+(g.cache_read_input_tokens||0)+(g.cache_creation_input_tokens||0):null,C=(g==null?void 0:g.output_tokens)||null,k=(g==null?void 0:g.cache_read_input_tokens)||0,N=(g==null?void 0:g.cache_creation_input_tokens)||0;let b=l.url;try{const I=new URL(l.url);b=I.host+I.pathname}catch{}return e.jsx(It.Item,{ref:o?this.activeItemRef:void 0,tabIndex:0,onClick:()=>d(u),className:`${$.listItem} ${o?$.listItemActive:""}`,children:e.jsxs("div",{className:$.itemContent,children:[e.jsxs("div",{className:$.itemHeader,children:[y==="MainAgent"?e.jsx(xe,{className:`${$.tagNoMargin} ${$.tagMainAgent}`,children:"MainAgent"}):y==="Plan"?e.jsx(xe,{className:`${$.tagNoMargin} ${$.tagPlan}`,children:Lt(y,x)}):y==="Count"||y==="Preflight"?e.jsx(xe,{className:`${$.tagNoMargin} ${$.tagMuted}`,children:y}):e.jsx(xe,{className:$.tagNoMargin,children:Lt(y,x)}),c&&e.jsx("span",{className:`${$.modelName} ${y==="MainAgent"?$.modelNameMain:""}`,children:c}),e.jsx("span",{className:$.time,children:f})]}),e.jsxs("div",{className:$.detailRow,children:[e.jsx("span",{className:$.urlText,title:l.url,children:b}),l.duration&&e.jsxs("span",{className:$.duration,children:[l.duration,"ms"]}),l.response&&e.jsx("span",{className:h?$.statusOk:i?$.statusErr:$.statusDefault,children:l.response.status})]}),g&&e.jsxs("div",{className:$.usageBox,children:[e.jsxs("div",{children:["token: output:",q(C)||0,", input: ",q(v)||0]}),(k>0||N>0)&&e.jsx("div",{children:(()=>{var O;const I=(O=this.props.cacheLossMap)==null?void 0:O.get(u),M={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 D;if(I){const ne=(I.reasons||[I.reason]).map(A=>p(M[A]||M.key_change)).join(`
27
+ `);D=e.jsx(ts,{title:e.jsx("span",{className:$.tooltipPreLine,children:ne}),children:e.jsx("span",{className:`${$.cacheDot} ${$.cacheDotLoss}`})})}else D=e.jsx("span",{className:`${$.cacheDot} ${$.cacheDotNormal}`});return e.jsxs(e.Fragment,{children:["cache",D,": ",k>0?`read:${q(k)}`:"",k>0&&N>0?", ":"",N>0?`create:${q(N)}`:""]})})()})]})]})})}})})}}const Xn=n=>typeof n=="boolean"||n instanceof Boolean,Zn=n=>typeof n=="number"||n instanceof Number,el=n=>typeof n=="bigint"||n instanceof BigInt,Ns=n=>!!n&&n instanceof Date,tl=n=>typeof n=="string"||n instanceof String,sl=n=>Array.isArray(n),_s=n=>typeof n=="object"&&n!==null,Ss=n=>!!n&&n instanceof Object&&typeof n=="function";function at(n,s){return s===void 0&&(s=!1),!n||s?`"${n}"`:n}function al(n,s,t){return t?JSON.stringify(n):s?`"${n}"`:n}function ks(n){let{field:s,value:t,data:a,lastElement:d,openBracket:l,closeBracket:u,level:f,style:o,shouldExpandNode:h,clickToExpandNode:i,outerRef:c,beforeExpandChange:m}=n;const y=j.useRef(!1),[x,g]=j.useState(()=>h(f,t,s)),v=j.useRef(null);j.useEffect(()=>{y.current?g(h(f,t,s)):y.current=!0},[h]);const C=j.useId();if(a.length===0)return nl({field:s,openBracket:l,closeBracket:u,lastElement:d,style:o});const k=x?o.collapseIcon:o.expandIcon,N=x?o.ariaLables.collapseJson:o.ariaLables.expandJson,b=f+1,T=a.length-1,E=M=>{x!==M&&(!m||m({level:f,value:t,field:s,newExpandValue:M}))&&g(M)},L=M=>{if(M.key==="ArrowRight"||M.key==="ArrowLeft")M.preventDefault(),E(M.key==="ArrowRight");else if(M.key==="ArrowUp"||M.key==="ArrowDown"){M.preventDefault();const D=M.key==="ArrowUp"?-1:1;if(!c.current)return;const O=c.current.querySelectorAll("[role=button]");let ae=-1;for(let A=0;A<O.length;A++)if(O[A].tabIndex===0){ae=A;break}if(ae<0)return;const ne=(ae+D+O.length)%O.length;O[ae].tabIndex=-1,O[ne].tabIndex=0,O[ne].focus()}},I=()=>{var M;E(!x);const D=v.current;if(!D)return;const O=(M=c.current)===null||M===void 0?void 0:M.querySelector('[role=button][tabindex="0"]');O&&(O.tabIndex=-1),D.tabIndex=0,D.focus()};return j.createElement("div",{className:o.basicChildStyle,role:"treeitem","aria-expanded":x,"aria-selected":void 0},j.createElement("span",{className:k,onClick:I,onKeyDown:L,role:"button","aria-label":N,"aria-expanded":x,"aria-controls":x?C:void 0,ref:v,tabIndex:f===0?0:-1}),(s||s==="")&&(i?j.createElement("span",{className:o.clickableLabel,onClick:I,onKeyDown:L},at(s,o.quotesForFieldNames),":"):j.createElement("span",{className:o.label},at(s,o.quotesForFieldNames),":")),j.createElement("span",{className:o.punctuation},l),x?j.createElement("ul",{id:C,role:"group",className:o.childFieldsContainer},a.map((M,D)=>j.createElement(vt,{key:M[0]||D,field:M[0],value:M[1],style:o,lastElement:D===T,level:b,shouldExpandNode:h,clickToExpandNode:i,beforeExpandChange:m,outerRef:c}))):j.createElement("span",{className:o.collapsedContent,onClick:I,onKeyDown:L}),j.createElement("span",{className:o.punctuation},u),!d&&j.createElement("span",{className:o.punctuation},","))}function nl(n){let{field:s,openBracket:t,closeBracket:a,lastElement:d,style:l}=n;return j.createElement("div",{className:l.basicChildStyle,role:"treeitem","aria-selected":void 0},(s||s==="")&&j.createElement("span",{className:l.label},at(s,l.quotesForFieldNames),":"),j.createElement("span",{className:l.punctuation},t),j.createElement("span",{className:l.punctuation},a),!d&&j.createElement("span",{className:l.punctuation},","))}function ll(n){let{field:s,value:t,style:a,lastElement:d,shouldExpandNode:l,clickToExpandNode:u,level:f,outerRef:o,beforeExpandChange:h}=n;return ks({field:s,value:t,lastElement:d||!1,level:f,openBracket:"{",closeBracket:"}",style:a,shouldExpandNode:l,clickToExpandNode:u,data:Object.keys(t).map(i=>[i,t[i]]),outerRef:o,beforeExpandChange:h})}function ol(n){let{field:s,value:t,style:a,lastElement:d,level:l,shouldExpandNode:u,clickToExpandNode:f,outerRef:o,beforeExpandChange:h}=n;return ks({field:s,value:t,lastElement:d||!1,level:l,openBracket:"[",closeBracket:"]",style:a,shouldExpandNode:u,clickToExpandNode:f,data:t.map(i=>[void 0,i]),outerRef:o,beforeExpandChange:h})}function il(n){let{field:s,value:t,style:a,lastElement:d}=n,l,u=a.otherValue;return t===null?(l="null",u=a.nullValue):t===void 0?(l="undefined",u=a.undefinedValue):tl(t)?(l=al(t,!a.noQuotesForStringValues,a.stringifyStringValues),u=a.stringValue):Xn(t)?(l=t?"true":"false",u=a.booleanValue):Zn(t)?(l=t.toString(),u=a.numberValue):el(t)?(l=`${t.toString()}n`,u=a.numberValue):Ns(t)?l=t.toISOString():Ss(t)?l="function() { }":l=t.toString(),j.createElement("div",{className:a.basicChildStyle,role:"treeitem","aria-selected":void 0},(s||s==="")&&j.createElement("span",{className:a.label},at(s,a.quotesForFieldNames),":"),j.createElement("span",{className:u},l),!d&&j.createElement("span",{className:a.punctuation},","))}function vt(n){const s=n.value;return sl(s)?j.createElement(ol,Object.assign({},n)):_s(s)&&!Ns(s)&&!Ss(s)?j.createElement(ll,Object.assign({},n)):j.createElement(il,Object.assign({},n))}var H={"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 ws={collapseJson:"collapse JSON",expandJson:"expand JSON"},et={container:H["container-light"],basicChildStyle:H["basic-element-style"],childFieldsContainer:H["child-fields-container"],label:H["label-light"],clickableLabel:H["clickable-label-light"],nullValue:H["value-null-light"],undefinedValue:H["value-undefined-light"],stringValue:H["value-string-light"],booleanValue:H["value-boolean-light"],numberValue:H["value-number-light"],otherValue:H["value-other-light"],punctuation:H["punctuation-light"],collapseIcon:H["collapse-icon-light"],expandIcon:H["expand-icon-light"],collapsedContent:H["collapsed-content-light"],noQuotesForStringValues:!1,quotesForFieldNames:!1,ariaLables:ws,stringifyStringValues:!1},rl={container:H["container-dark"],basicChildStyle:H["basic-element-style"],childFieldsContainer:H["child-fields-container"],label:H["label-dark"],clickableLabel:H["clickable-label-dark"],nullValue:H["value-null-dark"],undefinedValue:H["value-undefined-dark"],stringValue:H["value-string-dark"],booleanValue:H["value-boolean-dark"],numberValue:H["value-number-dark"],otherValue:H["value-other-dark"],punctuation:H["punctuation-dark"],collapseIcon:H["collapse-icon-dark"],expandIcon:H["expand-icon-dark"],collapsedContent:H["collapsed-content-dark"],noQuotesForStringValues:!1,quotesForFieldNames:!1,ariaLables:ws,stringifyStringValues:!1},cl=()=>!0,dl=n=>{let{data:s,style:t=et,shouldExpandNode:a=cl,clickToExpandNode:d=!1,beforeExpandChange:l,compactTopLevel:u,...f}=n;const o=j.useRef(null);return j.createElement("div",Object.assign({"aria-label":"JSON view"},f,{className:t.container,ref:o,role:"tree"}),u&&_s(s)?Object.entries(s).map(h=>{let[i,c]=h;return j.createElement(vt,{key:i,field:i,value:c,style:{...et,...t},lastElement:!0,level:1,shouldExpandNode:a,clickToExpandNode:d,beforeExpandChange:l,outerRef:o})}):j.createElement(vt,{value:s,style:{...et,...t},lastElement:!0,level:0,shouldExpandNode:a,clickToExpandNode:d,outerRef:o,beforeExpandChange:l}))},hl="_container_qeuid_1",ul={container:hl};class nt extends U.Component{shouldComponentUpdate(s){return s.data!==this.props.data||s.defaultExpand!==this.props.defaultExpand||s.expandNode!==this.props.expandNode}render(){const{data:s,defaultExpand:t,expandNode:a}=this.props,l={...typeof document<"u"&&document.documentElement.getAttribute("data-theme")!=="light"?rl:et,container:"rjv-container"};if(s==null)return null;const u=typeof a=="function"?a:t==="all"?()=>!0:t==="root"?f=>f<2:f=>f<1;return e.jsx("div",{className:ul.container,children:e.jsx(dl,{data:s,shouldExpandNode:u,style:l})})}}function ml({currentId:n,visibleIds:s=[],key:t}){if(t!=="ArrowUp"&&t!=="ArrowDown")return null;const a=s.findIndex(l=>l===n),d=t==="ArrowUp"?-1:1;return a>=0?s[a+d]??null:null}const pl="_root_1fofe_1",fl="_sidebar_1fofe_9",gl="_section_1fofe_18",xl="_sectionHeader_1fofe_22",vl="_arrow_1fofe_48",yl="_sectionTitle_1fofe_54",jl="_sectionCount_1fofe_62",Cl="_sectionBody_1fofe_71",bl="_historyToggle_1fofe_76",Nl="_historyToggleLabel_1fofe_102",_l="_item_1fofe_107",Sl="_itemActive_1fofe_133",kl="_itemContent_1fofe_143",wl="_itemLabel_1fofe_149",Tl="_itemSublabel_1fofe_157",Ml="_itemTime_1fofe_166",El="_content_1fofe_175",Rl="_contentEmpty_1fofe_183",Il="_contentInner_1fofe_190",Ll="_emptyWrap_1fofe_194",Al="_roleHeader_1fofe_202",Pl="_roleBadge_1fofe_210",Dl="_role_user_1fofe_219",Bl="_role_assistant_1fofe_225",Ol="_roleLabel_1fofe_231",Fl="_contentTime_1fofe_238",Hl="_turnDivider_1fofe_246",$l="_textBlock_1fofe_253",zl="_textBlockBar_1fofe_260",Vl="_textBlockBody_1fofe_269",Ul="_textBlockCompact_1fofe_277",ql="_textBlockCompactFloat_1fofe_284",Wl="_thinkingBlock_1fofe_291",Kl="_thinkingHeader_1fofe_299",Gl="_thinkingPreview_1fofe_314",Jl="_thinkingBody_1fofe_324",Ql="_toolBlock_1fofe_330",Yl="_toolBlockResult_1fofe_337",Xl="_toolBlockError_1fofe_341",Zl="_toolBlockHeader_1fofe_345",eo="_toolBlockBody_1fofe_356",to="_toolName_1fofe_361",so="_toolId_1fofe_367",ao="_errorLabel_1fofe_374",no="_blockTag_1fofe_384",lo="_blockTagText_1fofe_397",oo="_blockTagThinking_1fofe_403",io="_blockTagResult_1fofe_409",ro="_blockTagError_1fofe_415",co="_jsonBlock_1fofe_422",ho="_jsonBlockLabel_1fofe_429",uo="_blockSeparator_1fofe_439",mo="_markdownBody_1fofe_446",w={root:pl,sidebar:fl,section:gl,sectionHeader:xl,arrow:vl,sectionTitle:yl,sectionCount:jl,sectionBody:Cl,historyToggle:bl,historyToggleLabel:Nl,item:_l,itemActive:Sl,itemContent:kl,itemLabel:wl,itemSublabel:Tl,itemTime:Ml,content:El,contentEmpty:Rl,contentInner:Il,emptyWrap:Ll,roleHeader:Al,roleBadge:Pl,role_user:Dl,role_assistant:Bl,roleLabel:Ol,contentTime:Fl,turnDivider:Hl,textBlock:$l,textBlockBar:zl,textBlockBody:Vl,textBlockCompact:Ul,textBlockCompactFloat:ql,thinkingBlock:Wl,thinkingHeader:Kl,thinkingPreview:Gl,thinkingBody:Jl,toolBlock:Ql,toolBlockResult:Yl,toolBlockError:Xl,toolBlockHeader:Zl,toolBlockBody:eo,toolName:to,toolId:so,errorLabel:ao,blockTag:no,blockTagText:lo,blockTagThinking:oo,blockTagResult:io,blockTagError:ro,jsonBlock:co,jsonBlockLabel:ho,blockSeparator:uo,markdownBody:mo},{Text:po}=ss;function yt(n){if(n==null)return[];if(typeof n=="string"){const s=n.trim();return s?[{type:"markdown",text:s}]:[]}if(Array.isArray(n)){const s=[];for(const t of n)if(t)if(t.type==="text"){const a=(t.text||"").trim();a&&s.push({type:"markdown",text:a})}else if(t.type==="tool_use")s.push({type:"tool_use",name:t.name||"unknown",id:t.id||"",input:t.input??{}});else if(t.type==="tool_result"){const a=fo(t.content);s.push({type:"tool_result",tool_use_id:t.tool_use_id||"",is_error:t.is_error,content:a})}else if(t.type==="thinking"){const a=t.thinking||"";a.trim()&&s.push({type:"thinking",text:a})}else t.type==="image"?s.push({type:"json",label:"image",data:t}):s.push({type:"json",label:t.type||"block",data:t});return s}return[{type:"json",label:"content",data:n}]}function fo(n){if(n==null)return[];if(typeof n=="string"){const s=n.trim();return s?[{type:"markdown",text:s}]:[]}return Array.isArray(n)?n.flatMap(s=>{if(!s)return[];if(s.type==="text"){const t=(s.text||"").trim();return t?[{type:"markdown",text:t}]:[]}return[{type:"json",label:s.type||"block",data:s}]}):[{type:"json",label:"content",data:n}]}function go(n){if(!n)return null;if(typeof n=="string")return[{type:"markdown",text:n}];if(Array.isArray(n)){const s=[];return n.forEach((t,a)=>{a>0&&s.push({type:"separator"}),t&&(typeof t=="string"?s.push({type:"markdown",text:t}):t.type==="text"?s.push({type:"markdown",text:t.text||""}):s.push({type:"json",label:t.type||"item",data:t}))}),s}return[{type:"json",label:"system",data:n}]}function xo(n){const s=[],t=(n==null?void 0:n.name)||"unknown",a=(n==null?void 0:n.description)||"";let d=`### ${t}
28
+
29
+ `;a&&(d+=`${a}
30
+
31
+ `),s.push({type:"markdown",text:d});const l=(n==null?void 0:n.input_schema)||(n==null?void 0:n.parameters)||null;return l&&s.push({type:"json",label:"Parameters",data:l}),s}function vo(n){var s;if(typeof n=="string")return n.slice(0,60).replace(/\n/g," ");if(Array.isArray(n)){for(const t of n)if((t==null?void 0:t.type)==="text"&&((s=t.text)!=null&&s.trim()))return t.text.trim().slice(0,60).replace(/\n/g," ")}return""}function yo(n){var a;const s=[];let t=0;for(;t<n.length;){const d=n[t];if((d==null?void 0:d.role)!=="user"){t++;continue}const l=((a=n[t+1])==null?void 0:a.role)==="assistant"?n[t+1]:null;s.push({id:`turn__${t}`,isTurn:!0,turnIndex:s.length,timestamp:d._timestamp||null,assistantTimestamp:(l==null?void 0:l._timestamp)||null,userBlocks:yt(d==null?void 0:d.content),assistantBlocks:l?yt(l.content):null,preview:vo(d==null?void 0:d.content)}),t+=l?2:1}return s}function jt(n){try{return new Date(n).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}catch{return null}}function jo({text:n,compact:s}){const t=as(n);return s?e.jsx("div",{className:w.textBlockCompact,children:e.jsx("div",{className:`chat-md ${w.markdownBody}`,dangerouslySetInnerHTML:{__html:t}})}):e.jsxs("div",{className:w.textBlock,children:[e.jsx("div",{className:w.textBlockBar,children:e.jsx("span",{className:`${w.blockTag} ${w.blockTagText}`,children:"text"})}),e.jsx("div",{className:`chat-md ${w.textBlockBody}`,dangerouslySetInnerHTML:{__html:t}})]})}function Co({block:n}){const[s,t]=j.useState(!0),a=n.text.length>60?n.text.slice(0,60).replace(/\n/g," ")+"…":n.text.replace(/\n/g," ");return e.jsxs("div",{className:w.thinkingBlock,children:[e.jsxs("div",{className:w.thinkingHeader,onClick:()=>t(d=>!d),children:[s?e.jsx(Ae,{className:w.arrow}):e.jsx(Pe,{className:w.arrow}),e.jsx("span",{className:`${w.blockTag} ${w.blockTagThinking}`,children:"thinking"}),!s&&e.jsx("span",{className:w.thinkingPreview,children:a})]}),s&&e.jsx("div",{className:w.thinkingBody,children:e.jsx("div",{className:`chat-md ${w.markdownBody}`,dangerouslySetInnerHTML:{__html:as(n.text)}})})]})}function lt({blocks:n,compact:s}){return!n||n.length===0?null:e.jsx(e.Fragment,{children:n.map((t,a)=>e.jsx(bo,{block:t,compact:s},a))})}function bo({block:n,compact:s}){var t;return n.type==="separator"?e.jsx("hr",{className:w.blockSeparator}):n.type==="markdown"?(t=n.text)!=null&&t.trim()?e.jsx(jo,{text:n.text,compact:s}):null:n.type==="thinking"?e.jsx(Co,{block:n}):n.type==="tool_use"?e.jsxs("div",{className:w.toolBlock,children:[e.jsxs("div",{className:w.toolBlockHeader,children:[e.jsx("span",{className:w.blockTag,children:"tool_use"}),e.jsx("span",{className:w.toolName,children:n.name}),n.id&&e.jsx("span",{className:w.toolId,children:n.id})]}),e.jsx("div",{className:w.toolBlockBody,children:e.jsx(nt,{data:n.input,defaultExpand:"root"})})]}):n.type==="tool_result"?e.jsxs("div",{className:`${w.toolBlock} ${n.is_error?w.toolBlockError:w.toolBlockResult}`,children:[e.jsxs("div",{className:w.toolBlockHeader,children:[e.jsx("span",{className:`${w.blockTag} ${n.is_error?w.blockTagError:w.blockTagResult}`,children:"tool_result"}),n.tool_use_id&&e.jsx("span",{className:w.toolId,children:n.tool_use_id}),n.is_error&&e.jsx("span",{className:w.errorLabel,children:"error"})]}),e.jsx("div",{className:w.toolBlockBody,children:e.jsx(lt,{blocks:n.content,compact:!0})})]}):n.type==="json"?e.jsxs("div",{className:w.jsonBlock,children:[n.label&&e.jsx("div",{className:w.jsonBlockLabel,children:n.label}),e.jsx(nt,{data:n.data,defaultExpand:"root"})]}):null}function No({turn:n}){const s=n.timestamp?jt(n.timestamp):null,t=n.assistantTimestamp?jt(n.assistantTimestamp):null;return e.jsxs("div",{children:[e.jsxs("div",{className:w.roleHeader,children:[e.jsx("span",{className:`${w.roleBadge} ${w.role_user}`,children:"user"}),e.jsx("span",{className:w.roleLabel,children:`Turn ${n.turnIndex+1}`}),s&&e.jsx("span",{className:w.contentTime,children:s})]}),e.jsx(lt,{blocks:n.userBlocks}),n.assistantBlocks&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:w.turnDivider}),e.jsxs("div",{className:w.roleHeader,children:[e.jsx("span",{className:`${w.roleBadge} ${w.role_assistant}`,children:"assistant"}),t&&e.jsx("span",{className:w.contentTime,children:t})]}),e.jsx(lt,{blocks:n.assistantBlocks})]})]})}function _o({sectionKey:n,title:s,items:t,historyItems:a=[],onSelect:d,onSelectById:l,selectedId:u,sidebarRef:f}){const[o,h]=j.useState(n!=="tools"),[i,c]=j.useState(!1),m=t.length+a.length,y=`${n}__history_toggle`;function x(C){var N;const k=(N=f.current)==null?void 0:N.querySelector(`[data-context-sidebar-control="${C}"]`);k&&(k.focus(),k.scrollIntoView({block:"nearest"}))}function g(C,k){var T;const N=Array.from(((T=f.current)==null?void 0:T.querySelectorAll("[data-context-sidebar-control]"))||[]).map(E=>E.dataset.contextSidebarControl).filter(Boolean),b=ml({currentId:k,visibleIds:N,key:C.key});b&&(C.preventDefault(),typeof window<"u"&&window.requestAnimationFrame(()=>{var L;x(b);const E=(L=f.current)==null?void 0:L.querySelector(`[data-context-sidebar-control="${b}"]`);(E==null?void 0:E.dataset.controlType)==="item"&&l(b)}))}function v(C){const k=u===C.id;return e.jsxs("button",{type:"button",className:`${w.item} ${k?w.itemActive:""}`,onClick:()=>d(C),onKeyDown:N=>g(N,C.id),"aria-current":k?"true":void 0,"data-context-sidebar-control":C.id,"data-control-type":"item",children:[e.jsxs("div",{className:w.itemContent,children:[e.jsx("span",{className:w.itemLabel,children:C.label}),C.sublabel&&!k&&e.jsx("div",{className:w.itemSublabel,children:C.sublabel})]}),C.time&&e.jsx("span",{className:w.itemTime,children:C.time})]},C.id)}return e.jsxs("div",{className:w.section,children:[e.jsxs("button",{type:"button",className:w.sectionHeader,onClick:()=>h(C=>!C),"aria-expanded":o,children:[o?e.jsx(Ae,{className:w.arrow}):e.jsx(Pe,{className:w.arrow}),e.jsx("span",{className:w.sectionTitle,children:s}),e.jsx("span",{className:w.sectionCount,children:m})]}),o&&e.jsxs("div",{className:w.sectionBody,children:[a.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:w.historyToggle,onClick:()=>c(C=>!C),onKeyDown:C=>g(C,y),"aria-expanded":i,"data-context-sidebar-control":y,"data-control-type":"toggle",children:[i?e.jsx(Ae,{className:w.arrow}):e.jsx(Pe,{className:w.arrow}),e.jsxs("span",{className:w.historyToggleLabel,children:[p("ui.context.history")," (",a.length,")"]})]}),i&&a.map(v)]}),t.map(v)]})]})}function So({body:n,response:s}){const[t,a]=j.useState(null),d=j.useRef(null),l=j.useMemo(()=>{if(!Array.isArray(n==null?void 0:n.messages))return[];const i=yo(n.messages);if(i.length===0)return i;const c=i[i.length-1],m=s!=null&&s.content?yt(s.content):null;return[...i.slice(0,-1),{...c,assistantBlocks:m??c.assistantBlocks}]},[n,s]);if(j.useEffect(()=>{l.length>0?a(l[l.length-1]):a(null)},[n,s]),!n||typeof n!="object")return e.jsx("div",{className:w.emptyWrap,children:e.jsx(Le,{description:p("ui.context.noData")})});const u=[];Array.isArray(n.tools)&&n.tools.length>0&&u.push({key:"tools",title:e.jsxs(e.Fragment,{children:[p("ui.context.tools")," ",e.jsx(ie,{doc:"ToolsFirst"})]}),items:n.tools.map((i,c)=>({id:`tool__${c}`,label:(i==null?void 0:i.name)||`Tool ${c}`,blocks:xo(i)}))});const f=go(n.system);if(f!=null&&u.push({key:"system",title:p("ui.context.systemPrompt"),items:[{id:"system__0",label:p("ui.context.systemPrompt"),blocks:f}]}),l.length>0){const i=x=>({...x,label:p("ui.context.historyTurnNoTime",{n:x.turnIndex+1}),time:x.timestamp?jt(x.timestamp):null,sublabel:x.preview||void 0}),c=x=>({...x,label:p("ui.context.currentTurn"),sublabel:x.preview||void 0}),m=l.slice(0,-1).map(i),y=c(l[l.length-1]);u.push({key:"messages",title:p("ui.context.messages"),historyItems:m.length>0?m:void 0,items:[y]})}if(u.length===0)return e.jsx("div",{className:w.emptyWrap,children:e.jsx(Le,{description:p("ui.context.noFields")})});const o=t!=null&&t.isTurn?l.find(i=>i.id===t.id)??null:t,h=new Map;return u.forEach(i=>{(i.historyItems||[]).forEach(c=>h.set(c.id,c)),i.items.forEach(c=>h.set(c.id,c))}),e.jsxs("div",{className:w.root,children:[e.jsx("div",{ref:d,className:w.sidebar,children:u.map(i=>e.jsx(_o,{sectionKey:i.key,title:i.title,items:i.items,historyItems:i.historyItems,selectedId:o==null?void 0:o.id,onSelect:c=>a(c),onSelectById:c=>{const m=h.get(c);m&&a(m)},sidebarRef:d},i.key))}),e.jsx("div",{className:w.content,children:o==null?e.jsx("div",{className:w.contentEmpty,children:e.jsx(po,{type:"secondary",children:p("ui.context.selectPrompt")})}):e.jsx("div",{className:w.contentInner,children:o.isTurn?e.jsx(No,{turn:o}):e.jsxs(e.Fragment,{children:[o.role&&e.jsxs("div",{className:w.roleHeader,children:[e.jsx("span",{className:`${w.roleBadge} ${w[`role_${o.role}`]||""}`,children:o.role}),e.jsx("span",{className:w.roleLabel,children:o.label})]}),e.jsx(lt,{blocks:o.blocks})]})},o.id)})]})}const ko="_container_14l2m_1",wo="_emptyState_14l2m_9",To="_urlSection_14l2m_16",Mo="_urlLeft_14l2m_23",Eo="_tokenStatsBox_14l2m_28",Ro="_tokenGrid_14l2m_35",Io="_tokenRows_14l2m_45",Lo="_tokenRow_14l2m_45",Ao="_tokenRowBorder_14l2m_53",Po="_tokenLabel_14l2m_57",Do="_tokenTd_14l2m_64",Bo="_tokenHitRate_14l2m_73",Oo="_tokenHitRateLabel_14l2m_86",Fo="_urlText_14l2m_96",Ho="_metaText_14l2m_103",$o="_headersContainer_14l2m_107",zo="_headerRow_14l2m_111",Vo="_headerKey_14l2m_117",Uo="_headerValue_14l2m_122",qo="_streamingBox_14l2m_127",Wo="_rawTextPre_14l2m_140",Ko="_tabContent_14l2m_153",Go="_bodyLabel_14l2m_161",Jo="_bodyHeader_14l2m_165",Qo="_diffSection_14l2m_172",Yo="_diffToggle_14l2m_176",Xo="_diffIcon_14l2m_182",Zo="_reminderSelect_14l2m_208",ei="_diffHeaderRow_14l2m_227",ti="_diffSpaceRight_14l2m_233",si="_reminderFilterWrapper_14l2m_237",ai="_reminderLabel_14l2m_243",ni="_cacheTabContent_14l2m_249",li="_userPromptList_14l2m_254",oi="_userPromptItem_14l2m_260",ii="_userPromptNavBtn_14l2m_271",ri="_cacheContent_14l2m_282",ci="_cacheTokenBar_14l2m_289",di="_cacheTokenWrite_14l2m_299",hi="_cacheTokenRead_14l2m_303",ui="_cacheCopyIcon_14l2m_307",mi="_cacheScrollArea_14l2m_314",pi="_cacheSectionBlock_14l2m_320",fi="_cacheSectionHeader_14l2m_324",gi="_cacheCollapseArrow_14l2m_336",xi="_cachePre_14l2m_342",vi="_cacheHighlightSvg_14l2m_356",yi="_cachePreSystem_14l2m_365",S={container:ko,emptyState:wo,urlSection:To,urlLeft:Mo,tokenStatsBox:Eo,tokenGrid:Ro,tokenRows:Io,tokenRow:Lo,tokenRowBorder:Ao,tokenLabel:Po,tokenTd:Do,tokenHitRate:Bo,tokenHitRateLabel:Oo,urlText:Fo,metaText:Ho,headersContainer:$o,headerRow:zo,headerKey:Vo,headerValue:Uo,streamingBox:qo,rawTextPre:Wo,tabContent:Ko,bodyLabel:Go,bodyHeader:Jo,diffSection:Qo,diffToggle:Yo,diffIcon:Xo,reminderSelect:Zo,diffHeaderRow:ei,diffSpaceRight:ti,reminderFilterWrapper:si,reminderLabel:ai,cacheTabContent:ni,userPromptList:li,userPromptItem:oi,userPromptNavBtn:ii,cacheContent:ri,cacheTokenBar:ci,cacheTokenWrite:di,cacheTokenRead:hi,cacheCopyIcon:ui,cacheScrollArea:mi,cacheSectionBlock:pi,cacheSectionHeader:fi,cacheCollapseArrow:gi,cachePre:xi,cacheHighlightSvg:vi,cachePreSystem:yi},{Text:he,Paragraph:ji}=ss;class Ci extends U.Component{constructor(s){super(s),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 s=this._cacheScrollEl;s&&(this._cacheOnScrollFade=()=>{clearTimeout(this._cacheAutoFadeTimer),this.setState({cacheHighlightFading:!0}),this._cacheFadeClearTimer=setTimeout(()=>{this.setState({cacheHighlightIdx:null,cacheHighlightFading:!1})},3e3),this._cacheUnbindScrollFade()},s.addEventListener("scroll",this._cacheOnScrollFade,{passive:!0}))}scrollToCacheMsg(s){if(this.state.cacheCollapsed.messages){this.setState(f=>({cacheCollapsed:{...f.cacheCollapsed,messages:!1}}),()=>this.scrollToCacheMsg(s));return}const t=this._cacheScrollEl;if(!t)return;const a=t.querySelector(`[data-msg-idx="${s}"]`);if(!a)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 d=!1,l=!1;const u=()=>{!d||!l||(this.setState({cacheHighlightIdx:s,cacheHighlightFading:!1}),this._cacheScrollSettleTimer=setTimeout(()=>this._cacheBindScrollFade(),200),this._cacheAutoFadeTimer=setTimeout(()=>{this.state.cacheHighlightIdx===s&&!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),d=!0,u()},t.addEventListener("scrollend",this._cacheScrollEndHandler,{once:!0}),this._cacheScrollSettleTimer=setTimeout(()=>{t.removeEventListener("scrollend",this._cacheScrollEndHandler),d=!0,u()},800),this._cacheHighlightDelayTimer=setTimeout(()=>{l=!0,u()},500),a.scrollIntoView({behavior:"smooth",block:"center"})}shouldComponentUpdate(s,t){if(s.request!==this.props.request){const d=Te(s.request);this.setState({diffExpanded:d&&!!s.expandDiff,requestHeadersExpanded:!1,responseHeadersExpanded:!1,reminderFilters:null}),this._cacheClearAllTimers()}const a=s.currentTab==="kv-cache-text";return s.request!==this.props.request||s.currentTab!==this.props.currentTab||s.onTabChange!==this.props.onTabChange||s.selectedIndex!==this.props.selectedIndex||s.expandDiff!==this.props.expandDiff||s.pendingCacheHighlight!==this.props.pendingCacheHighlight||t.bodyViewMode!==this.state.bodyViewMode||a&&t.cacheHighlightIdx!==this.state.cacheHighlightIdx||a&&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||a&&t.cacheCollapsed!==this.state.cacheCollapsed}componentDidUpdate(s){const t=this.props.pendingCacheHighlight;t&&t!==s.pendingCacheHighlight&&setTimeout(()=>{var a,d;this.scrollToCacheMsg(t.msgIdx),(d=(a=this.props).onCacheHighlightDone)==null||d.call(a)},150)}toggleBodyViewMode(s){this.setState(t=>({bodyViewMode:{...t.bodyViewMode,[s]:t.bodyViewMode[s]==="json"?"text":"json"}}))}copyBody(s){var u;const{request:t}=this.props;if(!t)return;let a;if(s==="diff"?a=this._lastDiffResult:a=s==="request"?t.body:(u=t.response)==null?void 0:u.body,a==null)return;const d=typeof a=="object"?ct(a):a,l=typeof d=="string"?d:JSON.stringify(d,null,2);navigator.clipboard.writeText(l).then(()=>K.success(p("ui.copySuccess")))}renderHeaders(s){return!s||Object.keys(s).length===0?e.jsx(he,{type:"secondary",children:p("ui.noHeaders")}):e.jsx("div",{className:S.headersContainer,children:Object.entries(s).map(([t,a])=>e.jsxs("div",{className:S.headerRow,children:[e.jsx(he,{code:!0,className:S.headerKey,children:t}),t==="authorization"&&e.jsx(ie,{doc:"TranslateContextPollution"}),e.jsx(he,{type:"secondary",className:S.headerValue,children:String(a)})]},t))})}getRequestExpandNode(s,t){if(t!=="request"||!s||typeof s!="object")return;const{request:a,requests:d,selectedIndex:l}=this.props;if(!a)return;const u=d&&l!=null?d[l+1]:null,{type:f}=Ke(a,u);let o=null;if(this.state.reminderFilters==="claudeMd"&&Array.isArray(s.messages)){o=new Set,o.add(s.messages);for(const c of s.messages){if(!c||typeof c!="object")continue;const m=c.content;if(typeof m=="string")At(m)&&o.add(c);else if(Array.isArray(m)){let y=!1;for(const x of m)x&&x.type==="text"&&At(x.text)&&(o.add(x),y=!0);y&&(o.add(c),o.add(m))}}}let h=null;if(this.state.reminderFilters==="skills"&&Array.isArray(s.messages)){h=new Set,h.add(s.messages);for(const c of s.messages){if(!c||typeof c!="object")continue;const m=c.content;if(typeof m=="string")Pt(m)&&h.add(c);else if(Array.isArray(m)){let y=!1;for(const x of m)x&&x.type==="text"&&Pt(x.text)&&(h.add(x),y=!0);y&&(h.add(c),h.add(m))}}}const i=o||h;if(f==="Preflight"){const c=new Set,m=y=>{y&&typeof y=="object"&&(c.add(y),Array.isArray(y)?y.forEach(m):Object.values(y).forEach(m))};return Array.isArray(s.messages)&&m(s.messages),Array.isArray(s.system)&&s.system.length>=3&&m(s.system[2]),(y,x,g)=>!!(y<2||c.has(x)||i&&i.has(x)||y===1&&g==="system")}if(f==="MainAgent"&&Array.isArray(s.messages)&&s.messages.length===1){const c=s.messages[0],m=c&&Array.isArray(c.content)?c.content:null,y=m&&m.length>0?m[m.length-1]:null,x=new Set,g=v=>{v&&typeof v=="object"&&(x.add(v),Array.isArray(v)?v.forEach(g):Object.values(v).forEach(g))};return y&&g(y),x.add(s.messages),c&&typeof c=="object"&&x.add(c),m&&x.add(m),(v,C,k)=>!!(v<2||x.has(C)||i&&i.has(C))}if(i)return(c,m,y)=>!!(c<2||i.has(m))}renderBody(s,t){const{bodyViewMode:a}=this.state;if(s==null)return e.jsx(he,{type:"secondary",children:p("ui.noBody")});if(typeof s=="string"&&s.includes("Streaming Response"))return e.jsx("div",{className:S.streamingBox,children:e.jsx(he,{type:"secondary",children:p("ui.streamingResponse")})});const d=typeof s=="object"?ct(s):s,l=a[t]==="json",u=this.getRequestExpandNode(d,t);return e.jsx("div",{children:l?e.jsx(nt,{data:d,defaultExpand:t==="response"?"all":"root",expandNode:u}):e.jsx("pre",{className:S.rawTextPre,children:typeof d=="string"?d:JSON.stringify(d,null,2)})})}getPrevMainAgentRequest(){const{requests:s,selectedIndex:t}=this.props;if(!s||t==null)return null;for(let a=t-1;a>=0;a--)if(Te(s[a])){const d=s[a];return d._slimmed?Dt(d,this.props.allRequests||s):d}return null}computeDiff(s,t){if(s==null||t==null||typeof s!="object"||typeof t!="object")return null;const a={},d=new Set([...Object.keys(s),...Object.keys(t)]);for(const l of d)if(!l.startsWith("_"))if(!(l in s))a[l]=t[l];else if(l in t){const u=JSON.stringify(s[l]),f=JSON.stringify(t[l]);u!==f&&(l==="messages"&&Array.isArray(s[l])&&Array.isArray(t[l])&&t[l].length>s[l].length?a[l]=t[l].slice(s[l].length):a[l]=t[l])}else continue;return Object.keys(a).length?a:null}render(){var m,y,x;let{request:s,currentTab:t,onTabChange:a}=this.props;if(!s)return e.jsx("div",{className:S.emptyState,children:e.jsx(Le,{description:"选择一个请求查看详情"})});s._slimmed&&(s=Dt(s,this.props.allRequests||this.props.requests));const d=new Date(s.timestamp).toLocaleString("zh-CN"),l=s.response&&s.response.status<400;let u=null;if(Te(s)){const g=this.getPrevMainAgentRequest();if(g){const v=JSON.stringify(s.body).length,C=JSON.stringify(g.body).length;if(v<C)u=e.jsxs("div",{className:S.diffSection,children:[e.jsxs(he,{strong:!0,className:S.diffToggle,onClick:()=>this.setState(N=>({diffExpanded:!N.diffExpanded})),children:["Body Diff JSON ",e.jsx(ie,{doc:"BodyDiffJSON"})," ",this.state.diffExpanded?e.jsx(Ae,{className:S.diffIcon}):e.jsx(Pe,{className:S.diffIcon})]}),this.state.diffExpanded&&e.jsx(he,{type:"secondary",children:p("ui.diffSessionChanged")})]});else{const N=ct(this.computeDiff(g.body,s.body));N&&(this._lastDiffResult=N,u=e.jsxs("div",{className:S.diffSection,children:[e.jsxs("div",{className:S.diffHeaderRow,children:[e.jsxs(he,{strong:!0,className:S.diffToggle,onClick:()=>this.setState(b=>({diffExpanded:!b.diffExpanded})),children:["Body Diff JSON ",e.jsx(ie,{doc:"BodyDiffJSON"})," ",this.state.diffExpanded?e.jsx(Ae,{className:S.diffIcon}):e.jsx(Pe,{className:S.diffIcon})]}),this.state.diffExpanded&&e.jsxs(Ue,{size:"small",className:S.diffSpaceRight,children:[e.jsx(F,{size:"small",icon:this.state.bodyViewMode.diff==="json"?e.jsx(Xe,{}):e.jsx(Ze,{}),onClick:()=>this.toggleBodyViewMode("diff"),children:this.state.bodyViewMode.diff==="json"?"Text":"JSON"}),e.jsx(F,{size:"small",icon:e.jsx(Ve,{}),onClick:()=>this.copyBody("diff"),children:p("ui.copy")})]})]}),this.state.diffExpanded&&e.jsx(e.Fragment,{children:this.state.bodyViewMode.diff==="json"?e.jsx(nt,{data:N,defaultExpand:"all"}):e.jsx("pre",{className:S.rawTextPre,children:JSON.stringify(N,null,2)})})]}))}}}const f=ma(s.body),o=pa(s.body),h=[{key:"request",label:"Request",children:e.jsxs("div",{className:S.tabContent,children:[e.jsxs("div",{className:S.diffSection,children:[e.jsxs(he,{strong:!0,className:S.diffToggle,onClick:()=>this.setState(g=>({requestHeadersExpanded:!g.requestHeadersExpanded})),children:["Headers ",this.state.requestHeadersExpanded?e.jsx(Ae,{className:S.diffIcon}):e.jsx(Pe,{className:S.diffIcon})]}),this.state.requestHeadersExpanded&&this.renderHeaders(s.headers)]}),u,e.jsxs("div",{children:[e.jsxs("div",{className:S.bodyHeader,children:[e.jsxs(he,{strong:!0,className:S.bodyLabel,children:["Body",e.jsx(ie,{doc:"BodyFields"})]}),e.jsxs(Ue,{size:"small",children:[(f||o)&&e.jsxs("span",{className:S.reminderFilterWrapper,children:[e.jsx("span",{className:S.reminderLabel,children:"system-reminder:"}),e.jsx($e,{size:"small",className:S.reminderSelect,placeholder:"filter",value:this.state.reminderFilters||void 0,onChange:g=>this.setState({reminderFilters:g||null}),options:[{label:"CLAUDE.md",value:"claudeMd",disabled:!f},{label:"Skills",value:"skills",disabled:!o}],popupMatchSelectWidth:!1,allowClear:!0})]}),e.jsx(F,{size:"small",icon:this.state.bodyViewMode.request==="json"?e.jsx(Xe,{}):e.jsx(Ze,{}),onClick:()=>this.toggleBodyViewMode("request"),children:this.state.bodyViewMode.request==="json"?"Text":"JSON"}),e.jsx(F,{size:"small",icon:e.jsx(Ve,{}),onClick:()=>this.copyBody("request"),children:p("ui.copy")})]})]}),this.renderBody(s.body,"request")]})]})},{key:"response",label:"Response",children:e.jsx("div",{className:S.tabContent,children:s.response?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:S.diffSection,children:[e.jsxs(he,{strong:!0,className:S.diffToggle,onClick:()=>this.setState(g=>({responseHeadersExpanded:!g.responseHeadersExpanded})),children:["Headers ",this.state.responseHeadersExpanded?e.jsx(Ae,{className:S.diffIcon}):e.jsx(Pe,{className:S.diffIcon})]}),this.state.responseHeadersExpanded&&this.renderHeaders(s.response.headers)]}),e.jsxs("div",{children:[e.jsxs("div",{className:S.bodyHeader,children:[e.jsxs(he,{strong:!0,className:S.bodyLabel,children:["Body",e.jsx(ie,{doc:"ResponseFields"})]}),e.jsxs(Ue,{size:"small",children:[e.jsx(F,{size:"small",icon:this.state.bodyViewMode.response==="json"?e.jsx(Xe,{}):e.jsx(Ze,{}),onClick:()=>this.toggleBodyViewMode("response"),children:this.state.bodyViewMode.response==="json"?"Text":"JSON"}),e.jsx(F,{size:"small",icon:e.jsx(Ve,{}),onClick:()=>this.copyBody("response"),children:p("ui.copy")})]})]}),this.renderBody(s.response.body,"response")]})]}):e.jsx(Le,{description:p("ui.responseNotCaptured")})})},{key:"kv-cache-text",label:e.jsxs("span",{children:["KV-Cache-Text ",e.jsx(ie,{doc:"KVCacheContent"})]}),children:e.jsx("div",{className:`${S.tabContent} ${S.cacheTabContent}`,children:(()=>{const g=Yt([s]),v=s.timestamp+"|"+s.url;if(g&&(g.cacheCreateTokens>0||g.cacheReadTokens>0)&&(this._lastCachedTokensKey=v,this._lastCachedTokens={cacheCreateTokens:g.cacheCreateTokens,cacheReadTokens:g.cacheReadTokens}),!g||g.system.length===0&&g.messages.length===0&&g.tools.length===0)return e.jsx(Le,{description:p("ui.noCachedContent"),image:Le.PRESENTED_IMAGE_SIMPLE});const C=()=>{const b=[];return g.tools.length>0&&(b.push(`=== ${p("ui.tools")} ===`),g.tools.forEach(T=>b.push(T))),g.system.length>0&&(b.push(`
32
+ === ${p("ui.systemPrompt")} ===`),g.system.forEach(T=>b.push(T))),g.messages.length>0&&(b.push(`
33
+ === ${p("ui.messages")} ===`),g.messages.forEach(T=>b.push(T))),b.join(`
34
+
35
+ `)},k=g.messages.map((b,T)=>({text:b,msgIdx:T})).filter(({text:b})=>b.startsWith("[user]")).map(({text:b,msgIdx:T})=>{const E=b.replace(/^\[user\]\s*/,"").trim();return!E||We(E)?{cleaned:"",msgIdx:T}:{cleaned:st.parseSegments(E).filter(M=>M.type==="text").map(M=>M.content.trim()).filter(M=>M&&!We(M)).join(" ").trim(),msgIdx:T}}).filter(({cleaned:b})=>!(!b||/Implement the following plan:/i.test(b))),N=k.length>0?e.jsx("div",{className:S.userPromptList,children:k.map(({cleaned:b,msgIdx:T})=>e.jsx("div",{className:S.userPromptItem,onMouseEnter:E=>{E.currentTarget.style.background="var(--color-primary-bg-lighter)",E.currentTarget.style.color="var(--text-white)"},onMouseLeave:E=>{E.currentTarget.style.background="",E.currentTarget.style.color="var(--text-secondary)"},onClick:()=>this.scrollToCacheMsg(T),children:b},T))}):null;return e.jsxs("div",{className:S.cacheContent,children:[(()=>{const T=g.cacheCreateTokens>0||g.cacheReadTokens>0?g:this._lastCachedTokensKey===v?this._lastCachedTokens:null;return T||N?e.jsxs("div",{className:S.cacheTokenBar,children:[T&&e.jsxs(e.Fragment,{children:[p("ui.tokens"),": ",e.jsxs("span",{className:S.cacheTokenWrite,children:["write ",q(T.cacheCreateTokens)]})," / ",e.jsxs("span",{className:S.cacheTokenRead,children:["read ",q(T.cacheReadTokens)]}),e.jsx(ts,{title:p("ui.copyAllCacheText"),children:e.jsx(Ve,{className:S.cacheCopyIcon,onClick:()=>{navigator.clipboard.writeText(C()).then(()=>{K.success(p("ui.copied"))}).catch(()=>{})}})})]}),N&&e.jsx(ze,{content:N,trigger:"hover",placement:"left",children:e.jsx("span",{className:S.userPromptNavBtn,children:p("ui.userPromptNav")})})]}):null})(),e.jsxs("div",{className:S.cacheScrollArea,ref:b=>{this._cacheScrollEl=b},children:[g.tools.length>0&&e.jsxs("div",{className:S.cacheSectionBlock,children:[e.jsxs("div",{className:S.cacheSectionHeader,onClick:()=>this.setState(b=>({cacheCollapsed:{...b.cacheCollapsed,tools:!b.cacheCollapsed.tools}})),children:[e.jsx("span",{className:S.cacheCollapseArrow,style:{transform:this.state.cacheCollapsed.tools?"rotate(-90deg)":"rotate(0deg)"},children:"▼"}),p("ui.tools")," (",g.tools.length,")"]}),!this.state.cacheCollapsed.tools&&g.tools.map((b,T)=>e.jsx("pre",{className:S.cachePre,children:b},T))]}),g.system.length>0&&e.jsxs("div",{className:S.cacheSectionBlock,children:[e.jsxs("div",{className:S.cacheSectionHeader,onClick:()=>this.setState(b=>({cacheCollapsed:{...b.cacheCollapsed,system:!b.cacheCollapsed.system}})),children:[e.jsx("span",{className:S.cacheCollapseArrow,style:{transform:this.state.cacheCollapsed.system?"rotate(-90deg)":"rotate(0deg)"},children:"▼"}),p("ui.systemPrompt")," (",g.system.length,")"]}),!this.state.cacheCollapsed.system&&g.system.map((b,T)=>e.jsx("pre",{className:S.cachePreSystem,children:b},T))]}),g.messages.length>0&&e.jsxs("div",{className:S.cacheSectionBlock,children:[e.jsxs("div",{className:S.cacheSectionHeader,onClick:()=>this.setState(b=>({cacheCollapsed:{...b.cacheCollapsed,messages:!b.cacheCollapsed.messages}})),children:[e.jsx("span",{className:S.cacheCollapseArrow,style:{transform:this.state.cacheCollapsed.messages?"rotate(-90deg)":"rotate(0deg)"},children:"▼"}),p("ui.messages")," (",g.messages.length,")"]}),!this.state.cacheCollapsed.messages&&g.messages.map((b,T)=>{const E=T===this.state.cacheHighlightIdx,L=E?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:S.cachePre,style:L,children:[E&&e.jsx("svg",{className:S.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"})})}),b]},T)})]})]})]})})()})},{key:"context",label:"Context",children:e.jsx("div",{className:`${S.tabContent} ${S.cacheTabContent}`,children:e.jsx(So,{body:s.body,response:(m=s.response)==null?void 0:m.body})})}],i=(x=(y=s.response)==null?void 0:y.body)==null?void 0:x.usage,c=i?(()=>{const g=i.input_tokens||0,v=i.output_tokens||0,C=i.cache_creation_input_tokens||0,k=i.cache_read_input_tokens||0,N=g+C+k,b=N>0?(k/N*100).toFixed(1):"0.0";return{input:g,output:v,cacheCreate:C,cacheRead:k,hitRate:b}})():null;return e.jsxs("div",{className:S.container,children:[e.jsxs("div",{className:S.urlSection,children:[e.jsxs("div",{className:S.urlLeft,children:[e.jsx(ji,{className:S.urlText,ellipsis:{rows:2,expandable:!0},children:s.url}),e.jsxs(Ue,{size:"small",wrap:!0,children:[e.jsx(xe,{color:s.method==="POST"?"blue":"green",children:s.method}),e.jsxs(he,{type:"secondary",className:S.metaText,children:["🕐 ",d]}),s.duration&&e.jsxs(he,{type:"secondary",className:S.metaText,children:["⏱️ ",s.duration,"ms"]}),s.response&&e.jsxs(xe,{color:l?"success":"error",children:["HTTP ",s.response.status]})]})]}),c&&e.jsx("div",{className:S.tokenStatsBox,children:e.jsxs("div",{className:S.tokenGrid,children:[e.jsxs("div",{className:S.tokenRows,children:[e.jsxs("div",{className:S.tokenRow,children:[e.jsx("span",{className:S.tokenLabel,children:"Token"}),e.jsxs("span",{className:S.tokenTd,children:["input: ",q(c.input)]}),e.jsxs("span",{className:S.tokenTd,children:["output: ",q(c.output)]})]}),e.jsxs("div",{className:`${S.tokenRow} ${S.tokenRowBorder}`,children:[e.jsx("span",{className:S.tokenLabel,children:"Cache"}),e.jsxs("span",{className:S.tokenTd,children:["create: ",q(c.cacheCreate)]}),e.jsxs("span",{className:S.tokenTd,children:["read: ",q(c.cacheRead)]})]})]}),e.jsxs("div",{className:S.tokenHitRate,children:[e.jsxs("div",{children:[c.hitRate,"%"]}),e.jsx("div",{className:S.tokenHitRateLabel,children:p("ui.hitRate")})]})]})})]}),e.jsx(Zt,{activeKey:t,onChange:a,items:h,size:"small"})]})}}const bi="_resizer_pzn4b_1",Ni={resizer:bi};class _i extends U.Component{constructor(s){super(s),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this)}handleMouseDown(s){s.preventDefault(),document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("mouseup",this.handleMouseUp)}handleMouseMove(s){this.props.onResize&&this.props.onResize(s.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:Ni.resizer})}}class Ei extends fa{constructor(t){super(t);B(this,"handleViewRequest",t=>{this.setState({viewMode:"raw",selectedIndex:t,scrollCenter:!0})});B(this,"handleViewInChat",()=>{this.setState(t=>{const d=(t.showAll?t.requests:Qe(t.requests))[t.selectedIndex];if(!d)return null;let l=null;if(Te(d)&&d.timestamp)l=d.timestamp;else{const u=Ke(d);if((u.type==="SubAgent"||u.type==="Teammate")&&d.timestamp)l=d.timestamp;else{const f=t.requests.indexOf(d);f>=0&&(l=Bt(t.requests,f))}l||K.info(p("ui.cannotMap"))}return{viewMode:"chat",chatScrollToTs:l}})});B(this,"handleToggleViewMode",()=>{this.setState(t=>{const a=t.viewMode==="raw"?"chat":"raw";if(a==="raw"){if(t.selectedIndex===null){const u=t.showAll?t.requests:Qe(t.requests);return{viewMode:a,selectedIndex:u.length>0?u.length-1:null,scrollCenter:!0}}return{viewMode:a,scrollCenter:!0}}const d=t.showAll?t.requests:Qe(t.requests),l=t.selectedIndex!=null?d[t.selectedIndex]:null;if(l){let u=null;if(Te(l)&&l.timestamp)u=l.timestamp;else{const f=Ke(l);if((f.type==="SubAgent"||f.type==="Teammate")&&l.timestamp)u=l.timestamp;else{const o=t.requests.indexOf(l);o>=0&&(u=Bt(t.requests,o)),u||K.info(p("ui.cannotMap"))}}return{viewMode:a,chatScrollToTs:u}}return{viewMode:a,chatScrollToTs:null}},()=>{this.state.viewMode==="chat"&&this.state.terminalVisible&&this.state.cliMode&&!Es&&requestAnimationFrame(()=>{const t=document.querySelector(".xterm-helper-textarea");t&&t.focus()})})});B(this,"handleTabChange",t=>{this.setState({currentTab:t})});B(this,"handleCacheHighlightDone",()=>{this.setState({pendingCacheHighlight:null})});B(this,"handleNavigateCacheMsg",t=>{const a=this.state.showAll?this.state.requests:Qe(this.state.requests);let d=-1;for(let l=a.length-1;l>=0;l--)if(Te(a[l])){d=l;break}d<0||this.setState({selectedIndex:d,scrollCenter:!0,currentTab:"kv-cache-text",pendingCacheHighlight:{msgIdx:t,key:Date.now()}})});B(this,"handleResize",t=>{const a=this.mainContainerRef.current;if(!a)return;const d=a.getBoundingClientRect(),l=t-d.left;l>=250&&l<=800&&this.setState({leftPanelWidth:l})});B(this,"handleLoadLocalJsonlFile",()=>{const t=document.createElement("input");t.type="file",t.accept=".jsonl",t.multiple=!0,t.onchange=a=>{const d=Array.from(a.target.files);if(d.length===0)return;if(d.reduce((h,i)=>h+i.size,0)>500*1024*1024){K.error(p("ui.fileTooLarge"));return}this.setState({fileLoading:!0,fileLoadingCount:0});let u=0;const f=[],o=[];d.forEach(h=>{const i=new FileReader;i.onload=c=>{try{const y=c.target.result.split(`
36
+ ---
37
+ `).filter(x=>x.trim()).map(x=>{try{return JSON.parse(x)}catch{return null}}).filter(Boolean);f.push(...y),o.push(h.name)}catch{}u++,u===d.length&&this._finishLocalLoad(f,o)},i.readAsText(h)})},t.click()});B(this,"_processJsonlFiles",t=>{if(!t||t.length===0)return;if(t.reduce((f,o)=>f+o.size,0)>500*1024*1024){K.error(p("ui.fileTooLarge"));return}this.setState({fileLoading:!0,fileLoadingCount:0});let d=0;const l=[],u=[];t.forEach(f=>{const o=new FileReader;o.onload=h=>{try{const c=h.target.result.split(`
38
+ ---
39
+ `).filter(m=>m.trim()).map(m=>{try{return JSON.parse(m)}catch{return null}}).filter(Boolean);l.push(...c),u.push(f.name)}catch{}d++,d===t.length&&this._finishLocalLoad(l,u)},o.readAsText(f)})});B(this,"_isInternalDrag",t=>t.dataTransfer.types.includes("text/x-preset-reorder"));B(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})});B(this,"_onDragLeave",t=>{const a=this._layoutRef.current;a&&!a.contains(t.relatedTarget)&&this.setState({isDragging:!1})});B(this,"_onDrop",t=>{if(t.preventDefault(),this._isInternalDrag(t))return;this.setState({isDragging:!1});const a=Array.from(t.dataTransfer.files);a.length&&Promise.all(a.map(d=>ga(d).then(l=>({name:d.name,path:l})).catch(l=>(K.error(`${d.name}: ${l.message}`),null)))).then(d=>{const l=d.filter(Boolean).map(u=>`"${u.path}"`);l.length>0&&this.setState(u=>({pendingUploadPaths:[...u.pendingUploadPaths||[],...l]}))})});B(this,"handleUploadPathsConsumed",()=>{this.setState({pendingUploadPaths:[]})});Object.assign(this.state,{leftPanelWidth:380,terminalVisible:!0,currentTab:"request",pendingCacheHighlight:null})}render(){const{filteredRequests:t,selectedRequest:a,fileLoading:d,fileLoadingCount:l,mainAgentSessions:u,viewMode:f}=this.renderPrepare(),{selectedIndex:o,leftPanelWidth:h,currentTab:i}=this.state;return this.state.workspaceMode?this.renderWorkspaceMode():e.jsxs(xa,{theme:this.themeConfig,children:[d&&e.jsx("div",{className:R.loadingOverlay,children:e.jsxs("div",{className:R.loadingText,children:["Loading...(",l,")"]})}),this.state.isDragging&&e.jsx("div",{className:R.dragOverlay,children:e.jsxs("div",{className:R.dragOverlayContent,children:[e.jsx(Kt,{className:R.dragIcon}),e.jsx("p",{children:p("ui.dragDropHint")})]})}),e.jsxs(Me,{className:R.layout,ref:this._layoutRef,onDragOver:this._onDragOver,onDragLeave:this._onDragLeave,onDrop:this._onDrop,children:[e.jsx(Me.Header,{className:R.header,children:e.jsx(st,{requestCount:t.length,requests:t,viewMode:f,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(c=>({terminalVisible:!c.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})}),e.jsxs(Me.Content,{className:R.content,children:[f==="raw"&&(t.length===0?e.jsx("div",{className:R.guideContainer,children:e.jsxs("div",{className:R.guideContent,children:[e.jsx("h2",{className:R.guideTitle,children:p("ui.guide.title")}),e.jsxs("div",{className:R.guideStep,children:[e.jsx("div",{className:R.guideStepNum,children:"1"}),e.jsxs("div",{className:R.guideStepBody,children:[e.jsx("p",{className:R.guideText,children:p("ui.guide.step1")}),e.jsx("code",{className:R.guideCode,children:p("ui.guide.exampleQuestion")})]})]}),e.jsxs("div",{className:R.guideStep,children:[e.jsx("div",{className:R.guideStepNum,children:"2"}),e.jsxs("div",{className:R.guideStepBody,children:[e.jsx("p",{className:R.guideText,children:p("ui.guide.step2")}),e.jsx("code",{className:R.guideCode,children:p("ui.guide.troubleshootCmd")})]})]}),e.jsxs("div",{className:R.guideStep,children:[e.jsx("div",{className:R.guideStepNum,children:"3"}),e.jsxs("div",{className:R.guideStepBody,children:[e.jsx("p",{className:R.guideText,children:p("ui.guide.step3")}),e.jsx("code",{className:R.guideCode,children:"npm install -g @anthropic-ai/claude-code"})]})]})]})}):e.jsxs("div",{ref:this.mainContainerRef,className:R.mainContainer,children:[e.jsxs("div",{className:R.leftPanel,style:{width:h},children:[e.jsxs("div",{className:R.leftPanelHeader,children:[e.jsx("span",{children:p("ui.requestList")}),e.jsx("span",{className:R.leftPanelCount,children:p("ui.totalRequests",{count:t.length})})]}),e.jsx("div",{className:R.leftPanelBody,children:e.jsx(Yn,{requests:t,selectedIndex:o,scrollCenter:this.state.scrollCenter,onSelect:this.handleSelectRequest,onScrollDone:this.handleScrollDone,cacheLossMap:this._cacheLossMap})})]}),e.jsx(_i,{onResize:this.handleResize}),e.jsx("div",{className:R.rightPanel,children:e.jsx(Ci,{request:a,requests:t,allRequests:this.state.requests,selectedIndex:o,currentTab:i,onTabChange:this.handleTabChange,onViewInChat:this.handleViewInChat,expandDiff:this.state.expandDiff,pendingCacheHighlight:this.state.pendingCacheHighlight,onCacheHighlightDone:this.handleCacheHighlightDone})})]})),e.jsx("div",{className:R.chatViewWrapper,style:{display:f==="chat"?"flex":"none"},children:e.jsx(va,{requests:t,mainAgentSessions:u,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(c=>({terminalVisible:!c.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:c=>this.loadSession(c),lang:this.state.lang,autoApproveSeconds:this.state.autoApproveSeconds,onAutoApproveChange:this.handleAutoApproveChange})})]}),e.jsx("div",{className:R.footer,children:e.jsx("div",{className:R.footerRight,children:e.jsxs("a",{href:"https://github.com/weiesky/cc-viewer",target:"_blank",rel:"noopener noreferrer",className:R.footerLink,children:[e.jsx("svg",{className:R.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(ke,{title:p("ui.resume.title"),open:this.state.resumeModalVisible,closable:!1,maskClosable:!1,keyboard:!1,footer:e.jsxs("div",{children:[e.jsxs("div",{className:R.resumeFooterRight,children:[e.jsx(F,{type:"primary",onClick:()=>this.handleResumeChoice("continue"),className:R.btnMarginRight,children:p("ui.resume.continue")},"continue"),e.jsx(F,{onClick:()=>this.handleResumeChoice("new"),children:p("ui.resume.new")},"new")]}),e.jsx("div",{className:R.resumeFooterLeft,children:e.jsx(ya,{checked:this.state.resumeRememberChoice,onChange:c=>this.setState({resumeRememberChoice:c.target.checked}),className:R.resumeCheckboxOpacity,children:e.jsx("span",{className:R.resumeCheckboxOpacity,children:p("ui.resume.remember")})})})]}),children:e.jsx("p",{children:p("ui.resume.message",{file:this.state.resumeFileName})})}),e.jsxs(ke,{title:e.jsxs("span",{className:R.modalTitleInline,children:[e.jsx(es,{apiEndpoint:oe("/api/open-log-dir"),title:p("ui.openLogDir"),size:16}),p("ui.importLocalLogs")]}),open:this.state.importModalVisible,onCancel:this.handleCloseImportModal,footer:null,width:1e3,styles:{body:{overflow:"hidden"}},children:[e.jsxs("div",{className:R.modalActions,children:[e.jsx(F,{icon:e.jsx(Kt,{}),onClick:this.handleLoadLocalJsonlFile,children:p("ui.loadLocalJsonl")}),e.jsx(F,{size:"small",type:this.state.selectedLogs.size>1?"primary":"default",disabled:this.state.selectedLogs.size<2,onClick:this.handleMergeLogs,className:R.btnMarginLeft,children:p("ui.mergeLogs")}),e.jsx(F,{size:"small",danger:!0,icon:e.jsx(pt,{}),disabled:this.state.selectedLogs.size===0,onClick:this.handleDeleteLogs,className:R.btnMarginLeft,children:p("ui.deleteLogs")}),e.jsx(F,{size:"small",icon:e.jsx(ft,{spin:this.state.refreshingStats}),loading:this.state.refreshingStats,onClick:this.handleRefreshStats,className:R.btnMarginLeft,children:p("ui.refreshStats")})]}),this.state.localLogsLoading?e.jsx("div",{className:R.spinCenter,children:e.jsx(Xt,{})}):(()=>{const c=this.state.localLogs[this.state.currentProject];return!c||c.length===0?e.jsx("div",{className:R.emptyCenter,children:p("ui.noLogs")}):e.jsx("div",{className:R.logListContainer,children:this.renderLogTable(c,!1)})})()]})]})}}export{Ei as default};