@adhdev/daemon-standalone 1.0.27 → 1.0.28-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/public/assets/{index-Bfkec2FE.js → index-CX3wQvni.js} +3 -3
- package/public/assets/{terminal-BZj_X5zy.js → terminal-DiXj2eIR.js} +1 -1
- package/public/assets/{vendor-cL4V2vaO.js → vendor-DyCWA2YZ.js} +57 -49
- package/public/index.html +2 -2
- package/vendor/mcp-server/index.js +0 -0
- package/vendor/session-host-daemon/index.js +0 -0
- package/vendor/session-host-daemon/index.mjs +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adhdev/daemon-standalone",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.28-rc.1",
|
|
4
4
|
"description": "ADHDev standalone daemon — embedded HTTP/WS server for local dashboard",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"license": "AGPL-3.0-or-later",
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@adhdev/ghostty-vt-node": "*",
|
|
40
|
-
"@adhdev/session-host-core": "
|
|
40
|
+
"@adhdev/session-host-core": "1.0.28-rc.1",
|
|
41
41
|
"@xterm/addon-serialize": "^0.14.0",
|
|
42
42
|
"@xterm/xterm": "^6.0.0",
|
|
43
43
|
"chalk": "^5.3.0",
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/terminal-
|
|
2
|
-
var Rh=Object.defineProperty;var Eh=(e,t,n)=>t in e?Rh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var st=(e,t,n)=>Eh(e,typeof t!="symbol"?t+"":t,n);import{r as l,j as s,u as Ce,M as Ei,a as _h,b as $h,c as Hh,t as Fh,d as Bh,i as kt,e as Oh,f as an,R as Lt,T as Xo,g as Cr,h as Zo,k as ei,D as Wh,E as Uh,l as Gh,C as qh,m as zh,B as Kh,n as Vh,o as Yh,p as Jh,H as Lr,P as Rs,q as Qh,s as Xh,v as Zh,w as $l,x as ef,y as tf,z as _i,A as sf,F as nf,G as rf,I as af,J as Es,N as ti,K as of}from"./vendor-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/terminal-DiXj2eIR.js","assets/vendor-DyCWA2YZ.js","assets/terminal-6GBZ9nXN.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
var Rh=Object.defineProperty;var Eh=(e,t,n)=>t in e?Rh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var st=(e,t,n)=>Eh(e,typeof t!="symbol"?t+"":t,n);import{r as l,j as s,u as Ce,M as Ei,a as _h,b as $h,c as Hh,t as Fh,d as Bh,i as kt,e as Oh,f as an,R as Lt,T as Xo,g as Cr,h as Zo,k as ei,D as Wh,E as Uh,l as Gh,C as qh,m as zh,B as Kh,n as Vh,o as Yh,p as Jh,H as Lr,P as Rs,q as Qh,s as Xh,v as Zh,w as $l,x as ef,y as tf,z as _i,A as sf,F as nf,G as rf,I as af,J as Es,N as ti,K as of}from"./vendor-DyCWA2YZ.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const o of a)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(a){const o={};return a.integrity&&(o.integrity=a.integrity),a.referrerPolicy&&(o.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?o.credentials="include":a.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(a){if(a.ep)return;a.ep=!0;const o=n(a);fetch(a.href,o)}})();function lf(e={}){const t=Math.max(1,Math.floor(e.capacity||200)),n=[];return{record(r){const a={id:`webdbg_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,8)}`,ts:Date.now(),...r,payload:r.payload?{...r.payload}:{}};return n.push(a),n.length>t&&n.splice(0,n.length-t),a},list(r={}){const a=Math.max(1,Math.floor(r.limit||100));return n.filter(o=>!r.interactionId||o.interactionId===r.interactionId).filter(o=>!r.topic||o.topic===r.topic).filter(o=>!r.kind||o.kind===r.kind).slice(-a).map(o=>({...o,payload:o.payload?{...o.payload}:{}}))},clear(){n.splice(0,n.length)}}}const Tn=lf();function Hl(e){const t={};for(const n of e)n.transport&&(t[n.transport]=(t[n.transport]||0)+1);return{count:e.length,ids:e.map(n=>n.id),statuses:e.map(n=>String(n.status||"unknown")),transports:t}}function cf(e,t){return typeof e=="string"&&e.trim().length>0&&e!==t}function Fl(e){return Array.isArray(e)?[...e]:[]}function Xd(e,t){if(!e)return t??null;const n=Object.prototype.hasOwnProperty.call(e,"messages"),r=Object.prototype.hasOwnProperty.call(e,"activeModal"),a=typeof e.id=="string"?e.id.trim():"",o=typeof(t==null?void 0:t.id)=="string"?t.id.trim():"",i=!!a&&!!o&&a!==o;return t?{...t,...e,messages:n?Fl(e.messages):i?[]:t.messages,activeModal:r?e.activeModal??null:t.activeModal,inputContent:e.inputContent??t.inputContent}:{...e,...n?{messages:Fl(e.messages)}:{},...r?{activeModal:e.activeModal??null}:{}}}function nr(e,t){const n=cf(e.providerName,e.providerType)?e.providerName:void 0;return{...e,parentId:e.parentId??(t==null?void 0:t.parentSessionId)??null,providerSessionId:e.providerSessionId??(t==null?void 0:t.providerSessionId),providerName:n??(t==null?void 0:t.providerName)??(t==null?void 0:t.cliName)??(t==null?void 0:t.type)??e.providerName??e.providerType,title:e.title??(t==null?void 0:t.title)??n??(t==null?void 0:t.providerName)??e.providerName??e.providerType,workspace:e.workspace??(t==null?void 0:t.workspace)??null,mode:e.mode??(t==null?void 0:t.mode),capabilities:e.capabilities??(t==null?void 0:t.sessionCapabilities)??(t==null?void 0:t.capabilities)??[],cdpConnected:e.cdpConnected??(t==null?void 0:t.cdpConnected),activeChat:Xd(e.activeChat,t==null?void 0:t.activeChat),activeInteractivePrompt:Object.prototype.hasOwnProperty.call(e,"activeInteractivePrompt")?e.activeInteractivePrompt??null:(t==null?void 0:t.activeInteractivePrompt)??null,controlValues:e.controlValues??(t==null?void 0:t.controlValues),providerControls:e.providerControls??(t==null?void 0:t.providerControls),summaryMetadata:e.summaryMetadata??(t==null?void 0:t.summaryMetadata),runtimeWriteOwner:e.runtimeWriteOwner??(t==null?void 0:t.runtimeWriteOwner),runtimeAttachedClients:e.runtimeAttachedClients??(t==null?void 0:t.runtimeAttachedClients),lastMessagePreview:e.lastMessagePreview??(t==null?void 0:t.lastMessagePreview),lastMessageRole:e.lastMessageRole??(t==null?void 0:t.lastMessageRole),lastMessageAt:e.lastMessageAt??(t==null?void 0:t.lastMessageAt),lastMessageHash:e.lastMessageHash??(t==null?void 0:t.lastMessageHash),unread:e.unread??(t==null?void 0:t.unread),lastSeenAt:e.lastSeenAt??(t==null?void 0:t.lastSeenAt),inboxBucket:e.inboxBucket??(t==null?void 0:t.inboxBucket),completionMarker:e.completionMarker??(t==null?void 0:t.completionMarker),seenCompletionMarker:e.seenCompletionMarker??(t==null?void 0:t.seenCompletionMarker),surfaceHidden:e.surfaceHidden??(t==null?void 0:t.surfaceHidden),muted:e.muted??(t==null?void 0:t.muted),resume:e.resume??(t==null?void 0:t.resume),runtimeKey:e.runtimeKey??(t==null?void 0:t.runtimeKey),runtimeDisplayName:e.runtimeDisplayName??(t==null?void 0:t.runtimeDisplayName),runtimeWorkspaceLabel:e.runtimeWorkspaceLabel??(t==null?void 0:t.runtimeWorkspaceLabel),settings:e.settings??(t==null?void 0:t.settings)}}function Zd(e,t,n){if(!(t!=null&&t.length))return(n==null?void 0:n.preserveMissing)===!1&&Array.isArray(t)?t:e;if(!(e!=null&&e.length))return t;const r=t.map(a=>{const o=e.find(i=>i.id===a.id);return o?nr(a,o):a});if((n==null?void 0:n.preserveMissing)!==!1){const a=new Set(t.map(o=>o.id));for(const o of e)a.has(o.id)||r.push(o)}return r}function Bl(e){return!!e&&typeof e=="object"&&"text"in e}function $i(e,t){const n=(t==null?void 0:t.joiner)??" ",r=(t==null?void 0:t.normalizeWhitespace)??!1;let a="";return typeof e=="string"?a=e:Array.isArray(e)?a=e.map(o=>typeof o=="string"?o:Bl(o)?String(o.text||""):"").join(n):Bl(e)?a=String(e.text||""):a=String(e||""),r?a.replace(/\s+/g," ").trim():a}function Mn(e){return $i(e,{normalizeWhitespace:!0})}function df(e){let t="";for(let n=0;n<e.length;n++){const r=e[n],a=e.charCodeAt(n);if(!(a<=31&&r!==`
|
|
3
3
|
`&&r!==" ")&&!(a>=127&&a<=159)&&!(a>=8203&&a<=8207||a>=8234&&a<=8238||a===8288||a===65279)&&a!==65533){if(a===65038||a===65039){const o=t.length>0?t[t.length-1]:"";if(!o||o===`
|
|
4
4
|
`||o===" "||o===" ")continue}t+=r}}return t}function Ol(e){var n,r;let t=0;return e.activeChat!==void 0&&(t+=4),e.activeInteractivePrompt!==void 0&&(t+=2),(n=e.childSessions)!=null&&n.length&&(t+=2),e.workspace&&(t+=1),e.machine&&(t+=1),(r=e.agents)!=null&&r.length&&(t+=1),t}function eu(e,t,n){if(n.type!=="adhdev-daemon")return n;const r={...n},a=t.version??n.version??e.version,o=t.serverVersion??e.serverVersion??n.serverVersion,i=t.versionMismatch===!0||e.versionMismatch===!0,c=t.versionUpdateRequired===!0||e.versionUpdateRequired===!0,d=t.versionUpdateReason??e.versionUpdateReason??n.versionUpdateReason;return a&&(r.version=a),o&&(r.serverVersion=o),d&&(r.versionUpdateReason=d),a&&o&&a===o?(delete r.versionMismatch,delete r.serverVersion,delete r.versionUpdateRequired,delete r.versionUpdateReason,r):((t.versionMismatch===!0||i&&a&&o&&a!==o)&&(r.versionMismatch=!0),c&&(r.versionUpdateRequired=!0),r)}function uf(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619)>>>0;return t.toString(16).padStart(8,"0")}function to(e){if(!e||typeof e!="object")return"";const t=e,n=uf(Mn(t.content).slice(0,512));return[String(t.id||""),String(t._localId||""),String(t._turnKey||""),String(t.index??""),String(t.role||""),String(t.receivedAt??t.timestamp??""),n].join(":")}function pf(e,t){if(!Array.isArray(e))return e;if(t!=null&&t.has(e))return{count:e.length,sharedRef:!0};let n=2166136261;for(const r of e){const a=to(r);for(let o=0;o<a.length;o+=1)n^=a.charCodeAt(o),n=Math.imul(n,16777619)>>>0}return{count:e.length,hash:n.toString(16).padStart(8,"0"),first:to(e[0]),last:to(e[e.length-1])}}function si(e){return!!e&&typeof e=="object"&&"messages"in e&&("activeModal"in e||"inputContent"in e||"status"in e)}function ni(e,t,n){if(!e||!t||typeof e!="object"||typeof t!="object")return;if(si(e)&&si(t)){const i=e.messages;Array.isArray(i)&&i===t.messages&&n.add(i)}if(Array.isArray(e)&&Array.isArray(t)){const i=Math.min(e.length,t.length);for(let c=0;c<i;c+=1)ni(e[c],t[c],n);return}const r=e,a=t,o=new Set([...Object.keys(r),...Object.keys(a)]);for(const i of o)i!=="messages"&&ni(r[i],a[i],n)}function or(e,t){return Array.isArray(e)?e.map(n=>or(n,t)):!e||typeof e!="object"?e:si(e)?Object.fromEntries(Object.entries(e).filter(([r])=>r!=="timestamp"&&r!=="_lastUpdate").sort(([r],[a])=>r.localeCompare(a)).map(([r,a])=>[r,r==="messages"?pf(a,t):or(a,t)])):Object.fromEntries(Object.entries(e).filter(([n])=>n!=="timestamp"&&n!=="_lastUpdate").sort(([n],[r])=>n.localeCompare(r)).map(([n,r])=>[n,or(r,t)]))}function mf(e,t){try{const n=new WeakSet;return ni(e,t,n),JSON.stringify(or(e,n))===JSON.stringify(or(t,n))}catch{return!1}}function ri(e,t,n){return mf(e,t)?(e._lastUpdate=n,typeof t.timestamp=="number"&&(e.timestamp=t.timestamp),e):t}function tu(e){var t;return e.daemonId||((t=e.id)==null?void 0:t.split(":")[0])||e.id}function hf(e,t,n){t[n]!==void 0&&(e[n]=t[n])}function Wl(e,t,n,r){var d;const a=(d=t.chats)!=null&&d.length?t.chats:e.chats,o=Zd(e.childSessions,t.childSessions,{preserveMissing:r}),i=Xd(t.activeChat,e.activeChat),c=t.workspace||e.workspace;return eu(e,t,{...e,...t,chats:a,childSessions:o,activeChat:i,workspace:c,_lastUpdate:n})}function ff(e,t,n){var a,o;const r={};t.status&&t.status!==e.status&&(r.status=t.status),t.cdpConnected!==void 0&&(r.cdpConnected=t.cdpConnected),t.childSessions!==void 0&&(r.childSessions=Zd(e.childSessions,t.childSessions,{preserveMissing:n})),(a=t.chats)!=null&&a.length&&!((o=e.chats)!=null&&o.length)&&(r.chats=t.chats),t.workspace&&(r.workspace=t.workspace);for(const i of["title","providerSessionId","parentSessionId","sessionKind","sessionCapabilities","controlValues","providerControls","summaryMetadata","activeInteractivePrompt","lastMessagePreview","lastMessageRole","lastMessageAt","lastMessageHash","lastUpdated","unread","lastSeenAt","inboxBucket","completionMarker","seenCompletionMarker","surfaceHidden","muted","runtimeKey","runtimeDisplayName","runtimeWorkspaceLabel","runtimeWriteOwner","runtimeAttachedClients","version","serverVersion","versionUpdateReason","versionUpdateRequired","updateCommand","updatePolicy","updateChannel","releaseChannel"])hf(r,t,i);return t.machineNickname!==void 0&&t.machineNickname!==e.machineNickname&&(r.machineNickname=t.machineNickname),t.versionMismatch===!0&&(r.versionMismatch=!0),r}function bf(e,t,n,r){const a=ff(e,t,r),o=Object.keys(a).length>0?eu(e,t,{...e,...a,_lastUpdate:n}):{...e,_lastUpdate:n};return ri(e,o,n)}function gf(e){const t=new Set(e.map(o=>o.id)),n=new Set,r=new Set,a=new Set;for(const o of e){const i=tu(o);i&&n.add(i),i&&o.type!=="adhdev-daemon"&&r.add(i),i&&o.type==="adhdev-daemon"&&o._sessionListAuthoritative&&a.add(i)}return{incomingIds:t,incomingDaemonIds:n,daemonIdsWithSessionEntries:r,daemonIdsWithAuthoritativeSessionList:a}}function xf(e,t,n,r,a,o){return!a.has(t)||!o.has(t)||r.has(e.id)?!1:e.transport==="pty"||e.transport==="acp"?n>1e4:e.transport==="cdp-page"?n>3e4:!1}function vf(e,t,n,r,a){return e.transport?n.has(t)&&!r.has(t)?!0:a.has(t):!1}function yf(e,t,n){var u,m;const r=Date.now(),a=new Set((n==null?void 0:n.authoritativeDaemonIds)||[]);if(t.length===0)return e.map(f=>({...f,_lastUpdate:r}));const o=new Map;for(const f of t)o.set(f.id,f);const{incomingIds:i,incomingDaemonIds:c,daemonIdsWithSessionEntries:d,daemonIdsWithAuthoritativeSessionList:p}=gf(e);for(const f of e){const g=o.get(f.id);if(!g){o.set(f.id,{...f,_lastUpdate:r});continue}const k=Ol(f),h=Ol(g),v=tu(f),w=!a.has(v);if(k>h){const C=Wl(g,f,r,w);o.set(f.id,ri(g,C,r));continue}if(k<h){o.set(f.id,bf(g,f,r,w));continue}const b=f.timestamp||r,j=g._lastUpdate||g.timestamp||0;if(b>=j){const C=Wl(g,f,r,w);o.set(f.id,ri(g,C,r));continue}(u=f.chats)!=null&&u.length&&!((m=g.chats)!=null&&m.length)&&o.set(f.id,{...g,chats:f.chats})}for(const[f,g]of o){const k=g.daemonId||f.split(":")[0];if(!c.has(k))continue;if(a.has(k)&&p.has(k)&&!i.has(f)){o.delete(f);continue}const h=r-(g._lastUpdate||g.timestamp||0);xf(g,k,h,i,a,d)&&o.delete(f)}for(const[f,g]of o){const k=g.daemonId||f.split(":")[0];if(vf(g,k,c,d,o))continue;r-(g._lastUpdate||g.timestamp||0)>3e5&&g.status!=="online"&&o.delete(f)}return Array.from(o.values())}function wf(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}const su=l.createContext({ides:[],updateRouteChats:()=>{},initialLoaded:!1,toasts:[],setToasts:()=>{},wsStatus:"connected",isConnected:!0,connectionStates:{},connectionTransports:{},showReconnected:!1,userName:void 0,setUserName:()=>{},isP2PActive:!1,p2pStates:{},userRole:void 0,connectionRetryStatuses:void 0}),nu=l.createContext({injectEntries:()=>{},markLoaded:()=>{},getIdes:()=>[]});function kf({children:e,connectionOverrides:t}){const[n,r]=l.useState([]),[a,o]=l.useState(!1),[i,c]=l.useState([]),[d,p]=l.useState(void 0),u=l.useRef(n);l.useEffect(()=>{u.current=n},[n]);const m=l.useCallback((w,b)=>{r(j=>{let C=!1;const y=j.map(x=>x.id!==w||x.chats===b?x:(C=!0,{...x,chats:b}));return C?y:j})},[]),f=l.useCallback((w,b)=>{r(j=>{const C=j.length===0?w:yf(w,j,b),y=!wf(j,C);return y&&Tn.record({kind:"dashboard.entries_applied",payload:{incoming:Hl(w),next:Hl(C)}}),y?C:j})},[]),g=l.useCallback(()=>o(!0),[]),k=l.useMemo(()=>({injectEntries:f,markLoaded:g,getIdes:()=>u.current}),[f,g]),h=t,v=l.useMemo(()=>({ides:n,updateRouteChats:m,initialLoaded:a,toasts:i,setToasts:c,wsStatus:(h==null?void 0:h.wsStatus)??"connected",isConnected:(h==null?void 0:h.isConnected)??!0,connectionStates:(h==null?void 0:h.connectionStates)??{},connectionTransports:(h==null?void 0:h.connectionTransports)??{},showReconnected:(h==null?void 0:h.showReconnected)??!1,retryConnection:h==null?void 0:h.retryConnection,retryServerConnection:h==null?void 0:h.retryServerConnection,connectionLoginUrl:h==null?void 0:h.connectionLoginUrl,isP2PActive:(h==null?void 0:h.isP2PActive)??!1,p2pStates:(h==null?void 0:h.p2pStates)??{},userRole:h==null?void 0:h.userRole,connectionRetryStatuses:h==null?void 0:h.connectionRetryStatuses,userName:d,setUserName:p}),[n,m,a,i,h==null?void 0:h.wsStatus,h==null?void 0:h.isConnected,h==null?void 0:h.connectionStates,h==null?void 0:h.connectionTransports,h==null?void 0:h.showReconnected,h==null?void 0:h.retryConnection,h==null?void 0:h.retryServerConnection,h==null?void 0:h.connectionLoginUrl,h==null?void 0:h.isP2PActive,h==null?void 0:h.p2pStates,h==null?void 0:h.userRole,h==null?void 0:h.connectionRetryStatuses,d]);return s.jsx(nu.Provider,{value:k,children:s.jsx(su.Provider,{value:v,children:e})})}function js(){return l.useContext(su)}function fr(){return l.useContext(nu)}function ru(e){const{baseUrl:t,getToken:n,onUnauthorized:r}=e;function a(c){return c.startsWith("http")?c:`${t}${c.startsWith("/")?"":"/"}${c}`}function o(c){const d=n==null?void 0:n(),p=a(c),u=c.startsWith("http")?new URL(p):new URL(p,typeof window<"u"?window.location.origin:"http://localhost");return d&&u.searchParams.set("token",d),!c.startsWith("http")&&!t?`${u.pathname}${u.search}${u.hash}`:u.toString()}async function i(c,d={}){const p={"Content-Type":"application/json",...d.headers||{}},u=n==null?void 0:n();u&&(p.Authorization=`Bearer ${u}`);const m=a(c),f=new AbortController,g=setTimeout(()=>f.abort(),15e3);try{const k=await fetch(m,{...d,headers:p,signal:f.signal});if(k.status===401)throw r==null||r(),new Error("Unauthorized");if(!k.ok){const h=await k.json().catch(()=>({error:k.statusText}));throw new Error(h.error||`API Error: ${k.status}`)}return k.json()}finally{clearTimeout(g)}}return{getDaemons:()=>i("/api/v1/daemons"),getDaemonStatus:c=>i(`/api/v1/daemons/${c}/status`),sendCommand:(c,d,p={})=>i(`/api/v1/daemons/${c}/command`,{method:"POST",body:JSON.stringify({type:d,payload:p})}),execTerminal:(c,d,p)=>i(`/api/v1/daemons/${c}/terminal`,{method:"POST",body:JSON.stringify({command:d,name:p})}),sendAgentMessage:(c,d,p)=>i(`/api/v1/shortcuts/${c}/chat`,{method:"POST",body:JSON.stringify({agentType:d,message:p})}),getAgentStatus:c=>i(`/api/v1/shortcuts/${c}/status`),approveAgent:(c,d,p)=>i(`/api/v1/shortcuts/${c}/approve`,{method:"POST",body:JSON.stringify({agentType:d,action:p?"approve":"reject"})}),getMuxState:c=>i(`/api/v1/mux/${encodeURIComponent(c)}/state`),getMuxSocketInfo:c=>i(`/api/v1/mux/${encodeURIComponent(c)}/socket-info`),controlMux:(c,d,p={})=>i(`/api/v1/mux/${encodeURIComponent(c)}/control`,{method:"POST",body:JSON.stringify({type:d,payload:p})}),getMuxEventsUrl:c=>o(`/api/v1/mux/${encodeURIComponent(c)}/events`),getRuntimeEventsUrl:c=>o(`/api/v1/runtime/${encodeURIComponent(c)}/events`),request:i}}const Sf=ru({baseUrl:"http://localhost:3847"}),Cf=l.createContext(Sf);function jf({client:e,children:t}){return s.jsx(Cf.Provider,{value:e,children:t})}const Nf={sendCommand:async()=>{throw new Error("TransportContext not initialized")}},au=l.createContext(Nf);function Af({value:e,children:t}){return s.jsx(au.Provider,{value:e,children:t})}function wt(){return l.useContext(au)}function ou(e){return e&&typeof e=="object"&&e.result&&typeof e.result=="object"?e.result:e}function Tf(e){const t=ou(e);if(!t||t.error!=="untrusted_external_provider")return null;const n=t.provider&&typeof t.provider=="object"?t.provider:null;return{providerType:typeof(n==null?void 0:n.type)=="string"?n.type:null,sourceName:typeof(n==null?void 0:n.sourceName)=="string"?n.sourceName:null,description:typeof t.hint=="string"?t.hint:void 0}}function Mf(e){const[t,n]=l.useState(null),r=l.useCallback(async(i,c)=>{const d=m=>e(i,"launch_cli",{...c,...m}),p=await d({}),u=Tf(p);return u?new Promise(m=>{n({providerType:u.providerType||String(c.cliType??"?"),sourceName:u.sourceName,description:u.description,retry:()=>d({confirmExternalUntrusted:!0}),resolve:f=>{f.cancelled?m({success:!1,error:"user_cancelled_untrusted_launch"}):m(f.response)}})}):p},[e]),a=l.useCallback(async()=>{const i=t;if(i){n(null);try{const c=await i.retry(),d=ou(c);d!=null&&d.success?i.resolve({ok:!0,response:c}):i.resolve({ok:!1,error:(d==null?void 0:d.error)||"launch failed after confirm",response:c})}catch(c){i.resolve({ok:!1,error:(c==null?void 0:c.message)||String(c)})}}},[t]),o=l.useCallback(()=>{const i=t;i&&(n(null),i.resolve({ok:!1,cancelled:!0}))},[t]);return{launchCli:r,pending:t,confirm:a,cancel:o}}function Pf({providerType:e,sourceName:t,description:n,onConfirm:r,onCancel:a}){const{t:o}=Ce("common"),i=l.useRef(null);return l.useEffect(()=>{var c;(c=i.current)==null||c.focus()},[]),l.useEffect(()=>{const c=d=>{d.key==="Escape"&&a()};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[a]),s.jsx("div",{role:"dialog","aria-modal":"true","aria-label":o("machine.confirmExternal.dialogAria"),className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",onClick:a,style:{pointerEvents:"auto"},children:s.jsxs("div",{className:"bg-[var(--surface-primary)] text-text-primary border border-amber-500/40 rounded-lg shadow-xl max-w-lg w-full",onClick:c=>c.stopPropagation(),children:[s.jsxs("div",{className:"px-4 py-3 border-b border-border-subtle flex items-center gap-2",children:[s.jsx("span",{"aria-hidden":!0,className:"text-amber-400 text-base",children:"⚠"}),s.jsx("h2",{className:"text-sm font-semibold",children:o("machine.confirmExternal.title")})]}),s.jsxs("div",{className:"px-4 py-3 text-[12px] flex flex-col gap-3",children:[s.jsxs("p",{children:["You're about to activate ",s.jsx("span",{className:"font-mono",children:e}),t?s.jsxs(s.Fragment,{children:[" from ",s.jsx("span",{className:"font-mono",children:t})]}):null,"."]}),s.jsx("p",{className:"text-text-secondary",children:n??o("machine.confirmExternal.description")}),s.jsx("p",{className:"text-text-secondary",children:o("machine.confirmExternal.proceedWarning")})]}),s.jsxs("div",{className:"px-4 py-2 border-t border-border-subtle flex justify-end gap-2",children:[s.jsx("button",{ref:i,type:"button",onClick:a,className:"px-3 py-1 text-sm rounded border border-border-default hover:bg-surface-secondary",children:o("machine.confirmExternal.cancel")}),s.jsx("button",{type:"button",onClick:r,className:"px-3 py-1 text-sm rounded bg-amber-500 text-black font-semibold hover:opacity-90",children:o("machine.confirmExternal.activate")})]})]})})}const iu=l.createContext(null);function Df({sendDaemonCommand:e,children:t}){const n=Mf(e),r=l.useMemo(()=>({launchCli:n.launchCli}),[n.launchCli]);return s.jsxs(iu.Provider,{value:r,children:[t,n.pending&&s.jsx(Pf,{providerType:n.pending.providerType,sourceName:n.pending.sourceName,description:n.pending.description,onConfirm:n.confirm,onCancel:n.cancel})]})}function Ra(){const e=l.useContext(iu);return e||{launchCli:async()=>{throw new Error("useLaunchCli must be used inside <LaunchCliProvider>")}}}function lu(e){return e?new Date(e).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}):""}function If(e,t,n){return Number(e.receivedAt||n[ha(e)]||0)||0}function cu(e){return/[`*_#[\]()>-]|https?:\/\/|\n\s*[-*]\s|\n\s*\d+\.\s|\|/.test(e)}function Lf(e){return Array.isArray(e)&&e.some(t=>!!t&&typeof t=="object"&&"type"in t)}function Un(e,t){if(!e)return t;try{return(e.startsWith("file://")?new URL(e).pathname:e).split(/[\\/]/).filter(Boolean).pop()||t}catch{return e.split(/[\\/]/).filter(Boolean).pop()||t}}function so(e){if(typeof e.uri=="string"&&e.uri)return e.uri;if(typeof e.data=="string"&&e.data&&typeof e.mimeType=="string"&&e.mimeType)return`data:${e.mimeType};base64,${e.data}`}function Rf(e){let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t^e.charCodeAt(n),t|=0;return(t>>>0).toString(36)}function ha(e,t){const n=e,r=$i(e.content,{joiner:`
|
|
5
5
|
`}),a=[e.id?`id:${e.id}`:"",n._localId?`local:${n._localId}`:"",n._turnKey?`turn:${n._turnKey}`:"",e.bubbleId?`bubble:${e.bubbleId}`:"",e.providerUnitKey?`unit:${e.providerUnitKey}`:"",typeof e.index=="number"?`msgIndex:${e.index}`:"",typeof e.sequence=="number"?`seq:${e.sequence}`:""].filter(Boolean);if(a.length>0)return a.join("|");const o=e.receivedAt||e.timestamp||0;return[e.role?`role:${e.role}`:"role:",`chash:${Rf(r)}`,o?`ts:${o}`:""].filter(Boolean).join("|")}function Ef(e){let t=2166136261;for(const n of e){const r=String(n||"");for(let a=0;a<r.length;a+=1)t^=r.charCodeAt(a),t=Math.imul(t,16777619)>>>0;t^=255,t=Math.imul(t,16777619)>>>0}return t.toString(16).padStart(8,"0")}function _f(e){try{return JSON.stringify(e??"")}catch{return String(e??"")}}function du(e){return e?Ef([String(e.id||""),String(e.index??""),String(e.role||""),String(e.receivedAt??e.timestamp??""),_f(e.content)]):""}const Hi=200,$f=80,Ul=650,Gn=new Map;function fa(e,t){if(!e)return!1;const n=String(e.messageFingerprint||"");return n?n===String(t||""):!0}function Hf(e,t){if(!Array.isArray(e)||e.length===0)return"0:empty";const n=String(t||"").trim();if(n)return`${e.length}:${n}`;const r=e[e.length-1];return`${e.length}:${du(r)}`}function Ff(e,t,n,r){return e||!t?!1:fa(n,r)}function Bf({scrollTop:e,scrollHeight:t,clientHeight:n,topThresholdPx:r=$f,bottomThresholdPx:a=Hi}){const o=Math.max(0,Number(e)||0),i=Math.max(0,Number(t)||0),c=Math.max(0,Number(n)||0);return Math.max(0,i-c)<=0?{showTop:!1,showBottom:!1}:{showTop:o>r,showBottom:Math.max(0,i-o-c)>a}}function Of(e){return Bf({scrollTop:e.scrollTop,scrollHeight:e.scrollHeight,clientHeight:e.clientHeight})}function rr(e,t=Hi){return!!e&&e.fromBottom>=t}function Wf(e,t){return fa(e,t)?!rr(e):!0}function Uf({hasSelection:e,userScrolledUp:t,hasChatContentChanged:n=!0}){return!(e||t||!n)}function Gf({hasSelection:e,userScrolledUp:t,contextAutoScrollActive:n}){return e?!1:n||!t}function no(e,t){const n=Math.max(0,e.scrollHeight-e.clientHeight-t.fromBottom);e.scrollTop=Number.isFinite(n)?n:t.top}const Je={size:18};function uu({size:e=Je.size,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[s.jsx("rect",{x:"3",y:"3",width:"7",height:"7",rx:"1"}),s.jsx("rect",{x:"14",y:"3",width:"7",height:"7",rx:"1"}),s.jsx("rect",{x:"3",y:"14",width:"7",height:"7",rx:"1"}),s.jsx("rect",{x:"14",y:"14",width:"7",height:"7",rx:"1"})]})}function Fi({size:e=Je.size,className:t}){return s.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:s.jsx("polyline",{points:"15 18 9 12 15 6"})})}function Fs({size:e=Je.size,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[s.jsx("rect",{x:"2",y:"2",width:"20",height:"8",rx:"2"}),s.jsx("rect",{x:"2",y:"14",width:"20",height:"8",rx:"2"}),s.jsx("circle",{cx:"6",cy:"6",r:"1",fill:"currentColor",stroke:"none"}),s.jsx("circle",{cx:"6",cy:"18",r:"1",fill:"currentColor",stroke:"none"}),s.jsx("line",{x1:"10",y1:"6",x2:"18",y2:"6"}),s.jsx("line",{x1:"10",y1:"18",x2:"18",y2:"18"})]})}function pu({size:e=Je.size,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[s.jsx("path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"}),s.jsx("circle",{cx:"9",cy:"7",r:"4"}),s.jsx("path",{d:"M22 21v-2a4 4 0 0 0-3-3.87"}),s.jsx("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})]})}function qf({size:e=Je.size,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[s.jsx("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),s.jsx("circle",{cx:"12",cy:"7",r:"4"})]})}function zf({size:e=Je.size,className:t}){return s.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:s.jsx("path",{d:"M21 2l-2 2m-7.61 7.61a5.5 5.5 0 1 1-7.778 7.778 5.5 5.5 0 0 1 7.777-7.777zm0 0L15.5 7.5m0 0l3 3L22 7l-3-3m-3.5 3.5L19 4"})})}function mu({size:e=Je.size,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[s.jsx("path",{d:"M4 19.5A2.5 2.5 0 0 1 6.5 17H20"}),s.jsx("path",{d:"M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"}),s.jsx("line",{x1:"9",y1:"7",x2:"16",y2:"7"}),s.jsx("line",{x1:"9",y1:"11",x2:"14",y2:"11"})]})}function hu({size:e=Je.size,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[s.jsx("path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"}),s.jsx("rect",{x:"8",y:"2",width:"8",height:"4",rx:"1"}),s.jsx("line",{x1:"8",y1:"10",x2:"16",y2:"10"}),s.jsx("line",{x1:"8",y1:"14",x2:"14",y2:"14"}),s.jsx("line",{x1:"8",y1:"18",x2:"12",y2:"18"})]})}function fu({size:e=Je.size,className:t}){return s.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:s.jsx("polyline",{points:"20 6 9 17 4 12"})})}function Ea({size:e=Je.size,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[s.jsx("circle",{cx:"12",cy:"12",r:"3"}),s.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})]})}function Bi({size:e=Je.size,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[s.jsx("circle",{cx:"12",cy:"12",r:"10"}),s.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),s.jsx("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]})}function Kf({size:e=Je.size,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[s.jsx("circle",{cx:"12",cy:"12",r:"10"}),s.jsx("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}),s.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]})}function Vf({size:e=Je.size,className:t}){return s.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:s.jsx("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"})})}function un({size:e=Je.size,className:t}){return s.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:s.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})})}function gs({size:e=Je.size,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[s.jsx("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2"}),s.jsx("line",{x1:"8",y1:"21",x2:"16",y2:"21"}),s.jsx("line",{x1:"12",y1:"17",x2:"12",y2:"21"})]})}function Oi({size:e=Je.size,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[s.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),s.jsx("polyline",{points:"14 2 14 8 20 8"}),s.jsx("line",{x1:"8",y1:"13",x2:"16",y2:"13"}),s.jsx("line",{x1:"8",y1:"17",x2:"13",y2:"17"})]})}function Pn({size:e=Je.size,className:t}){return s.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:s.jsx("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})})}function _a({size:e=Je.size,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[s.jsx("polyline",{points:"23 4 23 10 17 10"}),s.jsx("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"})]})}function on({size:e=Je.size,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[s.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}),s.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),s.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]})}function br({size:e=Je.size,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[s.jsx("path",{d:"M12 22v-5"}),s.jsx("path",{d:"M9 8V2"}),s.jsx("path",{d:"M15 8V2"}),s.jsx("path",{d:"M18 8v5a6 6 0 0 1-12 0V8z"})]})}function rs({size:e=Je.size,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[s.jsx("circle",{cx:"12",cy:"5",r:"2"}),s.jsx("circle",{cx:"5",cy:"19",r:"2"}),s.jsx("circle",{cx:"19",cy:"19",r:"2"}),s.jsx("line",{x1:"12",y1:"7",x2:"5",y2:"17"}),s.jsx("line",{x1:"12",y1:"7",x2:"19",y2:"17"}),s.jsx("line",{x1:"5",y1:"19",x2:"19",y2:"19"})]})}function Yf({size:e=Je.size,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[s.jsx("polygon",{points:"12 2 2 7 12 12 22 7 12 2"}),s.jsx("polyline",{points:"2 12 12 17 22 12"}),s.jsx("polyline",{points:"2 17 12 22 22 17"})]})}function bu({size:e=Je.size,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[s.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),s.jsx("circle",{cx:"12",cy:"12",r:"3"})]})}function Wi({size:e=Je.size,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[s.jsx("path",{d:"M17.94 17.94A10.94 10.94 0 0 1 12 20C5 20 1 12 1 12a21.8 21.8 0 0 1 5.06-5.94"}),s.jsx("path",{d:"M9.9 4.24A10.93 10.93 0 0 1 12 4c7 0 11 8 11 8a21.77 21.77 0 0 1-2.16 3.19"}),s.jsx("path",{d:"M14.12 14.12a3 3 0 1 1-4.24-4.24"}),s.jsx("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]})}function gu({size:e=Je.size,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[s.jsx("circle",{cx:"12",cy:"12",r:"10"}),s.jsx("polyline",{points:"12 6 12 12 16 14"})]})}function Jf({size:e=Je.size,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[s.jsx("line",{x1:"18",y1:"20",x2:"18",y2:"10"}),s.jsx("line",{x1:"12",y1:"20",x2:"12",y2:"4"}),s.jsx("line",{x1:"6",y1:"20",x2:"6",y2:"14"})]})}function Ui({size:e=Je.size,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[s.jsx("polyline",{points:"4 17 10 11 4 5"}),s.jsx("line",{x1:"12",y1:"19",x2:"20",y2:"19"})]})}function Qf({size:e=Je.size,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[s.jsx("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"}),s.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"})]})}function xu({size:e=Je.size,className:t}){return s.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:s.jsx("polygon",{points:"5 3 19 12 5 21 5 3"})})}function Gi({size:e=Je.size,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[s.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),s.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}function Tt({size:e=Je.size,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[s.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),s.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function Xf({size:e=Je.size,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[s.jsx("path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z"}),s.jsx("path",{d:"M12 15l-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z"}),s.jsx("path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0"}),s.jsx("path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5"})]})}function Zf({size:e=Je.size,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[s.jsx("rect",{x:"3",y:"8",width:"18",height:"12",rx:"2"}),s.jsx("path",{d:"M12 2v6"}),s.jsx("circle",{cx:"8.5",cy:"14",r:"1.5",fill:"currentColor",stroke:"none"}),s.jsx("circle",{cx:"15.5",cy:"14",r:"1.5",fill:"currentColor",stroke:"none"})]})}function eb({size:e=Je.size,className:t}){return s.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:s.jsx("path",{d:"M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z"})})}function tb({size:e=Je.size,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[s.jsx("rect",{x:"9",y:"10",width:"6",height:"12",rx:"1"}),s.jsx("path",{d:"M12 2c-1.5 2-3 3.5-3 5a3 3 0 0 0 6 0c0-1.5-1.5-3-3-5z"})]})}function Hn({size:e=Je.size,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[s.jsx("path",{d:"M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"}),s.jsx("path",{d:"M13.73 21a2 2 0 0 1-3.46 0"})]})}function vu({size:e=Je.size,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[s.jsx("path",{d:"M8.7 3A6 6 0 0 1 18 8c0 3 .6 5 1.4 6.5"}),s.jsx("path",{d:"M17 17H3s3-2 3-9a5.98 5.98 0 0 1 .6-2.6"}),s.jsx("path",{d:"M13.73 21a2 2 0 0 1-3.46 0"}),s.jsx("line",{x1:"2",y1:"2",x2:"22",y2:"22"})]})}function sb({size:e=Je.size,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[s.jsx("circle",{cx:"12",cy:"12",r:"5"}),s.jsx("line",{x1:"12",y1:"1",x2:"12",y2:"3"}),s.jsx("line",{x1:"12",y1:"21",x2:"12",y2:"23"}),s.jsx("line",{x1:"4.22",y1:"4.22",x2:"5.64",y2:"5.64"}),s.jsx("line",{x1:"18.36",y1:"18.36",x2:"19.78",y2:"19.78"}),s.jsx("line",{x1:"1",y1:"12",x2:"3",y2:"12"}),s.jsx("line",{x1:"21",y1:"12",x2:"23",y2:"12"}),s.jsx("line",{x1:"4.22",y1:"19.78",x2:"5.64",y2:"18.36"}),s.jsx("line",{x1:"18.36",y1:"5.64",x2:"19.78",y2:"4.22"})]})}function nb({size:e=Je.size,className:t}){return s.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:s.jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})})}function rb({size:e=Je.size,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[s.jsx("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",ry:"2"}),s.jsx("line",{x1:"8",y1:"21",x2:"16",y2:"21"}),s.jsx("line",{x1:"12",y1:"17",x2:"12",y2:"21"})]})}function yu({size:e=Je.size,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[s.jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),s.jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]})}function ab({size:e=Je.size,className:t}){return s.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:s.jsx("polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2"})})}function ob({size:e=Je.size,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[s.jsx("polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"}),s.jsx("path",{d:"M19.07 4.93a10 10 0 0 1 0 14.14M15.54 8.46a5 5 0 0 1 0 7.07"})]})}function ib({size:e=Je.size,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[s.jsx("path",{d:"M14.5 10c-.83 0-1.5-.89-1.5-2s.67-2 1.5-2 1.5.89 1.5 2-.67 2-1.5 2z"}),s.jsx("path",{d:"M9.5 10c-.83 0-1.5-.89-1.5-2s.67-2 1.5-2 1.5.89 1.5 2-.67 2-1.5 2z"}),s.jsx("path",{d:"M19.35 6.07A16.03 16.03 0 0 0 15 4a.84.84 0 0 0-.46.33 11 11 0 0 0-.74 1.5 15.68 15.68 0 0 0-3.6 0 11.23 11.23 0 0 0-.74-1.5A.84.84 0 0 0 9 4a16.03 16.03 0 0 0-4.35 2.07A16.8 16.8 0 0 0 2 15a16.22 16.22 0 0 0 4 3c.12.08.27.06.37-.04a11.14 11.14 0 0 0 1.2-1.92.35.35 0 0 0-.18-.46 10.4 10.4 0 0 1-1.63-.78.36.36 0 0 1 .03-.6 6.8 6.8 0 0 0 .32-.24.36.36 0 0 1 .37-.04c2.2.98 4.6.98 6.8 0a.36.36 0 0 1 .37.04c.1.08.21.16.32.24a.36.36 0 0 1 .03.6 10.4 10.4 0 0 1-1.63.78.35.35 0 0 0-.18.46c.39.67.8 1.3 1.2 1.92a.37.37 0 0 0 .37.04 16.22 16.22 0 0 0 4-3 16.8 16.8 0 0 0-2.65-8.93z"})]})}function lb({size:e=Je.size,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[s.jsx("rect",{x:"2",y:"7",width:"15",height:"14",rx:"2"}),s.jsx("path",{d:"M13 2h9v9"}),s.jsx("path",{d:"M22 2L13 11"})]})}function cb({size:e=Je.size,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[s.jsx("polyline",{points:"9 14 4 9 9 4"}),s.jsx("path",{d:"M20 20v-7a4 4 0 0 0-4-4H4"})]})}function db({size:e=Je.size,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[s.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),s.jsx("line",{x1:"6",y1:"8",x2:"6.01",y2:"8"}),s.jsx("line",{x1:"10",y1:"8",x2:"10.01",y2:"8"}),s.jsx("line",{x1:"14",y1:"8",x2:"14.01",y2:"8"}),s.jsx("line",{x1:"18",y1:"8",x2:"18.01",y2:"8"}),s.jsx("line",{x1:"6",y1:"12",x2:"6.01",y2:"12"}),s.jsx("line",{x1:"10",y1:"12",x2:"10.01",y2:"12"}),s.jsx("line",{x1:"14",y1:"12",x2:"14.01",y2:"12"}),s.jsx("line",{x1:"18",y1:"12",x2:"18.01",y2:"12"}),s.jsx("line",{x1:"7",y1:"16",x2:"17",y2:"16"})]})}function ub({size:e=Je.size,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[s.jsx("rect",{x:"2",y:"6",width:"13",height:"13",rx:"2"}),s.jsx("path",{d:"M9 6V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2"})]})}function pb({size:e=Je.size,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[s.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),s.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"21"}),s.jsx("line",{x1:"3",y1:"12",x2:"12",y2:"12"})]})}function mb({size:e=Je.size,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[s.jsx("circle",{cx:"12",cy:"12",r:"10"}),s.jsx("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),s.jsx("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})]})}const wu="adhdev_chat_activity_visible",Gl=new Set(["hidden","debug","internal"]),ql=new Set(["visible","user","chat"]),hb=new Set(["debug","trace","internal"]),fb=new Set(["tool_call","terminal_command","runtime_activity"]),bb=new Set(["runtime_status","provider_chrome","control"]),gb=new Set(["thought","tool","terminal"]);function ku(e){const t=e.meta;return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function gn(e){return typeof e=="string"?e.trim().toLowerCase():""}function ro(e,t,n){return e[n]??(t==null?void 0:t[n])}function zl(e,t,n){const r=e;return n.some(a=>r[a]===!0||(t==null?void 0:t[a])===!0)}function xb(e,t){const n=gn(e.kind);return n||(t==="tool"?"tool":"standard")}function ao(e,t,n){const r=ku(e),a=typeof(r==null?void 0:r.label)=="string"?r.label.trim():"";return a||(t==="terminal"||n==="terminal_command"?"Terminal":t==="tool"||n==="tool_call"?"Tool":t==="thought"?"Thought":n==="runtime_activity"?"Runtime":"Activity")}function vb(e){const t=e.content;return Array.isArray(t)&&t.some(n=>!!n&&typeof n=="object"&&n.type!=="text")}function qi(e){if(!e)return{surface:"internal",isUserFacing:!1,isActivityFacing:!1,isInternal:!0,role:"",kind:"standard",label:"Internal"};const t=ku(e),n=gn(e.role),r=xb(e,n),a=gn(ro(e,t,"visibility")),o=gn(e.transcriptVisibility??(t==null?void 0:t.transcriptVisibility)??a),i=gn(ro(e,t,"audience")),c=gn(ro(e,t,"source")),d=Gl.has(a)||Gl.has(o)||hb.has(i)||zl(e,t,["internal","isInternal","debug","statusOnly","controlOnly"]),p=ql.has(a)||ql.has(o)||i==="chat"||zl(e,t,["userFacing"]),u=gb.has(r)||fb.has(c);if(d)return{surface:u?"activity":"internal",isUserFacing:!1,isActivityFacing:u,isInternal:!u,role:n,kind:r,label:ao(e,r,c)};if(p)return{surface:"chat",isUserFacing:!0,isActivityFacing:!1,isInternal:!1,role:n,kind:r,label:ao(e,r,c)};if((n==="system"||r==="system")&&vb(e))return{surface:"chat",isUserFacing:!0,isActivityFacing:!1,isInternal:!1,role:n,kind:r,label:"Chat"};if(bb.has(c)||n==="system"||r==="system")return{surface:"internal",isUserFacing:!1,isActivityFacing:!1,isInternal:!0,role:n,kind:r,label:"Internal"};if(u)return{surface:"activity",isUserFacing:!1,isActivityFacing:!0,isInternal:!1,role:n,kind:r,label:ao(e,r,c)};const m=(n==="user"||n==="human"||n==="assistant")&&(r==="standard"||r==="");return{surface:m?"chat":"internal",isUserFacing:m,isActivityFacing:!1,isInternal:!m,role:n,kind:r,label:m?"Chat":"Internal"}}function yb(e){return(Array.isArray(e)?e:[]).filter(t=>qi(t).isUserFacing)}function Su(e){return(Array.isArray(e)?e:[]).filter(t=>qi(t).isActivityFacing)}function Cu(e){const t=e.content;return typeof t=="string"?t:(()=>{try{return JSON.stringify(t??"")}catch{return String(t??"")}})()}function wb(e){return`${String(e.role||"")}::${Cu(e)}`}function kb(e){if(e.length<2)return e;const t=[];let n="";for(const r of e){const a=wb(r);Cu(r).trim().length>0&&a===n||(t.push(r),n=a)}return t}function Sb(e,t,n){return!n||t.length===0?e:[...e,...t].sort((r,a)=>{const o=Number(r.receivedAt??r.timestamp??0)||0,i=Number(a.receivedAt??a.timestamp??0)||0;if(o!==i)return o-i;const c=Number(r.index??0)||0,d=Number(a.index??0)||0;return c-d})}function Kl(e=typeof localStorage<"u"?localStorage:void 0){try{return(e==null?void 0:e.getItem(wu))==="1"}catch{return!1}}function Cb({text:e}){const{t}=Ce("common"),[n,r]=l.useState(!1),a=l.useCallback(()=>{navigator.clipboard.writeText(e).catch(()=>{}),r(!0),setTimeout(()=>r(!1),1500)},[e]);return s.jsx("button",{type:"button",onClick:a,"aria-label":t("chat.copyMessage"),className:"chat-copy-btn",children:n?s.jsx(fu,{size:11}):s.jsx(hu,{size:11})})}const ju=[_h,{singleTilde:!1}],Nu=[ju,$h,Hh],jb=[ju];function Rr(e,t,n){return s.jsxs("div",{className:"rounded-md border border-border-subtle p-2 text-sm",role:"note",children:[s.jsx("span",{className:"font-medium",children:e}),t?s.jsx("span",{className:"ml-1 break-all",children:t}):null,n?s.jsx("div",{className:"mt-1 opacity-80",style:{whiteSpace:"pre-wrap"},children:n}):null]})}function Vl(e,t){return e?t?s.jsx("pre",{className:"chat-preformatted",children:e}):cu(e)?s.jsx(Ei,{remarkPlugins:Nu,children:e}):s.jsx("div",{style:{whiteSpace:"pre-wrap"},children:e}):null}const Nb=l.memo(function({content:t,renderAsPreformatted:n,renderAsMarkdown:r}){return n?s.jsx("pre",{className:"chat-preformatted",children:t}):r?s.jsx(Ei,{remarkPlugins:Nu,children:t}):s.jsx("div",{style:{whiteSpace:"pre-wrap"},children:t})});function qn({parts:e,renderAsPreformatted:t}){return s.jsx("div",{className:"flex flex-col gap-2",children:e.map((n,r)=>{if(n.type==="text")return s.jsx("div",{children:Vl(String(n.text||""),t)},`text-${r}`);if(n.type==="image"){const a=so(n),o=n.alt||n.description||Un(n.uri,"image");return a?s.jsx("img",{src:a,alt:o,className:"max-w-full rounded-md border border-border-subtle"},`image-${r}`):s.jsx("div",{children:Rr("Image",o,n.mimeType)},`image-fallback-${r}`)}if(n.type==="audio"){const a=so(n);return a?s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("audio",{controls:!0,src:a,className:"max-w-full"}),n.transcript?s.jsx("div",{className:"text-sm opacity-80",style:{whiteSpace:"pre-wrap"},children:n.transcript}):null]},`audio-${r}`):s.jsx("div",{children:Rr("Audio",Un(n.uri,"audio"),n.transcript||n.mimeType)},`audio-fallback-${r}`)}if(n.type==="video"){const a=so(n),o=n.title||n.name||n.alt||Un(n.uri,"video"),i=[n.transcript,n.description,n.mimeType].filter(Boolean).join(`
|
|
6
6
|
`);return s.jsxs("div",{className:"flex flex-col gap-1",children:[a?s.jsx("video",{controls:!0,src:a,poster:n.posterUri,className:"max-w-full rounded-md border border-border-subtle"}):Rr("Video",o,i),a&&i?s.jsx("div",{className:"text-sm opacity-80",style:{whiteSpace:"pre-wrap"},children:i}):null]},`video-${r}`)}if(n.type==="resource_link"){const a=n.title||n.name||Un(n.uri,"resource"),o=[n.description,n.mimeType].filter(Boolean).join(`
|
|
7
7
|
`);return s.jsxs("div",{className:"flex flex-col gap-1",children:[n.uri?s.jsx("a",{href:n.uri,target:"_blank",rel:"noreferrer",download:!0,className:"underline break-all",children:a}):Rr("Resource",a,o),n.uri&&o?s.jsx("div",{className:"text-sm opacity-80",style:{whiteSpace:"pre-wrap"},children:o}):null]},`resource-link-${r}`)}if(n.type==="resource"&&n.resource){const a=Un(n.resource.uri,"resource");if(n.resource.text)return s.jsxs("div",{className:"rounded-md border border-border-subtle p-2",children:[s.jsx("div",{className:"text-[11px] opacity-70 mb-1",children:a}),Vl(n.resource.text,!0)]},`resource-${r}`);if(n.resource.uri)return s.jsx("a",{href:n.resource.uri,target:"_blank",rel:"noreferrer",className:"underline break-all",children:a},`resource-uri-${r}`)}return null})})}const Ab=l.memo(function({log:t}){return s.jsxs("div",{className:"self-center chat-msg-action",children:[s.jsx(Ei,{remarkPlugins:jb,children:t.text}),s.jsx("span",{className:"action-time",children:lu(t.timestamp)})]})},(e,t)=>e.log===t.log);function Yl(e){const t=e.meta;return[du(e),e.kind||"",e.senderName||"",e.bubbleId||"",e.bubbleState||"",e.visibility||"",e.transcriptVisibility||"",e.audience||"",e.source||"",e.userFacing===void 0?"":String(e.userFacing),e.internal===void 0?"":String(e.internal),e.isInternal===void 0?"":String(e.isInternal),e.debug===void 0?"":String(e.debug),t?String(t.label??""):"",t?String(t.isRunning??""):"",t?String(t.renderMode??""):""].join("")}const Tb=l.memo(function({message:t,receivedAt:n,agentName:r,userName:a,isCliMode:o,isTextExpanded:i,onToggleTextExpanded:c}){var S,A,T;const d=(t.role||"").toLowerCase(),p=d==="user"||d==="human",u=t.kind||(d==="tool"?"tool":"standard"),m=qi(t),f=Lf(t.content)?t.content:null,g=!!(f!=null&&f.some(I=>I.type!=="text")),k=$i(t.content,{joiner:`
|
|
8
|
-
`});if(m.isActivityFacing&&u!=="thought"&&u!=="tool"&&u!=="terminal"){const I=m.label||"Activity";return s.jsxs("div",{className:"self-start chat-msg-activity","data-chat-activity-row":"true",children:[s.jsxs("div",{className:"chat-msg-activity-meta","aria-label":"Activity message",children:[s.jsx("span",{className:"activity-dot"}),s.jsx("span",{children:I})]}),g&&f?s.jsx("div",{className:"chat-msg-activity-body",children:s.jsx(qn,{parts:f,renderAsPreformatted:!1})}):s.jsx("div",{className:"chat-msg-activity-body",style:{whiteSpace:"pre-wrap"},children:k})]})}if(u==="thought"){const I=typeof((S=t.meta)==null?void 0:S.label)=="string"?t.meta.label:"Thought";return s.jsxs("div",{className:"self-start chat-msg-thought","data-chat-activity-row":m.isActivityFacing?"true":void 0,children:[s.jsxs("div",{className:"chat-msg-header",children:[s.jsx(eb,{size:13}),s.jsx("span",{children:I})]}),s.jsx("div",{className:"chat-msg-body",children:k})]})}if(u==="tool")return s.jsxs("div",{className:"self-start chat-msg-tool","data-chat-activity-row":m.isActivityFacing?"true":void 0,children:[s.jsxs("div",{className:"chat-msg-tool-meta","aria-label":"Tool message",children:[s.jsx("span",{className:"tool-icon",children:"⏺"}),s.jsx("span",{className:"tool-label",children:"Tool"})]}),g&&f?s.jsx("div",{className:"tool-text w-full",children:s.jsx(qn,{parts:f,renderAsPreformatted:!1})}):s.jsx("div",{className:"tool-text w-full",style:{whiteSpace:"pre-wrap"},children:k})]});if(u==="terminal"){const I=(A=t.meta)!=null&&A.isRunning?"⏳":"✅",D=typeof((T=t.meta)==null?void 0:T.label)=="string"?t.meta.label:"Ran command";return s.jsxs("div",{className:"self-start chat-msg-terminal","data-chat-activity-row":m.isActivityFacing?"true":void 0,children:[s.jsxs("div",{className:"chat-msg-header",children:[s.jsx("span",{children:I}),s.jsx("span",{children:D})]}),g&&f?s.jsx("div",{className:"chat-msg-body",children:s.jsx(qn,{parts:f,renderAsPreformatted:!0})}):s.jsx("pre",{className:"chat-msg-body",children:k})]})}if(u==="system")return s.jsx("div",{className:"self-center chat-msg-system",children:g&&f?s.jsx(qn,{parts:f,renderAsPreformatted:!1}):k.slice(0,100)});const h=t.meta,w=(typeof(h==null?void 0:h.renderMode)=="string"?h.renderMode.trim():"")==="preformatted",b=k,j=!1,C=b,y=w,x=!p&&!y&&cu(C),N=["chat-message-row",p?"chat-message-row-user self-end":"chat-message-row-assistant self-start"].join(" ");return s.jsx("div",{className:N,children:(b||g||p)&&s.jsxs("div",{className:`chat-bubble ${p?"chat-bubble-user":"chat-bubble-assistant"}`,children:[s.jsxs("div",{className:`chat-bubble-header ${b||g?"mb-1.5":"mb-0"}`,children:[s.jsx("span",{className:"chat-sender",children:p?a||"You":t.senderName||r}),s.jsxs("span",{className:"chat-bubble-header-end",children:[(b||g)&&s.jsx(Cb,{text:k}),n!=null&&s.jsx("span",{className:"chat-time",children:lu(n)})]})]}),(b||g)&&s.jsx("div",{className:"chat-markdown",children:g&&f?s.jsx(qn,{parts:f,renderAsPreformatted:y}):s.jsx(Nb,{content:C,renderAsPreformatted:y,renderAsMarkdown:x})}),j]})})},(e,t)=>(e.message===t.message||Yl(e.message)===Yl(t.message))&&e.receivedAt===t.receivedAt&&e.agentName===t.agentName&&e.userName===t.userName&&e.isCliMode===t.isCliMode&&e.isTextExpanded===t.isTextExpanded),Mb=l.forwardRef(function({messages:t,actionLogs:n,agentName:r="Agent",userName:a,isCliMode:o=!1,isWorking:i=!1,contextKey:c="",receivedAtMap:d={},lastMessageHash:p,showActivityMessages:u=!1,emptyState:m,onLoadMore:f,isLoadingMore:g,hasMoreHistory:k,hiddenLiveCount:h=0,loadError:v,scrollToBottomRequestNonce:w,isVisible:b=!0},j){const{t:C}=Ce("common"),y=l.useRef(null),x=l.useRef(null),N=l.useRef(null),S=l.useRef(0),A=l.useRef(""),T=l.useRef(""),I=l.useRef(!1),D=l.useRef(null),P=l.useRef(!1),_=l.useRef(null),G=l.useRef(!1),[H,L]=l.useState(new Set),[O,E]=l.useState({showTop:!1,showBottom:!1}),M=l.useRef(!1),$=l.useRef(!1),R=l.useRef(b),z=l.useRef(b),Q=l.useRef(null);z.current=b;const ne=()=>{const ce=y.current;return ce?ce.scrollHeight-ce.scrollTop-ce.clientHeight<Hi:!0},J=l.useCallback(()=>{const ce=y.current,F=ce?Of(ce):{showTop:!1,showBottom:!1};E(pe=>pe.showTop===F.showTop&&pe.showBottom===F.showBottom?pe:F)},[]),Z=l.useCallback((ce="auto")=>{var pe;const F=y.current;F&&(F.scrollTo({top:F.scrollHeight,behavior:ce}),(pe=F.ownerDocument.defaultView)==null||pe.requestAnimationFrame(()=>J()))},[J]),de=l.useCallback((ce="auto")=>{var pe;const F=y.current;F&&(F.scrollTo({top:0,behavior:ce}),(pe=F.ownerDocument.defaultView)==null||pe.requestAnimationFrame(()=>J()))},[J]),te=l.useCallback(()=>{var U;const ce=y.current,F=(U=window.getSelection)==null?void 0:U.call(window);if(!ce||!F||F.rangeCount===0||F.isCollapsed){G.current=!1;return}const pe=F.anchorNode,xe=F.focusNode;G.current=!!(pe&&xe&&ce.contains(pe)&&ce.contains(xe))},[]),B=l.useMemo(()=>{const ce=yb(t),F=Su(t);return kb(Sb(ce,F,u))},[t,u]),ie=B.length===t.length?p:void 0,Y=Hf(B,ie),le=l.useCallback(()=>{const ce=y.current;if(!ce||!c||!z.current)return;const F={top:ce.scrollTop,fromBottom:Math.max(0,ce.scrollHeight-ce.scrollTop-ce.clientHeight),messageFingerprint:Y};Q.current={contextKey:c,snapshot:F},Gn.set(c,F)},[c,Y]),Ne=l.useCallback((ce="auto")=>{D.current!=null&&cancelAnimationFrame(D.current),D.current=requestAnimationFrame(()=>{D.current=null,Z(ce)})},[Z]),we=l.useCallback(()=>{M.current=!1,P.current=!0,$.current=!0,_.current!=null&&window.clearTimeout(_.current),_.current=window.setTimeout(()=>{P.current=!1,_.current=null},Ul)},[]);l.useEffect(()=>{const ce=!I.current,F=T.current!==c;if(T.current=c,ce||F){I.current=!0;const xe=c?Gn.get(c):null,U=!!xe&&fa(xe,Y);M.current=U?rr(xe):!1,P.current=Wf(xe,Y),G.current||(U?requestAnimationFrame(()=>{const be=y.current;be&&(no(be,xe),M.current=rr(xe),J(),$.current=!0)}):Ne("auto")),S.current=B.length,A.current=Y;return}B.length>S.current;const pe=Y!==A.current;Uf({hasSelection:G.current,userScrolledUp:M.current,hasChatContentChanged:pe})&&Ne("auto"),S.current=B.length,A.current=Y},[Y,c,B.length,Ne,J]),l.useEffect(()=>{w&&(we(),G.current||Ne("auto"))},[we,Ne,w]),l.useEffect(()=>{const ce=R.current;ce&&!b&&le(),z.current=b,R.current=b;const F=c?Gn.get(c):null;if(Ff(ce,b,F,Y)){if(!F)return;M.current=rr(F),P.current=!1,G.current||requestAnimationFrame(()=>{const pe=y.current;pe&&(no(pe,F),J())});return}},[b,c,Y,we,le,Ne,J]),l.useEffect(()=>()=>{const ce=Q.current;ce&&Gn.set(ce.contextKey,ce.snapshot),D.current!=null&&cancelAnimationFrame(D.current),_.current!=null&&window.clearTimeout(_.current)},[]),l.useEffect(()=>{const ce=x.current,F=y.current;if(!ce||!F)return;const pe=()=>{_.current!=null&&window.clearTimeout(_.current),_.current=window.setTimeout(()=>{P.current=!1,_.current=null},Ul)},xe=new ResizeObserver(()=>{J();const U=P.current;Gf({hasSelection:G.current,userScrolledUp:M.current,contextAutoScrollActive:U})&&(Ne("auto"),U&&pe())});return xe.observe(ce),F!==ce&&xe.observe(F),()=>{xe.disconnect(),_.current!=null&&(window.clearTimeout(_.current),_.current=null)}},[Ne,c,J]),l.useImperativeHandle(j,()=>({scrollToBottom:(ce="smooth")=>{Z(ce)}}),[Z]),l.useEffect(()=>{const ce=y.current;if(!ce)return;let F;const pe=()=>{le(),clearTimeout(F),F=setTimeout(()=>{M.current=!ne(),J()},50)};return ce.addEventListener("scroll",pe,{passive:!0}),()=>{ce.removeEventListener("scroll",pe),clearTimeout(F)}},[le,J]),l.useEffect(()=>(document.addEventListener("selectionchange",te),()=>document.removeEventListener("selectionchange",te)),[te]);const Se=l.useRef(0),me=l.useRef(!1);l.useEffect(()=>{const ce=y.current;if(!ce||!me.current||Se.current===0)return;const F=ce.scrollHeight-Se.current;F>0&&(ce.scrollTop=F),J(),le(),Se.current=0,me.current=!1},[B.length,le,J]),l.useEffect(()=>{if($.current||!c)return;const ce=Gn.get(c),F=y.current;if(!(!ce||!F)){if(!fa(ce,Y)){Z("auto"),$.current=!0;return}no(F,ce),M.current=rr(ce),J(),$.current=!0}},[c,Y,B.length,Z,J]);const q=()=>{const ce=y.current;ce&&(Se.current=ce.scrollHeight),me.current=!0,f==null||f()},W=()=>{M.current=!0,de("smooth"),le()},X=()=>{we(),Z("smooth"),le()},K=l.useMemo(()=>{const ce=B.map((U,be)=>({type:"message",data:U,index:be,ts:If(U,be,d)}));if(!n||n.length===0)return ce;const F=[...n].sort((U,be)=>U.timestamp-be.timestamp).map((U,be)=>({type:"action",data:U,index:be,ts:U.timestamp})),pe=[];let xe=0;for(const U of ce){for(;xe<F.length&&U.ts>0&&F[xe].ts<U.ts;)pe.push(F[xe++]);pe.push(U)}for(;xe<F.length;)pe.push(F[xe++]);return pe},[B,n,d]),ue=h>0||!!k,Pe=h>0?h>80?C("chatList.showEarlierMessagesHidden",{count:Math.min(h,80),total:h}):C("chatList.showEarlierMessages",{count:Math.min(h,80)}):v?C("chatList.loadErrorRetry",{error:v}):C("chatList.loadOlderMessages");return s.jsxs("div",{className:"chat-scroll-frame",children:[s.jsx("div",{ref:y,"data-chat-scroll":!0,className:"chat-container",children:s.jsxs("div",{ref:x,className:"chat-container-content",children:[g&&s.jsx("div",{className:"text-center py-3 text-text-muted text-xs opacity-60 animate-pulse",children:C("chatList.loadingOlderMessages")}),ue&&!g&&s.jsx("div",{className:"text-center py-2",children:s.jsx("button",{type:"button",onClick:q,className:`text-[11px] rounded-xl px-4 py-1.5 cursor-pointer border transition-all ${v&&h===0?"bg-transparent border-yellow-500/30 text-yellow-400 opacity-80 hover:opacity-100":"bg-transparent border-border-subtle text-text-muted opacity-70 hover:opacity-100 hover:border-accent/40"}`,children:Pe})}),K.length===0&&!ue&&(m||s.jsx("div",{className:"text-center mt-16 opacity-20 text-[13px]",children:C("chatList.waitingForMessages")})),K.map(ce=>{if(ce.type==="action"){const je=ce.data;return s.jsx(Ab,{log:je},`action-${ce.index}`)}const F=ce.data;ce.index;const pe=ha(F),xe=F.receivedAt||d[pe],U=`${c}-${pe}`,be=H.has(U);return s.jsx(Tb,{message:F,receivedAt:xe,agentName:r,userName:a,isCliMode:o,isTextExpanded:be,onToggleTextExpanded:()=>L(je=>{const ge=new Set(je);return be?ge.delete(U):ge.add(U),ge})},`msg-${pe}`)}),i&&s.jsx("div",{className:"self-start chat-typing-wrapper",children:s.jsxs("div",{className:"typing-indicator",children:[s.jsx("div",{className:"dot"}),s.jsx("div",{className:"dot"}),s.jsx("div",{className:"dot"}),s.jsx("span",{className:"text-[11px] text-text-muted ml-1",children:C("chatList.agentGenerating")})]})}),s.jsx("div",{className:"min-h-10",ref:N})]})}),(O.showTop||O.showBottom)&&s.jsxs("div",{className:"chat-scroll-jump-controls","aria-label":C("chatList.jumpToTop"),children:[O.showTop&&s.jsx("button",{type:"button",className:"chat-scroll-jump-button",onClick:W,"aria-label":C("chatList.jumpToOldestMessages"),title:C("chatList.jumpToTop"),children:C("chatList.top")}),O.showBottom&&s.jsx("button",{type:"button",className:"chat-scroll-jump-button chat-scroll-jump-button-primary",onClick:X,"aria-label":C("chatList.jumpToLatestMessages"),title:C("chatList.jumpToBottom"),children:C("chatList.latest")})]})]})}),Pb=l.memo(Mb,(e,t)=>e.messages===t.messages&&e.actionLogs===t.actionLogs&&e.agentName===t.agentName&&e.userName===t.userName&&e.isCliMode===t.isCliMode&&e.isWorking===t.isWorking&&e.contextKey===t.contextKey&&e.receivedAtMap===t.receivedAtMap&&e.lastMessageHash===t.lastMessageHash&&e.showActivityMessages===t.showActivityMessages&&e.emptyState===t.emptyState&&e.onLoadMore===t.onLoadMore&&e.isLoadingMore===t.isLoadingMore&&e.hasMoreHistory===t.hasMoreHistory&&e.hiddenLiveCount===t.hiddenLiveCount&&e.loadError===t.loadError&&e.scrollToBottomRequestNonce===t.scrollToBottomRequestNonce&&e.isVisible===t.isVisible),Db="modulepreload",Ib=function(e){return"/"+e},Jl={},Lb=function(t,n,r){let a=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const i=document.querySelector("meta[property=csp-nonce]"),c=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));a=Promise.allSettled(n.map(d=>{if(d=Ib(d),d in Jl)return;Jl[d]=!0;const p=d.endsWith(".css"),u=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${u}`))return;const m=document.createElement("link");if(m.rel=p?"stylesheet":Db,p||(m.as="script"),m.crossOrigin="",m.href=d,c&&m.setAttribute("nonce",c),document.head.appendChild(m),p)return new Promise((f,g)=>{m.addEventListener("load",f),m.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${d}`)))})}))}function o(i){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=i,window.dispatchEvent(c),!c.defaultPrevented)throw i}return a.then(i=>{for(const c of i||[])c.status==="rejected"&&o(c.reason);return t().catch(o)})};let Ql=!1;const Au=l.forwardRef(({onInput:e,onViewportMetrics:t,onScrollMetrics:n,fontSize:r=13,readOnly:a=!1,sizingMode:o="measured"},i)=>{const c=l.useRef(null),[d,p]=l.useState(null),u=l.useRef([]),m=l.useRef(!1),f=l.useRef(!1),g=l.useRef(!1),k=l.useRef(!1),h=()=>{const v=c.current;if(v){m.current&&(v.clear(),m.current=!1);for(const w of u.current)v.write(w.data,w.onProcessed);u.current=[],f.current&&(v.fit(),f.current=!1),g.current&&(v.bumpResize(),g.current=!1),k.current&&(v.scrollToTop(),k.current=!1)}};return l.useImperativeHandle(i,()=>({write:(v,w)=>{c.current?c.current.write(v,w):u.current.push({data:v,onProcessed:w})},clear:()=>{c.current?c.current.clear():(u.current=[],m.current=!0)},reset:()=>{c.current&&typeof c.current.reset=="function"?c.current.reset():(u.current=[],m.current=!0)},resize:(v,w)=>{c.current&&typeof c.current.resize=="function"&&c.current.resize(v,w)},fit:()=>{c.current?c.current.fit():f.current=!0},bumpResize:()=>{c.current?c.current.bumpResize():g.current=!0},scrollToTop:()=>{c.current?c.current.scrollToTop():k.current=!0},getSelection:()=>{var v,w;return((w=(v=c.current)==null?void 0:v.getSelection)==null?void 0:w.call(v))||""},getVisibleText:()=>{var v,w;return((w=(v=c.current)==null?void 0:v.getVisibleText)==null?void 0:w.call(v))||""}}),[]),l.useEffect(()=>{d&&h()},[d]),l.useEffect(()=>{let v=!1;return Lb(()=>import("./terminal-BZj_X5zy.js"),__vite__mapDeps([0,1,2])).then(w=>{Ql||(Ql=!0,console.info("[CliTerminal] renderer module loaded: terminal-render-web")),v||p(()=>w.GhosttyTerminalView)}).catch(w=>{console.error("[CliTerminal] failed to load terminal renderer",w)}),()=>{v=!0}},[]),d?s.jsx(d,{ref:c,onInput:e,onViewportMetrics:t,onScrollMetrics:n,fontSize:r,readOnly:a,sizingMode:o,className:"w-full h-full rounded-lg overflow-hidden"}):s.jsx("div",{className:"w-full h-full rounded-lg overflow-hidden animate-pulse",style:{background:"#0f1117"}})});Au.displayName="CliTerminal";function Ut(...e){return Fh(Bh(e))}const Rb={lg:"rounded-lg",xl:"rounded-xl","2xl":"rounded-2xl"},Eb={none:"",sm:"p-3",md:"px-4 py-3.5",lg:"px-5 py-4"},Ps=l.forwardRef(function({radius:t="xl",padding:n="md",className:r,...a},o){return s.jsx("div",{ref:o,className:Ut("border border-border-subtle bg-bg-secondary",Rb[t],Eb[n],r),...a})});function Er({label:e,value:t,sub:n,icon:r}){return s.jsxs(Ps,{children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[s.jsx("span",{className:"text-base flex items-center",children:r}),s.jsx("span",{className:"text-[10px] text-text-muted uppercase tracking-wide font-semibold",children:e})]}),s.jsx("div",{className:"text-[22px] font-bold text-text-primary tracking-tight",children:t}),n&&s.jsx("div",{className:"text-[11px] text-text-muted mt-0.5",children:n})]})}function Xl({value:e,max:t,label:n,color:r="#8b5cf6",detail:a,compact:o=!1}){const i=t>0?Math.min(Math.round(e/t*100),100):0,c=i>85?"#ef4444":i>60?"var(--status-warning)":r;return o?s.jsxs("div",{className:"flex-1",children:[s.jsxs("div",{className:"flex justify-between mb-0.5",children:[s.jsx("span",{className:"text-[9px] text-text-muted uppercase tracking-wide font-semibold",children:n}),s.jsxs("span",{className:"text-[10px] text-text-secondary font-semibold",children:[i,"%"]})]}),s.jsx("div",{className:"h-1 bg-white/[0.04] rounded-sm overflow-hidden",children:s.jsx("div",{className:"h-full rounded-sm transition-[width] duration-500",style:{width:`${i}%`,background:c}})})]}):s.jsxs("div",{className:"flex-1",children:[s.jsxs("div",{className:"flex justify-between mb-1.5",children:[s.jsx("span",{className:"text-[11px] text-text-secondary font-medium",children:n}),s.jsxs("span",{className:"text-[13px] text-text-primary font-bold",children:[i,"%"]})]}),s.jsx("div",{className:"h-1.5 bg-white/[0.04] rounded-sm overflow-hidden",children:s.jsx("div",{className:"h-full rounded-sm transition-[width] duration-[600ms]",style:{width:`${i}%`,background:`linear-gradient(90deg, ${c}, ${c}cc)`}})}),a&&s.jsx("div",{className:"text-[10px] text-text-muted mt-0.5",children:a})]})}function _b({cursorPos:e,viewportRef:t,imgRef:n}){var b;if(!e||!n.current)return null;const r=n.current,a=r.getBoundingClientRect(),o=(b=t.current)==null?void 0:b.getBoundingClientRect();if(!o)return null;const i=r.naturalWidth||a.width,c=r.naturalHeight||a.height,d=i/c,p=a.width/a.height;let u,m,f,g;d>p?(u=a.width,m=a.width/d,f=0,g=(a.height-m)/2):(m=a.height,u=a.height*d,f=(a.width-u)/2,g=0);const k=a.left-o.left+f+u*e.nx,h=a.top-o.top+g+m*e.ny,v=Math.max(8,Math.min(o.width-8,k)),w=Math.max(8,Math.min(o.height-8,h));return s.jsxs("div",{style:{position:"absolute",left:v-8,top:w-8,width:16,height:16,pointerEvents:"none",zIndex:100},children:[s.jsx("div",{style:{position:"absolute",left:7,top:0,width:2,height:16,background:"rgba(59,130,246,0.8)"}}),s.jsx("div",{style:{position:"absolute",left:0,top:7,width:16,height:2,background:"rgba(59,130,246,0.8)"}}),s.jsx("div",{style:{position:"absolute",left:5,top:5,width:6,height:6,borderRadius:"50%",background:"#3b82f6",boxShadow:"0 0 8px rgba(59,130,246,0.6)"}})]})}function $b({inputMode:e,onToggleInputMode:t,isImeOpen:n,setIsImeOpen:r,isMenuOpen:a,setIsMenuOpen:o,imeText:i,setImeText:c,handleImeSubmit:d,isConnActive:p,zoom:u,isMobile:m,mobileFillZoom:f,onZoomOut:g,onZoomReset:k,onZoomIn:h,transportType:v,screenshotUsage:w,lastActionStatus:b}){const{t:j}=Ce("common");return s.jsxs(s.Fragment,{children:[s.jsxs("div",{onTouchStart:C=>C.stopPropagation(),className:"absolute bottom-0 left-0 right-0 z-20 flex items-center justify-center gap-1.5 px-3 py-2 bg-black/75 backdrop-blur-xl border-t border-white/[0.08] touch-none",children:[s.jsxs("div",{onClick:t,className:`h-8 px-2.5 rounded-lg flex items-center gap-[5px] cursor-pointer ${e==="mouse"?"bg-blue-500/25 border border-blue-500/40":"bg-white/[0.08] border border-white/10"}`,children:[s.jsx("span",{className:"text-sm",children:e==="mouse"?"🖱️":"👆"}),s.jsx("span",{className:`text-[10px] font-bold ${e==="mouse"?"text-blue-400":"text-slate-400"}`,children:j(e==="mouse"?"remote.mouse":"remote.touch")})]}),s.jsxs("div",{className:"relative",children:[s.jsx("div",{onClick:()=>{r(C=>!C),o(!1)},className:`w-8 h-8 rounded-lg flex items-center justify-center cursor-pointer ${n?"bg-emerald-500/25 border border-emerald-500/40":"bg-white/[0.08] border border-white/10"}`,children:s.jsx("span",{className:"text-sm",children:"⌨️"})}),n&&s.jsx("div",{className:"absolute bottom-10 left-1/2 -translate-x-1/2 w-[220px] bg-neutral-950/[0.98] backdrop-blur-[30px] rounded-xl border border-white/20 p-[10px_12px] shadow-[0_10px_30px_rgba(0,0,0,0.8)] flex flex-col gap-2 z-20",style:{animation:"slideUp 0.15s ease-out"},children:s.jsx("input",{type:"text",placeholder:j("remote.typeAndEnter"),value:i,autoFocus:!0,onTouchStart:C=>C.stopPropagation(),onChange:C=>c(C.target.value),onKeyDown:C=>{d(C)},className:"w-full bg-black/60 border border-white/15 rounded-lg px-2.5 py-2 text-white text-[13px] outline-none"})})]}),s.jsx("div",{className:"relative",children:s.jsx("div",{onClick:()=>{o(C=>!C),r(!1)},className:`w-8 h-8 rounded-lg flex items-center justify-center cursor-pointer ${a?"bg-blue-500/25 border border-blue-500/40":"bg-white/[0.08] border border-white/10"}`,children:s.jsx("span",{className:"text-sm",children:"⚙️"})})}),s.jsx("div",{className:"w-px h-[18px] bg-white/10"}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsxs("div",{className:"flex items-center gap-0.5 px-1.5 py-0.5 rounded-md",style:{background:p?"rgba(34,197,94,0.12)":"rgba(234,179,8,0.12)"},children:[s.jsx("div",{className:"w-1 h-1 rounded-full",style:{background:p?"#22c55e":"#eab308",boxShadow:p?"0 0 4px #22c55e80":"0 0 4px #eab30880"}}),s.jsx("span",{className:"text-[8px] font-extrabold",style:{color:p?"#22c55e":"#eab308"},children:j(p?"remote.connected":"remote.ws")})]}),u>1&&s.jsxs("span",{className:"text-[8px] font-bold text-indigo-400",children:[Math.round(u*100),"%"]}),v==="direct"&&s.jsx("span",{className:"text-[8px] font-bold px-1 py-0.5 rounded",style:{color:"#22c55e",background:"rgba(34,197,94,0.12)"},title:j("remote.directP2PTitle"),children:j("remote.direct")}),v==="relay"&&s.jsx("span",{className:"text-[8px] font-bold px-1 py-0.5 rounded",style:{color:"var(--status-warning)",background:"color-mix(in srgb, var(--status-warning) 12%, transparent)"},title:j("remote.turnRelayTitle"),children:j("remote.relay")}),w&&w.dailyBudgetMinutes>0&&s.jsx("span",{className:"text-[8px] font-bold px-1 py-0.5 rounded",style:{color:w.budgetExhausted?"#ef4444":"#c4b5fd",background:w.budgetExhausted?"rgba(239,68,68,0.1)":"rgba(139,92,246,0.14)"},title:j("remote.dailyTurnTitle"),children:w.budgetExhausted?j("remote.turnBlocked"):j("remote.turnUsage",{used:w.dailyUsedMinutes,budget:w.dailyBudgetMinutes})}),b&&s.jsx("span",{className:"text-[8px] text-neutral-500 font-semibold max-w-[100px] overflow-hidden text-ellipsis whitespace-nowrap",children:b})]})]}),a&&s.jsxs("div",{onTouchStart:C=>C.stopPropagation(),style:{position:"absolute",bottom:56,left:"50%",transform:"translateX(-50%)",width:220,background:"rgba(23, 23, 23, 0.95)",backdropFilter:"blur(25px)",borderRadius:14,border:"1px solid rgba(255,255,255,0.1)",padding:14,boxShadow:"0 12px 40px rgba(0,0,0,0.6)",display:"flex",flexDirection:"column",gap:12,zIndex:20,touchAction:"none",animation:"slideUpSidebar 0.15s ease-out"},children:[s.jsx("div",{style:{fontSize:9,fontWeight:900,color:"#3b82f6",letterSpacing:1.5},children:j("remote.settings")}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[s.jsxs("div",{style:{fontSize:10,color:"#888",fontWeight:700},children:[j("remote.zoom")," ",u<=(m?f:1)+.01?j(m?"remote.fill":"remote.fit"):`${Math.round(u*100)}%`]}),s.jsxs("div",{style:{display:"flex",gap:4},children:[s.jsx("button",{onClick:C=>{C.stopPropagation(),g()},style:{flex:1,background:"rgba(255,255,255,0.1)",color:"#fff",border:"none",padding:"6px",borderRadius:6,fontSize:12,fontWeight:800,cursor:"pointer"},children:"−"}),s.jsx("button",{onClick:C=>{C.stopPropagation(),k()},style:{flex:1,background:"rgba(255,255,255,0.1)",color:"#fff",border:"none",padding:"6px",borderRadius:6,fontSize:9,fontWeight:800,cursor:"pointer"},children:j(m?"remote.fill":"remote.fit")}),s.jsx("button",{onClick:C=>{C.stopPropagation(),h()},style:{flex:1,background:"rgba(255,255,255,0.1)",color:"#fff",border:"none",padding:"6px",borderRadius:6,fontSize:12,fontWeight:800,cursor:"pointer"},children:"+"})]})]})]})]})}function Hb({waitingLabel:e,waitingHint:t,transportType:n}){const{t:r}=Ce("common");return s.jsxs("div",{className:"text-center flex flex-col items-center gap-3 px-6",children:[s.jsx("div",{className:"w-14 h-14 rounded-2xl flex items-center justify-center border border-white/10 bg-white/[0.04] shadow-[0_10px_30px_rgba(0,0,0,0.35)]",style:{animation:"remote-float 2.8s ease-in-out infinite"},children:s.jsx("img",{src:"/otter-logo.png",alt:"",className:"w-8 h-8 opacity-90"})}),s.jsx("div",{className:"text-white/85 text-[13px] font-semibold tracking-wide",children:e}),s.jsx("div",{className:"text-[11px] text-white/40",children:t}),n==="relay"&&s.jsx("div",{className:"text-[10px] font-medium",style:{color:"var(--status-warning)",opacity:.8},children:r("remote.waitingState.turnRelayActive")})]})}function Fb(){if(typeof window>"u")return!1;try{return window.__ADHDEV_DEBUG_RENDERS__===!0||window.localStorage.getItem("adhdev_debug_renders")==="1"}catch{return window.__ADHDEV_DEBUG_RENDERS__===!0}}function Zl(e){return e==null||typeof e=="number"||typeof e=="boolean"?e:typeof e=="string"?e.length>64?`${e.slice(0,61)}...`:e:Array.isArray(e)?`Array(${e.length})`:typeof e=="object"?"Object":typeof e}function jr(e,t){const n=l.useRef(null),r=l.useRef(0);l.useEffect(()=>{if(!Fb())return;r.current+=1;const a=n.current;if(!a){console.debug(`[render-trace] ${e}#${r.current}`,{changed:["mount"],snapshot:Object.fromEntries(Object.entries(t).map(([i,c])=>[i,Zl(c)]))}),n.current=t;return}const o=Object.keys({...a,...t}).filter(i=>!Object.is(a[i],t[i]));o.length>0&&console.debug(`[render-trace] ${e}#${r.current}`,{changed:o,snapshot:Object.fromEntries(o.map(i=>[i,Zl(t[i])]))}),n.current=t})}function Bb({containerRef:e,viewportRef:t,imgRef:n,inputMode:r,setInputMode:a,minZoom:o,zoomRef:i,panXRef:c,panYRef:d,setPanX:p,setPanY:u,setZoom:m,lastWheelTimeRef:f,onAction:g,setLastActionStatus:k,spawnRippleFromNormalized:h,clampPan:v,isMobile:w,mobileFillZoom:b}){const[j,C]=l.useState(null),y=l.useRef(null),x=l.useRef(null),N=l.useRef(null),S=l.useRef(!1),A=l.useRef(null),T=l.useRef(0),I=l.useRef(null),D=l.useRef(1),P=l.useRef({x:0,y:0}),_=l.useRef(!1),G=l.useRef(r),H=l.useRef(g),L=30,O=550,E=18,M=60,$=400,R=12,z=()=>{if(y.current)return;const J={nx:.5,ny:.5};y.current=J,C(J)};return l.useEffect(()=>{G.current=r,r==="mouse"&&z()},[r]),l.useEffect(()=>{H.current=g},[g]),l.useEffect(()=>{const J=e.current;if(!J)return;const Z=le=>{if(!n.current)return null;const Ne=n.current.getBoundingClientRect();return!Ne.width||!Ne.height?null:{nx:Math.max(0,Math.min(1,(le.clientX-Ne.left)/Ne.width)),ny:Math.max(0,Math.min(1,(le.clientY-Ne.top)/Ne.height))}},de=(le,Ne)=>{if(!n.current)return{dnx:0,dny:0};const we=n.current,Se=we.getBoundingClientRect(),me=we.naturalWidth||Se.width,q=we.naturalHeight||Se.height,W=me/q,X=Se.width/Se.height;let K,ue;return W>X?(K=Se.width,ue=Se.width/W):(ue=Se.height,K=Se.height*W),{dnx:le/K,dny:Ne/ue}},te=(le,Ne,we)=>{if(we<=1.05)return;const Se=-(le-.5)*100,me=-(Ne-.5)*100,q=v(Se,me,we);(Math.abs(q.x-c.current)>.1||Math.abs(q.y-d.current)>.1)&&(p(q.x),u(q.y),c.current=q.x,d.current=q.y)},B=le=>{const Ne=t.current;if(Ne&&le.target instanceof Node&&Ne.contains(le.target))le.preventDefault();else return;if(le.touches.length===1){const we=le.touches[0];x.current={x:we.clientX,y:we.clientY,time:Date.now()},N.current={x:we.clientX,y:we.clientY},_.current||(S.current=!1),A.current=setTimeout(()=>{if(!S.current&&!_.current)if(S.current=!0,G.current==="mouse"){const Se=y.current||{nx:.5,ny:.5};k("Right Click"),h(Se.nx,Se.ny,"right"),H.current("input_click",{...Se,button:"right"}).catch(()=>{})}else{const Se=Z(we);Se&&(k("Right Click"),h(Se.nx,Se.ny,"right"),H.current("input_click",{...Se,button:"right"}).catch(()=>{}))}},500);return}if(le.touches.length===2){A.current&&clearTimeout(A.current),S.current=!0,_.current=!0;const we=le.touches[1].clientX-le.touches[0].clientX,Se=le.touches[1].clientY-le.touches[0].clientY;I.current=Math.sqrt(we*we+Se*Se),D.current=i.current,P.current={x:(le.touches[0].clientX+le.touches[1].clientX)/2,y:(le.touches[0].clientY+le.touches[1].clientY)/2}}},ie=le=>{const Ne=t.current;if(Ne&&le.target instanceof Node&&Ne.contains(le.target)&&le.preventDefault(),le.touches.length===1&&N.current){const we=le.touches[0],Se=we.clientX-N.current.x,me=we.clientY-N.current.y;if(!S.current&&x.current){const q=we.clientX-x.current.x,W=we.clientY-x.current.y;Math.sqrt(q*q+W*W)>8&&(S.current=!0,A.current&&clearTimeout(A.current))}if(S.current)if(G.current==="mouse"){const q=de(Se,me),W=y.current||{nx:.5,ny:.5},X=Math.max(0,Math.min(1,W.nx+q.dnx)),K=Math.max(0,Math.min(1,W.ny+q.dny));y.current={nx:X,ny:K},C({nx:X,ny:K}),k(`Cursor: ${Math.round(X*100)}%, ${Math.round(K*100)}%`),te(X,K,i.current);const ue=Date.now();ue-f.current>=30&&(f.current=ue,H.current("input_mouseMoved",{nx:X,ny:K}).catch(()=>{}))}else if(i.current>1){const q=t.current;if(q){const W=q.clientWidth,X=q.clientHeight,K=c.current+Se/W*100,ue=d.current+me/X*100,Pe=v(K,ue,i.current);p(Pe.x),u(Pe.y),c.current=Pe.x,d.current=Pe.y}}else{const q=Z(we);if(q){const W=Date.now();W-f.current>=40&&(f.current=W,k("Scroll"),H.current("input_wheel",{nx:q.nx,ny:q.ny,deltaX:Math.round(-Se*2.5),deltaY:Math.round(-me*2.5)}).catch(()=>{}))}}N.current={x:we.clientX,y:we.clientY};return}if(le.touches.length===2&&I.current!==null){const we=le.touches[1].clientX-le.touches[0].clientX,Se=le.touches[1].clientY-le.touches[0].clientY,q=Math.sqrt(we*we+Se*Se)/I.current,W=(le.touches[0].clientX+le.touches[1].clientX)/2,X=(le.touches[0].clientY+le.touches[1].clientY)/2,K=W-P.current.x,ue=X-P.current.y,Pe=Math.abs(q-1)>.03;if(G.current==="mouse"){if(Pe){const ce=Math.max(o,Math.min(5,D.current*q));m(ce),i.current=ce}else if(Math.abs(K)>2||Math.abs(ue)>2){const ce=y.current||{nx:.5,ny:.5},F=Date.now();F-f.current>=30&&(f.current=F,k("Scroll"),H.current("input_wheel",{nx:ce.nx,ny:ce.ny,deltaX:Math.round(-K*3),deltaY:Math.round(-ue*3)}).catch(()=>{}))}}else{const ce=Math.max(o,Math.min(5,D.current*q));m(ce),i.current=ce;const F=t.current;if(F&&ce>1){const pe=F.clientWidth,xe=F.clientHeight,U=c.current+K/pe*100,be=d.current+ue/xe*100,je=v(U,be,ce);p(je.x),u(je.y),c.current=je.x,d.current=je.y}}P.current={x:W,y:X}}},Y=le=>{var Ne;if(A.current&&clearTimeout(A.current),I.current=null,le.touches.length===1&&_.current){const we=le.touches[0];x.current={x:we.clientX,y:we.clientY,time:Date.now()},N.current={x:we.clientX,y:we.clientY},S.current=!0;return}if(le.touches.length===0){if(_.current){_.current=!1,S.current=!1;return}if(le.changedTouches.length===1){const we=le.changedTouches[0],Se=Date.now(),me=Se-(((Ne=x.current)==null?void 0:Ne.time)||0),q=x.current?we.clientX-x.current.x:0,W=x.current?we.clientY-x.current.y:0,X=Math.sqrt(q*q+W*W);if(G.current==="mouse"){if(me<L||me>O||X>E){S.current=!1;return}const K=y.current||Z(we);K&&(k(`Click: ${Math.round(K.nx*100)}%, ${Math.round(K.ny*100)}%`),h(K.nx,K.ny,"left"),H.current("input_click",{...K}).catch(()=>{}))}else{if(S.current){S.current=!1;return}if(me<M||me>$||X>R){S.current=!1;return}const K=Z(we);if(!K)return;Se-T.current<300?(k("Double tap"),h(K.nx,K.ny,"double"),H.current("input_click",{...K,clickCount:2}).catch(()=>{}),T.current=0):(k(`Tap: ${Math.round(K.nx*100)}%, ${Math.round(K.ny*100)}%`),h(K.nx,K.ny,"left"),H.current("input_click",{...K}).catch(()=>{}),T.current=Se)}}S.current=!1}};return J.addEventListener("touchstart",B,{passive:!1}),J.addEventListener("touchmove",ie,{passive:!1}),J.addEventListener("touchend",Y,{passive:!1}),()=>{J.removeEventListener("touchstart",B),J.removeEventListener("touchmove",ie),J.removeEventListener("touchend",Y),A.current&&clearTimeout(A.current)}},[e,t,n,o,i,c,d,p,u,m,f,k,h,v]),{cursorPos:j,cursorPosRef:y,handleToggleInputMode:()=>{a(J=>{const Z=J==="touch"?"mouse":"touch";return Z==="mouse"&&z(),Z})},handleZoomReset:()=>{const J=w?b:1;m(J),i.current=J,p(0),u(0),c.current=0,d.current=0}}}function Tu({onAction:e,addLog:t,connState:n,connScreenshot:r,screenshotUsage:a,transportType:o}){const i=l.useRef(null),c=l.useRef(null),d=l.useRef(null),[p,u]=l.useState(null),[m,f]=l.useState(""),[,g]=l.useState(!1),[k,h]=l.useState([]),v=l.useRef(0),[w,b]=l.useState(!1),[j,C]=l.useState(!1),y=typeof window<"u"&&window.matchMedia("(max-width: 768px)").matches,[x,N]=l.useState(y?"mouse":"touch"),[S,A]=l.useState(1),T=l.useRef(!1),[I,D]=l.useState(1),[P,_]=l.useState(0),[G,H]=l.useState(0);jr("RemoteView",{connState:n,hasScreenshot:!!r,inputMode:x,zoom:I,panX:P,panY:G,isMenuOpen:w,isImeOpen:j});const L=l.useRef(0),O=l.useRef(I),E=l.useRef(P),M=l.useRef(G);l.useEffect(()=>{O.current=I},[I]),l.useEffect(()=>{E.current=P},[P]),l.useEffect(()=>{M.current=G},[G]),l.useEffect(()=>{var me;(me=i.current)==null||me.focus()},[]);const $=n==="connected",R=r,z=$?"Connected. Waiting for first frame...":n==="connecting"?"Connecting to Host...":"Reconnecting to Host...",Q=$?"The remote stream is warming up":"Waiting for the remote stream to catch up";l.useEffect(()=>{if(!y||T.current||!R)return;const me=d.current,q=c.current;if(!me||!q)return;const W=()=>{const X=q.clientWidth,K=q.clientHeight,ue=me.naturalWidth,Pe=me.naturalHeight;if(!ue||!Pe||!X||!K)return;const ce=Math.min(X/ue,K/Pe),pe=Math.max(X/ue,K/Pe)/ce;pe>1.01&&(A(pe),D(pe),O.current=pe),T.current=!0};me.complete&&me.naturalWidth?W():me.addEventListener("load",W,{once:!0})},[R,y]);const ne=.5;l.useEffect(()=>{I<=ne&&(_(0),H(0))},[I,ne]);const J=(me,q,W)=>{if(W<=ne)return{x:0,y:0};const X=(W-1)/(2*W)*100,K=(W-1)/(2*W)*100;return{x:Math.max(-X,Math.min(X,me)),y:Math.max(-K,Math.min(K,q))}},Z=(me,q)=>{if(!d.current)return null;const W=d.current.getBoundingClientRect();return!W.width||!W.height?null:{nx:Math.max(0,Math.min(1,(me-W.left)/W.width)),ny:Math.max(0,Math.min(1,(q-W.top)/W.height))}},de=(me,q,W)=>{const X=c.current;if(!X)return;const K=X.getBoundingClientRect(),ue=++v.current;h(Pe=>[...Pe,{id:ue,x:me-K.left,y:q-K.top,type:W}]),setTimeout(()=>h(Pe=>Pe.filter(ce=>ce.id!==ue)),600)},te=(me,q,W)=>{const X=d.current,K=c.current;if(!X||!K)return;const ue=X.getBoundingClientRect(),Pe=K.getBoundingClientRect(),ce=X.naturalWidth||ue.width,F=X.naturalHeight||ue.height,pe=ce/F,xe=ue.width/ue.height;let U,be,je,ge;pe>xe?(U=ue.width,be=ue.width/pe,je=0,ge=(ue.height-be)/2):(be=ue.height,U=ue.height*pe,je=(ue.width-U)/2,ge=0);const Ie=ue.left-Pe.left+je+U*me,et=ue.top-Pe.top+ge+be*q,Ze=++v.current;h(rt=>[...rt,{id:Ze,x:Ie,y:et,type:W}]),setTimeout(()=>h(rt=>rt.filter(he=>he.id!==Ze)),600)},B=async me=>{var W;const q=Z(me.clientX,me.clientY);if(q){u(`Click: ${Math.round(q.nx*100)}%, ${Math.round(q.ny*100)}%`),de(me.clientX,me.clientY,"left"),(W=i.current)==null||W.focus();try{const X=await e("input_click",{nx:q.nx,ny:q.ny});X!=null&&X.success||t(`❌ Click failed: ${X==null?void 0:X.error}`)}catch(X){t(`❌ Click error: ${X.message||X}`)}}},ie=async(me,q,W,X=0)=>{try{await e("input_key",{type:W?"char":"keyDown",key:me,code:q,text:W?me:void 0,unmodifiedText:W?me:void 0,modifiers:X})}catch(K){t(`❌ Key error: ${K.message||K}`)}},Y=async me=>{if(me.target.tagName==="INPUT")return;["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Backspace","Tab","Enter","Escape"].includes(me.key)&&me.preventDefault();let W=0;me.altKey&&(W|=1),me.ctrlKey&&(W|=2),me.metaKey&&(W|=4),me.shiftKey&&(W|=8),u(`Key: ${me.key}`),await ie(me.key,me.code,me.key.length===1,W)},le=async me=>{if(me.key==="Enter"){if(me.nativeEvent.isComposing)return;if(m){const q=m;f(""),u(`IME Sent: ${q}`);try{const W=await e("input_type",{text:q});W!=null&&W.success||t(`❌ IME error: ${W==null?void 0:W.error}`)}catch(W){t(`❌ IME error: ${W.message}`)}}else u("Key: Enter"),await ie("Enter","Enter",!1)}};l.useEffect(()=>{const me=i.current;if(!me)return;const q=W=>{var X;if((X=d.current)!=null&&X.contains(W.target)){W.preventDefault();const K=Date.now();if(K-L.current<40)return;L.current=K;const ue=Z(W.clientX,W.clientY);if(!ue)return;u(`Scroll: ${Math.round(W.deltaY)}`),e("input_wheel",{nx:ue.nx,ny:ue.ny,deltaX:Math.round(W.deltaX),deltaY:Math.round(W.deltaY)}).catch(()=>{})}};return me.addEventListener("wheel",q,{passive:!1}),()=>me.removeEventListener("wheel",q)},[e]);const{cursorPos:Ne,handleToggleInputMode:we,handleZoomReset:Se}=Bb({containerRef:i,viewportRef:c,imgRef:d,inputMode:x,setInputMode:N,minZoom:ne,zoomRef:O,panXRef:E,panYRef:M,setPanX:_,setPanY:H,setZoom:D,lastWheelTimeRef:L,onAction:e,setLastActionStatus:u,spawnRippleFromNormalized:te,clampPan:J,isMobile:y,mobileFillZoom:S});return s.jsxs("div",{ref:i,className:"flex-1 flex flex-col bg-black relative overflow-hidden outline-none touch-none",onKeyDown:Y,onContextMenu:me=>me.preventDefault(),onFocus:()=>g(!0),onBlur:()=>g(!1),tabIndex:0,children:[s.jsxs("div",{ref:c,className:"flex-1 relative overflow-hidden flex items-center justify-center bg-black",children:[R?s.jsx("img",{ref:d,src:R,alt:"Remote View",style:{display:"block",maxWidth:"100%",maxHeight:"100%",width:"auto",height:"auto",transform:`scale(${I}) translate(${P}%, ${G}%)`,transformOrigin:"center center",cursor:x==="mouse"?"default":"crosshair",userSelect:"none",WebkitTouchCallout:"none"},onClick:B,onContextMenu:me=>me.preventDefault(),onDragStart:me=>me.preventDefault()}):s.jsx(Hb,{waitingLabel:z,waitingHint:Q,transportType:o}),x==="mouse"&&R&&s.jsx(_b,{cursorPos:Ne,viewportRef:c,imgRef:d}),k.map(me=>{const W={left:"59,130,246",right:"239,68,68",double:"34,197,94"}[me.type];return s.jsxs("div",{style:{position:"absolute",left:me.x,top:me.y,pointerEvents:"none",zIndex:200,transform:"translate(-50%, -50%)"},children:[s.jsx("div",{style:{width:40,height:40,borderRadius:"50%",border:`2px solid rgba(${W}, 0.8)`,animation:"click-ripple-ring 0.5s ease-out forwards",position:"absolute",left:-20,top:-20}}),s.jsx("div",{style:{width:8,height:8,borderRadius:"50%",background:`rgba(${W}, 0.9)`,boxShadow:`0 0 12px rgba(${W}, 0.6)`,animation:"click-ripple-dot 0.4s ease-out forwards",position:"absolute",left:-4,top:-4}})]},me.id)})]}),s.jsx($b,{inputMode:x,onToggleInputMode:we,isImeOpen:j,setIsImeOpen:C,isMenuOpen:w,setIsMenuOpen:b,imeText:m,setImeText:f,handleImeSubmit:le,isConnActive:$,zoom:I,isMobile:y,mobileFillZoom:S,onZoomOut:()=>D(me=>Math.max(.5,me-.25)),onZoomReset:Se,onZoomIn:()=>D(me=>Math.min(5,me+.25)),transportType:o,screenshotUsage:a,lastActionStatus:p}),s.jsx("style",{children:`
|
|
8
|
+
`});if(m.isActivityFacing&&u!=="thought"&&u!=="tool"&&u!=="terminal"){const I=m.label||"Activity";return s.jsxs("div",{className:"self-start chat-msg-activity","data-chat-activity-row":"true",children:[s.jsxs("div",{className:"chat-msg-activity-meta","aria-label":"Activity message",children:[s.jsx("span",{className:"activity-dot"}),s.jsx("span",{children:I})]}),g&&f?s.jsx("div",{className:"chat-msg-activity-body",children:s.jsx(qn,{parts:f,renderAsPreformatted:!1})}):s.jsx("div",{className:"chat-msg-activity-body",style:{whiteSpace:"pre-wrap"},children:k})]})}if(u==="thought"){const I=typeof((S=t.meta)==null?void 0:S.label)=="string"?t.meta.label:"Thought";return s.jsxs("div",{className:"self-start chat-msg-thought","data-chat-activity-row":m.isActivityFacing?"true":void 0,children:[s.jsxs("div",{className:"chat-msg-header",children:[s.jsx(eb,{size:13}),s.jsx("span",{children:I})]}),s.jsx("div",{className:"chat-msg-body",children:k})]})}if(u==="tool")return s.jsxs("div",{className:"self-start chat-msg-tool","data-chat-activity-row":m.isActivityFacing?"true":void 0,children:[s.jsxs("div",{className:"chat-msg-tool-meta","aria-label":"Tool message",children:[s.jsx("span",{className:"tool-icon",children:"⏺"}),s.jsx("span",{className:"tool-label",children:"Tool"})]}),g&&f?s.jsx("div",{className:"tool-text w-full",children:s.jsx(qn,{parts:f,renderAsPreformatted:!1})}):s.jsx("div",{className:"tool-text w-full",style:{whiteSpace:"pre-wrap"},children:k})]});if(u==="terminal"){const I=(A=t.meta)!=null&&A.isRunning?"⏳":"✅",D=typeof((T=t.meta)==null?void 0:T.label)=="string"?t.meta.label:"Ran command";return s.jsxs("div",{className:"self-start chat-msg-terminal","data-chat-activity-row":m.isActivityFacing?"true":void 0,children:[s.jsxs("div",{className:"chat-msg-header",children:[s.jsx("span",{children:I}),s.jsx("span",{children:D})]}),g&&f?s.jsx("div",{className:"chat-msg-body",children:s.jsx(qn,{parts:f,renderAsPreformatted:!0})}):s.jsx("pre",{className:"chat-msg-body",children:k})]})}if(u==="system")return s.jsx("div",{className:"self-center chat-msg-system",children:g&&f?s.jsx(qn,{parts:f,renderAsPreformatted:!1}):k.slice(0,100)});const h=t.meta,w=(typeof(h==null?void 0:h.renderMode)=="string"?h.renderMode.trim():"")==="preformatted",b=k,j=!1,C=b,y=w,x=!p&&!y&&cu(C),N=["chat-message-row",p?"chat-message-row-user self-end":"chat-message-row-assistant self-start"].join(" ");return s.jsx("div",{className:N,children:(b||g||p)&&s.jsxs("div",{className:`chat-bubble ${p?"chat-bubble-user":"chat-bubble-assistant"}`,children:[s.jsxs("div",{className:`chat-bubble-header ${b||g?"mb-1.5":"mb-0"}`,children:[s.jsx("span",{className:"chat-sender",children:p?a||"You":t.senderName||r}),s.jsxs("span",{className:"chat-bubble-header-end",children:[(b||g)&&s.jsx(Cb,{text:k}),n!=null&&s.jsx("span",{className:"chat-time",children:lu(n)})]})]}),(b||g)&&s.jsx("div",{className:"chat-markdown",children:g&&f?s.jsx(qn,{parts:f,renderAsPreformatted:y}):s.jsx(Nb,{content:C,renderAsPreformatted:y,renderAsMarkdown:x})}),j]})})},(e,t)=>(e.message===t.message||Yl(e.message)===Yl(t.message))&&e.receivedAt===t.receivedAt&&e.agentName===t.agentName&&e.userName===t.userName&&e.isCliMode===t.isCliMode&&e.isTextExpanded===t.isTextExpanded),Mb=l.forwardRef(function({messages:t,actionLogs:n,agentName:r="Agent",userName:a,isCliMode:o=!1,isWorking:i=!1,contextKey:c="",receivedAtMap:d={},lastMessageHash:p,showActivityMessages:u=!1,emptyState:m,onLoadMore:f,isLoadingMore:g,hasMoreHistory:k,hiddenLiveCount:h=0,loadError:v,scrollToBottomRequestNonce:w,isVisible:b=!0},j){const{t:C}=Ce("common"),y=l.useRef(null),x=l.useRef(null),N=l.useRef(null),S=l.useRef(0),A=l.useRef(""),T=l.useRef(""),I=l.useRef(!1),D=l.useRef(null),P=l.useRef(!1),_=l.useRef(null),G=l.useRef(!1),[H,L]=l.useState(new Set),[O,E]=l.useState({showTop:!1,showBottom:!1}),M=l.useRef(!1),$=l.useRef(!1),R=l.useRef(b),z=l.useRef(b),Q=l.useRef(null);z.current=b;const ne=()=>{const ce=y.current;return ce?ce.scrollHeight-ce.scrollTop-ce.clientHeight<Hi:!0},J=l.useCallback(()=>{const ce=y.current,F=ce?Of(ce):{showTop:!1,showBottom:!1};E(pe=>pe.showTop===F.showTop&&pe.showBottom===F.showBottom?pe:F)},[]),Z=l.useCallback((ce="auto")=>{var pe;const F=y.current;F&&(F.scrollTo({top:F.scrollHeight,behavior:ce}),(pe=F.ownerDocument.defaultView)==null||pe.requestAnimationFrame(()=>J()))},[J]),de=l.useCallback((ce="auto")=>{var pe;const F=y.current;F&&(F.scrollTo({top:0,behavior:ce}),(pe=F.ownerDocument.defaultView)==null||pe.requestAnimationFrame(()=>J()))},[J]),te=l.useCallback(()=>{var U;const ce=y.current,F=(U=window.getSelection)==null?void 0:U.call(window);if(!ce||!F||F.rangeCount===0||F.isCollapsed){G.current=!1;return}const pe=F.anchorNode,xe=F.focusNode;G.current=!!(pe&&xe&&ce.contains(pe)&&ce.contains(xe))},[]),B=l.useMemo(()=>{const ce=yb(t),F=Su(t);return kb(Sb(ce,F,u))},[t,u]),ie=B.length===t.length?p:void 0,Y=Hf(B,ie),le=l.useCallback(()=>{const ce=y.current;if(!ce||!c||!z.current)return;const F={top:ce.scrollTop,fromBottom:Math.max(0,ce.scrollHeight-ce.scrollTop-ce.clientHeight),messageFingerprint:Y};Q.current={contextKey:c,snapshot:F},Gn.set(c,F)},[c,Y]),Ne=l.useCallback((ce="auto")=>{D.current!=null&&cancelAnimationFrame(D.current),D.current=requestAnimationFrame(()=>{D.current=null,Z(ce)})},[Z]),we=l.useCallback(()=>{M.current=!1,P.current=!0,$.current=!0,_.current!=null&&window.clearTimeout(_.current),_.current=window.setTimeout(()=>{P.current=!1,_.current=null},Ul)},[]);l.useEffect(()=>{const ce=!I.current,F=T.current!==c;if(T.current=c,ce||F){I.current=!0;const xe=c?Gn.get(c):null,U=!!xe&&fa(xe,Y);M.current=U?rr(xe):!1,P.current=Wf(xe,Y),G.current||(U?requestAnimationFrame(()=>{const be=y.current;be&&(no(be,xe),M.current=rr(xe),J(),$.current=!0)}):Ne("auto")),S.current=B.length,A.current=Y;return}B.length>S.current;const pe=Y!==A.current;Uf({hasSelection:G.current,userScrolledUp:M.current,hasChatContentChanged:pe})&&Ne("auto"),S.current=B.length,A.current=Y},[Y,c,B.length,Ne,J]),l.useEffect(()=>{w&&(we(),G.current||Ne("auto"))},[we,Ne,w]),l.useEffect(()=>{const ce=R.current;ce&&!b&&le(),z.current=b,R.current=b;const F=c?Gn.get(c):null;if(Ff(ce,b,F,Y)){if(!F)return;M.current=rr(F),P.current=!1,G.current||requestAnimationFrame(()=>{const pe=y.current;pe&&(no(pe,F),J())});return}},[b,c,Y,we,le,Ne,J]),l.useEffect(()=>()=>{const ce=Q.current;ce&&Gn.set(ce.contextKey,ce.snapshot),D.current!=null&&cancelAnimationFrame(D.current),_.current!=null&&window.clearTimeout(_.current)},[]),l.useEffect(()=>{const ce=x.current,F=y.current;if(!ce||!F)return;const pe=()=>{_.current!=null&&window.clearTimeout(_.current),_.current=window.setTimeout(()=>{P.current=!1,_.current=null},Ul)},xe=new ResizeObserver(()=>{J();const U=P.current;Gf({hasSelection:G.current,userScrolledUp:M.current,contextAutoScrollActive:U})&&(Ne("auto"),U&&pe())});return xe.observe(ce),F!==ce&&xe.observe(F),()=>{xe.disconnect(),_.current!=null&&(window.clearTimeout(_.current),_.current=null)}},[Ne,c,J]),l.useImperativeHandle(j,()=>({scrollToBottom:(ce="smooth")=>{Z(ce)}}),[Z]),l.useEffect(()=>{const ce=y.current;if(!ce)return;let F;const pe=()=>{le(),clearTimeout(F),F=setTimeout(()=>{M.current=!ne(),J()},50)};return ce.addEventListener("scroll",pe,{passive:!0}),()=>{ce.removeEventListener("scroll",pe),clearTimeout(F)}},[le,J]),l.useEffect(()=>(document.addEventListener("selectionchange",te),()=>document.removeEventListener("selectionchange",te)),[te]);const Se=l.useRef(0),me=l.useRef(!1);l.useEffect(()=>{const ce=y.current;if(!ce||!me.current||Se.current===0)return;const F=ce.scrollHeight-Se.current;F>0&&(ce.scrollTop=F),J(),le(),Se.current=0,me.current=!1},[B.length,le,J]),l.useEffect(()=>{if($.current||!c)return;const ce=Gn.get(c),F=y.current;if(!(!ce||!F)){if(!fa(ce,Y)){Z("auto"),$.current=!0;return}no(F,ce),M.current=rr(ce),J(),$.current=!0}},[c,Y,B.length,Z,J]);const q=()=>{const ce=y.current;ce&&(Se.current=ce.scrollHeight),me.current=!0,f==null||f()},W=()=>{M.current=!0,de("smooth"),le()},X=()=>{we(),Z("smooth"),le()},K=l.useMemo(()=>{const ce=B.map((U,be)=>({type:"message",data:U,index:be,ts:If(U,be,d)}));if(!n||n.length===0)return ce;const F=[...n].sort((U,be)=>U.timestamp-be.timestamp).map((U,be)=>({type:"action",data:U,index:be,ts:U.timestamp})),pe=[];let xe=0;for(const U of ce){for(;xe<F.length&&U.ts>0&&F[xe].ts<U.ts;)pe.push(F[xe++]);pe.push(U)}for(;xe<F.length;)pe.push(F[xe++]);return pe},[B,n,d]),ue=h>0||!!k,Pe=h>0?h>80?C("chatList.showEarlierMessagesHidden",{count:Math.min(h,80),total:h}):C("chatList.showEarlierMessages",{count:Math.min(h,80)}):v?C("chatList.loadErrorRetry",{error:v}):C("chatList.loadOlderMessages");return s.jsxs("div",{className:"chat-scroll-frame",children:[s.jsx("div",{ref:y,"data-chat-scroll":!0,className:"chat-container",children:s.jsxs("div",{ref:x,className:"chat-container-content",children:[g&&s.jsx("div",{className:"text-center py-3 text-text-muted text-xs opacity-60 animate-pulse",children:C("chatList.loadingOlderMessages")}),ue&&!g&&s.jsx("div",{className:"text-center py-2",children:s.jsx("button",{type:"button",onClick:q,className:`text-[11px] rounded-xl px-4 py-1.5 cursor-pointer border transition-all ${v&&h===0?"bg-transparent border-yellow-500/30 text-yellow-400 opacity-80 hover:opacity-100":"bg-transparent border-border-subtle text-text-muted opacity-70 hover:opacity-100 hover:border-accent/40"}`,children:Pe})}),K.length===0&&!ue&&(m||s.jsx("div",{className:"text-center mt-16 opacity-20 text-[13px]",children:C("chatList.waitingForMessages")})),K.map(ce=>{if(ce.type==="action"){const je=ce.data;return s.jsx(Ab,{log:je},`action-${ce.index}`)}const F=ce.data;ce.index;const pe=ha(F),xe=F.receivedAt||d[pe],U=`${c}-${pe}`,be=H.has(U);return s.jsx(Tb,{message:F,receivedAt:xe,agentName:r,userName:a,isCliMode:o,isTextExpanded:be,onToggleTextExpanded:()=>L(je=>{const ge=new Set(je);return be?ge.delete(U):ge.add(U),ge})},`msg-${pe}`)}),i&&s.jsx("div",{className:"self-start chat-typing-wrapper",children:s.jsxs("div",{className:"typing-indicator",children:[s.jsx("div",{className:"dot"}),s.jsx("div",{className:"dot"}),s.jsx("div",{className:"dot"}),s.jsx("span",{className:"text-[11px] text-text-muted ml-1",children:C("chatList.agentGenerating")})]})}),s.jsx("div",{className:"min-h-10",ref:N})]})}),(O.showTop||O.showBottom)&&s.jsxs("div",{className:"chat-scroll-jump-controls","aria-label":C("chatList.jumpToTop"),children:[O.showTop&&s.jsx("button",{type:"button",className:"chat-scroll-jump-button",onClick:W,"aria-label":C("chatList.jumpToOldestMessages"),title:C("chatList.jumpToTop"),children:C("chatList.top")}),O.showBottom&&s.jsx("button",{type:"button",className:"chat-scroll-jump-button chat-scroll-jump-button-primary",onClick:X,"aria-label":C("chatList.jumpToLatestMessages"),title:C("chatList.jumpToBottom"),children:C("chatList.latest")})]})]})}),Pb=l.memo(Mb,(e,t)=>e.messages===t.messages&&e.actionLogs===t.actionLogs&&e.agentName===t.agentName&&e.userName===t.userName&&e.isCliMode===t.isCliMode&&e.isWorking===t.isWorking&&e.contextKey===t.contextKey&&e.receivedAtMap===t.receivedAtMap&&e.lastMessageHash===t.lastMessageHash&&e.showActivityMessages===t.showActivityMessages&&e.emptyState===t.emptyState&&e.onLoadMore===t.onLoadMore&&e.isLoadingMore===t.isLoadingMore&&e.hasMoreHistory===t.hasMoreHistory&&e.hiddenLiveCount===t.hiddenLiveCount&&e.loadError===t.loadError&&e.scrollToBottomRequestNonce===t.scrollToBottomRequestNonce&&e.isVisible===t.isVisible),Db="modulepreload",Ib=function(e){return"/"+e},Jl={},Lb=function(t,n,r){let a=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const i=document.querySelector("meta[property=csp-nonce]"),c=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));a=Promise.allSettled(n.map(d=>{if(d=Ib(d),d in Jl)return;Jl[d]=!0;const p=d.endsWith(".css"),u=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${u}`))return;const m=document.createElement("link");if(m.rel=p?"stylesheet":Db,p||(m.as="script"),m.crossOrigin="",m.href=d,c&&m.setAttribute("nonce",c),document.head.appendChild(m),p)return new Promise((f,g)=>{m.addEventListener("load",f),m.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${d}`)))})}))}function o(i){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=i,window.dispatchEvent(c),!c.defaultPrevented)throw i}return a.then(i=>{for(const c of i||[])c.status==="rejected"&&o(c.reason);return t().catch(o)})};let Ql=!1;const Au=l.forwardRef(({onInput:e,onViewportMetrics:t,onScrollMetrics:n,fontSize:r=13,readOnly:a=!1,sizingMode:o="measured"},i)=>{const c=l.useRef(null),[d,p]=l.useState(null),u=l.useRef([]),m=l.useRef(!1),f=l.useRef(!1),g=l.useRef(!1),k=l.useRef(!1),h=()=>{const v=c.current;if(v){m.current&&(v.clear(),m.current=!1);for(const w of u.current)v.write(w.data,w.onProcessed);u.current=[],f.current&&(v.fit(),f.current=!1),g.current&&(v.bumpResize(),g.current=!1),k.current&&(v.scrollToTop(),k.current=!1)}};return l.useImperativeHandle(i,()=>({write:(v,w)=>{c.current?c.current.write(v,w):u.current.push({data:v,onProcessed:w})},clear:()=>{c.current?c.current.clear():(u.current=[],m.current=!0)},reset:()=>{c.current&&typeof c.current.reset=="function"?c.current.reset():(u.current=[],m.current=!0)},resize:(v,w)=>{c.current&&typeof c.current.resize=="function"&&c.current.resize(v,w)},fit:()=>{c.current?c.current.fit():f.current=!0},bumpResize:()=>{c.current?c.current.bumpResize():g.current=!0},scrollToTop:()=>{c.current?c.current.scrollToTop():k.current=!0},getSelection:()=>{var v,w;return((w=(v=c.current)==null?void 0:v.getSelection)==null?void 0:w.call(v))||""},getVisibleText:()=>{var v,w;return((w=(v=c.current)==null?void 0:v.getVisibleText)==null?void 0:w.call(v))||""}}),[]),l.useEffect(()=>{d&&h()},[d]),l.useEffect(()=>{let v=!1;return Lb(()=>import("./terminal-DiXj2eIR.js"),__vite__mapDeps([0,1,2])).then(w=>{Ql||(Ql=!0,console.info("[CliTerminal] renderer module loaded: terminal-render-web")),v||p(()=>w.GhosttyTerminalView)}).catch(w=>{console.error("[CliTerminal] failed to load terminal renderer",w)}),()=>{v=!0}},[]),d?s.jsx(d,{ref:c,onInput:e,onViewportMetrics:t,onScrollMetrics:n,fontSize:r,readOnly:a,sizingMode:o,className:"w-full h-full rounded-lg overflow-hidden"}):s.jsx("div",{className:"w-full h-full rounded-lg overflow-hidden animate-pulse",style:{background:"#0f1117"}})});Au.displayName="CliTerminal";function Ut(...e){return Fh(Bh(e))}const Rb={lg:"rounded-lg",xl:"rounded-xl","2xl":"rounded-2xl"},Eb={none:"",sm:"p-3",md:"px-4 py-3.5",lg:"px-5 py-4"},Ps=l.forwardRef(function({radius:t="xl",padding:n="md",className:r,...a},o){return s.jsx("div",{ref:o,className:Ut("border border-border-subtle bg-bg-secondary",Rb[t],Eb[n],r),...a})});function Er({label:e,value:t,sub:n,icon:r}){return s.jsxs(Ps,{children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[s.jsx("span",{className:"text-base flex items-center",children:r}),s.jsx("span",{className:"text-[10px] text-text-muted uppercase tracking-wide font-semibold",children:e})]}),s.jsx("div",{className:"text-[22px] font-bold text-text-primary tracking-tight",children:t}),n&&s.jsx("div",{className:"text-[11px] text-text-muted mt-0.5",children:n})]})}function Xl({value:e,max:t,label:n,color:r="#8b5cf6",detail:a,compact:o=!1}){const i=t>0?Math.min(Math.round(e/t*100),100):0,c=i>85?"#ef4444":i>60?"var(--status-warning)":r;return o?s.jsxs("div",{className:"flex-1",children:[s.jsxs("div",{className:"flex justify-between mb-0.5",children:[s.jsx("span",{className:"text-[9px] text-text-muted uppercase tracking-wide font-semibold",children:n}),s.jsxs("span",{className:"text-[10px] text-text-secondary font-semibold",children:[i,"%"]})]}),s.jsx("div",{className:"h-1 bg-white/[0.04] rounded-sm overflow-hidden",children:s.jsx("div",{className:"h-full rounded-sm transition-[width] duration-500",style:{width:`${i}%`,background:c}})})]}):s.jsxs("div",{className:"flex-1",children:[s.jsxs("div",{className:"flex justify-between mb-1.5",children:[s.jsx("span",{className:"text-[11px] text-text-secondary font-medium",children:n}),s.jsxs("span",{className:"text-[13px] text-text-primary font-bold",children:[i,"%"]})]}),s.jsx("div",{className:"h-1.5 bg-white/[0.04] rounded-sm overflow-hidden",children:s.jsx("div",{className:"h-full rounded-sm transition-[width] duration-[600ms]",style:{width:`${i}%`,background:`linear-gradient(90deg, ${c}, ${c}cc)`}})}),a&&s.jsx("div",{className:"text-[10px] text-text-muted mt-0.5",children:a})]})}function _b({cursorPos:e,viewportRef:t,imgRef:n}){var b;if(!e||!n.current)return null;const r=n.current,a=r.getBoundingClientRect(),o=(b=t.current)==null?void 0:b.getBoundingClientRect();if(!o)return null;const i=r.naturalWidth||a.width,c=r.naturalHeight||a.height,d=i/c,p=a.width/a.height;let u,m,f,g;d>p?(u=a.width,m=a.width/d,f=0,g=(a.height-m)/2):(m=a.height,u=a.height*d,f=(a.width-u)/2,g=0);const k=a.left-o.left+f+u*e.nx,h=a.top-o.top+g+m*e.ny,v=Math.max(8,Math.min(o.width-8,k)),w=Math.max(8,Math.min(o.height-8,h));return s.jsxs("div",{style:{position:"absolute",left:v-8,top:w-8,width:16,height:16,pointerEvents:"none",zIndex:100},children:[s.jsx("div",{style:{position:"absolute",left:7,top:0,width:2,height:16,background:"rgba(59,130,246,0.8)"}}),s.jsx("div",{style:{position:"absolute",left:0,top:7,width:16,height:2,background:"rgba(59,130,246,0.8)"}}),s.jsx("div",{style:{position:"absolute",left:5,top:5,width:6,height:6,borderRadius:"50%",background:"#3b82f6",boxShadow:"0 0 8px rgba(59,130,246,0.6)"}})]})}function $b({inputMode:e,onToggleInputMode:t,isImeOpen:n,setIsImeOpen:r,isMenuOpen:a,setIsMenuOpen:o,imeText:i,setImeText:c,handleImeSubmit:d,isConnActive:p,zoom:u,isMobile:m,mobileFillZoom:f,onZoomOut:g,onZoomReset:k,onZoomIn:h,transportType:v,screenshotUsage:w,lastActionStatus:b}){const{t:j}=Ce("common");return s.jsxs(s.Fragment,{children:[s.jsxs("div",{onTouchStart:C=>C.stopPropagation(),className:"absolute bottom-0 left-0 right-0 z-20 flex items-center justify-center gap-1.5 px-3 py-2 bg-black/75 backdrop-blur-xl border-t border-white/[0.08] touch-none",children:[s.jsxs("div",{onClick:t,className:`h-8 px-2.5 rounded-lg flex items-center gap-[5px] cursor-pointer ${e==="mouse"?"bg-blue-500/25 border border-blue-500/40":"bg-white/[0.08] border border-white/10"}`,children:[s.jsx("span",{className:"text-sm",children:e==="mouse"?"🖱️":"👆"}),s.jsx("span",{className:`text-[10px] font-bold ${e==="mouse"?"text-blue-400":"text-slate-400"}`,children:j(e==="mouse"?"remote.mouse":"remote.touch")})]}),s.jsxs("div",{className:"relative",children:[s.jsx("div",{onClick:()=>{r(C=>!C),o(!1)},className:`w-8 h-8 rounded-lg flex items-center justify-center cursor-pointer ${n?"bg-emerald-500/25 border border-emerald-500/40":"bg-white/[0.08] border border-white/10"}`,children:s.jsx("span",{className:"text-sm",children:"⌨️"})}),n&&s.jsx("div",{className:"absolute bottom-10 left-1/2 -translate-x-1/2 w-[220px] bg-neutral-950/[0.98] backdrop-blur-[30px] rounded-xl border border-white/20 p-[10px_12px] shadow-[0_10px_30px_rgba(0,0,0,0.8)] flex flex-col gap-2 z-20",style:{animation:"slideUp 0.15s ease-out"},children:s.jsx("input",{type:"text",placeholder:j("remote.typeAndEnter"),value:i,autoFocus:!0,onTouchStart:C=>C.stopPropagation(),onChange:C=>c(C.target.value),onKeyDown:C=>{d(C)},className:"w-full bg-black/60 border border-white/15 rounded-lg px-2.5 py-2 text-white text-[13px] outline-none"})})]}),s.jsx("div",{className:"relative",children:s.jsx("div",{onClick:()=>{o(C=>!C),r(!1)},className:`w-8 h-8 rounded-lg flex items-center justify-center cursor-pointer ${a?"bg-blue-500/25 border border-blue-500/40":"bg-white/[0.08] border border-white/10"}`,children:s.jsx("span",{className:"text-sm",children:"⚙️"})})}),s.jsx("div",{className:"w-px h-[18px] bg-white/10"}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsxs("div",{className:"flex items-center gap-0.5 px-1.5 py-0.5 rounded-md",style:{background:p?"rgba(34,197,94,0.12)":"rgba(234,179,8,0.12)"},children:[s.jsx("div",{className:"w-1 h-1 rounded-full",style:{background:p?"#22c55e":"#eab308",boxShadow:p?"0 0 4px #22c55e80":"0 0 4px #eab30880"}}),s.jsx("span",{className:"text-[8px] font-extrabold",style:{color:p?"#22c55e":"#eab308"},children:j(p?"remote.connected":"remote.ws")})]}),u>1&&s.jsxs("span",{className:"text-[8px] font-bold text-indigo-400",children:[Math.round(u*100),"%"]}),v==="direct"&&s.jsx("span",{className:"text-[8px] font-bold px-1 py-0.5 rounded",style:{color:"#22c55e",background:"rgba(34,197,94,0.12)"},title:j("remote.directP2PTitle"),children:j("remote.direct")}),v==="relay"&&s.jsx("span",{className:"text-[8px] font-bold px-1 py-0.5 rounded",style:{color:"var(--status-warning)",background:"color-mix(in srgb, var(--status-warning) 12%, transparent)"},title:j("remote.turnRelayTitle"),children:j("remote.relay")}),w&&w.dailyBudgetMinutes>0&&s.jsx("span",{className:"text-[8px] font-bold px-1 py-0.5 rounded",style:{color:w.budgetExhausted?"#ef4444":"#c4b5fd",background:w.budgetExhausted?"rgba(239,68,68,0.1)":"rgba(139,92,246,0.14)"},title:j("remote.dailyTurnTitle"),children:w.budgetExhausted?j("remote.turnBlocked"):j("remote.turnUsage",{used:w.dailyUsedMinutes,budget:w.dailyBudgetMinutes})}),b&&s.jsx("span",{className:"text-[8px] text-neutral-500 font-semibold max-w-[100px] overflow-hidden text-ellipsis whitespace-nowrap",children:b})]})]}),a&&s.jsxs("div",{onTouchStart:C=>C.stopPropagation(),style:{position:"absolute",bottom:56,left:"50%",transform:"translateX(-50%)",width:220,background:"rgba(23, 23, 23, 0.95)",backdropFilter:"blur(25px)",borderRadius:14,border:"1px solid rgba(255,255,255,0.1)",padding:14,boxShadow:"0 12px 40px rgba(0,0,0,0.6)",display:"flex",flexDirection:"column",gap:12,zIndex:20,touchAction:"none",animation:"slideUpSidebar 0.15s ease-out"},children:[s.jsx("div",{style:{fontSize:9,fontWeight:900,color:"#3b82f6",letterSpacing:1.5},children:j("remote.settings")}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[s.jsxs("div",{style:{fontSize:10,color:"#888",fontWeight:700},children:[j("remote.zoom")," ",u<=(m?f:1)+.01?j(m?"remote.fill":"remote.fit"):`${Math.round(u*100)}%`]}),s.jsxs("div",{style:{display:"flex",gap:4},children:[s.jsx("button",{onClick:C=>{C.stopPropagation(),g()},style:{flex:1,background:"rgba(255,255,255,0.1)",color:"#fff",border:"none",padding:"6px",borderRadius:6,fontSize:12,fontWeight:800,cursor:"pointer"},children:"−"}),s.jsx("button",{onClick:C=>{C.stopPropagation(),k()},style:{flex:1,background:"rgba(255,255,255,0.1)",color:"#fff",border:"none",padding:"6px",borderRadius:6,fontSize:9,fontWeight:800,cursor:"pointer"},children:j(m?"remote.fill":"remote.fit")}),s.jsx("button",{onClick:C=>{C.stopPropagation(),h()},style:{flex:1,background:"rgba(255,255,255,0.1)",color:"#fff",border:"none",padding:"6px",borderRadius:6,fontSize:12,fontWeight:800,cursor:"pointer"},children:"+"})]})]})]})]})}function Hb({waitingLabel:e,waitingHint:t,transportType:n}){const{t:r}=Ce("common");return s.jsxs("div",{className:"text-center flex flex-col items-center gap-3 px-6",children:[s.jsx("div",{className:"w-14 h-14 rounded-2xl flex items-center justify-center border border-white/10 bg-white/[0.04] shadow-[0_10px_30px_rgba(0,0,0,0.35)]",style:{animation:"remote-float 2.8s ease-in-out infinite"},children:s.jsx("img",{src:"/otter-logo.png",alt:"",className:"w-8 h-8 opacity-90"})}),s.jsx("div",{className:"text-white/85 text-[13px] font-semibold tracking-wide",children:e}),s.jsx("div",{className:"text-[11px] text-white/40",children:t}),n==="relay"&&s.jsx("div",{className:"text-[10px] font-medium",style:{color:"var(--status-warning)",opacity:.8},children:r("remote.waitingState.turnRelayActive")})]})}function Fb(){if(typeof window>"u")return!1;try{return window.__ADHDEV_DEBUG_RENDERS__===!0||window.localStorage.getItem("adhdev_debug_renders")==="1"}catch{return window.__ADHDEV_DEBUG_RENDERS__===!0}}function Zl(e){return e==null||typeof e=="number"||typeof e=="boolean"?e:typeof e=="string"?e.length>64?`${e.slice(0,61)}...`:e:Array.isArray(e)?`Array(${e.length})`:typeof e=="object"?"Object":typeof e}function jr(e,t){const n=l.useRef(null),r=l.useRef(0);l.useEffect(()=>{if(!Fb())return;r.current+=1;const a=n.current;if(!a){console.debug(`[render-trace] ${e}#${r.current}`,{changed:["mount"],snapshot:Object.fromEntries(Object.entries(t).map(([i,c])=>[i,Zl(c)]))}),n.current=t;return}const o=Object.keys({...a,...t}).filter(i=>!Object.is(a[i],t[i]));o.length>0&&console.debug(`[render-trace] ${e}#${r.current}`,{changed:o,snapshot:Object.fromEntries(o.map(i=>[i,Zl(t[i])]))}),n.current=t})}function Bb({containerRef:e,viewportRef:t,imgRef:n,inputMode:r,setInputMode:a,minZoom:o,zoomRef:i,panXRef:c,panYRef:d,setPanX:p,setPanY:u,setZoom:m,lastWheelTimeRef:f,onAction:g,setLastActionStatus:k,spawnRippleFromNormalized:h,clampPan:v,isMobile:w,mobileFillZoom:b}){const[j,C]=l.useState(null),y=l.useRef(null),x=l.useRef(null),N=l.useRef(null),S=l.useRef(!1),A=l.useRef(null),T=l.useRef(0),I=l.useRef(null),D=l.useRef(1),P=l.useRef({x:0,y:0}),_=l.useRef(!1),G=l.useRef(r),H=l.useRef(g),L=30,O=550,E=18,M=60,$=400,R=12,z=()=>{if(y.current)return;const J={nx:.5,ny:.5};y.current=J,C(J)};return l.useEffect(()=>{G.current=r,r==="mouse"&&z()},[r]),l.useEffect(()=>{H.current=g},[g]),l.useEffect(()=>{const J=e.current;if(!J)return;const Z=le=>{if(!n.current)return null;const Ne=n.current.getBoundingClientRect();return!Ne.width||!Ne.height?null:{nx:Math.max(0,Math.min(1,(le.clientX-Ne.left)/Ne.width)),ny:Math.max(0,Math.min(1,(le.clientY-Ne.top)/Ne.height))}},de=(le,Ne)=>{if(!n.current)return{dnx:0,dny:0};const we=n.current,Se=we.getBoundingClientRect(),me=we.naturalWidth||Se.width,q=we.naturalHeight||Se.height,W=me/q,X=Se.width/Se.height;let K,ue;return W>X?(K=Se.width,ue=Se.width/W):(ue=Se.height,K=Se.height*W),{dnx:le/K,dny:Ne/ue}},te=(le,Ne,we)=>{if(we<=1.05)return;const Se=-(le-.5)*100,me=-(Ne-.5)*100,q=v(Se,me,we);(Math.abs(q.x-c.current)>.1||Math.abs(q.y-d.current)>.1)&&(p(q.x),u(q.y),c.current=q.x,d.current=q.y)},B=le=>{const Ne=t.current;if(Ne&&le.target instanceof Node&&Ne.contains(le.target))le.preventDefault();else return;if(le.touches.length===1){const we=le.touches[0];x.current={x:we.clientX,y:we.clientY,time:Date.now()},N.current={x:we.clientX,y:we.clientY},_.current||(S.current=!1),A.current=setTimeout(()=>{if(!S.current&&!_.current)if(S.current=!0,G.current==="mouse"){const Se=y.current||{nx:.5,ny:.5};k("Right Click"),h(Se.nx,Se.ny,"right"),H.current("input_click",{...Se,button:"right"}).catch(()=>{})}else{const Se=Z(we);Se&&(k("Right Click"),h(Se.nx,Se.ny,"right"),H.current("input_click",{...Se,button:"right"}).catch(()=>{}))}},500);return}if(le.touches.length===2){A.current&&clearTimeout(A.current),S.current=!0,_.current=!0;const we=le.touches[1].clientX-le.touches[0].clientX,Se=le.touches[1].clientY-le.touches[0].clientY;I.current=Math.sqrt(we*we+Se*Se),D.current=i.current,P.current={x:(le.touches[0].clientX+le.touches[1].clientX)/2,y:(le.touches[0].clientY+le.touches[1].clientY)/2}}},ie=le=>{const Ne=t.current;if(Ne&&le.target instanceof Node&&Ne.contains(le.target)&&le.preventDefault(),le.touches.length===1&&N.current){const we=le.touches[0],Se=we.clientX-N.current.x,me=we.clientY-N.current.y;if(!S.current&&x.current){const q=we.clientX-x.current.x,W=we.clientY-x.current.y;Math.sqrt(q*q+W*W)>8&&(S.current=!0,A.current&&clearTimeout(A.current))}if(S.current)if(G.current==="mouse"){const q=de(Se,me),W=y.current||{nx:.5,ny:.5},X=Math.max(0,Math.min(1,W.nx+q.dnx)),K=Math.max(0,Math.min(1,W.ny+q.dny));y.current={nx:X,ny:K},C({nx:X,ny:K}),k(`Cursor: ${Math.round(X*100)}%, ${Math.round(K*100)}%`),te(X,K,i.current);const ue=Date.now();ue-f.current>=30&&(f.current=ue,H.current("input_mouseMoved",{nx:X,ny:K}).catch(()=>{}))}else if(i.current>1){const q=t.current;if(q){const W=q.clientWidth,X=q.clientHeight,K=c.current+Se/W*100,ue=d.current+me/X*100,Pe=v(K,ue,i.current);p(Pe.x),u(Pe.y),c.current=Pe.x,d.current=Pe.y}}else{const q=Z(we);if(q){const W=Date.now();W-f.current>=40&&(f.current=W,k("Scroll"),H.current("input_wheel",{nx:q.nx,ny:q.ny,deltaX:Math.round(-Se*2.5),deltaY:Math.round(-me*2.5)}).catch(()=>{}))}}N.current={x:we.clientX,y:we.clientY};return}if(le.touches.length===2&&I.current!==null){const we=le.touches[1].clientX-le.touches[0].clientX,Se=le.touches[1].clientY-le.touches[0].clientY,q=Math.sqrt(we*we+Se*Se)/I.current,W=(le.touches[0].clientX+le.touches[1].clientX)/2,X=(le.touches[0].clientY+le.touches[1].clientY)/2,K=W-P.current.x,ue=X-P.current.y,Pe=Math.abs(q-1)>.03;if(G.current==="mouse"){if(Pe){const ce=Math.max(o,Math.min(5,D.current*q));m(ce),i.current=ce}else if(Math.abs(K)>2||Math.abs(ue)>2){const ce=y.current||{nx:.5,ny:.5},F=Date.now();F-f.current>=30&&(f.current=F,k("Scroll"),H.current("input_wheel",{nx:ce.nx,ny:ce.ny,deltaX:Math.round(-K*3),deltaY:Math.round(-ue*3)}).catch(()=>{}))}}else{const ce=Math.max(o,Math.min(5,D.current*q));m(ce),i.current=ce;const F=t.current;if(F&&ce>1){const pe=F.clientWidth,xe=F.clientHeight,U=c.current+K/pe*100,be=d.current+ue/xe*100,je=v(U,be,ce);p(je.x),u(je.y),c.current=je.x,d.current=je.y}}P.current={x:W,y:X}}},Y=le=>{var Ne;if(A.current&&clearTimeout(A.current),I.current=null,le.touches.length===1&&_.current){const we=le.touches[0];x.current={x:we.clientX,y:we.clientY,time:Date.now()},N.current={x:we.clientX,y:we.clientY},S.current=!0;return}if(le.touches.length===0){if(_.current){_.current=!1,S.current=!1;return}if(le.changedTouches.length===1){const we=le.changedTouches[0],Se=Date.now(),me=Se-(((Ne=x.current)==null?void 0:Ne.time)||0),q=x.current?we.clientX-x.current.x:0,W=x.current?we.clientY-x.current.y:0,X=Math.sqrt(q*q+W*W);if(G.current==="mouse"){if(me<L||me>O||X>E){S.current=!1;return}const K=y.current||Z(we);K&&(k(`Click: ${Math.round(K.nx*100)}%, ${Math.round(K.ny*100)}%`),h(K.nx,K.ny,"left"),H.current("input_click",{...K}).catch(()=>{}))}else{if(S.current){S.current=!1;return}if(me<M||me>$||X>R){S.current=!1;return}const K=Z(we);if(!K)return;Se-T.current<300?(k("Double tap"),h(K.nx,K.ny,"double"),H.current("input_click",{...K,clickCount:2}).catch(()=>{}),T.current=0):(k(`Tap: ${Math.round(K.nx*100)}%, ${Math.round(K.ny*100)}%`),h(K.nx,K.ny,"left"),H.current("input_click",{...K}).catch(()=>{}),T.current=Se)}}S.current=!1}};return J.addEventListener("touchstart",B,{passive:!1}),J.addEventListener("touchmove",ie,{passive:!1}),J.addEventListener("touchend",Y,{passive:!1}),()=>{J.removeEventListener("touchstart",B),J.removeEventListener("touchmove",ie),J.removeEventListener("touchend",Y),A.current&&clearTimeout(A.current)}},[e,t,n,o,i,c,d,p,u,m,f,k,h,v]),{cursorPos:j,cursorPosRef:y,handleToggleInputMode:()=>{a(J=>{const Z=J==="touch"?"mouse":"touch";return Z==="mouse"&&z(),Z})},handleZoomReset:()=>{const J=w?b:1;m(J),i.current=J,p(0),u(0),c.current=0,d.current=0}}}function Tu({onAction:e,addLog:t,connState:n,connScreenshot:r,screenshotUsage:a,transportType:o}){const i=l.useRef(null),c=l.useRef(null),d=l.useRef(null),[p,u]=l.useState(null),[m,f]=l.useState(""),[,g]=l.useState(!1),[k,h]=l.useState([]),v=l.useRef(0),[w,b]=l.useState(!1),[j,C]=l.useState(!1),y=typeof window<"u"&&window.matchMedia("(max-width: 768px)").matches,[x,N]=l.useState(y?"mouse":"touch"),[S,A]=l.useState(1),T=l.useRef(!1),[I,D]=l.useState(1),[P,_]=l.useState(0),[G,H]=l.useState(0);jr("RemoteView",{connState:n,hasScreenshot:!!r,inputMode:x,zoom:I,panX:P,panY:G,isMenuOpen:w,isImeOpen:j});const L=l.useRef(0),O=l.useRef(I),E=l.useRef(P),M=l.useRef(G);l.useEffect(()=>{O.current=I},[I]),l.useEffect(()=>{E.current=P},[P]),l.useEffect(()=>{M.current=G},[G]),l.useEffect(()=>{var me;(me=i.current)==null||me.focus()},[]);const $=n==="connected",R=r,z=$?"Connected. Waiting for first frame...":n==="connecting"?"Connecting to Host...":"Reconnecting to Host...",Q=$?"The remote stream is warming up":"Waiting for the remote stream to catch up";l.useEffect(()=>{if(!y||T.current||!R)return;const me=d.current,q=c.current;if(!me||!q)return;const W=()=>{const X=q.clientWidth,K=q.clientHeight,ue=me.naturalWidth,Pe=me.naturalHeight;if(!ue||!Pe||!X||!K)return;const ce=Math.min(X/ue,K/Pe),pe=Math.max(X/ue,K/Pe)/ce;pe>1.01&&(A(pe),D(pe),O.current=pe),T.current=!0};me.complete&&me.naturalWidth?W():me.addEventListener("load",W,{once:!0})},[R,y]);const ne=.5;l.useEffect(()=>{I<=ne&&(_(0),H(0))},[I,ne]);const J=(me,q,W)=>{if(W<=ne)return{x:0,y:0};const X=(W-1)/(2*W)*100,K=(W-1)/(2*W)*100;return{x:Math.max(-X,Math.min(X,me)),y:Math.max(-K,Math.min(K,q))}},Z=(me,q)=>{if(!d.current)return null;const W=d.current.getBoundingClientRect();return!W.width||!W.height?null:{nx:Math.max(0,Math.min(1,(me-W.left)/W.width)),ny:Math.max(0,Math.min(1,(q-W.top)/W.height))}},de=(me,q,W)=>{const X=c.current;if(!X)return;const K=X.getBoundingClientRect(),ue=++v.current;h(Pe=>[...Pe,{id:ue,x:me-K.left,y:q-K.top,type:W}]),setTimeout(()=>h(Pe=>Pe.filter(ce=>ce.id!==ue)),600)},te=(me,q,W)=>{const X=d.current,K=c.current;if(!X||!K)return;const ue=X.getBoundingClientRect(),Pe=K.getBoundingClientRect(),ce=X.naturalWidth||ue.width,F=X.naturalHeight||ue.height,pe=ce/F,xe=ue.width/ue.height;let U,be,je,ge;pe>xe?(U=ue.width,be=ue.width/pe,je=0,ge=(ue.height-be)/2):(be=ue.height,U=ue.height*pe,je=(ue.width-U)/2,ge=0);const Ie=ue.left-Pe.left+je+U*me,et=ue.top-Pe.top+ge+be*q,Ze=++v.current;h(rt=>[...rt,{id:Ze,x:Ie,y:et,type:W}]),setTimeout(()=>h(rt=>rt.filter(he=>he.id!==Ze)),600)},B=async me=>{var W;const q=Z(me.clientX,me.clientY);if(q){u(`Click: ${Math.round(q.nx*100)}%, ${Math.round(q.ny*100)}%`),de(me.clientX,me.clientY,"left"),(W=i.current)==null||W.focus();try{const X=await e("input_click",{nx:q.nx,ny:q.ny});X!=null&&X.success||t(`❌ Click failed: ${X==null?void 0:X.error}`)}catch(X){t(`❌ Click error: ${X.message||X}`)}}},ie=async(me,q,W,X=0)=>{try{await e("input_key",{type:W?"char":"keyDown",key:me,code:q,text:W?me:void 0,unmodifiedText:W?me:void 0,modifiers:X})}catch(K){t(`❌ Key error: ${K.message||K}`)}},Y=async me=>{if(me.target.tagName==="INPUT")return;["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Backspace","Tab","Enter","Escape"].includes(me.key)&&me.preventDefault();let W=0;me.altKey&&(W|=1),me.ctrlKey&&(W|=2),me.metaKey&&(W|=4),me.shiftKey&&(W|=8),u(`Key: ${me.key}`),await ie(me.key,me.code,me.key.length===1,W)},le=async me=>{if(me.key==="Enter"){if(me.nativeEvent.isComposing)return;if(m){const q=m;f(""),u(`IME Sent: ${q}`);try{const W=await e("input_type",{text:q});W!=null&&W.success||t(`❌ IME error: ${W==null?void 0:W.error}`)}catch(W){t(`❌ IME error: ${W.message}`)}}else u("Key: Enter"),await ie("Enter","Enter",!1)}};l.useEffect(()=>{const me=i.current;if(!me)return;const q=W=>{var X;if((X=d.current)!=null&&X.contains(W.target)){W.preventDefault();const K=Date.now();if(K-L.current<40)return;L.current=K;const ue=Z(W.clientX,W.clientY);if(!ue)return;u(`Scroll: ${Math.round(W.deltaY)}`),e("input_wheel",{nx:ue.nx,ny:ue.ny,deltaX:Math.round(W.deltaX),deltaY:Math.round(W.deltaY)}).catch(()=>{})}};return me.addEventListener("wheel",q,{passive:!1}),()=>me.removeEventListener("wheel",q)},[e]);const{cursorPos:Ne,handleToggleInputMode:we,handleZoomReset:Se}=Bb({containerRef:i,viewportRef:c,imgRef:d,inputMode:x,setInputMode:N,minZoom:ne,zoomRef:O,panXRef:E,panYRef:M,setPanX:_,setPanY:H,setZoom:D,lastWheelTimeRef:L,onAction:e,setLastActionStatus:u,spawnRippleFromNormalized:te,clampPan:J,isMobile:y,mobileFillZoom:S});return s.jsxs("div",{ref:i,className:"flex-1 flex flex-col bg-black relative overflow-hidden outline-none touch-none",onKeyDown:Y,onContextMenu:me=>me.preventDefault(),onFocus:()=>g(!0),onBlur:()=>g(!1),tabIndex:0,children:[s.jsxs("div",{ref:c,className:"flex-1 relative overflow-hidden flex items-center justify-center bg-black",children:[R?s.jsx("img",{ref:d,src:R,alt:"Remote View",style:{display:"block",maxWidth:"100%",maxHeight:"100%",width:"auto",height:"auto",transform:`scale(${I}) translate(${P}%, ${G}%)`,transformOrigin:"center center",cursor:x==="mouse"?"default":"crosshair",userSelect:"none",WebkitTouchCallout:"none"},onClick:B,onContextMenu:me=>me.preventDefault(),onDragStart:me=>me.preventDefault()}):s.jsx(Hb,{waitingLabel:z,waitingHint:Q,transportType:o}),x==="mouse"&&R&&s.jsx(_b,{cursorPos:Ne,viewportRef:c,imgRef:d}),k.map(me=>{const W={left:"59,130,246",right:"239,68,68",double:"34,197,94"}[me.type];return s.jsxs("div",{style:{position:"absolute",left:me.x,top:me.y,pointerEvents:"none",zIndex:200,transform:"translate(-50%, -50%)"},children:[s.jsx("div",{style:{width:40,height:40,borderRadius:"50%",border:`2px solid rgba(${W}, 0.8)`,animation:"click-ripple-ring 0.5s ease-out forwards",position:"absolute",left:-20,top:-20}}),s.jsx("div",{style:{width:8,height:8,borderRadius:"50%",background:`rgba(${W}, 0.9)`,boxShadow:`0 0 12px rgba(${W}, 0.6)`,animation:"click-ripple-dot 0.4s ease-out forwards",position:"absolute",left:-4,top:-4}})]},me.id)})]}),s.jsx($b,{inputMode:x,onToggleInputMode:we,isImeOpen:j,setIsImeOpen:C,isMenuOpen:w,setIsMenuOpen:b,imeText:m,setImeText:f,handleImeSubmit:le,isConnActive:$,zoom:I,isMobile:y,mobileFillZoom:S,onZoomOut:()=>D(me=>Math.max(.5,me-.25)),onZoomReset:Se,onZoomIn:()=>D(me=>Math.min(5,me+.25)),transportType:o,screenshotUsage:a,lastActionStatus:p}),s.jsx("style",{children:`
|
|
9
9
|
@keyframes slideUp {
|
|
10
10
|
from { opacity: 0; transform: translateY(6px); }
|
|
11
11
|
to { opacity: 1; transform: translateY(0); }
|