@neuralnomads/codenomad-dev 0.13.3-dev-20260403-d0a0325d → 0.13.3-dev-20260404-7996e514

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neuralnomads/codenomad-dev",
3
- "version": "0.13.3-dev-20260403-d0a0325d",
3
+ "version": "0.13.3-dev-20260404-7996e514",
4
4
  "description": "CodeNomad Server",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -1,2 +1,2 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-BCffFoQZ.js","assets/git-diff-vendor-CAv-4upN.js","assets/fast-diff-vendor-DgdwVvTQ.js","assets/highlight-vendor-8FKMu9os.js","assets/git-diff-vendor-HAZkIolJ.css"])))=>i.map(i=>d[i]);
2
- import{_ as K}from"./index-CJQRbTtv.js";import{m as B,t as g,i as a,d as w,a as F,f as N}from"./monaco-viewer-BCffFoQZ.js";import{c as f,n as c,a as L,F as T,S as W,z as j,A as q}from"./git-diff-vendor-CAv-4upN.js";import{D as G}from"./DiffToolbar-ysD8YAOp.js";import{S as H}from"./SplitFilePanel-DyezmCo2.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";import"./main-BpgxtqbO.js";import"./wrap-text-CIfNyrm2.js";var J=g('<div class="file-viewer-panel flex-1"><div class="file-viewer-content file-viewer-content--monaco">'),E=g("<div class=file-viewer-empty><span class=file-viewer-empty-text>"),Q=g('<div class="p-3 text-xs text-secondary">'),R=g("<div><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text></span></div><div class=file-list-item-stats><span class=file-list-item-additions>+</span><span class=file-list-item-deletions>-"),U=g("<span class=files-tab-selected-path><span class=file-path-text>"),X=g('<div class=files-tab-stats style="flex:0 0 auto"><span class="files-tab-stat files-tab-stat-additions"><span class=files-tab-stat-value>+</span></span><span class="files-tab-stat files-tab-stat-deletions"><span class=files-tab-stat-value>-'),Y=g("<div style=margin-left:auto>");const Z=q(()=>K(()=>import("./monaco-viewer-BCffFoQZ.js").then(e=>e.ab),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.MonacoDiffViewer}))),fe=e=>{const M=f(()=>e.activeSessionId()),S=f(()=>!!(M()&&M()!=="info")),D=f(()=>S()?e.activeSessionDiffs():null),m=f(()=>{const n=D();return Array.isArray(n)?[...n].sort((i,l)=>String(i.file||"").localeCompare(String(l.file||""))):[]}),I=f(()=>m().reduce((n,i)=>(n.additions+=typeof i.additions=="number"?i.additions:0,n.deletions+=typeof i.deletions=="number"?i.deletions:0,n),{additions:0,deletions:0})),O=f(()=>{const n=m();return n.length===0?null:n.reduce((i,l)=>{const v=typeof(i==null?void 0:i.additions)=="number"?i.additions:0,y=typeof(i==null?void 0:i.deletions)=="number"?i.deletions:0,x=v+y,k=typeof(l==null?void 0:l.additions)=="number"?l.additions:0,t=typeof(l==null?void 0:l.deletions)=="number"?l.deletions:0,r=k+t;return r>x?l:r<x?i:String(l.file||"").localeCompare(String((i==null?void 0:i.file)||""))<0?l:i},n[0])}),P=f(()=>{const n=e.selectedFile(),i=m();if(n){const l=i.find(v=>v.file===n);if(l)return l}return O()}),p=f(()=>`${e.instanceId}:${S()?M():"no-session"}`),V=f(()=>{if(!S())return e.t("instanceShell.sessionChanges.noSessionSelected");const n=D();return n===void 0?e.t("instanceShell.sessionChanges.loading"):!Array.isArray(n)||n.length===0?e.t("instanceShell.sessionChanges.empty"):e.t("instanceShell.filesShell.viewerEmpty")}),A=f(()=>{const n=P();return n!=null&&n.file?String(n.file):e.t("instanceShell.rightPanel.tabs.changes")});return B(()=>{const n=m(),i=I(),l=P(),v=()=>(()=>{var t=J(),r=t.firstChild;return a(r,c(W,{get when(){return l&&S()&&n.length>0?l:null},get fallback(){return(()=>{var o=E(),s=o.firstChild;return a(s,V),o})()},children:o=>c(j,{get fallback(){return(()=>{var s=E(),u=s.firstChild;return a(u,()=>e.t("instanceInfo.loading")),s})()},get children(){return c(Z,{get scopeKey(){return p()},get path(){return String(o().file||"")},get before(){return String(o().before||"")},get after(){return String(o().after||"")},get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrap(){return e.diffWordWrapMode()}})}})})),t})(),y=()=>(()=>{var t=Q();return a(t,V),t})();return c(H,{get header(){return[(()=>{var t=U(),r=t.firstChild;return a(r,A),L(()=>w(t,"title",A())),t})(),(()=>{var t=X(),r=t.firstChild,o=r.firstChild;o.firstChild;var s=r.nextSibling,u=s.firstChild;return u.firstChild,a(o,()=>i.additions,null),a(u,()=>i.deletions,null),t})(),(()=>{var t=Y();return a(t,c(G,{get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrapMode(){return e.diffWordWrapMode()},get onViewModeChange(){return e.onViewModeChange},get onContextModeChange(){return e.onContextModeChange},get onWordWrapModeChange(){return e.onWordWrapModeChange}})),t})()]},list:{panel:()=>c(W,{get when(){return n.length>0},get fallback(){return y()},get children(){return c(T,{each:n,children:t=>(()=>{var r=R(),o=r.firstChild,s=o.firstChild,u=s.firstChild,b=s.nextSibling,h=b.firstChild;h.firstChild;var C=h.nextSibling;return C.firstChild,r.$$click=()=>{e.onSelectFile(t.file,e.isPhoneLayout())},a(u,()=>t.file),a(h,()=>t.additions,null),a(C,()=>t.deletions,null),L(d=>{var _=`file-list-item ${(l==null?void 0:l.file)===t.file?"file-list-item-active":""}`,$=t.file;return _!==d.e&&F(r,d.e=_),$!==d.t&&w(s,"title",d.t=$),d},{e:void 0,t:void 0}),r})()})}}),overlay:()=>c(W,{get when(){return n.length>0},get fallback(){return y()},get children(){return c(T,{each:n,children:t=>(()=>{var r=R(),o=r.firstChild,s=o.firstChild,u=s.firstChild,b=s.nextSibling,h=b.firstChild;h.firstChild;var C=h.nextSibling;return C.firstChild,r.$$click=()=>{e.onSelectFile(t.file,!0)},a(u,()=>t.file),a(h,()=>t.additions,null),a(C,()=>t.deletions,null),L(d=>{var _=`file-list-item ${(l==null?void 0:l.file)===t.file?"file-list-item-active":""}`,$=t.file,z=t.file;return _!==d.e&&F(r,d.e=_),$!==d.t&&w(r,"title",d.t=$),z!==d.a&&w(s,"title",d.a=z),d},{e:void 0,t:void 0,a:void 0}),r})()})}})},get viewer(){return v()},get listOpen(){return e.listOpen()},get onToggleList(){return e.onToggleList},get splitWidth(){return e.splitWidth()},get onResizeMouseDown(){return e.onResizeMouseDown},get onResizeTouchStart(){return e.onResizeTouchStart},get isPhoneLayout(){return e.isPhoneLayout()},get overlayAriaLabel(){return e.t("instanceShell.rightPanel.tabs.changes")}})})};N(["click"]);export{fe as default};
2
+ import{_ as K}from"./index-CJQRbTtv.js";import{m as B,t as g,i as a,d as w,a as F,f as N}from"./monaco-viewer-BCffFoQZ.js";import{c as f,n as c,a as L,F as T,S as W,z as j,A as q}from"./git-diff-vendor-CAv-4upN.js";import{D as G}from"./DiffToolbar-Cu7psKR5.js";import{S as H}from"./SplitFilePanel-DyezmCo2.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";import"./main-C35SKI2Q.js";import"./wrap-text-CzY37NHS.js";var J=g('<div class="file-viewer-panel flex-1"><div class="file-viewer-content file-viewer-content--monaco">'),E=g("<div class=file-viewer-empty><span class=file-viewer-empty-text>"),Q=g('<div class="p-3 text-xs text-secondary">'),R=g("<div><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text></span></div><div class=file-list-item-stats><span class=file-list-item-additions>+</span><span class=file-list-item-deletions>-"),U=g("<span class=files-tab-selected-path><span class=file-path-text>"),X=g('<div class=files-tab-stats style="flex:0 0 auto"><span class="files-tab-stat files-tab-stat-additions"><span class=files-tab-stat-value>+</span></span><span class="files-tab-stat files-tab-stat-deletions"><span class=files-tab-stat-value>-'),Y=g("<div style=margin-left:auto>");const Z=q(()=>K(()=>import("./monaco-viewer-BCffFoQZ.js").then(e=>e.ab),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.MonacoDiffViewer}))),fe=e=>{const M=f(()=>e.activeSessionId()),S=f(()=>!!(M()&&M()!=="info")),D=f(()=>S()?e.activeSessionDiffs():null),m=f(()=>{const n=D();return Array.isArray(n)?[...n].sort((i,l)=>String(i.file||"").localeCompare(String(l.file||""))):[]}),I=f(()=>m().reduce((n,i)=>(n.additions+=typeof i.additions=="number"?i.additions:0,n.deletions+=typeof i.deletions=="number"?i.deletions:0,n),{additions:0,deletions:0})),O=f(()=>{const n=m();return n.length===0?null:n.reduce((i,l)=>{const v=typeof(i==null?void 0:i.additions)=="number"?i.additions:0,y=typeof(i==null?void 0:i.deletions)=="number"?i.deletions:0,x=v+y,k=typeof(l==null?void 0:l.additions)=="number"?l.additions:0,t=typeof(l==null?void 0:l.deletions)=="number"?l.deletions:0,r=k+t;return r>x?l:r<x?i:String(l.file||"").localeCompare(String((i==null?void 0:i.file)||""))<0?l:i},n[0])}),P=f(()=>{const n=e.selectedFile(),i=m();if(n){const l=i.find(v=>v.file===n);if(l)return l}return O()}),p=f(()=>`${e.instanceId}:${S()?M():"no-session"}`),V=f(()=>{if(!S())return e.t("instanceShell.sessionChanges.noSessionSelected");const n=D();return n===void 0?e.t("instanceShell.sessionChanges.loading"):!Array.isArray(n)||n.length===0?e.t("instanceShell.sessionChanges.empty"):e.t("instanceShell.filesShell.viewerEmpty")}),A=f(()=>{const n=P();return n!=null&&n.file?String(n.file):e.t("instanceShell.rightPanel.tabs.changes")});return B(()=>{const n=m(),i=I(),l=P(),v=()=>(()=>{var t=J(),r=t.firstChild;return a(r,c(W,{get when(){return l&&S()&&n.length>0?l:null},get fallback(){return(()=>{var o=E(),s=o.firstChild;return a(s,V),o})()},children:o=>c(j,{get fallback(){return(()=>{var s=E(),u=s.firstChild;return a(u,()=>e.t("instanceInfo.loading")),s})()},get children(){return c(Z,{get scopeKey(){return p()},get path(){return String(o().file||"")},get before(){return String(o().before||"")},get after(){return String(o().after||"")},get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrap(){return e.diffWordWrapMode()}})}})})),t})(),y=()=>(()=>{var t=Q();return a(t,V),t})();return c(H,{get header(){return[(()=>{var t=U(),r=t.firstChild;return a(r,A),L(()=>w(t,"title",A())),t})(),(()=>{var t=X(),r=t.firstChild,o=r.firstChild;o.firstChild;var s=r.nextSibling,u=s.firstChild;return u.firstChild,a(o,()=>i.additions,null),a(u,()=>i.deletions,null),t})(),(()=>{var t=Y();return a(t,c(G,{get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrapMode(){return e.diffWordWrapMode()},get onViewModeChange(){return e.onViewModeChange},get onContextModeChange(){return e.onContextModeChange},get onWordWrapModeChange(){return e.onWordWrapModeChange}})),t})()]},list:{panel:()=>c(W,{get when(){return n.length>0},get fallback(){return y()},get children(){return c(T,{each:n,children:t=>(()=>{var r=R(),o=r.firstChild,s=o.firstChild,u=s.firstChild,b=s.nextSibling,h=b.firstChild;h.firstChild;var C=h.nextSibling;return C.firstChild,r.$$click=()=>{e.onSelectFile(t.file,e.isPhoneLayout())},a(u,()=>t.file),a(h,()=>t.additions,null),a(C,()=>t.deletions,null),L(d=>{var _=`file-list-item ${(l==null?void 0:l.file)===t.file?"file-list-item-active":""}`,$=t.file;return _!==d.e&&F(r,d.e=_),$!==d.t&&w(s,"title",d.t=$),d},{e:void 0,t:void 0}),r})()})}}),overlay:()=>c(W,{get when(){return n.length>0},get fallback(){return y()},get children(){return c(T,{each:n,children:t=>(()=>{var r=R(),o=r.firstChild,s=o.firstChild,u=s.firstChild,b=s.nextSibling,h=b.firstChild;h.firstChild;var C=h.nextSibling;return C.firstChild,r.$$click=()=>{e.onSelectFile(t.file,!0)},a(u,()=>t.file),a(h,()=>t.additions,null),a(C,()=>t.deletions,null),L(d=>{var _=`file-list-item ${(l==null?void 0:l.file)===t.file?"file-list-item-active":""}`,$=t.file,z=t.file;return _!==d.e&&F(r,d.e=_),$!==d.t&&w(r,"title",d.t=$),z!==d.a&&w(s,"title",d.a=z),d},{e:void 0,t:void 0,a:void 0}),r})()})}})},get viewer(){return v()},get listOpen(){return e.listOpen()},get onToggleList(){return e.onToggleList},get splitWidth(){return e.splitWidth()},get onResizeMouseDown(){return e.onResizeMouseDown},get onResizeTouchStart(){return e.onResizeTouchStart},get isPhoneLayout(){return e.isPhoneLayout()},get overlayAriaLabel(){return e.t("instanceShell.rightPanel.tabs.changes")}})})};N(["click"]);export{fe as default};
@@ -1 +1 @@
1
- import{t as g,i as c,m as W,d as i,a as S,f as C}from"./monaco-viewer-BCffFoQZ.js";import{u as T}from"./index-CJQRbTtv.js";import{n as o,m as $,a as V}from"./git-diff-vendor-CAv-4upN.js";import{I as U,S as A,N as I}from"./main-BpgxtqbO.js";import{A as N,W as D}from"./wrap-text-CIfNyrm2.js";const E=[["path",{d:"M12 22v-6",key:"6o8u61"}],["path",{d:"M12 8V2",key:"1wkif3"}],["path",{d:"M4 12H2",key:"rhcxmi"}],["path",{d:"M10 12H8",key:"s88cx1"}],["path",{d:"M16 12h-2",key:"10asgb"}],["path",{d:"M22 12h-2",key:"14jgyd"}],["path",{d:"m15 19-3 3-3-3",key:"11eu04"}],["path",{d:"m15 5-3-3-3 3",key:"itvq4r"}]],F=t=>o(U,$(t,{name:"UnfoldVertical",iconNode:E}));var H=g("<div class=file-viewer-toolbar><button type=button class=file-viewer-toolbar-icon-button></button><button type=button class=file-viewer-toolbar-icon-button></button><button type=button>");const z=t=>{const{t:a}=T(),r=()=>t.viewMode==="split"?"unified":"split",s=()=>t.contextMode==="collapsed"?"expanded":"collapsed",h=()=>t.wordWrapMode==="on"?"off":"on",f=()=>r()==="split"?a("instanceShell.diff.switchToSplit"):a("instanceShell.diff.switchToUnified"),v=()=>s()==="collapsed"?a("instanceShell.diff.hideUnchanged"):a("instanceShell.diff.showFull"),u=()=>h()==="on"?a("instanceShell.diff.enableWordWrap"):a("instanceShell.diff.disableWordWrap");return(()=>{var b=H(),n=b.firstChild,l=n.nextSibling,d=l.nextSibling;return n.$$click=()=>t.onViewModeChange(r()),c(n,(()=>{var e=W(()=>r()==="split");return()=>e()?o(A,{class:"h-4 w-4","aria-hidden":"true"}):o(N,{class:"h-4 w-4","aria-hidden":"true"})})()),l.$$click=()=>t.onContextModeChange(s()),c(l,(()=>{var e=W(()=>s()==="collapsed");return()=>e()?o(I,{class:"h-4 w-4","aria-hidden":"true"}):o(F,{class:"h-4 w-4","aria-hidden":"true"})})()),d.$$click=()=>t.onWordWrapModeChange(h()),c(d,o(D,{class:"h-4 w-4","aria-hidden":"true"})),V(e=>{var m=f(),w=f(),M=v(),p=v(),x=`file-viewer-toolbar-icon-button${t.wordWrapMode==="on"?" active":""}`,k=u(),y=u();return m!==e.e&&i(n,"aria-label",e.e=m),w!==e.t&&i(n,"title",e.t=w),M!==e.a&&i(l,"aria-label",e.a=M),p!==e.o&&i(l,"title",e.o=p),x!==e.i&&S(d,e.i=x),k!==e.n&&i(d,"aria-label",e.n=k),y!==e.s&&i(d,"title",e.s=y),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),b})()};C(["click"]);export{z as D};
1
+ import{t as g,i as c,m as W,d as i,a as S,f as C}from"./monaco-viewer-BCffFoQZ.js";import{u as T}from"./index-CJQRbTtv.js";import{n as o,m as $,a as V}from"./git-diff-vendor-CAv-4upN.js";import{I as U,S as A,N as I}from"./main-C35SKI2Q.js";import{A as N,W as D}from"./wrap-text-CzY37NHS.js";const E=[["path",{d:"M12 22v-6",key:"6o8u61"}],["path",{d:"M12 8V2",key:"1wkif3"}],["path",{d:"M4 12H2",key:"rhcxmi"}],["path",{d:"M10 12H8",key:"s88cx1"}],["path",{d:"M16 12h-2",key:"10asgb"}],["path",{d:"M22 12h-2",key:"14jgyd"}],["path",{d:"m15 19-3 3-3-3",key:"11eu04"}],["path",{d:"m15 5-3-3-3 3",key:"itvq4r"}]],F=t=>o(U,$(t,{name:"UnfoldVertical",iconNode:E}));var H=g("<div class=file-viewer-toolbar><button type=button class=file-viewer-toolbar-icon-button></button><button type=button class=file-viewer-toolbar-icon-button></button><button type=button>");const z=t=>{const{t:a}=T(),r=()=>t.viewMode==="split"?"unified":"split",s=()=>t.contextMode==="collapsed"?"expanded":"collapsed",h=()=>t.wordWrapMode==="on"?"off":"on",f=()=>r()==="split"?a("instanceShell.diff.switchToSplit"):a("instanceShell.diff.switchToUnified"),v=()=>s()==="collapsed"?a("instanceShell.diff.hideUnchanged"):a("instanceShell.diff.showFull"),u=()=>h()==="on"?a("instanceShell.diff.enableWordWrap"):a("instanceShell.diff.disableWordWrap");return(()=>{var b=H(),n=b.firstChild,l=n.nextSibling,d=l.nextSibling;return n.$$click=()=>t.onViewModeChange(r()),c(n,(()=>{var e=W(()=>r()==="split");return()=>e()?o(A,{class:"h-4 w-4","aria-hidden":"true"}):o(N,{class:"h-4 w-4","aria-hidden":"true"})})()),l.$$click=()=>t.onContextModeChange(s()),c(l,(()=>{var e=W(()=>s()==="collapsed");return()=>e()?o(I,{class:"h-4 w-4","aria-hidden":"true"}):o(F,{class:"h-4 w-4","aria-hidden":"true"})})()),d.$$click=()=>t.onWordWrapModeChange(h()),c(d,o(D,{class:"h-4 w-4","aria-hidden":"true"})),V(e=>{var m=f(),w=f(),M=v(),p=v(),x=`file-viewer-toolbar-icon-button${t.wordWrapMode==="on"?" active":""}`,k=u(),y=u();return m!==e.e&&i(n,"aria-label",e.e=m),w!==e.t&&i(n,"title",e.t=w),M!==e.a&&i(l,"aria-label",e.a=M),p!==e.o&&i(l,"title",e.o=p),x!==e.i&&S(d,e.i=x),k!==e.n&&i(d,"aria-label",e.n=k),y!==e.s&&i(d,"title",e.s=y),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),b})()};C(["click"]);export{z as D};
@@ -1,2 +1,2 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-BCffFoQZ.js","assets/git-diff-vendor-CAv-4upN.js","assets/fast-diff-vendor-DgdwVvTQ.js","assets/highlight-vendor-8FKMu9os.js","assets/git-diff-vendor-HAZkIolJ.css"])))=>i.map(i=>d[i]);
2
- import{_ as R}from"./index-CJQRbTtv.js";import{m as _,t as c,i as s,d as o,a as z,f as I}from"./monaco-viewer-BCffFoQZ.js";import{n as i,m as D,S as d,a as v,F,z as V,A as M}from"./git-diff-vendor-CAv-4upN.js";import{S as T}from"./SplitFilePanel-DyezmCo2.js";import{I as A,R as y}from"./main-BpgxtqbO.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";const O=[["path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z",key:"1owoqh"}],["polyline",{points:"17 21 17 13 7 13 7 21",key:"1md35c"}],["polyline",{points:"7 3 7 8 15 8",key:"8nz8an"}]],q=e=>i(A,D(e,{name:"Save",iconNode:O}));var g=c("<div class=file-viewer-empty><span class=file-viewer-empty-text>"),K=c('<div class="file-viewer-panel flex-1"><div class="file-viewer-content file-viewer-content--monaco">'),N=c('<div class="p-3 text-xs text-secondary">'),W=c("<div class=file-list-item><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text>.."),H=c('<div><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text></span></div><div class=file-list-item-stats><span class="text-[10px] text-secondary">'),j=c("<span>"),B=c("<div class=files-tab-stats><span class=files-tab-stat><span class=files-tab-selected-path><span class=file-path-text>"),G=c("<button type=button class=files-header-icon-button style=margin-inline-start:auto>"),J=c("<button type=button class=files-header-icon-button>"),Q=c("<span class=text-error>");const U=M(()=>R(()=>import("./monaco-viewer-BCffFoQZ.js").then(e=>e.ac),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.MonacoFileViewer}))),ae=e=>{const C=()=>{const h=e.browserSelectedContent();h!=null&&e.onSave(h)};return _(()=>{const h=e.browserEntries(),P=[...h||[]].sort((t,n)=>{const r=t.type==="directory"?0:1,l=n.type==="directory"?0:1;return r!==l?r-l:String(t.name||"").localeCompare(String(n.name||""))}),L=e.parentPath(),w=()=>e.browserSelectedPath()||e.browserPath(),x=()=>e.browserLoading()&&h===null?e.t("instanceInfo.loading"):e.t("instanceShell.filesShell.viewerEmpty"),k=()=>(()=>{var t=K(),n=t.firstChild;return s(n,i(d,{get when(){return e.browserSelectedLoading()},get fallback(){return i(d,{get when(){return e.browserSelectedError()},get fallback(){return i(d,{get when(){return _(()=>!!(e.browserSelectedPath()&&e.browserSelectedContent()!==null))()?{path:e.browserSelectedPath(),content:e.browserSelectedContent()}:null},get fallback(){return(()=>{var r=g(),l=r.firstChild;return s(l,x),r})()},children:r=>i(V,{get fallback(){return(()=>{var l=g(),a=l.firstChild;return s(a,()=>e.t("instanceInfo.loading")),l})()},get children(){return i(U,{get scopeKey(){return e.scopeKey()},get path(){return r().path},get content(){return r().content},get onSave(){return e.onSave},get onContentChange(){return e.onContentChange}})}})})},children:r=>(()=>{var l=g(),a=l.firstChild;return s(a,r),l})()})},get children(){var r=g(),l=r.firstChild;return s(l,()=>e.t("instanceInfo.loading")),r}})),t})(),m=()=>[i(d,{when:L,children:t=>(()=>{var n=W(),r=n.firstChild,l=r.firstChild;return n.$$click=()=>e.onLoadEntries(t()),v(()=>o(l,"title",t())),n})()}),i(d,{get when(){return e.browserLoading()&&h===null},get children(){var t=N();return s(t,()=>e.t("instanceInfo.loading")),t}}),i(F,{each:P,children:t=>(()=>{var n=H(),r=n.firstChild,l=r.firstChild,a=l.firstChild,f=l.nextSibling,E=f.firstChild;return n.$$click=()=>{if(t.type==="directory"){e.onLoadEntries(t.path);return}e.onRequestOpenFile(t.path)},s(a,()=>t.name),s(E,()=>t.type),v(u=>{var b=`file-list-item ${e.browserSelectedPath()===t.path?"file-list-item-active":""}`,S=t.path,$=t.path;return b!==u.e&&z(n,u.e=b),S!==u.t&&o(n,"title",u.t=S),$!==u.a&&o(l,"title",u.a=$),u},{e:void 0,t:void 0,a:void 0}),n})()})];return i(T,{get header(){return[(()=>{var t=B(),n=t.firstChild,r=n.firstChild,l=r.firstChild;return s(l,w),s(t,i(d,{get when(){return e.browserLoading()},get children(){var a=j();return s(a,()=>e.t("instanceInfo.loading")),a}}),null),s(t,i(d,{get when(){return e.browserError()},children:a=>(()=>{var f=Q();return s(f,a),f})()}),null),v(()=>o(r,"title",w())),t})(),(()=>{var t=G();return t.$$click=C,s(t,i(d,{get when(){return e.browserSelectedSaving()},get fallback(){return i(q,{class:"h-4 w-4"})},get children(){return i(y,{class:"h-4 w-4 animate-spin"})}})),v(n=>{var r=e.t("instanceShell.rightPanel.actions.save")||"Save (Ctrl+S)",l=e.t("instanceShell.rightPanel.actions.save")||"Save",a=e.browserSelectedSaving()||!e.browserSelectedDirty();return r!==n.e&&o(t,"title",n.e=r),l!==n.t&&o(t,"aria-label",n.t=l),a!==n.a&&(t.disabled=n.a=a),n},{e:void 0,t:void 0,a:void 0}),t})(),(()=>{var t=J();return t.$$click=()=>e.onRefresh(),s(t,i(y,{get class(){return`h-4 w-4${e.browserLoading()?" animate-spin":""}`}})),v(n=>{var r=e.t("instanceShell.rightPanel.actions.refresh"),l=e.t("instanceShell.rightPanel.actions.refresh"),a=e.browserLoading();return r!==n.e&&o(t,"title",n.e=r),l!==n.t&&o(t,"aria-label",n.t=l),a!==n.a&&(t.disabled=n.a=a),n},{e:void 0,t:void 0,a:void 0}),t})()]},list:{panel:m,overlay:m},get viewer(){return k()},get listOpen(){return e.listOpen()},get onToggleList(){return e.onToggleList},get splitWidth(){return e.splitWidth()},get onResizeMouseDown(){return e.onResizeMouseDown},get onResizeTouchStart(){return e.onResizeTouchStart},get isPhoneLayout(){return e.isPhoneLayout()},get overlayAriaLabel(){return e.t("instanceShell.rightPanel.tabs.files")}})})};I(["click"]);export{ae as default};
2
+ import{_ as R}from"./index-CJQRbTtv.js";import{m as _,t as c,i as s,d as o,a as z,f as I}from"./monaco-viewer-BCffFoQZ.js";import{n as i,m as D,S as d,a as v,F,z as V,A as M}from"./git-diff-vendor-CAv-4upN.js";import{S as T}from"./SplitFilePanel-DyezmCo2.js";import{I as A,R as y}from"./main-C35SKI2Q.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";const O=[["path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z",key:"1owoqh"}],["polyline",{points:"17 21 17 13 7 13 7 21",key:"1md35c"}],["polyline",{points:"7 3 7 8 15 8",key:"8nz8an"}]],q=e=>i(A,D(e,{name:"Save",iconNode:O}));var g=c("<div class=file-viewer-empty><span class=file-viewer-empty-text>"),K=c('<div class="file-viewer-panel flex-1"><div class="file-viewer-content file-viewer-content--monaco">'),N=c('<div class="p-3 text-xs text-secondary">'),W=c("<div class=file-list-item><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text>.."),H=c('<div><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text></span></div><div class=file-list-item-stats><span class="text-[10px] text-secondary">'),j=c("<span>"),B=c("<div class=files-tab-stats><span class=files-tab-stat><span class=files-tab-selected-path><span class=file-path-text>"),G=c("<button type=button class=files-header-icon-button style=margin-inline-start:auto>"),J=c("<button type=button class=files-header-icon-button>"),Q=c("<span class=text-error>");const U=M(()=>R(()=>import("./monaco-viewer-BCffFoQZ.js").then(e=>e.ac),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.MonacoFileViewer}))),ae=e=>{const C=()=>{const h=e.browserSelectedContent();h!=null&&e.onSave(h)};return _(()=>{const h=e.browserEntries(),P=[...h||[]].sort((t,n)=>{const r=t.type==="directory"?0:1,l=n.type==="directory"?0:1;return r!==l?r-l:String(t.name||"").localeCompare(String(n.name||""))}),L=e.parentPath(),w=()=>e.browserSelectedPath()||e.browserPath(),x=()=>e.browserLoading()&&h===null?e.t("instanceInfo.loading"):e.t("instanceShell.filesShell.viewerEmpty"),k=()=>(()=>{var t=K(),n=t.firstChild;return s(n,i(d,{get when(){return e.browserSelectedLoading()},get fallback(){return i(d,{get when(){return e.browserSelectedError()},get fallback(){return i(d,{get when(){return _(()=>!!(e.browserSelectedPath()&&e.browserSelectedContent()!==null))()?{path:e.browserSelectedPath(),content:e.browserSelectedContent()}:null},get fallback(){return(()=>{var r=g(),l=r.firstChild;return s(l,x),r})()},children:r=>i(V,{get fallback(){return(()=>{var l=g(),a=l.firstChild;return s(a,()=>e.t("instanceInfo.loading")),l})()},get children(){return i(U,{get scopeKey(){return e.scopeKey()},get path(){return r().path},get content(){return r().content},get onSave(){return e.onSave},get onContentChange(){return e.onContentChange}})}})})},children:r=>(()=>{var l=g(),a=l.firstChild;return s(a,r),l})()})},get children(){var r=g(),l=r.firstChild;return s(l,()=>e.t("instanceInfo.loading")),r}})),t})(),m=()=>[i(d,{when:L,children:t=>(()=>{var n=W(),r=n.firstChild,l=r.firstChild;return n.$$click=()=>e.onLoadEntries(t()),v(()=>o(l,"title",t())),n})()}),i(d,{get when(){return e.browserLoading()&&h===null},get children(){var t=N();return s(t,()=>e.t("instanceInfo.loading")),t}}),i(F,{each:P,children:t=>(()=>{var n=H(),r=n.firstChild,l=r.firstChild,a=l.firstChild,f=l.nextSibling,E=f.firstChild;return n.$$click=()=>{if(t.type==="directory"){e.onLoadEntries(t.path);return}e.onRequestOpenFile(t.path)},s(a,()=>t.name),s(E,()=>t.type),v(u=>{var b=`file-list-item ${e.browserSelectedPath()===t.path?"file-list-item-active":""}`,S=t.path,$=t.path;return b!==u.e&&z(n,u.e=b),S!==u.t&&o(n,"title",u.t=S),$!==u.a&&o(l,"title",u.a=$),u},{e:void 0,t:void 0,a:void 0}),n})()})];return i(T,{get header(){return[(()=>{var t=B(),n=t.firstChild,r=n.firstChild,l=r.firstChild;return s(l,w),s(t,i(d,{get when(){return e.browserLoading()},get children(){var a=j();return s(a,()=>e.t("instanceInfo.loading")),a}}),null),s(t,i(d,{get when(){return e.browserError()},children:a=>(()=>{var f=Q();return s(f,a),f})()}),null),v(()=>o(r,"title",w())),t})(),(()=>{var t=G();return t.$$click=C,s(t,i(d,{get when(){return e.browserSelectedSaving()},get fallback(){return i(q,{class:"h-4 w-4"})},get children(){return i(y,{class:"h-4 w-4 animate-spin"})}})),v(n=>{var r=e.t("instanceShell.rightPanel.actions.save")||"Save (Ctrl+S)",l=e.t("instanceShell.rightPanel.actions.save")||"Save",a=e.browserSelectedSaving()||!e.browserSelectedDirty();return r!==n.e&&o(t,"title",n.e=r),l!==n.t&&o(t,"aria-label",n.t=l),a!==n.a&&(t.disabled=n.a=a),n},{e:void 0,t:void 0,a:void 0}),t})(),(()=>{var t=J();return t.$$click=()=>e.onRefresh(),s(t,i(y,{get class(){return`h-4 w-4${e.browserLoading()?" animate-spin":""}`}})),v(n=>{var r=e.t("instanceShell.rightPanel.actions.refresh"),l=e.t("instanceShell.rightPanel.actions.refresh"),a=e.browserLoading();return r!==n.e&&o(t,"title",n.e=r),l!==n.t&&o(t,"aria-label",n.t=l),a!==n.a&&(t.disabled=n.a=a),n},{e:void 0,t:void 0,a:void 0}),t})()]},list:{panel:m,overlay:m},get viewer(){return k()},get listOpen(){return e.listOpen()},get onToggleList(){return e.onToggleList},get splitWidth(){return e.splitWidth()},get onResizeMouseDown(){return e.onResizeMouseDown},get onResizeTouchStart(){return e.onResizeTouchStart},get isPhoneLayout(){return e.isPhoneLayout()},get overlayAriaLabel(){return e.t("instanceShell.rightPanel.tabs.files")}})})};I(["click"]);export{ae as default};
@@ -1,2 +1,2 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-BCffFoQZ.js","assets/git-diff-vendor-CAv-4upN.js","assets/fast-diff-vendor-DgdwVvTQ.js","assets/highlight-vendor-8FKMu9os.js","assets/git-diff-vendor-HAZkIolJ.css"])))=>i.map(i=>d[i]);
2
- import{_ as B}from"./index-CJQRbTtv.js";import{m as V,t as h,i as r,d as $,a as D,f as K}from"./monaco-viewer-BCffFoQZ.js";import{c as f,n as d,a as w,S as c,F as R,z as G,A as N}from"./git-diff-vendor-CAv-4upN.js";import{D as j}from"./DiffToolbar-ysD8YAOp.js";import{S as q}from"./SplitFilePanel-DyezmCo2.js";import{R as H}from"./main-BpgxtqbO.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";import"./wrap-text-CIfNyrm2.js";var S=h("<div class=file-viewer-empty><span class=file-viewer-empty-text>"),J=h('<div class="file-viewer-panel flex-1"><div class="file-viewer-content file-viewer-content--monaco">'),Q=h('<div class="p-3 text-xs text-secondary">'),A=h('<span class="text-[10px] text-secondary">'),z=h("<span class=file-list-item-additions>+"),O=h("<span class=file-list-item-deletions>-"),T=h("<div><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text></span></div><div class=file-list-item-stats>"),U=h("<span class=files-tab-selected-path><span class=file-path-text>"),X=h('<div class=files-tab-stats style="flex:0 0 auto"><span class="files-tab-stat files-tab-stat-additions"><span class=files-tab-stat-value>+</span></span><span class="files-tab-stat files-tab-stat-deletions"><span class=files-tab-stat-value>-'),Y=h("<button type=button class=files-header-icon-button style=margin-left:auto>"),Z=h("<span class=text-error>");const p=N(()=>B(()=>import("./monaco-viewer-BCffFoQZ.js").then(e=>e.ab),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.MonacoDiffViewer}))),ce=e=>{const P=f(()=>e.activeSessionId()),y=f(()=>!!(P()&&P()!=="info")),M=f(()=>y()?e.entries():null),b=f(()=>{const o=M();return Array.isArray(o)?[...o].sort((s,g)=>String(s.path||"").localeCompare(String(g.path||""))):[]}),F=f(()=>b().reduce((o,s)=>(o.additions+=typeof s.added=="number"?s.added:0,o.deletions+=typeof s.removed=="number"?s.removed:0,o),{additions:0,deletions:0})),L=f(()=>b().filter(o=>o&&o.status!=="deleted")),I=f(()=>{const o=b(),s=e.selectedPath(),g=e.mostChangedPath();return(o.find(_=>_.path===s)||(g?o.find(_=>_.path===g):void 0))??null}),W=f(()=>y()?M()===null?e.t("instanceShell.gitChanges.loading"):L().length===0?e.t("instanceShell.gitChanges.empty"):e.t("instanceShell.filesShell.viewerEmpty"):e.t("instanceShell.gitChanges.noSessionSelected"));return V(()=>{const o=F(),s=I(),g=b(),x=L(),_=()=>(()=>{var t=J(),l=t.firstChild;return r(l,d(c,{get when(){return e.selectedLoading()},get fallback(){return d(c,{get when(){return e.selectedError()},get fallback(){return d(c,{get when(){return V(()=>!!(s&&e.selectedBefore()!==null&&e.selectedAfter()!==null&&s.status!=="deleted"))()?{path:s.path,before:e.selectedBefore(),after:e.selectedAfter()}:null},get fallback(){return(()=>{var i=S(),a=i.firstChild;return r(a,W),i})()},children:i=>d(G,{get fallback(){return(()=>{var a=S(),u=a.firstChild;return r(u,()=>e.t("instanceInfo.loading")),a})()},get children(){return d(p,{get scopeKey(){return e.scopeKey()},get path(){return String(i().path||"")},get before(){return String(i().before||"")},get after(){return String(i().after||"")},get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrap(){return e.diffWordWrapMode()}})}})})},children:i=>(()=>{var a=S(),u=a.firstChild;return r(u,i),a})()})},get children(){var i=S(),a=i.firstChild;return r(a,()=>e.t("instanceInfo.loading")),i}})),t})(),k=()=>(()=>{var t=Q();return r(t,W),t})();return d(q,{get header(){return[(()=>{var t=U(),l=t.firstChild;return r(l,()=>(s==null?void 0:s.path)||e.t("instanceShell.rightPanel.tabs.gitChanges")),w(()=>$(t,"title",(s==null?void 0:s.path)||e.t("instanceShell.rightPanel.tabs.gitChanges"))),t})(),(()=>{var t=X(),l=t.firstChild,i=l.firstChild;i.firstChild;var a=l.nextSibling,u=a.firstChild;return u.firstChild,r(i,()=>o.additions,null),r(u,()=>o.deletions,null),r(t,d(c,{get when(){return e.statusError()},children:v=>(()=>{var n=Z();return r(n,v),n})()}),null),t})(),(()=>{var t=Y();return t.$$click=()=>e.onRefresh(),r(t,d(H,{get class(){return`h-4 w-4${e.statusLoading()?" animate-spin":""}`}})),w(l=>{var i=e.t("instanceShell.rightPanel.actions.refresh"),a=e.t("instanceShell.rightPanel.actions.refresh"),u=!y()||e.statusLoading()||M()===null;return i!==l.e&&$(t,"title",l.e=i),a!==l.t&&$(t,"aria-label",l.t=a),u!==l.a&&(t.disabled=l.a=u),l},{e:void 0,t:void 0,a:void 0}),t})(),d(j,{get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrapMode(){return e.diffWordWrapMode()},get onViewModeChange(){return e.onViewModeChange},get onContextModeChange(){return e.onContextModeChange},get onWordWrapModeChange(){return e.onWordWrapModeChange}})]},list:{panel:()=>d(c,{get when(){return x.length>0},get fallback(){return k()},get children(){return d(R,{each:g,children:t=>(()=>{var l=T(),i=l.firstChild,a=i.firstChild,u=a.firstChild,v=a.nextSibling;return l.$$click=()=>{e.onOpenFile(t.path)},r(u,()=>t.path),r(v,d(c,{get when(){return t.status==="deleted"},get children(){var n=A();return r(n,()=>e.t("instanceShell.gitChanges.deleted")),n}}),null),r(v,d(c,{get when(){return t.status!=="deleted"},get children(){return[(()=>{var n=z();return n.firstChild,r(n,()=>t.added,null),n})(),(()=>{var n=O();return n.firstChild,r(n,()=>t.removed,null),n})()]}}),null),w(n=>{var C=`file-list-item ${e.selectedPath()===t.path?"file-list-item-active":""}`,m=t.path;return C!==n.e&&D(l,n.e=C),m!==n.t&&$(a,"title",n.t=m),n},{e:void 0,t:void 0}),l})()})}}),overlay:()=>d(c,{get when(){return x.length>0},get fallback(){return k()},get children(){return d(R,{each:g,children:t=>(()=>{var l=T(),i=l.firstChild,a=i.firstChild,u=a.firstChild,v=a.nextSibling;return l.$$click=()=>e.onOpenFile(t.path),r(u,()=>t.path),r(v,d(c,{get when(){return t.status==="deleted"},get children(){var n=A();return r(n,()=>e.t("instanceShell.gitChanges.deleted")),n}}),null),r(v,d(c,{get when(){return t.status!=="deleted"},get children(){return[(()=>{var n=z();return n.firstChild,r(n,()=>t.added,null),n})(),(()=>{var n=O();return n.firstChild,r(n,()=>t.removed,null),n})()]}}),null),w(n=>{var C=`file-list-item ${e.selectedPath()===t.path?"file-list-item-active":""}`,m=t.path,E=t.path;return C!==n.e&&D(l,n.e=C),m!==n.t&&$(l,"title",n.t=m),E!==n.a&&$(a,"title",n.a=E),n},{e:void 0,t:void 0,a:void 0}),l})()})}})},get viewer(){return _()},get listOpen(){return e.listOpen()},get onToggleList(){return e.onToggleList},get splitWidth(){return e.splitWidth()},get onResizeMouseDown(){return e.onResizeMouseDown},get onResizeTouchStart(){return e.onResizeTouchStart},get isPhoneLayout(){return e.isPhoneLayout()},get overlayAriaLabel(){return e.t("instanceShell.rightPanel.tabs.gitChanges")}})})};K(["click"]);export{ce as default};
2
+ import{_ as B}from"./index-CJQRbTtv.js";import{m as V,t as h,i as r,d as $,a as D,f as K}from"./monaco-viewer-BCffFoQZ.js";import{c as f,n as d,a as w,S as c,F as R,z as G,A as N}from"./git-diff-vendor-CAv-4upN.js";import{D as j}from"./DiffToolbar-Cu7psKR5.js";import{S as q}from"./SplitFilePanel-DyezmCo2.js";import{R as H}from"./main-C35SKI2Q.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";import"./wrap-text-CzY37NHS.js";var S=h("<div class=file-viewer-empty><span class=file-viewer-empty-text>"),J=h('<div class="file-viewer-panel flex-1"><div class="file-viewer-content file-viewer-content--monaco">'),Q=h('<div class="p-3 text-xs text-secondary">'),A=h('<span class="text-[10px] text-secondary">'),z=h("<span class=file-list-item-additions>+"),O=h("<span class=file-list-item-deletions>-"),T=h("<div><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text></span></div><div class=file-list-item-stats>"),U=h("<span class=files-tab-selected-path><span class=file-path-text>"),X=h('<div class=files-tab-stats style="flex:0 0 auto"><span class="files-tab-stat files-tab-stat-additions"><span class=files-tab-stat-value>+</span></span><span class="files-tab-stat files-tab-stat-deletions"><span class=files-tab-stat-value>-'),Y=h("<button type=button class=files-header-icon-button style=margin-left:auto>"),Z=h("<span class=text-error>");const p=N(()=>B(()=>import("./monaco-viewer-BCffFoQZ.js").then(e=>e.ab),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.MonacoDiffViewer}))),ce=e=>{const P=f(()=>e.activeSessionId()),y=f(()=>!!(P()&&P()!=="info")),M=f(()=>y()?e.entries():null),b=f(()=>{const o=M();return Array.isArray(o)?[...o].sort((s,g)=>String(s.path||"").localeCompare(String(g.path||""))):[]}),F=f(()=>b().reduce((o,s)=>(o.additions+=typeof s.added=="number"?s.added:0,o.deletions+=typeof s.removed=="number"?s.removed:0,o),{additions:0,deletions:0})),L=f(()=>b().filter(o=>o&&o.status!=="deleted")),I=f(()=>{const o=b(),s=e.selectedPath(),g=e.mostChangedPath();return(o.find(_=>_.path===s)||(g?o.find(_=>_.path===g):void 0))??null}),W=f(()=>y()?M()===null?e.t("instanceShell.gitChanges.loading"):L().length===0?e.t("instanceShell.gitChanges.empty"):e.t("instanceShell.filesShell.viewerEmpty"):e.t("instanceShell.gitChanges.noSessionSelected"));return V(()=>{const o=F(),s=I(),g=b(),x=L(),_=()=>(()=>{var t=J(),l=t.firstChild;return r(l,d(c,{get when(){return e.selectedLoading()},get fallback(){return d(c,{get when(){return e.selectedError()},get fallback(){return d(c,{get when(){return V(()=>!!(s&&e.selectedBefore()!==null&&e.selectedAfter()!==null&&s.status!=="deleted"))()?{path:s.path,before:e.selectedBefore(),after:e.selectedAfter()}:null},get fallback(){return(()=>{var i=S(),a=i.firstChild;return r(a,W),i})()},children:i=>d(G,{get fallback(){return(()=>{var a=S(),u=a.firstChild;return r(u,()=>e.t("instanceInfo.loading")),a})()},get children(){return d(p,{get scopeKey(){return e.scopeKey()},get path(){return String(i().path||"")},get before(){return String(i().before||"")},get after(){return String(i().after||"")},get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrap(){return e.diffWordWrapMode()}})}})})},children:i=>(()=>{var a=S(),u=a.firstChild;return r(u,i),a})()})},get children(){var i=S(),a=i.firstChild;return r(a,()=>e.t("instanceInfo.loading")),i}})),t})(),k=()=>(()=>{var t=Q();return r(t,W),t})();return d(q,{get header(){return[(()=>{var t=U(),l=t.firstChild;return r(l,()=>(s==null?void 0:s.path)||e.t("instanceShell.rightPanel.tabs.gitChanges")),w(()=>$(t,"title",(s==null?void 0:s.path)||e.t("instanceShell.rightPanel.tabs.gitChanges"))),t})(),(()=>{var t=X(),l=t.firstChild,i=l.firstChild;i.firstChild;var a=l.nextSibling,u=a.firstChild;return u.firstChild,r(i,()=>o.additions,null),r(u,()=>o.deletions,null),r(t,d(c,{get when(){return e.statusError()},children:v=>(()=>{var n=Z();return r(n,v),n})()}),null),t})(),(()=>{var t=Y();return t.$$click=()=>e.onRefresh(),r(t,d(H,{get class(){return`h-4 w-4${e.statusLoading()?" animate-spin":""}`}})),w(l=>{var i=e.t("instanceShell.rightPanel.actions.refresh"),a=e.t("instanceShell.rightPanel.actions.refresh"),u=!y()||e.statusLoading()||M()===null;return i!==l.e&&$(t,"title",l.e=i),a!==l.t&&$(t,"aria-label",l.t=a),u!==l.a&&(t.disabled=l.a=u),l},{e:void 0,t:void 0,a:void 0}),t})(),d(j,{get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrapMode(){return e.diffWordWrapMode()},get onViewModeChange(){return e.onViewModeChange},get onContextModeChange(){return e.onContextModeChange},get onWordWrapModeChange(){return e.onWordWrapModeChange}})]},list:{panel:()=>d(c,{get when(){return x.length>0},get fallback(){return k()},get children(){return d(R,{each:g,children:t=>(()=>{var l=T(),i=l.firstChild,a=i.firstChild,u=a.firstChild,v=a.nextSibling;return l.$$click=()=>{e.onOpenFile(t.path)},r(u,()=>t.path),r(v,d(c,{get when(){return t.status==="deleted"},get children(){var n=A();return r(n,()=>e.t("instanceShell.gitChanges.deleted")),n}}),null),r(v,d(c,{get when(){return t.status!=="deleted"},get children(){return[(()=>{var n=z();return n.firstChild,r(n,()=>t.added,null),n})(),(()=>{var n=O();return n.firstChild,r(n,()=>t.removed,null),n})()]}}),null),w(n=>{var C=`file-list-item ${e.selectedPath()===t.path?"file-list-item-active":""}`,m=t.path;return C!==n.e&&D(l,n.e=C),m!==n.t&&$(a,"title",n.t=m),n},{e:void 0,t:void 0}),l})()})}}),overlay:()=>d(c,{get when(){return x.length>0},get fallback(){return k()},get children(){return d(R,{each:g,children:t=>(()=>{var l=T(),i=l.firstChild,a=i.firstChild,u=a.firstChild,v=a.nextSibling;return l.$$click=()=>e.onOpenFile(t.path),r(u,()=>t.path),r(v,d(c,{get when(){return t.status==="deleted"},get children(){var n=A();return r(n,()=>e.t("instanceShell.gitChanges.deleted")),n}}),null),r(v,d(c,{get when(){return t.status!=="deleted"},get children(){return[(()=>{var n=z();return n.firstChild,r(n,()=>t.added,null),n})(),(()=>{var n=O();return n.firstChild,r(n,()=>t.removed,null),n})()]}}),null),w(n=>{var C=`file-list-item ${e.selectedPath()===t.path?"file-list-item-active":""}`,m=t.path,E=t.path;return C!==n.e&&D(l,n.e=C),m!==n.t&&$(l,"title",n.t=m),E!==n.a&&$(a,"title",n.a=E),n},{e:void 0,t:void 0,a:void 0}),l})()})}})},get viewer(){return _()},get listOpen(){return e.listOpen()},get onToggleList(){return e.onToggleList},get splitWidth(){return e.splitWidth()},get onResizeMouseDown(){return e.onResizeMouseDown},get onResizeTouchStart(){return e.onResizeTouchStart},get isPhoneLayout(){return e.isPhoneLayout()},get overlayAriaLabel(){return e.t("instanceShell.rightPanel.tabs.gitChanges")}})})};K(["click"]);export{ce as default};
@@ -1 +1 @@
1
- import{m as Se,P as Xe,t as O,i as h,a as Ye,d as L,f as Ge}from"./monaco-viewer-BCffFoQZ.js";import{n as d,m as S,b as $,o as P,k as J,l as ee,q as re,s as _,d as T,c as j,S as Z,t as Qe,w as Ce,a as pe,F as de}from"./git-diff-vendor-CAv-4upN.js";import{I as fe,O as Ze,P as F,Q as se,T as Je,U as et,V as Pe,W as Ie,X as Te,Y as tt,Z as ue,_ as ie,$ as le,a0 as $e,a1 as te,a2 as ne,a3 as nt,a4 as he,a5 as ot,a6 as st,a7 as E,a8 as me,a9 as it,aa as rt,ab as lt,ac as A,ad as at,ae as ct,af as we,ag as dt,ah as ge,ai as ut,aj as gt,ak as pt,al as ft}from"./main-BpgxtqbO.js";import{u as ht}from"./index-CJQRbTtv.js";import{T as mt}from"./todo-CShSQjpC.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";const bt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],vt=e=>d(fe,S(e,{name:"Info",iconNode:bt})),yt=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],xt=e=>d(fe,S(e,{name:"TerminalSquare",iconNode:yt})),Ct=[["polygon",{points:"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2",key:"h1p8hx"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],wt=e=>d(fe,S(e,{name:"XOctagon",iconNode:Ct}));var ke=J();function St(){return ee(ke)}function Pt(){const e=St();if(e===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}function De(e,o){return!!(o.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function It(e,o){var t;const l=o.ref();if(!l)return-1;let r=e.length;if(!r)return-1;for(;r--;){const n=(t=e[r])==null?void 0:t.ref();if(n&&De(n,l))return r+1}return 0}function Tt(e){const o=e.map((r,t)=>[t,r]);let l=!1;return o.sort(([r,t],[n,s])=>{const i=t.ref(),a=s.ref();return i===a||!i||!a?0:De(i,a)?(r>n&&(l=!0),-1):(r<n&&(l=!0),1)}),l?o.map(([r,t])=>t):e}function Oe(e,o){const l=Tt(e);e!==l&&o(l)}function $t(e){var t,n;const o=e[0],l=(t=e[e.length-1])==null?void 0:t.ref();let r=(n=o==null?void 0:o.ref())==null?void 0:n.parentElement;for(;r;){if(l&&r.contains(l))return r;r=r.parentElement}return se(r).body}function kt(e,o){$(()=>{const l=setTimeout(()=>{Oe(e(),o)});P(()=>clearTimeout(l))})}function Dt(e,o){if(typeof IntersectionObserver!="function"){kt(e,o);return}let l=[];$(()=>{const r=()=>{const s=!!l.length;l=e(),s&&Oe(e(),o)},t=$t(e()),n=new IntersectionObserver(r,{root:t});for(const s of e()){const i=s.ref();i&&n.observe(i)}P(()=>n.disconnect())})}function Ot(e={}){const[o,l]=Ze({value:()=>et(e.items),onChange:n=>{var s;return(s=e.onItemsChange)==null?void 0:s.call(e,n)}});Dt(o,l);const r=n=>(l(s=>{const i=It(s,n);return Je(s,n,i)}),()=>{l(s=>{const i=s.filter(a=>a.ref()!==n.ref());return s.length===i.length?s:i})});return{DomCollectionProvider:n=>d(ke.Provider,{value:{registerItem:r},get children(){return n.children}})}}function _t(e){const o=Pt(),l=F({shouldRegisterItem:!0},e);$(()=>{if(!l.shouldRegisterItem)return;const r=o.registerItem(l.getItem());P(r)})}var Mt={};me(Mt,{Arrow:()=>Pe,Content:()=>Me,Portal:()=>Ee,Root:()=>Ae,Tooltip:()=>Q,Trigger:()=>Fe,useTooltipContext:()=>ae});var _e=J();function ae(){const e=ee(_e);if(e===void 0)throw new Error("[kobalte]: `useTooltipContext` must be used within a `Tooltip` component");return e}function Me(e){const o=ae(),l=F({id:o.generateId("content")},e),[r,t]=_(l,["ref","style"]);return $(()=>P(o.registerContentId(t.id))),d(Z,{get when(){return o.contentPresent()},get children(){return d($e.Positioner,{get children(){return d(nt,S({ref(n){var s=te(i=>{o.setContentRef(i)},r.ref);typeof s=="function"&&s(n)},role:"tooltip",disableOutsidePointerEvents:!1,get style(){return he({"--kb-tooltip-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},r.style)},onFocusOutside:n=>n.preventDefault(),onDismiss:()=>o.hideTooltip(!0)},()=>o.dataset(),t))}})}})}function Ee(e){const o=ae();return d(Z,{get when(){return o.contentPresent()},get children(){return d(Xe,e)}})}function Et(e,o,l){const r=e.split("-")[0],t=o.getBoundingClientRect(),n=l.getBoundingClientRect(),s=[],i=t.left+t.width/2,a=t.top+t.height/2;switch(r){case"top":s.push([t.left,a]),s.push([n.left,n.bottom]),s.push([n.left,n.top]),s.push([n.right,n.top]),s.push([n.right,n.bottom]),s.push([t.right,a]);break;case"right":s.push([i,t.top]),s.push([n.left,n.top]),s.push([n.right,n.top]),s.push([n.right,n.bottom]),s.push([n.left,n.bottom]),s.push([i,t.bottom]);break;case"bottom":s.push([t.left,a]),s.push([n.left,n.top]),s.push([n.left,n.bottom]),s.push([n.right,n.bottom]),s.push([n.right,n.top]),s.push([t.right,a]);break;case"left":s.push([i,t.top]),s.push([n.right,n.top]),s.push([n.left,n.top]),s.push([n.left,n.bottom]),s.push([n.right,n.bottom]),s.push([i,t.bottom]);break}return s}var N={},At=0,q=!1,M,G,V;function Ae(e){const o=`tooltip-${re()}`,l=`${++At}`,r=F({id:o,openDelay:700,closeDelay:300,skipDelayDuration:300},e),[t,n]=_(r,["id","open","defaultOpen","onOpenChange","disabled","triggerOnFocusOnly","openDelay","closeDelay","skipDelayDuration","ignoreSafeArea","forceMount"]);let s;const[i,a]=T(),[c,p]=T(),[u,g]=T(),[v,x]=T(n.placement),y=Ie({open:()=>t.open,defaultOpen:()=>t.defaultOpen,onOpenChange:b=>{var D;return(D=t.onOpenChange)==null?void 0:D.call(t,b)}}),{present:C}=Te({show:()=>t.forceMount||y.isOpen(),element:()=>u()??null}),f=()=>{N[l]=m},w=()=>{for(const b in N)b!==l&&(N[b](!0),delete N[b])},m=(b=!1)=>{b||t.closeDelay&&t.closeDelay<=0?(window.clearTimeout(s),s=void 0,y.close()):s||(s=window.setTimeout(()=>{s=void 0,y.close()},t.closeDelay)),window.clearTimeout(M),M=void 0,t.skipDelayDuration&&t.skipDelayDuration>=0&&(V=window.setTimeout(()=>{window.clearTimeout(V),V=void 0},t.skipDelayDuration)),q&&(window.clearTimeout(G),G=window.setTimeout(()=>{delete N[l],G=void 0,q=!1},t.closeDelay))},I=()=>{clearTimeout(s),s=void 0,w(),f(),q=!0,y.open(),window.clearTimeout(M),M=void 0,window.clearTimeout(G),G=void 0,window.clearTimeout(V),V=void 0},W=()=>{w(),f(),!y.isOpen()&&!M&&!q?M=window.setTimeout(()=>{M=void 0,q=!0,I()},t.openDelay):y.isOpen()||I()},K=(b=!1)=>{!b&&t.openDelay&&t.openDelay>0&&!s&&!V?W():I()},z=()=>{window.clearTimeout(M),M=void 0,q=!1},R=()=>{window.clearTimeout(s),s=void 0},U=b=>ue(c(),b)||ue(u(),b),k=b=>{const D=c(),B=u();if(!(!D||!B))return Et(b,D,B)},Y=b=>{const D=b.target;if(U(D)){R();return}if(!t.ignoreSafeArea){const B=k(v());if(B&&ot(st(b),B)){R();return}}s||m()};$(()=>{if(!y.isOpen())return;const b=se();b.addEventListener("pointermove",Y,!0),P(()=>{b.removeEventListener("pointermove",Y,!0)})}),$(()=>{const b=c();if(!b||!y.isOpen())return;const D=qe=>{const Ve=qe.target;ue(Ve,b)&&m(!0)},B=tt();B.addEventListener("scroll",D,{capture:!0}),P(()=>{B.removeEventListener("scroll",D,{capture:!0})})}),P(()=>{clearTimeout(s),N[l]&&delete N[l]});const ze={dataset:j(()=>({"data-expanded":y.isOpen()?"":void 0,"data-closed":y.isOpen()?void 0:""})),isOpen:y.isOpen,isDisabled:()=>t.disabled??!1,triggerOnFocusOnly:()=>t.triggerOnFocusOnly??!1,contentId:i,contentPresent:C,openTooltip:K,hideTooltip:m,cancelOpening:z,generateId:le(()=>r.id),registerContentId:ie(a),isTargetOnTooltip:U,setTriggerRef:p,setContentRef:g};return d(_e.Provider,{value:ze,get children(){return d($e,S({anchorRef:c,contentRef:u,onCurrentPlacementChange:x},n))}})}function Fe(e){let o;const l=ae(),[r,t]=_(e,["ref","onPointerEnter","onPointerLeave","onPointerDown","onClick","onFocus","onBlur"]);let n=!1,s=!1,i=!1;const a=()=>{n=!1},c=()=>{!l.isOpen()&&(s||i)&&l.openTooltip(i)},p=f=>{l.isOpen()&&!s&&!i&&l.hideTooltip(f)},u=f=>{E(f,r.onPointerEnter),!(f.pointerType==="touch"||l.triggerOnFocusOnly()||l.isDisabled()||f.defaultPrevented)&&(s=!0,c())},g=f=>{E(f,r.onPointerLeave),f.pointerType!=="touch"&&(s=!1,i=!1,l.isOpen()?p():l.cancelOpening())},v=f=>{E(f,r.onPointerDown),n=!0,se(o).addEventListener("pointerup",a,{once:!0})},x=f=>{E(f,r.onClick),s=!1,i=!1,p(!0)},y=f=>{E(f,r.onFocus),!(l.isDisabled()||f.defaultPrevented||n)&&(i=!0,c())},C=f=>{E(f,r.onBlur);const w=f.relatedTarget;l.isTargetOnTooltip(w)||(s=!1,i=!1,p(!0))};return P(()=>{se(o).removeEventListener("pointerup",a)}),d(ne,S({as:"button",ref(f){var w=te(m=>{l.setTriggerRef(m),o=m},r.ref);typeof w=="function"&&w(f)},get"aria-describedby"(){return Se(()=>!!l.isOpen())()?l.contentId():void 0},onPointerEnter:u,onPointerLeave:g,onPointerDown:v,onClick:x,onFocus:y,onBlur:C},()=>l.dataset(),t))}var Q=Object.assign(Ae,{Arrow:Pe,Content:Me,Portal:Ee,Trigger:Fe}),Ft={};me(Ft,{Collapsible:()=>Kt,Content:()=>be,Root:()=>ve,Trigger:()=>ye,useCollapsibleContext:()=>oe});var Ke=J();function oe(){const e=ee(Ke);if(e===void 0)throw new Error("[kobalte]: `useCollapsibleContext` must be used within a `Collapsible.Root` component");return e}function be(e){const[o,l]=T(),r=oe(),t=F({id:r.generateId("content")},e),[n,s]=_(t,["ref","id","style"]),{present:i}=Te({show:r.shouldMount,element:()=>o()??null}),[a,c]=T(0),[p,u]=T(0);let v=r.isOpen()||i();return Qe(()=>{const x=requestAnimationFrame(()=>{v=!1});P(()=>{cancelAnimationFrame(x)})}),$(Ce(i,()=>{if(!o())return;o().style.transitionDuration="0s",o().style.animationName="none";const x=o().getBoundingClientRect();c(x.height),u(x.width),v||(o().style.transitionDuration="",o().style.animationName="")})),$(Ce(r.isOpen,x=>{!x&&o()&&(o().style.transitionDuration="",o().style.animationName="")},{defer:!0})),$(()=>P(r.registerContentId(n.id))),d(Z,{get when(){return i()},get children(){return d(ne,S({as:"div",ref(x){var y=te(l,n.ref);typeof y=="function"&&y(x)},get id(){return n.id},get style(){return he({"--kb-collapsible-content-height":a()?`${a()}px`:void 0,"--kb-collapsible-content-width":p()?`${p()}px`:void 0},n.style)}},()=>r.dataset(),s))}})}function ve(e){const o=`collapsible-${re()}`,l=F({id:o},e),[r,t]=_(l,["open","defaultOpen","onOpenChange","disabled","forceMount"]),[n,s]=T(),i=Ie({open:()=>r.open,defaultOpen:()=>r.defaultOpen,onOpenChange:p=>{var u;return(u=r.onOpenChange)==null?void 0:u.call(r,p)}}),a=j(()=>({"data-expanded":i.isOpen()?"":void 0,"data-closed":i.isOpen()?void 0:"","data-disabled":r.disabled?"":void 0})),c={dataset:a,isOpen:i.isOpen,disabled:()=>r.disabled??!1,shouldMount:()=>r.forceMount||i.isOpen(),contentId:n,toggle:i.toggle,generateId:le(()=>t.id),registerContentId:ie(s)};return d(Ke.Provider,{value:c,get children(){return d(ne,S({as:"div"},a,t))}})}function ye(e){const o=oe(),[l,r]=_(e,["onClick"]);return d(it,S({get"aria-expanded"(){return o.isOpen()},get"aria-controls"(){return Se(()=>!!o.isOpen())()?o.contentId():void 0},get disabled(){return o.disabled()},onClick:n=>{E(n,l.onClick),o.toggle()}},()=>o.dataset(),r))}var Kt=Object.assign(ve,{Content:be,Trigger:ye}),X={};me(X,{Accordion:()=>Rt,Content:()=>Le,Header:()=>Ue,Item:()=>He,Root:()=>je,Trigger:()=>We,useAccordionContext:()=>xe});var Re=J();function Be(){const e=ee(Re);if(e===void 0)throw new Error("[kobalte]: `useAccordionItemContext` must be used within a `Accordion.Item` component");return e}function Le(e){const o=Be(),l=o.generateId("content"),r=F({id:l},e),[t,n]=_(r,["id","style"]);return $(()=>P(o.registerContentId(t.id))),d(be,S({role:"region",get"aria-labelledby"(){return o.triggerId()},get style(){return he({"--kb-accordion-content-height":"var(--kb-collapsible-content-height)","--kb-accordion-content-width":"var(--kb-collapsible-content-width)"},t.style)}},n))}function Ue(e){const o=oe();return d(ne,S({as:"h3"},()=>o.dataset(),e))}var Ne=J();function xe(){const e=ee(Ne);if(e===void 0)throw new Error("[kobalte]: `useAccordionContext` must be used within a `Accordion.Root` component");return e}function He(e){const o=xe(),l=`${o.generateId("item")}-${re()}`,r=F({id:l},e),[t,n]=_(r,["value","disabled"]),[s,i]=T(),[a,c]=T(),p=()=>o.listState().selectionManager(),u=()=>p().isSelected(t.value),g={value:()=>t.value,triggerId:s,contentId:a,generateId:le(()=>n.id),registerTriggerId:ie(i),registerContentId:ie(c)};return d(Re.Provider,{value:g,get children(){return d(ve,S({get open(){return u()},get disabled(){return t.disabled}},n))}})}function je(e){let o;const l=`accordion-${re()}`,r=F({id:l,multiple:!1,collapsible:!1,shouldFocusWrap:!0},e),[t,n]=_(r,["id","ref","value","defaultValue","onChange","multiple","collapsible","shouldFocusWrap","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]),[s,i]=T([]),{DomCollectionProvider:a}=Ot({items:s,onItemsChange:i}),c=rt({selectedKeys:()=>t.value,defaultSelectedKeys:()=>t.defaultValue,onSelectionChange:g=>{var v;return(v=t.onChange)==null?void 0:v.call(t,Array.from(g))},disallowEmptySelection:()=>!t.multiple&&!t.collapsible,selectionMode:()=>t.multiple?"multiple":"single",dataSource:s});c.selectionManager().setFocusedKey("item-1");const p=lt({selectionManager:()=>c.selectionManager(),collection:()=>c.collection(),disallowEmptySelection:()=>c.selectionManager().disallowEmptySelection(),shouldFocusWrap:()=>t.shouldFocusWrap,disallowTypeAhead:!0,allowsTabNavigation:!0},()=>o),u={listState:()=>c,generateId:le(()=>t.id)};return d(a,{get children(){return d(Ne.Provider,{value:u,get children(){return d(ne,S({as:"div",get id(){return t.id},ref(g){var v=te(x=>o=x,t.ref);typeof v=="function"&&v(g)},get onKeyDown(){return A([t.onKeyDown,p.onKeyDown])},get onMouseDown(){return A([t.onMouseDown,p.onMouseDown])},get onFocusIn(){return A([t.onFocusIn])},get onFocusOut(){return A([t.onFocusOut,p.onFocusOut])}},n))}})}})}function We(e){let o;const l=xe(),r=Be(),t=oe(),n=r.generateId("trigger"),s=F({id:n},e),[i,a]=_(s,["ref","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]);_t({getItem:()=>({ref:()=>o,type:"item",key:r.value(),textValue:"",disabled:t.disabled()})});const c=at({key:()=>r.value(),selectionManager:()=>l.listState().selectionManager(),disabled:()=>t.disabled(),shouldSelectOnPressUp:!0},()=>o),p=u=>{["Enter"," "].includes(u.key)&&u.preventDefault(),E(u,i.onKeyDown),E(u,c.onKeyDown)};return $(()=>P(r.registerTriggerId(a.id))),d(ye,S({ref(u){var g=te(v=>o=v,i.ref);typeof g=="function"&&g(u)},get"data-key"(){return c.dataKey()},get onPointerDown(){return A([i.onPointerDown,c.onPointerDown])},get onPointerUp(){return A([i.onPointerUp,c.onPointerUp])},get onClick(){return A([i.onClick,c.onClick])},onKeyDown:p,get onMouseDown(){return A([i.onMouseDown,c.onMouseDown])},get onFocus(){return A([i.onFocus,c.onFocus])}},a))}var Rt=Object.assign(je,{Content:Le,Header:Ue,Item:He,Trigger:We}),Bt=O('<div><div class="flex flex-wrap items-center gap-2 text-xs text-primary"><div class="inline-flex items-center gap-1 rounded-full border border-base px-2 py-0.5 text-xs text-primary"><span class="uppercase text-[10px] tracking-wide text-muted"></span><span class="font-semibold text-primary"></span></div><div class="inline-flex items-center gap-1 rounded-full border border-base px-2 py-0.5 text-xs text-primary"><span class="uppercase text-[10px] tracking-wide text-muted"></span><span class="font-semibold text-primary"></span></div><div class="inline-flex items-center gap-1 rounded-full border border-base px-2 py-0.5 text-xs text-primary"><span class="uppercase text-[10px] tracking-wide text-muted"></span><span class="font-semibold text-primary">');const Lt=e=>{const{t:o}=ht(),l=j(()=>ct(e.instanceId,e.sessionId)??{cost:0,contextWindow:0,isSubscriptionModel:!1,inputTokens:0,outputTokens:0,reasoningTokens:0,actualUsageTokens:0,modelOutputLimit:0,contextAvailableTokens:null}),r=j(()=>l().inputTokens??0),t=j(()=>l().outputTokens??0),n=j(()=>{const i=l().isSubscriptionModel?0:l().cost;return i>0?i:0}),s=j(()=>`$${n().toFixed(2)}`);return(()=>{var i=Bt(),a=i.firstChild,c=a.firstChild,p=c.firstChild,u=p.nextSibling,g=c.nextSibling,v=g.firstChild,x=v.nextSibling,y=g.nextSibling,C=y.firstChild,f=C.nextSibling;return h(p,()=>o("contextUsagePanel.labels.input")),h(u,()=>we(r())),h(v,()=>o("contextUsagePanel.labels.output")),h(x,()=>we(t())),h(C,()=>o("contextUsagePanel.labels.cost")),h(f,s),pe(()=>Ye(i,`session-context-panel px-4 py-2 ${e.class??""}`)),i})()};var H=O('<div class="right-panel-empty right-panel-empty--left"><span class=text-xs>'),Ut=O('<div class="rounded-md border border-base bg-surface-secondary px-3 py-2"><div class="flex items-start justify-between gap-3"><div class=min-w-0><div class="text-sm font-medium text-primary"></div><p class="mt-1 text-xs text-secondary">'),Nt=O('<div class="flex flex-col gap-3 min-h-0"><div class="flex items-center justify-between gap-2 text-[11px] text-secondary"><span></span><span class="flex items-center gap-2"><span style=color:var(--session-status-idle-fg)></span><span style=color:var(--session-status-working-fg)></span></span></div><div class="rounded-md border border-base bg-surface-secondary p-2 max-h-[40vh] overflow-y-auto"><div class="flex flex-col">'),Ht=O('<button type=button class="border-b border-base last:border-b-0 text-left hover:bg-surface-muted rounded-sm"><div class="flex items-center justify-between gap-3"><div class="text-xs font-mono text-primary min-w-0 flex-1 overflow-hidden whitespace-nowrap"style=text-overflow:ellipsis;direction:rtl;text-align:left;unicode-bidi:plaintext></div><div class="flex items-center gap-2 text-[11px] flex-shrink-0"><span style=color:var(--session-status-idle-fg)></span><span style=color:var(--session-status-working-fg)>'),jt=O('<div class="flex flex-col gap-2">'),Wt=O("<span>"),zt=O('<div class=status-process-card><div class=status-process-header><span class=status-process-title></span><div class=status-process-meta><span></span></div></div><div class=status-process-actions><button type=button class="button-tertiary w-full p-1 inline-flex items-center justify-center"></button><button type=button class="button-tertiary w-full p-1 inline-flex items-center justify-center"></button><button type=button class="button-tertiary w-full p-1 inline-flex items-center justify-center">'),qt=O("<div class=status-tab-container>"),Vt=O("<span class=section-left><span class=section-label>");const tn=e=>{const o=i=>e.expandedItems().includes(i),s=[{id:"yolo-mode",labelKey:"instanceShell.rightPanel.sections.yoloMode",tooltipKey:"instanceShell.rightPanel.sections.yoloMode.tooltip",render:()=>{const i=e.activeSession();return i?(()=>{var a=Ut(),c=a.firstChild,p=c.firstChild,u=p.firstChild,g=u.nextSibling;return h(u,()=>e.t("instanceShell.yoloMode.title")),h(g,()=>e.t("instanceShell.yoloMode.description")),h(c,d(pt,{get checked(){return gt(e.instanceId,i.id)},color:"warning",size:"small",get inputProps(){return{"aria-label":e.t("instanceShell.yoloMode.title")}},onChange:()=>ut(e.instanceId,i.id)}),null),a})():(()=>{var a=H(),c=a.firstChild;return h(c,()=>e.t("instanceShell.yoloMode.noSessionSelected")),a})()}},{id:"session-changes",labelKey:"instanceShell.rightPanel.sections.sessionChanges",tooltipKey:"instanceShell.rightPanel.sections.sessionChanges.tooltip",render:()=>{const i=e.activeSessionId();if(!i||i==="info")return(()=>{var u=H(),g=u.firstChild;return h(g,()=>e.t("instanceShell.sessionChanges.noSessionSelected")),u})();const a=e.activeSessionDiffs();if(a===void 0)return(()=>{var u=H(),g=u.firstChild;return h(g,()=>e.t("instanceShell.sessionChanges.loading")),u})();if(!Array.isArray(a)||a.length===0)return(()=>{var u=H(),g=u.firstChild;return h(g,()=>e.t("instanceShell.sessionChanges.empty")),u})();const c=[...a].sort((u,g)=>String(u.file||"").localeCompare(String(g.file||""))),p=c.reduce((u,g)=>(u.additions+=typeof g.additions=="number"?g.additions:0,u.deletions+=typeof g.deletions=="number"?g.deletions:0,u),{additions:0,deletions:0});return(()=>{var u=Nt(),g=u.firstChild,v=g.firstChild,x=v.nextSibling,y=x.firstChild,C=y.nextSibling,f=g.nextSibling,w=f.firstChild;return h(v,()=>e.t("instanceShell.sessionChanges.filesChanged",{count:c.length})),h(y,()=>`+${p.additions}`),h(C,()=>`-${p.deletions}`),h(w,d(de,{each:c,children:m=>(()=>{var I=Ht(),W=I.firstChild,K=W.firstChild,z=K.nextSibling,R=z.firstChild,U=R.nextSibling;return I.$$click=()=>e.onOpenChangesTab(m.file),h(K,()=>m.file),h(R,()=>`+${m.additions}`),h(U,()=>`-${m.deletions}`),pe(k=>{var Y=e.t("instanceShell.sessionChanges.actions.show"),ce=m.file;return Y!==k.e&&L(I,"title",k.e=Y),ce!==k.t&&L(K,"title",k.t=ce),k},{e:void 0,t:void 0}),I})()})),u})()}},{id:"plan",labelKey:"instanceShell.rightPanel.sections.plan",tooltipKey:"instanceShell.rightPanel.sections.plan.tooltip",render:()=>{const i=e.activeSessionId();if(!i||i==="info")return(()=>{var c=H(),p=c.firstChild;return h(p,()=>e.t("instanceShell.plan.noSessionSelected")),c})();const a=e.latestTodoState();return a?d(mt,{state:a,get emptyLabel(){return e.t("instanceShell.plan.empty")},showStatusLabel:!1}):(()=>{var c=H(),p=c.firstChild;return h(p,()=>e.t("instanceShell.plan.empty")),c})()}},{id:"background-processes",labelKey:"instanceShell.rightPanel.sections.backgroundProcesses",tooltipKey:"instanceShell.rightPanel.sections.backgroundProcesses.tooltip",render:()=>{const i=e.backgroundProcessList();return i.length===0?(()=>{var a=H(),c=a.firstChild;return h(c,()=>e.t("instanceShell.backgroundProcesses.empty")),a})():(()=>{var a=jt();return h(a,d(de,{each:i,children:c=>(()=>{var p=zt(),u=p.firstChild,g=u.firstChild,v=g.nextSibling,x=v.firstChild,y=u.nextSibling,C=y.firstChild,f=C.nextSibling,w=f.nextSibling;return h(g,()=>c.title),h(x,()=>e.t("instanceShell.backgroundProcesses.status",{status:c.status})),h(v,d(Z,{get when(){return typeof c.outputSizeBytes=="number"},get children(){var m=Wt();return h(m,()=>e.t("instanceShell.backgroundProcesses.output",{sizeKb:Math.round((c.outputSizeBytes??0)/1024)})),m}}),null),C.$$click=()=>e.onOpenBackgroundOutput(c),h(C,d(xt,{class:"h-4 w-4"})),f.$$click=()=>e.onStopBackgroundProcess(c.id),h(f,d(wt,{class:"h-4 w-4"})),w.$$click=()=>e.onTerminateBackgroundProcess(c.id),h(w,d(ft,{class:"h-4 w-4"})),pe(m=>{var I=e.t("instanceShell.backgroundProcesses.actions.output"),W=e.t("instanceShell.backgroundProcesses.actions.output"),K=c.status!=="running",z=e.t("instanceShell.backgroundProcesses.actions.stop"),R=e.t("instanceShell.backgroundProcesses.actions.stop"),U=e.t("instanceShell.backgroundProcesses.actions.terminate"),k=e.t("instanceShell.backgroundProcesses.actions.terminate");return I!==m.e&&L(C,"aria-label",m.e=I),W!==m.t&&L(C,"title",m.t=W),K!==m.a&&(f.disabled=m.a=K),z!==m.o&&L(f,"aria-label",m.o=z),R!==m.i&&L(f,"title",m.i=R),U!==m.n&&L(w,"aria-label",m.n=U),k!==m.s&&L(w,"title",m.s=k),m},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),p})()})),a})()}},{id:"mcp",labelKey:"instanceShell.rightPanel.sections.mcp",tooltipKey:"instanceShell.rightPanel.sections.mcp.tooltip",render:()=>d(ge,{get initialInstance(){return e.instance},sections:["mcp"],showSectionHeadings:!1,class:"space-y-2"})},{id:"lsp",labelKey:"instanceShell.rightPanel.sections.lsp",tooltipKey:"instanceShell.rightPanel.sections.lsp.tooltip",render:()=>d(ge,{get initialInstance(){return e.instance},sections:["lsp"],showSectionHeadings:!1,class:"space-y-2"})},{id:"plugins",labelKey:"instanceShell.rightPanel.sections.plugins",tooltipKey:"instanceShell.rightPanel.sections.plugins.tooltip",render:()=>d(ge,{get initialInstance(){return e.instance},sections:["plugins"],showSectionHeadings:!1,class:"space-y-2"})}];return(()=>{var i=qt();return h(i,d(Z,{get when(){return e.activeSession()},children:a=>d(Lt,{get instanceId(){return e.instanceId},get sessionId(){return a().id},class:"status-tab-context-panel"})}),null),h(i,d(X.Root,{class:"right-panel-accordion",collapsible:!0,multiple:!0,get value(){return e.expandedItems()},get onChange(){return e.onExpandedItemsChange},get children(){return d(de,{each:s,children:a=>d(X.Item,{get value(){return a.id},class:"right-panel-accordion-item",get children(){return[d(X.Header,{class:"right-panel-accordion-header-row",get children(){return[d(X.Trigger,{class:"right-panel-accordion-trigger",get children(){return[(()=>{var c=Vt(),p=c.firstChild;return h(p,()=>e.t(a.labelKey)),c})(),d(dt,{get class(){return`right-panel-accordion-chevron ${o(a.id)?"right-panel-accordion-chevron-expanded":""}`}})]}}),d(Q,{openDelay:200,gutter:4,placement:"top",get children(){return[d(Q.Trigger,{as:"button",type:"button",class:"section-info-trigger",get"aria-label"(){return e.t(a.tooltipKey)},get children(){return d(vt,{class:"section-info-icon"})}}),d(Q.Portal,{get children(){return d(Q.Content,{class:"section-info-tooltip",get children(){return e.t(a.tooltipKey)}})}})]}})]}}),d(X.Content,{class:"right-panel-accordion-content",get children(){return a.render()}})]}})})}}),null),i})()};Ge(["click"]);export{tn as default};
1
+ import{m as Se,P as Xe,t as O,i as h,a as Ye,d as L,f as Ge}from"./monaco-viewer-BCffFoQZ.js";import{n as d,m as S,b as $,o as P,k as J,l as ee,q as re,s as _,d as T,c as j,S as Z,t as Qe,w as Ce,a as pe,F as de}from"./git-diff-vendor-CAv-4upN.js";import{I as fe,O as Ze,P as F,Q as se,T as Je,U as et,V as Pe,W as Ie,X as Te,Y as tt,Z as ue,_ as ie,$ as le,a0 as $e,a1 as te,a2 as ne,a3 as nt,a4 as he,a5 as ot,a6 as st,a7 as E,a8 as me,a9 as it,aa as rt,ab as lt,ac as A,ad as at,ae as ct,af as we,ag as dt,ah as ge,ai as ut,aj as gt,ak as pt,al as ft}from"./main-C35SKI2Q.js";import{u as ht}from"./index-CJQRbTtv.js";import{T as mt}from"./todo-CGOKkpdI.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";const bt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],vt=e=>d(fe,S(e,{name:"Info",iconNode:bt})),yt=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],xt=e=>d(fe,S(e,{name:"TerminalSquare",iconNode:yt})),Ct=[["polygon",{points:"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2",key:"h1p8hx"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],wt=e=>d(fe,S(e,{name:"XOctagon",iconNode:Ct}));var ke=J();function St(){return ee(ke)}function Pt(){const e=St();if(e===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}function De(e,o){return!!(o.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function It(e,o){var t;const l=o.ref();if(!l)return-1;let r=e.length;if(!r)return-1;for(;r--;){const n=(t=e[r])==null?void 0:t.ref();if(n&&De(n,l))return r+1}return 0}function Tt(e){const o=e.map((r,t)=>[t,r]);let l=!1;return o.sort(([r,t],[n,s])=>{const i=t.ref(),a=s.ref();return i===a||!i||!a?0:De(i,a)?(r>n&&(l=!0),-1):(r<n&&(l=!0),1)}),l?o.map(([r,t])=>t):e}function Oe(e,o){const l=Tt(e);e!==l&&o(l)}function $t(e){var t,n;const o=e[0],l=(t=e[e.length-1])==null?void 0:t.ref();let r=(n=o==null?void 0:o.ref())==null?void 0:n.parentElement;for(;r;){if(l&&r.contains(l))return r;r=r.parentElement}return se(r).body}function kt(e,o){$(()=>{const l=setTimeout(()=>{Oe(e(),o)});P(()=>clearTimeout(l))})}function Dt(e,o){if(typeof IntersectionObserver!="function"){kt(e,o);return}let l=[];$(()=>{const r=()=>{const s=!!l.length;l=e(),s&&Oe(e(),o)},t=$t(e()),n=new IntersectionObserver(r,{root:t});for(const s of e()){const i=s.ref();i&&n.observe(i)}P(()=>n.disconnect())})}function Ot(e={}){const[o,l]=Ze({value:()=>et(e.items),onChange:n=>{var s;return(s=e.onItemsChange)==null?void 0:s.call(e,n)}});Dt(o,l);const r=n=>(l(s=>{const i=It(s,n);return Je(s,n,i)}),()=>{l(s=>{const i=s.filter(a=>a.ref()!==n.ref());return s.length===i.length?s:i})});return{DomCollectionProvider:n=>d(ke.Provider,{value:{registerItem:r},get children(){return n.children}})}}function _t(e){const o=Pt(),l=F({shouldRegisterItem:!0},e);$(()=>{if(!l.shouldRegisterItem)return;const r=o.registerItem(l.getItem());P(r)})}var Mt={};me(Mt,{Arrow:()=>Pe,Content:()=>Me,Portal:()=>Ee,Root:()=>Ae,Tooltip:()=>Q,Trigger:()=>Fe,useTooltipContext:()=>ae});var _e=J();function ae(){const e=ee(_e);if(e===void 0)throw new Error("[kobalte]: `useTooltipContext` must be used within a `Tooltip` component");return e}function Me(e){const o=ae(),l=F({id:o.generateId("content")},e),[r,t]=_(l,["ref","style"]);return $(()=>P(o.registerContentId(t.id))),d(Z,{get when(){return o.contentPresent()},get children(){return d($e.Positioner,{get children(){return d(nt,S({ref(n){var s=te(i=>{o.setContentRef(i)},r.ref);typeof s=="function"&&s(n)},role:"tooltip",disableOutsidePointerEvents:!1,get style(){return he({"--kb-tooltip-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},r.style)},onFocusOutside:n=>n.preventDefault(),onDismiss:()=>o.hideTooltip(!0)},()=>o.dataset(),t))}})}})}function Ee(e){const o=ae();return d(Z,{get when(){return o.contentPresent()},get children(){return d(Xe,e)}})}function Et(e,o,l){const r=e.split("-")[0],t=o.getBoundingClientRect(),n=l.getBoundingClientRect(),s=[],i=t.left+t.width/2,a=t.top+t.height/2;switch(r){case"top":s.push([t.left,a]),s.push([n.left,n.bottom]),s.push([n.left,n.top]),s.push([n.right,n.top]),s.push([n.right,n.bottom]),s.push([t.right,a]);break;case"right":s.push([i,t.top]),s.push([n.left,n.top]),s.push([n.right,n.top]),s.push([n.right,n.bottom]),s.push([n.left,n.bottom]),s.push([i,t.bottom]);break;case"bottom":s.push([t.left,a]),s.push([n.left,n.top]),s.push([n.left,n.bottom]),s.push([n.right,n.bottom]),s.push([n.right,n.top]),s.push([t.right,a]);break;case"left":s.push([i,t.top]),s.push([n.right,n.top]),s.push([n.left,n.top]),s.push([n.left,n.bottom]),s.push([n.right,n.bottom]),s.push([i,t.bottom]);break}return s}var N={},At=0,q=!1,M,G,V;function Ae(e){const o=`tooltip-${re()}`,l=`${++At}`,r=F({id:o,openDelay:700,closeDelay:300,skipDelayDuration:300},e),[t,n]=_(r,["id","open","defaultOpen","onOpenChange","disabled","triggerOnFocusOnly","openDelay","closeDelay","skipDelayDuration","ignoreSafeArea","forceMount"]);let s;const[i,a]=T(),[c,p]=T(),[u,g]=T(),[v,x]=T(n.placement),y=Ie({open:()=>t.open,defaultOpen:()=>t.defaultOpen,onOpenChange:b=>{var D;return(D=t.onOpenChange)==null?void 0:D.call(t,b)}}),{present:C}=Te({show:()=>t.forceMount||y.isOpen(),element:()=>u()??null}),f=()=>{N[l]=m},w=()=>{for(const b in N)b!==l&&(N[b](!0),delete N[b])},m=(b=!1)=>{b||t.closeDelay&&t.closeDelay<=0?(window.clearTimeout(s),s=void 0,y.close()):s||(s=window.setTimeout(()=>{s=void 0,y.close()},t.closeDelay)),window.clearTimeout(M),M=void 0,t.skipDelayDuration&&t.skipDelayDuration>=0&&(V=window.setTimeout(()=>{window.clearTimeout(V),V=void 0},t.skipDelayDuration)),q&&(window.clearTimeout(G),G=window.setTimeout(()=>{delete N[l],G=void 0,q=!1},t.closeDelay))},I=()=>{clearTimeout(s),s=void 0,w(),f(),q=!0,y.open(),window.clearTimeout(M),M=void 0,window.clearTimeout(G),G=void 0,window.clearTimeout(V),V=void 0},W=()=>{w(),f(),!y.isOpen()&&!M&&!q?M=window.setTimeout(()=>{M=void 0,q=!0,I()},t.openDelay):y.isOpen()||I()},K=(b=!1)=>{!b&&t.openDelay&&t.openDelay>0&&!s&&!V?W():I()},z=()=>{window.clearTimeout(M),M=void 0,q=!1},R=()=>{window.clearTimeout(s),s=void 0},U=b=>ue(c(),b)||ue(u(),b),k=b=>{const D=c(),B=u();if(!(!D||!B))return Et(b,D,B)},Y=b=>{const D=b.target;if(U(D)){R();return}if(!t.ignoreSafeArea){const B=k(v());if(B&&ot(st(b),B)){R();return}}s||m()};$(()=>{if(!y.isOpen())return;const b=se();b.addEventListener("pointermove",Y,!0),P(()=>{b.removeEventListener("pointermove",Y,!0)})}),$(()=>{const b=c();if(!b||!y.isOpen())return;const D=qe=>{const Ve=qe.target;ue(Ve,b)&&m(!0)},B=tt();B.addEventListener("scroll",D,{capture:!0}),P(()=>{B.removeEventListener("scroll",D,{capture:!0})})}),P(()=>{clearTimeout(s),N[l]&&delete N[l]});const ze={dataset:j(()=>({"data-expanded":y.isOpen()?"":void 0,"data-closed":y.isOpen()?void 0:""})),isOpen:y.isOpen,isDisabled:()=>t.disabled??!1,triggerOnFocusOnly:()=>t.triggerOnFocusOnly??!1,contentId:i,contentPresent:C,openTooltip:K,hideTooltip:m,cancelOpening:z,generateId:le(()=>r.id),registerContentId:ie(a),isTargetOnTooltip:U,setTriggerRef:p,setContentRef:g};return d(_e.Provider,{value:ze,get children(){return d($e,S({anchorRef:c,contentRef:u,onCurrentPlacementChange:x},n))}})}function Fe(e){let o;const l=ae(),[r,t]=_(e,["ref","onPointerEnter","onPointerLeave","onPointerDown","onClick","onFocus","onBlur"]);let n=!1,s=!1,i=!1;const a=()=>{n=!1},c=()=>{!l.isOpen()&&(s||i)&&l.openTooltip(i)},p=f=>{l.isOpen()&&!s&&!i&&l.hideTooltip(f)},u=f=>{E(f,r.onPointerEnter),!(f.pointerType==="touch"||l.triggerOnFocusOnly()||l.isDisabled()||f.defaultPrevented)&&(s=!0,c())},g=f=>{E(f,r.onPointerLeave),f.pointerType!=="touch"&&(s=!1,i=!1,l.isOpen()?p():l.cancelOpening())},v=f=>{E(f,r.onPointerDown),n=!0,se(o).addEventListener("pointerup",a,{once:!0})},x=f=>{E(f,r.onClick),s=!1,i=!1,p(!0)},y=f=>{E(f,r.onFocus),!(l.isDisabled()||f.defaultPrevented||n)&&(i=!0,c())},C=f=>{E(f,r.onBlur);const w=f.relatedTarget;l.isTargetOnTooltip(w)||(s=!1,i=!1,p(!0))};return P(()=>{se(o).removeEventListener("pointerup",a)}),d(ne,S({as:"button",ref(f){var w=te(m=>{l.setTriggerRef(m),o=m},r.ref);typeof w=="function"&&w(f)},get"aria-describedby"(){return Se(()=>!!l.isOpen())()?l.contentId():void 0},onPointerEnter:u,onPointerLeave:g,onPointerDown:v,onClick:x,onFocus:y,onBlur:C},()=>l.dataset(),t))}var Q=Object.assign(Ae,{Arrow:Pe,Content:Me,Portal:Ee,Trigger:Fe}),Ft={};me(Ft,{Collapsible:()=>Kt,Content:()=>be,Root:()=>ve,Trigger:()=>ye,useCollapsibleContext:()=>oe});var Ke=J();function oe(){const e=ee(Ke);if(e===void 0)throw new Error("[kobalte]: `useCollapsibleContext` must be used within a `Collapsible.Root` component");return e}function be(e){const[o,l]=T(),r=oe(),t=F({id:r.generateId("content")},e),[n,s]=_(t,["ref","id","style"]),{present:i}=Te({show:r.shouldMount,element:()=>o()??null}),[a,c]=T(0),[p,u]=T(0);let v=r.isOpen()||i();return Qe(()=>{const x=requestAnimationFrame(()=>{v=!1});P(()=>{cancelAnimationFrame(x)})}),$(Ce(i,()=>{if(!o())return;o().style.transitionDuration="0s",o().style.animationName="none";const x=o().getBoundingClientRect();c(x.height),u(x.width),v||(o().style.transitionDuration="",o().style.animationName="")})),$(Ce(r.isOpen,x=>{!x&&o()&&(o().style.transitionDuration="",o().style.animationName="")},{defer:!0})),$(()=>P(r.registerContentId(n.id))),d(Z,{get when(){return i()},get children(){return d(ne,S({as:"div",ref(x){var y=te(l,n.ref);typeof y=="function"&&y(x)},get id(){return n.id},get style(){return he({"--kb-collapsible-content-height":a()?`${a()}px`:void 0,"--kb-collapsible-content-width":p()?`${p()}px`:void 0},n.style)}},()=>r.dataset(),s))}})}function ve(e){const o=`collapsible-${re()}`,l=F({id:o},e),[r,t]=_(l,["open","defaultOpen","onOpenChange","disabled","forceMount"]),[n,s]=T(),i=Ie({open:()=>r.open,defaultOpen:()=>r.defaultOpen,onOpenChange:p=>{var u;return(u=r.onOpenChange)==null?void 0:u.call(r,p)}}),a=j(()=>({"data-expanded":i.isOpen()?"":void 0,"data-closed":i.isOpen()?void 0:"","data-disabled":r.disabled?"":void 0})),c={dataset:a,isOpen:i.isOpen,disabled:()=>r.disabled??!1,shouldMount:()=>r.forceMount||i.isOpen(),contentId:n,toggle:i.toggle,generateId:le(()=>t.id),registerContentId:ie(s)};return d(Ke.Provider,{value:c,get children(){return d(ne,S({as:"div"},a,t))}})}function ye(e){const o=oe(),[l,r]=_(e,["onClick"]);return d(it,S({get"aria-expanded"(){return o.isOpen()},get"aria-controls"(){return Se(()=>!!o.isOpen())()?o.contentId():void 0},get disabled(){return o.disabled()},onClick:n=>{E(n,l.onClick),o.toggle()}},()=>o.dataset(),r))}var Kt=Object.assign(ve,{Content:be,Trigger:ye}),X={};me(X,{Accordion:()=>Rt,Content:()=>Le,Header:()=>Ue,Item:()=>He,Root:()=>je,Trigger:()=>We,useAccordionContext:()=>xe});var Re=J();function Be(){const e=ee(Re);if(e===void 0)throw new Error("[kobalte]: `useAccordionItemContext` must be used within a `Accordion.Item` component");return e}function Le(e){const o=Be(),l=o.generateId("content"),r=F({id:l},e),[t,n]=_(r,["id","style"]);return $(()=>P(o.registerContentId(t.id))),d(be,S({role:"region",get"aria-labelledby"(){return o.triggerId()},get style(){return he({"--kb-accordion-content-height":"var(--kb-collapsible-content-height)","--kb-accordion-content-width":"var(--kb-collapsible-content-width)"},t.style)}},n))}function Ue(e){const o=oe();return d(ne,S({as:"h3"},()=>o.dataset(),e))}var Ne=J();function xe(){const e=ee(Ne);if(e===void 0)throw new Error("[kobalte]: `useAccordionContext` must be used within a `Accordion.Root` component");return e}function He(e){const o=xe(),l=`${o.generateId("item")}-${re()}`,r=F({id:l},e),[t,n]=_(r,["value","disabled"]),[s,i]=T(),[a,c]=T(),p=()=>o.listState().selectionManager(),u=()=>p().isSelected(t.value),g={value:()=>t.value,triggerId:s,contentId:a,generateId:le(()=>n.id),registerTriggerId:ie(i),registerContentId:ie(c)};return d(Re.Provider,{value:g,get children(){return d(ve,S({get open(){return u()},get disabled(){return t.disabled}},n))}})}function je(e){let o;const l=`accordion-${re()}`,r=F({id:l,multiple:!1,collapsible:!1,shouldFocusWrap:!0},e),[t,n]=_(r,["id","ref","value","defaultValue","onChange","multiple","collapsible","shouldFocusWrap","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]),[s,i]=T([]),{DomCollectionProvider:a}=Ot({items:s,onItemsChange:i}),c=rt({selectedKeys:()=>t.value,defaultSelectedKeys:()=>t.defaultValue,onSelectionChange:g=>{var v;return(v=t.onChange)==null?void 0:v.call(t,Array.from(g))},disallowEmptySelection:()=>!t.multiple&&!t.collapsible,selectionMode:()=>t.multiple?"multiple":"single",dataSource:s});c.selectionManager().setFocusedKey("item-1");const p=lt({selectionManager:()=>c.selectionManager(),collection:()=>c.collection(),disallowEmptySelection:()=>c.selectionManager().disallowEmptySelection(),shouldFocusWrap:()=>t.shouldFocusWrap,disallowTypeAhead:!0,allowsTabNavigation:!0},()=>o),u={listState:()=>c,generateId:le(()=>t.id)};return d(a,{get children(){return d(Ne.Provider,{value:u,get children(){return d(ne,S({as:"div",get id(){return t.id},ref(g){var v=te(x=>o=x,t.ref);typeof v=="function"&&v(g)},get onKeyDown(){return A([t.onKeyDown,p.onKeyDown])},get onMouseDown(){return A([t.onMouseDown,p.onMouseDown])},get onFocusIn(){return A([t.onFocusIn])},get onFocusOut(){return A([t.onFocusOut,p.onFocusOut])}},n))}})}})}function We(e){let o;const l=xe(),r=Be(),t=oe(),n=r.generateId("trigger"),s=F({id:n},e),[i,a]=_(s,["ref","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]);_t({getItem:()=>({ref:()=>o,type:"item",key:r.value(),textValue:"",disabled:t.disabled()})});const c=at({key:()=>r.value(),selectionManager:()=>l.listState().selectionManager(),disabled:()=>t.disabled(),shouldSelectOnPressUp:!0},()=>o),p=u=>{["Enter"," "].includes(u.key)&&u.preventDefault(),E(u,i.onKeyDown),E(u,c.onKeyDown)};return $(()=>P(r.registerTriggerId(a.id))),d(ye,S({ref(u){var g=te(v=>o=v,i.ref);typeof g=="function"&&g(u)},get"data-key"(){return c.dataKey()},get onPointerDown(){return A([i.onPointerDown,c.onPointerDown])},get onPointerUp(){return A([i.onPointerUp,c.onPointerUp])},get onClick(){return A([i.onClick,c.onClick])},onKeyDown:p,get onMouseDown(){return A([i.onMouseDown,c.onMouseDown])},get onFocus(){return A([i.onFocus,c.onFocus])}},a))}var Rt=Object.assign(je,{Content:Le,Header:Ue,Item:He,Trigger:We}),Bt=O('<div><div class="flex flex-wrap items-center gap-2 text-xs text-primary"><div class="inline-flex items-center gap-1 rounded-full border border-base px-2 py-0.5 text-xs text-primary"><span class="uppercase text-[10px] tracking-wide text-muted"></span><span class="font-semibold text-primary"></span></div><div class="inline-flex items-center gap-1 rounded-full border border-base px-2 py-0.5 text-xs text-primary"><span class="uppercase text-[10px] tracking-wide text-muted"></span><span class="font-semibold text-primary"></span></div><div class="inline-flex items-center gap-1 rounded-full border border-base px-2 py-0.5 text-xs text-primary"><span class="uppercase text-[10px] tracking-wide text-muted"></span><span class="font-semibold text-primary">');const Lt=e=>{const{t:o}=ht(),l=j(()=>ct(e.instanceId,e.sessionId)??{cost:0,contextWindow:0,isSubscriptionModel:!1,inputTokens:0,outputTokens:0,reasoningTokens:0,actualUsageTokens:0,modelOutputLimit:0,contextAvailableTokens:null}),r=j(()=>l().inputTokens??0),t=j(()=>l().outputTokens??0),n=j(()=>{const i=l().isSubscriptionModel?0:l().cost;return i>0?i:0}),s=j(()=>`$${n().toFixed(2)}`);return(()=>{var i=Bt(),a=i.firstChild,c=a.firstChild,p=c.firstChild,u=p.nextSibling,g=c.nextSibling,v=g.firstChild,x=v.nextSibling,y=g.nextSibling,C=y.firstChild,f=C.nextSibling;return h(p,()=>o("contextUsagePanel.labels.input")),h(u,()=>we(r())),h(v,()=>o("contextUsagePanel.labels.output")),h(x,()=>we(t())),h(C,()=>o("contextUsagePanel.labels.cost")),h(f,s),pe(()=>Ye(i,`session-context-panel px-4 py-2 ${e.class??""}`)),i})()};var H=O('<div class="right-panel-empty right-panel-empty--left"><span class=text-xs>'),Ut=O('<div class="rounded-md border border-base bg-surface-secondary px-3 py-2"><div class="flex items-start justify-between gap-3"><div class=min-w-0><div class="text-sm font-medium text-primary"></div><p class="mt-1 text-xs text-secondary">'),Nt=O('<div class="flex flex-col gap-3 min-h-0"><div class="flex items-center justify-between gap-2 text-[11px] text-secondary"><span></span><span class="flex items-center gap-2"><span style=color:var(--session-status-idle-fg)></span><span style=color:var(--session-status-working-fg)></span></span></div><div class="rounded-md border border-base bg-surface-secondary p-2 max-h-[40vh] overflow-y-auto"><div class="flex flex-col">'),Ht=O('<button type=button class="border-b border-base last:border-b-0 text-left hover:bg-surface-muted rounded-sm"><div class="flex items-center justify-between gap-3"><div class="text-xs font-mono text-primary min-w-0 flex-1 overflow-hidden whitespace-nowrap"style=text-overflow:ellipsis;direction:rtl;text-align:left;unicode-bidi:plaintext></div><div class="flex items-center gap-2 text-[11px] flex-shrink-0"><span style=color:var(--session-status-idle-fg)></span><span style=color:var(--session-status-working-fg)>'),jt=O('<div class="flex flex-col gap-2">'),Wt=O("<span>"),zt=O('<div class=status-process-card><div class=status-process-header><span class=status-process-title></span><div class=status-process-meta><span></span></div></div><div class=status-process-actions><button type=button class="button-tertiary w-full p-1 inline-flex items-center justify-center"></button><button type=button class="button-tertiary w-full p-1 inline-flex items-center justify-center"></button><button type=button class="button-tertiary w-full p-1 inline-flex items-center justify-center">'),qt=O("<div class=status-tab-container>"),Vt=O("<span class=section-left><span class=section-label>");const tn=e=>{const o=i=>e.expandedItems().includes(i),s=[{id:"yolo-mode",labelKey:"instanceShell.rightPanel.sections.yoloMode",tooltipKey:"instanceShell.rightPanel.sections.yoloMode.tooltip",render:()=>{const i=e.activeSession();return i?(()=>{var a=Ut(),c=a.firstChild,p=c.firstChild,u=p.firstChild,g=u.nextSibling;return h(u,()=>e.t("instanceShell.yoloMode.title")),h(g,()=>e.t("instanceShell.yoloMode.description")),h(c,d(pt,{get checked(){return gt(e.instanceId,i.id)},color:"warning",size:"small",get inputProps(){return{"aria-label":e.t("instanceShell.yoloMode.title")}},onChange:()=>ut(e.instanceId,i.id)}),null),a})():(()=>{var a=H(),c=a.firstChild;return h(c,()=>e.t("instanceShell.yoloMode.noSessionSelected")),a})()}},{id:"session-changes",labelKey:"instanceShell.rightPanel.sections.sessionChanges",tooltipKey:"instanceShell.rightPanel.sections.sessionChanges.tooltip",render:()=>{const i=e.activeSessionId();if(!i||i==="info")return(()=>{var u=H(),g=u.firstChild;return h(g,()=>e.t("instanceShell.sessionChanges.noSessionSelected")),u})();const a=e.activeSessionDiffs();if(a===void 0)return(()=>{var u=H(),g=u.firstChild;return h(g,()=>e.t("instanceShell.sessionChanges.loading")),u})();if(!Array.isArray(a)||a.length===0)return(()=>{var u=H(),g=u.firstChild;return h(g,()=>e.t("instanceShell.sessionChanges.empty")),u})();const c=[...a].sort((u,g)=>String(u.file||"").localeCompare(String(g.file||""))),p=c.reduce((u,g)=>(u.additions+=typeof g.additions=="number"?g.additions:0,u.deletions+=typeof g.deletions=="number"?g.deletions:0,u),{additions:0,deletions:0});return(()=>{var u=Nt(),g=u.firstChild,v=g.firstChild,x=v.nextSibling,y=x.firstChild,C=y.nextSibling,f=g.nextSibling,w=f.firstChild;return h(v,()=>e.t("instanceShell.sessionChanges.filesChanged",{count:c.length})),h(y,()=>`+${p.additions}`),h(C,()=>`-${p.deletions}`),h(w,d(de,{each:c,children:m=>(()=>{var I=Ht(),W=I.firstChild,K=W.firstChild,z=K.nextSibling,R=z.firstChild,U=R.nextSibling;return I.$$click=()=>e.onOpenChangesTab(m.file),h(K,()=>m.file),h(R,()=>`+${m.additions}`),h(U,()=>`-${m.deletions}`),pe(k=>{var Y=e.t("instanceShell.sessionChanges.actions.show"),ce=m.file;return Y!==k.e&&L(I,"title",k.e=Y),ce!==k.t&&L(K,"title",k.t=ce),k},{e:void 0,t:void 0}),I})()})),u})()}},{id:"plan",labelKey:"instanceShell.rightPanel.sections.plan",tooltipKey:"instanceShell.rightPanel.sections.plan.tooltip",render:()=>{const i=e.activeSessionId();if(!i||i==="info")return(()=>{var c=H(),p=c.firstChild;return h(p,()=>e.t("instanceShell.plan.noSessionSelected")),c})();const a=e.latestTodoState();return a?d(mt,{state:a,get emptyLabel(){return e.t("instanceShell.plan.empty")},showStatusLabel:!1}):(()=>{var c=H(),p=c.firstChild;return h(p,()=>e.t("instanceShell.plan.empty")),c})()}},{id:"background-processes",labelKey:"instanceShell.rightPanel.sections.backgroundProcesses",tooltipKey:"instanceShell.rightPanel.sections.backgroundProcesses.tooltip",render:()=>{const i=e.backgroundProcessList();return i.length===0?(()=>{var a=H(),c=a.firstChild;return h(c,()=>e.t("instanceShell.backgroundProcesses.empty")),a})():(()=>{var a=jt();return h(a,d(de,{each:i,children:c=>(()=>{var p=zt(),u=p.firstChild,g=u.firstChild,v=g.nextSibling,x=v.firstChild,y=u.nextSibling,C=y.firstChild,f=C.nextSibling,w=f.nextSibling;return h(g,()=>c.title),h(x,()=>e.t("instanceShell.backgroundProcesses.status",{status:c.status})),h(v,d(Z,{get when(){return typeof c.outputSizeBytes=="number"},get children(){var m=Wt();return h(m,()=>e.t("instanceShell.backgroundProcesses.output",{sizeKb:Math.round((c.outputSizeBytes??0)/1024)})),m}}),null),C.$$click=()=>e.onOpenBackgroundOutput(c),h(C,d(xt,{class:"h-4 w-4"})),f.$$click=()=>e.onStopBackgroundProcess(c.id),h(f,d(wt,{class:"h-4 w-4"})),w.$$click=()=>e.onTerminateBackgroundProcess(c.id),h(w,d(ft,{class:"h-4 w-4"})),pe(m=>{var I=e.t("instanceShell.backgroundProcesses.actions.output"),W=e.t("instanceShell.backgroundProcesses.actions.output"),K=c.status!=="running",z=e.t("instanceShell.backgroundProcesses.actions.stop"),R=e.t("instanceShell.backgroundProcesses.actions.stop"),U=e.t("instanceShell.backgroundProcesses.actions.terminate"),k=e.t("instanceShell.backgroundProcesses.actions.terminate");return I!==m.e&&L(C,"aria-label",m.e=I),W!==m.t&&L(C,"title",m.t=W),K!==m.a&&(f.disabled=m.a=K),z!==m.o&&L(f,"aria-label",m.o=z),R!==m.i&&L(f,"title",m.i=R),U!==m.n&&L(w,"aria-label",m.n=U),k!==m.s&&L(w,"title",m.s=k),m},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),p})()})),a})()}},{id:"mcp",labelKey:"instanceShell.rightPanel.sections.mcp",tooltipKey:"instanceShell.rightPanel.sections.mcp.tooltip",render:()=>d(ge,{get initialInstance(){return e.instance},sections:["mcp"],showSectionHeadings:!1,class:"space-y-2"})},{id:"lsp",labelKey:"instanceShell.rightPanel.sections.lsp",tooltipKey:"instanceShell.rightPanel.sections.lsp.tooltip",render:()=>d(ge,{get initialInstance(){return e.instance},sections:["lsp"],showSectionHeadings:!1,class:"space-y-2"})},{id:"plugins",labelKey:"instanceShell.rightPanel.sections.plugins",tooltipKey:"instanceShell.rightPanel.sections.plugins.tooltip",render:()=>d(ge,{get initialInstance(){return e.instance},sections:["plugins"],showSectionHeadings:!1,class:"space-y-2"})}];return(()=>{var i=qt();return h(i,d(Z,{get when(){return e.activeSession()},children:a=>d(Lt,{get instanceId(){return e.instanceId},get sessionId(){return a().id},class:"status-tab-context-panel"})}),null),h(i,d(X.Root,{class:"right-panel-accordion",collapsible:!0,multiple:!0,get value(){return e.expandedItems()},get onChange(){return e.onExpandedItemsChange},get children(){return d(de,{each:s,children:a=>d(X.Item,{get value(){return a.id},class:"right-panel-accordion-item",get children(){return[d(X.Header,{class:"right-panel-accordion-header-row",get children(){return[d(X.Trigger,{class:"right-panel-accordion-trigger",get children(){return[(()=>{var c=Vt(),p=c.firstChild;return h(p,()=>e.t(a.labelKey)),c})(),d(dt,{get class(){return`right-panel-accordion-chevron ${o(a.id)?"right-panel-accordion-chevron-expanded":""}`}})]}}),d(Q,{openDelay:200,gutter:4,placement:"top",get children(){return[d(Q.Trigger,{as:"button",type:"button",class:"section-info-trigger",get"aria-label"(){return e.t(a.tooltipKey)},get children(){return d(vt,{class:"section-info-icon"})}}),d(Q.Portal,{get children(){return d(Q.Content,{class:"section-info-tooltip",get children(){return e.t(a.tooltipKey)}})}})]}})]}}),d(X.Content,{class:"right-panel-accordion-content",get children(){return a.render()}})]}})})}}),null),i})()};Ge(["click"]);export{tn as default};
@@ -1 +1 @@
1
- import{t as b,i as x,u as E,m as _,k as V}from"./monaco-viewer-BCffFoQZ.js";import{c as L,b as B,n as p,a as F,S as T,E as D,D as z,C as $,G}from"./git-diff-vendor-CAv-4upN.js";import{an as U,ao as N,ap as K}from"./main-BpgxtqbO.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";import"./index-CJQRbTtv.js";var q=b("<div>"),O=b("<div class=tool-call-diff-viewer>"),P=b("<pre class=tool-call-diff-fallback>");const j=V("session");G();function I(e,s,o){const a=window.getComputedStyle(o),i=document.createElement("span");i.textContent=s||"",i.style.position="absolute",i.style.visibility="hidden",i.style.pointerEvents="none",i.style.display="inline-block",i.style.width="auto",i.style.maxWidth="none",i.style.whiteSpace="nowrap",i.style.fontFamily=a.fontFamily,i.style.fontSize=a.fontSize,i.style.fontWeight=a.fontWeight,i.style.fontStyle=a.fontStyle,i.style.letterSpacing=a.letterSpacing,i.style.fontVariant=a.fontVariant,i.style.textTransform=a.textTransform,i.style.lineHeight=a.lineHeight,e.appendChild(i);const f=Math.ceil(i.getBoundingClientRect().width);return i.remove(),f}function M(e,s,o=40){const a=s.reduce((l,n)=>Math.max(l,I(e,n.text,n.source)),0),i=s.reduce((l,n)=>Math.max(l,n.text.length),1),f=Math.round(i*7+4);return Math.max(2,Math.min(o,a>0?a+2:f))}function J(e,s){const o=e.querySelector(".unified-diff-table-wrapper"),a=e.querySelector(".unified-diff-table"),i=e.querySelector(".unified-diff-table-num-col"),f=e.querySelectorAll(".diff-line-num"),l=e.querySelectorAll(".diff-line-hunk-action, .diff-line-widget-wrapper, .diff-line-extend-wrapper"),n=[];a&&(s?(a.classList.add("table-fixed"),a.style.tableLayout="fixed",a.style.width="100%",a.style.minWidth="100%"):(a.classList.remove("table-fixed"),a.style.tableLayout="auto",a.style.width="max-content",a.style.minWidth="100%")),f.forEach(r=>{var v,k;const c=r.querySelector("[data-line-old-num]"),m=r.querySelector("[data-line-new-num]"),W=r.querySelector(".shrink-0"),S=r.querySelector(":scope > .flex"),C=r.querySelector(":scope > .tool-call-diff-compact-line-number"),y=((v=c==null?void 0:c.textContent)==null?void 0:v.trim())??"",w=((k=m==null?void 0:m.textContent)==null?void 0:k.trim())??"",H=w.length>0&&w!=="0",R=y.length>0&&y!=="0",g=H?w:R?y:w||y;S&&(S.style.display="none"),W&&(W.style.display="none"),c&&(c.style.display="none",c.style.width="auto"),m&&(m.style.display="none",m.style.width="auto"),r.style.paddingLeft="1px",r.style.paddingRight="1px",r.style.textAlign="left";const u=C??document.createElement("span");u.className="tool-call-diff-compact-line-number",u.textContent=g,u.setAttribute("aria-hidden",g?"false":"true"),C||r.appendChild(u),n.push({gutter:r,label:u,text:g})});const t=M(e,n.map(r=>({text:r.text,source:r.label}))),d=`${t}px`,h=`${Math.max(8,t-10)}px`;o&&(o.style.setProperty("--diff-aside-width",h),o.style.setProperty("--diff-aside-width--",h)),i&&(i.style.width=d),n.forEach(({gutter:r,label:c})=>{r.style.width=d,r.style.minWidth=d,r.style.maxWidth=d,c.style.width="auto",c.style.maxWidth="none"}),l.forEach(r=>{r.style.width=d,r.style.minWidth=d,r.style.maxWidth=d,r.style.paddingLeft="0",r.style.paddingRight="0"})}function Q(e){const s=e.querySelector(".old-diff-table-wrapper"),o=e.querySelector(".new-diff-table-wrapper"),a=Array.from(e.querySelectorAll(".diff-line-old-num, .diff-line-new-num")),i=Array.from(e.querySelectorAll(".diff-line-hunk-action, .diff-line-widget-wrapper, .diff-line-extend-wrapper")),f=a.map(t=>({cell:t,span:t.querySelector("[data-line-num]")})).filter(t=>!!t.span),n=`${M(e,f.map(({span:t})=>{var d;return{text:((d=t.textContent)==null?void 0:d.trim())??"",source:t}}),64)}px`;[s,o].forEach(t=>{t&&t.style.setProperty("--diff-aside-width",n)}),a.forEach(t=>{t.style.width=n,t.style.minWidth=n,t.style.maxWidth=n,t.style.paddingLeft="2px",t.style.paddingRight="2px",t.style.textAlign="left",t.style.whiteSpace="nowrap",t.style.overflowWrap="normal",t.style.wordBreak="normal"}),f.forEach(({span:t})=>{t.style.whiteSpace="nowrap",t.style.overflowWrap="normal",t.style.wordBreak="normal"}),i.forEach(t=>{t.style.width=n,t.style.minWidth=n,t.style.maxWidth=n,t.style.paddingLeft="0",t.style.paddingRight="0"})}function A(e,s,o=!1){if(s==="unified"){J(e,o);return}s==="split"&&Q(e)}function ne(e){const s=L(()=>{const f=U(e.diffText);if(!f)return null;const l=N(e.filePath)||"text",n=e.filePath||"diff";return{oldFile:{fileName:n,fileLang:l},newFile:{fileName:n,fileLang:l},hunks:[f]}});let o,a;const i=L(()=>s()?`${e.theme}|${e.mode}|${e.wrap?"wrap":"nowrap"}|${e.diffText}`:"");return B(()=>{var n;if(e.cachedHtml){o&&A(o,e.mode,!!e.wrap),(n=e.onRendered)==null||n.call(e);return}const l=i();l&&o&&a!==l&&requestAnimationFrame(()=>{var d;if(!o)return;A(o,e.mode,!!e.wrap);const t=o.innerHTML;t&&(a=l,e.cacheEntryParams&&K(e.cacheEntryParams,{text:e.diffText,html:t,theme:e.theme,mode:e.mode,wrap:e.wrap}),(d=e.onRendered)==null||d.call(e))})}),(()=>{var f=O();return x(f,p(T,{get when(){return e.cachedHtml},get fallback(){return(()=>{var l=q(),n=o;return typeof n=="function"?E(n,l):o=l,x(l,p(T,{get when(){return s()},get fallback(){return(()=>{var t=P();return x(t,()=>e.diffText),t})()},children:t=>p(D,{fallback:d=>(j.warn("Failed to render diff view",d),(()=>{var h=P();return x(h,()=>e.diffText),h})()),get children(){return p(z,{get data(){return t()},get diffViewMode(){return _(()=>e.mode==="split")()?$.Split:$.Unified},get diffViewTheme(){return e.theme},diffViewHighlight:!0,get diffViewWrap(){return!!e.wrap},diffViewFontSize:13})}})})),l})()},get children(){var l=q(),n=o;return typeof n=="function"?E(n,l):o=l,F(()=>l.innerHTML=e.cachedHtml),l}})),f})()}export{ne as ToolCallDiffViewer};
1
+ import{t as b,i as x,u as E,m as _,k as V}from"./monaco-viewer-BCffFoQZ.js";import{c as L,b as B,n as p,a as F,S as T,E as D,D as z,C as $,G}from"./git-diff-vendor-CAv-4upN.js";import{an as U,ao as N,ap as K}from"./main-C35SKI2Q.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";import"./index-CJQRbTtv.js";var q=b("<div>"),O=b("<div class=tool-call-diff-viewer>"),P=b("<pre class=tool-call-diff-fallback>");const j=V("session");G();function I(e,s,o){const a=window.getComputedStyle(o),i=document.createElement("span");i.textContent=s||"",i.style.position="absolute",i.style.visibility="hidden",i.style.pointerEvents="none",i.style.display="inline-block",i.style.width="auto",i.style.maxWidth="none",i.style.whiteSpace="nowrap",i.style.fontFamily=a.fontFamily,i.style.fontSize=a.fontSize,i.style.fontWeight=a.fontWeight,i.style.fontStyle=a.fontStyle,i.style.letterSpacing=a.letterSpacing,i.style.fontVariant=a.fontVariant,i.style.textTransform=a.textTransform,i.style.lineHeight=a.lineHeight,e.appendChild(i);const f=Math.ceil(i.getBoundingClientRect().width);return i.remove(),f}function M(e,s,o=40){const a=s.reduce((l,n)=>Math.max(l,I(e,n.text,n.source)),0),i=s.reduce((l,n)=>Math.max(l,n.text.length),1),f=Math.round(i*7+4);return Math.max(2,Math.min(o,a>0?a+2:f))}function J(e,s){const o=e.querySelector(".unified-diff-table-wrapper"),a=e.querySelector(".unified-diff-table"),i=e.querySelector(".unified-diff-table-num-col"),f=e.querySelectorAll(".diff-line-num"),l=e.querySelectorAll(".diff-line-hunk-action, .diff-line-widget-wrapper, .diff-line-extend-wrapper"),n=[];a&&(s?(a.classList.add("table-fixed"),a.style.tableLayout="fixed",a.style.width="100%",a.style.minWidth="100%"):(a.classList.remove("table-fixed"),a.style.tableLayout="auto",a.style.width="max-content",a.style.minWidth="100%")),f.forEach(r=>{var v,k;const c=r.querySelector("[data-line-old-num]"),m=r.querySelector("[data-line-new-num]"),W=r.querySelector(".shrink-0"),S=r.querySelector(":scope > .flex"),C=r.querySelector(":scope > .tool-call-diff-compact-line-number"),y=((v=c==null?void 0:c.textContent)==null?void 0:v.trim())??"",w=((k=m==null?void 0:m.textContent)==null?void 0:k.trim())??"",H=w.length>0&&w!=="0",R=y.length>0&&y!=="0",g=H?w:R?y:w||y;S&&(S.style.display="none"),W&&(W.style.display="none"),c&&(c.style.display="none",c.style.width="auto"),m&&(m.style.display="none",m.style.width="auto"),r.style.paddingLeft="1px",r.style.paddingRight="1px",r.style.textAlign="left";const u=C??document.createElement("span");u.className="tool-call-diff-compact-line-number",u.textContent=g,u.setAttribute("aria-hidden",g?"false":"true"),C||r.appendChild(u),n.push({gutter:r,label:u,text:g})});const t=M(e,n.map(r=>({text:r.text,source:r.label}))),d=`${t}px`,h=`${Math.max(8,t-10)}px`;o&&(o.style.setProperty("--diff-aside-width",h),o.style.setProperty("--diff-aside-width--",h)),i&&(i.style.width=d),n.forEach(({gutter:r,label:c})=>{r.style.width=d,r.style.minWidth=d,r.style.maxWidth=d,c.style.width="auto",c.style.maxWidth="none"}),l.forEach(r=>{r.style.width=d,r.style.minWidth=d,r.style.maxWidth=d,r.style.paddingLeft="0",r.style.paddingRight="0"})}function Q(e){const s=e.querySelector(".old-diff-table-wrapper"),o=e.querySelector(".new-diff-table-wrapper"),a=Array.from(e.querySelectorAll(".diff-line-old-num, .diff-line-new-num")),i=Array.from(e.querySelectorAll(".diff-line-hunk-action, .diff-line-widget-wrapper, .diff-line-extend-wrapper")),f=a.map(t=>({cell:t,span:t.querySelector("[data-line-num]")})).filter(t=>!!t.span),n=`${M(e,f.map(({span:t})=>{var d;return{text:((d=t.textContent)==null?void 0:d.trim())??"",source:t}}),64)}px`;[s,o].forEach(t=>{t&&t.style.setProperty("--diff-aside-width",n)}),a.forEach(t=>{t.style.width=n,t.style.minWidth=n,t.style.maxWidth=n,t.style.paddingLeft="2px",t.style.paddingRight="2px",t.style.textAlign="left",t.style.whiteSpace="nowrap",t.style.overflowWrap="normal",t.style.wordBreak="normal"}),f.forEach(({span:t})=>{t.style.whiteSpace="nowrap",t.style.overflowWrap="normal",t.style.wordBreak="normal"}),i.forEach(t=>{t.style.width=n,t.style.minWidth=n,t.style.maxWidth=n,t.style.paddingLeft="0",t.style.paddingRight="0"})}function A(e,s,o=!1){if(s==="unified"){J(e,o);return}s==="split"&&Q(e)}function ne(e){const s=L(()=>{const f=U(e.diffText);if(!f)return null;const l=N(e.filePath)||"text",n=e.filePath||"diff";return{oldFile:{fileName:n,fileLang:l},newFile:{fileName:n,fileLang:l},hunks:[f]}});let o,a;const i=L(()=>s()?`${e.theme}|${e.mode}|${e.wrap?"wrap":"nowrap"}|${e.diffText}`:"");return B(()=>{var n;if(e.cachedHtml){o&&A(o,e.mode,!!e.wrap),(n=e.onRendered)==null||n.call(e);return}const l=i();l&&o&&a!==l&&requestAnimationFrame(()=>{var d;if(!o)return;A(o,e.mode,!!e.wrap);const t=o.innerHTML;t&&(a=l,e.cacheEntryParams&&K(e.cacheEntryParams,{text:e.diffText,html:t,theme:e.theme,mode:e.mode,wrap:e.wrap}),(d=e.onRendered)==null||d.call(e))})}),(()=>{var f=O();return x(f,p(T,{get when(){return e.cachedHtml},get fallback(){return(()=>{var l=q(),n=o;return typeof n=="function"?E(n,l):o=l,x(l,p(T,{get when(){return s()},get fallback(){return(()=>{var t=P();return x(t,()=>e.diffText),t})()},children:t=>p(D,{fallback:d=>(j.warn("Failed to render diff view",d),(()=>{var h=P();return x(h,()=>e.diffText),h})()),get children(){return p(z,{get data(){return t()},get diffViewMode(){return _(()=>e.mode==="split")()?$.Split:$.Unified},get diffViewTheme(){return e.theme},diffViewHighlight:!0,get diffViewWrap(){return!!e.wrap},diffViewFontSize:13})}})})),l})()},get children(){var l=q(),n=o;return typeof n=="function"?E(n,l):o=l,F(()=>l.innerHTML=e.cachedHtml),l}})),f})()}export{ne as ToolCallDiffViewer};