1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1250],{3018:function(e,t,a){a.d(t,{AuthBackground:function(){return N}});var s=a(7437),r=a(2265),o=a(1769),i=a(3327),n=a(5805),l=a(8736),c=a(8906),d=a(8997),u=a(3774),m=a(9202),h=a(44),p=a(9547),x=a(2961),g=a(3639);let b={elearning:[{Icon:o.Z,delay:0},{Icon:i.Z,delay:1},{Icon:n.Z,delay:2},{Icon:l.Z,delay:.5},{Icon:c.Z,delay:1.5},{Icon:d.Z,delay:2.5}],ohwr:[{Icon:u.Z,delay:0},{Icon:m.Z,delay:1},{Icon:h.Z,delay:2},{Icon:n.Z,delay:.5},{Icon:l.Z,delay:1.5},{Icon:p.Z,delay:2.5}],cohrm:[{Icon:x.Z,delay:0},{Icon:g.Z,delay:1},{Icon:c.Z,delay:2},{Icon:d.Z,delay:.5},{Icon:p.Z,delay:1.5},{Icon:u.Z,delay:2.5}],default:[{Icon:c.Z,delay:0},{Icon:d.Z,delay:1},{Icon:p.Z,delay:2},{Icon:n.Z,delay:.5},{Icon:o.Z,delay:1.5},{Icon:i.Z,delay:2.5}]},f={elearning:"bg-gradient-to-br from-blue-600 via-indigo-700 to-purple-800",ohwr:"bg-gradient-to-br from-emerald-600 via-teal-700 to-green-800",cohrm:"bg-gradient-to-br from-red-600 via-rose-700 to-orange-800",default:"bg-gradient-to-br from-blue-600 via-indigo-700 to-purple-800"},v={elearning:{fr:{badge:"OH E-Learning",title:"Formation One Health",subtitle:"Connectez-vous pour continuer",description:"Acc\xe9dez \xe0 vos cours, suivez votre progression et obtenez des certificats reconnus dans l'approche One Health.",stats:[{value:"50+",label:"Cours disponibles"},{value:"1000+",label:"Apprenants actifs"},{value:"100%",label:"Certifiant"}]},en:{badge:"OH E-Learning",title:"One Health Training",subtitle:"Sign in to continue",description:"Access your courses, track your progress and earn recognized certificates in the One Health approach.",stats:[{value:"50+",label:"Available courses"},{value:"1000+",label:"Active learners"},{value:"100%",label:"Certified"}]}},ohwr:{fr:{badge:"OHWR-Mapping",title:"Cartographie des Ressources",subtitle:"Connectez-vous pour continuer",description:"Explorez la cartographie interactive des experts, organisations, mat\xe9riels et documents One Health \xe0 travers les 10 r\xe9gions du Cameroun.",stats:[{value:"10",label:"R\xe9gions couvertes"},{value:"500+",label:"Experts r\xe9pertori\xe9s"},{value:"200+",label:"Organisations"}]},en:{badge:"OHWR-Mapping",title:"Resource Mapping",subtitle:"Sign in to continue",description:"Explore the interactive mapping of One Health experts, organizations, materials and documents across Cameroon's 10 regions.",stats:[{value:"10",label:"Regions covered"},{value:"500+",label:"Listed experts"},{value:"200+",label:"Organizations"}]}},cohrm:{fr:{badge:"COHRM-System",title:"Surveillance Sanitaire",subtitle:"Connectez-vous pour continuer",description:"Acc\xe9dez au syst\xe8me de gestion des rumeurs sanitaires One Health : signalement, v\xe9rification, \xe9valuation des risques et coordination de la r\xe9ponse.",stats:[{value:"24/7",label:"Veille sanitaire"},{value:"5",label:"Niveaux de validation"},{value:"10",label:"R\xe9gions surveill\xe9es"}]},en:{badge:"COHRM-System",title:"Health Surveillance",subtitle:"Sign in to continue",description:"Access the One Health rumor management system: reporting, verification, risk assessment and response coordination.",stats:[{value:"24/7",label:"Health monitoring"},{value:"5",label:"Validation levels"},{value:"10",label:"Regions monitored"}]}},default:{fr:{badge:"One Health Cameroun",title:"Bienvenue",subtitle:"Connectez-vous pour continuer",description:"Acc\xe9dez \xe0 l'ensemble des ressources de la plateforme One Health Cameroun : formations, cartographie, surveillance sanitaire.",stats:[{value:"50+",label:"Cours disponibles"},{value:"500+",label:"Experts r\xe9pertori\xe9s"},{value:"2500+",label:"Ressources"}]},en:{badge:"One Health Cameroon",title:"Welcome",subtitle:"Sign in to continue",description:"Access the full One Health Cameroon platform: training, resource mapping, health surveillance.",stats:[{value:"50+",label:"Available courses"},{value:"500+",label:"Listed experts"},{value:"2500+",label:"Resources"}]}}},y={fr:{badge:"One Health Cameroun",title:"Rejoignez-nous",subtitle:"Cr\xe9ez votre compte gratuitement",description:"Acc\xe9dez \xe0 des formations de qualit\xe9 sur l'approche One Health et obtenez des certificats reconnus.",stats:[{value:"50+",label:"Cours"},{value:"1000+",label:"Apprenants"},{value:"2500+",label:"Ressources"}]},en:{badge:"One Health Cameroon",title:"Join Us",subtitle:"Create your account for free",description:"Access quality training on the One Health approach and earn recognized certificates.",stats:[{value:"50+",label:"Courses"},{value:"1000+",label:"Learners"},{value:"2500+",label:"Resources"}]}};function N(e){let{lang:t,variant:a,redirectTo:o}=e,[i,n]=(0,r.useState)(!1);(0,r.useEffect)(()=>{n(!0)},[]);let l=o?o.includes("oh-elearning")?"elearning":o.includes("ohwr-mapping")?"ohwr":o.includes("cohrm")?"cohrm":o.includes("dashboard")?"elearning":"default":"default",c="login"===a,d=c?v[l][t]:y[t],u=b[l],m=c?f[l]:"bg-gradient-to-br from-emerald-600 via-teal-700 to-cyan-800";return(0,s.jsxs)("div",{className:"hidden lg:block relative w-0 flex-1 overflow-hidden",children:[(0,s.jsx)("div",{className:"absolute inset-0 ".concat(m)}),(0,s.jsxs)("div",{className:"absolute inset-0 overflow-hidden",children:[(0,s.jsx)("div",{className:"absolute -top-20 -right-20 w-96 h-96 rounded-full border-2 border-white/10 transition-all duration-1000 ".concat(i?"opacity-100 scale-100":"opacity-0 scale-50"),style:{animationDelay:"0s"}}),(0,s.jsx)("div",{className:"absolute -top-10 -right-10 w-80 h-80 rounded-full border border-white/20 transition-all duration-1000 delay-100 ".concat(i?"opacity-100 scale-100":"opacity-0 scale-50")}),(0,s.jsx)("div",{className:"absolute -bottom-32 -left-32 w-[500px] h-[500px] rounded-full border-2 border-white/10 transition-all duration-1000 delay-200 ".concat(i?"opacity-100 scale-100":"opacity-0 scale-50")}),(0,s.jsx)("div",{className:"absolute -bottom-20 -left-20 w-96 h-96 rounded-full border border-white/15 transition-all duration-1000 delay-300 ".concat(i?"opacity-100 scale-100":"opacity-0 scale-50")}),(0,s.jsx)("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2",children:(0,s.jsx)("div",{className:"w-[600px] h-[600px] rounded-full border border-white/10 animate-spin transition-opacity duration-1000 ".concat(i?"opacity-100":"opacity-0"),style:{animationDuration:"30s"}})}),(0,s.jsx)("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2",children:(0,s.jsx)("div",{className:"w-[450px] h-[450px] rounded-full border border-dashed border-white/20 animate-spin transition-opacity duration-1000 delay-200 ".concat(i?"opacity-100":"opacity-0"),style:{animationDuration:"25s",animationDirection:"reverse"}})}),(0,s.jsx)("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2",children:(0,s.jsx)("div",{className:"w-[300px] h-[300px] rounded-full border-2 border-white/10 animate-spin transition-opacity duration-1000 delay-300 ".concat(i?"opacity-100":"opacity-0"),style:{animationDuration:"20s"}})}),(0,s.jsx)("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2",children:(0,s.jsxs)("div",{className:"w-[450px] h-[450px] animate-spin",style:{animationDuration:"15s"},children:[(0,s.jsx)("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-3 h-3 bg-white/40 rounded-full"}),(0,s.jsx)("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-2 h-2 bg-white/30 rounded-full"}),(0,s.jsx)("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-4 h-4 bg-white/20 rounded-full"}),(0,s.jsx)("div",{className:"absolute right-0 top-1/2 -translate-y-1/2 w-2 h-2 bg-white/50 rounded-full"})]})}),u.map((e,t)=>{let{Icon:a,delay:r}=e;return(0,s.jsx)("div",{className:"absolute transition-all duration-1000 ".concat(i?"opacity-100 translate-y-0":"opacity-0 translate-y-10"),style:{to
1p:"".concat(15+13*t%70,"%"),left:"".concat(10+17*t%80,"%"),transitionDelay:"".concat(r,"s")},children:(0,s.jsx)("div",{className:"p-3 bg-white/10 backdrop-blur-sm rounded-2xl animate-bounce",style:{animationDuration:"".concat(3+.5*t,"s"),animationDelay:"".concat(r,"s")},children:(0,s.jsx)(a,{className:"w-6 h-6 text-white/70"})})},t)}),(0,s.jsx)("div",{className:"absolute top-20 right-40 w-32 h-32 bg-white/5 rounded-full blur-3xl transition-opacity duration-1000 ".concat(i?"opacity-100":"opacity-0")}),(0,s.jsx)("div",{className:"absolute bottom-40 left-20 w-40 h-40 bg-white/10 rounded-full blur-3xl transition-opacity duration-1000 delay-500 ".concat(i?"opacity-100":"opacity-0")})]}),(0,s.jsx)("div",{className:"absolute inset-0 flex items-center justify-center p-12 z-10",children:(0,s.jsxs)("div",{className:"text-center text-white max-w-lg transition-all duration-700 ".concat(i?"opacity-100 translate-y-0":"opacity-0 translate-y-8"),children:[(0,s.jsxs)("div",{className:"inline-flex items-center gap-2 px-4 py-2 rounded-full bg-white/10 backdrop-blur-sm border border-white/20 mb-6 transition-all duration-700 delay-100 ".concat(i?"opacity-100 scale-100":"opacity-0 scale-90"),children:[(0,s.jsx)("div",{className:"w-2 h-2 bg-green-400 rounded-full animate-pulse"}),(0,s.jsx)("span",{className:"text-sm font-medium",children:d.badge})]}),(0,s.jsx)("h2",{className:"text-5xl font-bold mb-3 transition-all duration-700 delay-200 ".concat(i?"opacity-100 translate-y-0":"opacity-0 translate-y-4"),children:d.title}),(0,s.jsx)("p",{className:"text-xl text-white/90 mb-4 transition-all duration-700 delay-300 ".concat(i?"opacity-100 translate-y-0":"opacity-0 translate-y-4"),children:d.subtitle}),(0,s.jsx)("p",{className:"text-white/70 mb-10 leading-relaxed transition-all duration-700 delay-400 ".concat(i?"opacity-100 translate-y-0":"opacity-0 translate-y-4"),children:d.description}),(0,s.jsx)("div",{className:"grid grid-cols-3 gap-4 transition-all duration-700 delay-500 ".concat(i?"opacity-100 translate-y-0":"opacity-0 translate-y-4"),children:d.stats.map((e,t)=>(0,s.jsxs)("div",{className:"relative group",children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-white/10 rounded-2xl blur-xl group-hover:bg-white/20 transition-all duration-300"}),(0,s.jsxs)("div",{className:"relative bg-white/10 backdrop-blur-sm rounded-2xl p-4 border border-white/20 hover:border-white/40 hover:bg-white/15 transition-all duration-300 cursor-default",children:[(0,s.jsx)("div",{className:"text-3xl font-bold mb-1",children:e.value}),(0,s.jsx)("div",{className:"text-xs text-white/70",children:e.label})]})]},t))}),(0,s.jsxs)("div",{className:"flex items-center justify-center gap-2 mt-10 transition-all duration-700 delay-700 ".concat(i?"opacity-100":"opacity-0"),children:[(0,s.jsx)("div",{className:"w-12 h-px bg-gradient-to-r from-transparent to-white/30"}),(0,s.jsx)("div",{className:"w-2 h-2 rounded-full bg-white/30"}),(0,s.jsx)("div",{className:"w-3 h-3 rounded-full bg-white/50"}),(0,s.jsx)("div",{className:"w-2 h-2 rounded-full bg-white/30"}),(0,s.jsx)("div",{className:"w-12 h-px bg-gradient-to-l from-transparent to-white/30"})]})]})})]})}},2693:function(e,t,a){a.d(t,{AuthGuard:function(){return l}});var s=a(7437),r=a(2265),o=a(9376),i=a(5863),n=a(4320);function l(e){let{children:t,lang:a,redirectTo:l}=e,{isAuthenticated:c,isLoading:d}=(0,n.aC)(),u=(0,o.useRouter)();return((0,r.useEffect)(()=>{if(!d&&!c){let e="/".concat(a,"/auth/login"),t=window.location.pathname,s=l||t;u.push("".concat(e,"?redirect=").concat(encodeURIComponent(s)))}},[c,d,u,a,l]),d)?(0,s.jsx)("div",{className:"min-h-screen flex items-center justify-center",children:(0,s.jsxs)("div",{className:"text-center",children:[(0,s.jsx)(i.Z,{className:"h-12 w-12 animate-spin text-oh-blue mx-auto"}),(0,s.jsx)("p",{className:"mt-4 text-gray-600",children:"fr"===a?"Chargement...":"Loading..."})]})}):c?(0,s.jsx)(s.Fragment,{children:t}):null}},330:function(e,t,a){a.d(t,{LoginForm:function(){return b}});var s=a(7437),r=a(2265),o=a(9376),i=a(7648),n=a(2252),l=a(6167),c=a(2431),d=a(9345),u=a(6337),m=a(7769),h=a(2208),p=a(5863),x=a(4320);let g={fr:{title:"Connexion",subtitle:"Connectez-vous \xe0 votre compte",email:"Email",emailPlaceholder:"[email protected]",password:"Mot de passe",passwordPlaceholder:"Votre mot de passe",rememberMe:"Se souvenir de moi",forgotPassword:"Mot de passe oubli\xe9 ?",login:"Se connecter",loggingIn:"Connexion...",noAccount:"Vous n'avez pas de compte ?",register:"S'inscrire",verification:{title:"Email non v\xe9rifi\xe9",message:"Veuillez v\xe9rifier votre email avant de vous connecter.",resend:"Renvoyer l'email de v\xe9rification",resending:"Envoi en cours...",resent:"Email envoy\xe9 ! V\xe9rifiez votre bo\xeete de r\xe9ception."},errors:{email:"Email invalide",password:"Le mot de passe est requis",invali
1dCredentials:"Identifiant ou mot de passe incorrect",accountDeactivated:"Ce compte a \xe9t\xe9 d\xe9sactiv\xe9",serverError:"Erreur de connexion au serveur"}},en:{title:"Login",subtitle:"Sign in to your account",email:"Email",emailPlaceholder:"[email protected]",password:"Password",passwordPlaceholder:"Your password",rememberMe:"Remember me",forgotPassword:"Forgot password?",login:"Sign in",loggingIn:"Signing in...",noAccount:"Don't have an account?",register:"Sign up",verification:{title:"Email not verified",message:"Please verify your email before logging in.",resend:"Resend verification email",resending:"Sending...",resent:"Email sent! Check your inbox."},errors:{email:"Invalid email",password:"Password is required",invalidCredentials:"Invalid email or password",accountDeactivated:"This account has been deactivated",serverError:"Server connection error"}}};function b(e){let{lang:t,redirectTo:a}=e,b=g[t],f=(0,o.useRouter)(),{login:v,resendVerification:y}=(0,x.aC)(),[N,w]=(0,r.useState)({email:"",password:"",rememberMe:!1}),[j,C]=(0,r.useState)(!1),[S,k]=(0,r.useState)({}),[P,Z]=(0,r.useState)(!1),[I,E]=(0,r.useState)(""),[z,O]=(0,r.useState)(!1),[A,R]=(0,r.useState)(""),[L,H]=(0,r.useState)(!1),[D,M]=(0,r.useState)(!1),T=()=>{let e={};return N.email&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(N.email)||(e.email=b.errors.email),N.password||(e.password=b.errors.password),k(e),0===Object.keys(e).length},q=async e=>{if(e.preventDefault(),E(""),O(!1),M(!1),T()){Z(!0);try{let e=await v(N.email,N.password);if(e.success){let e=a||"/".concat(t,"/dashboard");f.push(e)}else if(e.requiresVerification)O(!0),R(e.email||N.email);else{var s;let t=(null===(s=e.message)||void 0===s?void 0:s.toLowerCase())||"";t.includes("invalid")||t.includes("credentials")||t.includes("incorrect")?E(b.errors.invalidCredentials):t.includes("deactivated")||t.includes("not active")?E(b.errors.accountDeactivated):E(e.message||b.errors.invalidCredentials)}}catch(e){E(b.errors.serverError)}finally{Z(!1)}}},F=async()=>{H(!0),M(!1);try{(await y(A,t)).success&&M(!0)}catch(e){console.error("Error resending verification:",e)}finally{H(!1)}};return(0,s.jsxs)("div",{className:"w-full max-w-md mx-auto",children:[(0,s.jsxs)("div",{className:"text-center mb-8",children:[(0,s.jsx)("h1",{className:"text-3xl font-bold text-gray-900",children:b.title}),(0,s.jsx)("p",{className:"mt-2 text-gray-600",children:b.subtitle})]}),(0,s.jsxs)("form",{onSubmit:q,className:"space-y-6",children:[I&&(0,s.jsx)("div",{className:"p-4 bg-red-50 border border-red-200 rounded-lg text-red-600 text-sm",children:I}),z&&(0,s.jsx)("div",{className:"p-4 bg-amber-50 border border-amber-200 rounded-lg",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)(n.Z,{className:"w-5 h-5 text-amber-600 mt-0.5 flex-shrink-0"}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("h3",{className:"text-amber-800 font-semibold mb-1",children:b.verification.title}),(0,s.jsx)("p",{className:"text-amber-700 text-sm mb-3",children:b.verification.message}),D?(0,s.jsxs)("div",{className:"flex items-center gap-2 text-green-600 text-sm",children:[(0,s.jsx)(l.Z,{className:"w-4 h-4"}),b.verification.resent]}):(0,s.jsxs)("button",{type:"button",onClick:F,disabled:L,className:"flex items-center gap-2 text-amber-700 hover:text-amber-800 text-sm font-medium disabled:opacity-50",children:[(0,s.jsx)(c.Z,{className:"w-4 h-4 ".concat(L?"animate-spin":"")}),L?b.verification.resending:b.verification.resend]})]})]})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{htmlFor:"email",className:"block text-sm font-medium text-gray-700 mb-1",children:b.email}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:(0,s.jsx)(d.Z,{className:"h-5 w-5 text-gray-400"})}),(0,s.jsx)("input",{type:"email",id:"email",value:N.email,onChange:e=>w({...N,email:e.target.value}),placeholder:b.emailPlaceholder,className:"block w-full pl-10 pr-4 py-3 border rounded-lg focus:ring-2 focus:ring-oh-blue focus:border-oh-blue transition-colors ".concat(S.email?"border-red-500":"border-gray-300")})]}),S.email&&(0,s.jsx)("p",{className:"mt-1 text-sm text-red-500",children:S.email})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{htmlFor:"password",className:"block text-sm font-medium text-gray-700 mb-1",children:b.password}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:(0,s.jsx)(u.Z,{className:"h-5 w-5 text-gray-400"})}),(0,s.jsx)("input",{type:j?"text":"password",id:"password",value:N.password,onChange:e=>w({...N,password:e.target.value}),placeholder:b.passwordPlaceholder,className:"block w-full pl-10 pr-12 py-3 border rounded-lg focus:ring-2 focus:ring-oh-blue focus:border-oh-blue transition-colors ".concat(S.password?"border-red-500":"border-gray-300")}),(0,s.jsx)("button",{type:"button",onClick:()=>C(!j),className:"absolute inset-y-0 right-0 pr-3 flex items-center",children:j?(0,s.jsx)(m.Z,{className:"h-5 w-5 text-gray-400 hover:text-gray-600"}):(0,s.jsx)(h.Z,{className:"h-5 w-5 text-gray-400 hover:text-gray-600"})})]}),S.password&&(0,s.jsx)("p",{className:"mt-1 text-sm text-red-500",children:S.password})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("label",{className:"flex items-center",children:[(0,s.jsx)("input",{type:"checkbox",checked:N.rememberMe,onChange:e=>w({...N,rememberMe:e.target.checked}),className:"h-4 w-4 text-oh-blue focus:ring-oh-blue border-gray-300 rounded"}),(0,s.jsx)("span",{className:"ml-2 text-sm text-gray-600",children:b.rememberMe})]}),(0,s.jsx)(i.default,{href:"/".concat(t,"/auth/forgot-password"),className:"text-sm font-medium text-oh-blue hover:text-oh-blue/80",children:b.forgotPassword})]}),(0,s.jsx)("button",{type:"submit",disabled:P,className:"w-full flex items-center justify-center gap-2 bg-oh-blue text-white py-3 px-4 roun
1ded-lg font-semibold hover:bg-oh-blue/90 focus:ring-2 focus:ring-oh-blue focus:ring-offset-2 transition-colors disabled:opacity-70 disabled:cursor-not-allowed",children:P?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(p.Z,{className:"h-5 w-5 animate-spin"}),b.loggingIn]}):b.login}),(0,s.jsxs)("p",{className:"text-center text-sm text-gray-600",children:[b.noAccount," ",(0,s.jsx)(i.default,{href:"/".concat(t,"/auth/register"),className:"font-semibold text-oh-blue hover:text-oh-blue/80",children:b.register})]})]})]})}},908:function(e,t,a){a.d(t,{RegisterForm:function(){return g}});var s=a(7437),r=a(2265),o=a(9376),i=a(7648),n=a(6167),l=a(2369),c=a(9345),d=a(6337),u=a(7769),m=a(2208),h=a(5863),p=a(4320);let x={fr:{title:"Inscription",subtitle:"Cr\xe9ez votre compte",username:"Nom d'utilisateur",usernamePlaceholder:"johndoe",email:"Email",emailPlaceholder:"[email protected]",firstName:"Pr\xe9nom",firstNamePlaceholder:"Jean",lastName:"Nom",lastNamePlaceholder:"Dupont",password:"Mot de passe",passwordPlaceholder:"Au moins 8 caract\xe8res",confirmPassword:"Confirmer le mot de passe",confirmPasswordPlaceholder:"R\xe9p\xe9tez votre mot de passe",termsAccept:"J'accepte les",termsLink:"conditions d'utilisation",register:"S'inscrire",registering:"Inscription...",hasAccount:"Vous avez d\xe9j\xe0 un compte ?",login:"Se connecter",verification:{title:"V\xe9rifiez votre email",message:"Un email de v\xe9rification a \xe9t\xe9 envoy\xe9 \xe0",instruction:"Cliquez sur le lien dans l'email pour activer votre compte.",checkSpam:"V\xe9rifiez vos spams si vous ne le trouvez pas.",backToLogin:"Retour \xe0 la connexion"},errors:{username:"Le nom d'utilisateur est requis (3 caract\xe8res min.)",email:"Email invalide",firstName:"Le pr\xe9nom est requis",lastName:"Le nom est requis",password:"Le mot de passe doit contenir au moins 8 caract\xe8res",confirmPassword:"Les mots de passe ne correspondent pas",terms:"Vous devez accepter les conditions",serverError:"Erreur de connexion au serveur"}},en:{title:"Sign Up",subtitle:"Create your account",username:"Username",usernamePlaceholder:"johndoe",email:"Email",emailPlaceholder:"[email protected]",firstName:"First name",firstNamePlaceholder:"John",lastName:"Last name",lastNamePlaceholder:"Doe",password:"Password",passwordPlaceholder:"At least 8 characters",confirmPassword:"Confirm password",confirmPasswordPlaceholder:"Repeat your password",termsAccept:"I accept the",termsLink:"terms and conditions",register:"Sign up",registering:"Signing up...",hasAccount:"Already have an account?",login:"Sign in",verification:{title:"Check your email",message:"A verification email has been sent to",instruction:"Click the link in the email to activate your account.",checkSpam:"Check your spam folder if you can't find it.",backToLogin:"Back to login"},errors:{username:"Username is required (min. 3 characters)",email:"Invalid email",firstName:"First name is required",lastName:"Last name is required",password:"Password must be at least 8 characters",confirmPassword:"Passwords do not match",terms:"You must accept the terms",serverError:"Server connection error"}}};function g(e){let{lang:t}=e,a=x[t],g=(0,o.useRouter)(),{register:b}=(0,p.aC)(),[f,v]=(0,r.useState)({username:"",email:"",firstName:"",lastName:"",password:"",confirmPassword:"",acceptTerms:!1}),[y,N]=(0,r.useState)(!1),[w,j]=(0,r.useState)(!1),[C,S]=(0,r.useState)({}),[k,P]=(0,r.useState)(!1),[Z,I]=(0,r.useState)(""),[E,z]=(0,r.useState)(!1),O=()=>{let e={};return(!f.username||f.username.length<3)&&(e.username=a.errors.username),f.email&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(f.email)||(e.email=a.errors.email),f.firstName||(e.firstName=a.errors.firstName),f.lastName||(e.lastName=a.errors.lastName),(!f.password||f.password.length<8)&&(e.password=a.errors.password),f.password!==f.confirmPassword&&(e.confirmPassword=a.errors.confirmPassword),f.acceptTerms||(e.terms=a.errors.terms),S(e),0===Object.keys(e).length},A=async e=>{if(e.preventDefault(),I(""),O()){P(!0);try{let e=await b({username:f.username,email:f.email,password:f.password,first_name:f.firstName,last_name:f.lastName,lang:t});e.success?e.requiresVerification?z(!0):g.push("/".concat(t,"/dashboard")):I(e.message||a.errors.serverError)}catch(e){I(a.errors.serverError)}finally{P(!1)}}};return E?(0,s.jsx)("div",{className:"w-full max-w-md mx-auto",children:(0,s.jsxs)("div",{className:"text-center",children:[(0,s.jsx)("div",{className:"mx-auto w-20 h-20 bg-green-100 rounded-full flex items-center justify-center mb-6",children:(0,s.jsx)(n.Z,{className:"w-10 h-10 text-green-600"})}),(0,s.jsx)("h1",{className:"text-3xl font-bold text-gray-900 mb-3",children:a.verification.title}),(0,s.jsx)("p",{className:"text-gray-600 mb-2",children:a.verification.message}),(0,s.jsx)("p",{className:"text-oh-blue font-semibold mb-4",children:f.email}),(0,s.jsx)("p",{className:"text-gray-600 mb-2",children:a.verification.instruction}),(0,s.jsx)("p",{className:"text-sm text-gray-500 mb-8",children:a.verification.checkSpam}
1),(0,s.jsx)(i.default,{href:"/".concat(t,"/auth/login"),className:"inline-flex items-center gap-2 bg-oh-blue text-white py-3 px-6 rounded-lg font-semibold hover:bg-oh-blue/90 transition-colors",children:a.verification.backToLogin})]})}):(0,s.jsxs)("div",{className:"w-full max-w-md mx-auto",children:[(0,s.jsxs)("div",{className:"text-center mb-8",children:[(0,s.jsx)("h1",{className:"text-3xl font-bold text-gray-900",children:a.title}),(0,s.jsx)("p",{className:"mt-2 text-gray-600",children:a.subtitle})]}),(0,s.jsxs)("form",{onSubmit:A,className:"space-y-5",children:[Z&&(0,s.jsx)("div",{className:"p-4 bg-red-50 border border-red-200 rounded-lg text-red-600 text-sm",children:Z}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{htmlFor:"username",className:"block text-sm font-medium text-gray-700 mb-1",children:a.username}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:(0,s.jsx)(l.Z,{className:"h-5 w-5 text-gray-400"})}),(0,s.jsx)("input",{type:"text",id:"username",value:f.username,onChange:e=>v({...f,username:e.target.value}),placeholder:a.usernamePlaceholder,className:"block w-full pl-10 pr-4 py-3 border rounded-lg focus:ring-2 focus:ring-oh-blue focus:border-oh-blue transition-colors ".concat(C.username?"border-red-500":"border-gray-300")})]}),C.username&&(0,s.jsx)("p",{className:"mt-1 text-sm text-red-500",children:C.username})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{htmlFor:"email",className:"block text-sm font-medium text-gray-700 mb-1",children:a.email}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:(0,s.jsx)(c.Z,{className:"h-5 w-5 text-gray-400"})}),(0,s.jsx)("input",{type:"email",id:"email",value:f.email,onChange:e=>v({...f,email:e.target.value}),placeholder:a.emailPlaceholder,className:"block w-full pl-10 pr-4 py-3 border rounded-lg focus:ring-2 focus:ring-oh-blue focus:border-oh-blue transition-colors ".concat(C.email?"border-red-500":"border-gray-300")})]}),C.email&&(0,s.jsx)("p",{className:"mt-1 text-sm text-red-500",children:C.email})]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{htmlFor:"firstName",className:"block text-sm font-medium text-gray-700 mb-1",children:a.firstName}),(0,s.jsx)("input",{type:"text",id:"firstName",value:f.firstName,onChange:e=>v({...f,firstName:e.target.value}),placeholder:a.firstNamePlaceholder,className:"block w-full px-4 py-3 border rounded-lg focus:ring-2 focus:ring-oh-blue focus:border-oh-blue transition-colors ".concat(C.firstName?"border-red-500":"border-gray-300")}),C.firstName&&(0,s.jsx)("p",{className:"mt-1 text-sm text-red-500",children:C.firstName})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{htmlFor:"lastName",className:"block text-sm font-medium text-gray-700 mb-1",children:a.lastName}),(0,s.jsx)("input",{type:"text",id:"lastName",value:f.lastName,onChange:e=>v({...f,lastName:e.target.value}),placeholder:a.lastNamePlaceholder,className:"block w-full px-4 py-3 border rounded-lg focus:ring-2 focus:ring-oh-blue focus:border-oh-blue transition-colors ".concat(C.lastName?"border-red-500":"border-gray-300")}),C.lastName&&(0,s.jsx)("p",{className:"mt-1 text-sm text-red-500",children:C.lastName})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{htmlFor:"password",className:"block text-sm font-medium text-gray-700 mb-1",children:a.password}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:(0,s.jsx)(d.Z,{className:"h-5 w-5 text-gray-400"})}),(0,s.jsx)("input",{type:y?"text":"password",id:"password",value:f.password,onChange:e=>v({...f,password:e.target.value}),placeholder:a.passwordPlaceholder,className:"block w-full pl-10 pr-12 py-3 border rounded-lg focus:ring-2 focus:ring-oh-blue focus:border-oh-blue transition-colors ".concat(C.password?"border-red-500":"border-gray-300")}),(0,s.jsx)("button",{type:"button",onClick:()=>N(!y),className:"absolute inset-y-0 right-0 pr-3 flex items-center",children:y?(0,s.jsx)(u.Z,{className:"h-5 w-5 text-gray-400 hover:text-gray-600"}):(0,s.jsx)(m.Z,{className:"h-5 w-5 text-gray-400 hover:text-gray-600"})})]}),C.password&&(0,s.jsx)("p",{className:"mt-1 text-sm text-red-500",children:C.password})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{htmlFor:"confirmPassword",className:"block text-sm font-medium text-gray-700 mb-1",children:a.confirmPassword}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:(0,s.jsx)(d.Z,{className:"h-5 w-5 text-gray-400"})}),(0,s.jsx)("input",{type:w?"text":"password",id:"confirmPassword",value:f.confirmPassword,onChange:e=>v({...f,confirmPassword:e.target.value}),placeholder:a.confirmPasswordPlaceholder,className:"block w-full pl-10 pr-12 py-3 border rounded-lg focus:ring-2 focus:ring-oh-blue focus:border-oh-blue transition-colors ".concat(C.confirmPassword?"border-red-500":"border-gray-300")}),(0,s.jsx)("button",{type:"button",onClick:()=>j(!w),className:"absolute inset-y-0 right-0 pr-3 flex items-center",children:w?(0,s.jsx)(u.Z,{className:"h-5 w-5 text-gray-400 hover:text-gray-600"}):(0,s.jsx)(m.Z,{className:"h-5 w-5 text-gray-400 hover:text-gray-600"})})]}),C.confirmPassword&&(0,s.jsx)("p",{className:"mt-1 text-sm text-red-500",children:C.confirmPassword})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"flex items-start gap-2",children:[(0,s.jsx)("input",{type:"checkbox",checked:f.acceptTerms,onChange:e=>v({...f,acceptTerms:e.target.checked}),className:"h-4 w-4 mt-1 text-oh-blue focus:ring-oh-blue border-gray-300 rounded"}),(0,s.jsxs)("span",{className:"text-sm text-gray-600",children:[a.termsAccept," ",(0,s.jsx)(i.default,{href:"/".concat(t,"/terms"),className:"text-oh-blue hover:underline",children:a.termsLink})]})]}),C.terms&&(0,s.jsx)("p",{className:"mt-1 text-sm text-red-500",children:C.terms})]}),(0,s.jsx)("button",{type:"submit",disabled:k,className:"w-full flex items-center justify-center gap-2 bg-oh-blue text-white py-3 px-4 roun
1ded-lg font-semibold hover:bg-oh-blue/90 focus:ring-2 focus:ring-oh-blue focus:ring-offset-2 transition-colors disabled:opacity-70 disabled:cursor-not-allowed",children:k?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(h.Z,{className:"h-5 w-5 animate-spin"}),a.registering]}):a.register}),(0,s.jsxs)("p",{className:"text-center text-sm text-gray-600",children:[a.hasAccount," ",(0,s.jsx)(i.default,{href:"/".concat(t,"/auth/login"),className:"font-semibold text-oh-blue hover:text-oh-blue/80",children:a.login})]})]})]})}},3911:function(e,t,a){a.d(t,{UserMenu:function(){return y}});var s=a(7437),r=a(2265),o=a(7648),i=a(3145),n=a(9376),l=a(9090),c=a(7806),d=a(5466),u=a(1769),m=a(8736),h=a(2369),p=a(875),x=a(7692),g=a(4320),b=a(4508),f=a(9116);let v={fr:{login:"Connexion",register:"S'inscrire",dashboard:"Tableau de bord",myCourses:"Mes cours",resources:"Ressources",profile:"Mon profil",settings:"Param\xe8tres",logout:"D\xe9connexion"},en:{login:"Login",register:"Sign up",dashboard:"Dashboard",myCourses:"My Courses",resources:"Resources",profile:"My Profile",settings:"Settings",logout:"Logout"}};function y(e){var t;let{lang:a}=e,y=v[a],{user:N,isAuthenticated:w,logout:j}=(0,g.aC)(),C=(0,n.useRouter)(),[S,k]=(0,r.useState)(!1),P=(0,r.useRef)(null);if((0,r.useEffect)(()=>{function e(e){P.current&&!P.current.contains(e.target)&&k(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),!w||!N)return(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsxs)(o.default,{href:"/".concat(a,"/auth/login"),className:"group flex items-center gap-2 px-4 py-2.5 text-sm font-semibold text-gray-700 hover:text-oh-blue rounded-xl border-2 border-gray-200 hover:border-oh-blue/40 hover:bg-oh-blue/5 transition-all duration-300",children:[(0,s.jsx)(l.Z,{size:18,className:"group-hover:translate-x-0.5 transition-transform duration-300"}),y.login]}),(0,s.jsxs)(o.default,{href:"/".concat(a,"/auth/register"),className:"group relative flex items-center gap-2 px-5 py-2.5 text-sm font-semibold text-white rounded-xl overflow-hidden transition-all duration-300 hover:shadow-lg hover:shadow-oh-blue/25 hover:-translate-y-0.5",children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-gradient-to-r from-oh-blue via-indigo-600 to-oh-blue bg-[length:200%_100%] group-hover:animate-gradient-x transition-all"}),(0,s.jsx)("div",{className:"absolute inset-0 opacity-0 group-hover:opacity-100 transition-opacity duration-500",children:(0,s.jsx)("div",{className:"absolute inset-0 translate-x-[-100%] group-hover:translate-x-[100%] transition-transform duration-700 bg-gradient-to-r from-transparent via-white/20 to-transparent"})}),(0,s.jsx)(c.Z,{size:18,className:"relative z-10 group-hover:scale-110 transition-transform duration-300"}),(0,s.jsx)("span",{className:"relative z-10",children:y.register})]})]});let Z=N.first_name?"".concat(N.first_name," ").concat(N.last_name||"").trim():N.username,I=N.first_name?"".concat(N.first_name.charAt(0)).concat((null===(t=N.last_name)||void 0===t?void 0:t.charAt(0))||"").toUpperCase():N.username.substring(0,2).toUpperCase(),E=[{label:y.dashboard,href:"/".concat(a,"/dashboard"),icon:d.Z},{label:y.myCourses,href:"/".concat(a,"/dashboard/courses"),icon:u.Z},{label:y.resources,href:"/".concat(a,"/dashboard/resources"),icon:m.Z},{label:y.profile,href:"/".concat(a,"/dashboard/profile"),icon:h.Z}];return(0,s.jsxs)("div",{ref:P,className:"relative",children:[(0,s.jsxs)("button",{onClick:()=>k(!S),className:(0,b.cn)("flex items-center gap-2 px-3 py-2 rounded-lg transition-colors","hover:bg-gray-100",S&&"bg-gray-100"),children:[(0,s.jsx)("div",{className:"relative w-8 h-8 rounded-full overflow-hidden bg-oh-blue flex items-center justify-center",children:N.avatar?(0,s.jsx)(i.default,{src:(0,f.Jn)(N.avatar),alt:Z,fill:!0,className:"object-cover"}):(0,s.jsx)("span",{className:"text-white text-sm font-medium",children:I})}),(0,s.jsx)("span",{className:"text-sm font-medium text-gray-700 hidden sm:block max-w-[120px] truncate",children:Z}),(0,s.jsx)(p.Z,{size:16,className:(0,b.cn)("text-gray-500 transition-transform duration-200",S&&"rotate-180")}
1)]}),(0,s.jsxs)("div",{className:(0,b.cn)("absolute right-0 top-full mt-2 w-56 bg-white rounded-xl shadow-lg border border-gray-100 py-2 z-50","opacity-0 invisible translate-y-2 transition-all duration-200",S&&"opacity-100 visible translate-y-0"),children:[(0,s.jsxs)("div",{className:"px-4 py-3 border-b border-gray-100",children:[(0,s.jsx)("p",{className:"font-medium text-gray-900 truncate",children:Z}),(0,s.jsx)("p",{className:"text-sm text-gray-500 truncate",children:N.email})]}),(0,s.jsx)("div",{className:"py-2",children:E.map(e=>(0,s.jsxs)(o.default,{href:e.href,onClick:()=>k(!1),className:"flex items-center gap-3 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50 transition-colors",children:[(0,s.jsx)(e.icon,{size:18,className:"text-gray-400"}),e.label]},e.href))}),(0,s.jsx)("div",{className:"border-t border-gray-100 pt-2",children:(0,s.jsxs)("button",{onClick:()=>{j(),k(!1),C.push("/".concat(a))},className:"flex items-center gap-3 w-full px-4 py-2 text-sm text-red-600 hover:bg-red-50 transition-colors",children:[(0,s.jsx)(x.Z,{size:18}),y.logout]})})]})]})}},4320:function(e,t,a){a.d(t,{Ho:function(){return c},aC:function(){return d}});var s=a(7437),r=a(2265);let o=(0,r.createContext)(void 0),i="/api",n="oh_elearning_token",l="oh_elearning_user";function c(e){let{children:t}=e,[a,c]=(0,r.useState)(null),[d,u]=(0,r.useState)(null),[m,h]=(0,r.useState)(!0);(0,r.useEffect)(()=>{let e=localStorage.getItem(n),t=localStorage.getItem(l);if(e&&t){u(e);try{c(JSON.parse(t))}catch(e){localStorage.removeItem(l)}p(e)}else h(!1)},[]);let p=async e=>{try{let t=await fetch("".concat(i,"/auth/me"),{headers:{Authorization:"Bearer ".concat(e)}});if(t.ok){let e=await t.json();e.success&&e.data&&(c(e.data),localStorage.setItem(l,JSON.stringify(e.data)))}else f()}catch(e){console.error("Token verification error:",e)}finally{h(!1)}},x=(0,r.useCallback)(async(e,t)=>{try{var a;let s=await fetch("".concat(i,"/auth/login"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e,password:t})}),r=await s.json();if(r.success&&(null===(a=r.data)||void 0===a?void 0:a.token)){let{token:e,user:t}=r.data;return u(e),c(t),localStorage.setItem(n,e),localStorage.setItem(l,JSON.stringify(t)),{success:!0}}if(r.requiresVerification)return{success:!1,message:r.message||"Email not verified",requiresVerification:!0,email:r.email};return{success:!1,message:r.message||"Erreur de connexion"}}catch(e){return console.error("Login error:",e),{success:!1,message:"Erreur de connexion au serveur"}}},[]),g=(0,r.useCallback)(async e=>{try{var t;let a=await fetch("".concat(i,"/auth/register"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await a.json();if(!s.success)return{success:!1,message:s.message||"Erreur d'inscription"};if(s.requiresVerification)return{success:!0,message:s.message,requiresVerification:!0};if(null===(t=s.data)||void 0===t?void 0:t.token){let{token:e,user:t}=s.data;u(e),c(t),localStorage.setItem(n,e),localStorage.setItem(l,JSON.stringify(t))}return{success:!0}}catch(e){return console.error("Register error:",e),{success:!1,message:"Erreur de connexion au serveur"}}},[]),b=(0,r.useCallback)(async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"fr";try{let a=await fetch("".concat(i,"/auth/resend-verification"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e,lang:t})}),s=await a.json();return{success:s.success,message:s.message}}catch(e){return console.error("Resend verification error:",e),{success:!1,message:"Erreur de connexion au serveur"}}},[]),f=(0,r.useCallback)(()=>{u(null),c(null),localStorage.removeItem(n),localStorage.removeItem(l)},[]),v=(0,r.useCallback)(async e=>{if(!d)return{success:!1,message:"Non authentifi\xe9"};try{let t=await fetch("".concat(i,"/auth/profile"),{method:"PUT",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(d)},body:JSON.stringify(e)}),s=await t.json();if(!s.success)return{success:!1,message:s.message||"Erreur de mise \xe0 jour"};{let t={...a,...e};return c(t),localStorage.setItem(l,JSON.stringify(t)),{success:!0}}}catch(e){return console.error("Update profile error:",e),{success:!1,message:"Erreur de connexion au serveur"}}},[d,a]);return(0,s.jsx)(o.Provider,{value:{user:a,token:d,isAuthenticated:!!d&&!!a,isLoading:m,login:x,register:g,logout:f,updateProfile:v,resendVerification:b},children:t})}function d(){let e=(0,r.useContext)(o);if(void 0===e)throw Error("useAuth must be used within an AuthProvider");return e}},5155:function(e,t,a){function s(e){let{src:t,width:a,quality:s}=e;return t.startsWith("http://")||t.startsWith("https://"),t}a.r(t),a.d(t,{default:function(){return s}})},4508:function(e,t,a){a.d(t,{Jn:function(){return i},cn:function(){return o}});var s=a(1994),r=a(3335);function o(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return(0,r.m6)((0,s.W)(t))}function i(e){return e?e.startsWith("http")?e:(e.startsWith("/uploads/")||e.startsWith("uploads/"),e.startsWith("/")?e:"/".concat(e)):"/images/placeholder.jpg"}}}]);
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.