import{r as e}from"./rolldown-runtime-DIIn1E2Q.js";import{K as t,ct as n}from"./vendor-primevue-DyvCA8Nd.js";import"./vendor-firebase-yTFzdAQf.js";import{A as r,F as i,Ht as a,I as o,Lt as s,O as c,R as l,S as u,Y as d,_t as f,et as p,j as m,k as h,l as g,nt as _,pt as v}from"./vendor-vue-core-IZuWV8u3.js";import"./vendor-other-Q0G0D0d6.js";import"./useFeatureFlags-BfqxvwHy.js";import{Ot as y}from"./api-C840HmAF.js";import"./vendor-markdown-8POvMhty.js";import"./colorUtil-Q3kaA72Z.js";import{n as b}from"./vendor-i18n-NwyZMF0q.js";import"./i18n-B8CRKNXU.js";import"./vendor-reka-ui-Dfvl2gA8.js";import{t as x}from"./Button-uSZXZovG.js";import{H as S,i as C,qr as w}from"./dialogService-J-k0CeI4.js";import"./systemStatsStore-BJOd4X3d.js";import{t as T}from"./envUtil-DhK5xFg_.js";import"./userStore-o2bxxBJt.js";import"./useErrorHandling-t4kNWELW.js";import"./vendor-tiptap-BZCaYoPl.js";import"./Popover-BV6_S20i.js";import"./markdownRendererUtil-DH1PCfUd.js";import"./useExternalLink-Cxwyf6Kb.js";import{t as E}from"./serverConfigStore-BV8DQxMg.js";var D={class:`server-config-panel flex flex-col gap-2`},O={class:`flex justify-end gap-2`},k={class:`flex items-center justify-between`},A=l({__name:`ServerConfigPanel`,setup(e){let l=C(),A=E(),j=y(),{serverConfigsByCategory:M,serverConfigValues:N,launchArgs:P,commandLineArgs:F,modifiedConfigs:I}=g(A),L=!1,revertChanges=()=>{A.revertChanges()},restartApp=async()=>{L=!0,await T().restartApp()};v(P,async e=>{await l.set(`Comfy.Server.LaunchArgs`,e)}),v(N,async e=>{await l.set(`Comfy.Server.ServerConfigValues`,e)});let{copyToClipboard:R}=w(),copyCommandLineArgs=async()=>{await R(F.value)},{t:z}=b();d(()=>{L||I.value.length!==0&&j.add({severity:`warn`,summary:z(`serverConfig.restartRequiredToastSummary`),detail:z(`serverConfig.restartRequiredToastDetail`),life:1e4})});let translateItem=e=>({...e,name:z(`serverConfigItems.${e.id}.name`,e.name),tooltip:e.tooltip?z(`serverConfigItems.${e.id}.tooltip`,e.tooltip):void 0});return(e,l)=>(p(),m(`div`,D,[s(I).length>0?(p(),h(s(n),{key:0,severity:`info`,"pt:text":`w-full`},{default:f(()=>[c(`p`,null,a(e.$t(`serverConfig.modifiedConfigs`)),1),c(`ul`,null,[(p(!0),m(u,null,_(s(I),e=>(p(),m(`li`,{key:e.id},a(e.name)+`: `+a(e.initialValue)+` → `+a(e.value),1))),128))]),c(`div`,O,[o(x,{variant:`secondary`,onClick:revertChanges},{default:f(()=>[i(a(e.$t(`serverConfig.revertChanges`)),1)]),_:1}),o(x,{variant:`destructive`,onClick:restartApp},{default:f(()=>[i(a(e.$t(`serverConfig.restart`)),1)]),_:1})])]),_:1})):r(``,!0),s(F)?(p(),h(s(n),{key:1,severity:`secondary`,"pt:text":`w-full`},{icon:f(()=>l[0]||=[c(`i`,{class:`icon-[lucide--terminal] text-xl font-bold`},null,-1)]),default:f(()=>[c(`div`,k,[c(`p`,null,a(s(F)),1),o(x,{size:`icon`,variant:`muted-textonly`,"aria-label":e.$t(`g.copyToClipboard`),onClick:copyCommandLineArgs},{default:f(()=>l[1]||=[c(`i`,{class:`pi pi-clipboard`},null,-1)]),_:1},8,[`aria-label`])])]),_:1})):r(``,!0),(p(!0),m(u,null,_(Object.entries(s(M)),([n,i],l)=>(p(),m(`div`,{key:n},[l>0?(p(),h(s(t),{key:0})):r(``,!0),c(`h3`,null,a(e.$t(`serverConfigCategories.${n}`,n)),1),(p(!0),m(u,null,_(i,e=>(p(),m(`div`,{key:e.name,class:`mb-4`},[o(S,{id:e.id,"form-value":e.value,"onUpdate:formValue":t=>e.value=t,item:translateItem(e),"label-class":{"text-highlight":e.initialValue!==e.value}},null,8,[`id`,`form-value`,`onUpdate:formValue`,`item`,`label-class`])]))),128))]))),128))]))}});export{A as default};
//# sourceMappingURL=ServerConfigPanel-5DWlPALI.js.map