PageSourceSearch

https://www.casanare.gov.co/_next/static/chunks/pages/admin-e49daa2a34f138c8.js

js casanare.gov.co collected 2026-10-02 17:32:34 UTC 13,685 bytes, 2 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6964],{64830:function(e,l,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin",function(){return a(9839)}])},9839:function(e,l,a){"use strict";a.r(l),a.d(l,{default:function(){return Page}});var s=a(28598),n=a(82684),r=a(60071),t=a.n(r),i=a(34376),o=a(10351),d=a(64058),c=a(68051),u=a(91764),m=a(54913),x=a(91231),p=a(72167),f=a(99085),h=a(83047),g=a(9251),v=a(39421),b=a(35703),j=a(75367),w=a(74399),y=a(30173),N=a(51192),S=a(7195),C=a(13847);a(78133);var k=a(95449),P=a(50241),_=a(31798),E=a(67802),I=a(84231),Z=a(65789),L=a(67707),A=a(98044),G=a(64253);let T=y.Ry({email:y.Z_().email("Debe ser un correo v\xe1lido").required("Correo requerido"),password:y.Z_().required("Contrase\xf1a requerida"),remember:y.O7().optional()}).required();function LoginStepper(e){let{currentStep:l,steps:a}=e,getStepColor=e=>e===l||e<l?"marine":"silver",getStepBgColor=e=>e===l?"bg-blueLight":e<l?"bg-marine":"bg-concrete";return(0,s.jsx)("div",{className:"inline-flex w-full space-x-3 py-3 3xl:pb-7 3xl:pt-4",children:a.map((e,l)=>(0,s.jsxs)("div",{className:"w-full text-[10px] font-medium",children:[(0,s.jsx)("span",{className:"text-".concat(getStepColor(l)),children:e.name}),(0,s.jsx)("div",{className:"h-1.5 ".concat(getStepBgColor(l))})]},e.key))})}function LoginForm(e){var l,a;let{onShowRecoveryForm:r,temporalPasswordExternalState:t}=e,[i,o]=(0,n.useState)(0),{showLoading:d}=(0,N.XC)(),{logInConfirm:c,saveToken:u}=(0,Z.f)(),m=(0,N.ZP)(e=>e.saveDependencyId),[f]=(0,p.K_T)(),[g]=(0,p.SiG)(),{onSendCode:y}=(0,E.Z)(),[z,R]=(0,n.useState)(!1),[D,V]=(0,n.useState)(!1),[O,q]=(0,n.use
1State)(null),[F,U]=(0,n.useState)(!1),[B,K]=(0,n.useState)(null),[X,H]=(0,n.useState)(""),[M,J]=(0,n.useState)(!1),{remove:Q}=(0,N.ZP)(),[W,Y]=(0,n.useState)([]),[$,ee]=(0,n.useState)(""),[el,ea]=(0,n.useState)(I.HJ),[es,en]=(0,n.useState)(!1),{executeRecaptcha:er}=(0,b.xX)(),{state:et,setter:ei}=t,{register:eo,handleSubmit:ed,watch:ec,reset:eu,formState:em}=(0,j.cI)({reValidateMode:"onChange",resolver:(0,h.X)(T)}),{errors:ex}=em;(0,n.useEffect)(()=>{!et&&(B&&!es&&o(1),es&&o(1))},[ec("email"),ec("password"),B,es,et]),(0,n.useEffect)(()=>{et||J(!!X&&!!B&&!!O&&!es)},[X,B,O,es,et]);let login=async e=>{if(!er){(0,x.Eo)("reCAPTCHA no carg\xf3, refresca la p\xe1gina");return}d(!0);let l=await er("SignInAdmin");await f({variables:{signInAdminInput:{email:e.email,password:e.password}},context:{headers:{"x-recaptcha-token":l}},onError:e=>{d(!1);let l=e.graphQLErrors[0];(null==l?void 0:l.message)&&(null==l?void 0:l.status)==400&&V(!0)},onCompleted:l=>{let a=l.signInAdmin.token,s=l.signInAdmin.user;completeUserLogin(a,s,e.remember||!1)}})},handleGoogleSuccess=async e=>{try{let l=e.credential;if(!l)return;g({variables:{googleSigninInput:{idToken:l}},onError:e=>{d(!1);let l=e.graphQLErrors[0];(null==l?void 0:l.message)&&(null==l?void 0:l.status)==400&&V(!0)},onCompleted:e=>{let l=e.SignInWithOAuth.token,a=e.SignInWithOAuth.user;completeUserLogin(l,a,!0)}})}catch(e){(0,x.Eo)("Error al iniciar sesi\xf3n con Google")}},completeUserLogin=(e,l,a)=>{if(q(l),l.temporalPassword){localStorage.setItem("token_reset",e),K(e);let a=(null==l?void 0:l.userDependencies)||[];Y(a.map(e=>{var l,a;return{value:null==e?void 0:null===(l=e.dependency)||void 0===l?void 0:l.id,label:null===(a=e.dependency)||void 0===a?void 0:a.name}})),ei(l.temporalPassword),d(!1),eu({email:"",password:""});return}if(!0==l.emailVerification||!0==l.phoneVerification)d(!1),ee(e),!0==l.emailVerification&&!0==l.phoneVerification?V(!0):(V(!1),ea(!0==l.emailVerification?I.HJ:I.CY),d(!1),R(!0));else{if(U(l.type===p.bZj.SuperAdmin),l.type!==p.bZj.SuperAdmin){let s=(null==l?void 0:l.userDependencies)||[];if(0===s.length){en(!0),d(!1);return}Y(s.map(e=>{var l,a;return{value:null==e?void 0:null===(l=e.dependency)||void 0===l?void 0:l.id,label:null===(a=e.dependency)||void 0===a?void 0:a.name}})),u(a,e),K(e)}else u(a,e),K(e);d(!1),R(!1)}},onResendCode=async e=>{let l=await y({email:ec("email"),password:ec("password"),type:e});return l},onChooseVerificationType=async e=>{await onResendCode(e).then(l=>{var a,s;(null===(a=l.data)||void 0===a?void 0:a.signInAdmin)&&(ee(null===(s=l.data)||void 0===s?void 0:s.signInAdmin.token),V(!1),ea(e),d(!1),R(!0))})};return(0,s.jsxs)("div",{className:"flex h-full flex-col",children:[(0,s.jsx)(LoginStepper,{currentStep:i,steps:[{name:"Datos iniciales",key:"initial-data"},{name:"Dependencia",key:"dependency"}]}),0===i&&(0,s.jsxs)("form",{className:"animate-fade-in transition-all",onSubmit:function(){for(var e=arguments.length,l=Array(e),a=0;a<e;a++)l[a]=arguments[a];ed(login)(...l)},children:[(0,s.jsx)(_.Z,{title:"Correo electr\xf3nico",inputProps:eo("email"),placeholder:"[email protected]",fieldError:null===(l=ex.email)||void 0===l?void 0:l.message}),(0,s.jsx)(P.Z,{title:"Contrase\xf1a",inputProps:eo("password"),placeholder:"Ingrese aqu\xed su contrase\xf1a",fieldError:null===(a=ex.password)||void 0===a?void 0:a.message}),(0,s.jsxs)("div",{className:"inline-flex w-full items-center justify-between",children:[(0,s.jsx)(k.Z,{label:"Recu\xe9rdame",inputProps:{...eo("remember"),className:"h-4 w-4 border-2 border-marine data-[state=checked]:border-marine data-[state=checked]:border-0 data-[state=checked]:bg-marine"},labelProps:{className:"text-dimGray text-sm"}}),(0,s.jsx)("span",{className:"cursor-pointer text-sm font-medium text-marine hover:underline",onClick:r,children:"Recuperar contrase\xf1a"})]}),(0,s.jsx)(C.z,{icon:w.hdK,iconPlacement:"right",size:"small",color:"blue",className:"mt-3 w-full",children:"Continuar"}),(0,s.jsxs)("div",{className:"my-3 inline-flex w-full items-center justify-between",children:[(0,s.jsx)("div",{className:"h-[1px] w-full bg-silver"}),(0,s.jsx)("span",{className:"mx-[20px] text-sm text-tundora",children:"O"}),(0,s.jsx)("div",{className:"h-[1px] w-full bg-silver"})]}),(0,s.jsx)(CustomGoogleLoginButton,{onSuccess:e=>handleGoogleSuccess({credential:e}),onError:()=>console.error("Fallo al iniciar sesi\xf3n con Google")})]}),1===i&&(0,s.jsx)("div",{className:"flex h-full animate-fade-in flex-col justify-between transition-all",children:es?(0,s.jsx)("div",{className:"flex flex-1 flex-col items-center justify-center text-center",children:(0,s.jsxs)("div",{className:"max-w-md rounded-lg border border-red-200 bg-red-50 p-6",children:[(0,s.jsx)("div",{className:"mb-2 text-lg font-semibold text-red-600",children:"Acceso denegado"}),(0,s.jsx)("div",{className:"mb-4 text-red-700",children:"Tu usuario no tiene dependencias asignadas. Para poder acceder al sistema, es necesario que un administrador te asigne al menos una depen
1dencia. Por favor, contacta al administrador del sistema."}),(0,s.jsx)(C.z,{size:"small",color:"secondary",className:"w-full border-red-600 bg-red-600 text-white hover:bg-red-700",type:"button",onClick:()=>{en(!1),K(null),q(null),o(0),eu({email:"",password:""})},children:"Volver"})]})}):(0,s.jsxs)("div",{className:"flex h-full flex-1 flex-col justify-between",children:[(0,s.jsx)(A.y,{disabled:!B,isSuperAdmin:F,userOptions:W,userToken:null!=B?B:void 0,externalValueState:{state:X,setter:H}}),(0,s.jsxs)("div",{className:"mt-4 inline-flex w-full items-center justify-between space-x-3",children:[(0,s.jsx)(C.z,{size:"small",type:"button",variant:"ghost",icon:w.KYK,iconPlacement:"left",onClick:()=>{v.Z.remove("token"),K(null),q(null),o(0),eu({email:"",password:""})},className:"text-marine hover:bg-marine hover:text-white",children:"Atr\xe1s"}),(0,s.jsx)(C.z,{size:"small",color:"blue",className:"w-full",type:"button",disabled:!M,onClick:()=>{var e;M&&(m(X),c(null!==(e=ec("remember"))&&void 0!==e&&e,B,O))},children:"Ingresar"})]})]})}),(0,s.jsx)(S.Z,{open:z,handler:R,dismiss:{escapeKey:!1,outsidePress:!1,referencePress:!1,enabled:!1},children:(0,s.jsx)(G.Z,{verificationType:el,handleDialog:R,token:$,remember:ec("remember"),onResendCode:onResendCode})}),(0,s.jsx)(S.Z,{open:D,handler:V,dismiss:{escapeKey:!1,outsidePress:!1,referencePress:!1,enabled:!1},children:(0,s.jsx)(L.Z,{onChooseType:onChooseVerificationType,handleDialog:V})})]})}let CustomGoogleLoginButton=e=>{let{onSuccess:l,onError:a}=e,r=(0,n.useRef)(null),handleGoogleLoginSuccess=async e=>{let s=e.credential;if(!s){console.error("ID Token no recibido en la respuesta de Google."),null==a||a();return}await l(s)};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(C.z,{size:"small",type:"button",variant:"ghost",onClick:()=>{var e;let l=null===(e=r.current)||void 0===e?void 0:e.querySelector('div[role="button"]');l instanceof HTMLElement?l.click():(console.error("No se pudo encontrar el bot\xf3n de Google interno. Revisa la estructura del DOM."),null==a||a())},className:"w-full bg-white text-tundora shadow-md",children:[(0,s.jsx)("img",{src:"/google.svg",alt:"google",className:"size-[24px]"}),"Continuar con Google"]}),(0,s.jsx)("div",{style:{display:"none",position:"absolute",width:"0px",height:"0px",overflow:"hidden"},ref:r,children:(0,s.jsx)(g.kZ,{onSuccess:handleGoogleLoginSuccess,onError:()=>{console.error("Login Fallido por GoogleLogin."),null==a||a()}})})]})};var z=a(80308),R=a(44930);function NewLoginPage(){let e=(0,i.useRouter)(),{recoveryToken:l}=e.query,a=localStorage.getItem("token_reset"),{data:r}=(0,p.m03)({variables:{where:{isAdminEnabled:!0}}}),[h,g]=(0,n.useState)(!1),[v,b]=(0,n.useState)(!1),[j,w]=(0,c.Z)({loop:!0},[(0,d.Z)({delay:5e3,stopOnInteraction:!0})]),[y,N]=(0,n.useState)(0),S=(0,n.useCallback)(()=>{w&&N(w.selectedScrollSnap())},[w,N]),C=(0,n.useCallback)(e=>w&&w.scrollTo(e),[w]);(0,n.useEffect)(()=>{l&&g(!0)},[l]),(0,n.useEffect)(()=>{w&&(S(),w.on("select",S),w.on("reInit",S))},[w,S]);let[k]=(0,p.a3O)(),handleSubmitUpdatePassword=async l=>{try{await k({variables:{updatePasswordInput:{token:a,password:l.newPassword,passwordConfirm:l.newPasswordConfirm}}}),(0,x.XA)("Contrase\xf1a cambiada exitosamente"),localStorage.removeItem("token_reset"),b(!1)}catch(l){(0,x.Eo)("Error al cambiar contrase\xf1a"),e.push(u.j2),b(!1)}};return(0,s.jsxs)("section",{className:"grid h-full w-full grid-cols-[435px_1fr] items-center space-x-6 px-11 py-5 3xl:px-[130px]",style:{backgroundImage:"url('/login_bg.png')",backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat"},children:[(0,s.jsxs)("article",{className:"flex h-[575px] max-h-[575px]  w-[435px] flex-col justify-between rounded-xl border-[1px] border-blueLight bg-white px-10 pb-[18px] pt-[30px] 3xl:h-[630px] 3xl:py-[40px]",children:[(0,s.jsxs)("div",{className:"flex flex-1 flex-col space-y-2.5",children:[!h&&!v&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("p",{className:"text-2xl font-semibold text-tundora",children:["Bienvenido al portal del",(0,s.jsxs)("div",{className:"inline-flex items-end space-x-2",children:[(0,s.jsx)("span",{children:"funcionario"}),(0,s.jsx)(t(),{src:"/new_logo_gov_co.png",alt:"new_gov.co",width:83,height:27})]})]}),(0,s.jsx)("p",{className:"text-dimGray",children:"Inicia sesi\xf3n ingresando los datos solicitados"})]}),v?(0,s.jsx)(f.T,{schema:m.M2,submit:handleSubmitUpdatePassword,children:(0,s.jsx)(z.Z,{})}):(0,s.jsx)(s.Fragment,{children:h?(0,s.jsx)(R.Z,{resetStep:()=>g(!1),recoveryToken:l}):(0,s.jsx)(LoginForm,{onShowRecoveryForm:()=>g(!0),temporalPasswordExternalState:{state:v,setter:b}})})]}),(0,s.jsx)("p",{className:"mt-4 truncate text-center text-sm text-dimGray",children:"Versi\xf3n"})]}),(0,s.jsxs)("article",{className:"relative flex h-[575px] flex-1 flex-col items-center justify-center overflow-hidden rounded-xl bg-white",role:"region","aria-roledescription":"carrusel","aria-label":"Carrusel informativo",children:[(0,s.jsx)("div",{className:"embla h-full w-full",ref:j,"aria-live":"off",children:(0,s.jsx)("div",{className:"embla__container flex h-full",children:null==r?void 0:r.allCarouselSlides.map((e,l)=>{var a;return(0,s.jsx)("div",{className:"embla__slide relative flex-shrink-0 flex-grow-0 basis-full",children:(0,s.jsxs)("div",{className:"flex h-full w-full flex-col items-center justify-center gap-[18px] px-12 text-center",children:[(0,s.jsxs)("div",{className:"relative flex h-[245px] w-[540px] items-center justify-center",children:[(0,s.jsx)(t(),{src:"/grid-slide-login.png",alt:"grid slide login",fill:!0,className:"object-cover"}),(0,s.jsx)(t(),{src:(null===(a=e.imageFile)||void 0===a?void 0:a.downloadUrl)||"/placeholder.png",alt:e.title,width:480,height:245,className:"relative z-10 rounded-[12px] object-cover"})]}
1),(0,s.jsx)("div",{className:"body-text5-medium text-purpleComplement",children:"Nuevo modulo operativo"}),(0,s.jsx)("h3",{className:"body-text2-semibold text-tundora",children:e.title}),(0,s.jsx)("p",{className:"body-text5-regular max-w-md text-dimGray",children:e.description}),e.ctaText&&e.ctaUrl&&(0,s.jsx)("div",{children:(0,s.jsx)(o.Z,{onClick:()=>window.open(e.ctaUrl||"","_blank"),text:e.ctaText,className:"bg-marine hover:bg-marine hover:bg-opacity-90"})})]})},l)})})}),(0,s.jsx)("div",{className:"absolute bottom-8 left-1/2 flex -translate-x-1/2 transform space-x-3",role:"tablist","aria-label":"Diapositivas del carrusel",children:null==r?void 0:r.allCarouselSlides.map((e,l)=>(0,s.jsx)("button",{role:"tab","aria-selected":l===y,"aria-label":"Ir a diapositiva ".concat(l+1," de ").concat(r.allCarouselSlides.length),className:"h-[9px] w-[9px] rounded-full transition-all duration-300 ".concat(l===y?"!w-[28px] bg-[#3366cc] bg-opacity-30":"bg-hawkesBlue hover:bg-[#3366cc] hover:bg-opacity-30"),onClick:()=>C(l)},l))})]})]})}function Page(){return(0,s.jsx)(NewLoginPage,{})}}},function(e){e.O(0,[7920,173,5367,590,7698,1857,27,1906,4127,9774,2888,179],function(){return e(e.s=64830)}),_N_E=e.O()}]);
2//# sourceMappingURL=admin-e49daa2a34f138c8.js.map

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.