hermes-web-ui 0.6.19-beta.1 → 0.6.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/js/{ChannelsView-R4lITyrN.js → ChannelsView-Ag8OEodp.js} +1 -1
- package/dist/client/assets/js/{ChatPanel-CuVS9Cpb.js → ChatPanel-BrmqJHNK.js} +1 -1
- package/dist/client/assets/js/{ChatView-51Y8-6We.js → ChatView-gJPxYHRo.js} +1 -1
- package/dist/client/assets/js/{CodingAgentsView-o-84bi7b.js → CodingAgentsView-ipSR8pbp.js} +1 -1
- package/dist/client/assets/js/{DevicesView-h7Zwuzkq.js → DevicesView-DHrcql13.js} +1 -1
- package/dist/client/assets/js/{FileRenameModal-CG4nr9lS.js → FileRenameModal-CLIjRvNr.js} +1 -1
- package/dist/client/assets/js/{FilesView-BCwF32gb.js → FilesView-DIj14SkV.js} +1 -1
- package/dist/client/assets/js/{GlobalAgentView-BNeajjWr.js → GlobalAgentView-D2oOzpvZ.js} +1 -1
- package/dist/client/assets/js/{GroupChatView-CtiHsUW2.js → GroupChatView-DMzl_3h-.js} +1 -1
- package/dist/client/assets/js/{HistoryMessageList-Bbvc_rDC.js → HistoryMessageList-QE8QSGJq.js} +1 -1
- package/dist/client/assets/js/{HistoryView-DTS_-MOq.js → HistoryView-Cvo-m7a-.js} +1 -1
- package/dist/client/assets/js/{JobsView-BEpDwaYZ.js → JobsView-wT1iJzrC.js} +1 -1
- package/dist/client/assets/js/{KanbanView-BwHs9yhx.js → KanbanView-4y2U2D2S.js} +1 -1
- package/dist/client/assets/js/{LoginView-BO-kJG8E.js → LoginView-Bi3Gqxy7.js} +1 -1
- package/dist/client/assets/js/{LogsView-BWtHg0rY.js → LogsView-C89l_rDy.js} +1 -1
- package/dist/client/assets/js/{MarkdownRenderer-CIx7sgOl.js → MarkdownRenderer-4F5njY0A.js} +1 -1
- package/dist/client/assets/js/{McpManagerView-DH_bBWTD.js → McpManagerView-BtIU8_27.js} +1 -1
- package/dist/client/assets/js/{MemoryView-C62_8Q5e.js → MemoryView-Yyh5SN0T.js} +1 -1
- package/dist/client/assets/js/{MessageItem-CiLT5Cpc.js → MessageItem-Ci7UFgqI.js} +1 -1
- package/dist/client/assets/js/{ModelsView-CxcQxMjo.js → ModelsView-r7wvbIwf.js} +1 -1
- package/dist/client/assets/js/{OutlinePanel-DWHXcxCU.js → OutlinePanel-L7D8-Ikf.js} +1 -1
- package/dist/client/assets/js/{PerformanceView-Dl496qH8.js → PerformanceView-CBtzGjmQ.js} +1 -1
- package/dist/client/assets/js/{PluginsView-cuXTwemx.js → PluginsView-DJL5V6Pk.js} +1 -1
- package/dist/client/assets/js/{ProfilesView-CENWOG4L.js → ProfilesView-B6oUYlws.js} +1 -1
- package/dist/client/assets/js/{SettingRow-DlO3pPcg.js → SettingRow-0_6ZIyYN.js} +1 -1
- package/dist/client/assets/js/{SettingsCircuitBadge-6dmnDQb1.js → SettingsCircuitBadge-BMGa0qD8.js} +1 -1
- package/dist/client/assets/js/{SettingsView-1pU-xU8a.js → SettingsView-DuTNoQGi.js} +1 -1
- package/dist/client/assets/js/{SkillsUsageView-Ccf6rJxA.js → SkillsUsageView-CJcDROgg.js} +1 -1
- package/dist/client/assets/js/{SkillsView-CRaLpRCl.js → SkillsView-CY5Olxqc.js} +1 -1
- package/dist/client/assets/js/{TerminalPanel-BfRB2Y8u.js → TerminalPanel-BoahxMAQ.js} +1 -1
- package/dist/client/assets/js/{TerminalView-BYKZXepo.js → TerminalView-Dttao2OL.js} +1 -1
- package/dist/client/assets/js/{UsageView-CbggYElq.js → UsageView-lGUx8vNS.js} +1 -1
- package/dist/client/assets/js/{VersionPreviewView-vxm_TRsi.js → VersionPreviewView-BAHRWETM.js} +1 -1
- package/dist/client/assets/js/{_plugin-vue_export-helper-DIpMhnga.js → _plugin-vue_export-helper-D9aS-jmR.js} +2 -2
- package/dist/client/assets/js/{chat-timestamp-CSe88NJz.js → chat-timestamp-Cs7c547g.js} +1 -1
- package/dist/client/assets/js/{index-kbqf1KFz.js → index-D7Ma0wep.js} +1 -1
- package/dist/client/assets/js/{models-HlnNcHHk.js → models-pLc8SjNq.js} +1 -1
- package/dist/client/assets/js/{session-browser-prefs--p0ZgG03.js → session-browser-prefs-16DgLY_L.js} +1 -1
- package/dist/client/assets/js/{skills-BROW9HzT.js → skills-DhYpy-kw.js} +1 -1
- package/dist/client/assets/js/{system-Dkwwe7Dj.js → system-D4wB1NDc.js} +1 -1
- package/dist/client/assets/js/{ttsHelpers-BdWxSCbS.js → ttsHelpers-DpXZJub7.js} +1 -1
- package/dist/client/assets/js/{useSttSettings-DmguRaGs.js → useSttSettings-B1qx7G5j.js} +1 -1
- package/dist/client/index.html +3 -3
- package/dist/server/index.js +3 -3
- package/dist/server/index.js.map +1 -1
- package/dist/server/openapi.json +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as H}from"./rolldown-runtime-M0oDzQ_3.js";import{An as Ae,Bt as Ie,Dn as v,En as Be,Gn as B,In as o,It as u,Kn as D,Kt as N,Ot as te,Pn as Pe,Rt as Re,Tn as Ve,V as De,an as C,ar as S,cn as _,dn as L,er as e,fn as n,g as xe,in as Le,kn as $e,m as g,nr as ne,on as F,pn as Q,sn as b,t as E,tn as z}from"./ui-vendor-BUz-RIuE.js";import{c as O,l as j}from"./vue-vendor-BAk4Aood.js";import{n as G,t as J}from"./_plugin-vue_export-helper-DIpMhnga.js";import{F as We,I as Ne,M as we,P as Fe,R as Qe,ht as Ee,j as ye,mt as Oe,z as je}from"./index-kbqf1KFz.js";import{n as Ge,t as s}from"./SettingRow-DlO3pPcg.js";var ie,oe,re,se,qe,de=H((()=>{N(),E(),O(),ie={class:"platform-info"},oe=["innerHTML"],re={class:"platform-name"},se={key:0,class:"platform-card-body"},qe=Q({__name:"PlatformCard",props:{name:{},icon:{},config:{},credentials:{},exclusive:{type:Boolean}},setup(T){const h=T,y=D(!0),{t:a}=j(),U=Le(()=>{const k=h.credentials;if(!k)return!1;const w=["token","api_key","app_id","client_id","secret","app_secret","client_secret","access_token","bot_id","account_id","enabled"];return[k,k.extra].filter(Boolean).some(M=>w.some(A=>{const q=M[A];return q!=null&&q!==""&&q!==!1}))});return(k,w)=>(v(),_("div",{class:ne(["platform-card",{configured:U.value}])},[C("div",{class:"platform-card-header",onClick:w[0]||(w[0]=M=>y.value=!y.value)},[C("div",ie,[C("span",{class:"platform-icon",innerHTML:T.icon},null,8,oe),C("span",re,S(T.name),1),n(e(Ie),{type:U.value?"success":"default",size:"small",round:""},{default:o(()=>[L(S(U.value?e(a)("common.configured"):e(a)("common.notConfigured")),1)]),_:1},8,["type"])]),C("span",{class:ne(["expand-icon",{expanded:y.value}])},"▾",2)]),y.value?(v(),_("div",se,[T.exclusive?(v(),F(e(Re),{key:0,type:"warning","show-icon":!0,class:"exclusive-alert"},{default:o(()=>[L(S(e(a)("platform.exclusiveTokenWarning")),1)]),_:1})):b("",!0),Ae(k.$slots,"default",{},void 0,!0)])):b("",!0)],2))}})})),Je=H((()=>{})),ze,Ke=H((()=>{de(),de(),Je(),G(),ze=J(qe,[["__scopeId","data-v-e27ecbbe"]])})),ue,pe,ce,me,fe,Ce,ve=H((()=>{N(),E(),O(),ye(),We(),Ke(),Ge(),ue={class:"settings-section"},pe={class:"weixin-qr-section"},ce={key:1,class:"weixin-qr-loading"},me={key:2,class:"weixin-qr-hint"},fe={class:"platform-actions"},Ce=Q({__name:"PlatformSettings",setup(T){const h=we(),y=De(),{t:a}=j(),U=B({}),k=B({}),w=B({}),M=B({}),A=B({});function q(i){return JSON.parse(JSON.stringify(i||{}))}function $(i,l){for(const[m,t]of Object.entries(l))t&&typeof t=="object"&&!Array.isArray(t)?i[m]=$({...i[m]||{}},t):i[m]=t;return i}function p(i){return k[i]||(k[i]=q(h[i])),k[i]}function d(i){return w[i]||(w[i]=q(I(i))),w[i]}function c(i,l){k[i]=$({...p(i)},l),M[i]=!0}function f(i,l){w[i]=$({...d(i)},l),A[i]=!0}function K(i,l){return JSON.stringify(i||{})===JSON.stringify(l||{})}function X(i){return!!M[i]&&!!k[i]&&!K(k[i],h[i])}function Y(i){return!!A[i]&&!!w[i]&&!K(w[i],I(i))}function Se(i){return X(i)||Y(i)}function r(i){return!!U[i]}async function Me(i){U[i]=!0;try{const l=X(i),m=Y(i);l&&await h.saveSection(i,p(i),{restart:!m}),m&&(await Qe(i,d(i)),await h.fetchSettings()),k[i]=q(h[i]),w[i]=q(I(i)),M[i]=!1,A[i]=!1,y.success(a("settings.saved"))}catch(l){y.error(l?.message||a("settings.saveFailed"))}finally{U[i]=!1}}function I(i){return h.platforms[i]||{}}function Z(i){return i===!0||i==="true"}const ee=D(""),P=D(""),x=D("idle");let R=null;async function Te(){x.value="loading",ee.value="",P.value="",le();try{const i=await Fe();P.value=i.qrcode,ee.value=i.qrcode_url,window.open(i.qrcode_url,"_blank"),x.value="waiting",V()}catch(i){x.value="error",y.error(i.message||a("platform.qrFetching"))}}function V(){P.value&&(R=setTimeout(async()=>{try{const i=await Ne(P.value);i.status==="wait"?V():i.status==="scaned"?(x.value="scaned",V()):i.status==="expired"?x.value="expired":i.status==="confirmed"&&(x.value="confirmed",await je({account_id:i.account_id,token:i.token,base_url:i.base_url}),await h.fetchSettings(),y.success(a("settings.saved")))}catch{V()}},3e3))}function le(){R&&(clearTimeout(R),R=null)}Be(()=>{le()});const ae=[{key:"telegram",name:"Telegram",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.479.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"/></svg>'},{key:"discord",name:"Discord",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189z"/></svg>'},{key:"slack",name:"Slack",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zm1.271 0a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zm0 1.271a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zm10.122 0a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V5.042zm-1.27 0a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312zM15.165 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zm0-1.27a2.527 2.527 0 0 1 2.523-2.52h6.313A2.528 2.528 0 0 1 24 18.956a2.528 2.528 0 0 1-2.522 2.523h-6.313z"/></svg>'},{key:"whatsapp",name:"WhatsApp",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z"/></svg>'},{key:"matrix",name:"Matrix",icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M.632.55v22.9H2.28V24H0V0h2.28v.55zm7.043 7.26v1.157h.033c.309-.443.683-.784 1.117-1.024.433-.245.936-.365 1.5-.365.54 0 1.033.107 1.48.324.448.217.786.619 1.017 1.205.24-.376.558-.702.956-.98.398-.277.872-.414 1.424-.414.41 0 .784.065 1.122.194.34.13.629.325.87.588.241.263.428.59.56.984.132.393.198.85.198 1.368v5.89h-2.49v-4.893c0-.268-.016-.525-.048-.77a1.627 1.627 0 00-.2-.63 1.028 1.028 0 00-.392-.426 1.294 1.294 0 00-.616-.134c-.277 0-.508.05-.693.15a1.043 1.043 0 00-.43.41 1.768 1.768 0 00-.214.616 4.15 4.15 0 00-.06.74v4.937H9.29v-4.937c0-.25-.01-.498-.032-.742a1.84 1.84 0 00-.166-.638.998.998 0 00-.363-.448 1.206 1.206 0 00-.624-.154c-.26 0-.483.048-.67.144a1.055 1.055 0 00-.436.402 1.744 1.744 0 00-.227.616 4.108 4.108 0 00-.063.74v4.937H5.21V7.81zm15.693 15.64V.55H21.72V0H24v24h-2.28v-.55z"/></svg>'},{key:"feishu",name:"Feishu",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M6.59 3.41a2.25 2.25 0 0 1 3.182 0L13.5 7.14l-3.182 3.182L6.59 7.59a2.25 2.25 0 0 1 0-3.182zm5.303 5.303L15.075 5.53a2.25 2.25 0 0 1 3.182 3.182L15.075 11.894 11.893 8.713zM3.41 6.59a2.25 2.25 0 0 1 3.182 0l3.182 3.182-3.182 3.182a2.25 2.25 0 0 1-3.182-3.182L3.41 6.59zm5.303 5.303L11.894 15.075a2.25 2.25 0 0 1-3.182 3.182L5.53 15.075 8.713 11.893zm5.303-5.303L17.478 9.778a2.25 2.25 0 0 1-3.182 3.182L10.53 10.075l3.182-3.182 0 .023z"/></svg>'},{key:"dingtalk",name:"DingTalk",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M19.76 7.05c-.23-.52-.7-.9-1.26-1.02L5.35 3.2c-.77-.16-1.51.38-1.58 1.16-.22 2.55.17 5.4 1.13 7.66.97 2.29 2.52 4.11 4.45 4.82l-1.28 3.03c-.17.4.24.79.63.59l9.47-4.83c.34-.17.55-.52.55-.9v-3.12c.73-.4 1.22-1.17 1.22-2.06 0-.87-.08-1.73-.18-2.5zm-3.66 5.95-5.19 2.65.76-1.8c.12-.29-.03-.62-.33-.72-2.1-.73-3.56-3.54-3.95-6.73l9.27 2c.04.38.07.76.07 1.15 0 .45-.36.81-.81.81h-2.79c-.35 0-.63.28-.63.63s.28.63.63.63h2.97V13z"/></svg>'},{key:"qqbot",name:"QQBot",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C7.58 2 4 5.27 4 9.31c0 2.3 1.15 4.34 2.95 5.68-.13.58-.48 1.62-1.26 2.53-.24.28-.05.72.32.73 1.72.05 3.02-.68 3.69-1.15.72.16 1.49.25 2.3.25 4.42 0 8-3.27 8-7.31S16.42 2 12 2zm-3.2 7.63c-.63 0-1.14-.55-1.14-1.23s.51-1.23 1.14-1.23 1.14.55 1.14 1.23-.51 1.23-1.14 1.23zm6.4 0c-.63 0-1.14-.55-1.14-1.23s.51-1.23 1.14-1.23 1.14.55 1.14 1.23-.51 1.23-1.14 1.23zM5.5 20.5a.5.5 0 0 1 .5-.5h12a.5.5 0 0 1 0 1H6a.5.5 0 0 1-.5-.5z"/></svg>'},{key:"weixin",name:"Weixin",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M8.691 2.188C3.891 2.188 0 5.476 0 9.53c0 2.212 1.17 4.203 3.002 5.55a.59.59 0 01.213.665l-.39 1.48c-.019.07-.048.141-.048.213 0 .163.13.295.29.295a.326.326 0 00.167-.054l1.903-1.114a.864.864 0 01.717-.098 10.16 10.16 0 002.837.403c.276 0 .543-.027.811-.05-.857-2.578.157-4.972 1.932-6.446 1.703-1.415 3.882-1.98 5.853-1.838-.576-3.583-4.196-6.348-8.596-6.348zM5.785 5.991c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 01-1.162 1.178A1.17 1.17 0 014.623 7.17c0-.651.52-1.18 1.162-1.18zm5.813 0c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 01-1.162 1.178 1.17 1.17 0 01-1.162-1.178c0-.651.52-1.18 1.162-1.18zm3.68 4.025c-3.694 0-6.69 2.462-6.69 5.496 0 3.034 2.996 5.496 6.69 5.496.753 0 1.477-.1 2.158-.28a.66.66 0 01.548.074l1.46.854a.25.25 0 00.127.041.224.224 0 00.221-.225c0-.055-.022-.109-.037-.162l-.298-1.131a.453.453 0 01.163-.509C21.81 18.613 22.77 16.973 22.77 15.512c0-3.034-2.996-5.496-6.69-5.496h.198zm-2.454 3.347c.491 0 .889.404.889.902a.896.896 0 01-.889.903.896.896 0 01-.889-.903c0-.498.398-.902.889-.902zm4.912 0c.491 0 .889.404.889.902a.896.896 0 01-.889.903.896.896 0 01-.889-.903c0-.498.398-.902.889-.902z"/></svg>'},{key:"wecom",name:"WeCom",icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M8.691 2.188C3.891 2.188 0 5.476 0 9.53c0 2.212 1.17 4.203 3.002 5.55a.59.59 0 01.213.665l-.39 1.48c-.019.07-.048.141-.048.213 0 .163.13.295.29.295a.326.326 0 00.167-.054l1.903-1.114a.864.864 0 01.717-.098 10.16 10.16 0 002.837.403c.276 0 .543-.027.811-.05-.857-2.578.157-4.972 1.932-6.446 1.703-1.415 3.882-1.98 5.853-1.838-.576-3.583-4.196-6.348-8.596-6.348zM5.785 5.991c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 01-1.162 1.178A1.17 1.17 0 014.623 7.17c0-.651.52-1.18 1.162-1.18zm5.813 0c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 01-1.162 1.178 1.17 1.17 0 01-1.162-1.178c0-.651.52-1.18 1.162-1.18zm3.68 4.025c-3.694 0-6.69 2.462-6.69 5.496 0 3.034 2.996 5.496 6.69 5.496.753 0 1.477-.1 2.158-.28a.66.66 0 01.548.074l1.46.854a.25.25 0 00.127.041.224.224 0 00.221-.225c0-.055-.022-.109-.037-.162l-.298-1.131a.453.453 0 01.163-.509C21.81 18.613 22.77 16.973 22.77 15.512c0-3.034-2.996-5.496-6.69-5.496h.198zm-2.454 3.347c.491 0 .889.404.889.902a.896.896 0 01-.889.903.896.896 0 01-.889-.903c0-.498.398-.902.889-.902zm4.912 0c.491 0 .889.404.889.902a.896.896 0 01-.889.903.896.896 0 01-.889-.903c0-.498.398-.902.889-.902z"/></svg>'}];return Pe(()=>ae.map(i=>({key:i.key,config:h[i.key],credentials:I(i.key)})),i=>{for(const l of i)M[l.key]||(k[l.key]=q(l.config)),A[l.key]||(w[l.key]=q(l.credentials))},{deep:!0,immediate:!0}),(i,l)=>(v(),_("section",ue,[(v(),_(z,null,$e(ae,m=>n(ze,{key:m.key,name:m.name,icon:m.icon,exclusive:m.exclusive,config:e(h)[m.key],credentials:I(m.key)},{default:o(()=>[m.key==="telegram"?(v(),_(z,{key:0},[n(s,{label:e(a)("platform.botToken"),hint:e(a)("platform.botTokenHint")},{default:o(()=>[n(e(u),{value:d("telegram").token||"",loading:r("telegram"),clearable:"",size:"small",class:"input-lg",placeholder:"123456:ABC-DEF...","onUpdate:value":l[0]||(l[0]=t=>f("telegram",{token:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionGroup")},{default:o(()=>[n(e(g),{value:p("telegram").require_mention,loading:r("telegram"),"onUpdate:value":l[1]||(l[1]=t=>c("telegram",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.reactions"),hint:e(a)("platform.reactionsHint")},{default:o(()=>[n(e(g),{value:p("telegram").reactions,loading:r("telegram"),"onUpdate:value":l[2]||(l[2]=t=>c("telegram",{reactions:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.freeResponseChats"),hint:e(a)("platform.freeResponseChatsHint")},{default:o(()=>[n(e(u),{value:p("telegram").free_response_chats||"",loading:r("telegram"),size:"small",placeholder:"chat_id1,chat_id2","onUpdate:value":l[3]||(l[3]=t=>c("telegram",{free_response_chats:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.mentionPatterns"),hint:e(a)("platform.mentionPatternsHint")},{default:o(()=>[n(e(u),{value:(p("telegram").mention_patterns||[]).join(", "),loading:r("telegram"),size:"small",placeholder:"pattern1, pattern2","onUpdate:value":l[4]||(l[4]=t=>c("telegram",{mention_patterns:t?t.split(",").map(W=>W.trim()):[]}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="discord"?(v(),_(z,{key:1},[n(s,{label:e(a)("platform.botToken"),hint:e(a)("platform.botTokenHint")},{default:o(()=>[n(e(u),{value:d("discord").token||"",loading:r("discord"),clearable:"",size:"small",class:"input-lg",placeholder:"Bot token...","onUpdate:value":l[5]||(l[5]=t=>f("discord",{token:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionChannel")},{default:o(()=>[n(e(g),{value:p("discord").require_mention,loading:r("discord"),"onUpdate:value":l[6]||(l[6]=t=>c("discord",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.autoThread"),hint:e(a)("platform.autoThreadHint")},{default:o(()=>[n(e(g),{value:p("discord").auto_thread,loading:r("discord"),"onUpdate:value":l[7]||(l[7]=t=>c("discord",{auto_thread:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.reactions"),hint:e(a)("platform.reactionsHint")},{default:o(()=>[n(e(g),{value:p("discord").reactions,loading:r("discord"),"onUpdate:value":l[8]||(l[8]=t=>c("discord",{reactions:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.freeResponseChannels"),hint:e(a)("platform.freeResponseChannelsHint")},{default:o(()=>[n(e(u),{value:p("discord").free_response_channels||"",loading:r("discord"),size:"small",placeholder:"channel_id1,channel_id2","onUpdate:value":l[9]||(l[9]=t=>c("discord",{free_response_channels:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.allowedChannels"),hint:e(a)("platform.allowedChannelsHint")},{default:o(()=>[n(e(u),{value:p("discord").allowed_channels||"",loading:r("discord"),size:"small",placeholder:"channel_id1,channel_id2","onUpdate:value":l[10]||(l[10]=t=>c("discord",{allowed_channels:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.ignoredChannels"),hint:e(a)("platform.ignoredChannelsHint")},{default:o(()=>[n(e(u),{value:p("discord").ignored_channels||"",loading:r("discord"),size:"small",placeholder:"channel_id1,channel_id2","onUpdate:value":l[11]||(l[11]=t=>c("discord",{ignored_channels:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.noThreadChannels"),hint:e(a)("platform.noThreadChannelsHint")},{default:o(()=>[n(e(u),{value:p("discord").no_thread_channels||"",loading:r("discord"),size:"small",placeholder:"channel_id1,channel_id2","onUpdate:value":l[12]||(l[12]=t=>c("discord",{no_thread_channels:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="slack"?(v(),_(z,{key:2},[n(s,{label:e(a)("platform.botToken"),hint:e(a)("platform.botTokenHint")},{default:o(()=>[n(e(u),{value:d("slack").token||"",loading:r("slack"),clearable:"",size:"small",class:"input-lg",placeholder:"xoxb-...","onUpdate:value":l[13]||(l[13]=t=>f("slack",{token:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionChannel")},{default:o(()=>[n(e(g),{value:p("slack").require_mention,loading:r("slack"),"onUpdate:value":l[14]||(l[14]=t=>c("slack",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.allowBots"),hint:e(a)("platform.allowBotsHint")},{default:o(()=>[n(e(g),{value:p("slack").allow_bots,loading:r("slack"),"onUpdate:value":l[15]||(l[15]=t=>c("slack",{allow_bots:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.freeResponseChannels"),hint:e(a)("platform.freeResponseChannelsHint")},{default:o(()=>[n(e(u),{value:p("slack").free_response_channels||"",loading:r("slack"),size:"small",placeholder:"channel_id1,channel_id2","onUpdate:value":l[16]||(l[16]=t=>c("slack",{free_response_channels:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="whatsapp"?(v(),_(z,{key:3},[n(s,{label:e(a)("platform.waEnabled"),hint:e(a)("platform.waEnabledHint")},{default:o(()=>[n(e(g),{value:d("whatsapp").enabled,loading:r("whatsapp"),"onUpdate:value":l[17]||(l[17]=t=>f("whatsapp",{enabled:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionGroup")},{default:o(()=>[n(e(g),{value:p("whatsapp").require_mention,loading:r("whatsapp"),"onUpdate:value":l[18]||(l[18]=t=>c("whatsapp",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.freeResponseChats"),hint:e(a)("platform.freeResponseChatsHint")},{default:o(()=>[n(e(u),{value:p("whatsapp").free_response_chats||"",loading:r("whatsapp"),size:"small",placeholder:"chat_id1,chat_id2","onUpdate:value":l[19]||(l[19]=t=>c("whatsapp",{free_response_chats:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.mentionPatterns"),hint:e(a)("platform.mentionPatternsHint")},{default:o(()=>[n(e(u),{value:(p("whatsapp").mention_patterns||[]).join(", "),loading:r("whatsapp"),size:"small",placeholder:"pattern1, pattern2","onUpdate:value":l[20]||(l[20]=t=>c("whatsapp",{mention_patterns:t?t.split(",").map(W=>W.trim()):[]}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="matrix"?(v(),_(z,{key:4},[n(s,{label:e(a)("platform.accessToken"),hint:e(a)("platform.accessTokenHint")},{default:o(()=>[n(e(u),{value:d("matrix").token||"",loading:r("matrix"),clearable:"",size:"small",class:"input-lg",placeholder:"syt_...","onUpdate:value":l[21]||(l[21]=t=>f("matrix",{token:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.homeserver"),hint:e(a)("platform.homeserverHint")},{default:o(()=>[n(e(u),{value:d("matrix").extra?.homeserver||"",loading:r("matrix"),clearable:"",size:"small",class:"input-lg",placeholder:"https://matrix.org","onUpdate:value":l[22]||(l[22]=t=>f("matrix",{extra:{...d("matrix").extra,homeserver:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionRoom")},{default:o(()=>[n(e(g),{value:p("matrix").require_mention,loading:r("matrix"),"onUpdate:value":l[23]||(l[23]=t=>c("matrix",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.autoThread"),hint:e(a)("platform.autoThreadHintRoom")},{default:o(()=>[n(e(g),{value:p("matrix").auto_thread,loading:r("matrix"),"onUpdate:value":l[24]||(l[24]=t=>c("matrix",{auto_thread:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.dmMentionThreads"),hint:e(a)("platform.dmMentionThreadsHint")},{default:o(()=>[n(e(g),{value:p("matrix").dm_mention_threads,loading:r("matrix"),"onUpdate:value":l[25]||(l[25]=t=>c("matrix",{dm_mention_threads:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.freeResponseRooms"),hint:e(a)("platform.freeResponseRoomsHint")},{default:o(()=>[n(e(u),{value:p("matrix").free_response_rooms||"",loading:r("matrix"),size:"small",placeholder:"room_id1,room_id2","onUpdate:value":l[26]||(l[26]=t=>c("matrix",{free_response_rooms:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="feishu"?(v(),_(z,{key:5},[n(s,{label:e(a)("platform.appId"),hint:e(a)("platform.appIdHint")},{default:o(()=>[n(e(u),{value:d("feishu").extra?.app_id||"",loading:r("feishu"),clearable:"",size:"small",class:"input-lg",placeholder:"cli_...","onUpdate:value":l[27]||(l[27]=t=>f("feishu",{extra:{...d("feishu").extra,app_id:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.appSecret"),hint:e(a)("platform.appSecretHint")},{default:o(()=>[n(e(u),{value:d("feishu").extra?.app_secret||"",loading:r("feishu"),type:"password","show-password-on":"click",clearable:"",size:"small",class:"input-lg",placeholder:"App Secret","onUpdate:value":l[28]||(l[28]=t=>f("feishu",{extra:{...d("feishu").extra,app_secret:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.encryptKey"),hint:e(a)("platform.encryptKeyHint")},{default:o(()=>[n(e(u),{value:d("feishu").extra?.encrypt_key||"",loading:r("feishu"),type:"password","show-password-on":"click",clearable:"",size:"small",class:"input-lg",placeholder:"Encrypt Key","onUpdate:value":l[29]||(l[29]=t=>f("feishu",{extra:{...d("feishu").extra,encrypt_key:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.verificationToken"),hint:e(a)("platform.verificationTokenHint")},{default:o(()=>[n(e(u),{value:d("feishu").extra?.verification_token||"",loading:r("feishu"),type:"password","show-password-on":"click",clearable:"",size:"small",class:"input-lg",placeholder:"Verification Token","onUpdate:value":l[30]||(l[30]=t=>f("feishu",{extra:{...d("feishu").extra,verification_token:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionGroup")},{default:o(()=>[n(e(g),{value:p("feishu").require_mention,loading:r("feishu"),"onUpdate:value":l[31]||(l[31]=t=>c("feishu",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.freeResponseChats"),hint:e(a)("platform.freeResponseChatsHint")},{default:o(()=>[n(e(u),{value:p("feishu").free_response_chats||"",loading:r("feishu"),size:"small",placeholder:"chat_id1,chat_id2","onUpdate:value":l[32]||(l[32]=t=>c("feishu",{free_response_chats:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="dingtalk"?(v(),_(z,{key:6},[n(s,{label:e(a)("platform.clientId"),hint:e(a)("platform.clientIdHint")},{default:o(()=>[n(e(u),{value:d("dingtalk").extra?.client_id||"",loading:r("dingtalk"),clearable:"",size:"small",class:"input-lg",placeholder:"Client ID","onUpdate:value":l[33]||(l[33]=t=>f("dingtalk",{extra:{...d("dingtalk").extra,client_id:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.clientSecret"),hint:e(a)("platform.clientSecretHint")},{default:o(()=>[n(e(u),{value:d("dingtalk").extra?.client_secret||"",loading:r("dingtalk"),clearable:"",size:"small",class:"input-lg",placeholder:"Client Secret","onUpdate:value":l[34]||(l[34]=t=>f("dingtalk",{extra:{...d("dingtalk").extra,client_secret:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.cardTemplateId"),hint:e(a)("platform.cardTemplateIdHint")},{default:o(()=>[n(e(u),{value:d("dingtalk").extra?.card_template_id||"",loading:r("dingtalk"),clearable:"",size:"small",class:"input-lg",placeholder:"AI Card Template ID","onUpdate:value":l[35]||(l[35]=t=>f("dingtalk",{extra:{...d("dingtalk").extra,card_template_id:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.allowAllUsers"),hint:e(a)("platform.allowAllUsersHint")},{default:o(()=>[n(e(g),{value:Z(d("dingtalk").allow_all_users),loading:r("dingtalk"),"onUpdate:value":l[36]||(l[36]=t=>f("dingtalk",{allow_all_users:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.allowedUsers"),hint:e(a)("platform.allowedUsersHint")},{default:o(()=>[n(e(u),{value:d("dingtalk").allowed_users||"",loading:r("dingtalk"),clearable:"",size:"small",class:"input-lg",placeholder:"user_id1,user_id2","onUpdate:value":l[37]||(l[37]=t=>f("dingtalk",{allowed_users:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionGroup")},{default:o(()=>[n(e(g),{value:p("dingtalk").require_mention,loading:r("dingtalk"),"onUpdate:value":l[38]||(l[38]=t=>c("dingtalk",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.freeResponseChats"),hint:e(a)("platform.freeResponseChatsHint")},{default:o(()=>[n(e(u),{value:p("dingtalk").free_response_chats||"",loading:r("dingtalk"),size:"small",placeholder:"chat_id1,chat_id2","onUpdate:value":l[39]||(l[39]=t=>c("dingtalk",{free_response_chats:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="qqbot"?(v(),_(z,{key:7},[n(s,{label:e(a)("platform.qqAppId"),hint:e(a)("platform.qqAppIdHint")},{default:o(()=>[n(e(u),{value:d("qqbot").extra?.app_id||"",loading:r("qqbot"),clearable:"",size:"small",class:"input-lg",placeholder:"App ID","onUpdate:value":l[40]||(l[40]=t=>f("qqbot",{extra:{...d("qqbot").extra,app_id:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.qqAppSecret"),hint:e(a)("platform.qqAppSecretHint")},{default:o(()=>[n(e(u),{value:d("qqbot").extra?.client_secret||"",loading:r("qqbot"),clearable:"",size:"small",class:"input-lg",placeholder:"App Secret","onUpdate:value":l[41]||(l[41]=t=>f("qqbot",{extra:{...d("qqbot").extra,client_secret:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.allowedUsers"),hint:e(a)("platform.allowedUsersHint")},{default:o(()=>[n(e(u),{value:d("qqbot").allowed_users||"",loading:r("qqbot"),clearable:"",size:"small",class:"input-lg",placeholder:"openid1,openid2","onUpdate:value":l[42]||(l[42]=t=>f("qqbot",{allowed_users:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.allowAllUsers"),hint:e(a)("platform.allowAllUsersHint")},{default:o(()=>[n(e(g),{value:Z(d("qqbot").allow_all_users),loading:r("qqbot"),"onUpdate:value":l[43]||(l[43]=t=>f("qqbot",{allow_all_users:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.qqMarkdown"),hint:e(a)("platform.qqMarkdownHint")},{default:o(()=>[n(e(g),{value:p("qqbot").extra?.markdown_support??!0,loading:r("qqbot"),"onUpdate:value":l[44]||(l[44]=t=>c("qqbot",{extra:{...p("qqbot").extra,markdown_support:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="weixin"?(v(),_(z,{key:8},[C("div",pe,[x.value==="idle"||x.value==="error"||x.value==="expired"||x.value==="confirmed"?(v(),F(e(te),{key:0,type:"primary",size:"small",onClick:Te},{default:o(()=>[L(S(x.value==="confirmed"?e(a)("platform.qrRelogin"):e(a)("platform.qrLogin")),1)]),_:1})):b("",!0),x.value==="loading"?(v(),_("div",ce,[n(e(xe),{size:"small"}),C("span",null,S(e(a)("platform.qrFetching")),1)])):b("",!0),x.value==="waiting"||x.value==="scaned"?(v(),_("div",me,S(x.value==="scaned"?e(a)("platform.qrScanedHint"):e(a)("platform.qrScanHint")),1)):b("",!0)]),n(s,{label:e(a)("platform.weixinToken"),hint:e(a)("platform.weixinTokenHint")},{default:o(()=>[n(e(u),{value:d("weixin").token||"",loading:r("weixin"),clearable:"",size:"small",class:"input-lg",placeholder:"Token","onUpdate:value":l[45]||(l[45]=t=>f("weixin",{token:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.accountId"),hint:e(a)("platform.accountIdHint")},{default:o(()=>[n(e(u),{value:d("weixin").extra?.account_id||"",loading:r("weixin"),clearable:"",size:"small",class:"input-lg",placeholder:"Account ID","onUpdate:value":l[46]||(l[46]=t=>f("weixin",{extra:{...d("weixin").extra,account_id:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="wecom"?(v(),_(z,{key:9},[n(s,{label:e(a)("platform.botId"),hint:e(a)("platform.botIdHint")},{default:o(()=>[n(e(u),{value:d("wecom").extra?.bot_id||"",loading:r("wecom"),clearable:"",size:"small",class:"input-lg",placeholder:"Bot ID","onUpdate:value":l[47]||(l[47]=t=>f("wecom",{extra:{...d("wecom").extra,bot_id:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.appSecret"),hint:e(a)("platform.wecomSecretHint")},{default:o(()=>[n(e(u),{value:d("wecom").extra?.secret||"",loading:r("wecom"),clearable:"",size:"small",class:"input-lg",placeholder:"Secret","onUpdate:value":l[48]||(l[48]=t=>f("wecom",{extra:{...d("wecom").extra,secret:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),C("div",fe,[n(e(te),{type:"primary",size:"small",loading:r(m.key),disabled:!Se(m.key),onClick:t=>Me(m.key)},{default:o(()=>[L(S(e(a)("common.save")),1)]),_:1},8,["loading","disabled","onClick"])])]),_:2},1032,["name","icon","exclusive","config","credentials"])),64))]))}})})),Xe=H((()=>{})),Ue,Ye=H((()=>{ve(),ve(),Xe(),G(),Ue=J(Ce,[["__scopeId","data-v-401828fc"]])})),ge,_e,he,be,He,ke=H((()=>{N(),E(),O(),ye(),Oe(),Ye(),ge={class:"channels-view"},_e={class:"page-header"},he={class:"header-title"},be={class:"channels-content"},He=Q({__name:"ChannelsView",setup(T){const h=we(),y=Ee(),{t:a}=j();async function U(){(!y.activeProfileName||y.profiles.length===0)&&await y.fetchProfiles(),await h.fetchSettings()}return Ve(()=>{U()}),(k,w)=>(v(),_("div",ge,[C("header",_e,[C("h2",he,S(e(a)("sidebar.channels")),1)]),C("div",be,[n(e(xe),{show:e(h).loading||e(h).saving,size:"large",description:e(a)("common.loading")},{default:o(()=>[e(h).loading?b("",!0):(v(),F(Ue,{key:0}))]),_:1},8,["show","description"])])]))}})})),Ze=H((()=>{})),el,ll=H((()=>{ke(),ke(),Ze(),G(),el=J(He,[["__scopeId","data-v-2a2475d5"]])}));ll();export{el as default};
|
|
1
|
+
import{n as H}from"./rolldown-runtime-M0oDzQ_3.js";import{An as Ae,Bt as Ie,Dn as v,En as Be,Gn as B,In as o,It as u,Kn as D,Kt as N,Ot as te,Pn as Pe,Rt as Re,Tn as Ve,V as De,an as C,ar as S,cn as _,dn as L,er as e,fn as n,g as xe,in as Le,kn as $e,m as g,nr as ne,on as F,pn as Q,sn as b,t as E,tn as z}from"./ui-vendor-BUz-RIuE.js";import{c as O,l as j}from"./vue-vendor-BAk4Aood.js";import{n as G,t as J}from"./_plugin-vue_export-helper-D9aS-jmR.js";import{F as We,I as Ne,M as we,P as Fe,R as Qe,ht as Ee,j as ye,mt as Oe,z as je}from"./index-D7Ma0wep.js";import{n as Ge,t as s}from"./SettingRow-0_6ZIyYN.js";var ie,oe,re,se,qe,de=H((()=>{N(),E(),O(),ie={class:"platform-info"},oe=["innerHTML"],re={class:"platform-name"},se={key:0,class:"platform-card-body"},qe=Q({__name:"PlatformCard",props:{name:{},icon:{},config:{},credentials:{},exclusive:{type:Boolean}},setup(T){const h=T,y=D(!0),{t:a}=j(),U=Le(()=>{const k=h.credentials;if(!k)return!1;const w=["token","api_key","app_id","client_id","secret","app_secret","client_secret","access_token","bot_id","account_id","enabled"];return[k,k.extra].filter(Boolean).some(M=>w.some(A=>{const q=M[A];return q!=null&&q!==""&&q!==!1}))});return(k,w)=>(v(),_("div",{class:ne(["platform-card",{configured:U.value}])},[C("div",{class:"platform-card-header",onClick:w[0]||(w[0]=M=>y.value=!y.value)},[C("div",ie,[C("span",{class:"platform-icon",innerHTML:T.icon},null,8,oe),C("span",re,S(T.name),1),n(e(Ie),{type:U.value?"success":"default",size:"small",round:""},{default:o(()=>[L(S(U.value?e(a)("common.configured"):e(a)("common.notConfigured")),1)]),_:1},8,["type"])]),C("span",{class:ne(["expand-icon",{expanded:y.value}])},"▾",2)]),y.value?(v(),_("div",se,[T.exclusive?(v(),F(e(Re),{key:0,type:"warning","show-icon":!0,class:"exclusive-alert"},{default:o(()=>[L(S(e(a)("platform.exclusiveTokenWarning")),1)]),_:1})):b("",!0),Ae(k.$slots,"default",{},void 0,!0)])):b("",!0)],2))}})})),Je=H((()=>{})),ze,Ke=H((()=>{de(),de(),Je(),G(),ze=J(qe,[["__scopeId","data-v-e27ecbbe"]])})),ue,pe,ce,me,fe,Ce,ve=H((()=>{N(),E(),O(),ye(),We(),Ke(),Ge(),ue={class:"settings-section"},pe={class:"weixin-qr-section"},ce={key:1,class:"weixin-qr-loading"},me={key:2,class:"weixin-qr-hint"},fe={class:"platform-actions"},Ce=Q({__name:"PlatformSettings",setup(T){const h=we(),y=De(),{t:a}=j(),U=B({}),k=B({}),w=B({}),M=B({}),A=B({});function q(i){return JSON.parse(JSON.stringify(i||{}))}function $(i,l){for(const[m,t]of Object.entries(l))t&&typeof t=="object"&&!Array.isArray(t)?i[m]=$({...i[m]||{}},t):i[m]=t;return i}function p(i){return k[i]||(k[i]=q(h[i])),k[i]}function d(i){return w[i]||(w[i]=q(I(i))),w[i]}function c(i,l){k[i]=$({...p(i)},l),M[i]=!0}function f(i,l){w[i]=$({...d(i)},l),A[i]=!0}function K(i,l){return JSON.stringify(i||{})===JSON.stringify(l||{})}function X(i){return!!M[i]&&!!k[i]&&!K(k[i],h[i])}function Y(i){return!!A[i]&&!!w[i]&&!K(w[i],I(i))}function Se(i){return X(i)||Y(i)}function r(i){return!!U[i]}async function Me(i){U[i]=!0;try{const l=X(i),m=Y(i);l&&await h.saveSection(i,p(i),{restart:!m}),m&&(await Qe(i,d(i)),await h.fetchSettings()),k[i]=q(h[i]),w[i]=q(I(i)),M[i]=!1,A[i]=!1,y.success(a("settings.saved"))}catch(l){y.error(l?.message||a("settings.saveFailed"))}finally{U[i]=!1}}function I(i){return h.platforms[i]||{}}function Z(i){return i===!0||i==="true"}const ee=D(""),P=D(""),x=D("idle");let R=null;async function Te(){x.value="loading",ee.value="",P.value="",le();try{const i=await Fe();P.value=i.qrcode,ee.value=i.qrcode_url,window.open(i.qrcode_url,"_blank"),x.value="waiting",V()}catch(i){x.value="error",y.error(i.message||a("platform.qrFetching"))}}function V(){P.value&&(R=setTimeout(async()=>{try{const i=await Ne(P.value);i.status==="wait"?V():i.status==="scaned"?(x.value="scaned",V()):i.status==="expired"?x.value="expired":i.status==="confirmed"&&(x.value="confirmed",await je({account_id:i.account_id,token:i.token,base_url:i.base_url}),await h.fetchSettings(),y.success(a("settings.saved")))}catch{V()}},3e3))}function le(){R&&(clearTimeout(R),R=null)}Be(()=>{le()});const ae=[{key:"telegram",name:"Telegram",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.479.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"/></svg>'},{key:"discord",name:"Discord",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189z"/></svg>'},{key:"slack",name:"Slack",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zm1.271 0a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zm0 1.271a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zm10.122 0a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V5.042zm-1.27 0a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312zM15.165 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zm0-1.27a2.527 2.527 0 0 1 2.523-2.52h6.313A2.528 2.528 0 0 1 24 18.956a2.528 2.528 0 0 1-2.522 2.523h-6.313z"/></svg>'},{key:"whatsapp",name:"WhatsApp",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z"/></svg>'},{key:"matrix",name:"Matrix",icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M.632.55v22.9H2.28V24H0V0h2.28v.55zm7.043 7.26v1.157h.033c.309-.443.683-.784 1.117-1.024.433-.245.936-.365 1.5-.365.54 0 1.033.107 1.48.324.448.217.786.619 1.017 1.205.24-.376.558-.702.956-.98.398-.277.872-.414 1.424-.414.41 0 .784.065 1.122.194.34.13.629.325.87.588.241.263.428.59.56.984.132.393.198.85.198 1.368v5.89h-2.49v-4.893c0-.268-.016-.525-.048-.77a1.627 1.627 0 00-.2-.63 1.028 1.028 0 00-.392-.426 1.294 1.294 0 00-.616-.134c-.277 0-.508.05-.693.15a1.043 1.043 0 00-.43.41 1.768 1.768 0 00-.214.616 4.15 4.15 0 00-.06.74v4.937H9.29v-4.937c0-.25-.01-.498-.032-.742a1.84 1.84 0 00-.166-.638.998.998 0 00-.363-.448 1.206 1.206 0 00-.624-.154c-.26 0-.483.048-.67.144a1.055 1.055 0 00-.436.402 1.744 1.744 0 00-.227.616 4.108 4.108 0 00-.063.74v4.937H5.21V7.81zm15.693 15.64V.55H21.72V0H24v24h-2.28v-.55z"/></svg>'},{key:"feishu",name:"Feishu",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M6.59 3.41a2.25 2.25 0 0 1 3.182 0L13.5 7.14l-3.182 3.182L6.59 7.59a2.25 2.25 0 0 1 0-3.182zm5.303 5.303L15.075 5.53a2.25 2.25 0 0 1 3.182 3.182L15.075 11.894 11.893 8.713zM3.41 6.59a2.25 2.25 0 0 1 3.182 0l3.182 3.182-3.182 3.182a2.25 2.25 0 0 1-3.182-3.182L3.41 6.59zm5.303 5.303L11.894 15.075a2.25 2.25 0 0 1-3.182 3.182L5.53 15.075 8.713 11.893zm5.303-5.303L17.478 9.778a2.25 2.25 0 0 1-3.182 3.182L10.53 10.075l3.182-3.182 0 .023z"/></svg>'},{key:"dingtalk",name:"DingTalk",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M19.76 7.05c-.23-.52-.7-.9-1.26-1.02L5.35 3.2c-.77-.16-1.51.38-1.58 1.16-.22 2.55.17 5.4 1.13 7.66.97 2.29 2.52 4.11 4.45 4.82l-1.28 3.03c-.17.4.24.79.63.59l9.47-4.83c.34-.17.55-.52.55-.9v-3.12c.73-.4 1.22-1.17 1.22-2.06 0-.87-.08-1.73-.18-2.5zm-3.66 5.95-5.19 2.65.76-1.8c.12-.29-.03-.62-.33-.72-2.1-.73-3.56-3.54-3.95-6.73l9.27 2c.04.38.07.76.07 1.15 0 .45-.36.81-.81.81h-2.79c-.35 0-.63.28-.63.63s.28.63.63.63h2.97V13z"/></svg>'},{key:"qqbot",name:"QQBot",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C7.58 2 4 5.27 4 9.31c0 2.3 1.15 4.34 2.95 5.68-.13.58-.48 1.62-1.26 2.53-.24.28-.05.72.32.73 1.72.05 3.02-.68 3.69-1.15.72.16 1.49.25 2.3.25 4.42 0 8-3.27 8-7.31S16.42 2 12 2zm-3.2 7.63c-.63 0-1.14-.55-1.14-1.23s.51-1.23 1.14-1.23 1.14.55 1.14 1.23-.51 1.23-1.14 1.23zm6.4 0c-.63 0-1.14-.55-1.14-1.23s.51-1.23 1.14-1.23 1.14.55 1.14 1.23-.51 1.23-1.14 1.23zM5.5 20.5a.5.5 0 0 1 .5-.5h12a.5.5 0 0 1 0 1H6a.5.5 0 0 1-.5-.5z"/></svg>'},{key:"weixin",name:"Weixin",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M8.691 2.188C3.891 2.188 0 5.476 0 9.53c0 2.212 1.17 4.203 3.002 5.55a.59.59 0 01.213.665l-.39 1.48c-.019.07-.048.141-.048.213 0 .163.13.295.29.295a.326.326 0 00.167-.054l1.903-1.114a.864.864 0 01.717-.098 10.16 10.16 0 002.837.403c.276 0 .543-.027.811-.05-.857-2.578.157-4.972 1.932-6.446 1.703-1.415 3.882-1.98 5.853-1.838-.576-3.583-4.196-6.348-8.596-6.348zM5.785 5.991c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 01-1.162 1.178A1.17 1.17 0 014.623 7.17c0-.651.52-1.18 1.162-1.18zm5.813 0c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 01-1.162 1.178 1.17 1.17 0 01-1.162-1.178c0-.651.52-1.18 1.162-1.18zm3.68 4.025c-3.694 0-6.69 2.462-6.69 5.496 0 3.034 2.996 5.496 6.69 5.496.753 0 1.477-.1 2.158-.28a.66.66 0 01.548.074l1.46.854a.25.25 0 00.127.041.224.224 0 00.221-.225c0-.055-.022-.109-.037-.162l-.298-1.131a.453.453 0 01.163-.509C21.81 18.613 22.77 16.973 22.77 15.512c0-3.034-2.996-5.496-6.69-5.496h.198zm-2.454 3.347c.491 0 .889.404.889.902a.896.896 0 01-.889.903.896.896 0 01-.889-.903c0-.498.398-.902.889-.902zm4.912 0c.491 0 .889.404.889.902a.896.896 0 01-.889.903.896.896 0 01-.889-.903c0-.498.398-.902.889-.902z"/></svg>'},{key:"wecom",name:"WeCom",icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M8.691 2.188C3.891 2.188 0 5.476 0 9.53c0 2.212 1.17 4.203 3.002 5.55a.59.59 0 01.213.665l-.39 1.48c-.019.07-.048.141-.048.213 0 .163.13.295.29.295a.326.326 0 00.167-.054l1.903-1.114a.864.864 0 01.717-.098 10.16 10.16 0 002.837.403c.276 0 .543-.027.811-.05-.857-2.578.157-4.972 1.932-6.446 1.703-1.415 3.882-1.98 5.853-1.838-.576-3.583-4.196-6.348-8.596-6.348zM5.785 5.991c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 01-1.162 1.178A1.17 1.17 0 014.623 7.17c0-.651.52-1.18 1.162-1.18zm5.813 0c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 01-1.162 1.178 1.17 1.17 0 01-1.162-1.178c0-.651.52-1.18 1.162-1.18zm3.68 4.025c-3.694 0-6.69 2.462-6.69 5.496 0 3.034 2.996 5.496 6.69 5.496.753 0 1.477-.1 2.158-.28a.66.66 0 01.548.074l1.46.854a.25.25 0 00.127.041.224.224 0 00.221-.225c0-.055-.022-.109-.037-.162l-.298-1.131a.453.453 0 01.163-.509C21.81 18.613 22.77 16.973 22.77 15.512c0-3.034-2.996-5.496-6.69-5.496h.198zm-2.454 3.347c.491 0 .889.404.889.902a.896.896 0 01-.889.903.896.896 0 01-.889-.903c0-.498.398-.902.889-.902zm4.912 0c.491 0 .889.404.889.902a.896.896 0 01-.889.903.896.896 0 01-.889-.903c0-.498.398-.902.889-.902z"/></svg>'}];return Pe(()=>ae.map(i=>({key:i.key,config:h[i.key],credentials:I(i.key)})),i=>{for(const l of i)M[l.key]||(k[l.key]=q(l.config)),A[l.key]||(w[l.key]=q(l.credentials))},{deep:!0,immediate:!0}),(i,l)=>(v(),_("section",ue,[(v(),_(z,null,$e(ae,m=>n(ze,{key:m.key,name:m.name,icon:m.icon,exclusive:m.exclusive,config:e(h)[m.key],credentials:I(m.key)},{default:o(()=>[m.key==="telegram"?(v(),_(z,{key:0},[n(s,{label:e(a)("platform.botToken"),hint:e(a)("platform.botTokenHint")},{default:o(()=>[n(e(u),{value:d("telegram").token||"",loading:r("telegram"),clearable:"",size:"small",class:"input-lg",placeholder:"123456:ABC-DEF...","onUpdate:value":l[0]||(l[0]=t=>f("telegram",{token:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionGroup")},{default:o(()=>[n(e(g),{value:p("telegram").require_mention,loading:r("telegram"),"onUpdate:value":l[1]||(l[1]=t=>c("telegram",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.reactions"),hint:e(a)("platform.reactionsHint")},{default:o(()=>[n(e(g),{value:p("telegram").reactions,loading:r("telegram"),"onUpdate:value":l[2]||(l[2]=t=>c("telegram",{reactions:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.freeResponseChats"),hint:e(a)("platform.freeResponseChatsHint")},{default:o(()=>[n(e(u),{value:p("telegram").free_response_chats||"",loading:r("telegram"),size:"small",placeholder:"chat_id1,chat_id2","onUpdate:value":l[3]||(l[3]=t=>c("telegram",{free_response_chats:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.mentionPatterns"),hint:e(a)("platform.mentionPatternsHint")},{default:o(()=>[n(e(u),{value:(p("telegram").mention_patterns||[]).join(", "),loading:r("telegram"),size:"small",placeholder:"pattern1, pattern2","onUpdate:value":l[4]||(l[4]=t=>c("telegram",{mention_patterns:t?t.split(",").map(W=>W.trim()):[]}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="discord"?(v(),_(z,{key:1},[n(s,{label:e(a)("platform.botToken"),hint:e(a)("platform.botTokenHint")},{default:o(()=>[n(e(u),{value:d("discord").token||"",loading:r("discord"),clearable:"",size:"small",class:"input-lg",placeholder:"Bot token...","onUpdate:value":l[5]||(l[5]=t=>f("discord",{token:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionChannel")},{default:o(()=>[n(e(g),{value:p("discord").require_mention,loading:r("discord"),"onUpdate:value":l[6]||(l[6]=t=>c("discord",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.autoThread"),hint:e(a)("platform.autoThreadHint")},{default:o(()=>[n(e(g),{value:p("discord").auto_thread,loading:r("discord"),"onUpdate:value":l[7]||(l[7]=t=>c("discord",{auto_thread:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.reactions"),hint:e(a)("platform.reactionsHint")},{default:o(()=>[n(e(g),{value:p("discord").reactions,loading:r("discord"),"onUpdate:value":l[8]||(l[8]=t=>c("discord",{reactions:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.freeResponseChannels"),hint:e(a)("platform.freeResponseChannelsHint")},{default:o(()=>[n(e(u),{value:p("discord").free_response_channels||"",loading:r("discord"),size:"small",placeholder:"channel_id1,channel_id2","onUpdate:value":l[9]||(l[9]=t=>c("discord",{free_response_channels:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.allowedChannels"),hint:e(a)("platform.allowedChannelsHint")},{default:o(()=>[n(e(u),{value:p("discord").allowed_channels||"",loading:r("discord"),size:"small",placeholder:"channel_id1,channel_id2","onUpdate:value":l[10]||(l[10]=t=>c("discord",{allowed_channels:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.ignoredChannels"),hint:e(a)("platform.ignoredChannelsHint")},{default:o(()=>[n(e(u),{value:p("discord").ignored_channels||"",loading:r("discord"),size:"small",placeholder:"channel_id1,channel_id2","onUpdate:value":l[11]||(l[11]=t=>c("discord",{ignored_channels:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.noThreadChannels"),hint:e(a)("platform.noThreadChannelsHint")},{default:o(()=>[n(e(u),{value:p("discord").no_thread_channels||"",loading:r("discord"),size:"small",placeholder:"channel_id1,channel_id2","onUpdate:value":l[12]||(l[12]=t=>c("discord",{no_thread_channels:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="slack"?(v(),_(z,{key:2},[n(s,{label:e(a)("platform.botToken"),hint:e(a)("platform.botTokenHint")},{default:o(()=>[n(e(u),{value:d("slack").token||"",loading:r("slack"),clearable:"",size:"small",class:"input-lg",placeholder:"xoxb-...","onUpdate:value":l[13]||(l[13]=t=>f("slack",{token:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionChannel")},{default:o(()=>[n(e(g),{value:p("slack").require_mention,loading:r("slack"),"onUpdate:value":l[14]||(l[14]=t=>c("slack",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.allowBots"),hint:e(a)("platform.allowBotsHint")},{default:o(()=>[n(e(g),{value:p("slack").allow_bots,loading:r("slack"),"onUpdate:value":l[15]||(l[15]=t=>c("slack",{allow_bots:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.freeResponseChannels"),hint:e(a)("platform.freeResponseChannelsHint")},{default:o(()=>[n(e(u),{value:p("slack").free_response_channels||"",loading:r("slack"),size:"small",placeholder:"channel_id1,channel_id2","onUpdate:value":l[16]||(l[16]=t=>c("slack",{free_response_channels:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="whatsapp"?(v(),_(z,{key:3},[n(s,{label:e(a)("platform.waEnabled"),hint:e(a)("platform.waEnabledHint")},{default:o(()=>[n(e(g),{value:d("whatsapp").enabled,loading:r("whatsapp"),"onUpdate:value":l[17]||(l[17]=t=>f("whatsapp",{enabled:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionGroup")},{default:o(()=>[n(e(g),{value:p("whatsapp").require_mention,loading:r("whatsapp"),"onUpdate:value":l[18]||(l[18]=t=>c("whatsapp",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.freeResponseChats"),hint:e(a)("platform.freeResponseChatsHint")},{default:o(()=>[n(e(u),{value:p("whatsapp").free_response_chats||"",loading:r("whatsapp"),size:"small",placeholder:"chat_id1,chat_id2","onUpdate:value":l[19]||(l[19]=t=>c("whatsapp",{free_response_chats:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.mentionPatterns"),hint:e(a)("platform.mentionPatternsHint")},{default:o(()=>[n(e(u),{value:(p("whatsapp").mention_patterns||[]).join(", "),loading:r("whatsapp"),size:"small",placeholder:"pattern1, pattern2","onUpdate:value":l[20]||(l[20]=t=>c("whatsapp",{mention_patterns:t?t.split(",").map(W=>W.trim()):[]}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="matrix"?(v(),_(z,{key:4},[n(s,{label:e(a)("platform.accessToken"),hint:e(a)("platform.accessTokenHint")},{default:o(()=>[n(e(u),{value:d("matrix").token||"",loading:r("matrix"),clearable:"",size:"small",class:"input-lg",placeholder:"syt_...","onUpdate:value":l[21]||(l[21]=t=>f("matrix",{token:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.homeserver"),hint:e(a)("platform.homeserverHint")},{default:o(()=>[n(e(u),{value:d("matrix").extra?.homeserver||"",loading:r("matrix"),clearable:"",size:"small",class:"input-lg",placeholder:"https://matrix.org","onUpdate:value":l[22]||(l[22]=t=>f("matrix",{extra:{...d("matrix").extra,homeserver:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionRoom")},{default:o(()=>[n(e(g),{value:p("matrix").require_mention,loading:r("matrix"),"onUpdate:value":l[23]||(l[23]=t=>c("matrix",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.autoThread"),hint:e(a)("platform.autoThreadHintRoom")},{default:o(()=>[n(e(g),{value:p("matrix").auto_thread,loading:r("matrix"),"onUpdate:value":l[24]||(l[24]=t=>c("matrix",{auto_thread:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.dmMentionThreads"),hint:e(a)("platform.dmMentionThreadsHint")},{default:o(()=>[n(e(g),{value:p("matrix").dm_mention_threads,loading:r("matrix"),"onUpdate:value":l[25]||(l[25]=t=>c("matrix",{dm_mention_threads:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.freeResponseRooms"),hint:e(a)("platform.freeResponseRoomsHint")},{default:o(()=>[n(e(u),{value:p("matrix").free_response_rooms||"",loading:r("matrix"),size:"small",placeholder:"room_id1,room_id2","onUpdate:value":l[26]||(l[26]=t=>c("matrix",{free_response_rooms:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="feishu"?(v(),_(z,{key:5},[n(s,{label:e(a)("platform.appId"),hint:e(a)("platform.appIdHint")},{default:o(()=>[n(e(u),{value:d("feishu").extra?.app_id||"",loading:r("feishu"),clearable:"",size:"small",class:"input-lg",placeholder:"cli_...","onUpdate:value":l[27]||(l[27]=t=>f("feishu",{extra:{...d("feishu").extra,app_id:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.appSecret"),hint:e(a)("platform.appSecretHint")},{default:o(()=>[n(e(u),{value:d("feishu").extra?.app_secret||"",loading:r("feishu"),type:"password","show-password-on":"click",clearable:"",size:"small",class:"input-lg",placeholder:"App Secret","onUpdate:value":l[28]||(l[28]=t=>f("feishu",{extra:{...d("feishu").extra,app_secret:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.encryptKey"),hint:e(a)("platform.encryptKeyHint")},{default:o(()=>[n(e(u),{value:d("feishu").extra?.encrypt_key||"",loading:r("feishu"),type:"password","show-password-on":"click",clearable:"",size:"small",class:"input-lg",placeholder:"Encrypt Key","onUpdate:value":l[29]||(l[29]=t=>f("feishu",{extra:{...d("feishu").extra,encrypt_key:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.verificationToken"),hint:e(a)("platform.verificationTokenHint")},{default:o(()=>[n(e(u),{value:d("feishu").extra?.verification_token||"",loading:r("feishu"),type:"password","show-password-on":"click",clearable:"",size:"small",class:"input-lg",placeholder:"Verification Token","onUpdate:value":l[30]||(l[30]=t=>f("feishu",{extra:{...d("feishu").extra,verification_token:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionGroup")},{default:o(()=>[n(e(g),{value:p("feishu").require_mention,loading:r("feishu"),"onUpdate:value":l[31]||(l[31]=t=>c("feishu",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.freeResponseChats"),hint:e(a)("platform.freeResponseChatsHint")},{default:o(()=>[n(e(u),{value:p("feishu").free_response_chats||"",loading:r("feishu"),size:"small",placeholder:"chat_id1,chat_id2","onUpdate:value":l[32]||(l[32]=t=>c("feishu",{free_response_chats:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="dingtalk"?(v(),_(z,{key:6},[n(s,{label:e(a)("platform.clientId"),hint:e(a)("platform.clientIdHint")},{default:o(()=>[n(e(u),{value:d("dingtalk").extra?.client_id||"",loading:r("dingtalk"),clearable:"",size:"small",class:"input-lg",placeholder:"Client ID","onUpdate:value":l[33]||(l[33]=t=>f("dingtalk",{extra:{...d("dingtalk").extra,client_id:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.clientSecret"),hint:e(a)("platform.clientSecretHint")},{default:o(()=>[n(e(u),{value:d("dingtalk").extra?.client_secret||"",loading:r("dingtalk"),clearable:"",size:"small",class:"input-lg",placeholder:"Client Secret","onUpdate:value":l[34]||(l[34]=t=>f("dingtalk",{extra:{...d("dingtalk").extra,client_secret:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.cardTemplateId"),hint:e(a)("platform.cardTemplateIdHint")},{default:o(()=>[n(e(u),{value:d("dingtalk").extra?.card_template_id||"",loading:r("dingtalk"),clearable:"",size:"small",class:"input-lg",placeholder:"AI Card Template ID","onUpdate:value":l[35]||(l[35]=t=>f("dingtalk",{extra:{...d("dingtalk").extra,card_template_id:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.allowAllUsers"),hint:e(a)("platform.allowAllUsersHint")},{default:o(()=>[n(e(g),{value:Z(d("dingtalk").allow_all_users),loading:r("dingtalk"),"onUpdate:value":l[36]||(l[36]=t=>f("dingtalk",{allow_all_users:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.allowedUsers"),hint:e(a)("platform.allowedUsersHint")},{default:o(()=>[n(e(u),{value:d("dingtalk").allowed_users||"",loading:r("dingtalk"),clearable:"",size:"small",class:"input-lg",placeholder:"user_id1,user_id2","onUpdate:value":l[37]||(l[37]=t=>f("dingtalk",{allowed_users:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionGroup")},{default:o(()=>[n(e(g),{value:p("dingtalk").require_mention,loading:r("dingtalk"),"onUpdate:value":l[38]||(l[38]=t=>c("dingtalk",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.freeResponseChats"),hint:e(a)("platform.freeResponseChatsHint")},{default:o(()=>[n(e(u),{value:p("dingtalk").free_response_chats||"",loading:r("dingtalk"),size:"small",placeholder:"chat_id1,chat_id2","onUpdate:value":l[39]||(l[39]=t=>c("dingtalk",{free_response_chats:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="qqbot"?(v(),_(z,{key:7},[n(s,{label:e(a)("platform.qqAppId"),hint:e(a)("platform.qqAppIdHint")},{default:o(()=>[n(e(u),{value:d("qqbot").extra?.app_id||"",loading:r("qqbot"),clearable:"",size:"small",class:"input-lg",placeholder:"App ID","onUpdate:value":l[40]||(l[40]=t=>f("qqbot",{extra:{...d("qqbot").extra,app_id:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.qqAppSecret"),hint:e(a)("platform.qqAppSecretHint")},{default:o(()=>[n(e(u),{value:d("qqbot").extra?.client_secret||"",loading:r("qqbot"),clearable:"",size:"small",class:"input-lg",placeholder:"App Secret","onUpdate:value":l[41]||(l[41]=t=>f("qqbot",{extra:{...d("qqbot").extra,client_secret:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.allowedUsers"),hint:e(a)("platform.allowedUsersHint")},{default:o(()=>[n(e(u),{value:d("qqbot").allowed_users||"",loading:r("qqbot"),clearable:"",size:"small",class:"input-lg",placeholder:"openid1,openid2","onUpdate:value":l[42]||(l[42]=t=>f("qqbot",{allowed_users:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.allowAllUsers"),hint:e(a)("platform.allowAllUsersHint")},{default:o(()=>[n(e(g),{value:Z(d("qqbot").allow_all_users),loading:r("qqbot"),"onUpdate:value":l[43]||(l[43]=t=>f("qqbot",{allow_all_users:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.qqMarkdown"),hint:e(a)("platform.qqMarkdownHint")},{default:o(()=>[n(e(g),{value:p("qqbot").extra?.markdown_support??!0,loading:r("qqbot"),"onUpdate:value":l[44]||(l[44]=t=>c("qqbot",{extra:{...p("qqbot").extra,markdown_support:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="weixin"?(v(),_(z,{key:8},[C("div",pe,[x.value==="idle"||x.value==="error"||x.value==="expired"||x.value==="confirmed"?(v(),F(e(te),{key:0,type:"primary",size:"small",onClick:Te},{default:o(()=>[L(S(x.value==="confirmed"?e(a)("platform.qrRelogin"):e(a)("platform.qrLogin")),1)]),_:1})):b("",!0),x.value==="loading"?(v(),_("div",ce,[n(e(xe),{size:"small"}),C("span",null,S(e(a)("platform.qrFetching")),1)])):b("",!0),x.value==="waiting"||x.value==="scaned"?(v(),_("div",me,S(x.value==="scaned"?e(a)("platform.qrScanedHint"):e(a)("platform.qrScanHint")),1)):b("",!0)]),n(s,{label:e(a)("platform.weixinToken"),hint:e(a)("platform.weixinTokenHint")},{default:o(()=>[n(e(u),{value:d("weixin").token||"",loading:r("weixin"),clearable:"",size:"small",class:"input-lg",placeholder:"Token","onUpdate:value":l[45]||(l[45]=t=>f("weixin",{token:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.accountId"),hint:e(a)("platform.accountIdHint")},{default:o(()=>[n(e(u),{value:d("weixin").extra?.account_id||"",loading:r("weixin"),clearable:"",size:"small",class:"input-lg",placeholder:"Account ID","onUpdate:value":l[46]||(l[46]=t=>f("weixin",{extra:{...d("weixin").extra,account_id:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="wecom"?(v(),_(z,{key:9},[n(s,{label:e(a)("platform.botId"),hint:e(a)("platform.botIdHint")},{default:o(()=>[n(e(u),{value:d("wecom").extra?.bot_id||"",loading:r("wecom"),clearable:"",size:"small",class:"input-lg",placeholder:"Bot ID","onUpdate:value":l[47]||(l[47]=t=>f("wecom",{extra:{...d("wecom").extra,bot_id:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.appSecret"),hint:e(a)("platform.wecomSecretHint")},{default:o(()=>[n(e(u),{value:d("wecom").extra?.secret||"",loading:r("wecom"),clearable:"",size:"small",class:"input-lg",placeholder:"Secret","onUpdate:value":l[48]||(l[48]=t=>f("wecom",{extra:{...d("wecom").extra,secret:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),C("div",fe,[n(e(te),{type:"primary",size:"small",loading:r(m.key),disabled:!Se(m.key),onClick:t=>Me(m.key)},{default:o(()=>[L(S(e(a)("common.save")),1)]),_:1},8,["loading","disabled","onClick"])])]),_:2},1032,["name","icon","exclusive","config","credentials"])),64))]))}})})),Xe=H((()=>{})),Ue,Ye=H((()=>{ve(),ve(),Xe(),G(),Ue=J(Ce,[["__scopeId","data-v-401828fc"]])})),ge,_e,he,be,He,ke=H((()=>{N(),E(),O(),ye(),Oe(),Ye(),ge={class:"channels-view"},_e={class:"page-header"},he={class:"header-title"},be={class:"channels-content"},He=Q({__name:"ChannelsView",setup(T){const h=we(),y=Ee(),{t:a}=j();async function U(){(!y.activeProfileName||y.profiles.length===0)&&await y.fetchProfiles(),await h.fetchSettings()}return Ve(()=>{U()}),(k,w)=>(v(),_("div",ge,[C("header",_e,[C("h2",he,S(e(a)("sidebar.channels")),1)]),C("div",be,[n(e(xe),{show:e(h).loading||e(h).saving,size:"large",description:e(a)("common.loading")},{default:o(()=>[e(h).loading?b("",!0):(v(),F(Ue,{key:0}))]),_:1},8,["show","description"])])]))}})})),Ze=H((()=>{})),el,ll=H((()=>{ke(),ke(),Ze(),G(),el=J(He,[["__scopeId","data-v-2a2475d5"]])}));ll();export{el as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as J}from"./rolldown-runtime-M0oDzQ_3.js";import{$t as na,Cn as Ai,Dn as i,E as Fi,En as La,I as Di,In as S,It as Qe,Jt as Ft,K as vt,Kn as h,Kt as Ve,Ln as Dt,M as Ei,Ot as X,P as Bi,Pn as ce,Qt as ba,Tn as et,V as Aa,Y as Ri,Zt as Qa,an as t,ar as c,cn as v,ct as Ni,dn as j,en as la,er as e,fn as k,g as Oi,gt as Ui,in as w,ir as Et,kn as ke,m as zi,mt as Je,nr as ne,nt as Xo,on as ae,ot as Ze,pn as tt,sn as b,t as Bt,tn as ue,ut as Vi,w as qi,xn as Me}from"./ui-vendor-BUz-RIuE.js";import{c as at,f as Ki,l as st,m as Wi}from"./vue-vendor-BAk4Aood.js";import{d as Gi,f as pt,n as lt,t as nt,u as ra}from"./_plugin-vue_export-helper-DIpMhnga.js";import{C as Hi,G as ji,K as Za,X as es,_t as Fa,b as Da,dt as Xi,et as Yi,gt as Ea,ht as Yo,lt as Jo,mt as Qo,nt as Ji,q as Qi,rt as Zi,ut as er,w as tr,y as Ba}from"./index-kbqf1KFz.js";import{n as ar,t as sr}from"./session-browser-prefs--p0ZgG03.js";import{n as Zo,t as Ia}from"./clipboard-1NPxC3YL.js";import{l as lr,s as nr}from"./skills-BROW9HzT.js";import{a as ei,i as or,o as ti,r as ir}from"./chat-timestamp-CSe88NJz.js";import{c as rr,d as ur,l as cr,n as dr,t as vr,u as pr}from"./useSttSettings-DmguRaGs.js";import{d as fr,f as hr}from"./ttsHelpers-BdWxSCbS.js";import{a as ts,i as mr,n as gr,o as as,r as ss,s as _r,t as yr}from"./OutlinePanel-DWHXcxCU.js";import{n as wr,t as kr}from"./MessageItem-CiLT5Cpc.js";import{_ as Sr,a as br,b as Cr,c as xr,d as Mr,f as $r,g as Pr,h as Ir,i as Tr,l as Lr,m as Ar,n as Fr,o as Dr,p as Er,r as Br,s as Rr,t as Nr,u as Or,v as Ur,y as zr}from"./FileRenameModal-CG4nr9lS.js";import{n as Vr,t as qr}from"./TerminalPanel-BfRB2Y8u.js";import{i as Kr,n as Wr,r as Gr,t as Hr}from"./SettingsCircuitBadge-6dmnDQb1.js";var ls,ns,os,is,rs,us,cs,ds,vs,ps,fs,hs,ai,ms=J((()=>{Ve(),Bt(),at(),ra(),Zo(),ls={class:"folder-picker"},ns={key:0,class:"folder-picker-loading"},os={key:1,class:"folder-tree"},is={class:"folder-name"},rs=["onClick","onContextmenu"],us=["onClick"],cs={class:"folder-name"},ds={class:"folder-empty-text"},vs={key:1,class:"folder-empty"},ps={key:2,class:"folder-selected"},fs={class:"folder-selected-label"},hs={class:"folder-selected-path"},ai=tt({__name:"FolderPicker",props:{modelValue:{}},emits:["update:modelValue"],setup(A,{emit:r}){const n=A,C=r,{t:_}=st(),m=Ri(),g=Aa(),u=h(!1),B=h(""),G=h([]),F=h(new Set),V=h(new Map),Q=h(new Set),E=h(n.modelValue||""),Y=h(!1),H=h(!1),O=h(0),z=h(0),Z=h(null),P=h(!1),L=h("create"),M=h(""),I=h(!1);ce(()=>n.modelValue,$=>{E.value=$||""});function R($){const T=String($||"").trim();E.value=T,C("update:modelValue",T||null)}async function K($=""){try{return await pt(`/api/hermes/workspace/folders${$?`?path=${encodeURIComponent($)}`:""}`)}catch{return null}}function te($){const T=$.split("/").filter(Boolean);return T.pop(),T.join("/")}async function oe($=""){const T=await K($);if(!T){Y.value=!0;return}if(Y.value=!1,!$){B.value=T.base,G.value=T.folders;return}V.value.set($,T.folders),V.value=new Map(V.value)}et(async()=>{u.value=!0,await oe(),u.value=!1});async function he($){if(F.value.has($.path)){F.value.delete($.path),F.value=new Set(F.value);return}if(F.value.add($.path),F.value=new Set(F.value),!V.value.has($.path)){Q.value.add($.path),Q.value=new Set(Q.value);const T=await K($.path);V.value.set($.path,T?.folders||[]),V.value=new Map(V.value),Q.value.delete($.path),Q.value=new Set(Q.value)}}function D($){R($.fullPath)}function U(){R(B.value)}async function q($){if(!$){U();return}D($),F.value.has($.path)||await he($)}function ee($,T){$.preventDefault(),$.stopPropagation(),Z.value=T,O.value=$.clientX,z.value=$.clientY,H.value=!1,Me(()=>{H.value=!0})}const pe=w(()=>{const $=[{label:_("files.open"),key:"open"},{type:"divider",key:"d1"},{label:_("files.copyPath"),key:"copyPath"},{label:_("files.newFolder"),key:"newFolder"}];return Z.value&&($.push({label:_("files.rename"),key:"rename"}),$.push({type:"divider",key:"d2"}),$.push({label:_("files.delete"),key:"delete"})),$});function me(){H.value=!1}function xe($){L.value=$,M.value=$==="rename"&&Z.value?.name||"",P.value=!0}async function se($){H.value=!1;const T=Z.value;switch($){case"open":await q(T);break;case"copyPath":{const W=await Ia(T?.fullPath||B.value);g[W?"success":"error"](W?_("files.pathCopied"):`${_("files.pathCopied")} ✗`);break}case"newFolder":xe("create");break;case"rename":T&&xe("rename");break;case"delete":if(!T)return;m.warning({title:_("files.delete"),content:_("files.confirmDeleteDir",{name:T.name}),positiveText:_("common.delete"),negativeText:_("common.cancel"),onPositiveClick:async()=>{try{await pt("/api/hermes/workspace/folders",{method:"DELETE",body:JSON.stringify({path:T.path})}),(E.value===T.fullPath||E.value.startsWith(`${T.fullPath}/`))&&R(null),F.value.delete(T.path),F.value=new Set(F.value),V.value.delete(T.path),V.value=new Map(V.value),await oe(te(T.path)),g.success(_("files.deleted"))}catch{g.error(_("files.deleteFailed"))}}});break}}async function Oe(){const $=M.value.trim();if($){I.value=!0;try{if(L.value==="create"){const T=Z.value?.path||"";await pt("/api/hermes/workspace/folders",{method:"POST",body:JSON.stringify({parentPath:T,name:$})}),T&&(F.value.add(T),F.value=new Set(F.value)),await oe(T),g.success(_("files.created"))}else if(Z.value){const T=Z.value;await pt("/api/hermes/workspace/folders/rename",{method:"POST",body:JSON.stringify({path:T.path,name:$})}),await oe(te(T.path)),(E.value===T.fullPath||E.value.startsWith(`${T.fullPath}/`))&&R(null),g.success(_("files.renamed"))}P.value=!1}catch{g.error(L.value==="rename"?_("files.renameFailed"):_("files.createFailed"))}finally{I.value=!1}}}const ve=w(()=>{const $=[];function T(W,ge){for(const de of W){const _e=F.value.has(de.path),Le=Q.value.has(de.path),fe=V.value.get(de.path);$.push({folder:de,depth:ge,isExpanded:_e,isLoading:Le,hasChildren:fe?fe.length>0:null}),_e&&fe&&fe.length>0&&T(fe,ge+1)}}return T(G.value,0),$});return($,T)=>(i(),v("div",ls,[k(e(Qe),{value:E.value,placeholder:e(_)("chat.workspacePlaceholder"),clearable:"",size:"small",class:"folder-path-input","onUpdate:value":R},null,8,["value","placeholder"]),u.value?(i(),v("div",ns,[k(e(Oi),{size:"small"})])):(i(),v("div",os,[B.value?(i(),v("div",{key:0,class:ne(["folder-item root",{selected:E.value===B.value}]),onClick:U,onContextmenu:T[0]||(T[0]=W=>ee(W,null))},[T[4]||(T[4]=t("span",{class:"folder-icon"},"📂",-1)),t("span",is,c(B.value||"/"),1)],34)):b("",!0),(i(!0),v(ue,null,ke(ve.value,W=>(i(),v("div",{key:W.folder.path,class:ne(["folder-item",{selected:E.value===W.folder.fullPath}]),style:Et({paddingLeft:`${12+W.depth*16}px`}),onClick:ge=>D(W.folder),onContextmenu:ge=>ee(ge,W.folder)},[t("span",{class:"folder-expand",onClick:la(ge=>he(W.folder),["stop"])},[W.isLoading?(i(),v(ue,{key:0},[j("⏳")],64)):(i(),v(ue,{key:1},[j(c(W.isExpanded?"▼":"▶"),1)],64))],8,us),T[5]||(T[5]=t("span",{class:"folder-icon"},"📁",-1)),t("span",cs,c(W.folder.name),1)],46,rs))),128)),(i(!0),v(ue,null,ke(ve.value,W=>(i(),v(ue,{key:"empty-"+W.folder.path},[W.isExpanded&&!W.isLoading&&W.hasChildren===!1?(i(),v("div",{key:0,class:"folder-item empty",style:Et({paddingLeft:`${28+W.depth*16}px`})},[t("span",ds,c(e(_)("chat.folderPickerEmpty")),1)],4)):b("",!0)],64))),128)),(G.value.length===0||Y.value)&&!u.value?(i(),v("div",vs,c(e(_)("chat.folderPickerNoFolders")),1)):b("",!0)])),E.value?(i(),v("div",ps,[t("span",fs,c(e(_)("chat.folderPickerSelected")),1),t("span",hs,c(E.value),1)])):b("",!0),k(e(Xo),{show:H.value,x:O.value,y:z.value,options:pe.value,placement:"bottom-start",trigger:"manual",onSelect:se,onClickoutside:me},null,8,["show","x","y","options"]),k(e(vt),{show:P.value,"onUpdate:show":T[3]||(T[3]=W=>P.value=W),preset:"dialog",title:L.value==="rename"?e(_)("files.rename"):e(_)("files.newFolder"),style:{width:"400px"}},{action:S(()=>[k(e(Ei),{justify:"end"},{default:S(()=>[k(e(X),{size:"small",onClick:T[2]||(T[2]=W=>P.value=!1)},{default:S(()=>[j(c(e(_)("common.cancel")),1)]),_:1}),k(e(X),{size:"small",type:"primary",loading:I.value,disabled:!M.value.trim(),onClick:Oe},{default:S(()=>[j(c(e(_)("common.confirm")),1)]),_:1},8,["loading","disabled"])]),_:1})]),default:S(()=>[k(e(Qe),{value:M.value,"onUpdate:value":T[1]||(T[1]=W=>M.value=W),placeholder:L.value==="rename"?e(_)("files.renameTo"):e(_)("files.newFolderName")},null,8,["value","placeholder"])]),_:1},8,["show","title"])]))}})})),jr=J((()=>{})),Ta,Xr=J((()=>{ms(),ms(),jr(),lt(),Ta=nt(ai,[["__scopeId","data-v-92479ea5"]])}));async function Yr(A,r,n){return(await pt(`/api/hermes/model-context/${encodeURIComponent(A)}/${encodeURIComponent(r)}`,{method:"PUT",body:JSON.stringify({provider:A,model:r,context_limit:n})})).data}var Jr=J((()=>{ra()})),gs,_s,ys,ws,ks,Ss,bs,si,Cs=J((()=>{Ve(),at(),gs=["data-status"],_s={class:"voice-transcript-overlay__status"},ys={key:0,class:"voice-transcript-overlay__transcript"},ws={key:1,class:"voice-transcript-overlay__error",role:"alert"},ks={key:2,class:"voice-transcript-overlay__debug"},Ss={class:"voice-transcript-overlay__debug-title"},bs={class:"voice-transcript-overlay__debug-list"},si=tt({__name:"VoiceTranscriptOverlay",props:{status:{},transcript:{},error:{default:null},floating:{type:Boolean,default:!1},events:{default:()=>[]},debug:{type:Boolean,default:!1}},setup(A){const r=A,{t:n}=st(),C=w(()=>n(`chat.voiceInput.status.${r.status}`)),_=w(()=>n("chat.voiceInput.statusLabel",{status:C.value})),m=w(()=>n("chat.voiceInput.transcriptLabel",{text:r.transcript})),g=w(()=>n("chat.voiceInput.errorLabel",{error:r.error})),u=w(()=>r.events.slice(-5).map(B=>B.type));return(B,G)=>(i(),v("div",{class:ne(["voice-transcript-overlay",{"voice-transcript-overlay--floating":r.floating}]),"data-testid":"voice-transcript-overlay","data-status":r.status,role:"status","aria-live":"polite"},[t("p",_s,c(_.value),1),r.transcript?(i(),v("p",ys,c(m.value),1)):b("",!0),r.error?(i(),v("p",ws,c(g.value),1)):b("",!0),r.debug&&u.value.length?(i(),v("div",ks,[t("p",Ss,c(e(n)("chat.voiceInput.recentEvents")),1),t("ol",bs,[(i(!0),v(ue,null,ke(u.value,(F,V)=>(i(),v("li",{key:`${V}:${F}`,class:"voice-transcript-overlay__debug-item","data-testid":"voice-event-debug-item"},c(F),1))),128))])])):b("",!0)],10,gs))}})})),Qr=J((()=>{})),li,Zr=J((()=>{Cs(),Cs(),Qr(),lt(),li=nt(si,[["__scopeId","data-v-2d59fc0f"]])})),xs,Ms,$s,Ps,Is,ni,Ts=J((()=>{Ve(),at(),Zr(),xs={class:"voice-dialogue-controls__actions"},Ms=["aria-label","aria-pressed"],$s={key:0,class:"voice-dialogue-controls__icon",width:"16",height:"16",viewBox:"0 0 24 24","aria-hidden":"true"},Ps={key:1,class:"voice-dialogue-controls__icon",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},Is=["aria-label"],ni=tt({__name:"VoiceDialogueControls",props:{status:{},transcript:{},error:{default:null},events:{default:()=>[]},debug:{type:Boolean,default:!1},onStart:{},onStop:{},onCancel:{}},setup(A){const r=A,n=new Set(["capturing","transcribing","sending"]),{t:C}=st(),_=w(()=>n.has(r.status)),m=w(()=>_.value||!!r.transcript||!!r.error),g=w(()=>_.value?C("chat.voiceInput.stopCaptureAndInsert"):C("chat.voiceInput.startCapture"));async function u(){if(_.value){await r.onStop();return}await r.onStart()}function B(){r.onCancel()}return(G,F)=>(i(),v("div",{class:ne(["voice-dialogue-controls voice-dialogue-controls--floating-overlay",{active:_.value}])},[m.value?(i(),ae(li,{key:0,floating:"",status:r.status,transcript:r.transcript,error:r.error,events:r.events,debug:r.debug},null,8,["status","transcript","error","events","debug"])):b("",!0),t("div",xs,[t("button",{type:"button",class:ne(["voice-dialogue-controls__toggle",{active:_.value}]),"data-testid":"voice-record-toggle","aria-label":g.value,"aria-pressed":_.value,onClick:u},[_.value?(i(),v("svg",$s,[...F[0]||(F[0]=[t("rect",{x:"7",y:"7",width:"10",height:"10",rx:"2",fill:"currentColor"},null,-1)])])):(i(),v("svg",Ps,[...F[1]||(F[1]=[t("path",{d:"M12 3a3 3 0 0 0-3 3v5a3 3 0 0 0 6 0V6a3 3 0 0 0-3-3Z"},null,-1),t("path",{d:"M5 10v1a7 7 0 0 0 14 0v-1"},null,-1),t("path",{d:"M12 18v3"},null,-1),t("path",{d:"M9 21h6"},null,-1)])]))],10,Ms),_.value?(i(),v("button",{key:0,type:"button",class:"voice-dialogue-controls__cancel","data-testid":"voice-record-cancel","aria-label":e(C)("chat.voiceInput.cancelCapture"),onClick:B},[...F[2]||(F[2]=[t("svg",{class:"voice-dialogue-controls__icon voice-dialogue-controls__icon--small",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","aria-hidden":"true"},[t("path",{d:"M18 6 6 18"}),t("path",{d:"m6 6 12 12"})],-1)])],8,Is)):b("",!0)])],2))}})})),eu=J((()=>{})),oi,tu=J((()=>{Ts(),Ts(),eu(),lt(),oi=nt(ni,[["__scopeId","data-v-bed1a556"]])}));function au(A){let r=0;return function(C,_={}){return r+=1,{id:`${A}:${r}`,seq:r,sessionId:A,type:C,captureId:_.captureId,turnId:_.turnId,timestamp:_.timestamp??new Date().toISOString(),final:_.final,payload:_.payload}}}var su=J((()=>{}));function Ca(A){return`${A}-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function Ls(A){return A instanceof Error?A:new Error(String(A))}function lu(A){return A.replace(/\s+/g," ").trim()}function nu(A){const r=Ca("voice-session"),n=au(r),C=h([]),_=h("idle"),m=h(null),g=h(null),u=h(""),B=h(null),G=w(()=>_.value!=="idle");function F(P,L={}){const M=n(P,{...L,captureId:L.captureId??m.value??void 0,turnId:L.turnId??g.value??void 0});return C.value.push(M),C.value.length>50&&C.value.splice(0,C.value.length-50),M}function V(P,L={}){const M=Ls(P);return B.value=M,_.value="error",F("session.error",{captureId:L.captureId,turnId:L.turnId,final:!0,payload:M}),M}function Q(P={}){const L=P.captureId??m.value,M=P.turnId??g.value;M&&F("turn.cancelled",{captureId:L??void 0,turnId:M,final:!0}),L&&F("capture.cancelled",{captureId:L,turnId:M??void 0,final:!0}),m.value=null,g.value=null,u.value="",B.value=null,_.value="idle"}F("session.started",{final:!0});async function E(){try{await Promise.resolve(A.stopOutputAudio?.())}catch(L){console.warn("[useVoiceDialogue] Failed to stop output audio before capture:",Ls(L))}(m.value||g.value)&&Q(),B.value=null,u.value="",_.value="capturing",g.value=null;const P=Ca("capture");return m.value=P,F("capture.started",{captureId:P}),{captureId:P}}async function Y(P,L){if(m.value!==P)return;const M=lu(L);if(!M){u.value="",O(P);return}B.value=null,u.value=M,_.value="sending",F("transcript.done",{captureId:P,final:!0,payload:{text:M}});const I=Ca("turn");g.value=I,F("turn.started",{captureId:P,turnId:I,payload:{text:M}});try{await Promise.resolve(A.sendMessage(M))}catch(R){if(m.value===P&&g.value===I)throw V(R,{captureId:P,turnId:I}),R;return}m.value!==P||g.value!==I||(F("turn.ended",{captureId:P,turnId:I,final:!0,payload:{text:M}}),m.value=null,g.value=null,u.value="",_.value="idle")}async function H(P,L){if(m.value===P){B.value=null,_.value="transcribing";try{const M=await A.transcribe(L);if(m.value!==P)return;await Y(P,M.text)}catch(M){if(m.value===P)throw B.value===null&&V(M,{captureId:P,turnId:g.value??void 0}),M;return}}}function O(P=m.value){!P||m.value!==P||Q({captureId:P,turnId:g.value})}function z(P){F("output.audio.started",{payload:P})}function Z(P){F("output.audio.done",{final:!0,payload:P})}return{sessionId:r,events:C,status:_,activeCaptureId:m,activeTurnId:g,transcript:u,error:B,isBusy:G,beginCapture:E,transcribeAndSend:H,commitTranscript:Y,cancelCapture:O,markOutputStarted:z,markOutputDone:Z}}var ou=J((()=>{Ve(),su()}));function xa(A){return A instanceof Error?A:new Error(String(A))}function oa(A){return A.replace(/\s+/g," ").trim()}function ia(A){return oa(A.filter(Boolean).join(" "))}function iu(A){return oa(A?.[0]?.transcript??"")}function ru(A){const r=A.results,n=typeof A.resultIndex=="number"?A.resultIndex:0,C=[],_=[];if(!r||typeof r.length!="number")return{finalText:"",interimText:""};for(let m=n;m<r.length;m+=1){const g=r[m],u=iu(g);u&&(g?.isFinal?C.push(u):_.push(u))}return{finalText:ia(C),interimText:ia(_)}}function As(){if(typeof window>"u")return null;const A=window;return A.SpeechRecognition??A.webkitSpeechRecognition??null}function uu(A={}){const r=h(!!As()),n=h("idle"),C=h(""),_=h(""),m=h(null);let g=null,u=0,B=null,G=null,F=null,V=null;function Q(){return A.messages?.unsupported||ii}function E(D){const U=D?.trim();return U&&A.messages?.failedWithReason?A.messages.failedWithReason(U):U?`Browser speech recognition failed: ${U}.`:A.messages?.failed||"Browser speech recognition failed."}function Y(){V!==null&&(clearTimeout(V),V=null)}function H(){B=null,G=null,F=null,Y()}function O(D){D&&(D.onresult=null,D.onerror=null,D.onend=null)}function z(D){const U=G;H(),U?.(oa(D))}function Z(D){const U=F,q=xa(D);H(),U?.(q)}function P(D={}){n.value="idle",D.clearTranscript&&(C.value=""),_.value="",D.clearError&&(m.value=null)}function L(){return ia([C.value,_.value])}function M(D,U,q){const ee=new D;return g=ee,ee.lang=q,ee.interimResults=!0,ee.continuous=!0,ee.onresult=pe=>{if(U!==u||g!==ee)return;const{finalText:me,interimText:xe}=ru(pe);me&&(C.value=ia([C.value,me])),_.value=xe},ee.onerror=pe=>{K(U,new Error(E(typeof pe.error=="string"?pe.error:void 0)))},ee.onend=()=>{if(!(U!==u||g!==ee)){if(n.value==="listening"&&!B){g=null,O(ee),_.value="";try{M(D,U,q).start()}catch(pe){K(U,pe)}return}R(U)}},ee}function I(){m.value=null,n.value==="error"&&(n.value="idle")}function R(D,U=L()){if(D!==u)return;const q=g;g=null,O(q),P(),z(U)}function K(D,U){if(D!==u)return xa(U);const q=xa(U),ee=g;return g=null,O(ee),_.value="",n.value="error",m.value=q,Z(q),q}async function te(D={}){const U=As();if(r.value=!!U,!U){const me=new Error(Q());throw n.value="error",m.value=me,me}he();const q=++u,ee=typeof D.language=="string"?D.language.trim():"";C.value="",_.value="",m.value=null,n.value="listening";const pe=M(U,q,ee);try{pe.start()}catch(me){throw K(q,me)}}function oe(){const D=u,U=g;return U?B||(n.value="stopping",B=new Promise((q,ee)=>{G=q,F=ee,Y(),V=setTimeout(()=>{R(D)},ri);try{U.stop()}catch(pe){K(D,pe)}}),B):(n.value!=="error"&&P(),Promise.resolve(oa(L())))}function he(){u+=1;const D=g;g=null,O(D);try{D?.abort()}catch{}z(""),P({clearTranscript:!0,clearError:!0})}return{isSupported:r,status:n,transcript:C,partialTranscript:_,error:m,start:te,stop:oe,cancel:he,clearError:I}}var ii,ri,cu=J((()=>{Ve(),ii="Browser speech recognition is not supported in this browser.",ri=1e3})),Fs,Ds,Es,Bs,Rs,Ns,Os,Us,zs,Vs,qs,Ks,Ws,Gs,Hs,js,Xs,Ys,Js,Qs,Zs,el,tl,al,sl,ll,nl,ol,il,sa,rl,ui,ul=J((()=>{Ve(),Ba(),Ea(),Qo(),Jo(),Jr(),lr(),Bt(),at(),ei(),tu(),pr(),fr(),ou(),rr(),vr(),cu(),tr(),Fs={class:"chat-input-area"},Ds={class:"input-top-bar"},Es={class:"auto-play-speech-switch"},Bs={key:2,class:"context-bar"},Rs={key:0,class:"attachment-previews"},Ns=["src","alt"],Os={key:1,class:"attachment-file"},Us={class:"file-name"},zs={class:"file-size"},Vs=["onClick"],qs=["placeholder"],Ks=["onMousedown","onMouseenter"],Ws={class:"slash-command-name"},Gs={key:0,class:"slash-command-args"},Hs={class:"slash-command-desc"},js={class:"input-actions"},Xs={key:0,class:"skill-picker-modal"},Ys=["placeholder"],Js={class:"skill-picker-list"},Qs={key:0,class:"skill-picker-empty"},Zs=["onClick","onKeydown"],el={class:"skill-picker-command"},tl={class:"skill-picker-name"},al={class:"skill-picker-desc"},sl={key:2,class:"skill-picker-empty"},ll={class:"context-edit-content"},nl={style:{"margin-bottom":"16px",color:"#666"}},ol={style:{"margin-top":"12px","font-size":"12px",color:"#999"}},il={style:{display:"flex","justify-content":"flex-end",gap:"8px"}},sa="hermes_chat_input_drafts_v1",rl=256e3,ui=tt({__name:"ChatInput",setup(A,{expose:r}){const n=Da(),C=Fa(),_=Yo(),{t:m}=st(),g=Aa(),{toolTraceVisible:u,toggleToolTraceVisible:B}=ti(),G=w(()=>[{label:m("chat.reasoningEffort.options.default"),value:""},{label:m("chat.reasoningEffort.options.none"),value:"none"},{label:m("chat.reasoningEffort.options.minimal"),value:"minimal"},{label:m("chat.reasoningEffort.options.low"),value:"low"},{label:m("chat.reasoningEffort.options.medium"),value:"medium"},{label:m("chat.reasoningEffort.options.high"),value:"high"},{label:m("chat.reasoningEffort.options.xhigh"),value:"xhigh"}]),F=w(()=>n.activeSession?.reasoningEffort||""),V=w(()=>{const l=F.value;return l?G.value.find(f=>f.value===l)?.label||l:m("chat.reasoningEffort.defaultLabel")});function Q(l){const f=n.activeSessionId;f&&n.setSessionReasoningEffort(f,l||"")}const E=h(""),Y=h(),H=h(),O=h(),z=h([]),Z=h(!1),P=h(0),L=h(!1),M=hr(),I=ur({messages:{unsupported:m("chat.voiceInput.microphoneUnsupported"),recordingFailed:m("chat.voiceInput.microphoneRecordingFailed")}}),R=dr(),K=uu({messages:{unsupported:m("chat.voiceInput.browserSpeechUnsupported"),failed:m("chat.voiceInput.browserSpeechFailed"),failedWithReason:l=>m("chat.voiceInput.browserSpeechFailedWithReason",{error:l})}}),te=h(null);function oe(l){return l.replace(/\s+/g," ").trim()}function he(){return R.provider.value==="custom"?{provider:"custom",language:R.customLanguage.value.trim()||void 0,prompt:R.customPrompt.value.trim()||void 0}:R.provider.value==="doubao"?{provider:"doubao"}:{provider:"openai",language:R.openaiLanguage.value.trim()||void 0,prompt:R.openaiPrompt.value.trim()||void 0}}function D(){return R.openaiLanguage.value.trim()||R.customLanguage.value.trim()||""}function U(l){const f=oe(l);if(!f)return;const y=Y.value,le=E.value,Te=y?.selectionStart??le.length,We=y?.selectionEnd??Te,je=le.slice(0,Te),re=le.slice(We),Gt=je&&!/\s$/.test(je)?" ":"",Ht=`${je}${Gt}${f}${re&&!/^\s/.test(re)?" ":""}${re}`,jt=je.length+Gt.length+f.length;E.value=Ht,se.value=!1,Me(()=>{const Xe=Y.value;Xe&&(Xe.focus(),Xe.setSelectionRange(jt,jt),d.value===null&&(Xe.style.height="auto",Xe.style.height=`${Math.min(Xe.scrollHeight,100)}px`))})}const q=nu({transcribe:async l=>{const{provider:f,language:y,prompt:le}=he();return cr({audio:l,provider:f,language:y,prompt:le})},sendMessage:async l=>{U(l)},stopOutputAudio:()=>M.stop(!0)}),ee=w(()=>te.value!=="browser"||q.status.value!=="capturing"?q.transcript.value:oe([K.transcript.value,K.partialTranscript.value].filter(Boolean).join(" "))),pe=w(()=>R.provider.value==="browser"||te.value==="browser"),me=w(()=>q.error.value?.message??(pe.value?K.error.value?.message:null)??I.state.value.error?.message??null),xe=w(()=>Hi.map(l=>({key:l.key,name:l.name,args:l.argsKey?m(l.argsKey):l.args||"",description:m(l.descriptionKey),insertText:l.insertText,opensSkillPicker:l.opensSkillPicker}))),se=h(!1),Oe=h(""),ve=h(0),$=h([]),T=h(!1),W=h(""),ge=h(!1);let de="",_e=null;const Le=w(()=>n.activeSession?.source==="cli"),fe=w(()=>!!n.activeSession&&n.activeSession.source!=="coding_agent"),ot=w(()=>{const l=new Map;for(const f of $.value)for(const y of f.skills||[])y.enabled!==!1&&(l.has(y.name)||l.set(y.name,y));return[...l.values()].map(f=>{const y=Fe(f.name);return{key:`skill:${y}`,name:f.name,commandName:y,description:f.description||f.name}})}),Se=w(()=>{const l=Oe.value.trim().toLowerCase(),f=Le.value?xe.value:fe.value?xe.value.filter(y=>y.name==="fork"):[];return l?f.filter(y=>{const le=y.name.toLowerCase(),Te=y.insertText?.toLowerCase(),We=y.description.toLowerCase();return le.startsWith(l)||Te?.startsWith(l)||We.includes(l)}):f}),$e=w(()=>{const l=W.value.trim().toLowerCase();return l?ot.value.filter(f=>f.name.toLowerCase().includes(l)||f.commandName.includes(l)||f.description.toLowerCase().includes(l)):ot.value});function Fe(l){return l.trim().toLowerCase().replace(/\s+/g,"-").replace(/_/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")}function Ge(){return n.activeSession?.profile||_.activeProfileName||"default"}async function p(){if(!Le.value)return;const l=Ge();return de===l||_e||(_e=(async()=>{try{const f=await nr(l);if(Ge()!==l)return;$.value=f.categories||[],de=l}catch{if(Ge()!==l)return;$.value=[],de=l}finally{_e=null}})()),_e}const d=h(null);function x(l){l.preventDefault();const f=Y.value;if(!f)return;const y=f.clientHeight,le=l.clientY;function Te(je){const re=y-(je.clientY-le);d.value=Math.max(20,Math.min(400,Math.round(re)))}function We(){document.removeEventListener("mousemove",Te),document.removeEventListener("mouseup",We),document.body.style.cursor="",document.body.style.userSelect=""}document.body.style.cursor="row-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",Te),document.addEventListener("mouseup",We)}const ie=h(!1);function ye(){try{const l=JSON.parse(localStorage.getItem(sa)||"{}");return l&&typeof l=="object"&&!Array.isArray(l)?l:{}}catch{return{}}}function ft(){return n.activeSessionId||n.activeSession?.id||""}function ht(){const l=ft();E.value=l&&ye()[l]||""}function St(l){const f=ft();if(!f)return;const y=ye();l?y[f]=l:delete y[f],Object.keys(y).length>0?localStorage.setItem(sa,JSON.stringify(y)):localStorage.removeItem(sa)}et(()=>{ht();const l=localStorage.getItem("autoPlaySpeech");l!==null&&(ie.value=l==="true",n.setAutoPlaySpeech(ie.value))}),ce(ie,l=>{localStorage.setItem("autoPlaySpeech",String(l)),n.setAutoPlaySpeech(l)}),ce(E,l=>{St(l)}),ce(()=>n.activeSession?.id,()=>{ht()}),ce(()=>[n.activeSession?.profile,_.activeProfileName],()=>{de="",$.value=[]});const ua=w(()=>E.value.trim()||z.value.length>0);function qe(){Me(()=>{H.value&&H.value.querySelector(".active")?.scrollIntoView({block:"nearest",behavior:"instant"})})}function be(){if(!Le.value&&!fe.value){se.value=!1;return}const l=Y.value;if(!l)return;const f=l.selectionStart,y=E.value.slice(0,f);if(!y.startsWith("/")||y.includes(" ")||y.includes(`
|
|
1
|
+
import{n as J}from"./rolldown-runtime-M0oDzQ_3.js";import{$t as na,Cn as Ai,Dn as i,E as Fi,En as La,I as Di,In as S,It as Qe,Jt as Ft,K as vt,Kn as h,Kt as Ve,Ln as Dt,M as Ei,Ot as X,P as Bi,Pn as ce,Qt as ba,Tn as et,V as Aa,Y as Ri,Zt as Qa,an as t,ar as c,cn as v,ct as Ni,dn as j,en as la,er as e,fn as k,g as Oi,gt as Ui,in as w,ir as Et,kn as ke,m as zi,mt as Je,nr as ne,nt as Xo,on as ae,ot as Ze,pn as tt,sn as b,t as Bt,tn as ue,ut as Vi,w as qi,xn as Me}from"./ui-vendor-BUz-RIuE.js";import{c as at,f as Ki,l as st,m as Wi}from"./vue-vendor-BAk4Aood.js";import{d as Gi,f as pt,n as lt,t as nt,u as ra}from"./_plugin-vue_export-helper-D9aS-jmR.js";import{C as Hi,G as ji,K as Za,X as es,_t as Fa,b as Da,dt as Xi,et as Yi,gt as Ea,ht as Yo,lt as Jo,mt as Qo,nt as Ji,q as Qi,rt as Zi,ut as er,w as tr,y as Ba}from"./index-D7Ma0wep.js";import{n as ar,t as sr}from"./session-browser-prefs-16DgLY_L.js";import{n as Zo,t as Ia}from"./clipboard-1NPxC3YL.js";import{l as lr,s as nr}from"./skills-DhYpy-kw.js";import{a as ei,i as or,o as ti,r as ir}from"./chat-timestamp-Cs7c547g.js";import{c as rr,d as ur,l as cr,n as dr,t as vr,u as pr}from"./useSttSettings-B1qx7G5j.js";import{d as fr,f as hr}from"./ttsHelpers-DpXZJub7.js";import{a as ts,i as mr,n as gr,o as as,r as ss,s as _r,t as yr}from"./OutlinePanel-L7D8-Ikf.js";import{n as wr,t as kr}from"./MessageItem-Ci7UFgqI.js";import{_ as Sr,a as br,b as Cr,c as xr,d as Mr,f as $r,g as Pr,h as Ir,i as Tr,l as Lr,m as Ar,n as Fr,o as Dr,p as Er,r as Br,s as Rr,t as Nr,u as Or,v as Ur,y as zr}from"./FileRenameModal-CLIjRvNr.js";import{n as Vr,t as qr}from"./TerminalPanel-BoahxMAQ.js";import{i as Kr,n as Wr,r as Gr,t as Hr}from"./SettingsCircuitBadge-BMGa0qD8.js";var ls,ns,os,is,rs,us,cs,ds,vs,ps,fs,hs,ai,ms=J((()=>{Ve(),Bt(),at(),ra(),Zo(),ls={class:"folder-picker"},ns={key:0,class:"folder-picker-loading"},os={key:1,class:"folder-tree"},is={class:"folder-name"},rs=["onClick","onContextmenu"],us=["onClick"],cs={class:"folder-name"},ds={class:"folder-empty-text"},vs={key:1,class:"folder-empty"},ps={key:2,class:"folder-selected"},fs={class:"folder-selected-label"},hs={class:"folder-selected-path"},ai=tt({__name:"FolderPicker",props:{modelValue:{}},emits:["update:modelValue"],setup(A,{emit:r}){const n=A,C=r,{t:_}=st(),m=Ri(),g=Aa(),u=h(!1),B=h(""),G=h([]),F=h(new Set),V=h(new Map),Q=h(new Set),E=h(n.modelValue||""),Y=h(!1),H=h(!1),O=h(0),z=h(0),Z=h(null),P=h(!1),L=h("create"),M=h(""),I=h(!1);ce(()=>n.modelValue,$=>{E.value=$||""});function R($){const T=String($||"").trim();E.value=T,C("update:modelValue",T||null)}async function K($=""){try{return await pt(`/api/hermes/workspace/folders${$?`?path=${encodeURIComponent($)}`:""}`)}catch{return null}}function te($){const T=$.split("/").filter(Boolean);return T.pop(),T.join("/")}async function oe($=""){const T=await K($);if(!T){Y.value=!0;return}if(Y.value=!1,!$){B.value=T.base,G.value=T.folders;return}V.value.set($,T.folders),V.value=new Map(V.value)}et(async()=>{u.value=!0,await oe(),u.value=!1});async function he($){if(F.value.has($.path)){F.value.delete($.path),F.value=new Set(F.value);return}if(F.value.add($.path),F.value=new Set(F.value),!V.value.has($.path)){Q.value.add($.path),Q.value=new Set(Q.value);const T=await K($.path);V.value.set($.path,T?.folders||[]),V.value=new Map(V.value),Q.value.delete($.path),Q.value=new Set(Q.value)}}function D($){R($.fullPath)}function U(){R(B.value)}async function q($){if(!$){U();return}D($),F.value.has($.path)||await he($)}function ee($,T){$.preventDefault(),$.stopPropagation(),Z.value=T,O.value=$.clientX,z.value=$.clientY,H.value=!1,Me(()=>{H.value=!0})}const pe=w(()=>{const $=[{label:_("files.open"),key:"open"},{type:"divider",key:"d1"},{label:_("files.copyPath"),key:"copyPath"},{label:_("files.newFolder"),key:"newFolder"}];return Z.value&&($.push({label:_("files.rename"),key:"rename"}),$.push({type:"divider",key:"d2"}),$.push({label:_("files.delete"),key:"delete"})),$});function me(){H.value=!1}function xe($){L.value=$,M.value=$==="rename"&&Z.value?.name||"",P.value=!0}async function se($){H.value=!1;const T=Z.value;switch($){case"open":await q(T);break;case"copyPath":{const W=await Ia(T?.fullPath||B.value);g[W?"success":"error"](W?_("files.pathCopied"):`${_("files.pathCopied")} ✗`);break}case"newFolder":xe("create");break;case"rename":T&&xe("rename");break;case"delete":if(!T)return;m.warning({title:_("files.delete"),content:_("files.confirmDeleteDir",{name:T.name}),positiveText:_("common.delete"),negativeText:_("common.cancel"),onPositiveClick:async()=>{try{await pt("/api/hermes/workspace/folders",{method:"DELETE",body:JSON.stringify({path:T.path})}),(E.value===T.fullPath||E.value.startsWith(`${T.fullPath}/`))&&R(null),F.value.delete(T.path),F.value=new Set(F.value),V.value.delete(T.path),V.value=new Map(V.value),await oe(te(T.path)),g.success(_("files.deleted"))}catch{g.error(_("files.deleteFailed"))}}});break}}async function Oe(){const $=M.value.trim();if($){I.value=!0;try{if(L.value==="create"){const T=Z.value?.path||"";await pt("/api/hermes/workspace/folders",{method:"POST",body:JSON.stringify({parentPath:T,name:$})}),T&&(F.value.add(T),F.value=new Set(F.value)),await oe(T),g.success(_("files.created"))}else if(Z.value){const T=Z.value;await pt("/api/hermes/workspace/folders/rename",{method:"POST",body:JSON.stringify({path:T.path,name:$})}),await oe(te(T.path)),(E.value===T.fullPath||E.value.startsWith(`${T.fullPath}/`))&&R(null),g.success(_("files.renamed"))}P.value=!1}catch{g.error(L.value==="rename"?_("files.renameFailed"):_("files.createFailed"))}finally{I.value=!1}}}const ve=w(()=>{const $=[];function T(W,ge){for(const de of W){const _e=F.value.has(de.path),Le=Q.value.has(de.path),fe=V.value.get(de.path);$.push({folder:de,depth:ge,isExpanded:_e,isLoading:Le,hasChildren:fe?fe.length>0:null}),_e&&fe&&fe.length>0&&T(fe,ge+1)}}return T(G.value,0),$});return($,T)=>(i(),v("div",ls,[k(e(Qe),{value:E.value,placeholder:e(_)("chat.workspacePlaceholder"),clearable:"",size:"small",class:"folder-path-input","onUpdate:value":R},null,8,["value","placeholder"]),u.value?(i(),v("div",ns,[k(e(Oi),{size:"small"})])):(i(),v("div",os,[B.value?(i(),v("div",{key:0,class:ne(["folder-item root",{selected:E.value===B.value}]),onClick:U,onContextmenu:T[0]||(T[0]=W=>ee(W,null))},[T[4]||(T[4]=t("span",{class:"folder-icon"},"📂",-1)),t("span",is,c(B.value||"/"),1)],34)):b("",!0),(i(!0),v(ue,null,ke(ve.value,W=>(i(),v("div",{key:W.folder.path,class:ne(["folder-item",{selected:E.value===W.folder.fullPath}]),style:Et({paddingLeft:`${12+W.depth*16}px`}),onClick:ge=>D(W.folder),onContextmenu:ge=>ee(ge,W.folder)},[t("span",{class:"folder-expand",onClick:la(ge=>he(W.folder),["stop"])},[W.isLoading?(i(),v(ue,{key:0},[j("⏳")],64)):(i(),v(ue,{key:1},[j(c(W.isExpanded?"▼":"▶"),1)],64))],8,us),T[5]||(T[5]=t("span",{class:"folder-icon"},"📁",-1)),t("span",cs,c(W.folder.name),1)],46,rs))),128)),(i(!0),v(ue,null,ke(ve.value,W=>(i(),v(ue,{key:"empty-"+W.folder.path},[W.isExpanded&&!W.isLoading&&W.hasChildren===!1?(i(),v("div",{key:0,class:"folder-item empty",style:Et({paddingLeft:`${28+W.depth*16}px`})},[t("span",ds,c(e(_)("chat.folderPickerEmpty")),1)],4)):b("",!0)],64))),128)),(G.value.length===0||Y.value)&&!u.value?(i(),v("div",vs,c(e(_)("chat.folderPickerNoFolders")),1)):b("",!0)])),E.value?(i(),v("div",ps,[t("span",fs,c(e(_)("chat.folderPickerSelected")),1),t("span",hs,c(E.value),1)])):b("",!0),k(e(Xo),{show:H.value,x:O.value,y:z.value,options:pe.value,placement:"bottom-start",trigger:"manual",onSelect:se,onClickoutside:me},null,8,["show","x","y","options"]),k(e(vt),{show:P.value,"onUpdate:show":T[3]||(T[3]=W=>P.value=W),preset:"dialog",title:L.value==="rename"?e(_)("files.rename"):e(_)("files.newFolder"),style:{width:"400px"}},{action:S(()=>[k(e(Ei),{justify:"end"},{default:S(()=>[k(e(X),{size:"small",onClick:T[2]||(T[2]=W=>P.value=!1)},{default:S(()=>[j(c(e(_)("common.cancel")),1)]),_:1}),k(e(X),{size:"small",type:"primary",loading:I.value,disabled:!M.value.trim(),onClick:Oe},{default:S(()=>[j(c(e(_)("common.confirm")),1)]),_:1},8,["loading","disabled"])]),_:1})]),default:S(()=>[k(e(Qe),{value:M.value,"onUpdate:value":T[1]||(T[1]=W=>M.value=W),placeholder:L.value==="rename"?e(_)("files.renameTo"):e(_)("files.newFolderName")},null,8,["value","placeholder"])]),_:1},8,["show","title"])]))}})})),jr=J((()=>{})),Ta,Xr=J((()=>{ms(),ms(),jr(),lt(),Ta=nt(ai,[["__scopeId","data-v-92479ea5"]])}));async function Yr(A,r,n){return(await pt(`/api/hermes/model-context/${encodeURIComponent(A)}/${encodeURIComponent(r)}`,{method:"PUT",body:JSON.stringify({provider:A,model:r,context_limit:n})})).data}var Jr=J((()=>{ra()})),gs,_s,ys,ws,ks,Ss,bs,si,Cs=J((()=>{Ve(),at(),gs=["data-status"],_s={class:"voice-transcript-overlay__status"},ys={key:0,class:"voice-transcript-overlay__transcript"},ws={key:1,class:"voice-transcript-overlay__error",role:"alert"},ks={key:2,class:"voice-transcript-overlay__debug"},Ss={class:"voice-transcript-overlay__debug-title"},bs={class:"voice-transcript-overlay__debug-list"},si=tt({__name:"VoiceTranscriptOverlay",props:{status:{},transcript:{},error:{default:null},floating:{type:Boolean,default:!1},events:{default:()=>[]},debug:{type:Boolean,default:!1}},setup(A){const r=A,{t:n}=st(),C=w(()=>n(`chat.voiceInput.status.${r.status}`)),_=w(()=>n("chat.voiceInput.statusLabel",{status:C.value})),m=w(()=>n("chat.voiceInput.transcriptLabel",{text:r.transcript})),g=w(()=>n("chat.voiceInput.errorLabel",{error:r.error})),u=w(()=>r.events.slice(-5).map(B=>B.type));return(B,G)=>(i(),v("div",{class:ne(["voice-transcript-overlay",{"voice-transcript-overlay--floating":r.floating}]),"data-testid":"voice-transcript-overlay","data-status":r.status,role:"status","aria-live":"polite"},[t("p",_s,c(_.value),1),r.transcript?(i(),v("p",ys,c(m.value),1)):b("",!0),r.error?(i(),v("p",ws,c(g.value),1)):b("",!0),r.debug&&u.value.length?(i(),v("div",ks,[t("p",Ss,c(e(n)("chat.voiceInput.recentEvents")),1),t("ol",bs,[(i(!0),v(ue,null,ke(u.value,(F,V)=>(i(),v("li",{key:`${V}:${F}`,class:"voice-transcript-overlay__debug-item","data-testid":"voice-event-debug-item"},c(F),1))),128))])])):b("",!0)],10,gs))}})})),Qr=J((()=>{})),li,Zr=J((()=>{Cs(),Cs(),Qr(),lt(),li=nt(si,[["__scopeId","data-v-2d59fc0f"]])})),xs,Ms,$s,Ps,Is,ni,Ts=J((()=>{Ve(),at(),Zr(),xs={class:"voice-dialogue-controls__actions"},Ms=["aria-label","aria-pressed"],$s={key:0,class:"voice-dialogue-controls__icon",width:"16",height:"16",viewBox:"0 0 24 24","aria-hidden":"true"},Ps={key:1,class:"voice-dialogue-controls__icon",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},Is=["aria-label"],ni=tt({__name:"VoiceDialogueControls",props:{status:{},transcript:{},error:{default:null},events:{default:()=>[]},debug:{type:Boolean,default:!1},onStart:{},onStop:{},onCancel:{}},setup(A){const r=A,n=new Set(["capturing","transcribing","sending"]),{t:C}=st(),_=w(()=>n.has(r.status)),m=w(()=>_.value||!!r.transcript||!!r.error),g=w(()=>_.value?C("chat.voiceInput.stopCaptureAndInsert"):C("chat.voiceInput.startCapture"));async function u(){if(_.value){await r.onStop();return}await r.onStart()}function B(){r.onCancel()}return(G,F)=>(i(),v("div",{class:ne(["voice-dialogue-controls voice-dialogue-controls--floating-overlay",{active:_.value}])},[m.value?(i(),ae(li,{key:0,floating:"",status:r.status,transcript:r.transcript,error:r.error,events:r.events,debug:r.debug},null,8,["status","transcript","error","events","debug"])):b("",!0),t("div",xs,[t("button",{type:"button",class:ne(["voice-dialogue-controls__toggle",{active:_.value}]),"data-testid":"voice-record-toggle","aria-label":g.value,"aria-pressed":_.value,onClick:u},[_.value?(i(),v("svg",$s,[...F[0]||(F[0]=[t("rect",{x:"7",y:"7",width:"10",height:"10",rx:"2",fill:"currentColor"},null,-1)])])):(i(),v("svg",Ps,[...F[1]||(F[1]=[t("path",{d:"M12 3a3 3 0 0 0-3 3v5a3 3 0 0 0 6 0V6a3 3 0 0 0-3-3Z"},null,-1),t("path",{d:"M5 10v1a7 7 0 0 0 14 0v-1"},null,-1),t("path",{d:"M12 18v3"},null,-1),t("path",{d:"M9 21h6"},null,-1)])]))],10,Ms),_.value?(i(),v("button",{key:0,type:"button",class:"voice-dialogue-controls__cancel","data-testid":"voice-record-cancel","aria-label":e(C)("chat.voiceInput.cancelCapture"),onClick:B},[...F[2]||(F[2]=[t("svg",{class:"voice-dialogue-controls__icon voice-dialogue-controls__icon--small",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","aria-hidden":"true"},[t("path",{d:"M18 6 6 18"}),t("path",{d:"m6 6 12 12"})],-1)])],8,Is)):b("",!0)])],2))}})})),eu=J((()=>{})),oi,tu=J((()=>{Ts(),Ts(),eu(),lt(),oi=nt(ni,[["__scopeId","data-v-bed1a556"]])}));function au(A){let r=0;return function(C,_={}){return r+=1,{id:`${A}:${r}`,seq:r,sessionId:A,type:C,captureId:_.captureId,turnId:_.turnId,timestamp:_.timestamp??new Date().toISOString(),final:_.final,payload:_.payload}}}var su=J((()=>{}));function Ca(A){return`${A}-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function Ls(A){return A instanceof Error?A:new Error(String(A))}function lu(A){return A.replace(/\s+/g," ").trim()}function nu(A){const r=Ca("voice-session"),n=au(r),C=h([]),_=h("idle"),m=h(null),g=h(null),u=h(""),B=h(null),G=w(()=>_.value!=="idle");function F(P,L={}){const M=n(P,{...L,captureId:L.captureId??m.value??void 0,turnId:L.turnId??g.value??void 0});return C.value.push(M),C.value.length>50&&C.value.splice(0,C.value.length-50),M}function V(P,L={}){const M=Ls(P);return B.value=M,_.value="error",F("session.error",{captureId:L.captureId,turnId:L.turnId,final:!0,payload:M}),M}function Q(P={}){const L=P.captureId??m.value,M=P.turnId??g.value;M&&F("turn.cancelled",{captureId:L??void 0,turnId:M,final:!0}),L&&F("capture.cancelled",{captureId:L,turnId:M??void 0,final:!0}),m.value=null,g.value=null,u.value="",B.value=null,_.value="idle"}F("session.started",{final:!0});async function E(){try{await Promise.resolve(A.stopOutputAudio?.())}catch(L){console.warn("[useVoiceDialogue] Failed to stop output audio before capture:",Ls(L))}(m.value||g.value)&&Q(),B.value=null,u.value="",_.value="capturing",g.value=null;const P=Ca("capture");return m.value=P,F("capture.started",{captureId:P}),{captureId:P}}async function Y(P,L){if(m.value!==P)return;const M=lu(L);if(!M){u.value="",O(P);return}B.value=null,u.value=M,_.value="sending",F("transcript.done",{captureId:P,final:!0,payload:{text:M}});const I=Ca("turn");g.value=I,F("turn.started",{captureId:P,turnId:I,payload:{text:M}});try{await Promise.resolve(A.sendMessage(M))}catch(R){if(m.value===P&&g.value===I)throw V(R,{captureId:P,turnId:I}),R;return}m.value!==P||g.value!==I||(F("turn.ended",{captureId:P,turnId:I,final:!0,payload:{text:M}}),m.value=null,g.value=null,u.value="",_.value="idle")}async function H(P,L){if(m.value===P){B.value=null,_.value="transcribing";try{const M=await A.transcribe(L);if(m.value!==P)return;await Y(P,M.text)}catch(M){if(m.value===P)throw B.value===null&&V(M,{captureId:P,turnId:g.value??void 0}),M;return}}}function O(P=m.value){!P||m.value!==P||Q({captureId:P,turnId:g.value})}function z(P){F("output.audio.started",{payload:P})}function Z(P){F("output.audio.done",{final:!0,payload:P})}return{sessionId:r,events:C,status:_,activeCaptureId:m,activeTurnId:g,transcript:u,error:B,isBusy:G,beginCapture:E,transcribeAndSend:H,commitTranscript:Y,cancelCapture:O,markOutputStarted:z,markOutputDone:Z}}var ou=J((()=>{Ve(),su()}));function xa(A){return A instanceof Error?A:new Error(String(A))}function oa(A){return A.replace(/\s+/g," ").trim()}function ia(A){return oa(A.filter(Boolean).join(" "))}function iu(A){return oa(A?.[0]?.transcript??"")}function ru(A){const r=A.results,n=typeof A.resultIndex=="number"?A.resultIndex:0,C=[],_=[];if(!r||typeof r.length!="number")return{finalText:"",interimText:""};for(let m=n;m<r.length;m+=1){const g=r[m],u=iu(g);u&&(g?.isFinal?C.push(u):_.push(u))}return{finalText:ia(C),interimText:ia(_)}}function As(){if(typeof window>"u")return null;const A=window;return A.SpeechRecognition??A.webkitSpeechRecognition??null}function uu(A={}){const r=h(!!As()),n=h("idle"),C=h(""),_=h(""),m=h(null);let g=null,u=0,B=null,G=null,F=null,V=null;function Q(){return A.messages?.unsupported||ii}function E(D){const U=D?.trim();return U&&A.messages?.failedWithReason?A.messages.failedWithReason(U):U?`Browser speech recognition failed: ${U}.`:A.messages?.failed||"Browser speech recognition failed."}function Y(){V!==null&&(clearTimeout(V),V=null)}function H(){B=null,G=null,F=null,Y()}function O(D){D&&(D.onresult=null,D.onerror=null,D.onend=null)}function z(D){const U=G;H(),U?.(oa(D))}function Z(D){const U=F,q=xa(D);H(),U?.(q)}function P(D={}){n.value="idle",D.clearTranscript&&(C.value=""),_.value="",D.clearError&&(m.value=null)}function L(){return ia([C.value,_.value])}function M(D,U,q){const ee=new D;return g=ee,ee.lang=q,ee.interimResults=!0,ee.continuous=!0,ee.onresult=pe=>{if(U!==u||g!==ee)return;const{finalText:me,interimText:xe}=ru(pe);me&&(C.value=ia([C.value,me])),_.value=xe},ee.onerror=pe=>{K(U,new Error(E(typeof pe.error=="string"?pe.error:void 0)))},ee.onend=()=>{if(!(U!==u||g!==ee)){if(n.value==="listening"&&!B){g=null,O(ee),_.value="";try{M(D,U,q).start()}catch(pe){K(U,pe)}return}R(U)}},ee}function I(){m.value=null,n.value==="error"&&(n.value="idle")}function R(D,U=L()){if(D!==u)return;const q=g;g=null,O(q),P(),z(U)}function K(D,U){if(D!==u)return xa(U);const q=xa(U),ee=g;return g=null,O(ee),_.value="",n.value="error",m.value=q,Z(q),q}async function te(D={}){const U=As();if(r.value=!!U,!U){const me=new Error(Q());throw n.value="error",m.value=me,me}he();const q=++u,ee=typeof D.language=="string"?D.language.trim():"";C.value="",_.value="",m.value=null,n.value="listening";const pe=M(U,q,ee);try{pe.start()}catch(me){throw K(q,me)}}function oe(){const D=u,U=g;return U?B||(n.value="stopping",B=new Promise((q,ee)=>{G=q,F=ee,Y(),V=setTimeout(()=>{R(D)},ri);try{U.stop()}catch(pe){K(D,pe)}}),B):(n.value!=="error"&&P(),Promise.resolve(oa(L())))}function he(){u+=1;const D=g;g=null,O(D);try{D?.abort()}catch{}z(""),P({clearTranscript:!0,clearError:!0})}return{isSupported:r,status:n,transcript:C,partialTranscript:_,error:m,start:te,stop:oe,cancel:he,clearError:I}}var ii,ri,cu=J((()=>{Ve(),ii="Browser speech recognition is not supported in this browser.",ri=1e3})),Fs,Ds,Es,Bs,Rs,Ns,Os,Us,zs,Vs,qs,Ks,Ws,Gs,Hs,js,Xs,Ys,Js,Qs,Zs,el,tl,al,sl,ll,nl,ol,il,sa,rl,ui,ul=J((()=>{Ve(),Ba(),Ea(),Qo(),Jo(),Jr(),lr(),Bt(),at(),ei(),tu(),pr(),fr(),ou(),rr(),vr(),cu(),tr(),Fs={class:"chat-input-area"},Ds={class:"input-top-bar"},Es={class:"auto-play-speech-switch"},Bs={key:2,class:"context-bar"},Rs={key:0,class:"attachment-previews"},Ns=["src","alt"],Os={key:1,class:"attachment-file"},Us={class:"file-name"},zs={class:"file-size"},Vs=["onClick"],qs=["placeholder"],Ks=["onMousedown","onMouseenter"],Ws={class:"slash-command-name"},Gs={key:0,class:"slash-command-args"},Hs={class:"slash-command-desc"},js={class:"input-actions"},Xs={key:0,class:"skill-picker-modal"},Ys=["placeholder"],Js={class:"skill-picker-list"},Qs={key:0,class:"skill-picker-empty"},Zs=["onClick","onKeydown"],el={class:"skill-picker-command"},tl={class:"skill-picker-name"},al={class:"skill-picker-desc"},sl={key:2,class:"skill-picker-empty"},ll={class:"context-edit-content"},nl={style:{"margin-bottom":"16px",color:"#666"}},ol={style:{"margin-top":"12px","font-size":"12px",color:"#999"}},il={style:{display:"flex","justify-content":"flex-end",gap:"8px"}},sa="hermes_chat_input_drafts_v1",rl=256e3,ui=tt({__name:"ChatInput",setup(A,{expose:r}){const n=Da(),C=Fa(),_=Yo(),{t:m}=st(),g=Aa(),{toolTraceVisible:u,toggleToolTraceVisible:B}=ti(),G=w(()=>[{label:m("chat.reasoningEffort.options.default"),value:""},{label:m("chat.reasoningEffort.options.none"),value:"none"},{label:m("chat.reasoningEffort.options.minimal"),value:"minimal"},{label:m("chat.reasoningEffort.options.low"),value:"low"},{label:m("chat.reasoningEffort.options.medium"),value:"medium"},{label:m("chat.reasoningEffort.options.high"),value:"high"},{label:m("chat.reasoningEffort.options.xhigh"),value:"xhigh"}]),F=w(()=>n.activeSession?.reasoningEffort||""),V=w(()=>{const l=F.value;return l?G.value.find(f=>f.value===l)?.label||l:m("chat.reasoningEffort.defaultLabel")});function Q(l){const f=n.activeSessionId;f&&n.setSessionReasoningEffort(f,l||"")}const E=h(""),Y=h(),H=h(),O=h(),z=h([]),Z=h(!1),P=h(0),L=h(!1),M=hr(),I=ur({messages:{unsupported:m("chat.voiceInput.microphoneUnsupported"),recordingFailed:m("chat.voiceInput.microphoneRecordingFailed")}}),R=dr(),K=uu({messages:{unsupported:m("chat.voiceInput.browserSpeechUnsupported"),failed:m("chat.voiceInput.browserSpeechFailed"),failedWithReason:l=>m("chat.voiceInput.browserSpeechFailedWithReason",{error:l})}}),te=h(null);function oe(l){return l.replace(/\s+/g," ").trim()}function he(){return R.provider.value==="custom"?{provider:"custom",language:R.customLanguage.value.trim()||void 0,prompt:R.customPrompt.value.trim()||void 0}:R.provider.value==="doubao"?{provider:"doubao"}:{provider:"openai",language:R.openaiLanguage.value.trim()||void 0,prompt:R.openaiPrompt.value.trim()||void 0}}function D(){return R.openaiLanguage.value.trim()||R.customLanguage.value.trim()||""}function U(l){const f=oe(l);if(!f)return;const y=Y.value,le=E.value,Te=y?.selectionStart??le.length,We=y?.selectionEnd??Te,je=le.slice(0,Te),re=le.slice(We),Gt=je&&!/\s$/.test(je)?" ":"",Ht=`${je}${Gt}${f}${re&&!/^\s/.test(re)?" ":""}${re}`,jt=je.length+Gt.length+f.length;E.value=Ht,se.value=!1,Me(()=>{const Xe=Y.value;Xe&&(Xe.focus(),Xe.setSelectionRange(jt,jt),d.value===null&&(Xe.style.height="auto",Xe.style.height=`${Math.min(Xe.scrollHeight,100)}px`))})}const q=nu({transcribe:async l=>{const{provider:f,language:y,prompt:le}=he();return cr({audio:l,provider:f,language:y,prompt:le})},sendMessage:async l=>{U(l)},stopOutputAudio:()=>M.stop(!0)}),ee=w(()=>te.value!=="browser"||q.status.value!=="capturing"?q.transcript.value:oe([K.transcript.value,K.partialTranscript.value].filter(Boolean).join(" "))),pe=w(()=>R.provider.value==="browser"||te.value==="browser"),me=w(()=>q.error.value?.message??(pe.value?K.error.value?.message:null)??I.state.value.error?.message??null),xe=w(()=>Hi.map(l=>({key:l.key,name:l.name,args:l.argsKey?m(l.argsKey):l.args||"",description:m(l.descriptionKey),insertText:l.insertText,opensSkillPicker:l.opensSkillPicker}))),se=h(!1),Oe=h(""),ve=h(0),$=h([]),T=h(!1),W=h(""),ge=h(!1);let de="",_e=null;const Le=w(()=>n.activeSession?.source==="cli"),fe=w(()=>!!n.activeSession&&n.activeSession.source!=="coding_agent"),ot=w(()=>{const l=new Map;for(const f of $.value)for(const y of f.skills||[])y.enabled!==!1&&(l.has(y.name)||l.set(y.name,y));return[...l.values()].map(f=>{const y=Fe(f.name);return{key:`skill:${y}`,name:f.name,commandName:y,description:f.description||f.name}})}),Se=w(()=>{const l=Oe.value.trim().toLowerCase(),f=Le.value?xe.value:fe.value?xe.value.filter(y=>y.name==="fork"):[];return l?f.filter(y=>{const le=y.name.toLowerCase(),Te=y.insertText?.toLowerCase(),We=y.description.toLowerCase();return le.startsWith(l)||Te?.startsWith(l)||We.includes(l)}):f}),$e=w(()=>{const l=W.value.trim().toLowerCase();return l?ot.value.filter(f=>f.name.toLowerCase().includes(l)||f.commandName.includes(l)||f.description.toLowerCase().includes(l)):ot.value});function Fe(l){return l.trim().toLowerCase().replace(/\s+/g,"-").replace(/_/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")}function Ge(){return n.activeSession?.profile||_.activeProfileName||"default"}async function p(){if(!Le.value)return;const l=Ge();return de===l||_e||(_e=(async()=>{try{const f=await nr(l);if(Ge()!==l)return;$.value=f.categories||[],de=l}catch{if(Ge()!==l)return;$.value=[],de=l}finally{_e=null}})()),_e}const d=h(null);function x(l){l.preventDefault();const f=Y.value;if(!f)return;const y=f.clientHeight,le=l.clientY;function Te(je){const re=y-(je.clientY-le);d.value=Math.max(20,Math.min(400,Math.round(re)))}function We(){document.removeEventListener("mousemove",Te),document.removeEventListener("mouseup",We),document.body.style.cursor="",document.body.style.userSelect=""}document.body.style.cursor="row-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",Te),document.addEventListener("mouseup",We)}const ie=h(!1);function ye(){try{const l=JSON.parse(localStorage.getItem(sa)||"{}");return l&&typeof l=="object"&&!Array.isArray(l)?l:{}}catch{return{}}}function ft(){return n.activeSessionId||n.activeSession?.id||""}function ht(){const l=ft();E.value=l&&ye()[l]||""}function St(l){const f=ft();if(!f)return;const y=ye();l?y[f]=l:delete y[f],Object.keys(y).length>0?localStorage.setItem(sa,JSON.stringify(y)):localStorage.removeItem(sa)}et(()=>{ht();const l=localStorage.getItem("autoPlaySpeech");l!==null&&(ie.value=l==="true",n.setAutoPlaySpeech(ie.value))}),ce(ie,l=>{localStorage.setItem("autoPlaySpeech",String(l)),n.setAutoPlaySpeech(l)}),ce(E,l=>{St(l)}),ce(()=>n.activeSession?.id,()=>{ht()}),ce(()=>[n.activeSession?.profile,_.activeProfileName],()=>{de="",$.value=[]});const ua=w(()=>E.value.trim()||z.value.length>0);function qe(){Me(()=>{H.value&&H.value.querySelector(".active")?.scrollIntoView({block:"nearest",behavior:"instant"})})}function be(){if(!Le.value&&!fe.value){se.value=!1;return}const l=Y.value;if(!l)return;const f=l.selectionStart,y=E.value.slice(0,f);if(!y.startsWith("/")||y.includes(" ")||y.includes(`
|
|
2
2
|
`)){se.value=!1;return}Oe.value=y.slice(1),ve.value=0,se.value=Se.value.length>0}function Pe(l){if(l.opensSkillPicker){se.value=!1,De();return}E.value=`/${l.insertText||l.name} `,se.value=!1,Me(()=>{const f=Y.value;if(!f)return;const y=E.value.length;f.setSelectionRange(y,y),f.focus()})}async function De(){if(Le.value){se.value=!1,W.value="",T.value=!0,ge.value=!0;try{await p()}finally{ge.value=!1}}}function Ie(l){E.value=`/skill ${l.commandName} `,T.value=!1,Me(()=>{const f=Y.value;if(!f)return;const y=E.value.length;f.setSelectionRange(y,y),f.focus()})}const Ce=h(256e3);let Ae="",Ee="",Be=null;const Ue=h(!1),we=h(256e3),mt=h(!1),gt=w(()=>n.activeSession?.source==="coding_agent");async function Rt(){gt.value||(we.value=Ce.value,Ue.value=!0)}async function ca(){if(!we.value||we.value<=0){g.error(m("chat.contextEditInvalid"));return}mt.value=!0;try{const l=n.activeSession?.provider||C.selectedProvider||"",f=n.activeSession?.model||C.selectedModel||"";if(!l||!f){g.error(m("chat.contextEditFailed"));return}await Yr(l,f,we.value),Ce.value=we.value,Ae=it(),Ue.value=!1,g.success(m("chat.contextEditSuccess"))}catch(l){g.error(`${m("chat.contextEditFailed")}: ${l.message||""}`)}finally{mt.value=!1}}function bt(){const l=n.activeSession;return{profile:l?.profile||_.activeProfileName||void 0,provider:l?.provider||void 0,model:l?.model||void 0}}function it(){const l=bt();return`${l.profile||""}|${l.provider||""}|${l.model||""}`}async function Nt(){if(gt.value)return;const l=it();if(l!==Ae)return l===Ee&&Be||(Ee=l,Be=(async()=>{const f=bt();try{const y=await Zi(f.profile,f.provider,f.model);if(it()!==l)return;Ce.value=y,Ae=l}catch{if(it()!==l)return;Ce.value=rl,Ae=l}finally{Ee===l&&(Be=null,Ee="")}})()),Be}et(Nt),ce(()=>[_.activeProfileName,C.selectedProvider,C.selectedModel,n.activeSession?.id,n.activeSession?.profile,n.activeSession?.provider,n.activeSession?.model,n.activeSession?.source],Nt,{flush:"post"});const rt=w(()=>{if(gt.value)return 0;const l=n.activeSession?.contextTokens;return typeof l=="number"&&Number.isFinite(l)&&l>0?l:(n.activeSession?.inputTokens??0)+(n.activeSession?.outputTokens??0)}),Ot=w(()=>rt.value>0),da=w(()=>Math.max(0,Ce.value-rt.value)),Ke=w(()=>Math.min(rt.value/Ce.value*100,100));function Ct(l){return l>=1e6?(l/1e6).toFixed(1)+"M":l>=1e3?(l/1e3).toFixed(1)+"k":String(l)}function Ut(l){if(z.value.find(le=>le.name===l.name))return;const f=Date.now().toString(36)+Math.random().toString(36).slice(2,8),y=URL.createObjectURL(l);z.value.push({id:f,name:l.name,type:l.type,size:l.size,url:y,file:l})}function ze(l){for(const f of l)Ut(f);l.length>0&&Y.value?.focus()}function He(){O.value?.click()}function va(l){const f=l.target;f.files&&(ze(Array.from(f.files)),f.value="")}function _t(l){const f=Array.from(l.clipboardData?.items||[]).filter(y=>y.type.startsWith("image/"));if(f.length){l.preventDefault();for(const y of f){const le=y.getAsFile();if(!le)continue;const Te=y.type.split("/")[1]||"png";ze([new File([le],`pasted-${Date.now()}.${Te}`,{type:y.type})])}}}function zt(l){l.preventDefault()}function Vt(l){l.preventDefault(),l.dataTransfer?.types.includes("Files")&&(P.value++,Z.value=!0)}function pa(){P.value--,P.value<=0&&(P.value=0,Z.value=!1)}function fa(l){l.preventDefault(),P.value=0,Z.value=!1;const f=Array.from(l.dataTransfer?.files||[]);f.length&&ze(f)}r({addFiles:ze});function yt(){const l=E.value.trim();if(!(!l&&z.value.length===0)){if(Le.value&&l==="/skill"&&z.value.length===0){De();return}n.sendMessage(l,z.value.length>0?z.value:void 0),E.value="",St(""),z.value=[],se.value=!1,Y.value&&(Y.value.style.height="auto")}}async function xt(){K.clearError();const{captureId:l}=await q.beginCapture(),f=R.provider.value==="browser";te.value=f?"browser":"backend";try{if(f){await K.start({language:D()});return}await I.start()}catch{te.value=null,q.cancelCapture(l)}}async function ha(){const l=q.activeCaptureId.value;if(!l)return;if(te.value==="browser"){let y="";try{y=await K.stop()}catch{te.value=null,q.cancelCapture(l);return}te.value=null;try{await q.commitTranscript(l,y)}catch{}return}if(I.state.value.status==="requesting"){I.cancel(),te.value=null,q.cancelCapture(l);return}let f;try{f=await I.stop()}catch{te.value=null,q.cancelCapture(l);return}if(te.value=null,f.size<=0){q.cancelCapture(l);return}try{await q.transcribeAndSend(l,f)}catch{}}function qt(){te.value==="browser"?K.cancel():I.cancel(),te.value=null,q.cancelCapture()}function ma(){L.value=!0}function ga(){requestAnimationFrame(()=>{L.value=!1,be()})}function _a(l){return L.value||l.isComposing||l.keyCode===229}function ya(l){if(se.value&&Se.value.length>0){if(l.key==="ArrowDown"){l.preventDefault(),ve.value=(ve.value+1)%Se.value.length,qe();return}if(l.key==="ArrowUp"){l.preventDefault(),ve.value=(ve.value-1+Se.value.length)%Se.value.length,qe();return}if(l.key==="Enter"||l.key==="Tab"){l.preventDefault(),Pe(Se.value[ve.value]);return}if(l.key==="Escape"){l.preventDefault(),se.value=!1;return}}l.key!=="Enter"||l.shiftKey||_a(l)||(l.preventDefault(),yt())}function wa(l){const f=l.target;L.value||be(),d.value===null&&(f.style.height="auto",f.style.height=Math.min(f.scrollHeight,100)+"px")}function ka(l){ve.value=l}function Mt(l){if(!se.value)return;const f=l.target;!f.closest(".slash-command-dropdown")&&!f.closest(".input-wrapper")&&(se.value=!1)}et(()=>{document.addEventListener("mousedown",Mt)}),La(()=>{document.removeEventListener("mousedown",Mt)});function Kt(l){const f=z.value.findIndex(y=>y.id===l);f!==-1&&(URL.revokeObjectURL(z.value[f].url),z.value.splice(f,1))}function Wt(l){return l<1024?l+" B":l<1024*1024?(l/1024).toFixed(1)+" KB":(l/(1024*1024)).toFixed(1)+" MB"}function ut(l){return l.startsWith("image/")}return(l,f)=>(i(),v("div",Fs,[t("div",Ds,[k(e(Ze),{trigger:"hover"},{trigger:S(()=>[k(e(X),{quaternary:"",size:"tiny",onClick:He,circle:""},{icon:S(()=>[...f[8]||(f[8]=[t("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[t("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"})],-1)])]),_:1})]),default:S(()=>[j(" "+c(e(m)("chat.attachFiles")),1)]),_:1}),gt.value?b("",!0):(i(),ae(e(Ui),{key:0,value:F.value,options:G.value,trigger:"click","onUpdate:value":Q},{default:S(()=>[k(e(Ze),{trigger:"hover"},{trigger:S(()=>[k(e(X),{quaternary:"",size:"tiny",circle:"",class:ne(["reasoning-effort-button",{active:!!F.value}]),"aria-label":`${e(m)("chat.reasoningEffort.tooltip")}: ${V.value}`},{icon:S(()=>[...f[9]||(f[9]=[t("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round"},[t("path",{d:"M9.5 2A2.5 2.5 0 0 1 12 4.5v15a2.5 2.5 0 0 1-4.96.44 2.5 2.5 0 0 1-2.96-3.08 3 3 0 0 1-.34-5.58 2.5 2.5 0 0 1 1.32-4.24 2.5 2.5 0 0 1 1.98-3A2.5 2.5 0 0 1 9.5 2Z"}),t("path",{d:"M14.5 2A2.5 2.5 0 0 0 12 4.5v15a2.5 2.5 0 0 0 4.96.44 2.5 2.5 0 0 0 2.96-3.08 3 3 0 0 0 .34-5.58 2.5 2.5 0 0 0-1.32-4.24 2.5 2.5 0 0 0-1.98-3A2.5 2.5 0 0 0 14.5 2Z"})],-1)])]),_:1},8,["class","aria-label"])]),default:S(()=>[j(" "+c(e(m)("chat.reasoningEffort.tooltip"))+": "+c(V.value),1)]),_:1})]),_:1},8,["value","options"])),t("div",Es,[k(e(Ze),{trigger:"hover"},{trigger:S(()=>[...f[10]||(f[10]=[t("div",{class:"switch-label"},[t("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[t("polygon",{points:"5 3 19 12 5 21 5 3"})])],-1)])]),default:S(()=>[j(" "+c(e(m)("chat.autoPlaySpeech")),1)]),_:1}),k(e(zi),{size:"small",value:ie.value,"onUpdate:value":f[0]||(f[0]=y=>ie.value=y),round:!1},null,8,["value"])]),k(e(Ze),{trigger:"hover"},{trigger:S(()=>[k(e(X),{quaternary:"",size:"tiny",class:ne(["tool-trace-toggle",{active:e(u)}]),"aria-label":e(u)?e(m)("chat.hideToolCalls"):e(m)("chat.showToolCalls"),onClick:e(B)},{default:S(()=>[...f[11]||(f[11]=[t("svg",{class:"tool-trace-icon",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[t("path",{d:"M14.7 6.3a4.5 4.5 0 0 0-5.8 5.8L3.5 17.5a2.1 2.1 0 0 0 3 3l5.4-5.4a4.5 4.5 0 0 0 5.8-5.8l-3 3-3-3 3-3z"})],-1)])]),_:1},8,["class","aria-label","onClick"])]),default:S(()=>[j(" "+c(e(u)?e(m)("chat.hideToolCalls"):e(m)("chat.showToolCalls")),1)]),_:1}),Ot.value?(i(),v("span",{key:1,class:ne(["context-info",{"context-warning":Ke.value>80}])},[j(c(Ct(rt.value))+" / ",1),k(e(Ze),{trigger:"hover"},{trigger:S(()=>[t("span",{class:"context-limit-editable",onClick:Rt},c(Ct(Ce.value)),1)]),default:S(()=>[t("span",null,c(e(m)("chat.contextClickToEdit")),1)]),_:1}),j(" · "+c(e(m)("chat.contextRemaining"))+" "+c(Ct(da.value)),1)],2)):b("",!0),Ot.value?(i(),v("div",Bs,[t("div",{class:ne(["context-bar-fill",{"context-bar-warn":Ke.value>60&&Ke.value<=80,"context-bar-danger":Ke.value>80}]),style:Et({width:`${Ke.value}%`})},null,6)])):b("",!0)]),z.value.length>0?(i(),v("div",Rs,[(i(!0),v(ue,null,ke(z.value,y=>(i(),v("div",{key:y.id,class:ne(["attachment-preview",{image:ut(y.type)}])},[ut(y.type)?(i(),v("img",{key:0,src:y.url,alt:y.name,class:"attachment-thumb"},null,8,Ns)):(i(),v("div",Os,[f[12]||(f[12]=t("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[t("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),t("polyline",{points:"14 2 14 8 20 8"})],-1)),t("span",Us,c(y.name),1),t("span",zs,c(Wt(y.size)),1)])),t("button",{class:"attachment-remove",onClick:le=>Kt(y.id)},[...f[13]||(f[13]=[t("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[t("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])],8,Vs)],2))),128))])):b("",!0),t("div",{class:ne(["input-wrapper",{"drag-over":Z.value}]),onDragover:zt,onDragenter:Vt,onDragleave:pa,onDrop:fa},[t("input",{ref_key:"fileInputRef",ref:O,type:"file",multiple:"",class:"file-input-hidden",onChange:va},null,544),t("div",{class:"resize-handle",onMousedown:x},null,32),Dt(t("textarea",{ref_key:"textareaRef",ref:Y,"onUpdate:modelValue":f[1]||(f[1]=y=>E.value=y),class:"input-textarea",style:Et(d.value?{height:d.value+"px"}:{}),placeholder:e(m)("chat.inputPlaceholder"),rows:"1",onKeydown:ya,onCompositionstart:ma,onCompositionend:ga,onInput:wa,onPaste:_t},null,44,qs),[[Qa,E.value]]),k(Ft,{name:"dropdown-fade"},{default:S(()=>[se.value&&Se.value.length>0?(i(),v("div",{key:0,ref_key:"commandDropdownRef",ref:H,class:"slash-command-dropdown"},[(i(!0),v(ue,null,ke(Se.value,(y,le)=>(i(),v("div",{key:y.key,class:ne(["slash-command-item",{active:le===ve.value}]),onMousedown:la(Te=>Pe(y),["prevent"]),onMouseenter:Te=>ka(le)},[t("span",Ws,"/"+c(y.name),1),y.args?(i(),v("span",Gs,c(y.args),1)):b("",!0),t("span",Hs,c(y.description),1)],42,Ks))),128))],512)):b("",!0)]),_:1}),t("div",js,[k(oi,{status:e(q).status.value,transcript:ee.value,error:me.value,events:e(q).events.value,"on-start":xt,"on-stop":ha,"on-cancel":qt},null,8,["status","transcript","error","events"]),e(n).isStreaming?(i(),ae(e(X),{key:0,size:"small",type:"error",disabled:e(n).isAborting,onClick:f[2]||(f[2]=y=>e(n).stopStreaming())},{default:S(()=>[j(c(e(m)("chat.stop")),1)]),_:1},8,["disabled"])):b("",!0),k(e(X),{size:"small",type:"primary",disabled:!ua.value,onClick:yt},{icon:S(()=>[...f[14]||(f[14]=[t("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[t("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),t("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})],-1)])]),default:S(()=>[j(" "+c(e(m)("chat.send")),1)]),_:1},8,["disabled"])])],34),k(e(vt),{show:T.value,"onUpdate:show":f[4]||(f[4]=y=>T.value=y),title:e(m)("skills.title"),"mask-closable":!0,preset:"card",style:{width:"min(620px, calc(100vw - 32px))"}},{default:S(()=>[T.value?(i(),v("div",Xs,[Dt(t("input",{"onUpdate:modelValue":f[3]||(f[3]=y=>W.value=y),class:"skill-picker-search",placeholder:e(m)("skills.searchPlaceholder"),type:"search"},null,8,Ys),[[Qa,W.value]]),t("div",Js,[ge.value?(i(),v("div",Qs,c(e(m)("common.loading")),1)):(i(!0),v(ue,{key:1},ke($e.value,y=>(i(),v("div",{key:y.key,role:"button",tabindex:"0",class:"skill-picker-item",onClick:le=>Ie(y),onKeydown:[na(la(le=>Ie(y),["prevent"]),["enter"]),na(la(le=>Ie(y),["prevent"]),["space"])]},[t("div",el,"/skill "+c(y.commandName),1),t("div",tl,c(y.name),1),t("div",al,c(y.description),1)],40,Zs))),128)),!ge.value&&$e.value.length===0?(i(),v("div",sl,c(W.value?e(m)("skills.noMatch"):e(m)("skills.noSkills")),1)):b("",!0)])])):b("",!0)]),_:1},8,["show","title"]),k(e(vt),{show:Ue.value,"onUpdate:show":f[7]||(f[7]=y=>Ue.value=y),title:e(m)("chat.contextEditTitle"),"mask-closable":!0,preset:"card",style:{width:"400px"}},{footer:S(()=>[t("div",il,[k(e(X),{onClick:f[6]||(f[6]=y=>Ue.value=!1),disabled:mt.value},{default:S(()=>[j(c(e(m)("chat.contextEditCancel")),1)]),_:1},8,["disabled"]),k(e(X),{type:"primary",onClick:ca,loading:mt.value},{default:S(()=>[j(c(e(m)("chat.contextEditSave")),1)]),_:1},8,["loading"])])]),default:S(()=>[t("div",ll,[t("p",nl,c(e(m)("chat.contextEditDesc")),1),k(e(Fi),{value:we.value,"onUpdate:value":f[5]||(f[5]=y=>we.value=y),min:1e3,max:1e7,step:1e3,"show-button":!1,placeholder:e(m)("chat.contextEditPlaceholder"),style:{width:"100%"}},{suffix:S(()=>[...f[15]||(f[15]=[t("span",{style:{color:"#999"}},"tokens",-1)])]),_:1},8,["value","placeholder"]),t("div",ol,c(e(m)("chat.contextEditHint")),1)])]),_:1},8,["show","title"])]))}})})),du=J((()=>{})),ci,vu=J((()=>{ul(),ul(),du(),lt(),ci=nt(ui,[["__scopeId","data-v-cb0e4e3c"]])}));async function pu(A={}){const r=new URLSearchParams;return A.humanOnly===!1&&r.set("humanOnly","false"),A.source&&r.set("source",A.source),A.limit!=null&&r.set("limit",String(A.limit)),(await pt(`/api/hermes/sessions/conversations${r.toString()?`?${r.toString()}`:""}`)).sessions}async function fu(A,r={}){const n=new URLSearchParams;r.humanOnly===!1&&n.set("humanOnly","false"),r.source&&n.set("source",r.source);const C=n.toString()?`?${n.toString()}`:"";return pt(`/api/hermes/sessions/conversations/${encodeURIComponent(A)}/messages${C}`)}var hu=J((()=>{ra()})),cl,dl,vl,pl,fl,hl,ml,gl,_l,yl,wl,kl,Sl,bl,Cl,xl,Ml,$l,Pl,Il,Tl,Ll,di,Al=J((()=>{Ve(),hu(),_r(),Ea(),at(),cl={class:"conversation-monitor"},dl={class:"conversation-monitor__sidebar"},vl={key:0,class:"conversation-monitor__empty"},pl={key:1,class:"conversation-monitor__empty"},fl=["aria-pressed","onClick"],hl={class:"conversation-monitor__session-title-row"},ml={class:"conversation-monitor__session-title"},gl={key:0,class:"conversation-monitor__session-live"},_l={class:"conversation-monitor__session-meta"},yl={key:0,class:"conversation-monitor__session-preview"},wl={class:"conversation-monitor__detail"},kl={key:0,class:"conversation-monitor__detail-header"},Sl={class:"conversation-monitor__detail-title"},bl={class:"conversation-monitor__detail-meta"},Cl=["title"],xl={key:1,class:"conversation-monitor__empty conversation-monitor__empty--error"},Ml={key:2,class:"conversation-monitor__empty"},$l={key:3,class:"conversation-monitor__empty"},Pl={key:4,class:"conversation-monitor__messages"},Il={class:"conversation-monitor__message-meta"},Tl={class:"conversation-monitor__message-content"},Ll=15e3,di=tt({__name:"ConversationMonitorPane",props:{humanOnly:{type:Boolean}},setup(A){const r=A,{t:n}=st(),C=Fa(),_=h([]),m=h(null),g=h(null),u=h(!1),B=h(!1),G=h("");let F=null,V=0,Q=0;const E=w(()=>_.value.find(L=>L.id===m.value)||null),Y=w(()=>E.value?.model?C.displayModelName(E.value.model,E.value.provider):"");function H(L){return n(L==="user"?"chat.monitorRoleUser":"chat.monitorRoleAssistant")}function O(L){return n("chat.linkedSessions",{count:L})}function z(){V+=1,Q+=1}async function Z(L=!1){const M=++V;L||(u.value=!0,G.value="");try{const I=await pu({humanOnly:r.humanOnly});if(M!==V)return;if(_.value=I,!I.length){m.value=null,g.value=null;return}(!m.value||!I.some(R=>R.id===m.value))&&(m.value=I[0].id)}catch(I){if(M!==V||L)return;G.value=I?.message||String(I),_.value=[],m.value=null,g.value=null}finally{!L&&M===V&&(u.value=!1)}}async function P(L,M=!1){const I=++Q;if(!L){g.value=null;return}const R=r.humanOnly;M||(B.value=!0,G.value="");try{const K=await fu(L,{humanOnly:R});if(I!==Q||L!==m.value||R!==r.humanOnly)return;g.value=K}catch(K){if(I!==Q||M)return;G.value=K?.message||String(K),g.value=null}finally{!M&&I===Q&&(B.value=!1)}}return ce(m,async L=>{await P(L,!1)}),ce(()=>r.humanOnly,async()=>{z(),m.value=null,g.value=null,await Z(!1)}),et(async()=>{await Z(!1),F=setInterval(async()=>{await Z(!0),m.value&&await P(m.value,!0)},Ll)}),La(()=>{z(),F&&clearInterval(F)}),(L,M)=>(i(),v("div",cl,[t("aside",dl,[u.value&&_.value.length===0?(i(),v("div",vl,c(e(n)("common.loading")),1)):_.value.length===0?(i(),v("div",pl,c(e(n)("chat.noSessions")),1)):b("",!0),(i(!0),v(ue,null,ke(_.value,I=>(i(),v("button",{key:I.id,class:ne(["conversation-monitor__session",{active:I.id===m.value}]),"aria-pressed":I.id===m.value,onClick:R=>m.value=I.id},[t("div",hl,[t("span",ml,c(I.title||I.preview||I.id),1),I.is_active?(i(),v("span",gl,c(e(n)("chat.recentBadge")),1)):b("",!0)]),t("div",_l,c(e(as)(I.source))+" · "+c(e(ts)(I.last_active)),1),I.preview?(i(),v("div",yl,c(I.preview),1)):b("",!0)],10,fl))),128))]),t("section",wl,[E.value?(i(),v("header",kl,[t("div",Sl,c(E.value.title||E.value.preview||E.value.id),1),t("div",bl,[t("span",null,c(e(as)(E.value.source)),1),M[0]||(M[0]=t("span",null,"·",-1)),t("span",{title:E.value.model},c(Y.value),9,Cl),M[1]||(M[1]=t("span",null,"·",-1)),t("span",null,c(O(E.value.thread_session_count)),1)])])):b("",!0),G.value?(i(),v("div",xl,c(G.value),1)):B.value&&!g.value?(i(),v("div",Ml,c(e(n)("common.loading")),1)):!g.value||g.value.messages.length===0?(i(),v("div",$l,c(e(n)("chat.noVisibleMessages")),1)):(i(),v("div",Pl,[(i(!0),v(ue,null,ke(g.value.messages,I=>(i(),v("article",{key:`${I.session_id}-${I.id}`,class:ne(["conversation-monitor__message",`role-${I.role}`])},[t("div",Il,c(H(I.role))+" · "+c(e(ts)(I.timestamp)),1),t("div",Tl,c(I.content),1)],2))),128))]))])]))}})})),mu=J((()=>{})),vi,gu=J((()=>{Al(),Al(),mu(),lt(),vi=nt(di,[["__scopeId","data-v-71fcd8c4"]])})),pi,_u=J((()=>{pi="/assets/gif/thinking-DoVDAdxi.gif"})),Fl,Dl,El,Bl,Rl,Nl,Ol,Ul,zl,Vl,ql,Kl,Wl,Gl,Hl,jl,Xl,Yl,Jl,Ql,Zl,en,tn,an,sn,ln,nn,on,rn,un,cn,dn,vn,pn,fn,hn,mn,gn,_n,yn,wn,kn,Sn,bn,Cn,xn,Mn,$n,Pn,In,Tn,Ln,An,Fn,Ma,fi,Dn=J((()=>{Ve(),at(),Bt(),or(),wr(),Ba(),_u(),ei(),Fl={class:"message-list-shell"},Dl={class:"empty-state"},El=["src","alt"],Bl={key:0,class:"history-archive-link-wrap"},Rl=["href"],Nl={key:1,class:"history-loader"},Ol={key:0,class:"history-loader-spinner"},Ul={key:0,class:"fork-divider",role:"separator"},zl={class:"fork-divider-pill"},Vl={class:"fork-divider-text"},ql=["href"],Kl={key:0,class:"streaming-indicator"},Wl={class:"thinking-status"},Gl=["src"],Hl={class:"thinking-status-copy"},jl={class:"thinking-status-label"},Xl={class:"thinking-status-time"},Yl={key:0,class:"tool-calls-panel"},Jl={key:0,class:"tool-call-item compression-item"},Ql={key:0,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"tool-call-icon"},Zl={key:1,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"tool-call-icon"},en={class:"tool-call-name"},tn={key:2,class:"tool-call-spinner"},an={key:1,class:"tool-call-item compression-item"},sn={key:0,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"tool-call-icon"},ln={key:1,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"tool-call-icon"},nn={class:"tool-call-name"},on={key:2,class:"tool-call-spinner"},rn={class:"tool-call-name"},un=["title"],cn=["title"],dn={key:2,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"tool-call-success-icon"},vn={key:3,class:"tool-call-spinner"},pn={key:4,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"tool-call-error-icon"},fn=["aria-label","title"],hn={key:1,class:"message-float-stack"},mn={key:0,class:"approval-float-panel"},gn={class:"float-panel-header"},_n={class:"approval-float-title"},yn={class:"approval-float-desc"},wn={class:"approval-float-command"},kn={class:"approval-float-actions"},Sn={key:0,class:"approval-float-panel"},bn={class:"float-panel-header"},Cn={class:"approval-float-title"},xn={class:"approval-float-desc"},Mn={key:0,class:"approval-float-actions"},$n={key:1,class:"clarify-float-input-row"},Pn={key:0,class:"queue-float-panel"},In={class:"queue-float-header"},Tn={class:"queue-float-list"},Ln={class:"queue-index"},An={class:"queue-text"},Fn=["title","onClick"],Ma=new Map,fi=tt({__name:"MessageList",setup(A,{expose:r}){const n=Da(),{t:C}=st(),{toolTraceVisible:_}=ti(),m=h(null),g=h(null),u=h(!1),B=h(0),G={frames:8,keepAliveMs:1200};let F=0,V=null;function Q(p){return p>=1e6?(p/1e6).toFixed(1)+"M":p>=1e3?(p/1e3).toFixed(1)+"K":String(p)}function E(p){return p<1?`${Math.round(p*1e3)}ms`:p<60?`${Math.round(p*10)/10}s`:`${Math.floor(p/60)}m ${Math.round(p%60)}s`}function Y(p){const d=String(p||"");return d.length>160?`${d.slice(0,157)}...`:d}function H(p){const d=Math.floor(p/1e3),x=Math.floor(d/3600),ie=Math.floor(d%3600/60),ye=d%60;return x>0?`${x}h${ie}m${ye}s`:ie>0?`${ie}m${ye}s`:`${ye}s`}function O(){V&&(clearInterval(V),V=null)}const z=w(()=>n.isRunActive||!!n.abortState),Z=w(()=>H(B.value)),P=w(()=>{const p=n.messages;let d=-1;for(let x=p.length-1;x>=0;x--)if(p[x].role==="user"){d=x;break}return[...p.filter((x,ie)=>x.role==="tool"&&ie>d)].reverse()}),L=w(()=>P.value.filter(p=>!!p.toolName)),M=w(()=>{const p=n.activeSession,d=p?.codingAgentId||(p?.agent==="codex"?"codex":p?.agent==="claude"?"claude-code":void 0);return d==="codex"?{logo:"/coding-agents/codex-openai.png",alt:"Codex",text:C("chat.emptyStateAgent",{agent:"Codex"})}:d==="claude-code"?{logo:"/coding-agents/claude-code.svg",alt:"Claude Code",text:C("chat.emptyStateAgent",{agent:"Claude Code"})}:{logo:"/coding-agents/hermes.png",alt:"Hermes",text:C("chat.emptyState")}}),I=w(()=>{const p=new Set(P.value.map(d=>d.id));return n.messages.filter(d=>d.role==="tool"?_.value&&!!d.toolName&&!(n.isRunActive&&p.has(d.id)):!(d.role==="assistant"&&d.isStreaming&&!d.content?.trim()&&d.reasoning?.trim()&&P.value.length===0))});function R(p){return`fork-divider-${p}`}const K=w(()=>{const p=I.value,d=se.value,x=n.activeSession;if(!d||!x?.forkPointMessageId)return p;const ie=String(x.forkPointMessageId),ye=p.findIndex(ht=>String(ht.id)===ie);if(ye<0)return p;const ft={id:R(x.id),role:"system",content:"",timestamp:x.updatedAt||Date.now(),systemType:"fork-divider"};return[...p.slice(0,ye+1),ft,...p.slice(ye+1)]}),te=w(()=>{const p=n.activeSession,d=I.value.some(x=>x.role==="user"||x.role==="assistant");return!!p&&p.source!=="coding_agent"&&!n.isStreaming&&!n.isForkPending&&d}),oe=w(()=>{const p=K.value;for(let d=p.length-1;d>=0;d--){const x=p[d];if(x.role==="user"||x.role==="assistant")return x.id}return null}),he=w(()=>{const p=n.activeSessionId;return p?n.queuedUserMessages.get(p)||[]:[]}),D=w(()=>n.activePendingApproval),U=w(()=>n.activePendingClarify),q=h(""),ee=w(()=>!!D.value||!!U.value),pe=w(()=>he.value.length>0&&ee.value?"20px 20px 380px":he.value.length>0||ee.value?"20px 20px 260px":"20px"),me=w(()=>{const p=n.activeSession;return!!p?.hasMoreBefore&&(p.loadedMessageCount||0)>=300}),xe=w(()=>{const p=n.activeSession;if(!p?.id)return"#/hermes/history";const d=p.profile?`?profile=${encodeURIComponent(p.profile)}`:"";return`#/hermes/history/session/${encodeURIComponent(p.id)}${d}`}),se=w(()=>{const p=n.activeSession;return p?.parentSessionId?{parentSessionId:p.parentSessionId,parentTitle:p.parentTitle||p.parentSessionId,parentHref:`#/hermes/history/session/${encodeURIComponent(p.parentSessionId)}${p.profile?`?profile=${encodeURIComponent(p.profile)}`:""}`,canSwitchParent:n.sessions.some(d=>d.id===p.parentSessionId),lastRole:p.parentLastMessageRole||"",lastMessage:p.parentLastMessage||""}:null});async function Oe(p){const d=se.value;if(d?.parentSessionId){if(d.canSwitchParent){p?.preventDefault(),await n.switchSession(d.parentSessionId);return}window.location.hash=d.parentHref.replace(/^#/,"")}}function ve(p){n.respondApproval(p)}function $(p){const d=p!==void 0?p:q.value.trim();n.respondToClarify(d),q.value=""}function T(p){const d=n.activeSessionId;d&&n.removeQueuedMessage(d,p)}function W(p){const d=p.replace(/\s+/g," ").trim();return d.length>48?`${d.slice(0,48)}...`:d}function ge(p=100){return m.value?.shouldAutoFollowBottom(p)??!0}function de(p){m.value?.scrollToBottom(p),u.value=!1}function _e(p){m.value?.scrollToMessage(p)}function Le(p,d){m.value?.scrollToAnchor(p,d)}function fe(){u.value=I.value.length>0&&!(m.value?.isNearBottom(1e3)??!0)}function ot(){fe()}function Se(){de({frames:4,keepAliveMs:600})}function $e(p){if(!p)return;const d=m.value?.captureViewportPosition()??null;d&&Ma.set(p,d)}function Fe(p){if(n.activeSessionId!==p)return;if(n.focusMessageId){g.value=null,_e(n.focusMessageId);return}const d=Ma.get(p);if(d){g.value=null,d.wasNearBottom?de(G):m.value?.restoreViewportPosition(d);return}const x=n.activeSession;if(x?.parentSessionId&&x.forkPointMessageId){const ie=R(x.id);if(K.value.some(ye=>ye.id===ie)){g.value=null,_e(ie);return}if(n.isLoadingMessages||n.messages.length===0)return}de(G),n.messages.length>0&&!n.isLoadingMessages&&(g.value=null)}async function Ge(){const p=n.activeSession;if(!p?.hasMoreBefore||p.isLoadingOlderMessages||me.value)return;const d=m.value?.captureScrollPosition()??null;await n.loadOlderMessages(p.id)&&(await Me(),m.value?.restoreScrollPosition(d),fe())}return ce(()=>n.activeSessionId,async(p,d)=>{$e(d),p&&(g.value=p,await Me(),Fe(p))},{immediate:!0}),ce(()=>[n.activeSessionId,n.messages.length],([p,d])=>{!p||g.value!==p||d===0||(Fe(p),Me(fe))},{flush:"post"}),ce(()=>I.value.length,()=>{Me(fe)},{flush:"post"}),ce(()=>n.isLoadingMessages,async(p,d)=>{if(p||!d)return;const x=n.activeSessionId;if(!(!x||g.value!==x)){if(n.focusMessageId){g.value=null;return}await Me(),n.activeSessionId===x&&Fe(x)}},{flush:"post"}),ce(()=>n.focusMessageId,p=>{p&&_e(p)}),ce(()=>n.isRunActive,p=>{p&&de({frames:3,keepAliveMs:400})}),ce(z,p=>{if(O(),!p){F=0,B.value=0;return}F=Date.now(),B.value=0,V=setInterval(()=>{B.value=Date.now()-F},1e3)},{immediate:!0}),ce(()=>n.messages[n.messages.length-1]?.content,()=>{if(g.value!==n.activeSessionId){if(n.focusMessageId){_e(n.focusMessageId);return}ge()&&de({frames:1,keepAliveMs:0})}}),ce(P,()=>{if(g.value!==n.activeSessionId){if(n.focusMessageId){_e(n.focusMessageId);return}ge()&&de({frames:1,keepAliveMs:0})}}),ce(()=>he.value.length,async(p,d)=>{if(g.value===n.activeSessionId||n.focusMessageId||p<=d)return;const x=ge(320);await Me(),!(!x&&!n.isRunActive)&&de({frames:4,keepAliveMs:600})}),Ai(()=>{O(),$e(n.activeSessionId)}),et(()=>{Me(fe)}),r({scrollToBottom:de,scrollToMessage:_e,scrollToAnchor:Le}),(p,d)=>(i(),v("div",Fl,[(i(),ae(ir,{key:e(n).activeSessionId||"chat-empty",ref_key:"listRef",ref:m,messages:K.value,virtualized:!1,padding:pe.value,onScroll:ot,onTopReach:Ge},{empty:S(()=>[t("div",Dl,[t("img",{src:M.value.logo,alt:M.value.alt,class:"empty-logo"},null,8,El),t("p",null,c(M.value.text),1)])]),before:S(()=>[me.value?(i(),v("div",Bl,[t("a",{class:"history-archive-link",href:xe.value},c(e(C)("chat.viewOlderInHistory")),9,Rl)])):e(n).activeSession?.hasMoreBefore||e(n).activeSession?.isLoadingOlderMessages?(i(),v("div",Nl,[e(n).activeSession?.isLoadingOlderMessages?(i(),v("span",Ol)):b("",!0)])):b("",!0)]),item:S(({message:x})=>[x.systemType==="fork-divider"&&se.value?(i(),v("div",Ul,[d[9]||(d[9]=t("div",{class:"fork-divider-line","aria-hidden":"true"},null,-1)),t("div",zl,[d[8]||(d[8]=t("span",{class:"fork-divider-icon","aria-hidden":"true"},[t("svg",{viewBox:"0 0 24 24",focusable:"false"},[t("path",{d:"M6 3v6a4 4 0 0 0 4 4h4.2"}),t("path",{d:"M18 9l4 4-4 4"}),t("path",{d:"M6 21V3"}),t("circle",{cx:"6",cy:"5",r:"2"}),t("circle",{cx:"6",cy:"19",r:"2"})])],-1)),t("span",Vl,c(e(C)("chat.forkedFrom")),1),t("a",{class:"fork-divider-link",href:se.value.parentHref,onClick:Oe},c(se.value.parentTitle),9,ql)]),d[10]||(d[10]=t("div",{class:"fork-divider-line","aria-hidden":"true"},null,-1))])):(i(),ae(kr,{key:1,message:x,highlight:e(n).focusMessageId===x.id,"show-fork-action":te.value&&x.id===oe.value},null,8,["message","highlight","show-fork-action"]))]),after:S(()=>[k(Ft,{name:"fade"},{default:S(()=>[z.value?(i(),v("div",Kl,[t("div",Wl,[t("img",{src:e(pi),alt:"","aria-hidden":"true",class:"thinking-avatar"},null,8,Gl),t("div",Hl,[t("span",jl,c(e(C)("chat.thinkingInProgress")),1),t("span",Xl,c(Z.value),1)])]),L.value.length>0||e(n).compressionState||e(n).abortState?(i(),v("div",Yl,[e(n).abortState?(i(),v("div",Jl,[e(n).abortState.aborting?(i(),v("svg",Ql,[...d[11]||(d[11]=[t("path",{d:"M10 9v6m4-6v6M5 5h14v14H5z"},null,-1)])])):(i(),v("svg",Zl,[...d[12]||(d[12]=[t("path",{d:"M5 13l4 4L19 7"},null,-1)])])),t("span",en,c(e(n).abortState.aborting?e(n).abortState.timedOut?e(n).abortState.message||"Still stopping... new messages will be queued":"Pausing... waiting for the run to stop and sync":e(n).abortState.synced?"Paused and synced":"Paused"),1),e(n).abortState.aborting?(i(),v("span",tn)):b("",!0)])):b("",!0),e(n).compressionState?(i(),v("div",an,[e(n).compressionState.compressing?(i(),v("svg",sn,[...d[13]||(d[13]=[t("path",{d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"},null,-1)])])):e(n).compressionState.compressed?(i(),v("svg",ln,[...d[14]||(d[14]=[t("path",{d:"M5 13l4 4L19 7"},null,-1)])])):b("",!0),t("span",nn,c(e(n).compressionState.compressing?`Compressing... (${e(n).compressionState.messageCount} msgs, ~${Q(e(n).compressionState.beforeTokens)} tokens)`:e(n).compressionState.compressed?`Compressed ${e(n).compressionState.messageCount} msgs: ~${Q(e(n).compressionState.beforeTokens)} → ~${Q(e(n).compressionState.afterTokens)} tokens`:"Compression skipped"),1),e(n).compressionState.compressing?(i(),v("span",on)):b("",!0)])):b("",!0),(i(!0),v(ue,null,ke(L.value,x=>(i(),v("div",{key:x.id,class:"tool-call-item"},[d[17]||(d[17]=t("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"tool-call-icon"},[t("path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"})],-1)),t("span",rn,c(x.toolName),1),x.toolPreview?(i(),v("span",{key:0,class:"tool-call-preview",title:x.toolPreview},c(Y(x.toolPreview)),9,un)):b("",!0),x.toolDuration&&x.toolStatus!=="running"?(i(),v("span",{key:1,class:"tool-call-duration",title:p.$t("chat.executionDuration")},c(E(x.toolDuration)),9,cn)):b("",!0),x.toolStatus==="done"?(i(),v("svg",dn,[...d[15]||(d[15]=[t("circle",{cx:"12",cy:"12",r:"10",fill:"currentColor","fill-opacity":"0.15"},null,-1),t("path",{d:"M8 12L11 15L16 9",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,-1)])])):b("",!0),x.toolStatus==="running"?(i(),v("span",vn)):b("",!0),x.toolStatus==="error"?(i(),v("svg",pn,[...d[16]||(d[16]=[t("circle",{cx:"12",cy:"12",r:"10",fill:"currentColor","fill-opacity":"0.15"},null,-1),t("path",{d:"M15 9L9 15M9 9L15 15",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,-1)])])):b("",!0)]))),128))])):b("",!0)])):b("",!0)]),_:1})]),_:1},8,["messages","padding"])),u.value?(i(),v("button",{key:0,type:"button",class:"scroll-bottom-button","aria-label":e(C)("chat.scrollToBottom"),title:e(C)("chat.scrollToBottom"),onClick:Se},[...d[18]||(d[18]=[t("svg",{class:"scroll-bottom-icon",viewBox:"0 0 24 24","aria-hidden":"true",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[t("path",{d:"m7 10 5 5 5-5"}),t("path",{d:"M6 19h12"})],-1)])],8,fn)):b("",!0),D.value||U.value||he.value.length>0?(i(),v("div",hn,[k(Ft,{name:"queue-float"},{default:S(()=>[D.value?(i(),v("div",mn,[t("div",gn,[d[19]||(d[19]=t("span",{class:"approval-float-icon","aria-hidden":"true"},[t("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[t("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10"}),t("path",{d:"m9 12 2 2 4-4"})])],-1)),t("span",null,c(e(C)("chat.approvalKicker")),1)]),t("div",_n,c(e(C)("chat.approvalTitle")),1),t("div",yn,c(D.value.description),1),t("code",wn,c(D.value.command),1),t("div",kn,[D.value.isMemoryWrite?(i(),ae(e(X),{key:0,size:"small",type:"primary",onClick:d[0]||(d[0]=x=>ve("once"))},{default:S(()=>[j(c(e(C)("chat.approvalAgree")),1)]),_:1})):b("",!0),!D.value.isMemoryWrite&&D.value.choices.includes("once")?(i(),ae(e(X),{key:1,size:"small",type:"primary",onClick:d[1]||(d[1]=x=>ve("once"))},{default:S(()=>[j(c(e(C)("chat.approvalAllowOnce")),1)]),_:1})):b("",!0),!D.value.isMemoryWrite&&D.value.choices.includes("session")?(i(),ae(e(X),{key:2,size:"small",secondary:"",onClick:d[2]||(d[2]=x=>ve("session"))},{default:S(()=>[j(c(e(C)("chat.approvalAllowSession")),1)]),_:1})):b("",!0),!D.value.isMemoryWrite&&D.value.choices.includes("always")?(i(),ae(e(X),{key:3,size:"small",secondary:"",onClick:d[3]||(d[3]=x=>ve("always"))},{default:S(()=>[j(c(e(C)("chat.approvalAlways")),1)]),_:1})):b("",!0),D.value.isMemoryWrite||D.value.choices.includes("deny")?(i(),ae(e(X),{key:4,size:"small",type:"error",secondary:"",onClick:d[4]||(d[4]=x=>ve("deny"))},{default:S(()=>[j(c(e(C)("chat.approvalDeny")),1)]),_:1})):b("",!0)])])):b("",!0)]),_:1}),k(Ft,{name:"queue-float"},{default:S(()=>[!D.value&&U.value?(i(),v("div",Sn,[t("div",bn,[d[20]||(d[20]=t("span",{class:"approval-float-icon","aria-hidden":"true"},[t("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[t("circle",{cx:"12",cy:"12",r:"10"}),t("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}),t("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})])],-1)),t("span",null,c(e(C)("chat.clarifyKicker")),1)]),t("div",Cn,c(e(C)("chat.clarifyTitle")),1),t("div",xn,c(U.value.question),1),U.value.choices&&U.value.choices.length?(i(),v("div",Mn,[(i(!0),v(ue,null,ke(U.value.choices,x=>(i(),ae(e(X),{key:x,size:"small",type:"primary",onClick:ie=>$(x)},{default:S(()=>[j(c(x),1)]),_:2},1032,["onClick"]))),128)),k(e(X),{size:"small",type:"error",secondary:"",onClick:d[5]||(d[5]=x=>$(""))},{default:S(()=>[j(c(e(C)("chat.clarifyDismiss")),1)]),_:1})])):(i(),v("div",$n,[k(e(Qe),{value:q.value,"onUpdate:value":d[6]||(d[6]=x=>q.value=x),size:"small",placeholder:e(C)("chat.clarifyPlaceholder")},null,8,["value","placeholder"]),k(e(X),{size:"small",type:"primary",onClick:d[7]||(d[7]=x=>$())},{default:S(()=>[j(c(e(C)("chat.clarifySubmit")),1)]),_:1})]))])):b("",!0)]),_:1}),k(Ft,{name:"queue-float"},{default:S(()=>[he.value.length>0?(i(),v("div",Pn,[t("div",In,[d[21]||(d[21]=t("span",{class:"queue-orbit","aria-hidden":"true"},[t("span")],-1)),t("span",null,c(e(C)("chat.messageQueue")),1),t("strong",null,c(he.value.length),1)]),t("div",Tn,[(i(!0),v(ue,null,ke(he.value,(x,ie)=>(i(),v("div",{key:x.id,class:"queue-float-item"},[t("span",Ln,c(ie+1),1),t("span",An,c(W(x.content)),1),t("button",{type:"button",class:"queue-remove",title:e(C)("chat.removeQueuedMessage"),onClick:ye=>T(x.id)},[...d[22]||(d[22]=[t("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[t("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])],8,Fn)]))),128))])])):b("",!0)]),_:1})])):b("",!0)]))}})})),yu=J((()=>{})),hi,wu=J((()=>{Dn(),Dn(),yu(),lt(),hi=nt(fi,[["__scopeId","data-v-29cd8f3e"]])})),En,Bn,Rn,Nn,mi,On=J((()=>{Ve(),zr(),at(),Bt(),Ur(),Pr(),Ar(),$r(),Or(),xr(),Dr(),Tr(),Fr(),En={class:"files-panel-drawer"},Bn={class:"files-main-panel"},Rn={class:"main-toolbar"},Nn={class:"files-content"},mi=tt({__name:"FilesPanel",setup(A){const r=Cr(),{t:n}=st(),C=h(null),_=h(!1),m=h(!1),g=h("newFile"),u=h(null),B=h(null),G=h(!1);function F(H,O){C.value?.show(H,O)}function V(){g.value="newFile",u.value=null,B.value=null,m.value=!0}function Q(){g.value="newFolder",u.value=null,B.value=null,m.value=!0}function E(H){g.value="newFolder",u.value=null,B.value=H.isDir?H.path:r.currentPath,m.value=!0}function Y(H){g.value="rename",u.value=H,B.value=null,m.value=!0}return et(()=>{r.fetchEntries("")}),(H,O)=>(i(),v("div",En,[G.value?(i(),v("div",{key:0,class:"sidebar-overlay",onClick:O[0]||(O[0]=z=>G.value=!1)})):b("",!0),t("div",{class:ne(["files-tree-panel",{"mobile-visible":G.value}])},[k(Sr)],2),t("div",Bn,[t("div",Rn,[k(e(X),{size:"small",onClick:O[1]||(O[1]=z=>G.value=!G.value),class:"sidebar-toggle"},{icon:S(()=>[...O[5]||(O[5]=[t("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[t("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),t("line",{x1:"9",y1:"3",x2:"9",y2:"21"})],-1)])]),default:S(()=>[j(" "+c(e(n)("files.fileTree")),1)]),_:1}),k(Er,{onShowNewFile:V,onShowNewFolder:Q,onShowUpload:O[2]||(O[2]=z=>_.value=!0)})]),k(Ir),t("div",Nn,[e(r).editingFile?(i(),ae(Rr,{key:0})):e(r).previewFile?(i(),ae(br,{key:1})):(i(),ae(Mr,{key:2,onContextmenuEntry:F}))])]),k(Lr,{ref_key:"contextMenuRef",ref:C,onRename:Y,onNewFolder:E},null,512),k(Br,{show:_.value,"onUpdate:show":O[3]||(O[3]=z=>_.value=z)},null,8,["show"]),k(Nr,{show:m.value,"onUpdate:show":O[4]||(O[4]=z=>m.value=z),mode:g.value,entry:u.value,"target-path":B.value},null,8,["show","mode","entry","target-path"])]))}})})),ku=J((()=>{})),gi,Su=J((()=>{On(),On(),ku(),lt(),gi=nt(mi,[["__scopeId","data-v-527e892e"]])})),Un,zn,Vn,qn,Kn,Wn,Gn,Hn,jn,Xn,Yn,Jn,Qn,Zn,eo,to,ao,so,lo,no,oo,io,ro,uo,co,vo,po,fo,ho,mo,go,_o,yo,wo,ko,So,bo,Co,xo,Mo,$o,Po,Io,To,Lo,Ao,Fo,Do,Eo,Bo,Ro,No,Oo,Uo,zo,Vo,qo,Ko,Wo,Go,Ho,$a,Pa,_i,jo=J((()=>{Ve(),Jo(),Qi(),Ba(),Ea(),Qo(),sr(),Bt(),Ki(),at(),Zo(),Xr(),vu(),gu(),wu(),mr(),gr(),Su(),Vr(),Kr(),Wr(),ra(),Un={class:"chat-panel"},zn={key:0,class:"page-sidebar-top"},Vn={class:"session-list-toolbar"},qn={class:"session-list-actions"},Kn={key:1,class:"session-items"},Wn={key:0,class:"session-loading"},Gn={key:1,class:"session-empty"},Hn={class:"session-group-header session-group-header--static"},jn={class:"session-group-label"},Xn={class:"session-group-count"},Yn={key:2,class:"page-sidebar-bottom"},Jn={class:"session-model-list"},Qn=["onClick"],Zn={class:"session-model-group-label"},eo={class:"session-model-group-count"},to={class:"session-model-group-items"},ao=["title","onClick"],so={class:"session-model-item-label"},lo={class:"session-model-item-name"},no={key:0,class:"session-model-item-id"},oo={key:0,class:"session-model-badge-preview"},io={key:1,class:"session-model-badge-disabled"},ro={key:2,class:"session-model-badge-custom"},uo={key:3,class:"session-model-check",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},co={key:0,class:"session-model-empty"},vo={class:"session-model-custom"},po={class:"session-model-custom-row"},fo={class:"session-model-custom-hint"},ho={class:"new-chat-form"},mo={class:"new-chat-field"},go={class:"new-chat-label"},_o={key:0,class:"new-chat-field"},yo={class:"new-chat-label"},wo={class:"new-chat-field"},ko={class:"new-chat-label"},So={key:1,class:"new-chat-field"},bo={class:"new-chat-label"},Co={key:2,class:"new-chat-field"},xo={class:"new-chat-label"},Mo={key:3,class:"new-chat-field"},$o={class:"new-chat-label"},Po={key:4,class:"new-chat-field"},Io={class:"new-chat-label"},To={key:5,class:"new-chat-field"},Lo={class:"new-chat-label"},Ao={class:"new-chat-field"},Fo={class:"new-chat-label"},Do={class:"new-chat-actions"},Eo={class:"chat-main"},Bo={class:"chat-header"},Ro={class:"header-left"},No={class:"header-session-title"},Oo=["title"],Uo={class:"header-actions"},zo={class:"chat-main-content"},Vo={class:"chat-tool-panel-inner"},qo={class:"chat-tool-tabs",role:"tablist"},Ko=["aria-selected"],Wo=["aria-selected"],Go={class:"chat-tool-content"},Ho=360,$a=560,Pa="hermes.chat.toolPanelWidth",_i=tt({__name:"ChatPanel",setup(A){const r=Da(),n=Fa(),C=Yo(),_=ar(),m=Wi(),g=Aa(),{t:u}=st(),B=w(()=>Gi()),G=h(!1),F=h(null),V=h(null),Q=h(null),E=h(0),Y=h(!1),H=h(!1),O=h("files"),z=h(ee()),Z=h(null),P=h("chat"),L=h(!1),M=h(new Set),I=h(!1),R=h(!1),K=h(typeof window>"u"||!window.matchMedia("(max-width: 768px)").matches);let te=null;const oe=h(!1),he=w(()=>({width:oe.value?"100%":`${z.value}px`}));function D(a){return m.resolve({name:r.runtimeMode==="global_agent"?"hermes.globalAgentSession":"hermes.session",params:{sessionId:a}}).href}function U(a){typeof window>"u"||window.open(D(a),"_blank","noopener,noreferrer")}function q(a){F.value?.scrollToAnchor(a.messageId,a.anchorId),oe.value&&(G.value=!1)}function ee(){if(typeof window>"u")return $a;const a=Number.parseInt(window.localStorage.getItem(Pa)||"",10);return Number.isFinite(a)?Math.round(a):$a}function pe(){if(typeof window>"u")return 1180;if(oe.value)return window.innerWidth;const a=Q.value?.clientWidth||window.innerWidth;return Math.max(320,Math.min(Math.floor(a*.88),a-120))}function me(a){const s=pe();return Math.min(s,Math.max(Math.min(Ho,s),Math.round(a)))}function xe(){oe.value||(z.value=me(z.value))}function se(a){const s=Z.value;if(!s)return;const o=s.x-a.clientX;z.value=me(s.width+o)}function Oe(){Z.value&&(Z.value=null,window.removeEventListener("pointermove",se),window.removeEventListener("pointerup",Oe),oe.value||window.localStorage.setItem(Pa,String(z.value)),document.body.style.userSelect="",document.body.style.cursor="")}function ve(a){oe.value||(a.preventDefault(),Z.value={x:a.clientX,width:z.value},window.addEventListener("pointermove",se),window.addEventListener("pointerup",Oe),document.body.style.userSelect="none",document.body.style.cursor="col-resize")}function $(a){return Array.from(a.dataTransfer?.types||[]).includes("Files")}function T(){E.value=0,Y.value=!1}function W(a){$(a)&&(a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect="copy"))}function ge(a){$(a)&&(a.preventDefault(),E.value+=1,Y.value=!0)}function de(a){$(a)&&(E.value-=1,E.value<=0&&T())}function _e(a){if(!$(a))return;a.preventDefault();const s=Array.from(a.dataTransfer?.files||[]),o=a.target instanceof Element?a.target:null;T(),!(!s.length||o?.closest(".chat-input-area"))&&V.value?.addFiles?.(s)}async function Le(a){r.clearSessionCompletedUnread(a),await m.push({name:r.runtimeMode==="global_agent"?"hermes.globalAgentSession":"hermes.session",params:{sessionId:a}}),r.activeSessionId!==a&&await r.switchSession(a),te?.matches&&(K.value=!1)}function fe(a){oe.value=a.matches,a.matches&&K.value&&(K.value=!1)}function ot(){K.value=!0}et(()=>{te=window.matchMedia("(max-width: 768px)"),fe(te),te.addEventListener("change",fe),window.addEventListener("hermes:open-page-sidebar",ot),window.addEventListener("resize",xe),xe(),C.profiles.length===0&&C.fetchProfiles()}),La(()=>{te?.removeEventListener("change",fe),window.removeEventListener("hermes:open-page-sidebar",ot),window.removeEventListener("resize",xe),Oe()}),ce(H,async a=>{!a||oe.value||(await Me(),xe())});const Se=h(!1),$e=h(""),Fe=h(null),Ge=h(null),p=w(()=>r.sessionProfileFilter),d=w(()=>[{label:u("chat.allProfiles"),value:"__all__"},...C.profiles.map(a=>({label:a.name,value:a.name}))]);async function x(a){r.sessionProfileFilter=a==="__all__"?null:a,await r.loadSessions(r.sessionProfileFilter)}function ie(a){return[...a].sort((s,o)=>{const N=r.isSessionLive(s.id);return N!==r.isSessionLive(o.id)?N?-1:1:(o.updatedAt||0)-(s.updatedAt||0)})}const ye=w(()=>ie(r.sessions.filter(a=>_.isPinned(a.id)))),ft=w(()=>ie(r.sessions.filter(a=>!_.isPinned(a.id))));ce(()=>[r.sessionsLoaded,...r.sessions.map(a=>a.id)],a=>{const s=a.slice(1);!a[0]||s.length===0||_.pruneMissingSessions(s)},{immediate:!0});const ht=w(()=>r.activeSession?.title||u("chat.newChat")),St=w(()=>{const a=r.activeSession;return a?.model?n.displayModelName(a.model,a.provider):u("models.selectModel")}),ua=w(()=>P.value==="live"?u("chat.liveSessions"):ht.value),qe=h(!1),be=h("hermes"),Pe=h("scoped"),De=h("default"),Ie=h(""),Ce=h(""),Ae=h(""),Ee=h(""),Be=h("codex_responses"),Ue=h(""),we=h(!1),mt=new Set(["openai-codex","copilot","xai-oauth","nous","google-gemini-cli","claude-oauth"]),gt=w(()=>[{label:"Hermes",value:"hermes"},{label:"Claude Code",value:"claude-code"},{label:"Codex",value:"codex"}]),Rt=w(()=>[{label:u("codingAgents.protocolOpenAiChat"),value:"chat_completions"},{label:u("codingAgents.protocolOpenAiResponses"),value:"codex_responses"},{label:u("codingAgents.protocolAnthropicMessages"),value:"anthropic_messages"}]),ca=w(()=>[{label:u("codingAgents.launchModeGlobal"),value:"global"},{label:u("codingAgents.launchModeScoped"),value:"scoped"}]);function bt(a){return n.profileModelGroups.find(s=>s.profile===a)?.groups||[]}function it(a){return mt.has(String(a||"").toLowerCase())}function Nt(a){return be.value!=="hermes"&&Pe.value==="scoped"?!it(a.provider):!0}function rt(a){return bt(a).filter(Nt)}function Ot(a){const s=rt(a),o=C.activeProfileName||"default",N=n.selectedProvider||"",Re=n.selectedModel||"",Ye=N?s.find(dt=>dt.provider===N):void 0;if(a===o&&Ye?.models.includes(Re))return{provider:N,model:Re};const Ne=n.profileModelGroups.find(dt=>dt.profile===a),kt=Ne?.default_provider||"",Ja=Ne?.default||"",Sa=(kt?s.find(dt=>dt.provider===kt):void 0)||s.find(dt=>dt.models.length>0);return{provider:Sa?.provider||"",model:Sa?.models.includes(Ja)?Ja:Sa?.models[0]||""}}const da=w(()=>(C.profiles.length>0?C.profiles:[{name:"default"}]).map(a=>({label:a.name,value:a.name}))),Ke=w(()=>rt(De.value)),Ct=w(()=>Ke.value.map(a=>({label:a.label||a.provider,value:a.provider}))),Ut=w(()=>{const a=Ke.value.find(s=>s.provider===Ie.value);return(a?.models||[]).map(s=>({label:n.displayModelName(s,a?.provider),value:s}))}),ze=w(()=>Ke.value.find(a=>a.provider===Ie.value)),He=w(()=>be.value!=="hermes"),va=w(()=>He.value&&Pe.value==="global"),_t=w(()=>!va.value),zt=w(()=>He.value&&Pe.value==="scoped"&&!ze.value?.base_url),Vt=w(()=>He.value&&Pe.value==="scoped"&&!ze.value?.api_key),pa=w(()=>De.value?_t.value?!Ie.value||!Ce.value?!1:He.value?!(!Be.value||zt.value&&!Ae.value.trim()||Vt.value&&!Ee.value.trim()):!0:!0:!1);function fa(a){const s=String(a?.provider||Ie.value||"").toLowerCase(),o=String(a?.base_url||Ae.value||"").toLowerCase();return es(a?.api_mode,Za(s,o))}function yt(){Be.value=fa(ze.value)}function xt(){const a=Ot(De.value);Ie.value=a.provider,Ce.value=a.model,Ae.value="",Ee.value="",yt()}function ha(){if(!_t.value)return;const a=ze.value;if(a&&a.models.includes(Ce.value)){yt();return}xt()}ce(()=>[be.value,Pe.value,De.value],()=>ha());async function qt(){L.value=!1,M.value.clear(),I.value=!1,qe.value=!0,we.value=!0;try{C.profiles.length===0&&await C.fetchProfiles(),n.modelGroups.length===0&&n.profileModelGroups.length===0&&await n.loadModels(),Ue.value="",De.value=C.activeProfileName||C.profiles.find(a=>a.active)?.name||C.profiles[0]?.name||"default",xt()}finally{we.value=!1}}function ma(a){De.value=a,xt()}function ga(a){Ie.value=a,Ce.value=Ut.value[0]?.value||"",Ae.value="",Ee.value="",yt()}async function _a(){if(be.value!=="hermes"){we.value=!0;try{const Ye=be.value,Ne=(await ji()).tools.find(kt=>kt.id===Ye);if(!Ne?.installed){const kt=Ye==="codex"?"Codex":"Claude Code";g.warning(u("codingAgents.installRequired",{agent:Ne?.name||kt})),qe.value=!1,await m.push({name:"hermes.codingAgents"});return}}catch{g.error(u("codingAgents.loadFailed"));return}finally{we.value=!1}}const a=ze.value,s=be.value==="hermes"?"cli":"coding_agent",o=s==="coding_agent"&&Pe.value==="global",N=be.value==="codex"?"codex":be.value==="claude-code"?"claude":"hermes",Re=r.newChat({profile:De.value,provider:o?void 0:Ie.value,model:o?void 0:Ce.value,source:s,agent:N,codingAgentId:be.value==="hermes"?void 0:be.value,codingAgentMode:s==="coding_agent"?Pe.value:void 0,workspace:Ue.value||null,baseUrl:s==="coding_agent"&&!o&&(a?.base_url||Ae.value.trim())||void 0,apiKey:s==="coding_agent"&&!o&&(a?.api_key||Ee.value.trim())||void 0,apiMode:s==="coding_agent"&&!o?Be.value:void 0});await m.push({name:r.runtimeMode==="global_agent"?"hermes.globalAgentSession":"hermes.session",params:{sessionId:Re.id}}),qe.value=!1}function ya(a){return r.sessions.find(s=>s.id===a)?.profile||null}function wa(a,s){const o=m.resolve({name:r.runtimeMode==="global_agent"?"hermes.globalAgentSession":"hermes.session",params:{sessionId:a},query:s?{profile:s}:void 0}).href;return`${window.location.origin}${window.location.pathname}${o}`}async function ka(a){const s=a||r.activeSessionId;s&&(await Ia(wa(s,ya(s)))?g.success(u("common.copied")):g.error(u("common.copied")+" ✗"))}async function Mt(a){const s=a||r.activeSessionId;s&&(await Ia(s)?g.success(u("common.copied")):g.error(u("common.copied")+" ✗"))}async function Kt(a){if(!await r.deleteSession(a)){g.error(u("common.deleteFailed"));return}_.removePinned(a),g.success(u("chat.sessionDeleted"))}function Wt(){R.value||(L.value=!L.value,L.value||(M.value.clear(),I.value=!1))}function ut(a){return`${a.profile||"default"}\0${a.id}`}function l(a){if(R.value)return;const s=ut(a);M.value.has(s)?M.value.delete(s):M.value.add(s),M.value=new Set(M.value),M.value.size===0&&(I.value=!1)}function f(a){return M.value.has(ut(a))}async function y(){if(M.value.size===0||R.value)return;const a=new Map(r.sessions.map(o=>[ut(o),o])),s=Array.from(M.value).map(o=>a.get(o)).filter(o=>!!o).map(o=>({id:o.id,profile:o.profile||null}));if(s.length!==0){R.value=!0;try{const o=await Yi(s);if(o.deleted>0){for(const N of s)_.removePinned(N.id);await r.loadSessions(r.sessionProfileFilter),g.success(u("chat.batchDeleteSuccess",{count:o.deleted})),o.failed>0&&g.warning(u("chat.batchDeletePartial",{failed:o.failed}))}else g.error(u("chat.batchDeleteFailed"))}catch{g.error(u("chat.batchDeleteFailed"))}finally{R.value=!1,I.value=!1,L.value=!1,M.value.clear()}}}function le(){return y(),!1}function Te(){if(!R.value){M.value.clear();for(const a of r.sessions)a.id!==r.activeSessionId&&M.value.add(ut(a));M.value=new Set(M.value)}}const We=w(()=>M.value.size),je=w(()=>r.sessions.some(a=>a.id!==r.activeSessionId)),re=h(null),Gt=w(()=>re.value?_.isPinned(re.value):!1),Ht=w(()=>re.value&&r.sessions.find(a=>a.id===re.value)||null),jt=w(()=>{const a=[{label:u(Gt.value?"chat.unpin":"chat.pin"),key:"pin"},{label:u("chat.rename"),key:"rename"},{label:u("chat.setWorkspace"),key:"workspace"}];return(Ht.value?.source==="cli"||Ht.value?.source==="coding_agent")&&a.push({label:u("chat.setModel"),key:"model"}),a.push({label:u("chat.export"),key:"export",children:[{label:u("chat.exportFull"),key:"export-full",children:[{label:"JSON",key:"export-full-json"},{label:"TXT",key:"export-full-txt"}]},{label:u("chat.exportCompressed"),key:"export-compressed",children:[{label:"JSON",key:"export-compressed-json"},{label:"TXT",key:"export-compressed-txt"}]}]}),a.push({label:u("chat.openSessionInNewTab"),key:"open-link"}),a.push({label:u("chat.copySessionLink"),key:"copy-link"}),a.push({label:u("chat.copySessionId"),key:"copy-id"}),a});function Xe(){m.push({name:"hermes.settings"})}function Ra(a,s){a.preventDefault(),re.value=s,Xt.value=!0,Na.value=a.clientX,Oa.value=a.clientY}const Xt=h(!1),Na=h(0),Oa=h(0);function Ua(a){return a==="export-full-json"?{mode:"full",ext:"json"}:a==="export-full-txt"?{mode:"full",ext:"txt"}:a==="export-compressed-json"?{mode:"compressed",ext:"json"}:a==="export-compressed-txt"?{mode:"compressed",ext:"txt"}:null}async function yi(a){if(Xt.value=!1,!!re.value){if(a==="pin"){_.togglePinned(re.value);return}if(a==="copy-link")ka(re.value);else if(a==="copy-id")Mt(re.value);else if(a==="open-link")U(re.value);else if(Ua(a)){const{mode:s,ext:o}=Ua(a),N=s==="compressed"?g.loading(u("chat.exportCompressing"),{duration:0}):null;try{await Ji(re.value,s,o),N?.destroy(),g.success(u("chat.exportSuccess"))}catch{N?.destroy(),g.error(u("chat.exportFailed"))}}else if(a==="workspace"){const s=r.sessions.find(o=>o.id===re.value);$t.value=re.value,wt.value=s?.workspace||"",Yt.value=!0}else if(a==="model")await Ha(re.value);else if(a==="rename"){const s=r.sessions.find(o=>o.id===re.value);Fe.value=re.value,$e.value=s?.title||"",Se.value=!0,Me(()=>{Ge.value?.focus()})}}}function wi(){Xt.value=!1}async function za(){if(!(!Fe.value||!$e.value.trim())){if(await er(Fe.value,$e.value.trim())){const a=r.sessions.find(s=>s.id===Fe.value);a&&(a.title=$e.value.trim()),r.activeSession?.id===Fe.value&&(r.activeSession.title=$e.value.trim()),g.success(u("chat.renamed"))}else g.error(u("chat.renameFailed"));Se.value=!1}}const Yt=h(!1),wt=h(""),$t=h(null);async function ki(){if($t.value){if(await Xi($t.value,wt.value||null)){const a=r.sessions.find(s=>s.id===$t.value);a&&(a.workspace=wt.value||null),r.activeSession?.id===$t.value&&(r.activeSession.workspace=wt.value||null),g.success(u("chat.workspaceSet"))}else g.error(u("chat.workspaceSetFailed"));Yt.value=!1}}const Jt=h(!1),Pt=h(!1),ct=h(null),It=h(""),Qt=h({}),Zt=h(""),Tt=h(""),ea=h(""),ta=h(""),Lt=h("codex_responses"),aa=h(null),Va=w(()=>r.sessions.find(a=>a.id===ct.value)?.profile||null),qa=w(()=>r.sessions.find(a=>a.id===ct.value)||(r.activeSession?.id===ct.value?r.activeSession:void 0)),Ka=w(()=>qa.value?.source==="coding_agent"&&qa.value?.codingAgentMode!=="global"),At=w(()=>Va.value?bt(Va.value).filter(a=>!Ka.value||!it(a.provider)):[]),Si=w(()=>At.value.map(a=>({label:a.label,value:a.provider}))),Wa=w(()=>At.value.map(a=>({...a,models:[...a.models,...(n.customModels[a.provider]||[]).filter(s=>!a.models.includes(s))]}))),Ga=w(()=>{const a=It.value.trim().toLowerCase();return a?Wa.value.map(s=>({...s,models:s.models.filter(o=>{const N=n.displayModelName(o,s.provider);return o.toLowerCase().includes(a)||N.toLowerCase().includes(a)})})).filter(s=>s.models.length>0||s.label.toLowerCase().includes(a)):Wa.value});async function Ha(a){n.modelGroups.length===0&&n.profileModelGroups.length===0&&await n.loadModels();const s=r.sessions.find(Ne=>Ne.id===a)||(r.activeSession?.id===a?r.activeSession:void 0);ct.value=a;const o=At.value,N=s?.provider?o.find(Ne=>Ne.provider===s.provider):void 0,Re=N||o.find(Ne=>Ne.models.length>0),Ye={provider:Re?.provider||"",model:Re?.models.includes(s?.model||"")?s?.model||"":Re?.models[0]||""};Zt.value=N?s?.model||Ye.model||"":Ye.model||"",Tt.value=N?s?.provider||"":Ye.provider||"",ta.value=Tt.value,It.value="",ea.value="",Qt.value={},Jt.value=!0}function bi(){const a=r.activeSession?.id;if(!a){qt();return}Ha(a)}function ja(a){return!!Qt.value[a]}function Ci(a){Qt.value[a]=!Qt.value[a]}function xi(a,s){return(n.customModels[s]||[]).includes(a)}function Mi(a,s){return n.displayModelName(a,s)}function $i(a,s){return n.getModelAlias(a,s)}function Pi(a){const s=At.value.find(Re=>Re.provider===a),o=String(s?.provider||a||"").toLowerCase(),N=String(s?.base_url||"").toLowerCase();return es(s?.api_mode,Za(o,N))}async function Xa(a,s,o){ct.value&&(await r.switchSessionModel(a,s,ct.value,o)?(Zt.value=a,Tt.value=s,o&&(Lt.value=o),aa.value=null,Pt.value=!1,Jt.value=!1,g.success(u("chat.modelSet"))):g.error(u("chat.modelSetFailed")))}async function Ya(a,s){if(!(At.value.find(o=>o.provider===s)?.model_meta?.[a]?.disabled||!ct.value)){if(Ka.value){aa.value={model:a,provider:s},Lt.value=Pi(s),Pt.value=!0;return}await Xa(a,s)}}async function Ii(){const a=aa.value;a&&await Xa(a.model,a.provider,Lt.value)}function Ti(){aa.value=null,Pt.value=!1}async function Li(){const a=ea.value.trim(),s=ta.value;!a||!s||await Ya(a,s)}return(a,s)=>(i(),v("div",Un,[P.value==="chat"?(i(),v("div",{key:0,class:ne(["session-backdrop",{active:K.value}]),onClick:s[0]||(s[0]=o=>K.value=!1)},null,2)):b("",!0),P.value==="chat"?(i(),v("aside",{key:1,class:ne(["session-list",{collapsed:!K.value}])},[K.value?(i(),v("div",zn,[k(Gr,{active:e(r).runtimeMode==="global_agent"?"global":"chat","primary-label":e(u)("chat.newChat"),onPrimary:qt},null,8,["active","primary-label"]),t("div",Vn,[k(e(Je),{class:"session-profile-filter",value:p.value||"__all__",options:d.value,size:"small",loading:e(C).loading,"onUpdate:value":x},null,8,["value","options","loading"]),t("div",qn,[t("button",{class:"session-close-btn",onClick:s[1]||(s[1]=o=>K.value=!1)},[...s[28]||(s[28]=[t("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[t("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])]),L.value?b("",!0):(i(),ae(e(X),{key:0,quaternary:"",size:"tiny",onClick:Wt,title:e(u)("chat.toggleBatchMode")},{icon:S(()=>[...s[29]||(s[29]=[t("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[t("path",{d:"M9 11l3 3L22 4"}),t("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})],-1)])]),_:1},8,["title"])),L.value?(i(),ae(e(X),{key:1,quaternary:"",size:"tiny",onClick:Te,disabled:!je.value||R.value,title:e(u)("chat.selectAll")},{icon:S(()=>[...s[30]||(s[30]=[t("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[t("path",{d:"M9 11l3 3L22 4"}),t("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})],-1)])]),_:1},8,["disabled","title"])):b("",!0),L.value&&We.value>0?(i(),ae(e(qi),{key:2,show:I.value,"onUpdate:show":s[2]||(s[2]=o=>I.value=o),"positive-button-props":{loading:R.value,disabled:R.value},"negative-button-props":{disabled:R.value},onPositiveClick:le},{trigger:S(()=>[k(e(X),{quaternary:"",size:"tiny",type:"error",loading:R.value,disabled:R.value},{icon:S(()=>[...s[31]||(s[31]=[t("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[t("polyline",{points:"3 6 5 6 21 6"}),t("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})],-1)])]),_:1},8,["loading","disabled"])]),default:S(()=>[j(" "+c(e(u)("chat.confirmBatchDelete",{count:We.value})),1)]),_:1},8,["show","positive-button-props","negative-button-props"])):b("",!0),L.value?(i(),ae(e(X),{key:3,quaternary:"",size:"tiny",onClick:Wt,disabled:R.value},{icon:S(()=>[...s[32]||(s[32]=[t("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[t("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])]),_:1},8,["disabled"])):b("",!0)])])])):b("",!0),K.value?(i(),v("div",Kn,[e(r).isLoadingSessions&&e(r).sessions.length===0?(i(),v("div",Wn,c(e(u)("common.loading")),1)):e(r).sessions.length===0?(i(),v("div",Gn,c(e(u)("chat.noSessions")),1)):b("",!0),ye.value.length>0?(i(),v(ue,{key:2},[t("div",Hn,[t("span",jn,c(e(u)("chat.pinned")),1),t("span",Xn,c(ye.value.length),1)]),(i(!0),v(ue,null,ke(ye.value,o=>(i(),ae(ss,{key:`pinned-${o.id}`,session:o,active:o.id===e(r).activeSessionId,pinned:!0,"can-delete":o.id!==e(r).activeSessionId||e(r).sessions.length>1,streaming:e(r).isSessionLive(o.id),"completed-unread":e(r).isSessionCompletedUnread(o.id),selectable:L.value,selected:f(o),"show-profile":!0,to:D(o.id),onSelect:N=>Le(o.id),onContextmenu:N=>Ra(N,o.id),onDelete:N=>Kt(o.id),onToggleSelect:N=>l(o)},null,8,["session","active","can-delete","streaming","completed-unread","selectable","selected","to","onSelect","onContextmenu","onDelete","onToggleSelect"]))),128))],64)):b("",!0),(i(!0),v(ue,null,ke(ft.value,o=>(i(),ae(ss,{key:o.id,session:o,active:o.id===e(r).activeSessionId,pinned:!1,"can-delete":o.id!==e(r).activeSessionId||e(r).sessions.length>1,streaming:e(r).isSessionLive(o.id),"completed-unread":e(r).isSessionCompletedUnread(o.id),selectable:L.value,selected:f(o),"show-profile":!0,to:D(o.id),onSelect:N=>Le(o.id),onContextmenu:N=>Ra(N,o.id),onDelete:N=>Kt(o.id),onToggleSelect:N=>l(o)},null,8,["session","active","can-delete","streaming","completed-unread","selectable","selected","to","onSelect","onContextmenu","onDelete","onToggleSelect"]))),128))])):b("",!0),K.value?(i(),v("div",Yn,[t("button",{class:"page-sidebar-menu-btn",type:"button",onClick:Xe},[s[33]||(s[33]=t("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[t("circle",{cx:"12",cy:"12",r:"3"}),t("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})],-1)),t("span",null,c(e(u)("sidebar.settings")),1)]),k(Hr)])):b("",!0)],2)):b("",!0),k(e(Xo),{placement:"bottom-start",trigger:"manual",x:Na.value,y:Oa.value,options:jt.value,show:Xt.value,onSelect:yi,onClickoutside:wi},null,8,["x","y","options","show"]),k(e(vt),{show:Se.value,"onUpdate:show":s[4]||(s[4]=o=>Se.value=o),preset:"dialog",title:e(u)("chat.renameSession"),"positive-text":e(u)("common.ok"),"negative-text":e(u)("common.cancel"),onPositiveClick:za},{default:S(()=>[k(e(Qe),{ref_key:"renameInputRef",ref:Ge,value:$e.value,"onUpdate:value":s[3]||(s[3]=o=>$e.value=o),placeholder:e(u)("chat.enterNewTitle"),onKeydown:na(za,["enter"])},null,8,["value","placeholder"])]),_:1},8,["show","title","positive-text","negative-text"]),k(e(vt),{show:Yt.value,"onUpdate:show":s[6]||(s[6]=o=>Yt.value=o),preset:"dialog",title:e(u)("chat.setWorkspaceTitle"),"positive-text":e(u)("common.ok"),"negative-text":e(u)("common.cancel"),style:{width:"520px"},onPositiveClick:ki},{default:S(()=>[k(Ta,{modelValue:wt.value,"onUpdate:modelValue":s[5]||(s[5]=o=>wt.value=o)},null,8,["modelValue"])]),_:1},8,["show","title","positive-text","negative-text"]),k(e(vt),{show:Jt.value,"onUpdate:show":s[10]||(s[10]=o=>Jt.value=o),preset:"card",title:e(u)("chat.setModelTitle"),style:{width:"min(480px, calc(100vw - 32px))"},"mask-closable":!0},{default:S(()=>[k(e(Qe),{value:It.value,"onUpdate:value":s[7]||(s[7]=o=>It.value=o),placeholder:e(u)("models.searchPlaceholder"),clearable:"",size:"small",class:"session-model-search"},null,8,["value","placeholder"]),t("div",Jn,[(i(!0),v(ue,null,ke(Ga.value,o=>(i(),v("div",{key:o.provider,class:"session-model-group"},[t("div",{class:"session-model-group-header",onClick:N=>Ci(o.provider)},[(i(),v("svg",{class:ne(["session-model-group-arrow",{collapsed:ja(o.provider)}]),width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[...s[34]||(s[34]=[t("polyline",{points:"6 9 12 15 18 9"},null,-1)])],2)),t("span",Zn,c(o.label),1),t("span",eo,c(o.models.length),1)],8,Qn),Dt(t("div",to,[(i(!0),v(ue,null,ke(o.models,N=>(i(),v("div",{key:N,class:ne(["session-model-item",{active:N===Zt.value&&o.provider===Tt.value,disabled:!!o.model_meta?.[N]?.disabled}]),title:o.model_meta?.[N]?.disabled?e(u)("models.disabledTooltip"):"",onClick:Re=>Ya(N,o.provider)},[t("span",so,[t("span",lo,c(Mi(N,o.provider)),1),$i(N,o.provider)?(i(),v("span",no,c(e(u)("models.aliasCanonical",{model:N})),1)):b("",!0)]),o.model_meta?.[N]?.preview?(i(),v("span",oo,c(e(u)("models.previewBadge")),1)):b("",!0),o.model_meta?.[N]?.disabled?(i(),v("span",io,c(e(u)("models.disabledBadge")),1)):b("",!0),xi(N,o.provider)?(i(),v("span",ro,c(e(u)("models.customBadge")),1)):b("",!0),N===Zt.value&&o.provider===Tt.value?(i(),v("svg",uo,[...s[35]||(s[35]=[t("polyline",{points:"20 6 9 17 4 12"},null,-1)])])):b("",!0)],10,ao))),128))],512),[[ba,!ja(o.provider)]])]))),128)),Ga.value.length===0?(i(),v("div",co,c(It.value?"No results":"No models"),1)):b("",!0),t("div",vo,[t("div",po,[k(e(Je),{value:ta.value,"onUpdate:value":s[8]||(s[8]=o=>ta.value=o),options:Si.value,size:"small",class:"session-model-custom-provider"},null,8,["value","options"]),k(e(Qe),{value:ea.value,"onUpdate:value":s[9]||(s[9]=o=>ea.value=o),placeholder:e(u)("models.customModelPlaceholder"),size:"small",class:"session-model-custom-input",onKeydown:na(Li,["enter"])},null,8,["value","placeholder"])]),t("div",fo,c(e(u)("models.customModelHint")),1)])])]),_:1},8,["show","title"]),k(e(vt),{show:Pt.value,"onUpdate:show":s[12]||(s[12]=o=>Pt.value=o),preset:"dialog",title:e(u)("codingAgents.protocolScope"),"mask-closable":!0,style:{width:"min(420px, calc(100vw - 32px))"}},{action:S(()=>[k(e(X),{size:"small",onClick:Ti},{default:S(()=>[j(c(e(u)("common.cancel")),1)]),_:1}),k(e(X),{size:"small",type:"primary",onClick:Ii},{default:S(()=>[j(c(e(u)("common.confirm")),1)]),_:1})]),default:S(()=>[k(e(Je),{value:Lt.value,"onUpdate:value":s[11]||(s[11]=o=>Lt.value=o),options:Rt.value},null,8,["value","options"])]),_:1},8,["show","title"]),k(e(Di),{show:qe.value,"onUpdate:show":s[21]||(s[21]=o=>qe.value=o),class:"new-chat-drawer",placement:"right",width:"min(440px, 100vw)","mask-closable":!0},{default:S(()=>[k(e(Bi),{title:e(u)("chat.newChat"),closable:""},{footer:S(()=>[t("div",Do,[k(e(X),{onClick:s[20]||(s[20]=o=>qe.value=!1)},{default:S(()=>[j(c(e(u)("common.cancel")),1)]),_:1}),k(e(X),{type:"primary",disabled:!pa.value,onClick:_a},{default:S(()=>[j(c(e(u)("chat.newChat")),1)]),_:1},8,["disabled"])])]),default:S(()=>[t("div",ho,[t("label",mo,[t("span",go,c(e(u)("chat.agent")),1),k(e(Je),{value:be.value,"onUpdate:value":s[13]||(s[13]=o=>be.value=o),options:gt.value,disabled:we.value},null,8,["value","options","disabled"])]),He.value?(i(),v("label",_o,[t("span",yo,c(e(u)("codingAgents.launchModeScope")),1),k(e(Ni),{value:Pe.value,"onUpdate:value":s[14]||(s[14]=o=>Pe.value=o),name:"new-chat-coding-agent-mode"},{default:S(()=>[(i(!0),v(ue,null,ke(ca.value,o=>(i(),ae(e(Vi),{key:o.value,value:o.value},{default:S(()=>[j(c(o.label),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])])):b("",!0),t("label",wo,[t("span",ko,c(e(u)("sidebar.profiles")),1),k(e(Je),{value:De.value,options:da.value,loading:we.value||e(C).loading,"onUpdate:value":ma},null,8,["value","options","loading"])]),_t.value?(i(),v("label",So,[t("span",bo,c(e(u)("models.provider")),1),k(e(Je),{value:Ie.value,options:Ct.value,disabled:we.value,"onUpdate:value":ga},null,8,["value","options","disabled"])])):b("",!0),_t.value?(i(),v("label",Co,[t("span",xo,c(e(u)("models.models")),1),k(e(Je),{value:Ce.value,"onUpdate:value":s[15]||(s[15]=o=>Ce.value=o),options:Ut.value,disabled:we.value||!Ie.value,filterable:""},null,8,["value","options","disabled"])])):b("",!0),He.value&&Pe.value==="scoped"?(i(),v("label",Mo,[t("span",$o,c(e(u)("codingAgents.protocolScope")),1),k(e(Je),{value:Be.value,"onUpdate:value":s[16]||(s[16]=o=>Be.value=o),options:Rt.value,disabled:we.value},null,8,["value","options","disabled"])])):b("",!0),zt.value?(i(),v("label",Po,[t("span",Io,c(e(u)("models.baseUrl")),1),k(e(Qe),{value:Ae.value,"onUpdate:value":s[17]||(s[17]=o=>Ae.value=o),placeholder:e(u)("models.baseUrlPlaceholder")},null,8,["value","placeholder"])])):b("",!0),Vt.value?(i(),v("label",To,[t("span",Lo,c(e(u)("models.apiKey")),1),k(e(Qe),{value:Ee.value,"onUpdate:value":s[18]||(s[18]=o=>Ee.value=o),type:"password","show-password-on":"click",placeholder:e(u)("models.apiKeyPlaceholder")},null,8,["value","placeholder"])])):b("",!0),t("div",Ao,[t("span",Fo,c(e(u)("chat.workspace")),1),k(Ta,{modelValue:Ue.value,"onUpdate:modelValue":s[19]||(s[19]=o=>Ue.value=o)},null,8,["modelValue"])])])]),_:1},8,["title"])]),_:1},8,["show"]),t("div",Eo,[t("header",Bo,[t("div",Ro,[P.value==="chat"?(i(),ae(e(X),{key:0,class:"header-sidebar-toggle",quaternary:"",size:"small",onClick:s[22]||(s[22]=o=>K.value=!K.value),circle:""},{icon:S(()=>[...s[36]||(s[36]=[t("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[t("rect",{x:"3",y:"3",width:"7",height:"7"}),t("rect",{x:"14",y:"3",width:"7",height:"7"}),t("rect",{x:"3",y:"14",width:"7",height:"7"}),t("rect",{x:"14",y:"14",width:"7",height:"7"})],-1)])]),_:1})):b("",!0),t("span",No,c(ua.value),1),e(r).activeSession?.workspace?(i(),v("span",{key:1,class:"workspace-badge",title:e(r).activeSession.workspace},"📁 "+c(e(r).activeSession.workspace.split("/").pop()||e(r).activeSession.workspace),9,Oo)):b("",!0)]),t("div",Uo,[P.value==="chat"?(i(),v(ue,{key:0},[B.value?(i(),ae(e(Ze),{key:0,trigger:"hover"},{trigger:S(()=>[k(e(X),{class:ne(["header-tool-toggle",{active:H.value}]),quaternary:"",size:"small",onClick:s[23]||(s[23]=o=>H.value=!H.value),circle:""},{icon:S(()=>[...s[37]||(s[37]=[t("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[t("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),t("line",{x1:"9",y1:"3",x2:"9",y2:"21"}),t("line",{x1:"15",y1:"3",x2:"15",y2:"21"})],-1)])]),_:1},8,["class"])]),default:S(()=>[j(" "+c(e(u)("drawer.files"))+" / "+c(e(u)("drawer.terminal")),1)]),_:1})):b("",!0),k(e(Ze),{trigger:"hover"},{trigger:S(()=>[k(e(X),{quaternary:"",size:"small",onClick:s[24]||(s[24]=o=>G.value=!G.value),circle:""},{icon:S(()=>[...s[38]||(s[38]=[t("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[t("path",{d:"M3 12h18M3 6h18M3 18h18"})],-1)])]),_:1})]),default:S(()=>[j(" "+c(e(u)("chat.outlineTitle")),1)]),_:1}),k(e(Ze),{trigger:"hover"},{trigger:S(()=>[k(e(X),{quaternary:"",size:"small",onClick:s[25]||(s[25]=o=>Mt()),circle:""},{icon:S(()=>[...s[39]||(s[39]=[t("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[t("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),t("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})],-1)])]),_:1})]),default:S(()=>[j(" "+c(e(u)("chat.copySessionId")),1)]),_:1}),k(e(X),{class:"header-model-button",size:"small",circle:oe.value,title:St.value,onClick:bi},{icon:S(()=>[...s[40]||(s[40]=[t("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[t("circle",{cx:"12",cy:"12",r:"3"}),t("path",{d:"M12 1v4"}),t("path",{d:"M12 19v4"}),t("path",{d:"M1 12h4"}),t("path",{d:"M19 12h4"}),t("path",{d:"M4.22 4.22l2.83 2.83"}),t("path",{d:"M16.95 16.95l2.83 2.83"}),t("path",{d:"M4.22 19.78l2.83-2.83"}),t("path",{d:"M16.95 7.05l2.83-2.83"})],-1)])]),default:S(()=>[oe.value?b("",!0):(i(),v(ue,{key:0},[j(c(St.value),1)],64))]),_:1},8,["circle","title"])],64)):b("",!0)])]),P.value==="chat"?(i(),v("div",{key:0,ref_key:"chatContentWrapperRef",ref:Q,class:ne(["chat-content-wrapper",{"chat-content-wrapper--drop-active":Y.value}]),onDragover:W,onDragenter:ge,onDragleave:de,onDrop:_e},[t("div",zo,[k(hi,{ref_key:"messageListRef",ref:F},null,512),k(ci,{ref_key:"chatInputRef",ref:V},null,512)]),G.value?(i(),ae(yr,{key:0,messages:e(r).messages,onNavigate:q},null,8,["messages"])):b("",!0),H.value?(i(),v("aside",{key:1,class:"chat-tool-panel",style:Et(he.value)},[t("div",{class:"chat-tool-resize-handle",onPointerdown:ve},null,32),t("div",Vo,[t("div",qo,[t("button",{class:ne(["chat-tool-tab",{active:O.value==="files"}]),type:"button",role:"tab","aria-selected":O.value==="files",onClick:s[26]||(s[26]=o=>O.value="files")},c(e(u)("drawer.files")),11,Ko),t("button",{class:ne(["chat-tool-tab",{active:O.value==="terminal"}]),type:"button",role:"tab","aria-selected":O.value==="terminal",onClick:s[27]||(s[27]=o=>O.value="terminal")},c(e(u)("drawer.terminal")),11,Wo)]),t("div",Go,[Dt(k(gi,null,null,512),[[ba,O.value==="files"]]),Dt(k(qr,{visible:H.value&&O.value==="terminal"},null,8,["visible"]),[[ba,O.value==="terminal"]])])])],4)):b("",!0)],34)):(i(),ae(vi,{key:1,"human-only":e(_).humanOnly},null,8,["human-only"]))])]))}})})),bu=J((()=>{})),Cu,uc=J((()=>{jo(),jo(),bu(),lt(),Cu=nt(_i,[["__scopeId","data-v-74b02b68"]])}));export{uc as n,Cu as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as r}from"./rolldown-runtime-M0oDzQ_3.js";import{Dn as S,En as w,Kt as g,Pn as _,Tn as y,cn as C,fn as P,in as n,pn as V}from"./ui-vendor-BUz-RIuE.js";import{f as x,m as M,p as R}from"./vue-vendor-BAk4Aood.js";import{n as b,t as k}from"./_plugin-vue_export-helper-
|
|
1
|
+
import{n as r}from"./rolldown-runtime-M0oDzQ_3.js";import{Dn as S,En as w,Kt as g,Pn as _,Tn as y,cn as C,fn as P,in as n,pn as V}from"./ui-vendor-BUz-RIuE.js";import{f as x,m as M,p as R}from"./vue-vendor-BAk4Aood.js";import{n as b,t as k}from"./_plugin-vue_export-helper-D9aS-jmR.js";import{M as B,_t as E,b as F,gt as I,ht as T,j,mt as q,y as A}from"./index-D7Ma0wep.js";import{n as D,t as H}from"./ChatPanel-BrmqJHNK.js";var l,i,p,c=r((()=>{g(),x(),D(),I(),A(),q(),j(),l={class:"chat-view"},i="Hermes Studio",p=V({__name:"ChatView",setup(U){const m=E(),t=F(),d=T(),f=B(),a=R(),v=M(),s=n(()=>{const e=a.params.sessionId;return typeof e=="string"&&e.trim()?e:null}),h=n(()=>{const e=a.query.profile;return typeof e=="string"&&e.trim()?e:null});_(n(()=>a.name!=="hermes.session"?i:t.activeSession?.title?.trim()||i),e=>{document.title=e},{immediate:!0}),w(()=>{document.title=i});async function o(){await t.loadSessions(t.sessionProfileFilter,s.value),s.value&&t.activeSessionId!==s.value&&await v.replace({name:"hermes.chat"})}return y(async()=>{t.setRuntimeMode("default"),m.loadModels(),await Promise.all([d.fetchProfiles(),f.fetchSettings()]),await o()}),_([s,h],async([e])=>{if(t.sessionsLoaded){if(!e){await t.loadSessions(t.sessionProfileFilter);return}if(t.activeSessionId!==e){if(!t.sessions.some(u=>u.id===e)){await o();return}await t.switchSession(e)}}}),(e,u)=>(S(),C("div",l,[P(H)]))}})})),K=r((()=>{})),L,N=r((()=>{c(),c(),K(),b(),L=k(p,[["__scopeId","data-v-724670c2"]])}));N();export{L as default};
|