codex-mobile-re 0.1.102 → 0.1.103
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/LICENSE +11 -11
- package/README.md +214 -214
- package/dist/assets/{AutomationsPanel-ulx5N8pM.css → AutomationsPanel-BBeoQ-Fx.css} +1 -1
- package/dist/assets/{AutomationsPanel-BZ73-GJE.js → AutomationsPanel-CnK1Yuru.js} +1 -1
- package/dist/assets/{DirectoryHub-DWtUbt5I.js → DirectoryHub-BunsdSMs.js} +2 -2
- package/dist/assets/{DirectoryHub-BOBZNd77.css → DirectoryHub-Ce5pFnd0.css} +1 -1
- package/dist/assets/{ReviewPane-Cd7kjB6d.js → ReviewPane-C02hbV2G.js} +1 -1
- package/dist/assets/{ReviewPane-B8ZRIB5L.css → ReviewPane-CyX0PWor.css} +1 -1
- package/dist/assets/{ThreadConversation-BFAPAWUd.js → ThreadConversation-BS09bMfR.js} +5 -5
- package/dist/assets/{ThreadConversation-Db8A09JM.css → ThreadConversation-D0SQKKN2.css} +1 -1
- package/dist/assets/{ThreadTerminalPanel-O7IxAyfy.css → ThreadTerminalPanel-BHXovq7A.css} +1 -1
- package/dist/assets/{ThreadTerminalPanel-C0cuIPzx.js → ThreadTerminalPanel-juDCK2c0.js} +2 -2
- package/dist/assets/index-DDchNpQh.js +87 -0
- package/dist/assets/{index-bLpg1m_q.css → index-DM1MDzKD.css} +1 -1
- package/dist/assets/{index.esm-Cxn_LBGD.js → index.esm-Cls06s1L.js} +1 -1
- package/dist/icons/codexui-icon.svg +52 -52
- package/dist/icons/pwa-icon.svg +38 -38
- package/dist/icons/pwa-maskable.svg +36 -36
- package/dist/index.html +21 -21
- package/dist/manifest.webmanifest +36 -36
- package/dist/sw.js +92 -92
- package/dist-cli/index.js +0 -0
- package/dist-cli/index.js.map +1 -1
- package/package.json +94 -94
- package/scripts/dev-random-home.cjs +21 -21
- package/scripts/dev.cjs +69 -69
- package/scripts/fix-pty-native-build.cjs +70 -70
- package/dist/assets/index-BALsV_-J.js +0 -86
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{d as dn,q as ct,N as un,O as _n,m as fn,l as pn,P as vs,C as gn,Q as vn,R as mn,S as Sn,o as Ht,a as Wt,b as Ke,F as wn,r as bn,n as ms,t as zt,u as Ft,e as yn,j as Cn,U as kn,_ as xn}from"./index-
|
|
1
|
+
import{d as dn,q as ct,N as un,O as _n,m as fn,l as pn,P as vs,C as gn,Q as vn,R as mn,S as Sn,o as Ht,a as Wt,b as Ke,F as wn,r as bn,n as ms,t as zt,u as Ft,e as yn,j as Cn,U as kn,_ as xn}from"./index-DDchNpQh.js";/**
|
|
2
2
|
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
3
3
|
* @license MIT
|
|
4
4
|
*
|
|
@@ -35,4 +35,4 @@ WARNING: This link could potentially be dangerous`)){let i=window.open();if(i){t
|
|
|
35
35
|
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
36
36
|
* http://bellard.org/jslinux/
|
|
37
37
|
* Copyright (c) 2011 Fabrice Bellard
|
|
38
|
-
*/var Ih=2,Nh=1,Hh=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){var c;if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:((c=this._terminal.options.overviewRuler)==null?void 0:c.width)||14,i=window.getComputedStyle(this._terminal.element.parentElement),s=parseInt(i.getPropertyValue("height")),r=Math.max(0,parseInt(i.getPropertyValue("width"))),n=window.getComputedStyle(this._terminal.element),o={top:parseInt(n.getPropertyValue("padding-top")),bottom:parseInt(n.getPropertyValue("padding-bottom")),right:parseInt(n.getPropertyValue("padding-right")),left:parseInt(n.getPropertyValue("padding-left"))},h=o.top+o.bottom,l=o.right+o.left,a=s-h,d=r-l-t;return{cols:Math.max(Ih,Math.floor(d/e.css.cell.width)),rows:Math.max(Nh,Math.floor(a/e.css.cell.height))}}};const Wh={class:"thread-terminal-header"},zh={class:"thread-terminal-tabs"},Fh=["title","onClick"],$h=["data-status"],Kh={class:"thread-terminal-title"},Uh={class:"thread-terminal-actions"},qh=["title"],Vh=["title"],Yh={key:0,class:"thread-terminal-error"},_r="codex-web-local.terminal-quick-commands.v1",fr="codex-web-local.terminal-tabs.v1",Xh=dn({__name:"ThreadTerminalPanel",props:{threadId:{},cwd:{}},emits:["hide","terminalFocusChange"],setup(e,{expose:t,emit:i}){const s=e,r=i,n=ct(null),o=ct(""),h=ct(""),l=ct([]);let a=null,d=null,c=null,u=null,f=0,_=null;const{t:p}=Cn(),w=ct(Ee()),B=ct([]);un(()=>{D(),$(),u=_n(N),ye(),A(!1)}),fn(()=>{f&&(window.cancelAnimationFrame(f),f=0),c==null||c.disconnect(),c=null,u==null||u(),u=null,a==null||a.dispose(),a=null,d=null}),pn(()=>[s.threadId,s.cwd],()=>{D(),ye(),A(!1)});function $(){n.value&&(a=new Oh({cursorBlink:!0,fontFamily:'Menlo, Monaco, Consolas, "Courier New", monospace',fontSize:12,lineHeight:1.25,scrollback:1e4,theme:{background:"#050505",foreground:"#e5e7eb",cursor:"#f4f4f5",selectionBackground:"#475569",black:"#18181b",red:"#f87171",green:"#86efac",yellow:"#fde68a",blue:"#93c5fd",magenta:"#d8b4fe",cyan:"#67e8f9",white:"#f4f4f5"}}),d=new Hh,a.loadAddon(d),a.open(n.value),a.onData(m=>{o.value&&vs(o.value,m).catch(b=>{h.value=b instanceof Error?b.message:p("Terminal input failed")})}),c=new ResizeObserver(()=>{tt()}),c.observe(n.value),tt())}async function A(m,b=""){if(_&&!m&&!b){await _;return}const y=L(m,b);_=y;try{await y}finally{_===y&&(_=null)}}async function L(m,b=""){if(!(!s.threadId||!s.cwd||!a)){h.value="",await gn(),K();try{const y=await vn({threadId:s.threadId,cwd:s.cwd,sessionId:m?void 0:b||o.value||void 0,cols:a.cols,rows:a.rows,newSession:m});R({id:y.id,shell:y.shell||"terminal",status:"attached"}),o.value=y.id,P(),E(y.buffer)}catch(y){h.value=y instanceof Error?y.message:p("Terminal attach failed")}}}function N(m){const b=Xe(m.params),y=Q(b==null?void 0:b.sessionId);if(!(!y||!a)){if(m.method==="terminal-attached"){v(y,{shell:Q(b==null?void 0:b.shell)||void 0,status:"attached"}),P();return}if(m.method==="terminal-init-log"){if(y!==o.value)return;a.clear(),a.write(Q(b==null?void 0:b.log)||"");return}if(m.method==="terminal-data"){if(y!==o.value)return;a.write(Q(b==null?void 0:b.data)||"");return}if(m.method==="terminal-exit"){if(v(y,{status:"exited"}),P(),y!==o.value)return;a.writeln(""),a.writeln("[terminal exited]");return}if(m.method==="terminal-error"){if(v(y,{status:"error"}),P(),y!==o.value)return;h.value=Q(b==null?void 0:b.message)||"Terminal error"}}}function H(){A(!0)}function ie(){window.setTimeout(()=>{var b;const m=document.activeElement;m instanceof Node&&((b=n.value)!=null&&b.contains(m))||r("terminalFocusChange",!1)},100)}function be(m){!m||m===o.value||A(!1,m)}function xe(){const m=o.value;if(!m){r("hide");return}const b=l.value.findIndex(X=>X.id===m),y=l.value.filter(X=>X.id!==m);l.value=y;const M=y[Math.max(0,Math.min(b,y.length-1))];if(m&&kn(m).catch(X=>{h.value=X instanceof Error?X.message:"Terminal close failed"}),M){o.value=M.id,P(),A(!1,M.id);return}o.value="",a==null||a.clear(),P(),r("hide")}function tt(){f||(f=window.requestAnimationFrame(()=>{f=0,K(),a&&o.value&&mn(o.value,a.cols,a.rows).catch(()=>{})}))}function K(){try{d==null||d.fit()}catch{}}function R(m){const b=l.value.findIndex(M=>M.id===m.id);if(b<0){l.value=[...l.value,m],P();return}const y=[...l.value];y.splice(b,1,{...y[b],...m}),l.value=y,P()}function v(m,b){const y=l.value.findIndex(X=>X.id===m);if(y<0)return;const M=[...l.value];M.splice(y,1,{...M[y],...b}),l.value=M,P()}function E(m){a&&(a.clear(),m&&a.write(m))}function k(m,b){const y=m.shell&&m.shell!=="terminal"?m.shell:"Terminal";return l.value.length>1?`${y} ${b+1}`:y}function D(){var b;const m=W()[C()];if(!m||m.tabs.length===0){l.value=[],o.value="";return}l.value=m.tabs,o.value=m.activeSessionId&&m.tabs.some(y=>y.id===m.activeSessionId)?m.activeSessionId:((b=m.tabs[0])==null?void 0:b.id)??""}function P(){if(typeof window>"u")return;const m=W(),b=C();l.value.length===0||!o.value?delete m[b]:m[b]={activeSessionId:o.value,tabs:l.value.map(y=>({...y}))},window.localStorage.setItem(fr,JSON.stringify(m))}function C(){return`${s.threadId}::${s.cwd}`}function W(){if(typeof window>"u")return{};try{const m=window.localStorage.getItem(fr);if(!m)return{};const b=JSON.parse(m);if(!b||typeof b!="object"||Array.isArray(b))return{};const y={};for(const[M,X]of Object.entries(b)){const z=Xe(X),ze=Q(z==null?void 0:z.activeSessionId),It=Array.isArray(z==null?void 0:z.tabs)?z.tabs:[],Fe=[];for(const ln of It){const $e=Xe(ln),gs=Q($e==null?void 0:$e.id);if(!gs)continue;const Nt=Q($e==null?void 0:$e.status),cn=Nt==="attached"||Nt==="exited"||Nt==="error"?Nt:"connecting";Fe.push({id:gs,shell:Q($e==null?void 0:$e.shell)||"terminal",status:cn})}Fe.length>0&&(y[M]={activeSessionId:ze,tabs:Fe})}return y}catch{return{}}}function J(m){return m.trim().replace(/\s+/g," ")}async function ye(){const m=s.cwd.trim();if(!m){B.value=[];return}try{B.value=await Sn(m)}catch{B.value=[]}}async function Pe(m,b=!1){const y=J(m);if(y){if(await me(),o.value||await A(!1),!o.value)throw new Error("Terminal is not connected");a==null||a.focus(),_e(y,b);try{await vs(o.value,`${y}\r`)}catch(M){throw h.value=M instanceof Error?M.message:"Quick command failed",M}}}async function me(){for(let m=0;m<20;m+=1){if(a)return;await new Promise(b=>window.setTimeout(b,25))}throw new Error("Terminal is not ready")}t({runQuickCommand:Pe});function _e(m,b){const y=J(m);if(!y)return;const M=w.value.find(Fe=>Fe.value===y),X=B.value.findIndex(Fe=>Fe.value===y),z=X>=0?B.value[X]:null,ze={label:(M==null?void 0:M.label)||(z==null?void 0:z.label)||y,value:y,custom:(M==null?void 0:M.custom)===!0||!z&&b,usageCount:((M==null?void 0:M.usageCount)??0)+1,lastUsedAt:Date.now(),sourceIndex:X>=0?X:void 0},It=[...w.value.filter(Fe=>Fe.value!==y),ze];w.value=It,Se(It)}function Ee(){if(typeof window>"u")return[];try{const m=window.localStorage.getItem(_r);if(!m)return[];const b=JSON.parse(m);if(!Array.isArray(b))return[];const y=new Set,M=[];for(const X of b){const z=Xe(X),ze=J(Q(z==null?void 0:z.value));ze&&(y.has(ze)||(y.add(ze),M.push({label:Q(z==null?void 0:z.label)||ze,value:ze,custom:(z==null?void 0:z.custom)!==!1,usageCount:Te(z==null?void 0:z.usageCount),lastUsedAt:Te(z==null?void 0:z.lastUsedAt)})))}return M}catch{return[]}}function Se(m){typeof window>"u"||window.localStorage.setItem(_r,JSON.stringify(m.map(b=>({label:b.label,value:b.value,custom:b.custom===!0,usageCount:b.usageCount,lastUsedAt:b.lastUsedAt}))))}function Te(m){if(typeof m=="number"&&Number.isFinite(m))return Math.max(0,Math.trunc(m));if(typeof m=="string"){const b=Number(m);if(Number.isFinite(b))return Math.max(0,Math.trunc(b))}return 0}function Xe(m){return m!==null&&typeof m=="object"&&!Array.isArray(m)?m:null}function Q(m){return typeof m=="string"?m:""}return(m,b)=>(Ht(),Wt("section",{class:ms(["thread-terminal-panel",{"is-error":!!h.value}])},[Ke("header",Wh,[Ke("div",zh,[(Ht(!0),Wt(wn,null,bn(l.value,(y,M)=>(Ht(),Wt("button",{key:y.id,class:ms(["thread-terminal-tab",{"is-active":y.id===o.value}]),type:"button",title:k(y,M),onClick:X=>be(y.id)},[Ke("span",{class:"thread-terminal-dot","data-status":y.status},null,8,$h),Ke("span",Kh,zt(k(y,M)),1)],10,Fh))),128))]),Ke("div",Uh,[Ke("button",{class:"thread-terminal-action",type:"button",title:"New",onClick:H}," New "),Ke("button",{class:"thread-terminal-action",type:"button",title:Ft(p)("Hide terminal"),onClick:b[0]||(b[0]=y=>m.$emit("hide"))},zt(Ft(p)("Hide")),9,qh),Ke("button",{class:"thread-terminal-action",type:"button",title:Ft(p)("Close"),onClick:xe},zt(Ft(p)("Close")),9,Vh)])]),h.value?(Ht(),Wt("p",Yh,zt(h.value),1)):yn("",!0),Ke("div",{ref_key:"terminalHostRef",ref:n,class:"thread-terminal-host",onPointerdown:b[1]||(b[1]=y=>r("terminalFocusChange",!0)),onFocusin:b[2]||(b[2]=y=>r("terminalFocusChange",!0)),onFocusout:ie},null,544)],2))}}),Zh=xn(Xh,[["__scopeId","data-v-
|
|
38
|
+
*/var Ih=2,Nh=1,Hh=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){var c;if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:((c=this._terminal.options.overviewRuler)==null?void 0:c.width)||14,i=window.getComputedStyle(this._terminal.element.parentElement),s=parseInt(i.getPropertyValue("height")),r=Math.max(0,parseInt(i.getPropertyValue("width"))),n=window.getComputedStyle(this._terminal.element),o={top:parseInt(n.getPropertyValue("padding-top")),bottom:parseInt(n.getPropertyValue("padding-bottom")),right:parseInt(n.getPropertyValue("padding-right")),left:parseInt(n.getPropertyValue("padding-left"))},h=o.top+o.bottom,l=o.right+o.left,a=s-h,d=r-l-t;return{cols:Math.max(Ih,Math.floor(d/e.css.cell.width)),rows:Math.max(Nh,Math.floor(a/e.css.cell.height))}}};const Wh={class:"thread-terminal-header"},zh={class:"thread-terminal-tabs"},Fh=["title","onClick"],$h=["data-status"],Kh={class:"thread-terminal-title"},Uh={class:"thread-terminal-actions"},qh=["title"],Vh=["title"],Yh={key:0,class:"thread-terminal-error"},_r="codex-web-local.terminal-quick-commands.v1",fr="codex-web-local.terminal-tabs.v1",Xh=dn({__name:"ThreadTerminalPanel",props:{threadId:{},cwd:{}},emits:["hide","terminalFocusChange"],setup(e,{expose:t,emit:i}){const s=e,r=i,n=ct(null),o=ct(""),h=ct(""),l=ct([]);let a=null,d=null,c=null,u=null,f=0,_=null;const{t:p}=Cn(),w=ct(Ee()),B=ct([]);un(()=>{D(),$(),u=_n(N),ye(),A(!1)}),fn(()=>{f&&(window.cancelAnimationFrame(f),f=0),c==null||c.disconnect(),c=null,u==null||u(),u=null,a==null||a.dispose(),a=null,d=null}),pn(()=>[s.threadId,s.cwd],()=>{D(),ye(),A(!1)});function $(){n.value&&(a=new Oh({cursorBlink:!0,fontFamily:'Menlo, Monaco, Consolas, "Courier New", monospace',fontSize:12,lineHeight:1.25,scrollback:1e4,theme:{background:"#050505",foreground:"#e5e7eb",cursor:"#f4f4f5",selectionBackground:"#475569",black:"#18181b",red:"#f87171",green:"#86efac",yellow:"#fde68a",blue:"#93c5fd",magenta:"#d8b4fe",cyan:"#67e8f9",white:"#f4f4f5"}}),d=new Hh,a.loadAddon(d),a.open(n.value),a.onData(m=>{o.value&&vs(o.value,m).catch(b=>{h.value=b instanceof Error?b.message:p("Terminal input failed")})}),c=new ResizeObserver(()=>{tt()}),c.observe(n.value),tt())}async function A(m,b=""){if(_&&!m&&!b){await _;return}const y=L(m,b);_=y;try{await y}finally{_===y&&(_=null)}}async function L(m,b=""){if(!(!s.threadId||!s.cwd||!a)){h.value="",await gn(),K();try{const y=await vn({threadId:s.threadId,cwd:s.cwd,sessionId:m?void 0:b||o.value||void 0,cols:a.cols,rows:a.rows,newSession:m});R({id:y.id,shell:y.shell||"terminal",status:"attached"}),o.value=y.id,P(),E(y.buffer)}catch(y){h.value=y instanceof Error?y.message:p("Terminal attach failed")}}}function N(m){const b=Xe(m.params),y=Q(b==null?void 0:b.sessionId);if(!(!y||!a)){if(m.method==="terminal-attached"){v(y,{shell:Q(b==null?void 0:b.shell)||void 0,status:"attached"}),P();return}if(m.method==="terminal-init-log"){if(y!==o.value)return;a.clear(),a.write(Q(b==null?void 0:b.log)||"");return}if(m.method==="terminal-data"){if(y!==o.value)return;a.write(Q(b==null?void 0:b.data)||"");return}if(m.method==="terminal-exit"){if(v(y,{status:"exited"}),P(),y!==o.value)return;a.writeln(""),a.writeln("[terminal exited]");return}if(m.method==="terminal-error"){if(v(y,{status:"error"}),P(),y!==o.value)return;h.value=Q(b==null?void 0:b.message)||"Terminal error"}}}function H(){A(!0)}function ie(){window.setTimeout(()=>{var b;const m=document.activeElement;m instanceof Node&&((b=n.value)!=null&&b.contains(m))||r("terminalFocusChange",!1)},100)}function be(m){!m||m===o.value||A(!1,m)}function xe(){const m=o.value;if(!m){r("hide");return}const b=l.value.findIndex(X=>X.id===m),y=l.value.filter(X=>X.id!==m);l.value=y;const M=y[Math.max(0,Math.min(b,y.length-1))];if(m&&kn(m).catch(X=>{h.value=X instanceof Error?X.message:"Terminal close failed"}),M){o.value=M.id,P(),A(!1,M.id);return}o.value="",a==null||a.clear(),P(),r("hide")}function tt(){f||(f=window.requestAnimationFrame(()=>{f=0,K(),a&&o.value&&mn(o.value,a.cols,a.rows).catch(()=>{})}))}function K(){try{d==null||d.fit()}catch{}}function R(m){const b=l.value.findIndex(M=>M.id===m.id);if(b<0){l.value=[...l.value,m],P();return}const y=[...l.value];y.splice(b,1,{...y[b],...m}),l.value=y,P()}function v(m,b){const y=l.value.findIndex(X=>X.id===m);if(y<0)return;const M=[...l.value];M.splice(y,1,{...M[y],...b}),l.value=M,P()}function E(m){a&&(a.clear(),m&&a.write(m))}function k(m,b){const y=m.shell&&m.shell!=="terminal"?m.shell:"Terminal";return l.value.length>1?`${y} ${b+1}`:y}function D(){var b;const m=W()[C()];if(!m||m.tabs.length===0){l.value=[],o.value="";return}l.value=m.tabs,o.value=m.activeSessionId&&m.tabs.some(y=>y.id===m.activeSessionId)?m.activeSessionId:((b=m.tabs[0])==null?void 0:b.id)??""}function P(){if(typeof window>"u")return;const m=W(),b=C();l.value.length===0||!o.value?delete m[b]:m[b]={activeSessionId:o.value,tabs:l.value.map(y=>({...y}))},window.localStorage.setItem(fr,JSON.stringify(m))}function C(){return`${s.threadId}::${s.cwd}`}function W(){if(typeof window>"u")return{};try{const m=window.localStorage.getItem(fr);if(!m)return{};const b=JSON.parse(m);if(!b||typeof b!="object"||Array.isArray(b))return{};const y={};for(const[M,X]of Object.entries(b)){const z=Xe(X),ze=Q(z==null?void 0:z.activeSessionId),It=Array.isArray(z==null?void 0:z.tabs)?z.tabs:[],Fe=[];for(const ln of It){const $e=Xe(ln),gs=Q($e==null?void 0:$e.id);if(!gs)continue;const Nt=Q($e==null?void 0:$e.status),cn=Nt==="attached"||Nt==="exited"||Nt==="error"?Nt:"connecting";Fe.push({id:gs,shell:Q($e==null?void 0:$e.shell)||"terminal",status:cn})}Fe.length>0&&(y[M]={activeSessionId:ze,tabs:Fe})}return y}catch{return{}}}function J(m){return m.trim().replace(/\s+/g," ")}async function ye(){const m=s.cwd.trim();if(!m){B.value=[];return}try{B.value=await Sn(m)}catch{B.value=[]}}async function Pe(m,b=!1){const y=J(m);if(y){if(await me(),o.value||await A(!1),!o.value)throw new Error("Terminal is not connected");a==null||a.focus(),_e(y,b);try{await vs(o.value,`${y}\r`)}catch(M){throw h.value=M instanceof Error?M.message:"Quick command failed",M}}}async function me(){for(let m=0;m<20;m+=1){if(a)return;await new Promise(b=>window.setTimeout(b,25))}throw new Error("Terminal is not ready")}t({runQuickCommand:Pe});function _e(m,b){const y=J(m);if(!y)return;const M=w.value.find(Fe=>Fe.value===y),X=B.value.findIndex(Fe=>Fe.value===y),z=X>=0?B.value[X]:null,ze={label:(M==null?void 0:M.label)||(z==null?void 0:z.label)||y,value:y,custom:(M==null?void 0:M.custom)===!0||!z&&b,usageCount:((M==null?void 0:M.usageCount)??0)+1,lastUsedAt:Date.now(),sourceIndex:X>=0?X:void 0},It=[...w.value.filter(Fe=>Fe.value!==y),ze];w.value=It,Se(It)}function Ee(){if(typeof window>"u")return[];try{const m=window.localStorage.getItem(_r);if(!m)return[];const b=JSON.parse(m);if(!Array.isArray(b))return[];const y=new Set,M=[];for(const X of b){const z=Xe(X),ze=J(Q(z==null?void 0:z.value));ze&&(y.has(ze)||(y.add(ze),M.push({label:Q(z==null?void 0:z.label)||ze,value:ze,custom:(z==null?void 0:z.custom)!==!1,usageCount:Te(z==null?void 0:z.usageCount),lastUsedAt:Te(z==null?void 0:z.lastUsedAt)})))}return M}catch{return[]}}function Se(m){typeof window>"u"||window.localStorage.setItem(_r,JSON.stringify(m.map(b=>({label:b.label,value:b.value,custom:b.custom===!0,usageCount:b.usageCount,lastUsedAt:b.lastUsedAt}))))}function Te(m){if(typeof m=="number"&&Number.isFinite(m))return Math.max(0,Math.trunc(m));if(typeof m=="string"){const b=Number(m);if(Number.isFinite(b))return Math.max(0,Math.trunc(b))}return 0}function Xe(m){return m!==null&&typeof m=="object"&&!Array.isArray(m)?m:null}function Q(m){return typeof m=="string"?m:""}return(m,b)=>(Ht(),Wt("section",{class:ms(["thread-terminal-panel",{"is-error":!!h.value}])},[Ke("header",Wh,[Ke("div",zh,[(Ht(!0),Wt(wn,null,bn(l.value,(y,M)=>(Ht(),Wt("button",{key:y.id,class:ms(["thread-terminal-tab",{"is-active":y.id===o.value}]),type:"button",title:k(y,M),onClick:X=>be(y.id)},[Ke("span",{class:"thread-terminal-dot","data-status":y.status},null,8,$h),Ke("span",Kh,zt(k(y,M)),1)],10,Fh))),128))]),Ke("div",Uh,[Ke("button",{class:"thread-terminal-action",type:"button",title:"New",onClick:H}," New "),Ke("button",{class:"thread-terminal-action",type:"button",title:Ft(p)("Hide terminal"),onClick:b[0]||(b[0]=y=>m.$emit("hide"))},zt(Ft(p)("Hide")),9,qh),Ke("button",{class:"thread-terminal-action",type:"button",title:Ft(p)("Close"),onClick:xe},zt(Ft(p)("Close")),9,Vh)])]),h.value?(Ht(),Wt("p",Yh,zt(h.value),1)):yn("",!0),Ke("div",{ref_key:"terminalHostRef",ref:n,class:"thread-terminal-host",onPointerdown:b[1]||(b[1]=y=>r("terminalFocusChange",!0)),onFocusin:b[2]||(b[2]=y=>r("terminalFocusChange",!0)),onFocusout:ie},null,544)],2))}}),Zh=xn(Xh,[["__scopeId","data-v-175dedb7"]]);export{Zh as default};
|