openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
1 lines • 2.33 kB
JavaScript
import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{Yn as t}from"./control-ui-connection-Bfj9beF_.js";import{_j as n,dj as r,hj as i,mj as a}from"./control-ui-boot-shared-DFTSUQQ0.js";import{F as o,O as s,U as c,d as l,f as u,g as d,gt as f,j as p,l as m,m as h,s as g,u as _,x as v}from"./solid-runtime-C416s-HC.js";import{dr as y,fr as b}from"./deferred-ui-support-D-VedBtc.js";function x(e){let t=o(()=>n(e.confirmation,e=>e.read())),r=()=>t().read();return p(s,{get when(){return r()},keyed:!0,children:t=>{let n;f(()=>{n?.isConnected&&e.confirmation.read()===t&&n.focus({preventScroll:!0})});let r=()=>a(t.kind===`message`?`mcpApp.confirmMessage`:`mcpApp.confirmFile`);var i=S(),o=i.firstChild,s=o.firstChild,c=s.nextSibling,p=c.nextSibling,g=o.nextSibling.firstChild,_=g.nextSibling;return i._$$keydown=t=>{(t.key===`Escape`||t.key===`Enter`)&&(t.stopPropagation(),(t.key===`Escape`||t.target===t.currentTarget)&&(t.preventDefault(),e.confirmation.finish(t.key===`Enter`)))},h(()=>e=>n=e,i),l(s,()=>t.title),l(c,r),l(p,(()=>{var e=u(()=>t.text.length>200);return()=>e()?`${t.text.slice(0,200)}…`:t.text})()),g._$$click=()=>e.confirmation.finish(!0),l(g,()=>a(t.kind===`message`?`mcpApp.sendMessage`:`mcpApp.openFile`)),_._$$click=()=>e.confirmation.finish(!1),l(_,()=>a(`mcpApp.cancel`)),m(()=>({e:`${t.title}: ${r()}`,t:t.title,a:t.text}),({e,t,a:n},r)=>{e!==r?.e&&d(i,`aria-label`,e),t!==r?.t&&d(s,`title`,t),n!==r?.a&&d(p,`title`,n)}),i}})}var S;function C(){return(C=e((()=>{_(),c(),y(),r(),i(),S=v(`<div class=mcp-app-confirm role=alertdialog tabindex=-1><div class=mcp-app-confirm__copy><div class=mcp-app-confirm__title></div><div></div><div class=mcp-app-confirm__preview></div></div><div class=mcp-app-confirm__actions><button class=mcp-app-confirm__accept type=button></button><button type=button>`),b(),g([`keydown`,`click`])})))()}function w(){let e=null,n=t();function r(t,r=!0){let i=e;if(!i)return;e=null,n.publish();let a=i.isCurrent()&&i.frame.isConnected;r&&a&&i.frame.focus({preventScroll:!0}),i.resolve(t&&a)}return{read:()=>e,subscribe:n.subscribe,request(t){return e||!t.isCurrent()?Promise.resolve(!1):new Promise(r=>{e={...t,resolve:r},n.publish()})},cancel:()=>r(!1,!1),update(){e&&!e.isCurrent()&&r(!1,!1)},finish:r}}function T(){return(T=e((()=>{})))()}export{C as i,T as n,x as r,w as t};