PageSourceSearch

https://hipragya.ai/assets/PhoneLiteHome-BWNaCm0b.js

js hipragya.ai collected 2026-10-05 14:35:51 UTC 7,267 bytes, 1 lines download raw bytes

1import{b as S,r,j as e,L as i,s as L,o as u,k}from"./index-CvryZg2y.js";import{R}from"./rotate-cw-CbWye4L5.js";import{F as P}from"./flame-BnX2yRQw.js";import{A as f}from"./arrow-right-CFL0g_jY.js";import{L as A}from"./layers-oHJZikrJ.js";function C(t){return(t==null?void 0:t.full_name)||(t==null?void 0:t.username)||"Learner"}function $(t){var a,n;return Number(((a=t==null?void 0:t.current_streak)==null?void 0:a.current_streak_days)??(t==null?void 0:t.current_streak_days)??((n=t==null?void 0:t.streak)==null?void 0:n.current_streak_days)??0)||0}function q(){const{user:t}=S(),[a,n]=r.useState([]),[l,j]=r.useState(null),[N,w]=r.useState(0),[v,o]=r.useState(!0),[c,x]=r.useState("");r.useEffect(()=>{if(!(t!=null&&t.id))return;let s=!1;return(async()=>{var b;o(!0),x("");try{const[g,p]=await Promise.all([k.get("/v2/content/root-nodes"),k.get(`/progress/summary/${t.id}`).catch(()=>({data:{}}))]);if(s)return;const y=Array.isArray(g.data)?g.data:[];n(y.filter(_=>_.has_access)),j(((b=p.data)==null?void 0:b.recent_activity)||null),w($(p.data))}catch{s||x("Your phone home could not be loaded. Please try again.")}finally{s||o(!1)}})(),()=>{s=!0}},[t==null?void 0:t.id]);const m=l!=null&&l.content_node_id?`/chapter/${l.content_node_id}`:null,h=r.useMemo(()=>`${a.length} ${a.length===1?"course":"courses"}`,[a.length]);return v?e.jsxs("div",{"aria-label":"Loading phone home",className:"space-y-4 py-2",children:[e.jsx("div",{className:"h-40 animate-pulse rounded-3xl bg-slate-200 dark:bg-slate-800"}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx("div",{className:"h-28 animate-pulse rounded-2xl bg-slate-200 dark:bg-slate-800"}),e.jsx("div",{className:"h-28 animate-pulse rounded-2xl bg-slate-200 dark:bg-slate-800"})]}),e.jsx("div",{className:"h-32 animate-pulse rounded-2xl bg-slate-200 dark:bg-slate-800"})]}):c?e.jsxs("div",{role:"alert",className:"rounded-3xl border border-rose-200 bg-white p-6 text-center shadow-sm dark:border-rose-900 dark:bg-slate-900",children:[e.jsx("p",{className:"text-sm font-semibold text-rose-700 dark:text-rose-300",children:c}),e.jsxs("button",{type:"button",onClick:()=>window.location.reload(),className:"mt-4 inline-flex min-h-11 items-center gap-2 rounded-xl bg-slate-950 px-4 py-2 text-sm font-bold text-white dark:bg-white dark:text-slate-950",children:[e.jsx(R,{className:"h-4 w-4","aria-hidden":"true"})," Try again"]})]}):e.jsxs("div",{className:"space-y-5",children:[e.jsxs("section",{className:"overflow-hidden rounded-3xl bg-slate-950 px-5 py-6 text-white shadow-xl shadow-slate-950/10 dark:bg-indigo-950",children:[e.jsx("p",{className:"text-xs font-bold uppercase tracking-[0.16em] text-indigo-300",children:"Phone Home"}),e.jsxs("h1",{className:"mt-2 text-3xl font-black tracking-tight",children:["Hello, ",C(t),"."]}),e.jsxs("div",{className:"mt-5 flex items-center gap-3",children:[e.jsxs("span",{className:"inline-flex items-center gap-2 rounded-2xl bg-white/10 px-3 py-2 text-sm font-bold",children:[e.jsx(P,{className:"h-4 w-4 text-amber-300","aria-hidden":"true"}),N,"-day streak"]}),e.jsx("span",{className:"text-sm text-slate-300",children:h})]}),m?e.jsxs(i,{to:m,className:"mt-5 flex min-h-14 items-center justify-between gap-4 rounded-2xl bg-white px-4 py-3 text-left text-slate-950 shadow-sm focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-indigo-300",children:[e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"block text-[10px] font-black uppercase tracking-[0.14em] text-indigo-600",children:"Continue learning"}),e.jsx("span",{className:"mt-1 block truncate text-sm font-bold",children:l.title||"Your last lesson"})]}),e.jsx(f,{className:"h-5 w-5 flex-none text-indigo-600","aria-hidden":"true"})]}):e.jsx("p",{className:"mt-5 rounded-2xl bg-white/10 px-4 py-3 text-sm text-slate-200",children:"Pick a course below to start a Bite-Sized lesson."})]}),e.jsxs("section",{"aria-labelledby":"phone-quick-actions",children:[e.jsx("h2",{id:"phone-quick-actions",className:"mb-3 text-sm font-black uppercase tracking-[0.14em] text-slate-500 dark:text-slate-400",children:"Qu
1ick practice"}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs(i,{to:"/brain-gym",className:"rounded-2xl border border-indigo-200 bg-indigo-50 p-4 text-indigo-950 shadow-sm transition-colors hover:bg-indigo-100 dark:border-indigo-900 dark:bg-indigo-950/60 dark:text-indigo-100",children:[e.jsx(L,{className:"h-6 w-6 text-indigo-600 dark:text-indigo-300","aria-hidden":"true"}),e.jsx("span",{className:"mt-4 block text-base font-black",children:"Daily Mix"}),e.jsx("span",{className:"mt-1 block text-xs leading-5 text-indigo-700 dark:text-indigo-300",children:"Today’s short reasoning set"})]}),e.jsxs(i,{to:"/flashcards",className:"rounded-2xl border border-emerald-200 bg-emerald-50 p-4 text-emerald-950 shadow-sm transition-colors hover:bg-emerald-100 dark:border-emerald-900 dark:bg-emerald-950/50 dark:text-emerald-100",children:[e.jsx(A,{className:"h-6 w-6 text-emerald-600 dark:text-emerald-300","aria-hidden":"true"}),e.jsx("span",{className:"mt-4 block text-base font-black",children:"Flashcards"}),e.jsx("span",{className:"mt-1 block text-xs leading-5 text-emerald-700 dark:text-emerald-300",children:"Review what is due"})]})]})]}),e.jsxs("section",{"aria-labelledby":"phone-courses",children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between gap-3",children:[e.jsx("h2",{id:"phone-courses",className:"text-sm font-black uppercase tracking-[0.14em] text-slate-500 dark:text-slate-400",children:"Your courses"}),e.jsx("span",{className:"text-xs font-semibold text-slate-400",children:h})]}),a.length>0?e.jsx("div",{className:"space-y-3",children:a.map(s=>{var d;return e.jsxs(i,{to:`/subject/${s.id}
1`,className:"flex min-h-20 items-center gap-4 rounded-2xl border border-slate-200 bg-white p-4 shadow-sm transition-colors hover:border-indigo-300 hover:bg-indigo-50/40 focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-indigo-100 dark:border-slate-800 dark:bg-slate-900 dark:hover:border-indigo-800",children:[e.jsx("span",{className:"flex h-11 w-11 flex-none items-center justify-center rounded-2xl bg-slate-100 text-slate-700 dark:bg-slate-800 dark:text-slate-200",children:e.jsx(u,{className:"h-5 w-5","aria-hidden":"true"})}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"block truncate text-base font-black text-slate-950 dark:text-white",children:s.title}),e.jsx("span",{className:"mt-0.5 block truncate text-xs text-slate-500 dark:text-slate-400",children:((d=s.curriculum)==null?void 0:d.display_name)||"Bite-Sized lessons"})]}),e.jsx(f,{className:"h-5 w-5 flex-none text-slate-400","aria-hidden":"true"})]},s.id)})}):e.jsxs("div",{className:"rounded-2xl border border-dashed border-slate-300 bg-white p-6 text-center dark:border-slate-700 dark:bg-slate-900",children:[e.jsx(u,{className:"mx-auto h-7 w-7 text-slate-400","aria-hidden":"true"}),e.jsx("p",{className:"mt-3 text-sm font-bold text-slate-800 dark:text-slate-100",children:"No enrolled courses yet"}),e.jsx("p",{className:"mt-1 text-xs leading-5 text-slate-500 dark:text-slate-400",children:"Course discovery and subscription management are available on a tablet or computer."})]})]})]})}export{q as default};

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.