1import{n as y}from"./rolldown-runtime-M0oDzQ_3.js";import{$n as i,$t as a,An as s,At as Ne,Bn as h,Bt as F,Cn as Ge,E as q,Jn as e,O as Be,Pt as Ke,Qt as Oe,W as Y,Xn as J,Yt as Ue,an as P,en as k,g as Le,i as Qe,m as Ze,nn as $,on as _,q as el,s as E,sn as T,t as A,tn as S,wt as b,xn as m,yn as ll,z as D}from"./ui-vendor-DNWaqYj5.js";import{c as V,l as N}from"./vue-vendor-VX6KvV1_.js";import{n as B,t as U}from"./_plugin-vue_export-helper-Fcw_rIxj.js";import{J as al,X as L,Y as R,q as tl}from"./index-DUEP1pix.js";var W,X,G,K,O,Q,Z,ee,le,ae,te,oe,ie,se,ne,re,ue,de,fe,_e,pe,ce,ve,me,he,Re,ge=y((()=>{F(),A(),R(),V(),al(),W={class:"card-header"},X={class:"profile-title"},G={class:"profile-name"},K={class:"card-body"},O={class:"info-row"},Q={class:"info-label"},Z={class:"info-value mono"},ee={class:"toggle-text"},le={key:0,class:"card-detail"},ae={class:"info-row"},te={class:"info-label"},oe={class:"info-value"},ie={class:"info-row"},se={class:"info-label"},ne={class:"info-value mono detail-path"},re={class:"info-row"},ue={class:"info-label"},de={class:"info-value"},fe={class:"info-row"},_e={class:"info-label"},pe={class:"info-value"},ce={class:"info-row"},ve={class:"info-label"},me={class:"info-value"},he={class:"card-actions"},Re=T({__name:"ProfileCard",props:{profile:{}},setup(C,{emit:x}){const u=C,{t:l}=N(),n=L(),r=D(),g=el(),p=h(!1),d=h(!1),c=h(!1),o=h(!1),v=h(null),I=Oe(()=>u.profile.name==="default");async function M(){if(p.value){p.value=!1;return}p.value=!0,d.value=!0;try{v.value=await n.fetchProfileDetail(u.profile.name)}finally{d.value=!1}}async function f(){g.warning({title:l("profiles.switchTo"),content:l("profiles.switchConfirm",{name:u.profile.name}),positiveText:l("profiles.switchTo"),negativeText:l("common.cancel"),onPositiveClick:t})}async function t(){o.value=!0;try{await n.switchHermesProfile(u.profile.name)?(r.success(l("profiles.switchSuccess",{name:u.profile.name})),setTimeout(()=>window.location.reload(),500)):r.error(l("profiles.switchFailed"))}finally{o.value=!1}}function w(){g.warning({title:l("profiles.delete"),content:l("profiles.deleteConfirm",{name:u.profile.name}),positiveText:l("common.delete"),negativeText:l("common.cancel"),onPositiveClick:async()=>{await n.deleteProfile(u.profile.name)?r.success(l("profiles.deleteSuccess")):r.error(l("profiles.deleteFailed"))}})}async function z(){c.value=!0;try{await n.exportProfile(u.profile.name)?r.success(l("profiles.exportSuccess")):r.error(l("profiles.exportFailed"))}finally{c.value=!1}}return(j,H)=>(m(),$("div",{class:J(["profile-card",{active:C.profile.active}])},[a("div",W,[a("div",X,[_(tl,{name:C.profile.name,avatar:C.profile.avatar,size:28},null,8,["name","avatar"]),a("h3",G,i(C.profile.name),1)]),C.profile.active?(m(),k(e(Ke),{key:0,size:"tiny",type:"success",bordered:!1},{default:s(()=>[P(i(e(l)("profiles.active")),1)]),_:1})):S("",!0)]),a("div",K,[a("div",O,[a("span",Q,i(e(l)("profiles.model")),1),a("code",Z,i(C.profile.model),1)])]),a("div",{class:"card-detail-toggle",onClick:M},[(m(),$("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:J(["toggle-icon",{expanded:p.value}])},[...H[0]||(H[0]=[a("polyline",{points:"6 9 12 15 18 9"},null,-1)])],2)),a("span",ee,i(p.value?e(l)("common.collapse"):e(l)("common.expand")),1)]),p.value?(m(),$("div",le,[_(e(Le),{show:d.value,size:"small"},{default:s(()=>[v.value?(m(),$(Ue,{key:0},[a("div",ae,[a("span",te,i(e(l)("profiles.provider")),1),a("span",oe,i(v.value.provider),1)]),a("div",ie,[a("span",se,i(e(l)("profiles.path")),1),a("code",ne,i(v.value.path),1)]),a("div",re,[a("span",ue,i(e(l)("profiles.skills")),1),a("span",de,i(v.value.skills),1)]),a("div",fe,[a("span",_e,i(e(l)("profiles.hasEnv")),1),a("span",pe,i(v.value.hasEnv?"Yes":"No"),1)]),a("div",ce,[a("span",ve,i(e(l)("profiles.hasSoulMd")),1),a("span",me,i(v.value.hasSoulMd?"Yes":"No"),1)])],64)):S("",!0)]),_:1},8,["show"])])):S("",!0),a("div",he,[C.profile.active?S("",!0):(m(),k(e(b),{key:0,size:"tiny",loading:o.value,quaternary:"",type:"primary",onClick:f},{default:s(()=>[P(i(e(l)("profiles.switchTo")),1)]),_:1},8,["loading"])),_(e(b),{size:"tiny",quaternary:"",type:"error",disabled:I.value||C.profile.active,onClick:w},{default:s(()=>[P(i(e(l)("common.delete")),1)]),_:1},8,["disabled"]),_(e(b),{size:"tiny",quaternary:"",loading:c.value,onClick:z},{default:s(()=>[P(i(e(l)("profiles.export")),1)]),_:1},8,["loading"])])],2))}})})),ol=y((()=>{})),je,il=y((()=>{ge(),ge(),ol(),B(),je=U(Re,[["__scopeId","data-v-6cae06e2"]])})),ye,we,Ae,Pe=y((()=>{F(),il(),R(),V(),ye={key:0,class:"empty-state"},we={key:1,class:"profiles-grid"},Ae=T({__name:"ProfilesPanel",emits:["rename"],setup(C){const{t:x}=N(),u=L();return(l,n)=>e(u).profiles.length===0?(m(),$("div",ye,[n[1]||(n[1]=a("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1",class:"empty-icon"},[a("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),a("circle",{cx:"12",cy:"7",r:"4"})],-1)),a("p",null,i(e(x)("profiles.noProfiles")),1)])):(m(),$("div",we,[(m(!0),$(Ue,null,Ge(e(u).profiles,r=>(m(),k(je,{key:r.name,profile:r,onRename:n[0]||(n[0]=g=>l.$emit("rename",g))},null,8,["profile"]))),128))]))}})})),sl=y((()=>{})),De,nl=y((()=>{Pe(),Pe(),sl(),B(),De=U(Ae,[["__scopeId","data-v-51e73d5a"]])})),Ce,qe,xe=y((()=>{F(),A(),R(),V(),Ce={class:"modal-footer"},qe=T({__name:"ProfileCreateModal",emits:["close","saved"],setup(C,{emit:x}){const u=x,{t:l}=N(),n=L(),r=D(),g=h(!0),p=h(!1),d=h(""),c=h(!1),o=h("");function v(f){const t=f.toLowerCase().replace(/[^a-z0-9_-]/g,"");t!==f?o.value=l("profiles.nameValidation"):o.value="",d.value=t}async function I(){if(!d.value){r.warning(l("profiles.namePlaceholder"));return}if(!/^[a-z0-9_-]+$/.test(d.value)){r.error(l("profiles.nameValidation"));return}p.value=!0;try{const f=await n.createProfile(d.value.trim(),c.value);if(f.success){const t=f.strippedCredentials??[],w=f.disabledPlatforms??[],z=f.
1strippedConfigCredentials??[];if(c.value&&(t.length>0||w.length>0||z.length>0)){const j=[];t.length>0&&j.push(l("profiles.cloneStrippedCredentials",{count:t.length,list:t.join(", ")})),w.length>0&&j.push(l("profiles.cloneDisabledPlatforms",{count:w.length,list:w.join(", ")})),z.length>0&&j.push(l("profiles.cloneStrippedConfigCredentials",{count:z.length,list:z.join(", ")})),r.info(`${l("profiles.createSuccess",{name:d.value.trim()})} 2${j.join(` 3`)}`,{duration:6e3})}else r.success(l("profiles.createSuccess",{name:d.value.trim()}));u("saved")}else{const t=f.error||l("profiles.createFailed");r.error(t)}}finally{p.value=!1}}function M(){g.value=!1,setTimeout(()=>u("close"),200)}return(f,t)=>(m(),k(e(Y),{show:g.value,"onUpdate:show":t[2]||(t[2]=w=>g.value=w),preset:"card",title:e(l)("profiles.create"),style:{width:"min(420px, calc(100vw - 32px))"},"mask-closable":!p.value,onAfterLeave:t[3]||(t[3]=w=>u("close"))},{footer:s(()=>[a("div",Ce,[_(e(b),{onClick:M},{default:s(()=>[P(i(e(l)("common.cancel")),1)]),_:1}),_(e(b),{type:"primary",loading:p.value,onClick:I},{default:s(()=>[P(i(e(l)("common.create")),1)]),_:1},8,["loading"])])]),default:s(()=>[_(e(Be),{"label-placement":"top"},{default:s(()=>[_(e(q),{label:e(l)("profiles.name"),required:""},{default:s(()=>[_(e(Ne),{value:d.value,"onUpdate:value":t[0]||(t[0]=w=>d.value=w),placeholder:e(l)("profiles.namePlaceholder"),onInput:v},null,8,["value","placeholder"])]),_:1},8,["label"]),o.value?(m(),k(e(E),{key:0,depth:"3",type:"warning",style:{"font-size":"12px"}},{default:s(()=>[P(i(o.value),1)]),_:1})):S("",!0),_(e(q),{label:e(l)("profiles.cloneFromCurrent")},{default:s(()=>[_(e(Ze),{value:c.value,"onUpdate:value":t[1]||(t[1]=w=>c.value=w)},null,8,["value"])]),_:1},8,["label"]),c.value?(m(),k(e(E),{key:1,depth:"3",style:{"font-size":"12px"}},{default:s(()=>[P(i(e(l)("profiles.cloneCleanupNotice")),1)]),_:1})):S("",!0)]),_:1})]),_:1},8,["show","title","mask-closable"]))}})})),rl=y((()=>{})),ul=y((()=>{})),Ee,dl=y((()=>{xe(),xe(),rl(),ul(),B(),Ee=U(qe,[["__scopeId","data-v-06cc88f3"]])})),ke,Ye,be=y((()=>{F(),A(),R(),V(),ke={class:"modal-footer"},Ye=T({__name:"ProfileRenameModal",props:{profileName:{}},emits:["close","saved"],setup(C,{emit:x}){const u=C,l=x,{t:n}=N(),r=L(),g=D(),p=h(!0),d=h(!1),c=h(""),o=h("");function v(f){const t=f.toLowerCase().replace(/[^a-z0-9_-]/g,"");t!==f?o.value=n("profiles.nameValidation"):o.value="",c.value=t}async function I(){if(!c.value){g.warning(n("profiles.newNamePlaceholder"));return}if(!/^[a-z0-9_-]+$/.test(c.value)){g.error(n("profiles.nameValidation"));return}d.value=!0;try{await r.renameProfile(u.profileName,c.value.trim())?(g.success(n("profiles.renameSuccess")),l("saved")):g.error(n("profiles.renameFailed"))}finally{d.value=!1}}function M(){p.value=!1,setTimeout(()=>l("close"),200)}return(f,t)=>(m(),k(e(Y),{show:p.value,"onUpdate:show":t[1]||(t[1]=w=>p.value=w),preset:"card",title:e(n)("profiles.rename"),style:{width:"min(420px, calc(100vw - 32px))"},"mask-closable":!d.value,onAfterLeave:t[2]||(t[2]=w=>l("close"))},{footer:s(()=>[a("div",ke,[_(e(b),{onClick:M},{default:s(()=>[P(i(e(n)("common.cancel")),1)]),_:1}),_(e(b),{type:"primary",loading:d.value,onClick:I},{default:s(()=>[P(i(e(n)("common.confirm")),1)]),_:1},8,["loading"])])]),default:s(()=>[_(e(Be),{"label-placement":"top"},{default:s(()=>[_(e(q),{label:e(n)("profiles.newName"),required:""},{default:s(()=>[_(e(Ne),{value:c.value,"onUpdate:value":t[0]||(t[0]=w=>c.value=w),placeholder:e(n)("profiles.newNamePlaceholder"),onInput:v},null,8,["value","placeholder"])]),_:1},8,["label"]),o.value?(m(),k(e(E),{key:0,depth:"3",type:"warning",style:{"font-size":"12px"}},{default:s(()=>[P(i(o.value),1)]),_:1})):S("",!0)]),_:1})]),_:1},8,["show","title","mask-closable"]))}})})),fl=y((()=>{})),He,_l=y((()=>{be(),be(),fl(),B(),He=U(Ye,[["__scopeId","data-v-740612c1"]])})),Me,Je,Se=y((()=>{F(),A(),R(),V(),Me={class:"modal-footer"},Je=T({__name:"ProfileImportModal",emits:["close","saved"],setup(C,{emit:x}){const u=x,{t:l}=N(),n=L(),r=D(),g=h(!0),p=h(!1),d=h([]),c=[".tar.gz",".tgz",".gz",".zip"];function o({file:M}){const f=M.name?.toLowerCase()||"";return c.some(t=>f.endsWith(t))?!0:(r.warning(l("profiles.importInvalidFile")),!1)}async function v(){if(!d.value.length){r.warning(l("profiles.importSelectFile"));return}p.value=!0;try{const M=d.value[0].file;if(!M){r.error(l("profiles.importFailed"));return}await n.importProfile(M)?(r.success(l("profiles.importSuccess")),u("saved")):r.error(l("profiles.importFailed"))}finally{p.value=!1}}function I(){g.value=!1,setTimeout(()=>u("close"),200)}return(M,f)=>(m(),k(e(Y),{show:g.value,"onUpdate:show":f[1]||(f[1]=t=>
3g.value=t),preset:"card",title:e(l)("profiles.import"),style:{width:"min(420px, calc(100vw - 32px))"},"mask-closable":!p.value,onAfterLeave:f[2]||(f[2]=t=>u("close"))},{footer:s(()=>[a("div",Me,[_(e(b),{onClick:I},{default:s(()=>[P(i(e(l)("common.cancel")),1)]),_:1}),_(e(b),{type:"primary",loading:p.value,disabled:!d.value.length,onClick:v},{default:s(()=>[P(i(e(l)("common.confirm")),1)]),_:1},8,["loading","disabled"])])]),default:s(()=>[_(e(Qe),{"file-list":d.value,"onUpdate:fileList":f[0]||(f[0]=t=>d.value=t),max:1,accept:c.join(","),disabled:p.value,onBeforeUpload:o},{default:s(()=>[_(e(b),null,{default:s(()=>[P(i(e(l)("profiles.importSelectFile")),1)]),_:1})]),_:1},8,["file-list","accept","disabled"])]),_:1},8,["show","title","mask-closable"]))}})})),pl=y((()=>{})),We,cl=y((()=>{Se(),Se(),pl(),B(),We=U(Je,[["__scopeId","data-v-accddacf"]])})),$e,Ie,ze,Fe,Te,Xe,Ve=y((()=>{F(),A(),V(),nl(),dl(),_l(),cl(),R(),$e={class:"profiles-view"},Ie={class:"page-header"},ze={class:"header-title"},Fe={class:"header-actions"},Te={class:"profiles-content"},Xe=T({__name:"ProfilesView",setup(C){const{t:x}=N(),u=L(),l=h(!1),n=h(!1),r=h(null);ll(()=>{u.fetchHermesProfiles()});function g(){l.value=!1}function p(){r.value=null}function d(){n.value=!1}return(c,o)=>(m(),$("div",$e,[a("header",Ie,[a("h2",ze,i(e(x)("profiles.title")),1),a("div",Fe,[_(e(b),{size:"small",onClick:o[0]||(o[0]=v=>n.value=!0)},{icon:s(()=>[...o[6]||(o[6]=[a("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[a("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),a("polyline",{points:"17 8 12 3 7 8"}),a("line",{x1:"12",y1:"3",x2:"12",y2:"15"})],-1)])]),default:s(()=>[P(" "+i(e(x)("profiles.import")),1)]),_:1}),_(e(b),{type:"primary",size:"small",onClick:o[1]||(o[1]=v=>l.value=!0)},{icon:s(()=>[...o[7]||(o[7]=[a("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[a("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),a("line",{x1:"5",y1:"12",x2:"19",y2:"12"})],-1)])]),default:s(()=>[P(" "+i(e(x)("profiles.create")),1)]),_:1})])]),a("div",Te,[_(e(Le),{show:e(u).loading&&e(u).profiles.length===0},{default:s(()=>[_(De,{onRename:o[2]||(o[2]=v=>r.value=v)})]),_:1},8,["show"])]),l.value?(m(),k(Ee,{key:0,onClose:o[3]||(o[3]=v=>l.value=!1),onSaved:g})):S("",!0),r.value?(m(),k(He,{key:1,"profile-name":r.value,onClose:o[4]||(o[4]=v=>r.value=null),onSaved:p},null,8,["profile-name"])):S("",!0),n.value?(m(),k(We,{key:2,onClose:o[5]||(o[5]=v=>n.value=!1),onSaved:d})):S("",!0)]))}})})),vl=y((()=>{})),ml,hl=y((()=>{Ve(),Ve(),vl(),B(),ml=U(Xe,[["__scopeId","data-v-4b884a5a"]])}));hl();export{ml as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.