+import{b as y,q as g,u as o,o as n,c as p,H as h,w as _,g as v,t as V,z as b,s as x,j as d,F as M,C as q,_ as w,$ as K,e as f,r as U}from"./runtime-dom.esm-bundler-kIUX19tl.chunk.mjs";import{c as j}from"./index-95YLtwyE.chunk.mjs";import{a as C}from"./index-C1xmmKTZ-t0nPlmDG.chunk.mjs";import{t as s}from"./translation-DoG5ZELJ-RPmSSHnq.chunk.mjs";import{g as N}from"./createElementId-DhjFt1I9-O556ozYc.chunk.mjs";import{N as S}from"./logger-D3RVzcfQ-B7Se_Euq.chunk.mjs";import{N as z}from"./NcSelect-B1uITk_3-BAR3LTcY.chunk.mjs";import{N as A}from"./NcCheckboxRadioSwitch-D0gFwEVl-ANCSRF7y.chunk.mjs";import{N as E}from"./NcPasswordField-BOLzDHBJ-DQet8BBi.chunk.mjs";import{_ as L}from"./NcDateTime.vue_vue_type_script_setup_true_lang-B4upiZjL-DSkatZE7.chunk.mjs";import{C as c,a as k}from"./types-Dd-xTC5X.chunk.mjs";import{l as B}from"./logger-WSZ2uVjf.chunk.mjs";const P=y({__name:"ConfigurationEntry",props:b({configKey:{},configOption:{}},{modelValue:{type:[String,Boolean],default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const a=g(e,"modelValue");return(t,i)=>e.configOption.type!==o(c).Boolean?(n(),p(h(e.configOption.type===o(c).Password?o(E):o(L)),{key:0,modelValue:a.value,"onUpdate:modelValue":i[0]||(i[0]=l=>a.value=l),name:e.configKey,required:!(e.configOption.flags&o(k).Optional),label:e.configOption.value,title:e.configOption.tooltip},null,8,["modelValue","name","required","label","title"])):(n(),p(o(A),{key:1,modelValue:a.value,"onUpdate:modelValue":i[1]||(i[1]=l=>a.value=l),type:"switch",title:e.configOption.tooltip},{default:_(()=>[v(V(e.configOption.value),1)]),_:1},8,["modelValue","title"]))}}),R=y({__name:"AuthMechanismRsa",props:b({authMechanism:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const a=g(e,"modelValue"),t=U();x(t,()=>{t.value&&(a.value.private_key="",a.value.public_key="")});async function i(){try{const{data:l}=await j.post(N("/apps/files_external/ajax/public_key.php"),{keyLength:t.value});a.value.private_key=l.data.private_key,a.value.public_key=l.data.public_key}catch(l){B.error("Error generating RSA key pair",{error:l}),C(s("files_external","Error generating key pair"))}}return(l,m)=>(n(),d("div",null,[(n(!0),d(M,null,q(e.authMechanism.configuration,(r,u)=>w((n(),p(P,{key:r.value,modelValue:a.value[u],"onUpdate:modelValue":O=>a.value[u]=O,configKey:u,configOption:r},null,8,["modelValue","onUpdate:modelValue","configKey","configOption"])),[[K,!(r.flags&o(k).Hidden)]])),128)),f(o(z),{modelValue:t.value,"onUpdate:modelValue":m[0]||(m[0]=r=>t.value=r),clearable:!1,inputLabel:o(s)("files_external","Key size"),options:[1024,2048,4096],required:""},null,8,["modelValue","inputLabel"]),f(o(S),{disabled:!t.value,wide:"",onClick:i},{default:_(()=>[v(V(o(s)("files_external","Generate keys")),1)]),_:1},8,["disabled"])]))}}),Z=Object.freeze(Object.defineProperty({__proto__:null,default:R},Symbol.toStringTag,{value:"Module"}));export{Z as A,P as _};
0 commit comments