1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4520],{3430:(e,t,s)=>{Promise.resolve().then(s.bind(s,34664))},14186:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(19946).A)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]])},19946:(e,t,s)=>{"use strict";s.d(t,{A:()=>d});var r=s(12115);let a=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),l=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,s)=>s?s.toUpperCase():t.toLowerCase()),n=e=>{let t=l(e);return t.charAt(0).toUpperCase()+t.slice(1)},i=function(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return t.filter((e,t,s)=>!!e&&""!==e.trim()&&s.indexOf(e)===t).join(" ").trim()},c=e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0};var m={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let o=(0,r.forwardRef)((e,t)=>{let{color:s="currentColor",size:a=24,strokeWidth:l=2,absoluteStrokeWidth:n,className:o="",children:d,iconNode:x,...u}=e;return(0,r.createElement)("svg",{ref:t,...m,width:a,height:a,stroke:s,strokeWidth:n?24*Number(l)/Number(a):l,className:i("lucide",o),...!d&&!c(u)&&{"aria-hidden":"true"},...u},[...x.map(e=>{let[t,s]=e;return(0,r.createElement)(t,s)}),...Array.isArray(d)?d:[d]])}),d=(e,t)=>{let s=(0,r.forwardRef)((s,l)=>{let{className:c,...m}=s;return(0,r.createElement)(o,{ref:l,iconNode:t,className:i("lucide-".concat(a(n(e))),"lucide-".concat(e),c),...m})});return s.displayName=n(e),s}},34664:(e,t,s)=>{"use strict";s.d(t,{default:()=>h});var r=s(95155),a=s(12115),l=s(35695),n=s(6874),i=s.n(n),c=s(14186),m=s(78749),o=s(92657),d=s(40283),x=s(66766);function u(e){let{email:t,onVerify:s,onResend:l,onBack:n,loading:i,error:c,resendSuccess:m}=e,[o,d]=(0,a.useState)(["","","","","",""]),[x,u]=(0,a.useState)(!1),[h,f]=(0,a.useState)(300),g=(0,a.useRef)([]);(0,a.useEffect)(()=>{g.current=g.current.slice(0,6)},[]),(0,a.useEffect)(()=>{let e=o.join("");6!==e.length||i||x||(u(!0),s(e)),e.length<6&&x&&u(!1)},[o,i,x,s]),(0,a.useEffect)(()=>{let e=setInterval(()=>{f(t=>t<=1?(clearInterval(e),0):t-1)},1e3);return()=>clearInterval(e)},[]);let b=(e,t)=>{if(t&&!/^\d+$/.test(t))return;let s=[...o];if(s[e]=t.slice(0,1),d(s),t&&e<5){var r;null==(r=g.current[e+1])||r.focus()}},p=(e,t)=>{var s,r,a;"Backspace"===t.key?!o[e]&&e>0&&(null==(s=g.current[e-1])||s.focus()):"ArrowLeft"===t.key&&e>0?null==(r=g.current[e-1])||r.focus():"ArrowRight"===t.key&&e<5&&(null==(a=g.current[e+1])||a.focus())};return(0,r.jsxs)("div",{className:"w-full max-w-md mx-auto p-4 sm:p-6",children:[(0,r.jsxs)("div",{className:"text-center mb-4 sm:mb-6",children:[(0,r.jsx)("h1",{className:"text-xl sm:text-2xl font-bold text-gray-900",children:"Check your email"}),(0,r.jsxs)("p",{className:"text-gray-600 mt-2 text-sm sm:text-base",children:["Enter the code sent to ",t]})]}),(0,r.jsx)("p",{className:"text-center text-gray-600 text-xs sm:text-sm mb-4 sm:mb-6",children:"You can paste the full 6-digit code or enter digits individually"}),(0,r.jsx)("div",{className:"text-center mb-4 sm:mb-6",children:(0,r.jsxs)("div",{className:"flex items-center justify-center",children:[(0,r.jsx)("span",{className:"text-gray-700 text-sm sm:text-base",children:"OTP valid for: "}),(0,r.jsx)("span",{className:"ml-2 font-medium ".concat(h<60?"text-red-500":"text-green-500"),children:(()=>{let e=Math.floor(h/60);return"".concat(e.toString().padStart(2,"0"),":").concat((h%60).toString().padStart(2,"0"))})()})]})}),c&&(0,r.jsx)("div",{className:"mb-4 sm:mb-6 p-3 sm:p-4 bg-red-50 border border-red-200 rounded-md text-red-600 text-xs sm:text-sm",children:c}),m&&(0,r.jsx)("div",{className:"mb-4 sm:mb-6 p-3 sm:p-4 bg-green-50 border border-green-200 rounded-md text-green-600 text-xs sm:text-sm",children:"A new verification code has been sent to your email."}),(0,r.jsxs)("form",{onSubmit:e=>{e.preventDefault();let t=o.join("");6===t.length&&s(t)},children:[(0,r.jsx)("div",{className:"flex justify-center space-x-1 sm:space-x-2 mb-4 sm:mb-6",onPaste:e=>{e.preventDefault();let t=e.clipboardData.getData("text");if(/^\d{6}$/.test(t)){var s;d(t.split("")),null==(s=g.current[5])||s.focus()}},children:[0,1,2,3,4,5].map(e=>(0,r.jsx)("div",{className:"w-9 h-10 sm:w-12 sm:h-12",children:(0,r.jsx)("input",{ref:t=>{g.current[e]=t},type:"text",maxLength:1,value:o[e],onChange:t=>b(e,t.target.value),onKeyDown:t=>p(e,t),className:"w-full h-full text-center text-lg sm:text-xl font-medium border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",required:!0})},e))}),(0,r.jsx)("button",{type:"submit",disabled:i||6!==o.join("").length||0===h,className:"w-full bg-blue-500 hover:bg-blue-600 disabled:bg-blue-400 text-white font-medium py-2 sm:py-3 px-4 roun
1ded-lg transition-colors text-sm sm:text-base",children:i?"Verifying...":"Verify"})]}),(0,r.jsxs)("div",{className:"mt-4 sm:mt-6 text-center",children:[(0,r.jsx)("p",{className:"text-gray-600 mb-2 text-xs sm:text-sm",children:"Can't find the email? Check your spam folder."}),(0,r.jsx)("button",{type:"button",onClick:l,disabled:i||h>0,className:"text-blue-500 hover:text-blue-600 disabled:text-blue-300 text-xs sm:text-sm font-medium",children:"Request new code"})]}),(0,r.jsx)("div",{className:"text-center mt-3 sm:mt-4",children:(0,r.jsx)("p",{className:"text-gray-500 text-xs sm:text-sm",children:"The OTP code will be valid for 5 minutes."})}),(0,r.jsx)("div",{className:"text-center mt-4 sm:mt-6",children:(0,r.jsx)("button",{type:"button",onClick:n,className:"text-gray-500 hover:text-gray-600 text-xs sm:text-sm",children:"Back to login"})})]})}function h(){let[e,t]=(0,a.useState)(""),[s,n]=(0,a.useState)(""),[h,f]=(0,a.useState)(!1),[g,b]=(0,a.useState)(""),[p,y]=(0,a.useState)(!1),[v,j]=(0,a.useState)(!1),[N,w]=(0,a.useState)(null),[k,P]=(0,a.useState)(!1),[S,A]=(0,a.useState)(!1),{login:C,verifyOTP:T,resendOTP:E}=(0,d.A)(),O=(0,l.useRouter)(),R=(0,l.useSearchParams)();(0,a.useEffect)(()=>{if("inactivity"===R.get("reason")){A(!0);let e=setTimeout(()=>{A(!1)},1e4);return()=>clearTimeout(e)}},[R]);let L=async t=>{t.preventDefault(),b(""),y(!0);try{console.log("Login: Submitting credentials");let t=await C(e,s);if(t.success)if(t.requiresPasswordChange&&t.user){let e=new URLSearchParams({email:t.user.email,firstName:t.user.firstName,lastName:t.user.lastName});O.push("/first-login-password-change?".concat(e.toString()))}else t.requiresOTP&&t.user&&(console.log("Login: OTP verification required, showing OTP form"),w(t.user),j(!0));else console.log("Login: Failed",t.error),b(t.error||"Login failed")}catch(e){console.error("Login: Error",e),b(e.message||"Login failed")}finally{y(!1)}},q=async t=>{b(""),y(!0);try{console.log("OTP: Submitting verification code");let s=await T(e,t);console.log("OTP: Result received",s),s.success||(console.log("OTP: Verification failed",s.error),b(s.error||"OTP verification failed"))}catch(e){console.error("OTP: Error",e),b(e.message||"OTP verification failed")}finally{y(!1)}},F=async()=>{b(""),P(!1),y(!0);try{let t=await E(e);t.success?P(!0):b(t.error||"Failed to resend OTP")}catch(e){b(e.message||"Failed to resend OTP")}finally{y(!1)}};return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("div",{className:"min-h-screen flex flex-col lg:flex-row",children:[(0,r.jsxs)("div",{className:"flex-1 bg-white flex flex-col min-h-screen lg:min-h-0",children:[(0,r.jsx)("div",{className:"flex-1 flex items-center justify-center py-6 px-4 sm:py-12 sm:px-8",children:(0,r.jsxs)("div",{className:"max-w-md w-full space-y-6 sm:space-y-8",children:[(0,r.jsx)("div",{className:"text-center",children:(0,r.jsxs)("div",{className:"flex items-center justify-center space-x-2 sm:space-x-3 mb-6 sm:mb-8",children:[(0,r.jsxs)("div",{className:"w-10 h-10 sm:w-12 sm:h-12 relative flex-shrink-0",children:[(0,r.jsx)(x.default,{src:"/rwanda-coat-of-arms.png",alt:"Rwanda Coat of Arms",width:48,height:48,sizes:"(max-width: 640px) 40px, 48px",className:"object-contain",onError:e=>{e.currentTarget.style.display="none";let t=e.currentTarget.nextElementSibling;t&&(t.style.display="flex")}}),(0,r.jsx)("div",{className:"w-10 h-10 sm:w-12 sm:h-12 bg-green-600 rounded-full flex items-center justify-center hidden",children:(0,r.jsx)("span",{className:"text-white font-bold text-xs sm:text-sm",children:"RW"})})]}),(0,r.jsxs)("div",{className:"text-left",children:[(0,r.jsx)("h1",{className:"text-lg sm:text-xl font-bold text-gray-900",children:"Ministry of Health"}),(0,r.jsx)("p",{className:"text-xs sm:text-sm text-gray-600",children:"Services Portal"})]})]})}),(0,r.jsx)("div",{children:v?(0,r.jsx)(u,{email:e,onVerify:q,onResend:F,onBack:()=>{j(!1),b(""),P(!1)},loading:p,error:g,resendSuccess:k}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"mb-6 sm:mb-8",children:[(0,r.jsx)("h2",{className:"text-xl sm:text-2xl font-bold text-gray-900 mb-2 sm:mb-3 text-center",children:"Sign In"}),(0,r.jsx)("p",{className:"text-gray-600 text-xs sm:text-sm",children:"Welcome! Please enter your credentials to get started."})]}),S&&(0,r.jsxs)("div",{className:"mb-4 sm:mb-6 p-4 bg-blue-50 border border-blue-200 rounded-md flex items-start gap-3 animate-fade-in",children:[(0,r.jsx)(c.A,{className:"h-5 w-5 text-blue-600 mt-0.5 flex-shrink-0"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"text-sm font-medium text-blue-900",children:"Session expired"}),(0,r.jsx)("p",{className:"text-xs text-blue-700 mt-1",children:"You have been logged out due to inactivity. Please sign in again to continue."})]})]}),g&&(0,r.jsx)("div",{className:"mb-4 sm:mb-6 p-3 sm:p-4 bg-red-50 border border-red-200 rounded-md text-red-600 text-xs sm:text-sm",children:g}
1),(0,r.jsxs)("form",{onSubmit:L,className:"space-y-4 sm:space-y-6",children:[(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{className:"block text-xs sm:text-sm font-medium text-gray-700 mb-1 sm:mb-2",children:["Email ",(0,r.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,r.jsx)("input",{type:"email",value:e,onChange:e=>t(e.target.value),placeholder:"[email protected]",className:"w-full px-3 sm:px-4 py-2 sm:py-3 text-sm sm:text-base border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 placeholder-gray-400",required:!0})]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{className:"block text-xs sm:text-sm font-medium text-gray-700 mb-1 sm:mb-2",children:["Password ",(0,r.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("input",{type:h?"text":"password",value:s,onChange:e=>n(e.target.value),placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢â¢â¢",className:"w-full px-3 sm:px-4 py-2 sm:py-3 text-sm sm:text-base border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 placeholder-gray-400 pr-10 sm:pr-12",required:!0}),(0,r.jsx)("button",{type:"button",onClick:()=>f(!h),className:"absolute inset-y-0 right-0 pr-3 sm:pr-4 flex items-center text-gray-400 hover:text-gray-600",children:h?(0,r.jsx)(m.A,{className:"h-4 w-4 sm:h-5 sm:w-5"}):(0,r.jsx)(o.A,{className:"h-4 w-4 sm:h-5 sm:w-5"})})]})]}),(0,r.jsx)("div",{className:"pt-2 sm:pt-4",children:(0,r.jsx)("button",{type:"submit",disabled:p,className:"w-full bg-blue-600 hover:bg-blue-700 disabled:bg-blue-400 text-white font-medium py-2 sm:py-3 px-4 rounded-lg transition-colors text-sm sm:text-base",children:p?"Signing In...":"Sign In"})}),(0,r.jsx)("div",{className:"text-center mt-3 sm:mt-4",children:(0,r.jsx)(i(),{href:"/forgot-password",className:"text-blue-600 hover:text-blue-700 text-xs sm:text-sm font-medium",children:"Forgot your password?"})})]})]})})]})}),(0,r.jsx)("footer",{className:"w-full py-8 sm:py-10 text-center text-sm text-[#6b7c8f]",children:"\xa9 2026 Ministry of Health. All rights reserved."})]}),(0,r.jsx)("div",{className:"hidden lg:flex flex-1 bg-blue-700 items-center justify-center px-6 py-8 text-center",children:(0,r.jsxs)("div",{className:"max-w-md",children:[(0,r.jsx)("h1",{className:"text-3xl font-bold text-white mb-4 leading-tight",children:"Ministry of Health Services Portal"}),(0,r.jsx)("p",{className:"text-white text-lg leading-relaxed opacity-90",children:"Access comprehensive services including Performance-Based Financing (PBF) evaluations, Transport Request management, and Travel Clearance processing to streamline ministry operations."})]})})]})})}},35695:(e,t,s)=>{"use strict";var r=s(18999);s.o(r,"useParams")&&s.d(t,{useParams:function(){return r.useParams}}),s.o(r,"usePathname")&&s.d(t,{usePathname:function(){return r.usePathname}}),s.o(r,"useRouter")&&s.d(t,{useRouter:function(){return r.useRouter}}),s.o(r,"useSearchParams")&&s.d(t,{useSearchParams:function(){return r.useSearchParams}})},78749:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(19946).A)("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]])},92657:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(19946).A)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])}},e=>{var t=t=>e(e.s=t);e.O(0,[6874,6766,283,8441,1684,7358],()=>t(3430)),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.