"use strict";(globalThis["webpackChunkbaggisowtfaresystem"]=globalThis["webpackChunkbaggisowtfaresystem"]||[]).push([[629],{629:(e,a,t)=>{t.r(a),t.d(a,{default:()=>h});var l=t(1347),s=t(4187),i=t(3022),n=t(705),o=t(2986);const d=(0,n.nY)("mailTest",{state:()=>({loading:!1,lastResult:null}),actions:{async sendTestMail(e){this.loading=!0;try{const a=await(0,o.bE)("/test-mail",{to:e});return this.lastResult=a,!0}catch(e){throw this.lastResult=e,e}finally{this.loading=!1}}}});var u=t(588);const c={__name:"TestMail",setup(e){const{canWrite:a}=(0,u.J)(),t=a("user"),n=(0,l.EW)(()=>t.value),o=(0,i.A)(),c=d(),r=(0,s.KR)("mehmet.kececi@baggi.com.tr");async function g(){if(n.value)try{await c.sendTestMail(r.value),o.notify({type:"positive",message:"Test mail gonderildi"})}catch(e){o.notify({type:"negative",message:e?.message||"Mail gonderilemedi"})}else o.notify({type:"negative",message:"Test mail gonderme yetkiniz yok"})}return(e,a)=>{const t=(0,l.g2)("q-card-section"),i=(0,l.g2)("q-input"),o=(0,l.g2)("q-btn"),d=(0,l.g2)("q-card-actions"),u=(0,l.g2)("q-card"),m=(0,l.g2)("q-page");return n.value?((0,l.uX)(),(0,l.Wv)(m,{key:0,class:"q-pa-md"},{default:(0,l.k6)(()=>[(0,l.bF)(u,{flat:"",bordered:"",class:"q-pa-md",style:{"max-width":"500px"}},{default:(0,l.k6)(()=>[(0,l.bF)(t,null,{default:(0,l.k6)(()=>[...a[1]||(a[1]=[(0,l.Lk)("div",{class:"text-h6"},"SMTP Test Mail",-1)])]),_:1}),(0,l.bF)(t,null,{default:(0,l.k6)(()=>[(0,l.bF)(i,{modelValue:r.value,"onUpdate:modelValue":a[0]||(a[0]=e=>r.value=e),label:"Gonderilecek mail",filled:"",dense:""},null,8,["modelValue"])]),_:1}),(0,l.bF)(d,{align:"right"},{default:(0,l.k6)(()=>[n.value?((0,l.uX)(),(0,l.Wv)(o,{key:0,color:"primary",label:"Test Mail Gonder",loading:(0,s.R1)(c).loading,disable:!n.value,onClick:g},null,8,["loading","disable"])):(0,l.Q3)("",!0)]),_:1})]),_:1})]),_:1})):((0,l.uX)(),(0,l.Wv)(m,{key:1,class:"q-pa-md flex flex-center"},{default:(0,l.k6)(()=>[...a[2]||(a[2]=[(0,l.Lk)("div",{class:"text-negative text-subtitle1"}," Bu module erisim yetkiniz yok. ",-1)])]),_:1}))}}};var r=t(5013),g=t(3341),m=t(222),k=t(6067),y=t(5034),b=t(2677),v=t(272),f=t.n(v);const p=c,h=p;f()(c,"components",{QPage:r.A,QCard:g.A,QCardSection:m.A,QInput:k.A,QCardActions:y.A,QBtn:b.A})}}]);