PageSourceSearch

https://selyt.cl/assets/profile-page-DvphyVy1.js

js selyt.cl collected 2026-10-02 00:15:34 UTC 24,830 bytes, 1 lines download raw bytes

1import{w as Se,r as i,aj as Ee,d as me,j as e,L as N,s as E,al as Re,am as Fe,ao as R}from"./vendor-ByXk4kz0.js";import{u as Le,f as Te,x as Be,I as Ie,i as Ae,B as l,J as Ue,K as Oe,y as O,e as b}from"./index-BOWIUa5W.js";import{I as o}from"./input-2ZAfIJ_8.js";import{L as c}from"./label-Dqu46QPK.js";import{S as p}from"./switch-DowC1_AW.js";import{L as V,ao as F,e as xe,r as he,I as D,U as M,b as y,al as ue,B as pe,a3 as Ve,F as fe,k as ge,j as De,aU as je,K as Me}from"./icons-vendor-2uA-iZSn.js";import"./capacitor-vendor-8XoStP7I.js";import"./supabase-vendor-BZjl9asz.js";const ze=Fe({fullName:R().min(1,"El nombre es requerido"),phone:R().optional(),currentPassword:R().optional(),newPassword:R().optional()});function Ye(){const{user:s,logoutMutation:L}=Le(),{toast:n}=Te(),{isDesktop:Ne}=Be(),[,be]=Se(),[z,$]=i.useState(!0),[q,K]=i.useState(!0),[m,f]=i.useState(!1),[x,g]=i.useState(!1),[T,J]=i.useState(!1),[w,Q]=i.useState(""),[G,v]=i.useState(""),[B,C]=i.useState(null),[H,W]=i.useState(!1),[ye,X]=i.useState(null),[k,Y]=i.useState(!1),h=i.useRef(null),Z=Ie(),[_,ee]=i.useState(()=>Ae()),[se,ae]=i.useState(!1),te=async a=>{ae(!0);try{a?(await Ue(),ee(!0),n({title:"Biometría activada",description:"Podrás iniciar sesión con Face ID / huella."})):(await Oe(),ee(!1),n({title:"Biometría desactivada"}))}catch(t){const d=t instanceof Error?t.message:"Inténtalo nuevamente";n({title:"No se pudo cambiar la biometría",description:d,variant:"destructive"})}finally{ae(!1)}},re=()=>{s!=null&&s.username&&(navigator.clipboard.writeText(s.username),W(!0),n({title:"Código copiado",description:s.username}),setTimeout(()=>W(!1),2e3))},r=Ee({resolver:Re(ze),defaultValues:{fullName:(s==null?void 0:s.fullName)||"",phone:(s==null?void 0:s.phone)||"",currentPassword:"",newPassword:""}}),j=me({mutationFn:async a=>(await b("/api/user",{method:"PATCH",body:JSON.stringify(a)})).json(),onSuccess:()=>{O.invalidateQueries({queryKey:["/api/user"]}),n({title:"Perfil actualizado",description:"Los cambios han sido guardados correctamente"}),r.reset({fullName:r.getValues("fullName"),phone:r.getValues("phone"),currentPassword:"",newPassword:""}),f(!1),g(!1)},onError:a=>{n({title:"Error al actualizar",description:a.message,variant:"destructive"})}}),ie=()=>{L.mutate(void 0,{onSuccess:()=>{be("/auth")},onError:()=>{n({title:"Error",description:"No se pudo cerrar sesión",variant:"destructive"})}})},P=a=>{j.mutate(a)},le=async a=>{var oe;const t=(oe=a.target.files)==null?void 0:oe[0];if(!t)return;const d=new FileReader;d.onloadend=()=>X(d.result),d.readAsDataURL(t),Y(!0);try{const ce=t.type||"image/jpeg",A=await b("/api/profile/photo/upload-url",{method:"POST",body:JSON.stringify({contentType:ce})});if(!A.ok){const{error:U}=await A.json().catch(()=>({}));throw new Error(U||"Tipo de archivo no permitido.")}const{url:ve,fields:Ce,objectKey:ke}=await A.json(),S=new FormData;for(const[U,Pe]of Object.entries(Ce))S.append(U,Pe);S.append("Content-Type",ce),S.append("file",t);const de=await fetch(ve,{method:"POST",body:S});if(!de.ok)throw new Error(de.status===403?"Tipo o tamaño de archivo no permitido.":"Error al subir la foto.");if(!(await b("/api/profile/photo",{method:"PATCH",body:JSON.stringify({photoUrl:ke})})).ok)throw new Error("Error al guardar foto");O.invalidateQueries({queryKey:["/api/user"]}),n({title:"Foto de perfil actualizada"})}catch{n({title:"Error al subir la foto",variant:"destructive"}),X(null)}finally{Y(!1),h.current&&(h.current.value="")}},u=ye||(s==null?void 0:s.photoUrl),we=async()=>{if(!w.trim()){v("Ingresa un código de referido");return}v(""),C(null);try{const t=await(await b(`/api/referrals/lookup/${encodeURIComponent(w.trim())}`)).json();C(t)}catch(a){const t=a instanceof Error?a.message:"Error al buscar el código";v(t)}},I=me({mutationFn:async a=>{const t=await b("/api/referrals/link",{method:"POST",body:JSON.stringify({referralCode:a})});if(!t.ok){const d=await t.json();throw new Error(d.error||"Error al vincular")}return t.json()},onSuccess:a=>{O.invalidateQueries({queryKey:["/api/user"]}
1),n({title:"¡Vinculación exitosa!",description:`Te has vinculado a ${a.referrer.fullName}`}),J(!1),Q(""),C(null)},onError:a=>{n({title:"Error",description:a.message,variant:"destructive"})}});if(!s)return null;const ne=a=>a&&a.split(" ").map(t=>t[0]).join("").toUpperCase().slice(0,2)||"U";return Ne?e.jsxs("div",{className:"space-y-6",children:[e.jsx("input",{type:"file",ref:h,accept:"image/jpeg,image/png,image/webp",className:"hidden",onChange:le}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl font-semibold text-gray-900",children:"Mi Perfil"}),e.jsx("p",{className:"text-sm text-gray-500",children:"Administra tu cuenta y preferencias"})]}),e.jsxs("div",{className:"flex gap-8",children:[e.jsxs("div",{className:"flex-1 min-w-0 space-y-6",children:[e.jsx("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:e.jsxs("div",{className:"flex items-center gap-4 mb-6",children:[e.jsxs("button",{onClick:()=>{var a;return(a=h.current)==null?void 0:a.click()},className:"relative group flex-shrink-0",disabled:k,children:[e.jsx("div",{className:"w-16 h-16 rounded-full overflow-hidden shadow-md",children:u?e.jsx("img",{src:u,alt:"Foto de perfil",className:"w-full h-full object-cover"}):e.jsx("div",{className:"w-full h-full bg-gradient-to-br from-gray-700 to-gray-900 text-white flex items-center justify-center font-bold text-xl",children:ne(s.fullName)})}),e.jsx("div",{className:"absolute inset-0 rounded-full bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:k?e.jsx(V,{className:"h-5 w-5 text-white animate-spin"}):e.jsx(F,{className:"h-5 w-5 text-white"})}),e.jsx("div",{className:"absolute -bottom-1 -right-1 w-6 h-6 rounded-full bg-gray-900 flex items-center justify-center shadow-lg border-2 border-white",children:e.jsx(F,{className:"h-3 w-3 text-white"})})]}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"font-semibold text-gray-900 text-lg",children:s.fullName||s.username}),e.jsx("p",{className:"text-sm text-gray-500",children:"Vendedor Selyt"}),e.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[e.jsx("span",{className:"text-xs text-gray-400",children:"Código:"}),e.jsxs("button",{onClick:re,className:"flex items-center gap-1 bg-gray-100 hover:bg-gray-200 px-2 py-0.5 rounded text-sm font-mono transition-colors text-gray-700",children:[s.username,H?e.jsx(xe,{className:"h-3 w-3 text-emerald-500"}):e.jsx(he,{className:"h-3 w-3"})]})]})]}),e.jsx(N,{href:"/credential",children:e.jsxs(l,{variant:"outline",className:"gap-2",children:[e.jsx(D,{className:"h-4 w-4"}),"Ver Credencial"]})})]})}),e.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:[e.jsxs("button",{onClick:()=>f(!m),className:"w-full flex items-center justify-between p-4 hover:bg-gray-50 transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-blue-100 flex items-center justify-center",children:e.jsx(M,{className:"h-5 w-5 text-blue-600"})}),e.jsx("span",{className:"font-medium text-gray-900",children:"Datos Personales"})]}),e.jsx(y,{className:`h-5 w-5 text-gray-400 transition-transform ${m?"rotate-90":""}`})]}),m&&e.jsx("div",{className:"border-t border-gray-100 p-4",children:e.jsxs("form",{onSubmit:r.handleSubmit(P),className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{htmlFor:"fullName-desktop",children:"Nombre Completo"}),e.jsx(o,{id:"fullName-desktop",...r.register("fullName"),className:"h-11"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{htmlFor:"phone-desktop",children:"Teléfono"}),e.jsx(o,{id:"phone-desktop",type:"tel",placeholder:"+56912345678",...r.register("phone"),className:"h-11"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{children:"Código de Referido"}),e.jsx(o,{value:(s==null?void 0:s.username)||"",disabled:!0,className:"h-11 bg-gray-50 font-mono"})]}),e.jsxs("div",{className:"flex gap-2 justify-end",children:[e.jsx(l,{type:"button",variant:"outline",onClick:()=>f(!1),children:"Cancelar"}),e.jsx(l,{type:"submit",className:"bg-gray-900 hover:bg-gray-800",disabled:j.isPending,children:"Guardar"})]})]})})]}),e.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:[e.jsxs("button",{onClick:()=>g(!x),className:"w-full flex items-center justify-between p-4 hover:bg-gray-50 transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-purple-100 flex items-center justify-center",children:e.jsx(ue,{className:"h-5 w-5 text-purple-600"})}),e.jsx("span",{className:"font-medium text-gray-900",children:"Cambiar Contraseña"})]}),e.jsx(y,{className:`h-5 w-5 text-gray-400 transition-transform ${x?"rotate-90":""}`})]}),x&&e.jsx("div",{className:"border-t border-gray-100 p-4",children:e.jsxs("form",{onSubmit:r.handleSubmit(P),className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{htmlFor:"currentPassword-desktop",children:"Contraseña Actual"}),e.jsx(o,{id:"currentPassword-desktop",type:"password",...r.register("currentPassword"),className:"h-11"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{htmlFor:"newPassword-desktop",children:"Nueva Contraseña"}),e.jsx(o,{id:"newPassword-desktop",type:"password",...r.register("newPassword"),className:"h-11"})]})]}),e.jsxs("div",{className:"flex gap-2 justify-end",children:[e.jsx(l,{type:"button",variant:"outline",onClick:()=>g(!1),children:"Cancelar"}),e.jsx(l,{type:"submit",className:"bg-gray-900 hover:bg-gray-800",disabled:j.isPending,children:"Cambiar"})]})]})})]}),e.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-4",children:[e.jsx("h3",{className:"font-medium text-gray-900 mb-4",children:"Notificaciones"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(pe,{className:"h-5 w-5 text-gray-400"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-gray-900",children:"Notificaciones por Email"}),e.jsx("p",{className:"text-xs text-gray-500",children:"Recibe actualizaciones en tu correo"})]})]}),e.jsx(p,{checked:z,onCheckedChange:$})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Ve,{className:"h-5 w-5 text-gray-400"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-gray-900",children:"Notificaciones Push"}),e.jsx("p",{className:"text-xs text-gray-500",children:"Alertas en tiempo real"})]})]}),e.jsx(p,{checked:q,onCheckedChange:K})]})]})]}),Z&&e.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-4",children:[e.jsx("h3",{className:"font-medium text-gray-900 mb-4",children:"Seguridad"}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(fe,{className:"h-5 w-5 text-gray-400"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-gray-900",children:"Inicio con biometría"}),e.jsx("p",{className:"text-xs text-gray-500",children:"Entra con Face ID / huella, sin escribir tu contraseña"})]})]}),e.jsx(p,{checked:_,disabled:se,onCheckedChange:te,"data-testid":"switch-biometric"})]})]}),e.jsxs(l,{onClick:ie,variant:"outline",className:"w-full gap-2 text-gray-700 hover:bg-red-50 hover:border-red-200 hover:text-red-600",disabled:L.isPending,children:[e.jsx(ge,{className:"h-5 w-5"}),"Cerrar Sesión"]})]}),e.jsxs("div",{className:"w-80 flex-shrink-0 space-y-5",children:[e.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-5",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"w-10 h-10 rounded-full overflow-hidden bg-gray-100 flex items-center justify-center flex-shrink-0",children:u?e.jsx("img",{src:u,alt:s.fullName||"",className:"w-full h-full object-cover"}):e.jsx(M,{className:"h-5 w-5 text-gray-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-gray-900",children:s.fullName||s.username}),e.jsx("p",{className:"text-xs text-gray-500",children:"Vendedor activo"})]})]}),e.jsxs("div",{className:"space-y-2 text-sm",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-500",children:"Email"}),e.jsx("span",{className:"text-gray-900 truncate ml-2",children:s.email||"No configurado"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-500",children:"Teléfono"}),e.jsx("span",{className:"text-gray-900",children:s.phone||"No configurado"})]})]})]}),e.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-5",children:[e.jsx("h3",{className:"font-semibold text-gray-900 mb-3",children:"Accesos rápidos"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{href:"/credential",children:e.jsxs("button",{className:"w-full flex items-center gap-3 p-3 rounded-lg hover:bg-gray-50 transition-colors text-left",children:[e.jsx(D,{className:"h-5 w-5 text-blue-600"}),e.jsx("span",{className:"text-sm text-gray-700",children:"Ver Credencial Digital"})]})}),e.jsx(N,{href:"/payment-method",children:e.jsxs("button",{className:"w-full flex items-center gap-3 p-3 rounded-lg hover:bg-gray-50 transition-colors text-left",children:[e.jsx(De,{className:"h-5 w-5 text-purple-600"}),e.jsx("span",{className:"text-sm text-gray-700",children:"Configurar Medio de Pago"})]})}),e.jsx(N,{href:"/referrals",children:e.jsxs("button",{className:"w-full flex items-center gap-3 p-3 rounded-lg hover:bg-gray-50 transition-colors text-left",children:[e.jsx(je,{className:"h-5 w-5 text-emerald-600"}),e.jsx("span",{className:"text-sm text-gray-700",children:"Mis Referidos"})]})})]})]}),e.jsxs("div",{className:"bg-gradient-to-br from-blue-50 to-indigo-50 rounded-xl border border-blue-100 p-5",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(Me,{className:"h-5 w-5 text-blue-600"}),e.jsx("h3",{className:"font-semibold text-gray-900",children:"Seguridad"})]}),e.jsx("p",{className:"text-sm text-gray-600",children:"Mantén tu contraseña segura y actualizada. Nunca compartas tus credenciales con terceros."})]})]})]})]}):e.jsxs(E.div,{initial:{opacity:0,y:20}
1,animate:{opacity:1,y:0},transition:{duration:.3,ease:"easeOut"},className:"min-h-screen bg-gradient-to-b from-white to-gray-50 pb-20",children:[e.jsx("input",{type:"file",ref:h,accept:"image/jpeg,image/png,image/webp",className:"hidden",onChange:le}),e.jsx("div",{className:"px-4 pb-3",children:e.jsx("div",{className:"bg-white rounded-2xl p-4 shadow-sm border border-gray-100",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("button",{onClick:()=>{var a;return(a=h.current)==null?void 0:a.click()},className:"relative group flex-shrink-0",disabled:k,children:[e.jsx("div",{className:"w-14 h-14 rounded-full overflow-hidden shadow-md",children:u?e.jsx("img",{src:u,alt:"Foto de perfil",className:"w-full h-full object-cover"}):e.jsx("div",{className:"w-full h-full bg-gradient-to-br from-gray-700 to-gray-900 text-white flex items-center justify-center font-bold text-lg",children:ne(s.fullName)})}),e.jsx("div",{className:"absolute inset-0 rounded-full bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:k?e.jsx(V,{className:"h-4 w-4 text-white animate-spin"}):e.jsx(F,{className:"h-4 w-4 text-white"})}),e.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 w-5 h-5 rounded-full bg-gray-900 flex items-center justify-center shadow-lg border-2 border-white",children:e.jsx(F,{className:"h-2.5 w-2.5 text-white"})})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-semibold text-gray-900 text-base truncate",children:s.fullName||s.username}),e.jsx("p",{className:"text-xs text-gray-500",children:"Vendedor Selyt"}),e.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[e.jsx("span",{className:"text-[11px] text-gray-400",children:"Código:"}),e.jsxs("button",{onClick:re,className:"flex items-center gap-1 bg-gray-100 hover:bg-gray-200 px-2 py-0.5 rounded text-xs font-mono transition-colors text-gray-700","data-testid":"button-copy-code",children:[s.username,H?e.jsx(xe,{className:"h-3 w-3 text-emerald-500"}):e.jsx(he,{className:"h-3 w-3"})]})]})]}),e.jsx(N,{href:"/credential",children:e.jsxs("button",{className:"flex flex-col items-center gap-1 px-3 py-2 bg-gray-100 hover:bg-gray-200 rounded-xl transition-colors","data-testid":"button-credential",children:[e.jsx(D,{className:"h-5 w-5 text-gray-600"}),e.jsx("span",{className:"text-[10px] font-medium text-gray-600",children:"Credencial"})]})})]})})}),e.jsxs("div",{className:"px-4 space-y-3",children:[e.jsxs("div",{className:"bg-white rounded-2xl shadow-sm border border-gray-100 overflow-hidden",children:[e.jsxs("button",{onClick:()=>f(!m),className:"w-full flex items-center justify-between p-4 hover:bg-gray-50 transition-colors","data-testid":"button-datos-personales",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-blue-100 flex items-center justify-center",children:e.jsx(M,{className:"h-5 w-5 text-blue-600"})}),e.jsx("span",{className:"font-medium text-gray-900 text-sm",children:"Datos Personales"})]}),e.jsx(y,{className:`h-5 w-5 text-gray-400 transition-transform ${m?"rotate-90":""}`})]}),m&&e.jsx(E.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},className:"border-t border-gray-100 p-4",children:e.jsxs("form",{onSubmit:r.handleSubmit(P),className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{htmlFor:"fullName",className:"text-sm text-gray-600",children:"Nombre Completo"}),e.jsx(o,{id:"fullName","data-testid":"input-fullname",className:"h-11 rounded-xl",...r.register("fullName")})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{htmlFor:"username",className:"text-sm text-gray-600",children:"Código de Referido"}),e.jsx(o,{id:"username",value:(s==null?void 0:s.username)||"",disabled:!0,className:"h-11 rounded-xl bg-gray-50 font-mono"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{htmlFor:"phone",className:"text-sm text-gray-600",children:"Teléfono"}),e.jsx(o,{id:"phone",type:"tel",placeholder:"+56912345678",className:"h-11 rounded-xl",...r.register("phone")})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(l,{type:"button",variant:"outline",onClick:()=>f(!1),className:"flex-1 rounded-xl",children:"Cancelar"}),e.jsx(l,{type:"submit",className:"flex-1 bg-gray-900 hover:bg-gray-800 rounded-xl",disabled:j.isPending,children:"Guardar"})]})]})})]}),e.jsxs("div",{className:"bg-white rounded-2xl shadow-sm border border-gray-100 overflow-hidden",children:[e.jsxs("button",{onClick:()=>g(!x),className:"w-full flex items-center justify-between p-4 hover:bg-gray-50 transition-colors","data-testid":"button-cambiar-contraseña",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-purple-100 flex items-center justify-center",children:e.jsx(ue,{className:"h-5 w-5 text-purple-600"})}),e.jsx("span",{className:"font-medium text-gray-900 text-sm",children:"Cambiar Contraseña"})]}),e.jsx(y,{className:`h-5 w-5 text-gray-400 transition-transform ${x?"rotate-90":""}`})]}),x&&e.jsx(E.div,{initial:{height:0,opacity:0}
1,animate:{height:"auto",opacity:1},className:"border-t border-gray-100 p-4",children:e.jsxs("form",{onSubmit:r.handleSubmit(P),className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{htmlFor:"currentPassword",className:"text-sm text-gray-600",children:"Contraseña Actual"}),e.jsx(o,{id:"currentPassword",type:"password",className:"h-11 rounded-xl",...r.register("currentPassword")})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{htmlFor:"newPassword",className:"text-sm text-gray-600",children:"Nueva Contraseña"}),e.jsx(o,{id:"newPassword",type:"password",className:"h-11 rounded-xl",...r.register("newPassword")})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(l,{type:"button",variant:"outline",onClick:()=>g(!1),className:"flex-1 rounded-xl",children:"Cancelar"}),e.jsx(l,{type:"submit",className:"flex-1 bg-gray-900 hover:bg-gray-800 rounded-xl",disabled:j.isPending,children:"Cambiar"})]})]})})]}),!s.referredBy&&e.jsxs("div",{className:"bg-white rounded-2xl shadow-sm border border-amber-200 overflow-hidden",children:[e.jsxs("button",{onClick:()=>J(!T),className:"w-full flex items-center justify-between p-4 hover:bg-amber-50/50 transition-colors","data-testid":"button-show-link-referral",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-amber-100 flex items-center justify-center",children:e.jsx(je,{className:"h-5 w-5 text-amber-600"})}),e.jsx("span",{className:"font-medium text-gray-900 text-sm",children:"Vincular Código de Referido"})]}),e.jsx(y,{className:`h-5 w-5 text-gray-400 transition-transform ${T?"rotate-90":""}`})]}),T&&e.jsx(E.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},className:"border-t border-amber-200 p-4 bg-amber-50/30",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{placeholder:"Ej: PAULAA1500",value:w,onChange:a=>{Q(a.target.value.toUpperCase()),v(""),C(null)},className:"font-mono h-11 rounded-xl","data-testid":"input-referral-code"}),e.jsx(l,{type:"button",variant:"outline",className:"rounded-xl",onClick:we,children:"Buscar"})]}),G&&e.jsx("p",{className:"text-xs text-red-500",children:G}),B&&e.jsxs("div",{className:"bg-emerald-50 border border-emerald-200 rounded-xl p-3 flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-semibold text-emerald-800",children:B.fullName}),e.jsx("p",{className:"text-xs text-gray-500",children:B.role==="supervisor"?"Supervisor":"Referidor"})]}),e.jsx(l,{size:"sm",className:"bg-emerald-600 hover:bg-emerald-700 rounded-lg",onClick:()=>I.mutate(w),disabled:I.isPending,children:I.isPending?e.jsx(V,{className:"h-4 w-4 animate-spin"}):"Vincular"})]})]})})]}),e.jsxs("div",{className:"bg-white rounded-2xl shadow-sm border border-gray-100 p-4",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-emerald-100 flex items-center justify-center",children:e.jsx(pe,{className:"h-5 w-5 text-emerald-600"})}),e.jsx("span",{className:"font-medium text-gray-900 text-sm",children:"Notificaciones"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-gray-700",children:"Email"}),e.jsx("p",{className:"text-xs text-gray-500",children:"Actualizaciones por correo"})]}),e.jsx(p,{checked:z,onCheckedChange:$})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-gray-700",children:"Push"}),e.jsx("p",{className:"text-xs text-gray-500",children:"Alertas en tiempo real"})]}),e.jsx(p,{checked:q,onCheckedChange:K})]})]})]}),Z&&e.jsxs("div",{className:"bg-white rounded-2xl shadow-sm border border-gray-100 p-4",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-emerald-100 flex items-center justify-center",children:e.jsx(fe,{className:"h-5 w-5 text-emerald-600"})}),e.jsx("span",{className:"font-medium text-gray-900 text-sm",children:"Seguridad"})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-gray-700",children:"Inicio con biometría"}),e.jsx("p",{className:"text-xs text-gray-500",children:"Entra con Face ID / huella, sin tu contraseña"})]}),e.jsx(p,{checked:_,disabled:se,onCheckedChange:te,"data-testid":"switch-biometric-mobile"})]})]}),e.jsxs("button",{onClick:ie,className:"w-full flex items-center justify-center gap-2 p-4 bg-white rounded-2xl shadow-sm border border-gray-100 text-gray-700 hover:bg-red-50 hover:border-red-200 hover:text-red-600 transition-all","data-testid":"button-logout",disabled:L.isPending,children:[e.jsx(ge,{className:"h-5 w-5"}),e.jsx("span",{className:"font-medium text-sm",children:"Cerrar Sesión"})]})]})]})}export{Ye 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.