import{x as B,az as E,r as y,w as h,y as m,D as C,n as i,A as l,I as n,S as f,J as u,G as d,B as s,z as v,K as p}from"./index-CFvoaD7J.js";import{E as j}from"./EditConfig-Ct-cJfRC.js";import{n as N}from"./index.browser-OxPLOBIU.js";import{b as S,V as $,a as c}from"./VCardText-CpOuj25H.js";import{e as z}from"./VMenu-9pSrU4Fo.js";import{V}from"./VList-fGk9SRdf.js";import{C as D}from"./VListItem-CSPID7yq.js";import"./VExpansionPanels-BsT7TGi_.js";import"./VCheckboxBtn-CRgZyCzV.js";import"./VAlert-CIiIOQza.js";import"./VSwitch-Cbz5zuOr.js";import"./VTextField-DF4u_eMy.js";import"./VVirtualScroll-BDBVEoUv.js";import"./VChip-Ccz1-bmn.js";import"./VSlider-ka6goZbo.js";import"./VForm-B86dz_JX.js";import"./VCard-DxLPF-Ra.js";import"./VSpacer-UYEiyhN7.js";/* empty css              */import"./VDialog-CdvGeqlS.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";const O={key:0,style:{"margin-left":"-5px","margin-right":"-5px"}},T=["href"],ne=B({__name:"EditCoreConfig",props:{domain:{}},setup(b){const k=E(),t=y(),w=N(11),r=y(!1),_=b;h(()=>_.domain,async o=>{o&&(t.value=await n.getCoreConfig(o))},{immediate:!0});const M=async function(o){r.value=!0,n.saveCoreConfig(t.value.domain,o).then(()=>{r.value=!1,k.push({name:"providersettings"})}).catch(e=>{alert(e),r.value=!1})},x=async function(o,e){r.value=!0;for(const a of Object.values(t.value.values))a.value!==void 0&&e[a.key]==null&&(e[a.key]=a.value);e.session_id=w,n.getCoreConfigEntries(t.value.domain,o,e).then(a=>{t.value.values={};for(const g of a)t.value.values[g.key]=g;r.value=!1}).catch(a=>{alert(a),r.value=!1})};return(o,e)=>(m(),C("section",null,[i(S,null,{default:l(()=>[t.value?(m(),C("div",O,[i($,null,{default:l(()=>[f(u(o.$t("settings.setup_provider",[d(n).providerManifests[t.value.domain].name])),1)]),_:1}),i(c,null,{default:l(()=>[f(u(d(n).providerManifests[t.value.domain].description),1)]),_:1}),e[2]||(e[2]=s("br",null,null,-1)),d(n).providerManifests[t.value.domain].codeowners.length?(m(),v(c,{key:0},{default:l(()=>[s("b",null,u(o.$t("settings.codeowners"))+": ",1),f(u(d(n).providerManifests[t.value.domain].codeowners.join(" / ")),1)]),_:1})):p("",!0),d(n).providerManifests[t.value.domain].documentation?(m(),v(c,{key:1},{default:l(()=>[s("b",null,u(o.$t("settings.need_help_setup_provider")),1),e[1]||(e[1]=f("  ")),s("a",{href:d(n).providerManifests[t.value.domain].documentation,target:"_blank"},u(o.$t("settings.check_docs")),9,T)]),_:1})):p("",!0),e[3]||(e[3]=s("br",null,null,-1)),i(V),e[4]||(e[4]=s("br",null,null,-1)),e[5]||(e[5]=s("br",null,null,-1))])):p("",!0),i(V),t.value?(m(),v(j,{key:1,"config-entries":Object.values(t.value.values),disabled:!1,onSubmit:M,onAction:x},null,8,["config-entries"])):p("",!0)]),_:1}),i(z,{modelValue:r.value,"onUpdate:modelValue":e[0]||(e[0]=a=>r.value=a),scrim:"true",persistent:"",style:{display:"flex","align-items":"center","justify-content":"center"}},{default:l(()=>[i(D,{indeterminate:"",size:"64",color:"primary"})]),_:1},8,["modelValue"])]))}});export{ne as default};
