import{u as f,b as y,j as e}from"./vendor-BKmmeuxg.js";import{I as d}from"./input-error-LaPr_4wd.js";import{L as b}from"./loading-button-BnTVAMJ7.js";import{S as n}from"./switch-Db09nqXX.js";import{C as N}from"./card-D9_SJYq6.js";import{I as p}from"./input-DM0goJrn.js";import{L as l}from"./label-HmIcv5Yx.js";import{S as C,a as S,b as w,c as k,d as I}from"./select-CD9o3HN1.js";import{j as L}from"./utils-DxSsnXxD.js";import{o as x}from"./inertia-SZXqLvQm.js";import"./button-BpNwv2aE.js";import"./index-WW_1X1qx.js";import"./switch-DFFqeub-.js";const J=({payment:c})=>{const{props:h}=f(),{translate:u}=h,{settings:t,input:a,button:j,common:m}=u,{data:r,setData:o,post:_,errors:i,processing:g}=y({...c.fields,type:"sslcommerz"}),v=s=>{s.preventDefault(),_(route("settings.payment.update",{id:c.id}))};return e.jsxs(N,{className:"p-4 sm:p-6",children:[e.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-xl font-semibold",children:t.sslcommerz_settings}),e.jsx("p",{className:"text-gray-500",children:t.configure_payment_gateway.replace(":gateway","SSLCommerz")})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(l,{htmlFor:"status",children:r.active?m.enabled:m.disabled}),e.jsx(n,{id:"status",checked:r.active,onCheckedChange:s=>o("active",s)})]})]}),e.jsxs("form",{onSubmit:v,className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx(l,{children:a.currency}),e.jsxs(C,{value:r.currency,onValueChange:s=>o("currency",s),children:[e.jsx(S,{children:e.jsx(w,{placeholder:a.currency})}),e.jsx(k,{children:L.map(s=>e.jsxs(I,{value:s.value,children:[s.label," (",s.value,")"]},s.value))})]}),e.jsx(d,{message:i.currency})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsxs("span",{className:"text-sm font-medium",children:[t.test_mode,":"]}),e.jsx(n,{id:"status",checked:r.test_mode,onCheckedChange:s=>o("test_mode",s)}),e.jsx(l,{htmlFor:"status",className:"text-gray-500",children:r.test_mode?t.using_test_environment:t.using_live_environment})]})]}),e.jsxs("div",{className:"border-b pb-6",children:[e.jsx("h3",{className:"mb-4 text-lg font-medium",children:t.api_credentials}),e.jsxs("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx(l,{children:a.store_id}),e.jsx(p,{name:"store_id",value:r.store_id||"",onChange:s=>x(s,o),placeholder:a.store_id_placeholder}),e.jsx(d,{message:i.store_id}),e.jsx("p",{className:"mt-1 text-sm text-gray-500",children:r.test_mode?t.use_test_mode_key.replace(":key","store ID"):t.use_live_mode_key.replace(":key","store ID")})]}),e.jsxs("div",{children:[e.jsx(l,{children:a.store_password}),e.jsx(p,{name:"store_password",value:r.store_password||"",onChange:s=>x(s,o),placeholder:a.store_password_placeholder,type:"password"}),e.jsx(d,{message:i.store_password}),e.jsx("p",{className:"mt-1 text-sm text-gray-500",children:r.test_mode?t.use_test_mode_key.replace(":key","store password"):t.use_live_mode_key.replace(":key","store password")})]})]})]}),e.jsx(b,{loading:g,type:"submit",className:"w-full",children:j.save_changes})]})]})};export{J as default};