var L=Object.defineProperty;var g=Object.getOwnPropertySymbols;var I=Object.prototype.hasOwnProperty,D=Object.prototype.propertyIsEnumerable;var u=(l,m,t)=>m in l?L(l,m,{enumerable:!0,configurable:!0,writable:!0,value:t}):l[m]=t,v=(l,m)=>{for(var t in m||(m={}))I.call(m,t)&&u(l,t,m[t]);if(g)for(var t of g(m))D.call(m,t)&&u(l,t,m[t]);return l};import{jsxs as r,jsx as e}from"react/jsx-runtime";import{I as d}from"./input-error-BbsDx4-P.js";import{L as T}from"./loading-button-B_LaGOAp.js";import{a as j,L as p,as as f,at as b,au as S,av as x,aw as h,I as c}from"./ui-components-B24mpb8o.js";import{D as P}from"./layout-CZk01yM3.js";import{usePage as V,useForm as M}from"@inertiajs/react";import"lucide-react";import"react";import"next-themes";import"sonner";import"@radix-ui/react-label";import"class-variance-authority";import"@radix-ui/react-checkbox";import"@radix-ui/react-avatar";import"@radix-ui/react-dropdown-menu";import"@radix-ui/react-scroll-area";import"@radix-ui/react-popover";import"@radix-ui/react-radio-group";import"@radix-ui/react-dialog";import"@radix-ui/react-slot";import"clsx";import"@radix-ui/react-separator";import"@radix-ui/react-tooltip";import"@radix-ui/react-tabs";import"@radix-ui/react-accordion";import"@radix-ui/react-progress";import"@radix-ui/react-select";import"cmdk";import"@radix-ui/react-switch";import"react-day-picker";import"@radix-ui/react-slider";import"embla-carousel-react";import"@radix-ui/react-toggle-group";import"vaul";import"tailwind-merge";import"./main-Cv60h411.js";import"./theme-colors-CLpwvDr4.js";import"./appearance-zLWEcDPI.js";import"./language-79bZLpyc.js";import"./notification-BBQVVMqD.js";import"date-fns";import"./app-logo-CAnM-q9p.js";import"./route-D0xh7FtZ.js";import"./use-lang-Cw_jKJYs.js";const B=({smtp:l})=>{const{props:m}=V(),{translate:t}=m,{settings:_,input:i,button:y}=t,{data:o,setData:s,post:C,errors:n,processing:N}=M(v({},l.fields)),w=a=>{a.preventDefault(),C(route("settings.smtp.update",{id:l.id}))};return r("div",{className:"md:px-3",children:[r("div",{className:"mb-6",children:[e("h1",{className:"text-2xl font-bold",children:_.smtp_settings}),e("p",{className:"text-gray-500",children:_.email_settings_description})]}),e(j,{className:"p-4 sm:p-6",children:r("form",{onSubmit:w,className:"space-y-6",children:[r("div",{className:"border-b pb-6",children:[e("h2",{className:"mb-4 text-xl font-semibold",children:i.mail_driver}),r("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-2",children:[r("div",{children:[r(p,{children:[i.mail_driver," *"]}),r(f,{value:o.mail_mailer,onValueChange:a=>s("mail_mailer",a),children:[e(b,{children:e(S,{placeholder:i.select_option})}),e(x,{children:e(h,{value:"smtp",children:"SMTP"})})]}),e(d,{message:n.mail_mailer})]}),r("div",{children:[r(p,{children:[i.mail_host," *"]}),e(c,{name:"mail_host",value:o.mail_host||"",onChange:a=>s(a.target.name,a.target.value),placeholder:i.mail_host_placeholder}),e(d,{message:n.mail_host})]}),r("div",{children:[r(p,{children:[i.mail_port," *"]}),e(c,{name:"mail_port",value:o.mail_port||"",onChange:a=>s(a.target.name,a.target.value),placeholder:i.mail_port_placeholder}),e(d,{message:n.mail_port})]}),r("div",{children:[e(p,{children:i.mail_encryption}),r(f,{value:o.mail_encryption,onValueChange:a=>s("mail_encryption",a),children:[e(b,{children:e(S,{placeholder:i.select_option})}),r(x,{children:[e(h,{value:"tls",children:"TLS"}),e(h,{value:"ssl",children:"SSL"})]})]}),e(d,{message:n.mail_encryption})]}),r("div",{children:[r(p,{children:[i.mail_username," *"]}),e(c,{name:"mail_username",value:o.mail_username||"",onChange:a=>s(a.target.name,a.target.value),placeholder:i.mail_username_placeholder}),e(d,{message:n.mail_username})]}),r("div",{children:[r(p,{children:[i.mail_password," *"]}),e(c,{name:"mail_password",value:o.mail_password||"",onChange:a=>s(a.target.name,a.target.value),placeholder:i.mail_password_placeholder,type:"password"}),e(d,{message:n.mail_password})]}),r("div",{children:[r(p,{children:[i.mail_from_address," *"]}),e(c,{name:"mail_from_address",value:o.mail_from_address||"",onChange:a=>s(a.target.name,a.target.value),placeholder:i.mail_from_address_placeholder}),e(d,{message:n.mail_from_address})]}),r("div",{children:[r(p,{children:[i.mail_from_name," *"]}),e(c,{name:"mail_from_name",value:o.mail_from_name||"",onChange:a=>s(a.target.name,a.target.value),placeholder:i.mail_from_name_placeholder}),e(d,{message:n.mail_from_name})]})]})]}),e("div",{className:"flex items-center justify-end",children:e(T,{loading:N,children:y.save_changes})})]})})]})};B.layout=l=>e(P,{children:l});export{B as default};
