PageSourceSearch

https://deliabarraza.com/_next/static/chunks/app/pacientes/page-3b01d6b877f6e789.js

js deliabarraza.com collected 2026-10-10 02:29:13 UTC 5,005 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[961],{2985:(e,t,l)=>{"use strict";l.d(t,{A:()=>n,AuthProvider:()=>o});var r=l(5155),a=l(2115);let s=(0,a.createContext)({patient:null,id_control:null,clave:"",token:null,expires_at:null,login:()=>{},logout:()=>{}});function o({children:e}){let[t,l]=(0,a.useState)({patient:null,id_control:null,clave:"",token:null,expires_at:null});function n(){l({patient:null,id_control:null,clave:"",token:null,expires_at:null});try{localStorage.removeItem("db_auth")}catch{}}return(0,a.useEffect)(()=>{try{let e=localStorage.getItem("db_auth");if(e){let t=JSON.parse(e);t.expires_at&&new Date(t.expires_at)<=new Date?localStorage.removeItem("db_auth"):l(t)}}catch{}},[]),(0,a.useEffect)(()=>{if(!t.expires_at||!t.patient)return;let e=new Date(t.expires_at).getTime()-Date.now();if(e<=0)return void n();let l=setTimeout(()=>n(),e);return()=>clearTimeout(l)},[t.expires_at,t.patient]),(0,r.jsx)(s.Provider,{value:{...t,login:function(e,t,r,a,s){let o={patient:e,id_control:t,clave:r,token:a,expires_at:s};l(o);try{localStorage.setItem("db_auth",JSON.stringify(o))}catch{}},logout:n},children:e})}function n(){return(0,a.useContext)(s)}},3321:(e,t,l)=>{"use strict";var r=l(4645);l.o(r,"usePathname")&&l.d(t,{usePathname:function(){return r.usePathname}}),l.o(r,"useRouter")&&l.d(t,{useRouter:function(){return r.useRouter}}),l.o(r,"useSearchParams")&&l.d(t,{useSearchParams:function(){return r.useSearchParams}})},7062:(e,t,l)=>{Promise.resolve().then(l.t.bind(l,8437,23)),Promise.resolve().then(l.bind(l,9605))},9605:(e,t,l)=>{"use strict";l.d(t,{default:()=>n});var r=l(5155),a=l(2115),s=l(3321),o=l(2985);function n(){let[e,t]=(0,a.useState)(""),[l,n]=(0,a.useState)(""),[i,c]=(0,a.useState)(!1),[u,d]=(0,a.useState)(null),{login:x}=(0,o.A)(),m=(0,s.useRouter)();async function p(t){t.preventDefault(),d(null),c(!0);try{let t=await fetch("/api/v1/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({clave:e,contra:l})}),r=await t.json();0===r.retcode&&r.patient?.first_name?(x(r.patient,r.id_control,e,r.token,r.expires_at),m.push("/pacientes/dashboard")):d(r.message||"Clave o contrase\xf1a incorrectos.")}catch{d("Error de conexi\xf3n. Intente m\xe1s tarde.")}finally{c(!1)}}return(0,r.jsxs)("div",{className:"bg-white rounded-2xl shadow-lg p-7 flex flex-col gap-5 max-w-md w-full",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"inline-block text-white text-xs font-semibold px-4 py-1.5 rounded-full mb-3",style:{backgroundColor:"#E61794"},children:"Portal Pacientes"}),(0,r.jsx)("h2",{className:"text-2xl font-bold",style:{color:"#422B3B"},children:"Iniciar Sesi\xf3n"}),(0,r.jsx)("p",{className:"text-sm mt-1",style:{color:"#565656"},children:"Ingresa tu clave y contrase\xf1a para acceder a tus resultados."})]}),(0,r.jsxs)("form",{onSubmit:p,className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,r.jsx)("label",{className:"text-sm font-semibold",style:{color:"#422B3B"},children:"Clave de paciente"}),(0,r.jsx)("input",{type:"text",value:e,onChange:e=>t(e.target.value),required:!0,autoComplete:"username",className:"w-full rounded-xl border px-4 py-2.5 text-sm outline-none transition-colors",style:{borderColor:"#E1E8ED",color:"#422B3B"},onFocus:e=>e.currentTarget.style.borderColor="#03B0AB",onBlur:e=>e.currentTarget.style.borderColor="#E1E8ED"})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,r.jsx)("label",{className:"text-sm font-semibold",style:{color:"#422B3B"},children:"Contrase\xf1a"}),(0,r.jsx)("input",{type:"password",value:l,onChange:e=>n(e.target.value),required:!0,autoComplete:"current-password",className:"w-full rounded-xl border px-4 py-2.5 text-sm outline-none transition-colors",style:{borderColor:"#E1E8ED",color:"#422B3B"},onFocus:e=>e.currentTarget.style.borderColor="#03B0AB",onBlur:e=>e.currentTarget.style.borderColor="#E1E8ED"})]}),u&&(0,r.jsxs)("div",{className:"flex items-center gap-2 text-sm px-4 py-2.5 rounded-xl",style:{backgroundColor:"#FFF0F7",color:"#E61794"},children:[(0,r.jsx)("svg",{viewBox:"0 0 24 24",className:"w-4 h-4 flex-shrink-0",fill:"currentColor",children:(0,r.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),u]}),(0,r.jsx)("button",{type:"submit",disabled:i,className:"w-full flex items-center justify-center gap-2 text-white font-semibold py-3 rounded-xl transition-opacity hover:opacity-90 disabled:opacity-60 mt-1",style:{backgroundColor:"#E61794"},children:i?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("svg",{className:"w-4 h-4 animate-spin",viewBox:"0 0 24 24",fill:"none",children:[(0,r.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,r.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v8H4z"})]}),"Verificando..."]}):"Ingresar"})]})]})}}},e=>{e.O(0,[8437,8441,3794,7358],()=>e(e.s=7062)),_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.