(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,43791,e=>{"use strict";var r=e.i(36703),s=e.i(2286),t=e.i(19140);function a(){let e=(0,t.useRouter)(),[a,l]=(0,s.useState)(!1),[i,o]=(0,s.useState)({type:"",text:""}),[n,d]=(0,s.useState)({oldPassword:"",newPassword:"",confirmPassword:""}),c=e=>{d({...n,[e.target.name]:e.target.value})},u=async e=>{if(e.preventDefault(),o({type:"",text:""}),n.newPassword!==n.confirmPassword)return void o({type:"error",text:"Yeni şifreler eşleşmiyor"});l(!0);try{let e=await fetch("/api/auth/change-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({oldPassword:n.oldPassword,newPassword:n.newPassword})}),r=await e.json();e.ok?(o({type:"success",text:"Şifreniz başarıyla güncellendi."}),d({oldPassword:"",newPassword:"",confirmPassword:""})):o({type:"error",text:r.error||"Bir hata oluştu"})}catch(e){o({type:"error",text:"Bağlantı hatası"})}finally{l(!1)}};return(0,r.jsxs)("div",{className:"max-w-2xl mx-auto p-6",children:[(0,r.jsxs)("div",{className:"mb-6 flex items-center justify-between",children:[(0,r.jsx)("h1",{className:"text-2xl font-bold text-gray-800",children:"Hesap Ayarları"}),(0,r.jsx)("button",{onClick:()=>e.back(),className:"text-gray-500 hover:text-gray-700 font-medium",children:"← Geri Dön"})]}),(0,r.jsxs)("div",{className:"bg-white rounded-xl shadow-sm border border-gray-100 overflow-hidden",children:[(0,r.jsx)("div",{className:"px-6 py-4 border-b border-gray-100 bg-[#0082ca]",children:(0,r.jsx)("h2",{className:"text-lg font-semibold text-white",children:"Şifre Değiştir"})}),(0,r.jsxs)("div",{className:"p-6",children:[i.text&&(0,r.jsx)("div",{className:`p-4 mb-4 rounded-lg ${"success"===i.type?"bg-green-50 text-green-700":"bg-red-50 text-red-700"}`,children:i.text}),(0,r.jsxs)("form",{onSubmit:u,className:"space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Mevcut Şifre"}),(0,r.jsx)("input",{type:"password",name:"oldPassword",value:n.oldPassword,onChange:c,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,r.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Yeni Şifre"}),(0,r.jsx)("input",{type:"password",name:"newPassword",value:n.newPassword,onChange:c,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,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Yeni Şifre (Tekrar)"}),(0,r.jsx)("input",{type:"password",name:"confirmPassword",value:n.confirmPassword,onChange:c,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,r.jsx)("div",{className:"pt-4 flex justify-end",children:(0,r.jsx)("button",{type:"submit",disabled:a,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:a?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("svg",{className:"animate-spin -ml-1 mr-2 h-4 w-4 text-white",fill:"none",viewBox:"0 0 24 24",children:[(0,r.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,r.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"})})]})]})]})]})}e.s(["default",()=>a])}]);