0xV3NOMx
Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64



Your IP : 18.119.117.77


Current Path : /proc/thread-self/root/var/www/college/static/js/
Upload File :
Current File : //proc/thread-self/root/var/www/college/static/js/392.0938aca9.chunk.js

"use strict";(self.webpackChunkcollege_portal_app=self.webpackChunkcollege_portal_app||[]).push([[392],{6440:(e,s,t)=>{t.d(s,{c:()=>o});t(9060);var n=t(456),u=t(8464),r=t(2496);const a=()=>(0,r.jsx)(u.c,{indicator:(0,r.jsx)(n.c,{style:{fontSize:30,color:"white"},spin:!0})}),o=e=>{let{text:s,onClick:t,isLoading:n}=e;return(0,r.jsx)("div",{children:n?(0,r.jsx)("div",{className:"button",style:{paddingTop:10},children:(0,r.jsx)(a,{})}):(0,r.jsx)("div",{children:(0,r.jsx)("input",{type:"submit",className:"button",value:s,onClick:t})})})}},2392:(e,s,t)=>{t.r(s),t.d(s,{default:()=>E});var n=t(9060),u=t(5320),r=t(6440),a=t(624),o=t(1560),c=t(4692),l=t(628),i=t(616),d=t(5560),m=t(2496);const p=e=>{let{submenus:s,dropdown:t,depthLevel:n}=e;n+=1;const u=n>1?"dropdown-submenu":"";return(0,m.jsx)("ul",{className:"dropdown ".concat(u," ").concat(t?"show":""),children:s.map(((e,s)=>(0,m.jsx)(v,{items:e,depthLevel:n},s)))})};var h=t(2432),x=t(5588),j=t(12);const v=e=>{let{items:s,depthLevel:t}=e;const[u,r]=(0,n.useState)(!1);let a=(0,n.useRef)();(0,n.useEffect)((()=>{const e=e=>{u&&a.current&&!a.current.contains(e.target)&&r(!1)};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e)}}),[u]);return(0,m.jsx)("li",{className:"menu-items",ref:a,onMouseEnter:()=>{r(!0)},onMouseLeave:()=>{r(!1)},onClick:()=>{u&&r(!1)},children:s.url&&s.submenu?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)("button",{type:"button","aria-haspopup":"menu","aria-expanded":u?"true":"false",onClick:()=>{r((e=>!e))},children:[(0,m.jsx)(j.Af,{children:s.title}),t>0?(0,m.jsx)(h.c,{}):(0,m.jsx)(x.c,{})]}),(0,m.jsx)(p,{depthLevel:t,submenus:s.submenu,dropdown:u})]}):!s.url&&s.submenu?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)("button",{type:"button","aria-haspopup":"menu","aria-expanded":u?"true":"false",children:[s.title,t>0?(0,m.jsx)(h.c,{}):(0,m.jsx)(x.c,{})]}),(0,m.jsx)(p,{depthLevel:t,submenus:s.submenu,dropdown:u})]}):(0,m.jsx)(j.Af,{to:s.url,children:s.title})})};var b=t(8372),f=t(3392);const w=async(e,s,t)=>{await(0,b.c)({method:"GET",url:f.G+"getCmenus&usertype="+s+"&univcode="+t,headers:{"Content-Type":"application/json"}}).then((s=>{if(0===s.data.error_code){let t=[];s.data.data.menu.map(((e,s)=>{let n={};n.title=e.title,n.url=e.url,e.submenu.length>0&&(n.submenu=e.submenu,e.submenu.map(((e,s)=>{0===e.submenu.length&&delete e.submenu}))),t.push(n)})),e({type:"MENUS",payload:t})}else e({type:"CLEAR_MENUS",payload:[]})}))},y=()=>{const e=(0,a.OY)(),s=(0,a.w1)((e=>e.AuthReducer)),t=(0,a.w1)((e=>e.MenuReducer.menus));(0,n.useEffect)((()=>{u()}),[]);const u=async()=>{await w(e,s.userData.fusertype,s.userData.funivcode)};return(0,m.jsx)("nav",{className:"desktop-nav",children:(0,m.jsx)("ul",{className:"menus",children:t.map(((e,s)=>(0,m.jsx)(v,{items:e,depthLevel:0},s)))})})},g=e=>{let{submenus:s,dropdown:t,depthLevel:n}=e;n+=1;const u=n>1?"dropdown-submenu":"";return(0,m.jsx)("ul",{className:"dropdown ".concat(u," ").concat(t?"show":""),children:s.map(((e,s)=>(0,m.jsx)(L,{items:e,depthLevel:n},s)))})},L=e=>{let{items:s,depthLevel:t,showMenu:u,setShowMenu:r}=e;const[a,o]=(0,n.useState)(!1),c=()=>{a&&o(!1),u&&r(!1)},l=e=>{e.stopPropagation(),o((e=>!e))};return(0,m.jsx)("li",{className:"menu-items",onClick:c,children:s.url&&s.submenu?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)("button",{type:"button","aria-haspopup":"menu","aria-expanded":a?"true":"false",children:[(0,m.jsx)(j.cH,{onClick:c,children:s.title}),(0,m.jsx)("div",{onClick:e=>l(e),children:a?(0,m.jsx)("span",{className:"arrow-close"}):(0,m.jsx)("span",{className:"arrow"})})]}),(0,m.jsx)(g,{depthLevel:t,submenus:s.submenu,dropdown:a})]}):!s.url&&s.submenu?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)("button",{type:"button","aria-haspopup":"menu","aria-expanded":a?"true":"false",children:[s.title," ",(0,m.jsx)("div",{onClick:e=>l(e),children:a?(0,m.jsx)("span",{className:"arrow-close"}):(0,m.jsx)("span",{className:"arrow"})})]}),(0,m.jsx)(g,{depthLevel:t,submenus:s.submenu,dropdown:a})]}):(0,m.jsx)(j.cH,{to:s.url,children:s.title})})},C=()=>{const e=(0,a.OY)(),s=(0,a.w1)((e=>e.MenuReducer.menus)),t=(0,a.w1)((e=>e.AuthReducer)),[u,r]=(0,n.useState)(!1);let o=(0,n.useRef)();(0,n.useEffect)((()=>{c();const e=e=>{u&&o.current&&!o.current.contains(e.target)&&r(!1)};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e)}}),[u]);const c=async()=>{await w(e,t.userData.fusertype,t.userData.funivcode)};return(0,m.jsxs)("nav",{className:"mobile-nav",children:[(0,m.jsx)("button",{className:"mobile-nav__menu-button",type:"button",onClick:()=>r((e=>!e)),children:"Menu"}),u&&(0,m.jsx)("ul",{className:"menus",ref:o,children:s.map(((e,s)=>(0,m.jsx)(L,{items:e,depthLevel:0,showMenu:u,setShowMenu:r},s)))})]})};var N=t(1384);const k={display:"flex",justifyContent:"center",alignItems:"center"},E=()=>{const e=(0,a.OY)(),s=(0,o.i6)(),[t,p]=(0,n.useState)(!1),[h,x]=(0,n.useState)(localStorage.getItem("logo")),v=(0,a.w1)((e=>e.AuthReducer.userData));return(0,m.jsx)("header",{children:(0,m.jsxs)("div",{className:"nav-area",children:[(0,m.jsxs)("div",{style:k,children:[(0,m.jsx)(j.Af,{to:"/",className:"logo",children:(0,m.jsx)("img",{src:h,width:50,height:50,style:{borderRadius:"8px"}})}),(0,m.jsx)("p",{style:{fontSize:"10px"},children:v.funivcode+" - "+v.funivname.toUpperCase()})]}),(0,m.jsx)(y,{}),(0,m.jsx)(C,{}),(0,m.jsxs)("div",{style:k,children:[(0,m.jsx)("p",{style:{fontSize:"10px",marginRight:"5px",width:"100px",textAlign:"justify"},children:v.fcollcode+"-"+v.fcollname}),(0,m.jsx)(c.c,{wrap:!0,size:16,children:(0,m.jsxs)(l.c,{children:[(0,m.jsx)(i.c,{size:50,icon:(0,m.jsx)(u.c,{}),onClick:()=>p(!0)}),(0,m.jsx)("p",{style:{fontSize:"10px",color:"#fff",textAlign:"center"},children:v.fuser})]})})]}),(0,m.jsx)(d.c,{title:"Profile",open:t,onClose:()=>p(!1),children:(0,m.jsx)(r.c,{text:"Logout",onClick:()=>{e((0,N.c)(s))}})})]})})}}}]);
//# sourceMappingURL=392.0938aca9.chunk.js.map