@openchamber/web 2.6.0 → 2.6.1-canary.20261102.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AboutDialog-DBDN-gwQ.js → AboutDialog-BTYnMXM0.js} +1 -1
- package/dist/assets/{AboutLogo-BP87552a.js → AboutLogo-BwyB9sbV.js} +1 -1
- package/dist/assets/{ArchiveView-GN7gU2qK.js → ArchiveView-BsWIv-C4.js} +1 -1
- package/dist/assets/{ChangeRequestDiffUnavailable-B28oeUds.js → ChangeRequestDiffUnavailable-ED92kmXz.js} +1 -1
- package/dist/assets/{ChangedPathLabel-DV4XTf6K.js → ChangedPathLabel-7Zbbq-FE.js} +1 -1
- package/dist/assets/{CommandPalette-Dvsy8IHV.js → CommandPalette-CLlDfj5e.js} +1 -1
- package/dist/assets/{DiffView-BXm5iGeW.js → DiffView-CQOHl1hv.js} +1 -1
- package/dist/assets/{FilesView-CAXuJLle.js → FilesView-D00Dnc8i.js} +1 -1
- package/dist/assets/{GitView-D29soKpK.js → GitView-Z4zWCBn1.js} +1 -1
- package/dist/assets/{GuestSurfacePane-Dw0Um8RG.js → GuestSurfacePane-OM2GGOiX.js} +1 -1
- package/dist/assets/{HelpDialog-DuO4UnZT.js → HelpDialog-DNqqtAW-.js} +1 -1
- package/dist/assets/{IntegrationsCatalogView-BrLbP8hQ.js → IntegrationsCatalogView-C4-oLIEz.js} +1 -1
- package/dist/assets/{JsonTreeView-ZZKmvRSL.js → JsonTreeView-Bw8E9Koo.js} +1 -1
- package/dist/assets/{MarkdownDiffPreview-DuH8ODuS.js → MarkdownDiffPreview-CaG-F6-b.js} +1 -1
- package/dist/assets/{MarkdownRendererImpl-DNGYmQPH.js → MarkdownRendererImpl-Cd3zotqp.js} +3 -3
- package/dist/assets/{MemoryDebugPanel-C7shSvtT.js → MemoryDebugPanel-DzMnnl_P.js} +1 -1
- package/dist/assets/{NoteEditor-Ba3KW2rV.js → NoteEditor-DWNlP4dC.js} +1 -1
- package/dist/assets/{OnboardingScreen-CIyOLCq2.js → OnboardingScreen-DZVhaQUC.js} +1 -1
- package/dist/assets/{OpenCodeStatusDialog-ByN8gJ51.js → OpenCodeStatusDialog-BgseXyBy.js} +1 -1
- package/dist/assets/{OverviewView-B6SMyBTp.js → OverviewView-CohMMobq.js} +1 -1
- package/dist/assets/{PatchDiff-C8jKkgEf.js → PatchDiff-DGB_PTLK.js} +1 -1
- package/dist/assets/{PlanView-NMKJpsCH.js → PlanView-pwTIoUJK.js} +1 -1
- package/dist/assets/{ProjectActionsDialog-Ctr7-_lb.js → ProjectActionsDialog-C3rXp1WV.js} +1 -1
- package/dist/assets/{ReplyUiBlock-C-C95eJ_.js → ReplyUiBlock-B1NgzCEP.js} +1 -1
- package/dist/assets/{RunOverview-DNSvGB7-.js → RunOverview-BqmEhK3a.js} +1 -1
- package/dist/assets/{ScheduledTasksDialog-BNXOjpPY.js → ScheduledTasksDialog-CXyiyIDe.js} +1 -1
- package/dist/assets/{SettingsView-ug8Oinyr.js → SettingsView-D7mytSZv.js} +1 -1
- package/dist/assets/{SettingsWindow-CKUU5T8p.js → SettingsWindow-CnjurTti.js} +1 -1
- package/dist/assets/{SidebarSectionsManager-DWJwQwVi.js → SidebarSectionsManager-D1hsBI-4.js} +1 -1
- package/dist/assets/{SourceBoardView-BQittQF3.js → SourceBoardView-BoMdMgmW.js} +1 -1
- package/dist/assets/{SpaceAccessDialog-CeZrOBod.js → SpaceAccessDialog-q5blJXG5.js} +1 -1
- package/dist/assets/{SpaceApplyDialog-DurN0_0Z.js → SpaceApplyDialog-Csq1Z7zY.js} +1 -1
- package/dist/assets/{SpaceRow-BkgNrW0R.js → SpaceRow-BvJCw88e.js} +1 -1
- package/dist/assets/{SpaceSetupOutput-BDkJcYrl.js → SpaceSetupOutput-Bzeasxqg.js} +1 -1
- package/dist/assets/{SpacesView-D6UCwVZp.js → SpacesView-DNI1yLAG.js} +1 -1
- package/dist/assets/{SubmoduleDiffSummary-BK5RTTC4.js → SubmoduleDiffSummary-B3CnCMwZ.js} +1 -1
- package/dist/assets/{ToolOutputDialog-CAenoFSA.js → ToolOutputDialog-inRAtLLn.js} +1 -1
- package/dist/assets/{ToolPartDiffPreview-CdjYwDyA.js → ToolPartDiffPreview-CJneViW_.js} +1 -1
- package/dist/assets/{UiBlock-t2ea_iLd.js → UiBlock-ChJiwt5R.js} +1 -1
- package/dist/assets/{UsageStatsView-D2AXngeb.js → UsageStatsView-CWV-BYPI.js} +1 -1
- package/dist/assets/{Virtualizer-V759EvEY.js → Virtualizer-BOHERqLh.js} +1 -1
- package/dist/assets/{WalkthroughView-CiQk4Tg_.js → WalkthroughView-BnT4-pMh.js} +1 -1
- package/dist/assets/{WorktreesView-Bmnk7eXM.js → WorktreesView-D_VUAXdo.js} +1 -1
- package/dist/assets/{appThemeRegistry-D4EuLaGF.js → appThemeRegistry-BBiQjAje.js} +1 -1
- package/dist/assets/{ar-9I6l4EAU.js → ar-BXROvDU9.js} +1 -1
- package/dist/assets/{codeHighlight-DD239VMc.js → codeHighlight-CJBps6zM.js} +1 -1
- package/dist/assets/{computeVirtualFileMetrics-BhVDZ-oP.js → computeVirtualFileMetrics-CXGHe7T5.js} +2 -2
- package/dist/assets/{contextFileOpenGuard-D9Z0ay-I.js → contextFileOpenGuard-Cp662aS-.js} +1 -1
- package/dist/assets/{date-time-DlgUVVwY.js → date-time-C4F_nWqa.js} +1 -1
- package/dist/assets/{de-CPlTX8kA.js → de-nCDq_bQg.js} +1 -1
- package/dist/assets/{es-BMaNboo9.js → es-CvZecQ0j.js} +1 -1
- package/dist/assets/{fileContentPoller-paKtimZt.js → fileContentPoller-D0GhYhQ3.js} +1 -1
- package/dist/assets/{flexokiTheme-Bv37aHkq.js → flexokiTheme-Df4MxCkn.js} +1 -1
- package/dist/assets/{fr-onOdSl19.js → fr-DzrngSh8.js} +1 -1
- package/dist/assets/{he-CgCCGzpX.js → he-uZ2JD0ys.js} +1 -1
- package/dist/assets/{highlights-ByNnuo4t.js → highlights-gD3Zrhb_.js} +1 -1
- package/dist/assets/{index-BKnb59RH.js → index-BNAoU1SB.js} +1 -1
- package/dist/assets/{initializeSharedPreferences-CFrNmgg0.js → initializeSharedPreferences-Cb-QZ9nO.js} +1 -1
- package/dist/assets/{install-EEjacdUD.js → install-BjzS6Z-p.js} +1 -1
- package/dist/assets/{isDiffPlainText-DUd8YJX0.js → isDiffPlainText-SBv5bM8c.js} +1 -1
- package/dist/assets/{isFilePlainText-BqR4iT-Y.js → isFilePlainText-QNmxHtqN.js} +1 -1
- package/dist/assets/{ja-CYYy1_I8.js → ja-CADF0HeI.js} +1 -1
- package/dist/assets/{katex.min-BBVkbKQY.js → katex.min-BCtkGOiC.js} +4 -4
- package/dist/assets/{ko-CupS3Elm.js → ko-BLGJMTce.js} +1 -1
- package/dist/assets/{main-B3MbWk_e.js → main-BAWvOAbS.js} +2 -2
- package/dist/assets/{main-Kwo8IqqZ.js → main-my1cVcab.js} +4 -4
- package/dist/assets/{miniChat-DelNi_yP.js → miniChat-C80tea9b.js} +2 -2
- package/dist/assets/{mobile-BIso4MdY.js → mobile-Bw86MtWV.js} +2 -2
- package/dist/assets/{nl-Di3GhSHB.js → nl-ClP-S61w.js} +1 -1
- package/dist/assets/{pageTitle-BL2yQcTV.js → pageTitle-Cph9nb1O.js} +1 -1
- package/dist/assets/{parseDiffFromFile-31PZ3lnE.js → parseDiffFromFile-Yp9eHLcj.js} +1 -1
- package/dist/assets/{pierreDiffTint-igvBfgMB.js → pierreDiffTint-CFyG2F44.js} +1 -1
- package/dist/assets/{pl-DEy-fwio.js → pl-LChBHlUo.js} +1 -1
- package/dist/assets/{pt-BR-Cqzgn2Hs.js → pt-BR-CV84EAxr.js} +1 -1
- package/dist/assets/{relocateRestoredSession-CGvQdGRX.js → relocateRestoredSession-gkROUapx.js} +2 -2
- package/dist/assets/{renderElectronMiniChatApp-hBJHkIHQ.js → renderElectronMiniChatApp-CJN6HCUs.js} +2 -2
- package/dist/assets/{renderMarkdownForExport-DWj11Yob.js → renderMarkdownForExport-BPMLtJlQ.js} +1 -1
- package/dist/assets/{renderMobileApp-Bzps4LvM.js → renderMobileApp-Cuc-A8vm.js} +3 -3
- package/dist/assets/{resolveLanguages-DHAaVkki.js → resolveLanguages-UhQ_Qm0O.js} +1 -1
- package/dist/assets/{runtimeEndpointReset-BPYbd6uu.js → runtimeEndpointReset-CMO7G_Ff.js} +5 -5
- package/dist/assets/{scheduledTasksApi-D6FhT0TU.js → scheduledTasksApi-Mn2aZ7Rl.js} +1 -1
- package/dist/assets/{shiki-y7boL955.js → shiki-B7QfMAec.js} +1 -1
- package/dist/assets/{space-apply-9idN6j4k.js → space-apply-CNISDYMA.js} +1 -1
- package/dist/assets/{space-close-CjDS5mSo.js → space-close-C4pr8Kt0.js} +1 -1
- package/dist/assets/{spaceNetwork-DeZE7V6c.js → spaceNetwork-DUg5u0h8.js} +1 -1
- package/dist/assets/{stream-tokenizer-UaU7yP0V.js → stream-tokenizer-CSMIYyXj.js} +1 -1
- package/dist/assets/{textMateThemeFromAppTheme-fsNcE7v2.js → textMateThemeFromAppTheme-CbTfkuJp.js} +1 -1
- package/dist/assets/{tr-DL0uHNVd.js → tr-BXliZ8MC.js} +1 -1
- package/dist/assets/{uk-qdUsCGYW.js → uk-CxABjNd2.js} +1 -1
- package/dist/assets/{useAppFontEffects-DpDiWkkc.js → useAppFontEffects-C_TEX3sk.js} +16 -16
- package/dist/assets/{useBranchPullRequestRequest-Cbky4ZeH.js → useBranchPullRequestRequest-CLTracub.js} +1 -1
- package/dist/assets/{useCallableModelProviders-Y8rZzgJF.js → useCallableModelProviders-CcETbnHf.js} +1 -1
- package/dist/assets/{useDiffFindSurface-B7KQR8iQ.js → useDiffFindSurface-BY6KBx38.js} +1 -1
- package/dist/assets/{useGitCleanLine-D6E5eJm2.js → useGitCleanLine-KstI02a0.js} +1 -1
- package/dist/assets/{useInlineCommentController-CF8aQO6-.js → useInlineCommentController-ByiCLJwx.js} +1 -1
- package/dist/assets/{useMarkdownLocalAssets-BXBlTj-y.js → useMarkdownLocalAssets-DG5IJM9Y.js} +1 -1
- package/dist/assets/{useRootScrollLock-3qp1KaTm.js → useRootScrollLock-ClFa_ezf.js} +2 -2
- package/dist/assets/{useWalkthroughReview-BNHJ06yD.js → useWalkthroughReview-BjhHwuOR.js} +1 -1
- package/dist/assets/{useWholeFileComment-CisbVgb0.js → useWholeFileComment-Dbr3Y7Ga.js} +1 -1
- package/dist/assets/{useWorktreeArchiveActions-03WxbHUV.js → useWorktreeArchiveActions-jkcvj4mj.js} +1 -1
- package/dist/assets/{vendor-codemirror-language-data-C6MZftZF.js → vendor-codemirror-language-data-Cy549AYN.js} +2 -2
- package/dist/assets/{zh-CN-B3B6hhd4.js → zh-CN-Cj8b8iKH.js} +1 -1
- package/dist/assets/{zh-TW-CBU98qnu.js → zh-TW-CyjD8MXO.js} +1 -1
- package/dist/index.html +2 -2
- package/dist/mini-chat.html +2 -2
- package/dist/mobile.html +2 -2
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{R as W,j as D,a as Me,f as Qe,r as h}from"./vendor-react--VO_rL_p.js";import{p as Bt,a as qt}from"./parseDiffFromFile-
|
|
1
|
+
import{R as W,j as D,a as Me,f as Qe,r as h}from"./vendor-react--VO_rL_p.js";import{p as Bt,a as qt}from"./parseDiffFromFile-Yp9eHLcj.js";import{c as mt}from"./isDiffPlainText-SBv5bM8c.js";import{P as jt,V as gt,F as Vt}from"./pierreDiffTint-CFyG2F44.js";import{V as Kt}from"./Virtualizer-BOHERqLh.js";import{u as Pt,aj as Ut,ak as yt,aK as Gt,T as Xt,gf as Yt,n as Qt,Q as xt,bB as Jt,bO as Zt,aq as fe,bP as vt,bQ as bt,bR as en}from"./useAppFontEffects-C_TEX3sk.js";import"./katex.min-BCtkGOiC.js";import{a as wt,I as tn,u as nn}from"./useInlineCommentController-ByiCLJwx.js";import{as as rn}from"./runtimeEndpointReset-CMO7G_Ff.js";import{ensurePierreThemeRegistered as Lt,getResolvedShikiTheme as St}from"./appThemeRegistry-BBiQjAje.js";import{DIFFS_HIGHLIGHTER as on}from"./diffsHighlighter-BsxkaI3Q.js";const Pe=t=>{if(t.type==="new"){const n=Math.min(t.selection.start,t.selection.end),r=Math.max(t.selection.start,t.selection.end);return`new-comment-${t.selection.side??"additions"}-${n}-${r}`}return`draft-${t.draft.id}`},sn=t=>{const{drafts:n,editingDraftId:r,selection:e}=t,i=[];for(const s of n){if(!Number.isFinite(s.endLine))continue;const a=Math.max(1,Math.floor(s.endLine)),u=s.side==="original"?"deletions":"additions";i.push({lineNumber:a,side:u,metadata:{type:s.id===r?"edit":"saved",draft:s}})}return e&&!r&&i.push({lineNumber:Math.max(e.start,e.end),side:e.side??"additions",metadata:{type:"new",selection:e}}),i};function an(t){const n=t.trim();if(!n)return null;if(/^-?\d+(\.\d+)?$/.test(n)){const r=Number.parseFloat(n);return Number.isFinite(r)?r:null}if(n.endsWith("px")){const r=Number.parseFloat(n.slice(0,-2));return Number.isFinite(r)?r:null}return null}function kt(t){if(!(!t||t<=0))return Math.max(200,Math.floor(t))}function ln(t){const{diffRootRef:n,drafts:r,selection:e,editingDraftId:i,commentText:s,onTextChange:a,fileLabel:u,onSave:c,onCancel:l,onEdit:f,onDelete:g}=t,[p,S]=W.useState(0),[I,b]=W.useState(null),_=W.useMemo(()=>!e||i?null:Pe({type:"new",selection:e}),[i,e]),q=W.useMemo(()=>{const x=r.map(k=>Pe({type:k.id===i?"edit":"saved",draft:k}));return _&&x.push(_),x},[r,i,_]),F=W.useCallback(x=>{const k=n.current;if(!k)return null;const $=k.querySelector("diffs-container");if(!($ instanceof HTMLElement))return null;const P=$.querySelector(`[data-annotation-id="${x}"]`);if(P instanceof HTMLElement)return P;const B=$.shadowRoot;return B?B.querySelector(`[data-annotation-id="${x}"]`):null},[n]);W.useEffect(()=>{if(q.length===0)return;let x=!1,k=0;const $=12,P=()=>{x||q.every(G=>!!F(G))||k>=$||(k+=1,requestAnimationFrame(()=>{x||(S(G=>G+1),P())}))};return P(),()=>{x=!0}},[q,F]),W.useEffect(()=>{const x=n.current;if(!x)return;const k=()=>{const P=getComputedStyle(x),B=an(P.getPropertyValue("--oc-context-panel-width")),G=x.getBoundingClientRect(),ee=B??G.width;b(ee>0?ee:null)};k();const $=new ResizeObserver(()=>{k()});return $.observe(x),window.addEventListener("resize",k),()=>{$.disconnect(),window.removeEventListener("resize",k)}},[n]);const O=W.useCallback(x=>{const $=n.current?.getBoundingClientRect(),P=x.closest("[data-annotation-content]"),B=P instanceof HTMLElement?P.getBoundingClientRect():x.getBoundingClientRect(),G=[B.width];$&&G.push($.right-B.left);const ee=G.filter(he=>Number.isFinite(he)&&he>0);return ee.length>0?kt(Math.min(...ee)):kt(I)},[n,I]),z=()=>{const x=n.current?.querySelector("diffs-container")?.shadowRoot,k=x?Array.from(x.querySelectorAll("[data-line][data-selected-line]")).at(-1):void 0;if(k)return getComputedStyle(k).getPropertyValue("--diffs-computed-selected-line-bg").trim()||void 0};return D.jsxs(D.Fragment,{children:[r.map(x=>{const k=Pe({type:x.id===i?"edit":"saved",draft:x}),$=F(k);if(!$)return null;const P=O($);return x.id===i?Me.createPortal(D.jsx(wt,{initialText:s,onTextChange:a,fileLabel:u,lineRange:{start:x.startLine,end:x.endLine,side:x.side==="original"?"deletions":"additions"},isEditing:!0,onSave:c,onCancel:l,maxWidth:P,bandColor:z()}),$,`draft-edit-${x.id}`):Me.createPortal(D.jsx(tn,{draft:x,onEdit:()=>f(x),onDelete:()=>g(x),maxWidth:P}),$,`draft-card-${x.id}`)}),e&&!i&&_&&(()=>{const x=F(_);if(!x)return null;const k=O(x);return Me.createPortal(D.jsx(wt,{initialText:s,onTextChange:a,fileLabel:u,lineRange:e,isEditing:!1,onSave:c,onCancel:l,maxWidth:k,bandColor:z()}),x,_)})()]})}const yr=14,xr=t=>t.slice(t.lastIndexOf("/",t.length-2)+1),Nt=t=>t.replace(/\\/g,"/").replace(/^\/+/,"").trim(),Rt=(t,n)=>({id:`dir:${t}`,path:t,name:n,children:new Map,directFiles:[],files:[]}),vr=t=>{const n=Rt("","");for(const r of t){const e=Nt(r.path);if(!e)continue;const s=e.split("/").filter(Boolean).slice(0,-1);let a=n;if(a.files.push(r),s.length>0){let u="";for(const c of s){u=u?`${u}/${c}`:c;const l=a.children.get(c);if(l){l.files.push(r),a=l;continue}const f=Rt(u,c);f.files.push(r),a.children.set(c,f),a=f}}a.directFiles.push(r)}return n},cn=t=>{let n=t,r=t.name;for(;n.directFiles.length===0&&n.children.size===1;){const[e]=n.children.values();n=e,r=`${r}/${e.name}`}return{node:n,label:r}},br=(t,n)=>{const r=[],e=(i,s)=>{const a=Array.from(i.children.values()).sort((c,l)=>c.path.localeCompare(l.path));for(const c of a){const{node:l,label:f}=cn(c);r.push({key:l.id,kind:"directory",depth:s,label:f,directory:l}),n.has(l.path)&&e(l,s+1)}const u=[...i.directFiles].sort((c,l)=>c.path.localeCompare(l.path));for(const c of u)r.push({key:`file:${Nt(c.path)}`,kind:"file",depth:s,file:c})};return e(t,0),r},Ke=3,dn=1e6,Ct=new WeakMap,un=t=>{const n=Ct.get(t);if(n)return n;let r=!1;const e=[];for(const s of t.hunks){const a=[];for(const u of s.hunkContent){if(u.type==="context"){Xe(a,{...u});continue}const c=fn(t,u);(c.length>1||c[0]?.type==="context")&&(r=!0);for(const l of c)Xe(a,l)}e.push(...pn(s,a))}const i=r?gn(t,e):t;return Ct.set(t,i),i},Et=t=>t.replace(/\s+/g,""),fn=(t,n)=>{if(n.deletions===0||n.additions===0)return[{...n}];const r=t.deletionLines.slice(n.deletionLineIndex,n.deletionLineIndex+n.deletions),e=t.additionLines.slice(n.additionLineIndex,n.additionLineIndex+n.additions),i=[];let s=0,a=0;for(const[u,c]of hn(r,e))(u>s||c>a)&&i.push({type:"change",deletions:u-s,deletionLineIndex:n.deletionLineIndex+s,additions:c-a,additionLineIndex:n.additionLineIndex+a}),Xe(i,{type:"context",lines:1,deletionLineIndex:n.deletionLineIndex+u,additionLineIndex:n.additionLineIndex+c}),s=u+1,a=c+1;return(s<n.deletions||a<n.additions)&&i.push({type:"change",deletions:n.deletions-s,deletionLineIndex:n.deletionLineIndex+s,additions:n.additions-a,additionLineIndex:n.additionLineIndex+a}),i},hn=(t,n)=>{const r=t.map(Et),e=n.map(Et),i=[];let s=0;for(;s<r.length&&s<e.length&&r[s]===e[s];)i.push([s,s]),s+=1;let a=0;for(;a<r.length-s&&a<e.length-s&&r[r.length-1-a]===e[e.length-1-a];)a+=1;const u=r.length-s-a,c=e.length-s-a;if(u>0&&c>0&&(u+1)*(c+1)<=dn){const l=c+1,f=new Uint32Array((u+1)*l);for(let S=u-1;S>=0;S-=1)for(let I=c-1;I>=0;I-=1)f[S*l+I]=r[s+S]===e[s+I]?f[(S+1)*l+I+1]+1:Math.max(f[(S+1)*l+I],f[S*l+I+1]);let g=0,p=0;for(;g<u&&p<c;)r[s+g]===e[s+p]?(i.push([s+g,s+p]),g+=1,p+=1):f[(g+1)*l+p]>=f[g*l+p+1]?g+=1:p+=1}for(let l=a;l>0;l-=1)i.push([r.length-l,e.length-l]);return i},Xe=(t,n)=>{const r=t.at(-1);if(r?.type==="context"&&n.type==="context"){r.lines+=n.lines;return}t.push(n)},It=(t,n,r)=>({type:"context",lines:r,deletionLineIndex:t.deletionLineIndex+n,additionLineIndex:t.additionLineIndex+n}),pn=(t,n)=>{const r=[];let e=null;for(const[s,a]of n.entries()){if(a.type==="change"){if(!e){e=[];const c=n[s-1];if(c?.type==="context"){const l=Math.min(c.lines,Ke);e.push(It(c,c.lines-l,l))}}e.push(a);continue}if(!e)continue;if(s<n.length-1&&a.lines<=Ke*2){e.push(a);continue}e.push(It(a,0,Math.min(a.lines,Ke))),r.push(e),e=null}e&&r.push(e);const i=n.at(-1);return r.map(s=>{const a=s.at(-1),u=a!==void 0&&i!==void 0&&Te(a,"deletion")===Te(i,"deletion")&&Te(a,"addition")===Te(i,"addition");return mn(t,s,u)})},Te=(t,n)=>n==="deletion"?t.deletionLineIndex+(t.type==="context"?t.lines:t.deletions):t.additionLineIndex+(t.type==="context"?t.lines:t.additions),mn=(t,n,r)=>{let e=0,i=0,s=0,a=0,u=0;for(const b of n)b.type==="context"?(s+=b.lines,a+=b.lines,u+=b.lines):(e+=b.additions,i+=b.deletions,a+=Math.max(b.additions,b.deletions),u+=b.additions+b.deletions);const c=n[0],l=s+e,f=s+i,g=Tt(Ne(t.additionStart,t.additionCount)+c.additionLineIndex-t.additionLineIndex,l),p=Tt(Ne(t.deletionStart,t.deletionCount)+c.deletionLineIndex-t.deletionLineIndex,f),I=c.additionLineIndex===t.additionLineIndex&&c.deletionLineIndex===t.deletionLineIndex?t.hunkContext:void 0;return{collapsedBefore:0,additionStart:g,additionCount:l,additionLines:e,additionLineIndex:c.additionLineIndex,deletionStart:p,deletionCount:f,deletionLines:i,deletionLineIndex:c.deletionLineIndex,hunkContent:n,hunkContext:I,hunkSpecs:`@@ -${p},${f} +${g},${l} @@${I?` ${I}`:""}
|
|
2
2
|
`,splitLineStart:0,splitLineCount:a,unifiedLineStart:0,unifiedLineCount:u,noEOFCRDeletions:r&&t.noEOFCRDeletions,noEOFCRAdditions:r&&t.noEOFCRAdditions}},Ne=(t,n)=>t-(n===0?0:1),Tt=(t,n)=>t+(n===0?0:1),gn=(t,n)=>{let r=0,e=0,i=0;for(const a of n)a.collapsedBefore=Math.max(Ne(a.additionStart,a.additionCount)-i,0),a.splitLineStart=r+a.collapsedBefore,a.unifiedLineStart=e+a.collapsedBefore,r+=a.collapsedBefore+a.splitLineCount,e+=a.collapsedBefore+a.unifiedLineCount,i=Ne(a.additionStart,a.additionCount)+a.additionCount;if(n.at(-1)&&!t.isPartial&&t.additionLines.length>0&&t.deletionLines.length>0){const a=Math.max(t.additionLines.length-i,0);r+=a,e+=a}return{...t,...t.isPartial?yn(t,n):{hunks:n},splitLineCount:r,unifiedLineCount:e,cacheKey:t.cacheKey===void 0?void 0:`${t.cacheKey}:hide-whitespace`}},yn=(t,n)=>{const r=[],e=[],i=(a,u,c,l)=>{for(let f=c;f<c+l;f+=1)u.push(a[f])};return{hunks:n.map(a=>{const u=r.length,c=e.length,l=a.hunkContent.map(f=>{const g={...f,deletionLineIndex:r.length,additionLineIndex:e.length};return i(t.deletionLines,r,f.deletionLineIndex,f.type==="context"?f.lines:f.deletions),i(t.additionLines,e,f.additionLineIndex,f.type==="context"?f.lines:f.additions),g});return{...a,deletionLineIndex:u,additionLineIndex:c,hunkContent:l}}),deletionLines:r,additionLines:e}},xn=t=>t.replace(/\r?\n$/,""),vn=(t,n,r)=>{if(!t.isPartial)return r-1;for(const e of t.hunks){const i=n==="additions"?e.additionStart:e.deletionStart,s=n==="additions"?e.additionCount:e.deletionCount;if(r<i||r>=i+s)continue;return(n==="additions"?e.additionLineIndex:e.deletionLineIndex)+(r-i)}return null},bn=(t,n,r,e)=>{const i=n==="additions"?t.additionLines:t.deletionLines,s=[];for(let a=Math.max(1,r);a<=e;a+=1){const u=vn(t,n,a),c=u===null?void 0:i[u];c!==void 0&&s.push(xn(c))}return s.join(`
|
|
3
3
|
`)},Ue=/[\p{L}\p{N}_$]/u,wn=(t,n)=>{if(n<0||n>t.length)return null;const r=n===t.length?t.length-1:n;if(r<0||!Ue.test(t[r]))return null;let e=r,i=r+1;for(;e>0&&Ue.test(t[e-1]);)e-=1;for(;i<t.length&&Ue.test(t[i]);)i+=1;return{word:t.slice(e,i),spanStart:e}},Ln=t=>t?Array.from(t.children).filter(n=>n instanceof HTMLElement&&n.hasAttribute("data-code")):[],Sn=(t,n)=>{const r=new Map,e=()=>{const c=t.getBoundingClientRect().left,l=Array.from(r.values(),f=>({entry:f,left:f.column.getBoundingClientRect().left-c,clientWidth:f.column.clientWidth,scrollWidth:f.column.scrollWidth,scrollLeft:f.column.scrollLeft}));n.hidden=!l.some(f=>f.scrollWidth-f.clientWidth>1);for(const{entry:f,left:g,clientWidth:p,scrollWidth:S,scrollLeft:I}of l){const b=S-p>1;f.track.hidden=!b,b&&(f.track.style.left=`${g}px`,f.track.style.width=`${p}px`,f.spacer.style.width=`${S}px`,f.track.scrollLeft=I)}},i=new ResizeObserver(e),s=new MutationObserver(()=>u()),a=c=>{const l=document.createElement("div");l.className="absolute inset-y-0 overflow-x-auto overflow-y-hidden overscroll-x-none",l.tabIndex=-1,l.hidden=!0;const f=document.createElement("div");f.className="h-px",l.appendChild(f),n.appendChild(l);const g=()=>{Math.abs(l.scrollLeft-c.scrollLeft)>=1&&(l.scrollLeft=c.scrollLeft)},p=()=>{Math.abs(c.scrollLeft-l.scrollLeft)>=1&&(c.scrollLeft=l.scrollLeft)};return c.addEventListener("scroll",g,{passive:!0}),l.addEventListener("scroll",p,{passive:!0}),i.observe(c),{column:c,content:null,track:l,spacer:f,detach:()=>{c.removeEventListener("scroll",g),l.removeEventListener("scroll",p),i.unobserve(c),l.remove()}}},u=()=>{const c=t.querySelector("diffs-container")?.shadowRoot??null,l=c?.querySelector("pre")??null,f=Ln(l);for(const[g,p]of r)f.includes(g)||(p.detach(),p.content&&i.unobserve(p.content),r.delete(g));for(const g of f){const p=r.get(g)??a(g);r.set(g,p);const S=Array.from(g.children).find(I=>I.hasAttribute("data-content"))??null;S!==p.content&&(p.content&&i.unobserve(p.content),S&&i.observe(S),p.content=S)}s.disconnect(),s.observe(t,{childList:!0}),c&&s.observe(c,{childList:!0}),l&&s.observe(l,{childList:!0});for(const g of f)s.observe(g,{childList:!0});r.size===0&&(n.hidden=!0)};return u(),i.observe(t),()=>{s.disconnect(),i.disconnect();for(const c of r.values())c.detach();r.clear(),n.hidden=!0}},kn=t=>{const n=Qe.c(4),{containerRef:r}=t,e=W.useRef(null);let i,s;n[0]!==r?(i=()=>{const u=r.current,c=e.current;if(!(!u||!c))return Sn(u,c)},s=[r],n[0]=r,n[1]=i,n[2]=s):(i=n[1],s=n[2]),W.useEffect(i,s);let a;return n[3]===Symbol.for("react.memo_cache_sentinel")?(a=D.jsx("div",{ref:e,hidden:!0,"aria-hidden":"true",className:"sticky bottom-0 z-10 h-2.5 bg-background"}),n[3]=a):a=n[3],a},At=[],Rn=`
|
|
4
4
|
[data-gutter-buffer="annotation"] { min-height: 0; }
|
package/dist/assets/{useCallableModelProviders-Y8rZzgJF.js → useCallableModelProviders-CcETbnHf.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a}from"./vendor-react--VO_rL_p.js";import{k as u,j as p}from"./katex.min-
|
|
1
|
+
import{r as a}from"./vendor-react--VO_rL_p.js";import{k as u,j as p}from"./katex.min-BCtkGOiC.js";import{V as f}from"./useAppFontEffects-C_TEX3sk.js";function h(t=!0){const i=f(r=>r.providers),e=u(r=>r.currentDirectory),[c,n]=a.useState(void 0);return a.useEffect(()=>{if(!t)return;let r=!1;return(async()=>{try{const d=e?`/api/small-model?directory=${encodeURIComponent(e)}`:"/api/small-model",o=await p(d,{method:"GET",headers:{Accept:"application/json"}});if(!o.ok)return;const s=await o.json().catch(()=>null);!r&&Array.isArray(s?.authenticatedProviders)&&n(s.authenticatedProviders.filter(l=>typeof l=="string"))}catch{}})(),()=>{r=!0}},[i,e,t]),c}export{h as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as de,R as n,j as M}from"./vendor-react--VO_rL_p.js";import{h as me}from"./useBranchPullRequestRequest-Cbky4ZeH.js";import{u as pe,Q as he,cn as fe,I as te,y as ge,B as re,ea as xe,eb as ye}from"./useAppFontEffects-DpDiWkkc.js";import"./katex.min-BBVkbKQY.js";const be="data-diff-find-bar",Pe=t=>{const e=de.c(87),{query:i,onQueryChange:y,total:c,currentIndex:p,isSearching:s,failedCount:E,onNext:g,onPrevious:x,onClose:m,focusNonce:d,className:P}=t,L=E===void 0?0:E,{t:o}=pe(),R=n.useRef(null);let k,C;e[0]===Symbol.for("react.memo_cache_sentinel")?(k=()=>{R.current?.focus()},C=[],e[0]=k,e[1]=C):(k=e[0],C=e[1]),n.useEffect(k,C);let F,b;e[2]!==d?(F=()=>{d&&d>0&&(R.current?.focus(),R.current?.select())},b=[d],e[2]=d,e[3]=F,e[4]=b):(F=e[3],b=e[4]),n.useEffect(F,b);let I;e[5]!==s||e[6]!==i?(I=i.trim().length>0&&!s,e[5]=s,e[6]=i,e[7]=I):I=e[7];const N=I;let h;e[8]!==p||e[9]!==N||e[10]!==o||e[11]!==c?(h=c>0?o("diffFind.countAria",{current:p+1,total:c}):N?o("diffFind.noMatches"):void 0,e[8]=p,e[9]=N,e[10]=o,e[11]=c,e[12]=h):h=e[12];const _=h;let a;e[13]!==s||e[14]!==_||e[15]!==o?(a=s?[_,o("diffFind.searchingAria")].filter(Boolean).join(", "):_,e[13]=s,e[14]=_,e[15]=o,e[16]=a):a=e[16];const l=a;let u;e[17]!==m||e[18]!==g||e[19]!==x?(u=T=>{fe(T)||(T.key==="Enter"?(T.preventDefault(),T.shiftKey?x():g()):T.key==="Escape"&&(T.preventDefault(),m()))},e[17]=m,e[18]=g,e[19]=x,e[20]=u):u=e[20];const S=u;let v;e[21]!==P?(v=he("absolute inset-e-3 top-3 z-40 flex flex-col rounded-lg border border-edge bg-[var(--surface-elevated)] px-1.5 py-1 shadow-lg",P),e[21]=P,e[22]=v):v=e[22];let Q;e[23]===Symbol.for("react.memo_cache_sentinel")?(Q=M.jsx(te,{name:"search",className:"ms-0.5 size-3.5 text-muted-foreground"}),e[23]=Q):Q=e[23];let $;e[24]!==y?($=T=>y(T.target.value),e[24]=y,e[25]=$):$=e[25];let j;e[26]!==o?(j=o("diffFind.placeholder"),e[26]=o,e[27]=j):j=e[27];let z;e[28]!==o?(z=o("diffFind.placeholder"),e[28]=o,e[29]=z):z=e[29];let D;e[30]!==S||e[31]!==i||e[32]!==$||e[33]!==j||e[34]!==z?(D=M.jsx(ge,{ref:R,value:i,onChange:$,onKeyDown:S,placeholder:j,"aria-label":z,className:"h-7 w-40 rounded-md px-2 py-0 text-sm md:w-56"}),e[30]=S,e[31]=i,e[32]=$,e[33]=j,e[34]=z,e[35]=D):D=e[35];let B;e[36]!==p||e[37]!==N||e[38]!==s||e[39]!==o||e[40]!==c?(B=N&&c===0?o("diffFind.noMatches"):c>0?`${p+1}/${c}${s?"+":""}`:"",e[36]=p,e[37]=N,e[38]=s,e[39]=o,e[40]=c,e[41]=B):B=e[41];let r;e[42]!==l||e[43]!==B?(r=M.jsx("span",{className:"min-w-12 px-1 text-center typography-micro text-muted-foreground tabular-nums","aria-live":"polite","aria-label":l,children:B}),e[42]=l,e[43]=B,e[44]=r):r=e[44];let f;e[45]!==o?(f=o("diffFind.previousAria"),e[45]=o,e[46]=f):f=e[46];let w;e[47]!==o?(w=o("diffFind.previousAria"),e[47]=o,e[48]=w):w=e[48];const A=c===0;let O;e[49]===Symbol.for("react.memo_cache_sentinel")?(O=M.jsx(te,{name:"arrow-up",className:"size-3.5"}),e[49]=O):O=e[49];let H;e[50]!==x||e[51]!==f||e[52]!==w||e[53]!==A?(H=M.jsx(re,{type:"button",variant:"ghost",size:"sm",className:"size-6 p-0 text-muted-foreground",onClick:x,title:f,"aria-label":w,disabled:A,children:O}),e[50]=x,e[51]=f,e[52]=w,e[53]=A,e[54]=H):H=e[54];let K;e[55]!==o?(K=o("diffFind.nextAria"),e[55]=o,e[56]=K):K=e[56];let W;e[57]!==o?(W=o("diffFind.nextAria"),e[57]=o,e[58]=W):W=e[58];const se=c===0;let Y;e[59]===Symbol.for("react.memo_cache_sentinel")?(Y=M.jsx(te,{name:"arrow-down",className:"size-3.5"}),e[59]=Y):Y=e[59];let U;e[60]!==g||e[61]!==K||e[62]!==W||e[63]!==se?(U=M.jsx(re,{type:"button",variant:"ghost",size:"sm",className:"size-6 p-0 text-muted-foreground",onClick:g,title:K,"aria-label":W,disabled:se,children:Y}),e[60]=g,e[61]=K,e[62]=W,e[63]=se,e[64]=U):U=e[64];let q;e[65]!==o?(q=o("diffFind.closeAria"),e[65]=o,e[66]=q):q=e[66];let J;e[67]!==o?(J=o("diffFind.closeAria"),e[67]=o,e[68]=J):J=e[68];let Z;e[69]===Symbol.for("react.memo_cache_sentinel")?(Z=M.jsx(te,{name:"close",className:"size-3.5"}),e[69]=Z):Z=e[69];let G;e[70]!==m||e[71]!==q||e[72]!==J?(G=M.jsx(re,{type:"button",variant:"ghost",size:"sm",className:"size-6 p-0 text-muted-foreground",onClick:m,title:q,"aria-label":J,children:Z}),e[70]=m,e[71]=q,e[72]=J,e[73]=G):G=e[73];let V;e[74]!==D||e[75]!==r||e[76]!==H||e[77]!==U||e[78]!==G?(V=M.jsxs("div",{className:"flex items-center gap-1",children:[Q,D,r,H,U,G]}),e[74]=D,e[75]=r,e[76]=H,e[77]=U,e[78]=G,e[79]=V):V=e[79];let X;e[80]!==L||e[81]!==o?(X=L>0&&M.jsx("p",{className:"w-0 min-w-full px-1 pb-0.5 typography-micro text-status-warning",children:o("diffFind.failedCount",{count:L})}),e[80]=L,e[81]=o,e[82]=X):X=e[82];let ee;return e[83]!==v||e[84]!==V||e[85]!==X?(ee=M.jsxs("div",{"data-diff-find-bar":"",className:v,children:[V,X]}),e[83]=v,e[84]=V,e[85]=X,e[86]=ee):ee=e[86],ee},Se=/[.*+?^${}()|[\]\\]/g,we=t=>t.replace(Se,"\\$&"),Fe=t=>t.replace(/\r?\n$/,""),Ee=(t,e,i)=>{const y=new RegExp(we(e),i?"g":"gi"),c=[];for(const p of t.matchAll(y))c.push({spanStart:p.index??0,spanLength:p[0].length});return c},ne=(t,e,i,y,c,p,s)=>{if(y<1)return;const E=Fe(c);for(const g of Ee(E,p,s))t.push({filePath:e,side:i,lineNumber:y,spanStart:g.spanStart,spanLength:g.spanLength})},Re=(t,e,i,y)=>{if(i.length===0)return[];const c=y.caseSensitive??!1,p=y.layout==="inline",s=[];for(const E of t.hunks){let g=E.additionStart,x=E.deletionStart;for(const m of E.hunkContent){if(m.type==="context"){for(let d=0;d<m.lines;d+=1)p||ne(s,e,"deletions",x+d,t.deletionLines[m.deletionLineIndex+d],i,c),ne(s,e,"additions",g+d,t.additionLines[m.additionLineIndex+d],i,c);g+=m.lines,x+=m.lines;continue}for(let d=0;d<m.deletions;d+=1)ne(s,e,"deletions",x+d,t.deletionLines[m.deletionLineIndex+d],i,c);x+=m.deletions;for(let d=0;d<m.additions;d+=1)ne(s,e,"additions",g+d,t.additionLines[m.additionLineIndex+d],i,c);g+=m.additions}}return s},ve=120,_e=(t,e)=>t&&e?me(t):t,oe=[],ae=(t,e)=>t.filePath===e.filePath&&t.side===e.side&&t.lineNumber===e.lineNumber&&t.spanStart===e.spanStart,ce=(t,e)=>{const i=t.get(e.filePath);return i!==void 0&&i.revision===e.revision},ie=(t,e)=>t.has(e.filePath)&&t.get(e.filePath)===e.revision,le=(t,e)=>{const i=[],y=c=>{for(const p of c){const s=e.get(p.filePath);s?.nestedSources&&s.revision===p.revision?y(s.nestedSources):i.push(p)}};return y(t),i},je=({sources:t,caseSensitive:e=!1})=>{const[i,y]=n.useState(!1),[c,p]=n.useState(""),[s,E]=n.useState(""),[g,x]=n.useState(0),[m,d]=n.useState(()=>new Map),P=n.useRef(m),[L,o]=n.useState(()=>new Map),R=n.useRef(L),k=n.useRef(t);k.current=t;const C=n.useRef(i);C.current=i;const F=n.useRef(!1),b=n.useRef(null),I=n.useCallback(async()=>{if(!F.current){F.current=!0;try{for(;;){if(!C.current)return;const r=le(k.current,P.current).find(O=>!ce(P.current,O)&&!ie(R.current,O));if(!r)return;let f;try{f=await r.load()}catch{const O=new Map(R.current).set(r.filePath,r.revision);R.current=O,o(O);continue}const w=f!==null&&"nestedSources"in f?{revision:r.revision,diff:null,nestedSources:f.nestedSources}:{revision:r.revision,diff:f,nestedSources:null},A=new Map(P.current).set(r.filePath,w);P.current=A,d(A)}}finally{F.current=!1}}},[]);n.useEffect(()=>{i&&I()},[i,I,t]),n.useEffect(()=>{if(c===s)return;const r=window.setTimeout(()=>{E(c),x(0)},ve);return()=>window.clearTimeout(r)},[s,c]);const N=n.useMemo(()=>le(t,m),[m,t]),h=n.useMemo(()=>{if(!i)return oe;const r=s.trim();if(r.length===0)return oe;const f=[];for(const w of N){const A=m.get(w.filePath)?.diff;A&&f.push(...Re(A,w.filePath,r,{caseSensitive:e,layout:w.layout}))}return f},[s,e,i,m,N]),_=n.useRef(h);_.current=h;const[a,l]=n.useState({matches:h,query:s});if(a.matches!==h){const r=a.query===s?a.matches[g]:void 0,f=r?h.findIndex(A=>ae(A,r)):-1,w=f>=0?f:h.length===0?0:Math.min(g,h.length-1);l({matches:h,query:s}),w!==g&&x(w)}const u=n.useCallback(r=>{b.current=null,p(r)},[]),S=n.useCallback(()=>{if(!C.current&&R.current.size>0){const r=new Map;R.current=r,o(r)}y(!0)},[]),v=n.useCallback(()=>{b.current=null,S()},[S]),Q=n.useCallback(()=>{b.current=null,y(!1)},[]),$=n.useCallback((r,f)=>{if(p(r),E(r),S(),f){b.current={...f,query:r};return}b.current=null,x(0)},[S]),j=i&&N.some(r=>!ce(m,r)&&!ie(L,r)),z=i?N.filter(r=>ie(L,r)).length:0;n.useEffect(()=>{const r=b.current;if(!r)return;if(!i||r.query!==s){b.current=null;return}const f=h.findIndex(w=>ae(w,r));if(f>=0){b.current=null,x(h.length===0?0:(f+1)%h.length);return}j||(b.current=null,x(0))},[s,i,j,h]);const D=n.useCallback(()=>{x(r=>{const f=_.current.length;return f===0?0:(r+1)%f})},[]),B=n.useCallback(()=>{x(r=>{const f=_.current.length;return f===0?0:(r-1+f)%f})},[]);return{isOpen:i,open:v,close:Q,query:c,setQuery:u,matches:h,currentIndex:g,currentMatch:h[g]??null,isSearching:j,failedCount:z,next:D,previous:B,openWithQuery:$}},Ce=(t,e)=>t instanceof HTMLElement&&!e?.contains(t)&&(t.isContentEditable||t.matches("input, textarea")),Ne=5e3,Ie="[data-find-surface]",ue=(t,e)=>{if(!(t instanceof Element))return!1;const i=t.closest(Ie);return i!==null&&i!==e},Oe=({find:t,visible:e,rootRef:i,reveal:y})=>{const{isOpen:c,matches:p,currentMatch:s,currentIndex:E,open:g,close:x,openWithQuery:m}=t,d=n.useRef(new Map),[P,L]=n.useState(0),o=n.useRef(y);o.current=y;const R=n.useMemo(()=>{const a=new Map;for(const l of p){const u=a.get(l.filePath);u?u.push(l):a.set(l.filePath,[l])}return a},[p]),k=n.useRef({isOpen:c,currentMatch:s,matchesByFile:R});k.current={isOpen:c,currentMatch:s,matchesByFile:R};const C=n.useCallback((a,l)=>{const u=k.current,S=u.currentMatch;if(!u.isOpen||!S||S.filePath!==a){l.setFindHighlights([],0);return}const v=u.matchesByFile.get(a)??[];l.setFindHighlights(v,v.indexOf(S))},[]),F=n.useRef(null),b=n.useCallback(()=>{const a=F.current;a?.frame!=null&&window.cancelAnimationFrame(a.frame),F.current=null},[]),I=n.useCallback(a=>{const l=F.current;l?.frame!=null&&window.cancelAnimationFrame(l.frame);const u={match:a,frame:null,deadline:performance.now()+Ne};F.current=u;const S=()=>{if(u.frame=null,F.current!==u)return;if(d.current.get(a.filePath)?.scrollToLine({lineNumber:a.lineNumber,side:a.side,align:"center"})){F.current=null;return}performance.now()<u.deadline&&(u.frame=window.requestAnimationFrame(S))};u.frame=window.requestAnimationFrame(S)},[]);n.useEffect(()=>b,[b]);const N=n.useCallback((a,l)=>{if(!l){d.current.delete(a);return}d.current.set(a,l),k.current.isOpen&&C(a,l);const u=F.current;u&&u.match.filePath===a&&I(u.match)},[C,I]);n.useEffect(()=>{for(const[a,l]of d.current)C(a,l)},[C,s,c,R]);const h=n.useRef(null);n.useEffect(()=>{if(!c||!s){h.current=null,b();return}const a=`${E}:${s.filePath}:${s.side}:${s.lineNumber}:${s.spanStart}`;h.current!==a&&(h.current=a,o.current(s,d.current.has(s.filePath)),I(s))},[b,E,s,c,I]),xe("find_in_file",a=>{if(!e||a.defaultPrevented||Ce(document.activeElement,i.current)||ue(a.target,i.current))return!1;g(),L(l=>l+1)}),n.useEffect(()=>{if(!e||!c)return;const a=l=>{if(l.key!=="Escape"||l.defaultPrevented||fe(l))return;const{target:u}=l;if(!(u instanceof Node))return;const S=document.activeElement,v=!S||S===document.body;!i.current?.contains(u)&&!v||ue(u,i.current)||!(u instanceof Element&&u.closest(`[${be}]`)!==null)&&ye(u)||(l.preventDefault(),l.stopPropagation(),x())};return window.addEventListener("keydown",a,!0),()=>window.removeEventListener("keydown",a,!0)},[x,c,i,e]);const _=n.useCallback((a,l)=>{m(l.word,{filePath:a,side:l.side,lineNumber:l.lineNumber,spanStart:l.spanStart}),L(u=>u+1)},[m]);return{registerViewer:N,openOnWord:_,focusNonce:P}};export{Pe as D,Oe as a,_e as r,je as u};
|
|
1
|
+
import{f as de,R as n,j as M}from"./vendor-react--VO_rL_p.js";import{h as me}from"./useBranchPullRequestRequest-CLTracub.js";import{u as pe,Q as he,cn as fe,I as te,y as ge,B as re,ea as xe,eb as ye}from"./useAppFontEffects-C_TEX3sk.js";import"./katex.min-BCtkGOiC.js";const be="data-diff-find-bar",Pe=t=>{const e=de.c(87),{query:i,onQueryChange:y,total:c,currentIndex:p,isSearching:s,failedCount:E,onNext:g,onPrevious:x,onClose:m,focusNonce:d,className:P}=t,L=E===void 0?0:E,{t:o}=pe(),R=n.useRef(null);let k,C;e[0]===Symbol.for("react.memo_cache_sentinel")?(k=()=>{R.current?.focus()},C=[],e[0]=k,e[1]=C):(k=e[0],C=e[1]),n.useEffect(k,C);let F,b;e[2]!==d?(F=()=>{d&&d>0&&(R.current?.focus(),R.current?.select())},b=[d],e[2]=d,e[3]=F,e[4]=b):(F=e[3],b=e[4]),n.useEffect(F,b);let I;e[5]!==s||e[6]!==i?(I=i.trim().length>0&&!s,e[5]=s,e[6]=i,e[7]=I):I=e[7];const N=I;let h;e[8]!==p||e[9]!==N||e[10]!==o||e[11]!==c?(h=c>0?o("diffFind.countAria",{current:p+1,total:c}):N?o("diffFind.noMatches"):void 0,e[8]=p,e[9]=N,e[10]=o,e[11]=c,e[12]=h):h=e[12];const _=h;let a;e[13]!==s||e[14]!==_||e[15]!==o?(a=s?[_,o("diffFind.searchingAria")].filter(Boolean).join(", "):_,e[13]=s,e[14]=_,e[15]=o,e[16]=a):a=e[16];const l=a;let u;e[17]!==m||e[18]!==g||e[19]!==x?(u=T=>{fe(T)||(T.key==="Enter"?(T.preventDefault(),T.shiftKey?x():g()):T.key==="Escape"&&(T.preventDefault(),m()))},e[17]=m,e[18]=g,e[19]=x,e[20]=u):u=e[20];const S=u;let v;e[21]!==P?(v=he("absolute inset-e-3 top-3 z-40 flex flex-col rounded-lg border border-edge bg-[var(--surface-elevated)] px-1.5 py-1 shadow-lg",P),e[21]=P,e[22]=v):v=e[22];let Q;e[23]===Symbol.for("react.memo_cache_sentinel")?(Q=M.jsx(te,{name:"search",className:"ms-0.5 size-3.5 text-muted-foreground"}),e[23]=Q):Q=e[23];let $;e[24]!==y?($=T=>y(T.target.value),e[24]=y,e[25]=$):$=e[25];let j;e[26]!==o?(j=o("diffFind.placeholder"),e[26]=o,e[27]=j):j=e[27];let z;e[28]!==o?(z=o("diffFind.placeholder"),e[28]=o,e[29]=z):z=e[29];let D;e[30]!==S||e[31]!==i||e[32]!==$||e[33]!==j||e[34]!==z?(D=M.jsx(ge,{ref:R,value:i,onChange:$,onKeyDown:S,placeholder:j,"aria-label":z,className:"h-7 w-40 rounded-md px-2 py-0 text-sm md:w-56"}),e[30]=S,e[31]=i,e[32]=$,e[33]=j,e[34]=z,e[35]=D):D=e[35];let B;e[36]!==p||e[37]!==N||e[38]!==s||e[39]!==o||e[40]!==c?(B=N&&c===0?o("diffFind.noMatches"):c>0?`${p+1}/${c}${s?"+":""}`:"",e[36]=p,e[37]=N,e[38]=s,e[39]=o,e[40]=c,e[41]=B):B=e[41];let r;e[42]!==l||e[43]!==B?(r=M.jsx("span",{className:"min-w-12 px-1 text-center typography-micro text-muted-foreground tabular-nums","aria-live":"polite","aria-label":l,children:B}),e[42]=l,e[43]=B,e[44]=r):r=e[44];let f;e[45]!==o?(f=o("diffFind.previousAria"),e[45]=o,e[46]=f):f=e[46];let w;e[47]!==o?(w=o("diffFind.previousAria"),e[47]=o,e[48]=w):w=e[48];const A=c===0;let O;e[49]===Symbol.for("react.memo_cache_sentinel")?(O=M.jsx(te,{name:"arrow-up",className:"size-3.5"}),e[49]=O):O=e[49];let H;e[50]!==x||e[51]!==f||e[52]!==w||e[53]!==A?(H=M.jsx(re,{type:"button",variant:"ghost",size:"sm",className:"size-6 p-0 text-muted-foreground",onClick:x,title:f,"aria-label":w,disabled:A,children:O}),e[50]=x,e[51]=f,e[52]=w,e[53]=A,e[54]=H):H=e[54];let K;e[55]!==o?(K=o("diffFind.nextAria"),e[55]=o,e[56]=K):K=e[56];let W;e[57]!==o?(W=o("diffFind.nextAria"),e[57]=o,e[58]=W):W=e[58];const se=c===0;let Y;e[59]===Symbol.for("react.memo_cache_sentinel")?(Y=M.jsx(te,{name:"arrow-down",className:"size-3.5"}),e[59]=Y):Y=e[59];let U;e[60]!==g||e[61]!==K||e[62]!==W||e[63]!==se?(U=M.jsx(re,{type:"button",variant:"ghost",size:"sm",className:"size-6 p-0 text-muted-foreground",onClick:g,title:K,"aria-label":W,disabled:se,children:Y}),e[60]=g,e[61]=K,e[62]=W,e[63]=se,e[64]=U):U=e[64];let q;e[65]!==o?(q=o("diffFind.closeAria"),e[65]=o,e[66]=q):q=e[66];let J;e[67]!==o?(J=o("diffFind.closeAria"),e[67]=o,e[68]=J):J=e[68];let Z;e[69]===Symbol.for("react.memo_cache_sentinel")?(Z=M.jsx(te,{name:"close",className:"size-3.5"}),e[69]=Z):Z=e[69];let G;e[70]!==m||e[71]!==q||e[72]!==J?(G=M.jsx(re,{type:"button",variant:"ghost",size:"sm",className:"size-6 p-0 text-muted-foreground",onClick:m,title:q,"aria-label":J,children:Z}),e[70]=m,e[71]=q,e[72]=J,e[73]=G):G=e[73];let V;e[74]!==D||e[75]!==r||e[76]!==H||e[77]!==U||e[78]!==G?(V=M.jsxs("div",{className:"flex items-center gap-1",children:[Q,D,r,H,U,G]}),e[74]=D,e[75]=r,e[76]=H,e[77]=U,e[78]=G,e[79]=V):V=e[79];let X;e[80]!==L||e[81]!==o?(X=L>0&&M.jsx("p",{className:"w-0 min-w-full px-1 pb-0.5 typography-micro text-status-warning",children:o("diffFind.failedCount",{count:L})}),e[80]=L,e[81]=o,e[82]=X):X=e[82];let ee;return e[83]!==v||e[84]!==V||e[85]!==X?(ee=M.jsxs("div",{"data-diff-find-bar":"",className:v,children:[V,X]}),e[83]=v,e[84]=V,e[85]=X,e[86]=ee):ee=e[86],ee},Se=/[.*+?^${}()|[\]\\]/g,we=t=>t.replace(Se,"\\$&"),Fe=t=>t.replace(/\r?\n$/,""),Ee=(t,e,i)=>{const y=new RegExp(we(e),i?"g":"gi"),c=[];for(const p of t.matchAll(y))c.push({spanStart:p.index??0,spanLength:p[0].length});return c},ne=(t,e,i,y,c,p,s)=>{if(y<1)return;const E=Fe(c);for(const g of Ee(E,p,s))t.push({filePath:e,side:i,lineNumber:y,spanStart:g.spanStart,spanLength:g.spanLength})},Re=(t,e,i,y)=>{if(i.length===0)return[];const c=y.caseSensitive??!1,p=y.layout==="inline",s=[];for(const E of t.hunks){let g=E.additionStart,x=E.deletionStart;for(const m of E.hunkContent){if(m.type==="context"){for(let d=0;d<m.lines;d+=1)p||ne(s,e,"deletions",x+d,t.deletionLines[m.deletionLineIndex+d],i,c),ne(s,e,"additions",g+d,t.additionLines[m.additionLineIndex+d],i,c);g+=m.lines,x+=m.lines;continue}for(let d=0;d<m.deletions;d+=1)ne(s,e,"deletions",x+d,t.deletionLines[m.deletionLineIndex+d],i,c);x+=m.deletions;for(let d=0;d<m.additions;d+=1)ne(s,e,"additions",g+d,t.additionLines[m.additionLineIndex+d],i,c);g+=m.additions}}return s},ve=120,_e=(t,e)=>t&&e?me(t):t,oe=[],ae=(t,e)=>t.filePath===e.filePath&&t.side===e.side&&t.lineNumber===e.lineNumber&&t.spanStart===e.spanStart,ce=(t,e)=>{const i=t.get(e.filePath);return i!==void 0&&i.revision===e.revision},ie=(t,e)=>t.has(e.filePath)&&t.get(e.filePath)===e.revision,le=(t,e)=>{const i=[],y=c=>{for(const p of c){const s=e.get(p.filePath);s?.nestedSources&&s.revision===p.revision?y(s.nestedSources):i.push(p)}};return y(t),i},je=({sources:t,caseSensitive:e=!1})=>{const[i,y]=n.useState(!1),[c,p]=n.useState(""),[s,E]=n.useState(""),[g,x]=n.useState(0),[m,d]=n.useState(()=>new Map),P=n.useRef(m),[L,o]=n.useState(()=>new Map),R=n.useRef(L),k=n.useRef(t);k.current=t;const C=n.useRef(i);C.current=i;const F=n.useRef(!1),b=n.useRef(null),I=n.useCallback(async()=>{if(!F.current){F.current=!0;try{for(;;){if(!C.current)return;const r=le(k.current,P.current).find(O=>!ce(P.current,O)&&!ie(R.current,O));if(!r)return;let f;try{f=await r.load()}catch{const O=new Map(R.current).set(r.filePath,r.revision);R.current=O,o(O);continue}const w=f!==null&&"nestedSources"in f?{revision:r.revision,diff:null,nestedSources:f.nestedSources}:{revision:r.revision,diff:f,nestedSources:null},A=new Map(P.current).set(r.filePath,w);P.current=A,d(A)}}finally{F.current=!1}}},[]);n.useEffect(()=>{i&&I()},[i,I,t]),n.useEffect(()=>{if(c===s)return;const r=window.setTimeout(()=>{E(c),x(0)},ve);return()=>window.clearTimeout(r)},[s,c]);const N=n.useMemo(()=>le(t,m),[m,t]),h=n.useMemo(()=>{if(!i)return oe;const r=s.trim();if(r.length===0)return oe;const f=[];for(const w of N){const A=m.get(w.filePath)?.diff;A&&f.push(...Re(A,w.filePath,r,{caseSensitive:e,layout:w.layout}))}return f},[s,e,i,m,N]),_=n.useRef(h);_.current=h;const[a,l]=n.useState({matches:h,query:s});if(a.matches!==h){const r=a.query===s?a.matches[g]:void 0,f=r?h.findIndex(A=>ae(A,r)):-1,w=f>=0?f:h.length===0?0:Math.min(g,h.length-1);l({matches:h,query:s}),w!==g&&x(w)}const u=n.useCallback(r=>{b.current=null,p(r)},[]),S=n.useCallback(()=>{if(!C.current&&R.current.size>0){const r=new Map;R.current=r,o(r)}y(!0)},[]),v=n.useCallback(()=>{b.current=null,S()},[S]),Q=n.useCallback(()=>{b.current=null,y(!1)},[]),$=n.useCallback((r,f)=>{if(p(r),E(r),S(),f){b.current={...f,query:r};return}b.current=null,x(0)},[S]),j=i&&N.some(r=>!ce(m,r)&&!ie(L,r)),z=i?N.filter(r=>ie(L,r)).length:0;n.useEffect(()=>{const r=b.current;if(!r)return;if(!i||r.query!==s){b.current=null;return}const f=h.findIndex(w=>ae(w,r));if(f>=0){b.current=null,x(h.length===0?0:(f+1)%h.length);return}j||(b.current=null,x(0))},[s,i,j,h]);const D=n.useCallback(()=>{x(r=>{const f=_.current.length;return f===0?0:(r+1)%f})},[]),B=n.useCallback(()=>{x(r=>{const f=_.current.length;return f===0?0:(r-1+f)%f})},[]);return{isOpen:i,open:v,close:Q,query:c,setQuery:u,matches:h,currentIndex:g,currentMatch:h[g]??null,isSearching:j,failedCount:z,next:D,previous:B,openWithQuery:$}},Ce=(t,e)=>t instanceof HTMLElement&&!e?.contains(t)&&(t.isContentEditable||t.matches("input, textarea")),Ne=5e3,Ie="[data-find-surface]",ue=(t,e)=>{if(!(t instanceof Element))return!1;const i=t.closest(Ie);return i!==null&&i!==e},Oe=({find:t,visible:e,rootRef:i,reveal:y})=>{const{isOpen:c,matches:p,currentMatch:s,currentIndex:E,open:g,close:x,openWithQuery:m}=t,d=n.useRef(new Map),[P,L]=n.useState(0),o=n.useRef(y);o.current=y;const R=n.useMemo(()=>{const a=new Map;for(const l of p){const u=a.get(l.filePath);u?u.push(l):a.set(l.filePath,[l])}return a},[p]),k=n.useRef({isOpen:c,currentMatch:s,matchesByFile:R});k.current={isOpen:c,currentMatch:s,matchesByFile:R};const C=n.useCallback((a,l)=>{const u=k.current,S=u.currentMatch;if(!u.isOpen||!S||S.filePath!==a){l.setFindHighlights([],0);return}const v=u.matchesByFile.get(a)??[];l.setFindHighlights(v,v.indexOf(S))},[]),F=n.useRef(null),b=n.useCallback(()=>{const a=F.current;a?.frame!=null&&window.cancelAnimationFrame(a.frame),F.current=null},[]),I=n.useCallback(a=>{const l=F.current;l?.frame!=null&&window.cancelAnimationFrame(l.frame);const u={match:a,frame:null,deadline:performance.now()+Ne};F.current=u;const S=()=>{if(u.frame=null,F.current!==u)return;if(d.current.get(a.filePath)?.scrollToLine({lineNumber:a.lineNumber,side:a.side,align:"center"})){F.current=null;return}performance.now()<u.deadline&&(u.frame=window.requestAnimationFrame(S))};u.frame=window.requestAnimationFrame(S)},[]);n.useEffect(()=>b,[b]);const N=n.useCallback((a,l)=>{if(!l){d.current.delete(a);return}d.current.set(a,l),k.current.isOpen&&C(a,l);const u=F.current;u&&u.match.filePath===a&&I(u.match)},[C,I]);n.useEffect(()=>{for(const[a,l]of d.current)C(a,l)},[C,s,c,R]);const h=n.useRef(null);n.useEffect(()=>{if(!c||!s){h.current=null,b();return}const a=`${E}:${s.filePath}:${s.side}:${s.lineNumber}:${s.spanStart}`;h.current!==a&&(h.current=a,o.current(s,d.current.has(s.filePath)),I(s))},[b,E,s,c,I]),xe("find_in_file",a=>{if(!e||a.defaultPrevented||Ce(document.activeElement,i.current)||ue(a.target,i.current))return!1;g(),L(l=>l+1)}),n.useEffect(()=>{if(!e||!c)return;const a=l=>{if(l.key!=="Escape"||l.defaultPrevented||fe(l))return;const{target:u}=l;if(!(u instanceof Node))return;const S=document.activeElement,v=!S||S===document.body;!i.current?.contains(u)&&!v||ue(u,i.current)||!(u instanceof Element&&u.closest(`[${be}]`)!==null)&&ye(u)||(l.preventDefault(),l.stopPropagation(),x())};return window.addEventListener("keydown",a,!0),()=>window.removeEventListener("keydown",a,!0)},[x,c,i,e]);const _=n.useCallback((a,l)=>{m(l.word,{filePath:a,side:l.side,lineNumber:l.lineNumber,spanStart:l.spanStart}),L(u=>u+1)},[m]);return{registerViewer:N,openOnWord:_,focusNonce:P}};export{Pe as D,Oe as a,_e as r,je as u};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{R as w,f as fe,j as t}from"./vendor-react--VO_rL_p.js";import{u as At}from"./vendor-tanstack-react-virtual-C_IilPt1.js";import{u as ue,aa as et,ab as tt,I as $,ac as it,e8 as It,Q as ae,K as Dt,B as Y,gg as Et,a_ as zt,t as ze,q as Te,D as Re,l as Oe,F as Pe,o as Ze,gh as Tt,aK as Rt,$ as st,gi as nt,n as at,gj as Ot,aR as Pt,A as de,C as Ft,bB as ht,bC as pt,gk as gt,bO as xt,gl as yt,gm as Lt,gn as bt,go as He,gp as $t,gq as vt,gr as Mt,gs as Ht,gt as wt,gu as jt,f8 as qe,bo as lt,bp as rt,bq as ot,br as ct,bs as dt,gv as Gt,gw as _t,bN as Le,gx as Nt,gy as Bt,x as ut,gz as Kt,gA as qt}from"./useAppFontEffects-DpDiWkkc.js";import{u as Ge,bP as Ct,bQ as Ut,aG as _e}from"./katex.min-BBVkbKQY.js";import{al as Jt,at as Ee,au as St,av as kt,aw as Qt,Q as Wt,O as Xt,P as Yt,ax as Zt,ay as ei,az as ti,aA as ii}from"./runtimeEndpointReset-BPYbd6uu.js";import{a as si,b as ni,c as ai,f as li,T as Ue}from"./useBranchPullRequestRequest-Cbky4ZeH.js";import{C as ri}from"./ChangedPathLabel-DV4XTf6K.js";const oi=w.memo(function(e){const i=fe.c(66),{file:n,actionLabel:f,actionSymbol:h,onAction:m,onViewDiff:u,onRevert:o,isReverting:p,stats:D,rowPaddingClassName:b,indentPx:r,actionAtStart:j,nameOnly:C,showRevert:P}=e,N=r===void 0?0:r,v=j===void 0?!1:j,c=C===void 0?!1:C,g=P===void 0?!0:P;let R;i[0]!==n?(R=Jt(n),i[0]=n,i[1]=R):R=i[1];const E=R,{t:M}=ue();let G;i[2]!==E.descriptionKey||i[3]!==M?(G=M(E.descriptionKey),i[2]=E.descriptionKey,i[3]=M,i[4]=G):G=i[4];const L=G,O=D?.insertions??0,S=D?.deletions??0;let k;i[5]!==m||i[6]!==u?(k=ie=>{ie.key===" "?(ie.preventDefault(),m()):ie.key==="Enter"&&(ie.preventDefault(),u())},i[5]=m,i[6]=u,i[7]=k):k=i[7];const I=k;let x;i[8]!==m?(x=ie=>{ie.preventDefault(),ie.stopPropagation(),m()},i[8]=m,i[9]=x):x=i[9];const T=x;let _;i[10]!==o?(_=ie=>{ie.preventDefault(),ie.stopPropagation(),o()},i[10]=o,i[11]=_):_=i[11];const H=_;let B;i[12]!==f||i[13]!==h||i[14]!==T?(B=t.jsx("button",{type:"button",onClick:T,className:"flex size-5 shrink-0 items-center justify-center rounded typography-micro font-semibold text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)]","aria-label":f,title:f,children:h}),i[12]=f,i[13]=h,i[14]=T,i[15]=B):B=i[15];const q=B;let K;i[16]===Symbol.for("react.memo_cache_sentinel")?(K={color:"var(--status-success)"},i[16]=K):K=i[16];let V;i[17]!==O?(V=t.jsxs("span",{style:K,children:["+",O]}),i[17]=O,i[18]=V):V=i[18];let U,F;i[19]===Symbol.for("react.memo_cache_sentinel")?(U=t.jsx("span",{className:"text-muted-foreground mx-0.5",children:"/"}),F={color:"var(--status-error)"},i[19]=U,i[20]=F):(U=i[19],F=i[20]);let J;i[21]!==S?(J=t.jsxs("span",{style:F,children:["-",S]}),i[21]=S,i[22]=J):J=i[22];let Z;i[23]!==V||i[24]!==J?(Z=t.jsxs("span",{className:"shrink-0 typography-micro",children:[V,U,J]}),i[23]=V,i[24]=J,i[25]=Z):Z=i[25];const Q=Z;let se;i[26]!==n.path||i[27]!==H||i[28]!==p||i[29]!==g||i[30]!==M?(se=g?t.jsxs(et,{children:[t.jsx(tt,{asChild:!0,children:t.jsx("button",{type:"button",onClick:H,disabled:p,className:"flex size-5 shrink-0 items-center justify-center rounded text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50","aria-label":M("gitView.changes.revertFileAria",{path:n.path}),children:p?t.jsx($,{name:"loader-4",className:"size-3.5 animate-spin"}):t.jsx($,{name:"arrow-go-back",className:"size-3.5"})})}),t.jsx(it,{sideOffset:8,children:M("gitView.changes.revertFileTooltip")})]}):null,i[26]=n.path,i[27]=H,i[28]=p,i[29]=g,i[30]=M,i[31]=se):se=i[31];const ee=se,a=`group flex items-center gap-2 py-1.5 cursor-pointer ${b??"px-3"}`;let d;i[32]!==N?(d=N>0?{paddingInlineStart:`${N}px`}:void 0,i[32]=N,i[33]=d):d=i[33];const s=v?q:null;let y;i[34]!==E.color?(y={color:E.color},i[34]=E.color,i[35]=y):y=i[35];let A;i[36]!==E.code||i[37]!==L||i[38]!==y?(A=t.jsx("span",{className:"typography-micro font-semibold w-4 text-center uppercase",style:y,title:L,"aria-label":L,children:E.code}),i[36]=E.code,i[37]=L,i[38]=y,i[39]=A):A=i[39];let z;i[40]!==n.path?(z=t.jsx(It,{filePath:n.path,className:"h-3.5 w-3.5 shrink-0"}),i[40]=n.path,i[41]=z):z=i[41];let W;e:{if(n.path.lastIndexOf("/")===-1||c){let re;i[42]===Symbol.for("react.memo_cache_sentinel")?(re={direction:"rtl",unicodeBidi:"plaintext"},i[42]=re):re=i[42];const he=n.path;let oe;i[43]!==n.path?(oe=si(n.path),i[43]=n.path,i[44]=oe):oe=i[44];let me;i[45]!==n.path||i[46]!==oe?(me=t.jsx("span",{className:"oc-ui-start-align flex-1 min-w-0 truncate typography-ui-label text-foreground",style:re,title:he,children:oe}),i[45]=n.path,i[46]=oe,i[47]=me):me=i[47],W=me;break e}let le;i[48]!==n.path?(le=t.jsx(ri,{path:n.path,className:"flex-1 typography-ui-label"}),i[48]=n.path,i[49]=le):le=i[49],W=le}let te;i[50]!==v||i[51]!==q||i[52]!==p||i[53]!==ee||i[54]!==Q?(te=v?t.jsxs(t.Fragment,{children:[Q,ee]}):t.jsxs("span",{className:"flex shrink-0 items-center justify-items-end gap-2 md:grid",children:[t.jsx("span",{className:ae("md:col-start-1 md:row-start-1",p?"md:invisible":"md:group-hover:invisible md:group-focus-within:invisible"),children:Q}),t.jsxs("span",{className:ae("flex items-center gap-2 md:col-start-1 md:row-start-1",!p&&"md:invisible md:group-hover:visible md:group-focus-within:visible"),children:[ee,q]})]}),i[50]=v,i[51]=q,i[52]=p,i[53]=ee,i[54]=Q,i[55]=te):te=i[55];let ne;return i[56]!==I||i[57]!==u||i[58]!==a||i[59]!==d||i[60]!==s||i[61]!==A||i[62]!==z||i[63]!==W||i[64]!==te?(ne=t.jsxs("div",{className:a,role:"button",tabIndex:0,onClick:u,onKeyDown:I,style:d,children:[s,A,z,W,te]}),i[56]=I,i[57]=u,i[58]=a,i[59]=d,i[60]=s,i[61]=A,i[62]=z,i[63]=W,i[64]=te,i[65]=ne):ne=i[65],ne}),ci=1e3,mt=34,Je=30,$e="ps-0 pe-2",Qe=(l,e)=>`${l} ${e}`,Fi=({groups:l,diffStats:e,revertingPaths:i,isRevertingAll:n=!1,headerBackgroundClassName:f="bg-sidebar",onVisiblePathsChange:h,onRevertAll:m,onRevertDirectory:u})=>{const{t:o}=ue(),p=w.useRef(null),b=Ge(a=>a.gitChangesViewMode)==="tree",r=w.useMemo(()=>l.filter(a=>a.entries.length>0),[l]),[j,C]=w.useState(new Set),[P,N]=w.useState(new Set),[v,c]=w.useState(!1),[g,R]=w.useState(null),E=Dt(),{confirm:M}=E,G=w.useCallback(async(a,d)=>{await M({title:o("gitView.changes.revertFileDialogTitle"),message:o("gitView.changes.revertFileDescription",{path:d}),action:o("gitView.changes.revertFileConfirm"),destructive:!0})&&a.onRevertFile(d)},[M,o]),L=w.useMemo(()=>r.map(a=>ni(a.entries)),[r]),O=w.useMemo(()=>{const a=[];return r.forEach((d,s)=>{Array.from(L[s]?.children.values()??[]).forEach(y=>{a.push(Qe(d.id,ai(y).node.path))})}),a},[L,r]);w.useEffect(()=>{b&&N(a=>{const d=new Set,s=new Set(O);return a.forEach(y=>{(y.slice(y.indexOf(" ")+1).includes("/")||s.has(y))&&d.add(y)}),O.forEach(y=>d.add(y)),d})},[b,O]);const S=w.useMemo(()=>{const a=[];return r.forEach((d,s)=>{if(a.push({type:"header",key:`header:${d.id}`,groupIndex:s}),!j.has(d.id)){if(b){const y=new Set;P.forEach(z=>{z.startsWith(`${d.id} `)&&y.add(z.slice(d.id.length+1))}),li(L[s],y).forEach(z=>{z.kind==="file"?a.push({type:"file",key:`${d.id}:${z.key}`,groupIndex:s,file:z.file,depth:z.depth}):a.push({type:"directory",key:`${d.id}:${z.key}`,groupIndex:s,directory:z.directory,label:z.label,depth:z.depth})});return}d.entries.forEach(y=>{a.push({type:"file",key:`${d.id}:file:${y.path}`,groupIndex:s,file:y,depth:0})})}}),m&&r.length>0&&a.push({type:"revert-all",key:"revert-all"}),a},[j,P,b,m,L,r]),k=S.length,I=k>=ci,x=At({count:k,enabled:I,getScrollElement:()=>p.current,estimateSize:()=>mt,overscan:12,getItemKey:a=>S[a]?.key??a}),T=x.getVirtualItems(),_=w.useMemo(()=>{if(!I)return 0;const a=p.current?.scrollTop??0;return T.find(s=>s.end>a)?.index??0},[I,T,p]);w.useEffect(()=>{if(!h)return;const a=d=>d&&d.type==="file"?d.file.path:null;if(k===0){h([]);return}if(!I){const d=[];for(const s of S)if(s.type==="file"&&(d.push(s.file.path),d.length>=Je))break;h(d);return}h(S.slice(_,_+Math.ceil((p.current?.clientHeight??0)/mt)+Je).map(d=>a(d)).filter(d=>!!d).slice(0,Je))},[h,k,S,I,_]);const H=w.useCallback(a=>{C(d=>{const s=new Set(d);return s.has(a)?s.delete(a):s.add(a),s})},[]),B=w.useCallback((a,d)=>{N(s=>{const y=new Set(s),A=Qe(a,d);return y.has(A)?y.delete(A):y.add(A),y})},[]),q=w.useMemo(()=>{const a=new Set;return r.forEach(d=>d.entries.forEach(s=>a.add(s.path))),Array.from(a)},[r]),K=q.length,V=g?n||g.paths.some(a=>i.has(a)):!1,U=w.useCallback(async()=>{!m||n||q.length===0||(await m(q),c(!1))},[q,n,m]),F=w.useCallback(async()=>{!u||!g||V||(await u(g.paths),R(null))},[V,u,g]),J=w.useCallback((a,d)=>{const s=j.has(a.id),y=a.entries.length;return t.jsxs("div",{className:ae("sticky top-0 z-10 flex items-center gap-2 py-2",f,$e,!d&&"mt-1 border-t border-edge-muted"),children:[t.jsx("button",{type:"button",onClick:()=>a.onActionAll(a.entries.map(A=>A.path)),className:"flex size-5 shrink-0 items-center justify-center rounded typography-micro font-semibold text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)]","aria-label":a.actionAllLabel,title:a.actionAllLabel,children:a.actionSymbol}),t.jsxs("button",{type:"button",onClick:()=>H(a.id),className:"flex min-w-0 flex-1 items-center gap-2 rounded text-start focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)]","aria-expanded":!s,children:[t.jsx("h3",{className:"truncate typography-ui-header font-semibold text-foreground",children:a.title}),t.jsx("span",{className:"typography-meta text-muted-foreground",children:y}),t.jsx($,{name:"arrow-down-s",className:ae("size-3.5 shrink-0 text-muted-foreground transition-transform",s&&"-rotate-90 rtl:rotate-90")})]})]})},[j,f,H]),Z=w.useCallback((a,d,s,y)=>{const A=P.has(Qe(a.id,d.path)),z=d.files.map(te=>te.path),W=n||z.some(te=>i.has(te));return t.jsxs("div",{className:ae("group flex items-center gap-2 py-1.5 text-muted-foreground hover:text-foreground",$e),style:{paddingInlineStart:`${y*Ue}px`},children:[t.jsxs("button",{type:"button",onClick:()=>B(a.id,d.path),"aria-expanded":A,className:"flex min-w-0 flex-1 items-center gap-1.5 rounded text-start focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":A?o("gitView.changes.collapseDirectoryAria",{path:d.path}):o("gitView.changes.expandDirectoryAria",{path:d.path}),children:[t.jsx("span",{className:"flex w-4 shrink-0 items-center justify-center",children:t.jsx($,{name:"arrow-right-s",className:ae("size-3.5 transition-transform",A&&"rotate-90 rtl:-rotate-90")})}),t.jsx("span",{className:"min-w-0 truncate typography-ui-label",title:d.path,children:s}),A?null:t.jsx("span",{className:"shrink-0 typography-micro tabular-nums text-muted-foreground",children:d.files.length})]}),t.jsxs("span",{className:ae("flex shrink-0 items-center gap-2 transition-opacity",!W&&"md:opacity-0 md:group-hover:opacity-100 md:group-focus-within:opacity-100"),children:[a.showRevertActions!==!1&&u?t.jsx("button",{type:"button",onClick:()=>R({path:d.path,paths:z,count:z.length}),disabled:W,className:"flex size-5 shrink-0 items-center justify-center rounded text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)] disabled:cursor-not-allowed disabled:opacity-50","aria-label":o("gitView.changes.revertDirectoryAria",{path:d.path}),title:o("gitView.changes.revertDirectoryTooltip"),children:W?t.jsx($,{name:"loader-4",className:"size-3.5 animate-spin"}):t.jsx($,{name:"arrow-go-back",className:"size-3.5"})}):null,t.jsx("button",{type:"button",onClick:()=>a.onActionAll(d.files.map(te=>te.path)),className:"flex size-5 shrink-0 items-center justify-center rounded typography-micro font-semibold text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)]","aria-label":o(a.actionSymbol==="+"?"gitView.changes.stageDirectoryAria":"gitView.changes.unstageDirectoryAria",{path:d.path}),title:o(a.actionSymbol==="+"?"gitView.changes.stageDirectoryAria":"gitView.changes.unstageDirectoryAria",{path:d.path}),children:a.actionSymbol})]})]})},[P,n,u,i,o,B]),Q=w.useCallback((a,d)=>{if(a.type==="revert-all")return t.jsx("div",{className:ae("flex justify-end py-2",$e),children:t.jsxs(Y,{variant:"ghost",size:"sm",onClick:()=>c(!0),disabled:n,className:"gap-1.5 text-[var(--status-error)] hover:bg-[var(--status-error)]/10 hover:text-[var(--status-error)]",children:[t.jsx($,{name:"arrow-go-back",className:"size-3.5"}),o("gitView.changes.revertAll")]})});const s=r[a.groupIndex];if(!s)return null;if(a.type==="header")return J(s,d);if(a.type==="directory")return Z(s,a.directory,a.label,a.depth);const y=a.file;return t.jsx(oi,{file:y,actionLabel:s.getActionLabel(y.path),actionSymbol:s.actionSymbol,onAction:()=>s.onActionFile(y.path),stats:e?.[s.statsScope]?.[y.path],onViewDiff:()=>s.onViewDiff(y.path),onRevert:()=>{G(s,y.path)},isReverting:i.has(y.path)||n,rowPaddingClassName:$e,indentPx:a.depth*Ue,actionAtStart:!b,nameOnly:b,showRevert:s.showRevertActions!==!1})},[e,n,b,Z,J,G,i,o,r]),se=a=>a.type!=="file"&&a.type!=="directory"?null:Array.from({length:a.depth},(d,s)=>t.jsx("span",{"aria-hidden":!0,className:"pointer-events-none absolute inset-y-0 w-px bg-edge",style:{insetInlineStart:`${s*Ue+8}px`}},s)),ee=w.useCallback(a=>{if(b)return!1;const d=S[a],s=S[a-1];return!d||!s||d.type!=="file"&&d.type!=="directory"||s.type!=="file"&&s.type!=="directory"?!1:s.groupIndex===d.groupIndex},[b,S]);return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"relative flex h-full min-h-0 w-full flex-col overflow-hidden",children:[t.jsx(Et,{ref:p,className:"overlay-scrollbar-target overlay-scrollbar-container min-h-0 w-full flex-1 overflow-x-hidden overflow-y-auto",children:I?t.jsx("div",{style:{height:x.getTotalSize(),position:"relative"},children:T.map(a=>{const d=S[a.index];return d?t.jsxs("div",{"data-index":a.index,ref:x.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${a.start}px)`},className:ae(ee(a.index)&&"before:pointer-events-none before:absolute before:inset-s-0 before:inset-e-2 before:top-0 before:border-t before:border-edge"),children:[se(d),Q(d,a.index===0)]},d.key):null})}):t.jsx("div",{role:"list","aria-label":o("gitView.changes.changedFilesAria"),children:S.map((a,d)=>t.jsxs("div",{className:ae("relative",ee(d)&&"before:pointer-events-none before:absolute before:inset-s-0 before:inset-e-2 before:top-0 before:border-t before:border-edge"),children:[se(a),Q(a,d===0)]},a.key))})}),t.jsx(zt,{containerRef:p,disableHorizontal:!0})]}),E.dialog,t.jsx(ze,{open:v,onOpenChange:a=>{!n&&!a&&c(!1)},children:t.jsxs(Te,{className:"max-w-md",children:[t.jsxs(Re,{children:[t.jsx(Oe,{children:o("gitView.changes.revertAllDialogTitle")}),t.jsx(Pe,{children:K===1?o("gitView.changes.revertAllDescriptionSingle",{count:K}):o("gitView.changes.revertAllDescriptionPlural",{count:K})})]}),t.jsxs(Ze,{children:[t.jsx(Y,{variant:"outline",size:"sm",onClick:()=>c(!1),disabled:n,children:o("gitView.common.cancel")}),t.jsx(Y,{variant:"destructive",size:"sm",onClick:()=>{U()},disabled:n,children:o(n?"gitView.changes.reverting":"gitView.changes.revertAll")})]})]})}),t.jsx(ze,{open:!!g,onOpenChange:a=>{!V&&!a&&R(null)},children:t.jsxs(Te,{className:"max-w-md",children:[t.jsxs(Re,{children:[t.jsx(Oe,{children:o("gitView.changes.revertDirectoryDialogTitle")}),t.jsx(Pe,{children:g?g.count===1?o("gitView.changes.revertDirectoryDescriptionSingle",{count:g.count,path:g.path}):o("gitView.changes.revertDirectoryDescriptionPlural",{count:g.count,path:g.path}):null})]}),t.jsxs(Ze,{children:[t.jsx(Y,{variant:"outline",size:"sm",onClick:()=>R(null),disabled:V,children:o("gitView.common.cancel")}),t.jsx(Y,{variant:"destructive",size:"sm",onClick:()=>{F()},disabled:V||!g,children:o(V?"gitView.changes.reverting":"gitView.changes.revertDirectory")})]})]})})]})},We=38,Me=200,di=l=>{const e=fe.c(26),{value:i,onChange:n,onSubmit:f,placeholder:h,disabled:m,hasTouchInput:u,isMobile:o}=l,p=m===void 0?!1:m,D=u===void 0?!1:u,b=o===void 0?!1:o,{t:r}=ue(),j=w.useRef(null),C=Tt(j),P=Ge(ui);let N;e[0]===Symbol.for("react.memo_cache_sentinel")?(N=()=>{const x=j.current;if(!x)return;const T=document.activeElement===x,_=()=>{x.style.height=`${We}px`;const B=x.scrollHeight,q=Math.min(Math.max(B,We),Me);x.style.height=`${q}px`,x.style.overflowY=B>Me?"auto":"hidden",B>Me&&!T&&(x.scrollTop=x.scrollHeight)};_();const H=window.requestAnimationFrame(_);return()=>{window.cancelAnimationFrame(H)}},e[0]=N):N=e[0];let v;e[1]!==i?(v=[i],e[1]=i,e[2]=v):v=e[2],w.useLayoutEffect(N,v);let c;e[3]!==n?(c=x=>n(x.target.value),e[3]=n,e[4]=c):c=e[4];let g;e[5]!==f?(g=x=>{x.key==="Enter"&&(x.metaKey||x.ctrlKey)&&!x.shiftKey&&!x.altKey&&(x.preventDefault(),f?.())},e[5]=f,e[6]=g):g=e[6];let R;e[7]!==h||e[8]!==r?(R=h??r("gitView.commit.messagePlaceholder"),e[7]=h,e[8]=r,e[9]=R):R=e[9];const E=D?"on":"off",M=D?"sentences":"off",G=b||P,L=p&&"opacity-50";let O;e[10]!==L?(O=ae("oc-raised oc-field w-full rounded-lg bg-surface-elevated px-3 py-2 typography-ui-label text-foreground placeholder:text-muted-foreground","resize-none outline-none",L),e[10]=L,e[11]=O):O=e[11];let S;e[12]===Symbol.for("react.memo_cache_sentinel")?(S={minHeight:We,maxHeight:Me},e[12]=S):S=e[12];let k;e[13]!==p||e[14]!==M||e[15]!==G||e[16]!==O||e[17]!==c||e[18]!==g||e[19]!==R||e[20]!==E||e[21]!==i?(k=t.jsx("textarea",{ref:j,value:i,onChange:c,onKeyDown:g,placeholder:R,rows:1,disabled:p,autoCorrect:E,autoCapitalize:M,spellCheck:G,className:O,style:S}),e[13]=p,e[14]=M,e[15]=G,e[16]=O,e[17]=c,e[18]=g,e[19]=R,e[20]=E,e[21]=i,e[22]=k):k=e[22];let I;return e[23]!==C||e[24]!==k?(I=t.jsxs(t.Fragment,{children:[k,C]}),e[23]=C,e[24]=k,e[25]=I):I=e[25],I};function ui(l){return l.inputSpellcheckEnabled}const mi=l=>{const e=fe.c(30),{highlights:i,onInsert:n}=l,{t:f}=ue();if(i.length===0)return null;let h;e[0]!==i||e[1]!==n?(h=()=>{n(i)},e[0]=i,e[1]=n,e[2]=h):h=e[2];const m=h;let u;e[3]!==f?(u=f("gitView.commit.aiHighlights.title"),e[3]=f,e[4]=u):u=e[4];let o;e[5]!==u?(o=t.jsx("p",{className:"typography-micro text-muted-foreground",children:u}),e[5]=u,e[6]=o):o=e[6];let p;e[7]!==f?(p=f("gitView.commit.aiHighlights.insertAria"),e[7]=f,e[8]=p):p=e[8];let D;e[9]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx($,{name:"arrow-down",className:"size-4"}),e[9]=D):D=e[9];let b;e[10]!==m||e[11]!==p?(b=t.jsx(tt,{asChild:!0,children:t.jsx(Y,{variant:"ghost",size:"icon",className:"size-6",onClick:m,"aria-label":p,children:D})}),e[10]=m,e[11]=p,e[12]=b):b=e[12];let r;e[13]!==f?(r=f("gitView.commit.aiHighlights.insertTooltip"),e[13]=f,e[14]=r):r=e[14];let j;e[15]!==r?(j=t.jsx(it,{sideOffset:8,children:r}),e[15]=r,e[16]=j):j=e[16];let C;e[17]!==b||e[18]!==j?(C=t.jsxs(et,{children:[b,j]}),e[17]=b,e[18]=j,e[19]=C):C=e[19];let P;e[20]!==o||e[21]!==C?(P=t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[o,C]}),e[20]=o,e[21]=C,e[22]=P):P=e[22];let N;e[23]!==i?(N=i.map(fi),e[23]=i,e[24]=N):N=e[24];let v;e[25]!==N?(v=t.jsx("ul",{className:"space-y-1",children:N}),e[25]=N,e[26]=v):v=e[26];let c;return e[27]!==P||e[28]!==v?(c=t.jsxs("div",{className:"space-y-2 rounded-xl oc-tile px-3 py-2",children:[P,v]}),e[27]=P,e[28]=v,e[29]=c):c=e[29],c};function fi(l,e){return t.jsx("li",{className:"typography-meta text-foreground",children:l},`${l}-${e}`)}const Li=l=>{const e=fe.c(83),{stagedCount:i,commitMessage:n,onCommitMessageChange:f,generatedHighlights:h,onInsertHighlights:m,onGenerateMessage:u,isGeneratingMessage:o,onCommit:p,onCommitAndPush:D,commitAction:b,networkOperationBlocked:r,hasPendingIndexMutation:j,gitmojiEnabled:C,onOpenGitmojiPicker:P}=l,N=r===void 0?!1:r,v=j===void 0?!1:j,{t:c}=ue(),g=i>0;let R;e[0]!==b||e[1]!==n||e[2]!==v||e[3]!==g?(R=n.trim()&&g&&b===null&&!v,e[0]=b,e[1]=n,e[2]=v,e[3]=g,e[4]=R):R=e[4];const E=R,{isMobile:M,hasTouchInput:G}=Rt();let L;e[5]!==c?(L=c("gitView.commit.title"),e[5]=c,e[6]=L):L=e[6];let O;e[7]!==L?(O=t.jsx("h3",{className:"typography-ui-header font-semibold text-foreground",children:L}),e[7]=L,e[8]=O):O=e[8];let S;e[9]!==g||e[10]!==c?(S=g?null:t.jsx("span",{className:"min-w-0 truncate typography-meta text-muted-foreground",children:c("gitView.commit.stageFilesHint")}),e[9]=g,e[10]=c,e[11]=S):S=e[11];let k;e[12]!==O||e[13]!==S?(k=t.jsxs("div",{className:"flex w-full items-baseline gap-2 px-0 pt-2 pb-1",children:[O,S]}),e[12]=O,e[13]=S,e[14]=k):k=e[14];let I;e[15]!==h||e[16]!==m?(I=t.jsx(mi,{highlights:h,onInsert:m}),e[15]=h,e[16]=m,e[17]=I):I=e[17];let x;e[18]!==E||e[19]!==o||e[20]!==p?(x=()=>{E&&!o&&p()},e[18]=E,e[19]=o,e[20]=p,e[21]=x):x=e[21];let T;e[22]!==c?(T=c("gitView.commit.messagePlaceholder"),e[22]=c,e[23]=T):T=e[23];const _=b!==null;let H;e[24]!==n||e[25]!==G||e[26]!==M||e[27]!==f||e[28]!==T||e[29]!==_||e[30]!==x?(H=t.jsx(di,{value:n,onChange:f,onSubmit:x,placeholder:T,disabled:_,hasTouchInput:G,isMobile:M}),e[24]=n,e[25]=G,e[26]=M,e[27]=f,e[28]=T,e[29]=_,e[30]=x,e[31]=H):H=e[31];let B;e[32]!==C||e[33]!==P||e[34]!==c?(B=C&&t.jsxs(Y,{variant:"outline",size:"sm",onClick:P,className:"w-fit",type:"button",children:[t.jsx($,{name:"emotion-happy",className:"size-4"}),c("gitView.commit.addGitmoji")]}),e[32]=C,e[33]=P,e[34]=c,e[35]=B):B=e[35];const q=o||b!==null||v||i===0;let K;e[36]!==c?(K=c("gitView.commit.generateAria"),e[36]=c,e[37]=K):K=e[37];let V;e[38]!==o?(V=o?t.jsx($,{name:"loader-4",className:"size-4 animate-spin"}):t.jsx($,{name:"ai-generate-2",className:"size-4 text-primary"}),e[38]=o,e[39]=V):V=e[39];let U;e[40]!==c?(U=c("gitView.commit.generate"),e[40]=c,e[41]=U):U=e[41];let F;e[42]!==U?(F=t.jsx("span",{className:"commit-actions__label",children:U}),e[42]=U,e[43]=F):F=e[43];let J;e[44]!==u||e[45]!==q||e[46]!==K||e[47]!==V||e[48]!==F?(J=t.jsxs(Y,{variant:"outline",size:"sm",onClick:u,disabled:q,type:"button","aria-label":K,className:"commit-actions__btn",children:[V,F]}),e[44]=u,e[45]=q,e[46]=K,e[47]=V,e[48]=F,e[49]=J):J=e[49];let Z;e[50]===Symbol.for("react.memo_cache_sentinel")?(Z=t.jsx("div",{className:"flex-1"}),e[50]=Z):Z=e[50];let Q;e[51]!==p?(Q=W=>p(W.currentTarget),e[51]=p,e[52]=Q):Q=e[52];const se=!E||o;let ee;e[53]!==c?(ee=c("gitView.commit.commitAria"),e[53]=c,e[54]=ee):ee=e[54];let a;e[55]!==b||e[56]!==c?(a=b==="commit"?t.jsxs(t.Fragment,{children:[t.jsx($,{name:"loader-4",className:"size-4 animate-spin"}),t.jsx("span",{className:"commit-actions__label",children:c("gitView.commit.committing")})]}):t.jsxs(t.Fragment,{children:[t.jsx($,{name:"git-commit",className:"size-4"}),t.jsx("span",{className:"commit-actions__label",children:c("gitView.commit.commit")})]}),e[55]=b,e[56]=c,e[57]=a):a=e[57];let d;e[58]!==Q||e[59]!==se||e[60]!==ee||e[61]!==a?(d=t.jsx(Y,{size:"sm",variant:"outline",onClick:Q,disabled:se,className:"commit-actions__btn whitespace-nowrap","aria-label":ee,children:a}),e[58]=Q,e[59]=se,e[60]=ee,e[61]=a,e[62]=d):d=e[62];let s;e[63]!==E||e[64]!==b||e[65]!==o||e[66]!==M||e[67]!==N||e[68]!==D||e[69]!==c?(s=M?t.jsxs(et,{children:[t.jsx(tt,{asChild:!0,children:t.jsx(Y,{variant:"default",size:"sm",onClick:W=>D(W.currentTarget),disabled:!E||o||N,className:"h-7 w-7 p-0","aria-label":c("gitView.commit.pushAria"),children:b==="commitAndPush"?t.jsx($,{name:"loader-4",className:"size-4 animate-spin"}):t.jsx($,{name:"arrow-up",className:"size-3.5"})})}),t.jsx(it,{side:"top",children:t.jsx("p",{children:c("gitView.commit.push")})})]}):t.jsx(Y,{size:"sm",variant:"default",onClick:W=>D(W.currentTarget),disabled:!E||o||N,className:"commit-actions__btn","aria-label":c("gitView.commit.pushAria"),children:b==="commitAndPush"?t.jsxs(t.Fragment,{children:[t.jsx($,{name:"loader-4",className:"size-4 animate-spin"}),t.jsx("span",{className:"commit-actions__label commit-actions__label--push",children:c("gitView.commit.pushing")})]}):t.jsxs(t.Fragment,{children:[t.jsx($,{name:"arrow-up",className:"size-3.5"}),t.jsx("span",{className:"commit-actions__label commit-actions__label--push",children:c("gitView.commit.push")})]})}),e[63]=E,e[64]=b,e[65]=o,e[66]=M,e[67]=N,e[68]=D,e[69]=c,e[70]=s):s=e[70];let y;e[71]!==J||e[72]!==d||e[73]!==s?(y=t.jsxs("div",{className:"@container/commit-actions flex items-center gap-2 min-w-0",children:[J,Z,d,s]}),e[71]=J,e[72]=d,e[73]=s,e[74]=y):y=e[74];let A;e[75]!==H||e[76]!==B||e[77]!==y||e[78]!==I?(A=t.jsxs("div",{className:"flex flex-col gap-3 px-0 pt-1 pb-3",children:[I,H,B,y]}),e[75]=H,e[76]=B,e[77]=y,e[78]=I,e[79]=A):A=e[79];let z;return e[80]!==A||e[81]!==k?(z=t.jsxs("section",{className:"border-0 bg-transparent rounded-none",children:[k,A]}),e[80]=A,e[81]=k,e[82]=z):z=e[82],z},$i=l=>{const e=fe.c(153),{open:i,onOpenChange:n,conflictFiles:f,directory:h,operation:m,onAbort:u,onClearState:o,onNavigatedToChat:p}=l;let D;e[0]!==f?(D=f===void 0?[]:f,e[0]=f,e[1]=D):D=e[1];const b=D,{t:r}=ue(),j=st(hi),C=st(pi),P=nt(gi),N=nt(xi),[v,c]=w.useState(!1),[g,R]=w.useState(null),[E,M]=w.useState(null);let G,L;e[2]!==h||e[3]!==i||e[4]!==r?(G=()=>{!i||!h||(c(!0),M(null),R(null),Ot(h).then(X=>{R(X)}).catch(X=>{const ce=X instanceof Error?X.message:r("gitView.conflict.loadFailed");M(ce)}).finally(()=>{c(!1)}))},L=[i,h,r],e[2]=h,e[3]=i,e[4]=r,e[5]=G,e[6]=L):(G=e[5],L=e[6]),w.useEffect(G,L);let O;e[7]!==g||e[8]!==h||e[9]!==m?(O=async()=>{if(!g)return null;const X=m==="merge"?"merge":"rebase",ce=g.headInfo||(m==="merge"?"MERGE_HEAD":"REBASE_HEAD"),Ne=m==="merge"?"git commit --no-edit":"git rebase --continue",Ce=await Pt(h),pe=Ce.render("git.conflict.resolve.visible",{operation_label:X,head_ref:ce}),ge=Ce.render("git.conflict.resolve.instructions",{operation_label:X,directory:h,operation:m,head_info:g.headInfo||"N/A",continue_cmd:Ne}),xe=`${X} conflict context (JSON)
|
|
1
|
+
import{R as w,f as fe,j as t}from"./vendor-react--VO_rL_p.js";import{u as At}from"./vendor-tanstack-react-virtual-C_IilPt1.js";import{u as ue,aa as et,ab as tt,I as $,ac as it,e8 as It,Q as ae,K as Dt,B as Y,gg as Et,a_ as zt,t as ze,q as Te,D as Re,l as Oe,F as Pe,o as Ze,gh as Tt,aK as Rt,$ as st,gi as nt,n as at,gj as Ot,aR as Pt,A as de,C as Ft,bB as ht,bC as pt,gk as gt,bO as xt,gl as yt,gm as Lt,gn as bt,go as He,gp as $t,gq as vt,gr as Mt,gs as Ht,gt as wt,gu as jt,f8 as qe,bo as lt,bp as rt,bq as ot,br as ct,bs as dt,gv as Gt,gw as _t,bN as Le,gx as Nt,gy as Bt,x as ut,gz as Kt,gA as qt}from"./useAppFontEffects-C_TEX3sk.js";import{u as Ge,bP as Ct,bQ as Ut,aG as _e}from"./katex.min-BCtkGOiC.js";import{al as Jt,at as Ee,au as St,av as kt,aw as Qt,Q as Wt,O as Xt,P as Yt,ax as Zt,ay as ei,az as ti,aA as ii}from"./runtimeEndpointReset-CMO7G_Ff.js";import{a as si,b as ni,c as ai,f as li,T as Ue}from"./useBranchPullRequestRequest-CLTracub.js";import{C as ri}from"./ChangedPathLabel-7Zbbq-FE.js";const oi=w.memo(function(e){const i=fe.c(66),{file:n,actionLabel:f,actionSymbol:h,onAction:m,onViewDiff:u,onRevert:o,isReverting:p,stats:D,rowPaddingClassName:b,indentPx:r,actionAtStart:j,nameOnly:C,showRevert:P}=e,N=r===void 0?0:r,v=j===void 0?!1:j,c=C===void 0?!1:C,g=P===void 0?!0:P;let R;i[0]!==n?(R=Jt(n),i[0]=n,i[1]=R):R=i[1];const E=R,{t:M}=ue();let G;i[2]!==E.descriptionKey||i[3]!==M?(G=M(E.descriptionKey),i[2]=E.descriptionKey,i[3]=M,i[4]=G):G=i[4];const L=G,O=D?.insertions??0,S=D?.deletions??0;let k;i[5]!==m||i[6]!==u?(k=ie=>{ie.key===" "?(ie.preventDefault(),m()):ie.key==="Enter"&&(ie.preventDefault(),u())},i[5]=m,i[6]=u,i[7]=k):k=i[7];const I=k;let x;i[8]!==m?(x=ie=>{ie.preventDefault(),ie.stopPropagation(),m()},i[8]=m,i[9]=x):x=i[9];const T=x;let _;i[10]!==o?(_=ie=>{ie.preventDefault(),ie.stopPropagation(),o()},i[10]=o,i[11]=_):_=i[11];const H=_;let B;i[12]!==f||i[13]!==h||i[14]!==T?(B=t.jsx("button",{type:"button",onClick:T,className:"flex size-5 shrink-0 items-center justify-center rounded typography-micro font-semibold text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)]","aria-label":f,title:f,children:h}),i[12]=f,i[13]=h,i[14]=T,i[15]=B):B=i[15];const q=B;let K;i[16]===Symbol.for("react.memo_cache_sentinel")?(K={color:"var(--status-success)"},i[16]=K):K=i[16];let V;i[17]!==O?(V=t.jsxs("span",{style:K,children:["+",O]}),i[17]=O,i[18]=V):V=i[18];let U,F;i[19]===Symbol.for("react.memo_cache_sentinel")?(U=t.jsx("span",{className:"text-muted-foreground mx-0.5",children:"/"}),F={color:"var(--status-error)"},i[19]=U,i[20]=F):(U=i[19],F=i[20]);let J;i[21]!==S?(J=t.jsxs("span",{style:F,children:["-",S]}),i[21]=S,i[22]=J):J=i[22];let Z;i[23]!==V||i[24]!==J?(Z=t.jsxs("span",{className:"shrink-0 typography-micro",children:[V,U,J]}),i[23]=V,i[24]=J,i[25]=Z):Z=i[25];const Q=Z;let se;i[26]!==n.path||i[27]!==H||i[28]!==p||i[29]!==g||i[30]!==M?(se=g?t.jsxs(et,{children:[t.jsx(tt,{asChild:!0,children:t.jsx("button",{type:"button",onClick:H,disabled:p,className:"flex size-5 shrink-0 items-center justify-center rounded text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50","aria-label":M("gitView.changes.revertFileAria",{path:n.path}),children:p?t.jsx($,{name:"loader-4",className:"size-3.5 animate-spin"}):t.jsx($,{name:"arrow-go-back",className:"size-3.5"})})}),t.jsx(it,{sideOffset:8,children:M("gitView.changes.revertFileTooltip")})]}):null,i[26]=n.path,i[27]=H,i[28]=p,i[29]=g,i[30]=M,i[31]=se):se=i[31];const ee=se,a=`group flex items-center gap-2 py-1.5 cursor-pointer ${b??"px-3"}`;let d;i[32]!==N?(d=N>0?{paddingInlineStart:`${N}px`}:void 0,i[32]=N,i[33]=d):d=i[33];const s=v?q:null;let y;i[34]!==E.color?(y={color:E.color},i[34]=E.color,i[35]=y):y=i[35];let A;i[36]!==E.code||i[37]!==L||i[38]!==y?(A=t.jsx("span",{className:"typography-micro font-semibold w-4 text-center uppercase",style:y,title:L,"aria-label":L,children:E.code}),i[36]=E.code,i[37]=L,i[38]=y,i[39]=A):A=i[39];let z;i[40]!==n.path?(z=t.jsx(It,{filePath:n.path,className:"h-3.5 w-3.5 shrink-0"}),i[40]=n.path,i[41]=z):z=i[41];let W;e:{if(n.path.lastIndexOf("/")===-1||c){let re;i[42]===Symbol.for("react.memo_cache_sentinel")?(re={direction:"rtl",unicodeBidi:"plaintext"},i[42]=re):re=i[42];const he=n.path;let oe;i[43]!==n.path?(oe=si(n.path),i[43]=n.path,i[44]=oe):oe=i[44];let me;i[45]!==n.path||i[46]!==oe?(me=t.jsx("span",{className:"oc-ui-start-align flex-1 min-w-0 truncate typography-ui-label text-foreground",style:re,title:he,children:oe}),i[45]=n.path,i[46]=oe,i[47]=me):me=i[47],W=me;break e}let le;i[48]!==n.path?(le=t.jsx(ri,{path:n.path,className:"flex-1 typography-ui-label"}),i[48]=n.path,i[49]=le):le=i[49],W=le}let te;i[50]!==v||i[51]!==q||i[52]!==p||i[53]!==ee||i[54]!==Q?(te=v?t.jsxs(t.Fragment,{children:[Q,ee]}):t.jsxs("span",{className:"flex shrink-0 items-center justify-items-end gap-2 md:grid",children:[t.jsx("span",{className:ae("md:col-start-1 md:row-start-1",p?"md:invisible":"md:group-hover:invisible md:group-focus-within:invisible"),children:Q}),t.jsxs("span",{className:ae("flex items-center gap-2 md:col-start-1 md:row-start-1",!p&&"md:invisible md:group-hover:visible md:group-focus-within:visible"),children:[ee,q]})]}),i[50]=v,i[51]=q,i[52]=p,i[53]=ee,i[54]=Q,i[55]=te):te=i[55];let ne;return i[56]!==I||i[57]!==u||i[58]!==a||i[59]!==d||i[60]!==s||i[61]!==A||i[62]!==z||i[63]!==W||i[64]!==te?(ne=t.jsxs("div",{className:a,role:"button",tabIndex:0,onClick:u,onKeyDown:I,style:d,children:[s,A,z,W,te]}),i[56]=I,i[57]=u,i[58]=a,i[59]=d,i[60]=s,i[61]=A,i[62]=z,i[63]=W,i[64]=te,i[65]=ne):ne=i[65],ne}),ci=1e3,mt=34,Je=30,$e="ps-0 pe-2",Qe=(l,e)=>`${l} ${e}`,Fi=({groups:l,diffStats:e,revertingPaths:i,isRevertingAll:n=!1,headerBackgroundClassName:f="bg-sidebar",onVisiblePathsChange:h,onRevertAll:m,onRevertDirectory:u})=>{const{t:o}=ue(),p=w.useRef(null),b=Ge(a=>a.gitChangesViewMode)==="tree",r=w.useMemo(()=>l.filter(a=>a.entries.length>0),[l]),[j,C]=w.useState(new Set),[P,N]=w.useState(new Set),[v,c]=w.useState(!1),[g,R]=w.useState(null),E=Dt(),{confirm:M}=E,G=w.useCallback(async(a,d)=>{await M({title:o("gitView.changes.revertFileDialogTitle"),message:o("gitView.changes.revertFileDescription",{path:d}),action:o("gitView.changes.revertFileConfirm"),destructive:!0})&&a.onRevertFile(d)},[M,o]),L=w.useMemo(()=>r.map(a=>ni(a.entries)),[r]),O=w.useMemo(()=>{const a=[];return r.forEach((d,s)=>{Array.from(L[s]?.children.values()??[]).forEach(y=>{a.push(Qe(d.id,ai(y).node.path))})}),a},[L,r]);w.useEffect(()=>{b&&N(a=>{const d=new Set,s=new Set(O);return a.forEach(y=>{(y.slice(y.indexOf(" ")+1).includes("/")||s.has(y))&&d.add(y)}),O.forEach(y=>d.add(y)),d})},[b,O]);const S=w.useMemo(()=>{const a=[];return r.forEach((d,s)=>{if(a.push({type:"header",key:`header:${d.id}`,groupIndex:s}),!j.has(d.id)){if(b){const y=new Set;P.forEach(z=>{z.startsWith(`${d.id} `)&&y.add(z.slice(d.id.length+1))}),li(L[s],y).forEach(z=>{z.kind==="file"?a.push({type:"file",key:`${d.id}:${z.key}`,groupIndex:s,file:z.file,depth:z.depth}):a.push({type:"directory",key:`${d.id}:${z.key}`,groupIndex:s,directory:z.directory,label:z.label,depth:z.depth})});return}d.entries.forEach(y=>{a.push({type:"file",key:`${d.id}:file:${y.path}`,groupIndex:s,file:y,depth:0})})}}),m&&r.length>0&&a.push({type:"revert-all",key:"revert-all"}),a},[j,P,b,m,L,r]),k=S.length,I=k>=ci,x=At({count:k,enabled:I,getScrollElement:()=>p.current,estimateSize:()=>mt,overscan:12,getItemKey:a=>S[a]?.key??a}),T=x.getVirtualItems(),_=w.useMemo(()=>{if(!I)return 0;const a=p.current?.scrollTop??0;return T.find(s=>s.end>a)?.index??0},[I,T,p]);w.useEffect(()=>{if(!h)return;const a=d=>d&&d.type==="file"?d.file.path:null;if(k===0){h([]);return}if(!I){const d=[];for(const s of S)if(s.type==="file"&&(d.push(s.file.path),d.length>=Je))break;h(d);return}h(S.slice(_,_+Math.ceil((p.current?.clientHeight??0)/mt)+Je).map(d=>a(d)).filter(d=>!!d).slice(0,Je))},[h,k,S,I,_]);const H=w.useCallback(a=>{C(d=>{const s=new Set(d);return s.has(a)?s.delete(a):s.add(a),s})},[]),B=w.useCallback((a,d)=>{N(s=>{const y=new Set(s),A=Qe(a,d);return y.has(A)?y.delete(A):y.add(A),y})},[]),q=w.useMemo(()=>{const a=new Set;return r.forEach(d=>d.entries.forEach(s=>a.add(s.path))),Array.from(a)},[r]),K=q.length,V=g?n||g.paths.some(a=>i.has(a)):!1,U=w.useCallback(async()=>{!m||n||q.length===0||(await m(q),c(!1))},[q,n,m]),F=w.useCallback(async()=>{!u||!g||V||(await u(g.paths),R(null))},[V,u,g]),J=w.useCallback((a,d)=>{const s=j.has(a.id),y=a.entries.length;return t.jsxs("div",{className:ae("sticky top-0 z-10 flex items-center gap-2 py-2",f,$e,!d&&"mt-1 border-t border-edge-muted"),children:[t.jsx("button",{type:"button",onClick:()=>a.onActionAll(a.entries.map(A=>A.path)),className:"flex size-5 shrink-0 items-center justify-center rounded typography-micro font-semibold text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)]","aria-label":a.actionAllLabel,title:a.actionAllLabel,children:a.actionSymbol}),t.jsxs("button",{type:"button",onClick:()=>H(a.id),className:"flex min-w-0 flex-1 items-center gap-2 rounded text-start focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)]","aria-expanded":!s,children:[t.jsx("h3",{className:"truncate typography-ui-header font-semibold text-foreground",children:a.title}),t.jsx("span",{className:"typography-meta text-muted-foreground",children:y}),t.jsx($,{name:"arrow-down-s",className:ae("size-3.5 shrink-0 text-muted-foreground transition-transform",s&&"-rotate-90 rtl:rotate-90")})]})]})},[j,f,H]),Z=w.useCallback((a,d,s,y)=>{const A=P.has(Qe(a.id,d.path)),z=d.files.map(te=>te.path),W=n||z.some(te=>i.has(te));return t.jsxs("div",{className:ae("group flex items-center gap-2 py-1.5 text-muted-foreground hover:text-foreground",$e),style:{paddingInlineStart:`${y*Ue}px`},children:[t.jsxs("button",{type:"button",onClick:()=>B(a.id,d.path),"aria-expanded":A,className:"flex min-w-0 flex-1 items-center gap-1.5 rounded text-start focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":A?o("gitView.changes.collapseDirectoryAria",{path:d.path}):o("gitView.changes.expandDirectoryAria",{path:d.path}),children:[t.jsx("span",{className:"flex w-4 shrink-0 items-center justify-center",children:t.jsx($,{name:"arrow-right-s",className:ae("size-3.5 transition-transform",A&&"rotate-90 rtl:-rotate-90")})}),t.jsx("span",{className:"min-w-0 truncate typography-ui-label",title:d.path,children:s}),A?null:t.jsx("span",{className:"shrink-0 typography-micro tabular-nums text-muted-foreground",children:d.files.length})]}),t.jsxs("span",{className:ae("flex shrink-0 items-center gap-2 transition-opacity",!W&&"md:opacity-0 md:group-hover:opacity-100 md:group-focus-within:opacity-100"),children:[a.showRevertActions!==!1&&u?t.jsx("button",{type:"button",onClick:()=>R({path:d.path,paths:z,count:z.length}),disabled:W,className:"flex size-5 shrink-0 items-center justify-center rounded text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)] disabled:cursor-not-allowed disabled:opacity-50","aria-label":o("gitView.changes.revertDirectoryAria",{path:d.path}),title:o("gitView.changes.revertDirectoryTooltip"),children:W?t.jsx($,{name:"loader-4",className:"size-3.5 animate-spin"}):t.jsx($,{name:"arrow-go-back",className:"size-3.5"})}):null,t.jsx("button",{type:"button",onClick:()=>a.onActionAll(d.files.map(te=>te.path)),className:"flex size-5 shrink-0 items-center justify-center rounded typography-micro font-semibold text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)]","aria-label":o(a.actionSymbol==="+"?"gitView.changes.stageDirectoryAria":"gitView.changes.unstageDirectoryAria",{path:d.path}),title:o(a.actionSymbol==="+"?"gitView.changes.stageDirectoryAria":"gitView.changes.unstageDirectoryAria",{path:d.path}),children:a.actionSymbol})]})]})},[P,n,u,i,o,B]),Q=w.useCallback((a,d)=>{if(a.type==="revert-all")return t.jsx("div",{className:ae("flex justify-end py-2",$e),children:t.jsxs(Y,{variant:"ghost",size:"sm",onClick:()=>c(!0),disabled:n,className:"gap-1.5 text-[var(--status-error)] hover:bg-[var(--status-error)]/10 hover:text-[var(--status-error)]",children:[t.jsx($,{name:"arrow-go-back",className:"size-3.5"}),o("gitView.changes.revertAll")]})});const s=r[a.groupIndex];if(!s)return null;if(a.type==="header")return J(s,d);if(a.type==="directory")return Z(s,a.directory,a.label,a.depth);const y=a.file;return t.jsx(oi,{file:y,actionLabel:s.getActionLabel(y.path),actionSymbol:s.actionSymbol,onAction:()=>s.onActionFile(y.path),stats:e?.[s.statsScope]?.[y.path],onViewDiff:()=>s.onViewDiff(y.path),onRevert:()=>{G(s,y.path)},isReverting:i.has(y.path)||n,rowPaddingClassName:$e,indentPx:a.depth*Ue,actionAtStart:!b,nameOnly:b,showRevert:s.showRevertActions!==!1})},[e,n,b,Z,J,G,i,o,r]),se=a=>a.type!=="file"&&a.type!=="directory"?null:Array.from({length:a.depth},(d,s)=>t.jsx("span",{"aria-hidden":!0,className:"pointer-events-none absolute inset-y-0 w-px bg-edge",style:{insetInlineStart:`${s*Ue+8}px`}},s)),ee=w.useCallback(a=>{if(b)return!1;const d=S[a],s=S[a-1];return!d||!s||d.type!=="file"&&d.type!=="directory"||s.type!=="file"&&s.type!=="directory"?!1:s.groupIndex===d.groupIndex},[b,S]);return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"relative flex h-full min-h-0 w-full flex-col overflow-hidden",children:[t.jsx(Et,{ref:p,className:"overlay-scrollbar-target overlay-scrollbar-container min-h-0 w-full flex-1 overflow-x-hidden overflow-y-auto",children:I?t.jsx("div",{style:{height:x.getTotalSize(),position:"relative"},children:T.map(a=>{const d=S[a.index];return d?t.jsxs("div",{"data-index":a.index,ref:x.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${a.start}px)`},className:ae(ee(a.index)&&"before:pointer-events-none before:absolute before:inset-s-0 before:inset-e-2 before:top-0 before:border-t before:border-edge"),children:[se(d),Q(d,a.index===0)]},d.key):null})}):t.jsx("div",{role:"list","aria-label":o("gitView.changes.changedFilesAria"),children:S.map((a,d)=>t.jsxs("div",{className:ae("relative",ee(d)&&"before:pointer-events-none before:absolute before:inset-s-0 before:inset-e-2 before:top-0 before:border-t before:border-edge"),children:[se(a),Q(a,d===0)]},a.key))})}),t.jsx(zt,{containerRef:p,disableHorizontal:!0})]}),E.dialog,t.jsx(ze,{open:v,onOpenChange:a=>{!n&&!a&&c(!1)},children:t.jsxs(Te,{className:"max-w-md",children:[t.jsxs(Re,{children:[t.jsx(Oe,{children:o("gitView.changes.revertAllDialogTitle")}),t.jsx(Pe,{children:K===1?o("gitView.changes.revertAllDescriptionSingle",{count:K}):o("gitView.changes.revertAllDescriptionPlural",{count:K})})]}),t.jsxs(Ze,{children:[t.jsx(Y,{variant:"outline",size:"sm",onClick:()=>c(!1),disabled:n,children:o("gitView.common.cancel")}),t.jsx(Y,{variant:"destructive",size:"sm",onClick:()=>{U()},disabled:n,children:o(n?"gitView.changes.reverting":"gitView.changes.revertAll")})]})]})}),t.jsx(ze,{open:!!g,onOpenChange:a=>{!V&&!a&&R(null)},children:t.jsxs(Te,{className:"max-w-md",children:[t.jsxs(Re,{children:[t.jsx(Oe,{children:o("gitView.changes.revertDirectoryDialogTitle")}),t.jsx(Pe,{children:g?g.count===1?o("gitView.changes.revertDirectoryDescriptionSingle",{count:g.count,path:g.path}):o("gitView.changes.revertDirectoryDescriptionPlural",{count:g.count,path:g.path}):null})]}),t.jsxs(Ze,{children:[t.jsx(Y,{variant:"outline",size:"sm",onClick:()=>R(null),disabled:V,children:o("gitView.common.cancel")}),t.jsx(Y,{variant:"destructive",size:"sm",onClick:()=>{F()},disabled:V||!g,children:o(V?"gitView.changes.reverting":"gitView.changes.revertDirectory")})]})]})})]})},We=38,Me=200,di=l=>{const e=fe.c(26),{value:i,onChange:n,onSubmit:f,placeholder:h,disabled:m,hasTouchInput:u,isMobile:o}=l,p=m===void 0?!1:m,D=u===void 0?!1:u,b=o===void 0?!1:o,{t:r}=ue(),j=w.useRef(null),C=Tt(j),P=Ge(ui);let N;e[0]===Symbol.for("react.memo_cache_sentinel")?(N=()=>{const x=j.current;if(!x)return;const T=document.activeElement===x,_=()=>{x.style.height=`${We}px`;const B=x.scrollHeight,q=Math.min(Math.max(B,We),Me);x.style.height=`${q}px`,x.style.overflowY=B>Me?"auto":"hidden",B>Me&&!T&&(x.scrollTop=x.scrollHeight)};_();const H=window.requestAnimationFrame(_);return()=>{window.cancelAnimationFrame(H)}},e[0]=N):N=e[0];let v;e[1]!==i?(v=[i],e[1]=i,e[2]=v):v=e[2],w.useLayoutEffect(N,v);let c;e[3]!==n?(c=x=>n(x.target.value),e[3]=n,e[4]=c):c=e[4];let g;e[5]!==f?(g=x=>{x.key==="Enter"&&(x.metaKey||x.ctrlKey)&&!x.shiftKey&&!x.altKey&&(x.preventDefault(),f?.())},e[5]=f,e[6]=g):g=e[6];let R;e[7]!==h||e[8]!==r?(R=h??r("gitView.commit.messagePlaceholder"),e[7]=h,e[8]=r,e[9]=R):R=e[9];const E=D?"on":"off",M=D?"sentences":"off",G=b||P,L=p&&"opacity-50";let O;e[10]!==L?(O=ae("oc-raised oc-field w-full rounded-lg bg-surface-elevated px-3 py-2 typography-ui-label text-foreground placeholder:text-muted-foreground","resize-none outline-none",L),e[10]=L,e[11]=O):O=e[11];let S;e[12]===Symbol.for("react.memo_cache_sentinel")?(S={minHeight:We,maxHeight:Me},e[12]=S):S=e[12];let k;e[13]!==p||e[14]!==M||e[15]!==G||e[16]!==O||e[17]!==c||e[18]!==g||e[19]!==R||e[20]!==E||e[21]!==i?(k=t.jsx("textarea",{ref:j,value:i,onChange:c,onKeyDown:g,placeholder:R,rows:1,disabled:p,autoCorrect:E,autoCapitalize:M,spellCheck:G,className:O,style:S}),e[13]=p,e[14]=M,e[15]=G,e[16]=O,e[17]=c,e[18]=g,e[19]=R,e[20]=E,e[21]=i,e[22]=k):k=e[22];let I;return e[23]!==C||e[24]!==k?(I=t.jsxs(t.Fragment,{children:[k,C]}),e[23]=C,e[24]=k,e[25]=I):I=e[25],I};function ui(l){return l.inputSpellcheckEnabled}const mi=l=>{const e=fe.c(30),{highlights:i,onInsert:n}=l,{t:f}=ue();if(i.length===0)return null;let h;e[0]!==i||e[1]!==n?(h=()=>{n(i)},e[0]=i,e[1]=n,e[2]=h):h=e[2];const m=h;let u;e[3]!==f?(u=f("gitView.commit.aiHighlights.title"),e[3]=f,e[4]=u):u=e[4];let o;e[5]!==u?(o=t.jsx("p",{className:"typography-micro text-muted-foreground",children:u}),e[5]=u,e[6]=o):o=e[6];let p;e[7]!==f?(p=f("gitView.commit.aiHighlights.insertAria"),e[7]=f,e[8]=p):p=e[8];let D;e[9]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx($,{name:"arrow-down",className:"size-4"}),e[9]=D):D=e[9];let b;e[10]!==m||e[11]!==p?(b=t.jsx(tt,{asChild:!0,children:t.jsx(Y,{variant:"ghost",size:"icon",className:"size-6",onClick:m,"aria-label":p,children:D})}),e[10]=m,e[11]=p,e[12]=b):b=e[12];let r;e[13]!==f?(r=f("gitView.commit.aiHighlights.insertTooltip"),e[13]=f,e[14]=r):r=e[14];let j;e[15]!==r?(j=t.jsx(it,{sideOffset:8,children:r}),e[15]=r,e[16]=j):j=e[16];let C;e[17]!==b||e[18]!==j?(C=t.jsxs(et,{children:[b,j]}),e[17]=b,e[18]=j,e[19]=C):C=e[19];let P;e[20]!==o||e[21]!==C?(P=t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[o,C]}),e[20]=o,e[21]=C,e[22]=P):P=e[22];let N;e[23]!==i?(N=i.map(fi),e[23]=i,e[24]=N):N=e[24];let v;e[25]!==N?(v=t.jsx("ul",{className:"space-y-1",children:N}),e[25]=N,e[26]=v):v=e[26];let c;return e[27]!==P||e[28]!==v?(c=t.jsxs("div",{className:"space-y-2 rounded-xl oc-tile px-3 py-2",children:[P,v]}),e[27]=P,e[28]=v,e[29]=c):c=e[29],c};function fi(l,e){return t.jsx("li",{className:"typography-meta text-foreground",children:l},`${l}-${e}`)}const Li=l=>{const e=fe.c(83),{stagedCount:i,commitMessage:n,onCommitMessageChange:f,generatedHighlights:h,onInsertHighlights:m,onGenerateMessage:u,isGeneratingMessage:o,onCommit:p,onCommitAndPush:D,commitAction:b,networkOperationBlocked:r,hasPendingIndexMutation:j,gitmojiEnabled:C,onOpenGitmojiPicker:P}=l,N=r===void 0?!1:r,v=j===void 0?!1:j,{t:c}=ue(),g=i>0;let R;e[0]!==b||e[1]!==n||e[2]!==v||e[3]!==g?(R=n.trim()&&g&&b===null&&!v,e[0]=b,e[1]=n,e[2]=v,e[3]=g,e[4]=R):R=e[4];const E=R,{isMobile:M,hasTouchInput:G}=Rt();let L;e[5]!==c?(L=c("gitView.commit.title"),e[5]=c,e[6]=L):L=e[6];let O;e[7]!==L?(O=t.jsx("h3",{className:"typography-ui-header font-semibold text-foreground",children:L}),e[7]=L,e[8]=O):O=e[8];let S;e[9]!==g||e[10]!==c?(S=g?null:t.jsx("span",{className:"min-w-0 truncate typography-meta text-muted-foreground",children:c("gitView.commit.stageFilesHint")}),e[9]=g,e[10]=c,e[11]=S):S=e[11];let k;e[12]!==O||e[13]!==S?(k=t.jsxs("div",{className:"flex w-full items-baseline gap-2 px-0 pt-2 pb-1",children:[O,S]}),e[12]=O,e[13]=S,e[14]=k):k=e[14];let I;e[15]!==h||e[16]!==m?(I=t.jsx(mi,{highlights:h,onInsert:m}),e[15]=h,e[16]=m,e[17]=I):I=e[17];let x;e[18]!==E||e[19]!==o||e[20]!==p?(x=()=>{E&&!o&&p()},e[18]=E,e[19]=o,e[20]=p,e[21]=x):x=e[21];let T;e[22]!==c?(T=c("gitView.commit.messagePlaceholder"),e[22]=c,e[23]=T):T=e[23];const _=b!==null;let H;e[24]!==n||e[25]!==G||e[26]!==M||e[27]!==f||e[28]!==T||e[29]!==_||e[30]!==x?(H=t.jsx(di,{value:n,onChange:f,onSubmit:x,placeholder:T,disabled:_,hasTouchInput:G,isMobile:M}),e[24]=n,e[25]=G,e[26]=M,e[27]=f,e[28]=T,e[29]=_,e[30]=x,e[31]=H):H=e[31];let B;e[32]!==C||e[33]!==P||e[34]!==c?(B=C&&t.jsxs(Y,{variant:"outline",size:"sm",onClick:P,className:"w-fit",type:"button",children:[t.jsx($,{name:"emotion-happy",className:"size-4"}),c("gitView.commit.addGitmoji")]}),e[32]=C,e[33]=P,e[34]=c,e[35]=B):B=e[35];const q=o||b!==null||v||i===0;let K;e[36]!==c?(K=c("gitView.commit.generateAria"),e[36]=c,e[37]=K):K=e[37];let V;e[38]!==o?(V=o?t.jsx($,{name:"loader-4",className:"size-4 animate-spin"}):t.jsx($,{name:"ai-generate-2",className:"size-4 text-primary"}),e[38]=o,e[39]=V):V=e[39];let U;e[40]!==c?(U=c("gitView.commit.generate"),e[40]=c,e[41]=U):U=e[41];let F;e[42]!==U?(F=t.jsx("span",{className:"commit-actions__label",children:U}),e[42]=U,e[43]=F):F=e[43];let J;e[44]!==u||e[45]!==q||e[46]!==K||e[47]!==V||e[48]!==F?(J=t.jsxs(Y,{variant:"outline",size:"sm",onClick:u,disabled:q,type:"button","aria-label":K,className:"commit-actions__btn",children:[V,F]}),e[44]=u,e[45]=q,e[46]=K,e[47]=V,e[48]=F,e[49]=J):J=e[49];let Z;e[50]===Symbol.for("react.memo_cache_sentinel")?(Z=t.jsx("div",{className:"flex-1"}),e[50]=Z):Z=e[50];let Q;e[51]!==p?(Q=W=>p(W.currentTarget),e[51]=p,e[52]=Q):Q=e[52];const se=!E||o;let ee;e[53]!==c?(ee=c("gitView.commit.commitAria"),e[53]=c,e[54]=ee):ee=e[54];let a;e[55]!==b||e[56]!==c?(a=b==="commit"?t.jsxs(t.Fragment,{children:[t.jsx($,{name:"loader-4",className:"size-4 animate-spin"}),t.jsx("span",{className:"commit-actions__label",children:c("gitView.commit.committing")})]}):t.jsxs(t.Fragment,{children:[t.jsx($,{name:"git-commit",className:"size-4"}),t.jsx("span",{className:"commit-actions__label",children:c("gitView.commit.commit")})]}),e[55]=b,e[56]=c,e[57]=a):a=e[57];let d;e[58]!==Q||e[59]!==se||e[60]!==ee||e[61]!==a?(d=t.jsx(Y,{size:"sm",variant:"outline",onClick:Q,disabled:se,className:"commit-actions__btn whitespace-nowrap","aria-label":ee,children:a}),e[58]=Q,e[59]=se,e[60]=ee,e[61]=a,e[62]=d):d=e[62];let s;e[63]!==E||e[64]!==b||e[65]!==o||e[66]!==M||e[67]!==N||e[68]!==D||e[69]!==c?(s=M?t.jsxs(et,{children:[t.jsx(tt,{asChild:!0,children:t.jsx(Y,{variant:"default",size:"sm",onClick:W=>D(W.currentTarget),disabled:!E||o||N,className:"h-7 w-7 p-0","aria-label":c("gitView.commit.pushAria"),children:b==="commitAndPush"?t.jsx($,{name:"loader-4",className:"size-4 animate-spin"}):t.jsx($,{name:"arrow-up",className:"size-3.5"})})}),t.jsx(it,{side:"top",children:t.jsx("p",{children:c("gitView.commit.push")})})]}):t.jsx(Y,{size:"sm",variant:"default",onClick:W=>D(W.currentTarget),disabled:!E||o||N,className:"commit-actions__btn","aria-label":c("gitView.commit.pushAria"),children:b==="commitAndPush"?t.jsxs(t.Fragment,{children:[t.jsx($,{name:"loader-4",className:"size-4 animate-spin"}),t.jsx("span",{className:"commit-actions__label commit-actions__label--push",children:c("gitView.commit.pushing")})]}):t.jsxs(t.Fragment,{children:[t.jsx($,{name:"arrow-up",className:"size-3.5"}),t.jsx("span",{className:"commit-actions__label commit-actions__label--push",children:c("gitView.commit.push")})]})}),e[63]=E,e[64]=b,e[65]=o,e[66]=M,e[67]=N,e[68]=D,e[69]=c,e[70]=s):s=e[70];let y;e[71]!==J||e[72]!==d||e[73]!==s?(y=t.jsxs("div",{className:"@container/commit-actions flex items-center gap-2 min-w-0",children:[J,Z,d,s]}),e[71]=J,e[72]=d,e[73]=s,e[74]=y):y=e[74];let A;e[75]!==H||e[76]!==B||e[77]!==y||e[78]!==I?(A=t.jsxs("div",{className:"flex flex-col gap-3 px-0 pt-1 pb-3",children:[I,H,B,y]}),e[75]=H,e[76]=B,e[77]=y,e[78]=I,e[79]=A):A=e[79];let z;return e[80]!==A||e[81]!==k?(z=t.jsxs("section",{className:"border-0 bg-transparent rounded-none",children:[k,A]}),e[80]=A,e[81]=k,e[82]=z):z=e[82],z},$i=l=>{const e=fe.c(153),{open:i,onOpenChange:n,conflictFiles:f,directory:h,operation:m,onAbort:u,onClearState:o,onNavigatedToChat:p}=l;let D;e[0]!==f?(D=f===void 0?[]:f,e[0]=f,e[1]=D):D=e[1];const b=D,{t:r}=ue(),j=st(hi),C=st(pi),P=nt(gi),N=nt(xi),[v,c]=w.useState(!1),[g,R]=w.useState(null),[E,M]=w.useState(null);let G,L;e[2]!==h||e[3]!==i||e[4]!==r?(G=()=>{!i||!h||(c(!0),M(null),R(null),Ot(h).then(X=>{R(X)}).catch(X=>{const ce=X instanceof Error?X.message:r("gitView.conflict.loadFailed");M(ce)}).finally(()=>{c(!1)}))},L=[i,h,r],e[2]=h,e[3]=i,e[4]=r,e[5]=G,e[6]=L):(G=e[5],L=e[6]),w.useEffect(G,L);let O;e[7]!==g||e[8]!==h||e[9]!==m?(O=async()=>{if(!g)return null;const X=m==="merge"?"merge":"rebase",ce=g.headInfo||(m==="merge"?"MERGE_HEAD":"REBASE_HEAD"),Ne=m==="merge"?"git commit --no-edit":"git rebase --continue",Ce=await Pt(h),pe=Ce.render("git.conflict.resolve.visible",{operation_label:X,head_ref:ce}),ge=Ce.render("git.conflict.resolve.instructions",{operation_label:X,directory:h,operation:m,head_info:g.headInfo||"N/A",continue_cmd:Ne}),xe=`${X} conflict context (JSON)
|
|
2
2
|
${JSON.stringify({directory:h,operation:g.operation,headInfo:g.headInfo,statusPorcelain:g.statusPorcelain,unmergedFiles:g.unmergedFiles,diff:g.diff},null,2)}`;return{visibleText:pe,instructionsText:ge,payloadText:xe}},e[7]=g,e[8]=h,e[9]=m,e[10]=O):O=e[10];const S=O;let k;e[11]!==S||e[12]!==r?(k=async()=>{try{return await S()}catch(X){const ce=X;de.error(r("magicPrompts.toast.loadFailed"),{description:ce instanceof Error?ce.message:void 0});return}},e[11]=S,e[12]=r,e[13]=k):k=e[13];const I=k;let x;e[14]!==u||e[15]!==n?(x=()=>{u(),n(!1)},e[14]=u,e[15]=n,e[16]=x):x=e[16];const T=x;let _;e[17]!==o||e[18]!==n?(_=()=>{o?.(),n(!1)},e[17]=o,e[18]=n,e[19]=_):_=e[19];const H=_;let B;e[20]!==C||e[21]!==o||e[22]!==p||e[23]!==n||e[24]!==I||e[25]!==P||e[26]!==N||e[27]!==r?(B=async()=>{const X=await I();if(X!==void 0){if(!X){de.error(r("gitView.conflict.noDetailsAvailable"));return}if(!C){de.error(r("gitView.conflict.noActiveSession"),{description:r("gitView.conflict.noActiveSessionDescription")});return}P(X.visibleText,"replace"),N([{text:X.instructionsText,synthetic:!0},{text:X.payloadText,synthetic:!0}]),o?.(),n(!1),p?.()}},e[20]=C,e[21]=o,e[22]=p,e[23]=n,e[24]=I,e[25]=P,e[26]=N,e[27]=r,e[28]=B):B=e[28];const q=B;let K;e[29]!==h||e[30]!==o||e[31]!==p||e[32]!==n||e[33]!==j||e[34]!==I||e[35]!==r?(K=async()=>{const X=await I();if(X!==void 0){if(!X){de.error(r("gitView.conflict.noDetailsAvailable"));return}j({directoryOverride:h,initialPrompt:X.visibleText,syntheticParts:[{text:X.instructionsText,synthetic:!0},{text:X.payloadText,synthetic:!0}]}),o?.(),n(!1),p?.()}},e[29]=h,e[30]=o,e[31]=p,e[32]=n,e[33]=j,e[34]=I,e[35]=r,e[36]=K):K=e[36];const V=K;let U,F,J,Z,Q,se,ee,a,d,s,y,A,z,W,te,ne,ie,le,re,he,oe,me;if(e[37]!==g||e[38]!==b||e[39]!==C||e[40]!==T||e[41]!==H||e[42]!==q||e[43]!==V||e[44]!==v||e[45]!==E||e[46]!==n||e[47]!==i||e[48]!==m||e[49]!==r){const X=r(m==="merge"?"gitView.operation.merge":"gitView.operation.rebase"),ce=g?.unmergedFiles||b;J=ze,oe=i,me=n,F=Te,he="max-w-md w-[calc(100vw-2rem)]",W="flex flex-col gap-4 overflow-hidden";let Ne;e[72]===Symbol.for("react.memo_cache_sentinel")?(Ne=t.jsx($,{name:"alert",className:"size-5 shrink-0 text-[var(--status-warning)]"}),e[72]=Ne):Ne=e[72];const Ce=t.jsxs("div",{className:"flex items-center gap-2",children:[Ne,t.jsx(Oe,{children:r("gitView.conflict.detectedTitle",{operation:X})})]});let pe;e[73]!==m||e[74]!==r?(pe=r("gitView.conflict.detectedDescription",{operation:m}),e[73]=m,e[74]=r,e[75]=pe):pe=e[75];let ge;e[76]!==pe?(ge=t.jsx(Pe,{children:pe}),e[76]=pe,e[77]=ge):ge=e[77],e[78]!==Ce||e[79]!==ge?(te=t.jsxs(Re,{children:[Ce,ge]}),e[78]=Ce,e[79]=ge,e[80]=te):te=e[80],e[81]!==v||e[82]!==r?(ne=v&&t.jsxs("div",{className:"flex items-center justify-center gap-2 py-4 text-muted-foreground",children:[t.jsx($,{name:"loader-4",className:"size-4 animate-spin"}),t.jsx("span",{className:"typography-meta",children:r("gitView.conflict.loading")})]}),e[81]=v,e[82]=r,e[83]=ne):ne=e[83],e[84]!==E||e[85]!==r?(ie=E&&t.jsx("div",{className:"rounded-lg bg-[var(--status-error-bg)] p-3 text-[var(--status-error)] typography-meta break-words",children:r("gitView.conflict.errorLoadingDetails",{message:E})}),e[84]=E,e[85]=r,e[86]=ie):ie=e[86],e[87]!==ce||e[88]!==r?(le=ce.length>0&&t.jsxs("div",{className:"space-y-2 overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("p",{className:"typography-meta text-muted-foreground",children:r("gitView.conflict.conflictedFiles")}),t.jsx("span",{className:"typography-micro px-1.5 py-0.5 rounded bg-[var(--surface-elevated)] text-muted-foreground",children:ce.length})]}),t.jsx(at,{outerClassName:"max-h-40 rounded-lg bg-[var(--surface-elevated)]",className:"p-3",disableHorizontal:!0,children:t.jsx("ul",{className:"space-y-1",children:ce.map(yi)})})]}),e[87]=ce,e[88]=r,e[89]=le):le=e[89],e[90]!==g||e[91]!==r?(re=g?.headInfo&&t.jsxs("div",{className:"space-y-1 overflow-hidden",children:[t.jsx("p",{className:"typography-meta text-muted-foreground",children:r("gitView.conflict.headInfo")}),t.jsx(at,{outerClassName:"max-h-24 rounded-lg bg-[var(--surface-elevated)]",className:"typography-micro text-foreground font-mono p-3 break-words whitespace-pre-wrap",disableHorizontal:!0,children:g.headInfo})]}),e[90]=g,e[91]=r,e[92]=re):re=e[92],y="flex flex-col gap-2 pt-2";let xe;e[93]!==V?(xe=()=>{V()},e[93]=V,e[94]=xe):xe=e[94];const Be=v||!g;let Se;e[95]!==v?(Se=v?t.jsx($,{name:"loader-4",className:"size-4 animate-spin"}):t.jsx($,{name:"add",className:"size-4"}),e[95]=v,e[96]=Se):Se=e[96];let ke;e[97]!==r?(ke=r("gitView.conflict.resolveNewSession"),e[97]=r,e[98]=ke):ke=e[98],e[99]!==xe||e[100]!==Be||e[101]!==Se||e[102]!==ke?(A=t.jsxs(Y,{variant:"default",onClick:xe,disabled:Be,className:"w-full gap-2",children:[Se,ke]}),e[99]=xe,e[100]=Be,e[101]=Se,e[102]=ke,e[103]=A):A=e[103];let Ve;e[104]!==q?(Ve=()=>{q()},e[104]=q,e[105]=Ve):Ve=e[105];const Ke=v||!g||!C;let Ae;e[106]!==v?(Ae=v?t.jsx($,{name:"loader-4",className:"size-4 animate-spin"}):t.jsx($,{name:"chat-1",className:"size-4"}),e[106]=v,e[107]=Ae):Ae=e[107];let Ie;e[108]!==r?(Ie=r("gitView.conflict.resolveCurrentSession"),e[108]=r,e[109]=Ie):Ie=e[109],e[110]!==Ve||e[111]!==Ke||e[112]!==Ae||e[113]!==Ie?(z=t.jsxs(Y,{variant:"outline",onClick:Ve,disabled:Ke,className:"w-full gap-2",children:[Ae,Ie]}),e[110]=Ve,e[111]=Ke,e[112]=Ae,e[113]=Ie,e[114]=z):z=e[114],d="flex gap-2 pt-1";let De;e[115]!==r?(De=r("gitView.conflict.continueLater"),e[115]=r,e[116]=De):De=e[116],e[117]!==H||e[118]!==De?(s=t.jsx(Y,{variant:"ghost",size:"sm",onClick:H,className:"flex-1",children:De}),e[117]=H,e[118]=De,e[119]=s):s=e[119],U=Y,Z="destructive",Q="sm",se=T,ee="flex-1",a=r("gitView.conflict.abortOperation",{operation:X}),e[37]=g,e[38]=b,e[39]=C,e[40]=T,e[41]=H,e[42]=q,e[43]=V,e[44]=v,e[45]=E,e[46]=n,e[47]=i,e[48]=m,e[49]=r,e[50]=U,e[51]=F,e[52]=J,e[53]=Z,e[54]=Q,e[55]=se,e[56]=ee,e[57]=a,e[58]=d,e[59]=s,e[60]=y,e[61]=A,e[62]=z,e[63]=W,e[64]=te,e[65]=ne,e[66]=ie,e[67]=le,e[68]=re,e[69]=he,e[70]=oe,e[71]=me}else U=e[50],F=e[51],J=e[52],Z=e[53],Q=e[54],se=e[55],ee=e[56],a=e[57],d=e[58],s=e[59],y=e[60],A=e[61],z=e[62],W=e[63],te=e[64],ne=e[65],ie=e[66],le=e[67],re=e[68],he=e[69],oe=e[70],me=e[71];let ye;e[120]!==U||e[121]!==Z||e[122]!==Q||e[123]!==se||e[124]!==ee||e[125]!==a?(ye=t.jsx(U,{variant:Z,size:Q,onClick:se,className:ee,children:a}),e[120]=U,e[121]=Z,e[122]=Q,e[123]=se,e[124]=ee,e[125]=a,e[126]=ye):ye=e[126];let be;e[127]!==d||e[128]!==s||e[129]!==ye?(be=t.jsxs("div",{className:d,children:[s,ye]}),e[127]=d,e[128]=s,e[129]=ye,e[130]=be):be=e[130];let ve;e[131]!==y||e[132]!==A||e[133]!==z||e[134]!==be?(ve=t.jsxs("div",{className:y,children:[A,z,be]}),e[131]=y,e[132]=A,e[133]=z,e[134]=be,e[135]=ve):ve=e[135];let we;e[136]!==W||e[137]!==te||e[138]!==ne||e[139]!==ie||e[140]!==le||e[141]!==re||e[142]!==ve?(we=t.jsxs("div",{className:W,children:[te,ne,ie,le,re,ve]}),e[136]=W,e[137]=te,e[138]=ne,e[139]=ie,e[140]=le,e[141]=re,e[142]=ve,e[143]=we):we=e[143];let je;e[144]!==F||e[145]!==he||e[146]!==we?(je=t.jsx(F,{className:he,children:we}),e[144]=F,e[145]=he,e[146]=we,e[147]=je):je=e[147];let Fe;return e[148]!==J||e[149]!==oe||e[150]!==me||e[151]!==je?(Fe=t.jsx(J,{open:oe,onOpenChange:me,children:je}),e[148]=J,e[149]=oe,e[150]=me,e[151]=je,e[152]=Fe):Fe=e[152],Fe};function hi(l){return l.openNewSessionDraft}function pi(l){return l.currentSessionId}function gi(l){return l.setPendingInputText}function xi(l){return l.setPendingSyntheticParts}function yi(l){return t.jsx("li",{className:"typography-micro text-foreground font-mono truncate block",title:l,children:l},l)}const Mi=({open:l,onOpenChange:e,targetBranch:i,changedFileCount:n,onCommitAndSwitch:f,onGenerateMessage:h,onRevertAndSwitch:m})=>{const{t:u}=ue(),[o,p]=w.useState(""),[D,b]=w.useState(null),[r,j]=w.useState(!1),C=D!==null;w.useEffect(()=>{l||(p(""),j(!1))},[l]);const P=async()=>{b("generate");try{const c=await h();c&&p(c)}catch(c){de.error(c instanceof Error?c.message:u("gitView.dirtySwitch.actionFailed"))}finally{b(null)}},N=async()=>{b("commit");try{let c=o.trim();if(!c){if(c=(await h()).trim(),!c){de.error(u("gitView.toast.enterCommitMessage"));return}p(c)}await f(c,r)}catch(c){de.error(c instanceof Error?c.message:u("gitView.dirtySwitch.actionFailed"))}finally{b(null)}},v=async()=>{b("revert");try{await m()}catch(c){de.error(c instanceof Error?c.message:u("gitView.dirtySwitch.actionFailed"))}finally{b(null)}};return t.jsx(ze,{open:l,onOpenChange:c=>{C||e(c)},children:t.jsx(Te,{className:"max-w-md w-[calc(100vw-2rem)]",children:t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs(Re,{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx($,{name:"alert",className:"size-5 shrink-0 text-[var(--status-warning)]"}),t.jsx(Oe,{children:u("gitView.dirtySwitch.title")})]}),t.jsx(Pe,{children:n===1?u("gitView.dirtySwitch.descriptionSingle",{branch:i}):u("gitView.dirtySwitch.descriptionPlural",{branch:i,count:n})})]}),t.jsxs("div",{className:"oc-raised oc-field flex items-center gap-2 rounded-lg px-3 py-2",children:[t.jsx("input",{value:o,onChange:c=>p(c.target.value),placeholder:u("gitView.commit.messagePlaceholder"),disabled:C,onKeyDown:c=>{c.key==="Enter"&&!C&&(c.preventDefault(),N())},className:"min-w-0 flex-1 bg-transparent typography-meta text-foreground outline-none placeholder:text-muted-foreground"}),t.jsx("button",{type:"button",onClick:()=>{P()},disabled:C,"aria-label":u("gitView.commit.generate"),title:u("gitView.commit.generate"),className:"shrink-0 text-muted-foreground hover:text-foreground disabled:opacity-50",children:D==="generate"?t.jsx($,{name:"loader-4",className:"size-4 animate-spin"}):t.jsx($,{name:"ai-generate-2",className:"size-4 text-primary"})})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Ft,{checked:r,onChange:j,disabled:C,ariaLabel:u("gitView.dirtySwitch.pushAfterCommit")}),t.jsx("span",{className:"typography-ui-label text-foreground cursor-pointer select-none",onClick:()=>!C&&j(!r),children:u("gitView.dirtySwitch.pushAfterCommit")})]}),t.jsxs("div",{className:"flex items-center justify-between gap-2 pt-1",children:[t.jsxs(Y,{variant:"destructive",size:"sm",onClick:()=>{v()},disabled:C,className:"gap-2",children:[D==="revert"?t.jsx($,{name:"loader-4",className:"size-4 animate-spin"}):null,u("gitView.dirtySwitch.revertAndSwitch")]}),t.jsxs(Y,{variant:"default",size:"sm",onClick:()=>{N()},disabled:C,className:"gap-2",children:[D==="commit"?t.jsx($,{name:"loader-4",className:"size-4 animate-spin"}):null,u("gitView.dirtySwitch.commitAndSwitch")]})]})]})})})},Xe="max-w-none",bi="flex flex-wrap items-center gap-2",Vt=l=>{const e=fe.c(6),{error:i,children:n}=l,f=i?"alert":void 0,h=i&&"text-[var(--status-error)]";let m;e[0]!==h?(m=ae(He,h),e[0]=h,e[1]=m):m=e[1];let u;return e[2]!==n||e[3]!==f||e[4]!==m?(u=t.jsx("p",{role:f,className:m,children:n}),e[2]=n,e[3]=f,e[4]=m,e[5]=u):u=e[5],u},vi=l=>{if(!l||l.target.operation!=="checkout-hydration")return[];const e=[...l.target.requirements],i=[...(l.hydration?.submodules??[]).map(n=>({kind:"submodule",item:n})),...(l.hydration?.lfs??[]).map(n=>({kind:"lfs",item:n}))];for(const{kind:n,item:f}of i){const h=f.endpoint;h&&(e.some(m=>m.kind===n&&m.path===f.path&&m.endpoint.fingerprint===h.fingerprint)||e.push({kind:n,path:f.path,endpoint:h}))}return e},wi=l=>{const e=fe.c(45),{directory:i,className:n}=l,{t:f}=ue(),{git:h,sourceControl:m}=ht(),u=pt(i,m),o=Ee(Ni),p=Ee(Ci),D=gt(),b=xt(Si),[r,j]=w.useState(""),[C,P]=w.useState(!1),N=w.useRef(0);let v;e[0]===Symbol.for("react.memo_cache_sentinel")?(v=()=>(N.current=N.current+1,j(""),P(!1),()=>{N.current=N.current+1}),e[0]=v):v=e[0];let c;e[1]!==u.scope||e[2]!==h||e[3]!==m?(c=[u.scope,h,m],e[1]=u.scope,e[2]=h,e[3]=m,e[4]=c):c=e[4],w.useLayoutEffect(v,c);const g=u.read;let R;e[5]!==D?(R=H=>Ct(H)&&vt(H,D),e[5]=D,e[6]=R):R=e[6];let E;e[7]!==o||e[8]!==p||e[9]!==R?(E=yt(o,p,R),e[7]=o,e[8]=p,e[9]=R,e[10]=E):E=e[10];const M=E;let G,L,O,S,k,I,x;if(e[11]!==n||e[12]!==i||e[13]!==h||e[14]!==o||e[15]!==M||e[16]!==r||e[17]!==g||e[18]!==b||e[19]!==m||e[20]!==f){L=Symbol.for("react.early_return_sentinel");e:{const H=g?Lt(g):null,B=H?.providers[0]?.primaryRemote??H?.remotes[0]?.name??"origin",q=(g?.repository.remotes??[]).filter(V=>V.name!==B&&H?.remotes.find(U=>U.name===V.name)?.readiness!=="ready"),K=async(V,U)=>{if(r)return;const F=N.current,J=_e(),Z=()=>N.current===F&&J===_e();j(V),P(!1);const Q=await ei({directory:i,identity:U,remoteName:V},{git:h,sourceControl:m});Z()&&(Q.status!=="applied"&&P(!0),j(""))};if(!q.length||!h.configureTransportBinding){L=null;break e}G=wt,e[28]!==f?(O=f("gitView.remotes.title"),e[28]=f,e[29]=O):O=e[29],e[30]!==f?(S=f("gitView.remotes.description"),e[30]=f,e[31]=S):S=e[31],e[32]!==n?(k=ae("min-w-0",n),e[32]=n,e[33]=k):k=e[33],I=jt,x=q.map(V=>{const U=bt(V.fetch.displayUrl);return t.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"truncate typography-ui-label text-foreground",children:V.name}),t.jsx("p",{className:ae(He,"truncate"),title:V.fetch.displayUrl,children:V.fetch.displayUrl})]}),t.jsx(St,{activeProfile:null,identities:M,onSelect:F=>{K(V.name,F)},isApplying:r===V.name,applicability:F=>kt(F,U),triggerClassName:"shrink-0 border border-border",onOpen:()=>{b(m,o.map(ki))}})]},V.name)})}e[11]=n,e[12]=i,e[13]=h,e[14]=o,e[15]=M,e[16]=r,e[17]=g,e[18]=b,e[19]=m,e[20]=f,e[21]=G,e[22]=L,e[23]=O,e[24]=S,e[25]=k,e[26]=I,e[27]=x}else G=e[21],L=e[22],O=e[23],S=e[24],k=e[25],I=e[26],x=e[27];if(L!==Symbol.for("react.early_return_sentinel"))return L;let T;e[34]!==C||e[35]!==f?(T=C?t.jsx(Vt,{error:!0,children:f("settings.sourceControl.instance.status.operationFailed")}):null,e[34]=C,e[35]=f,e[36]=T):T=e[36];let _;return e[37]!==G||e[38]!==T||e[39]!==O||e[40]!==S||e[41]!==k||e[42]!==I||e[43]!==x?(_=t.jsxs(G,{title:O,description:S,className:k,contentClassName:I,children:[x,T]}),e[37]=G,e[38]=T,e[39]=O,e[40]=S,e[41]=k,e[42]=I,e[43]=x,e[44]=_):_=e[44],_},ji=({directory:l,className:e})=>{const{t:i}=ue(),{git:n,sourceControl:f}=ht(),h=pt(l,f),m=Qt(l,n,f),[u,o]=w.useState(""),[p,D]=w.useState(""),[b,r]=w.useState(null),[j,C]=w.useState(!1),[P,N]=w.useState(!1),[v,c]=w.useState(!1),g=w.useRef(0),R=Ee(s=>s.profiles),E=Ee(s=>s.globalIdentity),M=Ee(s=>s.loadProfiles),G=Ee(s=>s.loadGlobalIdentity),L=gt(),O=xt(s=>s.refreshIdentityAccounts),S=$t(l),k=m.entry?.reads.at(-1)?.operation,I=k?.target.operation==="checkout-hydration"&&k.target.remote.name===u?vi(k):[],x=I.find(s=>JSON.stringify([s.kind,s.path,s.endpoint.fingerprint])===p),T=h.read,_=T?.repository.remotes.find(s=>s.name===u),H=x&&T?.binding?.auxiliary.find(s=>s.kind===x.kind&&s.endpoint.fingerprint===x.endpoint.fingerprint);w.useLayoutEffect(()=>(g.current+=1,o(""),D(""),r(null),C(!1),N(!1),c(!1),()=>{g.current+=1}),[h.scope,n,f]),w.useLayoutEffect(()=>{},[x?.endpoint.fingerprint]),w.useEffect(()=>{v&&(M(),G())},[M,G,v]);const B=w.useMemo(()=>yt(R,E,s=>Ct(s)&&vt(s,L)),[L,R,E]),q=x?.endpoint.displayUrl??"",K=w.useMemo(()=>q?bt(q):null,[q]),V=w.useCallback(s=>K?kt(s,K):{applicable:!0},[K]),U=w.useMemo(()=>{const s=B.filter(A=>V(A).applicable);return(S?.userName&&S.userEmail?s.find(A=>A.userName===S.userName&&A.userEmail===S.userEmail):void 0)??s.find(A=>A.account&&K?.host&&Mt(A.account.instance)===K.host)??null},[V,B,K,S]),F=(b?.endpoint===x?.endpoint.fingerprint?B.find(s=>s.id===b?.id):null)??U,J=F?Ut(F):null,Z=!!(h.status==="ready"&&T?.binding&&_&&x&&n.configureAuxiliaryBinding&&!j&&F&&V(F).applicable&&(J!=="account"||F?.account)&&(J!=="ssh"||F?.sshCredentialId)),Q=!!(h.status==="ready"&&H&&_&&n.configureAuxiliaryBinding&&!j),se=async()=>{if(!u||m.blocked)return;const s=m.start();if(s){N(!1);try{await Gt({directory:l,git:n,sourceControl:f,parentRemoteName:u,onOperation:s.onOperation})}catch(y){y instanceof _t||N(!0)}finally{s.finish()}}},ee=async s=>{if(s==="configure"&&!Z||s==="remove"&&!Q||!h.isCurrent()||!T?.binding||!_||!x||!n.configureAuxiliaryBinding)return;const y=g.current,A=_e(),z=()=>g.current===y&&A===_e(),W={directory:l,expectedRepositoryId:T.repository.repositoryId,expectedRevision:T.revision,expectedConfigRevision:T.repository.configRevision,parentRemote:u,expectedParentFingerprint:_.fetch.fingerprint,kind:x.kind,path:x.path,expectedEndpointFingerprint:x.endpoint.fingerprint},te=s==="remove"?{...W,operation:s}:F&&ti(F,W);if(!te)return;const ne=Le.captureMutation(h.scope,T);C(!0),N(!1);try{const ie=await n.configureAuxiliaryBinding(te);Le.setMutationResult(ne,ie.binding)||await Le.reconcile(ne,f)}catch{z()&&N(!0),await Le.reconcile(ne,f)}finally{ne.release(),z()&&C(!1)}},a=!!(I.length&&k&&"error"in k&&k.error.code==="AUTHENTICATION_REQUIRED"),d=s=>i(s==="submodule"?"gitView.hydration.kind.submodule":"gitView.hydration.kind.lfs");return t.jsxs(Wt,{open:v,onOpenChange:c,className:ae("min-w-0",e),children:[t.jsxs(Xt,{className:"w-auto justify-start gap-1.5",children:[t.jsx(Ht,{children:i("gitView.hydration.title")}),t.jsx($,{name:v?"arrow-up-s":"arrow-down-s",className:"h-4 w-4 text-muted-foreground"})]}),t.jsx(Yt,{children:t.jsxs(wt,{description:i("gitView.hydration.description"),className:"min-w-0 pt-2",contentClassName:jt,children:[t.jsx(qe,{label:i("gitView.hydration.parentRemote"),controlClassName:Xe,children:t.jsxs(lt,{value:u,onValueChange:s=>{o(s),D(""),r(null)},disabled:!T?.binding||j||m.blocked,children:[t.jsx(rt,{className:"w-fit max-w-[28ch]","aria-label":i("gitView.hydration.parentRemote"),children:t.jsx(ot,{placeholder:i("settings.sourceControl.transport.remoteLabel")})}),t.jsx(ct,{children:T?.binding?.remotes.filter(s=>s.readiness==="ready").map(s=>t.jsx(dt,{value:s.name,children:s.name},s.name))})]})}),t.jsx(Zt,{entry:m.entry,onRefresh:()=>{m.refresh()},onCancel:()=>{m.cancel()}}),a?t.jsx("p",{className:He,children:i("gitView.hydration.authorizationNeeded")}):null,I.length?t.jsx(qe,{label:i("gitView.hydration.endpoint"),controlClassName:Xe,children:t.jsxs(lt,{value:p,onValueChange:D,disabled:j,children:[t.jsx(rt,{className:"w-fit max-w-[28ch]","aria-label":i("gitView.hydration.endpoint"),children:t.jsx(ot,{placeholder:i("gitView.hydration.chooseEndpoint"),children:x?`${x.path} · ${d(x.kind)} · ${x.endpoint.displayUrl}`:void 0})}),t.jsx(ct,{children:I.map(s=>{const y=JSON.stringify([s.kind,s.path,s.endpoint.fingerprint]);return t.jsxs(dt,{value:y,children:[s.path," · ",d(s.kind)," · ",s.endpoint.displayUrl]},y)})})]})}):null,x?t.jsx(t.Fragment,{children:t.jsx(qe,{label:i("gitView.hydration.identity"),controlClassName:Xe,children:t.jsx(St,{activeProfile:F,identities:B,onSelect:s=>r({endpoint:x.endpoint.fingerprint,id:s.id}),isApplying:j,applicability:V,triggerClassName:"w-full max-w-none border border-border",menuAlign:"start",onOpen:()=>{O(f,R.map(s=>s.account))}})})}):null,k?.hydration?.status==="client-missing"?t.jsx("p",{role:"alert",className:ae(He,"text-[var(--status-warning)]"),children:i("gitView.hydration.lfsMissing")}):null,P?t.jsx(Vt,{error:!0,children:i("settings.sourceControl.instance.status.operationFailed")}):null,t.jsxs("div",{className:bi,children:[t.jsx(Y,{size:"sm",variant:"outline",disabled:!u||m.blocked||j,onClick:()=>{se()},children:i("gitView.hydration.retry")}),x?t.jsxs(t.Fragment,{children:[t.jsx(Y,{size:"sm",disabled:!Z,onClick:()=>{ee("configure")},children:i("settings.common.actions.saveChanges")}),H?t.jsx(Y,{size:"sm",variant:"ghost",disabled:!Q,onClick:()=>{ee("remove")},children:i("settings.common.actions.delete")}):null]}):null]})]})})]})};function Ni(l){return l.profiles}function Ci(l){return l.globalIdentity}function Si(l){return l.refreshIdentityAccounts}function ki(l){return l.account}const Ye="border-t border-edge pt-4",Hi=l=>{const e=fe.c(11),{open:i,onOpenChange:n,directory:f}=l,{t:h}=ue(),m=Ge(Vi),u=Ge(Ai);let o;e[0]!==f||e[1]!==n||e[2]!==i||e[3]!==u||e[4]!==m||e[5]!==h?(o=i?t.jsxs(Te,{className:"@container min-w-0 max-h-[85dvh] overflow-y-auto",children:[t.jsxs(Re,{children:[t.jsx(Oe,{children:h("gitView.context.configure")}),t.jsx(Pe,{children:h("gitView.context.description")})]}),t.jsx(wi,{directory:f,className:Ye}),t.jsx(ji,{directory:f,className:Ye}),t.jsxs(Ze,{className:Ye,children:[t.jsx(Y,{size:"sm",variant:"ghost",onClick:()=>{n(!1),m("git"),u(!0)},children:h("gitView.context.settings")}),t.jsx(Y,{size:"sm",variant:"outline",onClick:()=>n(!1),children:h("dialog.common.actions.close")})]})]}):null,e[0]=f,e[1]=n,e[2]=i,e[3]=u,e[4]=m,e[5]=h,e[6]=o):o=e[6];let p;return e[7]!==n||e[8]!==i||e[9]!==o?(p=t.jsx(ze,{open:i,onOpenChange:n,children:o}),e[7]=n,e[8]=i,e[9]=o,e[10]=p):p=e[10],p};function Vi(l){return l.setSettingsPage}function Ai(l){return l.setSettingsDialogOpen}const Gi=({mergeInProgress:l,rebaseInProgress:e,onContinue:i,onAbort:n,onResolveWithAI:f,conflictCount:h=0,isLoading:m=!1})=>{const{t:u}=ue(),[o,p]=w.useState(null),D=l&&l.head,b=e&&(e.headName||e.onto),r=D?"merge":b?"rebase":null;if(!r)return null;const j=async()=>{p("continue");try{await i()}finally{p(null)}},C=async()=>{p("abort");try{await n()}finally{p(null)}},P=o!==null,N=h>0,v=u(r==="merge"?"gitView.operation.merge":"gitView.operation.rebase");let c="";l?c=l.message?u("gitView.operation.mergingMessage",{message:l.message}):u("gitView.operation.mergeInProgressWithHead",{head:l.head}):e&&(c=e.headName?u("gitView.operation.rebasingOnto",{headName:e.headName,onto:e.onto||""}):u("gitView.operation.rebaseInProgress"));const g=N?h===1?u("gitView.operation.inProgressTitleOneConflict",{operation:v,count:h}):u("gitView.operation.inProgressTitleManyConflicts",{operation:v,count:h}):u("gitView.operation.inProgressTitle",{operation:v}),R=u(N?"gitView.operation.resolveConflictsHint":"gitView.operation.readyToContinueHint");return t.jsx("div",{className:"mx-4 mt-3 overflow-hidden rounded-lg bg-[var(--status-warning-background)]",children:t.jsxs("div",{className:"flex flex-col gap-3 p-3",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"typography-label text-[var(--status-warning)]",children:g}),c&&t.jsx("p",{className:"typography-micro break-words text-muted-foreground",children:c})]}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[t.jsx("p",{className:"typography-micro min-w-[12rem] flex-1 text-muted-foreground",children:R}),t.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[t.jsxs(Y,{variant:"ghost",size:"sm",onClick:C,disabled:P||m,className:"gap-1.5",children:[o==="abort"?t.jsx($,{name:"loader-4",className:"size-4 animate-spin"}):t.jsx($,{name:"close",className:"size-4"}),u("gitView.operation.abort")]}),N?f&&t.jsx(Y,{variant:"default",size:"sm",onClick:f,disabled:P||m,children:u("gitView.operation.resolveWithAi")}):t.jsxs(Y,{variant:"default",size:"sm",onClick:j,disabled:P||m,className:"gap-1.5",children:[o==="continue"?t.jsx($,{name:"loader-4",className:"size-4 animate-spin"}):t.jsx($,{name:"check",className:"size-4"}),u("gitView.operation.continue")]})]})]})]})})},ft=()=>Math.floor(Math.random()*1e3);function _i(){const l=fe.c(11),{t:e}=ue(),{triggerFireworks:i}=ii(),n=Nt();let f;l[0]!==n||l[1]!==e||l[2]!==i?(f=(p,D)=>{const{pushAfter:b,origin:r}=D,j=n?Bt(n,p,ut(),ft()):null;return j?de.success(j.title,{description:j.description}):de.success(e("gitView.toast.commitCreated")),j&&!b&&i({kind:"deletion",origin:r}),j!==null},l[0]=n,l[1]=e,l[2]=i,l[3]=f):f=l[3];const h=f;let m;l[4]!==n||l[5]!==e||l[6]!==i?(m=p=>{const{deletion:D,origin:b}=p,r=n?Kt(n,new Date,ut(),ft()):null;r?de.success(r.title,{description:r.description}):de.success(e("gitView.publish.succeeded")),i({kind:D?"deletion":"push",origin:b})},l[4]=n,l[5]=e,l[6]=i,l[7]=m):m=l[7];const u=m;let o;return l[8]!==h||l[9]!==u?(o={committed:h,pushed:u},l[8]=h,l[9]=u,l[10]=o):o=l[10],o}function Bi(l){const e=fe.c(4),i=Nt(),[n]=w.useState(Ii);let f;return e[0]!==i||e[1]!==l||e[2]!==n?(f=(i?qt(i,n.at,n.seed):null)??l,e[0]=i,e[1]=l,e[2]=n,e[3]=f):f=e[3],f}function Ii(){return{at:new Date,seed:Math.floor(Math.random()*1e3)}}export{Fi as C,Mi as D,Gi as I,Hi as R,_i as a,Li as b,$i as c,Bi as u};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{f as ze,r as he,j as i,R as pe}from"./vendor-react--VO_rL_p.js";import{u as He,Q as ee,T as Oe,B as Ve,I as ge,aK as Ye,av as Ze,cj as et,ck as tt,cl as nt,cm as st,cn as ot,co as lt,$ as We,aJ as it,cp as De,cq as at,cr as rt,cs as Be,A as ct,ct as mt}from"./useAppFontEffects-
|
|
1
|
+
import{f as ze,r as he,j as i,R as pe}from"./vendor-react--VO_rL_p.js";import{u as He,Q as ee,T as Oe,B as Ve,I as ge,aK as Ye,av as Ze,cj as et,ck as tt,cl as nt,cm as st,cn as ot,co as lt,$ as We,aJ as it,cp as De,cq as at,cr as rt,cs as Be,A as ct,ct as mt}from"./useAppFontEffects-C_TEX3sk.js";import{O as ft,P as ut,Q as dt}from"./runtimeEndpointReset-CMO7G_Ff.js";import{b0 as qe,aG as ht}from"./katex.min-BCtkGOiC.js";const Ge="inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full text-muted-foreground hover:bg-interactive-hover hover:text-foreground";function Et(n){const e=ze.c(64),{draft:l,onEdit:p,onDelete:f,className:M,maxWidth:q}=n,{t:o}=He(),[R,E]=he.useState(!1),v=l.text;let P;e[0]!==v?(P=v.length>150||v.split(`
|
|
2
2
|
`).length>3,e[0]=v,e[1]=P):P=e[1];const N=P;let A;e[2]!==M?(A=ee("w-full max-w-[min(100%,calc(var(--oc-context-panel-width,100vw)-var(--oc-editor-gutter-width,0px)))] overflow-hidden rounded-xl border border-[var(--interactive-border)] bg-[var(--surface-elevated)] shadow-none",M),e[2]=M,e[3]=A):A=e[3];const G=q?`${Math.max(200,Math.floor(q))}px`:void 0;let $;e[4]!==G?($={maxWidth:G},e[4]=G,e[5]=$):$=e[5];let O;e[6]===Symbol.for("react.memo_cache_sentinel")?(O={backgroundColor:"color-mix(in srgb, var(--surface-muted-foreground) 8%, transparent)"},e[6]=O):O=e[6];let r;e[7]!==l.fileLabel?(r=i.jsx("span",{className:"min-w-0 max-w-[200px] truncate text-xs font-medium text-foreground",title:l.fileLabel,children:l.fileLabel}),e[7]=l.fileLabel,e[8]=r):r=e[8];let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=i.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:"•"}),e[9]=x):x=e[9];let s;e[10]!==l?(s=Oe(l)?"shrink-0":"min-w-0 truncate",e[10]=l,e[11]=s):s=e[11];let K;e[12]!==s?(K=ee("me-auto text-xs text-muted-foreground",s),e[12]=s,e[13]=K):K=e[13];let m;e[14]!==l||e[15]!==o?(m=Oe(l)?o("inlineComment.range.wholeFile"):i.jsxs(i.Fragment,{children:[o("inlineComment.range.lines",{start:l.startLine,end:l.endLine}),l.side?` (${l.side})`:""]}),e[14]=l,e[15]=o,e[16]=m):m=e[16];let F;e[17]!==m||e[18]!==K?(F=i.jsx("span",{className:K,children:m}),e[17]=m,e[18]=K,e[19]=F):F=e[19];let c;e[20]===Symbol.for("react.memo_cache_sentinel")?(c={minHeight:0,minWidth:0},e[20]=c):c=e[20];let z;e[21]!==o?(z=o("inlineComment.actions.editComment"),e[21]=o,e[22]=z):z=e[22];let a;e[23]!==o?(a=o("inlineComment.actions.editComment"),e[23]=o,e[24]=a):a=e[24];let g;e[25]===Symbol.for("react.memo_cache_sentinel")?(g=i.jsx(ge,{name:"pencil",className:"h-3 w-3"}),e[25]=g):g=e[25];let b;e[26]!==p||e[27]!==z||e[28]!==a?(b=i.jsx("button",{type:"button",className:Ge,style:c,onClick:p,"aria-label":z,title:a,children:g}),e[26]=p,e[27]=z,e[28]=a,e[29]=b):b=e[29];let H;e[30]===Symbol.for("react.memo_cache_sentinel")?(H={minHeight:0,minWidth:0},e[30]=H):H=e[30];let w;e[31]!==o?(w=o("inlineComment.actions.deleteComment"),e[31]=o,e[32]=w):w=e[32];let _;e[33]!==o?(_=o("inlineComment.actions.deleteComment"),e[33]=o,e[34]=_):_=e[34];let W;e[35]===Symbol.for("react.memo_cache_sentinel")?(W=i.jsx(ge,{name:"close",className:"h-3 w-3"}),e[35]=W):W=e[35];let C;e[36]!==f||e[37]!==w||e[38]!==_?(C=i.jsx("button",{type:"button",className:Ge,style:H,onClick:f,"aria-label":w,title:_,children:W}),e[36]=f,e[37]=w,e[38]=_,e[39]=C):C=e[39];let D;e[40]!==F||e[41]!==b||e[42]!==C||e[43]!==r?(D=i.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5",style:O,children:[r,x,F,b,C]}),e[40]=F,e[41]=b,e[42]=C,e[43]=r,e[44]=D):D=e[44];const T=R||!N,Q=!R&&N&&"line-clamp-3";let d;e[45]!==Q?(d=ee("whitespace-pre-wrap break-words text-sm leading-relaxed text-foreground",Q),e[45]=Q,e[46]=d):d=e[46];let I;e[47]!==v||e[48]!==d?(I=i.jsx("div",{className:d,children:v}),e[47]=v,e[48]=d,e[49]=I):I=e[49];let y;e[50]!==N||e[51]!==R||e[52]!==o?(y=N&&i.jsx(ft,{asChild:!0,children:i.jsx(Ve,{variant:"ghost",size:"sm",className:"mt-1 h-6 w-full justify-start px-0 text-xs text-muted-foreground hover:text-foreground",children:R?i.jsxs(i.Fragment,{children:[i.jsx(ge,{name:"arrow-up-s",className:"me-1 size-3"}),o("inlineComment.actions.showLess")]}):i.jsxs(i.Fragment,{children:[i.jsx(ge,{name:"arrow-down-s",className:"me-1 size-3"}),o("inlineComment.actions.showMore")]})})}),e[50]=N,e[51]=R,e[52]=o,e[53]=y):y=e[53];let k;e[54]===Symbol.for("react.memo_cache_sentinel")?(k=i.jsx(ut,{}),e[54]=k):k=e[54];let S;e[55]!==T||e[56]!==I||e[57]!==y?(S=i.jsx("div",{className:"px-3 py-2",children:i.jsxs(dt,{open:T,onOpenChange:E,children:[I,y,k]})}),e[55]=T,e[56]=I,e[57]=y,e[58]=S):S=e[58];let j;return e[59]!==A||e[60]!==D||e[61]!==S||e[62]!==$?(j=i.jsxs("div",{className:A,style:$,"data-comment-card":"true",children:[D,S]}),e[59]=A,e[60]=D,e[61]=S,e[62]=$,e[63]=j):j=e[63],j}const pt=120;function Nt(n){const e=ze.c(92),{initialText:l,onTextChange:p,onSave:f,onCancel:M,fileLabel:q,lineRange:o,isEditing:R,className:E,maxWidth:v,bandColor:P,floating:N,band:A}=n,G=l===void 0?"":l,$=N===void 0?!1:N,O=A===void 0?!0:A,{t:r}=He(),{isMobile:x}=Ye(),[s,K]=pe.useState(G),m=he.useRef(null),F=Ze("enter");let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=()=>{const t=m.current;t&&(t.style.height="auto",t.style.height=`${Math.min(t.scrollHeight,pt)}px`)},e[0]=c):c=e[0];const z=c;let a;e[1]!==p?(a=t=>{K(t),p?.(t)},e[1]=p,e[2]=a):a=e[2];const g=a;let b;e[3]!==s?(b=[s],e[3]=s,e[4]=b):b=e[4],pe.useLayoutEffect(z,b);const H=he.useRef(o);let w,_;e[5]!==o?(w=()=>{o&&(H.current=o)},_=[o],e[5]=o,e[6]=w,e[7]=_):(w=e[6],_=e[7]),he.useEffect(w,_);const W=yt;let C;if(e[8]!==q||e[9]!==o||e[10]!==r){const t=W(o);C=[q,t?r("inlineComment.range.lines",{start:t.start,end:t.end}):null].filter(Boolean).join(" • ")||r("inlineComment.actions.comment"),e[8]=q,e[9]=o,e[10]=r,e[11]=C}else C=e[11];const D=C;let T,Q;e[12]!==x?(T=()=>{const t=m.current;if(!t)return;t.focus({preventScroll:!0});const V=t.value.length;t.setSelectionRange(V,V),x&&t.scrollIntoView({behavior:"auto",block:"nearest"})},Q=[x],e[12]=x,e[13]=T,e[14]=Q):(T=e[13],Q=e[14]),he.useEffect(T,Q);const d=et(),I=he.useRef(null);let y;e[15]===Symbol.for("react.memo_cache_sentinel")?(y=()=>{const t=I.current;t!==null&&(I.current=null,m.current?.setSelectionRange(t,t))},e[15]=y):y=e[15];let k;e[16]!==s?(k=[s],e[16]=s,e[17]=k):k=e[17],pe.useLayoutEffect(y,k);let S;e[18]!==g||e[19]!==s?(S=(t,V,Z)=>{const Ae=m.current?.value??s;I.current=t+Z.length,g(`${Ae.slice(0,t)}${Z}${Ae.slice(V)}`),m.current?.focus()},e[18]=g,e[19]=s,e[20]=S):S=e[20];const j=S;let X;e[21]===Symbol.for("react.memo_cache_sentinel")?(X=()=>m.current?.selectionStart??0,e[21]=X):X=e[21];const u=X;let h;e[22]===Symbol.for("react.memo_cache_sentinel")?(h=t=>m.current?st(m.current,t):null,e[22]=h):h=e[22];const J=h;let U;e[23]!==j||e[24]!==s?(U={text:s,getCaret:u,replaceRange:j,caretCoords:J},e[23]=j,e[24]=s,e[25]=U):U=e[25];const L=tt(U),B=nt();let Y;e[26]!==d||e[27]!==j?(Y=t=>{const V=t.currentTarget,Z=d.takePastedImages(t.clipboardData,V.value,{start:V.selectionStart,end:V.selectionEnd});Z&&(t.preventDefault(),j(Z.from,Z.to,Z.insertion))},e[26]=d,e[27]=j,e[28]=Y):Y=e[28];const xe=Y;let be;e[29]!==d||e[30]!==f||e[31]!==s?(be=()=>{s.trim()&&(f(s,W(H.current)),d.attachCitedImages(s))},e[29]=d,e[30]=f,e[31]=s,e[32]=be):be=e[32];const te=be;let Ce;e[33]!==B||e[34]!==L||e[35]!==M||e[36]!==te?(Ce=t=>{ot(t)||L.handleKeyDown(t)||(t.key==="Enter"&&B.shouldSubmit(t)?(t.preventDefault(),te()):t.key==="Escape"&&(t.preventDefault(),M()))},e[33]=B,e[34]=L,e[35]=M,e[36]=te,e[37]=Ce):Ce=e[37];const je=Ce;let ye;e[38]!==te?(ye=t=>{t.stopPropagation(),te()},e[38]=te,e[39]=ye):ye=e[39];const Le=ye,Ie=!$&&O&&"oc-inline-comment-band px-3 py-2";let ne;e[40]!==E||e[41]!==Ie?(ne=ee("w-full max-w-[min(100%,calc(var(--oc-context-panel-width,100vw)-var(--oc-editor-gutter-width,0px)))] font-sans",Ie,E),e[40]=E,e[41]=Ie,e[42]=ne):ne=e[42];const Re=v?`${Math.max(200,Math.floor(v))}px`:void 0,Ee=$||!O?void 0:P;let se;e[43]!==Re||e[44]!==Ee?(se={maxWidth:Re,backgroundColor:Ee},e[43]=Re,e[44]=Ee,e[45]=se):se=e[45];const Xe="true",Ne=Ct,Te=bt,ke=$?"oc-glass-popover oc-glass-floating rounded-3xl ps-4":"oc-raised oc-field rounded-lg bg-[var(--surface-elevated)] ps-3";let oe;e[46]!==ke?(oe=ee("relative flex items-end gap-2 py-1 pe-1 text-foreground",ke),e[46]=ke,e[47]=oe):oe=e[47];const Je=L.picker,Ue=1;let le;e[48]!==L||e[49]!==g?(le=t=>{g(t.target.value),L.sync(t.target.value,t.target.selectionStart,!lt(t.nativeEvent))},e[48]=L,e[49]=g,e[50]=le):le=e[50];let ie;e[51]!==L?(ie=t=>L.sync(t.currentTarget.value,t.currentTarget.selectionStart,!1),e[51]=L,e[52]=ie):ie=e[52];const Me=B.returnKeySends?"send":void 0,Pe=x?r("inlineComment.input.placeholderShort"):r("inlineComment.input.placeholder",{shortcut:F}),$e=x&&"text-base leading-6";let ae;e[53]!==$e?(ae=ee("min-w-0 flex-1 resize-none bg-transparent py-1.5 text-sm leading-5 text-foreground outline-none placeholder:text-muted-foreground",$e),e[53]=$e,e[54]=ae):ae=e[54];let Se;e[55]===Symbol.for("react.memo_cache_sentinel")?(Se={minHeight:0},e[55]=Se):Se=e[55];let re;e[56]!==D||e[57]!==je||e[58]!==xe||e[59]!==le||e[60]!==ie||e[61]!==Me||e[62]!==Pe||e[63]!==ae||e[64]!==s?(re=i.jsx("textarea",{ref:m,rows:Ue,value:s,onChange:le,onSelect:ie,onKeyDown:je,onPaste:xe,enterKeyHint:Me,placeholder:Pe,"aria-label":D,spellCheck:!0,className:ae,style:Se}),e[56]=D,e[57]=je,e[58]=xe,e[59]=le,e[60]=ie,e[61]=Me,e[62]=Pe,e[63]=ae,e[64]=s,e[65]=re):re=e[65];let ve;e[66]!==s?(ve=s.trim(),e[66]=s,e[67]=ve):ve=e[67];const Ke=!ve,Fe=x?"h-9 w-9":"h-8 w-8";let ce;e[68]!==Fe?(ce=ee("mb-0.5 flex shrink-0 items-center justify-center rounded-full bg-[var(--primary-base)] text-[var(--primary-foreground)] transition-opacity duration-150 hover:opacity-90 disabled:opacity-40",Fe),e[68]=Fe,e[69]=ce):ce=e[69];let me;e[70]!==r?(me=r("inlineComment.actions.comment"),e[70]=r,e[71]=me):me=e[71];let fe;e[72]!==r?(fe=r("inlineComment.actions.comment"),e[72]=r,e[73]=fe):fe=e[73];let we;e[74]===Symbol.for("react.memo_cache_sentinel")?(we=i.jsx(ge,{name:"attachment-2",className:"h-4 w-4"}),e[74]=we):we=e[74];let ue;e[75]!==Le||e[76]!==Ke||e[77]!==ce||e[78]!==me||e[79]!==fe?(ue=i.jsx("button",{type:"button",onClick:Le,onPointerDown:gt,onTouchStart:xt,disabled:Ke,className:ce,"aria-label":me,title:fe,children:we}),e[75]=Le,e[76]=Ke,e[77]=ce,e[78]=me,e[79]=fe,e[80]=ue):ue=e[80];let de;e[81]!==L.picker||e[82]!==oe||e[83]!==re||e[84]!==ue?(de=i.jsxs("div",{className:oe,children:[Je,re,ue]}),e[81]=L.picker,e[82]=oe,e[83]=re,e[84]=ue,e[85]=de):de=e[85];let _e;return e[86]!==ne||e[87]!==se||e[88]!==Ne||e[89]!==Te||e[90]!==de?(_e=i.jsx("div",{className:ne,style:se,"data-comment-input":Xe,onPointerDown:Ne,onTouchStart:Te,children:de}),e[86]=ne,e[87]=se,e[88]=Ne,e[89]=Te,e[90]=de,e[91]=_e):_e=e[91],_e}function xt(n){return n.stopPropagation()}function gt(n){return n.stopPropagation()}function bt(n){return n.stopPropagation()}function Ct(n){return n.stopPropagation()}function yt(n){if(!n)return;const e=Math.min(n.start,n.end),l=Math.max(n.start,n.end);return{...n,start:e,end:l}}const St=n=>{const e=Math.min(n.startLine,n.endLine),l=Math.max(n.startLine,n.endLine);return{...n,startLine:e,endLine:l}},Qe=n=>{const e=Math.min(n.start,n.end),l=Math.max(n.start,n.end);return{...n,start:e,end:l}};function Tt(n){const e=ze.c(48),{t:l}=He(),{source:p,fileLabel:f,language:M,getCodeForRange:q,toStoreRange:o,fromDraftRange:R,origin:E}=n;let v;e[0]!==E?(v=qe(E),e[0]=E,e[1]=v):v=e[1];const P=v,N=We(Dt),A=it();let G;e[2]!==N?(G=u=>N?u.getDirectoryForSession(N):null,e[2]=N,e[3]=G):G=e[3];const $=We(G),O=De(_t),r=De(wt),x=De(vt),[s,K]=pe.useState(null),[m,F]=pe.useState(""),[c,z]=pe.useState(null),a=at($??A);let g;e[4]!==a?(g=a?rt(ht(),a.directory,a.sessionKey):null,e[4]=a,e[5]=g):g=e[5];const b=g;let H;e[6]!==b?(H=u=>b?u.drafts[b]??Be:Be,e[6]=b,e[7]=H):H=e[7];const w=De(H);let _;e:{if(!a||!f){let h;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=[],e[8]=h):h=e[8],_=h;break e}let u;if(e[9]!==f||e[10]!==P||e[11]!==w||e[12]!==p){let h;e[14]!==f||e[15]!==P||e[16]!==p?(h=J=>J.source===p&&J.fileLabel===f&&qe(J.origin)===P,e[14]=f,e[15]=P,e[16]=p,e[17]=h):h=e[17],u=w.filter(h),e[9]=f,e[10]=P,e[11]=w,e[12]=p,e[13]=u}else u=e[13];_=u}const W=_;let C;e[18]===Symbol.for("react.memo_cache_sentinel")?(C=()=>{K(null),F(""),z(null)},e[18]=C):C=e[18];const D=C;let T;e[19]===Symbol.for("react.memo_cache_sentinel")?(T=()=>{D()},e[19]=T):T=e[19];const Q=T;let d;e[20]!==R?(d=u=>{const h=Qe(R(u));K(h),F(u.text),z(u.id)},e[20]=R,e[21]=d):d=e[21];const I=d;let y;e[22]!==c||e[23]!==x||e[24]!==a?(y=u=>{a&&(x(a,u.id),c===u.id&&D())},e[22]=c,e[23]=x,e[24]=a,e[25]=y):y=e[25];const k=y;let S;e[26]!==O||e[27]!==c||e[28]!==f||e[29]!==q||e[30]!==M||e[31]!==E||e[32]!==s||e[33]!==p||e[34]!==l||e[35]!==a||e[36]!==o||e[37]!==r?(S=(u,h)=>{const J=h??s,U=u.trim();if(!J||!U||!f)return;if(!a){ct.error(l("inlineComment.toast.selectSessionToSave"));return}const L=Qe(J),B=St(o(L)),Y=q(L),xe=!c;c?r(a,c,{fileLabel:f,startLine:B.startLine,endLine:B.endLine,side:B.side,code:Y,language:M,text:U,origin:E}):O(a,{source:p,fileLabel:f,startLine:B.startLine,endLine:B.endLine,side:B.side,code:Y,language:M,text:U,origin:E}),D(),xe&&requestAnimationFrame(mt)},e[26]=O,e[27]=c,e[28]=f,e[29]=q,e[30]=M,e[31]=E,e[32]=s,e[33]=p,e[34]=l,e[35]=a,e[36]=o,e[37]=r,e[38]=S):S=e[38];const j=S;let X;return e[39]!==m||e[40]!==k||e[41]!==W||e[42]!==c||e[43]!==R||e[44]!==j||e[45]!==s||e[46]!==I?(X={drafts:W,selection:s,setSelection:K,commentText:m,setCommentText:F,editingDraftId:c,setEditingDraftId:z,reset:D,cancel:Q,startEdit:I,deleteDraft:k,saveComment:j,fromDraftRange:R},e[39]=m,e[40]=k,e[41]=W,e[42]=c,e[43]=R,e[44]=j,e[45]=s,e[46]=I,e[47]=X):X=e[47],X}function vt(n){return n.removeDraft}function wt(n){return n.updateDraft}function _t(n){return n.addDraft}function Dt(n){return n.currentSessionId}export{Et as I,Nt as a,Qe as n,Tt as u};
|
package/dist/assets/{useMarkdownLocalAssets-BXBlTj-y.js → useMarkdownLocalAssets-DG5IJM9Y.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as k,R as y,f as R}from"./vendor-react--VO_rL_p.js";import{bg as C}from"./useAppFontEffects-
|
|
1
|
+
import{a as k,R as y,f as R}from"./vendor-react--VO_rL_p.js";import{bg as C}from"./useAppFontEffects-C_TEX3sk.js";const d="data-oc-block-index",g="data-oc-block-key",A=s=>{const e=s.ownerDocument.defaultView;for(let t=s.parentElement;t&&e;t=t.parentElement)if(/auto|scroll/.test(e.getComputedStyle(t).overflowY))return t;return null},b=(s,e)=>{if(!s)return 0;const t=Number.parseFloat(s.ownerDocument.defaultView?.getComputedStyle(s)[e]??"");return Number.isFinite(t)?t:0},L=s=>Array.from(s.querySelectorAll("video, audio")).some(e=>e instanceof HTMLMediaElement&&!e.paused),O=(s,e)=>{let t=5381;for(let n=0;n<e.length;n+=1)t=(t<<5)+t+e.charCodeAt(n)|0;return`${s}:${e.length}:${t>>>0}`},p=new WeakMap,E=24;class D{container=null;scroller=null;attached=!1;near=new Set;pins=new Map;holds=0;selecting=!1;selectionRelease=null;sizes=new Map;kept=new Set;listeners=new Set;stop=null;frame=null;charsPerLine=80;subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});isRendered(e){return this.attached?!this.scroller||this.holds>0||this.near.has(e)||this.pins.has(e):e<E}size(e){return this.sizes.get(e)}attach(e){this.detach(),this.container=e,this.scroller=A(e),this.attached=!0,p.set(e,this);const t=this.scroller;if(!t){this.notify();return}const n=e.ownerDocument,o=n.defaultView,r=()=>this.update(),c=()=>{this.frame!==null||!o||(this.frame=o.requestAnimationFrame(()=>{this.frame=null,this.update()}))},l=globalThis.ResizeObserver?new ResizeObserver(()=>{this.charsPerLine=Math.max(20,Math.round(e.clientWidth/7.5)),this.update(),c()}):null;l?.observe(t),l?.observe(e),this.charsPerLine=Math.max(20,Math.round(e.clientWidth/7.5)),c();const u=()=>{const a=n.getSelection(),h=a&&!a.isCollapsed&&a.rangeCount>0?a.getRangeAt(0):null,i=!!(h&&(e.contains(h.commonAncestorContainer)||h.intersectsNode(e)));h&&i&&!this.selectionRelease&&this.spansUnmounted(h)?this.selectionRelease=this.hold(void 0):!i&&this.selectionRelease&&(this.selectionRelease(),this.selectionRelease=null),i!==this.selecting&&(this.selecting=i,i||this.update())},f=a=>{if(!(a.target instanceof Element)||!a.target.closest("summary"))return;const h=a.target.closest(`[${d}]`)?.getAttribute(g);h&&this.kept.add(h)};t.addEventListener("scroll",r,{passive:!0}),e.addEventListener("click",f,!0),n.addEventListener("selectionchange",u),this.stop=()=>{this.frame!==null&&o?.cancelAnimationFrame(this.frame),this.frame=null,l?.disconnect(),t.removeEventListener("scroll",r),e.removeEventListener("click",f,!0),n.removeEventListener("selectionchange",u)}}detach(){this.stop?.(),this.stop=null,this.container&&p.delete(this.container),this.container=null,this.scroller=null;const e=this.selectionRelease;this.selectionRelease=null,this.selecting=!1,e?.()}hold(e,t=!1){e===void 0?this.holds+=1:this.pins.set(e,(this.pins.get(e)??0)+1),this.notify(t);let n=!1;return()=>{if(!n){if(n=!0,e===void 0)this.holds-=1;else{const o=(this.pins.get(e)??1)-1;o>0?this.pins.set(e,o):this.pins.delete(e)}this.update(),this.notify()}}}update(){const e=this.container,t=this.scroller,n=e?.querySelector("[data-oc-streamdown]");if(!e||!t||!n)return;const o=Array.from(n.children).filter(i=>i instanceof HTMLElement&&i.hasAttribute(d)),r=t.getBoundingClientRect();if(r.height===0)return;const c=r.top-r.height,l=r.bottom+r.height;let u=0,f=o.length;for(;u<f;){const i=u+f>>1;o[i].getBoundingClientRect().bottom<c?u=i+1:f=i}const a=new Set;for(let i=u;i<o.length&&!(o[i].getBoundingClientRect().top>l);i+=1)a.add(Number(o[i].getAttribute(d)));if(this.selecting)for(const i of this.near)a.add(i);if(this.holds===0)for(const i of o){const m=Number(i.getAttribute(d));a.has(m)||this.pins.has(m)||(this.isLive(i)?a.add(m):this.measure(i))}const h=a.size!==this.near.size||[...a].some(i=>!this.near.has(i));this.near=a,h&&this.notify()}isLive(e){if(e.hasAttribute("data-oc-block-placeholder"))return!1;const t=e.getAttribute(g);return t!==null&&this.kept.has(t)||L(e)}spansUnmounted(e){const t=r=>{const l=(r instanceof Element?r:r.parentElement)?.closest(`[${d}]`);return l&&this.container?.contains(l)?Number(l.getAttribute(d)):null},n=t(e.startContainer),o=t(e.endContainer);if(n===null||o===null)return!!this.container?.querySelector("[data-oc-block-placeholder]");for(let r=n;r<=o;r+=1)if(!this.isRendered(r))return!0;return!1}measure(e){const t=e.getAttribute(g);!t||e.hasAttribute("data-oc-block-placeholder")||this.sizes.set(t,{height:e.getBoundingClientRect().height,start:b(e.firstElementChild,"marginBlockStart"),end:b(e.lastElementChild,"marginBlockEnd")})}notify(e=!1){const t=()=>{for(const n of this.listeners)n()};e?k.flushSync(t):t()}}const M=(s,e={})=>{const t=s.closest("[data-markdown-content]")??s.querySelector("[data-markdown-content]"),n=t?p.get(t):void 0;if(!n)return()=>{};const o=e.block?.getAttribute(d);return n.hold(o==null?void 0:Number(o),e.sync)},N=y.createContext(null),S=s=>!!s.trim()&&!s.startsWith("#")&&!s.startsWith("//")&&!/^[a-z][a-z\d+.-]*:/i.test(s),w=s=>{try{return decodeURIComponent(s)}catch{return s}},v=(s,e)=>C(s.slice(0,s.lastIndexOf("/")+1)||"/",w(e.split(/[?#]/,1)[0]??"")),x=(s,e)=>{if(!e||s.defaultPrevented||s.button!==0||s.metaKey||s.ctrlKey||s.shiftKey||s.altKey)return!1;const t=s.currentTarget.getAttribute("href")??"";if(t.startsWith("#")){s.preventDefault(),s.stopPropagation();const n=w(t.slice(1)).toLowerCase(),o=s.currentTarget.closest("[data-markdown-content]"),r=o?M(o,{sync:!0}):null;for(const c of o?.querySelectorAll("h1,h2,h3,h4,h5,h6")??[]){const l=(c.textContent??"").trim().toLowerCase().replace(/[^\p{L}\p{N}\s-]/gu,"").replace(/\s+/g,"-");if(n&&(c.id===n||l===n)){c.scrollIntoView({block:"start"});break}}return r?.(),!0}return S(t)?(s.preventDefault(),s.stopPropagation(),e.onOpenFile(v(e.filePath,t)),!0):!1},K=s=>{const e=R.c(6),{filePath:t,workspaceRoot:n,onOpenFile:o,enabled:r,colorScheme:c}=s;let l;return e[0]!==c||e[1]!==r||e[2]!==t||e[3]!==o||e[4]!==n?(l=r&&t?{filePath:t,workspaceRoot:n,onOpenFile:o,colorScheme:c}:void 0,e[0]=c,e[1]=r,e[2]=t,e[3]=o,e[4]=n,e[5]=l):l=e[5],l};export{g as B,N as M,d as a,O as b,D as c,M as h,S as i,x as o,v as r,K as u};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/useAppFontEffects-
|
|
2
|
-
import{f as F,R as D,r as fe,j as o}from"./vendor-react--VO_rL_p.js";import{u as G,bq as pe,br as he,bs as we,be as $,bt as xe,bu as ee,bv as ge,bw as ie,aI as be,aG as te}from"./katex.min-BBVkbKQY.js";import{u as J,Q as O,I as z,a3 as Se,a4 as ve,a2 as _e,$ as Y,fA as ye,fB as je,n as Ce,fC as Ne,fD as Ie,au as Ee,fE as ke,cg as De,cd as Le,b5 as ze,x as se,fF as ne,fG as Re,fH as Ae,fI as Te,fJ as Fe,f5 as Pe,fK as $e,X as Ge,fL as Oe}from"./useAppFontEffects-DpDiWkkc.js";import{M as re}from"./vendor-base-ui-zhBy6TEG.js";import{o as oe,a as He,f as Me,s as We}from"./vendor-zod-Csf1sqWl.js";import{_ as ae}from"./vendor-vite-runtime-DD1OZmLC.js";function At(){const s=F.c(5),e=G(Be);let t;s[0]===Symbol.for("react.memo_cache_sentinel")?(t=pe(),s[0]=t):t=s[0];const c=t;let i;s[1]!==e?(i=he(e),s[1]=e,s[2]=i):i=s[2];const r=i;let n;return s[3]!==r?(n={usesFramelessChrome:c,side:r},s[3]=r,s[4]=n):n=s[4],n}function Be(s){return s.desktopWindowControlsPosition}const Ve={close:"#FF5F57",minimize:"#FEBC2E",maximize:"#28C940"},Ue="rgba(0, 0, 0, 0.7)",Ze=s=>{const e=F.c(3),{action:t}=s;if(t==="close"){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(z,{name:"close",className:"size-[10px]"}),e[0]=i):i=e[0],i}if(t==="minimize"){let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(z,{name:"subtract",className:"size-[10px]"}),e[1]=i):i=e[1],i}let c;return e[2]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx(z,{name:"add",className:"size-[10px]"}),e[2]=c):c=e[2],c},qe=s=>{const e=F.c(18),{action:t,isMaximized:c,onActivate:i}=s,{t:r}=J(),n=Ve[t];let a;e[0]!==t||e[1]!==c||e[2]!==r?(a=r(t==="close"?"header.windowControls.close":t==="minimize"?"header.windowControls.minimize":c?"header.windowControls.restore":"header.windowControls.maximize"),e[0]=t,e[1]=c,e[2]=r,e[3]=a):a=e[3];const d=a;let u;e[4]!==t||e[5]!==i?(u=()=>i(t),e[4]=t,e[5]=i,e[6]=u):u=e[6];let l;e[7]!==n?(l={backgroundColor:n,color:Ue},e[7]=n,e[8]=l):l=e[8];let m;e[9]!==t?(m=o.jsx("span",{className:"flex items-center justify-center opacity-0 transition-opacity duration-75 group-hover/wctl:opacity-100",children:o.jsx(Ze,{action:t})}),e[9]=t,e[10]=m):m=e[10];let h;e[11]!==l||e[12]!==m?(h=o.jsx("span",{className:"flex size-3.5 items-center justify-center rounded-full shadow-[inset_0_0_0_0.5px_rgba(0,0,0,0.28)] transition-[filter] duration-75 active:brightness-90",style:l,children:m}),e[11]=l,e[12]=m,e[13]=h):h=e[13];let f;return e[14]!==d||e[15]!==u||e[16]!==h?(f=o.jsx("button",{type:"button",onClick:u,title:d,"aria-label":d,className:"app-region-no-drag flex h-8 w-[24px] items-center justify-center rounded-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:h}),e[14]=d,e[15]=u,e[16]=h,e[17]=f):f=e[17],f},Tt=D.memo(function(e){const t=F.c(27),{visible:c,position:i}=e,r=i===void 0?"right":i,{t:n}=J(),[a,d]=D.useState(!1),u=G(Ye);let l,m;if(t[0]!==c?(l=()=>{if(!c)return;let I=!1;$("desktop_get_current_window_state").then(N=>{I||d(!!N?.maximized)}).catch(Ke);const k=N=>{const E=N.detail;d(!!E?.maximized)};return window.addEventListener("openchamber:window-maximized-changed",k),()=>{I=!0,window.removeEventListener("openchamber:window-maximized-changed",k)}},m=[c],t[0]=c,t[1]=l,t[2]=m):(l=t[1],m=t[2]),fe.useEffect(l,m),!c)return null;const h=r==="left";let f,p,w,x,b;if(t[3]!==u||t[4]!==h||t[5]!==a||t[6]!==r||t[7]!==n){b=Symbol.for("react.early_return_sentinel");e:{const I=we(r);let k;t[13]===Symbol.for("react.memo_cache_sentinel")?(k=S=>{if(S==="close"){$("desktop_close_current_window");return}if(S==="minimize"){$("desktop_minimize_current_window");return}$("desktop_toggle_current_window_maximized").then(v=>d(!!v?.maximized)).catch(Je)},t[13]=k):k=t[13];const N=k;if(u==="traffic-lights"){const S=h?"me-1":"ms-1 me-3";let v;t[14]!==S?(v=O("app-region-no-drag group/wctl flex h-8 shrink-0 items-center",S),t[14]=S,t[15]=v):v=t[15];let y;t[16]!==n?(y=n("header.windowControls.groupAria"),t[16]=n,t[17]=y):y=t[17];let j;t[18]!==a?(j=T=>o.jsx(qe,{action:T,isMaximized:a,onActivate:N},T),t[18]=a,t[19]=j):j=t[19],b=o.jsx("div",{dir:"ltr",className:v,"aria-label":y,children:I.map(j)});break e}const E=O("app-region-no-drag inline-flex items-center justify-center text-muted-foreground transition-colors hover:bg-interactive-hover hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",h?"h-8 w-8 rounded-md":"h-12 w-11"),R=h?"app-region-no-drag me-1 flex h-8 shrink-0 items-center":"app-region-no-drag ms-1 flex h-12 shrink-0 items-center",A=S=>S==="minimize"?o.jsx("button",{type:"button",className:E,onClick:Qe,title:n("header.windowControls.minimize"),"aria-label":n("header.windowControls.minimize"),children:o.jsx(z,{name:"subtract",className:"h-4 w-4"})},"minimize"):S==="maximize"?o.jsx("button",{type:"button",className:E,onClick:()=>{$("desktop_toggle_current_window_maximized").then(v=>d(!!v?.maximized)).catch(Xe)},title:n(a?"header.windowControls.restore":"header.windowControls.maximize"),"aria-label":n(a?"header.windowControls.restore":"header.windowControls.maximize"),children:o.jsx(z,{name:a?"fullscreen-exit":"checkbox-blank",className:"h-3.5 w-3.5"})},"maximize"):o.jsx("button",{type:"button",className:O(E,"hover:bg-[var(--status-error)] hover:text-[var(--status-error-foreground)]"),onClick:et,title:n("header.windowControls.close"),"aria-label":n("header.windowControls.close"),children:o.jsx(z,{name:"close",className:"h-4 w-4"})},"close");f="ltr",p=R,t[20]!==n?(w=n("header.windowControls.groupAria"),t[20]=n,t[21]=w):w=t[21],x=I.map(A)}t[3]=u,t[4]=h,t[5]=a,t[6]=r,t[7]=n,t[8]=f,t[9]=p,t[10]=w,t[11]=x,t[12]=b}else f=t[8],p=t[9],w=t[10],x=t[11],b=t[12];if(b!==Symbol.for("react.early_return_sentinel"))return b;let g;return t[22]!==f||t[23]!==p||t[24]!==w||t[25]!==x?(g=o.jsx("div",{dir:f,className:p,"aria-label":w,children:x}),t[22]=f,t[23]=p,t[24]=w,t[25]=x,t[26]=g):g=t[26],g});function Ye(s){return s.desktopWindowControlsStyle}function Ke(){}function Je(){}function Qe(){$("desktop_minimize_current_window")}function Xe(){}function et(){$("desktop_close_current_window")}const X="new-session";function Ft(s){const e=F.c(18),{children:t,variant:c,scopeProjectId:i,align:r}=s,n=c===void 0?"default":c,a=i===void 0?null:i,d=r===void 0?"start":r,u=G(st),l=G(tt);let m;e[0]!==t?(m=o.jsx(Se,{asChild:!0,children:t}),e[0]=t,e[1]=m):m=e[1];const h=n==="compact"?"w-[280px]":"w-[360px]";let f;e[2]!==h?(f=O("overflow-hidden p-1 max-w-[calc(100vw-32px)]",h),e[2]=h,e[3]=f):f=e[3];let p;e[4]!==u||e[5]!==a||e[6]!==l||e[7]!==n?(p=u?o.jsx(nt,{onSelect:()=>l(!1),variant:n,scopeProjectId:a}):null,e[4]=u,e[5]=a,e[6]=l,e[7]=n,e[8]=p):p=e[8];let w;e[9]!==d||e[10]!==f||e[11]!==p?(w=o.jsx(ve,{align:d,sideOffset:6,className:f,children:p}),e[9]=d,e[10]=f,e[11]=p,e[12]=w):w=e[12];let x;return e[13]!==u||e[14]!==l||e[15]!==m||e[16]!==w?(x=o.jsxs(_e,{open:u,onOpenChange:l,modal:!1,disableGlobalShortcuts:!0,children:[m,w]}),e[13]=u,e[14]=l,e[15]=m,e[16]=w,e[17]=x):x=e[17],x}function tt(s){return s.setSessionDropdownOpen}function st(s){return s.isSessionDropdownOpen}function nt(s){const e=F.c(31),{onSelect:t,variant:c,scopeProjectId:i}=s,r=Y(rt),n=Y(it);let a;e[0]!==r||e[1]!==i?(a={scopeProjectId:i,currentSessionId:r},e[0]=r,e[1]=i,e[2]=a):a=e[2];const d=ye(!0,a),u=Y(ot),{t:l}=J();let m;e[3]!==t||e[4]!==u?(m=()=>{t(),u()},e[3]=t,e[4]=u,e[5]=m):m=e[5];const h=m;let f;e[6]===Symbol.for("react.memo_cache_sentinel")?(f=new Set,e[6]=f):f=e[6];const[p,w]=D.useState(f),x=D.useRef(null),b=D.useRef(!1),g=n?X:r;let I;e[7]===Symbol.for("react.memo_cache_sentinel")?(I=_=>{w(q=>{const C=new Set(q);return C.has(_)?C.delete(_):C.add(_),C})},e[7]=I):I=e[7];const k=I;let N,E;e[8]!==p||e[9]!==g||e[10]!==d?(N=()=>{if(b.current||!g)return;const _=g===X?[]:je(d,g);if(!_)return;if(_.some(C=>!p.has(C))){w(C=>new Set([...C,..._]));return}const q=requestAnimationFrame(()=>{const C=Array.from(x.current?.querySelectorAll("[data-switcher-item-id]")??[]).find(P=>P.dataset.switcherItemId===g);C&&(C.focus(),C.scrollIntoView({block:"nearest"}),b.current=!0)});return()=>cancelAnimationFrame(q)},E=[p,g,d],e[8]=p,e[9]=g,e[10]=d,e[11]=N,e[12]=E):(N=e[11],E=e[12]),D.useLayoutEffect(N,E);let R,A;e[13]===Symbol.for("react.memo_cache_sentinel")?(R=O("group relative flex w-full cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 outline-hidden select-none","data-[highlighted]:bg-interactive-hover hover:bg-interactive-hover"),A=o.jsx(z,{name:"chat-new",className:"h-4 w-4 flex-shrink-0 text-muted-foreground"}),e[13]=R,e[14]=A):(R=e[13],A=e[14]);let S;e[15]!==l?(S=l("sessions.sidebar.header.actions.newSession"),e[15]=l,e[16]=S):S=e[16];let v;e[17]!==S?(v=o.jsx("span",{className:"truncate typography-ui-label font-normal leading-tight text-foreground",children:S}),e[17]=S,e[18]=v):v=e[18];let y;e[19]!==h||e[20]!==v?(y=o.jsxs(re,{"data-switcher-item-id":X,onClick:h,className:R,children:[A,v]}),e[19]=h,e[20]=v,e[21]=y):y=e[21];let j;e[22]!==p||e[23]!==d||e[24]!==t||e[25]!==l||e[26]!==c?(j=d.length===0?o.jsx("div",{className:"px-3 py-4 text-center typography-meta text-muted-foreground",children:l("sessions.switcher.empty")}):d.map(_=>o.jsx(le,{item:_,depth:0,variant:c,expandedParents:p,toggleParent:k,closeDropdown:t},_.node.session.id)),e[22]=p,e[23]=d,e[24]=t,e[25]=l,e[26]=c,e[27]=j):j=e[27];let T;return e[28]!==y||e[29]!==j?(T=o.jsx(Ce,{ref:x,outerClassName:"max-h-[60vh]",disableHorizontal:!0,children:o.jsxs("div",{className:"space-y-0.5",children:[y,j]})}),e[28]=y,e[29]=j,e[30]=T):T=e[30],T}function ot(s){return s.openNewSessionDraft}function it(s){return s.newSessionDraft.open===!0}function rt(s){return s.currentSessionId}function le(s){const e=F.c(31),{item:t,depth:c,variant:i,expandedParents:r,toggleParent:n,closeDropdown:a}=s,{node:d,secondaryMeta:u}=t,l=d.session,m=d.children.length>0;let h;e[0]!==r||e[1]!==l.id?(h=r.has(l.id),e[0]=r,e[1]=l.id,e[2]=h):h=e[2];const f=h;let p;e[3]!==m||e[4]!==l.id||e[5]!==n?(p=m?()=>n(l.id):void 0,e[3]=m,e[4]=l.id,e[5]=n,e[6]=p):p=e[6];let w;e[7]!==a||e[8]!==c||e[9]!==m||e[10]!==f||e[11]!==u||e[12]!==l||e[13]!==p||e[14]!==i?(w=o.jsx(at,{session:l,depth:c,variant:i,secondaryMeta:u,hasChildren:m,isExpanded:f,onToggleExpand:p,closeDropdown:a}),e[7]=a,e[8]=c,e[9]=m,e[10]=f,e[11]=u,e[12]=l,e[13]=p,e[14]=i,e[15]=w):w=e[15];let x;e[16]!==a||e[17]!==c||e[18]!==r||e[19]!==m||e[20]!==f||e[21]!==t.groupDirectory||e[22]!==t.projectId||e[23]!==d.children||e[24]!==u||e[25]!==n||e[26]!==i?(x=m&&f?d.children.map(g=>o.jsx(le,{item:{node:g,projectId:t.projectId,groupDirectory:t.groupDirectory,secondaryMeta:u},depth:c+1,variant:i,expandedParents:r,toggleParent:n,closeDropdown:a},g.session.id)):null,e[16]=a,e[17]=c,e[18]=r,e[19]=m,e[20]=f,e[21]=t.groupDirectory,e[22]=t.projectId,e[23]=d.children,e[24]=u,e[25]=n,e[26]=i,e[27]=x):x=e[27];let b;return e[28]!==w||e[29]!==x?(b=o.jsxs(o.Fragment,{children:[w,x]}),e[28]=w,e[29]=x,e[30]=b):b=e[30],b}function at(s){const e=F.c(55),{session:t,depth:c,variant:i,secondaryMeta:r,hasChildren:n,isExpanded:a,onToggleExpand:d,closeDropdown:u}=s,{t:l}=J(),m=Y(ct),h=Y(lt),f=Ne(t.id),p=m===t.id;let w;e[0]!==t.title||e[1]!==l?(w=t.title?.trim()||l("sessions.sidebar.session.untitled"),e[0]=t.title,e[1]=l,e[2]=w):w=e[2];const x=w,b=Ie(t.id),g=b!==null,I=Ee(g),k=!g&&f&&!p;let N;if(e[3]!==t){const L=ke(t)||Date.now();N=De(L),e[3]=t,e[4]=N}else N=e[4];const E=N;let R;e[5]!==r?.projectLabel?(R=r?.projectLabel?.trim()||null,e[5]=r?.projectLabel,e[6]=R):R=e[6];const A=R;let S;e[7]!==r?.branchLabel?(S=r?.branchLabel?.trim()||null,e[7]=r?.branchLabel,e[8]=S):S=e[8];const v=S,y=v&&v!=="HEAD"?v:null;let j;e[9]!==u||e[10]!==p||e[11]!==t||e[12]!==h?(j=()=>{if(p){u();return}const L=ze(t);h(t.id,L??null),u()},e[9]=u,e[10]=p,e[11]=t,e[12]=h,e[13]=j):j=e[13];const T=j;let _;e[14]!==T?(_=L=>{if(L.target?.closest("[data-switcher-expand]")){L.preventDefault();return}T()},e[14]=T,e[15]=_):_=e[15];const q=t.id,C=p&&"bg-interactive-selection text-interactive-selection-foreground hover:bg-interactive-selection data-[highlighted]:bg-interactive-selection";let P;e[16]!==C?(P=O("group relative flex w-full cursor-pointer items-start gap-2 rounded-lg px-2 py-1.5 outline-hidden select-none","data-[highlighted]:bg-interactive-hover hover:bg-interactive-hover",C),e[16]=C,e[17]=P):P=e[17];const Q=8+c*12;let H;e[18]!==Q?(H={paddingInlineStart:Q},e[18]=Q,e[19]=H):H=e[19];let M;e[20]!==n||e[21]!==a||e[22]!==d||e[23]!==l||e[24]!==i?(M=i==="compact"&&n?o.jsx("span",{role:"button",tabIndex:-1,"data-switcher-expand":!0,onClick:L=>{L.preventDefault(),L.stopPropagation(),d?.()},className:"inline-flex h-3.5 w-3.5 flex-shrink-0 items-center justify-center rounded text-muted-foreground hover:text-foreground","aria-label":l(a?"sessions.sidebar.session.subsessions.collapse":"sessions.sidebar.session.subsessions.expand"),children:a?o.jsx(z,{name:"arrow-down-s",className:"h-3.5 w-3.5"}):o.jsx(z,{name:"arrow-right-s",className:"h-3.5 w-3.5"})}):null,e[20]=n,e[21]=a,e[22]=d,e[23]=l,e[24]=i,e[25]=M):M=e[25];let W;e[26]!==x?(W=o.jsx("span",{dir:"auto",className:"truncate oc-ui-start-align typography-ui-label font-normal leading-tight text-foreground",children:x}),e[26]=x,e[27]=W):W=e[27];let B;e[28]!==M||e[29]!==W?(B=o.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[M,W]}),e[28]=M,e[29]=W,e[30]=B):B=e[30];let V;e[31]!==y||e[32]!==n||e[33]!==a||e[34]!==d||e[35]!==A||e[36]!==l||e[37]!==E||e[38]!==i?(V=i==="default"?o.jsxs("div",{className:"flex min-w-0 items-center gap-1.5 truncate text-muted-foreground leading-tight",style:{fontSize:"calc(var(--text-ui-label) * 0.85)"},children:[n?o.jsx("span",{role:"button",tabIndex:-1,"data-switcher-expand":!0,onClick:L=>{L.preventDefault(),L.stopPropagation(),d?.()},className:"inline-flex h-3 w-3 flex-shrink-0 items-center justify-center rounded text-muted-foreground hover:text-foreground","aria-label":l(a?"sessions.sidebar.session.subsessions.collapse":"sessions.sidebar.session.subsessions.expand"),children:a?o.jsx(z,{name:"arrow-down-s",className:"h-3 w-3"}):o.jsx(z,{name:"arrow-right-s",className:"h-3 w-3"})}):null,o.jsx("span",{className:"flex-shrink-0",children:E}),A?o.jsx("span",{className:"truncate",children:A}):null,y?o.jsxs("span",{className:"inline-flex min-w-0 items-center gap-0.5",children:[o.jsx(z,{name:"git-branch",className:"h-3 w-3 flex-shrink-0 text-muted-foreground"}),o.jsx("span",{className:"truncate",children:y})]}):null]}):null,e[31]=y,e[32]=n,e[33]=a,e[34]=d,e[35]=A,e[36]=l,e[37]=E,e[38]=i,e[39]=V):V=e[39];let U;e[40]!==B||e[41]!==V?(U=o.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[B,V]}),e[40]=B,e[41]=V,e[42]=U):U=e[42];let Z;e[43]!==g||e[44]!==I||e[45]!==k||e[46]!==b?(Z=g||k?o.jsx("span",{className:"flex h-3 w-3 flex-shrink-0 items-center justify-center self-center",children:o.jsx(Le,{state:b??"unread",runningClassName:O("h-2 w-2",I)})}):null,e[43]=g,e[44]=I,e[45]=k,e[46]=b,e[47]=Z):Z=e[47];let K;return e[48]!==t.id||e[49]!==H||e[50]!==U||e[51]!==Z||e[52]!==_||e[53]!==P?(K=o.jsxs(re,{onClick:_,"data-slot":"session-switcher-item","data-switcher-item-id":q,className:P,style:H,children:[U,Z]}),e[48]=t.id,e[49]=H,e[50]=U,e[51]=Z,e[52]=_,e[53]=P,e[54]=K):K=e[54],K}function lt(s){return s.setCurrentSession}function ct(s){return s.currentSessionId}const Pt=s=>!Number.isFinite(s)||s<=0?new Intl.NumberFormat(se(),{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2}).format(0):new Intl.NumberFormat(se(),{style:"currency",currency:"USD",minimumFractionDigits:s<.01?4:2,maximumFractionDigits:s<.01?4:2}).format(s),dt="ui-store",ut=oe({state:oe({contextSurfaceZones:He(We(),Me())})}),mt=s=>{if(!s)return null;let e;try{e=JSON.parse(s)}catch{return null}const t=ut.safeParse(e);return t.success?ge.parse(t.data.state.contextSurfaceZones):null},$t=()=>{const s=e=>{if(e.key!==dt)return;const t=mt(e.newValue);if(!t)return;const c=G.getState().contextSurfaceZones,i=new Set([...Object.keys(c),...Object.keys(t)].filter(xe));for(const r of i){const n=ee(t,r);n!==ee(G.getState().contextSurfaceZones,r)&&G.getState().moveContextSurfaceToZone(r,n)}};return window.addEventListener("storage",s),()=>window.removeEventListener("storage",s)},ft=D.lazy(()=>ae(()=>import("./useAppFontEffects-DpDiWkkc.js").then(s=>s.rH),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179])).then(s=>({default:s.GuestAttachDialog}))),ce=D.lazy(()=>ae(()=>import("./useAppFontEffects-DpDiWkkc.js").then(s=>s.rG),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179])).then(s=>({default:s.PluginPane}))),Gt=()=>{const s=F.c(11),e=ne(pt),t=ne(ht),c=Re(wt),i=Ae(xt);let r;s[0]!==i?(r=i.map(gt),s[0]=i,s[1]=r):r=s[1];let n;s[2]!==t||s[3]!==e?(n=e?o.jsx(D.Suspense,{fallback:null,children:o.jsx(ft,{guestId:e.guestId,item:e.item,onOpenChange:u=>{u||t()}})}):null,s[2]=t,s[3]=e,s[4]=n):n=s[4];let a;s[5]!==c?(a=c?o.jsx("div",{"aria-hidden":"true",className:"pointer-events-none fixed top-0 -inset-s-[9999px] h-px w-px overflow-hidden",children:o.jsx(D.Suspense,{fallback:null,children:o.jsx(ce,{mode:ie(c),surface:"panel",headless:!0})})}):null,s[5]=c,s[6]=a):a=s[6];let d;return s[7]!==r||s[8]!==n||s[9]!==a?(d=o.jsxs(o.Fragment,{children:[r,n,a]}),s[7]=r,s[8]=n,s[9]=a,s[10]=d):d=s[10],d};function pt(s){return s.request}function ht(s){return s.close}function wt(s){return s.guestId}function xt(s){return s.requests}function gt(s){return o.jsx("div",{"aria-hidden":"true",inert:!0,className:"pointer-events-none fixed top-0 -inset-s-[9999px] h-px w-px overflow-hidden",children:o.jsx(D.Suspense,{fallback:null,children:o.jsx(ce,{mode:ie(s.guestId),surface:"background",headless:!0,backgroundAction:s})})},s.id)}const bt=45e3,St=[1e3,2e3,4e3],de={isHidden:()=>!1,onVisible:()=>()=>{}},vt=()=>()=>{},_t=()=>typeof document>"u"?de:{isHidden:()=>document.visibilityState==="hidden",onVisible:s=>{const e=()=>{document.visibilityState!=="hidden"&&s()};return document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)}},yt=(s,e,t=window.setTimeout.bind(window),c=window.clearTimeout.bind(window),i=de,r=vt)=>{let n=!1,a,d=0,u=!1,l=!1,m=!1,h=!1;const f=async x=>{l=!0,m=!1;const b=await x().catch(()=>!1);if(l=!1,n)return;if(u||=b,!u&&m){f(e);return}const g=u?void 0:St[d];g!==void 0&&(d+=1),a=t(()=>{if(a=void 0,i.isHidden()){h=!0;return}f(e)},g??bt)},p=i.onVisible(()=>{!h||n||(h=!1,f(e))}),w=r(()=>{if(!(n||u)){if(l){m=!0;return}a!==void 0&&c(a),a=void 0,h=!1,f(e)}});return f(s),()=>{n=!0,p(),w(),a!==void 0&&c(a)}},Ot=s=>{const e=F.c(3);let t,c;e[0]!==s?(t=()=>{const i=jt;let r=i();const n=be(()=>{r(),r=i()});return()=>{n(),r()}},c=[s],e[0]=s,e[1]=t,e[2]=c):(t=e[1],c=e[2]),D.useEffect(t,c)};function jt(){const s=te();let e=!0;const t=async i=>(i?await Te(Fe()):await Pe(),!e||te()!==s?!1:($e(),Ge.getState().status==="ready")),c=yt(()=>t(!0),()=>t(!1),window.setTimeout.bind(window),window.clearTimeout.bind(window),_t(),i=>Oe(r=>{r===s&&i()}));return()=>{e=!1,c()}}const ue=()=>{const s=[document.documentElement,document.body],e=document.getElementById("root");return e&&s.push(e),s},me=()=>{let s=!1;for(const e of ue())e.scrollTop!==0&&(e.scrollTop=0,s=!0),e.scrollLeft!==0&&(e.scrollLeft=0,s=!0);return s},Ct=s=>s===document||ue().some(e=>e===s),Ht=()=>{const s=F.c(1);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],s[0]=e):e=s[0],D.useEffect(It,e)};function Nt(s){Ct(s.target)&&me()}function It(){const s=Nt;return document.addEventListener("scroll",s,{capture:!0,passive:!0}),me(),()=>document.removeEventListener("scroll",s,{capture:!0})}export{Gt as G,Ft as S,Tt as W,$t as a,Ht as b,Ot as c,Pt as f,At as u};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/useAppFontEffects-C_TEX3sk.js","assets/vendor-react--VO_rL_p.js","assets/vendor-scheduler-7OC5HNn7.js","assets/katex.min-BCtkGOiC.js","assets/vendor-vite-runtime-DD1OZmLC.js","assets/vendor-zustand-C9tWdk0j.js","assets/vendor-zod-Csf1sqWl.js","assets/vendor-opencode-client-CqFY51gT.js","assets/vendor-fuse.js-Dw8P0qyA.js","assets/vendor-streamdown-BbSYZ3NF.js","assets/vendor-markdown-BTUqNk6W.js","assets/vendor-mdast-util-from-markdown-CZHjOE75.js","assets/vendor-micromark-util-decode-numeric-character-reference-CNs1qBpV.js","assets/vendor-micromark-util-decode-string-fHsnqYdj.js","assets/vendor-decode-named-character-reference-C3-224fz.js","assets/vendor-micromark-util-normalize-identifier-C9ANKk3v.js","assets/vendor-micromark-AWM-NZXP.js","assets/vendor-micromark-util-combine-extensions-d8XJZrgA.js","assets/vendor-micromark-util-chunked-DrRIdSP-.js","assets/vendor-micromark-factory-space-PzSHLgmq.js","assets/vendor-micromark-util-character-CW3Cu1MS.js","assets/vendor-micromark-core-commonmark-kzTLNXAm.js","assets/vendor-micromark-util-classify-character-tcLuZZwM.js","assets/vendor-micromark-util-resolve-all-PQCKh0dx.js","assets/vendor-micromark-util-subtokenize-BF1Jf29a.js","assets/vendor-micromark-factory-destination-Sj0xfi0V.js","assets/vendor-micromark-factory-label-amyP0HdC.js","assets/vendor-micromark-factory-title-khnLkZK6.js","assets/vendor-micromark-factory-whitespace-eIB00uTl.js","assets/vendor-micromark-util-html-tag-name-DbKNfynz.js","assets/vendor-unist-util-stringify-position-Ch_qCilz.js","assets/vendor-mdast-util-to-string-C_aolqmU.js","assets/vendor-unist-util-visit-DhPeCsfG.js","assets/vendor-unist-util-visit-parents-DlviEg7Z.js","assets/vendor-unist-util-is-BPZGFiMU.js","assets/vendor-hast-util-raw-DvvLJg15.js","assets/vendor-ungap-structured-clone--gfxRhYI.js","assets/vendor-html-void-elements-CkdplsNl.js","assets/vendor-parse5-DwmzEj2o.js","assets/vendor-entities-wUUgTZDW.js","assets/vendor-web-namespaces-bsVAaBS1.js","assets/vendor-zwitch-C2o2j-tx.js","assets/vendor-unist-util-position-60F3QETU.js","assets/vendor-hast-util-from-parse5-Ba3T6RJI.js","assets/vendor-devlop-0Dp3JUBc.js","assets/vendor-property-information-Boo8Xpef.js","assets/vendor-hastscript-BrPNioaz.js","assets/vendor-comma-separated-tokens-CRUGqg4f.js","assets/vendor-space-separated-tokens-D7QSIrTI.js","assets/vendor-hast-util-parse-selector-TXfch5wI.js","assets/vendor-vfile-location-LfEFwJ2h.js","assets/vendor-hast-util-to-parse5-BoysVIPW.js","assets/vendor-hast-util-sanitize-2aGO5ay8.js","assets/vendor-micromark-extension-gfm-CsfPlnlB.js","assets/vendor-micromark-extension-gfm-autolink-literal-BYug7onl.js","assets/vendor-micromark-extension-gfm-footnote-OFl1FCH2.js","assets/vendor-micromark-extension-gfm-strikethrough-CyFiuwBf.js","assets/vendor-micromark-extension-gfm-table-dgw4LfUw.js","assets/vendor-micromark-extension-gfm-task-list-item-Dnadzr9U.js","assets/vendor-mdast-util-gfm-CroMDYLM.js","assets/vendor-mdast-util-gfm-autolink-literal-CTruMtvI.js","assets/vendor-ccount-c2V3InAJ.js","assets/vendor-mdast-util-find-and-replace-DB9iC-bx.js","assets/vendor-escape-string-regexp-BaJN9MlJ.js","assets/vendor-mdast-util-gfm-footnote-C-csI7OF.js","assets/vendor-mdast-util-gfm-strikethrough-BcskTdio.js","assets/vendor-mdast-util-gfm-table-DhPwQIyj.js","assets/vendor-markdown-table-DvhhVmnL.js","assets/vendor-mdast-util-to-markdown-Cl3qaiyc.js","assets/vendor-longest-streak-CtXnX3Xp.js","assets/vendor-mdast-util-phrasing-4oVbNLC3.js","assets/vendor-mdast-util-gfm-task-list-item-DMU5mK_M.js","assets/vendor-mdast-util-to-hast-CWnLaQSO.js","assets/vendor-micromark-util-sanitize-uri-BbwQ7CLk.js","assets/vendor-trim-lines-D8znQY54.js","assets/vendor-micromark-extension-cjk-friendly-BzZDGrF5.js","assets/vendor-micromark-extension-cjk-friendly-util-D5lVNoxW.js","assets/vendor-get-east-asian-width-CPhS2cOv.js","assets/vendor-micromark-util-symbol-JJPacVTp.js","assets/vendor-mdast-util-to-markdown-cjk-friendly-BZ3pe_qd.js","assets/vendor-micromark-extension-cjk-friendly-gfm-strikethrough-CqW-Ep4M.js","assets/vendor-mdast-util-to-markdown-cjk-friendly-gfm-strikethrough-BdPDQFO7.js","assets/vendor-hast-util-from-html-isomorphic-B0Kn01s9.js","assets/vendor-hast-util-from-dom-DeNf9aYW.js","assets/vendor-katex-DBqql0K7.js","assets/vendor-hast-util-to-text-0GXLnBvt.js","assets/vendor-hast-util-is-element-CuOmiqQi.js","assets/vendor-unist-util-find-after-CMaZmLxc.js","assets/vendor-micromark-extension-math-BRFoDziv.js","assets/vendor-mdast-util-math-wB-IJCL0.js","assets/vendor-remend-r8cP_t-e.js","assets/vendor-clsx-B-dksMZM.js","assets/vendor-tailwind-merge-BKkUfl9q.js","assets/vendor-marked-DN3zOnEe.js","assets/vendor-hast-util-to-jsx-runtime-Bq6JeJCx.js","assets/vendor-style-to-js-CI2G4dgu.js","assets/vendor-style-to-object-BAv4SQXc.js","assets/vendor-inline-style-parser-BlqBsVO4.js","assets/vendor-hast-util-whitespace-D4Wp6AEg.js","assets/vendor-estree-util-is-identifier-name-BgBfM8ME.js","assets/vendor-vfile-message-DqhD22jI.js","assets/vendor-unified-1CQKw2_w.js","assets/vendor-bail-FqpXQuLt.js","assets/vendor-extend-B94qxKr5.js","assets/vendor-is-plain-obj-C1gvLhAf.js","assets/vendor-trough-B_b8ryxu.js","assets/vendor-vfile-BCWrK60u.js","assets/vendor-html-url-attributes-D46m5wfe.js","assets/vendor-capacitor-core-B4EWRrHz.js","assets/katex-arxpHWv8.css","assets/vendor-base-ui-zhBy6TEG.js","assets/vendor-floating-ui-utils-BzXdqYpP.js","assets/vendor-floating-ui-dom-WyXykhNi.js","assets/vendor-floating-ui-core-CXmKXOXc.js","assets/vendor-floating-ui-react-dom-Cy8dRGoy.js","assets/vendor-use-sync-external-store-CfLJGVyr.js","assets/vendor-simplewebauthn-browser-VDA66rT_.js","assets/vendor-dnd-kit-core-Br1Cs7RV.js","assets/vendor-dnd-kit-utilities-DZ9KbT5S.js","assets/vendor-dnd-kit-accessibility-CYclfhtC.js","assets/vendor-dnd-kit-sortable-DpfLEOLv.js","assets/vendor-tanstack-react-virtual-C_IilPt1.js","assets/vendor-tanstack-virtual-core-DsQgKrou.js","assets/vendor-framer-motion-C_wK4GIM.js","assets/vendor-motion-dom-HXPOMxb7.js","assets/vendor-motion-utils-BGh8QBgx.js","assets/vendor-codemirror-commands-CjjsURR-.js","assets/vendor-codemirror-state-Cd8udR5z.js","assets/vendor-marijn-find-cluster-break-DXwl3gUT.js","assets/vendor-codemirror-view-Ciie9ey-.js","assets/vendor-style-mod-NZ5MEPvj.js","assets/vendor-w3c-keyname-Vcq4gwWv.js","assets/vendor-crelt-C8TCjufn.js","assets/vendor-codemirror-language-8HZTPOnt.js","assets/vendor-lezer-common-B3-cUCR_.js","assets/vendor-lezer-highlight-CZEcqU6G.js","assets/vendor-codemirror-streamparser-CmlTsbN2.js","assets/vendor-codemirror-lang-javascript-DmqaSK_j.js","assets/vendor-lezer-javascript-CWSwshuO.js","assets/vendor-lezer-lr-bhwg1HMg.js","assets/vendor-codemirror-autocomplete-BGedy2gC.js","assets/vendor-codemirror-lang-json-DVAYKmoO.js","assets/vendor-lezer-json-Cn1mncjr.js","assets/vendor-codemirror-lang-css-BLpgXfL2.js","assets/vendor-lezer-css-B2Hx_Nps.js","assets/vendor-codemirror-lang-html-S3jxr3Mo.js","assets/vendor-lezer-html-Cr8K5DGw.js","assets/vendor-codemirror-lang-markdown-D1jveRI5.js","assets/vendor-lezer-markdown-TQKzBB8i.js","assets/vendor-codemirror-language-data-Cy549AYN.js","assets/vendor-codemirror-lang-python-B-5UC9Ui.js","assets/vendor-lezer-python-BUoImtUb.js","assets/vendor-sonner-Dw26OnzC.js","assets/vendor-cmdk-BtSpU-Io.js","assets/vendor-radix-ui-react-dialog-OIW6VLWw.js","assets/vendor-radix-ui-primitive-Dc_FVRD7.js","assets/vendor-radix-ui-react-compose-refs-D4RvEbuR.js","assets/vendor-radix-ui-react-context-BbFoxCHu.js","assets/vendor-radix-ui-react-id-aGag8i_5.js","assets/vendor-radix-ui-react-use-layout-effect-B1oLzD-j.js","assets/vendor-radix-ui-react-use-controllable-state-BjnNPGHq.js","assets/vendor-radix-ui-react-dismissable-layer-DpT6mMbO.js","assets/vendor-radix-ui-react-primitive-CrN9dRDb.js","assets/vendor-radix-ui-react-slot-BjbalUfz.js","assets/vendor-radix-ui-react-use-callback-ref-CcC_buIU.js","assets/vendor-radix-ui-react-use-escape-keydown-Cp1WWKTC.js","assets/vendor-radix-ui-react-focus-scope-D1noLHmd.js","assets/vendor-radix-ui-react-portal-BlUEzfrF.js","assets/vendor-radix-ui-react-presence-BGqFfiW4.js","assets/vendor-radix-ui-react-focus-guards-CSS2IbZC.js","assets/vendor-react-remove-scroll-Der_cv-1.js","assets/vendor-tslib-De9GV7Vy.js","assets/vendor-react-remove-scroll-bar-Clwl9llp.js","assets/vendor-react-style-singleton-D_xJlTqU.js","assets/vendor-get-nonce-C-Z93AgS.js","assets/vendor-use-sidecar-BdLl6ZIw.js","assets/vendor-use-callback-ref-CXJF1lEr.js","assets/vendor-aria-hidden-DvXkyWUv.js","assets/vendor-legendapp-list-DAdshx9l.js","assets/vendor-class-variance-authority-5VPnzWs2.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{f as F,R as D,r as fe,j as o}from"./vendor-react--VO_rL_p.js";import{u as G,bq as pe,br as he,bs as we,be as $,bt as xe,bu as ee,bv as ge,bw as ie,aI as be,aG as te}from"./katex.min-BCtkGOiC.js";import{u as J,Q as O,I as z,a3 as Se,a4 as ve,a2 as _e,$ as Y,fA as ye,fB as je,n as Ce,fC as Ne,fD as Ie,au as Ee,fE as ke,cg as De,cd as Le,b5 as ze,x as se,fF as ne,fG as Re,fH as Ae,fI as Te,fJ as Fe,f5 as Pe,fK as $e,X as Ge,fL as Oe}from"./useAppFontEffects-C_TEX3sk.js";import{M as re}from"./vendor-base-ui-zhBy6TEG.js";import{o as oe,a as He,f as Me,s as We}from"./vendor-zod-Csf1sqWl.js";import{_ as ae}from"./vendor-vite-runtime-DD1OZmLC.js";function At(){const s=F.c(5),e=G(Be);let t;s[0]===Symbol.for("react.memo_cache_sentinel")?(t=pe(),s[0]=t):t=s[0];const c=t;let i;s[1]!==e?(i=he(e),s[1]=e,s[2]=i):i=s[2];const r=i;let n;return s[3]!==r?(n={usesFramelessChrome:c,side:r},s[3]=r,s[4]=n):n=s[4],n}function Be(s){return s.desktopWindowControlsPosition}const Ve={close:"#FF5F57",minimize:"#FEBC2E",maximize:"#28C940"},Ue="rgba(0, 0, 0, 0.7)",Ze=s=>{const e=F.c(3),{action:t}=s;if(t==="close"){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(z,{name:"close",className:"size-[10px]"}),e[0]=i):i=e[0],i}if(t==="minimize"){let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(z,{name:"subtract",className:"size-[10px]"}),e[1]=i):i=e[1],i}let c;return e[2]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx(z,{name:"add",className:"size-[10px]"}),e[2]=c):c=e[2],c},qe=s=>{const e=F.c(18),{action:t,isMaximized:c,onActivate:i}=s,{t:r}=J(),n=Ve[t];let a;e[0]!==t||e[1]!==c||e[2]!==r?(a=r(t==="close"?"header.windowControls.close":t==="minimize"?"header.windowControls.minimize":c?"header.windowControls.restore":"header.windowControls.maximize"),e[0]=t,e[1]=c,e[2]=r,e[3]=a):a=e[3];const d=a;let u;e[4]!==t||e[5]!==i?(u=()=>i(t),e[4]=t,e[5]=i,e[6]=u):u=e[6];let l;e[7]!==n?(l={backgroundColor:n,color:Ue},e[7]=n,e[8]=l):l=e[8];let m;e[9]!==t?(m=o.jsx("span",{className:"flex items-center justify-center opacity-0 transition-opacity duration-75 group-hover/wctl:opacity-100",children:o.jsx(Ze,{action:t})}),e[9]=t,e[10]=m):m=e[10];let h;e[11]!==l||e[12]!==m?(h=o.jsx("span",{className:"flex size-3.5 items-center justify-center rounded-full shadow-[inset_0_0_0_0.5px_rgba(0,0,0,0.28)] transition-[filter] duration-75 active:brightness-90",style:l,children:m}),e[11]=l,e[12]=m,e[13]=h):h=e[13];let f;return e[14]!==d||e[15]!==u||e[16]!==h?(f=o.jsx("button",{type:"button",onClick:u,title:d,"aria-label":d,className:"app-region-no-drag flex h-8 w-[24px] items-center justify-center rounded-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:h}),e[14]=d,e[15]=u,e[16]=h,e[17]=f):f=e[17],f},Tt=D.memo(function(e){const t=F.c(27),{visible:c,position:i}=e,r=i===void 0?"right":i,{t:n}=J(),[a,d]=D.useState(!1),u=G(Ye);let l,m;if(t[0]!==c?(l=()=>{if(!c)return;let I=!1;$("desktop_get_current_window_state").then(N=>{I||d(!!N?.maximized)}).catch(Ke);const k=N=>{const E=N.detail;d(!!E?.maximized)};return window.addEventListener("openchamber:window-maximized-changed",k),()=>{I=!0,window.removeEventListener("openchamber:window-maximized-changed",k)}},m=[c],t[0]=c,t[1]=l,t[2]=m):(l=t[1],m=t[2]),fe.useEffect(l,m),!c)return null;const h=r==="left";let f,p,w,x,b;if(t[3]!==u||t[4]!==h||t[5]!==a||t[6]!==r||t[7]!==n){b=Symbol.for("react.early_return_sentinel");e:{const I=we(r);let k;t[13]===Symbol.for("react.memo_cache_sentinel")?(k=S=>{if(S==="close"){$("desktop_close_current_window");return}if(S==="minimize"){$("desktop_minimize_current_window");return}$("desktop_toggle_current_window_maximized").then(v=>d(!!v?.maximized)).catch(Je)},t[13]=k):k=t[13];const N=k;if(u==="traffic-lights"){const S=h?"me-1":"ms-1 me-3";let v;t[14]!==S?(v=O("app-region-no-drag group/wctl flex h-8 shrink-0 items-center",S),t[14]=S,t[15]=v):v=t[15];let y;t[16]!==n?(y=n("header.windowControls.groupAria"),t[16]=n,t[17]=y):y=t[17];let j;t[18]!==a?(j=T=>o.jsx(qe,{action:T,isMaximized:a,onActivate:N},T),t[18]=a,t[19]=j):j=t[19],b=o.jsx("div",{dir:"ltr",className:v,"aria-label":y,children:I.map(j)});break e}const E=O("app-region-no-drag inline-flex items-center justify-center text-muted-foreground transition-colors hover:bg-interactive-hover hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",h?"h-8 w-8 rounded-md":"h-12 w-11"),R=h?"app-region-no-drag me-1 flex h-8 shrink-0 items-center":"app-region-no-drag ms-1 flex h-12 shrink-0 items-center",A=S=>S==="minimize"?o.jsx("button",{type:"button",className:E,onClick:Qe,title:n("header.windowControls.minimize"),"aria-label":n("header.windowControls.minimize"),children:o.jsx(z,{name:"subtract",className:"h-4 w-4"})},"minimize"):S==="maximize"?o.jsx("button",{type:"button",className:E,onClick:()=>{$("desktop_toggle_current_window_maximized").then(v=>d(!!v?.maximized)).catch(Xe)},title:n(a?"header.windowControls.restore":"header.windowControls.maximize"),"aria-label":n(a?"header.windowControls.restore":"header.windowControls.maximize"),children:o.jsx(z,{name:a?"fullscreen-exit":"checkbox-blank",className:"h-3.5 w-3.5"})},"maximize"):o.jsx("button",{type:"button",className:O(E,"hover:bg-[var(--status-error)] hover:text-[var(--status-error-foreground)]"),onClick:et,title:n("header.windowControls.close"),"aria-label":n("header.windowControls.close"),children:o.jsx(z,{name:"close",className:"h-4 w-4"})},"close");f="ltr",p=R,t[20]!==n?(w=n("header.windowControls.groupAria"),t[20]=n,t[21]=w):w=t[21],x=I.map(A)}t[3]=u,t[4]=h,t[5]=a,t[6]=r,t[7]=n,t[8]=f,t[9]=p,t[10]=w,t[11]=x,t[12]=b}else f=t[8],p=t[9],w=t[10],x=t[11],b=t[12];if(b!==Symbol.for("react.early_return_sentinel"))return b;let g;return t[22]!==f||t[23]!==p||t[24]!==w||t[25]!==x?(g=o.jsx("div",{dir:f,className:p,"aria-label":w,children:x}),t[22]=f,t[23]=p,t[24]=w,t[25]=x,t[26]=g):g=t[26],g});function Ye(s){return s.desktopWindowControlsStyle}function Ke(){}function Je(){}function Qe(){$("desktop_minimize_current_window")}function Xe(){}function et(){$("desktop_close_current_window")}const X="new-session";function Ft(s){const e=F.c(18),{children:t,variant:c,scopeProjectId:i,align:r}=s,n=c===void 0?"default":c,a=i===void 0?null:i,d=r===void 0?"start":r,u=G(st),l=G(tt);let m;e[0]!==t?(m=o.jsx(Se,{asChild:!0,children:t}),e[0]=t,e[1]=m):m=e[1];const h=n==="compact"?"w-[280px]":"w-[360px]";let f;e[2]!==h?(f=O("overflow-hidden p-1 max-w-[calc(100vw-32px)]",h),e[2]=h,e[3]=f):f=e[3];let p;e[4]!==u||e[5]!==a||e[6]!==l||e[7]!==n?(p=u?o.jsx(nt,{onSelect:()=>l(!1),variant:n,scopeProjectId:a}):null,e[4]=u,e[5]=a,e[6]=l,e[7]=n,e[8]=p):p=e[8];let w;e[9]!==d||e[10]!==f||e[11]!==p?(w=o.jsx(ve,{align:d,sideOffset:6,className:f,children:p}),e[9]=d,e[10]=f,e[11]=p,e[12]=w):w=e[12];let x;return e[13]!==u||e[14]!==l||e[15]!==m||e[16]!==w?(x=o.jsxs(_e,{open:u,onOpenChange:l,modal:!1,disableGlobalShortcuts:!0,children:[m,w]}),e[13]=u,e[14]=l,e[15]=m,e[16]=w,e[17]=x):x=e[17],x}function tt(s){return s.setSessionDropdownOpen}function st(s){return s.isSessionDropdownOpen}function nt(s){const e=F.c(31),{onSelect:t,variant:c,scopeProjectId:i}=s,r=Y(rt),n=Y(it);let a;e[0]!==r||e[1]!==i?(a={scopeProjectId:i,currentSessionId:r},e[0]=r,e[1]=i,e[2]=a):a=e[2];const d=ye(!0,a),u=Y(ot),{t:l}=J();let m;e[3]!==t||e[4]!==u?(m=()=>{t(),u()},e[3]=t,e[4]=u,e[5]=m):m=e[5];const h=m;let f;e[6]===Symbol.for("react.memo_cache_sentinel")?(f=new Set,e[6]=f):f=e[6];const[p,w]=D.useState(f),x=D.useRef(null),b=D.useRef(!1),g=n?X:r;let I;e[7]===Symbol.for("react.memo_cache_sentinel")?(I=_=>{w(q=>{const C=new Set(q);return C.has(_)?C.delete(_):C.add(_),C})},e[7]=I):I=e[7];const k=I;let N,E;e[8]!==p||e[9]!==g||e[10]!==d?(N=()=>{if(b.current||!g)return;const _=g===X?[]:je(d,g);if(!_)return;if(_.some(C=>!p.has(C))){w(C=>new Set([...C,..._]));return}const q=requestAnimationFrame(()=>{const C=Array.from(x.current?.querySelectorAll("[data-switcher-item-id]")??[]).find(P=>P.dataset.switcherItemId===g);C&&(C.focus(),C.scrollIntoView({block:"nearest"}),b.current=!0)});return()=>cancelAnimationFrame(q)},E=[p,g,d],e[8]=p,e[9]=g,e[10]=d,e[11]=N,e[12]=E):(N=e[11],E=e[12]),D.useLayoutEffect(N,E);let R,A;e[13]===Symbol.for("react.memo_cache_sentinel")?(R=O("group relative flex w-full cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 outline-hidden select-none","data-[highlighted]:bg-interactive-hover hover:bg-interactive-hover"),A=o.jsx(z,{name:"chat-new",className:"h-4 w-4 flex-shrink-0 text-muted-foreground"}),e[13]=R,e[14]=A):(R=e[13],A=e[14]);let S;e[15]!==l?(S=l("sessions.sidebar.header.actions.newSession"),e[15]=l,e[16]=S):S=e[16];let v;e[17]!==S?(v=o.jsx("span",{className:"truncate typography-ui-label font-normal leading-tight text-foreground",children:S}),e[17]=S,e[18]=v):v=e[18];let y;e[19]!==h||e[20]!==v?(y=o.jsxs(re,{"data-switcher-item-id":X,onClick:h,className:R,children:[A,v]}),e[19]=h,e[20]=v,e[21]=y):y=e[21];let j;e[22]!==p||e[23]!==d||e[24]!==t||e[25]!==l||e[26]!==c?(j=d.length===0?o.jsx("div",{className:"px-3 py-4 text-center typography-meta text-muted-foreground",children:l("sessions.switcher.empty")}):d.map(_=>o.jsx(le,{item:_,depth:0,variant:c,expandedParents:p,toggleParent:k,closeDropdown:t},_.node.session.id)),e[22]=p,e[23]=d,e[24]=t,e[25]=l,e[26]=c,e[27]=j):j=e[27];let T;return e[28]!==y||e[29]!==j?(T=o.jsx(Ce,{ref:x,outerClassName:"max-h-[60vh]",disableHorizontal:!0,children:o.jsxs("div",{className:"space-y-0.5",children:[y,j]})}),e[28]=y,e[29]=j,e[30]=T):T=e[30],T}function ot(s){return s.openNewSessionDraft}function it(s){return s.newSessionDraft.open===!0}function rt(s){return s.currentSessionId}function le(s){const e=F.c(31),{item:t,depth:c,variant:i,expandedParents:r,toggleParent:n,closeDropdown:a}=s,{node:d,secondaryMeta:u}=t,l=d.session,m=d.children.length>0;let h;e[0]!==r||e[1]!==l.id?(h=r.has(l.id),e[0]=r,e[1]=l.id,e[2]=h):h=e[2];const f=h;let p;e[3]!==m||e[4]!==l.id||e[5]!==n?(p=m?()=>n(l.id):void 0,e[3]=m,e[4]=l.id,e[5]=n,e[6]=p):p=e[6];let w;e[7]!==a||e[8]!==c||e[9]!==m||e[10]!==f||e[11]!==u||e[12]!==l||e[13]!==p||e[14]!==i?(w=o.jsx(at,{session:l,depth:c,variant:i,secondaryMeta:u,hasChildren:m,isExpanded:f,onToggleExpand:p,closeDropdown:a}),e[7]=a,e[8]=c,e[9]=m,e[10]=f,e[11]=u,e[12]=l,e[13]=p,e[14]=i,e[15]=w):w=e[15];let x;e[16]!==a||e[17]!==c||e[18]!==r||e[19]!==m||e[20]!==f||e[21]!==t.groupDirectory||e[22]!==t.projectId||e[23]!==d.children||e[24]!==u||e[25]!==n||e[26]!==i?(x=m&&f?d.children.map(g=>o.jsx(le,{item:{node:g,projectId:t.projectId,groupDirectory:t.groupDirectory,secondaryMeta:u},depth:c+1,variant:i,expandedParents:r,toggleParent:n,closeDropdown:a},g.session.id)):null,e[16]=a,e[17]=c,e[18]=r,e[19]=m,e[20]=f,e[21]=t.groupDirectory,e[22]=t.projectId,e[23]=d.children,e[24]=u,e[25]=n,e[26]=i,e[27]=x):x=e[27];let b;return e[28]!==w||e[29]!==x?(b=o.jsxs(o.Fragment,{children:[w,x]}),e[28]=w,e[29]=x,e[30]=b):b=e[30],b}function at(s){const e=F.c(55),{session:t,depth:c,variant:i,secondaryMeta:r,hasChildren:n,isExpanded:a,onToggleExpand:d,closeDropdown:u}=s,{t:l}=J(),m=Y(ct),h=Y(lt),f=Ne(t.id),p=m===t.id;let w;e[0]!==t.title||e[1]!==l?(w=t.title?.trim()||l("sessions.sidebar.session.untitled"),e[0]=t.title,e[1]=l,e[2]=w):w=e[2];const x=w,b=Ie(t.id),g=b!==null,I=Ee(g),k=!g&&f&&!p;let N;if(e[3]!==t){const L=ke(t)||Date.now();N=De(L),e[3]=t,e[4]=N}else N=e[4];const E=N;let R;e[5]!==r?.projectLabel?(R=r?.projectLabel?.trim()||null,e[5]=r?.projectLabel,e[6]=R):R=e[6];const A=R;let S;e[7]!==r?.branchLabel?(S=r?.branchLabel?.trim()||null,e[7]=r?.branchLabel,e[8]=S):S=e[8];const v=S,y=v&&v!=="HEAD"?v:null;let j;e[9]!==u||e[10]!==p||e[11]!==t||e[12]!==h?(j=()=>{if(p){u();return}const L=ze(t);h(t.id,L??null),u()},e[9]=u,e[10]=p,e[11]=t,e[12]=h,e[13]=j):j=e[13];const T=j;let _;e[14]!==T?(_=L=>{if(L.target?.closest("[data-switcher-expand]")){L.preventDefault();return}T()},e[14]=T,e[15]=_):_=e[15];const q=t.id,C=p&&"bg-interactive-selection text-interactive-selection-foreground hover:bg-interactive-selection data-[highlighted]:bg-interactive-selection";let P;e[16]!==C?(P=O("group relative flex w-full cursor-pointer items-start gap-2 rounded-lg px-2 py-1.5 outline-hidden select-none","data-[highlighted]:bg-interactive-hover hover:bg-interactive-hover",C),e[16]=C,e[17]=P):P=e[17];const Q=8+c*12;let H;e[18]!==Q?(H={paddingInlineStart:Q},e[18]=Q,e[19]=H):H=e[19];let M;e[20]!==n||e[21]!==a||e[22]!==d||e[23]!==l||e[24]!==i?(M=i==="compact"&&n?o.jsx("span",{role:"button",tabIndex:-1,"data-switcher-expand":!0,onClick:L=>{L.preventDefault(),L.stopPropagation(),d?.()},className:"inline-flex h-3.5 w-3.5 flex-shrink-0 items-center justify-center rounded text-muted-foreground hover:text-foreground","aria-label":l(a?"sessions.sidebar.session.subsessions.collapse":"sessions.sidebar.session.subsessions.expand"),children:a?o.jsx(z,{name:"arrow-down-s",className:"h-3.5 w-3.5"}):o.jsx(z,{name:"arrow-right-s",className:"h-3.5 w-3.5"})}):null,e[20]=n,e[21]=a,e[22]=d,e[23]=l,e[24]=i,e[25]=M):M=e[25];let W;e[26]!==x?(W=o.jsx("span",{dir:"auto",className:"truncate oc-ui-start-align typography-ui-label font-normal leading-tight text-foreground",children:x}),e[26]=x,e[27]=W):W=e[27];let B;e[28]!==M||e[29]!==W?(B=o.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[M,W]}),e[28]=M,e[29]=W,e[30]=B):B=e[30];let V;e[31]!==y||e[32]!==n||e[33]!==a||e[34]!==d||e[35]!==A||e[36]!==l||e[37]!==E||e[38]!==i?(V=i==="default"?o.jsxs("div",{className:"flex min-w-0 items-center gap-1.5 truncate text-muted-foreground leading-tight",style:{fontSize:"calc(var(--text-ui-label) * 0.85)"},children:[n?o.jsx("span",{role:"button",tabIndex:-1,"data-switcher-expand":!0,onClick:L=>{L.preventDefault(),L.stopPropagation(),d?.()},className:"inline-flex h-3 w-3 flex-shrink-0 items-center justify-center rounded text-muted-foreground hover:text-foreground","aria-label":l(a?"sessions.sidebar.session.subsessions.collapse":"sessions.sidebar.session.subsessions.expand"),children:a?o.jsx(z,{name:"arrow-down-s",className:"h-3 w-3"}):o.jsx(z,{name:"arrow-right-s",className:"h-3 w-3"})}):null,o.jsx("span",{className:"flex-shrink-0",children:E}),A?o.jsx("span",{className:"truncate",children:A}):null,y?o.jsxs("span",{className:"inline-flex min-w-0 items-center gap-0.5",children:[o.jsx(z,{name:"git-branch",className:"h-3 w-3 flex-shrink-0 text-muted-foreground"}),o.jsx("span",{className:"truncate",children:y})]}):null]}):null,e[31]=y,e[32]=n,e[33]=a,e[34]=d,e[35]=A,e[36]=l,e[37]=E,e[38]=i,e[39]=V):V=e[39];let U;e[40]!==B||e[41]!==V?(U=o.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[B,V]}),e[40]=B,e[41]=V,e[42]=U):U=e[42];let Z;e[43]!==g||e[44]!==I||e[45]!==k||e[46]!==b?(Z=g||k?o.jsx("span",{className:"flex h-3 w-3 flex-shrink-0 items-center justify-center self-center",children:o.jsx(Le,{state:b??"unread",runningClassName:O("h-2 w-2",I)})}):null,e[43]=g,e[44]=I,e[45]=k,e[46]=b,e[47]=Z):Z=e[47];let K;return e[48]!==t.id||e[49]!==H||e[50]!==U||e[51]!==Z||e[52]!==_||e[53]!==P?(K=o.jsxs(re,{onClick:_,"data-slot":"session-switcher-item","data-switcher-item-id":q,className:P,style:H,children:[U,Z]}),e[48]=t.id,e[49]=H,e[50]=U,e[51]=Z,e[52]=_,e[53]=P,e[54]=K):K=e[54],K}function lt(s){return s.setCurrentSession}function ct(s){return s.currentSessionId}const Pt=s=>!Number.isFinite(s)||s<=0?new Intl.NumberFormat(se(),{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2}).format(0):new Intl.NumberFormat(se(),{style:"currency",currency:"USD",minimumFractionDigits:s<.01?4:2,maximumFractionDigits:s<.01?4:2}).format(s),dt="ui-store",ut=oe({state:oe({contextSurfaceZones:He(We(),Me())})}),mt=s=>{if(!s)return null;let e;try{e=JSON.parse(s)}catch{return null}const t=ut.safeParse(e);return t.success?ge.parse(t.data.state.contextSurfaceZones):null},$t=()=>{const s=e=>{if(e.key!==dt)return;const t=mt(e.newValue);if(!t)return;const c=G.getState().contextSurfaceZones,i=new Set([...Object.keys(c),...Object.keys(t)].filter(xe));for(const r of i){const n=ee(t,r);n!==ee(G.getState().contextSurfaceZones,r)&&G.getState().moveContextSurfaceToZone(r,n)}};return window.addEventListener("storage",s),()=>window.removeEventListener("storage",s)},ft=D.lazy(()=>ae(()=>import("./useAppFontEffects-C_TEX3sk.js").then(s=>s.rH),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179])).then(s=>({default:s.GuestAttachDialog}))),ce=D.lazy(()=>ae(()=>import("./useAppFontEffects-C_TEX3sk.js").then(s=>s.rG),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179])).then(s=>({default:s.PluginPane}))),Gt=()=>{const s=F.c(11),e=ne(pt),t=ne(ht),c=Re(wt),i=Ae(xt);let r;s[0]!==i?(r=i.map(gt),s[0]=i,s[1]=r):r=s[1];let n;s[2]!==t||s[3]!==e?(n=e?o.jsx(D.Suspense,{fallback:null,children:o.jsx(ft,{guestId:e.guestId,item:e.item,onOpenChange:u=>{u||t()}})}):null,s[2]=t,s[3]=e,s[4]=n):n=s[4];let a;s[5]!==c?(a=c?o.jsx("div",{"aria-hidden":"true",className:"pointer-events-none fixed top-0 -inset-s-[9999px] h-px w-px overflow-hidden",children:o.jsx(D.Suspense,{fallback:null,children:o.jsx(ce,{mode:ie(c),surface:"panel",headless:!0})})}):null,s[5]=c,s[6]=a):a=s[6];let d;return s[7]!==r||s[8]!==n||s[9]!==a?(d=o.jsxs(o.Fragment,{children:[r,n,a]}),s[7]=r,s[8]=n,s[9]=a,s[10]=d):d=s[10],d};function pt(s){return s.request}function ht(s){return s.close}function wt(s){return s.guestId}function xt(s){return s.requests}function gt(s){return o.jsx("div",{"aria-hidden":"true",inert:!0,className:"pointer-events-none fixed top-0 -inset-s-[9999px] h-px w-px overflow-hidden",children:o.jsx(D.Suspense,{fallback:null,children:o.jsx(ce,{mode:ie(s.guestId),surface:"background",headless:!0,backgroundAction:s})})},s.id)}const bt=45e3,St=[1e3,2e3,4e3],de={isHidden:()=>!1,onVisible:()=>()=>{}},vt=()=>()=>{},_t=()=>typeof document>"u"?de:{isHidden:()=>document.visibilityState==="hidden",onVisible:s=>{const e=()=>{document.visibilityState!=="hidden"&&s()};return document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)}},yt=(s,e,t=window.setTimeout.bind(window),c=window.clearTimeout.bind(window),i=de,r=vt)=>{let n=!1,a,d=0,u=!1,l=!1,m=!1,h=!1;const f=async x=>{l=!0,m=!1;const b=await x().catch(()=>!1);if(l=!1,n)return;if(u||=b,!u&&m){f(e);return}const g=u?void 0:St[d];g!==void 0&&(d+=1),a=t(()=>{if(a=void 0,i.isHidden()){h=!0;return}f(e)},g??bt)},p=i.onVisible(()=>{!h||n||(h=!1,f(e))}),w=r(()=>{if(!(n||u)){if(l){m=!0;return}a!==void 0&&c(a),a=void 0,h=!1,f(e)}});return f(s),()=>{n=!0,p(),w(),a!==void 0&&c(a)}},Ot=s=>{const e=F.c(3);let t,c;e[0]!==s?(t=()=>{const i=jt;let r=i();const n=be(()=>{r(),r=i()});return()=>{n(),r()}},c=[s],e[0]=s,e[1]=t,e[2]=c):(t=e[1],c=e[2]),D.useEffect(t,c)};function jt(){const s=te();let e=!0;const t=async i=>(i?await Te(Fe()):await Pe(),!e||te()!==s?!1:($e(),Ge.getState().status==="ready")),c=yt(()=>t(!0),()=>t(!1),window.setTimeout.bind(window),window.clearTimeout.bind(window),_t(),i=>Oe(r=>{r===s&&i()}));return()=>{e=!1,c()}}const ue=()=>{const s=[document.documentElement,document.body],e=document.getElementById("root");return e&&s.push(e),s},me=()=>{let s=!1;for(const e of ue())e.scrollTop!==0&&(e.scrollTop=0,s=!0),e.scrollLeft!==0&&(e.scrollLeft=0,s=!0);return s},Ct=s=>s===document||ue().some(e=>e===s),Ht=()=>{const s=F.c(1);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],s[0]=e):e=s[0],D.useEffect(It,e)};function Nt(s){Ct(s.target)&&me()}function It(){const s=Nt;return document.addEventListener("scroll",s,{capture:!0,passive:!0}),me(),()=>document.removeEventListener("scroll",s,{capture:!0})}export{Gt as G,Ft as S,Tt as W,$t as a,Ht as b,Ot as c,Pt as f,At as u};
|