import{a7 as T,F as y,M as $,a8 as C,a9 as m,o as i,ae as u,aa as f,ai as v,E as r,aS as j,aT as p,an as d,ac as l,ap as o,aU as c,cq as x,au as b,bI as B,aK as S,b9 as I,ad as O}from"./index-CFcIX8RO.js";import{E as D}from"./EditConfig-tTm2yaGt.js";import{n as U}from"./index.browser-OxPLOBIU.js";import"./VForm-D4C74Wdm.js";import"./VExpansionPanels-D5FURIHn.js";import"./VDialog-C2cPU7vi.js";import"./VAlert-DZurr_D6.js";import"./VSwitch-JHKrUQHN.js";import"./VCheckboxBtn-Dy9mjR59.js";import"./VSlider-BVc6Euty.js";import"./VSelect-9ABLzY_9.js";import"./VVirtualScroll-BRrQ8Y7O.js";const _={key:0,style:{"margin-left":"-5px","margin-right":"-5px"}},W=T({__name:"EditCoreConfig",props:{domain:{}},setup(k){const V=O(),a=y(),w=U(11),s=y(!1),M=k;$(()=>M.domain,async t=>{t&&(a.value=await o.getCoreConfig(t))},{immediate:!0});const E=async function(t){s.value=!0,o.saveCoreConfig(a.value.domain,t).then(()=>{s.value=!1,V.push({name:"providersettings"})}).catch(e=>{alert(e),s.value=!1})},N=async function(t,e){s.value=!0;for(const n of Object.values(a.value.values))n.value!==void 0&&e[n.key]==null&&(e[n.key]=n.value);e.session_id=w,o.getCoreConfigEntries(a.value.domain,t,e).then(n=>{a.value.values={};for(const g of n)a.value.values[g.key]=g;s.value=!1}).catch(n=>{alert(n),s.value=!1})};return(t,e)=>(m(),C("section",null,[i(B,null,{default:u(()=>[a.value?(m(),C("div",_,[i(j,null,{default:u(()=>[p(d(t.$t("settings.setup_provider",[l(o).providerManifests[a.value.domain].name])),1)]),_:1}),i(c,null,{default:u(()=>[p(d(l(o).providerManifests[a.value.domain].description),1)]),_:1}),e[3]||(e[3]=r("br",null,null,-1)),l(o).providerManifests[a.value.domain].codeowners.length?(m(),v(c,{key:0},{default:u(()=>[r("b",null,d(t.$t("settings.codeowners"))+": ",1),p(d(l(o).providerManifests[a.value.domain].codeowners.join(" / ")),1)]),_:1})):f("",!0),l(o).providerManifests[a.value.domain].documentation?(m(),v(c,{key:1},{default:u(()=>[r("b",null,d(t.$t("settings.need_help_setup_provider")),1),e[2]||(e[2]=p("  ",-1)),r("a",{onClick:e[0]||(e[0]=n=>l(x)(l(o).providerManifests[a.value.domain].documentation))},d(t.$t("settings.check_docs")),1)]),_:1})):f("",!0),e[4]||(e[4]=r("br",null,null,-1)),i(b),e[5]||(e[5]=r("br",null,null,-1)),e[6]||(e[6]=r("br",null,null,-1))])):f("",!0),i(b),a.value?(m(),v(D,{key:1,"config-entries":Object.values(a.value.values),disabled:!1,onSubmit:E,onAction:N},null,8,["config-entries"])):f("",!0)]),_:1}),i(I,{modelValue:s.value,"onUpdate:modelValue":e[1]||(e[1]=n=>s.value=n),scrim:"true",persistent:"",style:{display:"flex","align-items":"center","justify-content":"center"}},{default:u(()=>[i(S,{indeterminate:"",size:"64",color:"primary"})]),_:1},8,["modelValue"])]))}});export{W as default};
