import{i as c,a2 as S,an as M,a5 as g,M as D,f as k,P as $,bx as U,a4 as N}from"./app-JmgyQoR0.js";import{F as C}from"./suspense-lwY0NW4i.js";import{b as V,a as d,h,i as I,j as e,u as r,l,K as o,E as _,z as m,t as F,F as G,H as w,c as B,D as v}from"./vue-y3KLWBaS.js";import{F as x}from"./folder-DNqDLK_K.js";const P={class:"_formRoot"},R=r("i",{class:"ph-key ph-bold ph-lg"},null,-1),E=r("i",{class:"ph-key ph-bold ph-lg"},null,-1),L=r("i",{class:"ph-floppy-disk-back ph-bold ph-lg"},null,-1),T=V({__name:"integrations.github",setup(y){let p=d(""),t=d(!1),i=d(null),u=d(null);async function f(){const s=await k("admin/meta");p.value=s.uri,t.value=s.enableGithubIntegration,i.value=s.githubClientId,u.value=s.githubClientSecret}function b(){$("admin/update-meta",{enableGithubIntegration:t.value,githubClientId:i.value,githubClientSecret:u.value}).then(()=>{U()})}return(s,a)=>(h(),I(C,{p:f},{default:e(()=>[r("div",P,[l(S,{modelValue:t.value,"onUpdate:modelValue":a[0]||(a[0]=n=>t.value=n),class:"_formBlock"},{label:e(()=>[o(_(m(c).ts.enable),1)]),_:1},8,["modelValue"]),t.value?(h(),F(G,{key:0},[l(M,{class:"_formBlock"},{default:e(()=>[o("Callback URL: "+_(`${p.value}/api/gh/cb`),1)]),_:1}),l(g,{modelValue:i.value,"onUpdate:modelValue":a[1]||(a[1]=n=>i.value=n),class:"_formBlock"},{prefix:e(()=>[R]),label:e(()=>[o("Client ID")]),_:1},8,["modelValue"]),l(g,{modelValue:u.value,"onUpdate:modelValue":a[2]||(a[2]=n=>u.value=n),class:"_formBlock"},{prefix:e(()=>[E]),label:e(()=>[o("Client Secret")]),_:1},8,["modelValue"])],64)):w("",!0),l(D,{primary:"",class:"_formBlock",onClick:b},{default:e(()=>[L,o(" "+_(m(c).ts.save),1)]),_:1})])]),_:1}))}}),j={class:"_formRoot"},z=r("i",{class:"ph-key ph-bold ph-lg"},null,-1),A=r("i",{class:"ph-key ph-bold ph-lg"},null,-1),K=r("i",{class:"ph-floppy-disk-back ph-bold ph-lg"},null,-1),W=V({__name:"integrations.discord",setup(y){let p=d(""),t=d(!1),i=d(null),u=d(null);async function f(){const s=await k("admin/meta");p.value=s.uri,t.value=s.enableDiscordIntegration,i.value=s.discordClientId,u.value=s.discordClientSecret}function b(){$("admin/update-meta",{enableDiscordIntegration:t.value,discordClientId:i.value,discordClientSecret:u.value}).then(()=>{U()})}return(s,a)=>(h(),I(C,{p:f},{default:e(()=>[r("div",j,[l(S,{modelValue:t.value,"onUpdate:modelValue":a[0]||(a[0]=n=>t.value=n),class:"_formBlock"},{label:e(()=>[o(_(m(c).ts.enable),1)]),_:1},8,["modelValue"]),t.value?(h(),F(G,{key:0},[l(M,{class:"_formBlock"},{default:e(()=>[o("Callback URL: "+_(`${p.value}/api/dc/cb`),1)]),_:1}),l(g,{modelValue:i.value,"onUpdate:modelValue":a[1]||(a[1]=n=>i.value=n),class:"_formBlock"},{prefix:e(()=>[z]),label:e(()=>[o("Client ID")]),_:1},8,["modelValue"]),l(g,{modelValue:u.value,"onUpdate:modelValue":a[2]||(a[2]=n=>u.value=n),class:"_formBlock"},{prefix:e(()=>[A]),label:e(()=>[o("Client Secret")]),_:1},8,["modelValue"])],64)):w("",!0),l(D,{primary:"",class:"_formBlock",onClick:b},{default:e(()=>[K,o(" "+_(m(c).ts.save),1)]),_:1})])]),_:1}))}}),q=r("i",{class:"ph-github-logo ph-bold ph-lg"},null,-1),J=r("i",{class:"ph-discord-logo ph-bold ph-lg"},null,-1),Z=V({__name:"integrations",setup(y){let p=d(!1),t=d(!1);async function i(){const b=await k("admin/meta");p.value=b.enableGithubIntegration,t.value=b.enableDiscordIntegration}const u=B(()=>[]),f=B(()=>[]);return N({title:c.ts.integration,icon:"ph-plug ph-bold ph-lg"}),(b,s)=>{const a=v("MkPageHeader"),n=v("MkSpacer"),H=v("MkStickyContainer");return h(),I(H,null,{header:e(()=>[l(a,{actions:u.value,tabs:f.value,"display-back-button":!0},null,8,["actions","tabs"])]),default:e(()=>[l(n,{"content-max":700,"margin-min":16,"margin-max":32},{default:e(()=>[l(C,{p:i},{default:e(()=>[l(x,{class:"_formBlock"},{icon:e(()=>[q]),label:e(()=>[o("GitHub")]),suffix:e(()=>[o(_(p.value?m(c).ts.enabled:m(c).ts.disabled),1)]),default:e(()=>[l(T)]),_:1}),l(x,{class:"_formBlock"},{icon:e(()=>[J]),label:e(()=>[o("Discord")]),suffix:e(()=>[o(_(t.value?m(c).ts.enabled:m(c).ts.disabled),1)]),default:e(()=>[l(W)]),_:1})]),_:1})]),_:1})]),_:1})}}});export{Z as default};
