(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[363],{5142:function(e,s,t){Promise.resolve().then(t.bind(t,1740))},1740:function(e,s,t){"use strict";t.r(s);var r=t(7437),n=t(7407),a=t(6357),i=t(1099),o=t(4032),d=t(5833),u=t(368),c=t(7114),l=t(8068),m=t(7826),f=t(1014),p=t(6463),g=t(2265),v=t(9343),h=t(9772);s.default=()=>{let e=(0,p.useRouter)(),[s,t]=(0,g.useState)(!1),x=h.z.object({activation_code:h.z.string({required_error:"Veuillez renseigner le code d'activation"}),password:m.r}),b=(0,v.cI)({resolver:(0,f.F)(x),mode:"onChange"});async function j(s){try{t(!0);let r=await (0,n.u7z)({body:{reset_token:s.activation_code,new_password:s.password}});if(t(!1),r.response.status<300){e.push("/reset-password/success");return}(0,l.Am)({title:"Erreur",description:r.error.detail,variant:"destructive"})}catch(e){t(!1),(0,l.Am)({title:"Erreur",description:"".concat(e),variant:"destructive"})}}return(0,r.jsx)(a.G,{title:"R\xe9initialiser le mot de passe",description:"Entrez votre nouveau mot de passe",children:(0,r.jsx)(c.l0,{...b,children:(0,r.jsx)("form",{onSubmit:b.handleSubmit(j),children:(0,r.jsxs)("div",{className:"grid gap-4",children:[(0,r.jsx)(u.D,{form:b,name:"activation_code",queryParam:"reset_token"}),(0,r.jsx)(i.T,{form:b,name:"password",label:"Mot de passe",render:e=>(0,r.jsx)(d.S,{...e})}),(0,r.jsx)(o.f,{type:"submit",className:"mt-2 w-full",label:"R\xe9initialiser le mot de passe",isLoading:s})]})})})})}},1439:function(e,s,t){"use strict";t.d(s,{W:function(){return d}});var r=t(7437),n=t(7209),a=t(9354),i=t(2265),o=t(4008);let d=i.forwardRef((e,s)=>{let{className:t,...d}=e,[u,c]=i.useState(!1),l=()=>c(!u);return(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(n.I,{type:u?"text":"password",className:(0,a.cn)(t),ref:s,...d}),(0,r.jsx)("div",{className:"absolute inset-y-0 right-0 flex cursor-pointer items-center pr-3 text-gray-400 hover:text-[hsl(var(--ring))]",children:u?(0,r.jsx)(o.Rbo,{className:"h-4 w-4",onClick:l}):(0,r.jsx)(o.MBb,{className:"h-4 w-4",onClick:l})})]})});d.displayName="PasswordInput"},5833:function(e,s,t){"use strict";t.d(s,{S:function(){return o}});var r=t(7437),n=t(1439),a=t(5459),i=t(2265);let o=i.forwardRef((e,s)=>{let{...t}=e,[o,d]=i.useState(0),u=t.onChange;return t.onChange=e=>{u&&(d((0,a.tu)(e.target.value).score),u(e))},(0,r.jsxs)("div",{children:[(0,r.jsx)(n.W,{...t,ref:s}),(0,r.jsx)("div",{className:"grid grid-flow-col justify-stretch gap-4 mt-4 px-1",children:[void 0,void 0,void 0,void 0,void 0].map((e,s)=>{var n,a;return(0,r.jsx)("div",{className:"px-1 h-2 rounded-xl transition-colors ".concat((null===(a=t.value)||void 0===a?void 0:null===(n=a.toString())||void 0===n?void 0:n.length)&&!(o<s)?["bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-400","bg-green-400"][o]:"bg-gray-200")},s)})})]})});o.displayName="PasswordInputWithStrength"},9155:function(e,s,t){"use strict";t.d(s,{F:function(){return a}});var r=t(7437),n=t(2265);let a=e=>{let{children:s}=e;return(0,r.jsx)(n.Suspense,{fallback:(0,r.jsx)("div",{children:"Loading..."}),children:s})}},368:function(e,s,t){"use strict";t.d(s,{D:function(){return u}});var r=t(7437),n=t(7114),a=t(6463),i=t(2265);let o=e=>{let{form:s,queryParam:t,name:o,optional:d=!1}=e,u=(0,a.useSearchParams)().get(t),c=(0,a.useRouter)();return(0,i.useEffect)(()=>{d||u?u&&s.setValue(o,u):c.push(encodeURI("/error?message=Url invalide : ".concat(t," manquant")))}),(0,r.jsx)(n.Wi,{control:s.control,name:o,render:e=>{let{field:s}=e;return(0,r.jsx)("input",{type:"hidden",...s})}})};var d=t(9155);let u=e=>{let{form:s,queryParam:t,name:n,optional:a=!1}=e;return(0,r.jsx)(d.F,{children:(0,r.jsx)(o,{form:s,name:n,queryParam:t,optional:a})})}},7826:function(e,s,t){"use strict";t.d(s,{r:function(){return c}});var r=t(5459),n=t(9346),a=t(2607),i=t(2599),o=t(7005),d=t(9772);let u={translations:i.Z,graphs:n.x,dictionary:{...n.F,...a.F,...o.F}};r.Mu.setOptions(u);let c=d.z.string({required_error:"Le mot de passe n'est pas assez fort"}).superRefine((e,s)=>{let t=(0,r.tu)(e||"");t.score>=4||(t.feedback.warning?s.addIssue({code:d.z.ZodIssueCode.custom,message:t.feedback.warning}):t.feedback.suggestions.length?s.addIssue({code:d.z.ZodIssueCode.custom,message:t.feedback.suggestions[0]}):s.addIssue({code:d.z.ZodIssueCode.custom,message:"Le mot de passe n'est pas assez fort"}))})}},function(e){e.O(0,[310,422,538,391,610,199,401,6,250,956,473,394,407,971,23,744],function(){return e(e.s=5142)}),_N_E=e.O()}]);