import{_asu,Nasb,aasw,rasl,casf,oasg,wasr,basd,dasp,tasm,vasS,easI,fasc,lash,gasM}from"./NcSettingsSection-DFav6ob5-Dvi4WdiE.chunk.mjs";import{gask,sasv}from"./check-BUfWmAQ9.chunk.mjs";import{casR}from"./index-C0zE9_k9.chunk.mjs";constT=k().detectLogLevel().setApp("sharebymail").build(),V={name:"AdminSettings",components:{NcCheckboxRadioSwitch:w,NcSettingsSection:b},setup(){return{t:c}},data(){return{sendPasswordMail:h("sharebymail","sendPasswordMail"),replyToInitiator:h("sharebymail","replyToInitiator")}},watch:{sendPasswordMail(e){this.update("sendpasswordmail",e)},replyToInitiator(e){this.update("replyToInitiator",e)}},methods:{asyncupdate(e,a){awaitR();consto=S("/apps/provisioning_api/api/v1/config/apps/{appId}/{key}",{appId:"sharebymail",key:e}),t=a?"yes":"no";try{const{data:s}=awaitI.post(o,{value:t});this.handleResponse({status:s.ocs?.meta?.status})}catch(s){this.handleResponse({errorMessage:c("sharebymail","Unable to update share by mail config"),error:s})}},asynchandleResponse({status:e,errorMessage:a,error:o}){e!=="ok"&&(v(a),T.error(a,{error:o}))}}};functionN(e,a,o,t,s,x){constn=l("NcCheckboxRadioSwitch"),y=l("NcSettingsSection");returng(),f(y,{name:t.t("sharebymail","Share by mail"),description:t.t("sharebymail","Allows people to share a personalized link to a file or folder by putting in an email address.")},{default:r(()=>[d(n,{modelValue:s.sendPasswordMail,"onUpdate:modelValue":a[0]||(a[0]=i=>s.sendPasswordMail=i),type:"switch"},{default:r(()=>[p(m(t.t("sharebymail","Send password by mail")),1)]),_:1},8,["modelValue"]),d(n,{modelValue:s.replyToInitiator,"onUpdate:modelValue":a[1]||(a[1]=i=>s.replyToInitiator=i),type:"switch"},{default:r(()=>[p(m(t.t("sharebymail","Reply to initiator")),1)]),_:1},8,["modelValue"])]),_:1},8,["name","description"])}constP=u(V,[["render",N]]),_=M(P);_.mount("#vue-admin-sharebymail");