@qredence/fleet 0.5.10 → 0.5.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/web/client/assets/agent-activity-CwMDU7aP.js +1 -0
  3. package/dist/web/client/assets/artifacts-panel-CQmFEF_H.js +1 -0
  4. package/dist/web/client/assets/{chat-command-palette-DfYSPPXI.js → chat-command-palette-CmHTS3rs.js} +1 -1
  5. package/dist/web/client/assets/{chat-C8XDWWXz.js → chat-yh02zgA7.js} +1 -1
  6. package/dist/web/client/assets/{citations-BQ_pr_9_.js → citations-C_tPOJE_.js} +1 -1
  7. package/dist/web/client/assets/{fleet-message-queue-zWM5-y18.js → fleet-message-queue-DUz6Hfrf.js} +1 -1
  8. package/dist/web/client/assets/{fleet-pi-tool-renderer-AJoMbXBa.js → fleet-pi-tool-renderer-BEDIO3al.js} +4 -4
  9. package/dist/web/client/assets/fleet-reasoning-panel-CbkO7u-v.js +1 -0
  10. package/dist/web/client/assets/{fleet-subagent-list-BnRnrWKS.js → fleet-subagent-list-iKUtLJKZ.js} +1 -1
  11. package/dist/web/client/assets/fleet-tool-timeline-C8heL7ae.js +1 -0
  12. package/dist/web/client/assets/{fork-picker-dialog-CkcSekBl.js → fork-picker-dialog-ByBOGVsa.js} +1 -1
  13. package/dist/web/client/assets/globals-B_I1Eq1u.css +2 -0
  14. package/dist/web/client/assets/horizontal-resize-qK6eRhIG.js +1 -0
  15. package/dist/web/client/assets/{index-DlnHLDpx.js → index-C1zOjrMK.js} +3 -3
  16. package/dist/web/client/assets/{ipython-tool-BrMePqD-.js → ipython-tool-ldJ9F1Cw.js} +1 -1
  17. package/dist/web/client/assets/model-selector-list-DsKTuAgS.js +1 -0
  18. package/dist/web/client/assets/{openui-renderer-DwYFJdbe.js → openui-renderer-J3dhPpL4.js} +5 -5
  19. package/dist/web/client/assets/prompt-input-qPIXZ-Rb.js +1 -0
  20. package/dist/web/client/assets/prompt-suggestions-Cc--lSNR.js +1 -0
  21. package/dist/web/client/assets/{provider-label-BCJh04J5.js → provider-label-Dpr7djG9.js} +1 -1
  22. package/dist/web/client/assets/repl-panel-DsPX04Xr.js +1 -0
  23. package/dist/web/client/assets/{resources-panel-Bo8dfUdm.js → resources-panel-D867-goy.js} +1 -1
  24. package/dist/web/client/assets/right-panel-registry-DewpBWHM.js +2 -0
  25. package/dist/web/client/assets/routes-vNkVToAF.js +16 -0
  26. package/dist/web/client/assets/safe-storage-s25GrfpH.js +1 -0
  27. package/dist/web/client/assets/session-insights-panel-YnaXvTpi.js +1 -0
  28. package/dist/web/client/assets/settings-dialog-B-v4me3Y.js +1 -0
  29. package/dist/web/client/assets/skeleton-loaders-C9vHwAYV.js +1 -0
  30. package/dist/web/client/assets/{subagent-chat-panel-DseoO31p.js → subagent-chat-panel-DkVUumrP.js} +1 -1
  31. package/dist/web/client/assets/subagent-transcript-D8wmQxXe.js +1 -0
  32. package/dist/web/client/assets/subagents-panel-BMp2Ego0.js +1 -0
  33. package/dist/web/client/assets/{surfaces-cW-gp56p.js → surfaces-DI-U-_2a.js} +1 -1
  34. package/dist/web/client/assets/tool-result-DfnPN0FQ.js +4 -0
  35. package/dist/web/client/assets/ui-preferences-CImQGZm_.js +1 -0
  36. package/dist/web/client/assets/virtualized-turn-list-DMJENRY0.js +6 -0
  37. package/dist/web/client/assets/{workspace-panel-DI1W3ce9.js → workspace-panel-G6yMpKJ8.js} +1 -1
  38. package/dist/web/client/bundle-budget.json +6 -6
  39. package/dist/web/server/{_tanstack-start-manifest_v-Cdx6hy2i-I7A5YJRU.js → _tanstack-start-manifest_v-po4woX6g-AUGCOEZ2.js} +14 -13
  40. package/dist/web/server/{agent-activity-B-JMvecd-SLE3GGY2.js → agent-activity-CS2rbF_C-A3R26CYH.js} +2 -2
  41. package/dist/web/server/{artifacts-panel-DLMK1O8P-42T45JMA.js → artifacts-panel-8GGUCtOd-X5TNKTY2.js} +12 -12
  42. package/dist/web/server/{chat-command-palette-CdYwoTMe-4LBAZF7K.js → chat-command-palette-Dgl5tqWn-72LLEWUD.js} +2 -2
  43. package/dist/web/server/{chunk-K5ESTT4A.js → chunk-7MDZVLIY.js} +11 -3
  44. package/dist/web/server/{chunk-EBCYJSBR.js → chunk-7SD2ZSEA.js} +3 -3
  45. package/dist/web/server/{chunk-M564UIEY.js → chunk-ABBWBBSS.js} +8 -8
  46. package/dist/web/server/{chunk-KNJUSMBT.js → chunk-BXWAUTTH.js} +2 -2
  47. package/dist/web/server/{chunk-54II5QXQ.js → chunk-ETTDO4UO.js} +6 -3
  48. package/dist/web/server/{chunk-EHNIN245.js → chunk-GETSIVNU.js} +5 -5
  49. package/dist/web/server/{chunk-NRDG2ISJ.js → chunk-GGT2ZKDB.js} +49 -49
  50. package/dist/web/server/{chunk-X2R5YPQZ.js → chunk-IJPCV6DH.js} +3 -2
  51. package/dist/web/server/{chunk-AJJ2S5FF.js → chunk-JQDLJ7KI.js} +20 -20
  52. package/dist/web/server/{chunk-VHBFU4TG.js → chunk-JUROEEWM.js} +43 -14
  53. package/dist/web/server/{chunk-TCH3U26B.js → chunk-MIW4LJTV.js} +2 -2
  54. package/dist/web/server/{chunk-2TRF62K5.js → chunk-N6NOTURM.js} +3 -3
  55. package/dist/web/server/{chunk-5XX7RKJ6.js → chunk-NXJ32VFR.js} +5 -5
  56. package/dist/web/server/{chunk-EOVMHQ2H.js → chunk-O4OTWWPF.js} +7 -7
  57. package/dist/web/server/{chunk-OB5OSYJK.js → chunk-RNOJACWQ.js} +53 -29
  58. package/dist/web/server/chunk-SZJUXVWG.js +40 -0
  59. package/dist/web/server/{chunk-6AW2XFTZ.js → chunk-WILCIZYU.js} +194 -10
  60. package/dist/web/server/{chunk-FED63ZHU.js → chunk-WKV2Z4KO.js} +10 -5
  61. package/dist/web/server/{chunk-ANL4B775.js → chunk-XLNCWZMZ.js} +2 -2
  62. package/dist/web/server/{chunk-GM32R7JW.js → chunk-YKVGQBZA.js} +10 -8
  63. package/dist/web/server/{chunk-3PIUR75R.js → chunk-YXXRP3NS.js} +9 -9
  64. package/dist/web/server/{fleet-message-queue-BxycG26e-2XLOTCLP.js → fleet-message-queue-j0DCU5Xy-5HKBHMPV.js} +2 -2
  65. package/dist/web/server/{fleet-pi-tool-renderer-RIeVlM9J-D6MISCQC.js → fleet-pi-tool-renderer-umKunT3K-O4GBH35V.js} +5 -5
  66. package/dist/web/server/{fleet-reasoning-panel-D_K48UOT-GN2PA6KT.js → fleet-reasoning-panel-BxC2COxi-GPLMQSTT.js} +9 -9
  67. package/dist/web/server/{fleet-subagent-list-5luKtpds-3OTVFHJQ.js → fleet-subagent-list-CpSYzCIq-JDH2LHSS.js} +1 -1
  68. package/dist/web/server/{fleet-tool-timeline-DwRqQgOj-HUFLGMDV.js → fleet-tool-timeline-IB36_PB2-XJENTO6I.js} +1 -1
  69. package/dist/web/server/{fork-picker-dialog-B9yGc8Au-IL63F2DN.js → fork-picker-dialog-DlINz9UQ-UWIXFDJX.js} +3 -3
  70. package/dist/web/server/{model-selector-list-cb2-ewoA-KIVU6LD3.js → model-selector-list-OYnzNbyu-HBGCNF2L.js} +5 -5
  71. package/dist/web/server/{openui-renderer-Czy5Vo2L-BLXPJD65.js → openui-renderer-Cj7kfqyL-EKJ6JTTQ.js} +4 -4
  72. package/dist/web/server/{prompt-suggestions-BOmHi4-J-C563CHFU.js → prompt-suggestions-D4AEEY7K-RZSP7PWV.js} +3 -3
  73. package/dist/web/server/{repl-panel-yyxhwe4c-7U6HXYPS.js → repl-panel-D5KsoJik-BQKO53JO.js} +9 -9
  74. package/dist/web/server/{resources-panel-j4fAIi9g-5C267IXV.js → resources-panel-CE5pD4vy-V5FXBTYC.js} +2 -2
  75. package/dist/web/server/{router-CgSWrAYc-5UBYSZTJ.js → router-Ci1wxI7I-E2AYMNON.js} +253 -76
  76. package/dist/web/server/{routes-CP_BBhD0-BAWQYGKY.js → routes-CRpm9-Sa-IYK6MUJO.js} +705 -537
  77. package/dist/web/server/server.js +2 -2
  78. package/dist/web/server/{session-insights-panel-BHZyKDTo-LRMAMA3O.js → session-insights-panel-CUhdgvRt-VB2HUCQP.js} +4 -4
  79. package/dist/web/server/{settings-dialog-CxHe8nym-KKXDPTIW.js → settings-dialog-BvkgNflv-GPJ6COQO.js} +14 -10
  80. package/dist/web/server/{subagent-chat-panel-DlSsM59d-DBW7DI3T.js → subagent-chat-panel-CMuvW9Sd-M5TEEGQW.js} +11 -11
  81. package/dist/web/server/{subagents-panel-Txzk8oDb-NRKLASYN.js → subagents-panel-DgfB6_Yy-4INEPE3Y.js} +13 -13
  82. package/dist/web/server/{workspace-panel-BOs-58Cv-SWQBMZSB.js → workspace-panel-bpwj-Veu-Q2CEJMN4.js} +4 -3
  83. package/package.json +1 -1
  84. package/dist/web/client/assets/agent-activity-CDcDNVC6.js +0 -1
  85. package/dist/web/client/assets/artifacts-panel-CObI-DMt.js +0 -1
  86. package/dist/web/client/assets/fleet-reasoning-panel-MtbSdoCv.js +0 -1
  87. package/dist/web/client/assets/fleet-tool-timeline-COzPrwr8.js +0 -1
  88. package/dist/web/client/assets/generative-text-renderer-CDKHv-v_.js +0 -6
  89. package/dist/web/client/assets/globals-DisQPFtV.css +0 -2
  90. package/dist/web/client/assets/horizontal-resize-Bl3AyBJg.js +0 -1
  91. package/dist/web/client/assets/model-selector-list-DQaPFUYt.js +0 -1
  92. package/dist/web/client/assets/prompt-input-DZ4cho_e.js +0 -1
  93. package/dist/web/client/assets/prompt-suggestions-CXM6knMK.js +0 -1
  94. package/dist/web/client/assets/repl-panel-BDQ5MEgV.js +0 -1
  95. package/dist/web/client/assets/right-panel-registry-VVRPktV3.js +0 -2
  96. package/dist/web/client/assets/routes-DAikUNzO.js +0 -16
  97. package/dist/web/client/assets/session-insights-panel-CQdT90Op.js +0 -1
  98. package/dist/web/client/assets/settings-dialog-DS64KmwC.js +0 -1
  99. package/dist/web/client/assets/skeleton-loaders-DjGv9LLA.js +0 -1
  100. package/dist/web/client/assets/subagent-transcript-cxVKYnh9.js +0 -1
  101. package/dist/web/client/assets/subagents-panel-CHC96I68.js +0 -1
  102. package/dist/web/client/assets/tool-result-Baj3CdL_.js +0 -4
  103. package/dist/web/client/assets/ui-preferences-DUEFuJFj.js +0 -1
@@ -1,2 +1,2 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/markdown-DInPmRUG.js","assets/rolldown-runtime-hePW80VL.js","assets/bundle-mjs-DKHVkVWu.js","assets/jsx-runtime-NZYk81nU.js","assets/utils-Eg7xtNmV.js","assets/preload-helper-Czpn1I53.js","assets/chunk-YOKDWASO-BAf618wr.js","assets/react-dom-Bwxum3ti.js","assets/lib-ChrQ49PO.js","assets/cn-C8c0S2mI.js"])))=>i.map(i=>d[i]);
2
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t}from"./bundle-mjs-DKHVkVWu.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{d as r,o as i,r as a,u as o}from"./ease-u56MhKYS.js";import{n as s,t as c}from"./use-reduced-motion-eORd7fqW.js";import{t as l}from"./utils-Eg7xtNmV.js";import{t as u}from"./createLucideIcon-DwxZHm0M.js";import{t as d}from"./chevron-down-BEVGmnSb.js";import{t as f}from"./earth-DGZXAN5r.js";import{i as p}from"./shield-check-CkA2viVW.js";import{t as m}from"./preload-helper-Czpn1I53.js";import{t as h}from"./agent-disclosure-B8SnhQXL.js";import{t as g}from"./safe-external-url-D3PJJIcM.js";var _=u(`book-open-text`,[[`path`,{d:`M12 5v16`,key:`1f6ucr`}],[`path`,{d:`M16 13h2`,key:`weia3s`}],[`path`,{d:`M16 9h2`,key:`1n7gjm`}],[`path`,{d:`M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z`,key:`1fyvmf`}],[`path`,{d:`M6 13h2`,key:`1cckiz`}],[`path`,{d:`M6 9h2`,key:`1k7j9f`}]]),v=u(`list-todo`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`rect`,{x:`3`,y:`4`,width:`6`,height:`6`,rx:`1`,key:`cif1o7`}]]),y=u(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),b=u(`message-circle-question-mark`,[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),x=e(t(),1);function S(){let[e,t]=(0,x.useState)(!1);return(0,x.useEffect)(()=>{if(typeof window>`u`||!window.matchMedia)return;let e=window.matchMedia(`(hover: hover) and (pointer: fine)`),n=()=>t(e.matches);return n(),e.addEventListener?.(`change`,n),()=>e.removeEventListener?.(`change`,n)},[]),e}var C=n(),w=(0,x.lazy)(()=>m(async()=>{let{Markdown:e}=await import(`./markdown-DInPmRUG.js`).then(e=>e.a);return{Markdown:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9])).then(({Markdown:e})=>({default:e})));function T(e){return(0,C.jsx)(x.Suspense,{fallback:(0,C.jsx)(`div`,{className:e.className?`${e.className} whitespace-pre-wrap`:`whitespace-pre-wrap`,children:e.content}),children:(0,C.jsx)(w,{...e})})}var E={};function D(e){try{return new URL(`/favicon.ico`,e).toString()}catch{return null}}function O(e,t){return`${e}-${t.replace(/[^a-zA-Z0-9_-]/g,`-`)}`}function k({url:e,className:t}){let n=e&&g(e)?D(e):null,[r,i]=(0,x.useState)(null);return(0,C.jsx)(`span`,{"aria-hidden":`true`,className:l(`grid size-5 shrink-0 place-items-center text-muted-foreground`,t),children:n&&r!==n?(0,C.jsx)(`img`,{src:n,alt:``,width:16,height:16,loading:`lazy`,referrerPolicy:`no-referrer`,onError:()=>i(n),className:`size-4 rounded-sm object-contain`}):(0,C.jsx)(f,{className:`size-3.5`})})}function A({citations:e,limit:t=3,className:n}){return(0,C.jsx)(`span`,{"aria-hidden":`true`,className:l(`flex -space-x-1.5`,n),children:e.slice(0,t).map(e=>(0,C.jsx)(k,{url:e.url,className:`size-6 rounded-full bg-background ring-2 ring-background`},e.id))})}function j({citation:e,index:t,idPrefix:n}){let r=e.url&&g(e.url)?e.url:void 0,i=(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(k,{url:e.url}),(0,C.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-wrap items-baseline gap-x-2 gap-y-0.5`,children:[(0,C.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground/80 transition-colors group-hover/citation:text-foreground`,children:e.title}),e.domain?(0,C.jsx)(`span`,{className:`min-w-0 truncate text-xs text-muted-foreground/60`,children:e.domain}):null]}),(0,C.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5`,children:[(0,C.jsx)(`span`,{className:`grid size-5 place-items-center rounded-md bg-foreground/[0.05] text-[10px] font-semibold tabular-nums text-muted-foreground`,children:t}),r?(0,C.jsx)(p,{className:`size-3.5 text-muted-foreground/40 transition-colors group-hover/citation:text-muted-foreground`}):null]})]}),a=`group/citation flex items-center gap-2 rounded-md px-1.5 py-1 outline-none focus-visible:ring-2 focus-visible:ring-ring`,o=O(n,e.id);return r?(0,C.jsx)(`a`,{id:o,href:r,target:`_blank`,rel:`noreferrer noopener`,className:a,children:i}):(0,C.jsx)(`div`,{id:o,className:a,children:i})}function M({citations:e,idPrefix:t,className:n}){let o=c()??!1,u=(0,x.useId)(),d=t??`citation-list-${u.replace(/:/g,``)}`;return(0,C.jsx)(`div`,{className:l(`grid gap-0.5`,n),children:(0,C.jsx)(s,{mode:`popLayout`,children:e.map((e,t)=>(0,C.jsx)(r.div,{layout:`position`,initial:o?{opacity:1}:{opacity:0,y:6},animate:{opacity:1,y:0},exit:o?{opacity:0}:{opacity:0,y:-3},transition:o?{duration:0}:{opacity:{duration:.18,ease:a},y:i,layout:i},children:(0,C.jsx)(j,{citation:e,index:t+1,idPrefix:d})},e.id))})})}function N({citations:e,title:t=`Sources`,open:n,defaultOpen:i=!1,onOpenChange:a,idPrefix:s,className:u}){let f=c()??!1,p=(0,x.useId)(),m=`${p}-content`,g=s??`citation-${p.replace(/:/g,``)}`,[v,y]=(0,x.useState)(i),b=n??v,S=(0,x.useCallback)(e=>{n===void 0&&y(e),a?.(e)},[a,n]);return(0,C.jsxs)(`div`,{className:l(`w-full text-sm`,u),children:[(0,C.jsxs)(`button`,{type:`button`,"aria-expanded":b,"aria-controls":m,onClick:()=>S(!b),className:`group -ml-1 flex min-h-8 items-center gap-2 rounded-lg px-1 text-left text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring`,children:[(0,C.jsx)(_,{className:`size-4`}),(0,C.jsx)(`span`,{className:`font-medium`,children:t}),(0,C.jsx)(`span`,{className:`rounded-full bg-muted px-1.5 py-0.5 text-[10px] font-semibold tabular-nums`,children:e.length}),(0,C.jsx)(r.span,{"aria-hidden":`true`,animate:{rotate:b?180:0},transition:f?{duration:0}:o,className:`text-muted-foreground/60`,children:(0,C.jsx)(d,{className:`size-3.5`})})]}),(0,C.jsx)(h,{id:m,open:b,children:(0,C.jsx)(M,{citations:e,idPrefix:g,className:`mt-1`})})]})}export{T as a,y as c,E as i,v as l,A as n,S as o,N as r,b as s,M as t,_ as u};
2
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t}from"./bundle-mjs-DKHVkVWu.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{d as r,o as i,r as a,u as o}from"./ease-u56MhKYS.js";import{n as s,t as c}from"./use-reduced-motion-eORd7fqW.js";import{t as l}from"./utils-Eg7xtNmV.js";import{t as u}from"./createLucideIcon-DwxZHm0M.js";import{t as d}from"./chevron-down-BEVGmnSb.js";import{t as f}from"./earth-DGZXAN5r.js";import{i as p}from"./shield-check-CkA2viVW.js";import{t as m}from"./preload-helper-Czpn1I53.js";import{t as h}from"./agent-disclosure-B8SnhQXL.js";import{t as g}from"./safe-external-url-D3PJJIcM.js";var _=u(`book-open-text`,[[`path`,{d:`M12 5v16`,key:`1f6ucr`}],[`path`,{d:`M16 13h2`,key:`weia3s`}],[`path`,{d:`M16 9h2`,key:`1n7gjm`}],[`path`,{d:`M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z`,key:`1fyvmf`}],[`path`,{d:`M6 13h2`,key:`1cckiz`}],[`path`,{d:`M6 9h2`,key:`1k7j9f`}]]),v=u(`list-todo`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`rect`,{x:`3`,y:`4`,width:`6`,height:`6`,rx:`1`,key:`cif1o7`}]]),y=u(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),b=u(`message-circle-question-mark`,[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),x=e(t(),1);function S(){let[e,t]=(0,x.useState)(!1);return(0,x.useEffect)(()=>{if(typeof window>`u`||!window.matchMedia)return;let e=window.matchMedia(`(hover: hover) and (pointer: fine)`),n=()=>t(e.matches);return n(),e.addEventListener?.(`change`,n),()=>e.removeEventListener?.(`change`,n)},[]),e}var C=n(),w=(0,x.lazy)(()=>m(async()=>{let{Markdown:e}=await import(`./markdown-DInPmRUG.js`).then(e=>e.a);return{Markdown:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9])).then(({Markdown:e})=>({default:e})));function T(e){return(0,C.jsx)(x.Suspense,{fallback:(0,C.jsx)(`div`,{className:e.className?`${e.className} whitespace-pre-wrap`:`whitespace-pre-wrap`,children:e.content}),children:(0,C.jsx)(w,{...e})})}var E={};function D(e){try{return new URL(`/favicon.ico`,e).toString()}catch{return null}}function O(e,t){return`${e}-${t.replace(/[^a-zA-Z0-9_-]/g,`-`)}`}function k({url:e,className:t}){let n=e&&g(e)?D(e):null,[r,i]=(0,x.useState)(null);return(0,C.jsx)(`span`,{"aria-hidden":`true`,className:l(`grid size-5 shrink-0 place-items-center text-muted-foreground`,t),children:n&&r!==n?(0,C.jsx)(`img`,{src:n,alt:``,width:16,height:16,loading:`lazy`,referrerPolicy:`no-referrer`,onError:()=>i(n),className:`size-4 rounded-sm object-contain`}):(0,C.jsx)(f,{className:`size-3.5`})})}function A({citations:e,limit:t=3,className:n}){return(0,C.jsx)(`span`,{"aria-hidden":`true`,className:l(`flex -space-x-1.5`,n),children:e.slice(0,t).map(e=>(0,C.jsx)(k,{url:e.url,className:`size-6 rounded-full bg-background ring-2 ring-background`},e.id))})}function j({citation:e,index:t,idPrefix:n}){let r=e.url&&g(e.url)?e.url:void 0,i=(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(k,{url:e.url}),(0,C.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-wrap items-baseline gap-x-2 gap-y-0.5`,children:[(0,C.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground/80 transition-colors group-hover/citation:text-foreground`,children:e.title}),e.domain?(0,C.jsx)(`span`,{className:`min-w-0 truncate text-xs text-muted-foreground/60`,children:e.domain}):null]}),(0,C.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5`,children:[(0,C.jsx)(`span`,{className:`grid size-5 place-items-center rounded-md bg-foreground/[0.05] text-[0.625rem] font-semibold tabular-nums text-muted-foreground`,children:t}),r?(0,C.jsx)(p,{className:`size-3.5 text-muted-foreground/40 transition-colors group-hover/citation:text-muted-foreground`}):null]})]}),a=`group/citation flex items-center gap-2 rounded-md px-1.5 py-1 outline-none focus-visible:ring-2 focus-visible:ring-ring`,o=O(n,e.id);return r?(0,C.jsx)(`a`,{id:o,href:r,target:`_blank`,rel:`noreferrer noopener`,className:a,children:i}):(0,C.jsx)(`div`,{id:o,className:a,children:i})}function M({citations:e,idPrefix:t,className:n}){let o=c()??!1,u=(0,x.useId)(),d=t??`citation-list-${u.replace(/:/g,``)}`;return(0,C.jsx)(`div`,{className:l(`grid gap-0.5`,n),children:(0,C.jsx)(s,{mode:`popLayout`,children:e.map((e,t)=>(0,C.jsx)(r.div,{layout:`position`,initial:o?{opacity:1}:{opacity:0,y:6},animate:{opacity:1,y:0},exit:o?{opacity:0}:{opacity:0,y:-3},transition:o?{duration:0}:{opacity:{duration:.18,ease:a},y:i,layout:i},children:(0,C.jsx)(j,{citation:e,index:t+1,idPrefix:d})},e.id))})})}function N({citations:e,title:t=`Sources`,open:n,defaultOpen:i=!1,onOpenChange:a,idPrefix:s,className:u}){let f=c()??!1,p=(0,x.useId)(),m=`${p}-content`,g=s??`citation-${p.replace(/:/g,``)}`,[v,y]=(0,x.useState)(i),b=n??v,S=(0,x.useCallback)(e=>{n===void 0&&y(e),a?.(e)},[a,n]);return(0,C.jsxs)(`div`,{className:l(`w-full text-sm`,u),children:[(0,C.jsxs)(`button`,{type:`button`,"aria-expanded":b,"aria-controls":m,onClick:()=>S(!b),className:`group -ml-1 flex min-h-8 items-center gap-2 rounded-lg px-1 text-left text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring`,children:[(0,C.jsx)(_,{className:`size-4`}),(0,C.jsx)(`span`,{className:`font-medium`,children:t}),(0,C.jsx)(`span`,{className:`rounded-full bg-muted px-1.5 py-0.5 text-[0.625rem] font-semibold tabular-nums`,children:e.length}),(0,C.jsx)(r.span,{"aria-hidden":`true`,animate:{rotate:b?180:0},transition:f?{duration:0}:o,className:`text-muted-foreground/60`,children:(0,C.jsx)(d,{className:`size-3.5`})})]}),(0,C.jsx)(h,{id:m,open:b,children:(0,C.jsx)(M,{citations:e,idPrefix:g,className:`mt-1`})})]})}export{T as a,y as c,E as i,v as l,A as n,S as o,N as r,b as s,M as t,_ as u};
@@ -1 +1 @@
1
- import{t as e}from"./jsx-runtime-NZYk81nU.js";import{t}from"./utils-Eg7xtNmV.js";import{t as n}from"./x-CsRC_tCI.js";import{t as r}from"./notify-DgMKgZZW.js";var i=e(),a=[{key:`steering`,label:`Next`},{key:`followUp`,label:`After run`}];function o({queue:e,onDelete:o,className:s}){let c=e.steering.length+e.followUp.length;if(c===0)return null;let l=async(e,t,n)=>{try{await o?.(e,t,n)===!1&&r.error(`Unable to remove queued message`)}catch{r.error(`Unable to remove queued message`)}};return(0,i.jsx)(`section`,{"aria-label":`Queued messages`,className:t(`mx-auto mb-2 w-full max-w-an px-3`,s),children:(0,i.jsxs)(`div`,{className:`rounded-xl border border-border/60 bg-muted/30 p-2`,children:[(0,i.jsxs)(`div`,{className:`mb-1 flex items-baseline justify-between px-1 text-xs text-muted-foreground`,children:[(0,i.jsxs)(`span`,{children:[c,` queued`]}),(0,i.jsx)(`span`,{children:`Sent when the run reaches its lane`})]}),(0,i.jsx)(`div`,{className:`space-y-1`,children:a.flatMap(({key:t,label:r})=>e[t].map((e,a)=>(0,i.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 rounded-lg bg-background/80 px-2 py-1.5 text-sm`,children:[(0,i.jsx)(`span`,{className:`shrink-0 text-[10px] font-medium uppercase tracking-wide text-muted-foreground`,children:r}),(0,i.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-foreground/80`,children:e}),o?(0,i.jsx)(`button`,{type:`button`,"aria-label":`Remove queued message: ${e}`,onClick:()=>void l(t,a,e),className:`grid size-6 shrink-0 place-items-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:(0,i.jsx)(n,{className:`size-3.5`})}):null]},`${t}:${a}:${e}`)))})]})})}export{o as FleetMessageQueue};
1
+ import{t as e}from"./jsx-runtime-NZYk81nU.js";import{t}from"./utils-Eg7xtNmV.js";import{t as n}from"./x-CsRC_tCI.js";import{t as r}from"./notify-DgMKgZZW.js";var i=e(),a=[{key:`steering`,label:`Next`},{key:`followUp`,label:`After run`}];function o({queue:e,onDelete:o,className:s}){let c=e.steering.length+e.followUp.length;if(c===0)return null;let l=async(e,t,n)=>{try{await o?.(e,t,n)===!1&&r.error(`Unable to remove queued message`)}catch{r.error(`Unable to remove queued message`)}};return(0,i.jsx)(`section`,{"aria-label":`Queued messages`,className:t(`mx-auto mb-2 w-full max-w-an px-3`,s),children:(0,i.jsxs)(`div`,{className:`rounded-xl border border-border/60 bg-muted/30 p-2`,children:[(0,i.jsxs)(`div`,{className:`mb-1 flex items-baseline justify-between px-1 text-xs text-muted-foreground`,children:[(0,i.jsxs)(`span`,{children:[c,` queued`]}),(0,i.jsx)(`span`,{children:`Sent when the run reaches its lane`})]}),(0,i.jsx)(`div`,{className:`space-y-1`,children:a.flatMap(({key:t,label:r})=>e[t].map((e,a)=>(0,i.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 rounded-lg bg-background/80 px-2 py-1.5 text-sm`,children:[(0,i.jsx)(`span`,{className:`shrink-0 text-[0.625rem] font-medium uppercase tracking-wide text-muted-foreground`,children:r}),(0,i.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-foreground/80`,children:e}),o?(0,i.jsx)(`button`,{type:`button`,"aria-label":`Remove queued message: ${e}`,onClick:()=>void l(t,a,e),className:`grid size-6 shrink-0 place-items-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:(0,i.jsx)(n,{className:`size-3.5`})}):null]},`${t}:${a}:${e}`)))})]})})}export{o as FleetMessageQueue};
@@ -1,7 +1,7 @@
1
- import{n as e,r as t}from"./rolldown-runtime-hePW80VL.js";import{i as n}from"./bundle-mjs-DKHVkVWu.js";import{t as r}from"./jsx-runtime-NZYk81nU.js";import{d as i,l as a,n as o,o as s,r as c,u as l}from"./ease-u56MhKYS.js";import{n as u,t as d}from"./use-reduced-motion-eORd7fqW.js";import{t as f}from"./utils-Eg7xtNmV.js";import{t as p}from"./createLucideIcon-DwxZHm0M.js";import{i as m,n as h,r as g,t as _}from"./tool-result-Baj3CdL_.js";import{a as v,c as y,i as b,l as x,o as S,r as C,s as w}from"./citations-BQ_pr_9_.js";import{t as T}from"./check-JjHKAZas.js";import{t as E}from"./chevron-down-BEVGmnSb.js";import{t as D}from"./chevron-right-DrJxToLs.js";import{t as O}from"./chevron-up-CnSvySGH.js";import{t as k}from"./circle-alert-CONlFReH.js";import{n as A,t as j}from"./loader-circle-DjfHXUPB.js";import{t as M}from"./circle-x-CkKCB__4.js";import{a as N,i as ee,n as te,r as ne,t as re}from"./ipython-tool-BrMePqD-.js";import{n as ie,t as ae}from"./action-swap-roll-BB8DFMuf.js";import{n as oe,r as se,t as ce}from"./shield-check-CkA2viVW.js";import{t as le}from"./eye-B0DFz5hL.js";import{t as ue}from"./file-text-T-NcAlZs.js";import{t as de}from"./rotate-ccw-WNFNkKQD.js";import{t as fe}from"./search-eWVnAJsb.js";import{t as pe}from"./sparkles-DuclzqlE.js";import{t as me}from"./terminal-DOS1s1gm.js";import{t as he}from"./wrench-BJNNe07k.js";import{t as ge}from"./x-CsRC_tCI.js";import{t as P}from"./preload-helper-Czpn1I53.js";import{a as _e,i as ve,n as ye,o as be,r as xe,s as Se}from"./dist-CZDnnosQ.js";import"./cn-C8c0S2mI.js";import{r as Ce}from"./workspace-path-nav-C0AQNZyy.js";import{n as we,r as Te,t as Ee}from"./collapsible-BoXtZZWN.js";import{t as De}from"./agent-disclosure-B8SnhQXL.js";import{t as Oe}from"./safe-external-url-D3PJJIcM.js";import{o as ke}from"./surfaces-cW-gp56p.js";import{n as Ae,t as je}from"./range-BWOHiLNe.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`}]]),F=t(n(),1),I=r(),Ie=new Map;function Le(e){return{state:e.state,inputJson:JSON.stringify(e.input||{}),outputJson:JSON.stringify(e.output||{})}}function Re(e,t){let n=Ie.get(e),r=Le(t);if(!n)return Ie.set(e,r),!0;let i=n.state!==r.state||n.inputJson!==r.inputJson||n.outputJson!==r.outputJson;return i&&Ie.set(e,r),i}function ze(e,t){if(e.toolCallId!==t.toolCallId||e.type!==t.type)return!1;let n=t.toolCallId;return n?!Re(n,t):e.state===t.state}function Be(e){return e.output!==void 0&&e.output!==null||e.state===`error`||e.state===`result`}function Ve(e,t){return ze(e.part,t.part)?Be(t.part)?!0:e.chatStatus===t.chatStatus:!1}function He(e){if(e<1e3)return``;let t=Math.floor(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60),r=t%60;return r===0?`${n}m`:`${n}m ${r}s`}function Ue(e,t){let n=e.state!==`output-available`&&e.state!==`output-error`,r=e.state===`output-error`||e.state===`output-available`&&e.output?.success===!1,i=e.state===`output-available`&&!r;return{isPending:n&&t===`streaming`,isError:r,isSuccess:i,isInterrupted:n&&t!==`streaming`&&t!==void 0}}var We=`__custom__`;function Ge(e){return String.fromCharCode(65+e)}function Ke(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(We),{selectedIds:Array.from(r),customText:i,textValue:``}}function qe({questions:e,questionIndex:t=1,totalQuestions:n,onPreviousQuestion:r,onNextQuestion:i,submitLabel:a=`Send`,nextLabel:o=`Next`,skipLabel:s=`Skip`,allowSkip:c=!0,initialAnswer:l,onSubmit:u,onSkip:d,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,F.useState)(()=>Ke(l,g?.kind,_).selectedIds),[b,x]=(0,F.useState)(()=>Ke(l,g?.kind,_).customText),[S,C]=(0,F.useState)(()=>Ke(l,g?.kind,_).textValue),w=m>1&&(!!r||!!i),T=h>1,E=h<m,D=h>=m,O=(0,F.useMemo)(()=>new Set(v),[v]),k=D?a:o,A=(0,F.useMemo)(()=>{if(g?.kind===`text`)return S.trim().length>0;let e=v.filter(e=>e!==We).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])},N=e=>{if(x(e),g){if(g.kind===`single`){y(e.trim().length>0?[We]:[]);return}y(t=>{let n=t.includes(We);return e.trim().length>0&&!n?[...t,We]:e.trim().length===0&&n?t.filter(e=>e!==We):t})}};return g?(0,I.jsxs)(`div`,{className:f(`flex flex-col gap-2 bg-background px-3 py-2`,p),children:[(0,I.jsx)(`div`,{className:`flex items-center justify-between gap-px`,"data-total-questions":m,children:(0,I.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-an-tool-color`,children:[(0,I.jsx)(`span`,{className:`inline-flex h-5 min-w-5 items-center justify-center rounded px-1 text-sm font-medium text-an-tool-color-muted`,children:h}),(0,I.jsx)(`span`,{children:g.title})]})}),g.kind!==`text`&&(g.options?.length??0)>0&&(0,I.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,I.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-an-background-secondary`,children:[(0,I.jsx)(`span`,{className:f(`inline-flex h-5 min-w-5 items-center justify-center rounded border px-1 text-sm font-medium`,r?`border-an-primary-color bg-an-primary-color text-an-send-button-color`:`border-border bg-transparent text-an-tool-color-muted`),children:Ge(t)}),(0,I.jsxs)(`span`,{className:`text-sm text-an-tool-color`,children:[e.label,e.description&&(0,I.jsxs)(`span`,{className:`text-an-tool-color-muted`,children:[` `,e.description]})]})]},n)}),_&&(0,I.jsxs)(`div`,{className:`flex items-center gap-2 pt-1`,children:[(0,I.jsx)(`span`,{className:f(`inline-flex h-5 min-w-5 items-center justify-center rounded border px-1 text-sm font-medium`,v.includes(We)?`border-an-primary-color bg-an-primary-color text-an-send-button-color`:`border-border bg-transparent text-an-tool-color-muted`),children:Ge(g.options.length)}),(0,I.jsx)(`input`,{value:b,onChange:e=>N(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-an-tool-color md:text-sm`})]})]}),g.kind===`text`&&(0,I.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-an-tool-color md:text-sm`}),(0,I.jsxs)(`div`,{className:f(`flex items-center gap-1.5`,w?`justify-between`:`justify-end`),children:[w&&(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[r&&(0,I.jsx)(`button`,{type:`button`,onClick:r,disabled:!T,className:`h-6 rounded px-2 text-sm text-muted-foreground hover:text-an-tool-color disabled:opacity-60`,children:`Previous`}),i&&(0,I.jsx)(`button`,{type:`button`,onClick:i,disabled:!E,className:`h-6 rounded px-2 text-sm text-muted-foreground hover:text-an-tool-color disabled:opacity-60`,children:`Next`})]}),(0,I.jsxs)(`div`,{className:`flex items-center justify-end gap-1.5`,children:[c&&(0,I.jsx)(`button`,{type:`button`,onClick:()=>{d?.(),u({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-an-tool-color active:scale-[0.98]`,children:s}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>{if(!A||!g)return;if(g.kind===`text`){u({kind:`text`,questionId:g.id,text:S.trim()});return}let e=v.filter(e=>e!==We),t=b.trim()||void 0;u({kind:g.kind,questionId:g.id,selectedIds:e,text:t||void 0})},disabled:!A,className:`h-6 rounded bg-an-primary-color px-2.5 text-sm font-medium text-an-send-button-color transition-[background-color,transform] duration-150 hover:bg-an-primary-color/90 active:scale-[0.98] disabled:opacity-60 disabled:hover:bg-an-primary-color disabled:active:scale-100`,children:k})]})]})]}):null}function Je(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 Ye({part:e}){let[t,n]=(0,F.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,F.useState)({}),[d,f]=(0,F.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,F.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,v=i>1&&!_,y=s>1,b=s<i,x=(0,F.useMemo)(()=>!_||i<=1?[]:Array.from({length:i},(e,t)=>({index:t+1,answer:l[t+1]})),[_,l,i]),S=(0,F.useMemo)(()=>_?x.length>0?x.map(e=>`${e.index}: ${e.answer?Je(e.answer):`Pending`}`).join(` • `):h?Je(h):l[s]?Je(l[s]):`Pending`:``,[_,x,h,l,s]);if(!c)return null;let C=()=>{y&&(e.input?.onPreviousQuestion?.(),a||n(e=>Math.max(1,e-1)))},T=()=>{b&&(e.input?.onNextQuestion?.(),a||n(e=>Math.min(i,e+1)))};return(0,I.jsxs)(`div`,{className:`overflow-hidden rounded-an-tool-border-radius border border-border bg-an-tool-background`,children:[(0,I.jsxs)(`div`,{className:`flex h-7 items-center justify-between border-b border-border px-3 text-xs text-an-tool-color-muted`,children:[(0,I.jsxs)(`div`,{className:`inline-flex items-center gap-1.5`,children:[(0,I.jsx)(w,{className:`h-3.5 w-3.5`}),`Question`]}),v&&(0,I.jsxs)(`div`,{className:`inline-flex items-center gap-1`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:C,disabled:!y,className:`inline-flex size-5 items-center justify-center rounded-[4px] hover:bg-an-background-secondary disabled:opacity-40`,"aria-label":`Previous question`,children:(0,I.jsx)(O,{className:`h-3.5 w-3.5`})}),(0,I.jsxs)(`span`,{children:[s,` of `,i]}),(0,I.jsx)(`button`,{type:`button`,onClick:T,disabled:!b,className:`inline-flex size-5 items-center justify-center rounded-[4px] hover:bg-an-background-secondary disabled:opacity-40`,"aria-label":`Next question`,children:(0,I.jsx)(E,{className:`h-3.5 w-3.5`})})]})]}),_?(0,I.jsx)(`div`,{className:`bg-background px-3 py-2 text-xs text-an-tool-color-muted`,children:S}):(0,I.jsx)(qe,{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&&T()}},`${s}-${c.title}`)]})}function Xe(e){if(!e)return``;let t=Ce(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 Ze(e,t){let n=e.split(`
1
+ import{n as e,r as t}from"./rolldown-runtime-hePW80VL.js";import{i as n}from"./bundle-mjs-DKHVkVWu.js";import{t as r}from"./jsx-runtime-NZYk81nU.js";import{d as i,l as a,n as o,o as s,r as c,u as l}from"./ease-u56MhKYS.js";import{n as u,t as d}from"./use-reduced-motion-eORd7fqW.js";import{t as f}from"./utils-Eg7xtNmV.js";import{t as p}from"./createLucideIcon-DwxZHm0M.js";import{i as m,n as h,r as g,t as _}from"./tool-result-DfnPN0FQ.js";import{a as v,c as y,i as b,l as x,o as S,r as C,s as w}from"./citations-C_tPOJE_.js";import{t as T}from"./check-JjHKAZas.js";import{t as E}from"./chevron-down-BEVGmnSb.js";import{t as D}from"./chevron-right-DrJxToLs.js";import{t as O}from"./chevron-up-CnSvySGH.js";import{t as k}from"./circle-alert-CONlFReH.js";import{n as A,t as j}from"./loader-circle-DjfHXUPB.js";import{t as M}from"./circle-x-CkKCB__4.js";import{a as N,i as ee,n as te,r as ne,t as re}from"./ipython-tool-ldJ9F1Cw.js";import{n as ie,t as ae}from"./action-swap-roll-BB8DFMuf.js";import{n as oe,r as se,t as ce}from"./shield-check-CkA2viVW.js";import{t as le}from"./eye-B0DFz5hL.js";import{t as ue}from"./file-text-T-NcAlZs.js";import{t as de}from"./rotate-ccw-WNFNkKQD.js";import{t as fe}from"./search-eWVnAJsb.js";import{t as pe}from"./sparkles-DuclzqlE.js";import{t as me}from"./terminal-DOS1s1gm.js";import{t as he}from"./wrench-BJNNe07k.js";import{t as ge}from"./x-CsRC_tCI.js";import{t as P}from"./preload-helper-Czpn1I53.js";import{a as _e,i as ve,n as ye,o as be,r as xe,s as Se}from"./dist-CZDnnosQ.js";import"./cn-C8c0S2mI.js";import{r as Ce}from"./workspace-path-nav-C0AQNZyy.js";import{n as we,r as Te,t as Ee}from"./collapsible-BoXtZZWN.js";import{t as De}from"./agent-disclosure-B8SnhQXL.js";import{t as Oe}from"./safe-external-url-D3PJJIcM.js";import{o as ke}from"./surfaces-DI-U-_2a.js";import{n as Ae,t as je}from"./range-BWOHiLNe.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`}]]),F=t(n(),1),I=r(),Ie=new Map;function Le(e){return{state:e.state,inputJson:JSON.stringify(e.input||{}),outputJson:JSON.stringify(e.output||{})}}function Re(e,t){let n=Ie.get(e),r=Le(t);if(!n)return Ie.set(e,r),!0;let i=n.state!==r.state||n.inputJson!==r.inputJson||n.outputJson!==r.outputJson;return i&&Ie.set(e,r),i}function ze(e,t){if(e.toolCallId!==t.toolCallId||e.type!==t.type)return!1;let n=t.toolCallId;return n?!Re(n,t):e.state===t.state}function Be(e){return e.output!==void 0&&e.output!==null||e.state===`error`||e.state===`result`}function Ve(e,t){return ze(e.part,t.part)?Be(t.part)?!0:e.chatStatus===t.chatStatus:!1}function He(e){if(e<1e3)return``;let t=Math.floor(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60),r=t%60;return r===0?`${n}m`:`${n}m ${r}s`}function Ue(e,t){let n=e.state!==`output-available`&&e.state!==`output-error`,r=e.state===`output-error`||e.state===`output-available`&&e.output?.success===!1,i=e.state===`output-available`&&!r;return{isPending:n&&t===`streaming`,isError:r,isSuccess:i,isInterrupted:n&&t!==`streaming`&&t!==void 0}}var We=`__custom__`;function Ge(e){return String.fromCharCode(65+e)}function Ke(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(We),{selectedIds:Array.from(r),customText:i,textValue:``}}function qe({questions:e,questionIndex:t=1,totalQuestions:n,onPreviousQuestion:r,onNextQuestion:i,submitLabel:a=`Send`,nextLabel:o=`Next`,skipLabel:s=`Skip`,allowSkip:c=!0,initialAnswer:l,onSubmit:u,onSkip:d,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,F.useState)(()=>Ke(l,g?.kind,_).selectedIds),[b,x]=(0,F.useState)(()=>Ke(l,g?.kind,_).customText),[S,C]=(0,F.useState)(()=>Ke(l,g?.kind,_).textValue),w=m>1&&(!!r||!!i),T=h>1,E=h<m,D=h>=m,O=(0,F.useMemo)(()=>new Set(v),[v]),k=D?a:o,A=(0,F.useMemo)(()=>{if(g?.kind===`text`)return S.trim().length>0;let e=v.filter(e=>e!==We).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])},N=e=>{if(x(e),g){if(g.kind===`single`){y(e.trim().length>0?[We]:[]);return}y(t=>{let n=t.includes(We);return e.trim().length>0&&!n?[...t,We]:e.trim().length===0&&n?t.filter(e=>e!==We):t})}};return g?(0,I.jsxs)(`div`,{className:f(`flex flex-col gap-2 bg-background px-3 py-2`,p),children:[(0,I.jsx)(`div`,{className:`flex items-center justify-between gap-px`,"data-total-questions":m,children:(0,I.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-an-tool-color`,children:[(0,I.jsx)(`span`,{className:`inline-flex h-5 min-w-5 items-center justify-center rounded px-1 text-sm font-medium text-an-tool-color-muted`,children:h}),(0,I.jsx)(`span`,{children:g.title})]})}),g.kind!==`text`&&(g.options?.length??0)>0&&(0,I.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,I.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-an-background-secondary`,children:[(0,I.jsx)(`span`,{className:f(`inline-flex h-5 min-w-5 items-center justify-center rounded border px-1 text-sm font-medium`,r?`border-an-primary-color bg-an-primary-color text-an-send-button-color`:`border-border bg-transparent text-an-tool-color-muted`),children:Ge(t)}),(0,I.jsxs)(`span`,{className:`text-sm text-an-tool-color`,children:[e.label,e.description&&(0,I.jsxs)(`span`,{className:`text-an-tool-color-muted`,children:[` `,e.description]})]})]},n)}),_&&(0,I.jsxs)(`div`,{className:`flex items-center gap-2 pt-1`,children:[(0,I.jsx)(`span`,{className:f(`inline-flex h-5 min-w-5 items-center justify-center rounded border px-1 text-sm font-medium`,v.includes(We)?`border-an-primary-color bg-an-primary-color text-an-send-button-color`:`border-border bg-transparent text-an-tool-color-muted`),children:Ge(g.options.length)}),(0,I.jsx)(`input`,{value:b,onChange:e=>N(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-an-tool-color md:text-sm`})]})]}),g.kind===`text`&&(0,I.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-an-tool-color md:text-sm`}),(0,I.jsxs)(`div`,{className:f(`flex items-center gap-1.5`,w?`justify-between`:`justify-end`),children:[w&&(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[r&&(0,I.jsx)(`button`,{type:`button`,onClick:r,disabled:!T,className:`h-6 rounded px-2 text-sm text-muted-foreground hover:text-an-tool-color disabled:opacity-60`,children:`Previous`}),i&&(0,I.jsx)(`button`,{type:`button`,onClick:i,disabled:!E,className:`h-6 rounded px-2 text-sm text-muted-foreground hover:text-an-tool-color disabled:opacity-60`,children:`Next`})]}),(0,I.jsxs)(`div`,{className:`flex items-center justify-end gap-1.5`,children:[c&&(0,I.jsx)(`button`,{type:`button`,onClick:()=>{d?.(),u({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-an-tool-color active:scale-[0.98]`,children:s}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>{if(!A||!g)return;if(g.kind===`text`){u({kind:`text`,questionId:g.id,text:S.trim()});return}let e=v.filter(e=>e!==We),t=b.trim()||void 0;u({kind:g.kind,questionId:g.id,selectedIds:e,text:t||void 0})},disabled:!A,className:`h-6 rounded bg-an-primary-color px-2.5 text-sm font-medium text-an-send-button-color transition-[background-color,transform] duration-150 hover:bg-an-primary-color/90 active:scale-[0.98] disabled:opacity-60 disabled:hover:bg-an-primary-color disabled:active:scale-100`,children:k})]})]})]}):null}function Je(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 Ye({part:e}){let[t,n]=(0,F.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,F.useState)({}),[d,f]=(0,F.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,F.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,v=i>1&&!_,y=s>1,b=s<i,x=(0,F.useMemo)(()=>!_||i<=1?[]:Array.from({length:i},(e,t)=>({index:t+1,answer:l[t+1]})),[_,l,i]),S=(0,F.useMemo)(()=>_?x.length>0?x.map(e=>`${e.index}: ${e.answer?Je(e.answer):`Pending`}`).join(` • `):h?Je(h):l[s]?Je(l[s]):`Pending`:``,[_,x,h,l,s]);if(!c)return null;let C=()=>{y&&(e.input?.onPreviousQuestion?.(),a||n(e=>Math.max(1,e-1)))},T=()=>{b&&(e.input?.onNextQuestion?.(),a||n(e=>Math.min(i,e+1)))};return(0,I.jsxs)(`div`,{className:`overflow-hidden rounded-an-tool-border-radius border border-border bg-an-tool-background`,children:[(0,I.jsxs)(`div`,{className:`flex h-7 items-center justify-between border-b border-border px-3 text-xs text-an-tool-color-muted`,children:[(0,I.jsxs)(`div`,{className:`inline-flex items-center gap-1.5`,children:[(0,I.jsx)(w,{className:`size-3.5`}),`Question`]}),v&&(0,I.jsxs)(`div`,{className:`inline-flex items-center gap-1`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:C,disabled:!y,className:`inline-flex size-5 items-center justify-center rounded-[4px] hover:bg-an-background-secondary disabled:opacity-40`,"aria-label":`Previous question`,children:(0,I.jsx)(O,{className:`size-3.5`})}),(0,I.jsxs)(`span`,{children:[s,` of `,i]}),(0,I.jsx)(`button`,{type:`button`,onClick:T,disabled:!b,className:`inline-flex size-5 items-center justify-center rounded-[4px] hover:bg-an-background-secondary disabled:opacity-40`,"aria-label":`Next question`,children:(0,I.jsx)(E,{className:`size-3.5`})})]})]}),_?(0,I.jsx)(`div`,{className:`bg-background px-3 py-2 text-xs text-an-tool-color-muted`,children:S}):(0,I.jsx)(qe,{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&&T()}},`${s}-${c.title}`)]})}function Xe(e){if(!e)return``;let t=Ce(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 Ze(e,t){let n=e.split(`
2
2
  `),r=t.split(`
3
3
  `),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 Qe={"tool-Task":{icon:pe,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:pe,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:pe,title:()=>`Skill`,subtitle:e=>e.input?.skill||``,variant:`simple`},"tool-Grep":{icon:fe,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 ${Xe(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:le,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:ie,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}=Ze(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:me,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=>Xe(e)),n.length>50?`${n.slice(0,47)}...`:n},variant:`simple`},"tool-IPython":{icon:ie,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(`
4
- `,1)[0].trim();return n.length>50?`${n.slice(0,47)}...`:n},variant:`simple`},"tool-WebFetch":{icon:oe,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:fe,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:x,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:pe,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:y,title:e=>e.state!==`output-available`&&e.state!==`output-error`?`Finishing plan`:`Plan complete`,variant:`simple`},"tool-NotebookEdit":{icon:ie,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:me,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=>Xe(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:se,title:e=>e.state!==`output-available`&&e.state!==`output-error`?`Cloning repo`:`Repo cloned`,subtitle:e=>e.input?.repo??``,variant:`simple`},"tool-Thinking":{icon:pe,title:e=>e.state!==`output-available`&&e.state!==`output-error`?`Thinking...`:`Thought`,variant:`collapsible`}},$e=`tool-mcp__`,et={"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 tt(e){let t=et[e];if(t)return t;if(!e.startsWith($e))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 nt({icon:e,shimmerLabel:t,completeLabel:n,isAnimating:r,detail:i,onDetailClick:a,trailingContent:o,expandable:s=!1,expanded:c,defaultOpen:l=!1,onToggleExpand:u,children:d}){let p=!r,m=c??!1,h=s&&(p||m||r),g=(0,I.jsxs)(`div`,{className:f(`flex max-w-full items-center gap-1 rounded-an-tool-border-radius select-none`,h?`cursor-pointer`:`cursor-default`),children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-sm text-muted-foreground`,children:[e&&(0,I.jsx)(`span`,{className:`flex size-3 shrink-0 items-center justify-center`,children:e}),(0,I.jsx)(`span`,{className:`shrink-0 font-[450] whitespace-nowrap`,children:r&&t?(0,I.jsx)(N,{as:`span`,duration:1.2,className:`m-0 inline-flex h-4 items-center leading-none`,children:t}):n}),i&&(a?(0,I.jsx)(`button`,{type:`button`,onClick:a,className:`min-w-0 flex-1 truncate text-left font-normal text-an-foreground-muted/60 underline-offset-2 hover:text-an-foreground-muted hover:underline`,children:i}):(0,I.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-normal text-an-foreground-muted/60`,children:i})),o]}),s&&(p||m||r)&&(0,I.jsx)(`div`,{children:(0,I.jsx)(D,{className:f(`shrink-0 text-muted-foreground transition-transform duration-150 ease-out`,`size-3`,`rotate-0 group-data-panel-open:rotate-90`)})})]});return s?(0,I.jsxs)(Ee,{className:`flex w-full flex-col gap-2`,...c===void 0?{defaultOpen:l}:{open:c,onOpenChange:u},children:[(0,I.jsx)(Te,{className:`group flex`,disabled:!h,"aria-disabled":!h,children:g}),(0,I.jsx)(we,{className:f(`overflow-hidden`,`h-[var(--collapsible-panel-height)] transition-all duration-150 ease-out`,`data-ending-style:h-0 data-starting-style:h-0`,`[&[hidden]:not([hidden='until-found'])]:hidden`),children:d})]}):(0,I.jsx)(`div`,{className:`flex flex-col gap-1`,children:g})}var rt=(0,F.memo)(function({icon:e,title:t,subtitle:n,isPending:r,onSubtitleClick:i}){let a=e;return(0,I.jsx)(nt,{icon:a?(0,I.jsx)(a,{className:`h-full w-full shrink-0 text-muted-foreground`}):void 0,shimmerLabel:t,completeLabel:t,isAnimating:r,detail:n,onDetailClick:i})});function it(e){return e.split(`|`).map(e=>e.trim().split(/\s+/)[0]??``).filter(Boolean).slice(0,4).join(`, `)}function at({step:e,state:t,onComplete:n,approval:r}){ee(t===`animating`,e.duration,n);let i=t===`animating`,a=e.bashCommand??e.toolDetail,o=it(a);return(0,I.jsxs)(`div`,{className:`overflow-hidden rounded-an-tool-border-radius border border-border bg-an-tool-background`,children:[(0,I.jsxs)(`div`,{className:`flex h-7 items-center justify-between pr-2 pl-2.5`,children:[(0,I.jsx)(`div`,{className:`flex min-w-0 items-center gap-1.5 overflow-hidden`,children:i?(0,I.jsxs)(N,{as:`span`,duration:1.2,className:`m-0 inline-flex h-full items-center truncate text-xs leading-none`,children:[`Running command: `,o]}):(0,I.jsxs)(`span`,{className:`truncate text-xs text-muted-foreground`,children:[`Ran command: `,o]})}),i&&(0,I.jsx)(`svg`,{className:`h-3 w-3 shrink-0 animate-spin text-muted-foreground`,viewBox:`0 0 16 16`,fill:`none`,children:(0,I.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6`,stroke:`currentColor`,strokeWidth:`1.5`,strokeDasharray:`28`,strokeDashoffset:`7`,strokeLinecap:`round`})})]}),(0,I.jsxs)(`div`,{className:`overflow-hidden border-t border-border bg-background px-2.5 py-1.5 font-mono text-[12px] leading-[16px]`,children:[(0,I.jsxs)(`div`,{className:`break-all`,children:[(0,I.jsxs)(`span`,{className:`text-amber-600 select-none dark:text-amber-400`,children:[`$`,` `]}),(0,I.jsx)(`span`,{className:`text-foreground`,children:a})]}),!i&&e.bashOutput&&(0,I.jsx)(`div`,{className:`mt-1 max-h-[80px] overflow-hidden whitespace-pre-line text-muted-foreground`,children:e.bashOutput})]}),r&&(0,I.jsx)(te,{isPending:i,...r})]})}var ot=(0,F.memo)(function({part:e}){let t=e.input?.approval??e.args?.approval,{step:n,stepState:r}=ne(e,`Bash`);return(0,I.jsx)(at,{step:n,state:r,onComplete:()=>{},approval:t})});function st(e){let t=(0,F.useRef)(e);return(0,F.useInsertionEffect)(()=>void(t.current=e)),(0,F.useCallback)((...e)=>t.current(...e),[])}var ct=(0,F.createContext)(void 0);function lt(){return(0,F.useContext)(ct)}var ut={position:`absolute`,top:0,bottom:0,textAlign:`center`,whiteSpace:`normal`,touchAction:`none`},dt={display:`contents`};function ft(){return null}var pt=`diffs-container`,mt=/(?=^diff --git)/gm,ht=/(?<=\n)/,gt=/^(---|\+\+\+)\s+([^\t\r\n]+)/,_t=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,vt=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,yt=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,bt=`header-prefix`,xt=`header-filename-suffix`,St=`header-metadata`,Ct=`header-custom`,L={dark:`pierre-dark`,light:`pierre-light`},wt=`data-theme-css`,Tt=`data-unsafe-css`,Et=`data-diffs-scrollbar-measure`,Dt=`--diffs-scrollbar-gutter-measured`,Ot=1e5,kt={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8};({...kt});var At=Object.freeze({fromStart:0,fromEnd:0}),jt={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},Mt={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0};function Nt(e){return`annotation-${`side`in e?`${e.side}-`:``}${e.lineNumber}`}function Pt({hunkIndex:e,lineIndex:t,conflictIndex:n}){return`merge-conflict-action-${e}-${t}-${n}`}function R(e,t){return e-(t===0?0:1)}function z(e,t){return R(e,t)+t}function Ft(e,t){let n=t.hunks[e.hunkIndex];if(n!=null)return{hunkIndex:e.hunkIndex,lineIndex:It(n,e.startContentIndex)}}function It(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 Lt({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,I.jsxs)(I.Fragment,{children:[f==null?(0,I.jsxs)(I.Fragment,{children:[p!=null&&(0,I.jsx)(`div`,{slot:`header-prefix`,children:p}),m!=null&&(0,I.jsx)(`div`,{slot:`header-filename-suffix`,children:m}),h!=null&&(0,I.jsx)(`div`,{slot:`header-metadata`,children:h})]}):(0,I.jsx)(`div`,{slot:Ct,children:f}),o!=null&&l?.map((e,t)=>(0,I.jsx)(`div`,{slot:Nt(e),children:o(e)},t)),t!=null&&c!=null&&d!=null&&t.map(t=>{if(t==null)return;let n=Rt(t,e);return(0,I.jsx)(`div`,{slot:n,style:dt,children:c(t,d)},n)}),s!=null&&(0,I.jsx)(`div`,{slot:`gutter-utility-slot`,style:ut,children:s(u)})]})}function Rt(e,t){let n=Ft(e,t);return n==null?void 0:Pt({hunkIndex:n.hunkIndex,lineIndex:n.lineIndex,conflictIndex:e.conflictIndex})}function zt(e,t){return e==null||t==null||typeof e==`string`||typeof t==`string`?e===t:e.dark===t.dark&&e.light===t.light}function Bt(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}var Vt=new Set;function Ht(e){let t=[],n=new Set;for(let r of Ut(e.themes)){let e=Kt(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 Ht({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 Ht({themes:t})},registerInto(e){for(let t of r)e.registerThemeIfAbsent(t.name,t.load)}}}function Ut(e){return Wt(e)?[e]:e}function Wt(e){return Kt(e)||Gt(e)}function Gt(e){return typeof e.name==`string`&&typeof e.load==`function`}function Kt(e){return typeof e.getThemes==`function`}function qt(e){return typeof e==`object`&&e&&`default`in e?e.default:e}var Jt=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name=`DuplicateThemeError`}},Yt=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name=`UnregisteredThemeError`}},Xt=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name=`UnresolvedThemeError`}};function Zt(){let e=new Map,t=new Map,n=new Map,r=0;function i(t,n){if(e.has(t))throw new Jt(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 Yt(i));let c=r,l=s().then(e=>{let a=qt(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 Xt(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 Qt=Zt();function $t(e,t){e=Array.isArray(e)?e:[e];for(let n of e){let e;if(typeof n==`string`){if(e=Qt.getResolvedTheme(n),e==null)throw Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else e=n,n=n.name,Qt.getResolvedTheme(n)??Qt.seedResolvedTheme(n,e);Vt.has(n)||(Vt.add(n),t.loadThemeSync(e))}}var en=new Map,tn=new Map,nn=new Map,rn=new Set;function an(e,t){e=Array.isArray(e)?e:[e];for(let n of e){if(rn.has(n.name))continue;let e=en.get(n.name);e??(e=n,en.set(n.name,e)),rn.add(e.name),t.loadLanguageSync(e.data)}}function on(){return typeof WorkerGlobalScope<`u`&&typeof self<`u`&&self instanceof WorkerGlobalScope}async function sn(e){if(on())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=tn.get(e);if(t!=null)return t;try{let t=nn.get(e);if(t==null&&Object.prototype.hasOwnProperty.call(Se,e)&&(t=Se[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 en.has(e)||en.set(e,n),n});return tn.set(e,n),await n}finally{tn.delete(e)}}function cn(e){return en.get(e)??sn(e)}function ln({name:e,load:t,colorScheme:n,collection:r,displayName:i}){return{name:e,colorScheme:n,collection:r,displayName:i,load:un(t)}}function un(e){return async()=>_e(qt(await e()))}var dn=`pierre`,fn=[`pierre-dark`,`pierre-dark-soft`,`pierre-dark-vibrant`,`pierre-dark-protanopia-deuteranopia`,`pierre-dark-tritanopia`],pn=[`pierre-light`,`pierre-light-soft`,`pierre-light-vibrant`,`pierre-light-protanopia-deuteranopia`,`pierre-light-tritanopia`],mn=[...pn,...fn],hn=new Set(pn);function gn(e){return hn.has(e)?`light`:`dark`}var _n={"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`},vn={"pierre-dark":()=>P(()=>import(`./pierre-dark-CpLgRqie.js`),[]),"pierre-dark-soft":()=>P(()=>import(`./pierre-dark-soft-kZQmAZld.js`),[]),"pierre-dark-vibrant":()=>P(()=>import(`./pierre-dark-vibrant-CpQYzh95.js`),[]),"pierre-dark-protanopia-deuteranopia":()=>P(()=>import(`./pierre-dark-protanopia-deuteranopia-B35FxJx-.js`),[]),"pierre-dark-tritanopia":()=>P(()=>import(`./pierre-dark-tritanopia-CpjhbsIL.js`),[]),"pierre-light":()=>P(()=>import(`./pierre-light-CoaEpmwp.js`),[]),"pierre-light-soft":()=>P(()=>import(`./pierre-light-soft-lWLdNTOI.js`),[]),"pierre-light-vibrant":()=>P(()=>import(`./pierre-light-vibrant-D80Fkn33.js`),[]),"pierre-light-protanopia-deuteranopia":()=>P(()=>import(`./pierre-light-protanopia-deuteranopia-0fSaH845.js`),[]),"pierre-light-tritanopia":()=>P(()=>import(`./pierre-light-tritanopia-CEbqgOJL.js`),[])};function yn(e){return ln({name:e,collection:dn,colorScheme:gn(e),displayName:_n[e],load:vn[e]})}var bn=Ht({themes:mn.map(e=>yn(e))}),xn=`shiki`,Sn=[`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`],Cn=`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(`.`),wn=new Set(Sn);function Tn(e){return wn.has(e)?`light`:`dark`}var En={andromeeda:()=>P(()=>import(`./andromeeda-vGVdxbeo.js`),[]),"aurora-x":()=>P(()=>import(`./aurora-x-CDeNXAV0.js`),[]),"ayu-dark":()=>P(()=>import(`./ayu-dark-DluEY0Gj.js`),[]),"ayu-light":()=>P(()=>import(`./ayu-light-C3h-C4tm.js`),[]),"ayu-mirage":()=>P(()=>import(`./ayu-mirage-Bqwy1Gya.js`),[]),"catppuccin-frappe":()=>P(()=>import(`./catppuccin-frappe-C9Q5zVZY.js`),[]),"catppuccin-latte":()=>P(()=>import(`./catppuccin-latte-CtsyrtPq.js`),[]),"catppuccin-macchiato":()=>P(()=>import(`./catppuccin-macchiato-R8nAf1vR.js`),[]),"catppuccin-mocha":()=>P(()=>import(`./catppuccin-mocha-DjuaAJKi.js`),[]),"dark-plus":()=>P(()=>import(`./dark-plus-Cs2F2srj.js`),[]),dracula:()=>P(()=>import(`./dracula-BHWKrbxM.js`),[]),"dracula-soft":()=>P(()=>import(`./dracula-soft-5eyTD99u.js`),[]),"everforest-dark":()=>P(()=>import(`./everforest-dark-sB-x3p7T.js`),[]),"everforest-light":()=>P(()=>import(`./everforest-light-Df2xbC6M.js`),[]),"github-dark":()=>P(()=>import(`./github-dark-C-LZuMrd.js`),[]),"github-dark-default":()=>P(()=>import(`./github-dark-default-DXG-b-1a.js`),[]),"github-dark-dimmed":()=>P(()=>import(`./github-dark-dimmed-Bx1FflLF.js`),[]),"github-dark-high-contrast":()=>P(()=>import(`./github-dark-high-contrast-B_tTalzw.js`),[]),"github-light":()=>P(()=>import(`./github-light-EUqPIrTm.js`),[]),"github-light-default":()=>P(()=>import(`./github-light-default-BXViO-2h.js`),[]),"github-light-high-contrast":()=>P(()=>import(`./github-light-high-contrast-B68TUdTA.js`),[]),"gruvbox-dark-hard":()=>P(()=>import(`./gruvbox-dark-hard-C820rvS2.js`),[]),"gruvbox-dark-medium":()=>P(()=>import(`./gruvbox-dark-medium-BPjhmG05.js`),[]),"gruvbox-dark-soft":()=>P(()=>import(`./gruvbox-dark-soft-MrdJrrXF.js`),[]),"gruvbox-light-hard":()=>P(()=>import(`./gruvbox-light-hard-BC_s9l72.js`),[]),"gruvbox-light-medium":()=>P(()=>import(`./gruvbox-light-medium-BAWPOn9u.js`),[]),"gruvbox-light-soft":()=>P(()=>import(`./gruvbox-light-soft-BSMLrYjP.js`),[]),horizon:()=>P(()=>import(`./horizon-CE9ld1lL.js`),[]),"horizon-bright":()=>P(()=>import(`./horizon-bright-DSNQnXHK.js`),[]),houston:()=>P(()=>import(`./houston-CsvMBhTu.js`),[]),"kanagawa-dragon":()=>P(()=>import(`./kanagawa-dragon-Bozd7klA.js`),[]),"kanagawa-lotus":()=>P(()=>import(`./kanagawa-lotus-BmuOG9ZW.js`),[]),"kanagawa-wave":()=>P(()=>import(`./kanagawa-wave-BML5mF2J.js`),[]),laserwave:()=>P(()=>import(`./laserwave-C_8bwKvT.js`),[]),"light-plus":()=>P(()=>import(`./light-plus-DVQuIRkW.js`),[]),"material-theme":()=>P(()=>import(`./material-theme-Bm3Qr25_.js`),[]),"material-theme-darker":()=>P(()=>import(`./material-theme-darker-2IIEA8gg.js`),[]),"material-theme-lighter":()=>P(()=>import(`./material-theme-lighter-uhdI0v04.js`),[]),"material-theme-ocean":()=>P(()=>import(`./material-theme-ocean-CHQ94UKr.js`),[]),"material-theme-palenight":()=>P(()=>import(`./material-theme-palenight-B5W6OYN7.js`),[]),"min-dark":()=>P(()=>import(`./min-dark-BSWPekZh.js`),[]),"min-light":()=>P(()=>import(`./min-light-DDpmG2fV.js`),[]),monokai:()=>P(()=>import(`./monokai-B_bV9PQ9.js`),[]),"night-owl":()=>P(()=>import(`./night-owl-DhmEMT88.js`),[]),"night-owl-light":()=>P(()=>import(`./night-owl-light-eJ-hLW7d.js`),[]),nord:()=>P(()=>import(`./nord-Cb4Vim4T.js`),[]),"one-dark-pro":()=>P(()=>import(`./one-dark-pro-CLwyXe_n.js`),[]),"one-light":()=>P(()=>import(`./one-light-D7Lr4KcI.js`),[]),plastic:()=>P(()=>import(`./plastic-DQwYfKfQ.js`),[]),poimandres:()=>P(()=>import(`./poimandres-DRFjx7u4.js`),[]),red:()=>P(()=>import(`./red-DX1BQOs8.js`),[]),"rose-pine":()=>P(()=>import(`./rose-pine-aMsaMD1D.js`),[]),"rose-pine-dawn":()=>P(()=>import(`./rose-pine-dawn-8PwUyIlP.js`),[]),"rose-pine-moon":()=>P(()=>import(`./rose-pine-moon-DO-qXg-I.js`),[]),"slack-dark":()=>P(()=>import(`./slack-dark-DnToyrRv.js`),[]),"slack-ochin":()=>P(()=>import(`./slack-ochin-B2OO5cIa.js`),[]),"snazzy-light":()=>P(()=>import(`./snazzy-light-4G7pJPwS.js`),[]),"solarized-dark":()=>P(()=>import(`./solarized-dark-UdsmMDCL.js`),[]),"solarized-light":()=>P(()=>import(`./solarized-light-C1IUL_tW.js`),[]),"synthwave-84":()=>P(()=>import(`./synthwave-84-nFMaYfgc.js`),[]),"tokyo-night":()=>P(()=>import(`./tokyo-night-oM2G3aXe.js`),[]),vesper:()=>P(()=>import(`./vesper-DdrHHSXu.js`),[]),"vitesse-black":()=>P(()=>import(`./vitesse-black-fwtXNY1n.js`),[]),"vitesse-dark":()=>P(()=>import(`./vitesse-dark-BZCL-v6S.js`),[]),"vitesse-light":()=>P(()=>import(`./vitesse-light-VbXTXTou.js`),[])};function Dn(e){return ln({name:e,collection:xn,colorScheme:Tn(e),load:En[e]})}var On=Ht({themes:Object.freeze([...Sn.map(e=>Dn(e)),...Cn.map(e=>Dn(e))])});function kn(e){if(on())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(Qt.hasRegisteredTheme(e))return;let t=On.getTheme(e);if(t!=null){Qt.registerThemeIfAbsent(t.name,t.load);return}throw Error(`No valid theme loader registered for "${e}"`)}function An(e,t){if(t.name!==e)throw Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${t.name}`)}async function jn(e){kn(e);let t=await Qt.resolveTheme(e);return An(e,t),t}function Mn(e){return Qt.getResolvedTheme(e)??jn(e)}var B;async function Nn({themes:e,langs:t,preferredHighlighter:n=`shiki-js`}){B??=xe({themes:[],langs:[`text`],engine:n===`shiki-wasm`?be(P(()=>import(`./wasm-BnjxR4X6.js`),[])):ye()});let r=Fn(B)?await B:B;B=r;let i=[];for(let e of t){if(e===`text`||e===`ansi`)continue;let t=cn(e);`then`in t?i.push(t):an(t,r)}let a=[];for(let t of e){let e=Mn(t);`then`in e?a.push(e):$t(e,B)}return(i.length>0||a.length>0)&&await Promise.all([Promise.all(i).then(e=>{an(e,r)}),Promise.all(a).then(e=>{$t(e,r)})]),r}function Pn(){if(B!=null&&!(`then`in B))return B}function Fn(e=B){return e!=null&&`then`in e}for(let e of bn.getThemes())Qt.registerThemeIfAbsent(e.name,e.load);function In(e=L){let t=[];return typeof e==`string`?t.push(e):(t.push(e.dark),t.push(e.light)),t}var Ln=new Map,Rn={"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 zn(e){if(Ln.has(e))return Ln.get(e)??`text`;if(Rn[e]!=null)return Rn[e];let t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(Ln.has(t[1]))return Ln.get(t[1])??`text`;if(Rn[t[1]]!=null)return Rn[t[1]]??`text`}let n=e.match(/\.([^.]+)$/)?.[1]??``;return Ln.has(n)?Ln.get(n)??`text`:Rn[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 Bn({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 Vn(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 Hn(e){return H({tagName:`div`,properties:{"data-gutter":``},children:e})}function Un(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 Wn(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(`
4
+ `,1)[0].trim();return n.length>50?`${n.slice(0,47)}...`:n},variant:`simple`},"tool-WebFetch":{icon:oe,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:fe,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:x,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:pe,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:y,title:e=>e.state!==`output-available`&&e.state!==`output-error`?`Finishing plan`:`Plan complete`,variant:`simple`},"tool-NotebookEdit":{icon:ie,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:me,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=>Xe(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:se,title:e=>e.state!==`output-available`&&e.state!==`output-error`?`Cloning repo`:`Repo cloned`,subtitle:e=>e.input?.repo??``,variant:`simple`},"tool-Thinking":{icon:pe,title:e=>e.state!==`output-available`&&e.state!==`output-error`?`Thinking...`:`Thought`,variant:`collapsible`}},$e=`tool-mcp__`,et={"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 tt(e){let t=et[e];if(t)return t;if(!e.startsWith($e))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 nt({icon:e,shimmerLabel:t,completeLabel:n,isAnimating:r,detail:i,onDetailClick:a,trailingContent:o,expandable:s=!1,expanded:c,defaultOpen:l=!1,onToggleExpand:u,children:d}){let p=!r,m=c??!1,h=s&&(p||m||r),g=(0,I.jsxs)(`div`,{className:f(`flex max-w-full items-center gap-1 rounded-an-tool-border-radius select-none`,h?`cursor-pointer`:`cursor-default`),children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-sm text-muted-foreground`,children:[e&&(0,I.jsx)(`span`,{className:`flex size-3 shrink-0 items-center justify-center`,children:e}),(0,I.jsx)(`span`,{className:`shrink-0 font-[450] whitespace-nowrap`,children:r&&t?(0,I.jsx)(N,{as:`span`,duration:1.2,className:`m-0 inline-flex h-4 items-center leading-none`,children:t}):n}),i&&(a?(0,I.jsx)(`button`,{type:`button`,onClick:a,className:`min-w-0 flex-1 truncate text-left font-normal text-an-foreground-muted/60 underline-offset-2 hover:text-an-foreground-muted hover:underline`,children:i}):(0,I.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-normal text-an-foreground-muted/60`,children:i})),o]}),s&&(p||m||r)&&(0,I.jsx)(`div`,{children:(0,I.jsx)(D,{className:f(`shrink-0 text-muted-foreground transition-transform duration-150 ease-out`,`size-3`,`rotate-0 group-data-panel-open:rotate-90`)})})]});return s?(0,I.jsxs)(Ee,{className:`flex w-full flex-col gap-2`,...c===void 0?{defaultOpen:l}:{open:c,onOpenChange:u},children:[(0,I.jsx)(Te,{className:`group flex`,disabled:!h,"aria-disabled":!h,children:g}),(0,I.jsx)(we,{className:f(`overflow-hidden`,`h-[var(--collapsible-panel-height)] transition-all duration-150 ease-out`,`data-ending-style:h-0 data-starting-style:h-0`,`[&[hidden]:not([hidden='until-found'])]:hidden`),children:d})]}):(0,I.jsx)(`div`,{className:`flex flex-col gap-1`,children:g})}var rt=(0,F.memo)(function({icon:e,title:t,subtitle:n,isPending:r,onSubtitleClick:i}){let a=e;return(0,I.jsx)(nt,{icon:a?(0,I.jsx)(a,{className:`h-full w-full shrink-0 text-muted-foreground`}):void 0,shimmerLabel:t,completeLabel:t,isAnimating:r,detail:n,onDetailClick:i})});function it(e){return e.split(`|`).map(e=>e.trim().split(/\s+/)[0]??``).filter(Boolean).slice(0,4).join(`, `)}function at({step:e,state:t,onComplete:n,approval:r}){ee(t===`animating`,e.duration,n);let i=t===`animating`,a=e.bashCommand??e.toolDetail,o=it(a);return(0,I.jsxs)(`div`,{className:`overflow-hidden rounded-an-tool-border-radius border border-border bg-an-tool-background`,children:[(0,I.jsxs)(`div`,{className:`flex h-7 items-center justify-between pr-2 pl-2.5`,children:[(0,I.jsx)(`div`,{className:`flex min-w-0 items-center gap-1.5 overflow-hidden`,children:i?(0,I.jsxs)(N,{as:`span`,duration:1.2,className:`m-0 inline-flex h-full items-center truncate text-xs leading-none`,children:[`Running command: `,o]}):(0,I.jsxs)(`span`,{className:`truncate text-xs text-muted-foreground`,children:[`Ran command: `,o]})}),i&&(0,I.jsx)(`svg`,{className:`h-3 w-3 shrink-0 animate-spin text-muted-foreground`,viewBox:`0 0 16 16`,fill:`none`,children:(0,I.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6`,stroke:`currentColor`,strokeWidth:`1.5`,strokeDasharray:`28`,strokeDashoffset:`7`,strokeLinecap:`round`})})]}),(0,I.jsxs)(`div`,{className:`overflow-hidden border-t border-border bg-background px-2.5 py-1.5 font-mono text-[0.75rem] leading-[16px]`,children:[(0,I.jsxs)(`div`,{className:`break-all`,children:[(0,I.jsxs)(`span`,{className:`text-amber-600 select-none dark:text-amber-400`,children:[`$`,` `]}),(0,I.jsx)(`span`,{className:`text-foreground`,children:a})]}),!i&&e.bashOutput&&(0,I.jsx)(`div`,{className:`mt-1 max-h-[80px] overflow-hidden whitespace-pre-line text-muted-foreground`,children:e.bashOutput})]}),r&&(0,I.jsx)(te,{isPending:i,...r})]})}var ot=(0,F.memo)(function({part:e}){let t=e.input?.approval??e.args?.approval,{step:n,stepState:r}=ne(e,`Bash`);return(0,I.jsx)(at,{step:n,state:r,onComplete:()=>{},approval:t})});function st(e){let t=(0,F.useRef)(e);return(0,F.useInsertionEffect)(()=>void(t.current=e)),(0,F.useCallback)((...e)=>t.current(...e),[])}var ct=(0,F.createContext)(void 0);function lt(){return(0,F.useContext)(ct)}var ut={position:`absolute`,top:0,bottom:0,textAlign:`center`,whiteSpace:`normal`,touchAction:`none`},dt={display:`contents`};function ft(){return null}var pt=`diffs-container`,mt=/(?=^diff --git)/gm,ht=/(?<=\n)/,gt=/^(---|\+\+\+)\s+([^\t\r\n]+)/,_t=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,vt=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,yt=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,bt=`header-prefix`,xt=`header-filename-suffix`,St=`header-metadata`,Ct=`header-custom`,L={dark:`pierre-dark`,light:`pierre-light`},wt=`data-theme-css`,Tt=`data-unsafe-css`,Et=`data-diffs-scrollbar-measure`,Dt=`--diffs-scrollbar-gutter-measured`,Ot=1e5,kt={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8};({...kt});var At=Object.freeze({fromStart:0,fromEnd:0}),jt={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},Mt={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0};function Nt(e){return`annotation-${`side`in e?`${e.side}-`:``}${e.lineNumber}`}function Pt({hunkIndex:e,lineIndex:t,conflictIndex:n}){return`merge-conflict-action-${e}-${t}-${n}`}function R(e,t){return e-(t===0?0:1)}function z(e,t){return R(e,t)+t}function Ft(e,t){let n=t.hunks[e.hunkIndex];if(n!=null)return{hunkIndex:e.hunkIndex,lineIndex:It(n,e.startContentIndex)}}function It(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 Lt({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,I.jsxs)(I.Fragment,{children:[f==null?(0,I.jsxs)(I.Fragment,{children:[p!=null&&(0,I.jsx)(`div`,{slot:`header-prefix`,children:p}),m!=null&&(0,I.jsx)(`div`,{slot:`header-filename-suffix`,children:m}),h!=null&&(0,I.jsx)(`div`,{slot:`header-metadata`,children:h})]}):(0,I.jsx)(`div`,{slot:Ct,children:f}),o!=null&&l?.map((e,t)=>(0,I.jsx)(`div`,{slot:Nt(e),children:o(e)},t)),t!=null&&c!=null&&d!=null&&t.map(t=>{if(t==null)return;let n=Rt(t,e);return(0,I.jsx)(`div`,{slot:n,style:dt,children:c(t,d)},n)}),s!=null&&(0,I.jsx)(`div`,{slot:`gutter-utility-slot`,style:ut,children:s(u)})]})}function Rt(e,t){let n=Ft(e,t);return n==null?void 0:Pt({hunkIndex:n.hunkIndex,lineIndex:n.lineIndex,conflictIndex:e.conflictIndex})}function zt(e,t){return e==null||t==null||typeof e==`string`||typeof t==`string`?e===t:e.dark===t.dark&&e.light===t.light}function Bt(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}var Vt=new Set;function Ht(e){let t=[],n=new Set;for(let r of Ut(e.themes)){let e=Kt(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 Ht({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 Ht({themes:t})},registerInto(e){for(let t of r)e.registerThemeIfAbsent(t.name,t.load)}}}function Ut(e){return Wt(e)?[e]:e}function Wt(e){return Kt(e)||Gt(e)}function Gt(e){return typeof e.name==`string`&&typeof e.load==`function`}function Kt(e){return typeof e.getThemes==`function`}function qt(e){return typeof e==`object`&&e&&`default`in e?e.default:e}var Jt=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name=`DuplicateThemeError`}},Yt=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name=`UnregisteredThemeError`}},Xt=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name=`UnresolvedThemeError`}};function Zt(){let e=new Map,t=new Map,n=new Map,r=0;function i(t,n){if(e.has(t))throw new Jt(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 Yt(i));let c=r,l=s().then(e=>{let a=qt(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 Xt(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 Qt=Zt();function $t(e,t){e=Array.isArray(e)?e:[e];for(let n of e){let e;if(typeof n==`string`){if(e=Qt.getResolvedTheme(n),e==null)throw Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else e=n,n=n.name,Qt.getResolvedTheme(n)??Qt.seedResolvedTheme(n,e);Vt.has(n)||(Vt.add(n),t.loadThemeSync(e))}}var en=new Map,tn=new Map,nn=new Map,rn=new Set;function an(e,t){e=Array.isArray(e)?e:[e];for(let n of e){if(rn.has(n.name))continue;let e=en.get(n.name);e??(e=n,en.set(n.name,e)),rn.add(e.name),t.loadLanguageSync(e.data)}}function on(){return typeof WorkerGlobalScope<`u`&&typeof self<`u`&&self instanceof WorkerGlobalScope}async function sn(e){if(on())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=tn.get(e);if(t!=null)return t;try{let t=nn.get(e);if(t==null&&Object.prototype.hasOwnProperty.call(Se,e)&&(t=Se[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 en.has(e)||en.set(e,n),n});return tn.set(e,n),await n}finally{tn.delete(e)}}function cn(e){return en.get(e)??sn(e)}function ln({name:e,load:t,colorScheme:n,collection:r,displayName:i}){return{name:e,colorScheme:n,collection:r,displayName:i,load:un(t)}}function un(e){return async()=>_e(qt(await e()))}var dn=`pierre`,fn=[`pierre-dark`,`pierre-dark-soft`,`pierre-dark-vibrant`,`pierre-dark-protanopia-deuteranopia`,`pierre-dark-tritanopia`],pn=[`pierre-light`,`pierre-light-soft`,`pierre-light-vibrant`,`pierre-light-protanopia-deuteranopia`,`pierre-light-tritanopia`],mn=[...pn,...fn],hn=new Set(pn);function gn(e){return hn.has(e)?`light`:`dark`}var _n={"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`},vn={"pierre-dark":()=>P(()=>import(`./pierre-dark-CpLgRqie.js`),[]),"pierre-dark-soft":()=>P(()=>import(`./pierre-dark-soft-kZQmAZld.js`),[]),"pierre-dark-vibrant":()=>P(()=>import(`./pierre-dark-vibrant-CpQYzh95.js`),[]),"pierre-dark-protanopia-deuteranopia":()=>P(()=>import(`./pierre-dark-protanopia-deuteranopia-B35FxJx-.js`),[]),"pierre-dark-tritanopia":()=>P(()=>import(`./pierre-dark-tritanopia-CpjhbsIL.js`),[]),"pierre-light":()=>P(()=>import(`./pierre-light-CoaEpmwp.js`),[]),"pierre-light-soft":()=>P(()=>import(`./pierre-light-soft-lWLdNTOI.js`),[]),"pierre-light-vibrant":()=>P(()=>import(`./pierre-light-vibrant-D80Fkn33.js`),[]),"pierre-light-protanopia-deuteranopia":()=>P(()=>import(`./pierre-light-protanopia-deuteranopia-0fSaH845.js`),[]),"pierre-light-tritanopia":()=>P(()=>import(`./pierre-light-tritanopia-CEbqgOJL.js`),[])};function yn(e){return ln({name:e,collection:dn,colorScheme:gn(e),displayName:_n[e],load:vn[e]})}var bn=Ht({themes:mn.map(e=>yn(e))}),xn=`shiki`,Sn=[`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`],Cn=`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(`.`),wn=new Set(Sn);function Tn(e){return wn.has(e)?`light`:`dark`}var En={andromeeda:()=>P(()=>import(`./andromeeda-vGVdxbeo.js`),[]),"aurora-x":()=>P(()=>import(`./aurora-x-CDeNXAV0.js`),[]),"ayu-dark":()=>P(()=>import(`./ayu-dark-DluEY0Gj.js`),[]),"ayu-light":()=>P(()=>import(`./ayu-light-C3h-C4tm.js`),[]),"ayu-mirage":()=>P(()=>import(`./ayu-mirage-Bqwy1Gya.js`),[]),"catppuccin-frappe":()=>P(()=>import(`./catppuccin-frappe-C9Q5zVZY.js`),[]),"catppuccin-latte":()=>P(()=>import(`./catppuccin-latte-CtsyrtPq.js`),[]),"catppuccin-macchiato":()=>P(()=>import(`./catppuccin-macchiato-R8nAf1vR.js`),[]),"catppuccin-mocha":()=>P(()=>import(`./catppuccin-mocha-DjuaAJKi.js`),[]),"dark-plus":()=>P(()=>import(`./dark-plus-Cs2F2srj.js`),[]),dracula:()=>P(()=>import(`./dracula-BHWKrbxM.js`),[]),"dracula-soft":()=>P(()=>import(`./dracula-soft-5eyTD99u.js`),[]),"everforest-dark":()=>P(()=>import(`./everforest-dark-sB-x3p7T.js`),[]),"everforest-light":()=>P(()=>import(`./everforest-light-Df2xbC6M.js`),[]),"github-dark":()=>P(()=>import(`./github-dark-C-LZuMrd.js`),[]),"github-dark-default":()=>P(()=>import(`./github-dark-default-DXG-b-1a.js`),[]),"github-dark-dimmed":()=>P(()=>import(`./github-dark-dimmed-Bx1FflLF.js`),[]),"github-dark-high-contrast":()=>P(()=>import(`./github-dark-high-contrast-B_tTalzw.js`),[]),"github-light":()=>P(()=>import(`./github-light-EUqPIrTm.js`),[]),"github-light-default":()=>P(()=>import(`./github-light-default-BXViO-2h.js`),[]),"github-light-high-contrast":()=>P(()=>import(`./github-light-high-contrast-B68TUdTA.js`),[]),"gruvbox-dark-hard":()=>P(()=>import(`./gruvbox-dark-hard-C820rvS2.js`),[]),"gruvbox-dark-medium":()=>P(()=>import(`./gruvbox-dark-medium-BPjhmG05.js`),[]),"gruvbox-dark-soft":()=>P(()=>import(`./gruvbox-dark-soft-MrdJrrXF.js`),[]),"gruvbox-light-hard":()=>P(()=>import(`./gruvbox-light-hard-BC_s9l72.js`),[]),"gruvbox-light-medium":()=>P(()=>import(`./gruvbox-light-medium-BAWPOn9u.js`),[]),"gruvbox-light-soft":()=>P(()=>import(`./gruvbox-light-soft-BSMLrYjP.js`),[]),horizon:()=>P(()=>import(`./horizon-CE9ld1lL.js`),[]),"horizon-bright":()=>P(()=>import(`./horizon-bright-DSNQnXHK.js`),[]),houston:()=>P(()=>import(`./houston-CsvMBhTu.js`),[]),"kanagawa-dragon":()=>P(()=>import(`./kanagawa-dragon-Bozd7klA.js`),[]),"kanagawa-lotus":()=>P(()=>import(`./kanagawa-lotus-BmuOG9ZW.js`),[]),"kanagawa-wave":()=>P(()=>import(`./kanagawa-wave-BML5mF2J.js`),[]),laserwave:()=>P(()=>import(`./laserwave-C_8bwKvT.js`),[]),"light-plus":()=>P(()=>import(`./light-plus-DVQuIRkW.js`),[]),"material-theme":()=>P(()=>import(`./material-theme-Bm3Qr25_.js`),[]),"material-theme-darker":()=>P(()=>import(`./material-theme-darker-2IIEA8gg.js`),[]),"material-theme-lighter":()=>P(()=>import(`./material-theme-lighter-uhdI0v04.js`),[]),"material-theme-ocean":()=>P(()=>import(`./material-theme-ocean-CHQ94UKr.js`),[]),"material-theme-palenight":()=>P(()=>import(`./material-theme-palenight-B5W6OYN7.js`),[]),"min-dark":()=>P(()=>import(`./min-dark-BSWPekZh.js`),[]),"min-light":()=>P(()=>import(`./min-light-DDpmG2fV.js`),[]),monokai:()=>P(()=>import(`./monokai-B_bV9PQ9.js`),[]),"night-owl":()=>P(()=>import(`./night-owl-DhmEMT88.js`),[]),"night-owl-light":()=>P(()=>import(`./night-owl-light-eJ-hLW7d.js`),[]),nord:()=>P(()=>import(`./nord-Cb4Vim4T.js`),[]),"one-dark-pro":()=>P(()=>import(`./one-dark-pro-CLwyXe_n.js`),[]),"one-light":()=>P(()=>import(`./one-light-D7Lr4KcI.js`),[]),plastic:()=>P(()=>import(`./plastic-DQwYfKfQ.js`),[]),poimandres:()=>P(()=>import(`./poimandres-DRFjx7u4.js`),[]),red:()=>P(()=>import(`./red-DX1BQOs8.js`),[]),"rose-pine":()=>P(()=>import(`./rose-pine-aMsaMD1D.js`),[]),"rose-pine-dawn":()=>P(()=>import(`./rose-pine-dawn-8PwUyIlP.js`),[]),"rose-pine-moon":()=>P(()=>import(`./rose-pine-moon-DO-qXg-I.js`),[]),"slack-dark":()=>P(()=>import(`./slack-dark-DnToyrRv.js`),[]),"slack-ochin":()=>P(()=>import(`./slack-ochin-B2OO5cIa.js`),[]),"snazzy-light":()=>P(()=>import(`./snazzy-light-4G7pJPwS.js`),[]),"solarized-dark":()=>P(()=>import(`./solarized-dark-UdsmMDCL.js`),[]),"solarized-light":()=>P(()=>import(`./solarized-light-C1IUL_tW.js`),[]),"synthwave-84":()=>P(()=>import(`./synthwave-84-nFMaYfgc.js`),[]),"tokyo-night":()=>P(()=>import(`./tokyo-night-oM2G3aXe.js`),[]),vesper:()=>P(()=>import(`./vesper-DdrHHSXu.js`),[]),"vitesse-black":()=>P(()=>import(`./vitesse-black-fwtXNY1n.js`),[]),"vitesse-dark":()=>P(()=>import(`./vitesse-dark-BZCL-v6S.js`),[]),"vitesse-light":()=>P(()=>import(`./vitesse-light-VbXTXTou.js`),[])};function Dn(e){return ln({name:e,collection:xn,colorScheme:Tn(e),load:En[e]})}var On=Ht({themes:Object.freeze([...Sn.map(e=>Dn(e)),...Cn.map(e=>Dn(e))])});function kn(e){if(on())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(Qt.hasRegisteredTheme(e))return;let t=On.getTheme(e);if(t!=null){Qt.registerThemeIfAbsent(t.name,t.load);return}throw Error(`No valid theme loader registered for "${e}"`)}function An(e,t){if(t.name!==e)throw Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${t.name}`)}async function jn(e){kn(e);let t=await Qt.resolveTheme(e);return An(e,t),t}function Mn(e){return Qt.getResolvedTheme(e)??jn(e)}var B;async function Nn({themes:e,langs:t,preferredHighlighter:n=`shiki-js`}){B??=xe({themes:[],langs:[`text`],engine:n===`shiki-wasm`?be(P(()=>import(`./wasm-BnjxR4X6.js`),[])):ye()});let r=Fn(B)?await B:B;B=r;let i=[];for(let e of t){if(e===`text`||e===`ansi`)continue;let t=cn(e);`then`in t?i.push(t):an(t,r)}let a=[];for(let t of e){let e=Mn(t);`then`in e?a.push(e):$t(e,B)}return(i.length>0||a.length>0)&&await Promise.all([Promise.all(i).then(e=>{an(e,r)}),Promise.all(a).then(e=>{$t(e,r)})]),r}function Pn(){if(B!=null&&!(`then`in B))return B}function Fn(e=B){return e!=null&&`then`in e}for(let e of bn.getThemes())Qt.registerThemeIfAbsent(e.name,e.load);function In(e=L){let t=[];return typeof e==`string`?t.push(e):(t.push(e.dark),t.push(e.light)),t}var Ln=new Map,Rn={"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 zn(e){if(Ln.has(e))return Ln.get(e)??`text`;if(Rn[e]!=null)return Rn[e];let t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(Ln.has(t[1]))return Ln.get(t[1])??`text`;if(Rn[t[1]]!=null)return Rn[t[1]]??`text`}let n=e.match(/\.([^.]+)$/)?.[1]??``;return Ln.has(n)?Ln.get(n)??`text`:Rn[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 Bn({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 Vn(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 Hn(e){return H({tagName:`div`,properties:{"data-gutter":``},children:e})}function Un(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 Wn(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(`
5
5
  `)),e}var Gn=Symbol(`no-token`),Kn=Symbol(`multiple-tokens`);function qn(e){let t=Jn(e);if(t!=null)return t;let n=Gn,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`){Xn(e,a);for(let t of e.children)Yn(t)}else Yn(e);r.push(e),i=[],a=void 0;return}for(let e of i)Yn(e);r.push(H({tagName:`span`,properties:{"data-char":a},children:i})),i=[],a=void 0},s=e=>{if(e!==Gn){if(e===Kn){n=Kn;return}if(n===Gn){n=e;return}n!==e&&(n=Kn)}};for(let t of e.children){let e=t.type===`element`?qn(t):Gn;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 Yn(e){if(e.type===`element`){e.properties[`data-char`]=void 0;for(let t of e.children)Yn(t)}}function Xn(e,t){e.properties[`data-char`]=t}function Zn(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+Qn(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 Qn(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 $n(e=!1,t=!1){let n={lineInfo:[]},r=[{line(e){return delete e.properties.class,e},pre(t){let r=Vn(t),i=[];if(r!=null){let t=1;for(let a of r.children)a.type===`element`&&(e&&qn(a),i.push(Wn(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(tr,er),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:er}}var er=Zn({classPrefix:`hl-`}),tr={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 nr=/^#(?:[0-9a-f]{3}0|[0-9a-f]{6}00)$/i,rr=/^0(?:\.0+)?%?$/;function ir(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 ar(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 or(e){if(e==null)return null;let t=ar(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 sr(e){if(e==null)return!1;let t=e.trim().toLowerCase();if(t===`transparent`||nr.test(t))return!0;let n=ir(t);return n!=null&&rr.test(n)}function cr(e,t,n){if(t==null||n==null)return!1;let r=or(e),i=or(t),a=or(n);return r==null||i==null||a==null?!1:Math.abs(r-a)<Math.abs(r-i)}var lr=new WeakMap;function ur(e){let t=lr.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`,dr(n[`gitDecoration.addedResourceForeground`],n[`terminal.ansiGreen`],n[`editorGutter.addedBackground`])),G(r,`gitDecoration.modifiedResourceForeground`,dr(n[`gitDecoration.modifiedResourceForeground`],n[`terminal.ansiBlue`],n[`editorGutter.modifiedBackground`])),G(r,`gitDecoration.deletedResourceForeground`,dr(n[`gitDecoration.deletedResourceForeground`],n[`terminal.ansiRed`],n[`editorGutter.deletedBackground`]));let c=(sr(n[`list.focusOutline`])?void 0:n[`list.focusOutline`])??(sr(n.focusBorder)?void 0:n.focusBorder);c==null?delete r[`list.focusOutline`]:r[`list.focusOutline`]=c;let l=n[`list.hoverBackground`];l!=null&&(fr(l,o)||cr(l,o,s))&&delete r[`list.hoverBackground`];let u=Object.freeze({...e,colors:Object.freeze(r)});return lr.set(e,u),u}function G(e,t,n){n!=null&&n!==``&&(e[t]=n)}function dr(...e){for(let t of e)if(t!=null&&t!==``)return t}function fr(e,t){return t!=null&&e.toLowerCase()===t.toLowerCase()}function pr({theme:e=L,highlighter:t,prefix:n}){let r=``;if(typeof e==`string`){let i=t.getTheme(e),a=ur(i);r+=`color:${a.fg};`,r+=`background-color:${a.bg};`,r+=`${W(`global`)}fg:${a.fg};`,r+=`${W(`global`)}bg:${a.bg};`,r+=mr(i,n)}else{let n=t.getTheme(e.dark),i=ur(n);r+=`${W(`global`)}dark:${i.fg};`,r+=`${W(`global`)}dark-bg:${i.bg};`,r+=mr(n,`dark`),n=t.getTheme(e.light),i=ur(n),r+=`${W(`global`)}light:${i.fg};`,r+=`${W(`global`)}light-bg:${i.bg};`,r+=mr(n,`light`)}return r}function mr(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 hr(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 gr(e,t){return e===t||e?.cacheKey!=null&&e.cacheKey===t?.cacheKey}function _r(e,t){return zt(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength&&e.lineDiffType===t.lineDiffType&&e.maxLineDiffLength===t.maxLineDiffLength}function vr(e){let t=e.lang??zn(e.name),n=e.lang??(e.prevName==null?`text`:zn(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 yr(e){return{...kt,...e}}function br(e,t){let n=xr(e,t);return t?n:e.diffHeaderHeight+n}function xr(e,t){return e.paddingTop??(t?e.spacing:0)}function Sr(e){return e.paddingBottom??e.spacing}function Cr(e){switch(e){case`simple`:return 4;case`metadata`:case`line-info`:case`line-info-basic`:case`custom`:return 32}}function wr(e){return[R(e.additionStart,e.additionCount)+1,z(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 Tr(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-z(t.additionStart,t.additionCount),r=e.deletionLines.length-z(t.deletionStart,t.deletionCount);return n<=0&&r<=0?!1:n!==r}function Er({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-z(n.additionStart,n.additionCount),i=e.deletionLines.length-z(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=Er({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 Dr({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]=wr(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]=wr(a);return t<o+i.fromStart||t>=o+i.rangeSize}function Or({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]=wr(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 kr({type:e,metrics:t}){return t.hunkSeparatorHeight??Cr(e)}function Ar({type:e,metrics:t}){return e===`simple`||e===`metadata`||e===`line-info-basic`?0:t.spacing}function jr({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 Mr(e){return e!==`simple`&&e!==`metadata`}function Nr({type:e,metrics:t,hunkIndex:n,hunkSpecs:r}){if(!jr({type:e,hunkIndex:n,hunkSpecs:r}))return;let i=kr({type:e,metrics:t}),a=Ar({type:e,metrics:t}),o=n>0?a:0,s=a;return{height:i,gapBefore:o,gapAfter:s,totalHeight:o+i+s}}function Pr({type:e,metrics:t}){if(!Mr(e))return;let n=kr({type:e,metrics:t}),r=Ar({type:e,metrics:t});return{height:n,gapBefore:r,gapAfter:0,totalHeight:r+n}}function Fr({diff:e,diffStyle:t,startingLine:n=0,totalLines:r=1/0,expandedHunks:i,collapsedContextThreshold:a=1,callback:o}){let s=Ir({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=R(r.deletionStart,r.deletionCount),s=R(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(zr(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,zr(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(zr(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=Br(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(Vr({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(zr(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 Ir({diff:e,diffStyle:t,startingLine:n,expandedHunks:r,collapsedContextThreshold:i}){if(n<=0||t===`both`)return{hunkIndex:0,splitCount:0,unifiedCount:0};let a=Lr({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 Lr({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 Rr(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 zr(e,t,n,r,i,a){let[o,s]=Rr(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 Br(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 Vr({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}},Hr=new class extends Y{};function Ur(e,t,n){return Hr.diff(e,t,n)}function Wr(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 Gr(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 qr(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 Yr(e,t){return qr(e,t,``)}function Xr(e,t){return t.slice(0,Zr(e,t))}function Zr(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 Qr(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 $r(e,t){if(t)return ti(e,t)[1];let n;for(n=e.length-1;n>=0&&e[n].match(/\s/);n--);return e.substring(n+1)}function ei(e,t){if(t)return ti(e,t)[0];let n=e.match(/^\s*/);return n?n[0]:``}function ti(e,t){if(!t)return[ei(e),$r(e)];if(t.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);let n=Qr(e,t),r=n[0],i=n[n.length-1];return[/\s/.test(r)?r:``,/\s/.test(i)?i:``]}var ni=`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}`,ri=RegExp(`[${ni}]+|\\s+|[^${ni}]`,`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=Qr(e,r)}else n=e.match(ri)||[];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)&&ii(n,i,r,e,t.intlSegmenter),n=e,r=null,i=null)}),(r||i)&&ii(n,i,r,null,t.intlSegmenter),e}};function ii(e,t,n,r,i){if(t&&n){let[a,o]=ti(t.value,i),[s,c]=ti(n.value,i);if(e){let r=Wr(a,s);e.value=qr(e.value,s,r),t.value=Jr(t.value,r),n.value=Jr(n.value,r)}if(r){let e=Gr(o,c);r.value=Kr(r.value,c,e),t.value=Yr(t.value,e),n.value=Yr(n.value,e)}}else if(n){if(e){let e=ei(n.value,i);n.value=n.value.substring(e.length)}if(r){let e=ei(r.value,i);r.value=r.value.substring(e.length)}}else if(e&&r){let n=ei(r.value,i),[a,o]=ti(t.value,i),s=Wr(n,a);t.value=Jr(t.value,s);let c=Gr(Jr(n,s),o);t.value=Yr(t.value,c),r.value=Kr(r.value,n,c),e.value=qr(e.value,n,n.slice(0,n.length-c.length))}else if(r){let e=ei(r.value,i),n=Xr($r(t.value,i),e);t.value=Yr(t.value,n)}else if(e){let n=Xr($r(e.value,i),ei(t.value,i));t.value=Jr(t.value,n)}}var ai=new class extends Y{tokenize(e){let t=RegExp(`(\\r?\\n)|[${ni}]+|[^\\S\\n\\r]+|[^${ni}]`,`ug`);return e.match(t)||[]}};function oi(e,t,n){return ai.diff(e,t,n)}var si=new class extends Y{constructor(){super(...arguments),this.tokenize=li}equals(e,t,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
6
6
  `))&&(e=e.trim()),(!n.newlineIsToken||!t.includes(`
7
7
  `))&&(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith(`
@@ -1387,9 +1387,9 @@ import{n as e,r as t}from"./rolldown-runtime-hePW80VL.js";import{i as n}from"./b
1387
1387
  --diffs-bg-hover-override: #0a0a0a;
1388
1388
  --diffs-bg-separator-override: #0f0f0f;
1389
1389
  }
1390
- `:void 0,[f]),y=`an-edit-diff dark:bg-black dark:[--diffs-bg:#000] dark:[--diffs-bg-buffer-override:#000] dark:[--diffs-bg-context-override:#000] dark:[--diffs-bg-hover-override:#0a0a0a] dark:[--diffs-bg-separator-override:#0f0f0f]`;return(0,I.jsxs)(`div`,{className:`an-edit-tool-card overflow-hidden rounded-an-tool-border-radius border border-an-tool-border-color bg-an-tool-background dark:bg-black`,children:[(0,I.jsxs)(`div`,{className:`flex h-7 items-center justify-between bg-an-tool-background px-2.5 py-0 `+(c&&!g?``:`border-b border-an-tool-border-color`),children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[u&&(0,I.jsx)(Xc,{filename:l,className:`h-3 w-3 shrink-0`}),c&&!g?(0,I.jsx)(N,{as:`span`,duration:1.2,className:`text-xs`,children:`Generating...`}):c?(0,I.jsxs)(N,{as:`span`,duration:1.2,className:`text-xs`,children:[d?`Creating`:`Editing`,` `,l]}):(0,I.jsxs)(`span`,{className:`truncate text-xs text-an-tool-color-muted`,children:[d?`Created`:`Edited`,` `,e.filePath&&s?(0,I.jsx)(`button`,{type:`button`,onClick:()=>s(e.filePath??``),className:`truncate underline-offset-2 hover:text-an-tool-color hover:underline`,children:l}):l]})]}),e.diffStats&&!c&&(0,I.jsx)(`span`,{className:`inline-flex gap-2 font-mono text-[11px] text-an-tool-color-muted`,children:e.diffStats.split(` `).map(e=>(0,I.jsx)(`span`,{className:e.startsWith(`+`)?`text-an-diff-added-text`:e.startsWith(`-`)?`text-an-diff-removed-text`:void 0,children:e},e))})]}),g?(0,I.jsx)(`div`,{className:`${y} text-[12px]`,style:_,children:(0,I.jsxs)(`div`,{className:a?`group/edit-diff relative`:`relative`,children:[(0,I.jsx)(`div`,{className:a&&!m?`max-h-[260px] overflow-hidden`:void 0,children:(0,I.jsx)(Yc,{oldFile:g.oldFile,newFile:g.newFile,className:y,style:_,options:{theme:{dark:`github-dark`,light:`github-light`},themeType:f,unsafeCSS:v,diffStyle:`unified`,disableFileHeader:!0}},f)}),a&&(0,I.jsx)(I.Fragment,{children:(0,I.jsx)(`button`,{type:`button`,onClick:()=>h(e=>!e),"aria-label":m?`Hide`:`Show more`,className:`group absolute inset-x-0 bottom-0 flex h-16 items-end justify-center pb-2 text-muted-foreground `+(m?`bg-transparent`:`bg-linear-to-b from-transparent to-background`),children:(0,I.jsx)(E,{className:`h-4 w-4 opacity-0 transition-opacity duration-150 group-hover:opacity-100 `+(m?`rotate-180`:`rotate-0`)})})})]})}):null,o&&(0,I.jsx)(te,{isPending:c,...o})]})}var Qc=(0,F.memo)(function({part:e,isCollapsible:t=!1,onFilePathClick:n}){let r=e.input?.approval??e.args?.approval,i=e.type?.replace(`tool-`,``)||`Edit`,{step:a,stepState:o}=ne(e,i);return(0,I.jsx)(Zc,{step:a,state:o,onComplete:()=>{},input:e.input??e.args,output:e.output??e.result,isCollapsible:t,approval:r,onFilePathClick:n})});function $c({className:e,...t}){return(0,I.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,I.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`,fill:`none`,opacity:.2}),(0,I.jsx)(`path`,{d:`M12 2C6.48 2 2 6.48 2 12`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`,fill:`none`})]})}function el(e){return(0,I.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,I.jsx)(`path`,{d:`M5 12.75L10 19L19 5`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function tl(e){return(0,I.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,width:`24`,height:`24`,...e,children:[(0,I.jsx)(`path`,{d:`M14 6L20 12L14 18`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,I.jsx)(`path`,{d:`M19 12H4`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`})]})}function nl(e,t){if(!e||e.length===0)return{type:`creation`,items:t.map((e,t)=>({todo:e,newStatus:e.status,index:t}))};let n=[];return t.forEach((t,r)=>{let i=e[r];(!i||i.status!==t.status)&&n.push({todo:t,oldStatus:i?.status,newStatus:t.status,index:r})}),n.length===1?{type:`single`,items:n}:{type:`multiple`,items:n}}var rl=({status:e,isPending:t})=>{if(t&&e===`in_progress`)return(0,I.jsx)(`div`,{className:`flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded-full border border-an-foreground-muted/60`,children:(0,I.jsx)(tl,{className:`h-2 w-2 text-an-foreground-muted/70`})});switch(e){case`completed`:return(0,I.jsx)(`div`,{className:`flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded-full border border-an-foreground-muted/40`,children:(0,I.jsx)(el,{className:`h-2 w-2 text-an-foreground-muted/70`})});case`in_progress`:return(0,I.jsx)(`div`,{className:`flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded-full border border-an-foreground-muted/60`,children:(0,I.jsx)(tl,{className:`h-2 w-2 text-an-foreground-muted/70`})});default:return(0,I.jsx)(`div`,{className:`flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded-full border border-an-foreground-muted/60`})}},il=(0,F.memo)(function({todo:e,isPending:t}){return(0,I.jsxs)(`div`,{className:f(`flex items-start gap-2`),children:[(0,I.jsx)(`div`,{className:`mt-[2px]`,children:(0,I.jsx)(rl,{status:e.status,isPending:t})}),(0,I.jsx)(`span`,{className:f(`text-sm`,e.status===`completed`&&`line-through`,t||e.status===`completed`||e.status===`pending`?`text-an-foreground/60`:`text-an-foreground/80`),children:e.content})]})}),al=(0,F.memo)(function({part:e,chatStatus:t}){let{isPending:n}=Ue(e,t),r=e.state===`input-streaming`,i=e.output?.oldTodos||[],a=e.input?.todos||e.output?.newTodos||[],o=i.length===0,s=(0,F.useMemo)(()=>nl(i,a),[i,a]);return r||a.length===0?(0,I.jsx)(`div`,{className:`flex flex-col gap-2 text-sm leading-relaxed text-an-foreground/80`,children:(0,I.jsx)(`div`,{className:`text-an-foreground/60`,children:(0,I.jsx)(N,{as:`span`,duration:1.2,className:`m-0 inline-flex h-4 items-center text-sm leading-none`,children:o?`Creating to-do list...`:`Updating to-dos...`})})}):(s.type===`single`||s.type,(0,I.jsx)(`div`,{className:`flex flex-col gap-2 text-sm leading-relaxed text-an-foreground/80`,children:a.map(e=>(0,I.jsx)(il,{todo:e,isPending:n},e.content))}))},Ve);function ol(e){let t=e.id?.trim();return t?t.endsWith(`.md`)?t:`plan-${t}.md`:`plan-working.md`}var sl=(0,F.memo)(function({part:e,chatStatus:t}){let{isPending:n}=Ue(e,t),r=e.input?.plan,[i,a]=(0,F.useState)(!1),[o,s]=(0,F.useState)(!1),[c,l]=(0,F.useState)(null),[u,d]=(0,F.useState)(!1),[p,m]=(0,F.useState)(``);if(!r)return null;let h=ol(r),g=r.summary?.trim()??``,_=g.length>0,y=e.input?.completed??0,b=e.input?.total??r.todos?.length??0,x=!!e.input?.pendingDecision,S=x&&!n,C=e.input?.approved||o||r.status===`approved`||r.status===`completed`,w=async(e,t,n)=>{if(!(!t||c)){l(e);try{await t(n),e===`execute`&&s(!0),e===`refine`&&(m(``),d(!1))}finally{l(null)}}},T=b>0?`${y}/${b} complete`:x?`Awaiting review`:void 0;return(0,I.jsxs)(`div`,{className:`an-tool-plan overflow-hidden rounded-an-tool-border-radius border border-border bg-an-tool-background`,children:[(0,I.jsxs)(`div`,{className:`flex h-7 items-center justify-between pr-2.5 pl-3`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[n?(0,I.jsx)($c,{className:`h-3 w-3 shrink-0 animate-spin text-an-tool-color-muted`}):(0,I.jsx)(ue,{className:`h-3.5 w-3.5 shrink-0 text-an-tool-color-muted`}),(0,I.jsx)(`span`,{className:`truncate text-xs text-an-tool-color-muted`,children:h})]}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>a(e=>!e),"aria-label":i?`Collapse plan`:`Expand plan`,className:`inline-flex size-5 items-center justify-center text-an-tool-color-muted`,children:i?(0,I.jsx)(Ne,{className:`h-3.5 w-3.5`}):(0,I.jsx)(Me,{className:`h-3.5 w-3.5`})})]}),(0,I.jsxs)(`div`,{className:`border-t border-border bg-background pt-2`,children:[(0,I.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-3`,children:[(0,I.jsx)(`div`,{className:`text-sm text-an-tool-color`,children:r.title}),T?(0,I.jsx)(`div`,{className:`rounded-full border border-border px-2 py-0.5 text-[11px] text-an-tool-color-muted`,children:T}):null]}),_?(0,I.jsxs)(`div`,{className:`relative`,children:[(0,I.jsx)(`div`,{className:f(`px-3`,`text-sm text-an-tool-color-muted`,!i&&`max-h-[94px] overflow-hidden`),children:(0,I.jsx)(v,{content:g,className:`text-sm`})}),!i&&(0,I.jsxs)(`div`,{className:`absolute inset-x-0 bottom-0 h-16 pr-2 pb-2 pl-3.5`,children:[(0,I.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,I.jsx)(`div`,{className:`relative flex h-full items-end justify-between`,children:(0,I.jsx)(`button`,{type:`button`,onClick:()=>a(!0),className:`-mx-2 h-5 rounded-[4px] px-1.5 text-xs text-muted-foreground hover:text-an-tool-color`,children:`Read detailed plan`})})]})]}):(0,I.jsx)(`div`,{className:`text-xs text-an-tool-color-muted`,children:`No plan summary provided.`})]}),(i||!_)&&(0,I.jsxs)(`div`,{className:`mt-2 flex items-center justify-between border-t border-border bg-an-tool-background pt-1.5 pr-2 pb-2 pl-3.5`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:()=>a(e=>!e),className:`-mx-2 h-5 rounded-[4px] px-1.5 text-xs text-muted-foreground hover:text-an-tool-color`,children:i?`Hide detailed plan`:`Read detailed plan`}),S?(0,I.jsx)(`div`,{className:`text-[11px] text-an-tool-color-muted`,children:`Choose what to do with this plan.`}):C?(0,I.jsx)(`div`,{className:`text-[11px] text-an-tool-color-muted`,children:`Approved`}):null]}),S?(0,I.jsxs)(`div`,{className:`flex flex-col gap-2 border-t border-border bg-an-tool-background px-3 py-2.5`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:()=>w(`execute`,e.input?.onExecute),disabled:!!c,className:`h-7 rounded-[6px] bg-an-primary-color px-2.5 text-xs font-medium text-an-send-button-color disabled:opacity-60`,children:c===`execute`?`Executing...`:e.input?.executeLabel??`Execute`}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>w(`stay`,e.input?.onStay),disabled:!!c,className:`h-7 rounded-[6px] border border-border px-2.5 text-xs text-an-tool-color disabled:opacity-60`,children:c===`stay`?`Saving...`:e.input?.stayLabel??`Stay`}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>d(e=>!e),disabled:!!c,className:`h-7 rounded-[6px] border border-border px-2.5 text-xs text-an-tool-color disabled:opacity-60`,children:e.input?.refineLabel??`Refine`})]}),u?(0,I.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,I.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-an-tool-color outline-none focus:border-an-primary-color md:text-sm`}),(0,I.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:()=>{d(!1),m(``)},disabled:!!c,className:`h-7 rounded-[6px] border border-border px-2.5 text-xs text-an-tool-color disabled:opacity-60`,children:`Cancel`}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>w(`refine`,e.input?.onRefine,p),disabled:!!c,className:`h-7 rounded-[6px] bg-an-primary-color px-2.5 text-xs font-medium text-an-send-button-color disabled:opacity-60`,children:c===`refine`?`Submitting...`:`Submit refinement`})]})]}):null]}):null]})]})},Ve);function cl(e,t){let[n,r]=(0,F.useState)(0);return(0,F.useEffect)(()=>{if(t&&e){r(Date.now()-e);let t=setInterval(()=>{r(Date.now()-e)},1e3);return()=>clearInterval(t)}},[t,e]),n}function ll(e,t){return`${e} ${e===1?t:`${t}s`}`}function ul(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(ll(i,`file`)),a>0&&s.push(`${a} ${a===1?`search`:`searches`}`),o>0&&s.push(ll(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 dl(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 fl(e,t){let n=[];return e>0&&n.push(ll(e,`file`)),t>0&&n.push(`${t} ${t===1?`search`:`searches`}`),n.join(`, `)}var pl=(0,F.memo)(function({part:e,nestedTools:t=[],chatStatus:n,completeLabel:r,shimmerLabel:i,interruptedLabel:a,maxVisibleTools:o=5,defaultOpen:s,showElapsed:c=!0}){let{isPending:l,isInterrupted:u}=Ue(e,n),d=e.input?.description||``,[p,m]=(0,F.useState)(s??!1),[h,g]=(0,F.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,o)*28,S=l?Math.max(h,0):t.length,C=(0,F.useRef)(l),w=(0,F.useRef)(!1),T=(0,F.useRef)(null),{fileCount:E,searchCount:D}=(0,F.useMemo)(()=>dl(l?t.slice(0,Math.max(h,0)):t),[l,t,h]),O=fl(E,D),k=(0,F.useRef)(null),A=cl(_,l);(0,F.useEffect)(()=>{let e=C.current;return T.current&&=(window.clearTimeout(T.current),null),l&&!e&&!w.current&&s!==!1&&(m(!1),T.current=window.setTimeout(()=>{m(!0)},60)),!l&&e&&(m(!1),w.current=!1),C.current=l,()=>{T.current&&=(window.clearTimeout(T.current),null)}},[s,l]),(0,F.useEffect)(()=>{if(!l||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)},[l,t.length,y]),(0,F.useEffect)(()=>{!l||!k.current||(k.current.scrollTop=k.current.scrollHeight)},[l,h]);let j=(()=>{if(l&&v)return O;if(!l&&v){let e=ul(t);if(e)return e}return d?d.length>60?`${d.slice(0,57)}...`:d:``})(),M=He(!l&&b?b:A);return u&&!e.output?(0,I.jsx)(nt,{completeLabel:a,isAnimating:!1}):(0,I.jsx)(nt,{completeLabel:r,shimmerLabel:i,isAnimating:l,detail:j,expandable:v,expanded:p,onToggleExpand:()=>{w.current=!0,m(e=>!e)},trailingContent:c&&M?(0,I.jsx)(`span`,{className:`shrink-0 font-normal text-an-foreground-muted/60 tabular-nums`,children:M}):void 0,children:(0,I.jsxs)(`div`,{className:`relative`,children:[l&&p&&S>4&&(0,I.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 top-0 z-10 h-10 bg-linear-to-b from-an-background to-transparent`}),(0,I.jsx)(`div`,{ref:k,className:f(t.length>1?`flex flex-col gap-2`:void 0,l&&p&&S>4&&`overflow-y-auto`),style:l&&p&&S>4?{height:`${x}px`}:void 0,children:(l?t.slice(0,Math.max(h,0)):t).map((e,t)=>{let r=l?{...e,state:t===h-1?`input-streaming`:`output-available`}:e,i=Qe[r.type];if(!i)return null;let{isPending:a,isError:o}=Ue(r,n);return(0,I.jsx)(rt,{icon:i.icon,title:i.title(r),subtitle:i.subtitle?.(r),isPending:a,isError:o},r.toolCallId??r.id??`${r.type}-${i.title(r)}`)})})]})})}),ml=[`query`,`question`,`email`,`name`,`id`,`customer`,`url`,`issue`,`body`,`summary`,`title`],hl={List:`Listing`,Get:`Getting`,Create:`Creating`,Update:`Updating`,Delete:`Deleting`,Search:`Searching`,Fetch:`Fetching`,Retrieve:`Retrieving`,Send:`Sending`,Generate:`Generating`,Add:`Adding`,Remove:`Removing`,Modify:`Modifying`,Draft:`Drafting`,Manage:`Managing`,Query:`Querying`,Start:`Starting`,Set:`Setting`,Check:`Checking`,Find:`Finding`},gl={List:`Listed`,Get:`Got`,Create:`Created`,Update:`Updated`,Delete:`Deleted`,Search:`Searched`,Fetch:`Fetched`,Retrieve:`Retrieved`,Send:`Sent`,Generate:`Generated`,Add:`Added`,Remove:`Removed`,Modify:`Modified`,Draft:`Drafted`,Manage:`Managed`,Query:`Queried`,Start:`Started`,Set:`Set`,Check:`Checked`,Find:`Found`};function _l(e){let t=e.displayName.split(` `),n=t[0],r=t.slice(1).join(` `),i=hl[n];return i?r?`${i} ${r}`:i:e.displayName}function vl(e){let t=e.displayName.split(` `),n=t[0],r=t.slice(1).join(` `),i=gl[n];return i?r?`${i} ${r}`:i:e.displayName}function yl(e){if(!e||typeof e!=`object`)return``;let t=Object.entries(e).filter(([,e])=>e!=null&&e!==``);if(t.length===0)return``;let n=[...t].sort(([e],[t])=>{let n=ml.indexOf(e),r=ml.indexOf(t);return n!==-1&&r!==-1?n-r:n===-1?r===-1?0:1:-1}),r=[];for(let[e,t]of n){if(r.length>=2)break;let n=typeof t==`string`?t:JSON.stringify(t),i=n.length>30?n.slice(0,27)+`...`:n;r.push(`${e}: ${i}`)}return r.join(` `)}function bl(e){if(!e)return e;if(Array.isArray(e)){let t=[];for(let n of e)n?.type===`text`&&typeof n?.text==`string`&&t.push(n.text);if(t.length>0){let e=t.join(``);try{return JSON.parse(e)}catch{return e}}return e}if(e?.type===`text`&&typeof e?.text==`string`)try{return JSON.parse(e.text)}catch{return e.text}if(typeof e==`string`)try{return JSON.parse(e)}catch{return e}return e}function xl(e){let t=bl(e);if(typeof t==`string`)return t.length>3e3?t.slice(0,3e3)+`
1390
+ `:void 0,[f]),y=`an-edit-diff dark:bg-black dark:[--diffs-bg:#000] dark:[--diffs-bg-buffer-override:#000] dark:[--diffs-bg-context-override:#000] dark:[--diffs-bg-hover-override:#0a0a0a] dark:[--diffs-bg-separator-override:#0f0f0f]`;return(0,I.jsxs)(`div`,{className:`an-edit-tool-card overflow-hidden rounded-an-tool-border-radius border border-an-tool-border-color bg-an-tool-background dark:bg-black`,children:[(0,I.jsxs)(`div`,{className:`flex h-7 items-center justify-between bg-an-tool-background px-2.5 py-0 `+(c&&!g?``:`border-b border-an-tool-border-color`),children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[u&&(0,I.jsx)(Xc,{filename:l,className:`h-3 w-3 shrink-0`}),c&&!g?(0,I.jsx)(N,{as:`span`,duration:1.2,className:`text-xs`,children:`Generating...`}):c?(0,I.jsxs)(N,{as:`span`,duration:1.2,className:`text-xs`,children:[d?`Creating`:`Editing`,` `,l]}):(0,I.jsxs)(`span`,{className:`truncate text-xs text-an-tool-color-muted`,children:[d?`Created`:`Edited`,` `,e.filePath&&s?(0,I.jsx)(`button`,{type:`button`,onClick:()=>s(e.filePath??``),className:`truncate underline-offset-2 hover:text-an-tool-color hover:underline`,children:l}):l]})]}),e.diffStats&&!c&&(0,I.jsx)(`span`,{className:`inline-flex gap-2 font-mono text-[0.6875rem] text-an-tool-color-muted`,children:e.diffStats.split(` `).map(e=>(0,I.jsx)(`span`,{className:e.startsWith(`+`)?`text-an-diff-added-text`:e.startsWith(`-`)?`text-an-diff-removed-text`:void 0,children:e},e))})]}),g?(0,I.jsx)(`div`,{className:`${y} text-[0.75rem]`,style:_,children:(0,I.jsxs)(`div`,{className:a?`group/edit-diff relative`:`relative`,children:[(0,I.jsx)(`div`,{className:a&&!m?`max-h-[260px] overflow-hidden`:void 0,children:(0,I.jsx)(Yc,{oldFile:g.oldFile,newFile:g.newFile,className:y,style:_,options:{theme:{dark:`github-dark`,light:`github-light`},themeType:f,unsafeCSS:v,diffStyle:`unified`,disableFileHeader:!0}},f)}),a&&(0,I.jsx)(I.Fragment,{children:(0,I.jsx)(`button`,{type:`button`,onClick:()=>h(e=>!e),"aria-label":m?`Hide`:`Show more`,className:`group absolute inset-x-0 bottom-0 flex h-16 items-end justify-center pb-2 text-muted-foreground `+(m?`bg-transparent`:`bg-linear-to-b from-transparent to-background`),children:(0,I.jsx)(E,{className:`h-4 w-4 opacity-0 transition-opacity duration-150 group-hover:opacity-100 `+(m?`rotate-180`:`rotate-0`)})})})]})}):null,o&&(0,I.jsx)(te,{isPending:c,...o})]})}var Qc=(0,F.memo)(function({part:e,isCollapsible:t=!1,onFilePathClick:n}){let r=e.input?.approval??e.args?.approval,i=e.type?.replace(`tool-`,``)||`Edit`,{step:a,stepState:o}=ne(e,i);return(0,I.jsx)(Zc,{step:a,state:o,onComplete:()=>{},input:e.input??e.args,output:e.output??e.result,isCollapsible:t,approval:r,onFilePathClick:n})});function $c({className:e,...t}){return(0,I.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,I.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`,fill:`none`,opacity:.2}),(0,I.jsx)(`path`,{d:`M12 2C6.48 2 2 6.48 2 12`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`,fill:`none`})]})}function el(e){return(0,I.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,I.jsx)(`path`,{d:`M5 12.75L10 19L19 5`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function tl(e){return(0,I.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,width:`24`,height:`24`,...e,children:[(0,I.jsx)(`path`,{d:`M14 6L20 12L14 18`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,I.jsx)(`path`,{d:`M19 12H4`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`})]})}function nl(e,t){if(!e||e.length===0)return{type:`creation`,items:t.map((e,t)=>({todo:e,newStatus:e.status,index:t}))};let n=[];return t.forEach((t,r)=>{let i=e[r];(!i||i.status!==t.status)&&n.push({todo:t,oldStatus:i?.status,newStatus:t.status,index:r})}),n.length===1?{type:`single`,items:n}:{type:`multiple`,items:n}}var rl=({status:e,isPending:t})=>{if(t&&e===`in_progress`)return(0,I.jsx)(`div`,{className:`flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded-full border border-an-foreground-muted/60`,children:(0,I.jsx)(tl,{className:`h-2 w-2 text-an-foreground-muted/70`})});switch(e){case`completed`:return(0,I.jsx)(`div`,{className:`flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded-full border border-an-foreground-muted/40`,children:(0,I.jsx)(el,{className:`h-2 w-2 text-an-foreground-muted/70`})});case`in_progress`:return(0,I.jsx)(`div`,{className:`flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded-full border border-an-foreground-muted/60`,children:(0,I.jsx)(tl,{className:`h-2 w-2 text-an-foreground-muted/70`})});default:return(0,I.jsx)(`div`,{className:`flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded-full border border-an-foreground-muted/60`})}},il=(0,F.memo)(function({todo:e,isPending:t}){return(0,I.jsxs)(`div`,{className:f(`flex items-start gap-2`),children:[(0,I.jsx)(`div`,{className:`mt-[2px]`,children:(0,I.jsx)(rl,{status:e.status,isPending:t})}),(0,I.jsx)(`span`,{className:f(`text-sm`,e.status===`completed`&&`line-through`,t||e.status===`completed`||e.status===`pending`?`text-an-foreground/60`:`text-an-foreground/80`),children:e.content})]})}),al=(0,F.memo)(function({part:e,chatStatus:t}){let{isPending:n}=Ue(e,t),r=e.state===`input-streaming`,i=e.output?.oldTodos||[],a=e.input?.todos||e.output?.newTodos||[],o=i.length===0,s=(0,F.useMemo)(()=>nl(i,a),[i,a]);return r||a.length===0?(0,I.jsx)(`div`,{className:`flex flex-col gap-2 text-sm leading-relaxed text-an-foreground/80`,children:(0,I.jsx)(`div`,{className:`text-an-foreground/60`,children:(0,I.jsx)(N,{as:`span`,duration:1.2,className:`m-0 inline-flex h-4 items-center text-sm leading-none`,children:o?`Creating to-do list...`:`Updating to-dos...`})})}):(s.type===`single`||s.type,(0,I.jsx)(`div`,{className:`flex flex-col gap-2 text-sm leading-relaxed text-an-foreground/80`,children:a.map(e=>(0,I.jsx)(il,{todo:e,isPending:n},e.content))}))},Ve);function ol(e){let t=e.id?.trim();return t?t.endsWith(`.md`)?t:`plan-${t}.md`:`plan-working.md`}var sl=(0,F.memo)(function({part:e,chatStatus:t}){let{isPending:n}=Ue(e,t),r=e.input?.plan,[i,a]=(0,F.useState)(!1),[o,s]=(0,F.useState)(!1),[c,l]=(0,F.useState)(null),[u,d]=(0,F.useState)(!1),[p,m]=(0,F.useState)(``);if(!r)return null;let h=ol(r),g=r.summary?.trim()??``,_=g.length>0,y=e.input?.completed??0,b=e.input?.total??r.todos?.length??0,x=!!e.input?.pendingDecision,S=x&&!n,C=e.input?.approved||o||r.status===`approved`||r.status===`completed`,w=async(e,t,n)=>{if(!(!t||c)){l(e);try{await t(n),e===`execute`&&s(!0),e===`refine`&&(m(``),d(!1))}finally{l(null)}}},T=b>0?`${y}/${b} complete`:x?`Awaiting review`:void 0;return(0,I.jsxs)(`div`,{className:`an-tool-plan overflow-hidden rounded-an-tool-border-radius border border-border bg-an-tool-background`,children:[(0,I.jsxs)(`div`,{className:`flex h-7 items-center justify-between pr-2.5 pl-3`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[n?(0,I.jsx)($c,{className:`h-3 w-3 shrink-0 animate-spin text-an-tool-color-muted`}):(0,I.jsx)(ue,{className:`h-3.5 w-3.5 shrink-0 text-an-tool-color-muted`}),(0,I.jsx)(`span`,{className:`truncate text-xs text-an-tool-color-muted`,children:h})]}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>a(e=>!e),"aria-label":i?`Collapse plan`:`Expand plan`,className:`inline-flex size-5 items-center justify-center text-an-tool-color-muted`,children:i?(0,I.jsx)(Ne,{className:`h-3.5 w-3.5`}):(0,I.jsx)(Me,{className:`h-3.5 w-3.5`})})]}),(0,I.jsxs)(`div`,{className:`border-t border-border bg-background pt-2`,children:[(0,I.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-3`,children:[(0,I.jsx)(`div`,{className:`text-sm text-an-tool-color`,children:r.title}),T?(0,I.jsx)(`div`,{className:`rounded-full border border-border px-2 py-0.5 text-[0.6875rem] text-an-tool-color-muted`,children:T}):null]}),_?(0,I.jsxs)(`div`,{className:`relative`,children:[(0,I.jsx)(`div`,{className:f(`px-3`,`text-sm text-an-tool-color-muted`,!i&&`max-h-[94px] overflow-hidden`),children:(0,I.jsx)(v,{content:g,className:`text-sm`})}),!i&&(0,I.jsxs)(`div`,{className:`absolute inset-x-0 bottom-0 h-16 pr-2 pb-2 pl-3.5`,children:[(0,I.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,I.jsx)(`div`,{className:`relative flex h-full items-end justify-between`,children:(0,I.jsx)(`button`,{type:`button`,onClick:()=>a(!0),className:`-mx-2 h-5 rounded-[4px] px-1.5 text-xs text-muted-foreground hover:text-an-tool-color`,children:`Read detailed plan`})})]})]}):(0,I.jsx)(`div`,{className:`text-xs text-an-tool-color-muted`,children:`No plan summary provided.`})]}),(i||!_)&&(0,I.jsxs)(`div`,{className:`mt-2 flex items-center justify-between border-t border-border bg-an-tool-background pt-1.5 pr-2 pb-2 pl-3.5`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:()=>a(e=>!e),className:`-mx-2 h-5 rounded-[4px] px-1.5 text-xs text-muted-foreground hover:text-an-tool-color`,children:i?`Hide detailed plan`:`Read detailed plan`}),S?(0,I.jsx)(`div`,{className:`text-[0.6875rem] text-an-tool-color-muted`,children:`Choose what to do with this plan.`}):C?(0,I.jsx)(`div`,{className:`text-[0.6875rem] text-an-tool-color-muted`,children:`Approved`}):null]}),S?(0,I.jsxs)(`div`,{className:`flex flex-col gap-2 border-t border-border bg-an-tool-background px-3 py-2.5`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:()=>w(`execute`,e.input?.onExecute),disabled:!!c,className:`h-7 rounded-[6px] bg-an-primary-color px-2.5 text-xs font-medium text-an-send-button-color disabled:opacity-60`,children:c===`execute`?`Executing...`:e.input?.executeLabel??`Execute`}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>w(`stay`,e.input?.onStay),disabled:!!c,className:`h-7 rounded-[6px] border border-border px-2.5 text-xs text-an-tool-color disabled:opacity-60`,children:c===`stay`?`Saving...`:e.input?.stayLabel??`Stay`}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>d(e=>!e),disabled:!!c,className:`h-7 rounded-[6px] border border-border px-2.5 text-xs text-an-tool-color disabled:opacity-60`,children:e.input?.refineLabel??`Refine`})]}),u?(0,I.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,I.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-an-tool-color outline-none focus:border-an-primary-color md:text-sm`}),(0,I.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:()=>{d(!1),m(``)},disabled:!!c,className:`h-7 rounded-[6px] border border-border px-2.5 text-xs text-an-tool-color disabled:opacity-60`,children:`Cancel`}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>w(`refine`,e.input?.onRefine,p),disabled:!!c,className:`h-7 rounded-[6px] bg-an-primary-color px-2.5 text-xs font-medium text-an-send-button-color disabled:opacity-60`,children:c===`refine`?`Submitting...`:`Submit refinement`})]})]}):null]}):null]})]})},Ve);function cl(e,t){let[n,r]=(0,F.useState)(0);return(0,F.useEffect)(()=>{if(t&&e){r(Date.now()-e);let t=setInterval(()=>{r(Date.now()-e)},1e3);return()=>clearInterval(t)}},[t,e]),n}function ll(e,t){return`${e} ${e===1?t:`${t}s`}`}function ul(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(ll(i,`file`)),a>0&&s.push(`${a} ${a===1?`search`:`searches`}`),o>0&&s.push(ll(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 dl(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 fl(e,t){let n=[];return e>0&&n.push(ll(e,`file`)),t>0&&n.push(`${t} ${t===1?`search`:`searches`}`),n.join(`, `)}var pl=(0,F.memo)(function({part:e,nestedTools:t=[],chatStatus:n,completeLabel:r,shimmerLabel:i,interruptedLabel:a,maxVisibleTools:o=5,defaultOpen:s,showElapsed:c=!0}){let{isPending:l,isInterrupted:u}=Ue(e,n),d=e.input?.description||``,[p,m]=(0,F.useState)(s??!1),[h,g]=(0,F.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,o)*28,S=l?Math.max(h,0):t.length,C=(0,F.useRef)(l),w=(0,F.useRef)(!1),T=(0,F.useRef)(null),{fileCount:E,searchCount:D}=(0,F.useMemo)(()=>dl(l?t.slice(0,Math.max(h,0)):t),[l,t,h]),O=fl(E,D),k=(0,F.useRef)(null),A=cl(_,l);(0,F.useEffect)(()=>{let e=C.current;return T.current&&=(window.clearTimeout(T.current),null),l&&!e&&!w.current&&s!==!1&&(m(!1),T.current=window.setTimeout(()=>{m(!0)},60)),!l&&e&&(m(!1),w.current=!1),C.current=l,()=>{T.current&&=(window.clearTimeout(T.current),null)}},[s,l]),(0,F.useEffect)(()=>{if(!l||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)},[l,t.length,y]),(0,F.useEffect)(()=>{!l||!k.current||(k.current.scrollTop=k.current.scrollHeight)},[l,h]);let j=(()=>{if(l&&v)return O;if(!l&&v){let e=ul(t);if(e)return e}return d?d.length>60?`${d.slice(0,57)}...`:d:``})(),M=He(!l&&b?b:A);return u&&!e.output?(0,I.jsx)(nt,{completeLabel:a,isAnimating:!1}):(0,I.jsx)(nt,{completeLabel:r,shimmerLabel:i,isAnimating:l,detail:j,expandable:v,expanded:p,onToggleExpand:()=>{w.current=!0,m(e=>!e)},trailingContent:c&&M?(0,I.jsx)(`span`,{className:`shrink-0 font-normal text-an-foreground-muted/60 tabular-nums`,children:M}):void 0,children:(0,I.jsxs)(`div`,{className:`relative`,children:[l&&p&&S>4&&(0,I.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 top-0 z-10 h-10 bg-linear-to-b from-an-background to-transparent`}),(0,I.jsx)(`div`,{ref:k,className:f(t.length>1?`flex flex-col gap-2`:void 0,l&&p&&S>4&&`overflow-y-auto`),style:l&&p&&S>4?{height:`${x}px`}:void 0,children:(l?t.slice(0,Math.max(h,0)):t).map((e,t)=>{let r=l?{...e,state:t===h-1?`input-streaming`:`output-available`}:e,i=Qe[r.type];if(!i)return null;let{isPending:a,isError:o}=Ue(r,n);return(0,I.jsx)(rt,{icon:i.icon,title:i.title(r),subtitle:i.subtitle?.(r),isPending:a,isError:o},r.toolCallId??r.id??`${r.type}-${i.title(r)}`)})})]})})}),ml=[`query`,`question`,`email`,`name`,`id`,`customer`,`url`,`issue`,`body`,`summary`,`title`],hl={List:`Listing`,Get:`Getting`,Create:`Creating`,Update:`Updating`,Delete:`Deleting`,Search:`Searching`,Fetch:`Fetching`,Retrieve:`Retrieving`,Send:`Sending`,Generate:`Generating`,Add:`Adding`,Remove:`Removing`,Modify:`Modifying`,Draft:`Drafting`,Manage:`Managing`,Query:`Querying`,Start:`Starting`,Set:`Setting`,Check:`Checking`,Find:`Finding`},gl={List:`Listed`,Get:`Got`,Create:`Created`,Update:`Updated`,Delete:`Deleted`,Search:`Searched`,Fetch:`Fetched`,Retrieve:`Retrieved`,Send:`Sent`,Generate:`Generated`,Add:`Added`,Remove:`Removed`,Modify:`Modified`,Draft:`Drafted`,Manage:`Managed`,Query:`Queried`,Start:`Started`,Set:`Set`,Check:`Checked`,Find:`Found`};function _l(e){let t=e.displayName.split(` `),n=t[0],r=t.slice(1).join(` `),i=hl[n];return i?r?`${i} ${r}`:i:e.displayName}function vl(e){let t=e.displayName.split(` `),n=t[0],r=t.slice(1).join(` `),i=gl[n];return i?r?`${i} ${r}`:i:e.displayName}function yl(e){if(!e||typeof e!=`object`)return``;let t=Object.entries(e).filter(([,e])=>e!=null&&e!==``);if(t.length===0)return``;let n=[...t].sort(([e],[t])=>{let n=ml.indexOf(e),r=ml.indexOf(t);return n!==-1&&r!==-1?n-r:n===-1?r===-1?0:1:-1}),r=[];for(let[e,t]of n){if(r.length>=2)break;let n=typeof t==`string`?t:JSON.stringify(t),i=n.length>30?n.slice(0,27)+`...`:n;r.push(`${e}: ${i}`)}return r.join(` `)}function bl(e){if(!e)return e;if(Array.isArray(e)){let t=[];for(let n of e)n?.type===`text`&&typeof n?.text==`string`&&t.push(n.text);if(t.length>0){let e=t.join(``);try{return JSON.parse(e)}catch{return e}}return e}if(e?.type===`text`&&typeof e?.text==`string`)try{return JSON.parse(e.text)}catch{return e.text}if(typeof e==`string`)try{return JSON.parse(e)}catch{return e}return e}function xl(e){let t=bl(e);if(typeof t==`string`)return t.length>3e3?t.slice(0,3e3)+`
1391
1391
  ...`:t;let n=JSON.stringify(t,null,2);return n.length>3e3?n.slice(0,3e3)+`
1392
- ...`:n}var Sl=(0,F.memo)(function({part:e,mcpInfo:t,chatStatus:n,defaultOpen:r}){let{isPending:i,isInterrupted:a}=Ue(e,n),o=(0,F.useMemo)(()=>e.state===`input-streaming`?`Preparing ${t.displayName}`:i?_l(t):vl(t),[e.state,i,t]),s=(0,F.useMemo)(()=>e.state===`input-streaming`?``:yl(e.input),[e.input,e.state]),c=(0,F.useMemo)(()=>e.output?xl(e.output):null,[e.output]),l=(0,F.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,I.jsxs)(`span`,{className:`text-sm text-an-tool-color-muted`,children:[t.displayName,` interrupted`]}):(0,I.jsx)(`div`,{className:`an-tool-mcp`,children:(0,I.jsx)(nt,{shimmerLabel:o,completeLabel:o,isAnimating:i,detail:s||void 0,trailingContent:void 0,expandable:u,defaultOpen:r,children:l&&(0,I.jsx)(v,{className:`text-[12px]`,codeControls:!1,content:l})})})},Ve);function Cl({step:e,state:t,onComplete:n,defaultOpen:r,expanded:i,onToggleExpand:a}){return ee(t===`animating`,e.duration,n),(0,I.jsx)(nt,{shimmerLabel:`Thinking`,completeLabel:`Thought`,isAnimating:t===`animating`,expandable:!!e.thoughtContent,defaultOpen:r,expanded:i,onToggleExpand:a,children:(0,I.jsx)(`div`,{className:`max-h-[175px] overflow-y-auto`,children:(0,I.jsx)(`p`,{className:`text-sm whitespace-pre-wrap text-muted-foreground`,children:e.thoughtContent})})})}var wl=(0,F.memo)(function({part:e,step:t,state:n,onComplete:r,defaultOpen:i,expanded:a,onToggleExpand:o}){let s,c,l;if(t&&n&&r)s=t,c=n,l=r;else if(e){let t=ne(e,`Thinking`);s=t.step,c=t.stepState,l=()=>{}}else return null;return(0,I.jsx)(Cl,{step:s,state:c,onComplete:l,defaultOpen:i,expanded:a,onToggleExpand:o})});function Tl({toolSteps:e,stepStates:t,onStepComplete:n,results:r=[],defaultOpen:i}){let a=e.some(e=>t[e.id]===`animating`),o=e.find(e=>e.searchQuery)?.searchQuery??`searching...`,s=r.length,c=s>0;function l({step:e}){return ee(t[e.id]===`animating`,e.duration,()=>n(e.id)),null}return(0,I.jsxs)(I.Fragment,{children:[e.map(e=>(0,I.jsx)(l,{step:e},e.id)),(0,I.jsx)(nt,{shimmerLabel:`Searching...`,completeLabel:`Found ${s} results`,isAnimating:a,expandable:c,defaultOpen:i,children:(0,I.jsxs)(`div`,{className:`overflow-hidden rounded-an-tool-border-radius border border-border bg-an-tool-background`,children:[(0,I.jsxs)(`div`,{className:`flex h-7 items-center gap-1 border-b border-an-tool-border-color px-2.5 py-0 text-xs`,children:[(0,I.jsx)(`span`,{className:`font-medium text-foreground`,children:`Searched for`}),` `,(0,I.jsxs)(`span`,{className:`truncate text-muted-foreground`,children:[`“`,o,`”`]})]}),(0,I.jsx)(`div`,{className:`max-h-[200px] overflow-y-auto bg-background`,children:(0,I.jsx)(`div`,{className:`flex flex-col gap-1 p-1`,children:r.map(e=>(0,I.jsxs)(`div`,{className:f(`flex cursor-default items-center gap-2 rounded-[calc(var(--an-tool-border-radius)-4px)] px-2 py-1`,`hover:bg-muted/50`),children:[(0,I.jsx)(`div`,{className:`flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground`,children:(0,I.jsx)(ue,{className:`h-4 w-4`})}),(0,I.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm text-foreground/90`,children:e.title}),(0,I.jsx)(`span`,{className:`shrink-0 text-xs whitespace-nowrap text-muted-foreground`,children:e.date||e.source})]},`${e.title}-${e.source}-${e.date}`))})})]})})]})}function El(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 Dl=(0,F.memo)(function({part:e,results:t,defaultOpen:n}){let r=e.type?.replace(`tool-`,``)||`WebSearch`,{step:i,stepState:a}=ne(e,r),o={[i.id]:a};return(0,I.jsx)(Tl,{toolSteps:[i],stepStates:o,onStepComplete:()=>{},results:t??El(e.output?.results)??El(e.result?.results),defaultOpen:n})});function Ol(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}=Ue(e,t);return n?`pending`:`success`}var kl=(0,F.memo)(function({part:e,nestedTools:t,chatStatus:n,toolRenderers:r}){let i=e.type;switch(i){case`tool-Bash`:return(0,I.jsx)(ot,{part:e});case`tool-IPython`:return(0,I.jsx)(re,{part:e});case`tool-Edit`:case`tool-Write`:return(0,I.jsx)(Qc,{part:e});case`tool-WebSearch`:case`tool-Grep`:case`tool-Glob`:return(0,I.jsx)(Dl,{part:e});case`tool-PlanWrite`:return(0,I.jsx)(sl,{part:e,chatStatus:n});case`tool-TodoWrite`:return(0,I.jsx)(al,{part:e,chatStatus:n});case`tool-Question`:return(0,I.jsx)(Ye,{part:e,chatStatus:n});case`tool-Task`:case`tool-Agent`:{let r=e.type===`tool-Agent`?`Agent`:`Task`;return(0,I.jsx)(pl,{part:e,nestedTools:t,chatStatus:n,completeLabel:`${r} completed`,shimmerLabel:`Running ${r.toLowerCase()}`,interruptedLabel:`${r} interrupted`,defaultOpen:!1})}case`tool-Thinking`:return(0,I.jsx)(wl,{part:e})}let a=tt(i);if(a){if(r){let t=r[a.toolName];if(t)return(0,I.jsx)(t,{name:a.toolName,input:e.input??{},output:e.output?bl(e.output):void 0,status:Ol(e,n)})}return(0,I.jsx)(Sl,{part:e,mcpInfo:a,chatStatus:n})}if(r&&i.startsWith(`tool-`)){let t=i.slice(5),a=r[t];if(a)return(0,I.jsx)(a,{name:t,input:e.input??{},output:e.output??e.result,status:Ol(e,n)})}let o=Qe[i];if(o){let{isPending:t,isError:r}=Ue(e,n);return(0,I.jsx)(rt,{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}=Ue(e,n);return(0,I.jsx)(rt,{title:c?`Running ${s}`:s,isPending:c,isError:l})}),Al={queued:`Waiting to generate`,generating:`Generating image`,refining:`Refining details`,complete:`Image ready`,error:`Generation failed`},jl={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}},Ml={queued:1,generating:1,refining:.48,complete:0,error:0},Nl=10,Pl=Math.PI*2;function Fl({status:e,reduce:t}){return e===`complete`?(0,I.jsx)(T,{"aria-hidden":`true`,className:`size-3.5`}):e===`error`?(0,I.jsx)(k,{"aria-hidden":`true`,className:`size-3.5`}):(0,I.jsxs)(i.span,{"aria-hidden":`true`,animate:t?void 0:{rotate:360},transition:{duration:2.4,ease:o,repeat:1/0},className:`grid size-3.5 grid-cols-2 place-items-center gap-0.5`,children:[(0,I.jsx)(`span`,{className:`size-1 rounded-[1px] bg-current`}),(0,I.jsx)(`span`,{className:`size-1 rounded-[1px] bg-current opacity-55`}),(0,I.jsx)(`span`,{className:`size-1 rounded-[1px] bg-current opacity-55`}),(0,I.jsx)(`span`,{className:`size-1 rounded-[1px] bg-current`})]})}function Il({interactive:e,reduce:t,status:n}){let r=S(),a=(0,F.useRef)(null);return(0,F.useEffect)(()=>{let n=a.current,i=n?.getContext(`2d`);if(!n||!i)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),i.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=>{i.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,a=Math.ceil(s/Nl)+1,d=Math.ceil(c/Nl)+1,f=(s-(a-1)*Nl)/2,m=(c-(d-1)*Nl)/2;i.fillStyle=l;for(let e=0;e<d;e+=1)for(let t=0;t<a;t+=1){let n=f+t*Nl,a=m+e*Nl,o=n-u.x,s=a-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=a+g*p,y=.65+d*.85;i.globalAlpha=.17+d*.72,i.beginPath(),i.arc(_,v,y,0,Pl),i.fill()}i.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,I.jsx)(i.div,{"aria-hidden":`true`,initial:!1,animate:{opacity:Ml[n]},transition:{duration:t?0:.4,ease:c},className:`absolute inset-0 overflow-hidden bg-muted`,children:(0,I.jsx)(`canvas`,{ref:a,className:`absolute inset-0 size-full text-foreground`})})}function Ll({children:e,status:t=`generating`,label:n,prompt:r,resolution:o=`1024 × 1024`,aspectRatio:s=`1 / 1`,size:l=`compact`,interactive:p=!0,statusText:m,showStatus:h=!0,onRetry:g,className:_,mediaClassName:v,statusClassName:y}){let b=d()??!1,x=t===`queued`||t===`generating`||t===`refining`,S=jl[t],C=m??Al[t],w=n??(r?`${C}: ${r}`:C);return(0,I.jsx)(`div`,{"data-slot":`image-generation`,"data-state":t,"aria-busy":x,className:f(`w-full`,_),children:(0,I.jsxs)(`div`,{className:f(`w-full`,l===`compact`&&`mx-auto max-w-52`),children:[(0,I.jsxs)(`div`,{role:`img`,"aria-label":w,style:{aspectRatio:s},className:`relative isolate w-full overflow-hidden rounded-xl bg-muted`,children:[(0,I.jsx)(i.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:c},className:f(`absolute inset-0 [&>*]:size-full [&>*]:object-cover [&_img]:size-full [&_img]:object-cover`,v),children:e}),(0,I.jsx)(u,{initial:!1,children:x?(0,I.jsx)(i.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:b?0:.25,ease:c},className:`absolute inset-0`,children:(0,I.jsx)(Il,{interactive:p,reduce:b,status:t})},`dither-field`):null}),o?(0,I.jsx)(`span`,{className:`absolute top-2 right-2 z-10 rounded-full bg-background/75 px-2 py-0.5 font-mono text-[10px] tabular-nums text-muted-foreground`,children:o}):null]}),(0,I.jsx)(u,{initial:!1,children:h||r?(0,I.jsxs)(i.div,{initial:!1,className:`mt-3 text-left`,children:[(0,I.jsxs)(`div`,{"aria-live":`polite`,className:f(h?`flex min-h-5 items-center gap-2`:`contents`,`text-sm font-medium text-foreground`,t===`error`&&`text-destructive`,y),children:[h?(0,I.jsx)(Fl,{status:t,reduce:b}):null,(0,I.jsx)(u,{mode:`popLayout`,initial:!1,children:h?(0,I.jsx)(i.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:c},children:C},C):null})]}),r?(0,I.jsxs)(`p`,{className:`mt-0.5 truncate text-xs text-muted-foreground`,children:[`“`,r,`”`]}):null]},`status-block`):null}),t===`error`&&g?(0,I.jsxs)(i.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,I.jsx)(de,{"aria-hidden":`true`,className:`size-4`}),`Try again`]}):null]})})}function Rl(e){return e===`in-progress`?`In progress`:e===`completed`?`Completed`:e===`cancelled`?`Cancelled`:`Pending`}function zl({complete:e}){let t=d()??!1;return(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`relative grid size-6 shrink-0 place-items-center`,children:(0,I.jsx)(u,{initial:!1,mode:`popLayout`,children:e?(0,I.jsxs)(i.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}:l,className:`absolute size-5.5 overflow-visible text-emerald-500`,children:[(0,I.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`,fill:`currentColor`}),(0,I.jsx)(i.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:c}})]},`complete`):(0,I.jsx)(i.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}:l,className:`absolute grid place-items-center text-muted-foreground`,children:(0,I.jsx)(x,{className:`size-4`})},`todo`)})})}function Bl({status:e,progress:t}){let n=d()??!1,r=t===void 0?.68:Math.min(100,Math.max(0,t))/100;return(0,I.jsxs)(i.svg,{"aria-hidden":`true`,viewBox:`0 0 24 24`,initial:!1,className:f(`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,I.jsx)(i.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:c},className:f(e===`in-progress`&&`opacity-20`)}),(0,I.jsx)(i.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}:s,style:{transformOrigin:`12px 12px`}}),(0,I.jsx)(i.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:c}}),(0,I.jsx)(i.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:c}})]})}function Vl({items:e,title:t=`To-dos`,open:n,defaultOpen:r=!0,onOpenChange:a,collapseOnComplete:o=!0,maxHeight:p=248,className:m}){let h=d()??!1,g=(0,F.useId)(),_=`${g}-trigger`,v=`${g}-content`,y=(0,F.useRef)(null),b=(0,F.useRef)(!1),[x,S]=(0,F.useState)(r),C=n??x,w=e.filter(e=>e.status===`completed`).length,T=e.length>0&&w===e.length,D=e.length,O=(0,F.useCallback)(e=>{n===void 0&&S(e),a?.(e)},[a,n]);return(0,F.useEffect)(()=>{b.current&&!T&&O(!0),!b.current&&T&&o&&O(!1),b.current=T},[T,o,O]),(0,F.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,I.jsxs)(`section`,{"aria-label":`Agent task list`,className:f(`w-full overflow-hidden rounded-2xl border border-border/70`,m),children:[(0,I.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,I.jsx)(zl,{complete:T}),(0,I.jsx)(`h3`,{className:`min-w-0 flex-1 truncate text-sm font-medium text-foreground/90`,children:t}),(0,I.jsxs)(`span`,{className:f(`shrink-0 text-xs font-medium tabular-nums text-muted-foreground`,T&&`text-emerald-600 dark:text-emerald-400`),children:[(0,I.jsxs)(`span`,{className:`sr-only`,children:[w,` of `,e.length,` tasks completed`]}),(0,I.jsxs)(`span`,{"aria-hidden":`true`,className:`inline-flex`,children:[(0,I.jsx)(ae,{value:String(w),children:w}),(0,I.jsx)(`span`,{children:`/`}),(0,I.jsx)(`span`,{children:e.length})]})]}),(0,I.jsx)(i.span,{"aria-hidden":`true`,animate:{rotate:C?180:0},transition:h?{duration:0}:l,className:`text-muted-foreground/50 transition-colors group-hover:text-muted-foreground`,children:(0,I.jsx)(E,{className:`size-3.5`})})]}),(0,I.jsx)(De,{id:v,role:`region`,"aria-labelledby":_,open:C,children:(0,I.jsxs)(`div`,{ref:y,className:`scrollbar-hide overflow-y-auto px-2 pb-2`,style:{maxHeight:p},children:[(0,I.jsx)(`ol`,{"aria-live":`polite`,className:`space-y-0`,children:(0,I.jsx)(u,{initial:!1,mode:`popLayout`,children:e.map(e=>{let t=e.status??`pending`;return(0,I.jsxs)(i.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:c},y:s,layout:s},className:`flex min-h-9 items-center gap-2.5 rounded-xl px-1.5 py-1`,children:[(0,I.jsx)(Bl,{status:t,progress:e.progress}),(0,I.jsxs)(`span`,{className:`sr-only`,children:[Rl(t),`: `]}),(0,I.jsx)(`span`,{className:f(`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,I.jsxs)(`span`,{className:`relative inline-block max-w-full`,children:[e.title,(0,I.jsx)(i.span,{"aria-hidden":`true`,initial:!1,animate:{scaleX:+(t===`completed`),opacity:+(t===`completed`)},transition:h?{duration:0}:{duration:.28,ease:c,delay:.06},className:`absolute inset-x-0 top-1/2 h-px origin-left bg-current`})]})}),e.detail?(0,I.jsx)(`span`,{className:`shrink-0 text-sm text-muted-foreground/55`,children:e.detail}):null]},e.id)})})}),!e.length&&(0,I.jsx)(`p`,{className:`px-1.5 py-2 text-sm text-muted-foreground`,children:`No tasks yet`})]})})]})}function Hl({steps:e,activeIndex:t,className:n,...r}){let i=e.length,a=Ae(t,i),o=a>=i,s=je(a,i);return(0,I.jsxs)(`div`,{"data-slot":`agent-plan`,className:f(`flex w-full max-w-sm flex-col gap-3`,n),...r,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsx)(`span`,{className:`text-[13.5px] font-medium`,children:`Plan`}),(0,I.jsxs)(`span`,{className:f(ke,`text-foreground/35 tabular-nums`),children:[a,` of `,i]})]}),(0,I.jsx)(`div`,{className:`bg-foreground/[0.06] h-[3px] w-full overflow-hidden rounded-full`,children:(0,I.jsx)(`span`,{className:`bg-foreground/80 block h-full rounded-full transition-[width] duration-500`,style:{width:`${s}%`}})}),(0,I.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:e.map((e,t)=>{let n=o||t<a,r=!o&&t===a;return(0,I.jsxs)(`li`,{className:`flex items-center gap-2.5 text-[13.5px]`,children:[(0,I.jsx)(`span`,{className:`flex size-4 shrink-0 items-center justify-center`,children:n?(0,I.jsx)(T,{className:`text-foreground/35 size-3.5`}):r?(0,I.jsx)(j,{className:`text-foreground/90 size-3.5 animate-spin motion-reduce:animate-none`}):(0,I.jsx)(`span`,{"aria-hidden":!0,className:`bg-foreground/15 size-1.5 rounded-full`})}),(0,I.jsx)(`span`,{className:f(n&&`text-foreground/40`,r&&`text-foreground/90`,!n&&!r&&`text-foreground/35`),children:e})]},e)})})]})}function Ul(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 Wl({presentation:e,className:t}){return(0,I.jsx)(Hl,{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 Gl(e){return e===`approving`?`Approving`:e===`approved`?`Approved`:e===`denied`?`Denied`:e===`running`?`Running`:e===`complete`?`Completed`:e===`error`?`Failed`:`Approval required`}function Kl(e){return e===`pending`?`border-amber-500/30 bg-amber-500/10 text-amber-600 dark:text-amber-400`:e===`approving`||e===`running`?`border-blue-500/30 bg-blue-500/10 text-blue-600 dark:text-blue-400`: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 ql({tool:e,title:t=`Allow this tool to run?`,description:n,parameters:r=[],status:o=`pending`,open:s,defaultOpen:p=!1,onOpenChange:m,onApprove:h,onAlwaysAllow:g,onDeny:_,className:v}){let y=d()??!1,b=`${(0,F.useId)()}-details`,x=(0,F.useRef)(o),[S,C]=(0,F.useState)(p),w=s??S,D=(0,F.useCallback)(e=>{s===void 0&&C(e),m?.(e)},[m,s]),O=o===`approving`||o===`running`,A=o===`pending`,M=o===`error`;return(0,F.useEffect)(()=>{x.current===`pending`&&o!==`pending`&&D(!1),x.current=o},[D,o]),(0,I.jsxs)(`div`,{"data-state":o,"aria-busy":O,className:f(`w-full overflow-hidden rounded-2xl border border-border/60 bg-muted/20 text-sm`,v),children:[(0,I.jsxs)(`div`,{className:`flex items-start gap-3 p-4`,children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,className:f(`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:O?(0,I.jsx)(j,{className:f(`size-4`,!y&&`animate-spin`)}):M?(0,I.jsx)(k,{className:`size-4`}):o===`denied`?(0,I.jsx)(ge,{className:`size-4`}):o===`approved`||o===`complete`?(0,I.jsx)(T,{className:`size-4`}):(0,I.jsx)(ce,{className:`size-4`})}),(0,I.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-start justify-between gap-3`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`div`,{className:`font-medium text-foreground`,children:t}),(0,I.jsx)(`div`,{className:`mt-0.5 truncate font-mono text-xs text-muted-foreground`,children:e})]}),(0,I.jsx)(`span`,{className:f(`shrink-0 rounded-full border px-2 py-0.5 text-[11px] font-medium transition-colors`,Kl(o)),children:Gl(o)})]}),n?(0,I.jsx)(`p`,{className:`mt-2 leading-5 text-muted-foreground`,children:n}):null,r.length?(0,I.jsxs)(`button`,{type:`button`,"aria-expanded":w,"aria-controls":b,onClick:()=>D(!w),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,I.jsx)(i.span,{"aria-hidden":`true`,animate:{rotate:w?180:0},transition:y?{duration:0}:l,children:(0,I.jsx)(E,{className:`size-3.5`})})]}):null]})]}),(0,I.jsx)(De,{id:b,open:w,children:(0,I.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,I.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,7rem)_minmax(0,1fr)] items-center gap-3 text-xs`,children:[(0,I.jsx)(`dt`,{className:`text-muted-foreground`,children:e.label}),(0,I.jsx)(`dd`,{className:`min-w-0 break-words font-mono text-foreground/85`,children:e.value})]},e.id))})}),(0,I.jsx)(u,{initial:!1,children:A?(0,I.jsxs)(i.div,{initial:y?{opacity:0}:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0},transition:{duration:y?.12:.22,ease:c},className:`flex flex-wrap items-center gap-2 border-t border-border/60 px-4 py-3`,children:[(0,I.jsx)(i.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,I.jsx)(i.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,I.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 Jl(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 Yl(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 Xl(e,...t){for(let n of t){let t=e?.[n];if(typeof t==`boolean`)return t}}function Zl(e){if(typeof e==`string`)return e;if(e==null)return``;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function Ql(e){return e.output!==void 0&&e.output!==null?e.output:e.result}function $l(e){let t=Jl(e),n=Jl(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:Zl(s),l=Yl(r,`durationMs`,`duration_ms`,`duration`),u=Xl(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 eu(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:Zl(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:Zl(e),language:`json`}]}let i=Zl(t);return i.trim()?[{label:`output`,content:i,language:`text`}]:[]}function tu(e,t){return eu(e,t).map(e=>`${e.label}\n${e.content}`).join(`
1392
+ ...`:n}var Sl=(0,F.memo)(function({part:e,mcpInfo:t,chatStatus:n,defaultOpen:r}){let{isPending:i,isInterrupted:a}=Ue(e,n),o=(0,F.useMemo)(()=>e.state===`input-streaming`?`Preparing ${t.displayName}`:i?_l(t):vl(t),[e.state,i,t]),s=(0,F.useMemo)(()=>e.state===`input-streaming`?``:yl(e.input),[e.input,e.state]),c=(0,F.useMemo)(()=>e.output?xl(e.output):null,[e.output]),l=(0,F.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,I.jsxs)(`span`,{className:`text-sm text-an-tool-color-muted`,children:[t.displayName,` interrupted`]}):(0,I.jsx)(`div`,{className:`an-tool-mcp`,children:(0,I.jsx)(nt,{shimmerLabel:o,completeLabel:o,isAnimating:i,detail:s||void 0,trailingContent:void 0,expandable:u,defaultOpen:r,children:l&&(0,I.jsx)(v,{className:`text-[0.75rem]`,codeControls:!1,content:l})})})},Ve);function Cl({step:e,state:t,onComplete:n,defaultOpen:r,expanded:i,onToggleExpand:a}){return ee(t===`animating`,e.duration,n),(0,I.jsx)(nt,{shimmerLabel:`Thinking`,completeLabel:`Thought`,isAnimating:t===`animating`,expandable:!!e.thoughtContent,defaultOpen:r,expanded:i,onToggleExpand:a,children:(0,I.jsx)(`div`,{className:`max-h-[175px] overflow-y-auto`,children:(0,I.jsx)(`p`,{className:`text-sm whitespace-pre-wrap text-muted-foreground`,children:e.thoughtContent})})})}var wl=(0,F.memo)(function({part:e,step:t,state:n,onComplete:r,defaultOpen:i,expanded:a,onToggleExpand:o}){let s,c,l;if(t&&n&&r)s=t,c=n,l=r;else if(e){let t=ne(e,`Thinking`);s=t.step,c=t.stepState,l=()=>{}}else return null;return(0,I.jsx)(Cl,{step:s,state:c,onComplete:l,defaultOpen:i,expanded:a,onToggleExpand:o})});function Tl({toolSteps:e,stepStates:t,onStepComplete:n,results:r=[],defaultOpen:i}){let a=e.some(e=>t[e.id]===`animating`),o=e.find(e=>e.searchQuery)?.searchQuery??`searching...`,s=r.length,c=s>0;function l({step:e}){return ee(t[e.id]===`animating`,e.duration,()=>n(e.id)),null}return(0,I.jsxs)(I.Fragment,{children:[e.map(e=>(0,I.jsx)(l,{step:e},e.id)),(0,I.jsx)(nt,{shimmerLabel:`Searching...`,completeLabel:`Found ${s} results`,isAnimating:a,expandable:c,defaultOpen:i,children:(0,I.jsxs)(`div`,{className:`overflow-hidden rounded-an-tool-border-radius border border-border bg-an-tool-background`,children:[(0,I.jsxs)(`div`,{className:`flex h-7 items-center gap-1 border-b border-an-tool-border-color px-2.5 py-0 text-xs`,children:[(0,I.jsx)(`span`,{className:`font-medium text-foreground`,children:`Searched for`}),` `,(0,I.jsxs)(`span`,{className:`truncate text-muted-foreground`,children:[`“`,o,`”`]})]}),(0,I.jsx)(`div`,{className:`max-h-[200px] overflow-y-auto bg-background`,children:(0,I.jsx)(`div`,{className:`flex flex-col gap-1 p-1`,children:r.map(e=>(0,I.jsxs)(`div`,{className:f(`flex cursor-default items-center gap-2 rounded-[calc(var(--an-tool-border-radius)-4px)] px-2 py-1`,`hover:bg-muted/50`),children:[(0,I.jsx)(`div`,{className:`flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground`,children:(0,I.jsx)(ue,{className:`h-4 w-4`})}),(0,I.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm text-foreground/90`,children:e.title}),(0,I.jsx)(`span`,{className:`shrink-0 text-xs whitespace-nowrap text-muted-foreground`,children:e.date||e.source})]},`${e.title}-${e.source}-${e.date}`))})})]})})]})}function El(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 Dl=(0,F.memo)(function({part:e,results:t,defaultOpen:n}){let r=e.type?.replace(`tool-`,``)||`WebSearch`,{step:i,stepState:a}=ne(e,r),o={[i.id]:a};return(0,I.jsx)(Tl,{toolSteps:[i],stepStates:o,onStepComplete:()=>{},results:t??El(e.output?.results)??El(e.result?.results),defaultOpen:n})});function Ol(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}=Ue(e,t);return n?`pending`:`success`}var kl=(0,F.memo)(function({part:e,nestedTools:t,chatStatus:n,toolRenderers:r}){let i=e.type;switch(i){case`tool-Bash`:return(0,I.jsx)(ot,{part:e});case`tool-IPython`:return(0,I.jsx)(re,{part:e});case`tool-Edit`:case`tool-Write`:return(0,I.jsx)(Qc,{part:e});case`tool-WebSearch`:case`tool-Grep`:case`tool-Glob`:return(0,I.jsx)(Dl,{part:e});case`tool-PlanWrite`:return(0,I.jsx)(sl,{part:e,chatStatus:n});case`tool-TodoWrite`:return(0,I.jsx)(al,{part:e,chatStatus:n});case`tool-Question`:return(0,I.jsx)(Ye,{part:e,chatStatus:n});case`tool-Task`:case`tool-Agent`:{let r=e.type===`tool-Agent`?`Agent`:`Task`;return(0,I.jsx)(pl,{part:e,nestedTools:t,chatStatus:n,completeLabel:`${r} completed`,shimmerLabel:`Running ${r.toLowerCase()}`,interruptedLabel:`${r} interrupted`,defaultOpen:!1})}case`tool-Thinking`:return(0,I.jsx)(wl,{part:e})}let a=tt(i);if(a){if(r){let t=r[a.toolName];if(t)return(0,I.jsx)(t,{name:a.toolName,input:e.input??{},output:e.output?bl(e.output):void 0,status:Ol(e,n)})}return(0,I.jsx)(Sl,{part:e,mcpInfo:a,chatStatus:n})}if(r&&i.startsWith(`tool-`)){let t=i.slice(5),a=r[t];if(a)return(0,I.jsx)(a,{name:t,input:e.input??{},output:e.output??e.result,status:Ol(e,n)})}let o=Qe[i];if(o){let{isPending:t,isError:r}=Ue(e,n);return(0,I.jsx)(rt,{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}=Ue(e,n);return(0,I.jsx)(rt,{title:c?`Running ${s}`:s,isPending:c,isError:l})}),Al={queued:`Waiting to generate`,generating:`Generating image`,refining:`Refining details`,complete:`Image ready`,error:`Generation failed`},jl={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}},Ml={queued:1,generating:1,refining:.48,complete:0,error:0},Nl=10,Pl=Math.PI*2;function Fl({status:e,reduce:t}){return e===`complete`?(0,I.jsx)(T,{"aria-hidden":`true`,className:`size-3.5`}):e===`error`?(0,I.jsx)(k,{"aria-hidden":`true`,className:`size-3.5`}):(0,I.jsxs)(i.span,{"aria-hidden":`true`,animate:t?void 0:{rotate:360},transition:{duration:2.4,ease:o,repeat:1/0},className:`grid size-3.5 grid-cols-2 place-items-center gap-0.5`,children:[(0,I.jsx)(`span`,{className:`size-1 rounded-[1px] bg-current`}),(0,I.jsx)(`span`,{className:`size-1 rounded-[1px] bg-current opacity-55`}),(0,I.jsx)(`span`,{className:`size-1 rounded-[1px] bg-current opacity-55`}),(0,I.jsx)(`span`,{className:`size-1 rounded-[1px] bg-current`})]})}function Il({interactive:e,reduce:t,status:n}){let r=S(),a=(0,F.useRef)(null);return(0,F.useEffect)(()=>{let n=a.current,i=n?.getContext(`2d`);if(!n||!i)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),i.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=>{i.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,a=Math.ceil(s/Nl)+1,d=Math.ceil(c/Nl)+1,f=(s-(a-1)*Nl)/2,m=(c-(d-1)*Nl)/2;i.fillStyle=l;for(let e=0;e<d;e+=1)for(let t=0;t<a;t+=1){let n=f+t*Nl,a=m+e*Nl,o=n-u.x,s=a-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=a+g*p,y=.65+d*.85;i.globalAlpha=.17+d*.72,i.beginPath(),i.arc(_,v,y,0,Pl),i.fill()}i.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,I.jsx)(i.div,{"aria-hidden":`true`,initial:!1,animate:{opacity:Ml[n]},transition:{duration:t?0:.4,ease:c},className:`absolute inset-0 overflow-hidden bg-muted`,children:(0,I.jsx)(`canvas`,{ref:a,className:`absolute inset-0 size-full text-foreground`})})}function Ll({children:e,status:t=`generating`,label:n,prompt:r,resolution:o=`1024 × 1024`,aspectRatio:s=`1 / 1`,size:l=`compact`,interactive:p=!0,statusText:m,showStatus:h=!0,onRetry:g,className:_,mediaClassName:v,statusClassName:y}){let b=d()??!1,x=t===`queued`||t===`generating`||t===`refining`,S=jl[t],C=m??Al[t],w=n??(r?`${C}: ${r}`:C);return(0,I.jsx)(`div`,{"data-slot":`image-generation`,"data-state":t,"aria-busy":x,className:f(`w-full`,_),children:(0,I.jsxs)(`div`,{className:f(`w-full`,l===`compact`&&`mx-auto max-w-52`),children:[(0,I.jsxs)(`div`,{role:`img`,"aria-label":w,style:{aspectRatio:s},className:`relative isolate w-full overflow-hidden rounded-xl bg-muted`,children:[(0,I.jsx)(i.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:c},className:f(`absolute inset-0 [&>*]:size-full [&>*]:object-cover [&_img]:size-full [&_img]:object-cover`,v),children:e}),(0,I.jsx)(u,{initial:!1,children:x?(0,I.jsx)(i.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:b?0:.25,ease:c},className:`absolute inset-0`,children:(0,I.jsx)(Il,{interactive:p,reduce:b,status:t})},`dither-field`):null}),o?(0,I.jsx)(`span`,{className:`absolute top-2 right-2 z-10 rounded-full bg-background/75 px-2 py-0.5 font-mono text-[0.625rem] tabular-nums text-muted-foreground`,children:o}):null]}),(0,I.jsx)(u,{initial:!1,children:h||r?(0,I.jsxs)(i.div,{initial:!1,className:`mt-3 text-left`,children:[(0,I.jsxs)(`div`,{"aria-live":`polite`,className:f(h?`flex min-h-5 items-center gap-2`:`contents`,`text-sm font-medium text-foreground`,t===`error`&&`text-destructive`,y),children:[h?(0,I.jsx)(Fl,{status:t,reduce:b}):null,(0,I.jsx)(u,{mode:`popLayout`,initial:!1,children:h?(0,I.jsx)(i.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:c},children:C},C):null})]}),r?(0,I.jsxs)(`p`,{className:`mt-0.5 truncate text-xs text-muted-foreground`,children:[`“`,r,`”`]}):null]},`status-block`):null}),t===`error`&&g?(0,I.jsxs)(i.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,I.jsx)(de,{"aria-hidden":`true`,className:`size-4`}),`Try again`]}):null]})})}function Rl(e){return e===`in-progress`?`In progress`:e===`completed`?`Completed`:e===`cancelled`?`Cancelled`:`Pending`}function zl({complete:e}){let t=d()??!1;return(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`relative grid size-6 shrink-0 place-items-center`,children:(0,I.jsx)(u,{initial:!1,mode:`popLayout`,children:e?(0,I.jsxs)(i.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}:l,className:`absolute size-5.5 overflow-visible text-emerald-500`,children:[(0,I.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`,fill:`currentColor`}),(0,I.jsx)(i.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:c}})]},`complete`):(0,I.jsx)(i.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}:l,className:`absolute grid place-items-center text-muted-foreground`,children:(0,I.jsx)(x,{className:`size-4`})},`todo`)})})}function Bl({status:e,progress:t}){let n=d()??!1,r=t===void 0?.68:Math.min(100,Math.max(0,t))/100;return(0,I.jsxs)(i.svg,{"aria-hidden":`true`,viewBox:`0 0 24 24`,initial:!1,className:f(`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,I.jsx)(i.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:c},className:f(e===`in-progress`&&`opacity-20`)}),(0,I.jsx)(i.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}:s,style:{transformOrigin:`12px 12px`}}),(0,I.jsx)(i.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:c}}),(0,I.jsx)(i.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:c}})]})}function Vl({items:e,title:t=`To-dos`,open:n,defaultOpen:r=!0,onOpenChange:a,collapseOnComplete:o=!0,maxHeight:p=248,className:m}){let h=d()??!1,g=(0,F.useId)(),_=`${g}-trigger`,v=`${g}-content`,y=(0,F.useRef)(null),b=(0,F.useRef)(!1),[x,S]=(0,F.useState)(r),C=n??x,w=e.filter(e=>e.status===`completed`).length,T=e.length>0&&w===e.length,D=e.length,O=(0,F.useCallback)(e=>{n===void 0&&S(e),a?.(e)},[a,n]);return(0,F.useEffect)(()=>{b.current&&!T&&O(!0),!b.current&&T&&o&&O(!1),b.current=T},[T,o,O]),(0,F.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,I.jsxs)(`section`,{"aria-label":`Agent task list`,className:f(`w-full overflow-hidden rounded-2xl border border-border/70`,m),children:[(0,I.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,I.jsx)(zl,{complete:T}),(0,I.jsx)(`h3`,{className:`min-w-0 flex-1 truncate text-sm font-medium text-foreground/90`,children:t}),(0,I.jsxs)(`span`,{className:f(`shrink-0 text-xs font-medium tabular-nums text-muted-foreground`,T&&`text-emerald-600 dark:text-emerald-400`),children:[(0,I.jsxs)(`span`,{className:`sr-only`,children:[w,` of `,e.length,` tasks completed`]}),(0,I.jsxs)(`span`,{"aria-hidden":`true`,className:`inline-flex`,children:[(0,I.jsx)(ae,{value:String(w),children:w}),(0,I.jsx)(`span`,{children:`/`}),(0,I.jsx)(`span`,{children:e.length})]})]}),(0,I.jsx)(i.span,{"aria-hidden":`true`,animate:{rotate:C?180:0},transition:h?{duration:0}:l,className:`text-muted-foreground/50 transition-colors group-hover:text-muted-foreground`,children:(0,I.jsx)(E,{className:`size-3.5`})})]}),(0,I.jsx)(De,{id:v,role:`region`,"aria-labelledby":_,open:C,children:(0,I.jsxs)(`div`,{ref:y,className:`scrollbar-hide overflow-y-auto px-2 pb-2`,style:{maxHeight:p},children:[(0,I.jsx)(`ol`,{"aria-live":T?`polite`:`off`,className:`space-y-0`,children:(0,I.jsx)(u,{initial:!1,mode:`popLayout`,children:e.map(e=>{let t=e.status??`pending`;return(0,I.jsxs)(i.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:c},y:s,layout:s},className:`flex min-h-9 items-center gap-2.5 rounded-xl px-1.5 py-1`,children:[(0,I.jsx)(Bl,{status:t,progress:e.progress}),(0,I.jsxs)(`span`,{className:`sr-only`,children:[Rl(t),`: `]}),(0,I.jsx)(`span`,{className:f(`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,I.jsxs)(`span`,{className:`relative inline-block max-w-full`,children:[e.title,(0,I.jsx)(i.span,{"aria-hidden":`true`,initial:!1,animate:{scaleX:+(t===`completed`),opacity:+(t===`completed`)},transition:h?{duration:0}:{duration:.28,ease:c,delay:.06},className:`absolute inset-x-0 top-1/2 h-px origin-left bg-current`})]})}),e.detail?(0,I.jsx)(`span`,{className:`shrink-0 text-sm text-muted-foreground/55`,children:e.detail}):null]},e.id)})})}),!e.length&&(0,I.jsx)(`p`,{className:`px-1.5 py-2 text-sm text-muted-foreground`,children:`No tasks yet`})]})})]})}function Hl({steps:e,activeIndex:t,className:n,...r}){let i=e.length,a=Ae(t,i),o=a>=i,s=je(a,i);return(0,I.jsxs)(`div`,{"data-slot":`agent-plan`,className:f(`flex w-full max-w-sm flex-col gap-3`,n),...r,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsx)(`span`,{className:`text-[0.84375rem] font-medium`,children:`Plan`}),(0,I.jsxs)(`span`,{className:f(ke,`text-foreground/35 tabular-nums`),children:[a,` of `,i]})]}),(0,I.jsx)(`div`,{className:`bg-foreground/[0.06] h-[3px] w-full overflow-hidden rounded-full`,children:(0,I.jsx)(`span`,{className:`bg-foreground/80 block h-full rounded-full transition-[width] duration-500`,style:{width:`${s}%`}})}),(0,I.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:e.map((e,t)=>{let n=o||t<a,r=!o&&t===a;return(0,I.jsxs)(`li`,{className:`flex items-center gap-2.5 text-[0.84375rem]`,children:[(0,I.jsx)(`span`,{className:`flex size-4 shrink-0 items-center justify-center`,children:n?(0,I.jsx)(T,{className:`text-foreground/35 size-3.5`}):r?(0,I.jsx)(j,{className:`text-foreground/90 size-3.5 animate-spin motion-reduce:animate-none`}):(0,I.jsx)(`span`,{"aria-hidden":!0,className:`bg-foreground/15 size-1.5 rounded-full`})}),(0,I.jsx)(`span`,{className:f(n&&`text-foreground/40`,r&&`text-foreground/90`,!n&&!r&&`text-foreground/35`),children:e})]},e)})})]})}function Ul(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 Wl({presentation:e,className:t}){return(0,I.jsx)(Hl,{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 Gl(e){return e===`approving`?`Approving`:e===`approved`?`Approved`:e===`denied`?`Denied`:e===`running`?`Running`:e===`complete`?`Completed`:e===`error`?`Failed`:`Approval required`}function Kl(e){return e===`pending`?`border-amber-500/30 bg-amber-500/10 text-amber-600 dark:text-amber-400`:e===`approving`||e===`running`?`border-blue-500/30 bg-blue-500/10 text-blue-600 dark:text-blue-400`: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 ql({tool:e,title:t=`Allow this tool to run?`,description:n,parameters:r=[],status:o=`pending`,open:s,defaultOpen:p=!1,onOpenChange:m,onApprove:h,onAlwaysAllow:g,onDeny:_,className:v}){let y=d()??!1,b=`${(0,F.useId)()}-details`,x=(0,F.useRef)(o),[S,C]=(0,F.useState)(p),w=s??S,D=(0,F.useCallback)(e=>{s===void 0&&C(e),m?.(e)},[m,s]),O=o===`approving`||o===`running`,A=o===`pending`,M=o===`error`;return(0,F.useEffect)(()=>{x.current===`pending`&&o!==`pending`&&D(!1),x.current=o},[D,o]),(0,I.jsxs)(`div`,{"data-state":o,"aria-busy":O,className:f(`w-full overflow-hidden rounded-2xl border border-border/60 bg-muted/20 text-sm`,v),children:[(0,I.jsxs)(`div`,{className:`flex items-start gap-3 p-4`,children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,className:f(`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:O?(0,I.jsx)(j,{className:f(`size-4`,!y&&`animate-spin`)}):M?(0,I.jsx)(k,{className:`size-4`}):o===`denied`?(0,I.jsx)(ge,{className:`size-4`}):o===`approved`||o===`complete`?(0,I.jsx)(T,{className:`size-4`}):(0,I.jsx)(ce,{className:`size-4`})}),(0,I.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-start justify-between gap-3`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`div`,{className:`font-medium text-foreground`,children:t}),(0,I.jsx)(`div`,{className:`mt-0.5 truncate font-mono text-xs text-muted-foreground`,children:e})]}),(0,I.jsx)(`span`,{className:f(`shrink-0 rounded-full border px-2 py-0.5 text-[0.6875rem] font-medium transition-colors`,Kl(o)),children:Gl(o)})]}),n?(0,I.jsx)(`p`,{className:`mt-2 leading-5 text-muted-foreground`,children:n}):null,r.length?(0,I.jsxs)(`button`,{type:`button`,"aria-expanded":w,"aria-controls":b,onClick:()=>D(!w),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,I.jsx)(i.span,{"aria-hidden":`true`,animate:{rotate:w?180:0},transition:y?{duration:0}:l,children:(0,I.jsx)(E,{className:`size-3.5`})})]}):null]})]}),(0,I.jsx)(De,{id:b,open:w,children:(0,I.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,I.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,7rem)_minmax(0,1fr)] items-center gap-3 text-xs`,children:[(0,I.jsx)(`dt`,{className:`text-muted-foreground`,children:e.label}),(0,I.jsx)(`dd`,{className:`min-w-0 break-words font-mono text-foreground/85`,children:e.value})]},e.id))})}),(0,I.jsx)(u,{initial:!1,children:A?(0,I.jsxs)(i.div,{initial:y?{opacity:0}:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0},transition:{duration:y?.12:.22,ease:c},className:`flex flex-wrap items-center gap-2 border-t border-border/60 px-4 py-3`,children:[(0,I.jsx)(i.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,I.jsx)(i.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,I.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 Jl(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 Yl(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 Xl(e,...t){for(let n of t){let t=e?.[n];if(typeof t==`boolean`)return t}}function Zl(e){if(typeof e==`string`)return e;if(e==null)return``;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function Ql(e){return e.output!==void 0&&e.output!==null?e.output:e.result}function $l(e){let t=Jl(e),n=Jl(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:Zl(s),l=Yl(r,`durationMs`,`duration_ms`,`duration`),u=Xl(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 eu(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:Zl(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:Zl(e),language:`json`}]}let i=Zl(t);return i.trim()?[{label:`output`,content:i,language:`text`}]:[]}function tu(e,t){return eu(e,t).map(e=>`${e.label}\n${e.content}`).join(`
1393
1393
 
1394
1394
  `)}function nu(e){return Jl(e.input)??Jl(e.args)}function ru(e,...t){for(let n of t){let t=e?.[n];if(Array.isArray(t))return t}}function iu(e,t){return $(t.details??t.record,`diff`,`patch`)??$(e,`diff`,`patch`)}function au(e,t){return $(e,`path`,`filePath`,`filename`,`file`)??$(t.details??t.record,`path`,`filePath`,`filename`,`file`)??`workspace file`}function ou(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 su(e,t){let n=t.details??t.record,r=Jl(e?.plan)??Jl(n?.plan),i=ru(e,`todos`)??ru(r,`todos`,`items`)??ru(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`?`in-progress`:i===`completed`?`completed`:i===`cancelled`?`cancelled`:`pending`;return[{id:`${t}-${r}`,title:r,status:a}]}):[]}function cu(e){let t=ru(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&&Oe(i)?i:void 0;return[{id:`${t}-${r}`,title:r,url:a,domain:$(n,`domain`,`source`)}]}):[]}function lu(e){return $(e.details??e.record,`url`,`imageUrl`,`image_url`)}function uu(e,t){return Q(e?.approval)??Q(t.details?.approval)??Q(t.record?.approval)}function du(e){let t=typeof e.type==`string`?e.type:`Tool`;return t.startsWith(`tool-`)?t.slice(5):t}function fu(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 pu(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 mu(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 hu(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()}function gu(e,t){let n=Q(e);if(!n)return;let r=du(n),i=r.toLowerCase(),a=nu(n),o=Ql(n),s=$l(o),c=fu(n,t),l=$(a,`command`,`cmd`,`code`,`script`),u=mu(r,l),d=$(a,`thought`,`text`),f=[];s.durationMs!==void 0&&f.push(`${s.durationMs}ms`),s.kernelRestarted&&f.push(`kernel restarted`);let p=iu(a,s),m=i.includes(`todo`)||i.includes(`plan`)?su(a,s):[],h=i.includes(`search`)||i.includes(`web`)||i.includes(`source`)||i.includes(`citation`)?cu(s):[],g=i.includes(`image`)||i.includes(`generat`)?lu(s):void 0,_=uu(a,s),v=tu(s,o)||(i===`thinking`||i===`reasoning`?d??``:``),y=!!v.trim(),b=typeof n.toolCallId==`string`&&n.toolCallId?n.toolCallId:`${r}-${JSON.stringify(a??{})}`,x;return m.length>0?x={kind:`todo`,title:i.includes(`plan`)?`Plan`:`Todo list`,items:m}:h.length>0?x={kind:`citations`,citations:h}:g?x={kind:`image`,url:g}:p&&(i.includes(`edit`)||i.includes(`write`)||i.includes(`patch`))?x={kind:`diff`,file:au(a,s),lines:ou(p),copyText:p}:(l||y||_||f.length>0)&&(x={kind:`output`,content:v,language:pu(r,s.structured),structured:s.structured,sections:eu(s,o),sourceCode:l,sourceLanguage:u,sourceLabel:hu(r,u)}),{id:b,name:r,lowerName:i,status:c,input:a,output:o,outputSummary:s,command:l,metadata:f,approval:_,detail:x}}function _u(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 vu(e,t){return t.toLowerCase().includes(`bash`)||t.toLowerCase().includes(`shell`)?(0,I.jsx)(me,{"aria-hidden":`true`,className:`size-4`}):e===`success`?(0,I.jsx)(A,{"aria-hidden":`true`,className:`size-4`}):(0,I.jsx)(he,{"aria-hidden":`true`,className:`size-4`})}function yu({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,I.jsx)(ql,{tool:t,title:`Fleet Prime permission`,description:`This tool reported a permission decision from Fleet Prime.`,parameters:i,status:r})}function bu({code:e,language:t,languageLabel:n,status:r}){return(0,I.jsx)(m,{code:e,language:t,languageLabel:n,status:r===`running`?`streaming`:`complete`,showStatus:!1,maxHeight:160,showLineNumbers:!1,wrap:!0})}var xu=(0,F.memo)(function({part:e,chatStatus:t,fallback:n}){let r=gu(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=_u(i.items),a=!!e.input?.pendingDecision;if(r.lowerName===`planwrite`&&a)return n??null;let o=r.lowerName===`planwrite`&&e.input?.executing?Ul(t):void 0;return o?(0,I.jsx)(Wl,{presentation:o,className:`mb-2`}):(0,I.jsx)(Vl,{items:i.items,title:i.title,defaultOpen:!0,collapseOnComplete:!1,maxHeight:240})}if(i.kind===`citations`)return(0,I.jsx)(C,{citations:i.citations,title:`Sources`,defaultOpen:!0});if(i.kind===`image`)return(0,I.jsx)(Ll,{status:a===`running`?`generating`:a===`error`?`error`:`complete`,children:(0,I.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,I.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,I.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:vu(a,r.name),defaultOpen:a===`running`,collapseOnComplete:!1,maxHeight:240,copyText:o,children:[i.sourceCode?(0,I.jsx)(bu,{code:i.sourceCode,language:i.sourceLanguage??`text`,languageLabel:i.sourceLabel,status:a}):null,i.sections.map(e=>(0,I.jsx)(h,{language:e.language,label:e.label,children:e.content},e.label)),(0,I.jsx)(yu,{approval:r.approval,name:r.name,status:a})]})}),Su=e({FleetPiToolRenderer:()=>Cu}),Cu=(0,F.memo)(function(e){let t=e.part.type;if(t===`tool-Thinking`||t===`tool-FleetReasoning`)return null;let n=(0,I.jsx)(kl,{...e,toolRenderers:b});return t.startsWith(`tool-`)?(0,I.jsx)(xu,{...e,fallback:n}):n});export{Su as n,Cu as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t}from"./bundle-mjs-DKHVkVWu.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{t as r}from"./utils-Eg7xtNmV.js";import{t as i}from"./chevron-down-BEVGmnSb.js";import{n as a,r as o,t as s}from"./collapsible-BoXtZZWN.js";import{n as c,r as l,t as u}from"./surfaces-DI-U-_2a.js";import{r as d}from"./range-BWOHiLNe.js";var f=e(t(),1),p=n(),m={dots:`rounded-full`,squares:`rounded-[1px]`,rounded:`rounded-[3px]`};function h({label:e,tick:t,variant:n=`dots`,className:i,...a}){let o=Math.floor(t/3);return(0,p.jsxs)(`div`,{"data-slot":`generation-loader`,className:r(`flex flex-col items-center gap-4`,i),...a,children:[(0,p.jsx)(`div`,{"aria-hidden":!0,className:`grid grid-cols-3 gap-1`,children:Array.from({length:9},(e,t)=>{let i=(t*2+o)%9<3;return(0,p.jsx)(`span`,{className:r(`bg-foreground size-2 transition-opacity duration-300 motion-reduce:transition-none`,m[n],i?`opacity-90`:`opacity-15`)},t)})}),(0,p.jsx)(u,{className:`text-foreground/55 relative inline-block text-sm`,children:e})]})}function g({label:e,elapsed:t,className:n,...i}){return(0,p.jsxs)(`div`,{"data-slot":`thinking-indicator`,className:r(`text-foreground/55 flex items-center gap-2.5 text-sm`,n),...i,children:[(0,p.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 shrink-0 animate-pulse rounded-full bg-blue-500 motion-reduce:animate-none dark:bg-blue-400`}),(0,p.jsx)(u,{className:`fade-in slide-in-from-bottom-1 animate-in relative inline-block leading-none duration-300`,children:e},e),t!==void 0&&(0,p.jsx)(`span`,{className:r(`font-mono text-[0.6875rem] tracking-tight`,`text-foreground/30 tabular-nums`),children:t})]})}function _({steps:e,visibleSteps:t,streaming:n,streamingLabel:f=`Thinking`,open:m,onOpenChange:h,restingLabel:g,elapsed:_,className:v}){let y=d(e,t);return(0,p.jsxs)(s,{"data-slot":`reasoning-panel`,open:m,onOpenChange:h,className:r(`w-full max-w-sm`,v),children:[(0,p.jsxs)(o,{className:`group/trigger text-foreground/55 hover:text-foreground/90 flex items-center gap-1.5 py-1 text-[0.84375rem] transition-[color,scale] outline-none active:scale-[0.98]`,children:[(0,p.jsxs)(c,{active:+!n,className:`text-start`,children:[(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(u,{active:n,className:`relative inline-block leading-none`,children:f}),_!==void 0&&(0,p.jsx)(`span`,{className:r(`font-mono text-[0.6875rem] tracking-tight`,`text-foreground/30 tabular-nums`),children:_})]}),(0,p.jsx)(p.Fragment,{children:g})]}),(0,p.jsx)(i,{className:`size-3.5 shrink-0 opacity-60 transition-transform duration-200 ease-[cubic-bezier(0.32,0.72,0,1)] group-data-open/trigger:rotate-180 group-data-panel-open/trigger:rotate-180 motion-reduce:transition-none`})]}),(0,p.jsx)(a,{className:r(l,`outline-none`),children:(0,p.jsx)(`ol`,{className:`flex flex-col gap-4 pt-3 pb-1`,children:y.map((e,t)=>{let i=n&&t===y.length-1;return(0,p.jsxs)(`li`,{className:`fade-in slide-in-from-bottom-1 animate-in fill-mode-both flex gap-3 duration-300`,children:[(0,p.jsx)(`span`,{"aria-hidden":!0,className:r(`mt-[7px] size-[5px] shrink-0 rounded-full transition-colors duration-300`,i?`animate-pulse bg-blue-500 dark:bg-blue-400`:`bg-foreground/20`)}),(0,p.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,p.jsx)(`p`,{className:`text-foreground/90 text-[0.84375rem] font-medium`,children:e.title}),(0,p.jsx)(`p`,{className:`text-foreground/50 mt-0.5 text-[0.8125rem] leading-relaxed break-words`,children:e.body})]})]},e.id??`${e.title}-${t}`)})})})]})}function v({presentation:e,className:t,streamingOverride:n}){let[i,a]=(0,f.useState)(void 0),o=n??e.streaming,s=i??o,c=(0,f.useMemo)(()=>e.steps.map(e=>({id:e.id,title:e.title,body:e.body})),[e.steps]);if(!o&&c.length===0)return null;let l=Math.min(Math.max(0,e.visibleSteps),c.length),u=c.at(l-1),d=u?.title??y(e.phase),m=b(e.elapsedMs);return(0,p.jsxs)(`section`,{"data-slot":`fleet-reasoning-presentation`,"aria-label":`Safe reasoning progress`,className:r(`w-full max-w-xl rounded-xl border border-border/60 bg-muted/30 px-3 py-2.5 shadow-sm shadow-black/[0.02] dark:shadow-black/15`,t),children:[o?(0,p.jsx)(`div`,{className:`mb-1.5 flex flex-col gap-1.5 border-b border-border/45 pb-2.5`,children:u?.body?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(g,{label:d,elapsed:m,className:`text-[0.8125rem]`}),(0,p.jsx)(`p`,{className:`pl-4 text-xs font-normal text-muted-foreground`,children:u.body})]}):(0,p.jsx)(h,{label:d,tick:Math.floor((e.elapsedMs??0)/250),variant:`dots`,className:`items-start gap-2 p-1 text-left`})}):null,(0,p.jsx)(_,{steps:c,visibleSteps:l,streaming:o,streamingLabel:`Preparing response`,open:s,onOpenChange:a,restingLabel:e.restingLabel,elapsed:m,className:`max-w-none`})]})}function y(e){switch(e){case`waiting`:return`Preparing run`;case`context`:return`Reviewing workspace context`;case`planning`:return`Organising the response`;case`executing`:return`Completing requested work`;case`responding`:return`Writing the response`;case`recovering`:return`Recovering the run`;case`error`:return`Run needs attention`;case`complete`:return`Completed`;default:return`Working`}}function b(e){if(e===void 0)return;let t=Math.max(0,Math.round(e/1e3));return t<60?String(t)+`s`:String(Math.floor(t/60))+`m `+String(t%60)+`s`}export{v as FleetReasoningPanel};