openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
29 lines • 329 kB
JavaScript
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./catalog-terminal-start-CAl9O1Oq.js","./catalog-terminal-start-CKAPUE5U.js","./control-ui-core-D-VUH4Gq.css"])))=>i.map(i=>d[i]);
import{n as e}from"./rolldown-runtime-8BhlS34s.js";import{At as t,Ba as n,Bi as r,C as i,Ci as a,Cr as o,Dt as s,Et as c,Gi as l,Gt as u,Hi as d,Ht as f,Ii as p,Ja as m,Ji as h,Kt as g,Lr as _,Mt as v,Oa as y,Pa as b,Rr as x,Si as S,Sr as C,St as w,T as ee,Tt as T,Ui as E,Ut as te,Vt as ne,Wi as re,Wt as D,Ya as ie,Yi as O,Za as k,_i as ae,ai as oe,br as se,ca as ce,ci as le,di as ue,eo as A,gt as de,hi as fe,ii as pe,io as j,ka as me,li as M,no as he,oi as ge,ri as _e,ro as N,ti as ve,to as ye,vt as be,w as xe,yr as Se,yt as P,zi as Ce,zt as we}from"./control-ui-foundation-ZY_Flbbd.js";import{Al as Te,Ar as Ee,Bs as F,Ct as De,Cu as Oe,Dc as ke,Di as Ae,Dt as je,Ec as Me,El as Ne,Et as Pe,Eu as Fe,Fl as Ie,Fr as Le,Gl as I,I as Re,Jl as ze,Ml as Be,Ms as Ve,Mt as He,Nl as Ue,Nt as We,Ol as Ge,Or as Ke,Os as qe,Pl as Je,Pt as Ye,Qi as Xe,Qt as Ze,R as Qe,Rs as $e,St as et,Tl as tt,Tt as nt,Tu as rt,Ul as it,Ur as at,Wl as ot,Xi as st,Xl as ct,Xt as lt,Yi as ut,Yt as dt,Zc as ft,Zl as L,Zt as pt,an as mt,bc as ht,bt as gt,bu as R,cc as _t,dl as z,eu as vt,fl as yt,gl as bt,gt as xt,hc as St,hr as Ct,hu as B,jl as wt,jr as Tt,js as Et,jt as Dt,kl as Ot,kr as kt,ks as At,li as jt,ll as Mt,lt as Nt,mr as Pt,mt as Ft,nl as V,nt as It,pa as Lt,pr as Rt,pt as zt,ql as H,rt as Bt,sc as Vt,sl as Ht,sn as Ut,tl as Wt,ui as Gt,ul as Kt,ut as qt,uu as U,vc as Jt,vt as Yt,wl as Xt,wt as Zt,xc as Qt,xt as $t,xu as W,yt as en,z as tn,zs as nn}from"./control-ui-core-3P365fbR.js";import{$ as rn,A as an,D as on,F as sn,G as cn,H as ln,I as un,J as dn,K as fn,L as pn,M as mn,N as hn,P as gn,R as _n,T as vn,U as yn,V as bn,W as xn,X as Sn,Y as Cn,_ as wn,d as Tn,dt as En,et as Dn,f as On,g as kn,h as An,i as jn,j as Mn,l as Nn,lt as Pn,p as Fn,q as In,r as Ln,tt as Rn,u as zn,ut as Bn,v as Vn,w as Hn,y as Un,z as Wn}from"./control-ui-boot-shared-JlZTSJEC.js";import{$n as Gn,$r as Kn,$t as qn,At as Jn,Ea as Yn,La as Xn,Ot as Zn,Ra as Qn,Ua as $n,_n as er,co as tr,dr as nr,en as rr,er as ir,fn as ar,go as or,kt as sr,qa as cr,rr as lr,tn as ur,ur as dr,va as fr,wa as pr}from"./control-ui-core-CFW9Qtjn.js";import{$ as mr,B as hr,I as gr,R as _r,X as vr,Y as yr,g as br}from"./lit-runtime-P5vbNq6b.js";import{$ as xr,A as Sr,At as Cr,Et as wr,O as Tr,Tt as Er,a as Dr,at as Or,c as kr,ct as Ar,d as jr,dt as Mr,et as Nr,ft as Pr,gt as Fr,l as Ir,lt as Lr,mt as Rr,nt as zr,o as Br,ot as Vr,pt as Hr,s as Ur,st as Wr,tt as Gr,u as Kr,ut as qr,v as Jr,vt as Yr,wt as Xr,y as Zr}from"./control-ui-boot-shared-3SP_aL-Y.js";import{D as Qr,E as $r,O as ei,P as ti,St as ni,Ut as ri,Vt as ii,bt as ai,ht as oi,j as si,k as ci,mt as li,pt as ui}from"./control-ui-boot-shared-Rs4iS2kF.js";import{c as di,d as fi,l as pi}from"./gateway-runtime-5YzSCmfV.js";import{D as mi,N as hi,O as gi,P as _i,at as vi,gt as yi,j as bi,mt as xi,rt as Si}from"./control-ui-boot-shared-DBJri5ri.js";import{S as Ci,_ as wi,n as Ti,t as Ei}from"./control-ui-boot-shared-90V688bk.js";import{Bo as Di,En as Oi,Fo as ki,Io as Ai,Lr as ji,Mr as Mi,Nr as Ni,Ro as Pi,Sn as Fi,bn as Ii,cr as Li,kn as Ri,pr as zi,sr as Bi,vr as Vi,zo as Hi,zr as Ui}from"./control-ui-boot-shared-CG9HtEG-.js";import{$t as Wi,Bn as Gi,Rt as Ki,Vn as qi,Zt as Ji,zn as Yi,zt as Xi}from"./control-ui-boot-shared-73R4ErOy.js";import{$ as Zi,A as Qi,G as $i,H as ea,K as ta,M as na,N as ra,P as ia,Q as aa,V as oa,Z as sa,_t as ca,ct as la,ht as ua,j as da,lt as fa,nt as pa,pt as ma,q as ha,rt as ga,vt as _a,w as va}from"./control-ui-boot-shared-BykNRHBP.js";import{N as ya,P as ba}from"./markdown-runtime-Hc-lvqnn.js";import{_ as xa,h as Sa}from"./control-ui-boot-shared-BR12heUA.js";import{_i as Ca,hi as wa}from"./control-ui-boot-shared-CApmg5ot.js";function Ta(e){let t;return n=>{let r=()=>{let r=n.state.scopeId;if(t===void 0){t=r;return}if(r===t)return;let i=t;t=r,e(r,i)};return r(),n.subscribe(r)}}function Ea(){return(Ea=e((()=>{})))()}var Da,Oa;function ka(){return(ka=e((()=>{W(),Da={newSession:{title:R.newSession.title,hint:R.newSession.hint,environments:`Environments`,gateway:`Gateway · local`,cloudWorkerMachine:`{profile} · {machine}`,cloudWorkerOsMachine:`{profile} · {os} · {machine}`,cloudWorkerOs:`{profile} · {os}`,cloudRuntimeUnsupported:`The {runtime} runtime does not support cloud workers.`,cloudProfileRuntimeUnsupported:`The {runtime} runtime cannot use this cloud worker. Choose a compatible cloud worker or run locally.`,deviceRuntimeUnsupported:`This runtime does not support paired devices`,placementStartFailed:`The session was created, but startup needs attention: {error}`,placementCreateFailed:`Couldn't prepare session recovery. Your draft has been kept.`,placementStillStarting:`Worker setup is still in progress. Retry to check the existing worker; your message has not been sent.`,placementCompletionUnconfirmed:`Could not confirm whether worker setup finished. Retry to check again; your message has not been sent.`,placementReloadBlocked:R.newSession.placementReloadBlocked,placementCancelled:`Session setup was interrupted and the temporary session was cleaned up. Your prompt is kept here.`,discardUnsavedAndReload:R.newSession.discardUnsavedAndReload,yourDevices:`Your devices`,autoDeviceSub:`Least-busy device`,autoDeviceSubEligible:`First eligible device`,cloud:`Cloud`,machine:`Machine`,operatingSystem:`Operating system`,runsOn:`Runs on {place}`,browse:`Browse folders`,worktree:`Worktree`,checkingGit:`Checking Git availability…`,gitCheckUnavailable:`Couldn't verify Git for this folder. Choose it again to retry.`,starting:`Starting…`,createFailed:`Couldn't create the session.`,checkoutCurrentNote:`Works in the selected folder on its current branch.`,preferenceSaveUnconfirmed:`Saving your new-session choices could not be confirmed. Check them before starting a session.`,worktreeNameClearUnconfirmed:`Session accepted, but clearing the saved worktree name could not be confirmed. Check Name before starting another worktree.`,agent:`Agent`,agents:`Agents`,where:`Where`,gatewayNamed:`Gateway · {name}`,cloudWorker:`Cloud · {profile}`,cloudWorkerProvider:`Cloud worker provider: {provider}`,cloudRecoveryUnavailable:`Cloud workers are unavailable because this connection does not support task recovery. Reconnect or update the Gateway.`,placementSyncsFolder:`Syncs {folder} to the selected runner`,placementClonesRepository:`Clones {folder} on the selected runner. No Gateway checkout is created.`,folder:`Folder`,autoDevice:`Auto`,neverConnected:`Never connected`,offlineFor:`Offline for {duration}`,lastSeen:`Last seen {time}`,nodeUpdateRequired:`Update required: run {updateCommand}, then reconnect. For a headless node, run {restartCommand}.`,nodeCommandPendingApproval:`Ask an administrator to approve the pending {command} request, or pick another device.`,nodeCommandUndeclared:`Make {command} available on this device, then reconnect, or pick another device.`,nodeCommandUnauthorized:`Authorize {command} in the Gateway node command policy, or pick another device.`,capabilityCamera:`Camera`,capabilityLocation:`Location`,capabilityTalk:`Talk`,capabilityScreenCapture:`Screen capture`,capabilityCanvas:`Canvas`,capabilityVoice:`Voice`,environmentDisposable:`Disposable`,environmentPersistent:`Persistent`,registerProject:`Register as project`,machineShape:`{cpu} vCPU · {memory} GB`,machineCpu:`{cpu} vCPU`,machineMemory:`{memory} GB`,machineDefault:`Default`,browseRequiresAdmin:`To browse outside agent workspaces, open Inbox, select Limited access, request admin, then approve in Devices.`,connectMachine:`Connect a device`,browserUp:`Parent folder`,browserUse:`Use this folder`,browserEmpty:`No subfolders`,browserNoMatches:`No matching folders`,browserLoadFailed:`Couldn't list that folder.`,hiddenFolder:`Hidden folder`,worktreeUnavailable:`Selected folder is not a Git checkout`,worktreeBaseRef:`From`,worktreeBranchesLimited:`Suggestions are limited. Enter any branch or commit.`,worktreeBranchesUnavailable:`Branch suggestions are unavailable. Enter a branch or commit.`,worktreeName:`Name`,worktreeNamePlaceholder:`Named from the session title`,worktreeBranchNote:`Creates branch {branch} in a separate checkout.`,worktreeBranchFromTitleNote:`Creates a branch from the session title in a separate checkout.`,worktreeNameInvalid:`Use lowercase letters, digits, and dashes.`,incognito:`Incognito`,incognitoDescription:`Keep this session for 24 hours or until the Gateway restarts, whichever comes first`,draft:`Draft`,draftDescription:`Keep this session to yourself until you publish it`,messagePlaceholder:`What should this session work on?`,dictate:`Dictate`,readingAttachment:`Reading attachment`,start:`Start session`,created:`Session created`,startInTerminal:`Start in terminal`,nativeTerminalHint:`Start the native CLI on the selected machine using its own account and configuration. This does not create an OpenClaw Chat.`,chooseNativeHost:`Choose a native CLI host`,nativeHostsUnavailable:`No native CLI is available. Install it on the Gateway or connect a machine with CLI access, then reconnect to the Gateway.`,nativeTerminalPrompt:`Optional initial prompt for the native CLI`,terminalNodeFolder:`Existing absolute folder on this node`,terminalAttachmentsUnsupported:`Remove attachments before starting a native CLI. Add files from the terminal after it opens.`,createOutcomeUnknown:`The Gateway changed while this session was starting. Check recent sessions before starting this task again.`,cliAgentsGroup:`CLI agents`,cliAgentsUnavailable:`CLI agents unavailable`,placementSetupInterrupted:`This session's runner setup was interrupted. Check recent sessions before starting this task again.`,catalogUnavailable:`This session target is unavailable.`,placementNotReady:`The selected runner isn't ready yet. Try again in a moment.`,nodeUnavailable:`The selected device is unavailable. Pick another place.`,terminalCapabilityOverridesUnsupported:`Clear session capability overrides before starting in a terminal.`,checkout:`Checkout`,checkoutCurrent:`Current checkout`,checkoutWorktree:`New worktree`,checkoutWorktreeNamed:`Worktree · {name}`,checkoutWorktreeSub:`Isolated copy of the repo`,checkoutWorktreeFrom:`New worktree from {branch}`,checkoutCloud:`Starting branch`,checkoutCloudFrom:`From {branch}`,checkoutRepository:`Remote checkout`,checkoutRepositoryFrom:`Remote checkout from {branch}`,checkoutRemoteLocked:`Devices and cloud run in a worktree`,local:`Local`,folderPlaceholder:`Agent workspace`,projects:`Projects`,projectsAdminHint:`Admins can register projects from Browse folders`,projectSearchPlaceholder:`Search projects or paste a Git URL`,githubProjects:`GitHub`,githubTokenHint:`No Control UI GitHub credential or shared Gateway environment token is configured; public GitHub results only.`,cloneProject:`Clone`,recentFolders:`Recent`,what:`What`,newWorkspace:`New workspace`,newWorkspaceDescription:`Start in an empty folder for this session.`,remoteSourceUnavailable:`This folder cannot provide a Git checkout. Select New workspace to start empty, or choose a repository.`,environmentSearchPlaceholder:`Search environments`,environmentSearchEmpty:`No matching environments`,gatewayHost:`Gateway host`,device:`Device`,environmentDetails:`Show details for {name}`,concurrentSessionsValue:`{used} of {total} session slots in use`,autoDeviceChoose:`Any available device`,manageCloudWorkers:`Manage cloud workers`,persistentEnvironmentHint:`Reusable host`,disposableEnvironmentHint:`Disposable host`,sessionHostingAction:`Session hosting is disabled. Run the following command on the device:`,updateAction:`This device needs an update. Run the following command:`,reconnectAction:`Then reconnect the device. For a headless device, run:`,runsOnGateway:`Runs on your gateway`,autoDeviceHint:`Chooses the least-busy connected device`,autoDeviceHintEligible:`Chooses the first eligible connected device`,autoDeviceInfo:`About automatic device selection`,autoDeviceScope:`Connected devices only`,restoringPreferences:`Restoring your last session setup…`,checkingPlace:`Checking the selected place…`,agentsUnavailable:`No agents are available on this Gateway yet.`,loadingAgentDefaults:`Refreshing agent defaults…`,agentDefaultsUnavailable:`Could not refresh agent defaults. Reload to try again.`,terminalHostUnavailable:`Native CLI host unavailable. Check that the CLI is installed and the node is connected with its fresh-start command approved, then retry the catalog.`,terminalDisabled:`Enable CLI agents and terminals in Gateway settings to start a native CLI.`,terminalPlacementUnsupported:`Native CLI sessions use a specific host, not OpenClaw worker placement. Reset this draft and choose a native host.`,terminalNeedsFolder:`Pick a folder before starting in a terminal.`,noSessionHosts:`No session hosts are paired. Connect a machine with session hosting enabled.`,deviceUnavailable:`Device unavailable. Reconnect it and try again.`,sessionHostingDisabled:`Session hosting is disabled. Run openclaw connect --service --session-host on the device.`,deviceCapacityUnavailable:`Worker capacity is unavailable. Restart the device session host and try again.`,deviceNoSlots:`No worker slots are available. Wait for a slot or pick another device.`,connectMachineTitle:`Connect a machine`,connectMachineDescription:`Run this command on the machine you want to connect.`,connectMachineGenerating:`Creating a secure connection link…`,connectMachineFailed:`Couldn't create a connection link.`,connectMachineMissingUrl:`The Gateway did not return a join URL. Update it and try again.`,connectMachineUnavailable:`Reconnect to the Gateway and try again.`,connectMachineTeamHint:`Running it pairs that machine as a device for your team.`,connectMachineSingleUse:`This link is single-use and expires soon.`,connectMachineSingleUseExpires:`This link is single-use and expires at {time}.`,connectMachineFreshCode:`Mint fresh code`,connectMachineRefreshing:`Minting…`,connectMachineManageDevices:`Manage devices`}},Oa=Object.assign(()=>{Object.assign(R.newSession,Da.newSession)},{catalog:Da})})))()}function Aa(e,t){if(!Array.isArray(t)||t.length===0||t.length>10)return;let n=[],r=0;for(let i of t){if(!h(i)||typeof i.profileId!=`string`||!i.profileId.trim()||i.profileId.length>256||typeof i.start!=`number`||!Number.isSafeInteger(i.start)||typeof i.end!=`number`||!Number.isSafeInteger(i.end)||i.start<r||i.end<=i.start+1||i.end>e.length||e[i.start]!==`@`||/[\p{L}\p{N}\p{M}_@.%+-]/u.test(e[i.start-1]??``)||!e.slice(i.start+1,i.end).trim())return;for(let t=i.start;t<i.end;t+=1)if(e.charCodeAt(t)<32)return;n.push({profileId:i.profileId,start:i.start,end:i.end}),r=i.end}return n}function ja(e,t,n=[],r){if(!r&&e===t||n.length===0)return n;let i=0;for(;i<e.length&&i<t.length&&e[i]===t[i];)i+=1;let a=0,o=Math.min(e.length,t.length);for(;a<o&&e[e.length-a-1]===t[t.length-a-1];)a+=1;let s=e.length-a;if(i+a>o&&(s=i+Math.max(0,e.length-t.length),i=o-a),r?.value===e&&!r.inputType.startsWith(`history`)){let n=e.length-t.length,a=r.start,o=r.end;a===o&&r.inputType.startsWith(`delete`)&&n>0&&(r.inputType.endsWith(`Backward`)?a-=n:o+=n);let c=t.length-e.length+o-a;a>=0&&c>=0&&e.slice(0,a)===t.slice(0,a)&&e.slice(o)===t.slice(a+c)&&(i=a,s=o)}let c=t.length-e.length;return Aa(t,n.flatMap(e=>e.end<=i?e.end===i&&/[\p{L}\p{N}\p{M}_-]/u.test(t[i]??``)?[]:[e]:e.start>=s?[{...e,start:e.start+c,end:e.end+c}]:[]))??[]}function Ma(e,t=[]){let n=e.trim(),r=e.length-e.trimStart().length,i=Aa(n,t.map(e=>({...e,start:e.start-r,end:e.end-r})));return{text:n,...i?{mentions:i}:{}}}function Na(){return(Na=e((()=>{ti()})))()}function Pa(e,t,n){if(!h(e))return null;let r=e;return Object.keys(r).some(e=>!Za.has(e))||r.key!==t||r.agentId!==n||r.message!==``||r.worktreeSource!==void 0&&(!Ci($r.properties.worktreeSource,r.worktreeSource)||r.worktree!==!0||r.repository!==void 0||r.projectId!==void 0||r.cwd!==void 0||r.worktreeBaseRef!==void 0||r.catalogId!==void 0)||(r.repository===void 0?r.worktree!==!0:!Ci($r.properties.repository,r.repository)||r.worktree!==void 0||r.projectId!==void 0||r.cwd!==void 0||r.worktreeBaseRef!==void 0||r.worktreeName!==void 0||r.catalogId!==void 0)||r.incognito!==void 0&&r.incognito!==!0||r.visibility!==void 0&&r.visibility!==`draft`||r.fastMode!==void 0&&!Ci($r.properties.fastMode,r.fastMode)||r.permissionMode!==void 0&&!Ci(ui,r.permissionMode)||r.toolOverrides!==void 0&&!Ci(li,r.toolOverrides)||r.titleSource!==void 0&&!Ci($r.properties.titleSource,r.titleSource)||r.projectId!==void 0&&r.cwd!==void 0||Xa.some(e=>r[e]!==void 0&&!k(r[e]))?null:r}function Fa(e){try{let t=JSON.parse(e);return h(t)?t:null}catch{return null}}function Ia(e){return h(e)?e.kind===`profile`&&Object.keys(e).every(e=>e===`kind`||e===`profileId`||e===`os`||e===`machineClass`)&&k(e.profileId)&&(e.os===void 0||k(e.os)&&e.os.length<=64)&&(e.machineClass===void 0||k(e.machineClass)&&e.machineClass.length<=128)||e.kind===`device`&&Object.keys(e).every(e=>e===`kind`||e===`deviceId`)&&k(e.deviceId)?e:e.kind===`auto-device`&&Object.keys(e).every(e=>e===`kind`)?{kind:`auto-device`}:null:null}function La(e,t,n,r){if(e.createParams?.incognito===!0||!k(e.sessionKey)||r!==void 0&&e.sessionKey!==r||!k(e.messageId)||typeof e.message!=`string`||!k(e.message)&&!e.attachments?.length||e.attachments!==void 0&&!Array.isArray(e.attachments)||!Ia(e.target)||!k(e.agentId)||e.gatewayUrl!==t||e.recoveryScope!==n||e.phase!==`creating`&&e.phase!==`dispatching`&&e.phase!==`sending`&&e.phase!==`paused`||e.phase===`paused`&&(e.reason!==`not-sent`&&e.reason!==`rejected`&&e.reason!==`unconfirmed`||!k(e.error)||e.error.length>Ya)||e.phase===`creating`&&!Pa(e.createParams,e.sessionKey,e.agentId))return null;let{mentions:i,...a}=e,o=Aa(e.message,i);return i!==void 0&&(!Array.isArray(i)||(o?.length??0)!==i.length)?null:{...a,...o?{mentions:o}:{}}}function Ra(e,t){try{return e.removeItem(t),e.getItem(t)===null}catch{return!1}}function za(e,t,n,r,i){try{let a=e.getItem(t);if(a===null)return null;let o=Fa(a),s=o?La(o,n,r,i):null;return!s||t!==pt(n,r,s.sessionKey)?(Ra(e,t),null):s}catch{return null}}function Ba(e,t,n,r){let i=pt(r.gatewayUrl,r.recoveryScope,r.sessionKey),a=JSON.stringify(r);try{if(e.removeItem(t),e.getItem(t)!==null)return null;e.setItem(i,a);let n=za(e,i,r.gatewayUrl,r.recoveryScope,r.sessionKey);if(n)return n}catch{}Ra(e,i);try{e.setItem(t,n)}catch{}return null}function Va(e,t){if(!e||!t)return[];try{let n=globalThis.sessionStorage;if(!n)return[];let r=new Map;for(let i of lt(e,t)){let a=za(n,i,e,t);a&&r.set(a.sessionKey,a)}return[...r.values()].toSorted((e,t)=>e.sessionKey.localeCompare(t.sessionKey))}catch{return[]}}function Ha(e,t,n){for(let r of Va(e,t))Ga({...r,recoveryScope:n})&&qa(e,t,r.sessionKey,r.messageId)}function Ua(e,t,n){if(!e||!t||!n)return null;try{let r=globalThis.sessionStorage;return r?za(r,pt(e,t,n),e,t,n):null}catch{return null}}function Wa(e){let{gatewayUrl:t,recoveryScope:n,sessionKey:r}=e,i=La(e,t,n,r);if(!t||!n||!i)return!1;try{let e=globalThis.sessionStorage;if(!e)return!1;let a=pt(t,n,r);return e.setItem(a,JSON.stringify(i)),!!za(e,a,t,n,r)}catch{return!1}}function Ga(e,t=e.messageId){let n=Ua(e.gatewayUrl,e.recoveryScope,e.sessionKey);return n&&n.messageId!==t?!1:Wa(e)}function Ka(e,t){if(e===t.sessionKey)return Ga(t);try{let n=globalThis.sessionStorage;if(!n||!e)return!1;let r=pt(t.gatewayUrl,t.recoveryScope,e),i=n.getItem(r),a=za(n,r,t.gatewayUrl,t.recoveryScope,e);if(!i||!a)return Ga(t);if(a.messageId!==t.messageId)return!1;let o=za(n,pt(t.gatewayUrl,t.recoveryScope,t.sessionKey),t.gatewayUrl,t.recoveryScope,t.sessionKey);return o?o.messageId===t.messageId&&Ra(n,r):!!Ba(n,r,i,t)}catch{return!1}}function qa(e,t,n,r){if(e&&t)try{let i=globalThis.sessionStorage;if(!i)return;if(n){let a=pt(e,t,n);if(r&&Fa(i.getItem(a)??``)?.messageId!==r)return;Ra(i,a);return}let a=Ze(e,t);for(let e=i.length-1;e>=0;--e){let t=i.key(e);t?.startsWith(a)&&Ra(i,t)}}catch{}}function Ja(e,t,n,r=e.phase===`paused`?e.reason:e.phase===`sending`?`unconfirmed`:`not-sent`){let i={...e,phase:`paused`,reason:r,error:p(I(t),Ya)},a=n&&Ga(i);return n&&!a&&(Ua(e.gatewayUrl,e.recoveryScope,e.sessionKey)?.phase!==`paused`&&qa(e.gatewayUrl,e.recoveryScope,e.sessionKey,e.messageId),i.error=p(`Recovery could not be saved in this tab. Keep this page open.\n${i.error}`,Ya)),{recovery:i,persisted:a}}var Ya,Xa,Za;function Qa(){return(Qa=e((()=>{Qr(),oi(),wi(),Na(),H(),dt(),Ya=4096,Xa=[`category`,`displayName`,`titleSource`,`model`,`agentRuntime`,`contextWindow`,`thinkingLevel`,`worktreeBaseRef`,`worktreeName`,`cwd`,`catalogId`,`projectId`],Za=new Set([`key`,`agentId`,`message`,`worktree`,`worktreeSource`,`repository`,`incognito`,`visibility`,`permissionMode`,`fastMode`,`toolOverrides`,...Xa])})))()}function $a(e,t){if(!t.sendRunId||t.sessionId&&t.sessionId!==(e.sessionInfo?.sessionId??e.sessionId))return;let n=e.inputReceipts?.find(e=>e.runId===t.sendRunId);return n?.state===`pending`&&n.cancelled?`cancelled`:n?.state}function eo(e,t,n=!1){let r=null;if(!t||!Array.isArray(e))return r;for(let i of e){let e=ri(i);if(e&&(!n||e.role===`user`)&&(e.idempotencyKey===t||e.idempotencyKey===`${t}:user`)&&(r=e,e.id!==null||e.sequence!==null))return e}return r}function to(e){let t=E(e),n=E(t?.__openclaw),r=n?.seq,i=n?.id??t?.messageId;return typeof r==`number`&&Number.isSafeInteger(r)&&r>0?`seq:${r}`:typeof i==`string`&&i.trim()?`id:${i}`:null}function no(e){let t=to(e);if(!t)return null;let n=E(e),r=E(n?.__openclaw),{recordTimestampMs:i,...a}=r??{},o=r?{...n,__openclaw:a}:n;try{return`${t}:${JSON.stringify(o)}`}catch{return t}}function ro(e,t){let n=new Set;for(let t of e){let e=to(t);e&&n.add(e)}let r=new Set,i=new Map;for(let e of t){let t=to(e);if(!t||!n.has(t))continue;let a=no(e);a&&(r.add(t),i.set(a,(i.get(a)??0)+1))}return[...e.filter(e=>{let t=to(e);if(!t||!r.has(t))return!0;let n=no(e),a=n?i.get(n)??0:0;return!n||a===0||(i.set(n,a-1),!1)}),...t]}function io(){return(io=e((()=>{ii()})))()}var ao,oo;function so(){return(so=e((()=>{W(),ao={commandPalette:{newSessionSettings:`New session settings`,rememberSettings:`Remember settings for {shortcut}`,rememberUnavailable:`Reconnect to remember settings.`,settingsSaveFailed:`Could not save settings.`},palette:{placeholder:R.palette.placeholder,noResults:`No results found`,noResultsStart:`Press {shortcut} to start a new session.`,startSession:`New session`,startSessionBackground:`Start new session in background`,startingSession:`Starting…`,promptRequired:`Write a prompt to start a session.`,searchingSessions:`Searching sessions…`,searchingCommands:`Searching commands…`,clearSearch:`Clear search`,escapeKey:`esc`,filterLabel:`Filter search results`,filters:{all:`All`,sessions:`Sessions`,messages:`Messages`},searchFailed:`Chat search failed — check the gateway logs and retry`,modelSearchFailed:`Model search unavailable. Change your search to retry.`,searchPartial:`Transcript search unavailable — showing chat titles and metadata`,searchIndexing:`Indexing older messages — search again shortly.`,categories:{search:`Search`,navigation:R.palette.categories.navigation,skills:`Skills`,messages:`In messages`},items:{apps:`Apps`,sessions:`Sessions`,scheduled:`Automations`,skills:`Skills`,plugins:`Plugins`,settings:`Settings`,agents:`Agents`,desktop:`Desktop`},descriptions:{verboseMode:`Toggle verbose mode.`},footer:{navigate:`navigate`,select:`select`,close:`close`,newline:`newline`}},sessionsView:{transcriptSearchTitle:`Search transcripts`,transcriptSearchDescription:`Find exact words or phrases in user and assistant messages across the default agent's sessions.`,transcriptSearchInputLabel:`Search session transcripts`,transcriptSearchPlaceholder:`Search exact words or phrases…`,transcriptSearchAction:`Search`,transcriptSearchClear:`Clear`,transcriptSearchRetry:`Retry`,transcriptSearchSearching:`Searching transcripts…`,transcriptSearchUnavailable:`Transcript search requires a newer Gateway.`,transcriptSearchError:`Transcript search failed`,transcriptSearchIndexing:`The transcript index is still updating. Retry to include recent messages.`,transcriptSearchArchivedExcluded:`{count} archived transcripts excluded; open a session to restore its searchable history.`,transcriptSearchEmpty:`No transcript messages match that search.`,transcriptSearchMatches:`Transcript matches: {count}`,transcriptSearchTruncated:`Showing the first 25 matches.`},shortcutsOverlay:{title:R.shortcutsOverlay.title,sections:{general:`General`,chat:`Chat`,panels:`Panels`,sidebar:`Sidebar`,imageViewer:`Image viewer`,approvals:`Approvals`},labels:{commandPalette:`Open command palette`,newSession:`Open New Session`,archiveSession:`Archive current session`,paletteStartSession:`Start a background session (in the command palette)`,keyboardShortcuts:`Show keyboard shortcuts`,toggleSidebar:`Toggle sidebar`,debugOverlay:`Toggle debug overlay`,appearanceSettings:`Open appearance settings`,startNewSession:`Start new session (from the new-session page)`,closeDialog:`Close dialog or exit settings`,sendMessage:`Send message`,newline:`Insert new line`,steerImmediately:`Steer active response`,historyRecall:`Browse sent message history`,transcriptSearch:`Search conversation`,clearReply:`Clear reply`,stopResponse:`Stop active response`,cancelDictation:`Cancel dictation`,saveQueuedMessage:`Save queued message`,toggleSessionSelect:`Select multiple sessions`,extendSessionSelect:`Extend session selection`,zoomIn:`Zoom in`,zoomOut:`Zoom out`,zoomReset:`Reset zoom`,panImageHorizontal:`Pan image horizontally`,panImageVertical:`Pan image vertically`,terminalPanel:`Toggle terminal panel`,homePanel:`Talk to your Home agent`,workspaceFiles:`Toggle workspace files`,sideChat:`Toggle side chat`,browserPanel:`Toggle browser panel`,desktopPanel:`Toggle desktop panel`,discussionPanel:`Toggle discussion panel`,dashboardPanel:`Toggle dashboard panel`,reviewPanel:`Toggle review panel`,approveOnce:`Approve once`,approveAlways:`Always allow`,denyApproval:`Deny approval`}},chat:{welcome:{hintBeforeShortcut:`Type a message below ·`,hintAfterShortcut:`for commands`,recentSessions:`Recent chats`,suggestions:{whatCanYouDo:R.chat.welcome.suggestions.whatCanYouDo,summarizeRecentSessions:`Summarize my recent sessions`,configureChannel:`Help me configure a channel`,checkSystemHealth:`Check system health`}},commands:{arguments:`Command arguments`,menu:`Slash commands`,optionCount:`{count} options`,clearDescription:`Clear chat history`,redirectDescription:`Abort and restart with a new message`,steerDescription:`Inject a message into the active run`,exportDescription:`Download this conversation as Markdown`,categories:{session:`Session`,model:`Model`,agents:`Agents`,tools:`Tools`}}}},oo=Object.assign(()=>{Object.assign(R.shortcutsOverlay,ao.shortcutsOverlay),Object.assign(R.chat.welcome,ao.chat.welcome),Object.assign(R.chat.commands,ao.chat.commands),Object.assign(R.commandPalette,ao.commandPalette),Object.assign(R.palette,ao.palette),Object.assign(R.sessionsView,ao.sessionsView)},{catalog:ao})})))()}function co(e){return e.source!==`skill`}function lo(e){return(e.aliases??[]).map(e=>e.trim()).filter(Boolean).map(e=>e.startsWith(`/`)?e.slice(1):e)}function uo(e){if(e.args?.length)return e.args.map(e=>{let t=`<${e.name}>`;return e.required?t:`[${e.name}]`}).join(` `)}function fo(e,t,n){let r=typeof n==`string`?n:n.value;return e.formatArgs?.({[t]:r})??r}function po(e){let t=e.args?.[0];if(!t)return;let n=t.choices?.map(n=>fo(e,t.name,n)).filter(Boolean);return n?.length?n:void 0}function mo(e){let t=e.tier;return t===`essential`||t===`standard`||t===`power`?t:`standard`}function ho(e,t=`local`){let n=e.name.trim();if(!n)return null;let r=e.source??(t===`local`?`native`:void 0),i=Go[e.key.replace(/[:.-]/g,`_`)];return{key:e.key,name:n,aliases:lo(e).filter(e=>e!==n),description:Xo[e.key]??e.description,...Yo[e.key]?{descriptionKey:Yo[e.key]}:{},args:Object.hasOwn(Zo,e.key)?Zo[e.key]:uo(e),icon:i?.icon??`terminal`,category:i?.category??(e.category===`session`?`session`:e.category===`options`?`model`:`tools`),executeLocal:t===`local`&&qo.has(e.key),modelIndependent:e.modelIndependent,argOptions:po(e),allowsInlineMultiWordArgs:Ko.has(e.key),tier:t===`local`?mo(e):`standard`,...r?{source:r}:{},...e.skillDisplayName?{skillDisplayName:e.skillDisplayName}:{},...e.skillModelVisible===void 0?{}:{skillModelVisible:e.skillModelVisible},...e.clientPresentation?{clientPresentation:e.clientPresentation}:{}}}function go(e){let t=e.trim().replace(/^\//u,``).slice(0,Ho),n=A(t);return!n||!Lo.test(n)?null:n}function _o(e,t){let n=typeof e==`string`?e:``;return n.length>t?p(n,t):n}function vo(e){if(e.dynamic===!0)return[];let t=e.choices;return Array.isArray(t)?t.map(e=>{if(typeof e==`string`)return _o(e,Ho);let t=E(e);return t?{value:_o(t.value,Ho),label:_o(t.label,Ho)}:null}).filter(e=>e?typeof e==`string`?!!e:!!e.value:!1):[]}function yo(e){let t=E(e);if(!t||Object.keys(t).length!==2||!Object.hasOwn(t,`when`)||!Object.hasOwn(t,`action`)||t.when!==`no-arguments`)return;let n=E(t.action);if(n&&Object.keys(n).length===1&&Object.hasOwn(n,`kind`)&&n.kind===`device-pairing`)return{when:`no-arguments`,action:{kind:`device-pairing`}}}function bo(){return[...Pr().map(e=>({key:e.key,name:e.textAliases[0]?.replace(/^\//u,``)??e.key,aliases:e.textAliases,description:e.description,modelIndependent:e.modelIndependent,args:e.args?.map(e=>({name:e.name,required:e.required,choices:Array.isArray(e.choices)?e.choices:void 0})),formatArgs:e.formatArgs,category:e.category,tier:e.tier})).map(e=>ho(e,`local`)).filter(e=>e!==null),...Jo]}function xo(e=bo()){let t=new Set;for(let n of e){t.add(A(n.name));for(let e of n.aliases??[]){let n=go(e);n&&t.add(n)}}return t}function So(e,t){let n=(Array.isArray(e.textAliases)?e.textAliases:[]).slice(0,zo).filter(e=>typeof e==`string`).map(go).filter(e=>!!e).filter(e=>!t.has(e)),r=n[0]??(typeof e.name==`string`?go(e.name):null);if(!r||t.has(r))return null;let i=(Array.isArray(e.args)?e.args:[]).map(e=>E(e)).filter(e=>e!==null).slice(0,Bo).map(e=>({name:_o(e.name,Wo),required:e.required===!0,choices:vo(e).slice(0,Vo)})).filter(e=>e.name.length>0).map(e=>Object.assign({name:e.name},e.required?{required:!0}:{},e.choices.length>0?{choices:e.choices}:{}));return{key:r,name:r,aliases:n.map(e=>`/${e}`),description:_o(e.description,Uo),...i.length>0?{args:i}:{},category:typeof e.category==`string`?e.category:void 0,source:e.source===`native`||e.source===`plugin`||e.source===`skill`?e.source:void 0,skillDisplayName:typeof e.skillDisplayName==`string`&&_o(e.skillDisplayName,Ho).trim()||void 0,skillModelVisible:typeof e.skillModelVisible==`boolean`?e.skillModelVisible:void 0,clientPresentation:e.source===`plugin`?yo(e.clientPresentation):void 0}}function Co(e){Qo.splice(0,Qo.length,...e)}function wo(e){let t=bo(),n=xo(t),r=e.slice(0,Ro).map(e=>So(e,n)).filter(e=>e!==null).map(e=>ho(e,`remote`)).filter(e=>e!==null),i=new Map;for(let e of[...t,...r]){let t=A(e.name);t&&!i.has(t)&&i.set(t,e)}return Array.from(i.values())}function To(e){let t=e?.commands;return Array.isArray(t)?t.map(e=>E(e)).filter(e=>e!==null):[]}function Eo(e){return B(`chat.commands.categories.${e}`)}function Do(e){return e.descriptionKey?B(e.descriptionKey):e.description}function Oo(e,t){let n=[e.name,...e.aliases??[]].map(A);return n.some(e=>e===t)?0:n.some(e=>e.startsWith(t))?1:n.some(e=>e.includes(t))?2:A(Do(e)).includes(t)?3:ts}function ko(e,t){let n=A(e),r=t?.showAll??!1,i=t?.inlineOnly?Qo.filter(e=>e.source===`skill`&&e.skillModelVisible===!0||co(e)&&t.allowImmediateInlineCommands!==!1):Qo;return i=n?i.filter(e=>Oo(e,n)<ts):i,!n&&!r&&(i=i.filter(e=>(e.tier??`standard`)!==`power`)),i.toSorted((e,t)=>(n?Oo(e,n)-Oo(t,n):0)||(es[e.tier??`standard`]??1)-(es[t.tier??`standard`]??1)||$o.indexOf(e.category??`session`)-$o.indexOf(t.category??`session`))}function Ao(e,t=e.length){let n=Math.max(0,Math.min(t,e.length)),r=e.slice(0,n).match(/(?:^|\s)\/([^\s/:]*)(:?)$/u);if(!r||r.index===void 0)return null;let i=r[0].indexOf(`/`),a=r.index+i;if(e[a+1]===`/`)return null;let o=n;for(;o<e.length&&!/\s/u.test(e[o]??``);)o+=1;return{query:r[1]??``,start:a,end:o,inline:e.slice(0,a).trim().length>0||e.slice(o).trim().length>0||r[2]===`:`,...r[2]===`:`?{skillOnly:!0}:{}}}function jo(e){return e.skillDisplayName?.trim()||e.name}function Mo(e){let t=A(e),n=t.replace(/[\s_]+/gu,`-`);return Qo.filter(e=>e.source===`skill`&&e.skillModelVisible===!0).filter(e=>{let r=A(jo(e)),i=r.replace(/[\s_]+/gu,`-`),a=A(e.name).replace(/[\s_]+/gu,`-`);return!t||r.includes(t)||i.includes(n)||a.startsWith(n)||A(Do(e)).includes(t)}).toSorted((e,t)=>jo(e).localeCompare(jo(t)))}function No(e){let t=e.trim();if(!t.startsWith(`/`))return null;let n=t.slice(1),r=n.search(/[\s:]/u),i=r===-1?n:n.slice(0,r),a=r===-1?``:n.slice(r).trimStart();a.startsWith(`:`)&&(a=a.slice(1).trimStart());let o=a.trim();if(!i)return null;let s=A(i),c=Qo.find(e=>e.name===s||e.aliases?.some(e=>A(e)===s));return c?{command:c,args:o}:null}function Po(e){let t=No(e)?.command.key;return A(e.trim())===`/stop`||t===`approve`}function Fo(e){return!e.trimStart().startsWith(`/`)||Po(e)}function Io(e){let t=No(e);if(!t)return!1;let n=t.command.modelIndependent;if(n===`directive`){let e=Lr(t.command.key);return e!==void 0&&(e===`model`&&!Rr(t.args)||Ar(e,t.args))}return n===`always`||(n===`no-args`?t.args===``:typeof n==`function`&&n(t.args))}var Lo,Ro,zo,Bo,Vo,Ho,Uo,Wo,Go,Ko,qo,Jo,Yo,Xo,Zo,Qo,$o,es,ts;function ns(){return(ns=e((()=>{Hr(),Wr(),U(),so(),oo(),Lo=/^[a-z0-9][a-z0-9_-]*$/u,Ro=500,zo=20,Bo=20,Vo=50,Ho=200,Uo=2e3,Wo=200,Go={help:{icon:`book`,category:`tools`},status:{icon:`barChart`,category:`tools`},usage:{icon:`barChart`,category:`tools`},export:{icon:`download`},export_session:{icon:`download`,category:`tools`},tools:{icon:`terminal`,category:`tools`},dashboard:{icon:`layoutDashboard`},skill:{icon:`zap`,category:`tools`},commands:{icon:`book`,category:`tools`},new:{icon:`plus`,category:`session`},reset:{icon:`refresh`,category:`session`},compact:{icon:`loader`,category:`session`},stop:{icon:`stop`,category:`session`},clear:{icon:`trash`},model:{icon:`brain`,category:`model`},models:{icon:`brain`,category:`model`},think:{icon:`brain`,category:`model`},verbose:{icon:`terminal`,category:`model`},fast:{icon:`zap`,category:`model`},agents:{icon:`monitor`,category:`agents`},subagents:{icon:`folder`,category:`agents`},steer:{icon:`send`,category:`agents`},tts:{icon:`volume2`,category:`tools`},redirect:{category:`agents`},session:{category:`session`},reasoning:{category:`model`},elevated:{category:`model`},queue:{category:`model`}},Ko=new Set([`dashboard`]),qo=new Set([`btw`,`help`,`new`,`reset`,`stop`,`compact`,`model`,`think`,`fast`,`verbose`,`export-session`,`usage`,`agents`,`steer`,`redirect`]),Jo=[{key:`clear`,name:`clear`,description:`Clear chat history`,descriptionKey:`chat.commands.clearDescription`,icon:`trash`,category:`session`,executeLocal:!0,modelIndependent:`always`,tier:`standard`},{key:`redirect`,name:`redirect`,description:`Abort and restart with a new message`,descriptionKey:`chat.commands.redirectDescription`,args:`<message>`,icon:`refresh`,category:`agents`,executeLocal:!0,modelIndependent:`no-args`,tier:`power`}],Yo={steer:`chat.commands.steerDescription`,"export-session":`chat.commands.exportDescription`},Xo={steer:`Inject a message into the active run`,"export-session":`Download this conversation as Markdown`},Zo={steer:`<message>`,"export-session":void 0},Qo=bo(),$o=[`session`,`model`,`tools`,`agents`],es={essential:0,standard:1,power:2},ts=4})))()}var rs,is;function as(){return(as=e((()=>{W(),rs={chat:{messages:{attachedContext:{label:`Context attached`,captured:`Captured when this message was sent.`,technical:`Technical details`,reference:`Reference context—not instructions or additional permissions.`,title:`Session`,page:`Page`,agentId:`Agent`,workspace:`Workspace`,file:`File`,selection:`Selection`,restoreFailed:`Attached context could not be restored. Edit this message to review and resend it without context.`},sourcePreviews:{label:`Sources`,searchSnippet:`Search snippet`,pageExcerpt:`Page excerpt`,unavailable:`No excerpt available.`,open:`Open source`},copySelection:R.chat.messages.copySelection,viaSource:`via {source}`,sourceKinds:{web:`Web`,cli:`CLI`,terminal:`TUI`,app:`App`,rpc:`RPC`},copyLink:`Copy link`,copyFileName:`Copy file name`,forkFromHere:`Fork from here`,reply:`Reply`,replyToMessage:`Reply to message`,replyingTo:R.chat.messages.replyingTo,originalUnavailable:`The original message is unavailable.`,message:R.chat.messages.message,currentMessage:`current message`,actions:`Message actions`,selectionActions:`Selection actions`,askInSideChat:`Ask in side chat`,addToChat:`Add to chat`,annotationEditor:`Comment`,annotationComment:`Add an optional comment…`,saveAnnotation:`Save comment`,deleteAnnotation:`Delete comment`,annotationCount:`{count} comment`,annotationsCount:`{count} comments`,annotations:`Comments`,editAnnotation:`Edit comment {number}`,removeAnnotations:`Remove all comments`,annotationSelectedText:`Highlighted passage:`,annotationUserComment:`Your comment:`,rewind:`Rewind`,rewindConfirm:`Rewind to before this message?`,dontAskAgain:`Don't ask again`,rewindToHere:`Rewind to here`,rewindUnavailable:`Rewind is unavailable while the agent is working`,forkUnavailable:`Fork is unavailable while the agent is working`,showLess:R.chat.messages.showLess,showMore:R.chat.messages.showMore,tooLargeToDisplay:R.chat.messages.tooLargeToDisplay,unknownDate:`Unknown date`,unattributedSender:R.chat.messages.unattributedSender,toolSender:R.chat.messages.toolSender,errorSender:R.chat.messages.errorSender,forwardedFrom:`From`,forwardedAutomation:`Automation`,forwardedFromAgent:`Forwarded from {agentId}`,forwardedMessage:`Forwarded message`,fullContentLoadExhausted:`Could not load the full message.`,voiceNote:`Voice note`,duplicatesCollapsed:`{count} consecutive identical messages collapsed`,contextFor:`Message context for {timestamp}`}}},is=Object.assign(()=>Object.assign(R.chat.messages,rs.chat.messages),{catalog:rs})})))()}function os(e){if(!h(e)||e.sessionId!==void 0&&typeof e.sessionId!=`string`)return!1;let t=e.action===`start`?[`action`,`sessionId`]:[`action`,`sessionId`,`goalId`,`previousDraft`];return Object.keys(e).every(e=>t.includes(e))&&(e.action===`start`||e.action===`edit`&&typeof e.goalId==`string`&&e.goalId.length>0&&typeof e.previousDraft==`string`)}function ss(){return(ss=e((()=>{})))()}function cs(e){return h(e)&&typeof e.messageId==`string`&&e.messageId.length>0&&typeof e.text==`string`&&(e.senderLabel==null||typeof e.senderLabel==`string`)&&(e.sourceMessageId==null||typeof e.sourceMessageId==`string`)}function ls(){return(ls=e((()=>{})))()}function us(e){if(!(!h(e)||typeof e.text!=`string`||typeof e.comment!=`string`||typeof e.sessionKey!=`string`||typeof e.start!=`number`||!Number.isSafeInteger(e.start)||e.start<0||typeof e.end!=`number`||!Number.isSafeInteger(e.end)||e.end<e.start||e.messageId!==void 0&&typeof e.messageId!=`string`||e.entryId!==void 0&&typeof e.entryId!=`string`))return{text:e.text,comment:e.comment,sessionKey:e.sessionKey,start:e.start,end:e.end,...typeof e.messageId==`string`?{messageId:e.messageId}:{},...typeof e.entryId==`string`?{entryId:e.entryId}:{}}}function ds(){return(ds=e((()=>{})))()}function fs(e){let t=ye(e?.name)??ye(e?.username);if(t)return t;let n=ye(e?.id);return n?/^([^@\s]+)@[^@\s]+$/.exec(n)?.[1]??n:null}function ps(e){let t=ye(e?.id),n=ye(e?.name),r=ye(e?.username),i=ye(e?.profileAvatarUrl),a=Sn(e?.identity);return!t&&!n&&!r&&!i?null:{...a?{identity:a}:{},...t?{id:t}:{},...n?{name:n}:{},...r?{username:r}:{},...i?{profileAvatarUrl:i}:{}}}function ms(e){return e?e.identity?JSON.stringify(e.identity,Object.keys(e.identity).toSorted()):[e.id??``,e.name??``,e.username??``,e.profileAvatarUrl??``].join(`\0`):null}function hs(){return(hs=e((()=>{Cn()})))()}function gs(e,t){return e.id===t.id&&e.asyncQuestionItemId===t.asyncQuestionItemId&&e.text===t.text&&e.workContextUnavailable===t.workContextUnavailable&&JSON.stringify(e.workContext)===JSON.stringify(t.workContext)&&JSON.stringify(e.mentions??[])===JSON.stringify(t.mentions??[])&&e.sendRunId===t.sendRunId&&e.sendAttempts===t.sendAttempts&&e.sendState===t.sendState&&e.agentId===t.agentId&&e.sessionKey===t.sessionKey&&e.orderKey===t.orderKey&&e.attachmentPayload?.key===t.attachmentPayload?.key}function _s(e){if(!h(e))return null;let t=e,n=j(t.id),r=j(t.mimeType);if(!n||!r)return null;let i={id:n,mimeType:r};(t.origin===`paste`||t.origin===`file`)&&(i.origin=t.origin);let a=us(t.selectionAnnotation);a&&(i.selectionAnnotation=a);let o=j(t.fileName);o&&(i.fileName=o),typeof t.sizeBytes==`number`&&Number.isFinite(t.sizeBytes)&&(i.sizeBytes=t.sizeBytes);let s=j(t.dataUrl);return s&&(i.dataUrl=s),i}function vs(e){if(!h(e))return null;let t=e,n=j(t.id),r=typeof t.text==`string`?t.text:``,i=M(t.createdAt)??Date.now();if(!n||!r.trim()&&!Array.isArray(t.attachments)&&t.attachmentPayload===void 0&&t.attachmentStorageError===void 0)return null;let a=Array.isArray(t.attachments)?t.attachments.map(_s).filter(e=>e!==null):[],o={id:n,text:r,createdAt:i},s=j(t.asyncQuestionItemId);s&&s.length<=256&&(o.asyncQuestionItemId=s),t.workContext!==void 0&&(o.workContext=Rn(t.workContext),o.workContext||(o.workContextUnavailable=!0));let c=Aa(r,t.mentions);if(c&&(o.mentions=c),t.attachmentPayload!==void 0){let e=t.attachmentPayload;h(e)&&typeof e.key==`string`&&typeof e.recoveryScope==`string`&&typeof e.tabId==`string`?o.attachmentPayload={key:e.key,recoveryScope:e.recoveryScope,tabId:e.tabId}:o.attachmentStorageError=`missing`}if((t.attachmentStorageError===`missing`||t.attachmentStorageError===`unavailable`||t.attachmentStorageError===`capacity`)&&(o.attachmentStorageError=t.attachmentStorageError),Array.isArray(t.attachments)&&a.length!==t.attachments.length&&(o.attachmentStorageError=`missing`),o.attachmentPayload&&!a.length&&(o.attachmentStorageError=`missing`),t.intent!==void 0){let e=t.intent;if(!h(e)||Object.keys(e).length!==3||e.kind!==`session-goal-start`||e.version!==1||typeof e.issuedAtMs!=`number`||!Number.isSafeInteger(e.issuedAtMs)||e.issuedAtMs<=0)return null;o.intent={kind:e.kind,version:e.version,issuedAtMs:e.issuedAtMs},(t.expectedLeafEntryId===null||typeof t.expectedLeafEntryId==`string`)&&(o.expectedLeafEntryId=t.expectedLeafEntryId)}let l=j(t.sessionId);l&&(o.sessionId=l),typeof t.orderKey==`number`&&Number.isFinite(t.orderKey)&&(o.orderKey=t.orderKey);let u=ps(t.sender);u&&(o.sender=u);let d=t.kind===`steered`||j(t.steerTargetRunId)!==void 0||t.sendState===`steering`?`steer`:Mr(typeof t.queueMode==`string`?t.queueMode:void 0);d&&(o.queueMode=d),a.length&&(o.attachments=a),typeof t.refreshSessions==`boolean`&&(o.refreshSessions=t.refreshSessions);let f=j(t.replyToId);f&&(o.replyToId=f),t.sendState===`steering`||t.sendState===`executing-command`?o.sendState=`unconfirmed`:t.sendState===`submitting`?o.sendState=`waiting-idle`:t.sendState===`sending`?o.sendState=`waiting-reconnect`:t.sendState===`failed`||t.sendState===`unconfirmed`||t.sendState===`held`||t.sendState===`waiting-idle`||t.sendState===`waiting-reconnect`?o.sendState=t.sendState:t.sendState===`waiting-model`&&(o.sendState=`failed`,o.sendError=xs);let p=j(t.sendError);p&&(o.sendError=p);let m=j(t.sendRunId);m&&(o.sendRunId=m),typeof t.sendAttempts==`number`&&Number.isFinite(t.sendAttempts)&&(o.sendAttempts=t.sendAttempts);for(let e of[`localCommandArgs`,`localCommandName`,`sessionKey`]){let n=j(t[e]);n&&(o[e]=n)}let g=j(t.agentId);return g&&(o.agentId=b(g)),t.mentions!==void 0&&(!Array.isArray(t.mentions)||t.mentions.length!==(c?.length??0))&&(o.sendState=o.sendState===`held`?`held`:`failed`,o.sendError=B(`chat.mentions.restoreFailed`)),(t.workContextUnavailable===!0||o.workContextUnavailable)&&(o.workContextUnavailable=!0,o.sendState=o.sendState===`held`?`held`:`failed`,o.sendError=B(`chat.messages.attachedContext.restoreFailed`)),o}function ys(e){if(!h(e))return null;let t=e,n=typeof t.draft==`string`?t.draft:void 0,r=n?Aa(n,t.draftMentions):void 0;if(t.goalMode!==void 0&&!os(t.goalMode))return null;let i=t.goalMode;if(t.replyTarget!==void 0&&!cs(t.replyTarget))return null;let a=t.replyTarget;if(Array.isArray(t.queue)&&t.queue.length>bs)return null;let o=Array.isArray(t.queue)?t.queue.map(vs).filter(e=>e!==null):void 0,s=Array.isArray(t.removedQueueItemIds)?t.removedQueueItemIds.map(j).filter(e=>e!==void 0):void 0,c=new Set(s??[]),l=o?.filter(e=>!c.has(e.id)),u=M(t.updatedAt)??Date.now(),d=(typeof t.draftRevision==`number`&&Number.isSafeInteger(t.draftRevision)?t.draftRevision:void 0)??(n?u:void 0);return!n&&!i&&!a&&d===void 0&&(!l||l.length===0)?null:{...t.awaitingDefaults===!0?{awaitingDefaults:!0}:{},...n?{draft:n}:{},...r?{draftMentions:r}:{},...i?{goalMode:i}:{},...a?{replyTarget:{...a}}:{},...d===void 0?{}:{draftRevision:d},...l&&l.length>0?{queue:l}:{},updatedAt:u}}var bs,xs;function Ss(){return(Ss=e((()=>{fe(),qr(),rn(),U(),as(),V(),ss(),Na(),ls(),ds(),hs(),is(),bs=1e3,xs=`Chat settings update was interrupted. Review and retry when ready.`})))()}function Cs(e,t){return e??Error(t)}function G(e){return new Promise((t,n)=>{e.addEventListener(`success`,()=>t(e.result),{once:!0}),e.addEventListener(`error`,()=>n(Cs(e.error,`IndexedDB request failed`)),{once:!0})})}function K(e){return new Promise((t,n)=>{e.addEventListener(`complete`,()=>t(),{once:!0}),e.addEventListener(`abort`,()=>n(Cs(e.error,`IndexedDB transaction aborted`)),{once:!0}),e.addEventListener(`error`,()=>n(Cs(e.error,`IndexedDB transaction failed`)),{once:!0})})}function ws(){if(ks)return ks;let e=new Promise((t,n)=>{let r=()=>{ks===e&&(ks=null)};if(typeof indexedDB>`u`){n(Error(`IndexedDB is unavailable`));return}let i=indexedDB.open(Ts,Es);i.addEventListener(`upgradeneeded`,()=>{let e=i.result;e.objectStoreNames.contains(`outboxPayloads`)||e.createObjectStore(`outboxPayloads`,{keyPath:`key`});let t=e.objectStoreNames.contains(Ds)?i.transaction?.objectStore(Ds):e.createObjectStore(Ds,{keyPath:`key`});t&&!t.indexNames.contains(Os)&&t.createIndex(Os,Os,{unique:!1})},{once:!0});let a=!1;i.addEventListener(`success`,()=>{let e=i.result;if(a){e.close(),r();return}e.addEventListener(`close`,r,{once:!0}),e.addEventListener(`versionchange`,()=>{e.close(),r()}),t(e)},{once:!0}),i.addEventListener(`error`,()=>{r(),n(Cs(i.error,`IndexedDB open failed`))},{once:!0}),i.addEventListener(`blocked`,()=>{a=!0,n(Error(`IndexedDB upgrade was blocked`))},{once:!0})});return ks=e,e}var Ts,Es,Ds,Os,ks;function As(){return(As=e((()=>{Ts=`openclaw-control-ui`,Es=2,Ds=`composerDrafts`,Os=`ownerKey`,ks=null})))()}function js(e){return{status:`failed`,reason:e instanceof DOMException&&e.name===`QuotaExceededError`?`capacity`:`unavailable`}}async function Ms(e,t){let n=t.reduce((e,t)=>e+t.blob.size,0);if(n>zs)return{status:`failed`,reason:`capacity`};try{let r=(await ws()).transaction(Rs,`readwrite`,{durability:`strict`}),i=K(r),a=r.objectStore(Rs),o=await G(a.getAll()).catch(async e=>{throw await i,e}),s=o.reduce((e,t)=>e+(h(t)&&typeof t.bytes==`number`&&Number.isSafeInteger(t.bytes)&&t.bytes>=0?t.bytes:Bs),0);if(o.length>=Vs||s+n>Bs)return await i,{status:`failed`,reason:`capacity`};let c=JSON.stringify([e.gatewayOwner,e.recoveryScope,e.queueId,T()]);return a.add({key:c,owner:e,bytes:n,attachments:t}),await i,{status:`ready`,value:{key:c,recoveryScope:e.recoveryScope,tabId:e.tabId}}}catch(e){return js(e)}}async function Ns(e,t){if(t.recoveryScope!==e.recoveryScope)return{status:`failed`,reason:`missing`};try{let n=(await ws()).transaction(Rs),r=K(n),[i]=await Promise.all([G(n.objectStore(Rs).get(t.key)),r]);if(!h(i)||!h(i.owner)||i.key!==t.key||i.owner.gatewayOwner!==e.gatewayOwner||i.owner.recoveryScope!==e.recoveryScope||i.owner.queueId!==e.queueId||i.owner.tabId!==t.tabId||!Array.isArray(i.attachments)||!i.attachments.length)return{status:`failed`,reason:`missing`};let a=[];for(let e of i.attachments){if(!h(e)||!(e.blob instanceof Blob)||typeof e.mimeType!=`string`||e.origin!==void 0&&e.origin!==`paste`&&e.origin!==`file`||e.fileName!==void 0&&typeof e.fileName!=`string`||e.sizeBytes!==void 0&&e.sizeBytes!==e.blob.size)return{status:`failed`,reason:`missing`};let t=us(e.selectionAnnotation);a.push({blob:e.blob,mimeType:e.mimeType,...e.origin?{origin:e.origin}:{},...t?{selectionAnnotation:t}:{},...typeof e.fileName==`string`?{fileName:e.fileName}:{},...typeof e.sizeBytes==`number`?{sizeBytes:e.sizeBytes}:{}})}return i.bytes===a.reduce((e,t)=>e+t.blob.size,0)?{status:`ready`,value:a}:{status:`failed`,reason:`missing`}}catch(e){return js(e)}}async function Ps(e){try{let t=await Fs(),n=e.filter(e=>e.tabId===t);if(!n.length)return;let r=(await ws()).transaction(Rs,`readwrite`),i=r.objectStore(Rs);for(let e of n)i.delete(e.key);await K(r)}catch{}}function Fs(){return Us??=(async()=>{let e=Oe();if(!e)throw Error(`Outbox ownership unavailable`);let t=globalThis.navigator?.locks;if(!t){let t=T();return e.setItem(Hs,t),t}let n=e=>new Promise((n,r)=>{t.request(`openclaw-outbox:${e}`,{ifAvailable:!0},e=>(n(!!e),e?new Promise(()=>{}):void 0)).catch(r)}),r=e.getItem(Hs),i=r&&await n(r)?r:T();if(i!==r&&!await n(i))throw Error(`Outbox ownership unavailable`);return e.setItem(Hs,i),i})().catch(e=>{throw Us=null,e})}function Is(e){let t=e.client;if(!t||e.connected&&!t.recoveryScopeReady)return;t.recoveryScopeReady&&t.recoveryScope&&Ws.set(t,t.recoveryScope);let n=Ws.get(t);return n===t.recoveryScope?n:void 0}function Ls(e,t){return!t.attachmentPayload||t.attachmentPayload.recoveryScope===Is(e)}var Rs,zs,Bs,Vs,Hs,Us,Ws;function Gs(){return(Gs=e((()=>{c(),As(),ds(),Rs=`outboxPayloads`,zs=26214400,Bs=262144e3,Vs=1e3,Hs=`openclaw.control.outboxTab.v1`,Us=null,Ws=new WeakMap})))()}function Ks(e){ec=Math.max(ec,e??0)}function qs(e=0){let t=Math.max(Date.now(),ec+1,e+1);return ec=t,t}function Js(e,t,n,r){if(r===void 0)return;let i=Qs(e,t,n);i.committed=Math.max(i.committed,r)}function Ys(e,t,n,r){let i=Qs(e,t,n);i.attempted=Math.max(i.attempted,r)}function Xs(e,t,n,r){let i=Qs(e,t,n);i.edited=Math.max(i.edited,r)}function Zs(e,t,n,r){let i=Qs(e,t,n),a=Symbol(`composer-replacement`),o=Math.max(r,i.committed,i.attempted,i.edited);return i.replacement=a,()=>i.replacement===a&&Math.max(i.committed,i.attempted,i.edited)<=o}function Qs(e,t,n){let r=tc.get(e);r||(r=new Map,tc.set(e,r));let i=r.get(t);i||(i=new Map,r.set(t,i));let a=i.get(n);return a||(a={committed:0,attempted:0,edited:0},i.set(n,a)),a}function $s(e,t,n,r){let i=tc.get(e)?.get(t)?.get(n),a=Math.max(r??0,i?.committed??0);return{committed:a,latestAttempt:Math.max(a,i?.attempted??0)}}var ec,tc;function nc(){return(nc=e((()=>{ec=0,tc=new WeakMap})))()}function rc(e){return!e.draft&&!e.draftMentions&&!e.goalMode&&!e.replyTarget?!1:(delete e.draft,delete e.draftMentions,delete e.goalMode,delete e.replyTarget,!0)}function ic(e){let t=!1,n=[...Object.entries(e.sessions),...Object.values(e.recovery).map(e=>[e.sourceScopeKey,e.session])];for(let[e,r]of n)me(lc(e)?.sessionKey)&&(t=rc(r)||t);return t}function ac(e){return wc.add(e),!Tc&&typeof window<`u`&&(Tc=!0,window.addEventListener(`storage`,sc)),()=>{wc.delete(e),Tc&&wc.size===0&&typeof window<`u`&&(Tc=!1,window.removeEventListener(`storage`,sc))}}function oc(){for(let e of wc)try{e()}catch(e){console.error(`[openclaw] stored chat outbox listener failed`,e)}}function sc(e){if(e.key===null&&e.storageArea){Oc.get(e.storageArea)?.clear(),oc();return}(e.key?.startsWith(Cc)||e.key?.startsWith(bc)||e.key?.startsWith(xc)||e.key?.startsWith(Sc))&&(e.storageArea&&Oc.get(e.storageArea)?.clear(),oc())}function cc(e){let t=e?.trim()||`default`,n=encodeURIComponent(t);return{key:`${Cc}${n}`,legacyKey:`${bc}${n.slice(0,240)}`,previousKey:`${xc}${n}`,blobKey:`${Sc}${n}`,gatewayOwner:t,legacyOwnerIsUnambiguous:n.length<240}}function lc(e){let t=e.lastIndexOf(`\0agent:`);if(t<1)return null;let n=e.slice(0,t),r=e.slice(t+7),i=z(n)?.agentId;if(i&&b(r)!==b(i))return null;let a=i??(n===`global`&&r!==`@unresolved`?r:void 0);return{sessionKey:n,...a?{agentId:b(a)}:{}}}function uc(e,t){let n=!1;for(let[r,i]of Object.entries(e.sessions)){if(!i.awaitingDefaults||!Wt(t))continue;let a=lc(r);if(!a)continue;let o=bt(t,a.sessionKey,a.agentId),s=F(o),{awaitingDefaults:c,...l}=i,u=e.sessions[s];if(s!==r&&u){let t=new Set(u.queue?.map(e=>e.id)),n=l.queue?.some(e=>t.has(e.id)),i=(l.draftRevision??0)>(u.draftRevision??0);if(n||(l.draft||l.goalMode||l.replyTarget)&&!i)pc(e,`pending:${r}`,4,r,l);else{let t=i?l:u;e.sessions[s]={...t,queue:[...u.queue??[],...(l.queue??[]).map(e=>yc(e,o))],updatedAt:Math.max(l.updatedAt,u.updatedAt)}}}else e.sessions[s]={...l,...l.queue?{queue:l.queue.map(e=>yc(e,o))}:{}};s!==r&&delete e.sessions[r],n=!0}return n}function dc(e,t,n){return{scope:bt(e,t,n),awaitingDefaults:!Wt(e)}}function fc(e,t,n=``){return JSON.stringify([e.settings?.gatewayUrl,e.client?.recoveryScope,F(t)])+n}function pc(e,t,n,r,i){let{queue:a,...o}=i,s=new Map;(o.draft||o.goalMode||o.replyTarget||!a?.length&&o.draftRevision!==void 0)&&s.set(void 0,[]);for(let e of a??[]){let t=e.attachmentPayload?.recoveryScope,n=s.get(t)??[];n.push(e),s.set(t,n)}for(let[a,c]of s)e.recovery[`${t}:${JSON.stringify(a??null)}`]={sourceVersion:n,sourceScopeKey:r,session:{...a===void 0?o:{updatedAt:i.updatedAt,draftRevision:i.draftRevision},...c.length?{queue:c}:{}}}}function mc(e,t,n,r,i,a){let o=i?F(i):n,s=r.queue?.some(e=>e.sessionKey&&e.sessionKey!==i?.sessionKey||e.agentId&&e.agentId!==i?.agentId);i&&!s&&!e.sessions[o]&&Object.keys(e.sessions).length<20?e.sessions[o]={...r,...r.queue?{queue:r.queue.map(e=>({...e,...i}))}:{}}:pc(e,`${t}:${a}:${n}`,t,n,r)}function hc(e,t){let n=e.getItem(t.key),r=n?JSON.parse(n):{version:4,gatewayOwner:t.gatewayOwner,sessions:{},recovery:{}};if(n){if(r.version!==4||r.gatewayOwner!==t.gatewayOwner||!r.sessions||!r.recovery)throw Error(`Chat outbox owner or version mismatch`);for(let[n,i]of Object.entries(r.sessions)){let a=ys(i);if(!a)throw Error(`Invalid chat outbox record`);r.sessions[n]=a,Ks(a.draftRevision),Js(e,t.key,n,a.draftRevision)}}let i=[];for(let[a,o]of[[t.blobKey,3],[t.previousKey,2],...t.legacyOwnerIsUnambiguous?[[t.legacyKey,1]]:[]]){let s=e.getItem(a);if(!s){s===``&&i.push({key:a,raw:s});continue}let c=xi(vi(new TextEncoder().encode(s)));if(r.legacyReceipts?.[o]===c){i.push({key:a,raw:s});continue}let l=JSON.parse(s);if(l.version!==o||o!==1&&l.gatewayOwner!==t.gatewayOwner||!l.sessions)throw Error(`Chat outbox legacy owner or version mismatch`);let u={...r.sessions},d={...r.recovery},f=!1;for(let[e,t]of Object.entries(l.sessions)){let i=ys(t),a=h(t)&&Array.isArray(t.removedQueueItemIds)?t.removedQueueItemIds:[],s=h(t)&&Array.isArray(t.queue)?t.queue.filter(e=>!h(e)||!a.includes(e.id)):[];if(!i||s.length!==(i.queue?.length??0))throw Error(`Invalid legacy chat outbox record`);let u=lc(e);h(t)&&me(u?.sessionKey)&&(f=rc(t)||f,rc(i),ys(t)||delete l.sessions[e]);let d=u&&(z(u.sessionKey)||o===1&&u.sessionKey===`global`&&u.agentId||u.sessionKey!==`global`&&u.sessionKey!==`main`&&u.sessionKey!==l.mainAlias?.key);if(!n&&o!==1&&u?.sessionKey===`global`){let t=new Map;i.queue=i.queue?.filter(e=>{let n=z(e.sessionKey);if(!n||e.agentId&&e.agentId!==n.agentId)return!0;let i=F({sessionKey:e.sessionKey,agentId:n.agentId});if(!t.has(i)&&Object.keys(r.sessions).length+t.size>=20)return!0;let a=t.get(i)??[];return a.push(e),t.set(i,a),!1});for(let[n,a]of t)mc(r,o,`${e}:${n}`,{queue:a,updatedAt:i.updatedAt},lc(n),c)}(i.draft||i.goalMode||i.replyTarget||i.draftRevision!==void 0||i.queue?.length)&&mc(r,o,e,i,!n&&d?u:null,c)}if(Object.keys(r.recovery).length>Ec){if(r.sessions=u,r.recovery=d,r.recoveryBlocked=!0,f&&e.getItem(a)===s)try{e.setItem(a,JSON.stringify(l))}catch{}continue}r.legacyReceipts={...r.legacyReceipts,[o]:c},i.push({key:a,raw:s})}let a=ic(r);if(i.length||a){i.length&&Dc.set(r,i);try{_c(e,t,r)}catch{}}return r}function gc(e,t){let n=Oc.get(e),r=n?.get(t.key);if(r)return r;let i=hc(e,t),a=n??new Map;return a.set(t.key,i),Oc.set(e,a),i}function _c(e,t,n){ic(n);let r=e.getItem(t.key);if(Oc.get(e)?.delete(t.key),Object.keys(n.recovery).length>Ec)throw Error(`Chat outbox recovery limit reached; legacy source retained`);let i=Object.entries(n.sessions),a=i.filter(([,e])=>e.queue?.length);if(a.length>20)throw Error(`Chat outbox session limit reached`);let o=i.filter(([,e])=>!e.queue?.length),s=`global\u0000agent:${$e}`,c=(e,t)=>Number(t[1].awaitingDefaults===!0&&!z(t[0]))-Number(e[1].awaitingDefaults===!0&&!z(e[0]))||t[1].updatedAt-e[1].updatedAt||(t[1].draftRevision??0)-(e[1].draftRevision??0)||e[0].localeCompare(t[0]),l=o.find(([e])=>e===s),u=[...l?[l]:[],...o.filter(([e,t])=>e!==s&&!t.draft&&!t.goalMode&&!t.replyTarget&&t.draftRevision!==void 0).toSorted(c)].slice(0,20),d=[...[...a.toSorted(c),...o.filter(([e,t])=>e!==s&&!!(t.draft||t.goalMode||t.replyTarget)).toSorted(c)].slice(0,20),...u];if(d.length===0&&Object.keys(n.recovery).length===0&&!Dc.has(n)&&!n.legacyReceipts){if(e.removeItem(t.key),e.getItem(t.key)!==null)throw Error(`Chat outbox removal verification failed`);vc(e,t,r,null);return}if(Dc.has(n)&&d.length<i.length)throw Error(`Chat outbox migration exceeds retention; source retained`);let f={version:4,gatewayOwner:t.gatewayOwner,sessions:Object.fromEntries(d),recovery:n.recovery,...n.legacyReceipts?{legacyReceipts:n.legacyReceipts}:{}},p=JSON.stringify(f);if(e.setItem(t.key,p),e.getItem(t.key)!==p)throw Error(`Chat outbox write verification failed`);for(let t of Dc.get(n)??[])if(e.getItem(t.key)===t.raw){try{e.removeItem(t.key)}catch{}try{e.getItem(t.key)===t.raw&&e.setItem(t.key,``)}catch{}}Dc.delete(n),vc(e,t,r,f)}function vc(e,t,n,r){if(n)try{if([t.legacyKey,t.previousKey,t.blobKey].some(t=>e.getItem(t)!==null))return;let i=e=>{if(e===null)return[];if(!h(e)||e.version!==4||e.gatewayOwner!==t.gatewayOwner||!h(e.sessions)||!h(e.recovery))throw Error(`Unreadable outbox retention source`);return[...Object.values(e.sessions),...Object.values(e.recovery).map(e=>{if(!h(e))throw Error(`Unreadable recovery source`);return e.session})].flatMap(e=>{if(!h(e)||e.queue!==void 0&&!Array.isArray(e.queue))throw Error(`Unreadable outbox row`);return(e.queue??[]).flatMap(e=>{if(!h(e))throw Error(`Unreadable outbox item`);let t=e.attachmentPayload;if(t===void 0)return[];if(!h(t)||typeof t.key!=`string`||typeof t.recoveryScope!=`string`||typeof t.tabId!=`string`)throw Error(`Unreadable outbox payload reference`);return[{key:t.key,recoveryScope:t.recoveryScope,tabId:t.tabId}]})})},a=new Set(i(r).map(e=>e.key)),o=i(JSON.parse(n)).filter(e=>!a.has(e.key));o.length&&Ps(o)}catch{}}function yc(e,t){let{agentId:n,...r}=e,i=t.agentId??z(t.sessionKey)?.agentId;return{...r,sessionKey:t.sessionKey,...i?{agentId:i}:{}}}var bc,xc,Sc,Cc,wc,Tc,Ec,Dc,Oc;function kc(){return(kc=e((()=>{Si(),yi(),y(),V(),Gs(),Ss(),nc(),nn(),bc=`openclaw.control.chatComposer.v1:`,xc=`openclaw.control.chatComposer.v2:`,Sc=`openclaw.control.chatComposer.v3:`,Cc=`openclaw.control.chatComposer.v4:`,wc=new Set,Tc=!1,Ec=80,Dc=new WeakMap,Oc=new WeakMap})))()}function Ac(e){return fa(e)}function jc(){return(jc=e((()=>{la()})))()}function Mc(e){let t=Pc.exec(e);return t?.groups?(t.groups.label??``)+t.groups.body:e}function Nc(e){let t=l(e);if(!t||t.role!==`user`&&t.role!==`assistant`)return e;let n=l(t.__openclaw)?.idempotencyKey??t.idempotencyKey;if(typeof n!=`string`||!/^[^:\s]+-catalog:/u.test(n))return e;let r=t.content;return{...t,...typeof t.text==`string`?{text:Mc(t.text)}:{},...typeof r==`string`?{content:Mc(r)}:Array.isArray(r)?{content:r.map(e=>{let n=l(e);return n&&typeof n.text==`string`&&(n.type===`text`||n.type===`input_text`||t.role===`assistant`&&n.type===`output_text`)?Object.assign({},n,{text:Mc(n.text)}):e})}:{}}}var Pc;function Fc(){return(Fc=e((()=>{Pc=/^(?<label>(?:Thinking|Tool call|Tool result|Other)\r?\n\r?\n)?<<<EXTERNAL_UNTRUSTED_CONTENT id="(?<id>[a-f0-9]{16})">>>\r?\nSource: External\r?\n---\r?\n(?<body>[\s\S]*?)\r?\n<<<END_EXTERNAL_UNTRUSTED_CONTENT id="\k<id>">>>$/u})))()}function Ic(e,t){return e===`text`||t===`user`&&e===`input_text`||t===`assistant`&&(e===`input_text`||e===`output_text`)}function Lc(e,t){let n=A(t)===`user`,r=Vr(e);return t===`assistant`?Ac(r):n?zr(_a(r)):_a(r)}function Rc(e){if(e==null)return null;let t=Dn(Nc(e)),n=t,r=typeof n.role==`string`?n.role:``,i=r===`assistant`?ma(t):Uc(t);return i?Lc(i,r):null}function zc(e,t,n){if(!e||typeof e!=`object`)return n(e);if(t.has(e))return t.get(e)??null;let r=n(e);return t.set(e,r),r}function Bc(e){return zc(e,qc,Rc)}function Vc(e){if(e==null)return null;let t=e.content,n=[];if(Array.isArray(t))for(let e of t){let t=l(e);if(t?.type===`thinking`&&typeof t.thinking==`string`){let e=t.thinking.trim();e&&n.push(e)}}return n.length>0?n.join(`
`):null}function Hc(e){return zc(e,Jc,Vc)}function Uc(e){if(e==null)return null;let t=e,n=A(t.role),r=t.content;if(typeof r==`string`)return r;if(Array.isArray(r)){let e=r.map(e=>{let t=l(e);return t&&Ic(t.type,n)&&typeof t.text==`string`?t.text:null}).filter(e=>typeof e==`string`);if(e.length>0)return e.join(`
`)}return typeof t.text==`string`?t.text:null}function Wc(e){return!e||typeof e!=`object`?[]:(dn(e)??[]).flatMap((e,t)=>{let n=e.path??e.url;return n?[{factIndex:t,path:n,mediaType:e.contentType??e.kind,fileName:e.fileName,...e.origin?{origin:e.origin}:{},...e.sizeBytes===void 0?{}:{sizeBytes:e.sizeBytes},...e.durationMs===void 0?{}:{durationMs:e.durationMs},...e.width===void 0?{}:{width:e.width},...e.height===void 0?{}:{height:e.height}}]:[]})}function Gc(e){if(typeof e==`string`)return!0;if(!Array.isArray(e))return!1;for(let t of e){if(!t||typeof t!=`object`)return!1;let e=t;if(e.type!==`text`||typeof e.text!=`string`)return!1}return!0}function Kc(e){if(!e||typeof e!=`object`)return!1;let t=e;return A(t.role)!==`user`||Wc(t).length>0||!Gc(t.content??t.text)?!1:(Rc(e)?.trim()??``)===``}var qc,Jc;function Yc(){return(Yc=e((()=>{Or(),Gr(),rn(),In(),ca(),ua(),jc(),Fc(),qc=new WeakMap,Jc=new WeakMap})))()}function Xc(e){return e.startsWith(`/`)&&al.some(t=>e.includes(t))}function Zc(e){let t=e.trim();if(!t)return;let n;try{if(/^https?:\/\//i.test(t)||Xc(t)){let e=new URL(t,`https://openclaw.invalid`).pathname;n=e.slice(e.lastIndexOf(`/`)+1);try{let e=n.replace(/%2f/gi,`%252F`).replace(/%5c/gi,`%255C`);n=decodeURIComponent(e)}catch{}}else n=t.split(/[\\/]/).pop()??t}catch{n=t.split(/[\\/]/).pop()??t}return n||void 0}function Qc(e){let t=Zc(e);if(t)return/\.([a-zA-Z0-9]+)$/.exec(t)?.[1]?.toLowerCase()}function $c(e){let t=Qc(e);return t!==void 0&&ol.has(t)}function el(e,t){if(typeof t==`string`&&t.trim()){let e=t.trim().toLowerCase();if(e.startsWith(`image/`))return!0;if(e!==`application/octet-stream`)return!1}let n=Qc(e);return n!==void 0&&[`png`,`jpg`,`jpeg`,`gif`,`webp`,`bmp`,`svg`,`heic`,`heif`,`avif`].includes(n)}function tl(e,t){return(typeof t==`string`?t.split(`;`,1)[0]?.trim().toLowerCase():``)===`image/svg+xml`||Qc(e)===`svg`}function nl(e,t){if(typeof t==`string`&&t.trim().toLowerCase().startsWith(`audio/`))return!0;let n=Qc(e);return n!==void 0&&[`aac`,`flac`,`m2a`,`m4a`,`mp3`,`oga`,`ogg`,`opus`,`wav`].includes(n)}function rl(e,t){return typeof t==`string`&&t.trim().toLowerCase().startsWith(`video/`)?!0:$c(e)}function il(e){let t=e.trim();if(t.startsWith(sl)){let e=t.split(`/`).pop()?.trim()||t;return e.replace(cl,``)||e}try{if(/^https?:\/\//i.test(t)){let e=new URL(t);return Zc(t)?.trim()||e.hostname||t}}catch{}return t.split(/[\\/]/).pop()?.trim()||t}var al,ol,sl,cl;function ll(){return(ll=e((()=>{al=[`/__openclaw__/assistant-media`,`/__openclaw__/media/`,`/api/chat/media/outgoing/`,`/media/inbound/`],ol=new Set([`avi`,`m4v`,`mkv`,`mov`,`mp4`,`mpeg`,`mpg`,`webm`]),sl=`media://inbound/`,cl=/---[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}(?=\.[^./]*$|$)/i})))()}function ul(e){return e===`image`||e===`audio`||e===`video`||e===`document`}function dl(e){let t=l(e);if(!t||t.type!==`attachment`&&t.type!==`attachment_error`)return;let n=l(t.attachment);if(!n||!ul(n.kind)||typeof n.label!=`string`)return[];let r=typeof n.mimeType==`string`?n.mimeType:void 0;if(t.type===`attachment_error`)return n.code!==`file-not-found`&&n.code!==`unsupported-format`&&n.code!==`delivery-failed`?[]:[{type:`attachment_error`,attachment:{code:n.code,kind:n.kind,label:n.label,...r===void 0?{}:{mimeType:r}}}];if(typeof n.url!=`string`)return[];let i={url:n.url,kind:n.kind,label:n.label,...r===void 0?{}:{mimeType:r},...n.origin===`paste`||n.origin===`file`?{origin:n.origin}:{},...n.isVoiceNote===!0?{isVoiceNote:!0}:{},...typeof n.artifactId==`string`?{artifactId:n.artifactId}:{},...n.playback===`native`||n.playback===`transcode`?{playback:n.playback}:{}};for(let e of[`sizeBytes`,`durationMs`,`width`,`height`]){let t=M(n[e]);t!==void 0&&(e===`width`||e===`height`?t>0:t>=0)&&(i[e]=t)}return[{type:`attachment`,attachment:i}]}function fl(){return(fl=e((()=>{fe()})))()}function pl(e,t){return typeof e==`string`?e.startsWith(`data:`)?e:`data:${typeof t==`string`?t:`image/png`};base64,${e}`:void 0}function ml(e){let t=l(e.source);if(e.type===`image`){let n=t?.type===`base64`&&typeof t.data==`string`,r={url:N(e.url)??N(t?.url),dataUrl:pl(n?t.data:e.data,n?t.media_type:e.mimeType),preferData:!0,mimeType:O(e,`mimeType`)??O(t,`media_type`)};for(let t of[`artifactId`,`fileName`,`openUrl`,`alt`]){let n=O(e,t);n!==void 0&&(r[t]=n)}for(let t of[`sizeBytes`,`width`,`height`]){let n=M(e[t]);n!==void 0&&(r[t]=n)}return{type:`image`,sources:[r],inlineSlot:!0}}if(e.type===`image_url`)return{type:`image`,sources:[{url:N(l(e.image_url)?.url)}]};if(e.type===`input_image`)return{type:`image`,sources:[{url:N(e.image_url)??N(l(e.image_url)?.url)},{url:N(t?.url),dataUrl:pl(t?.data,t?.media_type),mimeType:O(t,`media_type`)}]};if(e.type===`openclaw_pairing_qr`)return{type:`image`,sources:[{url:N(e.image_url),alt:O(e,`alt`)}],expiresAtMs:M(e.expiresAtMs)}}function hl(){return(hl=e((()=>{fe()})))()}function gl(e,t){return!!(e.viewId&&e.viewId===t.viewId||e.url&&e.url===t.url)}function _l(e){let t=l(e);if(!(!t||t.audioAsVoice!==void 0&&t.audioAsVoice!==!0||t.replyToCurrent!==void 0&&t.replyToCurrent!==!0))return{audioAsVoice:t.audioAsVoice,replyToCurrent:t.replyToCurrent,replyToId:O(t,`replyToId`)}}function vl(e){let t=l(e);if(!t)return;let n=N(t.sessionKey),r=N(t.agentId),i=N(t.label);return n||r?{...`sessionKey`in t?{sessionKey:n}:{},...`agentId`in t?{agentId:r}:{},...i?{label:i}:{}}:void 0}function yl(e){if(e.type!==`image`||e.omitted!==!0||N(e.artifactId)!==void 0||N(e.url)!==void 0)return null;let t=ue(e.bytes);return{type:`omitted_media`,media:{kind:`image`,...t===void 0?{}:{sizeBytes:t}}}}function bl(e){let t=e.toLowerCase();return[`user`,`assistant`,`system`].includes(t)?t:[`toolresult`,`tool_result`,`tool`,`function`].includes(t)?`tool`:e}function xl(e){return typeof e?.toolCallId==`string`||typeof e?.tool_call_id==`string`||typeof e?.toolUseId==`string`||typeof e?.tool_use_id==`string`||typeof e?.toolName==`string`||typeof e?.tool_name==`string`}function Sl(e){let t=l(e),n=t?.content;return Array.isArray(n)&&n.some(e=>{let t=l(e)?.type;return sn(t)||hn(t)})||xl(t)?`toolResult`:O(t,`role`)??`unknown`}function Cl(e){let t=Sn(e?.senderIdentity);return ps({identity:t,id:e?.senderId,name:e?.senderName,username:e?.senderUsername,profileAvatarUrl:t?.type===`profile`?e?.senderProfileAvatarUrl:void 0})}function wl(e,t){let n=l(e),r=O(n,`senderLabel`)?.trim()??``;return r?r.replace(Ll,``).trim():fs(t===void 0?Cl(l(n?.__openclaw)):t)}function Tl(e){let t=l(e),n=typeof t?.role==`string`?t.role.toLowerCase():``;return n===`toolresult`||n===`tool_result`}function El(e){let t=l(e);return(typeof t?.role==`string`?bl(t.role):`unknown`)===`tool`||xl(t)}function Dl(e){let t=l(e),n=t?.type===`canvas`?l(t.preview):void 0;if(!n||n.kind!==`canvas`||n.surface===`tool_card`||n.render!==`url`)return null;let r={kind:`canvas`,surface:`assistant_message`,render:`url`};for(let e of[`title`,`url`,`viewId`,`className`,`style`]){let t=O(n,e);t!==void 0&&(r[e]=t)}let i=M(n.preferredHeight);i!==void 0&&(r.preferredHeight=i);let a=n.sandbox;(a===`strict`||a===`scripts`)&&(r.sandbox=a);let o=n.boardWidgetName;fn(o)&&(r.boardWidgetName=o);let s=l(n.mcpApp),c=O(s,`viewId`);if(c?.trim()){r.mcpApp={viewId:c};for(let e of[`serverName`,`toolName`,`uiResourceUri`,`toolCallId`,`originSessionKey`]){let t=O(s,e);t!==void 0&&(r.mcpApp[e]=t)}}return r}function Ol(e){let t=Qc(e);return t?Rl[t]:void 0}function kl(e){let t=Ol(e),n=Nr(t);return{kind:!n||n===`sticker`||n===`unknown`?`document`:n,mimeType:t,label:(()=>{try{if(/^https?:\/\//i.test(e)){let t=new URL(e);return t.pathname.split(`/`).pop()?.trim()||t.hostname||e}}catch{}return e.split(/[\\/]/).pop()?.trim()||e})()}}function Al(e){if(e.type!==`audio`)return null;let t=l(e.source);if(!t)return null;let n=O(t,`media_type`)?.trim(),r=n?.toLowerCase().startsWith(`audio/`)?n:`audio/mpeg`,i=t.type,a=O(t,i===`base64`?`data`:`url`)?.trim();return!a||i!==`base64`&&i!==`url`?null:{type:`attachment`,attachment:{url:i===`base64`&&!a.startsWith(`data:`)?`data:${r};base64,${a}`:a,kind:`audio`,label:O(e,`label`)?.trim()||`Audio`,mimeType:r,...e.isVoiceNote===!0?{isVoiceNote:!0}:{}}}}function jl(e){let t=e.type,n=O(e,`url`)?.trim();if(t!==`audio`&&t!==`video`||!n)return null;let r={url:n,kind:t,label:O(e,`fileName`)?.trim()||O(e,`label`)?.trim()||(t===`audio`?`Audio`:`Video`)};for(let t of[`mimeType`,`artifactId`]){let n=O(e,t);n!==void 0&&(r[t]=n)}t===`audio`&&e.isVoiceNote===!0&&(r.isVoiceNote=!0);let i=e.playback;(i===`native`||i===`transcode`)&&(r.playback=i);for(let n of[`sizeBytes`,`durationMs`,`width`,`height`]){let i=M(e[n]);i!==void 0&&(n===`width`||n===`height`?t===`video`&&i>0:i>=0)&&(r[n]=i)}return{type:`attachment`,attachment:r}}function Ml(e){let t=[];for(let n of e){let e=t[t.length-1];if(n.type===`text`&&e?.type===`text`){e.text=[e.text,n.text].filter(e=>e!==void 0).join(`
`);continue}t.push(n)}return t.filter(e=>e.type!==`text`||!!e.text?.trim())}function Nl(e){return e.map(e=>e.type!==`text`||typeof e.text!=`string`?e:{...e,text:zr(e.text)}).filter(e=>e.type!==`text`||!!e.text?.trim())}function Pl(e){let t=e?.replyToId?.trim();return t?{kind:`id`,id:t}:e?.replyToCurrent===!0?{kind:`current`}:null}function Fl(e,t,n){let r=xn(e),i=Mn(r.text,{extractAudioDirectives:!1}),a=[],o=t?.audioAsVoice===!0,s=Pl(t),c=i.segments??[{type:`text`,text:i.text}];for(let e of c){if(e.type===`media`){let t=kl(e.url);a.push({type:`attachment`,attachment:{url:e.url,kind:t.kind,label:t.label,mimeType:t.mimeType}});continue}e.text&&a.push({type:`text`,text:e.text})}for(let e of r.previews)e.surface!==`assistant_message`||n.some(t=>gl(e,t))||a.push({type:`canvas`,preview:{...e,surface:`assistant_message`},rawText:null});let l=Ml(a.map(e=>e.type===`attachment`&&e.attachment.kind===`audio`&&o?Object.assign({},e,{attachment:{...e.attachment,isVoiceNote:!0}}):e));return{content:l.length>0?l:s===null&&!o&&i.text.trim().length>0?[{type:`text`,text:i.text}]:[],audioAsVoice:o}}function Il(e){let t=l(e),n=t&&zl.get(t);if(n)return n;let r=l(Dn(Nc(e)))??{},i=Sl(r),a=typeof r.content==`string`||Array.isArray(r.content)?r.content:typeof r.text==`string`?r.text:void 0,o=Array.isArray(a)?a:null,s=i===`assistant`,c=s?_l(r.openclawDelivery):void 0,u=(o??[]).flatMap(e=>{let t=Dl(e);return t?[t]:[]}),d=[],f=!1,p=Pl(c);if(typeof a==`string`){if(s){let e=Fl(a,c,u);d=e.content,f=e.audioAsVoice}else d=[{type:`text`,text:a}]}else o&&(d=o.flatMap(e=>{let t=l(e);if(!t)return[];let n=yl(t);if(n)return[n];let r=ml(t);if(r)return[r];let a=t.type;if(a===`clawhub`){let e=s?ga(t):null;return e?[e]:[]}let o=O(t,`text`);if(a===`thinking`){let e=O(t,`thinking`);return e===void 0?[]:[{type:a,thinking:e}]}if(s){let e=jl(t);if(e)return[e];let n=Al(t);if(n)return[n]}else if(a===`audio`)return[];if(a===`attachment`||a===`attachment_error`)return dl(t)??[];if(a===`canvas`){let e=Dl(t);return e?[{type:`canvas`,preview:e,rawText:O(t,`rawText`)??null}]:[]}if(o!==void 0&&(a===`text`||i===`user`&&a===`input_text`||i===`assistant`&&(a===`input_text`||a===`output_text`))){if(s){let e=Fl(o,c,u);return f||=e.audioAsVoice,e.content}return[{type:`text`,text:o,name:void 0,args:void 0}]}return[{type:a||`text`,text:o,name:t.name,args:pn(t)}]}));let m=M(r.timestamp)??Date.now(),h=O(r,`id`),g=l(r.__openclaw),_=O(g,`replyToId`)?.trim()??``;_&&(p={kind:`id`,id:_});let v=l(g?.replyToPreview),y=O(v,`text`)?.trim()??``,b=O(v,`senderLabel`)?.trim()??``,x=Cl(g),S=wl(r,x),C=x??(S?{name:S}:null),w=i===`user`?bn(r):[];d=Nl(d);let ee=vl(r.senderSession),T={role:i,content:d,timestamp:m,id:h,senderLabel:S,...ee?{senderSession:ee}:{},...C?{sender:C}:{},...w.length?{sourceClients:w}:{},...f?{audioAsVoice:!0}:{},...y?{replyPreview:{text:y,...b?{senderLabel:b}:{}}}:{},...p?{replyTarget:p}:{}};return t&&M(r.timestamp)!==void 0&&zl.set(t,T),T}var Ll,Rl,zl;function Bl(){return(Bl=e((()=>{xr(),fe(),Gr(),cn(),Wn(),Cn(),mn(),rn(),an(),pa(),ll(),Fc(),fl(),hl(),hs(),Ll=/\s+\(([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\)$/iu,Rl={png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,webp:`image/webp`,gif:`image/gif`,heic:`image/heic`,heif:`image/heif`,ogg:`audio/ogg`,oga:`audio/ogg`,mp3:`audio/mpeg`,wav:`audio/wav`,flac:`audio/flac`,aac:`audio/aac`,opus:`audio/opus`,m4a:`audio/mp4`,m2a:`audio/mpeg`,mp4:`video/mp4`,webm:`video/webm`,mov:`video/quicktime`,pdf:`application/pdf`,txt:`text/plain`,md:`text/markdown`,csv:`text/csv`,json:`application/json`,zip:`application/zip`},zl=new WeakMap})))()}function Vl(e){return e.orderKey??e.createdAt}function Hl(e,t){return Vl(e)-Vl(t)}function Ul(e){return!e.pendingRunId&&!e.intent&&(e.sendAttempts??0)===0&&(e.sendState===void 0||e.sendState===`waiting-idle`||e.sendState===`waiting-reconnect`||e.sendState===`failed`)}function Wl(e,t=Ul){let n=[],r=[];for(let i of e.toSorted(Hl)){if(t(i)){r.push(i);continue}r.length>0&&(n.push(r),r=[])}return r.length>0&&n.push(r),n}function Gl(e,t,n){let r=e.toSorted(Hl),i=r.findIndex(e=>e.id===t),a=Math.min(Math.max(n,0),r.length-1);if(i<0||i===a)return[];let o=r.map(Vl);for(let e=1;e<o.length;e+=1)o[e]=Math.max(o[e],o[e-1]+1);let s=r.splice(i,1)[0];return r.splice(a,0,s),r.flatMap((e,t)=>Vl(e)===o[t]?[]:[{...e,orderKey:o[t]}])}function Kl(){return(Kl=e((()=>{})))()}function ql(){let e=null,t=()=>{e=null};return{invalidate:t,subscribe(e){return ac(()=>{t(),e()})},read(t){let n=[t.settings?.gatewayUrl,t.assistantAgentId,t.agentsList,t.hello,t.client,t.client?.recoveryScope,t.client?.recoveryScopeReady,t.connected],r=e;if(r&&n.every((e,t)=>Object.is(e,r.inputs[t])))return r.summary;let i=Zl(t);return e={inputs:n,summary:i},i}}}function Jl(e){let t=Oe();if(!t)return[];try{let n=cc(e.settings?.gatewayUrl),r=gc(t,n);if(uc(r,e))try{_c(t,n,r)}catch{}return Object.entries(r.sessions).flatMap(([t,n])=>{let r=lc(t);return r?[{scope:r,session:{...n,queue:n.queue?.filter(t=>Ls(e,t))}}]:[]})}catch{return[]}}function Yl(e){return Jl(e).flatMap(({scope:e,session:t})=>t.queue?.length?[{...e,queue:t.queue.toSorted(Hl)}]:[]).toSorted((e,t)=>(e.queue[0]?.createdAt??2**53-1)-(t.queue[0]?.createdAt??2**53-1)||e.sessionKey.localeCompare(t.sessionKey))}function Xl(e,t){return Yl(e).find(e=>e.sessionKey===t.sessionKey&&e.agentId===t.agentId)}function Zl(e){let t=new Map,n=new Set;for(let{scope:r,session:i}of Jl(e)){let e=F(r);i.draft&&n.add(e);let a=t.get(e)??{all:new Set,attention:new Set};for(let e of i.queue??[])e.pendingRunId||(a.all.add(e.id),(e.sendState===`failed`||e.sendState===`unconfirmed`||e.sendState===`held`)&&a.attention.add(e.id));a.all.size&&t.set(e,a)}let r=new Map,i=0;for(let[e,n]of t)i+=n.all.size,n.attention.size&&r.set(e,n.attention.size);let a=t=>F(bt(e,t));return{total:i,attentionCountForSession:e=>r.get(a(e))??0,hasSessionDraft:e=>n.has(a(e))}}function Ql(){return(Ql=e((()=>{V(),Gs(),kc()})))()}function $l(e){let t=l(e)?.activity;return Array.isArray(t)?t.filter(e=>Ci(ei,e)):[]}function eu(e){let t=Sr(e),n=Object.entries(t.counts).filter(([,e])=>e>0).map(([e,t])=>B(`chat.toolCards.activity.${e}${t===1?`One`:`Many`}`,{count:String(t)})).join(` · `),r=Object.entries(t.outcomes).filter(([,e])=>e>0).map(([e,t])=>({kind:e,label:B(e===`skipped`?`chat.toolCards.skippedCount`:`chat.toolCards.activity.${e}`,{count:String(t)})}));return{total:t.total,label:n,outcomes:r}}function tu(e,t={}){let n=eu(e);return[n.label,...n.outcomes.filter(({kind:e})=>t.includeInlineOutcomes!==!1||e!==`failed`&&e!==`skipped`).map(({label:e})=>e)].filter(Boolean).join(` · `)||B(`chat.toolCards.rawDetails`)}function nu(){return(nu=e((()=>{wi(),ci(),Tr(),U()})))()}function ru(e){if(typeof e.messageId==`string`&&e.messageId.trim())return e.messageId;let t=e.__openclaw,n=E(t);return typeof n?.id==`string`&&n.id.trim()?n.id:void 0}function iu(e){let t=E(E(e)?.__openclaw),n=E(t?.toolOutput);return(n?.source===`provider-response`||n?.source===`execution`)&&n.modelInput===`unverified`?{source:n.source,modelInput:n.modelInput,...n.outcome===`unknown`?{outcome:`unknown`}:{},...n.captureTruncated===!0?{captureTruncated:!0}:{}}:void 0}function au(e){return Array.isArray(e)?e.filter(e=>!!e&&typeof e==`object`):[]}function ou(e){if(typeof e!=`string`)return e;let t=e.trim();if(!t||!t.startsWith(`{`)&&!t.startsWith(`[`))return e;try{return JSON.parse(t)}catch{return e}}function su(e){return a(e.trim())??null}function cu(e){if(typeof e.text==`string`)return e.text;if(typeof e.content==`string`)return e.content;if(Array.isArray(e.content)){let t=e.content.flatMap(e=>{if(!e||typeof e!=`object`)return[];let t=e.text;return typeof t==`string`?[t]:[]});if(t.length>0)return t.join(`
`)}}function lu(...e){for(let t of e){let e=d(t),n=e?.exitCode??e?.exit_code;if(typeof n==`number`&&Number.isInteger(n))return n}}function uu(e){if(e.activity)return e.activity.status===`skipped`;let t=d(e.details);return(e.live!==!0||e.completed===!0)&&t?.status===`skipped`&&t.deniedReason===`steering`}function du(e){if(uu(e))return!1;if(e.activity)return e.activity.status===`failed`;let t=e.live!==!0||e.completed===!0;return e.isError??(t&&gn(e.outputText))}function fu(e,t){if(uu(e))return`skipped`;if(e.toolOutput?.outcome===`unknown`)return du(e)?`failed`:`unknown`;if(e.activity)switch(e.activity.status){case`failed`:case`blocked`:return e.activity.status;case`completed`:return`succeeded`;case`running`:return t===!0&&e.live===!0?`running`:`unknown`;default:return`unknown`}return du(e)?`failed`:t===!0&&e.live===!0&&e.completed!==!0?`running`:e.completed===!0||e.live!==!0&&e.outputText!==void 0?`succeeded`:`unknown`}function pu(e,t){let n=yn(e,t);return n?.surface===`assistant_message`?{...n,surface:`assistant_message`}:void 0}function mu(e,t,n,r=n){let i=ln(e),a=i?.surface===`assistant_message`?{...i,surface:`assistant_message`}:pu(t,n);if(a)return{preview:{...a,surface:`assistant_message`}};let o=E(E(e)?.browserTab),s=Di(o);if(r!==`browser`||!o||!s)return{};let c=typeof o.url==`string`?p(o.url,2048):``;return{browserTab:s,preview:wr(c)?{kind:`browser-tab`,...s,url:c,...typeof o.title==`string`?{title:p(o.title,512)}:{}}:void 0}}function hu(e,t){return _n(e)||typeof e.callId==`string`&&e.callId.trim()||typeof t.toolCallId==`string`&&t.toolCallId.trim()||typeof t.tool_call_id==`string`&&t.tool_call_id.trim()||typeof t.toolUseId==`string`&&t.toolUseId.trim()||typeof t.tool_use_id==`string`&&t.tool_use_id.trim()||void 0}function gu(e,t){return typeof e.name==`string`&&e.name.trim()||typeof t.toolName==`string`&&t.toolName.trim()||typeof t.tool_name==`string`&&t.tool_name.trim()||`tool`}function _u(e){if(e!=null){if(typeof e==`string`)return e;try{return JSON.stringify(e,null,2)}catch{return typeof e==`bigint`?String(e):Object.prototype.toString.call(e)}}}function vu(e){let t=e?.trim().replace(/\s+/g,` `);if(t)return t.replace(/^with\s+/i,``).trim()||t}function yu(e){return vu(e)?.toLowerCase().replace(/[\s._-]+/g,``)}function bu(e,t){let n=vu(e);if(!n)return;let r=yu(n),i=yu(t);return r&&i&&r===i?void 0:n}function xu(e){let t=vu(e);if(t)return p(t,120)}function Su(e){if(!h(e))return;let t=e;for(let e of Du){let n=t[e];if(typeof n!=`string`)continue;let r=n.search(/\S/),i;if(r>=0){let e=Math.max(n.lastIndexOf(`\r`,r),n.lastIndexOf(`
`,r))+1,t=/[\r\n]/g;t.lastIndex=r,i=n.slice(e,t.exec(n)?.index??n.length)}let a=xu(i?ct(i):void 0);if(a)return a}}function Cu(e){return hn(e.type)||typeof e.name==`string`&&(e.arguments!=null||e.args!=null||e.input!=null)}function wu(e){let t=e,n=typeof t.role==`string`?t.role.toLowerCase():``,r=Tl(e)||n===`tool`||n===`function`||typeof t.toolName==`string`||typeof t.tool_name==`string`,i=au(t.content),a=un(t),o=t.__openclawToolStreamLive===!0,s=d(t.__openclawToolStreamDiffStat),c=typeof s?.added==`number`&&Number.isInteger(s.added)&&s.added>=0&&typeof s.removed==`number`&&Number.isInteger(s.removed)&&s.removed>=0?{added:s.added,removed:s.removed}:void 0,l=[],u=new WeakSet,f=ru(t),p=ri(t)?.runId??j(t.runId);for(let e=0;e<i.length;e++){let n=i[e]??{},s=j(n.runId)??p,d=j(n.parentToolCallId);if(Cu(n)){let r=ou(n.arguments??n.args??n.input),i=hu(n,t),a=gu(n,t),u=n.details??t.details;l.push({id:i??`${a}:${e}`,...i?{callId:i}:{},...s?{runId:s}:{},...d?{parentToolCallId:d}:{},name:a,args:r,inputText:_u(r),...u===void 0?{}:{details:u},...o?{live:!0,completed:t.__openclawToolStreamResultReceived===!0}:{},...c?{liveDiffStat:c}:{},messageId:f});continue}if(sn(n.type)){let i=gu(n,t),c=hu(n,t),p=c??`${i}:${e}`,m=l.find(e=>e.id===p)??l.find(e=>(!c||!e.callId)&&e.name===i&&e.outputText===void 0&&!u.has(e)),h=cu(n),g=E(n.__openclaw),_=g&&Object.hasOwn(g,`id`)?j(g.id):f,v=iu(n)??iu(t),y=(g&&Object.hasOwn(g,`truncated`)?g:E(t.__openclaw))?.truncated===!0,b=n.details??t.details,x=r?gu({},t):void 0,S=mu(b,h,i,x&&x!==`browser`?x:m?.name??x??i),C=un(n)??a,w=lu(n,b,h?su(h):void 0,t);if(m){u.add(m),m.callId??=c,m.runId??=s,m.parentToolCallId??=d,o||(m.completed=!0),m.outputText=h,m.resultMessageId=_,m.outputTruncated=y,m.toolOutput=v,m.preview=S.preview,m.browserTab=S.browserTab,b!==void 0&&(m.details=b),C!==void 0&&(m.isError=C),w!==void 0&&(m.exitCode=w);continue}l.push({id:p,...c?{callId:c}:{},...s?{runId:s}:{},...d?{parentToolCallId:d}:{},name:i,completed:!0,outputText:h,resultMessageId:_,outputTruncated:y,toolOutput:v,...b===void 0?{}:{details:b},messageId:f,...C===void 0?{}:{isError:C},...w===void 0?{}:{exitCode:w},...S})}}if(r&&l.length===0){let r=typeof t.toolName==`string`&&t.toolName||typeof t.tool_name==`string`&&t.tool_name||`tool`,i=cu(t),o=hu({},t),s=lu(t,t.details,i?su(i):void 0);l.push({id:o??`${gu({},t)}:0`,...o?{callId:o}:{},...p?{runId:p}:{},name:r,completed:Tl(e)||n===`tool`||n===`function`,outputText:i,resultMessageId:f,outputTruncated:E(t.__openclaw)?.truncated===!0,toolOutput:iu(t),...t.details===void 0?{}:{details:t.details},messageId:f,...a===void 0?{}:{isError:a},...s===void 0?{}:{exitCode:s},...mu(t.details,i,r)})}let m=new Map($l(e).filter(e=>!e.suppressChannelProgress).map(e=>[e.toolCallId??e.itemId,e])),h;for(let[e,t]of l.entries()){let n=t.callId?m.get(t.callId):void 0;n&&(t.activity=n),!(!t.browserTab||t.callId||t.messageId)&&(h??=++Ou,t.previewRevision=`${h}:${e}`)}return l}function Tu(e){if(!e||typeof e!=`object`)return wu(e);let t=ku.get(e);if(t)return t;let n=wu(e);return ku.set(e,n),n}function Eu(e,t){let n=Au.get(e),r=n?.get(t);if(r)return r;let i=wu({...e,content:[t]});return n||(n=new WeakMap,Au.set(e,n)),n.set(t,i),i}var Du,Ou,ku,Au;function ju(){return(ju=e((()=>{ii(),Er(),pe(),cn(),mn(),Hi(),ze(),Bl(),nu(),Du=[`message`,`prompt`,`task`,`query`,`text`,`description`],Ou=0,ku=new WeakMap,Au=new WeakMap})))()}function Mu(e){return{key:e.key,agentId:e.agentId,...e.target.kind===`profile`?{profileId:e.target.profileId,...e.target.os?{os:e.target.os}:{},...e.target.machineClass?{machineClass:e.target.machineClass}:{}}:e.target.kind===`device`?{deviceId:e.target.deviceId}:{autoDevice:!0}}}function Nu(e){return e instanceof Gn?e.retryable||e.gatewayCode===`UNAVAILABLE`:!0}async function Pu(e,t){try{let n=await e.describe({key:t},{refresh:!0,client:e.client});if(n?.session===null)return{status:`missing`};let r=n?.session?.sessionId;return{status:`read`,placement:n?.session?.placement,...typeof r==`string`&&r.trim()?{sessionId:r}:{}}}catch(e){return Pt(e,null)?{status:`awaiting-gateway`}:Nu(e)?{status:`unavailable`}:{status:`rejected`,error:I(e)}}}async function Fu(e,t){try{await e.request(`sessions.reclaim`,{key:t.key,agentId:t.agentId});return}catch(e){return I(e)}}async function Iu(e,t,n,r){if(!n())return{status:`interrupted`};let i=await Fu(e,t);return i?{status:`cleanup-rejected`,error:i,...r===void 0?{}:{messageId:r}}:{status:`cancelled`}}async function Lu(e,t,n){let{client:r}=e,i=t.initial?{status:`read`,placement:t.initial}:void 0,a=0,o=0,s=!1;for(let c=0;c<Wu;c+=1){let c=i??await Pu(e,t.key);if(s=c.status===`read`&&c.placement!==void 0&&qu.has(c.placement.state),i=void 0,c.status===`missing`)return{status:`missing`};if(c.status===`rejected`)return{status:`cleanup-rejected`,error:c.error};if(c.status===`unavailable`||c.status===`awaiting-gateway`){if(a=c.status===`awaiting-gateway`?0:a+1,!n())return Iu(r,t,t.cleanupOnCancellation);if(a>=Gu){let e=await Fu(r,t),n=`session placement could not be verified`;return{status:`cleanup-rejected`,error:e?`${n}; cleanup failed: ${e}`:n}}await new Promise(e=>{globalThis.setTimeout(e,Uu)});continue}if(a=0,c.status===`read`){let e=c.placement;if(e)o=0;else if(o+=1,o>=Ku)return{status:`cleanup-rejected`,error:`session placement could not be verified`};if(!n())return Iu(r,t,t.cleanupOnCancellation);if(e?.state===`active`)return{status:`active`,placement:e};if(t.mode===`retry`&&(!e||e.state===`local`||e.state===`reclaimed`||e.state===`failed`))return{status:`dispatch`};if(e&&!qu.has(e.state)){if(e.state===`failed`){let e=await Fu(r,t);if(e)return{status:`cleanup-rejected`,error:e}}return{status:`rejected`,placement:e}}}await new Promise(e=>{globalThis.setTimeout(e,Uu)})}return n()?{status:`cleanup-rejected`,error:B(s?`newSession.placementStillStarting`:`newSession.placementCompletionUnconfirmed`)}:Iu(r,t,t.cleanupOnCancellation)}async function Ru(e,t,n){return zu(e,t,n,!1)}async function zu(e,t,n,r){let{client:i}=e;if(!i)return`gateway unavailable during draft cleanup`;let a=await Pu({...e,client:i},t);if(a.status!==`missing`){if(a.status===`rejected`)return a.error;if(a.status===`unavailable`||a.status===`awaiting-gateway`)return r?`session placement could not be verified`:`placement draft session could not be verified`;if(r&&a.placement){let e=await Fu(i,{key:t,agentId:n});if(e)return e}return a.sessionId?Bu(i,{key:t,agentId:n,sessionId:a.sessionId}):`placement draft session identity is unavailable`}}async function Bu(e,t){try{await e.request(`sessions.patch`,{key:t.key,agentId:t.agentId,archived:!0,expectedSessionId:t.sessionId})}catch(e){return I(e)}try{if((await e.request(`sessions.delete`,{key:t.key,agentId:t.agentId,deleteTranscript:!0,expectedSessionId:t.sessionId,archivedOnly:!0})).deleted!==!0)throw Error(`placement draft session was not deleted`);return}catch(n){let r=I(n);try{await e.request(`sessions.patch`,{key:t.key,agentId:t.agentId,archived:!1,expectedSessionId:t.sessionId})}catch(e){return`${r}; restoring the placement draft failed: ${I(e)}`}return r}}async function Vu(e,t,n){return zu(e,t,n,!0)}async function Hu(e,t,n,r=()=>!0){let{client:i}=e,a=t.message,o=t.mentions?.map(e=>({...e})),s=t.cleanupOnCancellation??(()=>!0),c,l=``;if(t.mode!==`dispatch`&&(c=await Lu(e,{key:t.key,agentId:t.agentId,mode:t.mode,cleanupOnCancellation:s},n)),c?.status===`dispatch`&&!n())return Iu(i,t,s);if(!c||c.status===`dispatch`)try{let r=await i.request(`sessions.dispatch`,Mu(t));c=await Lu(e,{key:t.key,agentId:t.agentId,initial:r.placement,mode:`recover`,cleanupOnCancellation:s},n)}catch(r){if(l=I(r),!s()&&!n())return{status:`interrupted`};if(!Nu(r))return{status:`dispatch-rejected`,error:l};c=await Lu(e,{key:t.key,agentId:t.agentId,mode:`recover`,cleanupOnCancellation:s},n)}if(!s()&&!n())return{status:`interrupted`};if(c.status===`cancelled`||c.status===`interrupted`||c.status===`cleanup-rejected`)return c;if(c.status===`missing`)return{status:`session-missing`,error:`placement draft session no longer exists`};if(c.status===`rejected`){let e=typeof c.placement?.state==`string`?c.placement.state:``;return{status:`dispatch-rejected`,error:l||(e?`session placement became ${e}`:``)}}if(!n())return Iu(i,t,s);let u=t.messageId??T(),d=async(e,n)=>{let r=await Fu(i,t);return{status:n,messageId:u,error:r?`${e}; cleanup failed: ${r}`:e}};if(!r())return d(`placement recovery storage is unavailable`,`send-not-started`);try{let e=await i.request(`sessions.send`,{key:t.key,agentId:t.agentId,message:a,...o?.length?{mentions:o}:{},attachments:t.attachments,idempotencyKey:u});if(!n())return await Iu(i,t,s,u);let r=qi(e,u);return Gi(r)?d(Ki(r,`chat`),`send-definitive-rejected`):{status:`started`,messageId:u}}catch(e){return n()?e instanceof lr||e instanceof Error&&!(e instanceof Gn)&&e.message===`gateway not connected`?d(I(e),`send-not-started`):Nu(e)?{status:`send-rejected`,error:I(e),messageId:u}:d(I(e),`send-definitive-rejected`):Iu(i,t,s,u)}}var Uu,Wu,Gu,Ku,qu;function Ju(){return(Ju=e((()=>{ir(),U(),ka(),H(),Rt(),c(),Yi(),Xi(),Oa(),Uu=250,Wu=1200,Gu=4,Ku=20,qu=new Set([`requested`,`provisioning`,`syncing`,`starting`,`draining`,`reconciling`])})))()}async function Yu(e){let t=e.persistRecovery!==!1,n=e.mode!==`dispatch`,r=e.recovery,i=`not-sent`,a=(e,n=i)=>({status:`paused`,recovery:Ja(r,e,t,n).recovery}),o=()=>e.isLifecycleCurrent()&&e.ownsRecovery(),s=async(t=n)=>{let i=await(t?Vu:Ru)(e,r.sessionKey,r.agentId);return i||e.clearRecovery(`resolved`),i};if(r.phase===`sending`||r.phase===`paused`&&r.reason===`unconfirmed`){if(!o())return{status:`interrupted`};let t=await e.client.request(`chat.history`,{sessionKey:r.sessionKey,...Ht(r.sessionKey)?{agentId:r.agentId}:{},limit:1e3,...r.messageId.length<=256?{inputRunIds:[r.messageId]}:{}}).catch(e=>({error:I(e)}));if(!o())return{status:`interrupted`};if(`error`in t)return a(t.error,`unconfirmed`);let n=$a(t,{sendRunId:r.messageId});if(n||eo(t.messages,r.messageId,!0)){e.clearRecovery(`resolved`);let i=t.inputReceipts?.find(e=>e.runId===r.messageId);return n?{status:`accepted`,...i?.state===`consumed`?{consumedByEventId:i.consumedByEventId}:{}}:{status:`started`,messageId:r.messageId}}return a(`No matching user message was found in the available history. Delivery remains unconfirmed.`,`unconfirmed`)}if(r.phase===`paused`)return{status:`paused`,recovery:r};let c=n&&t?Ua(r.gatewayUrl,r.recoveryScope,r.sessionKey):null;if(!o()){if(!e.cleanupOnCancellation())return{status:`interrupted`};let i=t?n?c?.messageId===r.messageId:Ga(r):!1,a=await s();return{status:`cancelled`,cleanupError:a,recoveryPersisted:a?i:!1}}let l=t?n?c?.messageId===r.messageId:Ga(r):!0;if(!o()||!l)return!e.cleanupOnCancellation()&&!o()?{status:`interrupted`}:n&&!l?{status:`cancelled`,cleanupError:`placement recovery storage is unavailable`,recoveryPersisted:!1}:{status:`cancelled`,cleanupError:await s(),recoveryPersisted:l};let u=await Hu(e,{key:r.sessionKey,agentId:r.agentId,target:r.target,message:r.message,mentions:r.mentions,attachments:r.attachments,messageId:r.messageId,mode:e.mode,cleanupOnCancellation:e.cleanupOnCancellation},o,()=>{if(!t)return i=`unconfirmed`,e.setRecoveryPhase(`sending`,!1),!0;let n=Ua(r.gatewayUrl,r.recoveryScope,r.sessionKey);if(n&&n.messageId!==r.messageId)return!1;let a=Wa({...r,phase:`sending`});return a&&(i=`unconfirmed`,e.setRecoveryPhase(`sending`,!0)),a});return!e.cleanupOnCancellation()&&!o()?{status:`interrupted`}:u.status===`interrupted`?u:u.status===`cancelled`?{status:`cancelled`,cleanupError:await s(!1),recoveryPersisted:t}:u.status===`cleanup-rejected`?a(u.error):u.status===`session-missing`?(e.clearRecovery(`resolved`),{status:`cancelled`,recoveryPersisted:!1}):u.status===`send-not-started`?a(u.error,`not-sent`):u.status===`send-definitive-rejected`?a(u.error,`rejected`):u.status===`dispatch-rejected`||u.status===`send-rejected`?a(u.error):e.isLifecycleCurrent()?e.ownsRecovery()?(e.clearRecovery(`resolved`),u):(e.clearRecovery(`resolved`),{status:`ownership-lost`}):(e.clearRecovery(`interrupted`),{status:`interrupted`})}function Xu(){return(Xu=e((()=>{si(),io(),H(),V(),Qa(),Ju()})))()}function Zu(e,t,n=We().resourceBasePath){try{let r=new URL(e,nd),i=$n();if(i){let e=new URL(i.gatewayUrl).pathname.replace(/\/$/u,``),t=xe(r.pathname,e);t&&(r.pathname=`${e}${t}`);let n=r.origin===nd?`${r.pathname}${r.search}`:r.href;r=new URL(cr(n),nd)}let a=r.origin===nd,o=xe(r.pathname,n),s=on(`agentAvatar`,r.pathname,n),c=o?`${n}${o}`:s.matched&&s.value?Hn(`agentAvatar`,n,s.value):null;if(!c)return null;let l=`${c}${r.search}`;return a?t?new URL(l,t).toString():l:t&&r.origin===t?t+l:null}catch{return null}}function Qu(e){return e.trim().split(/\s+/u).filter(Boolean).slice(0,2).map(e=>Fe(e,1)).join(``).toUpperCase()||`?`}function $u(e){let t=e.id?.trim(),n=fs(e)??`?`;return{kind:`initials`,initials:Qu(n),colorSeed:Ae(t||n)}}function ed(e){return $u(e).colorSeed%360}function td(e){let t=e.identity;if(t&&t.type!==`profile`&&t.type!==`agent`)return $u(e);let{origin:n,resourceBasePath:r}=We(),a=e.profileAvatarUrl?.trim();if(a){let e=Zu(a,n);if(e&&(!t||on(t.type===`agent`?`agentAvatar`:`userAvatar`,new URL(e,nd).pathname,r).matched))return{kind:`profile`,url:e}}if(t?.type===`profile`){let e=Zu(i(t.id),n);if(e)return{kind:`profile`,url:e}}return $u(e)}var nd;function rd(){return(rd=e((()=>{vn(),ee(),hs(),rt(),He(),nd=`https://origin-probe.invalid`})))()}function id(){fd+=1;for(let e of q.values())e.blobUrl&&URL.revokeObjectURL(e.blobUrl);q.clear()}function ad(){for(let[e,t]of q){if(q.size<=ld)break;!t.settled||t.references>0||(q.delete(e),t.blobUrl&&URL.revokeObjectURL(t.blobUrl))}}function od(e){let t=q.get(e);if(q.delete(e),t&&(t.retryAt===void 0||Date.now()<t.retryAt))return q.set(e,t),t.blobUrl??t.promise;let n={blobUrl:null,references:0,settled:!1,promise:Promise.resolve(null)};return n.promise=(async()=>{try{let t=await Dt(e,ud);if(!t.ok)return null;let r=await t.blob();if(r.size===0||r.size>2097152||!o(r.type))return null;let i=URL.createObjectURL(r);return q.get(e)===n?(n.blobUrl=i,ad(),i):(URL.revokeObjectURL(i),null)}catch{return null}finally{!n.blobUrl&&q.get(e)===n&&(n.settled=!0,n.retryAt=Date.now()+dd,ad())}})(),q.set(e,n),ad(),n.promise}function sd(e){let{authTokens:t,origin:n,resourceBasePath:r}=We(),i=Zu(e,n,r);return i?n||t.length?od(i):i:null}function cd(e){let t=e?[...q.values()].find(t=>t.blobUrl===e||t.promise===e):void 0;if(!t)return()=>void 0;t.references+=1;let n=!1;return()=>{n||(n=!0,--t.references,t.settled=!0,ad())}}var ld,ud,dd,q,fd,pd;function md(){return(md=e((()=>{C(),He(),rd(),ld=128,ud=3e4,dd=6e4,q=new Map,fd=0,Ye(id),pd=class{constructor(e){this.host=e,this.connected=!1,this.routes=new Map,this.activeRoutes=null,this.generation=fd,e.addController(this)}hostConnected(){this.connected=!0,this.unsubscribeGatewayReset=Ye(()=>this.host.requestUpdate()),this.host.requestUpdate()}hostDisconnected(){this.connected=!1,this.unsubscribeGatewayReset?.(),this.unsubscribeGatewayReset=void 0,this.clearRoutes()}clearRoutes(){for(let e of this.routes.values())e.release?.();this.routes.clear()}withActiveRoutes(e){this.activeRoutes=new Set;try{return e()}finally{for(let[e,t]of this.routes)this.activeRoutes.has(e)||(t.release?.(),this.routes.delete(e));this.activeRoutes=null}}imageErrorHandler(e){let t=this.routes.get(e);return()=>{t?.url&&this.connected&&this.generation===fd&&this.routes.get(e)===t&&(t.url=null,this.host.requestUpdate())}}resolve(e){if(!this.connected)return null;this.generation!==fd&&(this.clearRoutes(),this.generation=fd),this.activeRoutes?.add(e);let t=e.startsWith(`/`)?sd(e):e,n=this.routes.get(e);if(n&&n.result===t)return n.url;let r={url:e,result:t,release:cd(t)};this.routes.set(e,r);let i=t=>{if(this.generation!==fd||this.routes.get(e)!==r){r.release?.();return}r.url=t};return typeof t==`string`||t===null?i(t):t.then(t=>{i(t),this.connected&&this.routes.get(e)===r&&this.host.requestUpdate()}),n?.release?.(),r.url}}})))()}function hd(e,t,n={}){return mr`<span
class="${t} hover-marquee ${n.loop?`hover-marquee--loop`:``}"
dir=${n.loop?`auto`:vr}
${Sd(n,t)}
><span class="hover-marquee__text">${e}</span></span
>`}var gd,_d,vd,yd,bd,xd,Sd;function Cd(){return(Cd=e((()=>{yr(),br(),hr(),gd=40,_d=500,vd=.4,yd=new Set,xd=class extends gr{constructor(...e){super(...e),this.visible=!0,this.readyToScroll=!1,this.options={},this.shift=0,this.schedule=()=>{this.isConnected&&(yd.add(this.measure),bd===void 0&&(bd=requestAnimationFrame(()=>{bd=void 0;let e=[...yd];yd.clear(),e.map(e=>e()).forEach(e=>e?.())})))},this.measure=()=>{let e=this.label;if(!this.isConnected||!e?.isConnected)return;if(!this.host){if(this.text=e.querySelector(`.hover-marquee__text`)??void 0,this.host=e.closest(`.session-row-host, .sidebar-recent-sessions__head, .sidebar-identity-card, .sidebar-agent-card__main, .sidebar-workspace-header__main`)??void 0,!this.host||!this.text)return;for(let e of[`pointerenter`,`pointerleave`,`focusin`,`focusout`])this.host.addEventListener(e,this.schedule);this.motion=matchMedia(`(prefers-reduced-motion: reduce)`),this.motion.addEventListener(`change`,this.schedule),this.observer=new ResizeObserver(this.schedule),this.observer.observe(e),this.observer.observe(this.text),this.contentObserver=new MutationObserver(this.schedule),this.contentObserver.observe(e,{childList:!0,characterData:!0,subtree:!0,attributes:!0,attributeFilter:[`dir`]}),this.contentObserver.observe(this.host,{attributes:!0,attributeFilter:[`aria-expanded`,`dir`]}),this.contentObserver.observe(e.ownerDocument.documentElement,{attributes:!0,attributeFilter:[`dir`]})}this.options.loop&&!this.visibilityObserver?(this.visibilityObserver=new IntersectionObserver(e=>{for(let t of e)this.visible=t.isIntersecting;this.schedule()}),this.visibilityObserver.observe(e)):!this.options.loop&&this.visibilityObserver&&(this.visibilityObserver.disconnect(),this.visibilityObserver=void 0,this.visible=!0);let t=e.clientWidth;if(t<=0)return()=>this.clearOverflow(e);let n=this.text,r=getComputedStyle(e),i=Number.parseFloat(r.paddingLeft)+Number.parseFloat(r.paddingRight),a=r.whiteSpace===`nowrap`?n.scrollWidth+i-t:0,o=a>+!this.options.loop;if(!o)return()=>this.clearOverflow(e);if(!(this.host.matches(`:hover, :focus-visible`)||this.host.querySelector(`:focus-visible`)||this.options.loop&&this.host.getAttribute(`aria-expanded`)===`true`)||!this.visible||this.motion?.matches)return()=>{e.classList.toggle(`hover-marquee--overflowing`,o),this.stop()};let s=Number.parseFloat(r.getPropertyValue(`--hover-marquee-fade-width`)),c=(a+(this.options.loop?0:s))*(r.direction===`rtl`?1:-1),l=e.classList.contains(`hover-marquee--scrolling`),u;if(c!==this.shift||!l){let e=getComputedStyle(n).transform,t=e===`none`?0:new DOMMatrixReadOnly(e).m41;u=(this.options.loop?Math.abs(c)/vd:Math.abs(c-t))/(this.options.speed??gd)*1e3}return()=>{e.classList.toggle(`hover-marquee--overflowing`,o),u!==void 0&&(e.style.setProperty(`--hover-marquee-shift`,`${c}px`),e.style.setProperty(`--hover-marquee-duration`,`${u}ms`),this.shift=c),this.readyToScroll?(this.readyToScroll=!1,e.classList.add(`hover-marquee--scrolling`)):this.timer===void 0&&!l&&(this.timer=window.setTimeout(()=>{this.timer=void 0,this.readyToScroll=!0,this.schedule()},this.options.delay??_d))}}}render(e,t){return vr}update(e,[t,n]){return this.label=e.element instanceof HTMLElement?e.element:void 0,(!this.host||n!==this.className||t.delay!==this.options.delay||t.speed!==this.options.speed||t.loop!==this.options.loop)&&this.schedule(),this.options={...t},this.className=n,vr}reconnected(){this.schedule()}disconnected(){yd.delete(this.measure),yd.size===0&&bd!==void 0&&(cancelAnimationFrame(bd),bd=void 0),this.stop(),this.observer?.disconnect(),this.observer=void 0,this.contentObserver?.disconnect(),this.contentObserver=void 0,this.visibilityObserver?.disconnect(),this.visibilityObserver=void 0,this.visible=!0,this.motion?.removeEventListener(`change`,this.schedule);for(let e of[`pointerenter`,`pointerleave`,`focusin`,`focusout`])this.host?.removeEventListener(e,this.schedule);this.host=void 0}clearOverflow(e){e.classList.toggle(`hover-marquee--overflowing`,!1),this.stop(),e.style.removeProperty(`--hover-marquee-shift`),e.style.removeProperty(`--hover-marquee-duration`),this.shift=0}stop(){window.clearTimeout(this.timer),this.timer=void 0,this.readyToScroll=!1,this.label?.classList.remove(`hover-marquee--scrolling`)}},Sd=_r(xd)})))()}function wd(e,t){return e<t?-1:+(e>t)}function Td(e){return zd&&Rd===e?zd:(Rd=e,zd=$i(Zn(e)??[]),zd)}function Ed(e,t=e.id){let n=e.id===ai;return{name:n?B(`presence.sharedOwner.name`):e.name??e.email??t,isSharedOwner:n}}function Dd(e){return Ed(e).name}function Od(e){let t=(e.entries??[]).flatMap(e=>e.reason!==`disconnect`&&e.lastActivityAt!==void 0&&Number.isFinite(e.lastActivityAt)?[e.lastActivityAt]:[]);return t.length?Math.max(...t):void 0}function kd(e,t=Date.now()){let n=Od(e);return n===void 0?`unknown`:t-n<12e4?`active`:`idle`}function Ad(e){return B(e===`active`?`presence.onlineActive`:e===`idle`?`presence.onlineIdle`:`presence.rosterTitle`)}function jd(e,t,n){let r={active:0,idle:1,unknown:2},i=r[kd(e,n)]-r[kd(t,n)];return i===0?wd(Dd(e).toLowerCase(),Dd(t).toLowerCase())||wd(ha(e),ha(t)):i}function Md(e,t){return t?.type===`profile`&&e.identity?.id===t.id}function Nd(e,t,n,r,i=[]){let a=sr({snapshotUser:t,presenceEntries:Zn(e),presenceInstanceId:n}),o=a?ha(a):void 0;return Td(e).users.filter(e=>ha(e)!==o&&!i.some(t=>Md(e,t))&&(r===void 0||e.watchedSessions.includes(r)))}function Pd(e){let t=Date.now();return Td(e).users.toSorted((e,n)=>jd(e,n,t))}function Fd(e,t,n,r){return Nd(e,t,n,r).length>0}function Id(e){return Td(e).users.length>=2}var Ld,Rd,zd;function Bd(){return(Bd=e((()=>{ni(),ta(),U(),Ld=12e4})))()}function Vd(e){return e===`none`||e===`person`?e:`project`}function Hd(e){let t=e?.identity;return t?t.type===`profile`||t.type===`agent`?`${t.type}:${t.id}`:JSON.stringify(t,Object.keys(t).toSorted()):``}function Ud(e){let t=e.replace(/[\\/]+$/,``);if(!t)return null;let n=t.match(/^(.*?)[\\/]\.claude[\\/]worktrees[\\/][^\\/]/);return n?n[1]||null:t}function Wd(e){return e.split(/[\\/]/).findLast(Boolean)??e}function Gd(e){let t=new Map,n=new Map,r=[];for(let i of e){let e=i.customGroup?.trim();if(e){let n=`custom:${e}`,r=t.get(e);r||(r={kind:`custom`,key:n,legacySectionKey:n,label:e,title:`Custom group: ${e}`,sessions:[]},t.set(e,r)),r.sessions.push(i);continue}let a=i.cwd?.trim(),o=a?Ud(a):null;if(!o){r.push(i);continue}let s=n.get(o);s||(s={kind:`project`,key:`project:${o}`,legacySectionKey:o,label:Wd(o),title:o,sessions:[]},n.set(o,s)),s.sessions.push(i)}return{groups:[...t.values(),...n.values()],ungrouped:r}}function Kd(e){let t=new Map,n=[];for(let r of e){let e=r.createdActor,i=Hd(e);if(!e?.identity||!i){n.push(r);continue}let a=`person:${i}`,o=t.get(a);if(!o){let n=e.identity.type===`profile`?Dd({id:e.identity.id,name:e.label?.trim()||e.identity.id}):e.label?.trim()||e.identity.id;o={kind:`person`,key:a,legacySectionKey:`person:${e.id}`,label:n,title:`Created by ${n}`,sessions:[]},t.set(a,o)}o.sessions.push(r)}return{groups:[...t.values()].toSorted((e,t)=>e.label.localeCompare(t.label)),ungrouped:n}}function qd(){return(qd=e((()=>{Bd()})))()}function Jd(e,t){e.setData(rf,t),e.setData(`text/plain`,t),e.effectAllowed=`copyMove`}function Yd(e){return e?.getData(`application/x-openclaw-session-key`).trim()||null}function Xd(e){return Array.from(e?.types??[]).includes(rf)}function Zd(e,t){e.setData(af,t),e.effectAllowed=`move`}function Qd(e){return e?.getData(af).trim()||null}function $d(e){return Array.from(e?.types??[]).includes(af)}function ef(e,t){e.setData(of,t),e.effectAllowed=`move`}function tf(e){return e?.getData(of).trim()||null}function nf(e){return Array.from(e?.types??[]).includes(of)}var rf,af,of;function sf(){return(sf=e((()=>{rf=`application/x-openclaw-session-key`,af=`application/x-openclaw-session-group`,of=`application/x-openclaw-sidebar-route`})))()}function cf(e,t){return t?{sessionKey:e,...t.agentId?{agentId:t.agentId}:{},runId:t.runId,revision:t.revision,updatedAt:t.updatedAt,headline:t.headline,health:t.health}:null}function lf(e){return e===`stuck`||e===`waiting-on-user`}function uf(e){return e.localRunId?e.localRunId:!e.session?.hasActiveRun||!e.digest?.runId?null:e.session.activeRunIds?.includes(e.digest.runId)?e.digest.runId:null}function df(e,t){return e?t?e.revision===t.revision?e.updatedAt>=t.updatedAt?e:t:e.revision>t.revision?e:t:e:t??null}function ff(){return(ff=e((()=>{})))()}function pf(e,t=300){let n=Zr(e,{mode:`message`}),r=n.didStrip&&/^[*`~_]+$/.test(n.text)?``:n.text;return{shouldSkip:n.shouldSkip||n.didStrip&&r.length<=t,text:r}}function mf(e){if(typeof e==`string`)return{text:e,hasVisibleNonTextContent:!1};if(!Array.isArray(e))return{text:``,hasVisibleNonTextContent:e!=null};let t=!1,n=[];return e.forEach(e=>{let r=re(e);r?.type===`text`&&typeof r.text==`string`?n.push(r.text):r?.type!==`thinking`&&r?.type!==`reasoning`&&(t=!0)}),{text:n.join(``),hasVisibleNonTextContent:t}}function hf(e){let t=re(e);if(!t||A(t.role)!==`assistant`||typeof t.senderLabel==`string`&&t.senderLabel.trim())return!1;let{text:n,hasVisibleNonTextContent:r}=mf(typeof t.content==`string`||Array.isArray(t.content)?t.content:t.text);return!r&&n.trim().length>0&&pf(n).shouldSkip}function gf(){return(gf=e((()=>{Jr()})))()}var _f,vf;function yf(){return(yf=e((()=>{W(),_f={sessionsView:{searchPeople:`Search people and agents…`,noPeopleMatch:`No matching people or agents`,peopleRange:`{start}–{end} of {total}`}},vf=Object.assign(()=>{Object.assign(R.sessionsView,_f.sessionsView)},{catalog:_f})})))()}function bf(e,t,n){let r=t.replaceAll(`\\`,`/`);return`${e}://file${(r.startsWith(`/`)?r:`/${r}`).split(`/`).map((e,t)=>t===1&&/^[a-z]:$/i.test(e)?e:encodeURIComponent(e)).join(`/`)}${n?`:${n}`:``}`}function xf(e,t,n){return window.open(bf(e,t,n))}var Sf,Cf;function wf(){return(wf=e((()=>{Sf=[`cursor`,`vscode`,`windsurf`,`zed`],Cf={cursor:`Cursor`,vscode:`VS Code`,windsurf:`Windsurf`,zed:`Zed`}})))()}var Tf;function Ef(){return(Ef=e((()=>{Rt(),_t(),Tf=class{constructor(e,t){this.host=e,this.options=t,this.lifecycle=Lt({client:null,phase:`stopped`}),this.currentGateway=null,this.currentSnapshot=null,this.currentClient=null,this.currentConnected=!1,this.hasBoundGateway=!1,this.handlePageActivation=()=>{this.options.onPageActivation?.()},this.subscriptions=new Vt(e).effect(t.getGateway,e=>{let t=!this.hasBoundGateway,n=this.hasBoundGateway&&this.currentGateway!==e;return this.hasBoundGateway=!0,this.currentGateway=e,this.applySnapshot(e.snapshot,{initial:t,sourceChanged:n}),e.subscribe(t=>{this.currentGateway===e&&this.options.getGateway()===e&&this.applySnapshot(t,{initial:!1,sourceChanged:!1})})}),e.addController(this)}get gateway(){return this.currentGateway}get snapshot(){return this.currentSnapshot}get client(){return this.currentClient}get connected(){return this.currentConnected}get epoch(){return this.lifecycle.epoch}capture(){return this.lifecycle.capture()}isCurrent(e){return this.lifecycle.isCurrent(e)}invalidate(){this.lifecycle.invalidate()}isRouteDataCurrent(e){let t=this.options.getGateway();if(!t||e.gateway!==t)return!1;let n=t.snapshot;return e.gatewaySnapshot===n||e.gatewaySnapshot.phase===`connected`&&n.phase===`connected`&&e.gatewaySnapshot.client===n.client&&e.gatewaySnapshot.hello!==null&&e.gatewaySnapshot.hello===n.hello}hostConnected(){this.options.onPageActivation&&(document.addEventListener(`visibilitychange`,this.handlePageActivation),globalThis.addEventListener(`focus`,this.handlePageActivation))}hostDisconnected(){this.options.onPageActivation&&(document.removeEventListener(`visibilitychange`,this.handlePageActivation),globalThis.removeEventListener(`focus`,this.handlePageActivation)),this.subscriptions.clear();let e=this.currentSnapshot;if(this.currentGateway=null,e){let t={...e,client:null,phase:`stopped`},n=this.lifecycle.transition(t),r=this.currentClient!==null,i=this.currentConnected;this.currentSnapshot=null,this.currentClient=null,this.currentConnected=!1,n&&this.options.invalidateRequests?.({snapshot:t,initial:!1,sourceChanged:!1,clientChanged:r,connectionChanged:i,identityChanged:!1,becameConnected:!1,becameAvailable:!1})}else this.lifecycle.invalidate();this.host.requestUpdate()}applySnapshot(e,t){let n=this.currentClient,r=this.currentConnected,i=this.currentSnapshot!==null&&Ct(this.currentSnapshot),a=e.phase===`connected`,o=n!==e.client,s=r!==a,c=this.lifecycle.transition(e);t.sourceChanged&&!c&&this.lifecycle.invalidate(),this.currentSnapshot=e,this.currentClient=e.client,this.currentConnected=a;let l={snapshot:e,initial:t.initial,sourceChanged:t.sourceChanged,clientChanged:o,connectionChanged:s,identityChanged:!t.initial&&(t.sourceChanged||o),becameConnected:a&&!r,becameAvailable:Ct(e)&&!i};l.identityChanged&&this.options.onIdentityChange?.(l),!t.initial&&(c||t.sourceChanged)&&this.options.invalidateRequests?.(l),this.options.onSnapshot?.(l),a&&(t.initial||l.identityChanged||l.connectionChanged)&&this.options.ensureInitialData?.(),this.host.requestUpdate()}}})))()}var Df,Of;function kf(){return(kf=e((()=>{W(),Df={connection:{scopeUpgrade:{limited:`This browser has limited access.`,guidance:`This browser has limited access. Manage it with openclaw devices on the Gateway or from Devices on an admin browser.`,status:`Limited access`,inboxState:`Administrator access required`,showDetails:`Show limited access details`,closeDetails:`Close limited access details`,request:`Request admin`,requesting:`Requesting administrator access…`,requestingAction:`Requesting…`,pending:`Approve this browser by running {command} on the Gateway or from Devices on an admin browser. Retry reattaches to the request; Cancel stops waiting.`,retry:`Retry`,cancel:`Cancel`,rejected:`The administrator access request was rejected.`,expired:`The administrator access request expired.`,error:`Administrator access request failed: {error}`}},attention:{cronErrorUnknown:`Unknown error`,cronFailed:`{job} failed`,cronOverdue:`{job} overdue`,automationFailed:`Failed · {time}`,automationOverdue:`Overdue · {time}`,failed:`Failed`,overdue:`Overdue`,dismissItem:`Dismiss {item}`,dismissShown:`Dismiss shown`,emptyTitle:`Nothing waiting`,emptyBody:`New requests and alerts land here.`,issues:`Inbox`,issueCount:`{count} inbox item`,issueCountPlural:`{count} inbox items`,tabs:{label:`Inbox categories`,all:`All`,approvals:`Approvals`,mentions:`Mentions`,automations:`Automations`,system:`System`},mentions:{from:`{sender} mentioned you`,open:`Open`,dismiss:`Dismiss`,dismissing:`Dismissing…`,emptyTitle:`No mentions yet`,emptyBody:`When someone mentions you in a chat, it appears here.`,retention:`Mentions expire after 7 days.`,notifications:`Notification settings`,loading:`Loading mentions…`,unavailable:`Sign in and connect to the Gateway to see your mentions.`,refresh:`Refresh mentions`,error:`Mentions could not be updated. Refresh or try dismissing again.`},outbox:{conversation:`Conversation`,failed:`Your message wasn’t sent`,unconfirmed:`Your message may not have arrived`,commandFailed:`Your command failed`,commandUnconfirmed:`Your command may not have run`,review:`Review in chat`,reviewShort:`Review`,reviewHint:`Open the conversation to review it before trying again.`,checkBeforeRetry:`Open the conversation to check whether it arrived before trying again.`,checkCommandBeforeRetry:`The command may already have run. Review the conversation before retrying.`,offline:`Offline`,offlineHint:`Offline: reconnect before retrying.`},modelAuthExpired:`Model auth expired: {providers}`,authExpired:`Auth expired`,modelAuthExpiredState:`Auth expired · {time}`,modelAuthExpiredWithScope:`{scope} · Auth expired · {time}`,reconnect:`Reconnect`,pendingApproval:`{count} pending approval`,pendingApprovals:`{count} pending approvals`,alerts:{updateQuestion:`These are the available update facts:
{facts}
Summarize what is new and whether anything needs my attention before updating.`,cronFailedQuestion:`These automations failed:
{facts}
Explain why they failed and how to fix them.`,cronOverdueFact:`{job}: {duration} late`,cronOverdueQuestion:`These automations are overdue:
{facts}
Explain why they have not run and how to fix them.`,modelAuthExpiredQuestion:`These model-provider credentials need attention:
{facts}
Explain what expired and how to re-authenticate them.`}}},Of=Object.assign(()=>{Object.assign(R.connection,Df.connection),R.attention=Df.attention},{catalog:Df})})))()}function Af(e,t,n=!1){let r=e.trim();if(n&&!jf.test(r)&&(r=String(Number(r))),!jf.test(r))return;let[i,a=``]=r.split(`.`),o=(i||`0`).replace(/^0+/u,``)||`0`,s=a.replace(/0+$/u,``);if(o.length>16||s.length>10)return;let c=10n**BigInt(s.length),l=(BigInt(o)*c+BigInt(s||`0`))*BigInt(Mf[t]);if(l%c!==0n)return;let u=l/c;return u>0n&&u<=BigInt(864e13)?Number(u):void 0}var jf,Mf;function Nf(){return(Nf=e((()=>{fe(),jf=/^(?:\d+(?:\.\d*)?|\.\d+)$/u,Mf={seconds:1e3,minutes:6e4,hours:36e5,days:864e5}})))()}function Pf(e){let t=Date.parse(e);if(!Number.isFinite(t))return``;let n=new Date(t);return`${n.getFullYear()}-${String(n.getMonth()+1).padStart(2,`0`)}-${String(n.getDate()).padStart(2,`0`)}T${String(n.getHours()).padStart(2,`0`)}:${String(n.getMinutes()).padStart(2,`0`)}`}function Ff(e){return e%864e5==0?{everyAmount:String(e/864e5),everyUnit:`days`}:e%36e5==0?{everyAmount:String(e/36e5),everyUnit:`hours`}:e%6e4==0?{everyAmount:String(e/6e4),everyUnit:`minutes`}:{everyAmount:If(e),everyUnit:`seconds`}}function If(e){let t=BigInt(e),n=t/1000n,r=t%1000n;return r===0n?String(n):`${n}.${r.toString().padStart(3,`0`).replace(/0+$/u,``)}`}function Lf(e){if(e===0||typeof e!=`number`||!Number.isFinite(e)||e<0)return{scheduleExact:e===0,staggerAmount:``,staggerUnit:`seconds`};let t=e%6e4==0;return{scheduleExact:!1,staggerAmount:t?String(e/6e4):If(e),staggerUnit:t?`minutes`:`seconds`}}function Rf(e,t){let n=t.schedule;if(e.scheduleKind!==n.kind)return!1;if(n.kind===`at`)return e.scheduleAt===Pf(n.at);if(n.kind===`every`)return Af(e.everyAmount,e.everyUnit)===n.everyMs;if(n.kind===`cron`){let t=Lf(n.staggerMs);return e.cronExpr.trim()===n.expr&&e.cronTz.trim()===(n.tz??``)&&e.scheduleExact===t.scheduleExact&&e.staggerAmount.trim()===t.staggerAmount&&e.staggerUnit===t.staggerUnit}return!0}function zf(e,t){if(e.scheduleKind===`at`){let t=Date.parse(e.scheduleAt);if(!Number.isFinite(t))throw Error(B(`cron.errors.invalidRunTime`));return{kind:`at`,at:new Date(t).toISOString()}}if(e.scheduleKind===`every`){let t=Af(e.everyAmount,e.everyUnit);if(t===void 0)throw Error(B(`cron.errors.invalidIntervalAmount`));return{kind:`every`,everyMs:t}}let n=e.cronExpr.trim();if(!n)throw Error(B(`cron.errors.cronExprRequiredShort`));let r,i=e.staggerAmount.trim();if(e.scheduleExact)r=0;else if(!i){let e=t?.kind===`cron`&&t.expr===n&&t.staggerMs!==void 0;r=Fn(n)??(e?0:void 0)}else if(r=Af(i,e.staggerUnit,!0),r===void 0)throw Error(B(`cron.errors.invalidStaggerAmount`));return{kind:`cron`,expr:n,tz:e.cronTz.trim()||void 0,staggerMs:r}}function Bf(){return(Bf=e((()=>{On(),U(),Nf()})))()}function Vf(e){return h(e)?e.kind===`systemEvent`?typeof e.text==`string`:e.kind===`agentTurn`?typeof e.message==`string`:e.kind===`command`?Array.isArray(e.argv)&&e.argv.every(e=>typeof e==`string`):e.kind===`script`?typeof e.script==`string`:An(e.kind):!1}function Hf(e){let t=e.payload;return Vf(t)?t:null}function Uf(){return(Uf=e((()=>{})))()}function Wf(e,t){if(!h(e)||!Array.isArray(e.jobs)||typeof e.snapshotRevision!=`string`||e.snapshotRevision.length===0||typeof e.total!=`number`||!Number.isSafeInteger(e.total)||e.total<0||typeof e.offset!=`number`||!Number.isSafeInteger(e.offset)||e.offset<0||typeof e.limit!=`number`||!Number.isSafeInteger(e.limit)||e.limit<1||e.limit>t||e.jobs.length>e.limit||typeof e.hasMore!=`boolean`||e.nextOffset!==null&&(typeof e.nextOffset!=`number`||!Number.isSafeInteger(e.nextOffset)||e.nextOffset<0))throw Error(`cron.list returned an invalid inventory page`);return e}function Gf(e,t){let n=t+e.jobs.length;if(e.offset!==t||!Number.isSafeInteger(n)||n>e.total||(e.hasMore?e.nextOffset!==n||n<=t||n>=e.total:e.nextOffset!==null||n!==e.total))throw Error(`cron.list returned an invalid inventory page`)}function Kf(e,t){e.cronJobsReloadPending||(e.cronJobsReloadPending=!0,e.cronJobsReloadPendingTableFilters=t)}async function qf(e,t){if(!e.cronJobsReloadPending)return;let n=e.cronJobsReloadPendingTableFilters;e.cronJobsReloadPending=!1,e.cronJobsReloadPendingTableFilters=!1,await Qf(e,t,{tableFilters:n})}function Jf(e){return typeof e==`number`&&Number.isFinite(e)&&e>=0}function Yf(e){if(!h(e))return!1;let t=e.autoDisabled;return typeof e.id==`string`&&e.id.trim().length>0&&typeof e.name==`string`&&(e.agentId===void 0||typeof e.agentId==`string`)&&typeof e.enabled==`boolean`&&Jf(e.updatedAtMs)&&(e.nextRunAtMs===null||Jf(e.nextRunAtMs))&&(e.lastRunAtMs===null||Jf(e.lastRunAtMs))&&(e.lastRunStatus===null||e.lastRunStatus===`ok`||e.lastRunStatus===`error`||e.lastRunStatus===`skipped`)&&(e.runningAtMs===void 0||Jf(e.runningAtMs))&&(t===void 0||h(t)&&(t.reason===`consecutive-failures`||t.reason===`schedule-errors`)&&Jf(t.atMs)&&typeof t.consecutiveErrors==`number`&&Number.isSafeInteger(t.consecutiveErrors)&&t.consecutiveErrors>0)}function Xf(e,t){return Qf(e,$f,t)}function Zf(e,t){return Qf(e,ep,t)}async function Qf(e,t,n){if(!e.client||!e.connected||e.canRefresh?.()===!1)return;let r=n?.append===!0;if(e.cronLoading||e.cronJobsLoadingMore){r||(e.cronJobsReloadPending=!0,e.cronJobsReloadPendingTableFilters=n?.tableFilters===!0);return}if(!r||e.cronJobsHasMore){r?e.cronJobsLoadingMore=!0:e.cronLoading=!0,e.cronJobsError=null;try{let i=r?Math.max(0,e.cronJobsNextOffset??e.cronJobs.length):0,a=Wf(await e.client.request(`cron.list`,{...e.cronSessionFilter??(e.cronAgentId?{agentId:e.cronAgentId}:{}),includeDisabled:e.cronJobsEnabledFilter===`all`,includeDeliveryPreviews:!1,...t.compact?{compact:!0}:{},limit:e.cronJobsLimit,offset:i,query:e.cronJobsQuery.trim()||void 0,enabled:e.cronJobsEnabledFilter,...n?.tableFilters?{scheduleKind:e.cronJobsScheduleKindFilter,lastRunStatus:e.cronJobsLastStatusFilter,trigger:e.cronJobsTriggerFilter}:{},sortBy:e.cronJobsSortBy,sortDir:e.cronJobsSortDir}),e.cronJobsLimit);if(r&&(a.snapshotRevision!==e.cronJobsSnapshotRevision||a.total!==e.cronJobsTotal)){Kf(e,n?.tableFilters===!0);return}Gf(a,i);let o=t.readRows(a.jobs);e.cronJobs=r?[...e.cronJobs,...o]:o,e.cronJobsSnapshotRevision=a.snapshotRevision,e.cronJobsTotal=a.total,e.cronJobsHasMore=a.hasMore,e.cronJobsNextOffset=a.nextOffset}catch(t){e.cronJobsError=I(t)}finally{r?e.cronJobsLoadingMore=!1:e.cronLoading=!1,await qf(e,t)}}}var $f,ep;function tp(){return(tp=e((()=>{H(),Uf(),$f={readRows:e=>e.filter(e=>Hf(e)!==null)},ep={compact:!0,readRows:e=>{if(!e.every(Yf))throw Error(`cron.list returned an invalid compact inventory row`);return e}}})))()}function np(e){if(!(`reason`in e))return B(`cron.runNotStarted.unknown`);switch(e.reason){case`not-due`:return B(`cron.runNotStarted.notDue`);case`already-running`:return B(`cron.runNotStarted.alreadyRunning`);case`invalid-spec`:return B(`cron.runNotStarted.invalidSpec`);case`stopped`:return B(`cron.runNotStarted.stopped`)}return B(`cron.runNotStarted.unknown`)}function rp(){return(rp=e((()=>{U()})))()}function ip(e,t){let n=Math.max(0,Math.floor(M(e.total)??t)),r=Math.max(0,Math.floor(M(e.offset)??0)),i=typeof e.hasMore==`boolean`?e.hasMore:r+t<n,a=M(e.nextOffset);return{total:n,hasMore:i,nextOffset:a===void 0?i?r+t:null:Math.max(0,Math.floor(a))}}function ap(e){pp.delete(e),e.cronRunsError=null,e.cronRuns=[],e.cronRunsTotal=0,e.cronRunsHasMore=!1,e.cronRunsNextOffset=null}function op(e,t){return e.client===t.client&&e.cronAgentId===t.agentId&&e.cronRunsScope===t.scope&&(t.scope!==`job`||e.cronRunsJobId===t.jobId)&&e.cronRunsLimit===t.limit&&e.cronRunsStatusFilter===t.status&&e.cronRunsQuery.trim()===t.query&&e.cronRunsSortDir===t.sortDir&&e.cronRunsStatuses.length===t.statuses.length&&e.cronRunsStatuses.every((e,n)=>e===t.statuses[n])&&e.cronRunsDeliveryStatuses.length===t.deliveryStatuses.length&&e.cronRunsDeliveryStatuses.every((e,n)=>e===t.deliveryStatuses[n])}function sp(e,t){return J.get(e)===t&&e.connected&&op(e,t)&&(!t.append||Math.max(0,e.cronRunsNextOffset??e.cronRuns.length)===t.offset)}function cp(e){let t=J.get(e);if(t&&sp(e,t))return`pending`;let n=pp.get(e);return!n||!op(e,n)?`idle`:e.cronRunsError===null?`ready`:`failed`}async function lp(e,t){let n=e.client;if(!n||!e.connected||e.canRefresh?.()===!1)return`skipped`;let r=e.cronRunsScope,i=e.cronRunsJobId;if(r===`job`&&!i)return ap(e),`skipped`;let a=pp.get(e);(!a||!op(e,a))&&ap(e);let o=t?.append===!0;if(o&&!e.cronRunsHasMore)return`skipped`;let s=J.get(e);if(t?.coalesce&&!o&&s&&!s.append&&s.jobId===(r===`job`?i:null)&&sp(e,s))return(s.queued??=Se()).promise;let c={client:n,agentId:e.cronAgentId,scope:r,jobId:r===`job`?i:null,limit:e.cronRunsLimit,offset:o?Math.max(0,e.cronRunsNextOffset??e.cronRuns.length):0,statuses:[...e.cronRunsStatuses],status:e.cronRunsStatusFilter,deliveryStatuses:[...e.cronRunsDeliveryStatuses],query:e.cronRunsQuery.trim(),sortDir:e.cronRunsSortDir,append:o};J.set(e,c),o||(e.cronRunsHasMore=!1,e.cronRunsNextOffset=null),e.cronRunsLoadingMore=o;try{let t=await n.request(`cron.runs`,{...c.scope===`all`&&c.agentId?{agentId:c.agentId}:{},scope:c.scope,id:c.jobId??void 0,limit:c.limit,offset:c.offset,statuses:c.statuses.length>0?c.statuses:void 0,status:c.status,deliveryStatuses:c.deliveryStatuses.length>0?c.deliveryStatuses:void 0,query:c.query||void 0,sortDir:c.sortDir});if(!sp(e,c))return`skipped`;pp.set(e,c),e.cronRunsError=null;let r=Array.isArray(t.entries)?t.entries:[];e.cronRuns=o?[...e.cronRuns,...r]:r;let i=ip(t,r.length);return e.cronRunsTotal=Math.max(i.total,e.cronRuns.length),e.cronRunsHasMore=i.hasMore,e.cronRunsNextOffset=i.nextOffset,`ok`}catch(t){return!sp(e,c)||c.queued?`skipped`:(pp.set(e,c),e.cronRunsError=I(t),`error`)}finally{let n=sp(e,c);J.get(e)===c&&(J.delete(e),o&&(e.cronRunsLoadingMore=!1)),c.queued?.resolve(n?lp(e,t):`skipped`)}}async function up(e){(e.cronRunsScope!==`job`||e.cronRunsJobId)&&await lp(e,{append:!0})}function dp(e,t){e.cronRunsScope=t.cronRunsScope??e.cronRunsScope,Array.isArray(t.cronRunsStatuses)&&(e.cronRunsStatuses=t.cronRunsStatuses,e.cronRunsStatusFilter=t.cronRunsStatuses[0]??`all`),Array.isArray(t.cronRunsDeliveryStatuses)&&(e.cronRunsDeliveryStatuses=t.cronRunsDeliveryStatuses),t.cronRunsStatusFilter&&(e.cronRunsStatusFilter=t.cronRunsStatusFilter,e.cronRunsStatuses=t.cronRunsStatusFilter===`all`?[]:[t.cronRunsStatusFilter]),typeof t.cronRunsQuery==`string`&&(e.cronRunsQuery=t.cronRunsQuery),e.cronRunsSortDir=t.cronRunsSortDir??e.cronRunsSortDir}function fp(e){J.get(e)?.queued?.resolve(`skipped`),J.delete(e)}var J,pp;function mp(){return(mp=e((()=>{fe(),se(),H(),J=new WeakMap,pp=new WeakMap})))()}function hp(e){let t=e.trim();if(!t)return`cron.errors.webhookUrlRequired`;if(!Xr(t))return`cron.errors.webhookUrlInvalid`;try{let e=new URL(t);return e.username||e.password||e.hostname.includes(`%`)?`cron.errors.webhookUrlInvalid`:void 0}catch{return`cron.errors.webhookUrlInvalid`}}function gp(){return(gp=e((()=>{Er()})))()}async function _p(e){if(!e.client||!e.connected||!e.cronAgentId){e.cronScopedTotal=null,e.cronScopedNextWakeAtMs=null;return}try{let[t,n]=await Promise.all([e.client.request(`cron.list`,{agentId:e.cronAgentId,includeDisabled:!0,includeDeliveryPreviews:!1,limit:1,offset:0}),e.client.request(`cron.list`,{agentId:e.cronAgentId,enabled:`enabled`,includeDeliveryPreviews:!1,limit:1,offset:0,sortBy:`nextRunAtMs`,sortDir:`asc`})]);e.cronScopedTotal=typeof t.total==`number`?t.total:null;let r=n.jobs[0]?.state?.nextRunAtMs;e.cronScopedNextWakeAtMs=typeof r==`number`&&Number.isFinite(r)?r:null}catch{e.cronScopedTotal=null,e.cronScopedNextWakeAtMs=null}}function vp(){return(vp=e((()=>{})))()}function yp(e){return e===`main`||e===`isolated`||e===`current`||e.startsWith(`session:`)&&e.length>8}function bp(e={}){return{client:e.client??null,connected:e.connected??!1,cronLoading:!1,cronJobsError:null,cronJobsLoadingMore:!1,cronJobsReloadPending:!1,cronJobsReloadPendingTableFilters:!1,cronJobs:[],cronJobsSnapshotRevision:null,cronJobsTotal:0,cronJobsHasMore:!1,cronJobsNextOffset:null,cronJobsLimit:50,cronJobsQuery:``,cronJobsEnabledFilter:`all`,cronJobsScheduleKindFilter:`all`,cronJobsLastStatusFilter:`all`,cronJobsTriggerFilter:`all`,cronJobsSortBy:`nextRunAtMs`,cronJobsSortDir:`asc`,cronAgentId:null,cronStatus:null,cronScopedTotal:null,cronScopedNextWakeAtMs:null,cronError:null,cronForm:{...im},cronCreateOpen:!1,cronFieldErrors:{},cronEditingJob:null,cronCloningJob:null,cronRunsError:null,cronRunsJobId:null,cronRunsLoadingMore:!1,cronRuns:[],cronRunsTotal:0,cronRunsHasMore:!1,cronRunsNextOffset:null,cronRunsLimit:50,cronRunsScope:`all`,cronRunsStatuses:[],cronRunsDeliveryStatuses:[],cronRunsStatusFilter:`all`,cronRunsQuery:``,cronRunsSortDir:`desc`,cronBusy:!1}}function xp(e){return e.sessionTarget!==`main`&&(e.payloadKind===`agentTurn`||e.payloadLocked)}function Sp(e,t={}){let n=e;if(!e.payloadLocked){if(t.sessionTarget!==void 0){let t=e.sessionTarget===`main`?`systemEvent`:`agentTurn`;e.payloadKind!==t&&(n={...n,payloadKind:t})}else e.payloadKind===`systemEvent`&&e.sessionTarget!==`main`?n={...n,sessionTarget:`main`}:e.payloadKind===`agentTurn`&&e.sessionTarget===`main`&&(n={...n,sessionTarget:`isolated`})}return n.deliveryMode!==`announce`||xp(n)?n:{...n,deliveryMode:`none`}}function Cp(e){let t={};if(e.name.trim()||(t.name=`cron.errors.nameRequired`),e.scheduleKind===`at`){let n=Date.parse(e.scheduleAt);Number.isFinite(n)||(t.scheduleAt=`cron.errors.scheduleAtInvalid`)}else if(e.scheduleKind===`every`){let n=Af(e.everyAmount,e.everyUnit);n===void 0?t.everyAmount=`cron.errors.everyAmountInvalid`:e.triggerEnabled&&n<Un()&&(t.everyAmount=`cron.errors.triggerIntervalTooShort`)}else if(e.scheduleKind===`cron`&&(e.cronExpr.trim()||(t.cronExpr=`cron.errors.cronExprRequired`),!e.scheduleExact)){let n=e.staggerAmount.trim();n&&!Af(n,e.staggerUnit,!0)&&(t.staggerAmount=`cron.errors.staggerAmountInvalid`)}if(e.triggerEnabled&&(e.payloadKind===`script`?t.triggerScript=`cron.errors.triggerScriptPayloadUnsupported`:e.scheduleKind!==`every`&&e.scheduleKind!==`cron`&&e.scheduleKind!==`stream`?t.triggerScript=`cron.errors.triggerScheduleUnsupported`:e.triggerScript.trim()||(t.triggerScript=`cron.errors.triggerScriptRequired`)),!e.payloadLocked&&!e.payloadText.trim()&&(t.payloadText=e.payloadKind===`systemEvent`?`cron.errors.systemTextRequired`:`cron.errors.agentMessageRequired`),!e.payloadLocked&&e.payloadKind===`agentTurn`){let n=e.timeoutSeconds.trim();if(n){let e=tn(n,NaN);(!Number.isFinite(e)||e<0)&&(t.timeoutSeconds=`cron.errors.timeoutInvalid`)}}if(e.deliveryMode===`webhook`){let n=hp(e.deliveryTo);n&&(t.deliveryTo=n)}if(e.failureAlertMode===`custom`){let n=e.failureAlertAfter.trim();if(n){let e=tn(n,0);(!Number.isFinite(e)||e<1)&&(t.failureAlertAfter=`Failure alert threshold must be at least 1.`)}let r=e.failureAlertCooldownSeconds.trim();r&&Up(r)===void 0&&(t.failureAlertCooldownSeconds=`Cooldown must be finite and 0 or greater.`)}return t}function wp(e){return Object.keys(e).length>0}function Tp(e){Y.get(e)?.queued?.resolve(),Y.delete(e)}function Ep(e){let t=Y.get(e);t&&(t.reportErrors=!1)}async function Dp(e,t){let n=e.client;if(!n||!e.connected||e.canRefresh?.()===!1)return;let r=Y.get(e);if(t?.coalesce&&r?.client===n)return(r.queued??=Se()).promise;let i=e.cronAgentId,a=e.cronEditingJob,o={client:n,selectedJob:a,reportErrors:!t?.coalesce||!e.cronBusy};Y.set(e,o);let s=()=>Y.get(e)===o&&e.connected&&e.client===n&&e.cronAgentId===i,c=()=>s()&&o.selectedJob===a&&e.cronEditingJob===a,l=a?n.request(`cron.get`,{id:a.id}).then(e=>{c()&&e.id===a.id&&(a.state=e.state)},n=>{c()&&o.reportErrors&&(!t?.coalesce||!o.queued)&&(e.cronError=I(n))}):Promise.resolve();try{let t=await n.request(`cron.status`,{});s()&&(e.cronStatus=t)}catch(n){if(!s()||!o.reportErrors||t?.coalesce&&o.queued)return;Xe(n)?(e.cronStatus=null,e.cronError=ut(`cron status`)):e.cronError=I(n)}finally{await l;let t=s();if(Y.get(e)===o&&Y.delete(e),o.queued){let n=t?Dp(e,{coalesce:!0}):void 0;t&&!o.reportErrors&&Ep(e),o.queued.resolve(n)}}}function Op(e,t){if(typeof t!=`string`)return;let n=t.trim();n&&e.add(n)}function kp(e,t){if(typeof t==`string`){Op(e,t);return}let n=d(t);if(!n)return;Op(e,n.primary),Op(e,n.model),Op(e,n.id),Op(e,n.value);let r=Array.isArray(n.fallbacks)?n.fallbacks:Array.isArray(n.fallback)?n.fallback:[];for(let t of r)Op(e,t)}function Ap(e){let t=d(e?.agents);if(!t)return[];let n=new Set,r=d(t.defaults);if(r){kp(n,r.model);for(let e of Object.keys(d(r.models)??{}))Op(n,e)}for(let e of Object.values(E(t.entries)??{}))kp(n,d(e)?.model);return ie([...n])}async function jp(e,t,n){let r=e.client;if(!r||!e.connected||e.cronBusy)return;let i=t?{id:t.id,name:t.displayName??t.name}:null,a=t=>{e.cronError=i&&e.cronEditingJob?.id!==i.id?`${i.name}: ${t}`:t};Ep(e),e.cronBusy=!0,e.cronError=null;try{await n(r,a)}catch(e){a(I(e))}finally{Ep(e),e.cronBusy=!1}}function Mp(e){if(e)return e;throw Error(`This automation is missing its configuration revision. Refresh and try again.`)}function Np(e,t){e.cronJobs=e.cronJobs.map(e=>e.id===t.id?t:e)}function Pp(e){return(h(e)&&h(e.details)?e.details:null)?.code===`CRON_JOB_CHANGED`}function Fp(e,t){typeof t.cronJobsQuery==`string`&&(e.cronJobsQuery=t.cronJobsQuery),e.cronJobsEnabledFilter=t.cronJobsEnabledFilter??e.cronJobsEnabledFilter,e.cronJobsScheduleKindFilter=t.cronJobsScheduleKindFilter??e.cronJobsScheduleKindFilter,e.cronJobsLastStatusFilter=t.cronJobsLastStatusFilter??e.cronJobsLastStatusFilter,e.cronJobsTriggerFilter=t.cronJobsTriggerFilter??e.cronJobsTriggerFilter,e.cronJobsSortBy=t.cronJobsSortBy??e.cronJobsSortBy,e.cronJobsSortDir=t.cronJobsSortDir??e.cronJobsSortDir}function Ip(e){let t=Y.get(e);t&&(t.selectedJob=null)}function Lp(e){Ip(e),e.cronError=null,e.cronEditingJob=null,e.cronCloningJob=null}function Rp(e,t){e.cronCloningJob=null,e.cronForm={...im,agentId:t??``},e.cronFieldErrors={}}function zp(e,t){return e?.kind===`command`||e?.kind===`script`||An(e?.kind)||wn(t)}function Bp(e,t){let n=typeof e.failureAlert==`object`?e.failureAlert:void 0,r=Hf(e),i=zp(r,e.declarationKey);if(!yp(e.sessionTarget))throw TypeError(`Invalid cron session target: ${e.sessionTarget}`);let a={...t,name:e.name,description:e.description??``,agentId:e.agentId??``,sessionKey:e.sessionKey??``,clearAgent:!1,enabled:e.enabled,deleteAfterRun:e.deleteAfterRun??e.schedule.kind===`at`,scheduleKind:e.schedule.kind,scheduleAt:``,cronTz:``,scheduleExact:!1,staggerAmount:``,staggerUnit:`seconds`,triggerEnabled:e.trigger!==void 0,triggerScript:e.trigger?.script??``,triggerOnce:e.trigger?.once===!0,sessionTarget:e.sessionTarget,wakeMode:e.wakeMode,payloadKind:r?.kind??im.payloadKind,payloadLocked:i,payloadText:r?.kind===`systemEvent`?r.text:r?.kind===`agentTurn`?r.message:r?.kind===`command`?r.argv.join(` `):r?.kind===`script`?r.script:``,payloadModel:r?.kind===`agentTurn`?r.model??``:``,payloadThinking:r?.kind===`agentTurn`?r.thinking??``:``,payloadLightContext:r?.kind===`agentTurn`&&r.lightContext===!0,deliveryMode:e.delivery?.mode??`none`,deliveryChannel:e.delivery?.channel??rm,deliveryTo:e.delivery?.to??``,deliveryAccountId:e.delivery?.accountId??``,deliveryBestEffort:e.delivery?.bestEffort??!1,deliveryThreadId:e.delivery?.threadId,deliveryCompletionDestination:e.delivery?.mode===`announce`?e.delivery.completionDestination:void 0,deliveryFailureDestination:e.delivery?.failureDestination,failureAlertMode:e.failureAlert===!1?`disabled`:n?`custom`:`inherit`,failureAlertAfter:typeof n?.after==`number`?String(n.after):``,failureAlertCooldownSeconds:typeof n?.cooldownMs==`number`?If(n.cooldownMs):``,failureAlertChannel:n?.channel??rm,failureAlertTo:n?.to??``,failureAlertDeliveryMode:n?.mode??``,failureAlertAccountId:n?.accountId??``,timeoutSeconds:r?.kind===`agentTurn`&&typeof r.timeoutSeconds==`number`?String(r.timeoutSeconds):``};if(e.schedule.kind===`at`)a.scheduleAt=Pf(e.schedule.at);else if(e.schedule.kind===`every`){let t=Ff(e.schedule.everyMs);a.everyAmount=t.everyAmount,a.everyUnit=t.everyUnit}else if(e.schedule.kind===`cron`){a.cronExpr=e.schedule.expr,a.cronTz=e.schedule.tz??``;let t=Lf(e.schedule.staggerMs);a.scheduleExact=t.scheduleExact,a.staggerAmount=t.staggerAmount,a.staggerUnit=t.staggerUnit}return Sp(a)}function Vp(e,t,n){let r=!n&&t&&`toolsAllow`in t?t.toolsAllow:void 0,i=r?{toolsAllow:[...r]}:{};if(e.payloadKind===`systemEvent`){let t=e.payloadText.trim();if(!t)throw Error(B(`cron.errors.systemEventTextRequired`));return{kind:`systemEvent`,text:t,...i}}if(e.payloadKind!==`agentTurn`)throw Error(`Cron ${e.payloadKind} payloads are read-only in Control UI.`);let a=e.payloadText.trim();if(!a)throw Error(B(`cron.errors.agentMessageRequiredShort`));let o=t?.kind===`agentTurn`?t:void 0,s=n?void 0:o,c=e.payloadModel.trim()||(n&&o?.model!==void 0?null:void 0),l=e.payloadThinking.trim()||(n&&o?.thinking!==void 0?null:void 0),u=e.timeoutSeconds.trim(),d=tn(u,NaN),f=e.payloadLightContext||o?.lightContext!==void 0?e.payloadLightContext:void 0;return{kind:`agentTurn`,message:a,...c===void 0?{}:{model:c},...l===void 0?{}:{thinking:l},...u&&Number.isFinite(d)&&d>=0?{timeoutSeconds:d}:n&&o?.timeoutSeconds!==void 0?{timeoutSeconds:null}:{},...f===void 0?{}:{lightContext:f},...i,...s?.fallbacks?{fallbacks:[...s.fallbacks]}:{},...s?.allowUnsafeExternalContent===void 0?{}:{allowUnsafeExternalContent:s.allowUnsafeExternalContent}}}function Hp(e,t={}){let n=e.trim();if(n)return n===rm?t.preserveLast?rm:void 0:n}function Up(e){let t=e.trim(),n=tn(t,NaN);if(!t||!Number.isFinite(n)||n<0)return;let[r,i=`0`]=(n===0||ae(t)===void 0?String(n):t).split(/[eE]/u),a=Number(`${r}e${Number(i)+3}`);return Number.isFinite(a)&&a>=0?Math.floor(a):void 0}function Wp(e,t,n=!1){if(e.failureAlertMode===`disabled`)return!1;if(e.failureAlertMode!==`custom`)return n&&t!==void 0?null:void 0;let r=t&&typeof t==`object`?t:void 0,i=n?r:void 0,a=tn(e.failureAlertAfter.trim(),0),o=Up(e.failureAlertCooldownSeconds),s=e.failureAlertAccountId.trim(),c=e.failureAlertTo.trim();return{after:a>0?Math.floor(a):i?.after===void 0?void 0:null,channel:Hp(e.failureAlertChannel,{preserveLast:!!r?.channel}),to:c||(i?.to?null:void 0),...o===void 0?i?.cooldownMs===void 0?{}:{cooldownMs:null}:{cooldownMs:o},mode:e.failureAlertDeliveryMode||(i?.mode===void 0?void 0:null),accountId:s||(i?.accountId?null:void 0),includeSkipped:r?.includeSkipped}}function Gp(e){if(!e||typeof e!=`object`)return null;let t=`job`in e?e.job:e;if(!t||typeof t!=`object`)return null;let n=t.id;return typeof n==`string`&&n.length>0?n:null}async function Kp(e){let t={saved:!1};return await jp(e,void 0,async n=>{let r=Sp(e.cronForm);r!==e.cronForm&&(e.cronForm=r);let i=Cp(r);if(e.cronFieldErrors=i,wp(i))return;let a=e.cronEditingJob,o=a?Mp(a.configRevision):void 0,s=a??e.cronCloningJob,c=s?Hf(s):null,l=s&&Rf(r,s)?a?void 0:s.schedule:zf(r,a?.schedule),u=a&&r.payloadLocked&&zp(c,s?.declarationKey)?void 0:Vp(r,c,!!a),d=r.deliveryMode,f=r.deliveryAccountId.trim(),p=d===`announce`?f||(a?.delivery?.accountId?null:void 0):void 0,m=d&&d!==`none`?{mode:d,channel:d===`announce`?Hp(r.deliveryChannel,{preserveLast:!!a?.delivery?.channel}):void 0,to:r.deliveryTo.trim()||(d===`announce`&&a?.delivery?.to?null:void 0),accountId:p,bestEffort:r.deliveryBestEffort,...r.deliveryThreadId===void 0?{}:{threadId:r.deliveryThreadId},...d===`announce`&&r.deliveryCompletionDestination?{completionDestination:r.deliveryCompletionDestination}:{},...r.deliveryFailureDestination?{failureDestination:r.deliveryFailureDestination}:{}}:d===`none`?{mode:`none`,...r.deliveryBestEffort?{bestEffort:!0}:{},...r.deliveryThreadId===void 0?{}:{threadId:r.deliveryThreadId},...r.deliveryFailureDestination?{failureDestination:r.deliveryFailureDestination}:{}}:void 0,h=Wp(r,s?.failureAlert,!!a),g=r.triggerScript.trim(),_=r.triggerEnabled?a?.trigger?.script===g&&a.trigger.once===!0===r.triggerOnce?void 0:{script:g,once:r.triggerOnce}:a?.trigger?null:void 0,v=r.clearAgent?null:r.agentId.trim(),y=r.sessionKey.trim()||(a?.sessionKey?null:void 0),b={name:r.name.trim(),description:r.description.trim(),agentId:v===null?null:v||void 0,sessionKey:y,enabled:r.enabled,...r.scheduleKind===`at`||r.scheduleKind===`on-exit`?{deleteAfterRun:r.deleteAfterRun}:{},sessionTarget:r.sessionTarget,wakeMode:r.wakeMode,trigger:_,delivery:m,failureAlert:h};if(l&&(b.schedule=l),s?.pacing&&(l?.kind===`every`||l?.kind===`cron`?a||(b.pacing={...s.pacing}):a&&l&&(b.pacing=null)),u&&(b.payload=u),!b.name)throw Error(B(`cron.errors.nameRequiredShort`));if(a){let i=a.id,s=()=>e.cronEditingJob===a&&e.cronForm===r;try{let t=await n.request(`cron.update`,{id:i,expectedConfigRevision:o,patch:b});Np(e,t),s()&&$p(e,t)}catch(t){if(!Pp(t)){if(s())throw t;return}if(await qp(e),!s())return;try{let t=await n.request(`cron.get`,{id:i});if(!s())return;$p(e,t),e.cronError=`This automation changed on the Gateway. The latest definition is loaded; review it before retrying.`}catch{s()&&(e.cronError=`This automation changed on the Gateway, but the latest definition could not be loaded. Refresh before retrying.`)}return}t={saved:!0,jobId:i}}else{let r=await n.request(`cron.add`,b);Rp(e,v),t={saved:!0,jobId:Gp(r)}}await qp(e)}),t}async function qp(e){await Xf(e,{tableFilters:!0}),await Dp(e)}async function Jp(e,t,n){let r=!1;return await jp(e,t,async i=>{let a=await i.request(`cron.update`,{id:t.id,expectedConfigRevision:Mp(t.configRevision),patch:{enabled:n}});Np(e,a),e.cronEditingJob?.id===a.id&&Qp(e,a,{...e.cronForm,enabled:a.enabled}),r=!0,await qp(e)}),r}async function Yp(e,t,n=`force`){await jp(e,e.cronEditingJob?.id===t?e.cronEditingJob:e.cronJobs.find(e=>e.id===t)??{id:t,name:t},async(r,i)=>{let a=await r.request(`cron.run`,{id:t,mode:n});if(!a.ok||`ran`in a&&!a.ran){i(np(a)),`reason`in a&&a.reason===`invalid-spec`&&await lp(e);return}await lp(e),`enqueued`in a&&a.enqueued&&i(`Run queued. Run ID: ${a.runId}`)})}async function Xp(e,t){await jp(e,t,async n=>{await n.request(`cron.remove`,{id:t.id});let r=e.cronJobs.length;e.cronJobs=e.cronJobs.filter(e=>e.id!==t.id),e.cronJobs.length!==r&&(e.cronJobsTotal=Math.max(0,e.cronJobsTotal-1)),e.cronEditingJob?.id===t.id&&Lp(e),e.cronRunsJobId===t.id&&(e.cronRunsJobId=null,ap(e)),await qp(e)})}function Zp(e){Tp(e),fp(e),e.cronJobsReloadPending=!1,e.cronJobsReloadPendingTableFilters=!1}function Qp(e,t,n){Ip(e),e.cronError=null,e.cronEditingJob=t,e.cronCloningJob=null,e.cronRunsJobId=t.id,e.cronForm=n,e.cronFieldErrors=Cp(n)}function $p(e,t){Qp(e,t,Bp(t,e.cronForm))}function em(e,t){let n=e.trim()||`Job`,r=`${n} copy`;if(!t.has(A(r)))return r;let i=2;for(;i<1e3;){let e=`${n} copy ${i}`;if(!t.has(A(e)))return e;i+=1}return`${n} copy ${Date.now()}`}function tm(e,t){Lp(e),e.cronCloningJob=t,e.cronRunsJobId=t.id;let n=new Set(e.cronJobs.map(e=>A(e.name))),r=Bp(t,e.cronForm);r.name=em(t.name,n),r.payloadLocked&&(r.payloadLocked=!1,r.payloadKind=im.payloadKind,r.payloadText=``),e.cronForm=Sp(r,{payloadKind:r.payloadKind}),e.cronFieldErrors=Cp(e.cronForm)}function nm(e,t){Lp(e),Rp(e,t)}var rm,im,Y;function am(){return(am=e((()=>{fe(),n(),Vn(),kn(),se(),U(),H(),Qe(),st(),Nf(),Bf(),tp(),Uf(),rp(),mp(),gp(),rm=`last`,im={name:``,description:``,agentId:``,sessionKey:``,clearAgent:!1,enabled:!0,deleteAfterRun:!1,scheduleKind:`every`,scheduleAt:``,everyAmount:`30`,everyUnit:`minutes`,cronExpr:`0 7 * * *`,cronTz:``,scheduleExact:!1,staggerAmount:``,staggerUnit:`seconds`,triggerEnabled:!1,triggerScript:``,triggerOnce:!1,sessionTarget:`isolated`,wakeMode:`now`,payloadKind:`agentTurn`,payloadLocked:!1,payloadText:``,payloadModel:``,payloadThinking:``,payloadLightContext:!1,deliveryMode:`none`,deliveryChannel:`last`,deliveryTo:``,deliveryAccountId:``,deliveryBestEffort:!1,deliveryThreadId:void 0,deliveryCompletionDestination:void 0,deliveryFailureDestination:void 0,failureAlertMode:`inherit`,failureAlertAfter:``,failureAlertCooldownSeconds:``,failureAlertChannel:`last`,failureAlertTo:``,failureAlertDeliveryMode:``,failureAlertAccountId:``,timeoutSeconds:``},Y=new WeakMap})))()}async function om(e,t,n,r){e.subscribers.add(t);let i;try{if(!n)return await e.promise;let r=()=>void 0,a=new Promise((e,t)=>{r=t});return i=()=>{e.subscribers.delete(t),e.subscribers.size===0&&e.controller?.abort(n.reason),r(n.reason)},n.addEventListener(`abort`,i,{once:!0}),n.aborted&&i(),await Promise.race([e.promise,a])}finally{i&&n?.removeEventListener(`abort`,i),e.subscribers.delete(t),r?.()}}function sm(){return(sm=e((()=>{})))()}function cm(e){let t=x(e);return Tn(t)??t}function lm(e){return e.status===`missing`?!0:Array.isArray(e.profiles)?e.profiles.some(e=>e.type===`oauth`||e.type===`token`):!1}function um(e){let t=new Map;for(let n of e){let e=cm(n.provider),r=t.get(e)??[];r.push(n),t.set(e,r)}return[...t].map(([e,t])=>{let n=t.reduce((e,t)=>gm.indexOf(t.status)<gm.indexOf(e.status)?t:e),r=t.find(e=>e.apiKey)?.apiKey;return Object.assign({},n,{provider:e,profiles:t.flatMap(e=>e.profiles),...r?{apiKey:r}:{}})})}function dm(e,t){let n;for(let r of e.providers)for(let i of[r,...r.profiles])if(i.expiry)for(let r of[864e5,3e5,0]){let a=i.expiry.at-r;if(a>e.ts){let r=t+(a-e.ts);(n===void 0||r<n)&&(n=r)}}return n}function fm(e){return hm.get(e)}async function pm(e,t){t.signal?.throwIfAborted();let n={...t?.refresh?{refresh:!0}:{},agentId:t.agentId},r=async t=>{let r=Date.now(),i=(t?await e.request(`models.authStatus`,n,{signal:t}):await e.request(`models.authStatus`,n))??mm;return Array.isArray(i.providers)&&hm.set(i,dm(i,r)),i},i=It.get(e);if(i||(i={entries:new Map,refreshes:0},It.set(e,i)),t.refresh){i.entries.clear(),i.refreshes+=1;try{return await r(t.signal)}finally{--i.refreshes}}if(i.refreshes>0)return await r(t.signal);let a=i.entries,o=t.agentId,s=a.get(o);if(s?.refreshAt!==void 0&&s.refreshAt<=Date.now()&&(a.delete(o),s=void 0),!s){let e={promise:r(),subscribers:new Set};a.set(o,e);let t=()=>{a.get(o)===e&&a.delete(o)};e.promise.then(n=>{n===mm||n.unavailable||!Array.isArray(n.providers)?t():a.get(o)===e&&(e.refreshAt=fm(n))},t),s=e}return await om(s,{},t.signal)}var mm,hm,gm;function _m(){return(_m=e((()=>{_(),zn(),Bt(),mm={ts:0,providers:[]},hm=new WeakMap,gm=[`expired`,`missing`,`expiring`,`ok`,`static`]})))()}function vm(e){return e.state?.lastRunStatus??e.state?.lastStatus??`unknown`}function ym(e){let t=e.state?.runningAtMs;return typeof t==`number`&&Number.isFinite(t)}function bm(e){return e.state?.autoDisabled?!0:e.enabled&&vm(e)===`error`}function xm(){return(xm=e((()=>{})))()}function Sm(e,t,n,r){let i=[...e],a=i.indexOf(t),o=i.indexOf(n);if(a<0||o<0||a===o)return i;let[s]=i.splice(a,1);if(s===void 0)return i;let c=i.indexOf(n)+ +(r===`after`);return i.splice(c,0,s),i}function Cm(){return(Cm=e((()=>{})))()}function wm(e,t){let n=new Set(e),r=t.map(e=>N(e.category)).filter(e=>typeof e==`string`&&!n.has(e)).toSorted((e,t)=>e.localeCompare(t));return[...e,...new Set(r)]}function Tm(e,t,n=[]){let r=m(t),i=new Set(r),a=m(n),o=new Set(a),s=(kt(e)??[]).filter(e=>e.startsWith(`category:`)?i.has(e.slice(9)):!e.startsWith(`catalog:`)||o.has(e.slice(8)));for(let e of r){let t=`category:${e}`;if(s.includes(t))continue;let n=s.findIndex(e=>Lm.includes(e));s.splice(n<0?s.length:n,0,t)}for(let[e,t]of Lm.entries()){if(s.includes(t))continue;if(e===0){s.push(t);continue}let n=Lm[e-1];s.splice(s.indexOf(n)+1,0,t)}let c=a.map(e=>`catalog:${e}`).filter(e=>!s.includes(e));return s.splice(s.indexOf(`work`)+1,0,...c),s}function Em(e){return Fm.includes(e)?e:`none`}function Dm(e){let t=new Date(e),n=e=>new Date(t.getFullYear(),t.getMonth(),t.getDate()-e).getTime(),r=n(0),i=n(1),a=n(6);return({updatedAt:e})=>typeof e!=`number`||!Number.isFinite(e)||e<=0?``:e>=r?`today`:e>=i?`yesterday`:e>=a?`week`:`older`}function Om(e){return e.channel??yt(e.key)?.channel??``}function km(e,t){switch(t){case`category`:return e.category?.trim()??``;case`person`:return Hd(e.owner?.actor);case`channel`:return Om(e);case`kind`:return Ve(e);case`agent`:return z(e.key)?.agentId??``;default:return``}}function Am(e){let t=e.now??Date.now(),n=e.mode===`date`?Dm(t):t=>km(t,e.mode),r=new Map;for(let t of e.rows){let e=n(t),i=r.get(e);i?i.push(t):r.set(e,[t])}return Pm(e.mode,r,e.knownCategories??[]).map(e=>({id:e,rows:r.get(e)??[]}))}function jm(e){return e===`none`||e===`person`||e===`project`?e:`category`}function Mm(e,t){return t===`category`&&e.pinned!==!0&&!!e.category?.trim()&&e.kind===`group`}function Nm(e,t={}){let n=t.grouping??`category`,r=[],i=[],a=[],o=[],s=new Map,c=[],l=new Map,u=new Map;if(n===`category`)for(let e of t.knownGroups??[]){let t=e.trim();t&&!s.has(t)&&(s.set(t,[]),c.push(t))}for(let t of e){if(t.pinned===!0){r.push(t);continue}if(n===`none`){i.push(t);continue}let e=n===`project`&&t.workContext?Ud(t.workContext.path):null;if(e){let n=u.get(e);n?n.rows.push(t):u.set(e,{id:`project:${e}`,project:{name:Wd(e),path:e},rows:[t]});continue}let c=n===`person`?t.owner?.actor:void 0,d=c?.identity?.id,f=Hd(c);if(c&&d&&f){let e=l.get(f);e?e.rows.push(t):l.set(f,{id:`person:${f}`,personOwner:{...c,id:d},rows:[t]});continue}let p=n===`category`?t.category?.trim():void 0;if(p){let e=s.get(p);e?e.push(t):s.set(p,[t]);continue}if(t.kind===`group`){a.push(t);continue}if(t.workSession===!0||t.acpSession===!0){o.push(t);continue}i.push(t)}let d=[];r.length>0&&d.push({id:`pinned`,rows:r}),d.push(...[...l.values()].toSorted((e,n)=>{let r=e.personOwner,i=n.personOwner;return(r.identity?.type===`agent`?2:r.identity?.type===`profile`&&r.id===t.selfOwnerId?0:1)-(i.identity?.type===`agent`?2:i.identity?.type===`profile`&&i.id===t.selfOwnerId?0:1)||(r.label||r.id).localeCompare(i.label||i.id)||r.id.localeCompare(i.id)})),d.push(...[...u.values()].toSorted((e,t)=>{let n=e.project,r=t.project;return n.name.localeCompare(r.name)||n.path.localeCompare(r.path)}));let f=[...c,...[...s.keys()].slice(c.length).toSorted((e,t)=>e.localeCompare(t))],p=f.map(e=>({id:`category:${e}`,category:e,rows:s.get(e)??[]}));p.push({id:`ungrouped`,rows:i});let h=e.some(e=>Mm(e,n));(a.length>0||h)&&p.push({id:`groups`,groups:!0,rows:a}),p.push({id:`work`,work:!0,rows:o});let g=m(t.catalogIds);if(p.push(...g.map(e=>({id:`catalog:${e}`,rows:[]}))),t.sectionOrder){let e=new Map(p.map(e=>[e.id,e]));for(let n of Tm(t.sectionOrder,f,g)){let t=e.get(n);t&&(d.push(t),e.delete(t.id))}return d.push(...p.filter(t=>e.has(t.id))),d}return d.push(...p),d}function Pm(e,t,n){if(e===`date`)return Im.filter(e=>t.has(e));if(e===`category`){let e=m(n),r=[...t.keys()].filter(t=>t!==``&&!e.includes(t)).toSorted((e,t)=>e.localeCompare(t));return[...e,...r,``]}let r=[...t.keys()].filter(e=>e!==``);return r.sort((e,t)=>e.localeCompare(t)),t.has(``)&&r.push(``),r}var Fm,Im,Lm,Rm;function zm(){return(zm=e((()=>{n(),At(),qd(),Ke(),V(),Fm=[`none`,`category`,`person`,`channel`,`kind`,`agent`,`date`],Im=[`today`,`yesterday`,`week`,`older`,``],Lm=[`ungrouped`,`groups`,`work`],Rm=Sm})))()}function Bm(e,t,n){e.onNavigate&&e.sessionDataContext&&(e.sessionDataContext.agentSelection.set(n),e.onNavigate(`terminal`,{pathname:or(`terminal`,e.basePath),search:Me(t),hash:``}))}async function Vm(e,t,n){let{prepareCatalogTerminal:r}=await Ce(async()=>{let{prepareCatalogTerminal:e}=await import(`./catalog-terminal-start-CAl9O1Oq.js`);return{prepareCatalogTerminal:e}},__vite__mapDeps([0,1,2]),import.meta.url);return r(e,t,n)}function Hm(){return(Hm=e((()=>{tr(),ke(),r()})))()}function Um(e){return Bn(e)?.map(Re).join(` `)}function Wm(e,t=B(`common.na`)){return e==null||!Number.isFinite(e)||e<0?t:En(e).map(Re).join(` `)}function Gm(){return(Gm=e((()=>{Pn(),U(),Qe()})))()}var Km;function qm(){return(qm=e((()=>{Km=class{constructor(e,t,n,r=!0,i=`always`){this.intervalMs=t,this.tick=n,this.autoStart=r,this.visibility=i,this.timer=null,this.running=!1,this.handleVisibilityChange=()=>{this.running&&(this.isVisible()?this.startTimer()&&this.tick():this.clearTimer())},e.addController(this)}hostConnected(){this.autoStart&&this.start()}hostDisconnected(){this.stop()}start(){return!this.running&&(this.running=!0,this.visibility===`visible`&&document.addEventListener(`visibilitychange`,this.handleVisibilityChange),this.startTimer(),!0)}stop(){this.running=!1,this.visibility===`visible`&&document.removeEventListener(`visibilitychange`,this.handleVisibilityChange),this.clearTimer()}isVisible(){return this.visibility===`always`||document.visibilityState!==`hidden`}startTimer(){return this.timer!==null||!this.isVisible()?!1:(this.timer=globalThis.setInterval(()=>{this.isVisible()&&this.tick()},this.intervalMs),!0)}clearTimer(){this.timer!==null&&(globalThis.clearInterval(this.timer),this.timer=null)}}})))()}function Jm(e,t){let n={},r=e.activeRouteId,i=e.sessionKey;eh.set(e,n);let a={...t,commit:()=>!e.isConnected||e.activeRouteId!==r||e.sessionKey!==i||eh.get(e)!==n?!1:(eh.delete(e),t.commit())},o=new CustomEvent(Qm,{cancelable:!0,detail:a});globalThis.dispatchEvent(o),o.defaultPrevented||a.commit()}function Ym(e,t,n){let{client:r,hello:i}=e.snapshot,a={pathname:t,sessionKey:n,client:r,hello:i};$m.set(e,a),globalThis.setTimeout(()=>{$m.get(e)===a&&$m.delete(e)},Zm)}function Xm(e,t){let n=$m.get(e);if(!n||n.pathname!==t)return;$m.delete(e);let{client:r,hello:i}=e.snapshot;if(n.client===r&&n.hello===i)return n.sessionKey}var Zm,Qm,$m,eh;function th(){return(th=e((()=>{Zm=2e3,Qm=`openclaw:session-navigation-intent`,$m=new WeakMap,eh=new WeakMap})))()}function nh(e,t,n){let r=[t?.nativeDirectUserId,t?.from];r.some(e=>N(e))||r.push(n);for(let t of r){let n=N(t);if(n){if(e===`matrix`){if(n=n.replace(/^matrix:/i,``),/^@[^\s:]+:[^\s]+$/.test(n))return n;continue}if(e===`whatsapp`){n=n.replace(/^whatsapp:/i,``);let e=n.match(/^(\d+)(?:@s\.whatsapp\.net)?$/i);e&&(n=`+${e[1]}`)}else if(e===`signal`)n=n.replace(/^signal:/i,``);else if([`imessage`,`bluebubbles`,`sms`,`email`].includes(e)){if(n=n.replace(/^(?:imessage|bluebubbles|sms|auto|email):/i,``),/^[^\s@:]+@[^\s@:]+$/.test(n))return n}else continue;if(/^\+[1-9]\d{1,14}$/.test(n))return n}}}function rh(e,t){let n=t;if(n){if(e===`discord`)n=n.replace(/ (?:user|channel) id:\d+$/,``);else if(e===`telegram`){if(n=n.replace(/(?:^| )id:-?\d+(?: topic:\d+)?$/,``),/^(?:id:unknown|group:-?\d+(?: topic:\d+)?)$/.test(n))return}else e===`signal`&&(n=n.replace(/ id:\S+$/,``));return N(n)}}function ih(e){let t=Et(e.key,e.channel),n=he(t.channel);if(!t.channelSession||!n)return;let r=he(e.channel),i=he(e.origin?.provider??e.origin?.surface),a=(!r||r===n)&&(!i||i===n),o=a?e.origin:void 0,s=he(e.deliveryContext?.channel)===n?e.deliveryContext:void 0,c=aa(e.key),l=e.key.match(/^agent:[^:]+:[^:]+:(direct|dm|group|channel|thread):/)?.[1]??e.key.match(/^agent:[^:]+:[^:]+:[^:]+:(direct|dm):/)?.[1],u=a?e.chatType??o?.chatType:void 0,d=u??(l===`dm`?`direct`:l===`direct`||l===`group`||l===`channel`||l===`thread`?l:void 0),f=o?.threadId??s?.threadId??Zi(e.key).threadId??(n===`telegram`?e.key.match(/:topic:(\d+)$/u)?.[1]:void 0),p=n===`telegram`&&f!=null?N(String(f)):void 0;f!=null&&String(f).trim()&&(d=n===`telegram`?`topic`:`thread`);let m=u===`direct`||d===`direct`?nh(n,o,c?.channel===n&&(c.peerKind===`direct`||c.peerKind===`dm`)?c.peerId:void 0):void 0,h=rh(n,N(o?.label)),g=a?N(e.subject):void 0,_=a?N(e.groupChannel):void 0,v=n===`discord`?h??_??g:(n===`msteams`&&/^(?:personal|groupChat|channel)$/.test(g??``)?void 0:g)??_??h;(v===m||v===o?.from||v===o?.to||v===o?.nativeChannelId)&&(v=void 0);let y=(!r||r===n?N(e.accountId):void 0)??N(s?.accountId)??N(o?.accountId);return{channel:n,channelLabel:qe(n),kind:d,topicId:p,conversation:v,address:m,account:y==="default"?void 0:y}}function ah(){return(ah=e((()=>{sa(),At()})))()}function oh(e){let t=N(e.label),n=z(e.key)?.rest.startsWith(`dashboard:`)?N(e.displayName)??(e.worktree?void 0:N(e.derivedTitle)):void 0;return t??n??``}function sh(e,t,n){let r=N(e)??null;return r===(N(t)??null)||r===(N(n)??null)?null:{label:r}}function ch(){return(ch=e((()=>{V()})))()}function lh(e,t,n,r=new Set,i=new Set,a=new Set){let o=new Set(t.map(e=>e.key)),s=new Set(n),c=new Set,l=[],u=[];for(let t of e){let e=pr(t);if(!e)continue;let n=Yn(e);c.has(n)||(e.type!==`route`||s.has(e.route))&&(e.type!==`session`||o.has(e.key)||!r.has(e.key))&&(c.add(n),u.push(n),(e.type===`route`||(e.type===`plugin`?i.has(e.key):o.has(e.key)))&&l.push(e))}for(let e of t){let t={type:`session`,key:e.key},n=Yn(t);c.has(n)||(c.add(n),l.push(t),u.push(n))}for(let e of a){let t={type:`plugin`,key:e},n=Yn(t);i.has(e)&&!c.has(n)&&(c.add(n),l.push(t),u.push(n))}return{entries:l,sidebarEntries:u}}function uh(){return(uh=e((()=>{fr()})))()}async function dh(e){if(e.initialResult===null)return[];let t=new Map,n;for(let r=0;r<fh;r+=1){let i=t.size,a=new Set,o=0,s=r===0?e.initialResult:void 0;for(;!a.has(o);){a.add(o);let r=s??await e.list(o);if(s=void 0,e.isCurrent&&!e.isCurrent())return null;if(!r)throw Error(e.missingResultError);e.resultKind===`window`&&(t.clear(),n=r.totalCount),typeof r.totalCount==`number`&&(n=Math.max(n??0,r.totalCount));let i=e.mapPageRows?.(r.sessions)??r.sessions;for(let e of i)t.set(e.key,e);if(!(r.hasMore??(typeof r.totalCount==`number`&&o+r.sessions.length<r.totalCount)))break;let c=r.nextOffset??(r.offset??o)+r.sessions.length;if(c<=o){if(e.stalledPaginationError)throw Error(e.stalledPaginationError);break}o=c}if(e.resultKind!==`window`&&t.size===i||n===void 0||t.size>=n)break}if(e.incompletePaginationError&&n!==void 0&&t.size<n)throw Error(e.incompletePaginationError);return[...t.values()]}var fh;function ph(){return(ph=e((()=>{fh=4})))()}function mh(e,t=gh){return{spawnedBy:e,limit:t,includeGlobal:!1,includeUnknown:!1,configuredAgentsOnly:!0}}async function hh(e){let t=e.pageSize??gh,n=mh(e.parentKey,t),r=()=>{let t=e.sessions.listSnapshot(n);if(t.error)throw Error(t.error);return t.result};return e.initialResult&&await e.sessions.refreshList(n),dh({list:async t=>(await e.sessions.refreshList({...n,...t>0?{offset:t,append:!0}:{}}),r()),initialResult:e.initialResult?r():void 0,resultKind:`window`,isCurrent:e.isCurrent,missingResultError:`child session list returned no result`,incompletePaginationError:`The child session list kept changing. Try again.`})}var gh;function _h(){return(_h=e((()=>{ph(),gh=100})))()}function vh(){let e=null,t=yh,n=()=>{e!==null&&(globalThis.clearTimeout(e),e=null)};return{cancel:n,reset(){n(),t=yh},schedule(r){n();let i=t;t=Math.min(t*2,bh),e=globalThis.setTimeout(()=>{e=null,r()},i)}}}var yh,bh;function xh(){return(xh=e((()=>{yh=3e4,bh=3e5})))()}function Sh(e,t){let n=vh(),r=!1,i=!1,a=0,o=null,s=null,c=null;function l(){i=!1,r&&t.sync()}function u(){if(!r||i)return;i=!0;let e=a;globalThis.queueMicrotask(()=>{e===a&&l()})}let d=()=>{n.reset(),u()};return{get attached(){return r},get retry(){return n},sync:l,schedule:u,attach(){r||(r=!0,t.onAttach(),o=e.subscribe(t.onSnapshot??u),s=t.onEvent?e.subscribeEvents(t.onEvent):null,typeof document<`u`&&(document.addEventListener(`visibilitychange`,d),c=document))},detach(){r&&(r=!1,o?.(),o=null,s?.(),s=null,c?.removeEventListener(`visibilitychange`,d),c=null,n.reset(),a+=1,i=!1,t.onDetach())}}}function Ch(){return(Ch=e((()=>{xh()})))()}function wh(e){let t=e?.repository??e?.branch??e?.pullRequests[0];return t?{owner:t.owner,repo:t.repo}:null}function Th(e,t){let n=e.find(({state:e})=>e===`open`)??e.find(({state:e})=>e===`draft`)??e.find(({state:e})=>e===`merged`)??e[0];if(!n)return;let r=[...new Set(e.map(e=>e.number))].slice(0,20).toSorted((e,t)=>e-t);return t?.state===n.state&&t.numbers.join(`,`)===r.join(`,`)?t:{numbers:r,state:n.state}}function Eh(e){if(!e||typeof e!=`object`||!(`sessions`in e))return null;let t=e.sessions;return E(t)}function Dh(e){let t=new Map,n,r=[],i=new WeakMap,a=new Map,o=new Set,s=new Map,c=new Set,l=new Map,u=Lt(e.snapshot),d=null,f=null,p=0,m=null,h=[],g=null,_=()=>{g?.abort(),g=null},v=()=>{for(let e of Array.from(o))e()},y=(e,t)=>{let n=s.get(e);if(n){s.delete(e);for(let e of n)e(t)}},b=()=>{if(n)return n;let e=new Map;for(let n of t.values())for(let t of n.keys){let r=n.passive?0:n.foreground?2:1;e.set(t,Math.max(e.get(t)??0,r))}let i=[...e].toSorted(([e,t],[n,r])=>r-t||e.localeCompare(n)).slice(0,200);return n=i.map(([e])=>e),r=i.filter(([,e])=>e>0).map(([e])=>e),n},x=()=>(b(),r),S=()=>{let e=new Set(b()),t=new Set(x());for(let[e,n]of l)t.has(e)||(clearTimeout(n),l.delete(e));for(let e of c)t.has(e)||c.delete(e);for(let e of s.keys())t.has(e)||y(e);for(let t of a.keys())e.has(t)||a.delete(t)},C=()=>t.size>0||o.size>0||s.size>0,w=e=>{for(let t of h)e.includes(t)&&c.add(t)},ee=()=>{w(b()),p+=1,_(),m=null,h=[],d=null,f=null;let e=a.size>0;a.clear();for(let e of s.keys())y(e);e&&v()},T=Sh(e,{sync:ne,onSnapshot:e=>{let t=u.transition(e);t&&ee(),(t||e.hello!==d)&&(te.reset(),T.schedule())},onEvent:t=>{if(t.event===`agent`||t.event===`session.tool`){let n=E(t.payload),r=E(n?.data);if(typeof n?.sessionKey!=`string`||!(n.stream===`tool`&&r?.phase===`result`||n.stream===`lifecycle`&&(r?.phase===`end`||r?.phase===`error`)))return;for(let t of x())Ne({assistantAgentId:e.snapshot.assistantAgentId,hello:e.snapshot.hello,sessionKey:t},n.sessionKey,typeof n.agentId==`string`?n.agentId:void 0)&&D(t,{automatic:!0});return}if(t.event===`sessions.changed`){let n=at(t.payload),r=E(t.payload)?.reason;if(!n||!Ah.has(r))return;let i=b().filter(t=>Ne({assistantAgentId:e.snapshot.assistantAgentId,hello:e.snapshot.hello,sessionKey:t},n.key,n.agentId));if(i.length===0)return;let o=!1;for(let e of i)o=a.delete(e)||o,D(e,{automatic:!0});o&&v();return}if(t.event!==`controlUi.sessionPullRequests.changed`)return;let n=Eh(t.payload);if(!n)return;let r=new Set(b()),i=!1;for(let[e,t]of Object.entries(n)){if(!r.has(e))continue;let n=a.get(e),o=wh(t),s=wh(n),c=n?.branch?.branch??n?.pullRequests[0]?.branch,l=(!o||o.owner===s?.owner&&o.repo===s?.repo)&&(!t.branch||!c||t.branch.branch===c),u=t;n&&l&&(t.status===`rate-limited`||t.status===`unavailable`)&&t.pullRequests.length===0&&(u={...t,pullRequests:n.pullRequests,branch:t.branch??n.branch,repository:t.repository??n.repository}),a.set(e,u),i=!0,y(e,u)}i&&v()},onAttach:()=>{u.transition(e.snapshot)&&ee(),d=null,f=null},onDetach:()=>{p+=1,_(),m=null,h=[],d=null,f=null,a.clear();for(let e of l.values())clearTimeout(e);l.clear()}}),{retry:te}=T;function ne(){let t=e.snapshot,n=t.client;if(t.phase!==`connected`||n===null||t.hello===null||fi(t,`controlUi.sessionPullRequests.subscribe`)!==!0){w(b()),d=null,f=null,_();for(let e of s.keys())y(e);C()||T.detach();return}let r=x(),i=typeof document<`u`&&document.visibilityState===`hidden`?[]:r,a=JSON.stringify(i.toSorted());m!==null&&(a!==f||t.hello!==d)&&w(r);let o=new Set(i),l=[...c].filter(e=>o.has(e));if(t.hello===d&&a===f&&l.length===0){C()||T.detach();return}if(m!==null&&t.hello===d&&a===f)return;d=t.hello,f=a;let u=++p;_(),g=new AbortController;let v=()=>T.attached&&C()&&u===p&&t.hello===d&&a===f;te.cancel(),m=u,h=l;for(let e of l)c.delete(e);let S=n.request(kh,{sessionKeys:i,...l.length>0?{refreshSessionKeys:l}:{}},{timeoutMs:we,signal:g.signal});C()||T.detach(),S.then(()=>{v()&&te.reset()}).catch(()=>{if(v()){for(let e of l)c.add(e);f=null,te.schedule(()=>{T.attached&&C()&&T.schedule()});for(let e of i)y(e)}}).finally(()=>{m===u&&(m=null,h=[],v()&&c.size>0&&T.schedule())})}let re=(e,r,i={})=>{let a=C(),o=new Set(r.map(e=>e.trim()).filter(Boolean)),s=t.get(e);(s===void 0?o.size===0:s.keys.size===o.size&&s.foreground===(i.foreground===!0)&&s.passive===(i.passive===!0)&&[...o].every(e=>s.keys.has(e)))||(o.size===0?t.delete(e):t.set(e,{keys:o,foreground:i.foreground===!0,passive:i.passive===!0}),n=void 0,te.reset(),S(),C()?(a||(d=null,f=null),T.attach(),T.schedule()):T.attached&&T.sync())};function D(e,t={}){let n=e.trim();return!n||!x().includes(n)?!1:(clearTimeout(l.get(n)),l.delete(n),t.automatic?l.set(n,setTimeout(()=>D(n),5e3)):(c.add(n),te.reset(),T.schedule()),!0)}return{watch:re,unwatch:e=>{i.delete(e),re(e,[])},load:async(n,r)=>{let o=r.trim();if(!o)return;let c={};i.set(n,c);let l=x().includes(o);re(n,[o],{foreground:!0});try{let t=a.get(o);return t&&l?t:(t&&D(o),e.snapshot.phase!==`connected`||fi(e.snapshot,`controlUi.sessionPullRequests.subscribe`)!==!0?void 0:await new Promise(e=>{let t=s.get(o)??new Set;t.add(e),s.set(o,t),T.schedule()}))}finally{let e=t.get(n);i.get(n)===c&&e?.keys.size===1&&e.keys.has(o)&&(i.delete(n),re(n,[]))}},refresh:D,get:e=>a.get(e),subscribe:e=>{let t=C();return o.add(e),t||(d=null,f=null),T.attach(),()=>{o.delete(e)&&(C()?T.schedule():T.attached&&T.sync())}}}}function Oh(e){let t=jh.get(e);if(t)return t;let n=Dh(e);return jh.set(e,n),n}var kh,Ah,jh;function Mh(){return(Mh=e((()=>{ne(),Nn(),pi(),Ch(),Le(),V(),kh=`controlUi.sessionPullRequests.subscribe`,Ah=new Set([`new`,`reset`,`branch-switch`,`fork`,`rewind`]),jh=new WeakMap})))()}function Nh(e){let t=new Set(Ph);for(let n of(e??``).split(/\s+/)){let e=he(n);e&&t.add(e)}return[...t].join(` `)}var Ph,Fh;function Ih(){return(Ih=e((()=>{Ph=[`noopener`,`noreferrer`],Fh=`_blank`})))()}var Lh;function Rh(){return(Rh=e((()=>{Lh=`https://discord.gg/clawd`})))()}function zh(e,t){return JSON.stringify([`file`,e??``,t])}function Bh(e,t,n,r){return e===`file:${n}`||e===zh(t,r??n)}function Vh(e){let t=e.replace(/[\\/]+$/,``);return t.split(/[\\/]/).pop()||t}function Hh(e){let t=e.session;if(!t)return{root:null,label:null};if(t.repositoryWorkspaceId)return{root:t.execNode&&t.execCwd?.trim()||null,label:t.repository?Vh(t.repository.url).replace(/\.git$/u,``):null};let n=t.execNode?t.execCwd?.trim()||null:t.spawnedWorkspaceDir?.trim()||t.spawnedCwd?.trim()||e.worktreePath?.trim()||(t.worktree?``:e.agentWorkspace?.trim())||null;return{root:n,label:t.worktree?.repoRoot?Vh(t.worktree.repoRoot):n?Vh(n):null}}function Uh(){return(Uh=e((()=>{})))()}var Wh,Gh;function Kh(){return(Kh=e((()=>{W(),Wh={custodian:{pluginPlaceholder:`Ask OpenClaw about {plugin}`,pluginIntroTitle:`Ask about {plugin}`,pluginStarterPurpose:`What does it do?`,pluginStarterTools:`What tools does it have?`,pluginStarterSetup:`How do I set it up?`,pluginPromptPurpose:`What does {plugin} do?`,pluginPromptTools:`What tools does {plugin} provide?`,pluginPromptSetup:`How do I set up {plugin}?`,pluginHelpQuestion:`Explain {setting}`,pluginHelpFailed:`Could not prepare the setting question. Try Ask OpenClaw again.`,pluginHelpUnset:`Not set`,pluginHelpValue:`Current value: {value}`},pluginsPage:{installProgress:{title:`Installation progress`,stopped:`Installation stopped`,rejected:{title:`Plugin not installed`,recovery:`This attempt did not install the plugin. Resolve the reported issue, then select Retry install.`},saved:{title:`Installation saved`,recovery:`The installation was saved. Resolve the reported issue before reloading the plugin; do not install it again.`},unknown:{title:`Installation status unknown`,recovery:`The Gateway did not confirm the installation outcome. Reconnect and check installed plugins before trying again.`},retry:{title:`Installation failed`,recovery:`Resolve the reported issue, then select Retry install to try again.`},details:`Failure details`,viewStatus:`View status`,failure:`Installation failed`,resolve:{started:`Resolving package`,completed:`Package resolved`,failed:`Package resolution failed`},download:{started:`Downloading plugin`,completed:`Plugin downloaded`,failed:`Plugin download failed`},extract:{started:`Extracting archive`,completed:`Archive extracted`,failed:`Archive extraction failed`},files:{started:`Preparing plugin files`,completed:`Plugin files prepared`,failed:`Plugin file preparation failed`},dependencies:{started:`Installing plugin dependencies`,completed:`Plugin dependencies installed`,failed:`Dependency installation failed`},runtime:{started:`Applying plugin to Gateway`,completed:`Plugin applied to Gateway`,failed:`Plugin could not be applied to Gateway`}},editor:{title:`{name} settings`,search:`Search settings`,navigation:`Settings sections`,other:`Other`,noMatches:`No matching settings.`,empty:`This plugin has no configurable settings.`,permissions:`Permissions`,actions:`Actions for {name}`,reset:`Reset value`,ask:`Ask OpenClaw`},credentials:{stored:`••••••••`,replace:`Enter a new key to replace the stored credential.`,reveal:`Show API key`,hide:`Hide API key`,signup:`Get an API key`,useReference:`Use a secret reference`,editReference:`Edit reference`,viewSource:`View source`,fromSource:`From {source}`,environment:`From environment · {name}`,referenceTitle:`Secret reference`,referenceHelp:`Choose where this credential is stored. Saving changes the reference only; it does not rotate or test the secret.`,environmentHelp:`This credential comes from {name} in the Gateway environment. Change that environment variable at its source. Its value is never shown here.`,source:`Source`,provider:`Provider`,identifier:`Identifier`,sources:{env:`Environment`,file:`File`,exec:`Command provider`,store:`Secret store`},help:{env:`Use the environment variable name, for example SEARCH_API_KEY.`,file:`Use a JSON pointer such as /search/apiKey, or value for a single-value file provider.`,exec:`Use the identifier accepted by the configured command provider, such as team/search-key.`,store:`Use the stored secret name, for example SEARCH_API_KEY.`},unresolved:`This reference is currently unresolved. The configured source must provide the secret before the plugin can use it.`,invalid:`The setting could not accept this value. Check the source, provider, and identifier.`,invalidStored:`This credential has an invalid stored value. Replace it or edit its reference.`,stale:`Configuration changed. Reload this reference before editing it.`,saveFailed:`The credential could not be saved. Your draft is still available; try saving again.`},detailCapabilities:`Capabilities`,uiCapabilities:{page:{name:`Pages`,description:`Adds pages to OpenClaw.`},navigation:{name:`Navigation`,description:`Adds links to OpenClaw navigation.`},panel:{name:`Panels`,description:`Adds interface panels.`},action:{name:`Actions`,description:`Adds buttons or menu actions.`},accessory:{name:`Session accessories`,description:`Adds information or controls alongside sessions.`},widget:{name:`Dashboard widgets`,description:`Adds widgets to the dashboard.`},replacement:{name:`Interface replacements`,description:`Replaces supported parts of the interface.`},"link-reader":{name:`Link previews`,description:`Shows previews and details for supported links.`}},capabilityFamilies:{speechProviders:{name:`Text to speech`,description:`Turn text into spoken audio.`},realtimeTranscriptionProviders:{name:`Live transcription`,description:`Transcribe audio as it arrives.`},realtimeVoiceProviders:{name:`Realtime voice`,description:`Support live voice conversations.`},mediaUnderstandingProviders:{name:`Media understanding`,description:`Analyze supported media inputs.`},imageGenerationProviders:{name:`Image generation`,description:`Create images from prompts and supported references.`},videoGenerationProviders:{name:`Video generation`,description:`Create video with supported generation models.`},musicGenerationProviders:{name:`Music generation`,description:`Create music with supported generation models.`},embeddingProviders:{name:`Embeddings`,description:`Represent content for semantic search and retrieval.`},webSearchProviders:{name:`Web search`,description:`Find information on the web.`},webFetchProviders:{name:`Web fetching`,description:`Read content from web pages.`},webContentExtractors:{name:`Web content extraction`,description:`Extract readable content from web pages.`},documentExtractors:{name:`Document extraction`,description:`Extract content from supported documents.`},transcriptSourceProviders:{name:`Transcripts`,description:`Capture or import transcripts from supported sources.`},migrationProviders:{name:`Migration`,description:`Bring supported data into OpenClaw.`}},breadcrumb:`Breadcrumb`,settingsDescription:`Configure installed plugins, access, and lifecycle.`,settingsTabs:`Plugin settings sections`,settingsInstalled:`Installed`,settingsInstalledDescription:`Search and configure plugins available to this gateway.`,advanced:`Advanced`,advancedDescription:`Global plugin loading, allow and deny lists, and capability slot ownership.`,searchInstalled:`Search installed plugins`,noSettingsMatches:`No installed plugins match this search.`,noInstalled:`No plugins are installed.`,connectToManage:`Connect to the gateway to inspect plugins.`,auth:{accounts:`Accounts`,credentials:`Credentials`,edit:`Edit`,connected:`Connected`,configured:`Configured`,editAccount:`Edit {name} connection`,editCredential:`Edit {name}`,connectAccount:`Connect {name}`,configure:`Configure`,configureCredential:`Configure {name}`,connect:`Connect`,requestFailed:`Sign-in did not finish. Try connecting again.`,sessionExpired:`This sign-in session expired. Try connecting again.`},toggleNamed:`Enable or disable {name}`,schemaUnavailable:`Plugin settings schema is unavailable.`,pluginNotFound:`This installed plugin could not be found.`,configuration:`Configuration`,configurationDescription:`Settings declared by this plugin.`,accessCapabilities:`Access & capabilities`,accessCapabilitiesDescription:`What this plugin can access with the current policy.`,promptContextAccess:`Add context to prompts`,promptContextAccessDescription:`Allows hooks to add plugin context before a model runs.`,conversationAccess:`Read conversation context`,conversationAccessDescription:`Allows hooks to inspect conversation content.`,modelOverrideAccess:`Override model selection`,modelOverrideAccessDescription:`Allows plugin actions or subagents to choose another model.`,accessAllowed:`Allowed`,accessBlocked:`Blocked`,lifecycle:`Lifecycle`,lifecycleDescription:`Installed source, version, trust, and removal controls.`,version:`Version`,installedSource:`Installed source`,integrity:`Integrity`,trustStatus:`Trust status`,setupRequiredDescription:`Complete the required configuration before enabling this plugin.`,additionalConfigurationRequired:`This plugin requires additional configuration`,uninstall:`Uninstall`,uninstallNamed:`Uninstall {name}`,uninstallDescription:`Remove this plugin package and its configured entries.`,managedCannotUninstall:`This plugin is managed by its installation source and cannot be uninstalled here.`,searchLabel:`Search plugins`,hubTablistLabel:`Plugins sections`,workshopTab:`Workshop`,backToSkills:`Back to Skills`,installedPluginsTitle:`Installed plugins`,featuredTitle:`Featured`,loadingFeatured:`Loading featured plugins…`,noFeaturedResults:`No featured plugins are available right now.`,exploreTitle:`Explore plugins`,loadingDiscovery:`Loading ClawHub plugins…`,loadMore:`Load more`,loadingMore:`Loading more…`,discoveryOffline:`Connect to browse plugins from ClawHub.`,noDiscoveryResults:`No plugins found`,noDiscoveryResultsHint:`Try a different search or choose another filter.`,searchClawHub:`Search ClawHub plugins`,searchPlugins:`Search plugins`,viewsLabel:`Catalog views`,intentAll:`All`,intentTrending:`Trending`,intentOfficial:`Official`,intentBundled:`Bundled`,loadingCategories:`Loading plugin categories…`,categoriesLabel:`Plugin categories`,categoriesTitle:`Categories`,allCategories:`All categories`,catalogPaginationLabel:`Plugin catalog pages`,previousPage:`Back`,nextPage:`Next`,pageNumber:`Page {page}`,downloadCount:`{count} downloads`,catalogPluginColumn:`Plugin`,catalogDownloadsColumn:`Downloads`,localPopularityUnavailable:`This plugin has not been published to ClawHub and does not have download metrics.`,detailBack:`Back to Explore plugins`,detailLoading:`Loading plugin details…`,detailSections:`Plugin details`,detailViewOnClawHub:`View on ClawHub`,detailUpdated:`Updated`,detailPublished:`Published`,detailRepository:`Repository`,detailDocumentation:`Documentation`,detailCategories:`Categories`,detailInstalledVersion:`Installed version`,detailSettings:`Settings`,detailEnable:`Enable`,detailDisable:`Disable`,detailTools:`Tools`,detailToolInputs:`Inputs`,detailType:`Type`,detailSecurity:`Security audit`,detailSecurityAudit:`View security audit`,detailNoReadme:`This plugin does not include a README.`,detailNoSkills:`This plugin does not declare any skills.`,detailNoConfiguration:`This plugin does not declare any configuration fields.`,detailNoCompatibility:`No compatibility requirements were published.`,detailNoVersions:`No release history is available.`,detailRequired:`Required`,detailOptional:`Optional`,detailSensitive:`Sensitive`,detailMinimumGateway:`Minimum Gateway version`,detailPluginApi:`Plugin API`,detailBuiltWith:`Built with OpenClaw`,detailSdkVersion:`Plugin SDK`,detailSourceCommit:`Source commit`,detailSourcePath:`Source path`,detailMcpServers:`MCP servers`,detailTabs:{readme:`README`,skills:`Skills`,configuration:`Configuration`,mcpServers:`MCP servers`,commands:`Commands`,hooks:`Hooks`,lspServers:`LSP servers`,compatibility:`Compatibility`,versions:`Versions`,access:`Access`,lifecycle:`Lifecycle`,advanced:`Advanced`},installCount:`{count} installs`,installed:`Installed`,installedDisabled:`Installed · Disabled`,pluginSettings:`Plugin settings`,setupRequired:`Setup required`,setupRequiredNotice:`Additional configuration required before this plugin can be enabled.`,searchInstalledPlaceholder:`Search installed plugins`,showAllPlugins:`Show all {count}`,viewAllInstalledPlugins:`View all`,hideInstalledPlugins:`Hide`,tryAgain:`Try again`,loading:`Loading plugins…`,noInstalledTitle:`No optional plugins installed`,noInstalledMatchTitle:`No installed plugins match`,categoryChannels:`Channels`,categoryModels:`Models`,categoryMemory:`Memory`,categoryContext:`Context`,categoryWeb:`Web`,categoryVoice:`Voice`,categoryMedia:`Media`,categoryProviders:`Model providers`,categoryTools:`Tools`,categoryRuntime:`Runtime`,categoryGateway:`Gateway`,categorySecurity:`Security`,categoryOther:`Other`,categoryUncategorized:`Uncategorized`,remove:`Remove`,removeConfirmTitle:`Remove {name}?`,removeConfirmMessage:`This removes the plugin package and all of its entries. Active work using this plugin finishes before removal.`,cancel:`Cancel`,reload:`Reload`,installSaved:`Installation of {name} was saved. {error}`,installSavedNotApplied:`Installation of {name} was saved, but the Gateway has not applied it. {error} Fix the reported problem, then run openclaw plugins reload {name}.`,runtimeFailurePhase:`Runtime phase: {phase}.`,enableAction:`Enable`,working:`Working…`,detailOrigin:`Source`,detailPackage:`Package`,detailPluginId:`Plugin ID`,offlineBody:`Connect to browse installed and recommended plugins.`,optionalCapability:`Optional OpenClaw capability.`,enabled:`Enabled`,disabled:`Disabled`,available:`Available`,needsAttention:`Needs attention`,included:`Included`,global:`Global`,workspace:`Workspace`,config:`Config`,official:`Official`,community:`Community`,verifiedSource:`Verified source`,codePlugin:`Code plugin`,bundlePlugin:`Bundle plugin`,unavailable:`Unavailable`,install:`Install`,retryInstall:`Retry install`,retryInstallNamed:`Retry install of {name}`,viewInstallStatusNamed:`View status of {name} installation`,installing:`Installing`,installNamed:`Install {name}`,connectToChange:`Connect to the gateway to change plugins.`,adminRequired:`Plugin changes require operator.admin access.`,changesDisabled:`This gateway does not allow plugin changes.`,configRefreshFailed:`Could not refresh Control UI configuration: {error}`,continueInstall:`Continue installation`,installAvailabilityChanged:`Plugin availability changed. Refresh the catalog to see its current state.`,installDestinationChanged:`The Gateway or operator changed. Install the plugin again to request a fresh review.`}},Gh=Object.assign(()=>{Object.assign(R.custodian,Wh.custodian),R.pluginsPage=Wh.pluginsPage},{catalog:Wh})})))()}function qh(e,t){let n=E(E(e)?.__openclaw);if(n?.truncated===!0&&n.reason===`oversized`)return B(`chat.messages.tooLargeToDisplay`);let r=t.content.flatMap(e=>e.type===`text`&&typeof e.text==`string`?e.text:[]).join(`
`);return t.role.toLowerCase()===`assistant`?Ac(r):r}function Jh(){return(Jh=e((()=>{U(),jc()})))()}function Yh(e,t){let n=!1;for(let e of t.content)if(e.type===`text`)n||=!!e.text?.trim();else if(e.type!==`thinking`&&!hn(e.type)&&!sn(e.type))return`non-text`;return n||Bc(e)?.trim()?`text`:`none`}function Xh(e){return rg.test(e)}function Zh(e){let t=E(e);if(!t||A(t.role)!==`assistant`)return!1;if(typeof t.text==`string`)return Xh(t.text);let n=Rc(e);return typeof n==`string`&&Xh(n)}function Qh(e){let t=E(e);if(!t||A(t.role)!==`toolresult`)return!1;let n=Rc(e);return typeof n==`string`&&n.trim()===ig}function $h(e){return Xh(e)||pf(e).shouldSkip}function eg(e){return Zh(e)||hf(e)}function tg(e){return!(eg(e)||Qh(e)||Kc(e))}function ng(e){return Array.isArray(e)?e.filter(tg):[]}var rg,ig;function ag(){return(ag=e((()=>{mn(),gf(),Yc(),rg=/^\s*NO_REPLY\s*$/,ig=`[openclaw] missing tool result in session history; inserted synthetic error result for transcript repair.`})))()}var og,sg;function cg(){return(cg=e((()=>{W(),og={chat:{codeBlock:{languageFallback:`Code`,hiddenLine:`1 hidden line`,hiddenLines:`{count} hidden lines`,showHiddenLine:`Show 1 hidden line`,showHiddenLines:`Show {count} hidden lines`,enableWrap:`Enable word wrap`,disableWrap:`Disable word wrap`,jsonView:`JSON view`,jsonTree:`Tree`,jsonRaw:`Raw`,jsonArrayItem:`Array ({count} item)`,jsonArrayItems:`Array ({count} items)`,jsonObjectKeys:`Object ({count} keys)`}}},sg=Object.assign(()=>Object.assign(R.chat.codeBlock,og.chat.codeBlock),{catalog:og})})))()}function lg(e){return B(ug[e])}var ug;function dg(){return(dg=e((()=>{U(),ug={manual:`sessionsView.archiveReasonManual`,"active-session-cap":`sessionsView.archiveReasonActiveSessionCap`,"age-retention":`sessionsView.archiveReasonAgeRetention`,"stale-dashboard":`sessionsView.archiveReasonStaleDashboard`,"restart-recovery":`sessionsView.archiveReasonRestartRecovery`}})))()}function fg(e){if(!e)return`ltr`;for(let t of e){if(mg.test(t))return`rtl`;if(hg.test(t))return`ltr`;if(!gg.test(t))return pg.test(t)?`rtl`:`ltr`}return`ltr`}var pg,mg,hg,gg;function _g(){return(_g=e((()=>{pg=/\p{Script=Hebrew}|\p{Script=Arabic}|\p{Script=Syriac}|\p{Script=Thaana}|\p{Script=Nko}|\p{Script=Samaritan}|\p{Script=Mandaic}|\p{Script=Adlam}|\p{Script=Phoenician}|\p{Script=Lydian}/u,mg=/[\u061C\u200F\u202B\u202E\u2067]/u,hg=/[\u200E\u202A\u202D\u2066]/u,gg=/[\s\p{P}\p{S}\p{Cf}]/u})))()}function vg(e){if(e.id===P.TUI)return`terminal`;if(e.mode===`webchat`||e.id===P.CONTROL_UI||e.id===P.BROWSER_COPILOT||e.id===P.WEBCHAT_UI||e.id===P.WEBCHAT)return`web`;if(e.id===P.CLI||e.mode===`cli`)return`cli`;if(e.mode===`ui`||e.id===P.MACOS_APP||e.id===P.LINUX_APP||e.id===P.IOS_APP||e.id===P.WATCHOS_APP||e.id===P.ANDROID_APP)return`app`}function yg(){return(yg=e((()=>{w()})))()}function bg(e){let t=e.map(e=>{let t=vg(e)??`rpc`,n=B(`chat.messages.sourceKinds.${t}`);return e.displayName&&e.displayName!==n?`${n} (${e.displayName})`:n});return B(`chat.messages.viaSource`,{source:[...new Set(t)].join(`, `)})}function xg(){return(xg=e((()=>{U(),as(),yg(),is()})))()}function Sg(e){let t=E(e)?.approvalReviews;return Array.isArray(t)?t.slice(-16).map(ea).filter(e=>e!==null):[]}function Cg(e,t,n){return{...E(e)??(e===void 0?{}:{toolDetails:e}),approvalReviews:[...t],...n?{approvalReviewOutcome:n}:{}}}function wg(e){let t=E(e)?.approvalReviewOutcome;return t===`approved`||t===`denied`||t===`reviewing`?t:void 0}function Tg(e,t=[]){return t.includes(`denied`)||e.some(e=>[`denied`,`timed_out`,`aborted`].includes(e.status))?`denied`:t.includes(`reviewing`)||e.some(e=>e.status===`in_progress`)?`reviewing`:t.includes(`approved`)||e.some(e=>e.status===`approved`)?`approved`:null}function Eg(){return(Eg=e((()=>{oa()})))()}function Dg(e){return typeof e.itemId==`string`&&e.itemId.trim().length>0}function Og(e){return e.boundaryMarker!==!0&&!Dg(e)}function kg(e,t){return t.trim()&&(e===null||t.startsWith(e))?t:e}function Ag(e,t){return!t||!e.startsWith(t)?e:e.slice(t.length).trimStart()}function jg(e,t=e=>e){let n=null;for(let r of e)Og(r)&&(n=kg(n,t(r.text)));return n}function Mg(){return(Mg=e((()=>{})))()}function Ng(e,t){let[n=``,...r]=e.trim().split(/\s+/u),i=Ig.get(n.toLowerCase()),a=Lg.get(r.at(-1)?.toLowerCase()??``);if(a&&r.pop(),n.toLowerCase()===`macintel`&&(t===`Mac`||t===`iPad`))return{label:[t===`Mac`?`macOS`:`iPadOS`,...r].join(` `),architecture:a};let o=n===n.toLowerCase()?`${n.charAt(0).toUpperCase()}${n.slice(1)}`:n;return{label:[i?`macOS`:Fg.get(n.toLowerCase())??o,...r].join(` `),architecture:i??a}}function Pg(e,t){let{label:n,architecture:r}=Ng(e,t);return r?`${n} (${r})`:n}var Fg,Ig,Lg;function Rg(){return(Rg=e((()=>{Fg=new Map([[`macos`,`macOS`],[`darwin`,`macOS`],[`win32`,`Windows`],[`win64`,`Windows`],[`windows`,`Windows`],[`linux`,`Linux`],[`freebsd`,`FreeBSD`],[`openbsd`,`OpenBSD`],[`netbsd`,`NetBSD`],[`ios`,`iOS`],[`ipados`,`iPadOS`],[`watchos`,`watchOS`],[`android`,`Android`],[`web`,`Web`]]),Ig=new Map([[`macarm`,`ARM`],[`macarm64`,`ARM`],[`arm64-apple-darwin`,`ARM`],[`aarch64-apple-darwin`,`ARM`],[`x86_64-apple-darwin`,`Intel`]]),Lg=new Map([[`arm`,`ARM`],[`arm64`,`ARM`],[`aarch64`,`ARM`],[`armv7l`,`ARM`],[`armv8l`,`ARM`],[`x64`,`x64`],[`x86_64`,`x64`],[`amd64`,`x64`],[`x86`,`x86`],[`i386`,`x86`],[`i686`,`x86`]])})))()}function zg(e){return e.replace(/^\/(?:Users|home)\/[^/]+(\/|$)/,`~$1`).replace(/^[A-Za-z]:\\Users\\[^\\]+(\\|$)/i,`~$1`)}function Bg(e){let t=Ur(e.name),n=A(t),r=Qg[n],i=Xg[(r??Zg).emoji??``]??`puzzle`,a=r?.title??Dr(t),o=r?.label??a,s=kr({toolKey:n,args:e.args,meta:e.meta,spec:r,fallbackDetailKeys:Zg.detailKeys,detailMode:`first`,toolDetailMode:e.detailMode,detailCoerce:{includeFalsy:!0}}),{verb:c}=s,{detail:l}=s;return l&&=zg(l),{name:t,icon:i,title:a,label:o,verb:c,detail:l}}function Vg(e){return e.detail?`with ${e.detail}`:void 0}function Hg(e){return e===Jg||e.startsWith(`${Jg}/`)||e===qg||e.startsWith(`${qg}/`)}function Ug(e,t=!1){try{let n=new URL(e,`http://localhost`);return n.origin===`http://localhost`?Hg(n.pathname)?`${n.pathname}${n.search}${n.hash}`:void 0:!t||!wr(n)?void 0:n.toString()}catch{return}}function Wg(e){let t=e?.trim();return!!(t&&Ug(t,!1))}function Gg(e,t,n=!1){let r=e?.trim();if(!r)return;let i=Ug(r,n);if(i){if(!t?.trim())return i;try{let e=new URL(t),n=e.pathname.replace(/\/+$/,``);if(!n.startsWith(Yg))return i;let r=new URL(i,e.origin);return Hg(r.pathname)?(r.protocol=e.protocol,r.username=e.username,r.password=e.password,r.host=e.host,r.pathname=`${n}${r.pathname}`,r.toString()):i}catch{return i}}}function Kg(e,t){if(t===`strict`||t===`scripts`&&e===`strict`)return``;if(t===`scripts`)return`allow-scripts`;switch(e){case`strict`:return``;case`trusted`:return`allow-scripts allow-same-origin`;default:return`allow-scripts`}}var qg,Jg,Yg,Xg,Zg,Qg;function $g(){return($g=e((()=>{Er(),mi(),Br(),qg=`/__openclaw__/a2ui`,Jg=`/__openclaw__/canvas`,Yg=`/__openclaw__/cap`,Xg={"🧩":`puzzle`,"🛠️":`wrench`,"🧰":`wrench`,"📖":`fileText`,"✍️":`edit`,"📝":`penLine`,"📎":`paperclip`,"🌐":`globe`,"📺":`monitor`,"🧾":`fileText`,"🔐":`settings`,"💻":`monitor`,"🔌":`plug`,"💬":`messageSquare`},Zg=gi.fallback,Qg=gi.tools})))()}function e_(){if(o_||a_>=2||i_.size===0)return;o_=!0;let e=()=>{o_=!1;for(let e of i_){if(a_>=2)break;i_.delete(e),e()}};typeof requestIdleCallback==`function`?requestIdleCallback(e,{timeout:500}):setTimeout(e,0)}function t_(e,t,n){let r=new AbortController,{signal:i}=r,a=new Promise(a=>{let o=()=>{i_.delete(u)},s=!1,c=e=>{s||(s=!0,r.abort(),o(),a(e))},l=()=>c(null);i.addEventListener(`abort`,l,{once:!0});let u=()=>{a_+=1;let r=document.createElement(`video`),a=document.createElement(`canvas`),u,d=setTimeout(l,2e3);o=()=>{clearTimeout(d),u!==void 0&&r.cancelVideoFrameCallback(u),r.removeAttribute(`src`),r.load(),a.width=a.height=0,--a_,e_()};let f={once:!0,signal:i},p=(e,t)=>{let n=2,i=()=>{!s&&--n===0&&t()};r.addEventListener(e,i,f),u=r.requestVideoFrameCallback(i)},m=()=>{try{a.width=t,a.height=n;let e=a.getContext(`2d`);if(!e)return l();let i=Math.max(t/r.videoWidth,n/r.videoHeight),o=r.videoWidth*i,s=r.videoHeight*i;e.drawImage(r,(t-o)/2,(n-s)/2,o,s),a.toBlob(c,`image/jpeg`,.8)}catch{l()}};if(r.preload=`metadata`,r.muted=!0,r.playsInline=!0,r.crossOrigin=`anonymous`,r.addEventListener(`error`,l,f),r.addEventListener(`loadedmetadata`,()=>{(!Number.isFinite(r.duration)||r.duration<=0||r.videoWidth*r.videoHeight>16777216)&&l()},f),typeof r.requestVideoFrameCallback!=`function`)return l();p(`loadedmetadata`,()=>{p(`seeked`,m),r.currentTime=Math.min(.1,r.duration/10)}),r.src=e,r.load()};i_.add(u),e_()});return{controller:r,owners:new Set,promise:a}}function n_(e){let{key:t,src:n,width:r,height:i,signal:a}=e;if(a.aborted||![r,i].every(e=>Number.isInteger(e)&&e>0&&e<=512))return Promise.resolve(null);let o=r_.get(t)??t_(n,r,i);return r_.set(t,o),o.owners.has(a)||(o.owners.add(a),a.addEventListener(`abort`,()=>{o.owners.delete(a),o.owners.size===0&&(r_.delete(t),o.controller.abort())},{once:!0})),o.promise.then(e=>a.aborted?null:e)}var r_,i_,a_,o_;function s_(){return(s_=e((()=>{r_=new Map,i_=new Set,a_=0,o_=!1})))()}var c_,l_;function u_(){return(u_=e((()=>{W(),c_={browser:{unavailable:`Browser control is unavailable for this connection. Reconnect with browser access.`,navigationBlocked:`The current browser navigation rules block this address. Select another tab or enter an allowed address.`,navigationCheckFailed:`OpenClaw couldn’t verify this tab’s address. Refresh to try again.`,tabUnavailable:`This tab is no longer available. Select another tab.`,noChatTarget:`Open a chat session first so the annotation has somewhere to go.`,annotationLimitReached:`Remove a browser annotation before retrying (maximum 4 cards and 8,000 characters of generated context).`,inspectUnavailable:`Element inspection is disabled (browser.evaluateEnabled=false).`,annotationSent:`Annotation added to the chat composer.`,dashboardSessionShared:`You and your agent share this isolated session browser`,dashboardShared:`You and your agent share this browser page`,dashboardStopped:`This dashboard's browser is stopped.`,dashboardStopping:`Browser stop is pending. Retry to finish closing its tab.`,dashboardStop:`Stop browser`,dashboardRetryStop:`Retry stop`,dashboardResume:`Resume browser`,dashboardReconnect:`Reconnect`,dashboardUnavailable:`Connect to a Gateway with browser access to use this dashboard.`,dashboardMissingIdentity:`Save this dashboard widget again before opening its browser.`,dashboardInvalidReply:`The browser response does not match this dashboard. Reconnect and try again.`,downloading:`Downloading…`,downloadFile:`Download file`,inputLabel:`Browser input: click a field in the page, then type or paste`,manualTextCorrection:`Autocorrect is unavailable in browser control. Edit the text directly.`,errors:{pasteFailed:`Could not paste. Reconnect to a managed browser and try again.`,requestFailed:`Browser request failed: {error}`,downloadFailed:`Could not download this file: {error}. Try again, or open it in your browser to save it.`,downloadEmpty:`No file returned.`,screenshotPathMissing:`Browser screenshot did not return a media path.`,screenshotFetchTimedOut:`Screenshot fetch timed out.`,screenshotFetchFailed:`Screenshot fetch failed ({status}).`,screenshotReadFailed:`Screenshot read failed.`,screenshotDecodeFailed:`Screenshot decode failed.`,canvasUnavailable:`Canvas 2D context unavailable.`},annotatePrompt:{browserTarget:`Browser target: {target}`,introTitled:`I annotated the page at {url} (page-reported title: "{title}") — the attached screenshot shows my markup.`,introUntitled:`I annotated the page at {url} — the attached screenshot shows my markup.`,region:`Marked region {index}: centered around {x}% across / {y}% down, spanning about {width}% × {height}% of the view.`,moreRegions:`…plus {count} more marked region(s), all visible in the screenshot.`,elementDetail:`Marked element (page-reported): {descriptor} — {width}×{height}px at ({x}, {y}).`,outro:`Please look at the marked area and tell me what you make of it.`}}},l_=Object.assign(()=>{let{errors:e,annotatePrompt:t,...n}=c_.browser;Object.assign(R.browser,n),Object.assign(R.browser.errors,e),Object.assign(R.browser.annotatePrompt,t)},{catalog:c_})})))()}function d_(e){return e.callId??e.messageId??e.previewRevision}function f_(e,t){let n=m_.get(e);if(n?.toolMessages===t)return n.latest;let r=new Map;for(let n of[e,t])for(let e of n)if(h(e))for(let t of Tu(e)){let e=d_(t);if(t.browserTab&&e&&fu(t,!1)===`succeeded`){let n=Pi(t.browserTab);r.delete(n),r.set(n,{tab:t.browserTab,revision:e})}}return m_.set(e,{toolMessages:t,latest:r}),r}function p_(e){let t=Pi(e.tab),n=h_.get(e.client);n||(n={tabs:new Map,images:new Map},h_.set(e.client,n));let{tabs:r,images:i}=n,a=r.get(t);if(a||(a={revisions:new Set},r.set(t,a)),a.revisions.has(e.revision))return a.pending??Promise.resolve(i.get(t));a.revisions.add(e.revision);let o=(a.pending??Promise.resolve()).then(async()=>{try{let n=await Fi(Ii(e.client,e.tab),e.tab.targetId),r=await Oi({resourceBasePath:e.resourceBasePath,authToken:e.authToken,path:n.path});if(i.delete(t),i.set(t,r),i.size>g_){let e=i.keys().next().value;e!==void 0&&i.delete(e)}return r}catch{i.delete(t);return}finally{a.pending===o&&(a.pending=void 0)}});return a.pending=o,o}var m_,h_,g_;function __(){return(__=e((()=>{Ri(),Hi(),ju(),m_=new WeakMap,h_=new WeakMap,g_=32})))()}function v_(e){let t=0,n=0;for(let r of e)r.kind===`add`?t+=1:r.kind===`del`&&(n+=1);return{added:t,removed:n}}function y_(e){if(!e.trim())return null;let t=[],n=!1;for(let r of e.split(`
`)){if(!r)continue;if(/^\s*\.\.\.\(truncated\)\.\.\.\s*$/.test(r)){n=!0,t.push({kind:`skip`,text:``});continue}if(/^\s*\.\.\.\s*$/.test(r)){t.push({kind:`skip`,text:``});continue}let e=r.match(/^([+\- ])\s*(\d+) ?(.*)$/s);if(!e)return null;let[,i,a,o]=e;if(!i||!a)return null;if(t.push({kind:i===`+`?`add`:i===`-`?`del`:`ctx`,lineNo:Number.parseInt(a,10),text:o??``}),t.length>400){t.push({kind:`skip`,text:``}),n=!0;break}}return t.some(e=>e.kind===`add`||e.kind===`del`)?n?{kind:`truncated`,lines:t}:{kind:`complete`,lines:t,stat:v_(t)}:null}function b_(e){let t=e.replace(/\r\n/g,`
`).replace(/\r/g,`
`);if(t===``)return[];let n=t.split(`
`);return n.length>1&&n[n.length-1]===``&&n.pop(),n}function x_(e,t,n){if(!n&&e.length<=400&&!t)return e;if(!e.some(e=>e.kind===`add`||e.kind===`del`))return n&&!t?[]:t?[{kind:`skip`,text:``}]:[...e.slice(0,400),{kind:`skip`,text:``}];let r=new Uint8Array(e.length);for(let t=0;t<e.length;t++){let n=e[t];if(!n||n.kind!==`add`&&n.kind!==`del`)continue;let i=Math.max(0,t-3),a=Math.min(e.length,t+4);r.fill(1,i,a)}let i=[],a=!1,o=t;for(let t=0;t<e.length;t++){if(r[t]===0){a=!0,o=!0;continue}if(a&&i.at(-1)?.kind!==`skip`&&i.push({kind:`skip`,text:``}),a=!1,i.length>=400){o=!0;break}let n=e[t];n&&i.push(n)}return o&&i.at(-1)?.kind!==`skip`&&i.push({kind:`skip`,text:``}),i}function S_(e,t,n){let r=b_(e),i=b_(t),a=r.length>T_||i.length>T_,o=r.length===i.length&&r.every((e,t)=>e===i[t]),s=a&&!o,c=[],l=0;for(;l<Math.min(r.length,i.length,T_)&&r[l]===i[l];)c.push({kind:`ctx`,text:r[l]}),l++;let u=r.slice(l,T_),d=i.slice(l,T_),f=d.length+1,p=new Uint16Array((u.length+1)*f);for(let e=u.length-1;e>=0;e--)for(let t=d.length-1;t>=0;t--){let n=e*f+t;p[n]=u[e]===d[t]?(p[n+f+1]??0)+1:Math.max(p[n+f]??0,p[n+1]??0)}for(let e=0,t=0;e<u.length||t<d.length;){let n=u[e],r=d[t];n!==void 0&&n===r?(c.push({kind:`ctx`,text:n}),e++,t++):n!==void 0&&(r===void 0||(p[(e+1)*f+t]??0)>=(p[e*f+t+1]??0))?(c.push({kind:`del`,text:n}),e++):r!==void 0&&(c.push({kind:`add`,text:r}),t++)}let m=x_(c,s,n?.compactUnchanged===!0);return s?{kind:`truncated`,lines:m}:{kind:`complete`,lines:m,stat:v_(c)}}function C_(e,t=80){let n=b_(e),r=[];for(let[e,i]of n.slice(0,t).entries())r.push({kind:`add`,lineNo:e+1,text:i});return n.length>t&&r.push({kind:`skip`,text:``}),r}function w_(e,t){let n=t?.maxLines??400,r=[],i=t?.truncated===!0||e.some(e=>e.kind===`truncated`),a=i;for(let t of e){if(t.lines.length===0)continue;if(r.length>0){if(r.length>=n){a=!0;break}r.push({kind:`skip`,text:``})}let e=n-r.length;if(t.lines.length>e){r.push(...t.lines.slice(0,e)),a=!0;break}r.push(...t.lines)}return a&&r.at(-1)?.kind!==`skip`&&r.push({kind:`skip`,text:``}),i?{kind:`truncated`,lines:r}:{kind:`complete`,lines:r,stat:e.reduce((e,t)=>({added:e.added+(t.kind===`complete`?t.stat.added:0),removed:e.removed+(t.kind===`complete`?t.stat.removed:0)}),{added:0,removed:0})}}var T_;function E_(){return(E_=e((()=>{T_=600})))()}function D_(e,t,n){let r=n.trim(),i={operation:t,sourcePath:r,path:r,lines:[],stat:{added:0,removed:0}};return e.sections.push(i),i}function O_(e,t,n){n.kind===`add`?t.stat.added+=1:n.kind===`del`&&(t.stat.removed+=1),e.storedRows<400?(t.lines.push(n),e.storedRows+=1):e.truncated=!0}function k_(e,t){t.lines.length!==0&&t.lines.at(-1)?.kind!==`skip`&&O_(e,t,{kind:`skip`,text:``})}function A_(e){let t=e.match(/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/);return t?{oldLine:Number.parseInt(t[1]??``,10),oldLeft:t[2]===void 0?1:Number.parseInt(t[2],10),newLine:Number.parseInt(t[3]??``,10),newLeft:t[4]===void 0?1:Number.parseInt(t[4],10)}:{}}function j_(e,t,n,r){let i,a;n.startsWith(`+`)?(i=`add`,a=r.newLine,r.newLine!==void 0&&(r.newLine+=1,r.newLeft=Math.max(0,(r.newLeft??0)-1))):n.startsWith(`-`)?(i=`del`,a=r.oldLine,r.oldLine!==void 0&&(r.oldLine+=1,r.oldLeft=Math.max(0,(r.oldLeft??0)-1))):(i=`ctx`,a=r.newLine,r.oldLine!==void 0&&r.newLine!==void 0&&(r.oldLine+=1,r.newLine+=1,r.oldLeft=Math.max(0,(r.oldLeft??0)-1),r.newLeft=Math.max(0,(r.newLeft??0)-1))),O_(e,t,{kind:i,...a===void 0?{}:{lineNo:a},text:n===``?``:n.slice(1)})}function M_(e){return e.oldLeft!==void 0&&e.oldLeft===0&&e.newLeft===0}function N_(e){return e.operation===`update`&&e.path!==e.sourcePath?`Move ${e.sourcePath} → ${e.path}`:`${e.operation===`add`?`Add`:e.operation===`delete`?`Delete`:`Update`} ${e.path}`}function P_(e){if(e.sections.length===0)return null;let t=[...new Set(e.sections.map(e=>e.path).filter(Boolean))],n=e.sections.map(({operation:e,path:t,sourcePath:n})=>({operation:e,path:t,...e===`update`&&n!==t?{oldPath:n}:{}})),r=e.sections.reduce((e,t)=>({added:e.added+t.stat.added,removed:e.removed+t.stat.removed}),{added:0,removed:0}),i=[],a=e.truncated,o=e=>{i.length<400?i.push(e):a=!0};for(let[t,r]of e.sections.entries()){e.sections.length>1&&(i.length>0&&i.at(-1)?.kind!==`skip`&&o({kind:`skip`,text:``}),o({kind:`file`,path:r.path,...`oldPath`in n[t]?{oldPath:r.sourcePath}:{},text:N_(r)}));for(let e of r.lines)o(e)}a&&i.at(-1)?.kind!==`skip`&&i.push({kind:`skip`,text:``});let s=e.sections.length===1?e.sections.at(0):void 0,c=s&&s.operation===`update`&&s.sourcePath!==s.path?{from:s.sourcePath,to:s.path}:void 0;return{paths:t,fileOperations:n,lines:i,stat:r,...c?{move:c}:{}}}function F_(e){let t={sections:[],storedRows:0,truncated:!1},n=null,r=`outside`,i=null;for(let a of b_(e)){let e=r===`update`?a.trimEnd():a.trim(),o=e.match(/^\*\*\* (Update|Add|Delete) File: (.+)$/);if(o){let e=o[1],a=o[2];if(!e||!a)continue;r=e.toLowerCase(),n=D_(t,r,a),i=null;continue}let s=r===`update`?e.match(/^\*\*\* Move to: (.+)$/):null;if(s&&n){n.path=s[1]?.trim()??n.path;continue}if(!(e===`*** Begin Patch`||e===`*** End Patch`||e===`*** End of File`||e.startsWith(`*** Environment ID:`))&&n){if(r===`update`&&a.startsWith(`@@`)){k_(t,n),i=A_(a);continue}r===`add`&&a.startsWith(`+`)?O_(t,n,{kind:`add`,lineNo:n.stat.added+1,text:a.slice(1)}):r===`update`&&(a===``||a.startsWith(`+`)||a.startsWith(`-`)||a.startsWith(` `))&&(j_(t,n,a,i??{}),i&&M_(i)&&(i=null))}}return P_(t)}function I_(e){return(e.split(` `,1)[0]?.trim()??``).replace(/^[ab]\//,``)}function L_(e,t,n,r,i){let a=I_(n.slice(4)),o=I_(r.slice(4)),s=a===`/dev/null`?`add`:o===`/dev/null`?`delete`:`update`,c=o===`/dev/null`?a:o,l=i&&t?t:D_(e,s,c);return l.operation=s,l.sourcePath=a||l.sourcePath,l.path=c||l.path,l}function R_(e){let t={sections:[],storedRows:0,truncated:!1},n=b_(e),r=null,i=null,a=!1;for(let e=0;e<n.length;e++){let o=n[e];if(o===void 0)continue;let s=o.match(/^diff --git a\/(.+) b\/(.+)$/);if(s){let e=s[1],n=s[2];if(!e||!n)continue;r=D_(t,`update`,n),r.sourcePath=e,i=null,a=!0;continue}let c=n[e+1];if(!i&&o.startsWith(`--- `)&&c?.startsWith(`+++ `)){r=L_(t,r,o,c,a),a=!1,e+=1;continue}if(o.startsWith(`@@`)){r&&k_(t,r),i=A_(o),a=!1;continue}/^index |^new file mode |^deleted file mode |^similarity index /.test(o)||r&&i&&(o.startsWith(`+`)||o.startsWith(`-`)||o.startsWith(` `))&&(j_(t,r,o,i),M_(i)&&(i=null))}return P_(t)}function z_(e){let t=typeof e==`string`?e:E(e)?.type;return t===`add`||t===`delete`?t:`update`}function B_(e){let t=E(e),n=t?.added,r=t?.removed;return typeof n==`number`&&typeof r==`number`&&n>=0&&r>=0?{added:Math.trunc(n),removed:Math.trunc(r)}:null}function V_(e,t,n){let r=null;for(let i of b_(n))i.startsWith(`@@`)?(k_(e,t),r=A_(i)):r&&(i.startsWith(`+`)||i.startsWith(`-`)||i.startsWith(` `))&&(j_(e,t,i,r),M_(r)&&(r=null))}function H_(e){let t={sections:[],storedRows:0,truncated:!1};for(let n of e){let e=E(n),r=j(e?.path)?.trim();if(!e||!r)continue;let i=z_(e.kind),a=D_(t,i,r),o=j(E(e.kind)?.move_path??E(e.kind)?.movePath);if(o&&(a.path=o.trim()),typeof e.diff==`string`){if(i===`update`)V_(t,a,e.diff);else{let n=i===`add`?`add`:`del`;for(let[r,i]of b_(e.diff).entries())O_(t,a,{kind:n,lineNo:r+1,text:i})}}let s=B_(e.stat);s&&(a.stat=s),t.truncated||=e.diffTruncated===!0}return P_(t)}function U_(e){let t=E(e);if(!t)return null;if(Array.isArray(t.changes)){let e=H_(t.changes);if(e)return e}let n=j(t.patch)??j(t.input)??j(t.diff);return n?/(?:^|\n)\s*\*\*\* (?:Begin Patch|Update File:|Add File:|Delete File:)/.test(n)?F_(n):R_(n):null}function W_(){return(W_=e((()=>{E_()})))()}function G_(e){return j(e?.path)??j(e?.file_path)??j(e?.filePath)??j(e?.file)??j(e?.filepath)??j(e?.filename)??j(e?.notebook_path)}function K_(e){let t=e.replace(/\\/g,`/`).replace(/\/+$/,``),n=t.lastIndexOf(`/`);return n<=0?{base:t||e}:{base:t.slice(n+1),dir:t.slice(0,n)}}function q_(e){let t=[],n=0,r=!1,i=Array.isArray(e.edits)?e.edits:[e];for(let[e,a]of i.entries()){if(e>=uv){r=!0;break}let i=E(a);if(!i)continue;let o=i.oldText??i.old_string??i.oldString??i.old_str,s=i.newText??i.new_string??i.newString??i.new_str;if(typeof o==`string`&&typeof s==`string`){let e=o.length+s.length;if(n+e>dv){r=!0;break}n+=e,t.push({oldText:o,newText:s})}}return{pairs:t,truncated:r}}function J_(e){let t=E(e),n=j(t?.diff);if(!n)return null;let r=y_(n);return r?{diff:r.lines,...r.kind===`complete`?{stat:r.stat}:{}}:null}function Y_(e){if(!e)return null;let{pairs:t,truncated:n}=q_(e);if(t.length===0)return n?{diff:[{kind:`skip`,text:``}]}:null;let r=w_(t.map(e=>S_(e.oldText,e.newText)),{truncated:n});return r.lines.length===0?null:{diff:r.lines,...r.kind===`complete`?{stat:r.stat}:{}}}function X_(e){let t=j(e?.insert_text);if(!t)return null;let n=S_(``,t).lines;return n.length>0?{diff:n}:null}function Z_(e){let t=U_(e);if(!t)return null;let n={kind:`edit`,fileOperations:t.fileOperations,diff:t.lines,stat:t.stat};if(t.paths.length>1)return{...n,target:`${t.paths.length} files`};if(t.move){let e=K_(t.move.from),r=K_(t.move.to),i=e.dir===r.dir?e.dir:void 0;return{...n,target:i?`${e.base} → ${r.base}`:`${t.move.from} → ${t.move.to}`,targetDetail:i}}let r=t.paths[0]?K_(t.paths[0]):null;return{...n,target:r?.base,targetDetail:r?.dir}}function Q_(e,t,n){if(av.has(e))switch(n){case`view`:return`read`;case`str_replace`:case`insert`:case`undo_edit`:return`edit`;case`create`:return`write`;default:return`generic`}return nv.has(e)?`command`:rv.has(e)?`read`:iv.has(e)||lv.has(e)?`edit`:ov.has(e)?`write`:sv.has(e)?`search`:cv.has(e)?`fetch`:t&&typeof t.command==`string`&&Object.keys(t).length<=3?`command`:`generic`}function $_(e){let t=E(e.args),n=t??E(e.details),r=e.name.trim().toLowerCase();if(n){let t=fv.get(n);if(t&&t.details===e.details&&t.name===r)return t.view}let i=tv(e,t,r);return n&&fv.set(n,{details:e.details,name:r,view:i}),i}function ev(e){return e.match(/^\s*(?:\/(?:usr\/)?bin\/)?(?:ba|z|da)?sh\s+-l?c\s+(['"])([\s\S]+)\1\s*$/)?.[2]??e}function tv(e,t,n){let r=av.has(n)?j(t?.command)?.trim().toLowerCase():void 0,i=Q_(n,t,r);if(i===`command`){let e=t?j(t.command):void 0;return{kind:i,title:nv.has(n)?jr(t):void 0,command:e&&ev(e),code:Kr(t)}}if(i===`edit`&&lv.has(n))return Z_(t)??{kind:`generic`};if(i===`read`||i===`edit`||i===`write`){let n=G_(t);if(!n)return{kind:`generic`};let{base:a,dir:o}=K_(n),s={kind:i,target:a,targetDetail:o};if(i===`read`)return s;let c=J_(e.details);if(c)return{...s,...c};if(i===`edit`){let e=r===`insert`?X_(t):r===`undo_edit`?null:Y_(t);return{...s,...e}}let l=E(e.details);if(l?.changed===!1)return s;let u=t?j(r===`create`?t.file_text:t.content):void 0;if(!u)return s;let d=C_(u);return{...s,diff:d,...l&&l.created!==!0?{}:{stat:{added:b_(u).length,removed:0}}}}if(i===`search`){let e=t?j(t.pattern)??j(t.query)??j(t.glob):void 0,n=G_(t);return!e&&!n?{kind:`generic`}:{kind:i,target:e??n,targetDetail:e?n:void 0}}if(i===`fetch`){let e=t?j(t.url):void 0;return e?{kind:i,target:e}:{kind:`generic`}}return{kind:`generic`}}var nv,rv,iv,av,ov,sv,cv,lv,uv,dv,fv;function pv(){return(pv=e((()=>{Ir(),E_(),W_(),nv=new Set([`bash`,`exec`,`shell`,`run_command`,`run_terminal_cmd`]),rv=new Set([`read`,`read_file`,`readfile`,`notebookread`,`notebook_read`]),iv=new Set([`edit`,`edit_file`,`multiedit`,`multi_edit`,`notebookedit`,`notebook_edit`]),av=new Set([`str_replace_editor`,`str_replace_based_edit_tool`]),ov=new Set([`write`,`write_file`,`create_file`]),sv=new Set([`grep`,`find`,`glob`,`ls`,`list`,`codebase_search`]),cv=new Set([`web_fetch`,`webfetch`,`fetch`]),lv=new Set([`apply_patch`,`applypatch`,`patch`]),uv=8,dv=12e4,fv=new WeakMap})))()}function mv(e){return!e.outputTruncated&&(e.toolOutput?.captureTruncated===!0||!e.toolOutput&&/\n\.\.\.\(OpenClaw truncated Codex native tool output: original \d+ chars, showing \d+; rerun with narrower args\.\)\s*$/u.test(e.outputText??``))}function hv(e){return B(e.toolOutput?.source===`provider-response`?`chat.toolCards.providerResponse`:e.toolOutput?.source===`execution`?`chat.toolCards.executionOutput`:`chat.toolCards.toolOutput`)}function gv(e){let t=S(e),n=h(t)&&typeof t.wall_time_seconds==`number`&&typeof t.exit_code==`number`&&typeof t.output==`string`&&Object.keys(t).every(e=>[`chunk_id`,`wall_time_seconds`,`exit_code`,`original_token_count`,`output`].includes(e))?{text:t.output,exitCode:t.exit_code}:void 0,r=n?.text??e,i=Ni(r)?.root?bi(r,hi(r,void 0,{insertSpaces:!0,tabSize:2})):r;return n&&n.exitCode!==0?`${B(`chat.toolCards.exitCode`,{code:String(n.exitCode)})}\n${i}`:i}function _v(e){let t=e.outputText;if(t===void 0||e.preview||e.toolOutput?.source!==`provider-response`||e.name!==`exec`||!h(e.args)||typeof e.args.input!=`string`)return t;let n=S(t);return!Array.isArray(n)||n.length===0||!n.every(e=>h(e)&&e.type===`input_text`&&typeof e.text==`string`)?t:n.filter((e,t)=>t!==0||n.length===1||!/^Script completed\nWall time [\d.]+ seconds\nOutput:\n$/u.test(e.text)).map(e=>gv(e.text)).join(`
`)}var vv;function yv(){return(yv=e((()=>{pe(),_i(),Mi(),U(),vv=8e3})))()}var bv;function xv(){return(xv=e((()=>{H(),bv=class{constructor(){this.entries=new Map}clear(){this.entries.clear()}prune(e){let t=new Set(e.filter(e=>e.contentKind===`mcp-app`).map(e=>this.key(e)));for(let e of this.entries.keys())t.has(e)||this.entries.delete(e)}async resolve(e,t,n){let r=this.key(e);n&&this.entries.delete(r);let i=this.entries.get(r);if(i)return await i;let a=t().then(e=>({status:`ready`,...e})).catch(e=>({status:`stale`,error:I(e)}));return this.entries.set(r,a),await a}key(e){return`${e.name}\0${e.revision}\0${e.instanceId??``}\0${e.grantState}`}}})))()}function Sv(e){return{sessionKey:e,revision:0,tabs:[],widgets:[]}}function Cv(e){let t=e?.trim()??``;return t?Cr(t,80):void 0}function wv(){return(wv=e((()=>{})))()}var Tv,Ev;function Dv(){return(Dv=e((()=>{Tv=class{constructor(e){this.value=e,this.listeners=new Set}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}set(e){this.value=e;for(let e of this.listeners)e()}},Ev=class{constructor(){this.listeners=new Set}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}emit(e){for(let t of this.listeners)t(e)}}})))()}function Ov(e){let t=14695981039346656037n;for(let n of new TextEncoder().encode(e))t^=BigInt(n),t=BigInt.asUintN(64,t*1099511628211n);return t.toString(16).padStart(16,`0`)}function kv(e){let t=`canvas-${e.toLowerCase().replace(/[^a-z0-9._-]/gu,`-`)}`;return t===`canvas-${e}`&&t.length<=64?t:`${t.slice(0,47).replace(/[._-]+$/gu,``)||`canvas-widget`}-${Ov(e)}`}function Av(e){return`mcp-app-${Ov(e)}`}function jv(){return(jv=e((()=>{})))()}function Mv(e,t=Date.now()){e.viewTicket&&e.viewTicketTtlMs&&Fv.set(e,t)}function Nv(e,t,n=Date.now()){Mv(e,Fv.get(t)??n)}function Pv(e,t=Date.now()){let n=e.viewTicketTtlMs;if(!e.viewTicket||!n)return;let r=Fv.get(e);return r===void 0?n:Math.max(0,n-(t-r))}var Fv;function Iv(){return(Iv=e((()=>{Fv=new WeakMap})))()}function Lv(e,t){return{...e,...t.frameUrl===void 0?{}:{frameUrl:t.frameUrl},...t.viewTicket===void 0?{}:{viewTicket:t.viewTicket},...t.viewTicketTtlMs===void 0?{}:{viewTicketTtlMs:t.viewTicketTtlMs},...t.viewGeneration===void 0?{}:{viewGeneration:t.viewGeneration},...t.sandboxUrl===void 0?{}:{sandboxUrl:t.sandboxUrl},...t.sandboxPort===void 0?{}:{sandboxPort:t.sandboxPort},...t.sandboxOrigin===void 0?{}:{sandboxOrigin:t.sandboxOrigin}}}var Rv;function zv(){return(zv=e((()=>{u(),H(),V(),xv(),wv(),Dv(),Iv(),Rv=class{constructor(e,t,n=!0,r=!0,i=!1,a=!0,o=!0){this.session=e,this.canPinWidgets=r,this.canPinMcpApps=i,this.canMutate=a,this.canGrant=o,this.loadErrorSignal=new Tv(null),this.eventStream=new Ev,this.retiredClients=new WeakSet,this.clientGeneration=0,this.refreshRequested=!1,this.userRefreshRequested=!1,this.changedWidgets=new Set,this.stateGeneration=0,this.connected=!1,this.appViews=new bv,this.disposed=!1,this.snapshotLoaded=!1,this.snapshotSignal=new Tv(Sv(this.sessionKey)),this.snapshot$=this.snapshotSignal,this.loadError$=this.loadErrorSignal,this.events=this.eventStream,this.client=t,this.connected=n,this.subscribe(t),n&&this.activate()}get sessionKey(){return this.session.sessionKey}attachClient(e,t=!0){if(this.disposed||e!==this.client&&this.retiredClients.has(e))return;let n=t!==this.connected,r=t&&!this.connected;if(this.connected=t,t||this.wakeRetryDelay?.(),e===this.client){n&&(this.clientGeneration+=1,this.stateGeneration+=1,this.appViews.clear(),this.publishAppViewGeneration()),r&&this.activate();return}this.retiredClients.add(this.client),this.unsubscribe?.(),this.client=e,this.clientGeneration+=1,this.stateGeneration+=1,this.changedWidgets.clear(),this.appViews.clear(),this.snapshotLoaded=!1,this.setLoadError(null),this.snapshotSignal.set(Sv(this.sessionKey)),this.subscribe(e),t&&this.activate()}activate(){return this.requestRefresh()}get hasLoadedSnapshot(){return this.snapshotLoaded}get appViewGeneration(){return this.clientGeneration}dispose(){this.disposed||(this.disposed=!0,this.connected=!1,this.unsubscribe?.(),this.unsubscribe=void 0,this.clientGeneration+=1,this.stateGeneration+=1,this.refreshRequested=!1,this.userRefreshRequested=!1,this.changedWidgets.clear(),this.appViews.clear(),this.wakeRetryDelay?.())}async applyOps(e){await this.mutate(`board.update`,{...this.session,ops:e})}async grant(e,t){let n=this.snapshotSignal.value.widgets.find(t=>t.name===e);if(!n)throw this.requestRefresh(),Error(`Dashboard widget not found: ${e}`);await this.mutate(`board.widget.grant`,{...this.session,name:e,decision:t,revision:n.revision,...n.instanceId?{instanceId:n.instanceId}:{}})}pinWidget(e){return this.pinBoardWidget(e,e.name??kv(e.docId),{kind:`canvas-doc`,docId:e.docId})}pinMcpApp(e){return this.pinBoardWidget(e,e.name??Av(e.viewId),{kind:`mcp-app`,viewId:e.viewId})}async pinBoardWidget(e,t,n){let r=Cv(e.title);await this.mutate(`board.widget.put`,{...this.session,name:t,...r?{title:r}:{},content:n,...e.tabId||e.size||e.after?{placement:{...e.tabId?{tabId:e.tabId}:{},...e.size?{size:e.size}:{},...e.after?{after:e.after}:{}}}:{}},t)}widgetFrameUrl(e,t){return this.snapshotSignal.value.widgets.find(n=>n.name===e&&n.revision===t)?.frameUrl??``}refreshWidgetFrame(e){return this.requestRefresh(e,!0)}async widgetAppView(e,t){return await this.resolveWidgetAppView(e,t,!1)}async refreshWidgetAppView(e,t){return await this.resolveWidgetAppView(e,t,!0)}async resolveWidgetAppView(e,t,n){if(this.disposed||!this.connected)return{status:`stale`,error:`Dashboard MCP App view unavailable`};let r=this.snapshotSignal.value.widgets.find(n=>n.name===e&&n.revision===t&&n.contentKind===`mcp-app`);if(!r)return{status:`stale`,error:`Dashboard MCP App widget unavailable`};let i=this.client,a=this.clientGeneration,o=await this.appViews.resolve(r,async()=>await i.request(`board.widget.appView`,{...this.session,name:e,revision:t,...r.instanceId?{instanceId:r.instanceId}:{}}),n);return this.disposed||!this.connected||i!==this.client||a!==this.clientGeneration?{status:`stale`,error:`Dashboard MCP App view unavailable`}:o}subscribe(e){this.unsubscribe=e.addEventListener(t=>{if(!(this.disposed||e!==this.client)){if(t.event===`board.changed`){let e=t.payload;e&&this.matchesSession(e.sessionKey)&&(this.stateGeneration+=1,this.requestRefresh(e.widget));return}if(t.event===`board.command`){let e=t.payload;e?.command&&this.matchesSession(e.sessionKey,e.agentId)&&this.eventStream.emit({sessionKey:this.snapshotSignal.value.sessionKey,command:e.command})}}})}matchesSession(e,t){if(typeof e!=`string`)return!1;let n=bt({},this.sessionKey,this.session.agentId);if(t){let r=bt({},e,t);return n.sessionKey===r.sessionKey&&n.agentId===r.agentId}if(!this.snapshotLoaded){let t=z(e);return!(!t||t.agentId!==n.agentId||Kt(e)!==n.sessionKey&&Kt(t.rest)!==n.sessionKey)}return Kt(e)===Kt(this.snapshotSignal.value.sessionKey)}requestRefresh(e,t=!1){return this.disposed?Promise.resolve():(this.refreshRequested=!0,this.userRefreshRequested||=t,e&&this.changedWidgets.add(e),this.wakeRetryDelay?.(),this.refreshLoop??=this.runRefreshLoop().finally(()=>{this.refreshLoop=void 0,this.refreshRequested&&(this.connected||this.userRefreshRequested)&&this.requestRefresh()}),this.refreshLoop)}async runRefreshLoop(){let e={delayMs:1e3};for(;this.refreshRequested;){if(this.disposed){this.refreshRequested=!1;return}if(!this.connected&&!this.userRefreshRequested)return;this.userRefreshRequested=!1;let t=new Set(this.changedWidgets);this.changedWidgets.clear();let n=this.client,r=this.stateGeneration;try{let i=await n.request(`board.get`,this.session);if(this.disposed)return;if(n!==this.client){this.refreshRequested=!0;continue}if(this.userRefreshRequested=!1,r!==this.stateGeneration){this.refreshRequested=!0;for(let e of t)this.changedWidgets.add(e);continue}for(let e of this.changedWidgets)t.add(e);this.changedWidgets.clear(),this.refreshRequested=!1,this.setSnapshot(i,t),e.delayMs=1e3}catch(i){if(this.disposed)return;if(this.refreshRequested=!0,n!==this.client)continue;this.setLoadError(I(i));for(let e of t)this.changedWidgets.add(e);if(i instanceof te&&i.gatewayCode===`UNAVAILABLE`&&!i.retryable){this.refreshRequested=this.stateGeneration!==r||this.userRefreshRequested;continue}if(!this.connected){if(this.userRefreshRequested)continue;return}let a=e.delayMs;e.delayMs=Math.min(a*2,3e4),await this.waitForRetry(a);continue}}}waitForRetry(e){return new Promise(t=>{let n,r=()=>{n&&(clearTimeout(n),n=void 0,this.wakeRetryDelay===r&&(this.wakeRetryDelay=void 0),t())};n=setTimeout(r,e),this.wakeRetryDelay=r})}async mutate(e,t,n){if(this.disposed)throw Error(`Session dashboard provider is no longer active`);let r=this.client,i=this.clientGeneration,a=++this.stateGeneration,o=()=>!this.disposed&&r===this.client&&i===this.clientGeneration&&a===this.stateGeneration;try{let i=await r.request(e,t);o()&&(this.stateGeneration+=1,this.setSnapshot(i,n?new Set([n]):new Set,!0))}catch(e){throw o()&&this.requestRefresh(),e}}setSnapshot(e,t=new Set,n=!1){let r=Date.now(),i=new Map(this.snapshotSignal.value.widgets.map(e=>[e.name,e])),a=e.widgets.map(e=>{let a=i.get(e.name);if(n&&a&&!t.has(e.name)&&a.revision===e.revision&&a.instanceId===e.instanceId&&e.viewGeneration===void 0){let t=Lv(e,a);return Nv(t,a,r),t}if(a&&!t.has(e.name)&&a.revision===e.revision&&a.instanceId===e.instanceId&&a.viewGeneration===e.viewGeneration&&!e.sandboxUrl&&a.frameUrl){let t={...e,frameUrl:a.frameUrl};return Mv(t,r),t}return Mv(e,r),e});this.appViews.prune(a),this.snapshotLoaded=!0,this.snapshotSignal.set({...e,widgets:a}),this.setLoadError(null)}setLoadError(e){this.loadErrorSignal.value!==e&&this.loadErrorSignal.set(e)}publishAppViewGeneration(){let e=this.snapshotSignal.value;e.widgets.some(e=>e.contentKind===`mcp-app`)&&this.snapshotSignal.set({...e,widgets:e.widgets.map(e=>e.contentKind===`mcp-app`?Object.assign({},e):e)})}}})))()}function Bv(e){return e.tabs.length>0||e.widgets.length>0}function Vv(e){let t=bt({},Mt(e.sessionKey),e.agentId);return JSON.stringify([e.agentId??t.agentId,t.sessionKey])}function Hv(e,t=!0){let n=Vv(e),r=Mt(e.sessionKey),i=t?qv.get(n)?.provider:void 0;if(i)return i;let a=Kv.get(n);return a||(a=new Wv(r),Kv.set(n,a)),a}function Uv(e,t,n=!0,r=!0,i=!1,a=!0,o=!0){let s=Vv(e),c=qv.get(s);if(c)c.provider.attachClient(t,n);else{let r={...e,sessionKey:Mt(e.sessionKey)};c={provider:new Rv(r,t,n),consumers:0},qv.set(s,c)}let l=new Gv(c.provider,{canPinWidgets:r,canPinMcpApps:i,canMutate:a,canGrant:o});c.consumers+=1;let u=!1;return{provider:l,update:(e,t,n)=>{u||qv.get(s)?.provider!==c.provider||(l.updateCapabilities(n),c.provider.attachClient(e,t))},release:()=>{if(u)return;u=!0,l.deactivate();let e=qv.get(s);e&&e.provider===c.provider&&(--e.consumers,!(e.consumers>0)&&(qv.delete(s),e.provider.dispose()))}}}var Wv,Gv,Kv,qv;function Jv(){return(Jv=e((()=>{V(),zv(),wv(),Dv(),Wv=class{constructor(e=``){this.sessionKey=e,this.appViewGeneration=0,this.canMutate=!1,this.canGrant=!1,this.canPinWidgets=!1,this.canPinMcpApps=!1,this.hasLoadedSnapshot=!0,this.loadError$=new Tv(null),this.events=new Ev,this.snapshot$=new Tv(Sv(e))}async applyOps(e){}async grant(e,t){}async pinWidget(e){throw Error(`Session dashboard unavailable`)}async pinMcpApp(e){throw Error(`Session dashboard unavailable`)}widgetFrameUrl(e,t){return``}async refreshWidgetFrame(e){}async widgetAppView(e,t){return{status:`stale`,error:`Session dashboard unavailable`}}async refreshWidgetAppView(e,t){return{status:`stale`,error:`Session dashboard unavailable`}}},Gv=class{constructor(e,t){this.transport=e,this.capabilities=t,this.active=!0,this.loadError$=e.loadError$,this.snapshot$=e.snapshot$,this.events=e.events}get sessionKey(){return this.transport.sessionKey}get appViewGeneration(){return this.transport.appViewGeneration}get canPinWidgets(){return this.active&&this.capabilities.canPinWidgets}get canPinMcpApps(){return this.active&&this.capabilities.canPinMcpApps}get canMutate(){return this.active&&this.capabilities.canMutate}get canGrant(){return this.active&&this.capabilities.canGrant}get hasLoadedSnapshot(){return this.transport.hasLoadedSnapshot}updateCapabilities(e){this.active&&(this.capabilities=e)}deactivate(){this.active=!1}async applyOps(e){if(!this.canMutate)throw Error(`Session dashboard mutation unavailable`);await this.transport.applyOps(e)}async grant(e,t){if(!this.canGrant)throw Error(`Session dashboard approval unavailable`);await this.transport.grant(e,t)}async pinWidget(e){if(!this.canMutate||!this.canPinWidgets)throw Error(`Session dashboard widget pinning unavailable`);await this.transport.pinWidget(e)}async pinMcpApp(e){if(!this.canMutate||!this.canPinMcpApps)throw Error(`Session dashboard MCP App pinning unavailable`);await this.transport.pinMcpApp(e)}widgetFrameUrl(e,t){return this.transport.widgetFrameUrl(e,t)}refreshWidgetFrame(e){return this.transport.refreshWidgetFrame(e)}widgetAppView(e,t){return this.transport.widgetAppView(e,t)}refreshWidgetAppView(e,t){return this.transport.refreshWidgetAppView(e,t)}},Kv=new Map,qv=new Map})))()}function Yv(e){let t={};for(let n of ra){let r=e(ey[n]).trim();r&&(t[n]=r)}return t}function Xv(){let e=document.documentElement,t=getComputedStyle(e);return{type:na,mode:e.dataset.themeMode===`light`?`light`:`dark`,tokens:Yv(e=>t.getPropertyValue(e))}}function Zv(e,t=`*`){e.contentWindow?.postMessage(Xv(),t)}function Qv(e,t){let n=ny.get(window);return n||(n=new Map,ny.set(window,n)),n.set(e,t),$v(),()=>n.delete(e)}function $v(){if(typeof window>`u`||typeof document>`u`||typeof MutationObserver>`u`||ty.has(window))return;ty.add(window);let e=document.documentElement;new MutationObserver(()=>{let e=ny.get(window);for(let t of document.querySelectorAll(`.chat-tool-card__preview-frame, .board-widget__frame`))e?.has(t)||Zv(t);for(let[t,n]of e??[])t.isConnected?Zv(t,n):e?.delete(t)}).observe(e,{attributes:!0,attributeFilter:[`data-theme`,`data-theme-mode`,`style`]})}var ey,ty,ny;function ry(){return(ry=e((()=>{ia(),ey={surface:`--bg`,card:`--card`,elevated:`--bg-elevated`,text:`--text`,"text-strong":`--text-strong`,muted:`--muted`,border:`--border`,"border-strong":`--border-strong`,accent:`--accent`,"accent-fill":`--primary`,"accent-fg":`--primary-foreground`,ok:`--ok`,warn:`--warn`,danger:`--danger`,info:`--info`,radius:`--radius`,"radius-full":`--radius-full`,"scrollbar-size":`--scrollbar-size`,"scrollbar-thumb-inset":`--scrollbar-thumb-inset`,"scrollbar-thumb":`--scrollbar-thumb`,"scrollbar-thumb-hover":`--scrollbar-thumb-hover`,"font-body":`--font-body`,"font-mono":`--mono`},ty=new WeakSet,ny=new WeakMap})))()}function iy(e){for(let t of sy.get(e)?.entries.values()??[])t.controller.abort();sy.delete(e)}function ay(e){if(!h(e))return{};let t=(t,n)=>typeof e[t]==`string`?p(e[t].replace(/\s+/gu,` `).trim(),n):void 0,n=(t,n)=>typeof e[t]==`string`&&e[t].length<=n&&/^data:image\/(?:png|x-icon);base64,[A-Za-z0-9+/]+=*$/u.test(e[t])?e[t]:void 0;return{title:t(`title`,180),description:t(`description`,400),imageDataUrl:n(`imageDataUrl`,35e4),faviconDataUrl:n(`faviconDataUrl`,9e4)}}function oy(e,t,n){let r=sy.get(e);(r?.generation!==e.connectionGeneration||r?.recoveryScope!==e.recoveryScope)&&(iy(e),r=void 0),r||(r={generation:e.connectionGeneration,recoveryScope:e.recoveryScope,entries:new Map},sy.set(e,r));let i=URL.parse(t);if(!i||![`http:`,`https:`].includes(i.protocol)||i.username||i.password)return Promise.resolve({});i.hash=``;let a=i.href,o=r,s=o.entries.get(a);if(s&&!s.controller.signal.aborted&&s.expiresAt>Date.now())return om(s,{},n);let c=new AbortController,l={expiresAt:1/0,controller:c,subscribers:new Set,promise:e.request(`controlUi.linkPreview`,{url:a},{signal:c.signal}).then(t=>{if(c.signal.aborted||sy.get(e)!==o||o.generation!==e.connectionGeneration||o.recoveryScope!==e.recoveryScope)return{};let n=ay(t);return l.expiresAt=Date.now()+(Object.values(n).some(Boolean)?3e5:3e4),n},()=>(o.entries.get(a)===l&&o.entries.delete(a),{}))};return o.entries.delete(a),o.entries.set(a,l),o.entries.size>32&&o.entries.delete(o.entries.keys().next().value),om(l,{},n)}var sy;function cy(){return(cy=e((()=>{sy=new WeakMap})))()}function ly(e=`smooth`){return e===`smooth`&&typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches?`auto`:e}function uy(){return(uy=e((()=>{})))()}function dy(e){if(!e)return;let t=/^(?![A-Za-z]:[/\\])(?:\[[^\]]+\]|[^:@/\s]+):((?!\/\/)[^\s\\]+)$/u.exec(e)?.[1];try{if(!t){let n=new URL(e);if(!n.hostname||n.username||n.password)return;t=n.pathname}let n=t.split(`/`).findLast(Boolean),r=n?decodeURIComponent(n).replace(/\.git$/iu,``).trim():``;return r&&!/[/\\\p{Cc}]/u.test(r)&&r!==`.`&&r!==`..`?r:void 0}catch{return}}function fy(e){return e.map(({displayName:e,originUrl:t})=>{let n=t?.replace(/^github\.com:/iu,`git@github.com:`).replace(/^ssh:\/\/github\.com(?::22)?\//iu,`ssh://git@github.com/`),r=n?da(n):null,[i,a]=r?new URL(r.url).pathname.slice(1,-4).split(`/`):[];if(i&&a)return{owner:i,repo:a,aliases:[e]};let o=dy(t);return{aliases:o&&o.toLowerCase()!==e.toLowerCase()?[e,o]:[e]}})}function py(e){let t=my.get(e);if(t)return t;let n=Lt(e.snapshot),r=new Set,i={result:null,repositories:[],ready:!1},a=``,o=null,s,c=()=>{n.invalidate(),o=null,i={result:null,repositories:[],ready:!1}},l=()=>{for(let e of r)e()},u=()=>{let t=e.snapshot,r=JSON.stringify([e.connection.gatewayUrl,e.connectionRevision,t.selfUser?.id,t.hello?.auth?.recoveryScope,t.hello?.auth?.role,[...t.hello?.auth?.scopes??[]].toSorted(),di(t,`projects.list`,`operator.read`)]);return n.transition(t)||r!==a?(a=r,c(),!0):!1},d=(t=!1)=>{if(u(),t&&(c(),l()),o)return o;let r=n.capture();if(!r)return Promise.resolve();if(!di(e.snapshot,`projects.list`,`operator.read`))return i={result:{projects:[]},repositories:[],ready:!0},l(),Promise.resolve();let a=r.client.request(`projects.list`,{}).then(e=>{u(),n.isCurrent(r)&&(i={result:e,repositories:fy(e.projects),ready:!0})},()=>{u()}).finally(()=>{o===a&&(o=null,l())});return o=a,a},f={get snapshot(){return u()&&r.size&&d(),i},refresh:d,subscribe(t){return r.add(t),s||=e.subscribe(()=>{u()&&(l(),d())}),u(),i.ready||d(),()=>{r.delete(t),r.size||(s?.(),s=void 0,c())}}};return my.set(e,f),f}var my;function hy(){return(hy=e((()=>{Qi(),pi(),my=new WeakMap})))()}function X(e){return e?.status===`published`||e?.status===`failed`}function gy(e){return e?.source===`personal`?{source:`personal`,...e.account}:e?.expected}var _y;function vy(){return(vy=e((()=>{t(),H(),c(),_y=class{constructor(e){this.owner=e,this.presentations=new Set,this.version=0,this.activity=null,this.options=null,this.selection=null,this.attempt=null,this.result=null,this.confirmation=null,this.error=null,this.reviewedRequestId=null,this.refreshPending=!1}get busy(){return this.activity!==null}get hasBindings(){return this.presentations.size>0}reset(){this.owner.release(),this.version+=1,this.activity=null,this.options=null,this.selection=null,this.attempt=null,this.result=null,this.confirmation=null,this.error=null,this.reviewedRequestId=null,this.refreshPending=!1}resetPresentation(){let e=X(this.result)?this.result.requestId:this.reviewedRequestId;this.reset(),this.reviewedRequestId=e}invalidate(){this.attempt?.selection.source===`personal`||this.result?.publisher?.source===`personal`||!this.locked&&this.selection?.source===`personal`||(this.refreshPending=!0,this.flushRefresh())}flushRefresh(){if(!this.refreshPending||this.busy||!this.owner.isCurrent())return;let e=[...this.presentations].find(e=>this.presented(e));(e||this.locked)&&this.refresh(e??null)}changed(){for(let e of this.presentations)e.changed?.()}presented(e){return this.presentations.has(e)&&this.owner.isCurrent()&&e.scope?.isCurrent()===!0&&e.scope.isPresented()}retireIdleOptions(){!this.busy&&!this.locked&&!this.result&&!this.error&&![...this.presentations].some(e=>this.presented(e))&&this.resetPresentation()}bind(e){let t={scope:null,changed:e};this.presentations.add(t);let n=()=>this.result;return{sync:e=>{this.presentations.has(t)&&(t.scope=e,this.retireIdleOptions(),this.presented(t)&&!this.busy&&!this.options&&!this.result&&!this.error&&this.refresh(t),this.flushRefresh())},view:()=>this.view(t),get result(){return n()},reset:()=>{this.presented(t)&&(this.resetPresentation(),this.changed())},detach:()=>{t.scope=null,t.changed=null,this.presentations.delete(t),this.retireIdleOptions(),this.hasBindings||this.owner.unbound()}}}get locked(){return this.attempt!==null||this.result!==null&&!X(this.result)}choose(e,t){let n=this.options;if(!n||this.locked||this.busy||!this.presented(e)||!e.scope?.canWrite)return;let r=n.personal;this.selection=t===`shared`?n.shared?{source:t,expected:n.shared}:null:r?.state===`connected`&&r.account&&r.generation?{source:t,account:r.account,generation:r.generation}:null,this.version+=1,this.changed()}async run(e,t,n){if(!(e?this.presented(e):t===`read`&&this.owner.isCurrent()&&this.locked)||this.busy)return;let r=++this.version,i=()=>this.version===r&&this.owner.isCurrent();this.activity=t,this.error=null,this.changed();try{await n(this.owner,i)}catch(e){i()&&(this.error=I(e))}finally{this.version===r&&(i()?this.activity=null:this.reset(),this.changed(),this.flushRefresh())}}applyResult(e){this.result=e,this.confirmation=null,X(e)&&(this.attempt=null,e.publisher&&e.publisher.source!==`personal`&&![...this.presentations].some(e=>this.presented(e))&&this.owner.release())}async readStatus(e,t,n){let r=await e.client.request(`sessions.github.status`,{...e.target,requestId:n});t()&&(this.applyResult(r.result),this.confirmation=r.confirmation)}async refresh(e){await this.run(e,`read`,async(e,t)=>{if(this.refreshPending=!1,this.result&&!X(this.result)){await this.readStatus(e,t,this.result.requestId);return}let n=this.attempt?.selection.source===`shared`?this.attempt:null,r=await e.client.request(`sessions.github.options`,{...e.target,...n?{idempotencyKey:n.idempotencyKey}:{}});if(!t())return;this.options=r;let i=!this.locked&&!this.result?r.pendingPersonal:null;if(!i&&(n||!this.locked&&this.selection?.source!==`personal`&&(!this.result||X(this.result)&&this.result.publisher?.source!==`personal`))&&(i=r.latestShared),i&&i.result.requestId!==this.reviewedRequestId){let e=i.result.publisher;(i===r.pendingPersonal||!X(i.result))&&this.owner.reserve(),this.applyResult(i.result),this.confirmation=i.confirmation,!this.attempt&&e&&e.source!==`personal`&&(this.selection={source:`shared`,expected:{source:e.source,accountId:e.accountId,login:e.login}})}!this.locked&&!this.selection&&r.shared&&(this.selection={source:`shared`,expected:r.shared})})}async publish(e){let t=this.attempt?.selection??this.selection;!e.scope?.canWrite||!t||X(this.result)||t.source===`personal`&&!e.scope.personalReady||this.locked&&!this.attempt||await this.run(e,`publish`,async(e,n)=>{this.owner.reserve();let r=this.attempt===null,i=this.attempt??{idempotencyKey:T(),selection:t};this.attempt=i;let a=await e.client.request(`sessions.github.publish`,{...e.target,...i}).catch(e=>{throw r&&n()&&this.attempt===i&&v(e)?.idempotencyKey===i.idempotencyKey&&(this.owner.release(),this.attempt=null,this.selection=null,this.options=null),e});n()&&(this.applyResult(a),a.status===`needs_confirmation`&&await this.readStatus(e,n,a.requestId))})}async confirm(e){let t=this.confirmation,n=this.result?.requestId;t&&n&&e.scope?.canWrite&&e.scope.personalReady&&await this.run(e,`confirm`,async(e,r)=>{let i=await e.client.request(`sessions.github.confirm`,{...e.target,requestId:n,generation:t.generation,account:t.account,requestDigest:t.requestDigest});r()&&(this.applyResult(i),i.status===`needs_confirmation`&&await this.readStatus(e,r,n))})}view(e){let t=e.scope;if(!t||!this.presented(e))return;let n=this.version,r=t=>{n===this.version&&this.presented(e)&&t()};return{activity:this.activity,canWrite:t.canWrite,locked:this.locked,options:this.options,selection:this.attempt?.selection??this.selection,result:this.result,confirmation:this.confirmation,error:this.error,personalReady:t.personalReady,onSelect:t.canWrite&&!this.result&&!this.locked?t=>r(()=>this.choose(e,t)):void 0,onPublish:t.canWrite&&(!this.locked||this.attempt!==null)&&!X(this.result)?()=>r(()=>void this.publish(e)):void 0,onConfirm:t.canWrite&&this.confirmation?()=>r(()=>void this.confirm(e)):void 0,onRefresh:()=>r(()=>void this.refresh(e)),onNewAction:X(this.result)?()=>r(()=>{this.busy||(this.resetPresentation(),this.refresh(e))}):void 0}}}})))()}var yy,by;function xy(){return(xy=e((()=>{W(),yy={chat:{goals:{composerMode:`Goal`,sessionChanged:`Conversation changed. Cancel and select Goal again.`,start:`Start goal`,save:`Save goal`,startHint:`Enter your objective.`,editHint:`Save without starting a run.`,objectivePlaceholder:`What should this goal accomplish?`,cancel:`Cancel goal entry`,offline:`Reconnect to manage goals.`,busy:`Wait for this run to finish. Your draft is unchanged.`,annotationUnsupported:`Send or remove browser annotations first. Your draft is unchanged.`,actionPending:`Wait for the pending goal action.`,invalidRequest:`Goal update is invalid. Check the objective and try again.`,outcomeUnknown:`Goal update not confirmed. Check its outcome before making another change.`,recoveryTitle:`Goal update not confirmed`,recoveryHint:`Check the saved request. If it already succeeded, it will not run again.`,checking:`Checking goal update…`,checkOutcome:`Check outcome`,refreshCurrent:`Review current goal`,recoveryExpired:`The saved request expired after 24 hours. Review the current goal before making another change.`,recoveryUnavailable:`Goal update was not sent because its recovery request could not be saved.`,recoveryInvalid:`The saved goal request is invalid; review the current goal before retrying.`,admissionImmutable:`Retry or remove this request. Editing requires a new goal.`,edit:`Edit goal`,editChip:`Edit`,pause:`Pause goal`,pauseChip:`Pause`,resume:`Resume goal`,resumeChip:`Resume`,clear:`Clear goal`,clearChip:`Clear`,showDetails:`Show goal details`,hideDetails:`Hide goal details`}}},by=Object.assign(()=>Object.assign(R.chat.goals,yy.chat.goals),{catalog:yy})})))()}var Sy,Cy;function wy(){return(wy=e((()=>{W(),Sy={chat:{modelControls:{subscription:`Subscription`,api:`API`,default:`Default`,routes:{claudeCli:{label:`Claude CLI · native`,detail:`Runs through Claude Code, using its native login or a selected saved account. An explicitly selected API-key account has separate API billing; CLI does not mean free or subscription-only.`},anthropicApi:{label:`API · OpenClaw`,detail:`Uses the configured Anthropic API connection with OpenClaw's runtime. API-key usage is billed separately from a Claude subscription.`},anthropicConfigured:{label:`Configured route`,detail:`Anthropic models can use the API or Claude CLI, depending on their configured runtime and account. The provider name alone does not determine billing.`}},decisionLabel:`Decision Model`,decisionDisabled:`Disabled`,decisionInherit:`Use global default · {model}`,decisionUnavailable:`This decision model is unavailable. Enable its plugin or choose another model.`,decisionHelp:`Makes typed choices, scores, and yes/no judgments. Disabled until you select a decision model; chat models are not used as a fallback.`,decisionAgentHelp:`Use the global decision model, choose an override, or disable decisions for this agent.`,effort:`Effort`,faster:`Faster`,smarter:`Smarter`,fastMode:`Fast mode`,searchModels:`Search models`,noMatchingModels:`No models match your search`,configureModels:`Configure models`,selectionScopeSessionLabel:`This session`,selectionScopeAgentLabel:`Agent default`,selectionScopeGlobalLabel:`Global default`,selectionScopeSession:`Selecting a model changes only this session.`,selectionScopeAgent:`Selecting a model updates this agent's default.`,selectionScopeGlobal:`Selecting a model updates the global default.`,defaultWithModel:`Default ({model})`,defaultWithLevel:`Default ({level})`,fastHelp:`Faster responses, higher usage of limits.`,contextWindow:`Context window`,contextWindowAria:`Context window: {state}`,speedUnsupported:`Speed control is not supported for this model.`,contextActiveAndMax:`{active} active · {maximum} max`,chatOnly:`Chat only`,chatOnlyHelp:`This model can chat, but it cannot use tools. Choose another model for files, commands, web, or media tasks.`,loadingModels:`Loading models…`,refreshingModels:`Refreshing models…`,refreshingProviderModels:`Refreshing models for {providers}…`,modelPending:`Model pending`,modelStarting:`Starting…`,modelsUnavailable:`Models unavailable`,runtimeUnavailable:`This harness is unavailable for this model.`,modelsRefreshFailed:`Some models could not be refreshed. Open Models to try again.`,checkingProviderModels:`{providers}: checking models…`,noModelsAvailable:`No models available`,noPermittedModels:`No models are permitted by your administrator.`,selectionRequired:`Choose a model`,restrictedModelsHelp:`Your administrator centrally configures the models available here.`,emptyModelsAction:`Manage models`,providerModels:`{provider} models`,useDefaultReasoning:`Use default reasoning ({level})`,fastResponsesAria:`Fast responses: {state}`},nativeRuntimeRecovery:{title:`Use {runtime}’s native permissions?`,confirm:`Continue for this chat`,confirmMessage:`{runtime} will run on the Gateway host under its own permissions. OpenClaw’s optional native tool and sandbox restrictions, including workspace-only restrictions, will not be enforced for this harness. Only this chat is changed; other chats and global configuration stay unchanged. OpenClaw-hosted tools keep their own policy checks.`,retryMessage:`Continue will retry the message you just sent.`,chooseAnother:`Choose another model to keep this chat’s current execution restrictions.`,failed:`Could not change this chat’s execution permissions: {error}`,refreshFailed:`The model and permissions were saved, but refreshing this chat failed: {error}`,reasons:{"sandbox-required":`{runtime} cannot run because this chat requires a sandbox.`,sandbox:`{runtime} uses native tools that cannot run inside the OpenClaw sandbox.`,"workspace-only":`{runtime} cannot enforce this chat’s OpenClaw workspace-only restriction.`,"permission-mode":`{runtime} cannot enforce this chat’s current execution permissions.`,"tool-policy":`{runtime} cannot enforce this chat’s OpenClaw native tool restrictions.`,"remote-execution":`{runtime} cannot use this chat’s remote execution target.`}},permissionControls:{label:`Execution permissions`,help:`Choose what available tools may do in this session. This does not change the tool profile.`,default:`Default`,defaultDescription:`Follow the agent's configured execution permissions.`,defaultWithMode:`Default ({mode})`,fullRequiresAdmin:`Full access requires operator.admin access.`,updateFailed:`Failed to update permissions: {error}`,refreshFailed:`Permissions were saved, but refreshing the session failed: {error}`,modes:{"read-only":{label:`Read Only`,description:`Agent tools can read within the session root, but cannot write or run commands.`},guarded:{label:`Guarded`,description:`A human reviews requests beyond the session root.`},workspace:{label:`Workspace`,description:`An AI reviewer checks requests beyond the session root.`},full:{label:`Full Access`,description:`No reviewer; files and commands are unrestricted.`}}}}},Cy=Object.assign(()=>{R.chat=Object.assign({},R.chat,Sy.chat)},{catalog:Sy})})))()}function Ty(e){return e?.source===`session-key`||e?.source===`session`}function Ey(e,t){if(!e||!t||e.agentRuntime?.id===t)return e;let n=e.runtimeChoices?.find(e=>e.agentRuntime.id===t);return n?{id:e.id,name:e.name,provider:e.provider,alias:e.alias,tags:e.tags,apiKeySupported:e.apiKeySupported,...n}:void 0}function Dy(){return(Dy=e((()=>{})))()}function Oy(e){let t=Je(e??``);return!!(t&&Wy.has(t))}function ky(e){return Object.hasOwn(e.modelOverrides,e.sessionKey)?e.modelOverrides[e.sessionKey]==null?null:`user`:e.activeSession?.modelOverrideSource}function Ay(e){let t=e.chatModelCatalog??[],n=e.modelOverrides;if(Object.hasOwn(n,e.sessionKey))return Ue(n[e.sessionKey],t);let r=e.activeSession;return Ie(r?.model,r?.modelProvider,t)}function jy(e){return e.catalogRetired||e.catalogInitialized===!1?``:e.modelSelectionPolicy?.restricted?e.modelSelectionPolicy.defaultModel??``:Ie(e.agentDefaultModel,void 0,e.chatModelCatalog??[])||Ie(e.sessionsResult?.defaults?.model,e.sessionsResult?.defaults?.modelProvider,e.chatModelCatalog??[])}function My(e){let t=e.trim().toLowerCase(),n=t.indexOf(`/`);return n<=0?t:`${Je(t.slice(0,n))}/${t.slice(n+1)}`}function Ny(e){return My(Te(e.id,e.provider))}function Py(e,t){let n=e.trim().toLowerCase();if(!n)return e;let r=My(e);for(let e of[!1,!0]){let i=t.find(t=>!!t.disabled===e&&(t.value.trim().toLowerCase()===n||My(t.value)===r));if(i)return i.value}return e}function Fy(e,t){let n=new Set,r=[];for(let i of e.toSorted((e,t)=>Number(e.available===!1)-Number(t.available===!1)||Number(e.provider.trim().toLowerCase()!==Je(e.provider))-Number(t.provider.trim().toLowerCase()!==Je(t.provider)))){if(i.manualSelectionAllowed===!1)continue;let e=Ot(i,t),a=e.value.trim(),o=a.toLowerCase();a&&!n.has(o)&&(n.add(o),r.push({...e,...i.available===!1?{disabled:!0,unavailableReason:i.unavailableReason}:{}}))}return r}function Iy(e,t,n){let r=My(Ie(e,t,n)),i=n.filter(e=>Ny(e)===r);if(i.length&&!i.some(e=>e.available!==!1||!e.unavailableReason))return i.some(e=>e.unavailableReason===`cooldown`)?`cooldown`:i.some(e=>e.unavailableReason===`auth-failed`)?`auth-failed`:`missing-auth`}function Ly(e,t,n){let r=My(Ie(e,t,n));return n.some(e=>e.manualSelectionAllowed!==!1&&Ny(e)===r)}function Ry(e){return e===`missing-auth`?B(`modelSetup.missingAuth`):e===`unsupported-runtime`?B(`chat.modelControls.runtimeUnavailable`):e===`auth-failed`?`${B(`modelSetup.failure.auth`)}. ${B(`modelSetup.failureGuidance.auth`)}`:void 0}function zy(e){let t=e.chatModelCatalog??[],n=new Set(t.filter(e=>e.available!==!1).map(Ny)),r=t.filter(e=>e.available!==!1||!n.has(Ny(e))),i=Ge(r),a=Fy(r,i),o=Py(Ay(e),a),s=Py(jy(e),a),c=wt(s,i);return{currentOverride:o,defaultModel:s,defaultLabel:s?`Default (${c})`:`Default model`,modelOverrideSource:ky(e),options:a}}function By(e){if(e===`auto`)return`auto`;if(e===`on`)return!0;if(e===`off`)return!1}function Vy(e){let t=e?.effectiveFastMode??e?.fastMode,n=t===`auto`?B(`chat.commandResults.fast.autoValue`,{seconds:String(e?.fastAutoOnSeconds??60)}):B(t===!0?`chat.commandResults.fast.on`:`chat.commandResults.fast.off`),r=e?.effectiveFastModeSource,i=r===`session`?B(`chat.commandResults.fast.sourceSession`):r===`agent`?B(`chat.commandResults.fast.sourceAgent`):r===`config`?B(`chat.commandResults.fast.sourceModel`):r==="default"?B(`chat.commandResults.fast.sourceDefault`):``;return`${B(`chat.commandResults.fast.current`,{value:n})}${i}.`}function Hy(e,t,n,r){let i=e.trim().toLowerCase();if(!i)return n??r;let a=new Set,o=new Set,s=!1;for(let e of t){let t=e.id.trim().toLowerCase()===i,n=Te(e.id,e.provider).trim().toLowerCase()===i;if(!t&&!n)continue;s=!0;let r=Je(e.provider);r&&(t&&a.add(r),n&&o.add(r))}return o.size===1?[...o][0]??null:n&&a.has(n)&&!o.has(n)?n:a.size===1?[...a][0]??null:s?null:n??r}function Uy(e){let t=e.fastModeTarget,n=Je(t?.modelProvider??``)||null,r=Je(e.sessionsResult?.defaults?.modelProvider??``)||null,i=Hy(e.currentModelOverride,e.catalog,n,r),a=t?.fastMode===`auto`?`auto`:t?.fastMode===!0?`on`:t?.fastMode===!1?`off`:``,o=i===`openai`,s=t?.effectiveFastMode??t?.fastMode,c=o?s===!0?`on`:s===`auto`?`auto`:`off`:a,l=My(Ue(e.currentModelOverride||Te(t?.model??e.sessionsResult?.defaults?.model??``,i),e.catalog)),u=new Set(e.catalog.filter(e=>Ny(e)===l).map(e=>((e.runtimeChoices?.length?Ey(e,t?.agentRuntime?.id):e)??e).supportsFastMode)),d=(u.size===1?[...u][0]:void 0)??Oy(i),f=d||!!a,p=s===!0||s===`auto`,m=s===`auto`?`Auto`:p?`Fast`:o||c===`off`?`Standard`:`Default`,h=d?p?`off`:`on`:``;return{active:p,currentOverride:c,disabled:!f||!e.connected||e.loading||e.sending||!!e.activeRunId||e.stream!==null||!e.gatewayAvailable,label:m,nextValue:h,supported:f}}var Wy;function Gy(){return(Gy=e((()=>{U(),wy(),Be(),Cy(),Wy=new Set([`anthropic`,`minimax`,`minimax-portal`,`openai`,`xai`])})))()}var Ky,qy;function Jy(){return(Jy=e((()=>{W(),Ky={chat:{detailPanel:{close:`Close sidebar`,copyPath:`Copy path`,discard:`Discard`,editFile:`Edit file`,searchInFile:`Search in file`,showInFiles:`Show in Files`,unavailable:`Unable to open`,previousMatch:`Previous match`,nextMatch:`Next match`,overwrite:`Overwrite`,viewRawText:`View Raw Text`,viewSource:`Source`,renderedMarkdown:`Rendered Markdown`,renderedMarkdownHint:`Sanitized rich-text preview for quick reading.`,noPreviewableMarkdown:`No previewable markdown content.`,noContent:`No content available`,fullContentOversized:`Full content is unavailable because the stored transcript entry is too large to return safely.`,fullContentNotVisible:`Full content is unavailable because this transcript entry does not have a visible WebChat projection.`,fullContentUnavailable:`Full content is no longer available for this transcript entry.`,copyContents:`Copy file contents`,fileChanged:`File changed on disk since it was loaded.`,renderPreview:`Render preview`,imagePreview:`Image preview`,file:`File`,markdownPreview:`Markdown preview`,toolDetails:`Tool details`,reloadFailed:`Failed to reload the latest file.`,reloadBlocked:`Save or discard your file edits before reloading.`,draftRecovery:{review:`Review file drafts`,description:`Copy or download unsaved edits before discarding them. This only changes drafts in this tab, not files on disk. After resolving all drafts, try Refresh again.`,copy:`Copy {name}`,download:`Download {name}`,discard:`Discard {name}`,keep:`Keep drafts`,changed:`These edits changed. Close this dialog and review the drafts again.`,copyFailed:`Could not copy the edits. Select the text or download the draft instead.`},overwriteLoadFailed:`Failed to load the latest file before overwriting.`,fullContentLoadFailed:`Failed to load full content: {error}`}},filePreview:{bundle:{binary:`This binary file is included in the bundle but cannot be displayed as text.`,"too-large":`This file exceeds the preview limit. Its contents have not been truncated or loaded.`,unavailable:`This file could not be read safely or is unavailable. Close and reopen the skill to try again.`,incomplete:`Some bundle content is unavailable. Select a file to see its status.`},listLabel:`Files`,searchPlaceholder:`Search files…`,readOnly:`read-only`,emptyTitle:`No files match`,emptySubtitle:`Try another file name or content search.`,copyFile:`Copy file`,fileCount:`{count} files`,filteredFileCount:`{count}/{total} files`,noMatches:`No files match.`,navigate:`navigate`,kind:{text:`Text`,shell:`Shell`,file:`File`}}},qy=Object.assign(()=>{Object.assign(R.chat.detailPanel,Ky.chat.detailPanel),Object.assign(R.filePreview,Ky.filePreview)},{catalog:Ky})})))()}function Yy(e,t,n=`text/plain`){Xy(e,new Blob([t],{type:n}))}function Xy(e,t){let n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=e,r.click(),setTimeout(()=>URL.revokeObjectURL(n),0)}function Zy(){return(Zy=e((()=>{})))()}function Qy(e,t){return e.every(e=>e.kind!==`add`&&e.kind!==`ctx`||e.lineNo===void 0||t[e.lineNo-1]===e.text)}function $y(e,t,n){return Array.from({length:n},(n,r)=>({kind:`ctx`,lineNo:t+r,text:e[t+r-1]}))}function eb(e,t,n,r,i){let a=e.findIndex(e=>e.kind===`skip`&&e.gap===t),o=t.newStart+t.count-1;if(a<0||t.newStart<1||t.count<1||o>n.length||!Qy(e,n))return null;let s=r===`all`||t.count<=nb?t.count:Math.min(tb,t.count),c=t.count-s,l=$y(n,r===`up`?t.newStart+c:t.newStart,s),u=[];return r===`up`&&c>0&&u.push({kind:`skip`,text:i(c),gap:{...t,count:c}}),u.push(...l),r!==`up`&&c>0&&u.push({kind:`skip`,text:i(c),gap:{oldStart:t.oldStart+s,newStart:t.newStart+s,count:c}}),[...e.slice(0,a),...u,...e.slice(a+1)]}var tb,nb;function rb(){return(rb=e((()=>{E_(),tb=20,nb=25})))()}function ib(e,t,n=ab){let r=[],i=!1,a=!1,o=0,s=0,c,l,u=e.replace(/\r\n/g,`
`).split(`
`);u.at(-1)===``&&u.pop();for(let e of u){let u=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(e);if(u){let e=Number.parseInt(u[1]??``,10),n=Number.parseInt(u[2]??``,10),i=c===void 0?e-1:e-c;i>0&&r.push({kind:`skip`,text:t(i),gap:{oldStart:c??e-i,newStart:l??n-i,count:i}}),o=e,s=n,a=!0;continue}if(a&&!e.startsWith(`\\`)){if(r.length>=n){i=!0;break}e.startsWith(`+`)?(r.push({kind:`add`,lineNo:s,text:e.slice(1)}),s+=1):e.startsWith(`-`)?(r.push({kind:`del`,lineNo:o,text:e.slice(1)}),o+=1):(r.push({kind:`ctx`,lineNo:s,text:e.slice(1)}),o+=1,s+=1),c=o,l=s}}return{lines:r,truncated:i}}var ab;function ob(){return(ob=e((()=>{ab=600})))()}function sb(e){let t=[];for(let n=0;n<e.length;){let r=e[n];if(!r)break;if(r.kind!==`add`&&r.kind!==`del`){t.push({kind:`span`,line:r}),n+=1;continue}let i=[],a=[];for(;n<e.length;){let t=e[n];if(t?.kind===`del`)i.push(t);else if(t?.kind===`add`)a.push(t);else break;n+=1}let o=Math.max(i.length,a.length);for(let e=0;e<o;e+=1)t.push({kind:`pair`,...i[e]?{left:i[e]}:{},...a[e]?{right:a[e]}:{}})}return t}function cb(){return(cb=e((()=>{})))()}function lb(e){let t=Oe();if(!t)throw Error(`Browser storage is unavailable`);let n=hc(t,cc(e.settings?.gatewayUrl));return{entries:Object.entries(n.recovery).filter(([,t])=>(t.session.queue??[]).every(t=>Ls(e,t))).map(([e,t])=>Object.assign({},t,{id:e})),blocked:n.recoveryBlocked===!0}}function ub(e,t){let n=Oe();if(!n||!Wt(e)||e.selectedChatSessionIncognito||me(t.sessionKey)||e.connected&&e.client&&!e.client.recoveryScopeReady)return null;let r=cc(e.settings?.gatewayUrl),i=hc(n,r);uc(i,e);let a=F(bt(e,t.sessionKey,t.agentId)),o=i.sessions[a]??null;return{scope:t,gatewayOwner:r.gatewayOwner,recoveryScope:Is(e),session:JSON.stringify(o),revision:$s(n,r.key,a,o?.draftRevision).latestAttempt}}function db(e,t,n,r=0){let i=Oe();if(!i)return`storage-failed`;try{let a=ub(e,n.scope);if(!a||JSON.stringify(a)!==JSON.stringify(n))return`conflict`;let o=cc(e.settings?.gatewayUrl),s=hc(i,o),{id:c,...l}=t;if(JSON.stringify(s.recovery[c])!==JSON.stringify(l)||!(t.session.queue??[]).every(t=>Ls(e,t)))return`conflict`;let u=bt(e,n.scope.sessionKey,n.scope.agentId);if(F(u)!==F(n.scope))return`conflict`;let d=F(u),f=s.sessions[d];if(f?.draft||f?.goalMode||f?.replyTarget||f?.queue?.length)return`conflict`;let p=t.session;s.sessions[d]={...p,awaitingDefaults:void 0,draftRevision:qs(Math.max(r,n.revision,p.draftRevision??0)),queue:p.queue?.map(e=>Object.assign({},e,u,{sendState:e.sendState===`held`?`held`:(e.sendAttempts??0)>0||e.sendState===`unconfirmed`?`unconfirmed`:`failed`,sendError:e.sendError??`Recovered message. Review this destination and retry only if it did not arrive.`}))},delete s.recovery[c],_c(i,o,s);let m=hc(i,o);return m.recovery[c]||JSON.stringify(m.sessions[d])!==JSON.stringify(ys(s.sessions[d]))?`storage-failed`:(oc(),`restored`)}catch{return`storage-failed`}}function fb(){return(fb=e((()=>{y(),V(),Gs(),Ss(),nc(),kc()})))()}function pb(){return document.querySelector(`openclaw-chat-page`)?.sessionSplitAvailable===!0}function mb(e){return Tt(e,{method:`chat.history`,requiredScope:`operator.read`,sessionScope:!0}).allowed}async function hb(e){let{context:t,session:n}=e,r=t.gateway,i=r.snapshot.client,a=Tt(r.snapshot,{method:`chat.history`,requiredScope:`operator.read`,sessionScope:!0});if(!a.allowed||!i)throw Error(a.allowed?B(`sessionsView.actionRequiresConnection`):a.reason);let o=z(n.key)?.agentId??Jt(t,e.agentId),s=r.snapshot.hello,c=()=>e.isCurrent()&&r.snapshot.client===i&&r.snapshot.phase===`connected`&&r.snapshot.hello===s,l=[],u=new Map,d=(e,t=1e3)=>i.request(`chat.history`,{sessionKey:n.key,agentId:o,limit:t,maxChars:5e5,offset:e}),f=0,p;for(;;){let e=await d(f);if(!c()||n.sessionId&&e.sessionId!==n.sessionId||p&&(e.sessionId!==p.sessionId||e.totalMessages!==p.totalMessages))throw Error(B(`sessionsView.copyTranscriptChanged`));p??=e;let t=new Map,r=(e.messages??[]).filter(e=>{let n=no(e);if(!n)return!0;let r=(t.get(n)??0)+1;return t.set(n,r),r>(u.get(n)??0)});for(let[e,n]of t)u.set(e,Math.max(n,u.get(e)??0));if(l.push(r),!e.hasMore)break;if(e.nextOffset===void 0||e.nextOffset<=f)throw Error(B(`sessionsView.copyTranscriptChanged`));f=e.nextOffset}if(l.length>1){let e=await d(0,1);if(!c()||e.sessionId!==p.sessionId||e.totalMessages!==p.totalMessages||e.deltaCursor!==p.deltaCursor||e.sessionInfo?.activeLeafEntryId!==p.sessionInfo?.activeLeafEntryId)throw Error(B(`sessionsView.copyTranscriptChanged`))}let m=t.agents.state.agentsList?.agents.find(e=>e.id===o)?.name??`OpenClaw`,h=Sa(l.toReversed().flat(),m);if(!h)throw Error(B(`chat.commandResults.emptyExport`));return jt(h,c)}async function gb(e,t){try{if(e===`split-right`||e===`split-below`){(!pb()||window.dispatchEvent(new CustomEvent(`openclaw:ui-command`,{detail:{agentId:t.agentId,command:{kind:`split`,direction:e===`split-right`?`right`:`down`,sessionKey:t.session.key},...t.sourceSessionKey?{sessionKey:t.sourceSessionKey}:{}},cancelable:!0})))&&ot({message:B(`sessionsView.splitUnavailable`)});return}if(e===`copy-markdown`||e===`copy-session-id`){let n=e===`copy-markdown`?await hb(t):await jt(t.session.sessionId??``);ot({message:B(n?`common.copied`:`common.copyFailed`)});return}let n=ht(t.context,t.session.key,t.agentId),r=t.context.gateway,i=e===`copy-session-link`||e===`copy-session-preview-link`,a=i?r.snapshot.hello?.controlUiUrl??r.snapshot.client?.gatewayUrl??r.connection.gatewayUrl:void 0,o=new URL(a||window.location.href);o.protocol=o.protocol.replace(/^ws/u,`http`);let s=a?o.pathname:t.context.basePath,c=Qt({context:t.context,basePath:e===`copy-session-preview-link`?`${ce(s)}/share`:s,face:n,sessionKey:t.session.key,agentId:t.agentId,exactKey:!0}),l=new URL(c.href,o.origin).href;if(i){let e=await jt(l);ot({message:B(e?`common.copied`:`common.copyFailed`)});return}let u=Ut({popup:e===`open-new-window`});u?u.location.replace(l):ot({message:B(`sessionsView.openWindowBlocked`)})}catch(e){ot({message:I(e)})}}function _b(){return(_b=e((()=>{tr(),Kn(),U(),xa(),io(),Gt(),H(),mt(),Ee(),it(),St(),V()})))()}var vb,yb;function bb(){return(bb=e((()=>{W(),vb={sessionsView:{placementFactService:`Service`,placementFactProfile:`Profile`,placementFactMachine:`Machine`,placementFactState:`State`,placementFactDisk:`Disk`,placementDiskFree:`{free} free`,runsOnDevice:`Runs on device`,runsOnWorker:`Runs on worker`,stopWorker:`Stop worker…`,stopWorkerConfirm:`Stop the worker for "{session}"?`,stopWorkerConfirmAction:`Stop worker`,deviceOffline:`Device offline`,waitingForDevice:`Waiting for device to reconnect; retry after it returns.`,continueOnGatewayMenu:`Continue on Gateway…`,continueOnGatewayAction:`Continue on Gateway`,continueOnGatewayConfirm:`Continue "{session}" on the Gateway? Unsynced device files and in-flight work may be lost. OpenClaw will continue from the last Gateway-synced state and will not replay the interrupted turn.`,discardWorkspaceDeleteConfirm:`The device for "{session}" is offline and has changes that have not synced. Reconnect it to keep those changes. To delete this session now, discard unsynced device files and in-flight work, then retry deletion once. The last Gateway-synced workspace is used; interrupted work is not replayed.`,discardWorkspaceDeleteAction:`Discard changes and delete`,discardWorkspaceArchiveConfirm:`The device for "{session}" is offline and has changes that have not synced. Reconnect it to keep those changes. To archive this session now, discard unsynced device files and in-flight work, then retry archiving once. The last Gateway-synced workspace is used; interrupted work is not replayed.`,discardWorkspaceArchiveAction:`Discard changes and archive`,workspaceRecoveryBatchHint:`Recover each offline session separately before retrying this selection.`,stopDeviceWorker:`Stop device worker…`,offlineDeviceStopUnavailable:`Reconnect the device to stop and sync its workspace, or Continue on Gateway.`,stopDeviceWorkerConfirm:`Stop the device worker for "{session}"?`,stopDeviceWorkerConfirmAction:`Stop device worker`,restartSession:`Restart session…`,restartingSession:`Restarting session…`,restartSessionTitle:`Restart session`,restartSessionDescription:`Choose where "{session}" should restart.`,restartSessionWarning:`The session restarts from its last saved workspace on the selected destination. Changes that the previous worker did not upload may be lost.`,restartSessionAction:`Restart session`,chooseWorker:`Choose worker…`,dispatchingSession:`Starting worker…`,repositoryWorkerRequiredLabel:`Worker required`,repositoryWorkerRequiredTitle:`Repository worker required`,repositoryWorkerRequiredPrompt:`Choose a device or cloud worker before sending another message in this repository session.`,dispatchSessionTitle:`Choose a worker`,dispatchSessionDescription:`Choose where "{session}" should continue.`,dispatchSessionNotice:`This repository exists only on workers, so the Gateway cannot run this session locally.`,dispatchSessionAction:`Continue on worker`,stoppingSession:`Stopping session…`,finishingSessionMove:`Finishing session move…`,syncingCloudFiles:`Cloud · syncing files`,syncingCloudFilesComposer:`Send now; your message starts automatically after workspace sync.`,syncingCloudFilesDetail:`Safely applying cloud edits`,failedSessionTitle:`Runner failed`,failedSessionRestartPrompt:`Restart this session to continue.`,failedSessionStopPrompt:`Stop the failed worker before restarting this session.`,failedSessionUnavailable:`This session's runner failed and cannot accept messages.`}},yb=Object.assign(()=>{Object.assign(R.sessionsView,vb.sessionsView)},{catalog:vb})})))()}function xb(e,t,n){return Math.min(n,Math.max(t,Number.isFinite(e)?Math.round(e):t))}function Sb(e,t){return{name:e.name,w:e.w,h:e.h,order:t}}function Cb(e,t=Bb){return e.map(e=>({name:e.name,w:xb(e.w,1,12),h:xb(e.h,1,t),order:Number.isFinite(e.order)?e.order:0})).toSorted((e,t)=>e.order-t.order||e.name.localeCompare(t.name)).map(Sb)}function wb(e,t,n,r,i){for(let a=n;a<n+i;a+=1)for(let n=t;n<t+r;n+=1)if(e[a]?.[n])return!1;return!0}function Tb(e,t){for(let n=t.y;n<t.y+t.h;n+=1){let r=e[n]??Array.from({length:12},()=>!1);e[n]=r;for(let e=t.x;e<t.x+t.w;e+=1)r[e]=!0}}function Eb(e,t){for(let n=0;;n+=1)for(let r=0;r<=12-t.w;r+=1)if(wb(e,r,n,t.w,t.h))return{name:t.name,x:r,y:n,w:t.w,h:t.h}}function Db(e,t=Bb){return Ob(Cb(e,t))}function Ob(e){let t=[],n=[];for(let r of e){let e=Eb(t,r);Tb(t,e),n.push(e)}return n}function kb(e,t){return t.x>=e.x&&t.x<e.x+e.w&&t.y>=e.y&&t.y<e.y+e.h}function Ab(e,t,n){let r=Cb(e),i=r.findIndex(e=>e.name===t);if(i<0)return r;let a=Ob(r),o=a.find(e=>e.name===n.name)??n,s={x:xb(o.x,0,11),y:Math.max(0,Number.isFinite(o.y)?Math.floor(o.y):0)},c=a.find(e=>e.name===t);if(c&&kb(c,s))return r;let[l]=r.splice(i,1);if(!l)return r;let u=a.find(e=>e.name!==t&&kb(e,s))??a.filter(e=>e.name!==t&&(e.y>s.y||e.y===s.y&&e.x>=s.x)).toSorted((e,t)=>e.y-t.y||e.x-t.x)[0],d=u?r.findIndex(e=>e.name===u.name):r.length;return r.splice(Math.max(0,d),0,l),r.map(Sb)}function jb(e,t,n,r){return Cb(e).map(e=>e.name===t?{name:e.name,w:xb(n,1,12),h:xb(r,1,Bb),order:e.order}:e)}function Mb(e,t,n){let r=Cb(e),i=r.findIndex(e=>e.name===t);if(i<0)return r;let a=n===`left`||n===`up`?-1:1,o=Math.min(r.length-1,Math.max(0,i+a));if(o!==i){let[e]=r.splice(i,1);e&&r.splice(o,0,e)}return r.map(Sb)}function Nb(e){return`grid-column: ${e.x+1} / span ${e.w}; grid-row: ${e.y+1} / span ${e.h};`}function Pb(){return typeof window.matchMedia==`function`&&!window.matchMedia(`(hover: hover) and (pointer: fine)`).matches?Ub:0}function Fb(e,t,n){if(!(e.contentKind!==`html`||e.heightMode===`fixed`||t===void 0||!Number.isFinite(t)||t<=0))return t+2+n+((e.presentation??`card`)===`card`?24:0)}function Ib(e){return e*56+(e-1)*12}function Lb(e,t,n=0,r=Hb){let i=Fb(e,t,n);if(i===void 0)return e.sizeH;let a=Math.ceil((i+12)/68);return Math.min(r,Math.max(Vb,a))}function Rb(e,t,n=0,r=Hb){let i=Fb(e,t,n);if(i!==void 0)return Math.min(i,Ib(Lb(e,t,n,r)))}function zb(e,t,n=!1,r=``){let i=Pb();return e.map(e=>({name:e.name,w:e.sizeW,h:Lb(e,t.get(e.name),e.name===r?0:i,n?240:void 0),order:e.position}))}var Bb,Vb,Hb,Ub,Wb;function Gb(){return(Gb=e((()=>{Bb=20,Vb=2,Hb=20,Ub=38,Wb=`(hover: hover) and (pointer: fine)`})))()}function Kb(e){let t=p(e.replace(/\s+/g,` `).trim(),Jb);return t?`Regarding "${t}": `:null}function qb(e){return e.trim().replace(/^\/(?:btw|side)(?::\s*|\s+|$)/i,``).trim()}var Jb;function Yb(){return(Yb=e((()=>{Jb=300})))()}function Xb(e){if(!h(e)||typeof e.step!=`string`||e.status!==`pending`&&e.status!==`in_progress`&&e.status!==`completed`)throw Error(`Progress card response contained invalid steps`);return{status:e.status,step:e.step}}function Zb(e,t){if(!h(e))throw Error(`Progress card response was invalid`);let n=e.card;if(n===null)return null;if(!h(n))throw Error(`Progress card response was invalid`);let r=n.markdown,i=n.revision,a=le(n.updatedAt),o=n.steps;if(n.sessionKey!==t||r!==void 0&&typeof r!=`string`||o!==void 0&&!Array.isArray(o)||typeof i!=`number`||!Number.isInteger(i)||i<1||a===void 0||!Number.isInteger(a))throw Error(`Progress card response did not match the requested session`);let s=Array.isArray(o)?o.map(Xb):void 0;if(r===void 0&&(!s||s.length===0))throw Error(`Progress card response contained no content`);return{sessionKey:t,revision:i,updatedAt:a,...r===void 0?{}:{markdown:r},...s&&s.length>0?{steps:s}:{}}}function Qb(e,t){let n=t.agentId?.trim()?b(t.agentId):void 0,r=t.sessionKey.trim(),i=r.toLowerCase();return{...n?{agentId:n}:{},...bt(e,i===`global`||i===`unknown`?i:Xt(r,n),n)}}function $b(e){return z(e.sessionKey)?{sessionKey:e.sessionKey}:e}function ex(e){let t=new Map,n=new Map,r=new Map,i=dr(e),a=()=>{let t=dr(e);t!==i&&(i=t,r.clear())},o=(e,t,n)=>{a(),n?r.has(e)||r.set(e,{target:t,token:{}}):r.delete(e)},s=new Set,c=Lt(e.snapshot),l=e.snapshot.client,u=!1,d=null,f=null,p=t=>{let n=Qb(e.snapshot,t);return{target:n,key:JSON.stringify([n.agentId??null,n.sessionKey]),wireKey:Xt(n.sessionKey,n.agentId)}},m=(e=!1)=>new Map(Array.from(t.values()).filter(t=>!e||t.admitAutomaticRead?.()!==!1).flatMap(({targets:e})=>e.map(e=>{let t=p(e);return[t.key,t.target]}))),g=()=>{for(let e of s)e()},_=e=>{clearTimeout(e.refresh?.timer),delete e.refresh},v=e=>{let t=e.refresh;t?.accepted&&e.card&&e.card.revision>t.baseline&&(clearTimeout(t.timer),t.state=`updated`)},y=(e,t)=>{let n=t instanceof Gn&&h(t.details)&&t.details.code===`SESSION_PARTICIPATION_REQUIRED`;e.error=n?`access-denied`:`unavailable`,e.dirty=!0,n&&(e.card=null),g()},b=(e,t)=>{n.delete(e),n.set(e,t);let r=m();for(;n.size>ax;){let e=[...n].find(([e,t])=>!r.has(e)&&!t.load&&t.refresh?.state!==`pending`);if(!e)break;_(e[1]),n.delete(e[0])}},x=()=>e.snapshot.phase===`connected`&&e.snapshot.client!==null,S=(e,t)=>{if(e.pendingRefreshRevision===null||t===null){e.pendingRefreshRevision=null;return}(e.pendingRefreshRevision===void 0||t>e.pendingRefreshRevision)&&(e.pendingRefreshRevision=t)},C=e=>{let t=e.pendingRefreshRevision;return t!=null&&e.card!==null&&e.card!==void 0&&e.card.revision>=t},w=async t=>{let r=p(t);if(!r.target.sessionKey||!x())return null;let i=n.get(r.key)??{target:r.target,wireKey:r.wireKey,generation:0,dismissalGeneration:0,dirty:!0};if(b(r.key,i),!i.dirty&&i.card!==void 0)return i.card;if(i.load)return i.load;c.transition(e.snapshot);let a=c.capture();if(!a)return null;let s=i.generation,l=()=>n.get(r.key)===i&&i.generation===s&&c.isCurrent(a)&&e.snapshot.client===a.client,u=!1,d=a.client.request(nx,$b(i.target)).then(e=>{let t=Zb(e,i.wireKey);return l()?t===null&&i.pendingRefreshRevision!==void 0?(u=!0,i.dirty=!0,i.card??null):(i.card=t,o(r.key,i.target,t),i.dirty=i.pendingRefreshRevision!==void 0&&!C(i),delete i.error,v(i),g(),t):null}).catch(e=>{throw l()&&y(i,e),e}).finally(()=>{if(i.load===d&&(delete i.load,n.get(r.key)===i)){b(r.key,i);let e=u||i.pendingRefreshRevision!==void 0&&!C(i);delete i.pendingRefreshRevision,e&&m(!0).has(r.key)&&w(i.target).catch(()=>void 0)}});return i.load=d,b(r.key,i),d},ee=()=>{for(let e of m(!0).values())w(e).catch(()=>void 0)},E=e=>{if(c.transition(e)){for(let e of n.values())_(e);g()}let t=e.client!==l,i=x(),a=i&&!u;if(!i&&u)for(let e of n.values())e.dirty=!0,delete e.load,delete e.pendingRefreshRevision;u=i,(t||a)&&(t&&(l=e.client,n.clear(),r.clear(),g()),ee())},te=t=>{if(t.event===`sessions.changed`&&h(t.payload)){if(t.payload.reason!==`reset`&&t.payload.reason!==`delete`)return;let i=at(t.payload);if(!i)return;let a=t=>Ne({hello:e.snapshot.hello,assistantAgentId:t.agentId,sessionKey:t.sessionKey},i.key,i.agentId);for(let[e,{target:t}]of r)a(t)&&r.delete(e);let o=!1;for(let[e,t]of n)a(t.target)&&(_(t),n.delete(e),o=!0);o&&g(),ee();return}if(t.event!==ix||!h(t.payload))return;let{sessionKey:i,revision:a}=t.payload;if(typeof i!=`string`||a!==null&&(typeof a!=`number`||!Number.isInteger(a)))return;let o=m(!0),s=[...n].filter(([,e])=>e.wireKey===i);for(let[e,t]of s)if(!(!t.load&&!t.dirty&&a!==null&&t.card!==null&&t.card!==void 0&&t.card.revision>=a)){if(t.dirty=!0,delete t.error,t.dismissalGeneration+=1,t.load){S(t,a);continue}t.generation+=1,!t.load&&o.has(e)&&w(t.target).catch(()=>void 0)}},ne=()=>{d||f||(c.transition(e.snapshot),e.snapshot.client!==l&&(l=e.snapshot.client,n.clear(),r.clear()),u=x(),d=e.subscribe(E),f=e.subscribeEvents(te))},re=()=>{if(!(t.size>0||s.size>0)){d?.(),f?.(),d=null,f=null;for(let e of n.values())_(e);n.clear()}},D=(e,n,r)=>{let i=n.filter(e=>e.sessionKey.trim()).map(({sessionKey:e,agentId:t})=>({sessionKey:e,agentId:t}));if(i.length===0){t.delete(e),re();return}t.set(e,{targets:i,...r}),ne();for(let e of i)r?.admitAutomaticRead?.()!==!1&&w(e).catch(()=>void 0)};return{watch:D,unwatch:e=>D(e,[]),load:w,refresh:(t,r)=>{c.transition(e.snapshot);let i=c.capture(),a=p(t),o=n.get(a.key);if(!i||!o||o.card!==r||o.refresh?.state===`pending`)return;let s=o.refresh?.state===`failed`||o.refresh?.state===`timeout`,l={state:`pending`,idempotencyKey:o.refresh&&o.refresh.state!==`updated`&&!o.refresh.retryNewIntent?o.refresh.idempotencyKey:T(),baseline:o.refresh&&o.refresh.state!==`updated`&&!o.refresh.retryNewIntent?o.refresh.baseline:r.revision,accepted:!1};_(o),o.refresh=l;let u=()=>n.get(a.key)===o&&o.refresh===l&&c.isCurrent(i)&&e.snapshot.client===i.client;l.timer=setTimeout(()=>{u()&&l.state===`pending`&&(l.state=`timeout`,g())},ox);let d={...$b(o.target),idempotencyKey:l.idempotencyKey};g(),i.client.request(`progressCard.refresh`,d).then(e=>{if(u()){if(e.status!==`accepted`||typeof e.runId!=`string`||!e.runId||!Number.isInteger(e.revision)||e.revision<1)throw Error(`Progress refresh response was invalid`);l.baseline=Math.max(l.baseline,e.revision),l.accepted=!0,v(o),g()}}).catch(e=>{u()&&(clearTimeout(l.timer),l.retryNewIntent=e instanceof Gn&&h(e.details)&&e.details.code===`PROGRESS_CARD_REFRESH_TERMINAL`,l.state=`failed`,g())}),s&&u()&&(o.dirty=!0,w(o.target).catch(()=>void 0))},getRefreshState:e=>n.get(p(e).key)?.refresh?.state,dismiss:async(t,r)=>{c.transition(e.snapshot);let i=c.capture();if(!i)return!1;let a=p(t),s=n.get(a.key);if(!s||s.card!==r)return!1;let l=s.generation,u=s.dismissalGeneration,d=()=>n.get(a.key)===s&&c.isCurrent(i)&&e.snapshot.client===i.client,f=Zb(await i.client.request(rx,{...$b(s.target),expectedRevision:r.revision}).catch(e=>{throw d()&&s.generation===l&&s.dismissalGeneration===u&&y(s,e),e}),s.wireKey);if(!d())return!1;let m=f===null;if(f?s.generation===l&&s.dismissalGeneration===u:s.card?.revision===r.revision){let e=s.load!==void 0&&(s.generation===l||s.pendingRefreshRevision!==void 0);e&&(s.generation+=1,S(s,null)),s.card=f,o(a.key,s.target,f),s.dirty=e,delete s.error,b(a.key,s),g()}return m},get:e=>n.get(p(e).key)?.card,getLifetime:e=>(a(),r.get(p(e).key)?.token),getError:e=>n.get(p(e).key)?.error,subscribe:e=>(s.add(e),ne(),()=>{s.delete(e),re()})}}function tx(e){let t=sx.get(e);if(t)return t;let n=ex(e);return sx.set(e,n),n}var nx,rx,ix,ax,ox,sx;function cx(){return(cx=e((()=>{fe(),ir(),nr(),Le(),V(),c(),nx=`progressCard.get`,rx=`progressCard.put`,ix=`progressCard.changed`,ax=100,ox=12e4,sx=new WeakMap})))()}var lx;function ux(){return(ux=e((()=>{t(),lx=class{constructor(){this.activeSessionKey=``,this.activationObserved=!1,this.requested=!1}beginActivation(e){this.activeSessionKey=e.trim(),this.activationObserved=!1,this.activationMarkedUnreadAt=void 0,this.requested=!1}shouldPatch(e,t,n){let r=e.trim(),i=n??void 0;return r!==this.activeSessionKey&&this.beginActivation(r),r?(this.activationObserved||(this.activationObserved=!0,this.activationMarkedUnreadAt=i),t===!1?i===void 0&&(this.activationMarkedUnreadAt=void 0,this.requested=!1,!1):i!==void 0&&i!==this.activationMarkedUnreadAt||t!==!0||this.requested?!1:(this.requested=!0,!0)):!1}patchFailed(e,t){if(e.trim()===this.activeSessionKey){let e=E(t)?.gatewayCode;this.requested=e===s.INVALID_REQUEST||e===s.FORBIDDEN||e===s.APPROVAL_NOT_FOUND}}}})))()}var dx,fx;function px(){return(px=e((()=>{W(),dx={mcpServers:{signIn:`Sign in`,authenticationSaved:`Authentication saved`,signInFailed:`Sign-in did not finish. Check the connector settings and try again.`,signInExpired:`This sign-in session ended. Close the dialog and sign in again.`,profileSignIn:`Sign in through the linked account in Models.`,requesterSignIn:`Each person signs in through this connector in chat.`,add:`Add server`,adding:`Adding…`,nameLabel:`Name`,transportLabel:`Transport`,transportStreamableHttp:`Streamable HTTP`,transportSse:`SSE`,transportStdio:`Stdio`,targetLabel:`URL or command`,nameInvalid:`Server names use letters, numbers, dots, dashes, or underscores.`,targetInvalid:`Enter a URL for HTTP transports or a valid command line for stdio.`,sessionEnableFailed:`The server was saved disabled globally, but enabling it for this session failed: {error}`,sessionChanged:`The active session changed before it could be enabled.`,sessionUnavailable:`The active session is unavailable; refresh and try again.`,nameTaken:`An MCP server named “{name}” already exists.`,missing:`MCP server “{name}” was not found in the configuration.`,missingTransport:`missing transport`,addedSuccess:`Added MCP server {name}.`,enabledSuccess:`Enabled MCP server {name}.`,disabledSuccess:`Disabled MCP server {name}.`,removedSuccess:`Removed MCP server {name}.`,configUnavailable:`Configuration is unavailable; refresh and try again.`,connectRequired:`Connect to the gateway to change MCP servers.`,adminRequired:`MCP server changes require operator.admin access.`,enable:`Enable`,disable:`Disable`,removeNamed:`Remove {name}`,working:`Working…`},mcpPage:{intro:`Connect and manage MCP servers that provide tools to OpenClaw.`,servers:`Servers`,oauth:`OAuth`,filtered:`Filtered`,configuredServers:`Configured servers`,noServers:`No MCP servers configured.`,setUpFirstServer:`Set up your first MCP server`,operatorCommands:`MCP operator commands`,operatorCommandsHint:`Status, diagnostics, auth, probing, and runtime reload.`,runtimeHint:`Edits save automatically. With automatic reload enabled, MCP connections rebuild on next use.`,toolFilter:`tool filter`,parallel:`parallel`,tlsVerifyOff:`TLS verify off`,mtls:`mTLS`}},fx=Object.assign(()=>{Object.assign(R.mcpServers,dx.mcpServers),Object.assign(R.mcpPage,dx.mcpPage)},{catalog:dx})})))()}function mx(e){let t=[],n=``,r=null,i=!1;for(let a=0;a<e.length;a+=1){let o=e[a]??``;if(o===`\\`&&r===`"`){let t=1;for(;e[a+t]===`\\`;)t+=1;e[a+t]===`"`?(n+=`\\`.repeat(Math.floor(t/2)),t%2==0?r=null:n+=`"`,a+=t):(n+=`\\`.repeat(t),a+=t-1),i=!0;continue}if(o===`\\`&&r===null){let t=e[a+1];t&&(t===`"`||t===`'`||/\s/u.test(t))?(n+=t,i=!0,a+=1):(n+=o,i=!0);continue}if(r){o===r?r=null:n+=o,i=!0;continue}if(o===`'`||o===`"`){r=o,i=!0;continue}if(/\s/u.test(o)){i&&=(t.push(n),n=``,!1);continue}n+=o,i=!0}return r?null:(i&&t.push(n),t)}function hx(e,t){if(t!==`stdio`)return wr(e)?{url:e,transport:t}:null;if(/^https?:\/\//i.test(e))return null;let[n,...r]=mx(e.trim())??[];return n?r.length>0?{command:n,args:r}:{command:n}:null}function gx(e){if(!e)return null;let t=E(E(e.mcp)?.servers)??{};return Object.entries(t).map(([e,t])=>{let n=E(t)??{},r=typeof n.url==`string`?n.url:``,i=typeof n.command==`string`?n.command:``,a=E(n.oauth),o=i?`stdio`:r?n.transport===`streamable-http`?`streamable-http`:n.transport===void 0||n.transport===`sse`?`sse`:`invalid`:`invalid`;return{name:e,enabled:n.enabled!==!1,transport:o,target:i||_e(r),auth:typeof n.auth==`string`?n.auth:null,signIn:n.auth===`oauth`?a?.authProfileId?`profile`:a?.identity===`per-requester`?`requester`:o!==`stdio`&&o!==`invalid`&&hx(r,o)?`operator`:null:null,toolFilter:!!n.toolFilter,parallel:n.supportsParallelToolCalls===!0,tls:n.sslVerify===!1?`verify-off`:n.clientCert||n.clientKey?`mtls`:null}}).toSorted((e,t)=>e.name.localeCompare(t.name))}function _x(e,t,n){return Object.hasOwn(e,t)?{error:B(`mcpServers.nameTaken`,{name:t})}:{patch:{[t]:n}}}function vx(e,t,n){return Object.hasOwn(e,t)?{patch:{[t]:{enabled:n?null:!1}}}:{error:B(`mcpServers.missing`,{name:t})}}function yx(e,t){return Object.hasOwn(e,t)?{patch:{[t]:null},replacePaths:Ln(e[t],`mcp.servers.${t}`)}:{error:B(`mcpServers.missing`,{name:t})}}async function bx(e,t){try{return await e.ensureLoaded(),await e.patchFromSnapshot(e=>{let n=E(E(e.mcp)?.servers)??{},r=t.buildPatch(n);return`error`in r?r:{options:{raw:{mcp:{servers:r.patch}},note:t.note,...r.replacePaths?.length?{replacePaths:r.replacePaths}:{}}}})?(await e.refresh(),{ok:!0}):{ok:!1,error:e.state.lastError??B(`mcpServers.configUnavailable`)}}catch(e){return{ok:!1,error:I(e)}}}var xx;function Sx(){return(Sx=e((()=>{ve(),Er(),jn(),U(),px(),H(),fx(),xx=/^[a-zA-Z0-9][a-zA-Z0-9._-]*$/})))()}function Cx(e,t){return e!=null&&Object.hasOwn(e,t)?e[t]:void 0}function wx(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0})}function Tx(e){return{...e?.mcpServers?{mcpServers:{...e.mcpServers}}:{},...e?.mcpToolsDeny?{mcpToolsDeny:Object.fromEntries(Object.entries(e.mcpToolsDeny).map(([e,t])=>[e,[...t]]))}:{},...e?.skills?{skills:{...e.skills}}:{},...e?.webSearch===void 0?{}:{webSearch:e.webSearch}}}function Ex(e,t){return t??e}function Dx(e,t){return e&&(t??e)}function Ox(e,t,n,r,i){let a=Tx(e),o=(Object.hasOwn(a,t)?a[t]:void 0)??{};return r===i?delete o[n]:wx(o,n,r),Object.keys(o).length===0?delete a[t]:a[t]=o,a}function kx(e,t,n=!0){let r=Tx(e);return n?(t===n?delete r.webSearch:r.webSearch=t,r):(r.webSearch===!0&&delete r.webSearch,r)}function Ax(e,t,n,r){let i=Tx(e),a=Object.hasOwn(i,`mcpToolsDeny`)?i.mcpToolsDeny:void 0,o=new Set(Cx(a,t)??[]);r?o.add(n):o.delete(n);let s=a??{};return o.size>0?wx(s,t,[...o].toSorted()):delete s[t],Object.keys(s).length===0?delete i.mcpToolsDeny:i.mcpToolsDeny=s,i}function jx(e){return Object.keys(e?.mcpServers??{}).length+Object.keys(e?.skills??{}).length+Object.keys(e?.mcpToolsDeny??{}).length+(e?.webSearch===void 0?0:1)}function Mx(){return(Mx=e((()=>{})))()}var Nx,Px;function Fx(){return(Fx=e((()=>{W(),Nx={skillDiscovery:{search:`Search skills`,settings:`Skill settings`,libraryStatus:`Library skill. Session selections control when it is used.`},skillLibrary:{library:`Skill library`,mine:`My skills`,team:`Team`,all:`All libraries`,inventory:`Agent & workspace`,create:`Create skill`,import:`Import skill`,save:`Save skill`,propose:`Save workspace proposal`,apply:`Apply to workspace`,slug:`Skill name`,slugHelp:`Use 1–63 lowercase letters, digits, or hyphens; start with a letter or digit.`,description:`Description`,file:`File`,newFile:`New text file path`,addFile:`Add file`,deleteFile:`Delete file`,deleteFileConfirm:`Remove {path} from the next saved bundle?`,fileExists:`That file already exists. Select it to edit its contents.`,binary:`Binary attachment. Its original bytes are preserved when you save.`,binaryRead:`Binary attachment retained with this revision.`,readOnly:`You can read this skill. Only its owner or an authorized administrator can edit it.`,personalTarget:`My skills. Save to your personal library; existing session selections change only when you explicitly attach or refresh.`,workspaceTarget:`Workspace: {agent}. Save creates a Workshop proposal; apply it after review.`,technicalDetails:`Skill details`,skillId:`Skill ID`,command:`Command`,ownerRevision:`{owner} · revision {revision}`,executable:`Executable supporting file`,defaultLimit:`New sessions select up to {count} default skills. Existing sessions keep their selected revisions.`,session:{selected:`Selected for this session`,attachable:`Add from your libraries`,pin:`Selected revision {revision}`,read:`Read selected revision`,empty:`No managed skills selected.`,refresh:`Refresh revision`,attachNamed:`Attach {name} · {owner}`,detach:`Detach`,queued:`Skill selections updated for the next turn. An active turn keeps its current revision.`,readOnly:`This is the exact revision selected for this session. Session access allows reading this pin, not editing its library or browsing other revisions.`},search:`Search names, descriptions, and owners`,empty:`No skills in this library. Create one or import a bundle.`,you:`You`,shared:`Shared with team`,private:`Private`,share:`Share with team`,unshare:`Make private`,transfer:`Transfer to team`,remove:`Remove skill`,enable:`Enable`,disable:`Disable`,revision:`Retained revision`,selectRevision:`Select a revision`,rollback:`Restore revision`,discard:`Discard your unsaved skill changes?`,conflict:`This skill changed since you opened it. Your draft is preserved. Copy your changes, then close and reopen the skill to review the current revision before saving.`,signIn:`Sign in with a Gateway profile to create personal skills. Administrators can still create skills in the selected agent workspace.`,connectionChanged:`The Gateway connection changed. Reopen the skill before saving.`,selectAgent:`Select an agent workspace before creating a skill.`,workspaceTextOnly:`Workshop imports support UTF-8 text files. Keep executable and binary assets in the file-authored workspace workflow.`,bundleLimit:`Use at most 256 files, 1 MiB per file, and 8 MiB per bundle or ZIP.`,missingSkill:`Choose SKILL.md together with its supporting files, or a folder containing SKILL.md at its root.`,uploadFailed:`The Gateway did not confirm the upload. Check your library before retrying the import.`,pending:`Proposal {id} saved for workspace {agent}. It is pending review and is not active yet.`,workspaceSaved:`Workspace {agent}: {state}. Start a new session to use the skill.`,importHelp:`Import a skill into your private library.`,importWorkspace:`Prepare a skill for review in the selected workspace.`,importClawHub:`Import {source} into your private library.`,files:`Files`,filesHelp:`SKILL.md with supporting files, a folder, or a ZIP (saved on import).`,workspaceFilesHelp:`SKILL.md with supporting text files, or a folder.`,chooseFilesButton:`Choose files`,chooseFolderButton:`Choose folder`,noFilesSelected:`No files selected.`,selectedFile:`{count} file · {names}`,selectedFiles:`{count} files · {names}`,clearSelection:`Clear`,confirm:{remove:`Remove {slug} from the library?`,transfer:`Transfer {slug} to team ownership? Team administrators will manage it.`},receipt:{published:`Saved {slug} to {target} library (owner: {owner}).`,unchanged:`Unchanged: {slug} in {target} library (owner: {owner}).`,removed:`Removed {slug} from {target} library (owner: {owner}).`}}},Px=Object.assign(()=>{R.skillLibrary=Nx.skillLibrary,R.skillDiscovery=Nx.skillDiscovery},{catalog:Nx})})))()}function Ix(e,t){if(!e||!t)return{models:[],hasSnapshot:!1,retired:!1};let n={agentId:t},r=Bx(e,n,{allowStale:!0});return{...r,models:r?.models??[],hasSnapshot:r!==void 0,retired:$t(e,n)}}function Lx(e,t){let n=nt.get(e)??new Set;return nt.set(e,n),n.add(t),()=>{n.delete(t),n.size===0&&nt.delete(e)}}function Rx(e,{connected:t=!0,loading:n=!1,error:r=null,retired:i=!1,initialized:a=!0}={}){return{hasSnapshot:a&&!i&&(e.models.length>0||!n&&!r),initialized:a,retired:i,modelSelectionPolicy:e.modelSelectionPolicy,refreshFailed:e.refreshFailed,pendingProviders:e.pendingProviders,status:t?r?`error`:n?`loading`:a?`ready`:`idle`:`offline`}}function zx(e,t){return e.refreshFailed?t??B(e.models.length?`chat.modelControls.modelsRefreshFailed`:`chat.modelControls.modelsUnavailable`):null}function Bx(e,t,{allowStale:n=!1}={}){let r=et.get(e)?.entries,i=Zt(Pe(t)),a=r?.get(i);if(a?.expiresAt!==void 0&&a.expiresAt<=Date.now()&>(e,a),!a?.invalidated||n)return r&&a?.result&&(r.delete(i),r.set(i,a)),a?.result}function Vx(e,t){let n=Zt(Pe(t)),r=Array.from(et.get(e)?.requests.get(n)?.values()??[]).map(e=>e.active?.transportSettled).filter(e=>e!==void 0);return r.length?Promise.allSettled(r).then(()=>{}):void 0}function Hx(e){let{client:t,cache:n,lane:r,timeoutMs:i}=e,a=new AbortController,o=Se(),s=Se(),c=typeof i==`number`&&Number.isFinite(i)?f(i,{minMs:0}):void 0,l=c===void 0?void 0:Date.now()+c,u,d=!1,p=!1,m=()=>!v.settled&&!a.signal.aborted&&v.subscribers.size>0&&et.get(t)===n&&n.reads.has(v.read)&&r.active===v&&!r.queued,h=()=>{clearTimeout(u),n.reads.delete(v.read),v.settled=!0,r.queued===v&&(r.queued=void 0,e.releaseLane())},_=()=>{if(s.resolve(),r.active!==v)return;r.active=void 0;let i=r.queued;i&&et.get(t)===n&&(r.queued=void 0,r.active=i,i.start()),e.releaseLane()},v={refresh:e.scope.refresh===!0,controller:a,read:Ft(t,e.scope,a.signal),preparing:!0,settled:!1,subscribers:new Set,promise:o.promise,transportSettled:s.promise,resolve:e=>{v.settled||(h(),o.resolve(e))},reject:e=>{v.settled||(h(),o.reject(e))},start:()=>{if(d)return;if(d=!0,v.settled){_();return}let n=l===void 0?void 0:l-Date.now();if(e.queued&&c!==void 0&&n!==void 0&&n<=0){v.reject(new D({method:`models.list`,timeoutMs:c,requestSent:!1})),_();return}let r=v.read,a={...e.scope,...v.refresh?{refresh:!0}:{}};(async()=>{let e=!1;for(;;)try{let e=await(i===void 0?t.request(`models.list`,a):t.request(`models.list`,a,{timeoutMs:c===void 0?i:null,...c===void 0?{}:{onSent:()=>{p=!0}}}));je(r,a,e),v.resolve(e);return}catch(n){if(e||!g(n)||n.gatewayCode!==`UNAVAILABLE`||!n.retryable||!m()){v.reject(n);return}e=!0;let r=Se(),i=setTimeout(r.resolve,f(n.retryAfterMs??0,{minMs:0})),a=Lx(t,()=>{m()||r.resolve()});o.promise.then(()=>r.resolve(),()=>r.resolve());try{await r.promise}finally{clearTimeout(i),a()}if(l!==void 0&&c!==void 0&&l<=Date.now()){v.reject(new D({method:`models.list`,timeoutMs:c,requestSent:p}));return}if(!m()){v.reject(n);return}}})().catch(v.reject).finally(_)}};return a.signal.addEventListener(`abort`,()=>v.reject(a.signal.reason),{once:!0}),c!==void 0&&(u=setTimeout(()=>v.reject(new D({method:`models.list`,timeoutMs:c,requestSent:p})),c)),v}async function Ux(e,t){let{signal:n,timeoutMs:r,...i}=t;n?.throwIfAborted();let a=Pe(i);if(!a.refresh){let t=Bx(e,a);if(t)return t}let o=xt(e),s=Zt(a),c=o.requests.get(s)??new Map;o.requests.set(s,c);let l=c.get(r)??{};c.set(r,l);let u=()=>{!l.active&&!l.queued&&(c.delete(r),c.size===0&&o.requests.delete(s))},d=l.queued??l.active;if(d&&!d.settled&&!d.controller.signal.aborted&&(d.preparing||!a.refresh&&o.reads.has(d.read)))return await om(d,{},n);let f=l.queued!==void 0,p=l.queued??Hx({client:e,scope:a,timeoutMs:r,cache:o,lane:l,queued:l.active!==void 0,releaseLane:u});l.active?l.queued=p:l.active=p,p.preparing=!0,p.refresh||=a.refresh===!0;let m=om(p,{},n);return a.refresh&&en(e),et.get(e)===o?(f||a.refresh)&&(o.reads.delete(p.read),p.read=Ft(e,{...a,...p.refresh?{refresh:!0}:{}},p.controller.signal)):p.reject(new DOMException(`Model catalog connection retired`,`AbortError`)),p.preparing=!1,l.active===p&&p.start(),await m}function Wx(e,t,n){return e.subscribeEvents(e=>{let r=De(e);if(r)t(r);else if(e.event===`models.snapshot`&&n){let r=e.payload;Zt(Pe(n))===Zt(Pe(r.scope))&&t(`refresh`)}})}function Gx(){return(Gx=e((()=>{u(),ne(),se(),U(),wy(),Yt(),Cy()})))()}function Kx(e,t){for(let n of Array.from(e.listeners.keys()))try{n(t)}catch(e){console.error(`[chat-metadata] listener error:`,e)}}function qx(e){return JSON.stringify([e.agentId?.trim()??``,e.sessionKey??null,e.authProfileId??null])}function Jx(e,t){let n=qx(t),r=Nt.get(e);if(!r){let t=new Map;r={entries:t,invalidate:(e,n,r)=>{if(r!==void 0&&r?.catalogChanged!==!0&&(!e&&r?.reason!==`delete`&&r?.reason!==`cleanup`||r?.phase!==`reset`&&![`reset`,`patch`,`command-metadata`,`create`,`new`,`delete`,`recovery`,`cleanup`].some(e=>e===r?.reason)))return;let i=Array.from(t.values()).filter(t=>(r===void 0||e!==void 0||t.scope.sessionKey!==void 0)&&(n&&e?.sessionKey?tt(n,t.scope.sessionKey,e.sessionKey,e.agentId,t.scope.agentId):(!e?.agentId||t.scope.agentId===e.agentId)&&(!e?.sessionKey||t.scope.sessionKey===e.sessionKey))&&(!e?.authProfileId||t.scope.authProfileId===e.authProfileId)),a=e?.sessionKey!==void 0&&zt(r);for(let e of i)e.refreshRevision+=1,e.refreshAfter=a?Date.now()+cS:void 0,e.validateCatalog=a&&e.listeners.size>0,e.result=void 0,e.writer=void 0;for(let t of i)Kx(t,{type:`invalidated`,scope:a?`session`:`full`,refreshSessionFacts:a||r===void 0&&!e?.sessionKey}),t.release()}},Nt.set(e,r)}let i=r.entries,a=i.get(n);if(a)i.delete(n),i.set(n,a);else{let r=Pe(t),o=Zt(r),s={scope:t,listeners:new Map,refreshRevision:0,catalogRevision:0,release:()=>{s.listeners.size===0&&!s.activeRequest&&!s.queuedRequest&&(!s.result||i.size>sS)&&(s.writer=void 0,i.get(n)===s&&(i.delete(n),c()))}},c=Lx(e,e=>{e.type===`invalidated`&&e.matches(r,o)&&(s.catalogRevision+=1)});a=s,i.set(n,a);for(let e of i.values()){if(i.size<=sS)break;e!==a&&e.release()}}return a}function Yx(e){return new Promise(t=>{globalThis.setTimeout(t,e)})}async function Xx(e,t,n){if(n===void 0)return e.request(`chat.metadata`,t);let r;for(;;){let i=n-Date.now();if(i<=0)throw r??Error(`New-session metadata retry deadline elapsed`);try{return await e.request(`chat.metadata`,t,{timeoutMs:Math.min(we,i)})}catch(e){let t=e instanceof Error?e:Error(`New-session metadata request failed`,{cause:e}),i=be(t);if(i===null)throw t;let a=n-Date.now();if(a<=0)throw t;r=t,await Yx(Math.min(i,a))}}}function Zx(e,t,n){return ge([e.map(({manualSelectionAllowed:e,runtimeChoices:t,...n})=>({...n,...t?{runtimeChoices:t.map(({manualSelectionAllowed:e,...t})=>t)}:{}})),t,n])}function Qx(e,t){let n={};t.writer=n;let r=()=>t.writer===n;return{isCurrent:r,publish:n=>{let{models:i,accountSelection:a,modelSelectionPolicy:o,...s}=n;if(r()){let n=!1;if(t.validateCatalog){t.validateCatalog=!1;let r=Bx(e,t.scope);(!r||i===void 0||Zx(i,a,o)!==Zx(r.models,r.accountSelection,r.modelSelectionPolicy))&&(en(e,t.scope),n=!0)}t.result=s,Kx(t,{type:`result`,result:s,...n?{catalogChanged:!0}:{}})}return t.release(),s},fail:e=>{r()&&Kx(t,{type:`error`,error:e}),t.release()}}}function $x(e,t,n,r){let i=Qx(e,t),a=t.queuedRequest;if(a)return a.publication=i,a.revalidation||=n,a.setStartupRetryDeadline(r),Kx(t,{type:`loading`}),a.promise;let{promise:o,resolve:s,reject:c}=Se(),l=!1,u=r,d,f={promise:o,publication:i,revalidation:n,setStartupRetryDeadline:e=>{l||e===void 0||(u=Math.min(u??e,e),t.queuedRequest===f&&(clearTimeout(d),d=setTimeout(()=>{if(t.queuedRequest!==f)return;t.queuedRequest=void 0;let e=Error(`New-session metadata retry deadline elapsed`);f.publication.fail(e),c(e),t.release()},Math.max(0,u-Date.now()))))},start:()=>{l=!0,clearTimeout(d);let n=f.publication;(async()=>{try{let r=await Xx(e,t.scope,u).finally(()=>{t.activeRequest=void 0;let e=t.queuedRequest;t.queuedRequest=void 0,e&&(t.activeRequest=e,e.start())});s(n.publish(r))}catch(e){n.fail(e),c(e)}finally{t.release()}})()}};return t.activeRequest?t.queuedRequest=f:t.activeRequest=f,f.setStartupRetryDeadline(r),Kx(t,{type:`loading`}),t.activeRequest===f&&f.start(),o}function eS(e,t){return Nt.get(e)?.entries.get(qx(t))?.result}function tS(e,t,n,r=()=>!0){let i=Jx(e,t);return i.listeners.set(n,r),()=>{i.listeners.delete(n),(t.sessionKey||t.authProfileId)&&i.listeners.size===0&&(i.refreshRevision+=1,i.writer=void 0,i.validateCatalog&&(i.validateCatalog=!1,en(e,t))),i.refresh?.start(),i.release()}}function nS(e,t){let n=Jx(e,t);if(n.result)return Promise.resolve(n.result);let r=n.queuedRequest??n.activeRequest;return r?.publication.isCurrent()?r.promise:$x(e,n,!1)}function rS(e,t,n){let r=Jx(e,t),i=r.queuedRequest??r.activeRequest,a=n?.startupRetryWindowMs===void 0?void 0:Date.now()+n.startupRetryWindowMs;return i?.publication.isCurrent()&&(i.revalidation||i===r.queuedRequest)?(i.revalidation=!0,i.setStartupRetryDeadline(a),i.promise):$x(e,r,!0,a)}function iS(e,t){let n=Jx(e,t),{isCurrent:r,publish:i}=Qx(e,n);return Kx(n,{type:`loading`}),{isCurrent:r,publish:i}}function aS(e,t){let n=Jx(e,t);n.refreshRevision+=1,n.refreshAfter=void 0;let r=n.refresh;n.refresh=void 0,r?.start()}function oS(e,t,n){let r=Jx(e,t);Bx(e,t);let i=r.refresh,a=n?.kind===void 0&&i?.revision===r.refreshRevision&&!i.metadataRequired,o=n?.kind!==`startup`&&!a;if(i?.phase===`waiting`)return i.metadataRequired||=o,i.revalidateMetadata=n?.revalidateMetadata??i.revalidateMetadata,i.revision=r.refreshRevision,i.catalogRevision=r.catalogRevision,i.start(),i;if(i&&i.phase!==`inactive`&&i.revision===r.refreshRevision&&i.catalogRevision===r.catalogRevision&&!n?.revalidateMetadata&&(!o||i.metadataRequired||n?.kind===void 0))return i;let s=r.refreshRevision,c=r.catalogRevision,l=i?.revision===s&&i.catalogRevision===c&&i.phase!==`inactive`&&n?.kind===`metadata`?i.catalog:void 0,u=Se(),d=Se(),f=!1,p,m={catalog:u.promise,completed:d.promise,revision:s,catalogRevision:c,phase:`waiting`,metadataRequired:o,revalidateMetadata:n?.revalidateMetadata,isCurrent:()=>Nt.get(e)?.entries.get(qx(t))===r&&m.revision===r.refreshRevision&&m.catalogRevision===r.catalogRevision,start:()=>{if(m.phase!==`waiting`)return;clearTimeout(p),Bx(e,t);let n=r.refresh===m,i=n&&Array.from(r.listeners.values()).some(e=>e()),a=(r.refreshAfter??0)-Date.now();if(i&&a>0){p=setTimeout(m.start,a);return}i&&m.metadataRequired&&r.queuedRequest&&nS(e,t);let o=s===r.refreshRevision&&c===r.catalogRevision?l:void 0,h=o&&i?void 0:Vx(e,t),g=[r.activeRequest?.promise,h].filter(e=>e!==void 0);if(n&&g.length){f||(f=!0,Promise.allSettled(g).then(()=>{f=!1,m.start()}));return}if(!i){m.phase=`inactive`,u.resolve(void 0),d.resolve(),r.release();return}m.phase=`admitted`,m.revision=r.refreshRevision,m.catalogRevision=r.catalogRevision;let _=o??Ux(e,t),v=m.metadataRequired?m.revalidateMetadata?.()?rS(e,t):nS(e,t):Promise.resolve();_.then(u.resolve,u.reject),Promise.allSettled([v,u.promise]).then(()=>{d.resolve(),r.release()})}};return r.refresh=m,m.start(),m}var sS,cS;function lS(){return(lS=e((()=>{ne(),de(),oe(),se(),Yt(),Gx(),V(),qt(),sS=64,cS=2500})))()}function uS(e,t,n){let r=n===void 0?Jn(Zn(e?.snapshot)??[],t?.trim()):l(n);return r?ps({id:r.id??r.email,name:r.name,identity:r.identity,profileAvatarUrl:r.avatarUrl}):null}function dS(){return(dS=e((()=>{hs()})))()}function fS(e,t,n,r){let i=n.trim();if(!i)return;let a=A(i);t.has(a)||(t.add(a),e.push({value:i,label:r(i)}))}function pS(){return(pS=e((()=>{})))()}function mS(e,t){let n=e?.agentRuntime?.id?.trim(),r=t?.agentRuntime?.id?.trim();return(!e?.modelProvider||e.modelProvider===t?.modelProvider)&&(!e?.model||e.model===t?.model)&&(!n||!r||n===r)}function hS(e,t,n){let r=e?.model||e?.modelProvider?e:t,i=CS(n,r?.modelProvider??null,r?.model??null,e?.agentRuntime?.id),a=[e,mS(e,t)?t:void 0,i].find(e=>e?.thinkingLevels!==void 0||e?.thinkingOptions!==void 0||e?.thinkingDefault!==void 0);if(a)return{agentRuntime:a.agentRuntime,thinkingLevels:a.thinkingLevels??a.thinkingOptions?.map(e=>({id:Z(e),label:e})),thinkingDefault:a.thinkingDefault,reasoning:i?.reasoning}}function gS(e,t,n=[]){return hS(e,t,n)?.thinkingLevels??[]}function _S(e,t,n=[]){let r=gS(e,t,n).map(e=>Z(e.id));return r.length>0?[`default`,...new Set(r.filter(e=>e&&e!=="default"))]:[]}function vS(e,t,n=[]){let r=hS(e,t,n)?.thinkingLevels;if(r===void 0)return B(`common.unknown`);let i=r.map(e=>e.label);return i.length===0?B(`common.none`):(i.includes(`default`)?i:[`default`,...i]).join(`, `)}function yS(e,t,n,r=[]){let i=Yr(e);if(i)return i;let a=A(e);return gS(t,n,r).map(e=>({id:Z(e.id),label:A(e.label)})).find(e=>e.id===a||e.label===a)?.id}function bS(e,t,n,r=[]){return hS(e,t,r)?.thinkingLevels?.some(e=>Z(e.id)===n||Yr(e.label)===n)}function xS(e,t,n){let r=e?.thinkingLevel?.trim(),i=hS(e,t,n);return r?i?.thinkingLevels?.find(e=>Z(e.id)===Z(r))?.label??r:i?.thinkingDefault??B(`common.unknown`)}function SS(e){let t=new Set,n=[];for(let r of e){let e=Z(r.id);fS(n,t,e,()=>ES(e,r.label))}return n}function CS(e,t,n,r){let i=r?.trim(),a=e.find(e=>{let r=e.agentRuntime?.id?.trim();return e.provider===t&&e.id===n&&(!i||!r||i===r||e.runtimeChoices?.some(e=>e.agentRuntime.id===i))});return i&&(a?.agentRuntime?.id||a?.runtimeChoices?.length)?Ey(a,i):a}function wS(e){let t=e.session??e.sessionsResult?.sessions?.find(t=>ft(t.key,e.sessionKey)),n=t?.thinkingLevel,r=typeof n==`string`&&n.trim()?Yr(n)??n.trim():``,i=hS(t,e.defaults??e.sessionsResult?.defaults,e.catalog),a=i?.thinkingLevels??[],o=i?.reasoning===!1&&a.length>0&&a.every(e=>Z(e.id||e.label)===`off`),s=o?[]:a,c=i?.thinkingDefault??``,l=o&&r===`off`?``:r,u=SS(s),d=Z(c),f={value:d,displayLabel:TS(c)},p=l||d,m=u.findIndex(e=>e.value===p),h=l?`override`:`default`,g=l?u[m]?.label??ES(l):f.displayLabel;return{selection:m>=0?{kind:`anchored`,source:h,value:p,displayLabel:g,index:m}:{kind:`unanchored`,source:h,value:p,displayLabel:g},inherited:f,options:u}}function Z(e){return Yr(e)??A(e)}function TS(e){return e?`Inherited: ${DS(Z(e))}`:B(`common.unknown`)}function ES(e,t){let n=Z(e);return!n||n===`off`?`Off`:DS(t?.trim()||n)}function DS(e){let t=A(e);if([`on`,`enable`,`enabled`].includes(t))return`On`;switch(Z(e)){case`adaptive`:return`Adaptive`;case`minimal`:return`Minimal`;case`low`:return`Low`;case`medium`:return`Medium`;case`high`:return`High`;case`xhigh`:return`Extra high`;case`max`:return`Maximum`;case`ultra`:return`Ultra`;default:return e.charAt(0).toUpperCase()+e.slice(1)}}function OS(){return(OS=e((()=>{Fr(),U(),pS(),V()})))()}function kS(e,t){let n=e?.contextBudgetStatus?.promptBudgetBeforeReserve;return typeof n==`number`&&Number.isFinite(n)&&n>0?{tokens:n,fromLastPrompt:!0}:{tokens:e?.contextTokens??t??0,fromLastPrompt:!1}}function AS(){return(AS=e((()=>{})))()}function jS(e){return typeof e==`string`?Mr(e):void 0}function MS(e,t={}){let n=l(e),r=l(n?.messages),i=l(r?.queue),a=jS(l(i?.byChannel)?.webchat)??jS(i?.mode),o=jS(t.effectiveMode),s=jS(t.sessionMode);if(s)return s;if(t.configNeedsApply)return o;if((t.sessionMetadataLoaded!==!1||o)&&(n||o))return a??o??`steer`}function NS(e,t){return er(e)??t}function PS(){return(PS=e((()=>{qr(),va(),ar()})))()}var FS,IS;function LS(){return(LS=e((()=>{W(),FS={chat:{providerReview:{pausedTitle:`Chat paused as a precaution`,stoppedTitle:`Chat stopped as a precaution`,pausedBody:`The provider could not confirm the agent was interpreting your instructions correctly. Review its findings before deciding to continue.`,stoppedBody:`The provider stopped this chat without reviewable findings. This conversation remains stopped; no continuation is available.`,stoppedWithFindingsBody:`The provider stopped this conversation. Review its findings before starting further work.`,review:`Review findings`,findings:`Provider findings`,continuationTitle:`Continuation message`,continuationBody:`Acknowledging sends this exact provider-supplied message:`,acknowledge:`Acknowledge findings and continue`,continuing:`Requesting continuation…`,waiting:`Continuation requested. Waiting for the provider to accept it.`,checkStatus:`Check continuation status`,checkingStatus:`Checking continuation status…`,refreshFailed:`Continuation was requested, but its status could not be refreshed. Check again to see whether it was accepted.`,noContinuation:`Continuation is not available for this conversation. It remains stopped.`,continuationFailed:`Continuation was not accepted. This conversation remains paused.`,queueHelp:`Queued messages stay held. Review and retry each message separately after continuation is accepted.`,queueStopped:`Queued messages remain held.`,queueHoldFailed:`Could not save the queued-message review hold. Free browser storage and try again. No continuation was sent.`,queuedInputHeld:`Held when the provider paused this conversation. Review the findings, then retry this message separately if it is still needed.`}}},IS=Object.assign(()=>Object.assign(R.chat,FS.chat),{catalog:FS})})))()}function RS(e,t,n){if(e.trimStart().startsWith(`/`))return!0;let r=e.slice(0,n),i=r.split(`
`).length-1,a=!1,o;WS??=new ya().disable([`inline`,`linkify`,`replacements`,`smartquotes`,`text_join`]);for(let e of WS.parse(r,{}))if(e.map&&(a=e.map[0]<=i&&e.map[1]>i),a){if([`fence`,`code_block`,`html_block`].includes(e.type))return!0;e.type===`inline`&&e.content&&(o=e.content)}if(o===void 0)return!0;let s=0,c=0,l=0,u=``,d=!1,f=!1,p=!1,m=0;for(let e=0;e<o.length;){let t=o[e++];if(s){if(t!=="`")continue;let n=1;for(;o[e]==="`";)n+=1,e+=1;s===n&&(s=0,m=e);continue}if(f){p?t===`>`&&(f=!1,m=e):u?t===u&&(u=``):t===`"`||t===`'`?u=t:t===`>`&&(f=!1,m=e);continue}if(t===`\\`){e+=1;continue}if(l){d?t===`>`&&(d=!1):u?t===u&&(u=``):(t===`"`||t===`'`)&&/\s/u.test(o[e-2]??``)?u=t:t===`<`&&o[e-2]===`(`?d=!0:t===`(`?l+=1:t===`)`&&--l===0&&(m=e);continue}if(t==="`")for(s=1;o[e]==="`";)s+=1,e+=1;else if(t===`[`)c+=1;else if(t===`]`&&c>0)--c,o[e]===`(`&&(l=1,e+=1);else if(t===`<`){let t=o.slice(e);p=/^[a-zA-Z][a-zA-Z0-9+.-]*:/u.test(t)||/^[^\s<>]*@/u.test(t),f=p||/^[a-zA-Z!?/]/u.test(t)}}if(s||l||f)return!0;let h=o.length-(n-t),g=h,_=/\s/u;for(;g>m&&!_.test(o[g-1]);)--g;let v=o.slice(g,h);if(v.toLowerCase().includes(`www.`)||/[/?#]/u.test(v))return!0;let y=!1;for(let e=0;e<v.length;e+=1){let t=v.charCodeAt(e);if(t===58&&y&&e+1<v.length)return!0;t>=65&&t<=90||t>=97&&t<=122?y=!0:y&&(t>=48&&t<=57||t===43||t===45||t===46)||(y=!1)}return!1}function zS(e){let t=0,n=HS.length;for(;t<n;){let r=t+n>>>1;HS[r]<e?t=r+1:n=r}return t}function BS(e){return Object.hasOwn(Ei,e)?Ei[e]:void 0}function VS(e){let t=[];for(let n=zS(e);n<HS.length&&t.length<12;n+=1){let r=HS[n];if(!r.startsWith(e))break;t.push(r)}return t}var HS,US,WS,GS;function KS(){return(KS=e((()=>{ba(),Ti(),HS=Object.keys(Ei).toSorted(),US=HS.reduce((e,t)=>Math.max(e,t.length),0),GS=class{constructor(){this.context=null,this.snapshot=null}reset(){this.context=null,this.snapshot=null}find(e,t){if(this.snapshot?.value===e&&this.snapshot.caret===t)return this.snapshot.target;let n=this.resolve(e,t);return this.snapshot={value:e,caret:t,target:n},n}resolve(e,t){let n=e.slice(Math.max(0,t-US-1),t),r=/:([a-z0-9_+-]+)$/u.exec(n);if(!r||!HS[zS(r[1])]?.startsWith(r[1]))return this.context=null,null;let i=t-r[0].length;if(/[\p{L}\p{N}_/:\\]$/u.test(e.slice(Math.max(0,i-2),i)))return null;let a=t;for(;a-i<=US&&/[a-z0-9_+-]/u.test(e[a]??``);)a+=1;if(/[a-z0-9_+-]/u.test(e[a]??``))return null;e[a]===`:`&&(a+=1);let o=e.slice(0,i);return this.context?.prefix!==o&&(this.context={prefix:o,literal:RS(e,i,t)}),this.context.literal?null:{start:i,end:a,query:r[1]}}}})))()}var qS,JS;function YS(){return(YS=e((()=>{W(),qS={chat:{pullRequests:{checksQueued:`Queued`,checksSkippedCount:`{count} skipped`,checksLoading:`Loading jobs and steps…`,checksEmpty:`No check details are available for this commit.`,checksUnavailable:`Couldn’t load all CI details. Try again or open the checks on GitHub.`,checksStale:`Some CI details are unavailable or out of date. Try again or open the job on GitHub.`,checksRateLimited:`GitHub’s rate limit was reached. CI details may be out of date.`,checksRetryAfter:`Try again in {duration}.`,checksNoSteps:`This check does not provide GitHub Actions steps.`,checksStepsUnavailable:`Step details are not available yet.`,openJob:`Open job on GitHub`,openCheck:`Open check details`}}},JS=Object.assign(()=>Object.assign(R.chat.pullRequests,qS.chat.pullRequests),{catalog:qS})})))()}function XS(e){if(e.status!==503)return;let t=e.headers?.get(`retry-after`)?.trim();if(!t||!/^\d+$/.test(t))return;let n=Number(t)*1e3;return Number.isSafeInteger(n)&&n>0&&n<=nC?n:void 0}function ZS(e,t){aC.get(e)===t&&(aC.delete(e),t.retryTimer!==void 0&&(clearTimeout(t.retryTimer),t.retryTimer=void 0),t.controller.abort(),t.blobUrl&&URL.revokeObjectURL(t.blobUrl))}function QS(e,t,n,r){return`${n?`stable-miss`:`retry-miss`}\0${r?`retry-503`:`drop-503`}\0${t.join(``)}\0${e}`}function $S(e,t){let n=aC.get(e);n&&(n.consumers.delete(t),!(n.consumers.size>0||n.releaseTimer!==void 0)&&(n.releaseTimer=setTimeout(()=>{n.releaseTimer=void 0,!(aC.get(e)!==n||n.consumers.size>0)&&ZS(e,n)},0)))}async function eC(e,t,n,r,i,a){let o=setTimeout(()=>a.controller.abort(),tC),s=null,c=!1,l;try{for(let e of n.length>0?n:[``]){let n=await qn(t,{...e?{headers:{Authorization:`Bearer ${e}`}}:{},signal:a.controller.signal});if(n.ok){s=URL.createObjectURL(await n.blob());break}if(c=n.status===404,l=i?XS(n):void 0,n.status!==401&&n.status!==403)break}}catch{}finally{clearTimeout(o)}if(aC.get(e)!==a){s&&URL.revokeObjectURL(s);return}if(!s){if(c&&r)return;if(l!==void 0&&a.consumers.size>0){a.retryAttempts<rC?(a.retryAttempts+=1,a.retryTimer=setTimeout(()=>{a.retryTimer=void 0,aC.get(e)===a&&a.consumers.size!==0&&(a.controller=new AbortController,eC(e,t,n,r,i,a))},l)):a.retryEligibleAt=Date.now()+iC;return}ZS(e,a);return}a.blobUrl=s;for(let e of a.consumers.values())e()}var tC,nC,rC,iC,aC,oC;function sC(){return(sC=e((()=>{rr(),tC=3e4,nC=3e4,rC=3,iC=3e4,aC=new Map,oC=class{constructor(e,t={}){this.host=e,this.options=t,this.owner=Symbol(`authenticated-avatar-route-owner`),this.keys=new Set,this.connected=!1,this.onUpdate=()=>{this.connected&&this.host.requestUpdate()},e.addController(this)}hostConnected(){this.connected=!0,this.stopAuthRecovery??=ur(this.onUpdate),this.host.requestUpdate()}hostDisconnected(){this.connected=!1,this.stopAuthRecovery?.(),this.stopAuthRecovery=void 0,this.reset()}reset(){for(let e of this.keys)$S(e,this.owner);this.keys.clear()}withActiveRoutes(e){let t=this.keys;this.keys=new Set;try{return e()}finally{for(let e of t)this.keys.has(e)||$S(e,this.owner)}}resolve(e,t){if(!e.startsWith(`/`))return e;if(!this.connected)return null;let n=this.options.cacheNotFound===!0,r=this.options.retryUnavailable===!0,i=QS(e,t,n,r),a=aC.get(i);return a?a.blobUrl===null&&a.retryTimer===void 0&&a.retryEligibleAt!==void 0&&Date.now()>=a.retryEligibleAt&&(a.retryAttempts=0,a.retryEligibleAt=void 0,a.controller=new AbortController,eC(i,e,t,n,r,a)):(a={blobUrl:null,consumers:new Map,controller:new AbortController,releaseTimer:void 0,retryTimer:void 0,retryAttempts:0,retryEligibleAt:void 0},aC.set(i,a),eC(i,e,t,n,r,a)),a.releaseTimer!==void 0&&(clearTimeout(a.releaseTimer),a.releaseTimer=void 0),a.consumers.set(this.owner,this.onUpdate),this.keys.add(i),a.blobUrl}}})))()}function cC(e){let t=le(e);if(t===void 0)return null;let n=t-Date.now();if(n<=0)return`now`;let r=Math.floor(n/6e4);if(r<1)return`<1m`;if(r<60)return`${r}m`;let i=Math.floor(r/60),a=r%60;if(i<24)return a>0?`${i}h ${a}m`:`${i}h`;let o=Math.floor(i/24);if(o<7){let e=i%24;return e>0?`${o}d ${e}h`:`${o}d`}return new Date(t).toLocaleDateString(void 0,{month:`short`,day:`numeric`})}function lC(e){return Math.max(0,Math.min(100,Math.round(e)))}function uC(e,t){let n=new Map;for(let r of(e?.providers??[]).filter(t)){let e=r.usage;if(!e)continue;let t=(e.windows??[]).map(e=>{let t={label:(e.label||``).trim(),usedPercent:lC(e.usedPercent)};return e.resetAt!==void 0&&(t.resetAt=e.resetAt),t}),i=(e.billing??[]).flatMap(e=>{if(e.type!==`budget`||!Number.isFinite(e.used)||!Number.isFinite(e.limit)||e.used<0||e.limit<=0)return[];let t={used:e.used,limit:e.limit,unit:e.unit};return e.label&&(t.label=e.label),[t]});if(t.length===0&&i.length===0)continue;let a=[...new Set([r.provider,e.providerId].filter(e=>!!e))],o=JSON.stringify([r.displayName,e.accountEmail??null,t,i]),s=n.get(o);if(s){for(let e of a)s.providers.includes(e)||s.providers.push(e);continue}n.set(o,{providers:a,displayName:r.displayName,...e.plan?{plan:e.plan}:{},...e.accountEmail?{accountEmail:e.accountEmail}:{},windows:t,budgets:i})}return[...n.values()]}function dC(){return(dC=e((()=>{fe()})))()}var fC,pC;function mC(){return(mC=e((()=>{W(),fC={chat:{camera:{title:`Take photo`,previewHint:`Preview your camera before taking a photo.`,reviewHint:`Use this photo or retake it. Your camera is off.`,photoAlt:`Captured photo`,requesting:`Waiting for your camera. Allow access if prompted.`,capturing:`Preparing your photo…`,capture:`Capture`,retake:`Retake`,usePhoto:`Use photo`,upload:`Upload photo`,retry:`Try again`,errorTitle:`Camera unavailable`,previewUnavailable:`Camera preview unavailable`,useNativeCamera:`Use device camera`,insecure:`Live preview requires HTTPS or localhost. Use your device camera or upload a photo. Your browser may show a camera or file picker.`,unsupported:`This browser cannot show a live camera preview. Use your device camera or upload a photo. Your browser may show a camera or file picker.`,permissionDenied:`Camera access was denied. Allow camera access in your browser and system settings, then try again.`,notFound:`No camera was found. Connect a camera, or upload a photo instead.`,unavailable:`The camera could not start. Check that another app is not using it, then try again.`,stopped:`Your camera stopped. Reconnect it and try again, or upload a photo instead.`,captureFailed:`The photo could not be captured. Try again, or upload a photo instead.`}}},pC=Object.assign(()=>Object.assign(R.chat,fC.chat),{catalog:fC})})))()}var hC,gC;function _C(){return(_C=e((()=>{W(),hC={skillsPage:{title:`Skills`,tabs:{all:`All`,ready:`Ready`,needsSetup:`Needs Setup`,disabled:`Disabled`},defaultAgent:`{name} (default)`,filterPlaceholder:`Filter installed skills`,shown:`{count} shown`,clawHub:`ClawHub`,clawHubSubtitle:`Search and install skills from the registry`,searchClawHub:`Search ClawHub skills…`,searching:`Searching…`,disconnected:`Not connected to gateway.`,empty:`No skills found.`,noClawHubResults:`No skills found on ClawHub.`,notScannedByClawHub:`Not scanned by ClawHub`,install:`Install`,installed:`Installed`,installing:`Installing…`,close:`Close`,by:`By`,latest:`Latest: v{version}`,platforms:`Platforms: {platforms}`,installNamed:`Install {name}`,notFound:`Skill not found.`,openDetails:`Open {name} details`,enabledNamed:`{name} enabled`,invalidLink:`ClawHub link invalid`,overview:`Overview`,skillCard:`Skill Card`,missingRequirements:`Missing requirements`,reason:`Reason: {reasons}`,disabled:`Disabled`,enabled:`Enabled`,apiKey:`API key`,getKey:`Get your key:`,saveKey:`Save key`,source:`Source:`,refreshing:`Refreshing…`,fullSecurityReport:`Full security report`,loadingSkillCard:`Loading Skill Card…`,skillCardNotLoaded:`Skill Card not loaded.`,verdict:{unavailable:`Unavailable`,clean:`Clean`,pending:`Pending`,blocked:`Blocked`,review:`Review`}}},gC=Object.assign(()=>{R.skillsPage=hC.skillsPage},{catalog:hC})})))()}function vC(e){return e===`web_search`||e===`web_fetch`?e:void 0}function yC(e){if(typeof e!=`string`||e.length>2048||!wr(e))return null;let t=new URL(e);return t.username||t.password?null:t}function bC(e){let t=new URL(e);return t.hash=``,t.href}function xC(e){return e.map(e=>e.type===`text`||e.type===`code_inline`?e.content:e.type===`softbreak`||e.type===`hardbreak`?` `:``).join(``).replace(/\s+/gu,` `).trim()}function SC(e){return PC.parse(Ui(e),{})}function CC(e,t){if(typeof e!=`string`||e.length>MC)return;let n=t===`web_search`?`Web Search`:`Web Fetch`,r=/(?:^|\n)<<<EXTERNAL_UNTRUSTED_CONTENT id="([a-f0-9]{16})">>>\r?\nSource: ([^\r\n]+)\r?\n---\r?\n([\s\S]*?)\r?\n<<<END_EXTERNAL_UNTRUSTED_CONTENT id="\1">>>/u.exec(e);return r?.[2]===n&&p(r[3]?.trim()??``,jC)||void 0}function wC(e,t){let n=CC(e,t);if(!n)return;let r=SC(n).filter(e=>e.type===`inline`).map(e=>xC(e.children??[])).join(` `).trim();return r?p(r,180):void 0}function TC(e,t){let n=CC(e,t);if(!n)return;let r=SC(n),i=r.flatMap((e,n)=>e.type===`inline`&&r[n-1]?.type===`paragraph_open`&&(t===`web_search`||r[n-1]?.level===0)?[xC(e.children??[])]:[]).find(e=>e.length>=(t===`web_fetch`?60:1));if(i)return i.length>NC?`${p(i,279).trimEnd()}…`:i}function EC(e){if(e.details!==void 0)return E(e.details);if(!e.outputText||e.outputText.length>1e5)return null;try{return E(JSON.parse(e.outputText))}catch{return null}}function DC(e,t,n){let r=EC(e),i=E(r?.externalContent);if(!r||i?.source!==t||i.untrusted!==!0||i.wrapped!==!0)return[];let a=(e,r,i,a=[bC(e)])=>a.some(e=>n.has(e))?[{candidate:{url:e,name:t,title:r.title,excerpt:i?r[i]:void 0},keys:a}]:[];if(t===`web_search`){let e=r.kind===`results`?r.results:r.kind===`answer`?r.citations:void 0;return Array.isArray(e)?e.slice(0,20).flatMap(e=>{let t=E(e),n=yC(t?.url);return t&&n?a(n,t,r.kind===`results`?`snippet`:void 0):[]}):[]}if(typeof r.status!=`number`||r.status<200||r.status>=300)return[];let o=yC(r.url),s=yC(r.finalUrl);return o&&s?a(s,r,`text`,[...new Set([bC(o),bC(s)])]):[]}function OC(e){let t=e.source,n=e.page&&TC(e.page.excerpt,`web_fetch`),r=n||e.search&&TC(e.search.excerpt,`web_search`);return{url:t.url.href,title:wC(t.title,t.name)??t.url.hostname,domain:t.url.hostname,...r?{excerpt:r,excerptKind:n?`page`:`search`}:{}}}function kC(e){let t=E(e.answer);if(!t||Wi(t)!==e.runId)return[];let n=Bc(e.answer);if(!n||n.length>jC)return[];let r=FC.get(t),i=r?.text===n?r.links:SC(n).flatMap(e=>(e.children??[]).flatMap(e=>{let t=e.type===`link_open`?yC(e.attrGet(`href`)):null;return t?[bC(t)]:[]}));if(r?.text!==n&&FC.set(t,{text:n,links:i,inputs:[],previews:[]}),i.length===0)return[];let a=e.basePath??Qn(globalThis.location.pathname)[0],o=[e.runId,a,e.sessionPublicOrigin,globalThis.location.origin],s=[],c=!1;frameInputs:for(let n of e.groups)if(o.push(n.runId),n.runId===e.runId)for(let{message:e}of n.messages){if(o.push(e),e===t){c=!0;break frameInputs}let n=E(e);if(n){s.push(n),o.push(n.role,n.toolName,n.tool_name,n.content,Wi(n));for(let e of Tu(n))o.push(e,e.callId,e.runId,e.name,e.completed,e.live,e.isError,e.outputText,e.details)}}if(!c)return[];if(r?.text===n&&o.length===r.inputs.length&&o.every((e,t)=>Object.is(e,r.inputs[t])))return r.previews;let l=new Set(i),u=new Map,d=new Map,f=new Map;for(let t of s){let n=typeof t.role==`string`?bl(t.role):``;if(n!==`assistant`&&n!==`tool`||Wi(t)!==e.runId)continue;let r=Array.isArray(t.content)?t.content:[];if(r.some(t=>{let n=E(t),r=j(n?.runId);return n&&(hn(n.type)||sn(n.type))&&r&&r!==e.runId}))continue;let i=j(t.toolName)??j(t.tool_name);for(let n of r){let r=E(n),i=r&&hn(r.type)?_n(r)??j(t.toolCallId):void 0,a=j(r?.name);i&&a&&f.set(wa(e.runId,i),a)}for(let n of Tu(t)){if(n.runId!==e.runId||fu(n,!1)!==`succeeded`)continue;let t=vC((n.callId?f.get(wa(e.runId,n.callId)):void 0)??i);if(!(!t||n.name!==t||i&&i!==t))for(let{candidate:e,keys:r}of DC(n,t,l)){let n=bC(e.url),i=u.get(n)??{source:e};if(t===`web_fetch`){i.source=e,i.page=e,i.search??=r.map(e=>u.get(e)?.search).find(e=>e!==void 0),l.add(n);for(let e of r)e!==n&&d.set(e,n);d.delete(n)}else i.search?.excerpt||(i.search=e,i.page||(i.source=e));u.set(n,i)}}}let p=new Map,m=t=>Ai(t)!==null||Vi(t,{basePath:a,publicOrigin:e.sessionPublicOrigin})!==null;for(let e of i){if(m(e))continue;let t=e;for(let e=d.get(t);e;e=d.get(t))t=e;let n=u.get(t);if(n&&!p.has(t)&&!m(t)&&p.set(t,OC(n)),p.size>=AC)break}let h=[...p.values()];return FC.set(t,{text:n,links:i,inputs:o,previews:h}),h}var AC,jC,MC,NC,PC,FC;function IC(){return(IC=e((()=>{Er(),mn(),Xn(),ki(),Li(),zi(),ji(),Ji(),Ca(),Yc(),Bl(),ju(),AC=8,jC=3e4,MC=1e5,NC=280,PC=Bi(),FC=new WeakMap})))()}var LC,RC;function zC(){return(zC=e((()=>{W(),LC={profilePage:{modelAccounts:{title:`Connected accounts`,addAccount:`Add account`,provider:`Provider`,method:`Sign-in method`,noMethods:`No personal sign-in methods are available. Ask your administrator for help.`,gateway:`Gateway`,gatewayUnavailable:`Endpoint unavailable`,person:`Person`,currentPerson:`Current person`,noPerson:`Not identified`,scope:`Scope`,personal:`Personal`,personalDescription:`Sign-in saves an account for this person on this Gateway. System and agent credentials are unchanged.`,signInUnavailable:`Sign-in not ready`,connectionSettings:`Connection settings`,unavailable:{identity:`Use the identity-enabled Gateway address supplied by your administrator, through Tailscale Serve or a trusted proxy. A shared token or device pairing alone does not identify a person.`,write:`Personal account sign-in requires operator.write access. Ask your administrator for access, then reconnect to the Gateway.`,profile:`Wait for your identity profile to load. If it does not appear, use Refresh or Set identity above to retry.`},description:`Choose the account new chats prefer. Existing chats keep their account choice. Gateway fallback rules still apply; this preference is not a billing guarantee.`,empty:`No personal default selected. New chats use the gateway's default account.`,linkedDescription:`Preferred for new chats with this provider. Clearing the default keeps the saved credential and existing chat choices.`,linkedStatus:`New chat default`,gatewayAccount:`Selected saved account`,selectAction:`Use for new chats`,savedAccounts:`Saved accounts`,loadMore:`Load more saved accounts`,inventoryFailed:`Could not load saved accounts. Refresh to retry.`,authTypes:{oauth:`Browser sign-in · saved account`,token:`Token · saved account`,api_key:`API key · saved account`},checkStatusAction:`Check status`,actionFailed:`Could not update connected accounts. Try again.`,statusFailed:`Could not check sign-in status. Check again or cancel this attempt.`,statusTimedOut:`Sign-in has not finished. Check its status or cancel and sign in again.`,notices:{connected:`Account added.`,cancelled:`Sign-in cancelled. No account was added by this attempt.`,expired:`Sign-in expired. Sign in again to start a new attempt.`,selected:`Default updated for new chats. Existing chats are unchanged.`,cleared:`New chats use the gateway default for this provider. Saved credentials and existing chats are unchanged.`},connectErrors:{exchange:`Sign-in failed while exchanging the authorization code. Sign in again.`,identity:`The account identity could not be verified. Sign in again with your own account.`,authority:`Your access changed before sign-in finished. Reconnect to the gateway and try again.`,unavailable:`The gateway could not save the account. Sign in again or ask an administrator for help.`},inputLabel:`Use an existing gateway credential`,inputDescription:`Admin only: choose an existing Gateway credential for this person's new chats. This does not sign in or change the stored credential.`,inputPlaceholder:`openai:alice`,linkAction:`Use for new chats`,unlinkAction:`Use gateway default`,connectAction:`Sign in`,cancelAction:`Cancel`}}},RC=Object.assign(()=>{R.profilePage=Object.assign({},R.profilePage,LC.profilePage)},{catalog:LC})})))()}function BC(e,t={}){let n=t.projection===`available-credentials`,r=e.profiles.filter(e=>[`ok`,`expiring`,`static`].includes(e.status)),i=n?r:e.profiles,a=i.filter(e=>e.type===`oauth`||e.type===`token`),o=i.find(e=>e.profileId===t.authProfileId),s=!!(e.apiKey||i.some(e=>e.type===`api_key`));if(n&&t.authProfileId&&!o||([`missing`,`expired`].includes(e.status)||n&&e.profiles.length>0)&&!e.apiKey&&r.length===0)return{kind:`missing`,label:B(`modelSetup.candidates.signInNeeded`)};if(a.length&&o?.type!==`api_key`){if(n&&s&&!o)return{kind:`subscription`,label:`${B(`chat.modelControls.api`)} / ${B(`chat.modelControls.subscription`)}`};let t=o??(n&&a.length===1&&!s?a[0]:void 0),r=e.profiles.filter(e=>e.type===`oauth`||e.type===`token`).length;return{kind:`subscription`,label:o?.displayName||(r===1?e.usage?.plan:void 0)||B(`chat.modelControls.subscription`),detail:t?.email}}return s?{kind:`api`,label:B(`chat.modelControls.api`)}:void 0}function VC(){return(VC=e((()=>{U(),wy(),Cy()})))()}var HC,UC;function WC(){return(WC=e((()=>{W(),HC={pluginConsent:{widenedTitle:`What changed`,widenedDescription:`New since your last acceptance.`,previouslyAccepted:`Previously accepted {date}.`,declaredTitle:`Declared capabilities`,declaredDescription:`From the plugin manifest. OpenClaw validates the plugin against these declarations when it loads.`,declaredEmpty:`No channels, providers, or tools declared in the manifest.`,contracts:`Contracts`,hooks:`Hooks`,runtimeHooks:`Code plugins may register hooks at runtime; their hook names are not declared in the manifest.`,mcpServers:`MCP servers`,cliCommands:`CLI commands`,cliBackends:`CLI backends`,skills:`Skills`,dangerousFlags:`Dangerous config flags`,grantsTitle:`Your grants`,grantsDescription:`Set per plugin in plugins.entries.{id}. Hooks outside these grants are blocked at load.`,promptInjection:`Prompt injection`,conversationAccess:`Conversation access`,allowed:`Allowed`,blocked:`Blocked`,on:`On`,off:`Off`,grantDefault:`(default)`,grantConfigured:`(set in config)`,externalAccessHint:`Off by default for external plugins.`,modelOverrides:`Model overrides`,subagentModelOverrides:`Subagent model overrides`,modelOverride:`Model override: {value}`,allowedModels:`Allowed models: {models}`,allowedCompletionModels:`Completion models: {models}`,authProfileOverride:`Auth profile override: {value}`,agentIdOverride:`Agent ID override: {value}`,noOverrides:`No overrides configured`,loading:`Loading capability details…`,fallback:`Capability details must be available before you can approve this plugin.`,verifiedClean:`Verified clean`,reviewRecommended:`Review recommended`,reviewRequired:`Review required`,trustBlocked:`Blocked`,scanDate:`Scanned {date}`,integrity:`Integrity`,sha256:`SHA-256`,commit:`Commit`,pinnedArtifact:`Pinned to the exact installed artifact.`,sourceClawHub:`ClawHub`,sourceNpm:`npm`,sourceGit:`Git`,sourcePath:`Local path`,sourceArchive:`Archive`,sourceMarketplace:`Marketplace`,community:`Community`,enableNamed:`Enable {name}`,installPolicy:{technicalDetails:`Technical details`,severity:{info:`Info`,warn:`Warning`,critical:`Critical`},policyScope:`Continuing approves every install-policy warning encountered during this install. Each warning is checked again before installation continues.`}}},UC=Object.assign(()=>{R.pluginConsent=HC.pluginConsent},{catalog:HC})})))()}function Q(e,...t){return{id:e,label:`shortcutsOverlay.labels.${e}`,combos:t}}function GC(e,t){return{id:e,label:`shortcutsOverlay.sections.${e}`,entries:t}}function KC(e=`enter`){return e===`modifier-enter`?qC.map(e=>GC(e.id,e.entries.map(e=>JC.has(e.id)?Q(e.id,L.modifiedEnter):e))):qC}var qC,JC;function YC(){return(YC=e((()=>{so(),vt(),oo(),qC=[GC(`general`,[Q(`commandPalette`,L.commandPalette),Q(`newSession`,L.newSession),Q(`paletteStartSession`,L.modifiedEnter),Q(`keyboardShortcuts`,L.keyboardShortcuts),Q(`toggleSidebar`,L.toggleSidebar),Q(`debugOverlay`,L.debugOverlay),Q(`appearanceSettings`,L.appearanceSettings),Q(`startNewSession`,L.sendMessage),Q(`closeDialog`,L.escape)]),GC(`chat`,[Q(`archiveSession`,L.archiveSession),Q(`sendMessage`,L.sendMessage),Q(`newline`,L.newline),Q(`steerImmediately`,L.modifiedEnter),Q(`historyRecall`,L.historyPrevious,L.historyNext),Q(`transcriptSearch`,L.transcriptSearch),Q(`clearReply`,L.escape),Q(`stopResponse`,L.escape),Q(`cancelDictation`,L.escape),Q(`saveQueuedMessage`,L.modifiedEnter)]),GC(`panels`,[Q(`terminalPanel`,L.terminalPanel),Q(`homePanel`,L.homePanel),Q(`workspaceFiles`,L.workspaceFiles),Q(`sideChat`,L.sideChat),Q(`browserPanel`,L.browserPanel),Q(`desktopPanel`,L.desktopPanel),Q(`discussionPanel`,L.discussionPanel),Q(`dashboardPanel`,L.dashboardPanel),Q(`reviewPanel`,L.reviewPanel)]),GC(`sidebar`,[Q(`toggleSessionSelect`,L.toggleSessionSelect),Q(`extendSessionSelect`,L.extendSessionSelect)]),GC(`imageViewer`,[Q(`zoomIn`,L.zoomIn),Q(`zoomOut`,L.zoomOut),Q(`zoomReset`,L.zoomReset),Q(`panImageHorizontal`,L.imagePanLeft,L.imagePanRight),Q(`panImageVertical`,L.imagePanUp,L.imagePanDown)]),GC(`approvals`,[Q(`approveOnce`,L.modifiedEnter),Q(`approveAlways`,L.approveAlways),Q(`denyApproval`,L.denyApproval)])],JC=new Set([`sendMessage`,`startNewSession`])})))()}async function XC(){let e=await ws();return Sw!==e&&(Sw=e,globalThis.setTimeout(()=>void ow(e).catch(()=>void 0),0)),e}function ZC(e){return JSON.stringify([e.gatewayOwner,e.recoveryScope])}function QC(e){return JSON.stringify([e.gatewayOwner,e.recoveryScope,e.scopeKey])}function $C(e){let t=Math.max(Date.now(),e+1,xw+1);return xw=t,t}function ew(e){if(!e||typeof e!=`object`)return!1;let t=e;return t.blob instanceof Blob&&typeof t.mimeType==`string`&&(t.origin===void 0||t.origin===`paste`||t.origin===`file`)}function tw(e){if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.itemId==`string`&&typeof t.signature==`string`&&typeof t.edited==`boolean`&&(t.dismissed===void 0||typeof t.dismissed==`boolean`)&&(t.reopenedAfterBoundary===void 0||typeof t.reopenedAfterBoundary==`string`)&&Array.isArray(t.answers)&&t.answers.every(e=>e&&typeof e==`object`&&typeof e.freeText==`string`&&Array.isArray(e.selected)&&e.selected.every(e=>typeof e==`string`))}function nw(e){if(!e||typeof e!=`object`)return null;let t=e;if(typeof t.key!=`string`||typeof t.ownerKey!=`string`||typeof t.gatewayOwner!=`string`||typeof t.recoveryScope!=`string`||typeof t.scopeKey!=`string`||typeof t.updatedAt!=`number`||typeof t.writeId!=`string`||typeof t.text!=`string`||t.goalMode!==void 0&&!os(t.goalMode)||t.replyTarget!==void 0&&!cs(t.replyTarget)||typeof t.revision!=`number`||!Number.isSafeInteger(t.revision)||t.revision<=0||!Array.isArray(t.attachments)||!t.attachments.every(ew)||t.questionDrafts!==void 0&&(!Array.isArray(t.questionDrafts)||!t.questionDrafts.every(tw)))return null;let n=t.modelSelection;return n!==void 0&&(!n||typeof n!=`object`||typeof n.agentId!=`string`||typeof n.model!=`string`||typeof n.thinkingLevel!=`string`||n.agentRuntime!==void 0&&typeof n.agentRuntime!=`string`)&&(t.modelSelection=void 0),t.mentions=Aa(t.text,t.mentions),t}function rw(e){return!!(e.text||e.goalMode||e.replyTarget||e.modelSelection||e.attachments.length>0||e.questionDrafts?.length)}function iw(e,t){let n=$C(e.revision);return{...e,revision:n,text:``,mentions:void 0,goalMode:void 0,replyTarget:void 0,modelSelection:void 0,attachments:[],questionDrafts:void 0,updatedAt:t,writeId:`fence:${n}`}}function aw(e,t){if(!(cw(e)||e.updatedAt>t-vw))return rw(e)?iw(e,t):null}async function ow(e){let t=e.transaction($,`readwrite`),n=t.objectStore($),r=Date.now(),i=n.openCursor();i.addEventListener(`success`,()=>{try{let e=i.result;if(!e)return;let t=nw(e.value),n=t?aw(t,r):void 0;n===null?e.delete():n&&e.update(n),e.continue()}catch{t.abort()}}),await K(t)}async function sw(e,t,n){let r=(await G(e.index(gw).getAll(t))).flatMap(e=>{let t=nw(e);return t?[t]:[]}),i=[];for(let t of r){let r=aw(t,n);if(r===null){e.delete(t.key);continue}if(r){e.put(r);continue}rw(t)&&!cw(t)&&i.push(t)}i.sort((e,t)=>t.updatedAt-e.updatedAt);for(let t of i.slice(yw))e.put(iw(t,n))}function cw(e){return!e.scopeKey.startsWith(_w)&&!e.scopeKey.startsWith(`questions:v1:`)&&e.scopeKey.includes(`\0agent:`)&&rw(e)}async function lw(e){let t;try{t=(await XC()).transaction($,`readwrite`);let n=t.objectStore($),r=(await G(n.index(gw).getAll(ZC(e)))).map(nw).filter(e=>e!==null),i=[],a=r.filter(e=>rw(e)&&!cw(e)).length;for(let t of r){if(!cw(t))continue;if(t.gatewayOwner!==e.gatewayOwner||t.recoveryScope!==e.recoveryScope)throw Error(`Composer recovery owner mismatch`);let r=lc(t.scopeKey),o=r&&![`global`,`main`].includes(r.sessionKey),s={...e,scopeKey:`${_w}${r?F(r):t.scopeKey}`},c=o?await G(n.get(QC(s))):void 0,l=nw(c);o&&l&&!rw(l)&&l.revision>t.revision?n.put(iw(t,Date.now())):o&&a<yw&&c===void 0?(n.put({...t,key:QC(s),scopeKey:s.scopeKey,updatedAt:Date.now()}),a++,n.put(iw(t,Date.now()))):i.push({scopeKey:t.scopeKey,revision:t.revision,writeId:t.writeId,text:t.text,attachmentNames:t.attachments.map(e=>e.fileName??e.mimeType)})}return await K(t),{status:`ready`,entries:i}}catch{try{t?.abort()}catch{}return{status:`storage-failed`}}}async function uw(e,t,n,r,i,a){let o;try{o=(await XC()).transaction($,`readwrite`);let s=o.objectStore($),c=nw(await G(s.get(QC({...e,scopeKey:t.scopeKey})))),l=nw(await G(s.get(QC(e))));if(!i()||!c||!cw(c)||c.gatewayOwner!==e.gatewayOwner||c.recoveryScope!==e.recoveryScope||c.revision!==t.revision||c.writeId!==t.writeId||(l?.revision??0)!==n||l?.writeId!==r||l&&rw(l))return o.abort(),{status:`conflict`};let u=$C(Math.max(a,c.revision,l?.revision??0));return s.put({...c,key:QC(e),scopeKey:e.scopeKey,revision:u,writeId:`recovered:${u}`,updatedAt:Date.now()}),s.put(iw(c,Date.now())),await K(o),{status:`persisted`,revision:u}}catch{try{o?.abort()}catch{}return{status:`storage-failed`}}}async function dw(e){try{let t=(await XC()).transaction($,`readwrite`),n=t.objectStore($),r=await G(n.get(QC(e))),i=nw(r),a=Date.now();if(!i)return r!==void 0&&n.delete(QC(e)),await K(t),{status:`not-found`};if(i.gatewayOwner!==e.gatewayOwner||i.recoveryScope!==e.recoveryScope||i.scopeKey!==e.scopeKey)return t.abort(),{status:`storage-failed`};let o=aw(i,a);return o===null?(n.delete(i.key),await K(t),{status:`not-found`}):o?(n.put(o),await K(t),{status:`not-found`,revision:o.revision,writeId:o.writeId}):(await K(t),rw(i)?{status:`found`,draft:{revision:i.revision,writeId:i.writeId,text:i.text,...i.mentions?.length?{mentions:i.mentions}:{},...i.goalMode?{goalMode:i.goalMode}:{},...i.replyTarget?{replyTarget:{...i.replyTarget}}:{},...i.modelSelection?{modelSelection:i.modelSelection}:{},attachments:i.attachments,...i.questionDrafts?.length?{questionDrafts:i.questionDrafts}:{}}}:{status:`not-found`,revision:i.revision,writeId:i.writeId})}catch{return{status:`storage-failed`}}}async function fw(e,t,n){if(t.attachments.reduce((e,t)=>e+t.blob.size,0)>bw){let r=await fw(e,{...t,attachments:[]},n);return r.status===`persisted`?{status:`payload-too-large`,revision:r.revision,writeId:r.writeId}:r}try{let r=(await XC()).transaction($,`readwrite`),i=r.objectStore($),a=QC(e),o=nw(await G(i.get(a)));if(o?.revision===t.revision)return r.abort(),o.writeId===n.writeId?{status:`persisted`,revision:o.revision,writeId:o.writeId}:{status:`conflict`};if(!(o?o.revision===n.expectedRevision&&(n.expectedWriteId===void 0||o.writeId===n.expectedWriteId)||n.expectedWriteIds?.includes(o.writeId)===!0:n.expectedRevision===0&&n.expectedWriteId===void 0)||(o?.revision??0)>t.revision)return r.abort(),{status:`conflict`};let s=Date.now(),c={key:a,ownerKey:ZC(e),gatewayOwner:e.gatewayOwner,recoveryScope:e.recoveryScope,scopeKey:e.scopeKey,revision:t.revision,text:t.text,...t.mentions?.length?{mentions:t.mentions.map(e=>({...e}))}:{},...t.goalMode?{goalMode:t.goalMode}:{},...t.replyTarget?{replyTarget:{...t.replyTarget}}:{},...t.modelSelection?{modelSelection:{...t.modelSelection}}:{},attachments:t.attachments,...t.questionDrafts?.length?{questionDrafts:t.questionDrafts}:{},updatedAt:s,writeId:n.writeId};return i.put(c),await sw(i,c.ownerKey,s),await K(r),{status:`persisted`,revision:t.revision,writeId:n.writeId}}catch{return{status:`storage-failed`}}}async function pw(e,t=0,n){try{let r=(await XC()).transaction($,`readwrite`),i=r.objectStore($),a=Date.now(),o=await mw(i,e,t,n,a);return o.status===`conflict`?(r.abort(),o):(await sw(i,ZC(e),a),await K(r),o)}catch{return{status:`storage-failed`}}}async function mw(e,t,n,r,i){t.scopeKey.startsWith(_w)&&await mw(e,{...t,scopeKey:`questions:v1:${t.scopeKey}`},n,r,i);let a=QC(t),o=nw(await G(e.get(a)));if(r!==void 0&&(o?.revision??0)>=r)return{status:`conflict`};let s=$C(Math.max(n,o?.revision??0)),c=`retired:${s}`;return e.put({key:a,ownerKey:ZC(t),gatewayOwner:t.gatewayOwner,recoveryScope:t.recoveryScope,scopeKey:t.scopeKey,revision:s,text:``,attachments:[],questionDrafts:void 0,updatedAt:i,writeId:c}),{status:`persisted`,revision:s,writeId:c}}async function hw(e,t){try{let n=(await XC()).transaction($,`readwrite`),r=n.objectStore($),i=Date.now();for(let n of t)await mw(r,{...e,scopeKey:n.scopeKey},n.minimumRevision,n.retireBeforeRevision,i);return await sw(r,ZC(e),i),await K(n),`completed`}catch{return`storage-failed`}}var $,gw,_w,vw,yw,bw,xw,Sw;function Cw(){return(Cw=e((()=>{As(),ss(),Na(),kc(),ls(),$=`composerDrafts`,gw=`ownerKey`,_w=`chat:v3:`,vw=6048e5,yw=20,bw=26214400,xw=0,Sw=null})))()}function ww(){return(ww=e((()=>{Qa()})))()}export{iS as $,Af as $a,To as $c,Vm as $i,Uv as $n,td as $o,dg as $r,il as $s,Nb as $t,GS as A,Dp as Aa,Ns as Ac,hh as Ai,ka as Al,Iy as An,Gd as Ao,Kg as Ar,Hl as As,hx as At,kS as B,vp as Ba,fs as Bc,ih as Bi,gy as Bn,kd as Bo,Ag as Br,vl as Bs,Kb as Bt,uC as C,om as Ca,Ys as Cc,Mh as Ci,Ua as Cl,Gy as Cn,Xd as Co,l_ as Cr,tu as Cs,Ex as Ct,sC as D,wp as Da,Is as Dc,Sh as Di,Aa as Dl,Vy as Dn,ef as Do,$g as Dr,Xl as Ds,yx as Dt,oC as E,bp as Ea,Gs as Ec,Th as Ei,Na as El,Uy as En,Jd as Eo,Vg as Er,Yl as Es,_x as Et,IS as F,tm as Fa,K as Fc,lh as Fi,Cy as Fn,Fd as Fo,jg as Fr,Bl as Fs,lx as Ft,Z as G,up as Ga,as as Gc,Jm as Gi,iy as Gn,Nd as Go,Cg as Gr,dl as Gs,zb as Gt,ES as H,cp as Ha,ms as Hc,Xm as Hi,py as Hn,Od as Ho,wg as Hr,Cl as Hs,Yb as Ht,PS as I,$p as Ia,xs as Ic,ch as Ii,xy as In,Bd as Io,kg as Ir,El as Is,ux as It,_S as J,Zf as Ja,bo as Jc,Um as Ji,Xv as Jn,pd as Jo,vg as Jr,ll as Js,Gb as Jt,wS as K,dp as Ka,is as Kc,Km as Ki,cy as Kn,Cd as Ko,xg as Kr,Qc as Ks,Lb as Kt,NS as L,Jp as La,Ss as Lc,sh as Li,by as Ln,Ad as Lo,Mg as Lr,Il as Ls,cx as Lt,KS as M,Xp as Ma,Ms as Mc,dh as Mi,Ea as Ml,Ty as Mn,Vd as Mo,Ng as Mr,Ul as Ms,gx as Mt,VS as N,Ap as Na,As as Nc,ph as Ni,Ta as Nl,Ey as Nn,Ld as No,Rg as Nr,Gl as Ns,px as Nt,YS as O,am as Oa,Ls as Oc,Ch as Oi,Ma as Ol,Ay as On,Zd as Oo,Wg as Or,Wl as Os,vx as Ot,LS as P,Yp as Pa,G as Pc,uh as Pi,wy as Pn,Id as Po,Pg as Pr,gl as Ps,fx as Pt,uS as Q,Nf as Qa,Ao as Qc,Bm as Qi,Qv as Qn,rd as Qo,lg as Qr,rl as Qs,jb as Qt,MS as R,Fp as Ra,vs as Rc,oh as Ri,_y as Rn,Md as Ro,Dg as Rr,bl as Rs,Qb as Rt,pC as S,sm as Sa,$s as Sc,kh as Si,Ka as Sl,Ly as Sn,Qd as So,u_ as Sr,$l as Ss,Cx as St,dC as T,nm as Ta,Js as Tc,Oh as Ti,Ga as Tl,By as Tn,$d as To,n_ as Tr,Ql as Ts,xx as Tt,OS as U,mp as Ua,ds as Uc,th as Ui,uy as Un,Pd as Uo,Sg as Ur,wl as Us,Wb as Ut,vS as V,_p as Va,hs as Vc,Qm as Vi,hy as Vn,Dd as Vo,Eg as Vr,Sl as Vs,qb as Vt,bS as W,lp as Wa,us as Wc,Ym as Wi,ly as Wn,Td as Wo,Tg as Wr,fl as Ws,Pb as Wt,hS as X,Hf as Xa,Fo as Xc,Gm as Xi,$v as Xn,sd as Xo,fg as Xr,el as Xs,Mb as Xt,yS as Y,Xf as Ya,wo as Yc,Wm as Yi,ry as Yn,md as Yo,yg as Yr,nl as Ys,Db as Yt,dS as Z,Uf as Za,co as Zc,Hm as Zi,Zv as Zn,cd as Zo,_g as Zr,tl as Zs,Ab as Zt,kC as _,_m as _a,ac as _c,Lh as _i,Qa as _l,Yy as _n,uf as _o,b_ as _r,uu as _s,jx as _t,uw as a,zm as aa,jc as ac,tg as ai,ns as al,gb as an,Cf as ao,Pv as ar,Ru as as,rS as at,gC as b,pm as ba,nc as bc,Nh as bi,Pa as bl,qy as bn,Yd as bo,f_ as br,eu as bs,Ax as bt,fw as c,Em as ca,dc as cc,ng as ci,No as cl,lb as cn,yf as co,Av as cr,Eu as cs,Ux as ct,WC as d,Sm as da,kc as dc,Kh as di,oo as dl,sb as dn,hf as do,yv as dr,xu as ds,Ix as dt,Fm as ea,Rc as ec,cg as ei,Mo as el,bb as en,kf as eo,Bv as er,$u as es,lS as et,UC as f,xm as fa,oc as fc,Gh as fi,eo as fl,ob as fn,pf as fo,mv as fr,vu as fs,Rx as ft,RC as g,cm as ga,cc as gc,zh as gi,qa as gl,Xy as gn,cf as go,E_ as gr,du as gs,Px as gt,zC as h,vm as ha,uc as hc,Hh as hi,$a as hl,rb as hn,df as ho,$_ as hr,Cu as hs,Fx as ht,dw as i,Nm as ia,Wc as ic,Xh as ii,Do as il,_b as in,Sf as io,Iv as ir,Xu as is,aS as it,BS as j,Sp as ja,Ps as jc,_h as ji,Oa as jl,Dy as jn,qd as jo,Bg as jr,Kl as js,bx as jt,JS as k,Zp as ka,Fs as kc,mh as ki,ja as kl,zy as kn,Kd as ko,Gg as kr,Vl as ks,Sx as kt,YC as l,jm as la,fc as lc,Jh as li,Co as ll,db as ln,vf as lo,vv as lr,Tu as ls,zx as lt,VC as m,ym as ma,hc as mc,Bh as mi,ro as ml,eb as mn,lf as mo,pv as mr,ju as ms,Wx as mt,Cw as n,wm as na,Hc as nc,ag as ni,Eo as nl,mb as nn,Tf as no,Hv as nr,Zu as ns,oS as nt,pw as o,Rm as oa,Ac as oc,Yh as oi,Po as ol,ub as on,wf as oo,kv as or,Ju as os,tS as ot,BC as p,bm as pa,lc as pc,Uh as pi,io as pl,ib as pn,ff as po,hv as pr,bu as ps,Lx as pt,xS as q,tp as qa,Qo as qc,qm as qi,oy as qn,hd as qo,bg as qr,$c as qs,Rb as qt,lw as r,Am as ra,Yc as rc,$h as ri,ko as rl,pb as rn,Ef as ro,Jv as rr,Yu as rs,eS as rt,hw as s,Tm as sa,yc as sc,eg as si,Io as sl,fb as sn,xf as so,jv as sr,Mu as ss,Gx as st,ww as t,Mm as ta,Bc as tc,sg as ti,jo as tl,yb as tn,Of as to,Vv as tr,ed as ts,nS as tt,KC as u,Cm as ua,rc as uc,qh as ui,so as ul,cb as un,gf as uo,_v as ur,pu as us,Bx as ut,IC as v,lm as va,_c as vc,Rh as vi,Va as vl,Zy as vn,rf as vo,d_ as vr,Su as vs,Mx as vt,cC as w,Kp as wa,Xs as wc,wh as wi,Wa as wl,Oy as wn,nf as wo,s_ as wr,ql as ws,Dx as wt,mC as x,fm as xa,qs as xc,Ih as xi,Ja as xl,Ry as xn,tf as xo,p_ as xr,nu as xs,kx as xt,_C as y,um as ya,Zs as yc,Fh as yi,Ha as yl,Jy as yn,sf as yo,__ as yr,fu as ys,Ox as yt,AS as z,Cp as za,gs as zc,ah as zi,vy as zn,Ed as zo,Og as zr,Dl as zs,tx as zt};