| Current Path : /home/users/unlimited/www/whatsapp-crm/public/build/assets/ |
| Current File : /home/users/unlimited/www/whatsapp-crm/public/build/assets/Email-b7af2fb5.js |
import{r as k,T as h,h as x,f as $,o as d,a as l,t as u,e as a,u as o,n as i,c as p,b as _,g as C}from"./app-43851608.js";import M from"./App-2fea9171.js";import{_ as m}from"./FormInput-4a309017.js";import{_ as U}from"./FormSelect-2d73589a.js";import"./App-ad5f7ecb.js";import"./Sidebar-7bb6d772.js";import"./Menu-4221d61f.js";import"./ProfileModal-628e5b7c.js";import"./LangToggle-8d05b0dc.js";import"./MobileSidebar-b73cd192.js";import"./index-99011d5f.js";/* empty css */import"./Sidebar-7b5bc85b.js";import"./index-17cd980e.js";import"./use-text-value-242aa4d7.js";import"./ChevronUpDownIcon-8859f144.js";const S={class:"text-xl mb-1"},A={class:"mb-6 flex items-center text-sm leading-6 text-gray-600"},j=l("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24"},[l("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 11v5m0 5a9 9 0 1 1 0-18a9 9 0 0 1 0 18Zm.05-13v.1h-.1V8h.1Z"})],-1),B={class:"ml-1 mt-1"},N={class:"space-y-12"},Z={class:"pb-12"},E={class:"pb-10"},L={class:"grid gap-6 grid-cols-2 pb-6 md:w-2/3"},P={key:0,class:"grid gap-6 grid-cols-2 pb-10 md:w-2/3"},R={key:1,class:"grid gap-6 grid-cols-2 pb-6 md:w-2/3"},T={key:2,class:"grid gap-6 grid-cols-2 pb-6 md:w-2/3"},W={class:"grid gap-6 grid-cols-2 pb-3 md:w-2/3"},q={class:"grid grid-cols-2 pb-6 border-b md:w-2/3"},z={class:"relative flex gap-x-3 mt-4 col-span-2"},O={class:"flex items-center"},D=l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"},null,-1),F=[D],H={class:"relative flex gap-x-3 mt-4 col-span-2"},J={class:"flex items-center"},K=l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"},null,-1),G=[K],I={class:"mt-1 flex items-center justify-end gap-x-6 md:w-2/3 pt-2"},Q={type:"button",class:"text-sm leading-6 text-gray-900"},X=["disabled"],Y={key:0,xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24"},ee=l("path",{fill:"currentColor",d:"M12 2A10 10 0 1 0 22 12A10 10 0 0 0 12 2Zm0 18a8 8 0 1 1 8-8A8 8 0 0 1 12 20Z",opacity:".5"},null,-1),oe=l("path",{fill:"currentColor",d:"M20 12h2A10 10 0 0 0 12 2V4A8 8 0 0 1 20 12Z"},[l("animateTransform",{attributeName:"transform",dur:"1s",from:"0 12 12",repeatCount:"indefinite",to:"360 12 12",type:"rotate"})],-1),se=[ee,oe],re={key:1},Ve={__name:"Email",props:{config:{type:Object,required:!0}},setup(y){const w=y,c=t=>{const s=w.config.find(r=>r.key===t);return s?s.value:""},n=t=>{const s=JSON.parse(c("mail_config"));return s!==null&&typeof s=="object"&&!Array.isArray(s)?s[t]??null:null},f=k(!1),e=h({mail_config:{driver:n("driver")??void 0,from_address:n("from_address")??void 0,from_name:n("from_name")??void 0,reply_to_name:n("reply_to_name")??void 0,reply_to_address:n("reply_to_address")??void 0,mg_domain:n("mg_domain")??void 0,mg_secret:n("mg_secret")??void 0,ses_key:n("ses_key")??void 0,ses_secret:n("ses_secret")??void 0,ses_region:n("ses_region")??void 0,port:n("port")??void 0,host:n("host")??void 0,username:n("username")??void 0,password:n("password")??void 0,mail_config:n("password")??void 0},smtp_email_active:c("smtp_email_active")==="1",verify_email:c("verify_email")==="1"}),V=[{label:"SMTP",value:"smtp"},{label:"Mailgun",value:"mailgun"},{label:"Amazon SES",value:"ses"}],g=()=>{e.smtp_email_active=!e.smtp_email_active},v=()=>{e.verify_email=!e.verify_email},b=async()=>{e.put("/admin/settings?type=email",{preserveScroll:!0})};return(t,s)=>(d(),x(M,null,{default:$(()=>[l("div",null,[l("h2",S,u(t.$t("Mailer settings")),1),l("p",A,[j,l("span",B,u(t.$t("Configure email accounts")),1)])]),l("form",{onSubmit:s[18]||(s[18]=C(r=>b(),["prevent"]))},[l("div",N,[l("div",Z,[l("div",E,[l("div",L,[a(U,{modelValue:o(e).mail_config.driver,"onUpdate:modelValue":s[0]||(s[0]=r=>o(e).mail_config.driver=r),name:t.$t("Method"),type:"text",options:V,class:i("col-span-2")},null,8,["modelValue","name"])]),o(e).mail_config.driver==="mailgun"?(d(),p("div",P,[a(m,{modelValue:o(e).mail_config.mg_domain,"onUpdate:modelValue":s[1]||(s[1]=r=>o(e).mail_config.mg_domain=r),error:o(e).errors["mail_config.mg_domain"],name:t.$t("Mailgun domain"),type:"text",class:i("col-span-1")},null,8,["modelValue","error","name"]),a(m,{modelValue:o(e).mail_config.mg_secret,"onUpdate:modelValue":s[2]||(s[2]=r=>o(e).mail_config.mg_secret=r),error:o(e).errors["mail_config.mg_secret"],name:t.$t("Mailgun secret"),type:"text",class:i("col-span-1")},null,8,["modelValue","error","name"])])):o(e).mail_config.driver==="ses"?(d(),p("div",R,[a(m,{modelValue:o(e).mail_config.ses_key,"onUpdate:modelValue":s[3]||(s[3]=r=>o(e).mail_config.ses_key=r),error:o(e).errors["mail_config.ses_key"],name:t.$t("AWS access key id"),type:"text",class:i("col-span-1")},null,8,["modelValue","error","name"]),a(m,{modelValue:o(e).mail_config.ses_secret,"onUpdate:modelValue":s[4]||(s[4]=r=>o(e).mail_config.ses_secret=r),error:o(e).errors["mail_config.ses_secret"],name:t.$t("AWS secret access key"),type:"text",class:i("col-span-1")},null,8,["modelValue","error","name"]),a(m,{modelValue:o(e).mail_config.ses_region,"onUpdate:modelValue":s[5]||(s[5]=r=>o(e).mail_config.ses_region=r),error:o(e).errors["mail_config.ses_region"],name:t.$t("AWS default region"),type:"text",class:i("col-span-2")},null,8,["modelValue","error","name"])])):o(e).mail_config.driver==="smtp"?(d(),p("div",T,[a(m,{modelValue:o(e).mail_config.host,"onUpdate:modelValue":s[6]||(s[6]=r=>o(e).mail_config.host=r),error:o(e).errors["mail_config.host"],name:t.$t("Host"),type:"text",class:i("col-span-1")},null,8,["modelValue","error","name"]),a(m,{modelValue:o(e).mail_config.port,"onUpdate:modelValue":s[7]||(s[7]=r=>o(e).mail_config.port=r),error:o(e).errors["mail_config.port"],name:t.$t("Port"),type:"text",class:i("col-span-1")},null,8,["modelValue","error","name"]),a(m,{modelValue:o(e).mail_config.username,"onUpdate:modelValue":s[8]||(s[8]=r=>o(e).mail_config.username=r),error:o(e).errors["mail_config.username"],name:t.$t("Username"),type:"text",class:i("col-span-1")},null,8,["modelValue","error","name"]),a(m,{modelValue:o(e).mail_config.password,"onUpdate:modelValue":s[9]||(s[9]=r=>o(e).mail_config.password=r),error:o(e).errors["mail_config.password"],name:t.$t("Password"),type:"password",class:i("col-span-1")},null,8,["modelValue","error","name"])])):_("",!0),l("div",W,[a(m,{modelValue:o(e).mail_config.from_name,"onUpdate:modelValue":s[10]||(s[10]=r=>o(e).mail_config.from_name=r),name:t.$t("Mail from name"),error:o(e).errors["mail_config.from_name"],type:"text",class:i("col-span-1")},null,8,["modelValue","name","error"]),a(m,{modelValue:o(e).mail_config.from_address,"onUpdate:modelValue":s[11]||(s[11]=r=>o(e).mail_config.from_address=r),name:t.$t("Mail from address"),error:o(e).errors["mail_config.from_address"],type:"email",class:i("col-span-1")},null,8,["modelValue","name","error"]),a(m,{modelValue:o(e).mail_config.reply_to_name,"onUpdate:modelValue":s[12]||(s[12]=r=>o(e).mail_config.reply_to_name=r),name:t.$t("Reply to name"),error:o(e).errors["mail_config.reply_to_name"],type:"text",class:i("col-span-1")},null,8,["modelValue","name","error"]),a(m,{modelValue:o(e).mail_config.reply_to_address,"onUpdate:modelValue":s[13]||(s[13]=r=>o(e).mail_config.reply_to_address=r),name:t.$t("Reply to address"),error:o(e).errors["mail_config.reply_to_address"],type:"email",class:i("col-span-1")},null,8,["modelValue","name","error"])]),l("div",q,[l("div",z,[l("div",O,[l("label",{onClick:s[14]||(s[14]=r=>g()),for:"myCheckbox",class:"cursor-pointer"},[l("div",{class:i(["w-4 h-4 border border-gray-400 rounded-md flex items-center justify-center",o(e).smtp_email_active?"bg-[#000]":""])},[o(e).smtp_email_active?(d(),p("svg",{key:0,class:i(["w-4 h-4",o(e).smtp_email_active?"text-white":""]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},F,2)):_("",!0)],2)]),l("span",{onClick:s[15]||(s[15]=r=>g()),class:"ml-2 text-[14px] cursor-pointer"},u(t.$t("Activate email")),1)])]),l("div",H,[l("div",J,[l("label",{onClick:s[16]||(s[16]=r=>v()),for:"myCheckbox",class:"cursor-pointer"},[l("div",{class:i(["w-4 h-4 border border-gray-400 rounded-md flex items-center justify-center",{"bg-[#000]":o(e).verify_email}])},[o(e).verify_email?(d(),p("svg",{key:0,class:i(["w-4 h-4",o(e).verify_email?"text-white":""]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},G,2)):_("",!0)],2)]),l("span",{onClick:s[17]||(s[17]=r=>v()),class:"ml-2 text-[14px] cursor-pointer"},u(t.$t("Require email verification for new accounts")),1)])])]),l("div",I,[l("button",Q,u(t.$t("Cancel")),1),l("button",{class:i(["inline-flex justify-center rounded-md border border-transparent bg-primary px-4 py-2 text-sm text-white focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2",{"opacity-50":f.value}]),disabled:f.value},[f.value?(d(),p("svg",Y,se)):(d(),p("span",re,u(t.$t("Save")),1))],10,X)])])])])],32)]),_:1}))}};export{Ve as default};