UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

1 lines • 1.73 kB
import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{mi as t,pi as n}from"./_4____________________________.js";import{GN as r,JN as i,WC as a,fN as o,pN as s}from"./_2_____________________________.js";import{F as c,O as l,Rt as u,U as d,d as f,g as p,j as m,l as h,s as g,u as _,x as v}from"./_6____________________.js";var y,b;function x(){return(x=e((()=>{t(),y={chat:{failedMessageEdit:{label:`Edit message`,draftBlocked:`Send or clear your current draft before editing this message.`}}},b=Object.assign(()=>a(n,y),{catalog:y})})))()}function S(e){if(!e?.isCurrent())return;let{state:t,runId:n,readIdentity:r}=e,i=()=>{let e=t.chatMessages.findLast(e=>r(e)?.role===`user`),i=r(e);return i?.runId===n&&!i.isImported?i.id:null},a=()=>!!(t.chatMessage||t.chatAttachments.length||t.chatMentions?.length||t.chatReplyTarget||t.chatGoalDraftMode);if(i())return{disabled:a(),run:()=>{let t=i();return!e.isCurrent()||!t||a()?!1:e.rewind(t)}}}function C(e){let t=c(()=>S(e.source)),n=()=>i(`chat.failedMessageEdit.label`);return m(l,{get when(){return t()},get children(){var r=w(),a=r.firstChild,s=a.firstChild,c=s.firstChild,l=c.nextSibling;return a._$owner=u(),s._$$click=n=>{let r=t(),i=e.onFocusComposer;r&&e.confirm(n.currentTarget,()=>{Promise.resolve(r.run()).then(e=>{e&&i?.()})})},f(s,m(o,{name:`refresh`}),c),f(s,n,l),h(()=>({e:t()?.disabled?i(`chat.failedMessageEdit.draftBlocked`):n(),t:n(),a:t()?.disabled}),({e,t,a:n},r)=>{e!==r?.e&&(a.content=e),t!==r?.t&&p(s,`aria-label`,t),n!==r?.a&&p(s,`disabled`,n)}),r}})}var w;function T(){return(T=e((()=>{_(),d(),s(),x(),r(),w=v(`<span class=chat-confirm-wrap><openclaw-tooltip><button type=button class="btn btn--sm"><!><!>`,1),b(),g([`click`])})))()}T();export{C as default};