@openchambery/web 1.19.5-beta.9 → 1.19.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AgentAvatar-BceI_qBC.js → AgentAvatar-CecaXP3U.js} +1 -1
- package/dist/assets/{AssistantView-D5uRIhdd.js → AssistantView-EVdG6eL4.js} +1 -1
- package/dist/assets/{ChatContainer-vRoWqx9I.js → ChatContainer-CI9R1YEw.js} +39 -39
- package/dist/assets/ContextPanel-BKypMSdw.js +285 -0
- package/dist/assets/{DiagramView-tg_cF9bP.js → DiagramView-Cv8NeQZw.js} +1 -1
- package/dist/assets/MarkdownRendererImpl-BoNGeBaU.js +7 -0
- package/dist/assets/{MobileDetailNavigation-C3FPxLXw.js → MobileDetailNavigation-D_A3VHWc.js} +1 -1
- package/dist/assets/{MobileShareBridge-CwfVGh1E.js → MobileShareBridge-BhrdIMbw.js} +1 -1
- package/dist/assets/MobileSurface-CW5N2v0z.js +2 -0
- package/dist/assets/{MultiRunWindow-DeM0arSL.js → MultiRunWindow-Bh_4iSsl.js} +1 -1
- package/dist/assets/{OnboardingScreen-Czusf7rR.js → OnboardingScreen-BkbprNa7.js} +1 -1
- package/dist/assets/{SettingsView-3mxG03Kg.js → SettingsView-DjI_CkV3.js} +8 -8
- package/dist/assets/{SettingsWindow-CKVr8vEW.js → SettingsWindow-DD0gPVO2.js} +1 -1
- package/dist/assets/{TerminalView-B2vNAAGI.js → TerminalView-BdWZzQZR.js} +1 -1
- package/dist/assets/{ToolOutputDialog-FY1p6ABd.js → ToolOutputDialog-cAhekX_M.js} +1 -1
- package/dist/assets/appThemeRegistry-Z7AwGiu9.js +2 -0
- package/dist/assets/{clipboard-Ca2PSbr_.js → clipboard-C0bgPFn5.js} +1 -1
- package/dist/assets/{dialog-B2ieeCSR.js → dialog-Bjnvo5pk.js} +1 -1
- package/dist/assets/{es-Bj9HwM-0.js → es-D9KcV5TX.js} +1 -1
- package/dist/assets/{fr-BgEHZGug.js → fr-DPA9qUl3.js} +1 -1
- package/dist/assets/{gitApi-CIStyhfQ.js → gitApi-9I-wy4Pz.js} +1 -1
- package/dist/assets/insertionBoundaries-Dy_9x0TV.js +4 -0
- package/dist/assets/{ja-clyxf6re.js → ja-Dsif3NoD.js} +1 -1
- package/dist/assets/{ko-BZb3gnuq.js → ko-Dixx4Ctg.js} +1 -1
- package/dist/assets/{main-4AJr41lz.js → main-Dy2r9c5q.js} +2 -2
- package/dist/assets/{main-BXQdBQ0u.js → main-ssS4AQpG.js} +4 -4
- package/dist/assets/{miniChat-xTsSFILb.js → miniChat-CQqw310g.js} +2 -2
- package/dist/assets/{mobile-BCQf1Sdm.js → mobile-ClMMhPzX.js} +2 -2
- package/dist/assets/multirun-3dsNL_2z.js +4 -0
- package/dist/assets/{pl-CwZzSvrm.js → pl-Bj78ZGgf.js} +1 -1
- package/dist/assets/{projectMeta-DPKKf4Of.js → projectMeta-CZLzky9G.js} +2 -2
- package/dist/assets/{pt-BR-6ali2BQX.js → pt-BR-CFL3xSAf.js} +1 -1
- package/dist/assets/radio-D44bfX2h.js +1 -0
- package/dist/assets/{renderElectronMiniChatApp-BLlVyeOM.js → renderElectronMiniChatApp-Douqsp9n.js} +2 -2
- package/dist/assets/renderMobileApp-ScH1FVE6.js +25 -0
- package/dist/assets/{runtimeConfig-HOGA9fV1.js → runtimeConfig-D2zUK5uB.js} +1 -1
- package/dist/assets/runtimeEndpointReset-CFWN_nYN.js +4 -0
- package/dist/assets/{shikiHighlight-CYGn2J0U.js → shikiHighlight-CRK1juTA.js} +1 -1
- package/dist/assets/{sortable-tabs-strip-CxLE1X9x.js → sortable-tabs-strip-oDpTDVoQ.js} +1 -1
- package/dist/assets/src-2eFAiBLq.css +2 -0
- package/dist/assets/{store-BvrCRq6U.js → store-DzpbXWX1.js} +2 -2
- package/dist/assets/{uk-qRqJs4GS.js → uk-BY60Ub3Z.js} +1 -1
- package/dist/assets/{useAppFontEffects-Bs2vXOZc.js → useAppFontEffects-BIaLn7X0.js} +3 -3
- package/dist/assets/{useDesktopWindowControlsLayout-BF-8wlNn.js → useDesktopWindowControlsLayout-B9oOTdt_.js} +1 -1
- package/dist/assets/{useEffectiveDirectory-VgouJnIr.js → useEffectiveDirectory-BuzzKlL1.js} +1 -1
- package/dist/assets/{useMobileNavigationStore-KGRUWzjR.js → useMobileNavigationStore-SLsstI7D.js} +4 -4
- package/dist/assets/{useSessionAutoCleanup-Bw0QGMfA.js → useSessionAutoCleanup-C3QX4RaU.js} +1 -1
- package/dist/assets/{useWorkerHighlightedLines-CGgUFz01.js → useWorkerHighlightedLines-Ct_wpd4P.js} +1 -1
- package/dist/assets/{zh-CN-CwZ0adcY.js → zh-CN-Cox1LaOW.js} +2 -2
- package/dist/assets/{zh-TW-DC0jiCzA.js → zh-TW-B6RU0mxa.js} +2 -2
- package/dist/index.html +3 -3
- package/dist/mini-chat.html +3 -3
- package/dist/mobile.html +3 -3
- package/package.json +1 -1
- package/dist/assets/ContextPanel-BsZ6pucf.js +0 -285
- package/dist/assets/MarkdownRendererImpl-CUbq7MnV.js +0 -7
- package/dist/assets/MobileSurface-D7DvzqGV.js +0 -2
- package/dist/assets/appThemeRegistry-CxYhYWfx.js +0 -2
- package/dist/assets/insertionBoundaries-DKaP2akF.js +0 -4
- package/dist/assets/multirun-BGtjVyHw.js +0 -4
- package/dist/assets/radio-CkwG8Ru_.js +0 -1
- package/dist/assets/renderMobileApp-CCjMtagc.js +0 -25
- package/dist/assets/runtimeEndpointReset-pH89Ln7s.js +0 -4
- package/dist/assets/src-Bd_0IB9v.css +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-C0FnF6B9.js";import{kn as t,xn as n}from"./persistence-CLUawIlm.js";import{$ as r,A as i,C as a,F as o,G as s,J as c,K as l,L as u,M as d,N as f,Nt as p,O as m,Q as h,R as ee,S as te,T as ne,X as re,Y as g,Z as ie,_ as ae,at as oe,b as se,c as ce,d as le,gt as ue,h as de,ht as fe,it as pe,lt as me,m as he,nt as ge,o as _e,pt as ve,rt as ye,u as be,ut as xe,v as Se,vt as Ce,w as we,x as Te,xt as Ee,yt as De,z as Oe}from"./platform-BrncW9ab.js";import{l as _,qi as v,s as ke,ta as y,za as Ae}from"./useMobileNavigationStore-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-C0FnF6B9.js";import{kn as t,xn as n}from"./persistence-CLUawIlm.js";import{$ as r,A as i,C as a,F as o,G as s,J as c,K as l,L as u,M as d,N as f,Nt as p,O as m,Q as h,R as ee,S as te,T as ne,X as re,Y as g,Z as ie,_ as ae,at as oe,b as se,c as ce,d as le,gt as ue,h as de,ht as fe,it as pe,lt as me,m as he,nt as ge,o as _e,pt as ve,rt as ye,u as be,ut as xe,v as Se,vt as Ce,w as we,x as Te,xt as Ee,yt as De,z as Oe}from"./platform-BrncW9ab.js";import{l as _,qi as v,s as ke,ta as y,za as Ae}from"./useMobileNavigationStore-SLsstI7D.js";var je=e({applyGitStash:()=>G,checkIsGitRepository:()=>S,checkoutCommit:()=>Ke,cherryPick:()=>qe,countGitStashFiles:()=>U,createBranch:()=>J,createGitIdentity:()=>Z,createGitWorktree:()=>z,deleteGitIdentity:()=>$,deleteGitWorktree:()=>B,deleteRemoteBranch:()=>j,discoverGitCredentials:()=>He,discoverGitRepositories:()=>C,dropGitStash:()=>q,generateCommitMessage:()=>N,getCommitFileDiff:()=>Y,getConflictDetails:()=>Xe,getGitBranches:()=>A,getGitIdentities:()=>X,getGitStatus:()=>w,getGitWorktreeBootstrapStatus:()=>L,getGlobalGitIdentity:()=>Ue,git:()=>V,listGitStashes:()=>H,listGitWorktrees:()=>F,merge:()=>Ge,popGitStash:()=>K,previewGitWorktree:()=>R,rebase:()=>We,resetToCommit:()=>Ye,resolveGitPrimaryRoot:()=>T,resolveGitTopLevel:()=>E,revertCommit:()=>Je,stageGitFile:()=>D,stageGitFiles:()=>O,stashGitChanges:()=>W,unstageGitFile:()=>Pe,unstageGitFiles:()=>k,updateGitIdentity:()=>Q,validateGitWorktree:()=>I}),b=()=>n()?.git??null,Me=e=>{typeof window>`u`||window.dispatchEvent(new CustomEvent(`openchamber:chat-force-scroll-bottom`,{detail:{sessionId:e}}))},x=e=>{let t=e.trim(),n=(t.match(/```(?:json)?\s*([\s\S]*?)```/i)?.[1]??t).trim(),r=[n.indexOf(`{`)].filter(e=>e>=0);for(let e of r)for(let t=n.length;t>e;--t)if(n[t-1]===`}`)try{let r=JSON.parse(n.slice(e,t));if(r&&typeof r==`object`&&!Array.isArray(r))return r}catch{}return null},Ne=e=>{let t=e?.data;return(Array.isArray(t?.parts)?t.parts:[]).map(e=>{let t=e;return t.type===`text`?typeof t.text==`string`?t.text:typeof t.content==`string`?t.content:typeof t.value==`string`?t.value:``:``}).filter(e=>e.trim().length>0).join(`
|
|
2
2
|
`).trim()};async function S(e){let t=b();return t?t.checkIsGitRepository(e):ce(e)}async function C(e){return we(e)}async function w(e,t){let n=b();return n?n.getGitStatus(e,t):u(e,t)}async function T(e){return(await ye(e)).root}async function E(e){return(await pe(e)).root}async function D(e,t){let n=b();return n?.stageGitFile?n.stageGitFile(e,t):me(e,t)}async function O(e,t){let n=b();return n?.stageGitFiles?n.stageGitFiles(e,t):xe(e,t)}async function Pe(e,t){let n=b();return n?.unstageGitFile?n.unstageGitFile(e,t):fe(e,t)}async function k(e,t){let n=b();return n?.unstageGitFiles?n.unstageGitFiles(e,t):ue(e,t)}async function A(e,t){let n=b();if(t?.signal?.throwIfAborted(),n){let r=await n.getGitBranches(e,t);return t?.signal?.throwIfAborted(),r}return d(e,t)}async function j(e,t){let n=b();return n?n.deleteRemoteBranch(e,t):te(e,t)}var Fe=30,Ie=12e4,Le=async(e,t)=>{let n=t.slice(0,Fe),r=await Promise.all(n.map(async t=>{try{let[n,r]=await Promise.all([f(e,{path:t,staged:!0}).catch(()=>null),f(e,{path:t,staged:!1}).catch(()=>null)]);return[n?.diff,r?.diff].filter(e=>typeof e==`string`&&e.trim().length>0).join(`
|
|
3
3
|
`)||`--- ${t} (no textual diff available)`}catch{return`--- ${t} (diff unavailable)`}})),i=``;for(let e of r){if(i.length+e.length>Ie){i+=`
|
|
4
4
|
[remaining diffs truncated]`;break}i+=(i?`
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{A as t,E as n,b as r,t as i,y as a}from"./useUIStore-BXjMQrel.js";import{$t as o,D as s,d as c,k as l,ot as u,u as d,xn as f}from"./persistence-CLUawIlm.js";import{a as p,i as m,r as h}from"./vendor-zustand-B4dlGEM2.js";import{nt as g,rt as _,tt as v}from"./vendor-base-ui-CnHfUmDN.js";import{B as y,Ct as b,M as x,Mt as S}from"./platform-BrncW9ab.js";import{n as C}from"./vendor-react-DLPElpoQ.js";import{s as w}from"./vendor-tanstack-react-query-D7pys_c9.js";import{n as T}from"./vendor-reactuses-core-DDoDDyM9.js";import{n as ee}from"./clipboard-C0bgPFn5.js";import{_ as te,an as ne,b as E,bo as D,ct as re,fr as O,ft as ie,hn as k,l as A,lt as ae,ot as j,pt as oe,ro as se,st as ce,ta as M,ut as N,yo as P}from"./useMobileNavigationStore-SLsstI7D.js";import{c as le,t as F}from"./utils-D94hxQYq.js";import{n as I,r as L,t as R}from"./Icon-Du1LX11Q.js";import{g as ue,v as de}from"./gitApi-9I-wy4Pz.js";import{A as fe,X as pe,p as z,s as B}from"./projectMeta-CZLzky9G.js";var V=e(_(),1),H=C(),U=g(),W=e(v(),1),me=e=>{switch(e.name){case`new`:return`add`;case`init`:return`file`;case`undo`:return`arrow-go-back`;case`redo`:return`arrow-go-forward`;case`timeline`:return`time`;case`compact`:return`scissors`;case`goal`:return`target`;case`review`:return`search-eye`;case`test`:case`build`:case`run`:return`terminal-box`;default:return e.isBuiltIn?`flashlight`:`command`}},he=()=>`book-open`,ge=e=>{if(e.isDirectory)return`folder-3-fill`;switch(e.extension?.toLowerCase()){case`ts`:case`tsx`:case`js`:case`jsx`:case`json`:return`code`;case`md`:case`mdx`:return`file`;case`png`:case`jpg`:case`jpeg`:case`gif`:case`svg`:return`file-image`;default:return`file-pdf`}},_e=()=>`ai-agent`,ve=()=>`chat-thread`,G=32,K=(e,t)=>{let n=L[e];return typeof n!=`string`||n.length===0?null:`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="${t}" stroke-width="${R}" stroke-linecap="round" stroke-linejoin="round">${n}</svg>`},ye=(e,t)=>{let n=K(e,t);return!n||typeof document>`u`?Promise.resolve(null):new Promise(e=>{let t=new Image;t.decoding=`async`,t.onload=()=>{try{let n=document.createElement(`canvas`);n.width=G,n.height=G;let r=n.getContext(`2d`);if(!r){e(null);return}r.clearRect(0,0,G,G),r.drawImage(t,0,0,G,G);let i=n.toDataURL(`image/png`),a=i.indexOf(`,`);e(a>=0?i.slice(a+1):null)}catch{e(null)}},t.onerror=()=>e(null),t.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`})},be=(e,t)=>e.map(e=>{let n=e.isSkill?t.skill:e.isOpenChamber?`OpenChamber`:e.isBuiltIn?t.system:e.scope||e.agent||t.command;return{id:e.id,title:`/${e.name}`,subtitle:e.description,badge:n,iconName:me(e)}}),q=e=>e.map(e=>({id:`${e.name}-${e.scope}`,title:e.name,subtitle:e.description,badge:e.scope,iconName:he()})),xe=({agents:e,sessions:t,recentFiles:n,pathHits:r,untitledSession:i,sessionBadge:a})=>{let o=[];for(let t of e)o.push({id:`agent:${t.name}`,title:`@${t.name}`,subtitle:t.description,iconName:_e()});for(let e of t)o.push({id:`session:${e.id}`,title:e.title||i,badge:a,iconName:ve()});for(let e of n)o.push({id:`recent:${e.path}`,title:e.relativePath||e.name,iconName:ge(e)});for(let e of r)o.push({id:`file:${e.path}`,title:e.relativePath||e.name,iconName:ge(e)});return o},J=(e,t)=>{let n=t.trim();if(!n)return[...e].sort((e,t)=>e.isBuiltIn===t.isBuiltIn?e.name.localeCompare(t.name):e.isBuiltIn?-1:1);let r=oe([...e],n,e=>[e.name,e.description??``]);return r.sort((e,t)=>e.score===t.score?e.item.isBuiltIn===t.item.isBuiltIn?e.item.name.localeCompare(t.item.name):e.item.isBuiltIn?-1:1:e.score-t.score),r.map(e=>e.item)},Y=(e,t)=>{if(!e.includes(`/`)||t.size===0)return[];let n=RegExp(`(^|\\s)/(${u})?([A-Za-z0-9][A-Za-z0-9_-]*)(?=$|\\s)`,`g`),r=[],i;for(;(i=n.exec(e))!==null;){let e=i[3]??``;if(!t.has(e.toLowerCase()))continue;let n=i[2]??``,a=i.index+(i[1]?.length??0);r.push({start:a,end:a+1+n.length+e.length,name:e,hasSlot:n.length>0})}return r},X=(e,t,n=e.length)=>{let r=Y(e,t).filter(e=>!e.hasSlot);if(r.length===0)return null;let i=e,a=n;for(let e=r.length-1;e>=0;--e){let t=r[e].start+1;i=`${i.slice(0,t)}${u}${i.slice(t)}`,a>t&&(a+=u.length)}return i===e?null:{text:i,caret:a}},Se=e=>e.startsWith(u)?e.slice(u.length):e,Ce=e=>{if(e.inputMode===`shell`)return null;let t=e.text,n=Math.max(0,Math.min(e.cursor,t.length));if(t.startsWith(`/`)){let e=t.indexOf(` `),r=t.indexOf(`
|
|
2
|
+
`),i=Math.min(e===-1?t.length:e,r===-1?t.length:r);if(n<=i&&e===-1)return{kind:`slash-command`,query:Se(t.substring(1,i)),tokenStart:0,tokenEnd:i}}let r=t.substring(0,n),i=r.lastIndexOf(`/`);if(i!==-1){let e=i>0?r[i-1]:null,t=Se(r.substring(i+1)),a=t.includes(` `)||t.includes(`
|
|
3
|
+
`);if((!e||/\s/.test(e))&&!a)return{kind:`slash-skill`,query:t,tokenStart:i,tokenEnd:n}}let a=r.lastIndexOf(`#`);if(a!==-1){let e=a>0?r[a-1]:null,t=r.substring(a+1);if((!e||/\s/.test(e))&&!t.includes(` `)&&!t.includes(`
|
|
4
|
+
`))return{kind:`snippet`,query:t,tokenStart:a,tokenEnd:n}}let o=j({value:t,cursorPosition:n,inputSource:e.mentionInputSource??`manual`,insertedText:e.insertedText});return o===null?null:{kind:`mention`,query:o,tokenStart:r.lastIndexOf(`@`),tokenEnd:n}},we=e=>e===`mention`?`@`:e===`snippet`?`#`:`/`,Te=(e,t,n)=>{if(n&&n.tokenStart>=0&&n.tokenEnd>=n.tokenStart&&n.tokenEnd<=e.length&&e.startsWith(we(n.kind),n.tokenStart))return{start:n.tokenStart,end:n.tokenEnd};let r=Ce({text:e,cursor:t});return r?{start:r.tokenStart,end:r.tokenEnd}:null},Ee=(e,t)=>e===t||e.length===t.length&&e.every((e,n)=>{let r=t[n];return r!=null&&e.id===r.id&&e.title===r.title&&(e.subtitle??``)===(r.subtitle??``)&&(e.badge??``)===(r.badge??``)&&e.iconName===r.iconName}),De=(e,t)=>e.highlightedIndex===t.highlightedIndex&&Ee(e.rows,t.rows),Oe=(e,t)=>Ee(e,t)?e:t.slice(),ke=(e,t,n)=>{e&&(t.current&&De(t.current,n)||(t.current=n,e(n)))},Ae=(e,t)=>{t.current=null,e?.({rows:[],highlightedIndex:0})},Z=e=>{if(!e)return``;let t=e.replace(/\\/g,`/`),n=t.startsWith(`//`),r=t.replace(/\/+/g,`/`);n&&!r.startsWith(`//`)&&(r=`/${r}`);let i=r===`/`,a=/^[A-Za-z]:\/$/.test(r);return!i&&!a&&(r=r.replace(/\/+$/,``)),r},je=e=>/^[A-Za-z]:\//.test(e)?e.toLowerCase():e,Me=(e,t)=>{let n=Z(t),r=Z(e);if(!n||!r)return!1;let i=je(n),a=je(r);return a===i||a.startsWith(`${i}/`)},Ne=e=>{if(!e||typeof e!=`object`)return{};let t=e,n={};for(let[e,r]of Object.entries(t)){let t=Z(e);if(!t||!r||typeof r!=`object`)continue;let i=r,a=Array.isArray(i.openPaths)?Array.from(new Set(i.openPaths.filter(e=>typeof e==`string`).map(e=>Z(e)).filter(e=>Me(e,t)))):[],o=Array.isArray(i.expandedPaths)?Array.from(new Set(i.expandedPaths.filter(e=>typeof e==`string`).map(e=>Z(e)).filter(e=>Me(e,t)))):[],s=typeof i.selectedPath==`string`?Z(i.selectedPath):null,c=s&&Me(s,t)?s:a[0]??null,l=typeof i.touchedAt==`number`&&Number.isFinite(i.touchedAt)?i.touchedAt:Date.now(),u=n[t];if(u){let e=Array.from(new Set([...u.openPaths,...a])),r=Array.from(new Set([...u.expandedPaths,...o]));n[t]={openPaths:e,selectedPath:u.selectedPath??c??e[0]??null,expandedPaths:r,touchedAt:Math.max(u.touchedAt,l)};continue}n[t]={openPaths:a,selectedPath:c,expandedPaths:o,touchedAt:l}}return n},Pe=(e,t)=>{let n=Object.entries(e);if(n.length<=t)return e;n.sort((e,t)=>(t[1]?.touchedAt??0)-(e[1]?.touchedAt??0));let r={};for(let[e,i]of n.slice(0,t))r[e]=i;return r},Fe=e=>e?{...e,touchedAt:Date.now()}:{openPaths:[],selectedPath:null,expandedPaths:[],touchedAt:Date.now()},Ie=p()(h(m((e,t)=>({byRoot:{},addOpenPath:(t,n,r)=>{let i=Z((t||``).trim()),a=Z((n||``).trim());!i||!a||!r?.allowOutsideRoot&&!Me(a,i)||e(e=>{let t=e.byRoot[i],n=Fe(t),r=n.openPaths.includes(a),o=r?n.openPaths:[...n.openPaths,a],s=n.selectedPath??a;return t&&r&&t.selectedPath===s?e:{byRoot:Pe({...e.byRoot,[i]:{...n,openPaths:o,selectedPath:s}},20)}})},removeOpenPath:(t,n)=>{let r=Z((t||``).trim()),i=Z((n||``).trim());!r||!i||e(e=>{let t=e.byRoot[r];if(!t)return e;let n=je(i),a=e=>je(e)===n,o=t.selectedPath?a(t.selectedPath):!1;if(!t.openPaths.some(a)&&!o)return e;let s=t.openPaths.filter(e=>!a(e)),c=o?s[0]??null:t.selectedPath;return{byRoot:Pe({...e.byRoot,[r]:{...t,openPaths:s,selectedPath:c,touchedAt:Date.now()}},20)}})},removeOpenPathsByPrefix:(t,n)=>{let r=Z((t||``).trim()),i=Z((n||``).trim());!r||!i||e(e=>{let t=e.byRoot[r];if(!t)return e;let n=je(i),a=n.endsWith(`/`)?n:`${n}/`,o=e=>{let t=je(e);return t===n||t.startsWith(a)},s=t.openPaths.filter(e=>!o(e));if(s.length===t.openPaths.length)return e;let c=t.selectedPath&&o(t.selectedPath)?s[0]??null:t.selectedPath;return{byRoot:Pe({...e.byRoot,[r]:{...t,openPaths:s,selectedPath:c,touchedAt:Date.now()}},20)}})},removeExpandedPathsByPrefix:(t,n)=>{let r=Z((t||``).trim()),i=Z((n||``).trim());!r||!i||e(e=>{let t=e.byRoot[r];if(!t)return e;let n=je(i),a=n.endsWith(`/`)?n:`${n}/`,o=t.expandedPaths.filter(e=>{let t=je(e);return t!==n&&!t.startsWith(a)});return o.length===t.expandedPaths.length?e:{byRoot:Pe({...e.byRoot,[r]:{...t,expandedPaths:o,touchedAt:Date.now()}},20)}})},setSelectedPath:(t,n,r)=>{let i=Z((t||``).trim()),a=n?Z(n.trim()):null;!i||a&&!r?.allowOutsideRoot&&!Me(a,i)||e(e=>{let t=e.byRoot[i],n=Fe(t),r=a&&!n.openPaths.includes(a)?[...n.openPaths,a]:n.openPaths;return t&&t.selectedPath===a&&r===t.openPaths?e:{byRoot:Pe({...e.byRoot,[i]:{...n,openPaths:r,selectedPath:a}},20)}})},ensureSelectedPath:e=>{let n=Z((e||``).trim());if(!n)return;let r=t().byRoot[n];if(!r||r.selectedPath)return;let i=r.openPaths[0]??null;i&&t().setSelectedPath(n,i)},toggleExpandedPath:(t,n)=>{let r=Z((t||``).trim()),i=Z((n||``).trim());!r||!i||!Me(i,r)||e(e=>{let t=e.byRoot[r],n=Fe(t),a=n.expandedPaths.includes(i)?n.expandedPaths.filter(e=>e!==i):[...n.expandedPaths,i];return t&&t.expandedPaths===a&&t.selectedPath===n.selectedPath&&t.openPaths===n.openPaths?e:{byRoot:Pe({...e.byRoot,[r]:{...n,expandedPaths:a}},20)}})},expandPath:(t,n)=>{let r=Z((t||``).trim()),i=Z((n||``).trim());!r||!i||!Me(i,r)||e(e=>{let t=e.byRoot[r],n=Fe(t);return n.expandedPaths.includes(i)&&t?e:{byRoot:Pe({...e.byRoot,[r]:{...n,expandedPaths:[...n.expandedPaths,i]}},20)}})},expandPaths:(t,n)=>{let r=Z((t||``).trim());if(!r||!n||n.length===0)return;let i=n.map(e=>Z((e||``).trim())).filter(e=>e&&Me(e,r));i.length!==0&&e(e=>{let t=e.byRoot[r],n=Fe(t),a=new Set(n.expandedPaths),o=i.filter(e=>!a.has(e));return o.length===0?e:{byRoot:Pe({...e.byRoot,[r]:{...n,expandedPaths:[...n.expandedPaths,...o]}},20)}})}}),{name:`files-view-tabs-store`,version:2,storage:a(),migrate:e=>{if(!e||typeof e!=`object`)return{byRoot:{}};let t=e.byRoot;return{byRoot:Ne(t)}},partialize:e=>({byRoot:Ne(e.byRoot)})}),{name:`files-view-tabs-store`})),Le=(e,t)=>{let n=(0,H.c)(4),r=t===void 0?200:t,[i,a]=V.useState(e),o,s;return n[0]!==r||n[1]!==e?(o=()=>{let t=window.setTimeout(()=>{a(e)},r);return()=>{window.clearTimeout(t)}},s=[e,r],n[0]=r,n[1]=e,n[2]=o,n[3]=s):(o=n[2],s=n[3]),V.useEffect(o,s),i},Re=()=>{let e=(0,H.c)(17),t=A(ze),n=k(),r;e[0]===t?r=e[1]:(r=e=>t?e.getAttachment(t):void 0,e[0]=t,e[1]=r);let i=E(r),a=A(Be),o=A(Ve),s=D(He),c=D(Ue),l=b(We);if(t){let r;e[2]===i?r=e[3]:(r=te(i),e[2]=i,e[3]=r);let o=r;if(o)return o;let s;e[4]!==t||e[5]!==a?(s=a.get(t),e[4]=t,e[5]=a,e[6]=s):s=e[6];let c=s;if(c?.path)return c.path;let l;if(e[7]!==t||e[8]!==n){let r;e[10]===t?r=e[11]:(r=e=>e.id===t,e[10]=t,e[11]=r),l=n.find(r),e[7]=t,e[8]=n,e[9]=l}else l=e[9];let u=l;if(u?.directory)return u.directory}if(o?.open&&(o.bootstrapPendingDirectory||o.directoryOverride))return(o.bootstrapPendingDirectory||o.directoryOverride)??void 0;if(s){let t;if(e[12]!==s||e[13]!==c){let n;e[15]===s?n=e[16]:(n=e=>e.id===s,e[15]=s,e[16]=n),t=c.find(n),e[12]=s,e[13]=c,e[14]=t}else t=e[14];let n=t;if(n?.path)return n.path}return l??void 0};function ze(e){return e.currentSessionId}function Be(e){return e.worktreeMetadata}function Ve(e){return e.newSessionDraft}function He(e){return e.activeProjectId}function Ue(e){return e.projects}function We(e){return e.currentDirectory}var Ge=`absolute z-[100] min-w-0 w-full bottom-full mb-2 left-0 flex flex-col rounded-xl`,Ke=`pointer-events-auto absolute z-[100] min-w-0 flex flex-col rounded-xl`;function qe(e,t){return F(e?Ke:Ge,e?`oc-mobile-overlay-surface oc-mobile-overlay-surface--translucent oc-composer-autocomplete-surface`:`bg-background border-2 border-border/60 shadow-none`,t)}function Je(e,t){return e?`oc-composer-autocomplete-row`:t?`bg-interactive-selection`:void 0}var Ye=.4,Xe=e=>{let t=e.gap??8,n=e.composerTop-t;return{left:e.composerLeft,width:e.composerWidth,bottom:Math.max(0,e.visibleBottom-n),maxHeight:Ze({popupBottom:n,boundaryTop:e.boundaryTop,viewportHeight:e.viewportHeight,gap:t})}},Ze=e=>{let t=e.gap??8,n=Math.max(0,e.popupBottom-e.boundaryTop-t),r=e.viewportHeight*Ye,i=Math.floor(Math.min(n,r));return n>=120?Math.min(n,Math.max(120,i)):i},Qe=(e,t=0)=>{let n=e.closest(`main`);if(!n)return null;let r=(e.closest(`.mobile-chat-screen__content`)?.parentElement??n.parentElement?.closest(`main`)??n).querySelector(`:scope > .oc-mobile-detail-navigation`)?.getBoundingClientRect().bottom,i=n.getBoundingClientRect().top;return Math.max(r===void 0?i:Math.max(r,i),t)},$e=(e,t)=>{let n=(0,H.c)(5),[r,i]=V.useState(void 0),a;n[0]!==t||n[1]!==e?(a=()=>{if(!t){i(void 0);return}let n=()=>{let t=e.current?.parentElement;if(!t)return;let n=t.getBoundingClientRect(),r=window.visualViewport,a=r?.offsetTop??0,o=r?.height??window.innerHeight,s=Qe(t,a)??a,c=Xe({composerTop:n.top,composerLeft:n.left,composerWidth:n.width,visibleBottom:a+o,boundaryTop:s,viewportHeight:o});i(e=>e&&e.left===c.left&&e.width===c.width&&e.bottom===c.bottom&&e.maxHeight===c.maxHeight?e:c)};return n(),window.addEventListener(`resize`,n),window.addEventListener(`oc:keyboard-settled`,n),window.visualViewport?.addEventListener(`resize`,n),window.visualViewport?.addEventListener(`scroll`,n),()=>{window.removeEventListener(`resize`,n),window.removeEventListener(`oc:keyboard-settled`,n),window.visualViewport?.removeEventListener(`resize`,n),window.visualViewport?.removeEventListener(`scroll`,n)}},n[0]=t,n[1]=e,n[2]=a):a=n[2];let o;return n[3]===t?o=n[4]:(o=[t],n[3]=t,n[4]=o),V.useLayoutEffect(a,o),t?r:void 0},et=e=>e?e.closest(`.oc-chat-composer-swap-scope`)??e.closest(`main`):null,tt=V.forwardRef((e,t)=>{let n=(0,H.c)(28),{isMobile:r,className:i,style:a,children:o}=e,s=V.useRef(null),[c,l]=V.useState(null),u=$e(s,r),d,f;if(n[0]===r?(d=n[1],f=n[2]):(d=()=>{if(!r){l(null);return}l(et(s.current?.parentElement??null))},f=[r],n[0]=r,n[1]=d,n[2]=f),V.useLayoutEffect(d,f),!r){let e;n[3]===i?e=n[4]:(e=qe(!1,i),n[3]=i,n[4]=e);let r;return n[5]!==o||n[6]!==t||n[7]!==a||n[8]!==e?(r=(0,U.jsx)(`div`,{ref:t,className:e,style:a,children:o}),n[5]=o,n[6]=t,n[7]=a,n[8]=e,n[9]=r):r=n[9],r}let p;n[10]===i?p=n[11]:(p=qe(!0,i),n[10]=i,n[11]=p);let m;n[12]===u?m=n[13]:(m=u?{left:u.left,width:u.width,bottom:u.bottom,maxHeight:u.maxHeight}:{visibility:`hidden`},n[12]=u,n[13]=m);let h;n[14]!==a||n[15]!==m?(h={...a,...m},n[14]=a,n[15]=m,n[16]=h):h=n[16];let g;n[17]!==o||n[18]!==t||n[19]!==p||n[20]!==h?(g=(0,U.jsx)(`div`,{className:`pointer-events-none fixed inset-0 z-[100]`,children:(0,U.jsx)(`div`,{ref:t,className:p,style:h,children:o})}),n[17]=o,n[18]=t,n[19]=p,n[20]=h,n[21]=g):g=n[21];let _=g,v;n[22]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,U.jsx)(`span`,{ref:s,className:`hidden`,"aria-hidden":!0}),n[22]=v):v=n[22];let y;n[23]!==_||n[24]!==c?(y=c?(0,W.createPortal)(_,c):_,n[23]=_,n[24]=c,n[25]=y):y=n[25];let b;return n[26]===y?b=n[27]:(b=(0,U.jsxs)(U.Fragment,{children:[v,y]}),n[26]=y,n[27]=b),b});tt.displayName=`ComposerAutocompleteLayer`;var nt=()=>{let e=null,t=!1,n=!1;return{pointerDown:(n,r)=>{e={x:n,y:r},t=!1},pointerMove:(n,r)=>{e&&Math.hypot(n-e.x,r-e.y)>6&&(t=!0)},pointerCancel:()=>{e=null,t=!1},pointerUp:r=>{if(!e)return!1;let i=!t;return e=null,t=!1,i?(n=!0,r(),!0):(n=!0,!1)},click:e=>n?(n=!1,!1):(e(),!0)}},rt=V.forwardRef(({searchQuery:e,onFileSelect:t,onAgentSelect:n,onSessionSelect:r,onClose:a,style:o,onRowsChange:c},u)=>{let{t:d}=ee(),f=Re()??``,p=A(e=>e.currentSessionId),m=O(e=>e.activeSessions),h=D(e=>e.activeProjectId),g=D(e=>e.projects),_=V.useMemo(()=>g.find(e=>e.id===h)?.path??null,[h,g]),v=V.useMemo(()=>{let e=_||f;return e?e.replace(/\\/g,`/`).replace(/\/+$/,``):null},[_,f]),y=Ie(e=>v?e.byRoot[v]:void 0),b=M(e=>e.getVisibleAgents),x=S(e=>e.searchFiles),C=Le(e,180),w=l(),te=s(),[ne,E]=V.useState([]),[k,j]=V.useState([]),[oe,se]=V.useState(!1),[P,L]=V.useState(0),R=V.useRef(0),[ue,de]=V.useState(360),[pe,z]=V.useState({}),[B,H]=V.useState({}),W=V.useRef([]),me=V.useRef([]),he=V.useRef([]),_e=V.useRef(null),ve=V.useRef(null),G=V.useRef(null);G.current||=nt();let K=i(e=>e.isMobile),ye=(e??``).trim(),be=V.useMemo(()=>{if(!v||!y)return[];let e=[y.selectedPath,...y.openPaths.slice().reverse()].filter(e=>typeof e==`string`&&e.length>0),t=new Set,n=[];for(let r of e){if(t.has(r))continue;t.add(r);let e=r.replace(/\\/g,`/`),i=e.split(`/`).filter(Boolean).pop()||e,a=e.startsWith(`${v}/`)?e.slice(v.length+1):e;n.push({name:i,path:e,relativePath:a,extension:i.includes(`.`)?i.split(`.`).pop()?.toLowerCase():void 0})}return N(n,ye,{limit:6})},[ye,v,y]),q=V.useMemo(()=>ye.length>0?k:k.slice(0,2),[k,ye.length]),J=V.useMemo(()=>r?ce({sessions:m,currentSessionId:p,searchQuery:ye}):[],[m,p,ye,r]),Y=be,X=ne;V.useEffect(()=>{let e=e=>{let t=e.target;!t||!_e.current||_e.current.contains(t)||a()};return document.addEventListener(`pointerdown`,e,!0),()=>{document.removeEventListener(`pointerdown`,e,!0)}},[a]),V.useEffect(()=>{if(!f){E([]);return}let e=(C??``).trim(),t=ie(e);if(!t){E([]);return}let n=!1;se(!0);let r={includeHidden:w,respectGitignore:!te};return Promise.all([x(f,t,80,{...r,type:`file`}),x(f,t,40,{...r,type:`directory`})]).then(([t,r])=>{if(n)return;let i=new Set(be.map(e=>e.path));E(re({files:t,directories:r,query:e,excludePaths:i,limit:20}))}).catch(()=>{n||E([])}).finally(()=>{n||se(!1)}),()=>{n=!0}},[f,C,be,x,w,te]),V.useEffect(()=>{let t=b().filter(e=>e.mode&&e.mode!==`primary`).map(e=>({name:e.name,description:e.description,mode:e.mode}));j(ae(t,e??``))},[b,e]),V.useEffect(()=>{L(0),z({}),H({})},[X,Y.length,q.length,J.length]),V.useEffect(()=>{R.current=P},[P]),V.useEffect(()=>{W.current[P]?.scrollIntoView({block:`nearest`})},[P]),V.useEffect(()=>{let e=null,t=()=>{e!==null&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{let e={},t={};me.current.forEach((n,r)=>{if(!n)return;let i=he.current[r]?.offsetWidth??n.scrollWidth,a=Math.max(0,i-n.clientWidth),o=a>8;if(e[r]=o,o){let e=Math.max(.6,a/110);t[r]=e}}),z(e),H(t)})};return t(),window.addEventListener(`resize`,t),()=>{e!==null&&cancelAnimationFrame(e),window.removeEventListener(`resize`,t)}},[X,Y]),V.useEffect(()=>{let e=me.current[P];if(!e)return;let t=()=>{let t=e.clientWidth;t>0&&de(t)};if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect()}},[P]);let Se=T(e=>{t(e)}),Ce=T(e=>{n?.(e)}),we=T(e=>{r?.(e)}),Te=(e,t)=>({onMouseDown:e=>e.preventDefault(),onPointerDown:e=>{e.pointerType===`touch`&&G.current?.pointerDown(e.clientX,e.clientY)},onPointerMove:e=>{e.pointerType===`touch`&&G.current?.pointerMove(e.clientX,e.clientY)},onPointerUp:e=>{e.pointerType===`touch`&&(G.current?.pointerUp(t)??!1)&&(e.preventDefault(),e.stopPropagation())},onPointerCancel:()=>G.current?.pointerCancel(),onClick:()=>{G.current?.click(t)},onMouseMove:()=>L(e)}),Ee=e=>{let t=q.length+J.length+Y.length+X.length;if(t===0)return;let n=(e%t+t)%t;if(n<q.length){let e=q[n];e&&Ce(e.name);return}let r=n-q.length;if(r<J.length){let e=J[r];e&&we(e);return}let i=r-J.length,a=i<Y.length?Y[i]:X[i-Y.length];a&&Se(a)};V.useEffect(()=>{ke(c,ve,{rows:xe({agents:q,sessions:J,recentFiles:Y,pathHits:X,untitledSession:d(`chat.fileMentionAutocomplete.untitledSession`),sessionBadge:d(`chat.fileMentionAutocomplete.sessionType`)}),highlightedIndex:P})},[c,P,d,q,X,Y,J]);let De=V.useRef(c);De.current=c,V.useEffect(()=>()=>{Ae(De.current,ve)},[]),V.useImperativeHandle(u,()=>({acceptIndex:e=>{Ee(e)},handleKeyDown:e=>{if(e===`Escape`){a();return}let t=q.length+J.length+Y.length+X.length;if(t!==0){if(e===`ArrowDown`){L(e=>(e+1)%t);return}if(e===`ArrowUp`){L(e=>(e-1+t)%t);return}(e===`Enter`||e===`Tab`)&&Ee(R.current)}}}),[X,Y,q,J,a,Se,Ce,we]);let Oe=e=>(0,U.jsx)(I,{name:ge(e),className:`h-3.5 w-3.5 text-current`});return(0,U.jsxs)(tt,{ref:_e,isMobile:K,className:`max-w-[640px] max-h-64`,style:o,children:[(0,U.jsx)(fe,{preventOverscroll:!0,outerClassName:`flex-1 min-h-0`,className:`px-0`,children:(0,U.jsxs)(`div`,{className:`pb-2`,children:[q.length>0&&(0,U.jsx)(`div`,{className:`px-3 pb-1 pt-2 typography-meta font-medium text-muted-foreground`,children:d(`chat.fileMentionAutocomplete.groups.agents`)}),q.map((e,t)=>{let n=P===t;return(0,U.jsx)(`div`,{ref:e=>{W.current[t]=e},className:F(`flex items-start gap-2 px-3 py-1.5 cursor-pointer typography-ui-label rounded-lg`,K&&`min-h-11`,Je(K,n),!K&&n&&`text-interactive-selection-foreground`),...Te(t,()=>Ce(e.name)),children:(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,U.jsxs)(`div`,{className:`font-semibold truncate`,children:[`@`,e.name]}),e.description&&!K?(0,U.jsx)(`div`,{className:`typography-meta text-muted-foreground truncate`,children:e.description}):null]})},`agent-${e.name}`)}),q.length===2&&ye.length===0&&k.length>2&&(0,U.jsx)(`div`,{className:`px-3 py-1 typography-meta text-muted-foreground`,children:d(`chat.fileMentionAutocomplete.searchMoreAgents`)}),J.length>0&&(0,U.jsx)(`div`,{className:`px-3 pb-1 pt-2 typography-meta font-medium text-muted-foreground`,children:d(`chat.fileMentionAutocomplete.groups.sessions`)}),J.map((e,t)=>{let n=q.length+t,r=P===n;return(0,U.jsxs)(`div`,{ref:e=>{W.current[n]=e},className:F(`flex items-center gap-2 px-3 py-1.5 cursor-pointer typography-ui-label rounded-lg`,K&&`min-h-11`,Je(K,r),!K&&r&&`text-interactive-selection-foreground`),...Te(n,()=>we(e)),children:[(0,U.jsx)(I,{name:`chat-thread`,className:`h-4 w-4 flex-shrink-0 text-[var(--primary-base)]`}),(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,title:e.title||d(`chat.fileMentionAutocomplete.untitledSession`),children:e.title||d(`chat.fileMentionAutocomplete.untitledSession`)}),K?null:(0,U.jsx)(`span`,{className:`flex-shrink-0 typography-meta text-muted-foreground`,children:d(`chat.fileMentionAutocomplete.sessionType`)})]},`session-${e.id}`)}),Y.length>0&&(0,U.jsx)(`div`,{className:`px-3 pb-1 pt-2 typography-meta font-medium text-muted-foreground`,children:d(`chat.fileMentionAutocomplete.groups.recentFiles`)}),Y.map((e,t)=>{let n=q.length+J.length+t,r=e.relativePath||e.name,i=le(r,{maxLength:60}),a=P===n,o=pe[n]??!1,s=B[n]??2.6;return(0,U.jsxs)(`div`,{ref:e=>{W.current[n]=e},className:F(`flex items-center gap-2 px-3 py-1.5 cursor-pointer typography-ui-label rounded-lg`,K&&`min-h-11`,Je(K,a),!K&&a&&`text-interactive-selection-foreground`),...Te(n,()=>Se(e)),children:[Oe(e),(0,U.jsxs)(`span`,{ref:e=>{me.current[n]=e},className:`relative flex-1 min-w-0 overflow-hidden file-mention-marquee-container`,style:a?{"--file-mention-marquee-width":`${ue}px`,"--file-mention-marquee-duration":`${s}s`}:void 0,"aria-label":r,children:[(0,U.jsx)(`span`,{ref:e=>{he.current[n]=e},className:`absolute invisible whitespace-nowrap pointer-events-none`,"aria-hidden":!0,children:r}),o&&a?(0,U.jsx)(`span`,{className:`inline-block whitespace-nowrap file-mention-marquee`,children:r}):(0,U.jsx)(`span`,{className:`block truncate`,children:i})]})]},`recent-${e.path}`)}),X.length>0&&(0,U.jsx)(`div`,{className:`px-3 pb-1 pt-2 typography-meta font-medium text-muted-foreground`,children:d(`chat.fileMentionAutocomplete.groups.files`)}),X.map((e,t)=>{let n=q.length+J.length+Y.length+t,r=e.relativePath||e.name,i=le(r,{maxLength:60}),a=P===n,o=pe[n]??!1,s=B[n]??2.6;return(0,U.jsxs)(`div`,{ref:e=>{W.current[n]=e},className:F(`flex items-center gap-2 px-3 py-1.5 cursor-pointer typography-ui-label rounded-lg`,K&&`min-h-11`,Je(K,a),!K&&a&&`text-interactive-selection-foreground`),...Te(n,()=>Se(e)),children:[Oe(e),(0,U.jsxs)(`span`,{ref:e=>{me.current[n]=e},className:`relative flex-1 min-w-0 overflow-hidden file-mention-marquee-container`,style:a?{"--file-mention-marquee-width":`${ue}px`,"--file-mention-marquee-duration":`${s}s`}:void 0,"aria-label":r,children:[(0,U.jsx)(`span`,{ref:e=>{he.current[n]=e},className:`absolute invisible whitespace-nowrap pointer-events-none`,"aria-hidden":!0,children:r}),o&&a?(0,U.jsx)(`span`,{className:`inline-block whitespace-nowrap file-mention-marquee`,children:r}):(0,U.jsx)(`span`,{className:`block truncate`,children:i})]})]},e.path)}),oe&&X.length===0?(0,U.jsx)(`div`,{className:`flex items-center justify-center py-3`,children:(0,U.jsx)(I,{name:`refresh`,className:`h-4 w-4 animate-spin text-muted-foreground`})}):null,!oe&&X.length===0&&Y.length===0&&q.length===0&&J.length===0&&(0,U.jsx)(`div`,{className:`px-3 py-2 typography-ui-label text-muted-foreground`,children:d(`chat.fileMentionAutocomplete.empty`)})]})}),!K&&(0,U.jsx)(`div`,{className:`px-3 pt-1 pb-1.5 border-t typography-meta text-muted-foreground`,children:d(`chat.autocomplete.keyboardHint`)})]})}),it=new Set([`new`,`fork`,`compact`,`undo`,`redo`,`model`,`goal`]),at=(e,t)=>{if(!t||e.isSkill)return!1;let n=e.name?.trim().toLowerCase();return!!(n&&it.has(n))},ot=(e,t)=>!e||t({name:e}),st=` `,ct=(e,t)=>{let n=Math.max(0,Math.min(t,e.length)),r=n;for(;r>0&&!/\s/.test(e[r-1]);)--r;return r>=2&&e[r-1]===st&&e[r-2]===`/`&&(r-=2),e[r]===`/`?{start:r,end:n}:null},lt=`text-[10px] leading-none uppercase font-bold tracking-tight px-1.5 py-1 rounded border flex-shrink-0`,ut=F(lt,`bg-[color-mix(in_srgb,var(--primary-base)_12%,transparent)] text-[color-mix(in_srgb,var(--primary-base)_70%,transparent)] border-[color-mix(in_srgb,var(--primary-base)_24%,transparent)]`),dt=F(lt,`bg-[color-mix(in_srgb,var(--status-success)_12%,transparent)] text-[color-mix(in_srgb,var(--status-success)_70%,transparent)] border-[color-mix(in_srgb,var(--status-success)_24%,transparent)]`),ft=F(lt,`bg-[color-mix(in_srgb,var(--status-info)_12%,transparent)] text-[color-mix(in_srgb,var(--status-info)_70%,transparent)] border-[color-mix(in_srgb,var(--status-info)_24%,transparent)]`),pt=F(lt,`bg-[var(--surface-muted)] text-muted-foreground border-[var(--interactive-border)]/60`),mt=(e,t)=>e.length===t.length&&e.every((e,n)=>e.id===t[n]?.id),ht=(e,t)=>{let n=!!e.sessionID;return{hasSession:n,canStartSessionCommand:n||e.hasNewDraft,canUseReviewHandoffFlow:n&&!t&&!o()}},gt=V.forwardRef(({searchQuery:e,onCommandSelect:t,onClose:n,directory:r,style:a,commandPolicy:o,commandContext:s,onRowsChange:c},l)=>{let{t:u}=ee(),d=i(e=>e.isMobile),f=A(e=>e.currentSessionId),p=A(e=>!!e.newSessionDraft?.open),m=A(V.useCallback(e=>f?e.getDirectoryForSession(f):void 0,[f])),h=ne(f??``,m??void 0),g=V.useMemo(()=>s??{sessionID:f??null,hasMessages:h.length>0,hasNewDraft:p},[s,f,h.length,p]),{hasSession:_,canStartSessionCommand:v,canUseReviewHandoffFlow:y}=V.useMemo(()=>ht(g,d),[g,d]),b=g.hasMessages,[x,S]=V.useState([]),[C,w]=V.useState(!1),T=P({directory:r}),te=V.useMemo(()=>T.data??[],[T.data]),E=T.isFetching,D=se({directory:r}),re=V.useMemo(()=>D.data??[],[D.data]),[O,ie]=V.useState(0),k=V.useRef(0),ae=V.useRef(!1),j=V.useRef([]),oe=V.useRef(null),ce=V.useRef(!1),M=V.useRef(null),N=V.useRef(!1),le=V.useRef(null);V.useEffect(()=>{let e=e=>{let t=e.target;!t||!oe.current||oe.current.contains(t)||n()};return document.addEventListener(`pointerdown`,e,!0),()=>{document.removeEventListener(`pointerdown`,e,!0)}},[n]),V.useEffect(()=>{(async()=>{w(E);try{let t=te.map((e,t)=>({id:`opencode:${e.scope??`global`}:${e.name}:${e.agent??``}:${e.model??``}:${t}`,name:e.name,source:`opencode`,description:e.description,agent:e.agent??void 0,model:e.model??void 0,isBuiltIn:e.isBuiltIn,isSkill:e.source===`skill`,scope:e.scope,reference:e.reference})),n=re.map((e,t)=>({id:`skill:${e.scope}:${e.source??`opencode`}:${e.name}:${t}`,name:e.name,source:`skill`,description:e.description,isSkill:!0,scope:e.scope})),r=[{id:`openchamber:new`,name:`new`,source:`openchamber`,description:u(`chat.commandAutocomplete.command.newDescription`),isBuiltIn:!0},..._&&!b?[{id:`openchamber:init`,name:`init`,source:`openchamber`,description:u(`chat.commandAutocomplete.command.initDescription`),isBuiltIn:!0}]:[],..._?[{id:`openchamber:undo`,name:`undo`,source:`openchamber`,description:u(`chat.commandAutocomplete.command.undoDescription`),isBuiltIn:!0},{id:`openchamber:redo`,name:`redo`,source:`openchamber`,description:u(`chat.commandAutocomplete.command.redoDescription`),isBuiltIn:!0},{id:`openchamber:fork`,name:`fork`,source:`openchamber`,description:u(`chat.commandAutocomplete.command.forkDescription`),isBuiltIn:!0},{id:`openchamber:timeline`,name:`timeline`,source:`openchamber`,description:u(`chat.commandAutocomplete.command.timelineDescription`),isBuiltIn:!0}]:[],{id:`openchamber:model`,name:`model`,source:`openchamber`,description:u(`chat.commandAutocomplete.command.modelDescription`),isBuiltIn:!0},{id:`openchamber:compact`,name:`compact`,source:`openchamber`,description:u(`chat.commandAutocomplete.command.compactDescription`),isBuiltIn:!0},..._?[{id:`openchamber:summary`,name:`summary`,source:`openchamber`,description:u(`chat.commandAutocomplete.command.summaryDescription`),isOpenChamber:!0}]:[],...v?[{id:`openchamber:workspace-review`,name:`workspace-review`,source:`openchamber`,description:u(`chat.commandAutocomplete.command.workspaceReviewDescription`),isOpenChamber:!0}]:[],...y?[{id:`openchamber:handoff-review`,name:`handoff-review`,source:`openchamber`,description:u(`chat.commandAutocomplete.command.handoffReviewDescription`),isOpenChamber:!0}]:[],...v?[{id:`openchamber:craft-goal`,name:`craft-goal`,source:`openchamber`,description:u(`chat.commandAutocomplete.command.craftGoalDescription`),isOpenChamber:!0}]:[],...v?[{id:`openchamber:goal`,name:`goal`,source:`openchamber`,description:u(`chat.goal.button.armAria`),isBuiltIn:!0}]:[],...v?[{id:`openchamber:catch-up`,name:`catch-up`,source:`openchamber`,description:u(`chat.commandAutocomplete.command.catchUpDescription`),isOpenChamber:!0}]:[],...v?[{id:`openchamber:debug`,name:`debug`,source:`openchamber`,description:u(`chat.commandAutocomplete.command.debugDescription`),isOpenChamber:!0}]:[],...v?[{id:`openchamber:weigh`,name:`weigh`,source:`openchamber`,description:u(`chat.commandAutocomplete.command.weighDescription`),isOpenChamber:!0}]:[],...v?[{id:`openchamber:explore`,name:`explore`,source:`openchamber`,description:u(`chat.commandAutocomplete.command.exploreDescription`),isOpenChamber:!0}]:[],...t,...n],i=!b,a=J(r.filter(e=>(i||e.name!==`init`)&&(o?.(e)??!0)),e);S(e=>mt(e,a)?e:a)}catch{let t=!b,n=J([{id:`openchamber:new`,name:`new`,source:`openchamber`,description:u(`chat.commandAutocomplete.command.newDescription`),isBuiltIn:!0},..._&&!b?[{id:`openchamber:init`,name:`init`,source:`openchamber`,description:u(`chat.commandAutocomplete.command.initDescription`),isBuiltIn:!0}]:[],..._?[{id:`openchamber:undo`,name:`undo`,source:`openchamber`,description:u(`chat.commandAutocomplete.command.undoDescription`),isBuiltIn:!0},{id:`openchamber:redo`,name:`redo`,source:`openchamber`,description:u(`chat.commandAutocomplete.command.redoDescription`),isBuiltIn:!0},{id:`openchamber:fork`,name:`fork`,source:`openchamber`,description:u(`chat.commandAutocomplete.command.forkDescription`),isBuiltIn:!0},{id:`openchamber:timeline`,name:`timeline`,source:`openchamber`,description:u(`chat.commandAutocomplete.command.timelineDescription`),isBuiltIn:!0}]:[],{id:`openchamber:model`,name:`model`,source:`openchamber`,description:u(`chat.commandAutocomplete.command.modelDescription`),isBuiltIn:!0},{id:`openchamber:compact`,name:`compact`,source:`openchamber`,description:u(`chat.commandAutocomplete.command.compactDescription`),isBuiltIn:!0},..._?[{id:`openchamber:summary`,name:`summary`,source:`openchamber`,description:u(`chat.commandAutocomplete.command.summaryDescription`),isOpenChamber:!0}]:[],...v?[{id:`openchamber:workspace-review`,name:`workspace-review`,source:`openchamber`,description:u(`chat.commandAutocomplete.command.workspaceReviewDescription`),isOpenChamber:!0}]:[],...y?[{id:`openchamber:handoff-review`,name:`handoff-review`,source:`openchamber`,description:u(`chat.commandAutocomplete.command.handoffReviewDescription`),isOpenChamber:!0}]:[],...v?[{id:`openchamber:craft-goal`,name:`craft-goal`,source:`openchamber`,description:u(`chat.commandAutocomplete.command.craftGoalDescription`),isOpenChamber:!0}]:[],...v?[{id:`openchamber:goal`,name:`goal`,source:`openchamber`,description:u(`chat.goal.button.armAria`),isBuiltIn:!0}]:[],...v?[{id:`openchamber:catch-up`,name:`catch-up`,source:`openchamber`,description:u(`chat.commandAutocomplete.command.catchUpDescription`),isOpenChamber:!0}]:[],...v?[{id:`openchamber:debug`,name:`debug`,source:`openchamber`,description:u(`chat.commandAutocomplete.command.debugDescription`),isOpenChamber:!0}]:[],...v?[{id:`openchamber:weigh`,name:`weigh`,source:`openchamber`,description:u(`chat.commandAutocomplete.command.weighDescription`),isOpenChamber:!0}]:[],...v?[{id:`openchamber:explore`,name:`explore`,source:`openchamber`,description:u(`chat.commandAutocomplete.command.exploreDescription`),isOpenChamber:!0}]:[]].filter(e=>(t||e.name!==`init`)&&(o?.(e)??!0)),e);S(e=>mt(e,n)?e:n)}finally{w(!1)}})()},[e,b,_,v,y,te,E,re,u,o]),V.useEffect(()=>{ie(0)},[x]),V.useEffect(()=>{k.current=O},[O]),V.useEffect(()=>{j.current[O]?.scrollIntoView({block:`nearest`})},[O]),V.useEffect(()=>{ke(c,le,{rows:be(x,{skill:u(`chat.commandAutocomplete.badge.skill`),command:u(`chat.commandAutocomplete.badge.command`),system:u(`chat.commandAutocomplete.badge.system`)}),highlightedIndex:O})},[x,c,O,u]);let L=V.useRef(c);L.current=c,V.useEffect(()=>()=>{Ae(L.current,le)},[]),V.useImperativeHandle(l,()=>({acceptIndex:(e,n=!0)=>{let r=x[e];r&&t(r,at(r,n))},handleKeyDown:e=>{let r=x.length;if(e===`Escape`){n();return}if(r!==0){if(e===`ArrowDown`){ae.current=!0,ie(e=>(e+1)%r);return}if(e===`ArrowUp`){ae.current=!0,ie(e=>(e-1+r)%r);return}if(e===`Enter`||e===`Tab`){let n=(k.current%r+r)%r,i=x[n];i&&t(i,at(i,e===`Enter`))}}}}),[x,n,t]);let R=e=>{let t=me(e);switch(e.name){case`new`:return(0,U.jsx)(I,{name:t,className:`h-3.5 w-3.5`});case`init`:return(0,U.jsx)(I,{name:t,className:`h-3.5 w-3.5 text-green-500`});case`undo`:return(0,U.jsx)(I,{name:t,className:`h-3.5 w-3.5 text-orange-500`});case`redo`:return(0,U.jsx)(I,{name:t,className:`h-3.5 w-3.5 text-orange-500`});case`timeline`:return(0,U.jsx)(I,{name:t,className:`h-3.5 w-3.5`});case`compact`:return(0,U.jsx)(I,{name:t,className:`h-3.5 w-3.5 text-purple-500`});case`goal`:return(0,U.jsx)(I,{name:t,className:`h-3.5 w-3.5`});case`review`:return(0,U.jsx)(I,{name:t,className:`h-3.5 w-3.5 text-blue-500`});case`test`:case`build`:case`run`:return(0,U.jsx)(I,{name:t,className:`h-3.5 w-3.5 text-cyan-500`});default:return e.isBuiltIn?(0,U.jsx)(I,{name:t,className:`h-3.5 w-3.5 text-yellow-500`}):(0,U.jsx)(I,{name:t,className:`h-3.5 w-3.5 text-muted-foreground`})}};return(0,U.jsxs)(tt,{ref:oe,isMobile:d,className:`max-w-[450px] max-h-64`,style:a,children:[(0,U.jsx)(fe,{preventOverscroll:!0,outerClassName:`flex-1 min-h-0`,className:`px-0 pb-2`,children:C?(0,U.jsx)(`div`,{className:`flex items-center justify-center py-4`,children:(0,U.jsx)(I,{name:`refresh`,className:`h-4 w-4 animate-spin text-muted-foreground`})}):(0,U.jsxs)(`div`,{children:[x.map((e,n)=>{let r=e.isBuiltIn,i=e.isOpenChamber;return(0,U.jsxs)(`div`,{ref:e=>{j.current[n]=e},className:F(`flex gap-2 px-3 py-2 cursor-pointer rounded-lg`,d?`items-center`:`items-start`,Je(d,n===O)),onMouseDown:e=>e.preventDefault(),onPointerDown:e=>{e.pointerType===`touch`&&(M.current={x:e.clientX,y:e.clientY},N.current=!1)},onPointerMove:e=>{if(e.pointerType!==`touch`||!M.current)return;let t=e.clientX-M.current.x,n=e.clientY-M.current.y;Math.hypot(t,n)>6&&(N.current=!0)},onPointerUp:n=>{if(n.pointerType!==`touch`)return;let r=N.current;M.current=null,N.current=!1,!r&&(n.preventDefault(),n.stopPropagation(),ce.current=!0,t(e,at(e,d)))},onPointerCancel:()=>{M.current=null,N.current=!1},onClick:()=>{if(ce.current){ce.current=!1;return}t(e,at(e,d))},onMouseMove:()=>{ae.current=!1,ie(n)},children:[(0,U.jsx)(`div`,{className:F(!d&&`mt-0.5`),children:R(e)}),(0,U.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsxs)(`span`,{className:`typography-ui-label font-medium`,children:[`/`,e.name]}),e.isSkill?(0,U.jsx)(`span`,{className:ut,children:u(`chat.commandAutocomplete.badge.skill`)}):(0,U.jsx)(`span`,{className:ut,children:u(`chat.commandAutocomplete.badge.command`)}),i?(0,U.jsx)(`span`,{className:pt,children:`OpenChamber`}):r?(0,U.jsx)(`span`,{className:pt,children:u(`chat.commandAutocomplete.badge.system`)}):e.scope?(0,U.jsx)(`span`,{className:e.scope===`project`?ft:dt,children:e.scope}):null,e.agent&&(0,U.jsx)(`span`,{className:pt,children:e.agent})]}),e.description&&!d&&(0,U.jsx)(`div`,{className:`typography-meta text-muted-foreground mt-0.5 truncate`,children:e.description})]})]},e.id)}),x.length===0&&(0,U.jsx)(`div`,{className:`px-3 py-2 typography-ui-label text-muted-foreground`,children:u(`chat.commandAutocomplete.empty`)})]})}),!d&&(0,U.jsx)(`div`,{className:`px-3 pt-1 pb-1.5 border-t typography-meta text-muted-foreground`,children:u(`chat.autocomplete.keyboardHint`)})]})});gt.displayName=`CommandAutocomplete`;function _t(e){return(e.description||e.content).replace(/\s+/g,` `).trim().slice(0,120)}var vt=V.forwardRef((e,t)=>{let n=(0,H.c)(62),{searchQuery:r,onSnippetSelect:a,onClose:o,style:s}=e,{t:c}=ee(),l=V.useRef(null),u=i(yt),[d,f]=V.useState(0),p=V.useRef(0),m;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(m=[],n[0]=m):m=n[0];let[h,g]=V.useState(m),_;n[1]===Symbol.for(`react.memo_cache_sentinel`)?(_=[],n[1]=_):_=n[1];let v=V.useRef(_),y=pe(bt),b=pe(xt),x=pe(St),S=pe(Ct),C=i(wt),w=i(Tt),T,te;n[2]===b?(T=n[3],te=n[4]):(T=()=>{b()},te=[b],n[2]=b,n[3]=T,n[4]=te),V.useEffect(T,te);let ne,E;n[5]!==r||n[6]!==y?(ne=()=>{let e=r.trim();if(!e.length){let e=[...y].sort(Et);g(e),f(+!!e.length);return}let t=oe(y,e,Dt);t.sort(Ot);let n=t.map(kt);g(n),f(+!!n.length)},E=[r,y],n[5]=r,n[6]=y,n[7]=ne,n[8]=E):(ne=n[7],E=n[8]),V.useEffect(ne,E);let D,re;n[9]===d?(D=n[10],re=n[11]):(D=()=>{p.current=d,v.current[d]?.scrollIntoView({block:`nearest`})},re=[d],n[9]=d,n[10]=D,n[11]=re),V.useEffect(D,re);let O,ie;n[12]===o?(O=n[13],ie=n[14]):(ie=()=>{let e=e=>{let t=e.target;t&&l.current&&!l.current.contains(t)&&o()};return document.addEventListener(`pointerdown`,e,!0),()=>document.removeEventListener(`pointerdown`,e,!0)},O=[o],n[12]=o,n[13]=O,n[14]=ie),V.useEffect(ie,O);let k;n[15]!==a||n[16]!==r?(k=e=>{let t=r.trim(),n=e.aliases.includes(t)?t:e.name;a(e,n)},n[15]=a,n[16]=r,n[17]=k):k=n[17];let A=k,ae;n[18]!==o||n[19]!==S||n[20]!==C||n[21]!==w||n[22]!==x||n[23]!==y?(ae=()=>{let e=new Set(y.map(At)),t=`new-snippet`,n=1;for(;e.has(t);)t=`new-snippet-${n++}`;x({name:t,scope:`global`}),S(t),w(`snippets`),C(!0),o()},n[18]=o,n[19]=S,n[20]=C,n[21]=w,n[22]=x,n[23]=y,n[24]=ae):ae=n[24];let j=ae,se,ce;n[25]!==A||n[26]!==h||n[27]!==o||n[28]!==j?(se=()=>({handleKeyDown:e=>{if(e===`Escape`){o();return}let t=h.length+1;if(e===`ArrowDown`){f(e=>(e+1)%t);return}if(e===`ArrowUp`){f(e=>(e-1+t)%t);return}if(e===`Enter`||e===`Tab`){if(p.current===0){j();return}let e=h[p.current-1];e&&A(e)}}}),ce=[A,h,o,j],n[25]=A,n[26]=h,n[27]=o,n[28]=j,n[29]=se,n[30]=ce):(se=n[29],ce=n[30]),V.useImperativeHandle(t,se,ce);let M;n[31]===Symbol.for(`react.memo_cache_sentinel`)?(M=e=>{v.current[0]=e},n[31]=M):M=n[31];let N;n[32]!==u||n[33]!==d?(N=F(`flex items-center gap-2 px-3 py-1.5 cursor-pointer rounded-lg typography-ui-label`,Je(u,d===0)),n[32]=u,n[33]=d,n[34]=N):N=n[34];let P,le;n[35]===Symbol.for(`react.memo_cache_sentinel`)?(P=()=>f(0),le=(0,U.jsx)(I,{name:`add`,className:`h-3.5 w-3.5 text-muted-foreground`}),n[35]=P,n[36]=le):(P=n[35],le=n[36]);let L;n[37]===c?L=n[38]:(L=c(`chat.snippetAutocomplete.action.addNew`),n[37]=c,n[38]=L);let R;n[39]===L?R=n[40]:(R=(0,U.jsx)(`span`,{className:`font-medium text-foreground`,children:L}),n[39]=L,n[40]=R);let ue;n[41]!==j||n[42]!==N||n[43]!==R?(ue=(0,U.jsxs)(`div`,{ref:M,className:N,onClick:j,onMouseMove:P,children:[le,R]}),n[41]=j,n[42]=N,n[43]=R,n[44]=ue):ue=n[44];let de;n[45]!==A||n[46]!==h||n[47]!==u||n[48]!==d||n[49]!==c?(de=h.length?h.map((e,t)=>(0,U.jsx)(`div`,{ref:e=>{v.current[t+1]=e},className:F(`flex gap-2 px-3 py-1.5 cursor-pointer rounded-lg typography-ui-label`,u?`items-center`:`items-start`,Je(u,t+1===d)),onClick:()=>A(e),onMouseMove:()=>f(t+1),children:(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsxs)(`span`,{className:`font-semibold truncate`,children:[`#`,e.name]}),(0,U.jsx)(`span`,{className:`text-[10px] leading-none uppercase font-bold tracking-tight px-1.5 py-1 rounded border flex-shrink-0 bg-[var(--surface-muted)] text-muted-foreground border-[var(--interactive-border)]/60`,children:c(`snippets.source.${e.source}`)})]}),!u&&(0,U.jsx)(`div`,{className:`typography-meta text-muted-foreground mt-0.5 truncate`,children:_t(e)})]})},`${e.source}:${e.filePath}`)):(0,U.jsx)(`div`,{className:`px-3 py-2 typography-ui-label text-muted-foreground`,children:c(`chat.snippetAutocomplete.empty`)}),n[45]=A,n[46]=h,n[47]=u,n[48]=d,n[49]=c,n[50]=de):de=n[50];let z;n[51]!==ue||n[52]!==de?(z=(0,U.jsxs)(fe,{preventOverscroll:!0,outerClassName:`flex-1 min-h-0`,className:`px-0 pb-2`,children:[ue,de]}),n[51]=ue,n[52]=de,n[53]=z):z=n[53];let B;n[54]!==u||n[55]!==c?(B=!u&&(0,U.jsx)(`div`,{className:`px-3 pt-1 pb-1.5 border-t typography-meta text-muted-foreground`,children:c(`chat.snippetAutocomplete.footer`)}),n[54]=u,n[55]=c,n[56]=B):B=n[56];let W;return n[57]!==u||n[58]!==s||n[59]!==z||n[60]!==B?(W=(0,U.jsxs)(tt,{ref:l,isMobile:u,className:`max-w-[450px] max-h-60`,style:s,children:[z,B]}),n[57]=u,n[58]=s,n[59]=z,n[60]=B,n[61]=W):W=n[61],W});vt.displayName=`SnippetAutocomplete`;function yt(e){return e.isMobile}function bt(e){return e.snippets}function xt(e){return e.loadSnippets}function St(e){return e.setSnippetDraft}function Ct(e){return e.setSelectedSnippet}function wt(e){return e.setSettingsDialogOpen}function Tt(e){return e.setSettingsPage}function Et(e,t){return e.source===`project`&&t.source!==`project`?-1:e.source!==`project`&&t.source===`project`?1:e.name.localeCompare(t.name)}function Dt(e){return[e.name,...e.aliases]}function Ot(e,t){return e.score===t.score?e.item.source===`project`&&t.item.source!==`project`?-1:e.item.source!==`project`&&t.item.source===`project`?1:e.item.name.localeCompare(t.item.name):e.score-t.score}function kt(e){return e.item}function At(e){return e.name}var jt=2,Mt=e=>!!e&&typeof e==`object`&&!Array.isArray(e),Nt=e=>{let t=e?.trim().replace(/\\/g,`/`);return t?t.length>1?t.replace(/\/+$/,``):t:null},Pt=e=>Mt(e)&&Array.isArray(e.all)&&e.all.every(e=>typeof e==`string`)&&typeof e.current==`string`&&Mt(e.branches),Ft=(e,t)=>JSON.stringify([e,t]),It=e=>`version`in e&&e.version===jt&&Mt(e.entries),Lt=e=>{if(!e)return null;try{let t=JSON.parse(e);return Mt(t)?t.version===jt&&Mt(t.entries)?{version:jt,entries:t.entries}:t:null}catch{return null}},Rt=(e,t)=>{try{e.setItem(`oc.gitBranchCache`,JSON.stringify(t))}catch{}},zt=(e,t,n)=>{let r=Nt(e);if(!r||!t)return null;let i;try{i=n.getItem(`oc.gitBranchCache`)}catch{return null}let a=Lt(i);if(!a)return null;if(It(a))return Pt(a.entries[Ft(t,r)])?a.entries[Ft(t,r)]:null;let o={};for(let[e,n]of Object.entries(a)){let r=Nt(e);r&&Pt(n)&&(o[Ft(t,r)]=n)}return Rt(n,{version:jt,entries:o}),o[Ft(t,r)]??null},Bt=(e,t,n,r)=>{let i=Nt(e);if(!i||!t||!Pt(n))return;let a=null;try{a=r.getItem(`oc.gitBranchCache`)}catch{return}let o=Lt(a);Rt(r,{version:jt,entries:{...o&&It(o)?o.entries:{},[Ft(t,i)]:n}})},Vt=3e4,Ht=Nt,Ut=(e,t=n())=>c.git.branches(Ht(e),t),Wt=(e,t=n())=>c.git.remotes(Ht(e),t),Gt=async(e,t,n)=>{n.throwIfAborted();let r=f()?.git,i=t?.getGitBranches?await t.getGitBranches(e,{signal:n}):r?await r.getGitBranches(e,{signal:n}):await x(e,{signal:n});return n.throwIfAborted(),i},Kt=async(e,t,n)=>{n.throwIfAborted();let r=f()?.git,i=t?.getRemotes?await t.getRemotes(e,{signal:n}):r?await r.getRemotes(e,{signal:n}):await y(e,{signal:n});return n.throwIfAborted(),i},qt=(e,t,i=n(),a=r())=>{let o=Ht(e),s=t;return{queryKey:Ut(o,i),queryFn:async({signal:e})=>{if(!o)throw Error(`Git branches require a directory`);let t=await Gt(o,s,e);return Bt(o,i,t,a),t},staleTime:Vt,gcTime:1/0,initialData:()=>zt(o,i,a)??void 0,initialDataUpdatedAt:0}},Jt=(e,t,r=n())=>{let i=Ht(e),a=t;return{queryKey:Wt(i,r),queryFn:({signal:e})=>{if(!i)throw Error(`Git remotes require a directory`);return Kt(i,a,e)},staleTime:Vt,gcTime:1/0}},Yt=(e,r,i)=>{let a=(0,H.c)(9),o=i===void 0||i,s=V.useSyncExternalStore(t,n,n),c,l,u;a[0]!==e||a[1]!==r||a[2]!==s?(c=Ht(e),u=w,l=qt(c,r,s),a[0]=e,a[1]=r,a[2]=s,a[3]=c,a[4]=l,a[5]=u):(c=a[3],l=a[4],u=a[5]);let d=o&&!!c,f;return a[6]!==l||a[7]!==d?(f={...l,enabled:d},a[6]=l,a[7]=d,a[8]=f):f=a[8],u(f)},Xt=(e,r,i)=>{let a=(0,H.c)(9),o=i===void 0||i,s=V.useSyncExternalStore(t,n,n),c,l,u;a[0]!==e||a[1]!==r||a[2]!==s?(c=Ht(e),u=w,l=Jt(c,r,s),a[0]=e,a[1]=r,a[2]=s,a[3]=c,a[4]=l,a[5]=u):(c=a[3],l=a[4],u=a[5]);let d=o&&!!c,f;return a[6]!==l||a[7]!==d?(f={...l,enabled:d},a[6]=l,a[7]=d,a[8]=f):f=a[8],u(f)},Zt=(e,t,r=d,i=n())=>r.fetchQuery(qt(e,t,i)),Qt=(e,t,r=d,i=n())=>r.fetchQuery({...qt(e,t,i),staleTime:0}),$t=e=>e instanceof Error?e.name===`AbortError`||e.name===`CancelledError`||e.name===`Error`&&e.message===`CancelledError`:!1,en=1e4,tn=6e4,nn=5e3,rn=3e4,an=6e4,on=25,sn=40,cn=2,ln=15e3,un=500,dn=30,fn=20971520,pn=new Map,mn=new Map,hn=new Map,gn=new Map,_n=new Map,vn=(e,t)=>`${t}:${e}`,yn=e=>mn.get(e)??0,bn=e=>{let t=yn(e)+1;return mn.set(e,t),t},xn=e=>{let t=(hn.get(e)??0)+1;return hn.set(e,t),t},Sn=e=>{let t=pn.get(e);if(t)return t;let n=new Set;return pn.set(e,n),n},Q=()=>({isGitRepo:null,status:null,branches:null,branchesTransportIdentity:null,log:null,identity:null,diffCache:new Map,indexRevision:0,lastRepoCheckAt:0,lastStatusFetch:0,lastStatusChange:0,lastLogFetch:0,lastBranchesFetch:0,lastIdentityFetch:0,logMaxCount:25,isLoadingStatus:!1,isLoadingLog:!1,isLoadingBranches:!1,isLoadingIdentity:!1}),Cn=(e,t=dn,n=fn)=>{let r=0;for(let t of e.values())r+=(t.original?.length??0)+(t.modified?.length??0);if(e.size<=t&&r<=n)return e;let i=Array.from(e.entries()).sort((e,t)=>e[1].fetchedAt-t[1].fetchedAt),a=new Map,o=0;for(let e=i.length-1;e>=0;e--){let[r,s]=i[e],c=(s.original?.length??0)+(s.modified?.length??0);if(a.size>=t)break;o+c>n&&a.size>0||(a.set(r,s),o+=c)}return a},wn=(e,t)=>{if(!e&&!t)return!1;if(!e||!t)return!0;let n=new Set([...Object.keys(e),...Object.keys(t)]);for(let r of n){let n=e[r],i=t[r];if(!(!n&&!i)&&(!n||!i||n.insertions!==i.insertions||n.deletions!==i.deletions))return!0}return!1},Tn=(e,t)=>!e&&!t?!1:!e||!t||e.remote!==t.remote||e.branch!==t.branch||e.ahead!==t.ahead||e.behind!==t.behind,En=(e,t)=>{if(!e&&!t)return!1;if(!e||!t)return!0;let n=e.files??[],r=t.files??[];if(n.length!==r.length||e.ahead!==t.ahead||e.behind!==t.behind||e.current!==t.current||e.tracking!==t.tracking||e.isClean!==t.isClean||t.upstreamComparison!==void 0&&Tn(e.upstreamComparison,t.upstreamComparison))return!0;let i=new Set(n.map(e=>`${e.path}:${e.index}:${e.working_dir}`));for(let e of r)if(!i.has(`${e.path}:${e.index}:${e.working_dir}`))return!0;return!!(t.diffStats!==void 0&&wn(e.diffStats,t.diffStats))},Dn=(e,t)=>{let n=new Set;if(!t)return n;let r=e?.files??[],i=t.files??[],a=new Map(r.map(e=>[e.path,e])),o=new Map(i.map(e=>[e.path,e])),s=new Set([...a.keys(),...o.keys()]);for(let e of s){let t=a.get(e),r=o.get(e);if(!t||!r){n.add(e);continue}if(t.index!==r.index||t.working_dir!==r.working_dir){n.add(e);continue}}if(t.diffStats!==void 0){let r=e?.diffStats??{},i=t.diffStats??{},a=new Set([...Object.keys(r),...Object.keys(i)]);for(let e of a){let t=r[e],a=i[e];if(!t||!a){n.add(e);continue}(t.insertions!==a.insertions||t.deletions!==a.deletions)&&n.add(e)}}return n},On=(e,t)=>{if(!e&&!t)return!1;if(!e||!t)return!0;let n=e.files??[],r=t.files??[],i=e=>{let t=e?.trim()??``;return t===`?`?``:t},a=new Map(n.map(e=>[e.path,i(e.index)])),o=new Map(r.map(e=>[e.path,i(e.index)])),s=new Set([...a.keys(),...o.keys()]);for(let e of s)if((a.get(e)??``)!==(o.get(e)??``))return!0;return!1},kn=e=>!e||e.trim().length===0,An=e=>(e||``).trim()===`U`,jn=e=>{let t=(e.index||``).trim(),n=(e.working_dir||``).trim();if(An(t)||An(n))return e;let r=t===`?`||n===`?`?`A`:t||n||` `;return{...e,index:r,working_dir:` `}},Mn=e=>{let t=(e.index||``).trim(),n=(e.working_dir||``).trim();if(An(t)||An(n))return e;let r=n||(t===`A`||t===`?`?`?`:t)||` `;return{...e,index:` `,working_dir:r}},Nn=e=>kn(e.index)&&kn(e.working_dir),$=p()(h((e,t)=>({directories:new Map,activeDirectory:null,setActiveDirectory:n=>{let{activeDirectory:r,directories:i}=t();if(r!==n)if(r&&bn(r),n&&bn(n),n&&!i.has(n)){let t=new Map(i);t.set(n,Q()),e({activeDirectory:n,directories:t})}else e({activeDirectory:n})},getDirectoryState:e=>t().directories.get(e)??null,fetchStatus:async(n,r,i={})=>{let a=i.mode??`full`,o=vn(n,a),s=gn.get(o)??(a===`light`?gn.get(vn(n,`full`)):void 0);if(s)return s;let c=(async()=>{let{silent:a=!1}=i,{directories:o}=t(),s=o.get(n);if(s||=Q(),!a){let r=new Map(t().directories),i=r.get(n)??Q();r.set(n,{...i,isLoadingStatus:!0}),e({directories:r})}let c=!1;try{let a=Date.now(),o=s.isGitRepo!==!0||a-(s.lastRepoCheckAt||0)>tn,l=s.isGitRepo===!0;if(o&&(l=await r.checkIsGitRepository(n)),!l){let r=new Map(t().directories),i=r.get(n)??s;return r.set(n,{...i,isGitRepo:!1,status:null,isLoadingStatus:!1,lastRepoCheckAt:a,lastStatusFetch:a}),e({directories:r}),!1}let u=await r.getGitStatus(n,i.mode?{mode:i.mode}:void 0);if(En(s.status,u)){c=!0;let r=new Map(t().directories),i=r.get(n)??Q(),s=Dn(i.status,u),l=On(i.status,u),d=new Set((i.status?.files??[]).map(e=>e.path)),f=new Set((u.files??[]).map(e=>e.path)),p=new Map(i.diffCache);for(let e of d)f.has(e)||p.delete(e);for(let e of s)p.delete(e);let m=s.size>0;m&&bn(n);let h={...u,diffStats:u.diffStats===void 0&&i.status?.diffStats!==void 0?i.status.diffStats:u.diffStats,upstreamComparison:u.upstreamComparison===void 0?i.status?.upstreamComparison:u.upstreamComparison};r.set(n,{...i,isGitRepo:!0,status:h,diffCache:p,indexRevision:l?i.indexRevision+1:i.indexRevision,lastRepoCheckAt:o?a:i.lastRepoCheckAt,lastStatusFetch:Date.now(),lastStatusChange:m?Date.now():i.lastStatusChange}),e({directories:r})}else{let r=new Map(t().directories),i=r.get(n)??Q();r.set(n,{...i,isGitRepo:!0,lastRepoCheckAt:o?a:i.lastRepoCheckAt,lastStatusFetch:Date.now(),lastStatusChange:i.lastStatusChange}),e({directories:r})}}catch(e){console.error(`Failed to fetch git status:`,e)}finally{if(!a){let r=new Map(t().directories),i=r.get(n)??Q();r.set(n,{...i,isLoadingStatus:!1}),e({directories:r})}}return c})();gn.set(o,c);try{return await c}finally{gn.get(o)===c&&gn.delete(o)}},moveStatusPathsOptimistically:(n,r,i)=>{let a=new Set(r.map(e=>e.trim()).filter(Boolean));if(a.size===0)return null;let{directories:o}=t(),s=o.get(n),c=s?.status??null;if(!s||!c)return c;let l=!1,u=[];for(let e of c.files){if(!a.has(e.path)){u.push(e);continue}let t=i===`stage`?jn(e):Mn(e);t!==e&&(l=!0),Nn(t)?l=!0:u.push(t)}if(!l)return c;let d=new Map(o);return d.set(n,{...s,status:{...c,files:u,isClean:u.length===0},indexRevision:s.indexRevision+1,lastStatusChange:Date.now()}),e({directories:d}),c},restoreStatus:(n,r)=>{let{directories:i}=t(),a=i.get(n);if(!a)return;let o=new Map(i);o.set(n,{...a,status:r,indexRevision:a.indexRevision+1,lastStatusChange:Date.now()}),e({directories:o})},bumpIndexRevision:n=>{let{directories:r}=t(),i=r.get(n);if(!i)return;let a=new Map(r);a.set(n,{...i,indexRevision:i.indexRevision+1}),e({directories:a})},fetchBranches:async(r,i,a={})=>{let o=n(),s=xn(r);{let n=new Map(t().directories),i=n.get(r)??Q();n.set(r,{...i,isLoadingBranches:!0}),e({directories:n})}try{let c=a.force?await Qt(r,i,void 0,o):await Zt(r,i,void 0,o);if(s!==hn.get(r)||o!==n())return;let l=new Map(t().directories),u=l.get(r)??Q();l.set(r,{...u,branches:c,branchesTransportIdentity:o,isLoadingBranches:!1,lastBranchesFetch:Date.now()}),e({directories:l})}catch(i){if($t(i)||console.error(`Failed to fetch git branches:`,i),s!==hn.get(r)||o!==n())return;let a=new Map(t().directories),c=a.get(r)??Q();a.set(r,{...c,isLoadingBranches:!1}),e({directories:a})}},fetchLog:async(n,r,i)=>{let{directories:a}=t(),o=a.get(n),s=i??o?.logMaxCount??25;{let r=new Map(t().directories),i=r.get(n)??Q();r.set(n,{...i,isLoadingLog:!0}),e({directories:r})}try{let i=await r.getGitLog(n,{maxCount:s}),a=new Map(t().directories),o=a.get(n)??Q();a.set(n,{...o,log:i,isLoadingLog:!1,lastLogFetch:Date.now(),logMaxCount:s}),e({directories:a})}catch(r){console.error(`Failed to fetch git log:`,r);let i=new Map(t().directories),a=i.get(n)??Q();i.set(n,{...a,isLoadingLog:!1}),e({directories:i})}},fetchIdentity:async(n,r)=>{{let r=new Map(t().directories),i=r.get(n)??Q();r.set(n,{...i,isLoadingIdentity:!0}),e({directories:r})}try{let i=await r.getCurrentGitIdentity(n),a=new Map(t().directories),o=a.get(n)??Q();a.set(n,{...o,identity:i,isLoadingIdentity:!1,lastIdentityFetch:Date.now()}),e({directories:a})}catch(r){console.error(`Failed to fetch git identity:`,r);let i=new Map(t().directories),a=i.get(n)??Q();i.set(n,{...a,isLoadingIdentity:!1}),e({directories:i})}},fetchAll:async(n,r,i={})=>{let{directories:a}=t(),o=a.get(n);if(!o){o=Q();let t=new Map(a);t.set(n,o),e({directories:t})}let{force:s=!1,silentIfCached:c=!1}=i,l=Date.now();await t().fetchStatus(n,r,{silent:c&&!!o?.status});let u=t().directories.get(n);if(!u?.isGitRepo)return;await t().fetchBranches(n,r,{force:s});let d=l-(u.lastLogFetch||0);(s||d>en||!u.log)&&await t().fetchLog(n,r),await t().fetchIdentity(n,r)},getDiff:(e,n)=>t().directories.get(e)?.diffCache.get(n)??null,setDiff:(n,r,i)=>{let a=new Map(t().directories),o=a.get(n)??Q(),s=new Map(o.diffCache);s.set(r,{...i,fetchedAt:Date.now()});let c=Cn(s);a.set(n,{...o,diffCache:c}),e({directories:a})},clearDiffCache:n=>{bn(n);let r=new Map(t().directories),i=r.get(n);i&&(r.set(n,{...i,diffCache:new Map}),e({directories:r}))},fetchAllDiffs:async(e,n)=>{let r=t().directories.get(e);if(!r?.status?.files||r.status.files.length===0)return;let i=r.status.files.map(e=>e.path).slice(0,on);await t().prefetchDiffs(e,n,i,{maxFiles:on})},prefetchDiffs:async(n,r,i,a={})=>{let o=t().directories.get(n);if(!o?.status?.files||o.status.files.length===0||i.length===0)return;let{maxFiles:s=sn}=a,c=new Set(o.status.files.map(e=>e.path)),l=o.status.diffStats,u=Sn(n),d=[],f=new Set;for(let e of i){if(!e||f.has(e)||(f.add(e),!c.has(e))||o.diffCache.has(e)||u.has(e))continue;let t=l?.[e];t&&t.insertions+t.deletions>un||d.push(e)}let p=d.slice(0,Math.max(1,s));if(p.length===0)return;let m=yn(n);if(typeof document<`u`&&document.hidden)return;p.forEach(e=>u.add(e));let h=0,g=[],_=()=>{let e=h;return h+=1,e<p.length?p[e]:null},v=async e=>{let t=r.getGitFileDiff(n,{path:e}),i=new Promise((e,t)=>{setTimeout(()=>t(Error(`Timed out after ${ln}ms`)),ln)}),a=await Promise.race([t,i]);return{path:e,diff:{original:a.original??``,modified:a.modified??``,isBinary:a.isBinary}}},y=async()=>{for(;;){if(m!==yn(n))return;let e=_();if(!e)return;try{g.push(await v(e))}catch{}finally{u.delete(e)}}},b=Math.min(cn,p.length);if(await Promise.allSettled(Array.from({length:b},()=>y())),p.forEach(e=>u.delete(e)),m!==yn(n))return;let x=new Map(t().directories),S=x.get(n);if(!S)return;let C=new Map(S.diffCache),w=Date.now();g.forEach(e=>{!e.diff.isBinary&&e.diff.original===``&&e.diff.modified===``||C.set(e.path,{...e.diff,fetchedAt:w})});let T=Cn(C);x.set(n,{...S,diffCache:T}),e({directories:x})},setLogMaxCount:(n,r)=>{let i=new Map(t().directories),a=i.get(n)??Q();i.set(n,{...a,logMaxCount:r}),e({directories:i})},ensureStatus:async(e,n)=>{let r=t().directories.get(e),i=Date.now();r?.status&&i-r.lastStatusFetch<nn||await t().fetchStatus(e,n,{silent:!!r?.status})},ensureAll:(e,n)=>{let r=_n.get(e);if(r)return r;let i=(async()=>{let r=t().directories.get(e),i=Date.now();(!r?.status||r.status.diffStats===void 0||i-(r?.lastStatusFetch??0)>=nn)&&await t().fetchStatus(e,n,{silent:!!r?.status});let a=t().directories.get(e);if(!a?.isGitRepo)return;let o=[];(!a.branches||i-a.lastBranchesFetch>=rn)&&o.push(t().fetchBranches(e,n)),(!a.log||i-a.lastLogFetch>=en)&&o.push(t().fetchLog(e,n)),(!a.identity||i-a.lastIdentityFetch>=an)&&o.push(t().fetchIdentity(e,n)),o.length>0&&await Promise.all(o)})();return _n.set(e,i),i.finally(()=>{_n.get(e)===i&&_n.delete(e)}),i},refresh:async(e,n={})=>{let{activeDirectory:r}=t();r&&await t().fetchAll(r,e,n)}}),{name:`git-store`})),Pn=e=>{let t=(0,H.c)(2),n;return t[0]===e?n=t[1]:(n=t=>e?t.directories.get(e)?.status??null:null,t[0]=e,t[1]=n),$(n)},Fn=e=>{let r=(0,H.c)(3),i=V.useSyncExternalStore(t,n,n),a;return r[0]!==e||r[1]!==i?(a=t=>{if(!e)return null;let n=t.directories.get(e);return n?.branchesTransportIdentity===i?n.branches:null},r[0]=e,r[1]=i,r[2]=a):a=r[2],$(a)},In=e=>{let t=(0,H.c)(2),n;return t[0]===e?n=t[1]:(n=t=>e?t.directories.get(e)?.log??null:null,t[0]=e,t[1]=n),$(n)},Ln=e=>{let t=(0,H.c)(2),n;return t[0]===e?n=t[1]:(n=t=>e?t.directories.get(e)?.isGitRepo??null:null,t[0]=e,t[1]=n),$(n)},Rn=e=>{let t=(0,H.c)(2),n;return t[0]===e?n=t[1]:(n=t=>e?t.directories.get(e)?.status?.current?.trim()??null:null,t[0]=e,t[1]=n),$(n)},zn={current:new Map},Bn=()=>$(Gn),Vn=e=>{let t=(0,H.c)(3),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=new Map,t[0]=n):n=t[0];let r=V.useRef(n),i;return t[1]===e?i=t[2]:(i=t=>{let n=r.current,i=n.size===e.length;if(i)for(let r of e){let e=t.directories.get(r),a=n.get(r);if(!a||(e?.isGitRepo??null)!==a.isGitRepo||(e?.status?.current??null)!==a.branch){i=!1;break}}if(i)return n;let a=new Map;for(let n of e){let e=t.directories.get(n);a.set(n,{isGitRepo:e?.isGitRepo??null,branch:e?.status?.current??null})}return r.current=a,a},t[1]=e,t[2]=i),$(i)},Hn=e=>{let t=(0,H.c)(2),n;return t[0]===e?n=t[1]:(n=t=>e?t.directories.get(e)?.isLoadingStatus??!1:!1,t[0]=e,t[1]=n),$(n)},Un=e=>{let t=(0,H.c)(2),n;return t[0]===e?n=t[1]:(n=t=>e?t.directories.get(e)?.isLoadingLog??!1:!1,t[0]=e,t[1]=n),$(n)},Wn=e=>{let t=(0,H.c)(2),n;return t[0]===e?n=t[1]:(n=t=>e?t.directories.get(e)?.isLoadingBranches??!1:!1,t[0]=e,t[1]=n),$(n)};function Gn(e){let t=zn.current,n=t.size===e.directories.size;if(n){for(let[r,i]of e.directories)if(t.get(r)!==(i.status?.current??null)){n=!1;break}}if(n)return t;let r=new Map;for(let[t,n]of e.directories)r.set(t,n.status?.current??null);return zn.current=r,r}var Kn=e=>{let t=String(e||``).trim().replace(/^remotes\//,``);if(!t)return null;let n=t.indexOf(`/`);return n<=0||n>=t.length-1?null:{remote:t.slice(0,n),branch:t.slice(n+1)}},qn=e=>String(e||``).trim().replace(/^refs\/heads\//,``).replace(/^heads\//,``).replace(/^remotes\//,``),Jn=e=>e.branchName?qn(e.branchName):e.mode===`existing`?qn(e.existingBranch||e.preferredName||``):qn(e.preferredName||``),Yn=async e=>{let t=await z(e);try{let n=Kn((await ue(e)).branches?.[t]?.tracking||null);if(n?.remote)return n.remote}catch{}try{let t=Kn((await de(e)).tracking);if(t?.remote)return t.remote}catch{}return null},Xn=async(e,t)=>{let n=await Yn(e),r=qn(t);return!n||!r?null:{setUpstream:!0,upstreamRemote:n,upstreamBranch:r}},Zn=async(e,t,n)=>{let r=Jn(t),i=n?.resolvedRootTrackingRemote,a=i===void 0?await Xn(e,r):i&&qn(r)?{setUpstream:!0,upstreamRemote:i,upstreamBranch:qn(r)}:null;return a?{...t,setUpstream:t.setUpstream??a.setUpstream,upstreamRemote:t.upstreamRemote||a.upstreamRemote,upstreamBranch:t.upstreamBranch||a.upstreamBranch}:t},Qn=async(e,t,n)=>{let r=await Zn(e.path,t,n);return B(e,r)},$n=`oc:lastWorktreeSourceBranch`,er=({mode:e,sourceBranch:t,linkedPr:n,selectedBranch:r})=>e===`existing-branch`?r||null:n?null:t||null,tr=({branches:e,savedSourceBranch:t,rootBranch:n})=>t&&e.includes(t)&&t?{sourceBranch:t,shouldClearSavedSourceBranch:!1}:{sourceBranch:n&&e.includes(n)?n:e.includes(`main`)?`main`:e.includes(`master`)?`master`:e[0]??``,shouldClearSavedSourceBranch:!!t},nr=(e,t,n)=>{if(!e)return e;let r=t.length>0&&!/\s$/.test(t)&&!/^\s/.test(e)&&!/[([{]$/.test(t),i=n.length>0&&!/\s$/.test(e)&&!/^\s/.test(n)&&!/^[\])}.,;:!?]/.test(n);return`${r?` `:``}${e}${i?` `:``}`},rr=(e,t,n)=>{let r=nr(e,t,n);return`${t.length===0&&!/^\s/.test(r)?` `:``}${r}${n.length===0&&!/\s$/.test(r)?` `:``}`},ir=(e,t,n,r)=>{let i=e.slice(0,t),a=e.slice(n),o=rr(r,i,a),s=Math.max(0,o.indexOf(r)),c=i.length+s;return{text:`${i}${o}${a}`,caret:i.length+o.length,start:c,end:c+r.length}},ar=(e,t)=>{let n=e=>`${e.kind}:${e.value}:${e.range.start}:${e.range.end}`;return new Set(e.map(n)).has(n(t))?[...e]:[...e,t]},or=(e,t)=>t<e.length&&e[t]===` `?t+1:t;export{tt as A,X as B,Yt as C,ct as D,gt as E,Oe as F,q as H,ke as I,Ae as L,Re as M,Le as N,ot as O,Ie as P,Te as R,Qt as S,vt as T,ye as U,Se as V,In as _,$n as a,$ as b,Qn as c,Bn as d,Rn as f,Hn as g,Un as h,rr as i,Je as j,rt as k,Yn as l,Wn as m,ar as n,tr as o,Fn as p,ir as r,er as s,or as t,Zn as u,Vn as v,Xt as w,Ln as x,Pn as y,Ce as z};
|