UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

1 lines • 2.32 kB
import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{Ya as t}from"./_4____________________________.js";import{GN as n,JN as r,YN as i,ZN as a}from"./_2_____________________________.js";import{Li as o,Ri as s}from"./deferred-ui-support-DZEPWjAk.js";import{F as c,O as l,U as u,d,f,g as p,gt as m,j as h,l as g,m as _,s as v,u as y,x as b}from"./_6____________________.js";function x(e){let t=c(()=>a(e.confirmation,e=>e.read())),n=()=>t().read();return h(l,{get when(){return n()},keyed:!0,children:t=>{let n;m(()=>{n?.isConnected&&e.confirmation.read()===t&&n.focus({preventScroll:!0})});let i=()=>r(t.kind===`message`?`mcpApp.confirmMessage`:`mcpApp.confirmFile`);var a=S(),o=a.firstChild,s=o.firstChild,c=s.nextSibling,l=c.nextSibling,u=o.nextSibling.firstChild,h=u.nextSibling;return a._$$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`)))},_(()=>e=>n=e,a),d(s,()=>t.title),d(c,i),d(l,(()=>{var e=f(()=>t.text.length>200);return()=>e()?`${t.text.slice(0,200)}…`:t.text})()),u._$$click=()=>e.confirmation.finish(!0),d(u,()=>r(t.kind===`message`?`mcpApp.sendMessage`:`mcpApp.openFile`)),h._$$click=()=>e.confirmation.finish(!1),d(h,()=>r(`mcpApp.cancel`)),g(()=>({e:`${t.title}: ${i()}`,t:t.title,a:t.text}),({e,t,a:n},r)=>{e!==r?.e&&p(a,`aria-label`,e),t!==r?.t&&p(s,`title`,t),n!==r?.a&&p(l,`title`,n)}),a}})}var S;function C(){return(C=e((()=>{y(),u(),o(),n(),i(),S=b(`<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>`),s(),v([`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};