lattice-orchestrator 2.0.0 → 2.0.1

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.
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-DA-rfuFy.js","assets/html-pp8916En.js","assets/javascript-XPxc2APE.js","assets/css-CLj8gQPS.js","assets/angular-ts-BrjP3tb8.js","assets/scss-D5BDwBP9.js","assets/apl-CORt7UWP.js","assets/xml-DtyAt_xK.js","assets/java-B2AjWfgk.js","assets/json-CjLXzM_z.js","assets/astro-HNnZUWAn.js","assets/typescript-DttGkNCf.js","assets/postcss-BSGhOJ4k.js","assets/tsx-Dio8iE-N.js","assets/blade-BjGOyj-B.js","assets/html-derivative-DlHx6ybY.js","assets/sql-CKXjX23X.js","assets/bsl-C4qeDxuX.js","assets/sdbl-C5Q1usnU.js","assets/cairo-C_mOTUpN.js","assets/python-DgE28U1V.js","assets/cobol-nBiQ_Alo.js","assets/coffee-CSg58a7P.js","assets/cpp-C28rag7_.js","assets/regexp-BW_zLBm-.js","assets/glsl-Bk7TyU8J.js","assets/c-CyUOlKFr.js","assets/crystal-DNxU26gB.js","assets/shellscript-CE-5zpiL.js","assets/edge-FbVlp4U3.js","assets/elixir-CkH2-t6x.js","assets/elm-BX_9EnK8.js","assets/erb-BYCe7drp.js","assets/ruby-Wjq7vjNf.js","assets/haml-D5jkg6IW.js","assets/graphql-By4-2MiP.js","assets/jsx-BGEKFWBk.js","assets/lua-JmSlR1pZ.js","assets/yaml-B92AUxDB.js","assets/erlang-Dh270pQQ.js","assets/markdown-CKXSK5AY.js","assets/fortran-fixed-form-B5hFr6Yn.js","assets/fortran-free-form-BuX3zftO.js","assets/fsharp-B6CigNpP.js","assets/gdresource-ChoLB09i.js","assets/gdshader-MbeiIFWW.js","assets/gdscript-BajwJ0jS.js","assets/git-commit-BicZTByO.js","assets/diff-BlzBhZx2.js","assets/git-rebase-Bzlpfr7M.js","assets/glimmer-js-ByusRIyA.js","assets/glimmer-ts-BfAWNZQY.js","assets/hack-i7_Ulhet.js","assets/handlebars-BpdQsYii.js","assets/http-D0p2QOuJ.js","assets/hurl-CeF7EoTQ.js","assets/csv-AZNL9t8Q.js","assets/hxml-B_SuSTPP.js","assets/haxe-n0Q_eay_.js","assets/jinja-f2NsQr07.js","assets/jison-DRGa8fbr.js","assets/julia-BxjEHQ54.js","assets/r-BcofxrH1.js","assets/just-VxiPbLrw.js","assets/perl-NvoQZIq0.js","assets/latex-C-qBiGC3.js","assets/tex-BLPnQt1V.js","assets/liquid-C0sCDyMI.js","assets/marko-DjSrsDqO.js","assets/less-C76OjOdF.js","assets/mdc-DTYItulj.js","assets/nextflow-C-mBbutL.js","assets/nextflow-groovy-vE_lwT2v.js","assets/nginx-bBKbG2uI.js","assets/nim-BIad80T-.js","assets/php-R6g_5hLQ.js","assets/pug-DKIMFp6K.js","assets/qml-BEkX6VoX.js","assets/razor-BDqjjVU7.js","assets/csharp-DieIJxYJ.js","assets/rst-CRjBmOyv.js","assets/cmake-Cv5ljclQ.js","assets/sas-BZeeyq_z.js","assets/shaderlab-DNkMdb2B.js","assets/hlsl-Pefxhtaj.js","assets/shellsession-BhddCRKA.js","assets/soy-8wufbnw4.js","assets/sparql-CHK3vDkL.js","assets/turtle-whXsfw69.js","assets/stata-BJqnY-gO.js","assets/surrealql-CYeReaNr.js","assets/svelte-Cy7k_4gC.js","assets/templ-DhtptRzy.js","assets/go-C27-OAKa.js","assets/ts-tags-DQrlYJgV.js","assets/twig-xg9kU7Mw.js","assets/vue-D2xRrEX4.js","assets/vue-html-BM4TQ0nH.js","assets/vue-vine-BoDAl6tE.js","assets/stylus-CHekGIgu.js","assets/xsl-Btrj9DhN.js"])))=>i.map(i=>d[i]);
2
- import{r as fe,j as X}from"./vendor-react-xyVz3hOa.js";import{_ as u,I as Je,E as At,R as Wr,T as zr,F as O,d as Xr,e as qr,f as Jr}from"./main-C1x7RHJx.js";import{t as Qr}from"./vendor-markdown-vZ7invOV.js";import"./vendor-radix-BmcW-0BY.js";function ie(e){if([...e].length!==1)throw new Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function Zr(e,t,r){return e.has(t)||e.set(t,r),e.get(t)}const ot=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),P=String.raw;function oe(e,t){if(e==null)throw new Error(t??"Value expected");return e}const Zt=P`\[\^?`,Kt=`c.? | C(?:-.?)?|${P`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${P`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${P`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${P`o\{[^\}]*\}?`}|${P`\d{1,3}`}`,at=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,me=new RegExp(P`
2
+ import{r as fe,j as X}from"./vendor-react-xyVz3hOa.js";import{_ as u,I as Je,E as At,R as Wr,T as zr,F as O,d as Xr,e as qr,f as Jr}from"./main-BscBU2VN.js";import{t as Qr}from"./vendor-markdown-vZ7invOV.js";import"./vendor-radix-BmcW-0BY.js";function ie(e){if([...e].length!==1)throw new Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function Zr(e,t,r){return e.has(t)||e.set(t,r),e.get(t)}const ot=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),P=String.raw;function oe(e,t){if(e==null)throw new Error(t??"Value expected");return e}const Zt=P`\[\^?`,Kt=`c.? | C(?:-.?)?|${P`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${P`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${P`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${P`o\{[^\}]*\}?`}|${P`\d{1,3}`}`,at=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,me=new RegExp(P`
3
3
  \\ (?:
4
4
  ${Kt}
5
5
  | [gk]<[^>]*>?
@@ -1,3 +1,3 @@
1
- import{r as s,j as e}from"./vendor-react-xyVz3hOa.js";import{u as f,c as w,M as _,a as k,b as n,t as r}from"./main-C1x7RHJx.js";import"./vendor-radix-BmcW-0BY.js";import"./vendor-markdown-vZ7invOV.js";const i=12,v=({code:o,language:l,showLineNumbers:j=!1,className:u=""})=>{const d=f()==="dark"?"github-dark-default":"github-light-default",[t,b]=s.useState(!1),[c,p]=s.useState(null),h=s.useMemo(()=>o.trimEnd().split(`
1
+ import{r as s,j as e}from"./vendor-react-xyVz3hOa.js";import{u as f,c as w,M as _,a as k,b as n,t as r}from"./main-BscBU2VN.js";import"./vendor-radix-BmcW-0BY.js";import"./vendor-markdown-vZ7invOV.js";const i=12,v=({code:o,language:l,showLineNumbers:j=!1,className:u=""})=>{const d=f()==="dark"?"github-dark-default":"github-light-default",[t,b]=s.useState(!1),[c,p]=s.useState(null),h=s.useMemo(()=>o.trimEnd().split(`
2
2
  `),[o]),x=h.length,m=x>i,a=t?o.trimEnd():h.slice(0,i).join(`
3
3
  `),g=x-i;return s.useEffect(()=>{w(a,{lang:l,theme:d}).then(p).catch(()=>p(null))},[a,l,d]),e.jsxs("div",{className:n("relative overflow-hidden",r.codeBg,u),children:[m&&e.jsx("button",{onClick:()=>b(!t),className:n("absolute top-2 right-2 z-10 w-6 h-6 flex items-center justify-center rounded transition-colors cursor-pointer","text-stone-400 hover:text-stone-600 bg-stone-100/80","dark:text-zinc-600 dark:hover:text-zinc-400 dark:bg-zinc-900/80"),"aria-label":t?"Show fewer lines":"Show all lines",children:t?e.jsx(_,{size:12}):e.jsx(k,{size:12})}),c?e.jsx("div",{className:"[&_pre]:!bg-transparent [&_pre]:px-3 [&_pre]:py-2.5 [&_pre]:text-[13px] [&_pre]:leading-relaxed [&_pre]:whitespace-pre-wrap [&_pre]:break-words [&_code]:!bg-transparent",dangerouslySetInnerHTML:{__html:c}}):e.jsx("pre",{className:n("px-3 py-2.5 text-[13px] whitespace-pre-wrap break-words leading-relaxed font-mono m-0",r.text.secondary),children:a}),!t&&m&&e.jsxs("div",{className:n("text-center text-[13px] py-1.5",r.separator,"border-t",r.text.faint,"bg-stone-50/80 dark:bg-zinc-950/80"),children:["+",g," more lines"]})]})};export{v as CodeHighlight};
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-CU67Zn6k.js","assets/html-GMplVEZG.js","assets/javascript-wDzz0qaB.js","assets/css-DPfMkruS.js","assets/angular-ts-BwZT4LLn.js","assets/scss-OYdSNvt2.js","assets/apl-dKokRX4l.js","assets/xml-sdJ4AIDG.js","assets/java-CylS5w8V.js","assets/json-Cp-IABpG.js","assets/astro-CbQHKStN.js","assets/typescript-BPQ3VLAy.js","assets/postcss-CXtECtnM.js","assets/tsx-COt5Ahok.js","assets/blade-D4QpJJKB.js","assets/html-derivative-BFtXZ54Q.js","assets/sql-BLtJtn59.js","assets/bsl-BO_Y6i37.js","assets/sdbl-DVxCFoDh.js","assets/cairo-KRGpt6FW.js","assets/python-B6aJPvgy.js","assets/cobol-nwyudZeR.js","assets/coffee-Ch7k5sss.js","assets/cpp-CofmeUqb.js","assets/regexp-CDVJQ6XC.js","assets/glsl-DplSGwfg.js","assets/c-BIGW1oBm.js","assets/crystal-tKQVLTB8.js","assets/shellscript-Yzrsuije.js","assets/edge-BkV0erSs.js","assets/elixir-CDX3lj18.js","assets/elm-DbKCFpqz.js","assets/erb-B12qg9BL.js","assets/ruby-Dw2BHqvy.js","assets/haml-B8DHNrY2.js","assets/graphql-ChdNCCLP.js","assets/jsx-g9-lgVsj.js","assets/lua-BaeVxFsk.js","assets/yaml-Buea-lGh.js","assets/erlang-DsQrWhSR.js","assets/markdown-Cvjx9yec.js","assets/fortran-fixed-form-CkoXwp7k.js","assets/fortran-free-form-BxgE0vQu.js","assets/fsharp-CXgrBDvD.js","assets/gdresource-BOOCDP_w.js","assets/gdshader-DkwncUOv.js","assets/gdscript-C5YyOfLZ.js","assets/git-commit-F4YmCXRG.js","assets/diff-D97Zzqfu.js","assets/git-rebase-r7XF79zn.js","assets/glimmer-js-Rg0-pVw9.js","assets/glimmer-ts-U6CK756n.js","assets/hack-CaT9iCJl.js","assets/handlebars-BL8al0AC.js","assets/http-jrhK8wxY.js","assets/hurl-irOxFIW8.js","assets/csv-fuZLfV_i.js","assets/hxml-Bvhsp5Yf.js","assets/haxe-CzTSHFRz.js","assets/jinja-4LBKfQ-Z.js","assets/jison-wvAkD_A8.js","assets/julia-CxzCAyBv.js","assets/r-Dspwwk_N.js","assets/just-Cw27pwNe.js","assets/perl-C0TMdlhV.js","assets/latex-CWtU0Tv5.js","assets/tex-idrVyKtj.js","assets/liquid-DYVedYrR.js","assets/marko-CnJfTvn9.js","assets/less-B1dDrJ26.js","assets/mdc-BMNejdWA.js","assets/nextflow-Zz6hmt5N.js","assets/nextflow-groovy-BeH2EWoN.js","assets/nginx-BpAMiNFr.js","assets/nim-CVrawwO9.js","assets/php-Dhbhpdrm.js","assets/pug-CGlum2m_.js","assets/qml-3beO22l8.js","assets/razor-Uh8Bk_45.js","assets/csharp-COcwbKMJ.js","assets/rst-BrH8l1NY.js","assets/cmake-D1j8_8rp.js","assets/sas-cz2c8ADy.js","assets/shaderlab-Dg9Lc6iA.js","assets/hlsl-D3lLCCz7.js","assets/shellsession-BADoaaVG.js","assets/soy-Brmx7dQM.js","assets/sparql-rVzFXLq3.js","assets/turtle-BsS91CYL.js","assets/stata-BH5u7GGu.js","assets/surrealql-Bq5Q-fJD.js","assets/svelte-C_ipcX3V.js","assets/templ-P3uqSqPl.js","assets/go-CxLEBnE3.js","assets/ts-tags-zn1MmPIZ.js","assets/twig-DNn4PbVi.js","assets/vue-DN_0RTcg.js","assets/vue-html-AaS7Mt5G.js","assets/vue-vine-CQOfvN7w.js","assets/stylus-BEDo0Tqx.js","assets/xsl-CtQFsRM5.js","assets/CodeHighlight-0NzQZdJv.js","assets/vendor-react-xyVz3hOa.js","assets/vendor-radix-BmcW-0BY.js","assets/vendor-markdown-vZ7invOV.js","assets/CodeHighlight-QDb33RjI.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-CU67Zn6k.js","assets/html-GMplVEZG.js","assets/javascript-wDzz0qaB.js","assets/css-DPfMkruS.js","assets/angular-ts-BwZT4LLn.js","assets/scss-OYdSNvt2.js","assets/apl-dKokRX4l.js","assets/xml-sdJ4AIDG.js","assets/java-CylS5w8V.js","assets/json-Cp-IABpG.js","assets/astro-CbQHKStN.js","assets/typescript-BPQ3VLAy.js","assets/postcss-CXtECtnM.js","assets/tsx-COt5Ahok.js","assets/blade-D4QpJJKB.js","assets/html-derivative-BFtXZ54Q.js","assets/sql-BLtJtn59.js","assets/bsl-BO_Y6i37.js","assets/sdbl-DVxCFoDh.js","assets/cairo-KRGpt6FW.js","assets/python-B6aJPvgy.js","assets/cobol-nwyudZeR.js","assets/coffee-Ch7k5sss.js","assets/cpp-CofmeUqb.js","assets/regexp-CDVJQ6XC.js","assets/glsl-DplSGwfg.js","assets/c-BIGW1oBm.js","assets/crystal-tKQVLTB8.js","assets/shellscript-Yzrsuije.js","assets/edge-BkV0erSs.js","assets/elixir-CDX3lj18.js","assets/elm-DbKCFpqz.js","assets/erb-B12qg9BL.js","assets/ruby-Dw2BHqvy.js","assets/haml-B8DHNrY2.js","assets/graphql-ChdNCCLP.js","assets/jsx-g9-lgVsj.js","assets/lua-BaeVxFsk.js","assets/yaml-Buea-lGh.js","assets/erlang-DsQrWhSR.js","assets/markdown-Cvjx9yec.js","assets/fortran-fixed-form-CkoXwp7k.js","assets/fortran-free-form-BxgE0vQu.js","assets/fsharp-CXgrBDvD.js","assets/gdresource-BOOCDP_w.js","assets/gdshader-DkwncUOv.js","assets/gdscript-C5YyOfLZ.js","assets/git-commit-F4YmCXRG.js","assets/diff-D97Zzqfu.js","assets/git-rebase-r7XF79zn.js","assets/glimmer-js-Rg0-pVw9.js","assets/glimmer-ts-U6CK756n.js","assets/hack-CaT9iCJl.js","assets/handlebars-BL8al0AC.js","assets/http-jrhK8wxY.js","assets/hurl-irOxFIW8.js","assets/csv-fuZLfV_i.js","assets/hxml-Bvhsp5Yf.js","assets/haxe-CzTSHFRz.js","assets/jinja-4LBKfQ-Z.js","assets/jison-wvAkD_A8.js","assets/julia-CxzCAyBv.js","assets/r-Dspwwk_N.js","assets/just-Cw27pwNe.js","assets/perl-C0TMdlhV.js","assets/latex-CWtU0Tv5.js","assets/tex-idrVyKtj.js","assets/liquid-DYVedYrR.js","assets/marko-CnJfTvn9.js","assets/less-B1dDrJ26.js","assets/mdc-BMNejdWA.js","assets/nextflow-Zz6hmt5N.js","assets/nextflow-groovy-BeH2EWoN.js","assets/nginx-BpAMiNFr.js","assets/nim-CVrawwO9.js","assets/php-Dhbhpdrm.js","assets/pug-CGlum2m_.js","assets/qml-3beO22l8.js","assets/razor-Uh8Bk_45.js","assets/csharp-COcwbKMJ.js","assets/rst-BrH8l1NY.js","assets/cmake-D1j8_8rp.js","assets/sas-cz2c8ADy.js","assets/shaderlab-Dg9Lc6iA.js","assets/hlsl-D3lLCCz7.js","assets/shellsession-BADoaaVG.js","assets/soy-Brmx7dQM.js","assets/sparql-rVzFXLq3.js","assets/turtle-BsS91CYL.js","assets/stata-BH5u7GGu.js","assets/surrealql-Bq5Q-fJD.js","assets/svelte-C_ipcX3V.js","assets/templ-P3uqSqPl.js","assets/go-CxLEBnE3.js","assets/ts-tags-zn1MmPIZ.js","assets/twig-DNn4PbVi.js","assets/vue-DN_0RTcg.js","assets/vue-html-AaS7Mt5G.js","assets/vue-vine-CQOfvN7w.js","assets/stylus-BEDo0Tqx.js","assets/xsl-CtQFsRM5.js","assets/CodeHighlight-dzF_1m2m.js","assets/vendor-react-xyVz3hOa.js","assets/vendor-radix-BmcW-0BY.js","assets/vendor-markdown-vZ7invOV.js","assets/CodeHighlight-CrO5apPc.js"])))=>i.map(i=>d[i]);
2
2
  import{j as s,r as d,b as Ce,c as Im,u as Am,o as Rm,s as Pm,f as Mm,d as Lm,e as Om,h as Dm,i as $m,l as zm,k as dn,m as Ct,n as xa,p as St,q as Dl,t as $l,L as un,Q as Fm,v as Vm,w as zl,x as bt,N as Bm,B as Um,y as Gm}from"./vendor-react-xyVz3hOa.js";import{S as Hm,R as qm,C as Wm,a as Km,u as dt,P as tt,c as Ge,d as Qm,b as qn,e as ls,f as ur,g as Fl,h as Ym,i as ba,j as Ws,k as Jm}from"./vendor-radix-BmcW-0BY.js";import{t as Xm,M as rs,r as Ns,a as Eo}from"./vendor-markdown-vZ7invOV.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const i of a.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(o){if(o.ep)return;o.ep=!0;const a=n(o);fetch(o.href,a)}})();function kn({children:t}){return s.jsx("div",{className:"flex flex-col w-full h-full overflow-hidden bg-background relative",children:s.jsx("main",{className:"flex-1 flex flex-col overflow-hidden h-full min-h-0",children:t})})}const Zm=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),eh=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase()),gi=t=>{const e=eh(t);return e.charAt(0).toUpperCase()+e.slice(1)},Vl=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim(),th=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};var sh={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const nh=d.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:a,iconNode:i,...l},c)=>d.createElement("svg",{ref:c,...sh,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:Vl("lucide",o),...!a&&!th(l)&&{"aria-hidden":"true"},...l},[...i.map(([u,p])=>d.createElement(u,p)),...Array.isArray(a)?a:[a]]));const Q=(t,e)=>{const n=d.forwardRef(({className:r,...o},a)=>d.createElement(nh,{ref:a,iconNode:e,className:Vl(`lucide-${Zm(gi(t))}`,`lucide-${t}`,r),...o}));return n.displayName=gi(t),n};const rh=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],Xs=Q("archive",rh);const oh=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],ah=Q("arrow-down",oh);const ih=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Bl=Q("arrow-left",ih);const ch=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],lh=Q("arrow-right",ch);const dh=[["path",{d:"M4.5 3h15",key:"c7n0jr"}],["path",{d:"M6 3v16a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V3",key:"m1uhx7"}],["path",{d:"M6 14h12",key:"4cwo0f"}]],To=Q("beaker",dh);const uh=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742",key:"178tsu"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05",key:"1hqiys"}]],xi=Q("bell-off",uh);const ph=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],Gr=Q("bell",ph);const mh=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],hh=Q("bot",mh);const fh=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],gh=Q("box",fh);const xh=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],bh=Q("brain",xh);const yh=[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]],Ul=Q("bug",yh);const vh=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Pe=Q("check",vh);const wh=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ot=Q("chevron-down",wh);const _h=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Gt=Q("chevron-right",_h);const kh=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],jh=Q("chevron-up",kh);const Nh=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Cs=Q("circle-alert",Nh);const Ch=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]],Sh=Q("circle-arrow-up",Ch);const Eh=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Vn=Q("circle-check",Eh);const Th=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],bi=Q("circle-x",Th);const Ih=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Hr=Q("circle",Ih);const Ah=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"m9 14 2 2 4-4",key:"df797q"}]],Rh=Q("clipboard-check",Ah);const Ph=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Mh=Q("clock",Ph);const Lh=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],Io=Q("code",Lh);const Oh=[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Dh=Q("compass",Oh);const $h=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Bt=Q("copy",$h);const zh=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]],Fh=Q("crosshair",zh);const Vh=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],Ao=Q("download",Vh);const Bh=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],os=Q("external-link",Bh);const Uh=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],yi=Q("eye-off",Uh);const Gh=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Ro=Q("eye",Gh);const Hh=[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]],qh=Q("file-code",Hh);const Wh=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Po=Q("file-text",Wh);const Kh=[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]],Gl=Q("flask-conical",Kh);const Qh=[["rect",{width:"8",height:"5",x:"14",y:"17",rx:"1",key:"19aais"}],["path",{d:"M10 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 2v2.5",key:"1w6v7t"}],["path",{d:"M20 17v-2a2 2 0 1 0-4 0v2",key:"pwaxnr"}]],Yh=Q("folder-lock",Qh);const Jh=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],Xh=Q("gauge",Jh);const Zh=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],ya=Q("git-branch",Zh);const ef=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],tf=Q("git-commit-horizontal",ef);const sf=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],nf=Q("globe",sf);const rf=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],of=Q("image",rf);const af=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m8 11 4 4 4-4",key:"1dohi6"}],["path",{d:"M8 5H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-4",key:"1ywtjm"}]],Wn=Q("import",af);const cf=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],lf=Q("info",cf);const df=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],uf=Q("key-round",df);const pf=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],Hl=Q("layers",pf);const mf=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],vi=Q("layout-dashboard",mf);const hf=[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]],ff=Q("list-checks",hf);const gf=[["rect",{x:"3",y:"5",width:"6",height:"6",rx:"1",key:"1defrl"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]],Ks=Q("list-todo",gf);const xf=[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]],bf=Q("list",xf);const yf=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Ee=Q("loader-circle",yf);const vf=[["line",{x1:"2",x2:"5",y1:"12",y2:"12",key:"bvdh0s"}],["line",{x1:"19",x2:"22",y1:"12",y2:"12",key:"1tbv5k"}],["line",{x1:"12",x2:"12",y1:"2",y2:"5",key:"11lu5j"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}],["circle",{cx:"12",cy:"12",r:"7",key:"fim9np"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],wf=Q("locate-fixed",vf);const _f=[["path",{d:"m10 17 5-5-5-5",key:"1bsop3"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}]],wi=Q("log-in",_f);const kf=[["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"}]],_i=Q("log-out",kf);const jf=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],Nf=Q("maximize-2",jf);const Cf=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],Sf=Q("menu",Cf);const Ef=[["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"}]],Tf=Q("message-circle",Ef);const If=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],as=Q("message-square",If);const Af=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],Rf=Q("minimize-2",Af);const Pf=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],Mf=Q("monitor",Pf);const Lf=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],Of=Q("network",Lf);const Df=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]],$f=Q("panel-left-close",Df);const zf=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],ql=Q("panel-left",zf);const Ff=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]],qr=Q("panel-right-close",Ff);const Vf=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m10 15-3-3 3-3",key:"1pgupc"}]],Wr=Q("panel-right-open",Vf);const Bf=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],ki=Q("pause",Bf);const Uf=[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],Gf=Q("pencil-line",Uf);const Hf=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],va=Q("pencil",Hf);const qf=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],Ht=Q("play",qf);const Wf=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Wl=Q("plus",Wf);const Kf=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],ds=Q("refresh-cw",Kf);const Qf=[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]],Yf=Q("rocket",Qf);const Jf=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],wa=Q("rotate-ccw",Jf);const Xf=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Kl=Q("search",Xf);const Zf=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],ji=Q("send",Zf);const e0=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Mo=Q("settings",e0);const t0=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],Ql=Q("shield-alert",t0);const s0=[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71",key:"1jlk70"}],["path",{d:"M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264",key:"18rp1v"}]],pr=Q("shield-off",s0);const n0=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],Rs=Q("shield",n0);const r0=[["path",{d:"m12.5 17-.5-1-.5 1h1z",key:"3me087"}],["path",{d:"M15 22a1 1 0 0 0 1-1v-1a2 2 0 0 0 1.56-3.25 8 8 0 1 0-11.12 0A2 2 0 0 0 8 20v1a1 1 0 0 0 1 1z",key:"1o5pge"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}]],o0=Q("skull",r0);const a0=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],_a=Q("sparkles",a0);const i0=[["path",{d:"M16 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8Z",key:"qazsjp"}],["path",{d:"M15 3v4a2 2 0 0 0 2 2h4",key:"40519r"}]],c0=Q("sticky-note",i0);const l0=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],d0=Q("terminal",l0);const u0=[["path",{d:"M14.5 2v17.5c0 1.4-1.1 2.5-2.5 2.5c-1.4 0-2.5-1.1-2.5-2.5V2",key:"125lnx"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M14.5 16h-5",key:"1ox875"}]],p0=Q("test-tube",u0);const m0=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Lo=Q("trash-2",m0);const h0=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],jt=Q("triangle-alert",h0);const f0=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],Yl=Q("user",f0);const g0=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],x0=Q("users",g0);const b0=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],ka=Q("wrench",b0);const y0=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Fe=Q("x",y0);const v0=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],ja=Q("zap",v0);function Jl(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var o=t.length;for(e=0;e<o;e++)t[e]&&(n=Jl(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function Na(){for(var t,e,n=0,r="",o=arguments.length;n<o;n++)(t=arguments[n])&&(e=Jl(t))&&(r&&(r+=" "),r+=e);return r}const Ni=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,Ci=Na,w0=(t,e)=>n=>{var r;if(e?.variants==null)return Ci(t,n?.class,n?.className);const{variants:o,defaultVariants:a}=e,i=Object.keys(o).map(u=>{const p=n?.[u],m=a?.[u];if(p===null)return null;const h=Ni(p)||Ni(m);return o[u][h]}),l=n&&Object.entries(n).reduce((u,p)=>{let[m,h]=p;return h===void 0||(u[m]=h),u},{}),c=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((u,p)=>{let{class:m,className:h,...g}=p;return Object.entries(g).every(f=>{let[x,b]=f;return Array.isArray(b)?b.includes({...a,...l}[x]):{...a,...l}[x]===b})?[...u,m,h]:u},[]);return Ci(t,i,c,n?.class,n?.className)},_0=(t,e)=>{const n=new Array(t.length+e.length);for(let r=0;r<t.length;r++)n[r]=t[r];for(let r=0;r<e.length;r++)n[t.length+r]=e[r];return n},k0=(t,e)=>({classGroupId:t,validator:e}),Xl=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),Kn="-",Si=[],j0="arbitrary..",N0=t=>{const e=S0(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return C0(i);const l=i.split(Kn),c=l[0]===""&&l.length>1?1:0;return Zl(l,c,e)},getConflictingClassGroupIds:(i,l)=>{if(l){const c=r[i],u=n[i];return c?u?_0(u,c):c:u||Si}return n[i]||Si}}},Zl=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const o=t[e],a=n.nextPart.get(o);if(a){const u=Zl(t,e+1,a);if(u)return u}const i=n.validators;if(i===null)return;const l=e===0?t.join(Kn):t.slice(e).join(Kn),c=i.length;for(let u=0;u<c;u++){const p=i[u];if(p.validator(l))return p.classGroupId}},C0=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),r=e.slice(0,n);return r?j0+r:void 0})(),S0=t=>{const{theme:e,classGroups:n}=t;return E0(n,e)},E0=(t,e)=>{const n=Xl();for(const r in t){const o=t[r];Ca(o,n,r,e)}return n},Ca=(t,e,n,r)=>{const o=t.length;for(let a=0;a<o;a++){const i=t[a];T0(i,e,n,r)}},T0=(t,e,n,r)=>{if(typeof t=="string"){I0(t,e,n);return}if(typeof t=="function"){A0(t,e,n,r);return}R0(t,e,n,r)},I0=(t,e,n)=>{const r=t===""?e:ed(e,t);r.classGroupId=n},A0=(t,e,n,r)=>{if(P0(t)){Ca(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(k0(n,t))},R0=(t,e,n,r)=>{const o=Object.entries(t),a=o.length;for(let i=0;i<a;i++){const[l,c]=o[i];Ca(c,ed(e,l),n,r)}},ed=(t,e)=>{let n=t;const r=e.split(Kn),o=r.length;for(let a=0;a<o;a++){const i=r[a];let l=n.nextPart.get(i);l||(l=Xl(),n.nextPart.set(i,l)),n=l}return n},P0=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,M0=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),r=Object.create(null);const o=(a,i)=>{n[a]=i,e++,e>t&&(e=0,r=n,n=Object.create(null))};return{get(a){let i=n[a];if(i!==void 0)return i;if((i=r[a])!==void 0)return o(a,i),i},set(a,i){a in n?n[a]=i:o(a,i)}}},Oo="!",Ei=":",L0=[],Ti=(t,e,n,r,o)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),O0=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=o=>{const a=[];let i=0,l=0,c=0,u;const p=o.length;for(let x=0;x<p;x++){const b=o[x];if(i===0&&l===0){if(b===Ei){a.push(o.slice(c,x)),c=x+1;continue}if(b==="/"){u=x;continue}}b==="["?i++:b==="]"?i--:b==="("?l++:b===")"&&l--}const m=a.length===0?o:o.slice(c);let h=m,g=!1;m.endsWith(Oo)?(h=m.slice(0,-1),g=!0):m.startsWith(Oo)&&(h=m.slice(1),g=!0);const f=u&&u>c?u-c:void 0;return Ti(a,g,h,f)};if(e){const o=e+Ei,a=r;r=i=>i.startsWith(o)?a(i.slice(o.length)):Ti(L0,!1,i,void 0,!0)}if(n){const o=r;r=a=>n({className:a,parseClassName:o})}return r},D0=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,r)=>{e.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let a=0;a<n.length;a++){const i=n[a],l=i[0]==="[",c=e.has(i);l||c?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(i)):o.push(i)}return o.length>0&&(o.sort(),r.push(...o)),r}},$0=t=>({cache:M0(t.cacheSize),parseClassName:O0(t),sortModifiers:D0(t),...N0(t)}),z0=/\s+/,F0=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:a}=e,i=[],l=t.trim().split(z0);let c="";for(let u=l.length-1;u>=0;u-=1){const p=l[u],{isExternal:m,modifiers:h,hasImportantModifier:g,baseClassName:f,maybePostfixModifierPosition:x}=n(p);if(m){c=p+(c.length>0?" "+c:c);continue}let b=!!x,y=r(b?f.substring(0,x):f);if(!y){if(!b){c=p+(c.length>0?" "+c:c);continue}if(y=r(f),!y){c=p+(c.length>0?" "+c:c);continue}b=!1}const v=h.length===0?"":h.length===1?h[0]:a(h).join(":"),w=g?v+Oo:v,N=w+y;if(i.indexOf(N)>-1)continue;i.push(N);const C=o(y,b);for(let T=0;T<C.length;++T){const S=C[T];i.push(w+S)}c=p+(c.length>0?" "+c:c)}return c},V0=(...t)=>{let e=0,n,r,o="";for(;e<t.length;)(n=t[e++])&&(r=td(n))&&(o&&(o+=" "),o+=r);return o},td=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=td(t[r]))&&(n&&(n+=" "),n+=e);return n},B0=(t,...e)=>{let n,r,o,a;const i=c=>{const u=e.reduce((p,m)=>m(p),t());return n=$0(u),r=n.cache.get,o=n.cache.set,a=l,l(c)},l=c=>{const u=r(c);if(u)return u;const p=F0(c,n);return o(c,p),p};return a=i,(...c)=>a(V0(...c))},U0=[],Be=t=>{const e=n=>n[t]||U0;return e.isThemeGetter=!0,e},sd=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,nd=/^\((?:(\w[\w-]*):)?(.+)\)$/i,G0=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,H0=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,q0=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,W0=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,K0=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Q0=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,$t=t=>G0.test(t),ke=t=>!!t&&!Number.isNaN(Number(t)),zt=t=>!!t&&Number.isInteger(Number(t)),Kr=t=>t.endsWith("%")&&ke(t.slice(0,-1)),At=t=>H0.test(t),rd=()=>!0,Y0=t=>q0.test(t)&&!W0.test(t),Sa=()=>!1,J0=t=>K0.test(t),X0=t=>Q0.test(t),Z0=t=>!ie(t)&&!de(t),eg=t=>qt(t,id,Sa),ie=t=>sd.test(t),Xt=t=>qt(t,cd,Y0),Ii=t=>qt(t,cg,ke),tg=t=>qt(t,dd,rd),sg=t=>qt(t,ld,Sa),Ai=t=>qt(t,od,Sa),ng=t=>qt(t,ad,X0),jn=t=>qt(t,ud,J0),de=t=>nd.test(t),Fs=t=>us(t,cd),rg=t=>us(t,ld),Ri=t=>us(t,od),og=t=>us(t,id),ag=t=>us(t,ad),Nn=t=>us(t,ud,!0),ig=t=>us(t,dd,!0),qt=(t,e,n)=>{const r=sd.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},us=(t,e,n=!1)=>{const r=nd.exec(t);return r?r[1]?e(r[1]):n:!1},od=t=>t==="position"||t==="percentage",ad=t=>t==="image"||t==="url",id=t=>t==="length"||t==="size"||t==="bg-size",cd=t=>t==="length",cg=t=>t==="number",ld=t=>t==="family-name",dd=t=>t==="number"||t==="weight",ud=t=>t==="shadow",lg=()=>{const t=Be("color"),e=Be("font"),n=Be("text"),r=Be("font-weight"),o=Be("tracking"),a=Be("leading"),i=Be("breakpoint"),l=Be("container"),c=Be("spacing"),u=Be("radius"),p=Be("shadow"),m=Be("inset-shadow"),h=Be("text-shadow"),g=Be("drop-shadow"),f=Be("blur"),x=Be("perspective"),b=Be("aspect"),y=Be("ease"),v=Be("animate"),w=()=>["auto","avoid","all","avoid-page","page","left","right","column"],N=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],C=()=>[...N(),de,ie],T=()=>["auto","hidden","clip","visible","scroll"],S=()=>["auto","contain","none"],j=()=>[de,ie,c],E=()=>[$t,"full","auto",...j()],R=()=>[zt,"none","subgrid",de,ie],D=()=>["auto",{span:["full",zt,de,ie]},zt,de,ie],$=()=>[zt,"auto",de,ie],ne=()=>["auto","min","max","fr",de,ie],oe=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],V=()=>["start","end","center","stretch","center-safe","end-safe"],X=()=>["auto",...j()],H=()=>[$t,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],W=()=>[$t,"screen","full","dvw","lvw","svw","min","max","fit",...j()],fe=()=>[$t,"screen","full","lh","dvh","lvh","svh","min","max","fit",...j()],L=()=>[t,de,ie],G=()=>[...N(),Ri,Ai,{position:[de,ie]}],Z=()=>["no-repeat",{repeat:["","x","y","space","round"]}],F=()=>["auto","cover","contain",og,eg,{size:[de,ie]}],se=()=>[Kr,Fs,Xt],te=()=>["","none","full",u,de,ie],ee=()=>["",ke,Fs,Xt],pe=()=>["solid","dashed","dotted","double"],_e=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],A=()=>[ke,Kr,Ri,Ai],M=()=>["","none",f,de,ie],he=()=>["none",ke,de,ie],Y=()=>["none",ke,de,ie],B=()=>[ke,de,ie],ye=()=>[$t,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[At],breakpoint:[At],color:[rd],container:[At],"drop-shadow":[At],ease:["in","out","in-out"],font:[Z0],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[At],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[At],shadow:[At],spacing:["px",ke],text:[At],"text-shadow":[At],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",$t,ie,de,b]}],container:["container"],columns:[{columns:[ke,ie,de,l]}],"break-after":[{"break-after":w()}],"break-before":[{"break-before":w()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:C()}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:S()}],"overscroll-x":[{"overscroll-x":S()}],"overscroll-y":[{"overscroll-y":S()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:E()}],"inset-x":[{"inset-x":E()}],"inset-y":[{"inset-y":E()}],start:[{"inset-s":E(),start:E()}],end:[{"inset-e":E(),end:E()}],"inset-bs":[{"inset-bs":E()}],"inset-be":[{"inset-be":E()}],top:[{top:E()}],right:[{right:E()}],bottom:[{bottom:E()}],left:[{left:E()}],visibility:["visible","invisible","collapse"],z:[{z:[zt,"auto",de,ie]}],basis:[{basis:[$t,"full","auto",l,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ke,$t,"auto","initial","none",ie]}],grow:[{grow:["",ke,de,ie]}],shrink:[{shrink:["",ke,de,ie]}],order:[{order:[zt,"first","last","none",de,ie]}],"grid-cols":[{"grid-cols":R()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":R()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ne()}],"auto-rows":[{"auto-rows":ne()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...oe(),"normal"]}],"justify-items":[{"justify-items":[...V(),"normal"]}],"justify-self":[{"justify-self":["auto",...V()]}],"align-content":[{content:["normal",...oe()]}],"align-items":[{items:[...V(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...V(),{baseline:["","last"]}]}],"place-content":[{"place-content":oe()}],"place-items":[{"place-items":[...V(),"baseline"]}],"place-self":[{"place-self":["auto",...V()]}],p:[{p:j()}],px:[{px:j()}],py:[{py:j()}],ps:[{ps:j()}],pe:[{pe:j()}],pbs:[{pbs:j()}],pbe:[{pbe:j()}],pt:[{pt:j()}],pr:[{pr:j()}],pb:[{pb:j()}],pl:[{pl:j()}],m:[{m:X()}],mx:[{mx:X()}],my:[{my:X()}],ms:[{ms:X()}],me:[{me:X()}],mbs:[{mbs:X()}],mbe:[{mbe:X()}],mt:[{mt:X()}],mr:[{mr:X()}],mb:[{mb:X()}],ml:[{ml:X()}],"space-x":[{"space-x":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:H()}],"inline-size":[{inline:["auto",...W()]}],"min-inline-size":[{"min-inline":["auto",...W()]}],"max-inline-size":[{"max-inline":["none",...W()]}],"block-size":[{block:["auto",...fe()]}],"min-block-size":[{"min-block":["auto",...fe()]}],"max-block-size":[{"max-block":["none",...fe()]}],w:[{w:[l,"screen",...H()]}],"min-w":[{"min-w":[l,"screen","none",...H()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...H()]}],h:[{h:["screen","lh",...H()]}],"min-h":[{"min-h":["screen","lh","none",...H()]}],"max-h":[{"max-h":["screen","lh",...H()]}],"font-size":[{text:["base",n,Fs,Xt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ig,tg]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Kr,ie]}],"font-family":[{font:[rg,sg,e]}],"font-features":[{"font-features":[ie]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,de,ie]}],"line-clamp":[{"line-clamp":[ke,"none",de,Ii]}],leading:[{leading:[a,...j()]}],"list-image":[{"list-image":["none",de,ie]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",de,ie]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...pe(),"wavy"]}],"text-decoration-thickness":[{decoration:[ke,"from-font","auto",de,Xt]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[ke,"auto",de,ie]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",de,ie]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",de,ie]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:G()}],"bg-repeat":[{bg:Z()}],"bg-size":[{bg:F()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},zt,de,ie],radial:["",de,ie],conic:[zt,de,ie]},ag,ng]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:se()}],"gradient-via-pos":[{via:se()}],"gradient-to-pos":[{to:se()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:te()}],"rounded-s":[{"rounded-s":te()}],"rounded-e":[{"rounded-e":te()}],"rounded-t":[{"rounded-t":te()}],"rounded-r":[{"rounded-r":te()}],"rounded-b":[{"rounded-b":te()}],"rounded-l":[{"rounded-l":te()}],"rounded-ss":[{"rounded-ss":te()}],"rounded-se":[{"rounded-se":te()}],"rounded-ee":[{"rounded-ee":te()}],"rounded-es":[{"rounded-es":te()}],"rounded-tl":[{"rounded-tl":te()}],"rounded-tr":[{"rounded-tr":te()}],"rounded-br":[{"rounded-br":te()}],"rounded-bl":[{"rounded-bl":te()}],"border-w":[{border:ee()}],"border-w-x":[{"border-x":ee()}],"border-w-y":[{"border-y":ee()}],"border-w-s":[{"border-s":ee()}],"border-w-e":[{"border-e":ee()}],"border-w-bs":[{"border-bs":ee()}],"border-w-be":[{"border-be":ee()}],"border-w-t":[{"border-t":ee()}],"border-w-r":[{"border-r":ee()}],"border-w-b":[{"border-b":ee()}],"border-w-l":[{"border-l":ee()}],"divide-x":[{"divide-x":ee()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ee()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...pe(),"hidden","none"]}],"divide-style":[{divide:[...pe(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-bs":[{"border-bs":L()}],"border-color-be":[{"border-be":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...pe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ke,de,ie]}],"outline-w":[{outline:["",ke,Fs,Xt]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",p,Nn,jn]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",m,Nn,jn]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:ee()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[ke,Xt]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":ee()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",h,Nn,jn]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[ke,de,ie]}],"mix-blend":[{"mix-blend":[..._e(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":_e()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ke]}],"mask-image-linear-from-pos":[{"mask-linear-from":A()}],"mask-image-linear-to-pos":[{"mask-linear-to":A()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":A()}],"mask-image-t-to-pos":[{"mask-t-to":A()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":A()}],"mask-image-r-to-pos":[{"mask-r-to":A()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":A()}],"mask-image-b-to-pos":[{"mask-b-to":A()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":A()}],"mask-image-l-to-pos":[{"mask-l-to":A()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":A()}],"mask-image-x-to-pos":[{"mask-x-to":A()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":A()}],"mask-image-y-to-pos":[{"mask-y-to":A()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[de,ie]}],"mask-image-radial-from-pos":[{"mask-radial-from":A()}],"mask-image-radial-to-pos":[{"mask-radial-to":A()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":N()}],"mask-image-conic-pos":[{"mask-conic":[ke]}],"mask-image-conic-from-pos":[{"mask-conic-from":A()}],"mask-image-conic-to-pos":[{"mask-conic-to":A()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:G()}],"mask-repeat":[{mask:Z()}],"mask-size":[{mask:F()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",de,ie]}],filter:[{filter:["","none",de,ie]}],blur:[{blur:M()}],brightness:[{brightness:[ke,de,ie]}],contrast:[{contrast:[ke,de,ie]}],"drop-shadow":[{"drop-shadow":["","none",g,Nn,jn]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",ke,de,ie]}],"hue-rotate":[{"hue-rotate":[ke,de,ie]}],invert:[{invert:["",ke,de,ie]}],saturate:[{saturate:[ke,de,ie]}],sepia:[{sepia:["",ke,de,ie]}],"backdrop-filter":[{"backdrop-filter":["","none",de,ie]}],"backdrop-blur":[{"backdrop-blur":M()}],"backdrop-brightness":[{"backdrop-brightness":[ke,de,ie]}],"backdrop-contrast":[{"backdrop-contrast":[ke,de,ie]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ke,de,ie]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ke,de,ie]}],"backdrop-invert":[{"backdrop-invert":["",ke,de,ie]}],"backdrop-opacity":[{"backdrop-opacity":[ke,de,ie]}],"backdrop-saturate":[{"backdrop-saturate":[ke,de,ie]}],"backdrop-sepia":[{"backdrop-sepia":["",ke,de,ie]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":j()}],"border-spacing-x":[{"border-spacing-x":j()}],"border-spacing-y":[{"border-spacing-y":j()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",de,ie]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ke,"initial",de,ie]}],ease:[{ease:["linear","initial",y,de,ie]}],delay:[{delay:[ke,de,ie]}],animate:[{animate:["none",v,de,ie]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[x,de,ie]}],"perspective-origin":[{"perspective-origin":C()}],rotate:[{rotate:he()}],"rotate-x":[{"rotate-x":he()}],"rotate-y":[{"rotate-y":he()}],"rotate-z":[{"rotate-z":he()}],scale:[{scale:Y()}],"scale-x":[{"scale-x":Y()}],"scale-y":[{"scale-y":Y()}],"scale-z":[{"scale-z":Y()}],"scale-3d":["scale-3d"],skew:[{skew:B()}],"skew-x":[{"skew-x":B()}],"skew-y":[{"skew-y":B()}],transform:[{transform:[de,ie,"","none","gpu","cpu"]}],"transform-origin":[{origin:C()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ye()}],"translate-x":[{"translate-x":ye()}],"translate-y":[{"translate-y":ye()}],"translate-z":[{"translate-z":ye()}],"translate-none":["translate-none"],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",de,ie]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mbs":[{"scroll-mbs":j()}],"scroll-mbe":[{"scroll-mbe":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pbs":[{"scroll-pbs":j()}],"scroll-pbe":[{"scroll-pbe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",de,ie]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[ke,Fs,Xt,Ii]}],stroke:[{stroke:["none",...L()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},pd=B0(lg);function Le(...t){return pd(Na(t))}const dg=w0("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 cursor-pointer",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),md=d.forwardRef(({className:t,variant:e,size:n,asChild:r=!1,...o},a)=>{const i=r?Hm:"button";return s.jsx(i,{className:Le(dg({variant:e,size:n,className:t})),ref:a,...o})});md.displayName="Button";function Pi({data:t,collapsed:e=!1,depth:n=0}){const[r,o]=d.useState(!1),a=e||r,[i,l]=d.useState(!1),c=async()=>{try{await navigator.clipboard.writeText(JSON.stringify(t,null,2)),l(!0),setTimeout(()=>l(!1),2e3)}catch(p){console.error("Failed to copy:",p)}},u=(p,m)=>{if(p===null)return s.jsx("span",{className:"text-neutral-500 dark:text-neutral-400",children:"null"});if(p===void 0)return s.jsx("span",{className:"text-neutral-500 dark:text-neutral-400",children:"undefined"});if(typeof p=="boolean")return s.jsx("span",{className:"text-blue-600 dark:text-blue-400",children:p.toString()});if(typeof p=="number")return s.jsx("span",{className:"text-green-600 dark:text-green-400",children:p});if(typeof p=="string")return s.jsxs("span",{className:"text-emerald-700 dark:text-orange-300",children:['"',p,'"']});if(Array.isArray(p))return p.length===0?s.jsx("span",{className:"text-foreground",children:"[]"}):s.jsxs("span",{className:"inline-block",children:[s.jsx("button",{className:"inline-flex items-center justify-center w-4 h-4 mr-0.5 text-neutral-500 hover:text-black dark:text-neutral-400 dark:hover:text-white transition-colors",onClick:()=>o(h=>!h),"aria-label":a?"Expand array":"Collapse array",children:a?s.jsx(Gt,{size:12}):s.jsx(Ot,{size:12})}),s.jsx("span",{className:"text-foreground",children:"["}),a?s.jsxs("span",{className:"text-neutral-500 dark:text-neutral-400 italic mx-1",children:["...",p.length," items"]}):s.jsx("div",{className:"ml-[18px]",children:Object.entries(p).map(([h,g])=>s.jsxs("div",{className:"my-0.5",children:[s.jsxs("span",{className:"text-muted-foreground mr-1",children:[h,":"]}),u(g),Number(h)<p.length-1&&s.jsx("span",{className:"text-foreground",children:","})]},`json-array-item-${h}`))}),s.jsx("span",{className:"text-foreground",children:"]"})]});if(typeof p=="object"){const h=Object.entries(p);return h.length===0?s.jsx("span",{className:"text-foreground",children:"{}"}):s.jsxs("span",{className:"inline-block",children:[s.jsx("button",{className:"inline-flex items-center justify-center w-4 h-4 mr-0.5 text-neutral-500 hover:text-black dark:text-neutral-400 dark:hover:text-white transition-colors",onClick:()=>o(g=>!g),"aria-label":a?"Expand object":"Collapse object",children:a?s.jsx(Gt,{size:12}):s.jsx(Ot,{size:12})}),s.jsx("span",{className:"text-foreground",children:"{"}),a?s.jsxs("span",{className:"text-neutral-500 dark:text-neutral-400 italic mx-1",children:["...",h.length," properties"]}):s.jsx("div",{className:"ml-[18px]",children:h.map(([g,f],x)=>s.jsxs("div",{className:"my-0.5",children:[s.jsxs("span",{className:"text-blue-700 dark:text-blue-300",children:['"',g,'"']}),s.jsx("span",{className:"text-foreground mx-1",children:":"}),u(f),x<h.length-1&&s.jsx("span",{className:"text-foreground",children:","})]},g))}),s.jsx("span",{className:"text-black dark:text-neutral-300",children:"}"})]})}return s.jsx("span",{className:"text-neutral-500 dark:text-neutral-400",children:String(p)})};return s.jsxs("div",{className:"relative font-mono text-xs leading-relaxed p-2 bg-neutral-50 dark:bg-neutral-900 rounded overflow-auto",children:[n===0&&s.jsx(md,{variant:"ghost",size:"icon",className:"absolute top-1 right-1 h-6 w-6 bg-neutral-100 hover:bg-neutral-200 dark:bg-neutral-800 dark:hover:bg-neutral-700",onClick:c,"aria-label":"Copy JSON to clipboard",children:i?s.jsx(Pe,{size:14}):s.jsx(Bt,{size:14})}),u(t)]})}const Ea=d.createContext({theme:"dark"});function ug({children:t,...e}){return s.jsx(Ea.Provider,{value:e,children:t})}function mr(){return d.useContext(Ea).theme}function hd(t){const{resolveAgentColor:e}=d.useContext(Ea);if(!(!t||!e))return e(t)}const k={card:{bg:"bg-white dark:bg-zinc-900/30",border:"border-parchment-300 dark:border-zinc-800/40"},codeBg:"bg-parchment-100 dark:bg-zinc-950",codeBgSubtle:"bg-parchment-50 dark:bg-zinc-900/50",text:{primary:"text-parchment-800 dark:text-zinc-300",secondary:"text-parchment-600 dark:text-zinc-400",muted:"text-parchment-500 dark:text-zinc-500",faint:"text-parchment-400 dark:text-zinc-600"},separator:"border-parchment-200 dark:border-zinc-800/40",hover:"hover:bg-parchment-100 dark:hover:bg-zinc-800/40",scrollbar:"scrollbar-thin scrollbar-track-transparent scrollbar-thumb-parchment-300 dark:scrollbar-thumb-zinc-700"},ue={blue:{card:"border-blue-600/30 bg-blue-500/10 dark:border-blue-500/20 dark:bg-blue-500/5",icon:"text-blue-600 dark:text-blue-400/80"},emerald:{card:"border-emerald-600/30 bg-emerald-500/10 dark:border-emerald-500/20 dark:bg-emerald-500/5",icon:"text-emerald-600 dark:text-emerald-400/80"},violet:{card:"border-violet-600/30 bg-violet-500/10 dark:border-violet-500/20 dark:bg-violet-500/5",icon:"text-violet-600 dark:text-violet-400/80"},orange:{card:"border-orange-600/30 bg-orange-500/10 dark:border-orange-500/20 dark:bg-orange-500/5",icon:"text-orange-600 dark:text-orange-400/80"},amber:{card:"border-amber-600/30 bg-amber-500/10 dark:border-amber-500/20 dark:bg-amber-500/5",icon:"text-amber-600 dark:text-amber-400/80"},purple:{card:"border-purple-600/30 bg-purple-500/10 dark:border-purple-500/20 dark:bg-purple-500/5",icon:"text-purple-600 dark:text-purple-400/80"},cyan:{card:"border-cyan-600/30 bg-cyan-500/10 dark:border-cyan-500/20 dark:bg-cyan-500/5",icon:"text-cyan-600 dark:text-cyan-400/80"},indigo:{card:"border-indigo-600/30 bg-indigo-500/10 dark:border-indigo-500/20 dark:bg-indigo-500/5",icon:"text-indigo-600 dark:text-indigo-400/80"},rose:{card:"border-rose-600/30 bg-rose-500/10 dark:border-rose-500/20 dark:bg-rose-500/5",icon:"text-rose-600 dark:text-rose-400/80"},zinc:{card:"border-parchment-400/40 bg-parchment-500/8 dark:border-zinc-500/25 dark:bg-zinc-500/5",icon:"text-parchment-500 dark:text-zinc-400/80"}},kt={blue:{border:"border-blue-600/30 dark:border-blue-500/20",bg:"bg-blue-500/10 dark:bg-blue-500/5",icon:"text-blue-600 dark:text-blue-400/80"},green:{border:"border-green-600/30 dark:border-green-500/20",bg:"bg-green-500/10 dark:bg-green-500/5",icon:"text-green-600 dark:text-green-400/80"},yellow:{border:"border-amber-600/30 dark:border-amber-500/20",bg:"bg-amber-500/10 dark:bg-amber-500/5",icon:"text-amber-600 dark:text-amber-400/80"},purple:{border:"border-purple-600/30 dark:border-purple-500/20",bg:"bg-purple-500/10 dark:bg-purple-500/5",icon:"text-purple-600 dark:text-purple-400/80"},red:{border:"border-red-600/30 dark:border-red-500/20",bg:"bg-red-500/10 dark:bg-red-500/5",icon:"text-red-600 dark:text-red-400/80"},cyan:{border:"border-cyan-600/30 dark:border-cyan-500/20",bg:"bg-cyan-500/10 dark:bg-cyan-500/5",icon:"text-cyan-600 dark:text-cyan-400/80"}},pg={border:"border-parchment-400/40 dark:border-zinc-500/20",bg:"bg-parchment-500/8 dark:bg-zinc-500/5",icon:"text-parchment-500 dark:text-zinc-400/80"},Ps=`prose dark:prose-invert prose-sm max-w-none
3
3
  [&_h1]:text-[15px] [&_h1]:font-semibold [&_h1]:text-parchment-900 dark:[&_h1]:text-zinc-200 [&_h1]:mt-3 [&_h1]:mb-1
4
4
  [&_h2]:text-[14px] [&_h2]:font-semibold [&_h2]:text-parchment-800 dark:[&_h2]:text-zinc-300 [&_h2]:mt-2.5 [&_h2]:mb-1
@@ -22,7 +22,7 @@ import{j as s,r as d,b as Ce,c as Im,u as Am,o as Rm,s as Pm,f as Mm,d as Lm,e a
22
22
  `)}findNextMatchSync(t,e,n){const r=this.scanner.findNextMatchSync(t,e,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},Jr=class{constructor(t,e){this.languageId=t,this.tokenType=e}},kx=class Go{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,n){this._defaultAttributes=new Jr(e,8),this._embeddedLanguagesMatcher=new jx(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(e){return e===null?Go._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(e)}static _NULL_SCOPE_METADATA=new Jr(0,0);_getBasicScopeAttributes=new Td(e=>{const n=this._scopeToLanguage(e),r=this._toStandardTokenType(e);return new Jr(n,r)});_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(e){const n=e.match(Go.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},jx=class{values;scopesRegExp;constructor(t){if(t.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(t);const e=t.map(([n,r])=>Ed(n));e.sort(),e.reverse(),this.scopesRegExp=new RegExp(`^((${e.join(")|(")}))($|\\.)`,"")}}match(t){if(!this.scopesRegExp)return;const e=t.match(this.scopesRegExp);if(e)return this.values.get(e[1])}},Ui=class{constructor(t,e){this.stack=t,this.stoppedEarly=e}};function Dd(t,e,n,r,o,a,i,l){const c=e.content.length;let u=!1,p=-1;if(i){const g=Nx(t,e,n,r,o,a);o=g.stack,r=g.linePos,n=g.isFirstLine,p=g.anchorPosition}const m=Date.now();for(;!u;){if(l!==0&&Date.now()-m>l)return new Ui(o,!0);h()}return new Ui(o,!1);function h(){const g=Cx(t,e,n,r,o,p);if(!g){a.produce(o,c),u=!0;return}const f=g.captureIndices,x=g.matchedRuleId,b=f&&f.length>0?f[0].end>r:!1;if(x===vx){const y=o.getRule(t);a.produce(o,f[0].start),o=o.withContentNameScopesList(o.nameScopesList),qs(t,e,n,o,a,y.endCaptures,f),a.produce(o,f[0].end);const v=o;if(o=o.parent,p=v.getAnchorPos(),!b&&v.getEnterPos()===r){o=v,a.produce(o,c),u=!0;return}}else{const y=t.getRule(x);a.produce(o,f[0].start);const v=o,w=y.getName(e.content,f),N=o.contentNameScopesList.pushAttributed(w,t);if(o=o.push(x,r,p,f[0].end===c,null,N,N),y instanceof Uo){const C=y;qs(t,e,n,o,a,C.beginCaptures,f),a.produce(o,f[0].end),p=f[0].end;const T=C.getContentName(e.content,f),S=N.pushAttributed(T,t);if(o=o.withContentNameScopesList(S),C.endHasBackReferences&&(o=o.withEndRule(C.getEndWithResolvedBackReferences(e.content,f))),!b&&v.hasSameRuleAs(o)){o=o.pop(),a.produce(o,c),u=!0;return}}else if(y instanceof Zn){const C=y;qs(t,e,n,o,a,C.beginCaptures,f),a.produce(o,f[0].end),p=f[0].end;const T=C.getContentName(e.content,f),S=N.pushAttributed(T,t);if(o=o.withContentNameScopesList(S),C.whileHasBackReferences&&(o=o.withEndRule(C.getWhileWithResolvedBackReferences(e.content,f))),!b&&v.hasSameRuleAs(o)){o=o.pop(),a.produce(o,c),u=!0;return}}else if(qs(t,e,n,o,a,y.captures,f),a.produce(o,f[0].end),o=o.pop(),!b){o=o.safePop(),a.produce(o,c),u=!0;return}}f[0].end>r&&(r=f[0].end,n=!1)}}function Nx(t,e,n,r,o,a){let i=o.beginRuleCapturedEOL?0:-1;const l=[];for(let c=o;c;c=c.pop()){const u=c.getRule(t);u instanceof Zn&&l.push({rule:u,stack:c})}for(let c=l.pop();c;c=l.pop()){const{ruleScanner:u,findOptions:p}=Tx(c.rule,t,c.stack.endRule,n,r===i),m=u.findNextMatchSync(e,r,p);if(m){if(m.ruleId!==Md){o=c.stack.pop();break}m.captureIndices&&m.captureIndices.length&&(a.produce(c.stack,m.captureIndices[0].start),qs(t,e,n,c.stack,a,c.rule.whileCaptures,m.captureIndices),a.produce(c.stack,m.captureIndices[0].end),i=m.captureIndices[0].end,m.captureIndices[0].end>r&&(r=m.captureIndices[0].end,n=!1))}else{o=c.stack.pop();break}}return{stack:o,linePos:r,anchorPosition:i,isFirstLine:n}}function Cx(t,e,n,r,o,a){const i=Sx(t,e,n,r,o,a),l=t.getInjections();if(l.length===0)return i;const c=Ex(l,t,e,n,r,o,a);if(!c)return i;if(!i)return c;const u=i.captureIndices[0].start,p=c.captureIndices[0].start;return p<u||c.priorityMatch&&p===u?c:i}function Sx(t,e,n,r,o,a){const i=o.getRule(t),{ruleScanner:l,findOptions:c}=$d(i,t,o.endRule,n,r===a),u=l.findNextMatchSync(e,r,c);return u?{captureIndices:u.captureIndices,matchedRuleId:u.ruleId}:null}function Ex(t,e,n,r,o,a,i){let l=Number.MAX_VALUE,c=null,u,p=0;const m=a.contentNameScopesList.getScopeNames();for(let h=0,g=t.length;h<g;h++){const f=t[h];if(!f.matcher(m))continue;const x=e.getRule(f.ruleId),{ruleScanner:b,findOptions:y}=$d(x,e,null,r,o===i),v=b.findNextMatchSync(n,o,y);if(!v)continue;const w=v.captureIndices[0].start;if(!(w>=l)&&(l=w,c=v.captureIndices,u=v.ruleId,p=f.priority,l===o))break}return c?{priorityMatch:p===-1,captureIndices:c,matchedRuleId:u}:null}function $d(t,e,n,r,o){return{ruleScanner:t.compileAG(e,n,r,o),findOptions:0}}function Tx(t,e,n,r,o){return{ruleScanner:t.compileWhileAG(e,n,r,o),findOptions:0}}function qs(t,e,n,r,o,a,i){if(a.length===0)return;const l=e.content,c=Math.min(a.length,i.length),u=[],p=i[0].end;for(let m=0;m<c;m++){const h=a[m];if(h===null)continue;const g=i[m];if(g.length===0)continue;if(g.start>p)break;for(;u.length>0&&u[u.length-1].endPos<=g.start;)o.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop();if(u.length>0?o.produceFromScopes(u[u.length-1].scopes,g.start):o.produce(r,g.start),h.retokenizeCapturedWithRuleId){const x=h.getName(l,i),b=r.contentNameScopesList.pushAttributed(x,t),y=h.getContentName(l,i),v=b.pushAttributed(y,t),w=r.push(h.retokenizeCapturedWithRuleId,g.start,-1,!1,null,b,v),N=t.createOnigString(l.substring(0,g.end));Dd(t,N,n&&g.start===0,g.start,w,o,!1,0),Rd(N);continue}const f=h.getName(l,i);if(f!==null){const b=(u.length>0?u[u.length-1].scopes:r.contentNameScopesList).pushAttributed(f,t);u.push(new Ix(b,g.end))}}for(;u.length>0;)o.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop()}var Ix=class{scopes;endPos;constructor(t,e){this.scopes=t,this.endPos=e}};function Ax(t,e,n,r,o,a,i,l){return new Px(t,e,n,r,o,a,i,l)}function Gi(t,e,n,r,o){const a=Jn(e,er),i=Ld.getCompiledRuleId(n,r,o.repository);for(const l of a)t.push({debugSelector:e,matcher:l.matcher,ruleId:i,grammar:o,priority:l.priority})}function er(t,e){if(e.length<t.length)return!1;let n=0;return t.every(r=>{for(let o=n;o<e.length;o++)if(Rx(e[o],r))return n=o+1,!0;return!1})}function Rx(t,e){if(!t)return!1;if(t===e)return!0;const n=e.length;return t.length>n&&t.substr(0,n)===e&&t[n]==="."}var Px=class{constructor(t,e,n,r,o,a,i,l){if(this._rootScopeName=t,this.balancedBracketSelectors=a,this._onigLib=l,this._basicScopeAttributesProvider=new kx(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=i,this._grammar=Hi(e,null),this._injections=null,this._tokenTypeMatchers=[],o)for(const c of Object.keys(o)){const u=Jn(c,er);for(const p of u)this._tokenTypeMatchers.push({matcher:p.matcher,type:o[c]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const t of this._ruleId2desc)t&&t.dispose()}createOnigScanner(t){return this._onigLib.createOnigScanner(t)}createOnigString(t){return this._onigLib.createOnigString(t)}getMetadataForScope(t){return this._basicScopeAttributesProvider.getBasicScopeAttributes(t)}_collectInjections(){const t={lookup:o=>o===this._rootScopeName?this._grammar:this.getExternalGrammar(o),injections:o=>this._grammarRepository.injections(o)},e=[],n=this._rootScopeName,r=t.lookup(n);if(r){const o=r.injections;if(o)for(let i in o)Gi(e,i,o[i],this,r);const a=this._grammarRepository.injections(n);a&&a.forEach(i=>{const l=this.getExternalGrammar(i);if(l){const c=l.injectionSelector;c&&Gi(e,c,l,this,l)}})}return e.sort((o,a)=>o.priority-a.priority),e}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(t){const e=++this._lastRuleId,n=t(e);return this._ruleId2desc[e]=n,n}getRule(t){return this._ruleId2desc[t]}getExternalGrammar(t,e){if(this._includedGrammars[t])return this._includedGrammars[t];if(this._grammarRepository){const n=this._grammarRepository.lookup(t);if(n)return this._includedGrammars[t]=Hi(n,e&&e.$base),this._includedGrammars[t]}}tokenizeLine(t,e,n=0){const r=this._tokenize(t,e,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(t,e,n=0){const r=this._tokenize(t,e,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(t,e,n,r){this._rootId===-1&&(this._rootId=Ld.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let o;if(!e||e===Ho.NULL){o=!0;const u=this._basicScopeAttributesProvider.getDefaultAttributes(),p=this.themeProvider.getDefaults(),m=Ss.set(0,u.languageId,u.tokenType,null,p.fontStyle,p.foregroundId,p.backgroundId),h=this.getRule(this._rootId).getName(null,null);let g;h?g=Qs.createRootAndLookUpScopeName(h,m,this):g=Qs.createRoot("unknown",m),e=new Ho(null,this._rootId,-1,-1,!1,null,g,g)}else o=!1,e.reset();t=t+`
23
23
  `;const a=this.createOnigString(t),i=a.content.length,l=new Lx(n,t,this._tokenTypeMatchers,this.balancedBracketSelectors),c=Dd(this,a,o,0,e,l,!0,r);return Rd(a),{lineLength:i,lineTokens:l,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function Hi(t,e){return t=Xg(t),t.repository=t.repository||{},t.repository.$self={$vscodeTextmateLocation:t.$vscodeTextmateLocation,patterns:t.patterns,name:t.scopeName},t.repository.$base=e||t.repository.$self,t}var Qs=class yt{constructor(e,n,r){this.parent=e,this.scopePath=n,this.tokenAttributes=r}static fromExtension(e,n){let r=e,o=e?.scopePath??null;for(const a of n)o=Yr.push(o,a.scopeNames),r=new yt(r,o,a.encodedTokenAttributes);return r}static createRoot(e,n){return new yt(null,new Yr(null,e),n)}static createRootAndLookUpScopeName(e,n,r){const o=r.getMetadataForScope(e),a=new Yr(null,e),i=r.themeProvider.themeMatch(a),l=yt.mergeAttributes(n,o,i);return new yt(null,a,l)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(e){return yt.equals(this,e)}static equals(e,n){do{if(e===n||!e&&!n)return!0;if(!e||!n||e.scopeName!==n.scopeName||e.tokenAttributes!==n.tokenAttributes)return!1;e=e.parent,n=n.parent}while(!0)}static mergeAttributes(e,n,r){let o=-1,a=0,i=0;return r!==null&&(o=r.fontStyle,a=r.foregroundId,i=r.backgroundId),Ss.set(e,n.languageId,n.tokenType,null,o,a,i)}pushAttributed(e,n){if(e===null)return this;if(e.indexOf(" ")===-1)return yt._pushAttributed(this,e,n);const r=e.split(/ /g);let o=this;for(const a of r)o=yt._pushAttributed(o,a,n);return o}static _pushAttributed(e,n,r){const o=r.getMetadataForScope(n),a=e.scopePath.push(n),i=r.themeProvider.themeMatch(a),l=yt.mergeAttributes(e.tokenAttributes,o,i);return new yt(e,a,l)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){const n=[];let r=this;for(;r&&r!==e;)n.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(r.parent?.scopePath??null)}),r=r.parent;return r===e?n.reverse():void 0}},Ho=class Zt{constructor(e,n,r,o,a,i,l,c){this.parent=e,this.ruleId=n,this.beginRuleCapturedEOL=a,this.endRule=i,this.nameScopesList=l,this.contentNameScopesList=c,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=o}_stackElementBrand=void 0;static NULL=new Zt(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(e){return e===null?!1:Zt._equals(this,e)}static _equals(e,n){return e===n?!0:this._structuralEquals(e,n)?Qs.equals(e.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(e,n){do{if(e===n||!e&&!n)return!0;if(!e||!n||e.depth!==n.depth||e.ruleId!==n.ruleId||e.endRule!==n.endRule)return!1;e=e.parent,n=n.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){Zt._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(e,n,r,o,a,i,l){return new Zt(this,e,n,r,o,a,i,l)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){const e=[];return this._writeString(e,0),"["+e.join(",")+"]"}_writeString(e,n){return this.parent&&(n=this.parent._writeString(e,n)),e[n++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,n}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(e){return this.endRule===e?this:new Zt(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,e,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let n=this;for(;n&&n._enterPos===e._enterPos;){if(n.ruleId===e.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(e,n){const r=Qs.fromExtension(e?.nameScopesList??null,n.nameScopesList);return new Zt(e,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,Qs.fromExtension(r,n.contentNameScopesList))}},Mx=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(t,e){this.balancedBracketScopes=t.flatMap(n=>n==="*"?(this.allowAny=!0,[]):Jn(n,er).map(r=>r.matcher)),this.unbalancedBracketScopes=e.flatMap(n=>Jn(n,er).map(r=>r.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(t){for(const e of this.unbalancedBracketScopes)if(e(t))return!1;for(const e of this.balancedBracketScopes)if(e(t))return!0;return this.allowAny}},Lx=class{constructor(t,e,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=t,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(t,e){this.produceFromScopes(t.contentNameScopesList,e)}produceFromScopes(t,e){if(this._lastTokenEndIndex>=e)return;if(this._emitBinaryTokens){let r=t?.tokenAttributes??0,o=!1;if(this.balancedBracketSelectors?.matchesAlways&&(o=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const a=t?.getScopeNames()??[];for(const i of this._tokenTypeOverrides)i.matcher(a)&&(r=Ss.set(r,0,i.type,null,-1,0,0));this.balancedBracketSelectors&&(o=this.balancedBracketSelectors.match(a))}if(o&&(r=Ss.set(r,0,8,o,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===r){this._lastTokenEndIndex=e;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(r),this._lastTokenEndIndex=e;return}const n=t?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:e,scopes:n}),this._lastTokenEndIndex=e}getResult(t,e){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===e-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(t,e){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===e-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let r=0,o=this._binaryTokens.length;r<o;r++)n[r]=this._binaryTokens[r];return n}},Ox=class{constructor(t,e){this._onigLib=e,this._theme=t}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(const t of this._grammars.values())t.dispose()}setTheme(t){this._theme=t}getColorMap(){return this._theme.getColorMap()}addGrammar(t,e){this._rawGrammars.set(t.scopeName,t),e&&this._injectionGrammars.set(t.scopeName,e)}lookup(t){return this._rawGrammars.get(t)}injections(t){return this._injectionGrammars.get(t)}getDefaults(){return this._theme.getDefaults()}themeMatch(t){return this._theme.match(t)}grammarForScopeName(t,e,n,r,o){if(!this._grammars.has(t)){let a=this._rawGrammars.get(t);if(!a)return null;this._grammars.set(t,Ax(t,a,e,n,r,o,this,this._onigLib))}return this._grammars.get(t)}},Dx=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new Ox(Yn.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,n){this._syncRegistry.setTheme(Yn.createFromRawTheme(e,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,n,r){return this.loadGrammarWithConfiguration(e,n,{embeddedLanguages:r})}loadGrammarWithConfiguration(e,n,r){return this._loadGrammar(e,n,r.embeddedLanguages,r.tokenTypes,new Mx(r.balancedBracketSelectors||[],r.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,n,r,o,a){const i=new px(this._syncRegistry,e);for(;i.Q.length>0;)i.Q.map(l=>this._loadSingleGrammar(l.scopeName)),i.processQueue();return this._grammarForScopeName(e,n,r,o,a)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){const n=this._options.loadGrammar(e);if(n){const r=typeof this._options.getInjections=="function"?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(n,r)}}addGrammar(e,n=[],r=0,o=null){return this._syncRegistry.addGrammar(e,n),this._grammarForScopeName(e.scopeName,r,o)}_grammarForScopeName(e,n=0,r=null,o=null,a=null){return this._syncRegistry.grammarForScopeName(e,n,r,o,a)}},qo=Ho.NULL;function tr(t,e){const n=typeof t=="string"?{}:{...t.colorReplacements},r=typeof t=="string"?t:t.name;for(const[o,a]of Object.entries(e?.colorReplacements||{}))typeof a=="string"?n[o]=a:o===r&&Object.assign(n,a);return n}function Ut(t,e){return t&&(e?.[t?.toLowerCase()]||t)}function $x(t){return Array.isArray(t)?t:[t]}async function zd(t){return Promise.resolve(typeof t=="function"?t():t).then(e=>e.default||e)}function Ma(t){return!t||["plaintext","txt","text","plain"].includes(t)}function Fd(t){return t==="ansi"||Ma(t)}function La(t){return t==="none"}function Vd(t){return La(t)}function Bd(t,e){if(!e)return t;t.properties||={},t.properties.class||=[],typeof t.properties.class=="string"&&(t.properties.class=t.properties.class.split(/\s+/g)),Array.isArray(t.properties.class)||(t.properties.class=[]);const n=Array.isArray(e)?e:e.split(/\s+/g);for(const r of n)r&&!t.properties.class.includes(r)&&t.properties.class.push(r);return t}function yr(t,e=!1){if(t.length===0)return[["",0]];const n=t.split(/(\r?\n)/g);let r=0;const o=[];for(let a=0;a<n.length;a+=2){const i=e?n[a]+(n[a+1]||""):n[a];o.push([i,r]),r+=n[a].length,r+=n[a+1]?.length||0}return o}function zx(t){const e=yr(t,!0).map(([o])=>o);function n(o){if(o===t.length)return{line:e.length-1,character:e[e.length-1].length};let a=o,i=0;for(const l of e){if(a<l.length)break;a-=l.length,i++}return{line:i,character:a}}function r(o,a){let i=0;for(let l=0;l<o;l++)i+=e[l].length;return i+=a,i}return{lines:e,indexToPos:n,posToIndex:r}}function Fx(t,e,n){const r=new Set;for(const a of t.matchAll(/:?lang=["']([^"']+)["']/g)){const i=a[1].toLowerCase().trim();i&&r.add(i)}for(const a of t.matchAll(/(?:```|~~~)([\w-]+)/g)){const i=a[1].toLowerCase().trim();i&&r.add(i)}for(const a of t.matchAll(/\\begin\{([\w-]+)\}/g)){const i=a[1].toLowerCase().trim();i&&r.add(i)}for(const a of t.matchAll(/<script\s+(?:type|lang)=["']([^"']+)["']/gi)){const i=a[1].toLowerCase().trim(),l=i.includes("/")?i.split("/").pop():i;l&&r.add(l)}if(!n)return Array.from(r);const o=n.getBundledLanguages();return Array.from(r).filter(a=>a&&o[a])}const Oa="light-dark()",Vx=["color","background-color"];function Bx(t,e){let n=0;const r=[];for(const o of e)o>n&&r.push({...t,content:t.content.slice(n,o),offset:t.offset+n}),n=o;return n<t.content.length&&r.push({...t,content:t.content.slice(n),offset:t.offset+n}),r}function Ux(t,e){const n=Array.from(e instanceof Set?e:new Set(e)).sort((r,o)=>r-o);return n.length?t.map(r=>r.flatMap(o=>{const a=n.filter(i=>o.offset<i&&i<o.offset+o.content.length).map(i=>i-o.offset).sort((i,l)=>i-l);return a.length?Bx(o,a):o})):t}function Gx(t,e,n,r,o="css-vars"){const a={content:t.content,explanation:t.explanation,offset:t.offset},i=e.map(p=>sr(t.variants[p])),l=new Set(i.flatMap(p=>Object.keys(p))),c={},u=(p,m)=>{const h=m==="color"?"":m==="background-color"?"-bg":`-${m}`;return n+e[p]+(m==="color"?"":h)};return i.forEach((p,m)=>{for(const h of l){const g=p[h]||"inherit";if(m===0&&r&&Vx.includes(h))if(r===Oa&&i.length>1){const f=e.findIndex(v=>v==="light"),x=e.findIndex(v=>v==="dark");if(f===-1||x===-1)throw new ze('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const b=i[f][h]||"inherit",y=i[x][h]||"inherit";c[h]=`light-dark(${b}, ${y})`,o==="css-vars"&&(c[u(m,h)]=g)}else c[h]=g;else o==="css-vars"&&(c[u(m,h)]=g)}}),a.htmlStyle=c,a}function sr(t){const e={};if(t.color&&(e.color=t.color),t.bgColor&&(e["background-color"]=t.bgColor),t.fontStyle){t.fontStyle&et.Italic&&(e["font-style"]="italic"),t.fontStyle&et.Bold&&(e["font-weight"]="bold");const n=[];t.fontStyle&et.Underline&&n.push("underline"),t.fontStyle&et.Strikethrough&&n.push("line-through"),n.length&&(e["text-decoration"]=n.join(" "))}return e}function Wo(t){return typeof t=="string"?t:Object.entries(t).map(([e,n])=>`${e}:${n}`).join(";")}const Ud=new WeakMap;function vr(t,e){Ud.set(t,e)}function on(t){return Ud.get(t)}class Ls{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(e,n){return new Ls(Object.fromEntries($x(n).map(r=>[r,qo])),e)}constructor(...e){if(e.length===2){const[n,r]=e;this.lang=r,this._stacks=n}else{const[n,r,o]=e;this.lang=r,this._stacks={[o]:n}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return Hx(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function Hx(t){const e=[],n=new Set;function r(o){if(n.has(o))return;n.add(o);const a=o?.nameScopesList?.scopeName;a&&e.push(a),o.parent&&r(o.parent)}return r(t),e}function qx(t,e){if(!(t instanceof Ls))throw new ze("Invalid grammar state");return t.getInternalStack(e)}function Wx(){const t=new WeakMap;function e(n){if(!t.has(n.meta)){let r=function(i){if(typeof i=="number"){if(i<0||i>n.source.length)throw new ze(`Invalid decoration offset: ${i}. Code length: ${n.source.length}`);return{...o.indexToPos(i),offset:i}}else{const l=o.lines[i.line];if(l===void 0)throw new ze(`Invalid decoration position ${JSON.stringify(i)}. Lines length: ${o.lines.length}`);let c=i.character;if(c<0&&(c=l.length+c),c<0||c>l.length)throw new ze(`Invalid decoration position ${JSON.stringify(i)}. Line ${i.line} length: ${l.length}`);return{...i,character:c,offset:o.posToIndex(i.line,c)}}};const o=zx(n.source),a=(n.options.decorations||[]).map(i=>({...i,start:r(i.start),end:r(i.end)}));Kx(a),t.set(n.meta,{decorations:a,converter:o,source:n.source})}return t.get(n.meta)}return{name:"shiki:decorations",tokens(n){if(!this.options.decorations?.length)return;const o=e(this).decorations.flatMap(i=>[i.start.offset,i.end.offset]);return Ux(n,o)},code(n){if(!this.options.decorations?.length)return;const r=e(this),o=Array.from(n.children).filter(p=>p.type==="element"&&p.tagName==="span");if(o.length!==r.converter.lines.length)throw new ze(`Number of lines in code element (${o.length}) does not match the number of lines in the source (${r.converter.lines.length}). Failed to apply decorations.`);function a(p,m,h,g){const f=o[p];let x="",b=-1,y=-1;if(m===0&&(b=0),h===0&&(y=0),h===Number.POSITIVE_INFINITY&&(y=f.children.length),b===-1||y===-1)for(let w=0;w<f.children.length;w++)x+=Gd(f.children[w]),b===-1&&x.length===m&&(b=w+1),y===-1&&x.length===h&&(y=w+1);if(b===-1)throw new ze(`Failed to find start index for decoration ${JSON.stringify(g.start)}`);if(y===-1)throw new ze(`Failed to find end index for decoration ${JSON.stringify(g.end)}`);const v=f.children.slice(b,y);if(!g.alwaysWrap&&v.length===f.children.length)l(f,g,"line");else if(!g.alwaysWrap&&v.length===1&&v[0].type==="element")l(v[0],g,"token");else{const w={type:"element",tagName:"span",properties:{},children:v};l(w,g,"wrapper"),f.children.splice(b,v.length,w)}}function i(p,m){o[p]=l(o[p],m,"line")}function l(p,m,h){const g=m.properties||{},f=m.transform||(x=>x);return p.tagName=m.tagName||"span",p.properties={...p.properties,...g,class:p.properties.class},m.properties?.class&&Bd(p,m.properties.class),p=f(p,h)||p,p}const c=[],u=r.decorations.sort((p,m)=>m.start.offset-p.start.offset||p.end.offset-m.end.offset);for(const p of u){const{start:m,end:h}=p;if(m.line===h.line)a(m.line,m.character,h.character,p);else if(m.line<h.line){a(m.line,m.character,Number.POSITIVE_INFINITY,p);for(let g=m.line+1;g<h.line;g++)c.unshift(()=>i(g,p));a(h.line,0,h.character,p)}}c.forEach(p=>p())}}}function Kx(t){for(let e=0;e<t.length;e++){const n=t[e];if(n.start.offset>n.end.offset)throw new ze(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=e+1;r<t.length;r++){const o=t[r],a=n.start.offset<=o.start.offset&&o.start.offset<n.end.offset,i=n.start.offset<o.end.offset&&o.end.offset<=n.end.offset,l=o.start.offset<=n.start.offset&&n.start.offset<o.end.offset,c=o.start.offset<n.end.offset&&n.end.offset<=o.end.offset;if(a||i||l||c){if(a&&i||l&&c||l&&n.start.offset===n.end.offset||i&&o.start.offset===o.end.offset)continue;throw new ze(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(o.start)} intersect.`)}}}}function Gd(t){return t.type==="text"?t.value:t.type==="element"?t.children.map(Gd).join(""):""}const Qx=[Wx()];function nr(t){const e=Yx(t.transformers||[]);return[...e.pre,...e.normal,...e.post,...Qx]}function Yx(t){const e=[],n=[],r=[];for(const o of t)switch(o.enforce){case"pre":e.push(o);break;case"post":n.push(o);break;default:r.push(o)}return{pre:e,post:n,normal:r}}var es=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],Xr={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function Jx(t,e){const n=t.indexOf("\x1B",e);if(n!==-1&&t[n+1]==="["){const r=t.indexOf("m",n);if(r!==-1)return{sequence:t.substring(n+2,r).split(";"),startPosition:n,position:r+1}}return{position:t.length}}function qi(t){const e=t.shift();if(e==="2"){const n=t.splice(0,3).map(r=>Number.parseInt(r));return n.length!==3||n.some(r=>Number.isNaN(r))?void 0:{type:"rgb",rgb:n}}else if(e==="5"){const n=t.shift();if(n)return{type:"table",index:Number(n)}}}function Xx(t){const e=[];for(;t.length>0;){const n=t.shift();if(!n)continue;const r=Number.parseInt(n);if(!Number.isNaN(r))if(r===0)e.push({type:"resetAll"});else if(r<=9)Xr[r]&&e.push({type:"setDecoration",value:Xr[r]});else if(r<=29){const o=Xr[r-20];o&&(e.push({type:"resetDecoration",value:o}),o==="dim"&&e.push({type:"resetDecoration",value:"bold"}))}else if(r<=37)e.push({type:"setForegroundColor",value:{type:"named",name:es[r-30]}});else if(r===38){const o=qi(t);o&&e.push({type:"setForegroundColor",value:o})}else if(r===39)e.push({type:"resetForegroundColor"});else if(r<=47)e.push({type:"setBackgroundColor",value:{type:"named",name:es[r-40]}});else if(r===48){const o=qi(t);o&&e.push({type:"setBackgroundColor",value:o})}else r===49?e.push({type:"resetBackgroundColor"}):r===53?e.push({type:"setDecoration",value:"overline"}):r===55?e.push({type:"resetDecoration",value:"overline"}):r>=90&&r<=97?e.push({type:"setForegroundColor",value:{type:"named",name:es[r-90+8]}}):r>=100&&r<=107&&e.push({type:"setBackgroundColor",value:{type:"named",name:es[r-100+8]}})}return e}function Zx(){let t=null,e=null,n=new Set;return{parse(r){const o=[];let a=0;do{const i=Jx(r,a),l=i.sequence?r.substring(a,i.startPosition):r.substring(a);if(l.length>0&&o.push({value:l,foreground:t,background:e,decorations:new Set(n)}),i.sequence){const c=Xx(i.sequence);for(const u of c)u.type==="resetAll"?(t=null,e=null,n.clear()):u.type==="resetForegroundColor"?t=null:u.type==="resetBackgroundColor"?e=null:u.type==="resetDecoration"&&n.delete(u.value);for(const u of c)u.type==="setForegroundColor"?t=u.value:u.type==="setBackgroundColor"?e=u.value:u.type==="setDecoration"&&n.add(u.value)}a=i.position}while(a<r.length);return o}}}var eb={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function tb(t=eb){function e(l){return t[l]}function n(l){return`#${l.map(c=>Math.max(0,Math.min(c,255)).toString(16).padStart(2,"0")).join("")}`}let r;function o(){if(r)return r;r=[];for(let u=0;u<es.length;u++)r.push(e(es[u]));let l=[0,95,135,175,215,255];for(let u=0;u<6;u++)for(let p=0;p<6;p++)for(let m=0;m<6;m++)r.push(n([l[u],l[p],l[m]]));let c=8;for(let u=0;u<24;u++,c+=10)r.push(n([c,c,c]));return r}function a(l){return o()[l]}function i(l){switch(l.type){case"named":return e(l.name);case"rgb":return n(l.rgb);case"table":return a(l.index)}}return{value:i}}const sb={black:"#000000",red:"#cd3131",green:"#0DBC79",yellow:"#E5E510",blue:"#2472C8",magenta:"#BC3FBC",cyan:"#11A8CD",white:"#E5E5E5",brightBlack:"#666666",brightRed:"#F14C4C",brightGreen:"#23D18B",brightYellow:"#F5F543",brightBlue:"#3B8EEA",brightMagenta:"#D670D6",brightCyan:"#29B8DB",brightWhite:"#FFFFFF"};function nb(t,e,n){const r=tr(t,n),o=yr(e),a=Object.fromEntries(es.map(c=>{const u=`terminal.ansi${c[0].toUpperCase()}${c.substring(1)}`,p=t.colors?.[u];return[c,p||sb[c]]})),i=tb(a),l=Zx();return o.map(c=>l.parse(c[0]).map(u=>{let p,m;u.decorations.has("reverse")?(p=u.background?i.value(u.background):t.bg,m=u.foreground?i.value(u.foreground):t.fg):(p=u.foreground?i.value(u.foreground):t.fg,m=u.background?i.value(u.background):void 0),p=Ut(p,r),m=Ut(m,r),u.decorations.has("dim")&&(p=rb(p));let h=et.None;return u.decorations.has("bold")&&(h|=et.Bold),u.decorations.has("italic")&&(h|=et.Italic),u.decorations.has("underline")&&(h|=et.Underline),u.decorations.has("strikethrough")&&(h|=et.Strikethrough),{content:u.value,offset:c[1],color:p,bgColor:m,fontStyle:h}}))}function rb(t){const e=t.match(/#([0-9a-f]{3,8})/i);if(e){const r=e[1];if(r.length===8){const o=Math.round(Number.parseInt(r.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${r.slice(0,6)}${o}`}else{if(r.length===6)return`#${r}80`;if(r.length===4){const o=r[0],a=r[1],i=r[2],l=r[3],c=Math.round(Number.parseInt(`${l}${l}`,16)/2).toString(16).padStart(2,"0");return`#${o}${o}${a}${a}${i}${i}${c}`}else if(r.length===3){const o=r[0],a=r[1],i=r[2];return`#${o}${o}${a}${a}${i}${i}80`}}}const n=t.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:t}function Da(t,e,n={}){const{theme:r=t.getLoadedThemes()[0]}=n,o=t.resolveLangAlias(n.lang||"text");if(Ma(o)||La(r))return yr(e).map(c=>[{content:c[0],offset:c[1]}]);const{theme:a,colorMap:i}=t.setTheme(r);if(o==="ansi")return nb(a,e,n);const l=t.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==l.name)throw new ze(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${l.name}"`);if(!n.grammarState.themes.includes(a.name))throw new ze(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${a.name}"`)}return ab(e,l,a,i,n)}function ob(...t){if(t.length===2)return on(t[1]);const[e,n,r={}]=t,{lang:o="text",theme:a=e.getLoadedThemes()[0]}=r;if(Ma(o)||La(a))throw new ze("Plain language does not have grammar state");if(o==="ansi")throw new ze("ANSI language does not have grammar state");const{theme:i,colorMap:l}=e.setTheme(a),c=e.getLanguage(o);return new Ls($a(n,c,i,l,r).stateStack,c.name,i.name)}function ab(t,e,n,r,o){const a=$a(t,e,n,r,o),i=new Ls(a.stateStack,e.name,n.name);return vr(a.tokens,i),a.tokens}function $a(t,e,n,r,o){const a=tr(n,o),{tokenizeMaxLineLength:i=0,tokenizeTimeLimit:l=500}=o,c=yr(t);let u=o.grammarState?qx(o.grammarState,n.name)??qo:o.grammarContextCode!=null?$a(o.grammarContextCode,e,n,r,{...o,grammarState:void 0,grammarContextCode:void 0}).stateStack:qo,p=[];const m=[];for(let h=0,g=c.length;h<g;h++){const[f,x]=c[h];if(f===""){p=[],m.push([]);continue}if(i>0&&f.length>=i){p=[],m.push([{content:f,offset:x,color:"",fontStyle:0}]);continue}let b,y,v;o.includeExplanation&&(b=e.tokenizeLine(f,u,l),y=b.tokens,v=0);const w=e.tokenizeLine2(f,u,l),N=w.tokens.length/2;for(let C=0;C<N;C++){const T=w.tokens[2*C],S=C+1<N?w.tokens[2*C+2]:f.length;if(T===S)continue;const j=w.tokens[2*C+1],E=Ut(r[Ss.getForeground(j)],a),R=Ss.getFontStyle(j),D={content:f.substring(T,S),offset:x+T,color:E,fontStyle:R};if(o.includeExplanation){const $=[];if(o.includeExplanation!=="scopeName")for(const oe of n.settings){let V;switch(typeof oe.scope){case"string":V=oe.scope.split(/,/).map(X=>X.trim());break;case"object":V=oe.scope;break;default:continue}$.push({settings:oe,selectors:V.map(X=>X.split(/ /))})}D.explanation=[];let ne=0;for(;T+ne<S;){const oe=y[v],V=f.substring(oe.startIndex,oe.endIndex);ne+=V.length,D.explanation.push({content:V,scopes:o.includeExplanation==="scopeName"?ib(oe.scopes):cb($,oe.scopes)}),v+=1}}p.push(D)}m.push(p),p=[],u=w.ruleStack}return{tokens:m,stateStack:u}}function ib(t){return t.map(e=>({scopeName:e}))}function cb(t,e){const n=[];for(let r=0,o=e.length;r<o;r++){const a=e[r];n[r]={scopeName:a,themeMatches:db(t,a,e.slice(0,r))}}return n}function Wi(t,e){return t===e||e.substring(0,t.length)===t&&e[t.length]==="."}function lb(t,e,n){if(!Wi(t[t.length-1],e))return!1;let r=t.length-2,o=n.length-1;for(;r>=0&&o>=0;)Wi(t[r],n[o])&&(r-=1),o-=1;return r===-1}function db(t,e,n){const r=[];for(const{selectors:o,settings:a}of t)for(const i of o)if(lb(i,e,n)){r.push(a);break}return r}function Hd(t,e,n){const r=Object.entries(n.themes).filter(c=>c[1]).map(c=>({color:c[0],theme:c[1]})),o=r.map(c=>{const u=Da(t,e,{...n,theme:c.theme}),p=on(u),m=typeof c.theme=="string"?c.theme:c.theme.name;return{tokens:u,state:p,theme:m}}),a=ub(...o.map(c=>c.tokens)),i=a[0].map((c,u)=>c.map((p,m)=>{const h={content:p.content,variants:{},offset:p.offset};return"includeExplanation"in n&&n.includeExplanation&&(h.explanation=p.explanation),a.forEach((g,f)=>{const{content:x,explanation:b,offset:y,...v}=g[u][m];h.variants[r[f].color]=v}),h})),l=o[0].state?new Ls(Object.fromEntries(o.map(c=>[c.theme,c.state?.getInternalStack(c.theme)])),o[0].state.lang):void 0;return l&&vr(i,l),i}function ub(...t){const e=t.map(()=>[]),n=t.length;for(let r=0;r<t[0].length;r++){const o=t.map(c=>c[r]),a=e.map(()=>[]);e.forEach((c,u)=>c.push(a[u]));const i=o.map(()=>0),l=o.map(c=>c[0]);for(;l.every(c=>c);){const c=Math.min(...l.map(u=>u.content.length));for(let u=0;u<n;u++){const p=l[u];p.content.length===c?(a[u].push(p),i[u]+=1,l[u]=o[u][i[u]]):(a[u].push({...p,content:p.content.slice(0,c)}),l[u]={...p,content:p.content.slice(c),offset:p.offset+c})}}}return e}function rr(t,e,n){let r,o,a,i,l,c;if("themes"in n){const{defaultColor:u="light",cssVariablePrefix:p="--shiki-",colorsRendering:m="css-vars"}=n,h=Object.entries(n.themes).filter(y=>y[1]).map(y=>({color:y[0],theme:y[1]})).sort((y,v)=>y.color===u?-1:v.color===u?1:0);if(h.length===0)throw new ze("`themes` option must not be empty");const g=Hd(t,e,n);if(c=on(g),u&&Oa!==u&&!h.find(y=>y.color===u))throw new ze(`\`themes\` option must contain the defaultColor key \`${u}\``);const f=h.map(y=>t.getTheme(y.theme)),x=h.map(y=>y.color);a=g.map(y=>y.map(v=>Gx(v,x,p,u,m))),c&&vr(a,c);const b=h.map(y=>tr(y.theme,n));o=Ki(h,f,b,p,u,"fg",m),r=Ki(h,f,b,p,u,"bg",m),i=`shiki-themes ${f.map(y=>y.name).join(" ")}`,l=u?void 0:[o,r].join(";")}else if("theme"in n){const u=tr(n.theme,n);a=Da(t,e,n);const p=t.getTheme(n.theme);r=Ut(p.bg,u),o=Ut(p.fg,u),i=p.name,c=on(a)}else throw new ze("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:o,bg:r,themeName:i,rootStyle:l,grammarState:c}}function Ki(t,e,n,r,o,a,i){return t.map((l,c)=>{const u=Ut(e[c][a],n[c])||"inherit",p=`${r+l.color}${a==="bg"?"-bg":""}:${u}`;if(c===0&&o){if(o===Oa&&t.length>1){const m=t.findIndex(x=>x.color==="light"),h=t.findIndex(x=>x.color==="dark");if(m===-1||h===-1)throw new ze('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const g=Ut(e[m][a],n[m])||"inherit",f=Ut(e[h][a],n[h])||"inherit";return`light-dark(${g}, ${f});${p}`}return u}return i==="css-vars"?p:null}).filter(l=>!!l).join(";")}function or(t,e,n,r={meta:{},options:n,codeToHast:(o,a)=>or(t,o,a),codeToTokens:(o,a)=>rr(t,o,a)}){let o=e;for(const f of nr(n))o=f.preprocess?.call(r,o,n)||o;let{tokens:a,fg:i,bg:l,themeName:c,rootStyle:u,grammarState:p}=rr(t,o,n);const{mergeWhitespaces:m=!0,mergeSameStyleTokens:h=!1}=n;m===!0?a=mb(a):m==="never"&&(a=hb(a)),h&&(a=fb(a));const g={...r,get source(){return o}};for(const f of nr(n))a=f.tokens?.call(g,a)||a;return pb(a,{...n,fg:i,bg:l,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??u},g,p)}function pb(t,e,n,r=on(t)){const o=nr(e),a=[],i={type:"root",children:[]},{structure:l="classic",tabindex:c="0"}=e,u={class:`shiki ${e.themeName||""}`};e.rootStyle!==!1&&(e.rootStyle!=null?u.style=e.rootStyle:u.style=`background-color:${e.bg};color:${e.fg}`),c!==!1&&c!=null&&(u.tabindex=c.toString());for(const[x,b]of Object.entries(e.meta||{}))x.startsWith("_")||(u[x]=b);let p={type:"element",tagName:"pre",properties:u,children:[],data:e.data},m={type:"element",tagName:"code",properties:{},children:a};const h=[],g={...n,structure:l,addClassToHast:Bd,get source(){return n.source},get tokens(){return t},get options(){return e},get root(){return i},get pre(){return p},get code(){return m},get lines(){return h}};if(t.forEach((x,b)=>{b&&(l==="inline"?i.children.push({type:"element",tagName:"br",properties:{},children:[]}):l==="classic"&&a.push({type:"text",value:`
24
24
  `}));let y={type:"element",tagName:"span",properties:{class:"line"},children:[]},v=0;for(const w of x){let N={type:"element",tagName:"span",properties:{...w.htmlAttrs},children:[{type:"text",value:w.content}]};const C=Wo(w.htmlStyle||sr(w));C&&(N.properties.style=C);for(const T of o)N=T?.span?.call(g,N,b+1,v,y,w)||N;l==="inline"?i.children.push(N):l==="classic"&&y.children.push(N),v+=w.content.length}if(l==="classic"){for(const w of o)y=w?.line?.call(g,y,b+1)||y;h.push(y),a.push(y)}else l==="inline"&&h.push(y)}),l==="classic"){for(const x of o)m=x?.code?.call(g,m)||m;p.children.push(m);for(const x of o)p=x?.pre?.call(g,p)||p;i.children.push(p)}else if(l==="inline"){const x=[];let b={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const w of i.children)w.type==="element"&&w.tagName==="br"?(x.push(b),b={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(w.type==="element"||w.type==="text")&&b.children.push(w);x.push(b);let v={type:"element",tagName:"code",properties:{},children:x};for(const w of o)v=w?.code?.call(g,v)||v;i.children=[];for(let w=0;w<v.children.length;w++){w>0&&i.children.push({type:"element",tagName:"br",properties:{},children:[]});const N=v.children[w];N.type==="element"&&i.children.push(...N.children)}}let f=i;for(const x of o)f=x?.root?.call(g,f)||f;return r&&vr(f,r),f}function mb(t){return t.map(e=>{const n=[];let r="",o;return e.forEach((a,i)=>{const c=!(a.fontStyle&&(a.fontStyle&et.Underline||a.fontStyle&et.Strikethrough));c&&a.content.match(/^\s+$/)&&e[i+1]?(o===void 0&&(o=a.offset),r+=a.content):r?(c?n.push({...a,offset:o,content:r+a.content}):n.push({content:r,offset:o},a),o=void 0,r=""):n.push(a)}),n})}function hb(t){return t.map(e=>e.flatMap(n=>{if(n.content.match(/^\s+$/))return n;const r=n.content.match(/^(\s*)(.*?)(\s*)$/);if(!r)return n;const[,o,a,i]=r;if(!o&&!i)return n;const l=[{...n,offset:n.offset+o.length,content:a}];return o&&l.unshift({content:o,offset:n.offset}),i&&l.push({content:i,offset:n.offset+o.length+a.length}),l}))}function fb(t){return t.map(e=>{const n=[];for(const r of e){if(n.length===0){n.push({...r});continue}const o=n[n.length-1],a=Wo(o.htmlStyle||sr(o)),i=Wo(r.htmlStyle||sr(r)),l=o.fontStyle&&(o.fontStyle&et.Underline||o.fontStyle&et.Strikethrough),c=r.fontStyle&&(r.fontStyle&et.Underline||r.fontStyle&et.Strikethrough);!l&&!c&&a===i?o.content+=r.content:n.push({...r})}return n})}const gb=Xm;function xb(t,e,n){const r={meta:{},options:n,codeToHast:(a,i)=>or(t,a,i),codeToTokens:(a,i)=>rr(t,a,i)};let o=gb(or(t,e,n,r));for(const a of nr(n))o=a.postprocess?.call(r,o,n)||o;return o}const Qi={light:"#333333",dark:"#bbbbbb"},Yi={light:"#fffffe",dark:"#1e1e1e"},Ji="__shiki_resolved";function za(t){if(t?.[Ji])return t;const e={...t};e.tokenColors&&!e.settings&&(e.settings=e.tokenColors,delete e.tokenColors),e.type||="dark",e.colorReplacements={...e.colorReplacements},e.settings||=[];let{bg:n,fg:r}=e;if(!n||!r){const l=e.settings?e.settings.find(c=>!c.name&&!c.scope):void 0;l?.settings?.foreground&&(r=l.settings.foreground),l?.settings?.background&&(n=l.settings.background),!r&&e?.colors?.["editor.foreground"]&&(r=e.colors["editor.foreground"]),!n&&e?.colors?.["editor.background"]&&(n=e.colors["editor.background"]),r||(r=e.type==="light"?Qi.light:Qi.dark),n||(n=e.type==="light"?Yi.light:Yi.dark),e.fg=r,e.bg=n}e.settings[0]&&e.settings[0].settings&&!e.settings[0].scope||e.settings.unshift({settings:{foreground:e.fg,background:e.bg}});let o=0;const a=new Map;function i(l){if(a.has(l))return a.get(l);o+=1;const c=`#${o.toString(16).padStart(8,"0").toLowerCase()}`;return e.colorReplacements?.[`#${c}`]?i(l):(a.set(l,c),c)}e.settings=e.settings.map(l=>{const c=l.settings?.foreground&&!l.settings.foreground.startsWith("#"),u=l.settings?.background&&!l.settings.background.startsWith("#");if(!c&&!u)return l;const p={...l,settings:{...l.settings}};if(c){const m=i(l.settings.foreground);e.colorReplacements[m]=l.settings.foreground,p.settings.foreground=m}if(u){const m=i(l.settings.background);e.colorReplacements[m]=l.settings.background,p.settings.background=m}return p});for(const l of Object.keys(e.colors||{}))if((l==="editor.foreground"||l==="editor.background"||l.startsWith("terminal.ansi"))&&!e.colors[l]?.startsWith("#")){const c=i(e.colors[l]);e.colorReplacements[c]=e.colors[l],e.colors[l]=c}return Object.defineProperty(e,Ji,{enumerable:!1,writable:!1,value:!0}),e}async function qd(t){return Array.from(new Set((await Promise.all(t.filter(e=>!Fd(e)).map(async e=>await zd(e).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function Wd(t){return(await Promise.all(t.map(async n=>Vd(n)?null:za(await zd(n))))).filter(n=>!!n)}let bb=3;function yb(t,e=3){e>bb||console.trace(`[SHIKI DEPRECATE]: ${t}`)}let ws=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function Kd(t,e){if(!e)return t;if(e[t]){const n=new Set([t]);for(;e[t];){if(t=e[t],n.has(t))throw new ws(`Circular alias \`${Array.from(n).join(" -> ")} -> ${t}\``);n.add(t)}}return t}class vb extends Dx{constructor(e,n,r,o={}){super(e),this._resolver=e,this._themes=n,this._langs=r,this._alias=o,this._themes.map(a=>this.loadTheme(a)),this.loadLanguages(this._langs)}_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;getTheme(e){return typeof e=="string"?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){const n=za(e);return n.name&&(this._resolvedThemes.set(n.name,n),this._loadedThemesCache=null),n}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(e){let n=this._textmateThemeCache.get(e);n||(n=Yn.createFromRawTheme(e),this._textmateThemeCache.set(e,n)),this._syncRegistry.setTheme(n)}getGrammar(e){return e=Kd(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;const n=new Set([...this._langMap.values()].filter(a=>a.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);const r={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);const o=this.loadGrammarWithConfiguration(e.scopeName,1,r);if(o.name=e.name,this._resolvedGrammars.set(e.name,o),e.aliases&&e.aliases.forEach(a=>{this._alias[a]=e.name}),this._loadedLanguagesCache=null,n.size)for(const a of n)this._resolvedGrammars.delete(a.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(a.scopeName),this._syncRegistry?._grammars?.delete(a.scopeName),this.loadLanguage(this._langMap.get(a.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(const o of e)this.resolveEmbeddedLanguages(o);const n=Array.from(this._langGraph.entries()),r=n.filter(([o,a])=>!a);if(r.length){const o=n.filter(([a,i])=>i?(i.embeddedLanguages||i.embeddedLangs)?.some(c=>r.map(([u])=>u).includes(c)):!1).filter(a=>!r.includes(a));throw new ws(`Missing languages ${r.map(([a])=>`\`${a}\``).join(", ")}, required by ${o.map(([a])=>`\`${a}\``).join(", ")}`)}for(const[o,a]of n)this._resolver.addLanguage(a);for(const[o,a]of n)this.loadLanguage(a)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);const n=e.embeddedLanguages??e.embeddedLangs;if(n)for(const r of n)this._langGraph.set(r,this._langMap.get(r))}}class wb{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,n){this._onigLib={createOnigScanner:r=>e.createScanner(r),createOnigString:r=>e.createString(r)},n.forEach(r=>this.addLanguage(r))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(n=>{this._langs.set(n,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(n=>{this._injections.get(n)||this._injections.set(n,[]),this._injections.get(n).push(e.scopeName)})}getInjections(e){const n=e.split(".");let r=[];for(let o=1;o<=n.length;o++){const a=n.slice(0,o).join(".");r=[...r,...this._injections.get(a)||[]]}return r}}let Vs=0;function _b(t){Vs+=1,t.warnings!==!1&&Vs>=10&&Vs%10===0&&console.warn(`[Shiki] ${Vs} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let e=!1;if(!t.engine)throw new ws("`engine` option is required for synchronous mode");const n=(t.langs||[]).flat(1),r=(t.themes||[]).flat(1).map(za),o=new wb(t.engine,n),a=new vb(o,r,n,t.langAlias);let i;function l(w){return Kd(w,t.langAlias)}function c(w){y();const N=a.getGrammar(typeof w=="string"?w:w.name);if(!N)throw new ws(`Language \`${w}\` not found, you may need to load it first`);return N}function u(w){if(w==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};y();const N=a.getTheme(w);if(!N)throw new ws(`Theme \`${w}\` not found, you may need to load it first`);return N}function p(w){y();const N=u(w);i!==w&&(a.setTheme(N),i=w);const C=a.getColorMap();return{theme:N,colorMap:C}}function m(){return y(),a.getLoadedThemes()}function h(){return y(),a.getLoadedLanguages()}function g(...w){y(),a.loadLanguages(w.flat(1))}async function f(...w){return g(await qd(w))}function x(...w){y();for(const N of w.flat(1))a.loadTheme(N)}async function b(...w){return y(),x(await Wd(w))}function y(){if(e)throw new ws("Shiki instance has been disposed")}function v(){e||(e=!0,a.dispose(),Vs-=1)}return{setTheme:p,getTheme:u,getLanguage:c,getLoadedThemes:m,getLoadedLanguages:h,resolveLangAlias:l,loadLanguage:f,loadLanguageSync:g,loadTheme:b,loadThemeSync:x,dispose:v,[Symbol.dispose]:v}}async function kb(t){t.engine||yb("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[e,n,r]=await Promise.all([Wd(t.themes||[]),qd(t.langs||[]),t.engine]);return _b({...t,themes:e,langs:n,engine:r})}async function jb(t){const e=await kb(t);return{getLastGrammarState:(...n)=>ob(e,...n),codeToTokensBase:(n,r)=>Da(e,n,r),codeToTokensWithThemes:(n,r)=>Hd(e,n,r),codeToTokens:(n,r)=>rr(e,n,r),codeToHast:(n,r)=>or(e,n,r),codeToHtml:(n,r)=>xb(e,n,r),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...e,getInternalContext:()=>e}}function Nb(t){const e=t.langs,n=t.themes,r=t.engine;async function o(a){function i(m){if(typeof m=="string"){if(m=a.langAlias?.[m]||m,Fd(m))return[];const h=e[m];if(!h)throw new ze(`Language \`${m}\` is not included in this bundle. You may want to load it from external source.`);return h}return m}function l(m){if(Vd(m))return"none";if(typeof m=="string"){const h=n[m];if(!h)throw new ze(`Theme \`${m}\` is not included in this bundle. You may want to load it from external source.`);return h}return m}const c=(a.themes??[]).map(m=>l(m)),u=(a.langs??[]).map(m=>i(m)),p=await jb({engine:a.engine??r(),...a,themes:c,langs:u});return{...p,loadLanguage(...m){return p.loadLanguage(...m.map(i))},loadTheme(...m){return p.loadTheme(...m.map(l))},getBundledLanguages(){return e},getBundledThemes(){return n}}}return o}function Cb(t){let e;async function n(r={}){if(e){const o=await e;return await Promise.all([o.loadTheme(...r.themes||[]),o.loadLanguage(...r.langs||[])]),o}else{e=t({...r,themes:[],langs:[]});const o=await e;return await Promise.all([o.loadTheme(...r.themes||[]),o.loadLanguage(...r.langs||[])]),o}}return n}function Sb(t,e){const n=Cb(t);async function r(o,a){const i=await n({langs:[a.lang],themes:"theme"in a?[a.theme]:Object.values(a.themes)}),l=await e?.guessEmbeddedLanguages?.(o,a.lang,i);return l&&await i.loadLanguage(...l),i}return{getSingletonHighlighter(o){return n(o)},async codeToHtml(o,a){return(await r(o,a)).codeToHtml(o,a)},async codeToHast(o,a){return(await r(o,a)).codeToHast(o,a)},async codeToTokens(o,a){return(await r(o,a)).codeToTokens(o,a)},async codeToTokensBase(o,a){return(await r(o,a)).codeToTokensBase(o,a)},async codeToTokensWithThemes(o,a){return(await r(o,a)).codeToTokensWithThemes(o,a)},async getLastGrammarState(o,a){return(await n({langs:[a.lang],themes:[a.theme]})).getLastGrammarState(o,a)}}}const Qd=[{id:"abap",name:"ABAP",import:(()=>_(()=>import("./abap-BdImnpbu.js"),[]))},{id:"actionscript-3",name:"ActionScript",import:(()=>_(()=>import("./actionscript-3-CoDkCxhg.js"),[]))},{id:"ada",name:"Ada",import:(()=>_(()=>import("./ada-bCR0ucgS.js"),[]))},{id:"angular-html",name:"Angular HTML",import:(()=>_(()=>import("./angular-html-CU67Zn6k.js").then(t=>t.f),__vite__mapDeps([0,1,2,3])))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>_(()=>import("./angular-ts-BwZT4LLn.js"),__vite__mapDeps([4,0,1,2,3,5])))},{id:"apache",name:"Apache Conf",import:(()=>_(()=>import("./apache-Pmp26Uib.js"),[]))},{id:"apex",name:"Apex",import:(()=>_(()=>import("./apex-D8_7TLub.js"),[]))},{id:"apl",name:"APL",import:(()=>_(()=>import("./apl-dKokRX4l.js"),__vite__mapDeps([6,1,2,3,7,8,9])))},{id:"applescript",name:"AppleScript",import:(()=>_(()=>import("./applescript-Co6uUVPk.js"),[]))},{id:"ara",name:"Ara",import:(()=>_(()=>import("./ara-BRHolxvo.js"),[]))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>_(()=>import("./asciidoc-Ve4PFQV2.js"),[]))},{id:"asm",name:"Assembly",import:(()=>_(()=>import("./asm-D_Q5rh1f.js"),[]))},{id:"astro",name:"Astro",import:(()=>_(()=>import("./astro-CbQHKStN.js"),__vite__mapDeps([10,9,2,11,3,12,13])))},{id:"awk",name:"AWK",import:(()=>_(()=>import("./awk-DMzUqQB5.js"),[]))},{id:"ballerina",name:"Ballerina",import:(()=>_(()=>import("./ballerina-BFfxhgS-.js"),[]))},{id:"bat",name:"Batch File",aliases:["batch"],import:(()=>_(()=>import("./bat-BkioyH1T.js"),[]))},{id:"beancount",name:"Beancount",import:(()=>_(()=>import("./beancount-k_qm7-4y.js"),[]))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>_(()=>import("./berry-uYugtg8r.js"),[]))},{id:"bibtex",name:"BibTeX",import:(()=>_(()=>import("./bibtex-CHM0blh-.js"),[]))},{id:"bicep",name:"Bicep",import:(()=>_(()=>import("./bicep-Bmn6On1c.js"),[]))},{id:"bird2",name:"BIRD2 Configuration",aliases:["bird"],import:(()=>_(()=>import("./bird2-DPOp833l.js"),[]))},{id:"blade",name:"Blade",import:(()=>_(()=>import("./blade-D4QpJJKB.js"),__vite__mapDeps([14,15,1,2,3,7,8,16,9])))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:(()=>_(()=>import("./bsl-BO_Y6i37.js"),__vite__mapDeps([17,18])))},{id:"c",name:"C",import:(()=>_(()=>import("./c-BIGW1oBm.js"),[]))},{id:"c3",name:"C3",import:(()=>_(()=>import("./c3-eo99z4R2.js"),[]))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>_(()=>import("./cadence-Bv_4Rxtq.js"),[]))},{id:"cairo",name:"Cairo",import:(()=>_(()=>import("./cairo-KRGpt6FW.js"),__vite__mapDeps([19,20])))},{id:"clarity",name:"Clarity",import:(()=>_(()=>import("./clarity-D53aC0YG.js"),[]))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>_(()=>import("./clojure-P80f7IUj.js"),[]))},{id:"cmake",name:"CMake",import:(()=>_(()=>import("./cmake-D1j8_8rp.js"),[]))},{id:"cobol",name:"COBOL",import:(()=>_(()=>import("./cobol-nwyudZeR.js"),__vite__mapDeps([21,1,2,3,8])))},{id:"codeowners",name:"CODEOWNERS",import:(()=>_(()=>import("./codeowners-Bp6g37R7.js"),[]))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>_(()=>import("./codeql-DsOJ9woJ.js"),[]))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>_(()=>import("./coffee-Ch7k5sss.js"),__vite__mapDeps([22,2])))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>_(()=>import("./common-lisp-Cg-RD9OK.js"),[]))},{id:"coq",name:"Coq",import:(()=>_(()=>import("./coq-DkFqJrB1.js"),[]))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>_(()=>import("./cpp-CofmeUqb.js"),__vite__mapDeps([23,24,25,26,16])))},{id:"crystal",name:"Crystal",import:(()=>_(()=>import("./crystal-tKQVLTB8.js"),__vite__mapDeps([27,1,2,3,16,26,28])))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>_(()=>import("./csharp-COcwbKMJ.js"),[]))},{id:"css",name:"CSS",import:(()=>_(()=>import("./css-DPfMkruS.js"),[]))},{id:"csv",name:"CSV",import:(()=>_(()=>import("./csv-fuZLfV_i.js"),[]))},{id:"cue",name:"CUE",import:(()=>_(()=>import("./cue-D82EKSYY.js"),[]))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>_(()=>import("./cypher-COkxafJQ.js"),[]))},{id:"d",name:"D",import:(()=>_(()=>import("./d-85-TOEBH.js"),[]))},{id:"dart",name:"Dart",import:(()=>_(()=>import("./dart-CF10PKvl.js"),[]))},{id:"dax",name:"DAX",import:(()=>_(()=>import("./dax-CEL-wOlO.js"),[]))},{id:"desktop",name:"Desktop",import:(()=>_(()=>import("./desktop-BmXAJ9_W.js"),[]))},{id:"diff",name:"Diff",import:(()=>_(()=>import("./diff-D97Zzqfu.js"),[]))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>_(()=>import("./docker-BcOcwvcX.js"),[]))},{id:"dotenv",name:"dotEnv",import:(()=>_(()=>import("./dotenv-Da5cRb03.js"),[]))},{id:"dream-maker",name:"Dream Maker",import:(()=>_(()=>import("./dream-maker-BtqSS_iP.js"),[]))},{id:"edge",name:"Edge",import:(()=>_(()=>import("./edge-BkV0erSs.js"),__vite__mapDeps([29,11,1,2,3,15])))},{id:"elixir",name:"Elixir",import:(()=>_(()=>import("./elixir-CDX3lj18.js"),__vite__mapDeps([30,1,2,3])))},{id:"elm",name:"Elm",import:(()=>_(()=>import("./elm-DbKCFpqz.js"),__vite__mapDeps([31,25,26])))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>_(()=>import("./emacs-lisp-C9XAeP06.js"),[]))},{id:"erb",name:"ERB",import:(()=>_(()=>import("./erb-B12qg9BL.js"),__vite__mapDeps([32,1,2,3,33,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38])))},{id:"erlang",name:"Erlang",aliases:["erl"],import:(()=>_(()=>import("./erlang-DsQrWhSR.js"),__vite__mapDeps([39,40])))},{id:"fennel",name:"Fennel",import:(()=>_(()=>import("./fennel-BYunw83y.js"),[]))},{id:"fish",name:"Fish",import:(()=>_(()=>import("./fish-BvzEVeQv.js"),[]))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>_(()=>import("./fluent-C4IJs8-o.js"),[]))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>_(()=>import("./fortran-fixed-form-CkoXwp7k.js"),__vite__mapDeps([41,42])))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:(()=>_(()=>import("./fortran-free-form-BxgE0vQu.js"),[]))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>_(()=>import("./fsharp-CXgrBDvD.js"),__vite__mapDeps([43,40])))},{id:"gdresource",name:"GDResource",aliases:["tscn","tres"],import:(()=>_(()=>import("./gdresource-BOOCDP_w.js"),__vite__mapDeps([44,45,46])))},{id:"gdscript",name:"GDScript",aliases:["gd"],import:(()=>_(()=>import("./gdscript-C5YyOfLZ.js"),[]))},{id:"gdshader",name:"GDShader",import:(()=>_(()=>import("./gdshader-DkwncUOv.js"),[]))},{id:"genie",name:"Genie",import:(()=>_(()=>import("./genie-D0YGMca9.js"),[]))},{id:"gherkin",name:"Gherkin",import:(()=>_(()=>import("./gherkin-DyxjwDmM.js"),[]))},{id:"git-commit",name:"Git Commit Message",import:(()=>_(()=>import("./git-commit-F4YmCXRG.js"),__vite__mapDeps([47,48])))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>_(()=>import("./git-rebase-r7XF79zn.js"),__vite__mapDeps([49,28])))},{id:"gleam",name:"Gleam",import:(()=>_(()=>import("./gleam-BspZqrRM.js"),[]))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>_(()=>import("./glimmer-js-Rg0-pVw9.js"),__vite__mapDeps([50,2,11,3,1])))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>_(()=>import("./glimmer-ts-U6CK756n.js"),__vite__mapDeps([51,11,3,2,1])))},{id:"glsl",name:"GLSL",import:(()=>_(()=>import("./glsl-DplSGwfg.js"),__vite__mapDeps([25,26])))},{id:"gn",name:"GN",import:(()=>_(()=>import("./gn-n2N0HUVH.js"),[]))},{id:"gnuplot",name:"Gnuplot",import:(()=>_(()=>import("./gnuplot-DdkO51Og.js"),[]))},{id:"go",name:"Go",import:(()=>_(()=>import("./go-CxLEBnE3.js"),[]))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>_(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([35,2,11,36,13])))},{id:"groovy",name:"Groovy",import:(()=>_(()=>import("./groovy-gcz8RCvz.js"),[]))},{id:"hack",name:"Hack",import:(()=>_(()=>import("./hack-CaT9iCJl.js"),__vite__mapDeps([52,1,2,3,16])))},{id:"haml",name:"Ruby Haml",import:(()=>_(()=>import("./haml-B8DHNrY2.js"),__vite__mapDeps([34,2,3])))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>_(()=>import("./handlebars-BL8al0AC.js"),__vite__mapDeps([53,1,2,3,38])))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>_(()=>import("./haskell-Df6bDoY_.js"),[]))},{id:"haxe",name:"Haxe",import:(()=>_(()=>import("./haxe-CzTSHFRz.js"),[]))},{id:"hcl",name:"HashiCorp HCL",import:(()=>_(()=>import("./hcl-BWvSN4gD.js"),[]))},{id:"hjson",name:"Hjson",import:(()=>_(()=>import("./hjson-D5-asLiD.js"),[]))},{id:"hlsl",name:"HLSL",import:(()=>_(()=>import("./hlsl-D3lLCCz7.js"),[]))},{id:"html",name:"HTML",import:(()=>_(()=>import("./html-GMplVEZG.js"),__vite__mapDeps([1,2,3])))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>_(()=>import("./html-derivative-BFtXZ54Q.js"),__vite__mapDeps([15,1,2,3])))},{id:"http",name:"HTTP",import:(()=>_(()=>import("./http-jrhK8wxY.js"),__vite__mapDeps([54,28,9,7,8,35,2,11,36,13])))},{id:"hurl",name:"Hurl",import:(()=>_(()=>import("./hurl-irOxFIW8.js"),__vite__mapDeps([55,35,2,11,36,13,7,8,56])))},{id:"hxml",name:"HXML",import:(()=>_(()=>import("./hxml-Bvhsp5Yf.js"),__vite__mapDeps([57,58])))},{id:"hy",name:"Hy",import:(()=>_(()=>import("./hy-DFXneXwc.js"),[]))},{id:"imba",name:"Imba",import:(()=>_(()=>import("./imba-DGztddWO.js"),[]))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>_(()=>import("./ini-BEwlwnbL.js"),[]))},{id:"java",name:"Java",import:(()=>_(()=>import("./java-CylS5w8V.js"),[]))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>_(()=>import("./javascript-wDzz0qaB.js"),[]))},{id:"jinja",name:"Jinja",import:(()=>_(()=>import("./jinja-4LBKfQ-Z.js"),__vite__mapDeps([59,1,2,3])))},{id:"jison",name:"Jison",import:(()=>_(()=>import("./jison-wvAkD_A8.js"),__vite__mapDeps([60,2])))},{id:"json",name:"JSON",import:(()=>_(()=>import("./json-Cp-IABpG.js"),[]))},{id:"json5",name:"JSON5",import:(()=>_(()=>import("./json5-C9tS-k6U.js"),[]))},{id:"jsonc",name:"JSON with Comments",import:(()=>_(()=>import("./jsonc-Des-eS-w.js"),[]))},{id:"jsonl",name:"JSON Lines",import:(()=>_(()=>import("./jsonl-DcaNXYhu.js"),[]))},{id:"jsonnet",name:"Jsonnet",import:(()=>_(()=>import("./jsonnet-DFQXde-d.js"),[]))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>_(()=>import("./jssm-C2t-YnRu.js"),[]))},{id:"jsx",name:"JSX",import:(()=>_(()=>import("./jsx-g9-lgVsj.js"),[]))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>_(()=>import("./julia-CxzCAyBv.js"),__vite__mapDeps([61,23,24,25,26,16,20,2,62])))},{id:"just",name:"Just",import:(()=>_(()=>import("./just-Cw27pwNe.js"),__vite__mapDeps([63,28,2,11,64,1,3,7,8,16,20,33,34,35,36,13,23,24,25,26,37,38])))},{id:"kdl",name:"KDL",import:(()=>_(()=>import("./kdl-DV7GczEv.js"),[]))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>_(()=>import("./kotlin-BdnUsdx6.js"),[]))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>_(()=>import("./kusto-DZf3V79B.js"),[]))},{id:"latex",name:"LaTeX",import:(()=>_(()=>import("./latex-CWtU0Tv5.js"),__vite__mapDeps([65,66,62])))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>_(()=>import("./lean-BZvkOJ9d.js"),[]))},{id:"less",name:"Less",import:(()=>_(()=>import("./less-B1dDrJ26.js"),[]))},{id:"liquid",name:"Liquid",import:(()=>_(()=>import("./liquid-DYVedYrR.js"),__vite__mapDeps([67,1,2,3,9])))},{id:"llvm",name:"LLVM IR",import:(()=>_(()=>import("./llvm-DjAJT7YJ.js"),[]))},{id:"log",name:"Log file",import:(()=>_(()=>import("./log-2UxHyX5q.js"),[]))},{id:"logo",name:"Logo",import:(()=>_(()=>import("./logo-BtOb2qkB.js"),[]))},{id:"lua",name:"Lua",import:(()=>_(()=>import("./lua-BaeVxFsk.js"),__vite__mapDeps([37,26])))},{id:"luau",name:"Luau",import:(()=>_(()=>import("./luau-C-HG3fhB.js"),[]))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>_(()=>import("./make-CHLpvVh8.js"),[]))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>_(()=>import("./markdown-Cvjx9yec.js"),[]))},{id:"marko",name:"Marko",import:(()=>_(()=>import("./marko-CnJfTvn9.js"),__vite__mapDeps([68,3,69,5,11])))},{id:"matlab",name:"MATLAB",import:(()=>_(()=>import("./matlab-D7o27uSR.js"),[]))},{id:"mdc",name:"MDC",import:(()=>_(()=>import("./mdc-BMNejdWA.js"),__vite__mapDeps([70,40,38,15,1,2,3])))},{id:"mdx",name:"MDX",import:(()=>_(()=>import("./mdx-Cmh6b_Ma.js"),[]))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>_(()=>import("./mermaid-mWjccvbQ.js"),[]))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>_(()=>import("./mipsasm-CKIfxQSi.js"),[]))},{id:"mojo",name:"Mojo",import:(()=>_(()=>import("./mojo-rZm6bMo-.js"),[]))},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:(()=>_(()=>import("./moonbit-_H4v1dQx.js"),[]))},{id:"move",name:"Move",import:(()=>_(()=>import("./move-IF9eRakj.js"),[]))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>_(()=>import("./narrat-DRg8JJMk.js"),[]))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>_(()=>import("./nextflow-Zz6hmt5N.js"),__vite__mapDeps([71,72])))},{id:"nextflow-groovy",name:"nextflow-groovy",import:(()=>_(()=>import("./nextflow-groovy-BeH2EWoN.js"),[]))},{id:"nginx",name:"Nginx",import:(()=>_(()=>import("./nginx-BpAMiNFr.js"),__vite__mapDeps([73,37,26])))},{id:"nim",name:"Nim",import:(()=>_(()=>import("./nim-CVrawwO9.js"),__vite__mapDeps([74,26,1,2,3,7,8,25,40])))},{id:"nix",name:"Nix",import:(()=>_(()=>import("./nix-CwoSXNpI.js"),[]))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>_(()=>import("./nushell-Cz2AlsmD.js"),[]))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>_(()=>import("./objective-c-DXmwc3jG.js"),[]))},{id:"objective-cpp",name:"Objective-C++",import:(()=>_(()=>import("./objective-cpp-CLxacb5B.js"),[]))},{id:"ocaml",name:"OCaml",import:(()=>_(()=>import("./ocaml-C0hk2d4L.js"),[]))},{id:"odin",name:"Odin",import:(()=>_(()=>import("./odin-BBf5iR-q.js"),[]))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>_(()=>import("./openscad-C4EeE6gA.js"),[]))},{id:"pascal",name:"Pascal",import:(()=>_(()=>import("./pascal-D93ZcfNL.js"),[]))},{id:"perl",name:"Perl",import:(()=>_(()=>import("./perl-C0TMdlhV.js"),__vite__mapDeps([64,1,2,3,7,8,16])))},{id:"php",name:"PHP",import:(()=>_(()=>import("./php-Dhbhpdrm.js"),__vite__mapDeps([75,1,2,3,7,8,16,9])))},{id:"pkl",name:"Pkl",import:(()=>_(()=>import("./pkl-u5AG7uiY.js"),[]))},{id:"plsql",name:"PL/SQL",import:(()=>_(()=>import("./plsql-ChMvpjG-.js"),[]))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>_(()=>import("./po-BTJTHyun.js"),[]))},{id:"polar",name:"Polar",import:(()=>_(()=>import("./polar-C0HS_06l.js"),[]))},{id:"postcss",name:"PostCSS",import:(()=>_(()=>import("./postcss-CXtECtnM.js"),[]))},{id:"powerquery",name:"PowerQuery",import:(()=>_(()=>import("./powerquery-CEu0bR-o.js"),[]))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:(()=>_(()=>import("./powershell-Dpen1YoG.js"),[]))},{id:"prisma",name:"Prisma",import:(()=>_(()=>import("./prisma-Dd19v3D-.js"),[]))},{id:"prolog",name:"Prolog",import:(()=>_(()=>import("./prolog-CbFg5uaA.js"),[]))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>_(()=>import("./proto-C7zT0LnQ.js"),[]))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>_(()=>import("./pug-CGlum2m_.js"),__vite__mapDeps([76,2,3,1])))},{id:"puppet",name:"Puppet",import:(()=>_(()=>import("./puppet-BMWR74SV.js"),[]))},{id:"purescript",name:"PureScript",import:(()=>_(()=>import("./purescript-CklMAg4u.js"),[]))},{id:"python",name:"Python",aliases:["py"],import:(()=>_(()=>import("./python-B6aJPvgy.js"),[]))},{id:"qml",name:"QML",import:(()=>_(()=>import("./qml-3beO22l8.js"),__vite__mapDeps([77,2])))},{id:"qmldir",name:"QML Directory",import:(()=>_(()=>import("./qmldir-C8lEn-DE.js"),[]))},{id:"qss",name:"Qt Style Sheets",import:(()=>_(()=>import("./qss-IeuSbFQv.js"),[]))},{id:"r",name:"R",import:(()=>_(()=>import("./r-Dspwwk_N.js"),[]))},{id:"racket",name:"Racket",import:(()=>_(()=>import("./racket-BqYA7rlc.js"),[]))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>_(()=>import("./raku-DXvB9xmW.js"),[]))},{id:"razor",name:"ASP.NET Razor",import:(()=>_(()=>import("./razor-Uh8Bk_45.js"),__vite__mapDeps([78,1,2,3,79])))},{id:"reg",name:"Windows Registry Script",import:(()=>_(()=>import("./reg-C-SQnVFl.js"),[]))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>_(()=>import("./regexp-CDVJQ6XC.js"),[]))},{id:"rel",name:"Rel",import:(()=>_(()=>import("./rel-C3B-1QV4.js"),[]))},{id:"riscv",name:"RISC-V",import:(()=>_(()=>import("./riscv-BM1_JUlF.js"),[]))},{id:"ron",name:"RON",import:(()=>_(()=>import("./ron-D8l8udqQ.js"),[]))},{id:"rosmsg",name:"ROS Interface",import:(()=>_(()=>import("./rosmsg-BJDFO7_C.js"),[]))},{id:"rst",name:"reStructuredText",import:(()=>_(()=>import("./rst-BrH8l1NY.js"),__vite__mapDeps([80,15,1,2,3,23,24,25,26,16,20,28,38,81,33,34,7,8,35,11,36,13,37])))},{id:"ruby",name:"Ruby",aliases:["rb"],import:(()=>_(()=>import("./ruby-Dw2BHqvy.js"),__vite__mapDeps([33,1,2,3,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38])))},{id:"rust",name:"Rust",aliases:["rs"],import:(()=>_(()=>import("./rust-B1yitclQ.js"),[]))},{id:"sas",name:"SAS",import:(()=>_(()=>import("./sas-cz2c8ADy.js"),__vite__mapDeps([82,16])))},{id:"sass",name:"Sass",import:(()=>_(()=>import("./sass-Cj5Yp3dK.js"),[]))},{id:"scala",name:"Scala",import:(()=>_(()=>import("./scala-C151Ov-r.js"),[]))},{id:"scheme",name:"Scheme",import:(()=>_(()=>import("./scheme-C98Dy4si.js"),[]))},{id:"scss",name:"SCSS",import:(()=>_(()=>import("./scss-OYdSNvt2.js"),__vite__mapDeps([5,3])))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>_(()=>import("./sdbl-DVxCFoDh.js"),[]))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>_(()=>import("./shaderlab-Dg9Lc6iA.js"),__vite__mapDeps([83,84])))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>_(()=>import("./shellscript-Yzrsuije.js"),[]))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>_(()=>import("./shellsession-BADoaaVG.js"),__vite__mapDeps([85,28])))},{id:"smalltalk",name:"Smalltalk",import:(()=>_(()=>import("./smalltalk-BERRCDM3.js"),[]))},{id:"solidity",name:"Solidity",import:(()=>_(()=>import("./solidity-rGO070M0.js"),[]))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>_(()=>import("./soy-Brmx7dQM.js"),__vite__mapDeps([86,1,2,3])))},{id:"sparql",name:"SPARQL",import:(()=>_(()=>import("./sparql-rVzFXLq3.js"),__vite__mapDeps([87,88])))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>_(()=>import("./splunk-BtCnVYZw.js"),[]))},{id:"sql",name:"SQL",import:(()=>_(()=>import("./sql-BLtJtn59.js"),[]))},{id:"ssh-config",name:"SSH Config",import:(()=>_(()=>import("./ssh-config-_ykCGR6B.js"),[]))},{id:"stata",name:"Stata",import:(()=>_(()=>import("./stata-BH5u7GGu.js"),__vite__mapDeps([89,16])))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>_(()=>import("./stylus-BEDo0Tqx.js"),[]))},{id:"surrealql",name:"SurrealQL",aliases:["surql"],import:(()=>_(()=>import("./surrealql-Bq5Q-fJD.js"),__vite__mapDeps([90,2])))},{id:"svelte",name:"Svelte",import:(()=>_(()=>import("./svelte-C_ipcX3V.js"),__vite__mapDeps([91,2,11,3,12])))},{id:"swift",name:"Swift",import:(()=>_(()=>import("./swift-D82vCrfD.js"),[]))},{id:"system-verilog",name:"SystemVerilog",import:(()=>_(()=>import("./system-verilog-CnnmHF94.js"),[]))},{id:"systemd",name:"Systemd Units",import:(()=>_(()=>import("./systemd-4A_iFExJ.js"),[]))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>_(()=>import("./talonscript-CkByrt1z.js"),[]))},{id:"tasl",name:"Tasl",import:(()=>_(()=>import("./tasl-QIJgUcNo.js"),[]))},{id:"tcl",name:"Tcl",import:(()=>_(()=>import("./tcl-dwOrl1Do.js"),[]))},{id:"templ",name:"Templ",import:(()=>_(()=>import("./templ-P3uqSqPl.js"),__vite__mapDeps([92,93,2,3])))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>_(()=>import("./terraform-BETggiCN.js"),[]))},{id:"tex",name:"TeX",import:(()=>_(()=>import("./tex-idrVyKtj.js"),__vite__mapDeps([66,62])))},{id:"toml",name:"TOML",import:(()=>_(()=>import("./toml-vGWfd6FD.js"),[]))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>_(()=>import("./ts-tags-zn1MmPIZ.js"),__vite__mapDeps([94,11,3,2,25,26,1,16,7,8])))},{id:"tsv",name:"TSV",import:(()=>_(()=>import("./tsv-B_m7g4N7.js"),[]))},{id:"tsx",name:"TSX",import:(()=>_(()=>import("./tsx-COt5Ahok.js"),[]))},{id:"turtle",name:"Turtle",import:(()=>_(()=>import("./turtle-BsS91CYL.js"),[]))},{id:"twig",name:"Twig",import:(()=>_(()=>import("./twig-DNn4PbVi.js"),__vite__mapDeps([95,3,2,5,75,1,7,8,16,9,20,33,34,35,11,36,13,23,24,25,26,28,37,38])))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>_(()=>import("./typescript-BPQ3VLAy.js"),[]))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>_(()=>import("./typespec-BGHnOYBU.js"),[]))},{id:"typst",name:"Typst",aliases:["typ"],import:(()=>_(()=>import("./typst-DHCkPAjA.js"),[]))},{id:"v",name:"V",import:(()=>_(()=>import("./v-BcVCzyr7.js"),[]))},{id:"vala",name:"Vala",import:(()=>_(()=>import("./vala-CsfeWuGM.js"),[]))},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:(()=>_(()=>import("./vb-D17OF-Vu.js"),[]))},{id:"verilog",name:"Verilog",import:(()=>_(()=>import("./verilog-BQ8w6xss.js"),[]))},{id:"vhdl",name:"VHDL",import:(()=>_(()=>import("./vhdl-CeAyd5Ju.js"),[]))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>_(()=>import("./viml-CJc9bBzg.js"),[]))},{id:"vue",name:"Vue",import:(()=>_(()=>import("./vue-DN_0RTcg.js"),__vite__mapDeps([96,3,2,11,9,1,15])))},{id:"vue-html",name:"Vue HTML",import:(()=>_(()=>import("./vue-html-AaS7Mt5G.js"),__vite__mapDeps([97,2])))},{id:"vue-vine",name:"Vue Vine",import:(()=>_(()=>import("./vue-vine-CQOfvN7w.js"),__vite__mapDeps([98,3,5,69,99,12,2])))},{id:"vyper",name:"Vyper",aliases:["vy"],import:(()=>_(()=>import("./vyper-CDx5xZoG.js"),[]))},{id:"wasm",name:"WebAssembly",import:(()=>_(()=>import("./wasm-MzD3tlZU.js"),[]))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>_(()=>import("./wenyan-BV7otONQ.js"),[]))},{id:"wgsl",name:"WGSL",import:(()=>_(()=>import("./wgsl-Dx-B1_4e.js"),[]))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>_(()=>import("./wikitext-BhOHFoWU.js"),[]))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>_(()=>import("./wit-5i3qLPDT.js"),[]))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>_(()=>import("./wolfram-lXgVvXCa.js"),[]))},{id:"xml",name:"XML",import:(()=>_(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([7,8])))},{id:"xsl",name:"XSL",import:(()=>_(()=>import("./xsl-CtQFsRM5.js"),__vite__mapDeps([100,7,8])))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>_(()=>import("./yaml-Buea-lGh.js"),[]))},{id:"zenscript",name:"ZenScript",import:(()=>_(()=>import("./zenscript-DVFEvuxE.js"),[]))},{id:"zig",name:"Zig",import:(()=>_(()=>import("./zig-VOosw3JB.js"),[]))}],Eb=Object.fromEntries(Qd.map(t=>[t.id,t.import])),Tb=Object.fromEntries(Qd.flatMap(t=>t.aliases?.map(e=>[e,t.import])||[])),Ib={...Eb,...Tb},Ab=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>_(()=>import("./andromeeda-C4gqWexZ.js"),[]))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>_(()=>import("./aurora-x-D-2ljcwZ.js"),[]))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>_(()=>import("./ayu-dark-DYE7WIF3.js"),[]))},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:(()=>_(()=>import("./ayu-light-BA47KaF1.js"),[]))},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:(()=>_(()=>import("./ayu-mirage-32ctXXKs.js"),[]))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>_(()=>import("./catppuccin-frappe-DFWUc33u.js"),[]))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>_(()=>import("./catppuccin-latte-C9dUb6Cb.js"),[]))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>_(()=>import("./catppuccin-macchiato-DQyhUUbL.js"),[]))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>_(()=>import("./catppuccin-mocha-D87Tk5Gz.js"),[]))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>_(()=>import("./dark-plus-C3mMm8J8.js"),[]))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>_(()=>import("./dracula-BzJJZx-M.js"),[]))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>_(()=>import("./dracula-soft-BXkSAIEj.js"),[]))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>_(()=>import("./everforest-dark-BgDCqdQA.js"),[]))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>_(()=>import("./everforest-light-C8M2exoo.js"),[]))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>_(()=>import("./github-dark-DHJKELXO.js"),[]))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>_(()=>import("./github-dark-default-Cuk6v7N8.js"),[]))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>_(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[]))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>_(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[]))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>_(()=>import("./github-light-DAi9KRSo.js"),[]))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>_(()=>import("./github-light-default-D7oLnXFd.js"),[]))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>_(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[]))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>_(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[]))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>_(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[]))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>_(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[]))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>_(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[]))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>_(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[]))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>_(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[]))},{id:"horizon",displayName:"Horizon",type:"dark",import:(()=>_(()=>import("./horizon-BUw7H-hv.js"),[]))},{id:"horizon-bright",displayName:"Horizon Bright",type:"dark",import:(()=>_(()=>import("./horizon-bright-Cn-bp-IR.js"),[]))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>_(()=>import("./houston-DnULxvSX.js"),[]))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>_(()=>import("./kanagawa-dragon-CkXjmgJE.js"),[]))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>_(()=>import("./kanagawa-lotus-CfQXZHmo.js"),[]))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>_(()=>import("./kanagawa-wave-DWedfzmr.js"),[]))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>_(()=>import("./laserwave-DUszq2jm.js"),[]))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>_(()=>import("./light-plus-B7mTdjB0.js"),[]))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>_(()=>import("./material-theme-D5KoaKCx.js"),[]))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>_(()=>import("./material-theme-darker-BfHTSMKl.js"),[]))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>_(()=>import("./material-theme-lighter-B0m2ddpp.js"),[]))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>_(()=>import("./material-theme-ocean-CyktbL80.js"),[]))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>_(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[]))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>_(()=>import("./min-dark-CafNBF8u.js"),[]))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>_(()=>import("./min-light-CTRr51gU.js"),[]))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>_(()=>import("./monokai-D4h5O-jR.js"),[]))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>_(()=>import("./night-owl-C39BiMTA.js"),[]))},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:(()=>_(()=>import("./night-owl-light-CMTm3GFP.js"),[]))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>_(()=>import("./nord-Ddv68eIx.js"),[]))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>_(()=>import("./one-dark-pro-DVMEJ2y_.js"),[]))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>_(()=>import("./one-light-C3Wv6jpd.js"),[]))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>_(()=>import("./plastic-3e1v2bzS.js"),[]))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>_(()=>import("./poimandres-CS3Unz2-.js"),[]))},{id:"red",displayName:"Red",type:"dark",import:(()=>_(()=>import("./red-bN70gL4F.js"),[]))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>_(()=>import("./rose-pine-qdsjHGoJ.js"),[]))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>_(()=>import("./rose-pine-dawn-DHQR4-dF.js"),[]))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>_(()=>import("./rose-pine-moon-D4_iv3hh.js"),[]))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>_(()=>import("./slack-dark-BthQWCQV.js"),[]))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>_(()=>import("./slack-ochin-DqwNpetd.js"),[]))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>_(()=>import("./snazzy-light-Bw305WKR.js"),[]))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>_(()=>import("./solarized-dark-DXbdFlpD.js"),[]))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>_(()=>import("./solarized-light-L9t79GZl.js"),[]))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>_(()=>import("./synthwave-84-CbfX1IO0.js"),[]))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>_(()=>import("./tokyo-night-hegEt444.js"),[]))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>_(()=>import("./vesper-DU1UobuO.js"),[]))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>_(()=>import("./vitesse-black-Bkuqu6BP.js"),[]))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>_(()=>import("./vitesse-dark-D0r3Knsf.js"),[]))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>_(()=>import("./vitesse-light-CVO1_9PV.js"),[]))}],Rb=Object.fromEntries(Ab.map(t=>[t.id,t.import]));class Fa extends Error{constructor(e){super(e),this.name="ShikiError"}}function Pb(){return 2147483648}function Mb(){return typeof performance<"u"?performance.now():Date.now()}const Lb=(t,e)=>t+(e-t%e)%e;async function Ob(t){let e,n;const r={};function o(g){n=g,r.HEAPU8=new Uint8Array(g),r.HEAPU32=new Uint32Array(g)}function a(g,f,x){r.HEAPU8.copyWithin(g,f,f+x)}function i(g){try{return e.grow(g-n.byteLength+65535>>>16),o(e.buffer),1}catch{}}function l(g){const f=r.HEAPU8.length;g=g>>>0;const x=Pb();if(g>x)return!1;for(let b=1;b<=4;b*=2){let y=f*(1+.2/b);y=Math.min(y,g+100663296);const v=Math.min(x,Lb(Math.max(g,y),65536));if(i(v))return!0}return!1}const c=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function u(g,f,x=1024){const b=f+x;let y=f;for(;g[y]&&!(y>=b);)++y;if(y-f>16&&g.buffer&&c)return c.decode(g.subarray(f,y));let v="";for(;f<y;){let w=g[f++];if(!(w&128)){v+=String.fromCharCode(w);continue}const N=g[f++]&63;if((w&224)===192){v+=String.fromCharCode((w&31)<<6|N);continue}const C=g[f++]&63;if((w&240)===224?w=(w&15)<<12|N<<6|C:w=(w&7)<<18|N<<12|C<<6|g[f++]&63,w<65536)v+=String.fromCharCode(w);else{const T=w-65536;v+=String.fromCharCode(55296|T>>10,56320|T&1023)}}return v}function p(g,f){return g?u(r.HEAPU8,g,f):""}const m={emscripten_get_now:Mb,emscripten_memcpy_big:a,emscripten_resize_heap:l,fd_write:()=>0};async function h(){const f=await t({env:m,wasi_snapshot_preview1:m});e=f.memory,o(e.buffer),Object.assign(r,f),r.UTF8ToString=p}return await h(),r}var Db=Object.defineProperty,$b=(t,e,n)=>e in t?Db(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ue=(t,e,n)=>$b(t,typeof e!="symbol"?e+"":e,n);let We=null;function zb(t){throw new Fa(t.UTF8ToString(t.getLastOnigError()))}class wr{constructor(e){Ue(this,"utf16Length"),Ue(this,"utf8Length"),Ue(this,"utf16Value"),Ue(this,"utf8Value"),Ue(this,"utf16OffsetToUtf8"),Ue(this,"utf8OffsetToUtf16");const n=e.length,r=wr._utf8ByteLength(e),o=r!==n,a=o?new Uint32Array(n+1):null;o&&(a[n]=r);const i=o?new Uint32Array(r+1):null;o&&(i[r]=n);const l=new Uint8Array(r);let c=0;for(let u=0;u<n;u++){const p=e.charCodeAt(u);let m=p,h=!1;if(p>=55296&&p<=56319&&u+1<n){const g=e.charCodeAt(u+1);g>=56320&&g<=57343&&(m=(p-55296<<10)+65536|g-56320,h=!0)}o&&(a[u]=c,h&&(a[u+1]=c),m<=127?i[c+0]=u:m<=2047?(i[c+0]=u,i[c+1]=u):m<=65535?(i[c+0]=u,i[c+1]=u,i[c+2]=u):(i[c+0]=u,i[c+1]=u,i[c+2]=u,i[c+3]=u)),m<=127?l[c++]=m:m<=2047?(l[c++]=192|(m&1984)>>>6,l[c++]=128|(m&63)>>>0):m<=65535?(l[c++]=224|(m&61440)>>>12,l[c++]=128|(m&4032)>>>6,l[c++]=128|(m&63)>>>0):(l[c++]=240|(m&1835008)>>>18,l[c++]=128|(m&258048)>>>12,l[c++]=128|(m&4032)>>>6,l[c++]=128|(m&63)>>>0),h&&u++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=e,this.utf8Value=l,this.utf16OffsetToUtf8=a,this.utf8OffsetToUtf16=i}static _utf8ByteLength(e){let n=0;for(let r=0,o=e.length;r<o;r++){const a=e.charCodeAt(r);let i=a,l=!1;if(a>=55296&&a<=56319&&r+1<o){const c=e.charCodeAt(r+1);c>=56320&&c<=57343&&(i=(a-55296<<10)+65536|c-56320,l=!0)}i<=127?n+=1:i<=2047?n+=2:i<=65535?n+=3:n+=4,l&&r++}return n}createString(e){const n=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,n),n}}const _r=class vt{constructor(e){if(Ue(this,"id",++vt.LAST_ID),Ue(this,"_onigBinding"),Ue(this,"content"),Ue(this,"utf16Length"),Ue(this,"utf8Length"),Ue(this,"utf16OffsetToUtf8"),Ue(this,"utf8OffsetToUtf16"),Ue(this,"ptr"),!We)throw new Fa("Must invoke loadWasm first.");this._onigBinding=We,this.content=e;const n=new wr(e);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!vt._sharedPtrInUse?(vt._sharedPtr||(vt._sharedPtr=We.omalloc(1e4)),vt._sharedPtrInUse=!0,We.HEAPU8.set(n.utf8Value,vt._sharedPtr),this.ptr=vt._sharedPtr):this.ptr=n.createString(We)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===vt._sharedPtr?vt._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};Ue(_r,"LAST_ID",0);Ue(_r,"_sharedPtr",0);Ue(_r,"_sharedPtrInUse",!1);let Yd=_r;class Fb{constructor(e){if(Ue(this,"_onigBinding"),Ue(this,"_ptr"),!We)throw new Fa("Must invoke loadWasm first.");const n=[],r=[];for(let l=0,c=e.length;l<c;l++){const u=new wr(e[l]);n[l]=u.createString(We),r[l]=u.utf8Length}const o=We.omalloc(4*e.length);We.HEAPU32.set(n,o/4);const a=We.omalloc(4*e.length);We.HEAPU32.set(r,a/4);const i=We.createOnigScanner(o,a,e.length);for(let l=0,c=e.length;l<c;l++)We.ofree(n[l]);We.ofree(a),We.ofree(o),i===0&&zb(We),this._onigBinding=We,this._ptr=i}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,n,r){let o=0;if(typeof r=="number"&&(o=r),typeof e=="string"){e=new Yd(e);const a=this._findNextMatchSync(e,n,!1,o);return e.dispose(),a}return this._findNextMatchSync(e,n,!1,o)}_findNextMatchSync(e,n,r,o){const a=this._onigBinding,i=a.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(n),o);if(i===0)return null;const l=a.HEAPU32;let c=i/4;const u=l[c++],p=l[c++],m=[];for(let h=0;h<p;h++){const g=e.convertUtf8OffsetToUtf16(l[c++]),f=e.convertUtf8OffsetToUtf16(l[c++]);m[h]={start:g,end:f,length:f-g}}return{index:u,captureIndices:m}}}function Vb(t){return typeof t.instantiator=="function"}function Bb(t){return typeof t.default=="function"}function Ub(t){return typeof t.data<"u"}function Gb(t){return typeof Response<"u"&&t instanceof Response}function Hb(t){return typeof ArrayBuffer<"u"&&(t instanceof ArrayBuffer||ArrayBuffer.isView(t))||typeof Buffer<"u"&&Buffer.isBuffer?.(t)||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer||typeof Uint32Array<"u"&&t instanceof Uint32Array}let Sn;function qb(t){if(Sn)return Sn;async function e(){We=await Ob(async n=>{let r=t;return r=await r,typeof r=="function"&&(r=await r(n)),typeof r=="function"&&(r=await r(n)),Vb(r)?r=await r.instantiator(n):Bb(r)?r=await r.default(n):(Ub(r)&&(r=r.data),Gb(r)?typeof WebAssembly.instantiateStreaming=="function"?r=await Wb(r)(n):r=await Kb(r)(n):Hb(r)?r=await Zr(r)(n):r instanceof WebAssembly.Module?r=await Zr(r)(n):"default"in r&&r.default instanceof WebAssembly.Module&&(r=await Zr(r.default)(n))),"instance"in r&&(r=r.instance),"exports"in r&&(r=r.exports),r})}return Sn=e(),Sn}function Zr(t){return e=>WebAssembly.instantiate(t,e)}function Wb(t){return e=>WebAssembly.instantiateStreaming(t,e)}function Kb(t){return async e=>{const n=await t.arrayBuffer();return WebAssembly.instantiate(n,e)}}async function Qb(t){return t&&await qb(t),{createScanner(e){return new Fb(e.map(n=>typeof n=="string"?n:n.source))},createString(e){return new Yd(e)}}}const Yb=Nb({langs:Ib,themes:Rb,engine:()=>Qb(_(()=>import("./wasm-CG6Dc4jp.js"),[]))}),{codeToHtml:Va,codeToTokens:Jb}=Sb(Yb,{guessEmbeddedLanguages:Fx});function Ba({...t}){return s.jsx(qm,{"data-slot":"collapsible",...t})}function Ua({...t}){return s.jsx(Wm,{"data-slot":"collapsible-trigger",...t})}function Ga({...t}){return s.jsx(Km,{"data-slot":"collapsible-content",...t})}function Jd(t){let e;try{e=JSON.parse(t)}catch{return null}const n=[];if(Array.isArray(e))for(const o of e)o&&typeof o=="object"&&"type"in o&&n.push(o);else e&&typeof e=="object"&&"type"in e&&n.push(e);return n.length===0||!n.some(o=>o.type==="text"||o.type==="image")?null:{text:n.filter(o=>o.type==="text"&&o.text).map(o=>o.text).join(`
25
- `),blocks:n}}function Xb(t){return t.blocks.find(e=>e.type==="image"&&e.source?.data)}function Xd(t){return t.source?.data?`data:${t.source.media_type||"image/png"};base64,${t.source.data}`:null}let Ha=class extends d.Component{constructor(e){super(e),this.reset=()=>{this.setState({hasError:!1,error:null})},this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,n){console.error(`[ErrorBoundary${this.props.name?`:${this.props.name}`:""}]`,e,n.componentStack)}render(){return this.state.hasError&&this.state.error?typeof this.props.fallback=="function"?this.props.fallback(this.state.error,this.reset):this.props.fallback?this.props.fallback:this.props.inline?s.jsxs("span",{className:"inline-flex items-center gap-1.5 text-red-400 text-sm",children:[s.jsx(zo,{size:14}),s.jsxs("span",{children:["Error",this.props.name?` in ${this.props.name}`:""]}),s.jsx("button",{onClick:this.reset,className:"text-red-300 hover:text-red-200 underline",children:"retry"})]}):s.jsxs("div",{className:"my-2 border border-red-500/30 rounded-lg overflow-hidden bg-red-500/5",children:[s.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-red-500/20",children:[s.jsx(zo,{size:14,className:"text-red-400 flex-shrink-0"}),s.jsxs("span",{className:"text-xs font-semibold uppercase tracking-wider text-red-400",children:["Render Error",this.props.name?` — ${this.props.name}`:""]}),s.jsxs("button",{onClick:this.reset,className:"ml-auto flex items-center gap-1 px-2 py-1 text-xs text-red-300 hover:text-red-200 hover:bg-red-500/10 rounded transition-colors",children:[s.jsx(Gg,{size:12})," Retry"]})]}),s.jsx("div",{className:"px-3 py-2 text-sm text-red-200 font-medium",children:this.state.error.message})]}):this.props.children}};const Zb=Ce.lazy(async()=>({default:(await _(()=>import("./CodeHighlight-0NzQZdJv.js"),__vite__mapDeps([101,102,103,104]))).CodeHighlight}));function Xi({code:t,className:e=""}){return s.jsx("pre",{className:P("m-0 px-3 py-2.5 font-mono text-[13px] whitespace-pre-wrap break-words leading-relaxed",k.codeBg,k.text.secondary,e),children:s.jsx("code",{children:t.trimEnd()})})}function qa(t){return s.jsx(Ha,{inline:!0,name:"CodeHighlight",fallback:s.jsx(Xi,{code:t.code,className:t.className}),children:s.jsx(d.Suspense,{fallback:s.jsx(Xi,{code:t.code,className:t.className}),children:s.jsx(Zb,{...t})})})}function Oe({isExpanded:t,onExpandedChange:e,headerContent:n,content:r,canExpand:o=!0,wrapperClassName:a,cardClassName:i,headerClassName:l}){return s.jsx("div",{className:P("w-fit max-w-full",a),children:s.jsx(Ba,{open:t,onOpenChange:e,children:s.jsxs("div",{className:P("border rounded-lg overflow-hidden",k.card.border,k.card.bg,i),children:[s.jsx(Ua,{className:"w-full text-left cursor-pointer select-none",disabled:!o,children:s.jsxs("div",{className:P("flex items-center gap-2 px-3 py-2 transition-colors",o&&k.hover,l),children:[n,o&&s.jsx(en,{size:12,className:P("transition-transform duration-150 flex-shrink-0",k.text.faint,!t&&"-rotate-90")})]})}),o&&r&&s.jsx(Ga,{children:r})]})})})}function ey(t){let e=t.replace(/<system-reminder>[\s\S]*?<\/system-reminder>/g,"");return e=e.replace(/^\s*\d+→/gm,""),e.trimEnd()}const ty=5;function sy({input:t,result:e,workingDirectory:n}){const r=t?.file_path||"",o=ks(r,n),a=d.useMemo(()=>{if(!e)return null;const m=Jd(e);if(!m)return null;const h=Xb(m);return h?Xd(h):null},[e]),i=e?ey(e):"",l=Aa(i),[c,u]=d.useState(()=>l>0&&l<=ty),p=hr(r);return e?a?s.jsx(Oe,{isExpanded:!0,onExpandedChange:()=>{},cardClassName:ue.blue.card,headerContent:s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ra,{size:14,className:`${ue.blue.icon} flex-shrink-0`}),s.jsx("span",{className:`text-xs ${k.text.muted}`,children:"Read"})]}),s.jsx("span",{className:`text-xs ${k.text.secondary} truncate flex-1`,children:o})]}),content:s.jsx("div",{className:`border-t ${k.separator} px-3 py-2`,children:s.jsx("img",{src:a,alt:o,className:"rounded border border-stone-200 dark:border-zinc-800/40 max-w-full max-h-96 object-contain"})})}):s.jsx(Oe,{isExpanded:c,onExpandedChange:u,cardClassName:ue.blue.card,headerContent:s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Nt,{size:14,className:`${ue.blue.icon} flex-shrink-0`}),s.jsx("span",{className:`text-xs ${k.text.muted}`,children:"Read"})]}),s.jsx("span",{className:`text-xs ${k.text.secondary} truncate flex-1`,children:o})]}),content:i?s.jsx("div",{className:`border-t ${k.separator}`,children:p==="markdown"?s.jsx("div",{className:`px-3 py-2.5 max-h-96 overflow-y-auto ${k.scrollbar} ${Ps}`,children:s.jsx(rs,{remarkPlugins:[Ns],children:i})}):s.jsx(qa,{code:i,language:p,showLineNumbers:!0,className:"rounded-none"})}):void 0}):s.jsx("div",{})}const ny=Ce.lazy(async()=>({default:(await _(()=>Promise.resolve().then(()=>m1),void 0)).DiffViewer}));function Zi({oldValue:t,newValue:e}){return s.jsx("pre",{className:P("m-0 px-3 py-2.5 font-mono text-[13px] whitespace-pre-wrap break-words leading-relaxed",k.codeBg,k.text.primary),children:s.jsx("code",{children:e||t||"No changes"})})}function ec(t,e){return{added:Math.max(0,e.split(`
25
+ `),blocks:n}}function Xb(t){return t.blocks.find(e=>e.type==="image"&&e.source?.data)}function Xd(t){return t.source?.data?`data:${t.source.media_type||"image/png"};base64,${t.source.data}`:null}let Ha=class extends d.Component{constructor(e){super(e),this.reset=()=>{this.setState({hasError:!1,error:null})},this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,n){console.error(`[ErrorBoundary${this.props.name?`:${this.props.name}`:""}]`,e,n.componentStack)}render(){return this.state.hasError&&this.state.error?typeof this.props.fallback=="function"?this.props.fallback(this.state.error,this.reset):this.props.fallback?this.props.fallback:this.props.inline?s.jsxs("span",{className:"inline-flex items-center gap-1.5 text-red-400 text-sm",children:[s.jsx(zo,{size:14}),s.jsxs("span",{children:["Error",this.props.name?` in ${this.props.name}`:""]}),s.jsx("button",{onClick:this.reset,className:"text-red-300 hover:text-red-200 underline",children:"retry"})]}):s.jsxs("div",{className:"my-2 border border-red-500/30 rounded-lg overflow-hidden bg-red-500/5",children:[s.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-red-500/20",children:[s.jsx(zo,{size:14,className:"text-red-400 flex-shrink-0"}),s.jsxs("span",{className:"text-xs font-semibold uppercase tracking-wider text-red-400",children:["Render Error",this.props.name?` — ${this.props.name}`:""]}),s.jsxs("button",{onClick:this.reset,className:"ml-auto flex items-center gap-1 px-2 py-1 text-xs text-red-300 hover:text-red-200 hover:bg-red-500/10 rounded transition-colors",children:[s.jsx(Gg,{size:12})," Retry"]})]}),s.jsx("div",{className:"px-3 py-2 text-sm text-red-200 font-medium",children:this.state.error.message})]}):this.props.children}};const Zb=Ce.lazy(async()=>({default:(await _(()=>import("./CodeHighlight-dzF_1m2m.js"),__vite__mapDeps([101,102,103,104]))).CodeHighlight}));function Xi({code:t,className:e=""}){return s.jsx("pre",{className:P("m-0 px-3 py-2.5 font-mono text-[13px] whitespace-pre-wrap break-words leading-relaxed",k.codeBg,k.text.secondary,e),children:s.jsx("code",{children:t.trimEnd()})})}function qa(t){return s.jsx(Ha,{inline:!0,name:"CodeHighlight",fallback:s.jsx(Xi,{code:t.code,className:t.className}),children:s.jsx(d.Suspense,{fallback:s.jsx(Xi,{code:t.code,className:t.className}),children:s.jsx(Zb,{...t})})})}function Oe({isExpanded:t,onExpandedChange:e,headerContent:n,content:r,canExpand:o=!0,wrapperClassName:a,cardClassName:i,headerClassName:l}){return s.jsx("div",{className:P("w-fit max-w-full",a),children:s.jsx(Ba,{open:t,onOpenChange:e,children:s.jsxs("div",{className:P("border rounded-lg overflow-hidden",k.card.border,k.card.bg,i),children:[s.jsx(Ua,{className:"w-full text-left cursor-pointer select-none",disabled:!o,children:s.jsxs("div",{className:P("flex items-center gap-2 px-3 py-2 transition-colors",o&&k.hover,l),children:[n,o&&s.jsx(en,{size:12,className:P("transition-transform duration-150 flex-shrink-0",k.text.faint,!t&&"-rotate-90")})]})}),o&&r&&s.jsx(Ga,{children:r})]})})})}function ey(t){let e=t.replace(/<system-reminder>[\s\S]*?<\/system-reminder>/g,"");return e=e.replace(/^\s*\d+→/gm,""),e.trimEnd()}const ty=5;function sy({input:t,result:e,workingDirectory:n}){const r=t?.file_path||"",o=ks(r,n),a=d.useMemo(()=>{if(!e)return null;const m=Jd(e);if(!m)return null;const h=Xb(m);return h?Xd(h):null},[e]),i=e?ey(e):"",l=Aa(i),[c,u]=d.useState(()=>l>0&&l<=ty),p=hr(r);return e?a?s.jsx(Oe,{isExpanded:!0,onExpandedChange:()=>{},cardClassName:ue.blue.card,headerContent:s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ra,{size:14,className:`${ue.blue.icon} flex-shrink-0`}),s.jsx("span",{className:`text-xs ${k.text.muted}`,children:"Read"})]}),s.jsx("span",{className:`text-xs ${k.text.secondary} truncate flex-1`,children:o})]}),content:s.jsx("div",{className:`border-t ${k.separator} px-3 py-2`,children:s.jsx("img",{src:a,alt:o,className:"rounded border border-stone-200 dark:border-zinc-800/40 max-w-full max-h-96 object-contain"})})}):s.jsx(Oe,{isExpanded:c,onExpandedChange:u,cardClassName:ue.blue.card,headerContent:s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Nt,{size:14,className:`${ue.blue.icon} flex-shrink-0`}),s.jsx("span",{className:`text-xs ${k.text.muted}`,children:"Read"})]}),s.jsx("span",{className:`text-xs ${k.text.secondary} truncate flex-1`,children:o})]}),content:i?s.jsx("div",{className:`border-t ${k.separator}`,children:p==="markdown"?s.jsx("div",{className:`px-3 py-2.5 max-h-96 overflow-y-auto ${k.scrollbar} ${Ps}`,children:s.jsx(rs,{remarkPlugins:[Ns],children:i})}):s.jsx(qa,{code:i,language:p,showLineNumbers:!0,className:"rounded-none"})}):void 0}):s.jsx("div",{})}const ny=Ce.lazy(async()=>({default:(await _(()=>Promise.resolve().then(()=>m1),void 0)).DiffViewer}));function Zi({oldValue:t,newValue:e}){return s.jsx("pre",{className:P("m-0 px-3 py-2.5 font-mono text-[13px] whitespace-pre-wrap break-words leading-relaxed",k.codeBg,k.text.primary),children:s.jsx("code",{children:e||t||"No changes"})})}function ec(t,e){return{added:Math.max(0,e.split(`
26
26
  `).length-t.split(`
27
27
  `).length),removed:Math.max(0,t.split(`
28
28
  `).length-e.split(`
@@ -127,7 +127,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${e.do
127
127
  `)?null:{triggerIndex:Te,query:De,type:"file"}},xn=(z,le)=>{const Se=z.substring(0,le),Te=Se.lastIndexOf("/");if(Te===-1)return null;const De=Se.substring(0,Te);if(De.trim()!==""&&!De.endsWith(`
128
128
  `)&&!De.endsWith(" "))return null;const it=Se.substring(Te+1);return it.includes(" ")||it.includes(`
129
129
  `)?null:{triggerIndex:Te,query:it,type:"command"}},Lr=z=>{if(!B)return[];if(!z)return B.slice(0,50);const le=z.toLowerCase();return B.filter(Se=>Se.name.toLowerCase().includes(le)).slice(0,50)},Or=z=>{if(!ye)return[];if(!z)return ye.slice(0,50);const le=z.toLowerCase();return ye.filter(Se=>Se.name.toLowerCase().includes(le)).slice(0,50)},Tt=()=>{ce({isActive:!1,triggerIndex:-1,query:"",suggestions:[],focusedIndex:-1,type:"file"})},bn=z=>{if(!ve.current)return;const le=ve.current.selectionStart;if(I.type==="command"){const Se=pe.substring(0,I.triggerIndex)+z+" "+pe.substring(le);_e(Se),Tt(),setTimeout(()=>{if(ve.current){const Te=I.triggerIndex+z.length+1;ve.current.setSelectionRange(Te,Te),ve.current.focus(),Kt()}},0)}else{const Se=pe.substring(0,I.triggerIndex+1)+z+" "+pe.substring(le);_e(Se),Tt(),setTimeout(()=>{if(ve.current){const Te=I.triggerIndex+1+z.length+1;ve.current.setSelectionRange(Te,Te),ve.current.focus(),Kt()}},0)}},yn=z=>{const le=z.target.value;_e(le),Kt();const Se=z.target.selectionStart,Te=xn(le,Se);if(Te&&E){ye.length===0&&ps();const De=Or(Te.query);ce(it=>({isActive:!0,triggerIndex:Te.triggerIndex,query:Te.query,suggestions:De,type:Te.type,focusedIndex:it.focusedIndex>=0&&it.focusedIndex<De.length?it.focusedIndex:-1}));return}if(p){const De=Mr(le,Se);if(De){B.length===0&&ut();const it=Lr(De.query);ce(ms=>({isActive:!0,triggerIndex:De.triggerIndex,query:De.query,suggestions:it,type:De.type,focusedIndex:ms.focusedIndex>=0&&ms.focusedIndex<it.length?ms.focusedIndex:-1}));return}}Tt()},zs=()=>{const z=pe.trim();if(!z&&!L||fe)return;const le=L?W():void 0,Se=`${Z}-backup`;try{localStorage.setItem(Se,pe)}catch{}r(z,{workingDirectory:g||void 0,attachments:le}),_e(""),oa.set(Z,""),H(),Tt()},vn=z=>{if(I.isActive)switch(z.key){case"ArrowDown":z.preventDefault(),I.suggestions.length>0&&ce(le=>({...le,focusedIndex:le.focusedIndex<0?0:(le.focusedIndex+1)%le.suggestions.length}));break;case"ArrowUp":z.preventDefault(),I.suggestions.length>0&&ce(le=>({...le,focusedIndex:le.focusedIndex<0||le.focusedIndex===0?le.suggestions.length-1:le.focusedIndex-1}));break;case"Enter":case"Tab":if(!z.metaKey&&!z.ctrlKey&&(z.preventDefault(),I.suggestions.length>0)){const le=I.focusedIndex>=0?I.focusedIndex:0,Se=I.suggestions[le],Te=(I.type==="command",Se.name);bn(Te)}break;case" ":Tt();break;case"Escape":z.preventDefault(),Tt(),setTimeout(()=>ve.current?.focus(),0);break}else if(z.key==="Enter"){if(z.shiftKey)return;z.preventDefault(),zs()}else z.key==="c"&&z.ctrlKey&&(b||y)&&(z.preventDefault(),x?.())},Kt=()=>{const z=ve.current;if(z){z.style.height="auto";const le=Math.floor(window.innerHeight*.8);z.style.height=`${Math.min(z.scrollHeight,le)}px`}};d.useEffect(()=>Kt(),[pe]),d.useEffect(()=>{const z=()=>Kt();return window.addEventListener("resize",z),()=>window.removeEventListener("resize",z)},[]);const st=z=>{if(!u)return;const le=Array.from(z.clipboardData.files);le.length>0&&(z.preventDefault(),V(le))},rt=z=>{u&&(z.preventDefault(),z.stopPropagation(),ae(!0))},Dr=z=>{u&&(z.preventDefault(),z.stopPropagation(),z.currentTarget.contains(z.relatedTarget)||ae(!1))},wn=z=>{if(!u)return;z.preventDefault(),z.stopPropagation(),ae(!1);const le=Array.from(z.dataTransfer.files);le.length>0&&V(le)},_n=z=>{z.target.files&&z.target.files.length>0&&(V(z.target.files),z.target.value="")},nt=w||v?{border:"border-composer-caution dark:border-composer-caution/60",bg:"bg-composer-caution/30 dark:bg-composer-caution/10",borderInner:"border-composer-caution/60 dark:border-composer-caution/25",text:"text-composer-caution",textDim:"text-composer-caution dark:text-composer-caution/70"}:b?{border:"border-composer-active dark:border-composer-active/60",bg:"bg-composer-active/30 dark:bg-composer-active/10",borderInner:"border-composer-active/60 dark:border-composer-active/25",text:"text-composer-active",textDim:"text-composer-active dark:text-composer-active/70"}:y?{border:"border-composer-ready dark:border-composer-ready/40",bg:"bg-composer-ready/25 dark:bg-composer-ready/5",borderInner:"border-composer-ready/50 dark:border-composer-ready/15",text:"text-composer-ready",textDim:"text-composer-ready dark:text-composer-ready/60"}:{border:"border-composer-border",bg:"bg-composer-muted/15 dark:bg-composer-muted/5",borderInner:"border-composer-border/50",text:"text-composer-muted",textDim:"text-composer-muted/70 dark:text-composer-muted/40"};return s.jsx(l_,{children:s.jsxs("div",{ref:Ve,className:P("w-full relative",e.className),children:[u&&s.jsx("input",{ref:Ae,type:"file",multiple:!0,accept:N_,className:"hidden",onChange:_n}),s.jsxs("div",{"data-composer-status":w?"starting":v?"stopping":b?"active":y?"ready":"off",className:P("relative rounded-md overflow-hidden border bg-composer-surface/85 backdrop-blur-sm transition-all duration-200",m?nt.border:"border-composer-border/70"),children:[m&&s.jsxs("div",{className:P("relative flex min-h-[36px] sm:min-h-[44px] items-center justify-between gap-1.5 sm:gap-2 px-2 sm:px-3 py-1 sm:py-1.5 border-b",nt.bg,nt.borderInner),children:[s.jsx("div",{className:"flex items-center gap-1.5 sm:gap-2 shrink-0",children:w?s.jsxs(s.Fragment,{children:[s.jsx(ot,{size:12,className:P("animate-spin",nt.text)}),s.jsx("span",{className:P("text-[8px] sm:text-[10px] font-semibold uppercase tracking-wider",nt.text),children:"Starting"})]}):v?s.jsxs(s.Fragment,{children:[s.jsx(ot,{size:12,className:P("animate-spin",nt.text)}),s.jsx("span",{className:P("text-[8px] sm:text-[10px] font-semibold uppercase tracking-wider",nt.text),children:"Stopping"})]}):b?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"relative flex h-2 w-2",children:[s.jsx("span",{className:P("animate-ping absolute inline-flex h-full w-full rounded-full opacity-75","bg-composer-active")}),s.jsx("span",{className:P("relative inline-flex rounded-full h-2 w-2","bg-composer-active")})]}),s.jsx("span",{className:P("text-[8px] sm:text-[10px] font-semibold uppercase tracking-wider",nt.text),children:"Working"}),Me&&s.jsx("span",{className:P("text-[8px] sm:text-[10px] font-mono tabular-nums",nt.textDim),children:qe})]}):N&&y?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"relative flex h-2 w-2",children:[s.jsx("span",{className:"animate-pulse absolute inline-flex h-full w-full rounded-full bg-composer-caution opacity-50"}),s.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-composer-caution/70"})]}),s.jsx("span",{className:"text-[8px] sm:text-[10px] font-semibold uppercase tracking-wider text-composer-caution/70",children:"Waiting for background task"})]}):y?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"relative flex h-2 w-2",children:s.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-composer-ready dark:bg-composer-ready/50"})}),s.jsx("span",{className:"text-[8px] sm:text-[10px] font-semibold uppercase tracking-wider text-composer-ready dark:text-composer-ready/60",children:"Ready"})]}):s.jsx("span",{className:"text-[8px] sm:text-[10px] font-semibold uppercase tracking-wider text-composer-text-faint",children:"Idle"})}),s.jsxs("div",{className:"flex items-center gap-1 sm:gap-2 min-w-0 shrink",children:[D&&(()=>{const z=D.contextTokens??D.inputTokens+D.cacheCreationInputTokens+D.cacheReadInputTokens,le=z>=5e5?"text-red-500 dark:text-red-400":z>=2e5?"text-amber-500 dark:text-amber-400":b?"text-composer-active":y?"text-composer-ready":"text-composer-muted";return s.jsx("div",{className:"flex items-center rounded-sm border border-composer-border/50 bg-composer-surface-elevated/50 p-0.5","data-testid":"token-usage",children:s.jsxs("span",{className:P("px-1.5 sm:px-3 py-0.5 sm:py-1 text-[8px] sm:text-[10px] font-semibold uppercase tracking-wider whitespace-nowrap",le),"data-tokens":z,children:[j_(z)," tokens"]})})})(),R.length>0&&s.jsxs(d_,{children:[s.jsx(u_,{asChild:!0,children:s.jsxs("button",{type:"button",onClick:()=>ge(!0),className:"px-1.5 sm:px-2 py-0.5 sm:py-1 rounded-sm border border-composer-caution/35 bg-composer-caution/10 text-composer-caution text-[8px] sm:text-[10px] font-semibold uppercase tracking-wider hover:border-composer-caution/60 hover:bg-composer-caution/20 transition-colors cursor-pointer whitespace-nowrap",children:["Queue ",R.length]})}),s.jsx(ap,{side:"top",children:s.jsx("p",{children:"Per-session message queue. These auto-send in order when the current run finishes."})})]})]})]}),s.jsxs("div",{className:P("flex flex-col items-center justify-center w-full bg-transparent cursor-text relative",q&&"ring-2 ring-composer-active/50 ring-inset bg-composer-active/5"),onDragOver:rt,onDragLeave:Dr,onDrop:wn,children:[q&&s.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-composer-active/10 z-10 pointer-events-none",children:s.jsxs("div",{className:"flex items-center gap-2 text-composer-active font-medium",children:[s.jsx(Fg,{size:20}),s.jsx("span",{children:"Drop files to attach"})]})}),L&&s.jsxs("div",{className:"flex gap-2 px-3 py-2 w-full border-b border-composer-border/50 overflow-x-auto",children:[oe.map(z=>s.jsxs("div",{className:"relative group flex-shrink-0 flex items-center gap-1.5 px-2 py-1 rounded bg-composer-surface-elevated/50 border border-composer-border/50",children:[z.type==="image"?s.jsx(Ra,{size:14,className:"text-composer-active"}):s.jsx(Nt,{size:14,className:"text-composer-caution"}),s.jsx("span",{className:"text-xs text-composer-text-secondary max-w-[100px] truncate",children:z.name}),z.status==="processing"&&s.jsx(ot,{size:12,className:"animate-spin text-composer-text-secondary"}),z.status==="error"&&s.jsx("span",{className:"text-composer-danger text-xs",children:"!"}),s.jsx("button",{type:"button",onClick:()=>X(z.id),className:"ml-1 p-0.5 rounded hover:bg-composer-danger/20 text-composer-text-secondary hover:text-composer-danger transition-colors",children:s.jsx(br,{size:12})})]},z.id)),G&&s.jsx("span",{className:"text-xs text-composer-danger self-center",children:G})]}),s.jsxs("div",{className:"relative flex w-full min-h-[44px] items-center",children:[s.jsx("div",{className:"relative flex flex-1 min-h-[44px] items-center",children:s.jsx("textarea",{ref:ve,"data-testid":"composer-input",className:"max-h-[80vh] w-full border-none bg-transparent text-composer-text leading-relaxed resize-none outline-none overflow-y-auto min-h-[40px] py-2 pl-12 pr-28 text-sm tracking-[0.01em] placeholder:text-composer-text-faint",placeholder:i,value:pe,onChange:yn,onKeyDown:vn,onPaste:st,rows:1,disabled:l})}),u&&s.jsx("div",{className:"absolute flex items-center justify-center left-1.5 bottom-1.5",children:s.jsx("button",{type:"button",onClick:()=>Ae.current?.click(),disabled:l,"aria-label":"Add attachment",className:"flex h-8 w-8 items-center justify-center rounded-sm border border-composer-active dark:border-composer-active/30 text-composer-active transition-all duration-100 hover:border-composer-active hover:bg-composer-active/20 dark:hover:bg-composer-active/5 disabled:opacity-45 disabled:cursor-not-allowed",children:s.jsx(Ug,{size:14})})}),s.jsx("div",{className:"absolute flex items-center justify-center gap-2 right-1.5 bottom-1.5",children:b||y?s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("button",{type:"button","data-testid":"send-button",className:P("h-8 w-8 flex items-center justify-center rounded-sm border transition-all duration-100",pe.trim()||L?"border-composer-active dark:border-composer-active/40 text-composer-active hover:border-composer-active hover:bg-composer-active/20 dark:hover:bg-composer-active/10":"border-composer-border text-composer-text-faint cursor-not-allowed"),disabled:!pe.trim()&&!L||l||fe,onClick:zs,"aria-label":"Send message",children:s.jsx($o,{size:14})}),(b||v)&&s.jsxs("button",{type:"button",className:P("relative h-8 flex items-center justify-center gap-1 rounded-sm border text-[10px] font-semibold uppercase tracking-wider transition-all duration-100",v?"px-2":"w-8",v?"border-composer-caution/50 text-composer-caution bg-composer-caution/10":"border-composer-danger/30 text-composer-danger hover:border-composer-danger hover:bg-composer-danger/5"),onClick:()=>f?.(),"data-testid":"stop-button","aria-label":v?"Stop requested":"Stop session",children:[v?s.jsx(ot,{size:14,className:"animate-spin"}):s.jsx(qg,{size:14}),v&&s.jsx("span",{className:"hidden sm:inline",children:"Stopping"})]})]}):s.jsxs("div",{className:"flex items-center gap-2",children:[h&&s.jsx("button",{type:"button",onClick:()=>J(!O),title:"Menu",className:P("flex items-center justify-center px-2 h-8 rounded-sm border transition-all duration-100 cursor-pointer",O?"bg-composer-surface-elevated border-composer-border text-composer-text-secondary":"border-composer-border text-composer-text-faint hover:border-composer-text-faint hover:text-composer-text-secondary hover:bg-composer-surface-elevated/50"),children:s.jsx(yg,{size:14})}),s.jsx("button",{type:"button","data-testid":"send-button",disabled:!pe.trim()&&!L||l||fe,onClick:zs,className:P("flex items-center justify-center h-8 w-8 rounded-sm border transition-all duration-100 cursor-pointer",!pe.trim()&&!L||l||fe?"border-composer-border text-composer-text-faint cursor-not-allowed":"border-composer-active dark:border-composer-active/50 text-composer-active hover:border-composer-active hover:bg-composer-active/20 dark:hover:bg-composer-active/10"),children:s.jsx($o,{size:14})})]})})]}),s.jsx(Iw,{open:be,onOpenChange:ge,children:s.jsxs(Pu,{className:"max-w-lg",children:[s.jsxs(Rw,{children:[s.jsxs(Pw,{className:"text-sm font-semibold uppercase tracking-wider text-composer-caution",children:["Queued Messages (",R.length,")"]}),s.jsx(Mw,{className:"text-xs text-composer-text-secondary",children:"Per-session queue. These auto-send in order when the current run finishes."})]}),s.jsx("div",{className:"max-h-[55vh] overflow-y-auto space-y-2 pr-1",children:R.map(z=>s.jsxs("div",{className:"border border-composer-border/50 rounded-sm px-2.5 py-2 bg-composer-surface/80",children:[s.jsx("p",{className:"text-xs text-composer-text whitespace-pre-wrap break-words",children:z.content}),s.jsx("p",{className:"text-[10px] text-composer-text-faint mt-1 font-mono",children:z.status==="dispatching"?"sending...":`queued ${new Date(z.timestamp).toLocaleTimeString()}`})]},z.id))})]})})]})]}),h&&O&&e.renderMenu?.({onClose:()=>J(!1)}),(p||E)&&s.jsx(__,{suggestions:I.suggestions,onSelect:bn,onClose:Tt,isOpen:I.isActive&&I.suggestions.length>0,focusedIndex:I.focusedIndex,type:I.type,onFocusReturn:()=>ve.current?.focus()})]})})});class Ys extends d.Component{constructor(e){super(e),this.state={hasError:!1,error:null,showStack:!1}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,n){console.error(`[ErrorBoundary${this.props.name?`:${this.props.name}`:""}] Caught error:`,e,`
130
- Component stack:`,n.componentStack),this.props.onError?.(e,n)}reset=()=>{this.setState({hasError:!1,error:null,showStack:!1})};toggleStack=()=>{this.setState(e=>({showStack:!e.showStack}))};render(){return this.state.hasError&&this.state.error?typeof this.props.fallback=="function"?this.props.fallback(this.state.error,this.reset):this.props.fallback?this.props.fallback:this.props.inline?s.jsxs("span",{className:"inline-flex items-center gap-1.5 text-red-400 text-sm",children:[s.jsx(jt,{size:14}),s.jsxs("span",{children:["Error",this.props.name?` in ${this.props.name}`:""]}),s.jsx("button",{onClick:this.reset,className:"text-red-300 hover:text-red-200 underline",children:"retry"})]}):s.jsxs("div",{className:"my-2 border border-red-500/30 rounded-lg overflow-hidden bg-red-500/5",children:[s.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-red-500/20",children:[s.jsx(jt,{size:14,className:"text-red-400 flex-shrink-0"}),s.jsxs("span",{className:"text-xs font-semibold uppercase tracking-wider text-red-400",children:["Render Error",this.props.name?` - ${this.props.name}`:""]}),s.jsxs("button",{onClick:this.reset,className:"ml-auto flex items-center gap-1 px-2 py-1 text-xs text-red-300 hover:text-red-200 hover:bg-red-500/10 rounded transition-colors",children:[s.jsx(ds,{size:12}),"Retry"]})]}),s.jsxs("div",{className:"px-3 py-2",children:[s.jsx("p",{className:"text-sm text-red-200 font-medium",children:this.state.error.message}),this.state.error.stack&&s.jsxs("div",{className:"mt-2",children:[s.jsxs("button",{onClick:this.toggleStack,className:"flex items-center gap-1 text-xs text-red-400/70 hover:text-red-400 transition-colors",children:[this.state.showStack?s.jsx(jh,{size:12}):s.jsx(Ot,{size:12}),this.state.showStack?"Hide":"Show"," stack trace"]}),this.state.showStack&&s.jsx("pre",{className:"mt-2 text-xs text-red-300/60 font-mono whitespace-pre-wrap overflow-x-auto max-h-48 overflow-y-auto",children:this.state.error.stack})]})]})]}):this.props.children}}function S_({error:t,reset:e}){return s.jsx("div",{className:"min-h-dvh bg-background flex items-center justify-center p-4",children:s.jsx("div",{className:"max-w-md w-full",children:s.jsxs("div",{className:"border border-red-500/30 rounded-lg overflow-hidden bg-red-500/5",children:[s.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-red-500/20",children:[s.jsx(jt,{size:18,className:"text-red-400"}),s.jsx("span",{className:"text-sm font-semibold text-red-400",children:"Application Error"})]}),s.jsxs("div",{className:"p-4 space-y-4",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Something went wrong while rendering the application."}),s.jsx("p",{className:"text-sm text-red-200 font-mono bg-red-500/10 px-3 py-2 rounded",children:t.message}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs("button",{onClick:e,className:"flex items-center gap-2 px-4 py-2 bg-red-500/20 hover:bg-red-500/30 text-red-200 rounded transition-colors",children:[s.jsx(ds,{size:14}),"Try Again"]}),s.jsx("button",{onClick:()=>window.location.reload(),className:"px-4 py-2 text-muted-foreground hover:text-foreground transition-colors",children:"Reload Page"})]})]})]})})})}const E_=Ce.lazy(async()=>({default:(await _(()=>import("./CodeHighlight-QDb33RjI.js"),__vite__mapDeps([105,102,104,103]))).CodeHighlight}));function Ac({code:t,className:e=""}){return s.jsx("pre",{className:Le("m-0 overflow-x-auto bg-zinc-950 px-3 py-2.5 font-mono text-[10px] leading-relaxed text-zinc-400",e),children:s.jsx("code",{children:t.trimEnd()})})}function T_(t){return s.jsx(Ys,{inline:!0,name:"CodeHighlight",fallback:s.jsx(Ac,{code:t.code,className:t.className}),children:s.jsx(d.Suspense,{fallback:s.jsx(Ac,{code:t.code,className:t.className}),children:s.jsx(E_,{...t})})})}const I_={},A_={};function Rc({src:t,alt:e="Attached",className:n="max-w-[200px] max-h-[200px] rounded border border-zinc-600 object-contain"}){const[r,o]=d.useState(!0),[a,i]=d.useState(!1),l=d.useCallback(()=>o(!1),[]),c=d.useCallback(()=>{o(!1),i(!0)},[]);return a?s.jsx("div",{className:`${n} flex items-center justify-center bg-zinc-800/50`,children:s.jsx("span",{className:"text-xs text-zinc-500",children:"Failed to load"})}):s.jsxs("div",{className:"relative inline-block",children:[r&&s.jsx("div",{className:`${n} flex items-center justify-center bg-zinc-800/50 absolute inset-0`,children:s.jsx(Ee,{size:20,className:"animate-spin text-cyan-400"})}),s.jsx("img",{src:t,alt:e,className:`${n} ${r?"invisible":"visible"}`,onLoad:l,onError:c})]})}function R_(t){return t.replace(/<!--\s*NEXT_STEPS\s*\n[\s\S]*?-->/g,"").trim()}function P_(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function M_(t,e){if(typeof t=="string"){const r=t.trim();if(r.length>0&&r.toLowerCase()!=="unknown")return r}const n=[e.tool_name,e.toolName,e.recipient_name,e.recipientName];for(const r of n)if(typeof r=="string"){const o=r.trim();if(o.length>0&&o.toLowerCase()!=="unknown")return o}return"Tool"}function L_(t){const e=[],n=/`?★\s*Insight\s*─+`?\s*([\s\S]*?)\s*`?─{5,}`?/g;let r=0,o;for(;(o=n.exec(t))!==null;){if(o.index>r){const a=t.slice(r,o.index).trim();a&&e.push({type:"text",content:a})}e.push({type:"insight",content:o[1].trim()}),r=o.index+o[0].length}if(r<t.length){const a=t.slice(r).trim();a&&e.push({type:"text",content:a})}return e.length===0&&e.push({type:"text",content:t}),e}function O_(t){return t.replace(/^(\d+)\./gm,"$1\\.")}function Pc({text:t,markdownComponents:e}){const n=L_(t),[r,o]=d.useState(!1),a=l=>{l.stopPropagation();const c=document.createElement("textarea");c.value=t,c.style.position="fixed",c.style.left="-9999px",c.style.top="-9999px",document.body.appendChild(c),c.focus(),c.select();try{document.execCommand("copy"),o(!0),setTimeout(()=>o(!1),2e3)}catch(u){console.error("Failed to copy:",u)}document.body.removeChild(c)},i=s.jsxs("div",{className:"border border-blue-500/15 rounded-lg overflow-hidden bg-blue-500/5 w-fit max-w-full",children:[s.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 border-b border-blue-500/10",children:[s.jsx(as,{size:12,className:"text-blue-400/80 flex-shrink-0"}),s.jsx("span",{className:"text-[11px] text-zinc-400 font-medium",children:"Agent"}),s.jsx("div",{className:"flex-1"}),s.jsx("button",{type:"button",onClick:a,onPointerDown:l=>l.stopPropagation(),className:"p-1 rounded hover:bg-zinc-800/40 text-zinc-600 hover:text-zinc-400 opacity-100 sm:opacity-0 sm:group-hover/response:opacity-100 transition-opacity touch-manipulation",title:r?"Copied!":"Copy response",children:r?s.jsx(Pe,{size:12,className:"text-green-500"}):s.jsx(Bt,{size:12})})]}),s.jsx("div",{className:"px-3 py-2 prose max-w-none text-[13px] leading-relaxed dark:prose-invert",children:n.map((l,c)=>l.type==="insight"?s.jsx("div",{className:"my-3 not-prose",children:s.jsxs("div",{className:"border border-zinc-800/40 rounded-lg overflow-hidden bg-zinc-900/30",children:[s.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 border-b border-zinc-800/40",children:[s.jsx(_a,{size:12,className:"text-yellow-400/80 flex-shrink-0"}),s.jsx("span",{className:"text-[10px] text-zinc-400 font-medium",children:"Insight"})]}),s.jsx("div",{className:"px-3 py-2 prose max-w-none text-[13px] leading-relaxed dark:prose-invert",children:s.jsx(Eo,{remarkPlugins:[Ns],components:e,children:l.content})})]})},c):s.jsx(Eo,{remarkPlugins:[Ns],components:e,children:O_(l.content)},c))})]});return s.jsx("div",{className:"group/response relative",children:i})}const D_=[{pattern:/^\/prototype\/(.+)$/,getInfo:t=>({label:t[1].replace(/-/g," ").replace(/\b\w/g,e=>e.toUpperCase()),icon:Gl})},{pattern:/^\/c\/([a-f0-9-]+)$/,getInfo:t=>({label:`Session ${t[1].slice(0,8)}`,icon:Tf})},{pattern:/^\/dev$/,getInfo:()=>({label:"Dev Hub",icon:ka})},{pattern:/^\/session\/([a-f0-9-]+)\/review$/,getInfo:t=>({label:`Analysis ${t[1].slice(0,8)}`,icon:vi})},{pattern:/^\/analysis\/cross-session$/,getInfo:()=>({label:"Cross-session analysis",icon:vi})}];function Mc(t){if(!t)return null;let e;if(t.startsWith("/"))e=t;else try{const n=new URL(t),r=n.hostname;if(!(r==="localhost"||r==="127.0.0.1"||/^\d+\.\d+\.\d+\.\d+$/.test(r)))return null;e=n.pathname}catch{return null}for(const{pattern:n,getInfo:r}of D_){const o=e.match(n);if(o)return{path:e,...r(o)}}return null}function Lc({route:t}){return s.jsxs("a",{href:t.path,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 not-prose px-3 py-1 my-0.5 rounded-sm border border-cyan-500/40 bg-cyan-500/20 hover:bg-cyan-500/30 active:bg-cyan-500/35 transition-all duration-100 no-underline select-none align-middle cursor-pointer",style:{touchAction:"manipulation"},children:[s.jsx(t.icon,{size:11,className:"text-cyan-300 flex-shrink-0"}),s.jsx("span",{className:"text-[10px] font-display font-bold uppercase tracking-wider text-cyan-300 truncate max-w-[200px]",children:t.label}),s.jsx(os,{size:9,className:"text-cyan-300/40 flex-shrink-0"})]})}const lo={a({href:t,children:e}){const n=Mc(t);if(n)return s.jsx(Lc,{route:n});const r=t?.startsWith("/");return s.jsx("a",{href:t,target:r?void 0:"_blank",rel:r?void 0:"noopener noreferrer",className:"text-cyan-400 hover:text-cyan-300 underline underline-offset-2",children:e})},table({children:t}){return s.jsx("div",{className:"my-3 not-prose",children:s.jsx("div",{className:"border border-zinc-800/40 rounded-lg overflow-hidden bg-zinc-900/30",children:s.jsx("div",{className:"overflow-x-auto",children:s.jsx("table",{className:"w-full text-sm",children:t})})})})},thead({children:t}){return s.jsx("thead",{className:"bg-zinc-800/20 border-b border-zinc-800/40",children:t})},tbody({children:t}){return s.jsx("tbody",{className:"divide-y divide-zinc-800/40",children:t})},tr({children:t}){return s.jsx("tr",{className:"hover:bg-zinc-800/20 transition-colors",children:t})},th({children:t}){return s.jsx("th",{className:"px-3 py-2 text-left text-xs font-semibold uppercase tracking-wider text-zinc-400",children:t})},td({children:t}){return s.jsx("td",{className:"px-3 py-2 text-foreground",children:t})},code({node:t,inline:e,className:n,children:r,...o}){const a=/language-(\w+)/.exec(n||""),i=a?a[1]:"text";if(!e&&a)return s.jsx(T_,{code:String(r).replace(/\n$/,""),language:i,className:"rounded-md overflow-hidden max-w-full box-border"});const l=String(r).trim();if(/^https?:\/\//.test(l)){const c=Mc(l);if(c)return s.jsx(Lc,{route:c})}return s.jsx("code",{className:n,...o,children:r})}};function ip({message:t,toolResults:e=I_,childrenMessages:n=A_,expandedTasks:r=new Set,onToggleTaskExpanded:o,isFirstInGroup:a=!0,isLastInGroup:i=!0,isStreaming:l=!1,currentQuestionRequest:c,onAnswerQuestion:u,onPlanApprove:p,onPlanReject:m,planOutcomes:h}){const g=d.useRef(l),[f,x]=d.useState(new Set),[b,y]=d.useState(!1);if(d.useMemo(()=>{if(!Array.isArray(t.content))return{};const v={};return t.content.forEach(w=>{if(w&&typeof w=="object"&&w.type==="tool_result"){const N=w.tool_use_id;if(N){const C=w.content,T=(Array.isArray(C),C);v[N]={status:"completed",result:typeof T=="string"||Array.isArray(T)?T:void 0,is_error:w.is_error}}}}),v},[t.content]),t.type==="user"){let v=typeof t.content=="string"?t.content:Array.isArray(t.content)?t.content.filter(R=>R.type==="text").map(R=>R.text||"").join(`
130
+ Component stack:`,n.componentStack),this.props.onError?.(e,n)}reset=()=>{this.setState({hasError:!1,error:null,showStack:!1})};toggleStack=()=>{this.setState(e=>({showStack:!e.showStack}))};render(){return this.state.hasError&&this.state.error?typeof this.props.fallback=="function"?this.props.fallback(this.state.error,this.reset):this.props.fallback?this.props.fallback:this.props.inline?s.jsxs("span",{className:"inline-flex items-center gap-1.5 text-red-400 text-sm",children:[s.jsx(jt,{size:14}),s.jsxs("span",{children:["Error",this.props.name?` in ${this.props.name}`:""]}),s.jsx("button",{onClick:this.reset,className:"text-red-300 hover:text-red-200 underline",children:"retry"})]}):s.jsxs("div",{className:"my-2 border border-red-500/30 rounded-lg overflow-hidden bg-red-500/5",children:[s.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-red-500/20",children:[s.jsx(jt,{size:14,className:"text-red-400 flex-shrink-0"}),s.jsxs("span",{className:"text-xs font-semibold uppercase tracking-wider text-red-400",children:["Render Error",this.props.name?` - ${this.props.name}`:""]}),s.jsxs("button",{onClick:this.reset,className:"ml-auto flex items-center gap-1 px-2 py-1 text-xs text-red-300 hover:text-red-200 hover:bg-red-500/10 rounded transition-colors",children:[s.jsx(ds,{size:12}),"Retry"]})]}),s.jsxs("div",{className:"px-3 py-2",children:[s.jsx("p",{className:"text-sm text-red-200 font-medium",children:this.state.error.message}),this.state.error.stack&&s.jsxs("div",{className:"mt-2",children:[s.jsxs("button",{onClick:this.toggleStack,className:"flex items-center gap-1 text-xs text-red-400/70 hover:text-red-400 transition-colors",children:[this.state.showStack?s.jsx(jh,{size:12}):s.jsx(Ot,{size:12}),this.state.showStack?"Hide":"Show"," stack trace"]}),this.state.showStack&&s.jsx("pre",{className:"mt-2 text-xs text-red-300/60 font-mono whitespace-pre-wrap overflow-x-auto max-h-48 overflow-y-auto",children:this.state.error.stack})]})]})]}):this.props.children}}function S_({error:t,reset:e}){return s.jsx("div",{className:"min-h-dvh bg-background flex items-center justify-center p-4",children:s.jsx("div",{className:"max-w-md w-full",children:s.jsxs("div",{className:"border border-red-500/30 rounded-lg overflow-hidden bg-red-500/5",children:[s.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-red-500/20",children:[s.jsx(jt,{size:18,className:"text-red-400"}),s.jsx("span",{className:"text-sm font-semibold text-red-400",children:"Application Error"})]}),s.jsxs("div",{className:"p-4 space-y-4",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Something went wrong while rendering the application."}),s.jsx("p",{className:"text-sm text-red-200 font-mono bg-red-500/10 px-3 py-2 rounded",children:t.message}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs("button",{onClick:e,className:"flex items-center gap-2 px-4 py-2 bg-red-500/20 hover:bg-red-500/30 text-red-200 rounded transition-colors",children:[s.jsx(ds,{size:14}),"Try Again"]}),s.jsx("button",{onClick:()=>window.location.reload(),className:"px-4 py-2 text-muted-foreground hover:text-foreground transition-colors",children:"Reload Page"})]})]})]})})})}const E_=Ce.lazy(async()=>({default:(await _(()=>import("./CodeHighlight-CrO5apPc.js"),__vite__mapDeps([105,102,104,103]))).CodeHighlight}));function Ac({code:t,className:e=""}){return s.jsx("pre",{className:Le("m-0 overflow-x-auto bg-zinc-950 px-3 py-2.5 font-mono text-[10px] leading-relaxed text-zinc-400",e),children:s.jsx("code",{children:t.trimEnd()})})}function T_(t){return s.jsx(Ys,{inline:!0,name:"CodeHighlight",fallback:s.jsx(Ac,{code:t.code,className:t.className}),children:s.jsx(d.Suspense,{fallback:s.jsx(Ac,{code:t.code,className:t.className}),children:s.jsx(E_,{...t})})})}const I_={},A_={};function Rc({src:t,alt:e="Attached",className:n="max-w-[200px] max-h-[200px] rounded border border-zinc-600 object-contain"}){const[r,o]=d.useState(!0),[a,i]=d.useState(!1),l=d.useCallback(()=>o(!1),[]),c=d.useCallback(()=>{o(!1),i(!0)},[]);return a?s.jsx("div",{className:`${n} flex items-center justify-center bg-zinc-800/50`,children:s.jsx("span",{className:"text-xs text-zinc-500",children:"Failed to load"})}):s.jsxs("div",{className:"relative inline-block",children:[r&&s.jsx("div",{className:`${n} flex items-center justify-center bg-zinc-800/50 absolute inset-0`,children:s.jsx(Ee,{size:20,className:"animate-spin text-cyan-400"})}),s.jsx("img",{src:t,alt:e,className:`${n} ${r?"invisible":"visible"}`,onLoad:l,onError:c})]})}function R_(t){return t.replace(/<!--\s*NEXT_STEPS\s*\n[\s\S]*?-->/g,"").trim()}function P_(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function M_(t,e){if(typeof t=="string"){const r=t.trim();if(r.length>0&&r.toLowerCase()!=="unknown")return r}const n=[e.tool_name,e.toolName,e.recipient_name,e.recipientName];for(const r of n)if(typeof r=="string"){const o=r.trim();if(o.length>0&&o.toLowerCase()!=="unknown")return o}return"Tool"}function L_(t){const e=[],n=/`?★\s*Insight\s*─+`?\s*([\s\S]*?)\s*`?─{5,}`?/g;let r=0,o;for(;(o=n.exec(t))!==null;){if(o.index>r){const a=t.slice(r,o.index).trim();a&&e.push({type:"text",content:a})}e.push({type:"insight",content:o[1].trim()}),r=o.index+o[0].length}if(r<t.length){const a=t.slice(r).trim();a&&e.push({type:"text",content:a})}return e.length===0&&e.push({type:"text",content:t}),e}function O_(t){return t.replace(/^(\d+)\./gm,"$1\\.")}function Pc({text:t,markdownComponents:e}){const n=L_(t),[r,o]=d.useState(!1),a=l=>{l.stopPropagation();const c=document.createElement("textarea");c.value=t,c.style.position="fixed",c.style.left="-9999px",c.style.top="-9999px",document.body.appendChild(c),c.focus(),c.select();try{document.execCommand("copy"),o(!0),setTimeout(()=>o(!1),2e3)}catch(u){console.error("Failed to copy:",u)}document.body.removeChild(c)},i=s.jsxs("div",{className:"border border-blue-500/15 rounded-lg overflow-hidden bg-blue-500/5 w-fit max-w-full",children:[s.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 border-b border-blue-500/10",children:[s.jsx(as,{size:12,className:"text-blue-400/80 flex-shrink-0"}),s.jsx("span",{className:"text-[11px] text-zinc-400 font-medium",children:"Agent"}),s.jsx("div",{className:"flex-1"}),s.jsx("button",{type:"button",onClick:a,onPointerDown:l=>l.stopPropagation(),className:"p-1 rounded hover:bg-zinc-800/40 text-zinc-600 hover:text-zinc-400 opacity-100 sm:opacity-0 sm:group-hover/response:opacity-100 transition-opacity touch-manipulation",title:r?"Copied!":"Copy response",children:r?s.jsx(Pe,{size:12,className:"text-green-500"}):s.jsx(Bt,{size:12})})]}),s.jsx("div",{className:"px-3 py-2 prose max-w-none text-[13px] leading-relaxed dark:prose-invert",children:n.map((l,c)=>l.type==="insight"?s.jsx("div",{className:"my-3 not-prose",children:s.jsxs("div",{className:"border border-zinc-800/40 rounded-lg overflow-hidden bg-zinc-900/30",children:[s.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 border-b border-zinc-800/40",children:[s.jsx(_a,{size:12,className:"text-yellow-400/80 flex-shrink-0"}),s.jsx("span",{className:"text-[10px] text-zinc-400 font-medium",children:"Insight"})]}),s.jsx("div",{className:"px-3 py-2 prose max-w-none text-[13px] leading-relaxed dark:prose-invert",children:s.jsx(Eo,{remarkPlugins:[Ns],components:e,children:l.content})})]})},c):s.jsx(Eo,{remarkPlugins:[Ns],components:e,children:O_(l.content)},c))})]});return s.jsx("div",{className:"group/response relative",children:i})}const D_=[{pattern:/^\/prototype\/(.+)$/,getInfo:t=>({label:t[1].replace(/-/g," ").replace(/\b\w/g,e=>e.toUpperCase()),icon:Gl})},{pattern:/^\/c\/([a-f0-9-]+)$/,getInfo:t=>({label:`Session ${t[1].slice(0,8)}`,icon:Tf})},{pattern:/^\/dev$/,getInfo:()=>({label:"Dev Hub",icon:ka})},{pattern:/^\/session\/([a-f0-9-]+)\/review$/,getInfo:t=>({label:`Analysis ${t[1].slice(0,8)}`,icon:vi})},{pattern:/^\/analysis\/cross-session$/,getInfo:()=>({label:"Cross-session analysis",icon:vi})}];function Mc(t){if(!t)return null;let e;if(t.startsWith("/"))e=t;else try{const n=new URL(t),r=n.hostname;if(!(r==="localhost"||r==="127.0.0.1"||/^\d+\.\d+\.\d+\.\d+$/.test(r)))return null;e=n.pathname}catch{return null}for(const{pattern:n,getInfo:r}of D_){const o=e.match(n);if(o)return{path:e,...r(o)}}return null}function Lc({route:t}){return s.jsxs("a",{href:t.path,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 not-prose px-3 py-1 my-0.5 rounded-sm border border-cyan-500/40 bg-cyan-500/20 hover:bg-cyan-500/30 active:bg-cyan-500/35 transition-all duration-100 no-underline select-none align-middle cursor-pointer",style:{touchAction:"manipulation"},children:[s.jsx(t.icon,{size:11,className:"text-cyan-300 flex-shrink-0"}),s.jsx("span",{className:"text-[10px] font-display font-bold uppercase tracking-wider text-cyan-300 truncate max-w-[200px]",children:t.label}),s.jsx(os,{size:9,className:"text-cyan-300/40 flex-shrink-0"})]})}const lo={a({href:t,children:e}){const n=Mc(t);if(n)return s.jsx(Lc,{route:n});const r=t?.startsWith("/");return s.jsx("a",{href:t,target:r?void 0:"_blank",rel:r?void 0:"noopener noreferrer",className:"text-cyan-400 hover:text-cyan-300 underline underline-offset-2",children:e})},table({children:t}){return s.jsx("div",{className:"my-3 not-prose",children:s.jsx("div",{className:"border border-zinc-800/40 rounded-lg overflow-hidden bg-zinc-900/30",children:s.jsx("div",{className:"overflow-x-auto",children:s.jsx("table",{className:"w-full text-sm",children:t})})})})},thead({children:t}){return s.jsx("thead",{className:"bg-zinc-800/20 border-b border-zinc-800/40",children:t})},tbody({children:t}){return s.jsx("tbody",{className:"divide-y divide-zinc-800/40",children:t})},tr({children:t}){return s.jsx("tr",{className:"hover:bg-zinc-800/20 transition-colors",children:t})},th({children:t}){return s.jsx("th",{className:"px-3 py-2 text-left text-xs font-semibold uppercase tracking-wider text-zinc-400",children:t})},td({children:t}){return s.jsx("td",{className:"px-3 py-2 text-foreground",children:t})},code({node:t,inline:e,className:n,children:r,...o}){const a=/language-(\w+)/.exec(n||""),i=a?a[1]:"text";if(!e&&a)return s.jsx(T_,{code:String(r).replace(/\n$/,""),language:i,className:"rounded-md overflow-hidden max-w-full box-border"});const l=String(r).trim();if(/^https?:\/\//.test(l)){const c=Mc(l);if(c)return s.jsx(Lc,{route:c})}return s.jsx("code",{className:n,...o,children:r})}};function ip({message:t,toolResults:e=I_,childrenMessages:n=A_,expandedTasks:r=new Set,onToggleTaskExpanded:o,isFirstInGroup:a=!0,isLastInGroup:i=!0,isStreaming:l=!1,currentQuestionRequest:c,onAnswerQuestion:u,onPlanApprove:p,onPlanReject:m,planOutcomes:h}){const g=d.useRef(l),[f,x]=d.useState(new Set),[b,y]=d.useState(!1);if(d.useMemo(()=>{if(!Array.isArray(t.content))return{};const v={};return t.content.forEach(w=>{if(w&&typeof w=="object"&&w.type==="tool_result"){const N=w.tool_use_id;if(N){const C=w.content,T=(Array.isArray(C),C);v[N]={status:"completed",result:typeof T=="string"||Array.isArray(T)?T:void 0,is_error:w.is_error}}}}),v},[t.content]),t.type==="user"){let v=typeof t.content=="string"?t.content:Array.isArray(t.content)?t.content.filter(R=>R.type==="text").map(R=>R.text||"").join(`
131
131
  `):"";v=v.trim();const w=Array.isArray(t.content)?t.content.filter(R=>R.type==="image"||R.type==="document"):[];if(!v&&w.length===0)return null;const N=v.split(`
132
132
  `),C=N.length>8,T=b?N:N.slice(0,8),S=N.length-8,j=T.join(`
133
133
  `),E=s.jsxs("div",{className:"group/user relative border border-cyan-500/15 rounded-lg overflow-hidden bg-cyan-500/5 w-full",children:[s.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 border-b border-cyan-500/10",children:[s.jsx(Yl,{size:12,className:"text-cyan-400/80 flex-shrink-0"}),s.jsx("span",{className:"text-[11px] text-zinc-400 font-medium",children:"User"}),s.jsx("div",{className:"flex-1"}),C&&s.jsx("button",{onClick:()=>y(!b),className:"w-5 h-5 border-none bg-transparent text-zinc-500 cursor-pointer flex items-center justify-center p-0 hover:text-zinc-300","aria-label":b?"Show fewer lines":"Show all lines",children:b?s.jsx(Rf,{size:14}):s.jsx(Nf,{size:14})})]}),s.jsxs("div",{className:"px-3 py-2 text-[13px] leading-relaxed text-foreground",children:[w.length>0&&s.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:w.map((R,D)=>{if(R.type==="image"&&R.source){const $=R.source.type==="base64"?`data:${R.source.media_type};base64,${R.source.data}`:R.source.url;return s.jsx(Rc,{src:$,alt:"Attached",className:"max-w-[200px] max-h-[200px] rounded border border-zinc-600 object-contain"},`img-${D}`)}return R.type==="document"?s.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1 rounded bg-amber-500/10 border border-amber-500/20",children:[s.jsx(Po,{size:14,className:"text-amber-400"}),s.jsx("span",{className:"text-xs text-amber-300",children:"PDF"})]},`doc-${D}`):null})}),s.jsxs("div",{className:"whitespace-pre-wrap break-words",children:[j,!b&&C&&s.jsxs("span",{className:"text-muted-foreground italic",children:[`
@@ -187,7 +187,7 @@ Please work through these notes systematically. For each one, either:
187
187
  2. Investigate and propose a solution if complex
188
188
  3. Ask clarifying questions if the note is ambiguous
189
189
 
190
- Mark each note as addressed as you complete it.`,r}async function Mp(t,e,n,r,o={}){if(e.length===0&&n.length===0)return null;const a=q2(e,n),i=o.provider||"claude",l=o.model;return H2({prompt:a,provider:i,model:l,workspace:o.workspace,workingDirectory:r,permissionMode:o.permissionMode,createdAt:new Date().toISOString()}),t.createConversation({provider:i,message:a,workingDirectory:r,model:l,permissionMode:o.permissionMode,workspace:o.workspace})}const Lp="claudia-last-permission-mode";function pa(t,e){const n=t==="acceptEdits"?"acceptEdits":t==="bypassPermissions"?"bypassPermissions":"default";return e==="claude"&&n==="acceptEdits"?"default":n}function W2(t,e){try{const n=localStorage.getItem(Lp);if(n==="default"||n==="acceptEdits"||n==="bypassPermissions")return pa(n,e)}catch{}return pa(t,e)}function ln(t){const{explicit:e,fallback:n,provider:r}=t;return typeof e=="string"&&e.length>0?pa(e,r):W2(n,r)}function ma(t){try{localStorage.setItem(Lp,t)}catch{}}const sl={codebase:{icon:ka,text:"text-emerald-400",bg:"bg-emerald-500/10"},project_instructions:{icon:Io,text:"text-sky-400",bg:"bg-sky-500/10"},global_instructions:{icon:ja,text:"text-purple-400",bg:"bg-purple-500/10"}};function nl(t){const e=new Date(t),r=new Date().getTime()-e.getTime(),o=Math.floor(r/6e4),a=Math.floor(r/36e5),i=Math.floor(r/864e5);return o<1?"just now":o<60?`${o}m`:a<24?`${a}h`:i<7?`${i}d`:e.toLocaleDateString()}function rl(t){return[...t].sort((e,n)=>new Date(n.createdAt).getTime()-new Date(e.createdAt).getTime())}function Op({isOpen:t,onClose:e,onLaunchSession:n,defaultProvider:r="claude",defaultPermissionMode:o,initialProvider:a,initialPermissionMode:i}){const l=St(),[c,u]=d.useState([]),[p,m]=d.useState([]),[h,g]=d.useState(()=>{try{return localStorage.getItem("lattice-dev-note-draft")||""}catch{return""}}),f=K=>{g(K);try{K?localStorage.setItem("lattice-dev-note-draft",K):localStorage.removeItem("lattice-dev-note-draft")}catch{}},[x,b]=d.useState(!1),[y,v]=d.useState(!1),[w,N]=d.useState(!1),[C,T]=d.useState(null),[S,j]=d.useState(a||r),[E,R]=d.useState(()=>ln({explicit:i,fallback:o,provider:a||r})),[D,$]=d.useState(null),[ne,oe]=d.useState(""),[V,X]=d.useState(!1),[H,W]=d.useState(null),[fe,L]=d.useState(null),G=d.useRef(null),Z=rl(c),F=c.length+p.length,se=d.useMemo(()=>{const K=new Map;for(const me of p){const O=me.sourceProject||"General";K.has(O)||K.set(O,[]),K.get(O).push(me)}return[...K.entries()]},[p]);d.useEffect(()=>{t&&(N(!1),T(null),$(null),oe(""),a&&j(a),i&&R(ln({explicit:i,fallback:o,provider:a||r})),L(go()?.prompt||null),ee(),setTimeout(()=>G.current?.focus(),100))},[t,a,i,o,r]),d.useEffect(()=>{S==="claude"&&E==="acceptEdits"&&(R("default"),ma("default"))},[S,E]);const te=d.useCallback(async()=>{const K=fe||go()?.prompt;if(!K)return;try{if(navigator?.clipboard?.writeText){await navigator.clipboard.writeText(K);return}}catch{}const me=document.createElement("textarea");me.value=K,me.style.position="fixed",me.style.left="-9999px",me.style.top="-9999px",document.body.appendChild(me),me.focus(),me.select(),document.execCommand("copy"),document.body.removeChild(me)},[fe]),ee=async()=>{b(!0),W(null);try{const[K,me]=await Promise.all([U.getDevNotes(),U.getPendingRecommendations()]);u(rl(K.notes)),m(me.recommendations)}catch(K){W("Failed to load queue"),console.error("Failed to fetch action queue:",K)}finally{b(!1)}},pe=d.useCallback(async()=>{if(!(!h.trim()||y)){v(!0),W(null);try{await U.createDevNote({content:h.trim()}),f(""),await ee()}catch(K){W("Failed to create note"),console.error("Failed to create dev note:",K)}finally{v(!1)}}},[h,y]),_e=K=>{K.key==="Enter"&&!K.shiftKey&&(K.preventDefault(),pe())},A=async K=>{try{await U.updateDevNoteStatus(K,"done"),D===K&&($(null),oe("")),u(me=>me.filter(O=>O.id!==K))}catch(me){console.error("Failed to mark note as done:",me)}},M=async K=>{try{await U.deleteDevNote(K),D===K&&($(null),oe("")),u(me=>me.filter(O=>O.id!==K))}catch(me){console.error("Failed to delete note:",me)}},he=d.useCallback(K=>{$(K.id),oe(K.content)},[]),Y=d.useCallback(()=>{$(null),oe("")},[]),B=d.useCallback(async()=>{if(!D||V)return;const K=ne.trim();if(!K){W("Note content cannot be empty");return}X(!0),W(null);try{await U.updateDevNote(D,{content:K}),u(me=>me.map(O=>O.id===D?{...O,content:K}:O)),Y()}catch(me){W("Failed to update note"),console.error("Failed to update dev note:",me)}finally{X(!1)}},[D,ne,V,Y]),ye=async K=>{try{await U.completeRecommendation(K),m(me=>me.filter(O=>O.id!==K))}catch(me){console.error("Failed to complete recommendation:",me)}},I=async K=>{try{await U.dismissRecommendation(K),m(me=>me.filter(O=>O.id!==K))}catch(me){console.error("Failed to dismiss recommendation:",me)}},ce=d.useCallback(async()=>{if(C){e(),l(`/c/${C}`);return}if(!(F===0||!n||w)){N(!0),W(null);try{const K=await n(c,p,S,E);K?.sessionId?T(K.sessionId):W("Session started but no session ID was returned")}catch(K){W("Failed to start session"),L(go()?.prompt||null),console.error("Failed to launch queue session:",K)}finally{N(!1)}}},[C,F,n,w,c,p,e,l,S,E]),ve=d.useCallback(K=>{R(K),ma(K)},[]),Ve=[{mode:"default",label:"Ask",icon:Rs,activeClasses:"bg-cyan-500/20 text-cyan-300 border border-cyan-500/40",description:"Prompt before every tool use."},{mode:"bypassPermissions",label:"Trust",icon:pr,activeClasses:"bg-amber-500/20 text-amber-300 border border-amber-500/40",description:"Skip all permission prompts. Runs freely with no restrictions."}],Ae=()=>Z.length===0?null:s.jsxs("div",{className:"mb-1",children:[s.jsxs("div",{className:"flex items-center gap-2 px-3 py-1",children:[s.jsx(Ks,{size:10,className:"text-amber-400"}),s.jsx("span",{className:"text-[10px] font-display font-bold uppercase tracking-wider text-amber-400",children:"Notes"})]}),s.jsx("div",{className:"space-y-0.5",children:Z.map(K=>s.jsxs("div",{className:"group px-3 py-1.5 hover:bg-muted/20 transition-colors",children:[D===K.id?s.jsxs("div",{className:"space-y-2",children:[s.jsx("input",{value:ne,onChange:me=>oe(me.target.value),className:"w-full px-2 py-1.5 text-sm font-mono bg-background/60 border border-cyan-500/30 rounded-sm text-foreground focus:outline-none focus:border-cyan-400/60",onKeyDown:me=>{me.key==="Enter"&&!me.shiftKey&&(me.preventDefault(),B())}}),s.jsx("div",{className:"flex items-center justify-end gap-1",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("button",{onClick:()=>{B()},disabled:V||!ne.trim(),className:"p-1 text-muted-foreground/50 hover:text-emerald-400 cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",title:"Save note",children:V?s.jsx(Ee,{size:12,className:"animate-spin"}):s.jsx(Pe,{size:12})}),s.jsx("button",{onClick:Y,disabled:V,className:"p-1 text-muted-foreground/50 hover:text-rose-400 cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",title:"Cancel edit",children:s.jsx(Fe,{size:12})})]})})]}):s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("p",{className:"flex-1 min-w-0 text-sm font-mono text-foreground/80 leading-snug break-words",children:K.content}),s.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0 pt-0.5",children:[s.jsx("span",{className:"hidden sm:inline text-[10px] font-mono text-muted-foreground/30 opacity-0 group-hover:opacity-100 transition-opacity",children:nl(K.createdAt)}),s.jsxs("div",{className:"flex gap-1 opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-opacity",children:[s.jsx("button",{onClick:()=>he(K),className:"p-1 text-muted-foreground/50 hover:text-cyan-400 cursor-pointer",title:"Edit note",children:s.jsx(va,{size:12})}),s.jsx("button",{onClick:()=>{A(K.id)},className:"p-1 text-muted-foreground/50 hover:text-emerald-400 cursor-pointer",title:"Mark done",children:s.jsx(Pe,{size:12})}),s.jsx("button",{onClick:()=>{M(K.id)},className:"p-1 text-muted-foreground/50 hover:text-rose-400 cursor-pointer",title:"Delete note",children:s.jsx(Lo,{size:12})})]})]})]}),s.jsx("div",{className:"h-0.5"})]},K.id))})]});return t?s.jsxs("div",{className:"fixed inset-0 z-50 flex items-start justify-center",style:{paddingTop:"calc(env(safe-area-inset-top, 0px) + 10vh)",paddingRight:"calc(env(safe-area-inset-right, 0px) + 1rem)",paddingBottom:"calc(env(safe-area-inset-bottom, 0px) + 1rem)",paddingLeft:"calc(env(safe-area-inset-left, 0px) + 1rem)"},children:[s.jsx("button",{type:"button",className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:e,"aria-label":"Close queue dialog"}),s.jsxs("div",{className:"relative z-10 w-full max-w-md mx-4 bg-background border border-border rounded-sm shadow-xl overflow-hidden max-h-[80vh] flex flex-col",children:[s.jsx("div",{className:"absolute inset-0 bg-[linear-gradient(rgba(0,255,255,0.02)_1px,transparent_1px),linear-gradient(90deg,rgba(0,255,255,0.02)_1px,transparent_1px)] bg-[size:16px_16px] pointer-events-none"}),s.jsxs("div",{className:"relative border-b border-border/50",children:[s.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ks,{size:14,className:"text-cyan-400"}),s.jsx("span",{className:"text-[10px] font-display font-bold text-cyan-400 uppercase tracking-wider",children:"Action Queue"})]}),F>0&&s.jsx("div",{className:"flex items-center gap-1",children:p.length>0&&s.jsx("span",{className:"min-w-[18px] h-[18px] flex items-center justify-center text-[9px] font-bold bg-purple-500/20 text-purple-400 border border-purple-500/30 rounded-sm",children:p.length})})]}),s.jsx("button",{onClick:e,className:"p-1 text-muted-foreground hover:text-cyan-400 transition-colors cursor-pointer",children:s.jsx(Fe,{size:14})})]}),s.jsx("p",{className:"px-4 pb-2 text-[11px] leading-relaxed text-muted-foreground/70",children:"Backlog for future sessions. Items stay here until you start a dedicated session. This is separate from the per-session message queue in the composer."})]}),s.jsx("div",{className:"relative px-4 py-3 border-b border-border/30",children:s.jsxs("div",{className:"flex gap-2",children:[s.jsx("input",{ref:G,value:h,onChange:K=>f(K.target.value),onKeyDown:_e,placeholder:"Add a note...",className:"flex-1 px-3 py-1.5 bg-background/50 border border-border/50 rounded-sm text-sm font-mono placeholder:text-muted-foreground/40 focus:outline-none focus:border-cyan-500/50"}),s.jsx("button",{onClick:()=>{pe()},disabled:!h.trim()||y,className:"px-2.5 py-1.5 rounded-sm border border-cyan-500/30 text-cyan-400 hover:bg-cyan-500/10 hover:border-cyan-400 transition-all cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",children:y?s.jsx(Ee,{size:14,className:"animate-spin"}):s.jsx(Wl,{size:14})})]})}),s.jsx("div",{className:"relative flex-1 overflow-y-auto p-2 min-h-[150px] max-h-96 flex flex-col",children:x?s.jsx("div",{className:"flex flex-1 items-center justify-center py-8",children:s.jsx(Ee,{size:20,className:"animate-spin text-muted-foreground"})}):H?s.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 py-8 text-rose-400",children:[s.jsxs("div",{className:"flex items-center justify-center gap-2",children:[s.jsx(Cs,{size:16}),s.jsx("span",{className:"text-sm font-mono",children:H})]}),fe&&s.jsx("button",{onClick:()=>{te()},className:"px-2 py-1 rounded-sm border border-rose-500/30 text-[10px] font-mono font-bold uppercase tracking-wider hover:bg-rose-500/10 hover:border-rose-400 cursor-pointer",children:"Copy Last Prompt"})]}):F===0?s.jsxs("div",{className:"flex flex-1 min-h-[220px] flex-col items-center justify-center py-8 text-center text-muted-foreground/50",children:[s.jsx(Ks,{size:24,className:"mb-2 opacity-50"}),s.jsx("span",{className:"text-sm font-mono",children:"Action queue empty"}),s.jsx("span",{className:"text-xs font-mono mt-1",children:"Add a note above, or review a session to generate recommendations"})]}):s.jsxs(s.Fragment,{children:[Ae(),p.length>0&&s.jsxs(s.Fragment,{children:[c.length>0&&s.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 mt-2",children:[s.jsx("div",{className:"flex-1 border-t border-purple-500/20"}),s.jsx("span",{className:"text-[9px] font-mono font-bold text-purple-400/60 uppercase tracking-wider",children:"ai"}),s.jsx("div",{className:"flex-1 border-t border-purple-500/20"})]}),s.jsxs("div",{className:"mb-1",children:[s.jsxs("div",{className:"flex items-center gap-2 px-3 py-1",children:[s.jsx(hh,{size:10,className:"text-purple-400"}),s.jsx("span",{className:"text-[10px] font-mono font-bold uppercase tracking-wider text-purple-400",children:"Recommendations"}),s.jsxs("span",{className:"text-[10px] font-mono text-muted-foreground/30",children:["(",p.length,")"]})]}),se.map(([K,me])=>s.jsxs("div",{className:"mb-2",children:[s.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5",children:[s.jsx("span",{className:"text-[10px] font-display font-bold uppercase tracking-wider text-cyan-400/70",children:K}),s.jsx("span",{className:"text-[10px] font-mono text-muted-foreground/20",children:me.length})]}),s.jsx("div",{className:"space-y-0.5",children:me.map(O=>{const J=sl[O.target]||sl.codebase,q=J.icon,ae=O.friction?(()=>{const be=G2(O.friction).friction,ge=be.match(/^[^.!?]+[.!?]/)?.[0]||be;return ge.length>140?ge.slice(0,140)+"...":ge})():"";return s.jsxs("div",{className:"group px-3 py-2 hover:bg-muted/20 transition-colors",children:[s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("div",{className:`p-1 rounded ${J.bg} flex-shrink-0 mt-0.5`,children:s.jsx(q,{size:10,className:J.text})}),s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("p",{className:"text-sm font-mono text-foreground/80 leading-snug",children:O.action})})]}),ae&&s.jsx("p",{className:"text-[11px] font-mono text-muted-foreground/40 mt-1 pl-7 leading-snug line-clamp-2",children:ae}),s.jsxs("div",{className:"flex items-center gap-2 mt-1.5 pl-7",children:[s.jsx("span",{className:"text-[10px] font-mono text-muted-foreground/30",children:nl(O.createdAt)}),O.sessionId&&s.jsxs("button",{onClick:()=>{e(),l(`/c/${O.sessionId}`)},className:"flex items-center gap-1 text-[10px] font-mono text-muted-foreground/30 hover:text-cyan-400/70 transition-colors cursor-pointer",title:O.sourceMission||"View source session",children:[s.jsx(os,{size:9}),s.jsx("span",{className:"truncate max-w-[160px]",children:O.sourceMission||"session"})]}),s.jsx("div",{className:"flex-1"}),s.jsxs("div",{className:"flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[s.jsx("button",{onClick:()=>{ye(O.id)},className:"p-1 text-muted-foreground/50 hover:text-emerald-400 cursor-pointer",title:"Mark complete",children:s.jsx(Pe,{size:12})}),s.jsx("button",{onClick:()=>{I(O.id)},className:"p-1 text-muted-foreground/50 hover:text-rose-400 cursor-pointer",title:"Dismiss",children:s.jsx(Lo,{size:12})})]})]})]},O.id)})})]},K))]})]})]})}),F>0&&n&&s.jsxs("div",{className:"relative px-4 py-2.5 border-t border-border/30 space-y-2",children:[!C&&s.jsx("div",{className:"flex flex-wrap items-center gap-2",children:s.jsx("div",{className:"flex items-center rounded-sm border border-zinc-700/50 bg-zinc-900/50 p-0.5",children:Ve.map(({mode:K,label:me,icon:O,activeClasses:J,description:q})=>{const ae=E===K;return s.jsxs("button",{onClick:()=>ve(K),disabled:w,title:q,className:`flex items-center gap-1 px-2 py-1 rounded-sm text-[10px] font-display font-bold uppercase tracking-wider transition-all duration-100 cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed ${ae?J:"text-zinc-500 hover:text-zinc-400 border border-transparent"}`,children:[s.jsx(O,{size:10}),me]},K)})})}),s.jsx("button",{onClick:()=>{ce()},disabled:w,className:"w-full flex items-center justify-center gap-2 py-1.5 rounded-sm ui-action-btn ui-action-btn--cool text-[10px] font-display font-bold uppercase tracking-wider bg-background/80 backdrop-blur-sm disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:shadow-none disabled:hover:translate-x-0 disabled:hover:translate-y-0",children:w?s.jsxs(s.Fragment,{children:[s.jsx(Ee,{size:12,className:"animate-spin"}),"Starting Session..."]}):C?s.jsxs(s.Fragment,{children:[s.jsx(Ht,{size:12}),"Go to Session"]}):s.jsxs(s.Fragment,{children:[s.jsx(Ht,{size:12}),"Start Session"]})})]})]})]}):null}const K2=200,oi=["conversations","archived-sidebar"];function Q2(t){const{enabled:e}=t,{data:n,isLoading:r}=Ct({queryKey:oi,queryFn:async()=>((await U.listUnifiedConversations({archived:!0,includeIdentityImage:!1,limit:K2})).conversations||[]).filter(a=>a.archived).sort((a,i)=>new Date(i.updatedAt).getTime()-new Date(a.updatedAt).getTime()),enabled:e,staleTime:6e4,refetchOnWindowFocus:!1});return{archivedSessions:n||[],isLoading:r}}function Y2(t,e){if(!t)return t;const n=t.conversations.filter(r=>r.conversationId!==e);return n.length===t.conversations.length?t:{...t,conversations:n,total:Math.max(0,t.total-1)}}function On(t,e,n){return t+(e-t)*n}function Gs(t,e,n){return[On(t[0],e[0],n),On(t[1],e[1],n),On(t[2],e[2],n),On(t[3],e[3],n)]}function at(t){return`rgba(${Math.round(t[0])},${Math.round(t[1])},${Math.round(t[2])},${t[3].toFixed(3)})`}const xo=[120,120,130,.2],Ze=[251,191,36,.8],Hs=[52,211,153,1];function J2(t){if(t>=2)return{strokeColor:at(Hs),fillColor:at(Hs),fillOpacity:.6,borderColor:at(Hs),textColor:at(Hs),bgColor:"rgba(16,185,129,0.08)",scanning:!1,glowOpacity:.04};if(t>=1){const l=t-1,c=Gs(Ze,Hs,l*.3);return{strokeColor:at(c),fillColor:at(c),fillOpacity:.6,borderColor:at([c[0],c[1],c[2],.4]),textColor:at([c[0],c[1],c[2],.8]),bgColor:"transparent",scanning:!0,glowOpacity:0}}const e=Math.max(0,Math.min(t,.99)),n=Gs(xo,[Ze[0],Ze[1],Ze[2],.45],e),r=Gs(xo,[Ze[0],Ze[1],Ze[2],.55],e),o=e*e*.55,a=Math.max(0,(e-.5)*2),i=Gs([120,120,130,0],[Ze[0],Ze[1],Ze[2],a*.2],a);return{strokeColor:at(n),fillColor:at(r),fillOpacity:o,borderColor:at(i),textColor:at(Gs(xo,[Ze[0],Ze[1],Ze[2],.5],e*.6)),bgColor:"transparent",scanning:!1,glowOpacity:0}}function ha({status:t,isLoading:e=!1,disabled:n=!1,onClick:r}){const o=!!t?.synthesisInProgress,a=t?.pendingProposals??0,i=t?.threshold?Math.min((t.pendingExtractions??0)/t.threshold,1):0,l=a>0?2:o?1:i,c=J2(l),u=e?"Checking status...":o?"Reviewing recent sessions for patterns worth acting on":a>0?`${a} proposed change${a===1?"":"s"} based on patterns across recent sessions`:i>0?`${t?.pendingExtractions}/${t?.threshold} sessions toward next analysis`:"Lattice watches how you work across sessions and proposes changes when it spots patterns";return s.jsxs(Ke,{children:[s.jsx(Qe,{asChild:!0,children:s.jsxs("button",{type:"button",onClick:r,disabled:n,"aria-label":"Cross-session insights",className:`group relative flex items-center gap-2 px-3 py-1.5 max-sm:h-10 rounded-sm text-[10px] font-display font-bold uppercase tracking-wider transition-all duration-300 overflow-hidden ${a>0?"hover:shadow-[2px_2px_0_rgba(16,185,129,0.5),-2px_-2px_0_rgba(34,211,238,0.25)] hover:translate-x-[-1px] hover:translate-y-[-1px]":""} disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:shadow-none disabled:hover:translate-x-0 disabled:hover:translate-y-0`,style:{borderWidth:1,borderStyle:"solid",borderColor:c.borderColor,color:c.textColor,backgroundColor:c.bgColor},children:[c.scanning&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"absolute top-0 left-0 h-[1px] w-full animate-[insight-scan_1.5s_linear_infinite]",style:{background:`linear-gradient(to right, transparent, ${c.strokeColor}, transparent)`}}),s.jsx("span",{className:"absolute bottom-0 right-0 h-[1px] w-full animate-[insight-scan_1.5s_linear_infinite_0.75s]",style:{background:`linear-gradient(to right, transparent, ${at([Ze[0],Ze[1],Ze[2],.4])}, transparent)`}})]}),s.jsxs("svg",{viewBox:"0 0 12 12",className:"w-3 h-3 transition-all duration-500","aria-hidden":"true",children:[s.jsx("path",{d:"M6 1 L11 6 L6 11 L1 6 Z",fill:"none",stroke:c.strokeColor,strokeWidth:"1.2"}),c.fillOpacity>.01&&s.jsx("path",{d:"M6 3.5 L8.5 6 L6 8.5 L3.5 6 Z",fill:c.fillColor,opacity:c.fillOpacity})]}),a>0&&s.jsx("span",{className:"relative",children:a}),c.glowOpacity>0&&s.jsx("span",{className:"absolute inset-0 rounded-sm",style:{backgroundColor:`rgba(52,211,153,${c.glowOpacity})`}})]})}),s.jsx(He,{children:s.jsx("p",{children:u})})]})}function Dp({count:t,onClick:e}){return s.jsxs(Ke,{children:[s.jsx(Qe,{asChild:!0,children:s.jsxs("button",{type:"button",onClick:e,"aria-label":"Notes",className:"relative flex items-center gap-2 p-1.5 min-[1440px]:px-3 min-[1440px]:py-1.5 bg-background/80 backdrop-blur-sm ui-action-btn ui-action-btn--cool text-[10px] font-display font-bold uppercase tracking-wider",children:[s.jsx(Ks,{size:14}),s.jsx("span",{className:"hidden min-[1440px]:inline",children:"NOTES"}),t>0&&s.jsx("span",{className:"min-w-[16px] h-[16px] px-1 flex items-center justify-center rounded-full bg-cyan-400/15 border border-cyan-400/30 text-[9px] leading-none text-cyan-300 pb-px pl-0.5",children:t>99?"99+":t})]})}),s.jsx(He,{side:"bottom",align:"end",className:"max-w-[300px]",children:"Action queue for future work: notes and review recommendations stay here until you launch a separate session. This is different from the composer message queue."})]})}function X2({sessionId:t,isArchived:e=!1,insightsPanelOpen:n,onToggleInsightsPanel:r,crossSessionSidebarOpen:o,onToggleCrossSessionSidebar:a,onOpenCrossSessionAnalysis:i,onOpenFeedbackPanel:l}){const c=St(),u=dn(),p=Dl(),{isPro:m}=gn(),{conversations:h,invalidateConversations:g}=Os(),{serverConfig:f}=Ds(),[x,b]=d.useState(!1),[y,v]=d.useState(!1),[w,N]=d.useState(!1),[C,T]=d.useState(0),{data:S,isLoading:j}=Ct({queryKey:["cross-session-status"],queryFn:()=>U.getCrossSessionStatus(),staleTime:1e4,refetchInterval:I=>I.state.data?.synthesisInProgress?3e3:15e3});d.useEffect(()=>{const I=async()=>{try{const[ve,Ve]=await Promise.all([U.getDevNotes(),U.getPendingRecommendations()]);T(ve.notes.length+Ve.recommendations.length)}catch{}};I();const ce=setInterval(()=>{I()},3e4);return()=>clearInterval(ce)},[]);const E=d.useCallback(()=>{N(!1),Promise.all([U.getDevNotes(),U.getPendingRecommendations()]).then(([I,ce])=>T(I.notes.length+ce.recommendations.length))},[]),R=d.useCallback(async(I,ce,ve,Ve)=>{if(I.length===0&&ce.length===0)return;const Ae=ve||"claude";try{const K=await Mp(U,I,ce,f?.defaultWorkingDirectory||f?.cwd||"~",{workspace:"main",provider:Ae,model:f?.defaultModel,permissionMode:Ve||f?.defaultPermissionMode});return K?(await g(),{sessionId:K.conversationId}):null}catch(K){throw console.error("Failed to launch queue session:",K),K}},[g,f?.defaultWorkingDirectory,f?.cwd,f?.defaultModel,f?.defaultPermissionMode]),D=async()=>{if(t)try{await U.unifiedUpdateConversation(t,{archived:!e}),e||u.setQueriesData({predicate:I=>I.queryKey[0]==="conversations"&&I.queryKey[1]==="list"},I=>Y2(I,t)),await Promise.all([g(),u.invalidateQueries({queryKey:oi})]),c("/",{replace:!0})}catch(I){console.error(`[Archive] Failed to ${e?"unarchive":"archive"} session:`,I)}},[$,ne]=d.useState(!1),oe=async()=>{if(t){ne(!0);try{await U.exportSession(t)}catch(I){console.error("Failed to export session:",I),alert(`Export failed: ${I instanceof Error?I.message:"Unknown error"}`)}finally{ne(!1)}}},V=h.find(I=>I.conversationId===t),X=!!V?.importedAt,[H,W]=d.useState(""),[fe,L]=d.useState(!1),[G,Z]=d.useState(!1),[F,se]=d.useState(!1),te=Ce.useRef(null),ee=Ce.useRef(null),pe=V?.pausedReason;d.useEffect(()=>{if(t){if(pe&&pe.trim().length>0){L(!0),W(pe);return}if(h.some(I=>I.conversationId===t)){L(!1);return}U.getConversationDetails(t,{limit:1}).then(I=>{const ce=I?.sessionInfo?.paused_reason;L(!!ce),ce&&W(ce)}).catch(()=>{})}},[t,pe,h]),d.useEffect(()=>{G&&requestAnimationFrame(()=>te.current?.focus())},[G]),d.useEffect(()=>{F&&requestAnimationFrame(()=>ee.current?.focus())},[F]);const _e=async()=>{if(!t||!H.trim())return!1;try{return await U.unifiedUpdateConversation(t,{pausedReason:H.trim()}),L(!0),Z(!1),await g(),!0}catch(I){return console.error("Failed to pause session:",I),!1}},A=async()=>{if(!t)return!1;try{return await U.unifiedUpdateConversation(t,{pausedReason:null}),L(!1),W(""),await g(),!0}catch(I){return console.error("Failed to resume session:",I),!1}},[M,he]=d.useState(!1),Y=async()=>{if(t)try{if(navigator.clipboard?.writeText)await navigator.clipboard.writeText(t);else{const I=document.createElement("textarea");I.value=t,I.style.position="fixed",I.style.left="-9999px",I.style.top="-9999px",document.body.appendChild(I),I.focus(),I.select(),document.execCommand("copy"),document.body.removeChild(I)}he(!0),setTimeout(()=>he(!1),2e3)}catch(I){console.error("Failed to copy session ID:",I)}},B=p.pathname==="/analysis/cross-session",ye=()=>{if(B)c(-1);else if(i)i();else{const I=!!S?.readyToAnalyze;c(I?"/analysis/cross-session?run=1":"/analysis/cross-session")}};return s.jsxs(Dt,{children:[s.jsxs("div",{className:"flex justify-between items-center gap-3 px-4 py-3 border-b border-border/50 bg-background transition-colors relative overflow-hidden",children:[s.jsx("div",{className:"absolute inset-0 ui-grid-overlay pointer-events-none"}),s.jsxs("div",{className:"relative flex items-center gap-3",children:[a&&!o&&s.jsx("button",{onClick:a,"aria-label":"Open sessions sidebar",className:"p-1.5 ui-icon-btn ui-icon-btn--cool",children:s.jsx(ql,{size:18})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(mp,{size:28,interactive:!0,colorScheme:"gradient"}),s.jsx("span",{className:"text-base font-display font-medium lowercase tracking-widest text-white",children:"lattice"}),s.jsx("span",{className:"font-mono text-[10px] text-muted-foreground/30 select-none",children:"b91dbdc1"})]})]}),s.jsxs("div",{className:"relative hidden sm:flex items-center gap-1 md:gap-2 min-[1440px]:gap-2 flex-shrink-0",children:[X&&s.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 rounded-sm border border-cyan-500/30 bg-cyan-500/10",children:[s.jsx(Wn,{size:12,className:"text-cyan-400"}),s.jsx("span",{className:"text-[10px] font-display font-bold uppercase tracking-wider text-cyan-400",children:"Imported · Read-only"})]}),!e&&s.jsxs(s.Fragment,{children:[s.jsx(ha,{status:S??null,isLoading:j,disabled:!S&&!j,onClick:ye}),l&&s.jsxs(Ke,{children:[s.jsx(Qe,{asChild:!0,children:s.jsxs("button",{onClick:l,"aria-label":"Send feedback",className:"flex items-center gap-2 px-3 py-1.5 rounded-sm border border-transparent text-muted-foreground/50 hover:text-muted-foreground/70 hover:border-border/20 text-[10px] font-display font-bold uppercase tracking-wider transition-all duration-100",children:[s.jsx(as,{size:12}),s.jsx("span",{className:"hidden min-[1440px]:inline",children:"FEEDBACK"})]})}),s.jsx(He,{children:s.jsx("p",{children:"Report a bug or send a comment"})})]}),s.jsx("span",{className:"h-4 w-px bg-border/20 mx-2"})]}),fe?s.jsxs("button",{onClick:()=>{A()},disabled:!t,"aria-label":"Resume session",className:"flex items-center gap-2 p-1.5 min-[1440px]:px-3 min-[1440px]:py-1.5 bg-background/80 backdrop-blur-sm ui-action-btn ui-action-btn--violet text-[10px] font-display font-bold uppercase tracking-wider disabled:opacity-50 disabled:cursor-not-allowed",children:[s.jsx(Ht,{size:14}),s.jsx("span",{className:"hidden min-[1440px]:inline",children:"RESUME"})]}):s.jsxs(Xc,{open:G,onOpenChange:Z,children:[s.jsx(Zc,{asChild:!0,children:s.jsxs("button",{disabled:!t,"aria-label":"Pause session",className:"flex items-center gap-2 p-1.5 min-[1440px]:px-3 min-[1440px]:py-1.5 bg-background/80 backdrop-blur-sm ui-action-btn ui-action-btn--violet text-[10px] font-display font-bold uppercase tracking-wider disabled:opacity-50 disabled:cursor-not-allowed",children:[s.jsx(ki,{size:14}),s.jsx("span",{className:"hidden min-[1440px]:inline",children:"PAUSE"})]})}),s.jsx(ua,{side:"bottom",align:"end",className:"w-72 p-3 bg-zinc-900/95 backdrop-blur-sm border border-violet-500/20 shadow-[0_0_12px_rgba(139,92,246,0.15)]",children:s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{htmlFor:"pause-reason-desktop",className:"text-[10px] font-mono text-violet-400/60 uppercase tracking-wider",children:"Pause reason"}),s.jsx("textarea",{id:"pause-reason-desktop",ref:te,value:H,onChange:I=>W(I.target.value),onKeyDown:I=>{I.key==="Enter"&&!I.shiftKey&&(I.preventDefault(),_e())},placeholder:"Why are you pausing? (waiting for deploy, review, etc.)",className:"w-full px-2 py-2 text-[11px] leading-relaxed bg-zinc-800/50 border border-violet-500/20 rounded-sm text-zinc-200 placeholder:text-zinc-500 focus:outline-none focus:border-violet-400/40 resize-none",rows:3}),s.jsx("button",{onClick:()=>{_e()},disabled:!H.trim(),className:"w-full px-3 py-1.5 text-[10px] font-display font-bold uppercase tracking-wider bg-violet-500/10 border border-violet-500/30 text-violet-400 rounded-sm hover:bg-violet-500/20 hover:border-violet-400 transition-all disabled:opacity-40 disabled:cursor-not-allowed",children:"Pause Session"})]})})]}),s.jsxs(Ke,{children:[s.jsx(Qe,{asChild:!0,children:s.jsxs("button",{onClick:()=>{oe()},disabled:!t||$,"aria-label":"Export session",className:"flex items-center gap-2 p-1.5 min-[1440px]:px-3 min-[1440px]:py-1.5 rounded-sm bg-background/80 backdrop-blur-sm border border-cyan-500/30 text-cyan-400 text-[10px] font-display font-bold uppercase tracking-wider hover:border-cyan-400 hover:bg-cyan-500/5 hover:shadow-[2px_2px_0_rgba(0,255,255,0.5),-2px_-2px_0_rgba(168,85,247,0.3)] hover:translate-x-[-1px] hover:translate-y-[-1px] transition-all duration-100 cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:shadow-none disabled:hover:translate-x-0 disabled:hover:translate-y-0",children:[$?s.jsx(Ee,{size:14,className:"animate-spin"}):s.jsx(Ao,{size:14}),s.jsx("span",{className:"hidden min-[1440px]:inline",children:"EXPORT"})]})}),s.jsx(He,{children:s.jsx("p",{children:"Save a portable snapshot of this session — messages, tool calls, and metadata"})})]}),s.jsxs("button",{onClick:D,disabled:!t,"aria-label":e?"Unarchive Task":"Archive Task",className:"flex items-center gap-2 p-1.5 min-[1440px]:px-3 min-[1440px]:py-1.5 bg-background/80 backdrop-blur-sm ui-action-btn ui-action-btn--rose text-[10px] font-display font-bold uppercase tracking-wider disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:shadow-none disabled:hover:translate-x-0 disabled:hover:translate-y-0",children:[s.jsx(Xs,{size:14}),s.jsx("span",{className:"hidden min-[1440px]:inline",children:e?"RESTORE":"ARCHIVE"})]}),s.jsx(Dp,{count:C,onClick:()=>N(!0)}),t&&s.jsxs(Ke,{children:[s.jsx(Qe,{asChild:!0,children:s.jsx("button",{onClick:Y,"aria-label":"Copy session ID",className:`p-1.5 ui-icon-btn ${M?"border-green-400/50 text-green-300 bg-green-500/10":"ui-icon-btn--cool"}`,children:M?s.jsx(Pe,{size:16}):s.jsx(Bt,{size:16})})}),s.jsx(He,{children:s.jsx("p",{children:M?"Copied!":"For linking to this session in notes, bugs, or conversations"})})]}),s.jsx("button",{onClick:()=>v(!0),"aria-label":"Settings",className:"p-1.5 ui-icon-btn ui-icon-btn--cool",children:s.jsx(Mo,{size:16})}),r&&(()=>{const I=m?n?null:"Turn-by-turn timeline of this session's progress":"Unlock turn-by-turn session timeline, milestones, and progress tracking",ce=s.jsxs("button",{onClick:m?r:void 0,disabled:!m,"aria-label":n?"Hide history panel":"Show history panel",className:"flex items-center gap-2 p-1.5 min-[1440px]:px-3 min-[1440px]:py-1.5 bg-background/80 backdrop-blur-sm ui-action-btn ui-action-btn--amber text-[10px] font-display font-bold uppercase tracking-wider disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:shadow-none disabled:hover:translate-x-0 disabled:hover:translate-y-0",children:[n?s.jsx(qr,{size:14}):s.jsx(Wr,{size:14}),s.jsx("span",{className:"hidden min-[1440px]:inline",children:n?"HIDE":"HISTORY"})]});return I?s.jsxs(Ke,{children:[s.jsx(Qe,{asChild:!0,children:ce}),s.jsx(He,{children:s.jsx("p",{children:I})})]}):ce})()]}),s.jsxs("div",{className:"relative flex items-center gap-3 sm:hidden",children:[e?null:s.jsx("div",{className:"mr-3",children:s.jsx(ha,{status:S??null,isLoading:j,disabled:!S&&!j,onClick:ye})}),s.jsxs(Xc,{open:x,onOpenChange:I=>{b(I),I||se(!1)},children:[s.jsx(Zc,{asChild:!0,children:s.jsx("button",{type:"button",className:"relative flex items-center justify-center w-10 h-10 bg-background/80 backdrop-blur-sm ui-action-btn ui-action-btn--cool active:bg-cyan-500/10 touch-manipulation","aria-label":"Menu",children:x?s.jsx(Fe,{size:20}):s.jsx(Sf,{size:20})})}),s.jsx(ua,{align:"end",sideOffset:8,onOpenAutoFocus:I=>I.preventDefault(),onCloseAutoFocus:I=>I.preventDefault(),className:`p-2 bg-background/95 backdrop-blur-md border border-cyan-500/30 rounded-sm z-[100] ${F?"w-64":"w-52"}`,children:s.jsx("div",{className:"flex flex-col gap-1",children:F?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"px-3 py-2 space-y-2",children:[s.jsx("div",{className:"text-[10px] font-mono text-violet-400/70 uppercase tracking-wider",children:"Pause reason"}),s.jsx("textarea",{id:"pause-reason-mobile",ref:ee,value:H,onChange:I=>W(I.target.value),onKeyDown:I=>{I.key==="Enter"&&!I.shiftKey&&(I.preventDefault(),(async()=>await _e()&&(se(!1),b(!1)))())},placeholder:"Why are you pausing?",rows:4,className:"w-full px-2 py-2 text-sm font-mono leading-relaxed bg-background/60 border border-violet-500/30 rounded-sm text-foreground placeholder:text-muted-foreground/50 focus:outline-none focus:border-violet-400/60 resize-none"})]}),s.jsxs("div",{className:"flex items-center gap-2 px-3 pb-1",children:[s.jsx("button",{onClick:()=>se(!1),className:"flex-1 px-3 py-2 rounded-sm text-xs font-display font-bold uppercase tracking-wider text-muted-foreground hover:text-foreground hover:bg-muted/20 transition-colors cursor-pointer",children:"Back"}),s.jsx("button",{onClick:()=>{(async()=>await _e()&&(se(!1),b(!1)))()},disabled:!H.trim(),className:"flex-1 px-3 py-2 rounded-sm text-xs font-display font-bold uppercase tracking-wider text-violet-400 border border-violet-500/30 hover:bg-violet-500/10 hover:border-violet-400 transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",children:"Pause"})]})]}):s.jsxs(s.Fragment,{children:[X&&s.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-2 mx-1 mb-1 rounded-sm border border-cyan-500/30 bg-cyan-500/10",children:[s.jsx(Wn,{size:14,className:"text-cyan-400"}),s.jsx("span",{className:"text-xs font-display font-bold uppercase tracking-wider text-cyan-400",children:"Imported · Read-only"})]}),r&&(m?s.jsxs("button",{onClick:()=>{r(),b(!1)},className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-sm text-amber-400 text-sm font-display font-bold uppercase tracking-wider hover:bg-amber-500/10 transition-colors cursor-pointer",children:[n?s.jsx(qr,{size:16}):s.jsx(Wr,{size:16}),s.jsx("span",{children:n?"Hide History":"History"})]}):s.jsx(Dt,{children:s.jsxs(Ke,{children:[s.jsx(Qe,{asChild:!0,children:s.jsxs("button",{disabled:!0,className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-sm text-amber-400 text-sm font-display font-bold uppercase tracking-wider disabled:opacity-50 disabled:cursor-not-allowed",children:[n?s.jsx(qr,{size:16}):s.jsx(Wr,{size:16}),s.jsx("span",{children:n?"Hide History":"History"})]})}),s.jsx(He,{children:s.jsx("p",{children:"Unlock turn-by-turn session timeline, milestones, and progress tracking"})})]})})),t&&s.jsxs("button",{onClick:()=>{Y(),setTimeout(()=>b(!1),500)},className:`flex items-center gap-3 w-full px-3 py-2.5 rounded-sm text-sm font-display font-bold uppercase tracking-wider transition-colors cursor-pointer ${M?"text-green-400 bg-green-500/10":"text-blue-400 hover:bg-blue-500/10"}`,children:[M?s.jsx(Pe,{size:16}):s.jsx(Bt,{size:16}),s.jsx("span",{children:M?"Copied!":"Copy ID"})]}),fe?s.jsxs("button",{onClick:()=>{(async()=>await A()&&b(!1))()},disabled:!t,className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-sm text-violet-400 text-sm font-display font-bold uppercase tracking-wider hover:bg-violet-500/10 transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",children:[s.jsx(Ht,{size:16}),s.jsx("span",{children:"Resume"})]}):s.jsxs("button",{onClick:()=>se(!0),disabled:!t,className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-sm text-violet-400 text-sm font-display font-bold uppercase tracking-wider hover:bg-violet-500/10 transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",children:[s.jsx(ki,{size:16}),s.jsx("span",{children:"Pause"})]}),s.jsxs("button",{onClick:()=>{oe(),b(!1)},disabled:!t||$,className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-sm text-cyan-400 text-sm font-display font-bold uppercase tracking-wider hover:bg-cyan-500/10 transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",children:[$?s.jsx(Ee,{size:16,className:"animate-spin"}):s.jsx(Ao,{size:16}),s.jsx("span",{children:"Export"})]}),s.jsxs("button",{onClick:()=>{D(),b(!1)},disabled:!t,className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-sm text-rose-400 text-sm font-display font-bold uppercase tracking-wider hover:bg-rose-500/10 transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",children:[s.jsx(Xs,{size:16}),s.jsx("span",{children:e?"Restore":"Archive"})]}),s.jsx("div",{className:"border-t border-border/30 my-1"}),l&&s.jsxs("button",{onClick:()=>{l(),b(!1)},className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-sm text-muted-foreground text-sm font-display font-bold uppercase tracking-wider hover:bg-cyan-500/10 hover:text-cyan-400 transition-colors cursor-pointer",children:[s.jsx(as,{size:16}),s.jsx("span",{children:"Feedback"})]}),s.jsxs("button",{onClick:()=>{N(!0),b(!1)},className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-sm text-cyan-400 text-sm font-display font-bold uppercase tracking-wider hover:bg-cyan-500/10 transition-colors cursor-pointer",children:[s.jsx(Ks,{size:16}),s.jsxs("span",{children:["Notes",C>0?` (${C})`:""]})]}),s.jsxs("button",{onClick:()=>{v(!0),b(!1)},className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-sm text-muted-foreground text-sm font-display font-bold uppercase tracking-wider hover:bg-cyan-500/10 hover:text-cyan-400 transition-colors cursor-pointer",children:[s.jsx(Mo,{size:16}),s.jsx("span",{children:"Settings"})]})]})})})]})]})]}),s.jsx(U2,{isOpen:y,onClose:()=>v(!1)}),s.jsx(Op,{isOpen:w,onClose:E,onLaunchSession:R,defaultProvider:"claude",defaultPermissionMode:f?.defaultPermissionMode,initialProvider:V?.activeProvider||V?.latestProvider||void 0,initialPermissionMode:V?.permissionMode||void 0})]})}const $p=d.createContext(null);function zp(){const t=d.useContext($p);if(!t)throw new Error("useToast must be used within ToastProvider");return t}function Z2({toast:t,onDismiss:e}){const[n,r]=d.useState(!1);d.useEffect(()=>{if(t.duration!==0){const c=setTimeout(e,t.duration||5e3);return()=>clearTimeout(c)}},[t.duration,e]);const o=async c=>{if(c.stopPropagation(),t.copyUrl){const u=window.location.origin+t.copyUrl;await navigator.clipboard.writeText(u),r(!0),setTimeout(()=>r(!1),2e3)}},a={success:"border-emerald-500/50",error:"border-red-500/50",info:"border-cyan-500/50"}[t.type],i={success:"text-emerald-400",error:"text-red-400",info:"text-cyan-400"}[t.type],l={success:Pe,error:Cs,info:Cs}[t.type];return s.jsxs("div",{className:`
190
+ Mark each note as addressed as you complete it.`,r}async function Mp(t,e,n,r,o={}){if(e.length===0&&n.length===0)return null;const a=q2(e,n),i=o.provider||"claude",l=o.model;return H2({prompt:a,provider:i,model:l,workspace:o.workspace,workingDirectory:r,permissionMode:o.permissionMode,createdAt:new Date().toISOString()}),t.createConversation({provider:i,message:a,workingDirectory:r,model:l,permissionMode:o.permissionMode,workspace:o.workspace})}const Lp="claudia-last-permission-mode";function pa(t,e){const n=t==="acceptEdits"?"acceptEdits":t==="bypassPermissions"?"bypassPermissions":"default";return e==="claude"&&n==="acceptEdits"?"default":n}function W2(t,e){try{const n=localStorage.getItem(Lp);if(n==="default"||n==="acceptEdits"||n==="bypassPermissions")return pa(n,e)}catch{}return pa(t,e)}function ln(t){const{explicit:e,fallback:n,provider:r}=t;return typeof e=="string"&&e.length>0?pa(e,r):W2(n,r)}function ma(t){try{localStorage.setItem(Lp,t)}catch{}}const sl={codebase:{icon:ka,text:"text-emerald-400",bg:"bg-emerald-500/10"},project_instructions:{icon:Io,text:"text-sky-400",bg:"bg-sky-500/10"},global_instructions:{icon:ja,text:"text-purple-400",bg:"bg-purple-500/10"}};function nl(t){const e=new Date(t),r=new Date().getTime()-e.getTime(),o=Math.floor(r/6e4),a=Math.floor(r/36e5),i=Math.floor(r/864e5);return o<1?"just now":o<60?`${o}m`:a<24?`${a}h`:i<7?`${i}d`:e.toLocaleDateString()}function rl(t){return[...t].sort((e,n)=>new Date(n.createdAt).getTime()-new Date(e.createdAt).getTime())}function Op({isOpen:t,onClose:e,onLaunchSession:n,defaultProvider:r="claude",defaultPermissionMode:o,initialProvider:a,initialPermissionMode:i}){const l=St(),[c,u]=d.useState([]),[p,m]=d.useState([]),[h,g]=d.useState(()=>{try{return localStorage.getItem("lattice-dev-note-draft")||""}catch{return""}}),f=K=>{g(K);try{K?localStorage.setItem("lattice-dev-note-draft",K):localStorage.removeItem("lattice-dev-note-draft")}catch{}},[x,b]=d.useState(!1),[y,v]=d.useState(!1),[w,N]=d.useState(!1),[C,T]=d.useState(null),[S,j]=d.useState(a||r),[E,R]=d.useState(()=>ln({explicit:i,fallback:o,provider:a||r})),[D,$]=d.useState(null),[ne,oe]=d.useState(""),[V,X]=d.useState(!1),[H,W]=d.useState(null),[fe,L]=d.useState(null),G=d.useRef(null),Z=rl(c),F=c.length+p.length,se=d.useMemo(()=>{const K=new Map;for(const me of p){const O=me.sourceProject||"General";K.has(O)||K.set(O,[]),K.get(O).push(me)}return[...K.entries()]},[p]);d.useEffect(()=>{t&&(N(!1),T(null),$(null),oe(""),a&&j(a),i&&R(ln({explicit:i,fallback:o,provider:a||r})),L(go()?.prompt||null),ee(),setTimeout(()=>G.current?.focus(),100))},[t,a,i,o,r]),d.useEffect(()=>{S==="claude"&&E==="acceptEdits"&&(R("default"),ma("default"))},[S,E]);const te=d.useCallback(async()=>{const K=fe||go()?.prompt;if(!K)return;try{if(navigator?.clipboard?.writeText){await navigator.clipboard.writeText(K);return}}catch{}const me=document.createElement("textarea");me.value=K,me.style.position="fixed",me.style.left="-9999px",me.style.top="-9999px",document.body.appendChild(me),me.focus(),me.select(),document.execCommand("copy"),document.body.removeChild(me)},[fe]),ee=async()=>{b(!0),W(null);try{const[K,me]=await Promise.all([U.getDevNotes(),U.getPendingRecommendations()]);u(rl(K.notes)),m(me.recommendations)}catch(K){W("Failed to load queue"),console.error("Failed to fetch action queue:",K)}finally{b(!1)}},pe=d.useCallback(async()=>{if(!(!h.trim()||y)){v(!0),W(null);try{await U.createDevNote({content:h.trim()}),f(""),await ee()}catch(K){W("Failed to create note"),console.error("Failed to create dev note:",K)}finally{v(!1)}}},[h,y]),_e=K=>{K.key==="Enter"&&!K.shiftKey&&(K.preventDefault(),pe())},A=async K=>{try{await U.updateDevNoteStatus(K,"done"),D===K&&($(null),oe("")),u(me=>me.filter(O=>O.id!==K))}catch(me){console.error("Failed to mark note as done:",me)}},M=async K=>{try{await U.deleteDevNote(K),D===K&&($(null),oe("")),u(me=>me.filter(O=>O.id!==K))}catch(me){console.error("Failed to delete note:",me)}},he=d.useCallback(K=>{$(K.id),oe(K.content)},[]),Y=d.useCallback(()=>{$(null),oe("")},[]),B=d.useCallback(async()=>{if(!D||V)return;const K=ne.trim();if(!K){W("Note content cannot be empty");return}X(!0),W(null);try{await U.updateDevNote(D,{content:K}),u(me=>me.map(O=>O.id===D?{...O,content:K}:O)),Y()}catch(me){W("Failed to update note"),console.error("Failed to update dev note:",me)}finally{X(!1)}},[D,ne,V,Y]),ye=async K=>{try{await U.completeRecommendation(K),m(me=>me.filter(O=>O.id!==K))}catch(me){console.error("Failed to complete recommendation:",me)}},I=async K=>{try{await U.dismissRecommendation(K),m(me=>me.filter(O=>O.id!==K))}catch(me){console.error("Failed to dismiss recommendation:",me)}},ce=d.useCallback(async()=>{if(C){e(),l(`/c/${C}`);return}if(!(F===0||!n||w)){N(!0),W(null);try{const K=await n(c,p,S,E);K?.sessionId?T(K.sessionId):W("Session started but no session ID was returned")}catch(K){W("Failed to start session"),L(go()?.prompt||null),console.error("Failed to launch queue session:",K)}finally{N(!1)}}},[C,F,n,w,c,p,e,l,S,E]),ve=d.useCallback(K=>{R(K),ma(K)},[]),Ve=[{mode:"default",label:"Ask",icon:Rs,activeClasses:"bg-cyan-500/20 text-cyan-300 border border-cyan-500/40",description:"Prompt before every tool use."},{mode:"bypassPermissions",label:"Trust",icon:pr,activeClasses:"bg-amber-500/20 text-amber-300 border border-amber-500/40",description:"Skip all permission prompts. Runs freely with no restrictions."}],Ae=()=>Z.length===0?null:s.jsxs("div",{className:"mb-1",children:[s.jsxs("div",{className:"flex items-center gap-2 px-3 py-1",children:[s.jsx(Ks,{size:10,className:"text-amber-400"}),s.jsx("span",{className:"text-[10px] font-display font-bold uppercase tracking-wider text-amber-400",children:"Notes"})]}),s.jsx("div",{className:"space-y-0.5",children:Z.map(K=>s.jsxs("div",{className:"group px-3 py-1.5 hover:bg-muted/20 transition-colors",children:[D===K.id?s.jsxs("div",{className:"space-y-2",children:[s.jsx("input",{value:ne,onChange:me=>oe(me.target.value),className:"w-full px-2 py-1.5 text-sm font-mono bg-background/60 border border-cyan-500/30 rounded-sm text-foreground focus:outline-none focus:border-cyan-400/60",onKeyDown:me=>{me.key==="Enter"&&!me.shiftKey&&(me.preventDefault(),B())}}),s.jsx("div",{className:"flex items-center justify-end gap-1",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("button",{onClick:()=>{B()},disabled:V||!ne.trim(),className:"p-1 text-muted-foreground/50 hover:text-emerald-400 cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",title:"Save note",children:V?s.jsx(Ee,{size:12,className:"animate-spin"}):s.jsx(Pe,{size:12})}),s.jsx("button",{onClick:Y,disabled:V,className:"p-1 text-muted-foreground/50 hover:text-rose-400 cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",title:"Cancel edit",children:s.jsx(Fe,{size:12})})]})})]}):s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("p",{className:"flex-1 min-w-0 text-sm font-mono text-foreground/80 leading-snug break-words",children:K.content}),s.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0 pt-0.5",children:[s.jsx("span",{className:"hidden sm:inline text-[10px] font-mono text-muted-foreground/30 opacity-0 group-hover:opacity-100 transition-opacity",children:nl(K.createdAt)}),s.jsxs("div",{className:"flex gap-1 opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-opacity",children:[s.jsx("button",{onClick:()=>he(K),className:"p-1 text-muted-foreground/50 hover:text-cyan-400 cursor-pointer",title:"Edit note",children:s.jsx(va,{size:12})}),s.jsx("button",{onClick:()=>{A(K.id)},className:"p-1 text-muted-foreground/50 hover:text-emerald-400 cursor-pointer",title:"Mark done",children:s.jsx(Pe,{size:12})}),s.jsx("button",{onClick:()=>{M(K.id)},className:"p-1 text-muted-foreground/50 hover:text-rose-400 cursor-pointer",title:"Delete note",children:s.jsx(Lo,{size:12})})]})]})]}),s.jsx("div",{className:"h-0.5"})]},K.id))})]});return t?s.jsxs("div",{className:"fixed inset-0 z-50 flex items-start justify-center",style:{paddingTop:"calc(env(safe-area-inset-top, 0px) + 10vh)",paddingRight:"calc(env(safe-area-inset-right, 0px) + 1rem)",paddingBottom:"calc(env(safe-area-inset-bottom, 0px) + 1rem)",paddingLeft:"calc(env(safe-area-inset-left, 0px) + 1rem)"},children:[s.jsx("button",{type:"button",className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:e,"aria-label":"Close queue dialog"}),s.jsxs("div",{className:"relative z-10 w-full max-w-md mx-4 bg-background border border-border rounded-sm shadow-xl overflow-hidden max-h-[80vh] flex flex-col",children:[s.jsx("div",{className:"absolute inset-0 bg-[linear-gradient(rgba(0,255,255,0.02)_1px,transparent_1px),linear-gradient(90deg,rgba(0,255,255,0.02)_1px,transparent_1px)] bg-[size:16px_16px] pointer-events-none"}),s.jsxs("div",{className:"relative border-b border-border/50",children:[s.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ks,{size:14,className:"text-cyan-400"}),s.jsx("span",{className:"text-[10px] font-display font-bold text-cyan-400 uppercase tracking-wider",children:"Action Queue"})]}),F>0&&s.jsx("div",{className:"flex items-center gap-1",children:p.length>0&&s.jsx("span",{className:"min-w-[18px] h-[18px] flex items-center justify-center text-[9px] font-bold bg-purple-500/20 text-purple-400 border border-purple-500/30 rounded-sm",children:p.length})})]}),s.jsx("button",{onClick:e,className:"p-1 text-muted-foreground hover:text-cyan-400 transition-colors cursor-pointer",children:s.jsx(Fe,{size:14})})]}),s.jsx("p",{className:"px-4 pb-2 text-[11px] leading-relaxed text-muted-foreground/70",children:"Backlog for future sessions. Items stay here until you start a dedicated session. This is separate from the per-session message queue in the composer."})]}),s.jsx("div",{className:"relative px-4 py-3 border-b border-border/30",children:s.jsxs("div",{className:"flex gap-2",children:[s.jsx("input",{ref:G,value:h,onChange:K=>f(K.target.value),onKeyDown:_e,placeholder:"Add a note...",className:"flex-1 px-3 py-1.5 bg-background/50 border border-border/50 rounded-sm text-sm font-mono placeholder:text-muted-foreground/40 focus:outline-none focus:border-cyan-500/50"}),s.jsx("button",{onClick:()=>{pe()},disabled:!h.trim()||y,className:"px-2.5 py-1.5 rounded-sm border border-cyan-500/30 text-cyan-400 hover:bg-cyan-500/10 hover:border-cyan-400 transition-all cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",children:y?s.jsx(Ee,{size:14,className:"animate-spin"}):s.jsx(Wl,{size:14})})]})}),s.jsx("div",{className:"relative flex-1 overflow-y-auto p-2 min-h-[150px] max-h-96 flex flex-col",children:x?s.jsx("div",{className:"flex flex-1 items-center justify-center py-8",children:s.jsx(Ee,{size:20,className:"animate-spin text-muted-foreground"})}):H?s.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 py-8 text-rose-400",children:[s.jsxs("div",{className:"flex items-center justify-center gap-2",children:[s.jsx(Cs,{size:16}),s.jsx("span",{className:"text-sm font-mono",children:H})]}),fe&&s.jsx("button",{onClick:()=>{te()},className:"px-2 py-1 rounded-sm border border-rose-500/30 text-[10px] font-mono font-bold uppercase tracking-wider hover:bg-rose-500/10 hover:border-rose-400 cursor-pointer",children:"Copy Last Prompt"})]}):F===0?s.jsxs("div",{className:"flex flex-1 min-h-[220px] flex-col items-center justify-center py-8 text-center text-muted-foreground/50",children:[s.jsx(Ks,{size:24,className:"mb-2 opacity-50"}),s.jsx("span",{className:"text-sm font-mono",children:"Action queue empty"}),s.jsx("span",{className:"text-xs font-mono mt-1",children:"Add a note above, or review a session to generate recommendations"})]}):s.jsxs(s.Fragment,{children:[Ae(),p.length>0&&s.jsxs(s.Fragment,{children:[c.length>0&&s.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 mt-2",children:[s.jsx("div",{className:"flex-1 border-t border-purple-500/20"}),s.jsx("span",{className:"text-[9px] font-mono font-bold text-purple-400/60 uppercase tracking-wider",children:"ai"}),s.jsx("div",{className:"flex-1 border-t border-purple-500/20"})]}),s.jsxs("div",{className:"mb-1",children:[s.jsxs("div",{className:"flex items-center gap-2 px-3 py-1",children:[s.jsx(hh,{size:10,className:"text-purple-400"}),s.jsx("span",{className:"text-[10px] font-mono font-bold uppercase tracking-wider text-purple-400",children:"Recommendations"}),s.jsxs("span",{className:"text-[10px] font-mono text-muted-foreground/30",children:["(",p.length,")"]})]}),se.map(([K,me])=>s.jsxs("div",{className:"mb-2",children:[s.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5",children:[s.jsx("span",{className:"text-[10px] font-display font-bold uppercase tracking-wider text-cyan-400/70",children:K}),s.jsx("span",{className:"text-[10px] font-mono text-muted-foreground/20",children:me.length})]}),s.jsx("div",{className:"space-y-0.5",children:me.map(O=>{const J=sl[O.target]||sl.codebase,q=J.icon,ae=O.friction?(()=>{const be=G2(O.friction).friction,ge=be.match(/^[^.!?]+[.!?]/)?.[0]||be;return ge.length>140?ge.slice(0,140)+"...":ge})():"";return s.jsxs("div",{className:"group px-3 py-2 hover:bg-muted/20 transition-colors",children:[s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("div",{className:`p-1 rounded ${J.bg} flex-shrink-0 mt-0.5`,children:s.jsx(q,{size:10,className:J.text})}),s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("p",{className:"text-sm font-mono text-foreground/80 leading-snug",children:O.action})})]}),ae&&s.jsx("p",{className:"text-[11px] font-mono text-muted-foreground/40 mt-1 pl-7 leading-snug line-clamp-2",children:ae}),s.jsxs("div",{className:"flex items-center gap-2 mt-1.5 pl-7",children:[s.jsx("span",{className:"text-[10px] font-mono text-muted-foreground/30",children:nl(O.createdAt)}),O.sessionId&&s.jsxs("button",{onClick:()=>{e(),l(`/c/${O.sessionId}`)},className:"flex items-center gap-1 text-[10px] font-mono text-muted-foreground/30 hover:text-cyan-400/70 transition-colors cursor-pointer",title:O.sourceMission||"View source session",children:[s.jsx(os,{size:9}),s.jsx("span",{className:"truncate max-w-[160px]",children:O.sourceMission||"session"})]}),s.jsx("div",{className:"flex-1"}),s.jsxs("div",{className:"flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[s.jsx("button",{onClick:()=>{ye(O.id)},className:"p-1 text-muted-foreground/50 hover:text-emerald-400 cursor-pointer",title:"Mark complete",children:s.jsx(Pe,{size:12})}),s.jsx("button",{onClick:()=>{I(O.id)},className:"p-1 text-muted-foreground/50 hover:text-rose-400 cursor-pointer",title:"Dismiss",children:s.jsx(Lo,{size:12})})]})]})]},O.id)})})]},K))]})]})]})}),F>0&&n&&s.jsxs("div",{className:"relative px-4 py-2.5 border-t border-border/30 space-y-2",children:[!C&&s.jsx("div",{className:"flex flex-wrap items-center gap-2",children:s.jsx("div",{className:"flex items-center rounded-sm border border-zinc-700/50 bg-zinc-900/50 p-0.5",children:Ve.map(({mode:K,label:me,icon:O,activeClasses:J,description:q})=>{const ae=E===K;return s.jsxs("button",{onClick:()=>ve(K),disabled:w,title:q,className:`flex items-center gap-1 px-2 py-1 rounded-sm text-[10px] font-display font-bold uppercase tracking-wider transition-all duration-100 cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed ${ae?J:"text-zinc-500 hover:text-zinc-400 border border-transparent"}`,children:[s.jsx(O,{size:10}),me]},K)})})}),s.jsx("button",{onClick:()=>{ce()},disabled:w,className:"w-full flex items-center justify-center gap-2 py-1.5 rounded-sm ui-action-btn ui-action-btn--cool text-[10px] font-display font-bold uppercase tracking-wider bg-background/80 backdrop-blur-sm disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:shadow-none disabled:hover:translate-x-0 disabled:hover:translate-y-0",children:w?s.jsxs(s.Fragment,{children:[s.jsx(Ee,{size:12,className:"animate-spin"}),"Starting Session..."]}):C?s.jsxs(s.Fragment,{children:[s.jsx(Ht,{size:12}),"Go to Session"]}):s.jsxs(s.Fragment,{children:[s.jsx(Ht,{size:12}),"Start Session"]})})]})]})]}):null}const K2=200,oi=["conversations","archived-sidebar"];function Q2(t){const{enabled:e}=t,{data:n,isLoading:r}=Ct({queryKey:oi,queryFn:async()=>((await U.listUnifiedConversations({archived:!0,includeIdentityImage:!1,limit:K2})).conversations||[]).filter(a=>a.archived).sort((a,i)=>new Date(i.updatedAt).getTime()-new Date(a.updatedAt).getTime()),enabled:e,staleTime:6e4,refetchOnWindowFocus:!1});return{archivedSessions:n||[],isLoading:r}}function Y2(t,e){if(!t)return t;const n=t.conversations.filter(r=>r.conversationId!==e);return n.length===t.conversations.length?t:{...t,conversations:n,total:Math.max(0,t.total-1)}}function On(t,e,n){return t+(e-t)*n}function Gs(t,e,n){return[On(t[0],e[0],n),On(t[1],e[1],n),On(t[2],e[2],n),On(t[3],e[3],n)]}function at(t){return`rgba(${Math.round(t[0])},${Math.round(t[1])},${Math.round(t[2])},${t[3].toFixed(3)})`}const xo=[120,120,130,.2],Ze=[251,191,36,.8],Hs=[52,211,153,1];function J2(t){if(t>=2)return{strokeColor:at(Hs),fillColor:at(Hs),fillOpacity:.6,borderColor:at(Hs),textColor:at(Hs),bgColor:"rgba(16,185,129,0.08)",scanning:!1,glowOpacity:.04};if(t>=1){const l=t-1,c=Gs(Ze,Hs,l*.3);return{strokeColor:at(c),fillColor:at(c),fillOpacity:.6,borderColor:at([c[0],c[1],c[2],.4]),textColor:at([c[0],c[1],c[2],.8]),bgColor:"transparent",scanning:!0,glowOpacity:0}}const e=Math.max(0,Math.min(t,.99)),n=Gs(xo,[Ze[0],Ze[1],Ze[2],.45],e),r=Gs(xo,[Ze[0],Ze[1],Ze[2],.55],e),o=e*e*.55,a=Math.max(0,(e-.5)*2),i=Gs([120,120,130,0],[Ze[0],Ze[1],Ze[2],a*.2],a);return{strokeColor:at(n),fillColor:at(r),fillOpacity:o,borderColor:at(i),textColor:at(Gs(xo,[Ze[0],Ze[1],Ze[2],.5],e*.6)),bgColor:"transparent",scanning:!1,glowOpacity:0}}function ha({status:t,isLoading:e=!1,disabled:n=!1,onClick:r}){const o=!!t?.synthesisInProgress,a=t?.pendingProposals??0,i=t?.threshold?Math.min((t.pendingExtractions??0)/t.threshold,1):0,l=a>0?2:o?1:i,c=J2(l),u=e?"Checking status...":o?"Reviewing recent sessions for patterns worth acting on":a>0?`${a} proposed change${a===1?"":"s"} based on patterns across recent sessions`:i>0?`${t?.pendingExtractions}/${t?.threshold} sessions toward next analysis`:"Lattice watches how you work across sessions and proposes changes when it spots patterns";return s.jsxs(Ke,{children:[s.jsx(Qe,{asChild:!0,children:s.jsxs("button",{type:"button",onClick:r,disabled:n,"aria-label":"Cross-session insights",className:`group relative flex items-center gap-2 px-3 py-1.5 max-sm:h-10 rounded-sm text-[10px] font-display font-bold uppercase tracking-wider transition-all duration-300 overflow-hidden ${a>0?"hover:shadow-[2px_2px_0_rgba(16,185,129,0.5),-2px_-2px_0_rgba(34,211,238,0.25)] hover:translate-x-[-1px] hover:translate-y-[-1px]":""} disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:shadow-none disabled:hover:translate-x-0 disabled:hover:translate-y-0`,style:{borderWidth:1,borderStyle:"solid",borderColor:c.borderColor,color:c.textColor,backgroundColor:c.bgColor},children:[c.scanning&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"absolute top-0 left-0 h-[1px] w-full animate-[insight-scan_1.5s_linear_infinite]",style:{background:`linear-gradient(to right, transparent, ${c.strokeColor}, transparent)`}}),s.jsx("span",{className:"absolute bottom-0 right-0 h-[1px] w-full animate-[insight-scan_1.5s_linear_infinite_0.75s]",style:{background:`linear-gradient(to right, transparent, ${at([Ze[0],Ze[1],Ze[2],.4])}, transparent)`}})]}),s.jsxs("svg",{viewBox:"0 0 12 12",className:"w-3 h-3 transition-all duration-500","aria-hidden":"true",children:[s.jsx("path",{d:"M6 1 L11 6 L6 11 L1 6 Z",fill:"none",stroke:c.strokeColor,strokeWidth:"1.2"}),c.fillOpacity>.01&&s.jsx("path",{d:"M6 3.5 L8.5 6 L6 8.5 L3.5 6 Z",fill:c.fillColor,opacity:c.fillOpacity})]}),a>0&&s.jsx("span",{className:"relative",children:a}),c.glowOpacity>0&&s.jsx("span",{className:"absolute inset-0 rounded-sm",style:{backgroundColor:`rgba(52,211,153,${c.glowOpacity})`}})]})}),s.jsx(He,{children:s.jsx("p",{children:u})})]})}function Dp({count:t,onClick:e}){return s.jsxs(Ke,{children:[s.jsx(Qe,{asChild:!0,children:s.jsxs("button",{type:"button",onClick:e,"aria-label":"Notes",className:"relative flex items-center gap-2 p-1.5 min-[1440px]:px-3 min-[1440px]:py-1.5 bg-background/80 backdrop-blur-sm ui-action-btn ui-action-btn--cool text-[10px] font-display font-bold uppercase tracking-wider",children:[s.jsx(Ks,{size:14}),s.jsx("span",{className:"hidden min-[1440px]:inline",children:"NOTES"}),t>0&&s.jsx("span",{className:"min-w-[16px] h-[16px] px-1 flex items-center justify-center rounded-full bg-cyan-400/15 border border-cyan-400/30 text-[9px] leading-none text-cyan-300 pb-px pl-0.5",children:t>99?"99+":t})]})}),s.jsx(He,{side:"bottom",align:"end",className:"max-w-[300px]",children:"Action queue for future work: notes and review recommendations stay here until you launch a separate session. This is different from the composer message queue."})]})}function X2({sessionId:t,isArchived:e=!1,insightsPanelOpen:n,onToggleInsightsPanel:r,crossSessionSidebarOpen:o,onToggleCrossSessionSidebar:a,onOpenCrossSessionAnalysis:i,onOpenFeedbackPanel:l}){const c=St(),u=dn(),p=Dl(),{isPro:m}=gn(),{conversations:h,invalidateConversations:g}=Os(),{serverConfig:f}=Ds(),[x,b]=d.useState(!1),[y,v]=d.useState(!1),[w,N]=d.useState(!1),[C,T]=d.useState(0),{data:S,isLoading:j}=Ct({queryKey:["cross-session-status"],queryFn:()=>U.getCrossSessionStatus(),staleTime:1e4,refetchInterval:I=>I.state.data?.synthesisInProgress?3e3:15e3});d.useEffect(()=>{const I=async()=>{try{const[ve,Ve]=await Promise.all([U.getDevNotes(),U.getPendingRecommendations()]);T(ve.notes.length+Ve.recommendations.length)}catch{}};I();const ce=setInterval(()=>{I()},3e4);return()=>clearInterval(ce)},[]);const E=d.useCallback(()=>{N(!1),Promise.all([U.getDevNotes(),U.getPendingRecommendations()]).then(([I,ce])=>T(I.notes.length+ce.recommendations.length))},[]),R=d.useCallback(async(I,ce,ve,Ve)=>{if(I.length===0&&ce.length===0)return;const Ae=ve||"claude";try{const K=await Mp(U,I,ce,f?.defaultWorkingDirectory||f?.cwd||"~",{workspace:"main",provider:Ae,model:f?.defaultModel,permissionMode:Ve||f?.defaultPermissionMode});return K?(await g(),{sessionId:K.conversationId}):null}catch(K){throw console.error("Failed to launch queue session:",K),K}},[g,f?.defaultWorkingDirectory,f?.cwd,f?.defaultModel,f?.defaultPermissionMode]),D=async()=>{if(t)try{await U.unifiedUpdateConversation(t,{archived:!e}),e||u.setQueriesData({predicate:I=>I.queryKey[0]==="conversations"&&I.queryKey[1]==="list"},I=>Y2(I,t)),await Promise.all([g(),u.invalidateQueries({queryKey:oi})]),c("/",{replace:!0})}catch(I){console.error(`[Archive] Failed to ${e?"unarchive":"archive"} session:`,I)}},[$,ne]=d.useState(!1),oe=async()=>{if(t){ne(!0);try{await U.exportSession(t)}catch(I){console.error("Failed to export session:",I),alert(`Export failed: ${I instanceof Error?I.message:"Unknown error"}`)}finally{ne(!1)}}},V=h.find(I=>I.conversationId===t),X=!!V?.importedAt,[H,W]=d.useState(""),[fe,L]=d.useState(!1),[G,Z]=d.useState(!1),[F,se]=d.useState(!1),te=Ce.useRef(null),ee=Ce.useRef(null),pe=V?.pausedReason;d.useEffect(()=>{if(t){if(pe&&pe.trim().length>0){L(!0),W(pe);return}if(h.some(I=>I.conversationId===t)){L(!1);return}U.getConversationDetails(t,{limit:1}).then(I=>{const ce=I?.sessionInfo?.paused_reason;L(!!ce),ce&&W(ce)}).catch(()=>{})}},[t,pe,h]),d.useEffect(()=>{G&&requestAnimationFrame(()=>te.current?.focus())},[G]),d.useEffect(()=>{F&&requestAnimationFrame(()=>ee.current?.focus())},[F]);const _e=async()=>{if(!t||!H.trim())return!1;try{return await U.unifiedUpdateConversation(t,{pausedReason:H.trim()}),L(!0),Z(!1),await g(),!0}catch(I){return console.error("Failed to pause session:",I),!1}},A=async()=>{if(!t)return!1;try{return await U.unifiedUpdateConversation(t,{pausedReason:null}),L(!1),W(""),await g(),!0}catch(I){return console.error("Failed to resume session:",I),!1}},[M,he]=d.useState(!1),Y=async()=>{if(t)try{if(navigator.clipboard?.writeText)await navigator.clipboard.writeText(t);else{const I=document.createElement("textarea");I.value=t,I.style.position="fixed",I.style.left="-9999px",I.style.top="-9999px",document.body.appendChild(I),I.focus(),I.select(),document.execCommand("copy"),document.body.removeChild(I)}he(!0),setTimeout(()=>he(!1),2e3)}catch(I){console.error("Failed to copy session ID:",I)}},B=p.pathname==="/analysis/cross-session",ye=()=>{if(B)c(-1);else if(i)i();else{const I=!!S?.readyToAnalyze;c(I?"/analysis/cross-session?run=1":"/analysis/cross-session")}};return s.jsxs(Dt,{children:[s.jsxs("div",{className:"flex justify-between items-center gap-3 px-4 py-3 border-b border-border/50 bg-background transition-colors relative overflow-hidden",children:[s.jsx("div",{className:"absolute inset-0 ui-grid-overlay pointer-events-none"}),s.jsxs("div",{className:"relative flex items-center gap-3",children:[a&&!o&&s.jsx("button",{onClick:a,"aria-label":"Open sessions sidebar",className:"p-1.5 ui-icon-btn ui-icon-btn--cool",children:s.jsx(ql,{size:18})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(mp,{size:28,interactive:!0,colorScheme:"gradient"}),s.jsx("span",{className:"text-base font-display font-medium lowercase tracking-widest text-white",children:"lattice"}),s.jsx("span",{className:"font-mono text-[10px] text-muted-foreground/30 select-none",children:"9ebe492c"})]})]}),s.jsxs("div",{className:"relative hidden sm:flex items-center gap-1 md:gap-2 min-[1440px]:gap-2 flex-shrink-0",children:[X&&s.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 rounded-sm border border-cyan-500/30 bg-cyan-500/10",children:[s.jsx(Wn,{size:12,className:"text-cyan-400"}),s.jsx("span",{className:"text-[10px] font-display font-bold uppercase tracking-wider text-cyan-400",children:"Imported · Read-only"})]}),!e&&s.jsxs(s.Fragment,{children:[s.jsx(ha,{status:S??null,isLoading:j,disabled:!S&&!j,onClick:ye}),l&&s.jsxs(Ke,{children:[s.jsx(Qe,{asChild:!0,children:s.jsxs("button",{onClick:l,"aria-label":"Send feedback",className:"flex items-center gap-2 px-3 py-1.5 rounded-sm border border-transparent text-muted-foreground/50 hover:text-muted-foreground/70 hover:border-border/20 text-[10px] font-display font-bold uppercase tracking-wider transition-all duration-100",children:[s.jsx(as,{size:12}),s.jsx("span",{className:"hidden min-[1440px]:inline",children:"FEEDBACK"})]})}),s.jsx(He,{children:s.jsx("p",{children:"Report a bug or send a comment"})})]}),s.jsx("span",{className:"h-4 w-px bg-border/20 mx-2"})]}),fe?s.jsxs("button",{onClick:()=>{A()},disabled:!t,"aria-label":"Resume session",className:"flex items-center gap-2 p-1.5 min-[1440px]:px-3 min-[1440px]:py-1.5 bg-background/80 backdrop-blur-sm ui-action-btn ui-action-btn--violet text-[10px] font-display font-bold uppercase tracking-wider disabled:opacity-50 disabled:cursor-not-allowed",children:[s.jsx(Ht,{size:14}),s.jsx("span",{className:"hidden min-[1440px]:inline",children:"RESUME"})]}):s.jsxs(Xc,{open:G,onOpenChange:Z,children:[s.jsx(Zc,{asChild:!0,children:s.jsxs("button",{disabled:!t,"aria-label":"Pause session",className:"flex items-center gap-2 p-1.5 min-[1440px]:px-3 min-[1440px]:py-1.5 bg-background/80 backdrop-blur-sm ui-action-btn ui-action-btn--violet text-[10px] font-display font-bold uppercase tracking-wider disabled:opacity-50 disabled:cursor-not-allowed",children:[s.jsx(ki,{size:14}),s.jsx("span",{className:"hidden min-[1440px]:inline",children:"PAUSE"})]})}),s.jsx(ua,{side:"bottom",align:"end",className:"w-72 p-3 bg-zinc-900/95 backdrop-blur-sm border border-violet-500/20 shadow-[0_0_12px_rgba(139,92,246,0.15)]",children:s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{htmlFor:"pause-reason-desktop",className:"text-[10px] font-mono text-violet-400/60 uppercase tracking-wider",children:"Pause reason"}),s.jsx("textarea",{id:"pause-reason-desktop",ref:te,value:H,onChange:I=>W(I.target.value),onKeyDown:I=>{I.key==="Enter"&&!I.shiftKey&&(I.preventDefault(),_e())},placeholder:"Why are you pausing? (waiting for deploy, review, etc.)",className:"w-full px-2 py-2 text-[11px] leading-relaxed bg-zinc-800/50 border border-violet-500/20 rounded-sm text-zinc-200 placeholder:text-zinc-500 focus:outline-none focus:border-violet-400/40 resize-none",rows:3}),s.jsx("button",{onClick:()=>{_e()},disabled:!H.trim(),className:"w-full px-3 py-1.5 text-[10px] font-display font-bold uppercase tracking-wider bg-violet-500/10 border border-violet-500/30 text-violet-400 rounded-sm hover:bg-violet-500/20 hover:border-violet-400 transition-all disabled:opacity-40 disabled:cursor-not-allowed",children:"Pause Session"})]})})]}),s.jsxs(Ke,{children:[s.jsx(Qe,{asChild:!0,children:s.jsxs("button",{onClick:()=>{oe()},disabled:!t||$,"aria-label":"Export session",className:"flex items-center gap-2 p-1.5 min-[1440px]:px-3 min-[1440px]:py-1.5 rounded-sm bg-background/80 backdrop-blur-sm border border-cyan-500/30 text-cyan-400 text-[10px] font-display font-bold uppercase tracking-wider hover:border-cyan-400 hover:bg-cyan-500/5 hover:shadow-[2px_2px_0_rgba(0,255,255,0.5),-2px_-2px_0_rgba(168,85,247,0.3)] hover:translate-x-[-1px] hover:translate-y-[-1px] transition-all duration-100 cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:shadow-none disabled:hover:translate-x-0 disabled:hover:translate-y-0",children:[$?s.jsx(Ee,{size:14,className:"animate-spin"}):s.jsx(Ao,{size:14}),s.jsx("span",{className:"hidden min-[1440px]:inline",children:"EXPORT"})]})}),s.jsx(He,{children:s.jsx("p",{children:"Save a portable snapshot of this session — messages, tool calls, and metadata"})})]}),s.jsxs("button",{onClick:D,disabled:!t,"aria-label":e?"Unarchive Task":"Archive Task",className:"flex items-center gap-2 p-1.5 min-[1440px]:px-3 min-[1440px]:py-1.5 bg-background/80 backdrop-blur-sm ui-action-btn ui-action-btn--rose text-[10px] font-display font-bold uppercase tracking-wider disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:shadow-none disabled:hover:translate-x-0 disabled:hover:translate-y-0",children:[s.jsx(Xs,{size:14}),s.jsx("span",{className:"hidden min-[1440px]:inline",children:e?"RESTORE":"ARCHIVE"})]}),s.jsx(Dp,{count:C,onClick:()=>N(!0)}),t&&s.jsxs(Ke,{children:[s.jsx(Qe,{asChild:!0,children:s.jsx("button",{onClick:Y,"aria-label":"Copy session ID",className:`p-1.5 ui-icon-btn ${M?"border-green-400/50 text-green-300 bg-green-500/10":"ui-icon-btn--cool"}`,children:M?s.jsx(Pe,{size:16}):s.jsx(Bt,{size:16})})}),s.jsx(He,{children:s.jsx("p",{children:M?"Copied!":"For linking to this session in notes, bugs, or conversations"})})]}),s.jsx("button",{onClick:()=>v(!0),"aria-label":"Settings",className:"p-1.5 ui-icon-btn ui-icon-btn--cool",children:s.jsx(Mo,{size:16})}),r&&(()=>{const I=m?n?null:"Turn-by-turn timeline of this session's progress":"Unlock turn-by-turn session timeline, milestones, and progress tracking",ce=s.jsxs("button",{onClick:m?r:void 0,disabled:!m,"aria-label":n?"Hide history panel":"Show history panel",className:"flex items-center gap-2 p-1.5 min-[1440px]:px-3 min-[1440px]:py-1.5 bg-background/80 backdrop-blur-sm ui-action-btn ui-action-btn--amber text-[10px] font-display font-bold uppercase tracking-wider disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:shadow-none disabled:hover:translate-x-0 disabled:hover:translate-y-0",children:[n?s.jsx(qr,{size:14}):s.jsx(Wr,{size:14}),s.jsx("span",{className:"hidden min-[1440px]:inline",children:n?"HIDE":"HISTORY"})]});return I?s.jsxs(Ke,{children:[s.jsx(Qe,{asChild:!0,children:ce}),s.jsx(He,{children:s.jsx("p",{children:I})})]}):ce})()]}),s.jsxs("div",{className:"relative flex items-center gap-3 sm:hidden",children:[e?null:s.jsx("div",{className:"mr-3",children:s.jsx(ha,{status:S??null,isLoading:j,disabled:!S&&!j,onClick:ye})}),s.jsxs(Xc,{open:x,onOpenChange:I=>{b(I),I||se(!1)},children:[s.jsx(Zc,{asChild:!0,children:s.jsx("button",{type:"button",className:"relative flex items-center justify-center w-10 h-10 bg-background/80 backdrop-blur-sm ui-action-btn ui-action-btn--cool active:bg-cyan-500/10 touch-manipulation","aria-label":"Menu",children:x?s.jsx(Fe,{size:20}):s.jsx(Sf,{size:20})})}),s.jsx(ua,{align:"end",sideOffset:8,onOpenAutoFocus:I=>I.preventDefault(),onCloseAutoFocus:I=>I.preventDefault(),className:`p-2 bg-background/95 backdrop-blur-md border border-cyan-500/30 rounded-sm z-[100] ${F?"w-64":"w-52"}`,children:s.jsx("div",{className:"flex flex-col gap-1",children:F?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"px-3 py-2 space-y-2",children:[s.jsx("div",{className:"text-[10px] font-mono text-violet-400/70 uppercase tracking-wider",children:"Pause reason"}),s.jsx("textarea",{id:"pause-reason-mobile",ref:ee,value:H,onChange:I=>W(I.target.value),onKeyDown:I=>{I.key==="Enter"&&!I.shiftKey&&(I.preventDefault(),(async()=>await _e()&&(se(!1),b(!1)))())},placeholder:"Why are you pausing?",rows:4,className:"w-full px-2 py-2 text-sm font-mono leading-relaxed bg-background/60 border border-violet-500/30 rounded-sm text-foreground placeholder:text-muted-foreground/50 focus:outline-none focus:border-violet-400/60 resize-none"})]}),s.jsxs("div",{className:"flex items-center gap-2 px-3 pb-1",children:[s.jsx("button",{onClick:()=>se(!1),className:"flex-1 px-3 py-2 rounded-sm text-xs font-display font-bold uppercase tracking-wider text-muted-foreground hover:text-foreground hover:bg-muted/20 transition-colors cursor-pointer",children:"Back"}),s.jsx("button",{onClick:()=>{(async()=>await _e()&&(se(!1),b(!1)))()},disabled:!H.trim(),className:"flex-1 px-3 py-2 rounded-sm text-xs font-display font-bold uppercase tracking-wider text-violet-400 border border-violet-500/30 hover:bg-violet-500/10 hover:border-violet-400 transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",children:"Pause"})]})]}):s.jsxs(s.Fragment,{children:[X&&s.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-2 mx-1 mb-1 rounded-sm border border-cyan-500/30 bg-cyan-500/10",children:[s.jsx(Wn,{size:14,className:"text-cyan-400"}),s.jsx("span",{className:"text-xs font-display font-bold uppercase tracking-wider text-cyan-400",children:"Imported · Read-only"})]}),r&&(m?s.jsxs("button",{onClick:()=>{r(),b(!1)},className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-sm text-amber-400 text-sm font-display font-bold uppercase tracking-wider hover:bg-amber-500/10 transition-colors cursor-pointer",children:[n?s.jsx(qr,{size:16}):s.jsx(Wr,{size:16}),s.jsx("span",{children:n?"Hide History":"History"})]}):s.jsx(Dt,{children:s.jsxs(Ke,{children:[s.jsx(Qe,{asChild:!0,children:s.jsxs("button",{disabled:!0,className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-sm text-amber-400 text-sm font-display font-bold uppercase tracking-wider disabled:opacity-50 disabled:cursor-not-allowed",children:[n?s.jsx(qr,{size:16}):s.jsx(Wr,{size:16}),s.jsx("span",{children:n?"Hide History":"History"})]})}),s.jsx(He,{children:s.jsx("p",{children:"Unlock turn-by-turn session timeline, milestones, and progress tracking"})})]})})),t&&s.jsxs("button",{onClick:()=>{Y(),setTimeout(()=>b(!1),500)},className:`flex items-center gap-3 w-full px-3 py-2.5 rounded-sm text-sm font-display font-bold uppercase tracking-wider transition-colors cursor-pointer ${M?"text-green-400 bg-green-500/10":"text-blue-400 hover:bg-blue-500/10"}`,children:[M?s.jsx(Pe,{size:16}):s.jsx(Bt,{size:16}),s.jsx("span",{children:M?"Copied!":"Copy ID"})]}),fe?s.jsxs("button",{onClick:()=>{(async()=>await A()&&b(!1))()},disabled:!t,className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-sm text-violet-400 text-sm font-display font-bold uppercase tracking-wider hover:bg-violet-500/10 transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",children:[s.jsx(Ht,{size:16}),s.jsx("span",{children:"Resume"})]}):s.jsxs("button",{onClick:()=>se(!0),disabled:!t,className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-sm text-violet-400 text-sm font-display font-bold uppercase tracking-wider hover:bg-violet-500/10 transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",children:[s.jsx(ki,{size:16}),s.jsx("span",{children:"Pause"})]}),s.jsxs("button",{onClick:()=>{oe(),b(!1)},disabled:!t||$,className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-sm text-cyan-400 text-sm font-display font-bold uppercase tracking-wider hover:bg-cyan-500/10 transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",children:[$?s.jsx(Ee,{size:16,className:"animate-spin"}):s.jsx(Ao,{size:16}),s.jsx("span",{children:"Export"})]}),s.jsxs("button",{onClick:()=>{D(),b(!1)},disabled:!t,className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-sm text-rose-400 text-sm font-display font-bold uppercase tracking-wider hover:bg-rose-500/10 transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",children:[s.jsx(Xs,{size:16}),s.jsx("span",{children:e?"Restore":"Archive"})]}),s.jsx("div",{className:"border-t border-border/30 my-1"}),l&&s.jsxs("button",{onClick:()=>{l(),b(!1)},className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-sm text-muted-foreground text-sm font-display font-bold uppercase tracking-wider hover:bg-cyan-500/10 hover:text-cyan-400 transition-colors cursor-pointer",children:[s.jsx(as,{size:16}),s.jsx("span",{children:"Feedback"})]}),s.jsxs("button",{onClick:()=>{N(!0),b(!1)},className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-sm text-cyan-400 text-sm font-display font-bold uppercase tracking-wider hover:bg-cyan-500/10 transition-colors cursor-pointer",children:[s.jsx(Ks,{size:16}),s.jsxs("span",{children:["Notes",C>0?` (${C})`:""]})]}),s.jsxs("button",{onClick:()=>{v(!0),b(!1)},className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-sm text-muted-foreground text-sm font-display font-bold uppercase tracking-wider hover:bg-cyan-500/10 hover:text-cyan-400 transition-colors cursor-pointer",children:[s.jsx(Mo,{size:16}),s.jsx("span",{children:"Settings"})]})]})})})]})]})]}),s.jsx(U2,{isOpen:y,onClose:()=>v(!1)}),s.jsx(Op,{isOpen:w,onClose:E,onLaunchSession:R,defaultProvider:"claude",defaultPermissionMode:f?.defaultPermissionMode,initialProvider:V?.activeProvider||V?.latestProvider||void 0,initialPermissionMode:V?.permissionMode||void 0})]})}const $p=d.createContext(null);function zp(){const t=d.useContext($p);if(!t)throw new Error("useToast must be used within ToastProvider");return t}function Z2({toast:t,onDismiss:e}){const[n,r]=d.useState(!1);d.useEffect(()=>{if(t.duration!==0){const c=setTimeout(e,t.duration||5e3);return()=>clearTimeout(c)}},[t.duration,e]);const o=async c=>{if(c.stopPropagation(),t.copyUrl){const u=window.location.origin+t.copyUrl;await navigator.clipboard.writeText(u),r(!0),setTimeout(()=>r(!1),2e3)}},a={success:"border-emerald-500/50",error:"border-red-500/50",info:"border-cyan-500/50"}[t.type],i={success:"text-emerald-400",error:"text-red-400",info:"text-cyan-400"}[t.type],l={success:Pe,error:Cs,info:Cs}[t.type];return s.jsxs("div",{className:`
191
191
  flex items-start gap-3 p-3 rounded-lg
192
192
  bg-card/95 backdrop-blur-sm border ${a}
193
193
  shadow-lg animate-in slide-in-from-right-5 fade-in duration-200
@@ -345,7 +345,7 @@ Be concise. The developer will read this alongside the user's bug report.`}funct
345
345
  border border-stone-600 rounded hover:border-stone-500
346
346
  transition-colors`,children:"—"})]})]}),r&&s.jsxs("div",{className:"px-3 py-1.5 border-b border-stone-800 text-stone-500",children:[r.slice(0,20),r.length>20?"…":""]}),s.jsxs("div",{className:"px-3 py-2 space-y-1",children:[s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-stone-400",children:"Display msgs:"}),s.jsx("span",{className:"text-stone-200",children:c.total})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-stone-400",children:"User / Asst:"}),s.jsxs("span",{className:"text-stone-200",children:[c.user," / ",c.assistant,c.system>0&&s.jsxs("span",{className:"text-stone-500",children:[" + ",c.system," other"]})]})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-stone-400",children:"Tool results:"}),s.jsxs("span",{className:c.pendingToolResults>0?"text-amber-400":"text-stone-200",children:[c.completedToolResults,"/",c.totalToolResults,c.pendingToolResults>0&&` (${c.pendingToolResults} pending)`]})]}),c.childGroupCount>0&&s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-stone-400",children:"Children:"}),s.jsxs("span",{className:"text-stone-200",children:[c.totalChildMessages," in ",c.childGroupCount," groups"]})]})]}),s.jsx("div",{className:"px-3 py-2 border-t border-stone-800",children:p.length===0&&m.length===0?s.jsx("div",{className:"text-green-400",children:"✓ No violations"}):s.jsxs("div",{className:"space-y-1",children:[p.length>0&&s.jsxs("div",{className:"text-red-400",children:["✗ ",p.length," error",p.length!==1?"s":""]}),m.length>0&&s.jsxs("div",{className:"text-amber-400",children:["⚠ ",m.length," warning",m.length!==1?"s":""]})]})}),u.length>0&&s.jsxs("div",{className:"border-t border-stone-800",children:[s.jsxs("button",{onClick:()=>l(!i),className:`w-full px-3 py-1.5 text-left text-stone-400
347
347
  hover:text-stone-200 hover:bg-stone-800/50 transition-colors`,children:[i?"▼":"▶"," Details"]}),i&&s.jsx("div",{className:"px-3 pb-2 space-y-1.5 max-h-40 overflow-y-auto",children:u.map((g,f)=>s.jsxs("div",{className:`text-[10px] leading-tight ${g.severity==="error"?"text-red-300":"text-amber-300/80"}`,children:[s.jsxs("span",{className:"font-bold",children:["[",g.rule,"]"]})," ",g.message]},f))})]})]})},aN=3e3;function wl(t){if(typeof t.content=="string")return t.content;if(Array.isArray(t.content)){const e=[];for(const n of t.content)typeof n=="object"&&n!==null&&"type"in n&&n.type==="text"&&"text"in n&&typeof n.text=="string"&&e.push(n.text);return e.join("")}return""}function _l(t){return t.replace(/\s+/g," ").trim()}function kl(t){const e=Date.parse(t);return Number.isFinite(e)?e:null}function jl(t){return!t||t.startsWith("user-prompt-")?!1:t.startsWith("user-")||t.startsWith("optimistic-")||t.startsWith("queued-local-")||t.startsWith("h-")}function iN(t,e){return!t.provider||!e.provider?!0:t.provider===e.provider}function cN(t){const e=[];for(const n of t){if(n.type!=="user"){e.push(n);continue}const r=_l(wl(n));if(!r){e.push(n);continue}const o=n.id||n.messageId,a=kl(n.timestamp);let i=!1;for(let l=e.length-1;l>=0;l--){const c=e[l];if(c.type!=="user"||!iN(c,n)||_l(wl(c))!==r)continue;const p=kl(c.timestamp);if(a!==null&&p!==null&&Math.abs(a-p)>aN)continue;const m=c.id||c.messageId,h=jl(o),g=jl(m);if(h!==g){g&&!h&&(e[l]=n),i=!0;break}}i||e.push(n)}return e}const lN=7e3,dN=15e3;async function uN(t){try{const e=await U.getConversationStatus(t.sessionId);e.status==="ongoing"&&e.streamingId&&t.reconnectToStream(e.streamingId)}catch{}}async function pN(t){console.debug(`[DETAIL-TRACE] watchdog-recovery refetching details for ${t.sessionId?.slice(0,12)}`),await t.queryClient.cancelQueries({queryKey:ft.details(t.sessionId),exact:!0}),await Promise.all([t.queryClient.refetchQueries({queryKey:ft.details(t.sessionId),exact:!0}),t.queryClient.refetchQueries({queryKey:["insights",t.sessionId],exact:!0})])}function mN(t){if(!(t.hasActiveSignal&&t.noVisibleContent||t.slowHydration))return{shouldRecover:!1};const n=t.hasActiveSignal&&t.noVisibleContent?"empty-active":"slow-hydration";return{shouldRecover:!0,reason:n,delayMs:n==="empty-active"?lN:dN}}function hN(t){const e=t.conversationDetails.proposedNextSteps;!e||e.length===0||t.currentProposedNextSteps||!t.isSessionIdle||t.isDismissedThisSession||t.setProposedNextSteps(e)}function fN(t){t.hasInitiallyFocusedRef.current||(t.hasInitiallyFocusedRef.current=!0,setTimeout(()=>t.composerRef.current?.focusInput(),100))}function gN(t){const{conversationId:e,fetchHistory:n,initialMessageLimit:r}=t,[o,a]=d.useState(!0),[i,l]=d.useState(!1),[c,u]=d.useState(null),p=d.useCallback(async()=>{if(!(!e||!o||i)){l(!0);try{const h=await n({limit:r});a(h.hasMore)}catch(h){console.error("Failed to load more messages:",h)}finally{l(!1)}}},[e,o,i,n,r]),m=d.useCallback(async h=>{if(e){l(!0);try{let g=!0,f=0;const x=40;for(;g&&f<x;)g=(await n({limit:r})).hasMore,f++;a(g)}catch(g){console.error("Failed to load history for jump-to-turn:",g)}finally{l(!1)}}},[e,n,r]);return{hasMoreMessages:o,setHasMoreMessages:a,isLoadingMore:i,jumpToMessageId:c,setJumpToMessageId:u,loadMoreMessages:p,handleJumpToTurn:m}}function xN(){const[t,e]=d.useState(()=>{try{const r=localStorage.getItem("insightsPanelOpen");if(r!==null)return r==="true"}catch{}return typeof window<"u"&&window.innerWidth>=768}),n=d.useCallback(()=>{e(r=>{const o=!r;try{localStorage.setItem("insightsPanelOpen",String(o))}catch{}return o})},[]);return{insightsPanelOpen:t,setInsightsPanelOpen:e,toggleInsightsPanel:n}}function bN(t){const{conversationSummary:e,insights:n,conversationTitle:r}=t;d.useEffect(()=>{const o=e?.customName||n?.context?.mission||n?.purpose||(r!=="Conversation"?r:null);if(o){const a=o.length>50?`${o.slice(0,47)}...`:o;document.title=`Lattice · ${a}`}else document.title="Lattice";return()=>{document.title="Lattice"}},[r,e,n])}function yN(t){const{conversationId:e,isSessionIdle:n,reconnectToStream:r}=t,{data:o,refetch:a}=Ct({queryKey:["pendingQuestions",e],queryFn:()=>U.getPendingQuestions(e),enabled:!!e&&n,staleTime:1e4}),i=o?.questions||[],l=d.useRef(n);d.useEffect(()=>{n&&!l.current&&a(),l.current=n},[n,a]);const c=d.useCallback(async(p,m)=>{const h=await U.answerPendingQuestion(p,m);return a(),h.streamingId&&r(h.streamingId),h},[r,a]),u=d.useCallback(async p=>{try{await U.expirePendingQuestion(p),a()}catch(m){console.error("Failed to dismiss pending question:",m)}},[a]);return{pendingQuestions:i,handleAnswerPendingQuestion:c,handleDismissPendingQuestion:u,refetchPendingQuestions:a}}const Nl="CHECK OFF DEV NOTE:";function vN(t){if(typeof t.content=="string")return t.content;if(!Array.isArray(t.content))return"";const e=[];for(const n of t.content)n&&typeof n=="object"&&"type"in n&&n.type==="text"&&"text"in n&&typeof n.text=="string"&&e.push(n.text);return e.join(`
348
- `)}function Cl(t){return t.replace(/[“”]/g,'"').replace(/^\s*[-*]\s+/,"").replace(/^\s*\d+[.)]\s+/,"").replace(/^["'`]+/,"").replace(/["'`]+$/,"").replace(/\*\*/g,"").replace(/\s+/g," ").trim().toLowerCase()}function wN(t){const e=t.trim();if(e.length<2)return e;const n=e[0],r=e[e.length-1],o=[['"','"'],["“","”"],["'","'"],["`","`"]];for(const[a,i]of o)if(n===a&&r===i)return e.slice(1,-1).trim();return e}function _N(t){if(!t)return[];const e=[];for(const n of t.split(/\r?\n/)){const r=n.trim();if(!r)continue;const o=r.toUpperCase().indexOf(Nl);if(o===-1)continue;const a=wN(r.slice(o+Nl.length));a&&e.push(a)}return e}function kN(t){const{conversationId:e,combinedMessages:n,showToast:r}=t,o=d.useRef(new Set);d.useEffect(()=>{o.current.clear()},[e]),d.useEffect(()=>{if(!e||n.length===0)return;const a=new Map;for(const i of n){if(i.type!=="assistant")continue;const l=vN(i);if(!l)continue;const c=_N(l);for(const u of c){const p=Cl(u);if(!p)continue;const m=`${e}:${p}`;o.current.has(m)||a.set(m,{normalized:p})}}a.size!==0&&(async()=>{try{const{notes:i}=await U.getDevNotes();if(!Array.isArray(i)||i.length===0)return;const l=new Map;for(const h of i){const g=Cl(h.content);if(!g||h.status!=="pending")continue;const f=l.get(g);f?f.push(h):l.set(g,[h])}const c=[],u=new Set,p=new Set;for(const[h,g]of a.entries()){let x=l.get(g.normalized)?.find(b=>!p.has(b.id));if(!x){const y=Array.from(l.entries()).find(([v])=>v.includes(g.normalized)||g.normalized.includes(v));y&&(x=y[1].find(v=>!p.has(v.id)))}x&&(u.add(h),p.add(x.id),c.push(x))}if(c.length===0)return;await Promise.all(c.map(h=>U.updateDevNoteStatus(h.id,"done"))),u.forEach(h=>o.current.add(h));const m=c.length;r({title:`Marked ${m} dev note${m===1?"":"s"} done`,message:m===1?c[0].content:void 0,type:"success",duration:3500})}catch(i){console.error("Failed to auto-complete dev notes from CHECK OFF markers:",i)}})()},[n,e,r])}const jN=300;function NN(t){const{conversationId:e,queryClient:n}=t;d.useEffect(()=>{let r=null;const o=()=>{document.visibilityState==="visible"&&e&&(r=setTimeout(()=>{console.debug(`[DETAIL-TRACE] visibility-refresh invalidating details for ${e?.slice(0,12)}`),n.invalidateQueries({queryKey:ft.details(e)}),n.invalidateQueries({queryKey:wt.one(e)})},jN))};return document.addEventListener("visibilitychange",o),()=>{document.removeEventListener("visibilitychange",o),r&&clearTimeout(r)}},[e,n])}function CN(t){return!!t&&t.startsWith("conv-")}function SN(t){const{conversationId:e,conversationDetails:n,insights:r,navStartRef:o,navigationDebugEnabled:a}=t,i=d.useRef(null),l=d.useRef(null),c=d.useRef(new Map),u=typeof window<"u"&&window.localStorage.getItem("perf-debug")==="1",p=d.useCallback((m,h,g,f)=>{u&&g<32},[u]);return d.useEffect(()=>{if(!e)return;const m=`nav-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,6)}`;o.current={conversationId:e,time:performance.now(),traceId:m},i.current=null,l.current=null},[e,a,o]),d.useEffect(()=>{if(!e||!CN(e))return;let m=!1;const h=setTimeout(()=>{(async()=>{try{const g=await U.getConversationStatus(e);if(m||g.status!=="ongoing")return;const f=await U.getUnifiedConversation(e);if(m)return;const x=f.segments.slice().sort((w,N)=>w.sequenceNumber-N.sequenceNumber).at(-1);if(x?.status==="active")return;const b=Date.now(),y="session-switch-segment-status-mismatch",v=c.current.get(y);(v===void 0||b-v>=1e4)&&(c.current.set(y,b),ht({component:"ConversationView",event:y,severity:"warn",details:{conversationId:e.slice(0,8),conversationStatus:g.status,activeStreamingId:g.streamingId||null,latestSegmentId:x?.segmentId||null,latestSegmentProvider:x?.provider||null,latestSegmentStatus:x?.status||"missing"}}))}catch{if(m)return}})()},500);return()=>{m=!0,clearTimeout(h)}},[e]),d.useEffect(()=>{if(!e||!n||i.current===e)return;i.current=e;const m=o.current,h=m.conversationId===e?m.time:void 0;h&&Math.round(performance.now()-h),m.conversationId===e&&m.traceId},[n,e,o]),d.useEffect(()=>{if(!e||!r||l.current===e)return;l.current=e;const m=o.current.conversationId===e?o.current.time:void 0;m&&Math.round(performance.now()-m)},[e,r,o]),{onPerfRender:p}}function EN(t){return t instanceof Error?t.message:typeof t=="string"?t:"Unknown error"}function TN(t,e){const n=EN(e).trim()||"Unknown error";return/permission request timeout/i.test(n)||/did not respond/i.test(n)?"Claude session paused after a permission request timed out. Retry with TRUST/accept-edits mode, or respond to permissions sooner.":`Claude session failed: ${n}`}function IN(t){const{conversationId:e,conversationPausedReason:n,session:r,setSessionOptimisticOngoing:o,invalidateConversations:a,restoreDraftFromBackup:i,setSessionFailureError:l,nextStepsDismissedRef:c}=t;return{handleSendMessage:d.useCallback(async(p,m,h,g,f)=>{l(null),r.proposedNextSteps&&r.proposedNextSteps.length>0&&(c.current=!0,r.clearNextSteps()),e&&n&&U.unifiedUpdateConversation(e,{pausedReason:null});try{r.addOptimisticUserMessage(p),e&&o(e,"claude"),await r.sendMessage(p,h,g,f),a()}catch(x){console.error("[ConversationView] Send failed:",x),l(TN("claude",x)),i()}},[e,n,r,o,a,i,l,c])}}const Sl=1500,AN=3500;function _o(t){return new Promise(e=>setTimeout(e,t))}function RN(t){const{session:e,conversationId:n,setStopRequested:r}=t;return{handleStop:d.useCallback(async()=>{if(r(!0),!n){try{await e.stop()||(console.warn("[stop] Graceful stop failed, escalating to force-kill"),await e.forceKill())}catch(l){console.error("[stop] Stop/force-kill threw:",l)}r(!1);return}const a=async()=>{try{return(await U.getConversationStatus(n)).status}catch{return null}},i=l=>l===null||l==="completed"||l==="idle";try{await e.stop(),await _o(Sl);let l=await a();if(i(l)||(await _o(AN),l=await a()),!i(l)){console.warn("[stop] Server-side escalation timed out, sending force-kill",{conversationId:n,status:l});try{await U.unifiedForceKillConversation(n)}catch{}await _o(Sl),l=await a(),i(l)||console.error("[stop] Force-kill did not terminate session",{conversationId:n,status:l})}}catch(l){console.error("[stop] Unexpected error during stop sequence:",l)}r(!1)},[e,n,r])}}const PN=5e3,MN=["Load failed","Failed to fetch","NetworkError","network error","Connection lost"];function El(t){return t?MN.some(e=>t.includes(e)):!1}function LN(t){const{sessionError:e,sessionFailureError:n,clearSessionError:r,clearSessionFailureError:o}=t,a=d.useRef(null);d.useEffect(()=>{a.current&&(clearTimeout(a.current),a.current=null);const i=El(e),l=El(n);if(!(!i&&!l))return a.current=setTimeout(()=>{i&&r(),l&&o(),a.current=null},PN),()=>{a.current&&(clearTimeout(a.current),a.current=null)}},[e,n,r,o])}function ON(t,e){return t&&!e}const Tl=2;function DN(t){return t.includes("Failed to fetch")||t.includes("Load failed")||t.includes("NetworkError")?"Connection lost — retrying…":t.includes("timeout")?"Session load timed out — retrying…":t}function $N({children:t}){const{agentColors:e}=tN(),n=d.useCallback(r=>e[r],[e]);return s.jsx(ug,{theme:"dark",resolveAgentColor:n,children:t})}function zN({sidebarOpen:t,onToggleSidebar:e}={}){const{conversationId:n}=$l(),r=n,o=Dl(),a=St(),i=dn(),{isPro:l}=gn(),{showToast:c}=zp();d.useEffect(()=>(r&&jk({conversationId:r,sessionId:r}),()=>Nk()),[r]);const u=d.useMemo(()=>new URLSearchParams(o.search).get("debug")==="messages"||$e.messages===!0,[o.search]),{status:p,connected:m,processAlive:h,error:g,messages:f,renderItems:x,childrenMessages:b,usage:y,hasBackgroundTasks:v,pendingMessages:w,actionTrace:N,send:C,stop:T,reconnect:S,fetchHistory:j}=Hj(r??null),{permissionRequest:E,answerPermission:R,answerPermissionWithPattern:D,answerPermissionWithPatterns:$}=eN(r),[ne,oe]=d.useState(new Set),[V,X]=d.useState([]),[H,W]=d.useState(null),[fe,L]=d.useState([]),[G,Z]=d.useState(null),[F,se]=d.useState(null),te=p!=="idle",ee=p==="idle",pe=p==="initializing",_e=p==="streaming",A=g??F,M=d.useCallback(()=>se(null),[]);d.useEffect(()=>{(p==="initializing"||p==="streaming")&&G===null&&Z(Date.now()),p==="idle"&&Z(null)},[p,G]);const he=f,Y=d.useMemo(()=>{const re={};for(const we of he)if(Array.isArray(we.content))for(const Ne of we.content){const Re=Ne;Re.type==="tool_result"&&typeof Re.tool_use_id=="string"&&(re[Re.tool_use_id]={status:"completed",result:typeof Re.content=="string"?Re.content:void 0,is_error:typeof Re.is_error=="boolean"?Re.is_error:void 0})}return re},[he]),B=d.useCallback(async(re,we,Ne,Re,Ur,hs)=>{try{if(m)await C(re);else{const Jt=await fetch(`/api/harness/${r}/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:re,model:we,permissionMode:Ne})});if(!Jt.ok){const Tm=await Jt.json().catch(()=>({error:"Start failed"}));throw new Error(Tm.error||"Start failed")}S()}}catch(Jt){se(Jt instanceof Error?Jt.message:"Send failed")}},[r,m,C,S]),ye=d.useCallback(async()=>{try{return await T(),!0}catch{return!1}},[T]),I=d.useCallback(async()=>{await T()},[T]),ce=d.useCallback(re=>{oe(we=>{const Ne=new Set(we);return Ne.has(re)?Ne.delete(re):Ne.add(re),Ne})},[]),ve=d.useCallback(()=>W(null),[]),Ve=d.useCallback(async re=>{await B(re)},[B]);d.useEffect(()=>{if(ee&&fe.length>0){const[re,...we]=fe;L(we),B(re.sendContent)}},[ee,fe,B]);const Ae=d.useMemo(()=>({messages:he,isActive:te,isConnected:m,proposedNextSteps:H,clearNextSteps:ve,addOptimisticUserMessage:re=>{},sendMessage:B,enqueueMessage:Ve}),[he,te,m,H,ve,B,Ve]),K=d.useMemo(()=>({stop:ye,forceKill:I}),[ye,I]),[me]=d.useState("Conversation"),[O,J]=d.useState(!1),[q,ae]=d.useState(null),[be,ge]=d.useState(!1),qe=d.useCallback(()=>ae(null),[]);LN({sessionError:A,sessionFailureError:q,clearSessionError:M,clearSessionFailureError:qe});const{insightsPanelOpen:je,setInsightsPanelOpen:Me,toggleInsightsPanel:Ye}=xN(),Je=t??!1,[ut,ps]=d.useState(!1),[Mr,xn]=d.useState(!1),[Lr,Or]=d.useState([]),Tt=d.useCallback(async re=>{try{return(await U.listDirectory({path:re||"",recursive:!1,respectGitignore:!0})).entries}catch(we){return console.error("Failed to fetch file system entries:",we),[]}},[]),bn=d.useCallback(async re=>{try{const we=await U.getCommands(re||""),Ne=we.commands.filter(Re=>Re.type==="custom").map(Re=>({name:Re.name,description:Re.description||"",argumentHint:Re.argumentHint}));return Or(Ne),we.commands}catch(we){return console.error("Failed to fetch commands:",we),[]}},[]),{conversations:yn,pendingInsightsUpdates:zs,invalidateConversations:vn,setSessionOptimisticOngoing:Kt}=Os(),st=d.useMemo(()=>r&&yn.find(re=>re.conversationId===r)||null,[yn,r]),rt=w2(r),Dr=d.useCallback(()=>{const re=r?`claudia-draft-${r}`:"claudia-draft-home",we=`${re}-backup`;try{const Ne=localStorage.getItem(we);Ne&&(localStorage.setItem(re,Ne),localStorage.removeItem(we))}catch{}},[r]),wn=d.useRef(null),_n=d.useRef(!1),nt=d.useRef(!1),z=d.useRef({}),le=d.useRef({}),Se=d.useRef(!1);d.useEffect(()=>{if(o.state)try{window.history.replaceState({},document.title)}catch{}},[o]),d.useEffect(()=>{_n.current=!1,nt.current=!1},[r]);const Te=d.useRef(rt.isOngoing);d.useEffect(()=>{const re=Te.current;Te.current=rt.isOngoing,ON(re,rt.isOngoing)&&r&&(console.debug(`[DETAIL-TRACE] completion-edge invalidating details for ${r?.slice(0,12)}`),i.invalidateQueries({queryKey:ft.details(r)}))},[rt.isOngoing,r,i]);const De=d.useRef(r);d.useEffect(()=>{De.current!==r&&(De.current=r,ge(!1),r&&(console.debug(`[DETAIL-TRACE] session-switch invalidating details for ${r?.slice(0,12)}`),i.invalidateQueries({queryKey:ft.details(r)}),i.invalidateQueries({queryKey:wt.one(r)})))},[r,i]);const it=50,ms=10,{data:ct,isLoading:$r,error:It,isFetching:zr}=Ct({queryKey:ft.details(r||""),queryFn:()=>{const re=z.current.conversationId===r?z.current.traceId:void 0;return console.debug(`[DETAIL-TRACE] queryFn executing for ${r?.slice(0,12)} limit=${ms} traceId=${re?.slice(0,16)}`),U.getConversationDetails(r,{limit:ms,traceId:re,timeout:2e4})},enabled:!!r,staleTime:3e4,refetchOnMount:!0,refetchOnWindowFocus:!1,retry:(re,we)=>{if(re>=3||!(we instanceof Error))return!1;const Ne=we.message,Re=Ne.includes("not found"),Ur=Ne.includes("Failed to fetch")||Ne.includes("NetworkError")||Ne.includes("Load failed"),hs=Ne.includes("timeout");return Re||Ur||hs},retryDelay:re=>Math.min(500*2**re,3e3)});NN({conversationId:r,queryClient:i});const{data:Qt,isLoading:om}=Ct({queryKey:["insights",r],queryFn:()=>U.unifiedGetInsights(r,!0),enabled:!!r,staleTime:3e4,refetchOnMount:!0,refetchOnWindowFocus:!1}),{onPerfRender:Fr}=SN({conversationId:r,conversationDetails:ct,insights:Qt,navStartRef:z,navigationDebugEnabled:$e.navigation}),{pendingQuestions:ci,handleAnswerPendingQuestion:am,handleDismissPendingQuestion:im}=yN({conversationId:r,isSessionIdle:ee,reconnectToStream:S}),cm=d.useMemo(()=>Qt?{lastUpdateTime:Qt.patchedAt||Qt.computedAt||null}:void 0,[Qt]);d.useEffect(()=>{ct&&ct.sessionId===r&&(hN({conversationDetails:ct,currentProposedNextSteps:H,isSessionIdle:ee,isDismissedThisSession:nt.current,setProposedNextSteps:W}),ct.mcpServers&&ct.mcpServers.length>0&&X(ct.mcpServers),fN({hasInitiallyFocusedRef:_n,composerRef:wn}))},[ct,H]),bN({conversationSummary:st,insights:Qt,conversationTitle:me});const lm=d.useCallback(()=>{e?.()},[e]),{handleSendMessage:Vr}=IN({conversationId:r,conversationPausedReason:st?.pausedReason,session:Ae,setSessionOptimisticOngoing:Kt,invalidateConversations:vn,restoreDraftFromBackup:Dr,setSessionFailureError:ae,nextStepsDismissedRef:nt}),dm=d.useCallback(re=>{nt.current=!0,ve();const we=st?.permissionMode;Vr(re,void 0,void 0,we||void 0)},[Vr,st?.permissionMode,ve]),um=d.useCallback(()=>{nt.current=!0,ve()},[ve]),li=d.useCallback(async(re,we,Ne)=>{if(!O){J(!0);try{await R(re,we,Ne)}catch(Re){console.error("Failed to send permission decision:",Re)}finally{J(!1)}}},[O,R]),pm=d.useCallback(async(re,we,Ne)=>{if(!O){J(!0);try{await D(re,we,Ne)}catch(Re){console.error(`Failed to add pattern to ${Ne} allowlist:`,Re)}finally{J(!1)}}},[O,D]),mm=d.useCallback(async(re,we,Ne)=>{if(!O){J(!0);try{await $(re,we,Ne)}catch(Re){console.error(`Failed to add patterns to ${Ne} allowlist:`,Re)}finally{J(!1)}}},[O,$]),{handleStop:hm}=RN({session:K,conversationId:r,setStopRequested:ge});d.useEffect(()=>{ae(null)},[r]);const di=d.useCallback(async re=>{if(!r||Se.current)return;const we=(le.current[r]||0)+1;if(we>Tl)return;le.current[r]=we,Se.current=!0;const Ne=z.current;Ne.conversationId===r&&Ne.time&&Math.round(performance.now()-Ne.time);try{await uN({sessionId:r,reconnectToStream:S}),await pN({queryClient:i,sessionId:r})}finally{Se.current=!1}},[r,m,S,i]),ui=!It&&$r,fm=ui,Yt=d.useMemo(()=>cN(he),[he]);Xj({conversationId:r??null,messages:Yt,actionTrace:N,connected:m,status:p});const{hasMoreMessages:gm,isLoadingMore:xm,jumpToMessageId:bm,setJumpToMessageId:ym,loadMoreMessages:vm,handleJumpToTurn:wm}=gN({conversationId:r,fetchHistory:j,initialMessageLimit:it});kN({conversationId:r,combinedMessages:Yt,showToast:c});const pt=te,pi=d.useRef(ee);d.useEffect(()=>{const re=pi.current;if(pi.current=ee,!r&&be){ge(!1);return}!pt&&ee&&!re&&be&&ge(!1)},[r,pt,ee,be]);const Br=d.useRef(!1);d.useEffect(()=>{Br.current=!1},[r]),d.useEffect(()=>{Br.current||(Br.current=!0,console.debug(`[status:mount] ${r?.slice(0,12)}`,`alive=${h} busy=${pt}`,{"authoritative.status":rt.status,"authoritative.streamingId":rt.streamingId?.slice(0,8)??"-","authoritative.isFetching":rt.isFetching,"authoritative.isLoading":rt.isLoading,"authoritative.dataUpdatedAt":rt.dataUpdatedAt,harnessStatus:p,isActive:te,harnessConnected:m,"session.streamingId":"-"}))});const mi=d.useRef({isProviderBusy:pt,processAlive:h});d.useEffect(()=>{const re=mi.current;(re.isProviderBusy!==pt||re.processAlive!==h)&&(console.debug(`[status:view] ${r?.slice(0,12)}`,`busy=${pt} (was ${re.isProviderBusy})`,`alive=${h} (was ${re.processAlive})`,{isActive:te,harnessConnected:m,harnessStatus:p,"authoritative.isOngoing":rt.isOngoing,"authoritative.isFetching":rt.isFetching}),mi.current={isProviderBusy:pt,processAlive:h})});const _m=[...fe];d.useEffect(()=>{r&&(le.current[r]=0,Se.current=!1)},[r]),d.useEffect(()=>{if(!r)return;const re=It instanceof Error&&It.message.includes("not found");if(It&&!(re&&h)||(le.current[r]||0)>=Tl)return;const Ne=pt,Re=Yt.length===0,hs=mN({hasActiveSignal:Ne,noVisibleContent:Re,slowHydration:$r||zr});if(!hs.shouldRecover)return;const Jt=setTimeout(()=>{di(hs.reason)},hs.delayMs);return()=>clearTimeout(Jt)},[r,It,$r,zr,pt,h,Yt.length,di]);const km=pt||h,jm=It instanceof Error&&It.message.includes("not found"),Nm=It&&!(jm&&km)?DN(It.message):null,hi=A==="session_limit"||A==="init_timeout"||zr?null:q||A||Nm,Cm=E?s.jsx(gj,{permission:E,streamingId:void 0,workingDirectory:st?.workingDirectory,onApprove:()=>li(E.id,"approve"),onApprovePattern:(re,we)=>pm(E.id,re,we),onApprovePatterns:(re,we)=>mm(E.id,re,we),onDeny:re=>li(E.id,"deny",re),isLoading:O}):null,fi=d.useRef(null);d.useEffect(()=>{if(A&&A!==fi.current){const re=r?`claudia-draft-${r}-backup`:"claudia-draft-home-backup",we=localStorage.getItem(re);if(we){const Ne=r?`claudia-draft-${r}`:"claudia-draft-home";localStorage.setItem(Ne,we),localStorage.removeItem(re)}}fi.current=A},[A,r]);const Sm=d.useCallback(async()=>{r&&await U.resumeConversation(r,{message:"Approved. Proceed with the plan.",permissionMode:"bypassPermissions"})},[r]),Em=d.useCallback(async()=>{r&&await U.resumeConversation(r,{message:"Plan rejected — please revise or take a different approach.",permissionMode:"plan"})},[r]);return s.jsx(d.Profiler,{id:"ConversationView",onRender:Fr,children:s.jsx(sN,{teamName:st?.teamName??null,children:s.jsx($N,{children:s.jsxs("div",{className:"h-full w-full flex flex-col bg-background relative overflow-hidden",role:"main","aria-label":"Conversation view",children:[s.jsx(X2,{sessionId:r,isArchived:st?.archived||!1,isPinned:st?.pinned||!1,subtitle:st?{date:new Date(st.createdAt).toLocaleDateString("en-US",{month:"short",day:"numeric"}),repo:st.workingDirectory.split("/").pop()||"project"}:void 0,insightsPanelOpen:je,onToggleInsightsPanel:Ye,crossSessionSidebarOpen:Je,onToggleCrossSessionSidebar:lm,onOpenCrossSessionAnalysis:()=>ps(!0),onOpenFeedbackPanel:()=>xn(!0)}),hi&&s.jsx("div",{className:"bg-red-500/10 border-b border-red-500 text-red-600 dark:text-red-400 px-4 py-2 text-sm text-center animate-in slide-in-from-top duration-300",role:"alert",children:hi}),A==="init_timeout"&&s.jsx("div",{className:"bg-amber-500/10 border-b border-amber-500 text-amber-700 dark:text-amber-400 px-4 py-2 text-sm text-center animate-in slide-in-from-top duration-300",role:"alert",children:"Session initialization timed out — the conversation may be too large. Consider starting a fresh session."}),s.jsxs("div",{className:"flex-1 flex overflow-hidden relative",children:[ut&&s.jsx("div",{className:"absolute inset-0 z-30 bg-background",children:s.jsx(Vp,{onClose:()=>ps(!1)})}),Mr&&s.jsx("div",{className:"absolute inset-0 z-30 bg-background",children:s.jsx(dj,{onClose:()=>xn(!1),conversationId:r})}),s.jsxs("div",{className:"flex-1 flex flex-col min-w-0 relative",children:[s.jsxs(s.Fragment,{children:[s.jsx(d.Profiler,{id:"MessageList",onRender:Fr,children:s.jsx(ek,{sessionId:r,messages:ui&&Yt.length===0?[]:Yt,renderItems:x,toolResults:Y,childrenMessages:b,expandedTasks:ne,onToggleTaskExpanded:ce,isLoading:fm,isStreaming:_e,streamingProvider:"claude",pendingQuestion:ci.length>0?ci[0]:null,onAnswerPendingQuestion:am,onDismissPendingQuestion:im,hasMore:gm,isLoadingMore:xm,onLoadMore:vm,branchLineage:ct?.sessionInfo?.branched_from_session_id?{parentSessionId:ct.sessionInfo.branched_from_session_id,atTurn:ct.sessionInfo.branched_at_turn||0,branchPointMessageId:ct.branchPointMessageId}:void 0,onNavigateToSession:re=>a(`/c/${re}`),sessionStartTime:G,isSwitchingProvider:!1,switchingToProvider:"claude",jumpToMessageId:bm,onJumpHandled:()=>ym(null),inlinePermissionPrompt:Cm,onPlanApprove:Sm,onPlanReject:Em,actionTrace:N})}),u&&s.jsx(oN,{messages:Yt,toolResults:Y,childrenMessages:b,sessionId:r})]}),st?.importedAt?s.jsx("div",{className:"flex-shrink-0 z-10 w-full flex justify-center py-3",style:{paddingBottom:"calc(var(--lattice-composer-dock-bottom-gap) + var(--lattice-safe-area-bottom))"},children:s.jsxs("div",{className:"inline-flex items-center gap-2 px-4 py-2 bg-cyan-500/10 border border-cyan-500/30 rounded-sm",children:[s.jsx(Wn,{size:14,className:"text-cyan-400"}),s.jsx("span",{className:"text-cyan-400 font-display text-xs uppercase tracking-wider",children:"Imported session — read-only"})]})}):s.jsxs("div",{className:"flex-shrink-0 bg-white/80 dark:bg-zinc-900/80 backdrop-blur-sm z-10 w-full flex flex-col items-center pt-4",style:{paddingBottom:"calc(var(--app-composer-dock-bottom-gap) + var(--app-safe-area-bottom))"},children:[H&&H.length>0&&ee&&s.jsx("div",{className:"w-full max-w-5xl px-4 mb-2",children:s.jsx(ck,{steps:H,onSelect:dm,onDismiss:um})}),w.length>0&&s.jsx("div",{className:"w-full max-w-5xl px-4 mb-2 flex flex-col gap-1.5",children:w.map(re=>s.jsx("div",{"data-testid":"pending-message",className:"flex justify-end",children:s.jsx("div",{className:"max-w-[80%] min-w-[100px]",children:s.jsxs("div",{className:"border border-cyan-500/15 rounded-lg overflow-hidden bg-cyan-500/3 w-full opacity-60",children:[s.jsx("div",{className:"flex items-center gap-2 px-3 py-1.5 border-b border-cyan-500/8",children:s.jsx("span",{className:"text-[11px] text-zinc-500 font-medium",children:"User"})}),s.jsx("div",{className:"px-3 py-2 text-[13px] leading-relaxed text-foreground/40 whitespace-pre-wrap break-words",children:re.text})]})})},`pending-${re.inputEvent.seq}`))}),s.jsx("div",{className:"w-full max-w-5xl px-4",children:s.jsx(up,{ref:wn,core:{sessionId:r,onSubmit:Vr,isLoading:m||O,placeholder:""},features:{enableFileAutocomplete:!0,showSmartMenu:!0},workingDirectory:st?.workingDirectory,permissionConfig:{onStop:hm,onInterrupt:I},skills:Lr,mcpServers:V,runtimeConfig:{isSessionActive:pt,isSessionConnected:h||rt.isIdle,isStopRequested:be,isInitializing:pe,hasBackgroundTasks:v,sessionStartTime:G??void 0,onFetchFileSystem:Tt,onFetchCommands:bn,queuedMessages:_m,sessionUsage:y}})})]})]}),s.jsx(d.Profiler,{id:"InsightsPanel",onRender:Fr,children:s.jsx(sj,{insights:Qt??null,isLoading:om,isOpen:l&&je,onClose:()=>{Me(!1),localStorage.setItem("insightsPanelOpen","false")},syncState:cm,isPendingInsightsUpdate:r?zs.has(r):!1,sessionId:r,onJumpToTurn:wm,onBranch:async re=>{await vn(),a(`/c/${re}`)}})})]})]})})})})}function FN(){return`pending-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}function qp({sidebarOpen:t,onToggleSidebar:e}){const[n,r]=xa(),o=St(),{serverConfig:a}=Ds(),{addOptimisticSession:i,addPendingLaunch:l,removePendingLaunch:c,invalidateConversations:u}=Os(),p="main",[m,h]=d.useState(!1),[g,f]=d.useState(!1),[x,b]=d.useState(0),[y,v]=d.useState(null),[w,N]=d.useState(!0);n.get("provider");const C=n.get("mode"),T="claude",[S,j]=d.useState(T);d.useEffect(()=>{j(T)},[T]);const E=ln({explicit:C??void 0,fallback:a?.defaultPermissionMode,provider:T}),R=a?.defaultWorkingDirectory||a?.cwd||"~",D=d.useCallback(async()=>{try{const[X,H,W]=await Promise.all([U.getDevNotes(),U.getPendingRecommendations(),U.getCrossSessionStatus()]);b(X.notes.length+H.recommendations.length),v({pendingExtractions:W.pendingExtractions,threshold:W.threshold,pendingProposals:W.pendingProposals,readyToAnalyze:W.readyToAnalyze,synthesisInProgress:W.synthesisInProgress})}catch(X){console.error("Failed to refresh new-session header state:",X)}finally{N(!1)}},[]);d.useEffect(()=>{D();const X=window.setInterval(()=>{D()},15e3);return()=>window.clearInterval(X)},[D]),d.useCallback(X=>{j(X);const H=new URLSearchParams(n);H.set("provider",X),r(H,{replace:!0})},[n,r]);const $=d.useCallback(()=>{f(!1),D()},[D]),ne=d.useCallback(async(X,H,W,fe)=>{if(X.length===0&&H.length===0)return;const G=await Mp(U,X,H,R,{workspace:p,provider:W||"claude",model:a?.defaultModel,permissionMode:fe||E});return G?(await u(),{sessionId:G.conversationId}):null},[u,E,a?.defaultModel,R]),oe=d.useCallback(()=>{const X=!!y?.readyToAnalyze;o(X?"/analysis/cross-session?run=1":"/analysis/cross-session")},[y?.readyToAnalyze,o]),V=d.useCallback(async(X,H,W,fe,L,G)=>{if(!X.trim()||m)return;h(!0);const Z=G||S,F=a?.defaultModel||"claude-opus-4-6",se=E,te=FN();l({tempId:te,workingDirectory:H||R,initialPrompt:X,model:F,permissionMode:se,workspace:p,provider:Z});try{const ee=await U.createConversation({provider:Z,message:X,workingDirectory:H||R,model:F,permissionMode:se,workspace:p});try{localStorage.setItem(`lattice:last-provider:${ee.conversationId}`,ee.provider)}catch{}i({conversationId:ee.conversationId,streamingId:ee.streamingId,workingDirectory:ee.cwd,model:ee.model,permissionMode:ee.permissionMode||se,initialPrompt:X,workspace:p,provider:ee.provider}),ca(ee.conversationId,"client.navigate_to_conversation"),o(`/c/${ee.conversationId}`),u()}catch(ee){console.error("Failed to create session:",ee),alert(`Failed to create session: ${ee instanceof Error?ee.message:"Unknown error"}`)}finally{c(te),h(!1)}},[m,S,E,R,p,a,i,l,c,u,o]);return s.jsx(Dt,{children:s.jsxs("div",{className:`flex-1 min-w-0 flex flex-col h-full relative overflow-hidden ${t?"hidden md:flex":""}`,children:[s.jsxs("div",{className:"flex justify-between items-center gap-3 px-4 py-3 border-b border-border/50 bg-background transition-colors relative overflow-hidden",children:[s.jsx("div",{className:"absolute inset-0 ui-grid-overlay pointer-events-none"}),s.jsxs("div",{className:"relative flex items-center gap-2 sm:gap-3 min-w-0",children:[!t&&s.jsx("button",{onClick:e,"aria-label":"Open sessions sidebar",className:"p-1.5 ui-icon-btn ui-icon-btn--cool",children:s.jsx(ql,{size:18})}),s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s.jsx(mp,{size:28,interactive:!0,colorScheme:"gradient"}),s.jsx("span",{className:"text-base font-display font-medium lowercase tracking-widest text-white",children:"lattice"}),s.jsx("span",{className:"hidden lg:inline font-mono text-[10px] text-muted-foreground/30 select-none",children:"b91dbdc1"})]}),s.jsx("span",{className:"hidden md:block h-4 w-px bg-border/20 shrink-0"}),s.jsx("span",{className:"hidden sm:inline text-[10px] font-display font-bold uppercase tracking-wider text-muted-foreground/60",children:"New Session"})]}),s.jsxs("div",{className:"relative flex items-center gap-2 flex-shrink-0",children:[s.jsx(ha,{status:y,isLoading:w,onClick:oe}),s.jsx(Dp,{count:x,onClick:()=>f(!0)})]})]}),s.jsxs("div",{className:"flex-1 flex flex-col justify-end",children:[s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsxs("div",{className:"flex flex-col items-center gap-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(as,{size:14,className:"text-cyan-400/40"}),s.jsx("span",{className:"text-sm font-display font-bold uppercase tracking-wider text-muted-foreground/35",children:"Claude"})]}),s.jsxs("div",{className:"flex items-center gap-1.5 text-muted-foreground/20",children:[s.jsx("span",{className:"text-[10px] font-mono",children:"Type a message to start"}),s.jsx("span",{className:"text-[9px] font-mono px-1 py-0.5 border border-border/30 rounded-sm bg-background/40",children:"⏎"})]})]})}),s.jsx("div",{className:"flex-shrink-0 bg-white/80 dark:bg-zinc-900/80 backdrop-blur-sm z-10 w-full flex flex-col items-center pt-4",style:{paddingBottom:"calc(var(--app-composer-dock-bottom-gap) + var(--app-safe-area-bottom))"},children:s.jsx("div",{className:"w-full max-w-5xl px-4",children:s.jsx(up,{core:{onSubmit:V,isLoading:m,disabled:m,placeholder:""},features:{enableFileAutocomplete:!0,showSmartMenu:!0},workingDirectory:R,runtimeConfig:{isInitializing:m}})})})]}),s.jsx(Op,{isOpen:g,onClose:$,onLaunchSession:ne,defaultProvider:"claude",defaultPermissionMode:E,initialProvider:S,initialPermissionMode:E})]})})}const Il="app-favicon",Wp="/favicon.png",VN="/favicon-attention.svg",Kp=5e3;function Qp(t){return t.endsWith(".png")?"image/png":"image/svg+xml"}const Yp=["attention-favicon"];function BN(){const t=document.getElementById(Il);if(t instanceof HTMLLinkElement)return t;const e=document.createElement("link");return e.id=Il,e.rel="icon",e.type=Qp(Wp),document.head.appendChild(e),e}function Al(t){if(typeof document>"u")return;const e=BN(),n=t?VN:Wp;e.rel="icon",e.type=Qp(n),e.href=n}async function Jp(){const[t,e]=await Promise.all([U.getPermissions({status:"pending"}),U.getPendingQuestions()]),n={};for(const r of t.permissions){const o=r.conversationId||r.sessionId;o&&(n[o]=(n[o]||0)+1)}for(const r of e.questions){const o=r.conversationId||r.sessionId;o&&(n[o]=(n[o]||0)+1)}return{permissionCount:t.permissions.length,questionCount:e.questions.length,sessionAttention:n}}function UN(){const{data:t}=Ct({queryKey:Yp,queryFn:Jp,staleTime:2e3,refetchInterval:Kp,refetchIntervalInBackground:!1}),e=(t?.permissionCount||0)>0||(t?.questionCount||0)>0;return d.useEffect(()=>(Al(e),()=>{Al(!1)}),[e]),null}function GN(t){const{data:e}=Ct({queryKey:Yp,queryFn:Jp,staleTime:2e3,refetchInterval:Kp,refetchIntervalInBackground:!1});return!e||!t?!1:(e.sessionAttention[t]||0)>0}function $n({children:t,className:e=""}){return s.jsx("span",{className:`text-[7px] px-1 py-0.5 rounded-sm border font-bold uppercase tracking-wider backdrop-blur-sm ${e}`,children:t})}function HN(t){const e=Date.now()-new Date(t).getTime(),n=Math.floor(e/1e3),r=Math.floor(n/60),o=Math.floor(r/60);return n<10?"now":n<60?`${n}s`:r<60?`${r}m`:o<24?`${o}h`:`${Math.floor(o/24)}d`}const qN=["claude"];function WN(t){const e=new Set(t.providersUsed??[]);return e.add(t.latestProvider),qN.filter(n=>e.has(n))}function KN(t){return t.activeProvider??t.latestProvider}const QN=encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80" viewBox="0 0 80 80" fill="none">
348
+ `)}function Cl(t){return t.replace(/[“”]/g,'"').replace(/^\s*[-*]\s+/,"").replace(/^\s*\d+[.)]\s+/,"").replace(/^["'`]+/,"").replace(/["'`]+$/,"").replace(/\*\*/g,"").replace(/\s+/g," ").trim().toLowerCase()}function wN(t){const e=t.trim();if(e.length<2)return e;const n=e[0],r=e[e.length-1],o=[['"','"'],["“","”"],["'","'"],["`","`"]];for(const[a,i]of o)if(n===a&&r===i)return e.slice(1,-1).trim();return e}function _N(t){if(!t)return[];const e=[];for(const n of t.split(/\r?\n/)){const r=n.trim();if(!r)continue;const o=r.toUpperCase().indexOf(Nl);if(o===-1)continue;const a=wN(r.slice(o+Nl.length));a&&e.push(a)}return e}function kN(t){const{conversationId:e,combinedMessages:n,showToast:r}=t,o=d.useRef(new Set);d.useEffect(()=>{o.current.clear()},[e]),d.useEffect(()=>{if(!e||n.length===0)return;const a=new Map;for(const i of n){if(i.type!=="assistant")continue;const l=vN(i);if(!l)continue;const c=_N(l);for(const u of c){const p=Cl(u);if(!p)continue;const m=`${e}:${p}`;o.current.has(m)||a.set(m,{normalized:p})}}a.size!==0&&(async()=>{try{const{notes:i}=await U.getDevNotes();if(!Array.isArray(i)||i.length===0)return;const l=new Map;for(const h of i){const g=Cl(h.content);if(!g||h.status!=="pending")continue;const f=l.get(g);f?f.push(h):l.set(g,[h])}const c=[],u=new Set,p=new Set;for(const[h,g]of a.entries()){let x=l.get(g.normalized)?.find(b=>!p.has(b.id));if(!x){const y=Array.from(l.entries()).find(([v])=>v.includes(g.normalized)||g.normalized.includes(v));y&&(x=y[1].find(v=>!p.has(v.id)))}x&&(u.add(h),p.add(x.id),c.push(x))}if(c.length===0)return;await Promise.all(c.map(h=>U.updateDevNoteStatus(h.id,"done"))),u.forEach(h=>o.current.add(h));const m=c.length;r({title:`Marked ${m} dev note${m===1?"":"s"} done`,message:m===1?c[0].content:void 0,type:"success",duration:3500})}catch(i){console.error("Failed to auto-complete dev notes from CHECK OFF markers:",i)}})()},[n,e,r])}const jN=300;function NN(t){const{conversationId:e,queryClient:n}=t;d.useEffect(()=>{let r=null;const o=()=>{document.visibilityState==="visible"&&e&&(r=setTimeout(()=>{console.debug(`[DETAIL-TRACE] visibility-refresh invalidating details for ${e?.slice(0,12)}`),n.invalidateQueries({queryKey:ft.details(e)}),n.invalidateQueries({queryKey:wt.one(e)})},jN))};return document.addEventListener("visibilitychange",o),()=>{document.removeEventListener("visibilitychange",o),r&&clearTimeout(r)}},[e,n])}function CN(t){return!!t&&t.startsWith("conv-")}function SN(t){const{conversationId:e,conversationDetails:n,insights:r,navStartRef:o,navigationDebugEnabled:a}=t,i=d.useRef(null),l=d.useRef(null),c=d.useRef(new Map),u=typeof window<"u"&&window.localStorage.getItem("perf-debug")==="1",p=d.useCallback((m,h,g,f)=>{u&&g<32},[u]);return d.useEffect(()=>{if(!e)return;const m=`nav-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,6)}`;o.current={conversationId:e,time:performance.now(),traceId:m},i.current=null,l.current=null},[e,a,o]),d.useEffect(()=>{if(!e||!CN(e))return;let m=!1;const h=setTimeout(()=>{(async()=>{try{const g=await U.getConversationStatus(e);if(m||g.status!=="ongoing")return;const f=await U.getUnifiedConversation(e);if(m)return;const x=f.segments.slice().sort((w,N)=>w.sequenceNumber-N.sequenceNumber).at(-1);if(x?.status==="active")return;const b=Date.now(),y="session-switch-segment-status-mismatch",v=c.current.get(y);(v===void 0||b-v>=1e4)&&(c.current.set(y,b),ht({component:"ConversationView",event:y,severity:"warn",details:{conversationId:e.slice(0,8),conversationStatus:g.status,activeStreamingId:g.streamingId||null,latestSegmentId:x?.segmentId||null,latestSegmentProvider:x?.provider||null,latestSegmentStatus:x?.status||"missing"}}))}catch{if(m)return}})()},500);return()=>{m=!0,clearTimeout(h)}},[e]),d.useEffect(()=>{if(!e||!n||i.current===e)return;i.current=e;const m=o.current,h=m.conversationId===e?m.time:void 0;h&&Math.round(performance.now()-h),m.conversationId===e&&m.traceId},[n,e,o]),d.useEffect(()=>{if(!e||!r||l.current===e)return;l.current=e;const m=o.current.conversationId===e?o.current.time:void 0;m&&Math.round(performance.now()-m)},[e,r,o]),{onPerfRender:p}}function EN(t){return t instanceof Error?t.message:typeof t=="string"?t:"Unknown error"}function TN(t,e){const n=EN(e).trim()||"Unknown error";return/permission request timeout/i.test(n)||/did not respond/i.test(n)?"Claude session paused after a permission request timed out. Retry with TRUST/accept-edits mode, or respond to permissions sooner.":`Claude session failed: ${n}`}function IN(t){const{conversationId:e,conversationPausedReason:n,session:r,setSessionOptimisticOngoing:o,invalidateConversations:a,restoreDraftFromBackup:i,setSessionFailureError:l,nextStepsDismissedRef:c}=t;return{handleSendMessage:d.useCallback(async(p,m,h,g,f)=>{l(null),r.proposedNextSteps&&r.proposedNextSteps.length>0&&(c.current=!0,r.clearNextSteps()),e&&n&&U.unifiedUpdateConversation(e,{pausedReason:null});try{r.addOptimisticUserMessage(p),e&&o(e,"claude"),await r.sendMessage(p,h,g,f),a()}catch(x){console.error("[ConversationView] Send failed:",x),l(TN("claude",x)),i()}},[e,n,r,o,a,i,l,c])}}const Sl=1500,AN=3500;function _o(t){return new Promise(e=>setTimeout(e,t))}function RN(t){const{session:e,conversationId:n,setStopRequested:r}=t;return{handleStop:d.useCallback(async()=>{if(r(!0),!n){try{await e.stop()||(console.warn("[stop] Graceful stop failed, escalating to force-kill"),await e.forceKill())}catch(l){console.error("[stop] Stop/force-kill threw:",l)}r(!1);return}const a=async()=>{try{return(await U.getConversationStatus(n)).status}catch{return null}},i=l=>l===null||l==="completed"||l==="idle";try{await e.stop(),await _o(Sl);let l=await a();if(i(l)||(await _o(AN),l=await a()),!i(l)){console.warn("[stop] Server-side escalation timed out, sending force-kill",{conversationId:n,status:l});try{await U.unifiedForceKillConversation(n)}catch{}await _o(Sl),l=await a(),i(l)||console.error("[stop] Force-kill did not terminate session",{conversationId:n,status:l})}}catch(l){console.error("[stop] Unexpected error during stop sequence:",l)}r(!1)},[e,n,r])}}const PN=5e3,MN=["Load failed","Failed to fetch","NetworkError","network error","Connection lost"];function El(t){return t?MN.some(e=>t.includes(e)):!1}function LN(t){const{sessionError:e,sessionFailureError:n,clearSessionError:r,clearSessionFailureError:o}=t,a=d.useRef(null);d.useEffect(()=>{a.current&&(clearTimeout(a.current),a.current=null);const i=El(e),l=El(n);if(!(!i&&!l))return a.current=setTimeout(()=>{i&&r(),l&&o(),a.current=null},PN),()=>{a.current&&(clearTimeout(a.current),a.current=null)}},[e,n,r,o])}function ON(t,e){return t&&!e}const Tl=2;function DN(t){return t.includes("Failed to fetch")||t.includes("Load failed")||t.includes("NetworkError")?"Connection lost — retrying…":t.includes("timeout")?"Session load timed out — retrying…":t}function $N({children:t}){const{agentColors:e}=tN(),n=d.useCallback(r=>e[r],[e]);return s.jsx(ug,{theme:"dark",resolveAgentColor:n,children:t})}function zN({sidebarOpen:t,onToggleSidebar:e}={}){const{conversationId:n}=$l(),r=n,o=Dl(),a=St(),i=dn(),{isPro:l}=gn(),{showToast:c}=zp();d.useEffect(()=>(r&&jk({conversationId:r,sessionId:r}),()=>Nk()),[r]);const u=d.useMemo(()=>new URLSearchParams(o.search).get("debug")==="messages"||$e.messages===!0,[o.search]),{status:p,connected:m,processAlive:h,error:g,messages:f,renderItems:x,childrenMessages:b,usage:y,hasBackgroundTasks:v,pendingMessages:w,actionTrace:N,send:C,stop:T,reconnect:S,fetchHistory:j}=Hj(r??null),{permissionRequest:E,answerPermission:R,answerPermissionWithPattern:D,answerPermissionWithPatterns:$}=eN(r),[ne,oe]=d.useState(new Set),[V,X]=d.useState([]),[H,W]=d.useState(null),[fe,L]=d.useState([]),[G,Z]=d.useState(null),[F,se]=d.useState(null),te=p!=="idle",ee=p==="idle",pe=p==="initializing",_e=p==="streaming",A=g??F,M=d.useCallback(()=>se(null),[]);d.useEffect(()=>{(p==="initializing"||p==="streaming")&&G===null&&Z(Date.now()),p==="idle"&&Z(null)},[p,G]);const he=f,Y=d.useMemo(()=>{const re={};for(const we of he)if(Array.isArray(we.content))for(const Ne of we.content){const Re=Ne;Re.type==="tool_result"&&typeof Re.tool_use_id=="string"&&(re[Re.tool_use_id]={status:"completed",result:typeof Re.content=="string"?Re.content:void 0,is_error:typeof Re.is_error=="boolean"?Re.is_error:void 0})}return re},[he]),B=d.useCallback(async(re,we,Ne,Re,Ur,hs)=>{try{if(m)await C(re);else{const Jt=await fetch(`/api/harness/${r}/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:re,model:we,permissionMode:Ne})});if(!Jt.ok){const Tm=await Jt.json().catch(()=>({error:"Start failed"}));throw new Error(Tm.error||"Start failed")}S()}}catch(Jt){se(Jt instanceof Error?Jt.message:"Send failed")}},[r,m,C,S]),ye=d.useCallback(async()=>{try{return await T(),!0}catch{return!1}},[T]),I=d.useCallback(async()=>{await T()},[T]),ce=d.useCallback(re=>{oe(we=>{const Ne=new Set(we);return Ne.has(re)?Ne.delete(re):Ne.add(re),Ne})},[]),ve=d.useCallback(()=>W(null),[]),Ve=d.useCallback(async re=>{await B(re)},[B]);d.useEffect(()=>{if(ee&&fe.length>0){const[re,...we]=fe;L(we),B(re.sendContent)}},[ee,fe,B]);const Ae=d.useMemo(()=>({messages:he,isActive:te,isConnected:m,proposedNextSteps:H,clearNextSteps:ve,addOptimisticUserMessage:re=>{},sendMessage:B,enqueueMessage:Ve}),[he,te,m,H,ve,B,Ve]),K=d.useMemo(()=>({stop:ye,forceKill:I}),[ye,I]),[me]=d.useState("Conversation"),[O,J]=d.useState(!1),[q,ae]=d.useState(null),[be,ge]=d.useState(!1),qe=d.useCallback(()=>ae(null),[]);LN({sessionError:A,sessionFailureError:q,clearSessionError:M,clearSessionFailureError:qe});const{insightsPanelOpen:je,setInsightsPanelOpen:Me,toggleInsightsPanel:Ye}=xN(),Je=t??!1,[ut,ps]=d.useState(!1),[Mr,xn]=d.useState(!1),[Lr,Or]=d.useState([]),Tt=d.useCallback(async re=>{try{return(await U.listDirectory({path:re||"",recursive:!1,respectGitignore:!0})).entries}catch(we){return console.error("Failed to fetch file system entries:",we),[]}},[]),bn=d.useCallback(async re=>{try{const we=await U.getCommands(re||""),Ne=we.commands.filter(Re=>Re.type==="custom").map(Re=>({name:Re.name,description:Re.description||"",argumentHint:Re.argumentHint}));return Or(Ne),we.commands}catch(we){return console.error("Failed to fetch commands:",we),[]}},[]),{conversations:yn,pendingInsightsUpdates:zs,invalidateConversations:vn,setSessionOptimisticOngoing:Kt}=Os(),st=d.useMemo(()=>r&&yn.find(re=>re.conversationId===r)||null,[yn,r]),rt=w2(r),Dr=d.useCallback(()=>{const re=r?`claudia-draft-${r}`:"claudia-draft-home",we=`${re}-backup`;try{const Ne=localStorage.getItem(we);Ne&&(localStorage.setItem(re,Ne),localStorage.removeItem(we))}catch{}},[r]),wn=d.useRef(null),_n=d.useRef(!1),nt=d.useRef(!1),z=d.useRef({}),le=d.useRef({}),Se=d.useRef(!1);d.useEffect(()=>{if(o.state)try{window.history.replaceState({},document.title)}catch{}},[o]),d.useEffect(()=>{_n.current=!1,nt.current=!1},[r]);const Te=d.useRef(rt.isOngoing);d.useEffect(()=>{const re=Te.current;Te.current=rt.isOngoing,ON(re,rt.isOngoing)&&r&&(console.debug(`[DETAIL-TRACE] completion-edge invalidating details for ${r?.slice(0,12)}`),i.invalidateQueries({queryKey:ft.details(r)}))},[rt.isOngoing,r,i]);const De=d.useRef(r);d.useEffect(()=>{De.current!==r&&(De.current=r,ge(!1),r&&(console.debug(`[DETAIL-TRACE] session-switch invalidating details for ${r?.slice(0,12)}`),i.invalidateQueries({queryKey:ft.details(r)}),i.invalidateQueries({queryKey:wt.one(r)})))},[r,i]);const it=50,ms=10,{data:ct,isLoading:$r,error:It,isFetching:zr}=Ct({queryKey:ft.details(r||""),queryFn:()=>{const re=z.current.conversationId===r?z.current.traceId:void 0;return console.debug(`[DETAIL-TRACE] queryFn executing for ${r?.slice(0,12)} limit=${ms} traceId=${re?.slice(0,16)}`),U.getConversationDetails(r,{limit:ms,traceId:re,timeout:2e4})},enabled:!!r,staleTime:3e4,refetchOnMount:!0,refetchOnWindowFocus:!1,retry:(re,we)=>{if(re>=3||!(we instanceof Error))return!1;const Ne=we.message,Re=Ne.includes("not found"),Ur=Ne.includes("Failed to fetch")||Ne.includes("NetworkError")||Ne.includes("Load failed"),hs=Ne.includes("timeout");return Re||Ur||hs},retryDelay:re=>Math.min(500*2**re,3e3)});NN({conversationId:r,queryClient:i});const{data:Qt,isLoading:om}=Ct({queryKey:["insights",r],queryFn:()=>U.unifiedGetInsights(r,!0),enabled:!!r,staleTime:3e4,refetchOnMount:!0,refetchOnWindowFocus:!1}),{onPerfRender:Fr}=SN({conversationId:r,conversationDetails:ct,insights:Qt,navStartRef:z,navigationDebugEnabled:$e.navigation}),{pendingQuestions:ci,handleAnswerPendingQuestion:am,handleDismissPendingQuestion:im}=yN({conversationId:r,isSessionIdle:ee,reconnectToStream:S}),cm=d.useMemo(()=>Qt?{lastUpdateTime:Qt.patchedAt||Qt.computedAt||null}:void 0,[Qt]);d.useEffect(()=>{ct&&ct.sessionId===r&&(hN({conversationDetails:ct,currentProposedNextSteps:H,isSessionIdle:ee,isDismissedThisSession:nt.current,setProposedNextSteps:W}),ct.mcpServers&&ct.mcpServers.length>0&&X(ct.mcpServers),fN({hasInitiallyFocusedRef:_n,composerRef:wn}))},[ct,H]),bN({conversationSummary:st,insights:Qt,conversationTitle:me});const lm=d.useCallback(()=>{e?.()},[e]),{handleSendMessage:Vr}=IN({conversationId:r,conversationPausedReason:st?.pausedReason,session:Ae,setSessionOptimisticOngoing:Kt,invalidateConversations:vn,restoreDraftFromBackup:Dr,setSessionFailureError:ae,nextStepsDismissedRef:nt}),dm=d.useCallback(re=>{nt.current=!0,ve();const we=st?.permissionMode;Vr(re,void 0,void 0,we||void 0)},[Vr,st?.permissionMode,ve]),um=d.useCallback(()=>{nt.current=!0,ve()},[ve]),li=d.useCallback(async(re,we,Ne)=>{if(!O){J(!0);try{await R(re,we,Ne)}catch(Re){console.error("Failed to send permission decision:",Re)}finally{J(!1)}}},[O,R]),pm=d.useCallback(async(re,we,Ne)=>{if(!O){J(!0);try{await D(re,we,Ne)}catch(Re){console.error(`Failed to add pattern to ${Ne} allowlist:`,Re)}finally{J(!1)}}},[O,D]),mm=d.useCallback(async(re,we,Ne)=>{if(!O){J(!0);try{await $(re,we,Ne)}catch(Re){console.error(`Failed to add patterns to ${Ne} allowlist:`,Re)}finally{J(!1)}}},[O,$]),{handleStop:hm}=RN({session:K,conversationId:r,setStopRequested:ge});d.useEffect(()=>{ae(null)},[r]);const di=d.useCallback(async re=>{if(!r||Se.current)return;const we=(le.current[r]||0)+1;if(we>Tl)return;le.current[r]=we,Se.current=!0;const Ne=z.current;Ne.conversationId===r&&Ne.time&&Math.round(performance.now()-Ne.time);try{await uN({sessionId:r,reconnectToStream:S}),await pN({queryClient:i,sessionId:r})}finally{Se.current=!1}},[r,m,S,i]),ui=!It&&$r,fm=ui,Yt=d.useMemo(()=>cN(he),[he]);Xj({conversationId:r??null,messages:Yt,actionTrace:N,connected:m,status:p});const{hasMoreMessages:gm,isLoadingMore:xm,jumpToMessageId:bm,setJumpToMessageId:ym,loadMoreMessages:vm,handleJumpToTurn:wm}=gN({conversationId:r,fetchHistory:j,initialMessageLimit:it});kN({conversationId:r,combinedMessages:Yt,showToast:c});const pt=te,pi=d.useRef(ee);d.useEffect(()=>{const re=pi.current;if(pi.current=ee,!r&&be){ge(!1);return}!pt&&ee&&!re&&be&&ge(!1)},[r,pt,ee,be]);const Br=d.useRef(!1);d.useEffect(()=>{Br.current=!1},[r]),d.useEffect(()=>{Br.current||(Br.current=!0,console.debug(`[status:mount] ${r?.slice(0,12)}`,`alive=${h} busy=${pt}`,{"authoritative.status":rt.status,"authoritative.streamingId":rt.streamingId?.slice(0,8)??"-","authoritative.isFetching":rt.isFetching,"authoritative.isLoading":rt.isLoading,"authoritative.dataUpdatedAt":rt.dataUpdatedAt,harnessStatus:p,isActive:te,harnessConnected:m,"session.streamingId":"-"}))});const mi=d.useRef({isProviderBusy:pt,processAlive:h});d.useEffect(()=>{const re=mi.current;(re.isProviderBusy!==pt||re.processAlive!==h)&&(console.debug(`[status:view] ${r?.slice(0,12)}`,`busy=${pt} (was ${re.isProviderBusy})`,`alive=${h} (was ${re.processAlive})`,{isActive:te,harnessConnected:m,harnessStatus:p,"authoritative.isOngoing":rt.isOngoing,"authoritative.isFetching":rt.isFetching}),mi.current={isProviderBusy:pt,processAlive:h})});const _m=[...fe];d.useEffect(()=>{r&&(le.current[r]=0,Se.current=!1)},[r]),d.useEffect(()=>{if(!r)return;const re=It instanceof Error&&It.message.includes("not found");if(It&&!(re&&h)||(le.current[r]||0)>=Tl)return;const Ne=pt,Re=Yt.length===0,hs=mN({hasActiveSignal:Ne,noVisibleContent:Re,slowHydration:$r||zr});if(!hs.shouldRecover)return;const Jt=setTimeout(()=>{di(hs.reason)},hs.delayMs);return()=>clearTimeout(Jt)},[r,It,$r,zr,pt,h,Yt.length,di]);const km=pt||h,jm=It instanceof Error&&It.message.includes("not found"),Nm=It&&!(jm&&km)?DN(It.message):null,hi=A==="session_limit"||A==="init_timeout"||zr?null:q||A||Nm,Cm=E?s.jsx(gj,{permission:E,streamingId:void 0,workingDirectory:st?.workingDirectory,onApprove:()=>li(E.id,"approve"),onApprovePattern:(re,we)=>pm(E.id,re,we),onApprovePatterns:(re,we)=>mm(E.id,re,we),onDeny:re=>li(E.id,"deny",re),isLoading:O}):null,fi=d.useRef(null);d.useEffect(()=>{if(A&&A!==fi.current){const re=r?`claudia-draft-${r}-backup`:"claudia-draft-home-backup",we=localStorage.getItem(re);if(we){const Ne=r?`claudia-draft-${r}`:"claudia-draft-home";localStorage.setItem(Ne,we),localStorage.removeItem(re)}}fi.current=A},[A,r]);const Sm=d.useCallback(async()=>{r&&await U.resumeConversation(r,{message:"Approved. Proceed with the plan.",permissionMode:"bypassPermissions"})},[r]),Em=d.useCallback(async()=>{r&&await U.resumeConversation(r,{message:"Plan rejected — please revise or take a different approach.",permissionMode:"plan"})},[r]);return s.jsx(d.Profiler,{id:"ConversationView",onRender:Fr,children:s.jsx(sN,{teamName:st?.teamName??null,children:s.jsx($N,{children:s.jsxs("div",{className:"h-full w-full flex flex-col bg-background relative overflow-hidden",role:"main","aria-label":"Conversation view",children:[s.jsx(X2,{sessionId:r,isArchived:st?.archived||!1,isPinned:st?.pinned||!1,subtitle:st?{date:new Date(st.createdAt).toLocaleDateString("en-US",{month:"short",day:"numeric"}),repo:st.workingDirectory.split("/").pop()||"project"}:void 0,insightsPanelOpen:je,onToggleInsightsPanel:Ye,crossSessionSidebarOpen:Je,onToggleCrossSessionSidebar:lm,onOpenCrossSessionAnalysis:()=>ps(!0),onOpenFeedbackPanel:()=>xn(!0)}),hi&&s.jsx("div",{className:"bg-red-500/10 border-b border-red-500 text-red-600 dark:text-red-400 px-4 py-2 text-sm text-center animate-in slide-in-from-top duration-300",role:"alert",children:hi}),A==="init_timeout"&&s.jsx("div",{className:"bg-amber-500/10 border-b border-amber-500 text-amber-700 dark:text-amber-400 px-4 py-2 text-sm text-center animate-in slide-in-from-top duration-300",role:"alert",children:"Session initialization timed out — the conversation may be too large. Consider starting a fresh session."}),s.jsxs("div",{className:"flex-1 flex overflow-hidden relative",children:[ut&&s.jsx("div",{className:"absolute inset-0 z-30 bg-background",children:s.jsx(Vp,{onClose:()=>ps(!1)})}),Mr&&s.jsx("div",{className:"absolute inset-0 z-30 bg-background",children:s.jsx(dj,{onClose:()=>xn(!1),conversationId:r})}),s.jsxs("div",{className:"flex-1 flex flex-col min-w-0 relative",children:[s.jsxs(s.Fragment,{children:[s.jsx(d.Profiler,{id:"MessageList",onRender:Fr,children:s.jsx(ek,{sessionId:r,messages:ui&&Yt.length===0?[]:Yt,renderItems:x,toolResults:Y,childrenMessages:b,expandedTasks:ne,onToggleTaskExpanded:ce,isLoading:fm,isStreaming:_e,streamingProvider:"claude",pendingQuestion:ci.length>0?ci[0]:null,onAnswerPendingQuestion:am,onDismissPendingQuestion:im,hasMore:gm,isLoadingMore:xm,onLoadMore:vm,branchLineage:ct?.sessionInfo?.branched_from_session_id?{parentSessionId:ct.sessionInfo.branched_from_session_id,atTurn:ct.sessionInfo.branched_at_turn||0,branchPointMessageId:ct.branchPointMessageId}:void 0,onNavigateToSession:re=>a(`/c/${re}`),sessionStartTime:G,isSwitchingProvider:!1,switchingToProvider:"claude",jumpToMessageId:bm,onJumpHandled:()=>ym(null),inlinePermissionPrompt:Cm,onPlanApprove:Sm,onPlanReject:Em,actionTrace:N})}),u&&s.jsx(oN,{messages:Yt,toolResults:Y,childrenMessages:b,sessionId:r})]}),st?.importedAt?s.jsx("div",{className:"flex-shrink-0 z-10 w-full flex justify-center py-3",style:{paddingBottom:"calc(var(--lattice-composer-dock-bottom-gap) + var(--lattice-safe-area-bottom))"},children:s.jsxs("div",{className:"inline-flex items-center gap-2 px-4 py-2 bg-cyan-500/10 border border-cyan-500/30 rounded-sm",children:[s.jsx(Wn,{size:14,className:"text-cyan-400"}),s.jsx("span",{className:"text-cyan-400 font-display text-xs uppercase tracking-wider",children:"Imported session — read-only"})]})}):s.jsxs("div",{className:"flex-shrink-0 bg-white/80 dark:bg-zinc-900/80 backdrop-blur-sm z-10 w-full flex flex-col items-center pt-4",style:{paddingBottom:"calc(var(--app-composer-dock-bottom-gap) + var(--app-safe-area-bottom))"},children:[H&&H.length>0&&ee&&s.jsx("div",{className:"w-full max-w-5xl px-4 mb-2",children:s.jsx(ck,{steps:H,onSelect:dm,onDismiss:um})}),w.length>0&&s.jsx("div",{className:"w-full max-w-5xl px-4 mb-2 flex flex-col gap-1.5",children:w.map(re=>s.jsx("div",{"data-testid":"pending-message",className:"flex justify-end",children:s.jsx("div",{className:"max-w-[80%] min-w-[100px]",children:s.jsxs("div",{className:"border border-cyan-500/15 rounded-lg overflow-hidden bg-cyan-500/3 w-full opacity-60",children:[s.jsx("div",{className:"flex items-center gap-2 px-3 py-1.5 border-b border-cyan-500/8",children:s.jsx("span",{className:"text-[11px] text-zinc-500 font-medium",children:"User"})}),s.jsx("div",{className:"px-3 py-2 text-[13px] leading-relaxed text-foreground/40 whitespace-pre-wrap break-words",children:re.text})]})})},`pending-${re.inputEvent.seq}`))}),s.jsx("div",{className:"w-full max-w-5xl px-4",children:s.jsx(up,{ref:wn,core:{sessionId:r,onSubmit:Vr,isLoading:m||O,placeholder:""},features:{enableFileAutocomplete:!0,showSmartMenu:!0},workingDirectory:st?.workingDirectory,permissionConfig:{onStop:hm,onInterrupt:I},skills:Lr,mcpServers:V,runtimeConfig:{isSessionActive:pt,isSessionConnected:h||rt.isIdle,isStopRequested:be,isInitializing:pe,hasBackgroundTasks:v,sessionStartTime:G??void 0,onFetchFileSystem:Tt,onFetchCommands:bn,queuedMessages:_m,sessionUsage:y}})})]})]}),s.jsx(d.Profiler,{id:"InsightsPanel",onRender:Fr,children:s.jsx(sj,{insights:Qt??null,isLoading:om,isOpen:l&&je,onClose:()=>{Me(!1),localStorage.setItem("insightsPanelOpen","false")},syncState:cm,isPendingInsightsUpdate:r?zs.has(r):!1,sessionId:r,onJumpToTurn:wm,onBranch:async re=>{await vn(),a(`/c/${re}`)}})})]})]})})})})}function FN(){return`pending-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}function qp({sidebarOpen:t,onToggleSidebar:e}){const[n,r]=xa(),o=St(),{serverConfig:a}=Ds(),{addOptimisticSession:i,addPendingLaunch:l,removePendingLaunch:c,invalidateConversations:u}=Os(),p="main",[m,h]=d.useState(!1),[g,f]=d.useState(!1),[x,b]=d.useState(0),[y,v]=d.useState(null),[w,N]=d.useState(!0);n.get("provider");const C=n.get("mode"),T="claude",[S,j]=d.useState(T);d.useEffect(()=>{j(T)},[T]);const E=ln({explicit:C??void 0,fallback:a?.defaultPermissionMode,provider:T}),R=a?.defaultWorkingDirectory||a?.cwd||"~",D=d.useCallback(async()=>{try{const[X,H,W]=await Promise.all([U.getDevNotes(),U.getPendingRecommendations(),U.getCrossSessionStatus()]);b(X.notes.length+H.recommendations.length),v({pendingExtractions:W.pendingExtractions,threshold:W.threshold,pendingProposals:W.pendingProposals,readyToAnalyze:W.readyToAnalyze,synthesisInProgress:W.synthesisInProgress})}catch(X){console.error("Failed to refresh new-session header state:",X)}finally{N(!1)}},[]);d.useEffect(()=>{D();const X=window.setInterval(()=>{D()},15e3);return()=>window.clearInterval(X)},[D]),d.useCallback(X=>{j(X);const H=new URLSearchParams(n);H.set("provider",X),r(H,{replace:!0})},[n,r]);const $=d.useCallback(()=>{f(!1),D()},[D]),ne=d.useCallback(async(X,H,W,fe)=>{if(X.length===0&&H.length===0)return;const G=await Mp(U,X,H,R,{workspace:p,provider:W||"claude",model:a?.defaultModel,permissionMode:fe||E});return G?(await u(),{sessionId:G.conversationId}):null},[u,E,a?.defaultModel,R]),oe=d.useCallback(()=>{const X=!!y?.readyToAnalyze;o(X?"/analysis/cross-session?run=1":"/analysis/cross-session")},[y?.readyToAnalyze,o]),V=d.useCallback(async(X,H,W,fe,L,G)=>{if(!X.trim()||m)return;h(!0);const Z=G||S,F=a?.defaultModel||"claude-opus-4-6",se=E,te=FN();l({tempId:te,workingDirectory:H||R,initialPrompt:X,model:F,permissionMode:se,workspace:p,provider:Z});try{const ee=await U.createConversation({provider:Z,message:X,workingDirectory:H||R,model:F,permissionMode:se,workspace:p});try{localStorage.setItem(`lattice:last-provider:${ee.conversationId}`,ee.provider)}catch{}i({conversationId:ee.conversationId,streamingId:ee.streamingId,workingDirectory:ee.cwd,model:ee.model,permissionMode:ee.permissionMode||se,initialPrompt:X,workspace:p,provider:ee.provider}),ca(ee.conversationId,"client.navigate_to_conversation"),o(`/c/${ee.conversationId}`),u()}catch(ee){console.error("Failed to create session:",ee),alert(`Failed to create session: ${ee instanceof Error?ee.message:"Unknown error"}`)}finally{c(te),h(!1)}},[m,S,E,R,p,a,i,l,c,u,o]);return s.jsx(Dt,{children:s.jsxs("div",{className:`flex-1 min-w-0 flex flex-col h-full relative overflow-hidden ${t?"hidden md:flex":""}`,children:[s.jsxs("div",{className:"flex justify-between items-center gap-3 px-4 py-3 border-b border-border/50 bg-background transition-colors relative overflow-hidden",children:[s.jsx("div",{className:"absolute inset-0 ui-grid-overlay pointer-events-none"}),s.jsxs("div",{className:"relative flex items-center gap-2 sm:gap-3 min-w-0",children:[!t&&s.jsx("button",{onClick:e,"aria-label":"Open sessions sidebar",className:"p-1.5 ui-icon-btn ui-icon-btn--cool",children:s.jsx(ql,{size:18})}),s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s.jsx(mp,{size:28,interactive:!0,colorScheme:"gradient"}),s.jsx("span",{className:"text-base font-display font-medium lowercase tracking-widest text-white",children:"lattice"}),s.jsx("span",{className:"hidden lg:inline font-mono text-[10px] text-muted-foreground/30 select-none",children:"9ebe492c"})]}),s.jsx("span",{className:"hidden md:block h-4 w-px bg-border/20 shrink-0"}),s.jsx("span",{className:"hidden sm:inline text-[10px] font-display font-bold uppercase tracking-wider text-muted-foreground/60",children:"New Session"})]}),s.jsxs("div",{className:"relative flex items-center gap-2 flex-shrink-0",children:[s.jsx(ha,{status:y,isLoading:w,onClick:oe}),s.jsx(Dp,{count:x,onClick:()=>f(!0)})]})]}),s.jsxs("div",{className:"flex-1 flex flex-col justify-end",children:[s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsxs("div",{className:"flex flex-col items-center gap-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(as,{size:14,className:"text-cyan-400/40"}),s.jsx("span",{className:"text-sm font-display font-bold uppercase tracking-wider text-muted-foreground/35",children:"Claude"})]}),s.jsxs("div",{className:"flex items-center gap-1.5 text-muted-foreground/20",children:[s.jsx("span",{className:"text-[10px] font-mono",children:"Type a message to start"}),s.jsx("span",{className:"text-[9px] font-mono px-1 py-0.5 border border-border/30 rounded-sm bg-background/40",children:"⏎"})]})]})}),s.jsx("div",{className:"flex-shrink-0 bg-white/80 dark:bg-zinc-900/80 backdrop-blur-sm z-10 w-full flex flex-col items-center pt-4",style:{paddingBottom:"calc(var(--app-composer-dock-bottom-gap) + var(--app-safe-area-bottom))"},children:s.jsx("div",{className:"w-full max-w-5xl px-4",children:s.jsx(up,{core:{onSubmit:V,isLoading:m,disabled:m,placeholder:""},features:{enableFileAutocomplete:!0,showSmartMenu:!0},workingDirectory:R,runtimeConfig:{isInitializing:m}})})})]}),s.jsx(Op,{isOpen:g,onClose:$,onLaunchSession:ne,defaultProvider:"claude",defaultPermissionMode:E,initialProvider:S,initialPermissionMode:E})]})})}const Il="app-favicon",Wp="/favicon.png",VN="/favicon-attention.svg",Kp=5e3;function Qp(t){return t.endsWith(".png")?"image/png":"image/svg+xml"}const Yp=["attention-favicon"];function BN(){const t=document.getElementById(Il);if(t instanceof HTMLLinkElement)return t;const e=document.createElement("link");return e.id=Il,e.rel="icon",e.type=Qp(Wp),document.head.appendChild(e),e}function Al(t){if(typeof document>"u")return;const e=BN(),n=t?VN:Wp;e.rel="icon",e.type=Qp(n),e.href=n}async function Jp(){const[t,e]=await Promise.all([U.getPermissions({status:"pending"}),U.getPendingQuestions()]),n={};for(const r of t.permissions){const o=r.conversationId||r.sessionId;o&&(n[o]=(n[o]||0)+1)}for(const r of e.questions){const o=r.conversationId||r.sessionId;o&&(n[o]=(n[o]||0)+1)}return{permissionCount:t.permissions.length,questionCount:e.questions.length,sessionAttention:n}}function UN(){const{data:t}=Ct({queryKey:Yp,queryFn:Jp,staleTime:2e3,refetchInterval:Kp,refetchIntervalInBackground:!1}),e=(t?.permissionCount||0)>0||(t?.questionCount||0)>0;return d.useEffect(()=>(Al(e),()=>{Al(!1)}),[e]),null}function GN(t){const{data:e}=Ct({queryKey:Yp,queryFn:Jp,staleTime:2e3,refetchInterval:Kp,refetchIntervalInBackground:!1});return!e||!t?!1:(e.sessionAttention[t]||0)>0}function $n({children:t,className:e=""}){return s.jsx("span",{className:`text-[7px] px-1 py-0.5 rounded-sm border font-bold uppercase tracking-wider backdrop-blur-sm ${e}`,children:t})}function HN(t){const e=Date.now()-new Date(t).getTime(),n=Math.floor(e/1e3),r=Math.floor(n/60),o=Math.floor(r/60);return n<10?"now":n<60?`${n}s`:r<60?`${r}m`:o<24?`${o}h`:`${Math.floor(o/24)}d`}const qN=["claude"];function WN(t){const e=new Set(t.providersUsed??[]);return e.add(t.latestProvider),qN.filter(n=>e.has(n))}function KN(t){return t.activeProvider??t.latestProvider}const QN=encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80" viewBox="0 0 80 80" fill="none">
349
349
  <path d="M0 20h80M0 40h80M0 60h80M20 0v80M40 0v80M60 0v80" stroke="rgba(255,255,255,0.18)" stroke-width="1"/>
350
350
  </svg>`);function YN({identityImage:t,isCurrent:e,isPending:n}){const r=!!t,o=r?`url(data:image/jpeg;base64,${t})`:"linear-gradient(135deg, rgba(56,189,248,0.25), rgba(59,130,246,0.05))",a=r?"":`, url("data:image/svg+xml,${QN}")`;return s.jsxs("div",{className:`relative h-11 w-full rounded-sm border border-border/20 overflow-hidden${n&&!r?" animate-pulse":""}`,style:{boxShadow:e?"0 0 10px rgba(34,211,238,0.12)":"0 0 6px rgba(148,163,184,0.08)"},children:[s.jsx("div",{className:"pointer-events-none absolute inset-0 bg-[linear-gradient(rgba(0,255,255,0.04)_1px,transparent_1px),linear-gradient(90deg,rgba(0,255,255,0.04)_1px,transparent_1px)] bg-[size:14px_14px] z-[1]"}),s.jsx("div",{className:"h-full w-full",style:{backgroundImage:`${o}${a}`,backgroundSize:r?"cover":"cover, 80px 80px",backgroundPosition:"center"}})]})}function xt({conversation:t,teamStatus:e,isCurrent:n,onClick:r,compact:o=!1,onRestore:a,recentlyCompleted:i=!1,onRenameSessionName:l,isRenamingSessionName:c=!1,onRegenerateSessionName:u,isRegeneratingSessionName:p=!1,onPin:m}){const{isPro:h}=gn(),g=GN(t.conversationId),f=h?t.insights:void 0,x=f?.context?.mission||f?.purpose||t.initialPrompt||"New session",b=t.customName?.trim()||"",y=b||x,v=!b&&!f?.context?.mission&&!f?.purpose&&!!t.initialPrompt,w=f?.purpose,[N,C]=Ce.useState(!1),[T,S]=Ce.useState(y),j=Ce.useRef(T);j.current=T;const E=Ce.useRef(null),R=Ce.useRef(c),D=Ce.useRef(!1),$=Ce.useCallback(()=>{const L=E.current;if(!L)return;L.style.height="0px";const F=Math.min(Math.max(L.scrollHeight,42),128);L.style.height=`${F}px`},[]);Ce.useEffect(()=>{N||S(y)},[N,y]),Ce.useEffect(()=>{!N||!E.current||(E.current.focus(),E.current.select(),$())},[$,N]),Ce.useEffect(()=>{N&&$()},[$,N,T]),Ce.useEffect(()=>{R.current&&!c&&N&&C(!1),R.current=c},[N,c]);const ne=Ce.useCallback(async()=>{if(!l||c||D.current)return;const L=j.current.trim();if(!L){S(y),C(!1);return}if(L===y){C(!1);return}D.current=!0,C(!1);try{await l(t,L)}catch{}finally{D.current=!1}},[t,l,y,c]),oe=h&&t.identityImage||void 0,V=WN(t),X=KN(t),H=!!(!t.importedAt&&(f?.context?.scope||f?.theme||f?.tags?.complexity&&f.tags.complexity!=="routine")),W=!!(!N&&r),fe=Ce.useCallback(L=>{!W||!r||(L.key==="Enter"||L.key===" ")&&(L.preventDefault(),r())},[W,r]);return o?s.jsxs("div",{className:`
351
351
  flex items-center gap-4 p-4 rounded-sm
@@ -47,7 +47,7 @@
47
47
  <!-- GitHub Mona Sans and Hubot Sans -->
48
48
  <link href="https://cdn.jsdelivr.net/npm/@aspect-ui/mona-sans@1.0.1/mona-sans.min.css" rel="stylesheet">
49
49
  <script src="https://unpkg.com/@alenaksu/json-viewer@2.1.0/dist/json-viewer.bundle.js"></script>
50
- <script type="module" crossorigin src="/assets/main-C1x7RHJx.js"></script>
50
+ <script type="module" crossorigin src="/assets/main-BscBU2VN.js"></script>
51
51
  <link rel="modulepreload" crossorigin href="/assets/vendor-react-xyVz3hOa.js">
52
52
  <link rel="modulepreload" crossorigin href="/assets/vendor-radix-BmcW-0BY.js">
53
53
  <link rel="modulepreload" crossorigin href="/assets/vendor-markdown-vZ7invOV.js">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lattice-orchestrator",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "type": "module",
5
5
  "description": "Lattice - Claude Code session orchestration dashboard",
6
6
  "main": "dist/lattice-server.js",
@@ -108,7 +108,7 @@
108
108
  "@eslint/js": "^9.39.2",
109
109
  "@google/genai": "^1.11.0",
110
110
  "@isoflow/isopacks": "^0.0.10",
111
- "@liggi/agent-ui-harness": "^0.1.0",
111
+ "@liggi/agent-ui-harness": "^0.1.1",
112
112
  "@modelcontextprotocol/sdk": "^1.17.0",
113
113
  "@musistudio/llms": "^1.0.19",
114
114
  "@radix-ui/react-collapsible": "^1.1.11",