(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8814],{3562:function(e,t,r){Promise.resolve().then(r.bind(r,7655)),Promise.resolve().then(r.bind(r,2440))},9890:function(e,t,r){"use strict";r.d(t,{B:function(){return a}});let a=()=>window.RUNTIME_CONFIG||{}},618:function(e,t,r){"use strict";r.d(t,{H:function(){return c}});var a=r(2265),n=r(3464),i=r(3330),s=r(5740);let o=async e=>{let{legajo:t,facultad:r}=e,a=(0,s.B)();return(await n.Z.request({url:"".concat(i.Q,"/api/v1/tipoCertificadoQR"),method:"GET",data:{legajo:t,facultad:r},headers:{Authorization:"".concat(a)}})).data.registros},d=async e=>{let{legajo:t,facultad:r,certificadoQR:a}=e,o=(0,s.B)();return(await n.Z.request({url:"".concat(i.Q,"/api/v1/certificadoQR"),method:"POST",data:{legajo:t,facultad:r,certificadoQR:a},headers:{Authorization:"".concat(o)}})).data.url};function c(e){let{legajo:t,facultad:r,token:n}=e,[i,s]=(0,a.useState)(null),[c,l]=(0,a.useState)(!0),[u,v]=(0,a.useState)(null),[p,m]=(0,a.useState)(null),[h,f]=(0,a.useState)(!1),[x,b]=(0,a.useState)(null);return(0,a.useEffect)(()=>{let e=async()=>{l(!0),v(null);try{let e=await o({legajo:t,facultad:r});s(e)}catch(e){v(e)}finally{l(!1)}};t&&r&&n&&e()},[t,r,n]),{tipos:i,loadingTipos:c,errorTipos:u,certificados:p,loadingCertificados:h,errorCertificados:x,obtenerCertificados:(0,a.useCallback)(async e=>{f(!0),b(null);try{let a=await d({legajo:t,facultad:r,certificadoQR:e});return m(a),a}catch(e){b(e)}finally{f(!1)}},[t,r,n])}}},325:function(e,t,r){"use strict";r.d(t,{z:function(){return o}});var a=JSON.parse('{"registros":[{"title":"Cursado","value":[{"cardContent":"Horarios y Aulas","cardUrl":"/estudiante/cursado-horarios"},{"cardContent":"Nota de Examenes Parciales","cardUrl":"/estudiante/cursado-examenes"},{"cardContent":"Inscripci\xf3n a Cursado","cardUrl":"/estudiante/cursado-inscripcion"}]},{"title":"Ex\xe1menes","value":[{"cardContent":"Ex\xe1menes Rendidos","cardUrl":"/estudiante/examenes-finales"},{"cardContent":"Inscripci\xf3n a Examen","cardUrl":"/estudiante/examenes-inscripcion"}]},{"title":"Estado Acad\xe9mico","value":[{"cardContent":"Estado Acad\xe9mico","cardUrl":"/estudiante/estado-academico-detalle"}]},{"title":"Plan de Estudio","value":[{"cardContent":"Materias del Plan","cardUrl":"/estudiante/plan-de-estudio"},{"cardContent":"Correlatividad para cursar","cardUrl":"/estudiante/correlativas-cursado"},{"cardContent":"Correlatividad para rendir","cardUrl":"/estudiante/correlativas-examenes"}]},{"title":"Boleto Especial Educativo","value":[{"cardContent":"Tr\xe1mite de Boleto Especial Educativo","cardUrl":"/estudiante/boleto-estudiantil"}]}]}'),n=JSON.parse('{"registros":[{"title":"Cursado","value":[{"cardContent":"Materias dictadas","cardUrl":"/docente/materias-que-dicta"}]},{"title":"Ex\xe1menes","value":[{"cardContent":"Tribunales que integra","cardUrl":"/docente/tribunales-que-integra"}]}]}'),i=r(2453);let s={[i.G7.Estudiante]:a,[i.G7.Docente]:n},o=async e=>{try{var t;return null===(t=s[e])||void 0===t?void 0:t.registros}catch(e){throw Error(e.response.data.statussalida)}}},7655:function(e,t,r){"use strict";var a=r(7437),n=r(2265),i=r(7648),s=r(325),o=r(9317),d=r(2453),c=r(3014),l=r(618),u=r(5740),v=r(9890);t.default=e=>{var t,r;let{cardTitle:p,cardContent:m,cardUrl:h}=e,[f,x]=(0,n.useState)([]),[b,k]=(0,n.useState)(!1),{user:w}=(0,c.a)(),{tipos:g,loadingTipos:C,obtenerCertificados:E}=(0,l.H)({legajo:null==w?void 0:null===(t=w.currentUser)||void 0===t?void 0:t.legajo,facultad:null==w?void 0:null===(r=w.currentUser)||void 0===r?void 0:r.facultad,token:null==w?void 0:w.token}),{NEXT_PUBLIC_BOLETO_ESTUDIANTIL:y}=(0,v.B)(),N=async()=>{k(!0),x(await (0,s.z)(d.G7.Estudiante)),k(!1)};return((0,n.useEffect)(()=>{b||f.length||N()},[b,f]),b||C)?(0,a.jsx)(o.Z,{mensaje:"Aguarde un momento. Cargando informaci\xf3n..."}):(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-7.5 sm:grid-cols-2 xl:grid-cols-3",children:[f.filter(e=>{var t;return"Boleto Especial Educativo"!==e.title||!0===y&&(0,u.K)(null==w?void 0:null===(t=w.currentUser)||void 0===t?void 0:t.facultad)}).map((e,t)=>{var r;return(0,a.jsxs)("div",{className:"rounded-sm border border-stroke bg-white shadow-default dark:border-strokedark dark:bg-boxdark",children:[(0,a.jsx)("div",{className:"border-b border-stroke p-5 px-7.5 dark:border-strokedark",children:(0,a.jsx)("h4",{className:"text-xl font-semibold text-black dark:text-white dark:hover:text-primary",children:e.title})}),(0,a.jsx)("div",{className:"py-5",children:null===(r=e.value)||void 0===r?void 0:r.map((e,t)=>(0,a.jsx)("div",{className:"px-7.5 py-1",children:(0,a.jsx)("p",{className:" hover:text-primary",children:(0,a.jsx)(i.default,{href:e.cardUrl,children:e.cardContent})})},"".concat(e.cardContent,"_").concat(t)))})]},"".concat(e.title,"_").concat(t))}),(0,a.jsxs)("div",{className:"rounded-sm border border-stroke bg-white shadow-default dark:border-strokedark dark:bg-boxdark",children:[(0,a.jsx)("div",{className:"border-b border-stroke p-5 px-7.5 dark:border-strokedark",children:(0,a.jsx)("h4",{className:"text-xl font-semibold text-black dark:text-white dark:hover:text-primary",children:"Tramites"})}),(0,a.jsx)("div",{className:"py-5",children:null==g?void 0:g.map((e,t)=>(0,a.jsx)("div",{className:"px-7.5 py-1",children:(0,a.jsx)("p",{className:" hover:text-primary",children:(0,a.jsx)("span",{onClick:async()=>{let t=await E(e.numero_cqr);t?window.open(t,"_blank"):alert("No se pudo obtener el certificado. Intente nuevamente.")},className:"text-blue-600 hover:text-primary cursor-pointer",children:e.nombre_cer})})},"".concat(e.nombre_cer,"_").concat(t)))})]},"tramites")]})}},2440:function(e,t,r){"use strict";r.d(t,{default:function(){return u}});var a=r(7437);r(7960),r(2336),r(7337);var n=r(2265),i=r(798),s=r(4523),o=r(575),d=r(3014),c=r(9376),l=r(2453);function u(e){let{children:t}=e,[r,u]=(0,n.useState)(!1),{user:v,getUser:p,logout:m,setUser:h}=(0,d.a)(),[f,x]=(0,n.useState)("Active"),{push:b}=(0,c.useRouter)();return(0,i.Yp)({onIdle:()=>{x("Idle")},onActive:()=>{x("Active")},timeout:3e5,throttle:500}),(0,n.useEffect)(()=>{"Idle"===f&&v&&(m(),b("/"))},[v,m,f,b]),(0,n.useEffect)(()=>{p()||v||b("/")}),(0,n.useEffect)(()=>{v&&(v.currentUser.role!==l.G7.Estudiante&&window.location.pathname.includes("estudiante")?(0,c.redirect)("/docente/menu-principal"):v.currentUser.role!==l.G7.Docente&&window.location.pathname.includes(l.G7.Docente.toLowerCase())&&(0,c.redirect)("/estudiante/menu-principal"))},[b,v]),(0,a.jsx)(o.V.Provider,{value:{user:v,setUser:h},children:(0,a.jsx)("div",{className:"dark:bg-boxdark-2 dark:text-bodydark",children:(0,a.jsx)("div",{className:"h-screen",children:(0,a.jsxs)("div",{className:"relative flex flex-1 flex-col overflow-y-auto overflow-x-hidden",children:[(0,a.jsx)(s.Z,{sidebarOpen:r,setSidebarOpen:u}),(0,a.jsx)("main",{children:(0,a.jsx)("div",{className:"mx-auto max-w-screen-2xl p-4 md:p-6 2xl:p-10",children:t})})]})})})})}},4474:function(e,t,r){"use strict";r.d(t,{o:function(){return n}});class a extends Error{}function n(e,t){let r;if("string"!=typeof e)throw new a("Invalid token specified: must be a string");t||(t={});let n=!0===t.header?0:1,i=e.split(".")[n];if("string"!=typeof i)throw new a(`Invalid token specified: missing part #${n+1}`);try{r=function(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw Error("base64 string is not of the correct length")}try{var r;return r=t,decodeURIComponent(atob(r).replace(/(.)/g,(e,t)=>{let r=t.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}catch(e){return atob(t)}}(i)}catch(e){throw new a(`Invalid token specified: invalid base64 for part #${n+1} (${e.message})`)}try{return JSON.parse(r)}catch(e){throw new a(`Invalid token specified: invalid json for part #${n+1} (${e.message})`)}}a.prototype.name="InvalidTokenError"}},function(e){e.O(0,[3587,9070,4609,5947,8316,798,1320,2971,2117,1744],function(){return e(e.s=3562)}),_N_E=e.O()}]);