cc-viewer 1.6.131 → 1.6.133

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 (65) hide show
  1. package/dist/assets/App-BFEbsWQM.js +41 -0
  2. package/dist/assets/App-fG2r3jFq.css +1 -0
  3. package/dist/assets/AppHeader-33AglxUb.css +41 -0
  4. package/dist/assets/{AppHeader.module-BELBa7yz.js → AppHeader.module-CtuCFbdA.js} +59 -59
  5. package/dist/assets/{Mobile-BHY18odu.js → Mobile-Bp2RbeBU.js} +1 -1
  6. package/dist/assets/{_basePickBy-B9LrQhjs.js → _basePickBy-B0T11xYQ.js} +1 -1
  7. package/dist/assets/{_baseUniq-Cq_gdNQG.js → _baseUniq-D0M8tzSp.js} +1 -1
  8. package/dist/assets/{arc-ics4_WNv.js → arc-D6cdy7q_.js} +1 -1
  9. package/dist/assets/{architectureDiagram-2XIMDMQ5-CG5jEhMz.js → architectureDiagram-2XIMDMQ5-2GfhKa0T.js} +1 -1
  10. package/dist/assets/{blockDiagram-WCTKOSBZ-Ba2G6jOc.js → blockDiagram-WCTKOSBZ-DLA0Sj1x.js} +1 -1
  11. package/dist/assets/{c4Diagram-IC4MRINW-scPsa6Mr.js → c4Diagram-IC4MRINW-CA_Hr66Y.js} +1 -1
  12. package/dist/assets/channel-la8yOvt2.js +1 -0
  13. package/dist/assets/{chunk-4BX2VUAB-DCyM55ou.js → chunk-4BX2VUAB-D04pZGdL.js} +1 -1
  14. package/dist/assets/{chunk-55IACEB6-Bj_dwDow.js → chunk-55IACEB6-CUb23Ouk.js} +1 -1
  15. package/dist/assets/{chunk-FMBD7UC4-C--IPfJ0.js → chunk-FMBD7UC4-FI6C75_Q.js} +1 -1
  16. package/dist/assets/{chunk-JSJVCQXG-CWWlMNf6.js → chunk-JSJVCQXG-BbOPb9o6.js} +1 -1
  17. package/dist/assets/{chunk-KX2RTZJC-BaX5KBY4.js → chunk-KX2RTZJC-CAzT38FV.js} +1 -1
  18. package/dist/assets/{chunk-NQ4KR5QH-xyabXMSs.js → chunk-NQ4KR5QH-Dti2CrAe.js} +1 -1
  19. package/dist/assets/{chunk-QZHKN3VN-DXjrNjWi.js → chunk-QZHKN3VN-DyGq9ruZ.js} +1 -1
  20. package/dist/assets/{chunk-WL4C6EOR-D1AHVXD8.js → chunk-WL4C6EOR-BwLYBeLu.js} +1 -1
  21. package/dist/assets/classDiagram-VBA2DB6C-kUt0Xf8-.js +1 -0
  22. package/dist/assets/classDiagram-v2-RAHNMMFH-kUt0Xf8-.js +1 -0
  23. package/dist/assets/clone-CEVDUDen.js +1 -0
  24. package/dist/assets/{cose-bilkent-S5V4N54A-BjxoOFvj.js → cose-bilkent-S5V4N54A-V_7iUn46.js} +1 -1
  25. package/dist/assets/{dagre-KLK3FWXG-e5uESbYL.js → dagre-KLK3FWXG-CZUsFwM6.js} +1 -1
  26. package/dist/assets/{diagram-E7M64L7V-DqCBti2V.js → diagram-E7M64L7V-DMxygiOC.js} +1 -1
  27. package/dist/assets/{diagram-IFDJBPK2-0Wp3uyHy.js → diagram-IFDJBPK2-Ld2HDtF0.js} +1 -1
  28. package/dist/assets/{diagram-P4PSJMXO-SoTdpZjc.js → diagram-P4PSJMXO-m1kcREdi.js} +1 -1
  29. package/dist/assets/{erDiagram-INFDFZHY-BOZ0FOJY.js → erDiagram-INFDFZHY-vVdlf61B.js} +1 -1
  30. package/dist/assets/{flowDiagram-PKNHOUZH-uWiM2ZUu.js → flowDiagram-PKNHOUZH-2Y6Ggt46.js} +1 -1
  31. package/dist/assets/{ganttDiagram-A5KZAMGK-CiVMclUf.js → ganttDiagram-A5KZAMGK-0V8ypZHs.js} +1 -1
  32. package/dist/assets/{gitGraphDiagram-K3NZZRJ6-Ku8qjUuU.js → gitGraphDiagram-K3NZZRJ6-HI7IftLs.js} +1 -1
  33. package/dist/assets/{graph-DjKUJEqS.js → graph-CFNwsLbn.js} +1 -1
  34. package/dist/assets/{index-azUs3Qxz.js → index-C_MF_ut6.js} +2 -2
  35. package/dist/assets/{index-3E2GNREX.css → index-DpVZHXlw.css} +1 -1
  36. package/dist/assets/{infoDiagram-LFFYTUFH-DHmOE4XN.js → infoDiagram-LFFYTUFH-CTmG7GiP.js} +1 -1
  37. package/dist/assets/{ishikawaDiagram-PHBUUO56-C5xJlHuN.js → ishikawaDiagram-PHBUUO56-DYR1Aom3.js} +1 -1
  38. package/dist/assets/{journeyDiagram-4ABVD52K-CwLJJ-uP.js → journeyDiagram-4ABVD52K-B72IGO-5.js} +1 -1
  39. package/dist/assets/{kanban-definition-K7BYSVSG-C3hr9u0F.js → kanban-definition-K7BYSVSG-BwfQ0qJA.js} +1 -1
  40. package/dist/assets/{layout-CRQj3qq4.js → layout-ubniD4iw.js} +1 -1
  41. package/dist/assets/{linear-D1WeoCVD.js → linear-DXo9GC2I.js} +1 -1
  42. package/dist/assets/{mermaid.core-Dnp1sf3T.js → mermaid.core-JEugC4ZG.js} +4 -4
  43. package/dist/assets/{mindmap-definition-YRQLILUH-DCTMN0k3.js → mindmap-definition-YRQLILUH-BY54o1L8.js} +1 -1
  44. package/dist/assets/{pieDiagram-SKSYHLDU-CxNAvVrB.js → pieDiagram-SKSYHLDU-KOY275JH.js} +1 -1
  45. package/dist/assets/{quadrantDiagram-337W2JSQ-DkAZJbq0.js → quadrantDiagram-337W2JSQ-CIffLrSV.js} +1 -1
  46. package/dist/assets/{requirementDiagram-Z7DCOOCP-BCdipnP_.js → requirementDiagram-Z7DCOOCP-OJQ_B16B.js} +1 -1
  47. package/dist/assets/{sankeyDiagram-WA2Y5GQK-CpVJHICy.js → sankeyDiagram-WA2Y5GQK-CbmsQtQE.js} +1 -1
  48. package/dist/assets/{sequenceDiagram-2WXFIKYE-DZm3MFbu.js → sequenceDiagram-2WXFIKYE-q2XAawHr.js} +1 -1
  49. package/dist/assets/{stateDiagram-RAJIS63D-B_QuS61K.js → stateDiagram-RAJIS63D-bC1v7Grm.js} +1 -1
  50. package/dist/assets/stateDiagram-v2-FVOUBMTO-BcqwFGAz.js +1 -0
  51. package/dist/assets/{timeline-definition-YZTLITO2-DW2E-SEP.js → timeline-definition-YZTLITO2-CRdvqD0V.js} +1 -1
  52. package/dist/assets/{treemap-KZPCXAKY-WAM-hqbW.js → treemap-KZPCXAKY-Ser7nc2K.js} +1 -1
  53. package/dist/assets/{vennDiagram-LZ73GAT5-BZbwurbX.js → vennDiagram-LZ73GAT5--BhChYBy.js} +1 -1
  54. package/dist/assets/{xychartDiagram-JWTSCODW-BFp1ftg8.js → xychartDiagram-JWTSCODW-Ksm5Oz1H.js} +1 -1
  55. package/dist/index.html +2 -2
  56. package/package.json +1 -1
  57. package/dist/assets/App-9DQ4VNul.css +0 -1
  58. package/dist/assets/App-DtDZosZX.js +0 -41
  59. package/dist/assets/AppHeader-PuWcD2UV.css +0 -41
  60. package/dist/assets/channel-uzt2PdN-.js +0 -1
  61. package/dist/assets/classDiagram-VBA2DB6C-3SsBxLUf.js +0 -1
  62. package/dist/assets/classDiagram-v2-RAHNMMFH-3SsBxLUf.js +0 -1
  63. package/dist/assets/clone-BaM0oJXZ.js +0 -1
  64. package/dist/assets/stateDiagram-v2-FVOUBMTO-Dk_-QQ2W.js +0 -1
  65. package/dist/ccv-logo.png +0 -0
@@ -0,0 +1,41 @@
1
+ var Bs=Object.defineProperty;var Ds=(a,s,t)=>s in a?Bs(a,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[s]=t;var O=(a,s,t)=>Ds(a,typeof s!="symbol"?s+"":s,t);import{r as v,R as U,j as e,a as Os}from"./index-C_MF_ut6.js";import{g as Yt,r as $s,u as Ee,P as ct,c as te,Q as at,d as ft,U as Zt,V as Fs,W as Hs,X as zs,Y as Vs,Z as qs,$ as es,a0 as wt,a1 as Us,a2 as Ws,a3 as Ks,a4 as Gs,a5 as Js,a6 as Qs,a7 as Xs,_ as oe,a8 as Ys,a9 as xt,aa as Se,ab as Tt,ac as ut,ad as Mt,ae as Zs,af as ea,ag as Et,ah as ta,m as sa,ai as aa,aj as na,ak as oa,al as ia,am as la,an as ra,ao as It,C as _t,I as Ce,ap as ca,aq as ts,ar as da,as as ss,at as ha,au as ua,av as ma,e as ue,t as m,w as Ke,x as pa,y as Te,j as ga,k as fa,l as xa,s as d,v as G,q as re,aw as as,ax as Ve,ay as J,L as Le,az as ze,n as va,aA as ya,o as Ge,aB as ja,aC as _e,S as ns,aD as qe,aE as Ca,aF as je,aG as Rt,B as H,J as Me,aH as Re,M as ba,aI as os,aJ as Qe,aK as Na,aL as Sa,G as vt,aM as Lt,H as yt,aN as _a,O as is,aO as ka,aP as wa,aQ as Ae,aR as Pt,aS as Ta,aT as At,aU as ls,aV as rs,aW as Be,aX as De,aY as cs,aZ as mt,a_ as Bt,a$ as Dt,b0 as Ot,b1 as Ma,b2 as Ea,A as Ia,b3 as Xe,b4 as $t,b5 as Ra,D as La,z as I,E as Pa,b6 as Aa}from"./AppHeader.module-CtuCFbdA.js";const Ye=(a,s,t,n,r)=>({background:a,border:`${Ee(n.lineWidth)} ${n.lineType} ${s}`,[`${r}-icon`]:{color:t}}),Ba=a=>{const{componentCls:s,motionDurationSlow:t,marginXS:n,marginSM:r,fontSize:o,fontSizeLG:u,lineHeight:g,borderRadiusLG:i,motionEaseInOutCirc:h,withDescriptionIconSize:l,colorText:c,colorTextHeading:p,withDescriptionPadding:j,defaultPadding:f}=a;return{[s]:Object.assign(Object.assign({},$s(a)),{position:"relative",display:"flex",alignItems:"center",padding:f,wordWrap:"break-word",borderRadius:i,[`&${s}-rtl`]:{direction:"rtl"},[`${s}-content`]:{flex:1,minWidth:0},[`${s}-icon`]:{marginInlineEnd:n,lineHeight:0},"&-description":{display:"none",fontSize:o,lineHeight:g},"&-message":{color:p},[`&${s}-motion-leave`]:{overflow:"hidden",opacity:1,transition:`max-height ${t} ${h}, opacity ${t} ${h},
2
+ padding-top ${t} ${h}, padding-bottom ${t} ${h},
3
+ margin-bottom ${t} ${h}`},[`&${s}-motion-leave-active`]:{maxHeight:0,marginBottom:"0 !important",paddingTop:0,paddingBottom:0,opacity:0}}),[`${s}-with-description`]:{alignItems:"flex-start",padding:j,[`${s}-icon`]:{marginInlineEnd:r,fontSize:l,lineHeight:0},[`${s}-message`]:{display:"block",marginBottom:n,color:p,fontSize:u},[`${s}-description`]:{display:"block",color:c}},[`${s}-banner`]:{marginBottom:0,border:"0 !important",borderRadius:0}}},Da=a=>{const{componentCls:s,colorSuccess:t,colorSuccessBorder:n,colorSuccessBg:r,colorWarning:o,colorWarningBorder:u,colorWarningBg:g,colorError:i,colorErrorBorder:h,colorErrorBg:l,colorInfo:c,colorInfoBorder:p,colorInfoBg:j}=a;return{[s]:{"&-success":Ye(r,n,t,a,s),"&-info":Ye(j,p,c,a,s),"&-warning":Ye(g,u,o,a,s),"&-error":Object.assign(Object.assign({},Ye(l,h,i,a,s)),{[`${s}-description > pre`]:{margin:0,padding:0}})}}},Oa=a=>{const{componentCls:s,iconCls:t,motionDurationMid:n,marginXS:r,fontSizeIcon:o,colorIcon:u,colorIconHover:g}=a;return{[s]:{"&-action":{marginInlineStart:r},[`${s}-close-icon`]:{marginInlineStart:r,padding:0,overflow:"hidden",fontSize:o,lineHeight:Ee(o),backgroundColor:"transparent",border:"none",outline:"none",cursor:"pointer",[`${t}-close`]:{color:u,transition:`color ${n}`,"&:hover":{color:g}}},"&-close-text":{color:u,transition:`color ${n}`,"&:hover":{color:g}}}}},$a=a=>({withDescriptionIconSize:a.fontSizeHeading3,defaultPadding:`${a.paddingContentVerticalSM}px 12px`,withDescriptionPadding:`${a.paddingMD}px ${a.paddingContentHorizontalLG}px`}),Fa=Yt("Alert",a=>[Ba(a),Da(a),Oa(a)],$a);var Ft=function(a,s){var t={};for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&s.indexOf(n)<0&&(t[n]=a[n]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(a);r<n.length;r++)s.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(a,n[r])&&(t[n[r]]=a[n[r]]);return t};const Ha={success:qs,info:Vs,error:zs,warning:Hs},za=a=>{const{icon:s,prefixCls:t,type:n}=a,r=Ha[n]||null;return s?Fs(s,v.createElement("span",{className:`${t}-icon`},s),()=>({className:te(`${t}-icon`,s.props.className)})):v.createElement(r,{className:`${t}-icon`})},Va=a=>{const{isClosable:s,prefixCls:t,closeIcon:n,handleClose:r,ariaProps:o}=a,u=n===!0||n===void 0?v.createElement(es,null):n;return s?v.createElement("button",Object.assign({type:"button",onClick:r,className:`${t}-close-icon`,tabIndex:0},o),u):null},ds=v.forwardRef((a,s)=>{const{description:t,prefixCls:n,message:r,banner:o,className:u,rootClassName:g,style:i,onMouseEnter:h,onMouseLeave:l,onClick:c,afterClose:p,showIcon:j,closable:f,closeText:x,closeIcon:y,action:C,id:k}=a,N=Ft(a,["description","prefixCls","message","banner","className","rootClassName","style","onMouseEnter","onMouseLeave","onClick","afterClose","showIcon","closable","closeText","closeIcon","action","id"]),[b,M]=v.useState(!1),E=v.useRef(null);v.useImperativeHandle(s,()=>({nativeElement:E.current}));const{getPrefixCls:L,direction:R,closable:T,closeIcon:A,className:D,style:se}=ct("alert"),F=L("alert",n),[P,Q,ie]=Fa(F),Y=ee=>{var S;M(!0),(S=a.onClose)===null||S===void 0||S.call(a,ee)},ce=v.useMemo(()=>a.type!==void 0?a.type:o?"warning":"info",[a.type,o]),de=v.useMemo(()=>typeof f=="object"&&f.closeIcon||x?!0:typeof f=="boolean"?f:y!==!1&&y!==null&&y!==void 0?!0:!!T,[x,y,f,T]),le=o&&j===void 0?!0:j,W=te(F,`${F}-${ce}`,{[`${F}-with-description`]:!!t,[`${F}-no-icon`]:!le,[`${F}-banner`]:!!o,[`${F}-rtl`]:R==="rtl"},D,u,g,ie,Q),me=at(N,{aria:!0,data:!0}),ae=v.useMemo(()=>typeof f=="object"&&f.closeIcon?f.closeIcon:x||(y!==void 0?y:typeof T=="object"&&T.closeIcon?T.closeIcon:A),[y,f,T,x,A]),xe=v.useMemo(()=>{const ee=f??T;if(typeof ee=="object"){const{closeIcon:S}=ee;return Ft(ee,["closeIcon"])}return{}},[f,T]);return P(v.createElement(ft,{visible:!b,motionName:`${F}-motion`,motionAppear:!1,motionEnter:!1,onLeaveStart:ee=>({maxHeight:ee.offsetHeight}),onLeaveEnd:p},({className:ee,style:S},K)=>v.createElement("div",Object.assign({id:k,ref:Zt(E,K),"data-show":!b,className:te(W,ee),style:Object.assign(Object.assign(Object.assign({},se),i),S),onMouseEnter:h,onMouseLeave:l,onClick:c,role:"alert"},me),le?v.createElement(za,{description:t,icon:a.icon,prefixCls:F,type:ce}):null,v.createElement("div",{className:`${F}-content`},r?v.createElement("div",{className:`${F}-message`},r):null,t?v.createElement("div",{className:`${F}-description`},t):null),C?v.createElement("div",{className:`${F}-action`},C):null,v.createElement(Va,{isClosable:de,prefixCls:F,closeIcon:ae,handleClose:Y,ariaProps:xe}))))});function qa(a,s,t){return s=wt(s),Us(a,Ws()?Reflect.construct(s,t||[],wt(a).constructor):s.apply(a,t))}let Ua=(function(a){function s(){var t;return Js(this,s),t=qa(this,s,arguments),t.state={error:void 0,info:{componentStack:""}},t}return Ks(s,a),Gs(s,[{key:"componentDidCatch",value:function(n,r){this.setState({error:n,info:r})}},{key:"render",value:function(){const{message:n,description:r,id:o,children:u}=this.props,{error:g,info:i}=this.state,h=(i==null?void 0:i.componentStack)||null,l=typeof n>"u"?(g||"").toString():n,c=typeof r>"u"?h:r;return g?v.createElement(ds,{id:o,type:"error",message:l,description:v.createElement("pre",{style:{fontSize:"0.9em",overflowX:"auto"}},c)}):u}}])})(v.Component);const hs=ds;hs.ErrorBoundary=Ua;var Ht=v.createContext(null),us=v.createContext({}),Wa=["prefixCls","className","containerRef"],Ka=function(s){var t=s.prefixCls,n=s.className,r=s.containerRef,o=Qs(s,Wa),u=v.useContext(us),g=u.panel,i=Xs(g,r);return v.createElement("div",oe({className:te("".concat(t,"-content"),n),role:"dialog",ref:i},at(s,{aria:!0}),{"aria-modal":"true"},o))};function zt(a){return typeof a=="string"&&String(Number(a))===a?(Ys(!1,"Invalid value type of `width` or `height` which should be number type instead."),Number(a)):a}var Vt={width:0,height:0,overflow:"hidden",outline:"none",position:"absolute"};function Ga(a,s){var t,n,r,o=a.prefixCls,u=a.open,g=a.placement,i=a.inline,h=a.push,l=a.forceRender,c=a.autoFocus,p=a.keyboard,j=a.classNames,f=a.rootClassName,x=a.rootStyle,y=a.zIndex,C=a.className,k=a.id,N=a.style,b=a.motion,M=a.width,E=a.height,L=a.children,R=a.mask,T=a.maskClosable,A=a.maskMotion,D=a.maskClassName,se=a.maskStyle,F=a.afterOpenChange,P=a.onClose,Q=a.onMouseEnter,ie=a.onMouseOver,Y=a.onMouseLeave,ce=a.onClick,de=a.onKeyDown,le=a.onKeyUp,W=a.styles,me=a.drawerRender,ae=v.useRef(),xe=v.useRef(),ee=v.useRef();v.useImperativeHandle(s,function(){return ae.current});var S=function(ge){var $e=ge.keyCode,Fe=ge.shiftKey;switch($e){case ut.TAB:{if($e===ut.TAB){if(!Fe&&document.activeElement===ee.current){var He;(He=xe.current)===null||He===void 0||He.focus({preventScroll:!0})}else if(Fe&&document.activeElement===xe.current){var ht;(ht=ee.current)===null||ht===void 0||ht.focus({preventScroll:!0})}}break}case ut.ESC:{P&&p&&(ge.stopPropagation(),P(ge));break}}};v.useEffect(function(){if(u&&c){var Z;(Z=ae.current)===null||Z===void 0||Z.focus({preventScroll:!0})}},[u]);var K=v.useState(!1),ve=xt(K,2),be=ve[0],Ne=ve[1],q=v.useContext(Ht),ke;typeof h=="boolean"?ke=h?{}:{distance:0}:ke=h||{};var ye=(t=(n=(r=ke)===null||r===void 0?void 0:r.distance)!==null&&n!==void 0?n:q==null?void 0:q.pushDistance)!==null&&t!==void 0?t:180,Je=v.useMemo(function(){return{pushDistance:ye,push:function(){Ne(!0)},pull:function(){Ne(!1)}}},[ye]);v.useEffect(function(){if(u){var Z;q==null||(Z=q.push)===null||Z===void 0||Z.call(q)}else{var ge;q==null||(ge=q.pull)===null||ge===void 0||ge.call(q)}},[u]),v.useEffect(function(){return function(){var Z;q==null||(Z=q.pull)===null||Z===void 0||Z.call(q)}},[]);var pe=v.createElement(ft,oe({key:"mask"},A,{visible:R&&u}),function(Z,ge){var $e=Z.className,Fe=Z.style;return v.createElement("div",{className:te("".concat(o,"-mask"),$e,j==null?void 0:j.mask,D),style:Se(Se(Se({},Fe),se),W==null?void 0:W.mask),onClick:T&&u?P:void 0,ref:ge})}),ne=typeof b=="function"?b(g):b,$={};if(be&&ye)switch(g){case"top":$.transform="translateY(".concat(ye,"px)");break;case"bottom":$.transform="translateY(".concat(-ye,"px)");break;case"left":$.transform="translateX(".concat(ye,"px)");break;default:$.transform="translateX(".concat(-ye,"px)");break}g==="left"||g==="right"?$.width=zt(M):$.height=zt(E);var he={onMouseEnter:Q,onMouseOver:ie,onMouseLeave:Y,onClick:ce,onKeyDown:de,onKeyUp:le},we=v.createElement(ft,oe({key:"panel"},ne,{visible:u,forceRender:l,onVisibleChanged:function(ge){F==null||F(ge)},removeOnLeave:!1,leavedClassName:"".concat(o,"-content-wrapper-hidden")}),function(Z,ge){var $e=Z.className,Fe=Z.style,He=v.createElement(Ka,oe({id:k,containerRef:ge,prefixCls:o,className:te(C,j==null?void 0:j.content),style:Se(Se({},N),W==null?void 0:W.content)},at(a,{aria:!0}),he),L);return v.createElement("div",oe({className:te("".concat(o,"-content-wrapper"),j==null?void 0:j.wrapper,$e),style:Se(Se(Se({},$),Fe),W==null?void 0:W.wrapper)},at(a,{data:!0})),me?me(He):He)}),We=Se({},x);return y&&(We.zIndex=y),v.createElement(Ht.Provider,{value:Je},v.createElement("div",{className:te(o,"".concat(o,"-").concat(g),f,Tt(Tt({},"".concat(o,"-open"),u),"".concat(o,"-inline"),i)),style:We,tabIndex:-1,ref:ae,onKeyDown:S},pe,v.createElement("div",{tabIndex:0,ref:xe,style:Vt,"aria-hidden":"true","data-sentinel":"start"}),we,v.createElement("div",{tabIndex:0,ref:ee,style:Vt,"aria-hidden":"true","data-sentinel":"end"})))}var Ja=v.forwardRef(Ga),Qa=function(s){var t=s.open,n=t===void 0?!1:t,r=s.prefixCls,o=r===void 0?"rc-drawer":r,u=s.placement,g=u===void 0?"right":u,i=s.autoFocus,h=i===void 0?!0:i,l=s.keyboard,c=l===void 0?!0:l,p=s.width,j=p===void 0?378:p,f=s.mask,x=f===void 0?!0:f,y=s.maskClosable,C=y===void 0?!0:y,k=s.getContainer,N=s.forceRender,b=s.afterOpenChange,M=s.destroyOnClose,E=s.onMouseEnter,L=s.onMouseOver,R=s.onMouseLeave,T=s.onClick,A=s.onKeyDown,D=s.onKeyUp,se=s.panelRef,F=v.useState(!1),P=xt(F,2),Q=P[0],ie=P[1],Y=v.useState(!1),ce=xt(Y,2),de=ce[0],le=ce[1];Mt(function(){le(!0)},[]);var W=de?n:!1,me=v.useRef(),ae=v.useRef();Mt(function(){W&&(ae.current=document.activeElement)},[W]);var xe=function(be){var Ne;if(ie(be),b==null||b(be),!be&&ae.current&&!((Ne=me.current)!==null&&Ne!==void 0&&Ne.contains(ae.current))){var q;(q=ae.current)===null||q===void 0||q.focus({preventScroll:!0})}},ee=v.useMemo(function(){return{panel:se}},[se]);if(!N&&!Q&&!W&&M)return null;var S={onMouseEnter:E,onMouseOver:L,onMouseLeave:R,onClick:T,onKeyDown:A,onKeyUp:D},K=Se(Se({},s),{},{open:W,prefixCls:o,placement:g,autoFocus:h,keyboard:c,width:j,mask:x,maskClosable:C,inline:k===!1,afterOpenChange:xe,ref:me},S);return v.createElement(us.Provider,{value:ee},v.createElement(Zs,{open:W||N||Q,autoDestroy:!1,getContainer:k,autoLock:x&&(W||Q)},v.createElement(Ja,K)))};const ms=a=>{var s,t;const{prefixCls:n,ariaId:r,title:o,footer:u,extra:g,closable:i,loading:h,onClose:l,headerStyle:c,bodyStyle:p,footerStyle:j,children:f,classNames:x,styles:y}=a,C=ct("drawer");let k;i===!1?k=void 0:i===void 0||i===!0?k="start":k=(i==null?void 0:i.placement)==="end"?"end":"start";const N=v.useCallback(R=>v.createElement("button",{type:"button",onClick:l,className:te(`${n}-close`,{[`${n}-close-${k}`]:k==="end"})},R),[l,n,k]),[b,M]=ea(Et(a),Et(C),{closable:!0,closeIconRender:N}),E=()=>{var R,T;return!o&&!b?null:v.createElement("div",{style:Object.assign(Object.assign(Object.assign({},(R=C.styles)===null||R===void 0?void 0:R.header),c),y==null?void 0:y.header),className:te(`${n}-header`,{[`${n}-header-close-only`]:b&&!o&&!g},(T=C.classNames)===null||T===void 0?void 0:T.header,x==null?void 0:x.header)},v.createElement("div",{className:`${n}-header-title`},k==="start"&&M,o&&v.createElement("div",{className:`${n}-title`,id:r},o)),g&&v.createElement("div",{className:`${n}-extra`},g),k==="end"&&M)},L=()=>{var R,T;if(!u)return null;const A=`${n}-footer`;return v.createElement("div",{className:te(A,(R=C.classNames)===null||R===void 0?void 0:R.footer,x==null?void 0:x.footer),style:Object.assign(Object.assign(Object.assign({},(T=C.styles)===null||T===void 0?void 0:T.footer),j),y==null?void 0:y.footer)},u)};return v.createElement(v.Fragment,null,E(),v.createElement("div",{className:te(`${n}-body`,x==null?void 0:x.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),p),y==null?void 0:y.body)},h?v.createElement(ta,{active:!0,title:!1,paragraph:{rows:5},className:`${n}-body-skeleton`}):f),L())},Xa=a=>{const s="100%";return{left:`translateX(-${s})`,right:`translateX(${s})`,top:`translateY(-${s})`,bottom:`translateY(${s})`}[a]},ps=(a,s)=>({"&-enter, &-appear":Object.assign(Object.assign({},a),{"&-active":s}),"&-leave":Object.assign(Object.assign({},s),{"&-active":a})}),gs=(a,s)=>Object.assign({"&-enter, &-appear, &-leave":{"&-start":{transition:"none"},"&-active":{transition:`all ${s}`}}},ps({opacity:a},{opacity:1})),Ya=(a,s)=>[gs(.7,s),ps({transform:Xa(a)},{transform:"none"})],Za=a=>{const{componentCls:s,motionDurationSlow:t}=a;return{[s]:{[`${s}-mask-motion`]:gs(0,t),[`${s}-panel-motion`]:["left","right","top","bottom"].reduce((n,r)=>Object.assign(Object.assign({},n),{[`&-${r}`]:Ya(r,t)}),{})}}},en=a=>{const{borderRadiusSM:s,componentCls:t,zIndexPopup:n,colorBgMask:r,colorBgElevated:o,motionDurationSlow:u,motionDurationMid:g,paddingXS:i,padding:h,paddingLG:l,fontSizeLG:c,lineHeightLG:p,lineWidth:j,lineType:f,colorSplit:x,marginXS:y,colorIcon:C,colorIconHover:k,colorBgTextHover:N,colorBgTextActive:b,colorText:M,fontWeightStrong:E,footerPaddingBlock:L,footerPaddingInline:R,calc:T}=a,A=`${t}-content-wrapper`;return{[t]:{position:"fixed",inset:0,zIndex:n,pointerEvents:"none",color:M,"&-pure":{position:"relative",background:o,display:"flex",flexDirection:"column",[`&${t}-left`]:{boxShadow:a.boxShadowDrawerLeft},[`&${t}-right`]:{boxShadow:a.boxShadowDrawerRight},[`&${t}-top`]:{boxShadow:a.boxShadowDrawerUp},[`&${t}-bottom`]:{boxShadow:a.boxShadowDrawerDown}},"&-inline":{position:"absolute"},[`${t}-mask`]:{position:"absolute",inset:0,zIndex:n,background:r,pointerEvents:"auto"},[A]:{position:"absolute",zIndex:n,maxWidth:"100vw",transition:`all ${u}`,"&-hidden":{display:"none"}},[`&-left > ${A}`]:{top:0,bottom:0,left:{_skip_check_:!0,value:0},boxShadow:a.boxShadowDrawerLeft},[`&-right > ${A}`]:{top:0,right:{_skip_check_:!0,value:0},bottom:0,boxShadow:a.boxShadowDrawerRight},[`&-top > ${A}`]:{top:0,insetInline:0,boxShadow:a.boxShadowDrawerUp},[`&-bottom > ${A}`]:{bottom:0,insetInline:0,boxShadow:a.boxShadowDrawerDown},[`${t}-content`]:{display:"flex",flexDirection:"column",width:"100%",height:"100%",overflow:"auto",background:o,pointerEvents:"auto"},[`${t}-header`]:{display:"flex",flex:0,alignItems:"center",padding:`${Ee(h)} ${Ee(l)}`,fontSize:c,lineHeight:p,borderBottom:`${Ee(j)} ${f} ${x}`,"&-title":{display:"flex",flex:1,alignItems:"center",minWidth:0,minHeight:0}},[`${t}-extra`]:{flex:"none"},[`${t}-close`]:Object.assign({display:"inline-flex",width:T(c).add(i).equal(),height:T(c).add(i).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 ${g}`,textRendering:"auto",[`&${t}-close-end`]:{marginInlineStart:y},[`&:not(${t}-close-end)`]:{marginInlineEnd:y},"&:hover":{color:k,backgroundColor:N,textDecoration:"none"},"&:active":{backgroundColor:b}},aa(a)),[`${t}-title`]:{flex:1,margin:0,fontWeight:a.fontWeightStrong,fontSize:c,lineHeight:p},[`${t}-body`]:{flex:1,minWidth:0,minHeight:0,padding:l,overflow:"auto",[`${t}-body-skeleton`]:{width:"100%",height:"100%",display:"flex",justifyContent:"center"}},[`${t}-footer`]:{flexShrink:0,padding:`${Ee(L)} ${Ee(R)}`,borderTop:`${Ee(j)} ${f} ${x}`},"&-rtl":{direction:"rtl"}}}},tn=a=>({zIndexPopup:a.zIndexPopupBase,footerPaddingBlock:a.paddingXS,footerPaddingInline:a.padding}),fs=Yt("Drawer",a=>{const s=sa(a,{});return[en(s),Za(s)]},tn);var xs=function(a,s){var t={};for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&s.indexOf(n)<0&&(t[n]=a[n]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(a);r<n.length;r++)s.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(a,n[r])&&(t[n[r]]=a[n[r]]);return t};const sn={distance:180},Ze=a=>{const{rootClassName:s,width:t,height:n,size:r="default",mask:o=!0,push:u=sn,open:g,afterOpenChange:i,onClose:h,prefixCls:l,getContainer:c,panelRef:p=null,style:j,className:f,"aria-labelledby":x,visible:y,afterVisibleChange:C,maskStyle:k,drawerStyle:N,contentWrapperStyle:b,destroyOnClose:M,destroyOnHidden:E}=a,L=xs(a,["rootClassName","width","height","size","mask","push","open","afterOpenChange","onClose","prefixCls","getContainer","panelRef","style","className","aria-labelledby","visible","afterVisibleChange","maskStyle","drawerStyle","contentWrapperStyle","destroyOnClose","destroyOnHidden"]),R=na(),T=L.title?R:void 0,{getPopupContainer:A,getPrefixCls:D,direction:se,className:F,style:P,classNames:Q,styles:ie}=ct("drawer"),Y=D("drawer",l),[ce,de,le]=fs(Y),W=c===void 0&&A?()=>A(document.body):c,me=te({"no-mask":!o,[`${Y}-rtl`]:se==="rtl"},s,de,le),ae=v.useMemo(()=>t??(r==="large"?736:378),[t,r]),xe=v.useMemo(()=>n??(r==="large"?736:378),[n,r]),ee={motionName:It(Y,"mask-motion"),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500},S=ye=>({motionName:It(Y,`panel-motion-${ye}`),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500}),K=oa(),ve=Zt(p,K),[be,Ne]=ia("Drawer",L.zIndex),{classNames:q={},styles:ke={}}=L;return ce(v.createElement(la,{form:!0,space:!0},v.createElement(ra.Provider,{value:Ne},v.createElement(Qa,Object.assign({prefixCls:Y,onClose:h,maskMotion:ee,motion:S},L,{classNames:{mask:te(q.mask,Q.mask),content:te(q.content,Q.content),wrapper:te(q.wrapper,Q.wrapper)},styles:{mask:Object.assign(Object.assign(Object.assign({},ke.mask),k),ie.mask),content:Object.assign(Object.assign(Object.assign({},ke.content),N),ie.content),wrapper:Object.assign(Object.assign(Object.assign({},ke.wrapper),b),ie.wrapper)},open:g??y,mask:o,push:u,width:ae,height:xe,style:Object.assign(Object.assign({},P),j),className:te(F,f),rootClassName:me,getContainer:W,afterOpenChange:i??C,panelRef:ve,zIndex:be,"aria-labelledby":x??T,destroyOnClose:E??M}),v.createElement(ms,Object.assign({prefixCls:Y},L,{ariaId:T,onClose:h}))))))},an=a=>{const{prefixCls:s,style:t,className:n,placement:r="right"}=a,o=xs(a,["prefixCls","style","className","placement"]),{getPrefixCls:u}=v.useContext(_t),g=u("drawer",s),[i,h,l]=fs(g),c=te(g,`${g}-pure`,`${g}-${r}`,h,l,n);return i(v.createElement("div",{className:c,style:t},v.createElement(ms,Object.assign({prefixCls:g},o))))};Ze._InternalPanelDoNotUseOrYouWillBeFired=an;var nn={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"},on=function(s,t){return v.createElement(Ce,oe({},s,{ref:t,icon:nn}))},et=v.forwardRef(on),ln={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"},rn=function(s,t){return v.createElement(Ce,oe({},s,{ref:t,icon:ln}))},qt=v.forwardRef(rn);function cn(a,s,t){return typeof t=="boolean"?t:a.length?!0:ca(s).some(r=>r.type===ts)}var vs=function(a,s){var t={};for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&s.indexOf(n)<0&&(t[n]=a[n]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(a);r<n.length;r++)s.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(a,n[r])&&(t[n[r]]=a[n[r]]);return t};function dt({suffixCls:a,tagName:s,displayName:t}){return n=>v.forwardRef((o,u)=>v.createElement(n,Object.assign({ref:u,suffixCls:a,tagName:s},o)))}const kt=v.forwardRef((a,s)=>{const{prefixCls:t,suffixCls:n,className:r,tagName:o}=a,u=vs(a,["prefixCls","suffixCls","className","tagName"]),{getPrefixCls:g}=v.useContext(_t),i=g("layout",t),[h,l,c]=ss(i),p=n?`${i}-${n}`:i;return h(v.createElement(o,Object.assign({className:te(t||p,r,l,c),ref:s},u)))}),dn=v.forwardRef((a,s)=>{const{direction:t}=v.useContext(_t),[n,r]=v.useState([]),{prefixCls:o,className:u,rootClassName:g,children:i,hasSider:h,tagName:l,style:c}=a,p=vs(a,["prefixCls","className","rootClassName","children","hasSider","tagName","style"]),j=da(p,["suffixCls"]),{getPrefixCls:f,className:x,style:y}=ct("layout"),C=f("layout",o),k=cn(n,i,h),[N,b,M]=ss(C),E=te(C,{[`${C}-has-sider`]:k,[`${C}-rtl`]:t==="rtl"},x,u,g,b,M),L=v.useMemo(()=>({siderHook:{addSider:R=>{r(T=>[].concat(ha(T),[R]))},removeSider:R=>{r(T=>T.filter(A=>A!==R))}}}),[]);return N(v.createElement(ua.Provider,{value:L},v.createElement(l,Object.assign({ref:s,className:E,style:Object.assign(Object.assign({},y),c)},j),i)))}),hn=dt({tagName:"div",displayName:"Layout"})(dn),un=dt({suffixCls:"header",tagName:"header",displayName:"Header"})(kt),mn=dt({suffixCls:"footer",tagName:"footer",displayName:"Footer"})(kt),pn=dt({suffixCls:"content",tagName:"main",displayName:"Content"})(kt),Ie=hn;Ie.Header=un;Ie.Footer=mn;Ie.Content=pn;Ie.Sider=ts;Ie._InternalSiderContext=ma;var gn={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"},fn=function(s,t){return v.createElement(Ce,oe({},s,{ref:t,icon:gn}))},Ut=v.forwardRef(fn),xn={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"},vn=function(s,t){return v.createElement(Ce,oe({},s,{ref:t,icon:xn}))},Wt=v.forwardRef(vn),yn={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"},jn=function(s,t){return v.createElement(Ce,oe({},s,{ref:t,icon:yn}))},Kt=v.forwardRef(jn),Cn={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"},bn=function(s,t){return v.createElement(Ce,oe({},s,{ref:t,icon:Cn}))},tt=v.forwardRef(bn),Nn={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"},Sn=function(s,t){return v.createElement(Ce,oe({},s,{ref:t,icon:Nn}))},pt=v.forwardRef(Sn),_n={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"},kn=function(s,t){return v.createElement(Ce,oe({},s,{ref:t,icon:_n}))},wn=v.forwardRef(kn),Tn={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"},Mn=function(s,t){return v.createElement(Ce,oe({},s,{ref:t,icon:Tn}))},Gt=v.forwardRef(Mn),En={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"},In=function(s,t){return v.createElement(Ce,oe({},s,{ref:t,icon:En}))},Rn=v.forwardRef(In),Ln={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"},Pn=function(s,t){return v.createElement(Ce,oe({},s,{ref:t,icon:Ln}))},Jt=v.forwardRef(Pn),An={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"},Bn=function(s,t){return v.createElement(Ce,oe({},s,{ref:t,icon:An}))},Qt=v.forwardRef(Bn),Dn=Object.defineProperty,nt=Object.getOwnPropertySymbols,ys=Object.prototype.hasOwnProperty,js=Object.prototype.propertyIsEnumerable,Xt=(a,s,t)=>s in a?Dn(a,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[s]=t,jt=(a,s)=>{for(var t in s||(s={}))ys.call(s,t)&&Xt(a,t,s[t]);if(nt)for(var t of nt(s))js.call(s,t)&&Xt(a,t,s[t]);return a},Ct=(a,s)=>{var t={};for(var n in a)ys.call(a,n)&&s.indexOf(n)<0&&(t[n]=a[n]);if(a!=null&&nt)for(var n of nt(a))s.indexOf(n)<0&&js.call(a,n)&&(t[n]=a[n]);return t};/**
4
+ * @license QR Code generator library (TypeScript)
5
+ * Copyright (c) Project Nayuki.
6
+ * SPDX-License-Identifier: MIT
7
+ */var Oe;(a=>{const s=class B{constructor(i,h,l,c){if(this.version=i,this.errorCorrectionLevel=h,this.modules=[],this.isFunction=[],i<B.MIN_VERSION||i>B.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=i*4+17;let p=[];for(let f=0;f<this.size;f++)p.push(!1);for(let f=0;f<this.size;f++)this.modules.push(p.slice()),this.isFunction.push(p.slice());this.drawFunctionPatterns();const j=this.addEccAndInterleave(l);if(this.drawCodewords(j),c==-1){let f=1e9;for(let x=0;x<8;x++){this.applyMask(x),this.drawFormatBits(x);const y=this.getPenaltyScore();y<f&&(c=x,f=y),this.applyMask(x)}}r(0<=c&&c<=7),this.mask=c,this.applyMask(c),this.drawFormatBits(c),this.isFunction=[]}static encodeText(i,h){const l=a.QrSegment.makeSegments(i);return B.encodeSegments(l,h)}static encodeBinary(i,h){const l=a.QrSegment.makeBytes(i);return B.encodeSegments([l],h)}static encodeSegments(i,h,l=1,c=40,p=-1,j=!0){if(!(B.MIN_VERSION<=l&&l<=c&&c<=B.MAX_VERSION)||p<-1||p>7)throw new RangeError("Invalid value");let f,x;for(f=l;;f++){const N=B.getNumDataCodewords(f,h)*8,b=u.getTotalBits(i,f);if(b<=N){x=b;break}if(f>=c)throw new RangeError("Data too long")}for(const N of[B.Ecc.MEDIUM,B.Ecc.QUARTILE,B.Ecc.HIGH])j&&x<=B.getNumDataCodewords(f,N)*8&&(h=N);let y=[];for(const N of i){t(N.mode.modeBits,4,y),t(N.numChars,N.mode.numCharCountBits(f),y);for(const b of N.getData())y.push(b)}r(y.length==x);const C=B.getNumDataCodewords(f,h)*8;r(y.length<=C),t(0,Math.min(4,C-y.length),y),t(0,(8-y.length%8)%8,y),r(y.length%8==0);for(let N=236;y.length<C;N^=253)t(N,8,y);let k=[];for(;k.length*8<y.length;)k.push(0);return y.forEach((N,b)=>k[b>>>3]|=N<<7-(b&7)),new B(f,h,k,p)}getModule(i,h){return 0<=i&&i<this.size&&0<=h&&h<this.size&&this.modules[h][i]}getModules(){return this.modules}drawFunctionPatterns(){for(let l=0;l<this.size;l++)this.setFunctionModule(6,l,l%2==0),this.setFunctionModule(l,6,l%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const i=this.getAlignmentPatternPositions(),h=i.length;for(let l=0;l<h;l++)for(let c=0;c<h;c++)l==0&&c==0||l==0&&c==h-1||l==h-1&&c==0||this.drawAlignmentPattern(i[l],i[c]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(i){const h=this.errorCorrectionLevel.formatBits<<3|i;let l=h;for(let p=0;p<10;p++)l=l<<1^(l>>>9)*1335;const c=(h<<10|l)^21522;r(c>>>15==0);for(let p=0;p<=5;p++)this.setFunctionModule(8,p,n(c,p));this.setFunctionModule(8,7,n(c,6)),this.setFunctionModule(8,8,n(c,7)),this.setFunctionModule(7,8,n(c,8));for(let p=9;p<15;p++)this.setFunctionModule(14-p,8,n(c,p));for(let p=0;p<8;p++)this.setFunctionModule(this.size-1-p,8,n(c,p));for(let p=8;p<15;p++)this.setFunctionModule(8,this.size-15+p,n(c,p));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let i=this.version;for(let l=0;l<12;l++)i=i<<1^(i>>>11)*7973;const h=this.version<<12|i;r(h>>>18==0);for(let l=0;l<18;l++){const c=n(h,l),p=this.size-11+l%3,j=Math.floor(l/3);this.setFunctionModule(p,j,c),this.setFunctionModule(j,p,c)}}drawFinderPattern(i,h){for(let l=-4;l<=4;l++)for(let c=-4;c<=4;c++){const p=Math.max(Math.abs(c),Math.abs(l)),j=i+c,f=h+l;0<=j&&j<this.size&&0<=f&&f<this.size&&this.setFunctionModule(j,f,p!=2&&p!=4)}}drawAlignmentPattern(i,h){for(let l=-2;l<=2;l++)for(let c=-2;c<=2;c++)this.setFunctionModule(i+c,h+l,Math.max(Math.abs(c),Math.abs(l))!=1)}setFunctionModule(i,h,l){this.modules[h][i]=l,this.isFunction[h][i]=!0}addEccAndInterleave(i){const h=this.version,l=this.errorCorrectionLevel;if(i.length!=B.getNumDataCodewords(h,l))throw new RangeError("Invalid argument");const c=B.NUM_ERROR_CORRECTION_BLOCKS[l.ordinal][h],p=B.ECC_CODEWORDS_PER_BLOCK[l.ordinal][h],j=Math.floor(B.getNumRawDataModules(h)/8),f=c-j%c,x=Math.floor(j/c);let y=[];const C=B.reedSolomonComputeDivisor(p);for(let N=0,b=0;N<c;N++){let M=i.slice(b,b+x-p+(N<f?0:1));b+=M.length;const E=B.reedSolomonComputeRemainder(M,C);N<f&&M.push(0),y.push(M.concat(E))}let k=[];for(let N=0;N<y[0].length;N++)y.forEach((b,M)=>{(N!=x-p||M>=f)&&k.push(b[N])});return r(k.length==j),k}drawCodewords(i){if(i.length!=Math.floor(B.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let h=0;for(let l=this.size-1;l>=1;l-=2){l==6&&(l=5);for(let c=0;c<this.size;c++)for(let p=0;p<2;p++){const j=l-p,x=(l+1&2)==0?this.size-1-c:c;!this.isFunction[x][j]&&h<i.length*8&&(this.modules[x][j]=n(i[h>>>3],7-(h&7)),h++)}}r(h==i.length*8)}applyMask(i){if(i<0||i>7)throw new RangeError("Mask value out of range");for(let h=0;h<this.size;h++)for(let l=0;l<this.size;l++){let c;switch(i){case 0:c=(l+h)%2==0;break;case 1:c=h%2==0;break;case 2:c=l%3==0;break;case 3:c=(l+h)%3==0;break;case 4:c=(Math.floor(l/3)+Math.floor(h/2))%2==0;break;case 5:c=l*h%2+l*h%3==0;break;case 6:c=(l*h%2+l*h%3)%2==0;break;case 7:c=((l+h)%2+l*h%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[h][l]&&c&&(this.modules[h][l]=!this.modules[h][l])}}getPenaltyScore(){let i=0;for(let p=0;p<this.size;p++){let j=!1,f=0,x=[0,0,0,0,0,0,0];for(let y=0;y<this.size;y++)this.modules[p][y]==j?(f++,f==5?i+=B.PENALTY_N1:f>5&&i++):(this.finderPenaltyAddHistory(f,x),j||(i+=this.finderPenaltyCountPatterns(x)*B.PENALTY_N3),j=this.modules[p][y],f=1);i+=this.finderPenaltyTerminateAndCount(j,f,x)*B.PENALTY_N3}for(let p=0;p<this.size;p++){let j=!1,f=0,x=[0,0,0,0,0,0,0];for(let y=0;y<this.size;y++)this.modules[y][p]==j?(f++,f==5?i+=B.PENALTY_N1:f>5&&i++):(this.finderPenaltyAddHistory(f,x),j||(i+=this.finderPenaltyCountPatterns(x)*B.PENALTY_N3),j=this.modules[y][p],f=1);i+=this.finderPenaltyTerminateAndCount(j,f,x)*B.PENALTY_N3}for(let p=0;p<this.size-1;p++)for(let j=0;j<this.size-1;j++){const f=this.modules[p][j];f==this.modules[p][j+1]&&f==this.modules[p+1][j]&&f==this.modules[p+1][j+1]&&(i+=B.PENALTY_N2)}let h=0;for(const p of this.modules)h=p.reduce((j,f)=>j+(f?1:0),h);const l=this.size*this.size,c=Math.ceil(Math.abs(h*20-l*10)/l)-1;return r(0<=c&&c<=9),i+=c*B.PENALTY_N4,r(0<=i&&i<=2568888),i}getAlignmentPatternPositions(){if(this.version==1)return[];{const i=Math.floor(this.version/7)+2,h=this.version==32?26:Math.ceil((this.version*4+4)/(i*2-2))*2;let l=[6];for(let c=this.size-7;l.length<i;c-=h)l.splice(1,0,c);return l}}static getNumRawDataModules(i){if(i<B.MIN_VERSION||i>B.MAX_VERSION)throw new RangeError("Version number out of range");let h=(16*i+128)*i+64;if(i>=2){const l=Math.floor(i/7)+2;h-=(25*l-10)*l-55,i>=7&&(h-=36)}return r(208<=h&&h<=29648),h}static getNumDataCodewords(i,h){return Math.floor(B.getNumRawDataModules(i)/8)-B.ECC_CODEWORDS_PER_BLOCK[h.ordinal][i]*B.NUM_ERROR_CORRECTION_BLOCKS[h.ordinal][i]}static reedSolomonComputeDivisor(i){if(i<1||i>255)throw new RangeError("Degree out of range");let h=[];for(let c=0;c<i-1;c++)h.push(0);h.push(1);let l=1;for(let c=0;c<i;c++){for(let p=0;p<h.length;p++)h[p]=B.reedSolomonMultiply(h[p],l),p+1<h.length&&(h[p]^=h[p+1]);l=B.reedSolomonMultiply(l,2)}return h}static reedSolomonComputeRemainder(i,h){let l=h.map(c=>0);for(const c of i){const p=c^l.shift();l.push(0),h.forEach((j,f)=>l[f]^=B.reedSolomonMultiply(j,p))}return l}static reedSolomonMultiply(i,h){if(i>>>8||h>>>8)throw new RangeError("Byte out of range");let l=0;for(let c=7;c>=0;c--)l=l<<1^(l>>>7)*285,l^=(h>>>c&1)*i;return r(l>>>8==0),l}finderPenaltyCountPatterns(i){const h=i[1];r(h<=this.size*3);const l=h>0&&i[2]==h&&i[3]==h*3&&i[4]==h&&i[5]==h;return(l&&i[0]>=h*4&&i[6]>=h?1:0)+(l&&i[6]>=h*4&&i[0]>=h?1:0)}finderPenaltyTerminateAndCount(i,h,l){return i&&(this.finderPenaltyAddHistory(h,l),h=0),h+=this.size,this.finderPenaltyAddHistory(h,l),this.finderPenaltyCountPatterns(l)}finderPenaltyAddHistory(i,h){h[0]==0&&(i+=this.size),h.pop(),h.unshift(i)}};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]],a.QrCode=s;function t(g,i,h){if(i<0||i>31||g>>>i)throw new RangeError("Value out of range");for(let l=i-1;l>=0;l--)h.push(g>>>l&1)}function n(g,i){return(g>>>i&1)!=0}function r(g){if(!g)throw new Error("Assertion error")}const o=class X{constructor(i,h,l){if(this.mode=i,this.numChars=h,this.bitData=l,h<0)throw new RangeError("Invalid argument");this.bitData=l.slice()}static makeBytes(i){let h=[];for(const l of i)t(l,8,h);return new X(X.Mode.BYTE,i.length,h)}static makeNumeric(i){if(!X.isNumeric(i))throw new RangeError("String contains non-numeric characters");let h=[];for(let l=0;l<i.length;){const c=Math.min(i.length-l,3);t(parseInt(i.substring(l,l+c),10),c*3+1,h),l+=c}return new X(X.Mode.NUMERIC,i.length,h)}static makeAlphanumeric(i){if(!X.isAlphanumeric(i))throw new RangeError("String contains unencodable characters in alphanumeric mode");let h=[],l;for(l=0;l+2<=i.length;l+=2){let c=X.ALPHANUMERIC_CHARSET.indexOf(i.charAt(l))*45;c+=X.ALPHANUMERIC_CHARSET.indexOf(i.charAt(l+1)),t(c,11,h)}return l<i.length&&t(X.ALPHANUMERIC_CHARSET.indexOf(i.charAt(l)),6,h),new X(X.Mode.ALPHANUMERIC,i.length,h)}static makeSegments(i){return i==""?[]:X.isNumeric(i)?[X.makeNumeric(i)]:X.isAlphanumeric(i)?[X.makeAlphanumeric(i)]:[X.makeBytes(X.toUtf8ByteArray(i))]}static makeEci(i){let h=[];if(i<0)throw new RangeError("ECI assignment value out of range");if(i<128)t(i,8,h);else if(i<16384)t(2,2,h),t(i,14,h);else if(i<1e6)t(6,3,h),t(i,21,h);else throw new RangeError("ECI assignment value out of range");return new X(X.Mode.ECI,0,h)}static isNumeric(i){return X.NUMERIC_REGEX.test(i)}static isAlphanumeric(i){return X.ALPHANUMERIC_REGEX.test(i)}getData(){return this.bitData.slice()}static getTotalBits(i,h){let l=0;for(const c of i){const p=c.mode.numCharCountBits(h);if(c.numChars>=1<<p)return 1/0;l+=4+p+c.bitData.length}return l}static toUtf8ByteArray(i){i=encodeURI(i);let h=[];for(let l=0;l<i.length;l++)i.charAt(l)!="%"?h.push(i.charCodeAt(l)):(h.push(parseInt(i.substring(l+1,l+3),16)),l+=2);return h}};o.NUMERIC_REGEX=/^[0-9]*$/,o.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,o.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let u=o;a.QrSegment=o})(Oe||(Oe={}));(a=>{(s=>{const t=class{constructor(r,o){this.ordinal=r,this.formatBits=o}};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})(a.QrCode||(a.QrCode={}))})(Oe||(Oe={}));(a=>{(s=>{const t=class{constructor(r,o){this.modeBits=r,this.numBitsCharCount=o}numCharCountBits(r){return this.numBitsCharCount[Math.floor((r+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})(a.QrSegment||(a.QrSegment={}))})(Oe||(Oe={}));var Ue=Oe;/**
8
+ * @license qrcode.react
9
+ * Copyright (c) Paul O'Shannessy
10
+ * SPDX-License-Identifier: ISC
11
+ */var On={L:Ue.QrCode.Ecc.LOW,M:Ue.QrCode.Ecc.MEDIUM,Q:Ue.QrCode.Ecc.QUARTILE,H:Ue.QrCode.Ecc.HIGH},Cs=128,bs="L",Ns="#FFFFFF",Ss="#000000",_s=!1,ks=1,$n=4,Fn=0,Hn=.1;function ws(a,s=0){const t=[];return a.forEach(function(n,r){let o=null;n.forEach(function(u,g){if(!u&&o!==null){t.push(`M${o+s} ${r+s}h${g-o}v1H${o+s}z`),o=null;return}if(g===n.length-1){if(!u)return;o===null?t.push(`M${g+s},${r+s} h1v1H${g+s}z`):t.push(`M${o+s},${r+s} h${g+1-o}v1H${o+s}z`);return}u&&o===null&&(o=g)})}),t.join("")}function Ts(a,s){return a.slice().map((t,n)=>n<s.y||n>=s.y+s.h?t:t.map((r,o)=>o<s.x||o>=s.x+s.w?r:!1))}function zn(a,s,t,n){if(n==null)return null;const r=a.length+t*2,o=Math.floor(s*Hn),u=r/s,g=(n.width||o)*u,i=(n.height||o)*u,h=n.x==null?a.length/2-g/2:n.x*u,l=n.y==null?a.length/2-i/2:n.y*u,c=n.opacity==null?1:n.opacity;let p=null;if(n.excavate){let f=Math.floor(h),x=Math.floor(l),y=Math.ceil(g+h-f),C=Math.ceil(i+l-x);p={x:f,y:x,w:y,h:C}}const j=n.crossOrigin;return{x:h,y:l,h:i,w:g,excavation:p,opacity:c,crossOrigin:j}}function Vn(a,s){return s!=null?Math.max(Math.floor(s),0):a?$n:Fn}function Ms({value:a,level:s,minVersion:t,includeMargin:n,marginSize:r,imageSettings:o,size:u,boostLevel:g}){let i=U.useMemo(()=>{const f=(Array.isArray(a)?a:[a]).reduce((x,y)=>(x.push(...Ue.QrSegment.makeSegments(y)),x),[]);return Ue.QrCode.encodeSegments(f,On[s],t,void 0,void 0,g)},[a,s,t,g]);const{cells:h,margin:l,numCells:c,calculatedImageSettings:p}=U.useMemo(()=>{let j=i.getModules();const f=Vn(n,r),x=j.length+f*2,y=zn(j,u,f,o);return{cells:j,margin:f,numCells:x,calculatedImageSettings:y}},[i,u,o,n,r]);return{qrcode:i,margin:l,cells:h,numCells:c,calculatedImageSettings:p}}var qn=(function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0})(),Es=U.forwardRef(function(s,t){const n=s,{value:r,size:o=Cs,level:u=bs,bgColor:g=Ns,fgColor:i=Ss,includeMargin:h=_s,minVersion:l=ks,boostLevel:c,marginSize:p,imageSettings:j}=n,x=Ct(n,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:y}=x,C=Ct(x,["style"]),k=j==null?void 0:j.src,N=U.useRef(null),b=U.useRef(null),M=U.useCallback(P=>{N.current=P,typeof t=="function"?t(P):t&&(t.current=P)},[t]),[E,L]=U.useState(!1),{margin:R,cells:T,numCells:A,calculatedImageSettings:D}=Ms({value:r,level:u,minVersion:l,boostLevel:c,includeMargin:h,marginSize:p,imageSettings:j,size:o});U.useEffect(()=>{if(N.current!=null){const P=N.current,Q=P.getContext("2d");if(!Q)return;let ie=T;const Y=b.current,ce=D!=null&&Y!==null&&Y.complete&&Y.naturalHeight!==0&&Y.naturalWidth!==0;ce&&D.excavation!=null&&(ie=Ts(T,D.excavation));const de=window.devicePixelRatio||1;P.height=P.width=o*de;const le=o/A*de;Q.scale(le,le),Q.fillStyle=g,Q.fillRect(0,0,A,A),Q.fillStyle=i,qn?Q.fill(new Path2D(ws(ie,R))):T.forEach(function(W,me){W.forEach(function(ae,xe){ae&&Q.fillRect(xe+R,me+R,1,1)})}),D&&(Q.globalAlpha=D.opacity),ce&&Q.drawImage(Y,D.x+R,D.y+R,D.w,D.h)}}),U.useEffect(()=>{L(!1)},[k]);const se=jt({height:o,width:o},y);let F=null;return k!=null&&(F=U.createElement("img",{src:k,key:k,style:{display:"none"},onLoad:()=>{L(!0)},ref:b,crossOrigin:D==null?void 0:D.crossOrigin})),U.createElement(U.Fragment,null,U.createElement("canvas",jt({style:se,height:o,width:o,ref:M,role:"img"},C)),F)});Es.displayName="QRCodeCanvas";var Un=U.forwardRef(function(s,t){const n=s,{value:r,size:o=Cs,level:u=bs,bgColor:g=Ns,fgColor:i=Ss,includeMargin:h=_s,minVersion:l=ks,boostLevel:c,title:p,marginSize:j,imageSettings:f}=n,x=Ct(n,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:y,cells:C,numCells:k,calculatedImageSettings:N}=Ms({value:r,level:u,minVersion:l,boostLevel:c,includeMargin:h,marginSize:j,imageSettings:f,size:o});let b=C,M=null;f!=null&&N!=null&&(N.excavation!=null&&(b=Ts(C,N.excavation)),M=U.createElement("image",{href:f.src,height:N.h,width:N.w,x:N.x+y,y:N.y+y,preserveAspectRatio:"none",opacity:N.opacity,crossOrigin:N.crossOrigin}));const E=ws(b,y);return U.createElement("svg",jt({height:o,width:o,viewBox:`0 0 ${k} ${k}`,ref:t,role:"img"},x),!!p&&U.createElement("title",null,p),U.createElement("path",{fill:g,d:`M0,0 h${k}v${k}H0z`,shapeRendering:"crispEdges"}),U.createElement("path",{fill:i,d:E,shapeRendering:"crispEdges"}),M)});Un.displayName="QRCodeSVG";const Wn=[{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}],Kn={calibrationModels:Wn},gt=Kn.calibrationModels,Gn=[{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:"Українська"}],Jn=a=>{const s=t=>t.toUpperCase().split("").map(n=>String.fromCodePoint(127462+n.charCodeAt(0)-65)).join("");return!a||a.length!==2?s("CN"):s(a)},Pe=class Pe extends U.Component{constructor(t){super(t);O(this,"handleShowPrompts",()=>{this.setState({promptModalVisible:!0,promptData:this.extractUserPrompts()})});O(this,"handleExportPromptsTxt",()=>{const t=this.state.promptData;if(!t||t.length===0)return;const n=[];for(const g of t){const i=[],h=g.timestamp?new Date(g.timestamp).toLocaleString():"";h&&i.push(`${h}:
12
+ `);const l=(g.segments||[]).filter(c=>c.type==="text").map(c=>c.content);l.length>0&&i.push(l.join(`
13
+ `)),n.push(i.join(`
14
+ `))}if(n.length===0)return;const r=new Blob([n.join(`
15
+
16
+
17
+
18
+ `)],{type:"text/plain;charset=utf-8"}),o=URL.createObjectURL(r),u=document.createElement("a");u.href=o,u.download=`user-prompts-${new Date().toISOString().slice(0,10)}.txt`,u.click(),URL.revokeObjectURL(o)});O(this,"handleCalibrationModelChange",t=>{this.setState({calibrationModel:t}),localStorage.setItem("ccv_calibrationModel",t)});O(this,"handleShowProjectStats",()=>{this.setState({projectStatsVisible:!0,projectStatsLoading:!0}),fetch(ue("/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}))});O(this,"fetchPlugins",()=>fetch(ue("/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(()=>{}));O(this,"handleShowPlugins",()=>{this.setState({pluginModalVisible:!0}),this.fetchPlugins()});O(this,"handleTogglePlugin",(t,n)=>{fetch(ue("/api/preferences")).then(r=>r.json()).then(r=>{let o=Array.isArray(r.disabledPlugins)?[...r.disabledPlugins]:[];return n?o=o.filter(u=>u!==t):o.includes(t)||o.push(t),fetch(ue("/api/preferences"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({disabledPlugins:o})})}).then(()=>fetch(ue("/api/plugins/reload"),{method:"POST"})).then(r=>{if(!r.ok)throw new Error(r.status);return r.json()}).then(r=>{this.setState({pluginsList:r.plugins||[],pluginsDir:r.pluginsDir||""})}).catch(()=>{})});O(this,"handleDeletePlugin",(t,n)=>{this.setState({deleteConfirmVisible:!0,deleteTarget:{file:t,name:n}})});O(this,"handleDeletePluginConfirm",()=>{const{file:t}=this.state.deleteTarget||{};t&&(this.setState({deleteConfirmVisible:!1,deleteTarget:null}),fetch(ue(`/api/plugins?file=${encodeURIComponent(t)}`),{method:"DELETE"}).then(n=>{if(!n.ok)throw new Error(n.status);return n.json()}).then(n=>{n.plugins&&this.setState({pluginsList:n.plugins,pluginsDir:n.pluginsDir||""})}).catch(()=>{}))});O(this,"handleReloadPlugins",()=>{fetch(ue("/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(()=>{})});O(this,"handleAddPlugin",()=>{const t=document.createElement("input");t.type="file",t.accept=".js,.mjs",t.multiple=!0,t.onchange=()=>{const n=t.files;if(!n||n.length===0)return;for(const o of n)if(!o.name.endsWith(".js")&&!o.name.endsWith(".mjs")){J.error(m("ui.plugins.invalidFile"));return}const r=Array.from(n).map(o=>new Promise((u,g)=>{const i=new FileReader;i.onload=()=>u({name:o.name,content:i.result}),i.onerror=()=>g(new Error(`Failed to read ${o.name}`)),i.readAsText(o)}));Promise.all(r).then(o=>fetch(ue("/api/plugins/upload"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:o})})).then(o=>o.ok?o.json():o.text().then(u=>{try{return JSON.parse(u)}catch{throw new Error(m("ui.plugins.serverError",{status:o.status}))}})).then(o=>{o.error?J.error(m("ui.plugins.addFailed",{reason:o.error})):o.plugins&&(this.setState({pluginsList:o.plugins,pluginsDir:o.pluginsDir||""}),J.success(m("ui.plugins.addSuccess")))}).catch(o=>{J.error(o.message)})},t.click()});O(this,"handleShowCdnModal",()=>{this.setState({cdnModalVisible:!0,cdnUrl:"",cdnLoading:!1})});O(this,"handleCdnUrlChange",t=>{this.setState({cdnUrl:t.target.value})});O(this,"handleCdnInstall",()=>{const{cdnUrl:t}=this.state;if(!t.trim()){J.error(m("ui.plugins.cdnUrlRequired"));return}try{new URL(t)}catch{J.error(m("ui.plugins.cdnInvalidUrl"));return}this.setState({cdnLoading:!0}),fetch(ue("/api/plugins/install-from-url"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:t.trim()})}).then(n=>n.json()).then(n=>{n.error?J.error(m("ui.plugins.cdnInstallFailed",{reason:n.error})):(J.success(m("ui.plugins.cdnInstallSuccess")),n.plugins&&this.setState({pluginsList:n.plugins,pluginsDir:n.pluginsDir||""}),this.setState({cdnModalVisible:!1,cdnUrl:""}))}).catch(n=>{J.error(m("ui.plugins.cdnInstallFailed",{reason:n.message||"Network error"}))}).finally(()=>{this.setState({cdnLoading:!1})})});O(this,"handleCdnCancel",()=>{this.setState({cdnModalVisible:!1,cdnUrl:"",cdnLoading:!1})});O(this,"fetchProcesses",()=>{this.setState({processLoading:!0}),fetch(ue("/api/ccv-processes")).then(t=>t.json()).then(t=>{this.setState({processList:t.processes||[],processLoading:!1})}).catch(()=>{this.setState({processList:[],processLoading:!1})})});O(this,"handleShowProcesses",()=>{this.setState({processModalVisible:!0}),this.fetchProcesses()});O(this,"handleKillProcess",t=>{_e.confirm({title:m("ui.processManagement.killConfirm"),onOk:()=>{fetch(ue("/api/ccv-processes/kill"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({pid:t})}).then(n=>n.json()).then(n=>{n.ok?(J.success(m("ui.processManagement.killed")),this.fetchProcesses()):J.error(n.error||m("ui.processManagement.killFailed"))}).catch(()=>{J.error(m("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:(n=>gt.some(r=>r.value===n)?n:"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(ue("/api/local-url")).then(t=>t.json()).then(t=>{t.url&&this.setState({localUrl:t.url})}).catch(()=>{}),fetch(ue("/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:Jn(t.country),countryInfo:t})}).catch(()=>{})}componentDidUpdate(t){t.cacheExpireAt!==this.props.cacheExpireAt&&this.startCountdown()}shouldComponentUpdate(t,n){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||n!==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 n=Math.max(0,t-Date.now());if(n<=0){const u=m("ui.cacheExpired");this.state.countdownText!==u&&this.setState({countdownText:u}),this._expiredTimer=setTimeout(()=>{this.state.countdownText!==""&&this.setState({countdownText:""})},5e3);return}const r=Math.ceil(n/1e3);let o;if(r>=60){const u=Math.floor(r/60),g=r%60;o=m("ui.minuteSecond",{m:u,s:String(g).padStart(2,"0")})}else o=m("ui.second",{s:r});o!==this.state.countdownText&&this.setState({countdownText:o}),this._rafId=requestAnimationFrame(this.updateCountdown)}static parseSegments(t){const n=[],r=/<([a-zA-Z_][\w-]*)(?:\s[^>]*)?>[\s\S]*?<\/\1>/g;let o=0,u;for(;(u=r.exec(t))!==null;){const i=t.slice(o,u.index).trim();i&&n.push({type:"text",content:i});const h=u[1];if(o=u.index+u[0].length,Pe.COMMAND_TAGS.has(h))continue;const l=new RegExp(`^<${h}(?:\\s[^>]*)?>([\\s\\S]*)<\\/${h}>$`),c=u[0].match(l),p=c?c[1].trim():u[0].trim();n.push({type:"system",content:p,label:h})}const g=t.slice(o).trim();return g&&n.push({type:"text",content:g}),n}static extractUserTexts(t){const n=[],r=[];let o=null;for(const u of t)if(u.role==="user"){if(typeof u.content=="string"){const g=u.content.trim();if(!g)continue;if(!Ke(g)){if(/Implement the following plan:/i.test(g))continue;n.push(g),r.push(g)}}else if(Array.isArray(u.content)){const{commands:g,textBlocks:i}=pa(u.content);g.length>0&&(o=g[g.length-1]);const h=[];for(const c of i)/Implement the following plan:/i.test((c.text||"").trim())||h.push(c.text.trim());const l=u.content.filter(c=>{var p;return c.type==="text"&&((p=c.text)==null?void 0:p.trim())}).map(c=>c.text.trim());h.length>0&&(n.push(h.join(`
19
+ `)),r.push(l.join(`
20
+ `)))}}return{userMsgs:n,fullTexts:r,slashCmd:o}}extractUserPrompts(){var g;const{requests:t=[]}=this.props,n=[],r=new Set;let o=null;const u=t.filter(i=>Te(i));for(let i=0;i<u.length;i++){const h=u[i],l=((g=h.body)==null?void 0:g.messages)||[],c=h.timestamp||"",{userMsgs:p,fullTexts:j,slashCmd:f}=Pe.extractUserTexts(l);f&&f!=="/compact"&&f!==o&&n.push({type:"prompt",segments:[{type:"text",content:f}],timestamp:c}),o=f;for(let x=0;x<p.length;x++){const y=p[x];if(r.has(y))continue;r.add(y);const C=j[x]||y;n.push({type:"prompt",segments:Pe.parseSegments(C),timestamp:c})}}return n}renderTokenStats(){const{requests:t=[]}=this.props,n=ga(t),r=Object.keys(n),o=fa(t),u=xa(t);if(r.length===0&&o.length===0)return e.jsx("div",{className:d.tokenStatsEmpty,children:"暂无 token 数据"});const g=e.jsx("div",{className:d.tokenStatsColumn,children:r.map(c=>{const p=n[c],j=p.input+p.cacheCreation+p.cacheRead,f=j>0?(p.cacheRead/j*100).toFixed(1):"0.0";return e.jsxs("div",{className:r.length>1?d.modelCardSpaced:d.modelCard,children:[e.jsx("div",{className:d.modelName,children:c}),e.jsx("table",{className:d.statsTable,children:e.jsxs("tbody",{children:[e.jsxs("tr",{children:[e.jsx("td",{className:d.label,children:"Token"}),e.jsx("td",{className:d.th,children:"input"}),e.jsx("td",{className:d.th,children:"output"})]}),e.jsxs("tr",{className:d.rowBorder,children:[e.jsx("td",{className:d.label}),e.jsx("td",{className:d.td,children:G(j)}),e.jsx("td",{className:d.td,children:G(p.output)})]}),e.jsxs("tr",{children:[e.jsx("td",{className:d.label,children:"Cache"}),e.jsx("td",{className:d.th,children:"create"}),e.jsx("td",{className:d.th,children:"read"})]}),e.jsxs("tr",{className:d.rowBorder,children:[e.jsx("td",{className:d.label}),e.jsx("td",{className:d.td,children:G(p.cacheCreation)}),e.jsx("td",{className:d.td,children:G(p.cacheRead)})]}),e.jsxs("tr",{children:[e.jsx("td",{className:d.label,children:m("ui.hitRate")}),e.jsxs("td",{colSpan:2,className:d.td,children:[f,"%"]})]})]})})]},c)})}),i=this.renderCacheRebuildStats(),h=o.length>0?e.jsx("div",{className:d.toolStatsColumn,children:e.jsxs("div",{className:d.modelCard,children:[e.jsx("div",{className:d.modelName,children:m("ui.toolUsageStats")}),e.jsxs("table",{className:d.statsTable,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{className:`${d.th} ${d.thLeft}`,children:"Tool"}),e.jsx("td",{className:d.th,children:m("ui.cacheRebuild.count")})]})}),e.jsxs("tbody",{children:[o.map(([c,p])=>e.jsxs("tr",{className:d.rowBorder,children:[e.jsxs("td",{className:d.label,children:[c," ",e.jsx(re,{doc:`Tool-${c}`})]}),e.jsx("td",{className:d.td,children:p})]},c)),o.length>1&&e.jsxs("tr",{className:d.rebuildTotalRow,children:[e.jsx("td",{className:d.label,children:"Total"}),e.jsx("td",{className:d.td,children:o.reduce((c,p)=>c+p[1],0)})]})]})]})]})}):null,l=u.length>0?e.jsx("div",{className:d.toolStatsColumn,children:e.jsxs("div",{className:d.modelCard,children:[e.jsx("div",{className:d.modelName,children:m("ui.skillUsageStats")}),e.jsxs("table",{className:d.statsTable,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{className:`${d.th} ${d.thLeft}`,children:"Skill"}),e.jsx("td",{className:d.th,children:m("ui.cacheRebuild.count")})]})}),e.jsxs("tbody",{children:[u.map(([c,p])=>e.jsxs("tr",{className:d.rowBorder,children:[e.jsx("td",{className:d.label,children:c}),e.jsx("td",{className:d.td,children:p})]},c)),u.length>1&&e.jsxs("tr",{className:d.rebuildTotalRow,children:[e.jsx("td",{className:d.label,children:"Total"}),e.jsx("td",{className:d.td,children:u.reduce((c,p)=>c+p[1],0)})]})]})]})]})}):null;return e.jsxs("div",{className:d.tokenStatsContainer,children:[g,i,h,l]})}_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(i=>({_cacheSectionCollapsed:{...i._cacheSectionCollapsed||{},messages:!1}}),()=>this.scrollToCacheMsg(t));return}const n=this._cacheScrollEl;if(!n)return;const r=n.querySelector(`[data-msg-idx="${t}"]`);if(!r)return;clearTimeout(this._cacheScrollSettleTimer),clearTimeout(this._cacheFadeClearTimer),clearTimeout(this._cacheAutoFadeTimer),clearTimeout(this._cacheHighlightDelayTimer),this._cacheUnbindScrollFade(),this._cacheScrollEndHandler&&n.removeEventListener("scrollend",this._cacheScrollEndHandler),this.setState({cacheHighlightIdx:null,cacheHighlightFading:!1});let o=!1,u=!1;const g=()=>{!o||!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=()=>{n.removeEventListener("scrollend",this._cacheScrollEndHandler),o=!0,g()},n.addEventListener("scrollend",this._cacheScrollEndHandler,{once:!0}),this._cacheScrollSettleTimer=setTimeout(()=>{n.removeEventListener("scrollend",this._cacheScrollEndHandler),o=!0,g()},800),this._cacheHighlightDelayTimer=setTimeout(()=>{u=!0,g()},500),r.scrollIntoView({behavior:"smooth",block:"center"})}renderCacheContentPopover(t){const{requests:n=[],serverCachedContent:r}=this.props,o=r||as(n);if(o&&(o.cacheCreateTokens>0||o.cacheReadTokens>0)&&(this._lastCachedTokens={cacheCreateTokens:o.cacheCreateTokens,cacheReadTokens:o.cacheReadTokens}),t>0&&(this._lastContextPercent=t),!o||o.system.length===0&&o.messages.length===0&&o.tools.length===0)return e.jsx("div",{className:d.cachePopoverEmpty,children:m("ui.noCachedContent")});const u=(l,c,p,j)=>{if(c.length===0)return null;const f=l===m("ui.messages"),x=(this.state._cacheSectionCollapsed||{})[j],y=x!==void 0?!!x:j==="tools",C=()=>this.setState(k=>({_cacheSectionCollapsed:{...k._cacheSectionCollapsed||{},[j]:!y}}));return e.jsxs("div",{className:d.cacheSection,children:[e.jsxs("button",{type:"button",className:d.cacheSectionTitle,onClick:C,"aria-expanded":!y,children:[e.jsx("span",{className:d.cacheSectionArrow,children:y?"▶":"▼"}),l," (",c.length,")"]}),!y&&c.map((k,N)=>{const b=f?{"data-msg-idx":N}:{};let M=p||d.cacheCodeBlock;const E=f&&N===this.state.cacheHighlightIdx;return E&&(M+=" "+(this.state.cacheHighlightFading?d.cacheBlockHighlightFading:d.cacheBlockHighlight)),e.jsxs("pre",{className:M,...b,style:E?{position:"relative"}:void 0,children:[E&&e.jsx("svg",{className:`${d.cacheBorderSvg}${this.state.cacheHighlightFading?" "+d.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:d.cacheBorderRect})}),k]},N)})]})},g=()=>{const l=[];return o.tools.length>0&&(l.push(`=== ${m("ui.tools")} (${o.tools.length}) ===`),o.tools.forEach(c=>l.push(c))),o.system.length>0&&(l.push(`
21
+ === ${m("ui.systemPrompt")} (${o.system.length}) ===`),o.system.forEach(c=>l.push(c))),o.messages.length>0&&(l.push(`
22
+ === ${m("ui.messages")} (${o.messages.length}) ===`),o.messages.forEach(c=>l.push(c))),l.join(`
23
+
24
+ `)},i=o.messages.map((l,c)=>({text:l,msgIdx:c})).filter(({text:l})=>l.startsWith("[user]")).map(({text:l,msgIdx:c})=>{const p=l.replace(/^\[user\]\s*/,"").trim();return!p||Ke(p)?{cleaned:"",msgIdx:c}:{cleaned:Pe.parseSegments(p).filter(x=>x.type==="text").map(x=>x.content.trim()).filter(x=>x&&!Ke(x)).join(" ").trim(),msgIdx:c}}).filter(({cleaned:l})=>!(!l||/Implement the following plan:/i.test(l))),h=i.length>0?e.jsx("div",{className:d.cacheNavList,children:i.map(({cleaned:l,msgIdx:c})=>e.jsx("div",{className:d.cacheNavItem,onClick:()=>this.scrollToCacheMsg(c),children:l},c))}):null;return e.jsxs("div",{className:d.cachePopover,children:[e.jsx("div",{className:d.cachePopoverHeader,children:e.jsxs("div",{className:d.cachePopoverTitle,children:[m("ui.cachedContentTitle"),e.jsx(re,{doc:"KVCacheContent"}),e.jsx(Ve,{className:d.cacheCopyBtn,onClick:()=>{navigator.clipboard.writeText(g()).then(()=>{J.success(m("ui.copied"))}).catch(()=>{})}}),e.jsx("span",{className:d.cacheCalibrationLabel,children:m("ui.calibrationModelLabel")}),e.jsx(Le,{size:"small",value:this.state.calibrationModel,onChange:this.handleCalibrationModelChange,options:gt,className:d.calibrationSelect,popupMatchSelectWidth:!1})]})}),(()=>{const c=o.cacheCreateTokens>0||o.cacheReadTokens>0?o:this._lastCachedTokens,p=t>0?t:this._lastContextPercent||0;return c||h?e.jsxs("div",{className:d.cacheTokenInfo,children:[c&&e.jsxs(e.Fragment,{children:[m("ui.tokens"),": ",e.jsxs("span",{className:d.cacheWriteToken,children:["write ",G(c.cacheCreateTokens)]})," / ",e.jsxs("span",{className:d.cacheReadToken,children:["read ",G(c.cacheReadTokens)]}),p>0&&e.jsxs("span",{className:d.cacheCtxPercent,children:["(ctx:",p,"%)"]})]}),h&&e.jsx(ze,{content:h,trigger:"hover",placement:"left",children:e.jsx("span",{className:d.cacheNavBtn,children:m("ui.userPromptNav")})})]}):null})(),e.jsxs("div",{className:d.cacheScrollArea,ref:l=>{this._cacheScrollEl=l,l&&!this._cacheScrollInited&&(this._cacheScrollInited=!0,requestAnimationFrame(()=>{l.scrollTop=l.scrollHeight}))},children:[u(m("ui.tools"),o.tools,void 0,"tools"),u(m("ui.systemPrompt"),o.system,d.cacheCodeBlockSystem,"system"),u(m("ui.messages"),o.messages,void 0,"messages")]})]})}renderCacheRebuildStats(){const{requests:t=[]}=this.props,n=va(t),r=["ttl","system_change","tools_change","model_change","msg_truncated","msg_modified","key_change"],o={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=r.filter(y=>n[y].count>0),g=u.reduce((y,C)=>y+n[C].count,0),i=u.reduce((y,C)=>y+n[C].cacheCreate,0);ya(t);const h={},l={};for(let y=0;y<t.length;y++){const C=Ge(t[y],t[y+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";l[k]=(l[k]||0)+1}}const c=Object.entries(h).sort((y,C)=>C[1]-y[1]),p=Object.entries(l).sort((y,C)=>C[1]-y[1]),j=u.length>0,f=c.length>0,x=p.length>0;return!j&&!f&&!x?null:e.jsxs("div",{className:d.toolStatsColumn,children:[j&&e.jsxs("div",{className:f||x?d.modelCardSpaced:d.modelCard,children:[e.jsxs("div",{className:d.modelName,children:["MainAgent",e.jsx(re,{doc:"MainAgent"})," ",m("ui.cacheRebuildStats"),e.jsx(re,{doc:"CacheRebuild"})]}),e.jsxs("table",{className:d.statsTable,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{className:`${d.th} ${d.thLeft}`,children:m("ui.cacheRebuild.reason")}),e.jsx("td",{className:d.th,children:m("ui.cacheRebuild.count")}),e.jsx("td",{className:d.th,children:m("ui.cacheRebuild.cacheCreate")})]})}),e.jsxs("tbody",{children:[u.map(y=>e.jsxs("tr",{className:d.rowBorder,children:[e.jsx("td",{className:d.label,children:m(`ui.${o[y]}`)}),e.jsx("td",{className:d.td,children:n[y].count}),e.jsx("td",{className:d.td,children:G(n[y].cacheCreate)})]},y)),u.length>1&&e.jsxs("tr",{className:d.rebuildTotalRow,children:[e.jsx("td",{className:d.label,children:"Total"}),e.jsx("td",{className:d.td,children:g}),e.jsx("td",{className:d.td,children:G(i)})]})]})]})]}),f&&e.jsxs("div",{className:x?d.modelCardSpaced:d.modelCard,children:[e.jsx("div",{className:d.modelName,children:m("ui.subAgentStats")}),e.jsxs("table",{className:d.statsTable,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{className:`${d.th} ${d.thLeft}`,children:"SubAgent"}),e.jsx("td",{className:d.th,children:m("ui.cacheRebuild.count")})]})}),e.jsxs("tbody",{children:[c.map(([y,C])=>e.jsxs("tr",{className:d.rowBorder,children:[e.jsxs("td",{className:d.label,children:[y," ",e.jsx(re,{doc:`SubAgent-${y}`})]}),e.jsx("td",{className:d.td,children:C})]},y)),c.length>1&&e.jsxs("tr",{className:d.rebuildTotalRow,children:[e.jsx("td",{className:d.label,children:"Total"}),e.jsx("td",{className:d.td,children:c.reduce((y,C)=>y+C[1],0)})]})]})]})]}),x&&e.jsxs("div",{className:d.modelCard,children:[e.jsxs("div",{className:d.modelName,children:["Teammate",e.jsx(re,{doc:"Teammate"})]}),e.jsxs("table",{className:d.statsTable,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{className:`${d.th} ${d.thLeft}`,children:"Name"}),e.jsx("td",{className:d.th,children:m("ui.cacheRebuild.count")})]})}),e.jsxs("tbody",{children:[p.map(([y,C])=>e.jsxs("tr",{className:d.rowBorder,children:[e.jsx("td",{className:d.label,children:y}),e.jsx("td",{className:d.td,children:C})]},y)),p.length>1&&e.jsxs("tr",{className:d.rebuildTotalRow,children:[e.jsx("td",{className:d.label,children:"Total"}),e.jsx("td",{className:d.td,children:p.reduce((y,C)=>y+C[1],0)})]})]})]})]})]})}renderTextPrompt(t){return e.jsx("div",{className:d.textPromptCard,children:t.segments.map((n,r)=>n.type==="text"?e.jsx("pre",{className:d.preText,children:n.content},r):e.jsx(ja,{size:"small",className:d.systemCollapse,items:[{key:`sys-${r}`,label:e.jsx("span",{className:d.systemLabel,children:n.label}),children:e.jsx("pre",{className:d.preSys,children:n.content})}]},r))})}renderOriginalPrompt(t){const n=t.segments.filter(r=>r.type==="text");return n.length===0?null:e.jsx("div",{className:d.textPromptCard,children:n.map((r,o)=>e.jsx("pre",{className:d.preText,children:r.content},o))})}buildTextModeContent(){const{promptData:t}=this.state,n=[];for(const r of t){const o=(r.segments||[]).filter(u=>u.type==="text").map(u=>u.content);o.length>0&&n.push(o.join(`
25
+ `))}return n.join(`
26
+
27
+
28
+ `)}renderProjectStatsContent(){const{projectStats:t,projectStatsLoading:n}=this.state;if(n)return e.jsx("div",{className:d.projectStatsCenter,children:e.jsx(ns,{})});if(!t)return e.jsx("div",{className:d.projectStatsEmpty,children:m("ui.projectStats.noData")});const{summary:r,models:o,updatedAt:u}=t;o&&Object.entries(o).sort((h,l)=>l[1]-h[1]);const g={};if(t.files){for(const h of Object.values(t.files))if(h.models)for(const[l,c]of Object.entries(h.models))g[l]||(g[l]={input:0,output:0,cacheRead:0,cacheCreation:0,count:0}),g[l].input+=c.input_tokens||0,g[l].output+=c.output_tokens||0,g[l].cacheRead+=c.cache_read_input_tokens||0,g[l].cacheCreation+=c.cache_creation_input_tokens||0,g[l].count+=c.count||0}const i=Object.entries(g).sort((h,l)=>l[1].count-h[1].count);return e.jsxs("div",{className:d.projectStatsContent,children:[u&&e.jsx("div",{className:d.projectStatsUpdated,children:m("ui.projectStats.updatedAt",{time:new Date(u).toLocaleString()})}),e.jsxs("div",{className:d.projectStatsSummary,children:[e.jsxs("div",{className:d.projectStatCard,children:[e.jsx("div",{className:d.projectStatValue,children:(r==null?void 0:r.requestCount)??0}),e.jsx("div",{className:d.projectStatLabel,children:m("ui.projectStats.totalRequests")})]}),e.jsxs("div",{className:d.projectStatCard,children:[e.jsx("div",{className:d.projectStatValue,children:(r==null?void 0:r.turnCount)??(r==null?void 0:r.sessionCount)??0}),e.jsx("div",{className:d.projectStatLabel,children:m("ui.projectStats.turnCount")})]}),e.jsxs("div",{className:d.projectStatCard,children:[e.jsx("div",{className:d.projectStatValue,children:(r==null?void 0:r.fileCount)??0}),e.jsx("div",{className:d.projectStatLabel,children:m("ui.projectStats.totalFiles")})]}),e.jsxs("div",{className:d.projectStatCard,children:[e.jsx("div",{className:d.projectStatValue,children:G(r==null?void 0:r.input_tokens)}),e.jsx("div",{className:d.projectStatLabel,children:"Input Tokens"})]}),e.jsxs("div",{className:d.projectStatCard,children:[e.jsx("div",{className:d.projectStatValue,children:G(r==null?void 0:r.output_tokens)}),e.jsx("div",{className:d.projectStatLabel,children:"Output Tokens"})]})]}),i.length>0&&e.jsxs("div",{className:d.projectStatsSection,children:[e.jsx("div",{className:d.projectStatsSectionTitle,children:m("ui.projectStats.modelUsage")}),i.map(([h,l])=>{const c=l.input+l.cacheRead+l.cacheCreation,p=c>0?(l.cacheRead/c*100).toFixed(1):"0.0";return e.jsxs("div",{className:d.projectStatsModelCard,children:[e.jsxs("div",{className:d.projectStatsModelHeader,children:[e.jsx("span",{className:d.projectStatsModelName,children:h}),e.jsxs("span",{className:d.projectStatsModelCount,children:[l.count," reqs"]})]}),e.jsx("table",{className:d.statsTable,children:e.jsxs("tbody",{children:[e.jsxs("tr",{children:[e.jsx("td",{className:d.label,children:"Token"}),e.jsx("td",{className:d.th,children:"input"}),e.jsx("td",{className:d.th,children:"output"})]}),e.jsxs("tr",{className:d.rowBorder,children:[e.jsx("td",{className:d.label}),e.jsx("td",{className:d.td,children:G(c)}),e.jsx("td",{className:d.td,children:G(l.output)})]}),e.jsxs("tr",{children:[e.jsx("td",{className:d.label,children:"Cache"}),e.jsx("td",{className:d.th,children:"create"}),e.jsx("td",{className:d.th,children:"read"})]}),e.jsxs("tr",{className:d.rowBorder,children:[e.jsx("td",{className:d.label}),e.jsx("td",{className:d.td,children:G(l.cacheCreation)}),e.jsx("td",{className:d.td,children:G(l.cacheRead)})]}),e.jsxs("tr",{children:[e.jsx("td",{className:d.label,children:m("ui.hitRate")}),e.jsxs("td",{colSpan:2,className:d.td,children:[p,"%"]})]})]})})]},h)})]})]})}render(){var ee;const{requestCount:t,requests:n=[],viewMode:r,cacheType:o,onToggleViewMode:u,onImportLocalLogs:g,onLangChange:i,isLocalLog:h,localLogFile:l,projectName:c,collapseToolResults:p,onCollapseToolResultsChange:j,expandThinking:f,onExpandThinkingChange:x,showFullToolContent:y,onShowFullToolContentChange:C,expandDiff:k,onExpandDiffChange:N,filterIrrelevant:b,onFilterIrrelevantChange:M,logDir:E,onLogDirChange:L,updateInfo:R,onDismissUpdate:T,cliMode:A,terminalVisible:D,onToggleTerminal:se,onReturnToWorkspaces:F,contextWindow:P,serverCachedContent:Q,resumeAutoChoice:ie,onResumeAutoChoiceToggle:Y,onResumeAutoChoiceChange:ce,themeColor:de,onThemeColorChange:le,autoApproveSeconds:W,onAutoApproveChange:me}=this.props,{countdownText:ae}=this.state,xe=[{key:"import-local",icon:e.jsx(Gt,{}),label:m("ui.importLocalLogs"),onClick:g},{key:"export-prompts",icon:e.jsx(wn,{}),label:m("ui.exportPrompts"),onClick:this.handleShowPrompts},{key:"plugin-management",icon:e.jsx(Ut,{}),label:m("ui.pluginManagement"),onClick:this.handleShowPlugins},{key:"switch-workspace",icon:e.jsx(Gt,{className:d.iconMirror}),label:e.jsx("span",{className:d.disabledMenuItem,children:m("ui.switchWorkspace")}),disabled:!0},{key:"process-management",icon:e.jsx(pt,{}),label:m("ui.processManagement"),onClick:this.handleShowProcesses},{key:"proxy-switch",icon:e.jsx(qt,{}),label:m("ui.proxySwitch"),onClick:()=>this.setState({proxyModalVisible:!0})},{type:"divider"},{key:"project-stats",icon:e.jsx(Wt,{}),label:m("ui.projectStats"),onClick:this.handleShowProjectStats},...r==="raw"?[{key:"global-settings",icon:e.jsx(Jt,{}),label:m("ui.globalSettings"),onClick:()=>this.setState({globalSettingsVisible:!0})}]:[],...r==="chat"?[{key:"display-settings",icon:e.jsx(Jt,{}),label:m("ui.settings"),onClick:()=>this.setState({settingsDrawerVisible:!0})}]:[]];return e.jsxs("div",{className:d.headerBar,children:[e.jsxs(qe,{size:"middle",children:[e.jsx(Ca,{menu:{items:xe,className:"logo-dropdown-menu"},trigger:["hover"],onOpenChange:S=>this.setState({logoDropdownOpen:S}),align:{offset:[-4,0]},children:e.jsx("span",{className:`${d.logoWrap}${this.state.logoDropdownOpen?` ${d.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:`${d.logoImage}${this.state.logoDropdownOpen?` ${d.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(je,{className:d.tokenStatsTag,children:[e.jsx(pt,{className:d.tokenStatsIcon}),m("ui.tokenStats")]})}),this.props.activeProxyId&&this.props.activeProxyId!=="max"&&(()=>{const S=(this.props.proxyProfiles||[]).find(K=>K.id===this.props.activeProxyId);return S?e.jsxs(je,{className:d.proxyProfileTag,onClick:()=>this.setState({proxyModalVisible:!0}),children:[e.jsx(qt,{className:d.proxySwapIcon}),S.name,S.activeModel?` · ${S.activeModel}`:""]}):null})(),(()=>{var Ne,q,ke,ye,Je;let S=0;const K=gt.find(pe=>pe.value===this.state.calibrationModel),ve=K==null?void 0:K.tokens;if(!h){if(ve&&(P==null?void 0:P.used_percentage)!=null){const pe=$=>{var we,We;const he=(We=(we=$.response)==null?void 0:we.body)==null?void 0:We.usage;return((he==null?void 0:he.input_tokens)||0)+((he==null?void 0:he.cache_creation_input_tokens)||0)+((he==null?void 0:he.cache_read_input_tokens)||0)};let ne=0;for(let $=n.length-1;$>=0;$--)if(Te(n[$])&&((q=(Ne=n[$].response)==null?void 0:Ne.body)!=null&&q.usage)){ne=pe(n[$]);break}if(ne>0){const $=ve*.835;S=Math.min(100,Math.max(0,Math.round(ne/$*100)))}else{const $=P.context_window_size||2e5;S=Math.min(100,Math.max(0,Math.round(P.used_percentage*$/ve/83.5*100)))}}else if((P==null?void 0:P.used_percentage)!=null){const pe=this.state.settingsModel?Rt(this.state.settingsModel):0,ne=P.context_window_size||2e5;pe&&pe!==ne?S=Math.min(100,Math.max(0,Math.round(P.used_percentage*ne/pe/83.5*100))):S=Math.min(100,Math.max(0,Math.round(P.used_percentage/83.5*100)))}else if(n.length>0){const pe=ne=>{var he,we;const $=(we=(he=ne.response)==null?void 0:he.body)==null?void 0:we.usage;return(($==null?void 0:$.input_tokens)||0)+(($==null?void 0:$.cache_creation_input_tokens)||0)+(($==null?void 0:$.cache_read_input_tokens)||0)};for(let ne=n.length-1;ne>=0;ne--)if(Te(n[ne])&&((ye=(ke=n[ne].response)==null?void 0:ke.body)!=null&&ye.usage)){const $=pe(n[ne]),we=(ve||(P==null?void 0:P.context_window_size)||Rt(((Je=n[ne].body)==null?void 0:Je.model)||this.state.settingsModel))*.835;we>0&&$>0&&(S=Math.min(100,Math.max(0,Math.round($/we*100))));break}}}S===0&&this._lastContextPercent>0&&(S=this._lastContextPercent);const be=S>=80?"var(--color-error-light)":S>=60?"var(--color-warning-light)":"var(--color-success)";return h?e.jsx(je,{className:`${d.liveTag} ${d.liveTagHistory}`,children:e.jsx("span",{className:d.liveTagText,children:m("ui.historyLog",{file:l})})}):e.jsx(ze,{content:this.state._cachePopoverOpen?this.renderCacheContentPopover(S):e.jsx("div",{className:d.cachePopoverPlaceholder}),trigger:"hover",placement:"bottomLeft",overlayInnerStyle:{background:"var(--bg-elevated)",border:"1px solid var(--border-hover)",borderRadius:8,padding:"8px 8px"},onOpenChange:pe=>{this.setState({_cachePopoverOpen:pe}),pe||(this._cacheScrollInited=!1)},children:e.jsxs("span",{className:d.liveTag,style:{borderColor:be,color:be},children:[e.jsx("span",{className:d.liveTagFill,style:{width:`${S}%`,backgroundColor:be}}),e.jsx("span",{className:d.liveTagContent,children:e.jsxs("span",{className:d.liveTagText,children:[m("ui.liveMonitoring"),c?`:${c}`:""]})})]})})})(),R&&e.jsx(je,{color:R.type==="completed"?"green":"orange",closable:!0,onClose:()=>T&&T(),children:R.type==="completed"?m("ui.update.completed",{version:R.version}):m("ui.update.majorAvailable",{version:R.version})})]}),e.jsxs(qe,{size:"middle",children:[ae&&r==="raw"&&e.jsxs(je,{style:{background:"var(--bg-surface)",border:"1px solid var(--border-hover)",color:ae===m("ui.cacheExpired")?"var(--color-error-light)":"var(--text-secondary)"},children:[m("ui.cacheCountdown",{type:o?`(${o})`:""}),e.jsx("strong",{className:d.countdownStrong,children:ae})]}),r==="chat"&&A&&!h&&this.state.localUrl&&e.jsxs(e.Fragment,{children:[this.state.countryFlag&&((ee=this.state.countryInfo)==null?void 0:ee.country)!=="CN"&&e.jsx(ze,{content:this.state.countryInfo?e.jsxs("div",{className:d.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:d.countryInfoMeta,children:this.state.countryInfo.org}),this.state.countryInfo.ip&&e.jsx("div",{className:d.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(H,{className:d.compactBtnNoBorder,icon:e.jsx("span",{className:d.countryFlagIcon,children:this.state.countryFlag})})}),e.jsx(Me,{checked:de==="light",onChange:S=>le&&le(S?"light":"dark"),checkedChildren:"雪山白",unCheckedChildren:"曜石黑"}),e.jsx(ze,{content:e.jsxs("div",{className:d.qrcodePopover,children:[e.jsxs("div",{className:d.qrcodeTitle,children:[m("ui.scanToCoding")," ",e.jsx(re,{doc:"QRCode"})]}),e.jsx(Es,{value:this.state.localUrl,size:200,bgColor:de==="light"?"#ffffff":"#141414",fgColor:de==="light"?"#1a1a1a":"#d9d9d9",level:"M"}),e.jsx(Re,{readOnly:!0,value:this.state.localUrl,className:d.qrcodeUrlInput,suffix:e.jsx(Ve,{className:d.qrcodeUrlCopy,onClick:()=>{navigator.clipboard.writeText(this.state.localUrl).then(()=>{J.success(m("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(H,{className:d.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:d.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"})]})})})]}),A&&r==="chat"&&!h&&e.jsx(H,{className:d.compactBtn,type:D?"primary":"default",ghost:D,icon:e.jsx(tt,{}),onClick:se,children:m("ui.terminal")}),e.jsx(H,{className:d.compactBtn,type:r==="raw"?"primary":"default",icon:r==="raw"?e.jsx(Rn,{}):e.jsx(et,{}),onClick:u,children:r==="raw"?m("ui.chatMode"):m("ui.rawMode")})]}),e.jsxs(_e,{title:`${m("ui.userPrompt")} (${this.state.promptData.length}${m("ui.promptCountUnit")})`,open:this.state.promptModalVisible,onCancel:()=>this.setState({promptModalVisible:!1}),footer:null,width:700,children:[e.jsx("div",{className:d.promptExportBar,children:e.jsx(H,{icon:e.jsx(ba,{}),onClick:this.handleExportPromptsTxt,children:m("ui.exportPromptsTxt")})}),e.jsx(os,{activeKey:this.state.promptViewMode,onChange:S=>this.setState({promptViewMode:S}),size:"small",items:[{key:"original",label:m("ui.promptModeOriginal")},{key:"context",label:m("ui.promptModeContext")},{key:"text",label:m("ui.promptModeText")}]}),this.state.promptViewMode==="text"?e.jsx("textarea",{readOnly:!0,className:d.promptTextarea,value:this.buildTextModeContent()}):e.jsxs("div",{className:d.promptScrollArea,children:[this.state.promptData.length===0&&e.jsx("div",{className:d.promptEmpty,children:m("ui.noPrompt")}),this.state.promptData.map((S,K)=>{const ve=S.timestamp?new Date(S.timestamp).toLocaleString():m("ui.unknownTime");return e.jsxs("div",{children:[e.jsxs("div",{className:d.promptTimestamp,children:[ve,":"]}),this.state.promptViewMode==="original"?this.renderOriginalPrompt(S):this.renderTextPrompt(S)]},K)})]})]}),e.jsxs(Ze,{title:m("ui.settings"),placement:"left",width:360,open:this.state.settingsDrawerVisible,onClose:()=>this.setState({settingsDrawerVisible:!1}),children:[e.jsxs("div",{className:d.settingsGroupBox,children:[e.jsx("div",{className:d.settingsGroupTitle,children:m("ui.chatDisplaySwitches")}),e.jsxs("div",{className:d.settingsItem,children:[e.jsx("span",{className:d.settingsLabel,children:m("ui.collapseToolResults")}),e.jsx(Me,{checked:!!p,onChange:S=>j&&j(S)})]}),e.jsxs("div",{className:d.settingsItem,children:[e.jsx("span",{className:d.settingsLabel,children:m("ui.expandThinking")}),e.jsx(Me,{checked:!!f,onChange:S=>x&&x(S)})]}),e.jsxs("div",{className:d.settingsItem,children:[e.jsx("span",{className:d.settingsLabel,children:m("ui.showFullToolContent")}),e.jsx(Me,{checked:!!y,onChange:S=>C&&C(S)})]})]}),e.jsxs("div",{className:d.settingsGroupBox,children:[e.jsx("div",{className:d.settingsGroupTitle,children:m("ui.userPreferences")}),e.jsxs("div",{className:d.settingsItem,children:[e.jsx("span",{className:d.settingsLabel,children:m("ui.resumeAutoChoice")}),e.jsx(Me,{checked:!!ie,onChange:S=>Y&&Y(S)})]}),ie&&e.jsx("div",{className:d.settingsItem,children:e.jsxs(Qe.Group,{value:ie,onChange:S=>ce&&ce(S.target.value),size:"small",children:[e.jsx(Qe,{value:"continue",children:m("ui.resumeAutoChoice.continue")}),e.jsx(Qe,{value:"new",children:m("ui.resumeAutoChoice.new")})]})}),e.jsxs("div",{className:d.settingsItem,children:[e.jsx("span",{className:d.settingsLabel,children:m("ui.permission.autoApprove.setting")}),e.jsx(Le,{size:"small",value:W||0,onChange:S=>me&&me(S),options:[{label:m("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:d.settingsGroupBox,children:e.jsxs("div",{className:d.settingsItem,children:[e.jsx("span",{className:d.settingsLabel,children:m("ui.themeColor")}),e.jsx(Le,{size:"small",value:de||"dark",onChange:S=>le&&le(S),options:[{label:m("ui.themeColor.dark"),value:"dark"},{label:m("ui.themeColor.light"),value:"light"}],style:{width:140}})]})}),e.jsx("div",{className:d.settingsGroupBox,children:e.jsxs("div",{className:d.settingsItem,children:[e.jsx("span",{className:d.settingsLabel,children:m("ui.languageSettings")}),e.jsx(Le,{size:"small",value:Sa(),onChange:S=>{Na(S),i&&i()},options:Gn.map(S=>({label:S.label,value:S.value})),style:{width:140}})]})})]}),e.jsxs(Ze,{title:e.jsxs("span",{children:[m("ui.globalSettings")," ",e.jsx(re,{doc:"GlobalSettings"})]}),placement:"left",width:400,open:this.state.globalSettingsVisible,onClose:()=>this.setState({globalSettingsVisible:!1}),children:[e.jsxs("div",{className:d.settingsItem,children:[e.jsx("span",{className:d.settingsLabel,children:m("ui.filterIrrelevant")}),e.jsx(Me,{checked:!!b,onChange:S=>M&&M(S)})]}),e.jsxs("div",{className:d.settingsItem,children:[e.jsx("span",{className:d.settingsLabel,children:m("ui.expandDiff")}),e.jsx(Me,{checked:!!k,onChange:S=>N&&N(S)})]}),e.jsx("div",{className:d.settingsDivider}),e.jsx("div",{className:d.settingsLabel,children:m("ui.logDirTitle")}),e.jsx(Re,{className:d.logDirInput,value:this.state.logDirDraft??E,onChange:S=>this.setState({logDirDraft:S.target.value}),onBlur:()=>{const S=this.state.logDirDraft;S!=null&&S!==E&&(L==null||L(S)),this.setState({logDirDraft:null})},onPressEnter:()=>{const S=this.state.logDirDraft;S!=null&&S!==E&&(L==null||L(S)),this.setState({logDirDraft:null})},placeholder:"~/.claude/cc-viewer"})]}),e.jsx(Ze,{title:e.jsxs("span",{children:[e.jsx(Wt,{className:d.titleIcon}),m("ui.projectStats")]}),placement:"left",width:400,open:this.state.projectStatsVisible,onClose:()=>this.setState({projectStatsVisible:!1}),children:this.renderProjectStatsContent()}),e.jsxs(_e,{title:e.jsxs("span",{children:[e.jsx(Ut,{className:d.titleIcon}),m("ui.pluginManagement")]}),open:this.state.pluginModalVisible,onCancel:()=>this.setState({pluginModalVisible:!1}),footer:e.jsxs("div",{className:d.pluginModalFooter,children:[e.jsxs("div",{className:d.pluginModalFooterLeft,children:[e.jsx(H,{icon:e.jsx(Lt,{}),onClick:this.handleAddPlugin,children:m("ui.plugins.add")}),e.jsx(H,{icon:e.jsx(Kt,{}),onClick:this.handleShowCdnModal,children:m("ui.plugins.cdnInstall")})]}),e.jsx(H,{icon:e.jsx(yt,{}),onClick:this.handleReloadPlugins,children:m("ui.plugins.reload")})]}),width:560,children:[this.state.pluginsDir&&e.jsxs("div",{className:d.pluginDirHint,children:[e.jsxs("span",{className:d.pluginDirLabel,children:[m("ui.plugins.pluginsDir"),":"]})," ",e.jsx("code",{className:d.pluginDirPath,onClick:()=>{navigator.clipboard.writeText(this.state.pluginsDir).then(()=>{J.success(m("ui.copied"))}).catch(()=>{})},children:this.state.pluginsDir})]}),this.state.pluginsList.length===0?e.jsxs("div",{className:d.pluginEmpty,children:[e.jsx("div",{className:d.pluginEmptyTitle,children:m("ui.plugins.empty")}),e.jsx("div",{className:d.pluginEmptyHint,children:m("ui.plugins.emptyHint")})]}):e.jsx("div",{className:d.pluginList,children:this.state.pluginsList.map(S=>e.jsxs("div",{className:d.pluginItem,children:[e.jsxs("div",{className:d.pluginInfo,children:[e.jsx("span",{className:d.pluginName,children:S.name}),e.jsx("span",{className:d.pluginFile,children:S.file}),S.hooks.length>0&&e.jsx("span",{className:d.pluginHooks,children:S.hooks.map(K=>e.jsx("span",{className:d.pluginHookTag,children:K},K))})]}),e.jsxs("div",{className:d.pluginActions,children:[e.jsx(Me,{size:"small",checked:S.enabled,onChange:K=>this.handleTogglePlugin(S.name,K)}),e.jsx(H,{type:"text",size:"small",danger:!0,icon:e.jsx(vt,{}),onClick:()=>this.handleDeletePlugin(S.file,S.name)})]})]},S.file))})]}),e.jsx(_e,{title:m("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?m("ui.plugins.deleteConfirm",{name:this.state.deleteTarget.name}):""})}),e.jsx(_e,{title:e.jsxs("span",{children:[e.jsx(Kt,{className:d.titleIcon}),m("ui.plugins.cdnInstall")]}),open:this.state.cdnModalVisible,onCancel:this.handleCdnCancel,onOk:this.handleCdnInstall,confirmLoading:this.state.cdnLoading,okText:m("ui.plugins.cdnInstallBtn"),cancelText:m("ui.cancel"),width:480,children:e.jsxs("div",{children:[e.jsx("div",{className:d.cdnUrlLabel,children:m("ui.plugins.cdnUrl")}),e.jsx(Re,{placeholder:m("ui.plugins.cdnUrlPlaceholder"),value:this.state.cdnUrl,onChange:this.handleCdnUrlChange,onPressEnter:this.handleCdnInstall,className:d.cdnInput})]})}),e.jsx(_e,{title:e.jsxs("span",{children:[e.jsx(pt,{className:d.titleIcon}),m("ui.processManagement")]}),open:this.state.processModalVisible,onCancel:()=>this.setState({processModalVisible:!1}),footer:e.jsx(H,{icon:e.jsx(yt,{}),onClick:this.fetchProcesses,loading:this.state.processLoading,children:m("ui.processManagement.refresh")}),width:780,children:e.jsx(_a,{dataSource:this.state.processList,rowKey:"pid",loading:this.state.processLoading,size:"middle",pagination:!1,columns:[{title:m("ui.processManagement.port"),dataIndex:"port",width:80,render:S=>S?e.jsx("a",{href:`${window.location.protocol}//127.0.0.1:${S}`,target:"_blank",rel:"noopener noreferrer",children:S}):""},{title:"PID",dataIndex:"pid",width:80},{title:m("ui.processManagement.command"),dataIndex:"command",ellipsis:!0},{title:m("ui.processManagement.startTime"),dataIndex:"startTime",width:200},{title:m("ui.processManagement.action"),width:100,render:(S,K)=>K.isCurrent?e.jsx(H,{size:"small",className:d.currentProcessBtn,children:m("ui.processManagement.current")}):e.jsx(H,{size:"small",danger:!0,onClick:()=>this.handleKillProcess(K.pid),children:m("ui.processManagement.kill")})}]})}),e.jsx(_e,{title:e.jsxs("span",{children:[e.jsx(is,{apiEndpoint:ue("/api/open-profile-dir"),title:m("ui.proxy.openConfigDir"),size:16})," ",m("ui.proxySwitch")," ",e.jsx(re,{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||[],n=this.props.activeProxyId||"max",{editingProxy:r,editForm:o}=this.state;return e.jsxs("div",{children:[e.jsxs("div",{className:d.proxyWarning,children:["⚠️ ",m("ui.proxy.maxWarning")]}),e.jsx("div",{className:d.proxyList,children:t.map(u=>{var g;return e.jsxs("div",{className:`${d.proxyItem} ${u.id===n?d.proxyItemActive:""}`,children:[e.jsxs("div",{className:d.proxyItemMain,onClick:()=>{if(u.id!==n){const i={active:u.id,profiles:t};this.props.onProxyProfileChange(i)}},children:[e.jsx(Qe,{checked:u.id===n,style:{marginRight:8}}),e.jsxs("div",{className:d.proxyItemInfo,children:[e.jsxs("div",{className:d.proxyItemNameRow,children:[e.jsx("span",{className:d.proxyItemName,children:u.name}),u.id==="max"&&e.jsx(je,{className:d.proxyBuiltinTag,children:m("ui.proxy.builtin")})]}),u.id==="max"&&this.props.defaultConfig&&e.jsxs("div",{className:d.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:d.proxyItemDetail,children:[(()=>{try{return new URL(u.baseURL).host}catch{return u.baseURL}})(),u.activeModel?` · ${u.activeModel}`:(g=u.models)!=null&&g.length?` · ${u.models[0]}`:""]})]})]}),u.id!=="max"&&e.jsxs("div",{className:d.proxyItemActions,children:[e.jsx(H,{type:"text",size:"small",icon:e.jsx(ka,{}),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(H,{type:"text",size:"small",danger:!0,icon:e.jsx(vt,{}),onClick:()=>{_e.confirm({title:m("ui.proxy.deleteProxy"),content:m("ui.proxy.deleteConfirm",{name:u.name}),okType:"danger",onOk:()=>{const i=t.filter(l=>l.id!==u.id),h=n===u.id?"max":n;this.props.onProxyProfileChange({active:h,profiles:i})}})}})]})]},u.id)})}),r&&e.jsxs("div",{className:d.proxyEditForm,children:[e.jsxs("div",{className:d.proxyEditRow,children:[e.jsxs("label",{children:[m("ui.proxy.name")," ",e.jsx("span",{className:d.proxyRequired,children:"*"})]}),e.jsx(Re,{size:"small",value:o.name,onChange:u=>{const g=u.target.value;this.setState(i=>({editForm:{...i.editForm,name:g}}))}})]}),e.jsxs("div",{className:d.proxyEditRow,children:[e.jsxs("label",{children:[m("ui.proxy.baseURL")," ",e.jsx("span",{className:d.proxyRequired,children:"*"})]}),e.jsx(Re,{size:"small",value:o.baseURL,onChange:u=>{const g=u.target.value;this.setState(i=>({editForm:{...i.editForm,baseURL:g}}))},placeholder:"https://api.example.com"})]}),e.jsxs("div",{className:d.proxyEditRow,children:[e.jsxs("label",{children:[m("ui.proxy.apiKey")," ",e.jsx("span",{className:d.proxyRequired,children:"*"})]}),e.jsx(Re.Password,{size:"small",value:o.apiKey,onChange:u=>{const g=u.target.value;this.setState(i=>({editForm:{...i.editForm,apiKey:g}}))},placeholder:"sk-..."})]}),e.jsx("div",{className:d.proxyEditDivider}),e.jsxs("div",{className:d.proxyEditRow,children:[e.jsx("label",{children:m("ui.proxy.models")}),e.jsx(Re,{size:"small",value:o.models,onChange:u=>{const g=u.target.value;this.setState(i=>({editForm:{...i.editForm,models:g}}))},placeholder:"model-1, model-2"})]}),e.jsxs("div",{className:d.proxyEditRow,children:[e.jsx("label",{children:m("ui.proxy.activeModel")}),e.jsx(Le,{size:"small",className:d.fullWidthSelect,value:o.activeModel||void 0,onChange:u=>this.setState(g=>({editForm:{...g.editForm,activeModel:u}})),placeholder:m("ui.proxy.activeModel"),children:(o.models||"").split(",").map(u=>u.trim()).filter(Boolean).map(u=>e.jsx(Le.Option,{value:u,children:u},u))})]}),e.jsxs("div",{className:d.proxyEditBtns,children:[e.jsx(H,{size:"small",icon:e.jsx(wa,{}),type:"primary",onClick:()=>{var h,l,c;if(!((h=o.name)!=null&&h.trim())||!((l=o.baseURL)!=null&&l.trim())||!((c=o.apiKey)!=null&&c.trim())){J.warning(m("ui.proxy.requiredFields"));return}const u=(o.models||"").split(",").map(p=>p.trim()).filter(Boolean),g={id:r==="__new__"?`proxy_${Date.now()}`:r,name:o.name.trim(),baseURL:o.baseURL.trim(),apiKey:o.apiKey.trim(),models:u,activeModel:o.activeModel||u[0]||""};let i;r==="__new__"?i=[...t,g]:i=t.map(p=>p.id===r?{...p,...g,id:p.id}:p),this.props.onProxyProfileChange({active:n,profiles:i}),this.setState({editingProxy:null})},children:m("ui.proxy.save")}),e.jsx(H,{size:"small",icon:e.jsx(es,{}),onClick:()=>this.setState({editingProxy:null}),children:m("ui.proxy.cancel")})]})]}),!r&&e.jsx(H,{block:!0,type:"dashed",icon:e.jsx(Lt,{}),style:{marginTop:12},onClick:()=>this.setState({editingProxy:"__new__",editForm:{name:"",baseURL:"",apiKey:"",models:"",activeModel:""}}),children:m("ui.proxy.addProxy")})]})}};O(Pe,"COMMAND_TAGS",new Set(["command-name","command-message","command-args","local-command-caveat","local-command-stdout"]));let ot=Pe;const Qn="_centerEmpty_midza_1",Xn="_scrollContainer_midza_8",Yn="_listItem_midza_15",Zn="_listItemActive_midza_29",eo="_itemContent_midza_46",to="_itemHeader_midza_51",so="_tagNoMargin_midza_59",ao="_modelName_midza_64",no="_modelNameMain_midza_69",oo="_time_midza_73",io="_detailRow_midza_79",lo="_urlText_midza_86",ro="_duration_midza_95",co="_statusOk_midza_100",ho="_statusErr_midza_106",uo="_statusDefault_midza_111",mo="_usageBox_midza_116",po="_cacheDot_midza_126",go="_cacheDotLoss_midza_135",fo="_cacheDotNormal_midza_140",xo="_tagMainAgent_midza_144",vo="_tagPlan_midza_150",yo="_tagMuted_midza_156",jo="_tooltipPreLine_midza_162",V={centerEmpty:Qn,scrollContainer:Xn,listItem:Yn,listItemActive:Zn,itemContent:eo,itemHeader:to,tagNoMargin:so,modelName:ao,modelNameMain:no,time:oo,detailRow:io,urlText:lo,duration:ro,statusOk:co,statusErr:ho,statusDefault:uo,usageBox:mo,cacheDot:po,cacheDotLoss:go,cacheDotNormal:fo,tagMainAgent:xo,tagPlan:vo,tagMuted:yo,tooltipPreLine:jo};class Co extends U.Component{constructor(t){super(t);O(this,"handleKeyDown",t=>{if(t.key!=="ArrowUp"&&t.key!=="ArrowDown")return;const{requests:n,selectedIndex:r,onSelect:o}=this.props;if(!n.length)return;t.preventDefault();const u=r??0,g=t.key==="ArrowUp"?Math.max(0,u-1):Math.min(n.length-1,u+1);g!==u&&o(g)});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:n,onSelect:r}=this.props;return t.length===0?e.jsx("div",{className:V.centerEmpty,children:e.jsx(Ae,{description:m("ui.waitingRequests")})}):e.jsx("div",{className:V.scrollContainer,onKeyDown:this.handleKeyDown,children:e.jsx(Pt,{dataSource:t,size:"small",split:!1,renderItem:(o,u)=>{var M,E,L;const g=new Date(o.timestamp).toLocaleTimeString("zh-CN"),i=u===n,h=o.response&&o.response.status<400,l=o.response&&o.response.status>=400,c=Ta((M=o.body)==null?void 0:M.model),p=u+1<t.length?t[u+1]:null,{type:j,subType:f}=Ge(o,p),x=(L=(E=o.response)==null?void 0:E.body)==null?void 0:L.usage,y=x?(x.input_tokens||0)+(x.cache_read_input_tokens||0)+(x.cache_creation_input_tokens||0):null,C=(x==null?void 0:x.output_tokens)||null,k=(x==null?void 0:x.cache_read_input_tokens)||0,N=(x==null?void 0:x.cache_creation_input_tokens)||0;let b=o.url;try{const R=new URL(o.url);b=R.host+R.pathname}catch{}return e.jsx(Pt.Item,{ref:i?this.activeItemRef:void 0,tabIndex:0,onClick:()=>r(u),className:`${V.listItem} ${i?V.listItemActive:""}`,children:e.jsxs("div",{className:V.itemContent,children:[e.jsxs("div",{className:V.itemHeader,children:[j==="MainAgent"?e.jsx(je,{className:`${V.tagNoMargin} ${V.tagMainAgent}`,children:"MainAgent"}):j==="Plan"?e.jsx(je,{className:`${V.tagNoMargin} ${V.tagPlan}`,children:At(j,f)}):j==="Count"||j==="Preflight"?e.jsx(je,{className:`${V.tagNoMargin} ${V.tagMuted}`,children:j}):e.jsx(je,{className:V.tagNoMargin,children:At(j,f)}),c&&e.jsx("span",{className:`${V.modelName} ${j==="MainAgent"?V.modelNameMain:""}`,children:c}),e.jsx("span",{className:V.time,children:g})]}),e.jsxs("div",{className:V.detailRow,children:[e.jsx("span",{className:V.urlText,title:o.url,children:b}),o.duration&&e.jsxs("span",{className:V.duration,children:[o.duration,"ms"]}),o.response&&e.jsx("span",{className:h?V.statusOk:l?V.statusErr:V.statusDefault,children:o.response.status})]}),x&&e.jsxs("div",{className:V.usageBox,children:[e.jsxs("div",{children:["token: output:",G(C)||0,", input: ",G(y)||0]}),(k>0||N>0)&&e.jsx("div",{children:(()=>{var D;const R=(D=this.props.cacheLossMap)==null?void 0:D.get(u),T={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 A;if(R){const F=(R.reasons||[R.reason]).map(P=>m(T[P]||T.key_change)).join(`
29
+ `);A=e.jsx(ls,{title:e.jsx("span",{className:V.tooltipPreLine,children:F}),children:e.jsx("span",{className:`${V.cacheDot} ${V.cacheDotLoss}`})})}else A=e.jsx("span",{className:`${V.cacheDot} ${V.cacheDotNormal}`});return e.jsxs(e.Fragment,{children:["cache",A,": ",k>0?`read:${G(k)}`:"",k>0&&N>0?", ":"",N>0?`create:${G(N)}`:""]})})()})]})]})})}})})}}const bo=a=>typeof a=="boolean"||a instanceof Boolean,No=a=>typeof a=="number"||a instanceof Number,So=a=>typeof a=="bigint"||a instanceof BigInt,Is=a=>!!a&&a instanceof Date,_o=a=>typeof a=="string"||a instanceof String,ko=a=>Array.isArray(a),Rs=a=>typeof a=="object"&&a!==null,Ls=a=>!!a&&a instanceof Object&&typeof a=="function";function it(a,s){return s===void 0&&(s=!1),!a||s?`"${a}"`:a}function wo(a,s,t){return t?JSON.stringify(a):s?`"${a}"`:a}function Ps(a){let{field:s,value:t,data:n,lastElement:r,openBracket:o,closeBracket:u,level:g,style:i,shouldExpandNode:h,clickToExpandNode:l,outerRef:c,beforeExpandChange:p}=a;const j=v.useRef(!1),[f,x]=v.useState(()=>h(g,t,s)),y=v.useRef(null);v.useEffect(()=>{j.current?x(h(g,t,s)):j.current=!0},[h]);const C=v.useId();if(n.length===0)return To({field:s,openBracket:o,closeBracket:u,lastElement:r,style:i});const k=f?i.collapseIcon:i.expandIcon,N=f?i.ariaLables.collapseJson:i.ariaLables.expandJson,b=g+1,M=n.length-1,E=T=>{f!==T&&(!p||p({level:g,value:t,field:s,newExpandValue:T}))&&x(T)},L=T=>{if(T.key==="ArrowRight"||T.key==="ArrowLeft")T.preventDefault(),E(T.key==="ArrowRight");else if(T.key==="ArrowUp"||T.key==="ArrowDown"){T.preventDefault();const A=T.key==="ArrowUp"?-1:1;if(!c.current)return;const D=c.current.querySelectorAll("[role=button]");let se=-1;for(let P=0;P<D.length;P++)if(D[P].tabIndex===0){se=P;break}if(se<0)return;const F=(se+A+D.length)%D.length;D[se].tabIndex=-1,D[F].tabIndex=0,D[F].focus()}},R=()=>{var T;E(!f);const A=y.current;if(!A)return;const D=(T=c.current)===null||T===void 0?void 0:T.querySelector('[role=button][tabindex="0"]');D&&(D.tabIndex=-1),A.tabIndex=0,A.focus()};return v.createElement("div",{className:i.basicChildStyle,role:"treeitem","aria-expanded":f,"aria-selected":void 0},v.createElement("span",{className:k,onClick:R,onKeyDown:L,role:"button","aria-label":N,"aria-expanded":f,"aria-controls":f?C:void 0,ref:y,tabIndex:g===0?0:-1}),(s||s==="")&&(l?v.createElement("span",{className:i.clickableLabel,onClick:R,onKeyDown:L},it(s,i.quotesForFieldNames),":"):v.createElement("span",{className:i.label},it(s,i.quotesForFieldNames),":")),v.createElement("span",{className:i.punctuation},o),f?v.createElement("ul",{id:C,role:"group",className:i.childFieldsContainer},n.map((T,A)=>v.createElement(bt,{key:T[0]||A,field:T[0],value:T[1],style:i,lastElement:A===M,level:b,shouldExpandNode:h,clickToExpandNode:l,beforeExpandChange:p,outerRef:c}))):v.createElement("span",{className:i.collapsedContent,onClick:R,onKeyDown:L}),v.createElement("span",{className:i.punctuation},u),!r&&v.createElement("span",{className:i.punctuation},","))}function To(a){let{field:s,openBracket:t,closeBracket:n,lastElement:r,style:o}=a;return v.createElement("div",{className:o.basicChildStyle,role:"treeitem","aria-selected":void 0},(s||s==="")&&v.createElement("span",{className:o.label},it(s,o.quotesForFieldNames),":"),v.createElement("span",{className:o.punctuation},t),v.createElement("span",{className:o.punctuation},n),!r&&v.createElement("span",{className:o.punctuation},","))}function Mo(a){let{field:s,value:t,style:n,lastElement:r,shouldExpandNode:o,clickToExpandNode:u,level:g,outerRef:i,beforeExpandChange:h}=a;return Ps({field:s,value:t,lastElement:r||!1,level:g,openBracket:"{",closeBracket:"}",style:n,shouldExpandNode:o,clickToExpandNode:u,data:Object.keys(t).map(l=>[l,t[l]]),outerRef:i,beforeExpandChange:h})}function Eo(a){let{field:s,value:t,style:n,lastElement:r,level:o,shouldExpandNode:u,clickToExpandNode:g,outerRef:i,beforeExpandChange:h}=a;return Ps({field:s,value:t,lastElement:r||!1,level:o,openBracket:"[",closeBracket:"]",style:n,shouldExpandNode:u,clickToExpandNode:g,data:t.map(l=>[void 0,l]),outerRef:i,beforeExpandChange:h})}function Io(a){let{field:s,value:t,style:n,lastElement:r}=a,o,u=n.otherValue;return t===null?(o="null",u=n.nullValue):t===void 0?(o="undefined",u=n.undefinedValue):_o(t)?(o=wo(t,!n.noQuotesForStringValues,n.stringifyStringValues),u=n.stringValue):bo(t)?(o=t?"true":"false",u=n.booleanValue):No(t)?(o=t.toString(),u=n.numberValue):So(t)?(o=`${t.toString()}n`,u=n.numberValue):Is(t)?o=t.toISOString():Ls(t)?o="function() { }":o=t.toString(),v.createElement("div",{className:n.basicChildStyle,role:"treeitem","aria-selected":void 0},(s||s==="")&&v.createElement("span",{className:n.label},it(s,n.quotesForFieldNames),":"),v.createElement("span",{className:u},o),!r&&v.createElement("span",{className:n.punctuation},","))}function bt(a){const s=a.value;return ko(s)?v.createElement(Eo,Object.assign({},a)):Rs(s)&&!Is(s)&&!Ls(s)?v.createElement(Mo,Object.assign({},a)):v.createElement(Io,Object.assign({},a))}var z={"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 As={collapseJson:"collapse JSON",expandJson:"expand JSON"},st={container:z["container-light"],basicChildStyle:z["basic-element-style"],childFieldsContainer:z["child-fields-container"],label:z["label-light"],clickableLabel:z["clickable-label-light"],nullValue:z["value-null-light"],undefinedValue:z["value-undefined-light"],stringValue:z["value-string-light"],booleanValue:z["value-boolean-light"],numberValue:z["value-number-light"],otherValue:z["value-other-light"],punctuation:z["punctuation-light"],collapseIcon:z["collapse-icon-light"],expandIcon:z["expand-icon-light"],collapsedContent:z["collapsed-content-light"],noQuotesForStringValues:!1,quotesForFieldNames:!1,ariaLables:As,stringifyStringValues:!1},Ro={container:z["container-dark"],basicChildStyle:z["basic-element-style"],childFieldsContainer:z["child-fields-container"],label:z["label-dark"],clickableLabel:z["clickable-label-dark"],nullValue:z["value-null-dark"],undefinedValue:z["value-undefined-dark"],stringValue:z["value-string-dark"],booleanValue:z["value-boolean-dark"],numberValue:z["value-number-dark"],otherValue:z["value-other-dark"],punctuation:z["punctuation-dark"],collapseIcon:z["collapse-icon-dark"],expandIcon:z["expand-icon-dark"],collapsedContent:z["collapsed-content-dark"],noQuotesForStringValues:!1,quotesForFieldNames:!1,ariaLables:As,stringifyStringValues:!1},Lo=()=>!0,Po=a=>{let{data:s,style:t=st,shouldExpandNode:n=Lo,clickToExpandNode:r=!1,beforeExpandChange:o,compactTopLevel:u,...g}=a;const i=v.useRef(null);return v.createElement("div",Object.assign({"aria-label":"JSON view"},g,{className:t.container,ref:i,role:"tree"}),u&&Rs(s)?Object.entries(s).map(h=>{let[l,c]=h;return v.createElement(bt,{key:l,field:l,value:c,style:{...st,...t},lastElement:!0,level:1,shouldExpandNode:n,clickToExpandNode:r,beforeExpandChange:o,outerRef:i})}):v.createElement(bt,{value:s,style:{...st,...t},lastElement:!0,level:0,shouldExpandNode:n,clickToExpandNode:r,outerRef:i,beforeExpandChange:o}))},Ao="_container_qeuid_1",Bo={container:Ao};class lt 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:n}=this.props,o={...typeof document<"u"&&document.documentElement.getAttribute("data-theme")!=="light"?Ro:st,container:"rjv-container"};if(s==null)return null;const u=typeof n=="function"?n:t==="all"?()=>!0:t==="root"?g=>g<2:g=>g<1;return e.jsx("div",{className:Bo.container,children:e.jsx(Po,{data:s,shouldExpandNode:u,style:o})})}}function Do({currentId:a,visibleIds:s=[],key:t}){if(t!=="ArrowUp"&&t!=="ArrowDown")return null;const n=s.findIndex(o=>o===a),r=t==="ArrowUp"?-1:1;return n>=0?s[n+r]??null:null}const Oo="_root_17dqd_1",$o="_sidebar_17dqd_9",Fo="_section_17dqd_18",Ho="_sectionHeader_17dqd_22",zo="_arrow_17dqd_48",Vo="_sectionTitle_17dqd_54",qo="_sectionCount_17dqd_62",Uo="_sectionBody_17dqd_71",Wo="_historyToggle_17dqd_76",Ko="_historyToggleLabel_17dqd_102",Go="_item_17dqd_107",Jo="_itemActive_17dqd_135",Qo="_itemContent_17dqd_142",Xo="_itemLabel_17dqd_148",Yo="_itemSublabel_17dqd_156",Zo="_itemTime_17dqd_165",ei="_content_17dqd_174",ti="_contentEmpty_17dqd_182",si="_contentInner_17dqd_189",ai="_emptyWrap_17dqd_193",ni="_roleHeader_17dqd_201",oi="_roleBadge_17dqd_209",ii="_role_user_17dqd_218",li="_role_assistant_17dqd_224",ri="_roleLabel_17dqd_230",ci="_contentTime_17dqd_237",di="_turnDivider_17dqd_245",hi="_textBlock_17dqd_252",ui="_textBlockBar_17dqd_259",mi="_textBlockBody_17dqd_268",pi="_textBlockCompact_17dqd_276",gi="_textBlockCompactFloat_17dqd_283",fi="_thinkingBlock_17dqd_290",xi="_thinkingHeader_17dqd_298",vi="_thinkingPreview_17dqd_313",yi="_thinkingBody_17dqd_323",ji="_toolBlock_17dqd_329",Ci="_toolBlockResult_17dqd_336",bi="_toolBlockError_17dqd_340",Ni="_toolBlockHeader_17dqd_344",Si="_toolBlockBody_17dqd_355",_i="_toolName_17dqd_360",ki="_toolId_17dqd_366",wi="_errorLabel_17dqd_373",Ti="_blockTag_17dqd_383",Mi="_blockTagText_17dqd_396",Ei="_blockTagThinking_17dqd_402",Ii="_blockTagResult_17dqd_408",Ri="_blockTagError_17dqd_414",Li="_jsonBlock_17dqd_421",Pi="_jsonBlockLabel_17dqd_428",Ai="_blockSeparator_17dqd_438",Bi="_markdownBody_17dqd_445",w={root:Oo,sidebar:$o,section:Fo,sectionHeader:Ho,arrow:zo,sectionTitle:Vo,sectionCount:qo,sectionBody:Uo,historyToggle:Wo,historyToggleLabel:Ko,item:Go,itemActive:Jo,itemContent:Qo,itemLabel:Xo,itemSublabel:Yo,itemTime:Zo,content:ei,contentEmpty:ti,contentInner:si,emptyWrap:ai,roleHeader:ni,roleBadge:oi,role_user:ii,role_assistant:li,roleLabel:ri,contentTime:ci,turnDivider:di,textBlock:hi,textBlockBar:ui,textBlockBody:mi,textBlockCompact:pi,textBlockCompactFloat:gi,thinkingBlock:fi,thinkingHeader:xi,thinkingPreview:vi,thinkingBody:yi,toolBlock:ji,toolBlockResult:Ci,toolBlockError:bi,toolBlockHeader:Ni,toolBlockBody:Si,toolName:_i,toolId:ki,errorLabel:wi,blockTag:Ti,blockTagText:Mi,blockTagThinking:Ei,blockTagResult:Ii,blockTagError:Ri,jsonBlock:Li,jsonBlockLabel:Pi,blockSeparator:Ai,markdownBody:Bi},{Text:Di}=rs;function Nt(a){if(a==null)return[];if(typeof a=="string"){const s=a.trim();return s?[{type:"markdown",text:s}]:[]}if(Array.isArray(a)){const s=[];for(const t of a)if(t)if(t.type==="text"){const n=(t.text||"").trim();n&&s.push({type:"markdown",text:n})}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 n=Oi(t.content);s.push({type:"tool_result",tool_use_id:t.tool_use_id||"",is_error:t.is_error,content:n})}else if(t.type==="thinking"){const n=t.thinking||"";n.trim()&&s.push({type:"thinking",text:n})}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:a}]}function Oi(a){if(a==null)return[];if(typeof a=="string"){const s=a.trim();return s?[{type:"markdown",text:s}]:[]}return Array.isArray(a)?a.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:a}]}function $i(a){if(!a)return null;if(typeof a=="string")return[{type:"markdown",text:a}];if(Array.isArray(a)){const s=[];return a.forEach((t,n)=>{n>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:a}]}function Fi(a){const s=[],t=(a==null?void 0:a.name)||"unknown",n=(a==null?void 0:a.description)||"";let r=`### ${t}
30
+
31
+ `;n&&(r+=`${n}
32
+
33
+ `),s.push({type:"markdown",text:r});const o=(a==null?void 0:a.input_schema)||(a==null?void 0:a.parameters)||null;return o&&s.push({type:"json",label:"Parameters",data:o}),s}function Hi(a){var s;if(typeof a=="string")return a.slice(0,60).replace(/\n/g," ");if(Array.isArray(a)){for(const t of a)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 zi(a){var n;const s=[];let t=0;for(;t<a.length;){const r=a[t];if((r==null?void 0:r.role)!=="user"){t++;continue}const o=((n=a[t+1])==null?void 0:n.role)==="assistant"?a[t+1]:null;s.push({id:`turn__${t}`,isTurn:!0,turnIndex:s.length,timestamp:r._timestamp||null,assistantTimestamp:(o==null?void 0:o._timestamp)||null,userBlocks:Nt(r==null?void 0:r.content),assistantBlocks:o?Nt(o.content):null,preview:Hi(r==null?void 0:r.content)}),t+=o?2:1}return s}function St(a){try{return new Date(a).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}catch{return null}}function Vi({text:a,compact:s}){const t=cs(a);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 qi({block:a}){const[s,t]=v.useState(!0),n=a.text.length>60?a.text.slice(0,60).replace(/\n/g," ")+"…":a.text.replace(/\n/g," ");return e.jsxs("div",{className:w.thinkingBlock,children:[e.jsxs("div",{className:w.thinkingHeader,onClick:()=>t(r=>!r),children:[s?e.jsx(Be,{className:w.arrow}):e.jsx(De,{className:w.arrow}),e.jsx("span",{className:`${w.blockTag} ${w.blockTagThinking}`,children:"thinking"}),!s&&e.jsx("span",{className:w.thinkingPreview,children:n})]}),s&&e.jsx("div",{className:w.thinkingBody,children:e.jsx("div",{className:`chat-md ${w.markdownBody}`,dangerouslySetInnerHTML:{__html:cs(a.text)}})})]})}function rt({blocks:a,compact:s}){return!a||a.length===0?null:e.jsx(e.Fragment,{children:a.map((t,n)=>e.jsx(Ui,{block:t,compact:s},n))})}function Ui({block:a,compact:s}){var t;return a.type==="separator"?e.jsx("hr",{className:w.blockSeparator}):a.type==="markdown"?(t=a.text)!=null&&t.trim()?e.jsx(Vi,{text:a.text,compact:s}):null:a.type==="thinking"?e.jsx(qi,{block:a}):a.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:a.name}),a.id&&e.jsx("span",{className:w.toolId,children:a.id})]}),e.jsx("div",{className:w.toolBlockBody,children:e.jsx(lt,{data:a.input,defaultExpand:"root"})})]}):a.type==="tool_result"?e.jsxs("div",{className:`${w.toolBlock} ${a.is_error?w.toolBlockError:w.toolBlockResult}`,children:[e.jsxs("div",{className:w.toolBlockHeader,children:[e.jsx("span",{className:`${w.blockTag} ${a.is_error?w.blockTagError:w.blockTagResult}`,children:"tool_result"}),a.tool_use_id&&e.jsx("span",{className:w.toolId,children:a.tool_use_id}),a.is_error&&e.jsx("span",{className:w.errorLabel,children:"error"})]}),e.jsx("div",{className:w.toolBlockBody,children:e.jsx(rt,{blocks:a.content,compact:!0})})]}):a.type==="json"?e.jsxs("div",{className:w.jsonBlock,children:[a.label&&e.jsx("div",{className:w.jsonBlockLabel,children:a.label}),e.jsx(lt,{data:a.data,defaultExpand:"root"})]}):null}function Wi({turn:a}){const s=a.timestamp?St(a.timestamp):null,t=a.assistantTimestamp?St(a.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 ${a.turnIndex+1}`}),s&&e.jsx("span",{className:w.contentTime,children:s})]}),e.jsx(rt,{blocks:a.userBlocks}),a.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(rt,{blocks:a.assistantBlocks})]})]})}function Ki({sectionKey:a,title:s,items:t,historyItems:n=[],onSelect:r,onSelectById:o,selectedId:u,sidebarRef:g}){const[i,h]=v.useState(a!=="tools"),[l,c]=v.useState(!1),p=t.length+n.length,j=`${a}__history_toggle`;function f(C){var N;const k=(N=g.current)==null?void 0:N.querySelector(`[data-context-sidebar-control="${C}"]`);k&&(k.focus(),k.scrollIntoView({block:"nearest"}))}function x(C,k){var M;const N=Array.from(((M=g.current)==null?void 0:M.querySelectorAll("[data-context-sidebar-control]"))||[]).map(E=>E.dataset.contextSidebarControl).filter(Boolean),b=Do({currentId:k,visibleIds:N,key:C.key});b&&(C.preventDefault(),typeof window<"u"&&window.requestAnimationFrame(()=>{var L;f(b);const E=(L=g.current)==null?void 0:L.querySelector(`[data-context-sidebar-control="${b}"]`);(E==null?void 0:E.dataset.controlType)==="item"&&o(b)}))}function y(C){const k=u===C.id;return e.jsxs("button",{type:"button",className:`${w.item} ${k?w.itemActive:""}`,onClick:()=>r(C),onKeyDown:N=>x(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":i,children:[i?e.jsx(Be,{className:w.arrow}):e.jsx(De,{className:w.arrow}),e.jsx("span",{className:w.sectionTitle,children:s}),e.jsx("span",{className:w.sectionCount,children:p})]}),i&&e.jsxs("div",{className:w.sectionBody,children:[n.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:w.historyToggle,onClick:()=>c(C=>!C),onKeyDown:C=>x(C,j),"aria-expanded":l,"data-context-sidebar-control":j,"data-control-type":"toggle",children:[l?e.jsx(Be,{className:w.arrow}):e.jsx(De,{className:w.arrow}),e.jsxs("span",{className:w.historyToggleLabel,children:[m("ui.context.history")," (",n.length,")"]})]}),l&&n.map(y)]}),t.map(y)]})]})}function Gi({body:a,response:s}){const[t,n]=v.useState(null),r=v.useRef(null),o=v.useMemo(()=>{if(!Array.isArray(a==null?void 0:a.messages))return[];const l=zi(a.messages);if(l.length===0)return l;const c=l[l.length-1],p=s!=null&&s.content?Nt(s.content):null;return[...l.slice(0,-1),{...c,assistantBlocks:p??c.assistantBlocks}]},[a,s]);if(v.useEffect(()=>{o.length>0?n(o[o.length-1]):n(null)},[a,s]),!a||typeof a!="object")return e.jsx("div",{className:w.emptyWrap,children:e.jsx(Ae,{description:m("ui.context.noData")})});const u=[];Array.isArray(a.tools)&&a.tools.length>0&&u.push({key:"tools",title:e.jsxs(e.Fragment,{children:[m("ui.context.tools")," ",e.jsx(re,{doc:"ToolsFirst"})]}),items:a.tools.map((l,c)=>({id:`tool__${c}`,label:(l==null?void 0:l.name)||`Tool ${c}`,blocks:Fi(l)}))});const g=$i(a.system);if(g!=null&&u.push({key:"system",title:m("ui.context.systemPrompt"),items:[{id:"system__0",label:m("ui.context.systemPrompt"),blocks:g}]}),o.length>0){const l=f=>({...f,label:m("ui.context.historyTurnNoTime",{n:f.turnIndex+1}),time:f.timestamp?St(f.timestamp):null,sublabel:f.preview||void 0}),c=f=>({...f,label:m("ui.context.currentTurn"),sublabel:f.preview||void 0}),p=o.slice(0,-1).map(l),j=c(o[o.length-1]);u.push({key:"messages",title:m("ui.context.messages"),historyItems:p.length>0?p:void 0,items:[j]})}if(u.length===0)return e.jsx("div",{className:w.emptyWrap,children:e.jsx(Ae,{description:m("ui.context.noFields")})});const i=t!=null&&t.isTurn?o.find(l=>l.id===t.id)??null:t,h=new Map;return u.forEach(l=>{(l.historyItems||[]).forEach(c=>h.set(c.id,c)),l.items.forEach(c=>h.set(c.id,c))}),e.jsxs("div",{className:w.root,children:[e.jsx("div",{ref:r,className:w.sidebar,children:u.map(l=>e.jsx(Ki,{sectionKey:l.key,title:l.title,items:l.items,historyItems:l.historyItems,selectedId:i==null?void 0:i.id,onSelect:c=>n(c),onSelectById:c=>{const p=h.get(c);p&&n(p)},sidebarRef:r},l.key))}),e.jsx("div",{className:w.content,children:i==null?e.jsx("div",{className:w.contentEmpty,children:e.jsx(Di,{type:"secondary",children:m("ui.context.selectPrompt")})}):e.jsx("div",{className:w.contentInner,children:i.isTurn?e.jsx(Wi,{turn:i}):e.jsxs(e.Fragment,{children:[i.role&&e.jsxs("div",{className:w.roleHeader,children:[e.jsx("span",{className:`${w.roleBadge} ${w[`role_${i.role}`]||""}`,children:i.role}),e.jsx("span",{className:w.roleLabel,children:i.label})]}),e.jsx(rt,{blocks:i.blocks})]})},i.id)})]})}const Ji="_container_rg6mx_1",Qi="_emptyState_rg6mx_10",Xi="_urlSection_rg6mx_17",Yi="_urlLeft_rg6mx_25",Zi="_tokenStatsBox_rg6mx_30",el="_tokenGrid_rg6mx_37",tl="_tokenRows_rg6mx_47",sl="_tokenRow_rg6mx_47",al="_tokenRowBorder_rg6mx_55",nl="_tokenLabel_rg6mx_59",ol="_tokenTd_rg6mx_66",il="_tokenHitRate_rg6mx_75",ll="_tokenHitRateLabel_rg6mx_88",rl="_urlText_rg6mx_98",cl="_metaText_rg6mx_105",dl="_headersContainer_rg6mx_109",hl="_headerRow_rg6mx_113",ul="_headerKey_rg6mx_119",ml="_headerValue_rg6mx_124",pl="_streamingBox_rg6mx_129",gl="_rawTextPre_rg6mx_142",fl="_tabContent_rg6mx_155",xl="_bodyLabel_rg6mx_167",vl="_bodyHeader_rg6mx_171",yl="_diffSection_rg6mx_178",jl="_diffToggle_rg6mx_182",Cl="_diffIcon_rg6mx_188",bl="_reminderSelect_rg6mx_214",Nl="_diffHeaderRow_rg6mx_233",Sl="_diffSpaceRight_rg6mx_239",_l="_reminderFilterWrapper_rg6mx_243",kl="_reminderLabel_rg6mx_249",wl="_cacheTabContent_rg6mx_255",Tl="_userPromptList_rg6mx_260",Ml="_userPromptItem_rg6mx_266",El="_userPromptNavBtn_rg6mx_277",Il="_cacheContent_rg6mx_288",Rl="_cacheTokenBar_rg6mx_295",Ll="_cacheTokenWrite_rg6mx_305",Pl="_cacheTokenRead_rg6mx_309",Al="_cacheCopyIcon_rg6mx_313",Bl="_cacheScrollArea_rg6mx_320",Dl="_cacheSectionBlock_rg6mx_326",Ol="_cacheSectionHeader_rg6mx_330",$l="_cacheCollapseArrow_rg6mx_342",Fl="_cachePre_rg6mx_348",Hl="_cacheHighlightSvg_rg6mx_362",zl="_cachePreSystem_rg6mx_371",_={container:Ji,emptyState:Qi,urlSection:Xi,urlLeft:Yi,tokenStatsBox:Zi,tokenGrid:el,tokenRows:tl,tokenRow:sl,tokenRowBorder:al,tokenLabel:nl,tokenTd:ol,tokenHitRate:il,tokenHitRateLabel:ll,urlText:rl,metaText:cl,headersContainer:dl,headerRow:hl,headerKey:ul,headerValue:ml,streamingBox:pl,rawTextPre:gl,tabContent:fl,bodyLabel:xl,bodyHeader:vl,diffSection:yl,diffToggle:jl,diffIcon:Cl,reminderSelect:bl,diffHeaderRow:Nl,diffSpaceRight:Sl,reminderFilterWrapper:_l,reminderLabel:kl,cacheTabContent:wl,userPromptList:Tl,userPromptItem:Ml,userPromptNavBtn:El,cacheContent:Il,cacheTokenBar:Rl,cacheTokenWrite:Ll,cacheTokenRead:Pl,cacheCopyIcon:Al,cacheScrollArea:Bl,cacheSectionBlock:Dl,cacheSectionHeader:Ol,cacheCollapseArrow:$l,cachePre:Fl,cacheHighlightSvg:Hl,cachePreSystem:zl},{Text:fe,Paragraph:Vl}=rs;class ql 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(g=>({cacheCollapsed:{...g.cacheCollapsed,messages:!1}}),()=>this.scrollToCacheMsg(s));return}const t=this._cacheScrollEl;if(!t)return;const n=t.querySelector(`[data-msg-idx="${s}"]`);if(!n)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 r=!1,o=!1;const u=()=>{!r||!o||(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),r=!0,u()},t.addEventListener("scrollend",this._cacheScrollEndHandler,{once:!0}),this._cacheScrollSettleTimer=setTimeout(()=>{t.removeEventListener("scrollend",this._cacheScrollEndHandler),r=!0,u()},800),this._cacheHighlightDelayTimer=setTimeout(()=>{o=!0,u()},500),n.scrollIntoView({behavior:"smooth",block:"center"})}shouldComponentUpdate(s,t){if(s.request!==this.props.request){const r=Te(s.request);this.setState({diffExpanded:r&&!!s.expandDiff,requestHeadersExpanded:!1,responseHeadersExpanded:!1,reminderFilters:null}),this._cacheClearAllTimers()}const n=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||n&&t.cacheHighlightIdx!==this.state.cacheHighlightIdx||n&&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||n&&t.cacheCollapsed!==this.state.cacheCollapsed}componentDidUpdate(s){const t=this.props.pendingCacheHighlight;t&&t!==s.pendingCacheHighlight&&setTimeout(()=>{var n,r;this.scrollToCacheMsg(t.msgIdx),(r=(n=this.props).onCacheHighlightDone)==null||r.call(n)},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 n;if(s==="diff"?n=this._lastDiffResult:n=s==="request"?t.body:(u=t.response)==null?void 0:u.body,n==null)return;const r=typeof n=="object"?mt(n):n,o=typeof r=="string"?r:JSON.stringify(r,null,2);navigator.clipboard.writeText(o).then(()=>J.success(m("ui.copySuccess")))}renderHeaders(s){return!s||Object.keys(s).length===0?e.jsx(fe,{type:"secondary",children:m("ui.noHeaders")}):e.jsx("div",{className:_.headersContainer,children:Object.entries(s).map(([t,n])=>e.jsxs("div",{className:_.headerRow,children:[e.jsx(fe,{code:!0,className:_.headerKey,children:t}),t==="authorization"&&e.jsx(re,{doc:"TranslateContextPollution"}),e.jsx(fe,{type:"secondary",className:_.headerValue,children:String(n)})]},t))})}getRequestExpandNode(s,t){if(t!=="request"||!s||typeof s!="object")return;const{request:n,requests:r,selectedIndex:o}=this.props;if(!n)return;const u=r&&o!=null?r[o+1]:null,{type:g}=Ge(n,u);let i=null;if(this.state.reminderFilters==="claudeMd"&&Array.isArray(s.messages)){i=new Set,i.add(s.messages);for(const c of s.messages){if(!c||typeof c!="object")continue;const p=c.content;if(typeof p=="string")Bt(p)&&i.add(c);else if(Array.isArray(p)){let j=!1;for(const f of p)f&&f.type==="text"&&Bt(f.text)&&(i.add(f),j=!0);j&&(i.add(c),i.add(p))}}}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 p=c.content;if(typeof p=="string")Dt(p)&&h.add(c);else if(Array.isArray(p)){let j=!1;for(const f of p)f&&f.type==="text"&&Dt(f.text)&&(h.add(f),j=!0);j&&(h.add(c),h.add(p))}}}const l=i||h;if(g==="Preflight"){const c=new Set,p=j=>{j&&typeof j=="object"&&(c.add(j),Array.isArray(j)?j.forEach(p):Object.values(j).forEach(p))};return Array.isArray(s.messages)&&p(s.messages),Array.isArray(s.system)&&s.system.length>=3&&p(s.system[2]),(j,f,x)=>!!(j<2||c.has(f)||l&&l.has(f)||j===1&&x==="system")}if(g==="MainAgent"&&Array.isArray(s.messages)&&s.messages.length===1){const c=s.messages[0],p=c&&Array.isArray(c.content)?c.content:null,j=p&&p.length>0?p[p.length-1]:null,f=new Set,x=y=>{y&&typeof y=="object"&&(f.add(y),Array.isArray(y)?y.forEach(x):Object.values(y).forEach(x))};return j&&x(j),f.add(s.messages),c&&typeof c=="object"&&f.add(c),p&&f.add(p),(y,C,k)=>!!(y<2||f.has(C)||l&&l.has(C))}if(l)return(c,p,j)=>!!(c<2||l.has(p))}renderBody(s,t){const{bodyViewMode:n}=this.state;if(s==null)return e.jsx(fe,{type:"secondary",children:m("ui.noBody")});if(typeof s=="string"&&s.includes("Streaming Response"))return e.jsx("div",{className:_.streamingBox,children:e.jsx(fe,{type:"secondary",children:m("ui.streamingResponse")})});const r=typeof s=="object"?mt(s):s,o=n[t]==="json",u=this.getRequestExpandNode(r,t);return e.jsx("div",{children:o?e.jsx(lt,{data:r,defaultExpand:t==="response"?"all":"root",expandNode:u}):e.jsx("pre",{className:_.rawTextPre,children:typeof r=="string"?r:JSON.stringify(r,null,2)})})}getPrevMainAgentRequest(){const{requests:s,selectedIndex:t}=this.props;if(!s||t==null)return null;for(let n=t-1;n>=0;n--)if(Te(s[n])){const r=s[n];return r._slimmed?Ot(r,this.props.allRequests||s):r}return null}computeDiff(s,t){if(s==null||t==null||typeof s!="object"||typeof t!="object")return null;const n={},r=new Set([...Object.keys(s),...Object.keys(t)]);for(const o of r)if(!o.startsWith("_"))if(!(o in s))n[o]=t[o];else if(o in t){const u=JSON.stringify(s[o]),g=JSON.stringify(t[o]);u!==g&&(o==="messages"&&Array.isArray(s[o])&&Array.isArray(t[o])&&t[o].length>s[o].length?n[o]=t[o].slice(s[o].length):n[o]=t[o])}else continue;return Object.keys(n).length?n:null}render(){var p,j,f;let{request:s,currentTab:t,onTabChange:n}=this.props;if(!s)return e.jsx("div",{className:_.emptyState,children:e.jsx(Ae,{description:"选择一个请求查看详情"})});s._slimmed&&(s=Ot(s,this.props.allRequests||this.props.requests));const r=new Date(s.timestamp).toLocaleString("zh-CN"),o=s.response&&s.response.status<400;let u=null;if(Te(s)){const x=this.getPrevMainAgentRequest();if(x){const y=JSON.stringify(s.body).length,C=JSON.stringify(x.body).length;if(y<C)u=e.jsxs("div",{className:_.diffSection,children:[e.jsxs(fe,{strong:!0,className:_.diffToggle,onClick:()=>this.setState(N=>({diffExpanded:!N.diffExpanded})),children:["Body Diff JSON ",e.jsx(re,{doc:"BodyDiffJSON"})," ",this.state.diffExpanded?e.jsx(Be,{className:_.diffIcon}):e.jsx(De,{className:_.diffIcon})]}),this.state.diffExpanded&&e.jsx(fe,{type:"secondary",children:m("ui.diffSessionChanged")})]});else{const N=mt(this.computeDiff(x.body,s.body));N&&(this._lastDiffResult=N,u=e.jsxs("div",{className:_.diffSection,children:[e.jsxs("div",{className:_.diffHeaderRow,children:[e.jsxs(fe,{strong:!0,className:_.diffToggle,onClick:()=>this.setState(b=>({diffExpanded:!b.diffExpanded})),children:["Body Diff JSON ",e.jsx(re,{doc:"BodyDiffJSON"})," ",this.state.diffExpanded?e.jsx(Be,{className:_.diffIcon}):e.jsx(De,{className:_.diffIcon})]}),this.state.diffExpanded&&e.jsxs(qe,{size:"small",className:_.diffSpaceRight,children:[e.jsx(H,{size:"small",icon:this.state.bodyViewMode.diff==="json"?e.jsx(et,{}):e.jsx(tt,{}),onClick:()=>this.toggleBodyViewMode("diff"),children:this.state.bodyViewMode.diff==="json"?"Text":"JSON"}),e.jsx(H,{size:"small",icon:e.jsx(Ve,{}),onClick:()=>this.copyBody("diff"),children:m("ui.copy")})]})]}),this.state.diffExpanded&&e.jsx(e.Fragment,{children:this.state.bodyViewMode.diff==="json"?e.jsx(lt,{data:N,defaultExpand:"all"}):e.jsx("pre",{className:_.rawTextPre,children:JSON.stringify(N,null,2)})})]}))}}}const g=Ma(s.body),i=Ea(s.body),h=[{key:"request",label:"Request",children:e.jsxs("div",{className:_.tabContent,children:[e.jsxs("div",{className:_.diffSection,children:[e.jsxs(fe,{strong:!0,className:_.diffToggle,onClick:()=>this.setState(x=>({requestHeadersExpanded:!x.requestHeadersExpanded})),children:["Headers ",this.state.requestHeadersExpanded?e.jsx(Be,{className:_.diffIcon}):e.jsx(De,{className:_.diffIcon})]}),this.state.requestHeadersExpanded&&this.renderHeaders(s.headers)]}),u,e.jsxs("div",{children:[e.jsxs("div",{className:_.bodyHeader,children:[e.jsxs(fe,{strong:!0,className:_.bodyLabel,children:["Body",e.jsx(re,{doc:"BodyFields"})]}),e.jsxs(qe,{size:"small",children:[(g||i)&&e.jsxs("span",{className:_.reminderFilterWrapper,children:[e.jsx("span",{className:_.reminderLabel,children:"system-reminder:"}),e.jsx(Le,{size:"small",className:_.reminderSelect,placeholder:"filter",value:this.state.reminderFilters||void 0,onChange:x=>this.setState({reminderFilters:x||null}),options:[{label:"CLAUDE.md",value:"claudeMd",disabled:!g},{label:"Skills",value:"skills",disabled:!i}],popupMatchSelectWidth:!1,allowClear:!0})]}),e.jsx(H,{size:"small",icon:this.state.bodyViewMode.request==="json"?e.jsx(et,{}):e.jsx(tt,{}),onClick:()=>this.toggleBodyViewMode("request"),children:this.state.bodyViewMode.request==="json"?"Text":"JSON"}),e.jsx(H,{size:"small",icon:e.jsx(Ve,{}),onClick:()=>this.copyBody("request"),children:m("ui.copy")})]})]}),this.renderBody(s.body,"request")]})]})},{key:"response",label:"Response",children:e.jsx("div",{className:_.tabContent,children:s.response?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:_.diffSection,children:[e.jsxs(fe,{strong:!0,className:_.diffToggle,onClick:()=>this.setState(x=>({responseHeadersExpanded:!x.responseHeadersExpanded})),children:["Headers ",this.state.responseHeadersExpanded?e.jsx(Be,{className:_.diffIcon}):e.jsx(De,{className:_.diffIcon})]}),this.state.responseHeadersExpanded&&this.renderHeaders(s.response.headers)]}),e.jsxs("div",{children:[e.jsxs("div",{className:_.bodyHeader,children:[e.jsxs(fe,{strong:!0,className:_.bodyLabel,children:["Body",e.jsx(re,{doc:"ResponseFields"})]}),e.jsxs(qe,{size:"small",children:[e.jsx(H,{size:"small",icon:this.state.bodyViewMode.response==="json"?e.jsx(et,{}):e.jsx(tt,{}),onClick:()=>this.toggleBodyViewMode("response"),children:this.state.bodyViewMode.response==="json"?"Text":"JSON"}),e.jsx(H,{size:"small",icon:e.jsx(Ve,{}),onClick:()=>this.copyBody("response"),children:m("ui.copy")})]})]}),this.renderBody(s.response.body,"response")]})]}):e.jsx(Ae,{description:m("ui.responseNotCaptured")})})},{key:"kv-cache-text",label:e.jsxs("span",{children:["KV-Cache-Text ",e.jsx(re,{doc:"KVCacheContent"})]}),children:e.jsx("div",{className:`${_.tabContent} ${_.cacheTabContent}`,children:(()=>{const x=as([s]),y=s.timestamp+"|"+s.url;if(x&&(x.cacheCreateTokens>0||x.cacheReadTokens>0)&&(this._lastCachedTokensKey=y,this._lastCachedTokens={cacheCreateTokens:x.cacheCreateTokens,cacheReadTokens:x.cacheReadTokens}),!x||x.system.length===0&&x.messages.length===0&&x.tools.length===0)return e.jsx(Ae,{description:m("ui.noCachedContent"),image:Ae.PRESENTED_IMAGE_SIMPLE});const C=()=>{const b=[];return x.tools.length>0&&(b.push(`=== ${m("ui.tools")} ===`),x.tools.forEach(M=>b.push(M))),x.system.length>0&&(b.push(`
34
+ === ${m("ui.systemPrompt")} ===`),x.system.forEach(M=>b.push(M))),x.messages.length>0&&(b.push(`
35
+ === ${m("ui.messages")} ===`),x.messages.forEach(M=>b.push(M))),b.join(`
36
+
37
+ `)},k=x.messages.map((b,M)=>({text:b,msgIdx:M})).filter(({text:b})=>b.startsWith("[user]")).map(({text:b,msgIdx:M})=>{const E=b.replace(/^\[user\]\s*/,"").trim();return!E||Ke(E)?{cleaned:"",msgIdx:M}:{cleaned:ot.parseSegments(E).filter(T=>T.type==="text").map(T=>T.content.trim()).filter(T=>T&&!Ke(T)).join(" ").trim(),msgIdx:M}}).filter(({cleaned:b})=>!(!b||/Implement the following plan:/i.test(b))),N=k.length>0?e.jsx("div",{className:_.userPromptList,children:k.map(({cleaned:b,msgIdx:M})=>e.jsx("div",{className:_.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(M),children:b},M))}):null;return e.jsxs("div",{className:_.cacheContent,children:[(()=>{const M=x.cacheCreateTokens>0||x.cacheReadTokens>0?x:this._lastCachedTokensKey===y?this._lastCachedTokens:null;return M||N?e.jsxs("div",{className:_.cacheTokenBar,children:[M&&e.jsxs(e.Fragment,{children:[m("ui.tokens"),": ",e.jsxs("span",{className:_.cacheTokenWrite,children:["write ",G(M.cacheCreateTokens)]})," / ",e.jsxs("span",{className:_.cacheTokenRead,children:["read ",G(M.cacheReadTokens)]}),e.jsx(ls,{title:m("ui.copyAllCacheText"),children:e.jsx(Ve,{className:_.cacheCopyIcon,onClick:()=>{navigator.clipboard.writeText(C()).then(()=>{J.success(m("ui.copied"))}).catch(()=>{})}})})]}),N&&e.jsx(ze,{content:N,trigger:"hover",placement:"left",children:e.jsx("span",{className:_.userPromptNavBtn,children:m("ui.userPromptNav")})})]}):null})(),e.jsxs("div",{className:_.cacheScrollArea,ref:b=>{this._cacheScrollEl=b},children:[x.tools.length>0&&e.jsxs("div",{className:_.cacheSectionBlock,children:[e.jsxs("div",{className:_.cacheSectionHeader,onClick:()=>this.setState(b=>({cacheCollapsed:{...b.cacheCollapsed,tools:!b.cacheCollapsed.tools}})),children:[e.jsx("span",{className:_.cacheCollapseArrow,style:{transform:this.state.cacheCollapsed.tools?"rotate(-90deg)":"rotate(0deg)"},children:"▼"}),m("ui.tools")," (",x.tools.length,")"]}),!this.state.cacheCollapsed.tools&&x.tools.map((b,M)=>e.jsx("pre",{className:_.cachePre,children:b},M))]}),x.system.length>0&&e.jsxs("div",{className:_.cacheSectionBlock,children:[e.jsxs("div",{className:_.cacheSectionHeader,onClick:()=>this.setState(b=>({cacheCollapsed:{...b.cacheCollapsed,system:!b.cacheCollapsed.system}})),children:[e.jsx("span",{className:_.cacheCollapseArrow,style:{transform:this.state.cacheCollapsed.system?"rotate(-90deg)":"rotate(0deg)"},children:"▼"}),m("ui.systemPrompt")," (",x.system.length,")"]}),!this.state.cacheCollapsed.system&&x.system.map((b,M)=>e.jsx("pre",{className:_.cachePreSystem,children:b},M))]}),x.messages.length>0&&e.jsxs("div",{className:_.cacheSectionBlock,children:[e.jsxs("div",{className:_.cacheSectionHeader,onClick:()=>this.setState(b=>({cacheCollapsed:{...b.cacheCollapsed,messages:!b.cacheCollapsed.messages}})),children:[e.jsx("span",{className:_.cacheCollapseArrow,style:{transform:this.state.cacheCollapsed.messages?"rotate(-90deg)":"rotate(0deg)"},children:"▼"}),m("ui.messages")," (",x.messages.length,")"]}),!this.state.cacheCollapsed.messages&&x.messages.map((b,M)=>{const E=M===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":M,className:_.cachePre,style:L,children:[E&&e.jsx("svg",{className:_.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]},M)})]})]})]})})()})},{key:"context",label:"Context",children:e.jsx("div",{className:`${_.tabContent} ${_.cacheTabContent}`,children:e.jsx(Gi,{body:s.body,response:(p=s.response)==null?void 0:p.body})})}],l=(f=(j=s.response)==null?void 0:j.body)==null?void 0:f.usage,c=l?(()=>{const x=l.input_tokens||0,y=l.output_tokens||0,C=l.cache_creation_input_tokens||0,k=l.cache_read_input_tokens||0,N=x+C+k,b=N>0?(k/N*100).toFixed(1):"0.0";return{input:x,output:y,cacheCreate:C,cacheRead:k,hitRate:b}})():null;return e.jsxs("div",{className:_.container,children:[e.jsxs("div",{className:_.urlSection,children:[e.jsxs("div",{className:_.urlLeft,children:[e.jsx(Vl,{className:_.urlText,ellipsis:{rows:2,expandable:!0},children:s.url}),e.jsxs(qe,{size:"small",wrap:!0,children:[e.jsx(je,{color:s.method==="POST"?"blue":"green",children:s.method}),e.jsxs(fe,{type:"secondary",className:_.metaText,children:["🕐 ",r]}),s.duration&&e.jsxs(fe,{type:"secondary",className:_.metaText,children:["⏱️ ",s.duration,"ms"]}),s.response&&e.jsxs(je,{color:o?"success":"error",children:["HTTP ",s.response.status]})]})]}),c&&e.jsx("div",{className:_.tokenStatsBox,children:e.jsxs("div",{className:_.tokenGrid,children:[e.jsxs("div",{className:_.tokenRows,children:[e.jsxs("div",{className:_.tokenRow,children:[e.jsx("span",{className:_.tokenLabel,children:"Token"}),e.jsxs("span",{className:_.tokenTd,children:["input: ",G(c.input)]}),e.jsxs("span",{className:_.tokenTd,children:["output: ",G(c.output)]})]}),e.jsxs("div",{className:`${_.tokenRow} ${_.tokenRowBorder}`,children:[e.jsx("span",{className:_.tokenLabel,children:"Cache"}),e.jsxs("span",{className:_.tokenTd,children:["create: ",G(c.cacheCreate)]}),e.jsxs("span",{className:_.tokenTd,children:["read: ",G(c.cacheRead)]})]})]}),e.jsxs("div",{className:_.tokenHitRate,children:[e.jsxs("div",{children:[c.hitRate,"%"]}),e.jsx("div",{className:_.tokenHitRateLabel,children:m("ui.hitRate")})]})]})})]}),e.jsx(os,{activeKey:t,onChange:n,items:h,size:"small"})]})}}const Ul="_resizer_pzn4b_1",Wl={resizer:Ul};class Kl 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:Wl.resizer})}}class Zl extends Ia{constructor(t){super(t);O(this,"handleViewRequest",t=>{this.setState({viewMode:"raw",selectedIndex:t,scrollCenter:!0})});O(this,"handleViewInChat",()=>{this.setState(t=>{const r=(t.showAll?t.requests:Xe(t.requests))[t.selectedIndex];if(!r)return null;let o=null;if(Te(r)&&r.timestamp)o=r.timestamp;else{const u=Ge(r);if((u.type==="SubAgent"||u.type==="Teammate")&&r.timestamp)o=r.timestamp;else{const g=t.requests.indexOf(r);g>=0&&(o=$t(t.requests,g))}o||J.info(m("ui.cannotMap"))}return{viewMode:"chat",chatScrollToTs:o}})});O(this,"handleToggleViewMode",()=>{this.setState(t=>{const n=t.viewMode==="raw"?"chat":"raw";if(n==="raw"){if(t.selectedIndex===null){const u=t.showAll?t.requests:Xe(t.requests);return{viewMode:n,selectedIndex:u.length>0?u.length-1:null,scrollCenter:!0}}return{viewMode:n,scrollCenter:!0}}const r=t.showAll?t.requests:Xe(t.requests),o=t.selectedIndex!=null?r[t.selectedIndex]:null;if(o){let u=null;if(Te(o)&&o.timestamp)u=o.timestamp;else{const g=Ge(o);if((g.type==="SubAgent"||g.type==="Teammate")&&o.timestamp)u=o.timestamp;else{const i=t.requests.indexOf(o);i>=0&&(u=$t(t.requests,i)),u||J.info(m("ui.cannotMap"))}}return{viewMode:n,chatScrollToTs:u}}return{viewMode:n,chatScrollToTs:null}},()=>{this.state.viewMode==="chat"&&this.state.terminalVisible&&this.state.cliMode&&!Os&&requestAnimationFrame(()=>{const t=document.querySelector(".xterm-helper-textarea");t&&t.focus()})})});O(this,"handleTabChange",t=>{this.setState({currentTab:t})});O(this,"handleCacheHighlightDone",()=>{this.setState({pendingCacheHighlight:null})});O(this,"handleNavigateCacheMsg",t=>{const n=this.state.showAll?this.state.requests:Xe(this.state.requests);let r=-1;for(let o=n.length-1;o>=0;o--)if(Te(n[o])){r=o;break}r<0||this.setState({selectedIndex:r,scrollCenter:!0,currentTab:"kv-cache-text",pendingCacheHighlight:{msgIdx:t,key:Date.now()}})});O(this,"handleResize",t=>{const n=this.mainContainerRef.current;if(!n)return;const r=n.getBoundingClientRect(),o=t-r.left;o>=250&&o<=800&&this.setState({leftPanelWidth:o})});O(this,"handleLoadLocalJsonlFile",()=>{const t=document.createElement("input");t.type="file",t.accept=".jsonl",t.multiple=!0,t.onchange=n=>{const r=Array.from(n.target.files);if(r.length===0)return;if(r.reduce((h,l)=>h+l.size,0)>500*1024*1024){J.error(m("ui.fileTooLarge"));return}this.setState({fileLoading:!0,fileLoadingCount:0});let u=0;const g=[],i=[];r.forEach(h=>{const l=new FileReader;l.onload=c=>{try{const j=c.target.result.split(`
38
+ ---
39
+ `).filter(f=>f.trim()).map(f=>{try{return JSON.parse(f)}catch{return null}}).filter(Boolean);g.push(...j),i.push(h.name)}catch{}u++,u===r.length&&this._finishLocalLoad(g,i)},l.readAsText(h)})},t.click()});O(this,"_processJsonlFiles",t=>{if(!t||t.length===0)return;if(t.reduce((g,i)=>g+i.size,0)>500*1024*1024){J.error(m("ui.fileTooLarge"));return}this.setState({fileLoading:!0,fileLoadingCount:0});let r=0;const o=[],u=[];t.forEach(g=>{const i=new FileReader;i.onload=h=>{try{const c=h.target.result.split(`
40
+ ---
41
+ `).filter(p=>p.trim()).map(p=>{try{return JSON.parse(p)}catch{return null}}).filter(Boolean);o.push(...c),u.push(g.name)}catch{}r++,r===t.length&&this._finishLocalLoad(o,u)},i.readAsText(g)})});O(this,"_isInternalDrag",t=>t.dataTransfer.types.includes("text/x-preset-reorder"));O(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})});O(this,"_onDragLeave",t=>{const n=this._layoutRef.current;n&&!n.contains(t.relatedTarget)&&this.setState({isDragging:!1})});O(this,"_onDrop",t=>{if(t.preventDefault(),this._isInternalDrag(t))return;this.setState({isDragging:!1});const n=Array.from(t.dataTransfer.files);n.length&&Promise.all(n.map(r=>Ra(r).then(o=>({name:r.name,path:o})).catch(o=>(J.error(`${r.name}: ${o.message}`),null)))).then(r=>{const o=r.filter(Boolean).map(u=>`"${u.path}"`);o.length>0&&this.setState(u=>({pendingUploadPaths:[...u.pendingUploadPaths||[],...o]}))})});O(this,"handleUploadPathsConsumed",()=>{this.setState({pendingUploadPaths:[]})});Object.assign(this.state,{leftPanelWidth:380,terminalVisible:!0,currentTab:"context",pendingCacheHighlight:null})}render(){const{filteredRequests:t,selectedRequest:n,fileLoading:r,fileLoadingCount:o,mainAgentSessions:u,viewMode:g}=this.renderPrepare(),{selectedIndex:i,leftPanelWidth:h,currentTab:l}=this.state;return this.state.workspaceMode?this.renderWorkspaceMode():e.jsxs(La,{theme:this.themeConfig,children:[r&&e.jsx("div",{className:I.loadingOverlay,children:e.jsxs("div",{className:I.loadingText,children:["Loading...(",o,")"]})}),this.state.isDragging&&e.jsx("div",{className:I.dragOverlay,children:e.jsxs("div",{className:I.dragOverlayContent,children:[e.jsx(Qt,{className:I.dragIcon}),e.jsx("p",{children:m("ui.dragDropHint")})]})}),e.jsxs(Ie,{className:I.layout,ref:this._layoutRef,onDragOver:this._onDragOver,onDragLeave:this._onDragLeave,onDrop:this._onDrop,children:[e.jsx(Ie.Header,{className:I.header,children:e.jsx(ot,{requestCount:t.length,requests:t,viewMode:g,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})}),this.state.claudeMissing&&e.jsx(hs,{type:"warning",showIcon:!0,banner:!0,message:m("ui.claudeMissing.title"),description:e.jsxs("span",{children:[m("ui.claudeMissing.desc"),e.jsx("br",{}),e.jsx("code",{style:{background:"var(--bg-code)",padding:"2px 6px",borderRadius:3},children:"npm install -g @anthropic-ai/claude-code"})," ",e.jsx("span",{style:{color:"var(--text-muted)",margin:"0 4px"},children:m("ui.claudeMissing.or")})," ",e.jsx("a",{href:"https://claude.ai/download",target:"_blank",rel:"noopener noreferrer",style:{color:"var(--color-primary-light)"},children:m("ui.claudeMissing.native")})]})}),e.jsxs(Ie.Content,{className:I.content,children:[g==="raw"&&(t.length===0?e.jsx("div",{className:I.guideContainer,children:e.jsxs("div",{className:I.guideContent,children:[e.jsx("h2",{className:I.guideTitle,children:m("ui.guide.title")}),e.jsxs("div",{className:I.guideStep,children:[e.jsx("div",{className:I.guideStepNum,children:"1"}),e.jsxs("div",{className:I.guideStepBody,children:[e.jsx("p",{className:I.guideText,children:m("ui.guide.step1")}),e.jsx("code",{className:I.guideCode,children:m("ui.guide.exampleQuestion")})]})]}),e.jsxs("div",{className:I.guideStep,children:[e.jsx("div",{className:I.guideStepNum,children:"2"}),e.jsxs("div",{className:I.guideStepBody,children:[e.jsx("p",{className:I.guideText,children:m("ui.guide.step2")}),e.jsx("code",{className:I.guideCode,children:m("ui.guide.troubleshootCmd")})]})]}),e.jsxs("div",{className:I.guideStep,children:[e.jsx("div",{className:I.guideStepNum,children:"3"}),e.jsxs("div",{className:I.guideStepBody,children:[e.jsx("p",{className:I.guideText,children:m("ui.guide.step3")}),e.jsx("code",{className:I.guideCode,children:"npm install -g @anthropic-ai/claude-code"})]})]})]})}):e.jsxs("div",{ref:this.mainContainerRef,className:I.mainContainer,children:[e.jsxs("div",{className:I.leftPanel,style:{width:h},children:[e.jsxs("div",{className:I.leftPanelHeader,children:[e.jsx("span",{children:m("ui.requestList")}),e.jsx("span",{className:I.leftPanelCount,children:m("ui.totalRequests",{count:t.length})})]}),e.jsx("div",{className:I.leftPanelBody,children:e.jsx(Co,{requests:t,selectedIndex:i,scrollCenter:this.state.scrollCenter,onSelect:this.handleSelectRequest,onScrollDone:this.handleScrollDone,cacheLossMap:this._cacheLossMap})})]}),e.jsx(Kl,{onResize:this.handleResize}),e.jsx("div",{className:I.rightPanel,children:e.jsx(ql,{request:n,requests:t,allRequests:this.state.requests,selectedIndex:i,currentTab:l,onTabChange:this.handleTabChange,onViewInChat:this.handleViewInChat,expandDiff:this.state.expandDiff,pendingCacheHighlight:this.state.pendingCacheHighlight,onCacheHighlightDone:this.handleCacheHighlightDone})})]})),e.jsx("div",{className:I.chatViewWrapper,style:{display:g==="chat"?"flex":"none"},children:e.jsx(Pa,{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:I.footer,children:e.jsxs("div",{className:I.footerRight,children:[e.jsxs("a",{href:"https://github.com/weiesky/cc-viewer",target:"_blank",rel:"noopener noreferrer",className:I.footerLink,children:[e.jsx("svg",{className:I.footerIcon,viewBox:"0 0 16 16",fill:"currentColor",children:e.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"})}),"GitHub",this.state.githubStars!=null?` ★ ${this.state.githubStars}`:""]}),e.jsx("span",{className:I.footerSep,children:"|"}),e.jsxs("span",{className:`${I.footerVersion}${this.state.updateInfo?` ${I.footerVersionNew}`:""}`,onClick:()=>this.setState({updateModalVisible:!0}),style:{cursor:"pointer"},children:["v","1.6.133",this.state.updateInfo&&e.jsxs("svg",{className:I.newBadge,width:"28",height:"12",viewBox:"0 0 28 12",children:[e.jsx("rect",{width:"28",height:"12",rx:"3",fill:"currentColor",opacity:"0.25"}),e.jsx("text",{x:"14",y:"9",textAnchor:"middle",fill:"currentColor",fontSize:"8",fontWeight:"600",fontFamily:"system-ui",children:"NEW"})]})]})]})})]}),e.jsx(_e,{title:m("ui.update.title"),open:this.state.updateModalVisible,onCancel:()=>this.setState({updateModalVisible:!1}),footer:null,width:480,children:e.jsxs("div",{style:{lineHeight:1.8},children:[e.jsxs("p",{children:[e.jsxs("strong",{children:[m("ui.update.current"),":"]})," v","1.6.133"]}),this.state.updateInfo&&e.jsxs("p",{children:[e.jsxs("strong",{children:[m("ui.update.latest"),":"]})," v",this.state.updateInfo.version]}),e.jsx("p",{style:{marginTop:12},children:e.jsx("strong",{children:m("ui.update.npm")})}),e.jsx("code",{style:{display:"block",background:"var(--bg-code)",padding:"8px 12px",borderRadius:6,fontSize:13},children:"npm update -g cc-viewer"}),typeof window<"u"&&window.electronAPI&&e.jsxs(e.Fragment,{children:[e.jsx("p",{style:{marginTop:16},children:e.jsx("strong",{children:m("ui.update.electron")})}),e.jsx("p",{style:{color:"var(--text-tertiary)",fontSize:13},children:m("ui.update.electronDesc")}),e.jsxs("ol",{style:{color:"var(--text-tertiary)",fontSize:13,paddingLeft:20,margin:"6px 0"},children:[e.jsx("li",{children:m("ui.update.step1")}),e.jsx("li",{children:m("ui.update.step2")}),e.jsx("li",{children:m("ui.update.step3")})]})]}),e.jsx("div",{style:{marginTop:16,textAlign:"right"},children:e.jsx(H,{type:"primary",href:"https://github.com/weiesky/cc-viewer/releases",target:"_blank",rel:"noopener noreferrer",children:m("ui.update.goReleases")})})]})}),e.jsx(_e,{title:m("ui.resume.title"),open:this.state.resumeModalVisible,closable:!1,maskClosable:!1,keyboard:!1,footer:e.jsxs("div",{children:[e.jsxs("div",{className:I.resumeFooterRight,children:[e.jsx(H,{type:"primary",onClick:()=>this.handleResumeChoice("continue"),className:I.btnMarginRight,children:m("ui.resume.continue")},"continue"),e.jsx(H,{onClick:()=>this.handleResumeChoice("new"),children:m("ui.resume.new")},"new")]}),e.jsx("div",{className:I.resumeFooterLeft,children:e.jsx(Aa,{checked:this.state.resumeRememberChoice,onChange:c=>this.setState({resumeRememberChoice:c.target.checked}),className:I.resumeCheckboxOpacity,children:e.jsx("span",{className:I.resumeCheckboxOpacity,children:m("ui.resume.remember")})})})]}),children:e.jsx("p",{children:m("ui.resume.message",{file:this.state.resumeFileName})})}),e.jsxs(_e,{title:e.jsxs("span",{className:I.modalTitleInline,children:[e.jsx(is,{apiEndpoint:ue("/api/open-log-dir"),title:m("ui.openLogDir"),size:16}),m("ui.importLocalLogs")]}),open:this.state.importModalVisible,onCancel:this.handleCloseImportModal,footer:null,width:1e3,styles:{body:{overflow:"hidden"}},children:[e.jsxs("div",{className:I.modalActions,children:[e.jsx(H,{icon:e.jsx(Qt,{}),onClick:this.handleLoadLocalJsonlFile,children:m("ui.loadLocalJsonl")}),e.jsx(H,{size:"small",type:this.state.selectedLogs.size>1?"primary":"default",disabled:this.state.selectedLogs.size<2,onClick:this.handleMergeLogs,className:I.btnMarginLeft,children:m("ui.mergeLogs")}),e.jsx(H,{size:"small",danger:!0,icon:e.jsx(vt,{}),disabled:this.state.selectedLogs.size===0,onClick:this.handleDeleteLogs,className:I.btnMarginLeft,children:m("ui.deleteLogs")}),e.jsx(H,{size:"small",icon:e.jsx(yt,{spin:this.state.refreshingStats}),loading:this.state.refreshingStats,onClick:this.handleRefreshStats,className:I.btnMarginLeft,children:m("ui.refreshStats")})]}),this.state.localLogsLoading?e.jsx("div",{className:I.spinCenter,children:e.jsx(ns,{})}):(()=>{const c=this.state.localLogs[this.state.currentProject];return!c||c.length===0?e.jsx("div",{className:I.emptyCenter,children:m("ui.noLogs")}):e.jsx("div",{className:I.logListContainer,children:this.renderLogTable(c,!1)})})()]})]})}}export{Zl as default};
@@ -0,0 +1 @@
1
+ ._centerEmpty_midza_1{display:flex;align-items:center;justify-content:center;height:100%}._scrollContainer_midza_8{overflow:auto;height:100%;-webkit-overflow-scrolling:touch;will-change:scroll-position}._listItem_midza_15{cursor:pointer;padding:8px 12px;border-left:6px solid transparent;border-right:1px solid var(--border-primary);border-top:1px solid transparent;border-bottom:1px solid var(--border-primary);transition:background .15s}._listItem_midza_15:hover{border-left-color:var(--border-hover)}._listItemActive_midza_29{background:var(--color-primary-bg-faint);border-left-color:var(--color-primary-light);border-right:1px solid var(--color-primary-light);border-top:1px solid var(--color-primary-light);border-bottom:1px solid var(--color-primary-light)}._listItemActive_midza_29,._listItemActive_midza_29:hover{background:var(--color-primary-bg-faint);border-left-color:var(--color-primary-light);border-right-color:var(--color-primary-light);border-top-color:var(--color-primary-light);border-bottom-color:var(--color-primary-light)}._itemContent_midza_46{width:100%;min-width:0}._itemHeader_midza_51{display:flex;align-items:center;gap:6px;margin-bottom:4px;font-size:12px}._tagNoMargin_midza_59{margin:0;font-size:12px}._modelName_midza_64{font-size:12px;color:var(--text-tertiary)}._modelNameMain_midza_69{color:var(--color-code-orange)}._time_midza_73{font-size:12px;color:var(--text-gray);margin-left:auto}._detailRow_midza_79{display:flex;gap:8px;font-size:12px;align-items:center}._urlText_midza_86{color:var(--text-disabled);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0}._duration_midza_95{color:var(--text-gray);flex-shrink:0}._statusOk_midza_100{color:var(--color-success);opacity:.5;flex-shrink:0}._statusErr_midza_106{color:var(--color-error);flex-shrink:0}._statusDefault_midza_111{color:var(--text-tertiary);flex-shrink:0}._usageBox_midza_116{background:var(--bg-container);border-radius:4px;padding:3px 6px;margin-top:4px;font-size:12px;color:var(--text-gray);line-height:1.6}._cacheDot_midza_126{display:inline-block;width:6px;height:6px;border-radius:50%;margin:0 3px;vertical-align:middle}._cacheDotLoss_midza_135{background-color:var(--color-red-dark-bg);cursor:help}._cacheDotNormal_midza_140{background-color:var(--border-hover)}._tagMainAgent_midza_144{color:var(--color-code-orange);border-color:var(--color-code-orange-border);background:var(--color-code-orange-bg)}._tagPlan_midza_150{color:var(--color-error-muted);border-color:var(--color-error-muted);background-color:var(--bg-base-pure)}._tagMuted_midza_156{color:var(--text-muted);border-color:var(--border-light);background-color:var(--bg-base-pure)}._tooltipPreLine_midza_162{white-space:pre-line}._GzYRV{line-height:1.2;white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word}._3eOF8{margin-right:5px;font-weight:700}._3eOF8+._3eOF8{margin-left:-5px}._1MFti{cursor:pointer}._f10Tu{font-size:1.2em;margin-right:5px;-webkit-user-select:none;-moz-user-select:none;user-select:none}._1UmXx:after{content:"▸"}._1LId0:after{content:"▾"}._1pNG9{margin-right:5px}._1pNG9:after{content:"...";font-size:.8em}._2IvMF{background:#eee}._2bkNM{margin:0;padding:0 10px}._1BXBN{margin:0;padding:0}._1MGIk{font-weight:600;margin-right:5px;color:#000}._3uHL6{color:#000}._2T6PJ,._1Gho6{color:#df113a}._vGjyY{color:#2a3f3c}._1bQdo{color:#0b75f5}._3zQKs{color:#469038}._1xvuR{color:#43413d}._oLqym,._2AXVT,._2KJWg{color:#000}._11RoI{background:#002b36}._17H2C,._3QHg2,._3fDAz{color:#fdf6e3}._2bSDX{font-weight:bolder;margin-right:5px;color:#fdf6e3}._gsbQL{color:#fdf6e3}._LaAZe,._GTKgm{color:#81b5ac}._Chy1W{color:#cb4b16}._2bveF{color:#d33682}._2vRm-{color:#ae81ff}._1prJR{color:#268bd2}._container_qeuid_1{background:var(--bg-container);border-radius:6px;border:1px solid var(--border-primary);padding:12px;font-size:13px;font-family:monospace;overflow:auto}._root_17dqd_1{display:flex;height:100%;min-height:0;gap:0}._sidebar_17dqd_9{width:220px;flex-shrink:0;border-right:1px solid var(--border-primary);overflow-y:auto;padding:4px 0;-webkit-overflow-scrolling:touch}._section_17dqd_18{-webkit-user-select:none;user-select:none}._sectionHeader_17dqd_22{display:flex;align-items:center;gap:6px;width:100%;padding:6px 10px;cursor:pointer;color:var(--text-primary);font-size:12px;font-weight:600;transition:background .15s;background:none;border:0;text-align:left;font:inherit}._sectionHeader_17dqd_22:hover{background:var(--overlay-light-faint)}._sectionHeader_17dqd_22:focus-visible{outline:1px solid var(--color-primary-outline);outline-offset:-1px}._arrow_17dqd_48{font-size:10px;color:var(--text-tertiary);flex-shrink:0}._sectionTitle_17dqd_54{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._sectionCount_17dqd_62{font-size:11px;color:var(--text-muted);background:var(--bg-elevated);border-radius:10px;padding:0 6px;line-height:18px}._sectionBody_17dqd_71{padding:2px 0}._historyToggle_17dqd_76{display:flex;align-items:center;gap:6px;width:100%;padding:4px 10px 4px 14px;cursor:pointer;color:var(--text-muted);font-size:11px;transition:color .15s,background .15s;background:none;border:0;text-align:left;font:inherit}._historyToggle_17dqd_76:hover{color:var(--text-tertiary);background:var(--overlay-light-faint)}._historyToggle_17dqd_76:focus-visible{outline:1px solid var(--color-primary-outline);outline-offset:-1px}._historyToggleLabel_17dqd_102{flex:1}._item_17dqd_107{display:flex;align-items:center;justify-content:space-between;width:100%;padding:4px 9px 4px 23px;font-size:12px;color:var(--text-tertiary);cursor:pointer;transition:background .15s,color .15s;background:none;border:1px solid transparent;border-radius:4px;box-sizing:border-box;text-align:left;font:inherit}._item_17dqd_107:hover{background:var(--overlay-light-faint);color:var(--text-primary)}._item_17dqd_107:focus-visible{outline:1px solid var(--color-primary-outline);outline-offset:-1px}._itemActive_17dqd_135,._itemActive_17dqd_135:hover{background:var(--color-primary-bg-faint);color:var(--color-primary);border-color:var(--color-primary-light)}._itemContent_17dqd_142{flex:1;min-width:0;overflow:hidden}._itemLabel_17dqd_148{font-family:monospace;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block}._itemSublabel_17dqd_156{font-size:10px;color:var(--text-disabled);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:1px}._itemTime_17dqd_165{font-size:9px;color:var(--text-disabled);flex-shrink:0;margin-left:4px;font-family:monospace}._content_17dqd_174{flex:1;min-width:0;overflow:auto;padding:12px 16px;-webkit-overflow-scrolling:touch}._contentEmpty_17dqd_182{height:100%;display:flex;align-items:center;justify-content:center}._contentInner_17dqd_189{padding-bottom:20px}._emptyWrap_17dqd_193{display:flex;align-items:center;justify-content:center;height:200px}._roleHeader_17dqd_201{display:flex;align-items:center;gap:8px;margin-bottom:8px;flex-wrap:nowrap}._roleBadge_17dqd_209{font-size:10px;font-weight:600;letter-spacing:.04em;padding:2px 7px;border-radius:4px;flex-shrink:0}._role_user_17dqd_218{background:var(--color-primary-bg-lighter);color:var(--color-primary-lighter);border:1px solid var(--color-primary-bg-medium)}._role_assistant_17dqd_224{background:var(--color-purple-bg);color:var(--color-code-purple);border:1px solid var(--color-purple-border)}._roleLabel_17dqd_230{font-size:11px;color:var(--text-muted);flex:1;min-width:0}._contentTime_17dqd_237{margin-left:auto;font-size:10px;color:var(--text-disabled);font-family:monospace;flex-shrink:0}._turnDivider_17dqd_245{border:none;border-top:1px solid var(--border-primary);margin:14px 0}._textBlock_17dqd_252{margin-bottom:8px;border:1px solid var(--border-primary);border-radius:6px;overflow:hidden}._textBlockBar_17dqd_259{display:flex;align-items:center;gap:6px;padding:4px 10px;background:var(--bg-container);border-bottom:1px solid var(--border-primary)}._textBlockBody_17dqd_268{padding:10px 12px;font-size:13px;line-height:1.7;color:var(--text-primary);word-break:break-word}._textBlockCompact_17dqd_276{position:relative;padding:8px 10px;font-size:12px;color:var(--text-light)}._textBlockCompactFloat_17dqd_283{float:right;margin-left:6px;margin-bottom:2px}._thinkingBlock_17dqd_290{margin-bottom:8px;border:1px solid var(--color-thinking-border);border-radius:6px;overflow:hidden;background:var(--color-thinking-bg)}._thinkingHeader_17dqd_298{display:flex;align-items:center;gap:6px;padding:5px 10px;cursor:pointer;font-size:12px;color:var(--text-tertiary);transition:background .15s}._thinkingHeader_17dqd_298:hover{background:var(--overlay-light-faint)}._thinkingPreview_17dqd_313{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text-muted);font-size:11px}._thinkingBody_17dqd_323{padding:8px 12px;border-top:1px solid var(--color-thinking-border)}._toolBlock_17dqd_329{margin-bottom:8px;border:1px solid var(--border-primary);border-radius:6px;overflow:hidden}._toolBlockResult_17dqd_336{border-color:var(--color-green-border)}._toolBlockError_17dqd_340{border-color:var(--color-red-dark-border)}._toolBlockHeader_17dqd_344{display:flex;align-items:center;gap:8px;padding:5px 10px;background:var(--bg-container);border-bottom:1px solid var(--border-primary);font-size:12px;flex-wrap:wrap}._toolBlockBody_17dqd_355{padding:8px 10px;font-size:12px}._toolName_17dqd_360{color:var(--text-primary);font-weight:500;font-family:monospace}._toolId_17dqd_366{color:var(--text-disabled);font-size:10px;font-family:monospace;margin-left:auto}._errorLabel_17dqd_373{font-size:10px;color:var(--color-error-light);background:var(--color-error-bg-light);border:1px solid var(--color-error-border);border-radius:3px;padding:1px 5px}._blockTag_17dqd_383{font-size:9px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;padding:1px 5px;border-radius:3px;background:var(--bg-elevated);color:var(--text-muted);border:1px solid var(--border-primary);flex-shrink:0}._blockTagText_17dqd_396{background:var(--color-primary-bg-faint);color:var(--color-primary-lighter);border-color:var(--color-primary-bg-lighter)}._blockTagThinking_17dqd_402{background:var(--color-warning-bg-faint);color:var(--color-warning);border-color:var(--color-warning-border-light)}._blockTagResult_17dqd_408{background:var(--color-green-dark-bg);color:var(--color-success);border-color:var(--color-green-dark-border)}._blockTagError_17dqd_414{background:var(--color-error-bg-faint);color:var(--color-error-light);border-color:var(--color-error-border-light)}._jsonBlock_17dqd_421{margin-bottom:8px;border:1px solid var(--border-primary);border-radius:6px;overflow:hidden}._jsonBlockLabel_17dqd_428{font-size:10px;color:var(--text-muted);padding:3px 10px;background:var(--bg-container);border-bottom:1px solid var(--border-primary);font-family:monospace}._blockSeparator_17dqd_438{border:none;border-top:1px solid var(--border-primary);margin:16px 0}._markdownBody_17dqd_445{font-size:13px;line-height:1.7;color:var(--text-primary);word-break:break-word}._container_rg6mx_1{height:100%;overflow:hidden;padding:0 16px;display:flex;flex-direction:column;background:var(--bg-base)}._emptyState_rg6mx_10{display:flex;align-items:center;justify-content:center;height:100%}._urlSection_rg6mx_17{padding:12px 0;border-bottom:1px solid var(--border-primary);display:flex;align-items:flex-start;flex-shrink:0}._urlLeft_rg6mx_25{flex:1;min-width:0}._tokenStatsBox_rg6mx_30{flex-shrink:0;padding-left:12px;display:flex;align-items:center}._tokenGrid_rg6mx_37{display:flex;border:1px solid var(--border-secondary);border-radius:6px;overflow:hidden;min-width:360px;font-size:11px;line-height:1.6}._tokenRows_rg6mx_47{flex:1}._tokenRow_rg6mx_47{display:flex}._tokenRowBorder_rg6mx_55{border-top:1px solid var(--border-secondary)}._tokenLabel_rg6mx_59{color:var(--text-tertiary);padding:4px 8px;white-space:nowrap;font-weight:600}._tokenTd_rg6mx_66{flex:1;color:var(--text-primary);text-align:right;padding:4px 8px;font-family:monospace;white-space:nowrap}._tokenHitRate_rg6mx_75{display:flex;flex-direction:column;align-items:center;justify-content:center;color:var(--text-primary);padding:4px 8px;font-family:monospace;white-space:nowrap;border-left:1px solid var(--border-secondary);min-width:100px}._tokenHitRateLabel_rg6mx_88{color:var(--text-tertiary);font-size:10px;font-family:sans-serif}._tokenRowBorder_rg6mx_55 td{border-top:1px solid var(--border-secondary)}._urlText_rg6mx_98{color:var(--text-primary);font-size:13px;margin-bottom:8px;word-break:break-all}._metaText_rg6mx_105,._headersContainer_rg6mx_109{font-size:12px}._headerRow_rg6mx_113{display:flex;padding:4px 0;border-bottom:1px solid var(--border-primary)}._headerKey_rg6mx_119{min-width:200px;flex-shrink:0}._headerValue_rg6mx_124{word-break:break-all;margin-left:8px}._streamingBox_rg6mx_129{padding:20px;background:var(--bg-elevated);border-radius:6px;border:1px solid var(--border-primary)}._bodyToolbar_rg6mx_136{display:flex;gap:8px;margin-bottom:8px}._rawTextPre_rg6mx_142{background:var(--bg-code-dark);border:1px solid var(--border-primary);border-radius:6px;padding:12px;font-size:12px;color:var(--text-primary);overflow:auto;max-height:600px;white-space:pre-wrap;word-break:break-all}._tabContent_rg6mx_155{padding:16px 0 0;height:100%;overflow-y:auto;-webkit-overflow-scrolling:touch}._collapseSpacing_rg6mx_163{margin-bottom:16px}._bodyLabel_rg6mx_167{margin:0}._bodyHeader_rg6mx_171{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}._diffSection_rg6mx_178{margin-bottom:16px}._diffToggle_rg6mx_182{display:inline-block;margin-bottom:8px;cursor:pointer}._diffIcon_rg6mx_188{font-size:12px;margin-left:4px}._viewInChatBtn_rg6mx_193{display:inline-flex;align-items:center;height:26px;border-radius:13px;border:1px solid var(--border-light);background:#0000;color:var(--text-tertiary);cursor:pointer;font-size:12px;transition:all .2s;padding:0 10px;white-space:nowrap}._viewInChatBtn_rg6mx_193:hover{border-color:var(--text-muted);color:var(--text-primary);background:var(--overlay-light-faint)}._reminderSelect_rg6mx_214{min-width:140px;font-size:12px}._reminderSelect_rg6mx_214 .ant-select-selector.ant-select-selector{border-radius:2px;border-color:var(--border-light);background:#0000;min-height:26px;height:auto;padding:0 8px;font-family:monospace}._reminderSelect_rg6mx_214 .ant-select-selection-placeholder{font-size:11px}._diffHeaderRow_rg6mx_233{display:flex;align-items:center;gap:8px}._diffSpaceRight_rg6mx_239{margin-left:auto}._reminderFilterWrapper_rg6mx_243{display:inline-flex;align-items:center;gap:4px}._reminderLabel_rg6mx_249{color:var(--text-tertiary);font-size:12px;font-family:monospace}._cacheTabContent_rg6mx_255{padding-top:0;overflow:hidden}._userPromptList_rg6mx_260{width:600px;max-height:300px;overflow-y:auto}._userPromptItem_rg6mx_266{padding:4px 8px;font-size:12px;color:var(--text-secondary);cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;border-radius:3px}._userPromptNavBtn_rg6mx_277{margin-left:auto;font-size:11px;color:var(--color-primary);cursor:pointer;border:1px solid var(--color-primary);border-radius:3px;padding:1px 6px;white-space:nowrap}._cacheContent_rg6mx_288{padding:8px 0;height:100%;display:flex;flex-direction:column}._cacheTokenBar_rg6mx_295{display:flex;align-items:center;font-size:12px;font-family:monospace;color:var(--text-light);margin-bottom:12px;flex-shrink:0}._cacheTokenWrite_rg6mx_305{color:var(--color-code-orange)}._cacheTokenRead_rg6mx_309{color:var(--color-success)}._cacheCopyIcon_rg6mx_313{margin-left:8px;cursor:pointer;color:var(--text-tertiary);transition:color .2s}._cacheScrollArea_rg6mx_320{flex:1;overflow-y:auto;min-height:0}._cacheSectionBlock_rg6mx_326{margin-bottom:12px}._cacheSectionHeader_rg6mx_330{font-size:13px;font-weight:600;color:var(--text-primary);margin-bottom:6px;cursor:pointer;-webkit-user-select:none;user-select:none;display:flex;align-items:center;gap:4px}._cacheCollapseArrow_rg6mx_342{display:inline-block;transition:transform .2s;font-size:10px}._cachePre_rg6mx_348{white-space:pre-wrap;word-break:break-word;font-size:12px;line-height:1.5;color:var(--text-secondary);background:var(--bg-container);border:1px solid var(--border-primary);border-radius:4px;padding:8px;margin:4px 0;font-family:Menlo,Monaco,monospace}._cacheHighlightSvg_rg6mx_362{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;pointer-events:none;overflow:visible}._cachePreSystem_rg6mx_371{white-space:pre-wrap;word-break:break-word;font-size:12px;line-height:1.5;color:var(--text-secondary);background:var(--bg-code-system);border:1px solid var(--border-code-system);border-radius:4px;padding:8px;margin:4px 0;font-family:Menlo,Monaco,monospace}._container_rg6mx_1 .ant-tabs>.ant-tabs-nav{margin-bottom:0}._container_rg6mx_1 .ant-tabs{flex:1;min-height:0;display:flex;flex-direction:column}._container_rg6mx_1 .ant-tabs>.ant-tabs-content-holder{flex:1;min-height:0}._container_rg6mx_1 .ant-tabs-content,._container_rg6mx_1 .ant-tabs-tabpane-active{height:100%}._resizer_pzn4b_1{width:6px;cursor:col-resize;background:var(--bg-elevated);flex-shrink:0;transition:background .2s}._resizer_pzn4b_1:hover{background:var(--color-primary-light)}