cc-viewer 1.6.102 → 1.6.104
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{App-BJZlWGmj.js → App-BI4ZSHBT.js} +11 -11
- package/dist/assets/App-CIrOLEUO.css +1 -0
- package/dist/assets/AppHeader-D3YXOh2U.css +41 -0
- package/dist/assets/{AppHeader.module-Caq2Qxrw.js → AppHeader.module-DSfS8qzJ.js} +131 -131
- package/dist/assets/{Mobile-DqCug7io.js → Mobile-B_gmSQdN.js} +1 -1
- package/dist/assets/{_basePickBy-remei3ba.js → _basePickBy-Bp-w2YBt.js} +1 -1
- package/dist/assets/{_baseUniq-BzR_mhzV.js → _baseUniq-BgC-hGXS.js} +1 -1
- package/dist/assets/{arc-0FOCjzZT.js → arc-DpA3Har1.js} +1 -1
- package/dist/assets/{architectureDiagram-2XIMDMQ5-Ogy7tvC8.js → architectureDiagram-2XIMDMQ5-B39_m_tW.js} +1 -1
- package/dist/assets/{blockDiagram-WCTKOSBZ-DbBnGvs7.js → blockDiagram-WCTKOSBZ-BMziHST2.js} +1 -1
- package/dist/assets/{c4Diagram-IC4MRINW-DBedh471.js → c4Diagram-IC4MRINW-D8EXIR5N.js} +1 -1
- package/dist/assets/channel-BAesRgZz.js +1 -0
- package/dist/assets/{chunk-4BX2VUAB-nJy5_bZx.js → chunk-4BX2VUAB-CfjcoVgw.js} +1 -1
- package/dist/assets/{chunk-55IACEB6-iiSOyGXS.js → chunk-55IACEB6-DhZ0vs6G.js} +1 -1
- package/dist/assets/{chunk-FMBD7UC4-bdnTjRKU.js → chunk-FMBD7UC4-CqzGnGPL.js} +1 -1
- package/dist/assets/{chunk-JSJVCQXG-DgMz4OOF.js → chunk-JSJVCQXG-BFkcwou_.js} +1 -1
- package/dist/assets/{chunk-KX2RTZJC-Knw3cZ2u.js → chunk-KX2RTZJC-Bkh0D9lZ.js} +1 -1
- package/dist/assets/{chunk-NQ4KR5QH-BjdB1ZD2.js → chunk-NQ4KR5QH-BcR5uXM_.js} +1 -1
- package/dist/assets/{chunk-QZHKN3VN-D7fP7mL2.js → chunk-QZHKN3VN-DpPBWEW_.js} +1 -1
- package/dist/assets/{chunk-WL4C6EOR-B3oadh2E.js → chunk-WL4C6EOR-CRrRYVD5.js} +1 -1
- package/dist/assets/classDiagram-VBA2DB6C-Ds-5PZy_.js +1 -0
- package/dist/assets/classDiagram-v2-RAHNMMFH-Ds-5PZy_.js +1 -0
- package/dist/assets/clone-Bvt3Nl1I.js +1 -0
- package/dist/assets/{cose-bilkent-S5V4N54A-DTdOfP9G.js → cose-bilkent-S5V4N54A-ZwCmaIgi.js} +1 -1
- package/dist/assets/{dagre-KLK3FWXG-DPfan41V.js → dagre-KLK3FWXG-BXgBF5eQ.js} +1 -1
- package/dist/assets/{diagram-E7M64L7V-CtyCK-7l.js → diagram-E7M64L7V-P2UrWagc.js} +1 -1
- package/dist/assets/{diagram-IFDJBPK2-Bi_2gt8K.js → diagram-IFDJBPK2-y7B6XB_1.js} +1 -1
- package/dist/assets/{diagram-P4PSJMXO-BwxUnJmn.js → diagram-P4PSJMXO-B4iSqB2y.js} +1 -1
- package/dist/assets/{erDiagram-INFDFZHY-DNDeQ-Nf.js → erDiagram-INFDFZHY-C437WIfX.js} +1 -1
- package/dist/assets/{flowDiagram-PKNHOUZH-D5KLMAUo.js → flowDiagram-PKNHOUZH-DAxya1JH.js} +1 -1
- package/dist/assets/{ganttDiagram-A5KZAMGK-BLsAmIOB.js → ganttDiagram-A5KZAMGK-BKJOUENQ.js} +1 -1
- package/dist/assets/{gitGraphDiagram-K3NZZRJ6-ChAxH_PX.js → gitGraphDiagram-K3NZZRJ6-Ct3akNex.js} +1 -1
- package/dist/assets/{graph-DhhyK6hH.js → graph-D23QWBvV.js} +1 -1
- package/dist/assets/{index-M_rYsuaR.js → index-Bi9rchQE.js} +2 -2
- package/dist/assets/{infoDiagram-LFFYTUFH-BCfo96Mj.js → infoDiagram-LFFYTUFH-DENo7dwi.js} +1 -1
- package/dist/assets/{ishikawaDiagram-PHBUUO56-BXePTJDd.js → ishikawaDiagram-PHBUUO56-Dh3Oz0MB.js} +1 -1
- package/dist/assets/{journeyDiagram-4ABVD52K-CLZTTwf6.js → journeyDiagram-4ABVD52K-SnULbbq2.js} +1 -1
- package/dist/assets/{kanban-definition-K7BYSVSG-Re9f9dju.js → kanban-definition-K7BYSVSG-xD6DdmPL.js} +1 -1
- package/dist/assets/{layout-BTLcHmru.js → layout-DiNbInc6.js} +1 -1
- package/dist/assets/{linear-CymMsLim.js → linear-C-B_hH3J.js} +1 -1
- package/dist/assets/{mermaid.core-7o6dyao_.js → mermaid.core-0J135XB9.js} +4 -4
- package/dist/assets/{mindmap-definition-YRQLILUH-Dln-zrgf.js → mindmap-definition-YRQLILUH-Cfy-cyQ2.js} +1 -1
- package/dist/assets/{pieDiagram-SKSYHLDU-DssiF9sH.js → pieDiagram-SKSYHLDU-DG9JXtiO.js} +1 -1
- package/dist/assets/{quadrantDiagram-337W2JSQ-Bnb0BBo0.js → quadrantDiagram-337W2JSQ-DtJyRiTQ.js} +1 -1
- package/dist/assets/{requirementDiagram-Z7DCOOCP-D5WciKb4.js → requirementDiagram-Z7DCOOCP-CLdk2ho_.js} +1 -1
- package/dist/assets/{sankeyDiagram-WA2Y5GQK-DWk1rMpO.js → sankeyDiagram-WA2Y5GQK-DX9GLmcg.js} +1 -1
- package/dist/assets/{sequenceDiagram-2WXFIKYE-ClygMXcv.js → sequenceDiagram-2WXFIKYE-BqIsZZYY.js} +1 -1
- package/dist/assets/{stateDiagram-RAJIS63D-CjgprF86.js → stateDiagram-RAJIS63D-DioEhTBY.js} +1 -1
- package/dist/assets/stateDiagram-v2-FVOUBMTO-Di4lDOaO.js +1 -0
- package/dist/assets/{timeline-definition-YZTLITO2-CRmeM-0-.js → timeline-definition-YZTLITO2-R2T2uTVB.js} +1 -1
- package/dist/assets/{treemap-KZPCXAKY-CxpHpbg_.js → treemap-KZPCXAKY-DgSvjmtk.js} +1 -1
- package/dist/assets/{vennDiagram-LZ73GAT5-DVszulTg.js → vennDiagram-LZ73GAT5-DnJG4x9E.js} +1 -1
- package/dist/assets/{xychartDiagram-JWTSCODW-BGZ2DMtc.js → xychartDiagram-JWTSCODW-bp87yAdk.js} +1 -1
- package/dist/index.html +1 -1
- package/lib/perm-bridge.js +6 -2
- package/package.json +1 -1
- package/server.js +17 -2
- package/dist/assets/App-C1qQPsp4.css +0 -1
- package/dist/assets/AppHeader-BvoJq3yz.css +0 -41
- package/dist/assets/channel-CP2DWwf4.js +0 -1
- package/dist/assets/classDiagram-VBA2DB6C-mhM3RkKU.js +0 -1
- package/dist/assets/classDiagram-v2-RAHNMMFH-mhM3RkKU.js +0 -1
- package/dist/assets/clone-Cp20YwEM.js +0 -1
- package/dist/assets/stateDiagram-v2-FVOUBMTO-BdLIGCmV.js +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var Ms=Object.defineProperty;var Es=(n,s,t)=>s in n?Ms(n,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[s]=t;var O=(n,s,t)=>Es(n,typeof s!="symbol"?s+"":s,t);import{r as j,R as q,j as e,a as Rs}from"./index-M_rYsuaR.js";import{M as Is,N as Ls,_ as se,c as te,P as ct,Q as Ps,U as dt,d as bt,V as ge,W as Nt,X as nt,Y as _t,Z as As,$ as vt,a0 as Ds,a1 as St,a2 as Bs,g as Os,m as Fs,u as Be,a3 as $s,a4 as Hs,a5 as zs,a6 as Vs,a7 as Us,a8 as qs,a9 as Ws,aa as kt,C as yt,I as pe,ab as Ks,ac as Kt,ad as Gs,ae as Gt,af as Js,ag as Qs,ah as Ys,e as le,t as p,q as ze,v as Xs,w as Ce,f as Zs,h as ea,j as ta,s as d,o as W,n as ie,ai as Jt,aj as Fe,ak as G,al as Ke,am as Oe,k as sa,an as aa,l as Ve,ao as na,ap as je,S as Qt,B as H,aq as la,ar as ia,as as $e,at as oa,au as me,av as wt,aw as we,y as ra,J as ca,ax as Yt,H as Te,ay as qe,E as ht,az as Tt,G as ut,aA as da,O as Xt,aB as ha,aC as ua,aD as ma,aE as Ee,aF as Mt,aG as pa,aH as Et,aI as Zt,aJ as es,aK as Re,aL as Ie,aM as ts,aN as lt,aO as Rt,aP as It,aQ as Lt,aR as ga,aS as fa,A as xa,aT as We,aU as Pt,aV as va,z as ya,x as E,D as ja,aW as Ca}from"./AppHeader.module-Caq2Qxrw.js";var At=j.createContext(null),ss=j.createContext({}),ba=["prefixCls","className","containerRef"],Na=function(s){var t=s.prefixCls,a=s.className,c=s.containerRef,l=Is(s,ba),u=j.useContext(ss),g=u.panel,i=Ls(g,c);return j.createElement("div",se({className:te("".concat(t,"-content"),a),role:"dialog",ref:i},ct(s,{aria:!0}),{"aria-modal":"true"},l))};function Dt(n){return typeof n=="string"&&String(Number(n))===n?(Ps(!1,"Invalid value type of `width` or `height` which should be number type instead."),Number(n)):n}var Bt={width:0,height:0,overflow:"hidden",outline:"none",position:"absolute"};function _a(n,s){var t,a,c,l=n.prefixCls,u=n.open,g=n.placement,i=n.inline,h=n.push,o=n.forceRender,r=n.autoFocus,m=n.keyboard,y=n.classNames,x=n.rootClassName,f=n.rootStyle,v=n.zIndex,C=n.className,k=n.id,_=n.style,b=n.motion,T=n.width,R=n.height,P=n.children,I=n.mask,M=n.maskClosable,B=n.maskMotion,F=n.maskClassName,ae=n.maskStyle,ne=n.afterOpenChange,A=n.onClose,X=n.onMouseEnter,oe=n.onMouseOver,Z=n.onMouseLeave,he=n.onClick,ue=n.onKeyDown,fe=n.onKeyUp,N=n.styles,U=n.drawerRender,ee=j.useRef(),de=j.useRef(),xe=j.useRef();j.useImperativeHandle(s,function(){return ee.current});var be=function(re){var Pe=re.keyCode,Ae=re.shiftKey;switch(Pe){case nt.TAB:{if(Pe===nt.TAB){if(!Ae&&document.activeElement===xe.current){var De;(De=de.current)===null||De===void 0||De.focus({preventScroll:!0})}else if(Ae&&document.activeElement===de.current){var at;(at=xe.current)===null||at===void 0||at.focus({preventScroll:!0})}}break}case nt.ESC:{A&&m&&(re.stopPropagation(),A(re));break}}};j.useEffect(function(){if(u&&r){var Y;(Y=ee.current)===null||Y===void 0||Y.focus({preventScroll:!0})}},[u]);var Ne=j.useState(!1),_e=dt(Ne,2),ve=_e[0],Q=_e[1],L=j.useContext(At),$;typeof h=="boolean"?$=h?{}:{distance:0}:$=h||{};var K=(t=(a=(c=$)===null||c===void 0?void 0:c.distance)!==null&&a!==void 0?a:L==null?void 0:L.pushDistance)!==null&&t!==void 0?t:180,ye=j.useMemo(function(){return{pushDistance:K,push:function(){Q(!0)},pull:function(){Q(!1)}}},[K]);j.useEffect(function(){if(u){var Y;L==null||(Y=L.push)===null||Y===void 0||Y.call(L)}else{var re;L==null||(re=L.pull)===null||re===void 0||re.call(L)}},[u]),j.useEffect(function(){return function(){var Y;L==null||(Y=L.pull)===null||Y===void 0||Y.call(L)}},[]);var Ue=j.createElement(bt,se({key:"mask"},B,{visible:I&&u}),function(Y,re){var Pe=Y.className,Ae=Y.style;return j.createElement("div",{className:te("".concat(l,"-mask"),Pe,y==null?void 0:y.mask,F),style:ge(ge(ge({},Ae),ae),N==null?void 0:N.mask),onClick:M&&u?A:void 0,ref:re})}),ks=typeof b=="function"?b(g):b,ke={};if(ve&&K)switch(g){case"top":ke.transform="translateY(".concat(K,"px)");break;case"bottom":ke.transform="translateY(".concat(-K,"px)");break;case"left":ke.transform="translateX(".concat(K,"px)");break;default:ke.transform="translateX(".concat(-K,"px)");break}g==="left"||g==="right"?ke.width=Dt(T):ke.height=Dt(R);var ws={onMouseEnter:X,onMouseOver:oe,onMouseLeave:Z,onClick:he,onKeyDown:ue,onKeyUp:fe},Ts=j.createElement(bt,se({key:"panel"},ks,{visible:u,forceRender:o,onVisibleChanged:function(re){ne==null||ne(re)},removeOnLeave:!1,leavedClassName:"".concat(l,"-content-wrapper-hidden")}),function(Y,re){var Pe=Y.className,Ae=Y.style,De=j.createElement(Na,se({id:k,containerRef:re,prefixCls:l,className:te(C,y==null?void 0:y.content),style:ge(ge({},_),N==null?void 0:N.content)},ct(n,{aria:!0}),ws),P);return j.createElement("div",se({className:te("".concat(l,"-content-wrapper"),y==null?void 0:y.wrapper,Pe),style:ge(ge(ge({},ke),Ae),N==null?void 0:N.wrapper)},ct(n,{data:!0})),U?U(De):De)}),Ct=ge({},f);return v&&(Ct.zIndex=v),j.createElement(At.Provider,{value:ye},j.createElement("div",{className:te(l,"".concat(l,"-").concat(g),x,Nt(Nt({},"".concat(l,"-open"),u),"".concat(l,"-inline"),i)),style:Ct,tabIndex:-1,ref:ee,onKeyDown:be},Ue,j.createElement("div",{tabIndex:0,ref:de,style:Bt,"aria-hidden":"true","data-sentinel":"start"}),Ts,j.createElement("div",{tabIndex:0,ref:xe,style:Bt,"aria-hidden":"true","data-sentinel":"end"})))}var Sa=j.forwardRef(_a),ka=function(s){var t=s.open,a=t===void 0?!1:t,c=s.prefixCls,l=c===void 0?"rc-drawer":c,u=s.placement,g=u===void 0?"right":u,i=s.autoFocus,h=i===void 0?!0:i,o=s.keyboard,r=o===void 0?!0:o,m=s.width,y=m===void 0?378:m,x=s.mask,f=x===void 0?!0:x,v=s.maskClosable,C=v===void 0?!0:v,k=s.getContainer,_=s.forceRender,b=s.afterOpenChange,T=s.destroyOnClose,R=s.onMouseEnter,P=s.onMouseOver,I=s.onMouseLeave,M=s.onClick,B=s.onKeyDown,F=s.onKeyUp,ae=s.panelRef,ne=j.useState(!1),A=dt(ne,2),X=A[0],oe=A[1],Z=j.useState(!1),he=dt(Z,2),ue=he[0],fe=he[1];_t(function(){fe(!0)},[]);var N=ue?a:!1,U=j.useRef(),ee=j.useRef();_t(function(){N&&(ee.current=document.activeElement)},[N]);var de=function(ve){var Q;if(oe(ve),b==null||b(ve),!ve&&ee.current&&!((Q=U.current)!==null&&Q!==void 0&&Q.contains(ee.current))){var L;(L=ee.current)===null||L===void 0||L.focus({preventScroll:!0})}},xe=j.useMemo(function(){return{panel:ae}},[ae]);if(!_&&!X&&!N&&T)return null;var be={onMouseEnter:R,onMouseOver:P,onMouseLeave:I,onClick:M,onKeyDown:B,onKeyUp:F},Ne=ge(ge({},s),{},{open:N,prefixCls:l,placement:g,autoFocus:h,keyboard:r,width:y,mask:f,maskClosable:C,inline:k===!1,afterOpenChange:de,ref:U},be);return j.createElement(ss.Provider,{value:xe},j.createElement(As,{open:N||_||X,autoDestroy:!1,getContainer:k,autoLock:f&&(N||X)},j.createElement(Sa,Ne)))};const as=n=>{var s,t;const{prefixCls:a,ariaId:c,title:l,footer:u,extra:g,closable:i,loading:h,onClose:o,headerStyle:r,bodyStyle:m,footerStyle:y,children:x,classNames:f,styles:v}=n,C=vt("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 _=j.useCallback(I=>j.createElement("button",{type:"button",onClick:o,className:te(`${a}-close`,{[`${a}-close-${k}`]:k==="end"})},I),[o,a,k]),[b,T]=Ds(St(n),St(C),{closable:!0,closeIconRender:_}),R=()=>{var I,M;return!l&&!b?null:j.createElement("div",{style:Object.assign(Object.assign(Object.assign({},(I=C.styles)===null||I===void 0?void 0:I.header),r),v==null?void 0:v.header),className:te(`${a}-header`,{[`${a}-header-close-only`]:b&&!l&&!g},(M=C.classNames)===null||M===void 0?void 0:M.header,f==null?void 0:f.header)},j.createElement("div",{className:`${a}-header-title`},k==="start"&&T,l&&j.createElement("div",{className:`${a}-title`,id:c},l)),g&&j.createElement("div",{className:`${a}-extra`},g),k==="end"&&T)},P=()=>{var I,M;if(!u)return null;const B=`${a}-footer`;return j.createElement("div",{className:te(B,(I=C.classNames)===null||I===void 0?void 0:I.footer,f==null?void 0:f.footer),style:Object.assign(Object.assign(Object.assign({},(M=C.styles)===null||M===void 0?void 0:M.footer),y),v==null?void 0:v.footer)},u)};return j.createElement(j.Fragment,null,R(),j.createElement("div",{className:te(`${a}-body`,f==null?void 0:f.body,(s=C.classNames)===null||s===void 0?void 0:s.body),style:Object.assign(Object.assign(Object.assign({},(t=C.styles)===null||t===void 0?void 0:t.body),m),v==null?void 0:v.body)},h?j.createElement(Bs,{active:!0,title:!1,paragraph:{rows:5},className:`${a}-body-skeleton`}):x),P())},wa=n=>{const s="100%";return{left:`translateX(-${s})`,right:`translateX(${s})`,top:`translateY(-${s})`,bottom:`translateY(${s})`}[n]},ns=(n,s)=>({"&-enter, &-appear":Object.assign(Object.assign({},n),{"&-active":s}),"&-leave":Object.assign(Object.assign({},s),{"&-active":n})}),ls=(n,s)=>Object.assign({"&-enter, &-appear, &-leave":{"&-start":{transition:"none"},"&-active":{transition:`all ${s}`}}},ns({opacity:n},{opacity:1})),Ta=(n,s)=>[ls(.7,s),ns({transform:wa(n)},{transform:"none"})],Ma=n=>{const{componentCls:s,motionDurationSlow:t}=n;return{[s]:{[`${s}-mask-motion`]:ls(0,t),[`${s}-panel-motion`]:["left","right","top","bottom"].reduce((a,c)=>Object.assign(Object.assign({},a),{[`&-${c}`]:Ta(c,t)}),{})}}},Ea=n=>{const{borderRadiusSM:s,componentCls:t,zIndexPopup:a,colorBgMask:c,colorBgElevated:l,motionDurationSlow:u,motionDurationMid:g,paddingXS:i,padding:h,paddingLG:o,fontSizeLG:r,lineHeightLG:m,lineWidth:y,lineType:x,colorSplit:f,marginXS:v,colorIcon:C,colorIconHover:k,colorBgTextHover:_,colorBgTextActive:b,colorText:T,fontWeightStrong:R,footerPaddingBlock:P,footerPaddingInline:I,calc:M}=n,B=`${t}-content-wrapper`;return{[t]:{position:"fixed",inset:0,zIndex:a,pointerEvents:"none",color:T,"&-pure":{position:"relative",background:l,display:"flex",flexDirection:"column",[`&${t}-left`]:{boxShadow:n.boxShadowDrawerLeft},[`&${t}-right`]:{boxShadow:n.boxShadowDrawerRight},[`&${t}-top`]:{boxShadow:n.boxShadowDrawerUp},[`&${t}-bottom`]:{boxShadow:n.boxShadowDrawerDown}},"&-inline":{position:"absolute"},[`${t}-mask`]:{position:"absolute",inset:0,zIndex:a,background:c,pointerEvents:"auto"},[B]:{position:"absolute",zIndex:a,maxWidth:"100vw",transition:`all ${u}`,"&-hidden":{display:"none"}},[`&-left > ${B}`]:{top:0,bottom:0,left:{_skip_check_:!0,value:0},boxShadow:n.boxShadowDrawerLeft},[`&-right > ${B}`]:{top:0,right:{_skip_check_:!0,value:0},bottom:0,boxShadow:n.boxShadowDrawerRight},[`&-top > ${B}`]:{top:0,insetInline:0,boxShadow:n.boxShadowDrawerUp},[`&-bottom > ${B}`]:{bottom:0,insetInline:0,boxShadow:n.boxShadowDrawerDown},[`${t}-content`]:{display:"flex",flexDirection:"column",width:"100%",height:"100%",overflow:"auto",background:l,pointerEvents:"auto"},[`${t}-header`]:{display:"flex",flex:0,alignItems:"center",padding:`${Be(h)} ${Be(o)}`,fontSize:r,lineHeight:m,borderBottom:`${Be(y)} ${x} ${f}`,"&-title":{display:"flex",flex:1,alignItems:"center",minWidth:0,minHeight:0}},[`${t}-extra`]:{flex:"none"},[`${t}-close`]:Object.assign({display:"inline-flex",width:M(r).add(i).equal(),height:M(r).add(i).equal(),borderRadius:s,justifyContent:"center",alignItems:"center",color:C,fontWeight:R,fontSize:r,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:v},[`&:not(${t}-close-end)`]:{marginInlineEnd:v},"&:hover":{color:k,backgroundColor:_,textDecoration:"none"},"&:active":{backgroundColor:b}},$s(n)),[`${t}-title`]:{flex:1,margin:0,fontWeight:n.fontWeightStrong,fontSize:r,lineHeight:m},[`${t}-body`]:{flex:1,minWidth:0,minHeight:0,padding:o,overflow:"auto",[`${t}-body-skeleton`]:{width:"100%",height:"100%",display:"flex",justifyContent:"center"}},[`${t}-footer`]:{flexShrink:0,padding:`${Be(P)} ${Be(I)}`,borderTop:`${Be(y)} ${x} ${f}`},"&-rtl":{direction:"rtl"}}}},Ra=n=>({zIndexPopup:n.zIndexPopupBase,footerPaddingBlock:n.paddingXS,footerPaddingInline:n.padding}),is=Os("Drawer",n=>{const s=Fs(n,{});return[Ea(s),Ma(s)]},Ra);var os=function(n,s){var t={};for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&s.indexOf(a)<0&&(t[a]=n[a]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,a=Object.getOwnPropertySymbols(n);c<a.length;c++)s.indexOf(a[c])<0&&Object.prototype.propertyIsEnumerable.call(n,a[c])&&(t[a[c]]=n[a[c]]);return t};const Ia={distance:180},Ge=n=>{const{rootClassName:s,width:t,height:a,size:c="default",mask:l=!0,push:u=Ia,open:g,afterOpenChange:i,onClose:h,prefixCls:o,getContainer:r,panelRef:m=null,style:y,className:x,"aria-labelledby":f,visible:v,afterVisibleChange:C,maskStyle:k,drawerStyle:_,contentWrapperStyle:b,destroyOnClose:T,destroyOnHidden:R}=n,P=os(n,["rootClassName","width","height","size","mask","push","open","afterOpenChange","onClose","prefixCls","getContainer","panelRef","style","className","aria-labelledby","visible","afterVisibleChange","maskStyle","drawerStyle","contentWrapperStyle","destroyOnClose","destroyOnHidden"]),I=Hs(),M=P.title?I:void 0,{getPopupContainer:B,getPrefixCls:F,direction:ae,className:ne,style:A,classNames:X,styles:oe}=vt("drawer"),Z=F("drawer",o),[he,ue,fe]=is(Z),N=r===void 0&&B?()=>B(document.body):r,U=te({"no-mask":!l,[`${Z}-rtl`]:ae==="rtl"},s,ue,fe),ee=j.useMemo(()=>t??(c==="large"?736:378),[t,c]),de=j.useMemo(()=>a??(c==="large"?736:378),[a,c]),xe={motionName:kt(Z,"mask-motion"),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500},be=K=>({motionName:kt(Z,`panel-motion-${K}`),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500}),Ne=zs(),_e=Vs(m,Ne),[ve,Q]=Us("Drawer",P.zIndex),{classNames:L={},styles:$={}}=P;return he(j.createElement(qs,{form:!0,space:!0},j.createElement(Ws.Provider,{value:Q},j.createElement(ka,Object.assign({prefixCls:Z,onClose:h,maskMotion:xe,motion:be},P,{classNames:{mask:te(L.mask,X.mask),content:te(L.content,X.content),wrapper:te(L.wrapper,X.wrapper)},styles:{mask:Object.assign(Object.assign(Object.assign({},$.mask),k),oe.mask),content:Object.assign(Object.assign(Object.assign({},$.content),_),oe.content),wrapper:Object.assign(Object.assign(Object.assign({},$.wrapper),b),oe.wrapper)},open:g??v,mask:l,push:u,width:ee,height:de,style:Object.assign(Object.assign({},A),y),className:te(ne,x),rootClassName:U,getContainer:N,afterOpenChange:i??C,panelRef:_e,zIndex:ve,"aria-labelledby":f??M,destroyOnClose:R??T}),j.createElement(as,Object.assign({prefixCls:Z},P,{ariaId:M,onClose:h}))))))},La=n=>{const{prefixCls:s,style:t,className:a,placement:c="right"}=n,l=os(n,["prefixCls","style","className","placement"]),{getPrefixCls:u}=j.useContext(yt),g=u("drawer",s),[i,h,o]=is(g),r=te(g,`${g}-pure`,`${g}-${c}`,h,o,a);return i(j.createElement("div",{className:r,style:t},j.createElement(as,Object.assign({prefixCls:g},l))))};Ge._InternalPanelDoNotUseOrYouWillBeFired=La;var Pa={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"},Aa=function(s,t){return j.createElement(pe,se({},s,{ref:t,icon:Pa}))},Je=j.forwardRef(Aa),Da={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"},Ba=function(s,t){return j.createElement(pe,se({},s,{ref:t,icon:Da}))},Ot=j.forwardRef(Ba);function Oa(n,s,t){return typeof t=="boolean"?t:n.length?!0:Ks(s).some(c=>c.type===Kt)}var rs=function(n,s){var t={};for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&s.indexOf(a)<0&&(t[a]=n[a]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,a=Object.getOwnPropertySymbols(n);c<a.length;c++)s.indexOf(a[c])<0&&Object.prototype.propertyIsEnumerable.call(n,a[c])&&(t[a[c]]=n[a[c]]);return t};function st({suffixCls:n,tagName:s,displayName:t}){return a=>j.forwardRef((l,u)=>j.createElement(a,Object.assign({ref:u,suffixCls:n,tagName:s},l)))}const jt=j.forwardRef((n,s)=>{const{prefixCls:t,suffixCls:a,className:c,tagName:l}=n,u=rs(n,["prefixCls","suffixCls","className","tagName"]),{getPrefixCls:g}=j.useContext(yt),i=g("layout",t),[h,o,r]=Gt(i),m=a?`${i}-${a}`:i;return h(j.createElement(l,Object.assign({className:te(t||m,c,o,r),ref:s},u)))}),Fa=j.forwardRef((n,s)=>{const{direction:t}=j.useContext(yt),[a,c]=j.useState([]),{prefixCls:l,className:u,rootClassName:g,children:i,hasSider:h,tagName:o,style:r}=n,m=rs(n,["prefixCls","className","rootClassName","children","hasSider","tagName","style"]),y=Gs(m,["suffixCls"]),{getPrefixCls:x,className:f,style:v}=vt("layout"),C=x("layout",l),k=Oa(a,i,h),[_,b,T]=Gt(C),R=te(C,{[`${C}-has-sider`]:k,[`${C}-rtl`]:t==="rtl"},f,u,g,b,T),P=j.useMemo(()=>({siderHook:{addSider:I=>{c(M=>[].concat(Js(M),[I]))},removeSider:I=>{c(M=>M.filter(B=>B!==I))}}}),[]);return _(j.createElement(Qs.Provider,{value:P},j.createElement(o,Object.assign({ref:s,className:R,style:Object.assign(Object.assign({},v),r)},y),i)))}),$a=st({tagName:"div",displayName:"Layout"})(Fa),Ha=st({suffixCls:"header",tagName:"header",displayName:"Header"})(jt),za=st({suffixCls:"footer",tagName:"footer",displayName:"Footer"})(jt),Va=st({suffixCls:"content",tagName:"main",displayName:"Content"})(jt),Se=$a;Se.Header=Ha;Se.Footer=za;Se.Content=Va;Se.Sider=Kt;Se._InternalSiderContext=Ys;var Ua={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"},qa=function(s,t){return j.createElement(pe,se({},s,{ref:t,icon:Ua}))},Ft=j.forwardRef(qa),Wa={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"},Ka=function(s,t){return j.createElement(pe,se({},s,{ref:t,icon:Wa}))},$t=j.forwardRef(Ka),Ga={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"},Ja=function(s,t){return j.createElement(pe,se({},s,{ref:t,icon:Ga}))},Ht=j.forwardRef(Ja),Qa={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"},Ya=function(s,t){return j.createElement(pe,se({},s,{ref:t,icon:Qa}))},Qe=j.forwardRef(Ya),Xa={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"},Za=function(s,t){return j.createElement(pe,se({},s,{ref:t,icon:Xa}))},it=j.forwardRef(Za),en={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"},tn=function(s,t){return j.createElement(pe,se({},s,{ref:t,icon:en}))},sn=j.forwardRef(tn),an={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.4 800.9c.2-.3.5-.6.7-.9C920.6 722.1 960 621.7 960 512s-39.4-210.1-104.8-288c-.2-.3-.5-.5-.7-.8-1.1-1.3-2.1-2.5-3.2-3.7-.4-.5-.8-.9-1.2-1.4l-4.1-4.7-.1-.1c-1.5-1.7-3.1-3.4-4.6-5.1l-.1-.1c-3.2-3.4-6.4-6.8-9.7-10.1l-.1-.1-4.8-4.8-.3-.3c-1.5-1.5-3-2.9-4.5-4.3-.5-.5-1-1-1.6-1.5-1-1-2-1.9-3-2.8-.3-.3-.7-.6-1-1C736.4 109.2 629.5 64 512 64s-224.4 45.2-304.3 119.2c-.3.3-.7.6-1 1-1 .9-2 1.9-3 2.9-.5.5-1 1-1.6 1.5-1.5 1.4-3 2.9-4.5 4.3l-.3.3-4.8 4.8-.1.1c-3.3 3.3-6.5 6.7-9.7 10.1l-.1.1c-1.6 1.7-3.1 3.4-4.6 5.1l-.1.1c-1.4 1.5-2.8 3.1-4.1 4.7-.4.5-.8.9-1.2 1.4-1.1 1.2-2.1 2.5-3.2 3.7-.2.3-.5.5-.7.8C103.4 301.9 64 402.3 64 512s39.4 210.1 104.8 288c.2.3.5.6.7.9l3.1 3.7c.4.5.8.9 1.2 1.4l4.1 4.7c0 .1.1.1.1.2 1.5 1.7 3 3.4 4.6 5l.1.1c3.2 3.4 6.4 6.8 9.6 10.1l.1.1c1.6 1.6 3.1 3.2 4.7 4.7l.3.3c3.3 3.3 6.7 6.5 10.1 9.6 80.1 74 187 119.2 304.5 119.2s224.4-45.2 304.3-119.2a300 300 0 0010-9.6l.3-.3c1.6-1.6 3.2-3.1 4.7-4.7l.1-.1c3.3-3.3 6.5-6.7 9.6-10.1l.1-.1c1.5-1.7 3.1-3.3 4.6-5 0-.1.1-.1.1-.2 1.4-1.5 2.8-3.1 4.1-4.7.4-.5.8-.9 1.2-1.4a99 99 0 003.3-3.7zm4.1-142.6c-13.8 32.6-32 62.8-54.2 90.2a444.07 444.07 0 00-81.5-55.9c11.6-46.9 18.8-98.4 20.7-152.6H887c-3 40.9-12.6 80.6-28.5 118.3zM887 484H743.5c-1.9-54.2-9.1-105.7-20.7-152.6 29.3-15.6 56.6-34.4 81.5-55.9A373.86 373.86 0 01887 484zM658.3 165.5c39.7 16.8 75.8 40 107.6 69.2a394.72 394.72 0 01-59.4 41.8c-15.7-45-35.8-84.1-59.2-115.4 3.7 1.4 7.4 2.9 11 4.4zm-90.6 700.6c-9.2 7.2-18.4 12.7-27.7 16.4V697a389.1 389.1 0 01115.7 26.2c-8.3 24.6-17.9 47.3-29 67.8-17.4 32.4-37.8 58.3-59 75.1zm59-633.1c11 20.6 20.7 43.3 29 67.8A389.1 389.1 0 01540 327V141.6c9.2 3.7 18.5 9.1 27.7 16.4 21.2 16.7 41.6 42.6 59 75zM540 640.9V540h147.5c-1.6 44.2-7.1 87.1-16.3 127.8l-.3 1.2A445.02 445.02 0 00540 640.9zm0-156.9V383.1c45.8-2.8 89.8-12.5 130.9-28.1l.3 1.2c9.2 40.7 14.7 83.5 16.3 127.8H540zm-56 56v100.9c-45.8 2.8-89.8 12.5-130.9 28.1l-.3-1.2c-9.2-40.7-14.7-83.5-16.3-127.8H484zm-147.5-56c1.6-44.2 7.1-87.1 16.3-127.8l.3-1.2c41.1 15.6 85 25.3 130.9 28.1V484H336.5zM484 697v185.4c-9.2-3.7-18.5-9.1-27.7-16.4-21.2-16.7-41.7-42.7-59.1-75.1-11-20.6-20.7-43.3-29-67.8 37.2-14.6 75.9-23.3 115.8-26.1zm0-370a389.1 389.1 0 01-115.7-26.2c8.3-24.6 17.9-47.3 29-67.8 17.4-32.4 37.8-58.4 59.1-75.1 9.2-7.2 18.4-12.7 27.7-16.4V327zM365.7 165.5c3.7-1.5 7.3-3 11-4.4-23.4 31.3-43.5 70.4-59.2 115.4-21-12-40.9-26-59.4-41.8 31.8-29.2 67.9-52.4 107.6-69.2zM165.5 365.7c13.8-32.6 32-62.8 54.2-90.2 24.9 21.5 52.2 40.3 81.5 55.9-11.6 46.9-18.8 98.4-20.7 152.6H137c3-40.9 12.6-80.6 28.5-118.3zM137 540h143.5c1.9 54.2 9.1 105.7 20.7 152.6a444.07 444.07 0 00-81.5 55.9A373.86 373.86 0 01137 540zm228.7 318.5c-39.7-16.8-75.8-40-107.6-69.2 18.5-15.8 38.4-29.7 59.4-41.8 15.7 45 35.8 84.1 59.2 115.4-3.7-1.4-7.4-2.9-11-4.4zm292.6 0c-3.7 1.5-7.3 3-11 4.4 23.4-31.3 43.5-70.4 59.2-115.4 21 12 40.9 26 59.4 41.8a373.81 373.81 0 01-107.6 69.2z"}}]},name:"global",theme:"outlined"},nn=function(s,t){return j.createElement(pe,se({},s,{ref:t,icon:an}))},ln=j.forwardRef(nn),on={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"},rn=function(s,t){return j.createElement(pe,se({},s,{ref:t,icon:on}))},zt=j.forwardRef(rn),cn={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"},dn=function(s,t){return j.createElement(pe,se({},s,{ref:t,icon:cn}))},Vt=j.forwardRef(dn),hn={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"},un=function(s,t){return j.createElement(pe,se({},s,{ref:t,icon:hn}))},Ut=j.forwardRef(un),mn=Object.defineProperty,Ye=Object.getOwnPropertySymbols,cs=Object.prototype.hasOwnProperty,ds=Object.prototype.propertyIsEnumerable,qt=(n,s,t)=>s in n?mn(n,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[s]=t,mt=(n,s)=>{for(var t in s||(s={}))cs.call(s,t)&&qt(n,t,s[t]);if(Ye)for(var t of Ye(s))ds.call(s,t)&&qt(n,t,s[t]);return n},pt=(n,s)=>{var t={};for(var a in n)cs.call(n,a)&&s.indexOf(a)<0&&(t[a]=n[a]);if(n!=null&&Ye)for(var a of Ye(n))s.indexOf(a)<0&&ds.call(n,a)&&(t[a]=n[a]);return t};/**
|
|
1
|
+
var Ms=Object.defineProperty;var Es=(n,s,t)=>s in n?Ms(n,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[s]=t;var O=(n,s,t)=>Es(n,typeof s!="symbol"?s+"":s,t);import{r as j,R as q,j as e,a as Rs}from"./index-Bi9rchQE.js";import{M as Is,N as Ls,_ as se,c as te,P as ct,Q as Ps,U as dt,d as bt,V as ge,W as Nt,X as nt,Y as _t,Z as As,$ as yt,a0 as Ds,a1 as St,a2 as Bs,g as Os,m as Fs,u as Be,a3 as $s,a4 as Hs,a5 as zs,a6 as Vs,a7 as Us,a8 as qs,a9 as Ws,aa as kt,C as vt,I as pe,ab as Ks,ac as Kt,ad as Gs,ae as Gt,af as Js,ag as Qs,ah as Ys,e as le,t as p,q as ze,v as Xs,w as Ce,f as Zs,h as ea,j as ta,s as d,o as W,n as ie,ai as Jt,aj as Fe,ak as G,al as Ke,am as Oe,k as sa,an as aa,l as Ve,ao as na,ap as je,S as Qt,B as H,aq as la,ar as ia,as as $e,at as oa,au as me,av as wt,aw as we,y as ra,J as ca,ax as Yt,H as Te,ay as qe,E as ht,az as Tt,G as ut,aA as da,O as Xt,aB as ha,aC as ua,aD as ma,aE as Ee,aF as Mt,aG as pa,aH as Et,aI as Zt,aJ as es,aK as Re,aL as Ie,aM as ts,aN as lt,aO as Rt,aP as It,aQ as Lt,aR as ga,aS as fa,A as xa,aT as We,aU as Pt,aV as ya,z as va,x as E,D as ja,aW as Ca}from"./AppHeader.module-DSfS8qzJ.js";var At=j.createContext(null),ss=j.createContext({}),ba=["prefixCls","className","containerRef"],Na=function(s){var t=s.prefixCls,a=s.className,c=s.containerRef,l=Is(s,ba),u=j.useContext(ss),g=u.panel,i=Ls(g,c);return j.createElement("div",se({className:te("".concat(t,"-content"),a),role:"dialog",ref:i},ct(s,{aria:!0}),{"aria-modal":"true"},l))};function Dt(n){return typeof n=="string"&&String(Number(n))===n?(Ps(!1,"Invalid value type of `width` or `height` which should be number type instead."),Number(n)):n}var Bt={width:0,height:0,overflow:"hidden",outline:"none",position:"absolute"};function _a(n,s){var t,a,c,l=n.prefixCls,u=n.open,g=n.placement,i=n.inline,h=n.push,o=n.forceRender,r=n.autoFocus,m=n.keyboard,v=n.classNames,x=n.rootClassName,f=n.rootStyle,y=n.zIndex,C=n.className,k=n.id,_=n.style,b=n.motion,T=n.width,R=n.height,P=n.children,I=n.mask,M=n.maskClosable,B=n.maskMotion,F=n.maskClassName,ae=n.maskStyle,ne=n.afterOpenChange,A=n.onClose,X=n.onMouseEnter,oe=n.onMouseOver,Z=n.onMouseLeave,he=n.onClick,ue=n.onKeyDown,fe=n.onKeyUp,N=n.styles,U=n.drawerRender,ee=j.useRef(),de=j.useRef(),xe=j.useRef();j.useImperativeHandle(s,function(){return ee.current});var be=function(re){var Pe=re.keyCode,Ae=re.shiftKey;switch(Pe){case nt.TAB:{if(Pe===nt.TAB){if(!Ae&&document.activeElement===xe.current){var De;(De=de.current)===null||De===void 0||De.focus({preventScroll:!0})}else if(Ae&&document.activeElement===de.current){var at;(at=xe.current)===null||at===void 0||at.focus({preventScroll:!0})}}break}case nt.ESC:{A&&m&&(re.stopPropagation(),A(re));break}}};j.useEffect(function(){if(u&&r){var Y;(Y=ee.current)===null||Y===void 0||Y.focus({preventScroll:!0})}},[u]);var Ne=j.useState(!1),_e=dt(Ne,2),ye=_e[0],Q=_e[1],L=j.useContext(At),$;typeof h=="boolean"?$=h?{}:{distance:0}:$=h||{};var K=(t=(a=(c=$)===null||c===void 0?void 0:c.distance)!==null&&a!==void 0?a:L==null?void 0:L.pushDistance)!==null&&t!==void 0?t:180,ve=j.useMemo(function(){return{pushDistance:K,push:function(){Q(!0)},pull:function(){Q(!1)}}},[K]);j.useEffect(function(){if(u){var Y;L==null||(Y=L.push)===null||Y===void 0||Y.call(L)}else{var re;L==null||(re=L.pull)===null||re===void 0||re.call(L)}},[u]),j.useEffect(function(){return function(){var Y;L==null||(Y=L.pull)===null||Y===void 0||Y.call(L)}},[]);var Ue=j.createElement(bt,se({key:"mask"},B,{visible:I&&u}),function(Y,re){var Pe=Y.className,Ae=Y.style;return j.createElement("div",{className:te("".concat(l,"-mask"),Pe,v==null?void 0:v.mask,F),style:ge(ge(ge({},Ae),ae),N==null?void 0:N.mask),onClick:M&&u?A:void 0,ref:re})}),ks=typeof b=="function"?b(g):b,ke={};if(ye&&K)switch(g){case"top":ke.transform="translateY(".concat(K,"px)");break;case"bottom":ke.transform="translateY(".concat(-K,"px)");break;case"left":ke.transform="translateX(".concat(K,"px)");break;default:ke.transform="translateX(".concat(-K,"px)");break}g==="left"||g==="right"?ke.width=Dt(T):ke.height=Dt(R);var ws={onMouseEnter:X,onMouseOver:oe,onMouseLeave:Z,onClick:he,onKeyDown:ue,onKeyUp:fe},Ts=j.createElement(bt,se({key:"panel"},ks,{visible:u,forceRender:o,onVisibleChanged:function(re){ne==null||ne(re)},removeOnLeave:!1,leavedClassName:"".concat(l,"-content-wrapper-hidden")}),function(Y,re){var Pe=Y.className,Ae=Y.style,De=j.createElement(Na,se({id:k,containerRef:re,prefixCls:l,className:te(C,v==null?void 0:v.content),style:ge(ge({},_),N==null?void 0:N.content)},ct(n,{aria:!0}),ws),P);return j.createElement("div",se({className:te("".concat(l,"-content-wrapper"),v==null?void 0:v.wrapper,Pe),style:ge(ge(ge({},ke),Ae),N==null?void 0:N.wrapper)},ct(n,{data:!0})),U?U(De):De)}),Ct=ge({},f);return y&&(Ct.zIndex=y),j.createElement(At.Provider,{value:ve},j.createElement("div",{className:te(l,"".concat(l,"-").concat(g),x,Nt(Nt({},"".concat(l,"-open"),u),"".concat(l,"-inline"),i)),style:Ct,tabIndex:-1,ref:ee,onKeyDown:be},Ue,j.createElement("div",{tabIndex:0,ref:de,style:Bt,"aria-hidden":"true","data-sentinel":"start"}),Ts,j.createElement("div",{tabIndex:0,ref:xe,style:Bt,"aria-hidden":"true","data-sentinel":"end"})))}var Sa=j.forwardRef(_a),ka=function(s){var t=s.open,a=t===void 0?!1:t,c=s.prefixCls,l=c===void 0?"rc-drawer":c,u=s.placement,g=u===void 0?"right":u,i=s.autoFocus,h=i===void 0?!0:i,o=s.keyboard,r=o===void 0?!0:o,m=s.width,v=m===void 0?378:m,x=s.mask,f=x===void 0?!0:x,y=s.maskClosable,C=y===void 0?!0:y,k=s.getContainer,_=s.forceRender,b=s.afterOpenChange,T=s.destroyOnClose,R=s.onMouseEnter,P=s.onMouseOver,I=s.onMouseLeave,M=s.onClick,B=s.onKeyDown,F=s.onKeyUp,ae=s.panelRef,ne=j.useState(!1),A=dt(ne,2),X=A[0],oe=A[1],Z=j.useState(!1),he=dt(Z,2),ue=he[0],fe=he[1];_t(function(){fe(!0)},[]);var N=ue?a:!1,U=j.useRef(),ee=j.useRef();_t(function(){N&&(ee.current=document.activeElement)},[N]);var de=function(ye){var Q;if(oe(ye),b==null||b(ye),!ye&&ee.current&&!((Q=U.current)!==null&&Q!==void 0&&Q.contains(ee.current))){var L;(L=ee.current)===null||L===void 0||L.focus({preventScroll:!0})}},xe=j.useMemo(function(){return{panel:ae}},[ae]);if(!_&&!X&&!N&&T)return null;var be={onMouseEnter:R,onMouseOver:P,onMouseLeave:I,onClick:M,onKeyDown:B,onKeyUp:F},Ne=ge(ge({},s),{},{open:N,prefixCls:l,placement:g,autoFocus:h,keyboard:r,width:v,mask:f,maskClosable:C,inline:k===!1,afterOpenChange:de,ref:U},be);return j.createElement(ss.Provider,{value:xe},j.createElement(As,{open:N||_||X,autoDestroy:!1,getContainer:k,autoLock:f&&(N||X)},j.createElement(Sa,Ne)))};const as=n=>{var s,t;const{prefixCls:a,ariaId:c,title:l,footer:u,extra:g,closable:i,loading:h,onClose:o,headerStyle:r,bodyStyle:m,footerStyle:v,children:x,classNames:f,styles:y}=n,C=yt("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 _=j.useCallback(I=>j.createElement("button",{type:"button",onClick:o,className:te(`${a}-close`,{[`${a}-close-${k}`]:k==="end"})},I),[o,a,k]),[b,T]=Ds(St(n),St(C),{closable:!0,closeIconRender:_}),R=()=>{var I,M;return!l&&!b?null:j.createElement("div",{style:Object.assign(Object.assign(Object.assign({},(I=C.styles)===null||I===void 0?void 0:I.header),r),y==null?void 0:y.header),className:te(`${a}-header`,{[`${a}-header-close-only`]:b&&!l&&!g},(M=C.classNames)===null||M===void 0?void 0:M.header,f==null?void 0:f.header)},j.createElement("div",{className:`${a}-header-title`},k==="start"&&T,l&&j.createElement("div",{className:`${a}-title`,id:c},l)),g&&j.createElement("div",{className:`${a}-extra`},g),k==="end"&&T)},P=()=>{var I,M;if(!u)return null;const B=`${a}-footer`;return j.createElement("div",{className:te(B,(I=C.classNames)===null||I===void 0?void 0:I.footer,f==null?void 0:f.footer),style:Object.assign(Object.assign(Object.assign({},(M=C.styles)===null||M===void 0?void 0:M.footer),v),y==null?void 0:y.footer)},u)};return j.createElement(j.Fragment,null,R(),j.createElement("div",{className:te(`${a}-body`,f==null?void 0:f.body,(s=C.classNames)===null||s===void 0?void 0:s.body),style:Object.assign(Object.assign(Object.assign({},(t=C.styles)===null||t===void 0?void 0:t.body),m),y==null?void 0:y.body)},h?j.createElement(Bs,{active:!0,title:!1,paragraph:{rows:5},className:`${a}-body-skeleton`}):x),P())},wa=n=>{const s="100%";return{left:`translateX(-${s})`,right:`translateX(${s})`,top:`translateY(-${s})`,bottom:`translateY(${s})`}[n]},ns=(n,s)=>({"&-enter, &-appear":Object.assign(Object.assign({},n),{"&-active":s}),"&-leave":Object.assign(Object.assign({},s),{"&-active":n})}),ls=(n,s)=>Object.assign({"&-enter, &-appear, &-leave":{"&-start":{transition:"none"},"&-active":{transition:`all ${s}`}}},ns({opacity:n},{opacity:1})),Ta=(n,s)=>[ls(.7,s),ns({transform:wa(n)},{transform:"none"})],Ma=n=>{const{componentCls:s,motionDurationSlow:t}=n;return{[s]:{[`${s}-mask-motion`]:ls(0,t),[`${s}-panel-motion`]:["left","right","top","bottom"].reduce((a,c)=>Object.assign(Object.assign({},a),{[`&-${c}`]:Ta(c,t)}),{})}}},Ea=n=>{const{borderRadiusSM:s,componentCls:t,zIndexPopup:a,colorBgMask:c,colorBgElevated:l,motionDurationSlow:u,motionDurationMid:g,paddingXS:i,padding:h,paddingLG:o,fontSizeLG:r,lineHeightLG:m,lineWidth:v,lineType:x,colorSplit:f,marginXS:y,colorIcon:C,colorIconHover:k,colorBgTextHover:_,colorBgTextActive:b,colorText:T,fontWeightStrong:R,footerPaddingBlock:P,footerPaddingInline:I,calc:M}=n,B=`${t}-content-wrapper`;return{[t]:{position:"fixed",inset:0,zIndex:a,pointerEvents:"none",color:T,"&-pure":{position:"relative",background:l,display:"flex",flexDirection:"column",[`&${t}-left`]:{boxShadow:n.boxShadowDrawerLeft},[`&${t}-right`]:{boxShadow:n.boxShadowDrawerRight},[`&${t}-top`]:{boxShadow:n.boxShadowDrawerUp},[`&${t}-bottom`]:{boxShadow:n.boxShadowDrawerDown}},"&-inline":{position:"absolute"},[`${t}-mask`]:{position:"absolute",inset:0,zIndex:a,background:c,pointerEvents:"auto"},[B]:{position:"absolute",zIndex:a,maxWidth:"100vw",transition:`all ${u}`,"&-hidden":{display:"none"}},[`&-left > ${B}`]:{top:0,bottom:0,left:{_skip_check_:!0,value:0},boxShadow:n.boxShadowDrawerLeft},[`&-right > ${B}`]:{top:0,right:{_skip_check_:!0,value:0},bottom:0,boxShadow:n.boxShadowDrawerRight},[`&-top > ${B}`]:{top:0,insetInline:0,boxShadow:n.boxShadowDrawerUp},[`&-bottom > ${B}`]:{bottom:0,insetInline:0,boxShadow:n.boxShadowDrawerDown},[`${t}-content`]:{display:"flex",flexDirection:"column",width:"100%",height:"100%",overflow:"auto",background:l,pointerEvents:"auto"},[`${t}-header`]:{display:"flex",flex:0,alignItems:"center",padding:`${Be(h)} ${Be(o)}`,fontSize:r,lineHeight:m,borderBottom:`${Be(v)} ${x} ${f}`,"&-title":{display:"flex",flex:1,alignItems:"center",minWidth:0,minHeight:0}},[`${t}-extra`]:{flex:"none"},[`${t}-close`]:Object.assign({display:"inline-flex",width:M(r).add(i).equal(),height:M(r).add(i).equal(),borderRadius:s,justifyContent:"center",alignItems:"center",color:C,fontWeight:R,fontSize:r,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:_,textDecoration:"none"},"&:active":{backgroundColor:b}},$s(n)),[`${t}-title`]:{flex:1,margin:0,fontWeight:n.fontWeightStrong,fontSize:r,lineHeight:m},[`${t}-body`]:{flex:1,minWidth:0,minHeight:0,padding:o,overflow:"auto",[`${t}-body-skeleton`]:{width:"100%",height:"100%",display:"flex",justifyContent:"center"}},[`${t}-footer`]:{flexShrink:0,padding:`${Be(P)} ${Be(I)}`,borderTop:`${Be(v)} ${x} ${f}`},"&-rtl":{direction:"rtl"}}}},Ra=n=>({zIndexPopup:n.zIndexPopupBase,footerPaddingBlock:n.paddingXS,footerPaddingInline:n.padding}),is=Os("Drawer",n=>{const s=Fs(n,{});return[Ea(s),Ma(s)]},Ra);var os=function(n,s){var t={};for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&s.indexOf(a)<0&&(t[a]=n[a]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,a=Object.getOwnPropertySymbols(n);c<a.length;c++)s.indexOf(a[c])<0&&Object.prototype.propertyIsEnumerable.call(n,a[c])&&(t[a[c]]=n[a[c]]);return t};const Ia={distance:180},Ge=n=>{const{rootClassName:s,width:t,height:a,size:c="default",mask:l=!0,push:u=Ia,open:g,afterOpenChange:i,onClose:h,prefixCls:o,getContainer:r,panelRef:m=null,style:v,className:x,"aria-labelledby":f,visible:y,afterVisibleChange:C,maskStyle:k,drawerStyle:_,contentWrapperStyle:b,destroyOnClose:T,destroyOnHidden:R}=n,P=os(n,["rootClassName","width","height","size","mask","push","open","afterOpenChange","onClose","prefixCls","getContainer","panelRef","style","className","aria-labelledby","visible","afterVisibleChange","maskStyle","drawerStyle","contentWrapperStyle","destroyOnClose","destroyOnHidden"]),I=Hs(),M=P.title?I:void 0,{getPopupContainer:B,getPrefixCls:F,direction:ae,className:ne,style:A,classNames:X,styles:oe}=yt("drawer"),Z=F("drawer",o),[he,ue,fe]=is(Z),N=r===void 0&&B?()=>B(document.body):r,U=te({"no-mask":!l,[`${Z}-rtl`]:ae==="rtl"},s,ue,fe),ee=j.useMemo(()=>t??(c==="large"?736:378),[t,c]),de=j.useMemo(()=>a??(c==="large"?736:378),[a,c]),xe={motionName:kt(Z,"mask-motion"),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500},be=K=>({motionName:kt(Z,`panel-motion-${K}`),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500}),Ne=zs(),_e=Vs(m,Ne),[ye,Q]=Us("Drawer",P.zIndex),{classNames:L={},styles:$={}}=P;return he(j.createElement(qs,{form:!0,space:!0},j.createElement(Ws.Provider,{value:Q},j.createElement(ka,Object.assign({prefixCls:Z,onClose:h,maskMotion:xe,motion:be},P,{classNames:{mask:te(L.mask,X.mask),content:te(L.content,X.content),wrapper:te(L.wrapper,X.wrapper)},styles:{mask:Object.assign(Object.assign(Object.assign({},$.mask),k),oe.mask),content:Object.assign(Object.assign(Object.assign({},$.content),_),oe.content),wrapper:Object.assign(Object.assign(Object.assign({},$.wrapper),b),oe.wrapper)},open:g??y,mask:l,push:u,width:ee,height:de,style:Object.assign(Object.assign({},A),v),className:te(ne,x),rootClassName:U,getContainer:N,afterOpenChange:i??C,panelRef:_e,zIndex:ye,"aria-labelledby":f??M,destroyOnClose:R??T}),j.createElement(as,Object.assign({prefixCls:Z},P,{ariaId:M,onClose:h}))))))},La=n=>{const{prefixCls:s,style:t,className:a,placement:c="right"}=n,l=os(n,["prefixCls","style","className","placement"]),{getPrefixCls:u}=j.useContext(vt),g=u("drawer",s),[i,h,o]=is(g),r=te(g,`${g}-pure`,`${g}-${c}`,h,o,a);return i(j.createElement("div",{className:r,style:t},j.createElement(as,Object.assign({prefixCls:g},l))))};Ge._InternalPanelDoNotUseOrYouWillBeFired=La;var Pa={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"},Aa=function(s,t){return j.createElement(pe,se({},s,{ref:t,icon:Pa}))},Je=j.forwardRef(Aa),Da={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"},Ba=function(s,t){return j.createElement(pe,se({},s,{ref:t,icon:Da}))},Ot=j.forwardRef(Ba);function Oa(n,s,t){return typeof t=="boolean"?t:n.length?!0:Ks(s).some(c=>c.type===Kt)}var rs=function(n,s){var t={};for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&s.indexOf(a)<0&&(t[a]=n[a]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,a=Object.getOwnPropertySymbols(n);c<a.length;c++)s.indexOf(a[c])<0&&Object.prototype.propertyIsEnumerable.call(n,a[c])&&(t[a[c]]=n[a[c]]);return t};function st({suffixCls:n,tagName:s,displayName:t}){return a=>j.forwardRef((l,u)=>j.createElement(a,Object.assign({ref:u,suffixCls:n,tagName:s},l)))}const jt=j.forwardRef((n,s)=>{const{prefixCls:t,suffixCls:a,className:c,tagName:l}=n,u=rs(n,["prefixCls","suffixCls","className","tagName"]),{getPrefixCls:g}=j.useContext(vt),i=g("layout",t),[h,o,r]=Gt(i),m=a?`${i}-${a}`:i;return h(j.createElement(l,Object.assign({className:te(t||m,c,o,r),ref:s},u)))}),Fa=j.forwardRef((n,s)=>{const{direction:t}=j.useContext(vt),[a,c]=j.useState([]),{prefixCls:l,className:u,rootClassName:g,children:i,hasSider:h,tagName:o,style:r}=n,m=rs(n,["prefixCls","className","rootClassName","children","hasSider","tagName","style"]),v=Gs(m,["suffixCls"]),{getPrefixCls:x,className:f,style:y}=yt("layout"),C=x("layout",l),k=Oa(a,i,h),[_,b,T]=Gt(C),R=te(C,{[`${C}-has-sider`]:k,[`${C}-rtl`]:t==="rtl"},f,u,g,b,T),P=j.useMemo(()=>({siderHook:{addSider:I=>{c(M=>[].concat(Js(M),[I]))},removeSider:I=>{c(M=>M.filter(B=>B!==I))}}}),[]);return _(j.createElement(Qs.Provider,{value:P},j.createElement(o,Object.assign({ref:s,className:R,style:Object.assign(Object.assign({},y),r)},v),i)))}),$a=st({tagName:"div",displayName:"Layout"})(Fa),Ha=st({suffixCls:"header",tagName:"header",displayName:"Header"})(jt),za=st({suffixCls:"footer",tagName:"footer",displayName:"Footer"})(jt),Va=st({suffixCls:"content",tagName:"main",displayName:"Content"})(jt),Se=$a;Se.Header=Ha;Se.Footer=za;Se.Content=Va;Se.Sider=Kt;Se._InternalSiderContext=Ys;var Ua={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"},qa=function(s,t){return j.createElement(pe,se({},s,{ref:t,icon:Ua}))},Ft=j.forwardRef(qa),Wa={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"},Ka=function(s,t){return j.createElement(pe,se({},s,{ref:t,icon:Wa}))},$t=j.forwardRef(Ka),Ga={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"},Ja=function(s,t){return j.createElement(pe,se({},s,{ref:t,icon:Ga}))},Ht=j.forwardRef(Ja),Qa={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"},Ya=function(s,t){return j.createElement(pe,se({},s,{ref:t,icon:Qa}))},Qe=j.forwardRef(Ya),Xa={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"},Za=function(s,t){return j.createElement(pe,se({},s,{ref:t,icon:Xa}))},it=j.forwardRef(Za),en={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"},tn=function(s,t){return j.createElement(pe,se({},s,{ref:t,icon:en}))},sn=j.forwardRef(tn),an={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.4 800.9c.2-.3.5-.6.7-.9C920.6 722.1 960 621.7 960 512s-39.4-210.1-104.8-288c-.2-.3-.5-.5-.7-.8-1.1-1.3-2.1-2.5-3.2-3.7-.4-.5-.8-.9-1.2-1.4l-4.1-4.7-.1-.1c-1.5-1.7-3.1-3.4-4.6-5.1l-.1-.1c-3.2-3.4-6.4-6.8-9.7-10.1l-.1-.1-4.8-4.8-.3-.3c-1.5-1.5-3-2.9-4.5-4.3-.5-.5-1-1-1.6-1.5-1-1-2-1.9-3-2.8-.3-.3-.7-.6-1-1C736.4 109.2 629.5 64 512 64s-224.4 45.2-304.3 119.2c-.3.3-.7.6-1 1-1 .9-2 1.9-3 2.9-.5.5-1 1-1.6 1.5-1.5 1.4-3 2.9-4.5 4.3l-.3.3-4.8 4.8-.1.1c-3.3 3.3-6.5 6.7-9.7 10.1l-.1.1c-1.6 1.7-3.1 3.4-4.6 5.1l-.1.1c-1.4 1.5-2.8 3.1-4.1 4.7-.4.5-.8.9-1.2 1.4-1.1 1.2-2.1 2.5-3.2 3.7-.2.3-.5.5-.7.8C103.4 301.9 64 402.3 64 512s39.4 210.1 104.8 288c.2.3.5.6.7.9l3.1 3.7c.4.5.8.9 1.2 1.4l4.1 4.7c0 .1.1.1.1.2 1.5 1.7 3 3.4 4.6 5l.1.1c3.2 3.4 6.4 6.8 9.6 10.1l.1.1c1.6 1.6 3.1 3.2 4.7 4.7l.3.3c3.3 3.3 6.7 6.5 10.1 9.6 80.1 74 187 119.2 304.5 119.2s224.4-45.2 304.3-119.2a300 300 0 0010-9.6l.3-.3c1.6-1.6 3.2-3.1 4.7-4.7l.1-.1c3.3-3.3 6.5-6.7 9.6-10.1l.1-.1c1.5-1.7 3.1-3.3 4.6-5 0-.1.1-.1.1-.2 1.4-1.5 2.8-3.1 4.1-4.7.4-.5.8-.9 1.2-1.4a99 99 0 003.3-3.7zm4.1-142.6c-13.8 32.6-32 62.8-54.2 90.2a444.07 444.07 0 00-81.5-55.9c11.6-46.9 18.8-98.4 20.7-152.6H887c-3 40.9-12.6 80.6-28.5 118.3zM887 484H743.5c-1.9-54.2-9.1-105.7-20.7-152.6 29.3-15.6 56.6-34.4 81.5-55.9A373.86 373.86 0 01887 484zM658.3 165.5c39.7 16.8 75.8 40 107.6 69.2a394.72 394.72 0 01-59.4 41.8c-15.7-45-35.8-84.1-59.2-115.4 3.7 1.4 7.4 2.9 11 4.4zm-90.6 700.6c-9.2 7.2-18.4 12.7-27.7 16.4V697a389.1 389.1 0 01115.7 26.2c-8.3 24.6-17.9 47.3-29 67.8-17.4 32.4-37.8 58.3-59 75.1zm59-633.1c11 20.6 20.7 43.3 29 67.8A389.1 389.1 0 01540 327V141.6c9.2 3.7 18.5 9.1 27.7 16.4 21.2 16.7 41.6 42.6 59 75zM540 640.9V540h147.5c-1.6 44.2-7.1 87.1-16.3 127.8l-.3 1.2A445.02 445.02 0 00540 640.9zm0-156.9V383.1c45.8-2.8 89.8-12.5 130.9-28.1l.3 1.2c9.2 40.7 14.7 83.5 16.3 127.8H540zm-56 56v100.9c-45.8 2.8-89.8 12.5-130.9 28.1l-.3-1.2c-9.2-40.7-14.7-83.5-16.3-127.8H484zm-147.5-56c1.6-44.2 7.1-87.1 16.3-127.8l.3-1.2c41.1 15.6 85 25.3 130.9 28.1V484H336.5zM484 697v185.4c-9.2-3.7-18.5-9.1-27.7-16.4-21.2-16.7-41.7-42.7-59.1-75.1-11-20.6-20.7-43.3-29-67.8 37.2-14.6 75.9-23.3 115.8-26.1zm0-370a389.1 389.1 0 01-115.7-26.2c8.3-24.6 17.9-47.3 29-67.8 17.4-32.4 37.8-58.4 59.1-75.1 9.2-7.2 18.4-12.7 27.7-16.4V327zM365.7 165.5c3.7-1.5 7.3-3 11-4.4-23.4 31.3-43.5 70.4-59.2 115.4-21-12-40.9-26-59.4-41.8 31.8-29.2 67.9-52.4 107.6-69.2zM165.5 365.7c13.8-32.6 32-62.8 54.2-90.2 24.9 21.5 52.2 40.3 81.5 55.9-11.6 46.9-18.8 98.4-20.7 152.6H137c3-40.9 12.6-80.6 28.5-118.3zM137 540h143.5c1.9 54.2 9.1 105.7 20.7 152.6a444.07 444.07 0 00-81.5 55.9A373.86 373.86 0 01137 540zm228.7 318.5c-39.7-16.8-75.8-40-107.6-69.2 18.5-15.8 38.4-29.7 59.4-41.8 15.7 45 35.8 84.1 59.2 115.4-3.7-1.4-7.4-2.9-11-4.4zm292.6 0c-3.7 1.5-7.3 3-11 4.4 23.4-31.3 43.5-70.4 59.2-115.4 21 12 40.9 26 59.4 41.8a373.81 373.81 0 01-107.6 69.2z"}}]},name:"global",theme:"outlined"},nn=function(s,t){return j.createElement(pe,se({},s,{ref:t,icon:an}))},ln=j.forwardRef(nn),on={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"},rn=function(s,t){return j.createElement(pe,se({},s,{ref:t,icon:on}))},zt=j.forwardRef(rn),cn={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"},dn=function(s,t){return j.createElement(pe,se({},s,{ref:t,icon:cn}))},Vt=j.forwardRef(dn),hn={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"},un=function(s,t){return j.createElement(pe,se({},s,{ref:t,icon:hn}))},Ut=j.forwardRef(un),mn=Object.defineProperty,Ye=Object.getOwnPropertySymbols,cs=Object.prototype.hasOwnProperty,ds=Object.prototype.propertyIsEnumerable,qt=(n,s,t)=>s in n?mn(n,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[s]=t,mt=(n,s)=>{for(var t in s||(s={}))cs.call(s,t)&&qt(n,t,s[t]);if(Ye)for(var t of Ye(s))ds.call(s,t)&&qt(n,t,s[t]);return n},pt=(n,s)=>{var t={};for(var a in n)cs.call(n,a)&&s.indexOf(a)<0&&(t[a]=n[a]);if(n!=null&&Ye)for(var a of Ye(n))s.indexOf(a)<0&&ds.call(n,a)&&(t[a]=n[a]);return t};/**
|
|
2
2
|
* @license QR Code generator library (TypeScript)
|
|
3
3
|
* Copyright (c) Project Nayuki.
|
|
4
4
|
* SPDX-License-Identifier: MIT
|
|
5
|
-
*/var Le;(n=>{const s=class D{constructor(i,h,o,r){if(this.version=i,this.errorCorrectionLevel=h,this.modules=[],this.isFunction=[],i<D.MIN_VERSION||i>D.MAX_VERSION)throw new RangeError("Version value out of range");if(r<-1||r>7)throw new RangeError("Mask value out of range");this.size=i*4+17;let m=[];for(let x=0;x<this.size;x++)m.push(!1);for(let x=0;x<this.size;x++)this.modules.push(m.slice()),this.isFunction.push(m.slice());this.drawFunctionPatterns();const y=this.addEccAndInterleave(o);if(this.drawCodewords(y),r==-1){let x=1e9;for(let f=0;f<8;f++){this.applyMask(f),this.drawFormatBits(f);const v=this.getPenaltyScore();v<x&&(r=f,x=v),this.applyMask(f)}}c(0<=r&&r<=7),this.mask=r,this.applyMask(r),this.drawFormatBits(r),this.isFunction=[]}static encodeText(i,h){const o=n.QrSegment.makeSegments(i);return D.encodeSegments(o,h)}static encodeBinary(i,h){const o=n.QrSegment.makeBytes(i);return D.encodeSegments([o],h)}static encodeSegments(i,h,o=1,r=40,m=-1,y=!0){if(!(D.MIN_VERSION<=o&&o<=r&&r<=D.MAX_VERSION)||m<-1||m>7)throw new RangeError("Invalid value");let x,f;for(x=o;;x++){const _=D.getNumDataCodewords(x,h)*8,b=u.getTotalBits(i,x);if(b<=_){f=b;break}if(x>=r)throw new RangeError("Data too long")}for(const _ of[D.Ecc.MEDIUM,D.Ecc.QUARTILE,D.Ecc.HIGH])y&&f<=D.getNumDataCodewords(x,_)*8&&(h=_);let v=[];for(const _ of i){t(_.mode.modeBits,4,v),t(_.numChars,_.mode.numCharCountBits(x),v);for(const b of _.getData())v.push(b)}c(v.length==f);const C=D.getNumDataCodewords(x,h)*8;c(v.length<=C),t(0,Math.min(4,C-v.length),v),t(0,(8-v.length%8)%8,v),c(v.length%8==0);for(let _=236;v.length<C;_^=253)t(_,8,v);let k=[];for(;k.length*8<v.length;)k.push(0);return v.forEach((_,b)=>k[b>>>3]|=_<<7-(b&7)),new D(x,h,k,m)}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 o=0;o<this.size;o++)this.setFunctionModule(6,o,o%2==0),this.setFunctionModule(o,6,o%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 o=0;o<h;o++)for(let r=0;r<h;r++)o==0&&r==0||o==0&&r==h-1||o==h-1&&r==0||this.drawAlignmentPattern(i[o],i[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(i){const h=this.errorCorrectionLevel.formatBits<<3|i;let o=h;for(let m=0;m<10;m++)o=o<<1^(o>>>9)*1335;const r=(h<<10|o)^21522;c(r>>>15==0);for(let m=0;m<=5;m++)this.setFunctionModule(8,m,a(r,m));this.setFunctionModule(8,7,a(r,6)),this.setFunctionModule(8,8,a(r,7)),this.setFunctionModule(7,8,a(r,8));for(let m=9;m<15;m++)this.setFunctionModule(14-m,8,a(r,m));for(let m=0;m<8;m++)this.setFunctionModule(this.size-1-m,8,a(r,m));for(let m=8;m<15;m++)this.setFunctionModule(8,this.size-15+m,a(r,m));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let i=this.version;for(let o=0;o<12;o++)i=i<<1^(i>>>11)*7973;const h=this.version<<12|i;c(h>>>18==0);for(let o=0;o<18;o++){const r=a(h,o),m=this.size-11+o%3,y=Math.floor(o/3);this.setFunctionModule(m,y,r),this.setFunctionModule(y,m,r)}}drawFinderPattern(i,h){for(let o=-4;o<=4;o++)for(let r=-4;r<=4;r++){const m=Math.max(Math.abs(r),Math.abs(o)),y=i+r,x=h+o;0<=y&&y<this.size&&0<=x&&x<this.size&&this.setFunctionModule(y,x,m!=2&&m!=4)}}drawAlignmentPattern(i,h){for(let o=-2;o<=2;o++)for(let r=-2;r<=2;r++)this.setFunctionModule(i+r,h+o,Math.max(Math.abs(r),Math.abs(o))!=1)}setFunctionModule(i,h,o){this.modules[h][i]=o,this.isFunction[h][i]=!0}addEccAndInterleave(i){const h=this.version,o=this.errorCorrectionLevel;if(i.length!=D.getNumDataCodewords(h,o))throw new RangeError("Invalid argument");const r=D.NUM_ERROR_CORRECTION_BLOCKS[o.ordinal][h],m=D.ECC_CODEWORDS_PER_BLOCK[o.ordinal][h],y=Math.floor(D.getNumRawDataModules(h)/8),x=r-y%r,f=Math.floor(y/r);let v=[];const C=D.reedSolomonComputeDivisor(m);for(let _=0,b=0;_<r;_++){let T=i.slice(b,b+f-m+(_<x?0:1));b+=T.length;const R=D.reedSolomonComputeRemainder(T,C);_<x&&T.push(0),v.push(T.concat(R))}let k=[];for(let _=0;_<v[0].length;_++)v.forEach((b,T)=>{(_!=f-m||T>=x)&&k.push(b[_])});return c(k.length==y),k}drawCodewords(i){if(i.length!=Math.floor(D.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let h=0;for(let o=this.size-1;o>=1;o-=2){o==6&&(o=5);for(let r=0;r<this.size;r++)for(let m=0;m<2;m++){const y=o-m,f=(o+1&2)==0?this.size-1-r:r;!this.isFunction[f][y]&&h<i.length*8&&(this.modules[f][y]=a(i[h>>>3],7-(h&7)),h++)}}c(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 o=0;o<this.size;o++){let r;switch(i){case 0:r=(o+h)%2==0;break;case 1:r=h%2==0;break;case 2:r=o%3==0;break;case 3:r=(o+h)%3==0;break;case 4:r=(Math.floor(o/3)+Math.floor(h/2))%2==0;break;case 5:r=o*h%2+o*h%3==0;break;case 6:r=(o*h%2+o*h%3)%2==0;break;case 7:r=((o+h)%2+o*h%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[h][o]&&r&&(this.modules[h][o]=!this.modules[h][o])}}getPenaltyScore(){let i=0;for(let m=0;m<this.size;m++){let y=!1,x=0,f=[0,0,0,0,0,0,0];for(let v=0;v<this.size;v++)this.modules[m][v]==y?(x++,x==5?i+=D.PENALTY_N1:x>5&&i++):(this.finderPenaltyAddHistory(x,f),y||(i+=this.finderPenaltyCountPatterns(f)*D.PENALTY_N3),y=this.modules[m][v],x=1);i+=this.finderPenaltyTerminateAndCount(y,x,f)*D.PENALTY_N3}for(let m=0;m<this.size;m++){let y=!1,x=0,f=[0,0,0,0,0,0,0];for(let v=0;v<this.size;v++)this.modules[v][m]==y?(x++,x==5?i+=D.PENALTY_N1:x>5&&i++):(this.finderPenaltyAddHistory(x,f),y||(i+=this.finderPenaltyCountPatterns(f)*D.PENALTY_N3),y=this.modules[v][m],x=1);i+=this.finderPenaltyTerminateAndCount(y,x,f)*D.PENALTY_N3}for(let m=0;m<this.size-1;m++)for(let y=0;y<this.size-1;y++){const x=this.modules[m][y];x==this.modules[m][y+1]&&x==this.modules[m+1][y]&&x==this.modules[m+1][y+1]&&(i+=D.PENALTY_N2)}let h=0;for(const m of this.modules)h=m.reduce((y,x)=>y+(x?1:0),h);const o=this.size*this.size,r=Math.ceil(Math.abs(h*20-o*10)/o)-1;return c(0<=r&&r<=9),i+=r*D.PENALTY_N4,c(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 o=[6];for(let r=this.size-7;o.length<i;r-=h)o.splice(1,0,r);return o}}static getNumRawDataModules(i){if(i<D.MIN_VERSION||i>D.MAX_VERSION)throw new RangeError("Version number out of range");let h=(16*i+128)*i+64;if(i>=2){const o=Math.floor(i/7)+2;h-=(25*o-10)*o-55,i>=7&&(h-=36)}return c(208<=h&&h<=29648),h}static getNumDataCodewords(i,h){return Math.floor(D.getNumRawDataModules(i)/8)-D.ECC_CODEWORDS_PER_BLOCK[h.ordinal][i]*D.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 r=0;r<i-1;r++)h.push(0);h.push(1);let o=1;for(let r=0;r<i;r++){for(let m=0;m<h.length;m++)h[m]=D.reedSolomonMultiply(h[m],o),m+1<h.length&&(h[m]^=h[m+1]);o=D.reedSolomonMultiply(o,2)}return h}static reedSolomonComputeRemainder(i,h){let o=h.map(r=>0);for(const r of i){const m=r^o.shift();o.push(0),h.forEach((y,x)=>o[x]^=D.reedSolomonMultiply(y,m))}return o}static reedSolomonMultiply(i,h){if(i>>>8||h>>>8)throw new RangeError("Byte out of range");let o=0;for(let r=7;r>=0;r--)o=o<<1^(o>>>7)*285,o^=(h>>>r&1)*i;return c(o>>>8==0),o}finderPenaltyCountPatterns(i){const h=i[1];c(h<=this.size*3);const o=h>0&&i[2]==h&&i[3]==h*3&&i[4]==h&&i[5]==h;return(o&&i[0]>=h*4&&i[6]>=h?1:0)+(o&&i[6]>=h*4&&i[0]>=h?1:0)}finderPenaltyTerminateAndCount(i,h,o){return i&&(this.finderPenaltyAddHistory(h,o),h=0),h+=this.size,this.finderPenaltyAddHistory(h,o),this.finderPenaltyCountPatterns(o)}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]],n.QrCode=s;function t(g,i,h){if(i<0||i>31||g>>>i)throw new RangeError("Value out of range");for(let o=i-1;o>=0;o--)h.push(g>>>o&1)}function a(g,i){return(g>>>i&1)!=0}function c(g){if(!g)throw new Error("Assertion error")}const l=class J{constructor(i,h,o){if(this.mode=i,this.numChars=h,this.bitData=o,h<0)throw new RangeError("Invalid argument");this.bitData=o.slice()}static makeBytes(i){let h=[];for(const o of i)t(o,8,h);return new J(J.Mode.BYTE,i.length,h)}static makeNumeric(i){if(!J.isNumeric(i))throw new RangeError("String contains non-numeric characters");let h=[];for(let o=0;o<i.length;){const r=Math.min(i.length-o,3);t(parseInt(i.substring(o,o+r),10),r*3+1,h),o+=r}return new J(J.Mode.NUMERIC,i.length,h)}static makeAlphanumeric(i){if(!J.isAlphanumeric(i))throw new RangeError("String contains unencodable characters in alphanumeric mode");let h=[],o;for(o=0;o+2<=i.length;o+=2){let r=J.ALPHANUMERIC_CHARSET.indexOf(i.charAt(o))*45;r+=J.ALPHANUMERIC_CHARSET.indexOf(i.charAt(o+1)),t(r,11,h)}return o<i.length&&t(J.ALPHANUMERIC_CHARSET.indexOf(i.charAt(o)),6,h),new J(J.Mode.ALPHANUMERIC,i.length,h)}static makeSegments(i){return i==""?[]:J.isNumeric(i)?[J.makeNumeric(i)]:J.isAlphanumeric(i)?[J.makeAlphanumeric(i)]:[J.makeBytes(J.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 J(J.Mode.ECI,0,h)}static isNumeric(i){return J.NUMERIC_REGEX.test(i)}static isAlphanumeric(i){return J.ALPHANUMERIC_REGEX.test(i)}getData(){return this.bitData.slice()}static getTotalBits(i,h){let o=0;for(const r of i){const m=r.mode.numCharCountBits(h);if(r.numChars>=1<<m)return 1/0;o+=4+m+r.bitData.length}return o}static toUtf8ByteArray(i){i=encodeURI(i);let h=[];for(let o=0;o<i.length;o++)i.charAt(o)!="%"?h.push(i.charCodeAt(o)):(h.push(parseInt(i.substring(o+1,o+3),16)),o+=2);return h}};l.NUMERIC_REGEX=/^[0-9]*$/,l.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,l.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let u=l;n.QrSegment=l})(Le||(Le={}));(n=>{(s=>{const t=class{constructor(c,l){this.ordinal=c,this.formatBits=l}};t.LOW=new t(0,1),t.MEDIUM=new t(1,0),t.QUARTILE=new t(2,3),t.HIGH=new t(3,2),s.Ecc=t})(n.QrCode||(n.QrCode={}))})(Le||(Le={}));(n=>{(s=>{const t=class{constructor(c,l){this.modeBits=c,this.numBitsCharCount=l}numCharCountBits(c){return this.numBitsCharCount[Math.floor((c+7)/17)]}};t.NUMERIC=new t(1,[10,12,14]),t.ALPHANUMERIC=new t(2,[9,11,13]),t.BYTE=new t(4,[8,16,16]),t.KANJI=new t(8,[8,10,12]),t.ECI=new t(7,[0,0,0]),s.Mode=t})(n.QrSegment||(n.QrSegment={}))})(Le||(Le={}));var He=Le;/**
|
|
5
|
+
*/var Le;(n=>{const s=class D{constructor(i,h,o,r){if(this.version=i,this.errorCorrectionLevel=h,this.modules=[],this.isFunction=[],i<D.MIN_VERSION||i>D.MAX_VERSION)throw new RangeError("Version value out of range");if(r<-1||r>7)throw new RangeError("Mask value out of range");this.size=i*4+17;let m=[];for(let x=0;x<this.size;x++)m.push(!1);for(let x=0;x<this.size;x++)this.modules.push(m.slice()),this.isFunction.push(m.slice());this.drawFunctionPatterns();const v=this.addEccAndInterleave(o);if(this.drawCodewords(v),r==-1){let x=1e9;for(let f=0;f<8;f++){this.applyMask(f),this.drawFormatBits(f);const y=this.getPenaltyScore();y<x&&(r=f,x=y),this.applyMask(f)}}c(0<=r&&r<=7),this.mask=r,this.applyMask(r),this.drawFormatBits(r),this.isFunction=[]}static encodeText(i,h){const o=n.QrSegment.makeSegments(i);return D.encodeSegments(o,h)}static encodeBinary(i,h){const o=n.QrSegment.makeBytes(i);return D.encodeSegments([o],h)}static encodeSegments(i,h,o=1,r=40,m=-1,v=!0){if(!(D.MIN_VERSION<=o&&o<=r&&r<=D.MAX_VERSION)||m<-1||m>7)throw new RangeError("Invalid value");let x,f;for(x=o;;x++){const _=D.getNumDataCodewords(x,h)*8,b=u.getTotalBits(i,x);if(b<=_){f=b;break}if(x>=r)throw new RangeError("Data too long")}for(const _ of[D.Ecc.MEDIUM,D.Ecc.QUARTILE,D.Ecc.HIGH])v&&f<=D.getNumDataCodewords(x,_)*8&&(h=_);let y=[];for(const _ of i){t(_.mode.modeBits,4,y),t(_.numChars,_.mode.numCharCountBits(x),y);for(const b of _.getData())y.push(b)}c(y.length==f);const C=D.getNumDataCodewords(x,h)*8;c(y.length<=C),t(0,Math.min(4,C-y.length),y),t(0,(8-y.length%8)%8,y),c(y.length%8==0);for(let _=236;y.length<C;_^=253)t(_,8,y);let k=[];for(;k.length*8<y.length;)k.push(0);return y.forEach((_,b)=>k[b>>>3]|=_<<7-(b&7)),new D(x,h,k,m)}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 o=0;o<this.size;o++)this.setFunctionModule(6,o,o%2==0),this.setFunctionModule(o,6,o%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 o=0;o<h;o++)for(let r=0;r<h;r++)o==0&&r==0||o==0&&r==h-1||o==h-1&&r==0||this.drawAlignmentPattern(i[o],i[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(i){const h=this.errorCorrectionLevel.formatBits<<3|i;let o=h;for(let m=0;m<10;m++)o=o<<1^(o>>>9)*1335;const r=(h<<10|o)^21522;c(r>>>15==0);for(let m=0;m<=5;m++)this.setFunctionModule(8,m,a(r,m));this.setFunctionModule(8,7,a(r,6)),this.setFunctionModule(8,8,a(r,7)),this.setFunctionModule(7,8,a(r,8));for(let m=9;m<15;m++)this.setFunctionModule(14-m,8,a(r,m));for(let m=0;m<8;m++)this.setFunctionModule(this.size-1-m,8,a(r,m));for(let m=8;m<15;m++)this.setFunctionModule(8,this.size-15+m,a(r,m));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let i=this.version;for(let o=0;o<12;o++)i=i<<1^(i>>>11)*7973;const h=this.version<<12|i;c(h>>>18==0);for(let o=0;o<18;o++){const r=a(h,o),m=this.size-11+o%3,v=Math.floor(o/3);this.setFunctionModule(m,v,r),this.setFunctionModule(v,m,r)}}drawFinderPattern(i,h){for(let o=-4;o<=4;o++)for(let r=-4;r<=4;r++){const m=Math.max(Math.abs(r),Math.abs(o)),v=i+r,x=h+o;0<=v&&v<this.size&&0<=x&&x<this.size&&this.setFunctionModule(v,x,m!=2&&m!=4)}}drawAlignmentPattern(i,h){for(let o=-2;o<=2;o++)for(let r=-2;r<=2;r++)this.setFunctionModule(i+r,h+o,Math.max(Math.abs(r),Math.abs(o))!=1)}setFunctionModule(i,h,o){this.modules[h][i]=o,this.isFunction[h][i]=!0}addEccAndInterleave(i){const h=this.version,o=this.errorCorrectionLevel;if(i.length!=D.getNumDataCodewords(h,o))throw new RangeError("Invalid argument");const r=D.NUM_ERROR_CORRECTION_BLOCKS[o.ordinal][h],m=D.ECC_CODEWORDS_PER_BLOCK[o.ordinal][h],v=Math.floor(D.getNumRawDataModules(h)/8),x=r-v%r,f=Math.floor(v/r);let y=[];const C=D.reedSolomonComputeDivisor(m);for(let _=0,b=0;_<r;_++){let T=i.slice(b,b+f-m+(_<x?0:1));b+=T.length;const R=D.reedSolomonComputeRemainder(T,C);_<x&&T.push(0),y.push(T.concat(R))}let k=[];for(let _=0;_<y[0].length;_++)y.forEach((b,T)=>{(_!=f-m||T>=x)&&k.push(b[_])});return c(k.length==v),k}drawCodewords(i){if(i.length!=Math.floor(D.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let h=0;for(let o=this.size-1;o>=1;o-=2){o==6&&(o=5);for(let r=0;r<this.size;r++)for(let m=0;m<2;m++){const v=o-m,f=(o+1&2)==0?this.size-1-r:r;!this.isFunction[f][v]&&h<i.length*8&&(this.modules[f][v]=a(i[h>>>3],7-(h&7)),h++)}}c(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 o=0;o<this.size;o++){let r;switch(i){case 0:r=(o+h)%2==0;break;case 1:r=h%2==0;break;case 2:r=o%3==0;break;case 3:r=(o+h)%3==0;break;case 4:r=(Math.floor(o/3)+Math.floor(h/2))%2==0;break;case 5:r=o*h%2+o*h%3==0;break;case 6:r=(o*h%2+o*h%3)%2==0;break;case 7:r=((o+h)%2+o*h%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[h][o]&&r&&(this.modules[h][o]=!this.modules[h][o])}}getPenaltyScore(){let i=0;for(let m=0;m<this.size;m++){let v=!1,x=0,f=[0,0,0,0,0,0,0];for(let y=0;y<this.size;y++)this.modules[m][y]==v?(x++,x==5?i+=D.PENALTY_N1:x>5&&i++):(this.finderPenaltyAddHistory(x,f),v||(i+=this.finderPenaltyCountPatterns(f)*D.PENALTY_N3),v=this.modules[m][y],x=1);i+=this.finderPenaltyTerminateAndCount(v,x,f)*D.PENALTY_N3}for(let m=0;m<this.size;m++){let v=!1,x=0,f=[0,0,0,0,0,0,0];for(let y=0;y<this.size;y++)this.modules[y][m]==v?(x++,x==5?i+=D.PENALTY_N1:x>5&&i++):(this.finderPenaltyAddHistory(x,f),v||(i+=this.finderPenaltyCountPatterns(f)*D.PENALTY_N3),v=this.modules[y][m],x=1);i+=this.finderPenaltyTerminateAndCount(v,x,f)*D.PENALTY_N3}for(let m=0;m<this.size-1;m++)for(let v=0;v<this.size-1;v++){const x=this.modules[m][v];x==this.modules[m][v+1]&&x==this.modules[m+1][v]&&x==this.modules[m+1][v+1]&&(i+=D.PENALTY_N2)}let h=0;for(const m of this.modules)h=m.reduce((v,x)=>v+(x?1:0),h);const o=this.size*this.size,r=Math.ceil(Math.abs(h*20-o*10)/o)-1;return c(0<=r&&r<=9),i+=r*D.PENALTY_N4,c(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 o=[6];for(let r=this.size-7;o.length<i;r-=h)o.splice(1,0,r);return o}}static getNumRawDataModules(i){if(i<D.MIN_VERSION||i>D.MAX_VERSION)throw new RangeError("Version number out of range");let h=(16*i+128)*i+64;if(i>=2){const o=Math.floor(i/7)+2;h-=(25*o-10)*o-55,i>=7&&(h-=36)}return c(208<=h&&h<=29648),h}static getNumDataCodewords(i,h){return Math.floor(D.getNumRawDataModules(i)/8)-D.ECC_CODEWORDS_PER_BLOCK[h.ordinal][i]*D.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 r=0;r<i-1;r++)h.push(0);h.push(1);let o=1;for(let r=0;r<i;r++){for(let m=0;m<h.length;m++)h[m]=D.reedSolomonMultiply(h[m],o),m+1<h.length&&(h[m]^=h[m+1]);o=D.reedSolomonMultiply(o,2)}return h}static reedSolomonComputeRemainder(i,h){let o=h.map(r=>0);for(const r of i){const m=r^o.shift();o.push(0),h.forEach((v,x)=>o[x]^=D.reedSolomonMultiply(v,m))}return o}static reedSolomonMultiply(i,h){if(i>>>8||h>>>8)throw new RangeError("Byte out of range");let o=0;for(let r=7;r>=0;r--)o=o<<1^(o>>>7)*285,o^=(h>>>r&1)*i;return c(o>>>8==0),o}finderPenaltyCountPatterns(i){const h=i[1];c(h<=this.size*3);const o=h>0&&i[2]==h&&i[3]==h*3&&i[4]==h&&i[5]==h;return(o&&i[0]>=h*4&&i[6]>=h?1:0)+(o&&i[6]>=h*4&&i[0]>=h?1:0)}finderPenaltyTerminateAndCount(i,h,o){return i&&(this.finderPenaltyAddHistory(h,o),h=0),h+=this.size,this.finderPenaltyAddHistory(h,o),this.finderPenaltyCountPatterns(o)}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]],n.QrCode=s;function t(g,i,h){if(i<0||i>31||g>>>i)throw new RangeError("Value out of range");for(let o=i-1;o>=0;o--)h.push(g>>>o&1)}function a(g,i){return(g>>>i&1)!=0}function c(g){if(!g)throw new Error("Assertion error")}const l=class J{constructor(i,h,o){if(this.mode=i,this.numChars=h,this.bitData=o,h<0)throw new RangeError("Invalid argument");this.bitData=o.slice()}static makeBytes(i){let h=[];for(const o of i)t(o,8,h);return new J(J.Mode.BYTE,i.length,h)}static makeNumeric(i){if(!J.isNumeric(i))throw new RangeError("String contains non-numeric characters");let h=[];for(let o=0;o<i.length;){const r=Math.min(i.length-o,3);t(parseInt(i.substring(o,o+r),10),r*3+1,h),o+=r}return new J(J.Mode.NUMERIC,i.length,h)}static makeAlphanumeric(i){if(!J.isAlphanumeric(i))throw new RangeError("String contains unencodable characters in alphanumeric mode");let h=[],o;for(o=0;o+2<=i.length;o+=2){let r=J.ALPHANUMERIC_CHARSET.indexOf(i.charAt(o))*45;r+=J.ALPHANUMERIC_CHARSET.indexOf(i.charAt(o+1)),t(r,11,h)}return o<i.length&&t(J.ALPHANUMERIC_CHARSET.indexOf(i.charAt(o)),6,h),new J(J.Mode.ALPHANUMERIC,i.length,h)}static makeSegments(i){return i==""?[]:J.isNumeric(i)?[J.makeNumeric(i)]:J.isAlphanumeric(i)?[J.makeAlphanumeric(i)]:[J.makeBytes(J.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 J(J.Mode.ECI,0,h)}static isNumeric(i){return J.NUMERIC_REGEX.test(i)}static isAlphanumeric(i){return J.ALPHANUMERIC_REGEX.test(i)}getData(){return this.bitData.slice()}static getTotalBits(i,h){let o=0;for(const r of i){const m=r.mode.numCharCountBits(h);if(r.numChars>=1<<m)return 1/0;o+=4+m+r.bitData.length}return o}static toUtf8ByteArray(i){i=encodeURI(i);let h=[];for(let o=0;o<i.length;o++)i.charAt(o)!="%"?h.push(i.charCodeAt(o)):(h.push(parseInt(i.substring(o+1,o+3),16)),o+=2);return h}};l.NUMERIC_REGEX=/^[0-9]*$/,l.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,l.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let u=l;n.QrSegment=l})(Le||(Le={}));(n=>{(s=>{const t=class{constructor(c,l){this.ordinal=c,this.formatBits=l}};t.LOW=new t(0,1),t.MEDIUM=new t(1,0),t.QUARTILE=new t(2,3),t.HIGH=new t(3,2),s.Ecc=t})(n.QrCode||(n.QrCode={}))})(Le||(Le={}));(n=>{(s=>{const t=class{constructor(c,l){this.modeBits=c,this.numBitsCharCount=l}numCharCountBits(c){return this.numBitsCharCount[Math.floor((c+7)/17)]}};t.NUMERIC=new t(1,[10,12,14]),t.ALPHANUMERIC=new t(2,[9,11,13]),t.BYTE=new t(4,[8,16,16]),t.KANJI=new t(8,[8,10,12]),t.ECI=new t(7,[0,0,0]),s.Mode=t})(n.QrSegment||(n.QrSegment={}))})(Le||(Le={}));var He=Le;/**
|
|
6
6
|
* @license qrcode.react
|
|
7
7
|
* Copyright (c) Paul O'Shannessy
|
|
8
8
|
* SPDX-License-Identifier: ISC
|
|
9
|
-
*/var pn={L:He.QrCode.Ecc.LOW,M:He.QrCode.Ecc.MEDIUM,Q:He.QrCode.Ecc.QUARTILE,H:He.QrCode.Ecc.HIGH},hs=128,us="L",ms="#FFFFFF",ps="#000000",gs=!1,fs=1,gn=4,fn=0,xn=.1;function xs(n,s=0){const t=[];return n.forEach(function(a,c){let l=null;a.forEach(function(u,g){if(!u&&l!==null){t.push(`M${l+s} ${c+s}h${g-l}v1H${l+s}z`),l=null;return}if(g===a.length-1){if(!u)return;l===null?t.push(`M${g+s},${c+s} h1v1H${g+s}z`):t.push(`M${l+s},${c+s} h${g+1-l}v1H${l+s}z`);return}u&&l===null&&(l=g)})}),t.join("")}function
|
|
9
|
+
*/var pn={L:He.QrCode.Ecc.LOW,M:He.QrCode.Ecc.MEDIUM,Q:He.QrCode.Ecc.QUARTILE,H:He.QrCode.Ecc.HIGH},hs=128,us="L",ms="#FFFFFF",ps="#000000",gs=!1,fs=1,gn=4,fn=0,xn=.1;function xs(n,s=0){const t=[];return n.forEach(function(a,c){let l=null;a.forEach(function(u,g){if(!u&&l!==null){t.push(`M${l+s} ${c+s}h${g-l}v1H${l+s}z`),l=null;return}if(g===a.length-1){if(!u)return;l===null?t.push(`M${g+s},${c+s} h1v1H${g+s}z`):t.push(`M${l+s},${c+s} h${g+1-l}v1H${l+s}z`);return}u&&l===null&&(l=g)})}),t.join("")}function ys(n,s){return n.slice().map((t,a)=>a<s.y||a>=s.y+s.h?t:t.map((c,l)=>l<s.x||l>=s.x+s.w?c:!1))}function yn(n,s,t,a){if(a==null)return null;const c=n.length+t*2,l=Math.floor(s*xn),u=c/s,g=(a.width||l)*u,i=(a.height||l)*u,h=a.x==null?n.length/2-g/2:a.x*u,o=a.y==null?n.length/2-i/2:a.y*u,r=a.opacity==null?1:a.opacity;let m=null;if(a.excavate){let x=Math.floor(h),f=Math.floor(o),y=Math.ceil(g+h-x),C=Math.ceil(i+o-f);m={x,y:f,w:y,h:C}}const v=a.crossOrigin;return{x:h,y:o,h:i,w:g,excavation:m,opacity:r,crossOrigin:v}}function vn(n,s){return s!=null?Math.max(Math.floor(s),0):n?gn:fn}function vs({value:n,level:s,minVersion:t,includeMargin:a,marginSize:c,imageSettings:l,size:u,boostLevel:g}){let i=q.useMemo(()=>{const x=(Array.isArray(n)?n:[n]).reduce((f,y)=>(f.push(...He.QrSegment.makeSegments(y)),f),[]);return He.QrCode.encodeSegments(x,pn[s],t,void 0,void 0,g)},[n,s,t,g]);const{cells:h,margin:o,numCells:r,calculatedImageSettings:m}=q.useMemo(()=>{let v=i.getModules();const x=vn(a,c),f=v.length+x*2,y=yn(v,u,x,l);return{cells:v,margin:x,numCells:f,calculatedImageSettings:y}},[i,u,l,a,c]);return{qrcode:i,margin:o,cells:h,numCells:r,calculatedImageSettings:m}}var jn=(function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0})(),js=q.forwardRef(function(s,t){const a=s,{value:c,size:l=hs,level:u=us,bgColor:g=ms,fgColor:i=ps,includeMargin:h=gs,minVersion:o=fs,boostLevel:r,marginSize:m,imageSettings:v}=a,f=pt(a,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:y}=f,C=pt(f,["style"]),k=v==null?void 0:v.src,_=q.useRef(null),b=q.useRef(null),T=q.useCallback(A=>{_.current=A,typeof t=="function"?t(A):t&&(t.current=A)},[t]),[R,P]=q.useState(!1),{margin:I,cells:M,numCells:B,calculatedImageSettings:F}=vs({value:c,level:u,minVersion:o,boostLevel:r,includeMargin:h,marginSize:m,imageSettings:v,size:l});q.useEffect(()=>{if(_.current!=null){const A=_.current,X=A.getContext("2d");if(!X)return;let oe=M;const Z=b.current,he=F!=null&&Z!==null&&Z.complete&&Z.naturalHeight!==0&&Z.naturalWidth!==0;he&&F.excavation!=null&&(oe=ys(M,F.excavation));const ue=window.devicePixelRatio||1;A.height=A.width=l*ue;const fe=l/B*ue;X.scale(fe,fe),X.fillStyle=g,X.fillRect(0,0,B,B),X.fillStyle=i,jn?X.fill(new Path2D(xs(oe,I))):M.forEach(function(N,U){N.forEach(function(ee,de){ee&&X.fillRect(de+I,U+I,1,1)})}),F&&(X.globalAlpha=F.opacity),he&&X.drawImage(Z,F.x+I,F.y+I,F.w,F.h)}}),q.useEffect(()=>{P(!1)},[k]);const ae=mt({height:l,width:l},y);let ne=null;return k!=null&&(ne=q.createElement("img",{src:k,key:k,style:{display:"none"},onLoad:()=>{P(!0)},ref:b,crossOrigin:F==null?void 0:F.crossOrigin})),q.createElement(q.Fragment,null,q.createElement("canvas",mt({style:ae,height:l,width:l,ref:T,role:"img"},C)),ne)});js.displayName="QRCodeCanvas";var Cn=q.forwardRef(function(s,t){const a=s,{value:c,size:l=hs,level:u=us,bgColor:g=ms,fgColor:i=ps,includeMargin:h=gs,minVersion:o=fs,boostLevel:r,title:m,marginSize:v,imageSettings:x}=a,f=pt(a,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:y,cells:C,numCells:k,calculatedImageSettings:_}=vs({value:c,level:u,minVersion:o,boostLevel:r,includeMargin:h,marginSize:v,imageSettings:x,size:l});let b=C,T=null;x!=null&&_!=null&&(_.excavation!=null&&(b=ys(C,_.excavation)),T=q.createElement("image",{href:x.src,height:_.h,width:_.w,x:_.x+y,y:_.y+y,preserveAspectRatio:"none",opacity:_.opacity,crossOrigin:_.crossOrigin}));const R=xs(b,y);return q.createElement("svg",mt({height:l,width:l,viewBox:`0 0 ${k} ${k}`,ref:t,role:"img"},f),!!m&&q.createElement("title",null,m),q.createElement("path",{fill:g,d:`M0,0 h${k}v${k}H0z`,shapeRendering:"crispEdges"}),q.createElement("path",{fill:i,d:R,shapeRendering:"crispEdges"}),T)});Cn.displayName="QRCodeSVG";const bn=[{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}],Nn={calibrationModels:bn},ot=Nn.calibrationModels,_n=[{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:"Українська"}],Wt=n=>{const s=t=>t.toUpperCase().split("").map(a=>String.fromCodePoint(127462+a.charCodeAt(0)-65)).join("");return!n||n.length!==2?s("CN"):s(n)},Me=class Me extends q.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 a=[];for(const g of t){const i=[],h=g.timestamp?new Date(g.timestamp).toLocaleString():"";h&&i.push(`${h}:
|
|
10
10
|
`);const o=(g.segments||[]).filter(r=>r.type==="text").map(r=>r.content);o.length>0&&i.push(o.join(`
|
|
11
11
|
`)),a.push(i.join(`
|
|
12
12
|
`))}if(a.length===0)return;const c=new Blob([a.join(`
|
|
@@ -15,25 +15,25 @@ var Ms=Object.defineProperty;var Es=(n,s,t)=>s in n?Ms(n,s,{enumerable:!0,config
|
|
|
15
15
|
|
|
16
16
|
`)],{type:"text/plain;charset=utf-8"}),l=URL.createObjectURL(c),u=document.createElement("a");u.href=l,u.download=`user-prompts-${new Date().toISOString().slice(0,10)}.txt`,u.click(),URL.revokeObjectURL(l)});O(this,"handleCalibrationModelChange",t=>{this.setState({calibrationModel:t}),localStorage.setItem("ccv_calibrationModel",t)});O(this,"handleShowProjectStats",()=>{this.setState({projectStatsVisible:!0,projectStatsLoading:!0}),fetch(le("/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(le("/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,a)=>{fetch(le("/api/preferences")).then(c=>c.json()).then(c=>{let l=Array.isArray(c.disabledPlugins)?[...c.disabledPlugins]:[];return a?l=l.filter(u=>u!==t):l.includes(t)||l.push(t),fetch(le("/api/preferences"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({disabledPlugins:l})})}).then(()=>fetch(le("/api/plugins/reload"),{method:"POST"})).then(c=>{if(!c.ok)throw new Error(c.status);return c.json()}).then(c=>{this.setState({pluginsList:c.plugins||[],pluginsDir:c.pluginsDir||""})}).catch(()=>{})});O(this,"handleDeletePlugin",(t,a)=>{this.setState({deleteConfirmVisible:!0,deleteTarget:{file:t,name:a}})});O(this,"handleDeletePluginConfirm",()=>{const{file:t}=this.state.deleteTarget||{};t&&(this.setState({deleteConfirmVisible:!1,deleteTarget:null}),fetch(le(`/api/plugins?file=${encodeURIComponent(t)}`),{method:"DELETE"}).then(a=>{if(!a.ok)throw new Error(a.status);return a.json()}).then(a=>{a.plugins&&this.setState({pluginsList:a.plugins,pluginsDir:a.pluginsDir||""})}).catch(()=>{}))});O(this,"handleReloadPlugins",()=>{fetch(le("/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 a=t.files;if(!a||a.length===0)return;for(const l of a)if(!l.name.endsWith(".js")&&!l.name.endsWith(".mjs")){G.error(p("ui.plugins.invalidFile"));return}const c=Array.from(a).map(l=>new Promise((u,g)=>{const i=new FileReader;i.onload=()=>u({name:l.name,content:i.result}),i.onerror=()=>g(new Error(`Failed to read ${l.name}`)),i.readAsText(l)}));Promise.all(c).then(l=>fetch(le("/api/plugins/upload"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:l})})).then(l=>l.ok?l.json():l.text().then(u=>{try{return JSON.parse(u)}catch{throw new Error(p("ui.plugins.serverError",{status:l.status}))}})).then(l=>{l.error?G.error(p("ui.plugins.addFailed",{reason:l.error})):l.plugins&&(this.setState({pluginsList:l.plugins,pluginsDir:l.pluginsDir||""}),G.success(p("ui.plugins.addSuccess")))}).catch(l=>{G.error(l.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()){G.error(p("ui.plugins.cdnUrlRequired"));return}try{new URL(t)}catch{G.error(p("ui.plugins.cdnInvalidUrl"));return}this.setState({cdnLoading:!0}),fetch(le("/api/plugins/install-from-url"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:t.trim()})}).then(a=>a.json()).then(a=>{a.error?G.error(p("ui.plugins.cdnInstallFailed",{reason:a.error})):(G.success(p("ui.plugins.cdnInstallSuccess")),a.plugins&&this.setState({pluginsList:a.plugins,pluginsDir:a.pluginsDir||""}),this.setState({cdnModalVisible:!1,cdnUrl:""}))}).catch(a=>{G.error(p("ui.plugins.cdnInstallFailed",{reason:a.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(le("/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=>{je.confirm({title:p("ui.processManagement.killConfirm"),onOk:()=>{fetch(le("/api/ccv-processes/kill"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({pid:t})}).then(a=>a.json()).then(a=>{a.ok?(G.success(p("ui.processManagement.killed")),this.fetchProcesses()):G.error(a.error||p("ui.processManagement.killFailed"))}).catch(()=>{G.error(p("ui.processManagement.killFailed"))})}})});this.state={countdownText:"",countryFlag:null,countryInfo:null,promptModalVisible:!1,promptData:[],promptViewMode:"original",settingsDrawerVisible:!1,globalSettingsVisible:!1,projectStatsVisible:!1,projectStats:null,projectStatsLoading:!1,localUrl:"",pluginModalVisible:!1,pluginsList:[],pluginsDir:"",deleteConfirmVisible:!1,deleteTarget:null,processModalVisible:!1,processList:[],processLoading:!1,logoDropdownOpen:!1,cacheHighlightIdx:null,cacheHighlightFading:!1,cdnModalVisible:!1,cdnUrl:"",cdnLoading:!1,calibrationModel:(a=>ot.some(c=>c.value===a)?a:"auto")(localStorage.getItem("ccv_calibrationModel")||"auto"),proxyModalVisible:!1,editingProxy:null,editForm:{name:"",baseURL:"",apiKey:"",models:"",activeModel:""},logDirDraft:null},this._rafId=null,this._expiredTimer=null,this.updateCountdown=this.updateCountdown.bind(this)}componentDidMount(){this.startCountdown(),fetch(le("/api/local-url")).then(t=>t.json()).then(t=>{t.url&&this.setState({localUrl:t.url})}).catch(()=>{}),fetch(le("/api/claude-settings")).then(t=>t.json()).then(t=>{t.model&&this.setState({settingsModel:t.model})}).catch(()=>{}),fetch("https://ipinfo.io/json").then(t=>t.json()).then(t=>{t.country&&this.setState({countryFlag:Wt(t.country),countryInfo:t})}).catch(()=>{this.setState({countryFlag:Wt("CN")})})}componentDidUpdate(t){t.cacheExpireAt!==this.props.cacheExpireAt&&this.startCountdown()}shouldComponentUpdate(t,a){return t.requests!==this.props.requests||t.requestCount!==this.props.requestCount||t.viewMode!==this.props.viewMode||t.cacheExpireAt!==this.props.cacheExpireAt||t.cacheType!==this.props.cacheType||t.isLocalLog!==this.props.isLocalLog||t.projectName!==this.props.projectName||t.collapseToolResults!==this.props.collapseToolResults||t.expandThinking!==this.props.expandThinking||t.showFullToolContent!==this.props.showFullToolContent||t.expandDiff!==this.props.expandDiff||t.filterIrrelevant!==this.props.filterIrrelevant||t.logDir!==this.props.logDir||t.cliMode!==this.props.cliMode||t.contextWindow!==this.props.contextWindow||t.serverCachedContent!==this.props.serverCachedContent||t.resumeAutoChoice!==this.props.resumeAutoChoice||t.proxyProfiles!==this.props.proxyProfiles||t.activeProxyId!==this.props.activeProxyId||t.defaultConfig!==this.props.defaultConfig||a!==this.state}componentWillUnmount(){this._rafId&&cancelAnimationFrame(this._rafId),this._expiredTimer&&clearTimeout(this._expiredTimer),this._cacheFadeClearTimer&&clearTimeout(this._cacheFadeClearTimer),this._cacheUnbindScrollFade()}startCountdown(){if(this._rafId&&cancelAnimationFrame(this._rafId),this._expiredTimer&&clearTimeout(this._expiredTimer),!this.props.cacheExpireAt){this.state.countdownText!==""&&this.setState({countdownText:""});return}this._rafId=requestAnimationFrame(this.updateCountdown)}updateCountdown(){const{cacheExpireAt:t}=this.props;if(!t){this.state.countdownText!==""&&this.setState({countdownText:""});return}const a=Math.max(0,t-Date.now());if(a<=0){const u=p("ui.cacheExpired");this.state.countdownText!==u&&this.setState({countdownText:u}),this._expiredTimer=setTimeout(()=>{this.state.countdownText!==""&&this.setState({countdownText:""})},5e3);return}const c=Math.ceil(a/1e3);let l;if(c>=60){const u=Math.floor(c/60),g=c%60;l=p("ui.minuteSecond",{m:u,s:String(g).padStart(2,"0")})}else l=p("ui.second",{s:c});l!==this.state.countdownText&&this.setState({countdownText:l}),this._rafId=requestAnimationFrame(this.updateCountdown)}static parseSegments(t){const a=[],c=/<([a-zA-Z_][\w-]*)(?:\s[^>]*)?>[\s\S]*?<\/\1>/g;let l=0,u;for(;(u=c.exec(t))!==null;){const i=t.slice(l,u.index).trim();i&&a.push({type:"text",content:i});const h=u[1];if(l=u.index+u[0].length,Me.COMMAND_TAGS.has(h))continue;const o=new RegExp(`^<${h}(?:\\s[^>]*)?>([\\s\\S]*)<\\/${h}>$`),r=u[0].match(o),m=r?r[1].trim():u[0].trim();a.push({type:"system",content:m,label:h})}const g=t.slice(l).trim();return g&&a.push({type:"text",content:g}),a}static extractUserTexts(t){const a=[],c=[];let l=null;for(const u of t)if(u.role==="user"){if(typeof u.content=="string"){const g=u.content.trim();if(!g)continue;if(!ze(g)){if(/Implement the following plan:/i.test(g))continue;a.push(g),c.push(g)}}else if(Array.isArray(u.content)){const{commands:g,textBlocks:i}=Xs(u.content);g.length>0&&(l=g[g.length-1]);const h=[];for(const r of i)/Implement the following plan:/i.test((r.text||"").trim())||h.push(r.text.trim());const o=u.content.filter(r=>{var m;return r.type==="text"&&((m=r.text)==null?void 0:m.trim())}).map(r=>r.text.trim());h.length>0&&(a.push(h.join(`
|
|
17
17
|
`)),c.push(o.join(`
|
|
18
|
-
`)))}}return{userMsgs:a,fullTexts:c,slashCmd:l}}extractUserPrompts(){var g;const{requests:t=[]}=this.props,a=[],c=new Set;let l=null;const u=t.filter(i=>Ce(i));for(let i=0;i<u.length;i++){const h=u[i],o=((g=h.body)==null?void 0:g.messages)||[],r=h.timestamp||"",{userMsgs:m,fullTexts:
|
|
18
|
+
`)))}}return{userMsgs:a,fullTexts:c,slashCmd:l}}extractUserPrompts(){var g;const{requests:t=[]}=this.props,a=[],c=new Set;let l=null;const u=t.filter(i=>Ce(i));for(let i=0;i<u.length;i++){const h=u[i],o=((g=h.body)==null?void 0:g.messages)||[],r=h.timestamp||"",{userMsgs:m,fullTexts:v,slashCmd:x}=Me.extractUserTexts(o);x&&x!=="/compact"&&x!==l&&a.push({type:"prompt",segments:[{type:"text",content:x}],timestamp:r}),l=x;for(let f=0;f<m.length;f++){const y=m[f];if(c.has(y))continue;c.add(y);const C=v[f]||y;a.push({type:"prompt",segments:Me.parseSegments(C),timestamp:r})}}return a}renderTokenStats(){const{requests:t=[]}=this.props,a=Zs(t),c=Object.keys(a),l=ea(t),u=ta(t);if(c.length===0&&l.length===0)return e.jsx("div",{className:d.tokenStatsEmpty,children:"暂无 token 数据"});const g=e.jsx("div",{className:d.tokenStatsColumn,children:c.map(r=>{const m=a[r],v=m.input+m.cacheCreation+m.cacheRead,x=v>0?(m.cacheRead/v*100).toFixed(1):"0.0";return e.jsxs("div",{className:c.length>1?d.modelCardSpaced:d.modelCard,children:[e.jsx("div",{className:d.modelName,children:r}),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:W(v)}),e.jsx("td",{className:d.td,children:W(m.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:W(m.cacheCreation)}),e.jsx("td",{className:d.td,children:W(m.cacheRead)})]}),e.jsxs("tr",{children:[e.jsx("td",{className:d.label,children:p("ui.hitRate")}),e.jsxs("td",{colSpan:2,className:d.td,children:[x,"%"]})]})]})})]},r)})}),i=this.renderCacheRebuildStats(),h=l.length>0?e.jsx("div",{className:d.toolStatsColumn,children:e.jsxs("div",{className:d.modelCard,children:[e.jsx("div",{className:d.modelName,children:p("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:p("ui.cacheRebuild.count")})]})}),e.jsxs("tbody",{children:[l.map(([r,m])=>e.jsxs("tr",{className:d.rowBorder,children:[e.jsxs("td",{className:d.label,children:[r," ",e.jsx(ie,{doc:`Tool-${r}`})]}),e.jsx("td",{className:d.td,children:m})]},r)),l.length>1&&e.jsxs("tr",{className:d.rebuildTotalRow,children:[e.jsx("td",{className:d.label,children:"Total"}),e.jsx("td",{className:d.td,children:l.reduce((r,m)=>r+m[1],0)})]})]})]})]})}):null,o=u.length>0?e.jsx("div",{className:d.toolStatsColumn,children:e.jsxs("div",{className:d.modelCard,children:[e.jsx("div",{className:d.modelName,children:p("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:p("ui.cacheRebuild.count")})]})}),e.jsxs("tbody",{children:[u.map(([r,m])=>e.jsxs("tr",{className:d.rowBorder,children:[e.jsx("td",{className:d.label,children:r}),e.jsx("td",{className:d.td,children:m})]},r)),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((r,m)=>r+m[1],0)})]})]})]})]})}):null;return e.jsxs("div",{className:d.tokenStatsContainer,children:[g,i,h,o]})}_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 a=this._cacheScrollEl;if(!a)return;const c=a.querySelector(`[data-msg-idx="${t}"]`);if(!c)return;clearTimeout(this._cacheScrollSettleTimer),clearTimeout(this._cacheFadeClearTimer),clearTimeout(this._cacheAutoFadeTimer),clearTimeout(this._cacheHighlightDelayTimer),this._cacheUnbindScrollFade(),this._cacheScrollEndHandler&&a.removeEventListener("scrollend",this._cacheScrollEndHandler),this.setState({cacheHighlightIdx:null,cacheHighlightFading:!1});let l=!1,u=!1;const g=()=>{!l||!u||(this.setState({cacheHighlightIdx:t,cacheHighlightFading:!1}),this._cacheScrollSettleTimer=setTimeout(()=>this._cacheBindScrollFade(),200),this._cacheAutoFadeTimer=setTimeout(()=>{this.state.cacheHighlightIdx===t&&!this.state.cacheHighlightFading&&(this.setState({cacheHighlightFading:!0}),this._cacheFadeClearTimer=setTimeout(()=>{this.setState({cacheHighlightIdx:null,cacheHighlightFading:!1})},3e3),this._cacheUnbindScrollFade())},3e3))};this._cacheScrollEndHandler=()=>{a.removeEventListener("scrollend",this._cacheScrollEndHandler),l=!0,g()},a.addEventListener("scrollend",this._cacheScrollEndHandler,{once:!0}),this._cacheScrollSettleTimer=setTimeout(()=>{a.removeEventListener("scrollend",this._cacheScrollEndHandler),l=!0,g()},800),this._cacheHighlightDelayTimer=setTimeout(()=>{u=!0,g()},500),c.scrollIntoView({behavior:"smooth",block:"center"})}renderCacheContentPopover(t){const{requests:a=[],serverCachedContent:c}=this.props,l=c||Jt(a);if(l&&(l.cacheCreateTokens>0||l.cacheReadTokens>0)&&(this._lastCachedTokens={cacheCreateTokens:l.cacheCreateTokens,cacheReadTokens:l.cacheReadTokens}),t>0&&(this._lastContextPercent=t),!l||l.system.length===0&&l.messages.length===0&&l.tools.length===0)return e.jsx("div",{className:d.cachePopoverEmpty,children:p("ui.noCachedContent")});const u=(o,r,m,v)=>{if(r.length===0)return null;const x=o===p("ui.messages"),f=(this.state._cacheSectionCollapsed||{})[v],y=f!==void 0?!!f:v==="tools",C=()=>this.setState(k=>({_cacheSectionCollapsed:{...k._cacheSectionCollapsed||{},[v]:!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?"▶":"▼"}),o," (",r.length,")"]}),!y&&r.map((k,_)=>{const b=x?{"data-msg-idx":_}:{};let T=m||d.cacheCodeBlock;const R=x&&_===this.state.cacheHighlightIdx;return R&&(T+=" "+(this.state.cacheHighlightFading?d.cacheBlockHighlightFading:d.cacheBlockHighlight)),e.jsxs("pre",{className:T,...b,style:R?{position:"relative"}:void 0,children:[R&&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]},_)})]})},g=()=>{const o=[];return l.tools.length>0&&(o.push(`=== ${p("ui.tools")} (${l.tools.length}) ===`),l.tools.forEach(r=>o.push(r))),l.system.length>0&&(o.push(`
|
|
19
19
|
=== ${p("ui.systemPrompt")} (${l.system.length}) ===`),l.system.forEach(r=>o.push(r))),l.messages.length>0&&(o.push(`
|
|
20
20
|
=== ${p("ui.messages")} (${l.messages.length}) ===`),l.messages.forEach(r=>o.push(r))),o.join(`
|
|
21
21
|
|
|
22
|
-
`)},i=l.messages.map((o,r)=>({text:o,msgIdx:r})).filter(({text:o})=>o.startsWith("[user]")).map(({text:o,msgIdx:r})=>{const m=o.replace(/^\[user\]\s*/,"").trim();return!m||ze(m)?{cleaned:"",msgIdx:r}:{cleaned:Me.parseSegments(m).filter(f=>f.type==="text").map(f=>f.content.trim()).filter(f=>f&&!ze(f)).join(" ").trim(),msgIdx:r}}).filter(({cleaned:o})=>!(!o||/Implement the following plan:/i.test(o))),h=i.length>0?e.jsx("div",{className:d.cacheNavList,children:i.map(({cleaned:o,msgIdx:r})=>e.jsx("div",{className:d.cacheNavItem,onClick:()=>this.scrollToCacheMsg(r),children:o},r))}):null;return e.jsxs("div",{className:d.cachePopover,children:[e.jsx("div",{className:d.cachePopoverHeader,children:e.jsxs("div",{className:d.cachePopoverTitle,children:[p("ui.cachedContentTitle"),e.jsx(ie,{doc:"KVCacheContent"}),e.jsx(Fe,{className:d.cacheCopyBtn,onClick:()=>{navigator.clipboard.writeText(g()).then(()=>{G.success(p("ui.copied"))}).catch(()=>{})}}),e.jsx("span",{className:d.cacheCalibrationLabel,children:p("ui.calibrationModelLabel")}),e.jsx(Ke,{size:"small",value:this.state.calibrationModel,onChange:this.handleCalibrationModelChange,options:ot,className:d.calibrationSelect,popupMatchSelectWidth:!1})]})}),(()=>{const r=l.cacheCreateTokens>0||l.cacheReadTokens>0?l:this._lastCachedTokens,m=t>0?t:this._lastContextPercent||0;return r||h?e.jsxs("div",{className:d.cacheTokenInfo,children:[r&&e.jsxs(e.Fragment,{children:[p("ui.tokens"),": ",e.jsxs("span",{className:d.cacheWriteToken,children:["write ",W(r.cacheCreateTokens)]})," / ",e.jsxs("span",{className:d.cacheReadToken,children:["read ",W(r.cacheReadTokens)]}),m>0&&e.jsxs("span",{className:d.cacheCtxPercent,children:["(ctx:",m,"%)"]})]}),h&&e.jsx(Oe,{content:h,trigger:"hover",placement:"left",children:e.jsx("span",{className:d.cacheNavBtn,children:p("ui.userPromptNav")})})]}):null})(),e.jsxs("div",{className:d.cacheScrollArea,ref:o=>{this._cacheScrollEl=o,o&&!this._cacheScrollInited&&(this._cacheScrollInited=!0,requestAnimationFrame(()=>{o.scrollTop=o.scrollHeight}))},children:[u(p("ui.tools"),l.tools,void 0,"tools"),u(p("ui.systemPrompt"),l.system,d.cacheCodeBlockSystem,"system"),u(p("ui.messages"),l.messages,void 0,"messages")]})]})}renderCacheRebuildStats(){const{requests:t=[]}=this.props,a=sa(t),c=["ttl","system_change","tools_change","model_change","msg_truncated","msg_modified","key_change"],l={ttl:"cacheLoss.ttl",system_change:"cacheLoss.systemChange",tools_change:"cacheLoss.toolsChange",model_change:"cacheLoss.modelChange",msg_truncated:"cacheLoss.msgTruncated",msg_modified:"cacheLoss.msgModified",key_change:"cacheLoss.keyChange"},u=c.filter(
|
|
22
|
+
`)},i=l.messages.map((o,r)=>({text:o,msgIdx:r})).filter(({text:o})=>o.startsWith("[user]")).map(({text:o,msgIdx:r})=>{const m=o.replace(/^\[user\]\s*/,"").trim();return!m||ze(m)?{cleaned:"",msgIdx:r}:{cleaned:Me.parseSegments(m).filter(f=>f.type==="text").map(f=>f.content.trim()).filter(f=>f&&!ze(f)).join(" ").trim(),msgIdx:r}}).filter(({cleaned:o})=>!(!o||/Implement the following plan:/i.test(o))),h=i.length>0?e.jsx("div",{className:d.cacheNavList,children:i.map(({cleaned:o,msgIdx:r})=>e.jsx("div",{className:d.cacheNavItem,onClick:()=>this.scrollToCacheMsg(r),children:o},r))}):null;return e.jsxs("div",{className:d.cachePopover,children:[e.jsx("div",{className:d.cachePopoverHeader,children:e.jsxs("div",{className:d.cachePopoverTitle,children:[p("ui.cachedContentTitle"),e.jsx(ie,{doc:"KVCacheContent"}),e.jsx(Fe,{className:d.cacheCopyBtn,onClick:()=>{navigator.clipboard.writeText(g()).then(()=>{G.success(p("ui.copied"))}).catch(()=>{})}}),e.jsx("span",{className:d.cacheCalibrationLabel,children:p("ui.calibrationModelLabel")}),e.jsx(Ke,{size:"small",value:this.state.calibrationModel,onChange:this.handleCalibrationModelChange,options:ot,className:d.calibrationSelect,popupMatchSelectWidth:!1})]})}),(()=>{const r=l.cacheCreateTokens>0||l.cacheReadTokens>0?l:this._lastCachedTokens,m=t>0?t:this._lastContextPercent||0;return r||h?e.jsxs("div",{className:d.cacheTokenInfo,children:[r&&e.jsxs(e.Fragment,{children:[p("ui.tokens"),": ",e.jsxs("span",{className:d.cacheWriteToken,children:["write ",W(r.cacheCreateTokens)]})," / ",e.jsxs("span",{className:d.cacheReadToken,children:["read ",W(r.cacheReadTokens)]}),m>0&&e.jsxs("span",{className:d.cacheCtxPercent,children:["(ctx:",m,"%)"]})]}),h&&e.jsx(Oe,{content:h,trigger:"hover",placement:"left",children:e.jsx("span",{className:d.cacheNavBtn,children:p("ui.userPromptNav")})})]}):null})(),e.jsxs("div",{className:d.cacheScrollArea,ref:o=>{this._cacheScrollEl=o,o&&!this._cacheScrollInited&&(this._cacheScrollInited=!0,requestAnimationFrame(()=>{o.scrollTop=o.scrollHeight}))},children:[u(p("ui.tools"),l.tools,void 0,"tools"),u(p("ui.systemPrompt"),l.system,d.cacheCodeBlockSystem,"system"),u(p("ui.messages"),l.messages,void 0,"messages")]})]})}renderCacheRebuildStats(){const{requests:t=[]}=this.props,a=sa(t),c=["ttl","system_change","tools_change","model_change","msg_truncated","msg_modified","key_change"],l={ttl:"cacheLoss.ttl",system_change:"cacheLoss.systemChange",tools_change:"cacheLoss.toolsChange",model_change:"cacheLoss.modelChange",msg_truncated:"cacheLoss.msgTruncated",msg_modified:"cacheLoss.msgModified",key_change:"cacheLoss.keyChange"},u=c.filter(y=>a[y].count>0),g=u.reduce((y,C)=>y+a[C].count,0),i=u.reduce((y,C)=>y+a[C].cacheCreate,0);aa(t);const h={},o={};for(let y=0;y<t.length;y++){const C=Ve(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";o[k]=(o[k]||0)+1}}const r=Object.entries(h).sort((y,C)=>C[1]-y[1]),m=Object.entries(o).sort((y,C)=>C[1]-y[1]),v=u.length>0,x=r.length>0,f=m.length>0;return!v&&!x&&!f?null:e.jsxs("div",{className:d.toolStatsColumn,children:[v&&e.jsxs("div",{className:x?d.modelCardSpaced:d.modelCard,children:[e.jsxs("div",{className:d.modelName,children:["MainAgent",e.jsx(ie,{doc:"MainAgent"})," ",p("ui.cacheRebuildStats"),e.jsx(ie,{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:p("ui.cacheRebuild.reason")}),e.jsx("td",{className:d.th,children:p("ui.cacheRebuild.count")}),e.jsx("td",{className:d.th,children:p("ui.cacheRebuild.cacheCreate")})]})}),e.jsxs("tbody",{children:[u.map(y=>e.jsxs("tr",{className:d.rowBorder,children:[e.jsx("td",{className:d.label,children:p(`ui.${l[y]}`)}),e.jsx("td",{className:d.td,children:a[y].count}),e.jsx("td",{className:d.td,children:W(a[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:W(i)})]})]})]})]}),x&&e.jsxs("div",{className:f?d.modelCardSpaced:d.modelCard,children:[e.jsx("div",{className:d.modelName,children:p("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:p("ui.cacheRebuild.count")})]})}),e.jsxs("tbody",{children:[r.map(([y,C])=>e.jsxs("tr",{className:d.rowBorder,children:[e.jsxs("td",{className:d.label,children:[y," ",e.jsx(ie,{doc:`SubAgent-${y}`})]}),e.jsx("td",{className:d.td,children:C})]},y)),r.length>1&&e.jsxs("tr",{className:d.rebuildTotalRow,children:[e.jsx("td",{className:d.label,children:"Total"}),e.jsx("td",{className:d.td,children:r.reduce((y,C)=>y+C[1],0)})]})]})]})]}),f&&e.jsxs("div",{className:d.modelCard,children:[e.jsxs("div",{className:d.modelName,children:["Teammate",e.jsx(ie,{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:p("ui.cacheRebuild.count")})]})}),e.jsxs("tbody",{children:[m.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)),m.length>1&&e.jsxs("tr",{className:d.rebuildTotalRow,children:[e.jsx("td",{className:d.label,children:"Total"}),e.jsx("td",{className:d.td,children:m.reduce((y,C)=>y+C[1],0)})]})]})]})]})]})}renderTextPrompt(t){return e.jsx("div",{className:d.textPromptCard,children:t.segments.map((a,c)=>a.type==="text"?e.jsx("pre",{className:d.preText,children:a.content},c):e.jsx(na,{size:"small",className:d.systemCollapse,items:[{key:`sys-${c}`,label:e.jsx("span",{className:d.systemLabel,children:a.label}),children:e.jsx("pre",{className:d.preSys,children:a.content})}]},c))})}renderOriginalPrompt(t){const a=t.segments.filter(c=>c.type==="text");return a.length===0?null:e.jsx("div",{className:d.textPromptCard,children:a.map((c,l)=>e.jsx("pre",{className:d.preText,children:c.content},l))})}buildTextModeContent(){const{promptData:t}=this.state,a=[];for(const c of t){const l=(c.segments||[]).filter(u=>u.type==="text").map(u=>u.content);l.length>0&&a.push(l.join(`
|
|
23
23
|
`))}return a.join(`
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
`)}renderProjectStatsContent(){const{projectStats:t,projectStatsLoading:a}=this.state;if(a)return e.jsx("div",{className:d.projectStatsCenter,children:e.jsx(Qt,{})});if(!t)return e.jsx("div",{className:d.projectStatsEmpty,children:p("ui.projectStats.noData")});const{summary:c,models:l,updatedAt:u}=t;l&&Object.entries(l).sort((h,o)=>o[1]-h[1]);const g={};if(t.files){for(const h of Object.values(t.files))if(h.models)for(const[o,r]of Object.entries(h.models))g[o]||(g[o]={input:0,output:0,cacheRead:0,cacheCreation:0,count:0}),g[o].input+=r.input_tokens||0,g[o].output+=r.output_tokens||0,g[o].cacheRead+=r.cache_read_input_tokens||0,g[o].cacheCreation+=r.cache_creation_input_tokens||0,g[o].count+=r.count||0}const i=Object.entries(g).sort((h,o)=>o[1].count-h[1].count);return e.jsxs("div",{className:d.projectStatsContent,children:[u&&e.jsx("div",{className:d.projectStatsUpdated,children:p("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:(c==null?void 0:c.requestCount)??0}),e.jsx("div",{className:d.projectStatLabel,children:p("ui.projectStats.totalRequests")})]}),e.jsxs("div",{className:d.projectStatCard,children:[e.jsx("div",{className:d.projectStatValue,children:(c==null?void 0:c.turnCount)??(c==null?void 0:c.sessionCount)??0}),e.jsx("div",{className:d.projectStatLabel,children:p("ui.projectStats.turnCount")})]}),e.jsxs("div",{className:d.projectStatCard,children:[e.jsx("div",{className:d.projectStatValue,children:(c==null?void 0:c.fileCount)??0}),e.jsx("div",{className:d.projectStatLabel,children:p("ui.projectStats.totalFiles")})]}),e.jsxs("div",{className:d.projectStatCard,children:[e.jsx("div",{className:d.projectStatValue,children:W(c==null?void 0:c.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:W(c==null?void 0:c.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:p("ui.projectStats.modelUsage")}),i.map(([h,o])=>{const r=o.input+o.cacheRead+o.cacheCreation,m=r>0?(o.cacheRead/r*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:[o.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:W(r)}),e.jsx("td",{className:d.td,children:W(o.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:W(o.cacheCreation)}),e.jsx("td",{className:d.td,children:W(o.cacheRead)})]}),e.jsxs("tr",{children:[e.jsx("td",{className:d.label,children:p("ui.hitRate")}),e.jsxs("td",{colSpan:2,className:d.td,children:[m,"%"]})]})]})})]},h)})]})]})}render(){const{requestCount:t,requests:a=[],viewMode:c,cacheType:l,onToggleViewMode:u,onImportLocalLogs:g,onLangChange:i,isLocalLog:h,localLogFile:o,projectName:r,collapseToolResults:m,onCollapseToolResultsChange:y,expandThinking:x,onExpandThinkingChange:f,showFullToolContent:v,onShowFullToolContentChange:C,expandDiff:k,onExpandDiffChange:_,filterIrrelevant:b,onFilterIrrelevantChange:T,logDir:R,onLogDirChange:P,updateInfo:I,onDismissUpdate:M,cliMode:B,terminalVisible:F,onToggleTerminal:ae,onReturnToWorkspaces:ne,contextWindow:A,serverCachedContent:X,resumeAutoChoice:oe,onResumeAutoChoiceToggle:Z,onResumeAutoChoiceChange:he}=this.props,{countdownText:ue}=this.state,fe=[{key:"import-local",icon:e.jsx(zt,{}),label:p("ui.importLocalLogs"),onClick:g},{key:"export-prompts",icon:e.jsx(sn,{}),label:p("ui.exportPrompts"),onClick:this.handleShowPrompts},{key:"plugin-management",icon:e.jsx(Ft,{}),label:p("ui.pluginManagement"),onClick:this.handleShowPlugins},{key:"switch-workspace",icon:e.jsx(zt,{className:d.iconMirror}),label:e.jsx("span",{className:d.disabledMenuItem,children:p("ui.switchWorkspace")}),disabled:!0},{key:"process-management",icon:e.jsx(it,{}),label:p("ui.processManagement"),onClick:this.handleShowProcesses},{key:"proxy-switch",icon:e.jsx(Ot,{}),label:p("ui.proxySwitch"),onClick:()=>this.setState({proxyModalVisible:!0})},{type:"divider"},{key:"project-stats",icon:e.jsx($t,{}),label:p("ui.projectStats"),onClick:this.handleShowProjectStats},...c==="raw"?[{key:"global-settings",icon:e.jsx(Vt,{}),label:p("ui.globalSettings"),onClick:()=>this.setState({globalSettingsVisible:!0})}]:[],...c==="chat"?[{key:"display-settings",icon:e.jsx(Vt,{}),label:p("ui.settings"),onClick:()=>this.setState({settingsDrawerVisible:!0})}]:[],{key:"language",icon:e.jsx(ln,{}),label:p("ui.languageSettings"),children:[{key:"lang-grid-container",type:"group",label:e.jsx("div",{className:d.langGrid,children:_n.map(N=>e.jsx(H,{size:"small",type:N.value===ia()?"primary":"default",onClick:U=>{U.stopPropagation(),la(N.value),i&&i()},className:d.langBtn,children:N.label},N.value))})}]}];return e.jsxs("div",{className:d.headerBar,children:[e.jsxs($e,{size:"middle",children:[e.jsx(oa,{menu:{items:fe,className:"logo-dropdown-menu"},trigger:["hover"],onOpenChange:N=>this.setState({logoDropdownOpen:N}),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(Oe,{content:this.renderTokenStats(),trigger:"hover",placement:"bottomLeft",overlayInnerStyle:{background:"#1e1e1e",border:"1px solid #3a3a3a",borderRadius:8,padding:"8px 8px",maxHeight:"80vh",overflowY:"auto"},children:e.jsxs(me,{className:d.tokenStatsTag,children:[e.jsx(it,{className:d.tokenStatsIcon}),p("ui.tokenStats")]})}),this.props.activeProxyId&&this.props.activeProxyId!=="max"&&(()=>{const N=(this.props.proxyProfiles||[]).find(U=>U.id===this.props.activeProxyId);return N?e.jsxs(me,{className:d.proxyProfileTag,onClick:()=>this.setState({proxyModalVisible:!0}),children:[e.jsx(Ot,{className:d.proxySwapIcon}),N.name,N.activeModel?` · ${N.activeModel}`:""]}):null})(),(()=>{var xe,be,Ne,_e,ve;let N=0;const U=ot.find(Q=>Q.value===this.state.calibrationModel),ee=U==null?void 0:U.tokens;if(!h){if(ee&&(A==null?void 0:A.used_percentage)!=null){const Q=$=>{var ye,Ue;const K=(Ue=(ye=$.response)==null?void 0:ye.body)==null?void 0:Ue.usage;return((K==null?void 0:K.input_tokens)||0)+((K==null?void 0:K.cache_creation_input_tokens)||0)+((K==null?void 0:K.cache_read_input_tokens)||0)};let L=0;for(let $=a.length-1;$>=0;$--)if(Ce(a[$])&&((be=(xe=a[$].response)==null?void 0:xe.body)!=null&&be.usage)){L=Q(a[$]);break}if(L>0){const $=ee*.835;N=Math.min(100,Math.max(0,Math.round(L/$*100)))}else{const $=A.context_window_size||2e5;N=Math.min(100,Math.max(0,Math.round(A.used_percentage*$/ee/83.5*100)))}}else if((A==null?void 0:A.used_percentage)!=null){const Q=this.state.settingsModel?wt(this.state.settingsModel):0,L=A.context_window_size||2e5;Q&&Q!==L?N=Math.min(100,Math.max(0,Math.round(A.used_percentage*L/Q/83.5*100))):N=Math.min(100,Math.max(0,Math.round(A.used_percentage/83.5*100)))}else if(a.length>0){const Q=L=>{var K,ye;const $=(ye=(K=L.response)==null?void 0:K.body)==null?void 0:ye.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 L=a.length-1;L>=0;L--)if(Ce(a[L])&&((_e=(Ne=a[L].response)==null?void 0:Ne.body)!=null&&_e.usage)){const $=Q(a[L]),ye=(ee||(A==null?void 0:A.context_window_size)||wt(((ve=a[L].body)==null?void 0:ve.model)||this.state.settingsModel))*.835;ye>0&&$>0&&(N=Math.min(100,Math.max(0,Math.round($/ye*100))));break}}}N===0&&this._lastContextPercent>0&&(N=this._lastContextPercent);const de=N>=80?"#ff4d4f":N>=60?"#faad14":"#52c41a";return h?e.jsx(me,{className:`${d.liveTag} ${d.liveTagHistory}`,children:e.jsx("span",{className:d.liveTagText,children:p("ui.historyLog",{file:o})})}):e.jsx(Oe,{content:this.state._cachePopoverOpen?this.renderCacheContentPopover(N):e.jsx("div",{className:d.cachePopoverPlaceholder}),trigger:"hover",placement:"bottomLeft",overlayInnerStyle:{background:"#1e1e1e",border:"1px solid #3a3a3a",borderRadius:8,padding:"8px 8px"},onOpenChange:Q=>{this.setState({_cachePopoverOpen:Q}),Q||(this._cacheScrollInited=!1)},children:e.jsxs("span",{className:d.liveTag,style:{borderColor:de,color:de},children:[e.jsx("span",{className:d.liveTagFill,style:{width:`${N}%`,backgroundColor:de}}),e.jsx("span",{className:d.liveTagContent,children:e.jsxs("span",{className:d.liveTagText,children:[p("ui.liveMonitoring"),r?`:${r}`:""]})})]})})})(),I&&e.jsx(me,{color:I.type==="completed"?"green":"orange",closable:!0,onClose:()=>M&&M(),children:I.type==="completed"?p("ui.update.completed",{version:I.version}):p("ui.update.majorAvailable",{version:I.version})})]}),e.jsxs($e,{size:"middle",children:[ue&&c==="raw"&&e.jsxs(me,{style:{background:"#2a2a2a",border:"1px solid #3a3a3a",color:ue===p("ui.cacheExpired")?"#ff6b6b":"#ccc"},children:[p("ui.cacheCountdown",{type:l?`(${l})`:""}),e.jsx("strong",{className:d.countdownStrong,children:ue})]}),c==="chat"&&B&&!h&&this.state.localUrl&&e.jsxs(e.Fragment,{children:[this.state.countryFlag&&e.jsx(Oe,{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:"#1e1e1e",border:"1px solid #3a3a3a",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(Oe,{content:e.jsxs("div",{className:d.qrcodePopover,children:[e.jsx("div",{className:d.qrcodeTitle,children:p("ui.scanToCoding")}),e.jsx(js,{value:this.state.localUrl,size:200,bgColor:"#141414",fgColor:"#d9d9d9",level:"M"}),e.jsx(we,{readOnly:!0,value:this.state.localUrl,className:d.qrcodeUrlInput,suffix:e.jsx(Fe,{className:d.qrcodeUrlCopy,onClick:()=>{navigator.clipboard.writeText(this.state.localUrl).then(()=>{G.success(p("ui.copied"))}).catch(()=>{})}})})]}),trigger:"hover",placement:"bottomRight",overlayInnerStyle:{background:"#1e1e1e",border:"1px solid #3a3a3a",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"})]})})})]}),B&&c==="chat"&&!h&&e.jsx(H,{className:d.compactBtn,type:F?"primary":"default",ghost:F,icon:e.jsx(Qe,{}),onClick:ae,children:p("ui.terminal")}),e.jsx(H,{className:d.compactBtn,type:c==="raw"?"primary":"default",icon:c==="raw"?e.jsx(ra,{}):e.jsx(Je,{}),onClick:u,children:c==="raw"?p("ui.chatMode"):p("ui.rawMode")})]}),e.jsxs(je,{title:`${p("ui.userPrompt")} (${this.state.promptData.length}${p("ui.promptCountUnit")})`,open:this.state.promptModalVisible,onCancel:()=>this.setState({promptModalVisible:!1}),footer:null,width:700,children:[e.jsx("div",{className:d.promptExportBar,children:e.jsx(H,{icon:e.jsx(ca,{}),onClick:this.handleExportPromptsTxt,children:p("ui.exportPromptsTxt")})}),e.jsx(Yt,{activeKey:this.state.promptViewMode,onChange:N=>this.setState({promptViewMode:N}),size:"small",items:[{key:"original",label:p("ui.promptModeOriginal")},{key:"context",label:p("ui.promptModeContext")},{key:"text",label:p("ui.promptModeText")}]}),this.state.promptViewMode==="text"?e.jsx("textarea",{readOnly:!0,className:d.promptTextarea,value:this.buildTextModeContent()}):e.jsxs("div",{className:d.promptScrollArea,children:[this.state.promptData.length===0&&e.jsx("div",{className:d.promptEmpty,children:p("ui.noPrompt")}),this.state.promptData.map((N,U)=>{const ee=N.timestamp?new Date(N.timestamp).toLocaleString():p("ui.unknownTime");return e.jsxs("div",{children:[e.jsxs("div",{className:d.promptTimestamp,children:[ee,":"]}),this.state.promptViewMode==="original"?this.renderOriginalPrompt(N):this.renderTextPrompt(N)]},U)})]})]}),e.jsxs(Ge,{title:p("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:p("ui.chatDisplaySwitches")}),e.jsxs("div",{className:d.settingsItem,children:[e.jsx("span",{className:d.settingsLabel,children:p("ui.collapseToolResults")}),e.jsx(Te,{checked:!!m,onChange:N=>y&&y(N)})]}),e.jsxs("div",{className:d.settingsItem,children:[e.jsx("span",{className:d.settingsLabel,children:p("ui.expandThinking")}),e.jsx(Te,{checked:!!x,onChange:N=>f&&f(N)})]}),e.jsxs("div",{className:d.settingsItem,children:[e.jsx("span",{className:d.settingsLabel,children:p("ui.showFullToolContent")}),e.jsx(Te,{checked:!!v,onChange:N=>C&&C(N)})]})]}),e.jsxs("div",{className:d.settingsGroupBox,children:[e.jsx("div",{className:d.settingsGroupTitle,children:p("ui.userPreferences")}),e.jsxs("div",{className:d.settingsItem,children:[e.jsx("span",{className:d.settingsLabel,children:p("ui.resumeAutoChoice")}),e.jsx(Te,{checked:!!oe,onChange:N=>Z&&Z(N)})]}),oe&&e.jsx("div",{className:d.settingsItem,children:e.jsxs(qe.Group,{value:oe,onChange:N=>he&&he(N.target.value),size:"small",children:[e.jsx(qe,{value:"continue",children:p("ui.resumeAutoChoice.continue")}),e.jsx(qe,{value:"new",children:p("ui.resumeAutoChoice.new")})]})})]})]}),e.jsxs(Ge,{title:e.jsxs("span",{children:[p("ui.globalSettings")," ",e.jsx(ie,{doc:"GlobalSettings"})]}),placement:"left",width:400,open:this.state.globalSettingsVisible,onClose:()=>this.setState({globalSettingsVisible:!1}),children:[e.jsxs("div",{className:d.settingsItem,children:[e.jsx("span",{className:d.settingsLabel,children:p("ui.filterIrrelevant")}),e.jsx(Te,{checked:!!b,onChange:N=>T&&T(N)})]}),e.jsxs("div",{className:d.settingsItem,children:[e.jsx("span",{className:d.settingsLabel,children:p("ui.expandDiff")}),e.jsx(Te,{checked:!!k,onChange:N=>_&&_(N)})]}),e.jsx("div",{className:d.settingsDivider}),e.jsx("div",{className:d.settingsLabel,children:p("ui.logDirTitle")}),e.jsx(we,{className:d.logDirInput,value:this.state.logDirDraft??R,onChange:N=>this.setState({logDirDraft:N.target.value}),onBlur:()=>{const N=this.state.logDirDraft;N!=null&&N!==R&&(P==null||P(N)),this.setState({logDirDraft:null})},onPressEnter:()=>{const N=this.state.logDirDraft;N!=null&&N!==R&&(P==null||P(N)),this.setState({logDirDraft:null})},placeholder:"~/.claude/cc-viewer"})]}),e.jsx(Ge,{title:e.jsxs("span",{children:[e.jsx($t,{className:d.titleIcon}),p("ui.projectStats")]}),placement:"left",width:400,open:this.state.projectStatsVisible,onClose:()=>this.setState({projectStatsVisible:!1}),children:this.renderProjectStatsContent()}),e.jsxs(je,{title:e.jsxs("span",{children:[e.jsx(Ft,{className:d.titleIcon}),p("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(Tt,{}),onClick:this.handleAddPlugin,children:p("ui.plugins.add")}),e.jsx(H,{icon:e.jsx(Ht,{}),onClick:this.handleShowCdnModal,children:p("ui.plugins.cdnInstall")})]}),e.jsx(H,{icon:e.jsx(ut,{}),onClick:this.handleReloadPlugins,children:p("ui.plugins.reload")})]}),width:560,children:[this.state.pluginsDir&&e.jsxs("div",{className:d.pluginDirHint,children:[e.jsxs("span",{className:d.pluginDirLabel,children:[p("ui.plugins.pluginsDir"),":"]})," ",e.jsx("code",{className:d.pluginDirPath,onClick:()=>{navigator.clipboard.writeText(this.state.pluginsDir).then(()=>{G.success(p("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:p("ui.plugins.empty")}),e.jsx("div",{className:d.pluginEmptyHint,children:p("ui.plugins.emptyHint")})]}):e.jsx("div",{className:d.pluginList,children:this.state.pluginsList.map(N=>e.jsxs("div",{className:d.pluginItem,children:[e.jsxs("div",{className:d.pluginInfo,children:[e.jsx("span",{className:d.pluginName,children:N.name}),e.jsx("span",{className:d.pluginFile,children:N.file}),N.hooks.length>0&&e.jsx("span",{className:d.pluginHooks,children:N.hooks.map(U=>e.jsx("span",{className:d.pluginHookTag,children:U},U))})]}),e.jsxs("div",{className:d.pluginActions,children:[e.jsx(Te,{size:"small",checked:N.enabled,onChange:U=>this.handleTogglePlugin(N.name,U)}),e.jsx(H,{type:"text",size:"small",danger:!0,icon:e.jsx(ht,{}),onClick:()=>this.handleDeletePlugin(N.file,N.name)})]})]},N.file))})]}),e.jsx(je,{title:p("ui.plugins.delete"),open:this.state.deleteConfirmVisible,onCancel:()=>this.setState({deleteConfirmVisible:!1,deleteTarget:null}),onOk:this.handleDeletePluginConfirm,okType:"danger",okText:"OK",cancelText:"Cancel",children:e.jsx("p",{children:this.state.deleteTarget?p("ui.plugins.deleteConfirm",{name:this.state.deleteTarget.name}):""})}),e.jsx(je,{title:e.jsxs("span",{children:[e.jsx(Ht,{className:d.titleIcon}),p("ui.plugins.cdnInstall")]}),open:this.state.cdnModalVisible,onCancel:this.handleCdnCancel,onOk:this.handleCdnInstall,confirmLoading:this.state.cdnLoading,okText:p("ui.plugins.cdnInstallBtn"),cancelText:p("ui.cancel"),width:480,children:e.jsxs("div",{children:[e.jsx("div",{className:d.cdnUrlLabel,children:p("ui.plugins.cdnUrl")}),e.jsx(we,{placeholder:p("ui.plugins.cdnUrlPlaceholder"),value:this.state.cdnUrl,onChange:this.handleCdnUrlChange,onPressEnter:this.handleCdnInstall,className:d.cdnInput})]})}),e.jsx(je,{title:e.jsxs("span",{children:[e.jsx(it,{className:d.titleIcon}),p("ui.processManagement")]}),open:this.state.processModalVisible,onCancel:()=>this.setState({processModalVisible:!1}),footer:e.jsx(H,{icon:e.jsx(ut,{}),onClick:this.fetchProcesses,loading:this.state.processLoading,children:p("ui.processManagement.refresh")}),width:780,children:e.jsx(da,{dataSource:this.state.processList,rowKey:"pid",loading:this.state.processLoading,size:"middle",pagination:!1,columns:[{title:p("ui.processManagement.port"),dataIndex:"port",width:80,render:N=>N?e.jsx("a",{href:`${window.location.protocol}//127.0.0.1:${N}`,target:"_blank",rel:"noopener noreferrer",children:N}):""},{title:"PID",dataIndex:"pid",width:80},{title:p("ui.processManagement.command"),dataIndex:"command",ellipsis:!0},{title:p("ui.processManagement.startTime"),dataIndex:"startTime",width:200},{title:p("ui.processManagement.action"),width:100,render:(N,U)=>U.isCurrent?e.jsx(H,{size:"small",className:d.currentProcessBtn,children:p("ui.processManagement.current")}):e.jsx(H,{size:"small",danger:!0,onClick:()=>this.handleKillProcess(U.pid),children:p("ui.processManagement.kill")})}]})}),e.jsx(je,{title:e.jsxs("span",{children:[e.jsx(Xt,{apiEndpoint:le("/api/open-profile-dir"),title:p("ui.proxy.openConfigDir"),size:16})," ",p("ui.proxySwitch")," ",e.jsx(ie,{doc:"ProxySwitch",zIndex:1100})]}),open:this.state.proxyModalVisible,onCancel:()=>this.setState({proxyModalVisible:!1,editingProxy:null}),footer:null,width:520,children:this.renderProxyProfileList()})]})}renderProxyProfileList(){const t=this.props.proxyProfiles||[],a=this.props.activeProxyId||"max",{editingProxy:c,editForm:l}=this.state;return e.jsxs("div",{children:[e.jsxs("div",{className:d.proxyWarning,children:["⚠️ ",p("ui.proxy.maxWarning")]}),e.jsx("div",{className:d.proxyList,children:t.map(u=>{var g;return e.jsxs("div",{className:`${d.proxyItem} ${u.id===a?d.proxyItemActive:""}`,children:[e.jsxs("div",{className:d.proxyItemMain,onClick:()=>{if(u.id!==a){const i={active:u.id,profiles:t};this.props.onProxyProfileChange(i)}},children:[e.jsx(qe,{checked:u.id===a,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(me,{className:d.proxyBuiltinTag,children:p("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(ha,{}),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(ht,{}),onClick:()=>{je.confirm({title:p("ui.proxy.deleteProxy"),content:p("ui.proxy.deleteConfirm",{name:u.name}),okType:"danger",onOk:()=>{const i=t.filter(o=>o.id!==u.id),h=a===u.id?"max":a;this.props.onProxyProfileChange({active:h,profiles:i})}})}})]})]},u.id)})}),c&&e.jsxs("div",{className:d.proxyEditForm,children:[e.jsxs("div",{className:d.proxyEditRow,children:[e.jsxs("label",{children:[p("ui.proxy.name")," ",e.jsx("span",{className:d.proxyRequired,children:"*"})]}),e.jsx(we,{size:"small",value:l.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:[p("ui.proxy.baseURL")," ",e.jsx("span",{className:d.proxyRequired,children:"*"})]}),e.jsx(we,{size:"small",value:l.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:[p("ui.proxy.apiKey")," ",e.jsx("span",{className:d.proxyRequired,children:"*"})]}),e.jsx(we.Password,{size:"small",value:l.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:p("ui.proxy.models")}),e.jsx(we,{size:"small",value:l.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:p("ui.proxy.activeModel")}),e.jsx(Ke,{size:"small",className:d.fullWidthSelect,value:l.activeModel||void 0,onChange:u=>this.setState(g=>({editForm:{...g.editForm,activeModel:u}})),placeholder:p("ui.proxy.activeModel"),children:(l.models||"").split(",").map(u=>u.trim()).filter(Boolean).map(u=>e.jsx(Ke.Option,{value:u,children:u},u))})]}),e.jsxs("div",{className:d.proxyEditBtns,children:[e.jsx(H,{size:"small",icon:e.jsx(ua,{}),type:"primary",onClick:()=>{var h,o,r;if(!((h=l.name)!=null&&h.trim())||!((o=l.baseURL)!=null&&o.trim())||!((r=l.apiKey)!=null&&r.trim())){G.warning(p("ui.proxy.requiredFields"));return}const u=(l.models||"").split(",").map(m=>m.trim()).filter(Boolean),g={id:c==="__new__"?`proxy_${Date.now()}`:c,name:l.name.trim(),baseURL:l.baseURL.trim(),apiKey:l.apiKey.trim(),models:u,activeModel:l.activeModel||u[0]||""};let i;c==="__new__"?i=[...t,g]:i=t.map(m=>m.id===c?{...m,...g,id:m.id}:m),this.props.onProxyProfileChange({active:a,profiles:i}),this.setState({editingProxy:null})},children:p("ui.proxy.save")}),e.jsx(H,{size:"small",icon:e.jsx(ma,{}),onClick:()=>this.setState({editingProxy:null}),children:p("ui.proxy.cancel")})]})]}),!c&&e.jsx(H,{block:!0,type:"dashed",icon:e.jsx(Tt,{}),style:{marginTop:12},onClick:()=>this.setState({editingProxy:"__new__",editForm:{name:"",baseURL:"",apiKey:"",models:"",activeModel:""}}),children:p("ui.proxy.addProxy")})]})}};O(Me,"COMMAND_TAGS",new Set(["command-name","command-message","command-args","local-command-caveat","local-command-stdout"]));let Xe=Me;const Sn="_centerEmpty_18l8t_1",kn="_scrollContainer_18l8t_8",wn="_listItem_18l8t_15",Tn="_listItemActive_18l8t_27",Mn="_itemContent_18l8t_36",En="_itemHeader_18l8t_41",Rn="_tagNoMargin_18l8t_49",In="_modelName_18l8t_54",Ln="_modelNameMain_18l8t_59",Pn="_time_18l8t_63",An="_detailRow_18l8t_69",Dn="_urlText_18l8t_76",Bn="_duration_18l8t_85",On="_statusOk_18l8t_90",Fn="_statusErr_18l8t_96",$n="_statusDefault_18l8t_101",Hn="_usageBox_18l8t_106",zn="_cacheDot_18l8t_116",Vn="_cacheDotLoss_18l8t_125",Un="_cacheDotNormal_18l8t_130",qn="_tagMainAgent_18l8t_134",Wn="_tagPlan_18l8t_140",Kn="_tagMuted_18l8t_146",Gn="_tooltipPreLine_18l8t_152",V={centerEmpty:Sn,scrollContainer:kn,listItem:wn,listItemActive:Tn,itemContent:Mn,itemHeader:En,tagNoMargin:Rn,modelName:In,modelNameMain:Ln,time:Pn,detailRow:An,urlText:Dn,duration:Bn,statusOk:On,statusErr:Fn,statusDefault:$n,usageBox:Hn,cacheDot:zn,cacheDotLoss:Vn,cacheDotNormal:Un,tagMainAgent:qn,tagPlan:Wn,tagMuted:Kn,tooltipPreLine:Gn};class Jn extends q.Component{constructor(t){super(t);O(this,"handleKeyDown",t=>{if(t.key!=="ArrowUp"&&t.key!=="ArrowDown")return;const{requests:a,selectedIndex:c,onSelect:l}=this.props;if(!a.length)return;t.preventDefault();const u=c??0,g=t.key==="ArrowUp"?Math.max(0,u-1):Math.min(a.length-1,u+1);g!==u&&l(g)});this.activeItemRef=q.createRef()}componentDidMount(){this.scrollToSelected(!0)}shouldComponentUpdate(t){return t.requests!==this.props.requests||t.selectedIndex!==this.props.selectedIndex||t.scrollCenter!==this.props.scrollCenter||t.cacheLossMap!==this.props.cacheLossMap}componentDidUpdate(t){this.props.scrollCenter&&t.selectedIndex!==this.props.selectedIndex?this.scrollToSelected(!0):t.selectedIndex!==this.props.selectedIndex&&(this.scrollToSelected(!1),this.activeItemRef.current&&this.activeItemRef.current.focus({preventScroll:!0}))}scrollToSelected(t){this.activeItemRef.current&&(this.activeItemRef.current.scrollIntoView({block:t?"center":"nearest",behavior:"instant"}),t&&this.props.onScrollDone&&this.props.onScrollDone())}render(){const{requests:t,selectedIndex:a,onSelect:c}=this.props;return t.length===0?e.jsx("div",{className:V.centerEmpty,children:e.jsx(Ee,{description:p("ui.waitingRequests")})}):e.jsx("div",{className:V.scrollContainer,onKeyDown:this.handleKeyDown,children:e.jsx(Mt,{dataSource:t,size:"small",split:!1,renderItem:(l,u)=>{var T,R,P;const g=new Date(l.timestamp).toLocaleTimeString("zh-CN"),i=u===a,h=l.response&&l.response.status<400,o=l.response&&l.response.status>=400,r=pa((T=l.body)==null?void 0:T.model),m=u+1<t.length?t[u+1]:null,{type:y,subType:x}=Ve(l,m),f=(P=(R=l.response)==null?void 0:R.body)==null?void 0:P.usage,v=f?(f.input_tokens||0)+(f.cache_read_input_tokens||0)+(f.cache_creation_input_tokens||0):null,C=(f==null?void 0:f.output_tokens)||null,k=(f==null?void 0:f.cache_read_input_tokens)||0,_=(f==null?void 0:f.cache_creation_input_tokens)||0;let b=l.url;try{const I=new URL(l.url);b=I.host+I.pathname}catch{}return e.jsx(Mt.Item,{ref:i?this.activeItemRef:void 0,tabIndex:0,onClick:()=>c(u),className:`${V.listItem} ${i?V.listItemActive:""}`,children:e.jsxs("div",{className:V.itemContent,children:[e.jsxs("div",{className:V.itemHeader,children:[y==="MainAgent"?e.jsx(me,{className:`${V.tagNoMargin} ${V.tagMainAgent}`,children:"MainAgent"}):y==="Plan"?e.jsx(me,{className:`${V.tagNoMargin} ${V.tagPlan}`,children:Et(y,x)}):y==="Count"||y==="Preflight"?e.jsx(me,{className:`${V.tagNoMargin} ${V.tagMuted}`,children:y}):e.jsx(me,{className:V.tagNoMargin,children:Et(y,x)}),r&&e.jsx("span",{className:`${V.modelName} ${y==="MainAgent"?V.modelNameMain:""}`,children:r}),e.jsx("span",{className:V.time,children:g})]}),e.jsxs("div",{className:V.detailRow,children:[e.jsx("span",{className:V.urlText,title:l.url,children:b}),l.duration&&e.jsxs("span",{className:V.duration,children:[l.duration,"ms"]}),l.response&&e.jsx("span",{className:h?V.statusOk:o?V.statusErr:V.statusDefault,children:l.response.status})]}),f&&e.jsxs("div",{className:V.usageBox,children:[e.jsxs("div",{children:["token: output:",W(C)||0,", input: ",W(v)||0]}),(k>0||_>0)&&e.jsx("div",{children:(()=>{var F;const I=(F=this.props.cacheLossMap)==null?void 0:F.get(u),M={ttl:"ui.cacheLoss.ttl",system_change:"ui.cacheLoss.systemChange",tools_change:"ui.cacheLoss.toolsChange",model_change:"ui.cacheLoss.modelChange",msg_truncated:"ui.cacheLoss.msgTruncated",msg_modified:"ui.cacheLoss.msgModified",key_change:"ui.cacheLoss.keyChange"};let B;if(I){const ne=(I.reasons||[I.reason]).map(A=>p(M[A]||M.key_change)).join(`
|
|
27
|
-
`);B=e.jsx(Zt,{title:e.jsx("span",{className:V.tooltipPreLine,children:ne}),children:e.jsx("span",{className:`${V.cacheDot} ${V.cacheDotLoss}`})})}else B=e.jsx("span",{className:`${V.cacheDot} ${V.cacheDotNormal}`});return e.jsxs(e.Fragment,{children:["cache",B,": ",k>0?`read:${W(k)}`:"",k>0&&_>0?", ":"",_>0?`create:${W(_)}`:""]})})()})]})]})})}})})}}const Qn=n=>typeof n=="boolean"||n instanceof Boolean,Yn=n=>typeof n=="number"||n instanceof Number,Xn=n=>typeof n=="bigint"||n instanceof BigInt,Cs=n=>!!n&&n instanceof Date,Zn=n=>typeof n=="string"||n instanceof String,el=n=>Array.isArray(n),bs=n=>typeof n=="object"&&n!==null,Ns=n=>!!n&&n instanceof Object&&typeof n=="function";function Ze(n,s){return s===void 0&&(s=!1),!n||s?`"${n}"`:n}function tl(n,s,t){return t?JSON.stringify(n):s?`"${n}"`:n}function _s(n){let{field:s,value:t,data:a,lastElement:c,openBracket:l,closeBracket:u,level:g,style:i,shouldExpandNode:h,clickToExpandNode:o,outerRef:r,beforeExpandChange:m}=n;const y=j.useRef(!1),[x,f]=j.useState(()=>h(g,t,s)),v=j.useRef(null);j.useEffect(()=>{y.current?f(h(g,t,s)):y.current=!0},[h]);const C=j.useId();if(a.length===0)return sl({field:s,openBracket:l,closeBracket:u,lastElement:c,style:i});const k=x?i.collapseIcon:i.expandIcon,_=x?i.ariaLables.collapseJson:i.ariaLables.expandJson,b=g+1,T=a.length-1,R=M=>{x!==M&&(!m||m({level:g,value:t,field:s,newExpandValue:M}))&&f(M)},P=M=>{if(M.key==="ArrowRight"||M.key==="ArrowLeft")M.preventDefault(),R(M.key==="ArrowRight");else if(M.key==="ArrowUp"||M.key==="ArrowDown"){M.preventDefault();const B=M.key==="ArrowUp"?-1:1;if(!r.current)return;const F=r.current.querySelectorAll("[role=button]");let ae=-1;for(let A=0;A<F.length;A++)if(F[A].tabIndex===0){ae=A;break}if(ae<0)return;const ne=(ae+B+F.length)%F.length;F[ae].tabIndex=-1,F[ne].tabIndex=0,F[ne].focus()}},I=()=>{var M;R(!x);const B=v.current;if(!B)return;const F=(M=r.current)===null||M===void 0?void 0:M.querySelector('[role=button][tabindex="0"]');F&&(F.tabIndex=-1),B.tabIndex=0,B.focus()};return j.createElement("div",{className:i.basicChildStyle,role:"treeitem","aria-expanded":x,"aria-selected":void 0},j.createElement("span",{className:k,onClick:I,onKeyDown:P,role:"button","aria-label":_,"aria-expanded":x,"aria-controls":x?C:void 0,ref:v,tabIndex:g===0?0:-1}),(s||s==="")&&(o?j.createElement("span",{className:i.clickableLabel,onClick:I,onKeyDown:P},Ze(s,i.quotesForFieldNames),":"):j.createElement("span",{className:i.label},Ze(s,i.quotesForFieldNames),":")),j.createElement("span",{className:i.punctuation},l),x?j.createElement("ul",{id:C,role:"group",className:i.childFieldsContainer},a.map((M,B)=>j.createElement(gt,{key:M[0]||B,field:M[0],value:M[1],style:i,lastElement:B===T,level:b,shouldExpandNode:h,clickToExpandNode:o,beforeExpandChange:m,outerRef:r}))):j.createElement("span",{className:i.collapsedContent,onClick:I,onKeyDown:P}),j.createElement("span",{className:i.punctuation},u),!c&&j.createElement("span",{className:i.punctuation},","))}function sl(n){let{field:s,openBracket:t,closeBracket:a,lastElement:c,style:l}=n;return j.createElement("div",{className:l.basicChildStyle,role:"treeitem","aria-selected":void 0},(s||s==="")&&j.createElement("span",{className:l.label},Ze(s,l.quotesForFieldNames),":"),j.createElement("span",{className:l.punctuation},t),j.createElement("span",{className:l.punctuation},a),!c&&j.createElement("span",{className:l.punctuation},","))}function al(n){let{field:s,value:t,style:a,lastElement:c,shouldExpandNode:l,clickToExpandNode:u,level:g,outerRef:i,beforeExpandChange:h}=n;return _s({field:s,value:t,lastElement:c||!1,level:g,openBracket:"{",closeBracket:"}",style:a,shouldExpandNode:l,clickToExpandNode:u,data:Object.keys(t).map(o=>[o,t[o]]),outerRef:i,beforeExpandChange:h})}function nl(n){let{field:s,value:t,style:a,lastElement:c,level:l,shouldExpandNode:u,clickToExpandNode:g,outerRef:i,beforeExpandChange:h}=n;return _s({field:s,value:t,lastElement:c||!1,level:l,openBracket:"[",closeBracket:"]",style:a,shouldExpandNode:u,clickToExpandNode:g,data:t.map(o=>[void 0,o]),outerRef:i,beforeExpandChange:h})}function ll(n){let{field:s,value:t,style:a,lastElement:c}=n,l,u=a.otherValue;return t===null?(l="null",u=a.nullValue):t===void 0?(l="undefined",u=a.undefinedValue):Zn(t)?(l=tl(t,!a.noQuotesForStringValues,a.stringifyStringValues),u=a.stringValue):Qn(t)?(l=t?"true":"false",u=a.booleanValue):Yn(t)?(l=t.toString(),u=a.numberValue):Xn(t)?(l=`${t.toString()}n`,u=a.numberValue):Cs(t)?l=t.toISOString():Ns(t)?l="function() { }":l=t.toString(),j.createElement("div",{className:a.basicChildStyle,role:"treeitem","aria-selected":void 0},(s||s==="")&&j.createElement("span",{className:a.label},Ze(s,a.quotesForFieldNames),":"),j.createElement("span",{className:u},l),!c&&j.createElement("span",{className:a.punctuation},","))}function gt(n){const s=n.value;return el(s)?j.createElement(nl,Object.assign({},n)):bs(s)&&!Cs(s)&&!Ns(s)?j.createElement(al,Object.assign({},n)):j.createElement(ll,Object.assign({},n))}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 Ss={collapseJson:"collapse JSON",expandJson:"expand JSON"},rt={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:Ss,stringifyStringValues:!1},il={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:Ss,stringifyStringValues:!1},ol=()=>!0,rl=n=>{let{data:s,style:t=rt,shouldExpandNode:a=ol,clickToExpandNode:c=!1,beforeExpandChange:l,compactTopLevel:u,...g}=n;const i=j.useRef(null);return j.createElement("div",Object.assign({"aria-label":"JSON view"},g,{className:t.container,ref:i,role:"tree"}),u&&bs(s)?Object.entries(s).map(h=>{let[o,r]=h;return j.createElement(gt,{key:o,field:o,value:r,style:{...rt,...t},lastElement:!0,level:1,shouldExpandNode:a,clickToExpandNode:c,beforeExpandChange:l,outerRef:i})}):j.createElement(gt,{value:s,style:{...rt,...t},lastElement:!0,level:0,shouldExpandNode:a,clickToExpandNode:c,outerRef:i,beforeExpandChange:l}))},cl="_container_1h2lr_1",dl={container:cl},hl={...il,container:"rjv-container"};class et extends q.Component{shouldComponentUpdate(s){return s.data!==this.props.data||s.defaultExpand!==this.props.defaultExpand||s.expandNode!==this.props.expandNode}render(){const{data:s,defaultExpand:t,expandNode:a}=this.props;if(s==null)return null;const c=typeof a=="function"?a:t==="all"?()=>!0:t==="root"?l=>l<2:l=>l<1;return e.jsx("div",{className:dl.container,children:e.jsx(rl,{data:s,shouldExpandNode:c,style:hl})})}}function ul({currentId:n,visibleIds:s=[],key:t}){if(t!=="ArrowUp"&&t!=="ArrowDown")return null;const a=s.findIndex(l=>l===n),c=t==="ArrowUp"?-1:1;return a>=0?s[a+c]??null:null}const ml="_root_9isis_1",pl="_sidebar_9isis_9",gl="_section_9isis_18",fl="_sectionHeader_9isis_22",xl="_arrow_9isis_48",vl="_sectionTitle_9isis_54",yl="_sectionCount_9isis_62",jl="_sectionBody_9isis_71",Cl="_historyToggle_9isis_76",bl="_historyToggleLabel_9isis_102",Nl="_item_9isis_107",_l="_itemActive_9isis_133",Sl="_itemContent_9isis_143",kl="_itemLabel_9isis_149",wl="_itemSublabel_9isis_157",Tl="_itemTime_9isis_166",Ml="_content_9isis_175",El="_contentEmpty_9isis_183",Rl="_contentInner_9isis_190",Il="_emptyWrap_9isis_194",Ll="_roleHeader_9isis_202",Pl="_roleBadge_9isis_210",Al="_role_user_9isis_219",Dl="_role_assistant_9isis_225",Bl="_roleLabel_9isis_231",Ol="_contentTime_9isis_238",Fl="_turnDivider_9isis_246",$l="_textBlock_9isis_253",Hl="_textBlockBar_9isis_260",zl="_textBlockBody_9isis_269",Vl="_textBlockCompact_9isis_277",Ul="_textBlockCompactFloat_9isis_284",ql="_thinkingBlock_9isis_291",Wl="_thinkingHeader_9isis_299",Kl="_thinkingPreview_9isis_314",Gl="_thinkingBody_9isis_324",Jl="_toolBlock_9isis_330",Ql="_toolBlockResult_9isis_337",Yl="_toolBlockError_9isis_341",Xl="_toolBlockHeader_9isis_345",Zl="_toolBlockBody_9isis_356",ei="_toolName_9isis_361",ti="_toolId_9isis_367",si="_errorLabel_9isis_374",ai="_blockTag_9isis_384",ni="_blockTagText_9isis_397",li="_blockTagThinking_9isis_403",ii="_blockTagResult_9isis_409",oi="_blockTagError_9isis_415",ri="_jsonBlock_9isis_422",ci="_jsonBlockLabel_9isis_429",di="_blockSeparator_9isis_439",hi="_markdownBody_9isis_446",w={root:ml,sidebar:pl,section:gl,sectionHeader:fl,arrow:xl,sectionTitle:vl,sectionCount:yl,sectionBody:jl,historyToggle:Cl,historyToggleLabel:bl,item:Nl,itemActive:_l,itemContent:Sl,itemLabel:kl,itemSublabel:wl,itemTime:Tl,content:Ml,contentEmpty:El,contentInner:Rl,emptyWrap:Il,roleHeader:Ll,roleBadge:Pl,role_user:Al,role_assistant:Dl,roleLabel:Bl,contentTime:Ol,turnDivider:Fl,textBlock:$l,textBlockBar:Hl,textBlockBody:zl,textBlockCompact:Vl,textBlockCompactFloat:Ul,thinkingBlock:ql,thinkingHeader:Wl,thinkingPreview:Kl,thinkingBody:Gl,toolBlock:Jl,toolBlockResult:Ql,toolBlockError:Yl,toolBlockHeader:Xl,toolBlockBody:Zl,toolName:ei,toolId:ti,errorLabel:si,blockTag:ai,blockTagText:ni,blockTagThinking:li,blockTagResult:ii,blockTagError:oi,jsonBlock:ri,jsonBlockLabel:ci,blockSeparator:di,markdownBody:hi},{Text:ui}=es;function ft(n){if(n==null)return[];if(typeof n=="string"){const s=n.trim();return s?[{type:"markdown",text:s}]:[]}if(Array.isArray(n)){const s=[];for(const t of n)if(t)if(t.type==="text"){const a=(t.text||"").trim();a&&s.push({type:"markdown",text:a})}else if(t.type==="tool_use")s.push({type:"tool_use",name:t.name||"unknown",id:t.id||"",input:t.input??{}});else if(t.type==="tool_result"){const a=mi(t.content);s.push({type:"tool_result",tool_use_id:t.tool_use_id||"",is_error:t.is_error,content:a})}else if(t.type==="thinking"){const a=t.thinking||"";a.trim()&&s.push({type:"thinking",text:a})}else t.type==="image"?s.push({type:"json",label:"image",data:t}):s.push({type:"json",label:t.type||"block",data:t});return s}return[{type:"json",label:"content",data:n}]}function mi(n){if(n==null)return[];if(typeof n=="string"){const s=n.trim();return s?[{type:"markdown",text:s}]:[]}return Array.isArray(n)?n.flatMap(s=>{if(!s)return[];if(s.type==="text"){const t=(s.text||"").trim();return t?[{type:"markdown",text:t}]:[]}return[{type:"json",label:s.type||"block",data:s}]}):[{type:"json",label:"content",data:n}]}function pi(n){if(!n)return null;if(typeof n=="string")return[{type:"markdown",text:n}];if(Array.isArray(n)){const s=[];return n.forEach((t,a)=>{a>0&&s.push({type:"separator"}),t&&(typeof t=="string"?s.push({type:"markdown",text:t}):t.type==="text"?s.push({type:"markdown",text:t.text||""}):s.push({type:"json",label:t.type||"item",data:t}))}),s}return[{type:"json",label:"system",data:n}]}function gi(n){const s=[],t=(n==null?void 0:n.name)||"unknown",a=(n==null?void 0:n.description)||"";let c=`### ${t}
|
|
26
|
+
`)}renderProjectStatsContent(){const{projectStats:t,projectStatsLoading:a}=this.state;if(a)return e.jsx("div",{className:d.projectStatsCenter,children:e.jsx(Qt,{})});if(!t)return e.jsx("div",{className:d.projectStatsEmpty,children:p("ui.projectStats.noData")});const{summary:c,models:l,updatedAt:u}=t;l&&Object.entries(l).sort((h,o)=>o[1]-h[1]);const g={};if(t.files){for(const h of Object.values(t.files))if(h.models)for(const[o,r]of Object.entries(h.models))g[o]||(g[o]={input:0,output:0,cacheRead:0,cacheCreation:0,count:0}),g[o].input+=r.input_tokens||0,g[o].output+=r.output_tokens||0,g[o].cacheRead+=r.cache_read_input_tokens||0,g[o].cacheCreation+=r.cache_creation_input_tokens||0,g[o].count+=r.count||0}const i=Object.entries(g).sort((h,o)=>o[1].count-h[1].count);return e.jsxs("div",{className:d.projectStatsContent,children:[u&&e.jsx("div",{className:d.projectStatsUpdated,children:p("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:(c==null?void 0:c.requestCount)??0}),e.jsx("div",{className:d.projectStatLabel,children:p("ui.projectStats.totalRequests")})]}),e.jsxs("div",{className:d.projectStatCard,children:[e.jsx("div",{className:d.projectStatValue,children:(c==null?void 0:c.turnCount)??(c==null?void 0:c.sessionCount)??0}),e.jsx("div",{className:d.projectStatLabel,children:p("ui.projectStats.turnCount")})]}),e.jsxs("div",{className:d.projectStatCard,children:[e.jsx("div",{className:d.projectStatValue,children:(c==null?void 0:c.fileCount)??0}),e.jsx("div",{className:d.projectStatLabel,children:p("ui.projectStats.totalFiles")})]}),e.jsxs("div",{className:d.projectStatCard,children:[e.jsx("div",{className:d.projectStatValue,children:W(c==null?void 0:c.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:W(c==null?void 0:c.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:p("ui.projectStats.modelUsage")}),i.map(([h,o])=>{const r=o.input+o.cacheRead+o.cacheCreation,m=r>0?(o.cacheRead/r*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:[o.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:W(r)}),e.jsx("td",{className:d.td,children:W(o.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:W(o.cacheCreation)}),e.jsx("td",{className:d.td,children:W(o.cacheRead)})]}),e.jsxs("tr",{children:[e.jsx("td",{className:d.label,children:p("ui.hitRate")}),e.jsxs("td",{colSpan:2,className:d.td,children:[m,"%"]})]})]})})]},h)})]})]})}render(){const{requestCount:t,requests:a=[],viewMode:c,cacheType:l,onToggleViewMode:u,onImportLocalLogs:g,onLangChange:i,isLocalLog:h,localLogFile:o,projectName:r,collapseToolResults:m,onCollapseToolResultsChange:v,expandThinking:x,onExpandThinkingChange:f,showFullToolContent:y,onShowFullToolContentChange:C,expandDiff:k,onExpandDiffChange:_,filterIrrelevant:b,onFilterIrrelevantChange:T,logDir:R,onLogDirChange:P,updateInfo:I,onDismissUpdate:M,cliMode:B,terminalVisible:F,onToggleTerminal:ae,onReturnToWorkspaces:ne,contextWindow:A,serverCachedContent:X,resumeAutoChoice:oe,onResumeAutoChoiceToggle:Z,onResumeAutoChoiceChange:he}=this.props,{countdownText:ue}=this.state,fe=[{key:"import-local",icon:e.jsx(zt,{}),label:p("ui.importLocalLogs"),onClick:g},{key:"export-prompts",icon:e.jsx(sn,{}),label:p("ui.exportPrompts"),onClick:this.handleShowPrompts},{key:"plugin-management",icon:e.jsx(Ft,{}),label:p("ui.pluginManagement"),onClick:this.handleShowPlugins},{key:"switch-workspace",icon:e.jsx(zt,{className:d.iconMirror}),label:e.jsx("span",{className:d.disabledMenuItem,children:p("ui.switchWorkspace")}),disabled:!0},{key:"process-management",icon:e.jsx(it,{}),label:p("ui.processManagement"),onClick:this.handleShowProcesses},{key:"proxy-switch",icon:e.jsx(Ot,{}),label:p("ui.proxySwitch"),onClick:()=>this.setState({proxyModalVisible:!0})},{type:"divider"},{key:"project-stats",icon:e.jsx($t,{}),label:p("ui.projectStats"),onClick:this.handleShowProjectStats},...c==="raw"?[{key:"global-settings",icon:e.jsx(Vt,{}),label:p("ui.globalSettings"),onClick:()=>this.setState({globalSettingsVisible:!0})}]:[],...c==="chat"?[{key:"display-settings",icon:e.jsx(Vt,{}),label:p("ui.settings"),onClick:()=>this.setState({settingsDrawerVisible:!0})}]:[],{key:"language",icon:e.jsx(ln,{}),label:p("ui.languageSettings"),children:[{key:"lang-grid-container",type:"group",label:e.jsx("div",{className:d.langGrid,children:_n.map(N=>e.jsx(H,{size:"small",type:N.value===ia()?"primary":"default",onClick:U=>{U.stopPropagation(),la(N.value),i&&i()},className:d.langBtn,children:N.label},N.value))})}]}];return e.jsxs("div",{className:d.headerBar,children:[e.jsxs($e,{size:"middle",children:[e.jsx(oa,{menu:{items:fe,className:"logo-dropdown-menu"},trigger:["hover"],onOpenChange:N=>this.setState({logoDropdownOpen:N}),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(Oe,{content:this.renderTokenStats(),trigger:"hover",placement:"bottomLeft",overlayInnerStyle:{background:"#1e1e1e",border:"1px solid #3a3a3a",borderRadius:8,padding:"8px 8px",maxHeight:"80vh",overflowY:"auto"},children:e.jsxs(me,{className:d.tokenStatsTag,children:[e.jsx(it,{className:d.tokenStatsIcon}),p("ui.tokenStats")]})}),this.props.activeProxyId&&this.props.activeProxyId!=="max"&&(()=>{const N=(this.props.proxyProfiles||[]).find(U=>U.id===this.props.activeProxyId);return N?e.jsxs(me,{className:d.proxyProfileTag,onClick:()=>this.setState({proxyModalVisible:!0}),children:[e.jsx(Ot,{className:d.proxySwapIcon}),N.name,N.activeModel?` · ${N.activeModel}`:""]}):null})(),(()=>{var xe,be,Ne,_e,ye;let N=0;const U=ot.find(Q=>Q.value===this.state.calibrationModel),ee=U==null?void 0:U.tokens;if(!h){if(ee&&(A==null?void 0:A.used_percentage)!=null){const Q=$=>{var ve,Ue;const K=(Ue=(ve=$.response)==null?void 0:ve.body)==null?void 0:Ue.usage;return((K==null?void 0:K.input_tokens)||0)+((K==null?void 0:K.cache_creation_input_tokens)||0)+((K==null?void 0:K.cache_read_input_tokens)||0)};let L=0;for(let $=a.length-1;$>=0;$--)if(Ce(a[$])&&((be=(xe=a[$].response)==null?void 0:xe.body)!=null&&be.usage)){L=Q(a[$]);break}if(L>0){const $=ee*.835;N=Math.min(100,Math.max(0,Math.round(L/$*100)))}else{const $=A.context_window_size||2e5;N=Math.min(100,Math.max(0,Math.round(A.used_percentage*$/ee/83.5*100)))}}else if((A==null?void 0:A.used_percentage)!=null){const Q=this.state.settingsModel?wt(this.state.settingsModel):0,L=A.context_window_size||2e5;Q&&Q!==L?N=Math.min(100,Math.max(0,Math.round(A.used_percentage*L/Q/83.5*100))):N=Math.min(100,Math.max(0,Math.round(A.used_percentage/83.5*100)))}else if(a.length>0){const Q=L=>{var K,ve;const $=(ve=(K=L.response)==null?void 0:K.body)==null?void 0:ve.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 L=a.length-1;L>=0;L--)if(Ce(a[L])&&((_e=(Ne=a[L].response)==null?void 0:Ne.body)!=null&&_e.usage)){const $=Q(a[L]),ve=(ee||(A==null?void 0:A.context_window_size)||wt(((ye=a[L].body)==null?void 0:ye.model)||this.state.settingsModel))*.835;ve>0&&$>0&&(N=Math.min(100,Math.max(0,Math.round($/ve*100))));break}}}N===0&&this._lastContextPercent>0&&(N=this._lastContextPercent);const de=N>=80?"#ff4d4f":N>=60?"#faad14":"#52c41a";return h?e.jsx(me,{className:`${d.liveTag} ${d.liveTagHistory}`,children:e.jsx("span",{className:d.liveTagText,children:p("ui.historyLog",{file:o})})}):e.jsx(Oe,{content:this.state._cachePopoverOpen?this.renderCacheContentPopover(N):e.jsx("div",{className:d.cachePopoverPlaceholder}),trigger:"hover",placement:"bottomLeft",overlayInnerStyle:{background:"#1e1e1e",border:"1px solid #3a3a3a",borderRadius:8,padding:"8px 8px"},onOpenChange:Q=>{this.setState({_cachePopoverOpen:Q}),Q||(this._cacheScrollInited=!1)},children:e.jsxs("span",{className:d.liveTag,style:{borderColor:de,color:de},children:[e.jsx("span",{className:d.liveTagFill,style:{width:`${N}%`,backgroundColor:de}}),e.jsx("span",{className:d.liveTagContent,children:e.jsxs("span",{className:d.liveTagText,children:[p("ui.liveMonitoring"),r?`:${r}`:""]})})]})})})(),I&&e.jsx(me,{color:I.type==="completed"?"green":"orange",closable:!0,onClose:()=>M&&M(),children:I.type==="completed"?p("ui.update.completed",{version:I.version}):p("ui.update.majorAvailable",{version:I.version})})]}),e.jsxs($e,{size:"middle",children:[ue&&c==="raw"&&e.jsxs(me,{style:{background:"#2a2a2a",border:"1px solid #3a3a3a",color:ue===p("ui.cacheExpired")?"#ff6b6b":"#ccc"},children:[p("ui.cacheCountdown",{type:l?`(${l})`:""}),e.jsx("strong",{className:d.countdownStrong,children:ue})]}),c==="chat"&&B&&!h&&this.state.localUrl&&e.jsxs(e.Fragment,{children:[this.state.countryFlag&&e.jsx(Oe,{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:"#1e1e1e",border:"1px solid #3a3a3a",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(Oe,{content:e.jsxs("div",{className:d.qrcodePopover,children:[e.jsx("div",{className:d.qrcodeTitle,children:p("ui.scanToCoding")}),e.jsx(js,{value:this.state.localUrl,size:200,bgColor:"#141414",fgColor:"#d9d9d9",level:"M"}),e.jsx(we,{readOnly:!0,value:this.state.localUrl,className:d.qrcodeUrlInput,suffix:e.jsx(Fe,{className:d.qrcodeUrlCopy,onClick:()=>{navigator.clipboard.writeText(this.state.localUrl).then(()=>{G.success(p("ui.copied"))}).catch(()=>{})}})})]}),trigger:"hover",placement:"bottomRight",overlayInnerStyle:{background:"#1e1e1e",border:"1px solid #3a3a3a",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"})]})})})]}),B&&c==="chat"&&!h&&e.jsx(H,{className:d.compactBtn,type:F?"primary":"default",ghost:F,icon:e.jsx(Qe,{}),onClick:ae,children:p("ui.terminal")}),e.jsx(H,{className:d.compactBtn,type:c==="raw"?"primary":"default",icon:c==="raw"?e.jsx(ra,{}):e.jsx(Je,{}),onClick:u,children:c==="raw"?p("ui.chatMode"):p("ui.rawMode")})]}),e.jsxs(je,{title:`${p("ui.userPrompt")} (${this.state.promptData.length}${p("ui.promptCountUnit")})`,open:this.state.promptModalVisible,onCancel:()=>this.setState({promptModalVisible:!1}),footer:null,width:700,children:[e.jsx("div",{className:d.promptExportBar,children:e.jsx(H,{icon:e.jsx(ca,{}),onClick:this.handleExportPromptsTxt,children:p("ui.exportPromptsTxt")})}),e.jsx(Yt,{activeKey:this.state.promptViewMode,onChange:N=>this.setState({promptViewMode:N}),size:"small",items:[{key:"original",label:p("ui.promptModeOriginal")},{key:"context",label:p("ui.promptModeContext")},{key:"text",label:p("ui.promptModeText")}]}),this.state.promptViewMode==="text"?e.jsx("textarea",{readOnly:!0,className:d.promptTextarea,value:this.buildTextModeContent()}):e.jsxs("div",{className:d.promptScrollArea,children:[this.state.promptData.length===0&&e.jsx("div",{className:d.promptEmpty,children:p("ui.noPrompt")}),this.state.promptData.map((N,U)=>{const ee=N.timestamp?new Date(N.timestamp).toLocaleString():p("ui.unknownTime");return e.jsxs("div",{children:[e.jsxs("div",{className:d.promptTimestamp,children:[ee,":"]}),this.state.promptViewMode==="original"?this.renderOriginalPrompt(N):this.renderTextPrompt(N)]},U)})]})]}),e.jsxs(Ge,{title:p("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:p("ui.chatDisplaySwitches")}),e.jsxs("div",{className:d.settingsItem,children:[e.jsx("span",{className:d.settingsLabel,children:p("ui.collapseToolResults")}),e.jsx(Te,{checked:!!m,onChange:N=>v&&v(N)})]}),e.jsxs("div",{className:d.settingsItem,children:[e.jsx("span",{className:d.settingsLabel,children:p("ui.expandThinking")}),e.jsx(Te,{checked:!!x,onChange:N=>f&&f(N)})]}),e.jsxs("div",{className:d.settingsItem,children:[e.jsx("span",{className:d.settingsLabel,children:p("ui.showFullToolContent")}),e.jsx(Te,{checked:!!y,onChange:N=>C&&C(N)})]})]}),e.jsxs("div",{className:d.settingsGroupBox,children:[e.jsx("div",{className:d.settingsGroupTitle,children:p("ui.userPreferences")}),e.jsxs("div",{className:d.settingsItem,children:[e.jsx("span",{className:d.settingsLabel,children:p("ui.resumeAutoChoice")}),e.jsx(Te,{checked:!!oe,onChange:N=>Z&&Z(N)})]}),oe&&e.jsx("div",{className:d.settingsItem,children:e.jsxs(qe.Group,{value:oe,onChange:N=>he&&he(N.target.value),size:"small",children:[e.jsx(qe,{value:"continue",children:p("ui.resumeAutoChoice.continue")}),e.jsx(qe,{value:"new",children:p("ui.resumeAutoChoice.new")})]})})]})]}),e.jsxs(Ge,{title:e.jsxs("span",{children:[p("ui.globalSettings")," ",e.jsx(ie,{doc:"GlobalSettings"})]}),placement:"left",width:400,open:this.state.globalSettingsVisible,onClose:()=>this.setState({globalSettingsVisible:!1}),children:[e.jsxs("div",{className:d.settingsItem,children:[e.jsx("span",{className:d.settingsLabel,children:p("ui.filterIrrelevant")}),e.jsx(Te,{checked:!!b,onChange:N=>T&&T(N)})]}),e.jsxs("div",{className:d.settingsItem,children:[e.jsx("span",{className:d.settingsLabel,children:p("ui.expandDiff")}),e.jsx(Te,{checked:!!k,onChange:N=>_&&_(N)})]}),e.jsx("div",{className:d.settingsDivider}),e.jsx("div",{className:d.settingsLabel,children:p("ui.logDirTitle")}),e.jsx(we,{className:d.logDirInput,value:this.state.logDirDraft??R,onChange:N=>this.setState({logDirDraft:N.target.value}),onBlur:()=>{const N=this.state.logDirDraft;N!=null&&N!==R&&(P==null||P(N)),this.setState({logDirDraft:null})},onPressEnter:()=>{const N=this.state.logDirDraft;N!=null&&N!==R&&(P==null||P(N)),this.setState({logDirDraft:null})},placeholder:"~/.claude/cc-viewer"})]}),e.jsx(Ge,{title:e.jsxs("span",{children:[e.jsx($t,{className:d.titleIcon}),p("ui.projectStats")]}),placement:"left",width:400,open:this.state.projectStatsVisible,onClose:()=>this.setState({projectStatsVisible:!1}),children:this.renderProjectStatsContent()}),e.jsxs(je,{title:e.jsxs("span",{children:[e.jsx(Ft,{className:d.titleIcon}),p("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(Tt,{}),onClick:this.handleAddPlugin,children:p("ui.plugins.add")}),e.jsx(H,{icon:e.jsx(Ht,{}),onClick:this.handleShowCdnModal,children:p("ui.plugins.cdnInstall")})]}),e.jsx(H,{icon:e.jsx(ut,{}),onClick:this.handleReloadPlugins,children:p("ui.plugins.reload")})]}),width:560,children:[this.state.pluginsDir&&e.jsxs("div",{className:d.pluginDirHint,children:[e.jsxs("span",{className:d.pluginDirLabel,children:[p("ui.plugins.pluginsDir"),":"]})," ",e.jsx("code",{className:d.pluginDirPath,onClick:()=>{navigator.clipboard.writeText(this.state.pluginsDir).then(()=>{G.success(p("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:p("ui.plugins.empty")}),e.jsx("div",{className:d.pluginEmptyHint,children:p("ui.plugins.emptyHint")})]}):e.jsx("div",{className:d.pluginList,children:this.state.pluginsList.map(N=>e.jsxs("div",{className:d.pluginItem,children:[e.jsxs("div",{className:d.pluginInfo,children:[e.jsx("span",{className:d.pluginName,children:N.name}),e.jsx("span",{className:d.pluginFile,children:N.file}),N.hooks.length>0&&e.jsx("span",{className:d.pluginHooks,children:N.hooks.map(U=>e.jsx("span",{className:d.pluginHookTag,children:U},U))})]}),e.jsxs("div",{className:d.pluginActions,children:[e.jsx(Te,{size:"small",checked:N.enabled,onChange:U=>this.handleTogglePlugin(N.name,U)}),e.jsx(H,{type:"text",size:"small",danger:!0,icon:e.jsx(ht,{}),onClick:()=>this.handleDeletePlugin(N.file,N.name)})]})]},N.file))})]}),e.jsx(je,{title:p("ui.plugins.delete"),open:this.state.deleteConfirmVisible,onCancel:()=>this.setState({deleteConfirmVisible:!1,deleteTarget:null}),onOk:this.handleDeletePluginConfirm,okType:"danger",okText:"OK",cancelText:"Cancel",children:e.jsx("p",{children:this.state.deleteTarget?p("ui.plugins.deleteConfirm",{name:this.state.deleteTarget.name}):""})}),e.jsx(je,{title:e.jsxs("span",{children:[e.jsx(Ht,{className:d.titleIcon}),p("ui.plugins.cdnInstall")]}),open:this.state.cdnModalVisible,onCancel:this.handleCdnCancel,onOk:this.handleCdnInstall,confirmLoading:this.state.cdnLoading,okText:p("ui.plugins.cdnInstallBtn"),cancelText:p("ui.cancel"),width:480,children:e.jsxs("div",{children:[e.jsx("div",{className:d.cdnUrlLabel,children:p("ui.plugins.cdnUrl")}),e.jsx(we,{placeholder:p("ui.plugins.cdnUrlPlaceholder"),value:this.state.cdnUrl,onChange:this.handleCdnUrlChange,onPressEnter:this.handleCdnInstall,className:d.cdnInput})]})}),e.jsx(je,{title:e.jsxs("span",{children:[e.jsx(it,{className:d.titleIcon}),p("ui.processManagement")]}),open:this.state.processModalVisible,onCancel:()=>this.setState({processModalVisible:!1}),footer:e.jsx(H,{icon:e.jsx(ut,{}),onClick:this.fetchProcesses,loading:this.state.processLoading,children:p("ui.processManagement.refresh")}),width:780,children:e.jsx(da,{dataSource:this.state.processList,rowKey:"pid",loading:this.state.processLoading,size:"middle",pagination:!1,columns:[{title:p("ui.processManagement.port"),dataIndex:"port",width:80,render:N=>N?e.jsx("a",{href:`${window.location.protocol}//127.0.0.1:${N}`,target:"_blank",rel:"noopener noreferrer",children:N}):""},{title:"PID",dataIndex:"pid",width:80},{title:p("ui.processManagement.command"),dataIndex:"command",ellipsis:!0},{title:p("ui.processManagement.startTime"),dataIndex:"startTime",width:200},{title:p("ui.processManagement.action"),width:100,render:(N,U)=>U.isCurrent?e.jsx(H,{size:"small",className:d.currentProcessBtn,children:p("ui.processManagement.current")}):e.jsx(H,{size:"small",danger:!0,onClick:()=>this.handleKillProcess(U.pid),children:p("ui.processManagement.kill")})}]})}),e.jsx(je,{title:e.jsxs("span",{children:[e.jsx(Xt,{apiEndpoint:le("/api/open-profile-dir"),title:p("ui.proxy.openConfigDir"),size:16})," ",p("ui.proxySwitch")," ",e.jsx(ie,{doc:"ProxySwitch",zIndex:1100})]}),open:this.state.proxyModalVisible,onCancel:()=>this.setState({proxyModalVisible:!1,editingProxy:null}),footer:null,width:520,children:this.renderProxyProfileList()})]})}renderProxyProfileList(){const t=this.props.proxyProfiles||[],a=this.props.activeProxyId||"max",{editingProxy:c,editForm:l}=this.state;return e.jsxs("div",{children:[e.jsxs("div",{className:d.proxyWarning,children:["⚠️ ",p("ui.proxy.maxWarning")]}),e.jsx("div",{className:d.proxyList,children:t.map(u=>{var g;return e.jsxs("div",{className:`${d.proxyItem} ${u.id===a?d.proxyItemActive:""}`,children:[e.jsxs("div",{className:d.proxyItemMain,onClick:()=>{if(u.id!==a){const i={active:u.id,profiles:t};this.props.onProxyProfileChange(i)}},children:[e.jsx(qe,{checked:u.id===a,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(me,{className:d.proxyBuiltinTag,children:p("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(ha,{}),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(ht,{}),onClick:()=>{je.confirm({title:p("ui.proxy.deleteProxy"),content:p("ui.proxy.deleteConfirm",{name:u.name}),okType:"danger",onOk:()=>{const i=t.filter(o=>o.id!==u.id),h=a===u.id?"max":a;this.props.onProxyProfileChange({active:h,profiles:i})}})}})]})]},u.id)})}),c&&e.jsxs("div",{className:d.proxyEditForm,children:[e.jsxs("div",{className:d.proxyEditRow,children:[e.jsxs("label",{children:[p("ui.proxy.name")," ",e.jsx("span",{className:d.proxyRequired,children:"*"})]}),e.jsx(we,{size:"small",value:l.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:[p("ui.proxy.baseURL")," ",e.jsx("span",{className:d.proxyRequired,children:"*"})]}),e.jsx(we,{size:"small",value:l.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:[p("ui.proxy.apiKey")," ",e.jsx("span",{className:d.proxyRequired,children:"*"})]}),e.jsx(we.Password,{size:"small",value:l.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:p("ui.proxy.models")}),e.jsx(we,{size:"small",value:l.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:p("ui.proxy.activeModel")}),e.jsx(Ke,{size:"small",className:d.fullWidthSelect,value:l.activeModel||void 0,onChange:u=>this.setState(g=>({editForm:{...g.editForm,activeModel:u}})),placeholder:p("ui.proxy.activeModel"),children:(l.models||"").split(",").map(u=>u.trim()).filter(Boolean).map(u=>e.jsx(Ke.Option,{value:u,children:u},u))})]}),e.jsxs("div",{className:d.proxyEditBtns,children:[e.jsx(H,{size:"small",icon:e.jsx(ua,{}),type:"primary",onClick:()=>{var h,o,r;if(!((h=l.name)!=null&&h.trim())||!((o=l.baseURL)!=null&&o.trim())||!((r=l.apiKey)!=null&&r.trim())){G.warning(p("ui.proxy.requiredFields"));return}const u=(l.models||"").split(",").map(m=>m.trim()).filter(Boolean),g={id:c==="__new__"?`proxy_${Date.now()}`:c,name:l.name.trim(),baseURL:l.baseURL.trim(),apiKey:l.apiKey.trim(),models:u,activeModel:l.activeModel||u[0]||""};let i;c==="__new__"?i=[...t,g]:i=t.map(m=>m.id===c?{...m,...g,id:m.id}:m),this.props.onProxyProfileChange({active:a,profiles:i}),this.setState({editingProxy:null})},children:p("ui.proxy.save")}),e.jsx(H,{size:"small",icon:e.jsx(ma,{}),onClick:()=>this.setState({editingProxy:null}),children:p("ui.proxy.cancel")})]})]}),!c&&e.jsx(H,{block:!0,type:"dashed",icon:e.jsx(Tt,{}),style:{marginTop:12},onClick:()=>this.setState({editingProxy:"__new__",editForm:{name:"",baseURL:"",apiKey:"",models:"",activeModel:""}}),children:p("ui.proxy.addProxy")})]})}};O(Me,"COMMAND_TAGS",new Set(["command-name","command-message","command-args","local-command-caveat","local-command-stdout"]));let Xe=Me;const Sn="_centerEmpty_18l8t_1",kn="_scrollContainer_18l8t_8",wn="_listItem_18l8t_15",Tn="_listItemActive_18l8t_27",Mn="_itemContent_18l8t_36",En="_itemHeader_18l8t_41",Rn="_tagNoMargin_18l8t_49",In="_modelName_18l8t_54",Ln="_modelNameMain_18l8t_59",Pn="_time_18l8t_63",An="_detailRow_18l8t_69",Dn="_urlText_18l8t_76",Bn="_duration_18l8t_85",On="_statusOk_18l8t_90",Fn="_statusErr_18l8t_96",$n="_statusDefault_18l8t_101",Hn="_usageBox_18l8t_106",zn="_cacheDot_18l8t_116",Vn="_cacheDotLoss_18l8t_125",Un="_cacheDotNormal_18l8t_130",qn="_tagMainAgent_18l8t_134",Wn="_tagPlan_18l8t_140",Kn="_tagMuted_18l8t_146",Gn="_tooltipPreLine_18l8t_152",V={centerEmpty:Sn,scrollContainer:kn,listItem:wn,listItemActive:Tn,itemContent:Mn,itemHeader:En,tagNoMargin:Rn,modelName:In,modelNameMain:Ln,time:Pn,detailRow:An,urlText:Dn,duration:Bn,statusOk:On,statusErr:Fn,statusDefault:$n,usageBox:Hn,cacheDot:zn,cacheDotLoss:Vn,cacheDotNormal:Un,tagMainAgent:qn,tagPlan:Wn,tagMuted:Kn,tooltipPreLine:Gn};class Jn extends q.Component{constructor(t){super(t);O(this,"handleKeyDown",t=>{if(t.key!=="ArrowUp"&&t.key!=="ArrowDown")return;const{requests:a,selectedIndex:c,onSelect:l}=this.props;if(!a.length)return;t.preventDefault();const u=c??0,g=t.key==="ArrowUp"?Math.max(0,u-1):Math.min(a.length-1,u+1);g!==u&&l(g)});this.activeItemRef=q.createRef()}componentDidMount(){this.scrollToSelected(!0)}shouldComponentUpdate(t){return t.requests!==this.props.requests||t.selectedIndex!==this.props.selectedIndex||t.scrollCenter!==this.props.scrollCenter||t.cacheLossMap!==this.props.cacheLossMap}componentDidUpdate(t){this.props.scrollCenter&&t.selectedIndex!==this.props.selectedIndex?this.scrollToSelected(!0):t.selectedIndex!==this.props.selectedIndex&&(this.scrollToSelected(!1),this.activeItemRef.current&&this.activeItemRef.current.focus({preventScroll:!0}))}scrollToSelected(t){this.activeItemRef.current&&(this.activeItemRef.current.scrollIntoView({block:t?"center":"nearest",behavior:"instant"}),t&&this.props.onScrollDone&&this.props.onScrollDone())}render(){const{requests:t,selectedIndex:a,onSelect:c}=this.props;return t.length===0?e.jsx("div",{className:V.centerEmpty,children:e.jsx(Ee,{description:p("ui.waitingRequests")})}):e.jsx("div",{className:V.scrollContainer,onKeyDown:this.handleKeyDown,children:e.jsx(Mt,{dataSource:t,size:"small",split:!1,renderItem:(l,u)=>{var T,R,P;const g=new Date(l.timestamp).toLocaleTimeString("zh-CN"),i=u===a,h=l.response&&l.response.status<400,o=l.response&&l.response.status>=400,r=pa((T=l.body)==null?void 0:T.model),m=u+1<t.length?t[u+1]:null,{type:v,subType:x}=Ve(l,m),f=(P=(R=l.response)==null?void 0:R.body)==null?void 0:P.usage,y=f?(f.input_tokens||0)+(f.cache_read_input_tokens||0)+(f.cache_creation_input_tokens||0):null,C=(f==null?void 0:f.output_tokens)||null,k=(f==null?void 0:f.cache_read_input_tokens)||0,_=(f==null?void 0:f.cache_creation_input_tokens)||0;let b=l.url;try{const I=new URL(l.url);b=I.host+I.pathname}catch{}return e.jsx(Mt.Item,{ref:i?this.activeItemRef:void 0,tabIndex:0,onClick:()=>c(u),className:`${V.listItem} ${i?V.listItemActive:""}`,children:e.jsxs("div",{className:V.itemContent,children:[e.jsxs("div",{className:V.itemHeader,children:[v==="MainAgent"?e.jsx(me,{className:`${V.tagNoMargin} ${V.tagMainAgent}`,children:"MainAgent"}):v==="Plan"?e.jsx(me,{className:`${V.tagNoMargin} ${V.tagPlan}`,children:Et(v,x)}):v==="Count"||v==="Preflight"?e.jsx(me,{className:`${V.tagNoMargin} ${V.tagMuted}`,children:v}):e.jsx(me,{className:V.tagNoMargin,children:Et(v,x)}),r&&e.jsx("span",{className:`${V.modelName} ${v==="MainAgent"?V.modelNameMain:""}`,children:r}),e.jsx("span",{className:V.time,children:g})]}),e.jsxs("div",{className:V.detailRow,children:[e.jsx("span",{className:V.urlText,title:l.url,children:b}),l.duration&&e.jsxs("span",{className:V.duration,children:[l.duration,"ms"]}),l.response&&e.jsx("span",{className:h?V.statusOk:o?V.statusErr:V.statusDefault,children:l.response.status})]}),f&&e.jsxs("div",{className:V.usageBox,children:[e.jsxs("div",{children:["token: output:",W(C)||0,", input: ",W(y)||0]}),(k>0||_>0)&&e.jsx("div",{children:(()=>{var F;const I=(F=this.props.cacheLossMap)==null?void 0:F.get(u),M={ttl:"ui.cacheLoss.ttl",system_change:"ui.cacheLoss.systemChange",tools_change:"ui.cacheLoss.toolsChange",model_change:"ui.cacheLoss.modelChange",msg_truncated:"ui.cacheLoss.msgTruncated",msg_modified:"ui.cacheLoss.msgModified",key_change:"ui.cacheLoss.keyChange"};let B;if(I){const ne=(I.reasons||[I.reason]).map(A=>p(M[A]||M.key_change)).join(`
|
|
27
|
+
`);B=e.jsx(Zt,{title:e.jsx("span",{className:V.tooltipPreLine,children:ne}),children:e.jsx("span",{className:`${V.cacheDot} ${V.cacheDotLoss}`})})}else B=e.jsx("span",{className:`${V.cacheDot} ${V.cacheDotNormal}`});return e.jsxs(e.Fragment,{children:["cache",B,": ",k>0?`read:${W(k)}`:"",k>0&&_>0?", ":"",_>0?`create:${W(_)}`:""]})})()})]})]})})}})})}}const Qn=n=>typeof n=="boolean"||n instanceof Boolean,Yn=n=>typeof n=="number"||n instanceof Number,Xn=n=>typeof n=="bigint"||n instanceof BigInt,Cs=n=>!!n&&n instanceof Date,Zn=n=>typeof n=="string"||n instanceof String,el=n=>Array.isArray(n),bs=n=>typeof n=="object"&&n!==null,Ns=n=>!!n&&n instanceof Object&&typeof n=="function";function Ze(n,s){return s===void 0&&(s=!1),!n||s?`"${n}"`:n}function tl(n,s,t){return t?JSON.stringify(n):s?`"${n}"`:n}function _s(n){let{field:s,value:t,data:a,lastElement:c,openBracket:l,closeBracket:u,level:g,style:i,shouldExpandNode:h,clickToExpandNode:o,outerRef:r,beforeExpandChange:m}=n;const v=j.useRef(!1),[x,f]=j.useState(()=>h(g,t,s)),y=j.useRef(null);j.useEffect(()=>{v.current?f(h(g,t,s)):v.current=!0},[h]);const C=j.useId();if(a.length===0)return sl({field:s,openBracket:l,closeBracket:u,lastElement:c,style:i});const k=x?i.collapseIcon:i.expandIcon,_=x?i.ariaLables.collapseJson:i.ariaLables.expandJson,b=g+1,T=a.length-1,R=M=>{x!==M&&(!m||m({level:g,value:t,field:s,newExpandValue:M}))&&f(M)},P=M=>{if(M.key==="ArrowRight"||M.key==="ArrowLeft")M.preventDefault(),R(M.key==="ArrowRight");else if(M.key==="ArrowUp"||M.key==="ArrowDown"){M.preventDefault();const B=M.key==="ArrowUp"?-1:1;if(!r.current)return;const F=r.current.querySelectorAll("[role=button]");let ae=-1;for(let A=0;A<F.length;A++)if(F[A].tabIndex===0){ae=A;break}if(ae<0)return;const ne=(ae+B+F.length)%F.length;F[ae].tabIndex=-1,F[ne].tabIndex=0,F[ne].focus()}},I=()=>{var M;R(!x);const B=y.current;if(!B)return;const F=(M=r.current)===null||M===void 0?void 0:M.querySelector('[role=button][tabindex="0"]');F&&(F.tabIndex=-1),B.tabIndex=0,B.focus()};return j.createElement("div",{className:i.basicChildStyle,role:"treeitem","aria-expanded":x,"aria-selected":void 0},j.createElement("span",{className:k,onClick:I,onKeyDown:P,role:"button","aria-label":_,"aria-expanded":x,"aria-controls":x?C:void 0,ref:y,tabIndex:g===0?0:-1}),(s||s==="")&&(o?j.createElement("span",{className:i.clickableLabel,onClick:I,onKeyDown:P},Ze(s,i.quotesForFieldNames),":"):j.createElement("span",{className:i.label},Ze(s,i.quotesForFieldNames),":")),j.createElement("span",{className:i.punctuation},l),x?j.createElement("ul",{id:C,role:"group",className:i.childFieldsContainer},a.map((M,B)=>j.createElement(gt,{key:M[0]||B,field:M[0],value:M[1],style:i,lastElement:B===T,level:b,shouldExpandNode:h,clickToExpandNode:o,beforeExpandChange:m,outerRef:r}))):j.createElement("span",{className:i.collapsedContent,onClick:I,onKeyDown:P}),j.createElement("span",{className:i.punctuation},u),!c&&j.createElement("span",{className:i.punctuation},","))}function sl(n){let{field:s,openBracket:t,closeBracket:a,lastElement:c,style:l}=n;return j.createElement("div",{className:l.basicChildStyle,role:"treeitem","aria-selected":void 0},(s||s==="")&&j.createElement("span",{className:l.label},Ze(s,l.quotesForFieldNames),":"),j.createElement("span",{className:l.punctuation},t),j.createElement("span",{className:l.punctuation},a),!c&&j.createElement("span",{className:l.punctuation},","))}function al(n){let{field:s,value:t,style:a,lastElement:c,shouldExpandNode:l,clickToExpandNode:u,level:g,outerRef:i,beforeExpandChange:h}=n;return _s({field:s,value:t,lastElement:c||!1,level:g,openBracket:"{",closeBracket:"}",style:a,shouldExpandNode:l,clickToExpandNode:u,data:Object.keys(t).map(o=>[o,t[o]]),outerRef:i,beforeExpandChange:h})}function nl(n){let{field:s,value:t,style:a,lastElement:c,level:l,shouldExpandNode:u,clickToExpandNode:g,outerRef:i,beforeExpandChange:h}=n;return _s({field:s,value:t,lastElement:c||!1,level:l,openBracket:"[",closeBracket:"]",style:a,shouldExpandNode:u,clickToExpandNode:g,data:t.map(o=>[void 0,o]),outerRef:i,beforeExpandChange:h})}function ll(n){let{field:s,value:t,style:a,lastElement:c}=n,l,u=a.otherValue;return t===null?(l="null",u=a.nullValue):t===void 0?(l="undefined",u=a.undefinedValue):Zn(t)?(l=tl(t,!a.noQuotesForStringValues,a.stringifyStringValues),u=a.stringValue):Qn(t)?(l=t?"true":"false",u=a.booleanValue):Yn(t)?(l=t.toString(),u=a.numberValue):Xn(t)?(l=`${t.toString()}n`,u=a.numberValue):Cs(t)?l=t.toISOString():Ns(t)?l="function() { }":l=t.toString(),j.createElement("div",{className:a.basicChildStyle,role:"treeitem","aria-selected":void 0},(s||s==="")&&j.createElement("span",{className:a.label},Ze(s,a.quotesForFieldNames),":"),j.createElement("span",{className:u},l),!c&&j.createElement("span",{className:a.punctuation},","))}function gt(n){const s=n.value;return el(s)?j.createElement(nl,Object.assign({},n)):bs(s)&&!Cs(s)&&!Ns(s)?j.createElement(al,Object.assign({},n)):j.createElement(ll,Object.assign({},n))}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 Ss={collapseJson:"collapse JSON",expandJson:"expand JSON"},rt={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:Ss,stringifyStringValues:!1},il={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:Ss,stringifyStringValues:!1},ol=()=>!0,rl=n=>{let{data:s,style:t=rt,shouldExpandNode:a=ol,clickToExpandNode:c=!1,beforeExpandChange:l,compactTopLevel:u,...g}=n;const i=j.useRef(null);return j.createElement("div",Object.assign({"aria-label":"JSON view"},g,{className:t.container,ref:i,role:"tree"}),u&&bs(s)?Object.entries(s).map(h=>{let[o,r]=h;return j.createElement(gt,{key:o,field:o,value:r,style:{...rt,...t},lastElement:!0,level:1,shouldExpandNode:a,clickToExpandNode:c,beforeExpandChange:l,outerRef:i})}):j.createElement(gt,{value:s,style:{...rt,...t},lastElement:!0,level:0,shouldExpandNode:a,clickToExpandNode:c,outerRef:i,beforeExpandChange:l}))},cl="_container_17kea_1",dl={container:cl},hl={...il,container:"rjv-container"};class et extends q.Component{shouldComponentUpdate(s){return s.data!==this.props.data||s.defaultExpand!==this.props.defaultExpand||s.expandNode!==this.props.expandNode}render(){const{data:s,defaultExpand:t,expandNode:a}=this.props;if(s==null)return null;const c=typeof a=="function"?a:t==="all"?()=>!0:t==="root"?l=>l<2:l=>l<1;return e.jsx("div",{className:dl.container,children:e.jsx(rl,{data:s,shouldExpandNode:c,style:hl})})}}function ul({currentId:n,visibleIds:s=[],key:t}){if(t!=="ArrowUp"&&t!=="ArrowDown")return null;const a=s.findIndex(l=>l===n),c=t==="ArrowUp"?-1:1;return a>=0?s[a+c]??null:null}const ml="_root_9isis_1",pl="_sidebar_9isis_9",gl="_section_9isis_18",fl="_sectionHeader_9isis_22",xl="_arrow_9isis_48",yl="_sectionTitle_9isis_54",vl="_sectionCount_9isis_62",jl="_sectionBody_9isis_71",Cl="_historyToggle_9isis_76",bl="_historyToggleLabel_9isis_102",Nl="_item_9isis_107",_l="_itemActive_9isis_133",Sl="_itemContent_9isis_143",kl="_itemLabel_9isis_149",wl="_itemSublabel_9isis_157",Tl="_itemTime_9isis_166",Ml="_content_9isis_175",El="_contentEmpty_9isis_183",Rl="_contentInner_9isis_190",Il="_emptyWrap_9isis_194",Ll="_roleHeader_9isis_202",Pl="_roleBadge_9isis_210",Al="_role_user_9isis_219",Dl="_role_assistant_9isis_225",Bl="_roleLabel_9isis_231",Ol="_contentTime_9isis_238",Fl="_turnDivider_9isis_246",$l="_textBlock_9isis_253",Hl="_textBlockBar_9isis_260",zl="_textBlockBody_9isis_269",Vl="_textBlockCompact_9isis_277",Ul="_textBlockCompactFloat_9isis_284",ql="_thinkingBlock_9isis_291",Wl="_thinkingHeader_9isis_299",Kl="_thinkingPreview_9isis_314",Gl="_thinkingBody_9isis_324",Jl="_toolBlock_9isis_330",Ql="_toolBlockResult_9isis_337",Yl="_toolBlockError_9isis_341",Xl="_toolBlockHeader_9isis_345",Zl="_toolBlockBody_9isis_356",ei="_toolName_9isis_361",ti="_toolId_9isis_367",si="_errorLabel_9isis_374",ai="_blockTag_9isis_384",ni="_blockTagText_9isis_397",li="_blockTagThinking_9isis_403",ii="_blockTagResult_9isis_409",oi="_blockTagError_9isis_415",ri="_jsonBlock_9isis_422",ci="_jsonBlockLabel_9isis_429",di="_blockSeparator_9isis_439",hi="_markdownBody_9isis_446",w={root:ml,sidebar:pl,section:gl,sectionHeader:fl,arrow:xl,sectionTitle:yl,sectionCount:vl,sectionBody:jl,historyToggle:Cl,historyToggleLabel:bl,item:Nl,itemActive:_l,itemContent:Sl,itemLabel:kl,itemSublabel:wl,itemTime:Tl,content:Ml,contentEmpty:El,contentInner:Rl,emptyWrap:Il,roleHeader:Ll,roleBadge:Pl,role_user:Al,role_assistant:Dl,roleLabel:Bl,contentTime:Ol,turnDivider:Fl,textBlock:$l,textBlockBar:Hl,textBlockBody:zl,textBlockCompact:Vl,textBlockCompactFloat:Ul,thinkingBlock:ql,thinkingHeader:Wl,thinkingPreview:Kl,thinkingBody:Gl,toolBlock:Jl,toolBlockResult:Ql,toolBlockError:Yl,toolBlockHeader:Xl,toolBlockBody:Zl,toolName:ei,toolId:ti,errorLabel:si,blockTag:ai,blockTagText:ni,blockTagThinking:li,blockTagResult:ii,blockTagError:oi,jsonBlock:ri,jsonBlockLabel:ci,blockSeparator:di,markdownBody:hi},{Text:ui}=es;function ft(n){if(n==null)return[];if(typeof n=="string"){const s=n.trim();return s?[{type:"markdown",text:s}]:[]}if(Array.isArray(n)){const s=[];for(const t of n)if(t)if(t.type==="text"){const a=(t.text||"").trim();a&&s.push({type:"markdown",text:a})}else if(t.type==="tool_use")s.push({type:"tool_use",name:t.name||"unknown",id:t.id||"",input:t.input??{}});else if(t.type==="tool_result"){const a=mi(t.content);s.push({type:"tool_result",tool_use_id:t.tool_use_id||"",is_error:t.is_error,content:a})}else if(t.type==="thinking"){const a=t.thinking||"";a.trim()&&s.push({type:"thinking",text:a})}else t.type==="image"?s.push({type:"json",label:"image",data:t}):s.push({type:"json",label:t.type||"block",data:t});return s}return[{type:"json",label:"content",data:n}]}function mi(n){if(n==null)return[];if(typeof n=="string"){const s=n.trim();return s?[{type:"markdown",text:s}]:[]}return Array.isArray(n)?n.flatMap(s=>{if(!s)return[];if(s.type==="text"){const t=(s.text||"").trim();return t?[{type:"markdown",text:t}]:[]}return[{type:"json",label:s.type||"block",data:s}]}):[{type:"json",label:"content",data:n}]}function pi(n){if(!n)return null;if(typeof n=="string")return[{type:"markdown",text:n}];if(Array.isArray(n)){const s=[];return n.forEach((t,a)=>{a>0&&s.push({type:"separator"}),t&&(typeof t=="string"?s.push({type:"markdown",text:t}):t.type==="text"?s.push({type:"markdown",text:t.text||""}):s.push({type:"json",label:t.type||"item",data:t}))}),s}return[{type:"json",label:"system",data:n}]}function gi(n){const s=[],t=(n==null?void 0:n.name)||"unknown",a=(n==null?void 0:n.description)||"";let c=`### ${t}
|
|
28
28
|
|
|
29
29
|
`;a&&(c+=`${a}
|
|
30
30
|
|
|
31
|
-
`),s.push({type:"markdown",text:c});const l=(n==null?void 0:n.input_schema)||(n==null?void 0:n.parameters)||null;return l&&s.push({type:"json",label:"Parameters",data:l}),s}function fi(n){var s;if(typeof n=="string")return n.slice(0,60).replace(/\n/g," ");if(Array.isArray(n)){for(const t of n)if((t==null?void 0:t.type)==="text"&&((s=t.text)!=null&&s.trim()))return t.text.trim().slice(0,60).replace(/\n/g," ")}return""}function xi(n){var a;const s=[];let t=0;for(;t<n.length;){const c=n[t];if((c==null?void 0:c.role)!=="user"){t++;continue}const l=((a=n[t+1])==null?void 0:a.role)==="assistant"?n[t+1]:null;s.push({id:`turn__${t}`,isTurn:!0,turnIndex:s.length,timestamp:c._timestamp||null,assistantTimestamp:(l==null?void 0:l._timestamp)||null,userBlocks:ft(c==null?void 0:c.content),assistantBlocks:l?ft(l.content):null,preview:fi(c==null?void 0:c.content)}),t+=l?2:1}return s}function xt(n){try{return new Date(n).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}catch{return null}}function vi({text:n,compact:s}){const t=ts(n);return s?e.jsx("div",{className:w.textBlockCompact,children:e.jsx("div",{className:`chat-md ${w.markdownBody}`,dangerouslySetInnerHTML:{__html:t}})}):e.jsxs("div",{className:w.textBlock,children:[e.jsx("div",{className:w.textBlockBar,children:e.jsx("span",{className:`${w.blockTag} ${w.blockTagText}`,children:"text"})}),e.jsx("div",{className:`chat-md ${w.textBlockBody}`,dangerouslySetInnerHTML:{__html:t}})]})}function yi({block:n}){const[s,t]=j.useState(!0),a=n.text.length>60?n.text.slice(0,60).replace(/\n/g," ")+"…":n.text.replace(/\n/g," ");return e.jsxs("div",{className:w.thinkingBlock,children:[e.jsxs("div",{className:w.thinkingHeader,onClick:()=>t(c=>!c),children:[s?e.jsx(Re,{className:w.arrow}):e.jsx(Ie,{className:w.arrow}),e.jsx("span",{className:`${w.blockTag} ${w.blockTagThinking}`,children:"thinking"}),!s&&e.jsx("span",{className:w.thinkingPreview,children:a})]}),s&&e.jsx("div",{className:w.thinkingBody,children:e.jsx("div",{className:`chat-md ${w.markdownBody}`,dangerouslySetInnerHTML:{__html:ts(n.text)}})})]})}function tt({blocks:n,compact:s}){return!n||n.length===0?null:e.jsx(e.Fragment,{children:n.map((t,a)=>e.jsx(ji,{block:t,compact:s},a))})}function ji({block:n,compact:s}){var t;return n.type==="separator"?e.jsx("hr",{className:w.blockSeparator}):n.type==="markdown"?(t=n.text)!=null&&t.trim()?e.jsx(vi,{text:n.text,compact:s}):null:n.type==="thinking"?e.jsx(yi,{block:n}):n.type==="tool_use"?e.jsxs("div",{className:w.toolBlock,children:[e.jsxs("div",{className:w.toolBlockHeader,children:[e.jsx("span",{className:w.blockTag,children:"tool_use"}),e.jsx("span",{className:w.toolName,children:n.name}),n.id&&e.jsx("span",{className:w.toolId,children:n.id})]}),e.jsx("div",{className:w.toolBlockBody,children:e.jsx(et,{data:n.input,defaultExpand:"root"})})]}):n.type==="tool_result"?e.jsxs("div",{className:`${w.toolBlock} ${n.is_error?w.toolBlockError:w.toolBlockResult}`,children:[e.jsxs("div",{className:w.toolBlockHeader,children:[e.jsx("span",{className:`${w.blockTag} ${n.is_error?w.blockTagError:w.blockTagResult}`,children:"tool_result"}),n.tool_use_id&&e.jsx("span",{className:w.toolId,children:n.tool_use_id}),n.is_error&&e.jsx("span",{className:w.errorLabel,children:"error"})]}),e.jsx("div",{className:w.toolBlockBody,children:e.jsx(tt,{blocks:n.content,compact:!0})})]}):n.type==="json"?e.jsxs("div",{className:w.jsonBlock,children:[n.label&&e.jsx("div",{className:w.jsonBlockLabel,children:n.label}),e.jsx(et,{data:n.data,defaultExpand:"root"})]}):null}function Ci({turn:n}){const s=n.timestamp?xt(n.timestamp):null,t=n.assistantTimestamp?xt(n.assistantTimestamp):null;return e.jsxs("div",{children:[e.jsxs("div",{className:w.roleHeader,children:[e.jsx("span",{className:`${w.roleBadge} ${w.role_user}`,children:"user"}),e.jsx("span",{className:w.roleLabel,children:`Turn ${n.turnIndex+1}`}),s&&e.jsx("span",{className:w.contentTime,children:s})]}),e.jsx(tt,{blocks:n.userBlocks}),n.assistantBlocks&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:w.turnDivider}),e.jsxs("div",{className:w.roleHeader,children:[e.jsx("span",{className:`${w.roleBadge} ${w.role_assistant}`,children:"assistant"}),t&&e.jsx("span",{className:w.contentTime,children:t})]}),e.jsx(tt,{blocks:n.assistantBlocks})]})]})}function bi({sectionKey:n,title:s,items:t,historyItems:a=[],onSelect:c,onSelectById:l,selectedId:u,sidebarRef:g}){const[i,h]=j.useState(n!=="tools"),[o,r]=j.useState(!1),m=t.length+a.length,y=`${n}__history_toggle`;function x(C){var _;const k=(_=g.current)==null?void 0:_.querySelector(`[data-context-sidebar-control="${C}"]`);k&&(k.focus(),k.scrollIntoView({block:"nearest"}))}function f(C,k){var T;const _=Array.from(((T=g.current)==null?void 0:T.querySelectorAll("[data-context-sidebar-control]"))||[]).map(R=>R.dataset.contextSidebarControl).filter(Boolean),b=ul({currentId:k,visibleIds:_,key:C.key});b&&(C.preventDefault(),typeof window<"u"&&window.requestAnimationFrame(()=>{var P;x(b);const R=(P=g.current)==null?void 0:P.querySelector(`[data-context-sidebar-control="${b}"]`);(R==null?void 0:R.dataset.controlType)==="item"&&l(b)}))}function v(C){const k=u===C.id;return e.jsxs("button",{type:"button",className:`${w.item} ${k?w.itemActive:""}`,onClick:()=>c(C),onKeyDown:_=>f(_,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(Re,{className:w.arrow}):e.jsx(Ie,{className:w.arrow}),e.jsx("span",{className:w.sectionTitle,children:s}),e.jsx("span",{className:w.sectionCount,children:m})]}),i&&e.jsxs("div",{className:w.sectionBody,children:[a.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:w.historyToggle,onClick:()=>r(C=>!C),onKeyDown:C=>f(C,y),"aria-expanded":o,"data-context-sidebar-control":y,"data-control-type":"toggle",children:[o?e.jsx(Re,{className:w.arrow}):e.jsx(Ie,{className:w.arrow}),e.jsxs("span",{className:w.historyToggleLabel,children:[p("ui.context.history")," (",a.length,")"]})]}),o&&a.map(v)]}),t.map(v)]})]})}function Ni({body:n,response:s}){const[t,a]=j.useState(null),c=j.useRef(null),l=j.useMemo(()=>{if(!Array.isArray(n==null?void 0:n.messages))return[];const o=xi(n.messages);if(o.length===0)return o;const r=o[o.length-1],m=s!=null&&s.content?ft(s.content):null;return[...o.slice(0,-1),{...r,assistantBlocks:m??r.assistantBlocks}]},[n,s]);if(j.useEffect(()=>{l.length>0?a(l[l.length-1]):a(null)},[n,s]),!n||typeof n!="object")return e.jsx("div",{className:w.emptyWrap,children:e.jsx(Ee,{description:p("ui.context.noData")})});const u=[];Array.isArray(n.tools)&&n.tools.length>0&&u.push({key:"tools",title:e.jsxs(e.Fragment,{children:[p("ui.context.tools")," ",e.jsx(ie,{doc:"ToolsFirst"})]}),items:n.tools.map((o,r)=>({id:`tool__${r}`,label:(o==null?void 0:o.name)||`Tool ${r}`,blocks:gi(o)}))});const g=pi(n.system);if(g!=null&&u.push({key:"system",title:p("ui.context.systemPrompt"),items:[{id:"system__0",label:p("ui.context.systemPrompt"),blocks:g}]}),l.length>0){const o=x=>({...x,label:p("ui.context.historyTurnNoTime",{n:x.turnIndex+1}),time:x.timestamp?xt(x.timestamp):null,sublabel:x.preview||void 0}),r=x=>({...x,label:p("ui.context.currentTurn"),sublabel:x.preview||void 0}),m=l.slice(0,-1).map(o),y=r(l[l.length-1]);u.push({key:"messages",title:p("ui.context.messages"),historyItems:m.length>0?m:void 0,items:[y]})}if(u.length===0)return e.jsx("div",{className:w.emptyWrap,children:e.jsx(Ee,{description:p("ui.context.noFields")})});const i=t!=null&&t.isTurn?l.find(o=>o.id===t.id)??null:t,h=new Map;return u.forEach(o=>{(o.historyItems||[]).forEach(r=>h.set(r.id,r)),o.items.forEach(r=>h.set(r.id,r))}),e.jsxs("div",{className:w.root,children:[e.jsx("div",{ref:c,className:w.sidebar,children:u.map(o=>e.jsx(bi,{sectionKey:o.key,title:o.title,items:o.items,historyItems:o.historyItems,selectedId:i==null?void 0:i.id,onSelect:r=>a(r),onSelectById:r=>{const m=h.get(r);m&&a(m)},sidebarRef:c},o.key))}),e.jsx("div",{className:w.content,children:i==null?e.jsx("div",{className:w.contentEmpty,children:e.jsx(ui,{type:"secondary",children:p("ui.context.selectPrompt")})}):e.jsx("div",{className:w.contentInner,children:i.isTurn?e.jsx(Ci,{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(tt,{blocks:i.blocks})]})},i.id)})]})}const _i="_container_vourp_1",Si="_emptyState_vourp_10",ki="_urlSection_vourp_17",wi="_urlLeft_vourp_24",Ti="_tokenStatsBox_vourp_29",Mi="_tokenGrid_vourp_36",Ei="_tokenRows_vourp_46",Ri="_tokenRow_vourp_46",Ii="_tokenRowBorder_vourp_54",Li="_tokenLabel_vourp_58",Pi="_tokenTd_vourp_65",Ai="_tokenHitRate_vourp_74",Di="_tokenHitRateLabel_vourp_87",Bi="_urlText_vourp_97",Oi="_metaText_vourp_104",Fi="_headersContainer_vourp_108",$i="_headerRow_vourp_112",Hi="_headerKey_vourp_118",zi="_headerValue_vourp_123",Vi="_streamingBox_vourp_128",Ui="_rawTextPre_vourp_141",qi="_tabContent_vourp_154",Wi="_bodyLabel_vourp_162",Ki="_bodyHeader_vourp_166",Gi="_diffSection_vourp_173",Ji="_diffToggle_vourp_177",Qi="_diffIcon_vourp_183",Yi="_reminderSelect_vourp_209",Xi="_diffHeaderRow_vourp_228",Zi="_diffSpaceRight_vourp_234",eo="_reminderFilterWrapper_vourp_238",to="_reminderLabel_vourp_244",so="_cacheTabContent_vourp_250",ao="_userPromptList_vourp_255",no="_userPromptItem_vourp_261",lo="_userPromptNavBtn_vourp_272",io="_cacheContent_vourp_283",oo="_cacheTokenBar_vourp_290",ro="_cacheTokenWrite_vourp_300",co="_cacheTokenRead_vourp_304",ho="_cacheCopyIcon_vourp_308",uo="_cacheScrollArea_vourp_315",mo="_cacheSectionBlock_vourp_321",po="_cacheSectionHeader_vourp_325",go="_cacheCollapseArrow_vourp_337",fo="_cachePre_vourp_343",xo="_cacheHighlightSvg_vourp_357",vo="_cachePreSystem_vourp_366",S={container:_i,emptyState:Si,urlSection:ki,urlLeft:wi,tokenStatsBox:Ti,tokenGrid:Mi,tokenRows:Ei,tokenRow:Ri,tokenRowBorder:Ii,tokenLabel:Li,tokenTd:Pi,tokenHitRate:Ai,tokenHitRateLabel:Di,urlText:Bi,metaText:Oi,headersContainer:Fi,headerRow:$i,headerKey:Hi,headerValue:zi,streamingBox:Vi,rawTextPre:Ui,tabContent:qi,bodyLabel:Wi,bodyHeader:Ki,diffSection:Gi,diffToggle:Ji,diffIcon:Qi,reminderSelect:Yi,diffHeaderRow:Xi,diffSpaceRight:Zi,reminderFilterWrapper:eo,reminderLabel:to,cacheTabContent:so,userPromptList:ao,userPromptItem:no,userPromptNavBtn:lo,cacheContent:io,cacheTokenBar:oo,cacheTokenWrite:ro,cacheTokenRead:co,cacheCopyIcon:ho,cacheScrollArea:uo,cacheSectionBlock:mo,cacheSectionHeader:po,cacheCollapseArrow:go,cachePre:fo,cacheHighlightSvg:xo,cachePreSystem:vo},{Text:ce,Paragraph:yo}=es;class jo extends q.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 a=t.querySelector(`[data-msg-idx="${s}"]`);if(!a)return;clearTimeout(this._cacheScrollSettleTimer),clearTimeout(this._cacheFadeClearTimer),clearTimeout(this._cacheAutoFadeTimer),clearTimeout(this._cacheHighlightDelayTimer),this._cacheUnbindScrollFade(),this._cacheScrollEndHandler&&t.removeEventListener("scrollend",this._cacheScrollEndHandler),this.setState({cacheHighlightIdx:null,cacheHighlightFading:!1});let c=!1,l=!1;const u=()=>{!c||!l||(this.setState({cacheHighlightIdx:s,cacheHighlightFading:!1}),this._cacheScrollSettleTimer=setTimeout(()=>this._cacheBindScrollFade(),200),this._cacheAutoFadeTimer=setTimeout(()=>{this.state.cacheHighlightIdx===s&&!this.state.cacheHighlightFading&&(this.setState({cacheHighlightFading:!0}),this._cacheFadeClearTimer=setTimeout(()=>{this.setState({cacheHighlightIdx:null,cacheHighlightFading:!1})},3e3),this._cacheUnbindScrollFade())},3e3))};this._cacheScrollEndHandler=()=>{t.removeEventListener("scrollend",this._cacheScrollEndHandler),c=!0,u()},t.addEventListener("scrollend",this._cacheScrollEndHandler,{once:!0}),this._cacheScrollSettleTimer=setTimeout(()=>{t.removeEventListener("scrollend",this._cacheScrollEndHandler),c=!0,u()},800),this._cacheHighlightDelayTimer=setTimeout(()=>{l=!0,u()},500),a.scrollIntoView({behavior:"smooth",block:"center"})}shouldComponentUpdate(s,t){if(s.request!==this.props.request){const c=Ce(s.request);this.setState({diffExpanded:c&&!!s.expandDiff,requestHeadersExpanded:!1,responseHeadersExpanded:!1,reminderFilters:null}),this._cacheClearAllTimers()}const a=s.currentTab==="kv-cache-text";return s.request!==this.props.request||s.currentTab!==this.props.currentTab||s.onTabChange!==this.props.onTabChange||s.selectedIndex!==this.props.selectedIndex||s.expandDiff!==this.props.expandDiff||s.pendingCacheHighlight!==this.props.pendingCacheHighlight||t.bodyViewMode!==this.state.bodyViewMode||a&&t.cacheHighlightIdx!==this.state.cacheHighlightIdx||a&&t.cacheHighlightFading!==this.state.cacheHighlightFading||t.diffExpanded!==this.state.diffExpanded||t.requestHeadersExpanded!==this.state.requestHeadersExpanded||t.responseHeadersExpanded!==this.state.responseHeadersExpanded||t.reminderFilters!==this.state.reminderFilters||a&&t.cacheCollapsed!==this.state.cacheCollapsed}componentDidUpdate(s){const t=this.props.pendingCacheHighlight;t&&t!==s.pendingCacheHighlight&&setTimeout(()=>{var a,c;this.scrollToCacheMsg(t.msgIdx),(c=(a=this.props).onCacheHighlightDone)==null||c.call(a)},150)}toggleBodyViewMode(s){this.setState(t=>({bodyViewMode:{...t.bodyViewMode,[s]:t.bodyViewMode[s]==="json"?"text":"json"}}))}copyBody(s){var u;const{request:t}=this.props;if(!t)return;let a;if(s==="diff"?a=this._lastDiffResult:a=s==="request"?t.body:(u=t.response)==null?void 0:u.body,a==null)return;const c=typeof a=="object"?lt(a):a,l=typeof c=="string"?c:JSON.stringify(c,null,2);navigator.clipboard.writeText(l).then(()=>G.success(p("ui.copySuccess")))}renderHeaders(s){return!s||Object.keys(s).length===0?e.jsx(ce,{type:"secondary",children:p("ui.noHeaders")}):e.jsx("div",{className:S.headersContainer,children:Object.entries(s).map(([t,a])=>e.jsxs("div",{className:S.headerRow,children:[e.jsx(ce,{code:!0,className:S.headerKey,children:t}),t==="authorization"&&e.jsx(ie,{doc:"TranslateContextPollution"}),e.jsx(ce,{type:"secondary",className:S.headerValue,children:String(a)})]},t))})}getRequestExpandNode(s,t){if(t!=="request"||!s||typeof s!="object")return;const{request:a,requests:c,selectedIndex:l}=this.props;if(!a)return;const u=c&&l!=null?c[l+1]:null,{type:g}=Ve(a,u);let i=null;if(this.state.reminderFilters==="claudeMd"&&Array.isArray(s.messages)){i=new Set,i.add(s.messages);for(const r of s.messages){if(!r||typeof r!="object")continue;const m=r.content;if(typeof m=="string")Rt(m)&&i.add(r);else if(Array.isArray(m)){let y=!1;for(const x of m)x&&x.type==="text"&&Rt(x.text)&&(i.add(x),y=!0);y&&(i.add(r),i.add(m))}}}let h=null;if(this.state.reminderFilters==="skills"&&Array.isArray(s.messages)){h=new Set,h.add(s.messages);for(const r of s.messages){if(!r||typeof r!="object")continue;const m=r.content;if(typeof m=="string")It(m)&&h.add(r);else if(Array.isArray(m)){let y=!1;for(const x of m)x&&x.type==="text"&&It(x.text)&&(h.add(x),y=!0);y&&(h.add(r),h.add(m))}}}const o=i||h;if(g==="Preflight"){const r=new Set,m=y=>{y&&typeof y=="object"&&(r.add(y),Array.isArray(y)?y.forEach(m):Object.values(y).forEach(m))};return Array.isArray(s.messages)&&m(s.messages),Array.isArray(s.system)&&s.system.length>=3&&m(s.system[2]),(y,x,f)=>!!(y<2||r.has(x)||o&&o.has(x)||y===1&&f==="system")}if(g==="MainAgent"&&Array.isArray(s.messages)&&s.messages.length===1){const r=s.messages[0],m=r&&Array.isArray(r.content)?r.content:null,y=m&&m.length>0?m[m.length-1]:null,x=new Set,f=v=>{v&&typeof v=="object"&&(x.add(v),Array.isArray(v)?v.forEach(f):Object.values(v).forEach(f))};return y&&f(y),x.add(s.messages),r&&typeof r=="object"&&x.add(r),m&&x.add(m),(v,C,k)=>!!(v<2||x.has(C)||o&&o.has(C))}if(o)return(r,m,y)=>!!(r<2||o.has(m))}renderBody(s,t){const{bodyViewMode:a}=this.state;if(s==null)return e.jsx(ce,{type:"secondary",children:p("ui.noBody")});if(typeof s=="string"&&s.includes("Streaming Response"))return e.jsx("div",{className:S.streamingBox,children:e.jsx(ce,{type:"secondary",children:p("ui.streamingResponse")})});const c=typeof s=="object"?lt(s):s,l=a[t]==="json",u=this.getRequestExpandNode(c,t);return e.jsx("div",{children:l?e.jsx(et,{data:c,defaultExpand:t==="response"?"all":"root",expandNode:u}):e.jsx("pre",{className:S.rawTextPre,children:typeof c=="string"?c:JSON.stringify(c,null,2)})})}getPrevMainAgentRequest(){const{requests:s,selectedIndex:t}=this.props;if(!s||t==null)return null;for(let a=t-1;a>=0;a--)if(Ce(s[a])){const c=s[a];return c._slimmed?Lt(c,this.props.allRequests||s):c}return null}computeDiff(s,t){if(s==null||t==null||typeof s!="object"||typeof t!="object")return null;const a={},c=new Set([...Object.keys(s),...Object.keys(t)]);for(const l of c)if(!l.startsWith("_"))if(!(l in s))a[l]=t[l];else if(l in t){const u=JSON.stringify(s[l]),g=JSON.stringify(t[l]);u!==g&&(l==="messages"&&Array.isArray(s[l])&&Array.isArray(t[l])&&t[l].length>s[l].length?a[l]=t[l].slice(s[l].length):a[l]=t[l])}else continue;return Object.keys(a).length?a:null}render(){var m,y,x;let{request:s,currentTab:t,onTabChange:a}=this.props;if(!s)return e.jsx("div",{className:S.emptyState,children:e.jsx(Ee,{description:"选择一个请求查看详情"})});s._slimmed&&(s=Lt(s,this.props.allRequests||this.props.requests));const c=new Date(s.timestamp).toLocaleString("zh-CN"),l=s.response&&s.response.status<400;let u=null;if(Ce(s)){const f=this.getPrevMainAgentRequest();if(f){const v=JSON.stringify(s.body).length,C=JSON.stringify(f.body).length;if(v<C)u=e.jsxs("div",{className:S.diffSection,children:[e.jsxs(ce,{strong:!0,className:S.diffToggle,onClick:()=>this.setState(_=>({diffExpanded:!_.diffExpanded})),children:["Body Diff JSON ",e.jsx(ie,{doc:"BodyDiffJSON"})," ",this.state.diffExpanded?e.jsx(Re,{className:S.diffIcon}):e.jsx(Ie,{className:S.diffIcon})]}),this.state.diffExpanded&&e.jsx(ce,{type:"secondary",children:p("ui.diffSessionChanged")})]});else{const _=lt(this.computeDiff(f.body,s.body));_&&(this._lastDiffResult=_,u=e.jsxs("div",{className:S.diffSection,children:[e.jsxs("div",{className:S.diffHeaderRow,children:[e.jsxs(ce,{strong:!0,className:S.diffToggle,onClick:()=>this.setState(b=>({diffExpanded:!b.diffExpanded})),children:["Body Diff JSON ",e.jsx(ie,{doc:"BodyDiffJSON"})," ",this.state.diffExpanded?e.jsx(Re,{className:S.diffIcon}):e.jsx(Ie,{className:S.diffIcon})]}),this.state.diffExpanded&&e.jsxs($e,{size:"small",className:S.diffSpaceRight,children:[e.jsx(H,{size:"small",icon:this.state.bodyViewMode.diff==="json"?e.jsx(Je,{}):e.jsx(Qe,{}),onClick:()=>this.toggleBodyViewMode("diff"),children:this.state.bodyViewMode.diff==="json"?"Text":"JSON"}),e.jsx(H,{size:"small",icon:e.jsx(Fe,{}),onClick:()=>this.copyBody("diff"),children:p("ui.copy")})]})]}),this.state.diffExpanded&&e.jsx(e.Fragment,{children:this.state.bodyViewMode.diff==="json"?e.jsx(et,{data:_,defaultExpand:"all"}):e.jsx("pre",{className:S.rawTextPre,children:JSON.stringify(_,null,2)})})]}))}}}const g=ga(s.body),i=fa(s.body),h=[{key:"request",label:"Request",children:e.jsxs("div",{className:S.tabContent,children:[e.jsxs("div",{className:S.diffSection,children:[e.jsxs(ce,{strong:!0,className:S.diffToggle,onClick:()=>this.setState(f=>({requestHeadersExpanded:!f.requestHeadersExpanded})),children:["Headers ",this.state.requestHeadersExpanded?e.jsx(Re,{className:S.diffIcon}):e.jsx(Ie,{className:S.diffIcon})]}),this.state.requestHeadersExpanded&&this.renderHeaders(s.headers)]}),u,e.jsxs("div",{children:[e.jsxs("div",{className:S.bodyHeader,children:[e.jsxs(ce,{strong:!0,className:S.bodyLabel,children:["Body",e.jsx(ie,{doc:"BodyFields"})]}),e.jsxs($e,{size:"small",children:[(g||i)&&e.jsxs("span",{className:S.reminderFilterWrapper,children:[e.jsx("span",{className:S.reminderLabel,children:"system-reminder:"}),e.jsx(Ke,{size:"small",className:S.reminderSelect,placeholder:"filter",value:this.state.reminderFilters||void 0,onChange:f=>this.setState({reminderFilters:f||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(Je,{}):e.jsx(Qe,{}),onClick:()=>this.toggleBodyViewMode("request"),children:this.state.bodyViewMode.request==="json"?"Text":"JSON"}),e.jsx(H,{size:"small",icon:e.jsx(Fe,{}),onClick:()=>this.copyBody("request"),children:p("ui.copy")})]})]}),this.renderBody(s.body,"request")]})]})},{key:"response",label:"Response",children:e.jsx("div",{className:S.tabContent,children:s.response?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:S.diffSection,children:[e.jsxs(ce,{strong:!0,className:S.diffToggle,onClick:()=>this.setState(f=>({responseHeadersExpanded:!f.responseHeadersExpanded})),children:["Headers ",this.state.responseHeadersExpanded?e.jsx(Re,{className:S.diffIcon}):e.jsx(Ie,{className:S.diffIcon})]}),this.state.responseHeadersExpanded&&this.renderHeaders(s.response.headers)]}),e.jsxs("div",{children:[e.jsxs("div",{className:S.bodyHeader,children:[e.jsxs(ce,{strong:!0,className:S.bodyLabel,children:["Body",e.jsx(ie,{doc:"ResponseFields"})]}),e.jsxs($e,{size:"small",children:[e.jsx(H,{size:"small",icon:this.state.bodyViewMode.response==="json"?e.jsx(Je,{}):e.jsx(Qe,{}),onClick:()=>this.toggleBodyViewMode("response"),children:this.state.bodyViewMode.response==="json"?"Text":"JSON"}),e.jsx(H,{size:"small",icon:e.jsx(Fe,{}),onClick:()=>this.copyBody("response"),children:p("ui.copy")})]})]}),this.renderBody(s.response.body,"response")]})]}):e.jsx(Ee,{description:p("ui.responseNotCaptured")})})},{key:"kv-cache-text",label:e.jsxs("span",{children:["KV-Cache-Text ",e.jsx(ie,{doc:"KVCacheContent"})]}),children:e.jsx("div",{className:`${S.tabContent} ${S.cacheTabContent}`,children:(()=>{const f=Jt([s]),v=s.timestamp+"|"+s.url;if(f&&(f.cacheCreateTokens>0||f.cacheReadTokens>0)&&(this._lastCachedTokensKey=v,this._lastCachedTokens={cacheCreateTokens:f.cacheCreateTokens,cacheReadTokens:f.cacheReadTokens}),!f||f.system.length===0&&f.messages.length===0&&f.tools.length===0)return e.jsx(Ee,{description:p("ui.noCachedContent"),image:Ee.PRESENTED_IMAGE_SIMPLE});const C=()=>{const b=[];return f.tools.length>0&&(b.push(`=== ${p("ui.tools")} ===`),f.tools.forEach(T=>b.push(T))),f.system.length>0&&(b.push(`
|
|
31
|
+
`),s.push({type:"markdown",text:c});const l=(n==null?void 0:n.input_schema)||(n==null?void 0:n.parameters)||null;return l&&s.push({type:"json",label:"Parameters",data:l}),s}function fi(n){var s;if(typeof n=="string")return n.slice(0,60).replace(/\n/g," ");if(Array.isArray(n)){for(const t of n)if((t==null?void 0:t.type)==="text"&&((s=t.text)!=null&&s.trim()))return t.text.trim().slice(0,60).replace(/\n/g," ")}return""}function xi(n){var a;const s=[];let t=0;for(;t<n.length;){const c=n[t];if((c==null?void 0:c.role)!=="user"){t++;continue}const l=((a=n[t+1])==null?void 0:a.role)==="assistant"?n[t+1]:null;s.push({id:`turn__${t}`,isTurn:!0,turnIndex:s.length,timestamp:c._timestamp||null,assistantTimestamp:(l==null?void 0:l._timestamp)||null,userBlocks:ft(c==null?void 0:c.content),assistantBlocks:l?ft(l.content):null,preview:fi(c==null?void 0:c.content)}),t+=l?2:1}return s}function xt(n){try{return new Date(n).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}catch{return null}}function yi({text:n,compact:s}){const t=ts(n);return s?e.jsx("div",{className:w.textBlockCompact,children:e.jsx("div",{className:`chat-md ${w.markdownBody}`,dangerouslySetInnerHTML:{__html:t}})}):e.jsxs("div",{className:w.textBlock,children:[e.jsx("div",{className:w.textBlockBar,children:e.jsx("span",{className:`${w.blockTag} ${w.blockTagText}`,children:"text"})}),e.jsx("div",{className:`chat-md ${w.textBlockBody}`,dangerouslySetInnerHTML:{__html:t}})]})}function vi({block:n}){const[s,t]=j.useState(!0),a=n.text.length>60?n.text.slice(0,60).replace(/\n/g," ")+"…":n.text.replace(/\n/g," ");return e.jsxs("div",{className:w.thinkingBlock,children:[e.jsxs("div",{className:w.thinkingHeader,onClick:()=>t(c=>!c),children:[s?e.jsx(Re,{className:w.arrow}):e.jsx(Ie,{className:w.arrow}),e.jsx("span",{className:`${w.blockTag} ${w.blockTagThinking}`,children:"thinking"}),!s&&e.jsx("span",{className:w.thinkingPreview,children:a})]}),s&&e.jsx("div",{className:w.thinkingBody,children:e.jsx("div",{className:`chat-md ${w.markdownBody}`,dangerouslySetInnerHTML:{__html:ts(n.text)}})})]})}function tt({blocks:n,compact:s}){return!n||n.length===0?null:e.jsx(e.Fragment,{children:n.map((t,a)=>e.jsx(ji,{block:t,compact:s},a))})}function ji({block:n,compact:s}){var t;return n.type==="separator"?e.jsx("hr",{className:w.blockSeparator}):n.type==="markdown"?(t=n.text)!=null&&t.trim()?e.jsx(yi,{text:n.text,compact:s}):null:n.type==="thinking"?e.jsx(vi,{block:n}):n.type==="tool_use"?e.jsxs("div",{className:w.toolBlock,children:[e.jsxs("div",{className:w.toolBlockHeader,children:[e.jsx("span",{className:w.blockTag,children:"tool_use"}),e.jsx("span",{className:w.toolName,children:n.name}),n.id&&e.jsx("span",{className:w.toolId,children:n.id})]}),e.jsx("div",{className:w.toolBlockBody,children:e.jsx(et,{data:n.input,defaultExpand:"root"})})]}):n.type==="tool_result"?e.jsxs("div",{className:`${w.toolBlock} ${n.is_error?w.toolBlockError:w.toolBlockResult}`,children:[e.jsxs("div",{className:w.toolBlockHeader,children:[e.jsx("span",{className:`${w.blockTag} ${n.is_error?w.blockTagError:w.blockTagResult}`,children:"tool_result"}),n.tool_use_id&&e.jsx("span",{className:w.toolId,children:n.tool_use_id}),n.is_error&&e.jsx("span",{className:w.errorLabel,children:"error"})]}),e.jsx("div",{className:w.toolBlockBody,children:e.jsx(tt,{blocks:n.content,compact:!0})})]}):n.type==="json"?e.jsxs("div",{className:w.jsonBlock,children:[n.label&&e.jsx("div",{className:w.jsonBlockLabel,children:n.label}),e.jsx(et,{data:n.data,defaultExpand:"root"})]}):null}function Ci({turn:n}){const s=n.timestamp?xt(n.timestamp):null,t=n.assistantTimestamp?xt(n.assistantTimestamp):null;return e.jsxs("div",{children:[e.jsxs("div",{className:w.roleHeader,children:[e.jsx("span",{className:`${w.roleBadge} ${w.role_user}`,children:"user"}),e.jsx("span",{className:w.roleLabel,children:`Turn ${n.turnIndex+1}`}),s&&e.jsx("span",{className:w.contentTime,children:s})]}),e.jsx(tt,{blocks:n.userBlocks}),n.assistantBlocks&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:w.turnDivider}),e.jsxs("div",{className:w.roleHeader,children:[e.jsx("span",{className:`${w.roleBadge} ${w.role_assistant}`,children:"assistant"}),t&&e.jsx("span",{className:w.contentTime,children:t})]}),e.jsx(tt,{blocks:n.assistantBlocks})]})]})}function bi({sectionKey:n,title:s,items:t,historyItems:a=[],onSelect:c,onSelectById:l,selectedId:u,sidebarRef:g}){const[i,h]=j.useState(n!=="tools"),[o,r]=j.useState(!1),m=t.length+a.length,v=`${n}__history_toggle`;function x(C){var _;const k=(_=g.current)==null?void 0:_.querySelector(`[data-context-sidebar-control="${C}"]`);k&&(k.focus(),k.scrollIntoView({block:"nearest"}))}function f(C,k){var T;const _=Array.from(((T=g.current)==null?void 0:T.querySelectorAll("[data-context-sidebar-control]"))||[]).map(R=>R.dataset.contextSidebarControl).filter(Boolean),b=ul({currentId:k,visibleIds:_,key:C.key});b&&(C.preventDefault(),typeof window<"u"&&window.requestAnimationFrame(()=>{var P;x(b);const R=(P=g.current)==null?void 0:P.querySelector(`[data-context-sidebar-control="${b}"]`);(R==null?void 0:R.dataset.controlType)==="item"&&l(b)}))}function y(C){const k=u===C.id;return e.jsxs("button",{type:"button",className:`${w.item} ${k?w.itemActive:""}`,onClick:()=>c(C),onKeyDown:_=>f(_,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(Re,{className:w.arrow}):e.jsx(Ie,{className:w.arrow}),e.jsx("span",{className:w.sectionTitle,children:s}),e.jsx("span",{className:w.sectionCount,children:m})]}),i&&e.jsxs("div",{className:w.sectionBody,children:[a.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:w.historyToggle,onClick:()=>r(C=>!C),onKeyDown:C=>f(C,v),"aria-expanded":o,"data-context-sidebar-control":v,"data-control-type":"toggle",children:[o?e.jsx(Re,{className:w.arrow}):e.jsx(Ie,{className:w.arrow}),e.jsxs("span",{className:w.historyToggleLabel,children:[p("ui.context.history")," (",a.length,")"]})]}),o&&a.map(y)]}),t.map(y)]})]})}function Ni({body:n,response:s}){const[t,a]=j.useState(null),c=j.useRef(null),l=j.useMemo(()=>{if(!Array.isArray(n==null?void 0:n.messages))return[];const o=xi(n.messages);if(o.length===0)return o;const r=o[o.length-1],m=s!=null&&s.content?ft(s.content):null;return[...o.slice(0,-1),{...r,assistantBlocks:m??r.assistantBlocks}]},[n,s]);if(j.useEffect(()=>{l.length>0?a(l[l.length-1]):a(null)},[n,s]),!n||typeof n!="object")return e.jsx("div",{className:w.emptyWrap,children:e.jsx(Ee,{description:p("ui.context.noData")})});const u=[];Array.isArray(n.tools)&&n.tools.length>0&&u.push({key:"tools",title:e.jsxs(e.Fragment,{children:[p("ui.context.tools")," ",e.jsx(ie,{doc:"ToolsFirst"})]}),items:n.tools.map((o,r)=>({id:`tool__${r}`,label:(o==null?void 0:o.name)||`Tool ${r}`,blocks:gi(o)}))});const g=pi(n.system);if(g!=null&&u.push({key:"system",title:p("ui.context.systemPrompt"),items:[{id:"system__0",label:p("ui.context.systemPrompt"),blocks:g}]}),l.length>0){const o=x=>({...x,label:p("ui.context.historyTurnNoTime",{n:x.turnIndex+1}),time:x.timestamp?xt(x.timestamp):null,sublabel:x.preview||void 0}),r=x=>({...x,label:p("ui.context.currentTurn"),sublabel:x.preview||void 0}),m=l.slice(0,-1).map(o),v=r(l[l.length-1]);u.push({key:"messages",title:p("ui.context.messages"),historyItems:m.length>0?m:void 0,items:[v]})}if(u.length===0)return e.jsx("div",{className:w.emptyWrap,children:e.jsx(Ee,{description:p("ui.context.noFields")})});const i=t!=null&&t.isTurn?l.find(o=>o.id===t.id)??null:t,h=new Map;return u.forEach(o=>{(o.historyItems||[]).forEach(r=>h.set(r.id,r)),o.items.forEach(r=>h.set(r.id,r))}),e.jsxs("div",{className:w.root,children:[e.jsx("div",{ref:c,className:w.sidebar,children:u.map(o=>e.jsx(bi,{sectionKey:o.key,title:o.title,items:o.items,historyItems:o.historyItems,selectedId:i==null?void 0:i.id,onSelect:r=>a(r),onSelectById:r=>{const m=h.get(r);m&&a(m)},sidebarRef:c},o.key))}),e.jsx("div",{className:w.content,children:i==null?e.jsx("div",{className:w.contentEmpty,children:e.jsx(ui,{type:"secondary",children:p("ui.context.selectPrompt")})}):e.jsx("div",{className:w.contentInner,children:i.isTurn?e.jsx(Ci,{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(tt,{blocks:i.blocks})]})},i.id)})]})}const _i="_container_1yyka_1",Si="_emptyState_1yyka_9",ki="_urlSection_1yyka_16",wi="_urlLeft_1yyka_23",Ti="_tokenStatsBox_1yyka_28",Mi="_tokenGrid_1yyka_35",Ei="_tokenRows_1yyka_45",Ri="_tokenRow_1yyka_45",Ii="_tokenRowBorder_1yyka_53",Li="_tokenLabel_1yyka_57",Pi="_tokenTd_1yyka_64",Ai="_tokenHitRate_1yyka_73",Di="_tokenHitRateLabel_1yyka_86",Bi="_urlText_1yyka_96",Oi="_metaText_1yyka_103",Fi="_headersContainer_1yyka_107",$i="_headerRow_1yyka_111",Hi="_headerKey_1yyka_117",zi="_headerValue_1yyka_122",Vi="_streamingBox_1yyka_127",Ui="_rawTextPre_1yyka_140",qi="_tabContent_1yyka_153",Wi="_bodyLabel_1yyka_161",Ki="_bodyHeader_1yyka_165",Gi="_diffSection_1yyka_172",Ji="_diffToggle_1yyka_176",Qi="_diffIcon_1yyka_182",Yi="_reminderSelect_1yyka_208",Xi="_diffHeaderRow_1yyka_227",Zi="_diffSpaceRight_1yyka_233",eo="_reminderFilterWrapper_1yyka_237",to="_reminderLabel_1yyka_243",so="_cacheTabContent_1yyka_249",ao="_userPromptList_1yyka_254",no="_userPromptItem_1yyka_260",lo="_userPromptNavBtn_1yyka_271",io="_cacheContent_1yyka_282",oo="_cacheTokenBar_1yyka_289",ro="_cacheTokenWrite_1yyka_299",co="_cacheTokenRead_1yyka_303",ho="_cacheCopyIcon_1yyka_307",uo="_cacheScrollArea_1yyka_314",mo="_cacheSectionBlock_1yyka_320",po="_cacheSectionHeader_1yyka_324",go="_cacheCollapseArrow_1yyka_336",fo="_cachePre_1yyka_342",xo="_cacheHighlightSvg_1yyka_356",yo="_cachePreSystem_1yyka_365",S={container:_i,emptyState:Si,urlSection:ki,urlLeft:wi,tokenStatsBox:Ti,tokenGrid:Mi,tokenRows:Ei,tokenRow:Ri,tokenRowBorder:Ii,tokenLabel:Li,tokenTd:Pi,tokenHitRate:Ai,tokenHitRateLabel:Di,urlText:Bi,metaText:Oi,headersContainer:Fi,headerRow:$i,headerKey:Hi,headerValue:zi,streamingBox:Vi,rawTextPre:Ui,tabContent:qi,bodyLabel:Wi,bodyHeader:Ki,diffSection:Gi,diffToggle:Ji,diffIcon:Qi,reminderSelect:Yi,diffHeaderRow:Xi,diffSpaceRight:Zi,reminderFilterWrapper:eo,reminderLabel:to,cacheTabContent:so,userPromptList:ao,userPromptItem:no,userPromptNavBtn:lo,cacheContent:io,cacheTokenBar:oo,cacheTokenWrite:ro,cacheTokenRead:co,cacheCopyIcon:ho,cacheScrollArea:uo,cacheSectionBlock:mo,cacheSectionHeader:po,cacheCollapseArrow:go,cachePre:fo,cacheHighlightSvg:xo,cachePreSystem:yo},{Text:ce,Paragraph:vo}=es;class jo extends q.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 a=t.querySelector(`[data-msg-idx="${s}"]`);if(!a)return;clearTimeout(this._cacheScrollSettleTimer),clearTimeout(this._cacheFadeClearTimer),clearTimeout(this._cacheAutoFadeTimer),clearTimeout(this._cacheHighlightDelayTimer),this._cacheUnbindScrollFade(),this._cacheScrollEndHandler&&t.removeEventListener("scrollend",this._cacheScrollEndHandler),this.setState({cacheHighlightIdx:null,cacheHighlightFading:!1});let c=!1,l=!1;const u=()=>{!c||!l||(this.setState({cacheHighlightIdx:s,cacheHighlightFading:!1}),this._cacheScrollSettleTimer=setTimeout(()=>this._cacheBindScrollFade(),200),this._cacheAutoFadeTimer=setTimeout(()=>{this.state.cacheHighlightIdx===s&&!this.state.cacheHighlightFading&&(this.setState({cacheHighlightFading:!0}),this._cacheFadeClearTimer=setTimeout(()=>{this.setState({cacheHighlightIdx:null,cacheHighlightFading:!1})},3e3),this._cacheUnbindScrollFade())},3e3))};this._cacheScrollEndHandler=()=>{t.removeEventListener("scrollend",this._cacheScrollEndHandler),c=!0,u()},t.addEventListener("scrollend",this._cacheScrollEndHandler,{once:!0}),this._cacheScrollSettleTimer=setTimeout(()=>{t.removeEventListener("scrollend",this._cacheScrollEndHandler),c=!0,u()},800),this._cacheHighlightDelayTimer=setTimeout(()=>{l=!0,u()},500),a.scrollIntoView({behavior:"smooth",block:"center"})}shouldComponentUpdate(s,t){if(s.request!==this.props.request){const c=Ce(s.request);this.setState({diffExpanded:c&&!!s.expandDiff,requestHeadersExpanded:!1,responseHeadersExpanded:!1,reminderFilters:null}),this._cacheClearAllTimers()}const a=s.currentTab==="kv-cache-text";return s.request!==this.props.request||s.currentTab!==this.props.currentTab||s.onTabChange!==this.props.onTabChange||s.selectedIndex!==this.props.selectedIndex||s.expandDiff!==this.props.expandDiff||s.pendingCacheHighlight!==this.props.pendingCacheHighlight||t.bodyViewMode!==this.state.bodyViewMode||a&&t.cacheHighlightIdx!==this.state.cacheHighlightIdx||a&&t.cacheHighlightFading!==this.state.cacheHighlightFading||t.diffExpanded!==this.state.diffExpanded||t.requestHeadersExpanded!==this.state.requestHeadersExpanded||t.responseHeadersExpanded!==this.state.responseHeadersExpanded||t.reminderFilters!==this.state.reminderFilters||a&&t.cacheCollapsed!==this.state.cacheCollapsed}componentDidUpdate(s){const t=this.props.pendingCacheHighlight;t&&t!==s.pendingCacheHighlight&&setTimeout(()=>{var a,c;this.scrollToCacheMsg(t.msgIdx),(c=(a=this.props).onCacheHighlightDone)==null||c.call(a)},150)}toggleBodyViewMode(s){this.setState(t=>({bodyViewMode:{...t.bodyViewMode,[s]:t.bodyViewMode[s]==="json"?"text":"json"}}))}copyBody(s){var u;const{request:t}=this.props;if(!t)return;let a;if(s==="diff"?a=this._lastDiffResult:a=s==="request"?t.body:(u=t.response)==null?void 0:u.body,a==null)return;const c=typeof a=="object"?lt(a):a,l=typeof c=="string"?c:JSON.stringify(c,null,2);navigator.clipboard.writeText(l).then(()=>G.success(p("ui.copySuccess")))}renderHeaders(s){return!s||Object.keys(s).length===0?e.jsx(ce,{type:"secondary",children:p("ui.noHeaders")}):e.jsx("div",{className:S.headersContainer,children:Object.entries(s).map(([t,a])=>e.jsxs("div",{className:S.headerRow,children:[e.jsx(ce,{code:!0,className:S.headerKey,children:t}),t==="authorization"&&e.jsx(ie,{doc:"TranslateContextPollution"}),e.jsx(ce,{type:"secondary",className:S.headerValue,children:String(a)})]},t))})}getRequestExpandNode(s,t){if(t!=="request"||!s||typeof s!="object")return;const{request:a,requests:c,selectedIndex:l}=this.props;if(!a)return;const u=c&&l!=null?c[l+1]:null,{type:g}=Ve(a,u);let i=null;if(this.state.reminderFilters==="claudeMd"&&Array.isArray(s.messages)){i=new Set,i.add(s.messages);for(const r of s.messages){if(!r||typeof r!="object")continue;const m=r.content;if(typeof m=="string")Rt(m)&&i.add(r);else if(Array.isArray(m)){let v=!1;for(const x of m)x&&x.type==="text"&&Rt(x.text)&&(i.add(x),v=!0);v&&(i.add(r),i.add(m))}}}let h=null;if(this.state.reminderFilters==="skills"&&Array.isArray(s.messages)){h=new Set,h.add(s.messages);for(const r of s.messages){if(!r||typeof r!="object")continue;const m=r.content;if(typeof m=="string")It(m)&&h.add(r);else if(Array.isArray(m)){let v=!1;for(const x of m)x&&x.type==="text"&&It(x.text)&&(h.add(x),v=!0);v&&(h.add(r),h.add(m))}}}const o=i||h;if(g==="Preflight"){const r=new Set,m=v=>{v&&typeof v=="object"&&(r.add(v),Array.isArray(v)?v.forEach(m):Object.values(v).forEach(m))};return Array.isArray(s.messages)&&m(s.messages),Array.isArray(s.system)&&s.system.length>=3&&m(s.system[2]),(v,x,f)=>!!(v<2||r.has(x)||o&&o.has(x)||v===1&&f==="system")}if(g==="MainAgent"&&Array.isArray(s.messages)&&s.messages.length===1){const r=s.messages[0],m=r&&Array.isArray(r.content)?r.content:null,v=m&&m.length>0?m[m.length-1]:null,x=new Set,f=y=>{y&&typeof y=="object"&&(x.add(y),Array.isArray(y)?y.forEach(f):Object.values(y).forEach(f))};return v&&f(v),x.add(s.messages),r&&typeof r=="object"&&x.add(r),m&&x.add(m),(y,C,k)=>!!(y<2||x.has(C)||o&&o.has(C))}if(o)return(r,m,v)=>!!(r<2||o.has(m))}renderBody(s,t){const{bodyViewMode:a}=this.state;if(s==null)return e.jsx(ce,{type:"secondary",children:p("ui.noBody")});if(typeof s=="string"&&s.includes("Streaming Response"))return e.jsx("div",{className:S.streamingBox,children:e.jsx(ce,{type:"secondary",children:p("ui.streamingResponse")})});const c=typeof s=="object"?lt(s):s,l=a[t]==="json",u=this.getRequestExpandNode(c,t);return e.jsx("div",{children:l?e.jsx(et,{data:c,defaultExpand:t==="response"?"all":"root",expandNode:u}):e.jsx("pre",{className:S.rawTextPre,children:typeof c=="string"?c:JSON.stringify(c,null,2)})})}getPrevMainAgentRequest(){const{requests:s,selectedIndex:t}=this.props;if(!s||t==null)return null;for(let a=t-1;a>=0;a--)if(Ce(s[a])){const c=s[a];return c._slimmed?Lt(c,this.props.allRequests||s):c}return null}computeDiff(s,t){if(s==null||t==null||typeof s!="object"||typeof t!="object")return null;const a={},c=new Set([...Object.keys(s),...Object.keys(t)]);for(const l of c)if(!l.startsWith("_"))if(!(l in s))a[l]=t[l];else if(l in t){const u=JSON.stringify(s[l]),g=JSON.stringify(t[l]);u!==g&&(l==="messages"&&Array.isArray(s[l])&&Array.isArray(t[l])&&t[l].length>s[l].length?a[l]=t[l].slice(s[l].length):a[l]=t[l])}else continue;return Object.keys(a).length?a:null}render(){var m,v,x;let{request:s,currentTab:t,onTabChange:a}=this.props;if(!s)return e.jsx("div",{className:S.emptyState,children:e.jsx(Ee,{description:"选择一个请求查看详情"})});s._slimmed&&(s=Lt(s,this.props.allRequests||this.props.requests));const c=new Date(s.timestamp).toLocaleString("zh-CN"),l=s.response&&s.response.status<400;let u=null;if(Ce(s)){const f=this.getPrevMainAgentRequest();if(f){const y=JSON.stringify(s.body).length,C=JSON.stringify(f.body).length;if(y<C)u=e.jsxs("div",{className:S.diffSection,children:[e.jsxs(ce,{strong:!0,className:S.diffToggle,onClick:()=>this.setState(_=>({diffExpanded:!_.diffExpanded})),children:["Body Diff JSON ",e.jsx(ie,{doc:"BodyDiffJSON"})," ",this.state.diffExpanded?e.jsx(Re,{className:S.diffIcon}):e.jsx(Ie,{className:S.diffIcon})]}),this.state.diffExpanded&&e.jsx(ce,{type:"secondary",children:p("ui.diffSessionChanged")})]});else{const _=lt(this.computeDiff(f.body,s.body));_&&(this._lastDiffResult=_,u=e.jsxs("div",{className:S.diffSection,children:[e.jsxs("div",{className:S.diffHeaderRow,children:[e.jsxs(ce,{strong:!0,className:S.diffToggle,onClick:()=>this.setState(b=>({diffExpanded:!b.diffExpanded})),children:["Body Diff JSON ",e.jsx(ie,{doc:"BodyDiffJSON"})," ",this.state.diffExpanded?e.jsx(Re,{className:S.diffIcon}):e.jsx(Ie,{className:S.diffIcon})]}),this.state.diffExpanded&&e.jsxs($e,{size:"small",className:S.diffSpaceRight,children:[e.jsx(H,{size:"small",icon:this.state.bodyViewMode.diff==="json"?e.jsx(Je,{}):e.jsx(Qe,{}),onClick:()=>this.toggleBodyViewMode("diff"),children:this.state.bodyViewMode.diff==="json"?"Text":"JSON"}),e.jsx(H,{size:"small",icon:e.jsx(Fe,{}),onClick:()=>this.copyBody("diff"),children:p("ui.copy")})]})]}),this.state.diffExpanded&&e.jsx(e.Fragment,{children:this.state.bodyViewMode.diff==="json"?e.jsx(et,{data:_,defaultExpand:"all"}):e.jsx("pre",{className:S.rawTextPre,children:JSON.stringify(_,null,2)})})]}))}}}const g=ga(s.body),i=fa(s.body),h=[{key:"request",label:"Request",children:e.jsxs("div",{className:S.tabContent,children:[e.jsxs("div",{className:S.diffSection,children:[e.jsxs(ce,{strong:!0,className:S.diffToggle,onClick:()=>this.setState(f=>({requestHeadersExpanded:!f.requestHeadersExpanded})),children:["Headers ",this.state.requestHeadersExpanded?e.jsx(Re,{className:S.diffIcon}):e.jsx(Ie,{className:S.diffIcon})]}),this.state.requestHeadersExpanded&&this.renderHeaders(s.headers)]}),u,e.jsxs("div",{children:[e.jsxs("div",{className:S.bodyHeader,children:[e.jsxs(ce,{strong:!0,className:S.bodyLabel,children:["Body",e.jsx(ie,{doc:"BodyFields"})]}),e.jsxs($e,{size:"small",children:[(g||i)&&e.jsxs("span",{className:S.reminderFilterWrapper,children:[e.jsx("span",{className:S.reminderLabel,children:"system-reminder:"}),e.jsx(Ke,{size:"small",className:S.reminderSelect,placeholder:"filter",value:this.state.reminderFilters||void 0,onChange:f=>this.setState({reminderFilters:f||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(Je,{}):e.jsx(Qe,{}),onClick:()=>this.toggleBodyViewMode("request"),children:this.state.bodyViewMode.request==="json"?"Text":"JSON"}),e.jsx(H,{size:"small",icon:e.jsx(Fe,{}),onClick:()=>this.copyBody("request"),children:p("ui.copy")})]})]}),this.renderBody(s.body,"request")]})]})},{key:"response",label:"Response",children:e.jsx("div",{className:S.tabContent,children:s.response?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:S.diffSection,children:[e.jsxs(ce,{strong:!0,className:S.diffToggle,onClick:()=>this.setState(f=>({responseHeadersExpanded:!f.responseHeadersExpanded})),children:["Headers ",this.state.responseHeadersExpanded?e.jsx(Re,{className:S.diffIcon}):e.jsx(Ie,{className:S.diffIcon})]}),this.state.responseHeadersExpanded&&this.renderHeaders(s.response.headers)]}),e.jsxs("div",{children:[e.jsxs("div",{className:S.bodyHeader,children:[e.jsxs(ce,{strong:!0,className:S.bodyLabel,children:["Body",e.jsx(ie,{doc:"ResponseFields"})]}),e.jsxs($e,{size:"small",children:[e.jsx(H,{size:"small",icon:this.state.bodyViewMode.response==="json"?e.jsx(Je,{}):e.jsx(Qe,{}),onClick:()=>this.toggleBodyViewMode("response"),children:this.state.bodyViewMode.response==="json"?"Text":"JSON"}),e.jsx(H,{size:"small",icon:e.jsx(Fe,{}),onClick:()=>this.copyBody("response"),children:p("ui.copy")})]})]}),this.renderBody(s.response.body,"response")]})]}):e.jsx(Ee,{description:p("ui.responseNotCaptured")})})},{key:"kv-cache-text",label:e.jsxs("span",{children:["KV-Cache-Text ",e.jsx(ie,{doc:"KVCacheContent"})]}),children:e.jsx("div",{className:`${S.tabContent} ${S.cacheTabContent}`,children:(()=>{const f=Jt([s]),y=s.timestamp+"|"+s.url;if(f&&(f.cacheCreateTokens>0||f.cacheReadTokens>0)&&(this._lastCachedTokensKey=y,this._lastCachedTokens={cacheCreateTokens:f.cacheCreateTokens,cacheReadTokens:f.cacheReadTokens}),!f||f.system.length===0&&f.messages.length===0&&f.tools.length===0)return e.jsx(Ee,{description:p("ui.noCachedContent"),image:Ee.PRESENTED_IMAGE_SIMPLE});const C=()=>{const b=[];return f.tools.length>0&&(b.push(`=== ${p("ui.tools")} ===`),f.tools.forEach(T=>b.push(T))),f.system.length>0&&(b.push(`
|
|
32
32
|
=== ${p("ui.systemPrompt")} ===`),f.system.forEach(T=>b.push(T))),f.messages.length>0&&(b.push(`
|
|
33
33
|
=== ${p("ui.messages")} ===`),f.messages.forEach(T=>b.push(T))),b.join(`
|
|
34
34
|
|
|
35
|
-
`)},k=f.messages.map((b,T)=>({text:b,msgIdx:T})).filter(({text:b})=>b.startsWith("[user]")).map(({text:b,msgIdx:T})=>{const R=b.replace(/^\[user\]\s*/,"").trim();return!R||ze(R)?{cleaned:"",msgIdx:T}:{cleaned:Xe.parseSegments(R).filter(M=>M.type==="text").map(M=>M.content.trim()).filter(M=>M&&!ze(M)).join(" ").trim(),msgIdx:T}}).filter(({cleaned:b})=>!(!b||/Implement the following plan:/i.test(b))),_=k.length>0?e.jsx("div",{className:S.userPromptList,children:k.map(({cleaned:b,msgIdx:T})=>e.jsx("div",{className:S.userPromptItem,onMouseEnter:R=>{R.currentTarget.style.background="rgba(22,104,220,0.2)",R.currentTarget.style.color="#fff"},onMouseLeave:R=>{R.currentTarget.style.background="",R.currentTarget.style.color="#ccc"},onClick:()=>this.scrollToCacheMsg(T),children:b},T))}):null;return e.jsxs("div",{className:S.cacheContent,children:[(()=>{const T=f.cacheCreateTokens>0||f.cacheReadTokens>0?f:this._lastCachedTokensKey===
|
|
35
|
+
`)},k=f.messages.map((b,T)=>({text:b,msgIdx:T})).filter(({text:b})=>b.startsWith("[user]")).map(({text:b,msgIdx:T})=>{const R=b.replace(/^\[user\]\s*/,"").trim();return!R||ze(R)?{cleaned:"",msgIdx:T}:{cleaned:Xe.parseSegments(R).filter(M=>M.type==="text").map(M=>M.content.trim()).filter(M=>M&&!ze(M)).join(" ").trim(),msgIdx:T}}).filter(({cleaned:b})=>!(!b||/Implement the following plan:/i.test(b))),_=k.length>0?e.jsx("div",{className:S.userPromptList,children:k.map(({cleaned:b,msgIdx:T})=>e.jsx("div",{className:S.userPromptItem,onMouseEnter:R=>{R.currentTarget.style.background="rgba(22,104,220,0.2)",R.currentTarget.style.color="#fff"},onMouseLeave:R=>{R.currentTarget.style.background="",R.currentTarget.style.color="#ccc"},onClick:()=>this.scrollToCacheMsg(T),children:b},T))}):null;return e.jsxs("div",{className:S.cacheContent,children:[(()=>{const T=f.cacheCreateTokens>0||f.cacheReadTokens>0?f:this._lastCachedTokensKey===y?this._lastCachedTokens:null;return T||_?e.jsxs("div",{className:S.cacheTokenBar,children:[T&&e.jsxs(e.Fragment,{children:[p("ui.tokens"),": ",e.jsxs("span",{className:S.cacheTokenWrite,children:["write ",W(T.cacheCreateTokens)]})," / ",e.jsxs("span",{className:S.cacheTokenRead,children:["read ",W(T.cacheReadTokens)]}),e.jsx(Zt,{title:p("ui.copyAllCacheText"),children:e.jsx(Fe,{className:S.cacheCopyIcon,onClick:()=>{navigator.clipboard.writeText(C()).then(()=>{G.success(p("ui.copied"))}).catch(()=>{})}})})]}),_&&e.jsx(Oe,{content:_,trigger:"hover",placement:"left",children:e.jsx("span",{className:S.userPromptNavBtn,children:p("ui.userPromptNav")})})]}):null})(),e.jsxs("div",{className:S.cacheScrollArea,ref:b=>{this._cacheScrollEl=b},children:[f.tools.length>0&&e.jsxs("div",{className:S.cacheSectionBlock,children:[e.jsxs("div",{className:S.cacheSectionHeader,onClick:()=>this.setState(b=>({cacheCollapsed:{...b.cacheCollapsed,tools:!b.cacheCollapsed.tools}})),children:[e.jsx("span",{className:S.cacheCollapseArrow,style:{transform:this.state.cacheCollapsed.tools?"rotate(-90deg)":"rotate(0deg)"},children:"▼"}),p("ui.tools")," (",f.tools.length,")"]}),!this.state.cacheCollapsed.tools&&f.tools.map((b,T)=>e.jsx("pre",{className:S.cachePre,children:b},T))]}),f.system.length>0&&e.jsxs("div",{className:S.cacheSectionBlock,children:[e.jsxs("div",{className:S.cacheSectionHeader,onClick:()=>this.setState(b=>({cacheCollapsed:{...b.cacheCollapsed,system:!b.cacheCollapsed.system}})),children:[e.jsx("span",{className:S.cacheCollapseArrow,style:{transform:this.state.cacheCollapsed.system?"rotate(-90deg)":"rotate(0deg)"},children:"▼"}),p("ui.systemPrompt")," (",f.system.length,")"]}),!this.state.cacheCollapsed.system&&f.system.map((b,T)=>e.jsx("pre",{className:S.cachePreSystem,children:b},T))]}),f.messages.length>0&&e.jsxs("div",{className:S.cacheSectionBlock,children:[e.jsxs("div",{className:S.cacheSectionHeader,onClick:()=>this.setState(b=>({cacheCollapsed:{...b.cacheCollapsed,messages:!b.cacheCollapsed.messages}})),children:[e.jsx("span",{className:S.cacheCollapseArrow,style:{transform:this.state.cacheCollapsed.messages?"rotate(-90deg)":"rotate(0deg)"},children:"▼"}),p("ui.messages")," (",f.messages.length,")"]}),!this.state.cacheCollapsed.messages&&f.messages.map((b,T)=>{const R=T===this.state.cacheHighlightIdx,P=R?this.state.cacheHighlightFading?{boxShadow:"0 0 10px rgba(22,104,220,0)",transition:"box-shadow 3s ease-out",position:"relative"}:{boxShadow:"0 0 10px rgba(22,104,220,0.6)",transition:"box-shadow 0.2s ease-in",position:"relative"}:{};return e.jsxs("pre",{"data-msg-idx":T,className:S.cachePre,style:P,children:[R&&e.jsx("svg",{className:S.cacheHighlightSvg,style:{opacity:this.state.cacheHighlightFading?0:1,transition:this.state.cacheHighlightFading?"opacity 3s ease-out":void 0},preserveAspectRatio:"none",children:e.jsx("rect",{x:"0.5",y:"0.5",width:"calc(100% - 1px)",height:"calc(100% - 1px)",rx:"4",ry:"4",fill:"none",stroke:"#1668dc",strokeWidth:"1",strokeDasharray:"6 4",children:e.jsx("animate",{attributeName:"stroke-dashoffset",from:"0",to:"-100",dur:"4s",repeatCount:"indefinite"})})}),b]},T)})]})]})]})})()})},{key:"context",label:"Context",children:e.jsx("div",{className:`${S.tabContent} ${S.cacheTabContent}`,children:e.jsx(Ni,{body:s.body,response:(m=s.response)==null?void 0:m.body})})}],o=(x=(v=s.response)==null?void 0:v.body)==null?void 0:x.usage,r=o?(()=>{const f=o.input_tokens||0,y=o.output_tokens||0,C=o.cache_creation_input_tokens||0,k=o.cache_read_input_tokens||0,_=f+C+k,b=_>0?(k/_*100).toFixed(1):"0.0";return{input:f,output:y,cacheCreate:C,cacheRead:k,hitRate:b}})():null;return e.jsxs("div",{className:S.container,children:[e.jsxs("div",{className:S.urlSection,children:[e.jsxs("div",{className:S.urlLeft,children:[e.jsx(vo,{className:S.urlText,ellipsis:{rows:2,expandable:!0},children:s.url}),e.jsxs($e,{size:"small",wrap:!0,children:[e.jsx(me,{color:s.method==="POST"?"blue":"green",children:s.method}),e.jsxs(ce,{type:"secondary",className:S.metaText,children:["🕐 ",c]}),s.duration&&e.jsxs(ce,{type:"secondary",className:S.metaText,children:["⏱️ ",s.duration,"ms"]}),s.response&&e.jsxs(me,{color:l?"success":"error",children:["HTTP ",s.response.status]})]})]}),r&&e.jsx("div",{className:S.tokenStatsBox,children:e.jsxs("div",{className:S.tokenGrid,children:[e.jsxs("div",{className:S.tokenRows,children:[e.jsxs("div",{className:S.tokenRow,children:[e.jsx("span",{className:S.tokenLabel,children:"Token"}),e.jsxs("span",{className:S.tokenTd,children:["input: ",W(r.input)]}),e.jsxs("span",{className:S.tokenTd,children:["output: ",W(r.output)]})]}),e.jsxs("div",{className:`${S.tokenRow} ${S.tokenRowBorder}`,children:[e.jsx("span",{className:S.tokenLabel,children:"Cache"}),e.jsxs("span",{className:S.tokenTd,children:["create: ",W(r.cacheCreate)]}),e.jsxs("span",{className:S.tokenTd,children:["read: ",W(r.cacheRead)]})]})]}),e.jsxs("div",{className:S.tokenHitRate,children:[e.jsxs("div",{children:[r.hitRate,"%"]}),e.jsx("div",{className:S.tokenHitRateLabel,children:p("ui.hitRate")})]})]})})]}),e.jsx(Yt,{activeKey:t,onChange:a,items:h,size:"small"})]})}}const Co="_resizer_1xl2m_1",bo={resizer:Co};class No extends q.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:bo.resizer})}}class Mo extends xa{constructor(t){super(t);O(this,"handleViewRequest",t=>{this.setState({viewMode:"raw",selectedIndex:t,scrollCenter:!0})});O(this,"handleViewInChat",()=>{this.setState(t=>{const c=(t.showAll?t.requests:We(t.requests))[t.selectedIndex];if(!c)return null;let l=null;if(Ce(c)&&c.timestamp)l=c.timestamp;else{const u=Ve(c);if((u.type==="SubAgent"||u.type==="Teammate")&&c.timestamp)l=c.timestamp;else{const g=t.requests.indexOf(c);g>=0&&(l=Pt(t.requests,g))}l||G.info(p("ui.cannotMap"))}return{viewMode:"chat",chatScrollToTs:l}})});O(this,"handleToggleViewMode",()=>{this.setState(t=>{const a=t.viewMode==="raw"?"chat":"raw";if(a==="raw"){if(t.selectedIndex===null){const u=t.showAll?t.requests:We(t.requests);return{viewMode:a,selectedIndex:u.length>0?u.length-1:null,scrollCenter:!0}}return{viewMode:a,scrollCenter:!0}}const c=t.showAll?t.requests:We(t.requests),l=t.selectedIndex!=null?c[t.selectedIndex]:null;if(l){let u=null;if(Ce(l)&&l.timestamp)u=l.timestamp;else{const g=Ve(l);if((g.type==="SubAgent"||g.type==="Teammate")&&l.timestamp)u=l.timestamp;else{const i=t.requests.indexOf(l);i>=0&&(u=Pt(t.requests,i)),u||G.info(p("ui.cannotMap"))}}return{viewMode:a,chatScrollToTs:u}}return{viewMode:a,chatScrollToTs:null}},()=>{this.state.viewMode==="chat"&&this.state.terminalVisible&&this.state.cliMode&&!Rs&&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 a=this.state.showAll?this.state.requests:We(this.state.requests);let c=-1;for(let l=a.length-1;l>=0;l--)if(Ce(a[l])){c=l;break}c<0||this.setState({selectedIndex:c,scrollCenter:!0,currentTab:"kv-cache-text",pendingCacheHighlight:{msgIdx:t,key:Date.now()}})});O(this,"handleResize",t=>{const a=this.mainContainerRef.current;if(!a)return;const c=a.getBoundingClientRect(),l=t-c.left;l>=250&&l<=800&&this.setState({leftPanelWidth:l})});O(this,"handleLoadLocalJsonlFile",()=>{const t=document.createElement("input");t.type="file",t.accept=".jsonl",t.multiple=!0,t.onchange=a=>{const c=Array.from(a.target.files);if(c.length===0)return;if(c.reduce((h,o)=>h+o.size,0)>500*1024*1024){G.error(p("ui.fileTooLarge"));return}this.setState({fileLoading:!0,fileLoadingCount:0});let u=0;const g=[],i=[];c.forEach(h=>{const o=new FileReader;o.onload=r=>{try{const v=r.target.result.split(`
|
|
36
36
|
---
|
|
37
|
-
`).filter(x=>x.trim()).map(x=>{try{return JSON.parse(x)}catch{return null}}).filter(Boolean);g.push(...
|
|
37
|
+
`).filter(x=>x.trim()).map(x=>{try{return JSON.parse(x)}catch{return null}}).filter(Boolean);g.push(...v),i.push(h.name)}catch{}u++,u===c.length&&this._finishLocalLoad(g,i)},o.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){G.error(p("ui.fileTooLarge"));return}this.setState({fileLoading:!0,fileLoadingCount:0});let c=0;const l=[],u=[];t.forEach(g=>{const i=new FileReader;i.onload=h=>{try{const r=h.target.result.split(`
|
|
38
38
|
---
|
|
39
|
-
`).filter(m=>m.trim()).map(m=>{try{return JSON.parse(m)}catch{return null}}).filter(Boolean);l.push(...r),u.push(g.name)}catch{}c++,c===t.length&&this._finishLocalLoad(l,u)},i.readAsText(g)})});O(this,"_isInternalDrag",t=>t.dataTransfer.types.includes("text/x-preset-reorder"));O(this,"_onDragOver",t=>{t.preventDefault(),!this._isInternalDrag(t)&&(this.state.isDragging||this.setState({isDragging:!0}))});O(this,"_onDragLeave",t=>{const a=this._layoutRef.current;a&&!a.contains(t.relatedTarget)&&this.setState({isDragging:!1})});O(this,"_onDrop",t=>{if(t.preventDefault(),this._isInternalDrag(t))return;this.setState({isDragging:!1});const a=Array.from(t.dataTransfer.files);a.length&&Promise.all(a.map(c=>va(c).then(l=>({name:c.name,path:l})).catch(l=>(G.error(`${c.name}: ${l.message}`),null)))).then(c=>{const l=c.filter(Boolean).map(u=>`"${u.path}"`);l.length>0&&this.setState(u=>({pendingUploadPaths:[...u.pendingUploadPaths||[],...l]}))})});O(this,"handleUploadPathsConsumed",()=>{this.setState({pendingUploadPaths:[]})});Object.assign(this.state,{leftPanelWidth:380,terminalVisible:!0,currentTab:"request",pendingCacheHighlight:null})}render(){const{filteredRequests:t,selectedRequest:a,fileLoading:c,fileLoadingCount:l,mainAgentSessions:u,viewMode:g}=this.renderPrepare(),{selectedIndex:i,leftPanelWidth:h,currentTab:o}=this.state;return this.state.workspaceMode?this.renderWorkspaceMode():e.jsxs(ya,{theme:this.darkThemeConfig,children:[c&&e.jsx("div",{className:E.loadingOverlay,children:e.jsxs("div",{className:E.loadingText,children:["Loading...(",l,")"]})}),this.state.isDragging&&e.jsx("div",{className:E.dragOverlay,children:e.jsxs("div",{className:E.dragOverlayContent,children:[e.jsx(Ut,{className:E.dragIcon}),e.jsx("p",{children:p("ui.dragDropHint")})]})}),e.jsxs(Se,{className:E.layout,ref:this._layoutRef,onDragOver:this._onDragOver,onDragLeave:this._onDragLeave,onDrop:this._onDrop,children:[e.jsx(Se.Header,{className:E.header,children:e.jsx(Xe,{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(r=>({terminalVisible:!r.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,proxyProfiles:this.state.proxyProfiles,activeProxyId:this.state.activeProxyId,defaultConfig:this.state.defaultConfig,onProxyProfileChange:this.handleProxyProfileChange})}),e.jsxs(Se.Content,{className:E.content,children:[g==="raw"&&(t.length===0?e.jsx("div",{className:E.guideContainer,children:e.jsxs("div",{className:E.guideContent,children:[e.jsx("h2",{className:E.guideTitle,children:p("ui.guide.title")}),e.jsxs("div",{className:E.guideStep,children:[e.jsx("div",{className:E.guideStepNum,children:"1"}),e.jsxs("div",{className:E.guideStepBody,children:[e.jsx("p",{className:E.guideText,children:p("ui.guide.step1")}),e.jsx("code",{className:E.guideCode,children:p("ui.guide.exampleQuestion")})]})]}),e.jsxs("div",{className:E.guideStep,children:[e.jsx("div",{className:E.guideStepNum,children:"2"}),e.jsxs("div",{className:E.guideStepBody,children:[e.jsx("p",{className:E.guideText,children:p("ui.guide.step2")}),e.jsx("code",{className:E.guideCode,children:p("ui.guide.troubleshootCmd")})]})]}),e.jsxs("div",{className:E.guideStep,children:[e.jsx("div",{className:E.guideStepNum,children:"3"}),e.jsxs("div",{className:E.guideStepBody,children:[e.jsx("p",{className:E.guideText,children:p("ui.guide.step3")}),e.jsx("code",{className:E.guideCode,children:"npm install -g @anthropic-ai/claude-code"})]})]})]})}):e.jsxs("div",{ref:this.mainContainerRef,className:E.mainContainer,children:[e.jsxs("div",{className:E.leftPanel,style:{width:h},children:[e.jsxs("div",{className:E.leftPanelHeader,children:[e.jsx("span",{children:p("ui.requestList")}),e.jsx("span",{className:E.leftPanelCount,children:p("ui.totalRequests",{count:t.length})})]}),e.jsx("div",{className:E.leftPanelBody,children:e.jsx(Jn,{requests:t,selectedIndex:i,scrollCenter:this.state.scrollCenter,onSelect:this.handleSelectRequest,onScrollDone:this.handleScrollDone,cacheLossMap:this._cacheLossMap})})]}),e.jsx(No,{onResize:this.handleResize}),e.jsx("div",{className:E.rightPanel,children:e.jsx(jo,{request:a,requests:t,allRequests:this.state.requests,selectedIndex:i,currentTab:o,onTabChange:this.handleTabChange,onViewInChat:this.handleViewInChat,expandDiff:this.state.expandDiff,pendingCacheHighlight:this.state.pendingCacheHighlight,onCacheHighlightDone:this.handleCacheHighlightDone})})]})),e.jsx("div",{className:E.chatViewWrapper,style:{display:g==="chat"?"flex":"none"},children:e.jsx(ja,{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(r=>({terminalVisible:!r.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:r=>this.loadSession(r),lang:this.state.lang})})]}),e.jsx("div",{className:E.footer,children:e.jsxs("div",{className:E.footerRight,children:[e.jsxs("a",{href:"https://github.com/weiesky/cc-viewer",target:"_blank",rel:"noopener noreferrer",className:E.footerLink,children:[e.jsx("svg",{className:E.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:E.footerDivider,children:"|"}),e.jsx("a",{href:"dingtalk://dingtalkclient/action/sendmsg?dingtalk_id=sthk5es",className:E.footerLink,children:p("ui.footer.contact")})]})})]}),e.jsx(je,{title:p("ui.resume.title"),open:this.state.resumeModalVisible,closable:!1,maskClosable:!1,keyboard:!1,footer:e.jsxs("div",{children:[e.jsxs("div",{className:E.resumeFooterRight,children:[e.jsx(H,{type:"primary",onClick:()=>this.handleResumeChoice("continue"),className:E.btnMarginRight,children:p("ui.resume.continue")},"continue"),e.jsx(H,{onClick:()=>this.handleResumeChoice("new"),children:p("ui.resume.new")},"new")]}),e.jsx("div",{className:E.resumeFooterLeft,children:e.jsx(Ca,{checked:this.state.resumeRememberChoice,onChange:r=>this.setState({resumeRememberChoice:r.target.checked}),className:E.resumeCheckboxOpacity,children:e.jsx("span",{className:E.resumeCheckboxOpacity,children:p("ui.resume.remember")})})})]}),children:e.jsx("p",{children:p("ui.resume.message",{file:this.state.resumeFileName})})}),e.jsxs(je,{title:e.jsxs("span",{className:E.modalTitleInline,children:[e.jsx(Xt,{apiEndpoint:le("/api/open-log-dir"),title:p("ui.openLogDir"),size:16}),p("ui.importLocalLogs")]}),open:this.state.importModalVisible,onCancel:this.handleCloseImportModal,footer:null,width:1e3,styles:{body:{overflow:"hidden"}},children:[e.jsxs("div",{className:E.modalActions,children:[e.jsx(H,{icon:e.jsx(Ut,{}),onClick:this.handleLoadLocalJsonlFile,children:p("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:E.btnMarginLeft,children:p("ui.mergeLogs")}),e.jsx(H,{size:"small",danger:!0,icon:e.jsx(ht,{}),disabled:this.state.selectedLogs.size===0,onClick:this.handleDeleteLogs,className:E.btnMarginLeft,children:p("ui.deleteLogs")}),e.jsx(H,{size:"small",icon:e.jsx(ut,{spin:this.state.refreshingStats}),loading:this.state.refreshingStats,onClick:this.handleRefreshStats,className:E.btnMarginLeft,children:p("ui.refreshStats")})]}),this.state.localLogsLoading?e.jsx("div",{className:E.spinCenter,children:e.jsx(Qt,{})}):(()=>{const r=this.state.localLogs[this.state.currentProject];return!r||r.length===0?e.jsx("div",{className:E.emptyCenter,children:p("ui.noLogs")}):e.jsx("div",{className:E.logListContainer,children:this.renderLogTable(r,!1)})})()]})]})}}export{Mo as default};
|
|
39
|
+
`).filter(m=>m.trim()).map(m=>{try{return JSON.parse(m)}catch{return null}}).filter(Boolean);l.push(...r),u.push(g.name)}catch{}c++,c===t.length&&this._finishLocalLoad(l,u)},i.readAsText(g)})});O(this,"_isInternalDrag",t=>t.dataTransfer.types.includes("text/x-preset-reorder"));O(this,"_onDragOver",t=>{t.preventDefault(),!this._isInternalDrag(t)&&(this.state.isDragging||this.setState({isDragging:!0}))});O(this,"_onDragLeave",t=>{const a=this._layoutRef.current;a&&!a.contains(t.relatedTarget)&&this.setState({isDragging:!1})});O(this,"_onDrop",t=>{if(t.preventDefault(),this._isInternalDrag(t))return;this.setState({isDragging:!1});const a=Array.from(t.dataTransfer.files);a.length&&Promise.all(a.map(c=>ya(c).then(l=>({name:c.name,path:l})).catch(l=>(G.error(`${c.name}: ${l.message}`),null)))).then(c=>{const l=c.filter(Boolean).map(u=>`"${u.path}"`);l.length>0&&this.setState(u=>({pendingUploadPaths:[...u.pendingUploadPaths||[],...l]}))})});O(this,"handleUploadPathsConsumed",()=>{this.setState({pendingUploadPaths:[]})});Object.assign(this.state,{leftPanelWidth:380,terminalVisible:!0,currentTab:"request",pendingCacheHighlight:null})}render(){const{filteredRequests:t,selectedRequest:a,fileLoading:c,fileLoadingCount:l,mainAgentSessions:u,viewMode:g}=this.renderPrepare(),{selectedIndex:i,leftPanelWidth:h,currentTab:o}=this.state;return this.state.workspaceMode?this.renderWorkspaceMode():e.jsxs(va,{theme:this.darkThemeConfig,children:[c&&e.jsx("div",{className:E.loadingOverlay,children:e.jsxs("div",{className:E.loadingText,children:["Loading...(",l,")"]})}),this.state.isDragging&&e.jsx("div",{className:E.dragOverlay,children:e.jsxs("div",{className:E.dragOverlayContent,children:[e.jsx(Ut,{className:E.dragIcon}),e.jsx("p",{children:p("ui.dragDropHint")})]})}),e.jsxs(Se,{className:E.layout,ref:this._layoutRef,onDragOver:this._onDragOver,onDragLeave:this._onDragLeave,onDrop:this._onDrop,children:[e.jsx(Se.Header,{className:E.header,children:e.jsx(Xe,{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(r=>({terminalVisible:!r.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,proxyProfiles:this.state.proxyProfiles,activeProxyId:this.state.activeProxyId,defaultConfig:this.state.defaultConfig,onProxyProfileChange:this.handleProxyProfileChange})}),e.jsxs(Se.Content,{className:E.content,children:[g==="raw"&&(t.length===0?e.jsx("div",{className:E.guideContainer,children:e.jsxs("div",{className:E.guideContent,children:[e.jsx("h2",{className:E.guideTitle,children:p("ui.guide.title")}),e.jsxs("div",{className:E.guideStep,children:[e.jsx("div",{className:E.guideStepNum,children:"1"}),e.jsxs("div",{className:E.guideStepBody,children:[e.jsx("p",{className:E.guideText,children:p("ui.guide.step1")}),e.jsx("code",{className:E.guideCode,children:p("ui.guide.exampleQuestion")})]})]}),e.jsxs("div",{className:E.guideStep,children:[e.jsx("div",{className:E.guideStepNum,children:"2"}),e.jsxs("div",{className:E.guideStepBody,children:[e.jsx("p",{className:E.guideText,children:p("ui.guide.step2")}),e.jsx("code",{className:E.guideCode,children:p("ui.guide.troubleshootCmd")})]})]}),e.jsxs("div",{className:E.guideStep,children:[e.jsx("div",{className:E.guideStepNum,children:"3"}),e.jsxs("div",{className:E.guideStepBody,children:[e.jsx("p",{className:E.guideText,children:p("ui.guide.step3")}),e.jsx("code",{className:E.guideCode,children:"npm install -g @anthropic-ai/claude-code"})]})]})]})}):e.jsxs("div",{ref:this.mainContainerRef,className:E.mainContainer,children:[e.jsxs("div",{className:E.leftPanel,style:{width:h},children:[e.jsxs("div",{className:E.leftPanelHeader,children:[e.jsx("span",{children:p("ui.requestList")}),e.jsx("span",{className:E.leftPanelCount,children:p("ui.totalRequests",{count:t.length})})]}),e.jsx("div",{className:E.leftPanelBody,children:e.jsx(Jn,{requests:t,selectedIndex:i,scrollCenter:this.state.scrollCenter,onSelect:this.handleSelectRequest,onScrollDone:this.handleScrollDone,cacheLossMap:this._cacheLossMap})})]}),e.jsx(No,{onResize:this.handleResize}),e.jsx("div",{className:E.rightPanel,children:e.jsx(jo,{request:a,requests:t,allRequests:this.state.requests,selectedIndex:i,currentTab:o,onTabChange:this.handleTabChange,onViewInChat:this.handleViewInChat,expandDiff:this.state.expandDiff,pendingCacheHighlight:this.state.pendingCacheHighlight,onCacheHighlightDone:this.handleCacheHighlightDone})})]})),e.jsx("div",{className:E.chatViewWrapper,style:{display:g==="chat"?"flex":"none"},children:e.jsx(ja,{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(r=>({terminalVisible:!r.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:r=>this.loadSession(r),lang:this.state.lang})})]}),e.jsx("div",{className:E.footer,children:e.jsxs("div",{className:E.footerRight,children:[e.jsxs("a",{href:"https://github.com/weiesky/cc-viewer",target:"_blank",rel:"noopener noreferrer",className:E.footerLink,children:[e.jsx("svg",{className:E.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:E.footerDivider,children:"|"}),e.jsx("a",{href:"dingtalk://dingtalkclient/action/sendmsg?dingtalk_id=sthk5es",className:E.footerLink,children:p("ui.footer.contact")})]})})]}),e.jsx(je,{title:p("ui.resume.title"),open:this.state.resumeModalVisible,closable:!1,maskClosable:!1,keyboard:!1,footer:e.jsxs("div",{children:[e.jsxs("div",{className:E.resumeFooterRight,children:[e.jsx(H,{type:"primary",onClick:()=>this.handleResumeChoice("continue"),className:E.btnMarginRight,children:p("ui.resume.continue")},"continue"),e.jsx(H,{onClick:()=>this.handleResumeChoice("new"),children:p("ui.resume.new")},"new")]}),e.jsx("div",{className:E.resumeFooterLeft,children:e.jsx(Ca,{checked:this.state.resumeRememberChoice,onChange:r=>this.setState({resumeRememberChoice:r.target.checked}),className:E.resumeCheckboxOpacity,children:e.jsx("span",{className:E.resumeCheckboxOpacity,children:p("ui.resume.remember")})})})]}),children:e.jsx("p",{children:p("ui.resume.message",{file:this.state.resumeFileName})})}),e.jsxs(je,{title:e.jsxs("span",{className:E.modalTitleInline,children:[e.jsx(Xt,{apiEndpoint:le("/api/open-log-dir"),title:p("ui.openLogDir"),size:16}),p("ui.importLocalLogs")]}),open:this.state.importModalVisible,onCancel:this.handleCloseImportModal,footer:null,width:1e3,styles:{body:{overflow:"hidden"}},children:[e.jsxs("div",{className:E.modalActions,children:[e.jsx(H,{icon:e.jsx(Ut,{}),onClick:this.handleLoadLocalJsonlFile,children:p("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:E.btnMarginLeft,children:p("ui.mergeLogs")}),e.jsx(H,{size:"small",danger:!0,icon:e.jsx(ht,{}),disabled:this.state.selectedLogs.size===0,onClick:this.handleDeleteLogs,className:E.btnMarginLeft,children:p("ui.deleteLogs")}),e.jsx(H,{size:"small",icon:e.jsx(ut,{spin:this.state.refreshingStats}),loading:this.state.refreshingStats,onClick:this.handleRefreshStats,className:E.btnMarginLeft,children:p("ui.refreshStats")})]}),this.state.localLogsLoading?e.jsx("div",{className:E.spinCenter,children:e.jsx(Qt,{})}):(()=>{const r=this.state.localLogs[this.state.currentProject];return!r||r.length===0?e.jsx("div",{className:E.emptyCenter,children:p("ui.noLogs")}):e.jsx("div",{className:E.logListContainer,children:this.renderLogTable(r,!1)})})()]})]})}}export{Mo as default};
|