PageSourceSearch

https://app.declarando.es/assets/Reset-BpqnBe0I.js

js declarando.es collected 2026-09-24 08:44:47 UTC 3,819 bytes, 1 lines download raw bytes

1import{dQ as G,dV as K,dS as W,du as Y,da as n,bv as y,d0 as e,m as w,bS as v,ao as z,bs as p,aJ as E,bp as b,aY as J,q as Q,bq as j,h as X}from"./index-SW_ThLYf.js";import{R as Z,a as $}from"./RegisterService-Dx7MQGmJ.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};a.SENTRY_RELEASE={id:"bec1de57eae065682d34a4d342eab128bf62b115"}}catch{}})();try{(function(){var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="6f1caea0-9999-442c-a6d4-964985fdbceb",a._sentryDebugIdIdentifier="sentry-dbid-6f1caea0-9999-442c-a6d4-964985fdbceb")})()}catch{}const ee=new Z($),se=()=>({resetPass:G({queryKey:["register","reset-password"],mutationFn:t=>ee.resetPass(t)})}),ae="Las contraseñas no coinciden",C="Debe ser diferente a las anteriores.",ne=()=>{const a=K(),{resetPass:t}=se(),x=new URLSearchParams(window.location.search),l=a?.source||x.get("source"),u=x.get("email")||"",{userIdentity:R}=W(),k=u||R?.email||"",{trackPasswordPageVisit:D,trackPasswordCreationSuccess:I}=Y(k),T=a?.key??"",_=a?.salt??"",d=l==="register",[o,A]=n.useState(""),[r,N]=n.useState(""),[i,m]=n.useState([]),[f,P]=n.useState(!1),[q,L]=n.useState(!1),[F,H]=n.useState(!1);n.useEffect(()=>{S(o)},[]),n.useEffect(()=>{l==="register"&&u&&D()},[l,u]);const S=s=>{const{errors:c}=y(s);m(c??[])},M=()=>{H(!0);const{valid:s,errors:c}=y(o);m(c??[]),s&&V()&&U()},U=()=>{const s={k:T,v:"",s:_,p:o,d:r};t.mutate(s,{onSuccess:async()=>{l==="register"&&u&&await I(),setTimeout(()=>{j.success({title:"Contraseña creada correctamente",message:"A partir de ahora, ya puedes acceder a tu cuenta con tu nueva contraseña."})},1e3),X.goHome()},onError:c=>{j.error({title:"No ha sido posible crear la nueva contraseña",message:"Por favor, vuelve a intentarlo."});const h=c?.message??"";if(h==="INVALID_TOKEN"){L(!0);return}m([h==="PASSWORD_USADO"?C:h])}})},V=()=>o===r,B=s=>{A(s),S(s),P(r!==s)},O=s=>{N(s),P(s!==o)},g=F&&i.length>0;return e.jsx(w,{m:"auto",px:"lg",py:"lg",backgroundColor:"white",maxWidth:400,borderRadius:"sm",children:e.jsxs(v,{lg:!0,children:[e.jsxs(w,{display:"flex",flexDirection:"column",gap:"xs",alignItems:"baseline",children:[e.jsx(z,{textAlign:"center",as:"h1",children:d?"Establecer contraseña":"Cambiar contraseña"}),d&&e.jsx(p,{textColor:"semantic.text.general.text2",children:"Crea tu contraseña de acceso."})]}),e.jsxs(v,{children:[e.jsx(E,{placeholder:d?"Introduce tu contraseña":"Introduce tu nueva contraseña",success:i.length===0&&!!r&&!f,label:"Nueva contraseña",value:o,onChange:s=>B(s.target.value),error:g||!!r&&f}),e.jsx(E,{placeholder:d?"Confirma la contraseña":"Confirma la nueva contraseña",success:!!(r&&o===r),value:r,error:r&&f||g,helperText:r&&f?ae:"",onChange:s=>O(s.target.value),label:"Confirma la contraseña"})]}),q?e.jsx(b,{shrink:!1,full:!0,tone:"error",title:"El enlace ha caducado",message:e.jsxs(e.Fragment,{children:["Debes solicitar uno nuevo para continuar.",e.jsx(p,{small:!0,children:e.jsx(J,{underline:!0,href:"/password",target:"_self",children:"Solicitar nuevo enlace"})})]})}):e.jsxs(e.Fragment,{children:[r&&o===r&&!i.length?e.jsx(b,{shrink:!1,full:!0,tone:"success",title:"La contraseña cumple los requisitos",message:"Haz clic en 'Confirmar contraseña'"}):null,i.length>0?e.jsx(b,{shrink:!1,full:!0,tone:g?"error":"info",title:g?"La contraseña no cumple los requisitos":"Para que la contraseña sea válida",message:e.jsx(e.Fragment,{children:i.map((s,c)=>e.jsxs(p,{small:!0,children:[s===C?null:e.jsx("b",{children:"·"})," ",s]},"error"+c))})}):null]}),e.jsx(Q,{isDisabled:t.isPending,label:"Confirmar contraseña",onClick:M})]})})};export{ne as default};

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.