(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2955],{3887:function(e,r,n){Promise.resolve().then(n.bind(n,8992))},8992:function(e,r,n){"use strict";n.r(r),n.d(r,{default:function(){return i}});var s=n(7437),t=n(2265),a=n(9376),u=n(8706),o=n(6175);function i(){let[e,r]=(0,t.useState)(""),[n,i]=(0,t.useState)("+355"),[d,l]=(0,t.useState)(""),c=(0,a.useRouter)(),m=(0,u.T)(),[f,{isLoading:h}]=(0,o.s)();async function p(r){r.preventDefault(),l("");try{let r=await f({phone:n+e}).unwrap();r.success?c.push("/password/code-verification?phone=".concat(encodeURIComponent(n+e))):l(r.message||m("sms_error",{defaultValue:"Numri nuk u gjet. Provo perseri."}))}catch(e){l(m("generic_error",{defaultValue:"Ndodhi nje gabim."}))}}return(0,s.jsx)("div",{className:"min-h-[60vh] flex items-center justify-center px-4 py-12",children:(0,s.jsxs)("div",{className:"w-full max-w-md",children:[(0,s.jsx)("h1",{className:"text-2xl font-bold text-center mb-6",children:m("reset_password",{defaultValue:"Rivendos Fjalekalimin"})}),(0,s.jsxs)("div",{className:"bg-white rounded-xl p-8 shadow-sm",children:[(0,s.jsx)("p",{className:"text-gray-600 text-sm mb-6",children:m("reset_password_desc",{defaultValue:"Shkruaj numrin e telefonit dhe do te marresh nje kod verifikimi me SMS."})}),d&&(0,s.jsx)("div",{className:"bg-red-50 text-red-600 p-3 rounded-lg mb-4 text-sm",children:d}),(0,s.jsxs)("form",{onSubmit:p,className:"space-y-4",children:[(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsxs)("select",{value:n,onChange:e=>i(e.target.value),className:"border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-orange-500 outline-none",children:[(0,s.jsx)("option",{value:"+355",children:"+355"}),(0,s.jsx)("option",{value:"+383",children:"+383"}),(0,s.jsx)("option",{value:"+389",children:"+389"})]}),(0,s.jsx)("input",{type:"tel",value:e,onChange:e=>r(e.target.value),placeholder:m("phone_number",{defaultValue:"Numri i telefonit"}),required:!0,className:"flex-1 border border-gray-300 rounded-lg px-4 py-2 focus:ring-2 focus:ring-orange-500 focus:border-transparent outline-none"})]}),(0,s.jsx)("button",{type:"submit",disabled:h,className:"w-full bg-orange-500 hover:bg-orange-600 disabled:bg-orange-300 text-white font-semibold px-6 py-3 rounded-lg transition-colors",children:h?m("sending",{defaultValue:"Duke derguar..."}):m("send_code",{defaultValue:"Dergo Kodin"})})]})]})]})})}},9376:function(e,r,n){"use strict";var s=n(5475);n.o(s,"useParams")&&n.d(r,{useParams:function(){return s.useParams}}),n.o(s,"usePathname")&&n.d(r,{usePathname:function(){return s.usePathname}}),n.o(s,"useRouter")&&n.d(r,{useRouter:function(){return s.useRouter}}),n.o(s,"useSearchParams")&&n.d(r,{useSearchParams:function(){return s.useSearchParams}})},6175:function(e,r,n){"use strict";n.d(r,{$h:function(){return d},cv:function(){return a},er:function(){return u},oq:function(){return i},s:function(){return o}});var s=n(3557),t=n(9523);let a=(0,s.LC)({reducerPath:"miscApi",baseQuery:(0,t.ni)({baseUrl:"/"}),endpoints:e=>({registerFcmToken:e.mutation({query:e=>({url:"api/fcm",method:"POST",body:e})}),sendPasswordSms:e.mutation({query:e=>({url:"api/password/send-sms",method:"POST",body:e})}),verifyPasswordCode:e.mutation({query:e=>({url:"api/password/verify-code",method:"POST",body:e})}),changePassword:e.mutation({query:e=>({url:"api/password/change",method:"POST",body:e})})})}),{useRegisterFcmTokenMutation:u,useSendPasswordSmsMutation:o,useVerifyPasswordCodeMutation:i,useChangePasswordMutation:d}=a}},function(e){e.O(0,[8706,3557,2971,2117,1744],function(){return e(e.s=3887)}),_N_E=e.O()}]);