PageSourceSearch

https://www.hitwit.ai/assets/index-CJ2hKGjm.js

js hitwit.ai collected 2026-10-01 15:15:42 UTC 16,161 bytes, 2 lines download raw bytes

1import{x as Pe,f as Ue,u as Je,a as $e,R as S,an as Ke,b as be,r as c,k as Ve,m as Ye,a5 as j,aq as x,bl as Ze,bm as Xe,h as Se,bn as Ce,bo as fe,bp as et,bq as tt,br as Ie,bs as Re,bt as nt,bu as st,j as n,b0 as B,aF as ke,aG as it,Y as rt,G as v,B as o,bv as Ee,aB as N,Z as ot,d as m,a0 as ct,bw as G,ap as we,s as ut,A as at}from"./main-C-fwQcoT.js";/* empty css                    */import{d as lt}from"./Help-f4layk1r.js";import{d as pt}from"./Cancel-Dizyg9vk.js";import{Q as Te}from"./_hitwit-source-asset_15-qQlJf8mN.js";import{d as ve}from"./AccessTimeRounded-BXwz5Mdy.js";import{C as Ne}from"./index-m96Oq_0D.js";import{u as xt}from"./usePrevious-DKoN5903.js";import{H as mt}from"./Helmet-BxY3G0E1.js";import{u as dt}from"./useBackgrounding-CeY9xcUC.js";import{T as _t}from"./index-BabLnsm0.js";import{R as yt,a as gt}from"./RadioGroup-D92Q3wk1.js";import{F as jt}from"./FormControlLabel-DMr2kLF-.js";import{S as f}from"./Skeleton-SaD8DtO8.js";import{D as bt}from"./Dialog-DAlsJXBl.js";import{D as St}from"./DialogTitle-D3A1bFzV.js";import{D as ft}from"./DialogContent-DTVO09wk.js";import{D as It}from"./DialogContentText-CFhUcySH.js";import{D as Rt}from"./DialogActions-BfT18xOq.js";import"./index-DnugzyUQ.js";import"./index-Ct3Wyt73.js";import"./SwitchBase-5g15TP30.js";import"./FormGroup-Ds6QUyvI.js";ut(at,{shouldForwardProp:a=>a!=="open"})(({theme:a})=>({boxShadow:"inherit",backgroundColor:"transparent",zIndex:a.zIndex.drawer+1,transition:a.transitions.create(["width","margin"],{easing:a.transitions.easing.sharp,duration:a.transitions.duration.leavingScreen})}));const kt=Ye(a=>({container:{paddingTop:"80px",paddingBottom:"80px",display:"flex",alignItems:"flex-start",justifyContent:"center",minHeight:"calc(100vh)",[a.breakpoints.down("md")]:{paddingTop:"80px",paddingBottom:"80px"}},formControlLabel:{width:"100%",fontSize:"16px",fontWeight:400,".Mui-disabled":{color:"rgba(255, 255, 255, 0.5)"}},barRoot:{position:"absolute",bottom:1,right:5,left:5,height:2,borderBottomLeftRadius:4,borderBottomRightRadius:4,backgroundColor:a==null?void 0:a.palette.background.default300}})),Ae=["That's right!","You got it!","Spot on!","Bingo!"],De=["Uh oh!","Not quite!","Not really"],cn=()=>{var Y,Z,X,C,ee,te,ne;const a=Pe(),h=Ue(),A=Je(),i=$e();dt();const W=S.useRef(null),d=S.useRef(null),D=S.useRef(null),[e,z]=S.useState({}),{ready:L,send:g,message:F,disconnect:Et,setMessage:wt}=Ke(),{token:_}=be(s=>s.session),{dailyStatus:r,activeSession:Tt}=be(s=>s.app),[vt,Nt]=S.useState([]),[H,ze]=S.useState(0),[R,Le]=c.useState(0),[At,Oe]=c.useState(0),[Dt,he]=c.useState([]),[zt,Lt]=c.useState(null),[We,Q]=c.useState(!1),[q,O]=c.useState(!1),P=Ve(i.breakpoints.down("sm")),[Ot,ht]=c.useState(!1),[Fe,U]=c.useState(!0),[Me,M]=S.useState(!1),J=kt(),[I,$]=c.useState(void 0),K=(Y=h==null?void 0:h.state)==null?void 0:Y.skip;c.useEffect(()=>{setTimeout(()=>$(!0),500)},[]),c.useEffect(()=>{L&&K&&g(JSON.stringify({type:x.SKIP_REVISION,user_timezone:j(),token:_}))},[K,L]);const Be=()=>{console.log("idle",{type:x.REPORT_STRIKE,idle_seconds:G,strike:we.IDLING,token:_}),g(JSON.stringify({type:x.REPORT_STRIKE,idle_seconds:G,strike:we.IDLING,token:_})),Ge()},{getRemainingTime:Wt,reset:Ge}=Ze({onIdle:Be,timeout:1e3*G,throttle:500}),He=(s,t)=>{var l,p,u,y,b,k,E,w,T;if(s!=null&&s.summary){if(((l=s==null?void 0:s.summary)==null?void 0:l.correct_response)===t)return{color:(u=(p=i==null?void 0:i.palette)==null?void 0:p.text)==null?void 0:u.primary,fontWeight:"bold",opacity:1};if((s==null?void 0:s.user_answer)===t&&((y=s==null?void 0:s.summary)==null?void 0:y.correct_response)===t)return{color:(k=(b=i==null?void 0:i.palette)==null?void 0:b.text)==null?void 0:k.primary,fontWeight:"bold",opacity:1};if((s==null?void 0:s.user_answer)===t&&((E=s==null?void 0:s.summary)==null?void 0:E.correct_response)!==t)return{color:(T=(w=i==null?void 0:i.palette)==null?void 0:w.text)==null?void 0:T.primary,fontWeight:"bold",opacity:1}}return{opacity:s!=null&&s.summary?.5:1}},Qe=(s,t)=>{var l,p,u;if(s!=null&&s.summary){if(((l=s==null?void 0:s.summary)==null?void 0:l.correct_response)===t)return n.jsx(B,{color:"success"});if((s==null?void 0:s.user_answer)===t&&((p=s==null?void 0:s.summary)==null?void 0:p.correct_response)===t)return n.jsx(B,{color:"success"});if((s==null?void 0:s.user_answer)===t&&((u=s==null?void 0:s.summary)==null?void 0:u.correct_response)!==t)return n.jsx(pt,{color:"error"})}};c.useEffect(()=>{var s;if(L&&r){const t=Xe(r==null?void 0:r.sessions,p=>p.session_status==="In Progress"),l=Se.utc(t==null?void 0:t.scheduled_end_time).diff(Se.utc(),"seconds");t?(a(Ce(t)),(s=W==null?void 0:W.current)==null||s.start(l),(!e||e&&!e.flashcard_id)&&(q||setTimeout(()=>{g(JSON.stringify({type:x.FLASHCARD_REQUEST,user_timezone:j(),token:_})),O(!0)},1e3))):A("/summary")}
1},[L,r,e,q]),c.useEffect(()=>{var s;I===!1&&e&&R===1&&((s=d==null?void 0:d.current)==null||s.start(fe))},[I,e,R]),c.useEffect(()=>{r&&r.can_start_new_session==null&&a(et({user_timezone:j()}))},[r]),c.useEffect(()=>{var s;e!=null&&e.flashcard_id&&R!==1&&((s=d==null?void 0:d.current)==null||s.start(fe))},[e==null?void 0:e.flashcard_id,R]),c.useEffect(()=>{var s;e&&(e!=null&&e.summary)&&((s=D==null?void 0:D.current)==null||s.start(tt))},[e==null?void 0:e.summary]),c.useEffect(()=>qe(F),[F]),xt(e);const V=c.useCallback(s=>s==="correct"?Ae[Math.floor(Math.random()*Ae.length)]:De[Math.floor(Math.random()*De.length)],[e==null?void 0:e.flashcard_id]),qe=c.useCallback(s=>{var l,p;let t=null;try{t=JSON.parse(s)}catch(u){console.error(u);return}if(t){if((t==null?void 0:t.user_mode)===Ie.LEARNING&&(t==null?void 0:t.next_step)===Re.START_LEARNING){const u=t==null?void 0:t.correct_flashcards_in_session,y=(t==null?void 0:t.total_flashcards_in_session)-(t==null?void 0:t.correct_flashcards_in_session);t==null||t.total_flashcards_in_session,t==null||t.mastered_flashcards_in_session,u+y==0&&u==0?A("/learn",{state:{askContinueConfirmation:r!=null&&r.current_topic&&(r==null?void 0:r.current_topic)!=="TBD"?r==null?void 0:r.current_topic:!1}}):A("/revise-summary",{state:{summary:t}});return}else if((t==null?void 0:t.user_mode)===Ie.LEARNING&&(t==null?void 0:t.next_step)!==Re.START_LEARNING){A("/learn",{state:{askContinueConfirmation:r!=null&&r.current_topic&&(r==null?void 0:r.current_topic)!=="TBD"?r==null?void 0:r.current_topic:!1}});return}(t==null?void 0:t.type)===x.FLASHCARD_REQUEST?(O(!1),Q(!1),z(t),U(!0),Le(u=>u+1)):(t==null?void 0:t.type)===x.FLASHCARD_ANSWER&&z(u=>{var y,b;return console.log(u),(y=d==null?void 0:d.current)==null||y.stop(),{...u,summary:t==null?void 0:t.summary,responseMessage:(b=t==null?void 0:t.summary)!=null&&b.correct_flag?V("correct"):V("wrong")}}),(t==null?void 0:t.ui_action)===nt.TOPIC_MASTERY_CONGRATULATION&&st(`Congratulations! 👏🏻👏🏻 ${t==null?void 0:t.user_text}`,{position:"top-center",icon:n.jsx(B,{color:"success"}),style:{fontWeight:"bold",fontSize:"13px",borderRadius:"10px",background:(p=(l=i==null?void 0:i.palette)==null?void 0:l.background)==null?void 0:p.background,color:i.palette.text.primary}}),(t==null?void 0:t.client_reported_strikes)!==void 0&&he(t==null?void 0:t.client_reported_strikes),(t==null?void 0:t.focus_score)!==void 0&&Oe(t==null?void 0:t.focus_score),t!=null&&t.num_flashcards_in_queue&&ze(t==null?void 0:t.num_flashcards_in_queue)}},[r,F,z,e,I]);return!r||I===void 0||!e?n.jsx(ke,{sx:{zIndex:99999999,backgroundColor:(X=(Z=i==null?void 0:i.palette)==null?void 0:Z.background)==null?void 0:X.background},open:!0,children:n.jsx(it,{size:100,color:(ee=(C=i==null?void 0:i.palette)==null?void 0:C.primary)==null?void 0:ee.main})}):I?n.jsx(ke,{sx:{backgroundColor:(ne=(te=i==null?void 0:i.palette)==null?void 0:te.background)==null?void 0:ne.background,zIndex:9991,backdropFilter:"blur(24px)"},open:!!I,children:n.jsx(rt,{maxWidth:"xl",children:n.jsxs(v,{container:!0,alignItems:"center",spacing:2,children:[n.jsx(v,{item:!0,xs:12,sm:12,children:n.jsx(o,{sx:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center"},children:n.jsx("img",{src:Te,style:{width:300,height:300}})})}),n.jsxs(v,{item:!0,alignItems:"center",xs:12,sm:12,children:[n.jsx(o,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:n.jsx(_t,{text:`You have ${r==null?void 0:r.num_flashcards_in_queue} quiz questions from your past work. 
2Want to test your recall?`,start:!0,variant:"h5",textAlign:"center",sx:{textAlign:"center"}})}),n.jsx(Ee,{in:!0,timeout:750,style:{transitionDelay:"2000ms"},children:n.jsxs(o,{sx:{my:2,display:"flex",flexDirection:{sm:"row",xs:"column"},alignItems:"center",justifyContent:"center"},children:[n.jsx(N,{fullWidth:!!P,sx:{m:1},onClick:()=>{$(!1)},variant:"contained",children:"Yes, quiz me!"}),n.jsx(N,{fullWidth:!!P,onClick:()=>{g(JSON.stringify({type:x.SKIP_REVISION,user_timezone:j(),token:_}))},sx:{m:1},variant:"outlined",children:"Later"})]})})]})]})})}):n.jsxs(o,{style:{flex:1},children:[n.jsxs(mt,{children:[n.jsx("meta",{charSet:"utf-8"}),n.jsx("title",{children:"Revise"})]}),n.jsx(o,{className:J.container,children:n.jsx(v,{sx:{width:{xs:"100%",sm:"70%"}},display:"flex",justifyContent:"center",container:!0,children:n.jsxs(v,{item:!0,sx:{width:"100%"},minHeight:"auto",children:[n.jsxs(ot,{sx:{width:"100%"},direction:"row",alignItems:"center",children:[n.jsx(m,{variant:"h4",style:{flexGrow:1},children:"Warm up"}),(e==null?void 0:e.flashcard_id)&&n.jsx(N,{variant:"outlined",sx:{textTransform:"none"},onClick:()=>{g(JSON.stringify({type:x.SKIP_REVISION,user_timezone:j(),token:_}))},children:"I'm done revising"})]}),e!=null&&e.flashcard_id?n.jsxs(o,{sx:{width:"100%"},children:[n.jsxs(o,{sx:{py:2},style:{width:"100%",position:"relative",borderRadius:"12px"},children:[n.jsxs(o,{sx:{mt:6},display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",children:[n.jsx(o,{display:"flex",flexDirection:"row",alignItems:"center",children:H?n.jsxs(m,{variant:"subtitle2",style:{},children:["Question ",R,"/",H]}):null}),e!=null&&e.summary?n.jsx(Ne,{prefix:n.jsx(ve,{sx:{mr:.5,fontSize:"16px"}}),onComplete:()=>{g(JSON.stringify({type:x.FLASHCARD_REQUEST,user_timezone:j(),token:_})),O(!0)},fontSize:14,innerRef:D}):n.jsx(Ne,{prefix:n.jsx(ve,{sx:{mr:.5,fontSize:"16px"}}),onComplete:()=>{g(JSON.stringify({type:x.FLASHCARD_ANSWER,flashcard_id:e==null?void 0:e.flashcard_id,user_response:"I dont know",user_timezone:j(),token:_}))},fontSize:14,innerRef:d})]}),n.jsx(Ee,{in:Fe,children:n.jsxs(o,{display:"flex",flexDirection:"column",alignItems:"flex-start",sx:{width:"100%",marginTop:"16px",borderRadius:"12px"},children:[n.jsx(m,{variant:"subtitle1",style:{marginBottom:"20px"},children:e==null?void 0:e.question}),n.jsxs(ct,{fullWidth:!0,component:"fieldset",style:{position:"relative"},children:[((e==null?void 0:e.user_answer)||(e==null?void 0:e.summary))&&n.jsx(o,{style:{position:"absolute",top:0,right:0,bottom:0,left:0,zIndex:2}}),n.jsx(yt,{onChange:s=>{e!=null&&e.user_answer||e!=null&&e.summary||e.summary||(z(t=>({...t,user_answer:s.target.value})),g(JSON.stringify({type:x.FLASHCARD_ANSWER,flashcard_id:e==null?void 0:e.flashcard_id,user_response:s.target.value,user_timezone:j(),token:_})))}
2,name:"radio-buttons-group",children:e==null?void 0:e.answer_choices.map(s=>{var t,l,p,u,y,b,k,E,w,T,se,ie,re,oe,ce,ue,ae,le,pe,xe,me,de,_e,ye,ge,je;return e!=null&&e.summary&&!(s===((t=e==null?void 0:e.summary)==null?void 0:t.correct_response)||!((l=e==null?void 0:e.summary)!=null&&l.correct_flag)&&s===(e==null?void 0:e.user_answer))?null:n.jsxs(o,{sx:{my:.5,padding:1,borderRadius:4,border:`1px solid ${(u=(p=i==null?void 0:i.palette)==null?void 0:p.background)==null?void 0:u.border}`,transition:"all .1s ease-in-out","&:hover":{transform:"scale(1.01)",border:`1px solid ${(b=(y=i==null?void 0:i.palette)==null?void 0:y.primary)==null?void 0:b.main}`}},children:[n.jsx(jt,{className:J.formControlLabel,control:n.jsx(gt,{color:"primary",checked:e!=null&&e.summary?!0:void 0,checkedIcon:e!=null&&e.summary?Qe(e,s):void 0}),label:s,value:s,style:{...He(e,s)}}),(e==null?void 0:e.summary)&&s===((k=e==null?void 0:e.summary)==null?void 0:k.correct_response)&&((E=e==null?void 0:e.summary)==null?void 0:E.correct_response_explanation)&&n.jsxs(o,{sx:{p:2,backgroundColor:(T=(w=i==null?void 0:i.palette)==null?void 0:w.background)==null?void 0:T.default500,borderRadius:"12px"},children:[((se=e==null?void 0:e.summary)==null?void 0:se.correct_flag)&&n.jsx(m,{variant:"body1",sx:{mb:1},style:{color:(re=(ie=i==null?void 0:i.palette)==null?void 0:ie.text)==null?void 0:re.primary},children:e==null?void 0:e.responseMessage}),n.jsx(m,{variant:"body1",style:{color:(ce=(oe=i==null?void 0:i.palette)==null?void 0:oe.text)==null?void 0:ce.primary},children:(ue=e==null?void 0:e.summary)==null?void 0:ue.correct_response_explanation})]}),(e==null?void 0:e.summary)&&!((ae=e==null?void 0:e.summary)!=null&&ae.correct_flag)&&s===(e==null?void 0:e.user_answer)&&((le=e==null?void 0:e.summary)==null?void 0:le.user_response_explanation)&&n.jsxs(o,{sx:{p:2,backgroundColor:(xe=(pe=i==null?void 0:i.palette)==null?void 0:pe.background)==null?void 0:xe.default500,borderRadius:"12px"},children:[!((me=e==null?void 0:e.summary)!=null&&me.correct_flag)&&n.jsx(m,{variant:"body1",sx:{mb:1},style:{color:(_e=(de=i==null?void 0:i.palette)==null?void 0:de.text)==null?void 0:_e.primary},children:e==null?void 0:e.responseMessage}),n.jsx(m,{variant:"body1",style:{color:(ge=(ye=i==null?void 0:i.palette)==null?void 0:ye.text)==null?void 0:ge.primary},children:(je=e==null?void 0:e.summary)==null?void 0:je.user_response_explanation})]})]},(e==null?void 0:e.flashcard_id)+s)})},e==null?void 0:e.flashcard_id)]})]})}),n.jsx(o,{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",sx:{my:1},children:e&&(e!=null&&e.summary)?n.jsxs(o,{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",style:{height:60},children:[n.jsx(N,{loading:We,variant:"contained",onClick:()=>{Q(!0),g(JSON.stringify({type:x.FLASHCARD_REQUEST,user_timezone:j(),token:_})),O(!0),U(!1)},children:"Next question"}),n.jsx(o,{})]}):n.jsx(o,{})})]}),n.jsxs(o,{onClick:()=>M(s=>!s),sx:{cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center"},children:[n.jsx(lt,{sx:{fontSize:14}}),n.jsx(m,{sx:{mt:1,ml:1,pb:1},variant:"body2",children:"Why am I seeing this?"})]})]}):n.jsx(o,{sx:{width:"100%"},children:n.jsxs(o,{sx:{mt:8},children:[n.jsx(f,{sx:{my:1},variant:"rectangular",width:"20%",height:20}),n.jsx(f,{sx:{my:1},variant:"rectangular",width:"100%",height:48}),n.jsx(f,{sx:{my:1},variant:"rectangular",width:"50%",height:48}),n.jsxs(o,{sx:{mt:4},children:[n.jsx(f,{sx:{my:1},variant:"rectangular",width:"80%",height:50}),n.jsx(f,{sx:{my:1},variant:"rectangular",width:"80%",height:50}),n.jsx(f,{sx:{my:1},variant:"rectangular",width:"80%",height:50}),n.jsx(f,{sx:{my:1},variant:"rectangular",width:"80%",height:50})]})]})})]})})}),n.jsxs(bt,{open:Me,onClose:()=>M(!1),"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[n.jsx(St,{children:n.jsx(m,{variant:"h5",children:"Why am I seeing this?"})}),n.jsxs(ft,{children:[n.jsx("img",{style:{margin:"0 auto",width:200,height:200},src:Te}),n.jsx(It,{id:"alert-dialog-description",children:n.jsxs("ul",{children:[n.jsx("li",{style:{margin:"6px 0"},children:n.jsx(m,{sx:{fontSize:"0.95rem !important",fontWeight:400,lineHeight:1.75},children:"These revision quizzes help you retain what you learned earlier"})}),n.jsx("li",{style:{margin:"6px 0"},children:n.jsx(m,{sx:{fontSize:"0.95rem !important",fontWeight:400,lineHeight:1.75},children:"Mixing up the order of the questions ensures you have to force yourself to think about it. This is called “forced recall” and helps with retention"})}),n.jsx("li",{style:{margin:"6px 0"},children:n.jsx(m,{sx:{fontSize:"0.95rem !important",fontWeight:400,lineHeight:1.75},children:"The quiz questions are repeated at different intervals – things you get wrong appear sooner. This is called “spaced repetition” and again helps with retention"})})]})})]}),n.jsx(Rt,{children:n.jsx(N,{onClick:()=>M(!1),children:"Close"})})]})]})};export{cn 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.