module.exports=[66014,a=>{"use strict";var b=a.i(20373),c=a.i(15704),d=a.i(46001);function e(){let a=(0,d.useRouter)(),[e,f]=(0,c.useState)(!1),[g,h]=(0,c.useState)({type:"",text:""}),[i,j]=(0,c.useState)({oldPassword:"",newPassword:"",confirmPassword:""}),k=a=>{j({...i,[a.target.name]:a.target.value})},l=async a=>{if(a.preventDefault(),h({type:"",text:""}),i.newPassword!==i.confirmPassword)return void h({type:"error",text:"Yeni şifreler eşleşmiyor"});f(!0);try{let a=await fetch("/api/auth/change-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({oldPassword:i.oldPassword,newPassword:i.newPassword})}),b=await a.json();a.ok?(h({type:"success",text:"Şifreniz başarıyla güncellendi."}),j({oldPassword:"",newPassword:"",confirmPassword:""})):h({type:"error",text:b.error||"Bir hata oluştu"})}catch(a){h({type:"error",text:"Bağlantı hatası"})}finally{f(!1)}};return(0,b.jsxs)("div",{className:"max-w-2xl mx-auto p-6",children:[(0,b.jsxs)("div",{className:"mb-6 flex items-center justify-between",children:[(0,b.jsx)("h1",{className:"text-2xl font-bold text-gray-800",children:"Hesap Ayarları"}),(0,b.jsx)("button",{onClick:()=>a.back(),className:"text-gray-500 hover:text-gray-700 font-medium",children:"← Geri Dön"})]}),(0,b.jsxs)("div",{className:"bg-white rounded-xl shadow-sm border border-gray-100 overflow-hidden",children:[(0,b.jsx)("div",{className:"px-6 py-4 border-b border-gray-100 bg-[#0082ca]",children:(0,b.jsx)("h2",{className:"text-lg font-semibold text-white",children:"Şifre Değiştir"})}),(0,b.jsxs)("div",{className:"p-6",children:[g.text&&(0,b.jsx)("div",{className:`p-4 mb-4 rounded-lg ${"success"===g.type?"bg-green-50 text-green-700":"bg-red-50 text-red-700"}`,children:g.text}),(0,b.jsxs)("form",{onSubmit:l,className:"space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Mevcut Şifre"}),(0,b.jsx)("input",{type:"password",name:"oldPassword",value:i.oldPassword,onChange:k,required:!0,className:"w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 outline-none transition-all",placeholder:"******"})]}),(0,b.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Yeni Şifre"}),(0,b.jsx)("input",{type:"password",name:"newPassword",value:i.newPassword,onChange:k,required:!0,minLength:6,className:"w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 outline-none transition-all",placeholder:"En az 6 karakter"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Yeni Şifre (Tekrar)"}),(0,b.jsx)("input",{type:"password",name:"confirmPassword",value:i.confirmPassword,onChange:k,required:!0,minLength:6,className:"w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 outline-none transition-all",placeholder:"Şifreyi tekrar girin"})]})]}),(0,b.jsx)("div",{className:"pt-4 flex justify-end",children:(0,b.jsx)("button",{type:"submit",disabled:e,className:"bg-[#0082ca] hover:bg-[#006bb3] text-white px-6 py-2 rounded-lg font-medium transition-colors disabled:opacity-50 flex items-center",children:e?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("svg",{className:"animate-spin -ml-1 mr-2 h-4 w-4 text-white",fill:"none",viewBox:"0 0 24 24",children:[(0,b.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,b.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Güncelleniyor..."]}):"Şifreyi Güncelle"})})]})]})]})]})}a.s(["default",()=>e])}];

//# sourceMappingURL=Documents_koruyucu-izin-sistemi_app_dashboard_settings_page_tsx_b39c025e._.js.map