@qredence/fleet 0.6.2 → 0.6.3
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/CHANGELOG.md +6 -0
- package/dist/web/client/assets/DialogTitle-DiAm7YNe.js +1 -0
- package/dist/web/client/assets/alert-dialog-CYE37KMM.js +1 -0
- package/dist/web/client/assets/{artifacts-panel-DmQghvw8.js → artifacts-panel-ClDpGWOU.js} +1 -1
- package/dist/web/client/assets/{chat-C24kD2SP.js → chat-BVMnC5Qh.js} +1 -1
- package/dist/web/client/assets/{chat-command-palette-BIwjhE6s.js → chat-command-palette-YuyaJNbi.js} +1 -1
- package/dist/web/client/assets/{citations-BUvM92nt.js → citations-DXqV2NLy.js} +1 -1
- package/dist/web/client/assets/command-Cw4X8Bpk.js +1 -0
- package/dist/web/client/assets/dialog-BzcIOvFC.js +1 -0
- package/dist/web/client/assets/{fork-picker-dialog-CpwEwsxA.js → fork-picker-dialog-BYRr-xTy.js} +1 -1
- package/dist/web/client/assets/git-branch-CTq9aACS.js +1 -0
- package/dist/web/client/assets/globals-BtCXZXL_.css +2 -0
- package/dist/web/client/assets/{index-BGnQeUYE.js → index-B9aXxpOv.js} +2 -2
- package/dist/web/client/assets/{model-selector-list-CRZCXeBf.js → model-selector-list-CHD8lMAl.js} +1 -1
- package/dist/web/client/assets/{openui-renderer-Bkkx5kmA.js → openui-renderer-C4e9FOVR.js} +8 -8
- package/dist/web/client/assets/provider-catalog-ClVvphe0.js +1 -0
- package/dist/web/client/assets/provider-label-CwZ-KDxk.js +1 -0
- package/dist/web/client/assets/right-panel-registry-BnYCffmM.js +2 -0
- package/dist/web/client/assets/routes-DUontXSG.js +16 -0
- package/dist/web/client/assets/{session-tool-renderer-3E3cv8D0.js → session-tool-renderer-Bd3dsE2D.js} +3 -3
- package/dist/web/client/assets/session-tree-panel-CM4_wwrM.js +1 -0
- package/dist/web/client/assets/settings-dialog-DMTD9m6z.js +2 -0
- package/dist/web/client/assets/sparkles-BY5MFyk6.js +1 -0
- package/dist/web/client/assets/{subagent-chat-panel-C5ukYiUx.js → subagent-chat-panel-BESrXxAR.js} +1 -1
- package/dist/web/client/assets/{subagent-transcript-lqNcSVbH.js → subagent-transcript-CAqFJfMj.js} +1 -1
- package/dist/web/client/assets/{subagents-panel-SJKhaVTr.js → subagents-panel-8aKOwWLs.js} +1 -1
- package/dist/web/client/assets/{virtualized-turn-list-BgUgX6tM.js → virtualized-turn-list-mL3ONUUA.js} +3 -3
- package/dist/web/client/bundle-budget.json +6 -6
- package/dist/web/server/{_tanstack-start-manifest_v-BDPifIFN-DTSNCHBX.js → _tanstack-start-manifest_v-Cm8xE-Rb-TMLYN3GY.js} +15 -13
- package/dist/web/server/{artifacts-panel-BN3DgqfV-N73J6N5Y.js → artifacts-panel-CwLVBqyi-CDORJY75.js} +21 -20
- package/dist/web/server/{chat-command-palette-G8awyZRw-2QE7FXGT.js → chat-command-palette-DUha04ia-5OV7WVJZ.js} +11 -9
- package/dist/web/server/{chunk-ZOVXMNJM.js → chunk-3Q3QKLHC.js} +5 -96
- package/dist/web/server/{chunk-6SOMNRAX.js → chunk-ADYZWC5L.js} +12 -12
- package/dist/web/server/{chunk-CW6KZUKT.js → chunk-B2LF64HM.js} +1 -1
- package/dist/web/server/{chunk-YMPJMHXZ.js → chunk-DP26GVWH.js} +3 -2
- package/dist/web/server/chunk-ETCO5KZK.js +113 -0
- package/dist/web/server/{chunk-ENGEUJIH.js → chunk-FMAYMBRS.js} +22 -20
- package/dist/web/server/{chunk-WB2LJC3R.js → chunk-FTLJ66KU.js} +4 -4
- package/dist/web/server/{chunk-OSMP55KI.js → chunk-H5D5DX3K.js} +1 -20
- package/dist/web/server/chunk-HGVJEUV4.js +102 -0
- package/dist/web/server/{chunk-FT74GAAH.js → chunk-KZ35W5M7.js} +27 -27
- package/dist/web/server/{chunk-CCYLHNZJ.js → chunk-O2IC376F.js} +46 -3
- package/dist/web/server/chunk-OMPXUTMX.js +33 -0
- package/dist/web/server/{chunk-BUXJSBE3.js → chunk-RJNGEU6C.js} +1 -1
- package/dist/web/server/{chunk-O2UYZT3Z.js → chunk-T2UTBHJ4.js} +48 -4
- package/dist/web/server/{chunk-NMBH57JT.js → chunk-TU2WNRAL.js} +6 -6
- package/dist/web/server/{chunk-JPDRUSUD.js → chunk-UM3RHJNZ.js} +1 -1
- package/dist/web/server/{chunk-4OTHKQMG.js → chunk-V5IFFLZQ.js} +4 -4
- package/dist/web/server/{chunk-EDAWH2MT.js → chunk-XEG4JTND.js} +2 -2
- package/dist/web/server/{chunk-NCK2FJAD.js → chunk-XSOUURPF.js} +2 -2
- package/dist/web/server/{chunk-ESM7OCRL.js → chunk-YCCF676T.js} +3 -3
- package/dist/web/server/{chunk-JVOW2NWC.js → chunk-YDDDSVNB.js} +7 -100
- package/dist/web/server/{fork-picker-dialog-YKlapaxN-DR5L74ST.js → fork-picker-dialog-DeMiLZtS-WTRTTP64.js} +4 -3
- package/dist/web/server/{message-queue-Demph1x4-RBJUC3AT.js → message-queue-Demph1x4-GGXJUUKO.js} +4 -4
- package/dist/web/server/{model-selector-list-BmzLiCx9-TK6JGGKU.js → model-selector-list-BeGQHwKV-UJYFO4KX.js} +9 -8
- package/dist/web/server/{openui-renderer-moJGf0LA-QCU3PI6H.js → openui-renderer-B4z18Brm-HSMKJ47D.js} +13 -12
- package/dist/web/server/{router-CPdFlpbe-LAD4MNZB.js → router-DfG45nTQ-3VXEUYG5.js} +278 -56
- package/dist/web/server/{routes-hkom6S6L-DUPPQHPY.js → routes-B9F9UfF1-UN2IVBMJ.js} +271 -117
- package/dist/web/server/server.js +2 -2
- package/dist/web/server/{session-tool-renderer-CglQ2ky7-2JVYNZG2.js → session-tool-renderer-CT65wuet-RQBMXHEZ.js} +11 -10
- package/dist/web/server/session-tree-panel-rS0t1wbf-HNA6AJBY.js +229 -0
- package/dist/web/server/{settings-dialog-BCEfmgtP-T3WQEZHB.js → settings-dialog-CqkrDSnm-LFEKSS7Y.js} +38 -34
- package/dist/web/server/{subagent-chat-panel-BTwI1kdB-LKBWA4GD.js → subagent-chat-panel-Cf7QdDqH-DPPSVLSY.js} +18 -17
- package/dist/web/server/{subagents-panel-8Z9_csoV-HYMEEBHB.js → subagents-panel-_JsUw-6t-MZWM5P45.js} +18 -17
- package/package.json +1 -1
- package/dist/web/client/assets/command-Dv96gATQ.js +0 -1
- package/dist/web/client/assets/dialog-BCb4rQh0.js +0 -1
- package/dist/web/client/assets/globals-DCtBkCSD.css +0 -2
- package/dist/web/client/assets/provider-catalog-C0XBIasJ.js +0 -1
- package/dist/web/client/assets/provider-label-Cka0ep0S.js +0 -1
- package/dist/web/client/assets/right-panel-registry-BCW7fQTG.js +0 -2
- package/dist/web/client/assets/routes-BWe5Iz-2.js +0 -16
- package/dist/web/client/assets/settings-dialog-B8lHq2tT.js +0 -2
- package/dist/web/client/assets/sparkles-D8XIY8pN.js +0 -1
- package/dist/web/server/{chunk-43S5N7SH.js → chunk-5RTGRTPD.js} +3 -3
- package/dist/web/server/{chunk-OMEDERPG.js → chunk-S2IBIJIG.js} +3 -3
- package/dist/web/server/{chunk-IXGLKAPN.js → chunk-TR2GA5OF.js} +3 -3
- package/dist/web/server/{workspace-panel-BHEB9nRM-TS62SYBA.js → workspace-panel-BHEB9nRM-Y6KGIVGP.js} +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e,r as t}from"./rolldown-runtime-hePW80VL.js";import{t as n}from"./react-CwJFpaho.js";import{t as r}from"./jsx-runtime-NZYk81nU.js";import{t as i}from"./utils-Brtgag-m.js";import{c as a,f as o,l as s,n as c,o as l,r as u}from"./ease-CMumuPlX.js";import{n as d,t as f}from"./use-reduced-motion-BOcG709U.js";import{t as p}from"./createLucideIcon-_dfI7Arx.js";import{i as m,n as h,r as g,t as _}from"./tool-result-B_yb2JoE.js";import{a as v,i as y,o as b,r as x,s as S}from"./citations-BUvM92nt.js";import{t as C}from"./check-B3LlvM65.js";import{t as w}from"./chevron-down-DUUprRP5.js";import{t as T}from"./chevron-right-NVqQIoiO.js";import{n as E,t as D}from"./safe-external-url-BbAom7Bm.js";import{n as O,t as k}from"./file-text-TmalmYrb.js";import{n as A,t as j}from"./loader-circle-B5GIZGxd.js";import{a as M,n as ee,r as te,t as ne}from"./agent-disclosure-CMrxF7L-.js";import{a as re,i as ie,n as ae,r as oe,t as se}from"./ipython-tool-CkHaO3PW.js";import{i as ce,n as le,r as ue,t as de}from"./sparkles-D8XIY8pN.js";import{t as fe}from"./eye-CDHqtVoE.js";import{t as pe}from"./rotate-ccw-CfGhzOv7.js";import{t as me}from"./search-BjcXAUrI.js";import{t as he}from"./terminal-BQAKkBY6.js";import{t as ge}from"./wrench-Myc12BTA.js";import{t as _e}from"./x-BGsDD848.js";import{t as N}from"./preload-helper-Czpn1I53.js";import{a as ve,i as ye,n as be,o as xe,r as Se,s as Ce}from"./dist-CZDnnosQ.js";import{i as we,r as Te}from"./workspace-path-nav-DqPbETfJ.js";import{n as Ee,r as De,t as Oe}from"./collapsible-CUxOjhDJ.js";import{n as ke,t as Ae}from"./range-BWOHiLNe.js";import{s as je}from"./surfaces-CpfsGAIA.js";var Me=p(`chevrons-down`,[[`path`,{d:`m7 6 5 5 5-5`,key:`1lc07p`}],[`path`,{d:`m7 13 5 5 5-5`,key:`1d48rs`}]]),Ne=p(`chevrons-up`,[[`path`,{d:`m17 11-5-5-5 5`,key:`e8nh98`}],[`path`,{d:`m17 18-5-5-5 5`,key:`2avn1x`}]]),Pe=p(`file-plus`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M9 15h6`,key:`cctwl0`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}]]),Fe=p(`folder-search`,[[`path`,{d:`M10.7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v4.1`,key:`1bw5m7`}],[`path`,{d:`m21 21-1.9-1.9`,key:`1g2n9r`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}]]),P=t(n(),1),F=r(),Ie=`__custom__`;function Le(e){return String.fromCharCode(65+e)}function Re(e,t,n){if(!e||e.kind===`skip`)return{selectedIds:[],customText:``,textValue:``};if(t===`text`)return{selectedIds:[],customText:``,textValue:e.text??``};let r=new Set(e.selectedIds??[]),i=e.text??``;return n&&i.trim().length>0&&r.add(Ie),{selectedIds:Array.from(r),customText:i,textValue:``}}function ze({questions:e,questionIndex:t=1,totalQuestions:n,onPreviousQuestion:r,onNextQuestion:a,submitLabel:o=`Send`,nextLabel:s=`Next`,skipLabel:c=`Skip`,allowSkip:l=!0,initialAnswer:u,onSubmit:d,onSkip:f,className:p}){let m=n??e.length,h=Math.max(1,Math.min(t,m)),g=e[h-1],_=g?.allowCustom??!1,[v,y]=(0,P.useState)(()=>Re(u,g?.kind,_).selectedIds),[b,x]=(0,P.useState)(()=>Re(u,g?.kind,_).customText),[S,C]=(0,P.useState)(()=>Re(u,g?.kind,_).textValue),w=m>1&&(!!r||!!a),T=h>1,E=h<m,D=h>=m,O=(0,P.useMemo)(()=>new Set(v),[v]),k=D?o:s,A=(0,P.useMemo)(()=>{if(g?.kind===`text`)return S.trim().length>0;let e=v.filter(e=>e!==Ie).length+ +(b.trim().length>0);if(g?.kind===`single`)return e===1;let t=g?.minSelections??1,n=g?.maxSelections;return e<t||typeof n==`number`&&e>n?!1:e>0},[g?.kind,g?.minSelections,g?.maxSelections,v,b,S]),j=e=>{y(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},M=e=>{y([e])},ee=e=>{if(x(e),g){if(g.kind===`single`){y(e.trim().length>0?[Ie]:[]);return}y(t=>{let n=t.includes(Ie);return e.trim().length>0&&!n?[...t,Ie]:e.trim().length===0&&n?t.filter(e=>e!==Ie):t})}};return g?(0,F.jsxs)(`div`,{className:i(`flex flex-col gap-2 bg-background px-3 py-2`,p),children:[(0,F.jsx)(`div`,{className:`flex items-center justify-between gap-px`,"data-total-questions":m,children:(0,F.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-foreground`,children:[(0,F.jsx)(`span`,{className:`inline-flex h-5 min-w-5 items-center justify-center rounded px-1 text-sm font-medium text-muted-foreground`,children:h}),(0,F.jsx)(`span`,{children:g.title})]})}),g.kind!==`text`&&(g.options?.length??0)>0&&(0,F.jsxs)(`div`,{className:`flex flex-col gap-px`,children:[g.options.map((e,t)=>{let n=e.id??e.value??e.label,r=O.has(n);return(0,F.jsxs)(`button`,{type:`button`,onClick:()=>{g.kind===`single`?(M(n),_&&x(``)):j(n)},className:`-mx-2 flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left hover:bg-secondary`,children:[(0,F.jsx)(`span`,{className:i(`inline-flex h-5 min-w-5 items-center justify-center rounded border px-1 text-sm font-medium`,r?`border-primary bg-primary text-primary-foreground`:`border-border bg-transparent text-muted-foreground`),children:Le(t)}),(0,F.jsxs)(`span`,{className:`text-sm text-foreground`,children:[e.label,e.description&&(0,F.jsxs)(`span`,{className:`text-muted-foreground`,children:[` `,e.description]})]})]},n)}),_&&(0,F.jsxs)(`div`,{className:`flex items-center gap-2 pt-1`,children:[(0,F.jsx)(`span`,{className:i(`inline-flex h-5 min-w-5 items-center justify-center rounded border px-1 text-sm font-medium`,v.includes(Ie)?`border-primary bg-primary text-primary-foreground`:`border-border bg-transparent text-muted-foreground`),children:Le(g.options.length)}),(0,F.jsx)(`input`,{value:b,onChange:e=>ee(e.target.value),placeholder:g.customPlaceholder??`Type your answer`,className:`h-7 w-full rounded-md border border-border bg-background px-2 text-base text-foreground md:text-sm`})]})]}),g.kind===`text`&&(0,F.jsx)(`textarea`,{value:S,onChange:e=>C(e.target.value),placeholder:g.placeholder??`Type your answer`,rows:3,className:`w-full resize-y rounded-md border border-border bg-background px-2 py-1.5 text-base text-foreground md:text-sm`}),(0,F.jsxs)(`div`,{className:i(`flex items-center gap-1.5`,w?`justify-between`:`justify-end`),children:[w&&(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[r&&(0,F.jsx)(`button`,{type:`button`,onClick:r,disabled:!T,className:`h-6 rounded px-2 text-sm text-muted-foreground hover:text-foreground disabled:opacity-60`,children:`Previous`}),a&&(0,F.jsx)(`button`,{type:`button`,onClick:a,disabled:!E,className:`h-6 rounded px-2 text-sm text-muted-foreground hover:text-foreground disabled:opacity-60`,children:`Next`})]}),(0,F.jsxs)(`div`,{className:`flex items-center justify-end gap-1.5`,children:[l&&(0,F.jsx)(`button`,{type:`button`,onClick:()=>{f?.(),d({kind:`skip`})},className:`h-6 rounded px-2 text-sm text-muted-foreground transition-[background-color,color,transform] duration-150 hover:bg-muted/50 hover:text-foreground active:scale-[0.98]`,children:c}),(0,F.jsx)(`button`,{type:`button`,onClick:()=>{if(!A||!g)return;if(g.kind===`text`){d({kind:`text`,questionId:g.id,text:S.trim()});return}let e=v.filter(e=>e!==Ie),t=b.trim()||void 0;d({kind:g.kind,questionId:g.id,selectedIds:e,text:t||void 0})},disabled:!A,className:`h-6 rounded bg-primary px-2.5 text-sm font-medium text-primary-foreground transition-[background-color,transform] duration-150 hover:bg-primary/90 active:scale-[0.98] disabled:opacity-60 disabled:hover:bg-primary disabled:active:scale-100`,children:k})]})]})]}):null}function Be(e){if(e.kind===`skip`)return`Skipped`;if(e.kind===`text`)return e.text||`Answered`;let t=e.selectedIds?.length?e.selectedIds.join(`, `):``;return e.text?t?`${t} (${e.text})`:e.text:t||`Answered`}function Ve({part:e}){let[t,n]=(0,P.useState)(e.input?.questionIndex??1),r=e.input?.questions??[],i=e.input?.totalQuestions??r.length,a=typeof e.input?.questionIndex==`number`,o=a?e.input?.questionIndex??1:r.length>0?t:e.input?.questionIndex??1,s=Math.max(1,Math.min(o,i)),c=r[s-1],[l,u]=(0,P.useState)({}),[d,f]=(0,P.useState)(e.input?.questionIndex);e.input?.questionIndex!==d&&(f(e.input?.questionIndex),typeof e.input?.questionIndex==`number`&&n(e.input.questionIndex));let[p,m]=(0,P.useState)(e.toolCallId);e.toolCallId!==p&&(m(e.toolCallId),u({}),n(e.input?.questionIndex??1));let h=e.output?.answer,g=Object.keys(l).length,_=i===1?!!h||g>=1:i>0&&g>=i,y=i>1&&!_,b=s>1,x=s<i,S=(0,P.useMemo)(()=>!_||i<=1?[]:Array.from({length:i},(e,t)=>({index:t+1,answer:l[t+1]})),[_,l,i]),C=(0,P.useMemo)(()=>_?S.length>0?S.map(e=>`${e.index}: ${e.answer?Be(e.answer):`Pending`}`).join(` • `):h?Be(h):l[s]?Be(l[s]):`Pending`:``,[_,S,h,l,s]);if(!c)return null;let T=()=>{b&&(e.input?.onPreviousQuestion?.(),a||n(e=>Math.max(1,e-1)))},D=()=>{x&&(e.input?.onNextQuestion?.(),a||n(e=>Math.min(i,e+1)))};return(0,F.jsxs)(`div`,{className:`overflow-hidden rounded-chat-tool border border-border bg-muted`,children:[(0,F.jsxs)(`div`,{className:`flex h-7 items-center justify-between border-b border-border px-3 text-xs text-muted-foreground`,children:[(0,F.jsxs)(`div`,{className:`inline-flex items-center gap-1.5`,children:[(0,F.jsx)(v,{className:`size-3.5`}),`Question`]}),y&&(0,F.jsxs)(`div`,{className:`inline-flex items-center gap-1`,children:[(0,F.jsx)(`button`,{type:`button`,onClick:T,disabled:!b,className:`inline-flex size-5 items-center justify-center rounded-[4px] hover:bg-secondary disabled:opacity-40`,"aria-label":`Previous question`,children:(0,F.jsx)(E,{className:`size-3.5`})}),(0,F.jsxs)(`span`,{children:[s,` of `,i]}),(0,F.jsx)(`button`,{type:`button`,onClick:D,disabled:!x,className:`inline-flex size-5 items-center justify-center rounded-[4px] hover:bg-secondary disabled:opacity-40`,"aria-label":`Next question`,children:(0,F.jsx)(w,{className:`size-3.5`})})]})]}),_?(0,F.jsx)(`div`,{className:`bg-background px-3 py-2 text-xs text-muted-foreground`,children:C}):(0,F.jsx)(ze,{questions:r,questionIndex:s,totalQuestions:i,initialAnswer:l[s],submitLabel:e.input?.submitLabel,nextLabel:e.input?.nextLabel,skipLabel:e.input?.skipLabel,allowSkip:e.input?.allowSkip,onSubmit:t=>{u(e=>({...e,[s]:t})),e.input?.onSubmitAnswer?.(t),s<i&&D()}},`${s}-${c.title}`)]})}function He(e){return e.split(`|`).map(e=>e.trim().split(/\s+/)[0]??``).filter(Boolean).slice(0,4).join(`, `)}function Ue({step:e,state:t,onComplete:n,approval:r}){re(t===`animating`,e.duration,n);let i=t===`animating`,a=e.bashCommand??e.toolDetail,o=He(a);return(0,F.jsxs)(`div`,{className:`overflow-hidden rounded-chat-tool border border-border bg-muted`,children:[(0,F.jsxs)(`div`,{className:`flex h-7 items-center justify-between pr-2 pl-2.5`,children:[(0,F.jsx)(`div`,{className:`flex min-w-0 items-center gap-1.5 overflow-hidden`,children:i?(0,F.jsxs)(oe,{as:`span`,duration:1.2,className:`m-0 inline-flex h-full items-center truncate text-xs leading-none`,children:[`Running command: `,o]}):(0,F.jsxs)(`span`,{className:`truncate text-xs text-muted-foreground`,children:[`Ran command: `,o]})}),i&&(0,F.jsx)(`svg`,{className:`h-3 w-3 shrink-0 animate-spin text-muted-foreground`,viewBox:`0 0 16 16`,fill:`none`,children:(0,F.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6`,stroke:`currentColor`,strokeWidth:`1.5`,strokeDasharray:`28`,strokeDashoffset:`7`,strokeLinecap:`round`})})]}),(0,F.jsxs)(`div`,{className:`overflow-hidden border-t border-border bg-background px-2.5 py-1.5 font-mono text-label leading-[16px]`,children:[(0,F.jsxs)(`div`,{className:`break-all`,children:[(0,F.jsx)(`span`,{className:`text-amber-600 select-none dark:text-amber-400`,children:`$ `}),(0,F.jsx)(`span`,{className:`text-foreground`,children:a})]}),!i&&e.bashOutput&&(0,F.jsx)(`div`,{className:`mt-1 max-h-[80px] overflow-hidden whitespace-pre-line text-muted-foreground`,children:e.bashOutput})]}),r&&(0,F.jsx)(ie,{isPending:i,...r})]})}var We=(0,P.memo)(function({part:e}){let t=e.input?.approval??e.args?.approval,{step:n,stepState:r}=ae(e,`Bash`);return(0,F.jsx)(Ue,{step:n,state:r,onComplete:()=>{},approval:t})});function Ge(e){let t=(0,P.useRef)(e);return(0,P.useInsertionEffect)(()=>void(t.current=e)),(0,P.useCallback)((...e)=>t.current(...e),[])}var Ke=(0,P.createContext)(void 0);function qe(){return(0,P.useContext)(Ke)}var Je={position:`absolute`,top:0,bottom:0,textAlign:`center`,whiteSpace:`normal`,touchAction:`none`},Ye={display:`contents`};function Xe(){return null}var Ze=`diffs-container`,Qe=/(?=^diff --git)/gm,$e=/(?<=\n)/,et=/^(---|\+\+\+)\s+([^\t\r\n]+)/,tt=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,nt=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,rt=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,it=`header-prefix`,at=`header-filename-suffix`,ot=`header-metadata`,st=`header-custom`,I={dark:`pierre-dark`,light:`pierre-light`},ct=`data-theme-css`,lt=`data-unsafe-css`,ut=`data-diffs-scrollbar-measure`,dt=`--diffs-scrollbar-gutter-measured`,ft=1e5,pt={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8};({...pt});var mt=Object.freeze({fromStart:0,fromEnd:0}),ht={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},gt={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0};function _t(e){return`annotation-${`side`in e?`${e.side}-`:``}${e.lineNumber}`}function vt({hunkIndex:e,lineIndex:t,conflictIndex:n}){return`merge-conflict-action-${e}-${t}-${n}`}function L(e,t){return e-(t===0?0:1)}function R(e,t){return L(e,t)+t}function yt(e,t){let n=t.hunks[e.hunkIndex];if(n!=null)return{hunkIndex:e.hunkIndex,lineIndex:bt(n,e.startContentIndex)}}function bt(e,t){let n=e.unifiedLineStart;for(let r=0;r<t;r++){let t=e.hunkContent[r];n+=t.type===`context`?t.lines:t.deletions+t.additions}return n}function xt({fileDiff:e,actions:t,renderCustomHeader:n,renderHeaderPrefix:r,renderHeaderFilenameSuffix:i,renderHeaderMetadata:a,renderAnnotation:o,renderGutterUtility:s,renderMergeConflictUtility:c,lineAnnotations:l,getHoveredLine:u,getInstance:d}){let f=n?.(e),p=r?.(e),m=i?.(e),h=a?.(e);return(0,F.jsxs)(F.Fragment,{children:[f==null?(0,F.jsxs)(F.Fragment,{children:[p!=null&&(0,F.jsx)(`div`,{slot:`header-prefix`,children:p}),m!=null&&(0,F.jsx)(`div`,{slot:`header-filename-suffix`,children:m}),h!=null&&(0,F.jsx)(`div`,{slot:`header-metadata`,children:h})]}):(0,F.jsx)(`div`,{slot:st,children:f}),o!=null&&l?.map((e,t)=>(0,F.jsx)(`div`,{slot:_t(e),children:o(e)},t)),t!=null&&c!=null&&d!=null&&t.map(t=>{if(t==null)return;let n=St(t,e);return(0,F.jsx)(`div`,{slot:n,style:Ye,children:c(t,d)},n)}),s!=null&&(0,F.jsx)(`div`,{slot:`gutter-utility-slot`,style:Je,children:s(u)})]})}function St(e,t){let n=yt(e,t);return n==null?void 0:vt({hunkIndex:n.hunkIndex,lineIndex:n.lineIndex,conflictIndex:e.conflictIndex})}function Ct(e,t){return e==null||t==null||typeof e==`string`||typeof t==`string`?e===t:e.dark===t.dark&&e.light===t.light}function wt(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}var Tt=new Set;function Et(e){let t=[],n=new Set;for(let r of Dt(e.themes)){let e=At(r)?r.getThemes():[r];for(let r of e){if(n.has(r.name))throw Error(`Theme collection already contains theme "${r.name}"`);n.add(r.name),t.push(r)}}let r=Object.freeze([...t]),i=Object.freeze(r.filter(e=>e.colorScheme===`light`)),a=Object.freeze(r.filter(e=>e.colorScheme===`dark`)),o=new Map(r.map(e=>[e.name,e])),s=Object.freeze(r.map(e=>e.name)),c=Object.freeze(i.map(e=>e.name)),l=Object.freeze(a.map(e=>e.name));function u(e){if(e==null)return r;let{colorScheme:t,collection:n}=e;return n==null?t===`light`?i:t===`dark`?a:r:r.filter(e=>e.collection===n?t==null||e.colorScheme===t:!1)}return{getTheme(e){return o.get(e)},getThemes(e){return u(e)},getThemeNames(e){return e?.collection==null?e?.colorScheme===`light`?c:e?.colorScheme===`dark`?l:s:u(e).map(e=>e.name)},hasTheme(e){return o.has(e)},orderBy(e){return Et({themes:r.map((e,t)=>({descriptor:e,index:t})).sort((t,n)=>{let r=e(t.descriptor,n.descriptor);return r===0?t.index-n.index:r}).map(e=>e.descriptor)})},pick(e){let t=[],n=new Set;for(let r of e){if(n.has(r))throw Error(`Theme collection pick already includes theme "${r}"`);n.add(r);let e=o.get(r);if(e==null)throw Error(`Theme collection does not contain theme "${r}"`);t.push(e)}return Et({themes:t})},registerInto(e){for(let t of r)e.registerThemeIfAbsent(t.name,t.load)}}}function Dt(e){return Ot(e)?[e]:e}function Ot(e){return At(e)||kt(e)}function kt(e){return typeof e.name==`string`&&typeof e.load==`function`}function At(e){return typeof e.getThemes==`function`}function jt(e){return typeof e==`object`&&e&&`default`in e?e.default:e}var Mt=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name=`DuplicateThemeError`}},Nt=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name=`UnregisteredThemeError`}},Pt=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name=`UnresolvedThemeError`}};function Ft(){let e=new Map,t=new Map,n=new Map,r=0;function i(t,n){if(e.has(t))throw new Mt(t);e.set(t,n)}function a(t,n){return!e.has(t)&&(e.set(t,n),!0)}function o(t){return e.has(t)}function s(i){let a=t.get(i);if(a!==void 0)return Promise.resolve(a);let o=n.get(i);if(o!==void 0)return o;let s=e.get(i);if(s===void 0)return Promise.reject(new Nt(i));let c=r,l=s().then(e=>{let a=jt(e);return c===r&&t.set(i,a),n.get(i)===l&&n.delete(i),a}).catch(e=>{throw n.get(i)===l&&n.delete(i),e});return n.set(i,l),l}function c(e){return Promise.all(e.map(e=>s(e)))}function l(e,n){t.set(e,n)}function u(e){for(let[t,n]of e)l(t,n)}function d(e){return t.get(e)}function f(e){let n=[];for(let r of e){let e=t.get(r);if(e===void 0)throw new Pt(r);n.push(e)}return n}function p(e){return t.has(e)}function m(e){for(let n of e)if(!t.has(n))return!1;return!0}function h(e){let n=t.get(e);return n===void 0?s(e):n}function g(){r++,t.clear(),n.clear()}return{clearResolvedThemes:g,getResolvedOrResolveTheme:h,getResolvedTheme:d,getResolvedThemes:f,hasRegisteredTheme:o,hasResolvedTheme:p,hasResolvedThemes:m,registerTheme:i,registerThemeIfAbsent:a,resolveTheme:s,resolveThemes:c,seedResolvedTheme:l,seedResolvedThemes:u}}var z=Ft();function It(e,t){e=Array.isArray(e)?e:[e];for(let n of e){let e;if(typeof n==`string`){if(e=z.getResolvedTheme(n),e==null)throw Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else e=n,n=n.name,z.getResolvedTheme(n)??z.seedResolvedTheme(n,e);Tt.has(n)||(Tt.add(n),t.loadThemeSync(e))}}var Lt=new Map,Rt=new Map,zt=new Map,Bt=new Set;function Vt(e,t){e=Array.isArray(e)?e:[e];for(let n of e){if(Bt.has(n.name))continue;let e=Lt.get(n.name);e??(e=n,Lt.set(n.name,e)),Bt.add(e.name),t.loadLanguageSync(e.data)}}function Ht(){return typeof WorkerGlobalScope<`u`&&typeof self<`u`&&self instanceof WorkerGlobalScope}async function Ut(e){if(Ht())throw Error(`resolveLanguage("${e}") cannot be called from a worker context. Languages must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);let t=Rt.get(e);if(t!=null)return t;try{let t=zt.get(e);if(t==null&&Object.prototype.hasOwnProperty.call(Ce,e)&&(t=Ce[e]),t==null)throw Error(`resolveLanguage: "${e}" not found in bundled or custom languages`);let n=t().then(({default:t})=>{let n={name:e,data:t};return Lt.has(e)||Lt.set(e,n),n});return Rt.set(e,n),await n}finally{Rt.delete(e)}}function Wt(e){return Lt.get(e)??Ut(e)}function Gt({name:e,load:t,colorScheme:n,collection:r,displayName:i}){return{name:e,colorScheme:n,collection:r,displayName:i,load:Kt(t)}}function Kt(e){return async()=>ve(jt(await e()))}var qt=`pierre`,Jt=[`pierre-dark`,`pierre-dark-soft`,`pierre-dark-vibrant`,`pierre-dark-protanopia-deuteranopia`,`pierre-dark-tritanopia`],Yt=[`pierre-light`,`pierre-light-soft`,`pierre-light-vibrant`,`pierre-light-protanopia-deuteranopia`,`pierre-light-tritanopia`],Xt=[...Yt,...Jt],Zt=new Set(Yt);function Qt(e){return Zt.has(e)?`light`:`dark`}var $t={"pierre-dark":`Pierre Dark`,"pierre-dark-soft":`Pierre Dark Soft`,"pierre-dark-vibrant":`Pierre Dark Vibrant`,"pierre-dark-protanopia-deuteranopia":`Pierre Dark Protanopia & Deuteranopia`,"pierre-dark-tritanopia":`Pierre Dark Tritanopia`,"pierre-light":`Pierre Light`,"pierre-light-soft":`Pierre Light Soft`,"pierre-light-vibrant":`Pierre Light Vibrant`,"pierre-light-protanopia-deuteranopia":`Pierre Light Protanopia & Deuteranopia`,"pierre-light-tritanopia":`Pierre Light Tritanopia`},en={"pierre-dark":()=>N(()=>import(`./pierre-dark-CpLgRqie.js`),[]),"pierre-dark-soft":()=>N(()=>import(`./pierre-dark-soft-kZQmAZld.js`),[]),"pierre-dark-vibrant":()=>N(()=>import(`./pierre-dark-vibrant-CpQYzh95.js`),[]),"pierre-dark-protanopia-deuteranopia":()=>N(()=>import(`./pierre-dark-protanopia-deuteranopia-B35FxJx-.js`),[]),"pierre-dark-tritanopia":()=>N(()=>import(`./pierre-dark-tritanopia-CpjhbsIL.js`),[]),"pierre-light":()=>N(()=>import(`./pierre-light-CoaEpmwp.js`),[]),"pierre-light-soft":()=>N(()=>import(`./pierre-light-soft-lWLdNTOI.js`),[]),"pierre-light-vibrant":()=>N(()=>import(`./pierre-light-vibrant-D80Fkn33.js`),[]),"pierre-light-protanopia-deuteranopia":()=>N(()=>import(`./pierre-light-protanopia-deuteranopia-0fSaH845.js`),[]),"pierre-light-tritanopia":()=>N(()=>import(`./pierre-light-tritanopia-CEbqgOJL.js`),[])};function tn(e){return Gt({name:e,collection:qt,colorScheme:Qt(e),displayName:$t[e],load:en[e]})}var nn=Et({themes:Xt.map(e=>tn(e))}),rn=`shiki`,an=[`ayu-light`,`catppuccin-latte`,`everforest-light`,`github-light`,`github-light-default`,`github-light-high-contrast`,`gruvbox-light-hard`,`gruvbox-light-medium`,`gruvbox-light-soft`,`horizon-bright`,`kanagawa-lotus`,`light-plus`,`material-theme-lighter`,`min-light`,`night-owl-light`,`one-light`,`rose-pine-dawn`,`slack-ochin`,`snazzy-light`,`solarized-light`,`vitesse-light`],on=`andromeeda.aurora-x.ayu-dark.ayu-mirage.catppuccin-frappe.catppuccin-macchiato.catppuccin-mocha.dark-plus.dracula.dracula-soft.everforest-dark.github-dark.github-dark-default.github-dark-dimmed.github-dark-high-contrast.gruvbox-dark-hard.gruvbox-dark-medium.gruvbox-dark-soft.horizon.houston.kanagawa-dragon.kanagawa-wave.laserwave.material-theme.material-theme-darker.material-theme-ocean.material-theme-palenight.min-dark.monokai.night-owl.nord.one-dark-pro.plastic.poimandres.red.rose-pine.rose-pine-moon.slack-dark.solarized-dark.synthwave-84.tokyo-night.vesper.vitesse-black.vitesse-dark`.split(`.`),sn=new Set(an);function cn(e){return sn.has(e)?`light`:`dark`}var ln={andromeeda:()=>N(()=>import(`./andromeeda-vGVdxbeo.js`),[]),"aurora-x":()=>N(()=>import(`./aurora-x-CDeNXAV0.js`),[]),"ayu-dark":()=>N(()=>import(`./ayu-dark-DluEY0Gj.js`),[]),"ayu-light":()=>N(()=>import(`./ayu-light-C3h-C4tm.js`),[]),"ayu-mirage":()=>N(()=>import(`./ayu-mirage-Bqwy1Gya.js`),[]),"catppuccin-frappe":()=>N(()=>import(`./catppuccin-frappe-C9Q5zVZY.js`),[]),"catppuccin-latte":()=>N(()=>import(`./catppuccin-latte-CtsyrtPq.js`),[]),"catppuccin-macchiato":()=>N(()=>import(`./catppuccin-macchiato-R8nAf1vR.js`),[]),"catppuccin-mocha":()=>N(()=>import(`./catppuccin-mocha-DjuaAJKi.js`),[]),"dark-plus":()=>N(()=>import(`./dark-plus-Cs2F2srj.js`),[]),dracula:()=>N(()=>import(`./dracula-BHWKrbxM.js`),[]),"dracula-soft":()=>N(()=>import(`./dracula-soft-5eyTD99u.js`),[]),"everforest-dark":()=>N(()=>import(`./everforest-dark-sB-x3p7T.js`),[]),"everforest-light":()=>N(()=>import(`./everforest-light-Df2xbC6M.js`),[]),"github-dark":()=>N(()=>import(`./github-dark-C-LZuMrd.js`),[]),"github-dark-default":()=>N(()=>import(`./github-dark-default-DXG-b-1a.js`),[]),"github-dark-dimmed":()=>N(()=>import(`./github-dark-dimmed-Bx1FflLF.js`),[]),"github-dark-high-contrast":()=>N(()=>import(`./github-dark-high-contrast-B_tTalzw.js`),[]),"github-light":()=>N(()=>import(`./github-light-EUqPIrTm.js`),[]),"github-light-default":()=>N(()=>import(`./github-light-default-BXViO-2h.js`),[]),"github-light-high-contrast":()=>N(()=>import(`./github-light-high-contrast-B68TUdTA.js`),[]),"gruvbox-dark-hard":()=>N(()=>import(`./gruvbox-dark-hard-C820rvS2.js`),[]),"gruvbox-dark-medium":()=>N(()=>import(`./gruvbox-dark-medium-BPjhmG05.js`),[]),"gruvbox-dark-soft":()=>N(()=>import(`./gruvbox-dark-soft-MrdJrrXF.js`),[]),"gruvbox-light-hard":()=>N(()=>import(`./gruvbox-light-hard-BC_s9l72.js`),[]),"gruvbox-light-medium":()=>N(()=>import(`./gruvbox-light-medium-BAWPOn9u.js`),[]),"gruvbox-light-soft":()=>N(()=>import(`./gruvbox-light-soft-BSMLrYjP.js`),[]),horizon:()=>N(()=>import(`./horizon-CE9ld1lL.js`),[]),"horizon-bright":()=>N(()=>import(`./horizon-bright-DSNQnXHK.js`),[]),houston:()=>N(()=>import(`./houston-CsvMBhTu.js`),[]),"kanagawa-dragon":()=>N(()=>import(`./kanagawa-dragon-Bozd7klA.js`),[]),"kanagawa-lotus":()=>N(()=>import(`./kanagawa-lotus-BmuOG9ZW.js`),[]),"kanagawa-wave":()=>N(()=>import(`./kanagawa-wave-BML5mF2J.js`),[]),laserwave:()=>N(()=>import(`./laserwave-C_8bwKvT.js`),[]),"light-plus":()=>N(()=>import(`./light-plus-DVQuIRkW.js`),[]),"material-theme":()=>N(()=>import(`./material-theme-Bm3Qr25_.js`),[]),"material-theme-darker":()=>N(()=>import(`./material-theme-darker-2IIEA8gg.js`),[]),"material-theme-lighter":()=>N(()=>import(`./material-theme-lighter-uhdI0v04.js`),[]),"material-theme-ocean":()=>N(()=>import(`./material-theme-ocean-CHQ94UKr.js`),[]),"material-theme-palenight":()=>N(()=>import(`./material-theme-palenight-B5W6OYN7.js`),[]),"min-dark":()=>N(()=>import(`./min-dark-BSWPekZh.js`),[]),"min-light":()=>N(()=>import(`./min-light-DDpmG2fV.js`),[]),monokai:()=>N(()=>import(`./monokai-B_bV9PQ9.js`),[]),"night-owl":()=>N(()=>import(`./night-owl-DhmEMT88.js`),[]),"night-owl-light":()=>N(()=>import(`./night-owl-light-eJ-hLW7d.js`),[]),nord:()=>N(()=>import(`./nord-Cb4Vim4T.js`),[]),"one-dark-pro":()=>N(()=>import(`./one-dark-pro-CLwyXe_n.js`),[]),"one-light":()=>N(()=>import(`./one-light-D7Lr4KcI.js`),[]),plastic:()=>N(()=>import(`./plastic-DQwYfKfQ.js`),[]),poimandres:()=>N(()=>import(`./poimandres-DRFjx7u4.js`),[]),red:()=>N(()=>import(`./red-DX1BQOs8.js`),[]),"rose-pine":()=>N(()=>import(`./rose-pine-aMsaMD1D.js`),[]),"rose-pine-dawn":()=>N(()=>import(`./rose-pine-dawn-8PwUyIlP.js`),[]),"rose-pine-moon":()=>N(()=>import(`./rose-pine-moon-DO-qXg-I.js`),[]),"slack-dark":()=>N(()=>import(`./slack-dark-DnToyrRv.js`),[]),"slack-ochin":()=>N(()=>import(`./slack-ochin-B2OO5cIa.js`),[]),"snazzy-light":()=>N(()=>import(`./snazzy-light-4G7pJPwS.js`),[]),"solarized-dark":()=>N(()=>import(`./solarized-dark-UdsmMDCL.js`),[]),"solarized-light":()=>N(()=>import(`./solarized-light-C1IUL_tW.js`),[]),"synthwave-84":()=>N(()=>import(`./synthwave-84-nFMaYfgc.js`),[]),"tokyo-night":()=>N(()=>import(`./tokyo-night-oM2G3aXe.js`),[]),vesper:()=>N(()=>import(`./vesper-DdrHHSXu.js`),[]),"vitesse-black":()=>N(()=>import(`./vitesse-black-fwtXNY1n.js`),[]),"vitesse-dark":()=>N(()=>import(`./vitesse-dark-BZCL-v6S.js`),[]),"vitesse-light":()=>N(()=>import(`./vitesse-light-VbXTXTou.js`),[])};function un(e){return Gt({name:e,collection:rn,colorScheme:cn(e),load:ln[e]})}var dn=Et({themes:Object.freeze([...an.map(e=>un(e)),...on.map(e=>un(e))])});function fn(e){if(Ht())throw Error(`Theme "${e}" cannot be resolved from a worker context. Themes must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);if(z.hasRegisteredTheme(e))return;let t=dn.getTheme(e);if(t!=null){z.registerThemeIfAbsent(t.name,t.load);return}throw Error(`No valid theme loader registered for "${e}"`)}function pn(e,t){if(t.name!==e)throw Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${t.name}`)}async function mn(e){fn(e);let t=await z.resolveTheme(e);return pn(e,t),t}function hn(e){return z.getResolvedTheme(e)??mn(e)}var B;async function gn({themes:e,langs:t,preferredHighlighter:n=`shiki-js`}){B??=Se({themes:[],langs:[`text`],engine:n===`shiki-wasm`?xe(N(()=>import(`./wasm-BnjxR4X6.js`),[])):be()});let r=vn(B)?await B:B;B=r;let i=[];for(let e of t){if(e===`text`||e===`ansi`)continue;let t=Wt(e);`then`in t?i.push(t):Vt(t,r)}let a=[];for(let t of e){let e=hn(t);`then`in e?a.push(e):It(e,B)}return(i.length>0||a.length>0)&&await Promise.all([Promise.all(i).then(e=>{Vt(e,r)}),Promise.all(a).then(e=>{It(e,r)})]),r}function _n(){if(B!=null&&!(`then`in B))return B}function vn(e=B){return e!=null&&`then`in e}for(let e of nn.getThemes())z.registerThemeIfAbsent(e.name,e.load);function yn(e=I){let t=[];return typeof e==`string`?t.push(e):(t.push(e.dark),t.push(e.light)),t}var bn=new Map,xn={"1c":`1c`,abap:`abap`,as:`actionscript-3`,ada:`ada`,adb:`ada`,ads:`ada`,adoc:`asciidoc`,asciidoc:`asciidoc`,"component.html":`angular-html`,"component.ts":`angular-ts`,conf:`nginx`,htaccess:`apache`,cls:`tex`,trigger:`apex`,apl:`apl`,applescript:`applescript`,scpt:`applescript`,ara:`ara`,asm:`asm`,s:`riscv`,astro:`astro`,awk:`awk`,bal:`ballerina`,sh:`zsh`,bash:`zsh`,bat:`cmd`,cmd:`cmd`,be:`berry`,beancount:`beancount`,bib:`bibtex`,bicep:`bicep`,"blade.php":`blade`,bsl:`bsl`,c:`c`,h:`objective-cpp`,cs:`csharp`,cpp:`cpp`,hpp:`cpp`,cc:`cpp`,cxx:`cpp`,hh:`cpp`,cdc:`cdc`,cairo:`cairo`,clar:`clarity`,clj:`clojure`,cljs:`clojure`,cljc:`clojure`,soy:`soy`,cmake:`cmake`,"CMakeLists.txt":`cmake`,cob:`cobol`,cbl:`cobol`,cobol:`cobol`,CODEOWNERS:`codeowners`,ql:`ql`,coffee:`coffeescript`,lisp:`lisp`,cl:`lisp`,lsp:`lisp`,log:`log`,v:`verilog`,cql:`cql`,cr:`crystal`,css:`css`,csv:`csv`,cue:`cue`,cypher:`cypher`,cyp:`cypher`,d:`d`,dart:`dart`,dax:`dax`,desktop:`desktop`,diff:`diff`,patch:`diff`,Dockerfile:`dockerfile`,dockerfile:`dockerfile`,env:`dotenv`,dm:`dream-maker`,edge:`edge`,el:`emacs-lisp`,ex:`elixir`,exs:`elixir`,elm:`elm`,erb:`erb`,erl:`erlang`,hrl:`erlang`,f:`fortran-fixed-form`,for:`fortran-fixed-form`,fs:`fsharp`,fsi:`fsharp`,fsx:`fsharp`,f03:`f03`,f08:`f08`,f18:`f18`,f77:`f77`,f90:`fortran-free-form`,f95:`fortran-free-form`,fnl:`fennel`,fish:`fish`,ftl:`ftl`,tres:`gdresource`,res:`gdresource`,gd:`gdscript`,gdshader:`gdshader`,gs:`genie`,feature:`gherkin`,COMMIT_EDITMSG:`git-commit`,"git-rebase-todo":`git-rebase`,gjs:`glimmer-js`,gleam:`gleam`,gts:`glimmer-ts`,glsl:`glsl`,vert:`glsl`,frag:`glsl`,shader:`shaderlab`,gp:`gnuplot`,plt:`gnuplot`,gnuplot:`gnuplot`,go:`go`,graphql:`graphql`,gql:`graphql`,groovy:`groovy`,gvy:`groovy`,hack:`hack`,haml:`haml`,hbs:`handlebars`,handlebars:`handlebars`,hs:`haskell`,lhs:`haskell`,hx:`haxe`,hcl:`hcl`,hjson:`hjson`,hlsl:`hlsl`,fx:`hlsl`,html:`html`,htm:`html`,http:`http`,rest:`http`,hxml:`hxml`,hy:`hy`,imba:`imba`,ini:`ini`,cfg:`ini`,jade:`pug`,pug:`pug`,java:`java`,js:`javascript`,mjs:`javascript`,cjs:`javascript`,jinja:`jinja`,jinja2:`jinja`,j2:`jinja`,jison:`jison`,jl:`julia`,json:`json`,json5:`json5`,jsonc:`jsonc`,jsonl:`jsonl`,jsonnet:`jsonnet`,libsonnet:`jsonnet`,jssm:`jssm`,jsx:`jsx`,kt:`kotlin`,kts:`kts`,kql:`kusto`,tex:`tex`,ltx:`tex`,lean:`lean4`,less:`less`,liquid:`liquid`,lit:`lit`,ll:`llvm`,logo:`logo`,lua:`lua`,luau:`luau`,Makefile:`makefile`,mk:`makefile`,makefile:`makefile`,md:`markdown`,markdown:`markdown`,marko:`marko`,m:`wolfram`,mat:`matlab`,mdc:`mdc`,mdx:`mdx`,wiki:`wikitext`,mediawiki:`wikitext`,mmd:`mermaid`,mermaid:`mermaid`,mips:`mipsasm`,mojo:`mojo`,"🔥":`mojo`,move:`move`,nar:`narrat`,nf:`nextflow`,nim:`nim`,nims:`nim`,nimble:`nim`,nix:`nix`,nu:`nushell`,mm:`objective-cpp`,ml:`ocaml`,mli:`ocaml`,mll:`ocaml`,mly:`ocaml`,pas:`pascal`,p:`pascal`,pl:`prolog`,pm:`perl`,t:`perl`,raku:`raku`,p6:`raku`,pl6:`raku`,php:`php`,phtml:`php`,pls:`plsql`,sql:`sql`,po:`po`,polar:`polar`,pcss:`postcss`,pot:`pot`,potx:`potx`,pq:`powerquery`,pqm:`powerquery`,ps1:`powershell`,psm1:`powershell`,psd1:`powershell`,prisma:`prisma`,pro:`prolog`,P:`prolog`,properties:`properties`,proto:`protobuf`,pp:`puppet`,purs:`purescript`,py:`python`,pyw:`python`,pyi:`python`,qml:`qml`,qmldir:`qmldir`,qss:`qss`,r:`r`,R:`r`,rkt:`racket`,rktl:`racket`,razor:`razor`,cshtml:`razor`,rb:`ruby`,rbw:`ruby`,reg:`reg`,regex:`regexp`,rel:`rel`,rs:`rust`,rst:`rst`,rake:`ruby`,gemspec:`ruby`,jbuilder:`ruby`,builder:`ruby`,rabl:`ruby`,arb:`ruby`,ru:`ruby`,podspec:`ruby`,Gemfile:`ruby`,Rakefile:`ruby`,Guardfile:`ruby`,Capfile:`ruby`,Berksfile:`ruby`,Brewfile:`ruby`,Vagrantfile:`ruby`,Thorfile:`ruby`,Appraisals:`ruby`,Dangerfile:`ruby`,sas:`sas`,sass:`sass`,scala:`scala`,sc:`scala`,scm:`scheme`,ss:`scheme`,sld:`scheme`,scss:`scss`,sdbl:`sdbl`,shadergraph:`shader`,st:`smalltalk`,sol:`solidity`,sparql:`sparql`,rq:`sparql`,spl:`splunk`,config:`ssh-config`,do:`stata`,ado:`stata`,dta:`stata`,styl:`stylus`,stylus:`stylus`,svelte:`svelte`,swift:`swift`,sv:`system-verilog`,svh:`system-verilog`,service:`systemd`,socket:`systemd`,device:`systemd`,timer:`systemd`,talon:`talonscript`,tasl:`tasl`,tcl:`tcl`,templ:`templ`,tf:`tf`,tfvars:`tfvars`,toml:`toml`,ts:`typescript`,mts:`typescript`,cts:`typescript`,tsp:`typespec`,tsv:`tsv`,tsx:`tsx`,ttl:`turtle`,twig:`twig`,typ:`typst`,vv:`v`,vala:`vala`,vapi:`vala`,vb:`vb`,vbs:`vb`,bas:`vb`,vh:`verilog`,vhd:`vhdl`,vhdl:`vhdl`,vim:`vimscript`,vue:`vue`,"vine.ts":`vue-vine`,vy:`vyper`,wasm:`wasm`,wat:`wasm`,wy:`文言`,wgsl:`wgsl`,wit:`wit`,wl:`wolfram`,nb:`wolfram`,xml:`xml`,xsl:`xsl`,xslt:`xsl`,yaml:`yaml`,yml:`yml`,zs:`zenscript`,zig:`zig`,zsh:`zsh`,sty:`tex`};function Sn(e){if(bn.has(e))return bn.get(e)??`text`;if(xn[e]!=null)return xn[e];let t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(bn.has(t[1]))return bn.get(t[1])??`text`;if(xn[t[1]]!=null)return xn[t[1]]??`text`}let n=e.match(/\.([^.]+)$/)?.[1]??``;return bn.has(n)?bn.get(n)??`text`:xn[n]??`text`}function V(e){return{type:`text`,value:e}}function H({tagName:e,children:t=[],properties:n={}}){return{type:`element`,tagName:e,properties:n,children:t}}function Cn({name:e,width:t=16,height:n=16,properties:r}){return H({tagName:`svg`,properties:{width:t,height:n,viewBox:`0 0 16 16`,...r},children:[H({tagName:`use`,properties:{href:`#${e.replace(/^#/,``)}`}})]})}function wn(e){let t=e.children[0];for(;t!=null;){if(t.type===`element`&&t.tagName===`code`)return t;t=`children`in t?t.children[0]:null}}function Tn(e){return H({tagName:`div`,properties:{"data-gutter":``},children:e})}function En(e,t,n,r={}){return H({tagName:`div`,properties:{"data-line-type":e,"data-column-number":t,"data-line-index":n,...r},children:t==null?void 0:[H({tagName:`span`,properties:{"data-line-number-content":``},children:[V(`${t}`)]})]})}function U(e,t,n){return H({tagName:`div`,properties:{"data-gutter-buffer":t,"data-buffer-size":n,"data-line-type":t===`annotation`?void 0:e,style:t===`annotation`?`grid-row: span ${n};`:`grid-row: span ${n};min-height:calc(${n} * 1lh);`}})}function Dn(e,t,n){let r=typeof n.lineInfo==`function`?n.lineInfo(t):n.lineInfo[t-1];if(r==null){let r=`processLine: line ${t}, contains no state.lineInfo`;throw console.error(r,{node:e,line:t,state:n}),Error(r)}return e.tagName=`div`,e.properties[`data-line`]=r.lineNumber,e.properties[`data-alt-line`]=r.altLineNumber,e.properties[`data-line-type`]=r.type,e.properties[`data-line-index`]=r.lineIndex,e.children.length===0&&e.children.push(V(`
|
|
1
|
+
import{n as e,r as t}from"./rolldown-runtime-hePW80VL.js";import{t as n}from"./react-CwJFpaho.js";import{t as r}from"./jsx-runtime-NZYk81nU.js";import{t as i}from"./utils-Brtgag-m.js";import{c as a,f as o,l as s,n as c,o as l,r as u}from"./ease-CMumuPlX.js";import{n as d,t as f}from"./use-reduced-motion-BOcG709U.js";import{t as p}from"./createLucideIcon-_dfI7Arx.js";import{i as m,n as h,r as g,t as _}from"./tool-result-B_yb2JoE.js";import{a as v,i as y,o as b,r as x,s as S}from"./citations-DXqV2NLy.js";import{t as C}from"./check-B3LlvM65.js";import{t as w}from"./chevron-down-DUUprRP5.js";import{t as T}from"./chevron-right-NVqQIoiO.js";import{n as E,t as D}from"./safe-external-url-BbAom7Bm.js";import{n as O,t as k}from"./file-text-TmalmYrb.js";import{n as A,t as j}from"./loader-circle-B5GIZGxd.js";import{a as M,n as ee,r as te,t as ne}from"./agent-disclosure-CMrxF7L-.js";import{a as re,i as ie,n as ae,r as oe,t as se}from"./ipython-tool-CkHaO3PW.js";import{n as ce,r as le,t as ue}from"./sparkles-BY5MFyk6.js";import{t as de}from"./eye-CDHqtVoE.js";import{t as fe}from"./git-branch-CTq9aACS.js";import{t as pe}from"./rotate-ccw-CfGhzOv7.js";import{t as me}from"./search-BjcXAUrI.js";import{t as he}from"./terminal-BQAKkBY6.js";import{t as ge}from"./wrench-Myc12BTA.js";import{t as _e}from"./x-BGsDD848.js";import{t as N}from"./preload-helper-Czpn1I53.js";import{a as ve,i as ye,n as be,o as xe,r as Se,s as Ce}from"./dist-CZDnnosQ.js";import{i as we,r as Te}from"./workspace-path-nav-DqPbETfJ.js";import{n as Ee,r as De,t as Oe}from"./collapsible-CUxOjhDJ.js";import{n as ke,t as Ae}from"./range-BWOHiLNe.js";import{s as je}from"./surfaces-CpfsGAIA.js";var Me=p(`chevrons-down`,[[`path`,{d:`m7 6 5 5 5-5`,key:`1lc07p`}],[`path`,{d:`m7 13 5 5 5-5`,key:`1d48rs`}]]),Ne=p(`chevrons-up`,[[`path`,{d:`m17 11-5-5-5 5`,key:`e8nh98`}],[`path`,{d:`m17 18-5-5-5 5`,key:`2avn1x`}]]),Pe=p(`file-plus`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M9 15h6`,key:`cctwl0`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}]]),Fe=p(`folder-search`,[[`path`,{d:`M10.7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v4.1`,key:`1bw5m7`}],[`path`,{d:`m21 21-1.9-1.9`,key:`1g2n9r`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}]]),P=t(n(),1),F=r(),Ie=`__custom__`;function Le(e){return String.fromCharCode(65+e)}function Re(e,t,n){if(!e||e.kind===`skip`)return{selectedIds:[],customText:``,textValue:``};if(t===`text`)return{selectedIds:[],customText:``,textValue:e.text??``};let r=new Set(e.selectedIds??[]),i=e.text??``;return n&&i.trim().length>0&&r.add(Ie),{selectedIds:Array.from(r),customText:i,textValue:``}}function ze({questions:e,questionIndex:t=1,totalQuestions:n,onPreviousQuestion:r,onNextQuestion:a,submitLabel:o=`Send`,nextLabel:s=`Next`,skipLabel:c=`Skip`,allowSkip:l=!0,initialAnswer:u,onSubmit:d,onSkip:f,className:p}){let m=n??e.length,h=Math.max(1,Math.min(t,m)),g=e[h-1],_=g?.allowCustom??!1,[v,y]=(0,P.useState)(()=>Re(u,g?.kind,_).selectedIds),[b,x]=(0,P.useState)(()=>Re(u,g?.kind,_).customText),[S,C]=(0,P.useState)(()=>Re(u,g?.kind,_).textValue),w=m>1&&(!!r||!!a),T=h>1,E=h<m,D=h>=m,O=(0,P.useMemo)(()=>new Set(v),[v]),k=D?o:s,A=(0,P.useMemo)(()=>{if(g?.kind===`text`)return S.trim().length>0;let e=v.filter(e=>e!==Ie).length+ +(b.trim().length>0);if(g?.kind===`single`)return e===1;let t=g?.minSelections??1,n=g?.maxSelections;return e<t||typeof n==`number`&&e>n?!1:e>0},[g?.kind,g?.minSelections,g?.maxSelections,v,b,S]),j=e=>{y(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},M=e=>{y([e])},ee=e=>{if(x(e),g){if(g.kind===`single`){y(e.trim().length>0?[Ie]:[]);return}y(t=>{let n=t.includes(Ie);return e.trim().length>0&&!n?[...t,Ie]:e.trim().length===0&&n?t.filter(e=>e!==Ie):t})}};return g?(0,F.jsxs)(`div`,{className:i(`flex flex-col gap-2 bg-background px-3 py-2`,p),children:[(0,F.jsx)(`div`,{className:`flex items-center justify-between gap-px`,"data-total-questions":m,children:(0,F.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-foreground`,children:[(0,F.jsx)(`span`,{className:`inline-flex h-5 min-w-5 items-center justify-center rounded px-1 text-sm font-medium text-muted-foreground`,children:h}),(0,F.jsx)(`span`,{children:g.title})]})}),g.kind!==`text`&&(g.options?.length??0)>0&&(0,F.jsxs)(`div`,{className:`flex flex-col gap-px`,children:[g.options.map((e,t)=>{let n=e.id??e.value??e.label,r=O.has(n);return(0,F.jsxs)(`button`,{type:`button`,onClick:()=>{g.kind===`single`?(M(n),_&&x(``)):j(n)},className:`-mx-2 flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left hover:bg-secondary`,children:[(0,F.jsx)(`span`,{className:i(`inline-flex h-5 min-w-5 items-center justify-center rounded border px-1 text-sm font-medium`,r?`border-primary bg-primary text-primary-foreground`:`border-border bg-transparent text-muted-foreground`),children:Le(t)}),(0,F.jsxs)(`span`,{className:`text-sm text-foreground`,children:[e.label,e.description&&(0,F.jsxs)(`span`,{className:`text-muted-foreground`,children:[` `,e.description]})]})]},n)}),_&&(0,F.jsxs)(`div`,{className:`flex items-center gap-2 pt-1`,children:[(0,F.jsx)(`span`,{className:i(`inline-flex h-5 min-w-5 items-center justify-center rounded border px-1 text-sm font-medium`,v.includes(Ie)?`border-primary bg-primary text-primary-foreground`:`border-border bg-transparent text-muted-foreground`),children:Le(g.options.length)}),(0,F.jsx)(`input`,{value:b,onChange:e=>ee(e.target.value),placeholder:g.customPlaceholder??`Type your answer`,className:`h-7 w-full rounded-md border border-border bg-background px-2 text-base text-foreground md:text-sm`})]})]}),g.kind===`text`&&(0,F.jsx)(`textarea`,{value:S,onChange:e=>C(e.target.value),placeholder:g.placeholder??`Type your answer`,rows:3,className:`w-full resize-y rounded-md border border-border bg-background px-2 py-1.5 text-base text-foreground md:text-sm`}),(0,F.jsxs)(`div`,{className:i(`flex items-center gap-1.5`,w?`justify-between`:`justify-end`),children:[w&&(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[r&&(0,F.jsx)(`button`,{type:`button`,onClick:r,disabled:!T,className:`h-6 rounded px-2 text-sm text-muted-foreground hover:text-foreground disabled:opacity-60`,children:`Previous`}),a&&(0,F.jsx)(`button`,{type:`button`,onClick:a,disabled:!E,className:`h-6 rounded px-2 text-sm text-muted-foreground hover:text-foreground disabled:opacity-60`,children:`Next`})]}),(0,F.jsxs)(`div`,{className:`flex items-center justify-end gap-1.5`,children:[l&&(0,F.jsx)(`button`,{type:`button`,onClick:()=>{f?.(),d({kind:`skip`})},className:`h-6 rounded px-2 text-sm text-muted-foreground transition-[background-color,color,transform] duration-150 hover:bg-muted/50 hover:text-foreground active:scale-[0.98]`,children:c}),(0,F.jsx)(`button`,{type:`button`,onClick:()=>{if(!A||!g)return;if(g.kind===`text`){d({kind:`text`,questionId:g.id,text:S.trim()});return}let e=v.filter(e=>e!==Ie),t=b.trim()||void 0;d({kind:g.kind,questionId:g.id,selectedIds:e,text:t||void 0})},disabled:!A,className:`h-6 rounded bg-primary px-2.5 text-sm font-medium text-primary-foreground transition-[background-color,transform] duration-150 hover:bg-primary/90 active:scale-[0.98] disabled:opacity-60 disabled:hover:bg-primary disabled:active:scale-100`,children:k})]})]})]}):null}function Be(e){if(e.kind===`skip`)return`Skipped`;if(e.kind===`text`)return e.text||`Answered`;let t=e.selectedIds?.length?e.selectedIds.join(`, `):``;return e.text?t?`${t} (${e.text})`:e.text:t||`Answered`}function Ve({part:e}){let[t,n]=(0,P.useState)(e.input?.questionIndex??1),r=e.input?.questions??[],i=e.input?.totalQuestions??r.length,a=typeof e.input?.questionIndex==`number`,o=a?e.input?.questionIndex??1:r.length>0?t:e.input?.questionIndex??1,s=Math.max(1,Math.min(o,i)),c=r[s-1],[l,u]=(0,P.useState)({}),[d,f]=(0,P.useState)(e.input?.questionIndex);e.input?.questionIndex!==d&&(f(e.input?.questionIndex),typeof e.input?.questionIndex==`number`&&n(e.input.questionIndex));let[p,m]=(0,P.useState)(e.toolCallId);e.toolCallId!==p&&(m(e.toolCallId),u({}),n(e.input?.questionIndex??1));let h=e.output?.answer,g=Object.keys(l).length,_=i===1?!!h||g>=1:i>0&&g>=i,y=i>1&&!_,b=s>1,x=s<i,S=(0,P.useMemo)(()=>!_||i<=1?[]:Array.from({length:i},(e,t)=>({index:t+1,answer:l[t+1]})),[_,l,i]),C=(0,P.useMemo)(()=>_?S.length>0?S.map(e=>`${e.index}: ${e.answer?Be(e.answer):`Pending`}`).join(` • `):h?Be(h):l[s]?Be(l[s]):`Pending`:``,[_,S,h,l,s]);if(!c)return null;let T=()=>{b&&(e.input?.onPreviousQuestion?.(),a||n(e=>Math.max(1,e-1)))},D=()=>{x&&(e.input?.onNextQuestion?.(),a||n(e=>Math.min(i,e+1)))};return(0,F.jsxs)(`div`,{className:`overflow-hidden rounded-chat-tool border border-border bg-muted`,children:[(0,F.jsxs)(`div`,{className:`flex h-7 items-center justify-between border-b border-border px-3 text-xs text-muted-foreground`,children:[(0,F.jsxs)(`div`,{className:`inline-flex items-center gap-1.5`,children:[(0,F.jsx)(v,{className:`size-3.5`}),`Question`]}),y&&(0,F.jsxs)(`div`,{className:`inline-flex items-center gap-1`,children:[(0,F.jsx)(`button`,{type:`button`,onClick:T,disabled:!b,className:`inline-flex size-5 items-center justify-center rounded-[4px] hover:bg-secondary disabled:opacity-40`,"aria-label":`Previous question`,children:(0,F.jsx)(E,{className:`size-3.5`})}),(0,F.jsxs)(`span`,{children:[s,` of `,i]}),(0,F.jsx)(`button`,{type:`button`,onClick:D,disabled:!x,className:`inline-flex size-5 items-center justify-center rounded-[4px] hover:bg-secondary disabled:opacity-40`,"aria-label":`Next question`,children:(0,F.jsx)(w,{className:`size-3.5`})})]})]}),_?(0,F.jsx)(`div`,{className:`bg-background px-3 py-2 text-xs text-muted-foreground`,children:C}):(0,F.jsx)(ze,{questions:r,questionIndex:s,totalQuestions:i,initialAnswer:l[s],submitLabel:e.input?.submitLabel,nextLabel:e.input?.nextLabel,skipLabel:e.input?.skipLabel,allowSkip:e.input?.allowSkip,onSubmit:t=>{u(e=>({...e,[s]:t})),e.input?.onSubmitAnswer?.(t),s<i&&D()}},`${s}-${c.title}`)]})}function He(e){return e.split(`|`).map(e=>e.trim().split(/\s+/)[0]??``).filter(Boolean).slice(0,4).join(`, `)}function Ue({step:e,state:t,onComplete:n,approval:r}){re(t===`animating`,e.duration,n);let i=t===`animating`,a=e.bashCommand??e.toolDetail,o=He(a);return(0,F.jsxs)(`div`,{className:`overflow-hidden rounded-chat-tool border border-border bg-muted`,children:[(0,F.jsxs)(`div`,{className:`flex h-7 items-center justify-between pr-2 pl-2.5`,children:[(0,F.jsx)(`div`,{className:`flex min-w-0 items-center gap-1.5 overflow-hidden`,children:i?(0,F.jsxs)(oe,{as:`span`,duration:1.2,className:`m-0 inline-flex h-full items-center truncate text-xs leading-none`,children:[`Running command: `,o]}):(0,F.jsxs)(`span`,{className:`truncate text-xs text-muted-foreground`,children:[`Ran command: `,o]})}),i&&(0,F.jsx)(`svg`,{className:`h-3 w-3 shrink-0 animate-spin text-muted-foreground`,viewBox:`0 0 16 16`,fill:`none`,children:(0,F.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6`,stroke:`currentColor`,strokeWidth:`1.5`,strokeDasharray:`28`,strokeDashoffset:`7`,strokeLinecap:`round`})})]}),(0,F.jsxs)(`div`,{className:`overflow-hidden border-t border-border bg-background px-2.5 py-1.5 font-mono text-label leading-[16px]`,children:[(0,F.jsxs)(`div`,{className:`break-all`,children:[(0,F.jsx)(`span`,{className:`text-amber-600 select-none dark:text-amber-400`,children:`$ `}),(0,F.jsx)(`span`,{className:`text-foreground`,children:a})]}),!i&&e.bashOutput&&(0,F.jsx)(`div`,{className:`mt-1 max-h-[80px] overflow-hidden whitespace-pre-line text-muted-foreground`,children:e.bashOutput})]}),r&&(0,F.jsx)(ie,{isPending:i,...r})]})}var We=(0,P.memo)(function({part:e}){let t=e.input?.approval??e.args?.approval,{step:n,stepState:r}=ae(e,`Bash`);return(0,F.jsx)(Ue,{step:n,state:r,onComplete:()=>{},approval:t})});function Ge(e){let t=(0,P.useRef)(e);return(0,P.useInsertionEffect)(()=>void(t.current=e)),(0,P.useCallback)((...e)=>t.current(...e),[])}var Ke=(0,P.createContext)(void 0);function qe(){return(0,P.useContext)(Ke)}var Je={position:`absolute`,top:0,bottom:0,textAlign:`center`,whiteSpace:`normal`,touchAction:`none`},Ye={display:`contents`};function Xe(){return null}var Ze=`diffs-container`,Qe=/(?=^diff --git)/gm,$e=/(?<=\n)/,et=/^(---|\+\+\+)\s+([^\t\r\n]+)/,tt=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,nt=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,rt=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,it=`header-prefix`,at=`header-filename-suffix`,ot=`header-metadata`,st=`header-custom`,I={dark:`pierre-dark`,light:`pierre-light`},ct=`data-theme-css`,lt=`data-unsafe-css`,ut=`data-diffs-scrollbar-measure`,dt=`--diffs-scrollbar-gutter-measured`,ft=1e5,pt={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8};({...pt});var mt=Object.freeze({fromStart:0,fromEnd:0}),ht={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},gt={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0};function _t(e){return`annotation-${`side`in e?`${e.side}-`:``}${e.lineNumber}`}function vt({hunkIndex:e,lineIndex:t,conflictIndex:n}){return`merge-conflict-action-${e}-${t}-${n}`}function L(e,t){return e-(t===0?0:1)}function R(e,t){return L(e,t)+t}function yt(e,t){let n=t.hunks[e.hunkIndex];if(n!=null)return{hunkIndex:e.hunkIndex,lineIndex:bt(n,e.startContentIndex)}}function bt(e,t){let n=e.unifiedLineStart;for(let r=0;r<t;r++){let t=e.hunkContent[r];n+=t.type===`context`?t.lines:t.deletions+t.additions}return n}function xt({fileDiff:e,actions:t,renderCustomHeader:n,renderHeaderPrefix:r,renderHeaderFilenameSuffix:i,renderHeaderMetadata:a,renderAnnotation:o,renderGutterUtility:s,renderMergeConflictUtility:c,lineAnnotations:l,getHoveredLine:u,getInstance:d}){let f=n?.(e),p=r?.(e),m=i?.(e),h=a?.(e);return(0,F.jsxs)(F.Fragment,{children:[f==null?(0,F.jsxs)(F.Fragment,{children:[p!=null&&(0,F.jsx)(`div`,{slot:`header-prefix`,children:p}),m!=null&&(0,F.jsx)(`div`,{slot:`header-filename-suffix`,children:m}),h!=null&&(0,F.jsx)(`div`,{slot:`header-metadata`,children:h})]}):(0,F.jsx)(`div`,{slot:st,children:f}),o!=null&&l?.map((e,t)=>(0,F.jsx)(`div`,{slot:_t(e),children:o(e)},t)),t!=null&&c!=null&&d!=null&&t.map(t=>{if(t==null)return;let n=St(t,e);return(0,F.jsx)(`div`,{slot:n,style:Ye,children:c(t,d)},n)}),s!=null&&(0,F.jsx)(`div`,{slot:`gutter-utility-slot`,style:Je,children:s(u)})]})}function St(e,t){let n=yt(e,t);return n==null?void 0:vt({hunkIndex:n.hunkIndex,lineIndex:n.lineIndex,conflictIndex:e.conflictIndex})}function Ct(e,t){return e==null||t==null||typeof e==`string`||typeof t==`string`?e===t:e.dark===t.dark&&e.light===t.light}function wt(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}var Tt=new Set;function Et(e){let t=[],n=new Set;for(let r of Dt(e.themes)){let e=At(r)?r.getThemes():[r];for(let r of e){if(n.has(r.name))throw Error(`Theme collection already contains theme "${r.name}"`);n.add(r.name),t.push(r)}}let r=Object.freeze([...t]),i=Object.freeze(r.filter(e=>e.colorScheme===`light`)),a=Object.freeze(r.filter(e=>e.colorScheme===`dark`)),o=new Map(r.map(e=>[e.name,e])),s=Object.freeze(r.map(e=>e.name)),c=Object.freeze(i.map(e=>e.name)),l=Object.freeze(a.map(e=>e.name));function u(e){if(e==null)return r;let{colorScheme:t,collection:n}=e;return n==null?t===`light`?i:t===`dark`?a:r:r.filter(e=>e.collection===n?t==null||e.colorScheme===t:!1)}return{getTheme(e){return o.get(e)},getThemes(e){return u(e)},getThemeNames(e){return e?.collection==null?e?.colorScheme===`light`?c:e?.colorScheme===`dark`?l:s:u(e).map(e=>e.name)},hasTheme(e){return o.has(e)},orderBy(e){return Et({themes:r.map((e,t)=>({descriptor:e,index:t})).sort((t,n)=>{let r=e(t.descriptor,n.descriptor);return r===0?t.index-n.index:r}).map(e=>e.descriptor)})},pick(e){let t=[],n=new Set;for(let r of e){if(n.has(r))throw Error(`Theme collection pick already includes theme "${r}"`);n.add(r);let e=o.get(r);if(e==null)throw Error(`Theme collection does not contain theme "${r}"`);t.push(e)}return Et({themes:t})},registerInto(e){for(let t of r)e.registerThemeIfAbsent(t.name,t.load)}}}function Dt(e){return Ot(e)?[e]:e}function Ot(e){return At(e)||kt(e)}function kt(e){return typeof e.name==`string`&&typeof e.load==`function`}function At(e){return typeof e.getThemes==`function`}function jt(e){return typeof e==`object`&&e&&`default`in e?e.default:e}var Mt=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name=`DuplicateThemeError`}},Nt=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name=`UnregisteredThemeError`}},Pt=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name=`UnresolvedThemeError`}};function Ft(){let e=new Map,t=new Map,n=new Map,r=0;function i(t,n){if(e.has(t))throw new Mt(t);e.set(t,n)}function a(t,n){return!e.has(t)&&(e.set(t,n),!0)}function o(t){return e.has(t)}function s(i){let a=t.get(i);if(a!==void 0)return Promise.resolve(a);let o=n.get(i);if(o!==void 0)return o;let s=e.get(i);if(s===void 0)return Promise.reject(new Nt(i));let c=r,l=s().then(e=>{let a=jt(e);return c===r&&t.set(i,a),n.get(i)===l&&n.delete(i),a}).catch(e=>{throw n.get(i)===l&&n.delete(i),e});return n.set(i,l),l}function c(e){return Promise.all(e.map(e=>s(e)))}function l(e,n){t.set(e,n)}function u(e){for(let[t,n]of e)l(t,n)}function d(e){return t.get(e)}function f(e){let n=[];for(let r of e){let e=t.get(r);if(e===void 0)throw new Pt(r);n.push(e)}return n}function p(e){return t.has(e)}function m(e){for(let n of e)if(!t.has(n))return!1;return!0}function h(e){let n=t.get(e);return n===void 0?s(e):n}function g(){r++,t.clear(),n.clear()}return{clearResolvedThemes:g,getResolvedOrResolveTheme:h,getResolvedTheme:d,getResolvedThemes:f,hasRegisteredTheme:o,hasResolvedTheme:p,hasResolvedThemes:m,registerTheme:i,registerThemeIfAbsent:a,resolveTheme:s,resolveThemes:c,seedResolvedTheme:l,seedResolvedThemes:u}}var z=Ft();function It(e,t){e=Array.isArray(e)?e:[e];for(let n of e){let e;if(typeof n==`string`){if(e=z.getResolvedTheme(n),e==null)throw Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else e=n,n=n.name,z.getResolvedTheme(n)??z.seedResolvedTheme(n,e);Tt.has(n)||(Tt.add(n),t.loadThemeSync(e))}}var Lt=new Map,Rt=new Map,zt=new Map,Bt=new Set;function Vt(e,t){e=Array.isArray(e)?e:[e];for(let n of e){if(Bt.has(n.name))continue;let e=Lt.get(n.name);e??(e=n,Lt.set(n.name,e)),Bt.add(e.name),t.loadLanguageSync(e.data)}}function Ht(){return typeof WorkerGlobalScope<`u`&&typeof self<`u`&&self instanceof WorkerGlobalScope}async function Ut(e){if(Ht())throw Error(`resolveLanguage("${e}") cannot be called from a worker context. Languages must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);let t=Rt.get(e);if(t!=null)return t;try{let t=zt.get(e);if(t==null&&Object.prototype.hasOwnProperty.call(Ce,e)&&(t=Ce[e]),t==null)throw Error(`resolveLanguage: "${e}" not found in bundled or custom languages`);let n=t().then(({default:t})=>{let n={name:e,data:t};return Lt.has(e)||Lt.set(e,n),n});return Rt.set(e,n),await n}finally{Rt.delete(e)}}function Wt(e){return Lt.get(e)??Ut(e)}function Gt({name:e,load:t,colorScheme:n,collection:r,displayName:i}){return{name:e,colorScheme:n,collection:r,displayName:i,load:Kt(t)}}function Kt(e){return async()=>ve(jt(await e()))}var qt=`pierre`,Jt=[`pierre-dark`,`pierre-dark-soft`,`pierre-dark-vibrant`,`pierre-dark-protanopia-deuteranopia`,`pierre-dark-tritanopia`],Yt=[`pierre-light`,`pierre-light-soft`,`pierre-light-vibrant`,`pierre-light-protanopia-deuteranopia`,`pierre-light-tritanopia`],Xt=[...Yt,...Jt],Zt=new Set(Yt);function Qt(e){return Zt.has(e)?`light`:`dark`}var $t={"pierre-dark":`Pierre Dark`,"pierre-dark-soft":`Pierre Dark Soft`,"pierre-dark-vibrant":`Pierre Dark Vibrant`,"pierre-dark-protanopia-deuteranopia":`Pierre Dark Protanopia & Deuteranopia`,"pierre-dark-tritanopia":`Pierre Dark Tritanopia`,"pierre-light":`Pierre Light`,"pierre-light-soft":`Pierre Light Soft`,"pierre-light-vibrant":`Pierre Light Vibrant`,"pierre-light-protanopia-deuteranopia":`Pierre Light Protanopia & Deuteranopia`,"pierre-light-tritanopia":`Pierre Light Tritanopia`},en={"pierre-dark":()=>N(()=>import(`./pierre-dark-CpLgRqie.js`),[]),"pierre-dark-soft":()=>N(()=>import(`./pierre-dark-soft-kZQmAZld.js`),[]),"pierre-dark-vibrant":()=>N(()=>import(`./pierre-dark-vibrant-CpQYzh95.js`),[]),"pierre-dark-protanopia-deuteranopia":()=>N(()=>import(`./pierre-dark-protanopia-deuteranopia-B35FxJx-.js`),[]),"pierre-dark-tritanopia":()=>N(()=>import(`./pierre-dark-tritanopia-CpjhbsIL.js`),[]),"pierre-light":()=>N(()=>import(`./pierre-light-CoaEpmwp.js`),[]),"pierre-light-soft":()=>N(()=>import(`./pierre-light-soft-lWLdNTOI.js`),[]),"pierre-light-vibrant":()=>N(()=>import(`./pierre-light-vibrant-D80Fkn33.js`),[]),"pierre-light-protanopia-deuteranopia":()=>N(()=>import(`./pierre-light-protanopia-deuteranopia-0fSaH845.js`),[]),"pierre-light-tritanopia":()=>N(()=>import(`./pierre-light-tritanopia-CEbqgOJL.js`),[])};function tn(e){return Gt({name:e,collection:qt,colorScheme:Qt(e),displayName:$t[e],load:en[e]})}var nn=Et({themes:Xt.map(e=>tn(e))}),rn=`shiki`,an=[`ayu-light`,`catppuccin-latte`,`everforest-light`,`github-light`,`github-light-default`,`github-light-high-contrast`,`gruvbox-light-hard`,`gruvbox-light-medium`,`gruvbox-light-soft`,`horizon-bright`,`kanagawa-lotus`,`light-plus`,`material-theme-lighter`,`min-light`,`night-owl-light`,`one-light`,`rose-pine-dawn`,`slack-ochin`,`snazzy-light`,`solarized-light`,`vitesse-light`],on=`andromeeda.aurora-x.ayu-dark.ayu-mirage.catppuccin-frappe.catppuccin-macchiato.catppuccin-mocha.dark-plus.dracula.dracula-soft.everforest-dark.github-dark.github-dark-default.github-dark-dimmed.github-dark-high-contrast.gruvbox-dark-hard.gruvbox-dark-medium.gruvbox-dark-soft.horizon.houston.kanagawa-dragon.kanagawa-wave.laserwave.material-theme.material-theme-darker.material-theme-ocean.material-theme-palenight.min-dark.monokai.night-owl.nord.one-dark-pro.plastic.poimandres.red.rose-pine.rose-pine-moon.slack-dark.solarized-dark.synthwave-84.tokyo-night.vesper.vitesse-black.vitesse-dark`.split(`.`),sn=new Set(an);function cn(e){return sn.has(e)?`light`:`dark`}var ln={andromeeda:()=>N(()=>import(`./andromeeda-vGVdxbeo.js`),[]),"aurora-x":()=>N(()=>import(`./aurora-x-CDeNXAV0.js`),[]),"ayu-dark":()=>N(()=>import(`./ayu-dark-DluEY0Gj.js`),[]),"ayu-light":()=>N(()=>import(`./ayu-light-C3h-C4tm.js`),[]),"ayu-mirage":()=>N(()=>import(`./ayu-mirage-Bqwy1Gya.js`),[]),"catppuccin-frappe":()=>N(()=>import(`./catppuccin-frappe-C9Q5zVZY.js`),[]),"catppuccin-latte":()=>N(()=>import(`./catppuccin-latte-CtsyrtPq.js`),[]),"catppuccin-macchiato":()=>N(()=>import(`./catppuccin-macchiato-R8nAf1vR.js`),[]),"catppuccin-mocha":()=>N(()=>import(`./catppuccin-mocha-DjuaAJKi.js`),[]),"dark-plus":()=>N(()=>import(`./dark-plus-Cs2F2srj.js`),[]),dracula:()=>N(()=>import(`./dracula-BHWKrbxM.js`),[]),"dracula-soft":()=>N(()=>import(`./dracula-soft-5eyTD99u.js`),[]),"everforest-dark":()=>N(()=>import(`./everforest-dark-sB-x3p7T.js`),[]),"everforest-light":()=>N(()=>import(`./everforest-light-Df2xbC6M.js`),[]),"github-dark":()=>N(()=>import(`./github-dark-C-LZuMrd.js`),[]),"github-dark-default":()=>N(()=>import(`./github-dark-default-DXG-b-1a.js`),[]),"github-dark-dimmed":()=>N(()=>import(`./github-dark-dimmed-Bx1FflLF.js`),[]),"github-dark-high-contrast":()=>N(()=>import(`./github-dark-high-contrast-B_tTalzw.js`),[]),"github-light":()=>N(()=>import(`./github-light-EUqPIrTm.js`),[]),"github-light-default":()=>N(()=>import(`./github-light-default-BXViO-2h.js`),[]),"github-light-high-contrast":()=>N(()=>import(`./github-light-high-contrast-B68TUdTA.js`),[]),"gruvbox-dark-hard":()=>N(()=>import(`./gruvbox-dark-hard-C820rvS2.js`),[]),"gruvbox-dark-medium":()=>N(()=>import(`./gruvbox-dark-medium-BPjhmG05.js`),[]),"gruvbox-dark-soft":()=>N(()=>import(`./gruvbox-dark-soft-MrdJrrXF.js`),[]),"gruvbox-light-hard":()=>N(()=>import(`./gruvbox-light-hard-BC_s9l72.js`),[]),"gruvbox-light-medium":()=>N(()=>import(`./gruvbox-light-medium-BAWPOn9u.js`),[]),"gruvbox-light-soft":()=>N(()=>import(`./gruvbox-light-soft-BSMLrYjP.js`),[]),horizon:()=>N(()=>import(`./horizon-CE9ld1lL.js`),[]),"horizon-bright":()=>N(()=>import(`./horizon-bright-DSNQnXHK.js`),[]),houston:()=>N(()=>import(`./houston-CsvMBhTu.js`),[]),"kanagawa-dragon":()=>N(()=>import(`./kanagawa-dragon-Bozd7klA.js`),[]),"kanagawa-lotus":()=>N(()=>import(`./kanagawa-lotus-BmuOG9ZW.js`),[]),"kanagawa-wave":()=>N(()=>import(`./kanagawa-wave-BML5mF2J.js`),[]),laserwave:()=>N(()=>import(`./laserwave-C_8bwKvT.js`),[]),"light-plus":()=>N(()=>import(`./light-plus-DVQuIRkW.js`),[]),"material-theme":()=>N(()=>import(`./material-theme-Bm3Qr25_.js`),[]),"material-theme-darker":()=>N(()=>import(`./material-theme-darker-2IIEA8gg.js`),[]),"material-theme-lighter":()=>N(()=>import(`./material-theme-lighter-uhdI0v04.js`),[]),"material-theme-ocean":()=>N(()=>import(`./material-theme-ocean-CHQ94UKr.js`),[]),"material-theme-palenight":()=>N(()=>import(`./material-theme-palenight-B5W6OYN7.js`),[]),"min-dark":()=>N(()=>import(`./min-dark-BSWPekZh.js`),[]),"min-light":()=>N(()=>import(`./min-light-DDpmG2fV.js`),[]),monokai:()=>N(()=>import(`./monokai-B_bV9PQ9.js`),[]),"night-owl":()=>N(()=>import(`./night-owl-DhmEMT88.js`),[]),"night-owl-light":()=>N(()=>import(`./night-owl-light-eJ-hLW7d.js`),[]),nord:()=>N(()=>import(`./nord-Cb4Vim4T.js`),[]),"one-dark-pro":()=>N(()=>import(`./one-dark-pro-CLwyXe_n.js`),[]),"one-light":()=>N(()=>import(`./one-light-D7Lr4KcI.js`),[]),plastic:()=>N(()=>import(`./plastic-DQwYfKfQ.js`),[]),poimandres:()=>N(()=>import(`./poimandres-DRFjx7u4.js`),[]),red:()=>N(()=>import(`./red-DX1BQOs8.js`),[]),"rose-pine":()=>N(()=>import(`./rose-pine-aMsaMD1D.js`),[]),"rose-pine-dawn":()=>N(()=>import(`./rose-pine-dawn-8PwUyIlP.js`),[]),"rose-pine-moon":()=>N(()=>import(`./rose-pine-moon-DO-qXg-I.js`),[]),"slack-dark":()=>N(()=>import(`./slack-dark-DnToyrRv.js`),[]),"slack-ochin":()=>N(()=>import(`./slack-ochin-B2OO5cIa.js`),[]),"snazzy-light":()=>N(()=>import(`./snazzy-light-4G7pJPwS.js`),[]),"solarized-dark":()=>N(()=>import(`./solarized-dark-UdsmMDCL.js`),[]),"solarized-light":()=>N(()=>import(`./solarized-light-C1IUL_tW.js`),[]),"synthwave-84":()=>N(()=>import(`./synthwave-84-nFMaYfgc.js`),[]),"tokyo-night":()=>N(()=>import(`./tokyo-night-oM2G3aXe.js`),[]),vesper:()=>N(()=>import(`./vesper-DdrHHSXu.js`),[]),"vitesse-black":()=>N(()=>import(`./vitesse-black-fwtXNY1n.js`),[]),"vitesse-dark":()=>N(()=>import(`./vitesse-dark-BZCL-v6S.js`),[]),"vitesse-light":()=>N(()=>import(`./vitesse-light-VbXTXTou.js`),[])};function un(e){return Gt({name:e,collection:rn,colorScheme:cn(e),load:ln[e]})}var dn=Et({themes:Object.freeze([...an.map(e=>un(e)),...on.map(e=>un(e))])});function fn(e){if(Ht())throw Error(`Theme "${e}" cannot be resolved from a worker context. Themes must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);if(z.hasRegisteredTheme(e))return;let t=dn.getTheme(e);if(t!=null){z.registerThemeIfAbsent(t.name,t.load);return}throw Error(`No valid theme loader registered for "${e}"`)}function pn(e,t){if(t.name!==e)throw Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${t.name}`)}async function mn(e){fn(e);let t=await z.resolveTheme(e);return pn(e,t),t}function hn(e){return z.getResolvedTheme(e)??mn(e)}var B;async function gn({themes:e,langs:t,preferredHighlighter:n=`shiki-js`}){B??=Se({themes:[],langs:[`text`],engine:n===`shiki-wasm`?xe(N(()=>import(`./wasm-BnjxR4X6.js`),[])):be()});let r=vn(B)?await B:B;B=r;let i=[];for(let e of t){if(e===`text`||e===`ansi`)continue;let t=Wt(e);`then`in t?i.push(t):Vt(t,r)}let a=[];for(let t of e){let e=hn(t);`then`in e?a.push(e):It(e,B)}return(i.length>0||a.length>0)&&await Promise.all([Promise.all(i).then(e=>{Vt(e,r)}),Promise.all(a).then(e=>{It(e,r)})]),r}function _n(){if(B!=null&&!(`then`in B))return B}function vn(e=B){return e!=null&&`then`in e}for(let e of nn.getThemes())z.registerThemeIfAbsent(e.name,e.load);function yn(e=I){let t=[];return typeof e==`string`?t.push(e):(t.push(e.dark),t.push(e.light)),t}var bn=new Map,xn={"1c":`1c`,abap:`abap`,as:`actionscript-3`,ada:`ada`,adb:`ada`,ads:`ada`,adoc:`asciidoc`,asciidoc:`asciidoc`,"component.html":`angular-html`,"component.ts":`angular-ts`,conf:`nginx`,htaccess:`apache`,cls:`tex`,trigger:`apex`,apl:`apl`,applescript:`applescript`,scpt:`applescript`,ara:`ara`,asm:`asm`,s:`riscv`,astro:`astro`,awk:`awk`,bal:`ballerina`,sh:`zsh`,bash:`zsh`,bat:`cmd`,cmd:`cmd`,be:`berry`,beancount:`beancount`,bib:`bibtex`,bicep:`bicep`,"blade.php":`blade`,bsl:`bsl`,c:`c`,h:`objective-cpp`,cs:`csharp`,cpp:`cpp`,hpp:`cpp`,cc:`cpp`,cxx:`cpp`,hh:`cpp`,cdc:`cdc`,cairo:`cairo`,clar:`clarity`,clj:`clojure`,cljs:`clojure`,cljc:`clojure`,soy:`soy`,cmake:`cmake`,"CMakeLists.txt":`cmake`,cob:`cobol`,cbl:`cobol`,cobol:`cobol`,CODEOWNERS:`codeowners`,ql:`ql`,coffee:`coffeescript`,lisp:`lisp`,cl:`lisp`,lsp:`lisp`,log:`log`,v:`verilog`,cql:`cql`,cr:`crystal`,css:`css`,csv:`csv`,cue:`cue`,cypher:`cypher`,cyp:`cypher`,d:`d`,dart:`dart`,dax:`dax`,desktop:`desktop`,diff:`diff`,patch:`diff`,Dockerfile:`dockerfile`,dockerfile:`dockerfile`,env:`dotenv`,dm:`dream-maker`,edge:`edge`,el:`emacs-lisp`,ex:`elixir`,exs:`elixir`,elm:`elm`,erb:`erb`,erl:`erlang`,hrl:`erlang`,f:`fortran-fixed-form`,for:`fortran-fixed-form`,fs:`fsharp`,fsi:`fsharp`,fsx:`fsharp`,f03:`f03`,f08:`f08`,f18:`f18`,f77:`f77`,f90:`fortran-free-form`,f95:`fortran-free-form`,fnl:`fennel`,fish:`fish`,ftl:`ftl`,tres:`gdresource`,res:`gdresource`,gd:`gdscript`,gdshader:`gdshader`,gs:`genie`,feature:`gherkin`,COMMIT_EDITMSG:`git-commit`,"git-rebase-todo":`git-rebase`,gjs:`glimmer-js`,gleam:`gleam`,gts:`glimmer-ts`,glsl:`glsl`,vert:`glsl`,frag:`glsl`,shader:`shaderlab`,gp:`gnuplot`,plt:`gnuplot`,gnuplot:`gnuplot`,go:`go`,graphql:`graphql`,gql:`graphql`,groovy:`groovy`,gvy:`groovy`,hack:`hack`,haml:`haml`,hbs:`handlebars`,handlebars:`handlebars`,hs:`haskell`,lhs:`haskell`,hx:`haxe`,hcl:`hcl`,hjson:`hjson`,hlsl:`hlsl`,fx:`hlsl`,html:`html`,htm:`html`,http:`http`,rest:`http`,hxml:`hxml`,hy:`hy`,imba:`imba`,ini:`ini`,cfg:`ini`,jade:`pug`,pug:`pug`,java:`java`,js:`javascript`,mjs:`javascript`,cjs:`javascript`,jinja:`jinja`,jinja2:`jinja`,j2:`jinja`,jison:`jison`,jl:`julia`,json:`json`,json5:`json5`,jsonc:`jsonc`,jsonl:`jsonl`,jsonnet:`jsonnet`,libsonnet:`jsonnet`,jssm:`jssm`,jsx:`jsx`,kt:`kotlin`,kts:`kts`,kql:`kusto`,tex:`tex`,ltx:`tex`,lean:`lean4`,less:`less`,liquid:`liquid`,lit:`lit`,ll:`llvm`,logo:`logo`,lua:`lua`,luau:`luau`,Makefile:`makefile`,mk:`makefile`,makefile:`makefile`,md:`markdown`,markdown:`markdown`,marko:`marko`,m:`wolfram`,mat:`matlab`,mdc:`mdc`,mdx:`mdx`,wiki:`wikitext`,mediawiki:`wikitext`,mmd:`mermaid`,mermaid:`mermaid`,mips:`mipsasm`,mojo:`mojo`,"🔥":`mojo`,move:`move`,nar:`narrat`,nf:`nextflow`,nim:`nim`,nims:`nim`,nimble:`nim`,nix:`nix`,nu:`nushell`,mm:`objective-cpp`,ml:`ocaml`,mli:`ocaml`,mll:`ocaml`,mly:`ocaml`,pas:`pascal`,p:`pascal`,pl:`prolog`,pm:`perl`,t:`perl`,raku:`raku`,p6:`raku`,pl6:`raku`,php:`php`,phtml:`php`,pls:`plsql`,sql:`sql`,po:`po`,polar:`polar`,pcss:`postcss`,pot:`pot`,potx:`potx`,pq:`powerquery`,pqm:`powerquery`,ps1:`powershell`,psm1:`powershell`,psd1:`powershell`,prisma:`prisma`,pro:`prolog`,P:`prolog`,properties:`properties`,proto:`protobuf`,pp:`puppet`,purs:`purescript`,py:`python`,pyw:`python`,pyi:`python`,qml:`qml`,qmldir:`qmldir`,qss:`qss`,r:`r`,R:`r`,rkt:`racket`,rktl:`racket`,razor:`razor`,cshtml:`razor`,rb:`ruby`,rbw:`ruby`,reg:`reg`,regex:`regexp`,rel:`rel`,rs:`rust`,rst:`rst`,rake:`ruby`,gemspec:`ruby`,jbuilder:`ruby`,builder:`ruby`,rabl:`ruby`,arb:`ruby`,ru:`ruby`,podspec:`ruby`,Gemfile:`ruby`,Rakefile:`ruby`,Guardfile:`ruby`,Capfile:`ruby`,Berksfile:`ruby`,Brewfile:`ruby`,Vagrantfile:`ruby`,Thorfile:`ruby`,Appraisals:`ruby`,Dangerfile:`ruby`,sas:`sas`,sass:`sass`,scala:`scala`,sc:`scala`,scm:`scheme`,ss:`scheme`,sld:`scheme`,scss:`scss`,sdbl:`sdbl`,shadergraph:`shader`,st:`smalltalk`,sol:`solidity`,sparql:`sparql`,rq:`sparql`,spl:`splunk`,config:`ssh-config`,do:`stata`,ado:`stata`,dta:`stata`,styl:`stylus`,stylus:`stylus`,svelte:`svelte`,swift:`swift`,sv:`system-verilog`,svh:`system-verilog`,service:`systemd`,socket:`systemd`,device:`systemd`,timer:`systemd`,talon:`talonscript`,tasl:`tasl`,tcl:`tcl`,templ:`templ`,tf:`tf`,tfvars:`tfvars`,toml:`toml`,ts:`typescript`,mts:`typescript`,cts:`typescript`,tsp:`typespec`,tsv:`tsv`,tsx:`tsx`,ttl:`turtle`,twig:`twig`,typ:`typst`,vv:`v`,vala:`vala`,vapi:`vala`,vb:`vb`,vbs:`vb`,bas:`vb`,vh:`verilog`,vhd:`vhdl`,vhdl:`vhdl`,vim:`vimscript`,vue:`vue`,"vine.ts":`vue-vine`,vy:`vyper`,wasm:`wasm`,wat:`wasm`,wy:`文言`,wgsl:`wgsl`,wit:`wit`,wl:`wolfram`,nb:`wolfram`,xml:`xml`,xsl:`xsl`,xslt:`xsl`,yaml:`yaml`,yml:`yml`,zs:`zenscript`,zig:`zig`,zsh:`zsh`,sty:`tex`};function Sn(e){if(bn.has(e))return bn.get(e)??`text`;if(xn[e]!=null)return xn[e];let t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(bn.has(t[1]))return bn.get(t[1])??`text`;if(xn[t[1]]!=null)return xn[t[1]]??`text`}let n=e.match(/\.([^.]+)$/)?.[1]??``;return bn.has(n)?bn.get(n)??`text`:xn[n]??`text`}function V(e){return{type:`text`,value:e}}function H({tagName:e,children:t=[],properties:n={}}){return{type:`element`,tagName:e,properties:n,children:t}}function Cn({name:e,width:t=16,height:n=16,properties:r}){return H({tagName:`svg`,properties:{width:t,height:n,viewBox:`0 0 16 16`,...r},children:[H({tagName:`use`,properties:{href:`#${e.replace(/^#/,``)}`}})]})}function wn(e){let t=e.children[0];for(;t!=null;){if(t.type===`element`&&t.tagName===`code`)return t;t=`children`in t?t.children[0]:null}}function Tn(e){return H({tagName:`div`,properties:{"data-gutter":``},children:e})}function En(e,t,n,r={}){return H({tagName:`div`,properties:{"data-line-type":e,"data-column-number":t,"data-line-index":n,...r},children:t==null?void 0:[H({tagName:`span`,properties:{"data-line-number-content":``},children:[V(`${t}`)]})]})}function U(e,t,n){return H({tagName:`div`,properties:{"data-gutter-buffer":t,"data-buffer-size":n,"data-line-type":t===`annotation`?void 0:e,style:t===`annotation`?`grid-row: span ${n};`:`grid-row: span ${n};min-height:calc(${n} * 1lh);`}})}function Dn(e,t,n){let r=typeof n.lineInfo==`function`?n.lineInfo(t):n.lineInfo[t-1];if(r==null){let r=`processLine: line ${t}, contains no state.lineInfo`;throw console.error(r,{node:e,line:t,state:n}),Error(r)}return e.tagName=`div`,e.properties[`data-line`]=r.lineNumber,e.properties[`data-alt-line`]=r.altLineNumber,e.properties[`data-line-type`]=r.type,e.properties[`data-line-index`]=r.lineIndex,e.children.length===0&&e.children.push(V(`
|
|
2
2
|
`)),e}var On=Symbol(`no-token`),kn=Symbol(`multiple-tokens`);function An(e){let t=jn(e);if(t!=null)return t;let n=On,r=[],i=[],a,o=()=>{if(i.length===0||a==null){i=[],a=void 0;return}if(i.length===1){let e=i[0];if(e?.type===`element`){Nn(e,a);for(let t of e.children)Mn(t)}else Mn(e);r.push(e),i=[],a=void 0;return}for(let e of i)Mn(e);r.push(H({tagName:`span`,properties:{"data-char":a},children:i})),i=[],a=void 0},s=e=>{if(e!==On){if(e===kn){n=kn;return}if(n===On){n=e;return}n!==e&&(n=kn)}};for(let t of e.children){let e=t.type===`element`?An(t):On;if(s(e),typeof e!=`number`){o(),r.push(t);continue}a!=null&&a!==e&&o(),a??=e,i.push(t)}return o(),e.children=r,n}function jn(e){let t=e.properties[`data-char`];if(typeof t==`number`)return t}function Mn(e){if(e.type===`element`){e.properties[`data-char`]=void 0;for(let t of e.children)Mn(t)}}function Nn(e,t){e.properties[`data-char`]=t}function Pn(e={}){let{classPrefix:t=`__shiki_`,classSuffix:n=``,classReplacer:r=e=>e}=e,i=new Map;function a(e){return Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}function o(e){let o=typeof e==`string`?e:a(e),s=t+Fn(o)+n;return s=r(s),i.has(s)||i.set(s,typeof e==`string`?e:{...e}),s}return{name:`@shikijs/transformers:style-to-class`,pre(e){if(!e.properties.style)return;let t=o(e.properties.style);delete e.properties.style,this.addClassToHast(e,t)},tokens(e){for(let t of e)for(let e of t){if(!e.htmlStyle)continue;let t=o(e.htmlStyle);e.htmlStyle={},e.htmlAttrs||={},e.htmlAttrs.class?e.htmlAttrs.class+=` ${t}`:e.htmlAttrs.class=t}},getClassRegistry(){return i},getCSS(){let e=``;for(let[t,n]of i.entries())e+=`.${t}{${typeof n==`string`?n:a(n)}}`;return e},clearRegistry(){i.clear()}}}function Fn(e,t=0){let n=3735928559^t,r=1103547991^t;for(let t=0,i;t<e.length;t++)i=e.charCodeAt(t),n=Math.imul(n^i,2654435761),r=Math.imul(r^i,1597334677);return n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(n^n>>>13,3266489909),(4294967296*(2097151&r)+(n>>>0)).toString(36).slice(0,6)}function In(e=!1,t=!1){let n={lineInfo:[]},r=[{line(e){return delete e.properties.class,e},pre(t){let r=wn(t),i=[];if(r!=null){let t=1;for(let a of r.children)a.type===`element`&&(e&&An(a),i.push(Dn(a,t,n)),t++);r.children=i}return t},...e?{tokens(e){for(let t of e){let e=0;for(let n of t){let t=n;t.__lineChar??=e,e+=n.content.length}}},preprocess(e,t){t.mergeWhitespaces=`never`},span(e,t,n,r,i){if(i?.offset!=null&&i.content!=null){let t=i.__lineChar;return t!=null&&(e.properties[`data-char`]=t),e}return e}}:null}];return t&&r.push(Rn,Ln),e&&r.push({line:e=>(e.type===`element`&&e.children.length===0&&e.children.push({type:`element`,tagName:`br`,properties:{},children:[]}),e)}),{state:n,transformers:r,toClass:Ln}}var Ln=Pn({classPrefix:`hl-`}),Rn={name:`token-style-normalizer`,tokens(e){for(let t of e)for(let e of t){if(e.htmlStyle!=null)continue;let t={};e.color!=null&&(t.color=e.color),e.bgColor!=null&&(t[`background-color`]=e.bgColor),e.fontStyle!=null&&e.fontStyle!==0&&(e.fontStyle&1&&(t[`font-style`]=`italic`),e.fontStyle&2&&(t[`font-weight`]=`bold`),e.fontStyle&4&&(t[`text-decoration`]=`underline`)),Object.keys(t).length>0&&(e.htmlStyle=t)}}};function W(e){return`--${e===`token`?`diffs-token`:`diffs`}-`}var zn=/^#(?:[0-9a-f]{3}0|[0-9a-f]{6}00)$/i,Bn=/^0(?:\.0+)?%?$/;function Vn(e){let t=e.indexOf(`(`);if(t<=0||!e.endsWith(`)`))return;let n=e.slice(0,t).trim();if(!/^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)$/i.test(n))return;let r=e.slice(t+1,-1).trim();if(r.length===0)return;let i=r.lastIndexOf(`/`);if(i!==-1)return r.slice(i+1).trim();if(/^(?:rgba|hsla)$/i.test(n)){let e=r.split(`,`);if(e.length===4)return e[3]?.trim()}}function Hn(e){let t=/^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})\b/i.exec(e.trim());if(t==null)return null;let n=t[1],r,i=1;return n.length===3?r=n.split(``).map(e=>e+e).join(``):n.length===6?r=n:(r=n.slice(0,6),i=parseInt(n.slice(6,8),16)/255),[parseInt(r.slice(0,2),16),parseInt(r.slice(2,4),16),parseInt(r.slice(4,6),16),i]}function Un(e){if(e==null)return null;let t=Hn(e);if(t==null)return null;let n=t[0]/255,r=t[1]/255,i=t[2]/255,a=e=>e<=.03928?e/12.92:((e+.055)/1.055)**2.4;return .2126*a(n)+.7152*a(r)+.0722*a(i)}function Wn(e){if(e==null)return!1;let t=e.trim().toLowerCase();if(t===`transparent`||zn.test(t))return!0;let n=Vn(t);return n!=null&&Bn.test(n)}function Gn(e,t,n){if(t==null||n==null)return!1;let r=Un(e),i=Un(t),a=Un(n);return r==null||i==null||a==null?!1:Math.abs(r-a)<Math.abs(r-i)}var Kn=new WeakMap;function qn(e){let t=Kn.get(e);if(t!=null)return t;let n=e.colors??{},r={...n},i=n[`editor.background`]??e.bg,a=n[`editor.foreground`]??e.fg,o=n[`sideBar.background`]??i,s=n[`sideBar.foreground`]??a;G(r,`editor.background`,i),G(r,`editor.foreground`,a),G(r,`sideBar.background`,o),G(r,`sideBar.foreground`,s),G(r,`input.background`,n[`input.background`]??o),G(r,`sideBarSectionHeader.foreground`,n[`sideBarSectionHeader.foreground`]??s),G(r,`list.activeSelectionForeground`,n[`list.activeSelectionForeground`]??s),G(r,`gitDecoration.addedResourceForeground`,Jn(n[`gitDecoration.addedResourceForeground`],n[`terminal.ansiGreen`],n[`editorGutter.addedBackground`])),G(r,`gitDecoration.modifiedResourceForeground`,Jn(n[`gitDecoration.modifiedResourceForeground`],n[`terminal.ansiBlue`],n[`editorGutter.modifiedBackground`])),G(r,`gitDecoration.deletedResourceForeground`,Jn(n[`gitDecoration.deletedResourceForeground`],n[`terminal.ansiRed`],n[`editorGutter.deletedBackground`]));let c=(Wn(n[`list.focusOutline`])?void 0:n[`list.focusOutline`])??(Wn(n.focusBorder)?void 0:n.focusBorder);c==null?delete r[`list.focusOutline`]:r[`list.focusOutline`]=c;let l=n[`list.hoverBackground`];l!=null&&(Yn(l,o)||Gn(l,o,s))&&delete r[`list.hoverBackground`];let u=Object.freeze({...e,colors:Object.freeze(r)});return Kn.set(e,u),u}function G(e,t,n){n!=null&&n!==``&&(e[t]=n)}function Jn(...e){for(let t of e)if(t!=null&&t!==``)return t}function Yn(e,t){return t!=null&&e.toLowerCase()===t.toLowerCase()}function Xn({theme:e=I,highlighter:t,prefix:n}){let r=``;if(typeof e==`string`){let i=t.getTheme(e),a=qn(i);r+=`color:${a.fg};`,r+=`background-color:${a.bg};`,r+=`${W(`global`)}fg:${a.fg};`,r+=`${W(`global`)}bg:${a.bg};`,r+=Zn(i,n)}else{let n=t.getTheme(e.dark),i=qn(n);r+=`${W(`global`)}dark:${i.fg};`,r+=`${W(`global`)}dark-bg:${i.bg};`,r+=Zn(n,`dark`),n=t.getTheme(e.light),i=qn(n),r+=`${W(`global`)}light:${i.fg};`,r+=`${W(`global`)}light-bg:${i.bg};`,r+=Zn(n,`light`)}return r}function Zn(e,t){t=t==null?``:`${t}-`;let n=``,r=e.colors?.[`gitDecoration.addedResourceForeground`]??e.colors?.[`terminal.ansiGreen`];r!=null&&(n+=`${W(`global`)}${t}addition-color:${r};`);let i=e.colors?.[`gitDecoration.deletedResourceForeground`]??e.colors?.[`terminal.ansiRed`];i!=null&&(n+=`${W(`global`)}${t}deletion-color:${i};`);let a=e.colors?.[`gitDecoration.modifiedResourceForeground`]??e.colors?.[`terminal.ansiBlue`];return a!=null&&(n+=`${W(`global`)}${t}modified-color:${a};`),n}function Qn(e){let t=e.children[0];for(;t!=null;){if(t.type===`element`&&t.tagName===`code`)return t.children;t=`children`in t?t.children[0]:null}throw console.error(e),Error(`getLineNodes: Unable to find children`)}function $n(e,t){return e===t||e?.cacheKey!=null&&e.cacheKey===t?.cacheKey}function er(e,t){return Ct(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength&&e.lineDiffType===t.lineDiffType&&e.maxLineDiffLength===t.maxLineDiffLength}function tr(e){let t=e.lang??Sn(e.name),n=e.lang??(e.prevName==null?`text`:Sn(e.prevName));return t===`text`&&n===`text`}function K(e){let t=e.length;return e.charCodeAt(t-1)===10&&(t--,e.charCodeAt(t-1)===13&&t--),e.slice(0,t)}function nr(e){return{...pt,...e}}function rr(e,t){let n=ir(e,t);return t?n:e.diffHeaderHeight+n}function ir(e,t){return e.paddingTop??(t?e.spacing:0)}function ar(e){return e.paddingBottom??e.spacing}function or(e){switch(e){case`simple`:return 4;case`metadata`:case`line-info`:case`line-info-basic`:case`custom`:return 32}}function sr(e){return[L(e.additionStart,e.additionCount)+1,R(e.additionStart,e.additionCount)+1]}function q({isPartial:e,rangeSize:t,expandedHunks:n,hunkIndex:r,collapsedContextThreshold:i}){let a=Math.max(t,0);if(a===0||e)return{fromStart:0,fromEnd:0,rangeSize:a,collapsedLines:a,renderAll:!1};if(n===!0||a<=i)return{fromStart:a,fromEnd:0,rangeSize:a,collapsedLines:0,renderAll:!0};let o=n?.get(r),s=Math.min(Math.max(o?.fromStart??0,0),a),c=Math.min(Math.max(o?.fromEnd??0,0),a),l=s+c,u=l>=a;return{fromStart:u?a:s,fromEnd:u?0:c,rangeSize:a,collapsedLines:Math.max(a-l,0),renderAll:u}}function cr(e){let t=e.hunks[e.hunks.length-1];if(t==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return!1;let n=e.additionLines.length-R(t.additionStart,t.additionCount),r=e.deletionLines.length-R(t.deletionStart,t.deletionCount);return n<=0&&r<=0?!1:n!==r}function lr({fileDiff:e,errorPrefix:t}){let n=e.hunks[e.hunks.length-1];if(n==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return 0;let r=e.additionLines.length-R(n.additionStart,n.additionCount),i=e.deletionLines.length-R(n.deletionStart,n.deletionCount);if(r<=0&&i<=0)return 0;if(r!==i)throw Error(`${t}: trailing context mismatch (additions=${r}, deletions=${i}) for ${e.name}`);return Math.min(r,i)}function J({fileDiff:e,hunkIndex:t,expandedHunks:n,collapsedContextThreshold:r,errorPrefix:i}){if(t!==e.hunks.length-1)return;let a=lr({fileDiff:e,errorPrefix:i});if(a<=0)return;if(n===!0||a<=r)return{fromStart:a,fromEnd:0,rangeSize:a,collapsedLines:0,renderAll:!0};let o=n?.get(e.hunks.length),s=Math.min(Math.max(o?.fromStart??0,0),a);return{fromStart:s,fromEnd:0,rangeSize:a,collapsedLines:a-s,renderAll:s>=a}}function ur({fileDiff:e,lineNumber:t,expandedHunks:n,collapsedContextThreshold:r}){if(n===!0||e.isPartial)return!0;for(let[i,a]of e.hunks.entries()){let[o,s]=sr(a);if(t<o){let s=q({isPartial:e.isPartial,rangeSize:a.collapsedBefore,expandedHunks:n,hunkIndex:i,collapsedContextThreshold:r}),c=o-s.rangeSize;return s.renderAll||t<c+s.fromStart||t>=o-s.fromEnd}if(t<s)return!0}let i=J({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:n,collapsedContextThreshold:r,errorPrefix:`isAdditionLineRenderable`});if(i==null||i.renderAll)return!0;let a=e.hunks[e.hunks.length-1],[,o]=sr(a);return t<o+i.fromStart||t>=o+i.rangeSize}function dr({fileDiff:e,lineNumber:t,direction:n,expandedHunks:r,collapsedContextThreshold:i}){if(r===!0||e.isPartial)return t;let a=[],o=1;for(let[t,n]of e.hunks.entries()){let[s,c]=sr(n),l=q({isPartial:e.isPartial,rangeSize:n.collapsedBefore,expandedHunks:r,hunkIndex:t,collapsedContextThreshold:i}),u=s-l.rangeSize;l.renderAll?a.push([u,s]):(l.fromStart>0&&a.push([u,u+l.fromStart]),l.fromEnd>0&&a.push([s-l.fromEnd,s])),a.push([s,c]),o=c}let s=J({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:r,collapsedContextThreshold:i,errorPrefix:`getNearestRenderableAdditionLine`});if(s!=null){let e=o;o=e+s.rangeSize,s.renderAll?a.push([e,o]):s.fromStart>0&&a.push([e,e+s.fromStart])}if(t>=o)return t;if(n===`down`){for(let[e,n]of a)if(n>t)return Math.max(e,t);return}for(let e=a.length-1;e>=0;e--){let[n,r]=a[e];if(n<=t)return Math.min(r-1,t)}}function fr({type:e,metrics:t}){return t.hunkSeparatorHeight??or(e)}function pr({type:e,metrics:t}){return e===`simple`||e===`metadata`||e===`line-info-basic`?0:t.spacing}function mr({type:e,hunkIndex:t,hunkSpecs:n}){switch(e){case`simple`:return t>0;case`metadata`:return n!=null;case`line-info`:case`line-info-basic`:case`custom`:return!0}}function hr(e){return e!==`simple`&&e!==`metadata`}function gr({type:e,metrics:t,hunkIndex:n,hunkSpecs:r}){if(!mr({type:e,hunkIndex:n,hunkSpecs:r}))return;let i=fr({type:e,metrics:t}),a=pr({type:e,metrics:t}),o=n>0?a:0,s=a;return{height:i,gapBefore:o,gapAfter:s,totalHeight:o+i+s}}function _r({type:e,metrics:t}){if(!hr(e))return;let n=fr({type:e,metrics:t}),r=pr({type:e,metrics:t});return{height:n,gapBefore:r,gapAfter:0,totalHeight:r+n}}function vr({diff:e,diffStyle:t,startingLine:n=0,totalLines:r=1/0,expandedHunks:i,collapsedContextThreshold:a=1,callback:o}){let s=yr({diff:e,diffStyle:t,startingLine:n,expandedHunks:i,collapsedContextThreshold:a}),c={viewportStart:n,viewportEnd:n+r,isWindowedHighlight:n>0||r<1/0,splitCount:s.splitCount,unifiedCount:s.unifiedCount,finalHunkIndex:e.hunks.length-1,shouldBreak(){if(!c.isWindowedHighlight)return!1;let e=c.unifiedCount>=n+r,i=c.splitCount>=n+r;return t===`unified`?e:(t===`split`||e)&&i},shouldSkip(e,r){if(!c.isWindowedHighlight)return!1;let i=e>0&&c.unifiedCount+e<=n,a=r>0&&c.splitCount+r<=n;return t===`unified`?i:(t===`split`||i)&&a},incrementCounts(e,n){(t===`unified`||t===`both`)&&(c.unifiedCount+=e),(t===`split`||t===`both`)&&(c.splitCount+=n)},isInWindow(e,n){if(!c.isWindowedHighlight)return!0;let r=c.isInUnifiedWindow(e),i=c.isInSplitWindow(n);return t===`unified`?r:t===`split`?i:r||i},isInUnifiedWindow(e){return!c.isWindowedHighlight||c.unifiedCount>=n-e&&c.unifiedCount<n+r},isInSplitWindow(e){return!c.isWindowedHighlight||c.splitCount>=n-e&&c.splitCount<n+r},emit(e,n=!1){return n||(t===`unified`?c.incrementCounts(1,0):t===`split`?c.incrementCounts(0,1):c.incrementCounts(1,1)),o(e)??!1}};hunkIterator:for(let n=s.hunkIndex;n<e.hunks.length;n++){let r=e.hunks[n];if(r==null)throw Error(`iterateOverDiff: invalid hunk index`);if(c.shouldBreak())break;let o=L(r.deletionStart,r.deletionCount),s=L(r.additionStart,r.additionCount),l=!e.isPartial&&r.deletionCount===0?o:r.deletionLineIndex,u=!e.isPartial&&r.additionCount===0?s:r.additionLineIndex,d=q({isPartial:e.isPartial,rangeSize:r.collapsedBefore,expandedHunks:i,hunkIndex:n,collapsedContextThreshold:a}),f=n===c.finalHunkIndex?J({fileDiff:e,hunkIndex:n,expandedHunks:i,collapsedContextThreshold:a,errorPrefix:`iterateOverDiff`}):void 0,p=d.fromStart+d.fromEnd;function m(e,n){return f==null||f.collapsedLines<=0||f.fromStart+f.fromEnd>0?0:t===`unified`?e===r.unifiedLineStart+r.unifiedLineCount-1?f.collapsedLines:0:n===r.splitLineStart+r.splitLineCount-1?f.collapsedLines:0}let h=d.collapsedLines===0;function g(){return h?0:(h=!0,d.collapsedLines)}if(c.shouldSkip(p,p))c.incrementCounts(p,p),g();else{let e=r.unifiedLineStart-d.rangeSize,i=r.splitLineStart-d.rangeSize,a=l-d.rangeSize,f=u-d.rangeSize,p=o+1-d.rangeSize,m=s+1-d.rangeSize;if(Sr(c,d.fromStart,t,t=>c.emit({hunkIndex:n,hunk:r,collapsedBefore:0,collapsedAfter:0,type:`context-expanded`,deletionLine:{lineNumber:p+t,lineIndex:a+t,noEOFCR:!1,unifiedLineIndex:e+t,splitLineIndex:i+t},additionLine:{unifiedLineIndex:e+t,splitLineIndex:i+t,lineIndex:f+t,lineNumber:m+t,noEOFCR:!1}}))||(e=r.unifiedLineStart-d.fromEnd,i=r.splitLineStart-d.fromEnd,a=l-d.fromEnd,f=u-d.fromEnd,p=o+1-d.fromEnd,m=s+1-d.fromEnd,Sr(c,d.fromEnd,t,t=>c.emit({hunkIndex:n,hunk:r,collapsedBefore:g(),collapsedAfter:0,type:`context-expanded`,deletionLine:{lineNumber:p+t,lineIndex:a+t,noEOFCR:!1,unifiedLineIndex:e+t,splitLineIndex:i+t},additionLine:{unifiedLineIndex:e+t,splitLineIndex:i+t,lineIndex:f+t,lineNumber:m+t,noEOFCR:!1}}),()=>{g()})))break hunkIterator}let _=r.unifiedLineStart,v=r.splitLineStart,y=l,b=u,x=o+1,S=s+1,C=r.hunkContent.at(-1);for(let e of r.hunkContent){if(c.shouldBreak())break hunkIterator;let i=e===C;if(e.type===`context`){if(c.shouldSkip(e.lines,e.lines))c.incrementCounts(e.lines,e.lines),g();else if(Sr(c,e.lines,t,t=>{let a=i&&t===e.lines-1,o=_+t,s=v+t;return c.emit({hunkIndex:n,hunk:r,collapsedBefore:g(),collapsedAfter:m(o,s),type:`context`,deletionLine:{lineNumber:x+t,lineIndex:y+t,noEOFCR:a&&r.noEOFCRDeletions,unifiedLineIndex:o,splitLineIndex:s},additionLine:{unifiedLineIndex:o,splitLineIndex:s,lineIndex:b+t,lineNumber:S+t,noEOFCR:a&&r.noEOFCRAdditions}})},()=>{g()}))break hunkIterator;_+=e.lines,v+=e.lines,y+=e.lines,b+=e.lines,x+=e.lines,S+=e.lines}else{let a=Math.max(e.deletions,e.additions),o=e.deletions+e.additions;if(!c.shouldSkip(o,a)){let s=Cr(c,e,t);(s[0]?.[0]??0)>0&&g();for(let[l,u]of s)for(let s=l;s<u;s++){let l=m(_+s,t===`unified`?v+(s<e.deletions?s:s-e.deletions):v+s);if(c.emit(wr({hunkIndex:n,hunk:r,collapsedBefore:g(),collapsedAfter:l,diffStyle:t,index:s,unifiedLineIndex:_,splitLineIndex:v,additionLineIndex:b,deletionLineIndex:y,additionLineNumber:S,deletionLineNumber:x,content:e,isLastContent:i,unifiedCount:o,splitCount:a}),!0))break hunkIterator}}g(),c.incrementCounts(o,a),_+=o,v+=a,y+=e.deletions,b+=e.additions,x+=e.deletions,S+=e.additions}}if(f!=null){let{collapsedLines:n,fromStart:r,fromEnd:i}=f,a=r+i;if(Sr(c,a,t,t=>{let r=t===a-1;return c.emit({hunkIndex:e.hunks.length,hunk:void 0,collapsedBefore:0,collapsedAfter:r?n:0,type:`context-expanded`,deletionLine:{lineNumber:x+t,lineIndex:y+t,noEOFCR:!1,unifiedLineIndex:_+t,splitLineIndex:v+t},additionLine:{unifiedLineIndex:_+t,splitLineIndex:v+t,lineIndex:b+t,lineNumber:S+t,noEOFCR:!1}})},void 0,()=>c.shouldBreak()))break hunkIterator}}}function yr({diff:e,diffStyle:t,startingLine:n,expandedHunks:r,collapsedContextThreshold:i}){if(n<=0||t===`both`)return{hunkIndex:0,splitCount:0,unifiedCount:0};let a=br({diff:e,expandedHunks:r,collapsedContextThreshold:i}),o=0,s=e.hunks.length-1,c=e.hunks.length;for(;o<=s;){let e=o+s>>1,r=a[e+1];if(r==null)throw Error(`iterateOverDiff: invalid hunk prefix index`);(t===`unified`?r.unifiedCount:r.splitCount)>n?(c=e,s=e-1):o=e+1}if(c>=e.hunks.length){let t=a[e.hunks.length];if(t==null)throw Error(`iterateOverDiff: invalid terminal hunk prefix index`);return{hunkIndex:e.hunks.length,splitCount:t.splitCount,unifiedCount:t.unifiedCount}}let l=a[c];if(l==null)throw Error(`iterateOverDiff: invalid selected hunk prefix index`);return{hunkIndex:c,splitCount:l.splitCount,unifiedCount:l.unifiedCount}}function br({diff:e,expandedHunks:t,collapsedContextThreshold:n}){let r=0,i=0,a=e.hunks.length-1,o=[{splitCount:0,unifiedCount:0}];for(let s=0;s<e.hunks.length;s++){let c=e.hunks[s];if(c==null)throw Error(`iterateOverDiff: invalid hunk summary index`);let l=q({isPartial:e.isPartial,rangeSize:c.collapsedBefore,expandedHunks:t,hunkIndex:s,collapsedContextThreshold:n}),u=l.fromStart+l.fromEnd;r+=u+c.splitLineCount,i+=u+c.unifiedLineCount;let d=s===a?J({fileDiff:e,hunkIndex:s,expandedHunks:t,collapsedContextThreshold:n,errorPrefix:`iterateOverDiff`}):void 0;if(d!=null){let e=d.fromStart+d.fromEnd;r+=e,i+=e}o.push({splitCount:r,unifiedCount:i})}return o}function xr(e,t,n){if(!e.isWindowedHighlight||t<=0)return[0,t];let r=[];function i(n){let i=Math.max(0,e.viewportStart-n),a=Math.min(t,e.viewportEnd-n);a>i&&r.push([i,a])}if(n!==`split`&&i(e.unifiedCount),n!==`unified`&&i(e.splitCount),r.length===0)return[0,0];let a=r[0][0],o=r[0][1];for(let e=1;e<r.length;e++){let t=r[e];a=Math.min(a,t[0]),o=Math.max(o,t[1])}return[a,o]}function Sr(e,t,n,r,i,a){let[o,s]=xr(e,t,n);o>0&&(e.incrementCounts(o,o),i?.());let c=o;for(;c<t;){if(a?.()===!0)return!0;if(c>=s){e.incrementCounts(t-c,t-c);break}if(e.isInWindow(0,0)){if(r(c)===!0)return!0}else e.incrementCounts(1,1);c++}return!1}function Cr(e,t,n){if(!e.isWindowedHighlight)return[[0,n===`unified`?t.deletions+t.additions:Math.max(t.deletions,t.additions)]];let r=n!==`split`,i=n!==`unified`,a=n===`unified`?`unified`:`split`,o=[];function s(t,n){if(t+n<=e.viewportStart||t>=e.viewportEnd)return;let r=Math.max(0,e.viewportStart-t),i=Math.min(n,e.viewportEnd-t);return i>r?[r,i]:void 0}function c(e,n){return a===`split`?e:n===`additions`?[e[0]+t.deletions,e[1]+t.deletions]:e}function l(e,t){if(e==null)return;let[n,r]=c(e,t);r>n&&o.push([n,r])}if(r&&(l(s(e.unifiedCount,t.deletions),`deletions`),l(s(e.unifiedCount+t.deletions,t.additions),`additions`)),i&&(l(s(e.splitCount,t.deletions),`deletions`),l(s(e.splitCount,t.additions),`additions`)),o.length===0)return o;o.sort((e,t)=>e[0]-t[0]);let u=[o[0]];for(let[e,t]of o.slice(1)){let n=u[u.length-1];e<=n[1]?n[1]=Math.max(n[1],t):u.push([e,t])}return u}function wr({hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,diffStyle:i,index:a,unifiedLineIndex:o,splitLineIndex:s,additionLineIndex:c,deletionLineIndex:l,additionLineNumber:u,deletionLineNumber:d,content:f,isLastContent:p,unifiedCount:m,splitCount:h}){let g=a<f.deletions?o+a:void 0,_=i===`unified`?a>=f.deletions?o+a:void 0:a<f.additions?o+f.deletions+a:void 0,v=i===`unified`?s+(a<f.deletions?a:a-f.deletions):s+a,y=a<f.deletions?l+a:void 0,b=a<f.deletions?d+a:void 0,x=i===`unified`?a>=f.deletions?c+(a-f.deletions):void 0:a<f.additions?c+a:void 0,S=i===`unified`?a>=f.deletions?u+(a-f.deletions):void 0:a<f.additions?u+a:void 0,C=i===`unified`?p&&a===f.deletions-1&&t.noEOFCRDeletions:p&&a===h-1&&t.noEOFCRDeletions,w=i===`unified`?p&&a===m-1&&t.noEOFCRAdditions:p&&a===h-1&&t.noEOFCRAdditions,T=y!=null&&b!=null&&g!=null?{lineNumber:b,lineIndex:y,noEOFCR:C,unifiedLineIndex:g,splitLineIndex:v}:void 0,E=x!=null&&S!=null&&_!=null?{unifiedLineIndex:_,splitLineIndex:v,lineIndex:x,lineNumber:S,noEOFCR:w}:void 0;if(T==null&&E!=null)return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:void 0,additionLine:E};if(T!=null&&E==null)return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:T,additionLine:void 0};if(T==null||E==null)throw Error(`iterateOverDiff: missing change line data`);return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:T,additionLine:E}}var Y=class{diff(e,t,n={}){let r;typeof n==`function`?(r=n,n={}):`callback`in n&&(r=n.callback);let i=this.castInput(e,n),a=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),s=this.removeEmpty(this.tokenize(a,n));return this.diffWithOptionsObj(o,s,n,r)}diffWithOptionsObj(e,t,n,r){let i=e=>{if(e=this.postProcess(e,n),r){setTimeout(function(){r(e)},0);return}return e},a=t.length,o=e.length,s=1,c=a+o;n.maxEditLength!=null&&(c=Math.min(c,n.maxEditLength));let l=n.timeout??1/0,u=Date.now()+l,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=o&&f+1>=a)return i(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,m=1/0,h=()=>{for(let r=Math.max(p,-s);r<=Math.min(m,s);r+=2){let s,c=d[r-1],l=d[r+1];c&&(d[r-1]=void 0);let u=!1;if(l){let e=l.oldPos-r;u=l&&0<=e&&e<a}let h=c&&c.oldPos+1<o;if(!u&&!h){d[r]=void 0;continue}if(s=!h||u&&c.oldPos<l.oldPos?this.addToPath(l,!0,!1,0,n):this.addToPath(c,!1,!0,1,n),f=this.extractCommon(s,t,e,r,n),s.oldPos+1>=o&&f+1>=a)return i(this.buildValues(s.lastComponent,t,e))||!0;d[r]=s,s.oldPos+1>=o&&(m=Math.min(m,r-1)),f+1>=a&&(p=Math.max(p,r+1))}s++};if(r)(function e(){setTimeout(function(){if(s>c||Date.now()>u)return r(void 0);h()||e()},0)})();else for(;s<=c&&Date.now()<=u;){let e=h();if(e)return e}}addToPath(e,t,n,r,i){let a=e.lastComponent;return a&&!i.oneChangePerToken&&a.added===t&&a.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:a.count+1,added:t,removed:n,previousComponent:a.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:a}}}extractCommon(e,t,n,r,i){let a=t.length,o=n.length,s=e.oldPos,c=s-r,l=0;for(;c+1<a&&s+1<o&&this.equals(n[s+1],t[c+1],i);)c++,s++,l++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return l&&!i.oneChangePerToken&&(e.lastComponent={count:l,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=s,c}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join(``)}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){let r=[],i;for(;e;)r.push(e),i=e.previousComponent,delete e.previousComponent,e=i;r.reverse();let a=r.length,o=0,s=0,c=0;for(;o<a;o++){let e=r[o];if(e.removed)e.value=this.join(n.slice(c,c+e.count)),c+=e.count;else{if(!e.added&&this.useLongestToken){let r=t.slice(s,s+e.count);r=r.map(function(e,t){let r=n[c+t];return r.length>e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(s,s+e.count));s+=e.count,e.added||(c+=e.count)}}return r}},Tr=new class extends Y{};function Er(e,t,n){return Tr.diff(e,t,n)}function Dr(e,t){let n;for(n=0;n<e.length&&n<t.length;n++)if(e[n]!=t[n])return e.slice(0,n);return e.slice(0,n)}function Or(e,t){let n;if(!e||!t||e[e.length-1]!=t[t.length-1])return``;for(n=0;n<e.length&&n<t.length;n++)if(e[e.length-(n+1)]!=t[t.length-(n+1)])return e.slice(-n);return e.slice(-n)}function kr(e,t,n){if(e.slice(0,t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(t)}; this is a bug`);return n+e.slice(t.length)}function Ar(e,t,n){if(!t)return e+n;if(e.slice(-t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(t)}; this is a bug`);return e.slice(0,-t.length)+n}function jr(e,t){return kr(e,t,``)}function Mr(e,t){return Ar(e,t,``)}function Nr(e,t){return t.slice(0,Pr(e,t))}function Pr(e,t){let n=0;e.length>t.length&&(n=e.length-t.length);let r=t.length;e.length<t.length&&(r=e.length);let i=Array(r),a=0;i[0]=0;for(let e=1;e<r;e++){for(t[e]==t[a]?i[e]=i[a]:i[e]=a;a>0&&t[e]!=t[a];)a=i[a];t[e]==t[a]&&a++}a=0;for(let r=n;r<e.length;r++){for(;a>0&&e[r]!=t[a];)a=i[a];e[r]==t[a]&&a++}return a}function Fr(e,t){let n=[];for(let r of Array.from(t.segment(e))){let e=r.segment;n.length&&/\s/.test(n[n.length-1])&&/\s/.test(e)?n[n.length-1]+=e:n.push(e)}return n}function Ir(e,t){if(t)return Rr(e,t)[1];let n;for(n=e.length-1;n>=0&&e[n].match(/\s/);n--);return e.substring(n+1)}function Lr(e,t){if(t)return Rr(e,t)[0];let n=e.match(/^\s*/);return n?n[0]:``}function Rr(e,t){if(!t)return[Lr(e),Ir(e)];if(t.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);let n=Fr(e,t),r=n[0],i=n[n.length-1];return[/\s/.test(r)?r:``,/\s/.test(i)?i:``]}var zr=`a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}`,Br=RegExp(`[${zr}]+|\\s+|[^${zr}]`,`ug`);new class extends Y{equals(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()}tokenize(e,t={}){let n;if(t.intlSegmenter){let r=t.intlSegmenter;if(r.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);n=Fr(e,r)}else n=e.match(Br)||[];let r=[],i=null;return n.forEach(e=>{/\s/.test(e)?i==null?r.push(e):r.push(r.pop()+e):i!=null&&/\s/.test(i)?r[r.length-1]==i?r.push(r.pop()+e):r.push(i+e):r.push(e),i=e}),r}join(e){return e.map((e,t)=>t==0?e:e.replace(/^\s+/,``)).join(``)}postProcess(e,t){if(!e||t.oneChangePerToken)return e;let n=null,r=null,i=null;return e.forEach(e=>{e.added?r=e:e.removed?i=e:((r||i)&&Vr(n,i,r,e,t.intlSegmenter),n=e,r=null,i=null)}),(r||i)&&Vr(n,i,r,null,t.intlSegmenter),e}};function Vr(e,t,n,r,i){if(t&&n){let[a,o]=Rr(t.value,i),[s,c]=Rr(n.value,i);if(e){let r=Dr(a,s);e.value=Ar(e.value,s,r),t.value=jr(t.value,r),n.value=jr(n.value,r)}if(r){let e=Or(o,c);r.value=kr(r.value,c,e),t.value=Mr(t.value,e),n.value=Mr(n.value,e)}}else if(n){if(e){let e=Lr(n.value,i);n.value=n.value.substring(e.length)}if(r){let e=Lr(r.value,i);r.value=r.value.substring(e.length)}}else if(e&&r){let n=Lr(r.value,i),[a,o]=Rr(t.value,i),s=Dr(n,a);t.value=jr(t.value,s);let c=Or(jr(n,s),o);t.value=Mr(t.value,c),r.value=kr(r.value,n,c),e.value=Ar(e.value,n,n.slice(0,n.length-c.length))}else if(r){let e=Lr(r.value,i),n=Nr(Ir(t.value,i),e);t.value=Mr(t.value,n)}else if(e){let n=Nr(Ir(e.value,i),Lr(t.value,i));t.value=jr(t.value,n)}}var Hr=new class extends Y{tokenize(e){let t=RegExp(`(\\r?\\n)|[${zr}]+|[^\\S\\n\\r]+|[^${zr}]`,`ug`);return e.match(t)||[]}};function Ur(e,t,n){return Hr.diff(e,t,n)}var Wr=new class extends Y{constructor(){super(...arguments),this.tokenize=Kr}equals(e,t,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
|
|
3
3
|
`))&&(e=e.trim()),(!n.newlineIsToken||!t.includes(`
|
|
4
4
|
`))&&(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith(`
|
|
@@ -1388,8 +1388,8 @@ import{n as e,r as t}from"./rolldown-runtime-hePW80VL.js";import{t as n}from"./r
|
|
|
1388
1388
|
...`:t;let n=JSON.stringify(t,null,2);return n.length>3e3?n.slice(0,3e3)+`
|
|
1389
1389
|
...`:n}var el=(0,P.memo)(function({part:e,mcpInfo:t,chatStatus:n,defaultOpen:r}){let{isPending:i,isInterrupted:a}=Gc(e,n),o=(0,P.useMemo)(()=>e.state===`input-streaming`?`Preparing ${t.displayName}`:i?Yc(t):Xc(t),[e.state,i,t]),s=(0,P.useMemo)(()=>e.state===`input-streaming`?``:Zc(e.input),[e.input,e.state]),c=(0,P.useMemo)(()=>e.output?$c(e.output):null,[e.output]),l=(0,P.useMemo)(()=>{if(!c)return null;let e=c.trim();return e?`\`\`\`${e.startsWith(`{`)||e.startsWith(`[`)?`json`:`text`}\n${c}\n\`\`\``:null},[c]),u=!!l&&!i;return a&&!e.output?(0,F.jsxs)(`span`,{className:`text-sm text-muted-foreground`,children:[t.displayName,` interrupted`]}):(0,F.jsx)(`div`,{className:`an-tool-mcp`,children:(0,F.jsx)(Ic,{shimmerLabel:o,completeLabel:o,isAnimating:i,detail:s||void 0,trailingContent:void 0,expandable:u,defaultOpen:r,children:l&&(0,F.jsx)(we,{className:`text-label`,codeControls:!1,content:l})})})},Uc);function tl({className:e,...t}){return(0,F.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`16`,height:`16`,fill:`none`,className:e??`animate-spin text-muted-foreground will-change-transform`,...t,children:[(0,F.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`,fill:`none`,opacity:.2}),(0,F.jsx)(`path`,{d:`M12 2C6.48 2 2 6.48 2 12`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`,fill:`none`})]})}function nl(e){let t=e.id?.trim();return t?t.endsWith(`.md`)?t:`plan-${t}.md`:`plan-working.md`}var rl=(0,P.memo)(function({part:e,chatStatus:t}){let{isPending:n}=Gc(e,t),r=e.input?.plan,[a,o]=(0,P.useState)(!1),[s,c]=(0,P.useState)(!1),[l,u]=(0,P.useState)(null),[d,f]=(0,P.useState)(!1),[p,m]=(0,P.useState)(``);if(!r)return null;let h=nl(r),g=r.summary?.trim()??``,_=g.length>0,v=e.input?.completed??0,y=e.input?.total??r.todos?.length??0,b=!!e.input?.pendingDecision,x=b&&!n,S=e.input?.approved||s||r.status===`approved`||r.status===`completed`,C=async(e,t,n)=>{if(!(!t||l)){u(e);try{await t(n),e===`execute`&&c(!0),e===`refine`&&(m(``),f(!1))}finally{u(null)}}},w=y>0?`${v}/${y} complete`:b?`Awaiting review`:void 0;return(0,F.jsxs)(`div`,{className:`an-tool-plan overflow-hidden rounded-chat-tool border border-border bg-muted`,children:[(0,F.jsxs)(`div`,{className:`flex h-7 items-center justify-between pr-2.5 pl-3`,children:[(0,F.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[n?(0,F.jsx)(tl,{className:`h-3 w-3 shrink-0 animate-spin text-muted-foreground`}):(0,F.jsx)(k,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}),(0,F.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:h})]}),(0,F.jsx)(`button`,{type:`button`,onClick:()=>o(e=>!e),"aria-label":a?`Collapse plan`:`Expand plan`,className:`inline-flex size-5 items-center justify-center text-muted-foreground`,children:a?(0,F.jsx)(Ne,{className:`h-3.5 w-3.5`}):(0,F.jsx)(Me,{className:`h-3.5 w-3.5`})})]}),(0,F.jsxs)(`div`,{className:`border-t border-border bg-background pt-2`,children:[(0,F.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-3`,children:[(0,F.jsx)(`div`,{className:`text-sm text-foreground`,children:r.title}),w?(0,F.jsx)(`div`,{className:`rounded-full border border-border px-2 py-0.5 text-caption text-muted-foreground`,children:w}):null]}),_?(0,F.jsxs)(`div`,{className:`relative`,children:[(0,F.jsx)(`div`,{className:i(`px-3`,`text-sm text-muted-foreground`,!a&&`max-h-[94px] overflow-hidden`),children:(0,F.jsx)(we,{content:g,className:`text-sm`})}),!a&&(0,F.jsxs)(`div`,{className:`absolute inset-x-0 bottom-0 h-16 pr-2 pb-2 pl-3.5`,children:[(0,F.jsx)(`div`,{className:`absolute inset-x-0 bottom-0 h-full w-full bg-linear-to-b from-transparent from-0% to-background to-50%`}),(0,F.jsx)(`div`,{className:`relative flex h-full items-end justify-between`,children:(0,F.jsx)(`button`,{type:`button`,onClick:()=>o(!0),className:`-mx-2 h-5 rounded-[4px] px-1.5 text-xs text-muted-foreground hover:text-foreground`,children:`Read detailed plan`})})]})]}):(0,F.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`No plan summary provided.`})]}),(a||!_)&&(0,F.jsxs)(`div`,{className:`mt-2 flex items-center justify-between border-t border-border bg-muted pt-1.5 pr-2 pb-2 pl-3.5`,children:[(0,F.jsx)(`button`,{type:`button`,onClick:()=>o(e=>!e),className:`-mx-2 h-5 rounded-[4px] px-1.5 text-xs text-muted-foreground hover:text-foreground`,children:a?`Hide detailed plan`:`Read detailed plan`}),x?(0,F.jsx)(`div`,{className:`text-caption text-muted-foreground`,children:`Choose what to do with this plan.`}):S?(0,F.jsx)(`div`,{className:`text-caption text-muted-foreground`,children:`Approved`}):null]}),x?(0,F.jsxs)(`div`,{className:`flex flex-col gap-2 border-t border-border bg-muted px-3 py-2.5`,children:[(0,F.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,F.jsx)(`button`,{type:`button`,onClick:()=>C(`execute`,e.input?.onExecute),disabled:!!l,className:`h-7 rounded-[6px] bg-primary px-2.5 text-xs font-medium text-primary-foreground disabled:opacity-60`,children:l===`execute`?`Executing...`:e.input?.executeLabel??`Execute`}),(0,F.jsx)(`button`,{type:`button`,onClick:()=>C(`stay`,e.input?.onStay),disabled:!!l,className:`h-7 rounded-[6px] border border-border px-2.5 text-xs text-foreground disabled:opacity-60`,children:l===`stay`?`Saving...`:e.input?.stayLabel??`Stay`}),(0,F.jsx)(`button`,{type:`button`,onClick:()=>f(e=>!e),disabled:!!l,className:`h-7 rounded-[6px] border border-border px-2.5 text-xs text-foreground disabled:opacity-60`,children:e.input?.refineLabel??`Refine`})]}),d?(0,F.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,F.jsx)(`textarea`,{value:p,onChange:e=>m(e.target.value),rows:3,placeholder:`Describe what should change in the plan`,className:`w-full resize-y rounded-[8px] border border-border bg-background px-3 py-2 text-base text-foreground outline-none focus:border-primary md:text-sm`}),(0,F.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,F.jsx)(`button`,{type:`button`,onClick:()=>{f(!1),m(``)},disabled:!!l,className:`h-7 rounded-[6px] border border-border px-2.5 text-xs text-foreground disabled:opacity-60`,children:`Cancel`}),(0,F.jsx)(`button`,{type:`button`,onClick:()=>C(`refine`,e.input?.onRefine,p),disabled:!!l,className:`h-7 rounded-[6px] bg-primary px-2.5 text-xs font-medium text-primary-foreground disabled:opacity-60`,children:l===`refine`?`Submitting...`:`Submit refinement`})]})]}):null]}):null]})]})},Uc);function il({toolSteps:e,stepStates:t,onStepComplete:n,results:r=[],defaultOpen:a}){let o=e.some(e=>t[e.id]===`animating`),s=e.find(e=>e.searchQuery)?.searchQuery??`searching...`,c=r.length,l=c>0;function u({step:e}){return re(t[e.id]===`animating`,e.duration,()=>n(e.id)),null}return(0,F.jsxs)(F.Fragment,{children:[e.map(e=>(0,F.jsx)(u,{step:e},e.id)),(0,F.jsx)(Ic,{shimmerLabel:`Searching...`,completeLabel:`Found ${c} results`,isAnimating:o,expandable:l,defaultOpen:a,children:(0,F.jsxs)(`div`,{className:`overflow-hidden rounded-chat-tool border border-border bg-muted`,children:[(0,F.jsxs)(`div`,{className:`flex h-7 items-center gap-1 border-b border-border px-2.5 py-0 text-xs`,children:[(0,F.jsx)(`span`,{className:`font-medium text-foreground`,children:`Searched for`}),` `,(0,F.jsxs)(`span`,{className:`truncate text-muted-foreground`,children:[`“`,s,`”`]})]}),(0,F.jsx)(`div`,{className:`max-h-[200px] overflow-y-auto bg-background`,children:(0,F.jsx)(`div`,{className:`flex flex-col gap-1 p-1`,children:r.map(e=>(0,F.jsxs)(`div`,{className:i(`flex cursor-default items-center gap-2 rounded-[calc(var(--chat-tool-radius)-4px)] px-2 py-1`,`hover:bg-muted/50`),children:[(0,F.jsx)(`div`,{className:`flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground`,children:(0,F.jsx)(k,{className:`h-4 w-4`})}),(0,F.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm text-foreground/90`,children:e.title}),(0,F.jsx)(`span`,{className:`shrink-0 text-xs whitespace-nowrap text-muted-foreground`,children:e.date||e.source})]},`${e.title}-${e.source}-${e.date}`))})})]})})]})}function al(e){if(!Array.isArray(e))return;let t=e.map(e=>{if(!e||typeof e!=`object`)return null;let t=e.source,n=e.title,r=e.date;return typeof t!=`string`||typeof n!=`string`||typeof r!=`string`?null:{source:t,title:n,date:r}}).filter(e=>!!e);return t.length>0?t:void 0}var ol=(0,P.memo)(function({part:e,results:t,defaultOpen:n}){let r=e.type?.replace(`tool-`,``)||`WebSearch`,{step:i,stepState:a}=ae(e,r),o={[i.id]:a};return(0,F.jsx)(il,{toolSteps:[i],stepStates:o,onStepComplete:()=>{},results:t??al(e.output?.results)??al(e.result?.results),defaultOpen:n})});function sl(e){return e===`in-progress`?`In progress`:e===`completed`?`Completed`:e===`cancelled`?`Cancelled`:`Pending`}function cl({complete:e}){let t=f()??!1;return(0,F.jsx)(`span`,{"aria-hidden":`true`,className:`relative grid size-6 shrink-0 place-items-center`,children:(0,F.jsx)(d,{initial:!1,mode:`popLayout`,children:e?(0,F.jsxs)(o.svg,{viewBox:`0 0 24 24`,initial:t?{opacity:1}:{opacity:0,scale:.72},animate:{opacity:1,scale:1},exit:{opacity:0},transition:t?{duration:0}:s,className:`absolute size-5.5 overflow-visible text-emerald-500`,children:[(0,F.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`,fill:`currentColor`}),(0,F.jsx)(o.path,{d:`M7.5 12.25 10.5 15.25 16.75 8.75`,fill:`none`,stroke:`white`,strokeWidth:`2.25`,strokeLinecap:`round`,strokeLinejoin:`round`,initial:t?{pathLength:1}:{pathLength:0},animate:{pathLength:1},transition:t?{duration:0}:{duration:.24,ease:u}})]},`complete`):(0,F.jsx)(o.span,{initial:t?{opacity:1}:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:t?{opacity:0}:{opacity:0,scale:.72},transition:t?{duration:0}:s,className:`absolute grid place-items-center text-muted-foreground`,children:(0,F.jsx)(S,{className:`size-4`})},`todo`)})})}function ll({status:e,progress:t}){let n=f()??!1,r=t===void 0?.68:Math.min(100,Math.max(0,t))/100;return(0,F.jsxs)(o.svg,{"aria-hidden":`true`,viewBox:`0 0 24 24`,initial:!1,className:i(`mx-0.5 size-5 shrink-0 overflow-visible text-muted-foreground`,e===`in-progress`&&`text-foreground`,e===`cancelled`&&`text-rose-600 dark:text-rose-400`),children:[(0,F.jsx)(o.circle,{cx:`12`,cy:`12`,r:`9`,fill:`currentColor`,stroke:`currentColor`,strokeWidth:`1.5`,strokeDasharray:e===`pending`?`2 3`:void 0,strokeLinecap:`round`,initial:!1,animate:{fillOpacity:e===`completed`?.06:0},transition:n?{duration:0}:{duration:.18,ease:u},className:i(e===`in-progress`&&`opacity-20`)}),(0,F.jsx)(o.circle,{cx:`12`,cy:`12`,r:`9`,pathLength:`1`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,initial:!1,animate:{pathLength:e===`in-progress`?r:0,opacity:+(e===`in-progress`),rotate:e===`in-progress`&&t===void 0&&!n?360:-90},transition:e===`in-progress`&&t===void 0&&!n?{rotate:{duration:1.1,repeat:1/0,ease:`linear`}}:n?{duration:0}:l,style:{transformOrigin:`12px 12px`}}),(0,F.jsx)(o.path,{d:`M7.5 12.25 10.5 15.25 16.75 8.75`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,initial:!1,animate:{pathLength:+(e===`completed`),opacity:+(e===`completed`)},transition:n?{duration:0}:{duration:.24,ease:u}}),(0,F.jsx)(o.path,{d:`M8.5 8.5 15.5 15.5M15.5 8.5 8.5 15.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,initial:!1,animate:{pathLength:+(e===`cancelled`),opacity:+(e===`cancelled`)},transition:n?{duration:0}:{duration:.2,ease:u}})]})}function ul({items:e,title:t=`To-dos`,open:n,defaultOpen:r=!0,onOpenChange:a,collapseOnComplete:c=!0,maxHeight:p=248,className:m}){let h=f()??!1,g=(0,P.useId)(),_=`${g}-trigger`,v=`${g}-content`,y=(0,P.useRef)(null),b=(0,P.useRef)(!1),[x,S]=(0,P.useState)(r),C=n??x,T=e.filter(e=>e.status===`completed`).length,E=e.length>0&&T===e.length,D=e.length,O=(0,P.useCallback)(e=>{n===void 0&&S(e),a?.(e)},[a,n]);return(0,P.useEffect)(()=>{b.current&&!E&&O(!0),!b.current&&E&&c&&O(!1),b.current=E},[E,c,O]),(0,P.useLayoutEffect)(()=>{let e=y.current;if(!e||D===0)return;let t=requestAnimationFrame(()=>{e.scrollHeight<=e.clientHeight||(typeof e.scrollTo==`function`?e.scrollTo({top:e.scrollHeight,behavior:h?`auto`:`smooth`}):e.scrollTop=e.scrollHeight)});return()=>cancelAnimationFrame(t)},[D,h]),(0,F.jsxs)(`section`,{"aria-label":`Agent task list`,className:i(`w-full overflow-hidden rounded-2xl border border-border/70`,m),children:[(0,F.jsxs)(`button`,{id:_,type:`button`,"aria-expanded":C,"aria-controls":v,onClick:()=>O(!C),className:`group flex h-11 w-full items-center gap-2.5 rounded-2xl px-3.5 text-left outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:[(0,F.jsx)(cl,{complete:E}),(0,F.jsx)(`h3`,{className:`min-w-0 flex-1 truncate text-sm font-medium text-foreground/90`,children:t}),(0,F.jsxs)(`span`,{className:i(`shrink-0 text-xs font-medium tabular-nums text-muted-foreground`,E&&`text-emerald-600 dark:text-emerald-400`),children:[(0,F.jsxs)(`span`,{className:`sr-only`,children:[T,` of `,e.length,` tasks completed`]}),(0,F.jsxs)(`span`,{"aria-hidden":`true`,className:`inline-flex`,children:[(0,F.jsx)(ee,{value:String(T),children:T}),(0,F.jsx)(`span`,{children:`/`}),(0,F.jsx)(`span`,{children:e.length})]})]}),(0,F.jsx)(o.span,{"aria-hidden":`true`,animate:{rotate:C?180:0},transition:h?{duration:0}:s,className:`text-muted-foreground/50 transition-colors group-hover:text-muted-foreground`,children:(0,F.jsx)(w,{className:`size-3.5`})})]}),(0,F.jsx)(ne,{id:v,role:`region`,"aria-labelledby":_,open:C,children:(0,F.jsxs)(`div`,{ref:y,className:`scrollbar-hide overflow-y-auto px-2 pb-2`,style:{maxHeight:p},children:[(0,F.jsx)(`ol`,{"aria-live":E?`polite`:`off`,className:`space-y-0`,children:(0,F.jsx)(d,{initial:!1,mode:`popLayout`,children:e.map(e=>{let t=e.status??`pending`;return(0,F.jsxs)(o.li,{layout:`position`,initial:h?{opacity:1}:{opacity:0,y:6},animate:{opacity:1,y:0},exit:h?{opacity:0}:{opacity:0,y:-3},transition:h?{duration:0}:{opacity:{duration:.18,ease:u},y:l,layout:l},className:`flex min-h-9 items-center gap-2.5 rounded-xl px-1.5 py-1`,children:[(0,F.jsx)(ll,{status:t,progress:e.progress}),(0,F.jsxs)(`span`,{className:`sr-only`,children:[sl(t),`: `]}),(0,F.jsx)(`span`,{className:i(`min-w-0 flex-1 truncate text-sm leading-5`,t===`pending`&&`text-muted-foreground/65`,t===`in-progress`&&`text-foreground`,t===`completed`&&`text-muted-foreground/60`,t===`cancelled`&&`text-muted-foreground/55`),children:(0,F.jsxs)(`span`,{className:`relative inline-block max-w-full`,children:[e.title,(0,F.jsx)(o.span,{"aria-hidden":`true`,initial:!1,animate:{scaleX:+(t===`completed`),opacity:+(t===`completed`)},transition:h?{duration:0}:{duration:.28,ease:u,delay:.06},className:`absolute inset-x-0 top-1/2 h-px origin-left bg-current`})]})}),e.detail?(0,F.jsx)(`span`,{className:`shrink-0 text-sm text-muted-foreground/55`,children:e.detail}):null]},e.id)})})}),!e.length&&(0,F.jsx)(`p`,{className:`px-1.5 py-2 text-sm text-muted-foreground`,children:`No tasks yet`})]})})]})}function dl(e){return e===`in_progress`||e===`in-progress`?`in-progress`:e===`completed`?`completed`:e===`cancelled`?`cancelled`:`pending`}function fl(e){return(e??[]).flatMap((e,t)=>{let n=e.title??e.content;return n?[{id:`${t}-${n}`,title:n,status:dl(e.status)}]:[]})}var pl=(0,P.memo)(function({part:e}){let t=e.state===`input-streaming`,n=(0,P.useMemo)(()=>fl(e.input?.todos??e.output?.newTodos),[e.input?.todos,e.output?.newTodos]);return t||n.length===0?(0,F.jsx)(oe,{as:`span`,duration:1.2,className:`m-0 inline-flex h-4 items-center text-label leading-none`,children:`Updating to-dos...`}):(0,F.jsx)(ul,{items:n,title:`Todo list`,defaultOpen:!0,collapseOnComplete:!1,maxHeight:240})},Uc);function ml(e,t){let[n,r]=(0,P.useState)(0);return(0,P.useEffect)(()=>{if(t&&e){r(Date.now()-e);let t=setInterval(()=>{r(Date.now()-e)},1e3);return()=>clearInterval(t)}},[t,e]),n}function hl(e){if(!e)return``;let t=Te(e);if(t!==e)return t;if(e.startsWith(`/`)){let t=e.split(`/`),n=[`apps`,`packages`,`src`,`lib`,`components`],r=t.findIndex(e=>n.includes(e));if(r>0)return t.slice(r).join(`/`)}return e}function gl(e,t){let n=e.split(`
|
|
1390
1390
|
`),r=t.split(`
|
|
1391
|
-
`),i=Math.max(n.length,r.length),a=0,o=0;for(let e=0;e<i;e++)n[e]!==void 0&&r[e]!==void 0?n[e]!==r[e]&&(o++,a++):n[e]===void 0?r[e]!==void 0&&a++:o++;return{addedLines:a,removedLines:o}}var _l={"tool-Task":{icon:
|
|
1392
|
-
`,1)[0].trim();return n.length>50?`${n.slice(0,47)}...`:n},variant:`simple`},"tool-WebFetch":{icon:ue,title:e=>e.state!==`output-available`&&e.state!==`output-error`?`Fetching`:`Fetched`,subtitle:e=>{let t=e.input?.url||``;try{return new URL(t).hostname.replace(`www.`,``)}catch{return t.slice(0,30)}},variant:`simple`},"tool-WebSearch":{icon:me,title:e=>e.state!==`output-available`&&e.state!==`output-error`?`Searching web`:`Searched web`,subtitle:e=>{let t=e.input?.query||``;return t.length>40?`${t.slice(0,37)}...`:t},variant:`collapsible`},"tool-TodoWrite":{icon:S,title:e=>{let t=e.state!==`output-available`&&e.state!==`output-error`,n=e.input?.action||`update`;return t?n===`add`?`Adding todo`:`Updating todos`:n===`add`?`Added todo`:`Updated todos`},subtitle:e=>{let t=e.input?.todos||[];return t.length===0?``:`${t.length} ${t.length===1?`item`:`items`}`},variant:`simple`},"tool-PlanWrite":{icon:de,title:e=>{let t=e.state!==`output-available`&&e.state!==`output-error`,n=e.input?.action||`create`;if(t)return n===`create`?`Creating plan`:n===`approve`?`Approving plan`:`Updating plan`;let r=e.input?.plan?.status;return r===`awaiting_approval`?`Plan ready for review`:r===`approved`?`Plan approved`:r===`completed`?`Plan completed`:n===`create`?`Created plan`:`Updated plan`},variant:`simple`},"tool-ExitPlanMode":{icon:b,title:e=>e.state!==`output-available`&&e.state!==`output-error`?`Finishing plan`:`Plan complete`,variant:`simple`},"tool-NotebookEdit":{icon:te,title:e=>e.state!==`output-available`&&e.state!==`output-error`?`Editing notebook`:`Edited notebook`,subtitle:e=>{let t=e.input?.file_path||``;return t&&t.split(`/`).pop()||``},variant:`simple`},"tool-BashOutput":{icon:he,title:e=>e.state!==`output-available`&&e.state!==`output-error`?`Getting output`:`Command output`,subtitle:e=>{let t=e.output;if(typeof t==`string`&&t.trim())return t.trim();let n=e.input?.command||``;if(!n)return``;let r=n.replace(/\\\s*\n\s*/g,` `).trim();return r=r.replace(/\/(?:Users|home|root)\/[^\s"']+/g,e=>hl(e)),r.length>50?`${r.slice(0,47)}...`:r},variant:`simple`},"tool-KillShell":{icon:M,title:e=>e.state!==`output-available`&&e.state!==`output-error`?`Stopping shell`:`Shell stopped`,subtitle:e=>{let t=e.input?.pid;return typeof t==`number`?`pid ${t}`:``},variant:`simple`},"tool-cloning":{icon:ce,title:e=>e.state!==`output-available`&&e.state!==`output-error`?`Cloning repo`:`Repo cloned`,subtitle:e=>e.input?.repo??``,variant:`simple`},"tool-Thinking":{icon:de,title:e=>e.state!==`output-available`&&e.state!==`output-error`?`Thinking...`:`Thought`,variant:`collapsible`}},vl=`tool-mcp__`,yl={"tool-ListMcpResources":{serverName:`mcp`,toolName:`list_resources`,displayName:`List Resources`,category:`list`},"tool-ListMcpResourcesTool":{serverName:`mcp`,toolName:`list_resources`,displayName:`List Resources`,category:`list`},"tool-ReadMcpResource":{serverName:`mcp`,toolName:`read_resource`,displayName:`Read Resource`,category:`get`},"tool-ReadMcpResourceTool":{serverName:`mcp`,toolName:`read_resource`,displayName:`Read Resource`,category:`get`}};function bl(e){let t=yl[e];if(t)return t;if(!e.startsWith(vl))return null;let n=e.slice(10),r=n.indexOf(`__`);if(r===-1)return null;let i=n.slice(0,r),a=n.slice(r+2);return{serverName:i,toolName:a,displayName:a.replace(/_/g,` `).replace(/\b\w/g,e=>e.toUpperCase()).trim(),category:`other`}}function xl(e,t){return`${e} ${e===1?t:`${t}s`}`}function Sl(e){if(e.length===0)return``;let t=new Set([`tool-Read`,`tool-Edit`,`tool-Write`]),n=new Set([`tool-Search`,`tool-Grep`,`tool-Glob`,`tool-WebSearch`]),r=new Set([`tool-Bash`]),i=0,a=0,o=0;for(let s of e)t.has(s.type)?i+=1:n.has(s.type)?a+=1:r.has(s.type)&&(o+=1);let s=[];return i>0&&s.push(xl(i,`file`)),a>0&&s.push(`${a} ${a===1?`search`:`searches`}`),o>0&&s.push(xl(o,`command`)),s.length===0?``:s.length===1?s[0]:s.length===2?`${s[0]} and ${s[1]}`:`${s.slice(0,-1).join(`, `)}, and ${s[s.length-1]}`}function Cl(e){let t=new Set([`tool-Read`,`tool-Edit`,`tool-Write`]),n=new Set([`tool-Search`,`tool-Grep`,`tool-Glob`,`tool-WebSearch`]),r=0,i=0;for(let a of e)t.has(a.type)?r+=1:n.has(a.type)&&(i+=1);return{fileCount:r,searchCount:i}}function wl(e,t){let n=[];return e>0&&n.push(xl(e,`file`)),t>0&&n.push(`${t} ${t===1?`search`:`searches`}`),n.join(`, `)}var Tl=(0,P.memo)(function({part:e,nestedTools:t=[],chatStatus:n,completeLabel:r,shimmerLabel:a,interruptedLabel:o,maxVisibleTools:s=5,defaultOpen:c,showElapsed:l=!0}){let{isPending:u,isInterrupted:d}=Gc(e,n),f=e.input?.description||``,[p,m]=(0,P.useState)(c??!1),[h,g]=(0,P.useState)(0),_=e.callProviderMetadata?.custom?.startedAt??e.startedAt,v=t.length>0,y=e.toolCallId??e.id??``,b=e.output?.totalDurationMs||e.output?.duration||e.output?.duration_ms,x=Math.max(1,s)*28,S=u?Math.max(h,0):t.length,C=(0,P.useRef)(u),w=(0,P.useRef)(!1),T=(0,P.useRef)(null),{fileCount:E,searchCount:D}=(0,P.useMemo)(()=>Cl(u?t.slice(0,Math.max(h,0)):t),[u,t,h]),O=wl(E,D),k=(0,P.useRef)(null),A=ml(_,u);(0,P.useEffect)(()=>{let e=C.current;return T.current&&=(window.clearTimeout(T.current),null),u&&!e&&!w.current&&c!==!1&&(m(!1),T.current=window.setTimeout(()=>{m(!0)},60)),!u&&e&&(m(!1),w.current=!1),C.current=u,()=>{T.current&&=(window.clearTimeout(T.current),null)}},[c,u]),(0,P.useEffect)(()=>{if(!u||t.length===0){g(t.length);return}let e=1;g(Math.min(e,t.length));let n=setInterval(()=>{e+=1,g(Math.min(e,t.length)),e>=t.length&&clearInterval(n)},450);return()=>clearInterval(n)},[u,t.length,y]),(0,P.useEffect)(()=>{!u||!k.current||(k.current.scrollTop=k.current.scrollHeight)},[u,h]);let j=(()=>{if(u&&v)return O;if(!u&&v){let e=Sl(t);if(e)return e}return f?f.length>60?`${f.slice(0,57)}...`:f:``})(),M=Wc(!u&&b?b:A);return d&&!e.output?(0,F.jsx)(Ic,{completeLabel:o,isAnimating:!1}):(0,F.jsx)(Ic,{completeLabel:r,shimmerLabel:a,isAnimating:u,detail:j,expandable:v,expanded:p,onToggleExpand:()=>{w.current=!0,m(e=>!e)},trailingContent:l&&M?(0,F.jsx)(`span`,{className:`shrink-0 font-normal text-muted-foreground/60 tabular-nums`,children:M}):void 0,children:(0,F.jsxs)(`div`,{className:`relative`,children:[u&&p&&S>4&&(0,F.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 top-0 z-10 h-10 bg-linear-to-b from-background to-transparent`}),(0,F.jsx)(`div`,{ref:k,className:i(t.length>1?`flex flex-col gap-2`:void 0,u&&p&&S>4&&`overflow-y-auto`),style:u&&p&&S>4?{height:`${x}px`}:void 0,children:(u?t.slice(0,Math.max(h,0)):t).map((e,t)=>{let r=u?{...e,state:t===h-1?`input-streaming`:`output-available`}:e,i=_l[r.type];if(!i)return null;let{isPending:a,isError:o}=Gc(r,n);return(0,F.jsx)(Lc,{icon:i.icon,title:i.title(r),subtitle:i.subtitle?.(r),isPending:a,isError:o},r.toolCallId??r.id??`${r.type}-${i.title(r)}`)})})]})})});function El(e,t){if(e.state===`input-streaming`)return`streaming`;if(e.state===`output-available`)return`success`;if(e.state===`output-error`)return`error`;let{isPending:n}=Gc(e,t);return n?`pending`:`success`}var Dl=(0,P.memo)(function({part:e,nestedTools:t,chatStatus:n,toolRenderers:r}){let i=e.type;switch(i){case`tool-Bash`:return(0,F.jsx)(We,{part:e});case`tool-IPython`:return(0,F.jsx)(se,{part:e});case`tool-Edit`:case`tool-Write`:return(0,F.jsx)(Fc,{part:e});case`tool-WebSearch`:case`tool-Grep`:case`tool-Glob`:return(0,F.jsx)(ol,{part:e});case`tool-PlanWrite`:return(0,F.jsx)(rl,{part:e,chatStatus:n});case`tool-TodoWrite`:return(0,F.jsx)(pl,{part:e,chatStatus:n});case`tool-Question`:return(0,F.jsx)(Ve,{part:e,chatStatus:n});case`tool-Task`:case`tool-Agent`:{let r=e.type===`tool-Agent`?`Agent`:`Task`;return(0,F.jsx)(Tl,{part:e,nestedTools:t,chatStatus:n,completeLabel:`${r} completed`,shimmerLabel:`Running ${r.toLowerCase()}`,interruptedLabel:`${r} interrupted`,defaultOpen:!1})}case`tool-Thinking`:return null}let a=bl(i);if(a){if(r){let t=r[a.toolName];if(t)return(0,F.jsx)(t,{name:a.toolName,input:e.input??{},output:e.output?Qc(e.output):void 0,status:El(e,n)})}return(0,F.jsx)(el,{part:e,mcpInfo:a,chatStatus:n})}if(r&&i.startsWith(`tool-`)){let t=i.slice(5),a=r[t];if(a)return(0,F.jsx)(a,{name:t,input:e.input??{},output:e.output??e.result,status:El(e,n)})}let o=_l[i];if(o){let{isPending:t,isError:r}=Gc(e,n);return(0,F.jsx)(Lc,{title:o.title(e),subtitle:o.subtitle?.(e),isPending:t,isError:r})}let s=i.startsWith(`tool-`)?i.slice(5):i,{isPending:c,isError:l}=Gc(e,n);return(0,F.jsx)(Lc,{title:c?`Running ${s}`:s,isPending:c,isError:l})}),Ol={queued:`Waiting to generate`,generating:`Generating image`,refining:`Refining details`,complete:`Image ready`,error:`Generation failed`},kl={queued:{filter:`blur(4px) saturate(0.75)`,opacity:0,scale:1.02},generating:{filter:`blur(3px) saturate(0.85)`,opacity:0,scale:1.015},refining:{filter:`blur(1.5px) saturate(0.95)`,opacity:.62,scale:1.005},complete:{filter:`blur(0px) saturate(1)`,opacity:1,scale:1},error:{filter:`blur(2px) saturate(0.5)`,opacity:.28,scale:1}},Al={queued:1,generating:1,refining:.48,complete:0,error:0},jl=10,Ml=Math.PI*2;function Nl({status:e,reduce:t}){return e===`complete`?(0,F.jsx)(C,{"aria-hidden":`true`,className:`size-3.5`}):e===`error`?(0,F.jsx)(O,{"aria-hidden":`true`,className:`size-3.5`}):(0,F.jsxs)(o.span,{"aria-hidden":`true`,animate:t?void 0:{rotate:360},transition:{duration:2.4,ease:c,repeat:1/0},className:`grid size-3.5 grid-cols-2 place-items-center gap-0.5`,children:[(0,F.jsx)(`span`,{className:`size-1 rounded-[1px] bg-current`}),(0,F.jsx)(`span`,{className:`size-1 rounded-[1px] bg-current opacity-55`}),(0,F.jsx)(`span`,{className:`size-1 rounded-[1px] bg-current opacity-55`}),(0,F.jsx)(`span`,{className:`size-1 rounded-[1px] bg-current`})]})}function Pl({interactive:e,reduce:t,status:n}){let r=y(),i=(0,P.useRef)(null);return(0,P.useEffect)(()=>{let n=i.current,a=n?.getContext(`2d`);if(!n||!a)return;let o=0,s=0,c=0,l=`currentColor`,u={x:0,y:0,targetX:0,targetY:0,inside:!1},d=e&&r&&!t,f=()=>{let e=n.getBoundingClientRect();s=e.width||n.clientWidth||208,c=e.height||n.clientHeight||208;let t=Math.min(window.devicePixelRatio||1,2);n.width=Math.round(s*t),n.height=Math.round(c*t),a.setTransform(t,0,0,t,0,0),l=window.getComputedStyle(n).color,u.x=s/2,u.y=c/2,u.targetX=u.x,u.targetY=u.y},p=e=>{a.clearRect(0,0,s,c),u.inside||(u.targetX=s/2+(t?0:Math.sin(e/1700)*s*.12),u.targetY=c/2+(t?0:Math.cos(e/2100)*c*.1));let n=t?1:u.inside?.16:.045;u.x+=(u.targetX-u.x)*n,u.y+=(u.targetY-u.y)*n;let r=Math.min(s,c)*.38,i=Math.ceil(s/jl)+1,d=Math.ceil(c/jl)+1,f=(s-(i-1)*jl)/2,m=(c-(d-1)*jl)/2;a.fillStyle=l;for(let e=0;e<d;e+=1)for(let t=0;t<i;t+=1){let n=f+t*jl,i=m+e*jl,o=n-u.x,s=i-u.y,c=Math.hypot(o,s),l=Math.max(0,1-c/r),d=l*l*(3-2*l),p=d*d*9,h=c>0?o/c:0,g=c>0?s/c:0,_=n+h*p,v=i+g*p,y=.65+d*.85;a.globalAlpha=.17+d*.72,a.beginPath(),a.arc(_,v,y,0,Ml),a.fill()}a.globalAlpha=1,t||(o=window.requestAnimationFrame(p))},m=e=>{if(!d)return;let t=n.getBoundingClientRect();u.inside=!0,u.targetX=e.clientX-t.left,u.targetY=e.clientY-t.top},h=()=>{u.inside=!1},g=typeof ResizeObserver>`u`?null:new ResizeObserver(f);return f(),g?.observe(n),n.addEventListener(`pointermove`,m,{passive:!0}),n.addEventListener(`pointerleave`,h),p(0),()=>{o&&window.cancelAnimationFrame(o),g?.disconnect(),n.removeEventListener(`pointermove`,m),n.removeEventListener(`pointerleave`,h)}},[r,e,t]),(0,F.jsx)(o.div,{"aria-hidden":`true`,initial:!1,animate:{opacity:Al[n]},transition:{duration:t?0:.4,ease:u},className:`absolute inset-0 overflow-hidden bg-muted`,children:(0,F.jsx)(`canvas`,{ref:i,className:`absolute inset-0 size-full text-foreground`})})}function Fl({children:e,status:t=`generating`,label:n,prompt:r,resolution:s=`1024 × 1024`,aspectRatio:c=`1 / 1`,size:l=`compact`,interactive:p=!0,statusText:m,showStatus:h=!0,onRetry:g,className:_,mediaClassName:v,statusClassName:y}){let b=f()??!1,x=t===`queued`||t===`generating`||t===`refining`,S=kl[t],C=m??Ol[t],w=n??(r?`${C}: ${r}`:C);return(0,F.jsx)(`div`,{"data-slot":`image-generation`,"data-state":t,"aria-busy":x,className:i(`w-full`,_),children:(0,F.jsxs)(`div`,{className:i(`w-full`,l===`compact`&&`mx-auto max-w-52`),children:[(0,F.jsxs)(`div`,{role:`img`,"aria-label":w,style:{aspectRatio:c},className:`relative isolate w-full overflow-hidden rounded-xl bg-muted`,children:[(0,F.jsx)(o.div,{"aria-hidden":!e||void 0,initial:!1,animate:b?{opacity:S.opacity}:{filter:S.filter,opacity:S.opacity,scale:S.scale},transition:b?{duration:0}:{duration:.4,ease:u},className:i(`absolute inset-0 [&>*]:size-full [&>*]:object-cover [&_img]:size-full [&_img]:object-cover`,v),children:e}),(0,F.jsx)(d,{initial:!1,children:x?(0,F.jsx)(o.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:b?0:.25,ease:u},className:`absolute inset-0`,children:(0,F.jsx)(Pl,{interactive:p,reduce:b,status:t})},`dither-field`):null}),s?(0,F.jsx)(`span`,{className:`absolute top-2 right-2 z-10 rounded-full bg-background/75 px-2 py-0.5 font-mono text-micro tabular-nums text-muted-foreground`,children:s}):null]}),(0,F.jsx)(d,{initial:!1,children:h||r?(0,F.jsxs)(o.div,{initial:!1,className:`mt-3 text-left`,children:[(0,F.jsxs)(`div`,{"aria-live":`polite`,className:i(h?`flex min-h-5 items-center gap-2`:`contents`,`text-sm font-medium text-foreground`,t===`error`&&`text-destructive`,y),children:[h?(0,F.jsx)(Nl,{status:t,reduce:b}):null,(0,F.jsx)(d,{mode:`popLayout`,initial:!1,children:h?(0,F.jsx)(o.span,{initial:!b&&{opacity:0,y:4},animate:{opacity:1,y:0},exit:b?void 0:{opacity:0,y:-4},transition:{duration:b?0:.15,ease:u},children:C},C):null})]}),r?(0,F.jsxs)(`p`,{className:`mt-0.5 truncate text-xs text-muted-foreground`,children:[`“`,r,`”`]}):null]},`status-block`):null}),t===`error`&&g?(0,F.jsxs)(o.button,{type:`button`,onClick:g,whileTap:b?void 0:{scale:.96},transition:a,className:`mt-3 inline-flex min-h-10 items-center gap-2 rounded-full px-3 text-sm font-medium text-foreground outline-none transition-colors hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring`,children:[(0,F.jsx)(pe,{"aria-hidden":`true`,className:`size-4`}),`Try again`]}):null]})})}function Il({steps:e,activeIndex:t,className:n,...r}){let a=e.length,o=ke(t,a),s=o>=a,c=Ae(o,a);return(0,F.jsxs)(`div`,{"data-slot":`agent-plan`,className:i(`flex w-full max-w-sm flex-col gap-3`,n),...r,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,F.jsx)(`span`,{className:`text-body font-medium`,children:`Plan`}),(0,F.jsxs)(`span`,{className:i(je,`text-foreground/35 tabular-nums`),children:[o,` of `,a]})]}),(0,F.jsx)(`div`,{className:`bg-foreground/[0.06] h-[3px] w-full overflow-hidden rounded-full`,children:(0,F.jsx)(`span`,{className:`bg-foreground/80 block h-full rounded-full transition-[width] duration-500`,style:{width:`${c}%`}})}),(0,F.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:e.map((e,t)=>{let n=s||t<o,r=!s&&t===o;return(0,F.jsxs)(`li`,{className:`flex items-center gap-2.5 text-body`,children:[(0,F.jsx)(`span`,{className:`flex size-4 shrink-0 items-center justify-center`,children:n?(0,F.jsx)(C,{className:`text-foreground/35 size-3.5`}):r?(0,F.jsx)(j,{className:`text-foreground/90 size-3.5 animate-spin motion-reduce:animate-none`}):(0,F.jsx)(`span`,{"aria-hidden":!0,className:`bg-foreground/15 size-1.5 rounded-full`})}),(0,F.jsx)(`span`,{className:i(n&&`text-foreground/40`,r&&`text-foreground/90`,!n&&!r&&`text-foreground/35`),children:e})]},e)})})]})}function Ll(e){if(e.length===0)return;let t=e.flatMap(e=>{let t=e.title.trim();return t?[t]:[]});if(t.length!==e.length)return;let n=0;for(;n<e.length&&e[n]?.status===`completed`;)n+=1;if(!e.slice(n+1).some(e=>e.status===`completed`))return{steps:t,activeIndex:n}}function Rl({presentation:e,className:t}){return(0,F.jsx)(Il,{steps:e.steps,activeIndex:e.activeIndex,"aria-label":`Plan progress: ${Math.min(e.activeIndex,e.steps.length)} of ${e.steps.length} steps completed`,className:t})}function zl(e){return e===`approving`?`Approving`:e===`approved`?`Approved`:e===`denied`?`Denied`:e===`running`?`Running`:e===`complete`?`Completed`:e===`error`?`Failed`:`Approval required`}function Bl(e){return e===`pending`?`border-amber-500/30 bg-amber-500/10 text-amber-600 dark:text-amber-400`:e===`approving`||e===`running`?`border-primary/30 bg-primary/10 text-primary`:e===`approved`||e===`complete`?`border-emerald-500/30 bg-emerald-500/10 text-emerald-600 dark:text-emerald-400`:`border-rose-500/30 bg-rose-500/10 text-rose-600 dark:text-rose-400`}function Vl({tool:e,title:t=`Allow this tool to run?`,description:n,parameters:r=[],status:c=`pending`,open:l,defaultOpen:p=!1,onOpenChange:m,onApprove:h,onAlwaysAllow:g,onDeny:_,className:v}){let y=f()??!1,b=`${(0,P.useId)()}-details`,x=(0,P.useRef)(c),[S,T]=(0,P.useState)(p),E=l??S,D=(0,P.useCallback)(e=>{l===void 0&&T(e),m?.(e)},[m,l]),k=c===`approving`||c===`running`,A=c===`pending`,M=c===`error`;return(0,P.useEffect)(()=>{x.current===`pending`&&c!==`pending`&&D(!1),x.current=c},[D,c]),(0,F.jsxs)(`div`,{"data-state":c,"aria-busy":k,className:i(`w-full overflow-hidden rounded-2xl border border-border/60 bg-muted/20 text-sm`,v),children:[(0,F.jsxs)(`div`,{className:`flex items-start gap-3 p-4`,children:[(0,F.jsx)(`span`,{"aria-hidden":`true`,className:i(`mt-0.5 grid size-8 shrink-0 place-items-center rounded-xl border border-border/60 bg-background text-muted-foreground`,M&&`text-destructive`),children:k?(0,F.jsx)(j,{className:i(`size-4`,!y&&`animate-spin`)}):M?(0,F.jsx)(O,{className:`size-4`}):c===`denied`?(0,F.jsx)(_e,{className:`size-4`}):c===`approved`||c===`complete`?(0,F.jsx)(C,{className:`size-4`}):(0,F.jsx)(le,{className:`size-4`})}),(0,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,F.jsxs)(`div`,{className:`flex min-w-0 items-start justify-between gap-3`,children:[(0,F.jsxs)(`div`,{className:`min-w-0`,children:[(0,F.jsx)(`div`,{className:`font-medium text-foreground`,children:t}),(0,F.jsx)(`div`,{className:`mt-0.5 truncate font-mono text-xs text-muted-foreground`,children:e})]}),(0,F.jsx)(`span`,{className:i(`shrink-0 rounded-full border px-2 py-0.5 text-caption font-medium transition-colors`,Bl(c)),children:zl(c)})]}),n?(0,F.jsx)(`p`,{className:`mt-2 leading-5 text-muted-foreground`,children:n}):null,r.length?(0,F.jsxs)(`button`,{type:`button`,"aria-expanded":E,"aria-controls":b,onClick:()=>D(!E),className:`mt-2 inline-flex items-center gap-1 rounded-md text-xs font-medium text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring`,children:[`View details`,(0,F.jsx)(o.span,{"aria-hidden":`true`,animate:{rotate:E?180:0},transition:y?{duration:0}:s,children:(0,F.jsx)(w,{className:`size-3.5`})})]}):null]})]}),(0,F.jsx)(ne,{id:b,open:E,children:(0,F.jsx)(`dl`,{className:`mx-4 mb-4 grid gap-2 rounded-xl border border-border/50 bg-background/70 p-3`,children:r.map(e=>(0,F.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,7rem)_minmax(0,1fr)] items-center gap-3 text-xs`,children:[(0,F.jsx)(`dt`,{className:`text-muted-foreground`,children:e.label}),(0,F.jsx)(`dd`,{className:`min-w-0 break-words font-mono text-foreground/85`,children:e.value})]},e.id))})}),(0,F.jsx)(d,{initial:!1,children:A?(0,F.jsxs)(o.div,{initial:y?{opacity:0}:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0},transition:{duration:y?.12:.22,ease:u},className:`flex flex-wrap items-center gap-2 border-t border-border/60 px-4 py-3`,children:[(0,F.jsx)(o.button,{type:`button`,onClick:h,whileTap:y?void 0:{scale:.97},transition:a,className:`rounded-xl bg-foreground px-3 py-1.5 text-xs font-medium text-background outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,children:`Allow once`}),g?(0,F.jsx)(o.button,{type:`button`,onClick:g,whileTap:y?void 0:{scale:.97},transition:a,className:`rounded-xl border border-border/60 bg-background px-3 py-1.5 text-xs font-medium text-foreground outline-none transition-colors hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring`,children:`Always allow`}):null,(0,F.jsx)(`button`,{type:`button`,onClick:_,className:`rounded-xl px-3 py-1.5 text-xs font-medium text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring`,children:`Deny`})]}):null})]})}function Q(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}function Hl(e){let t=Q(e);if(t)return t;if(typeof e==`string`)try{return Q(JSON.parse(e))}catch{return}}function $(e,...t){for(let n of t){let t=e?.[n];if(typeof t==`string`&&t.trim())return t}}function Ul(e,...t){for(let n of t){let t=e?.[n];if(typeof t==`number`&&Number.isFinite(t))return t;if(typeof t==`string`&&t.trim()){let e=Number(t);if(Number.isFinite(e))return e}}}function Wl(e,...t){for(let n of t){let t=e?.[n];if(typeof t==`boolean`)return t}}function Gl(e){if(typeof e==`string`)return e;if(e==null)return``;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function Kl(e){return e.output!==void 0&&e.output!==null?e.output:e.result}function ql(e){let t=Hl(e),n=Hl(t?.details),r={...t??{},...n??{}},i=r.result,a=$(r,`stdout`,`standardOutput`,`standard_output`),o=$(r,`stderr`,`standardError`,`standard_error`),s=r.error??r.errorMessage??r.evalue,c=s===void 0?void 0:Gl(s),l=Ul(r,`durationMs`,`duration_ms`,`duration`),u=Wl(r,`kernelRestarted`,`kernel_restarted`),d=new Set([`stdout`,`stderr`,`standardOutput`,`standard_output`,`standardError`,`standard_error`,`error`,`errorMessage`,`evalue`,`durationMs`,`duration_ms`,`duration`,`kernelRestarted`,`kernel_restarted`,`status`,`isError`]),f=Object.keys(r).some(e=>!d.has(e));return{record:t,details:n,stdout:a,stderr:o,result:i,error:c,durationMs:l,kernelRestarted:u,structured:!a&&!o&&!c&&(typeof i==`object`&&!!i||f)}}function Jl(e,t){let n=[];if(e.stdout&&n.push({label:`stdout`,content:e.stdout,language:`text`}),e.stderr&&n.push({label:`stderr`,content:e.stderr,language:`text`}),e.result!==void 0&&n.push({label:`result`,content:Gl(e.result),language:typeof e.result==`object`&&e.result!==null?`json`:`text`}),e.error&&n.push({label:`error`,content:e.error,language:`text`}),n.length>0)return n;let r=e.details??e.record;if(r){let e={...r};if(delete e.details,delete e.isError,Object.keys(e).length>0)return[{label:`result`,content:Gl(e),language:`json`}]}let i=Gl(t);return i.trim()?[{label:`output`,content:i,language:`text`}]:[]}function Yl(e,t){return Jl(e,t).map(e=>`${e.label}\n${e.content}`).join(`
|
|
1391
|
+
`),i=Math.max(n.length,r.length),a=0,o=0;for(let e=0;e<i;e++)n[e]!==void 0&&r[e]!==void 0?n[e]!==r[e]&&(o++,a++):n[e]===void 0?r[e]!==void 0&&a++:o++;return{addedLines:a,removedLines:o}}var _l={"tool-Task":{icon:ue,title:e=>{let t=e.state!==`output-available`&&e.state!==`output-error`,n=e.input?.subagent_type||`Agent`;return t?`Running ${n}`:`${n} completed`},subtitle:e=>{let t=e.input?.description||``;return t.length>50?`${t.slice(0,47)}...`:t},variant:`simple`},"tool-Agent":{icon:ue,title:e=>{let t=e.state!==`output-available`&&e.state!==`output-error`,n=e.input?.subagent_type||`Agent`;return t?`Running ${n}`:`${n} completed`},subtitle:e=>{let t=e.input?.description||``;return t.length>50?`${t.slice(0,47)}...`:t},variant:`simple`},"tool-Skill":{icon:ue,title:()=>`Skill`,subtitle:e=>e.input?.skill||``,variant:`simple`},"tool-Grep":{icon:me,title:e=>{if(e.state!==`output-available`&&e.state!==`output-error`)return`Grepping`;let t=e.output?.numFiles||0;return t>0?`Grepped ${t} files`:`No matches`},subtitle:e=>{let t=e.input?.pattern||``,n=e.input?.path||``;if(n){let e=`${t} in ${hl(n)}`;return e.length>40?`${e.slice(0,37)}...`:e}return t.length>40?`${t.slice(0,37)}...`:t},variant:`simple`},"tool-Glob":{icon:Fe,title:e=>{if(e.state!==`output-available`&&e.state!==`output-error`)return`Exploring files`;let t=e.output?.numFiles||0;return t>0?`Found ${t} files`:`No files found`},subtitle:e=>{let t=e.input?.pattern||``;return t.length>40?`${t.slice(0,37)}...`:t},variant:`simple`},"tool-Read":{icon:de,title:e=>e.state!==`output-available`&&e.state!==`output-error`?`Reading`:`Read`,subtitle:e=>{let t=e.input?.file_path||``;return t&&t.split(`/`).pop()||``},variant:`simple`},"tool-Edit":{icon:te,title:e=>{let t=e.input?.file_path||``;return t&&t.split(`/`).pop()||`Edit`},subtitle:e=>{if(e.state!==`output-available`&&e.state!==`output-error`)return``;let t=e.input?.old_string||``,n=e.input?.new_string||``;if(!t&&!n)return``;if(t!==n){let{addedLines:e,removedLines:r}=gl(t,n);return`+${e} -${r}`}return``},variant:`simple`},"tool-Write":{icon:Pe,title:()=>`Create`,subtitle:e=>{let t=e.input?.file_path||``;return t&&t.split(`/`).pop()||``},variant:`simple`},"tool-Bash":{icon:he,title:e=>e.state!==`output-available`&&e.state!==`output-error`?`Running command`:`Ran command`,subtitle:e=>{let t=e.input?.command||``;if(!t)return``;let n=t.replace(/\\\s*\n\s*/g,` `).trim();return n=n.replace(/\/(?:Users|home|root)\/[^\s"']+/g,e=>hl(e)),n.length>50?`${n.slice(0,47)}...`:n},variant:`simple`},"tool-IPython":{icon:te,title:e=>e.state!==`output-available`&&e.state!==`output-error`?`Running cell`:`Ran cell`,subtitle:e=>{let t=e.input?.code||``;if(!t)return``;let n=t.split(`
|
|
1392
|
+
`,1)[0].trim();return n.length>50?`${n.slice(0,47)}...`:n},variant:`simple`},"tool-WebFetch":{icon:le,title:e=>e.state!==`output-available`&&e.state!==`output-error`?`Fetching`:`Fetched`,subtitle:e=>{let t=e.input?.url||``;try{return new URL(t).hostname.replace(`www.`,``)}catch{return t.slice(0,30)}},variant:`simple`},"tool-WebSearch":{icon:me,title:e=>e.state!==`output-available`&&e.state!==`output-error`?`Searching web`:`Searched web`,subtitle:e=>{let t=e.input?.query||``;return t.length>40?`${t.slice(0,37)}...`:t},variant:`collapsible`},"tool-TodoWrite":{icon:S,title:e=>{let t=e.state!==`output-available`&&e.state!==`output-error`,n=e.input?.action||`update`;return t?n===`add`?`Adding todo`:`Updating todos`:n===`add`?`Added todo`:`Updated todos`},subtitle:e=>{let t=e.input?.todos||[];return t.length===0?``:`${t.length} ${t.length===1?`item`:`items`}`},variant:`simple`},"tool-PlanWrite":{icon:ue,title:e=>{let t=e.state!==`output-available`&&e.state!==`output-error`,n=e.input?.action||`create`;if(t)return n===`create`?`Creating plan`:n===`approve`?`Approving plan`:`Updating plan`;let r=e.input?.plan?.status;return r===`awaiting_approval`?`Plan ready for review`:r===`approved`?`Plan approved`:r===`completed`?`Plan completed`:n===`create`?`Created plan`:`Updated plan`},variant:`simple`},"tool-ExitPlanMode":{icon:b,title:e=>e.state!==`output-available`&&e.state!==`output-error`?`Finishing plan`:`Plan complete`,variant:`simple`},"tool-NotebookEdit":{icon:te,title:e=>e.state!==`output-available`&&e.state!==`output-error`?`Editing notebook`:`Edited notebook`,subtitle:e=>{let t=e.input?.file_path||``;return t&&t.split(`/`).pop()||``},variant:`simple`},"tool-BashOutput":{icon:he,title:e=>e.state!==`output-available`&&e.state!==`output-error`?`Getting output`:`Command output`,subtitle:e=>{let t=e.output;if(typeof t==`string`&&t.trim())return t.trim();let n=e.input?.command||``;if(!n)return``;let r=n.replace(/\\\s*\n\s*/g,` `).trim();return r=r.replace(/\/(?:Users|home|root)\/[^\s"']+/g,e=>hl(e)),r.length>50?`${r.slice(0,47)}...`:r},variant:`simple`},"tool-KillShell":{icon:M,title:e=>e.state!==`output-available`&&e.state!==`output-error`?`Stopping shell`:`Shell stopped`,subtitle:e=>{let t=e.input?.pid;return typeof t==`number`?`pid ${t}`:``},variant:`simple`},"tool-cloning":{icon:fe,title:e=>e.state!==`output-available`&&e.state!==`output-error`?`Cloning repo`:`Repo cloned`,subtitle:e=>e.input?.repo??``,variant:`simple`},"tool-Thinking":{icon:ue,title:e=>e.state!==`output-available`&&e.state!==`output-error`?`Thinking...`:`Thought`,variant:`collapsible`}},vl=`tool-mcp__`,yl={"tool-ListMcpResources":{serverName:`mcp`,toolName:`list_resources`,displayName:`List Resources`,category:`list`},"tool-ListMcpResourcesTool":{serverName:`mcp`,toolName:`list_resources`,displayName:`List Resources`,category:`list`},"tool-ReadMcpResource":{serverName:`mcp`,toolName:`read_resource`,displayName:`Read Resource`,category:`get`},"tool-ReadMcpResourceTool":{serverName:`mcp`,toolName:`read_resource`,displayName:`Read Resource`,category:`get`}};function bl(e){let t=yl[e];if(t)return t;if(!e.startsWith(vl))return null;let n=e.slice(10),r=n.indexOf(`__`);if(r===-1)return null;let i=n.slice(0,r),a=n.slice(r+2);return{serverName:i,toolName:a,displayName:a.replace(/_/g,` `).replace(/\b\w/g,e=>e.toUpperCase()).trim(),category:`other`}}function xl(e,t){return`${e} ${e===1?t:`${t}s`}`}function Sl(e){if(e.length===0)return``;let t=new Set([`tool-Read`,`tool-Edit`,`tool-Write`]),n=new Set([`tool-Search`,`tool-Grep`,`tool-Glob`,`tool-WebSearch`]),r=new Set([`tool-Bash`]),i=0,a=0,o=0;for(let s of e)t.has(s.type)?i+=1:n.has(s.type)?a+=1:r.has(s.type)&&(o+=1);let s=[];return i>0&&s.push(xl(i,`file`)),a>0&&s.push(`${a} ${a===1?`search`:`searches`}`),o>0&&s.push(xl(o,`command`)),s.length===0?``:s.length===1?s[0]:s.length===2?`${s[0]} and ${s[1]}`:`${s.slice(0,-1).join(`, `)}, and ${s[s.length-1]}`}function Cl(e){let t=new Set([`tool-Read`,`tool-Edit`,`tool-Write`]),n=new Set([`tool-Search`,`tool-Grep`,`tool-Glob`,`tool-WebSearch`]),r=0,i=0;for(let a of e)t.has(a.type)?r+=1:n.has(a.type)&&(i+=1);return{fileCount:r,searchCount:i}}function wl(e,t){let n=[];return e>0&&n.push(xl(e,`file`)),t>0&&n.push(`${t} ${t===1?`search`:`searches`}`),n.join(`, `)}var Tl=(0,P.memo)(function({part:e,nestedTools:t=[],chatStatus:n,completeLabel:r,shimmerLabel:a,interruptedLabel:o,maxVisibleTools:s=5,defaultOpen:c,showElapsed:l=!0}){let{isPending:u,isInterrupted:d}=Gc(e,n),f=e.input?.description||``,[p,m]=(0,P.useState)(c??!1),[h,g]=(0,P.useState)(0),_=e.callProviderMetadata?.custom?.startedAt??e.startedAt,v=t.length>0,y=e.toolCallId??e.id??``,b=e.output?.totalDurationMs||e.output?.duration||e.output?.duration_ms,x=Math.max(1,s)*28,S=u?Math.max(h,0):t.length,C=(0,P.useRef)(u),w=(0,P.useRef)(!1),T=(0,P.useRef)(null),{fileCount:E,searchCount:D}=(0,P.useMemo)(()=>Cl(u?t.slice(0,Math.max(h,0)):t),[u,t,h]),O=wl(E,D),k=(0,P.useRef)(null),A=ml(_,u);(0,P.useEffect)(()=>{let e=C.current;return T.current&&=(window.clearTimeout(T.current),null),u&&!e&&!w.current&&c!==!1&&(m(!1),T.current=window.setTimeout(()=>{m(!0)},60)),!u&&e&&(m(!1),w.current=!1),C.current=u,()=>{T.current&&=(window.clearTimeout(T.current),null)}},[c,u]),(0,P.useEffect)(()=>{if(!u||t.length===0){g(t.length);return}let e=1;g(Math.min(e,t.length));let n=setInterval(()=>{e+=1,g(Math.min(e,t.length)),e>=t.length&&clearInterval(n)},450);return()=>clearInterval(n)},[u,t.length,y]),(0,P.useEffect)(()=>{!u||!k.current||(k.current.scrollTop=k.current.scrollHeight)},[u,h]);let j=(()=>{if(u&&v)return O;if(!u&&v){let e=Sl(t);if(e)return e}return f?f.length>60?`${f.slice(0,57)}...`:f:``})(),M=Wc(!u&&b?b:A);return d&&!e.output?(0,F.jsx)(Ic,{completeLabel:o,isAnimating:!1}):(0,F.jsx)(Ic,{completeLabel:r,shimmerLabel:a,isAnimating:u,detail:j,expandable:v,expanded:p,onToggleExpand:()=>{w.current=!0,m(e=>!e)},trailingContent:l&&M?(0,F.jsx)(`span`,{className:`shrink-0 font-normal text-muted-foreground/60 tabular-nums`,children:M}):void 0,children:(0,F.jsxs)(`div`,{className:`relative`,children:[u&&p&&S>4&&(0,F.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 top-0 z-10 h-10 bg-linear-to-b from-background to-transparent`}),(0,F.jsx)(`div`,{ref:k,className:i(t.length>1?`flex flex-col gap-2`:void 0,u&&p&&S>4&&`overflow-y-auto`),style:u&&p&&S>4?{height:`${x}px`}:void 0,children:(u?t.slice(0,Math.max(h,0)):t).map((e,t)=>{let r=u?{...e,state:t===h-1?`input-streaming`:`output-available`}:e,i=_l[r.type];if(!i)return null;let{isPending:a,isError:o}=Gc(r,n);return(0,F.jsx)(Lc,{icon:i.icon,title:i.title(r),subtitle:i.subtitle?.(r),isPending:a,isError:o},r.toolCallId??r.id??`${r.type}-${i.title(r)}`)})})]})})});function El(e,t){if(e.state===`input-streaming`)return`streaming`;if(e.state===`output-available`)return`success`;if(e.state===`output-error`)return`error`;let{isPending:n}=Gc(e,t);return n?`pending`:`success`}var Dl=(0,P.memo)(function({part:e,nestedTools:t,chatStatus:n,toolRenderers:r}){let i=e.type;switch(i){case`tool-Bash`:return(0,F.jsx)(We,{part:e});case`tool-IPython`:return(0,F.jsx)(se,{part:e});case`tool-Edit`:case`tool-Write`:return(0,F.jsx)(Fc,{part:e});case`tool-WebSearch`:case`tool-Grep`:case`tool-Glob`:return(0,F.jsx)(ol,{part:e});case`tool-PlanWrite`:return(0,F.jsx)(rl,{part:e,chatStatus:n});case`tool-TodoWrite`:return(0,F.jsx)(pl,{part:e,chatStatus:n});case`tool-Question`:return(0,F.jsx)(Ve,{part:e,chatStatus:n});case`tool-Task`:case`tool-Agent`:{let r=e.type===`tool-Agent`?`Agent`:`Task`;return(0,F.jsx)(Tl,{part:e,nestedTools:t,chatStatus:n,completeLabel:`${r} completed`,shimmerLabel:`Running ${r.toLowerCase()}`,interruptedLabel:`${r} interrupted`,defaultOpen:!1})}case`tool-Thinking`:return null}let a=bl(i);if(a){if(r){let t=r[a.toolName];if(t)return(0,F.jsx)(t,{name:a.toolName,input:e.input??{},output:e.output?Qc(e.output):void 0,status:El(e,n)})}return(0,F.jsx)(el,{part:e,mcpInfo:a,chatStatus:n})}if(r&&i.startsWith(`tool-`)){let t=i.slice(5),a=r[t];if(a)return(0,F.jsx)(a,{name:t,input:e.input??{},output:e.output??e.result,status:El(e,n)})}let o=_l[i];if(o){let{isPending:t,isError:r}=Gc(e,n);return(0,F.jsx)(Lc,{title:o.title(e),subtitle:o.subtitle?.(e),isPending:t,isError:r})}let s=i.startsWith(`tool-`)?i.slice(5):i,{isPending:c,isError:l}=Gc(e,n);return(0,F.jsx)(Lc,{title:c?`Running ${s}`:s,isPending:c,isError:l})}),Ol={queued:`Waiting to generate`,generating:`Generating image`,refining:`Refining details`,complete:`Image ready`,error:`Generation failed`},kl={queued:{filter:`blur(4px) saturate(0.75)`,opacity:0,scale:1.02},generating:{filter:`blur(3px) saturate(0.85)`,opacity:0,scale:1.015},refining:{filter:`blur(1.5px) saturate(0.95)`,opacity:.62,scale:1.005},complete:{filter:`blur(0px) saturate(1)`,opacity:1,scale:1},error:{filter:`blur(2px) saturate(0.5)`,opacity:.28,scale:1}},Al={queued:1,generating:1,refining:.48,complete:0,error:0},jl=10,Ml=Math.PI*2;function Nl({status:e,reduce:t}){return e===`complete`?(0,F.jsx)(C,{"aria-hidden":`true`,className:`size-3.5`}):e===`error`?(0,F.jsx)(O,{"aria-hidden":`true`,className:`size-3.5`}):(0,F.jsxs)(o.span,{"aria-hidden":`true`,animate:t?void 0:{rotate:360},transition:{duration:2.4,ease:c,repeat:1/0},className:`grid size-3.5 grid-cols-2 place-items-center gap-0.5`,children:[(0,F.jsx)(`span`,{className:`size-1 rounded-[1px] bg-current`}),(0,F.jsx)(`span`,{className:`size-1 rounded-[1px] bg-current opacity-55`}),(0,F.jsx)(`span`,{className:`size-1 rounded-[1px] bg-current opacity-55`}),(0,F.jsx)(`span`,{className:`size-1 rounded-[1px] bg-current`})]})}function Pl({interactive:e,reduce:t,status:n}){let r=y(),i=(0,P.useRef)(null);return(0,P.useEffect)(()=>{let n=i.current,a=n?.getContext(`2d`);if(!n||!a)return;let o=0,s=0,c=0,l=`currentColor`,u={x:0,y:0,targetX:0,targetY:0,inside:!1},d=e&&r&&!t,f=()=>{let e=n.getBoundingClientRect();s=e.width||n.clientWidth||208,c=e.height||n.clientHeight||208;let t=Math.min(window.devicePixelRatio||1,2);n.width=Math.round(s*t),n.height=Math.round(c*t),a.setTransform(t,0,0,t,0,0),l=window.getComputedStyle(n).color,u.x=s/2,u.y=c/2,u.targetX=u.x,u.targetY=u.y},p=e=>{a.clearRect(0,0,s,c),u.inside||(u.targetX=s/2+(t?0:Math.sin(e/1700)*s*.12),u.targetY=c/2+(t?0:Math.cos(e/2100)*c*.1));let n=t?1:u.inside?.16:.045;u.x+=(u.targetX-u.x)*n,u.y+=(u.targetY-u.y)*n;let r=Math.min(s,c)*.38,i=Math.ceil(s/jl)+1,d=Math.ceil(c/jl)+1,f=(s-(i-1)*jl)/2,m=(c-(d-1)*jl)/2;a.fillStyle=l;for(let e=0;e<d;e+=1)for(let t=0;t<i;t+=1){let n=f+t*jl,i=m+e*jl,o=n-u.x,s=i-u.y,c=Math.hypot(o,s),l=Math.max(0,1-c/r),d=l*l*(3-2*l),p=d*d*9,h=c>0?o/c:0,g=c>0?s/c:0,_=n+h*p,v=i+g*p,y=.65+d*.85;a.globalAlpha=.17+d*.72,a.beginPath(),a.arc(_,v,y,0,Ml),a.fill()}a.globalAlpha=1,t||(o=window.requestAnimationFrame(p))},m=e=>{if(!d)return;let t=n.getBoundingClientRect();u.inside=!0,u.targetX=e.clientX-t.left,u.targetY=e.clientY-t.top},h=()=>{u.inside=!1},g=typeof ResizeObserver>`u`?null:new ResizeObserver(f);return f(),g?.observe(n),n.addEventListener(`pointermove`,m,{passive:!0}),n.addEventListener(`pointerleave`,h),p(0),()=>{o&&window.cancelAnimationFrame(o),g?.disconnect(),n.removeEventListener(`pointermove`,m),n.removeEventListener(`pointerleave`,h)}},[r,e,t]),(0,F.jsx)(o.div,{"aria-hidden":`true`,initial:!1,animate:{opacity:Al[n]},transition:{duration:t?0:.4,ease:u},className:`absolute inset-0 overflow-hidden bg-muted`,children:(0,F.jsx)(`canvas`,{ref:i,className:`absolute inset-0 size-full text-foreground`})})}function Fl({children:e,status:t=`generating`,label:n,prompt:r,resolution:s=`1024 × 1024`,aspectRatio:c=`1 / 1`,size:l=`compact`,interactive:p=!0,statusText:m,showStatus:h=!0,onRetry:g,className:_,mediaClassName:v,statusClassName:y}){let b=f()??!1,x=t===`queued`||t===`generating`||t===`refining`,S=kl[t],C=m??Ol[t],w=n??(r?`${C}: ${r}`:C);return(0,F.jsx)(`div`,{"data-slot":`image-generation`,"data-state":t,"aria-busy":x,className:i(`w-full`,_),children:(0,F.jsxs)(`div`,{className:i(`w-full`,l===`compact`&&`mx-auto max-w-52`),children:[(0,F.jsxs)(`div`,{role:`img`,"aria-label":w,style:{aspectRatio:c},className:`relative isolate w-full overflow-hidden rounded-xl bg-muted`,children:[(0,F.jsx)(o.div,{"aria-hidden":!e||void 0,initial:!1,animate:b?{opacity:S.opacity}:{filter:S.filter,opacity:S.opacity,scale:S.scale},transition:b?{duration:0}:{duration:.4,ease:u},className:i(`absolute inset-0 [&>*]:size-full [&>*]:object-cover [&_img]:size-full [&_img]:object-cover`,v),children:e}),(0,F.jsx)(d,{initial:!1,children:x?(0,F.jsx)(o.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:b?0:.25,ease:u},className:`absolute inset-0`,children:(0,F.jsx)(Pl,{interactive:p,reduce:b,status:t})},`dither-field`):null}),s?(0,F.jsx)(`span`,{className:`absolute top-2 right-2 z-10 rounded-full bg-background/75 px-2 py-0.5 font-mono text-micro tabular-nums text-muted-foreground`,children:s}):null]}),(0,F.jsx)(d,{initial:!1,children:h||r?(0,F.jsxs)(o.div,{initial:!1,className:`mt-3 text-left`,children:[(0,F.jsxs)(`div`,{"aria-live":`polite`,className:i(h?`flex min-h-5 items-center gap-2`:`contents`,`text-sm font-medium text-foreground`,t===`error`&&`text-destructive`,y),children:[h?(0,F.jsx)(Nl,{status:t,reduce:b}):null,(0,F.jsx)(d,{mode:`popLayout`,initial:!1,children:h?(0,F.jsx)(o.span,{initial:!b&&{opacity:0,y:4},animate:{opacity:1,y:0},exit:b?void 0:{opacity:0,y:-4},transition:{duration:b?0:.15,ease:u},children:C},C):null})]}),r?(0,F.jsxs)(`p`,{className:`mt-0.5 truncate text-xs text-muted-foreground`,children:[`“`,r,`”`]}):null]},`status-block`):null}),t===`error`&&g?(0,F.jsxs)(o.button,{type:`button`,onClick:g,whileTap:b?void 0:{scale:.96},transition:a,className:`mt-3 inline-flex min-h-10 items-center gap-2 rounded-full px-3 text-sm font-medium text-foreground outline-none transition-colors hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring`,children:[(0,F.jsx)(pe,{"aria-hidden":`true`,className:`size-4`}),`Try again`]}):null]})})}function Il({steps:e,activeIndex:t,className:n,...r}){let a=e.length,o=ke(t,a),s=o>=a,c=Ae(o,a);return(0,F.jsxs)(`div`,{"data-slot":`agent-plan`,className:i(`flex w-full max-w-sm flex-col gap-3`,n),...r,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,F.jsx)(`span`,{className:`text-body font-medium`,children:`Plan`}),(0,F.jsxs)(`span`,{className:i(je,`text-foreground/35 tabular-nums`),children:[o,` of `,a]})]}),(0,F.jsx)(`div`,{className:`bg-foreground/[0.06] h-[3px] w-full overflow-hidden rounded-full`,children:(0,F.jsx)(`span`,{className:`bg-foreground/80 block h-full rounded-full transition-[width] duration-500`,style:{width:`${c}%`}})}),(0,F.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:e.map((e,t)=>{let n=s||t<o,r=!s&&t===o;return(0,F.jsxs)(`li`,{className:`flex items-center gap-2.5 text-body`,children:[(0,F.jsx)(`span`,{className:`flex size-4 shrink-0 items-center justify-center`,children:n?(0,F.jsx)(C,{className:`text-foreground/35 size-3.5`}):r?(0,F.jsx)(j,{className:`text-foreground/90 size-3.5 animate-spin motion-reduce:animate-none`}):(0,F.jsx)(`span`,{"aria-hidden":!0,className:`bg-foreground/15 size-1.5 rounded-full`})}),(0,F.jsx)(`span`,{className:i(n&&`text-foreground/40`,r&&`text-foreground/90`,!n&&!r&&`text-foreground/35`),children:e})]},e)})})]})}function Ll(e){if(e.length===0)return;let t=e.flatMap(e=>{let t=e.title.trim();return t?[t]:[]});if(t.length!==e.length)return;let n=0;for(;n<e.length&&e[n]?.status===`completed`;)n+=1;if(!e.slice(n+1).some(e=>e.status===`completed`))return{steps:t,activeIndex:n}}function Rl({presentation:e,className:t}){return(0,F.jsx)(Il,{steps:e.steps,activeIndex:e.activeIndex,"aria-label":`Plan progress: ${Math.min(e.activeIndex,e.steps.length)} of ${e.steps.length} steps completed`,className:t})}function zl(e){return e===`approving`?`Approving`:e===`approved`?`Approved`:e===`denied`?`Denied`:e===`running`?`Running`:e===`complete`?`Completed`:e===`error`?`Failed`:`Approval required`}function Bl(e){return e===`pending`?`border-amber-500/30 bg-amber-500/10 text-amber-600 dark:text-amber-400`:e===`approving`||e===`running`?`border-primary/30 bg-primary/10 text-primary`:e===`approved`||e===`complete`?`border-emerald-500/30 bg-emerald-500/10 text-emerald-600 dark:text-emerald-400`:`border-rose-500/30 bg-rose-500/10 text-rose-600 dark:text-rose-400`}function Vl({tool:e,title:t=`Allow this tool to run?`,description:n,parameters:r=[],status:c=`pending`,open:l,defaultOpen:p=!1,onOpenChange:m,onApprove:h,onAlwaysAllow:g,onDeny:_,className:v}){let y=f()??!1,b=`${(0,P.useId)()}-details`,x=(0,P.useRef)(c),[S,T]=(0,P.useState)(p),E=l??S,D=(0,P.useCallback)(e=>{l===void 0&&T(e),m?.(e)},[m,l]),k=c===`approving`||c===`running`,A=c===`pending`,M=c===`error`;return(0,P.useEffect)(()=>{x.current===`pending`&&c!==`pending`&&D(!1),x.current=c},[D,c]),(0,F.jsxs)(`div`,{"data-state":c,"aria-busy":k,className:i(`w-full overflow-hidden rounded-2xl border border-border/60 bg-muted/20 text-sm`,v),children:[(0,F.jsxs)(`div`,{className:`flex items-start gap-3 p-4`,children:[(0,F.jsx)(`span`,{"aria-hidden":`true`,className:i(`mt-0.5 grid size-8 shrink-0 place-items-center rounded-xl border border-border/60 bg-background text-muted-foreground`,M&&`text-destructive`),children:k?(0,F.jsx)(j,{className:i(`size-4`,!y&&`animate-spin`)}):M?(0,F.jsx)(O,{className:`size-4`}):c===`denied`?(0,F.jsx)(_e,{className:`size-4`}):c===`approved`||c===`complete`?(0,F.jsx)(C,{className:`size-4`}):(0,F.jsx)(ce,{className:`size-4`})}),(0,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,F.jsxs)(`div`,{className:`flex min-w-0 items-start justify-between gap-3`,children:[(0,F.jsxs)(`div`,{className:`min-w-0`,children:[(0,F.jsx)(`div`,{className:`font-medium text-foreground`,children:t}),(0,F.jsx)(`div`,{className:`mt-0.5 truncate font-mono text-xs text-muted-foreground`,children:e})]}),(0,F.jsx)(`span`,{className:i(`shrink-0 rounded-full border px-2 py-0.5 text-caption font-medium transition-colors`,Bl(c)),children:zl(c)})]}),n?(0,F.jsx)(`p`,{className:`mt-2 leading-5 text-muted-foreground`,children:n}):null,r.length?(0,F.jsxs)(`button`,{type:`button`,"aria-expanded":E,"aria-controls":b,onClick:()=>D(!E),className:`mt-2 inline-flex items-center gap-1 rounded-md text-xs font-medium text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring`,children:[`View details`,(0,F.jsx)(o.span,{"aria-hidden":`true`,animate:{rotate:E?180:0},transition:y?{duration:0}:s,children:(0,F.jsx)(w,{className:`size-3.5`})})]}):null]})]}),(0,F.jsx)(ne,{id:b,open:E,children:(0,F.jsx)(`dl`,{className:`mx-4 mb-4 grid gap-2 rounded-xl border border-border/50 bg-background/70 p-3`,children:r.map(e=>(0,F.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,7rem)_minmax(0,1fr)] items-center gap-3 text-xs`,children:[(0,F.jsx)(`dt`,{className:`text-muted-foreground`,children:e.label}),(0,F.jsx)(`dd`,{className:`min-w-0 break-words font-mono text-foreground/85`,children:e.value})]},e.id))})}),(0,F.jsx)(d,{initial:!1,children:A?(0,F.jsxs)(o.div,{initial:y?{opacity:0}:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0},transition:{duration:y?.12:.22,ease:u},className:`flex flex-wrap items-center gap-2 border-t border-border/60 px-4 py-3`,children:[(0,F.jsx)(o.button,{type:`button`,onClick:h,whileTap:y?void 0:{scale:.97},transition:a,className:`rounded-xl bg-foreground px-3 py-1.5 text-xs font-medium text-background outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,children:`Allow once`}),g?(0,F.jsx)(o.button,{type:`button`,onClick:g,whileTap:y?void 0:{scale:.97},transition:a,className:`rounded-xl border border-border/60 bg-background px-3 py-1.5 text-xs font-medium text-foreground outline-none transition-colors hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring`,children:`Always allow`}):null,(0,F.jsx)(`button`,{type:`button`,onClick:_,className:`rounded-xl px-3 py-1.5 text-xs font-medium text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring`,children:`Deny`})]}):null})]})}function Q(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}function Hl(e){let t=Q(e);if(t)return t;if(typeof e==`string`)try{return Q(JSON.parse(e))}catch{return}}function $(e,...t){for(let n of t){let t=e?.[n];if(typeof t==`string`&&t.trim())return t}}function Ul(e,...t){for(let n of t){let t=e?.[n];if(typeof t==`number`&&Number.isFinite(t))return t;if(typeof t==`string`&&t.trim()){let e=Number(t);if(Number.isFinite(e))return e}}}function Wl(e,...t){for(let n of t){let t=e?.[n];if(typeof t==`boolean`)return t}}function Gl(e){if(typeof e==`string`)return e;if(e==null)return``;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function Kl(e){return e.output!==void 0&&e.output!==null?e.output:e.result}function ql(e){let t=Hl(e),n=Hl(t?.details),r={...t??{},...n??{}},i=r.result,a=$(r,`stdout`,`standardOutput`,`standard_output`),o=$(r,`stderr`,`standardError`,`standard_error`),s=r.error??r.errorMessage??r.evalue,c=s===void 0?void 0:Gl(s),l=Ul(r,`durationMs`,`duration_ms`,`duration`),u=Wl(r,`kernelRestarted`,`kernel_restarted`),d=new Set([`stdout`,`stderr`,`standardOutput`,`standard_output`,`standardError`,`standard_error`,`error`,`errorMessage`,`evalue`,`durationMs`,`duration_ms`,`duration`,`kernelRestarted`,`kernel_restarted`,`status`,`isError`]),f=Object.keys(r).some(e=>!d.has(e));return{record:t,details:n,stdout:a,stderr:o,result:i,error:c,durationMs:l,kernelRestarted:u,structured:!a&&!o&&!c&&(typeof i==`object`&&!!i||f)}}function Jl(e,t){let n=[];if(e.stdout&&n.push({label:`stdout`,content:e.stdout,language:`text`}),e.stderr&&n.push({label:`stderr`,content:e.stderr,language:`text`}),e.result!==void 0&&n.push({label:`result`,content:Gl(e.result),language:typeof e.result==`object`&&e.result!==null?`json`:`text`}),e.error&&n.push({label:`error`,content:e.error,language:`text`}),n.length>0)return n;let r=e.details??e.record;if(r){let e={...r};if(delete e.details,delete e.isError,Object.keys(e).length>0)return[{label:`result`,content:Gl(e),language:`json`}]}let i=Gl(t);return i.trim()?[{label:`output`,content:i,language:`text`}]:[]}function Yl(e,t){return Jl(e,t).map(e=>`${e.label}\n${e.content}`).join(`
|
|
1393
1393
|
|
|
1394
1394
|
`)}function Xl(e){return Hl(e.input)??Hl(e.args)}function Zl(e,...t){for(let n of t){let t=e?.[n];if(Array.isArray(t))return t}}function Ql(e,t){return $(t.details??t.record,`diff`,`patch`)??$(e,`diff`,`patch`)}function $l(e,t){return $(e,`path`,`filePath`,`filename`,`file`)??$(t.details??t.record,`path`,`filePath`,`filename`,`file`)??`workspace file`}function eu(e){return e.split(`
|
|
1395
1395
|
`).map((e,t)=>({id:`${t}-${e.slice(0,16)}`,type:e.startsWith(`+`)&&!e.startsWith(`+++`)?`added`:e.startsWith(`-`)&&!e.startsWith(`---`)?`removed`:`context`,content:e}))}function tu(e,t){let n=t.details??t.record,r=Hl(e?.plan)??Hl(n?.plan),i=Zl(e,`todos`)??Zl(r,`todos`,`items`)??Zl(n,`todos`,`newTodos`,`items`);return i?i.flatMap((e,t)=>{let n=Q(e);if(!n)return[];let r=$(n,`content`,`title`,`text`,`label`);if(!r)return[];let i=$(n,`status`),a=i===`in_progress`||i===`in-progress`?`in-progress`:i===`completed`?`completed`:i===`cancelled`?`cancelled`:`pending`;return[{id:`${t}-${r}`,title:r,status:a}]}):[]}function nu(e){let t=Zl(e.details??e.record,`results`,`sources`,`citations`);return t?t.flatMap((e,t)=>{let n=Q(e);if(!n)return[];let r=$(n,`title`,`name`,`snippet`);if(!r)return[];let i=$(n,`url`,`link`),a=i&&D(i)?i:void 0;return[{id:`${t}-${r}`,title:r,url:a,domain:$(n,`domain`,`source`)}]}):[]}function ru(e){return $(e.details??e.record,`url`,`imageUrl`,`image_url`)}function iu(e,t){return Q(e?.approval)??Q(t.details?.approval)??Q(t.record?.approval)}function au(e){let t=typeof e.type==`string`?e.type:`Tool`;return t.startsWith(`tool-`)?t.slice(5):t}function ou(e,t){let n=typeof e.state==`string`?e.state:void 0;return n===`output-error`||n===`error`?`error`:n===`output-available`||n===`complete`||n===`success`?`success`:n===`cancelled`||n===`canceled`||n===`aborted`||n===`interrupted`?`cancelled`:e.error===void 0?n===`input-streaming`||n===`streaming`?t===`streaming`?`running`:`cancelled`:e.output!==void 0||e.result!==void 0?`success`:t===`streaming`?`running`:`cancelled`:`error`}function su(e,t){return t||e.toLowerCase().includes(`json`)?`json`:e.toLowerCase().includes(`bash`)||e.toLowerCase().includes(`shell`)?`bash`:e.toLowerCase().includes(`python`)?`python`:`text`}function cu(e,t){if(!t)return;let n=e.toLowerCase();return n.includes(`bash`)||n.includes(`shell`)?`bash`:n.includes(`python`)?/^\s*%%bash(?:\s|$)/im.test(t)?`bash`:`python`:`text`}function lu(e,t){if(!t)return;let n=e.toLowerCase();return n.includes(`ipython`)?`IPython`:n.includes(`bash`)||n.includes(`shell`)?`Bash`:n.includes(`python`)?`Python`:t===`json`?`JSON`:t===`text`?`Text`:t.toUpperCase()}var uu=new WeakMap;function du(e,t){if(e&&typeof e==`object`){let n=uu.get(e);if(n&&n.chatStatus===t)return n.value;let r=fu(e,t);return uu.set(e,{chatStatus:t,value:r}),r}return fu(e,t)}function fu(e,t){let n=Q(e);if(!n)return;let r=au(n),i=r.toLowerCase(),a=Xl(n),o=Kl(n),s=ql(o),c=ou(n,t),l=$(a,`command`,`cmd`,`code`,`script`),u=cu(r,l),d=[];s.durationMs!==void 0&&d.push(`${s.durationMs}ms`),s.kernelRestarted&&d.push(`kernel restarted`);let f=Ql(a,s),p=i.includes(`todo`)||i.includes(`plan`)?tu(a,s):[],m=i.includes(`search`)||i.includes(`web`)||i.includes(`source`)||i.includes(`citation`)?nu(s):[],h=i.includes(`image`)||i.includes(`generat`)?ru(s):void 0,g=iu(a,s),_=Yl(s,o),v=!!_.trim(),y=typeof n.toolCallId==`string`&&n.toolCallId?n.toolCallId:`${r}-${JSON.stringify(a??{})}`,b;return p.length>0?b={kind:`todo`,title:i.includes(`plan`)?`Plan`:`Todo list`,items:p}:m.length>0?b={kind:`citations`,citations:m}:h?b={kind:`image`,url:h}:f&&(i.includes(`edit`)||i.includes(`write`)||i.includes(`patch`))?b={kind:`diff`,file:$l(a,s),lines:eu(f),copyText:f}:(l||v||g||d.length>0)&&(b={kind:`output`,content:_,language:su(r,s.structured),structured:s.structured,sections:Jl(s,o),sourceCode:l,sourceLanguage:u,sourceLabel:lu(r,u)}),{id:y,name:r,lowerName:i,status:c,input:a,output:o,outputSummary:s,command:l,metadata:d,approval:g,detail:b}}function pu(e){return e.map(e=>({id:String(e.id),title:typeof e.title==`string`?e.title:``,status:e.status===`in-progress`?`in_progress`:e.status===`completed`?`completed`:e.status===`cancelled`?`cancelled`:`pending`}))}function mu(e,t){return t.toLowerCase().includes(`bash`)||t.toLowerCase().includes(`shell`)?(0,F.jsx)(he,{"aria-hidden":`true`,className:`size-4`}):e===`success`?(0,F.jsx)(A,{"aria-hidden":`true`,className:`size-4`}):(0,F.jsx)(ge,{"aria-hidden":`true`,className:`size-4`})}function hu({approval:e,name:t,status:n}){if(!e)return null;let r=n===`running`?`pending`:n===`error`?`error`:`complete`,i=Object.entries(e).flatMap(([e,t])=>typeof t==`object`||typeof t==`function`?[]:[{id:e,label:e,value:String(t)}]);return(0,F.jsx)(Vl,{tool:t,title:`Fleet Prime permission`,description:`This tool reported a permission decision from Fleet Prime.`,parameters:i,status:r})}function gu({code:e,language:t,languageLabel:n,status:r}){return(0,F.jsx)(m,{code:e,language:t,languageLabel:n,status:r===`running`?`streaming`:`complete`,showStatus:!1,maxHeight:160,showLineNumbers:!1,wrap:!0})}var _u=(0,P.memo)(function({part:e,chatStatus:t,fallback:n}){let r=du(e,t);if(!r||r.lowerName===`question`)return n??null;let{detail:i,status:a}=r;if(!i)return n??null;if(i.kind===`todo`){let t=pu(i.items),a=!!e.input?.pendingDecision;if(r.lowerName===`planwrite`&&a)return n??null;let o=r.lowerName===`planwrite`&&e.input?.executing?Ll(t):void 0;return o?(0,F.jsx)(Rl,{presentation:o,className:`mb-2`}):(0,F.jsx)(ul,{items:i.items,title:i.title,defaultOpen:!0,collapseOnComplete:!1,maxHeight:240})}if(i.kind===`citations`)return(0,F.jsx)(x,{citations:i.citations,title:`Sources`,defaultOpen:!0});if(i.kind===`image`)return(0,F.jsx)(Fl,{status:a===`running`?`generating`:a===`error`?`error`:`complete`,children:(0,F.jsx)(`img`,{src:i.url,alt:`Generated result`,width:640,height:320,loading:`lazy`,decoding:`async`,className:`h-auto max-h-80 w-full object-contain`})});if(i.kind===`diff`)return(0,F.jsx)(g,{file:i.file,lines:i.lines,status:a===`running`?`streaming`:`complete`,language:`diff`,maxHeight:240,copyText:i.copyText,defaultOpen:a===`running`});let o=i.content||`No output.`;return(0,F.jsxs)(_,{tool:`Prime`,title:r.name,status:a,kind:r.lowerName.includes(`bash`)||r.lowerName.includes(`shell`)||r.lowerName.includes(`python`)?`terminal`:`custom`,meta:r.metadata.length>0?r.metadata.join(` · `):void 0,icon:mu(a,r.name),defaultOpen:a===`running`,collapseOnComplete:!1,maxHeight:240,copyText:o,children:[i.sourceCode?(0,F.jsx)(gu,{code:i.sourceCode,language:i.sourceLanguage??`text`,languageLabel:i.sourceLabel,status:a}):null,i.sections.map(e=>(0,F.jsx)(h,{language:e.language,label:e.label,children:e.content},e.label)),(0,F.jsx)(hu,{approval:r.approval,name:r.name,status:a})]})}),vu=e({SessionToolRenderer:()=>yu}),yu=(0,P.memo)(function(e){let t=e.part.type;if(t===`tool-Thinking`||t===`tool-FleetReasoning`)return null;let n=(0,F.jsx)(Dl,{...e});return t.startsWith(`tool-`)?(0,F.jsx)(_u,{...e,fallback:n}):n});export{vu as n,yu as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-CwJFpaho.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{t as r}from"./button-Dl0ce3Y5.js";import{t as i}from"./utils-Brtgag-m.js";import{t as a}from"./git-branch-CTq9aACS.js";import{a as o,i as s,o as c,r as l,s as u,t as d}from"./alert-dialog-CYE37KMM.js";var f=e(t(),1),p=n();function m(e,t=0){let n=[];for(let r of e)n.push({node:r,depth:t}),n.push(...m(r.children,t+1));return n}function h({depth:e,isSelected:t,node:n,onSelect:a}){return(0,p.jsxs)(r,{type:`button`,variant:`ghost`,"data-testid":`session-tree-node-${n.id}`,onClick:a,className:i(`h-auto w-full flex-col items-start gap-0.5 rounded-md px-2 py-1.5 text-left font-normal`,t?`bg-foreground/10 ring-1 ring-foreground/15`:`hover:bg-foreground/6`,n.isOnActiveBranch?`text-foreground/90`:`text-foreground/55`),style:{marginLeft:`${e*12}px`,width:`calc(100% - ${e*12}px)`},children:[(0,p.jsxs)(`span`,{className:`flex items-center gap-1.5 text-label leading-5`,children:[n.isLeaf?(0,p.jsx)(`span`,{"aria-hidden":`true`,className:`font-semibold text-foreground`,children:`*`}):null,(0,p.jsx)(`span`,{className:`truncate font-medium`,children:n.preview})]}),(0,p.jsx)(`span`,{className:`truncate font-mono text-caption text-foreground/40`,children:n.id})]})}function g({sessionId:e,snapshot:t,loading:n,error:i,isStreaming:g,selectedEntryId:_,onSelectEntry:v,onRefresh:y,onRewind:b}){let[x,S]=(0,f.useState)(null),[C,w]=(0,f.useState)(null),[T,E]=(0,f.useState)(!1),[D,O]=(0,f.useState)(null),k=(0,f.useRef)(0),A=(0,f.useMemo)(()=>t?m(t.nodes):[],[t]),j=!!((0,f.useMemo)(()=>A.find(e=>e.node.id===_)?.node,[A,_])&&t&&_&&_!==t.leafId&&!g);(0,f.useEffect)(()=>{if(x===null||T||D===null)return;let e=t?.leafId??null;e!==C&&w(e)},[x,T,D,C,t?.leafId]);let M=(0,f.useCallback)(t=>{if(!(!e||t.messageIndex===void 0))return`${e}-m${t.messageIndex}`},[e]),N=(0,f.useCallback)(()=>{k.current+=1,S(null),w(null),O(null),E(!1)},[]);(0,f.useEffect)(()=>{N()},[e,N]);let P=(0,f.useCallback)(async()=>{let e=x,t=C;if(!e)return;let n=++k.current,r=()=>k.current===n;E(!0),O(null);try{await b(e,t),r()&&N()}catch(e){r()&&O(e instanceof Error?e.message:String(e))}finally{r()&&E(!1)}},[N,x,C,b]),F=(0,f.useCallback)(e=>{O(null),S(e),w(t?.leafId??null)},[t?.leafId]);return e?(0,p.jsxs)(`section`,{"aria-label":`Session tree`,className:`flex min-h-0 flex-1 flex-col gap-3`,children:[(0,p.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,p.jsxs)(`div`,{className:`flex items-center gap-2 text-label text-foreground/70`,children:[(0,p.jsx)(a,{className:`size-4`,"aria-hidden":`true`}),(0,p.jsx)(`span`,{children:`Branch history`})]}),(0,p.jsx)(r,{type:`button`,size:`sm`,variant:`outline`,onClick:y,disabled:n,children:`Refresh`})]}),i?(0,p.jsx)(`p`,{className:`rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-label text-destructive`,children:i}):null,g?(0,p.jsx)(`p`,{className:`rounded-md border border-border/60 bg-background px-3 py-2 text-label text-foreground/60`,children:`Finish or stop the current turn before rewinding.`}):null,(0,p.jsxs)(`div`,{"data-testid":`session-tree-list`,className:`flex min-h-0 flex-1 flex-col gap-1 overflow-y-auto rounded-md border border-border/60 bg-background p-2`,children:[n&&A.length===0?(0,p.jsx)(`p`,{className:`px-2 py-3 text-label text-foreground/45`,children:`Loading session tree…`}):null,!n&&A.length===0?(0,p.jsx)(`p`,{className:`px-2 py-3 text-label text-foreground/45`,children:`No branch entries yet.`}):null,A.map(({node:e,depth:t})=>(0,p.jsx)(h,{depth:t,node:e,isSelected:e.id===_,onSelect:()=>v(e.id,M(e))},e.id))]}),(0,p.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,p.jsxs)(`p`,{className:`text-caption text-foreground/45`,children:[(0,p.jsx)(`span`,{"aria-hidden":`true`,children:`*`}),` marks the current leaf on the active branch.`]}),(0,p.jsx)(r,{type:`button`,size:`sm`,disabled:!j,onClick:()=>_&&F(_),children:`Rewind here`})]}),(0,p.jsx)(d,{open:x!==null,onOpenChange:e=>{!e&&!T&&N()},children:(0,p.jsxs)(s,{children:[(0,p.jsx)(u,{children:`Rewind session?`}),(0,p.jsx)(o,{children:`Later turns on the current branch leave the active session. Rewinding to a user turn follows Prime Agent edit-from-here semantics: the leaf moves to that message's parent so you can resend from there.`}),D?(0,p.jsx)(`p`,{className:`rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-label text-destructive`,children:D}):null,(0,p.jsxs)(c,{children:[(0,p.jsx)(l,{disabled:T,children:`Cancel`}),(0,p.jsx)(r,{type:`button`,variant:`destructive`,disabled:T,onClick:()=>void P(),children:T?`Rewinding…`:`Rewind`})]})]})})]}):(0,p.jsx)(`section`,{"aria-label":`Session tree`,className:`flex min-h-36 items-center rounded-md border border-dashed border-border/70 px-4 text-center text-label leading-5 text-foreground/45`,children:`Start or open a session to browse its branch history.`})}export{g as SessionTreePanel};
|