import{r as e}from"./rolldown-runtime-DCMCV6zW.js";import{D as t,Dt as n,c as r}from"./vendor-vue-core-X6q-rGJs.js";const i=r(`serverConfig`,()=>{let e=n({}),r=t(()=>Object.values(e.value)),i=t(()=>r.value.filter(e=>e.initialValue!==e.value)),revertChanges=()=>{for(let e of i.value)e.value=e.initialValue},a=t(()=>r.value.reduce((e,t)=>{let n=t.category?.[0]??`General`;return e[n]=e[n]||[],e[n].push(t),e},{})),o=t(()=>Object.fromEntries(r.value.map(e=>[e.id,e.value===e.defaultValue||e.value===null||e.value===void 0?void 0:e.value]))),s=t(()=>{let e=Object.assign({},...r.value.map(e=>e.value===e.defaultValue||e.value===null||e.value===void 0?{}:e.getValue?e.getValue(e.value):{[e.id]:e.value}));return Object.fromEntries(Object.entries(e).map(([e,t])=>t===!0?[e,``]:[e,t.toString()]))}),c=t(()=>Object.entries(s.value).map(([e,t])=>[`--${e}`,t]).flat().filter(e=>e!==``).join(` `));function loadServerConfig(t,n){for(let r of t){let t=n[r.id]??r.defaultValue;e.value[r.id]={...r,value:t,initialValue:t}}}return{serverConfigById:e,serverConfigs:r,modifiedConfigs:i,serverConfigsByCategory:a,serverConfigValues:o,launchArgs:s,commandLineArgs:c,revertChanges,loadServerConfig}});export{i as t};
//# sourceMappingURL=serverConfigStore-CauSPgcD.js.map