@rvsx/qwen-code 0.23.8 → 0.23.9
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/chunks/{MaxSizedBox-BKPKMIY4.js → MaxSizedBox-R24Z2SNX.js} +8 -8
- package/chunks/{StandaloneSessionPicker-T4V4ZFI5.js → StandaloneSessionPicker-YU4QRUW4.js} +22 -22
- package/chunks/{acpAgent-BF4R7SNO.js → acpAgent-A72746Y6.js} +42 -42
- package/chunks/{agent-7IDOWREI.js → agent-54Z34WU2.js} +3 -3
- package/chunks/{agent-headless-ITI7FPND.js → agent-headless-PH52YSWA.js} +3 -3
- package/chunks/{bridge-46OFLF74.js → bridge-HUFQUL7R.js} +9 -9
- package/chunks/{channel-settings-store-UVRWFCSL.js → channel-settings-store-S2XBQHXG.js} +13 -13
- package/chunks/{chunk-QVN5HNQY.js → chunk-22HHM3LQ.js} +2 -2
- package/chunks/{chunk-UGQW5YST.js → chunk-266JNPCH.js} +1 -1
- package/chunks/{chunk-27CHKLBB.js → chunk-2I7YTQQE.js} +3 -3
- package/chunks/{chunk-N2VKUPOP.js → chunk-3VESNURC.js} +1 -1
- package/chunks/{chunk-M2C5HZ42.js → chunk-5C32AIAG.js} +1 -1
- package/chunks/{chunk-HFYKVVAD.js → chunk-5HC7R2IH.js} +1 -1
- package/chunks/{chunk-OGWXMKH7.js → chunk-5IH6ZPN4.js} +1 -1
- package/chunks/{chunk-QEWS4VAD.js → chunk-5TURFFCC.js} +1 -1
- package/chunks/{chunk-R5O3HPG6.js → chunk-65FG5ZNW.js} +7 -7
- package/chunks/{chunk-J3MHSBEQ.js → chunk-65ZMTIQB.js} +2 -2
- package/chunks/{chunk-D3LM2MR2.js → chunk-6LCCFGFN.js} +4 -4
- package/chunks/{chunk-2ZLEYX5K.js → chunk-6N47ZEGQ.js} +1 -1
- package/chunks/{chunk-42WUYIES.js → chunk-73EVGWME.js} +2 -2
- package/chunks/{chunk-KRAUSHOA.js → chunk-74UKQTG3.js} +2 -2
- package/chunks/{chunk-6TCLYILW.js → chunk-7B4U2S32.js} +1 -1
- package/chunks/{chunk-MNRKDUDL.js → chunk-7SNFBQVG.js} +3 -3
- package/chunks/{chunk-5OMU5RPP.js → chunk-7SO3BNPQ.js} +2 -2
- package/chunks/{chunk-V5OCU527.js → chunk-A4IT5J6R.js} +1 -1
- package/chunks/{chunk-TIP4YI6T.js → chunk-BI4542S4.js} +2 -2
- package/chunks/{chunk-CFINFW7B.js → chunk-C32XYUFA.js} +3 -3
- package/chunks/{chunk-YKEY23HH.js → chunk-CB7P4HG7.js} +1 -1
- package/chunks/{chunk-7ODCHDBZ.js → chunk-CZ5RUCDE.js} +2 -2
- package/chunks/{chunk-BGQXNQKT.js → chunk-DICDIGXI.js} +2 -2
- package/chunks/{chunk-QW63ODNZ.js → chunk-DY532LP4.js} +4 -4
- package/chunks/{chunk-QLFPARI4.js → chunk-ENQOX6GT.js} +1 -1
- package/chunks/{chunk-JUYZVD75.js → chunk-EU7FCCZB.js} +1 -1
- package/chunks/{chunk-OFAUOJAR.js → chunk-FOKUSLMJ.js} +1 -1
- package/chunks/{chunk-75D6U2BD.js → chunk-FRGYFNED.js} +1 -1
- package/chunks/{chunk-QDCMJ2QQ.js → chunk-FSEVH4T6.js} +1 -1
- package/chunks/{chunk-P5WYYR7O.js → chunk-G5VBJ5KM.js} +1 -1
- package/chunks/{chunk-QC4WXFMQ.js → chunk-GN7D2I73.js} +3 -3
- package/chunks/{chunk-A7JYGQYY.js → chunk-HA2ELSZ4.js} +1 -1
- package/chunks/{chunk-HXIENCIP.js → chunk-IHZWU6Z6.js} +29 -29
- package/chunks/{chunk-EYC6XA57.js → chunk-KDKVIMQJ.js} +2 -2
- package/chunks/{chunk-TFKHU65T.js → chunk-KEKQM4R7.js} +2 -2
- package/chunks/{chunk-72K4FUJY.js → chunk-LD33P24S.js} +1 -1
- package/chunks/{chunk-BPH3JD3H.js → chunk-LJLC3PGV.js} +7 -7
- package/chunks/{chunk-4RFJ4QCD.js → chunk-LVL26LMJ.js} +23 -23
- package/chunks/{chunk-MNODMDAF.js → chunk-NDTKC4VP.js} +11 -11
- package/chunks/{chunk-NAR7FPXQ.js → chunk-NH553UP2.js} +4 -4
- package/chunks/{chunk-Z44QYYVJ.js → chunk-NRDRAXEZ.js} +1 -1
- package/chunks/{chunk-S7BFHXDL.js → chunk-O7IGXJK3.js} +3 -3
- package/chunks/{chunk-P6Q3JTCD.js → chunk-PSNFOHYY.js} +1 -1
- package/chunks/{chunk-QOWYIDYM.js → chunk-PUAANVBC.js} +1 -1
- package/chunks/{chunk-7BGB2ACM.js → chunk-Q5CKY2MY.js} +9 -9
- package/chunks/{chunk-YGQBE4DU.js → chunk-R2E67Z47.js} +1 -1
- package/chunks/{chunk-DAFTTAK6.js → chunk-RA5MLQRO.js} +2 -2
- package/chunks/{chunk-H5RSLYP4.js → chunk-RUSD3KR2.js} +3 -3
- package/chunks/{chunk-ZCZYEQLU.js → chunk-SEE66JLY.js} +2 -2
- package/chunks/{chunk-RA2TAWTF.js → chunk-SNWZUOWV.js} +1 -1
- package/chunks/{chunk-B6BUTNXI.js → chunk-TJHIH4D4.js} +22 -22
- package/chunks/{chunk-YKDVILDG.js → chunk-U7HOT2JC.js} +1 -1
- package/chunks/{chunk-MP274XG2.js → chunk-UC56HLGJ.js} +3 -3
- package/chunks/{chunk-4RCU7TOZ.js → chunk-VEYJWMRN.js} +1 -1
- package/chunks/{chunk-5VK5BPLO.js → chunk-VVQNBRSJ.js} +3 -3
- package/chunks/{chunk-3Z4APCCI.js → chunk-W7PUR3EL.js} +1 -1
- package/chunks/{chunk-DCSU5O6J.js → chunk-WNCCZCAO.js} +3 -3
- package/chunks/{chunk-YLAOF6VG.js → chunk-XBGUAOQP.js} +5 -5
- package/chunks/{chunk-VZAKXPY2.js → chunk-YSSUZBJ5.js} +3 -3
- package/chunks/{chunk-QXYSZSP3.js → chunk-YYCLMMYP.js} +3 -3
- package/chunks/{chunk-WVBRNTWM.js → chunk-Z5D2UMYV.js} +13 -13
- package/chunks/{chunk-JU5LYO6H.js → chunk-ZCVGVTXJ.js} +3 -3
- package/chunks/{chunk-2OKH5PBN.js → chunk-ZI277HD3.js} +1 -1
- package/chunks/{chunk-NK4IC6BL.js → chunk-ZVMWBEWE.js} +5 -5
- package/chunks/{config-utils-D6KQPPDK.js → config-utils-X5PWPJQR.js} +8 -8
- package/chunks/{content-generator-MPN45DYE.js → content-generator-MOIJT5GL.js} +3 -3
- package/chunks/{contextCommand-IESDBR3R.js → contextCommand-JPXGPZSW.js} +9 -9
- package/chunks/{core-runtime-KONV6GJI.js → core-runtime-XBDWOPC7.js} +8 -8
- package/chunks/{create-sub-session-ZW6T6VCD.js → create-sub-session-H3XWQRUD.js} +8 -8
- package/chunks/{daemon-git-worktree-guard-7IRLBVMJ.js → daemon-git-worktree-guard-5KMOIZYP.js} +8 -8
- package/chunks/{daemon-status-provider-GUHOGVBR.js → daemon-status-provider-RORNECCW.js} +13 -13
- package/chunks/{daemon-trust-policy-XNA72JQ3.js → daemon-trust-policy-2GA6D2HB.js} +13 -13
- package/chunks/{daemon-trust-policy-monitor-7S6IVIEG.js → daemon-trust-policy-monitor-3DCGUYKU.js} +13 -13
- package/chunks/{deferred-core-runtime-ZBURC4VV.js → deferred-core-runtime-PPK3IWMF.js} +8 -8
- package/chunks/{edit-PSK6V5LE.js → edit-SPLY7LXB.js} +3 -3
- package/chunks/{enterPlanMode-N5JK4BIN.js → enterPlanMode-FJKT53SY.js} +3 -3
- package/chunks/{environment-EN7XQ2LN.js → environment-K7BUQWH3.js} +10 -10
- package/chunks/{errors-3NUBDXEP.js → errors-444G2JSQ.js} +10 -10
- package/chunks/{exitPlanMode-RZJYPSG5.js → exitPlanMode-SDHNK6OM.js} +3 -3
- package/chunks/{fast-path-MVKABA2I.js → fast-path-YHPH4MTX.js} +2 -2
- package/chunks/{glob-EBEY3NZR.js → glob-P2WBZMNY.js} +3 -3
- package/chunks/{goal-tools-PLWD4SQD.js → goal-tools-QKLTACVL.js} +3 -3
- package/chunks/{handleAutoUpdate-XDFEIUJT.js → handleAutoUpdate-J5YTQZVG.js} +10 -10
- package/chunks/{i18n-7SXVHPLF.js → i18n-BGSBUHKI.js} +8 -8
- package/chunks/{initializer-KCCELIOJ.js → initializer-GRDV4IAA.js} +13 -13
- package/chunks/{installationInfo-5OA36LC2.js → installationInfo-TM6AGJLP.js} +8 -8
- package/chunks/{list-O7TRVWMF.js → list-WERE6QQI.js} +16 -16
- package/chunks/{llm-3AD3Q5ZV.js → llm-XMTJE65N.js} +41 -41
- package/chunks/{llm-content-generator-WKDTSKSK.js → llm-content-generator-USPSC2VC.js} +2 -2
- package/chunks/{loadedSettingsAdapter-JRUAFRYC.js → loadedSettingsAdapter-AU37WTX5.js} +13 -13
- package/chunks/{loggingContentGenerator-INYHJ7GT.js → loggingContentGenerator-4Q3BWX6F.js} +4 -4
- package/chunks/{managed-npm-update-7RZXXC4U.js → managed-npm-update-QDYVNFEE.js} +8 -8
- package/chunks/{mcp-BFXKPLYM.js → mcp-XFJRCBKB.js} +13 -13
- package/chunks/{monitor-IUGTXTL4.js → monitor-2KPBTVTO.js} +3 -3
- package/chunks/{nonInteractiveCli-WSPUN3K2.js → nonInteractiveCli-ZN7C35AR.js} +36 -36
- package/chunks/{notebook-edit-3O5MO5MP.js → notebook-edit-YZCSNLZU.js} +3 -3
- package/chunks/{openai-subscription-gate-JHRPXEJW.js → openai-subscription-gate-QZ5DGXUM.js} +34 -34
- package/chunks/{openaiContentGenerator-KLBQ3NBR.js → openaiContentGenerator-WRTW2HZ2.js} +3 -3
- package/chunks/{pidfile-QMZYULBU.js → pidfile-CYPLPPNC.js} +8 -8
- package/chunks/{processUtils-D3O765OX.js → processUtils-5A44V72R.js} +2 -2
- package/chunks/{prompt-terminal-ledger-7YCPYOEA.js → prompt-terminal-ledger-OYB72RDC.js} +9 -9
- package/chunks/{qwenContentGenerator-VVMJ7SNK.js → qwenContentGenerator-PSKHKXC5.js} +4 -4
- package/chunks/{read-file-KGBWJCRD.js → read-file-SRFKDOAO.js} +2 -2
- package/chunks/{resumeHistoryUtils-3VFUPCVO.js → resumeHistoryUtils-PSG52WK6.js} +9 -9
- package/chunks/{ripGrep-2DW5QXLM.js → ripGrep-GP5QPIR4.js} +3 -3
- package/chunks/{run-qwen-serve-HUMGTD2Z.js → run-qwen-serve-NBZQ5SSC.js} +35 -35
- package/chunks/{runtime-MHDSEKY7.js → runtime-LJ3FBRNN.js} +14 -14
- package/chunks/{scheduled-tasks-FEWKCAQJ.js → scheduled-tasks-SVR4UUL7.js} +11 -11
- package/chunks/{scheduler-F2BMC2R5.js → scheduler-Z5XN6XPH.js} +10 -10
- package/chunks/{serve-EXY6CP5O.js → serve-HANL6VCH.js} +13 -13
- package/chunks/{server-D5B2NDIN.js → server-6NWR2WZD.js} +34 -34
- package/chunks/{session-SV3MLLZO.js → session-RPOX7ZRR.js} +37 -37
- package/chunks/{session-attachments-root-SL3ATDQI.js → session-attachments-root-ZWBIDW57.js} +8 -8
- package/chunks/{session-pr-refresh-CIY2L2IQ.js → session-pr-refresh-QLTTQP3C.js} +10 -10
- package/chunks/{settings-WYMPKB6S.js → settings-IAMMFZYH.js} +12 -12
- package/chunks/{shell-LJFOMS4E.js → shell-VEEFIBCF.js} +3 -3
- package/chunks/{skill-7PNZWL3A.js → skill-J2SRWN3J.js} +2 -2
- package/chunks/{skill-settings-GX6BTLOP.js → skill-settings-WIZUCUJZ.js} +12 -12
- package/chunks/{spawnChannel-WPZHW7DW.js → spawnChannel-C3QEKS5J.js} +8 -8
- package/chunks/{standalone-update-XU5JYXXV.js → standalone-update-XZQ43QGS.js} +9 -9
- package/chunks/{start-opentui-ui-EOA5MLR4.js → start-opentui-ui-C6CGSTKY.js} +41 -41
- package/chunks/{startInteractiveUI-LNBZH62W.js → startInteractiveUI-3Q32HPBQ.js} +45 -45
- package/chunks/{team-create-PATXKRZE.js → team-create-2XJ2KKGB.js} +3 -3
- package/chunks/{team-plan-approval-OWEBPIVB.js → team-plan-approval-6OUWCPC5.js} +3 -3
- package/chunks/{terminal-image-renderer-73MLNW53.js → terminal-image-renderer-WXEAP3LB.js} +8 -8
- package/chunks/{theme-manager-M34BNKSG.js → theme-manager-YXRTTQXI.js} +8 -8
- package/chunks/{tool-search-6PG52WZK.js → tool-search-ZPVE6LQP.js} +2 -2
- package/chunks/{total-session-admission-7KSM2VTL.js → total-session-admission-KUEANLPM.js} +9 -9
- package/chunks/{trustedFolders-RMXXAYZD.js → trustedFolders-SMAED2VQ.js} +9 -9
- package/chunks/{update-relaunch-GLEWPGC5.js → update-relaunch-DSDXRWCS.js} +5 -5
- package/chunks/{updateCheck-PEXEDUKJ.js → updateCheck-366LLFPV.js} +8 -8
- package/chunks/{useAutoAcceptIndicator-JDG7W2G2.js → useAutoAcceptIndicator-KZTNFXF5.js} +14 -14
- package/chunks/{validateNonInterActiveAuth-VO5KQF3T.js → validateNonInterActiveAuth-HMFE4XOH.js} +34 -34
- package/chunks/{version-YIEWJHN4.js → version-IUILLJGQ.js} +1 -1
- package/chunks/{web-fetch-F6HFL4SL.js → web-fetch-WRSH54AD.js} +2 -2
- package/chunks/{web-search-Q7XW2IDZ.js → web-search-LLQFWW7P.js} +1 -1
- package/chunks/{workflow-SXVYDPXY.js → workflow-IQFOVXY3.js} +5 -5
- package/chunks/{workspace-providers-status-WMB4BZGE.js → workspace-providers-status-MRXAML7E.js} +15 -15
- package/chunks/{workspace-registration-store-CXNBJE2G.js → workspace-registration-store-FDMHOZYT.js} +1 -1
- package/chunks/{workspace-registry-P5VIUIKX.js → workspace-registry-3G6G3U27.js} +9 -9
- package/chunks/{workspace-runtime-coordinator-T2W44242.js → workspace-runtime-coordinator-6VVIFASN.js} +9 -9
- package/chunks/{workspace-service-PCZ6WX5R.js → workspace-service-GHBW6ZDD.js} +14 -14
- package/chunks/{workspace-skills-status-KJSG5ZLV.js → workspace-skills-status-VWA2KX5R.js} +13 -13
- package/chunks/{workspace-trust-reconciler-WNEZMN3K.js → workspace-trust-reconciler-ZSPMTQHU.js} +14 -14
- package/chunks/{write-file-OBK3HXMI.js → write-file-GR7I7DWB.js} +4 -4
- package/chunks/{zoom-image-U6KEFEJZ.js → zoom-image-AECJSMNO.js} +2 -2
- package/cli.js +12 -12
- package/export-transcript-document.js +1 -1
- package/package.json +3 -3
|
@@ -618,4 +618,4 @@ ${t}
|
|
|
618
618
|
${s}`}function LH({tool:e}){let t=(0,I.useMemo)(()=>Gye(e),[e]),a=(0,I.useMemo)(()=>e.content&&bp(e)||"",[e]);return!t&&!a?null:(0,A.jsx)("div",{className:Me.expandedEdit,children:t?(0,A.jsx)(Rfe,{diff:t}):(0,A.jsx)("pre",{className:Me.expandedOutput,children:a})})}function ip({title:e,detail:t,status:a,children:l}){return(0,A.jsxs)("div",{className:Me.expandedCard,children:[(0,A.jsxs)("div",{className:Me.expandedCardHeader,children:[(0,A.jsxs)("span",{className:Me.expandedCardTitleRow,children:[a&&(0,A.jsx)(pw,{status:a}),(0,A.jsx)("span",{className:Me.expandedCardTitle,children:e})]}),t&&(0,A.jsx)("span",{className:Me.expandedCardDetail,children:t})]}),l&&(0,A.jsx)("div",{className:Me.expandedCardBody,children:l})]})}function Xye({tool:e,todos:t,expanded:a,title:l}){var s;let o=((s=(0,I.useContext)(GF).get(e.callId))==null?void 0:s.events)??[];return a?(0,A.jsx)(ip,{title:l,status:e.status,children:(0,A.jsx)("div",{className:Me.todoBody,children:(0,A.jsx)(y5,{todos:t})})}):(0,A.jsx)("div",{className:Me.todoBody,children:(0,A.jsx)(E5,{todos:t,events:o})})}function Zye({tool:e,displayName:t,detail:a,result:l}){let{t:s}=it(),o=a0e(),r=o?s0e(o.tasks,e):void 0;return r?(0,A.jsx)(g5,{task:r}):(0,A.jsx)(ip,{title:t,detail:a,children:(0,A.jsx)("div",{className:Me.workflowFallback,role:"status",children:e.status==="pending"||e.status==="in_progress"?s("workflow.inline.loading"):l||s("workflow.inline.unavailable")})})}function SJ(e,t){var a,l;let s=Iw(e.rawOutput),o=ZF(e),r=Ap(e),n=ex(e),i=_ye(e),d=Cm(e),c=((a=e.subTools)==null?void 0:a.length)||((l=s?.toolCalls)==null?void 0:l.length)||0,h=s?.executionSummary,w=h&&typeof h.totalDurationMs=="number"?b5(h.totalDurationMs):Em(e.startTime,e.endTime??(e.status==="in_progress"&&t?t:void 0)),u=s&&typeof s.tokenCount=="number"&&s.tokenCount>0?s.tokenCount:h&&typeof h.outputTokens=="number"&&h.outputTokens>0?h.outputTokens:0,g=u>0?$F(u):"";return{agentType:n,explicitAgentType:i,description:d,subToolCount:c,elapsed:w,tokens:g,status:r,reason:o}}function _ye(e){var t;let a=Iw(e.rawOutput),l=a?.subagentName;if(typeof l=="string"&&l.trim())return l.trim();let s=(t=e.args)==null?void 0:t.subagent_type;return typeof s=="string"&&s.trim()?s.trim():""}function TH(e){if(e.status==="completed")return!1;let t=e.toolName.toLowerCase();return!!(_r(e.toolName)||t==="write_file"||t==="writefile"||t==="edit"||t==="editfile"||Ho(t))}function $ye({tool:e}){let t=bp(e)||"";return(0,A.jsx)("pre",{className:Me.expandedOutput,children:t})}function eMe({tool:e}){var t;let a=tMe(e)||(typeof((t=e.args)==null?void 0:t.args)=="string"&&e.args.args.trim()?e.args.args.trim():e.title??"");return(0,A.jsx)("pre",{className:Me.expandedOutput,children:a})}function tMe(e){var t,a;let l=(t=e.content)==null?void 0:t[0];return l?.type!=="content"?"":typeof((a=l.content)==null?void 0:a.text)=="string"?l.content.text:""}function Bm(e){let t=e.toolName.toLowerCase();return ks(e)?"agent":_r(e.toolName)?"ask":Ho(t)?"shell":xF(t)?"fetch":sc(t)?"todo":t==="read"||t==="read_file"||t==="readfile"?"read":t==="edit"||t==="editfile"?"edit":t==="write"||t==="write_file"||t==="writefile"?"write":"other"}function aMe({description:e,elapsed:t}){return(0,A.jsxs)(A.Fragment,{children:[e&&(0,A.jsx)("span",{className:Me.lineArg,children:e}),t&&(0,A.jsx)("span",{className:Me.lineElapsed,children:t})]})}function sp({info:e}){let{renderToolHeaderExtra:t}=fr(),a=t?.(e);return a?(0,A.jsx)(A.Fragment,{children:a}):(0,A.jsx)(aMe,{description:e.description,elapsed:e.kind==="agent"||Tl(e.tool.status)?e.elapsed:""})}function lMe(e){return e.length>Tye||e.includes(`
|
|
619
619
|
`)}function sMe(e){return e.find(t=>Tl(t.status))??e[e.length-1]}function oMe(e,t,a,l=!1){if(RF(e)){let o=e.filter(n=>Tl(n.status)&&!br(n));if(o.length===0)return t("subagent.background");if(o.length===1&&_r(o[0].toolName))return t("toolGroup.summary.provideInformation");let r=o.map(n=>_r(n.toolName)?t("toolGroup.summary.provideInformation"):GJ(n,t,a));return t("toolGroup.running",{name:r.join(" \xB7 "),count:o.length})}return nMe(e,t,l)||t("toolGroup.summary",{count:e.length})}function GJ(e,t,a){if(sc(e.toolName))return t("toolGroup.summary.updatedTodos",{count:1});if(_r(e.toolName))return Tl(e.status)?t("toolGroup.summary.provideInformation"):t("toolGroup.summary.askedQuestions",{count:RJ(e)});let{displayName:l,description:s,hideDisplayName:o}=zJ(e,t,a);return[o?"":l,s].filter(Boolean).join(" ")}function zJ(e,t,a){let l=mw(e.toolName,t),s=fl(o5(e,a),120);return{kind:Bm(e),tool:e,displayName:l,description:s,elapsed:"",workspaceCwd:a,hideDisplayName:!!Mce(e)}}function rMe({tool:e,workspaceCwd:t}){let{t:a}=it(),l=_r(e.toolName),s=Tl(e.status),o=br(e),r=s&&!o&&ks(e),n=nx(r),i=!l&&s?o?a("subagent.background"):a("toolGroup.runningPrefix").trim():"";if(sc(e.toolName)||l)return(0,A.jsxs)(A.Fragment,{children:[i&&(0,A.jsxs)("span",{children:[i," "]}),GJ(e,a,t)]});let d=zJ(e,a,t),c=r?d5(e,a):"",h=r?{...d,description:[d.description,c&&`(${c})`].filter(Boolean).join(" "),elapsed:SJ(e,n).elapsed}:d;return(0,A.jsxs)(A.Fragment,{children:[i&&(0,A.jsxs)("span",{children:[i," "]}),(0,A.jsxs)("span",{className:Me.chatSummaryInline,children:[!h.hideDisplayName&&(0,A.jsx)("span",{className:Me.lineName,children:h.displayName}),(0,A.jsx)(sp,{info:h})]})]})}function nMe(e,t,a){let l=a?e.filter(ks).length:0;if(l>0){let h=e.length-l;return[t("toolGroup.summary.ranAgents",{count:l}),h?t("toolGroup.summary",{count:h}):""].filter(Boolean).join(" \xB7 ")}let s=0,o=0,r=0,n=0,i=0,d=0,c=0;for(let h of e){let w=h.toolName.toLowerCase();Ho(w)?o++:w==="edit"||w==="editfile"||w==="write"||w==="write_file"||w==="writefile"?s++:w==="read"||w==="read_file"||w==="readfile"?r++:w==="grep"||w==="grep_search"||w==="search"||w==="glob"||w==="web_search"||w==="websearch"?n++:sc(w)?i++:_r(w)?d+=RJ(h):c++}return[s?t("toolGroup.summary.editedFiles",{count:s}):"",o?t("toolGroup.summary.ranCommands",{count:o}):"",r?t("toolGroup.summary.readFiles",{count:r}):"",n?t("toolGroup.summary.searched",{count:n}):"",i?t("toolGroup.summary.updatedTodos",{count:i}):"",d?t("toolGroup.summary.askedQuestions",{count:d}):"",c?t("toolGroup.summary.otherTools",{count:c}):""].filter(Boolean).join(" ")}function RJ(e){var t;let a=(t=e.args)==null?void 0:t.questions;return Array.isArray(a)&&a.length>0?a.length:1}function iMe(){return(0,A.jsxs)("svg",{className:Me.chatSummaryToolIcon,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,A.jsx)("path",{d:"M12 20h9"}),(0,A.jsx)("path",{d:"M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z"})]})}function LJ(){return(0,A.jsxs)("svg",{className:Me.chatSummaryToolIcon,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","data-testid":"chat-summary-tool-icon","aria-hidden":"true",children:[(0,A.jsx)("rect",{x:"2",y:"2",width:"10",height:"10",rx:"2.4",stroke:"currentColor",strokeWidth:"1.2"}),(0,A.jsx)("path",{d:"M4.6 5.2 6 6.6 4.6 8",stroke:"currentColor",strokeWidth:"1.05",strokeLinecap:"round",strokeLinejoin:"round"}),(0,A.jsx)("path",{d:"M7.3 8.1h2.1",stroke:"currentColor",strokeWidth:"1.05",strokeLinecap:"round"})]})}function dMe(){return(0,A.jsxs)("svg",{className:Me.chatSummaryToolIcon,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:[(0,A.jsx)("circle",{cx:"7",cy:"7",r:"5.5",stroke:"currentColor",strokeWidth:"1.25"}),(0,A.jsx)("path",{d:"M1.8 7h10.4M7 1.5c1.3 1.5 2 3.3 2 5.5s-.7 4-2 5.5M7 1.5C5.7 3 5 4.8 5 7s.7 4 2 5.5",stroke:"currentColor",strokeWidth:"1.05",strokeLinecap:"round"})]})}function AMe(){return(0,A.jsxs)("svg",{className:Me.chatSummaryToolIcon,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:[(0,A.jsx)("rect",{x:"2",y:"1.6",width:"10",height:"10.8",rx:"2.2",stroke:"currentColor",strokeWidth:"1.25"}),(0,A.jsx)("path",{d:"M4.5 5.2h5M4.5 7h5M4.5 8.8h5",stroke:"currentColor",strokeWidth:"1.15",strokeLinecap:"round"})]})}function cMe(){return(0,A.jsx)("svg",{className:Me.chatSummaryToolIcon,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:(0,A.jsx)("path",{d:"M3 4.2 4.2 5.4 6.1 3.3M7.5 4.5h3.6M3 9.1l1.2 1.2 1.9-2.1M7.5 9.4h3.6",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})}function hMe(){return(0,A.jsx)("svg",{className:Me.chatSummaryToolIcon,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:(0,A.jsx)("path",{d:"M3.4 3.2h7.2c.7 0 1.25.55 1.25 1.25v3.4c0 .7-.55 1.25-1.25 1.25H7.5L4.5 11V9.1H3.4c-.7 0-1.25-.55-1.25-1.25v-3.4c0-.7.55-1.25 1.25-1.25Z",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})})}function FF(){return(0,A.jsx)("svg",{className:Me.chatSummaryToolIcon,width:"14",height:"14",viewBox:"0 0 1024 1024",fill:"currentColor","aria-hidden":"true",children:(0,A.jsx)("path",{d:"M770.08 96.32c1.728.64 3.072 1.984 3.712 3.712l38.848 107.584c.64 1.728 1.984 3.104 3.712 3.712l107.584 38.848a6.144 6.144 0 0 1 0 11.584l-107.584 38.848a6.144 6.144 0 0 0-3.712 3.712l-38.848 107.584a6.144 6.144 0 0 1-11.584 0L723.36 304.32a6.144 6.144 0 0 0-3.712-3.712L612.064 261.76a6.144 6.144 0 0 1 0-11.584l107.584-38.848a6.144 6.144 0 0 0 3.712-3.712l38.848-107.584c1.184-3.2 4.704-4.8 7.872-3.68zM576 160H384q-119.296 0-203.648 84.352Q96 328.704 96 448v192q0 119.296 84.352 203.648Q264.704 928 384 928h256q119.296 0 203.648-84.352Q928 759.296 928 640V512h-64v128q0 92.8-65.6 158.4Q732.8 864 640 864H384q-92.8 0-158.4-65.6Q160 732.8 160 640V448q0-92.8 65.6-158.4Q291.2 224 384 224h192v-64zm96 248.224L568.224 512 672 615.776l45.248-45.28L658.752 512l58.496-58.496L672 408.224zM320 608V448h64v160h-64z",stroke:"currentColor",strokeWidth:"28",strokeLinejoin:"round"})})}function TJ({tool:e}){let t=Bm(e);return t==="agent"?(0,A.jsx)(FF,{}):t==="ask"?(0,A.jsx)(hMe,{}):t==="edit"||t==="write"?(0,A.jsx)(iMe,{}):t==="fetch"?(0,A.jsx)(dMe,{}):t==="read"?(0,A.jsx)(AMe,{}):t==="todo"?(0,A.jsx)(cMe,{}):(0,A.jsx)(LJ,{})}function xF(e){let t=e.toLowerCase();return t==="web_fetch"||t==="webfetch"||t==="fetch"}function wMe(e,t){var a,l;if(((a=e.approval)==null?void 0:a.id)!==((l=t.approval)==null?void 0:l.id)||e.workspaceCwd!==t.workspaceCwd||e.summaryOnly!==t.summaryOnly||e.forceExpanded!==t.forceExpanded||e.detailsVisible!==t.detailsVisible||e.hideHeader!==t.hideHeader||e.hideCollapsedOutput!==t.hideCollapsedOutput)return!1;let s=e.tool,o=t.tool;return s.callId===o.callId&&s.toolName===o.toolName&&s.status===o.status&&s.subagentSessionReady===o.subagentSessionReady&&s.startTime===o.startTime&&s.endTime===o.endTime&&s.subContent===o.subContent&&s.rawOutput===o.rawOutput&&s.args===o.args&&s.content===o.content&&s.title===o.title&&uMe(s.subTools,o.subTools)}function uMe(e,t){if(e===t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let a=0;a<e.length;a++){let l=e[a],s=t[a];if(l.callId!==s.callId||l.toolName!==s.toolName||l.status!==s.status||l.subagentSessionReady!==s.subagentSessionReady||l.endTime!==s.endTime||l.rawOutput!==s.rawOutput||l.args!==s.args||l.subContent!==s.subContent||l.title!==s.title)return!1}return!0}var jH=/\[([^\]]+)\]\(qwen-session:\/\/([^)]+)\)/g;function DY(e,t){if(!e||!e.includes("qwen-session://"))return e;let a=[],l=0,s;for(jH.lastIndex=0;(s=jH.exec(e))!==null;){s.index>l&&a.push(e.slice(l,s.index));let o=s[2];a.push(t!=="interactive"?(0,A.jsx)("span",{style:{textDecoration:"underline"},children:s[1]},s.index):(0,A.jsx)("a",{href:"#",role:"button",style:{textDecoration:"underline",cursor:"pointer"},onClick:r=>{r.preventDefault(),r.stopPropagation(),window.dispatchEvent(new CustomEvent("qwen:open-session",{detail:o}))},children:s[1]},s.index)),l=s.index+s[0].length}return l<e.length&&a.push(e.slice(l)),a.length===1?a[0]:(0,A.jsx)(A.Fragment,{children:a})}var vF=(0,I.memo)(function({tool:e,approval:t,workspaceCwd:a,summaryOnly:l=!1,forceExpanded:s=!1,detailsVisible:o=!0,hideHeader:r=!1,hideCollapsedOutput:n=!1}){let{t:i}=it(),d=Ra(),c=ox(),h=Q5(),{hostOwnsEditDiffPreview:w}=fr(),u=h!==void 0,g=ac(e.rawOutput),p=s||!!g,f=t?.toolCallId===e.callId,B=!!(w&&f&&t!=null&&t.hasDiffPreview&&zH(t?.toolName??e.toolName)),b=B,[C,Q]=(0,I.useState)(!1),[x,F]=(0,I.useState)(()=>p||!l&&TH(e)&&!b),E=(0,I.useRef)(null),M=(0,I.useRef)(!1),Y=qF(e.toolName);(0,I.useEffect)(()=>{F(p||!l&&TH(e)&&!b),Q(!1),E.current=null,M.current=!1},[p,b,u,l,e.callId,e.toolName]);let v=ks(e),S=!f&&t?.toolCallId&&v&&Br(e,t.toolCallId),G=!!(B||w&&S&&t!=null&&t.hasDiffPreview&&zH(t.toolName??"")),J=Tl(e.status),W=J&&!Ho(e.toolName)&&!xF(e.toolName)&&!G,X=nx(W);if((0,I.useEffect)(()=>{!p&&!v&&e.status==="completed"&&!M.current&&F(!1)},[p,v,e.status]),v){let ae=SJ(e,X),Ve=ae.explicitAgentType?`${i("agent.label")} (${Bp(ae.explicitAgentType,i)})`:i("agent.label"),be=e.status==="completed"||e.status==="failed",Te=br(e),H=[Te&&!be?i("subagent.background"):e.status==="pending"?i("subagent.pending"):i("subagent.running"),Te&&!be||G?"":ae.elapsed].filter(Boolean).join(" \xB7 "),he=[ae.subToolCount>0?i("subagent.toolsCount",{count:ae.subToolCount}):"",ae.elapsed,ae.tokens,ae.reason?fl(ae.reason,80):""].filter(Boolean).join(" \xB7 "),we=s||x||!!S,Se=!!f,Je=Zr(e),bt=(0,A.jsx)(sx,{tool:e,approval:w?t:void 0,hideHeader:!0,defaultExpanded:!0,inline:!0});if(c&&!r){let ot=(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(FF,{}),(0,A.jsx)(pw,{status:be?ae.status:e.status}),(0,A.jsx)("span",{className:Me.lineName,children:Ve}),(0,A.jsx)(sp,{info:{kind:"agent",tool:e,displayName:Ve,description:ae.description?fl(ae.description,60):"",elapsed:be?he:H,workspaceCwd:a}})]});return(0,A.jsx)("div",{className:Me.line,"data-transcript-tool-call-id":e.callId,children:Se?(0,A.jsx)("div",{className:`${Me.lineMain} ${Me.lineButton}`,"aria-disabled":"true",children:ot}):(0,A.jsxs)("button",{type:"button",className:`${Me.lineMain} ${Me.lineExpandable} ${Me.lineButton}`,"aria-disabled":!!Je||void 0,title:Je?i(Je):void 0,onClick:()=>{Je||c.onOpen(e)},children:[ot,(0,A.jsx)("span",{className:Me.lineChevronRight,"aria-hidden":"true"})]})})}return(0,A.jsxs)("div",{className:Me.line,"data-transcript-tool-call-id":e.callId,children:[!r&&(0,A.jsxs)("div",{className:`${Me.lineMain} ${Se?"":Me.lineExpandable}`,"aria-disabled":!!Je||void 0,title:Je?i(Je):void 0,onClick:Se||Je?void 0:()=>F(!x),children:[(0,A.jsx)(FF,{}),(0,A.jsx)(pw,{status:be?ae.status:e.status}),(0,A.jsx)("span",{className:Me.lineName,children:Ve}),(0,A.jsx)(sp,{info:{kind:"agent",tool:e,displayName:Ve,description:ae.description?fl(ae.description,60):"",elapsed:be?he:H,workspaceCwd:a}}),!Se&&(0,A.jsx)("span",{className:x?Me.lineChevronDown:Me.lineChevronRight,"aria-hidden":"true"})]}),we&&(0,A.jsx)("div",{className:Me.lineDetail,children:r?(0,A.jsx)("div",{className:Me.expandedAgentCard,children:bt}):bt})]})}let O=s5(e,a),_=Yce(e),q=l&&Ho(e.toolName)?o5(e,a):O,Ae=mw(e.toolName,i),N=G||Ho(e.toolName)||xF(e.toolName)?"":Em(e.startTime,J?X:e.endTime),ce=e.toolName.toLowerCase(),j=ce==="monitor"&&u&&!C&&!r,D=sc(ce),le=D?m5(e):void 0,ge=!!le&&le.length>0,de=le?le.filter(ae=>ae.status==="completed").length:0,P=Ho(ce),re=ce==="grep"||ce==="grep_search"||ce==="search"||ce==="glob",ie=ce==="read"||ce==="read_file"||ce==="readfile",$=!D&&lMe(q),oe=!p&&!b,me=j||oe,Ce=()=>{M.current=!0,F(ae=>!ae)},K=()=>{Q(!0),oe&&Ce()},Be=()=>{h&&UJ(E,()=>h.onOpen(e),K)},et=Sye(e),ve=x&&$,at=ie,dt=ve&&!P&&!re&&!ie,ut=O,Tt=x&&!et&&(!D||!ge&&!_);return(0,A.jsxs)("div",{className:Me.line,"data-transcript-tool-call-id":e.callId,children:[r&&J&&N&&(0,A.jsx)("div",{className:Me.lineMain,children:(0,A.jsx)(sp,{info:{kind:Bm(e),tool:e,displayName:Ae,description:"",elapsed:N,workspaceCwd:a}})}),!r&&(0,A.jsxs)("div",{className:`${Me.lineMain} ${me?Me.lineExpandable:""}`,title:j?void 0:oe?i(x?"tool.collapseHint":"tool.expand"):void 0,"aria-expanded":j?void 0:oe?x:void 0,role:me?"button":void 0,tabIndex:me?0:void 0,onClick:me?()=>{if(j){Be();return}Ce()}:void 0,onKeyDown:me?ae=>{if(!(ae.key!=="Enter"&&ae.key!==" ")){if(ae.preventDefault(),j){Be();return}Ce()}}:void 0,children:[(0,A.jsx)(TJ,{tool:e}),(0,A.jsx)(pw,{status:e.status}),(0,A.jsx)("span",{className:Me.lineName,children:Ae}),D&&ge&&(0,A.jsxs)("span",{className:Me.todoProgress,children:[de,"/",le.length]}),(0,A.jsx)(sp,{info:{kind:Bm(e),tool:e,displayName:Ae,description:D||dt?"":q,elapsed:D?"":N,workspaceCwd:a}}),me&&(0,A.jsx)("span",{className:!j&&x?Me.lineChevronDown:Me.lineChevronRight,"aria-hidden":"true"})]}),g&&(!l||x)&&(0,A.jsx)(Uye,{display:g}),!g&&(!l||x)&&D&&ge&&(0,A.jsx)(Xye,{tool:e,todos:le,expanded:x,title:Ae}),!g&&(!l||x)&&D&&!ge&&_&&(0,A.jsx)("div",{className:Me.lineOutput,children:DY(_,d)}),!g&&Tt&&(0,A.jsx)(ip,{title:Ae,detail:ut,status:e.status,children:_&&(0,A.jsx)("div",{className:`${Me.lineOutput} ${Me.expandedLineOutput}`,children:DY(_,d)})}),!g&&!D&&!n&&_&&!Tt&&(!x||!et)&&(!l||x)&&(0,A.jsx)("div",{className:x?`${Me.lineOutput} ${Me.expandedLineOutput}`:Me.lineOutput,children:DY(_,d)}),!g&&!D&&x&&et&&(!Y||o)&&(0,A.jsx)("div",{className:Y?`${Me.lineDetail} ${Me.workflowLineDetail}`:at?`${Me.lineDetail} ${Me.markdownLineDetail}`:Me.lineDetail,children:Y?(0,A.jsx)(Zye,{tool:e,displayName:Ae,detail:ut,result:_}):ie?(0,A.jsx)(ip,{title:Ae,status:e.status,children:(0,A.jsx)(Vye,{tool:e})}):(0,A.jsxs)(ip,{title:Ae,detail:ut,status:e.status,children:[Ho(ce)&&(0,A.jsx)(Wye,{tool:e}),(ce==="write_file"||ce==="writefile")&&(0,A.jsx)(LH,{tool:e}),(ce==="edit"||ce==="write"||ce==="editfile")&&(0,A.jsx)(LH,{tool:e}),_r(e.toolName)&&(0,A.jsx)($ye,{tool:e}),XF(ce)&&(0,A.jsx)(eMe,{tool:e})]})})]})},wMe),gMe=(0,I.memo)(function({isStreaming:e,expanded:t,documentMode:a,translateContent:l,generateContent:s,onToggle:o}){let{language:r,t:n}=it();return(0,A.jsxs)("div",{className:`${Me.chatSummaryThoughtHeader}${t?` ${Me.chatSummaryThoughtHeaderExpanded}`:""}`,onClick:i=>{!a&&i.currentTarget.contains(i.target)&&o()},children:[(0,A.jsxs)("button",{type:"button",disabled:a,tabIndex:a?-1:void 0,className:Me.chatSummaryThoughtSummary,"data-testid":"compact-thinking-summary","aria-expanded":a?void 0:t,title:a?void 0:n(t?"thinking.collapse":"thinking.expand"),children:[(0,A.jsx)("span",{className:Me.chatSummaryThoughtIcon,"aria-hidden":"true",children:(0,A.jsx)(PF,{})}),(0,A.jsx)("span",{className:`${Me.chatSummaryThoughtLabel}${e?` ${Me.chatSummaryThoughtLabelActive}`:""}`,children:n(e?"thinking.running":"thinking.done")})]}),r==="zh-CN"&&l!==void 0&&s&&(0,A.jsx)(_8,{content:l,generateContent:s,className:Me.chatSummaryThoughtTranslate}),(0,A.jsx)("span",{className:t?Me.chatSummaryThoughtChevronDown:Me.chatSummaryThoughtChevronRight,"aria-hidden":"true"})]})}),UY=(0,I.memo)(function({content:e,isStreaming:t,generateContent:a}){let l=Ra()==="document",s=mm(),[o,r]=(0,I.useState)(!1),n=l?s:o,i=(0,I.useCallback)(()=>{l||r(d=>!d)},[l]);return(0,A.jsxs)("div",{className:Me.chatSummaryThought,children:[(0,A.jsx)(gMe,{isStreaming:t,expanded:n,documentMode:l,translateContent:l||t?void 0:e,generateContent:a,onToggle:i}),n&&(0,A.jsx)("div",{className:Me.chatSummaryThoughtContent,children:(0,A.jsx)(ti,{content:e,source:"thinking"})})]})}),pMe=(0,I.memo)(function({tools:e,compactSummary:t=!1,thoughts:a,pendingApproval:l,workspaceCwd:s,isLocateFlashing:o=!1,generateContent:r}){let{t:n}=it(),i=Ra()==="document",d=mm(),c=ox(),h=Q5(),w=h!==void 0,[u,g]=(0,I.useState)(!1),[p,f]=(0,I.useState)(!1),B=i?d:p,b=(0,I.useRef)(null),C=RF(e),Q=e.find(de=>Tl(de.status)&&!br(de))??(e.length>0?sMe(e):void 0),x=e.length===1?e[0]:void 0,F=!!(a!=null&&a.length),E=x&&ks(x)?x:void 0,M=x&&x.toolName.toLowerCase()==="monitor"?x:void 0,Y=x?ac(x.rawOutput):void 0,v=Y?.resourceUri,S=e.some(de=>ac(de.rawOutput)),G=e.some(de=>qF(de.toolName)),J=e.some(de=>Tl(de.status)&&!br(de)),W=a?.find(de=>de.isStreaming),X=C&&J?!0:W!==void 0,O=!X&&e.some(de=>Tl(de.status)&&br(de)),_=!!(!t&&E&&c),q=!!(!t&&M&&w&&!u),Ae=_||q,N=!t&&E?Zr(E):void 0,ce=C?Q??e[0]:e[0],j=l?.toolCallId&&e.some(de=>Br(de,l.toolCallId)),D=new Map,le=new Set;for(let de=0;t&&de<e.length;de++){if(!ks(e[de]))continue;let P=de+1;for(;P<e.length&&ks(e[P]);)P++;if(P-de>=2){let re=e.slice(de,P);D.set(re[0].callId,re);for(let ie of re.slice(1))le.add(ie.callId)}de=P-1}(0,I.useEffect)(()=>{g(!1),f(!1),b.current=null},[w,M?.callId]),(0,I.useEffect)(()=>{(v||S)&&f(!0)},[v,S]);let ge=()=>{!M||!h||UJ(b,()=>h.onOpen(M),()=>{g(!0),f(de=>!de)})};return j?(0,A.jsx)("div",{className:`${Me.group}${o?` ${Yd.flash}`:""}`,children:e.map(de=>(0,A.jsx)(vF,{tool:de,approval:l,workspaceCwd:s,forceExpanded:i},de.callId))}):(0,A.jsxs)("div",{className:o?Yd.flash:void 0,children:[(0,A.jsxs)("button",{type:"button",disabled:i,"aria-disabled":!!N||void 0,tabIndex:i?-1:void 0,className:Me.chatSummary,onClick:()=>{if(!(i||N)){if(_&&E&&c){c.onOpen(E);return}if(q&&M&&h){ge();return}f(de=>!de)}},"aria-expanded":i||Ae?void 0:p,title:N?n(N):i||Ae?void 0:n(B?"tool.collapseHint":"tool.expand"),children:[(0,A.jsx)("span",{className:O?`${Me.chatSummaryIcon} ${Me.chatSummaryIconDetached}`:Me.chatSummaryIcon,"aria-hidden":"true",children:W?(0,A.jsx)(PF,{}):ce?(0,A.jsx)(TJ,{tool:ce}):(0,A.jsx)(LJ,{})}),(0,A.jsx)("span",{className:X?`${Me.chatSummaryText} ${Me.chatSummaryTextActive}`:Me.chatSummaryText,children:W?n("thinking.running"):x?(0,A.jsx)(rMe,{tool:x,workspaceCwd:s}):oMe(e,n,s,t)}),(0,A.jsx)("span",{className:B?Me.chatChevronDown:Me.chatChevronRight,"aria-hidden":"true"})]}),(B||S||G)&&(0,A.jsx)("div",{"aria-hidden":!B,ref:de=>{de?.toggleAttribute("inert",!B)},className:B?Me.chatSummaryContentClip:`${Me.chatSummaryContentClip} ${Me.chatSummaryContentCollapsed}`,style:!B&&S&&!G?{display:"none"}:void 0,children:(0,A.jsx)("div",{className:Me.chatSummaryContentInner,children:(0,A.jsxs)("div",{className:`${Me.group} ${Me.chatSummaryGroup}`,children:[e.map(de=>{if(le.has(de.callId))return null;let P=D.get(de.callId);return(0,A.jsxs)(I.Fragment,{children:[a?.filter(re=>re.beforeToolCallId===de.callId).map((re,ie)=>(0,A.jsx)(UY,{content:re.content,isStreaming:re.isStreaming,generateContent:r},`thought-${de.callId}-${ie}`)),P?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("div",{className:Me.chatSummaryParallelAgents,"data-testid":"compact-parallel-agents",children:(0,A.jsx)(f5,{agents:P,pendingApproval:l})}),P.slice(1).flatMap(re=>a?.filter(ie=>ie.beforeToolCallId===re.callId).map((ie,$)=>(0,A.jsx)(UY,{content:ie.content,isStreaming:ie.isStreaming,generateContent:r},`thought-${re.callId}-${$}`)))]}):(0,A.jsx)(vF,{tool:de,approval:l,workspaceCwd:s,summaryOnly:!x||F,forceExpanded:i||!!x&&!F,detailsVisible:B,hideHeader:!!x&&!F})]},de.callId)}),a?.filter(de=>de.beforeToolCallId===void 0).map((de,P)=>(0,A.jsx)(UY,{content:de.content,isStreaming:de.isStreaming,generateContent:r},`thought-trailing-${P}`))]})})})]})}),Sx="summary-",jJ=e=>`${Sx}${e}`,HJ=e=>e.startsWith(Sx),JJ=e=>HJ(e)?e.slice(Sx.length):void 0,bMe="_message_1ujhf_1",BMe="_header_1ujhf_6",fMe="_headerStatic_1ujhf_7",mMe="_chevron_1ujhf_24",IMe="_title_1ujhf_30",CMe="_progress_1ujhf_39",Bd={message:bMe,header:BMe,headerStatic:fMe,chevron:mMe,title:IMe,progress:CMe};function QMe({id:e,todos:t}){var a;let l=((a=(0,I.useContext)(GF).get(e))==null?void 0:a.events)??[];return(0,A.jsx)(E5,{todos:t,events:l})}var EMe=(0,I.memo)(function({id:e,todos:t,isLocateFlashing:a=!1}){let{t:l}=it(),s=Ra()==="document",o=mm(),[r,n]=(0,I.useState)(!1);if(t.length===0)return null;let i=s?o:r,d=t.length,c=t.filter(h=>h.status==="completed").length;return(0,A.jsxs)("div",{className:`${Bd.message}${a?` ${Yd.flash}`:""}`,children:[s?(0,A.jsxs)("div",{className:Bd.headerStatic,children:[(0,A.jsx)("span",{className:Bd.title,children:l("plan.title")}),(0,A.jsxs)("span",{className:Bd.progress,children:[c,"/",d]})]}):(0,A.jsxs)("button",{type:"button",className:Bd.header,onClick:()=>n(h=>!h),"aria-expanded":r,title:l(r?"todo.collapse":"todo.expand"),children:[(0,A.jsx)("span",{className:Bd.chevron,"aria-hidden":"true",children:r?"\u25BE":"\u25B8"}),(0,A.jsx)("span",{className:Bd.title,children:l("plan.title")}),(0,A.jsxs)("span",{className:Bd.progress,children:[c,"/",d]})]}),i?(0,A.jsx)(y5,{todos:t,numbered:!0}):(0,A.jsx)(QMe,{id:e,todos:t})]})}),yMe="_message_1abcu_1",MMe="_content_1abcu_11",YMe="_question_1abcu_17",FMe="_prefix_1abcu_24",xMe="_answer_1abcu_28",vMe="_pending_1abcu_32",kMe="_shortcuts_1abcu_36",OA={message:yMe,content:MMe,question:YMe,prefix:FMe,answer:xMe,pending:vMe,shortcuts:kMe},NMe=(0,I.memo)(function({question:e,answer:t,isPending:a}){let{t:l}=it();return(0,A.jsxs)("div",{className:OA.message,children:[(0,A.jsxs)("div",{className:OA.content,children:[(0,A.jsxs)("div",{className:OA.question,children:[(0,A.jsx)("span",{className:OA.prefix,children:"/btw "}),(0,A.jsx)("span",{children:e})]}),(0,A.jsx)("div",{className:OA.answer,children:a?(0,A.jsx)("span",{className:OA.pending,children:l("btw.answering")}):(0,A.jsx)(ti,{content:t})})]}),(0,A.jsx)("div",{className:OA.shortcuts,children:l(a?"btw.shortcuts.pending":"btw.shortcuts.done")})]})}),DMe="_message_1g0wi_1",UMe="_header_1g0wi_21",SMe="_status_1g0wi_30",GMe="_name_1g0wi_35",zMe="_command_1g0wi_42",RMe="_output_1g0wi_51",dw={message:DMe,header:UMe,status:SMe,name:GMe,command:zMe,output:RMe},LMe=(0,I.memo)(function({command:e,output:t}){let{t:a}=it();return(0,A.jsxs)("div",{className:dw.message,children:[(0,A.jsxs)("div",{className:dw.header,children:[(0,A.jsx)("span",{className:dw.status,children:"\u2713"}),(0,A.jsx)("span",{className:dw.name,children:a("shell.command")}),e&&(0,A.jsx)("span",{className:dw.command,children:e})]}),t&&(0,A.jsx)("pre",{className:dw.output,children:t})]})}),TMe="_progress_1ik59_1",jMe="_spinner_1ik59_12",HMe="_bar_1ik59_19",JMe="_stage_1ik59_25",WMe="_icon_1ik59_29",VMe="_done_1ik59_35",KMe="_error_1ik59_43",OMe="_detail_1ik59_51",PMe="_path_1ik59_56",qMe="_pathButton_1ik59_61",xl={progress:TMe,spinner:jMe,bar:HMe,stage:JMe,icon:WMe,done:VMe,error:KMe,detail:OMe,path:PMe,pathButton:qMe},HH=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827"];function XMe({progress:e}){let{stage:t,progress:a,detail:l,isComplete:s,error:o}=e,[r,n]=(0,I.useState)(0),i=30,d=Math.round(a/100*i),c=i-d,h="\u2588".repeat(Math.max(0,d))+"\u2591".repeat(Math.max(0,c));return(0,I.useEffect)(()=>{if(s||o)return;let w=setInterval(()=>{n(u=>(u+1)%HH.length)},120);return()=>clearInterval(w)},[s,o]),o?(0,A.jsxs)("div",{className:`${xl.progress} ${xl.error}`,children:[(0,A.jsx)("span",{className:xl.icon,children:"\u2715"}),(0,A.jsx)("span",{className:xl.stage,children:t}),(0,A.jsx)("div",{className:xl.detail,children:o})]}):s?(0,A.jsxs)("div",{className:`${xl.progress} ${xl.done}`,children:[(0,A.jsx)("span",{className:xl.icon,children:"\u2713"}),(0,A.jsx)("span",{className:xl.stage,children:t})]}):(0,A.jsxs)("div",{className:xl.progress,children:[(0,A.jsx)("span",{className:xl.spinner,children:HH[r]}),(0,A.jsx)("span",{className:xl.bar,children:h}),(0,A.jsxs)("span",{className:xl.stage,children:[t,l?` (${l})`:""]})]})}function ZMe({path:e,onInsightReportOpen:t}){let{t:a}=it();return(0,A.jsxs)("div",{className:`${xl.progress} ${xl.done}`,children:[(0,A.jsx)("span",{className:xl.icon,children:"\u2713"}),(0,A.jsx)("span",{className:xl.stage,children:a("insight.ready")}),t?(0,A.jsx)("button",{type:"button",className:`${xl.path} ${xl.pathButton}`,onClick:()=>t(e),children:e}):(0,A.jsx)("span",{className:xl.path,children:e})]})}var _Me=(0,I.memo)(function({message:e,pendingApproval:t,onShowContextDetail:a,onImagePreview:l,onAttachmentPreview:s,onInsightReportOpen:o,workspaceCwd:r,showRetryHint:n=!1,onRetryClick:i,sendFailed:d=!1,onRetrySend:c,onEditUserMessage:h,onBranchSession:w,branchRecordId:u,showAssistantActions:g=!1,showAssistantBranch:p=!1,isLocateFlashing:f=!1,assistantTurnFooterInfo:B,generateContent:b}){let{t:C}=it(),Q=(0,I.useMemo)(()=>w&&u?()=>w(u):void 0,[w,u]),x=(0,I.useContext)(SF),F=e.role==="user"||e.role==="system"&&e.source==="mid_turn_message_injected",E=(()=>{switch(e.role){case"user":return(0,A.jsx)(X8,{content:e.content,images:e.images,files:e.files,inputAnnotations:e.inputAnnotations,isLocateFlashing:f,sendFailed:d,onRetrySend:c,onEdit:h,onImagePreview:l,onAttachmentPreview:s});case"assistant":return(0,A.jsx)(NAe,{content:e.content,isStreaming:e.isStreaming,timestamp:e.timestamp,onBranchSession:Q,showFooterActions:g,showBranchAction:p,isLocateFlashing:f,customFooterInfo:B});case"thinking":return(0,A.jsx)(RAe,{content:e.content,isStreaming:e.isStreaming,timestamp:e.timestamp,isLocateFlashing:f,generateContent:b});case"tool_group":return(0,A.jsx)(pMe,{tools:e.tools,thoughts:e.thoughts,compactSummary:x&&HJ(e.id),pendingApproval:t,workspaceCwd:r,isLocateFlashing:f,generateContent:b});case"plan":return(0,A.jsx)(EMe,{id:e.id,todos:e.todos,isLocateFlashing:f});case"system":return(0,A.jsx)(mbe,{content:e.content,variant:e.variant,source:e.source,data:e.data,images:e.images,files:e.files,onShowContextDetail:a,onImagePreview:l,onAttachmentPreview:s,showRetryHint:n&&e.retryable===!0,onRetryClick:i});case"user_shell":return(0,A.jsx)(LMe,{command:e.command,output:e.output});case"btw":return(0,A.jsx)(NMe,{question:e.question,answer:e.answer,isPending:e.isPending});case"insight_progress":return(0,A.jsx)(XMe,{progress:{stage:e.stage,progress:e.progress,detail:e.detail}});case"insight_ready":return(0,A.jsx)(ZMe,{path:e.path,onInsightReportOpen:o});case"insight_error":return(0,A.jsx)("div",{style:{color:"var(--error-color, #e06c75)"},children:e.error});default:return null}})();if(E===null)return null;let M=(0,A.jsx)(bw,{label:`message:${e.role}`,resetKeys:[e],fallback:(0,A.jsx)($Me,{align:F?"end":"start"}),children:E}),Y=(0,A.jsx)("div",{"data-user-selectable":"true",style:{display:"contents"},children:M});return e.role==="assistant"?g?Y:(0,A.jsx)(OY,{timestamp:e.timestamp,children:Y}):e.role==="system"&&e.source==="prompt_cancelled"?Y:(0,A.jsx)(OY,{timestamp:e.timestamp,chatMode:F,toolGroupSpacing:e.role==="tool_group"&&x,copyText:F?e.content:void 0,copyTitle:C("common.copy"),children:Y})},e1e);function $Me({align:e}){let{t}=it();return(0,A.jsx)("div",{role:"alert",style:{display:"flex",justifyContent:e==="end"?"flex-end":"flex-start"},children:(0,A.jsx)("span",{style:{color:"var(--error-color, #e06c75)",fontSize:"0.85em",opacity:.85},children:t("message.renderError")})})}function e1e(e,t){var a,l;return((a=e.pendingApproval)==null?void 0:a.id)!==((l=t.pendingApproval)==null?void 0:l.id)||e.onShowContextDetail!==t.onShowContextDetail||e.onImagePreview!==t.onImagePreview||e.onAttachmentPreview!==t.onAttachmentPreview||e.workspaceCwd!==t.workspaceCwd||e.showRetryHint!==t.showRetryHint||e.onRetryClick!==t.onRetryClick||e.sendFailed!==t.sendFailed||e.onRetrySend!==t.onRetrySend||e.onEditUserMessage!==t.onEditUserMessage||e.onInsightReportOpen!==t.onInsightReportOpen||e.onBranchSession!==t.onBranchSession||e.branchRecordId!==t.branchRecordId||e.showAssistantActions!==t.showAssistantActions||e.showAssistantBranch!==t.showAssistantBranch||e.isLocateFlashing!==t.isLocateFlashing||e.generateContent!==t.generateContent||!t1e(e.assistantTurnFooterInfo,t.assistantTurnFooterInfo)?!1:a1e(e.message,t.message)}function t1e(e,t){return e===t?!0:!e||!t?!1:e.turnId===t.turnId&&e.message.id===t.message.id&&e.message.content===t.message.content&&e.message.isStreaming===t.message.isStreaming&&e.message.timestamp===t.message.timestamp}function a1e(e,t){if(e===t)return!0;if(e.id!==t.id||e.role!==t.role||e.timestamp!==t.timestamp)return!1;switch(e.role){case"user":return t.role==="user"&&e.content===t.content&&WH(e.images,t.images);case"assistant":return t.role==="assistant"&&e.content===t.content&&e.isStreaming===t.isStreaming;case"thinking":return t.role==="thinking"&&e.content===t.content&&e.isStreaming===t.isStreaming;case"system":return t.role==="system"&&e.content===t.content&&e.variant===t.variant&&e.retryable===t.retryable&&e.source===t.source&&e.data===t.data&&WH(e.images,t.images);case"user_shell":return t.role==="user_shell"&&e.command===t.command&&e.output===t.output&&e.cwd===t.cwd;case"btw":return t.role==="btw"&&e.question===t.question&&e.answer===t.answer&&e.isPending===t.isPending;case"insight_progress":return t.role==="insight_progress"&&e.stage===t.stage&&e.progress===t.progress&&e.detail===t.detail;case"insight_ready":return t.role==="insight_ready"&&e.path===t.path;case"insight_error":return t.role==="insight_error"&&e.error===t.error;case"plan":return t.role==="plan"&&l1e(e.todos,t.todos);case"tool_group":return t.role==="tool_group"&&s1e(e.thoughts,t.thoughts)&&e.tools.length===t.tools.length&&e.tools.every((a,l)=>WJ(a,t.tools[l]));default:return!1}}function l1e(e,t){return e.length===t.length&&e.every((a,l)=>{let s=t[l];return s&&a.id===s.id&&a.content===s.content&&a.status===s.status&&a.priority===s.priority})}function WJ(e,t){return t?e.callId===t.callId&&e.toolName===t.toolName&&e.status===t.status&&e.subagentSessionReady===t.subagentSessionReady&&e.title===t.title&&e.kind===t.kind&&e.startTime===t.startTime&&e.endTime===t.endTime&&e.subContent===t.subContent&&fd(e.args)===fd(t.args)&&fd(e.rawOutput)===fd(t.rawOutput)&&fd(e.locations)===fd(t.locations)&&fd(e.content)===fd(t.content)&&o1e(e.subTools,t.subTools):!1}function s1e(e,t){return e===t?!0:!e||!t||e.length!==t.length?!1:e.every((a,l)=>{var s,o,r;return a.content===((s=t[l])==null?void 0:s.content)&&a.isStreaming===((o=t[l])==null?void 0:o.isStreaming)&&a.beforeToolCallId===((r=t[l])==null?void 0:r.beforeToolCallId)})}function o1e(e,t){return!e&&!t?!0:!e||!t||e.length!==t.length?!1:e.every((a,l)=>WJ(a,t[l]))}var JH=new WeakMap;function WH(e,t){return e===t?!0:!e||!t||e.length!==t.length?!1:e.every((a,l)=>a.data===t[l].data&&a.mimeType===t[l].mimeType)}function fd(e){if(e===void 0)return"";if(e!==null&&typeof e=="object"){let t=JH.get(e);if(t!==void 0)return t;try{t=JSON.stringify(e)}catch{t=String(e)}return JH.set(e,t),t}try{return JSON.stringify(e)}catch{return String(e)}}function VH({additions:e,deletions:t,className:a,additionsClassName:l,deletionsClassName:s}){return e===void 0||t===void 0?null:(0,A.jsxs)("span",{className:a,children:[(0,A.jsxs)("span",{className:l,children:["+",e]}),(0,A.jsxs)("span",{className:s,children:["-",t]})]})}function r1e(e){if(!e.some(t=>t.additions===void 0||t.deletions===void 0))return e.reduce((t,a)=>({additions:t.additions+(a.additions??0),deletions:t.deletions+(a.deletions??0)}),{additions:0,deletions:0})}function n1e(e,t){if(!e||!t)return;let a=e.workspaces;if(a){let l=a.filter(o=>o.cwd===t),s=l[0];return l.length!==1||!(s!=null&&s.id)||s.trusted!==!0||a.filter(o=>o.id===s.id).length!==1||s.primary!==(s.cwd===e.workspaceCwd)?void 0:i1e(s)}if(e.workspaceCwd===t)return{cwd:t,primary:!0}}function i1e(e){return{cwd:e.cwd,id:e.id,primary:e.primary}}function d1e(e,t){return e?.cwd===t.cwd&&e.id===t.id&&e.primary===t.primary}function A1e(e){var t;let a=tx(),l=Che(),s=(0,I.useMemo)(()=>n1e(a.capabilities,e),[a.capabilities,e]),o=(0,I.useRef)(void 0);s?d1e((t=o.current)==null?void 0:t.owner,s)||(o.current={owner:s}):o.current=void 0;let r=o.current,n=(0,I.useRef)(void 0);(0,I.useEffect)(()=>{if(!r){n.current=void 0;return}let d={};return n.current=d,()=>{queueMicrotask(()=>{n.current===d&&o.current===r&&(o.current=void 0)})}},[r]);let i=(0,I.useMemo)(()=>{if(!r)return;let d=r,c=()=>{let w=o.current;if(w!==d)throw new Error("Workspace artifact owner is no longer available");return w.owner},h=w=>{let u=c();if(u.id!==w)throw new Error("Scheduled task workspace owner no longer matches");return u};return{async readWorkspaceFile(w){let u=c(),g=await(u.primary?l.readWorkspaceFile(w):a.client.workspaceByCwd(u.cwd).readWorkspaceFile(w));return c(),g},async readFileBytes(w,u){let g=c(),p=await(g.primary?l.readFileBytes(w,u):a.client.workspaceByCwd(g.cwd).readWorkspaceFileBytes(w,u));return c(),p},async stat(w){let u=c(),g=await(u.primary?l.stat(w):a.client.workspaceByCwd(u.cwd).fileStat(w));return c(),g},async listScheduledTasks(w){h(w);let u=await l.listScheduledTasks(w);return h(w),u},async updateScheduledTask(w,u,g){h(g);let p=await l.updateScheduledTask(w,u,g);return h(g),p},async deleteScheduledTask(w,u){h(u),await l.deleteScheduledTask(w,u),h(u)}}},[r,l,a.client]);if(!(!r||!i))return{workspaceCwd:r.owner.cwd,...r.owner.id?{workspaceId:r.owner.id}:{},actions:i}}var c1e="_root_n9pre_1",h1e="_card_n9pre_7",w1e="_summary_n9pre_14",u1e="_icon_n9pre_22",g1e="_iconSvg_n9pre_33",p1e="_title_n9pre_39",b1e="_reviewSummary_n9pre_46",B1e="_reviewSummaryWithStats_n9pre_53",f1e="_reviewMeta_n9pre_58",m1e="_linkButton_n9pre_65",I1e="_reviewButton_n9pre_66",C1e="_showMoreButton_n9pre_67",Q1e="_actions_n9pre_96",E1e="_openButtonWrapper_n9pre_102",y1e="_list_n9pre_126",M1e="_fileRow_n9pre_133",Y1e="_path_n9pre_153",F1e="_lineStats_n9pre_162",x1e="_additions_n9pre_171",v1e="_deletions_n9pre_175",k1e="_chevronIcon_n9pre_189",N1e="_chevronIconOpen_n9pre_197",D1e="_artifactInfo_n9pre_201",U1e="_artifactMeta_n9pre_206",Qt={root:c1e,card:h1e,summary:w1e,icon:u1e,iconSvg:g1e,title:p1e,reviewSummary:b1e,reviewSummaryWithStats:B1e,reviewMeta:f1e,linkButton:m1e,reviewButton:I1e,showMoreButton:C1e,actions:Q1e,openButtonWrapper:E1e,list:y1e,fileRow:M1e,path:Y1e,lineStats:F1e,additions:x1e,deletions:v1e,chevronIcon:k1e,chevronIconOpen:N1e,artifactInfo:D1e,artifactMeta:U1e},kF=3;function KH(e,t){return t?e:e.slice(0,kF)}function S1e({turnId:e,changes:t,artifacts:a,scheduledTasks:l,workspaceCwd:s,onOpenRequest:o,onReviewChanges:r,onOpenArtifact:n,onOpenScheduledTask:i,onError:d}){let{t:c}=it(),h=A1e(s),w=h?.actions,[u,g]=(0,I.useState)(!1),[p,f]=(0,I.useState)(!1);if(t.length===0&&a.length===0&&l.length===0)return null;let B=KH(t,u),b=t.length-kF,C=KH(a,p),Q=a.length-kF,x=r1e(t),F=Y=>{if(o){o({id:"review",kind:"review",title:c("turnOutputs.review"),turnId:e,changes:t,...s?{workspaceCwd:s}:{},...h!=null&&h.workspaceId?{workspaceId:h.workspaceId}:{},...Y?{selectedPath:Y}:{}});return}r(t,Y)},E=Y=>{let v=T1e(Y,t,s);if(o){o({id:`artifact:${Y.id}`,kind:"artifact",title:Y.title??"Artifact",turnId:e,artifactId:Y.id,...Y.managedId?{managedId:Y.managedId}:{},artifact:Y,...s?{workspaceCwd:s}:{},...h!=null&&h.workspaceId?{workspaceId:h.workspaceId}:{},...v!==void 0?{previewContent:v}:{}});return}n(Y.id,v)},M=Y=>{if(o){o({id:`scheduled-task:${Y.toolCallId}`,kind:"scheduled_task",title:c("scheduledTasks.title"),turnId:e,task:h!=null&&h.workspaceId?{...Y,workspaceId:h.workspaceId}:Y,...s?{workspaceCwd:s}:{},...h!=null&&h.workspaceId?{workspaceId:h.workspaceId}:{}});return}i(Y)};return(0,A.jsxs)("div",{className:Qt.root,children:[t.length>0&&(0,A.jsxs)("div",{className:Qt.card,children:[(0,A.jsxs)("div",{className:Qt.summary,children:[(0,A.jsx)("span",{className:Qt.icon,"aria-hidden":"true",children:(0,A.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",focusable:"false",className:Qt.iconSvg,children:[(0,A.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",stroke:"currentColor",strokeWidth:"1.6"}),(0,A.jsx)("path",{d:"M9 9.5h6M12 6.5v6",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"}),(0,A.jsx)("path",{d:"M9 16h6",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})]})}),(0,A.jsxs)("div",{className:[Qt.reviewSummary,x?Qt.reviewSummaryWithStats:""].filter(Boolean).join(" "),children:[(0,A.jsx)("div",{className:Qt.title,children:c("turnOutputs.filesEdited",{count:t.length})}),(0,A.jsxs)("div",{className:Qt.reviewMeta,children:[(0,A.jsx)(VH,{additions:x?.additions,deletions:x?.deletions,className:Qt.lineStats,additionsClassName:Qt.additions,deletionsClassName:Qt.deletions}),(0,A.jsxs)("button",{type:"button",className:Qt.linkButton,onClick:()=>F(),children:[c("turnOutputs.viewChanges")," \u2197"]})]})]}),(0,A.jsx)("div",{className:Qt.actions,children:(0,A.jsx)("button",{type:"button",className:Qt.reviewButton,onClick:()=>F(),children:c("turnOutputs.review")})})]}),(0,A.jsxs)("div",{className:Qt.list,children:[B.map(Y=>(0,A.jsxs)("button",{type:"button",className:Qt.fileRow,onClick:()=>F(Y.path),title:Y.path,children:[(0,A.jsx)("span",{className:Qt.path,children:K1e(Y.path,s)}),(0,A.jsx)(VH,{additions:Y.additions,deletions:Y.deletions,className:Qt.lineStats,additionsClassName:Qt.additions,deletionsClassName:Qt.deletions})]},`${Y.toolCallId}:${Y.path}`)),b>0&&(0,A.jsxs)("button",{type:"button",className:Qt.showMoreButton,onClick:()=>g(Y=>!Y),children:[(0,A.jsx)("span",{children:u?c("turnOutputs.collapseFiles"):c("turnOutputs.showMoreFiles",{count:b})}),(0,A.jsx)(OH,{open:u})]})]})]}),C.map(Y=>(0,A.jsx)(G1e,{artifact:Y,onOpen:VJ(Y)?()=>E(Y):void 0,onError:d,onDownload:W1e(Y)&&w?v=>Eoe(w,Y.workspacePath,Y.mimeType,v):void 0},Y.id)),Q>0&&(0,A.jsxs)("button",{type:"button",className:Qt.showMoreButton,onClick:()=>f(Y=>!Y),children:[(0,A.jsx)("span",{children:p?c("turnOutputs.collapseArtifacts"):c("turnOutputs.showMoreArtifacts",{count:Q})}),(0,A.jsx)(OH,{open:p})]}),l.map(Y=>(0,A.jsx)(z1e,{task:Y,scheduleLabel:F8(Y.cron,c),onOpen:()=>M(Y)},Y.toolCallId))]})}function G1e({artifact:e,onOpen:t,onDownload:a,onError:l}){let{t:s}=it(),[o,r]=(0,I.useState)(!1),n=(0,I.useRef)(!0);(0,I.useEffect)(()=>(n.current=!0,()=>{n.current=!1}),[]);let i=Boe(e.sizeBytes),d=V1e(e,s),c=e.workspacePath&&rm(e.workspacePath).split("/").at(-1)||e.title,h=async()=>{if(!(!a||o)){r(!0);try{await a(()=>!n.current)}catch(w){if(!n.current)return;let u=s("common.downloadFailed",{message:nm(w)});l?l(new Error(u,{cause:w}),u):console.error(u,w)}finally{r(!1)}}};return(0,A.jsx)("div",{className:Qt.card,children:(0,A.jsxs)("div",{className:Qt.summary,children:[(0,A.jsx)("span",{className:Qt.icon,"aria-hidden":"true",children:(0,A.jsx)(Foe,{artifact:e,className:Qt.iconSvg})}),(0,A.jsxs)("div",{className:Qt.artifactInfo,children:[(0,A.jsx)("div",{className:Qt.title,children:e.title}),(0,A.jsx)("div",{className:Qt.artifactMeta,children:[boe(e),i].filter(Boolean).join(" \xB7 ")})]}),(0,A.jsxs)("div",{className:Qt.actions,children:[a&&(0,A.jsxs)("button",{type:"button",className:Qt.reviewButton,onClick:()=>void h(),title:`${s("common.download")} ${c}`,disabled:o,children:[(0,A.jsx)(Vu,{size:16,strokeWidth:1.8,"aria-hidden":"true"}),s(o?"common.downloading":"common.download")]}),(0,A.jsx)("span",{className:Qt.openButtonWrapper,title:d??e.title,children:(0,A.jsxs)("button",{type:"button",className:Qt.reviewButton,onClick:t,disabled:!t,children:[(0,A.jsx)(Oi,{size:16,strokeWidth:1.8,"aria-hidden":"true"}),s("common.open")]})})]})]})})}function z1e({task:e,scheduleLabel:t,onOpen:a}){let{t:l}=it();return(0,A.jsx)("div",{className:Qt.card,children:(0,A.jsxs)("div",{className:Qt.summary,children:[(0,A.jsx)("span",{className:Qt.icon,"aria-hidden":"true",children:(0,A.jsx)(R1e,{})}),(0,A.jsxs)("div",{className:Qt.artifactInfo,children:[(0,A.jsx)("div",{className:Qt.title,children:e.title}),(0,A.jsx)("div",{className:Qt.artifactMeta,children:[t,e.recurring?l("scheduledTasks.repeats"):l("scheduledTasks.runsOnce")].filter(Boolean).join(" \xB7 ")})]}),(0,A.jsx)("div",{className:Qt.actions,children:(0,A.jsx)("button",{type:"button",className:Qt.reviewButton,onClick:a,title:e.title,children:l("common.open")})})]})})}function R1e(){return(0,A.jsxs)("svg",{className:Qt.iconSvg,viewBox:"0 0 24 24",fill:"none",focusable:"false","aria-hidden":"true",children:[(0,A.jsx)("rect",{x:"4",y:"4",width:"16",height:"16",rx:"3",stroke:"currentColor",strokeWidth:"1.8"}),(0,A.jsx)("path",{d:"M12 8v4l3 2",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})]})}function OH({open:e}){return(0,A.jsx)("svg",{className:[Qt.chevronIcon,e?Qt.chevronIconOpen:""].filter(Boolean).join(" "),viewBox:"0 0 16 16",fill:"none",focusable:"false","aria-hidden":"true",children:(0,A.jsx)("path",{d:"m4 6 4 4 4-4",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"})})}var L1e=(0,I.memo)(S1e);function T1e(e,t,a){if(!H1e(e)||!e.workspacePath)return;let l=t.find(s=>yoe(s.path,e.workspacePath,a));if(l)return j1e(l)}function j1e(e){for(let t=e.diffs.length-1;t>=0;t--){let a=e.diffs[t];if(a!=null&&a.fullContent)return a.newText}}function H1e(e){var t,a;let l=((t=e.workspacePath)==null?void 0:t.toLowerCase())??"",s=((a=e.mimeType)==null?void 0:a.toLowerCase())??"";return e.kind==="html"||J1e(l)||s==="text/html"||s==="text/markdown"}function J1e(e){let t=e.toLowerCase();return t.endsWith(".html")||t.endsWith(".htm")||t.endsWith(".md")||t.endsWith(".markdown")||Coe(t)!==void 0}function W1e(e){return e.storage==="workspace"&&e.status==="available"&&!!e.workspacePath}function VJ(e){return e.storage!=="workspace"?!0:e.status==="available"||e.status==="changed"}function V1e(e,t){if(!VJ(e))return e.workspacePath?t("turnOutputs.artifactUnavailable",{path:e.workspacePath}):t("turnOutputs.artifactMissing")}function K1e(e,t){return PY(e,t)}function O1e(e,t){let[a,l]=(0,I.useState)(!1);return(0,I.useLayoutEffect)(()=>{let s=e.current;if(!s||!t){l(!1);return}let o=s.closest("[data-history-viewport]")??s,r=()=>{let c=Number.parseFloat(getComputedStyle(s).getPropertyValue("--chat-regular-content-width"))||1e3;l(o.getBoundingClientRect().width>=c)};r();let n=typeof ResizeObserver>"u"?null:new ResizeObserver(r);n?.observe(o);let i=s.closest("[data-web-shell-root]"),d=new MutationObserver(r);return i&&d.observe(i,{attributes:!0,attributeFilter:["style"]}),()=>{n?.disconnect(),d.disconnect()}},[e,t]),a}var P1e="_collapseRow_d7f01_1",q1e="_collapseRowClickable_d7f01_14",X1e="_collapseLabel_d7f01_19",Z1e="_processedLabel_d7f01_36",_1e="_processedMeta_d7f01_43",$1e="_hiddenMetrics_d7f01_47",eYe="_summaryMetrics_d7f01_51",tYe="_collapseIcon_d7f01_59",aYe="_chevronRight_d7f01_72",lYe="_chevronDown_d7f01_73",pr={collapseRow:P1e,collapseRowClickable:q1e,collapseLabel:X1e,processedLabel:Z1e,processedMeta:_1e,hiddenMetrics:$1e,summaryMetrics:eYe,collapseIcon:tYe,chevronRight:aYe,chevronDown:lYe},sYe="_list_16t54_1",oYe="_listWithWelcomeHeader_16t54_12",rYe="_historyStatus_16t54_32",nYe="_historyRetryButton_16t54_38",iYe="_virtualSizer_16t54_64",dYe="_virtualRow_16t54_73",AYe="_loadingSkeleton_16t54_83",cYe="_srOnly_16t54_91",hYe="_loadingSkeletonUserRow_16t54_103",wYe="_loadingSkeletonAssistantRow_16t54_109",uYe="_loadingSkeletonUserBubble_16t54_115",gYe="_loadingSkeletonUserBubbleCompact_16t54_116",pYe="_loadingSkeletonAssistantBlock_16t54_130",bYe="_loadingSkeletonLineWide_16t54_138",BYe="_loadingSkeletonLineMedium_16t54_139",fYe="_loadingSkeletonLineShort_16t54_140",mYe="_loadingSkeletonLineNarrow_16t54_141",IYe="_turnStatusRow_16t54_181",CYe="_turnAnswerRow_16t54_182",QYe="_turnContentRow_16t54_193",EYe="_sessionTimelineLayer_16t54_197",yYe="_sessionTimelinePanel_16t54_210",MYe="_sessionTimelineViewport_16t54_226",YYe="_sessionTimelineList_16t54_274",FYe="_sessionTimelineItem_16t54_284",xYe="_sessionTimelineButton_16t54_289",vYe="_sessionTimelineTick_16t54_309",kYe="_sessionTimelineButtonInRange_16t54_397",NYe="_sessionTimelineButtonCurrent_16t54_401",DYe="_sessionTimelineDetails_16t54_412",UYe="_sessionTimelineDetailsTitle_16t54_450",SYe="_sessionTimelineDetailsIcon_16t54_457",GYe="_sessionTimelineDetailsTitleText_16t54_469",zYe="_sessionTimelineDetailsDetail_16t54_479",Yt={list:sYe,listWithWelcomeHeader:oYe,historyStatus:rYe,historyRetryButton:nYe,virtualSizer:iYe,virtualRow:dYe,loadingSkeleton:AYe,srOnly:cYe,loadingSkeletonUserRow:hYe,loadingSkeletonAssistantRow:wYe,loadingSkeletonUserBubble:uYe,loadingSkeletonUserBubbleCompact:gYe,loadingSkeletonAssistantBlock:pYe,loadingSkeletonLineWide:bYe,loadingSkeletonLineMedium:BYe,loadingSkeletonLineShort:fYe,loadingSkeletonLineNarrow:mYe,turnStatusRow:IYe,turnAnswerRow:CYe,turnContentRow:QYe,sessionTimelineLayer:EYe,sessionTimelinePanel:yYe,sessionTimelineViewport:MYe,sessionTimelineList:YYe,sessionTimelineItem:FYe,sessionTimelineButton:xYe,sessionTimelineTick:vYe,sessionTimelineButtonInRange:kYe,sessionTimelineButtonCurrent:NYe,sessionTimelineDetails:DYe,sessionTimelineDetailsTitle:UYe,sessionTimelineDetailsIcon:SYe,sessionTimelineDetailsTitleText:GYe,sessionTimelineDetailsDetail:zYe},SY=()=>{},RYe=15e3,GY=180,LYe=400,PH=5e3;function TYe(e,t){if(!e||e.length!==t.length||t.length===0)return!1;for(let s=0;s<t.length-1;s+=1)if(e[s]!==t[s])return!1;let a=e[e.length-1],l=t[t.length-1];return a.id!==l.id||a.role!==l.role||l.role!=="assistant"&&l.role!=="thinking"||a.role!=="assistant"&&a.role!=="thinking"||a.isStreaming!==!0||l.isStreaming!==!0?!1:a.role==="assistant"&&l.role==="assistant"?typeof a.content!="string"||typeof l.content!="string"?!1:a.branchRecordId===l.branchRecordId&&a.usage===l.usage&&!!a.content.trim()==!!l.content.trim():a.role==="thinking"&&l.role==="thinking"}function jYe(e,t){return e.length===t.length&&e.every((a,l)=>Object.is(a,t[l]))}function HYe(e){for(let t=e.length-1;t>=0;t--){let a=e[t];if(a?.role==="user")return a.id}return null}function JYe(e){return e[e.length-1]}function WYe(e){for(let t=e.length-1;t>=0;t--){let a=e[t];if(a&&mo(a))return a.id}return null}function VYe(e,t){return e.role!=="tool_group"?!1:!!(t!=null&&t.toolCallId&&e.tools.some(a=>Br(a,t.toolCallId)))}function qH(e){let t=[],a=!1;for(let l of e){if(l.role!=="tool_group"||l.tools.length<2||!l.tools.some(n=>ac(n.rawOutput))){t.push(l);continue}a=!0;let s=[],o=0,r=n=>{n.length!==0&&t.push({...l,id:o++===0?l.id:`${l.id}-${n[0].callId}`,tools:n})};for(let n of l.tools)ac(n.rawOutput)?(r(s),s=[],r([n])):s.push(n);r(s)}return a?t:e}function KYe(e,t){let a=[],l=0,s=o=>o.role==="tool_group"&&!VYe(o,t)&&!o.tools.some(r=>ac(r.rawOutput));for(;l<e.length;){let o=e[l];if(o.role!=="thinking"&&!s(o)){a.push(o),l++;continue}let r=[],n=l-1,i=l;for(;i<e.length;){let w=e[i];if(w.role==="thinking"||s(w)){r.push(w),n=i,i++;continue}break}let d=r.filter(w=>w.role==="tool_group").flatMap(w=>w.tools);if(d.length===0||r.length<=1||r.length>=2&&r.every(KY)){for(let w of r)a.push(w);l=n+1;continue}let c=[],h=[];for(let w of r)if(w.role==="thinking"){let u={content:w.content,...w.isStreaming===!0?{isStreaming:!0}:{}};c.push(u),h.push(u)}else if(w.role==="tool_group"&&w.tools.length>0){let u=w.tools[0].callId;for(let g of h)g.beforeToolCallId=u;h.length=0}a.push({id:jJ(r[0].id),role:"tool_group",tools:d,...c.length>0?{thoughts:c}:{},timestamp:r[0].timestamp}),l=n+1}return a}function OYe(e,t){var a;let l=e[e.length-1];if(l?.role!=="tool_group"||JJ(l.id)===void 0||!((a=l.thoughts)!=null&&a.length))return;let s=l.thoughts[l.thoughts.length-1];if(s?.isStreaming!==!0)return;let o=l.thoughts.slice();o[o.length-1]={...s,content:t.content,isStreaming:!0};let r=e.slice();return r[r.length-1]={...l,thoughts:o,...l.id===jJ(t.id)?{timestamp:t.timestamp}:{}},r}function KJ(e){return Hse(FFe(e))}function em(e){if(e.type==="parallel_agents")return`group:${e.key}`;if(e.type==="turn_outputs")return`outputs:${e.key}`;if(e.type==="turn_collapse"){let t=e.turnCollapse.liveStartedAt;return t===void 0?`tc:${e.key}`:`tc:${e.key}:${t}`}return`msg:${e.key}`}function PYe(e,t,a,l,s){if((!a||a.size===0)&&(!l||l.size===0)&&(!s||s.size===0))return e;let o=[],r=null,n=(i,d)=>{if(d&&t||!i)return;let c=a?.get(i)??[],h=l?.get(i)??[],w=s?.get(i)??[];c.length===0&&h.length===0&&w.length===0||o.push({type:"turn_outputs",key:i,turnId:i,changes:c,artifacts:h,scheduledTasks:w})};for(let i of e)i.type==="message"&&mo(i.message)?(n(r,!1),r=i.message.id):!r&&i.type==="message"?r=i.message.id:!r&&i.type==="parallel_agents"&&(r=i.turnId),o.push(i);return n(r,!0),o}function qYe(e,t){let a=r=>r.type==="parallel_agents"&&(t?.has(r.key)===!0||r.agents.some(n=>Tl(n.status)));if(!e.some(r=>a(r)))return e;let l=[],s=[],o=()=>{l.push(...s),s=[]};for(let r of e)r.type==="message"&&mo(r.message)?(o(),l.push(r)):a(r)?s.push(r):l.push(r);return o(),l}function XYe(e,t){return e.type==="message"&&(e.message.role==="assistant"||t&&e.message.role==="system"&&e.message.source==="background_notification")&&!!e.message.content&&e.message.content.trim().length>0}function km(e,t,a,l=!0){let s=t;for(let o=a;o>t;o--)if(hFe(e[o])){s=o;break}for(let o=a;o>s;o--)if(XYe(e[o],l))return o;return-1}function ZYe(e,{isResponding:t,latestTurnAwaitsAgentSummary:a,gateBackgroundAgentStatus:l}){let s=[];for(let r=0;r<e.length;r++){let n=e[r];n.type==="message"&&mo(n.message)&&s.push(r)}let o=new Map;for(let r=0;r<s.length;r++){let n=s[r],i=(r+1<s.length?s[r+1]:e.length)-1;if(r===s.length-1&&(t||l&&a)||l&&XJ(e,n,i))continue;let d=e[n],c=km(e,n,i,!1);if(c<0)continue;let h=e[c];d?.type==="message"&&h.type==="message"&&h.message.role==="assistant"&&o.set(h.message.id,d.message.id)}return o}function XH(e,t){if(e.type==="parallel_agents")return!0;if(e.type==="turn_outputs"||e.type==="turn_collapse")return!1;switch(e.message.role){case"tool_group":case"plan":return!0;case"assistant":return!t;case"thinking":return!0;case"system":return e.message.source==="background_notification"?!t:e.message.source==="vision_bridge_notice";case"user":case"user_shell":case"btw":case"insight_progress":case"insight_ready":case"insight_error":return!1;default:return e.message,!1}}function OJ(e){return e.source==="mid_turn_message_injected"}function _Ye(e,t){if(e.type==="parallel_agents")return{kind:"agents",timestamp:e.timestamp,label:t?t("timeline.parallelAgents"):"Parallel agents"};if(e.type==="turn_outputs")return{kind:"none"};if(e.type!=="message")return{kind:"none"};let{message:a}=e;switch(a.role){case"thinking":return{kind:"thought",timestamp:a.timestamp,label:t?t("timeline.thinking"):"Thinking"};case"assistant":return e.turnCollapse?{kind:"none",timestamp:a.timestamp}:lc(a.content,1)?{kind:"commentary",timestamp:a.timestamp,label:t?t("timeline.assistantUpdate"):"Assistant update"}:{kind:"none",timestamp:a.timestamp};case"tool_group":{let l=a.tools.length;return{kind:"tool",timestamp:a.timestamp,label:t?t("timeline.toolCalls",{count:l}):`${l} tool call${l===1?"":"s"}`}}case"plan":return{kind:"plan",timestamp:a.timestamp,label:t?t("timeline.planUpdate"):"Plan update"};case"system":return OJ(a)?{kind:"status",timestamp:a.timestamp,label:t?t("timeline.statusUpdate"):"Status update"}:{kind:"none",timestamp:a.timestamp};case"user":case"user_shell":case"btw":case"insight_progress":case"insight_ready":case"insight_error":return{kind:"none",timestamp:a.timestamp};default:return{kind:"none"}}}function lc(e,t,a={}){let l=(a.stripMarkdown===!0?$Ye(e):e??"").replace(/\s+/g," ").trim();if(t<=0||!l)return"";let s=Array.from(l);return s.length>t?`${s.slice(0,t-1).join("")}\u2026`:l}function $Ye(e){if(!e)return"";let t=[],a=s=>{let o=`\0${t.length}\0`;return t.push(s),o},l=e.replace(/```[^\n`]*\n?([\s\S]*?)```/g,(s,o)=>a(o)).replace(/!\[([^\]]*)\]\([^)]+\)/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/`([^`\n]+)`/g,(s,o)=>a(o)).replace(/^\s{0,3}#{1,6}\s+/gm,"").replace(/^\s{0,3}>\s?/gm,"").replace(/^\s*[-*+]\s+/gm,"");l=zY(l,"~~"),l=zY(l,"**"),l=zY(l,"__"),l=l.replace(/\*([^*\s][^*]*?\S)\*/g,"$1").replace(/(^|[^\p{L}\p{N}_])_([^_\s][^_]*?\S)_(?=$|[^\p{L}\p{N}_])/gu,"$1$2");for(let[s,o]of t.entries())l=l.split(`\0${s}\0`).join(o);return l}function zY(e,t){let a="",l=0;for(;l<e.length;){let s=e.indexOf(t,l);if(s===-1)return a+e.slice(l);let o=s+t.length,r=e.indexOf(t,o);if(r===-1)return a+e.slice(l);let n=e.slice(o,r);a+=n.trim().length===0?e.slice(l,r+t.length):e.slice(l,s)+n,l=r+t.length}return a}function eFe(e,t){let a=e.role==="user"?e.content:e.role==="user_shell"?e.command:"";return lc(a,32)||(t?t("timeline.userTurn"):"User turn")}function tFe(e){return e.role==="user"&&(e.source==="cron"||e.source==="loop")}function mo(e){return e.role==="user"||e.role==="user_shell"}function aFe(e,t){if(!t.startsWith("msg:"))return;let a=t.slice(4);a=JJ(a)??a;for(let l=e.length-1;l>=0;l--){let s=e[l];if(s?.id===a){for(let o=l;o>=0;o--){let r=e[o];if(r&&mo(r))return r.id}return}}}function lFe(e,t){for(let a of e)if(a.type==="turn_collapse"&&a.turnCollapse.turnId===t)return a.turnCollapse.collapsed;return!1}function sFe(e,t){switch(e.role){case"thinking":return t?t("timeline.kind.thought"):"thinking";case"assistant":return lc(e.content,120,{stripMarkdown:!0});case"tool_group":{let a=e.tools.length;return t?t("timeline.toolCalls",{count:a}):`${a} tool call${a===1?"":"s"}`}case"plan":return t?t("timeline.planDetail"):"plan update";case"system":return OJ(e)?lc(e.content,120,{stripMarkdown:!0}):"";case"user":case"user_shell":case"btw":case"insight_progress":case"insight_ready":case"insight_error":return"";default:return""}}function oFe(e,t){if(e.type==="parallel_agents"){let a=e.agents.length;return t?t("timeline.parallelAgentsDetail",{count:a}):`${a} parallel agent${a===1?"":"s"}`}return e.type==="turn_outputs"||e.type!=="message"?"":sFe(e.message,t)}function rFe(e,t){return t?t(`timeline.kind.${e}`):HFe[e]}function nFe(e,t,a,l){if(t!==null)for(let r of e){if(r.type!=="message")continue;let{message:n}=r;if(n.id!==t||n.role!=="assistant")continue;let i=lc(n.content,180,{stripMarkdown:!0});if(i)return i}let s=[];for(let r=0;r<e.length;r+=1){let n=e[r];if(n.type==="message"&&t!==null&&n.message.id===t)continue;let i=oFe(n,l);i&&s.push(i)}return lc(s.join(" \xB7 "),180)||(a.length>0?a.map(r=>rFe(r,l)).join(" \xB7 "):l?l("timeline.noActivity"):"No activity")}function iFe(e,t){let a=[],l=null,s=[],o=()=>{if(!l)return;let r=KJ(s),n=km(r,-1,r.length-1,!1),i=n>=0?r[n]:null,d=i?.type==="message"&&i.message.role==="assistant"&&!i.message.isStreaming&&lc(i.message.content,1,{stripMarkdown:!0}).length>0?i.message.id:null,c=[];for(let h of r){if(h.type==="message"&&d!==null&&h.message.id===d)continue;let w=_Ye(h,t);w.kind!=="none"&&!c.includes(w.kind)&&c.push(w.kind)}a.push({id:l.id,label:eFe(l,t),detail:nFe(r,d,c,t),timestamp:l.timestamp,nodeKinds:c,...tFe(l)?{isScheduledTask:!0}:{}})};for(let r of e){if(mo(r)){o(),l=r,s=[];continue}l&&s.push(r)}return o(),a}function dFe(){return(0,A.jsxs)("svg",{className:Yt.sessionTimelineDetailsIcon,viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:[(0,A.jsx)("circle",{cx:"8",cy:"8",r:"6.25"}),(0,A.jsx)("path",{d:"M8 4.5v4l-2.5 2"})]})}function AFe(e){var t,a,l;let s=e.rawOutput&&typeof e.rawOutput=="object"?e.rawOutput:void 0;return[e.callId,e.toolName,e.kind??"",e.status,e.parentToolCallId??"",e.subContent?"sub-content":"",((t=e.subTools)==null?void 0:t.length)??0,String(((a=e.args)==null?void 0:a.subagent_type)??""),((l=e.args)==null?void 0:l.run_in_background)===!0?"background":"",String(s?.type??""),String(s?.status??"")].join(":")}function cFe(e){return e.map(t=>{let a=`${t.id}:${t.role}:${t.timestamp??""}`;switch(t.role){case"assistant":case"thinking":return`${a}:${t.isStreaming?"streaming":t.content}`;case"tool_group":return`${a}:${t.tools.map(AFe).join(",")}`;case"system":return`${a}:${t.variant}:${t.source??""}:${t.content}`;case"user":return`${a}:${t.content}`;case"user_shell":return`${a}:${t.command}`;case"plan":case"btw":case"insight_progress":case"insight_ready":case"insight_error":return a;default:return a}}).join("|")}function hFe(e){return e.type==="parallel_agents"?!0:e.type==="turn_outputs"||e.type==="turn_collapse"?!1:e.message.role==="tool_group"||e.message.role==="plan"}function wFe(e){if(e.type==="turn_outputs")return null;if(e.type==="turn_collapse")return e.turnCollapse.liveStartedAt===void 0||e.turnCollapse.toolCallCount===void 0||e.turnCollapse.toolCallCount<=0?null:`turn:${e.turnCollapse.turnId}:${e.turnCollapse.toolCallCount}`;if(e.type==="parallel_agents"){let a=e.agents.filter(l=>Tl(l.status));return a.length===0?null:`agents:${e.key}:${a.map(l=>l.callId).join(",")}`}if(e.message.role!=="tool_group")return null;let t=e.message.tools.filter(a=>Tl(a.status));return t.length===0?null:`tools:${e.message.id}:${t.map(a=>a.callId).join(",")}`}function uFe(e){for(let t=e.length-1;t>=0;t--){let a=wFe(e[t]);if(a)return a}return null}function gFe(e){if(!(e.type!=="message"||e.message.role!=="system"))return e.message.source==="prompt_cancelled"||e.message.source==="turn_error"?e.message.timestamp:void 0}function pFe(e){return e.type==="message"&&e.message.role==="system"&&e.message.source==="turn_error"}function bFe(e){var t;if(!(e.type!=="message"||e.message.role!=="assistant"))return(t=e.message.content)!=null&&t.trim()?e.message.timestamp:void 0}function BFe(e){return e.type==="message"&&e.message.role==="assistant"?e.message.usage:void 0}function RY(e){return typeof e=="number"&&Number.isFinite(e)&&e>=0?e:void 0}function ZH(e){if(e.parentToolCallId||!ks(e))return;let t=e.rawOutput&&typeof e.rawOutput=="object"?e.rawOutput:void 0,a=t!=null&&t.executionSummary&&typeof t.executionSummary=="object"?t.executionSummary:void 0,l=RY(a?.inputTokens),s=RY(a?.outputTokens);if(l===void 0&&s===void 0)return;let o=RY(a?.cachedTokens);return{callId:e.callId,usage:{inputTokens:l??0,outputTokens:s??0,...o!==void 0?{cachedTokens:o}:{}}}}function fFe(e){return e.type==="parallel_agents"?e.agents.flatMap(t=>ZH(t)??[]):e.type!=="message"||e.message.role!=="tool_group"?[]:e.message.tools.flatMap(t=>ZH(t)??[])}function mFe(e){return e.type==="parallel_agents"?e.agents.length:e.type==="turn_outputs"||e.type==="turn_collapse"?0:e.message.role==="tool_group"?e.message.tools.length:0}function PJ(e,t){for(let a=Math.min(t,e.length-1);a>=0;a--){let l=e[a];if(l.type==="message"&&mo(l.message))return l.message.id}return null}function qJ(e){let t=[],a=null;for(let l of e)l.type==="message"&&mo(l.message)&&(a=l.message.id),t.push(a);return t}function _H(e,t,a,l){let s=l===void 0?PJ(e,t):l[t]??null;return s?a.get(s)??null:null}function IFe(e,t,a,l,s=qJ(e)){let o=Number.POSITIVE_INFINITY,r=-1;for(let i of t){if(i<0||i>=e.length)continue;let d=_H(e,i,a,s);d!==null&&(o=Math.min(o,d),r=Math.max(r,d))}if(r<0)return null;let n=l==null?null:_H(e,l,a,s);return{startIndex:o,endIndex:r,currentIndex:n!==null&&n>=o&&n<=r?n:r}}function vp(e,t,a,l){for(let s=t;s<=a;s++){let o=e[s];if(o.type==="parallel_agents"){if(o.agents.some(l))return!0}else if(o.type==="message"&&o.message.role==="tool_group"&&o.message.tools.some(l))return!0}return!1}function CFe(e,t,a,l){return l?vp(e,t,a,s=>Br(s,l)):!1}function QFe(e,t,a){return vp(e,t,a,l=>ks(l)&&Tl(l.status))}function EFe(e,t,a){return vp(e,t,a,l=>ac(l.rawOutput)!==void 0)}function yFe(e,t){let a=new Set(t);for(let l of e){if(l.type!=="message"||l.message.role!=="system"||l.message.source!=="background_notification")continue;let s=l.message.data;if(!s||typeof s!="object"||Array.isArray(s)||!("kind"in s)||s.kind!=="shell")continue;let o="taskId"in s?s.taskId:void 0;typeof o=="string"&&a.add(o)}return a}function MFe(e,t,a,l){return vp(e,t,a,s=>{let o=jse(s);return o!==void 0&&!l.has(o)})}function XJ(e,t,a){return vp(e,t,a,l=>br(l)&&Tl(l.status))}function YFe(e,t,a,l){if(!(l!=null&&l.size))return!1;for(let s=t;s<=a;s++){let o=e[s];if(o.type==="parallel_agents"&&l.has(o.key))return!0}return!1}function LY(e){return e.type==="parallel_agents"?e.agents.filter(t=>br(t)&&t.status!=="failed").map(t=>t.callId):e.type==="message"&&e.message.role==="tool_group"?e.message.tools.filter(t=>br(t)&&t.status!=="failed").map(t=>t.callId):[]}function ZJ(e){var t;if(e.role!=="system"||e.source!=="background_notification")return null;let a=((t=e.content)==null?void 0:t.trimStart().toLowerCase().startsWith("background agent "))===!0,l=e.data;if(typeof l!="object"||l===null||Array.isArray(l))return a?{status:"completed",...e.timestamp!==void 0?{endTime:e.timestamp}:{}}:null;let{kind:s,toolUseId:o,status:r}=l;if(s!=="agent"&&!(s===void 0&&a))return null;let n=r===void 0?"completed":b8(r)?r:void 0;return n?{...typeof o=="string"?{callId:o}:{},status:n,...e.timestamp!==void 0?{endTime:e.timestamp}:{}}:null}function NF(e){return e.type==="message"?ZJ(e.message):null}function FFe(e){let t=new Map;for(let s of e){let o=ZJ(s);o!=null&&o.callId&&t.set(o.callId,o)}if(t.size===0)return e;let a=!1,l=e.map(s=>{if(s.role!=="tool_group")return s;let o=!1,r=s.tools.map(n=>{let i=t.get(n.callId);if(!i||!br(n)||!Tl(n.status))return n;let d=B8(n,i.status,i.endTime);return d===n?n:(o=!0,d)});return o?(a=!0,{...s,tools:r}):s});return a?l:e}function _J(e,t,a,l){let s=-1,o;for(let d=a;d>t;d--){let c=e[d];if(!(c.type!=="message"||c.message.role!=="system")){if(c.message.source==="turn_error"||c.message.source==="prompt_cancelled"){if(s<0)return null;continue}if(c.message.source==="background_notification"){let h=NF(c);if(l&&!h)continue;s<0&&(s=d,o=h?.callId)}}}if(s<0)return null;let r=-1;if(o){for(let d=a;d>=0;d--)if(LY(e[d]).includes(o)){r=d;break}}for(let d=a;d>=t&&!(r>=0);d--)if(LY(e[d]).length>0){r=d;break}let n=new Set,i=!1;if(r>=0){let d=r;for(let h=r;h>=0;h--){let w=e[h];if(w.type==="message"&&mo(w.message)){d=h;break}}let c=[];for(let h=d;h<=a;h++){let w=e[h];for(let g of LY(w))n.add(g);let u=NF(w);u&&(i=!0,u.callId?n.delete(u.callId):c.push(new Set(n)))}for(let h of c)for(let w of h)if(n.has(w)){n.delete(w);break}}return{lastNotificationIndex:s,sawAgentCompletion:i,unmatchedAgentCallIds:n}}function DF(e,t,a,l=!1,s=!0,o=!0){let r=_J(e,t,a,l);if(!r)return!1;if(r.sawAgentCompletion&&r.unmatchedAgentCallIds.size>0)return s;for(let n=r.lastNotificationIndex+1;n<=a;n++){let i=e[n];if(i.type==="message"&&i.message.role==="thinking")return!1}return o&&km(e,t,a,!1)<r.lastNotificationIndex}function xFe(e,{overrides:t,isResponding:a,activeTurnStartedAt:l,backgroundSummaryGraceActive:s=!0,waitForUnmatchedAgentCompletions:o=!0,waitForOrderedNarration:r=!0,terminalBackgroundShellTaskIds:n,automaticallyExpandedAgentKeys:i,pendingApprovalCallId:d,includeSubagentToolUsageInMetrics:c=!0,paginatedExpanded:h,enabled:w}){if(!w||e.length===0)return e;let u=[];for(let f=0;f<e.length;f++){let B=e[f];B.type==="message"&&mo(B.message)&&u.push(f)}if(u.length===0)return e;let g=yFe(e,n),p=[];for(let f=0;f<u[0];f++)p.push(e[f]);for(let f=0;f<u.length;f++){let B=u[f],b=(f+1<u.length?u[f+1]:e.length)-1,C=e[B],Q=C.message.id,x=C.message.timestamp,F=f===u.length-1,E=F&&a,M=QFe(e,B,b),Y=EFe(e,B,b),v=MFe(e,B,b,g),S=YFe(e,B,b,i),G=F&&s&&DF(e,B,b,!1,o,r),J=CFe(e,B,b,d),W=km(e,B,b),X=0,O,_,q=0,Ae=0,N=0,ce=0,j=0,D=!1,le=new Set,ge=!1;for(let me=B+1;me<=b;me++){let Ce=e[me];XH(Ce,me===W)&&X++,pFe(Ce)&&(ge=!0),ce+=mFe(Ce),Ce.type==="message"&&Ce.message.role==="thinking"?j++:Ce.type==="message"&&Ce.message.role==="tool_group"&&Ce.message.thoughts&&(j+=Ce.message.thoughts.length);let K=gFe(Ce);K!==void 0&&(O=O===void 0?K:Math.max(O,K));let Be=bFe(Ce);Be!==void 0&&(_=_===void 0?Be:Math.max(_,Be));let et=BFe(Ce);if(et&&(q+=et.inputTokens,Ae+=et.outputTokens,N+=et.cachedTokens??0,D=!0),c)for(let ve of fFe(Ce))le.has(ve.callId)||(le.add(ve.callId),q+=ve.usage.inputTokens,Ae+=ve.usage.outputTokens,N+=ve.usage.cachedTokens??0,D=!0)}let de=E||G?l??x??Date.now():void 0,P=O??_,re=x!==void 0&&P!==void 0&&P>=x?P-x:void 0;if(J||X===0&&!(D||re!==void 0||de!==void 0)){for(let me=B;me<=b;me++)p.push(e[me]);continue}let ie=E||M||Y||v||S||G||(ge||W<0)&&F,$=!(X===0||(t.has(Q)?t.get(Q):h!=null&&h.has(Q)||ie));p.push({type:"message",key:C.key,message:C.message});let oe={turnId:Q,collapsed:$,hiddenCount:X,...re!==void 0?{elapsedMs:re}:{},...D?{inputTokens:q,outputTokens:Ae}:{},...N>0?{cachedTokens:N}:{},...ce>0?{toolCallCount:ce}:{},...j>0?{thinkingCount:j}:{},...de!==void 0?{liveStartedAt:de}:{}};if(p.push({type:"turn_collapse",key:`tc-${Q}`,turnCollapse:oe}),!$){for(let me=B+1;me<=b;me++){let Ce=e[me];me===W&&Ce.type==="message"&&Ce.message.role==="assistant"?p.push({...Ce,turnCollapse:oe}):p.push(Ce)}continue}for(let me=B+1;me<=b;me++){let Ce=e[me];if(!(me===W&&E)){if(me===W&&Ce.type==="message"&&Ce.message.role==="assistant"){p.push({...Ce,turnCollapse:oe});continue}XH(Ce,me===W)||p.push(Ce)}}}return p}function TY(e,t,a){if(a){for(let l=0;l<e.length;l++){let s=e[l];if(s.type==="message"&&s.message.role==="tool_group"&&s.message.tools.some(o=>Br(o,a))||s.type==="parallel_agents"&&s.agents.some(o=>Br(o,a)))return l}return-1}for(let l=0;l<e.length;l++){let s=e[l];if(s.type==="message"&&s.message.id===t)return l}return-1}function $H(e,t){if(!t)return!1;let a=t.callId;return e.type==="message"?a?e.message.role==="tool_group"&&e.message.tools.some(l=>Br(l,a)):e.message.id===t.messageId:e.type==="parallel_agents"?!!a&&e.agents.some(l=>Br(l,a)):(e.type,!1)}function e8(e,t){var a;return e?e.type==="message"?(a=e.message.sourceBlockIds)==null?void 0:a.join(","):t.filter(l=>e.type==="parallel_agents"?l.role==="tool_group"&&e.agents.some(s=>l.tools.some(o=>Br(o,s.callId))):l.id===(e.type==="turn_outputs"?e.turnId:e.turnCollapse.turnId)).flatMap(l=>l.sourceBlockIds??[]).join(",")||void 0:void 0}var jY=0,vFe=120,kFe=80,NFe=32,DFe=240,tm=30,HY=160,t8=30,$J=200;function UFe(e,t=$J){return e>t}function SFe(e,t){return e<=t}function GFe(e){let t=Math.max(0,Math.ceil(e/1e3));if(t<60)return`${t}s`;let a=Math.floor(t/60),l=t-a*60;return`${a}m ${l}s`}function zFe(e){return e!==void 0&&e>0?GFe(e):""}function RFe(e,t){if(e.inputTokens===void 0||e.outputTokens===void 0)return"";let a=e.cachedTokens??0,l=a>0&&e.inputTokens>0?` (${Xl(a)} ${t("turn.cached")}, ${Math.round(a/e.inputTokens*100)}%)`:"";return`\u2191${Xl(e.inputTokens)}${l} \u2193${Xl(e.outputTokens)}`}function a8(e,t){let a=[],l=RFe(e,t);return l&&a.push(l),e.toolCallCount!==void 0&&e.toolCallCount>0&&a.push(t("turn.toolCalls",{count:e.toolCallCount})),e.thinkingCount!==void 0&&e.thinkingCount>0&&a.push(t("turn.thinkingCount",{count:e.thinkingCount})),a.join(" \xB7 ")}function LFe(e){return e.inputTokens!==void 0&&e.outputTokens!==void 0||e.toolCallCount!==void 0&&e.toolCallCount>0}var TFe=(0,I.memo)(function({turnCollapse:e,onToggleCollapse:t}){let{t:a}=it(),l=e.hiddenCount>0,s=e.liveStartedAt,o=l||s!==void 0||LFe(e),r=nx(s!==void 0&&o),n=(0,I.useRef)(0),i=(0,I.useRef)(s);i.current!==s&&(i.current=s,n.current=0);let d;s!==void 0&&o?(n.current=Math.max(n.current,Math.max(0,r-s)),d=n.current):o&&e.elapsedMs!==void 0?(n.current=0,d=e.elapsedMs):(n.current=0,d=void 0);let c=zFe(d),h=a8(e,a),w=a8(e,a),u=a(s!==void 0?"turn.processing":"turn.processed"),g=!!c&&o,p=!!h&&o,f=!!w&&o;if(!o)return null;let B=()=>{if(!l)return;let b=e.collapsed;t(e.turnId,b)};return(0,A.jsxs)("div",{className:l?`${pr.collapseRow} ${pr.collapseRowClickable}`:pr.collapseRow,role:l?"button":void 0,tabIndex:l?0:void 0,"aria-expanded":l?!e.collapsed:void 0,"aria-label":l?e.collapsed?a("turn.expand"):a("turn.collapse"):void 0,title:l?e.collapsed?a("turn.expand"):a("turn.collapse"):void 0,onClick:l?B:void 0,onKeyDown:l?b=>{b.key!=="Enter"&&b.key!==" "||(b.preventDefault(),B())}:void 0,children:[(0,A.jsxs)("span",{className:pr.collapseLabel,children:[(0,A.jsxs)("span",{className:pr.processedLabel,children:[u,g&&(0,A.jsxs)("span",{className:pr.processedMeta,children:[" ",c]})]}),f&&(0,A.jsx)("span",{className:pr.summaryMetrics,children:w}),p&&(0,A.jsx)("span",{className:pr.hiddenMetrics,children:h})]}),l&&(0,A.jsx)("span",{"data-testid":`toggle-${e.turnId}`,className:pr.collapseIcon,onClick:b=>{b.stopPropagation(),B()},children:(0,A.jsx)("span",{className:e.collapsed?pr.chevronRight:pr.chevronDown,"aria-hidden":"true"})})]})});function jFe(e){if(e.type==="turn_collapse")return Yt.turnStatusRow;if(e.type==="turn_outputs")return Yt.turnContentRow;if(e.type==="message"&&e.turnCollapse)return Yt.turnAnswerRow}var HFe={thought:"thinking",commentary:"assistant update",tool:"tool calls",agents:"parallel agents",plan:"plan update",status:"status update",none:"turn"},JFe=["--background","--foreground","--muted-foreground","--border","--font-sans"],l8="session-timeline-detail-tooltip",WFe=(0,I.memo)(function({entries:e,currentTurnId:t,currentRange:a,hidden:l,onSelect:s}){let o=up(),{t:r}=it(),n=(0,I.useRef)(null),i=(0,I.useRef)(null),d=(0,I.useRef)(null),c=(0,I.useRef)(!1),h=(0,I.useRef)(!1),w=(0,I.useRef)(null),u=(0,I.useRef)(null),[g,p]=(0,I.useState)(null),f=a!==null?a.currentIndex:e.findIndex(Y=>Y.id===t),B=(0,I.useCallback)(()=>p(null),[]),b=(0,I.useCallback)(()=>{c.current||h.current||B()},[B]),C=(0,I.useCallback)((Y,v)=>{let S=n.current;if(!S)return null;let G=getComputedStyle(S),J=v.getBoundingClientRect();return{entry:Y,top:J.top+J.height/2,left:J.right+8,clamped:!1,themeVars:Object.fromEntries(JFe.map(W=>[W,G.getPropertyValue(W)]))}},[]),Q=(0,I.useCallback)(Y=>{let v=i.current;if(!v)return null;let S=Array.from(v.querySelectorAll('[data-testid="session-timeline-entry"]')).find(G=>G.getAttribute("data-turn-id")===Y.id);return S?.querySelector("button")??null},[]),x=(0,I.useCallback)(Y=>{let v=i.current;if(!v)return!1;let S=v.getBoundingClientRect(),G=Y.getBoundingClientRect();return G.bottom>=S.top&&G.top<=S.bottom},[]),F=(0,I.useCallback)(()=>{p(Y=>{if(!Y)return null;let v=Q(Y.entry);return!v||!x(v)?null:C(Y.entry,v)})},[C,Q,x]),E=(0,I.useCallback)((Y,v)=>{p(C(Y,v))},[C]),M=(0,I.useCallback)(()=>{typeof window>"u"||(w.current!==null&&window.cancelAnimationFrame(w.current),u.current!==null&&window.clearTimeout(u.current),h.current=!0,w.current=window.requestAnimationFrame(()=>{w.current=null,h.current=!1,F()}),u.current=window.setTimeout(()=>{u.current=null,h.current=!1},100))},[F]);return(0,I.useLayoutEffect)(()=>{if(l)return;let Y=i.current;if(!Y||f<0)return;let v=Y.querySelector(`[data-timeline-index="${f}"]`);if(!v)return;let S=v.offsetTop+v.offsetHeight/2,G=Y.scrollHeight-Y.clientHeight,J=Math.max(0,Math.min(S-Y.clientHeight/2,G));if(Y.scrollTop===J)return;c.current=!0,Y.scrollTop=J;let W=window.requestAnimationFrame(()=>{c.current=!1,F()}),X=window.setTimeout(()=>{c.current=!1},100);return()=>{window.cancelAnimationFrame(W),window.clearTimeout(X),c.current=!1}},[f,l,F]),(0,I.useLayoutEffect)(()=>{if(!(!g||typeof window>"u"))return window.addEventListener("resize",F),()=>{window.removeEventListener("resize",F)}},[F,g]),(0,I.useLayoutEffect)(()=>()=>{w.current!==null&&window.cancelAnimationFrame(w.current),u.current!==null&&window.clearTimeout(u.current),h.current=!1},[]),(0,I.useLayoutEffect)(()=>{if(!g||g.clamped)return;let Y=n.current,v=d.current;if(!Y||!v||typeof window>"u")return;let S=v.getBoundingClientRect(),G=12,J=g.top;S.top<G?J+=G-S.top:S.bottom>window.innerHeight-G&&(J-=S.bottom-(window.innerHeight-G)),J!==g.top&&p(W=>W?.entry.id===g.entry.id?{...W,top:J,clamped:!0}:W)},[g]),l||e.length===0?null:(0,A.jsx)("div",{className:Yt.sessionTimelineLayer,"aria-hidden":"false",children:(0,A.jsxs)("nav",{ref:n,className:Yt.sessionTimelinePanel,"aria-label":r("timeline.sessionTimeline"),"data-testid":"session-timeline",onMouseLeave:B,children:[(0,A.jsx)("div",{ref:i,className:Yt.sessionTimelineViewport,"data-testid":"session-timeline-viewport",onScroll:b,children:(0,A.jsx)("ol",{className:Yt.sessionTimelineList,children:e.map((Y,v)=>{let S=a!==null&&v>=a.startIndex&&v<=a.endIndex,G=a!==null?v===a.currentIndex:Y.id===t,J=Y.nodeKinds.join(","),W=[`${r("timeline.turnPrefix",{index:v+1})}: ${Y.label}`,G?r("timeline.currentTurn"):null].filter(Boolean).join(". "),X=q=>E(Y,q.currentTarget),O=q=>{M(),E(Y,q.currentTarget)},_=g?.entry.id===Y.id;return(0,A.jsx)("li",{className:Yt.sessionTimelineItem,"data-testid":"session-timeline-entry","data-turn-id":Y.id,"data-timeline-index":v,"data-node-kinds":J,"data-in-current-range":S?"true":void 0,children:(0,A.jsx)("button",{type:"button",className:UF(Yt.sessionTimelineButton,S?Yt.sessionTimelineButtonInRange:void 0,G?Yt.sessionTimelineButtonCurrent:void 0),"aria-current":G?"step":void 0,"aria-describedby":_?l8:void 0,"aria-label":W,onClick:()=>s(Y.id),onFocus:O,onBlur:B,onMouseEnter:X,onMouseLeave:B,children:(0,A.jsx)("span",{className:Yt.sessionTimelineTick})})},Y.id)})})}),g&&typeof document<"u"&&(0,fm.createPortal)((0,A.jsxs)("div",{ref:d,className:Yt.sessionTimelineDetails,id:l8,"data-testid":"session-timeline-detail","data-title":g.entry.label,"data-detail":g.entry.detail,"data-scheduled-task":g.entry.isScheduledTask?"true":void 0,role:"tooltip",style:{...g.themeVars,top:g.top,left:g.left},children:[(0,A.jsxs)("span",{className:Yt.sessionTimelineDetailsTitle,children:[g.entry.isScheduledTask&&(0,A.jsx)(dFe,{}),(0,A.jsx)("span",{className:Yt.sessionTimelineDetailsTitleText,children:g.entry.label})]}),(0,A.jsx)("span",{className:Yt.sessionTimelineDetailsDetail,children:g.entry.detail})]}),o??document.body)]})})});function UF(...e){return e.filter(Boolean).join(" ")||void 0}var VFe=[];function KFe({label:e}){return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("div",{role:"status","aria-live":"polite",className:Yt.srOnly,children:e}),(0,A.jsxs)("div",{className:Yt.loadingSkeleton,"data-testid":"message-list-loading-skeleton","aria-hidden":"true",children:[(0,A.jsx)("div",{className:Yt.loadingSkeletonUserRow,children:(0,A.jsxs)("div",{className:Yt.loadingSkeletonUserBubble,children:[(0,A.jsx)("span",{className:Yt.loadingSkeletonLineWide}),(0,A.jsx)("span",{className:Yt.loadingSkeletonLineShort})]})}),(0,A.jsx)("div",{className:Yt.loadingSkeletonAssistantRow,children:(0,A.jsxs)("div",{className:Yt.loadingSkeletonAssistantBlock,children:[(0,A.jsx)("span",{className:Yt.loadingSkeletonLineMedium}),(0,A.jsx)("span",{className:Yt.loadingSkeletonLineWide}),(0,A.jsx)("span",{className:Yt.loadingSkeletonLineNarrow})]})}),(0,A.jsx)("div",{className:Yt.loadingSkeletonUserRow,children:(0,A.jsx)("div",{className:Yt.loadingSkeletonUserBubbleCompact,children:(0,A.jsx)("span",{className:Yt.loadingSkeletonLineMedium})})}),(0,A.jsx)("div",{className:Yt.loadingSkeletonAssistantRow,children:(0,A.jsxs)("div",{className:Yt.loadingSkeletonAssistantBlock,children:[(0,A.jsx)("span",{className:Yt.loadingSkeletonLineWide}),(0,A.jsx)("span",{className:Yt.loadingSkeletonLineMedium})]})})]})]})}var OFe=(0,I.memo)((0,I.forwardRef)(function({messages:e,frozenViewport:t=!1,sessionKey:a,terminalBackgroundShellTaskIds:l,pendingApproval:s,onShowContextDetail:o,onImagePreview:r,onAttachmentPreview:n,onInsightReportOpen:i,onEditUserMessage:d,loadingTranscript:c,catchingUp:h,hasOlderHistory:w=!1,loadingOlderHistory:u=!1,historyCapacityReached:g=!1,historyPaginationError:p=!1,onLoadOlderHistory:f,transcriptBlockCount:B=0,transcriptActivity:b,onReloadTranscript:C,isResponding:Q=!1,transcriptReloadPaused:x=Q,activeTurnStartedAt:F,welcomeHeader:E,centerWelcomeHeader:M=!1,workspaceCwd:Y,tailContent:v,tailKey:S="tail",virtualScrollThreshold:G=$J,autoScrollTailIntoView:J=!1,bottomOverlayInset:W=0,hideSessionTimeline:X=!1,hideFirstUserMessage:O=!1,firstTurnMetrics:_,includeSubagentToolUsageInMetrics:q=!0,showRetryHint:Ae=!1,onRetryClick:N,failedPromptMessageId:ce,onRetryFailedPrompt:j,onBranchSession:D,onCanScrollToBottomChange:le,turnFileChanges:ge,turnArtifacts:de,turnScheduledTasks:P,onReviewChanges:re,onOpenArtifact:ie,onOpenScheduledTask:$,onTurnOutputOpen:oe,onError:me,generateContent:Ce},K){var Be,et;let ve=(0,I.useRef)(t);ve.current=t;let{t:at}=it(),dt=Ra(),ut=(0,I.useContext)(SF),Tt=(0,I.useMemo)(()=>{let R=new Map,Z,pe=0;for(let ye of e)ye.role==="user"&&(R.set(ye.id,pe),Z=ye.id,pe+=1);return{lastId:Z,turnIndexById:R}},[e]),ae=(0,I.useMemo)(()=>{if(!t)return;let R=[...Tt.turnIndexById.keys()];return new Set(R.filter((Z,pe)=>pe===0||pe===R.length-1))},[Tt,t]),Ve=(0,I.useRef)(void 0),be=TYe(Ve.current,e);(0,I.useLayoutEffect)(()=>{Ve.current=e},[e]);let Te=(0,I.useRef)(void 0),H=(0,I.useMemo)(()=>{var R;let Z=Te.current,pe=e[e.length-1],ye;if(be&&Z?.sourceMessages===Ve.current&&Z?.compactMode===ut&&Z.pendingApproval===s&&(pe?.role==="assistant"&&((R=Z.value[Z.value.length-1])==null?void 0:R.id)===pe.id?(ye=Z.value.slice(),ye[ye.length-1]=pe):pe?.role==="thinking"&&(ye=ut?OYe(Z.value,pe):qH(e))),!ye){let xe=qH(e);ye=ut?KYe(xe,s):xe}return Te.current={sourceMessages:e,compactMode:ut,pendingApproval:s,value:ye},ye},[ut,e,s,be]),he=(0,I.useRef)(void 0),we=(0,I.useMemo)(()=>{let R=he.current,Z=H[H.length-1],pe;if(be&&Q&&R?.sourceMessages===Ve.current&&R?.compactMode===ut&&R.pendingApproval===s&&R.isResponding===Q&&R.turnFileChanges===ge&&R.turnArtifacts===de&&R.turnScheduledTasks===P){let ye=R.value[R.value.length-1];ye?.type==="message"&&ye.message.id===Z.id&&(pe=R.value.slice(),pe[pe.length-1]={...ye,message:Z})}return pe??(pe=PYe(KJ(H),Q,ge,de,P)),he.current={sourceMessages:e,compactMode:ut,pendingApproval:s,isResponding:Q,turnFileChanges:ge,turnArtifacts:de,turnScheduledTasks:P,value:pe},pe},[H,e,be,ut,s,Q,ge,de,P]),Se=(0,I.useMemo)(()=>{for(let R=H.length-1;R>=0;R-=1){let Z=H[R];if(Z?.role==="system"&&Z.source==="background_notification")return Z.id}return null},[H]),[Je,bt]=(0,I.useState)(Se),ot=!!(c||h),Vt=(0,I.useRef)(ot),Ta=(0,I.useRef)(H.length>0),ua=!Ta.current&&H.length>0,_t=ot||Vt.current||ua;(0,I.useLayoutEffect)(()=>{_t&&bt(Se),H.length>0&&(Ta.current=!0),Vt.current=ot},[_t,Se,ot,H.length]);let $t=!_t&&Se!==null&&Je!==Se,Pt=(0,I.useMemo)(()=>{for(let R=we.length-1;R>=0;R-=1){let Z=we[R];if(Z.type==="message"&&mo(Z.message))return R}return 0},[we]),ja=dt==="interactive",kl=(0,I.useMemo)(()=>ja&&XJ(we,Pt,we.length-1),[we,ja,Pt]),Re=(0,I.useMemo)(()=>_J(we,Pt,we.length-1,!0),[we,Pt]),mt=(0,I.useMemo)(()=>{let R=Re?.unmatchedAgentCallIds;return R&&R.size>0?[...R].sort().join("|"):""},[Re]),$e=$t&&!kl&&(Re?.sawAgentCompletion??!1)&&(Re?.unmatchedAgentCallIds.size??0)>0,[ra,Hl]=(0,I.useState)(!1);(0,I.useEffect)(()=>{Hl(!1)},[mt,Pt,Q]),(0,I.useEffect)(()=>{if(!$e||Q)return;let R=setTimeout(()=>Hl(!0),PH);return()=>clearTimeout(R)},[$e,mt,Pt,Q]);let ia=(0,I.useMemo)(()=>$t&&!kl&&!Q&&(Re?.sawAgentCompletion??!1)&&(Re?.unmatchedAgentCallIds.size??0)===0&&DF(we,Pt,we.length-1,!0,!0,!0),[$t,we,Q,Re,kl,Pt]),[Bs,Vo]=(0,I.useState)(!1),ai=(0,I.useMemo)(()=>{let R=Re;if(!R||R.lastNotificationIndex<0)return"";let Z=we[R.lastNotificationIndex];return Z?.type==="message"?Z.message.id:""},[we,Re]);(0,I.useEffect)(()=>{Vo(!1)},[ai,Pt,Q]),(0,I.useEffect)(()=>{if(!ia)return;let R=setTimeout(()=>Vo(!0),PH);return()=>clearTimeout(R)},[ia,ai,Pt,Q]);let _s=(0,I.useMemo)(()=>$t&&DF(we,Pt,we.length-1,!0,kl||!ra,!Bs),[$t,we,kl,Pt,Bs,ra]),mr=(0,I.useMemo)(()=>{let R=new Set;for(let Z=Pt;Z<we.length;Z+=1){let pe=we[Z];pe.type==="parallel_agents"&&R.add(pe.key)}return R},[we,Pt]),$r=(0,I.useMemo)(()=>{if(!$t)return{key:null};let R=-1,Z;for(let pe=we.length-1;pe>=0;pe-=1){let ye=we[pe];if(ye.type!=="message"||ye.message.role!=="system"||ye.message.source!=="background_notification")continue;let xe=NF(ye);if(xe){R=pe,Z=xe.callId;break}}for(let pe=R-1;pe>=0;pe-=1){let ye=we[pe];if(ye.type==="parallel_agents"&&(!Z||ye.agents.some(xe=>xe.callId===Z)))return{key:ye.key}}return{key:null}},[$t,we]),wl=(0,I.useRef)(null),vd=O1e(wl,!X),[ic,Nm]=(0,I.useState)(()=>new Set),kp=(0,I.useCallback)((R,Z)=>{Nm(pe=>{if(pe.has(R)===Z)return pe;let ye=new Set(pe);return Z?ye.add(R):ye.delete(R),ye})},[]),dc=(0,I.useRef)(null),kd=(0,I.useMemo)(()=>{var R,Z;if(!vd)return VFe;let pe=cFe(H);return(((R=dc.current)==null?void 0:R.signature)!==pe||((Z=dc.current)==null?void 0:Z.t)!==at)&&(dc.current={signature:pe,t:at,entries:iFe(H,at)}),dc.current.entries},[vd,H,at]),Dm=(0,I.useMemo)(()=>new Map(kd.map((R,Z)=>[R.id,Z])),[kd]),Np=(0,I.useMemo)(()=>WYe(H),[H]),[Qw,Dp]=(0,I.useState)(null),Um=Qw!==null?((Be=kd[Qw.currentIndex])==null?void 0:Be.id)??Np:Np,Up=(0,I.useRef)(void 0),Ac=(0,I.useMemo)(()=>{let R=Up.current,Z;return be&&Q&&R?.sourceMessages===Ve.current&&R?.isResponding===Q&&R.latestTurnAwaitsAgentSummary===_s&&R.gateBackgroundAgentStatus===ja?Z=R.value:Z=ZYe(we,{isResponding:Q,latestTurnAwaitsAgentSummary:_s,gateBackgroundAgentStatus:ja}),Up.current={sourceMessages:e,isResponding:Q,latestTurnAwaitsAgentSummary:_s,gateBackgroundAgentStatus:ja,value:Z},Z},[we,e,be,ja,Q,_s]),{collapseCompletedTurns:Sm}=fr(),cc=Sm??!0,[Nd,hc]=(0,I.useState)(()=>new Map),[li,Dd]=(0,I.useState)(()=>new Set),si=(0,I.useRef)(new Map),[Sp,Gm]=(0,I.useTransition)(),wc=(0,I.useRef)(!1),uc=(0,I.useRef)(new Map),oi=(0,I.useRef)(void 0),en=(0,I.useRef)([]),ri=(0,I.useRef)(!0);t&&(ri.current=!1);let aa=(0,I.useRef)(!1),Gp=(0,I.useRef)(0),Ud=(0,I.useRef)(0),Ns=(0,I.useRef)(!1),fs=(0,I.useRef)(0),ni=(0,I.useRef)(!1),ii=(0,I.useRef)(0),Xa=(0,I.useRef)(null),Sd=(0,I.useRef)(!1),Ir=(0,I.useRef)(null),zp=(0,I.useRef)(null),Ew=(0,I.useRef)(!1),gc=(0,I.useRef)(null),di=(0,I.useRef)(!1),T=(0,I.useRef)(c),ne=(0,I.useRef)(!!c),Ie=(0,I.useRef)(void 0),qe=(0,I.useRef)(void 0),ft=(0,I.useRef)(W),Kt=(0,I.useRef)(null),Ko=(0,I.useRef)(h),$s=(0,I.useRef)(h),Oo=(0,I.useRef)(!1),pc=(0,I.useRef)(!1),tn=(0,I.useRef)(void 0),Gd=(0,I.useRef)(void 0);$s.current=h;let Ds=(0,I.useRef)(!1),Us=(0,I.useRef)(void 0),yw=(0,I.useRef)(void 0),an=(0,I.useRef)(void 0),Mw=(0,I.useRef)(void 0),Yw=(0,I.useRef)(void 0),bc=(0,I.useRef)(void 0),Rp=(0,I.useRef)(void 0),zm=(0,I.useRef)(B),Rm=(0,I.useRef)(x);zm.current=B,Rm.current=x||t;let Lm=(0,I.useRef)(null),[Fa,Cr]=(0,I.useState)(null),Lx=(0,I.useRef)(!1);Lx.current=Fa?.virtual===!0;let Tx=(0,I.useRef)(H.length);(0,I.useLayoutEffect)(()=>{Tx.current=H.length},[H.length]);let Tm=(0,I.useRef)(e);(0,I.useLayoutEffect)(()=>{Tm.current=e},[e]);let[w7,Lp]=(0,I.useState)(!1),[u7,g7]=(0,I.useState)(a);u7!==a&&(g7(a),si.current.clear(),fs.current+=1,Ns.current=!1,Ds.current=!1,Cr(null),hc(R=>R.size?new Map:R),Dd(R=>R.size?new Set:R)),(0,I.useEffect)(()=>{w||(Ds.current=!1,Lm.current=null)},[w]);let Fw=(0,I.useCallback)(()=>{let R=wl.current,Z=R?R.scrollHeight-R.scrollTop-R.clientHeight:0,pe=!ri.current&&Z>1;zp.current!==pe&&(zp.current=pe,le?.(pe))},[le]),Zl=(0,I.useCallback)(()=>{Gd.current!==void 0&&window.cancelAnimationFrame(Gd.current),Gd.current=window.requestAnimationFrame(Fw)},[Fw]),Rt=(0,I.useCallback)(R=>{ve.current&&(R=!1),ri.current!==R&&(ri.current=R,Zl())},[Zl]),Bc=(0,I.useRef)(void 0),jm=(0,I.useRef)(!1),Nl=(0,I.useMemo)(()=>{var R;jm.current=!1;let Z=[ae,Nd,Q,F,l,$t,kl,ra,Bs,cc,O,_,q,ic,ut,s,ge,de,P,li],pe=Bc.current,ye=we[we.length-1];if(be&&Q&&pe&&pe.sourceMessages===Ve.current&&jYe(pe.dependencies,Z)&&ye?.type==="message"){let Ha=em(ye),Qo=-1;for(let Vl=pe.value.length-1;Vl>=0;Vl-=1)if(em(pe.value[Vl])===Ha){Qo=Vl;break}if(Qo>=0){let Vl=pe.value[Qo];if(Vl?.type==="message"){let eo=pe.value.slice();return eo[Qo]={...Vl,message:ye.message},Bc.current={sourceMessages:e,dependencies:Z,value:eo,virtualizerItems:pe.virtualizerItems},jm.current=!0,eo}}}let xe=xFe(we,{overrides:Nd,isResponding:Q,activeTurnStartedAt:F,terminalBackgroundShellTaskIds:l,backgroundSummaryGraceActive:$t,waitForUnmatchedAgentCompletions:kl||!ra,waitForOrderedNarration:!Bs,automaticallyExpandedAgentKeys:ic,pendingApprovalCallId:s?.toolCallId??null,includeSubagentToolUsageInMetrics:q,paginatedExpanded:ae?new Set([...li,...ae]):li,enabled:cc}),vt=ae?xe.map(Ha=>{if(!("turnCollapse"in Ha)||!Ha.turnCollapse||!ae.has(Ha.turnCollapse.turnId))return Ha;let{turnId:Qo,collapsed:Vl,hiddenCount:eo}=Ha.turnCollapse;return{...Ha,turnCollapse:{turnId:Qo,collapsed:Vl,hiddenCount:eo}}}):xe,ga=!1,ma=_?vt.map(Ha=>ga||Ha.type!=="turn_collapse"?Ha:(ga=!0,{...Ha,turnCollapse:{...Ha.turnCollapse,..._.durationMs!==void 0&&_.durationMs>0?{elapsedMs:_.durationMs}:{},..._.inputTokens!==void 0?{inputTokens:_.inputTokens}:{},..._.outputTokens!==void 0?{outputTokens:_.outputTokens}:{},..._.cachedTokens!==void 0?{cachedTokens:_.cachedTokens}:{}}})):vt,kt=qYe(ma,ic);if(!O)return Bc.current={sourceMessages:e,dependencies:Z,value:kt,virtualizerItems:kt},kt;let la=(R=H.find(Ha=>Ha.role==="user"))==null?void 0:R.id,Lt=la?kt.filter(Ha=>Ha.type!=="message"||Ha.message.id!==la):kt;return Bc.current={sourceMessages:e,dependencies:Z,value:Lt,virtualizerItems:Lt},Lt},[we,be,Nd,Q,F,l,$t,kl,ra,Bs,cc,ae,O,_,q,H,e,ic,ut,s,ge,de,P,li]),fc=((et=Bc.current)==null?void 0:et.sourceMessages)===e?Bc.current.virtualizerItems:Nl,xw=(0,I.useCallback)(R=>fc.some(Z=>String(em(Z))===R),[fc]),Hm=(0,I.useRef)(void 0),p7=(0,I.useMemo)(()=>{var R;if(jm.current&&((R=Hm.current)==null?void 0:R.length)===Nl.length)return Hm.current.value;let Z=qJ(Nl);return Hm.current={length:Nl.length,value:Z},Z},[Nl]),b7=kd.length>=Qhe,Po=v!=null,mc=!!c,Ai=!!E,_l=Ai?1:0,zd=_l+Nl.length,vw=zd+(Po?1:0),B7=_l+we.length+(Po?1:0),ln=UFe(B7,G),Jl=(0,I.useCallback)(()=>wl.current,[]),jx=(0,I.useCallback)(()=>{let R=wl.current;if(!R)return;let Z=R.scrollHeight-R.scrollTop-R.clientHeight<tm;aa.current=!Z,Rt(Z),Zl()},[Zl,Rt]),kw=(0,I.useCallback)(()=>{Gp.current=Date.now()+1e3},[]),Tp=(0,I.useCallback)(()=>{Yw.current!==void 0&&(window.clearTimeout(Yw.current),Yw.current=void 0)},[]),qo=(0,I.useCallback)(()=>{var R;Tp(),(R=bc.current)==null||R.abort(),bc.current=void 0},[Tp]),Ic=(0,I.useCallback)(()=>{Tp();let R=Rp.current;if(R){if(b?.getSnapshot().lastEventId===R.lastEventId)return;Rp.current=void 0}!C||bc.current!==void 0||aa.current||Rm.current||zm.current<=qj||(Yw.current=window.setTimeout(()=>{if(Yw.current=void 0,Rm.current||aa.current||zm.current<=qj)return;let Z=wl.current;if(!Z||Z.scrollHeight-Z.scrollTop-Z.clientHeight>=tm)return;let pe=new AbortController;bc.current=pe,C(pe.signal).then(()=>{if(pe.signal.aborted)return;let ye=b?.getSnapshot();Rp.current={...ye?.lastEventId!==void 0?{lastEventId:ye.lastEventId}:{}}}).catch(ye=>{ye instanceof Error&&ye.name==="AbortError"||console.warn("[MessageList] transcript reload failed:",ye)}).finally(()=>{bc.current===pe&&(bc.current=void 0)})},RYe))},[Tp,C,b]);(0,I.useEffect)(()=>{Rp.current=void 0},[b]),(0,I.useEffect)(()=>{if(!b)return qo;let R=b.getSnapshot().lastEventId,Z=b.subscribe(()=>{let pe=b.getSnapshot().lastEventId;pe!==R&&(R=pe,Ic())});return()=>{Z(),qo()}},[b,Ic,qo]),(0,I.useEffect)(()=>{if(x){qo();return}Ic()},[qo,x,Ic,B]);let Cc=(0,I.useCallback)(()=>{pc.current=!0,tn.current!==void 0&&window.cancelAnimationFrame(tn.current),tn.current=window.requestAnimationFrame(()=>{pc.current=!1,tn.current=void 0,jx()})},[jx]);(0,I.useEffect)(()=>()=>{tn.current!==void 0&&window.cancelAnimationFrame(tn.current),Gd.current!==void 0&&window.cancelAnimationFrame(Gd.current),Us.current!==void 0&&window.cancelAnimationFrame(Us.current),yw.current!==void 0&&window.cancelAnimationFrame(yw.current),an.current!==void 0&&window.cancelAnimationFrame(an.current),qo(),Ie.current!==void 0&&window.cancelAnimationFrame(Ie.current),qe.current!==void 0&&window.cancelAnimationFrame(qe.current)},[qo]);let Hx=(0,I.useCallback)((R,Z)=>{var pe;let ye=wl.current;(!ye||ye.scrollHeight>ye.clientHeight+1)&&(aa.current=!0,Rt(!1)),Cc(),oi.current!==void 0&&window.clearTimeout(oi.current),uc.current.clear(),(pe=wl.current)==null||pe.querySelectorAll("[data-message-row-key]").forEach(xe=>{let vt=xe.dataset.messageRowKey;vt&&uc.current.set(vt,xe.getBoundingClientRect().top)}),wc.current=!0,Gm(()=>{Dd(xe=>{if(!xe.has(R))return xe;let vt=new Set(xe);return vt.delete(R),vt}),hc(xe=>{let vt=new Map(xe);return vt.set(R,Z),vt})})},[Cc,Rt]);(0,I.useLayoutEffect)(()=>{var R;if(Sp||!wc.current)return;wc.current=!1;for(let pe of en.current)pe.cancel();en.current=[];let Z=typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;Z||(R=wl.current)==null||R.querySelectorAll("[data-message-row-key]").forEach(pe=>{if(typeof pe.animate!="function")return;let ye=pe.dataset.messageRowKey,xe=ye?uc.current.get(ye):void 0;if(xe===void 0){en.current.push(pe.animate([{opacity:0},{opacity:1}],{duration:GY,easing:"ease-out"}));return}let vt=xe-pe.getBoundingClientRect().top;Math.abs(vt)<1||en.current.push(pe.animate([{translate:`0 ${vt}px`},{translate:"0 0"}],{duration:GY,easing:"ease-out"}))}),uc.current.clear(),oi.current=window.setTimeout(()=>{oi.current=void 0,Cc()},Z?0:GY)},[Cc,Sp]),(0,I.useEffect)(()=>()=>{oi.current!==void 0&&window.clearTimeout(oi.current);for(let R of en.current)R.cancel();en.current=[]},[]);let f7=(0,I.useCallback)(R=>{let Z=R.target;Z instanceof HTMLElement&&Z.closest("[aria-expanded]")&&(aa.current=!0,Rt(!1),Cc())},[Cc,Rt]),Rd=(0,I.useCallback)(R=>{if(Ai&&R===jY)return"slot:header";if(Po&&R===zd)return`slot:tail:${S}`;let Z=fc[R-_l];return Z?em(Z):`slot:row:${R}`},[Ai,Po,zd,S,fc,_l]),m7=(0,I.useCallback)(R=>{if(Ai&&R===jY)return vFe;if(Po&&R===zd)return DFe;let Z=fc[R-_l];return Z?.type==="turn_collapse"?NFe:kFe},[Ai,Po,_l,zd,fc]),Wl=(0,I.useCallback)((R="auto")=>{if(ve.current)return;let Z=Jl();if(!Z||Z.scrollHeight<=Z.clientHeight)return;Sd.current=!1,ii.current+=1;let pe=ii.current;ni.current=!0,R==="smooth"?Z.scrollTo({top:Z.scrollHeight,behavior:R}):Z.scrollTop=Z.scrollHeight,Zl(),Ud.current=Math.max(0,Z.scrollHeight-Z.clientHeight),Fw();let ye=()=>{if(ii.current!==pe||(ni.current=!1,!Sd.current)||(Sd.current=!1,$s.current||aa.current))return;let xe=Jl();!xe||xe.scrollHeight<=xe.clientHeight||(Rt(!0),xe.scrollTop=xe.scrollHeight,Zl(),Ud.current=Math.max(0,xe.scrollHeight-xe.clientHeight),Fw())};R==="smooth"?setTimeout(ye,350):requestAnimationFrame(ye)},[Jl,Fw,Zl,Rt]),Jx=(0,I.useCallback)((R="smooth")=>{aa.current=!1,Rt(!0),Wl(R)},[Wl,Rt]),Xo=zse({count:vw,enabled:ln,getScrollElement:Jl,getItemKey:Rd,estimateSize:m7,overscan:20,anchorTo:"end",useFlushSync:!1,useAnimationFrameWithResizeObserver:!0,directDomUpdates:!0});Xo.shouldAdjustScrollPositionOnItemSizeChange=(R,Z,pe)=>{var ye;return SFe(R.end,((ye=wl.current)==null?void 0:ye.scrollTop)??pe.scrollOffset??0)};let I7=(0,I.useCallback)(R=>{if(Xo.measureElement(R),!R||!Lx.current)return;let Z=Number(R.dataset.index);Number.isFinite(Z)&&!Xo.itemSizeCache.has(Rd(Z))&&Xo.resizeItem(Z,R.offsetHeight)},[Rd,Xo]);(0,I.useLayoutEffect)(()=>{if(!Fa)return;let R=wl.current;if(Fa.rowKey&&!xw(Fa.rowKey)){let Z=aFe(Tm.current,Fa.rowKey);if(Z!==void 0&&lFe(Nl,Z)&&Nd.get(Z)!==!1&&!li.has(Z)){Dd(pe=>pe.has(Z)?pe:new Set(pe).add(Z)),Cr(pe=>pe&&{...pe,rowKey:`msg:${Z}`});return}Fa.generation===fs.current&&(fs.current+=1),Ns.current=!1,Mw.current=void 0,Lp(!1),Cr(null);return}if(Fa.settled){if(!R){Ns.current=!1,Cr(null);return}if(Fa.virtual?H.length===Fa.messageCount:R.scrollHeight===Fa.scrollHeight){if(Ns.current=!1,Us.current!==void 0)return;let Z=t8,pe=()=>{if(Us.current=void 0,Fa.generation===fs.current&&Tx.current===Fa.messageCount){if(Z-=1,Z>0){Us.current=requestAnimationFrame(pe);return}Cr(ye=>ye===Fa?null:ye)}};Us.current=requestAnimationFrame(pe);return}Us.current!==void 0&&(cancelAnimationFrame(Us.current),Us.current=void 0),Us.current=requestAnimationFrame(()=>{if(Us.current=void 0,Fa.generation!==fs.current)return;if(Fa.rowKey&&!xw(Fa.rowKey)){Ns.current=!1,Cr(null);return}let Z=Fa.rowKey?Array.from(R.querySelectorAll("[data-message-row-key]")).find(pe=>pe.dataset.messageRowKey===Fa.rowKey):void 0;Z&&Fa.rowTop!==void 0?R.scrollTop+=Z.getBoundingClientRect().top-Fa.rowTop:R.scrollTop=Fa.scrollTop+Math.max(0,R.scrollHeight-Fa.scrollHeight),Ns.current=!1,Cr(null)})}},[xw,H.length,Fa,Nl,Nd,li]);let Wx=Xo.getVirtualItems(),Qc=Xo.getTotalSize(),Vx=(0,I.useRef)({entryIndexById:new Map,headerOffset:0,isVisible:!1,turnIdByDisplayIndex:[],visibleItems:[]});Vx.current={entryIndexById:Dm,headerOffset:_l,isVisible:vd,turnIdByDisplayIndex:p7,visibleItems:Nl};let Kx=(0,I.useCallback)(()=>{let R=Jl(),Z=Vx.current;if(!R||!Z.isVisible||Z.entryIndexById.size===0){Dp(Lt=>Lt===null?Lt:null);return}let pe=R.getBoundingClientRect(),ye=pe.top,xe=pe.bottom,vt=ye+(xe-ye)/2,ga=[],ma=null,kt=Number.POSITIVE_INFINITY;R.querySelectorAll("[data-index]").forEach(Lt=>{let Ha=Lt.dataset.index;if(Ha===void 0)return;let Qo=Number(Ha);if(!Number.isFinite(Qo))return;let Vl=Qo-Z.headerOffset;if(Vl<0||Vl>=Z.visibleItems.length)return;let eo=Lt.getBoundingClientRect();if(eo.bottom<ye||eo.top>xe)return;ga.push(Vl);let Q7=eo.top+(eo.bottom-eo.top)/2,Zx=Math.abs(Q7-vt);Zx<kt&&(kt=Zx,ma=Vl)});let la=IFe(Z.visibleItems,ga,Z.entryIndexById,ma,Z.turnIdByDisplayIndex);Dp(Lt=>Lt?.startIndex===la?.startIndex&&Lt?.endIndex===la?.endIndex&&Lt?.currentIndex===la?.currentIndex?Lt:la)},[Jl]),ci=(0,I.useCallback)(()=>{Ir.current!==null&&cancelAnimationFrame(Ir.current),Ir.current=requestAnimationFrame(()=>{Ir.current=null,Kx()})},[Kx]);(0,I.useEffect)(()=>()=>{Xa.current!==null&&(clearTimeout(Xa.current),Xa.current=null),Ir.current!==null&&(cancelAnimationFrame(Ir.current),Ir.current=null)},[]),(0,I.useEffect)(()=>{ci()},[ci,vw,Qc,ln,Wx.length,vd]);let[Nw,Jm]=(0,I.useState)(null);(0,I.useEffect)(()=>{if(!Nw)return;let R=setTimeout(()=>Jm(null),1600);return()=>clearTimeout(R)},[Nw]);let Wm=(0,I.useCallback)((R,Z)=>{var pe,ye;aa.current=!0,Rt(!1),ii.current+=1;let xe=ii.current;if(ni.current=!0,ln)if(ve.current){let vt=Xo.getOffsetForIndex(R,"center");vt&&wl.current&&(wl.current.scrollTop=vt[0])}else Xo.scrollToIndex(R,{align:"center"});else(ye=(pe=wl.current)==null?void 0:pe.querySelector(`[data-index="${R}"]`))==null||ye.scrollIntoView({block:"center"});Xa.current!==null&&clearTimeout(Xa.current),Xa.current=setTimeout(()=>{Xa.current=null,ii.current===xe&&(ni.current=!1,ci(),Zl())},150),Jm(null),requestAnimationFrame(()=>Jm(Z))},[ln,Xo,Rt,ci,Zl]),Ox=(0,I.useRef)({visibleItems:[],displayItems:[],headerOffset:0,performScrollToRow:()=>{}});Ox.current={visibleItems:Nl,displayItems:we,headerOffset:_l,performScrollToRow:Wm};let Ld=(0,I.useRef)(null),Vm=(0,I.useCallback)((R,Z)=>{let{visibleItems:pe,displayItems:ye,headerOffset:xe,performScrollToRow:vt}=Ox.current,ga=TY(pe,R,Z);if(ga>=0)return Ld.current=null,vt(ga+xe,{messageId:R,callId:Z}),!0;let ma=TY(ye,R,Z);if(ma<0)return!1;let kt=PJ(ye,ma);return kt?(Ld.current={messageId:R,callId:Z},hc(la=>{if(la.get(kt)===!0)return la;let Lt=new Map(la);return Lt.set(kt,!0),Lt}),!0):!1},[]);(0,I.useImperativeHandle)(K,()=>({scrollToMessage:Vm,scrollToBottom:Jx}),[Vm,Jx]),(0,I.useEffect)(()=>{let R=Ld.current;if(!R)return;let Z=TY(Nl,R.messageId,R.callId);Z<0||(Ld.current=null,Wm(Z+_l,R))},[Nl,_l,Wm]);let Qr=(0,I.useCallback)(async(R=!1,Z=!1)=>{let pe=wl.current;if(!pe||!f||u||Ns.current||p&&!Z||Ds.current&&!R)return;Ds.current=!1,Ns.current=!0;let ye=++fs.current;Us.current!==void 0&&(cancelAnimationFrame(Us.current),Us.current=void 0),Lp(!Z);let xe;if(ln){let la=String(Rd(_l)),Lt=t8;if(xe=await new Promise(Ha=>{let Qo=()=>{if(yw.current=void 0,ye!==fs.current||wl.current!==pe||!xw(la)||Lt--<=0){Ha(void 0);return}let Vl=Array.from(pe.querySelectorAll("[data-message-row-key]")).find(eo=>eo.dataset.messageRowKey===la);Vl?Ha({rowKey:la,rowTop:Vl.getBoundingClientRect().top}):yw.current=requestAnimationFrame(Qo)};yw.current=requestAnimationFrame(Qo)}),!xe){ye===fs.current&&(Ns.current=!1,Mw.current=void 0,Lp(!1));return}}let vt=pe.scrollHeight,ga=pe.scrollTop,ma=pe.getBoundingClientRect().top,kt=xe?void 0:Array.from(pe.querySelectorAll("[data-message-row-key]")).find(la=>{let Lt=la.dataset.messageRowKey;return Lt!==void 0&&Lt.startsWith("msg:")&&la.getBoundingClientRect().bottom>ma});aa.current=!0,Cr({scrollHeight:vt,scrollTop:ga,messageCount:H.length,virtual:ln,settled:!1,generation:ye,...xe??(kt?{rowKey:kt.dataset.messageRowKey,rowTop:kt.getBoundingClientRect().top}:{})});try{si.current.set(ye,{ids:new Set(Tm.current.map(Lt=>Lt.id)),resolved:!1}),await f(Z?{force:!0}:void 0);let la=si.current.get(ye);la&&(la.resolved=!0),ye===fs.current&&Cr(Lt=>Lt?.generation===ye?{...Lt,settled:!0}:Lt)}catch{si.current.delete(ye),ye===fs.current&&(Ds.current=!0,Ns.current=!1,Cr(null))}finally{ye===fs.current&&Lp(!1)}},[u,f,p,Rd,xw,_l,H.length,ln]),C7=(0,I.useCallback)(()=>{Qr(!0,!0)},[Qr]);(0,I.useLayoutEffect)(()=>{let R=si.current;if(R.size===0)return;let Z=e.find(ga=>!(ga!=null&&ga.id.startsWith("local-")));if(!Z)return;let pe=R.entries().next().value;if(!pe)return;let[ye,xe]=pe;if(xe.ids.has(Z.id))return;let vt=[];for(let ga=0;ga<e.length;ga++){let ma=e[ga];if(!ma||!mo(ma)||xe.ids.has(ma.id))continue;let kt=!1;for(let la=ga+1;la<e.length;la++){let Lt=e[la];if(mo(Lt))break;if(xe.ids.has(Lt.id)){kt=!0;break}}kt&&vt.push(ma.id)}if(vt.length===0){if(!xe.resolved)return}else Dd(ga=>{let ma=null;for(let kt of vt)ga.has(kt)||(ma??(ma=new Set(ga)),ma.add(kt));return ma??ga});R.delete(ye);for(let ga of R.values())for(let ma of e)ma&&ga.ids.add(ma.id)},[e]),(0,I.useEffect)(()=>{let R=Mw.current;if(R===void 0||u||Fa||Ns.current||(Mw.current=void 0,!w||R!==fs.current))return;let Z=Jl();Z&&Z.scrollTop<=HY&&Qr(!0)},[Jl,w,Qr,u,Fa]);let Km=(0,I.useCallback)(()=>{let R=Jl();if(!R)return;let Z=R.scrollTop;w&&Z<=HY&&Qr(!0);let pe=Date.now()<=Gp.current;if(ni.current&&!pe){Ud.current=Z;return}ci();let ye=Ud.current;Ud.current=Z;let xe=R.scrollHeight-Z-R.clientHeight;if(Zl(),Z<ye-1){let vt=xe<tm;pe?(qo(),aa.current=!0,Rt(!1)):vt?(aa.current=!1,Rt(!0)):aa.current||(qo(),Rt(!1));return}xe<tm?(aa.current=!1,Rt(!0),Ic()):qo()},[Jl,w,Qr,Zl,ci,Ic,qo,Rt]);(0,I.useEffect)(()=>{let R=Jl();if(R)return R.addEventListener("scroll",Km,{passive:!0}),()=>R.removeEventListener("scroll",Km)},[Jl,Km]);let jp=(0,I.useCallback)(()=>{if(!w||u||h||mc)return;let R=Jl();if(!R||R.scrollHeight>R.clientHeight+1)return;let Z=Lm.current;if(Z!==null&&Z.loader===f&&Z.totalVirtualSize===Qc){Ds.current=!0;return}Lm.current={loader:f,totalVirtualSize:Qc},Qr()},[h,Jl,w,Qr,u,f,mc,Qc]);(0,I.useEffect)(()=>{jp()},[jp,Qc]),(0,I.useEffect)(()=>{let R=Jl();if(!R)return;let Z=()=>{if(an.current=void 0,!(R.scrollTop>HY)){if(u||Ns.current){Mw.current=fs.current;return}Qr(!0)}},pe=()=>{an.current!==void 0&&cancelAnimationFrame(an.current),an.current=requestAnimationFrame(Z)},ye=kt=>{kw(),kt.deltaY<0&&pe()},xe=()=>{kw()},vt=()=>pe(),ga=kt=>{let la=R.getBoundingClientRect(),Lt=20;(kt.clientX>=la.right-Lt||kt.clientY>=la.bottom-Lt)&&kw()},ma=kt=>{(kt.key==="ArrowUp"||kt.key==="ArrowDown"||kt.key==="PageUp"||kt.key==="PageDown"||kt.key==="Home"||kt.key==="End"||kt.key===" ")&&(kw(),(kt.key==="ArrowUp"||kt.key==="PageUp"||kt.key==="Home")&&pe())};return R.addEventListener("wheel",ye,{passive:!0}),R.addEventListener("touchstart",xe,{passive:!0}),R.addEventListener("touchmove",vt,{passive:!0}),R.addEventListener("pointerdown",ga,{passive:!0}),R.addEventListener("keydown",ma,{passive:!0}),()=>{R.removeEventListener("wheel",ye),R.removeEventListener("touchstart",xe),R.removeEventListener("touchmove",vt),R.removeEventListener("pointerdown",ga),R.removeEventListener("keydown",ma),an.current!==void 0&&(cancelAnimationFrame(an.current),an.current=void 0)}},[Jl,Qr,u,kw]),(0,I.useEffect)(()=>{let R=Jl();if(!R||typeof ResizeObserver>"u")return;let Z=new ResizeObserver(()=>{Zl(),jp(),!($s.current||aa.current)&&(Rt(!0),Wl())});Z.observe(R);for(let ye of Array.from(R.children))Z.observe(ye);let pe=new MutationObserver(ye=>{for(let xe of ye){for(let vt of Array.from(xe.addedNodes))vt instanceof HTMLElement&&Z.observe(vt);for(let vt of Array.from(xe.removedNodes))vt instanceof HTMLElement&&Z.unobserve(vt)}Zl()});return pe.observe(R,{childList:!0}),Zl(),()=>{Z.disconnect(),pe.disconnect()}},[Jl,jp,Zl,Wl,Rt]),(0,I.useEffect)(()=>{e.length===0&&(aa.current=!1,Sd.current=!1,Rt(!0),Ld.current=null,si.current.clear(),hc(R=>R.size?new Map:R),Dd(R=>R.size?new Set:R))},[e.length,Rt]),(0,I.useEffect)(()=>{let R=wl.current;if(!R)return;let Z=new ResizeObserver(()=>{ci(),!$s.current&&(aa.current||(Rt(!0),requestAnimationFrame(()=>{!$s.current&&!aa.current&&Wl()})))});return Z.observe(R),()=>Z.disconnect()},[Wl,ci,Rt]),(0,I.useLayoutEffect)(()=>{let R=HYe(e);if(h||c||T.current){gc.current=R,Ew.current=!0,di.current=!1,T.current=c;return}if(T.current=c,!Ew.current){gc.current=R,Ew.current=!0,di.current=!1;return}let Z=JYe(e);R&&Z?.role==="user"&&R!==gc.current?(aa.current=!1,Rt(!0),Ld.current=null,di.current=!0):di.current=!1,gc.current=R},[e,h,c,Rt]),(0,I.useLayoutEffect)(()=>{Ko.current&&!h&&(aa.current=!1,Rt(!0),Wl("auto")),Ko.current=h},[h,Wl,Rt]),(0,I.useLayoutEffect)(()=>{if(c){ne.current=!0;return}if(!ne.current||h||e.length===0)return;ne.current=!1,aa.current=!1,Rt(!0),Ld.current=null,Ie.current!==void 0&&window.cancelAnimationFrame(Ie.current),qe.current!==void 0&&window.cancelAnimationFrame(qe.current);let R=()=>{$s.current||aa.current||(Rt(!0),Wl("auto"))};Ie.current=window.requestAnimationFrame(()=>{Ie.current=void 0,R(),qe.current=window.requestAnimationFrame(()=>{qe.current=void 0,R()})})},[h,c,e.length,Wl,Rt]),(0,I.useLayoutEffect)(()=>{let R=ft.current!==W;ft.current=W,R&&(h||aa.current||(Rt(!0),requestAnimationFrame(()=>{!$s.current&&!aa.current&&Wl("auto")})))},[W,h,Wl,Rt]);let Hp=(0,I.useMemo)(()=>uFe(Nl),[Nl]);(0,I.useLayoutEffect)(()=>{if(!h){if(!Hp){Kt.current=null;return}Hp!==Kt.current&&(Kt.current=Hp,(ri.current||!aa.current)&&requestAnimationFrame(()=>{aa.current||(Rt(!0),Wl())}))}},[h,Hp,Wl,Rt]),(0,I.useEffect)(()=>{J&&Po&&!Oo.current&&(aa.current=!1,Rt(!0),requestAnimationFrame(()=>{aa.current||Wl()})),Oo.current=Po},[J,Po,Wl,Rt]);let Px=(0,I.useCallback)(R=>{let Z=xe=>{if(xe.type==="parallel_agents")return(0,A.jsx)(OY,{timestamp:xe.timestamp,children:(0,A.jsx)("div",{className:$H(xe,Nw)?Yd.flash:void 0,children:(0,A.jsx)(f5,{agents:xe.agents,autoManageExpansion:dt==="interactive"&&!h,automaticCollapseDelayMs:$r.key===xe.key&&!_s?LYe:void 0,deferAutomaticCollapse:$r.key===xe.key&&_s,expandActiveWhenLive:Q&&mr.has(xe.key),onAutomaticExpansionChange:la=>kp(xe.key,la),pendingApproval:s})})});if(xe.type==="turn_outputs")return(0,A.jsx)(L1e,{changes:xe.changes,turnId:xe.turnId,artifacts:xe.artifacts,scheduledTasks:xe.scheduledTasks,workspaceCwd:Y,onOpenRequest:oe,onReviewChanges:re??SY,onOpenArtifact:ie??SY,onOpenScheduledTask:$??SY,onError:me});if(xe.type==="turn_collapse")return(0,A.jsx)(TFe,{turnCollapse:xe.turnCollapse,onToggleCollapse:Hx});let vt=xe.message.role==="assistant"?Ac.get(xe.message.id):void 0,ga;xe.message.role==="assistant"&&vt&&!t&&(ga={turnId:vt,message:{id:xe.message.id,content:xe.message.content,isStreaming:xe.message.isStreaming,timestamp:xe.message.timestamp}});let ma=xe.message.role==="assistant"?xe.message.branchRecordId:void 0,kt=xe.message.role==="user"?xe.message.content:void 0;return(0,A.jsx)(_Me,{message:xe.message,pendingApproval:s,onShowContextDetail:o,onImagePreview:r,onAttachmentPreview:n,onInsightReportOpen:i,onEditUserMessage:d&&!Q&&!w&&!g&&xe.message.role==="user"&&kt!==void 0&&xe.message.id===Tt.lastId?()=>d(Tt.turnIndexById.get(xe.message.id)??0,kt):void 0,workspaceCwd:Y,showRetryHint:Ae,onRetryClick:N,sendFailed:xe.message.role==="user"&&xe.message.id===ce,onRetrySend:j,onBranchSession:D,branchRecordId:ma,showAssistantActions:xe.message.role==="assistant"&&Ac.has(xe.message.id),showAssistantBranch:xe.message.role==="assistant"&&!Q&&ma!==void 0,isLocateFlashing:$H(xe,Nw),assistantTurnFooterInfo:ga,generateContent:Ce})};if(Ai&&R===jY)return E;if(Po&&R===zd)return v;let pe=R-_l,ye=Nl[pe];return ye?Z(ye):null},[Ai,E,Po,v,zd,s,h,Q,_s,mr,$r,dt,kp,o,r,n,i,d,Tt,w,g,Ce,_l,Nl,Nw,Ac,t,Y,Ae,N,ce,j,D,Hx,ie,$,re,oe,me]),qx=(0,I.useCallback)(R=>R?jFe(R):void 0,[]),Xx=ln?Qc:e;return(0,I.useLayoutEffect)(()=>{if(h)return;let R=di.current;if(ni.current&&!R){aa.current||(Sd.current=!0);return}pc.current&&!R||(ri.current||R||!aa.current)&&(aa.current||Rt(!0),Wl(R?"smooth":"auto"),di.current=!1)},[Xx,vw,h,Wl,Rt]),(0,I.useLayoutEffect)(()=>{Zl()},[Xx,Zl,vw]),(0,A.jsxs)("div",{ref:wl,className:UF(Yt.list,Ai&&M?Yt.listWithWelcomeHeader:void 0),"data-web-shell-message-list":!0,onClickCapture:f7,children:[mc&&(0,A.jsx)(KFe,{label:at("editor.sessionLoading")}),u&&!mc&&!w7&&(0,A.jsx)("div",{className:Yt.historyStatus,role:"status",children:at("history.loadingEarlier")}),g&&!mc&&(0,A.jsx)("div",{className:Yt.historyStatus,role:"status",children:at("history.capacityReached")}),p&&!mc&&!g&&(0,A.jsxs)("div",{className:Yt.historyStatus,children:[(0,A.jsx)("span",{role:"status",children:at("history.paginationError")}),f&&(0,A.jsx)("button",{type:"button",className:Yt.historyRetryButton,onClick:C7,children:at("history.retry")})]}),(0,A.jsx)(WFe,{entries:kd,currentTurnId:Um,currentRange:Qw,hidden:!vd||!b7,onSelect:Vm}),ln?(0,A.jsx)("div",{ref:Xo.containerRef,className:Yt.virtualSizer,children:Wx.map(R=>(0,A.jsx)("div",{"data-index":R.index,ref:I7,className:UF(Yt.virtualRow,qx(Nl[R.index-_l])),"data-message-row-key":String(Rd(R.index)),"data-source-block-ids":e8(Nl[R.index-_l],e),"data-web-shell-message-row":!0,style:{position:"absolute",top:0,left:0,right:0},children:Px(R.index)},R.key))}):Array.from({length:vw},(R,Z)=>{let pe=Rd(Z),ye=Nl[Z-_l];return(0,A.jsx)("div",{"data-index":Z,className:qx(ye),"data-message-row-key":String(pe),"data-source-block-ids":e8(ye,e),"data-web-shell-message-row":!0,children:Px(Z)},pe)})]})})),s8={en:{title:"Something went wrong",body:"An unexpected error occurred and this content could not be displayed.",retry:"Try again"},"zh-CN":{title:"\u51FA\u4E86\u70B9\u95EE\u9898",body:"\u53D1\u751F\u610F\u5916\u9519\u8BEF\uFF0C\u65E0\u6CD5\u663E\u793A\u6B64\u5185\u5BB9\u3002",retry:"\u91CD\u8BD5"}},PFe={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"0.75rem",padding:"2rem",minHeight:"8rem",height:"100%",textAlign:"center",color:"inherit"},qFe={margin:0,fontSize:"1rem",fontWeight:600},XFe={margin:0,fontSize:"0.85rem",opacity:.7,maxWidth:"32rem"},ZFe={appearance:"none",cursor:"pointer",padding:"0.4rem 1rem",fontSize:"0.85rem",borderRadius:"6px",border:"1px solid rgba(128, 128, 128, 0.4)",background:"transparent",color:"inherit"};function _Fe({error:e,onRetry:t,language:a="en"}){let l=s8[a]??s8.en;return(0,A.jsxs)("div",{role:"alert",style:PFe,"data-web-shell-error":!0,children:[(0,A.jsx)("p",{style:qFe,children:l.title}),(0,A.jsx)("p",{style:XFe,children:l.body}),!1,(0,A.jsx)("button",{type:"button",style:ZFe,onClick:t,children:l.retry})]})}function $Fe(e){let t=new Map;for(let a of e){if(a.kind!=="assistant"&&a.kind!=="user")continue;let l=vl(a.meta);if(l?.source!=="background_notification"||l.qwenDiscreteMessage!==!0)continue;let s=vl(l.backgroundTask),o=fo(s,"toolUseId"),r=fo(s,"status");s?.kind!=="agent"||!o||!r||t.set(o,{status:r,endTime:a.serverTimestamp??a.clientReceivedAt})}return t}function exe(e){return e.startsWith("Model switched: ")}var txe=/^[A-Za-z0-9_.-]+ \(unrecognized daemon event\): /,axe=["usage_update: {","a2ui: {"];function lxe(e){return e.debugReason!==void 0?e.debugReason.startsWith("unrecognized_"):e.kind!=="debug"?!1:txe.test(e.text)||axe.some(t=>e.text.startsWith(t))}function sxe(e){return e!=="loop_detected"}function oxe(e,t){return e.errorKind==="loop_detected"?t?.loopDetected??e.text:e.errorKind==="model_stream_interrupted"||e.source==="turn_error"&&e.text.trim().toLowerCase()==="terminated"?t?.modelStreamInterrupted??e.text:e.text}function rxe(e,t){return e===void 0?{}:t?{data:{...vl(e)??{value:e},errorKind:t}}:{data:e}}function nxe(e){if(!e||typeof e!="object")return null;let t=e;return typeof t.displayName=="string"&&t.displayName?t.displayName:typeof t.newSessionId=="string"?t.newSessionId.slice(0,8):null}function ixe(e){if(!e||typeof e!="object")return;let t=e.items;if(!Array.isArray(t)||t.length===0)return;let a=[];for(let l of t){if(!l||typeof l!="object")continue;let s=l.content;if(Array.isArray(s))for(let o of s){if(!o||typeof o!="object")continue;let r=o.type,n=o.data,i=o.mimeType;if(r==="image"&&typeof n=="string"&&typeof i=="string"){let d=o;a.push({data:n,mimeType:i,...typeof d.attachmentId=="string"?{attachmentId:d.attachmentId}:{}})}}}return a.length>0?a:void 0}function dxe(e){if(!e||typeof e!="object")return;let t=e.items;if(!Array.isArray(t))return;let a=t.flatMap(l=>{if(!l||typeof l!="object")return[];let s=l.content;return Array.isArray(s)?s.flatMap(o=>{if(!o||typeof o!="object")return[];let r=o;return r.type==="resource"&&typeof r.attachmentId=="string"?[{name:r.attachmentId,attachmentId:r.attachmentId,mimeType:typeof r.mimeType=="string"?r.mimeType:"application/octet-stream"}]:[]}):[]});return a.length>0?a:void 0}function Axe(e){if(!e||typeof e!="object")return;let t=e.items;if(!Array.isArray(t)||t.length===0)return;let a=[];for(let l of t){if(!l||typeof l!="object")continue;let s=l.content;if(Array.isArray(s))for(let o of s){if(!o||typeof o!="object"||o.type!=="text")continue;let r=o.text;typeof r=="string"&&r.length>0&&a.push(r)}}return a.length>0?a.join(`
|
|
620
620
|
`):void 0}function o8(e){var t;return((t=e.meta)==null?void 0:t.source)==="background_notification"}function r8(e){var t;return vl((t=e.meta)==null?void 0:t.backgroundTask)??void 0}function n8(e){return e.text.length===0}function i8(e,t){if(!e)return t;if(!t)return e;let a=(e.cachedTokens??0)+(t.cachedTokens??0);return{inputTokens:e.inputTokens+t.inputTokens,outputTokens:e.outputTokens+t.outputTokens,...a>0?{cachedTokens:a}:{}}}function cxe(e,t={}){var a,l,s,o;let r=[],n=t.includeSourceIdentity===!0,i=t.safeToolProjection===!0,d=((a=t.labels)==null?void 0:a.promptCancelled)??"Request cancelled.",c=new Map,h=new Map,w=new Map,u=$Fe(e),g=null,p=null,f=!1;for(let B=0;B<e.length;B++){let b=e[B],C=b.serverTimestamp??b.clientReceivedAt;switch(b.kind){case"user":{let Q=b;if(o8(Q)){g=null,p=null,f=!0,r.push({id:b.id,role:"system",content:Q.text,variant:"info",source:"background_notification",data:r8(Q),timestamp:C,sourceBlockIds:[b.id]});break}g=null,p=null,f=!1;let x=vl(Q.meta),F=fo(x,"source"),E=Array.isArray(x?.inputAnnotations)?x.inputAnnotations:void 0,M=(l=Q.images)==null?void 0:l.map(S=>({data:S.data,mimeType:S.mimeType||"image/*",...S.attachmentId?{attachmentId:S.attachmentId}:{}})),Y=(s=Q.files)==null?void 0:s.map(S=>({name:S.name,mimeType:S.mimeType||"text/plain",...S.data!==void 0?{data:S.data}:{},...S.text!==void 0?{text:S.text}:{},...S.attachmentId?{attachmentId:S.attachmentId}:{}}));if(F==="mid_turn_message_injected"){r.push({id:b.id,role:"system",content:Q.text,variant:"info",source:F,timestamp:C,...M&&M.length>0?{images:M}:{},...Y&&Y.length>0?{files:Y}:{}}),f=!0;break}let v={id:b.id,role:"user",content:Q.text,timestamp:C,sourceBlockIds:[b.id],...F?{source:F}:{},...E?{inputAnnotations:E}:{}};M&&M.length>0&&(v.images=M),Y&&Y.length>0&&(v.files=Y),r.push(v);break}case"assistant":{let Q=b;if(o8(Q)){g=null,p=null,f=!0,r.push({id:b.id,role:"system",content:Q.text,variant:"info",source:"background_notification",data:r8(Q),timestamp:C,sourceBlockIds:[b.id]});break}let x=vl(Q.meta);if(x?.source==="vision_bridge_notice"){g=null,p=null,f=!0,r.push({id:b.id,role:"system",content:Q.text,variant:"info",source:"vision_bridge_notice",...x.visionBridgeNotice!==void 0?{data:x.visionBridgeNotice}:{},timestamp:C});break}if(!Q.text&&!Q.usage)break;let F=Q.parentToolCallId?c.get(Q.parentToolCallId):void 0;if(F){d8(F,Q.text,b.id);break}let E=vxe(Q.text);if(E){let Y=null,v=!1,S=0,G=0,J=0,W=null;for(let X of E)X.kind==="insight"?X.data.type==="insight_progress"?Y=X.data:X.data.type==="insight_ready"?(v=!0,r.push({id:`${b.id}-ir-${S++}`,role:"insight_ready",path:X.data.path,timestamp:C,sourceBlockIds:[b.id]})):X.data.type==="insight_error"&&(v=!0,r.push({id:`${b.id}-ie-${G++}`,role:"insight_error",error:X.data.error,timestamp:C,sourceBlockIds:[b.id]})):(r.push({id:n?`${b.id}-t-${J++}`:`${b.id}-t-${r.length}`,role:"assistant",content:X.text,timestamp:C,sourceBlockIds:[b.id]}),g=r.length-1,W=g,p=null);if(Q.branchRecordId&&W!==null){let X=r[W];X?.role==="assistant"&&(r[W]={...X,branchRecordId:Q.branchRecordId})}Y&&!v&&r.push({id:`${b.id}-ip`,role:"insight_progress",stage:Y.stage,progress:Y.progress,detail:Y.detail,timestamp:C,sourceBlockIds:[b.id]}),f=!0;break}let M=g!==null?r[g]:void 0;if(M&&M.role==="assistant"&&!f&&Q.segmentId===void 0&&!n8(Q)){let Y=i8(M.usage,Q.usage);r[g]={...M,content:M.content+Q.text,isStreaming:Q.streaming,sourceBlockIds:$n(M.sourceBlockIds,b.id),...Q.branchRecordId?{branchRecordId:Q.branchRecordId}:{},...Y?{usage:Y}:{}},f=!1,p=null}else if(!n8(Q))r.push({id:b.id,role:"assistant",content:Q.text,isStreaming:Q.streaming,timestamp:C,sourceBlockIds:[b.id],...Q.branchRecordId?{branchRecordId:Q.branchRecordId}:{},...Q.usage?{usage:Q.usage}:{}}),g=r.length-1,p=null,f=!1;else if(Q.usage&&M&&M.role==="assistant"){let Y=i8(M.usage,Q.usage);r[g]={...M,...Q.branchRecordId?{branchRecordId:Q.branchRecordId}:{},...Y?{usage:Y}:{}}}break}case"thought":{let Q=b,x=Q.parentToolCallId?c.get(Q.parentToolCallId):void 0;if(x){d8(x,Q.text,b.id);break}let F=p!==null?r[p]:void 0;F&&F.role==="thinking"&&!f&&Q.segmentId===void 0?(r[p]={...F,content:F.content+Q.text,isStreaming:Q.streaming,sourceBlockIds:$n(F.sourceBlockIds,b.id)},f=!1):(r.push({id:b.id,role:"thinking",content:Q.text,isStreaming:Q.streaming,timestamp:C,sourceBlockIds:[b.id]}),p=r.length-1,f=!1),g=null;break}case"tool":{let Q=b,x=Bxe(Q,i),F=u.get(x.callId),E=B8(x,F?.status,F?.endTime,i);Q.serverTimestamp!==void 0&&h.set(E.callId,Q.serverTimestamp);let M=w.get(E.callId);M!=null&&M.title&&(E.title=M.title),!E.args&&M!=null&&M.args&&(E.args=M.args);let Y=E.parentToolCallId?c.get(E.parentToolCallId):void 0,v=c.get(E.callId);if(v){A8(v,E,{replaceArgs:i||Q.rawInput!==void 0||v.args===void 0,replaceRawOutput:i||t7(Q)!==void 0||v.rawOutput===void 0});break}if(Y){uxe(Y,E),c.set(E.callId,E);break}JY(r,b.id,E,C),c.set(E.callId,E),g=null,p=null,f=!0;break}case"shell":{let Q=b,x=r[r.length-1];if(x&&x.role==="tool_group"){let F=gxe(x.tools),E=x.tools[F];if(E){let M=typeof E.rawOutput=="string"?E.rawOutput:"",Y={...E,rawOutput:M+Q.text,sourceBlockIds:$n(E.sourceBlockIds,b.id)};r[r.length-1]={...x,sourceBlockIds:$n(x.sourceBlockIds,b.id),tools:[...x.tools.slice(0,F),Y,...x.tools.slice(F+1)]},c.get(E.callId)===E&&c.set(E.callId,Y)}}else r.push({id:b.id,role:"tool_group",sourceBlockIds:[b.id],tools:[{callId:b.id,toolName:"shell",status:"completed",kind:"execute",rawOutput:Q.text,sourceBlockIds:[b.id]}],timestamp:C}),f=!0;break}case"user_shell":{let Q=b;r.push({id:b.id,role:"user_shell",sourceBlockIds:[b.id],command:Q.command,output:Q.text,...Q.cwd?{cwd:Q.cwd}:{},timestamp:C}),f=!0;break}case"permission":{let Q=b;Ixe(Q,w,i);let x=mxe(Q,i);if(!x)break;Q.serverTimestamp!==void 0&&!h.has(x.callId)&&h.set(x.callId,Q.serverTimestamp);let F=ks(x);if(!Q.resolved)break;let E=c.get(x.callId);if(E){let M=E.status,Y=E.endTime;x.toolName=E.toolName,Q.resolved&&(WY(Q.resolved)?x.status=F?x.status:"in_progress":(x.status=i&&c8(Q.resolved)?"completed":"failed",x.endTime=Q.updatedAt)),A8(E,x),(pxe(M)||Q.resolved&&F&&WY(Q.resolved))&&(E.status=M,E.endTime=Y);break}if(Q.resolved){WY(Q.resolved)?(F||(x.status="in_progress"),JY(r,b.id,x,C),c.set(x.callId,x),f=!0):(x.status=i&&c8(Q.resolved)?"completed":"failed",x.endTime=Q.updatedAt,JY(r,b.id,x,C),c.set(x.callId,x),f=!0);break}break}case"status":case"debug":{let Q=b;if(lxe(Q))break;if(Q.source==="mid_turn_message_injected"){let M=ixe(Q.data),Y=dxe(Q.data);r.push({id:b.id,role:"system",content:Q.text.length>0?Q.text:Axe(Q.data)??Q.text,variant:"info",timestamp:C,source:Q.source,...Q.data!==void 0?{data:Q.data}:{},...M?{images:M}:{},...Y?{files:Y}:{}}),f=!0;break}let x=Q.source==="session_branched"?nxe(Q.data):null,F=x&&(o=t.labels)!=null&&o.branchSuccess?t.labels.branchSuccess(x):Q.text;if(exe(F))break;let E=bxe(F);if(E){r.push({id:b.id,role:"plan",todos:E,timestamp:C,sourceBlockIds:[b.id]}),f=!0;break}r.push({id:b.id,role:"system",content:F,variant:"info",timestamp:C,sourceBlockIds:[b.id],...Q.source?{source:Q.source}:{},...Q.data!==void 0?{data:Q.data}:{}}),f=!0;break}case"error":{let Q=b,x=Q.errorKind;r.push({id:b.id,role:"system",content:oxe(Q,t.labels),variant:"error",retryable:Q.source==="turn_error"&&sxe(x),timestamp:C,sourceBlockIds:[b.id],...Q.source?{source:Q.source}:{},...rxe(Q.data,x)}),f=!0;break}case"prompt_cancelled":r.push({id:b.id,role:"system",content:d,variant:"info",source:"prompt_cancelled",timestamp:C,sourceBlockIds:[b.id]}),f=!0;break}}for(let B of c.values())ks(B)&&Tl(B.status)&&B.endTime===void 0&&(B.startTime=h.get(B.callId)??B.startTime);return hxe(r),n||wxe(r),r}function hxe(e){let t=a=>{let l=[];for(let s of a)l.push(...s.sourceBlockIds??[]),s.subTools&&l.push(...t(s.subTools));return l};for(let a of e)a.role==="tool_group"&&(a.sourceBlockIds=$n(a.sourceBlockIds,...t(a.tools)))}function wxe(e){let t=a=>{for(let l of a)delete l.sourceBlockIds,l.subTools&&t(l.subTools)};for(let a of e)delete a.sourceBlockIds,a.role==="tool_group"&&t(a.tools)}function uxe(e,t){e.subTools||(e.subTools=[]),e.subTools.push(t),e.sourceBlockIds=$n(e.sourceBlockIds,...t.sourceBlockIds??[])}function $n(e,...t){return[...new Set([...e??[],...t])]}function d8(e,t,a){e.subContent=(e.subContent||"")+t,e.sourceBlockIds=$n(e.sourceBlockIds,a)}function JY(e,t,a,l){let s=r=>ks(r),o=e[e.length-1];if(o&&o.role==="tool_group"&&o.id.startsWith("tg-")&&!s(a)&&!o.tools.some(s)){o.tools.push(a),o.sourceBlockIds=$n(o.sourceBlockIds,t);return}e.push({id:`tg-${t}`,role:"tool_group",tools:[a],timestamp:l,sourceBlockIds:[t]})}function gxe(e){for(let t=e.length-1;t>=0;t--){let a=e[t];if(a.kind==="execute"&&a.status==="in_progress")return t}for(let t=e.length-1;t>=0;t--)if(e[t].kind==="execute")return t;return e.length-1}function A8(e,t,a={}){e.status=t.status??e.status,e.title=t.title??e.title,e.toolName=t.toolName??e.toolName,e.kind=t.kind??e.kind,e.sourceBlockIds=$n(e.sourceBlockIds,...t.sourceBlockIds??[]),e.content=t.content??e.content,e.endTime=t.endTime??e.endTime,e.wasCancelled=t.wasCancelled??e.wasCancelled,a.replaceRawOutput!==!1&&(e.rawOutput=t.rawOutput??e.rawOutput),a.replaceArgs!==!1&&(e.args=t.args??e.args),e.executionMode=t.executionMode??e.executionMode,e.subagentSessionReady=e.subagentSessionReady===!0?!0:t.subagentSessionReady??e.subagentSessionReady,e.locations=t.locations??e.locations}function pxe(e){return e==="completed"||e==="failed"}function bxe(e){let t=e.startsWith("plan: ")?e.slice(6):void 0;if(t)try{let a=JSON.parse(t),l=vl(a);if(l?.sessionUpdate!=="plan"||!Array.isArray(l.entries))return;let s=lp(l.entries);return s.length>0?s:void 0}catch{return}}function vl(e){if(!(!e||typeof e!="object"||Array.isArray(e)))return e}function fo(e,t){let a=e?.[t];return typeof a=="string"&&a.length>0?a:void 0}function Bxe(e,t){var a;let l=Qxe(e,t),s=t?e.background===!0?"background":"foreground":(a=vl(l))==null?void 0:a.executionMode,o=Cxe(e,l),r=t?void 0:Exe(e),n={running:"in_progress",pending:"pending",confirming:"pending",background:"pending",completed:"completed",failed:"failed",cancelled:t?"failed":"completed",canceled:t?"failed":"completed",in_progress:"in_progress"},i=e.status==="completed"||e.status==="failed"||e.status==="cancelled"||e.status==="canceled",d=o&&(!t||!i);return{callId:e.toolCallId,toolName:e.toolName||"unknown",title:e.title,status:(d?"pending":n[e.status])||e.status||"in_progress",kind:s7(e.toolName,e.toolKind),rawOutput:l,args:fxe(e,t),executionMode:pj(s)?s:void 0,subagentSessionReady:e.subagentSessionReady,parentToolCallId:e.parentToolCallId,startTime:e.createdAt,endTime:i&&!d?e.updatedAt:void 0,...l7(e.status)?{wasCancelled:!0}:{},...r?{content:r}:{},sourceBlockIds:[e.id]}}function fxe(e,t){return t?Gx(e.preview):e.rawInput}function mxe(e,t){let a=vl(e.toolCall);if(!t&&!a)return;let l=t?Gx(e.preview):a?e7(a):void 0;if(Array.isArray(l?.questions))return;let s=a?vl(a._meta):void 0,o=t?e.toolKind:fo(a,"kind"),r=(t?e.toolName:fo(s,"toolName")??fo(a,"toolName")??fo(a,"name"))??(l!=null&&l.subagent_type?"agent":void 0)??(o==="fetch"?"web_fetch":o),n=t?e.toolCallId:fo(a,"toolCallId")??fo(a,"id");return!n||!r?void 0:{callId:n,toolName:r,title:t?e.title:fo(a,"title")??e.title,status:"pending",kind:s7(r,o),args:l,startTime:e.createdAt,sourceBlockIds:[e.id]}}function Ixe(e,t,a){let l=vl(e.toolCall),s=a?e.toolCallId:fo(l,"toolCallId")??fo(l,"id");if(!s)return;let o=a?e.title:fo(l,"title")??e.title,r=a?Gx(e.preview):l?e7(l):void 0;Array.isArray(r?.questions)&&t.set(s,{...o?{title:o}:{},...r?{args:r}:{}})}function WY(e){let[t="",a=""]=e.toLowerCase().split(":",2);return h8(t)?!0:t!=="selected"?!1:h8(a.trim())}function c8(e){return e.trim().toLowerCase()==="resolved"}function h8(e){return e==="allow"||e==="allowed"||e==="approve"||e==="approved"||e==="accept"||e==="accepted"||e==="confirm"||e==="confirmed"||e==="proceed"||e==="proceed_once"||e==="proceed_once_and_switch_to_default"||e==="proceed_always_project"||e==="proceed_always_user"||e==="allow_once"||e==="allow_always"||e==="success"||e==="succeeded"}function e7(e){return vl(e.rawInput)??vl(e.input)??vl(e.args)}function Cxe(e,t){var a;let l=(a=e.toolName)==null?void 0:a.toLowerCase();if(l!=="agent"&&l!=="task")return!1;if(e.background===!0)return!0;let s=vl(t);return s?.status==="background"}function Qxe(e,t){return t?a7(e.resultPreview):t7(e)}function t7(e){return yxe(e)&&e.status==="failed"?Mxe(e)??e.details??e.rawOutput:!l7(e.status)||!e.details?e.rawOutput??e.details:e.rawOutput&&typeof e.rawOutput=="object"&&!Array.isArray(e.rawOutput)?{...e.rawOutput,status:e.status,reason:e.details}:{status:e.status,reason:e.details,text:typeof e.rawOutput=="string"&&e.rawOutput?e.rawOutput:e.details}}function a7(e){if(e)return e.kind==="text"?e.text:e.kind==="generic"?e.summary:{entries:e.entries.map(t=>({content:t.content,status:t.status,...t.priority?{priority:t.priority}:{},_meta:{qwenTodo:{id:t.id,...t.blockedBy?{blockedBy:[...t.blockedBy]}:{}}}})),...e.planId||e.revision!==void 0?{plan:{...e.planId?{id:e.planId}:{},...e.revision!==void 0?{revision:e.revision}:{}}}:{}}}function Gx(e){if(e)switch(e.kind){case"ask_user_question":return{questions:e.questions.map(t=>({...t.header?{header:t.header}:{},question:t.question,options:t.options.map(a=>({label:a.label,...a.description?{description:a.description}:{}}))}))};case"todo_list":return a7(e);case"command":return{command:e.command,...e.cwd?{cwd:e.cwd}:{}};case"file_diff":return{path:e.path,...e.oldText!==void 0?{oldText:e.oldText}:{},...e.newText!==void 0?{newText:e.newText}:{},...e.patch!==void 0?{patch:e.patch}:{}};case"file_read":return{path:e.path,...e.range?{range:[...e.range]}:{}};case"web_fetch":return{url:e.url,...e.method?{method:e.method}:{}};case"subagent_delegation":return{subagent_type:e.agentName,prompt:e.task,...e.parentDelegationId?{parentDelegationId:e.parentDelegationId}:{}};default:return}}var w8=new WeakMap;function Exe(e){let t=e.content;if(!Array.isArray(t))return;let a=w8.get(e);if(a!==void 0)return a;let l=t.flatMap(o=>{let r=vl(o);if(!r)return[];let n=r.type;if(n==="content"){let i=vl(r.content);return!i||typeof i.type!="string"?[]:[{type:"content",content:{...i,type:i.type}}]}if(n==="diff"){let i=r.newText;if(typeof i!="string")return[];let d=r.path,c=r.oldText;return[{type:"diff",...typeof d=="string"?{path:d}:{},...typeof c=="string"?{oldText:c}:{},newText:i}]}if(n==="terminal"){let i=r.terminalId;return[{type:"terminal",...typeof i=="string"?{terminalId:i}:{}}]}return[]});if(l.length===0)return;let s=Object.freeze(l);return w8.set(e,s),s}function yxe(e){if(!e.toolName)return!1;let t=e.toolName.toLowerCase();return t==="ask_user_question"||t==="askuserquestion"}function Mxe(e){if(!Array.isArray(e.content))return;let t=e.content.map(a=>{var l;return(l=a?.content)==null?void 0:l.text}).filter(a=>!!a);if(!(!t||t.length===0))return t.join(`
|
|
621
|
-
`)}function l7(e){return e==="cancelled"||e==="canceled"}var Yxe=['"insight_progress":','"insight_ready":','"insight_error":'];function Fxe(e){try{let t=JSON.parse(e),a=vl(t.insight_progress);if(a&&typeof a.stage=="string"&&typeof a.progress=="number")return{type:"insight_progress",stage:a.stage,progress:a.progress,detail:typeof a.detail=="string"?a.detail:void 0};let l=vl(t.insight_ready);if(l&&typeof l.path=="string")return{type:"insight_ready",path:l.path};let s=vl(t.insight_error);if(s&&typeof s.error=="string")return{type:"insight_error",error:s.error}}catch{}return null}function xxe(e,t){if(e[t]!=="{")return null;let a=0,l=!1,s=!1;for(let o=t;o<e.length;o++){let r=e[o];if(s){s=!1;continue}if(r==="\\"&&l){s=!0;continue}if(r==='"'){l=!l;continue}if(!l){if(r==="{")a++;else if(r==="}"&&(a--,a===0))return e.slice(t,o+1)}}return null}function vxe(e){let t=[],a=0,l=0,s=!1;for(;l<e.length;){let r=e.indexOf("{",l);if(r===-1)break;let n=e.slice(r+1).trimStart();if(!Yxe.some(h=>n.startsWith(h))){l=r+1;continue}let i=xxe(e,r);if(!i){l=r+1;continue}let d=Fxe(i);if(!d){l=r+1;continue}s=!0;let c=e.slice(a,r).trim();c&&t.push({kind:"text",text:c}),t.push({kind:"insight",data:d}),a=r+i.length,l=a}if(!s)return null;let o=e.slice(a).trim();return o&&t.push({kind:"text",text:o}),t.length>0?t:null}function s7(e,t){if(t)return t;if(!e)return;let a=e.toLowerCase();if(a==="bash"||a==="execute")return"execute";if(a==="read")return"read";if(a==="edit"||a==="write")return"edit";if(a.includes("search")||a==="grep"||a==="glob")return"search";if(a==="agent"||a==="task")return"other"}function kxe(e,t,a=!1){return cxe(e,{safeToolProjection:a,includeSourceIdentity:!0,labels:{promptCancelled:t("request.cancelled"),branchSuccess:l=>t("branch.success",{name:l}),modelStreamInterrupted:t("error.modelStreamInterrupted"),loopDetected:t("error.loopDetected")}})}var Nxe="_app_evevi_1",Dxe="_appChat_evevi_62",Uxe="_content_evevi_114",Sxe="_themeDark_evevi_432",Gxe="_themeLight_evevi_506",zxe="_contentHasMessages_evevi_588",Aw={app:Nxe,appChat:Dxe,content:Uxe,themeDark:Sxe,themeLight:Gxe,contentHasMessages:zxe},Rxe=1e3,Lxe=40;function o7(e){if(e!==void 0)return yj(e);if(typeof window>"u")return"en";let t=new URLSearchParams(window.location.search);return yj(t.get("language")??t.get("lang")??navigator.language)}function Txe(e){let t=`${typeof e=="number"&&Number.isFinite(e)&&e>0?e:Rxe}px`,a=`calc(${t} + ${Lxe}px)`;return{"--chat-regular-content-width":t,"--chat-regular-shell-width":a,"--chat-content-width":t,"--chat-shell-width":a}}function jxe({blocks:e,renderMode:t="readonly",theme:a=ep.Dark,language:l,className:s,style:o,chatMaxWidth:r,workspaceCwd:n="",compactThinking:i=!1,documentExpanded:d=!0,collapseCompletedTurns:c,markdownTableMode:h="basic",virtualScrollThreshold:w,markdown:u,composerTagIcons:g,artifact:p,renderToolHeaderExtra:f,parseUserMessageContent:B,renderUserMessageContent:b,renderComposerTag:C,renderComposerTagTooltip:Q,renderAssistantTurnFooter:x,mcpAppBaseUrl:F}){let E=t==="document",M=!E&&(c??!0),Y=E?"basic":h,v=o7(l),S=(0,I.useMemo)(()=>m8(v),[v]),G=(0,I.useMemo)(()=>kxe(e,S,E),[e,E,S]),J=(0,I.useMemo)(()=>Pfe(G),[G]),W=(0,I.useMemo)(()=>Hfe(G),[G]),X=(0,I.useMemo)(()=>({artifact:p,composerTagIcons:g,renderToolHeaderExtra:f,parseUserMessageContent:B,renderUserMessageContent:b,renderComposerTag:C,renderComposerTagTooltip:Q,renderAssistantTurnFooter:x,compactThinking:i,collapseCompletedTurns:M,markdownTableMode:Y,markdown:u}),[p,M,i,g,u,Y,B,x,C,Q,f,b]),O=(0,I.useRef)(null),[_,q]=(0,I.useState)(null),Ae=(0,I.useRef)(new Set),N=[Aw.app,Aw.appChat,a===ep.Light?Aw.themeLight:Aw.themeDark,a===ep.Dark?"dark":void 0,s].filter(Boolean).join(" "),ce=(0,I.useMemo)(()=>({...o,...Txe(r)}),[r,o]);return(0,I.useLayoutEffect)(()=>{if(typeof document>"u")return;let j=document.createElement("div");return j.dataset.webShellPortalRoot="",j.dataset.webShellShadcn="",document.body.appendChild(j),q(j),()=>{j.remove(),q(null)}},[]),(0,I.useLayoutEffect)(()=>{let j=O.current;if(!j||!_)return;let D=null,le=()=>{D=null;let re=getComputedStyle(j),ie=new Set;_.dataset.webShellShadcn="",_.classList.toggle("dark",a===ep.Dark),_.lang=v;for(let $=0;$<re.length;$+=1){let oe=re[$];oe.startsWith("--")&&(ie.add(oe),_.style.setProperty(oe,re.getPropertyValue(oe)))}for(let $ of Ae.current)ie.has($)||_.style.removeProperty($);Ae.current=ie},ge=()=>{D===null&&(D=requestAnimationFrame(le))};le();let de=new MutationObserver(ge),P=j;for(;P;)de.observe(P,{attributes:!0,attributeFilter:["class","style","data-theme","lang"]}),P=P.parentElement;return window.addEventListener("resize",ge),()=>{de.disconnect(),window.removeEventListener("resize",ge),D!==null&&cancelAnimationFrame(D)}},[_,v,N,ce,a]),(0,A.jsx)(qoe,{value:a,children:(0,A.jsx)(Vse,{language:v,children:(0,A.jsx)(DJ.Provider,{value:F,children:(0,A.jsx)(I8.Provider,{value:_,children:(0,A.jsx)(Kse,{value:t,children:(0,A.jsx)(Ose,{value:d,children:(0,A.jsx)(Ise,{value:X,children:(0,A.jsx)(mse,{timeline:W,details:J,children:(0,A.jsx)(SF.Provider,{value:!1,children:(0,A.jsx)("div",{ref:O,className:N,style:ce,"data-web-shell-root":!0,"data-web-shell-shadcn":!0,"data-transcript-render-mode":t,"data-document-expanded":E?String(d):void 0,lang:v,children:(0,A.jsx)("div",{className:`${Aw.content} ${Aw.contentHasMessages}`,children:(0,A.jsx)(OFe,{messages:G,pendingApproval:null,isResponding:!1,workspaceCwd:n,virtualScrollThreshold:E?Number.MAX_SAFE_INTEGER:w,hideSessionTimeline:E})})})})})})})})})})})})}function r7(e){let t=o7(e.language);return(0,A.jsx)(bw,{label:"web-shell-transcript-root",resetKeys:[e.blocks,t],fallback:(a,l)=>(0,A.jsx)(_Fe,{error:a,onRetry:l,language:t}),children:(0,A.jsx)(jxe,{...e})})}var wt=We(il(),1),A7="qwen-export-theme";function rc(e){return e===void 0||typeof e=="string"}function nc(e){return e===void 0||typeof e=="number"&&Number.isFinite(e)&&e>=0}function Hxe(){let e=document.getElementById("transcript-document");if(!(e instanceof HTMLScriptElement))throw new Error("Transcript document envelope is missing.");let t=e.textContent??"";if(t.length>33554432)throw new Error("Transcript document exceeds the envelope budget.");if(new TextEncoder().encode(t).byteLength>33554432)throw new Error("Transcript document exceeds the envelope budget.");let a=JSON.parse(t);if(a.schemaVersion!==1||a.rendererVersion!=="0.23.8+d18574e03f32ce10"||!Array.isArray(a.blocks)||a.blocks.length>1e3||!a.metadata||typeof a.metadata!="object"||Array.isArray(a.metadata)||!rc(a.metadata.title)||!rc(a.metadata.startedAt)||!rc(a.metadata.projectName)||!rc(a.metadata.repository)||!rc(a.metadata.gitBranch)||!rc(a.metadata.model)||!rc(a.metadata.channel)||!nc(a.metadata.promptCount)||!nc(a.metadata.contextUsagePercent)||!nc(a.metadata.contextWindowSize)||!nc(a.metadata.totalTokens)||!nc(a.metadata.filesWritten)||!nc(a.metadata.linesAdded)||!nc(a.metadata.linesRemoved)||typeof a.metadata.exportedAt!="string"||typeof a.metadata.complete!="boolean"||typeof a.metadata.truncated!="boolean")throw new Error("Transcript document is incompatible with this renderer.");return a}function Jxe(){try{let e=localStorage.getItem(A7);if(e==="light"||e==="dark")return e}catch{}return"dark"}function n7(e){if(!e)return;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function Wxe(e){if(e!==void 0)return e>=1e6?`${e/1e6}m`:e>=1e3?`${e/1e3}k`:String(e)}function Xs({label:e,value:t}){return t===void 0||t===""?null:(0,wt.jsxs)("div",{className:"document-metadata-item",children:[(0,wt.jsx)("dt",{children:e}),(0,wt.jsx)("dd",{children:t})]})}function Vxe({metadata:e}){let t=e.contextUsagePercent===void 0?void 0:`${e.contextUsagePercent>100?">100":e.contextUsagePercent}%${e.contextWindowSize===void 0?"":` of ${Wxe(e.contextWindowSize)}`}`;return(0,wt.jsxs)("aside",{className:"document-metadata","data-document-metadata":!0,children:[(0,wt.jsxs)("section",{children:[(0,wt.jsx)("h2",{children:"Session Info"}),(0,wt.jsxs)("dl",{children:[(0,wt.jsx)(Xs,{label:"Session",value:e.title??"Qwen Code Chat Export"}),(0,wt.jsx)(Xs,{label:"Started",value:n7(e.startedAt)}),(0,wt.jsx)(Xs,{label:"Exported",value:n7(e.exportedAt)}),(0,wt.jsx)(Xs,{label:"Project",value:e.projectName}),(0,wt.jsx)(Xs,{label:"Repository",value:e.repository}),(0,wt.jsx)(Xs,{label:"Branch",value:e.gitBranch}),(0,wt.jsx)(Xs,{label:"Model",value:e.model}),(0,wt.jsx)(Xs,{label:"Channel",value:e.channel})]})]}),(0,wt.jsxs)("section",{children:[(0,wt.jsx)("h2",{children:"Statistics"}),(0,wt.jsxs)("dl",{children:[(0,wt.jsx)(Xs,{label:"Prompts",value:e.promptCount}),(0,wt.jsx)(Xs,{label:"Context Usage",value:t}),(0,wt.jsx)(Xs,{label:"Tokens",value:e.totalTokens?.toLocaleString()})]})]}),(0,wt.jsxs)("section",{children:[(0,wt.jsx)("h2",{children:"File Operations"}),(0,wt.jsxs)("dl",{children:[(0,wt.jsx)(Xs,{label:"Files modified",value:e.filesWritten}),(0,wt.jsx)(Xs,{label:"Lines added",value:e.linesAdded}),(0,wt.jsx)(Xs,{label:"Lines removed",value:e.linesRemoved})]})]})]})}function Kxe({value:e}){let[t,a]=(0,Zs.useState)(Jxe),[l,s]=(0,Zs.useState)(!0),o=(0,Zs.useRef)(l),r=(0,Zs.useRef)(null);return(0,Zs.useEffect)(()=>{document.documentElement.classList.toggle("dark",t==="dark"),document.documentElement.classList.toggle("light",t==="light");try{localStorage.setItem(A7,t)}catch{}},[t]),(0,Zs.useEffect)(()=>{o.current=l},[l]),(0,Zs.useEffect)(()=>{let n=()=>{r.current=o.current,(0,zx.flushSync)(()=>s(!0))},i=()=>{let d=r.current;r.current=null,d!==null&&(0,zx.flushSync)(()=>s(d))};return addEventListener("beforeprint",n),addEventListener("afterprint",i),()=>{removeEventListener("beforeprint",n),removeEventListener("afterprint",i)}},[]),(0,Zs.useEffect)(()=>{document.title=e.metadata.title||"Qwen Code Chat Export",requestAnimationFrame(()=>{document.body.dataset.renderComplete="true"})},[e.metadata.title]),(0,wt.jsxs)("main",{className:"document-shell",children:[(0,wt.jsxs)("header",{className:"document-header",children:[(0,wt.jsxs)("div",{children:[(0,wt.jsx)("h1",{children:e.metadata.title||"Qwen Code Chat Export"}),(0,wt.jsx)("p",{children:e.metadata.startedAt?`Started ${e.metadata.startedAt}`:`Exported ${e.metadata.exportedAt}`})]}),(!e.metadata.complete||e.metadata.truncated)&&(0,wt.jsx)("span",{className:"document-warning",children:"Partial export"}),(0,wt.jsxs)("div",{className:"document-actions","aria-label":"Document controls",children:[(0,wt.jsx)("button",{type:"button","data-document-expand-all":!0,disabled:l,onClick:()=>s(!0),children:"Expand all"}),(0,wt.jsx)("button",{type:"button","data-document-collapse-all":!0,disabled:!l,onClick:()=>s(!1),children:"Collapse all"}),(0,wt.jsx)("button",{type:"button","data-document-theme-toggle":!0,"aria-label":`Switch to ${t==="dark"?"light":"dark"} theme`,onClick:()=>a(n=>n==="dark"?"light":"dark"),children:t==="dark"?"Light theme":"Dark theme"})]})]}),(0,wt.jsxs)("div",{className:"document-content",children:[(0,wt.jsx)("div",{className:"document-transcript",children:(0,wt.jsx)(r7,{blocks:e.blocks,renderMode:"document",compactThinking:!0,documentExpanded:l,theme:t})}),(0,wt.jsx)(Vxe,{metadata:e.metadata})]})]})}function c7(){return(0,Zs.useEffect)(()=>{document.body.dataset.renderComplete="error"},[]),(0,wt.jsxs)("main",{className:"document-error",role:"alert",children:[(0,wt.jsx)("h1",{children:"Unable to open this chat export"}),(0,wt.jsx)("p",{children:"The file is incomplete or uses an incompatible renderer version."})]})}var Rx=class extends Zs.Component{constructor(){super(...arguments);this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?(0,wt.jsx)(c7,{}):this.props.children}},h7=document.getElementById("app");if(!h7)throw new Error("Transcript document root is missing.");var i7=(0,d7.createRoot)(h7);try{i7.render((0,wt.jsx)(Rx,{children:(0,wt.jsx)(Kxe,{value:Hxe()})}))}catch{i7.render((0,wt.jsx)(c7,{}))}})();
|
|
621
|
+
`)}function l7(e){return e==="cancelled"||e==="canceled"}var Yxe=['"insight_progress":','"insight_ready":','"insight_error":'];function Fxe(e){try{let t=JSON.parse(e),a=vl(t.insight_progress);if(a&&typeof a.stage=="string"&&typeof a.progress=="number")return{type:"insight_progress",stage:a.stage,progress:a.progress,detail:typeof a.detail=="string"?a.detail:void 0};let l=vl(t.insight_ready);if(l&&typeof l.path=="string")return{type:"insight_ready",path:l.path};let s=vl(t.insight_error);if(s&&typeof s.error=="string")return{type:"insight_error",error:s.error}}catch{}return null}function xxe(e,t){if(e[t]!=="{")return null;let a=0,l=!1,s=!1;for(let o=t;o<e.length;o++){let r=e[o];if(s){s=!1;continue}if(r==="\\"&&l){s=!0;continue}if(r==='"'){l=!l;continue}if(!l){if(r==="{")a++;else if(r==="}"&&(a--,a===0))return e.slice(t,o+1)}}return null}function vxe(e){let t=[],a=0,l=0,s=!1;for(;l<e.length;){let r=e.indexOf("{",l);if(r===-1)break;let n=e.slice(r+1).trimStart();if(!Yxe.some(h=>n.startsWith(h))){l=r+1;continue}let i=xxe(e,r);if(!i){l=r+1;continue}let d=Fxe(i);if(!d){l=r+1;continue}s=!0;let c=e.slice(a,r).trim();c&&t.push({kind:"text",text:c}),t.push({kind:"insight",data:d}),a=r+i.length,l=a}if(!s)return null;let o=e.slice(a).trim();return o&&t.push({kind:"text",text:o}),t.length>0?t:null}function s7(e,t){if(t)return t;if(!e)return;let a=e.toLowerCase();if(a==="bash"||a==="execute")return"execute";if(a==="read")return"read";if(a==="edit"||a==="write")return"edit";if(a.includes("search")||a==="grep"||a==="glob")return"search";if(a==="agent"||a==="task")return"other"}function kxe(e,t,a=!1){return cxe(e,{safeToolProjection:a,includeSourceIdentity:!0,labels:{promptCancelled:t("request.cancelled"),branchSuccess:l=>t("branch.success",{name:l}),modelStreamInterrupted:t("error.modelStreamInterrupted"),loopDetected:t("error.loopDetected")}})}var Nxe="_app_evevi_1",Dxe="_appChat_evevi_62",Uxe="_content_evevi_114",Sxe="_themeDark_evevi_432",Gxe="_themeLight_evevi_506",zxe="_contentHasMessages_evevi_588",Aw={app:Nxe,appChat:Dxe,content:Uxe,themeDark:Sxe,themeLight:Gxe,contentHasMessages:zxe},Rxe=1e3,Lxe=40;function o7(e){if(e!==void 0)return yj(e);if(typeof window>"u")return"en";let t=new URLSearchParams(window.location.search);return yj(t.get("language")??t.get("lang")??navigator.language)}function Txe(e){let t=`${typeof e=="number"&&Number.isFinite(e)&&e>0?e:Rxe}px`,a=`calc(${t} + ${Lxe}px)`;return{"--chat-regular-content-width":t,"--chat-regular-shell-width":a,"--chat-content-width":t,"--chat-shell-width":a}}function jxe({blocks:e,renderMode:t="readonly",theme:a=ep.Dark,language:l,className:s,style:o,chatMaxWidth:r,workspaceCwd:n="",compactThinking:i=!1,documentExpanded:d=!0,collapseCompletedTurns:c,markdownTableMode:h="basic",virtualScrollThreshold:w,markdown:u,composerTagIcons:g,artifact:p,renderToolHeaderExtra:f,parseUserMessageContent:B,renderUserMessageContent:b,renderComposerTag:C,renderComposerTagTooltip:Q,renderAssistantTurnFooter:x,mcpAppBaseUrl:F}){let E=t==="document",M=!E&&(c??!0),Y=E?"basic":h,v=o7(l),S=(0,I.useMemo)(()=>m8(v),[v]),G=(0,I.useMemo)(()=>kxe(e,S,E),[e,E,S]),J=(0,I.useMemo)(()=>Pfe(G),[G]),W=(0,I.useMemo)(()=>Hfe(G),[G]),X=(0,I.useMemo)(()=>({artifact:p,composerTagIcons:g,renderToolHeaderExtra:f,parseUserMessageContent:B,renderUserMessageContent:b,renderComposerTag:C,renderComposerTagTooltip:Q,renderAssistantTurnFooter:x,compactThinking:i,collapseCompletedTurns:M,markdownTableMode:Y,markdown:u}),[p,M,i,g,u,Y,B,x,C,Q,f,b]),O=(0,I.useRef)(null),[_,q]=(0,I.useState)(null),Ae=(0,I.useRef)(new Set),N=[Aw.app,Aw.appChat,a===ep.Light?Aw.themeLight:Aw.themeDark,a===ep.Dark?"dark":void 0,s].filter(Boolean).join(" "),ce=(0,I.useMemo)(()=>({...o,...Txe(r)}),[r,o]);return(0,I.useLayoutEffect)(()=>{if(typeof document>"u")return;let j=document.createElement("div");return j.dataset.webShellPortalRoot="",j.dataset.webShellShadcn="",document.body.appendChild(j),q(j),()=>{j.remove(),q(null)}},[]),(0,I.useLayoutEffect)(()=>{let j=O.current;if(!j||!_)return;let D=null,le=()=>{D=null;let re=getComputedStyle(j),ie=new Set;_.dataset.webShellShadcn="",_.classList.toggle("dark",a===ep.Dark),_.lang=v;for(let $=0;$<re.length;$+=1){let oe=re[$];oe.startsWith("--")&&(ie.add(oe),_.style.setProperty(oe,re.getPropertyValue(oe)))}for(let $ of Ae.current)ie.has($)||_.style.removeProperty($);Ae.current=ie},ge=()=>{D===null&&(D=requestAnimationFrame(le))};le();let de=new MutationObserver(ge),P=j;for(;P;)de.observe(P,{attributes:!0,attributeFilter:["class","style","data-theme","lang"]}),P=P.parentElement;return window.addEventListener("resize",ge),()=>{de.disconnect(),window.removeEventListener("resize",ge),D!==null&&cancelAnimationFrame(D)}},[_,v,N,ce,a]),(0,A.jsx)(qoe,{value:a,children:(0,A.jsx)(Vse,{language:v,children:(0,A.jsx)(DJ.Provider,{value:F,children:(0,A.jsx)(I8.Provider,{value:_,children:(0,A.jsx)(Kse,{value:t,children:(0,A.jsx)(Ose,{value:d,children:(0,A.jsx)(Ise,{value:X,children:(0,A.jsx)(mse,{timeline:W,details:J,children:(0,A.jsx)(SF.Provider,{value:!1,children:(0,A.jsx)("div",{ref:O,className:N,style:ce,"data-web-shell-root":!0,"data-web-shell-shadcn":!0,"data-transcript-render-mode":t,"data-document-expanded":E?String(d):void 0,lang:v,children:(0,A.jsx)("div",{className:`${Aw.content} ${Aw.contentHasMessages}`,children:(0,A.jsx)(OFe,{messages:G,pendingApproval:null,isResponding:!1,workspaceCwd:n,virtualScrollThreshold:E?Number.MAX_SAFE_INTEGER:w,hideSessionTimeline:E})})})})})})})})})})})})}function r7(e){let t=o7(e.language);return(0,A.jsx)(bw,{label:"web-shell-transcript-root",resetKeys:[e.blocks,t],fallback:(a,l)=>(0,A.jsx)(_Fe,{error:a,onRetry:l,language:t}),children:(0,A.jsx)(jxe,{...e})})}var wt=We(il(),1),A7="qwen-export-theme";function rc(e){return e===void 0||typeof e=="string"}function nc(e){return e===void 0||typeof e=="number"&&Number.isFinite(e)&&e>=0}function Hxe(){let e=document.getElementById("transcript-document");if(!(e instanceof HTMLScriptElement))throw new Error("Transcript document envelope is missing.");let t=e.textContent??"";if(t.length>33554432)throw new Error("Transcript document exceeds the envelope budget.");if(new TextEncoder().encode(t).byteLength>33554432)throw new Error("Transcript document exceeds the envelope budget.");let a=JSON.parse(t);if(a.schemaVersion!==1||a.rendererVersion!=="0.23.9+d18574e03f32ce10"||!Array.isArray(a.blocks)||a.blocks.length>1e3||!a.metadata||typeof a.metadata!="object"||Array.isArray(a.metadata)||!rc(a.metadata.title)||!rc(a.metadata.startedAt)||!rc(a.metadata.projectName)||!rc(a.metadata.repository)||!rc(a.metadata.gitBranch)||!rc(a.metadata.model)||!rc(a.metadata.channel)||!nc(a.metadata.promptCount)||!nc(a.metadata.contextUsagePercent)||!nc(a.metadata.contextWindowSize)||!nc(a.metadata.totalTokens)||!nc(a.metadata.filesWritten)||!nc(a.metadata.linesAdded)||!nc(a.metadata.linesRemoved)||typeof a.metadata.exportedAt!="string"||typeof a.metadata.complete!="boolean"||typeof a.metadata.truncated!="boolean")throw new Error("Transcript document is incompatible with this renderer.");return a}function Jxe(){try{let e=localStorage.getItem(A7);if(e==="light"||e==="dark")return e}catch{}return"dark"}function n7(e){if(!e)return;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function Wxe(e){if(e!==void 0)return e>=1e6?`${e/1e6}m`:e>=1e3?`${e/1e3}k`:String(e)}function Xs({label:e,value:t}){return t===void 0||t===""?null:(0,wt.jsxs)("div",{className:"document-metadata-item",children:[(0,wt.jsx)("dt",{children:e}),(0,wt.jsx)("dd",{children:t})]})}function Vxe({metadata:e}){let t=e.contextUsagePercent===void 0?void 0:`${e.contextUsagePercent>100?">100":e.contextUsagePercent}%${e.contextWindowSize===void 0?"":` of ${Wxe(e.contextWindowSize)}`}`;return(0,wt.jsxs)("aside",{className:"document-metadata","data-document-metadata":!0,children:[(0,wt.jsxs)("section",{children:[(0,wt.jsx)("h2",{children:"Session Info"}),(0,wt.jsxs)("dl",{children:[(0,wt.jsx)(Xs,{label:"Session",value:e.title??"Qwen Code Chat Export"}),(0,wt.jsx)(Xs,{label:"Started",value:n7(e.startedAt)}),(0,wt.jsx)(Xs,{label:"Exported",value:n7(e.exportedAt)}),(0,wt.jsx)(Xs,{label:"Project",value:e.projectName}),(0,wt.jsx)(Xs,{label:"Repository",value:e.repository}),(0,wt.jsx)(Xs,{label:"Branch",value:e.gitBranch}),(0,wt.jsx)(Xs,{label:"Model",value:e.model}),(0,wt.jsx)(Xs,{label:"Channel",value:e.channel})]})]}),(0,wt.jsxs)("section",{children:[(0,wt.jsx)("h2",{children:"Statistics"}),(0,wt.jsxs)("dl",{children:[(0,wt.jsx)(Xs,{label:"Prompts",value:e.promptCount}),(0,wt.jsx)(Xs,{label:"Context Usage",value:t}),(0,wt.jsx)(Xs,{label:"Tokens",value:e.totalTokens?.toLocaleString()})]})]}),(0,wt.jsxs)("section",{children:[(0,wt.jsx)("h2",{children:"File Operations"}),(0,wt.jsxs)("dl",{children:[(0,wt.jsx)(Xs,{label:"Files modified",value:e.filesWritten}),(0,wt.jsx)(Xs,{label:"Lines added",value:e.linesAdded}),(0,wt.jsx)(Xs,{label:"Lines removed",value:e.linesRemoved})]})]})]})}function Kxe({value:e}){let[t,a]=(0,Zs.useState)(Jxe),[l,s]=(0,Zs.useState)(!0),o=(0,Zs.useRef)(l),r=(0,Zs.useRef)(null);return(0,Zs.useEffect)(()=>{document.documentElement.classList.toggle("dark",t==="dark"),document.documentElement.classList.toggle("light",t==="light");try{localStorage.setItem(A7,t)}catch{}},[t]),(0,Zs.useEffect)(()=>{o.current=l},[l]),(0,Zs.useEffect)(()=>{let n=()=>{r.current=o.current,(0,zx.flushSync)(()=>s(!0))},i=()=>{let d=r.current;r.current=null,d!==null&&(0,zx.flushSync)(()=>s(d))};return addEventListener("beforeprint",n),addEventListener("afterprint",i),()=>{removeEventListener("beforeprint",n),removeEventListener("afterprint",i)}},[]),(0,Zs.useEffect)(()=>{document.title=e.metadata.title||"Qwen Code Chat Export",requestAnimationFrame(()=>{document.body.dataset.renderComplete="true"})},[e.metadata.title]),(0,wt.jsxs)("main",{className:"document-shell",children:[(0,wt.jsxs)("header",{className:"document-header",children:[(0,wt.jsxs)("div",{children:[(0,wt.jsx)("h1",{children:e.metadata.title||"Qwen Code Chat Export"}),(0,wt.jsx)("p",{children:e.metadata.startedAt?`Started ${e.metadata.startedAt}`:`Exported ${e.metadata.exportedAt}`})]}),(!e.metadata.complete||e.metadata.truncated)&&(0,wt.jsx)("span",{className:"document-warning",children:"Partial export"}),(0,wt.jsxs)("div",{className:"document-actions","aria-label":"Document controls",children:[(0,wt.jsx)("button",{type:"button","data-document-expand-all":!0,disabled:l,onClick:()=>s(!0),children:"Expand all"}),(0,wt.jsx)("button",{type:"button","data-document-collapse-all":!0,disabled:!l,onClick:()=>s(!1),children:"Collapse all"}),(0,wt.jsx)("button",{type:"button","data-document-theme-toggle":!0,"aria-label":`Switch to ${t==="dark"?"light":"dark"} theme`,onClick:()=>a(n=>n==="dark"?"light":"dark"),children:t==="dark"?"Light theme":"Dark theme"})]})]}),(0,wt.jsxs)("div",{className:"document-content",children:[(0,wt.jsx)("div",{className:"document-transcript",children:(0,wt.jsx)(r7,{blocks:e.blocks,renderMode:"document",compactThinking:!0,documentExpanded:l,theme:t})}),(0,wt.jsx)(Vxe,{metadata:e.metadata})]})]})}function c7(){return(0,Zs.useEffect)(()=>{document.body.dataset.renderComplete="error"},[]),(0,wt.jsxs)("main",{className:"document-error",role:"alert",children:[(0,wt.jsx)("h1",{children:"Unable to open this chat export"}),(0,wt.jsx)("p",{children:"The file is incomplete or uses an incompatible renderer version."})]})}var Rx=class extends Zs.Component{constructor(){super(...arguments);this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?(0,wt.jsx)(c7,{}):this.props.children}},h7=document.getElementById("app");if(!h7)throw new Error("Transcript document root is missing.");var i7=(0,d7.createRoot)(h7);try{i7.render((0,wt.jsx)(Rx,{children:(0,wt.jsx)(Kxe,{value:Hxe()})}))}catch{i7.render((0,wt.jsx)(c7,{}))}})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rvsx/qwen-code",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.9",
|
|
4
4
|
"description": "Qwen Code - AI-powered coding assistant",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
"export-transcript-document.js"
|
|
28
28
|
],
|
|
29
29
|
"config": {
|
|
30
|
-
"sandboxImageUri": "nologinb/qwen-code:0.23.
|
|
30
|
+
"sandboxImageUri": "nologinb/qwen-code:0.23.9"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {},
|
|
33
33
|
"optionalDependencies": {
|
|
34
|
-
"@qwen-code/audio-capture": "0.23.
|
|
34
|
+
"@qwen-code/audio-capture": "0.23.9",
|
|
35
35
|
"@lydell/node-pty": "1.2.0-beta.10",
|
|
36
36
|
"@lydell/node-pty-darwin-arm64": "1.2.0-beta.10",
|
|
37
37
|
"@lydell/node-pty-darwin-x64": "1.2.0-beta.10",
|