import{x as E,r as y,w as N,D as C,l as r,A as u,z as m,J as p,y as v,B as s,S as f,K as d,G as l,I as a,aV as $,aD as j}from"./index-DKhfhZyI.js";import{E as D}from"./EditConfig-DFaTC7uJ.js";import{n as S}from"./index.browser-OxPLOBIU.js";import{b as T,V as I,a as c}from"./VCardText-PK-MK26S.js";import{e as O}from"./VMenu-BTA9m0lg.js";import{V}from"./VList-BsIdJYb-.js";import{C as z}from"./VListItem-DG7fZYqG.js";import"./VForm-D1aN7gmd.js";import"./VCheckboxBtn-SjULh2vZ.js";import"./VExpansionPanels-DOptlIBH.js";import"./VAlert-EFQTLSCo.js";import"./VSwitch-DSjDgzWI.js";import"./VTextField-C_1U2QFr.js";import"./VVirtualScroll-DrLqMq8M.js";import"./VChip-Bt-2eXUN.js";import"./VSlider-B8oLe2Mv.js";import"./VDialog-zzdXdu7l.js";import"./VCard-AQsAsy9j.js";import"./VSpacer-lTIuHyc5.js";/* empty css              */import"./_plugin-vue_export-helper-DlAUqK2U.js";const A={key:0,style:{"margin-left":"-5px","margin-right":"-5px"}},ae=E({__name:"EditCoreConfig",props:{domain:{}},setup(b){const k=j(),t=y(),w=S(11),i=y(!1),M=b;N(()=>M.domain,async o=>{o&&(t.value=await a.getCoreConfig(o))},{immediate:!0});const x=async function(o){i.value=!0,a.saveCoreConfig(t.value.domain,o).then(()=>{i.value=!1,k.push({name:"providersettings"})}).catch(e=>{alert(e),i.value=!1})},B=async function(o,e){i.value=!0;for(const n of Object.values(t.value.values))n.value!==void 0&&e[n.key]==null&&(e[n.key]=n.value);e.session_id=w,a.getCoreConfigEntries(t.value.domain,o,e).then(n=>{t.value.values={};for(const g of n)t.value.values[g.key]=g;i.value=!1}).catch(n=>{alert(n),i.value=!1})};return(o,e)=>(m(),C("section",null,[r(T,null,{default:u(()=>[t.value?(m(),C("div",A,[r(I,null,{default:u(()=>[f(d(o.$t("settings.setup_provider",[l(a).providerManifests[t.value.domain].name])),1)]),_:1}),r(c,null,{default:u(()=>[f(d(l(a).providerManifests[t.value.domain].description),1)]),_:1}),e[3]||(e[3]=s("br",null,null,-1)),l(a).providerManifests[t.value.domain].codeowners.length?(m(),v(c,{key:0},{default:u(()=>[s("b",null,d(o.$t("settings.codeowners"))+": ",1),f(d(l(a).providerManifests[t.value.domain].codeowners.join(" / ")),1)]),_:1})):p("",!0),l(a).providerManifests[t.value.domain].documentation?(m(),v(c,{key:1},{default:u(()=>[s("b",null,d(o.$t("settings.need_help_setup_provider")),1),e[2]||(e[2]=f("  ")),s("a",{onClick:e[0]||(e[0]=n=>l($)(l(a).providerManifests[t.value.domain].documentation))},d(o.$t("settings.check_docs")),1)]),_:1})):p("",!0),e[4]||(e[4]=s("br",null,null,-1)),r(V),e[5]||(e[5]=s("br",null,null,-1)),e[6]||(e[6]=s("br",null,null,-1))])):p("",!0),r(V),t.value?(m(),v(D,{key:1,"config-entries":Object.values(t.value.values),disabled:!1,onSubmit:x,onAction:B},null,8,["config-entries"])):p("",!0)]),_:1}),r(O,{modelValue:i.value,"onUpdate:modelValue":e[1]||(e[1]=n=>i.value=n),scrim:"true",persistent:"",style:{display:"flex","align-items":"center","justify-content":"center"}},{default:u(()=>[r(z,{indeterminate:"",size:"64",color:"primary"})]),_:1},8,["modelValue"])]))}});export{ae as default};
