1void 0===Promise.withResolvers&&(Promise.withResolvers=function(){let e,t;return{promise:new Promise((s,r)=>{e=s,t=r}),resolve:e,reject:t}}),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[16366],{38090:function(e,t,s){"use strict";s.d(t,{u:function(){return A}});var r=s(67294),a=s(36289),n=s(95909),i=s(80665),l=s(83317),o=s(96362),d=s(84137),c=s(3594),u=s(58495),m=s(56817),x=Object.defineProperty,h=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable,g=(e,t,s)=>t in e?x(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,b=(e,t)=>{for(var s in t||(t={}))p.call(t,s)&&g(e,s,t[s]);if(h)for(var s of h(t))f.call(t,s)&&g(e,s,t[s]);return e};let v={xs:320,sm:380,md:440,lg:620,xl:780};var y=(0,m.k)((e,{overflow:t,size:s,centered:r,zIndex:a,fullScreen:n})=>({close:{},overlay:{display:n?"none":void 0},root:{position:"fixed",zIndex:a,top:0,left:0,right:0,bottom:0},inner:{position:"absolute",top:0,left:0,right:0,bottom:0,overflowY:"auto",padding:n?0:`${2*e.spacing.xl}px ${e.spacing.md}px`,display:"flex",justifyContent:"center",alignItems:r?"center":"flex-start"},title:{marginRight:e.spacing.md,textOverflow:"ellipsis",display:"block",wordBreak:"break-word"},modal:b({position:"relative",width:n?"100vw":e.fn.size({sizes:v,size:s}),borderRadius:n?0:void 0,outline:0,backgroundColor:"dark"===e.colorScheme?e.colors.dark[7]:e.white,marginTop:r?"auto":void 0,marginBottom:r?"auto":void 0,zIndex:1},n?{position:"absolute",top:0,left:0,right:0,bottom:0,maxHeight:"100vh",overflowY:"auto"}:{}),header:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:e.spacing.md,marginRight:-9},body:{maxHeight:"inside"===t?"calc(100vh - 185px)":null,overflowY:"inside"===t?"auto":null,wordBreak:"break-word"}})),w=s(83143),j=s(75933),N=s(7414),k=s(17577),_=s(82623),C=s(95117),E=s(34201),M=Object.defineProperty,D=Object.getOwnPropertySymbols,B=Object.prototype.hasOwnProperty,O=Object.prototype.propertyIsEnumerable,T=(e,t,s)=>t in e?M(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Z=(e,t)=>{for(var s in t||(t={}))B.call(t,s)&&T(e,s,t[s]);if(D)for(var s of D(t))O.call(t,s)&&T(e,s,t[s]);return e},P=(e,t)=>{var s={};for(var r in e)B.call(e,r)&&0>t.indexOf(r)&&(s[r]=e[r]);if(null!=e&&D)for(var r of D(e))0>t.indexOf(r)&&O.call(e,r)&&(s[r]=e[r]);return s};let S={size:"md",transitionDuration:250,overflow:"outside",padding:"lg",shadow:"lg",closeOnClickOutside:!0,closeOnEscape:!0,trapFocus:!0,withCloseButton:!0,withinPortal:!0,lockScroll:!0,withFocusReturn:!0,overlayBlur:0,zIndex:(0,c.w)("modal"),exitTransitionDuration:0};function A(e){let t=(0,u.N4)("Modal",S,e),{className:s,opened:c,title:m,onClose:x,children:h,withCloseButton:p,overlayOpacity:f,size:g,transitionDuration:b,exitTransitionDuration:v,closeButtonLabel:M,overlayColor:D,overflow:B,transition:O,padding:T,shadow:A,radius:F,id:R,classNames:I,styles:L,closeOnClickOutside:q,trapFocus:z,closeOnEscape:Q,centered:G,target:H,withinPortal:Y,zIndex:W,overlayBlur:$,transitionTimingFunction:K,fullScreen:J,unstyled:V,lockScroll:X,withFocusReturn:U}=t,ee=P(t,["className","opened","title","onClose","children","withCloseButton","overlayOpacity","size","transitionDuration","exitTransitionDuration","closeButtonLabel","overlayColor","overflow","transition","padding","shadow","radius","id","classNames","styles","closeOnClickOutside","trapFocus","closeOnEscape","centered","target","withinPortal","zIndex","overlayBlur","transitionTimingFunction","fullScreen","unstyled","lockScroll","withFocusReturn"]),et=(0,a.M)(R),es=`${et}-title`,er=`${et}-body`,{classes:ea,cx:en,theme:ei}=y({size:g,overflow:B,centered:G,zIndex:W,fullScreen:J},{unstyled:V,classNames:I,styles:L,name:"Modal"}),el=(0,n.P)(z&&c),eo=(0,r.useRef)(null),ed=(0,i.Y)(el,eo),ec="number"==typeof f?f:"dark"===ei.colorScheme?.85:.75;(0,l.P)(X&&c);let eu=e=>{!z&&"Escape"===e.key&&Q&&x()};(0,r.useEffect)(()=>{if(!z)return window.addEventListener("keydown",eu),()=>window.removeEventListener("keydown",eu)},[z]),(0,o.u)({opened:c,shouldReturnFocus:z&&U});let em=(0,r.useRef)(null);(0,d.s)("mousedown",e=>{em.current=e.target});let ex=()=>{em.current===eo.current&&q&&x()};return r.createElement(w.q,{withinPortal:Y,target:H},r.createElement(j.p,{mounted:c,duration:b,exitDuration:v,timingFunction:K,transitions:{modal:{duration:b,transition:O||(J?"fade":"pop")},overlay:{duration:b/2,transition:"fade",timingFunction:"ease"}}},e=>r.createElement(r.Fragment,null,r.createElement(N.x,Z({id:et,className:en(ea.root,s)},ee),r.createElement("div",{style:e.overlay},r.createElement(k.a,{className:ea.overlay,sx:{position:"fixed"},zIndex:0,blur:$,color:D||("dark"===ei.colorScheme?ei.colors.dark[9]:ei.black),opacity:ec,unstyled:V})),r.createElement("div",{role:"presentation",className:ea.inner,onClick:ex,onKeyDown:e=>{var t;(null==(t=e.target)?void 0:t.getAttribute("data-mantine-stop-propagation"))!=="true"&&"Escape"===e.key&&Q&&x()},ref:ed}
1,r.createElement(_.X,{className:ea.modal,shadow:A,p:T,radius:F,role:"dialog","aria-labelledby":es,"aria-describedby":er,"aria-modal":!0,tabIndex:-1,style:e.modal,unstyled:V,onClick:e=>e.stopPropagation()},(m||p)&&r.createElement("div",{className:ea.header},r.createElement(C.x,{id:es,className:ea.title},m),p&&r.createElement(E.P,{iconSize:16,onClick:x,"aria-label":M,className:ea.close})),r.createElement("div",{id:er,className:ea.body},h)))))))}A.displayName="@mantine/core/Modal"},84137:function(e,t,s){"use strict";s.d(t,{s:function(){return a}});var r=s(67294);function a(e,t,s){(0,r.useEffect)(()=>(window.addEventListener(e,t,s),()=>window.removeEventListener(e,t,s)),[e,t])}},89301:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/app",function(){return s(15335)}])},83989:function(e,t,s){"use strict";s.d(t,{Z:function(){return r}});let r=(0,s(31134).Z)("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]])},46866:function(e,t,s){"use strict";s.d(t,{Z:function(){return r}});let r=(0,s(31134).Z)("circle-play",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]])},50039:function(e,t,s){"use strict";s.d(t,{Z:function(){return r}});let r=(0,s(31134).Z)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]])},70095:function(e,t,s){"use strict";s.d(t,{Z:function(){return r}});let r=(0,s(31134).Z)("layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]])},45062:function(e,t,s){"use strict";s.d(t,{Z:function(){return r}});let r=(0,s(31134).Z)("play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]])},15335:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return G}});var r=s(85893),a=s(23287),n=s(87066),i=s(31134);let l=(0,i.Z)("compass",[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var o=s(83989),d=s(11163),c=s.n(d),u=s(67294),m=s(88767),x=s(83047);let h=(e,t)=>{var s;n.default.isAxiosError(e)&&(null===(s=e.response)||void 0===s?void 0:s.status)===401&&setTimeout(t,2500)},p=e=>h(e,()=>c().push("/sign_in"));var f=()=>{let e=(0,d.useRouter)();(0,a.TL)(),(0,a.CG)(e=>{var t;return null===(t=e.userData)||void 0===t?void 0:t.user_id});let[t,s]=(0,u.useState)(!1),{data:n,isLoading:i}=(0,m.useQuery)(["coursesv2-dashboard"],x.Hj,{onError:p}),c=null==n?void 0:n.course,{data:h}=(0,m.useQuery)({queryKey:["coursesv2-tree",null==c?void 0:c.revision],queryFn:()=>{var e;return(0,x.J$)(null!==(e=null==c?void 0:c.tree_url)&&void 0!==e?e:"")},staleTime:1/0,cacheTime:1/0,enabled:!!(null==c?void 0:c.revision),retry:!1}),f=(0,u.useMemo)(()=>{var e;return null!==(e=null==h?void 0:h.tree)&&void 0!==e?e:[]},[h]),g=(0,u.useMemo)(()=>f.find(e=>{var t;return null==e?void 0:null===(t=e.children)||void 0===t?void 0:t.find(e=>{var t;return e.id===(null==n?void 0:null===(t=n.last_touched)||void 0===t?void 0:t.node_id)})}),[f,n]),{data:b}=(0,m.useQuery)(["coursesv2-subjects"],x.kO,{onError:p}),v=(0,u.useMemo)(()=>{if(b&&n)for(let e of b.data){let t=e.sub_categories.find(e=>e.sub_category_id===n.sub_category_id);if(t)return t.thumbnail}},[b,n]);return i?(0,r.jsxs)("div",{className:"rounded-2xl border border-gray-200 bg-white p-5 shadow-sm",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-center",children:[(0,r.jsx)("div",{className:"shimmer h-[88px] w-full shrink-0 rounded-2xl lg:w-[88px]"}),(0,r.jsxs)("div",{className:"flex-1 space-y-2",children:[(0,r.jsx)("div",{className:"shimmer h-3 w-24 rounded"}),(0,r.jsx)("div",{className:"shimmer h-5 w-2/3 rounded"}),(0,r.jsx)("div",{className:"shimmer h-3 w-1/2 rounded"})]}),(0,r.jsx)("div",{className:"shimmer h-11 w-full rounded-lg lg:w-32"})]}),(0,r.jsx)("div",{className:"shimmer mt-4 h-2 w-full rounded-full"})]}):n&&g?(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(x.Nx,{dashboard:n,section:g,thumbnail:v,onClick:()=>{e.push({pathname:"/app/my_courses/lesson",query:{sub_category_id:n.sub_category_id}})}})}):(0,r.jsx)("div",{className:"rounded-2xl border border-brand-20 bg-brand-5 p-5 shadow-sm",children:(0,r.jsxs)("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-center",children:[(0,r.jsx)("div",{className:"flex h-[88px] w-full shrink-0 items-center justify-center rounded-2xl bg-gradient-to-br from-brand-20 to-brand-5 lg:w-[88px]","aria-hidden":!0,
1children:(0,r.jsx)(l,{className:"h-8 w-8 text-brand"})}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wider text-brand",children:"Today's task"}),(0,r.jsx)("h3",{className:"mt-1 text-lg font-semibold text-gray-900",children:"Pick a course to start learning"}),(0,r.jsx)("p",{className:"mt-1 text-sm text-gray-700",children:"Browse the catalogue and resume any time."})]}),(0,r.jsxs)("button",{type:"button",onClick:()=>e.push("/app/my_courses"),className:"inline-flex min-h-[44px] shrink-0 items-center justify-center gap-2 rounded-lg bg-brand px-5 py-2.5 text-sm font-semibold text-white transition hover:opacity-90 focus:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-2",children:["Explore courses",(0,r.jsx)(o.Z,{className:"h-4 w-4"})]})]})})},g=s(88057),b=s(44937),v=s(47041),y=s(81124),w=s(70309),j=s(33058);let N=(0,i.Z)("calendar-clock",[["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M17.5 17.5 16 16.3V14",key:"akvzfd"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]]);var k=()=>{var e,t;let s=(0,d.useRouter)(),i=null!==(e=(0,a.CG)(e=>{var t;return null===(t=e.userData)||void 0===t?void 0:t.user_id}))&&void 0!==e?e:null,l=async()=>{let e=await n.default.get("".concat(g._n,"/company/dashboard/widget"),{headers:{Authorization:"Bearer ".concat((0,v.getCookie)("token"))}});return 200===e.status?e.data:{}},c=["placement-prep-widget",i],{data:u,isLoading:x,isError:h}=(0,m.useQuery)(c,l,{refetchOnWindowFocus:!1,staleTime:3e5,cacheTime:6e5,retry:!1,initialData:()=>{var e;return null===(e=(0,b.Mc)(c))||void 0===e?void 0:e.data},initialDataUpdatedAt:()=>{var e;return null===(e=(0,b.Mc)(c))||void 0===e?void 0:e.savedAt},onSuccess:e=>(0,b.wF)(c,e)}),p=Math.min(100,Math.max(0,Math.round(null!==(t=null==u?void 0:u.progress)&&void 0!==t?t:0))),f=p<40?{label:"Getting there",color:"#FB7185",glow:"rgba(251, 113, 133, 0.55)"}:p<70?{label:"On track",color:"#FBBF24",glow:"rgba(251, 191, 36, 0.55)"}:{label:"Excellent",color:"#34D399",glow:"rgba(52, 211, 153, 0.55)"},k=(()=>{if(!(null==u?void 0:u.last_taken))return"Not started";try{return(0,y.Q)((0,w.D)(u.last_taken),{addSuffix:!0})}catch(e){return"Recently"}})(),_=(null==u?void 0:u.last_taken)||0!==p?"Start mock test":"Take your first mock test";if(x)return(0,r.jsxs)("div",{className:"relative h-full overflow-hidden rounded-2xl bg-gradient-to-br from-[#0B1633] via-[#1B2858] to-[#283C7A] p-5 shadow-xl",children:[(0,r.jsx)("div",{className:"shimmer mb-4 h-5 w-44 rounded bg-white/10"}),(0,r.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,r.jsx)("div",{className:"shimmer h-32 w-32 rounded-full bg-white/10"}),(0,r.jsx)("div",{className:"shimmer h-4 w-24 rounded bg-white/10"})]}),(0,r.jsx)("div",{className:"shimmer mt-6 h-14 rounded-xl bg-white/10"}),(0,r.jsx)("div",{className:"shimmer mt-4 h-11 w-full rounded-lg bg-white/10"})]});if(h)return(0,r.jsxs)("div",{className:"h-full rounded-2xl bg-gradient-to-br from-[#0B1633] to-[#1B2858] p-5 shadow-xl",children:[(0,r.jsx)("h2",{className:"mb-3 text-base font-semibold text-white",children:"Placement Readiness"}),(0,r.jsx)("p",{className:"text-sm text-blue-200",children:"Unable to load placement data."})]});let C="M ".concat(16,",").concat(86," A ").concat(64,",").concat(64," 0 0,1 ").concat(144,",").concat(86),E=64*Math.PI,M=E*(1-p/100),D=Math.PI*(1-p/100),B=80+64*Math.cos(D),O=86-64*Math.sin(D);return(0,r.jsxs)("div",{className:"relative flex h-full flex-col overflow-hidden rounded-2xl p-5 shadow-xl ring-1 ring-white/10",children:[(0,r.jsx)("div",{"aria-hidden":!0,className:"absolute inset-0 bg-gradient-to-br from-[#0B1633] via-[#152558] to-[#1F2D6A]"}),(0,r.jsx)("div",{"aria-hidden":!0,className:"pointer-events-none absolute -right-16 -top-16 h-56 w-56 rounded-full opacity-60 blur-3xl",style:{background:f.glow}}),(0,r.jsx)("div",{"aria-hidden":!0,className:"pointer-events-none absolute -left-20 -bottom-10 h-56 w-56 rounded-full bg-indigo-500/30 blur-3xl"}
1),(0,r.jsx)("div",{"aria-hidden":!0,className:"pointer-events-none absolute right-12 bottom-16 h-40 w-40 rounded-full bg-cyan-400/15 blur-3xl"}),(0,r.jsx)("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-x-0 top-0 h-px bg-gradient-to-r from-transparent via-white/30 to-transparent"}),(0,r.jsxs)("div",{className:"relative mb-3 flex items-start justify-between gap-3",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"flex h-7 w-7 items-center justify-center rounded-full bg-white/10 ring-1 ring-white/15",children:(0,r.jsx)(j.Z,{className:"h-3.5 w-3.5 text-cyan-300"})}),(0,r.jsx)("h2",{className:"text-base font-semibold text-white",children:"Placement Readiness"})]}),(0,r.jsxs)("button",{type:"button",onClick:()=>s.push("/app/placement_preparation/dashboard"),className:"inline-flex items-center gap-1 rounded-full bg-white/10 px-3 py-1 text-xs font-semibold text-blue-100 ring-1 ring-white/10 transition hover:bg-white/15 focus:outline-none focus-visible:ring-2 focus-visible:ring-cyan-300 focus-visible:ring-offset-2 focus-visible:ring-offset-[#0B1633]",children:["Details",(0,r.jsx)(o.Z,{className:"h-3 w-3"})]})]}),(0,r.jsxs)("div",{className:"relative flex flex-col items-center",children:[(0,r.jsxs)("div",{className:"relative h-[110px] w-[180px]",children:[(0,r.jsxs)("svg",{viewBox:"0 0 160 100",className:"h-full w-full","aria-hidden":!0,children:[(0,r.jsxs)("defs",{children:[(0,r.jsxs)("linearGradient",{id:"gauge-track",x1:"0",x2:"1",y1:"0",y2:"0",children:[(0,r.jsx)("stop",{offset:"0%",stopColor:"rgba(255,255,255,0.06)"}),(0,r.jsx)("stop",{offset:"50%",stopColor:"rgba(255,255,255,0.16)"}),(0,r.jsx)("stop",{offset:"100%",stopColor:"rgba(255,255,255,0.06)"})]}),(0,r.jsxs)("linearGradient",{id:"gauge-stroke",x1:"0",x2:"1",y1:"0",y2:"0",children:[(0,r.jsx)("stop",{offset:"0%",stopColor:f.color,stopOpacity:"0.7"}),(0,r.jsx)("stop",{offset:"100%",stopColor:f.color,stopOpacity:"1"})]}),(0,r.jsx)("filter",{id:"gauge-glow",x:"-50%",y:"-50%",width:"200%",height:"200%",children:(0,r.jsx)("feGaussianBlur",{stdDeviation:"3"})})]}),(0,r.jsx)("path",{d:C,fill:"none",stroke:"url(#gauge-track)",strokeWidth:13,strokeLinecap:"round"}),[0,.25,.5,.75,1].map((e,t)=>{let s=Math.PI*(1-e),a=80+53.5*Math.cos(s),n=86-53.5*Math.sin(s),i=80+57.5*Math.cos(s),l=86-57.5*Math.sin(s);return(0,r.jsx)("line",{x1:a,y1:n,x2:i,y2:l,stroke:"rgba(255,255,255,0.35)",strokeWidth:"1.5",strokeLinecap:"round"},t)}),(0,r.jsx)("path",{d:C,fill:"none",stroke:f.color,strokeWidth:19,strokeLinecap:"round",strokeDasharray:E,strokeDashoffset:M,opacity:"0.35",filter:"url(#gauge-glow)",style:{transition:"stroke-dashoffset 800ms ease-out"}}),(0,r.jsx)("path",{d:C,fill:"none",stroke:"url(#gauge-stroke)",strokeWidth:13,strokeLinecap:"round",strokeDasharray:E,strokeDashoffset:M,style:{transition:"stroke-dashoffset 800ms ease-out"}}),p>0&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("circle",{cx:B,cy:O,r:9,fill:f.color,opacity:"0.35",filter:"url(#gauge-glow)"}),(0,r.jsx)("circle",{cx:B,cy:O,r:4.5,fill:"white"}),(0,r.jsx)("circle",{cx:B,cy:O,r:2.5,fill:f.color})]})]}),(0,r.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-end pb-1",children:[(0,r.jsx)("span",{className:"text-4xl font-bold tracking-tight text-white",style:{textShadow:"0 0 12px ".concat(f.glow)},children:p}),(0,r.jsx)("span",{className:"text-[10px] font-medium uppercase tracking-widest text-blue-200/80",children:"/ 100"})]})]}),(0,r.jsxs)("span",{className:"mt-2 inline-flex items-center gap-1 rounded-full px-3 py-1 text-xs font-semibold ring-1",style:{backgroundColor:"".concat(f.color,"1A"),color:f.color,boxShadow:"0 0 12px ".concat(f.glow)},children:[(0,r.jsx)("span",{"aria-hidden":!0,className:"h-1.5 w-1.5 rounded-full",style:{backgroundColor:f.color,boxShadow:"0 0 6px ".concat(f.color)}}),f.label]})]}),(0,r.jsxs)("div",{className:"relative mt-4 flex items-center justify-center gap-2 rounded-xl bg-white/5 px-3 py-2.5 ring-1 ring-white/10 backdrop-blur-sm",children:[(0,r.jsx)(N,{className:"h-3.5 w-3.5 text-cyan-300"}),(0,r.jsx)("span",{className:"text-[9px] font-semibold uppercase tracking-wider text-blue-200/80",children:"Last attempt"}),(0,r.jsx)("span",{className:"text-sm font-bold text-white",children:k})]}),(0,r.jsxs)("button",{type:"button",onClick:()=>
1s.push("/app/placement_preparation/dashboard"),className:"group relative mt-4 inline-flex min-h-[44px] w-full items-center justify-center gap-2 overflow-hidden rounded-lg bg-gradient-to-r from-cyan-400 via-sky-400 to-indigo-500 px-5 py-2.5 text-sm font-semibold text-white shadow-lg shadow-cyan-500/30 transition hover:scale-[1.01] focus:outline-none focus-visible:ring-2 focus-visible:ring-cyan-300 focus-visible:ring-offset-2 focus-visible:ring-offset-[#0B1633]",children:[(0,r.jsx)("span",{"aria-hidden":!0,className:"absolute inset-x-0 top-0 h-px bg-white/40"}),(0,r.jsx)("span",{"aria-hidden":!0,className:"absolute inset-0 -translate-x-full bg-gradient-to-r from-transparent via-white/20 to-transparent transition-transform duration-700 group-hover:translate-x-full"}),(0,r.jsxs)("span",{className:"relative inline-flex items-center gap-2",children:[_,(0,r.jsx)(o.Z,{className:"h-4 w-4 transition-transform group-hover:translate-x-0.5"})]})]})]})},_=s(41095),C=s(15227),E=s(2553),M=s(1781);let D=[{title:"Solve a Problem",subtitle:"Coding practice",href:"/app/coding_problem",Icon:_.Z,tone:{bg:"bg-violet-50",iconBg:"bg-violet-100",iconColor:"text-violet-600"}},{title:"Mock Interview",subtitle:"AI interviewer",href:"/app/ai_interview_results",Icon:C.Z,tone:{bg:"bg-rose-50",iconBg:"bg-rose-100",iconColor:"text-rose-600"}}
1,{title:"Build Resume",subtitle:"ATS optimized",href:"/app/resume",Icon:E.Z,tone:{bg:"bg-cyan-50",iconBg:"bg-cyan-100",iconColor:"text-cyan-600"}},{title:"Join Hackathon",subtitle:"Active now",href:"/app/hackathon",Icon:M.Z,tone:{bg:"bg-amber-50",iconBg:"bg-amber-100",iconColor:"text-amber-600"}}];var B=()=>{let e=(0,d.useRouter)();return(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"mb-3 text-base font-semibold text-gray-900",children:"Quick Actions"}),(0,r.jsx)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-2 lg:grid-cols-4",children:D.map(t=>{let{Icon:s}=t;return(0,r.jsxs)("button",{type:"button",onClick:()=>e.push(t.href),className:"group flex flex-col items-start gap-3 rounded-2xl border border-gray-200 bg-white p-4 text-left shadow-sm transition hover:-translate-y-0.5 hover:border-brand-40 hover:shadow-md focus:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-2",children:[(0,r.jsx)("span",{className:"flex h-11 w-11 items-center justify-center rounded-xl ".concat(t.tone.iconBg," ").concat(t.tone.iconColor),children:(0,r.jsx)(s,{className:"h-5 w-5"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm font-semibold text-gray-900",children:t.title}),(0,r.jsx)("p",{className:"mt-0.5 text-xs text-gray-700",children:t.subtitle})]})]},t.href)})})]})};let O=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],T=e=>"".concat(e.getFullYear(),"-").concat(e.getMonth(),"-").concat(e.getDate());async function Z(){return(await n.default.get("".concat(g._n,"/student-profile/counts"),{headers:{Authorization:"Bearer ".concat((0,v.getCookie)("token"))}})).data.data}async function P(e){let t=Array.from(new Set(e.map(e=>"".concat(e.getFullYear(),"-").concat(String(e.getMonth()+1).padStart(2,"0"))))),s=await Promise.all(t.map(e=>n.default.post("".concat(g._n,"/student-profile/calender-logins"),{month:e},{headers:{Authorization:"Bearer ".concat((0,v.getCookie)("token")),"Content-Type":"application/json"}}))),r=[];return s.forEach(e=>{var t,s;(null!==(s=null===(t=e.data.data)||void 0===t?void 0:t.login_dates)&&void 0!==s?s:[]).forEach(e=>{let t=new Date(e);r.push(T(t))})}),r}let S=()=>{var e,t,s,i,l,o;let c=(0,a.CG)(e=>e.userData),x=(0,d.useRouter)(),h=(0,u.useMemo)(()=>new Date,[]),p=(0,u.useMemo)(()=>(function(e){let t=e.getDay(),s=new Date(e);return s.setDate(e.getDate()+(0===t?-6:1-t)),s.setHours(0,0,0,0),Array.from({length:7},(e,t)=>{let r=new Date(s);return r.setDate(s.getDate()+t),r})})(h),[h]),f=h.getDate(),g=h.getMonth(),b=T(p[0]),v=e=>{var t;n.default.isAxiosError(e)&&(null===(t=e.response)||void 0===t?void 0:t.status)===401&&setTimeout(()=>x.push("/sign_in"),2500)},{data:y,isLoading:w,isError:j,error:N,refetch:k}=(0,m.useQuery)({queryKey:["streak-counts"],queryFn:Z,cacheTime:864e5,staleTime:864e5,retry:!1,onError:v}),{data:_=[],isLoading:C,isError:E,error:M,refetch:D}=(0,m.useQuery)({queryKey:["calendar-logins",b],queryFn:()=>P(p),cacheTime:864e5,staleTime:864e5,retry:!1,onError:v});if(w||C)return(0,r.jsx)("div",{className:"rounded-2xl border border-gray-200 bg-white p-5 shadow-sm",children:(0,r.jsxs)("div",{className:"flex items-center justify-between gap-6",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"shimmer h-12 w-12 rounded-full"}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)("div",{className:"shimmer h-4 w-32 rounded"}),(0,r.jsx)("div",{className:"shimmer h-6 w-24 rounded"})]})]}),(0,r.jsx)("div",{className:"hidden gap-3 sm:flex",children:Array.from({length:7}).map((e,t)=>(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsx)("div",{className:"shimmer h-3 w-8 rounded"}),(0,r.jsx)("div",{className:"shimmer h-9 w-9 rounded-full"})]},t))})]})});if(j||E){let e=n.default.isAxiosError(N)&&(null===(t=N.response)||void 0===t?void 0:t.status)||n.default.isAxiosError(M)&&(null===(s=M.response)||void 0===s?void 0:s.status);return(0,r.jsx)("div",{className:"rounded-2xl border border-gray-200 bg-white p-5 shadow-sm",children:(0,r.jsxs)("div",{className:"flex flex-col items-center gap-2 py-2 text-center sm:flex-row sm:justify-between sm:text-left",children:[(0,r.jsx)("p",{className:"text-sm text-gray-600",children:401===e?"Your session has expired. Redirecting to sign inâ¦":"Couldn't load your streak. Please try again."}),401!==e&&(0,r.jsx)("button",{onClick:()=>{k(),D()},className:"text-brand shrink-0 text-sm font-semibold hover:underline",children:"Retry"})]})})}let B=null!==(i=null==y?void 0:y.curr_streak)&&void 0!==i?i:0,S=null!==(l=null==y?void 0:y.max_streak)&&void 0!==l?l:0,A=null!==(o=null==c?void 0:null===(e=c.user_name)||void 0===e?void 0:e.split(" ")[0])&&void 0!==o?o:"there";return(0,r.jsx)("div",{className:"rounded-2xl border border-gray-200 bg-white p-5 shadow-sm",children:(0,r.jsxs)("div",{className:"flex flex-col items-stretch gap-5 lg:flex-row lg:items-center lg:justify-between",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-orange-100 text-2xl",children:"\uD83D\uDD25"}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsxs)("p",{className:"truncate text-sm font-medium text-gray-700",children:["Hi ",A,"!"]}),B>0?(0,r.jsxs)("p",{className:"text-xl font-bold text-gray-900",children:[B," ",(0,r.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"day streak"})]}):(0,r.jsx)("p",{className:"text-xl font-bold text-gray-900",children:"Start a 1-day streak today"}),S>0&&(0,r.jsxs)("p",{className:"text-xs text-gray-500",children:["Best: ",S," days"]})]})]}),(0,r.jsx)("div",{role:"group","aria-label":"This week's activity",className:"hidescrollbar flex items-end justify-start gap-3 overflow-x-auto sm:justify-center lg:justify-end",children:p.map((e,t)=>{let s=e.getDate()===f&&e.getMonth()===g,a=e>h,n=!a&&_.includes(T(e));return(0,r.jsxs)("div",{className:"flex shrink-0 flex-col items-center gap-1.5",children:[(0,r.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wider ".concat(s?"text-brand":"text-gray-500"),children:O[t]}),(0,r.jsx)("span",{"aria-label":"".concat(O[t],": ").concat(a?"upcoming":n?"active":"inactive"),className:"flex h-9 w-9 items-center justify-center rounded-full text-sm font-semibold transition ".concat(n?"bg-brand text-white":s?"border-2 border-dashed border-brand text-brand":a?"border border-gray-200 text-gray-400":"border border-gray-200 bg-gray-50 text-gray-400"),children:n?(0,r.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:(0,r.jsx)("polyline",{points:"20 6 9 17 4 12"})}):(0,r.jsx)("span",{className:"text-[11px]",children:e.getDate()})})]},t)})})]})})};var A=s(32089),F=s(70095),R=s(45062),I=()=>{let e=(0,d.useRouter)(),t=(e,t)=>{var s;n.default.isAxiosError(e)&&(null===(s=e.response)||void 0===s?void 0:s.status)===401&&setTimeout(t,2500)},{data:s,isLoading:a}=(0,m.useQuery)(["coursesv2-dashboard"],x.Hj,{onError:s=>t(s,()=>e.push("/sign_in"))}),i=null==s?void 0:s.course,{data:c}=(0,m.useQuery)({queryKey:["coursesv2-tree",null==i?void 0:i.revision],queryFn:()=>{var e;return(0,x.J$)(null!==(e=null==i?void 0:i.tree_url)&&void 0!==e?e:"")},staleTime:1/0,cacheTime:1/0,enabled:!!(null==i?void 0:i.revision),retry:!1}),h=(0,u.useMemo)(()=>{var e;return null!==(e=null==c?void 0:c.tree)&&void 0!==e?e:[]},[c]),p=(0,u.useMemo)(()=>h.find(e=>{var t;return null==e?void 0:null===(t=e.children)||void 0===t?void 0:t.find(e=>{var t;return e.id===(null==s?void 0:null===(t=s.last_touched)||void 0===t?void 0:t.node_id)})}),[h,s]);if(a)return(0,r.jsxs)("div",{className:"flex h-full flex-col rounded-2xl border border-gray-200 bg-white p-5 shadow-sm",children:[(0,r.jsxs)("div",{className:"mb-4 flex items-center justify-between",children:[(0,r.jsx)("div",{className:"shimmer h-5 w-36 rounded"}),(0,r.jsx)("div",{className:"shimmer h-4 w-16 rounded"})]}),(0,r.jsx)("div",{className:"space-y-2.5",children:Array.from({length:4}).map((e,t)=>(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"shimmer h-10 w-10 shrink-0 rounded-xl"}),(0,r.jsxs)("div",{className:"flex-1 space-y-2",children:[(0,r.jsx)("div",{className:"shimmer h-4 w-3/4 rounded"}
1),(0,r.jsx)("div",{className:"shimmer h-3 w-1/2 rounded"})]})]},t))})]});if(!i||0===h.length)return(0,r.jsxs)("div",{className:"flex h-full flex-col items-start justify-between rounded-2xl border border-gray-200 bg-white p-5 shadow-sm",children:[(0,r.jsx)("h2",{className:"text-base font-semibold text-gray-900",children:"Topics in your course"}),(0,r.jsxs)("div",{className:"my-auto flex w-full flex-col items-center justify-center gap-2 py-6 text-center",children:[(0,r.jsx)("span",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-brand-10",children:(0,r.jsx)(A.Z,{className:"h-6 w-6 text-brand"})}),(0,r.jsx)("p",{className:"text-sm font-semibold text-gray-900",children:"No topics yet"}),(0,r.jsx)("p",{className:"max-w-[260px] text-xs text-gray-500",children:"Browse the catalogue and enrol to see lesson topics here."})]}),(0,r.jsxs)("button",{type:"button",onClick:()=>e.push("/app/my_courses"),className:"mt-2 inline-flex w-full min-h-[44px] items-center justify-center gap-2 rounded-lg bg-brand px-5 py-2.5 text-sm font-semibold text-white shadow-sm transition hover:opacity-90 focus:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-2",children:["Explore courses",(0,r.jsx)(o.Z,{className:"h-4 w-4"})]})]});let f=h.slice(0,3),g=Math.max(0,h.length-3),b=p?h.findIndex(e=>e.id===p.id):-1;return(0,r.jsxs)("div",{className:"flex h-full flex-col rounded-2xl border border-gray-200 bg-white p-5 shadow-sm",children:[(0,r.jsxs)("div",{className:"mb-4 flex items-start justify-between gap-3",children:[(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsxs)("h2",{className:"text-base font-semibold text-gray-900",children:["Topics in ",i.title]}),(0,r.jsxs)("p",{className:"mt-0.5 line-clamp-1 text-xs text-gray-500",children:[(0,r.jsx)(F.Z,{className:"mr-1 inline h-3 w-3 -translate-y-px"}),h.length," ",1===h.length?"topic":"topics"," \xb7 resume any time"]})]}),(0,r.jsxs)("button",{type:"button",onClick:()=>e.push({pathname:"/app/my_courses/lesson",query:{sub_category_id:s.sub_category_id}}),className:"inline-flex shrink-0 items-center gap-1 text-sm font-semibold text-brand transition hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-2",children:["View all",(0,r.jsx)(o.Z,{className:"h-3.5 w-3.5"})]})]}),(0,r.jsx)("ul",{className:"flex flex-1 flex-col gap-2",children:f.map((t,a)=>{var n,l,d,c;let u=a===b,m=null!==(d=null==t?void 0:null===(n=t.children)||void 0===n?void 0:n.length)&&void 0!==d?d:0,x=null!==(c=null==t?void 0:null===(l=t.children)||void 0===l?void 0:l.reduce((e,t)=>{var s,r;return e+Math.floor((null!==(r=null==t?void 0:null===(s=t.content)||void 0===s?void 0:s.duration_seconds)&&void 0!==r?r:0)/60)},0))&&void 0!==c?c:0;return(0,r.jsx)("li",{children:(0,r.jsxs)("button",{type:"button",onClick:()=>{var r,a;return u?e.push({pathname:"/app/my_courses/lesson",query:{sub_category_id:s.sub_category_id}}):e.push({pathname:"/app/my_courses/lesson",query:{sub_category_id:s.sub_category_id,course_id:i.course_id,node_id:null==t?void 0:null===(a=t.children)||void 0===a?void 0:null===(r=a[0])||void 0===r?void 0:r.id}})},className:"group flex w-full items-center gap-3 rounded-xl border p-2.5 text-left transition focus:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1 ".concat(u?"border-brand-40 bg-brand-5 hover:bg-brand-10":"border-transparent hover:border-gray-200 hover:bg-gray-50"),"aria-label":"Open ".concat(t.title),children:[(0,r.jsx)("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-xl text-sm font-bold ".concat(u?"bg-brand text-white":"bg-gray-100 text-gray-700 group-hover:bg-brand-10 group-hover:text-brand"),children:a+1}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,r.jsx)("p",{className:"line-clamp-1 text-sm font-semibold text-gray-900",children:t.title}),u&&(0,r.jsxs)("span",{className:"inline-flex shrink-0 items-center gap-1 rounded-full bg-brand-10 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider text-brand",children:[(0,r.jsx)(R.Z,{className:"h-2.5 w-2.5 fill-brand text-brand"}),"Current"]})]}),(0,r.jsxs)("div",{className:"mt-0.5 flex items-center gap-2 text-[11px] text-gray-500",children:[(0,r.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,r.jsx)(A.Z,{className:"h-3 w-3"}),m," ",1===m?"lesson":"lessons"]}),x>0&&(0,r.jsxs)("span",{children:["\xb7 ~",x," min"]})]})]}),(0,r.jsx)(o.Z,{className:"h-4 w-4 shrink-0 transition-transform ".concat(u?"text-brand":"text-gray-300 group-hover:translate-x-0.5 group-hover:text-brand")})]})},t.id)})}),g>0?(0,r.jsxs)("button",{type:"button",onClick:()=>e.push({pathname:"/app/my_courses/lesson",query:{sub_category_id:s.sub_category_id}}),className:"mt-3 inline-flex items-center justify-center gap-1 self-center rounded-full border border-gray-200 bg-gray-50 px-3 py-1 text-[11px] font-semibold text-gray-700 transition hover:bg-gray-100 focus:outline-none focus-visible:ring-2 focus-visible:ring-brand",children:["+",g," more ",1===g?"topic":"topics"]}):h.length<3?(0,r.jsxs)("button",{type:"button",onClick:()=>e.push("/app/my_courses"),className:"mt-auto flex items-center gap-3 rounded-xl border border-dashed border-brand-30 bg-brand-5 p-3 text-left transition hover:bg-brand-10 focus:outline-none focus-visible:ring-2 focus-visible:ring-brand",children:[(0,r.jsx)("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-white",children:(0,r.jsx)(l,{className:"h-5 w-5 text-brand"})}),(0,r.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,r.jsx)("span",{className:"block text-sm font-semibold text-gray-900",children:"Discover more courses"}),(0,r.jsx)("span",{className:"mt-0.5 block text-xs text-gray-700",children:"Browse the full catalogue"})]}),(0,r.jsx)(o.Z,{className:"h-4 w-4 shrink-0 text-brand"})]}):null]})},L=s(12877),q=s(73237),z=s(41248);let Q=()=>{let e=(0,z.I0)();(0,u.useEffect)(()=>{e((0,q.Iw)("Dashboard"))},[e]);let[t,s]=(0,u.useState)(!1);(0,u.useEffect)(()=>{(0,v.hasCookie)("token")&&s(!0)},[(0,v.hasCookie)("token")]);let n=(0,a.CG)(e=>e.userData),i=(0,d.useRouter)();return((0,u.useEffect)(()=>{t&&(null==n?void 0:n.role_id)!=null&&3!==n.role_id&&i.replace("/")},[n,t]),t&&n)?(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)(S,{}),(0,r.jsx)(f,{}),(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2",children:[(0,r.jsx)(k,{}),(0,r.jsx)(I,{})]}),(0,r.jsx)(B,{})]}):(0,r.jsx)("div",{className:"flex min-h-[60vh] items-center justify-center",children:(0,r.jsx)("div",{className:"rounded-xl border border-brand-20 bg-brand-5 px-6 py-10 text-center",children:(0,r.jsx)("p",{className:"text-base font-semibold text-gray-900",children:"You must be logged in to view this page"})})})};Q.getLayout=e=>(0,r.jsx)(L.Z,{children:e});var G=Q}},function(e){e.O(0,[70917,93021,24750,97083,81397,90457,11283,25623,7001,93278,16119,59100,46827,66183,67644,12877,83047,92888,49774,40179],function(){return e(e.s=89301)}),_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.