UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

1 lines • 23.3 kB
import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{Qt as t,Xt as n,_o as r,el as i,in as a,pn as o,sa as s,sn as c,va as l,ya as u}from"./control-ui-connection-Bfj9beF_.js";import{$p as d,Ck as f,Fa as p,Ia as m,La as h,Ra as ee,Sk as g,Zp as te,dj as _,ej as ne,mj as v,pj as re,rg as ie,tg as ae,tj as oe}from"./control-ui-boot-shared-DFTSUQQ0.js";import{B as se,C as y,Ct as ce,F as b,J as x,N as le,O as S,Rt as C,S as ue,St as de,U as w,d as T,f as E,g as D,gt as fe,j as O,l as k,o as pe,s as me,u as A,v as he,w as j,x as M}from"./solid-runtime-C416s-HC.js";import{X as ge,Y as _e,gr as ve,mr as ye}from"./deferred-ui-support-D-VedBtc.js";import{i as be,r as xe}from"./login-runtime-lAT1hrsQ.js";import{n as Se,t as Ce}from"./en-settings-YsyvL-Mv.js";import{n as we,t as Te}from"./en-route-subtitles-C2EbTkck.js";import{n as Ee,o as De}from"./settings-targets-BBXeSTMi.js";import{d as N,f as Oe,h as P,l as ke,n as Ae,p as F,u as je,y as I}from"./settings-ui-Ck6BJLhD.js";import{n as L,t as R}from"./gateway-host-BgB-LCkp.js";import{n as Me,t as Ne}from"./gateway-page-BGbclR08.js";import{a as Pe,o as Fe}from"./route-chrome-7YRVJwhf.js";import{i as Ie,r as Le}from"./gateway-vitals-DwnNd9mX.js";function Re(e){if(e.length===0)return null;let t=e.toSorted((e,t)=>e-t),n=e=>t[Math.ceil(t.length*e)-1];return{count:e.length,averageMs:e.reduce((e,t)=>e+t,0)/e.length,p50Ms:n(.5),p95Ms:n(.95),p99Ms:n(.99)}}var z;function B(){return(B=e((()=>{a(),ye(),ae(),L(),_(),h(),z=class{constructor(e,t){this.context=e,this.changed=t,this.settings=c(),this.password=``,this.gatewaySecretVisible=!1,this.systemInfo=null,this.systemInfoUnavailable=!1,this.ping=null,this.pingFailed=!1,this.pingSamples=[],this.pingRequest=null,this.statusHistory=[],this.statusFailed=!1,this.systemInfoRequest=null,this.systemInfoRead=null,this.sessionKeyBaseline=``,this.sessionGatewayUrl=``,this.sessionSaved=!1}cancelDiagnostic(e){let t=this[e];this[e]=null,t?.controller.abort(),t?.completion?.resolve(null),e===`systemInfoRequest`&&(this.systemInfoRead=null)}get isActive(){return this.gateway.gateway===this.context.gateway}dispose(){this.resetDiagnostics(),this.gatewaySecretVisible=!1}handleGatewaySnapshot({snapshot:e,initial:t,sourceChanged:n,clientChanged:r}){let i=this.systemInfoUnavailable;t||n||r?(this.resetDiagnostics(),this.resetConnectionDraft(),(t||n||this.sessionGatewayUrl!==this.context.gateway.connection.gatewayUrl)&&this.resetSessionDraft(),this.systemInfo=null,this.systemInfoUnavailable=!1):e.phase!==`connected`&&(this.gatewaySecretVisible=!1,this.systemInfo=null),e.phase===`connected`&&e.hello&&(this.systemInfoUnavailable=!m(e),this.systemInfoUnavailable&&(this.gateway.invalidate(),this.cancelDiagnostic(`systemInfoRequest`),this.systemInfo=null,this.statusFailed=!0)),this.settings.sessionKey===this.sessionKeyBaseline&&(this.settings={...this.settings,sessionKey:e.sessionKey}),this.sessionKeyBaseline=e.sessionKey,this.syncDiagnosticsPolling(),i&&!this.systemInfoUnavailable&&this.loadDiagnostic(`system-info`)}stopDiagnosticsPolling(){this.polling.stop(),this.cancelDiagnostic(`pingRequest`),this.cancelDiagnostic(`systemInfoRequest`)}resetDiagnostics(){this.stopDiagnosticsPolling(),this.pingSamples=[],this.ping=null,this.pingFailed=!1,this.statusHistory=[],this.statusFailed=!1}syncDiagnosticsPolling(){let e=this.context.gateway.snapshot;!this.isActive||document.visibilityState===`hidden`||e.phase!==`connected`||!e.client?this.stopDiagnosticsPolling():this.polling.start()&&this.refreshDiagnostics()}refreshDiagnostics(){this.loadDiagnostic(`ping`),this.loadDiagnostic(`system-info`)}async loadDiagnostic(e){let t=this.gateway.gateway,n=this.gateway.capture(),r=e===`ping`,i=r?`pingRequest`:`systemInfoRequest`;if(!t||t!==this.context.gateway||!n||!r&&this.systemInfoUnavailable||this[i]||document.visibilityState===`hidden`)return;let a={controller:new AbortController,completion:r?null:Promise.withResolvers()};this[i]=a,r||(this.systemInfoRead=a.completion?.promise??null),this.changed();let o=()=>this[i]===a&&this.isActive&&document.visibilityState!==`hidden`&&this.context.gateway===t&&this.gateway.isCurrent(n),s=r?performance.now():0;try{if(r){if(await n.client.request(`last-heartbeat`,{},{timeoutMs:p,signal:a.controller.signal}),!o())return;this.pingSamples=[...this.pingSamples.slice(-99),{at:Date.now(),value:performance.now()-s}],this.ping=Re(this.pingSamples.map(e=>e.value)),this.pingFailed=!1}else{let e=await ee(t,a.controller.signal);if(!o())return;this.systemInfo=e.value,this.polling.stop(),this.polling.start(),this.statusHistory.at(-1)?.at!==e.at&&(this.statusHistory=[...this.statusHistory.slice(-99),{at:e.at,status:{eventLoop:e.value.eventLoop,processMemory:e.value.processMemory}}]),this.statusFailed=!1}}catch(e){if(!o())return;r?this.pingFailed=!0:(this.statusFailed=!0,ie(e)&&(this.systemInfo=null,this.systemInfoUnavailable=!0))}finally{this[i]===a?(this[i]=null,a.completion?.resolve(this.statusFailed),this.changed()):a.completion?.resolve(null)}}resetConnectionDraft(){let{gatewayUrl:e,token:t,password:n}=this.context.gateway.connection;this.settings={...this.settings,gatewayUrl:e,token:t},this.password=n,this.gatewaySecretVisible=!1}resetSessionDraft(){this.sessionGatewayUrl=this.context.gateway.connection.gatewayUrl,this.sessionKeyBaseline=this.context.gateway.snapshot.sessionKey,this.settings={...this.settings,sessionKey:this.sessionKeyBaseline},this.sessionSaved=!1}saveSession(){this.context.gateway.setSessionKey(this.settings.sessionKey),this.resetSessionDraft(),this.sessionSaved=!0}async forgetDevice(){let e=this.context.gateway,t=e.connection.gatewayUrl;await ve({title:v(`connection.browser.confirmTitle`),message:v(`connection.browser.confirmMessage`,{gateway:R(t)}),confirmLabel:v(`connection.browser.confirmLabel`),danger:!0})&&this.isActive&&this.context.gateway===e&&e.connection.gatewayUrl===t&&(e.forgetDeviceToken?.(),this.changed())}updateConnection(e){if(e.gatewayUrl!==void 0){let t=o(this.settings.gatewayUrl,e.gatewayUrl,{token:this.settings.token,password:this.password});this.password=t.password,this.settings={...this.settings,...e,token:t.token}}else this.settings={...this.settings,...e}}viewProps(){let e=this.context.gateway.snapshot,t=this.context.gateway.connection,n=this.settings.gatewayUrl!==t.gatewayUrl||this.settings.token!==t.token||this.password!==t.password;return{phase:e.phase,hello:e.hello,settings:this.settings,liveGatewayUrl:t.gatewayUrl,secret:this.settings.token||this.password,lastError:e.lastError,systemInfo:this.systemInfo,systemInfoUnavailable:this.systemInfoUnavailable,ping:this.ping,pingFailed:this.pingFailed,pingSamples:this.pingSamples,statusHistory:this.statusHistory,statusFailed:this.statusFailed,dirty:n,sessionDirty:this.settings.sessionKey.trim()!==e.sessionKey,sessionSaved:this.sessionSaved,showGatewaySecret:this.gatewaySecretVisible,canForgetDevice:this.context.gateway.hasStoredDeviceToken?.()??!1,onForgetDevice:()=>void this.forgetDevice(),onConnectionChange:e=>{this.updateConnection(e),this.changed()},onSecretChange:e=>{this.password=``,this.updateConnection({token:e}),this.changed()},onSessionKeyChange:e=>{this.sessionSaved=!1,this.settings={...this.settings,sessionKey:e},this.changed()},onToggleGatewaySecretVisibility:()=>{this.gatewaySecretVisible=!this.gatewaySecretVisible,this.changed()},onConnect:()=>this.context.gateway.connect({gatewayUrl:this.settings.gatewayUrl,token:this.settings.token,password:this.password}),onDiscardConnection:()=>{this.resetConnectionDraft(),this.changed()},onReconnect:()=>this.context.gateway.connect(),onSaveSession:()=>{this.saveSession(),this.changed()},onDiscardSession:()=>{this.resetSessionDraft(),this.changed()}}}}})))()}function ze(e){return e?`${(e/1e3).toFixed(e%1e3==0?0:1)}s`:null}function Be(e){let t=()=>e.authMode===`password`?`connection.access.passwordHint`:e.authMode===`token`?`connection.access.tokenHint`:`connection.access.secretHint`;return O(N,{get title(){return v(`connection.access.secret`)},get description(){return v(t())},stackedOnNarrow:!0,get control(){var t=K(),n=t.firstChild,r=n.nextSibling;return T(t,O(Oe,{get ariaLabel(){return v(`connection.access.secret`)},get value(){return e.secret},get placeholder(){return v(`connection.access.secretPlaceholder`)},get visible(){return e.showGatewaySecret},get showLabel(){return v(`connection.access.showSecret`)},get hideLabel(){return v(`connection.access.hideSecret`)},get toggleLabel(){return v(`connection.access.toggleSecretVisibility`)},onInput:t=>e.onSecretChange(t),onToggle:()=>e.onToggleGatewaySecretVisibility()}),n),T(t,O(S,{get when(){return xe(e.secret)===`setup-code`},get children(){var e=G();return T(e,()=>v(`connection.access.setupCodeHint`)),e}}),r),t}})}function Ve(e){return`${e.toFixed(1)} ${v(`connection.ping.unit`)}`}function V(e){var t=J(),n=t.firstChild,r=n.nextSibling;return T(n,()=>v(`connection.ping.${e.name}`)),T(r,O(S,{get when(){return e.value!==void 0},fallback:`—`,get children(){return[E(()=>e.value?.toFixed(1)),` `,(()=>{var e=q();return T(e,()=>v(`connection.ping.unit`)),e})()]}})),k(()=>v(`connection.ping.${e.name}Hint`),e=>{D(t,`title`,e)}),t}function He(e){var t=X(),n=t.firstChild,r=n.firstChild,i=r.nextSibling,a=i.nextSibling,o=a.nextSibling,s=n.nextSibling,c=s.nextSibling,l=c.firstChild,u=l.nextSibling;return T(n,O(V,{name:`average`,get value(){return e.ping?.averageMs}}),r),T(n,O(V,{name:`p50`,get value(){return e.ping?.p50Ms}}),i),T(n,O(V,{name:`p95`,get value(){return e.ping?.p95Ms}}),a),T(n,O(V,{name:`p99`,get value(){return e.ping?.p99Ms}}),o),s.format=Ve,s.floorMax=100,s._$owner=C(),T(c,(()=>{var t=E(()=>!!e.ping);return()=>t()?v(`connection.ping.samples`,{count:String(e.ping.count)}):E(()=>!!e.pingFailed)()?void 0:v(`connection.ping.measuring`)})(),l),T(c,O(S,{get when(){return e.pingFailed},get children(){var e=Y();return T(e,()=>v(`connection.ping.failed`)),e}}),u),k(()=>({e:v(`connection.ping.title`),t:v(`connection.ping.latest`),a:e.pingSamples}),({e,t,a:r},i)=>{e!==i?.e&&D(n,`aria-label`,e),t!==i?.t&&(s.label=t),r!==i?.a&&(s.samples=r)}),t}function Ue(e){let t=r(),a=()=>e.phase===`connected`,o=()=>[`connecting`,`starting`,`reconnecting`].includes(e.phase),s=()=>o()&&!e.dirty,c=()=>e.phase===`reload-required`,l=()=>e.hello?.snapshot?.authMode,u=b(()=>i(e.settings.gatewayUrl)===i(e.liveGatewayUrl)?l():void 0),d=()=>a()?`connected`:e.phase===`stopped`?`offline`:e.phase,f=()=>s()?v(e.phase===`reconnecting`?`connection.access.status.reconnecting`:`connection.access.status.connecting`):a()||o()?v(`connection.access.applyReconnect`):v(e.lastError?`connection.access.retry`:`common.connect`),p=()=>ze(e.hello?.policy?.tickIntervalMs),m=()=>{if(ce(e.systemInfoReady))throw Error(v(`connection.activity.failed`));return null},h=()=>e.statusFailed?null:a()?e.statusHistory.length===0?`loading`:null:`offline`;return O(ke,{get children(){return[O(F,{get title(){return v(`connection.access.title`)},get description(){return E(()=>!!a())()?v(`connection.access.connectedTo`,{host:R(e.liveGatewayUrl)}):E(()=>!!(o()||c()))()?v(`connection.access.status.${d()}`):v(`connection.access.descriptionOffline`)},get actions(){return O(P,{get kind(){return a()?`ok`:`warn`},get label(){return v(`connection.access.status.${d()}`)}})},get children(){return[O(S,{get when(){return a()},get children(){return O(He,e)}}),O(S,{when:!t,get children(){return[O(N,{get title(){return v(`connection.access.gatewayUrl`)},get description(){return v(`connection.access.gatewayUrlHint`)},get control(){var t=Qe();return t._$$input=t=>e.onConnectionChange({gatewayUrl:t.currentTarget.value}),k(()=>({e:v(`connection.access.gatewayUrl`),t:e.settings.gatewayUrl}),({e,t:n},r)=>{e!==r?.e&&D(t,`aria-label`,e),t.value=n??``}),t}}),O(S,{get when(){return u()===`trusted-proxy`},get fallback(){return O(Be,x(e,{get authMode(){return u()}}))},get children(){return O(N,{get title(){return v(`connection.access.secret`)},get description(){return v(`connection.access.trustedProxy`)},get control(){return O(P,{kind:`ok`,get label(){return v(`connection.access.trustedProxyStatus`)}})}})}})]}}),O(S,{get when(){return E(()=>!a())()&&e.lastError},get children(){return O(N,{get title(){return O(P,{kind:`danger`,get label(){return v(`connection.access.lastError`)}})},get description(){return e.lastError}})}}),O(S,{get when(){return E(()=>!(a()&&!e.dirty))()?!c():!a()||e.dirty},get children(){var t=Je(),n=t.firstChild,r=n.firstChild,i=n.nextSibling,a=i.firstChild,o=a.firstChild,c=o.nextSibling;return T(r,(()=>{var t=E(()=>!!e.dirty);return()=>t()?v(`connection.access.unsavedHint`):void 0})()),T(i,O(S,{get when(){return e.dirty},get children(){var t=Z();return t._$$click=()=>e.onDiscardConnection(),T(t,()=>v(`connection.access.discard`)),t}}),a),a._$$click=()=>e.onConnect(),T(a,O(S,{get when(){return s()},get children(){return qe()}}),o),T(a,f,c),k(()=>s(),e=>{D(a,`disabled`,e)}),t}}),(()=>{var t=Ye(),n=t.firstChild,r=n.nextSibling,i=r.firstChild,o=i.nextSibling;return T(n,()=>v(`connection.access.details`)),T(r,O(S,{get when(){return E(()=>!!a())()?l()||p():a()},get children(){var e=Q();return T(e,()=>[l()?v(ut[l()]):null,p()?v(`connection.access.tick`,{tick:p()}):null].filter(Boolean).join(` · `)),e}}),i),T(i,()=>v(`connection.access.reconnectHint`)),o._$$click=()=>e.onReconnect(),T(o,()=>v(`connection.access.reconnect`)),k(()=>!a()||e.dirty,e=>{D(o,`disabled`,e)}),t})()]}}),O(F,{get title(){return v(`connection.activity.title`)},get description(){return v(`connection.activity.description`)},get children(){var t=Xe(),r=t.firstChild,i=r.nextSibling,a=i.nextSibling;return T(t,O(Le,{get status(){return e.statusHistory.at(-1)?.status??{}},get history(){return e.statusHistory}}),r),T(t,O(ue,{fallback:e=>(()=>{var t=G();return T(t,()=>n(e())),t})(),get children(){return O(j,{get children(){return m()}})}}),i),T(t,O(S,{get when(){return h()},children:e=>(()=>{var t=Q();return T(t,()=>v(e()===`loading`?`common.loading`:`connection.activity.${e()}`)),k(()=>e()===`offline`?void 0:`status`,e=>{D(t,`role`,e)}),t})()}),a),t}}),O(F,{get title(){return v(`connection.access.sessionTitle`)},get description(){return v(`connection.access.sessionDescription`,{host:R(e.liveGatewayUrl)})},get children(){return[O(N,{get title(){return v(`connection.access.sessionKey`)},get description(){return v(`connection.access.sessionKeyHint`)},get control(){var t=$e();return t._$$input=t=>e.onSessionKeyChange(t.currentTarget.value),k(()=>({e:v(`connection.access.sessionKey`),t:e.settings.sessionKey}),({e,t:n},r)=>{e!==r?.e&&D(t,`aria-label`,e),t.value=n??``}),t}}),O(S,{get when(){return e.sessionDirty},get fallback(){return O(S,{get when(){return e.sessionSaved},get children(){var e=et();return T(e,()=>v(`connection.access.saved`)),e}})},get children(){var t=Ze(),n=t.firstChild.nextSibling.firstChild,r=n.nextSibling;return n._$$click=()=>e.onDiscardSession(),T(n,()=>v(`connection.access.discard`)),r._$$click=()=>e.onSaveSession(),T(r,()=>v(`common.save`)),k(()=>!e.settings.sessionKey.trim(),e=>{D(r,`disabled`,e)}),t}})]}}),O(j,{get fallback(){return O(W,x(e,{pending:!0}))},get children(){return O(W,x(e,{get pending(){return de(e.systemInfoReady)}}))}}),O(S,{get when(){return e.canForgetDevice},get children(){return O(F,{get title(){return v(`connection.browser.title`)},get children(){return O(N,{get title(){return v(`connection.browser.savedSignIn`)},get control(){var t=Z();return t._$$click=()=>e.onForgetDevice(),T(t,()=>v(`connection.browser.forgetDevice`)),t}})}})}})]}})}function We(e){let t=()=>Math.min(Math.max(e.fraction,0),1),n=()=>Math.round(t()*100),r=()=>t()>=.92?`critical`:t()>=.75?`warn`:`ok`;var i=tt(),a=i.firstChild;return k(()=>({e:v(`quickSettings.system.usage`,{label:e.label}),t:n(),a:[`config-host__meter-fill`,`config-host__meter-fill--${r()}`],o:`${n()}%`}),({e,t,a:n,o:r},o)=>{e!==o?.e&&D(i,`aria-label`,e),t!==o?.t&&D(i,`aria-valuenow`,t),pe(a,n,o?.a),r!==o?.o&&he(a,`--config-host-meter-fill`,r)}),i}function Ge(e){let t=()=>e.stat.path?`${e.stat.label} ${e.stat.path}`:e.stat.label;var n=it(),r=n.firstChild,i=r.firstChild,a=i.nextSibling,o=r.nextSibling,s=o.firstChild,c=s.nextSibling,l=o.nextSibling,u=l.nextSibling;return T(r,()=>e.stat.label,i),T(r,O(S,{get when(){return e.stat.path},get children(){return[` `,(()=>{var t=$();return T(t,()=>e.stat.path),t})()]}}),a),T(o,()=>e.stat.value,s),T(o,O(S,{get when(){return e.stat.unit},get children(){return[` `,(()=>{var t=nt();return T(t,()=>e.stat.unit),t})()]}}),c),T(n,O(S,{get when(){return e.stat.usedFraction!=null},get children(){return O(We,{get label(){return t()},get fraction(){return e.stat.usedFraction}})}}),l),T(n,O(S,{get when(){return e.stat.detail},get children(){var t=rt();return T(t,()=>e.stat.detail),t}}),u),k(()=>e.stat.title,e=>{D(n,`title`,e)}),n}function H(e){return O(S,{get when(){return e.loading},fallback:`—`,get children(){return at()}})}function U(e,t,n,r){let i=t==null||n==null||t<=0?void 0:(t-n)/t;return{label:v(`quickSettings.system.${e}`),value:i==null?`—`:`${Math.round(Math.min(Math.max(i,0),1)*100)}%`,unit:i==null?void 0:v(`quickSettings.system.used`),detail:v(`quickSettings.system.freeOf`,{free:g(n),total:g(t)}),usedFraction:i,path:r}}function Ke(e){let t=e.loadAverage?.[0],n=e.loadAverage?v(`quickSettings.system.loadAverage`,{values:e.loadAverage.map(e=>e.toFixed(1)).join(` · `)}):void 0,r=[e.cpuModel,n].filter(Boolean).join(` · `)||void 0,i=v(e.cpuCount===1?`quickSettings.system.core`:`quickSettings.system.cores`,{count:String(e.cpuCount)}),a=[t==null?{label:v(`quickSettings.system.cpu`),value:i,detail:e.cpuModel}:{label:v(`quickSettings.system.cpu`),value:t.toFixed(1),unit:v(`quickSettings.system.load`),detail:i,usedFraction:e.cpuCount>0?t/e.cpuCount:void 0,title:r},U(`memory`,e.memoryTotalBytes,e.memoryFreeBytes)];for(let t of e.disks??[]){let e=U(`disk`,t.totalBytes,t.availableBytes,t.path);e.usedFraction!=null&&a.push(e)}return a}function W(e){let t=()=>e.systemInfo,n=()=>t()&&t().hostname!==t().machineName?t().hostname:void 0,r=()=>t()?.lanAddress?`${t().lanAddress}${t().port==null?``:`:${t().port}`}`:void 0,i=b(()=>t()?Ke(t()):[]);return O(S,{get when(){return!e.systemInfoUnavailable},get children(){var a=ct();return T(a,O(F,{get title(){return v(`quickSettings.system.gatewayHost`)},get actions(){return O(S,{get when(){return t()},get children(){return O(P,{kind:`ok`,get label(){return v(`quickSettings.system.up`,{duration:te(t().uptimeMs)})}})}})},get children(){var a=st(),o=a.firstChild,s=o.firstChild,c=s.nextSibling,l=c.nextSibling,u=o.nextSibling;return T(s,O(S,{get when(){return t()},get fallback(){return O(H,{get loading(){return e.pending}})},get children(){return t()?.machineName}})),T(c,O(S,{get when(){return t()},get fallback(){return O(H,{get loading(){return e.pending}})},get children(){return`${t()?.osLabel} · ${t()?.arch}`}})),T(l,O(S,{get when(){return t()},get fallback(){return O(H,{get loading(){return e.pending}})},get children(){return v(`quickSettings.system.runtime`,{version:t()?.nodeVersion??``,pid:String(t()?.pid)})}})),T(o,O(S,{get when(){return r()},get children(){var e=ot();return T(e,r),e}}),null),T(u,O(S,{get when(){return t()},get fallback(){return O(y,{each:[`cpu`,`memory`,`disk`],children:t=>(()=>{var n=lt(),r=n.firstChild,i=r.nextSibling;return T(r,()=>v(`quickSettings.system.${t}`)),T(i,O(H,{get loading(){return e.pending}})),n})()})},get children(){return O(y,{get each(){return i()},keyed:e=>`${e.label}:${e.path??``}`,children:e=>O(Ge,{get stat(){return e()}})})}})),k(()=>n()??``,e=>{D(s,`title`,e)}),a}})),k(()=>({e:Ee.host,t:e.pending?`true`:`false`}),({e,t},n)=>{e!==n?.e&&D(a,`id`,e),t!==n?.t&&D(a,`aria-busy`,t)}),a}})}var G,K,q,J,Y,X,Z,qe,Je,Q,Ye,Xe,Ze,Qe,$e,et,tt,$,nt,rt,it,at,ot,st,ct,lt,ut;function dt(){return(dt=e((()=>{A(),w(),Ie(),I(),Ce(),f(),d(),t(),L(),be(),_(),De(),G=M(`<p class=settings-row__desc role=status>`),K=M(`<div class=settings-input-with-hint><!><!>`),q=M(`<span>`),J=M(`<div><dt></dt><dd>`),Y=M(`<span class=connection-ping__error role=status>`),X=M(`<div class="settings-row connection-ping"><dl class=connection-ping__stats><!><!><!><!></dl><openclaw-sparkline class="gateway-vital connection-ping__trend"></openclaw-sparkline><p class=settings-row__desc><!><!>`,1),Z=M(`<button class=btn>`),qe=M(`<span class=btn__spinner aria-hidden=true>`),Je=M(`<div class="settings-row connection-actions"><div class=settings-row__text><span class=settings-row__desc role=status></span></div><div class="settings-row__control connection-actions__buttons"><button class="btn primary"><!><!>`),Q=M(`<p class=settings-row__desc>`),Ye=M(`<details class=connection-details><summary></summary><div class=connection-details__body><p class=settings-row__desc></p><button class=btn>`),Xe=M(`<div class="settings-row connection-activity"><!><!><!>`),Ze=M(`<div class=settings-row><div class=settings-row__text></div><div class="settings-row__control connection-actions__buttons"><button class=btn></button><button class="btn primary">`),Qe=M(`<input class=settings-input inputmode=url autocapitalize=none autocorrect=off autocomplete=off spellcheck=false placeholder=wss://gateway.example:443>`),$e=M(`<input class=settings-input>`),et=M(`<div class=settings-row role=status>`),tt=M(`<div class=config-host__meter role=meter aria-valuemin=0 aria-valuemax=100><div>`),$=M(`<span class=config-host__stat-path>`),nt=M(`<span class=config-host__stat-unit>`),rt=M(`<div class=config-host__stat-detail>`),it=M(`<div class=config-host__stat><div class=config-host__stat-label><!><!></div><div class=config-host__stat-value><!><!></div><!><!>`),at=M(`<span class="skeleton config-host__placeholder"aria-hidden=true>`),ot=M(`<code class=config-host__address>`),st=M(`<div class=config-host><div class=config-host__identity><div class=config-host__name></div><div class=config-host__meta></div><div class=config-host__meta></div></div><div class=config-host__stats>`),ct=M(`<div>`),lt=M(`<div class=config-host__stat><div class=config-host__stat-label></div><div class=config-host__stat-value>`),re(Se),ut={none:`connection.access.auth.none`,token:`connection.access.auth.token`,password:`connection.access.auth.password`,"trusted-proxy":`connection.access.auth.trustedProxy`},me([`click`,`input`])})))()}function ft(){let e=oe(),[t,n]=se(0,{ownedWrite:!0}),r=()=>n(e=>e+1),i=new z(e,r);i.polling=ge(p,()=>i.refreshDiagnostics()),i.gateway=Me({getGateway:()=>e.gateway,invalidateRequests:()=>i.dispose(),onSnapshot:e=>{i.handleGatewaySnapshot(e),r()},onPageActivation:()=>i.syncDiagnosticsPolling()}),fe(()=>()=>i.dispose());let a=()=>(t(),i.viewProps()),o=b(()=>(t(),{completion:i.systemInfoRead,failed:i.statusFailed}),{equals:(e,t)=>e.completion===t.completion&&e.failed===t.failed}),s=le(()=>{let e=o();return e.completion??e.failed});var c=pt(),d=c.firstChild,f=d.nextSibling;return c._$owner=C(),T(c,O(je,{get title(){return u(`connection`,v)},get subtitle(){return[E(()=>l(`connection`,v)),` `,O(Ae,{url:mt})]}}),d),T(c,O(Pe,{get children(){return O(Ue,x(a,{systemInfoReady:s}))}}),f),c}var pt,mt;function ht(){return(ht=e((()=>{A(),w(),s(),I(),Fe(),Te(),ne(),Ne(),_(),_e(),h(),B(),dt(),pt=M(`<openclaw-connection-page><!><!>`,1),we(),mt=`https://docs.openclaw.ai/gateway/remote`})))()}ht();export{ft as ConnectionPage};