import{r as e}from"./rolldown-runtime-DCMCV6zW.js";import{X as t,ct as n}from"./vendor-primevue-7po8Zk9v.js";import"./vendor-firebase-CdLSXhbt.js";import{$ as r,A as i,Bt as a,D as o,F as s,Ft as c,J as l,L as u,O as d,P as f,ft as p,ht as m,k as h,l as g,tt as _,x as v}from"./vendor-vue-core-D3IvUUeM.js";import"./vendor-other-CrvBxfcV.js";import{t as y}from"./envUtil-DPL4J8Ws.js";import"./types-0oh-UGWL.js";import"./remoteConfig-CNDr9CtS.js";import{Ot as b}from"./api-3C7_IVZO.js";import"./colorUtil-C83P1Arv.js";import{n as x}from"./vendor-i18n-CsAN_zFP.js";import"./i18n-DjEVEIh2.js";import"./useErrorHandling-CBX3YQ5l.js";import"./vendor-reka-ui-Bm3o_ZTf.js";import{t as S}from"./Button-mG8zDgxj.js";import{r as C}from"./dialogService-BC0EXJA5.js";import"./systemStatsStore-gvlzOl4W.js";import"./dialogStore-BbHfkjRE.js";import{t as w}from"./useCopyToClipboard-CUuoo5Dm.js";import"./vendor-tiptap-DsZVujQD.js";import"./vendor-markdown-yjaB1jgA.js";import"./markdownRendererUtil-D5cHPoK2.js";import{t as T}from"./PanelTemplate-CuvxTtdx.js";import{t as E}from"./FormItem-ChhcHEP0.js";import{t as D}from"./serverConfigStore-DMg8IXob.js";var O={class:`flex flex-col gap-2`},k={class:`flex justify-end gap-2`},A={class:`flex items-center justify-between`},j=u({__name:`ServerConfigPanel`,setup(e){let u=C(),j=D(),M=b(),{serverConfigsByCategory:N,serverConfigValues:P,launchArgs:F,commandLineArgs:I,modifiedConfigs:L}=g(j),R=!1,revertChanges=()=>{j.revertChanges()},restartApp=async()=>{R=!0,await y().restartApp()};p(F,async e=>{await u.set(`Comfy.Server.LaunchArgs`,e)}),p(P,async e=>{await u.set(`Comfy.Server.ServerConfigValues`,e)});let{copyToClipboard:z}=w(),copyCommandLineArgs=async()=>{await z(I.value)},{t:B}=x();l(()=>{R||L.value.length!==0&&M.add({severity:`warn`,summary:B(`serverConfig.restartRequiredToastSummary`),detail:B(`serverConfig.restartRequiredToastDetail`),life:1e4})});let translateItem=e=>({...e,name:B(`serverConfigItems.${e.id}.name`,e.name),tooltip:e.tooltip?B(`serverConfigItems.${e.id}.tooltip`,e.tooltip):void 0});return(e,l)=>(r(),d(T,{value:`Server-Config`,class:`server-config-panel`},{header:m(()=>[o(`div`,O,[c(L).length>0?(r(),d(c(n),{key:0,severity:`info`,"pt:text":`w-full`},{default:m(()=>[o(`p`,null,a(e.$t(`serverConfig.modifiedConfigs`)),1),o(`ul`,null,[(r(!0),i(v,null,_(c(L),e=>(r(),i(`li`,{key:e.id},a(e.name)+`: `+a(e.initialValue)+` → `+a(e.value),1))),128))]),o(`div`,k,[s(S,{variant:`secondary`,onClick:revertChanges},{default:m(()=>[f(a(e.$t(`serverConfig.revertChanges`)),1)]),_:1}),s(S,{variant:`destructive`,onClick:restartApp},{default:m(()=>[f(a(e.$t(`serverConfig.restart`)),1)]),_:1})])]),_:1})):h(``,!0),c(I)?(r(),d(c(n),{key:1,severity:`secondary`,"pt:text":`w-full`},{icon:m(()=>l[0]||=[o(`i`,{class:`icon-[lucide--terminal] text-xl font-bold`},null,-1)]),default:m(()=>[o(`div`,A,[o(`p`,null,a(c(I)),1),s(S,{size:`icon`,variant:`muted-textonly`,onClick:copyCommandLineArgs},{default:m(()=>l[1]||=[o(`i`,{class:`pi pi-clipboard`},null,-1)]),_:1})])]),_:1})):h(``,!0)])]),default:m(()=>[(r(!0),i(v,null,_(Object.entries(c(N)),([n,l],u)=>(r(),i(`div`,{key:n},[u>0?(r(),d(c(t),{key:0})):h(``,!0),o(`h3`,null,a(e.$t(`serverConfigCategories.${n}`,n)),1),(r(!0),i(v,null,_(l,e=>(r(),i(`div`,{key:e.name,class:`mb-4`},[s(E,{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))]),_:1}))}});export{j as default};
//# sourceMappingURL=ServerConfigPanel-C8v3nuRq.js.map